beautiful-grid 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/TableHeadColumn.js +12 -11
- package/cjs/components/toolbox/ToolboxColumnVisibilitySection.js +8 -10
- package/cjs/components/toolbox/ToolboxCustomSection.js +4 -1
- package/cjs/components/toolbox/ToolboxNumberFilterSection.js +20 -18
- package/cjs/components/toolbox/ToolboxSortSection.js +6 -5
- package/cjs/components/toolbox/ToolboxTextFilterSection.js +11 -9
- package/cjs/components/toolbox/ToolboxValueFilterSection.js +20 -20
- package/esm/components/TableHeadColumn.js +5 -4
- package/esm/components/toolbox/ToolboxColumnVisibilitySection.js +7 -9
- package/esm/components/toolbox/ToolboxCustomSection.js +3 -1
- package/esm/components/toolbox/ToolboxNumberFilterSection.js +15 -14
- package/esm/components/toolbox/ToolboxSortSection.js +5 -4
- package/esm/components/toolbox/ToolboxTextFilterSection.js +8 -7
- package/esm/components/toolbox/ToolboxValueFilterSection.js +13 -15
- package/package.json +1 -1
- package/types/types.d.ts +88 -0
|
@@ -49,8 +49,9 @@ var LazyTableHeadToolbox = React.lazy(function () {
|
|
|
49
49
|
}); });
|
|
50
50
|
});
|
|
51
51
|
function TableHeadColumn(_a) {
|
|
52
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
53
|
-
var column = _a.column,
|
|
52
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
53
|
+
var column = _a.column, _u = _a.columnIndex, columnIndex = _u === void 0 ? 0 : _u;
|
|
54
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
54
55
|
var sort = (0, store_1.useAppStore)(function (s) { return s.sort; });
|
|
55
56
|
var sortParams = (0, store_1.useAppStore)(function (s) { return s.sortParams; });
|
|
56
57
|
var dataQuery = (0, store_1.useAppStore)(function (s) { return s.dataQuery; });
|
|
@@ -89,22 +90,22 @@ function TableHeadColumn(_a) {
|
|
|
89
90
|
// Tooltip
|
|
90
91
|
var tooltipParts = [];
|
|
91
92
|
if (isAsc)
|
|
92
|
-
tooltipParts.push('오름차순 정렬');
|
|
93
|
+
tooltipParts.push((_e = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.sortAscending) !== null && _e !== void 0 ? _e : '오름차순 정렬');
|
|
93
94
|
if (isDesc)
|
|
94
|
-
tooltipParts.push('내림차순 정렬');
|
|
95
|
+
tooltipParts.push((_f = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.sortDescending) !== null && _f !== void 0 ? _f : '내림차순 정렬');
|
|
95
96
|
if (isFiltered)
|
|
96
|
-
tooltipParts.push('필터 적용됨');
|
|
97
|
-
var tooltip = tooltipParts.length > 0 ? tooltipParts.join(', ') : '컬럼 옵션 열기';
|
|
97
|
+
tooltipParts.push((_g = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.filterApplied) !== null && _g !== void 0 ? _g : '필터 적용됨');
|
|
98
|
+
var tooltip = tooltipParts.length > 0 ? tooltipParts.join(', ') : ((_h = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.openColumnOptions) !== null && _h !== void 0 ? _h : '컬럼 옵션 열기');
|
|
98
99
|
// Resolve icons with hierarchy (column -> global -> default)
|
|
99
|
-
var sortAscIcon = (
|
|
100
|
+
var sortAscIcon = (_k = (_j = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.sortAsc) !== null && _j !== void 0 ? _j : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.sortAsc) !== null && _k !== void 0 ? _k : (React.createElement("svg", { viewBox: '0 0 16 16', width: '10', height: '10', fill: 'currentColor' },
|
|
100
101
|
React.createElement("path", { d: 'M3 11.5L8 4l5 7.5H3z' })));
|
|
101
|
-
var sortDescIcon = (
|
|
102
|
+
var sortDescIcon = (_m = (_l = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.sortDesc) !== null && _l !== void 0 ? _l : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.sortDesc) !== null && _m !== void 0 ? _m : (React.createElement("svg", { viewBox: '0 0 16 16', width: '10', height: '10', fill: 'currentColor' },
|
|
102
103
|
React.createElement("path", { d: 'M3 4.5L8 12l5-7.5H3z' })));
|
|
103
|
-
var filterIcon = (
|
|
104
|
+
var filterIcon = (_p = (_o = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.filter) !== null && _o !== void 0 ? _o : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.filter) !== null && _p !== void 0 ? _p : (React.createElement("svg", { viewBox: '0 0 16 16', width: '12', height: '12', fill: 'currentColor', className: 'bgrid-filter-icon' },
|
|
104
105
|
React.createElement("path", { d: 'M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.293V13.5a.5.5 0 0 1-.74.439l-2.5-1.5A.5.5 0 0 1 6.5 12V8.293L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z' })));
|
|
105
|
-
var filterBadgeIcon = (
|
|
106
|
+
var filterBadgeIcon = (_r = (_q = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.filterBadge) !== null && _q !== void 0 ? _q : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.filterBadge) !== null && _r !== void 0 ? _r : (React.createElement("svg", { viewBox: '0 0 16 16', width: '10', height: '10', fill: 'currentColor', className: 'bgrid-filter-badge-icon' },
|
|
106
107
|
React.createElement("path", { d: 'M1.5 1.5A.5.5 0 0 1 2 1h12a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-.128.334L10 8.293V13.5a.5.5 0 0 1-.74.439l-2.5-1.5A.5.5 0 0 1 6.5 12V8.293L1.628 3.834A.5.5 0 0 1 1.5 3.5v-2z' })));
|
|
107
|
-
var dropdownIcon = (
|
|
108
|
+
var dropdownIcon = (_t = (_s = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.dropdown) !== null && _s !== void 0 ? _s : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.dropdown) !== null && _t !== void 0 ? _t : (React.createElement("svg", { viewBox: '0 0 16 16', width: '10', height: '10', fill: 'currentColor', className: 'bgrid-dropdown-arrow' },
|
|
108
109
|
React.createElement("path", { d: 'M3 6l5 5 5-5H3z' })));
|
|
109
110
|
if (isToolboxEnabled) {
|
|
110
111
|
return (React.createElement("div", { className: 'bgrid-head-cell-wrapper' },
|
|
@@ -65,8 +65,9 @@ function accessibleLabel(label, fallback) {
|
|
|
65
65
|
return typeof label === 'string' || typeof label === 'number' ? String(label) : fallback;
|
|
66
66
|
}
|
|
67
67
|
function ToolboxColumnVisibilitySection(_a) {
|
|
68
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
68
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
69
69
|
var column = _a.column, columnId = _a.columnId, mode = _a.mode, onModeChange = _a.onModeChange, close = _a.close;
|
|
70
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
70
71
|
var visibility = (0, store_1.useAppStore)(function (s) { return s.columnVisibilityState; });
|
|
71
72
|
var globalIcons = (0, store_1.useAppStore)(function (s) { return s.icons; });
|
|
72
73
|
var columnIcons = typeof column.toolbox === 'object' ? column.toolbox.icons : undefined;
|
|
@@ -94,7 +95,7 @@ function ToolboxColumnVisibilitySection(_a) {
|
|
|
94
95
|
React.createElement("div", { className: 'bgrid-toolbox-visibility-header' },
|
|
95
96
|
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-icon-button', "aria-label": '\uCEEC\uB7FC \uBA54\uB274\uB85C \uB3CC\uC544\uAC00\uAE30', onClick: function () { return onModeChange('menu'); } },
|
|
96
97
|
React.createElement("span", { "aria-hidden": 'true' }, "\u2039")),
|
|
97
|
-
React.createElement("span", { className: 'bgrid-toolbox-visibility-title' },
|
|
98
|
+
React.createElement("span", { className: 'bgrid-toolbox-visibility-title' }, (_j = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.hiddenColumns) !== null && _j !== void 0 ? _j : '숨긴 컬럼')),
|
|
98
99
|
React.createElement("div", { className: 'bgrid-toolbox-hidden-list' }, hiddenItems.map(function (item) {
|
|
99
100
|
var label = accessibleLabel(item.column.label, item.columnId);
|
|
100
101
|
return (React.createElement("button", { key: item.columnId, type: 'button', className: 'bgrid-toolbox-menu-item', "aria-label": "".concat(label, " \uCEEC\uB7FC \uD45C\uC2DC"), onClick: function () {
|
|
@@ -108,24 +109,21 @@ function ToolboxColumnVisibilitySection(_a) {
|
|
|
108
109
|
close();
|
|
109
110
|
} },
|
|
110
111
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, columnsIcon),
|
|
111
|
-
React.createElement("span", null,
|
|
112
|
+
React.createElement("span", null, (_k = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.showAllColumns) !== null && _k !== void 0 ? _k : '모두 표시'))));
|
|
112
113
|
}
|
|
113
114
|
return (React.createElement("div", { className: 'bgrid-toolbox-section bgrid-toolbox-visibility-section' },
|
|
114
|
-
React.createElement("div", { className: 'bgrid-toolbox-section-title' },
|
|
115
|
+
React.createElement("div", { className: 'bgrid-toolbox-section-title' }, (_l = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.columns) !== null && _l !== void 0 ? _l : '컬럼'),
|
|
115
116
|
React.createElement("div", { className: 'bgrid-toolbox-menu-list' },
|
|
116
|
-
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', disabled: !canHideCurrent, "aria-label": "".concat(accessibleLabel(column.label, columnId), " \uCEEC\uB7FC \uC228\uAE30\uAE30"), title: !canHideCurrent && visibleCount <= 1 ? '최소 한 개의 컬럼은 표시해야 합니다.' : undefined, onClick: function () {
|
|
117
|
+
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', disabled: !canHideCurrent, "aria-label": "".concat(accessibleLabel(column.label, columnId), " \uCEEC\uB7FC \uC228\uAE30\uAE30"), title: !canHideCurrent && visibleCount <= 1 ? ((_m = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.lastVisibleColumn) !== null && _m !== void 0 ? _m : '최소 한 개의 컬럼은 표시해야 합니다.') : undefined, onClick: function () {
|
|
117
118
|
if (!canHideCurrent)
|
|
118
119
|
return;
|
|
119
120
|
visibility.onChange(__spreadArray(__spreadArray([], __read(visibility.hiddenColumnIds), false), [columnId], false), { type: 'hide', columnId: columnId, column: currentItem === null || currentItem === void 0 ? void 0 : currentItem.column });
|
|
120
121
|
close();
|
|
121
122
|
} },
|
|
122
123
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, hideIcon),
|
|
123
|
-
React.createElement("span", null,
|
|
124
|
+
React.createElement("span", null, (_o = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.hideThisColumn) !== null && _o !== void 0 ? _o : '이 컬럼 숨기기')),
|
|
124
125
|
hiddenItems.length > 0 && (React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', "aria-label": "\uC228\uAE34 \uCEEC\uB7FC ".concat(hiddenItems.length, "\uAC1C \uAD00\uB9AC"), onClick: function () { return onModeChange('hidden'); } },
|
|
125
126
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, columnsIcon),
|
|
126
|
-
React.createElement("span", { className: 'bgrid-toolbox-menu-label' },
|
|
127
|
-
"\uC228\uAE34 \uCEEC\uB7FC ",
|
|
128
|
-
hiddenItems.length,
|
|
129
|
-
"\uAC1C"),
|
|
127
|
+
React.createElement("span", { className: 'bgrid-toolbox-menu-label' }, (_q = (_p = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.hiddenColumnCount) === null || _p === void 0 ? void 0 : _p.call(toolboxMsg, hiddenItems.length)) !== null && _q !== void 0 ? _q : "\uC228\uAE34 \uCEEC\uB7FC ".concat(hiddenItems.length, "\uAC1C")),
|
|
130
128
|
React.createElement("span", { className: 'bgrid-toolbox-menu-chevron', "aria-hidden": 'true' }, "\u203A"))))));
|
|
131
129
|
}
|
|
@@ -35,8 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.ToolboxCustomSection = ToolboxCustomSection;
|
|
37
37
|
var React = __importStar(require("react"));
|
|
38
|
+
var store_1 = require("../../store");
|
|
38
39
|
function ToolboxCustomSection(_a) {
|
|
40
|
+
var _b;
|
|
39
41
|
var column = _a.column, columnId = _a.columnId, columnIndex = _a.columnIndex, config = _a.config, close = _a.close;
|
|
42
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
40
43
|
if (config.render) {
|
|
41
44
|
var CustomRender = config.render;
|
|
42
45
|
return (React.createElement("div", { className: "bgrid-toolbox-custom-content" },
|
|
@@ -44,7 +47,7 @@ function ToolboxCustomSection(_a) {
|
|
|
44
47
|
}
|
|
45
48
|
if (config.extraItems && config.extraItems.length > 0) {
|
|
46
49
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-custom-section" },
|
|
47
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
50
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_b = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.extraMenu) !== null && _b !== void 0 ? _b : '추가 메뉴'),
|
|
48
51
|
React.createElement("div", { className: "bgrid-toolbox-menu-list" }, config.extraItems.map(function (item) { return (React.createElement("button", { key: item.id, type: "button", className: "bgrid-toolbox-menu-item", disabled: item.disabled, onClick: function () {
|
|
49
52
|
item.onClick({ column: column, columnId: columnId, columnIndex: columnIndex });
|
|
50
53
|
close();
|
|
@@ -54,7 +54,9 @@ var React = __importStar(require("react"));
|
|
|
54
54
|
var react_1 = require("react");
|
|
55
55
|
var store_1 = require("../../store");
|
|
56
56
|
function ToolboxNumberFilterSection(_a) {
|
|
57
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
57
58
|
var column = _a.column, columnId = _a.columnId;
|
|
59
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
58
60
|
var dataQuery = (0, store_1.useAppStore)(function (s) { return s.dataQuery; });
|
|
59
61
|
var filterDrafts = (0, store_1.useAppStore)(function (s) { return s.filterDrafts; });
|
|
60
62
|
var setFilterDraft = (0, store_1.useAppStore)(function (s) { return s.setFilterDraft; });
|
|
@@ -71,10 +73,10 @@ function ToolboxNumberFilterSection(_a) {
|
|
|
71
73
|
((appliedFilter === null || appliedFilter === void 0 ? void 0 : appliedFilter.type) === 'number' && appliedFilter.min !== undefined ? String(appliedFilter.min) : '');
|
|
72
74
|
var initialMax = ((currentDraft === null || currentDraft === void 0 ? void 0 : currentDraft.type) === 'number' && currentDraft.max !== undefined ? String(currentDraft.max) : '') ||
|
|
73
75
|
((appliedFilter === null || appliedFilter === void 0 ? void 0 : appliedFilter.type) === 'number' && appliedFilter.max !== undefined ? String(appliedFilter.max) : '');
|
|
74
|
-
var
|
|
75
|
-
var
|
|
76
|
-
var
|
|
77
|
-
var
|
|
76
|
+
var _r = __read((0, react_1.useState)(initialOperator), 2), operator = _r[0], setOperator = _r[1];
|
|
77
|
+
var _s = __read((0, react_1.useState)(initialValue), 2), valStr = _s[0], setValStr = _s[1];
|
|
78
|
+
var _t = __read((0, react_1.useState)(initialMin), 2), minStr = _t[0], setMinStr = _t[1];
|
|
79
|
+
var _u = __read((0, react_1.useState)(initialMax), 2), maxStr = _u[0], setMaxStr = _u[1];
|
|
78
80
|
var isBetween = operator === 'between';
|
|
79
81
|
var minNum = minStr.trim() !== '' ? Number(minStr) : undefined;
|
|
80
82
|
var maxNum = maxStr.trim() !== '' ? Number(maxStr) : undefined;
|
|
@@ -129,23 +131,23 @@ function ToolboxNumberFilterSection(_a) {
|
|
|
129
131
|
handleApply();
|
|
130
132
|
};
|
|
131
133
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-number-filter-section" },
|
|
132
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
134
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_b = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.numberFilter) !== null && _b !== void 0 ? _b : '숫자 필터'),
|
|
133
135
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
134
136
|
React.createElement("select", { className: "bgrid-toolbox-select", value: operator, onChange: function (e) { return setOperator(e.target.value); } },
|
|
135
|
-
React.createElement("option", { value: "equals" },
|
|
136
|
-
React.createElement("option", { value: "notEquals" },
|
|
137
|
-
React.createElement("option", { value: "gt" },
|
|
138
|
-
React.createElement("option", { value: "gte" },
|
|
139
|
-
React.createElement("option", { value: "lt" },
|
|
140
|
-
React.createElement("option", { value: "lte" },
|
|
141
|
-
React.createElement("option", { value: "between" },
|
|
137
|
+
React.createElement("option", { value: "equals" }, (_c = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.numberEquals) !== null && _c !== void 0 ? _c : '일치 (=)'),
|
|
138
|
+
React.createElement("option", { value: "notEquals" }, (_d = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.numberNotEquals) !== null && _d !== void 0 ? _d : '불일치 (≠)'),
|
|
139
|
+
React.createElement("option", { value: "gt" }, (_e = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.greaterThan) !== null && _e !== void 0 ? _e : '초과 (>)'),
|
|
140
|
+
React.createElement("option", { value: "gte" }, (_f = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.greaterThanOrEqual) !== null && _f !== void 0 ? _f : '이상 (≥)'),
|
|
141
|
+
React.createElement("option", { value: "lt" }, (_g = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.lessThan) !== null && _g !== void 0 ? _g : '미만 (<)'),
|
|
142
|
+
React.createElement("option", { value: "lte" }, (_h = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.lessThanOrEqual) !== null && _h !== void 0 ? _h : '이하 (≤)'),
|
|
143
|
+
React.createElement("option", { value: "between" }, (_j = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.between) !== null && _j !== void 0 ? _j : '범위 (Between)'))),
|
|
142
144
|
isBetween ? (React.createElement("div", { className: "bgrid-toolbox-range-row" },
|
|
143
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
145
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: (_k = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.minimumPlaceholder) !== null && _k !== void 0 ? _k : '최소값', value: minStr, onChange: function (e) { return setMinStr(e.target.value); }, onKeyDown: handleApplyKeyDown }),
|
|
144
146
|
React.createElement("span", { className: "bgrid-toolbox-range-separator" }, "~"),
|
|
145
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
146
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
147
|
-
isBetweenInvalid && (React.createElement("div", { className: "bgrid-toolbox-error-text" },
|
|
147
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: (_l = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.maximumPlaceholder) !== null && _l !== void 0 ? _l : '최대값', value: maxStr, onChange: function (e) { return setMaxStr(e.target.value); }, onKeyDown: handleApplyKeyDown }))) : (React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
148
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: (_m = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.numberPlaceholder) !== null && _m !== void 0 ? _m : '숫자 입력...', value: valStr, onChange: function (e) { return setValStr(e.target.value); }, onKeyDown: handleApplyKeyDown }))),
|
|
149
|
+
isBetweenInvalid && (React.createElement("div", { className: "bgrid-toolbox-error-text" }, (_o = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.invalidRange) !== null && _o !== void 0 ? _o : '최소값이 최대값보다 클 수 없습니다.')),
|
|
148
150
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
149
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
150
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", disabled: !isValid, onClick: handleApply },
|
|
151
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, (_p = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.clear) !== null && _p !== void 0 ? _p : '초기화'),
|
|
152
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", disabled: !isValid, onClick: handleApply }, (_q = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.apply) !== null && _q !== void 0 ? _q : '적용'))));
|
|
151
153
|
}
|
|
@@ -37,8 +37,9 @@ exports.ToolboxSortSection = ToolboxSortSection;
|
|
|
37
37
|
var React = __importStar(require("react"));
|
|
38
38
|
var store_1 = require("../../store");
|
|
39
39
|
function ToolboxSortSection(_a) {
|
|
40
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
40
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
41
41
|
var column = _a.column, columnId = _a.columnId;
|
|
42
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
42
43
|
var dataQuery = (0, store_1.useAppStore)(function (s) { return s.dataQuery; });
|
|
43
44
|
var sortParams = (0, store_1.useAppStore)(function (s) { return s.sortParams; });
|
|
44
45
|
var setColumnSort = (0, store_1.useAppStore)(function (s) { return s.setColumnSort; });
|
|
@@ -54,15 +55,15 @@ function ToolboxSortSection(_a) {
|
|
|
54
55
|
var sortClearIcon = (_h = (_g = columnIcons === null || columnIcons === void 0 ? void 0 : columnIcons.sortClear) !== null && _g !== void 0 ? _g : globalIcons === null || globalIcons === void 0 ? void 0 : globalIcons.sortClear) !== null && _h !== void 0 ? _h : (React.createElement("svg", { className: "bgrid-toolbox-icon", viewBox: "0 0 16 16", width: "14", height: "14", fill: "currentColor" },
|
|
55
56
|
React.createElement("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" })));
|
|
56
57
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-sort-section" },
|
|
57
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
58
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_j = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.sort) !== null && _j !== void 0 ? _j : '정렬'),
|
|
58
59
|
React.createElement("div", { className: "bgrid-toolbox-menu-list" },
|
|
59
60
|
React.createElement("button", { type: "button", className: "bgrid-toolbox-menu-item ".concat(isAsc ? 'active' : ''), onClick: function () { return setColumnSort(columnId, 'asc'); } },
|
|
60
61
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortAscIcon),
|
|
61
|
-
React.createElement("span", null,
|
|
62
|
+
React.createElement("span", null, (_k = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.sortAscending) !== null && _k !== void 0 ? _k : '오름차순 정렬')),
|
|
62
63
|
React.createElement("button", { type: "button", className: "bgrid-toolbox-menu-item ".concat(isDesc ? 'active' : ''), onClick: function () { return setColumnSort(columnId, 'desc'); } },
|
|
63
64
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortDescIcon),
|
|
64
|
-
React.createElement("span", null,
|
|
65
|
+
React.createElement("span", null, (_l = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.sortDescending) !== null && _l !== void 0 ? _l : '내림차순 정렬')),
|
|
65
66
|
activeSortParam && (React.createElement("button", { type: "button", className: "bgrid-toolbox-menu-item bgrid-toolbox-menu-item-clear", onClick: function () { return setColumnSort(columnId, null); } },
|
|
66
67
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortClearIcon),
|
|
67
|
-
React.createElement("span", null,
|
|
68
|
+
React.createElement("span", null, (_m = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.clearSort) !== null && _m !== void 0 ? _m : '정렬 초기화'))))));
|
|
68
69
|
}
|
|
@@ -54,7 +54,9 @@ var React = __importStar(require("react"));
|
|
|
54
54
|
var react_1 = require("react");
|
|
55
55
|
var store_1 = require("../../store");
|
|
56
56
|
function ToolboxTextFilterSection(_a) {
|
|
57
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
57
58
|
var column = _a.column, columnId = _a.columnId;
|
|
59
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
58
60
|
var dataQuery = (0, store_1.useAppStore)(function (s) { return s.dataQuery; });
|
|
59
61
|
var filterDrafts = (0, store_1.useAppStore)(function (s) { return s.filterDrafts; });
|
|
60
62
|
var setFilterDraft = (0, store_1.useAppStore)(function (s) { return s.setFilterDraft; });
|
|
@@ -68,8 +70,8 @@ function ToolboxTextFilterSection(_a) {
|
|
|
68
70
|
var initialValue = ((currentDraft === null || currentDraft === void 0 ? void 0 : currentDraft.type) === 'text' && currentDraft.value) ||
|
|
69
71
|
((appliedFilter === null || appliedFilter === void 0 ? void 0 : appliedFilter.type) === 'text' && appliedFilter.value) ||
|
|
70
72
|
'';
|
|
71
|
-
var
|
|
72
|
-
var
|
|
73
|
+
var _j = __read((0, react_1.useState)(initialOperator), 2), operator = _j[0], setOperator = _j[1];
|
|
74
|
+
var _k = __read((0, react_1.useState)(initialValue), 2), value = _k[0], setValue = _k[1];
|
|
73
75
|
(0, react_1.useEffect)(function () {
|
|
74
76
|
var draftParam = {
|
|
75
77
|
columnId: columnId,
|
|
@@ -100,15 +102,15 @@ function ToolboxTextFilterSection(_a) {
|
|
|
100
102
|
handleApply();
|
|
101
103
|
};
|
|
102
104
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-text-filter-section" },
|
|
103
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
105
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_b = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.textFilter) !== null && _b !== void 0 ? _b : '텍스트 필터'),
|
|
104
106
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
105
107
|
React.createElement("select", { className: "bgrid-toolbox-select", value: operator, onChange: function (e) { return setOperator(e.target.value); } },
|
|
106
|
-
React.createElement("option", { value: "contains" },
|
|
107
|
-
React.createElement("option", { value: "equals" },
|
|
108
|
-
React.createElement("option", { value: "notEquals" },
|
|
108
|
+
React.createElement("option", { value: "contains" }, (_c = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.contains) !== null && _c !== void 0 ? _c : '포함'),
|
|
109
|
+
React.createElement("option", { value: "equals" }, (_d = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.equals) !== null && _d !== void 0 ? _d : '일치'),
|
|
110
|
+
React.createElement("option", { value: "notEquals" }, (_e = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.notEquals) !== null && _e !== void 0 ? _e : '불일치'))),
|
|
109
111
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
110
|
-
React.createElement("input", { type: "text", className: "bgrid-toolbox-input", placeholder:
|
|
112
|
+
React.createElement("input", { type: "text", className: "bgrid-toolbox-input", placeholder: (_f = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.textPlaceholder) !== null && _f !== void 0 ? _f : '검색어 입력...', value: value, onChange: function (e) { return setValue(e.target.value); }, onKeyDown: handleApplyKeyDown })),
|
|
111
113
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
112
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
113
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply },
|
|
114
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, (_g = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.clear) !== null && _g !== void 0 ? _g : '초기화'),
|
|
115
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply }, (_h = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.apply) !== null && _h !== void 0 ? _h : '적용'))));
|
|
114
116
|
}
|
|
@@ -55,8 +55,9 @@ var react_1 = require("react");
|
|
|
55
55
|
var store_1 = require("../../store");
|
|
56
56
|
var utils_1 = require("../../utils");
|
|
57
57
|
function ToolboxValueFilterSection(_a) {
|
|
58
|
-
var _b, _c;
|
|
58
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
59
59
|
var column = _a.column, columnId = _a.columnId;
|
|
60
|
+
var toolboxMsg = (0, store_1.useAppStore)(function (s) { var _a; return (_a = s.msg) === null || _a === void 0 ? void 0 : _a.toolbox; });
|
|
60
61
|
var sourceData = (0, store_1.useAppStore)(function (s) { return (s.sourceData.length > 0 ? s.sourceData : s.data); });
|
|
61
62
|
var columns = (0, store_1.useAppStore)(function (s) { return s.columns; });
|
|
62
63
|
var dataQuery = (0, store_1.useAppStore)(function (s) { return s.dataQuery; });
|
|
@@ -111,9 +112,9 @@ function ToolboxValueFilterSection(_a) {
|
|
|
111
112
|
// Default to all selected
|
|
112
113
|
return new Set(distinctValues.map(function (v) { return (0, utils_1.normalizeValueForFilter)(v); }));
|
|
113
114
|
}, [appliedFilter, currentDraft, distinctValues]);
|
|
114
|
-
var
|
|
115
|
-
var
|
|
116
|
-
var
|
|
115
|
+
var _p = __read((0, react_1.useState)(initialSelectedValues), 2), selectedSet = _p[0], setSelectedSet = _p[1];
|
|
116
|
+
var _q = __read((0, react_1.useState)(''), 2), searchTerm = _q[0], setSearchTerm = _q[1];
|
|
117
|
+
var _r = __read((0, react_1.useState)(''), 2), debouncedSearch = _r[0], setDebouncedSearch = _r[1];
|
|
117
118
|
var searchTimeoutRef = (0, react_1.useRef)(null);
|
|
118
119
|
(0, react_1.useEffect)(function () {
|
|
119
120
|
if (currentDraft && currentDraft.type === 'values') {
|
|
@@ -144,14 +145,15 @@ function ToolboxValueFilterSection(_a) {
|
|
|
144
145
|
return distinctValues;
|
|
145
146
|
var query = debouncedSearch.trim().toLowerCase();
|
|
146
147
|
return distinctValues.filter(function (val) {
|
|
148
|
+
var _a;
|
|
147
149
|
var displayStr = val === null || val === undefined
|
|
148
|
-
? '(빈 값)'
|
|
150
|
+
? ((_a = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.emptyValue) !== null && _a !== void 0 ? _a : '(빈 값)')
|
|
149
151
|
: (filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.formatValue)
|
|
150
152
|
? String(filterConfig.formatValue(val))
|
|
151
153
|
: String(val);
|
|
152
154
|
return displayStr.toLowerCase().includes(query);
|
|
153
155
|
});
|
|
154
|
-
}, [debouncedSearch, distinctValues, filterConfig]);
|
|
156
|
+
}, [debouncedSearch, distinctValues, filterConfig, toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.emptyValue]);
|
|
155
157
|
var handleToggleValue = function (val) {
|
|
156
158
|
var next = new Set(selectedSet);
|
|
157
159
|
var norm = (0, utils_1.normalizeValueForFilter)(val);
|
|
@@ -210,18 +212,18 @@ function ToolboxValueFilterSection(_a) {
|
|
|
210
212
|
};
|
|
211
213
|
if (isManual && distinctValues.length === 0) {
|
|
212
214
|
return (React.createElement("div", { className: "bgrid-toolbox-section" },
|
|
213
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
214
|
-
React.createElement("div", { className: "bgrid-toolbox-empty-notice" },
|
|
215
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_c = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.filter) !== null && _c !== void 0 ? _c : '필터'),
|
|
216
|
+
React.createElement("div", { className: "bgrid-toolbox-empty-notice" }, (_d = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.noValues) !== null && _d !== void 0 ? _d : '사용 가능한 값 목록이 없습니다.')));
|
|
215
217
|
}
|
|
216
|
-
var maxDisplayItems = (
|
|
218
|
+
var maxDisplayItems = (_e = filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.maxValueListItems) !== null && _e !== void 0 ? _e : 300;
|
|
217
219
|
var isListCapped = filteredDistinctValues.length > maxDisplayItems;
|
|
218
220
|
var displayItems = isListCapped
|
|
219
221
|
? filteredDistinctValues.slice(0, maxDisplayItems)
|
|
220
222
|
: filteredDistinctValues;
|
|
221
223
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-values-filter-section" },
|
|
222
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
224
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, (_f = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.valueFilter) !== null && _f !== void 0 ? _f : '값 필터'),
|
|
223
225
|
React.createElement("div", { className: "bgrid-toolbox-search-box" },
|
|
224
|
-
React.createElement("input", { type: "text", className: "bgrid-toolbox-search-input", placeholder:
|
|
226
|
+
React.createElement("input", { type: "text", className: "bgrid-toolbox-search-input", placeholder: (_g = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.searchPlaceholder) !== null && _g !== void 0 ? _g : '검색...', value: searchTerm, onChange: function (e) { return setSearchTerm(e.target.value); } })),
|
|
225
227
|
React.createElement("div", { className: "bgrid-toolbox-values-container" },
|
|
226
228
|
React.createElement("div", { className: "bgrid-toolbox-select-all-row" },
|
|
227
229
|
React.createElement("label", { className: "bgrid-toolbox-checkbox-label" },
|
|
@@ -229,22 +231,20 @@ function ToolboxValueFilterSection(_a) {
|
|
|
229
231
|
if (el)
|
|
230
232
|
el.indeterminate = isIndeterminate;
|
|
231
233
|
}, onChange: function (e) { return handleSelectAll(e.target.checked); } }),
|
|
232
|
-
React.createElement("span", null,
|
|
234
|
+
React.createElement("span", null, (_h = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.selectAll) !== null && _h !== void 0 ? _h : '(전체 선택)'))),
|
|
233
235
|
React.createElement("div", { className: "bgrid-toolbox-values-list" },
|
|
234
236
|
displayItems.map(function (val, idx) {
|
|
237
|
+
var _a;
|
|
235
238
|
var norm = (0, utils_1.normalizeValueForFilter)(val);
|
|
236
239
|
var isChecked = selectedSet.has(norm);
|
|
237
|
-
var display = val === null || val === undefined ? (React.createElement("span", { className: "bgrid-toolbox-empty-value" },
|
|
240
|
+
var display = val === null || val === undefined ? (React.createElement("span", { className: "bgrid-toolbox-empty-value" }, (_a = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.emptyValue) !== null && _a !== void 0 ? _a : '(빈 값)')) : (filterConfig === null || filterConfig === void 0 ? void 0 : filterConfig.formatValue) ? (filterConfig.formatValue(val)) : (String(val));
|
|
238
241
|
return (React.createElement("label", { key: idx, className: "bgrid-toolbox-checkbox-label" },
|
|
239
242
|
React.createElement("input", { type: "checkbox", checked: isChecked, onChange: function () { return handleToggleValue(val); } }),
|
|
240
243
|
React.createElement("span", { className: "bgrid-toolbox-value-text" }, display)));
|
|
241
244
|
}),
|
|
242
|
-
filteredDistinctValues.length === 0 && (React.createElement("div", { className: "bgrid-toolbox-empty-notice" },
|
|
243
|
-
isListCapped && (React.createElement("div", { className: "bgrid-toolbox-capped-notice" },
|
|
244
|
-
"+",
|
|
245
|
-
filteredDistinctValues.length - maxDisplayItems,
|
|
246
|
-
"\uAC1C \uD56D\uBAA9\uC774 \uB354 \uC788\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9\uC744 \uC774\uC6A9\uD558\uC138\uC694.")))),
|
|
245
|
+
filteredDistinctValues.length === 0 && (React.createElement("div", { className: "bgrid-toolbox-empty-notice" }, (_j = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.noResults) !== null && _j !== void 0 ? _j : '검색 결과가 없습니다.')),
|
|
246
|
+
isListCapped && (React.createElement("div", { className: "bgrid-toolbox-capped-notice" }, (_l = (_k = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.moreValues) === null || _k === void 0 ? void 0 : _k.call(toolboxMsg, filteredDistinctValues.length - maxDisplayItems)) !== null && _l !== void 0 ? _l : "+".concat(filteredDistinctValues.length - maxDisplayItems, "\uAC1C \uD56D\uBAA9\uC774 \uB354 \uC788\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9\uC744 \uC774\uC6A9\uD558\uC138\uC694."))))),
|
|
247
247
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
248
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
249
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply },
|
|
248
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, (_m = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.clear) !== null && _m !== void 0 ? _m : '초기화'),
|
|
249
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply }, (_o = toolboxMsg === null || toolboxMsg === void 0 ? void 0 : toolboxMsg.apply) !== null && _o !== void 0 ? _o : '적용'))));
|
|
250
250
|
}
|
|
@@ -12,6 +12,7 @@ const LazyTableHeadToolbox = React.lazy(() => loadTableHeadToolbox().then(module
|
|
|
12
12
|
default: module.TableHeadToolbox,
|
|
13
13
|
})));
|
|
14
14
|
function TableHeadColumn({ column, columnIndex = 0 }) {
|
|
15
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
15
16
|
const sort = useAppStore(s => s.sort);
|
|
16
17
|
const sortParams = useAppStore(s => s.sortParams);
|
|
17
18
|
const dataQuery = useAppStore(s => s.dataQuery);
|
|
@@ -51,12 +52,12 @@ function TableHeadColumn({ column, columnIndex = 0 }) {
|
|
|
51
52
|
// Tooltip
|
|
52
53
|
const tooltipParts = [];
|
|
53
54
|
if (isAsc)
|
|
54
|
-
tooltipParts.push('오름차순 정렬');
|
|
55
|
+
tooltipParts.push(toolboxMsg?.sortAscending ?? '오름차순 정렬');
|
|
55
56
|
if (isDesc)
|
|
56
|
-
tooltipParts.push('내림차순 정렬');
|
|
57
|
+
tooltipParts.push(toolboxMsg?.sortDescending ?? '내림차순 정렬');
|
|
57
58
|
if (isFiltered)
|
|
58
|
-
tooltipParts.push('필터 적용됨');
|
|
59
|
-
const tooltip = tooltipParts.length > 0 ? tooltipParts.join(', ') : '컬럼 옵션 열기';
|
|
59
|
+
tooltipParts.push(toolboxMsg?.filterApplied ?? '필터 적용됨');
|
|
60
|
+
const tooltip = tooltipParts.length > 0 ? tooltipParts.join(', ') : (toolboxMsg?.openColumnOptions ?? '컬럼 옵션 열기');
|
|
60
61
|
// Resolve icons with hierarchy (column -> global -> default)
|
|
61
62
|
const sortAscIcon = columnIcons?.sortAsc ?? globalIcons?.sortAsc ?? (React.createElement("svg", { viewBox: '0 0 16 16', width: '10', height: '10', fill: 'currentColor' },
|
|
62
63
|
React.createElement("path", { d: 'M3 11.5L8 4l5 7.5H3z' })));
|
|
@@ -4,6 +4,7 @@ function accessibleLabel(label, fallback) {
|
|
|
4
4
|
return typeof label === 'string' || typeof label === 'number' ? String(label) : fallback;
|
|
5
5
|
}
|
|
6
6
|
export function ToolboxColumnVisibilitySection({ column, columnId, mode, onModeChange, close, }) {
|
|
7
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
7
8
|
const visibility = useAppStore(s => s.columnVisibilityState);
|
|
8
9
|
const globalIcons = useAppStore(s => s.icons);
|
|
9
10
|
const columnIcons = typeof column.toolbox === 'object' ? column.toolbox.icons : undefined;
|
|
@@ -31,7 +32,7 @@ export function ToolboxColumnVisibilitySection({ column, columnId, mode, onModeC
|
|
|
31
32
|
React.createElement("div", { className: 'bgrid-toolbox-visibility-header' },
|
|
32
33
|
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-icon-button', "aria-label": '\uCEEC\uB7FC \uBA54\uB274\uB85C \uB3CC\uC544\uAC00\uAE30', onClick: () => onModeChange('menu') },
|
|
33
34
|
React.createElement("span", { "aria-hidden": 'true' }, "\u2039")),
|
|
34
|
-
React.createElement("span", { className: 'bgrid-toolbox-visibility-title' },
|
|
35
|
+
React.createElement("span", { className: 'bgrid-toolbox-visibility-title' }, toolboxMsg?.hiddenColumns ?? '숨긴 컬럼')),
|
|
35
36
|
React.createElement("div", { className: 'bgrid-toolbox-hidden-list' }, hiddenItems.map(item => {
|
|
36
37
|
const label = accessibleLabel(item.column.label, item.columnId);
|
|
37
38
|
return (React.createElement("button", { key: item.columnId, type: 'button', className: 'bgrid-toolbox-menu-item', "aria-label": `${label} 컬럼 표시`, onClick: () => {
|
|
@@ -45,24 +46,21 @@ export function ToolboxColumnVisibilitySection({ column, columnId, mode, onModeC
|
|
|
45
46
|
close();
|
|
46
47
|
} },
|
|
47
48
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, columnsIcon),
|
|
48
|
-
React.createElement("span", null,
|
|
49
|
+
React.createElement("span", null, toolboxMsg?.showAllColumns ?? '모두 표시'))));
|
|
49
50
|
}
|
|
50
51
|
return (React.createElement("div", { className: 'bgrid-toolbox-section bgrid-toolbox-visibility-section' },
|
|
51
|
-
React.createElement("div", { className: 'bgrid-toolbox-section-title' },
|
|
52
|
+
React.createElement("div", { className: 'bgrid-toolbox-section-title' }, toolboxMsg?.columns ?? '컬럼'),
|
|
52
53
|
React.createElement("div", { className: 'bgrid-toolbox-menu-list' },
|
|
53
|
-
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', disabled: !canHideCurrent, "aria-label": `${accessibleLabel(column.label, columnId)} 컬럼 숨기기`, title: !canHideCurrent && visibleCount <= 1 ? '최소 한 개의 컬럼은 표시해야 합니다.' : undefined, onClick: () => {
|
|
54
|
+
React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', disabled: !canHideCurrent, "aria-label": `${accessibleLabel(column.label, columnId)} 컬럼 숨기기`, title: !canHideCurrent && visibleCount <= 1 ? (toolboxMsg?.lastVisibleColumn ?? '최소 한 개의 컬럼은 표시해야 합니다.') : undefined, onClick: () => {
|
|
54
55
|
if (!canHideCurrent)
|
|
55
56
|
return;
|
|
56
57
|
visibility.onChange([...visibility.hiddenColumnIds, columnId], { type: 'hide', columnId, column: currentItem?.column });
|
|
57
58
|
close();
|
|
58
59
|
} },
|
|
59
60
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, hideIcon),
|
|
60
|
-
React.createElement("span", null,
|
|
61
|
+
React.createElement("span", null, toolboxMsg?.hideThisColumn ?? '이 컬럼 숨기기')),
|
|
61
62
|
hiddenItems.length > 0 && (React.createElement("button", { type: 'button', className: 'bgrid-toolbox-menu-item', "aria-label": `숨긴 컬럼 ${hiddenItems.length}개 관리`, onClick: () => onModeChange('hidden') },
|
|
62
63
|
React.createElement("span", { className: 'bgrid-toolbox-icon-wrapper' }, columnsIcon),
|
|
63
|
-
React.createElement("span", { className: 'bgrid-toolbox-menu-label' },
|
|
64
|
-
"\uC228\uAE34 \uCEEC\uB7FC ",
|
|
65
|
-
hiddenItems.length,
|
|
66
|
-
"\uAC1C"),
|
|
64
|
+
React.createElement("span", { className: 'bgrid-toolbox-menu-label' }, toolboxMsg?.hiddenColumnCount?.(hiddenItems.length) ?? `숨긴 컬럼 ${hiddenItems.length}개`),
|
|
67
65
|
React.createElement("span", { className: 'bgrid-toolbox-menu-chevron', "aria-hidden": 'true' }, "\u203A"))))));
|
|
68
66
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { useAppStore } from '../../store';
|
|
2
3
|
export function ToolboxCustomSection({ column, columnId, columnIndex, config, close }) {
|
|
4
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
3
5
|
if (config.render) {
|
|
4
6
|
const CustomRender = config.render;
|
|
5
7
|
return (React.createElement("div", { className: "bgrid-toolbox-custom-content" },
|
|
@@ -7,7 +9,7 @@ export function ToolboxCustomSection({ column, columnId, columnIndex, config, cl
|
|
|
7
9
|
}
|
|
8
10
|
if (config.extraItems && config.extraItems.length > 0) {
|
|
9
11
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-custom-section" },
|
|
10
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
12
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.extraMenu ?? '추가 메뉴'),
|
|
11
13
|
React.createElement("div", { className: "bgrid-toolbox-menu-list" }, config.extraItems.map(item => (React.createElement("button", { key: item.id, type: "button", className: "bgrid-toolbox-menu-item", disabled: item.disabled, onClick: () => {
|
|
12
14
|
item.onClick({ column, columnId, columnIndex });
|
|
13
15
|
close();
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
import { useAppStore } from '../../store';
|
|
4
4
|
export function ToolboxNumberFilterSection({ column, columnId }) {
|
|
5
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
5
6
|
const dataQuery = useAppStore(s => s.dataQuery);
|
|
6
7
|
const filterDrafts = useAppStore(s => s.filterDrafts);
|
|
7
8
|
const setFilterDraft = useAppStore(s => s.setFilterDraft);
|
|
@@ -76,23 +77,23 @@ export function ToolboxNumberFilterSection({ column, columnId }) {
|
|
|
76
77
|
handleApply();
|
|
77
78
|
};
|
|
78
79
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-number-filter-section" },
|
|
79
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
80
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.numberFilter ?? '숫자 필터'),
|
|
80
81
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
81
82
|
React.createElement("select", { className: "bgrid-toolbox-select", value: operator, onChange: e => setOperator(e.target.value) },
|
|
82
|
-
React.createElement("option", { value: "equals" },
|
|
83
|
-
React.createElement("option", { value: "notEquals" },
|
|
84
|
-
React.createElement("option", { value: "gt" },
|
|
85
|
-
React.createElement("option", { value: "gte" },
|
|
86
|
-
React.createElement("option", { value: "lt" },
|
|
87
|
-
React.createElement("option", { value: "lte" },
|
|
88
|
-
React.createElement("option", { value: "between" },
|
|
83
|
+
React.createElement("option", { value: "equals" }, toolboxMsg?.numberEquals ?? '일치 (=)'),
|
|
84
|
+
React.createElement("option", { value: "notEquals" }, toolboxMsg?.numberNotEquals ?? '불일치 (≠)'),
|
|
85
|
+
React.createElement("option", { value: "gt" }, toolboxMsg?.greaterThan ?? '초과 (>)'),
|
|
86
|
+
React.createElement("option", { value: "gte" }, toolboxMsg?.greaterThanOrEqual ?? '이상 (≥)'),
|
|
87
|
+
React.createElement("option", { value: "lt" }, toolboxMsg?.lessThan ?? '미만 (<)'),
|
|
88
|
+
React.createElement("option", { value: "lte" }, toolboxMsg?.lessThanOrEqual ?? '이하 (≤)'),
|
|
89
|
+
React.createElement("option", { value: "between" }, toolboxMsg?.between ?? '범위 (Between)'))),
|
|
89
90
|
isBetween ? (React.createElement("div", { className: "bgrid-toolbox-range-row" },
|
|
90
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
91
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: toolboxMsg?.minimumPlaceholder ?? '최소값', value: minStr, onChange: e => setMinStr(e.target.value), onKeyDown: handleApplyKeyDown }),
|
|
91
92
|
React.createElement("span", { className: "bgrid-toolbox-range-separator" }, "~"),
|
|
92
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
93
|
-
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder:
|
|
94
|
-
isBetweenInvalid && (React.createElement("div", { className: "bgrid-toolbox-error-text" },
|
|
93
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: toolboxMsg?.maximumPlaceholder ?? '최대값', value: maxStr, onChange: e => setMaxStr(e.target.value), onKeyDown: handleApplyKeyDown }))) : (React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
94
|
+
React.createElement("input", { type: "number", className: "bgrid-toolbox-input", placeholder: toolboxMsg?.numberPlaceholder ?? '숫자 입력...', value: valStr, onChange: e => setValStr(e.target.value), onKeyDown: handleApplyKeyDown }))),
|
|
95
|
+
isBetweenInvalid && (React.createElement("div", { className: "bgrid-toolbox-error-text" }, toolboxMsg?.invalidRange ?? '최소값이 최대값보다 클 수 없습니다.')),
|
|
95
96
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
96
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
97
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", disabled: !isValid, onClick: handleApply },
|
|
97
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, toolboxMsg?.clear ?? '초기화'),
|
|
98
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", disabled: !isValid, onClick: handleApply }, toolboxMsg?.apply ?? '적용'))));
|
|
98
99
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useAppStore } from '../../store';
|
|
3
3
|
export function ToolboxSortSection({ column, columnId }) {
|
|
4
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
4
5
|
const dataQuery = useAppStore(s => s.dataQuery);
|
|
5
6
|
const sortParams = useAppStore(s => s.sortParams);
|
|
6
7
|
const setColumnSort = useAppStore(s => s.setColumnSort);
|
|
@@ -17,15 +18,15 @@ export function ToolboxSortSection({ column, columnId }) {
|
|
|
17
18
|
const sortClearIcon = columnIcons?.sortClear ?? globalIcons?.sortClear ?? (React.createElement("svg", { className: "bgrid-toolbox-icon", viewBox: "0 0 16 16", width: "14", height: "14", fill: "currentColor" },
|
|
18
19
|
React.createElement("path", { d: "M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z" })));
|
|
19
20
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-sort-section" },
|
|
20
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
21
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.sort ?? '정렬'),
|
|
21
22
|
React.createElement("div", { className: "bgrid-toolbox-menu-list" },
|
|
22
23
|
React.createElement("button", { type: "button", className: `bgrid-toolbox-menu-item ${isAsc ? 'active' : ''}`, onClick: () => setColumnSort(columnId, 'asc') },
|
|
23
24
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortAscIcon),
|
|
24
|
-
React.createElement("span", null,
|
|
25
|
+
React.createElement("span", null, toolboxMsg?.sortAscending ?? '오름차순 정렬')),
|
|
25
26
|
React.createElement("button", { type: "button", className: `bgrid-toolbox-menu-item ${isDesc ? 'active' : ''}`, onClick: () => setColumnSort(columnId, 'desc') },
|
|
26
27
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortDescIcon),
|
|
27
|
-
React.createElement("span", null,
|
|
28
|
+
React.createElement("span", null, toolboxMsg?.sortDescending ?? '내림차순 정렬')),
|
|
28
29
|
activeSortParam && (React.createElement("button", { type: "button", className: "bgrid-toolbox-menu-item bgrid-toolbox-menu-item-clear", onClick: () => setColumnSort(columnId, null) },
|
|
29
30
|
React.createElement("span", { className: "bgrid-toolbox-icon-wrapper" }, sortClearIcon),
|
|
30
|
-
React.createElement("span", null,
|
|
31
|
+
React.createElement("span", null, toolboxMsg?.clearSort ?? '정렬 초기화'))))));
|
|
31
32
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { useState, useEffect } from 'react';
|
|
3
3
|
import { useAppStore } from '../../store';
|
|
4
4
|
export function ToolboxTextFilterSection({ column, columnId }) {
|
|
5
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
5
6
|
const dataQuery = useAppStore(s => s.dataQuery);
|
|
6
7
|
const filterDrafts = useAppStore(s => s.filterDrafts);
|
|
7
8
|
const setFilterDraft = useAppStore(s => s.setFilterDraft);
|
|
@@ -47,15 +48,15 @@ export function ToolboxTextFilterSection({ column, columnId }) {
|
|
|
47
48
|
handleApply();
|
|
48
49
|
};
|
|
49
50
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-text-filter-section" },
|
|
50
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
51
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.textFilter ?? '텍스트 필터'),
|
|
51
52
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
52
53
|
React.createElement("select", { className: "bgrid-toolbox-select", value: operator, onChange: e => setOperator(e.target.value) },
|
|
53
|
-
React.createElement("option", { value: "contains" },
|
|
54
|
-
React.createElement("option", { value: "equals" },
|
|
55
|
-
React.createElement("option", { value: "notEquals" },
|
|
54
|
+
React.createElement("option", { value: "contains" }, toolboxMsg?.contains ?? '포함'),
|
|
55
|
+
React.createElement("option", { value: "equals" }, toolboxMsg?.equals ?? '일치'),
|
|
56
|
+
React.createElement("option", { value: "notEquals" }, toolboxMsg?.notEquals ?? '불일치'))),
|
|
56
57
|
React.createElement("div", { className: "bgrid-toolbox-form-row" },
|
|
57
|
-
React.createElement("input", { type: "text", className: "bgrid-toolbox-input", placeholder:
|
|
58
|
+
React.createElement("input", { type: "text", className: "bgrid-toolbox-input", placeholder: toolboxMsg?.textPlaceholder ?? '검색어 입력...', value: value, onChange: e => setValue(e.target.value), onKeyDown: handleApplyKeyDown })),
|
|
58
59
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
59
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
60
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply },
|
|
60
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, toolboxMsg?.clear ?? '초기화'),
|
|
61
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply }, toolboxMsg?.apply ?? '적용'))));
|
|
61
62
|
}
|
|
@@ -3,6 +3,7 @@ import { useState, useMemo, useEffect, useRef } from 'react';
|
|
|
3
3
|
import { useAppStore } from '../../store';
|
|
4
4
|
import { getCellValueByRowKey, filterRows, normalizeValueForFilter } from '../../utils';
|
|
5
5
|
export function ToolboxValueFilterSection({ column, columnId }) {
|
|
6
|
+
const toolboxMsg = useAppStore(s => s.msg?.toolbox);
|
|
6
7
|
const sourceData = useAppStore(s => (s.sourceData.length > 0 ? s.sourceData : s.data));
|
|
7
8
|
const columns = useAppStore(s => s.columns);
|
|
8
9
|
const dataQuery = useAppStore(s => s.dataQuery);
|
|
@@ -90,13 +91,13 @@ export function ToolboxValueFilterSection({ column, columnId }) {
|
|
|
90
91
|
const query = debouncedSearch.trim().toLowerCase();
|
|
91
92
|
return distinctValues.filter(val => {
|
|
92
93
|
const displayStr = val === null || val === undefined
|
|
93
|
-
? '(빈 값)'
|
|
94
|
+
? (toolboxMsg?.emptyValue ?? '(빈 값)')
|
|
94
95
|
: filterConfig?.formatValue
|
|
95
96
|
? String(filterConfig.formatValue(val))
|
|
96
97
|
: String(val);
|
|
97
98
|
return displayStr.toLowerCase().includes(query);
|
|
98
99
|
});
|
|
99
|
-
}, [debouncedSearch, distinctValues, filterConfig]);
|
|
100
|
+
}, [debouncedSearch, distinctValues, filterConfig, toolboxMsg?.emptyValue]);
|
|
100
101
|
const handleToggleValue = (val) => {
|
|
101
102
|
const next = new Set(selectedSet);
|
|
102
103
|
const norm = normalizeValueForFilter(val);
|
|
@@ -155,8 +156,8 @@ export function ToolboxValueFilterSection({ column, columnId }) {
|
|
|
155
156
|
};
|
|
156
157
|
if (isManual && distinctValues.length === 0) {
|
|
157
158
|
return (React.createElement("div", { className: "bgrid-toolbox-section" },
|
|
158
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
159
|
-
React.createElement("div", { className: "bgrid-toolbox-empty-notice" },
|
|
159
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.filter ?? '필터'),
|
|
160
|
+
React.createElement("div", { className: "bgrid-toolbox-empty-notice" }, toolboxMsg?.noValues ?? '사용 가능한 값 목록이 없습니다.')));
|
|
160
161
|
}
|
|
161
162
|
const maxDisplayItems = filterConfig?.maxValueListItems ?? 300;
|
|
162
163
|
const isListCapped = filteredDistinctValues.length > maxDisplayItems;
|
|
@@ -164,9 +165,9 @@ export function ToolboxValueFilterSection({ column, columnId }) {
|
|
|
164
165
|
? filteredDistinctValues.slice(0, maxDisplayItems)
|
|
165
166
|
: filteredDistinctValues;
|
|
166
167
|
return (React.createElement("div", { className: "bgrid-toolbox-section bgrid-toolbox-values-filter-section" },
|
|
167
|
-
React.createElement("div", { className: "bgrid-toolbox-section-title" },
|
|
168
|
+
React.createElement("div", { className: "bgrid-toolbox-section-title" }, toolboxMsg?.valueFilter ?? '값 필터'),
|
|
168
169
|
React.createElement("div", { className: "bgrid-toolbox-search-box" },
|
|
169
|
-
React.createElement("input", { type: "text", className: "bgrid-toolbox-search-input", placeholder:
|
|
170
|
+
React.createElement("input", { type: "text", className: "bgrid-toolbox-search-input", placeholder: toolboxMsg?.searchPlaceholder ?? '검색...', value: searchTerm, onChange: e => setSearchTerm(e.target.value) })),
|
|
170
171
|
React.createElement("div", { className: "bgrid-toolbox-values-container" },
|
|
171
172
|
React.createElement("div", { className: "bgrid-toolbox-select-all-row" },
|
|
172
173
|
React.createElement("label", { className: "bgrid-toolbox-checkbox-label" },
|
|
@@ -174,22 +175,19 @@ export function ToolboxValueFilterSection({ column, columnId }) {
|
|
|
174
175
|
if (el)
|
|
175
176
|
el.indeterminate = isIndeterminate;
|
|
176
177
|
}, onChange: e => handleSelectAll(e.target.checked) }),
|
|
177
|
-
React.createElement("span", null,
|
|
178
|
+
React.createElement("span", null, toolboxMsg?.selectAll ?? '(전체 선택)'))),
|
|
178
179
|
React.createElement("div", { className: "bgrid-toolbox-values-list" },
|
|
179
180
|
displayItems.map((val, idx) => {
|
|
180
181
|
const norm = normalizeValueForFilter(val);
|
|
181
182
|
const isChecked = selectedSet.has(norm);
|
|
182
|
-
const display = val === null || val === undefined ? (React.createElement("span", { className: "bgrid-toolbox-empty-value" },
|
|
183
|
+
const display = val === null || val === undefined ? (React.createElement("span", { className: "bgrid-toolbox-empty-value" }, toolboxMsg?.emptyValue ?? '(빈 값)')) : filterConfig?.formatValue ? (filterConfig.formatValue(val)) : (String(val));
|
|
183
184
|
return (React.createElement("label", { key: idx, className: "bgrid-toolbox-checkbox-label" },
|
|
184
185
|
React.createElement("input", { type: "checkbox", checked: isChecked, onChange: () => handleToggleValue(val) }),
|
|
185
186
|
React.createElement("span", { className: "bgrid-toolbox-value-text" }, display)));
|
|
186
187
|
}),
|
|
187
|
-
filteredDistinctValues.length === 0 && (React.createElement("div", { className: "bgrid-toolbox-empty-notice" },
|
|
188
|
-
isListCapped && (React.createElement("div", { className: "bgrid-toolbox-capped-notice" },
|
|
189
|
-
"+",
|
|
190
|
-
filteredDistinctValues.length - maxDisplayItems,
|
|
191
|
-
"\uAC1C \uD56D\uBAA9\uC774 \uB354 \uC788\uC2B5\uB2C8\uB2E4. \uAC80\uC0C9\uC744 \uC774\uC6A9\uD558\uC138\uC694.")))),
|
|
188
|
+
filteredDistinctValues.length === 0 && (React.createElement("div", { className: "bgrid-toolbox-empty-notice" }, toolboxMsg?.noResults ?? '검색 결과가 없습니다.')),
|
|
189
|
+
isListCapped && (React.createElement("div", { className: "bgrid-toolbox-capped-notice" }, toolboxMsg?.moreValues?.(filteredDistinctValues.length - maxDisplayItems) ?? `+${filteredDistinctValues.length - maxDisplayItems}개 항목이 더 있습니다. 검색을 이용하세요.`)))),
|
|
192
190
|
React.createElement("div", { className: "bgrid-toolbox-button-row" },
|
|
193
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear },
|
|
194
|
-
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply },
|
|
191
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-clear", onClick: handleClear }, toolboxMsg?.clear ?? '초기화'),
|
|
192
|
+
React.createElement("button", { type: "button", className: "bgrid-toolbox-btn bgrid-toolbox-btn-apply", onClick: handleApply }, toolboxMsg?.apply ?? '적용'))));
|
|
195
193
|
}
|
package/package.json
CHANGED
package/types/types.d.ts
CHANGED
|
@@ -665,6 +665,52 @@ export interface BGridRef {
|
|
|
665
665
|
*/
|
|
666
666
|
scrollToRow: (rowIndex: number, options?: BGridScrollToRowOptions) => void;
|
|
667
667
|
}
|
|
668
|
+
export interface BGridToolboxMessages {
|
|
669
|
+
sort?: string;
|
|
670
|
+
sortAscending?: string;
|
|
671
|
+
sortDescending?: string;
|
|
672
|
+
clearSort?: string;
|
|
673
|
+
filterApplied?: string;
|
|
674
|
+
openColumnOptions?: string;
|
|
675
|
+
filter?: string;
|
|
676
|
+
textFilter?: string;
|
|
677
|
+
valueFilter?: string;
|
|
678
|
+
numberFilter?: string;
|
|
679
|
+
contains?: string;
|
|
680
|
+
equals?: string;
|
|
681
|
+
notEquals?: string;
|
|
682
|
+
numberEquals?: string;
|
|
683
|
+
numberNotEquals?: string;
|
|
684
|
+
greaterThan?: string;
|
|
685
|
+
greaterThanOrEqual?: string;
|
|
686
|
+
lessThan?: string;
|
|
687
|
+
lessThanOrEqual?: string;
|
|
688
|
+
between?: string;
|
|
689
|
+
searchPlaceholder?: string;
|
|
690
|
+
textPlaceholder?: string;
|
|
691
|
+
numberPlaceholder?: string;
|
|
692
|
+
minimumPlaceholder?: string;
|
|
693
|
+
maximumPlaceholder?: string;
|
|
694
|
+
invalidRange?: string;
|
|
695
|
+
clear?: string;
|
|
696
|
+
apply?: string;
|
|
697
|
+
emptyValue?: string;
|
|
698
|
+
selectAll?: string;
|
|
699
|
+
noValues?: string;
|
|
700
|
+
noResults?: string;
|
|
701
|
+
extraMenu?: string;
|
|
702
|
+
columns?: string;
|
|
703
|
+
hiddenColumns?: string;
|
|
704
|
+
showAllColumns?: string;
|
|
705
|
+
hideThisColumn?: string;
|
|
706
|
+
lastVisibleColumn?: string;
|
|
707
|
+
hiddenColumnCount?: (count: number) => string;
|
|
708
|
+
moreValues?: (count: number) => string;
|
|
709
|
+
}
|
|
710
|
+
export interface BGridMessages {
|
|
711
|
+
emptyList?: string;
|
|
712
|
+
toolbox?: BGridToolboxMessages;
|
|
713
|
+
}
|
|
668
714
|
export interface BGridProps<T> {
|
|
669
715
|
ref?: React.Ref<BGridRef>;
|
|
670
716
|
width: number;
|
|
@@ -709,6 +755,48 @@ export interface BGridProps<T> {
|
|
|
709
755
|
onClick?: (params: BGridClickParams<T>) => void;
|
|
710
756
|
msg?: {
|
|
711
757
|
emptyList?: string;
|
|
758
|
+
toolbox?: {
|
|
759
|
+
sort?: string;
|
|
760
|
+
sortAscending?: string;
|
|
761
|
+
sortDescending?: string;
|
|
762
|
+
clearSort?: string;
|
|
763
|
+
filterApplied?: string;
|
|
764
|
+
openColumnOptions?: string;
|
|
765
|
+
filter?: string;
|
|
766
|
+
textFilter?: string;
|
|
767
|
+
valueFilter?: string;
|
|
768
|
+
numberFilter?: string;
|
|
769
|
+
contains?: string;
|
|
770
|
+
equals?: string;
|
|
771
|
+
notEquals?: string;
|
|
772
|
+
numberEquals?: string;
|
|
773
|
+
numberNotEquals?: string;
|
|
774
|
+
greaterThan?: string;
|
|
775
|
+
greaterThanOrEqual?: string;
|
|
776
|
+
lessThan?: string;
|
|
777
|
+
lessThanOrEqual?: string;
|
|
778
|
+
between?: string;
|
|
779
|
+
searchPlaceholder?: string;
|
|
780
|
+
textPlaceholder?: string;
|
|
781
|
+
numberPlaceholder?: string;
|
|
782
|
+
minimumPlaceholder?: string;
|
|
783
|
+
maximumPlaceholder?: string;
|
|
784
|
+
invalidRange?: string;
|
|
785
|
+
clear?: string;
|
|
786
|
+
apply?: string;
|
|
787
|
+
emptyValue?: string;
|
|
788
|
+
selectAll?: string;
|
|
789
|
+
noValues?: string;
|
|
790
|
+
noResults?: string;
|
|
791
|
+
extraMenu?: string;
|
|
792
|
+
columns?: string;
|
|
793
|
+
hiddenColumns?: string;
|
|
794
|
+
showAllColumns?: string;
|
|
795
|
+
hideThisColumn?: string;
|
|
796
|
+
lastVisibleColumn?: string;
|
|
797
|
+
hiddenColumnCount?: (count: number) => string;
|
|
798
|
+
moreValues?: (count: number) => string;
|
|
799
|
+
};
|
|
712
800
|
};
|
|
713
801
|
rowKey?: React.Key | React.Key[];
|
|
714
802
|
selectedRowKey?: React.Key | React.Key[];
|