@operato/data-grist 10.29.60 → 10.29.62
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/CHANGELOG.md +18 -0
- package/dist/src/data-grid/data-grid-body.d.ts +4 -0
- package/dist/src/data-grid/data-grid-body.js +53 -0
- package/dist/src/data-grid/data-grid-body.js.map +1 -1
- package/dist/src/data-grid/data-grid-header.js +9 -1
- package/dist/src/data-grid/data-grid-header.js.map +1 -1
- package/dist/src/renderers/index.d.ts +1 -0
- package/dist/src/renderers/index.js +1 -0
- package/dist/src/renderers/index.js.map +1 -1
- package/dist/src/renderers/ox-grist-renderer-sparkline.d.ts +30 -0
- package/dist/src/renderers/ox-grist-renderer-sparkline.js +103 -0
- package/dist/src/renderers/ox-grist-renderer-sparkline.js.map +1 -0
- package/dist/src/renderers/registry.js +2 -0
- package/dist/src/renderers/registry.js.map +1 -1
- package/dist/src/types.d.ts +6 -0
- package/dist/src/types.js.map +1 -1
- package/dist/test/field-hint.test.d.ts +2 -0
- package/dist/test/field-hint.test.js +54 -0
- package/dist/test/field-hint.test.js.map +1 -0
- package/dist/test/sparkline-renderer.test.d.ts +1 -0
- package/dist/test/sparkline-renderer.test.js +36 -0
- package/dist/test/sparkline-renderer.test.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/test/field-hint.test.ts +60 -0
- package/test/sparkline-renderer.test.ts +40 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
### [10.29.62](https://github.com/hatiolab/operato/compare/v10.29.61...v10.29.62) (2026-10-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/data-grist
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### [10.29.61](https://github.com/hatiolab/operato/compare/v10.29.60...v10.29.61) (2026-10-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### :rocket: New Features
|
|
18
|
+
|
|
19
|
+
* **data-grist:** a sparkline column - a series in a cell, a gap where a month has none ([795f8a2](https://github.com/hatiolab/operato/commit/795f8a2621cdb4d8512b641f016790b287123422))
|
|
20
|
+
* **data-grist:** record.hint - what a column takes, under the focused cell and on its header ([ea142bf](https://github.com/hatiolab/operato/commit/ea142bf2744e70d9aff6eb75394c8d5062aa0522))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
### [10.29.60](https://github.com/hatiolab/operato/compare/v10.29.59...v10.29.60) (2026-10-29)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -106,6 +106,10 @@ export declare class DataGridBody extends LitElement {
|
|
|
106
106
|
*/
|
|
107
107
|
private _imeBufferLabel;
|
|
108
108
|
/** IME buffer를 포커스된 셀 위에 위치시킨다 */
|
|
109
|
+
/** The focused cell's hint: its column's record.hint, while that cell can be edited and no block is selected. */
|
|
110
|
+
private _hintAt;
|
|
111
|
+
/** Under the focused cell, or over it when the space under it is out of the visible body. */
|
|
112
|
+
private _positionFieldHint;
|
|
109
113
|
private _positionIMEBuffer;
|
|
110
114
|
/** IME buffer 값을 field-change 이벤트로 커밋한다 */
|
|
111
115
|
_commitIMEBuffer(row: number, column: number): void;
|
|
@@ -155,6 +155,7 @@ let DataGridBody = class DataGridBody extends LitElement {
|
|
|
155
155
|
if (appendable) {
|
|
156
156
|
records = [...records, this.appendRecord];
|
|
157
157
|
}
|
|
158
|
+
const hint = this._hintAt(columns[focusedColumn], records[focusedRow], focusedRow);
|
|
158
159
|
if (accumulator) {
|
|
159
160
|
var accumRecord = this.buildAccumulatorRecord();
|
|
160
161
|
}
|
|
@@ -264,10 +265,12 @@ let DataGridBody = class DataGridBody extends LitElement {
|
|
|
264
265
|
aria-hidden is not the fix. Hiding the thing that holds focus makes focus vanish into
|
|
265
266
|
nothing. Instead of hiding it, name it after the cell it currently stands in for.
|
|
266
267
|
-->
|
|
268
|
+
<div id="field-hint" role="note" ?hidden=${!hint}>${hint || ''}</div>
|
|
267
269
|
<input
|
|
268
270
|
id="ime-buffer"
|
|
269
271
|
type="text"
|
|
270
272
|
aria-label=${this._imeBufferLabel(columns[focusedColumn])}
|
|
273
|
+
aria-describedby=${ifDefined(hint ? 'field-hint' : undefined)}
|
|
271
274
|
aria-activedescendant=${ifDefined(focusedRow >= 0 && focusedColumn >= 0 ? `cell-${focusedRow}-${focusedColumn}` : undefined)}
|
|
272
275
|
/>
|
|
273
276
|
<slot></slot>
|
|
@@ -587,6 +590,7 @@ let DataGridBody = class DataGridBody extends LitElement {
|
|
|
587
590
|
}
|
|
588
591
|
/* IME buffer 위치 업데이트 */
|
|
589
592
|
this._positionIMEBuffer();
|
|
593
|
+
this._positionFieldHint();
|
|
590
594
|
if (!this.editTarget && this._imeBuffer && !this._lastPointerTouch && this._hasEditableColumn) {
|
|
591
595
|
this._imeBuffer.focus({ preventScroll: true });
|
|
592
596
|
}
|
|
@@ -1097,6 +1101,31 @@ let DataGridBody = class DataGridBody extends LitElement {
|
|
|
1097
1101
|
: i18next.t('text.grid-cell-input-plain', { defaultValue: 'cell input' });
|
|
1098
1102
|
}
|
|
1099
1103
|
/** IME buffer를 포커스된 셀 위에 위치시킨다 */
|
|
1104
|
+
/** The focused cell's hint: its column's record.hint, while that cell can be edited and no block is selected. */
|
|
1105
|
+
_hintAt(column, record, row) {
|
|
1106
|
+
var _a;
|
|
1107
|
+
const hint = (_a = column === null || column === void 0 ? void 0 : column.record) === null || _a === void 0 ? void 0 : _a.hint;
|
|
1108
|
+
if (!hint || !record || this._selectBlock || column.gutterName)
|
|
1109
|
+
return undefined;
|
|
1110
|
+
let { editable } = column.record;
|
|
1111
|
+
if (typeof editable === 'function')
|
|
1112
|
+
editable = editable.call(this, record[column.name], column, record, row, this);
|
|
1113
|
+
return editable ? hint : undefined;
|
|
1114
|
+
}
|
|
1115
|
+
/** Under the focused cell, or over it when the space under it is out of the visible body. */
|
|
1116
|
+
_positionFieldHint() {
|
|
1117
|
+
var _a, _b;
|
|
1118
|
+
const hint = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector('#field-hint');
|
|
1119
|
+
const focusedEl = (_b = this.renderRoot) === null || _b === void 0 ? void 0 : _b.querySelector('[focused]');
|
|
1120
|
+
if (!hint || !focusedEl || hint.hidden)
|
|
1121
|
+
return;
|
|
1122
|
+
const below = focusedEl.offsetTop + focusedEl.offsetHeight;
|
|
1123
|
+
const scroller = this.scroller;
|
|
1124
|
+
const room = scroller.scrollTop + scroller.clientHeight - below;
|
|
1125
|
+
hint.style.left = focusedEl.offsetLeft + 'px';
|
|
1126
|
+
hint.style.minWidth = Math.min(focusedEl.offsetWidth, 320) + 'px';
|
|
1127
|
+
hint.style.top = (room < (hint.offsetHeight || 40) ? focusedEl.offsetTop - (hint.offsetHeight || 40) : below) + 'px';
|
|
1128
|
+
}
|
|
1100
1129
|
_positionIMEBuffer() {
|
|
1101
1130
|
var _a;
|
|
1102
1131
|
const focusedEl = (_a = this.renderRoot) === null || _a === void 0 ? void 0 : _a.querySelector('[focused]');
|
|
@@ -1278,6 +1307,30 @@ DataGridBody.styles = [
|
|
|
1278
1307
|
opacity: 1;
|
|
1279
1308
|
pointer-events: auto;
|
|
1280
1309
|
}
|
|
1310
|
+
|
|
1311
|
+
/* The focused cell's record.hint, under the cell while the grid has focus (§_positionFieldHint). */
|
|
1312
|
+
#field-hint {
|
|
1313
|
+
position: absolute;
|
|
1314
|
+
z-index: 11;
|
|
1315
|
+
display: none;
|
|
1316
|
+
max-width: 320px;
|
|
1317
|
+
box-sizing: border-box;
|
|
1318
|
+
padding: 4px 8px;
|
|
1319
|
+
border: 1px solid var(--ui-line, var(--md-sys-color-outline-variant));
|
|
1320
|
+
border-radius: var(--md-sys-shape-corner-small, 4px);
|
|
1321
|
+
background-color: var(--ui-surface, var(--md-sys-color-surface-container-high));
|
|
1322
|
+
color: var(--ui-muted, var(--md-sys-color-on-surface-variant));
|
|
1323
|
+
font-size: var(--ui-t-small, 11.5px);
|
|
1324
|
+
line-height: 1.5;
|
|
1325
|
+
white-space: normal;
|
|
1326
|
+
word-break: keep-all;
|
|
1327
|
+
overflow-wrap: anywhere;
|
|
1328
|
+
pointer-events: none;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
:host(:focus-within) #field-hint:not([hidden]) {
|
|
1332
|
+
display: block;
|
|
1333
|
+
}
|
|
1281
1334
|
`
|
|
1282
1335
|
];
|
|
1283
1336
|
__decorate([
|