beautiful-grid 1.0.17 → 1.0.19
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/README.md +1 -1
- package/cjs/components/ColResizer.js +7 -0
- package/cjs/components/Table.js +3 -1
- package/cjs/components/TableBody.js +2 -6
- package/esm/components/ColResizer.js +7 -0
- package/esm/components/Table.js +3 -1
- package/esm/components/TableBody.js +2 -6
- package/package.json +1 -1
- package/style.css +54 -3
package/README.md
CHANGED
|
@@ -1159,7 +1159,7 @@ Below is a categorized reference of `<BGrid>` props. For exact TypeScript types,
|
|
|
1159
1159
|
| `masterDetail` | `BGridMasterDetailOptions<T>` | Expands rows to display nested subgrids, forms, or custom detail panels. |
|
|
1160
1160
|
| `loading` | `boolean` | Displays full-grid loading overlay. |
|
|
1161
1161
|
| `spinning` | `boolean` | Displays body-area spinner. |
|
|
1162
|
-
| `msg` | `{ emptyList?: string }` | Custom empty state text.
|
|
1162
|
+
| `msg` | `{ emptyList?: string }` | Custom body-wide empty state text. It spans frozen and scrollable regions. |
|
|
1163
1163
|
|
|
1164
1164
|
---
|
|
1165
1165
|
|
|
@@ -130,6 +130,13 @@ function ColResizer(_a) {
|
|
|
130
130
|
table.style.tableLayout = 'auto';
|
|
131
131
|
table.style.width = 'max-content';
|
|
132
132
|
});
|
|
133
|
+
targetDiv.querySelectorAll('.bgrid-head-column, .bgrid-head-column-label, .bgrid-head-column-label-text').forEach(function (element) {
|
|
134
|
+
// The live header intentionally uses min-width: 0 for ellipsis. BestFit must measure the full label.
|
|
135
|
+
element.style.minWidth = 'max-content';
|
|
136
|
+
element.style.width = 'max-content';
|
|
137
|
+
element.style.overflow = 'visible';
|
|
138
|
+
element.style.textOverflow = 'clip';
|
|
139
|
+
});
|
|
133
140
|
bodyTarget = container.current;
|
|
134
141
|
bodyTarget.append(targetDiv);
|
|
135
142
|
return [4 /*yield*/, (0, utils_1.delay)(30)];
|
package/cjs/components/Table.js
CHANGED
|
@@ -238,7 +238,8 @@ function Table(props) {
|
|
|
238
238
|
scrollbar: s.scrollbar,
|
|
239
239
|
status: s.status,
|
|
240
240
|
pagination: s.pagination,
|
|
241
|
-
|
|
241
|
+
msg: s.msg,
|
|
242
|
+
}); })), rowChecked = _15.rowChecked, page = _15.page, loading = _15.loading, spinning = _15.spinning, disabled = _15.disabled, showLineNumber = _15.showLineNumber, summary = _15.summary, scrollbar = _15.scrollbar, status = _15.status, pagination = _15.pagination, msg = _15.msg;
|
|
242
243
|
var _16 = (0, store_1.useAppStore)((0, shallow_1.useShallow)(function (s) { return ({
|
|
243
244
|
searchOpen: s.searchOpen,
|
|
244
245
|
searchOptions: s.searchOptions,
|
|
@@ -2620,6 +2621,7 @@ function Table(props) {
|
|
|
2620
2621
|
React.createElement(Summary, { style: { left: frozenColumnsWidth }, role: 'rfdg-summary' },
|
|
2621
2622
|
React.createElement(TableSummary_1.TableSummary, { position: 'bottom' })))))),
|
|
2622
2623
|
React.createElement(BodyViewport, { ref: bodyContainerRef, style: { top: stickyTopHeight, height: contentBodyHeight }, "data-last": !page ? 'true' : undefined },
|
|
2624
|
+
data.length === 0 && (msg === null || msg === void 0 ? void 0 : msg.emptyList) ? (React.createElement("div", { className: 'bgrid-empty-state', role: 'status' }, msg.emptyList)) : null,
|
|
2623
2625
|
((_9 = rowReorderController.preview) === null || _9 === void 0 ? void 0 : _9.visible) && (React.createElement("div", { className: 'bgrid-row-reorder-preview', "data-bgrid-row-reorder-phase": rowReorderController.preview.phase, "aria-hidden": 'true' }, rowReorderController.preview.text)),
|
|
2624
2626
|
React.createElement(Loading_1.default, { active: !!spinning, size: 'small' })),
|
|
2625
2627
|
React.createElement("div", { className: 'bgrid-visually-hidden', role: 'status', "aria-live": 'polite', "aria-atomic": 'true' }, rowReorderController.announcement),
|
|
@@ -205,13 +205,12 @@ function TableBody(_a) {
|
|
|
205
205
|
}); })), editable = _j.editable, editTrigger = _j.editTrigger, disabled = _j.disabled, cellInteractionSession = _j.cellInteractionSession;
|
|
206
206
|
// [Selector Group 5] Display Options - 표시 옵션
|
|
207
207
|
var _k = (0, store_1.useAppStore)((0, shallow_1.useShallow)(function (s) { return ({
|
|
208
|
-
msg: s.msg,
|
|
209
208
|
getRowClassName: s.getRowClassName,
|
|
210
209
|
cellMergeOptions: s.cellMergeOptions,
|
|
211
210
|
variant: s.variant,
|
|
212
211
|
onClick: s.onClick,
|
|
213
212
|
sourceIndexByVisibleIndex: s.sourceIndexByVisibleIndex,
|
|
214
|
-
}); })),
|
|
213
|
+
}); })), getRowClassName = _k.getRowClassName, cellMergeOptions = _k.cellMergeOptions, variant = _k.variant, onClick = _k.onClick, sourceIndexByVisibleIndex = _k.sourceIndexByVisibleIndex;
|
|
215
214
|
var _l = (0, store_1.useAppStore)((0, shallow_1.useShallow)(function (s) { return ({
|
|
216
215
|
searchMatches: s.searchMatches,
|
|
217
216
|
activeSearchMatchIndex: s.activeSearchMatchIndex,
|
|
@@ -296,10 +295,7 @@ function TableBody(_a) {
|
|
|
296
295
|
React.createElement(TableBodyRow_1.TableBodyRow, { item: item, data: data, ri: ri, sourceIndex: sourceIndex, columns: columns, startCIdx: startCIdx, endCIdx: endCIdx, frozenColumnIndex: frozenColumnIndex, isLeftRegion: isLeftRegion, showLineNumber: showLineNumber !== null && showLineNumber !== void 0 ? showLineNumber : false, hasRowChecked: hasRowChecked, isRadio: Boolean(isRadio), checked: checkedAll === true || checkedIndexesMap.get(sourceIndex), rowCheckedDisabled: Boolean(disabled || ((_f = rowChecked === null || rowChecked === void 0 ? void 0 : rowChecked.disabled) === null || _f === void 0 ? void 0 : _f.call(rowChecked, sourceIndex, item))), rowStatus: rowStatus, active: active, className: className, resolvedRowHeight: resolvedRowHeight, itemHeight: itemHeight, itemPadding: itemPadding, editable: Boolean(editable), disabled: Boolean(disabled), editTrigger: editTrigger, hasOnClick: hasOnClick, cellMergeOptions: cellMergeOptions, mergeColumns: mergeColumns, odd: !mergeColumns ? ri % 2 === 0 : undefined, variant: variant, rowReorderEnabled: rowReorderEnabled, rowReorderRole: rowReorderRole, rowReorderPhase: reorderingInfo === null || reorderingInfo === void 0 ? void 0 : reorderingInfo.phase, rowReorderDirection: rowReorderDirection, rowReorderOffset: rowReorderOffset, reorder: reorder, reorderingInfo: reorderingInfo, searchMatchTokens: searchMatchTokens, currentSearchToken: currentSearchToken, isRowEditing: isRowEditing, cellInteractionSession: isRowEditing ? cellInteractionSession : undefined, handleClick: handleClick, setEditItem: setEditItem, setItemValue: setItemValue, handleMoveEditFocus: handleMoveEditFocus, handleChangeChecked: handleChangeChecked, handleChangeCheckedRadio: handleChangeCheckedRadio, getRowSpan: getRowSpan, onRowReorderPointerDown: onRowReorderPointerDown, onRowReorderKeyDown: onRowReorderKeyDown }),
|
|
297
296
|
detailHeight > 0 && (React.createElement(MasterDetailCell_1.MasterDetailRow, { item: item, sourceIndex: sourceIndex, visibleIndex: ri, detailHeight: detailHeight, isLeftRegion: isLeftRegion, viewportWidth: viewportWidth !== null && viewportWidth !== void 0 ? viewportWidth : Math.max(width - (frozenColumnsWidth !== null && frozenColumnsWidth !== void 0 ? frozenColumnsWidth : 0), 0), frozenColumnsWidth: frozenColumnsWidth !== null && frozenColumnsWidth !== void 0 ? frozenColumnsWidth : 0, colSpan: isLeftRegion ? Math.max(frozenColumnIndex, 1) : Math.max(columns.length - frozenColumnIndex, 1) }))));
|
|
298
297
|
}),
|
|
299
|
-
endNumber - startIdx < 1 &&
|
|
300
|
-
(isLeftRegion ? (React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding })) : (React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding }, (msg === null || msg === void 0 ? void 0 : msg.emptyList) ? (React.createElement(React.Fragment, null,
|
|
301
|
-
React.createElement("td", { className: 'bgrid-empty-cell', colSpan: columns.slice(frozenColumnIndex).length }, msg.emptyList),
|
|
302
|
-
React.createElement("td", { "data-none": true }))) : null))))));
|
|
298
|
+
endNumber - startIdx < 1 && React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding, "aria-hidden": 'true' }))));
|
|
303
299
|
}
|
|
304
300
|
function getRowStatusLabel(status) {
|
|
305
301
|
if (status === types_1.BGridDataItemStatus.new)
|
|
@@ -51,6 +51,13 @@ function ColResizer({ container, columnIndex, hideHandle, bordered, frozenBounda
|
|
|
51
51
|
table.style.tableLayout = 'auto';
|
|
52
52
|
table.style.width = 'max-content';
|
|
53
53
|
});
|
|
54
|
+
targetDiv.querySelectorAll('.bgrid-head-column, .bgrid-head-column-label, .bgrid-head-column-label-text').forEach(element => {
|
|
55
|
+
// The live header intentionally uses min-width: 0 for ellipsis. BestFit must measure the full label.
|
|
56
|
+
element.style.minWidth = 'max-content';
|
|
57
|
+
element.style.width = 'max-content';
|
|
58
|
+
element.style.overflow = 'visible';
|
|
59
|
+
element.style.textOverflow = 'clip';
|
|
60
|
+
});
|
|
54
61
|
const bodyTarget = container.current;
|
|
55
62
|
bodyTarget.append(targetDiv);
|
|
56
63
|
await delay(30);
|
package/esm/components/Table.js
CHANGED
|
@@ -90,7 +90,7 @@ function Table(props) {
|
|
|
90
90
|
handleClick: s.handleClick,
|
|
91
91
|
})));
|
|
92
92
|
// [Selector Group 5] State - 상태
|
|
93
|
-
const { rowChecked, page, loading, spinning, disabled, showLineNumber, summary, scrollbar, status, pagination } = useAppStore(useShallow(s => ({
|
|
93
|
+
const { rowChecked, page, loading, spinning, disabled, showLineNumber, summary, scrollbar, status, pagination, msg } = useAppStore(useShallow(s => ({
|
|
94
94
|
rowChecked: s.rowChecked,
|
|
95
95
|
page: s.page,
|
|
96
96
|
loading: s.loading,
|
|
@@ -101,6 +101,7 @@ function Table(props) {
|
|
|
101
101
|
scrollbar: s.scrollbar,
|
|
102
102
|
status: s.status,
|
|
103
103
|
pagination: s.pagination,
|
|
104
|
+
msg: s.msg,
|
|
104
105
|
})));
|
|
105
106
|
const { searchOpen, searchOptions, contextMenuOptions, activeSearchMatchIndex, searchMatches, storeSourceIndexByVisibleIndex, storeRowKey, cellInteractionSession, } = useAppStore(useShallow(s => ({
|
|
106
107
|
searchOpen: s.searchOpen,
|
|
@@ -2419,6 +2420,7 @@ function Table(props) {
|
|
|
2419
2420
|
React.createElement(Summary, { style: { left: frozenColumnsWidth }, role: 'rfdg-summary' },
|
|
2420
2421
|
React.createElement(TableSummary, { position: 'bottom' })))))),
|
|
2421
2422
|
React.createElement(BodyViewport, { ref: bodyContainerRef, style: { top: stickyTopHeight, height: contentBodyHeight }, "data-last": !page ? 'true' : undefined },
|
|
2423
|
+
data.length === 0 && msg?.emptyList ? (React.createElement("div", { className: 'bgrid-empty-state', role: 'status' }, msg.emptyList)) : null,
|
|
2422
2424
|
rowReorderController.preview?.visible && (React.createElement("div", { className: 'bgrid-row-reorder-preview', "data-bgrid-row-reorder-phase": rowReorderController.preview.phase, "aria-hidden": 'true' }, rowReorderController.preview.text)),
|
|
2423
2425
|
React.createElement(Loading, { active: !!spinning, size: 'small' })),
|
|
2424
2426
|
React.createElement("div", { className: 'bgrid-visually-hidden', role: 'status', "aria-live": 'polite', "aria-atomic": 'true' }, rowReorderController.announcement),
|
|
@@ -140,8 +140,7 @@ function TableBody({ rowKeyRegistry, region = 'main', rowRange, style, role, qua
|
|
|
140
140
|
cellInteractionSession: s.cellInteractionSession,
|
|
141
141
|
})));
|
|
142
142
|
// [Selector Group 5] Display Options - 표시 옵션
|
|
143
|
-
const {
|
|
144
|
-
msg: s.msg,
|
|
143
|
+
const { getRowClassName, cellMergeOptions, variant, onClick, sourceIndexByVisibleIndex } = useAppStore(useShallow(s => ({
|
|
145
144
|
getRowClassName: s.getRowClassName,
|
|
146
145
|
cellMergeOptions: s.cellMergeOptions,
|
|
147
146
|
variant: s.variant,
|
|
@@ -231,10 +230,7 @@ function TableBody({ rowKeyRegistry, region = 'main', rowRange, style, role, qua
|
|
|
231
230
|
React.createElement(TableBodyRow, { item: item, data: data, ri: ri, sourceIndex: sourceIndex, columns: columns, startCIdx: startCIdx, endCIdx: endCIdx, frozenColumnIndex: frozenColumnIndex, isLeftRegion: isLeftRegion, showLineNumber: showLineNumber ?? false, hasRowChecked: hasRowChecked, isRadio: Boolean(isRadio), checked: checkedAll === true || checkedIndexesMap.get(sourceIndex), rowCheckedDisabled: Boolean(disabled || rowChecked?.disabled?.(sourceIndex, item)), rowStatus: rowStatus, active: active, className: className, resolvedRowHeight: resolvedRowHeight, itemHeight: itemHeight, itemPadding: itemPadding, editable: Boolean(editable), disabled: Boolean(disabled), editTrigger: editTrigger, hasOnClick: hasOnClick, cellMergeOptions: cellMergeOptions, mergeColumns: mergeColumns, odd: !mergeColumns ? ri % 2 === 0 : undefined, variant: variant, rowReorderEnabled: rowReorderEnabled, rowReorderRole: rowReorderRole, rowReorderPhase: reorderingInfo?.phase, rowReorderDirection: rowReorderDirection, rowReorderOffset: rowReorderOffset, reorder: reorder, reorderingInfo: reorderingInfo, searchMatchTokens: searchMatchTokens, currentSearchToken: currentSearchToken, isRowEditing: isRowEditing, cellInteractionSession: isRowEditing ? cellInteractionSession : undefined, handleClick: handleClick, setEditItem: setEditItem, setItemValue: setItemValue, handleMoveEditFocus: handleMoveEditFocus, handleChangeChecked: handleChangeChecked, handleChangeCheckedRadio: handleChangeCheckedRadio, getRowSpan: getRowSpan, onRowReorderPointerDown: onRowReorderPointerDown, onRowReorderKeyDown: onRowReorderKeyDown }),
|
|
232
231
|
detailHeight > 0 && (React.createElement(MasterDetailRow, { item: item, sourceIndex: sourceIndex, visibleIndex: ri, detailHeight: detailHeight, isLeftRegion: isLeftRegion, viewportWidth: viewportWidth ?? Math.max(width - (frozenColumnsWidth ?? 0), 0), frozenColumnsWidth: frozenColumnsWidth ?? 0, colSpan: isLeftRegion ? Math.max(frozenColumnIndex, 1) : Math.max(columns.length - frozenColumnIndex, 1) }))));
|
|
233
232
|
}),
|
|
234
|
-
endNumber - startIdx < 1 &&
|
|
235
|
-
(isLeftRegion ? (React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding })) : (React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding }, msg?.emptyList ? (React.createElement(React.Fragment, null,
|
|
236
|
-
React.createElement("td", { className: 'bgrid-empty-cell', colSpan: columns.slice(frozenColumnIndex).length }, msg.emptyList),
|
|
237
|
-
React.createElement("td", { "data-none": true }))) : null))))));
|
|
233
|
+
endNumber - startIdx < 1 && React.createElement(NoDataTr, { itemHeight: itemHeight, itemPadding: itemPadding, "aria-hidden": 'true' }))));
|
|
238
234
|
}
|
|
239
235
|
function getRowStatusLabel(status) {
|
|
240
236
|
if (status === BGridDataItemStatus.new)
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -1886,10 +1886,20 @@
|
|
|
1886
1886
|
border-color: var(--bgrid-scroll-track-bg);
|
|
1887
1887
|
}
|
|
1888
1888
|
|
|
1889
|
-
.bgrid-empty-
|
|
1890
|
-
|
|
1891
|
-
|
|
1889
|
+
.bgrid-empty-state {
|
|
1890
|
+
position: absolute;
|
|
1891
|
+
inset: 0;
|
|
1892
|
+
z-index: 1;
|
|
1893
|
+
display: flex;
|
|
1894
|
+
box-sizing: border-box;
|
|
1895
|
+
align-items: center;
|
|
1896
|
+
justify-content: center;
|
|
1897
|
+
padding: 20px;
|
|
1898
|
+
overflow: hidden;
|
|
1899
|
+
color: var(--bgrid-body-color);
|
|
1900
|
+
background-color: var(--bgrid-body-bg);
|
|
1892
1901
|
text-align: center;
|
|
1902
|
+
pointer-events: none;
|
|
1893
1903
|
}
|
|
1894
1904
|
|
|
1895
1905
|
.bgrid-line-number-cell {
|
|
@@ -2629,12 +2639,53 @@
|
|
|
2629
2639
|
max-height: 100%;
|
|
2630
2640
|
}
|
|
2631
2641
|
|
|
2642
|
+
.bgrid-color-swatch {
|
|
2643
|
+
display: inline-block;
|
|
2644
|
+
width: 14px;
|
|
2645
|
+
height: 14px;
|
|
2646
|
+
box-sizing: border-box;
|
|
2647
|
+
border: 1px solid rgba(0, 0, 0, 0.18);
|
|
2648
|
+
border-radius: 3px;
|
|
2649
|
+
flex: 0 0 14px;
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
.bgrid-editor-icon .bgrid-color-swatch {
|
|
2653
|
+
margin: 0;
|
|
2654
|
+
}
|
|
2655
|
+
|
|
2656
|
+
[data-bgrid-theme='dark'] .bgrid-color-swatch,
|
|
2657
|
+
:root[data-theme='dark'] .bgrid-color-swatch {
|
|
2658
|
+
border-color: rgba(255, 255, 255, 0.22);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2632
2661
|
.bgrid-editor-icon:hover,
|
|
2633
2662
|
.bgrid-editor-icon:focus-visible {
|
|
2634
2663
|
background: var(--bgrid-body-hover-bg);
|
|
2635
2664
|
color: var(--bgrid-primary-color);
|
|
2636
2665
|
}
|
|
2637
2666
|
|
|
2667
|
+
.bgrid-editor-icon:has(.bgrid-color-swatch):hover,
|
|
2668
|
+
.bgrid-editor-icon:has(.bgrid-color-swatch):focus-visible {
|
|
2669
|
+
background: transparent;
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
.bgrid-editor-icon:hover .bgrid-color-swatch,
|
|
2673
|
+
.bgrid-editor-icon:focus-visible .bgrid-color-swatch,
|
|
2674
|
+
.bgrid-color-swatch:hover {
|
|
2675
|
+
border-color: rgba(0, 0, 0, 0.4);
|
|
2676
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
[data-bgrid-theme='dark'] .bgrid-editor-icon:hover .bgrid-color-swatch,
|
|
2680
|
+
[data-bgrid-theme='dark'] .bgrid-editor-icon:focus-visible .bgrid-color-swatch,
|
|
2681
|
+
[data-bgrid-theme='dark'] .bgrid-color-swatch:hover,
|
|
2682
|
+
:root[data-theme='dark'] .bgrid-editor-icon:hover .bgrid-color-swatch,
|
|
2683
|
+
:root[data-theme='dark'] .bgrid-editor-icon:focus-visible .bgrid-color-swatch,
|
|
2684
|
+
:root[data-theme='dark'] .bgrid-color-swatch:hover {
|
|
2685
|
+
border-color: rgba(255, 255, 255, 0.45);
|
|
2686
|
+
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2638
2689
|
.bgrid-editor-icon[hidden] {
|
|
2639
2690
|
display: none;
|
|
2640
2691
|
}
|