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
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* devextreme-react
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 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 __assign = (this && this.__assign) || function () {
|
|
15
|
+
__assign = Object.assign || function(t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
19
|
+
t[p] = s[p];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
return __assign.apply(this, arguments);
|
|
24
|
+
};
|
|
25
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
26
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
|
+
if (!m) return o;
|
|
28
|
+
var i = m.call(o), r, ar = [], e;
|
|
29
|
+
try {
|
|
30
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
31
|
+
}
|
|
32
|
+
catch (error) { e = { error: error }; }
|
|
33
|
+
finally {
|
|
34
|
+
try {
|
|
35
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
36
|
+
}
|
|
37
|
+
finally { if (e) throw e.error; }
|
|
38
|
+
}
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
import * as React from 'react';
|
|
42
|
+
import * as events from 'devextreme/events';
|
|
43
|
+
import { useState, useMemo, useCallback, useEffect, useRef, } from 'react';
|
|
44
|
+
import { TemplateWrapper } from './template-wrapper';
|
|
45
|
+
import { TemplateInstantiationModels, generateID } from './helpers';
|
|
46
|
+
import { DX_REMOVE_EVENT } from './component-base';
|
|
47
|
+
import { getOption as getConfigOption } from './config';
|
|
48
|
+
function normalizeProps(props) {
|
|
49
|
+
if (getConfigOption('useLegacyTemplateEngine')) {
|
|
50
|
+
var model = props.data;
|
|
51
|
+
if (model && Object.prototype.hasOwnProperty.call(model, 'key')) {
|
|
52
|
+
model.dxkey = model.key;
|
|
53
|
+
}
|
|
54
|
+
return model;
|
|
55
|
+
}
|
|
56
|
+
return props;
|
|
57
|
+
}
|
|
58
|
+
export var TemplateManager = function (_a) {
|
|
59
|
+
var init = _a.init;
|
|
60
|
+
var _b = __read(useState(new TemplateInstantiationModels()), 2), instantiationModels = _b[0], setInstantiationModels = _b[1];
|
|
61
|
+
var _c = __read(useState(), 2), updateContext = _c[0], setUpdateContext = _c[1];
|
|
62
|
+
var widgetId = useRef('');
|
|
63
|
+
var templateFactories = useRef({});
|
|
64
|
+
var subscribeOnRemoval = useCallback(function (container, onRemoved) {
|
|
65
|
+
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
66
|
+
events.on(container, DX_REMOVE_EVENT, onRemoved);
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
var unsubscribeOnRemoval = useCallback(function (container, onRemoved) {
|
|
70
|
+
if (container.nodeType === Node.ELEMENT_NODE) {
|
|
71
|
+
events.off(container, DX_REMOVE_EVENT, onRemoved);
|
|
72
|
+
}
|
|
73
|
+
}, []);
|
|
74
|
+
var createMapKey = useCallback(function (key1, key2) { return ({ key1: key1, key2: key2 }); }, []);
|
|
75
|
+
var getRandomId = useCallback(function () { return "" + generateID() + generateID() + generateID(); }, []);
|
|
76
|
+
var getRenderFunc = useCallback(function (templateKey) { return function (_a) {
|
|
77
|
+
var data = _a.model, index = _a.index, container = _a.container, onRendered = _a.onRendered;
|
|
78
|
+
var key = createMapKey(data, container);
|
|
79
|
+
var onRemoved = function () {
|
|
80
|
+
setInstantiationModels(function (currentInstantiationModels) {
|
|
81
|
+
var template = currentInstantiationModels.get(key);
|
|
82
|
+
if (template) {
|
|
83
|
+
currentInstantiationModels.delete(key);
|
|
84
|
+
return currentInstantiationModels.shallowCopy();
|
|
85
|
+
}
|
|
86
|
+
return currentInstantiationModels;
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
var hostWidgetId = widgetId.current;
|
|
90
|
+
setInstantiationModels(function (currentInstantiationModels) {
|
|
91
|
+
currentInstantiationModels.set(key, {
|
|
92
|
+
templateKey: templateKey,
|
|
93
|
+
index: index,
|
|
94
|
+
componentKey: getRandomId(),
|
|
95
|
+
onRendered: function () {
|
|
96
|
+
unsubscribeOnRemoval(container, onRemoved);
|
|
97
|
+
if (hostWidgetId === widgetId.current) {
|
|
98
|
+
onRendered === null || onRendered === void 0 ? void 0 : onRendered();
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
onRemoved: onRemoved,
|
|
102
|
+
});
|
|
103
|
+
return currentInstantiationModels.shallowCopy();
|
|
104
|
+
});
|
|
105
|
+
return container;
|
|
106
|
+
}; }, [unsubscribeOnRemoval, createMapKey]);
|
|
107
|
+
useMemo(function () {
|
|
108
|
+
function getTemplateFunction(template) {
|
|
109
|
+
switch (template.type) {
|
|
110
|
+
case 'children': return function () { return template.content; };
|
|
111
|
+
case 'render': return function (props) {
|
|
112
|
+
normalizeProps(props);
|
|
113
|
+
return template.content(props.data, props.index);
|
|
114
|
+
};
|
|
115
|
+
case 'component': return function (props) {
|
|
116
|
+
props = normalizeProps(props);
|
|
117
|
+
return React.createElement.bind(null, template.content)(props);
|
|
118
|
+
};
|
|
119
|
+
default: return function () { return React.createElement(React.Fragment); };
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function createDXTemplates(templateOptions) {
|
|
123
|
+
var factories = Object.entries(templateOptions)
|
|
124
|
+
.reduce(function (res, _a) {
|
|
125
|
+
var _b;
|
|
126
|
+
var _c = __read(_a, 2), key = _c[0], template = _c[1];
|
|
127
|
+
return (__assign(__assign({}, res), (_b = {}, _b[key] = getTemplateFunction(template), _b)));
|
|
128
|
+
}, {});
|
|
129
|
+
templateFactories.current = factories;
|
|
130
|
+
var dxTemplates = Object.keys(factories)
|
|
131
|
+
.reduce(function (templates, templateKey) {
|
|
132
|
+
templates[templateKey] = { render: getRenderFunc(templateKey) };
|
|
133
|
+
return templates;
|
|
134
|
+
}, {});
|
|
135
|
+
return dxTemplates;
|
|
136
|
+
}
|
|
137
|
+
function clearInstantiationModels() {
|
|
138
|
+
widgetId.current = getRandomId();
|
|
139
|
+
setInstantiationModels(new TemplateInstantiationModels());
|
|
140
|
+
}
|
|
141
|
+
function updateTemplates(onUpdated) {
|
|
142
|
+
setUpdateContext({ onUpdated: onUpdated });
|
|
143
|
+
}
|
|
144
|
+
init({ createDXTemplates: createDXTemplates, clearInstantiationModels: clearInstantiationModels, updateTemplates: updateTemplates });
|
|
145
|
+
}, [init, getRenderFunc]);
|
|
146
|
+
useEffect(function () {
|
|
147
|
+
if (updateContext) {
|
|
148
|
+
updateContext.onUpdated();
|
|
149
|
+
}
|
|
150
|
+
}, [updateContext]);
|
|
151
|
+
if (instantiationModels.empty) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return (React.createElement(React.Fragment, null, Array.from(instantiationModels).map(function (_a) {
|
|
155
|
+
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;
|
|
156
|
+
subscribeOnRemoval(container, onRemoved);
|
|
157
|
+
return React.createElement(TemplateWrapper, { key: componentKey, templateFactory: templateFactories.current[templateKey], data: data, index: index, container: container, onRemoved: onRemoved, onRendered: onRendered });
|
|
158
|
+
})));
|
|
159
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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,108 +11,104 @@
|
|
|
11
11
|
* https://github.com/DevExpress/devextreme-react
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
15
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16
|
+
if (!m) return o;
|
|
17
|
+
var i = m.call(o), r, ar = [], e;
|
|
18
|
+
try {
|
|
19
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
20
|
+
}
|
|
21
|
+
catch (error) { e = { error: error }; }
|
|
22
|
+
finally {
|
|
23
|
+
try {
|
|
24
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
25
|
+
}
|
|
26
|
+
finally { if (e) throw e.error; }
|
|
27
|
+
}
|
|
28
|
+
return ar;
|
|
29
|
+
};
|
|
30
30
|
import * as React from 'react';
|
|
31
|
-
import * as
|
|
31
|
+
import * as events from 'devextreme/events';
|
|
32
|
+
import { useCallback, useLayoutEffect, useEffect, useState, useRef, useMemo, memo, } from 'react';
|
|
33
|
+
import { createPortal } from 'react-dom';
|
|
32
34
|
import { DX_REMOVE_EVENT } from './component-base';
|
|
33
|
-
|
|
34
|
-
var
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_this._removalListenerRef = React.createRef();
|
|
44
|
-
_this.state = { removalListenerRequired: false };
|
|
45
|
-
_this._onDxRemove = _this._onDxRemove.bind(_this);
|
|
46
|
-
_this.getPreviousSiblingNode = _this.getPreviousSiblingNode.bind(_this);
|
|
47
|
-
return _this;
|
|
35
|
+
import { RemovalLockerContext } from './helpers';
|
|
36
|
+
var createHiddenNode = function (containerNodeName, ref, defaultElement) {
|
|
37
|
+
var style = { display: 'none' };
|
|
38
|
+
switch (containerNodeName) {
|
|
39
|
+
case 'TABLE':
|
|
40
|
+
return React.createElement("tbody", { style: style, ref: ref });
|
|
41
|
+
case 'TBODY':
|
|
42
|
+
return React.createElement("tr", { style: style, ref: ref });
|
|
43
|
+
default:
|
|
44
|
+
return React.createElement(defaultElement, { style: style, ref: ref });
|
|
48
45
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
46
|
+
};
|
|
47
|
+
var TemplateWrapperComponent = function (_a) {
|
|
48
|
+
var templateFactory = _a.templateFactory, data = _a.data, index = _a.index, container = _a.container, onRemoved = _a.onRemoved, onRendered = _a.onRendered;
|
|
49
|
+
var _b = __read(useState(false), 2), removalListenerRequired = _b[0], setRemovalListenerRequired = _b[1];
|
|
50
|
+
var isRemovalLocked = useRef(false);
|
|
51
|
+
var removalLocker = useMemo(function () { return ({
|
|
52
|
+
lock: function () { isRemovalLocked.current = true; },
|
|
53
|
+
unlock: function () { isRemovalLocked.current = false; },
|
|
54
|
+
}); }, []);
|
|
55
|
+
var element = useRef();
|
|
56
|
+
var hiddenNodeElement = useRef();
|
|
57
|
+
var removalListenerElement = useRef();
|
|
58
|
+
var onTemplateRemoved = useCallback(function (_, args) {
|
|
59
|
+
if ((args === null || args === void 0 ? void 0 : args.isUnmounting) || isRemovalLocked.current) {
|
|
60
|
+
return;
|
|
64
61
|
}
|
|
65
|
-
if (
|
|
66
|
-
|
|
62
|
+
if (element.current) {
|
|
63
|
+
events.off(element.current, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
67
64
|
}
|
|
68
|
-
if (
|
|
69
|
-
|
|
65
|
+
if (removalListenerElement.current) {
|
|
66
|
+
events.off(removalListenerElement.current, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
70
67
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
});
|
|
79
|
-
TemplateWrapper.prototype.getPreviousSiblingNode = function (node) {
|
|
80
|
-
this.hiddenElement = node;
|
|
81
|
-
this.element = node === null || node === void 0 ? void 0 : node.previousSibling;
|
|
82
|
-
};
|
|
83
|
-
TemplateWrapper.prototype._subscribeOnRemove = function () {
|
|
84
|
-
var node = this.element;
|
|
85
|
-
var removalListenerRequired = this.state.removalListenerRequired;
|
|
86
|
-
if (node && node.nodeType === Node.ELEMENT_NODE) {
|
|
87
|
-
this._subscribeOnElementRemoval(node);
|
|
88
|
-
return;
|
|
68
|
+
onRemoved();
|
|
69
|
+
}, [onRemoved]);
|
|
70
|
+
useLayoutEffect(function () {
|
|
71
|
+
var el = element.current;
|
|
72
|
+
if (el && el.nodeType === Node.ELEMENT_NODE) {
|
|
73
|
+
events.off(el, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
74
|
+
events.on(el, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
89
75
|
}
|
|
90
|
-
if (!removalListenerRequired) {
|
|
91
|
-
|
|
92
|
-
return;
|
|
76
|
+
else if (!removalListenerRequired) {
|
|
77
|
+
setRemovalListenerRequired(true);
|
|
93
78
|
}
|
|
94
|
-
if (
|
|
95
|
-
|
|
79
|
+
else if (removalListenerElement.current) {
|
|
80
|
+
events.off(removalListenerElement.current, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
81
|
+
events.on(removalListenerElement.current, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
96
82
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
83
|
+
return function () {
|
|
84
|
+
if (element.current) {
|
|
85
|
+
container.appendChild(element.current);
|
|
86
|
+
}
|
|
87
|
+
if (hiddenNodeElement.current) {
|
|
88
|
+
container.appendChild(hiddenNodeElement.current);
|
|
89
|
+
}
|
|
90
|
+
if (removalListenerElement.current) {
|
|
91
|
+
container.appendChild(removalListenerElement.current);
|
|
92
|
+
}
|
|
93
|
+
if (el) {
|
|
94
|
+
events.off(el, DX_REMOVE_EVENT, onTemplateRemoved);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}, [onTemplateRemoved, removalListenerRequired, container]);
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
onRendered();
|
|
100
|
+
}, [onRendered]);
|
|
101
|
+
var hiddenNode = createHiddenNode(container === null || container === void 0 ? void 0 : container.nodeName, function (node) {
|
|
102
|
+
hiddenNodeElement.current = node;
|
|
103
|
+
element.current = node === null || node === void 0 ? void 0 : node.previousSibling;
|
|
104
|
+
}, 'div');
|
|
105
|
+
var removalListener = removalListenerRequired
|
|
106
|
+
? createHiddenNode(container === null || container === void 0 ? void 0 : container.nodeName, function (node) { removalListenerElement.current = node; }, 'span')
|
|
107
|
+
: undefined;
|
|
108
|
+
return createPortal(React.createElement(React.Fragment, null,
|
|
109
|
+
React.createElement(RemovalLockerContext.Provider, { value: removalLocker },
|
|
110
|
+
templateFactory({ data: data, index: index, onRendered: onRendered }),
|
|
111
|
+
hiddenNode,
|
|
112
|
+
removalListener)), container);
|
|
113
|
+
};
|
|
114
|
+
export var TemplateWrapper = memo(TemplateWrapperComponent);
|
package/esm/core/template.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* devextreme-react
|
|
3
|
+
* Version: 23.2.3
|
|
4
|
+
* Build date: Tue Nov 28 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
|
+
export {};
|
package/esm/data-grid.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
package/esm/date-box.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -114,13 +115,24 @@ DateBox.propTypes = {
|
|
|
114
115
|
PropTypes.oneOf([
|
|
115
116
|
"static",
|
|
116
117
|
"floating",
|
|
117
|
-
"hidden"
|
|
118
|
+
"hidden",
|
|
119
|
+
"outside"
|
|
118
120
|
])
|
|
119
121
|
]),
|
|
122
|
+
max: PropTypes.oneOfType([
|
|
123
|
+
PropTypes.instanceOf(Date),
|
|
124
|
+
PropTypes.number,
|
|
125
|
+
PropTypes.string
|
|
126
|
+
]),
|
|
120
127
|
maxLength: PropTypes.oneOfType([
|
|
121
128
|
PropTypes.number,
|
|
122
129
|
PropTypes.string
|
|
123
130
|
]),
|
|
131
|
+
min: PropTypes.oneOfType([
|
|
132
|
+
PropTypes.instanceOf(Date),
|
|
133
|
+
PropTypes.number,
|
|
134
|
+
PropTypes.string
|
|
135
|
+
]),
|
|
124
136
|
name: PropTypes.string,
|
|
125
137
|
onChange: PropTypes.func,
|
|
126
138
|
onClosed: PropTypes.func,
|
|
@@ -203,6 +215,11 @@ DateBox.propTypes = {
|
|
|
203
215
|
"pending"
|
|
204
216
|
])
|
|
205
217
|
]),
|
|
218
|
+
value: PropTypes.oneOfType([
|
|
219
|
+
PropTypes.instanceOf(Date),
|
|
220
|
+
PropTypes.number,
|
|
221
|
+
PropTypes.string
|
|
222
|
+
]),
|
|
206
223
|
valueChangeEvent: PropTypes.string,
|
|
207
224
|
visible: PropTypes.bool,
|
|
208
225
|
width: PropTypes.oneOfType([
|
package/esm/date-range-box.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -92,6 +93,11 @@ DateRangeBox.propTypes = {
|
|
|
92
93
|
]),
|
|
93
94
|
dropDownOptions: PropTypes.object,
|
|
94
95
|
elementAttr: PropTypes.object,
|
|
96
|
+
endDate: PropTypes.oneOfType([
|
|
97
|
+
PropTypes.instanceOf(Date),
|
|
98
|
+
PropTypes.number,
|
|
99
|
+
PropTypes.string
|
|
100
|
+
]),
|
|
95
101
|
endDateLabel: PropTypes.string,
|
|
96
102
|
endDateName: PropTypes.string,
|
|
97
103
|
endDateOutOfRangeMessage: PropTypes.string,
|
|
@@ -114,9 +120,20 @@ DateRangeBox.propTypes = {
|
|
|
114
120
|
PropTypes.oneOf([
|
|
115
121
|
"static",
|
|
116
122
|
"floating",
|
|
117
|
-
"hidden"
|
|
123
|
+
"hidden",
|
|
124
|
+
"outside"
|
|
118
125
|
])
|
|
119
126
|
]),
|
|
127
|
+
max: PropTypes.oneOfType([
|
|
128
|
+
PropTypes.instanceOf(Date),
|
|
129
|
+
PropTypes.number,
|
|
130
|
+
PropTypes.string
|
|
131
|
+
]),
|
|
132
|
+
min: PropTypes.oneOfType([
|
|
133
|
+
PropTypes.instanceOf(Date),
|
|
134
|
+
PropTypes.number,
|
|
135
|
+
PropTypes.string
|
|
136
|
+
]),
|
|
120
137
|
multiView: PropTypes.bool,
|
|
121
138
|
onChange: PropTypes.func,
|
|
122
139
|
onClosed: PropTypes.func,
|
|
@@ -142,6 +159,11 @@ DateRangeBox.propTypes = {
|
|
|
142
159
|
showClearButton: PropTypes.bool,
|
|
143
160
|
showDropDownButton: PropTypes.bool,
|
|
144
161
|
spellcheck: PropTypes.bool,
|
|
162
|
+
startDate: PropTypes.oneOfType([
|
|
163
|
+
PropTypes.instanceOf(Date),
|
|
164
|
+
PropTypes.number,
|
|
165
|
+
PropTypes.string
|
|
166
|
+
]),
|
|
145
167
|
startDateLabel: PropTypes.string,
|
|
146
168
|
startDateName: PropTypes.string,
|
|
147
169
|
startDateOutOfRangeMessage: PropTypes.string,
|
package/esm/defer-rendering.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
package/esm/diagram.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
package/esm/draggable.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
package/esm/drawer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
package/esm/drop-down-box.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* devextreme-react
|
|
3
|
-
* Version: 23.2.
|
|
4
|
-
* Build date: Tue
|
|
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
|
+
"use client";
|
|
14
15
|
var __extends = (this && this.__extends) || (function () {
|
|
15
16
|
var extendStatics = function (d, b) {
|
|
16
17
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -102,7 +103,8 @@ DropDownBox.propTypes = {
|
|
|
102
103
|
PropTypes.oneOf([
|
|
103
104
|
"static",
|
|
104
105
|
"floating",
|
|
105
|
-
"hidden"
|
|
106
|
+
"hidden",
|
|
107
|
+
"outside"
|
|
106
108
|
])
|
|
107
109
|
]),
|
|
108
110
|
maxLength: PropTypes.oneOfType([
|