@lanaco/lnc-react-ui 2.1.28 → 2.1.31
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/lib/index.esm.js +241 -240
- package/lib/index.js +241 -240
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -4621,7 +4621,7 @@ var getCheckboxCss = function getCheckboxCss(props) {
|
|
|
4621
4621
|
height = "1.6875rem";
|
|
4622
4622
|
}
|
|
4623
4623
|
|
|
4624
|
-
return css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral(["\n .c-", "-container {\n font-family: ", ";\n display: inline-block;\n position: relative;\n padding: 0.25rem;\n padding-left: ", ";\n ", "\n cursor:
|
|
4624
|
+
return css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral(["\n .c-", "-container {\n font-family: ", ";\n display: inline-block;\n position: relative;\n padding: 0.25rem;\n padding-left: ", ";\n ", "\n cursor: auto;\n font-size: ", ";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: ", ";\n margin-left: ", ";\n }\n\n /* Hide the browser's default checkbox */\n .c-", "-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n }\n\n /* Create a custom checkbox */\n .c-", "-checkmark {\n position: absolute;\n top: 0;\n left: 0;\n height: ", ";\n width: ", ";\n background-color: #eee;\n border: 0.0625rem solid ", ";\n border-radius: 2px;\n transition: all 200ms ease;\n }\n\n /* On mouse-over, add a grey background color */\n .c-", "-container:hover input ~ .c-", "-checkmark {\n cursor: pointer;\n }\n\n .c-", "-container:hover input:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n cursor: default;\n }\n\n .c-", "-container input:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n }\n\n /* When the checkbox is checked, add a blue background */\n .c-", "-container input:checked ~ .c-", "-checkmark {\n background-color: ", ";\n }\n\n .c-", "-container input:checked:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n border: 0.0625rem solid ", ";\n cursor: default;\n }\n\n /* Create the checkmark/indicator (hidden when not checked) */\n .c-", "-checkmark:after {\n content: \"\";\n position: absolute;\n display: none;\n }\n\n /* Show the checkmark when checked */\n .c-", "-container input:checked ~ .c-", "-checkmark:after {\n display: block;\n }\n\n /* Style the checkmark/indicator */\n .c-", "-container .c-", "-checkmark:after {\n left: ", ";\n top: ", ";\n width: ", ";\n height: ", ";\n border: solid white;\n border-width: 0 0.21875rem 0.21875rem 0;\n -webkit-transform: rotate(35deg);\n -ms-transform: rotate(35deg);\n transform: rotate(35deg);\n }\n "])), props.id, props.theme.typography.fontFamily, padingLeft, paddingTop, props.theme.typography[props.size].fontSize, margin, marginLeft, props.id, props.id, height, width, props.theme.palette[props.color].main, props.id, props.id, props.id, props.id, props.theme.palette.gray[900], props.id, props.id, props.theme.palette.gray[900], props.id, props.id, props.theme.palette[props.color].main, props.id, props.id, props.theme.palette.gray[900], props.theme.palette.gray.textLight, props.id, props.id, props.id, props.id, props.id, left, top, checkWidth, checkHeight);
|
|
4625
4625
|
};
|
|
4626
4626
|
|
|
4627
4627
|
var CheckBox = function CheckBox(props) {
|
|
@@ -4635,7 +4635,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
4635
4635
|
|
|
4636
4636
|
var handleChange = function handleChange(e) {
|
|
4637
4637
|
if (preventDefault) e.preventDefault();
|
|
4638
|
-
onChange(id, !checked);
|
|
4638
|
+
if (!disabled) onChange(id, !checked);
|
|
4639
4639
|
};
|
|
4640
4640
|
|
|
4641
4641
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Global, {
|
|
@@ -4754,7 +4754,7 @@ var Text$2 = newStyled.label(_templateObject$q || (_templateObject$q = _taggedTe
|
|
|
4754
4754
|
}, function (props) {
|
|
4755
4755
|
return getLabelAndTextProps()[props.size].top;
|
|
4756
4756
|
});
|
|
4757
|
-
var Input$4 = newStyled.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteral(["\n &:checked + span {\n background-color: ", ";\n }\n\n &:focus + span {\n box-shadow: 0 0 0.0625rem\n ", ";\n }\n\n &:checked + span:before {\n transform: translateX(90%);\n }\n\n &:checked:disabled + span {\n }\n\n &:checked:disabled + span:before {\n backround-color: red;\n }\n\n &:disabled + span {\n position: absolute;\n cursor:
|
|
4757
|
+
var Input$4 = newStyled.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteral(["\n &:checked + span {\n background-color: ", ";\n }\n\n &:focus + span {\n box-shadow: 0 0 0.0625rem\n ", ";\n }\n\n &:checked + span:before {\n transform: translateX(90%);\n }\n\n &:checked:disabled + span {\n }\n\n &:checked:disabled + span:before {\n backround-color: red;\n }\n\n &:disabled + span {\n position: absolute;\n cursor: auto;\n top: ", ";\n left: ", ";\n right: 0;\n bottom: 0;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n height: ", ";\n width: ", ";\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n\n &:disabled + span:before {\n position: absolute;\n content: \"\";\n height: ", ";\n width: ", ";\n left: 0.0625rem;\n top: -0.125rem;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n\n &:checked:disabled + span:before {\n position: absolute;\n content: \"\";\n height: ", ";\n width: ", ";\n left: 0.0625rem;\n top: -0.125rem;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n"])), function (props) {
|
|
4758
4758
|
return props.theme.palette[props.color].main;
|
|
4759
4759
|
}, function (props) {
|
|
4760
4760
|
return props.theme.palette[props.color].main;
|
|
@@ -4821,7 +4821,7 @@ var ToggleSwitch = function ToggleSwitch(props) {
|
|
|
4821
4821
|
|
|
4822
4822
|
function handleChange(e) {
|
|
4823
4823
|
if (preventDefault) e.preventDefault();
|
|
4824
|
-
onChange(id, !value);
|
|
4824
|
+
if (!disabled) onChange(id, !value);
|
|
4825
4825
|
}
|
|
4826
4826
|
|
|
4827
4827
|
var themeProps = {
|
|
@@ -6522,7 +6522,7 @@ var Table$2 = newStyled.div(_templateObject2$l || (_templateObject2$l = _taggedT
|
|
|
6522
6522
|
var Body$1 = newStyled.div(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n &::-webkit-scrollbar {\n background: white;\n height: 0;\n width: 0;\n }\n overflow: auto;\n height: ", ";\n"])), function (props) {
|
|
6523
6523
|
return props.height && props.height !== "" ? props.height : "auto";
|
|
6524
6524
|
});
|
|
6525
|
-
var Row = newStyled.div(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n cursor:
|
|
6525
|
+
var Row = newStyled.div(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n cursor: default;\n transition: all 250ms ease;\n background-color: white;\n\n &:hover {\n background-color: whitesmoke;\n }\n"])));
|
|
6526
6526
|
var HeaderRow = newStyled.div(_templateObject5$c || (_templateObject5$c = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n border-bottom: 1px solid #80808050;\n background-color: whitesmoke;\n border-radius: 3px 3px 0 0;\n position: sticky;\n"])));
|
|
6527
6527
|
var HeaderColumnCheck = newStyled.div(_templateObject6$a || (_templateObject6$a = _taggedTemplateLiteral(["\n padding: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: ", ";\n padding-left: 8px;\n border-right: 1px solid #80808050;\n"])), function (props) {
|
|
6528
6528
|
return props.check ? "8px" : "0";
|
|
@@ -6588,10 +6588,11 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6588
6588
|
});
|
|
6589
6589
|
}
|
|
6590
6590
|
|
|
6591
|
-
onChange(id, selectedItems);
|
|
6591
|
+
if (!disabled) onChange(id, selectedItems);
|
|
6592
6592
|
};
|
|
6593
6593
|
|
|
6594
|
-
var
|
|
6594
|
+
var pageDecimalCount = options.length / displayedItemsCount;
|
|
6595
|
+
var pageCount = pageDecimalCount % 1 !== 0 ? Math.floor(options.length / displayedItemsCount) + 1 : pageDecimalCount;
|
|
6595
6596
|
var label = options.length === selectedOptions.length ? localization.DeselectAll || "Deselect all" : localization.SelectAll || "Select all";
|
|
6596
6597
|
|
|
6597
6598
|
var _options = pagination ? options.slice((page - 1) * displayedItemsCount, page * displayedItemsCount) : options;
|
|
@@ -6607,7 +6608,7 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6607
6608
|
disabled: false,
|
|
6608
6609
|
checked: options.length > 0 && options.length === selectedOptions.length,
|
|
6609
6610
|
onChange: function onChange() {
|
|
6610
|
-
|
|
6611
|
+
if (!disabled) onSelectDeselectAll(options.length > 0 && options.length === selectedOptions.length ? false : true);
|
|
6611
6612
|
},
|
|
6612
6613
|
color: color,
|
|
6613
6614
|
size: size,
|
|
@@ -6615,10 +6616,10 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6615
6616
|
tooltip: label
|
|
6616
6617
|
}) : /*#__PURE__*/React__default.createElement(ToggleSwitch, {
|
|
6617
6618
|
id: id,
|
|
6618
|
-
disabled:
|
|
6619
|
+
disabled: disabled,
|
|
6619
6620
|
checked: options.length === selectedOptions.length,
|
|
6620
6621
|
onChange: function onChange() {
|
|
6621
|
-
|
|
6622
|
+
if (!disabled) onSelectDeselectAll(options.length === selectedOptions.length ? false : true);
|
|
6622
6623
|
},
|
|
6623
6624
|
color: color,
|
|
6624
6625
|
size: size,
|
|
@@ -22940,7 +22941,7 @@ var DropdownLookup = function DropdownLookup(props) {
|
|
|
22940
22941
|
className: "fas fa-times fa-fw"
|
|
22941
22942
|
})), loading && /*#__PURE__*/React__default.createElement(LoadingButtonContainer, themeProps, /*#__PURE__*/React__default.createElement("i", {
|
|
22942
22943
|
className: "fas fa-redo fa-fw"
|
|
22943
|
-
})), !loading && /*#__PURE__*/React__default.createElement(ButtonContainer$3, _extends({}, themeProps, {
|
|
22944
|
+
})), !loading && disabled ? '' : /*#__PURE__*/React__default.createElement(ButtonContainer$3, _extends({}, themeProps, {
|
|
22944
22945
|
clickable: options == null || options.length === 0,
|
|
22945
22946
|
onClick: function onClick() {
|
|
22946
22947
|
if (options == null || options.length === 0) {
|
|
@@ -48992,19 +48993,240 @@ var TableSelectionType = {
|
|
|
48992
48993
|
MULTIPLE: "multiple"
|
|
48993
48994
|
};
|
|
48994
48995
|
|
|
48995
|
-
var _templateObject$i, _templateObject2$f, _templateObject3$c, _templateObject4$b, _templateObject5$a, _templateObject6$8;
|
|
48996
|
-
var Container$g = newStyled.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n
|
|
48996
|
+
var _templateObject$i, _templateObject2$f, _templateObject3$c, _templateObject4$b, _templateObject5$a, _templateObject6$8, _templateObject7$5, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$4, _templateObject12$4;
|
|
48997
|
+
var Container$g = newStyled.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n border-radius: 3px;\n font-size: ", ";\n font-family: ", ";\n"])), theme.typography.small.fontSize, theme.typography.fontFamily);
|
|
48998
|
+
var Wrapper$1 = newStyled.div(_templateObject2$f || (_templateObject2$f = _taggedTemplateLiteral(["\n display: block;\n overflow-x: auto;\n white-space: nowrap;\n"])));
|
|
48999
|
+
var TableTable$1 = newStyled.table(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteral(["\n border-collapse: collapse;\n width: 100%;\n"])));
|
|
49000
|
+
var TableHead$1 = newStyled.thead(_templateObject4$b || (_templateObject4$b = _taggedTemplateLiteral(["\n color: ", ";\n border-top: 1px solid #80808025;\n"])), theme.palette.primary.textDark);
|
|
49001
|
+
var TableHeadRow$1 = newStyled.tr(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteral(["\n border-bottom: 1px solid #80808025;\n"])));
|
|
49002
|
+
var TableHeadCell$1 = newStyled.th(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteral(["\n text-align: left;\n transition: all 250ms ease;\n font-weight: 900;\n font-size: 13px;\n\n ", "\n\n &:first-of-type {\n border-radius: 3px 0 0 0;\n }\n\n &:last-of-type {\n border-radius: 0 3px 0 0;\n }\n\n &:hover {\n // background-color: ", ";\n background-color: whitesmoke;\n cursor: ", ";\n }\n"])), function (props) {
|
|
49003
|
+
return props.selectionCell === true ? "width: 27px; padding: 1px 1px 1px 6px;" : "padding: 5px 5px 5px 6px;";
|
|
49004
|
+
}, theme.palette.primary.light, function (props) {
|
|
49005
|
+
return props.hideOrdering ? "inherit" : "pointer";
|
|
49006
|
+
});
|
|
49007
|
+
var HeaderInnerCell$1 = newStyled.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n // justify-content: center;\n\n & i {\n color: black;\n }\n"])));
|
|
49008
|
+
var HeaderCellText$1 = newStyled.span(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteral(["\n color: black;\n"])));
|
|
49009
|
+
var HeaderCellIcon$1 = newStyled.span(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteral(["\n color: black;\n margin-left: auto;\n\n & i {\n color: ", ";\n }\n"])), function (props) {
|
|
49010
|
+
return props.sort ? "transparent" : "black";
|
|
49011
|
+
});
|
|
49012
|
+
var TableBody$1 = newStyled.tbody(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteral([""])));
|
|
49013
|
+
var TableBodyRow$1 = newStyled.tr(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteral(["\n border-bottom: 1px solid transparent;\n border-top: 1px solid transparent;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
49014
|
+
if (props.selectedRow !== true) return "\n &:hover {\n & > td {\n // border-bottom: 1px solid ".concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n background-color: whitesmoke;\n }\n \n cursor: pointer;\n }");else return "";
|
|
49015
|
+
}, function (props) {
|
|
49016
|
+
if (props.selectedRow === true) return "\n background-color: ".concat(theme.palette.primary.lighter, ";\n cursor: pointer;\n \n & > td {\n // border-bottom: 1px solid ").concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n }\n ");else return "";
|
|
49017
|
+
});
|
|
49018
|
+
var TableBodyCell$1 = newStyled.td(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (props) {
|
|
49019
|
+
return props.selectionCell === true ? "1px 1px 1px 6px" : "5px 5px 5px 10px";
|
|
49020
|
+
});
|
|
49021
|
+
|
|
49022
|
+
var TableView = function TableView(props) {
|
|
49023
|
+
//======== RENDER ========
|
|
49024
|
+
var _props$Config = props.Config,
|
|
49025
|
+
Columns = _props$Config.Columns,
|
|
49026
|
+
Data = _props$Config.Data,
|
|
49027
|
+
IsLoading = _props$Config.IsLoading,
|
|
49028
|
+
ChangeToFormView = _props$Config.ChangeToFormView,
|
|
49029
|
+
SelectedData = _props$Config.SelectedData,
|
|
49030
|
+
SelectionIndicator = _props$Config.SelectionIndicator,
|
|
49031
|
+
SelectedEntirePage = _props$Config.SelectedEntirePage,
|
|
49032
|
+
EnableSelection = _props$Config.EnableSelection,
|
|
49033
|
+
EnableFormView = _props$Config.EnableFormView,
|
|
49034
|
+
SelectionType = _props$Config.SelectionType,
|
|
49035
|
+
_props$Config$OnSelec = _props$Config.OnSelection,
|
|
49036
|
+
OnSelection = _props$Config$OnSelec === void 0 ? function () {} : _props$Config$OnSelec,
|
|
49037
|
+
_props$Config$OnSelec2 = _props$Config.OnSelectAll,
|
|
49038
|
+
OnSelectAll = _props$Config$OnSelec2 === void 0 ? function () {} : _props$Config$OnSelec2;
|
|
49039
|
+
_props$Config.EnablePagination;
|
|
49040
|
+
var EnableOrdering = _props$Config.EnableOrdering,
|
|
49041
|
+
Accessor = _props$Config.Accessor,
|
|
49042
|
+
Ascending = _props$Config.Ascending,
|
|
49043
|
+
Descending = _props$Config.Descending,
|
|
49044
|
+
_props$Config$OnHeade = _props$Config.OnHeaderClick,
|
|
49045
|
+
OnHeaderClick = _props$Config$OnHeade === void 0 ? function () {} : _props$Config$OnHeade,
|
|
49046
|
+
ReadOnly = _props$Config.ReadOnly,
|
|
49047
|
+
_props$Config$IsLooku = _props$Config.IsLookup,
|
|
49048
|
+
IsLookup = _props$Config$IsLooku === void 0 ? false : _props$Config$IsLooku,
|
|
49049
|
+
_props$Config$LookupT = _props$Config.LookupTakeItem,
|
|
49050
|
+
LookupTakeItem = _props$Config$LookupT === void 0 ? function () {} : _props$Config$LookupT;
|
|
49051
|
+
var _props$Localization = props.Localization,
|
|
49052
|
+
Localization = _props$Localization === void 0 ? {} : _props$Localization;
|
|
49053
|
+
props.Export;
|
|
49054
|
+
props.Icons;
|
|
49055
|
+
//======== FUNCTIONS ========
|
|
49056
|
+
|
|
49057
|
+
function isFunction(functionToCheck) {
|
|
49058
|
+
return functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
|
|
49059
|
+
}
|
|
49060
|
+
|
|
49061
|
+
var handleOnSelection = function handleOnSelection(rowData, val) {
|
|
49062
|
+
OnSelection(rowData, val, SelectionType);
|
|
49063
|
+
};
|
|
49064
|
+
|
|
49065
|
+
var handleSelectAll = function handleSelectAll(val) {
|
|
49066
|
+
OnSelectAll(val);
|
|
49067
|
+
}; //======== RENDER ========
|
|
49068
|
+
|
|
49069
|
+
|
|
49070
|
+
var isItemInArray = function isItemInArray(item, array, byProp) {
|
|
49071
|
+
if (item[byProp] !== undefined) return !lodash.exports.isUndefined(array.find(function (x) {
|
|
49072
|
+
return x[byProp] === item[byProp];
|
|
49073
|
+
}));
|
|
49074
|
+
return array.indexOf(item) > -1;
|
|
49075
|
+
};
|
|
49076
|
+
|
|
49077
|
+
var renderBody = function renderBody() {
|
|
49078
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Data.map(function (dataItem, i) {
|
|
49079
|
+
return renderBodyRow(dataItem, i);
|
|
49080
|
+
}));
|
|
49081
|
+
};
|
|
49082
|
+
|
|
49083
|
+
var renderBodyRow = function renderBodyRow(dataItem, i) {
|
|
49084
|
+
Columns.find(function (x) {
|
|
49085
|
+
return x.nested;
|
|
49086
|
+
});
|
|
49087
|
+
var rowSelected = isItemInArray(dataItem, SelectedData, SelectionIndicator);
|
|
49088
|
+
return /*#__PURE__*/React__default.createElement(TableBodyRow$1, {
|
|
49089
|
+
selectedRow: rowSelected,
|
|
49090
|
+
key: i
|
|
49091
|
+
}, renderSelectionCell(dataItem, rowSelected, i), Columns.filter(function (x) {
|
|
49092
|
+
return x.hide !== true;
|
|
49093
|
+
}).map(function (col, j) {
|
|
49094
|
+
return renderBodyCell(dataItem, col, i, j);
|
|
49095
|
+
}));
|
|
49096
|
+
};
|
|
49097
|
+
|
|
49098
|
+
var renderBodyCell = function renderBodyCell(dataItem, def, rowIndex, cellIndex) {
|
|
49099
|
+
var tabIndex = rowIndex * Columns.length + cellIndex + 50;
|
|
49100
|
+
|
|
49101
|
+
var onClick = function onClick() {
|
|
49102
|
+
ChangeToFormView(dataItem, rowIndex);
|
|
49103
|
+
};
|
|
49104
|
+
|
|
49105
|
+
if (!EnableFormView) onClick = function onClick() {};
|
|
49106
|
+
if (!EnableSelection || ReadOnly) onClick = function onClick() {};
|
|
49107
|
+
|
|
49108
|
+
if (IsLookup) {
|
|
49109
|
+
onClick = function onClick() {
|
|
49110
|
+
if (!IsLoading) {
|
|
49111
|
+
LookupTakeItem(dataItem);
|
|
49112
|
+
}
|
|
49113
|
+
};
|
|
49114
|
+
}
|
|
49115
|
+
|
|
49116
|
+
var cellData = def.isObject === true ? dataItem[def.accessor][def.objectAccessor] : dataItem[def.accessor];
|
|
49117
|
+
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49118
|
+
key: tabIndex,
|
|
49119
|
+
onClick: onClick
|
|
49120
|
+
}, isFunction(def.specialRender) ? def.specialRender(dataItem, function () {
|
|
49121
|
+
ChangeToFormView(dataItem, rowIndex);
|
|
49122
|
+
}) : cellData);
|
|
49123
|
+
};
|
|
49124
|
+
|
|
49125
|
+
var renderSelectionCell = function renderSelectionCell(dataItem, selected, rowIndex) {
|
|
49126
|
+
if (IsLookup) {
|
|
49127
|
+
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49128
|
+
selectionCell: true,
|
|
49129
|
+
key: -1
|
|
49130
|
+
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
49131
|
+
inverted: true,
|
|
49132
|
+
onClick: function onClick() {
|
|
49133
|
+
if (!IsLoading) {
|
|
49134
|
+
LookupTakeItem(dataItem);
|
|
49135
|
+
}
|
|
49136
|
+
},
|
|
49137
|
+
icon: "arrow-right"
|
|
49138
|
+
}));
|
|
49139
|
+
}
|
|
49140
|
+
|
|
49141
|
+
if (!EnableSelection || ReadOnly || IsLookup) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
49142
|
+
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49143
|
+
selectionCell: true,
|
|
49144
|
+
key: -1
|
|
49145
|
+
}, /*#__PURE__*/React__default.createElement(CheckBox, {
|
|
49146
|
+
checked: selected,
|
|
49147
|
+
onChange: function onChange(e, val) {
|
|
49148
|
+
return handleOnSelection(dataItem, val);
|
|
49149
|
+
},
|
|
49150
|
+
id: rowIndex
|
|
49151
|
+
}));
|
|
49152
|
+
};
|
|
49153
|
+
|
|
49154
|
+
var renderHeaderCell = function renderHeaderCell(def, i) {
|
|
49155
|
+
var headerClick = function headerClick() {};
|
|
49156
|
+
|
|
49157
|
+
var hideOrdering = !EnableOrdering || (def.sortable === undefined ? false : def.sortable === false);
|
|
49158
|
+
var isAccessor = def.accessor === Accessor;
|
|
49159
|
+
var orderingIconClass; //-------------------------------------------------------------------
|
|
49160
|
+
|
|
49161
|
+
if (isAccessor && Ascending) orderingIconClass = "long-arrow-alt-up";
|
|
49162
|
+
if (isAccessor && Descending) orderingIconClass = "long-arrow-alt-down";
|
|
49163
|
+
if (isAccessor && !Ascending && !Descending) orderingIconClass = "sort";
|
|
49164
|
+
if (!isAccessor) orderingIconClass = "sort"; //-------------------------------------------------------------------
|
|
49165
|
+
|
|
49166
|
+
if (!isAccessor) headerClick = function headerClick() {
|
|
49167
|
+
return OnHeaderClick(def.sourceEntityName, def.accessor, true, false);
|
|
49168
|
+
};
|
|
49169
|
+
if (isAccessor && Ascending) headerClick = function headerClick() {
|
|
49170
|
+
return OnHeaderClick(def.sourceEntityName, def.accessor, false, true);
|
|
49171
|
+
};
|
|
49172
|
+
if (isAccessor && Descending) headerClick = function headerClick() {
|
|
49173
|
+
return OnHeaderClick("", "", false, true);
|
|
49174
|
+
}; //-------------------------------------------------------------------
|
|
49175
|
+
|
|
49176
|
+
return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49177
|
+
hideOrdering: hideOrdering,
|
|
49178
|
+
key: i,
|
|
49179
|
+
onClick: IsLoading || hideOrdering ? function () {} : headerClick
|
|
49180
|
+
}, /*#__PURE__*/React__default.createElement(HeaderInnerCell$1, null, /*#__PURE__*/React__default.createElement(HeaderCellText$1, null, def.displayName), !hideOrdering && /*#__PURE__*/React__default.createElement(HeaderCellIcon$1, {
|
|
49181
|
+
sort: orderingIconClass === "sort"
|
|
49182
|
+
}, /*#__PURE__*/React__default.createElement(Icon$1, {
|
|
49183
|
+
color: "white",
|
|
49184
|
+
icon: orderingIconClass
|
|
49185
|
+
}))));
|
|
49186
|
+
};
|
|
49187
|
+
|
|
49188
|
+
var renderSelectAllHeaderCell = function renderSelectAllHeaderCell() {
|
|
49189
|
+
if (IsLookup) return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49190
|
+
selectionCell: true,
|
|
49191
|
+
key: -1
|
|
49192
|
+
});
|
|
49193
|
+
if (!EnableSelection || ReadOnly || IsLookup && SelectionType === TableSelectionType.SINGLE) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
49194
|
+
if (SelectedEntirePage && Localization.DeselectAll) ;
|
|
49195
|
+
if (!SelectedEntirePage && Localization.SelectAll) ;
|
|
49196
|
+
return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49197
|
+
selectionCell: true,
|
|
49198
|
+
key: -1
|
|
49199
|
+
}, SelectionType === TableSelectionType.MULTIPLE && /*#__PURE__*/React__default.createElement(CheckBox, {
|
|
49200
|
+
checked: SelectedEntirePage,
|
|
49201
|
+
onChange: function onChange() {
|
|
49202
|
+
return handleSelectAll(!SelectedEntirePage);
|
|
49203
|
+
},
|
|
49204
|
+
id: "SelectedEntirePage"
|
|
49205
|
+
}));
|
|
49206
|
+
};
|
|
49207
|
+
|
|
49208
|
+
return /*#__PURE__*/React__default.createElement(Container$g, null, /*#__PURE__*/React__default.createElement(Wrapper$1, null, /*#__PURE__*/React__default.createElement(TableTable$1, {
|
|
49209
|
+
cellSpacing: 0
|
|
49210
|
+
}, /*#__PURE__*/React__default.createElement(TableHead$1, null, /*#__PURE__*/React__default.createElement(TableHeadRow$1, null, renderSelectAllHeaderCell(), Columns.filter(function (x) {
|
|
49211
|
+
return x.hide !== true;
|
|
49212
|
+
}).map(function (col, i) {
|
|
49213
|
+
return renderHeaderCell(col, i);
|
|
49214
|
+
}))), /*#__PURE__*/React__default.createElement(TableBody$1, null, renderBody()))));
|
|
49215
|
+
};
|
|
49216
|
+
|
|
49217
|
+
var _templateObject$h, _templateObject2$e, _templateObject3$b, _templateObject4$a, _templateObject5$9, _templateObject6$7;
|
|
49218
|
+
var Container$f = newStyled.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n justify-content: left;\n align-items: center;\n border-radius: 3px;\n padding: 4px;\n font-size: ", ";\n font-family: ", ";\n"])), function (props) {
|
|
48997
49219
|
return props.theme.typography.small.fontSize;
|
|
48998
49220
|
}, function (props) {
|
|
48999
49221
|
return props.theme.typography.fontFamily;
|
|
49000
49222
|
});
|
|
49001
|
-
var Item$2 = newStyled.div(_templateObject2$
|
|
49223
|
+
var Item$2 = newStyled.div(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteral(["\n padding-left: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
49002
49224
|
return props.first ? "0" : "6px";
|
|
49003
49225
|
});
|
|
49004
|
-
var ExportItem = newStyled.div(_templateObject3$
|
|
49005
|
-
var ItemText = newStyled.div(_templateObject4$
|
|
49006
|
-
var ItemCurrentPage = newStyled.div(_templateObject5$
|
|
49007
|
-
var ItemDropdown = newStyled.div(_templateObject6$
|
|
49226
|
+
var ExportItem = newStyled.div(_templateObject3$b || (_templateObject3$b = _taggedTemplateLiteral(["\n padding-left: 6px;\n display: flex;\n align-items: center;\n margin-left: auto;\n"])));
|
|
49227
|
+
var ItemText = newStyled.div(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteral(["\n padding-left: 12px;\n display: flex;\n align-items: center;\n"])));
|
|
49228
|
+
var ItemCurrentPage = newStyled.div(_templateObject5$9 || (_templateObject5$9 = _taggedTemplateLiteral(["\n padding-left: 6px;\n display: flex;\n align-items: center;\n"])));
|
|
49229
|
+
var ItemDropdown = newStyled.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteral(["\n padding-left: 14px;\n display: flex;\n align-items: center;\n"])));
|
|
49008
49230
|
|
|
49009
49231
|
var Pagination = function Pagination(props) {
|
|
49010
49232
|
//======================== PROPS ============================================
|
|
@@ -49172,7 +49394,7 @@ var Pagination = function Pagination(props) {
|
|
|
49172
49394
|
})));
|
|
49173
49395
|
};
|
|
49174
49396
|
|
|
49175
|
-
return /*#__PURE__*/React__default.createElement(Container$
|
|
49397
|
+
return /*#__PURE__*/React__default.createElement(Container$f, themeProps, renderFirst(), renderPrevious(), renderCurrentPage(), renderNext(), renderLast(), renderPageSize(), renderRowInformation(), renderExportButtons());
|
|
49176
49398
|
};
|
|
49177
49399
|
|
|
49178
49400
|
Pagination.defaultProps = {
|
|
@@ -49237,227 +49459,6 @@ Pagination.propTypes = {
|
|
|
49237
49459
|
color: PropTypes.oneOf(["primary", "secondary", "success", "error", "warning", "gray"])
|
|
49238
49460
|
};
|
|
49239
49461
|
|
|
49240
|
-
var _templateObject$h, _templateObject2$e, _templateObject3$b, _templateObject4$a, _templateObject5$9, _templateObject6$7, _templateObject7$5, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$4, _templateObject12$4;
|
|
49241
|
-
var Container$f = newStyled.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral(["\n border-radius: 3px;\n font-size: ", ";\n font-family: ", ";\n"])), theme.typography.small.fontSize, theme.typography.fontFamily);
|
|
49242
|
-
var Wrapper$1 = newStyled.div(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteral(["\n display: block;\n overflow-x: auto;\n white-space: nowrap;\n"])));
|
|
49243
|
-
var TableTable$1 = newStyled.table(_templateObject3$b || (_templateObject3$b = _taggedTemplateLiteral(["\n border-collapse: collapse;\n width: 100%;\n"])));
|
|
49244
|
-
var TableHead$1 = newStyled.thead(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteral(["\n color: ", ";\n border-top: 1px solid #80808025;\n"])), theme.palette.primary.textDark);
|
|
49245
|
-
var TableHeadRow$1 = newStyled.tr(_templateObject5$9 || (_templateObject5$9 = _taggedTemplateLiteral(["\n border-bottom: 1px solid #80808025;\n"])));
|
|
49246
|
-
var TableHeadCell$1 = newStyled.th(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteral(["\n text-align: left;\n transition: all 250ms ease;\n font-weight: 900;\n font-size: 13px;\n\n ", "\n\n &:first-of-type {\n border-radius: 3px 0 0 0;\n }\n\n &:last-of-type {\n border-radius: 0 3px 0 0;\n }\n\n &:hover {\n // background-color: ", ";\n background-color: whitesmoke;\n cursor: ", ";\n }\n"])), function (props) {
|
|
49247
|
-
return props.selectionCell === true ? "width: 27px; padding: 1px 1px 1px 6px;" : "padding: 5px 5px 5px 6px;";
|
|
49248
|
-
}, theme.palette.primary.light, function (props) {
|
|
49249
|
-
return props.hideOrdering ? "inherit" : "pointer";
|
|
49250
|
-
});
|
|
49251
|
-
var HeaderInnerCell$1 = newStyled.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: row;\n align-items: center;\n // justify-content: center;\n\n & i {\n color: black;\n }\n"])));
|
|
49252
|
-
var HeaderCellText$1 = newStyled.span(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteral(["\n color: black;\n"])));
|
|
49253
|
-
var HeaderCellIcon$1 = newStyled.span(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteral(["\n color: black;\n margin-left: auto;\n\n & i {\n color: ", ";\n }\n"])), function (props) {
|
|
49254
|
-
return props.sort ? "transparent" : "black";
|
|
49255
|
-
});
|
|
49256
|
-
var TableBody$1 = newStyled.tbody(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteral([""])));
|
|
49257
|
-
var TableBodyRow$1 = newStyled.tr(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteral(["\n border-bottom: 1px solid transparent;\n border-top: 1px solid transparent;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
49258
|
-
if (props.selectedRow !== true) return "\n &:hover {\n & > td {\n // border-bottom: 1px solid ".concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n background-color: whitesmoke;\n }\n \n cursor: pointer;\n }");else return "";
|
|
49259
|
-
}, function (props) {
|
|
49260
|
-
if (props.selectedRow === true) return "\n background-color: ".concat(theme.palette.primary.lighter, ";\n cursor: pointer;\n \n & > td {\n // border-bottom: 1px solid ").concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n }\n ");else return "";
|
|
49261
|
-
});
|
|
49262
|
-
var TableBodyCell$1 = newStyled.td(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteral(["\n padding: ", ";\n"])), function (props) {
|
|
49263
|
-
return props.selectionCell === true ? "1px 1px 1px 6px" : "5px 5px 5px 10px";
|
|
49264
|
-
});
|
|
49265
|
-
|
|
49266
|
-
var TableView = function TableView(props) {
|
|
49267
|
-
//======== RENDER ========
|
|
49268
|
-
var _props$Config = props.Config,
|
|
49269
|
-
Columns = _props$Config.Columns,
|
|
49270
|
-
Data = _props$Config.Data,
|
|
49271
|
-
IsLoading = _props$Config.IsLoading,
|
|
49272
|
-
ChangeToFormView = _props$Config.ChangeToFormView,
|
|
49273
|
-
SelectedData = _props$Config.SelectedData,
|
|
49274
|
-
SelectionIndicator = _props$Config.SelectionIndicator,
|
|
49275
|
-
SelectedEntirePage = _props$Config.SelectedEntirePage,
|
|
49276
|
-
EnableSelection = _props$Config.EnableSelection,
|
|
49277
|
-
EnableFormView = _props$Config.EnableFormView,
|
|
49278
|
-
SelectionType = _props$Config.SelectionType,
|
|
49279
|
-
_props$Config$OnSelec = _props$Config.OnSelection,
|
|
49280
|
-
OnSelection = _props$Config$OnSelec === void 0 ? function () {} : _props$Config$OnSelec,
|
|
49281
|
-
_props$Config$OnSelec2 = _props$Config.OnSelectAll,
|
|
49282
|
-
OnSelectAll = _props$Config$OnSelec2 === void 0 ? function () {} : _props$Config$OnSelec2;
|
|
49283
|
-
_props$Config.EnablePagination;
|
|
49284
|
-
var EnableOrdering = _props$Config.EnableOrdering,
|
|
49285
|
-
Accessor = _props$Config.Accessor,
|
|
49286
|
-
Ascending = _props$Config.Ascending,
|
|
49287
|
-
Descending = _props$Config.Descending,
|
|
49288
|
-
_props$Config$OnHeade = _props$Config.OnHeaderClick,
|
|
49289
|
-
OnHeaderClick = _props$Config$OnHeade === void 0 ? function () {} : _props$Config$OnHeade,
|
|
49290
|
-
ReadOnly = _props$Config.ReadOnly,
|
|
49291
|
-
_props$Config$IsLooku = _props$Config.IsLookup,
|
|
49292
|
-
IsLookup = _props$Config$IsLooku === void 0 ? false : _props$Config$IsLooku,
|
|
49293
|
-
_props$Config$LookupT = _props$Config.LookupTakeItem,
|
|
49294
|
-
LookupTakeItem = _props$Config$LookupT === void 0 ? function () {} : _props$Config$LookupT;
|
|
49295
|
-
var _props$Localization = props.Localization,
|
|
49296
|
-
Localization = _props$Localization === void 0 ? {} : _props$Localization;
|
|
49297
|
-
props.Export;
|
|
49298
|
-
props.Icons;
|
|
49299
|
-
//======== FUNCTIONS ========
|
|
49300
|
-
|
|
49301
|
-
function isFunction(functionToCheck) {
|
|
49302
|
-
return functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
|
|
49303
|
-
}
|
|
49304
|
-
|
|
49305
|
-
var handleOnSelection = function handleOnSelection(rowData, val) {
|
|
49306
|
-
OnSelection(rowData, val, SelectionType);
|
|
49307
|
-
};
|
|
49308
|
-
|
|
49309
|
-
var handleSelectAll = function handleSelectAll(val) {
|
|
49310
|
-
OnSelectAll(val);
|
|
49311
|
-
}; //======== RENDER ========
|
|
49312
|
-
|
|
49313
|
-
|
|
49314
|
-
var isItemInArray = function isItemInArray(item, array, byProp) {
|
|
49315
|
-
if (item[byProp] !== undefined) return !lodash.exports.isUndefined(array.find(function (x) {
|
|
49316
|
-
return x[byProp] === item[byProp];
|
|
49317
|
-
}));
|
|
49318
|
-
return array.indexOf(item) > -1;
|
|
49319
|
-
};
|
|
49320
|
-
|
|
49321
|
-
var renderBody = function renderBody() {
|
|
49322
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, Data.map(function (dataItem, i) {
|
|
49323
|
-
return renderBodyRow(dataItem, i);
|
|
49324
|
-
}));
|
|
49325
|
-
};
|
|
49326
|
-
|
|
49327
|
-
var renderBodyRow = function renderBodyRow(dataItem, i) {
|
|
49328
|
-
Columns.find(function (x) {
|
|
49329
|
-
return x.nested;
|
|
49330
|
-
});
|
|
49331
|
-
var rowSelected = isItemInArray(dataItem, SelectedData, SelectionIndicator);
|
|
49332
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(TableBodyRow$1, {
|
|
49333
|
-
selectedRow: rowSelected,
|
|
49334
|
-
key: i
|
|
49335
|
-
}, renderSelectionCell(dataItem, rowSelected, i), Columns.filter(function (x) {
|
|
49336
|
-
return x.hide !== true;
|
|
49337
|
-
}).map(function (col, j) {
|
|
49338
|
-
return renderBodyCell(dataItem, col, i, j);
|
|
49339
|
-
})));
|
|
49340
|
-
};
|
|
49341
|
-
|
|
49342
|
-
var renderBodyCell = function renderBodyCell(dataItem, def, rowIndex, cellIndex) {
|
|
49343
|
-
var tabIndex = rowIndex * Columns.length + cellIndex + 50;
|
|
49344
|
-
|
|
49345
|
-
var onClick = function onClick() {
|
|
49346
|
-
ChangeToFormView(dataItem);
|
|
49347
|
-
};
|
|
49348
|
-
|
|
49349
|
-
if (!EnableFormView) onClick = function onClick() {};
|
|
49350
|
-
if (!EnableSelection || ReadOnly) onClick = function onClick() {};
|
|
49351
|
-
|
|
49352
|
-
if (IsLookup) {
|
|
49353
|
-
onClick = function onClick() {
|
|
49354
|
-
if (!IsLoading) {
|
|
49355
|
-
LookupTakeItem(dataItem);
|
|
49356
|
-
}
|
|
49357
|
-
};
|
|
49358
|
-
}
|
|
49359
|
-
|
|
49360
|
-
var cellData = def.isObject === true ? dataItem[def.accessor][def.objectAccessor] : dataItem[def.accessor];
|
|
49361
|
-
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49362
|
-
key: tabIndex,
|
|
49363
|
-
onClick: onClick
|
|
49364
|
-
}, isFunction(def.specialRender) ? def.specialRender(dataItem, function () {
|
|
49365
|
-
ChangeToFormView(dataItem);
|
|
49366
|
-
}) : cellData);
|
|
49367
|
-
};
|
|
49368
|
-
|
|
49369
|
-
var renderSelectionCell = function renderSelectionCell(dataItem, selected, rowIndex) {
|
|
49370
|
-
if (IsLookup) {
|
|
49371
|
-
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49372
|
-
selectionCell: true,
|
|
49373
|
-
key: -1
|
|
49374
|
-
}, /*#__PURE__*/React__default.createElement(Button$1, {
|
|
49375
|
-
inverted: true,
|
|
49376
|
-
onClick: function onClick() {
|
|
49377
|
-
if (!IsLoading) {
|
|
49378
|
-
LookupTakeItem(dataItem);
|
|
49379
|
-
}
|
|
49380
|
-
},
|
|
49381
|
-
icon: "arrow-right"
|
|
49382
|
-
}));
|
|
49383
|
-
}
|
|
49384
|
-
|
|
49385
|
-
if (!EnableSelection || ReadOnly || IsLookup) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
49386
|
-
return /*#__PURE__*/React__default.createElement(TableBodyCell$1, {
|
|
49387
|
-
selectionCell: true,
|
|
49388
|
-
key: -1
|
|
49389
|
-
}, /*#__PURE__*/React__default.createElement(CheckBox, {
|
|
49390
|
-
checked: selected,
|
|
49391
|
-
onChange: function onChange(e, val) {
|
|
49392
|
-
return handleOnSelection(dataItem, val);
|
|
49393
|
-
},
|
|
49394
|
-
id: rowIndex
|
|
49395
|
-
}));
|
|
49396
|
-
};
|
|
49397
|
-
|
|
49398
|
-
var renderHeaderCell = function renderHeaderCell(def, i) {
|
|
49399
|
-
var headerClick = function headerClick() {};
|
|
49400
|
-
|
|
49401
|
-
var hideOrdering = !EnableOrdering || (def.sortable === undefined ? false : def.sortable === false);
|
|
49402
|
-
var isAccessor = def.accessor === Accessor;
|
|
49403
|
-
var orderingIconClass; //-------------------------------------------------------------------
|
|
49404
|
-
|
|
49405
|
-
if (isAccessor && Ascending) orderingIconClass = "long-arrow-alt-up";
|
|
49406
|
-
if (isAccessor && Descending) orderingIconClass = "long-arrow-alt-down";
|
|
49407
|
-
if (isAccessor && !Ascending && !Descending) orderingIconClass = "sort";
|
|
49408
|
-
if (!isAccessor) orderingIconClass = "sort"; //-------------------------------------------------------------------
|
|
49409
|
-
|
|
49410
|
-
if (!isAccessor) headerClick = function headerClick() {
|
|
49411
|
-
return OnHeaderClick(def.sourceEntityName, def.accessor, true, false);
|
|
49412
|
-
};
|
|
49413
|
-
if (isAccessor && Ascending) headerClick = function headerClick() {
|
|
49414
|
-
return OnHeaderClick(def.sourceEntityName, def.accessor, false, true);
|
|
49415
|
-
};
|
|
49416
|
-
if (isAccessor && Descending) headerClick = function headerClick() {
|
|
49417
|
-
return OnHeaderClick("", "", false, true);
|
|
49418
|
-
}; //-------------------------------------------------------------------
|
|
49419
|
-
|
|
49420
|
-
return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49421
|
-
hideOrdering: hideOrdering,
|
|
49422
|
-
key: i,
|
|
49423
|
-
onClick: IsLoading || hideOrdering ? function () {} : headerClick
|
|
49424
|
-
}, /*#__PURE__*/React__default.createElement(HeaderInnerCell$1, null, /*#__PURE__*/React__default.createElement(HeaderCellText$1, null, def.displayName), !hideOrdering && /*#__PURE__*/React__default.createElement(HeaderCellIcon$1, {
|
|
49425
|
-
sort: orderingIconClass === "sort"
|
|
49426
|
-
}, /*#__PURE__*/React__default.createElement(Icon$1, {
|
|
49427
|
-
color: "white",
|
|
49428
|
-
icon: orderingIconClass
|
|
49429
|
-
}))));
|
|
49430
|
-
};
|
|
49431
|
-
|
|
49432
|
-
var renderSelectAllHeaderCell = function renderSelectAllHeaderCell() {
|
|
49433
|
-
if (IsLookup) return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49434
|
-
selectionCell: true,
|
|
49435
|
-
key: -1
|
|
49436
|
-
});
|
|
49437
|
-
if (!EnableSelection || ReadOnly || IsLookup && SelectionType === TableSelectionType.SINGLE) return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
49438
|
-
if (SelectedEntirePage && Localization.DeselectAll) ;
|
|
49439
|
-
if (!SelectedEntirePage && Localization.SelectAll) ;
|
|
49440
|
-
return /*#__PURE__*/React__default.createElement(TableHeadCell$1, {
|
|
49441
|
-
selectionCell: true,
|
|
49442
|
-
key: -1
|
|
49443
|
-
}, SelectionType === TableSelectionType.MULTIPLE && /*#__PURE__*/React__default.createElement(CheckBox, {
|
|
49444
|
-
checked: SelectedEntirePage,
|
|
49445
|
-
onChange: function onChange() {
|
|
49446
|
-
return handleSelectAll(!SelectedEntirePage);
|
|
49447
|
-
},
|
|
49448
|
-
id: "SelectedEntirePage"
|
|
49449
|
-
}));
|
|
49450
|
-
};
|
|
49451
|
-
|
|
49452
|
-
return /*#__PURE__*/React__default.createElement(Container$f, null, /*#__PURE__*/React__default.createElement(Wrapper$1, null, /*#__PURE__*/React__default.createElement(TableTable$1, {
|
|
49453
|
-
cellSpacing: 0
|
|
49454
|
-
}, /*#__PURE__*/React__default.createElement(TableHead$1, null, /*#__PURE__*/React__default.createElement(TableHeadRow$1, null, renderSelectAllHeaderCell(), Columns.filter(function (x) {
|
|
49455
|
-
return x.hide !== true;
|
|
49456
|
-
}).map(function (col, i) {
|
|
49457
|
-
return renderHeaderCell(col, i);
|
|
49458
|
-
}))), /*#__PURE__*/React__default.createElement(TableBody$1, null, renderBody()))));
|
|
49459
|
-
};
|
|
49460
|
-
|
|
49461
49462
|
var _templateObject$g, _templateObject2$d;
|
|
49462
49463
|
|
|
49463
49464
|
var heightBySize$6 = function heightBySize(size) {
|
package/lib/index.js
CHANGED
|
@@ -4662,7 +4662,7 @@ var getCheckboxCss = function getCheckboxCss(props) {
|
|
|
4662
4662
|
height = "1.6875rem";
|
|
4663
4663
|
}
|
|
4664
4664
|
|
|
4665
|
-
return css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral__default['default'](["\n .c-", "-container {\n font-family: ", ";\n display: inline-block;\n position: relative;\n padding: 0.25rem;\n padding-left: ", ";\n ", "\n cursor:
|
|
4665
|
+
return css(_templateObject$r || (_templateObject$r = _taggedTemplateLiteral__default['default'](["\n .c-", "-container {\n font-family: ", ";\n display: inline-block;\n position: relative;\n padding: 0.25rem;\n padding-left: ", ";\n ", "\n cursor: auto;\n font-size: ", ";\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n margin: ", ";\n margin-left: ", ";\n }\n\n /* Hide the browser's default checkbox */\n .c-", "-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n }\n\n /* Create a custom checkbox */\n .c-", "-checkmark {\n position: absolute;\n top: 0;\n left: 0;\n height: ", ";\n width: ", ";\n background-color: #eee;\n border: 0.0625rem solid ", ";\n border-radius: 2px;\n transition: all 200ms ease;\n }\n\n /* On mouse-over, add a grey background color */\n .c-", "-container:hover input ~ .c-", "-checkmark {\n cursor: pointer;\n }\n\n .c-", "-container:hover input:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n cursor: default;\n }\n\n .c-", "-container input:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n }\n\n /* When the checkbox is checked, add a blue background */\n .c-", "-container input:checked ~ .c-", "-checkmark {\n background-color: ", ";\n }\n\n .c-", "-container input:checked:disabled ~ .c-", "-checkmark {\n background-color: ", ";\n border: 0.0625rem solid ", ";\n cursor: default;\n }\n\n /* Create the checkmark/indicator (hidden when not checked) */\n .c-", "-checkmark:after {\n content: \"\";\n position: absolute;\n display: none;\n }\n\n /* Show the checkmark when checked */\n .c-", "-container input:checked ~ .c-", "-checkmark:after {\n display: block;\n }\n\n /* Style the checkmark/indicator */\n .c-", "-container .c-", "-checkmark:after {\n left: ", ";\n top: ", ";\n width: ", ";\n height: ", ";\n border: solid white;\n border-width: 0 0.21875rem 0.21875rem 0;\n -webkit-transform: rotate(35deg);\n -ms-transform: rotate(35deg);\n transform: rotate(35deg);\n }\n "])), props.id, props.theme.typography.fontFamily, padingLeft, paddingTop, props.theme.typography[props.size].fontSize, margin, marginLeft, props.id, props.id, height, width, props.theme.palette[props.color].main, props.id, props.id, props.id, props.id, props.theme.palette.gray[900], props.id, props.id, props.theme.palette.gray[900], props.id, props.id, props.theme.palette[props.color].main, props.id, props.id, props.theme.palette.gray[900], props.theme.palette.gray.textLight, props.id, props.id, props.id, props.id, props.id, left, top, checkWidth, checkHeight);
|
|
4666
4666
|
};
|
|
4667
4667
|
|
|
4668
4668
|
var CheckBox = function CheckBox(props) {
|
|
@@ -4676,7 +4676,7 @@ var CheckBox = function CheckBox(props) {
|
|
|
4676
4676
|
|
|
4677
4677
|
var handleChange = function handleChange(e) {
|
|
4678
4678
|
if (preventDefault) e.preventDefault();
|
|
4679
|
-
onChange(id, !checked);
|
|
4679
|
+
if (!disabled) onChange(id, !checked);
|
|
4680
4680
|
};
|
|
4681
4681
|
|
|
4682
4682
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(Global, {
|
|
@@ -4795,7 +4795,7 @@ var Text$2 = newStyled.label(_templateObject$q || (_templateObject$q = _taggedTe
|
|
|
4795
4795
|
}, function (props) {
|
|
4796
4796
|
return getLabelAndTextProps()[props.size].top;
|
|
4797
4797
|
});
|
|
4798
|
-
var Input$4 = newStyled.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteral__default['default'](["\n &:checked + span {\n background-color: ", ";\n }\n\n &:focus + span {\n box-shadow: 0 0 0.0625rem\n ", ";\n }\n\n &:checked + span:before {\n transform: translateX(90%);\n }\n\n &:checked:disabled + span {\n }\n\n &:checked:disabled + span:before {\n backround-color: red;\n }\n\n &:disabled + span {\n position: absolute;\n cursor:
|
|
4798
|
+
var Input$4 = newStyled.input(_templateObject2$m || (_templateObject2$m = _taggedTemplateLiteral__default['default'](["\n &:checked + span {\n background-color: ", ";\n }\n\n &:focus + span {\n box-shadow: 0 0 0.0625rem\n ", ";\n }\n\n &:checked + span:before {\n transform: translateX(90%);\n }\n\n &:checked:disabled + span {\n }\n\n &:checked:disabled + span:before {\n backround-color: red;\n }\n\n &:disabled + span {\n position: absolute;\n cursor: auto;\n top: ", ";\n left: ", ";\n right: 0;\n bottom: 0;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n height: ", ";\n width: ", ";\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n\n &:disabled + span:before {\n position: absolute;\n content: \"\";\n height: ", ";\n width: ", ";\n left: 0.0625rem;\n top: -0.125rem;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n\n &:checked:disabled + span:before {\n position: absolute;\n content: \"\";\n height: ", ";\n width: ", ";\n left: 0.0625rem;\n top: -0.125rem;\n background-color: ", ";\n -webkit-transition: 0.4s;\n transition: 0.4s;\n border: 0.0625rem solid ", ";\n border-radius: 0.125rem;\n }\n"])), function (props) {
|
|
4799
4799
|
return props.theme.palette[props.color].main;
|
|
4800
4800
|
}, function (props) {
|
|
4801
4801
|
return props.theme.palette[props.color].main;
|
|
@@ -4862,7 +4862,7 @@ var ToggleSwitch = function ToggleSwitch(props) {
|
|
|
4862
4862
|
|
|
4863
4863
|
function handleChange(e) {
|
|
4864
4864
|
if (preventDefault) e.preventDefault();
|
|
4865
|
-
onChange(id, !value);
|
|
4865
|
+
if (!disabled) onChange(id, !value);
|
|
4866
4866
|
}
|
|
4867
4867
|
|
|
4868
4868
|
var themeProps = {
|
|
@@ -6563,7 +6563,7 @@ var Table$2 = newStyled.div(_templateObject2$l || (_templateObject2$l = _taggedT
|
|
|
6563
6563
|
var Body$1 = newStyled.div(_templateObject3$f || (_templateObject3$f = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: column;\n &::-webkit-scrollbar {\n background: white;\n height: 0;\n width: 0;\n }\n overflow: auto;\n height: ", ";\n"])), function (props) {
|
|
6564
6564
|
return props.height && props.height !== "" ? props.height : "auto";
|
|
6565
6565
|
});
|
|
6566
|
-
var Row = newStyled.div(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n cursor:
|
|
6566
|
+
var Row = newStyled.div(_templateObject4$d || (_templateObject4$d = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n cursor: default;\n transition: all 250ms ease;\n background-color: white;\n\n &:hover {\n background-color: whitesmoke;\n }\n"])));
|
|
6567
6567
|
var HeaderRow = newStyled.div(_templateObject5$c || (_templateObject5$c = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n border-bottom: 1px solid #80808050;\n background-color: whitesmoke;\n border-radius: 3px 3px 0 0;\n position: sticky;\n"])));
|
|
6568
6568
|
var HeaderColumnCheck = newStyled.div(_templateObject6$a || (_templateObject6$a = _taggedTemplateLiteral__default['default'](["\n padding: 3px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-right: ", ";\n padding-left: 8px;\n border-right: 1px solid #80808050;\n"])), function (props) {
|
|
6569
6569
|
return props.check ? "8px" : "0";
|
|
@@ -6629,10 +6629,11 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6629
6629
|
});
|
|
6630
6630
|
}
|
|
6631
6631
|
|
|
6632
|
-
onChange(id, selectedItems);
|
|
6632
|
+
if (!disabled) onChange(id, selectedItems);
|
|
6633
6633
|
};
|
|
6634
6634
|
|
|
6635
|
-
var
|
|
6635
|
+
var pageDecimalCount = options.length / displayedItemsCount;
|
|
6636
|
+
var pageCount = pageDecimalCount % 1 !== 0 ? Math.floor(options.length / displayedItemsCount) + 1 : pageDecimalCount;
|
|
6636
6637
|
var label = options.length === selectedOptions.length ? localization.DeselectAll || "Deselect all" : localization.SelectAll || "Select all";
|
|
6637
6638
|
|
|
6638
6639
|
var _options = pagination ? options.slice((page - 1) * displayedItemsCount, page * displayedItemsCount) : options;
|
|
@@ -6648,7 +6649,7 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6648
6649
|
disabled: false,
|
|
6649
6650
|
checked: options.length > 0 && options.length === selectedOptions.length,
|
|
6650
6651
|
onChange: function onChange() {
|
|
6651
|
-
|
|
6652
|
+
if (!disabled) onSelectDeselectAll(options.length > 0 && options.length === selectedOptions.length ? false : true);
|
|
6652
6653
|
},
|
|
6653
6654
|
color: color,
|
|
6654
6655
|
size: size,
|
|
@@ -6656,10 +6657,10 @@ var CheckboxLookup = function CheckboxLookup(props) {
|
|
|
6656
6657
|
tooltip: label
|
|
6657
6658
|
}) : /*#__PURE__*/React__default['default'].createElement(ToggleSwitch, {
|
|
6658
6659
|
id: id,
|
|
6659
|
-
disabled:
|
|
6660
|
+
disabled: disabled,
|
|
6660
6661
|
checked: options.length === selectedOptions.length,
|
|
6661
6662
|
onChange: function onChange() {
|
|
6662
|
-
|
|
6663
|
+
if (!disabled) onSelectDeselectAll(options.length === selectedOptions.length ? false : true);
|
|
6663
6664
|
},
|
|
6664
6665
|
color: color,
|
|
6665
6666
|
size: size,
|
|
@@ -22981,7 +22982,7 @@ var DropdownLookup = function DropdownLookup(props) {
|
|
|
22981
22982
|
className: "fas fa-times fa-fw"
|
|
22982
22983
|
})), loading && /*#__PURE__*/React__default['default'].createElement(LoadingButtonContainer, themeProps, /*#__PURE__*/React__default['default'].createElement("i", {
|
|
22983
22984
|
className: "fas fa-redo fa-fw"
|
|
22984
|
-
})), !loading && /*#__PURE__*/React__default['default'].createElement(ButtonContainer$3, _extends__default['default']({}, themeProps, {
|
|
22985
|
+
})), !loading && disabled ? '' : /*#__PURE__*/React__default['default'].createElement(ButtonContainer$3, _extends__default['default']({}, themeProps, {
|
|
22985
22986
|
clickable: options == null || options.length === 0,
|
|
22986
22987
|
onClick: function onClick() {
|
|
22987
22988
|
if (options == null || options.length === 0) {
|
|
@@ -49033,19 +49034,240 @@ var TableSelectionType = {
|
|
|
49033
49034
|
MULTIPLE: "multiple"
|
|
49034
49035
|
};
|
|
49035
49036
|
|
|
49036
|
-
var _templateObject$i, _templateObject2$f, _templateObject3$c, _templateObject4$b, _templateObject5$a, _templateObject6$8;
|
|
49037
|
-
var Container$g = newStyled.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral__default['default'](["\n
|
|
49037
|
+
var _templateObject$i, _templateObject2$f, _templateObject3$c, _templateObject4$b, _templateObject5$a, _templateObject6$8, _templateObject7$5, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$4, _templateObject12$4;
|
|
49038
|
+
var Container$g = newStyled.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral__default['default'](["\n border-radius: 3px;\n font-size: ", ";\n font-family: ", ";\n"])), theme.typography.small.fontSize, theme.typography.fontFamily);
|
|
49039
|
+
var Wrapper$1 = newStyled.div(_templateObject2$f || (_templateObject2$f = _taggedTemplateLiteral__default['default'](["\n display: block;\n overflow-x: auto;\n white-space: nowrap;\n"])));
|
|
49040
|
+
var TableTable$1 = newStyled.table(_templateObject3$c || (_templateObject3$c = _taggedTemplateLiteral__default['default'](["\n border-collapse: collapse;\n width: 100%;\n"])));
|
|
49041
|
+
var TableHead$1 = newStyled.thead(_templateObject4$b || (_templateObject4$b = _taggedTemplateLiteral__default['default'](["\n color: ", ";\n border-top: 1px solid #80808025;\n"])), theme.palette.primary.textDark);
|
|
49042
|
+
var TableHeadRow$1 = newStyled.tr(_templateObject5$a || (_templateObject5$a = _taggedTemplateLiteral__default['default'](["\n border-bottom: 1px solid #80808025;\n"])));
|
|
49043
|
+
var TableHeadCell$1 = newStyled.th(_templateObject6$8 || (_templateObject6$8 = _taggedTemplateLiteral__default['default'](["\n text-align: left;\n transition: all 250ms ease;\n font-weight: 900;\n font-size: 13px;\n\n ", "\n\n &:first-of-type {\n border-radius: 3px 0 0 0;\n }\n\n &:last-of-type {\n border-radius: 0 3px 0 0;\n }\n\n &:hover {\n // background-color: ", ";\n background-color: whitesmoke;\n cursor: ", ";\n }\n"])), function (props) {
|
|
49044
|
+
return props.selectionCell === true ? "width: 27px; padding: 1px 1px 1px 6px;" : "padding: 5px 5px 5px 6px;";
|
|
49045
|
+
}, theme.palette.primary.light, function (props) {
|
|
49046
|
+
return props.hideOrdering ? "inherit" : "pointer";
|
|
49047
|
+
});
|
|
49048
|
+
var HeaderInnerCell$1 = newStyled.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n align-items: center;\n // justify-content: center;\n\n & i {\n color: black;\n }\n"])));
|
|
49049
|
+
var HeaderCellText$1 = newStyled.span(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteral__default['default'](["\n color: black;\n"])));
|
|
49050
|
+
var HeaderCellIcon$1 = newStyled.span(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteral__default['default'](["\n color: black;\n margin-left: auto;\n\n & i {\n color: ", ";\n }\n"])), function (props) {
|
|
49051
|
+
return props.sort ? "transparent" : "black";
|
|
49052
|
+
});
|
|
49053
|
+
var TableBody$1 = newStyled.tbody(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteral__default['default']([""])));
|
|
49054
|
+
var TableBodyRow$1 = newStyled.tr(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteral__default['default'](["\n border-bottom: 1px solid transparent;\n border-top: 1px solid transparent;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
49055
|
+
if (props.selectedRow !== true) return "\n &:hover {\n & > td {\n // border-bottom: 1px solid ".concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n background-color: whitesmoke;\n }\n \n cursor: pointer;\n }");else return "";
|
|
49056
|
+
}, function (props) {
|
|
49057
|
+
if (props.selectedRow === true) return "\n background-color: ".concat(theme.palette.primary.lighter, ";\n cursor: pointer;\n \n & > td {\n // border-bottom: 1px solid ").concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n }\n ");else return "";
|
|
49058
|
+
});
|
|
49059
|
+
var TableBodyCell$1 = newStyled.td(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteral__default['default'](["\n padding: ", ";\n"])), function (props) {
|
|
49060
|
+
return props.selectionCell === true ? "1px 1px 1px 6px" : "5px 5px 5px 10px";
|
|
49061
|
+
});
|
|
49062
|
+
|
|
49063
|
+
var TableView = function TableView(props) {
|
|
49064
|
+
//======== RENDER ========
|
|
49065
|
+
var _props$Config = props.Config,
|
|
49066
|
+
Columns = _props$Config.Columns,
|
|
49067
|
+
Data = _props$Config.Data,
|
|
49068
|
+
IsLoading = _props$Config.IsLoading,
|
|
49069
|
+
ChangeToFormView = _props$Config.ChangeToFormView,
|
|
49070
|
+
SelectedData = _props$Config.SelectedData,
|
|
49071
|
+
SelectionIndicator = _props$Config.SelectionIndicator,
|
|
49072
|
+
SelectedEntirePage = _props$Config.SelectedEntirePage,
|
|
49073
|
+
EnableSelection = _props$Config.EnableSelection,
|
|
49074
|
+
EnableFormView = _props$Config.EnableFormView,
|
|
49075
|
+
SelectionType = _props$Config.SelectionType,
|
|
49076
|
+
_props$Config$OnSelec = _props$Config.OnSelection,
|
|
49077
|
+
OnSelection = _props$Config$OnSelec === void 0 ? function () {} : _props$Config$OnSelec,
|
|
49078
|
+
_props$Config$OnSelec2 = _props$Config.OnSelectAll,
|
|
49079
|
+
OnSelectAll = _props$Config$OnSelec2 === void 0 ? function () {} : _props$Config$OnSelec2;
|
|
49080
|
+
_props$Config.EnablePagination;
|
|
49081
|
+
var EnableOrdering = _props$Config.EnableOrdering,
|
|
49082
|
+
Accessor = _props$Config.Accessor,
|
|
49083
|
+
Ascending = _props$Config.Ascending,
|
|
49084
|
+
Descending = _props$Config.Descending,
|
|
49085
|
+
_props$Config$OnHeade = _props$Config.OnHeaderClick,
|
|
49086
|
+
OnHeaderClick = _props$Config$OnHeade === void 0 ? function () {} : _props$Config$OnHeade,
|
|
49087
|
+
ReadOnly = _props$Config.ReadOnly,
|
|
49088
|
+
_props$Config$IsLooku = _props$Config.IsLookup,
|
|
49089
|
+
IsLookup = _props$Config$IsLooku === void 0 ? false : _props$Config$IsLooku,
|
|
49090
|
+
_props$Config$LookupT = _props$Config.LookupTakeItem,
|
|
49091
|
+
LookupTakeItem = _props$Config$LookupT === void 0 ? function () {} : _props$Config$LookupT;
|
|
49092
|
+
var _props$Localization = props.Localization,
|
|
49093
|
+
Localization = _props$Localization === void 0 ? {} : _props$Localization;
|
|
49094
|
+
props.Export;
|
|
49095
|
+
props.Icons;
|
|
49096
|
+
//======== FUNCTIONS ========
|
|
49097
|
+
|
|
49098
|
+
function isFunction(functionToCheck) {
|
|
49099
|
+
return functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
|
|
49100
|
+
}
|
|
49101
|
+
|
|
49102
|
+
var handleOnSelection = function handleOnSelection(rowData, val) {
|
|
49103
|
+
OnSelection(rowData, val, SelectionType);
|
|
49104
|
+
};
|
|
49105
|
+
|
|
49106
|
+
var handleSelectAll = function handleSelectAll(val) {
|
|
49107
|
+
OnSelectAll(val);
|
|
49108
|
+
}; //======== RENDER ========
|
|
49109
|
+
|
|
49110
|
+
|
|
49111
|
+
var isItemInArray = function isItemInArray(item, array, byProp) {
|
|
49112
|
+
if (item[byProp] !== undefined) return !lodash.exports.isUndefined(array.find(function (x) {
|
|
49113
|
+
return x[byProp] === item[byProp];
|
|
49114
|
+
}));
|
|
49115
|
+
return array.indexOf(item) > -1;
|
|
49116
|
+
};
|
|
49117
|
+
|
|
49118
|
+
var renderBody = function renderBody() {
|
|
49119
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, Data.map(function (dataItem, i) {
|
|
49120
|
+
return renderBodyRow(dataItem, i);
|
|
49121
|
+
}));
|
|
49122
|
+
};
|
|
49123
|
+
|
|
49124
|
+
var renderBodyRow = function renderBodyRow(dataItem, i) {
|
|
49125
|
+
Columns.find(function (x) {
|
|
49126
|
+
return x.nested;
|
|
49127
|
+
});
|
|
49128
|
+
var rowSelected = isItemInArray(dataItem, SelectedData, SelectionIndicator);
|
|
49129
|
+
return /*#__PURE__*/React__default['default'].createElement(TableBodyRow$1, {
|
|
49130
|
+
selectedRow: rowSelected,
|
|
49131
|
+
key: i
|
|
49132
|
+
}, renderSelectionCell(dataItem, rowSelected, i), Columns.filter(function (x) {
|
|
49133
|
+
return x.hide !== true;
|
|
49134
|
+
}).map(function (col, j) {
|
|
49135
|
+
return renderBodyCell(dataItem, col, i, j);
|
|
49136
|
+
}));
|
|
49137
|
+
};
|
|
49138
|
+
|
|
49139
|
+
var renderBodyCell = function renderBodyCell(dataItem, def, rowIndex, cellIndex) {
|
|
49140
|
+
var tabIndex = rowIndex * Columns.length + cellIndex + 50;
|
|
49141
|
+
|
|
49142
|
+
var onClick = function onClick() {
|
|
49143
|
+
ChangeToFormView(dataItem, rowIndex);
|
|
49144
|
+
};
|
|
49145
|
+
|
|
49146
|
+
if (!EnableFormView) onClick = function onClick() {};
|
|
49147
|
+
if (!EnableSelection || ReadOnly) onClick = function onClick() {};
|
|
49148
|
+
|
|
49149
|
+
if (IsLookup) {
|
|
49150
|
+
onClick = function onClick() {
|
|
49151
|
+
if (!IsLoading) {
|
|
49152
|
+
LookupTakeItem(dataItem);
|
|
49153
|
+
}
|
|
49154
|
+
};
|
|
49155
|
+
}
|
|
49156
|
+
|
|
49157
|
+
var cellData = def.isObject === true ? dataItem[def.accessor][def.objectAccessor] : dataItem[def.accessor];
|
|
49158
|
+
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49159
|
+
key: tabIndex,
|
|
49160
|
+
onClick: onClick
|
|
49161
|
+
}, isFunction(def.specialRender) ? def.specialRender(dataItem, function () {
|
|
49162
|
+
ChangeToFormView(dataItem, rowIndex);
|
|
49163
|
+
}) : cellData);
|
|
49164
|
+
};
|
|
49165
|
+
|
|
49166
|
+
var renderSelectionCell = function renderSelectionCell(dataItem, selected, rowIndex) {
|
|
49167
|
+
if (IsLookup) {
|
|
49168
|
+
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49169
|
+
selectionCell: true,
|
|
49170
|
+
key: -1
|
|
49171
|
+
}, /*#__PURE__*/React__default['default'].createElement(Button$1, {
|
|
49172
|
+
inverted: true,
|
|
49173
|
+
onClick: function onClick() {
|
|
49174
|
+
if (!IsLoading) {
|
|
49175
|
+
LookupTakeItem(dataItem);
|
|
49176
|
+
}
|
|
49177
|
+
},
|
|
49178
|
+
icon: "arrow-right"
|
|
49179
|
+
}));
|
|
49180
|
+
}
|
|
49181
|
+
|
|
49182
|
+
if (!EnableSelection || ReadOnly || IsLookup) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
49183
|
+
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49184
|
+
selectionCell: true,
|
|
49185
|
+
key: -1
|
|
49186
|
+
}, /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
49187
|
+
checked: selected,
|
|
49188
|
+
onChange: function onChange(e, val) {
|
|
49189
|
+
return handleOnSelection(dataItem, val);
|
|
49190
|
+
},
|
|
49191
|
+
id: rowIndex
|
|
49192
|
+
}));
|
|
49193
|
+
};
|
|
49194
|
+
|
|
49195
|
+
var renderHeaderCell = function renderHeaderCell(def, i) {
|
|
49196
|
+
var headerClick = function headerClick() {};
|
|
49197
|
+
|
|
49198
|
+
var hideOrdering = !EnableOrdering || (def.sortable === undefined ? false : def.sortable === false);
|
|
49199
|
+
var isAccessor = def.accessor === Accessor;
|
|
49200
|
+
var orderingIconClass; //-------------------------------------------------------------------
|
|
49201
|
+
|
|
49202
|
+
if (isAccessor && Ascending) orderingIconClass = "long-arrow-alt-up";
|
|
49203
|
+
if (isAccessor && Descending) orderingIconClass = "long-arrow-alt-down";
|
|
49204
|
+
if (isAccessor && !Ascending && !Descending) orderingIconClass = "sort";
|
|
49205
|
+
if (!isAccessor) orderingIconClass = "sort"; //-------------------------------------------------------------------
|
|
49206
|
+
|
|
49207
|
+
if (!isAccessor) headerClick = function headerClick() {
|
|
49208
|
+
return OnHeaderClick(def.sourceEntityName, def.accessor, true, false);
|
|
49209
|
+
};
|
|
49210
|
+
if (isAccessor && Ascending) headerClick = function headerClick() {
|
|
49211
|
+
return OnHeaderClick(def.sourceEntityName, def.accessor, false, true);
|
|
49212
|
+
};
|
|
49213
|
+
if (isAccessor && Descending) headerClick = function headerClick() {
|
|
49214
|
+
return OnHeaderClick("", "", false, true);
|
|
49215
|
+
}; //-------------------------------------------------------------------
|
|
49216
|
+
|
|
49217
|
+
return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49218
|
+
hideOrdering: hideOrdering,
|
|
49219
|
+
key: i,
|
|
49220
|
+
onClick: IsLoading || hideOrdering ? function () {} : headerClick
|
|
49221
|
+
}, /*#__PURE__*/React__default['default'].createElement(HeaderInnerCell$1, null, /*#__PURE__*/React__default['default'].createElement(HeaderCellText$1, null, def.displayName), !hideOrdering && /*#__PURE__*/React__default['default'].createElement(HeaderCellIcon$1, {
|
|
49222
|
+
sort: orderingIconClass === "sort"
|
|
49223
|
+
}, /*#__PURE__*/React__default['default'].createElement(Icon$1, {
|
|
49224
|
+
color: "white",
|
|
49225
|
+
icon: orderingIconClass
|
|
49226
|
+
}))));
|
|
49227
|
+
};
|
|
49228
|
+
|
|
49229
|
+
var renderSelectAllHeaderCell = function renderSelectAllHeaderCell() {
|
|
49230
|
+
if (IsLookup) return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49231
|
+
selectionCell: true,
|
|
49232
|
+
key: -1
|
|
49233
|
+
});
|
|
49234
|
+
if (!EnableSelection || ReadOnly || IsLookup && SelectionType === TableSelectionType.SINGLE) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
49235
|
+
if (SelectedEntirePage && Localization.DeselectAll) ;
|
|
49236
|
+
if (!SelectedEntirePage && Localization.SelectAll) ;
|
|
49237
|
+
return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49238
|
+
selectionCell: true,
|
|
49239
|
+
key: -1
|
|
49240
|
+
}, SelectionType === TableSelectionType.MULTIPLE && /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
49241
|
+
checked: SelectedEntirePage,
|
|
49242
|
+
onChange: function onChange() {
|
|
49243
|
+
return handleSelectAll(!SelectedEntirePage);
|
|
49244
|
+
},
|
|
49245
|
+
id: "SelectedEntirePage"
|
|
49246
|
+
}));
|
|
49247
|
+
};
|
|
49248
|
+
|
|
49249
|
+
return /*#__PURE__*/React__default['default'].createElement(Container$g, null, /*#__PURE__*/React__default['default'].createElement(Wrapper$1, null, /*#__PURE__*/React__default['default'].createElement(TableTable$1, {
|
|
49250
|
+
cellSpacing: 0
|
|
49251
|
+
}, /*#__PURE__*/React__default['default'].createElement(TableHead$1, null, /*#__PURE__*/React__default['default'].createElement(TableHeadRow$1, null, renderSelectAllHeaderCell(), Columns.filter(function (x) {
|
|
49252
|
+
return x.hide !== true;
|
|
49253
|
+
}).map(function (col, i) {
|
|
49254
|
+
return renderHeaderCell(col, i);
|
|
49255
|
+
}))), /*#__PURE__*/React__default['default'].createElement(TableBody$1, null, renderBody()))));
|
|
49256
|
+
};
|
|
49257
|
+
|
|
49258
|
+
var _templateObject$h, _templateObject2$e, _templateObject3$b, _templateObject4$a, _templateObject5$9, _templateObject6$7;
|
|
49259
|
+
var Container$f = newStyled.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n justify-content: left;\n align-items: center;\n border-radius: 3px;\n padding: 4px;\n font-size: ", ";\n font-family: ", ";\n"])), function (props) {
|
|
49038
49260
|
return props.theme.typography.small.fontSize;
|
|
49039
49261
|
}, function (props) {
|
|
49040
49262
|
return props.theme.typography.fontFamily;
|
|
49041
49263
|
});
|
|
49042
|
-
var Item$2 = newStyled.div(_templateObject2$
|
|
49264
|
+
var Item$2 = newStyled.div(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteral__default['default'](["\n padding-left: ", ";\n display: flex;\n align-items: center;\n"])), function (props) {
|
|
49043
49265
|
return props.first ? "0" : "6px";
|
|
49044
49266
|
});
|
|
49045
|
-
var ExportItem = newStyled.div(_templateObject3$
|
|
49046
|
-
var ItemText = newStyled.div(_templateObject4$
|
|
49047
|
-
var ItemCurrentPage = newStyled.div(_templateObject5$
|
|
49048
|
-
var ItemDropdown = newStyled.div(_templateObject6$
|
|
49267
|
+
var ExportItem = newStyled.div(_templateObject3$b || (_templateObject3$b = _taggedTemplateLiteral__default['default'](["\n padding-left: 6px;\n display: flex;\n align-items: center;\n margin-left: auto;\n"])));
|
|
49268
|
+
var ItemText = newStyled.div(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteral__default['default'](["\n padding-left: 12px;\n display: flex;\n align-items: center;\n"])));
|
|
49269
|
+
var ItemCurrentPage = newStyled.div(_templateObject5$9 || (_templateObject5$9 = _taggedTemplateLiteral__default['default'](["\n padding-left: 6px;\n display: flex;\n align-items: center;\n"])));
|
|
49270
|
+
var ItemDropdown = newStyled.div(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteral__default['default'](["\n padding-left: 14px;\n display: flex;\n align-items: center;\n"])));
|
|
49049
49271
|
|
|
49050
49272
|
var Pagination = function Pagination(props) {
|
|
49051
49273
|
//======================== PROPS ============================================
|
|
@@ -49213,7 +49435,7 @@ var Pagination = function Pagination(props) {
|
|
|
49213
49435
|
})));
|
|
49214
49436
|
};
|
|
49215
49437
|
|
|
49216
|
-
return /*#__PURE__*/React__default['default'].createElement(Container$
|
|
49438
|
+
return /*#__PURE__*/React__default['default'].createElement(Container$f, themeProps, renderFirst(), renderPrevious(), renderCurrentPage(), renderNext(), renderLast(), renderPageSize(), renderRowInformation(), renderExportButtons());
|
|
49217
49439
|
};
|
|
49218
49440
|
|
|
49219
49441
|
Pagination.defaultProps = {
|
|
@@ -49278,227 +49500,6 @@ Pagination.propTypes = {
|
|
|
49278
49500
|
color: PropTypes__default['default'].oneOf(["primary", "secondary", "success", "error", "warning", "gray"])
|
|
49279
49501
|
};
|
|
49280
49502
|
|
|
49281
|
-
var _templateObject$h, _templateObject2$e, _templateObject3$b, _templateObject4$a, _templateObject5$9, _templateObject6$7, _templateObject7$5, _templateObject8$5, _templateObject9$5, _templateObject10$5, _templateObject11$4, _templateObject12$4;
|
|
49282
|
-
var Container$f = newStyled.div(_templateObject$h || (_templateObject$h = _taggedTemplateLiteral__default['default'](["\n border-radius: 3px;\n font-size: ", ";\n font-family: ", ";\n"])), theme.typography.small.fontSize, theme.typography.fontFamily);
|
|
49283
|
-
var Wrapper$1 = newStyled.div(_templateObject2$e || (_templateObject2$e = _taggedTemplateLiteral__default['default'](["\n display: block;\n overflow-x: auto;\n white-space: nowrap;\n"])));
|
|
49284
|
-
var TableTable$1 = newStyled.table(_templateObject3$b || (_templateObject3$b = _taggedTemplateLiteral__default['default'](["\n border-collapse: collapse;\n width: 100%;\n"])));
|
|
49285
|
-
var TableHead$1 = newStyled.thead(_templateObject4$a || (_templateObject4$a = _taggedTemplateLiteral__default['default'](["\n color: ", ";\n border-top: 1px solid #80808025;\n"])), theme.palette.primary.textDark);
|
|
49286
|
-
var TableHeadRow$1 = newStyled.tr(_templateObject5$9 || (_templateObject5$9 = _taggedTemplateLiteral__default['default'](["\n border-bottom: 1px solid #80808025;\n"])));
|
|
49287
|
-
var TableHeadCell$1 = newStyled.th(_templateObject6$7 || (_templateObject6$7 = _taggedTemplateLiteral__default['default'](["\n text-align: left;\n transition: all 250ms ease;\n font-weight: 900;\n font-size: 13px;\n\n ", "\n\n &:first-of-type {\n border-radius: 3px 0 0 0;\n }\n\n &:last-of-type {\n border-radius: 0 3px 0 0;\n }\n\n &:hover {\n // background-color: ", ";\n background-color: whitesmoke;\n cursor: ", ";\n }\n"])), function (props) {
|
|
49288
|
-
return props.selectionCell === true ? "width: 27px; padding: 1px 1px 1px 6px;" : "padding: 5px 5px 5px 6px;";
|
|
49289
|
-
}, theme.palette.primary.light, function (props) {
|
|
49290
|
-
return props.hideOrdering ? "inherit" : "pointer";
|
|
49291
|
-
});
|
|
49292
|
-
var HeaderInnerCell$1 = newStyled.div(_templateObject7$5 || (_templateObject7$5 = _taggedTemplateLiteral__default['default'](["\n display: flex;\n flex-direction: row;\n align-items: center;\n // justify-content: center;\n\n & i {\n color: black;\n }\n"])));
|
|
49293
|
-
var HeaderCellText$1 = newStyled.span(_templateObject8$5 || (_templateObject8$5 = _taggedTemplateLiteral__default['default'](["\n color: black;\n"])));
|
|
49294
|
-
var HeaderCellIcon$1 = newStyled.span(_templateObject9$5 || (_templateObject9$5 = _taggedTemplateLiteral__default['default'](["\n color: black;\n margin-left: auto;\n\n & i {\n color: ", ";\n }\n"])), function (props) {
|
|
49295
|
-
return props.sort ? "transparent" : "black";
|
|
49296
|
-
});
|
|
49297
|
-
var TableBody$1 = newStyled.tbody(_templateObject10$5 || (_templateObject10$5 = _taggedTemplateLiteral__default['default']([""])));
|
|
49298
|
-
var TableBodyRow$1 = newStyled.tr(_templateObject11$4 || (_templateObject11$4 = _taggedTemplateLiteral__default['default'](["\n border-bottom: 1px solid transparent;\n border-top: 1px solid transparent;\n\n ", "\n\n ", "\n"])), function (props) {
|
|
49299
|
-
if (props.selectedRow !== true) return "\n &:hover {\n & > td {\n // border-bottom: 1px solid ".concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n background-color: whitesmoke;\n }\n \n cursor: pointer;\n }");else return "";
|
|
49300
|
-
}, function (props) {
|
|
49301
|
-
if (props.selectedRow === true) return "\n background-color: ".concat(theme.palette.primary.lighter, ";\n cursor: pointer;\n \n & > td {\n // border-bottom: 1px solid ").concat(theme.palette.primary.light, ";\n // border-top: 1px solid ").concat(theme.palette.primary.light, ";\n }\n ");else return "";
|
|
49302
|
-
});
|
|
49303
|
-
var TableBodyCell$1 = newStyled.td(_templateObject12$4 || (_templateObject12$4 = _taggedTemplateLiteral__default['default'](["\n padding: ", ";\n"])), function (props) {
|
|
49304
|
-
return props.selectionCell === true ? "1px 1px 1px 6px" : "5px 5px 5px 10px";
|
|
49305
|
-
});
|
|
49306
|
-
|
|
49307
|
-
var TableView = function TableView(props) {
|
|
49308
|
-
//======== RENDER ========
|
|
49309
|
-
var _props$Config = props.Config,
|
|
49310
|
-
Columns = _props$Config.Columns,
|
|
49311
|
-
Data = _props$Config.Data,
|
|
49312
|
-
IsLoading = _props$Config.IsLoading,
|
|
49313
|
-
ChangeToFormView = _props$Config.ChangeToFormView,
|
|
49314
|
-
SelectedData = _props$Config.SelectedData,
|
|
49315
|
-
SelectionIndicator = _props$Config.SelectionIndicator,
|
|
49316
|
-
SelectedEntirePage = _props$Config.SelectedEntirePage,
|
|
49317
|
-
EnableSelection = _props$Config.EnableSelection,
|
|
49318
|
-
EnableFormView = _props$Config.EnableFormView,
|
|
49319
|
-
SelectionType = _props$Config.SelectionType,
|
|
49320
|
-
_props$Config$OnSelec = _props$Config.OnSelection,
|
|
49321
|
-
OnSelection = _props$Config$OnSelec === void 0 ? function () {} : _props$Config$OnSelec,
|
|
49322
|
-
_props$Config$OnSelec2 = _props$Config.OnSelectAll,
|
|
49323
|
-
OnSelectAll = _props$Config$OnSelec2 === void 0 ? function () {} : _props$Config$OnSelec2;
|
|
49324
|
-
_props$Config.EnablePagination;
|
|
49325
|
-
var EnableOrdering = _props$Config.EnableOrdering,
|
|
49326
|
-
Accessor = _props$Config.Accessor,
|
|
49327
|
-
Ascending = _props$Config.Ascending,
|
|
49328
|
-
Descending = _props$Config.Descending,
|
|
49329
|
-
_props$Config$OnHeade = _props$Config.OnHeaderClick,
|
|
49330
|
-
OnHeaderClick = _props$Config$OnHeade === void 0 ? function () {} : _props$Config$OnHeade,
|
|
49331
|
-
ReadOnly = _props$Config.ReadOnly,
|
|
49332
|
-
_props$Config$IsLooku = _props$Config.IsLookup,
|
|
49333
|
-
IsLookup = _props$Config$IsLooku === void 0 ? false : _props$Config$IsLooku,
|
|
49334
|
-
_props$Config$LookupT = _props$Config.LookupTakeItem,
|
|
49335
|
-
LookupTakeItem = _props$Config$LookupT === void 0 ? function () {} : _props$Config$LookupT;
|
|
49336
|
-
var _props$Localization = props.Localization,
|
|
49337
|
-
Localization = _props$Localization === void 0 ? {} : _props$Localization;
|
|
49338
|
-
props.Export;
|
|
49339
|
-
props.Icons;
|
|
49340
|
-
//======== FUNCTIONS ========
|
|
49341
|
-
|
|
49342
|
-
function isFunction(functionToCheck) {
|
|
49343
|
-
return functionToCheck && {}.toString.call(functionToCheck) === "[object Function]";
|
|
49344
|
-
}
|
|
49345
|
-
|
|
49346
|
-
var handleOnSelection = function handleOnSelection(rowData, val) {
|
|
49347
|
-
OnSelection(rowData, val, SelectionType);
|
|
49348
|
-
};
|
|
49349
|
-
|
|
49350
|
-
var handleSelectAll = function handleSelectAll(val) {
|
|
49351
|
-
OnSelectAll(val);
|
|
49352
|
-
}; //======== RENDER ========
|
|
49353
|
-
|
|
49354
|
-
|
|
49355
|
-
var isItemInArray = function isItemInArray(item, array, byProp) {
|
|
49356
|
-
if (item[byProp] !== undefined) return !lodash.exports.isUndefined(array.find(function (x) {
|
|
49357
|
-
return x[byProp] === item[byProp];
|
|
49358
|
-
}));
|
|
49359
|
-
return array.indexOf(item) > -1;
|
|
49360
|
-
};
|
|
49361
|
-
|
|
49362
|
-
var renderBody = function renderBody() {
|
|
49363
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, Data.map(function (dataItem, i) {
|
|
49364
|
-
return renderBodyRow(dataItem, i);
|
|
49365
|
-
}));
|
|
49366
|
-
};
|
|
49367
|
-
|
|
49368
|
-
var renderBodyRow = function renderBodyRow(dataItem, i) {
|
|
49369
|
-
Columns.find(function (x) {
|
|
49370
|
-
return x.nested;
|
|
49371
|
-
});
|
|
49372
|
-
var rowSelected = isItemInArray(dataItem, SelectedData, SelectionIndicator);
|
|
49373
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(TableBodyRow$1, {
|
|
49374
|
-
selectedRow: rowSelected,
|
|
49375
|
-
key: i
|
|
49376
|
-
}, renderSelectionCell(dataItem, rowSelected, i), Columns.filter(function (x) {
|
|
49377
|
-
return x.hide !== true;
|
|
49378
|
-
}).map(function (col, j) {
|
|
49379
|
-
return renderBodyCell(dataItem, col, i, j);
|
|
49380
|
-
})));
|
|
49381
|
-
};
|
|
49382
|
-
|
|
49383
|
-
var renderBodyCell = function renderBodyCell(dataItem, def, rowIndex, cellIndex) {
|
|
49384
|
-
var tabIndex = rowIndex * Columns.length + cellIndex + 50;
|
|
49385
|
-
|
|
49386
|
-
var onClick = function onClick() {
|
|
49387
|
-
ChangeToFormView(dataItem);
|
|
49388
|
-
};
|
|
49389
|
-
|
|
49390
|
-
if (!EnableFormView) onClick = function onClick() {};
|
|
49391
|
-
if (!EnableSelection || ReadOnly) onClick = function onClick() {};
|
|
49392
|
-
|
|
49393
|
-
if (IsLookup) {
|
|
49394
|
-
onClick = function onClick() {
|
|
49395
|
-
if (!IsLoading) {
|
|
49396
|
-
LookupTakeItem(dataItem);
|
|
49397
|
-
}
|
|
49398
|
-
};
|
|
49399
|
-
}
|
|
49400
|
-
|
|
49401
|
-
var cellData = def.isObject === true ? dataItem[def.accessor][def.objectAccessor] : dataItem[def.accessor];
|
|
49402
|
-
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49403
|
-
key: tabIndex,
|
|
49404
|
-
onClick: onClick
|
|
49405
|
-
}, isFunction(def.specialRender) ? def.specialRender(dataItem, function () {
|
|
49406
|
-
ChangeToFormView(dataItem);
|
|
49407
|
-
}) : cellData);
|
|
49408
|
-
};
|
|
49409
|
-
|
|
49410
|
-
var renderSelectionCell = function renderSelectionCell(dataItem, selected, rowIndex) {
|
|
49411
|
-
if (IsLookup) {
|
|
49412
|
-
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49413
|
-
selectionCell: true,
|
|
49414
|
-
key: -1
|
|
49415
|
-
}, /*#__PURE__*/React__default['default'].createElement(Button$1, {
|
|
49416
|
-
inverted: true,
|
|
49417
|
-
onClick: function onClick() {
|
|
49418
|
-
if (!IsLoading) {
|
|
49419
|
-
LookupTakeItem(dataItem);
|
|
49420
|
-
}
|
|
49421
|
-
},
|
|
49422
|
-
icon: "arrow-right"
|
|
49423
|
-
}));
|
|
49424
|
-
}
|
|
49425
|
-
|
|
49426
|
-
if (!EnableSelection || ReadOnly || IsLookup) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
49427
|
-
return /*#__PURE__*/React__default['default'].createElement(TableBodyCell$1, {
|
|
49428
|
-
selectionCell: true,
|
|
49429
|
-
key: -1
|
|
49430
|
-
}, /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
49431
|
-
checked: selected,
|
|
49432
|
-
onChange: function onChange(e, val) {
|
|
49433
|
-
return handleOnSelection(dataItem, val);
|
|
49434
|
-
},
|
|
49435
|
-
id: rowIndex
|
|
49436
|
-
}));
|
|
49437
|
-
};
|
|
49438
|
-
|
|
49439
|
-
var renderHeaderCell = function renderHeaderCell(def, i) {
|
|
49440
|
-
var headerClick = function headerClick() {};
|
|
49441
|
-
|
|
49442
|
-
var hideOrdering = !EnableOrdering || (def.sortable === undefined ? false : def.sortable === false);
|
|
49443
|
-
var isAccessor = def.accessor === Accessor;
|
|
49444
|
-
var orderingIconClass; //-------------------------------------------------------------------
|
|
49445
|
-
|
|
49446
|
-
if (isAccessor && Ascending) orderingIconClass = "long-arrow-alt-up";
|
|
49447
|
-
if (isAccessor && Descending) orderingIconClass = "long-arrow-alt-down";
|
|
49448
|
-
if (isAccessor && !Ascending && !Descending) orderingIconClass = "sort";
|
|
49449
|
-
if (!isAccessor) orderingIconClass = "sort"; //-------------------------------------------------------------------
|
|
49450
|
-
|
|
49451
|
-
if (!isAccessor) headerClick = function headerClick() {
|
|
49452
|
-
return OnHeaderClick(def.sourceEntityName, def.accessor, true, false);
|
|
49453
|
-
};
|
|
49454
|
-
if (isAccessor && Ascending) headerClick = function headerClick() {
|
|
49455
|
-
return OnHeaderClick(def.sourceEntityName, def.accessor, false, true);
|
|
49456
|
-
};
|
|
49457
|
-
if (isAccessor && Descending) headerClick = function headerClick() {
|
|
49458
|
-
return OnHeaderClick("", "", false, true);
|
|
49459
|
-
}; //-------------------------------------------------------------------
|
|
49460
|
-
|
|
49461
|
-
return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49462
|
-
hideOrdering: hideOrdering,
|
|
49463
|
-
key: i,
|
|
49464
|
-
onClick: IsLoading || hideOrdering ? function () {} : headerClick
|
|
49465
|
-
}, /*#__PURE__*/React__default['default'].createElement(HeaderInnerCell$1, null, /*#__PURE__*/React__default['default'].createElement(HeaderCellText$1, null, def.displayName), !hideOrdering && /*#__PURE__*/React__default['default'].createElement(HeaderCellIcon$1, {
|
|
49466
|
-
sort: orderingIconClass === "sort"
|
|
49467
|
-
}, /*#__PURE__*/React__default['default'].createElement(Icon$1, {
|
|
49468
|
-
color: "white",
|
|
49469
|
-
icon: orderingIconClass
|
|
49470
|
-
}))));
|
|
49471
|
-
};
|
|
49472
|
-
|
|
49473
|
-
var renderSelectAllHeaderCell = function renderSelectAllHeaderCell() {
|
|
49474
|
-
if (IsLookup) return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49475
|
-
selectionCell: true,
|
|
49476
|
-
key: -1
|
|
49477
|
-
});
|
|
49478
|
-
if (!EnableSelection || ReadOnly || IsLookup && SelectionType === TableSelectionType.SINGLE) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
49479
|
-
if (SelectedEntirePage && Localization.DeselectAll) ;
|
|
49480
|
-
if (!SelectedEntirePage && Localization.SelectAll) ;
|
|
49481
|
-
return /*#__PURE__*/React__default['default'].createElement(TableHeadCell$1, {
|
|
49482
|
-
selectionCell: true,
|
|
49483
|
-
key: -1
|
|
49484
|
-
}, SelectionType === TableSelectionType.MULTIPLE && /*#__PURE__*/React__default['default'].createElement(CheckBox, {
|
|
49485
|
-
checked: SelectedEntirePage,
|
|
49486
|
-
onChange: function onChange() {
|
|
49487
|
-
return handleSelectAll(!SelectedEntirePage);
|
|
49488
|
-
},
|
|
49489
|
-
id: "SelectedEntirePage"
|
|
49490
|
-
}));
|
|
49491
|
-
};
|
|
49492
|
-
|
|
49493
|
-
return /*#__PURE__*/React__default['default'].createElement(Container$f, null, /*#__PURE__*/React__default['default'].createElement(Wrapper$1, null, /*#__PURE__*/React__default['default'].createElement(TableTable$1, {
|
|
49494
|
-
cellSpacing: 0
|
|
49495
|
-
}, /*#__PURE__*/React__default['default'].createElement(TableHead$1, null, /*#__PURE__*/React__default['default'].createElement(TableHeadRow$1, null, renderSelectAllHeaderCell(), Columns.filter(function (x) {
|
|
49496
|
-
return x.hide !== true;
|
|
49497
|
-
}).map(function (col, i) {
|
|
49498
|
-
return renderHeaderCell(col, i);
|
|
49499
|
-
}))), /*#__PURE__*/React__default['default'].createElement(TableBody$1, null, renderBody()))));
|
|
49500
|
-
};
|
|
49501
|
-
|
|
49502
49503
|
var _templateObject$g, _templateObject2$d;
|
|
49503
49504
|
|
|
49504
49505
|
var heightBySize$6 = function heightBySize(size) {
|