@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/README.md +128 -144
- package/build/ts/src/plugins/table/index.js +1 -1
- package/build/ts/src/plugins/table/index.js.map +1 -1
- package/build/yasr.min.css.map +1 -1
- package/build/yasr.min.js +1 -1
- package/build/yasr.min.js.map +2 -2
- package/package.json +1 -1
- package/src/bindingsToCsv.ts +1 -1
- package/src/parsers/xml.ts +1 -1
- package/src/plugins/table/column-resizer.d.ts +29 -0
- package/src/plugins/table/index.ts +2 -2
package/package.json
CHANGED
package/src/bindingsToCsv.ts
CHANGED
package/src/parsers/xml.ts
CHANGED
|
@@ -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
|
|
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,
|