@matreshka/bff 0.9.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/LICENSE +32 -0
- package/README.md +35 -0
- package/dist/components/actions/server-action.d.ts +30 -0
- package/dist/components/actions/server-action.js +23 -0
- package/dist/components/aliases/button.d.ts +17 -0
- package/dist/components/aliases/button.js +54 -0
- package/dist/components/aliases/column.d.ts +11 -0
- package/dist/components/aliases/column.js +31 -0
- package/dist/components/aliases/row.d.ts +11 -0
- package/dist/components/aliases/row.js +31 -0
- package/dist/components/aliases/surface.d.ts +11 -0
- package/dist/components/aliases/surface.js +30 -0
- package/dist/components/app.d.ts +5 -0
- package/dist/components/app.js +12 -0
- package/dist/components/board.d.ts +58 -0
- package/dist/components/board.js +152 -0
- package/dist/components/boot.d.ts +2 -0
- package/dist/components/boot.js +39 -0
- package/dist/components/camera.d.ts +77 -0
- package/dist/components/camera.js +116 -0
- package/dist/components/charts/bar-chart.d.ts +14 -0
- package/dist/components/charts/bar-chart.js +27 -0
- package/dist/components/charts/chart.d.ts +69 -0
- package/dist/components/charts/chart.js +42 -0
- package/dist/components/charts/doughnut-chart.d.ts +14 -0
- package/dist/components/charts/doughnut-chart.js +27 -0
- package/dist/components/charts/line-chart.d.ts +14 -0
- package/dist/components/charts/line-chart.js +27 -0
- package/dist/components/charts/pie-chart.d.ts +14 -0
- package/dist/components/charts/pie-chart.js +27 -0
- package/dist/components/charts/polar-area-chart.d.ts +14 -0
- package/dist/components/charts/polar-area-chart.js +27 -0
- package/dist/components/charts/radar-chart.d.ts +14 -0
- package/dist/components/charts/radar-chart.js +27 -0
- package/dist/components/component.d.ts +159 -0
- package/dist/components/component.js +380 -0
- package/dist/components/container.d.ts +48 -0
- package/dist/components/container.js +80 -0
- package/dist/components/dialog.d.ts +83 -0
- package/dist/components/dialog.js +120 -0
- package/dist/components/entry-component.d.ts +34 -0
- package/dist/components/entry-component.js +74 -0
- package/dist/components/enum/password-input-kind.d.ts +1 -0
- package/dist/components/enum/password-input-kind.js +5 -0
- package/dist/components/enum/popover-position-area.d.ts +1 -0
- package/dist/components/enum/popover-position-area.js +5 -0
- package/dist/components/enum/text-input-kind.d.ts +1 -0
- package/dist/components/enum/text-input-kind.js +5 -0
- package/dist/components/enum/textarea-resize.d.ts +1 -0
- package/dist/components/enum/textarea-resize.js +5 -0
- package/dist/components/file-upload-area.d.ts +79 -0
- package/dist/components/file-upload-area.js +138 -0
- package/dist/components/for-each.d.ts +188 -0
- package/dist/components/for-each.js +362 -0
- package/dist/components/form.d.ts +62 -0
- package/dist/components/form.js +92 -0
- package/dist/components/grid.d.ts +80 -0
- package/dist/components/grid.js +79 -0
- package/dist/components/index.d.ts +55 -0
- package/dist/components/index.js +76 -0
- package/dist/components/inputs/input-component.d.ts +37 -0
- package/dist/components/inputs/input-component.js +30 -0
- package/dist/components/inputs/number-input.d.ts +45 -0
- package/dist/components/inputs/number-input.js +43 -0
- package/dist/components/inputs/password-input.d.ts +28 -0
- package/dist/components/inputs/password-input.js +42 -0
- package/dist/components/inputs/text-editor.d.ts +91 -0
- package/dist/components/inputs/text-editor.js +282 -0
- package/dist/components/inputs/text-input.d.ts +48 -0
- package/dist/components/inputs/text-input.js +40 -0
- package/dist/components/inputs/textarea.d.ts +36 -0
- package/dist/components/inputs/textarea.js +42 -0
- package/dist/components/item-list/flatten-nested-items.d.ts +11 -0
- package/dist/components/item-list/flatten-nested-items.js +100 -0
- package/dist/components/item-list/index.d.ts +5 -0
- package/dist/components/item-list/index.js +21 -0
- package/dist/components/item-list/item-list-host.d.ts +10 -0
- package/dist/components/item-list/item-list-host.js +2 -0
- package/dist/components/item-list/item-list.d.ts +68 -0
- package/dist/components/item-list/item-list.js +206 -0
- package/dist/components/item-list/list-from-ref-context.d.ts +11 -0
- package/dist/components/item-list/list-from-ref-context.js +27 -0
- package/dist/components/item-list/nested-items-host-support.d.ts +36 -0
- package/dist/components/item-list/nested-items-host-support.js +109 -0
- package/dist/components/item-list/types.d.ts +40 -0
- package/dist/components/item-list/types.js +13 -0
- package/dist/components/line.d.ts +43 -0
- package/dist/components/line.js +35 -0
- package/dist/components/map.d.ts +83 -0
- package/dist/components/map.js +146 -0
- package/dist/components/outputs/currency.d.ts +63 -0
- package/dist/components/outputs/currency.js +42 -0
- package/dist/components/outputs/datetime.d.ts +69 -0
- package/dist/components/outputs/datetime.js +49 -0
- package/dist/components/outputs/icon.d.ts +43 -0
- package/dist/components/outputs/icon.js +38 -0
- package/dist/components/outputs/iframe.d.ts +48 -0
- package/dist/components/outputs/iframe.js +44 -0
- package/dist/components/outputs/image.d.ts +73 -0
- package/dist/components/outputs/image.js +63 -0
- package/dist/components/outputs/number.d.ts +39 -0
- package/dist/components/outputs/number.js +47 -0
- package/dist/components/outputs/output-component.d.ts +58 -0
- package/dist/components/outputs/output-component.js +50 -0
- package/dist/components/outputs/progress-bar.d.ts +33 -0
- package/dist/components/outputs/progress-bar.js +42 -0
- package/dist/components/outputs/progress-spinner.d.ts +37 -0
- package/dist/components/outputs/progress-spinner.js +43 -0
- package/dist/components/outputs/qr-code.d.ts +28 -0
- package/dist/components/outputs/qr-code.js +40 -0
- package/dist/components/outputs/text.d.ts +57 -0
- package/dist/components/outputs/text.js +78 -0
- package/dist/components/outputs/vector.d.ts +47 -0
- package/dist/components/outputs/vector.js +53 -0
- package/dist/components/page.d.ts +96 -0
- package/dist/components/page.js +127 -0
- package/dist/components/popover.d.ts +63 -0
- package/dist/components/popover.js +96 -0
- package/dist/components/stack.d.ts +158 -0
- package/dist/components/stack.js +146 -0
- package/dist/components/types/component-sequence.d.ts +3 -0
- package/dist/components/types/component-sequence.js +2 -0
- package/dist/components/types/container-overlay.d.ts +3 -0
- package/dist/components/types/container-overlay.js +2 -0
- package/dist/components/utils/component-factory-shared.d.ts +4 -0
- package/dist/components/utils/component-factory-shared.js +12 -0
- package/dist/core/actions/action.d.ts +35 -0
- package/dist/core/actions/action.js +45 -0
- package/dist/core/actions/animate-component.d.ts +58 -0
- package/dist/core/actions/animate-component.js +57 -0
- package/dist/core/actions/local-action.d.ts +8 -0
- package/dist/core/actions/local-action.js +12 -0
- package/dist/core/actions/set-context-value.d.ts +18 -0
- package/dist/core/actions/set-context-value.js +32 -0
- package/dist/core/actions/set-context-values.d.ts +34 -0
- package/dist/core/actions/set-context-values.js +30 -0
- package/dist/core/actions/toggle-context-value.d.ts +21 -0
- package/dist/core/actions/toggle-context-value.js +30 -0
- package/dist/core/actions/write-text-to-clipboard.d.ts +30 -0
- package/dist/core/actions/write-text-to-clipboard.js +44 -0
- package/dist/core/boot.d.ts +2 -0
- package/dist/core/boot.js +8 -0
- package/dist/core/client-context.d.ts +7 -0
- package/dist/core/client-context.js +20 -0
- package/dist/core/client.d.ts +133 -0
- package/dist/core/client.js +292 -0
- package/dist/core/conditions/condition-group.d.ts +14 -0
- package/dist/core/conditions/condition-group.js +30 -0
- package/dist/core/conditions/condition-operand.d.ts +27 -0
- package/dist/core/conditions/condition-operand.js +15 -0
- package/dist/core/conditions/condition.d.ts +27 -0
- package/dist/core/conditions/condition.js +35 -0
- package/dist/core/conditions/context-array-includes.d.ts +32 -0
- package/dist/core/conditions/context-array-includes.js +52 -0
- package/dist/core/conditions/context-array-length.d.ts +86 -0
- package/dist/core/conditions/context-array-length.js +155 -0
- package/dist/core/conditions/context-value-defined.d.ts +12 -0
- package/dist/core/conditions/context-value-defined.js +21 -0
- package/dist/core/conditions/context-value-equal.d.ts +14 -0
- package/dist/core/conditions/context-value-equal.js +26 -0
- package/dist/core/conditions/context-value-in.d.ts +17 -0
- package/dist/core/conditions/context-value-in.js +26 -0
- package/dist/core/conditions/context-value-not-equal.d.ts +14 -0
- package/dist/core/conditions/context-value-not-equal.js +26 -0
- package/dist/core/conditions/context-value-undefined.d.ts +12 -0
- package/dist/core/conditions/context-value-undefined.js +21 -0
- package/dist/core/conditions/desktop-device.d.ts +11 -0
- package/dist/core/conditions/desktop-device.js +21 -0
- package/dist/core/conditions/groups.d.ts +71 -0
- package/dist/core/conditions/groups.js +74 -0
- package/dist/core/conditions/index.d.ts +17 -0
- package/dist/core/conditions/index.js +33 -0
- package/dist/core/conditions/mobile-device.d.ts +11 -0
- package/dist/core/conditions/mobile-device.js +21 -0
- package/dist/core/conditions/not-desktop-device.d.ts +11 -0
- package/dist/core/conditions/not-desktop-device.js +21 -0
- package/dist/core/conditions/not-mobile-device.d.ts +11 -0
- package/dist/core/conditions/not-mobile-device.js +21 -0
- package/dist/core/conditions/not-tablet-device.d.ts +11 -0
- package/dist/core/conditions/not-tablet-device.js +21 -0
- package/dist/core/conditions/tablet-device.d.ts +11 -0
- package/dist/core/conditions/tablet-device.js +21 -0
- package/dist/core/context/context-ref.d.ts +48 -0
- package/dist/core/context/context-ref.js +58 -0
- package/dist/core/context/context.d.ts +121 -0
- package/dist/core/context/context.js +353 -0
- package/dist/core/entry-context.d.ts +14 -0
- package/dist/core/entry-context.js +31 -0
- package/dist/core/gateway-connection.d.ts +29 -0
- package/dist/core/gateway-connection.js +146 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.js +46 -0
- package/dist/core/matreshka.d.ts +61 -0
- package/dist/core/matreshka.js +186 -0
- package/dist/core/router.d.ts +38 -0
- package/dist/core/router.js +116 -0
- package/dist/core/types/client-settings.d.ts +31 -0
- package/dist/core/types/client-settings.js +2 -0
- package/dist/core/types/component-instance.d.ts +25 -0
- package/dist/core/types/component-instance.js +42 -0
- package/dist/core/types/component-tree-node.d.ts +11 -0
- package/dist/core/types/component-tree-node.js +18 -0
- package/dist/core/types/componentable.d.ts +21 -0
- package/dist/core/types/componentable.js +2 -0
- package/dist/core/types/context-ref-primitive-value.d.ts +5 -0
- package/dist/core/types/context-ref-primitive-value.js +2 -0
- package/dist/core/types/message.d.ts +15 -0
- package/dist/core/types/message.js +2 -0
- package/dist/core/types/mixed-with-callbacks-array.d.ts +9 -0
- package/dist/core/types/mixed-with-callbacks-array.js +2 -0
- package/dist/core/types/native-picker-context-ref.d.ts +7 -0
- package/dist/core/types/native-picker-context-ref.js +2 -0
- package/dist/core/types/pageable.d.ts +15 -0
- package/dist/core/types/pageable.js +2 -0
- package/dist/core/types/standalone-component.d.ts +9 -0
- package/dist/core/types/standalone-component.js +2 -0
- package/dist/core/types/status-code.d.ts +319 -0
- package/dist/core/types/status-code.js +322 -0
- package/dist/core/utils/calculate-components.d.ts +13 -0
- package/dist/core/utils/calculate-components.js +40 -0
- package/dist/core/utils/color-token-id.d.ts +11 -0
- package/dist/core/utils/color-token-id.js +24 -0
- package/dist/core/utils/deep-pick.d.ts +2 -0
- package/dist/core/utils/deep-pick.js +54 -0
- package/dist/core/utils/hex-to-hsl.d.ts +14 -0
- package/dist/core/utils/hex-to-hsl.js +49 -0
- package/dist/core/utils/incoming-message-observer.d.ts +9 -0
- package/dist/core/utils/incoming-message-observer.js +23 -0
- package/dist/core/utils/merge-deep.d.ts +8 -0
- package/dist/core/utils/merge-deep.js +39 -0
- package/dist/core/utils/objects-diff.d.ts +13 -0
- package/dist/core/utils/objects-diff.js +56 -0
- package/dist/core/utils/parse-context-path.d.ts +4 -0
- package/dist/core/utils/parse-context-path.js +16 -0
- package/dist/core/utils/replace-context-keys.d.ts +12 -0
- package/dist/core/utils/replace-context-keys.js +90 -0
- package/dist/core/utils/serialize-component-tree.d.ts +9 -0
- package/dist/core/utils/serialize-component-tree.js +24 -0
- package/dist/core/utils/set-object-property.d.ts +2 -0
- package/dist/core/utils/set-object-property.js +29 -0
- package/dist/core/utils/track-created-instances.d.ts +10 -0
- package/dist/core/utils/track-created-instances.js +18 -0
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/platforms/android-platform.d.ts +6 -0
- package/dist/platforms/android-platform.js +10 -0
- package/dist/platforms/browser-platform.d.ts +79 -0
- package/dist/platforms/browser-platform.js +143 -0
- package/dist/platforms/client-platform.d.ts +6 -0
- package/dist/platforms/client-platform.js +10 -0
- package/dist/platforms/index.d.ts +12 -0
- package/dist/platforms/index.js +28 -0
- package/dist/platforms/ios-platform.d.ts +6 -0
- package/dist/platforms/ios-platform.js +10 -0
- package/dist/platforms/max-mini-app-platform.d.ts +45 -0
- package/dist/platforms/max-mini-app-platform.js +87 -0
- package/dist/platforms/mobile-platform.d.ts +117 -0
- package/dist/platforms/mobile-platform.js +316 -0
- package/dist/platforms/platform.d.ts +109 -0
- package/dist/platforms/platform.js +224 -0
- package/dist/platforms/pwa-platform.d.ts +6 -0
- package/dist/platforms/pwa-platform.js +10 -0
- package/dist/platforms/server-platform.d.ts +6 -0
- package/dist/platforms/server-platform.js +10 -0
- package/dist/platforms/telegram-mini-app-platform.d.ts +87 -0
- package/dist/platforms/telegram-mini-app-platform.js +166 -0
- package/dist/platforms/utils/client-platform.d.ts +4 -0
- package/dist/platforms/utils/client-platform.js +38 -0
- package/dist/platforms/utils/mobile-ble-services.d.ts +3 -0
- package/dist/platforms/utils/mobile-ble-services.js +31 -0
- package/dist/platforms/web-platform.d.ts +9 -0
- package/dist/platforms/web-platform.js +13 -0
- package/package.json +109 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Text = exports.TextOutputProcessor = exports.TextOutputAutolinkTarget = exports.TextOutputAutolinkScheme = void 0;
|
|
4
|
+
exports.lineBreaks = lineBreaks;
|
|
5
|
+
exports.autolink = autolink;
|
|
6
|
+
exports.text = text;
|
|
7
|
+
const text_output_autolink_scheme_1 = require("@matreshka/shared/enums/text-output-autolink-scheme");
|
|
8
|
+
const text_output_autolink_target_1 = require("@matreshka/shared/enums/text-output-autolink-target");
|
|
9
|
+
const text_output_processor_1 = require("@matreshka/shared/enums/text-output-processor");
|
|
10
|
+
const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
|
|
11
|
+
const core_1 = require("../../core");
|
|
12
|
+
const output_component_1 = require("./output-component");
|
|
13
|
+
var text_output_autolink_scheme_2 = require("@matreshka/shared/enums/text-output-autolink-scheme");
|
|
14
|
+
Object.defineProperty(exports, "TextOutputAutolinkScheme", { enumerable: true, get: function () { return text_output_autolink_scheme_2.TextOutputAutolinkScheme; } });
|
|
15
|
+
var text_output_autolink_target_2 = require("@matreshka/shared/enums/text-output-autolink-target");
|
|
16
|
+
Object.defineProperty(exports, "TextOutputAutolinkTarget", { enumerable: true, get: function () { return text_output_autolink_target_2.TextOutputAutolinkTarget; } });
|
|
17
|
+
var text_output_processor_2 = require("@matreshka/shared/enums/text-output-processor");
|
|
18
|
+
Object.defineProperty(exports, "TextOutputProcessor", { enumerable: true, get: function () { return text_output_processor_2.TextOutputProcessor; } });
|
|
19
|
+
const DEFAULT_AUTOLINK_SCHEMES = [
|
|
20
|
+
text_output_autolink_scheme_1.TextOutputAutolinkScheme.Http,
|
|
21
|
+
text_output_autolink_scheme_1.TextOutputAutolinkScheme.Https,
|
|
22
|
+
text_output_autolink_scheme_1.TextOutputAutolinkScheme.Mailto,
|
|
23
|
+
text_output_autolink_scheme_1.TextOutputAutolinkScheme.Tel,
|
|
24
|
+
];
|
|
25
|
+
function lineBreaks() {
|
|
26
|
+
return {
|
|
27
|
+
processor: text_output_processor_1.TextOutputProcessor.LineBreaks,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function autolink(options = {}) {
|
|
31
|
+
return {
|
|
32
|
+
processor: text_output_processor_1.TextOutputProcessor.Autolink,
|
|
33
|
+
target: options.target ?? text_output_autolink_target_1.TextOutputAutolinkTarget.Blank,
|
|
34
|
+
schemes: options.schemes ?? [...DEFAULT_AUTOLINK_SCHEMES],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function text(arg0, arg1) {
|
|
38
|
+
if (arg1 !== undefined) {
|
|
39
|
+
return new Text((0, output_component_1.outputValueRefToConfig)(arg1, arg0));
|
|
40
|
+
}
|
|
41
|
+
const single = arg0;
|
|
42
|
+
if (typeof single === "string" || single instanceof core_1.ContextRef) {
|
|
43
|
+
return new Text((0, output_component_1.outputValueRefToConfig)(single, {}));
|
|
44
|
+
}
|
|
45
|
+
return new Text(single);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Компонент для вывода текста.
|
|
49
|
+
*
|
|
50
|
+
* Наследуется от {@link OutputComponent}.
|
|
51
|
+
*/
|
|
52
|
+
class Text extends output_component_1.OutputComponent {
|
|
53
|
+
constructor(config) {
|
|
54
|
+
super(config);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Возвращает идентификатор типа вывода.
|
|
58
|
+
*
|
|
59
|
+
* @returns Строка "text".
|
|
60
|
+
*/
|
|
61
|
+
class() {
|
|
62
|
+
return server_component_class_1.ServerComponentClass.Text;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Инициализирует свойства компонента вывода текста.
|
|
66
|
+
*
|
|
67
|
+
* @param initValues Конфигурация инициализации.
|
|
68
|
+
* @returns Объект свойств компонента.
|
|
69
|
+
*/
|
|
70
|
+
initProperties(initValues) {
|
|
71
|
+
return {
|
|
72
|
+
...super.initProperties(initValues),
|
|
73
|
+
maxLines: initValues.maxLines,
|
|
74
|
+
processors: initValues.processors,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.Text = Text;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RatioMode } from "@matreshka/shared/enums/ratio-mode";
|
|
2
|
+
import { ServerComponentClass } from "@matreshka/shared/enums/server-component-class";
|
|
3
|
+
import { VectorMode } from "@matreshka/shared/enums/vector-mode";
|
|
4
|
+
import { type FlexItemSpec } from "@matreshka/shared/types/flex-item";
|
|
5
|
+
import { Componentable, ContextRef, StandaloneComponent } from "../../core";
|
|
6
|
+
import { CompatibleOutputRef, OutputComponent, OutputInitConfig, OutputProperties } from "./output-component";
|
|
7
|
+
export { RatioMode } from "@matreshka/shared/enums/ratio-mode";
|
|
8
|
+
/** @deprecated Use RatioMode instead */
|
|
9
|
+
export { RatioMode as ImageMode } from "@matreshka/shared/enums/ratio-mode";
|
|
10
|
+
export { VectorMode } from "@matreshka/shared/enums/vector-mode";
|
|
11
|
+
type VectorValue = string;
|
|
12
|
+
/**
|
|
13
|
+
* Свойства компонента вывода векторной графики.
|
|
14
|
+
*/
|
|
15
|
+
export type VectorProperties = {
|
|
16
|
+
mode: VectorMode;
|
|
17
|
+
flexItem?: FlexItemSpec;
|
|
18
|
+
ratio?: {
|
|
19
|
+
value: number;
|
|
20
|
+
mode: RatioMode;
|
|
21
|
+
};
|
|
22
|
+
} & OutputProperties;
|
|
23
|
+
/**
|
|
24
|
+
* Конфигурация инициализации компонента вывода векторной графики.
|
|
25
|
+
*/
|
|
26
|
+
export type VectorInitConfig<ComponentType extends Componentable = Vector, RefType extends ContextRef<any, any> = ContextRef<any, any>, PropertiesType extends VectorProperties = VectorProperties> = {
|
|
27
|
+
mode?: VectorMode;
|
|
28
|
+
flexItem?: FlexItemSpec;
|
|
29
|
+
ratio?: {
|
|
30
|
+
value: number;
|
|
31
|
+
mode: RatioMode;
|
|
32
|
+
};
|
|
33
|
+
} & OutputInitConfig<VectorValue, ComponentType, RefType, PropertiesType>;
|
|
34
|
+
type DefaultInitConfigType<RefType extends ContextRef<any, any>> = VectorInitConfig<Vector, RefType>;
|
|
35
|
+
type VectorValueOrRef<RefType extends ContextRef<any, any>> = VectorValue | CompatibleOutputRef<VectorValue, RefType>;
|
|
36
|
+
export declare function vector<RefType extends ContextRef<any, any> = ContextRef<any, any>>(options: Omit<DefaultInitConfigType<RefType>, "value" | "ref">, valueOrRef: VectorValueOrRef<RefType>): Vector<RefType>;
|
|
37
|
+
export declare function vector<RefType extends ContextRef<any, any> = ContextRef<any, any>>(valueOrRef: VectorValueOrRef<RefType>): Vector<RefType>;
|
|
38
|
+
export declare function vector<RefType extends ContextRef<any, any> = ContextRef<any, any>>(config: VectorInitConfig<Vector, RefType>): Vector<RefType>;
|
|
39
|
+
/**
|
|
40
|
+
* Компонент для вывода векторной графики (SVG).
|
|
41
|
+
*/
|
|
42
|
+
export declare class Vector<RefType extends ContextRef<any, any> = ContextRef<any, any>, PropertiesType extends VectorProperties = VectorProperties> extends OutputComponent<DefaultInitConfigType<RefType>, PropertiesType> implements StandaloneComponent {
|
|
43
|
+
constructor(config: DefaultInitConfigType<RefType>);
|
|
44
|
+
protected class(): ServerComponentClass;
|
|
45
|
+
protected initProperties(initValues: DefaultInitConfigType<RefType>): PropertiesType;
|
|
46
|
+
protected serializeRuleOverrides(overrides: Partial<PropertiesType>): Record<string, unknown>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Vector = exports.VectorMode = exports.ImageMode = exports.RatioMode = void 0;
|
|
4
|
+
exports.vector = vector;
|
|
5
|
+
const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
|
|
6
|
+
const vector_mode_1 = require("@matreshka/shared/enums/vector-mode");
|
|
7
|
+
const flex_item_1 = require("@matreshka/shared/types/flex-item");
|
|
8
|
+
const core_1 = require("../../core");
|
|
9
|
+
const output_component_1 = require("./output-component");
|
|
10
|
+
var ratio_mode_1 = require("@matreshka/shared/enums/ratio-mode");
|
|
11
|
+
Object.defineProperty(exports, "RatioMode", { enumerable: true, get: function () { return ratio_mode_1.RatioMode; } });
|
|
12
|
+
/** @deprecated Use RatioMode instead */
|
|
13
|
+
var ratio_mode_2 = require("@matreshka/shared/enums/ratio-mode");
|
|
14
|
+
Object.defineProperty(exports, "ImageMode", { enumerable: true, get: function () { return ratio_mode_2.RatioMode; } });
|
|
15
|
+
var vector_mode_2 = require("@matreshka/shared/enums/vector-mode");
|
|
16
|
+
Object.defineProperty(exports, "VectorMode", { enumerable: true, get: function () { return vector_mode_2.VectorMode; } });
|
|
17
|
+
function vector(arg0, arg1) {
|
|
18
|
+
if (arg1 !== undefined) {
|
|
19
|
+
return new Vector((0, output_component_1.outputValueRefToConfig)(arg1, arg0));
|
|
20
|
+
}
|
|
21
|
+
const single = arg0;
|
|
22
|
+
if (typeof single === "string" || single instanceof core_1.ContextRef) {
|
|
23
|
+
return new Vector((0, output_component_1.outputValueRefToConfig)(single, {}));
|
|
24
|
+
}
|
|
25
|
+
return new Vector(single);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Компонент для вывода векторной графики (SVG).
|
|
29
|
+
*/
|
|
30
|
+
class Vector extends output_component_1.OutputComponent {
|
|
31
|
+
constructor(config) {
|
|
32
|
+
super(config);
|
|
33
|
+
}
|
|
34
|
+
class() {
|
|
35
|
+
return server_component_class_1.ServerComponentClass.Vector;
|
|
36
|
+
}
|
|
37
|
+
initProperties(initValues) {
|
|
38
|
+
return {
|
|
39
|
+
...super.initProperties(initValues),
|
|
40
|
+
mode: initValues.mode ?? vector_mode_1.VectorMode.Native,
|
|
41
|
+
flexItem: (0, flex_item_1.normalizeFlexItem)(initValues.flexItem),
|
|
42
|
+
ratio: initValues.ratio,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
serializeRuleOverrides(overrides) {
|
|
46
|
+
const out = { ...overrides };
|
|
47
|
+
if (overrides.flexItem !== undefined) {
|
|
48
|
+
out.flexItem = (0, flex_item_1.normalizeFlexItem)(overrides.flexItem);
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.Vector = Vector;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ServerComponentClass } from "@matreshka/shared/enums/server-component-class";
|
|
2
|
+
import type { ComponentScrollPayload } from "@matreshka/shared/messages/client-to-bff/components/component-scroll-message";
|
|
3
|
+
import type { PageConfig } from "@matreshka/shared/types/page-config";
|
|
4
|
+
import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray, Pageable } from "../core";
|
|
5
|
+
import StatusCode from "../core/types/status-code";
|
|
6
|
+
import { ServerComponentAction } from "./component";
|
|
7
|
+
import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
|
|
8
|
+
import { Overlay } from "./types/container-overlay";
|
|
9
|
+
/**
|
|
10
|
+
* Свойства страницы.
|
|
11
|
+
*
|
|
12
|
+
* @property content Массив компонент, составляющих содержимое страницы.
|
|
13
|
+
* @property title Заголовок страницы, отображаемый в интерфейсе пользователя.
|
|
14
|
+
* @property statusCode HTTP-статус код страницы.
|
|
15
|
+
*/
|
|
16
|
+
export type PageProperties = {
|
|
17
|
+
content: ComponentTreeNode[];
|
|
18
|
+
title: string;
|
|
19
|
+
overlays?: Overlay[];
|
|
20
|
+
statusCode: StatusCode;
|
|
21
|
+
} & EntryComponentProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Конфигурация инициализации страницы.
|
|
24
|
+
*/
|
|
25
|
+
export type PageInitConfig<ComponentType extends Componentable = Page, PropertiesType extends PageProperties = PageProperties> = EntryComponentInitConfig<ComponentType, PropertiesType>;
|
|
26
|
+
type DefaultInitConfigType = PageInitConfig<Page>;
|
|
27
|
+
/**
|
|
28
|
+
* Абстрактный базовый класс страницы.
|
|
29
|
+
*/
|
|
30
|
+
export declare abstract class Page<InitConfigType extends PageInitConfig<any> = DefaultInitConfigType, PropertiesType extends PageProperties = PageProperties> extends EntryComponent<InitConfigType, PropertiesType> implements Pageable {
|
|
31
|
+
constructor();
|
|
32
|
+
/** Привязка обработчиков страницы к имени взаимодействия (как на клиенте в `interact`). */
|
|
33
|
+
private bindPageInteraction;
|
|
34
|
+
/** Привязка lifecycle entry-страницы к имени взаимодействия. */
|
|
35
|
+
private bindPageEntryInteraction;
|
|
36
|
+
/**
|
|
37
|
+
* Возвращает HTTP-статус страницы.
|
|
38
|
+
* @returns Статус страницы (по умолчанию 200 OK).
|
|
39
|
+
*/
|
|
40
|
+
statusCode(): StatusCode;
|
|
41
|
+
/**
|
|
42
|
+
* Загружает значения контекста страницы и инициализирует компоненты содержимого.
|
|
43
|
+
*/
|
|
44
|
+
boot(): Promise<unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* Заголовок страницы, отображаемый во вкладке браузера или в интерфейсе.
|
|
47
|
+
*
|
|
48
|
+
* Должен быть реализован в подклассе.
|
|
49
|
+
*/
|
|
50
|
+
protected abstract title(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Компоненты, формирующие содержимое страницы.
|
|
53
|
+
*
|
|
54
|
+
* Должен быть реализован в подклассе.
|
|
55
|
+
*
|
|
56
|
+
* @returns Массив самостоятельных компонентов.
|
|
57
|
+
*/
|
|
58
|
+
protected abstract content(): MixedWithCallbacksArray<ComponentTreeNode>;
|
|
59
|
+
/**
|
|
60
|
+
* Оверлеи страницы (рендерятся поверх содержимого страницы).
|
|
61
|
+
*
|
|
62
|
+
* По умолчанию оверлеи отсутствуют. Переопредели в наследнике, чтобы добавить
|
|
63
|
+
* overlay-элементы с якорями позиционирования.
|
|
64
|
+
*/
|
|
65
|
+
protected overlays(): Overlay[];
|
|
66
|
+
/**
|
|
67
|
+
* Обработчики прокрутки корня страницы (хост `app-page`), с троттлингом на клиенте.
|
|
68
|
+
* Переопредели в наследнике для дозагрузки списков и т.п.
|
|
69
|
+
*/
|
|
70
|
+
protected onScroll(): ServerComponentAction<Page, ComponentScrollPayload> | ServerComponentAction<Page, ComponentScrollPayload>[] | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Обработчики показа хоста страницы (`app-page`), после готовности представления на клиенте.
|
|
73
|
+
*/
|
|
74
|
+
protected onEnter(): ServerComponentAction<Page, undefined> | ServerComponentAction<Page, undefined>[] | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Обработчики скрытия / уничтожения хоста страницы на клиенте.
|
|
77
|
+
*/
|
|
78
|
+
protected onLeave(): ServerComponentAction<Page, undefined> | ServerComponentAction<Page, undefined>[] | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Инициализирует свойства страницы.
|
|
81
|
+
*
|
|
82
|
+
* @param initValues Конфигурация страницы.
|
|
83
|
+
* @returns Объект свойств страницы.
|
|
84
|
+
*/
|
|
85
|
+
protected initProperties(initValues: InitConfigType): PropertiesType;
|
|
86
|
+
/**
|
|
87
|
+
* Возвращает уникальный идентификатор класса компонента.
|
|
88
|
+
*
|
|
89
|
+
* @returns Строка "page".
|
|
90
|
+
*/
|
|
91
|
+
protected class(): ServerComponentClass;
|
|
92
|
+
protected serializeRuleOverrides(overrides: Partial<PropertiesType>): Record<string, unknown>;
|
|
93
|
+
protected serializeEntry(instance: ComponentInstance<this>): PageConfig;
|
|
94
|
+
serialize(instance?: ComponentInstance<this>): PageConfig;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Page = void 0;
|
|
7
|
+
const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
|
|
8
|
+
const status_code_1 = __importDefault(require("../core/types/status-code"));
|
|
9
|
+
const serialize_component_tree_1 = require("../core/utils/serialize-component-tree");
|
|
10
|
+
const entry_component_1 = require("./entry-component");
|
|
11
|
+
/**
|
|
12
|
+
* Абстрактный базовый класс страницы.
|
|
13
|
+
*/
|
|
14
|
+
class Page extends entry_component_1.EntryComponent {
|
|
15
|
+
constructor() {
|
|
16
|
+
// @ts-expect-error Page задаёт content в boot(), а не через конфиг конструктора Component.
|
|
17
|
+
super({});
|
|
18
|
+
this.bindPageInteraction("scroll", this.onScroll());
|
|
19
|
+
this.bindPageEntryInteraction("enter", this.onEnter());
|
|
20
|
+
this.bindPageEntryInteraction("leave", this.onLeave());
|
|
21
|
+
}
|
|
22
|
+
/** Привязка обработчиков страницы к имени взаимодействия (как на клиенте в `interact`). */
|
|
23
|
+
bindPageInteraction(event, handlers) {
|
|
24
|
+
if (handlers === undefined) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.bindActions(event, handlers);
|
|
28
|
+
}
|
|
29
|
+
/** Привязка lifecycle entry-страницы к имени взаимодействия. */
|
|
30
|
+
bindPageEntryInteraction(event, handlers) {
|
|
31
|
+
if (handlers === undefined) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.bindActions(event, handlers);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Возвращает HTTP-статус страницы.
|
|
38
|
+
* @returns Статус страницы (по умолчанию 200 OK).
|
|
39
|
+
*/
|
|
40
|
+
statusCode() {
|
|
41
|
+
return status_code_1.default.OK;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Загружает значения контекста страницы и инициализирует компоненты содержимого.
|
|
45
|
+
*/
|
|
46
|
+
async boot() {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Оверлеи страницы (рендерятся поверх содержимого страницы).
|
|
51
|
+
*
|
|
52
|
+
* По умолчанию оверлеи отсутствуют. Переопредели в наследнике, чтобы добавить
|
|
53
|
+
* overlay-элементы с якорями позиционирования.
|
|
54
|
+
*/
|
|
55
|
+
overlays() {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Обработчики прокрутки корня страницы (хост `app-page`), с троттлингом на клиенте.
|
|
60
|
+
* Переопредели в наследнике для дозагрузки списков и т.п.
|
|
61
|
+
*/
|
|
62
|
+
onScroll() {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Обработчики показа хоста страницы (`app-page`), после готовности представления на клиенте.
|
|
67
|
+
*/
|
|
68
|
+
onEnter() {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Обработчики скрытия / уничтожения хоста страницы на клиенте.
|
|
73
|
+
*/
|
|
74
|
+
onLeave() {
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Инициализирует свойства страницы.
|
|
79
|
+
*
|
|
80
|
+
* @param initValues Конфигурация страницы.
|
|
81
|
+
* @returns Объект свойств страницы.
|
|
82
|
+
*/
|
|
83
|
+
initProperties(initValues) {
|
|
84
|
+
return {
|
|
85
|
+
...super.initProperties(initValues),
|
|
86
|
+
statusCode: this.statusCode(),
|
|
87
|
+
title: this.title(),
|
|
88
|
+
content: this.content(),
|
|
89
|
+
overlays: this.overlays(),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Возвращает уникальный идентификатор класса компонента.
|
|
94
|
+
*
|
|
95
|
+
* @returns Строка "page".
|
|
96
|
+
*/
|
|
97
|
+
class() {
|
|
98
|
+
return server_component_class_1.ServerComponentClass.Page;
|
|
99
|
+
}
|
|
100
|
+
serializeRuleOverrides(overrides) {
|
|
101
|
+
const out = { ...overrides };
|
|
102
|
+
if (overrides.content !== undefined) {
|
|
103
|
+
out.content = (0, serialize_component_tree_1.serializeComponentList)(overrides.content);
|
|
104
|
+
}
|
|
105
|
+
if (overrides.overlays !== undefined) {
|
|
106
|
+
out.overlays = (0, serialize_component_tree_1.serializeOverlays)(overrides.overlays);
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
serializeEntry(instance) {
|
|
111
|
+
const result = super.serializeEntry(instance);
|
|
112
|
+
const p = this.properties;
|
|
113
|
+
return {
|
|
114
|
+
...result,
|
|
115
|
+
class: server_component_class_1.ServerComponentClass.Page,
|
|
116
|
+
properties: {
|
|
117
|
+
...p,
|
|
118
|
+
content: (0, serialize_component_tree_1.serializeComponentList)(p.content),
|
|
119
|
+
overlays: p.overlays ? (0, serialize_component_tree_1.serializeOverlays)(p.overlays) : [],
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
serialize(instance) {
|
|
124
|
+
return this.withEntrySerializationContext(instance, (resolvedInstance) => this.serializeEntry(resolvedInstance));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.Page = Page;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ServerComponentClass } from "@matreshka/shared/enums/server-component-class";
|
|
2
|
+
import type { PopoverConfig } from "@matreshka/shared/types/popover-config";
|
|
3
|
+
import { Componentable, ComponentInstance, ComponentTreeNode, MixedWithCallbacksArray } from "../core";
|
|
4
|
+
import { EntryComponent, EntryComponentInitConfig, EntryComponentProperties } from "./entry-component";
|
|
5
|
+
import { PopoverPositionArea } from "./enum/popover-position-area";
|
|
6
|
+
import { Overlay } from "./types/container-overlay";
|
|
7
|
+
export type PopoverProperties = {
|
|
8
|
+
content: ComponentTreeNode[];
|
|
9
|
+
positionArea?: PopoverPositionArea;
|
|
10
|
+
size?: number;
|
|
11
|
+
overlays?: Overlay[];
|
|
12
|
+
} & EntryComponentProperties;
|
|
13
|
+
/**
|
|
14
|
+
* Конфигурация инициализации для компонента Popover.
|
|
15
|
+
*
|
|
16
|
+
* @property content Список вложенных компонентов.
|
|
17
|
+
* @property positionArea Привязка к якорю через CSS Anchor Positioning (`position-area`).
|
|
18
|
+
* Если не задано, позиция определяется только поведением Popover API в браузере.
|
|
19
|
+
*/
|
|
20
|
+
export type PopoverInitConfig<ComponentType extends Componentable = Popover, PropertiesType extends PopoverProperties = PopoverProperties> = {
|
|
21
|
+
content: MixedWithCallbacksArray<ComponentTreeNode>;
|
|
22
|
+
positionArea?: PopoverPositionArea;
|
|
23
|
+
/**
|
|
24
|
+
* Ширина popover: значение > 1 интерпретируется в px, значение от 0 до 1
|
|
25
|
+
* передается клиенту как отношение к ширине якоря.
|
|
26
|
+
*/
|
|
27
|
+
size?: number;
|
|
28
|
+
overlays?: Overlay[];
|
|
29
|
+
} & EntryComponentInitConfig<ComponentType, PropertiesType>;
|
|
30
|
+
type DefaultInitConfigType = PopoverInitConfig<Popover>;
|
|
31
|
+
type PopoverContent = DefaultInitConfigType["content"];
|
|
32
|
+
type PopoverOptions = Omit<DefaultInitConfigType, "content">;
|
|
33
|
+
export declare function popover(content: PopoverContent): Popover;
|
|
34
|
+
export declare function popover(options: PopoverOptions, content: PopoverContent): Popover;
|
|
35
|
+
export declare function popover(config: DefaultInitConfigType): Popover;
|
|
36
|
+
/**
|
|
37
|
+
* Компонент всплывающей панели (popover), содержащей вложенные компоненты.
|
|
38
|
+
*
|
|
39
|
+
* На клиенте рендерится через [Popover API](https://doka.guide/html/popover/) (`popover="auto"`).
|
|
40
|
+
*/
|
|
41
|
+
export declare class Popover<InitConfigType extends PopoverInitConfig<any> = DefaultInitConfigType, PropertiesType extends PopoverProperties = PopoverProperties> extends EntryComponent<InitConfigType, PropertiesType> {
|
|
42
|
+
/**
|
|
43
|
+
* Возвращает уникальный идентификатор класса компонента.
|
|
44
|
+
*
|
|
45
|
+
* @returns Строка "popover".
|
|
46
|
+
*/
|
|
47
|
+
protected class(): ServerComponentClass;
|
|
48
|
+
/**
|
|
49
|
+
* Закрывает всплывающее окно, инициируя действие "close".
|
|
50
|
+
*/
|
|
51
|
+
close(instances?: ComponentInstance[]): void;
|
|
52
|
+
/**
|
|
53
|
+
* Инициализирует свойства компонента.
|
|
54
|
+
*
|
|
55
|
+
* @param initValues Объект конфигурации инициализации.
|
|
56
|
+
* @returns Объект со свойствами компонента.
|
|
57
|
+
*/
|
|
58
|
+
protected initProperties(initValues: InitConfigType): PropertiesType;
|
|
59
|
+
protected serializeRuleOverrides(overrides: Partial<PropertiesType>): Record<string, unknown>;
|
|
60
|
+
protected serializeEntry(instance: ComponentInstance<this>): PopoverConfig;
|
|
61
|
+
serialize(instance?: ComponentInstance<this>): PopoverConfig;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Popover = void 0;
|
|
4
|
+
exports.popover = popover;
|
|
5
|
+
const server_component_class_1 = require("@matreshka/shared/enums/server-component-class");
|
|
6
|
+
const popover_close_message_1 = require("@matreshka/shared/messages/bff-to-client/components/popover/popover-close-message");
|
|
7
|
+
const core_1 = require("../core");
|
|
8
|
+
const entry_component_1 = require("./entry-component");
|
|
9
|
+
function popover(arg0, arg1) {
|
|
10
|
+
if (arg1 !== undefined) {
|
|
11
|
+
return new Popover({
|
|
12
|
+
...arg0,
|
|
13
|
+
content: arg1,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
const single = arg0;
|
|
17
|
+
if (typeof single === "object" &&
|
|
18
|
+
single !== null &&
|
|
19
|
+
!Array.isArray(single) &&
|
|
20
|
+
"content" in single) {
|
|
21
|
+
return new Popover(single);
|
|
22
|
+
}
|
|
23
|
+
return new Popover({ content: single });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Компонент всплывающей панели (popover), содержащей вложенные компоненты.
|
|
27
|
+
*
|
|
28
|
+
* На клиенте рендерится через [Popover API](https://doka.guide/html/popover/) (`popover="auto"`).
|
|
29
|
+
*/
|
|
30
|
+
class Popover extends entry_component_1.EntryComponent {
|
|
31
|
+
/**
|
|
32
|
+
* Возвращает уникальный идентификатор класса компонента.
|
|
33
|
+
*
|
|
34
|
+
* @returns Строка "popover".
|
|
35
|
+
*/
|
|
36
|
+
class() {
|
|
37
|
+
return server_component_class_1.ServerComponentClass.Popover;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Закрывает всплывающее окно, инициируя действие "close".
|
|
41
|
+
*/
|
|
42
|
+
close(instances) {
|
|
43
|
+
if (instances) {
|
|
44
|
+
instances
|
|
45
|
+
.filter((instance) => instance.client)
|
|
46
|
+
.forEach((instance) => {
|
|
47
|
+
instance.client.outcomingMessage$.next(new popover_close_message_1.PopoverCloseMessage(instance.id));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.broadcast(new popover_close_message_1.PopoverCloseMessage(this.id));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Инициализирует свойства компонента.
|
|
56
|
+
*
|
|
57
|
+
* @param initValues Объект конфигурации инициализации.
|
|
58
|
+
* @returns Объект со свойствами компонента.
|
|
59
|
+
*/
|
|
60
|
+
initProperties(initValues) {
|
|
61
|
+
return {
|
|
62
|
+
...super.initProperties(initValues),
|
|
63
|
+
content: (0, core_1.calculateComponents)(initValues.content),
|
|
64
|
+
positionArea: initValues.positionArea,
|
|
65
|
+
size: initValues.size,
|
|
66
|
+
overlays: initValues.overlays,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
serializeRuleOverrides(overrides) {
|
|
70
|
+
const out = { ...overrides };
|
|
71
|
+
if (overrides.content !== undefined) {
|
|
72
|
+
out.content = (0, core_1.serializeComponentList)(overrides.content);
|
|
73
|
+
}
|
|
74
|
+
if (overrides.overlays !== undefined) {
|
|
75
|
+
out.overlays = (0, core_1.serializeOverlays)(overrides.overlays);
|
|
76
|
+
}
|
|
77
|
+
return out;
|
|
78
|
+
}
|
|
79
|
+
serializeEntry(instance) {
|
|
80
|
+
const result = super.serializeEntry(instance);
|
|
81
|
+
const p = this.properties;
|
|
82
|
+
return {
|
|
83
|
+
...result,
|
|
84
|
+
class: server_component_class_1.ServerComponentClass.Popover,
|
|
85
|
+
properties: {
|
|
86
|
+
...p,
|
|
87
|
+
content: (0, core_1.serializeComponentList)(p.content),
|
|
88
|
+
overlays: p.overlays ? (0, core_1.serializeOverlays)(p.overlays) : [],
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
serialize(instance) {
|
|
93
|
+
return this.withEntrySerializationContext(instance, (resolvedInstance) => this.serializeEntry(resolvedInstance));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.Popover = Popover;
|