x4js 1.4.27 → 1.4.30

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/lib/icon.js CHANGED
@@ -76,7 +76,8 @@ class Loader extends x4events_1.EventSource {
76
76
  if (r.ok) {
77
77
  const svg = await r.text();
78
78
  // check response, must be svg
79
- if (!svg.startsWith("<svg")) {
79
+ //TODO: find better
80
+ if (!svg.startsWith("<svg") && !svg.startsWith('<?xml')) {
80
81
  console.error("svg loading error: ", svg);
81
82
  this.signal('loaded', EvLoaded(url, ""));
82
83
  }
@@ -180,13 +181,10 @@ class Icon extends component_1.Component {
180
181
  let match_url = reUrl.exec(icon);
181
182
  if (match_url) {
182
183
  url = trimQuotes(match_url[1].trim());
183
- if (url.substring(0, 5) == 'data:') {
184
- this._setSVG(url);
185
- return;
186
- }
187
- else {
188
- name = url.replace(/[/\\\.\* ]/g, '_');
189
- }
184
+ // this value is escaped
185
+ url = url.replaceAll("\\", "");
186
+ this._setSVG(url);
187
+ return;
190
188
  }
191
189
  else {
192
190
  // todo: deprecated
package/lib/tools.js CHANGED
@@ -300,10 +300,9 @@ exports.escapeHtml = escapeHtml;
300
300
  * console.log( removeHtmlTags('<h1>sss</h1>') );
301
301
  */
302
302
  function removeHtmlTags(unsafe, nl_br = false) {
303
- if (!unsafe || unsafe.length == 0) {
304
- return unsafe;
303
+ if (unsafe === undefined || unsafe === null || !isString(unsafe) || unsafe.length == 0) {
304
+ return "";
305
305
  }
306
- debugger;
307
306
  let ret_val = '';
308
307
  for (let i = 0; i < unsafe.length; i++) {
309
308
  const ch = unsafe.codePointAt(i);
package/lib/treeview.js CHANGED
@@ -378,15 +378,14 @@ class TreeView extends layout_1.VLayout {
378
378
  return;
379
379
  }
380
380
  }
381
- this.m_selection = { id: nd.id, el: null };
382
- this.update();
381
+ this.selection = nd.id;
382
+ this.emit('click', (0, x4events_1.EvClick)(nd));
383
383
  this.emit('contextMenu', (0, x4events_1.EvContextMenu)(ev, nd));
384
384
  return;
385
385
  }
386
386
  dom = dom.parentElement;
387
387
  }
388
- this.m_selection = null;
389
- this.update();
388
+ this.selection = null;
390
389
  this.emit('contextMenu', (0, x4events_1.EvContextMenu)(ev, null));
391
390
  }
392
391
  /**
package/lib/x4.css CHANGED
@@ -31,7 +31,9 @@
31
31
  --x4-font-size: 13px;
32
32
  --x4-base-color: #266888;
33
33
  --x4-selection-color: #2458B3;
34
+ --x4-selection-text: white;
34
35
  --x4-hover-color: rgba(36, 88, 179, 0.9);
36
+ --x4-hover-text: white;
35
37
  --x4-mask-color: rgba(36, 88, 179, 0.6);
36
38
  --x4-focus-color: #2458B3;
37
39
  --x4-error-color: #b92a09;
@@ -758,11 +760,11 @@ textarea::selection {
758
760
  }
759
761
  .x-list-view .x-list-item:hover {
760
762
  background-color: var(--x4-hover-color);
761
- color: white;
763
+ color: var(--x4-hover-text);
762
764
  }
763
765
  .x-list-view .x-list-item.x-selected {
764
766
  background-color: var(--x4-selection-color);
765
- color: white;
767
+ color: var(--x4-selection-text);
766
768
  }
767
769
  .x-list-view .x-list-item:focus {
768
770
  outline: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.27",
3
+ "version": "1.4.30",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/treeview.ts CHANGED
@@ -520,20 +520,19 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
520
520
  return;
521
521
  }
522
522
  }
523
-
524
- this.m_selection = { id: nd.id, el: null };
525
- this.update( );
526
523
 
524
+ this.selection = nd.id;
525
+
526
+ this.emit('click', EvClick(nd) );
527
527
  this.emit('contextMenu', EvContextMenu(ev, nd));
528
+
528
529
  return;
529
530
  }
530
531
 
531
532
  dom = dom.parentElement;
532
533
  }
533
534
 
534
- this.m_selection = null;
535
- this.update( );
536
-
535
+ this.selection = null;
537
536
  this.emit('contextMenu', EvContextMenu(ev, null));
538
537
  }
539
538
 
package/src/x4.less CHANGED
@@ -36,7 +36,11 @@
36
36
  --x4-base-color: #266888;
37
37
 
38
38
  --x4-selection-color: #2458B3;
39
+ --x4-selection-text: white;
40
+
39
41
  --x4-hover-color: fadeout( #2458B3, 10% );
42
+ --x4-hover-text: white;
43
+
40
44
  --x4-mask-color: fadeout( #2458B3, 40% );
41
45
  --x4-focus-color: #2458B3;
42
46
  --x4-error-color: #b92a09;
@@ -947,12 +951,12 @@ textarea {
947
951
 
948
952
  &:hover {
949
953
  background-color: var( --x4-hover-color );
950
- color: white;
954
+ color: var( --x4-hover-text );
951
955
  }
952
956
 
953
957
  &.x-selected {
954
958
  background-color: var( --x4-selection-color );
955
- color: white;
959
+ color: var( --x4-selection-text );
956
960
  }
957
961
 
958
962
  &:focus {