@hpcc-js/tree 2.45.0 → 2.45.1

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.
@@ -1,310 +1,310 @@
1
- import { HTMLWidget, Palette, Platform, select as d3Select, Utility, } from "@hpcc-js/common";
2
- import { max as d3Max} from "d3-array";
3
- import { hierarchy as d3Hierarchy } from "d3-hierarchy";
4
-
5
- interface DirectoryItem {
6
- color?: string;
7
- iconClass?: string;
8
- label: string;
9
- depth: number;
10
- content?: string;
11
- markers?: any;
12
- isFolder: boolean;
13
- bold?: boolean;
14
- selected?: boolean;
15
- weightValue?: string;
16
- weightColor?: string;
17
- }
18
-
19
- export class DirectoryTree extends HTMLWidget {
20
-
21
- _palette;
22
-
23
- constructor() {
24
- super();
25
- }
26
-
27
- flattenData(json): DirectoryItem[] {
28
- const context = this;
29
- const root = d3Hierarchy(json);
30
- const ret = [];
31
-
32
- if (!this.omitRoot()) {
33
- visitNode(root);
34
- } else if (root.children) {
35
- root.children.forEach(visitNode);
36
- }
37
-
38
- return ret;
39
-
40
- function visitNode(node) {
41
- const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : "";
42
- ret.push({
43
- label: node.data.label,
44
- depth: node.depth - (context.omitRoot() ? 1 : 0),
45
- content: node.data.content,
46
- isFolder: !!node.data.children,
47
- iconClass: node.data.iconClass,
48
- color: node.data.color,
49
- bold: node.data.bold,
50
- weightValue,
51
- markers: node.data.markers,
52
- selected: node.data.selected
53
- });
54
- if (node.children) {
55
- node.children.forEach(visitNode);
56
- }
57
- }
58
- }
59
-
60
- protected iconClass(d) {
61
- if (d.label === "error") {
62
- return "fa fa-exclamation";
63
- }
64
- if (d.isFolder) {
65
- return this.folderIconOpen();
66
- }
67
- return this.textFileIcon();
68
- }
69
-
70
- protected calcRequiredWidth() {
71
- const flatData = this.flattenData(this.data());
72
-
73
- let widest = 0;
74
-
75
- const padding = this.rowItemPadding();
76
- const iconWidth = this.iconSize() + (padding * 2);
77
- const scrollbarWidth = Platform.getScrollbarWidth();
78
-
79
- flatData.forEach(row => {
80
- const offsetWidth = (row.depth * iconWidth) + (padding * 2);
81
- const textWidth = Utility.textSize(
82
- row.label,
83
- this.fontFamily(),
84
- this.fontSize(),
85
- !!row.bold
86
- ).width + (padding * 2);
87
- const totalWidth = textWidth + iconWidth + offsetWidth + scrollbarWidth;
88
- if (widest < totalWidth) {
89
- widest = totalWidth;
90
- }
91
- });
92
- return widest;
93
- }
94
-
95
- rowClick(str, markers) {}
96
-
97
- enter(domNode, element) {
98
- super.enter(domNode, element);
99
- element
100
- .style("width", "100%")
101
- .style("height", "100%")
102
- ;
103
- }
104
-
105
- update(domNode, element) {
106
- super.update(domNode, element);
107
-
108
- this._palette = this._palette.switch(this.paletteID());
109
-
110
- element
111
- .style("overflow-y", this.verticalScroll() ? "scroll" : null)
112
- ;
113
- const flatData = this.flattenData(this.data());
114
- const maxWeightValue = d3Max(flatData, n=>Number(n.weightValue));
115
-
116
- flatData.forEach(d=>{
117
- if(!d.weightValue){
118
- d.weightColor = "transparent";
119
- } else {
120
- d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);
121
- }
122
- });
123
- const context = this;
124
- const padding = this.rowItemPadding();
125
- const iconWidth = this.iconSize() + padding;
126
- const lineHeight = Math.max(context.iconSize(), context.fontSize());
127
- const rowSelection = element.selectAll(".directory-row").data(flatData);
128
- const fontFamily = this.fontFamily();
129
- const fontSize = this.fontSize();
130
- const maxWeightWidth = d3Max(flatData, d=>this.textSize(d.weightValue, fontFamily, fontSize).width);
131
- const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;
132
-
133
- const rowEnter = rowSelection.enter().append("div")
134
- .attr("class", d => `directory-row directory-row-depth-${d.depth}`)
135
- .style("display", "flex")
136
- .style("cursor", "pointer")
137
- .each(function (d: DirectoryItem) {
138
- const rowDiv = d3Select(this);
139
-
140
- const fontColor = d.color ? d.color : context.fontColor();
141
- const weightColor = d.weightColor ? d.weightColor : "transparent";
142
- const weightFontColor = Palette.textColor(weightColor);
143
-
144
- const weightDiv = rowDiv.append("div")
145
- .attr("class", "row-weight")
146
- .style("padding", rowItemPadding)
147
- .style("color", weightFontColor)
148
- .style("box-shadow", `inset 0 0 100px ${weightColor}`)
149
- .style("font-weight", d.bold ? "bold" : "normal")
150
- .style("font-family", fontFamily)
151
- .style("font-size", fontSize + "px")
152
- .text(d.weightValue)
153
- .attr("title", d.weightValue)
154
- .style("overflow", "hidden")
155
- .style("width", (maxWeightWidth + (padding * 2)) + "px")
156
- .style("text-overflow", "ellipsis")
157
- .style("text-align", "right")
158
- .style("line-height", lineHeight + "px")
159
- ;
160
- rowDiv.append("div")
161
- .attr("class", "row-depth")
162
- .style("width", (context.depthSize() * d.depth) + "px")
163
- .style("opacity", 1)
164
- .style("line-height", lineHeight + "px")
165
- ;
166
- const iconDiv = rowDiv.append("div")
167
- .attr("class", "row-icon " + (d.iconClass ? d.iconClass : context.iconClass(d)))
168
- .style("width", iconWidth + "px")
169
- .style("height", lineHeight + "px")
170
- .style("color", fontColor)
171
- .style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
172
- .style("font-size", context.iconSize() + "px")
173
- .style("padding", rowItemPadding)
174
- .style("line-height", lineHeight + "px")
175
- ;
176
- const labelDiv = rowDiv.append("div")
177
- .attr("class", "row-label")
178
- .style("padding", rowItemPadding)
179
- .style("color", fontColor)
180
- .style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
181
- .style("font-weight", d.bold ? "bold" : "normal")
182
- .style("font-family", context.fontFamily())
183
- .style("font-size", context.fontSize() + "px")
184
- .text(d.label)
185
- .attr("title", d.label)
186
- .style("flex", 1)
187
- .style("overflow", "hidden")
188
- .style("text-overflow", "ellipsis")
189
- .style("line-height", lineHeight + "px")
190
- ;
191
-
192
- rowDiv
193
- .on("mouseenter", () => {
194
- labelDiv.style("font-weight", "bold");
195
- })
196
- .on("mouseleave", () => {
197
- labelDiv.style("font-weight", d.bold ? "bold" : "normal");
198
- })
199
- ;
200
- weightDiv
201
- .on("mouseenter", () => {
202
- context.weight_mouseenter(d);
203
- })
204
- .on("mouseleave", () => {
205
- context.weight_mouseleave(d);
206
- })
207
- ;
208
-
209
- if (d.isFolder) {
210
- rowDiv.on("click", function (d: any) {
211
- let next = this.nextSibling;
212
- const wasClosed = rowDiv.classed("folder-closed");
213
- if (wasClosed) {
214
- rowDiv.classed("folder-closed", false);
215
- rowDiv.classed("folder-open", true);
216
- iconDiv.attr("class", "row-icon " + context.folderIconOpen());
217
- } else {
218
- rowDiv.classed("folder-closed", true);
219
- rowDiv.classed("folder-open", false);
220
- iconDiv.attr("class", "row-icon " + context.folderIconClosed());
221
- }
222
- while (next !== null) {
223
- const nextDepth = (d3Select(next).datum() as any).depth;
224
- if (nextDepth > d.depth) {
225
- next.style.display = wasClosed ? "flex" : "none";
226
- next = next.nextSibling;
227
- } else {
228
- next = null;
229
- }
230
- }
231
- });
232
- } else {
233
- rowDiv.on("click", () => {
234
- element.selectAll(".row-label").style("background-color", "transparent");
235
- element.selectAll(".row-icon").style("background-color", "transparent");
236
- iconDiv.style("background-color", context.selectionBackgroundColor());
237
- labelDiv.style("background-color", context.selectionBackgroundColor());
238
- const ext = d.label.split(".").pop().toLowerCase();
239
- context.rowClick(ext === "json" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);
240
- });
241
- }
242
- })
243
- ;
244
-
245
- rowEnter
246
- .merge(rowSelection)
247
- .style("background-color", context.backgroundColor())
248
- ;
249
-
250
- rowSelection.exit().remove();
251
- }
252
- weight_mouseenter(d){
253
-
254
- }
255
- weight_mouseleave(d){
256
-
257
- }
258
- }
259
- DirectoryTree.prototype._class += " tree_DirectoryTree";
260
-
261
- export interface DirectoryTree {
262
- backgroundColor(): string;
263
- backgroundColor(_: string): this;
264
- fontColor(): string;
265
- fontColor(_: string): this;
266
- fontFamily(): string;
267
- fontFamily(_: string): this;
268
- omitRoot(): boolean;
269
- omitRoot(_: boolean): this;
270
- fontSize(): number;
271
- fontSize(_: number): this;
272
- iconSize(): number;
273
- iconSize(_: number): this;
274
- fileIconSize(): number;
275
- fileIconSize(_: number): this;
276
- folderIconOpen(): string;
277
- folderIconOpen(_: string): this;
278
- folderIconClosed(): string;
279
- folderIconClosed(_: string): this;
280
- hoverBackgroundColor(): string;
281
- hoverBackgroundColor(_: string): this;
282
- selectionBackgroundColor(): string;
283
- selectionBackgroundColor(_: string): this;
284
- rowItemPadding(): number;
285
- rowItemPadding(_: number): this;
286
- textFileIcon(): string;
287
- textFileIcon(_: string): this;
288
- verticalScroll(): boolean;
289
- verticalScroll(_: boolean): this;
290
- paletteID(): string;
291
- paletteID(_: string): this;
292
- depthSize(): number;
293
- depthSize(_: number): this;
294
- }
295
- DirectoryTree.prototype._palette = Palette.rainbow("Blues");
296
-
297
- DirectoryTree.prototype.publish("depthSize", 14, "number", "Width of indentation per file or folder depth (pixels)");
298
- DirectoryTree.prototype.publish("paletteID", "Blues", "set", "Color palette for the weight backgrounds", DirectoryTree.prototype._palette.switch(), { tags: ["Basic"] });
299
- DirectoryTree.prototype.publish("omitRoot", false, "boolean", "If true, root node will not display");
300
- DirectoryTree.prototype.publish("rowItemPadding", 2, "number", "Top, bottom, left and right row item padding");
301
- DirectoryTree.prototype.publish("selectionBackgroundColor", "#CCC", "html-color", "Background color of selected directory rows");
302
- DirectoryTree.prototype.publish("backgroundColor", "#FFF", "html-color", "Directory item background color");
303
- DirectoryTree.prototype.publish("fontColor", "#000", "html-color", "Directory item font color");
304
- DirectoryTree.prototype.publish("fontFamily", "Arial", "string", "Directory item font family");
305
- DirectoryTree.prototype.publish("fontSize", 12, "number", "Directory item font size (pixels)");
306
- DirectoryTree.prototype.publish("iconSize", 12, "number", "Directory folder and file icon size (pixels)");
307
- DirectoryTree.prototype.publish("folderIconOpen", "fa fa-folder-open", "string", "Open folder icon class");
308
- DirectoryTree.prototype.publish("folderIconClosed", "fa fa-folder", "string", "Closed folder icon class");
309
- DirectoryTree.prototype.publish("textFileIcon", "fa fa-file-text-o", "string", "Text file icon class");
310
- DirectoryTree.prototype.publish("verticalScroll", true, "boolean", "If true, vertical scroll bar will be shown");
1
+ import { HTMLWidget, Palette, Platform, select as d3Select, Utility, } from "@hpcc-js/common";
2
+ import { max as d3Max} from "d3-array";
3
+ import { hierarchy as d3Hierarchy } from "d3-hierarchy";
4
+
5
+ interface DirectoryItem {
6
+ color?: string;
7
+ iconClass?: string;
8
+ label: string;
9
+ depth: number;
10
+ content?: string;
11
+ markers?: any;
12
+ isFolder: boolean;
13
+ bold?: boolean;
14
+ selected?: boolean;
15
+ weightValue?: string;
16
+ weightColor?: string;
17
+ }
18
+
19
+ export class DirectoryTree extends HTMLWidget {
20
+
21
+ _palette;
22
+
23
+ constructor() {
24
+ super();
25
+ }
26
+
27
+ flattenData(json): DirectoryItem[] {
28
+ const context = this;
29
+ const root = d3Hierarchy(json);
30
+ const ret = [];
31
+
32
+ if (!this.omitRoot()) {
33
+ visitNode(root);
34
+ } else if (root.children) {
35
+ root.children.forEach(visitNode);
36
+ }
37
+
38
+ return ret;
39
+
40
+ function visitNode(node) {
41
+ const weightValue = node.data.markers && node.data.markers.length ? node.data.markers.length : "";
42
+ ret.push({
43
+ label: node.data.label,
44
+ depth: node.depth - (context.omitRoot() ? 1 : 0),
45
+ content: node.data.content,
46
+ isFolder: !!node.data.children,
47
+ iconClass: node.data.iconClass,
48
+ color: node.data.color,
49
+ bold: node.data.bold,
50
+ weightValue,
51
+ markers: node.data.markers,
52
+ selected: node.data.selected
53
+ });
54
+ if (node.children) {
55
+ node.children.forEach(visitNode);
56
+ }
57
+ }
58
+ }
59
+
60
+ protected iconClass(d) {
61
+ if (d.label === "error") {
62
+ return "fa fa-exclamation";
63
+ }
64
+ if (d.isFolder) {
65
+ return this.folderIconOpen();
66
+ }
67
+ return this.textFileIcon();
68
+ }
69
+
70
+ protected calcRequiredWidth() {
71
+ const flatData = this.flattenData(this.data());
72
+
73
+ let widest = 0;
74
+
75
+ const padding = this.rowItemPadding();
76
+ const iconWidth = this.iconSize() + (padding * 2);
77
+ const scrollbarWidth = Platform.getScrollbarWidth();
78
+
79
+ flatData.forEach(row => {
80
+ const offsetWidth = (row.depth * iconWidth) + (padding * 2);
81
+ const textWidth = Utility.textSize(
82
+ row.label,
83
+ this.fontFamily(),
84
+ this.fontSize(),
85
+ !!row.bold
86
+ ).width + (padding * 2);
87
+ const totalWidth = textWidth + iconWidth + offsetWidth + scrollbarWidth;
88
+ if (widest < totalWidth) {
89
+ widest = totalWidth;
90
+ }
91
+ });
92
+ return widest;
93
+ }
94
+
95
+ rowClick(str, markers) {}
96
+
97
+ enter(domNode, element) {
98
+ super.enter(domNode, element);
99
+ element
100
+ .style("width", "100%")
101
+ .style("height", "100%")
102
+ ;
103
+ }
104
+
105
+ update(domNode, element) {
106
+ super.update(domNode, element);
107
+
108
+ this._palette = this._palette.switch(this.paletteID());
109
+
110
+ element
111
+ .style("overflow-y", this.verticalScroll() ? "scroll" : null)
112
+ ;
113
+ const flatData = this.flattenData(this.data());
114
+ const maxWeightValue = d3Max(flatData, n=>Number(n.weightValue));
115
+
116
+ flatData.forEach(d=>{
117
+ if(!d.weightValue){
118
+ d.weightColor = "transparent";
119
+ } else {
120
+ d.weightColor = this._palette(d.weightValue, 1, maxWeightValue);
121
+ }
122
+ });
123
+ const context = this;
124
+ const padding = this.rowItemPadding();
125
+ const iconWidth = this.iconSize() + padding;
126
+ const lineHeight = Math.max(context.iconSize(), context.fontSize());
127
+ const rowSelection = element.selectAll(".directory-row").data(flatData);
128
+ const fontFamily = this.fontFamily();
129
+ const fontSize = this.fontSize();
130
+ const maxWeightWidth = d3Max(flatData, d=>this.textSize(d.weightValue, fontFamily, fontSize).width);
131
+ const rowItemPadding = `${padding}px ${padding}px ${padding / 2}px ${padding}px`;
132
+
133
+ const rowEnter = rowSelection.enter().append("div")
134
+ .attr("class", d => `directory-row directory-row-depth-${d.depth}`)
135
+ .style("display", "flex")
136
+ .style("cursor", "pointer")
137
+ .each(function (d: DirectoryItem) {
138
+ const rowDiv = d3Select(this);
139
+
140
+ const fontColor = d.color ? d.color : context.fontColor();
141
+ const weightColor = d.weightColor ? d.weightColor : "transparent";
142
+ const weightFontColor = Palette.textColor(weightColor);
143
+
144
+ const weightDiv = rowDiv.append("div")
145
+ .attr("class", "row-weight")
146
+ .style("padding", rowItemPadding)
147
+ .style("color", weightFontColor)
148
+ .style("box-shadow", `inset 0 0 100px ${weightColor}`)
149
+ .style("font-weight", d.bold ? "bold" : "normal")
150
+ .style("font-family", fontFamily)
151
+ .style("font-size", fontSize + "px")
152
+ .text(d.weightValue)
153
+ .attr("title", d.weightValue)
154
+ .style("overflow", "hidden")
155
+ .style("width", (maxWeightWidth + (padding * 2)) + "px")
156
+ .style("text-overflow", "ellipsis")
157
+ .style("text-align", "right")
158
+ .style("line-height", lineHeight + "px")
159
+ ;
160
+ rowDiv.append("div")
161
+ .attr("class", "row-depth")
162
+ .style("width", (context.depthSize() * d.depth) + "px")
163
+ .style("opacity", 1)
164
+ .style("line-height", lineHeight + "px")
165
+ ;
166
+ const iconDiv = rowDiv.append("div")
167
+ .attr("class", "row-icon " + (d.iconClass ? d.iconClass : context.iconClass(d)))
168
+ .style("width", iconWidth + "px")
169
+ .style("height", lineHeight + "px")
170
+ .style("color", fontColor)
171
+ .style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
172
+ .style("font-size", context.iconSize() + "px")
173
+ .style("padding", rowItemPadding)
174
+ .style("line-height", lineHeight + "px")
175
+ ;
176
+ const labelDiv = rowDiv.append("div")
177
+ .attr("class", "row-label")
178
+ .style("padding", rowItemPadding)
179
+ .style("color", fontColor)
180
+ .style("background-color", d.selected ? context.selectionBackgroundColor() : "transparent")
181
+ .style("font-weight", d.bold ? "bold" : "normal")
182
+ .style("font-family", context.fontFamily())
183
+ .style("font-size", context.fontSize() + "px")
184
+ .text(d.label)
185
+ .attr("title", d.label)
186
+ .style("flex", 1)
187
+ .style("overflow", "hidden")
188
+ .style("text-overflow", "ellipsis")
189
+ .style("line-height", lineHeight + "px")
190
+ ;
191
+
192
+ rowDiv
193
+ .on("mouseenter", () => {
194
+ labelDiv.style("font-weight", "bold");
195
+ })
196
+ .on("mouseleave", () => {
197
+ labelDiv.style("font-weight", d.bold ? "bold" : "normal");
198
+ })
199
+ ;
200
+ weightDiv
201
+ .on("mouseenter", () => {
202
+ context.weight_mouseenter(d);
203
+ })
204
+ .on("mouseleave", () => {
205
+ context.weight_mouseleave(d);
206
+ })
207
+ ;
208
+
209
+ if (d.isFolder) {
210
+ rowDiv.on("click", function (d: any) {
211
+ let next = this.nextSibling;
212
+ const wasClosed = rowDiv.classed("folder-closed");
213
+ if (wasClosed) {
214
+ rowDiv.classed("folder-closed", false);
215
+ rowDiv.classed("folder-open", true);
216
+ iconDiv.attr("class", "row-icon " + context.folderIconOpen());
217
+ } else {
218
+ rowDiv.classed("folder-closed", true);
219
+ rowDiv.classed("folder-open", false);
220
+ iconDiv.attr("class", "row-icon " + context.folderIconClosed());
221
+ }
222
+ while (next !== null) {
223
+ const nextDepth = (d3Select(next).datum() as any).depth;
224
+ if (nextDepth > d.depth) {
225
+ next.style.display = wasClosed ? "flex" : "none";
226
+ next = next.nextSibling;
227
+ } else {
228
+ next = null;
229
+ }
230
+ }
231
+ });
232
+ } else {
233
+ rowDiv.on("click", () => {
234
+ element.selectAll(".row-label").style("background-color", "transparent");
235
+ element.selectAll(".row-icon").style("background-color", "transparent");
236
+ iconDiv.style("background-color", context.selectionBackgroundColor());
237
+ labelDiv.style("background-color", context.selectionBackgroundColor());
238
+ const ext = d.label.split(".").pop().toLowerCase();
239
+ context.rowClick(ext === "json" ? JSON.stringify(JSON.parse(d.content), null, 4) : d.content, d.markers);
240
+ });
241
+ }
242
+ })
243
+ ;
244
+
245
+ rowEnter
246
+ .merge(rowSelection)
247
+ .style("background-color", context.backgroundColor())
248
+ ;
249
+
250
+ rowSelection.exit().remove();
251
+ }
252
+ weight_mouseenter(d){
253
+
254
+ }
255
+ weight_mouseleave(d){
256
+
257
+ }
258
+ }
259
+ DirectoryTree.prototype._class += " tree_DirectoryTree";
260
+
261
+ export interface DirectoryTree {
262
+ backgroundColor(): string;
263
+ backgroundColor(_: string): this;
264
+ fontColor(): string;
265
+ fontColor(_: string): this;
266
+ fontFamily(): string;
267
+ fontFamily(_: string): this;
268
+ omitRoot(): boolean;
269
+ omitRoot(_: boolean): this;
270
+ fontSize(): number;
271
+ fontSize(_: number): this;
272
+ iconSize(): number;
273
+ iconSize(_: number): this;
274
+ fileIconSize(): number;
275
+ fileIconSize(_: number): this;
276
+ folderIconOpen(): string;
277
+ folderIconOpen(_: string): this;
278
+ folderIconClosed(): string;
279
+ folderIconClosed(_: string): this;
280
+ hoverBackgroundColor(): string;
281
+ hoverBackgroundColor(_: string): this;
282
+ selectionBackgroundColor(): string;
283
+ selectionBackgroundColor(_: string): this;
284
+ rowItemPadding(): number;
285
+ rowItemPadding(_: number): this;
286
+ textFileIcon(): string;
287
+ textFileIcon(_: string): this;
288
+ verticalScroll(): boolean;
289
+ verticalScroll(_: boolean): this;
290
+ paletteID(): string;
291
+ paletteID(_: string): this;
292
+ depthSize(): number;
293
+ depthSize(_: number): this;
294
+ }
295
+ DirectoryTree.prototype._palette = Palette.rainbow("Blues");
296
+
297
+ DirectoryTree.prototype.publish("depthSize", 14, "number", "Width of indentation per file or folder depth (pixels)");
298
+ DirectoryTree.prototype.publish("paletteID", "Blues", "set", "Color palette for the weight backgrounds", DirectoryTree.prototype._palette.switch(), { tags: ["Basic"] });
299
+ DirectoryTree.prototype.publish("omitRoot", false, "boolean", "If true, root node will not display");
300
+ DirectoryTree.prototype.publish("rowItemPadding", 2, "number", "Top, bottom, left and right row item padding");
301
+ DirectoryTree.prototype.publish("selectionBackgroundColor", "#CCC", "html-color", "Background color of selected directory rows");
302
+ DirectoryTree.prototype.publish("backgroundColor", "#FFF", "html-color", "Directory item background color");
303
+ DirectoryTree.prototype.publish("fontColor", "#000", "html-color", "Directory item font color");
304
+ DirectoryTree.prototype.publish("fontFamily", "Arial", "string", "Directory item font family");
305
+ DirectoryTree.prototype.publish("fontSize", 12, "number", "Directory item font size (pixels)");
306
+ DirectoryTree.prototype.publish("iconSize", 12, "number", "Directory folder and file icon size (pixels)");
307
+ DirectoryTree.prototype.publish("folderIconOpen", "fa fa-folder-open", "string", "Open folder icon class");
308
+ DirectoryTree.prototype.publish("folderIconClosed", "fa fa-folder", "string", "Closed folder icon class");
309
+ DirectoryTree.prototype.publish("textFileIcon", "fa fa-file-text-o", "string", "Text file icon class");
310
+ DirectoryTree.prototype.publish("verticalScroll", true, "boolean", "If true, vertical scroll bar will be shown");
package/src/Indented.css CHANGED
@@ -1,17 +1,17 @@
1
- .tree_Indented .node rect {
2
- cursor: pointer;
3
- fill: #fff;
4
- stroke: #3182bd;
5
- stroke-width: 1px;
6
- }
7
-
8
- .tree_Indented .node text {
9
- font: 10px sans-serif;
10
- pointer-events: none;
11
- }
12
-
13
- .tree_Indented path.link {
14
- fill: none;
15
- stroke: #9ecae1;
16
- stroke-width: 1.5px;
1
+ .tree_Indented .node rect {
2
+ cursor: pointer;
3
+ fill: #fff;
4
+ stroke: #3182bd;
5
+ stroke-width: 1px;
6
+ }
7
+
8
+ .tree_Indented .node text {
9
+ font: 10px sans-serif;
10
+ pointer-events: none;
11
+ }
12
+
13
+ .tree_Indented path.link {
14
+ fill: none;
15
+ stroke: #9ecae1;
16
+ stroke-width: 1.5px;
17
17
  }