devextreme-react 23.2.2-beta → 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 +2 -2
- package/cjs/action-sheet.d.ts +2 -2
- package/cjs/action-sheet.js +2 -2
- package/cjs/autocomplete.d.ts +2 -2
- package/cjs/autocomplete.js +2 -2
- package/cjs/bar-gauge.d.ts +6 -6
- package/cjs/bar-gauge.js +2 -2
- package/cjs/box.d.ts +2 -2
- package/cjs/box.js +2 -2
- package/cjs/bullet.d.ts +4 -4
- package/cjs/bullet.js +2 -2
- package/cjs/button-group.d.ts +2 -2
- package/cjs/button-group.js +2 -2
- package/cjs/button.d.ts +2 -2
- package/cjs/button.js +2 -2
- package/cjs/calendar.d.ts +4 -4
- package/cjs/calendar.js +18 -2
- package/cjs/chart.d.ts +75 -75
- package/cjs/chart.js +2 -2
- package/cjs/check-box.d.ts +2 -2
- package/cjs/check-box.js +2 -2
- package/cjs/circular-gauge.d.ts +4 -4
- package/cjs/circular-gauge.js +2 -2
- package/cjs/color-box.d.ts +2 -2
- package/cjs/color-box.js +2 -2
- package/cjs/common/charts.d.ts +2 -2
- 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 +2 -2
- package/cjs/core/component-base.d.ts +3 -2
- package/cjs/core/component-base.js +11 -9
- 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 +2 -2
- package/cjs/core/helpers.js +2 -2
- package/cjs/core/nested-option.d.ts +2 -2
- package/cjs/core/nested-option.js +2 -2
- package/cjs/core/options-manager.d.ts +3 -4
- package/cjs/core/options-manager.js +8 -10
- package/cjs/core/template-manager.d.ts +2 -2
- package/cjs/core/template-manager.js +14 -12
- package/cjs/core/template-wrapper.d.ts +2 -2
- package/cjs/core/template-wrapper.js +5 -5
- package/cjs/core/template.d.ts +2 -2
- package/cjs/core/template.js +2 -2
- package/cjs/core/types.d.ts +15 -5
- package/cjs/core/types.js +2 -2
- package/cjs/core/widget-config.d.ts +2 -2
- package/cjs/core/widget-config.js +2 -2
- package/cjs/data-grid.d.ts +20 -20
- package/cjs/data-grid.js +2 -2
- package/cjs/date-box.d.ts +13 -13
- package/cjs/date-box.js +17 -2
- package/cjs/date-range-box.d.ts +17 -17
- package/cjs/date-range-box.js +22 -2
- package/cjs/defer-rendering.d.ts +5 -3
- package/cjs/defer-rendering.js +2 -2
- package/cjs/diagram.d.ts +2 -2
- package/cjs/diagram.js +2 -2
- package/cjs/draggable.d.ts +2 -2
- package/cjs/draggable.js +2 -2
- package/cjs/drawer.d.ts +2 -2
- package/cjs/drawer.js +2 -2
- package/cjs/drop-down-box.d.ts +2 -2
- package/cjs/drop-down-box.js +2 -2
- package/cjs/drop-down-button.d.ts +3 -10
- package/cjs/drop-down-button.js +2 -2
- package/cjs/file-manager.d.ts +2 -2
- package/cjs/file-manager.js +2 -2
- package/cjs/file-uploader.d.ts +2 -2
- package/cjs/file-uploader.js +2 -2
- package/cjs/filter-builder.d.ts +8 -8
- package/cjs/filter-builder.js +2 -2
- package/cjs/form.d.ts +8 -8
- package/cjs/form.js +2 -2
- package/cjs/funnel.d.ts +4 -4
- package/cjs/funnel.js +2 -2
- package/cjs/gallery.d.ts +2 -2
- package/cjs/gallery.js +2 -2
- package/cjs/gantt.d.ts +6 -6
- package/cjs/gantt.js +4 -2
- package/cjs/html-editor.d.ts +2 -2
- package/cjs/html-editor.js +2 -2
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +2 -2
- package/cjs/linear-gauge.d.ts +4 -4
- package/cjs/linear-gauge.js +2 -2
- package/cjs/list.d.ts +2 -2
- package/cjs/list.js +2 -2
- package/cjs/load-indicator.d.ts +2 -2
- package/cjs/load-indicator.js +2 -2
- package/cjs/load-panel.d.ts +2 -2
- package/cjs/load-panel.js +2 -2
- package/cjs/lookup.d.ts +2 -2
- package/cjs/lookup.js +2 -2
- package/cjs/map.d.ts +2 -2
- package/cjs/map.js +2 -2
- package/cjs/menu.d.ts +2 -2
- package/cjs/menu.js +2 -2
- package/cjs/multi-view.d.ts +2 -2
- package/cjs/multi-view.js +2 -2
- package/cjs/number-box.d.ts +4 -4
- package/cjs/number-box.js +2 -2
- package/cjs/pie-chart.d.ts +8 -8
- package/cjs/pie-chart.js +2 -2
- package/cjs/pivot-grid-field-chooser.d.ts +2 -2
- package/cjs/pivot-grid-field-chooser.js +2 -2
- package/cjs/pivot-grid.d.ts +2 -2
- package/cjs/pivot-grid.js +2 -2
- package/cjs/polar-chart.d.ts +51 -50
- package/cjs/polar-chart.js +2 -2
- package/cjs/popover.d.ts +2 -2
- package/cjs/popover.js +2 -2
- package/cjs/popup.d.ts +2 -2
- package/cjs/popup.js +2 -2
- package/cjs/progress-bar.d.ts +2 -2
- package/cjs/progress-bar.js +2 -2
- package/cjs/radio-group.d.ts +2 -2
- package/cjs/radio-group.js +2 -2
- package/cjs/range-selector.d.ts +37 -37
- package/cjs/range-selector.js +2 -2
- package/cjs/range-slider.d.ts +4 -4
- package/cjs/range-slider.js +2 -2
- package/cjs/recurrence-editor.d.ts +2 -2
- package/cjs/recurrence-editor.js +2 -2
- package/cjs/resizable.d.ts +2 -2
- package/cjs/resizable.js +2 -2
- package/cjs/responsive-box.d.ts +2 -2
- package/cjs/responsive-box.js +2 -2
- package/cjs/sankey.d.ts +4 -4
- package/cjs/sankey.js +2 -2
- package/cjs/scheduler.d.ts +5 -5
- package/cjs/scheduler.js +17 -2
- package/cjs/scroll-view.d.ts +2 -2
- package/cjs/scroll-view.js +2 -2
- package/cjs/select-box.d.ts +2 -2
- package/cjs/select-box.js +2 -2
- package/cjs/slider.d.ts +4 -4
- package/cjs/slider.js +2 -2
- package/cjs/sortable.d.ts +2 -2
- package/cjs/sortable.js +2 -2
- package/cjs/sparkline.d.ts +4 -4
- package/cjs/sparkline.js +2 -2
- package/cjs/speed-dial-action.d.ts +2 -2
- package/cjs/speed-dial-action.js +2 -2
- package/cjs/switch.d.ts +2 -2
- package/cjs/switch.js +2 -2
- package/cjs/tab-panel.d.ts +2 -2
- package/cjs/tab-panel.js +2 -2
- package/cjs/tabs.d.ts +2 -2
- package/cjs/tabs.js +2 -2
- package/cjs/tag-box.d.ts +2 -2
- package/cjs/tag-box.js +2 -2
- package/cjs/text-area.d.ts +2 -2
- package/cjs/text-area.js +2 -2
- package/cjs/text-box.d.ts +2 -2
- package/cjs/text-box.js +2 -2
- package/cjs/tile-view.d.ts +2 -2
- package/cjs/tile-view.js +2 -2
- package/cjs/toast.d.ts +2 -2
- package/cjs/toast.js +2 -2
- package/cjs/toolbar.d.ts +2 -2
- package/cjs/toolbar.js +2 -2
- package/cjs/tooltip.d.ts +2 -2
- package/cjs/tooltip.js +2 -2
- package/cjs/tree-list.d.ts +14 -14
- package/cjs/tree-list.js +2 -2
- package/cjs/tree-map.d.ts +4 -4
- package/cjs/tree-map.js +2 -2
- package/cjs/tree-view.d.ts +2 -2
- package/cjs/tree-view.js +2 -2
- package/cjs/validation-group.d.ts +2 -2
- package/cjs/validation-group.js +2 -2
- package/cjs/validation-summary.d.ts +2 -2
- package/cjs/validation-summary.js +2 -2
- package/cjs/validator.d.ts +8 -8
- package/cjs/validator.js +2 -2
- package/cjs/vector-map.d.ts +2 -2
- package/cjs/vector-map.js +2 -2
- package/esm/accordion.js +2 -2
- package/esm/action-sheet.js +2 -2
- package/esm/autocomplete.js +2 -2
- package/esm/bar-gauge.js +2 -2
- package/esm/box.js +2 -2
- package/esm/bullet.js +2 -2
- package/esm/button-group.js +2 -2
- package/esm/button.js +2 -2
- package/esm/calendar.js +18 -2
- package/esm/chart.js +2 -2
- package/esm/check-box.js +2 -2
- package/esm/circular-gauge.js +2 -2
- package/esm/color-box.js +2 -2
- 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 +2 -2
- package/esm/core/component-base.js +11 -9
- 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 +2 -2
- package/esm/core/nested-option.js +2 -2
- package/esm/core/options-manager.js +8 -10
- package/esm/core/template-manager.js +14 -12
- package/esm/core/template-wrapper.js +5 -5
- package/esm/core/template.js +2 -2
- package/esm/core/types.js +2 -2
- package/esm/core/widget-config.js +2 -2
- package/esm/data-grid.js +2 -2
- package/esm/date-box.js +17 -2
- package/esm/date-range-box.js +22 -2
- package/esm/defer-rendering.js +2 -2
- package/esm/diagram.js +2 -2
- package/esm/draggable.js +2 -2
- package/esm/drawer.js +2 -2
- package/esm/drop-down-box.js +2 -2
- package/esm/drop-down-button.js +2 -2
- package/esm/file-manager.js +2 -2
- package/esm/file-uploader.js +2 -2
- package/esm/filter-builder.js +2 -2
- package/esm/form.js +2 -2
- package/esm/funnel.js +2 -2
- package/esm/gallery.js +2 -2
- package/esm/gantt.js +4 -2
- package/esm/html-editor.js +2 -2
- package/esm/index.js +2 -2
- package/esm/linear-gauge.js +2 -2
- package/esm/list.js +2 -2
- package/esm/load-indicator.js +2 -2
- package/esm/load-panel.js +2 -2
- package/esm/lookup.js +2 -2
- package/esm/map.js +2 -2
- package/esm/menu.js +2 -2
- package/esm/multi-view.js +2 -2
- package/esm/number-box.js +2 -2
- package/esm/pie-chart.js +2 -2
- package/esm/pivot-grid-field-chooser.js +2 -2
- package/esm/pivot-grid.js +2 -2
- package/esm/polar-chart.js +2 -2
- package/esm/popover.js +2 -2
- package/esm/popup.js +2 -2
- package/esm/progress-bar.js +2 -2
- package/esm/radio-group.js +2 -2
- package/esm/range-selector.js +2 -2
- package/esm/range-slider.js +2 -2
- package/esm/recurrence-editor.js +2 -2
- package/esm/resizable.js +2 -2
- package/esm/responsive-box.js +2 -2
- package/esm/sankey.js +2 -2
- package/esm/scheduler.js +17 -2
- package/esm/scroll-view.js +2 -2
- package/esm/select-box.js +2 -2
- package/esm/slider.js +2 -2
- package/esm/sortable.js +2 -2
- package/esm/sparkline.js +2 -2
- package/esm/speed-dial-action.js +2 -2
- package/esm/switch.js +2 -2
- package/esm/tab-panel.js +2 -2
- package/esm/tabs.js +2 -2
- package/esm/tag-box.js +2 -2
- package/esm/text-area.js +2 -2
- package/esm/text-box.js +2 -2
- package/esm/tile-view.js +2 -2
- package/esm/toast.js +2 -2
- package/esm/toolbar.js +2 -2
- package/esm/tooltip.js +2 -2
- package/esm/tree-list.js +2 -2
- package/esm/tree-map.js +2 -2
- package/esm/tree-view.js +2 -2
- package/esm/validation-group.js +2 -2
- package/esm/validation-summary.js +2 -2
- package/esm/validator.js +2 -2
- package/esm/vector-map.js +2 -2
- package/package.json +3 -3
package/cjs/context-menu.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -38,6 +38,7 @@ declare abstract class ComponentBase<P extends IHtmlOptions> extends React.PureC
|
|
|
38
38
|
protected readonly independentEvents: string[];
|
|
39
39
|
private _createDXTemplates;
|
|
40
40
|
private _clearInstantiationModels;
|
|
41
|
+
private _updateTemplates;
|
|
41
42
|
private _childNodes;
|
|
42
43
|
private readonly _optionsManager;
|
|
43
44
|
protected useRequestAnimationFrameFlag: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -134,9 +134,12 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
134
134
|
}
|
|
135
135
|
};
|
|
136
136
|
ComponentBase.prototype.componentDidUpdate = function (prevProps) {
|
|
137
|
+
var _a;
|
|
137
138
|
this._updateCssClasses(prevProps, this.props);
|
|
138
139
|
var config = this._getConfig();
|
|
139
|
-
this._optionsManager.
|
|
140
|
+
var templateOptions = this._optionsManager.getTemplateOptions(config);
|
|
141
|
+
var dxTemplates = ((_a = this._createDXTemplates) === null || _a === void 0 ? void 0 : _a.call(this, templateOptions)) || {};
|
|
142
|
+
this._optionsManager.update(config, dxTemplates);
|
|
140
143
|
this._scheduleTemplatesUpdate();
|
|
141
144
|
};
|
|
142
145
|
ComponentBase.prototype.componentWillUnmount = function () {
|
|
@@ -158,7 +161,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
158
161
|
var options = __assign({ templatesRenderAsynchronously: true }, this._optionsManager.getInitialOptions(config));
|
|
159
162
|
var templateOptions = this._optionsManager.getTemplateOptions(config);
|
|
160
163
|
var dxTemplates = (_a = this._createDXTemplates) === null || _a === void 0 ? void 0 : _a.call(this, templateOptions);
|
|
161
|
-
if (dxTemplates) {
|
|
164
|
+
if (dxTemplates && Object.keys(dxTemplates).length) {
|
|
162
165
|
options = __assign(__assign({}, options), { integrationOptions: {
|
|
163
166
|
templates: dxTemplates,
|
|
164
167
|
} });
|
|
@@ -181,10 +184,7 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
181
184
|
updateFunc(function () {
|
|
182
185
|
var _a;
|
|
183
186
|
_this.guardsUpdateScheduled = false;
|
|
184
|
-
|
|
185
|
-
var templateOptions = _this._optionsManager.getTemplateOptions(config);
|
|
186
|
-
var dxTemplates = ((_a = _this._createDXTemplates) === null || _a === void 0 ? void 0 : _a.call(_this, templateOptions, function () { return options_manager_1.scheduleGuards(); })) || {};
|
|
187
|
-
_this._optionsManager.updateTemplates(dxTemplates);
|
|
187
|
+
(_a = _this._updateTemplates) === null || _a === void 0 ? void 0 : _a.call(_this, function () { return options_manager_1.scheduleGuards(); });
|
|
188
188
|
});
|
|
189
189
|
options_manager_1.unscheduleGuards();
|
|
190
190
|
};
|
|
@@ -244,9 +244,11 @@ var ComponentBase = /** @class */ (function (_super) {
|
|
|
244
244
|
var _a;
|
|
245
245
|
(_a = this.context) === null || _a === void 0 ? void 0 : _a.unlock();
|
|
246
246
|
};
|
|
247
|
-
ComponentBase.prototype._setTemplateManagerHooks = function (
|
|
247
|
+
ComponentBase.prototype._setTemplateManagerHooks = function (_a) {
|
|
248
|
+
var createDXTemplates = _a.createDXTemplates, clearInstantiationModels = _a.clearInstantiationModels, updateTemplates = _a.updateTemplates;
|
|
248
249
|
this._createDXTemplates = createDXTemplates;
|
|
249
250
|
this._clearInstantiationModels = clearInstantiationModels;
|
|
251
|
+
this._updateTemplates = updateTemplates;
|
|
250
252
|
};
|
|
251
253
|
ComponentBase.prototype.renderChildren = function () {
|
|
252
254
|
// @ts-expect-error TS2339
|
package/cjs/core/component.d.ts
CHANGED
package/cjs/core/component.js
CHANGED
package/cjs/core/config.d.ts
CHANGED
package/cjs/core/config.js
CHANGED
package/cjs/core/helpers.d.ts
CHANGED
package/cjs/core/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -26,8 +26,7 @@ declare class OptionsManager {
|
|
|
26
26
|
setInstance(instance: unknown, config: IConfigNode, subscribableOptions: string[], independentEvents: string[]): void;
|
|
27
27
|
getInitialOptions(rootNode: IConfigNode): Record<string, unknown>;
|
|
28
28
|
getTemplateOptions(rootNode: IConfigNode): Record<string, ITemplate>;
|
|
29
|
-
update(config: IConfigNode): void;
|
|
30
|
-
updateTemplates(dxtemplates: DXTemplateCollection): void;
|
|
29
|
+
update(config: IConfigNode, dxtemplates: DXTemplateCollection): void;
|
|
31
30
|
onOptionChanged(e: {
|
|
32
31
|
name: string;
|
|
33
32
|
fullName: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -80,7 +80,7 @@ var OptionsManager = /** @class */ (function () {
|
|
|
80
80
|
var config = tree_1.buildConfig(rootNode, false);
|
|
81
81
|
return config.templates;
|
|
82
82
|
};
|
|
83
|
-
OptionsManager.prototype.update = function (config) {
|
|
83
|
+
OptionsManager.prototype.update = function (config, dxtemplates) {
|
|
84
84
|
var _this = this;
|
|
85
85
|
var changedOptions = [];
|
|
86
86
|
var optionChangedHandler = function (_a) {
|
|
@@ -97,6 +97,11 @@ var OptionsManager = /** @class */ (function () {
|
|
|
97
97
|
changes.removedOptions.forEach(function (optionName) {
|
|
98
98
|
_this.resetOption(optionName);
|
|
99
99
|
});
|
|
100
|
+
if (Object.keys(dxtemplates).length > 0) {
|
|
101
|
+
this.setValue('integrationOptions', {
|
|
102
|
+
templates: dxtemplates,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
100
105
|
Object.keys(changes.options).forEach(function (key) {
|
|
101
106
|
_this.setValue(key, changes.options[key]);
|
|
102
107
|
});
|
|
@@ -113,13 +118,6 @@ var OptionsManager = /** @class */ (function () {
|
|
|
113
118
|
});
|
|
114
119
|
this.instance.endUpdate();
|
|
115
120
|
};
|
|
116
|
-
OptionsManager.prototype.updateTemplates = function (dxtemplates) {
|
|
117
|
-
if (Object.keys(dxtemplates).length > 0) {
|
|
118
|
-
this.setValue('integrationOptions', {
|
|
119
|
-
templates: dxtemplates,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
121
|
OptionsManager.prototype.onOptionChanged = function (e) {
|
|
124
122
|
var _this = this;
|
|
125
123
|
var _a;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -80,9 +80,9 @@ function normalizeProps(props) {
|
|
|
80
80
|
var TemplateManager = function (_a) {
|
|
81
81
|
var init = _a.init;
|
|
82
82
|
var _b = __read(react_1.useState(new helpers_1.TemplateInstantiationModels()), 2), instantiationModels = _b[0], setInstantiationModels = _b[1];
|
|
83
|
-
var _c = __read(react_1.useState(
|
|
84
|
-
var _d = __read(react_1.useState(), 2), componentCallback = _d[0], setComponentCallback = _d[1];
|
|
83
|
+
var _c = __read(react_1.useState(), 2), updateContext = _c[0], setUpdateContext = _c[1];
|
|
85
84
|
var widgetId = react_1.useRef('');
|
|
85
|
+
var templateFactories = react_1.useRef({});
|
|
86
86
|
var subscribeOnRemoval = react_1.useCallback(function (container, onRemoved) {
|
|
87
87
|
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
88
88
|
events.on(container, component_base_1.DX_REMOVE_EVENT, onRemoved);
|
|
@@ -141,15 +141,14 @@ var TemplateManager = function (_a) {
|
|
|
141
141
|
default: return function () { return React.createElement(React.Fragment); };
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
function
|
|
144
|
+
function createDXTemplates(templateOptions) {
|
|
145
145
|
var factories = Object.entries(templateOptions)
|
|
146
146
|
.reduce(function (res, _a) {
|
|
147
147
|
var _b;
|
|
148
148
|
var _c = __read(_a, 2), key = _c[0], template = _c[1];
|
|
149
149
|
return (__assign(__assign({}, res), (_b = {}, _b[key] = getTemplateFunction(template), _b)));
|
|
150
150
|
}, {});
|
|
151
|
-
|
|
152
|
-
setComponentCallback(callback);
|
|
151
|
+
templateFactories.current = factories;
|
|
153
152
|
var dxTemplates = Object.keys(factories)
|
|
154
153
|
.reduce(function (templates, templateKey) {
|
|
155
154
|
templates[templateKey] = { render: getRenderFunc(templateKey) };
|
|
@@ -161,20 +160,23 @@ var TemplateManager = function (_a) {
|
|
|
161
160
|
widgetId.current = getRandomId();
|
|
162
161
|
setInstantiationModels(new helpers_1.TemplateInstantiationModels());
|
|
163
162
|
}
|
|
164
|
-
|
|
163
|
+
function updateTemplates(onUpdated) {
|
|
164
|
+
setUpdateContext({ onUpdated: onUpdated });
|
|
165
|
+
}
|
|
166
|
+
init({ createDXTemplates: createDXTemplates, clearInstantiationModels: clearInstantiationModels, updateTemplates: updateTemplates });
|
|
165
167
|
}, [init, getRenderFunc]);
|
|
166
168
|
react_1.useEffect(function () {
|
|
167
|
-
if (
|
|
168
|
-
|
|
169
|
+
if (updateContext) {
|
|
170
|
+
updateContext.onUpdated();
|
|
169
171
|
}
|
|
170
|
-
}, []);
|
|
172
|
+
}, [updateContext]);
|
|
171
173
|
if (instantiationModels.empty) {
|
|
172
174
|
return null;
|
|
173
175
|
}
|
|
174
176
|
return (React.createElement(React.Fragment, null, Array.from(instantiationModels).map(function (_a) {
|
|
175
177
|
var _b = __read(_a, 2), _c = _b[0], data = _c.key1, container = _c.key2, _d = _b[1], index = _d.index, templateKey = _d.templateKey, componentKey = _d.componentKey, onRendered = _d.onRendered, onRemoved = _d.onRemoved;
|
|
176
178
|
subscribeOnRemoval(container, onRemoved);
|
|
177
|
-
return React.createElement(template_wrapper_1.TemplateWrapper, { key: componentKey, templateFactory: templateFactories[templateKey], data: data, index: index, container: container, onRemoved: onRemoved, onRendered: onRendered });
|
|
179
|
+
return React.createElement(template_wrapper_1.TemplateWrapper, { key: componentKey, templateFactory: templateFactories.current[templateKey], data: data, index: index, container: container, onRemoved: onRemoved, onRendered: onRendered });
|
|
178
180
|
})));
|
|
179
181
|
};
|
|
180
182
|
exports.TemplateManager = TemplateManager;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -78,7 +78,7 @@ var TemplateWrapperComponent = function (_a) {
|
|
|
78
78
|
var hiddenNodeElement = react_1.useRef();
|
|
79
79
|
var removalListenerElement = react_1.useRef();
|
|
80
80
|
var onTemplateRemoved = react_1.useCallback(function (_, args) {
|
|
81
|
-
if ((args === null || args === void 0 ? void 0 : args.isUnmounting) || isRemovalLocked) {
|
|
81
|
+
if ((args === null || args === void 0 ? void 0 : args.isUnmounting) || isRemovalLocked.current) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
if (element.current) {
|
|
@@ -91,11 +91,11 @@ var TemplateWrapperComponent = function (_a) {
|
|
|
91
91
|
}, [onRemoved]);
|
|
92
92
|
react_1.useLayoutEffect(function () {
|
|
93
93
|
var el = element.current;
|
|
94
|
-
if (el) {
|
|
94
|
+
if (el && el.nodeType === Node.ELEMENT_NODE) {
|
|
95
95
|
events.off(el, component_base_1.DX_REMOVE_EVENT, onTemplateRemoved);
|
|
96
96
|
events.on(el, component_base_1.DX_REMOVE_EVENT, onTemplateRemoved);
|
|
97
97
|
}
|
|
98
|
-
if (!removalListenerRequired) {
|
|
98
|
+
else if (!removalListenerRequired) {
|
|
99
99
|
setRemovalListenerRequired(true);
|
|
100
100
|
}
|
|
101
101
|
else if (removalListenerElement.current) {
|
package/cjs/core/template.d.ts
CHANGED
package/cjs/core/template.js
CHANGED
package/cjs/core/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date:
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 2023
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) 2012 - 2023 Developer Express Inc. ALL RIGHTS RESERVED
|
|
7
7
|
*
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* https://github.com/DevExpress/devextreme-react
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
+
import { ReactNode } from 'react';
|
|
14
15
|
import { ITemplate } from './configuration/config-node';
|
|
15
16
|
interface DXTemplate {
|
|
16
17
|
render: RenderFunc;
|
|
@@ -40,10 +41,19 @@ export interface TemplateWrapperProps {
|
|
|
40
41
|
onRendered: () => void;
|
|
41
42
|
onRemoved: () => void;
|
|
42
43
|
}
|
|
43
|
-
export declare type TemplateFunc = (arg: TemplateArgs) => JSX.Element;
|
|
44
|
-
export declare type
|
|
44
|
+
export declare type TemplateFunc = (arg: TemplateArgs) => JSX.Element | ReactNode;
|
|
45
|
+
export declare type UpdateTemplateFunc = (onUpdated: () => void) => void;
|
|
46
|
+
export interface InitArgument {
|
|
47
|
+
createDXTemplates: DXTemplateCreator;
|
|
48
|
+
clearInstantiationModels: () => void;
|
|
49
|
+
updateTemplates: UpdateTemplateFunc;
|
|
50
|
+
}
|
|
51
|
+
export interface TemplateManagerUpdateContext {
|
|
52
|
+
onUpdated: () => void;
|
|
53
|
+
}
|
|
54
|
+
export declare type DXTemplateCreator = (templateOptions: Record<string, ITemplate>) => DXTemplateCollection;
|
|
45
55
|
export interface TemplateManagerProps {
|
|
46
|
-
init: (
|
|
56
|
+
init: (args: InitArgument) => void;
|
|
47
57
|
}
|
|
48
58
|
export interface TemplateInstantiationModel {
|
|
49
59
|
templateKey: string;
|
package/cjs/core/types.js
CHANGED