ods-component-lib 1.18.229 → 1.18.231
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/antd/currencyInput/OdsCurrencyInput.stories.d.ts +5 -2
- package/dist/components/antd/currencyInput/types.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1118 -48
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1118 -49
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
- package/dist/components/antd/modal/OdsAdvanceModal.d.ts +0 -7
- package/dist/components/devextreme/OdsTimeline/OdsTimeline.Constants.d.ts +0 -4
- package/dist/components/devextreme/OdsTimeline/OdsTimeline.Functions.d.ts +0 -6
- package/dist/components/devextreme/OdsTimeline/OdsTimeline.Types.d.ts +0 -77
- package/dist/components/devextreme/OdsTimeline/OdsTimeline.d.ts +0 -5
- package/dist/components/devextreme/OdsTimeline/OdsTimelineDateFilter.d.ts +0 -3
- package/dist/components/devextreme/OdsTimeline/OdsTimelineSelectionColumn.d.ts +0 -2
- package/dist/stories/OdsAdvanceModal/OdsAdvanceModal.stories.d.ts +0 -42
- package/dist/stories/OdsAdvanceModal/Samples/BasicOdsAdvanceModal.sample.d.ts +0 -8
- package/dist/stories/OdsBasicDataGrid/OdsBasicDataGrid.stories.d.ts +0 -110
- package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.Constants.d.ts +0 -14
- package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.MockData.d.ts +0 -7
- package/dist/stories/OdsBasicDataGrid/Samples/MergeCells/MergeCells.Sample.d.ts +0 -1
- package/dist/stories/OdsModal/Samples/OdsModal.Sample.d.ts +0 -1
- package/dist/stories/OdsPivotGrid/OdsPivotGrid.stories.d.ts +0 -15
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Constants.d.ts +0 -2
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.MockData.d.ts +0 -7
- package/dist/stories/OdsPivotGrid/Samples/BasicPivotGrid/BasicPivotGrid.Sample.d.ts +0 -1
- package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.Constants.d.ts +0 -5
- package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.MockData.d.ts +0 -6
- package/dist/stories/OdsRemoteDataGrid/Samples/MergeCells/MergeCells.Sample.d.ts +0 -1
- package/dist/stories/OdsTimePicker/Samples/TimeRangePicker.d.ts +0 -2
- package/dist/stories/OdsTimeline/OdsTimeline.Constants.d.ts +0 -3
- package/dist/stories/OdsTimeline/OdsTimeline.Functions.d.ts +0 -6
- package/dist/stories/OdsTimeline/OdsTimeline.MockData.d.ts +0 -39
package/dist/index.modern.js
CHANGED
|
@@ -22,6 +22,37 @@ import { createStyles } from 'antd-style';
|
|
|
22
22
|
import { saveAs as saveAs$1 } from 'file-saver';
|
|
23
23
|
import 'devextreme/dist/css/dx.light.css';
|
|
24
24
|
|
|
25
|
+
function _toPrimitive(t, r) {
|
|
26
|
+
if ("object" != typeof t || !t) return t;
|
|
27
|
+
var e = t[Symbol.toPrimitive];
|
|
28
|
+
if (void 0 !== e) {
|
|
29
|
+
var i = e.call(t, r || "default");
|
|
30
|
+
if ("object" != typeof i) return i;
|
|
31
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32
|
+
}
|
|
33
|
+
return ("string" === r ? String : Number)(t);
|
|
34
|
+
}
|
|
35
|
+
function _toPropertyKey(t) {
|
|
36
|
+
var i = _toPrimitive(t, "string");
|
|
37
|
+
return "symbol" == typeof i ? i : i + "";
|
|
38
|
+
}
|
|
39
|
+
function _defineProperties(target, props) {
|
|
40
|
+
for (var i = 0; i < props.length; i++) {
|
|
41
|
+
var descriptor = props[i];
|
|
42
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
43
|
+
descriptor.configurable = true;
|
|
44
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
45
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
49
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
50
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
51
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
52
|
+
writable: false
|
|
53
|
+
});
|
|
54
|
+
return Constructor;
|
|
55
|
+
}
|
|
25
56
|
function _extends() {
|
|
26
57
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
27
58
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -37705,12 +37736,12 @@ var CurrencySelect = function CurrencySelect(_ref) {
|
|
|
37705
37736
|
}));
|
|
37706
37737
|
};
|
|
37707
37738
|
|
|
37708
|
-
var _excluded$7 = ["currencySelectProps", "defaultValue", "locale", "dontFormatValue", "min"];
|
|
37739
|
+
var _excluded$7 = ["currencySelectProps", "defaultValue", "locale", "dontFormatValue", "min", "asPercentage", "isOnRight"];
|
|
37709
37740
|
var _templateObject$z;
|
|
37710
37741
|
var useStyles$9 = createStyles(function (_ref) {
|
|
37711
37742
|
var css = _ref.css;
|
|
37712
37743
|
return {
|
|
37713
|
-
Wrapper: css(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n
|
|
37744
|
+
Wrapper: css(_templateObject$z || (_templateObject$z = _taggedTemplateLiteralLoose(["\n width: 100%;\n "])))
|
|
37714
37745
|
};
|
|
37715
37746
|
});
|
|
37716
37747
|
var OdsCurrencyInput = function OdsCurrencyInput(_ref2) {
|
|
@@ -37718,10 +37749,12 @@ var OdsCurrencyInput = function OdsCurrencyInput(_ref2) {
|
|
|
37718
37749
|
_ref2$defaultValue = _ref2.defaultValue,
|
|
37719
37750
|
defaultValue = _ref2$defaultValue === void 0 ? "" : _ref2$defaultValue,
|
|
37720
37751
|
_ref2$locale = _ref2.locale,
|
|
37721
|
-
locale = _ref2$locale === void 0 ?
|
|
37752
|
+
locale = _ref2$locale === void 0 ? "tr-TR" : _ref2$locale,
|
|
37722
37753
|
dontFormatValue = _ref2.dontFormatValue,
|
|
37723
37754
|
_ref2$min = _ref2.min,
|
|
37724
37755
|
min = _ref2$min === void 0 ? 0 : _ref2$min,
|
|
37756
|
+
asPercentage = _ref2.asPercentage,
|
|
37757
|
+
isOnRight = _ref2.isOnRight,
|
|
37725
37758
|
props = _objectWithoutPropertiesLoose(_ref2, _excluded$7);
|
|
37726
37759
|
var _useStyles = useStyles$9(),
|
|
37727
37760
|
styles = _useStyles.styles;
|
|
@@ -37732,6 +37765,9 @@ var OdsCurrencyInput = function OdsCurrencyInput(_ref2) {
|
|
|
37732
37765
|
});
|
|
37733
37766
|
}, [currencySelectProps]);
|
|
37734
37767
|
var currencySelector = useMemo(function () {
|
|
37768
|
+
if (asPercentage) {
|
|
37769
|
+
return "%";
|
|
37770
|
+
}
|
|
37735
37771
|
if (!currencySelectProps || !currencySelectProps.currencyOptions || currencySelectProps.currencyOptions.length === 0) {
|
|
37736
37772
|
return undefined;
|
|
37737
37773
|
} else if (currencySelectProps.fixedCurrency) {
|
|
@@ -37751,7 +37787,8 @@ var OdsCurrencyInput = function OdsCurrencyInput(_ref2) {
|
|
|
37751
37787
|
}, React.createElement(InputNumber, Object.assign({
|
|
37752
37788
|
defaultValue: defaultValue,
|
|
37753
37789
|
min: min,
|
|
37754
|
-
addonBefore: currencySelector,
|
|
37790
|
+
addonBefore: !isOnRight && currencySelector,
|
|
37791
|
+
addonAfter: isOnRight && currencySelector,
|
|
37755
37792
|
value: props.value,
|
|
37756
37793
|
className: styles.Wrapper,
|
|
37757
37794
|
onChange: function onChange(value) {
|
|
@@ -37771,9 +37808,1041 @@ var formatValue = function formatValue(value, locale) {
|
|
|
37771
37808
|
};
|
|
37772
37809
|
var parseValue = function parseValue(stringNumber, locale) {
|
|
37773
37810
|
if (!stringNumber) return stringNumber;
|
|
37774
|
-
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g,
|
|
37775
|
-
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g,
|
|
37776
|
-
return parseFloat(stringNumber.replace(new RegExp(
|
|
37811
|
+
var thousandSeparator = Intl.NumberFormat(locale).format(11111).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, "");
|
|
37812
|
+
var decimalSeparator = Intl.NumberFormat(locale).format(1.1).replace(/(?:[0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDF50-\uDF59\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDEC0-\uDEC9\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD839[\uDCF0-\uDCF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])/g, "");
|
|
37813
|
+
return parseFloat(stringNumber.replace(new RegExp("\\" + thousandSeparator, "g"), "").replace(new RegExp("\\" + decimalSeparator), "."));
|
|
37814
|
+
};
|
|
37815
|
+
|
|
37816
|
+
var _templateObject$A, _templateObject2$8, _templateObject3$5, _templateObject4$4;
|
|
37817
|
+
var useStyles$a = createStyles(function (_ref) {
|
|
37818
|
+
var css = _ref.css;
|
|
37819
|
+
return {
|
|
37820
|
+
grid: css(_templateObject$A || (_templateObject$A = _taggedTemplateLiteralLoose(["\n & .grid-cell-selected {\n background-color: lightgreen;\n }\n & .grid-cell-disable-text-selection {\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n & .grid-cell-disable-colored {\n background-color: lightgray;\n }\n & .grid-summary-row-label {\n font-weight: 900;\n /* border-bottom: 1px solid lightgray; */\n }\n & .grid-summary-row-data {\n /* border-bottom: 1px solid lightgray; */\n }\n & .grid-toolbar-button-item {\n padding: 0 !important;\n }\n "]))),
|
|
37821
|
+
gridCustomSummary: css(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n background-color: rgb(255, 255, 255);\n border-radius: 0px 0px 16px 16px;\n font-size: 13px;\n text-align: unset;\n padding: 17px 16px 3px 15px;\n font-weight: 600;\n border-top: 1px solid #ededed;\n "]))),
|
|
37822
|
+
mergeCellChild: css(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteralLoose(["\n display: none;\n "]))),
|
|
37823
|
+
mergeCellRoot: css(_templateObject4$4 || (_templateObject4$4 = _taggedTemplateLiteralLoose(["\n text-align: left;\n vertical-align: middle;\n "])))
|
|
37824
|
+
};
|
|
37825
|
+
});
|
|
37826
|
+
|
|
37827
|
+
var checkCellSelectionConstraints$1 = function checkCellSelectionConstraints(e) {
|
|
37828
|
+
return e.rowType == "data" && e.columnIndex > -1 && e.rowIndex > -1;
|
|
37829
|
+
};
|
|
37830
|
+
var cellAlreadySelected$1 = function cellAlreadySelected(pkValue, dataField, cellInfos) {
|
|
37831
|
+
return cellInfos.some(function (cell) {
|
|
37832
|
+
return cell.pkValue == pkValue && cell.dataField == dataField;
|
|
37833
|
+
});
|
|
37834
|
+
};
|
|
37835
|
+
var getMultiLevelColumns$1 = function getMultiLevelColumns(col) {
|
|
37836
|
+
return col.multiLevelColumns && col.multiLevelColumns.map(function (colItem) {
|
|
37837
|
+
return React.createElement(Column, Object.assign({
|
|
37838
|
+
width: 80
|
|
37839
|
+
}, colItem), getMultiLevelColumns(colItem));
|
|
37840
|
+
});
|
|
37841
|
+
};
|
|
37842
|
+
|
|
37843
|
+
var constants$2 = {
|
|
37844
|
+
totalPageCount: 1,
|
|
37845
|
+
loadedPageCount: 1,
|
|
37846
|
+
totalRecordCount: 0,
|
|
37847
|
+
exportFormats: ["xlsx"],
|
|
37848
|
+
selectedCellBgColor: "#c1f9b8",
|
|
37849
|
+
allowedDataTypesForMultiCellEditing: ["number"]
|
|
37850
|
+
};
|
|
37851
|
+
var onCancelEditEvent$1 = new CustomEvent("cancelEdit", {
|
|
37852
|
+
bubbles: true,
|
|
37853
|
+
detail: {
|
|
37854
|
+
rowData: null
|
|
37855
|
+
}
|
|
37856
|
+
});
|
|
37857
|
+
var dataFieldNameActions = "Actions";
|
|
37858
|
+
|
|
37859
|
+
var OdsMergeCellDataGridHelper = /*#__PURE__*/function () {
|
|
37860
|
+
function OdsMergeCellDataGridHelper() {
|
|
37861
|
+
var _this = this;
|
|
37862
|
+
this.sortDataSource = function () {
|
|
37863
|
+
var _this$_dataSource;
|
|
37864
|
+
if (_this._mergeDataFields && _this._mergeDataFields.length > 0 && ((_this$_dataSource = _this._dataSource) === null || _this$_dataSource === void 0 ? void 0 : _this$_dataSource.length) > 0) {
|
|
37865
|
+
var compareResults = [];
|
|
37866
|
+
var conditionString = "";
|
|
37867
|
+
_this._dataSource = _this._dataSource.sort(function (a, b) {
|
|
37868
|
+
compareResults = _this._mergeDataFields.map(function (dataField) {
|
|
37869
|
+
return _this.compareData(a[dataField], b[dataField], _this.getDataType(dataField));
|
|
37870
|
+
});
|
|
37871
|
+
conditionString = compareResults.join("||");
|
|
37872
|
+
return eval(conditionString);
|
|
37873
|
+
});
|
|
37874
|
+
}
|
|
37875
|
+
return _this._dataSource;
|
|
37876
|
+
};
|
|
37877
|
+
this.compareData = function (value1, value2, dataType) {
|
|
37878
|
+
switch (dataType) {
|
|
37879
|
+
case "string":
|
|
37880
|
+
return String(value1).localeCompare(String(value2));
|
|
37881
|
+
case "number":
|
|
37882
|
+
return Number(value2) - Number(value1);
|
|
37883
|
+
default:
|
|
37884
|
+
return 0;
|
|
37885
|
+
}
|
|
37886
|
+
};
|
|
37887
|
+
this.getDataType = function (dataField) {
|
|
37888
|
+
var column = _this._columns.find(function (x) {
|
|
37889
|
+
return x.dataField == dataField;
|
|
37890
|
+
});
|
|
37891
|
+
return column === null || column === void 0 ? void 0 : column.dataType;
|
|
37892
|
+
};
|
|
37893
|
+
this.mergeDataSource = function (keyExpr) {
|
|
37894
|
+
var _this$_dataSource2;
|
|
37895
|
+
var mergedCells = [];
|
|
37896
|
+
if (_this._mergeDataFields && _this._mergeDataFields.length > 0 && ((_this$_dataSource2 = _this._dataSource) === null || _this$_dataSource2 === void 0 ? void 0 : _this$_dataSource2.length) > 0) {
|
|
37897
|
+
var keyName = Array.isArray(keyExpr) ? keyExpr[0] : keyExpr;
|
|
37898
|
+
var rowCurrent;
|
|
37899
|
+
var rowPrev;
|
|
37900
|
+
var dataFieldCurrent;
|
|
37901
|
+
var dataFieldNext;
|
|
37902
|
+
var _loop = function _loop(index) {
|
|
37903
|
+
rowCurrent = _this._dataSource[index];
|
|
37904
|
+
rowPrev = _this._dataSource[index - 1];
|
|
37905
|
+
for (var index1 = 0; index1 < _this._mergeDataFields.length; index1++) {
|
|
37906
|
+
dataFieldCurrent = _this._mergeDataFields[index1];
|
|
37907
|
+
if (rowCurrent[dataFieldCurrent] == rowPrev[dataFieldCurrent]) {
|
|
37908
|
+
if (mergedCells.some(function (x) {
|
|
37909
|
+
return x.FieldName == dataFieldCurrent && x.EndRowIndex == index - 1;
|
|
37910
|
+
})) {
|
|
37911
|
+
var cell = mergedCells.find(function (x) {
|
|
37912
|
+
return x.FieldName == dataFieldCurrent && x.EndRowIndex == index - 1;
|
|
37913
|
+
});
|
|
37914
|
+
cell.EndRowIndex = index;
|
|
37915
|
+
} else {
|
|
37916
|
+
mergedCells.push({
|
|
37917
|
+
FieldName: dataFieldCurrent,
|
|
37918
|
+
StartRowIndex: index - 1,
|
|
37919
|
+
EndRowIndex: index,
|
|
37920
|
+
StartKey: rowPrev[keyName],
|
|
37921
|
+
Type: "Original"
|
|
37922
|
+
});
|
|
37923
|
+
}
|
|
37924
|
+
}
|
|
37925
|
+
}
|
|
37926
|
+
};
|
|
37927
|
+
for (var index = 1; index < _this._dataSource.length; index++) {
|
|
37928
|
+
_loop(index);
|
|
37929
|
+
}
|
|
37930
|
+
var newStartRowIndex = 0,
|
|
37931
|
+
newEndRowIndex = 0,
|
|
37932
|
+
keyValue;
|
|
37933
|
+
for (var _index = 0; _index < _this._mergeDataFields.length - 1; _index++) {
|
|
37934
|
+
dataFieldCurrent = _this._mergeDataFields[_index];
|
|
37935
|
+
dataFieldNext = _this._mergeDataFields[_index + 1];
|
|
37936
|
+
if (!mergedCells.some(function (item) {
|
|
37937
|
+
return item.FieldName == dataFieldCurrent;
|
|
37938
|
+
}) || !mergedCells.some(function (item) {
|
|
37939
|
+
return item.FieldName == dataFieldCurrent && item.Type != "OutOfScope";
|
|
37940
|
+
})) {
|
|
37941
|
+
mergedCells.filter(function (item) {
|
|
37942
|
+
return item.FieldName == dataFieldNext;
|
|
37943
|
+
}).map(function (item) {
|
|
37944
|
+
item.Type = "OutOfScope";
|
|
37945
|
+
return item;
|
|
37946
|
+
});
|
|
37947
|
+
} else {
|
|
37948
|
+
mergedCells.filter(function (x) {
|
|
37949
|
+
return x.FieldName == dataFieldCurrent && x.Type != "OutOfScope";
|
|
37950
|
+
}).map(function (item) {
|
|
37951
|
+
mergedCells.filter(function (x) {
|
|
37952
|
+
return x.FieldName == dataFieldNext && x.Type != "New" && x.Type != "Placed";
|
|
37953
|
+
}).map(function (item1) {
|
|
37954
|
+
newStartRowIndex = 0;
|
|
37955
|
+
newEndRowIndex = 0;
|
|
37956
|
+
if (item1.StartRowIndex < item.EndRowIndex && item1.EndRowIndex > item.StartRowIndex) {
|
|
37957
|
+
if (item1.StartRowIndex < item.StartRowIndex) {
|
|
37958
|
+
newStartRowIndex = item.StartRowIndex;
|
|
37959
|
+
item1.Type = "Dirty";
|
|
37960
|
+
keyValue = item.StartKey;
|
|
37961
|
+
} else {
|
|
37962
|
+
newStartRowIndex = item1.StartRowIndex;
|
|
37963
|
+
keyValue = item1.StartKey;
|
|
37964
|
+
}
|
|
37965
|
+
if (item1.EndRowIndex > item.EndRowIndex) {
|
|
37966
|
+
newEndRowIndex = item.EndRowIndex;
|
|
37967
|
+
item1.Type = "Dirty";
|
|
37968
|
+
} else {
|
|
37969
|
+
newEndRowIndex = item1.EndRowIndex;
|
|
37970
|
+
}
|
|
37971
|
+
if (item1.Type == "Dirty") {
|
|
37972
|
+
mergedCells.push({
|
|
37973
|
+
FieldName: dataFieldNext,
|
|
37974
|
+
StartRowIndex: newStartRowIndex,
|
|
37975
|
+
EndRowIndex: newEndRowIndex,
|
|
37976
|
+
StartKey: keyValue,
|
|
37977
|
+
Type: "New"
|
|
37978
|
+
});
|
|
37979
|
+
} else {
|
|
37980
|
+
item1.Type = "Placed";
|
|
37981
|
+
}
|
|
37982
|
+
} else {
|
|
37983
|
+
item1.Type = "OutOfScope";
|
|
37984
|
+
}
|
|
37985
|
+
});
|
|
37986
|
+
});
|
|
37987
|
+
}
|
|
37988
|
+
}
|
|
37989
|
+
var _mergedCell = mergedCells.filter(function (x) {
|
|
37990
|
+
return x.Type != "Dirty" && x.Type != "OutOfScope";
|
|
37991
|
+
});
|
|
37992
|
+
return _mergedCell;
|
|
37993
|
+
}
|
|
37994
|
+
return mergedCells;
|
|
37995
|
+
};
|
|
37996
|
+
}
|
|
37997
|
+
return _createClass(OdsMergeCellDataGridHelper, [{
|
|
37998
|
+
key: "mergeDataFields",
|
|
37999
|
+
get: function get() {
|
|
38000
|
+
return this._mergeDataFields;
|
|
38001
|
+
},
|
|
38002
|
+
set: function set(val) {
|
|
38003
|
+
this._mergeDataFields = val;
|
|
38004
|
+
}
|
|
38005
|
+
}, {
|
|
38006
|
+
key: "dataSource",
|
|
38007
|
+
get: function get() {
|
|
38008
|
+
return this._dataSource;
|
|
38009
|
+
},
|
|
38010
|
+
set: function set(val) {
|
|
38011
|
+
this._dataSource = val;
|
|
38012
|
+
}
|
|
38013
|
+
}, {
|
|
38014
|
+
key: "columns",
|
|
38015
|
+
get: function get() {
|
|
38016
|
+
return this._columns;
|
|
38017
|
+
},
|
|
38018
|
+
set: function set(val) {
|
|
38019
|
+
this._columns = val;
|
|
38020
|
+
}
|
|
38021
|
+
}]);
|
|
38022
|
+
}();
|
|
38023
|
+
OdsMergeCellDataGridHelper.getInstance = function () {
|
|
38024
|
+
if (OdsMergeCellDataGridHelper._instance === null || OdsMergeCellDataGridHelper._instance === undefined) {
|
|
38025
|
+
return new OdsMergeCellDataGridHelper();
|
|
38026
|
+
}
|
|
38027
|
+
return OdsMergeCellDataGridHelper._instance;
|
|
38028
|
+
};
|
|
38029
|
+
|
|
38030
|
+
var useToken$2 = theme.useToken;
|
|
38031
|
+
var OdsMergeCellDataGrid = function OdsMergeCellDataGrid(props) {
|
|
38032
|
+
var _props$columnResizing, _props$className, _props$selection, _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
38033
|
+
var ref = props.ref,
|
|
38034
|
+
keyExpr = props.keyExpr,
|
|
38035
|
+
hasFastUpdate = props.hasFastUpdate,
|
|
38036
|
+
fastUpdateButtonText = props.fastUpdateButtonText,
|
|
38037
|
+
fastUpdateModalTitle = props.fastUpdateModalTitle,
|
|
38038
|
+
fastUpdateModalCancelText = props.fastUpdateModalCancelText,
|
|
38039
|
+
fastUpdateModalSaveText = props.fastUpdateModalSaveText,
|
|
38040
|
+
fastUpdateFormRequiredFieldMessage = props.fastUpdateFormRequiredFieldMessage,
|
|
38041
|
+
onCellClick = props.onCellClick,
|
|
38042
|
+
onCellHoverChanged = props.onCellHoverChanged,
|
|
38043
|
+
onFastUpdateButtonClick = props.onFastUpdateButtonClick,
|
|
38044
|
+
onFastUpdateFinish = props.onFastUpdateFinish,
|
|
38045
|
+
onFastUpdateCancel = props.onFastUpdateCancel,
|
|
38046
|
+
onFastUpdateFailed = props.onFastUpdateFailed,
|
|
38047
|
+
onCellPrepared = props.onCellPrepared,
|
|
38048
|
+
detailGridColumns = props.detailGridColumns,
|
|
38049
|
+
detailData = props.detailData,
|
|
38050
|
+
masterDetailFeatures = props.masterDetailFeatures;
|
|
38051
|
+
var _useToken = useToken$2(),
|
|
38052
|
+
token = _useToken.token;
|
|
38053
|
+
var _AntForm$useForm = Form$1.useForm(),
|
|
38054
|
+
fastUpdateForm = _AntForm$useForm[0];
|
|
38055
|
+
var gridRef = ref != null ? ref : useRef(null);
|
|
38056
|
+
var helper = OdsMergeCellDataGridHelper.getInstance();
|
|
38057
|
+
var pkName = keyExpr && keyExpr.toString();
|
|
38058
|
+
var _useState = useState(false),
|
|
38059
|
+
render = _useState[0],
|
|
38060
|
+
rerender = _useState[1];
|
|
38061
|
+
var _useState2 = useState(props.columns),
|
|
38062
|
+
gridColumns = _useState2[0],
|
|
38063
|
+
setGridColumns = _useState2[1];
|
|
38064
|
+
var _useState3 = useState([]),
|
|
38065
|
+
data = _useState3[0],
|
|
38066
|
+
setData = _useState3[1];
|
|
38067
|
+
var _useState4 = useState(false),
|
|
38068
|
+
isFastUpdateModalOpen = _useState4[0],
|
|
38069
|
+
setIsFastUpdateModalOpen = _useState4[1];
|
|
38070
|
+
var _useState5 = useState([]),
|
|
38071
|
+
selectedCells = _useState5[0],
|
|
38072
|
+
setSelectedCells = _useState5[1];
|
|
38073
|
+
var _useState6 = useState([]),
|
|
38074
|
+
hoveredCells = _useState6[0],
|
|
38075
|
+
setHoveredCells = _useState6[1];
|
|
38076
|
+
var _useState7 = useState([]),
|
|
38077
|
+
ctrlSelectedCells = _useState7[0],
|
|
38078
|
+
setCtrlSelectedCells = _useState7[1];
|
|
38079
|
+
var _useState8 = useState(false),
|
|
38080
|
+
ctrlSelection = _useState8[0],
|
|
38081
|
+
setCtrlSelection = _useState8[1];
|
|
38082
|
+
var _useState9 = useState([]),
|
|
38083
|
+
mergedCellInfo = _useState9[0],
|
|
38084
|
+
setMergedCellInfo = _useState9[1];
|
|
38085
|
+
var _useStyles = useStyles$a(),
|
|
38086
|
+
gridStyle = _useStyles.styles;
|
|
38087
|
+
useEffect(function () {
|
|
38088
|
+
helper.columns = props.columns;
|
|
38089
|
+
helper.dataSource = props.dataSource;
|
|
38090
|
+
helper.mergeDataFields = props.mergeDataFields;
|
|
38091
|
+
helper.sortDataSource();
|
|
38092
|
+
setMergedCellInfo(helper.mergeDataSource(props.keyExpr));
|
|
38093
|
+
setData(helper.dataSource);
|
|
38094
|
+
}, [props.dataSource]);
|
|
38095
|
+
useEffect(function () {
|
|
38096
|
+
constants$2.totalPageCount = 1;
|
|
38097
|
+
constants$2.loadedPageCount = 1;
|
|
38098
|
+
constants$2.totalRecordCount = 0;
|
|
38099
|
+
}, [props.dataGridPageName]);
|
|
38100
|
+
useEffect(function () {
|
|
38101
|
+
if (props.columns !== undefined && props.columns.length > 0) {
|
|
38102
|
+
var newColumns = props.columns.map(function (colItem) {
|
|
38103
|
+
if (colItem.tooltip !== undefined && colItem.tooltip.enable) {
|
|
38104
|
+
var headerCellRenderr = function headerCellRenderr() {
|
|
38105
|
+
return React.createElement("div", null, React.createElement("span", null, colItem.caption), React.createElement(Tooltip$1, {
|
|
38106
|
+
title: colItem.tooltip.title
|
|
38107
|
+
}, React.createElement(InfoCircleOutlined, {
|
|
38108
|
+
style: {
|
|
38109
|
+
marginLeft: 5
|
|
38110
|
+
}
|
|
38111
|
+
})));
|
|
38112
|
+
};
|
|
38113
|
+
colItem.headerCellRender = headerCellRenderr;
|
|
38114
|
+
}
|
|
38115
|
+
if (props.isServerSide) colItem.calculateSortValue = String("dummyFieldForPreventClientSideSorting");
|
|
38116
|
+
return colItem;
|
|
38117
|
+
});
|
|
38118
|
+
setGridColumns(newColumns);
|
|
38119
|
+
}
|
|
38120
|
+
}, [props.columns]);
|
|
38121
|
+
useEffect(function () {
|
|
38122
|
+
rerender(!render);
|
|
38123
|
+
}, [gridColumns]);
|
|
38124
|
+
useEffect(function () {
|
|
38125
|
+
locale(localStorage.getItem("locale"));
|
|
38126
|
+
loadMessages(JSON.parse(localStorage.getItem("localTranslation")));
|
|
38127
|
+
if (gridRef.current) {
|
|
38128
|
+
gridRef.current.instance.updateDimensions();
|
|
38129
|
+
}
|
|
38130
|
+
hasFastUpdate && document.addEventListener("keydown", keydownEvent);
|
|
38131
|
+
return function () {
|
|
38132
|
+
hasFastUpdate && document.removeEventListener("keydown", keydownEvent);
|
|
38133
|
+
};
|
|
38134
|
+
}, []);
|
|
38135
|
+
var keydownEvent = function keydownEvent(e) {
|
|
38136
|
+
switch (e.key) {
|
|
38137
|
+
case "Escape":
|
|
38138
|
+
{
|
|
38139
|
+
clearSelectedCells();
|
|
38140
|
+
}
|
|
38141
|
+
break;
|
|
38142
|
+
}
|
|
38143
|
+
};
|
|
38144
|
+
var clearSelectedCells = function clearSelectedCells() {
|
|
38145
|
+
setSelectedCells([]);
|
|
38146
|
+
};
|
|
38147
|
+
var singleSelect = function singleSelect(pkValue, dataField) {
|
|
38148
|
+
runSetSelectedCells([{
|
|
38149
|
+
dataField: dataField,
|
|
38150
|
+
pkValue: pkValue
|
|
38151
|
+
}]);
|
|
38152
|
+
};
|
|
38153
|
+
var multipleSelect = function multipleSelect(cells) {
|
|
38154
|
+
if (cells.length == 0) {
|
|
38155
|
+
return;
|
|
38156
|
+
}
|
|
38157
|
+
var _cells = [];
|
|
38158
|
+
var _loop = function _loop() {
|
|
38159
|
+
var element = cells[index];
|
|
38160
|
+
if (!_cells.some(function (cell) {
|
|
38161
|
+
return cell.colIndex == element.colIndex && cell.rowIndex == element.rowIndex;
|
|
38162
|
+
})) {
|
|
38163
|
+
_cells.push({
|
|
38164
|
+
colIndex: element.colIndex,
|
|
38165
|
+
rowIndex: element.rowIndex
|
|
38166
|
+
});
|
|
38167
|
+
}
|
|
38168
|
+
};
|
|
38169
|
+
for (var index = 0; index < cells.length; index++) {
|
|
38170
|
+
_loop();
|
|
38171
|
+
}
|
|
38172
|
+
var result = [];
|
|
38173
|
+
var maxColIndex = Math.max.apply(null, _cells.map(function (item) {
|
|
38174
|
+
return item.colIndex;
|
|
38175
|
+
}));
|
|
38176
|
+
var minColIndex = Math.min.apply(null, _cells.map(function (item) {
|
|
38177
|
+
return item.colIndex;
|
|
38178
|
+
}));
|
|
38179
|
+
var maxRowIndex = Math.max.apply(null, _cells.map(function (item) {
|
|
38180
|
+
return item.rowIndex;
|
|
38181
|
+
}));
|
|
38182
|
+
var minRowIndex = Math.min.apply(null, _cells.map(function (item) {
|
|
38183
|
+
return item.rowIndex;
|
|
38184
|
+
}));
|
|
38185
|
+
for (var rowIndex = minRowIndex; rowIndex <= maxRowIndex; rowIndex++) {
|
|
38186
|
+
var _loop2 = function _loop2() {
|
|
38187
|
+
var _column = gridRef.current.instance.columnOption(colIndex);
|
|
38188
|
+
if (constants$2.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
38189
|
+
return item.toLocaleLowerCase() == _column.dataType.toLocaleLowerCase();
|
|
38190
|
+
})) {
|
|
38191
|
+
result.push({
|
|
38192
|
+
dataField: _column.dataField,
|
|
38193
|
+
pkValue: gridRef.current.instance.cellValue(rowIndex, pkName)
|
|
38194
|
+
});
|
|
38195
|
+
}
|
|
38196
|
+
};
|
|
38197
|
+
for (var colIndex = minColIndex; colIndex <= maxColIndex; colIndex++) {
|
|
38198
|
+
_loop2();
|
|
38199
|
+
}
|
|
38200
|
+
}
|
|
38201
|
+
runSetSelectedCells(result);
|
|
38202
|
+
setHoveredCells([]);
|
|
38203
|
+
setCtrlSelectedCells([]);
|
|
38204
|
+
};
|
|
38205
|
+
var runSetSelectedCells = function runSetSelectedCells(value) {
|
|
38206
|
+
var removeDuplicates = function removeDuplicates(oldValues) {
|
|
38207
|
+
var result = [];
|
|
38208
|
+
var _loop3 = function _loop3() {
|
|
38209
|
+
var element = value[index];
|
|
38210
|
+
if (element.pkValue && !oldValues.some(function (cell) {
|
|
38211
|
+
return cell.dataField == element.dataField && cell.pkValue == element.pkValue;
|
|
38212
|
+
})) {
|
|
38213
|
+
result.push({
|
|
38214
|
+
dataField: element.dataField,
|
|
38215
|
+
pkValue: element.pkValue
|
|
38216
|
+
});
|
|
38217
|
+
}
|
|
38218
|
+
};
|
|
38219
|
+
for (var index = 0; index < value.length; index++) {
|
|
38220
|
+
_loop3();
|
|
38221
|
+
}
|
|
38222
|
+
return result;
|
|
38223
|
+
};
|
|
38224
|
+
setSelectedCells(function (prev) {
|
|
38225
|
+
return [].concat(prev, removeDuplicates(prev));
|
|
38226
|
+
});
|
|
38227
|
+
};
|
|
38228
|
+
var removeSelectedCell = function removeSelectedCell(rowIndex, colIndex) {
|
|
38229
|
+
var dataField = gridRef.current.instance.columnOption(colIndex).dataField;
|
|
38230
|
+
var pkValue = gridRef.current.instance.cellValue(rowIndex, pkName);
|
|
38231
|
+
setSelectedCells(function (prev) {
|
|
38232
|
+
return prev.filter(function (cell) {
|
|
38233
|
+
return !(cell.dataField == dataField && cell.pkValue == pkValue);
|
|
38234
|
+
});
|
|
38235
|
+
});
|
|
38236
|
+
};
|
|
38237
|
+
var closeModal = function closeModal() {
|
|
38238
|
+
setIsFastUpdateModalOpen(false);
|
|
38239
|
+
clearSelectedCells();
|
|
38240
|
+
fastUpdateForm.resetFields();
|
|
38241
|
+
};
|
|
38242
|
+
var actionButtons = useMemo(function () {
|
|
38243
|
+
if (props.actionButtonGroup) {
|
|
38244
|
+
if (props.actionButtonGroup.length > 3 && !props.edit) {
|
|
38245
|
+
return props.actionButtonGroup.slice(0, 2);
|
|
38246
|
+
} else {
|
|
38247
|
+
return props.actionButtonGroup;
|
|
38248
|
+
}
|
|
38249
|
+
} else {
|
|
38250
|
+
return [];
|
|
38251
|
+
}
|
|
38252
|
+
}, [props.actionButtonGroup]);
|
|
38253
|
+
var onEditorPreparing = useCallback(function (e) {
|
|
38254
|
+
if (e.row !== undefined && e.parentType === "dataRow") {
|
|
38255
|
+
if (props.handleEditorPreparing) {
|
|
38256
|
+
props.handleEditorPreparing(e);
|
|
38257
|
+
}
|
|
38258
|
+
}
|
|
38259
|
+
if (e.editorOptions && e.rowType === "data" && e.parentType === "dataRow") {
|
|
38260
|
+
e.editorOptions.onValueChanged = function (args) {
|
|
38261
|
+
if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$1);
|
|
38262
|
+
};
|
|
38263
|
+
}
|
|
38264
|
+
}, [props.isServerSide]);
|
|
38265
|
+
var customLoad = useCallback(function () {
|
|
38266
|
+
var state = JSON.parse(localStorage.getItem(props.exportFileName + "Storage"));
|
|
38267
|
+
if (localStorage.getItem(props.exportFileName + "Storage")) {
|
|
38268
|
+
state.selectedRowKeys = [];
|
|
38269
|
+
if (props.filterEnabledShow) state.filterPanel = {
|
|
38270
|
+
filterEnabled: false
|
|
38271
|
+
};else state.filterPanel = {
|
|
38272
|
+
filterEnabled: true
|
|
38273
|
+
};
|
|
38274
|
+
}
|
|
38275
|
+
return state;
|
|
38276
|
+
}, [props.filterEnabledShow]);
|
|
38277
|
+
var customSave = useCallback(function (state) {
|
|
38278
|
+
state.selectedRowKeys = [];
|
|
38279
|
+
if (props.filterEnabledShow) state.filterPanel = {
|
|
38280
|
+
filterEnabled: false
|
|
38281
|
+
};else state.filterPanel = {
|
|
38282
|
+
filterEnabled: true
|
|
38283
|
+
};
|
|
38284
|
+
if (data.length === 0) {
|
|
38285
|
+
if (!state.filterValue && state.filterValue !== null) {
|
|
38286
|
+
state.filterValue = null;
|
|
38287
|
+
}
|
|
38288
|
+
}
|
|
38289
|
+
localStorage.setItem(props.exportFileName + "Storage", JSON.stringify(state));
|
|
38290
|
+
}, [props.filterEnabledShow]);
|
|
38291
|
+
var onEditorPrepared = useCallback(function (info) {
|
|
38292
|
+
if (info.parentType === "filterRow" && info.editorName === "dxSelectBox" && (info.dataField === "IsActive" || info.dataField === "isActive")) {
|
|
38293
|
+
if (info.dataSource != null && info.dataSource.length > 0) {
|
|
38294
|
+
info.showAllText = info.dataSource.find(function (i) {
|
|
38295
|
+
return i.value === null;
|
|
38296
|
+
}).label;
|
|
38297
|
+
info.trueText = info.dataSource.find(function (i) {
|
|
38298
|
+
return i.value === true;
|
|
38299
|
+
}).label;
|
|
38300
|
+
info.falseText = info.dataSource.find(function (i) {
|
|
38301
|
+
return i.value === false;
|
|
38302
|
+
}).label;
|
|
38303
|
+
}
|
|
38304
|
+
}
|
|
38305
|
+
}, []);
|
|
38306
|
+
function actionCellRender(cellData, props) {
|
|
38307
|
+
var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length > 3 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button) {
|
|
38308
|
+
return {
|
|
38309
|
+
icon: button.icon,
|
|
38310
|
+
onClick: function onClick(event) {
|
|
38311
|
+
var customEvent = {
|
|
38312
|
+
column: cellData.column,
|
|
38313
|
+
component: cellData.component,
|
|
38314
|
+
element: cellData.element,
|
|
38315
|
+
event: event,
|
|
38316
|
+
model: cellData.data,
|
|
38317
|
+
row: cellData.row
|
|
38318
|
+
};
|
|
38319
|
+
button.onClick(customEvent);
|
|
38320
|
+
}
|
|
38321
|
+
};
|
|
38322
|
+
}) : [];
|
|
38323
|
+
var buttonElements = [];
|
|
38324
|
+
{
|
|
38325
|
+
!props.edit && actionButtons.forEach(function (buttonItem, index) {
|
|
38326
|
+
var isVisible = typeof buttonItem.visible === "function" ? buttonItem.visible({
|
|
38327
|
+
column: cellData.column,
|
|
38328
|
+
component: cellData.component,
|
|
38329
|
+
row: cellData.row
|
|
38330
|
+
}) : buttonItem.visible;
|
|
38331
|
+
buttonElements.push(React.createElement(OdsDataGrdiRowButton, Object.assign({
|
|
38332
|
+
key: "action-button-" + index,
|
|
38333
|
+
hint: buttonItem.hint,
|
|
38334
|
+
visible: isVisible,
|
|
38335
|
+
size: "small",
|
|
38336
|
+
type: "text",
|
|
38337
|
+
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
38338
|
+
icon: buttonItem.icon
|
|
38339
|
+
}, props.actionButtonsTooltipType === "styled" && {
|
|
38340
|
+
tooltip: buttonItem.hint
|
|
38341
|
+
}, {
|
|
38342
|
+
onClick: function onClick(event) {
|
|
38343
|
+
var customEvent = {
|
|
38344
|
+
column: cellData.column,
|
|
38345
|
+
component: cellData.component,
|
|
38346
|
+
element: cellData.element,
|
|
38347
|
+
event: event,
|
|
38348
|
+
model: cellData.data,
|
|
38349
|
+
row: cellData.row
|
|
38350
|
+
};
|
|
38351
|
+
buttonItem.onClick(customEvent);
|
|
38352
|
+
}
|
|
38353
|
+
})));
|
|
38354
|
+
});
|
|
38355
|
+
}
|
|
38356
|
+
{
|
|
38357
|
+
props.edit && actionButtons.forEach(function (buttonItem, index) {
|
|
38358
|
+
var isVisible = typeof buttonItem.visible === "function" ? buttonItem.visible({
|
|
38359
|
+
column: cellData.column,
|
|
38360
|
+
component: cellData.component,
|
|
38361
|
+
row: cellData.row
|
|
38362
|
+
}) : buttonItem.visible;
|
|
38363
|
+
buttonElements.push(React.createElement(OdsDataGrdiRowButton, Object.assign({
|
|
38364
|
+
key: "action-button-" + index,
|
|
38365
|
+
name: buttonItem.name,
|
|
38366
|
+
hint: buttonItem.hint,
|
|
38367
|
+
visible: isVisible,
|
|
38368
|
+
size: "small",
|
|
38369
|
+
type: "text",
|
|
38370
|
+
disabled: buttonItem.actionPermission === undefined ? false : !buttonItem.actionPermission,
|
|
38371
|
+
icon: buttonItem.icon
|
|
38372
|
+
}, props.actionButtonsTooltipType === "styled" && {
|
|
38373
|
+
tooltip: buttonItem.hint
|
|
38374
|
+
}, {
|
|
38375
|
+
onClick: function onClick(event) {
|
|
38376
|
+
if (buttonItem.onClick) {
|
|
38377
|
+
var customEvent = {
|
|
38378
|
+
column: cellData.column,
|
|
38379
|
+
component: cellData.component,
|
|
38380
|
+
element: cellData.element,
|
|
38381
|
+
event: event,
|
|
38382
|
+
model: cellData.data,
|
|
38383
|
+
row: cellData.row
|
|
38384
|
+
};
|
|
38385
|
+
buttonItem.onClick(customEvent);
|
|
38386
|
+
}
|
|
38387
|
+
}
|
|
38388
|
+
})));
|
|
38389
|
+
});
|
|
38390
|
+
}
|
|
38391
|
+
if (kebabMenuButtons.length > 0) {
|
|
38392
|
+
buttonElements.push(React.createElement(OdsDropdown, {
|
|
38393
|
+
key: "dropdown-" + (cellData.rowIndex || cellData.data.ID),
|
|
38394
|
+
menuItems: kebabMenuButtons
|
|
38395
|
+
}, React.createElement(OdsDataGrdiRowButton, {
|
|
38396
|
+
type: "text",
|
|
38397
|
+
icon: React.createElement(KebabMenuIcon, null)
|
|
38398
|
+
})));
|
|
38399
|
+
}
|
|
38400
|
+
return React.createElement(React.Fragment, null, buttonElements);
|
|
38401
|
+
}
|
|
38402
|
+
var onCustomCellClick = function onCustomCellClick(e) {
|
|
38403
|
+
if (hasFastUpdate) {
|
|
38404
|
+
if (checkCellSelectionConstraints$1(e) && constants$2.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
38405
|
+
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
38406
|
+
})) {
|
|
38407
|
+
if (!e.event.ctrlKey) {
|
|
38408
|
+
if (cellAlreadySelected$1(e.data[pkName], e.column.dataField, selectedCells)) {
|
|
38409
|
+
removeSelectedCell(e.rowIndex, e.columnIndex);
|
|
38410
|
+
} else {
|
|
38411
|
+
singleSelect(e.data[pkName], e.column.dataField);
|
|
38412
|
+
}
|
|
38413
|
+
} else {
|
|
38414
|
+
var selectedCell = {
|
|
38415
|
+
colIndex: e.columnIndex,
|
|
38416
|
+
rowIndex: e.rowIndex
|
|
38417
|
+
};
|
|
38418
|
+
if (ctrlSelection) {
|
|
38419
|
+
multipleSelect([].concat(ctrlSelectedCells, [selectedCell]));
|
|
38420
|
+
} else {
|
|
38421
|
+
setCtrlSelectedCells(function (prev) {
|
|
38422
|
+
return [].concat(prev, [selectedCell]);
|
|
38423
|
+
});
|
|
38424
|
+
}
|
|
38425
|
+
setCtrlSelection(function (prev) {
|
|
38426
|
+
return !prev;
|
|
38427
|
+
});
|
|
38428
|
+
}
|
|
38429
|
+
}
|
|
38430
|
+
}
|
|
38431
|
+
onCellClick && onCellClick(e);
|
|
38432
|
+
};
|
|
38433
|
+
var onCustomCellHoverChanged = function onCustomCellHoverChanged(e) {
|
|
38434
|
+
if (hasFastUpdate) {
|
|
38435
|
+
if (!e.event.ctrlKey && !ctrlSelection) {
|
|
38436
|
+
if (checkCellSelectionConstraints$1(e)) {
|
|
38437
|
+
if (e.event.buttons === 1) {
|
|
38438
|
+
setHoveredCells(function (prev) {
|
|
38439
|
+
return [].concat(prev, [{
|
|
38440
|
+
colIndex: e.columnIndex,
|
|
38441
|
+
rowIndex: e.rowIndex
|
|
38442
|
+
}]);
|
|
38443
|
+
});
|
|
38444
|
+
} else {
|
|
38445
|
+
multipleSelect(hoveredCells);
|
|
38446
|
+
}
|
|
38447
|
+
} else if (e.rowType != "data") {
|
|
38448
|
+
multipleSelect(hoveredCells);
|
|
38449
|
+
}
|
|
38450
|
+
}
|
|
38451
|
+
}
|
|
38452
|
+
onCellHoverChanged && onCellHoverChanged(e);
|
|
38453
|
+
};
|
|
38454
|
+
var onCustomFastUpdateButtonClick = function onCustomFastUpdateButtonClick(e) {
|
|
38455
|
+
if (selectedCells.length > 0) {
|
|
38456
|
+
setIsFastUpdateModalOpen(true);
|
|
38457
|
+
}
|
|
38458
|
+
onFastUpdateButtonClick && onFastUpdateButtonClick(e);
|
|
38459
|
+
};
|
|
38460
|
+
var onFastUpdateModalCancel = function onFastUpdateModalCancel(_e) {
|
|
38461
|
+
closeModal();
|
|
38462
|
+
onFastUpdateCancel && onFastUpdateCancel();
|
|
38463
|
+
};
|
|
38464
|
+
var onFastUpdateFormFinish = function onFastUpdateFormFinish(values) {
|
|
38465
|
+
onFastUpdateFinish && onFastUpdateFinish(values, selectedCells);
|
|
38466
|
+
closeModal();
|
|
38467
|
+
};
|
|
38468
|
+
var onFastUpdateFormFinishFailed = function onFastUpdateFormFinishFailed(errorInfo) {
|
|
38469
|
+
onFastUpdateFailed && onFastUpdateFailed(errorInfo);
|
|
38470
|
+
};
|
|
38471
|
+
var onClickFastUpdateFormCancel = function onClickFastUpdateFormCancel(_e) {
|
|
38472
|
+
closeModal();
|
|
38473
|
+
onFastUpdateCancel && onFastUpdateCancel();
|
|
38474
|
+
};
|
|
38475
|
+
var onCustomCellPrepared = function onCustomCellPrepared(e) {
|
|
38476
|
+
var _props$edit, _props$edit2;
|
|
38477
|
+
if (hasFastUpdate) {
|
|
38478
|
+
if (e.rowType === "data" && e.column.allowEditing && constants$2.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
38479
|
+
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
38480
|
+
})) {
|
|
38481
|
+
if (selectedCells.some(function (cell) {
|
|
38482
|
+
return cell.pkValue == e.data[pkName] && cell.dataField == e.column.dataField;
|
|
38483
|
+
})) {
|
|
38484
|
+
e.cellElement.classList.add("grid-cell-selected");
|
|
38485
|
+
}
|
|
38486
|
+
}
|
|
38487
|
+
}
|
|
38488
|
+
if (((_props$edit = props.edit) === null || _props$edit === void 0 ? void 0 : _props$edit.mode) == "cell" && (_props$edit2 = props.edit) !== null && _props$edit2 !== void 0 && _props$edit2.allowUpdating && e.rowType == "data" && !e.column.allowEditing) {
|
|
38489
|
+
e.cellElement.classList.add("grid-cell-disable-colored");
|
|
38490
|
+
}
|
|
38491
|
+
var isDifferentDataField = e.column.type == "selection" || e.column.dataField == dataFieldNameActions;
|
|
38492
|
+
if (e.rowType === "data" && e.columnIndex >= 0 && e.rowIndex >= 0 && (props.mergeDataFields.some(function (x) {
|
|
38493
|
+
return x == e.column.dataField;
|
|
38494
|
+
}) || isDifferentDataField)) {
|
|
38495
|
+
var dataIndex = e.component.getVisibleRows()[e.rowIndex].dataIndex;
|
|
38496
|
+
var dataField = isDifferentDataField ? props.mergeDataFields[0] : e.column.dataField;
|
|
38497
|
+
var mergedCells = mergedCellInfo.filter(function (x) {
|
|
38498
|
+
return x.FieldName == dataField;
|
|
38499
|
+
});
|
|
38500
|
+
if (mergedCells.length > 0) {
|
|
38501
|
+
var mergedCell = mergedCells.find(function (x) {
|
|
38502
|
+
return x.StartRowIndex == dataIndex;
|
|
38503
|
+
});
|
|
38504
|
+
if (mergedCell !== undefined) {
|
|
38505
|
+
e.cellElement.rowSpan = mergedCell.EndRowIndex - mergedCell.StartRowIndex + 1;
|
|
38506
|
+
e.cellElement.classList.add(gridStyle.mergeCellRoot);
|
|
38507
|
+
} else if (mergedCells.some(function (x) {
|
|
38508
|
+
return x.StartRowIndex < dataIndex && x.EndRowIndex >= dataIndex;
|
|
38509
|
+
})) {
|
|
38510
|
+
e.cellElement.classList.add(gridStyle.mergeCellChild);
|
|
38511
|
+
}
|
|
38512
|
+
}
|
|
38513
|
+
}
|
|
38514
|
+
onCellPrepared && onCellPrepared(e);
|
|
38515
|
+
};
|
|
38516
|
+
var onToolbarPreparing = function onToolbarPreparing(e) {
|
|
38517
|
+
if (props.toolbarButtonGroup && props.toolbarButtonGroup.length > 0) {
|
|
38518
|
+
e.toolbarOptions.items.unshift({
|
|
38519
|
+
location: "before",
|
|
38520
|
+
template: function template(_, __, container) {
|
|
38521
|
+
var wrapper = document.createElement("div");
|
|
38522
|
+
container.appendChild(wrapper);
|
|
38523
|
+
reactDom.render(React.createElement(React.StrictMode, null, props.toolbarButtonGroup && Array.isArray(props.toolbarButtonGroup) && props.toolbarButtonGroup.map(function (buttonGroupItem, index) {
|
|
38524
|
+
return React.createElement(OdsButton, {
|
|
38525
|
+
key: index,
|
|
38526
|
+
style: {
|
|
38527
|
+
marginLeft: token.margin
|
|
38528
|
+
},
|
|
38529
|
+
type: buttonGroupItem.type,
|
|
38530
|
+
onClick: buttonGroupItem.onClick
|
|
38531
|
+
}, buttonGroupItem.label);
|
|
38532
|
+
})), wrapper);
|
|
38533
|
+
}
|
|
38534
|
+
});
|
|
38535
|
+
}
|
|
38536
|
+
e.toolbarOptions.items.unshift({
|
|
38537
|
+
location: "before",
|
|
38538
|
+
cssClass: "toolbarTitleItem",
|
|
38539
|
+
template: function template(_, __, container) {
|
|
38540
|
+
var wrapper = document.createElement("div");
|
|
38541
|
+
container.appendChild(wrapper);
|
|
38542
|
+
reactDom.render(React.createElement(React.StrictMode, null, React.createElement(OdsTitle, {
|
|
38543
|
+
level: 5,
|
|
38544
|
+
style: {
|
|
38545
|
+
display: "flex",
|
|
38546
|
+
alignItems: "center",
|
|
38547
|
+
alignSelf: "stretch",
|
|
38548
|
+
margin: 0
|
|
38549
|
+
}
|
|
38550
|
+
}, props.pageTitle)), wrapper);
|
|
38551
|
+
}
|
|
38552
|
+
});
|
|
38553
|
+
};
|
|
38554
|
+
var handleSelectionChanged = function handleSelectionChanged(e) {
|
|
38555
|
+
var triggerEvent = true;
|
|
38556
|
+
if (props.mergeDataFields.length > 0) {
|
|
38557
|
+
var currentSelectedKey = e.currentSelectedRowKeys.length == 1 ? e.currentSelectedRowKeys[0] : undefined;
|
|
38558
|
+
var currentDeselectedKey = e.currentDeselectedRowKeys.length == 1 ? e.currentDeselectedRowKeys[0] : undefined;
|
|
38559
|
+
var currentRowIndex,
|
|
38560
|
+
isRowSelected = false,
|
|
38561
|
+
isRowDeselected = false;
|
|
38562
|
+
if (currentSelectedKey != undefined) {
|
|
38563
|
+
currentRowIndex = e.component.getRowIndexByKey(currentSelectedKey);
|
|
38564
|
+
isRowSelected = true;
|
|
38565
|
+
} else if (currentDeselectedKey != undefined) {
|
|
38566
|
+
currentRowIndex = e.component.getRowIndexByKey(currentDeselectedKey);
|
|
38567
|
+
isRowDeselected = true;
|
|
38568
|
+
}
|
|
38569
|
+
if (currentRowIndex != undefined) {
|
|
38570
|
+
var dataIndex = e.component.getVisibleRows()[currentRowIndex].dataIndex;
|
|
38571
|
+
var mergedCell = mergedCellInfo.find(function (x) {
|
|
38572
|
+
return x.FieldName == props.mergeDataFields[0] && x.StartRowIndex <= dataIndex && x.EndRowIndex >= dataIndex;
|
|
38573
|
+
});
|
|
38574
|
+
if (mergedCell) {
|
|
38575
|
+
var distanceToStart = dataIndex - mergedCell.StartRowIndex;
|
|
38576
|
+
var distanceToEnd = mergedCell.EndRowIndex - dataIndex;
|
|
38577
|
+
var keys = [];
|
|
38578
|
+
var visibleRow;
|
|
38579
|
+
for (var index = currentRowIndex - distanceToStart; index <= currentRowIndex + distanceToEnd; index++) {
|
|
38580
|
+
visibleRow = e.component.getVisibleRows()[index];
|
|
38581
|
+
if (visibleRow) {
|
|
38582
|
+
keys.push(visibleRow.key);
|
|
38583
|
+
}
|
|
38584
|
+
}
|
|
38585
|
+
if (isRowSelected) {
|
|
38586
|
+
e.component.selectRows(keys, true);
|
|
38587
|
+
triggerEvent = false;
|
|
38588
|
+
} else if (isRowDeselected) {
|
|
38589
|
+
e.component.deselectRows(keys);
|
|
38590
|
+
triggerEvent = false;
|
|
38591
|
+
}
|
|
38592
|
+
}
|
|
38593
|
+
}
|
|
38594
|
+
}
|
|
38595
|
+
if (triggerEvent) {
|
|
38596
|
+
props.onSelectionChanged && props.onSelectionChanged(e);
|
|
38597
|
+
}
|
|
38598
|
+
};
|
|
38599
|
+
var handleExporting = function handleExporting(e) {
|
|
38600
|
+
if (!props.closeGridHeader) {
|
|
38601
|
+
var _props$exportProps$ac, _props$exportProps$pa;
|
|
38602
|
+
ExportDataGridToExcel({
|
|
38603
|
+
gridComponent: e.component,
|
|
38604
|
+
baseFileName: props.exportProps.fileName,
|
|
38605
|
+
selectedText: props.exportProps.selectedText,
|
|
38606
|
+
getSummary: function getSummary() {
|
|
38607
|
+
return "";
|
|
38608
|
+
},
|
|
38609
|
+
selectedRowsOnly: e.selectedRowsOnly,
|
|
38610
|
+
activeText: (_props$exportProps$ac = props.exportProps.activeText) != null ? _props$exportProps$ac : "Active",
|
|
38611
|
+
passiveText: (_props$exportProps$pa = props.exportProps.passiveText) != null ? _props$exportProps$pa : "Passive"
|
|
38612
|
+
});
|
|
38613
|
+
}
|
|
38614
|
+
};
|
|
38615
|
+
var renderMasterDetailGrid = useCallback(function (_ref) {
|
|
38616
|
+
var _dataSource$data;
|
|
38617
|
+
var dataSource = _ref.data;
|
|
38618
|
+
var detailID = dataSource === null || dataSource === void 0 ? void 0 : (_dataSource$data = dataSource.data) === null || _dataSource$data === void 0 ? void 0 : _dataSource$data.ID;
|
|
38619
|
+
if (!detailID || !(detailData !== null && detailData !== void 0 && detailData[detailID])) {
|
|
38620
|
+
return null;
|
|
38621
|
+
}
|
|
38622
|
+
return React.createElement(MasterDetailDataGrid, {
|
|
38623
|
+
columns: detailGridColumns,
|
|
38624
|
+
dataSource: detailData[detailID],
|
|
38625
|
+
masterDetailFeatures: masterDetailFeatures
|
|
38626
|
+
});
|
|
38627
|
+
}, [detailGridColumns, detailData, masterDetailFeatures]);
|
|
38628
|
+
var checkIsPropArray = function checkIsPropArray(prop) {
|
|
38629
|
+
return prop && Array.isArray(prop);
|
|
38630
|
+
};
|
|
38631
|
+
return React.createElement(React.Fragment, null, React.createElement(Modal, {
|
|
38632
|
+
title: fastUpdateModalTitle != null ? fastUpdateModalTitle : "Fast Update",
|
|
38633
|
+
open: isFastUpdateModalOpen,
|
|
38634
|
+
onCancel: onFastUpdateModalCancel,
|
|
38635
|
+
footer: [],
|
|
38636
|
+
maskClosable: true,
|
|
38637
|
+
width: 300
|
|
38638
|
+
}, React.createElement(Form$1, {
|
|
38639
|
+
key: "form-fastupdate",
|
|
38640
|
+
form: fastUpdateForm,
|
|
38641
|
+
style: {
|
|
38642
|
+
maxWidth: "100%"
|
|
38643
|
+
},
|
|
38644
|
+
layout: "vertical",
|
|
38645
|
+
onFinish: onFastUpdateFormFinish,
|
|
38646
|
+
onFinishFailed: onFastUpdateFormFinishFailed
|
|
38647
|
+
}, constants$2.allowedDataTypesForMultiCellEditing.map(function (item) {
|
|
38648
|
+
switch (item) {
|
|
38649
|
+
case "number":
|
|
38650
|
+
return React.createElement(Form$1.Item, {
|
|
38651
|
+
name: "number",
|
|
38652
|
+
label: "",
|
|
38653
|
+
rules: [{
|
|
38654
|
+
required: true,
|
|
38655
|
+
message: fastUpdateFormRequiredFieldMessage != null ? fastUpdateFormRequiredFieldMessage : "Required field"
|
|
38656
|
+
}]
|
|
38657
|
+
}, React.createElement(OdsInputNumber, {
|
|
38658
|
+
key: "odsinputnumber-fastupdate",
|
|
38659
|
+
style: {
|
|
38660
|
+
width: "100%"
|
|
38661
|
+
},
|
|
38662
|
+
min: 0
|
|
38663
|
+
}));
|
|
38664
|
+
default:
|
|
38665
|
+
return React.createElement("div", null);
|
|
38666
|
+
}
|
|
38667
|
+
}), React.createElement(Row, {
|
|
38668
|
+
style: {
|
|
38669
|
+
justifyContent: "end",
|
|
38670
|
+
gap: token.marginSM
|
|
38671
|
+
}
|
|
38672
|
+
}, React.createElement(Col, null, React.createElement(OdsButton, {
|
|
38673
|
+
key: "back",
|
|
38674
|
+
onClick: onClickFastUpdateFormCancel
|
|
38675
|
+
}, " ", fastUpdateModalCancelText != null ? fastUpdateModalCancelText : "Cancel")), React.createElement(Col, null, React.createElement(OdsButton, {
|
|
38676
|
+
htmlType: "submit",
|
|
38677
|
+
type: "primary"
|
|
38678
|
+
}, " ", fastUpdateModalSaveText != null ? fastUpdateModalSaveText : "Save"))))), React.createElement(DataGrid$1, Object.assign({
|
|
38679
|
+
keyExpr: keyExpr,
|
|
38680
|
+
dataSource: data,
|
|
38681
|
+
showBorders: true,
|
|
38682
|
+
columnAutoWidth: false,
|
|
38683
|
+
ref: gridRef,
|
|
38684
|
+
height: props.height == undefined ? window.innerHeight - 164 : props.height,
|
|
38685
|
+
allowColumnResizing: true,
|
|
38686
|
+
columnResizingMode: (_props$columnResizing = props.columnResizingMode) != null ? _props$columnResizing : "widget",
|
|
38687
|
+
showRowLines: true,
|
|
38688
|
+
allowColumnReordering: true,
|
|
38689
|
+
remoteOperations: false,
|
|
38690
|
+
paging: {
|
|
38691
|
+
enabled: false
|
|
38692
|
+
},
|
|
38693
|
+
width: "100%",
|
|
38694
|
+
repaintChangesOnly: true,
|
|
38695
|
+
focusedRowEnabled: false,
|
|
38696
|
+
filterSyncEnabled: true
|
|
38697
|
+
}, checkIsPropArray(props.selectedRowKeys) && {
|
|
38698
|
+
selectedRowKeys: props.selectedRowKeys
|
|
38699
|
+
}, {
|
|
38700
|
+
wordWrapEnabled: props.wordWrapEnabled ? props.wordWrapEnabled : false,
|
|
38701
|
+
columnFixing: {
|
|
38702
|
+
enabled: true
|
|
38703
|
+
},
|
|
38704
|
+
noDataText: props.noDataText,
|
|
38705
|
+
className: gridStyle.grid + " " + ((_props$className = props.className) != null ? _props$className : ""),
|
|
38706
|
+
selection: (_props$selection = props.selection) != null ? _props$selection : {
|
|
38707
|
+
mode: "multiple",
|
|
38708
|
+
selectAllMode: "page"
|
|
38709
|
+
},
|
|
38710
|
+
sorting: {
|
|
38711
|
+
mode: "none"
|
|
38712
|
+
},
|
|
38713
|
+
onEditorPreparing: onEditorPreparing,
|
|
38714
|
+
onExporting: handleExporting,
|
|
38715
|
+
onRowClick: props.onRowClick,
|
|
38716
|
+
onEditorPrepared: onEditorPrepared,
|
|
38717
|
+
onSaved: props.onSaved,
|
|
38718
|
+
onSaving: props.onSaving,
|
|
38719
|
+
onEditCanceling: props.onEditCanceling,
|
|
38720
|
+
onCellClick: onCustomCellClick,
|
|
38721
|
+
onCellHoverChanged: onCustomCellHoverChanged,
|
|
38722
|
+
onCellPrepared: onCustomCellPrepared,
|
|
38723
|
+
onOptionChanged: props.onOptionChanged,
|
|
38724
|
+
onToolbarPreparing: !props.closeGridHeader && (props.onToolbarPreparing || onToolbarPreparing),
|
|
38725
|
+
onSelectionChanged: handleSelectionChanged
|
|
38726
|
+
}), gridColumns.map(function (col) {
|
|
38727
|
+
return React.createElement(Column, Object.assign({
|
|
38728
|
+
key: col.dataField
|
|
38729
|
+
}, col, {
|
|
38730
|
+
minWidth: 50,
|
|
38731
|
+
width: props.isColumnWidthFixed === true ? 160 : undefined,
|
|
38732
|
+
cssClass: col.cssClass + " " + (hasFastUpdate ? "grid-cell-disable-text-selection" : "")
|
|
38733
|
+
}), col.lookUp && React.createElement(Lookup, Object.assign({}, col.lookUp)), (col.dataField === "IsActive" || col.dataField === "isActive") && React.createElement(HeaderFilter, {
|
|
38734
|
+
dataSource: [{
|
|
38735
|
+
text: "Active",
|
|
38736
|
+
value: true
|
|
38737
|
+
}, {
|
|
38738
|
+
text: "Passive",
|
|
38739
|
+
value: false
|
|
38740
|
+
}]
|
|
38741
|
+
}), col.useDynamicHeaderFilter && React.createElement(HeaderFilter, {
|
|
38742
|
+
allowSearch: true,
|
|
38743
|
+
dataSource: [{
|
|
38744
|
+
text: "(Blanks)",
|
|
38745
|
+
value: null
|
|
38746
|
+
}].concat(data && data.length > 0 ? data.filter(function (item) {
|
|
38747
|
+
return item[col.dataField] !== null && item[col.dataField] !== undefined && item[col.dataField] !== "";
|
|
38748
|
+
}).map(function (item) {
|
|
38749
|
+
return {
|
|
38750
|
+
text: item[col.dataField].toString(),
|
|
38751
|
+
value: item[col.dataField]
|
|
38752
|
+
};
|
|
38753
|
+
}) : [])
|
|
38754
|
+
}), getMultiLevelColumns$1(col));
|
|
38755
|
+
}), props.actionColumnEnable !== undefined && props.actionColumnEnable === true && React.createElement(Column, {
|
|
38756
|
+
dataField: "Actions",
|
|
38757
|
+
fixed: true,
|
|
38758
|
+
allowSorting: false,
|
|
38759
|
+
caption: props.actionButtonGroupCaption,
|
|
38760
|
+
type: "buttons",
|
|
38761
|
+
showInColumnChooser: false,
|
|
38762
|
+
cellRender: function cellRender(cellData) {
|
|
38763
|
+
return actionCellRender(cellData, props);
|
|
38764
|
+
}
|
|
38765
|
+
}), props.showMasterDetail && React.createElement(MasterDetail, {
|
|
38766
|
+
enabled: true,
|
|
38767
|
+
component: renderMasterDetailGrid
|
|
38768
|
+
}), props.edit && React.createElement(Editing, {
|
|
38769
|
+
mode: props.edit.mode,
|
|
38770
|
+
allowUpdating: props.edit.allowUpdating,
|
|
38771
|
+
allowDeleting: props.edit.allowDeleting,
|
|
38772
|
+
allowAdding: props.edit.allowAdding,
|
|
38773
|
+
useIcons: true
|
|
38774
|
+
}, props.edit.mode === "popup" && React.createElement("div", null, React.createElement(Popup, {
|
|
38775
|
+
showTitle: true,
|
|
38776
|
+
width: 700,
|
|
38777
|
+
height: 300,
|
|
38778
|
+
showCloseButton: false
|
|
38779
|
+
}), React.createElement(Form, null, props.edit.formItems && props.edit.formItems.map(function (formItem) {
|
|
38780
|
+
return React.createElement(Item, {
|
|
38781
|
+
itemType: formItem.itemType,
|
|
38782
|
+
colCount: formItem.colCount,
|
|
38783
|
+
colSpan: formItem.colSpan
|
|
38784
|
+
}, formItem.items.map(function (subItem) {
|
|
38785
|
+
return React.createElement(Item, {
|
|
38786
|
+
key: subItem.dataField,
|
|
38787
|
+
dataField: subItem.dataField
|
|
38788
|
+
});
|
|
38789
|
+
}));
|
|
38790
|
+
})))), React.createElement(Paging, {
|
|
38791
|
+
enabled: false
|
|
38792
|
+
}), React.createElement(Pager, {
|
|
38793
|
+
visible: false
|
|
38794
|
+
}), React.createElement(Scrolling, {
|
|
38795
|
+
mode: "standard"
|
|
38796
|
+
}), !props.closeGridHeader && React.createElement(SearchPanel, {
|
|
38797
|
+
visible: true
|
|
38798
|
+
}), React.createElement(FilterRow, {
|
|
38799
|
+
visible: props.isFilterRow != undefined ? props.isFilterRow : true
|
|
38800
|
+
}), React.createElement(FilterPanel, {
|
|
38801
|
+
visible: true
|
|
38802
|
+
}), React.createElement(HeaderFilter, {
|
|
38803
|
+
visible: true
|
|
38804
|
+
}), React.createElement(Sorting, {
|
|
38805
|
+
mode: "none"
|
|
38806
|
+
}), !props.closeGridHeader && React.createElement(Export, {
|
|
38807
|
+
enabled: true,
|
|
38808
|
+
allowExportSelectedData: true,
|
|
38809
|
+
formats: constants$2.exportFormats
|
|
38810
|
+
}), ((_props$selectOptions = props.selectOptions) === null || _props$selectOptions === void 0 ? void 0 : _props$selectOptions.selectEnable) && React.createElement(Selection, {
|
|
38811
|
+
mode: (_props$selectOptions$ = (_props$selectOptions2 = props.selectOptions) === null || _props$selectOptions2 === void 0 ? void 0 : _props$selectOptions2.mode) != null ? _props$selectOptions$ : "multiple",
|
|
38812
|
+
deferred: (_props$selectOptions$2 = (_props$selectOptions3 = props.selectOptions) === null || _props$selectOptions3 === void 0 ? void 0 : _props$selectOptions3.deferred) != null ? _props$selectOptions$2 : true
|
|
38813
|
+
}), !props.closeGridHeader && React.createElement(ColumnChooser, {
|
|
38814
|
+
enabled: true,
|
|
38815
|
+
mode: "select"
|
|
38816
|
+
}, !props.columnChooserPositionDisabled && React.createElement(Position, {
|
|
38817
|
+
my: "right top",
|
|
38818
|
+
at: "right bottom",
|
|
38819
|
+
of: document.querySelector("." + props.dataGridPageName) ? "." + props.dataGridPageName + " .dx-datagrid-column-chooser-button" : ".dx-datagrid-column-chooser-button"
|
|
38820
|
+
}), React.createElement(ColumnChooserSearch, {
|
|
38821
|
+
enabled: true,
|
|
38822
|
+
editorOptions: {
|
|
38823
|
+
placeholder: ""
|
|
38824
|
+
}
|
|
38825
|
+
}), React.createElement(ColumnChooserSelection, {
|
|
38826
|
+
allowSelectAll: true,
|
|
38827
|
+
selectByClick: true,
|
|
38828
|
+
recursive: true
|
|
38829
|
+
})), !props.closeGridHeader && React.createElement(Toolbar, null, React.createElement(Item$1, {
|
|
38830
|
+
name: "searchPanel"
|
|
38831
|
+
}), React.createElement(Item$1, {
|
|
38832
|
+
name: "columnChooserButton",
|
|
38833
|
+
cssClass: "toolbarPanelItems"
|
|
38834
|
+
}), React.createElement(Item$1, {
|
|
38835
|
+
name: "exportButton",
|
|
38836
|
+
cssClass: "toolbarPanelItems"
|
|
38837
|
+
}), hasFastUpdate && React.createElement(Item$1, null, React.createElement(OdsButton, {
|
|
38838
|
+
key: "odsbutton-fastupdate",
|
|
38839
|
+
onClick: onCustomFastUpdateButtonClick
|
|
38840
|
+
}, fastUpdateButtonText != null ? fastUpdateButtonText : "Fast Update"))), React.createElement(StateStoring, {
|
|
38841
|
+
enabled: true,
|
|
38842
|
+
type: "custom",
|
|
38843
|
+
customLoad: customLoad,
|
|
38844
|
+
customSave: customSave
|
|
38845
|
+
})));
|
|
37777
38846
|
};
|
|
37778
38847
|
|
|
37779
38848
|
/**
|
|
@@ -38285,10 +39354,10 @@ function debounce(func, wait, options) {
|
|
|
38285
39354
|
|
|
38286
39355
|
var debounce_1 = debounce;
|
|
38287
39356
|
|
|
38288
|
-
var checkCellSelectionConstraints$
|
|
39357
|
+
var checkCellSelectionConstraints$2 = function checkCellSelectionConstraints(e) {
|
|
38289
39358
|
return e.rowType == "data" && e.columnIndex > -1 && e.rowIndex > -1;
|
|
38290
39359
|
};
|
|
38291
|
-
var cellAlreadySelected$
|
|
39360
|
+
var cellAlreadySelected$2 = function cellAlreadySelected(pkValue, dataField, cellInfos) {
|
|
38292
39361
|
return cellInfos.some(function (cell) {
|
|
38293
39362
|
return cell.pkValue == pkValue && cell.dataField == dataField;
|
|
38294
39363
|
});
|
|
@@ -38358,7 +39427,7 @@ var getSummaryItem = function getSummaryItem(col, visibleIndex, summaryType, isM
|
|
|
38358
39427
|
}
|
|
38359
39428
|
});
|
|
38360
39429
|
};
|
|
38361
|
-
var getMultiLevelColumns$
|
|
39430
|
+
var getMultiLevelColumns$2 = function getMultiLevelColumns(col) {
|
|
38362
39431
|
return col.multiLevelColumns && col.multiLevelColumns.map(function (colItem) {
|
|
38363
39432
|
return React.createElement(Column, Object.assign({
|
|
38364
39433
|
width: 80
|
|
@@ -38366,7 +39435,7 @@ var getMultiLevelColumns$1 = function getMultiLevelColumns(col) {
|
|
|
38366
39435
|
});
|
|
38367
39436
|
};
|
|
38368
39437
|
|
|
38369
|
-
var constants$
|
|
39438
|
+
var constants$3 = {
|
|
38370
39439
|
totalPageCount: 1,
|
|
38371
39440
|
loadedPageCount: 1,
|
|
38372
39441
|
totalRecordCount: 0,
|
|
@@ -38374,14 +39443,14 @@ var constants$2 = {
|
|
|
38374
39443
|
selectedCellBgColor: "#c1f9b8",
|
|
38375
39444
|
allowedDataTypesForMultiCellEditing: ["number"]
|
|
38376
39445
|
};
|
|
38377
|
-
var onCancelEditEvent$
|
|
39446
|
+
var onCancelEditEvent$2 = new CustomEvent("cancelEdit", {
|
|
38378
39447
|
bubbles: true,
|
|
38379
39448
|
detail: {
|
|
38380
39449
|
rowData: null
|
|
38381
39450
|
}
|
|
38382
39451
|
});
|
|
38383
39452
|
|
|
38384
|
-
var useToken$
|
|
39453
|
+
var useToken$3 = theme.useToken;
|
|
38385
39454
|
var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
38386
39455
|
var _props$axiosRequest4, _props$axiosRequest5, _props$axiosRequest6, _props$axiosRequest7, _props$axiosRequest8, _props$axiosRequest9, _props$axiosRequest10, _props$axiosRequest11, _props$selectOptions, _props$selectOptions$, _props$selectOptions2, _props$selectOptions$2, _props$selectOptions3;
|
|
38387
39456
|
var keyExpr = props.keyExpr,
|
|
@@ -38397,7 +39466,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38397
39466
|
onFastUpdateFinish = props.onFastUpdateFinish,
|
|
38398
39467
|
onFastUpdateCancel = props.onFastUpdateCancel,
|
|
38399
39468
|
onFastUpdateFailed = props.onFastUpdateFailed;
|
|
38400
|
-
var _useToken = useToken$
|
|
39469
|
+
var _useToken = useToken$3(),
|
|
38401
39470
|
token = _useToken.token;
|
|
38402
39471
|
var _AntForm$useForm = Form$1.useForm(),
|
|
38403
39472
|
fastUpdateForm = _AntForm$useForm[0];
|
|
@@ -38442,16 +39511,16 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38442
39511
|
scrollPosition = _useState12[0],
|
|
38443
39512
|
setScrollPosition = _useState12[1];
|
|
38444
39513
|
useEffect(function () {
|
|
38445
|
-
constants$
|
|
38446
|
-
constants$
|
|
38447
|
-
constants$
|
|
39514
|
+
constants$3.totalPageCount = 1;
|
|
39515
|
+
constants$3.loadedPageCount = 1;
|
|
39516
|
+
constants$3.totalRecordCount = 0;
|
|
38448
39517
|
}, [props.dataGridPageName]);
|
|
38449
39518
|
useEffect(function () {
|
|
38450
39519
|
var _props$axiosRequest, _props$axiosRequest2, _props$axiosRequest3;
|
|
38451
39520
|
if (props.axiosRequest !== undefined && ((_props$axiosRequest = props.axiosRequest) !== null && _props$axiosRequest !== void 0 && _props$axiosRequest.requestData && Object.keys((_props$axiosRequest2 = props.axiosRequest) === null || _props$axiosRequest2 === void 0 ? void 0 : _props$axiosRequest2.requestData).length > 0 || (_props$axiosRequest3 = props.axiosRequest) !== null && _props$axiosRequest3 !== void 0 && _props$axiosRequest3.requestQueryString)) {
|
|
38452
|
-
constants$
|
|
38453
|
-
constants$
|
|
38454
|
-
constants$
|
|
39521
|
+
constants$3.totalPageCount = 1;
|
|
39522
|
+
constants$3.loadedPageCount = 1;
|
|
39523
|
+
constants$3.totalRecordCount = 0;
|
|
38455
39524
|
setData([]);
|
|
38456
39525
|
fetchData();
|
|
38457
39526
|
}
|
|
@@ -38627,7 +39696,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38627
39696
|
for (var rowIndex = minRowIndex; rowIndex <= maxRowIndex; rowIndex++) {
|
|
38628
39697
|
var _loop2 = function _loop2() {
|
|
38629
39698
|
var _column = gridRef.current.instance.columnOption(colIndex);
|
|
38630
|
-
if (constants$
|
|
39699
|
+
if (constants$3.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
38631
39700
|
return item.toLocaleLowerCase() == _column.dataType.toLocaleLowerCase();
|
|
38632
39701
|
})) {
|
|
38633
39702
|
result.push({
|
|
@@ -38701,13 +39770,13 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38701
39770
|
if (props.axiosRequest.requestData && checkRequestDataHasOnlySortingProperty(props.axiosRequest.requestData)) return;
|
|
38702
39771
|
var apiUrl = props.axiosRequest.environmentUrl + "" + props.axiosRequest.apiUrl;
|
|
38703
39772
|
if (((_props$axiosRequest$r = props.axiosRequest.requestData) === null || _props$axiosRequest$r === void 0 ? void 0 : _props$axiosRequest$r.PaginatedRequest) !== undefined) {
|
|
38704
|
-
props.axiosRequest.requestData.PaginatedRequest.PageNumber = constants$
|
|
39773
|
+
props.axiosRequest.requestData.PaginatedRequest.PageNumber = constants$3.loadedPageCount;
|
|
38705
39774
|
props.axiosRequest.requestData.PaginatedRequest.PageSize = props.pageSize;
|
|
38706
39775
|
}
|
|
38707
39776
|
if (props.axiosRequest.requestQueryString !== undefined) {
|
|
38708
39777
|
props.axiosRequest.requestQueryString.maxResultCount = props.pageSize;
|
|
38709
|
-
if (constants$
|
|
38710
|
-
props.axiosRequest.requestQueryString.skipCount = ((constants$
|
|
39778
|
+
if (constants$3.loadedPageCount > 1 && constants$3.totalPageCount >= constants$3.loadedPageCount) {
|
|
39779
|
+
props.axiosRequest.requestQueryString.skipCount = ((constants$3.loadedPageCount - 1) * props.pageSize).toString();
|
|
38711
39780
|
}
|
|
38712
39781
|
var query = queryString.stringify(props.axiosRequest.requestQueryString);
|
|
38713
39782
|
apiUrl = apiUrl + "?" + query;
|
|
@@ -38722,10 +39791,10 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38722
39791
|
setLoading(true);
|
|
38723
39792
|
return Promise.resolve(fetch(apiUrl, requestOptions)).then(function (response) {
|
|
38724
39793
|
return Promise.resolve(response.json()).then(function (newData) {
|
|
38725
|
-
if (constants$
|
|
39794
|
+
if (constants$3.loadedPageCount == 1) {
|
|
38726
39795
|
setData(newData.Data ? newData.Data : newData);
|
|
38727
|
-
constants$
|
|
38728
|
-
} else if (constants$
|
|
39796
|
+
constants$3.loadedPageCount = 1;
|
|
39797
|
+
} else if (constants$3.totalPageCount >= constants$3.loadedPageCount) {
|
|
38729
39798
|
var newArray = newData.Data ? newData.Data : newData;
|
|
38730
39799
|
setData(function (prevData) {
|
|
38731
39800
|
return [].concat(prevData, newArray);
|
|
@@ -38751,15 +39820,15 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38751
39820
|
}, [(_props$axiosRequest6 = props.axiosRequest) === null || _props$axiosRequest6 === void 0 ? void 0 : _props$axiosRequest6.requestData, (_props$axiosRequest7 = props.axiosRequest) === null || _props$axiosRequest7 === void 0 ? void 0 : _props$axiosRequest7.apiUrl, (_props$axiosRequest8 = props.axiosRequest) === null || _props$axiosRequest8 === void 0 ? void 0 : _props$axiosRequest8.environmentUrl, (_props$axiosRequest9 = props.axiosRequest) === null || _props$axiosRequest9 === void 0 ? void 0 : _props$axiosRequest9.requestQueryString, (_props$axiosRequest10 = props.axiosRequest) === null || _props$axiosRequest10 === void 0 ? void 0 : _props$axiosRequest10.requestType, props.pageSize, props.isServerSide]);
|
|
38752
39821
|
var getTotalCount = function getTotalCount(response, data) {
|
|
38753
39822
|
if (data !== null && data !== void 0 && data.PageCount || data !== null && data !== void 0 && data.RowCount) {
|
|
38754
|
-
constants$
|
|
38755
|
-
constants$
|
|
39823
|
+
constants$3.totalPageCount = data.PageCount;
|
|
39824
|
+
constants$3.totalRecordCount = data.RowCount;
|
|
38756
39825
|
} else {
|
|
38757
39826
|
var totalCount;
|
|
38758
39827
|
if (response) totalCount = response.headers.get("x-total-count");
|
|
38759
39828
|
if (totalCount == null) totalCount = data === null || data === void 0 ? void 0 : data.rowCount;
|
|
38760
39829
|
if (totalCount == null) totalCount = data === null || data === void 0 ? void 0 : data.length;
|
|
38761
|
-
constants$
|
|
38762
|
-
constants$
|
|
39830
|
+
constants$3.totalRecordCount = parseInt(totalCount, 10) || 0;
|
|
39831
|
+
constants$3.totalPageCount = Math.ceil(constants$3.totalRecordCount / props.pageSize);
|
|
38763
39832
|
}
|
|
38764
39833
|
setLoading(false);
|
|
38765
39834
|
};
|
|
@@ -38771,7 +39840,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38771
39840
|
}
|
|
38772
39841
|
if (e.editorOptions && e.rowType === "data" && e.parentType === "dataRow") {
|
|
38773
39842
|
e.editorOptions.onValueChanged = function (args) {
|
|
38774
|
-
if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$
|
|
39843
|
+
if (args.event && args.event.type === "cancel") e.cellElement.dispatchEvent(onCancelEditEvent$2);
|
|
38775
39844
|
};
|
|
38776
39845
|
}
|
|
38777
39846
|
}, [props.isServerSide]);
|
|
@@ -38780,8 +39849,8 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38780
39849
|
return Promise.resolve(function () {
|
|
38781
39850
|
if (type === "reachedBottom") {
|
|
38782
39851
|
return function () {
|
|
38783
|
-
if (constants$
|
|
38784
|
-
constants$
|
|
39852
|
+
if (constants$3.totalPageCount <= constants$3.loadedPageCount) {} else {
|
|
39853
|
+
constants$3.loadedPageCount = constants$3.loadedPageCount + 1;
|
|
38785
39854
|
return Promise.resolve(fetchData()).then(function () {});
|
|
38786
39855
|
}
|
|
38787
39856
|
}();
|
|
@@ -38790,7 +39859,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38790
39859
|
} catch (e) {
|
|
38791
39860
|
return Promise.reject(e);
|
|
38792
39861
|
}
|
|
38793
|
-
}, [constants$
|
|
39862
|
+
}, [constants$3.totalPageCount]);
|
|
38794
39863
|
var onExporting = useCallback(function (e) {
|
|
38795
39864
|
if (e.format === "xlsx") {
|
|
38796
39865
|
var workbook = new Workbook();
|
|
@@ -38898,26 +39967,26 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
38898
39967
|
var _props$customSummary3;
|
|
38899
39968
|
var result = "";
|
|
38900
39969
|
var totalloaded = 0;
|
|
38901
|
-
if (data.length < 50 || !props.isServerSide || constants$
|
|
39970
|
+
if (data.length < 50 || !props.isServerSide || constants$3.loadedPageCount == constants$3.totalPageCount) {
|
|
38902
39971
|
totalloaded = data.length;
|
|
38903
39972
|
} else {
|
|
38904
|
-
totalloaded = constants$
|
|
39973
|
+
totalloaded = constants$3.loadedPageCount * props.pageSize;
|
|
38905
39974
|
}
|
|
38906
39975
|
if (props.isServerSide) {
|
|
38907
39976
|
var _props$customSummary, _props$customSummary2;
|
|
38908
|
-
result = constants$
|
|
39977
|
+
result = constants$3.totalRecordCount > 0 ? totalloaded + " " + ((_props$customSummary = props.customSummary) === null || _props$customSummary === void 0 ? void 0 : _props$customSummary.summaryLoadedDataLabel) + ("- " + constants$3.totalRecordCount) + ((_props$customSummary2 = props.customSummary) === null || _props$customSummary2 === void 0 ? void 0 : _props$customSummary2.summaryTotalDataLabel) : "";
|
|
38909
39978
|
result = concatFilteredLabel$1(result, totalloaded, filteredRowCount, filterApplied.current, props);
|
|
38910
39979
|
}
|
|
38911
39980
|
if (((_props$customSummary3 = props.customSummary) === null || _props$customSummary3 === void 0 ? void 0 : _props$customSummary3.summaryTotalCount) !== undefined && !props.isServerSide) {
|
|
38912
39981
|
result = props.customSummary.summaryTotalDataLabel + " : " + props.customSummary.summaryTotalCount;
|
|
38913
39982
|
result = concatFilteredLabel$1(result, totalloaded, filteredRowCount, filterApplied.current, props);
|
|
38914
39983
|
}
|
|
38915
|
-
if (constants$
|
|
39984
|
+
if (constants$3.totalPageCount > 1) {
|
|
38916
39985
|
var _props$customSummary4;
|
|
38917
|
-
result = result + " - " + ((_props$customSummary4 = props.customSummary) === null || _props$customSummary4 === void 0 ? void 0 : _props$customSummary4.summaryTotalPageCountLabel) + " " + constants$
|
|
39986
|
+
result = result + " - " + ((_props$customSummary4 = props.customSummary) === null || _props$customSummary4 === void 0 ? void 0 : _props$customSummary4.summaryTotalPageCountLabel) + " " + constants$3.loadedPageCount + " / " + constants$3.totalPageCount;
|
|
38918
39987
|
}
|
|
38919
39988
|
return result;
|
|
38920
|
-
}, [data, filteredRowCount, constants$
|
|
39989
|
+
}, [data, filteredRowCount, constants$3.loadedPageCount, props.pageSize, constants$3.totalRecordCount, filterApplied.current]);
|
|
38921
39990
|
function actionCellRender(cellData, props) {
|
|
38922
39991
|
var kebabMenuButtons = props.actionButtonGroup && props.actionButtonGroup.length >= 2 && !props.edit ? props.actionButtonGroup.slice(2).map(function (button) {
|
|
38923
39992
|
if (button.elementType === "element" && button.element) {
|
|
@@ -39070,11 +40139,11 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39070
40139
|
var onCustomCellClick = function onCustomCellClick(e) {
|
|
39071
40140
|
e.cellElement.style.backgroundColor = "transparent";
|
|
39072
40141
|
if (hasFastUpdate) {
|
|
39073
|
-
if (checkCellSelectionConstraints$
|
|
40142
|
+
if (checkCellSelectionConstraints$2(e) && constants$3.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
39074
40143
|
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
39075
40144
|
})) {
|
|
39076
40145
|
if (!e.event.ctrlKey) {
|
|
39077
|
-
if (cellAlreadySelected$
|
|
40146
|
+
if (cellAlreadySelected$2(e.data[pkName], e.column.dataField, selectedCells)) {
|
|
39078
40147
|
removeSelectedCell(e.rowIndex, e.columnIndex);
|
|
39079
40148
|
} else {
|
|
39080
40149
|
singleSelect(e.data[pkName], e.column.dataField);
|
|
@@ -39102,7 +40171,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39102
40171
|
var onCustomCellHoverChanged = function onCustomCellHoverChanged(e) {
|
|
39103
40172
|
if (hasFastUpdate) {
|
|
39104
40173
|
if (!e.event.ctrlKey && !ctrlSelection) {
|
|
39105
|
-
if (checkCellSelectionConstraints$
|
|
40174
|
+
if (checkCellSelectionConstraints$2(e)) {
|
|
39106
40175
|
if (e.event.buttons === 1) {
|
|
39107
40176
|
setHoveredCells(function (prev) {
|
|
39108
40177
|
return [].concat(prev, [{
|
|
@@ -39144,7 +40213,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39144
40213
|
var onCustomCellPrepared = function onCustomCellPrepared(e) {
|
|
39145
40214
|
var _props$edit, _props$edit2;
|
|
39146
40215
|
if (hasFastUpdate) {
|
|
39147
|
-
if (e.rowType === "data" && e.column.allowEditing && constants$
|
|
40216
|
+
if (e.rowType === "data" && e.column.allowEditing && constants$3.allowedDataTypesForMultiCellEditing.some(function (item) {
|
|
39148
40217
|
return item.toLocaleLowerCase() == e.column.dataType.toLocaleLowerCase();
|
|
39149
40218
|
})) {
|
|
39150
40219
|
if (selectedCells.some(function (cell) {
|
|
@@ -39220,7 +40289,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39220
40289
|
layout: "vertical",
|
|
39221
40290
|
onFinish: onFastUpdateFormFinish,
|
|
39222
40291
|
onFinishFailed: onFastUpdateFormFinishFailed
|
|
39223
|
-
}, constants$
|
|
40292
|
+
}, constants$3.allowedDataTypesForMultiCellEditing.map(function (item) {
|
|
39224
40293
|
switch (item) {
|
|
39225
40294
|
case "number":
|
|
39226
40295
|
return React.createElement(Form$1.Item, {
|
|
@@ -39319,7 +40388,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39319
40388
|
value: item[col.dataField]
|
|
39320
40389
|
};
|
|
39321
40390
|
}) : [])
|
|
39322
|
-
}), getMultiLevelColumns$
|
|
40391
|
+
}), getMultiLevelColumns$2(col));
|
|
39323
40392
|
}), props.actionColumnEnable !== undefined && props.actionColumnEnable === true && React.createElement(Column, {
|
|
39324
40393
|
dataField: "Actions",
|
|
39325
40394
|
fixed: true,
|
|
@@ -39385,7 +40454,7 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39385
40454
|
}), React.createElement(Export, {
|
|
39386
40455
|
enabled: true,
|
|
39387
40456
|
allowExportSelectedData: true,
|
|
39388
|
-
formats: constants$
|
|
40457
|
+
formats: constants$3.exportFormats
|
|
39389
40458
|
}), ((_props$selectOptions = props.selectOptions) === null || _props$selectOptions === void 0 ? void 0 : _props$selectOptions.selectEnable) && React.createElement(Selection, {
|
|
39390
40459
|
mode: (_props$selectOptions$ = (_props$selectOptions2 = props.selectOptions) === null || _props$selectOptions2 === void 0 ? void 0 : _props$selectOptions2.mode) != null ? _props$selectOptions$ : "multiple",
|
|
39391
40460
|
deferred: (_props$selectOptions$2 = (_props$selectOptions3 = props.selectOptions) === null || _props$selectOptions3 === void 0 ? void 0 : _props$selectOptions3.deferred) != null ? _props$selectOptions$2 : true
|
|
@@ -39432,5 +40501,5 @@ var OdsRemoteDataGrid = function OdsRemoteDataGrid(props) {
|
|
|
39432
40501
|
})));
|
|
39433
40502
|
};
|
|
39434
40503
|
|
|
39435
|
-
export { DxTreeList, OdsAlert, OdsAutoComplete, OdsBadge, OdsBadgeRibbon, OdsBannerAlert, OdsBasicDataGrid, OdsBasicTable, OdsButton, CabinGrid as OdsCabinGrid, OdsCalendar, OdsCard, OdsChange$1 as OdsChange, OdsCheckbox, OdsCheckboxGroup, OdsCollapse, OdsCurrencyInput, OdsDataGrid, OdsDateRangePicker, OdsDatepicker, OdsDisplayGrid, OdsDivider, OdsDropdown, OdsDropdownButton, OdsFileUpload, OdsFileUploadv2, OdsFilter, OdsFilterPlus, OdsFilterTagView, OdsImage, OdsInlineEditDataGrid, OdsInput, OdsInputNumber, OdsLink, OdsList, MasterDetailDataGrid as OdsMasterDetailDataGrid, OdsModal, OdsModalOld, OdsMultiSelect, OdsNotification, OdsParagraph, OdsPassword, OdsPhoneInput, OdsProgress, OdsRadio, OdsRadioGroup, OdsRangeTimepicker, OdsRate, OdsRemoteDataGrid, OdsSearch, OdsSelect, OdsSelectableTable, OdsServerSideDatagrid, OdsSpin, OdsSwitch, OdsTab, OdsBasicTable as OdsTable, OdsTag, OdsText, OdsTextArea, OdsTimeline, OdsTimepicker, OdsTitle, OdsTransfer, OdsTreeListMenu, OdsTreeSelect };
|
|
40504
|
+
export { DxTreeList, OdsAlert, OdsAutoComplete, OdsBadge, OdsBadgeRibbon, OdsBannerAlert, OdsBasicDataGrid, OdsBasicTable, OdsButton, CabinGrid as OdsCabinGrid, OdsCalendar, OdsCard, OdsChange$1 as OdsChange, OdsCheckbox, OdsCheckboxGroup, OdsCollapse, OdsCurrencyInput, OdsDataGrid, OdsDateRangePicker, OdsDatepicker, OdsDisplayGrid, OdsDivider, OdsDropdown, OdsDropdownButton, OdsFileUpload, OdsFileUploadv2, OdsFilter, OdsFilterPlus, OdsFilterTagView, OdsImage, OdsInlineEditDataGrid, OdsInput, OdsInputNumber, OdsLink, OdsList, MasterDetailDataGrid as OdsMasterDetailDataGrid, OdsMergeCellDataGrid, OdsModal, OdsModalOld, OdsMultiSelect, OdsNotification, OdsParagraph, OdsPassword, OdsPhoneInput, OdsProgress, OdsRadio, OdsRadioGroup, OdsRangeTimepicker, OdsRate, OdsRemoteDataGrid, OdsSearch, OdsSelect, OdsSelectableTable, OdsServerSideDatagrid, OdsSpin, OdsSwitch, OdsTab, OdsBasicTable as OdsTable, OdsTag, OdsText, OdsTextArea, OdsTimeline, OdsTimepicker, OdsTitle, OdsTransfer, OdsTreeListMenu, OdsTreeSelect };
|
|
39436
40505
|
//# sourceMappingURL=index.modern.js.map
|