@pdg/react-table 1.0.71 → 1.0.73
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/index.js
CHANGED
|
@@ -2787,6 +2787,30 @@ function typographyColorToSxColor(color) {
|
|
|
2787
2787
|
}
|
|
2788
2788
|
}
|
|
2789
2789
|
return tmp;
|
|
2790
|
+
}/********************************************************************************************************************
|
|
2791
|
+
* 사업자등록번호 하이픈 추가
|
|
2792
|
+
* @param companyNo 사업자등록번호
|
|
2793
|
+
* @returns 하이픈이 추가된 사업자등록번호
|
|
2794
|
+
* ******************************************************************************************************************/
|
|
2795
|
+
function companyNoAutoDash(companyNo) {
|
|
2796
|
+
var str = companyNo.replace(/[^0-9]/g, '');
|
|
2797
|
+
var values = [str.slice(0, 3)];
|
|
2798
|
+
if (str.length > 3)
|
|
2799
|
+
values.push(str.slice(3, 5));
|
|
2800
|
+
if (str.length > 5)
|
|
2801
|
+
values.push(str.slice(5));
|
|
2802
|
+
return values.join('-');
|
|
2803
|
+
}/********************************************************************************************************************
|
|
2804
|
+
* 주민등록번호에 하이픈 추가하는 함수
|
|
2805
|
+
* @param personalNo 주민등록번호
|
|
2806
|
+
* @returns 하이픈 추가된 주민등록번호
|
|
2807
|
+
* ******************************************************************************************************************/
|
|
2808
|
+
function personalNoAutoDash(personalNo) {
|
|
2809
|
+
var str = personalNo.replace(/[^0-9]/g, '');
|
|
2810
|
+
var values = [str.slice(0, 6)];
|
|
2811
|
+
if (str.length > 6)
|
|
2812
|
+
values.push(str.slice(6));
|
|
2813
|
+
return values.join('-');
|
|
2790
2814
|
}var TableContextDefaultValue = {
|
|
2791
2815
|
menuOpen: false,
|
|
2792
2816
|
openMenuId: undefined,
|
|
@@ -3037,6 +3061,16 @@ var TableBodyCell = function (_a) {
|
|
|
3037
3061
|
data = getTelAutoDash(data);
|
|
3038
3062
|
}
|
|
3039
3063
|
break;
|
|
3064
|
+
case 'company_no':
|
|
3065
|
+
if (typeof data === 'string') {
|
|
3066
|
+
data = companyNoAutoDash(data);
|
|
3067
|
+
}
|
|
3068
|
+
break;
|
|
3069
|
+
case 'personal_no':
|
|
3070
|
+
if (typeof data === 'string') {
|
|
3071
|
+
data = personalNoAutoDash(data);
|
|
3072
|
+
}
|
|
3073
|
+
break;
|
|
3040
3074
|
case 'check':
|
|
3041
3075
|
data = (React.createElement(material.Box, { className: 'TableBoxyCell-check-box', onClick: menuOpen ? undefined : function (e) { return e.stopPropagation(); } },
|
|
3042
3076
|
React.createElement(material.Checkbox, { checked: checked, disabled: checkDisabled, onChange: function (e, newChecked) {
|
|
@@ -4573,13 +4607,15 @@ TableMenuButton.defaultProps = TableMenuButtonDefaultProps;var InfoTableDefaultP
|
|
|
4573
4607
|
spacing: 2,
|
|
4574
4608
|
rowSpacing: 3,
|
|
4575
4609
|
labelColor: 'primary',
|
|
4610
|
+
dividerColor: 'gray',
|
|
4576
4611
|
};var Label = material.styled(material.Box)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-size: 12px;\n font-weight: bold;\n"], ["\n font-size: 12px;\n font-weight: bold;\n"])));
|
|
4577
4612
|
var ValueWrap = material.styled(material.Box)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"], ["\n margin-top: 3px;\n position: relative;\n display: flex;\n flex-direction: row;\n"])));
|
|
4578
4613
|
var Value = material.styled('div')(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex: 1;\n"], ["\n flex: 1;\n"])));
|
|
4579
4614
|
var ValueEllipsis = material.styled('div')(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"], ["\n flex: 1;\n position: relative;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"])));
|
|
4580
4615
|
var ValueClipboard = material.styled('div')(templateObject_5 || (templateObject_5 = __makeTemplateObject([""], [""])));
|
|
4581
4616
|
var ClipboardIconButton = material.styled(material.IconButton)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n margin-top: -10px;\n margin-bottom: -10px;\n"], ["\n margin-top: -10px;\n margin-bottom: -10px;\n"])));
|
|
4582
|
-
var
|
|
4617
|
+
var Line = material.styled('div')(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n border-top: 1px solid #efefef;\n height: 1px;\n flex: 1;\n"], ["\n border-top: 1px solid #efefef;\n height: 1px;\n flex: 1;\n"])));
|
|
4618
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;var Component = {};var toggleSelection = function () {
|
|
4583
4619
|
var selection = document.getSelection();
|
|
4584
4620
|
if (!selection.rangeCount) {
|
|
4585
4621
|
return function () {};
|
|
@@ -4844,7 +4880,7 @@ _defineProperty(CopyToClipboard$1, "defaultProps", {
|
|
|
4844
4880
|
|
|
4845
4881
|
CopyToClipboard.CopyToClipboard = CopyToClipboard;
|
|
4846
4882
|
var lib = CopyToClipboard;var InfoTable = function (_a) {
|
|
4847
|
-
var cols = _a.cols, spacing = _a.spacing, columnSpacing = _a.columnSpacing, rowSpacing = _a.rowSpacing, className = _a.className, style = _a.style, sx = _a.sx, labelClassName = _a.labelClassName, labelColor = _a.labelColor, labelStyle = _a.labelStyle, labelSx = _a.labelSx, valueClassName = _a.valueClassName, valueStyle = _a.valueStyle, valueSx = _a.valueSx, ellipsis = _a.ellipsis, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items, onCopyToClipboard = _a.onCopyToClipboard;
|
|
4883
|
+
var cols = _a.cols, spacing = _a.spacing, columnSpacing = _a.columnSpacing, rowSpacing = _a.rowSpacing, className = _a.className, style = _a.style, sx = _a.sx, labelClassName = _a.labelClassName, labelColor = _a.labelColor, labelStyle = _a.labelStyle, labelSx = _a.labelSx, dividerColor = _a.dividerColor, valueClassName = _a.valueClassName, valueStyle = _a.valueStyle, valueSx = _a.valueSx, ellipsis = _a.ellipsis, valueUnderline = _a.valueUnderline, info = _a.info, items = _a.items, onCopyToClipboard = _a.onCopyToClipboard;
|
|
4848
4884
|
var sizeProps = React.useMemo(function () {
|
|
4849
4885
|
var value = {};
|
|
4850
4886
|
if (typeof cols === 'number') {
|
|
@@ -4866,7 +4902,7 @@ var lib = CopyToClipboard;var InfoTable = function (_a) {
|
|
|
4866
4902
|
}, [cols]);
|
|
4867
4903
|
return (React.createElement(material.Grid, { container: true, spacing: spacing, columnSpacing: columnSpacing, rowSpacing: rowSpacing, className: classNames('InfoTable', className), style: style, sx: sx }, items.map(function (item, idx) {
|
|
4868
4904
|
if (item) {
|
|
4869
|
-
var finalLabelColor = typographyColorToSxColor(item.labelColor || labelColor);
|
|
4905
|
+
var finalLabelColor = typographyColorToSxColor(item.type === 'divider' ? item.dividerColor || dividerColor : item.labelColor || labelColor);
|
|
4870
4906
|
var finalLabelSx = combineSx(labelSx, item.labelSx, !!finalLabelColor && { color: finalLabelColor });
|
|
4871
4907
|
var finalValueSx = combineSx(valueSx, item.valueSx);
|
|
4872
4908
|
var valueUnderlineStyle = valueUnderline
|
|
@@ -4934,6 +4970,16 @@ var lib = CopyToClipboard;var InfoTable = function (_a) {
|
|
|
4934
4970
|
React.createElement("a", { href: data, target: '_blank' }, data)));
|
|
4935
4971
|
}
|
|
4936
4972
|
break;
|
|
4973
|
+
case 'company_no':
|
|
4974
|
+
if (typeof data === 'string') {
|
|
4975
|
+
data = companyNoAutoDash(data);
|
|
4976
|
+
}
|
|
4977
|
+
break;
|
|
4978
|
+
case 'personal_no':
|
|
4979
|
+
if (typeof data === 'string') {
|
|
4980
|
+
data = personalNoAutoDash(data);
|
|
4981
|
+
}
|
|
4982
|
+
break;
|
|
4937
4983
|
case 'date':
|
|
4938
4984
|
if (typeof data === 'string' || typeof data === 'number') {
|
|
4939
4985
|
data = dayjs(data, item.dateFormat).format('YYYY-MM-DD');
|
|
@@ -4971,8 +5017,15 @@ var lib = CopyToClipboard;var InfoTable = function (_a) {
|
|
|
4971
5017
|
if (empty(data))
|
|
4972
5018
|
data = item.onRenderEmpty ? item.onRenderEmpty(info) : React.createElement(React.Fragment, null, "\u00A0");
|
|
4973
5019
|
var copyToClipboardText_1 = item.clipboardText || (typeof data === 'string' ? data : typeof data === 'number' ? data.toString() : '');
|
|
4974
|
-
return (React.createElement(material.Grid,
|
|
4975
|
-
React.createElement(
|
|
5020
|
+
return item.type === 'divider' ? (React.createElement(material.Grid, { key: idx, item: true, xs: 12 },
|
|
5021
|
+
React.createElement(material.Stack, { direction: 'row', spacing: 0.5, alignItems: 'center' },
|
|
5022
|
+
item.icon && (React.createElement(reactForm.FormIcon, { sx: { color: item.dividerColor || dividerColor }, fontSize: 'small' }, item.icon)),
|
|
5023
|
+
item.label && (React.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$3(__assign$3({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label)),
|
|
5024
|
+
item.dividerLine && (React.createElement(React.Fragment, null, item.icon || item.label ? (React.createElement("div", { style: { flex: 1, paddingLeft: 5 } },
|
|
5025
|
+
React.createElement(Line, null))) : (React.createElement(Line, null))))))) : (React.createElement(material.Grid, __assign$3({ key: idx, item: true }, finalSizeProps, { className: item.className, style: item.style, sx: item.sx }),
|
|
5026
|
+
React.createElement(material.Stack, { direction: 'row', spacing: 0.5, alignItems: 'center' },
|
|
5027
|
+
item.icon && (React.createElement(reactForm.FormIcon, { sx: { color: finalLabelColor }, fontSize: 'small' }, "CalendarMonth")),
|
|
5028
|
+
React.createElement(Label, { className: classNames(labelClassName, item.labelClassName), style: __assign$3(__assign$3({}, item.labelStyle), labelStyle), sx: finalLabelSx }, item.label)),
|
|
4976
5029
|
React.createElement(ValueWrap, { className: classNames(valueClassName, item.valueClassName), style: __assign$3(__assign$3(__assign$3({}, valueStyle), item.valueStyle), valueUnderlineStyle), sx: finalValueSx },
|
|
4977
5030
|
item.ellipsis || ellipsis ? React.createElement(ValueEllipsis, null, data) : React.createElement(Value, null, data),
|
|
4978
5031
|
item.clipboard && notEmpty(copyToClipboardText_1) && (React.createElement(ValueClipboard, null,
|