@matdata/yasr 5.2.0 → 5.3.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@matdata/yasr",
3
3
  "description": "Yet Another SPARQL Resultset GUI",
4
- "version": "5.2.0",
4
+ "version": "5.3.0",
5
5
  "main": "build/yasr.min.js",
6
6
  "types": "build/ts/src/index.d.ts",
7
7
  "license": "MIT",
@@ -13,6 +13,6 @@ export default function (result: Parser.SparqlResults) {
13
13
  ? querySolutions.map((s) => {
14
14
  return mapValues(s, (binding) => binding.value);
15
15
  })
16
- : []
16
+ : [],
17
17
  );
18
18
  }
@@ -57,7 +57,7 @@ function parseBoolean(node: Element) {
57
57
  }
58
58
  export default function (
59
59
  xmlString: string,
60
- postProcessBinding: Parser.PostProcessBinding
60
+ postProcessBinding: Parser.PostProcessBinding,
61
61
  ): Parser.SparqlResults | undefined {
62
62
  if (typeof xmlString !== "string") return;
63
63
  const domParser = new DOMParser();
@@ -0,0 +1,29 @@
1
+ declare module "column-resizer" {
2
+ interface ColumnResizerOptions {
3
+ liveDrag?: boolean;
4
+ draggingClass?: string;
5
+ gripInnerHtml?: string;
6
+ minWidth?: number;
7
+ headerOnly?: boolean;
8
+ hoverCursor?: string;
9
+ dragCursor?: string;
10
+ resizeMode?: "fit" | "overflow" | "flex";
11
+ widths?: number[];
12
+ partialRefresh?: boolean;
13
+ onResize?: (() => void) | boolean;
14
+ [key: string]: any;
15
+ }
16
+
17
+ interface ColumnResizerInstance {
18
+ reset(options: { disable: boolean; onResize?: () => void; partialRefresh?: boolean; headerOnly?: boolean }): void;
19
+ onResize: () => void;
20
+ }
21
+
22
+ class ColumnResizer implements ColumnResizerInstance {
23
+ constructor(table: HTMLElement, options?: ColumnResizerOptions);
24
+ reset(options: { disable: boolean; onResize?: () => void; partialRefresh?: boolean; headerOnly?: boolean }): void;
25
+ onResize: () => void;
26
+ }
27
+
28
+ export default ColumnResizer;
29
+ }
@@ -57,7 +57,7 @@ export default class Table implements Plugin<PluginConfig> {
57
57
  partialRefresh?: boolean;
58
58
  headerOnly?: boolean;
59
59
  }) => void;
60
- onResize: () => {};
60
+ onResize: () => void;
61
61
  }
62
62
  | undefined;
63
63
  public helpReference = "https://docs.triply.cc/yasgui/#table";
@@ -220,7 +220,7 @@ export default class Table implements Plugin<PluginConfig> {
220
220
  this.tableEl.style.removeProperty("width");
221
221
  this.tableEl.style.width = this.tableEl.clientWidth + "px";
222
222
  const widths = Array.from(this.tableEl.querySelectorAll("th")).map((h) => h.offsetWidth - 26);
223
- this.tableResizer = new ColumnResizer.default(this.tableEl, {
223
+ this.tableResizer = new ColumnResizer(this.tableEl, {
224
224
  widths: this.persistentConfig.compact === true ? widths : [this.getSizeFirstColumn(), ...widths.slice(1)],
225
225
  partialRefresh: true,
226
226
  onResize: this.persistentConfig.isEllipsed !== false && this.setEllipsisHandlers,