@teipublisher/pb-components 3.2.1 → 3.2.3
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 +14 -0
- package/dist/pb-components-bundle.js +50 -50
- package/i18n/common/en.json +21 -1
- package/package.json +1 -1
- package/src/pb-table-grid.js +18 -3
package/i18n/common/en.json
CHANGED
|
@@ -308,7 +308,27 @@
|
|
|
308
308
|
"incomplete": "marked same type but without key",
|
|
309
309
|
"unmarked": "unmarked occurrence in text",
|
|
310
310
|
"open-in-tab": "Open document in new tab to review"
|
|
311
|
-
}
|
|
311
|
+
},
|
|
312
|
+
"other-occ1": "Found matches in",
|
|
313
|
+
"other-occ2": "other documents",
|
|
314
|
+
"loading": "Loading ",
|
|
315
|
+
"loading-failed": "Failed to load",
|
|
316
|
+
"not-found": "Not found",
|
|
317
|
+
"user": "User",
|
|
318
|
+
"rev-desc": "Revision Description",
|
|
319
|
+
"change-summary": "Change summary",
|
|
320
|
+
"change-placeholder": "Optional short description",
|
|
321
|
+
"status": "Status",
|
|
322
|
+
"enrichment": "Enrichment",
|
|
323
|
+
"details": "Annotation Details",
|
|
324
|
+
"hi-bold": "bold",
|
|
325
|
+
"hi-i": "italic",
|
|
326
|
+
"markup": "Inline text/markup or sequence of paragraphs",
|
|
327
|
+
"select": "Select element around current cursor position",
|
|
328
|
+
"enclose": "Enclose selection in new element",
|
|
329
|
+
"enclose-remove": "Remove enclosing tags",
|
|
330
|
+
"insert-place": "Insert placeName",
|
|
331
|
+
"insert-person": "Insert persName"
|
|
312
332
|
},
|
|
313
333
|
"ner": {
|
|
314
334
|
"title": "Train a Named Entity Recognition Model",
|
package/package.json
CHANGED
package/src/pb-table-grid.js
CHANGED
|
@@ -111,6 +111,7 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
|
|
|
111
111
|
this._columns = [];
|
|
112
112
|
this._selectedRow = null;
|
|
113
113
|
this._gridI18nInitialized = false;
|
|
114
|
+
this._visibilityApplyFrame = null;
|
|
114
115
|
this._onTableClick = this._onTableClick.bind(this);
|
|
115
116
|
this._onDocumentClick = this._onDocumentClick.bind(this);
|
|
116
117
|
}
|
|
@@ -181,6 +182,10 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
|
|
|
181
182
|
}
|
|
182
183
|
|
|
183
184
|
disconnectedCallback() {
|
|
185
|
+
if (this._visibilityApplyFrame !== null) {
|
|
186
|
+
cancelAnimationFrame(this._visibilityApplyFrame);
|
|
187
|
+
this._visibilityApplyFrame = null;
|
|
188
|
+
}
|
|
184
189
|
document.removeEventListener('click', this._onDocumentClick);
|
|
185
190
|
super.disconnectedCallback();
|
|
186
191
|
}
|
|
@@ -255,16 +260,16 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
|
|
|
255
260
|
|
|
256
261
|
this.grid = new Grid(config);
|
|
257
262
|
this._applyPaginationPosition();
|
|
258
|
-
this.grid.on('
|
|
263
|
+
this.grid.on('ready', () => {
|
|
259
264
|
this._clearRowSelection();
|
|
260
265
|
if (this.paginationTop) {
|
|
261
|
-
// `forceRender()` can reset GridJS plugin state; re-apply after each
|
|
266
|
+
// `forceRender()` can reset GridJS plugin state; re-apply after each ready event.
|
|
262
267
|
this.grid.plugin.get('pagination').position = PluginPosition.Header;
|
|
263
268
|
}
|
|
264
269
|
this.emitTo('pb-results-received', {
|
|
265
270
|
params: this._params,
|
|
266
271
|
});
|
|
267
|
-
this.
|
|
272
|
+
this._scheduleColumnVisibilityReapply();
|
|
268
273
|
});
|
|
269
274
|
|
|
270
275
|
this.grid.render(table);
|
|
@@ -311,6 +316,16 @@ export class PbTableGrid extends themableMixin(pbMixin(LitElement)) {
|
|
|
311
316
|
});
|
|
312
317
|
}
|
|
313
318
|
|
|
319
|
+
_scheduleColumnVisibilityReapply() {
|
|
320
|
+
if (this._visibilityApplyFrame !== null) {
|
|
321
|
+
cancelAnimationFrame(this._visibilityApplyFrame);
|
|
322
|
+
}
|
|
323
|
+
this._visibilityApplyFrame = requestAnimationFrame(() => {
|
|
324
|
+
this._visibilityApplyFrame = null;
|
|
325
|
+
this._applyColumnVisibilityToDom();
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
|
|
314
329
|
_onTableClick(event) {
|
|
315
330
|
const row = event.target.closest('tbody tr');
|
|
316
331
|
if (!row) {
|