devextreme-react 23.2.1-alpha-23255-1813 → 23.2.3
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/cjs/accordion.d.ts +2 -2
- package/cjs/accordion.js +3 -2
- package/cjs/action-sheet.d.ts +2 -2
- package/cjs/action-sheet.js +3 -2
- package/cjs/autocomplete.d.ts +2 -2
- package/cjs/autocomplete.js +5 -3
- package/cjs/bar-gauge.d.ts +22 -22
- package/cjs/bar-gauge.js +3 -2
- package/cjs/box.d.ts +3 -3
- package/cjs/box.js +3 -2
- package/cjs/bullet.d.ts +6 -6
- package/cjs/bullet.js +3 -2
- package/cjs/button-group.d.ts +2 -2
- package/cjs/button-group.js +3 -2
- package/cjs/button.d.ts +2 -2
- package/cjs/button.js +3 -2
- package/cjs/calendar.d.ts +4 -4
- package/cjs/calendar.js +19 -2
- package/cjs/chart.d.ts +133 -134
- package/cjs/chart.js +3 -2
- package/cjs/check-box.d.ts +2 -2
- package/cjs/check-box.js +3 -2
- package/cjs/circular-gauge.d.ts +15 -16
- package/cjs/circular-gauge.js +3 -2
- package/cjs/color-box.d.ts +2 -2
- package/cjs/color-box.js +5 -3
- package/cjs/common/charts.d.ts +3 -3
- package/cjs/common/charts.js +2 -2
- package/cjs/common/data/custom-store.d.ts +2 -2
- package/cjs/common/data/custom-store.js +2 -2
- package/cjs/common/grids.d.ts +2 -2
- package/cjs/common/grids.js +2 -2
- package/cjs/common/index.d.ts +2 -2
- package/cjs/common/index.js +2 -2
- package/cjs/context-menu.d.ts +2 -2
- package/cjs/context-menu.js +3 -2
- package/cjs/core/component-base.d.ts +14 -6
- package/cjs/core/component-base.js +84 -33
- package/cjs/core/component.d.ts +2 -2
- package/cjs/core/component.js +2 -2
- package/cjs/core/config.d.ts +2 -2
- package/cjs/core/config.js +2 -2
- package/cjs/core/configuration/comparer.d.ts +2 -2
- package/cjs/core/configuration/comparer.js +2 -2
- package/cjs/core/configuration/config-node.d.ts +2 -2
- package/cjs/core/configuration/config-node.js +2 -2
- package/cjs/core/configuration/react/element.d.ts +2 -2
- package/cjs/core/configuration/react/element.js +2 -2
- package/cjs/core/configuration/react/templates.d.ts +2 -2
- package/cjs/core/configuration/react/templates.js +2 -2
- package/cjs/core/configuration/react/tree.d.ts +2 -2
- package/cjs/core/configuration/react/tree.js +2 -2
- package/cjs/core/configuration/tree.d.ts +2 -2
- package/cjs/core/configuration/tree.js +2 -2
- package/cjs/core/configuration/utils.d.ts +2 -2
- package/cjs/core/configuration/utils.js +2 -2
- package/cjs/core/extension-component.d.ts +2 -2
- package/cjs/core/extension-component.js +2 -2
- package/cjs/core/helpers.d.ts +14 -3
- package/cjs/core/helpers.js +155 -4
- package/cjs/core/nested-option.d.ts +2 -2
- package/cjs/core/nested-option.js +2 -2
- package/cjs/core/options-manager.d.ts +7 -7
- package/cjs/core/options-manager.js +33 -20
- package/cjs/core/template-manager.d.ts +16 -0
- package/cjs/core/template-manager.js +182 -0
- package/cjs/core/template-wrapper.d.ts +4 -29
- package/cjs/core/template-wrapper.js +94 -98
- package/cjs/core/template.d.ts +2 -2
- package/cjs/core/template.js +2 -2
- package/cjs/core/types.d.ts +69 -0
- package/cjs/core/types.js +15 -0
- package/cjs/core/widget-config.d.ts +2 -2
- package/cjs/core/widget-config.js +2 -2
- package/cjs/data-grid.d.ts +23 -30
- package/cjs/data-grid.js +3 -2
- package/cjs/date-box.d.ts +13 -13
- package/cjs/date-box.js +20 -3
- package/cjs/date-range-box.d.ts +17 -17
- package/cjs/date-range-box.js +25 -3
- package/cjs/defer-rendering.d.ts +5 -3
- package/cjs/defer-rendering.js +3 -2
- package/cjs/diagram.d.ts +2 -2
- package/cjs/diagram.js +3 -2
- package/cjs/draggable.d.ts +2 -2
- package/cjs/draggable.js +3 -2
- package/cjs/drawer.d.ts +2 -2
- package/cjs/drawer.js +3 -2
- package/cjs/drop-down-box.d.ts +2 -2
- package/cjs/drop-down-box.js +5 -3
- package/cjs/drop-down-button.d.ts +3 -10
- package/cjs/drop-down-button.js +12 -2
- package/cjs/file-manager.d.ts +2 -2
- package/cjs/file-manager.js +3 -2
- package/cjs/file-uploader.d.ts +2 -2
- package/cjs/file-uploader.js +3 -2
- package/cjs/filter-builder.d.ts +8 -8
- package/cjs/filter-builder.js +3 -2
- package/cjs/form.d.ts +8 -8
- package/cjs/form.js +3 -2
- package/cjs/funnel.d.ts +20 -20
- package/cjs/funnel.js +3 -2
- package/cjs/gallery.d.ts +2 -2
- package/cjs/gallery.js +3 -2
- package/cjs/gantt.d.ts +6 -6
- package/cjs/gantt.js +5 -2
- package/cjs/html-editor.d.ts +2 -2
- package/cjs/html-editor.js +3 -2
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -2
- package/cjs/linear-gauge.d.ts +15 -16
- package/cjs/linear-gauge.js +3 -2
- package/cjs/list.d.ts +3 -3
- package/cjs/list.js +3 -2
- package/cjs/load-indicator.d.ts +2 -2
- package/cjs/load-indicator.js +3 -2
- package/cjs/load-panel.d.ts +2 -2
- package/cjs/load-panel.js +3 -2
- package/cjs/lookup.d.ts +2 -2
- package/cjs/lookup.js +5 -3
- package/cjs/map.d.ts +2 -2
- package/cjs/map.js +3 -2
- package/cjs/menu.d.ts +2 -2
- package/cjs/menu.js +3 -2
- package/cjs/multi-view.d.ts +2 -2
- package/cjs/multi-view.js +3 -2
- package/cjs/number-box.d.ts +4 -4
- package/cjs/number-box.js +5 -3
- package/cjs/pie-chart.d.ts +28 -29
- package/cjs/pie-chart.js +3 -2
- package/cjs/pivot-grid-field-chooser.d.ts +2 -2
- package/cjs/pivot-grid-field-chooser.js +3 -2
- package/cjs/pivot-grid.d.ts +2 -2
- package/cjs/pivot-grid.js +3 -2
- package/cjs/polar-chart.d.ts +95 -95
- package/cjs/polar-chart.js +3 -2
- package/cjs/popover.d.ts +2 -2
- package/cjs/popover.js +3 -2
- package/cjs/popup.d.ts +2 -2
- package/cjs/popup.js +3 -2
- package/cjs/progress-bar.d.ts +2 -2
- package/cjs/progress-bar.js +3 -2
- package/cjs/radio-group.d.ts +2 -2
- package/cjs/radio-group.js +3 -2
- package/cjs/range-selector.d.ts +49 -50
- package/cjs/range-selector.js +3 -2
- package/cjs/range-slider.d.ts +4 -4
- package/cjs/range-slider.js +3 -2
- package/cjs/recurrence-editor.d.ts +2 -2
- package/cjs/recurrence-editor.js +3 -2
- package/cjs/resizable.d.ts +2 -2
- package/cjs/resizable.js +3 -2
- package/cjs/responsive-box.d.ts +4 -4
- package/cjs/responsive-box.js +3 -2
- package/cjs/sankey.d.ts +11 -11
- package/cjs/sankey.js +3 -2
- package/cjs/scheduler.d.ts +6 -5
- package/cjs/scheduler.js +19 -2
- package/cjs/scroll-view.d.ts +2 -2
- package/cjs/scroll-view.js +3 -2
- package/cjs/select-box.d.ts +2 -2
- package/cjs/select-box.js +5 -3
- package/cjs/slider.d.ts +4 -4
- package/cjs/slider.js +3 -2
- package/cjs/sortable.d.ts +2 -2
- package/cjs/sortable.js +3 -2
- package/cjs/sparkline.d.ts +6 -6
- package/cjs/sparkline.js +3 -2
- package/cjs/speed-dial-action.d.ts +2 -2
- package/cjs/speed-dial-action.js +3 -2
- package/cjs/switch.d.ts +2 -2
- package/cjs/switch.js +3 -2
- package/cjs/tab-panel.d.ts +2 -2
- package/cjs/tab-panel.js +3 -2
- package/cjs/tabs.d.ts +2 -2
- package/cjs/tabs.js +3 -2
- package/cjs/tag-box.d.ts +2 -2
- package/cjs/tag-box.js +5 -3
- package/cjs/text-area.d.ts +2 -2
- package/cjs/text-area.js +5 -3
- package/cjs/text-box.d.ts +2 -2
- package/cjs/text-box.js +5 -3
- package/cjs/tile-view.d.ts +2 -2
- package/cjs/tile-view.js +3 -2
- package/cjs/toast.d.ts +2 -2
- package/cjs/toast.js +3 -2
- package/cjs/toolbar.d.ts +2 -2
- package/cjs/toolbar.js +3 -2
- package/cjs/tooltip.d.ts +2 -2
- package/cjs/tooltip.js +3 -2
- package/cjs/tree-list.d.ts +14 -14
- package/cjs/tree-list.js +3 -2
- package/cjs/tree-map.d.ts +15 -15
- package/cjs/tree-map.js +3 -2
- package/cjs/tree-view.d.ts +3 -3
- package/cjs/tree-view.js +3 -2
- package/cjs/validation-group.d.ts +2 -2
- package/cjs/validation-group.js +3 -2
- package/cjs/validation-summary.d.ts +2 -2
- package/cjs/validation-summary.js +3 -2
- package/cjs/validator.d.ts +8 -8
- package/cjs/validator.js +3 -2
- package/cjs/vector-map.d.ts +21 -21
- package/cjs/vector-map.js +3 -2
- package/core/component/package.json +6 -0
- package/core/config/package.json +6 -0
- package/core/extension-component/package.json +6 -0
- package/core/nested-option/package.json +6 -0
- package/esm/accordion.js +3 -2
- package/esm/action-sheet.js +3 -2
- package/esm/autocomplete.js +5 -3
- package/esm/bar-gauge.js +3 -2
- package/esm/box.js +3 -2
- package/esm/bullet.js +3 -2
- package/esm/button-group.js +3 -2
- package/esm/button.js +3 -2
- package/esm/calendar.js +19 -2
- package/esm/chart.js +3 -2
- package/esm/check-box.js +3 -2
- package/esm/circular-gauge.js +3 -2
- package/esm/color-box.js +5 -3
- package/esm/common/charts.js +2 -2
- package/esm/common/data/custom-store.js +2 -2
- package/esm/common/grids.js +2 -2
- package/esm/common/index.js +2 -2
- package/esm/context-menu.js +3 -2
- package/esm/core/component-base.js +85 -31
- package/esm/core/component.js +2 -2
- package/esm/core/config.js +2 -2
- package/esm/core/configuration/comparer.js +2 -2
- package/esm/core/configuration/config-node.js +2 -2
- package/esm/core/configuration/react/element.js +2 -2
- package/esm/core/configuration/react/templates.js +2 -2
- package/esm/core/configuration/react/tree.js +2 -2
- package/esm/core/configuration/tree.js +2 -2
- package/esm/core/configuration/utils.js +2 -2
- package/esm/core/extension-component.js +2 -2
- package/esm/core/helpers.js +154 -3
- package/esm/core/nested-option.js +2 -2
- package/esm/core/options-manager.js +33 -20
- package/esm/core/template-manager.js +159 -0
- package/esm/core/template-wrapper.js +94 -98
- package/esm/core/template.js +2 -2
- package/esm/core/types.js +14 -0
- package/esm/core/widget-config.js +2 -2
- package/esm/data-grid.js +3 -2
- package/esm/date-box.js +20 -3
- package/esm/date-range-box.js +25 -3
- package/esm/defer-rendering.js +3 -2
- package/esm/diagram.js +3 -2
- package/esm/draggable.js +3 -2
- package/esm/drawer.js +3 -2
- package/esm/drop-down-box.js +5 -3
- package/esm/drop-down-button.js +12 -2
- package/esm/file-manager.js +3 -2
- package/esm/file-uploader.js +3 -2
- package/esm/filter-builder.js +3 -2
- package/esm/form.js +3 -2
- package/esm/funnel.js +3 -2
- package/esm/gallery.js +3 -2
- package/esm/gantt.js +5 -2
- package/esm/html-editor.js +3 -2
- package/esm/index.js +2 -2
- package/esm/linear-gauge.js +3 -2
- package/esm/list.js +3 -2
- package/esm/load-indicator.js +3 -2
- package/esm/load-panel.js +3 -2
- package/esm/lookup.js +5 -3
- package/esm/map.js +3 -2
- package/esm/menu.js +3 -2
- package/esm/multi-view.js +3 -2
- package/esm/number-box.js +5 -3
- package/esm/pie-chart.js +3 -2
- package/esm/pivot-grid-field-chooser.js +3 -2
- package/esm/pivot-grid.js +3 -2
- package/esm/polar-chart.js +3 -2
- package/esm/popover.js +3 -2
- package/esm/popup.js +3 -2
- package/esm/progress-bar.js +3 -2
- package/esm/radio-group.js +3 -2
- package/esm/range-selector.js +3 -2
- package/esm/range-slider.js +3 -2
- package/esm/recurrence-editor.js +3 -2
- package/esm/resizable.js +3 -2
- package/esm/responsive-box.js +3 -2
- package/esm/sankey.js +3 -2
- package/esm/scheduler.js +19 -2
- package/esm/scroll-view.js +3 -2
- package/esm/select-box.js +5 -3
- package/esm/slider.js +3 -2
- package/esm/sortable.js +3 -2
- package/esm/sparkline.js +3 -2
- package/esm/speed-dial-action.js +3 -2
- package/esm/switch.js +3 -2
- package/esm/tab-panel.js +3 -2
- package/esm/tabs.js +3 -2
- package/esm/tag-box.js +5 -3
- package/esm/text-area.js +5 -3
- package/esm/text-box.js +5 -3
- package/esm/tile-view.js +3 -2
- package/esm/toast.js +3 -2
- package/esm/toolbar.js +3 -2
- package/esm/tooltip.js +3 -2
- package/esm/tree-list.js +3 -2
- package/esm/tree-map.js +3 -2
- package/esm/tree-view.js +3 -2
- package/esm/validation-group.js +3 -2
- package/esm/validation-summary.js +3 -2
- package/esm/validator.js +3 -2
- package/esm/vector-map.js +3 -2
- package/package.json +6 -7
- package/cjs/core/dx-template.d.ts +0 -26
- package/cjs/core/dx-template.js +0 -99
- package/cjs/core/templates-manager.d.ts +0 -25
- package/cjs/core/templates-manager.js +0 -88
- package/cjs/core/templates-renderer.d.ts +0 -28
- package/cjs/core/templates-renderer.js +0 -103
- package/cjs/core/templates-store.d.ts +0 -24
- package/cjs/core/templates-store.js +0 -50
- package/esm/core/dx-template.js +0 -77
- package/esm/core/templates-manager.js +0 -67
- package/esm/core/templates-renderer.js +0 -81
- package/esm/core/templates-store.js +0 -47
package/cjs/core/dx-template.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
"use strict";
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.createDxTemplate = void 0;
|
|
36
|
-
var React = __importStar(require("react"));
|
|
37
|
-
var events = __importStar(require("devextreme/events"));
|
|
38
|
-
var helpers_1 = require("./helpers");
|
|
39
|
-
var template_wrapper_1 = require("./template-wrapper");
|
|
40
|
-
var component_base_1 = require("./component-base");
|
|
41
|
-
function unwrapElement(element) {
|
|
42
|
-
return element.get ? element.get(0) : element;
|
|
43
|
-
}
|
|
44
|
-
function createDxTemplate(createContentProvider, templatesStore, keyFn) {
|
|
45
|
-
var renderedTemplates = new helpers_1.DoubleKeyMap();
|
|
46
|
-
return {
|
|
47
|
-
render: function (data) {
|
|
48
|
-
var container = unwrapElement(data.container);
|
|
49
|
-
var key = { key1: data.model, key2: container };
|
|
50
|
-
var prevTemplateId = renderedTemplates.get(key);
|
|
51
|
-
var templateId;
|
|
52
|
-
var onRemoved = function () {
|
|
53
|
-
templatesStore.setDeferredRemove(templateId, true);
|
|
54
|
-
renderedTemplates.delete(key);
|
|
55
|
-
};
|
|
56
|
-
var _subscribeOnContainerRemoval = function () {
|
|
57
|
-
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
58
|
-
events.one(container, component_base_1.DX_REMOVE_EVENT, onRemoved);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var _unsubscribeOnContainerRemoval = function () {
|
|
62
|
-
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
63
|
-
events.off(container, component_base_1.DX_REMOVE_EVENT, onRemoved);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
if (prevTemplateId) {
|
|
67
|
-
templateId = prevTemplateId;
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
templateId = keyFn ? keyFn(data.model) : "__template_" + helpers_1.generateID();
|
|
71
|
-
if (data.model !== undefined) {
|
|
72
|
-
renderedTemplates.set(key, templateId);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
_subscribeOnContainerRemoval();
|
|
76
|
-
templatesStore.add(templateId, function () {
|
|
77
|
-
var props = {
|
|
78
|
-
data: data.model,
|
|
79
|
-
index: data.index,
|
|
80
|
-
};
|
|
81
|
-
var contentProvider = createContentProvider();
|
|
82
|
-
return React.createElement(template_wrapper_1.TemplateWrapper, {
|
|
83
|
-
content: contentProvider(props),
|
|
84
|
-
container: container,
|
|
85
|
-
onRemoved: onRemoved,
|
|
86
|
-
onDidMount: function () {
|
|
87
|
-
var _a;
|
|
88
|
-
_unsubscribeOnContainerRemoval();
|
|
89
|
-
templatesStore.setDeferredRemove(templateId, false);
|
|
90
|
-
(_a = data.onRendered) === null || _a === void 0 ? void 0 : _a.call(data);
|
|
91
|
-
},
|
|
92
|
-
key: templateId,
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
return container;
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
exports.createDxTemplate = createDxTemplate;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { ITemplate } from './configuration/config-node';
|
|
15
|
-
import { TemplatesStore } from './templates-store';
|
|
16
|
-
declare class TemplatesManager {
|
|
17
|
-
private readonly _templatesStore;
|
|
18
|
-
private _templates;
|
|
19
|
-
private _templatesContent;
|
|
20
|
-
constructor(templatesStore: TemplatesStore);
|
|
21
|
-
add(name: string, template: ITemplate): void;
|
|
22
|
-
get templatesCount(): number;
|
|
23
|
-
get templates(): Record<string, any>;
|
|
24
|
-
}
|
|
25
|
-
export default TemplatesManager;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
"use strict";
|
|
15
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
-
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
18
|
-
}) : (function(o, m, k, k2) {
|
|
19
|
-
if (k2 === undefined) k2 = k;
|
|
20
|
-
o[k2] = m[k];
|
|
21
|
-
}));
|
|
22
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
-
}) : function(o, v) {
|
|
25
|
-
o["default"] = v;
|
|
26
|
-
});
|
|
27
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
var React = __importStar(require("react"));
|
|
36
|
-
var config_1 = require("./config");
|
|
37
|
-
var dx_template_1 = require("./dx-template");
|
|
38
|
-
function normalizeProps(props) {
|
|
39
|
-
if (config_1.getOption('useLegacyTemplateEngine')) {
|
|
40
|
-
var model = props.data;
|
|
41
|
-
if (model && Object.prototype.hasOwnProperty.call(model, 'key')) {
|
|
42
|
-
model.dxkey = model.key;
|
|
43
|
-
}
|
|
44
|
-
return model;
|
|
45
|
-
}
|
|
46
|
-
return props;
|
|
47
|
-
}
|
|
48
|
-
var contentCreators = {
|
|
49
|
-
component: function (contentGetter) { return function (props) {
|
|
50
|
-
props = normalizeProps(props);
|
|
51
|
-
return React.createElement.bind(null, contentGetter())(props);
|
|
52
|
-
}; },
|
|
53
|
-
render: function (contentGetter) { return function (props) {
|
|
54
|
-
normalizeProps(props);
|
|
55
|
-
return contentGetter()(props.data, props.index);
|
|
56
|
-
}; },
|
|
57
|
-
children: function (contentGetter) { return function () { return contentGetter(); }; },
|
|
58
|
-
};
|
|
59
|
-
var TemplatesManager = /** @class */ (function () {
|
|
60
|
-
function TemplatesManager(templatesStore) {
|
|
61
|
-
this._templates = {};
|
|
62
|
-
this._templatesContent = {};
|
|
63
|
-
this._templatesStore = templatesStore;
|
|
64
|
-
}
|
|
65
|
-
TemplatesManager.prototype.add = function (name, template) {
|
|
66
|
-
var _this = this;
|
|
67
|
-
this._templatesContent[name] = template.content;
|
|
68
|
-
var contentCreator = contentCreators[template.type]
|
|
69
|
-
.bind(this, function () { return _this._templatesContent[name]; });
|
|
70
|
-
this._templates[name] = dx_template_1.createDxTemplate(contentCreator, this._templatesStore, template.keyFn);
|
|
71
|
-
};
|
|
72
|
-
Object.defineProperty(TemplatesManager.prototype, "templatesCount", {
|
|
73
|
-
get: function () {
|
|
74
|
-
return Object.keys(this._templates).length;
|
|
75
|
-
},
|
|
76
|
-
enumerable: false,
|
|
77
|
-
configurable: true
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(TemplatesManager.prototype, "templates", {
|
|
80
|
-
get: function () {
|
|
81
|
-
return this._templates;
|
|
82
|
-
},
|
|
83
|
-
enumerable: false,
|
|
84
|
-
configurable: true
|
|
85
|
-
});
|
|
86
|
-
return TemplatesManager;
|
|
87
|
-
}());
|
|
88
|
-
exports.default = TemplatesManager;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import * as React from 'react';
|
|
15
|
-
import { TemplatesStore } from './templates-store';
|
|
16
|
-
declare class TemplatesRenderer extends React.PureComponent<{
|
|
17
|
-
templatesStore: TemplatesStore;
|
|
18
|
-
}> {
|
|
19
|
-
private updateScheduled;
|
|
20
|
-
private mounted;
|
|
21
|
-
private shouldRepeatForceUpdate;
|
|
22
|
-
private isUpdateFuncLaunched;
|
|
23
|
-
componentDidMount(): void;
|
|
24
|
-
componentWillUnmount(): void;
|
|
25
|
-
scheduleUpdate(useDeferUpdate: boolean, onRendered?: () => void): void;
|
|
26
|
-
render(): React.ReactNode;
|
|
27
|
-
}
|
|
28
|
-
export { TemplatesRenderer, };
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
"use strict";
|
|
15
|
-
var __extends = (this && this.__extends) || (function () {
|
|
16
|
-
var extendStatics = function (d, b) {
|
|
17
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
-
return extendStatics(d, b);
|
|
21
|
-
};
|
|
22
|
-
return function (d, b) {
|
|
23
|
-
if (typeof b !== "function" && b !== null)
|
|
24
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
31
|
-
if (k2 === undefined) k2 = k;
|
|
32
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
33
|
-
}) : (function(o, m, k, k2) {
|
|
34
|
-
if (k2 === undefined) k2 = k;
|
|
35
|
-
o[k2] = m[k];
|
|
36
|
-
}));
|
|
37
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
38
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
39
|
-
}) : function(o, v) {
|
|
40
|
-
o["default"] = v;
|
|
41
|
-
});
|
|
42
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
43
|
-
if (mod && mod.__esModule) return mod;
|
|
44
|
-
var result = {};
|
|
45
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
46
|
-
__setModuleDefault(result, mod);
|
|
47
|
-
return result;
|
|
48
|
-
};
|
|
49
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.TemplatesRenderer = void 0;
|
|
51
|
-
var frame_1 = require("devextreme/animation/frame");
|
|
52
|
-
var common_1 = require("devextreme/core/utils/common");
|
|
53
|
-
var React = __importStar(require("react"));
|
|
54
|
-
var TemplatesRenderer = /** @class */ (function (_super) {
|
|
55
|
-
__extends(TemplatesRenderer, _super);
|
|
56
|
-
function TemplatesRenderer() {
|
|
57
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
58
|
-
_this.updateScheduled = false;
|
|
59
|
-
_this.mounted = false;
|
|
60
|
-
_this.shouldRepeatForceUpdate = false;
|
|
61
|
-
_this.isUpdateFuncLaunched = false;
|
|
62
|
-
return _this;
|
|
63
|
-
}
|
|
64
|
-
TemplatesRenderer.prototype.componentDidMount = function () {
|
|
65
|
-
this.mounted = true;
|
|
66
|
-
};
|
|
67
|
-
TemplatesRenderer.prototype.componentWillUnmount = function () {
|
|
68
|
-
this.mounted = false;
|
|
69
|
-
};
|
|
70
|
-
TemplatesRenderer.prototype.scheduleUpdate = function (useDeferUpdate, onRendered) {
|
|
71
|
-
var _this = this;
|
|
72
|
-
if (this.updateScheduled) {
|
|
73
|
-
this.shouldRepeatForceUpdate = this.isUpdateFuncLaunched;
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
this.updateScheduled = true;
|
|
77
|
-
var updateFunc = useDeferUpdate ? common_1.deferUpdate : frame_1.requestAnimationFrame;
|
|
78
|
-
// eslint-disable-next-line no-void
|
|
79
|
-
void updateFunc(function () {
|
|
80
|
-
if (_this.mounted) {
|
|
81
|
-
_this.isUpdateFuncLaunched = true;
|
|
82
|
-
_this.forceUpdate(function () {
|
|
83
|
-
_this.updateScheduled = false;
|
|
84
|
-
onRendered === null || onRendered === void 0 ? void 0 : onRendered();
|
|
85
|
-
if (_this.shouldRepeatForceUpdate) {
|
|
86
|
-
_this.shouldRepeatForceUpdate = false;
|
|
87
|
-
_this.forceUpdate();
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
_this.isUpdateFuncLaunched = false;
|
|
92
|
-
_this.updateScheduled = false;
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
TemplatesRenderer.prototype.render = function () {
|
|
96
|
-
var templatesStore = this.props.templatesStore;
|
|
97
|
-
return React.createElement(React.Fragment, {},
|
|
98
|
-
// @ts-expect-error TS2769
|
|
99
|
-
templatesStore.renderWrappers());
|
|
100
|
-
};
|
|
101
|
-
return TemplatesRenderer;
|
|
102
|
-
}(React.PureComponent));
|
|
103
|
-
exports.TemplatesRenderer = TemplatesRenderer;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { TemplateWrapper, TemplateWrapperRenderer } from './template-wrapper';
|
|
15
|
-
declare class TemplatesStore {
|
|
16
|
-
private readonly _templates;
|
|
17
|
-
private readonly _onTemplateAdded;
|
|
18
|
-
constructor(onTemplateAdded: () => void);
|
|
19
|
-
add(templateId: string, templateFunc: TemplateWrapperRenderer): void;
|
|
20
|
-
setDeferredRemove(templateId: string, isDeferredRemove: boolean): void;
|
|
21
|
-
private removeDefferedTemplate;
|
|
22
|
-
renderWrappers(): TemplateWrapper[];
|
|
23
|
-
}
|
|
24
|
-
export { TemplatesStore, };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
"use strict";
|
|
15
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.TemplatesStore = void 0;
|
|
17
|
-
var TemplatesStore = /** @class */ (function () {
|
|
18
|
-
function TemplatesStore(onTemplateAdded) {
|
|
19
|
-
this._templates = {};
|
|
20
|
-
this._onTemplateAdded = onTemplateAdded;
|
|
21
|
-
}
|
|
22
|
-
TemplatesStore.prototype.add = function (templateId, templateFunc) {
|
|
23
|
-
this._templates[templateId] = { template: templateFunc, isDeferredRemove: false };
|
|
24
|
-
this._onTemplateAdded();
|
|
25
|
-
};
|
|
26
|
-
TemplatesStore.prototype.setDeferredRemove = function (templateId, isDeferredRemove) {
|
|
27
|
-
if (this._templates[templateId]) {
|
|
28
|
-
this._templates[templateId].isDeferredRemove = isDeferredRemove;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
TemplatesStore.prototype.removeDefferedTemplate = function () {
|
|
32
|
-
var _this = this;
|
|
33
|
-
Object.entries(this._templates)
|
|
34
|
-
.filter(function (_a) {
|
|
35
|
-
var templateInfo = _a[1];
|
|
36
|
-
return templateInfo.isDeferredRemove;
|
|
37
|
-
})
|
|
38
|
-
.forEach(function (_a) {
|
|
39
|
-
var templateId = _a[0];
|
|
40
|
-
delete _this._templates[templateId];
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
TemplatesStore.prototype.renderWrappers = function () {
|
|
44
|
-
var _this = this;
|
|
45
|
-
this.removeDefferedTemplate();
|
|
46
|
-
return Object.getOwnPropertyNames(this._templates).map(function (templateId) { return _this._templates[templateId].template(); });
|
|
47
|
-
};
|
|
48
|
-
return TemplatesStore;
|
|
49
|
-
}());
|
|
50
|
-
exports.TemplatesStore = TemplatesStore;
|
package/esm/core/dx-template.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import * as React from 'react';
|
|
15
|
-
import * as events from 'devextreme/events';
|
|
16
|
-
import { DoubleKeyMap, generateID } from './helpers';
|
|
17
|
-
import { TemplateWrapper } from './template-wrapper';
|
|
18
|
-
import { DX_REMOVE_EVENT } from './component-base';
|
|
19
|
-
function unwrapElement(element) {
|
|
20
|
-
return element.get ? element.get(0) : element;
|
|
21
|
-
}
|
|
22
|
-
function createDxTemplate(createContentProvider, templatesStore, keyFn) {
|
|
23
|
-
var renderedTemplates = new DoubleKeyMap();
|
|
24
|
-
return {
|
|
25
|
-
render: function (data) {
|
|
26
|
-
var container = unwrapElement(data.container);
|
|
27
|
-
var key = { key1: data.model, key2: container };
|
|
28
|
-
var prevTemplateId = renderedTemplates.get(key);
|
|
29
|
-
var templateId;
|
|
30
|
-
var onRemoved = function () {
|
|
31
|
-
templatesStore.setDeferredRemove(templateId, true);
|
|
32
|
-
renderedTemplates.delete(key);
|
|
33
|
-
};
|
|
34
|
-
var _subscribeOnContainerRemoval = function () {
|
|
35
|
-
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
36
|
-
events.one(container, DX_REMOVE_EVENT, onRemoved);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var _unsubscribeOnContainerRemoval = function () {
|
|
40
|
-
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
41
|
-
events.off(container, DX_REMOVE_EVENT, onRemoved);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
if (prevTemplateId) {
|
|
45
|
-
templateId = prevTemplateId;
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
templateId = keyFn ? keyFn(data.model) : "__template_" + generateID();
|
|
49
|
-
if (data.model !== undefined) {
|
|
50
|
-
renderedTemplates.set(key, templateId);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
_subscribeOnContainerRemoval();
|
|
54
|
-
templatesStore.add(templateId, function () {
|
|
55
|
-
var props = {
|
|
56
|
-
data: data.model,
|
|
57
|
-
index: data.index,
|
|
58
|
-
};
|
|
59
|
-
var contentProvider = createContentProvider();
|
|
60
|
-
return React.createElement(TemplateWrapper, {
|
|
61
|
-
content: contentProvider(props),
|
|
62
|
-
container: container,
|
|
63
|
-
onRemoved: onRemoved,
|
|
64
|
-
onDidMount: function () {
|
|
65
|
-
var _a;
|
|
66
|
-
_unsubscribeOnContainerRemoval();
|
|
67
|
-
templatesStore.setDeferredRemove(templateId, false);
|
|
68
|
-
(_a = data.onRendered) === null || _a === void 0 ? void 0 : _a.call(data);
|
|
69
|
-
},
|
|
70
|
-
key: templateId,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
return container;
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export { createDxTemplate, };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import * as React from 'react';
|
|
15
|
-
import { getOption as getConfigOption } from './config';
|
|
16
|
-
import { createDxTemplate } from './dx-template';
|
|
17
|
-
function normalizeProps(props) {
|
|
18
|
-
if (getConfigOption('useLegacyTemplateEngine')) {
|
|
19
|
-
var model = props.data;
|
|
20
|
-
if (model && Object.prototype.hasOwnProperty.call(model, 'key')) {
|
|
21
|
-
model.dxkey = model.key;
|
|
22
|
-
}
|
|
23
|
-
return model;
|
|
24
|
-
}
|
|
25
|
-
return props;
|
|
26
|
-
}
|
|
27
|
-
var contentCreators = {
|
|
28
|
-
component: function (contentGetter) { return function (props) {
|
|
29
|
-
props = normalizeProps(props);
|
|
30
|
-
return React.createElement.bind(null, contentGetter())(props);
|
|
31
|
-
}; },
|
|
32
|
-
render: function (contentGetter) { return function (props) {
|
|
33
|
-
normalizeProps(props);
|
|
34
|
-
return contentGetter()(props.data, props.index);
|
|
35
|
-
}; },
|
|
36
|
-
children: function (contentGetter) { return function () { return contentGetter(); }; },
|
|
37
|
-
};
|
|
38
|
-
var TemplatesManager = /** @class */ (function () {
|
|
39
|
-
function TemplatesManager(templatesStore) {
|
|
40
|
-
this._templates = {};
|
|
41
|
-
this._templatesContent = {};
|
|
42
|
-
this._templatesStore = templatesStore;
|
|
43
|
-
}
|
|
44
|
-
TemplatesManager.prototype.add = function (name, template) {
|
|
45
|
-
var _this = this;
|
|
46
|
-
this._templatesContent[name] = template.content;
|
|
47
|
-
var contentCreator = contentCreators[template.type]
|
|
48
|
-
.bind(this, function () { return _this._templatesContent[name]; });
|
|
49
|
-
this._templates[name] = createDxTemplate(contentCreator, this._templatesStore, template.keyFn);
|
|
50
|
-
};
|
|
51
|
-
Object.defineProperty(TemplatesManager.prototype, "templatesCount", {
|
|
52
|
-
get: function () {
|
|
53
|
-
return Object.keys(this._templates).length;
|
|
54
|
-
},
|
|
55
|
-
enumerable: false,
|
|
56
|
-
configurable: true
|
|
57
|
-
});
|
|
58
|
-
Object.defineProperty(TemplatesManager.prototype, "templates", {
|
|
59
|
-
get: function () {
|
|
60
|
-
return this._templates;
|
|
61
|
-
},
|
|
62
|
-
enumerable: false,
|
|
63
|
-
configurable: true
|
|
64
|
-
});
|
|
65
|
-
return TemplatesManager;
|
|
66
|
-
}());
|
|
67
|
-
export default TemplatesManager;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* devextreme-react
|
|
3
|
-
* Version: 23.2.1-alpha-23255-1813
|
|
4
|
-
* Build date: Tue Sep 12 2023
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
|
-
*
|
|
8
|
-
* This software may be modified and distributed under the terms
|
|
9
|
-
* of the MIT license. See the LICENSE file in the root of the project for details.
|
|
10
|
-
*
|
|
11
|
-
* https://github.com/DevExpress/devextreme-react
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
var __extends = (this && this.__extends) || (function () {
|
|
15
|
-
var extendStatics = function (d, b) {
|
|
16
|
-
extendStatics = Object.setPrototypeOf ||
|
|
17
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
18
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
19
|
-
return extendStatics(d, b);
|
|
20
|
-
};
|
|
21
|
-
return function (d, b) {
|
|
22
|
-
if (typeof b !== "function" && b !== null)
|
|
23
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
24
|
-
extendStatics(d, b);
|
|
25
|
-
function __() { this.constructor = d; }
|
|
26
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
27
|
-
};
|
|
28
|
-
})();
|
|
29
|
-
import { requestAnimationFrame } from 'devextreme/animation/frame';
|
|
30
|
-
import { deferUpdate } from 'devextreme/core/utils/common';
|
|
31
|
-
import * as React from 'react';
|
|
32
|
-
var TemplatesRenderer = /** @class */ (function (_super) {
|
|
33
|
-
__extends(TemplatesRenderer, _super);
|
|
34
|
-
function TemplatesRenderer() {
|
|
35
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
36
|
-
_this.updateScheduled = false;
|
|
37
|
-
_this.mounted = false;
|
|
38
|
-
_this.shouldRepeatForceUpdate = false;
|
|
39
|
-
_this.isUpdateFuncLaunched = false;
|
|
40
|
-
return _this;
|
|
41
|
-
}
|
|
42
|
-
TemplatesRenderer.prototype.componentDidMount = function () {
|
|
43
|
-
this.mounted = true;
|
|
44
|
-
};
|
|
45
|
-
TemplatesRenderer.prototype.componentWillUnmount = function () {
|
|
46
|
-
this.mounted = false;
|
|
47
|
-
};
|
|
48
|
-
TemplatesRenderer.prototype.scheduleUpdate = function (useDeferUpdate, onRendered) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
if (this.updateScheduled) {
|
|
51
|
-
this.shouldRepeatForceUpdate = this.isUpdateFuncLaunched;
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.updateScheduled = true;
|
|
55
|
-
var updateFunc = useDeferUpdate ? deferUpdate : requestAnimationFrame;
|
|
56
|
-
// eslint-disable-next-line no-void
|
|
57
|
-
void updateFunc(function () {
|
|
58
|
-
if (_this.mounted) {
|
|
59
|
-
_this.isUpdateFuncLaunched = true;
|
|
60
|
-
_this.forceUpdate(function () {
|
|
61
|
-
_this.updateScheduled = false;
|
|
62
|
-
onRendered === null || onRendered === void 0 ? void 0 : onRendered();
|
|
63
|
-
if (_this.shouldRepeatForceUpdate) {
|
|
64
|
-
_this.shouldRepeatForceUpdate = false;
|
|
65
|
-
_this.forceUpdate();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
_this.isUpdateFuncLaunched = false;
|
|
70
|
-
_this.updateScheduled = false;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
TemplatesRenderer.prototype.render = function () {
|
|
74
|
-
var templatesStore = this.props.templatesStore;
|
|
75
|
-
return React.createElement(React.Fragment, {},
|
|
76
|
-
// @ts-expect-error TS2769
|
|
77
|
-
templatesStore.renderWrappers());
|
|
78
|
-
};
|
|
79
|
-
return TemplatesRenderer;
|
|
80
|
-
}(React.PureComponent));
|
|
81
|
-
export { TemplatesRenderer, };
|