x4js 1.4.52 → 1.4.53
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/{action.js → cjs/action.js} +0 -0
- package/lib/{application.js → cjs/application.js} +13 -19
- package/lib/{autocomplete.js → cjs/autocomplete.js} +0 -4
- package/lib/cjs/base_component.js +124 -0
- package/lib/{button.js → cjs/button.js} +4 -4
- package/lib/{calendar.js → cjs/calendar.js} +22 -22
- package/lib/{canvas.js → cjs/canvas.js} +7 -8
- package/lib/{cardview.js → cjs/cardview.js} +3 -5
- package/lib/{checkbox.js → cjs/checkbox.js} +6 -5
- package/lib/cjs/color.js +591 -0
- package/lib/{colorpicker.js → cjs/colorpicker.js} +1 -14
- package/lib/{combobox.js → cjs/combobox.js} +2 -6
- package/lib/{component.js → cjs/component.js} +16 -25
- package/lib/{datastore.js → cjs/datastore.js} +18 -32
- package/lib/{dialog.js → cjs/dialog.js} +4 -21
- package/lib/{dom_events.js → cjs/dom_events.js} +0 -0
- package/lib/{drag_manager.js → cjs/drag_manager.js} +0 -5
- package/lib/{drawtext.js → cjs/drawtext.js} +5 -4
- package/lib/{fileupload.js → cjs/fileupload.js} +0 -3
- package/lib/{form.js → cjs/form.js} +2 -6
- package/lib/{formatters.js → cjs/formatters.js} +0 -0
- package/lib/{gridview.js → cjs/gridview.js} +20 -33
- package/lib/{i18n.js → cjs/i18n.js} +0 -0
- package/lib/{icon.js → cjs/icon.js} +17 -11
- package/lib/{image.js → cjs/image.js} +4 -5
- package/lib/{index.js → cjs/index.js} +0 -0
- package/lib/cjs/input.js +174 -0
- package/lib/{label.js → cjs/label.js} +2 -1
- package/lib/{layout.js → cjs/layout.js} +9 -8
- package/lib/{link.js → cjs/link.js} +3 -2
- package/lib/cjs/listview.js +544 -0
- package/{src/md5.ts → lib/cjs/md5.js} +403 -438
- package/lib/{menu.js → cjs/menu.js} +4 -11
- package/lib/{messagebox.js → cjs/messagebox.js} +4 -4
- package/lib/{panel.js → cjs/panel.js} +3 -4
- package/lib/{popup.js → cjs/popup.js} +4 -5
- package/lib/{property_editor.js → cjs/property_editor.js} +2 -5
- package/lib/{radiobtn.js → cjs/radiobtn.js} +6 -6
- package/lib/{rating.js → cjs/rating.js} +7 -6
- package/lib/cjs/request.js +246 -0
- package/lib/{router.js → cjs/router.js} +0 -1
- package/lib/cjs/settings.js +69 -0
- package/lib/{sidebarview.js → cjs/sidebarview.js} +2 -3
- package/lib/{spreadsheet.js → cjs/spreadsheet.js} +10 -27
- package/lib/{styles.js → cjs/styles.js} +5 -6
- package/lib/{svgcomponent.js → cjs/svgcomponent.js} +3 -11
- package/lib/{tabbar.js → cjs/tabbar.js} +5 -5
- package/lib/{tabview.js → cjs/tabview.js} +0 -2
- package/lib/{textarea.js → cjs/textarea.js} +4 -3
- package/lib/{textedit.js → cjs/textedit.js} +7 -8
- package/lib/{toaster.js → cjs/toaster.js} +0 -2
- package/lib/{tools.js → cjs/tools.js} +7 -16
- package/lib/{tooltips.js → cjs/tooltips.js} +0 -1
- package/lib/{treeview.js → cjs/treeview.js} +23 -19
- package/lib/{action.d.ts → cjs/types/action.d.ts} +0 -0
- package/lib/{application.d.ts → cjs/types/application.d.ts} +0 -0
- package/lib/{autocomplete.d.ts → cjs/types/autocomplete.d.ts} +0 -0
- package/lib/{base_component.d.ts → cjs/types/base_component.d.ts} +0 -0
- package/lib/{button.d.ts → cjs/types/button.d.ts} +0 -0
- package/lib/{calendar.d.ts → cjs/types/calendar.d.ts} +0 -0
- package/lib/{canvas.d.ts → cjs/types/canvas.d.ts} +0 -0
- package/lib/{cardview.d.ts → cjs/types/cardview.d.ts} +0 -0
- package/lib/{checkbox.d.ts → cjs/types/checkbox.d.ts} +0 -0
- package/lib/{color.d.ts → cjs/types/color.d.ts} +0 -0
- package/lib/{colorpicker.d.ts → cjs/types/colorpicker.d.ts} +0 -0
- package/lib/{combobox.d.ts → cjs/types/combobox.d.ts} +0 -0
- package/lib/{component.d.ts → cjs/types/component.d.ts} +0 -0
- package/lib/{datastore.d.ts → cjs/types/datastore.d.ts} +0 -0
- package/lib/{dialog.d.ts → cjs/types/dialog.d.ts} +0 -0
- package/lib/{dom_events.d.ts → cjs/types/dom_events.d.ts} +0 -0
- package/lib/{drag_manager.d.ts → cjs/types/drag_manager.d.ts} +0 -0
- package/lib/{drawtext.d.ts → cjs/types/drawtext.d.ts} +0 -0
- package/lib/{fileupload.d.ts → cjs/types/fileupload.d.ts} +0 -0
- package/lib/{form.d.ts → cjs/types/form.d.ts} +0 -0
- package/lib/{formatters.d.ts → cjs/types/formatters.d.ts} +0 -0
- package/lib/{gridview.d.ts → cjs/types/gridview.d.ts} +0 -0
- package/lib/{i18n.d.ts → cjs/types/i18n.d.ts} +0 -0
- package/lib/{icon.d.ts → cjs/types/icon.d.ts} +0 -0
- package/lib/{image.d.ts → cjs/types/image.d.ts} +0 -0
- package/lib/{index.d.ts → cjs/types/index.d.ts} +0 -0
- package/lib/{input.d.ts → cjs/types/input.d.ts} +0 -0
- package/lib/{label.d.ts → cjs/types/label.d.ts} +0 -0
- package/lib/{layout.d.ts → cjs/types/layout.d.ts} +0 -0
- package/lib/{link.d.ts → cjs/types/link.d.ts} +0 -0
- package/lib/{listview.d.ts → cjs/types/listview.d.ts} +0 -0
- package/lib/{md5.d.ts → cjs/types/md5.d.ts} +0 -0
- package/lib/{menu.d.ts → cjs/types/menu.d.ts} +0 -0
- package/lib/{messagebox.d.ts → cjs/types/messagebox.d.ts} +0 -0
- package/lib/{panel.d.ts → cjs/types/panel.d.ts} +0 -0
- package/lib/{popup.d.ts → cjs/types/popup.d.ts} +0 -0
- package/lib/{property_editor.d.ts → cjs/types/property_editor.d.ts} +0 -0
- package/lib/{radiobtn.d.ts → cjs/types/radiobtn.d.ts} +0 -0
- package/lib/{rating.d.ts → cjs/types/rating.d.ts} +0 -0
- package/lib/{request.d.ts → cjs/types/request.d.ts} +0 -0
- package/lib/{router.d.ts → cjs/types/router.d.ts} +0 -0
- package/lib/{settings.d.ts → cjs/types/settings.d.ts} +0 -0
- package/lib/{sidebarview.d.ts → cjs/types/sidebarview.d.ts} +0 -0
- package/lib/{spreadsheet.d.ts → cjs/types/spreadsheet.d.ts} +0 -0
- package/lib/{styles.d.ts → cjs/types/styles.d.ts} +0 -0
- package/lib/{svgcomponent.d.ts → cjs/types/svgcomponent.d.ts} +0 -0
- package/lib/{tabbar.d.ts → cjs/types/tabbar.d.ts} +0 -0
- package/lib/{tabview.d.ts → cjs/types/tabview.d.ts} +0 -0
- package/lib/{textarea.d.ts → cjs/types/textarea.d.ts} +0 -0
- package/lib/{textedit.d.ts → cjs/types/textedit.d.ts} +0 -0
- package/lib/{toaster.d.ts → cjs/types/toaster.d.ts} +0 -0
- package/lib/{tools.d.ts → cjs/types/tools.d.ts} +0 -0
- package/lib/{tooltips.d.ts → cjs/types/tooltips.d.ts} +0 -0
- package/lib/{treeview.d.ts → cjs/types/treeview.d.ts} +0 -0
- package/lib/{version.d.ts → cjs/types/version.d.ts} +0 -0
- package/lib/{x4dom.d.ts → cjs/types/x4dom.d.ts} +0 -0
- package/lib/{x4events.d.ts → cjs/types/x4events.d.ts} +0 -0
- package/lib/{x4react.d.ts → cjs/types/x4react.d.ts} +0 -0
- package/lib/{version.js → cjs/version.js} +0 -0
- package/lib/{x4dom.js → cjs/x4dom.js} +0 -0
- package/lib/{x4events.js → cjs/x4events.js} +6 -11
- package/lib/{x4react.js → cjs/x4react.js} +1 -4
- package/lib/esm/action.js +53 -0
- package/lib/esm/application.js +184 -0
- package/lib/esm/autocomplete.js +155 -0
- package/lib/{base_component.js → esm/base_component.js} +3 -7
- package/lib/esm/button.js +257 -0
- package/lib/esm/calendar.js +244 -0
- package/lib/esm/canvas.js +358 -0
- package/lib/esm/cardview.js +159 -0
- package/lib/esm/checkbox.js +133 -0
- package/lib/{color.js → esm/color.js} +3 -7
- package/lib/esm/colorpicker.js +1475 -0
- package/lib/esm/combobox.js +259 -0
- package/lib/esm/component.js +1711 -0
- package/lib/esm/datastore.js +990 -0
- package/lib/esm/dialog.js +490 -0
- package/lib/{base64.d.ts → esm/dom_events.js} +2 -8
- package/lib/esm/drag_manager.js +147 -0
- package/lib/esm/drawtext.js +271 -0
- package/lib/esm/fileupload.js +163 -0
- package/lib/esm/form.js +297 -0
- package/lib/esm/formatters.js +81 -0
- package/lib/esm/gridview.js +889 -0
- package/lib/esm/i18n.js +257 -0
- package/lib/esm/icon.js +256 -0
- package/lib/esm/image.js +154 -0
- package/lib/esm/index.mjs +86 -0
- package/lib/{input.js → esm/input.js} +2 -6
- package/lib/esm/label.js +90 -0
- package/lib/esm/layout.js +310 -0
- package/lib/esm/link.js +59 -0
- package/lib/{listview.js → esm/listview.js} +30 -36
- package/lib/{md5.js → esm/md5.js} +1 -5
- package/lib/esm/menu.js +300 -0
- package/lib/esm/messagebox.js +145 -0
- package/lib/esm/panel.js +65 -0
- package/lib/esm/popup.js +379 -0
- package/lib/esm/property_editor.js +251 -0
- package/lib/esm/radiobtn.js +136 -0
- package/lib/esm/rating.js +97 -0
- package/lib/{request.js → esm/request.js} +9 -16
- package/lib/esm/router.js +136 -0
- package/lib/{settings.js → esm/settings.js} +1 -5
- package/lib/esm/sidebarview.js +79 -0
- package/lib/esm/spreadsheet.js +1091 -0
- package/lib/esm/styles.js +270 -0
- package/lib/esm/svgcomponent.js +422 -0
- package/lib/esm/tabbar.js +107 -0
- package/lib/esm/tabview.js +83 -0
- package/lib/esm/textarea.js +123 -0
- package/lib/esm/textedit.js +412 -0
- package/lib/esm/toaster.js +62 -0
- package/lib/esm/tools.js +1155 -0
- package/lib/esm/tooltips.js +153 -0
- package/lib/esm/treeview.js +495 -0
- package/lib/esm/types/action.d.ts +57 -0
- package/lib/esm/types/application.d.ts +104 -0
- package/lib/esm/types/autocomplete.d.ts +58 -0
- package/lib/esm/types/base_component.d.ts +88 -0
- package/lib/esm/types/button.d.ts +151 -0
- package/lib/esm/types/calendar.d.ts +81 -0
- package/lib/esm/types/canvas.d.ts +92 -0
- package/lib/esm/types/cardview.d.ts +87 -0
- package/lib/esm/types/checkbox.d.ts +77 -0
- package/lib/esm/types/color.d.ts +148 -0
- package/lib/esm/types/colorpicker.d.ts +107 -0
- package/lib/esm/types/combobox.d.ts +101 -0
- package/lib/esm/types/component.d.ts +601 -0
- package/lib/esm/types/datastore.d.ts +396 -0
- package/lib/esm/types/dialog.d.ts +175 -0
- package/lib/esm/types/dom_events.d.ts +302 -0
- package/lib/esm/types/drag_manager.d.ts +54 -0
- package/lib/esm/types/drawtext.d.ts +48 -0
- package/lib/esm/types/fileupload.d.ts +64 -0
- package/lib/esm/types/form.d.ts +126 -0
- package/lib/esm/types/formatters.d.ts +35 -0
- package/lib/esm/types/gridview.d.ts +175 -0
- package/lib/esm/types/i18n.d.ts +73 -0
- package/lib/esm/types/icon.d.ts +64 -0
- package/lib/esm/types/image.d.ts +55 -0
- package/lib/esm/types/index.d.ts +83 -0
- package/lib/esm/types/input.d.ts +91 -0
- package/lib/esm/types/label.d.ts +58 -0
- package/lib/esm/types/layout.d.ts +87 -0
- package/lib/esm/types/link.d.ts +50 -0
- package/lib/esm/types/listview.d.ts +178 -0
- package/lib/esm/types/md5.d.ts +61 -0
- package/lib/esm/types/menu.d.ts +130 -0
- package/lib/esm/types/messagebox.d.ts +68 -0
- package/lib/esm/types/panel.d.ts +47 -0
- package/lib/esm/types/popup.d.ts +75 -0
- package/lib/esm/types/property_editor.d.ts +71 -0
- package/lib/esm/types/radiobtn.d.ts +72 -0
- package/lib/esm/types/rating.d.ts +53 -0
- package/lib/esm/types/request.d.ts +52 -0
- package/lib/esm/types/router.d.ts +42 -0
- package/lib/esm/types/settings.d.ts +37 -0
- package/lib/esm/types/sidebarview.d.ts +49 -0
- package/lib/esm/types/spreadsheet.d.ts +218 -0
- package/lib/esm/types/styles.d.ts +85 -0
- package/lib/esm/types/svgcomponent.d.ts +191 -0
- package/lib/esm/types/tabbar.d.ts +58 -0
- package/lib/esm/types/tabview.d.ts +49 -0
- package/lib/{texthiliter.d.ts → esm/types/textarea.d.ts} +26 -23
- package/lib/esm/types/textedit.d.ts +123 -0
- package/lib/esm/types/toaster.d.ts +42 -0
- package/lib/esm/types/tools.d.ts +394 -0
- package/lib/esm/types/tooltips.d.ts +46 -0
- package/lib/esm/types/treeview.d.ts +132 -0
- package/lib/esm/types/version.d.ts +29 -0
- package/lib/esm/types/x4dom.d.ts +49 -0
- package/lib/{x4_events.d.ts → esm/types/x4events.d.ts} +6 -3
- package/lib/esm/types/x4react.d.ts +41 -0
- package/lib/esm/version.js +29 -0
- package/lib/esm/x4dom.js +29 -0
- package/lib/{x4_events.js → esm/x4events.js} +11 -24
- package/lib/esm/x4react.js +71 -0
- package/lib/{x4.css → styles/x4.css} +0 -0
- package/{src → lib/styles}/x4.less +0 -0
- package/package.json +35 -14
- package/build.sh +0 -5
- package/lib/base64.js +0 -143
- package/lib/hosts/host.d.ts +0 -44
- package/lib/hosts/host.js +0 -73
- package/lib/smartedit.d.ts +0 -107
- package/lib/smartedit.js +0 -390
- package/lib/texthiliter.js +0 -227
- package/src/MIT-license.md +0 -14
- package/src/action.ts +0 -88
- package/src/alpha.jpg +0 -0
- package/src/application.ts +0 -251
- package/src/autocomplete.ts +0 -197
- package/src/base64.ts +0 -166
- package/src/base_component.ts +0 -152
- package/src/button.ts +0 -355
- package/src/calendar.ts +0 -322
- package/src/canvas.ts +0 -505
- package/src/cardview.ts +0 -227
- package/src/checkbox.ts +0 -187
- package/src/color.ts +0 -752
- package/src/colorpicker.ts +0 -1639
- package/src/combobox.ts +0 -362
- package/src/component.ts +0 -2329
- package/src/datastore.ts +0 -1322
- package/src/dialog.ts +0 -656
- package/src/dom_events.ts +0 -315
- package/src/drag_manager.ts +0 -199
- package/src/drawtext.ts +0 -355
- package/src/fileupload.ts +0 -213
- package/src/form.ts +0 -366
- package/src/formatters.ts +0 -105
- package/src/gridview.ts +0 -1185
- package/src/i18n.ts +0 -346
- package/src/icon.ts +0 -329
- package/src/image.ts +0 -204
- package/src/index.ts +0 -88
- package/src/input.ts +0 -249
- package/src/label.ts +0 -128
- package/src/layout.ts +0 -430
- package/src/link.ts +0 -86
- package/src/listview.ts +0 -762
- package/src/menu.ts +0 -425
- package/src/messagebox.ts +0 -203
- package/src/panel.ts +0 -86
- package/src/popup.ts +0 -494
- package/src/property_editor.ts +0 -337
- package/src/radiobtn.ts +0 -196
- package/src/rating.ts +0 -135
- package/src/request.ts +0 -300
- package/src/router.ts +0 -185
- package/src/settings.ts +0 -77
- package/src/sidebarview.ts +0 -103
- package/src/spreadsheet.ts +0 -1442
- package/src/styles.ts +0 -343
- package/src/svgcomponent.ts +0 -537
- package/src/tabbar.ts +0 -151
- package/src/tabview.ts +0 -110
- package/src/textarea.ts +0 -187
- package/src/textedit.ts +0 -544
- package/src/toaster.ts +0 -80
- package/src/tools.ts +0 -1468
- package/src/tooltips.ts +0 -191
- package/src/treeview.ts +0 -675
- package/src/version.ts +0 -30
- package/src/x4dom.ts +0 -57
- package/src/x4events.ts +0 -585
- package/src/x4react.ts +0 -90
- package/tsconfig.json +0 -21
|
@@ -83,19 +83,8 @@ exports.EvFocus = EvFocus;
|
|
|
83
83
|
*
|
|
84
84
|
*/
|
|
85
85
|
class Component extends base_component_1.BaseComponent {
|
|
86
|
-
m_dom;
|
|
87
|
-
m_iprops;
|
|
88
|
-
static __sb_width; // scrollbar width
|
|
89
|
-
static __comp_guid = 1000; // component global unique id
|
|
90
|
-
static __privateEvents = {};
|
|
91
|
-
static __sizeObserver; // resize observer
|
|
92
|
-
static __createObserver; // creation observer
|
|
93
|
-
//private static __intersectionObserver: IntersectionObserver; // visibility observer
|
|
94
|
-
static __capture = null;
|
|
95
|
-
static __capture_mask = null;
|
|
96
|
-
static __css = null;
|
|
97
86
|
constructor(props = null) {
|
|
98
|
-
super(props
|
|
87
|
+
super(props !== null && props !== void 0 ? props : {});
|
|
99
88
|
this.m_iprops = {
|
|
100
89
|
classes: {},
|
|
101
90
|
dom_events: {},
|
|
@@ -118,7 +107,7 @@ class Component extends base_component_1.BaseComponent {
|
|
|
118
107
|
* @param content new content or null
|
|
119
108
|
*/
|
|
120
109
|
setContent(content, refreshAll = false) {
|
|
121
|
-
this.m_props.content = content
|
|
110
|
+
this.m_props.content = content !== null && content !== void 0 ? content : [];
|
|
122
111
|
if (this.m_iprops.inrender || !this.m_dom) {
|
|
123
112
|
return;
|
|
124
113
|
}
|
|
@@ -282,7 +271,7 @@ class Component extends base_component_1.BaseComponent {
|
|
|
282
271
|
*/
|
|
283
272
|
getComputedStyle(pseudoElt) {
|
|
284
273
|
if (this.dom) {
|
|
285
|
-
return new styles_1.ComputedStyle(getComputedStyle(this.dom, pseudoElt
|
|
274
|
+
return new styles_1.ComputedStyle(getComputedStyle(this.dom, pseudoElt !== null && pseudoElt !== void 0 ? pseudoElt : null));
|
|
286
275
|
}
|
|
287
276
|
return new styles_1.ComputedStyle(this.m_props.style);
|
|
288
277
|
}
|
|
@@ -535,6 +524,7 @@ class Component extends base_component_1.BaseComponent {
|
|
|
535
524
|
render(props) {
|
|
536
525
|
}
|
|
537
526
|
_createDOM() {
|
|
527
|
+
var _a, _b;
|
|
538
528
|
if (this.m_dom) {
|
|
539
529
|
return this.m_dom;
|
|
540
530
|
}
|
|
@@ -581,10 +571,10 @@ class Component extends base_component_1.BaseComponent {
|
|
|
581
571
|
// create self
|
|
582
572
|
let vdom = this.m_iprops;
|
|
583
573
|
if (props.ns) {
|
|
584
|
-
this.m_dom = x4dom_1.x4document.createElementNS(props.ns, props.tag
|
|
574
|
+
this.m_dom = x4dom_1.x4document.createElementNS(props.ns, (_a = props.tag) !== null && _a !== void 0 ? _a : 'div');
|
|
585
575
|
}
|
|
586
576
|
else {
|
|
587
|
-
this.m_dom = x4dom_1.x4document.createElement((props.tag
|
|
577
|
+
this.m_dom = x4dom_1.x4document.createElement(((_b = props.tag) !== null && _b !== void 0 ? _b : 'div'));
|
|
588
578
|
}
|
|
589
579
|
this.m_dom[_x4_el_sym] = this;
|
|
590
580
|
//let me = Object.getPrototypeOf(this);
|
|
@@ -886,13 +876,14 @@ class Component extends base_component_1.BaseComponent {
|
|
|
886
876
|
* called by the system
|
|
887
877
|
*/
|
|
888
878
|
static _dispatchEvent(ev) {
|
|
879
|
+
var _a;
|
|
889
880
|
let target = ev.target, noup = unbubbleEvents[ev.type] === 2;
|
|
890
881
|
while (target) {
|
|
891
882
|
if (target[_x4_el_store]) {
|
|
892
883
|
let store = target[_x4_el_store][ev.type];
|
|
893
884
|
if (store) {
|
|
894
885
|
let el = target[_x4_el_sym];
|
|
895
|
-
let root = el
|
|
886
|
+
let root = (_a = el === null || el === void 0 ? void 0 : el.root) !== null && _a !== void 0 ? _a : null;
|
|
896
887
|
if (store instanceof Array) {
|
|
897
888
|
store.some((fn) => {
|
|
898
889
|
fn(ev, root);
|
|
@@ -921,11 +912,12 @@ class Component extends base_component_1.BaseComponent {
|
|
|
921
912
|
* called by the system
|
|
922
913
|
*/
|
|
923
914
|
static _dispatchUnbubbleEvent(ev) {
|
|
915
|
+
var _a;
|
|
924
916
|
let target = ev.currentTarget || ev.target, eventType = ev.type;
|
|
925
917
|
let eventStore = target[_x4_el_store], store = eventStore && eventStore[eventType];
|
|
926
918
|
if (store) {
|
|
927
919
|
let el = target[_x4_el_sym];
|
|
928
|
-
let root = el
|
|
920
|
+
let root = (_a = el === null || el === void 0 ? void 0 : el.root) !== null && _a !== void 0 ? _a : null;
|
|
929
921
|
if (store instanceof Array) {
|
|
930
922
|
store.forEach((fn) => {
|
|
931
923
|
fn(ev, root);
|
|
@@ -1288,6 +1280,12 @@ class Component extends base_component_1.BaseComponent {
|
|
|
1288
1280
|
}
|
|
1289
1281
|
}
|
|
1290
1282
|
exports.Component = Component;
|
|
1283
|
+
Component.__comp_guid = 1000; // component global unique id
|
|
1284
|
+
Component.__privateEvents = {};
|
|
1285
|
+
//private static __intersectionObserver: IntersectionObserver; // visibility observer
|
|
1286
|
+
Component.__capture = null;
|
|
1287
|
+
Component.__capture_mask = null;
|
|
1288
|
+
Component.__css = null;
|
|
1291
1289
|
/** @ignore */
|
|
1292
1290
|
let fly_element = null;
|
|
1293
1291
|
/**
|
|
@@ -1323,7 +1321,6 @@ exports.Flex = Flex;
|
|
|
1323
1321
|
* simple space between 2 elements
|
|
1324
1322
|
*/
|
|
1325
1323
|
class Space extends Component {
|
|
1326
|
-
m_size;
|
|
1327
1324
|
constructor(size) {
|
|
1328
1325
|
super({});
|
|
1329
1326
|
this.m_size = size;
|
|
@@ -1356,9 +1353,6 @@ function EvSize(size, mode = null, context = null) {
|
|
|
1356
1353
|
}
|
|
1357
1354
|
exports.EvSize = EvSize;
|
|
1358
1355
|
class Separator extends Component {
|
|
1359
|
-
m_irect;
|
|
1360
|
-
m_delta;
|
|
1361
|
-
m_target;
|
|
1362
1356
|
constructor(props) {
|
|
1363
1357
|
super(props);
|
|
1364
1358
|
this.setDomEvent('mousedown', (e) => this._mousedown(e));
|
|
@@ -1500,8 +1494,6 @@ function EvOverlayResize(ui_event, sens, context = null) {
|
|
|
1500
1494
|
}
|
|
1501
1495
|
exports.EvOverlayResize = EvOverlayResize;
|
|
1502
1496
|
class SizerOverlay extends Component {
|
|
1503
|
-
m_delta;
|
|
1504
|
-
m_irect;
|
|
1505
1497
|
constructor(props) {
|
|
1506
1498
|
super(props);
|
|
1507
1499
|
this.addClass(props.sens);
|
|
@@ -1623,7 +1615,6 @@ function EvShortcut(name) {
|
|
|
1623
1615
|
* ])
|
|
1624
1616
|
*/
|
|
1625
1617
|
class Container extends Component {
|
|
1626
|
-
m_shortcuts;
|
|
1627
1618
|
constructor(props) {
|
|
1628
1619
|
if ((0, tools_1.isArray)(props)) {
|
|
1629
1620
|
super({ content: props });
|
|
@@ -40,9 +40,6 @@ function EvDataChange(type, id) {
|
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
class MetaInfos {
|
|
43
|
-
name;
|
|
44
|
-
id; // field name holding 'id' record info
|
|
45
|
-
fields; // field list
|
|
46
43
|
constructor(name) {
|
|
47
44
|
this.name = name;
|
|
48
45
|
this.id = undefined;
|
|
@@ -99,10 +96,7 @@ var data;
|
|
|
99
96
|
function field(data) {
|
|
100
97
|
return (ownerCls, fldName) => {
|
|
101
98
|
let metas = _getMetas(ownerCls);
|
|
102
|
-
metas.fields.push({
|
|
103
|
-
name: fldName,
|
|
104
|
-
...data
|
|
105
|
-
});
|
|
99
|
+
metas.fields.push(Object.assign({ name: fldName }, data));
|
|
106
100
|
};
|
|
107
101
|
}
|
|
108
102
|
data_1.field = field;
|
|
@@ -113,7 +107,7 @@ var data;
|
|
|
113
107
|
* my_field: string; // this field will be seen as a string
|
|
114
108
|
*/
|
|
115
109
|
function string(props) {
|
|
116
|
-
return field({
|
|
110
|
+
return field(Object.assign(Object.assign({}, props), { type: 'string' }));
|
|
117
111
|
}
|
|
118
112
|
data_1.string = string;
|
|
119
113
|
/**
|
|
@@ -123,7 +117,7 @@ var data;
|
|
|
123
117
|
* my_field: number; // this field will be seen as an integer
|
|
124
118
|
*/
|
|
125
119
|
function int(props) {
|
|
126
|
-
return field({
|
|
120
|
+
return field(Object.assign(Object.assign({}, props), { type: 'int' }));
|
|
127
121
|
}
|
|
128
122
|
data_1.int = int;
|
|
129
123
|
/**
|
|
@@ -133,7 +127,7 @@ var data;
|
|
|
133
127
|
* my_field: number; // this field will be seen as a float
|
|
134
128
|
*/
|
|
135
129
|
function float(props) {
|
|
136
|
-
return field({
|
|
130
|
+
return field(Object.assign(Object.assign({}, props), { type: 'float' }));
|
|
137
131
|
}
|
|
138
132
|
data_1.float = float;
|
|
139
133
|
/**
|
|
@@ -143,7 +137,7 @@ var data;
|
|
|
143
137
|
* my_field: boolean; // this field will be seen as a boolean
|
|
144
138
|
*/
|
|
145
139
|
function bool(props) {
|
|
146
|
-
return field({
|
|
140
|
+
return field(Object.assign(Object.assign({}, props), { type: 'bool' }));
|
|
147
141
|
}
|
|
148
142
|
data_1.bool = bool;
|
|
149
143
|
/**
|
|
@@ -153,7 +147,7 @@ var data;
|
|
|
153
147
|
* my_field: date; // this field will be seen as a date
|
|
154
148
|
*/
|
|
155
149
|
function date(props) {
|
|
156
|
-
return field({
|
|
150
|
+
return field(Object.assign(Object.assign({}, props), { type: 'date' }));
|
|
157
151
|
}
|
|
158
152
|
data_1.date = date;
|
|
159
153
|
/**
|
|
@@ -165,7 +159,7 @@ var data;
|
|
|
165
159
|
* };
|
|
166
160
|
*/
|
|
167
161
|
function calc(props) {
|
|
168
|
-
return field({
|
|
162
|
+
return field(Object.assign(Object.assign({}, props), { type: 'calc' }));
|
|
169
163
|
}
|
|
170
164
|
data_1.calc = calc;
|
|
171
165
|
/**
|
|
@@ -175,7 +169,7 @@ var data;
|
|
|
175
169
|
* my_field(): TypedRecord[];
|
|
176
170
|
*/
|
|
177
171
|
function array(ctor, props) {
|
|
178
|
-
return data.field({
|
|
172
|
+
return data.field(Object.assign(Object.assign({}, props), { type: 'array', model: new ctor() }));
|
|
179
173
|
}
|
|
180
174
|
data_1.array = array;
|
|
181
175
|
})(data = exports.data || (exports.data = {}));
|
|
@@ -381,8 +375,6 @@ exports.Record = Record;
|
|
|
381
375
|
* by default, the field id is rhe first member or the record
|
|
382
376
|
*/
|
|
383
377
|
class AutoRecord extends Record {
|
|
384
|
-
m_data;
|
|
385
|
-
m_fid;
|
|
386
378
|
constructor(data) {
|
|
387
379
|
super();
|
|
388
380
|
this.m_data = data;
|
|
@@ -410,7 +402,7 @@ class AutoRecord extends Record {
|
|
|
410
402
|
this.m_data[name] = data;
|
|
411
403
|
}
|
|
412
404
|
clone(data) {
|
|
413
|
-
return new AutoRecord({
|
|
405
|
+
return new AutoRecord(Object.assign({}, data));
|
|
414
406
|
}
|
|
415
407
|
}
|
|
416
408
|
exports.AutoRecord = AutoRecord;
|
|
@@ -460,11 +452,6 @@ exports.DataProxy = DataProxy;
|
|
|
460
452
|
*
|
|
461
453
|
*/
|
|
462
454
|
class DataStore extends x4events_1.EventSource {
|
|
463
|
-
m_model;
|
|
464
|
-
m_fields;
|
|
465
|
-
m_records;
|
|
466
|
-
m_proxy;
|
|
467
|
-
m_rec_index;
|
|
468
455
|
constructor(props) {
|
|
469
456
|
super();
|
|
470
457
|
this.m_fields = undefined;
|
|
@@ -640,7 +627,8 @@ class DataStore extends x4events_1.EventSource {
|
|
|
640
627
|
return this._getRecord(idx);
|
|
641
628
|
}
|
|
642
629
|
_getRecord(index) {
|
|
643
|
-
|
|
630
|
+
var _a;
|
|
631
|
+
return (_a = this.m_records[index]) !== null && _a !== void 0 ? _a : null;
|
|
644
632
|
}
|
|
645
633
|
moveTo(other) {
|
|
646
634
|
other.setRawData(this.m_records);
|
|
@@ -650,7 +638,7 @@ class DataStore extends x4events_1.EventSource {
|
|
|
650
638
|
* @param opts
|
|
651
639
|
*/
|
|
652
640
|
createView(opts) {
|
|
653
|
-
let eopts = {
|
|
641
|
+
let eopts = Object.assign(Object.assign({}, opts), { store: this });
|
|
654
642
|
return new DataView(eopts);
|
|
655
643
|
}
|
|
656
644
|
/**
|
|
@@ -800,8 +788,9 @@ class DataStore extends x4events_1.EventSource {
|
|
|
800
788
|
if (fidxs.length == 1) {
|
|
801
789
|
let field = fidxs[0].fidx;
|
|
802
790
|
index.sort((ia, ib) => {
|
|
803
|
-
|
|
804
|
-
let
|
|
791
|
+
var _a, _b;
|
|
792
|
+
let va = (_a = this.getByIndex(ia).getRaw(field)) !== null && _a !== void 0 ? _a : '';
|
|
793
|
+
let vb = (_b = this.getByIndex(ib).getRaw(field)) !== null && _b !== void 0 ? _b : '';
|
|
805
794
|
if (va > vb) {
|
|
806
795
|
return 1;
|
|
807
796
|
}
|
|
@@ -817,11 +806,12 @@ class DataStore extends x4events_1.EventSource {
|
|
|
817
806
|
}
|
|
818
807
|
else {
|
|
819
808
|
index.sort((ia, ib) => {
|
|
809
|
+
var _a, _b;
|
|
820
810
|
for (let fi = 0; fi < fidxs.length; fi++) {
|
|
821
811
|
let fidx = fidxs[fi].fidx;
|
|
822
812
|
let mul = fidxs[fi].asc ? 1 : -1;
|
|
823
|
-
let va = this.getByIndex(ia).getRaw(fidx)
|
|
824
|
-
let vb = this.getByIndex(ib).getRaw(fidx)
|
|
813
|
+
let va = (_a = this.getByIndex(ia).getRaw(fidx)) !== null && _a !== void 0 ? _a : '';
|
|
814
|
+
let vb = (_b = this.getByIndex(ib).getRaw(fidx)) !== null && _b !== void 0 ? _b : '';
|
|
825
815
|
if (va > vb) {
|
|
826
816
|
return mul;
|
|
827
817
|
}
|
|
@@ -873,10 +863,6 @@ exports.EvViewChange = EvViewChange;
|
|
|
873
863
|
* You can have multiple views for a single DataStore
|
|
874
864
|
*/
|
|
875
865
|
class DataView extends base_component_1.BaseComponent {
|
|
876
|
-
m_index;
|
|
877
|
-
m_store;
|
|
878
|
-
m_sort;
|
|
879
|
-
m_filter;
|
|
880
866
|
constructor(props) {
|
|
881
867
|
super(props);
|
|
882
868
|
this.m_store = props.store;
|
|
@@ -46,25 +46,8 @@ exports.EvBtnClick = EvBtnClick;
|
|
|
46
46
|
* Standard dialog class
|
|
47
47
|
*/
|
|
48
48
|
class Dialog extends popup_1.Popup {
|
|
49
|
-
m_icon;
|
|
50
|
-
m_title;
|
|
51
|
-
m_form;
|
|
52
|
-
m_buttons;
|
|
53
|
-
m_closable;
|
|
54
|
-
m_movable;
|
|
55
|
-
m_maximized;
|
|
56
|
-
m_minimized;
|
|
57
|
-
m_maximizable;
|
|
58
|
-
m_minimizable;
|
|
59
|
-
m_minFormSize;
|
|
60
|
-
m_rc_max;
|
|
61
|
-
m_rc_min;
|
|
62
|
-
m_el_title;
|
|
63
|
-
m_last_down;
|
|
64
|
-
m_auto_close;
|
|
65
|
-
m_ui_title;
|
|
66
|
-
m_form_cb;
|
|
67
49
|
constructor(props) {
|
|
50
|
+
var _a, _b, _c;
|
|
68
51
|
let content = props.content;
|
|
69
52
|
props.content = null;
|
|
70
53
|
let width = props.width;
|
|
@@ -92,11 +75,11 @@ class Dialog extends popup_1.Popup {
|
|
|
92
75
|
});
|
|
93
76
|
}
|
|
94
77
|
this.m_movable = props.movable;
|
|
95
|
-
this.m_auto_close = props.autoClose
|
|
78
|
+
this.m_auto_close = (_a = props.autoClose) !== null && _a !== void 0 ? _a : true;
|
|
96
79
|
this.m_icon = props.icon;
|
|
97
80
|
this.m_title = props.title;
|
|
98
|
-
this.m_buttons = props.buttons
|
|
99
|
-
this.m_closable = props.closable
|
|
81
|
+
this.m_buttons = (_b = props.buttons) !== null && _b !== void 0 ? _b : null;
|
|
82
|
+
this.m_closable = (_c = props.closable) !== null && _c !== void 0 ? _c : false;
|
|
100
83
|
this.m_last_down = 0;
|
|
101
84
|
this.on('size', (ev) => {
|
|
102
85
|
this.addClass('@resized');
|
|
File without changes
|
|
@@ -49,12 +49,13 @@ const defStyle = {
|
|
|
49
49
|
lineBreak: true,
|
|
50
50
|
};
|
|
51
51
|
function drawText(ctx, input_Text, rc, drawStyle) {
|
|
52
|
+
var _a, _b, _c;
|
|
52
53
|
if (rc.width <= 0 || rc.height <= 0) {
|
|
53
54
|
//width or height or font size cannot be 0
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
57
|
//console.time( 'drawtext' );
|
|
57
|
-
drawStyle = {
|
|
58
|
+
drawStyle = Object.assign(Object.assign({}, defStyle), drawStyle);
|
|
58
59
|
ctx.save();
|
|
59
60
|
if (drawStyle.clip) {
|
|
60
61
|
ctx.beginPath();
|
|
@@ -73,7 +74,7 @@ function drawText(ctx, input_Text, rc, drawStyle) {
|
|
|
73
74
|
}
|
|
74
75
|
ctx.textBaseline = 'bottom';
|
|
75
76
|
// End points
|
|
76
|
-
let fontSize = (0, tools_1.roundTo)(drawStyle.fontSize, 2)
|
|
77
|
+
let fontSize = (_a = (0, tools_1.roundTo)(drawStyle.fontSize, 2)) !== null && _a !== void 0 ? _a : 12;
|
|
77
78
|
//let style = `${drawStyle.fontStyle ?? ''} ${drawStyle.fontVariant ?? ''} ${drawStyle.fontWeight ?? ''} ${fontSize}px ${drawStyle.fontFamily ?? 'arial'}`;
|
|
78
79
|
let style = '';
|
|
79
80
|
if (drawStyle.fontStyle) {
|
|
@@ -86,7 +87,7 @@ function drawText(ctx, input_Text, rc, drawStyle) {
|
|
|
86
87
|
style += drawStyle.fontWeight + ' ';
|
|
87
88
|
}
|
|
88
89
|
style += fontSize + 'px ';
|
|
89
|
-
let family = drawStyle.fontFamily
|
|
90
|
+
let family = (_b = drawStyle.fontFamily) !== null && _b !== void 0 ? _b : 'sans-serif';
|
|
90
91
|
if (family.indexOf('.') > 0) {
|
|
91
92
|
family = '"' + family + '"';
|
|
92
93
|
}
|
|
@@ -156,7 +157,7 @@ function drawText(ctx, input_Text, rc, drawStyle) {
|
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
const textSize = _calcTextHeight(ctx, "Ag");
|
|
159
|
-
let lineHeight = (drawStyle.lineHeight
|
|
160
|
+
let lineHeight = ((_c = drawStyle.lineHeight) !== null && _c !== void 0 ? _c : 1.3) * textSize; // * 1.2 = map to pdf
|
|
160
161
|
const nlines = textarray.length;
|
|
161
162
|
// calc vertical Align
|
|
162
163
|
let col_top = rc.top;
|
|
@@ -40,11 +40,6 @@ const i18n_1 = require("./i18n");
|
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
class Form extends layout_1.VLayout {
|
|
43
|
-
m_height;
|
|
44
|
-
m_container;
|
|
45
|
-
m_buttons;
|
|
46
|
-
m_dirty;
|
|
47
|
-
m_watchChanges;
|
|
48
43
|
constructor(props) {
|
|
49
44
|
let content = props.content;
|
|
50
45
|
props.content = null;
|
|
@@ -121,7 +116,8 @@ class Form extends layout_1.VLayout {
|
|
|
121
116
|
* @param name
|
|
122
117
|
*/
|
|
123
118
|
getButton(name) {
|
|
124
|
-
|
|
119
|
+
var _a;
|
|
120
|
+
let button = (_a = this.m_buttons) === null || _a === void 0 ? void 0 : _a.itemWithRef('@' + name);
|
|
125
121
|
return button;
|
|
126
122
|
}
|
|
127
123
|
/**
|
|
File without changes
|
|
@@ -48,8 +48,6 @@ function EvGridCheck(rec, chk) {
|
|
|
48
48
|
}
|
|
49
49
|
exports.EvGridCheck = EvGridCheck;
|
|
50
50
|
class ColHeader extends component_1.Component {
|
|
51
|
-
m_sens;
|
|
52
|
-
m_sorted;
|
|
53
51
|
constructor(props, title) {
|
|
54
52
|
super(props);
|
|
55
53
|
this.m_sorted = false;
|
|
@@ -93,27 +91,11 @@ class ColHeader extends component_1.Component {
|
|
|
93
91
|
* gridview class
|
|
94
92
|
*/
|
|
95
93
|
class GridView extends layout_1.VLayout {
|
|
96
|
-
m_dataview;
|
|
97
|
-
m_data_cx;
|
|
98
|
-
m_columns;
|
|
99
|
-
m_view_el;
|
|
100
|
-
m_container;
|
|
101
|
-
m_header;
|
|
102
|
-
m_footer;
|
|
103
|
-
m_empty_msg;
|
|
104
|
-
m_empty_text;
|
|
105
|
-
m_selection;
|
|
106
|
-
m_itemHeight;
|
|
107
|
-
m_topIndex;
|
|
108
|
-
m_visible_rows; // shown elements
|
|
109
|
-
m_hasMarks;
|
|
110
|
-
m_marks; // checked elements
|
|
111
|
-
m_recycler;
|
|
112
|
-
m_rowClassifier;
|
|
113
94
|
constructor(props) {
|
|
95
|
+
var _a, _b;
|
|
114
96
|
super(props);
|
|
115
97
|
this.m_columns = props.columns;
|
|
116
|
-
this.m_hasMarks = props.hasMarks
|
|
98
|
+
this.m_hasMarks = (_a = props.hasMarks) !== null && _a !== void 0 ? _a : false;
|
|
117
99
|
this.m_marks = new Set();
|
|
118
100
|
// prepend the checkable column
|
|
119
101
|
if (this.m_hasMarks) {
|
|
@@ -129,7 +111,7 @@ class GridView extends layout_1.VLayout {
|
|
|
129
111
|
this.m_itemHeight = 0;
|
|
130
112
|
this.m_recycler = [];
|
|
131
113
|
this.m_rowClassifier = props.calcRowClass;
|
|
132
|
-
this.m_empty_text = props.empty_text
|
|
114
|
+
this.m_empty_text = (_b = props.empty_text) !== null && _b !== void 0 ? _b : i18n_1._tr.global.empty_list;
|
|
133
115
|
//this.setDomEvent('create', this._handleCreate, this);
|
|
134
116
|
this.setDomEvent('click', (e) => this._itemClick(e));
|
|
135
117
|
this.setDomEvent('dblclick', (e) => this._itemDblClick(e));
|
|
@@ -347,7 +329,8 @@ class GridView extends layout_1.VLayout {
|
|
|
347
329
|
// compute full width
|
|
348
330
|
let full_width = 0;
|
|
349
331
|
this.m_columns.forEach((col) => {
|
|
350
|
-
|
|
332
|
+
var _a;
|
|
333
|
+
full_width += (_a = col.width) !== null && _a !== void 0 ? _a : 0;
|
|
351
334
|
});
|
|
352
335
|
this.m_header = new layout_1.HLayout({
|
|
353
336
|
cls: '@header',
|
|
@@ -399,20 +382,21 @@ class GridView extends layout_1.VLayout {
|
|
|
399
382
|
]);
|
|
400
383
|
}
|
|
401
384
|
_on_col_resize(col, width) {
|
|
385
|
+
var _a, _b, _c, _d;
|
|
402
386
|
const _col = this.m_columns[col];
|
|
403
387
|
let updateFlex = false;
|
|
404
388
|
if (width >= 0) {
|
|
405
389
|
_col.width = width;
|
|
406
390
|
if (_col.flex) {
|
|
407
391
|
_col.$hdr.removeClass('@flex');
|
|
408
|
-
_col.$ftr
|
|
392
|
+
(_a = _col.$ftr) === null || _a === void 0 ? void 0 : _a.removeClass('@flex');
|
|
409
393
|
_col.flex = undefined;
|
|
410
394
|
updateFlex = true;
|
|
411
395
|
}
|
|
412
396
|
}
|
|
413
397
|
else if (width < 0 && !_col.flex) {
|
|
414
398
|
_col.$hdr.addClass('@flex');
|
|
415
|
-
_col.$ftr
|
|
399
|
+
(_b = _col.$ftr) === null || _b === void 0 ? void 0 : _b.addClass('@flex');
|
|
416
400
|
_col.flex = 1;
|
|
417
401
|
updateFlex = true;
|
|
418
402
|
}
|
|
@@ -423,9 +407,9 @@ class GridView extends layout_1.VLayout {
|
|
|
423
407
|
flex = true;
|
|
424
408
|
}
|
|
425
409
|
});
|
|
426
|
-
this.m_header.itemWithRef('flex')
|
|
410
|
+
(_c = this.m_header.itemWithRef('flex')) === null || _c === void 0 ? void 0 : _c.show(flex ? false : true);
|
|
427
411
|
if (this.m_footer) {
|
|
428
|
-
this.m_footer.itemWithRef('flex')
|
|
412
|
+
(_d = this.m_footer.itemWithRef('flex')) === null || _d === void 0 ? void 0 : _d.show(flex ? false : true);
|
|
429
413
|
}
|
|
430
414
|
}
|
|
431
415
|
this._updateScroll(true);
|
|
@@ -503,6 +487,7 @@ class GridView extends layout_1.VLayout {
|
|
|
503
487
|
return row;
|
|
504
488
|
}
|
|
505
489
|
_buildItems(canOpt = true) {
|
|
490
|
+
var _a, _b, _c, _d;
|
|
506
491
|
let rc = this.getBoundingRect();
|
|
507
492
|
let rh = this.m_header.getBoundingRect();
|
|
508
493
|
let height = rc.height - rh.height + this.m_itemHeight;
|
|
@@ -518,17 +503,18 @@ class GridView extends layout_1.VLayout {
|
|
|
518
503
|
let even = this.m_topIndex & 1 ? true : false;
|
|
519
504
|
// compute full width
|
|
520
505
|
this.m_columns.forEach((col) => {
|
|
521
|
-
|
|
506
|
+
var _a;
|
|
507
|
+
full_width += (_a = col.width) !== null && _a !== void 0 ? _a : 0;
|
|
522
508
|
});
|
|
523
509
|
// if items height make scroll visible, update header width
|
|
524
510
|
if (((count + 1) * this.m_itemHeight) >= height) {
|
|
525
511
|
let w = component_1.Component.getScrollbarSize();
|
|
526
512
|
this.m_header.setStyleValue("paddingRight", w);
|
|
527
|
-
this.m_footer
|
|
513
|
+
(_a = this.m_footer) === null || _a === void 0 ? void 0 : _a.setStyleValue("paddingRight", w);
|
|
528
514
|
}
|
|
529
515
|
else {
|
|
530
516
|
this.m_header.setStyleValue("paddingRight", 0);
|
|
531
|
-
this.m_footer
|
|
517
|
+
(_b = this.m_footer) === null || _b === void 0 ? void 0 : _b.setStyleValue("paddingRight", 0);
|
|
532
518
|
}
|
|
533
519
|
// passe 0 - all created cells are moved to the recycler
|
|
534
520
|
if (this.m_visible_rows) {
|
|
@@ -639,7 +625,7 @@ class GridView extends layout_1.VLayout {
|
|
|
639
625
|
this.m_empty_msg.show(show);
|
|
640
626
|
if (full_width < rc.width) {
|
|
641
627
|
this.m_header.setStyleValue('width', null);
|
|
642
|
-
this.m_footer
|
|
628
|
+
(_c = this.m_footer) === null || _c === void 0 ? void 0 : _c.setStyleValue('width', null);
|
|
643
629
|
this.m_container.setStyle({
|
|
644
630
|
height: count * this.m_itemHeight,
|
|
645
631
|
width: null
|
|
@@ -647,7 +633,7 @@ class GridView extends layout_1.VLayout {
|
|
|
647
633
|
}
|
|
648
634
|
else {
|
|
649
635
|
this.m_header.setStyleValue('width', full_width + 1000);
|
|
650
|
-
this.m_footer
|
|
636
|
+
(_d = this.m_footer) === null || _d === void 0 ? void 0 : _d.setStyleValue('width', full_width + 1000);
|
|
651
637
|
this.m_container.setStyle({
|
|
652
638
|
height: count * this.m_itemHeight,
|
|
653
639
|
width: full_width
|
|
@@ -662,6 +648,7 @@ class GridView extends layout_1.VLayout {
|
|
|
662
648
|
return;
|
|
663
649
|
}
|
|
664
650
|
const update = () => {
|
|
651
|
+
var _a;
|
|
665
652
|
// element destroyed between updateScroll and now
|
|
666
653
|
if (!this.dom) {
|
|
667
654
|
return;
|
|
@@ -673,7 +660,7 @@ class GridView extends layout_1.VLayout {
|
|
|
673
660
|
}
|
|
674
661
|
let newLeft = this.m_view_el.dom.scrollLeft;
|
|
675
662
|
this.m_header.setStyleValue('left', -newLeft);
|
|
676
|
-
this.m_footer
|
|
663
|
+
(_a = this.m_footer) === null || _a === void 0 ? void 0 : _a.setStyleValue('left', -newLeft);
|
|
677
664
|
};
|
|
678
665
|
if (forceUpdate) {
|
|
679
666
|
this.singleShot(update, 10);
|
|
@@ -721,7 +708,7 @@ class GridView extends layout_1.VLayout {
|
|
|
721
708
|
_itemMenu(e) {
|
|
722
709
|
let dom = e.target, self = this.dom;
|
|
723
710
|
while (dom && dom != self) {
|
|
724
|
-
let itm = component_1.Component.getElement(dom), id = itm
|
|
711
|
+
let itm = component_1.Component.getElement(dom), id = itm === null || itm === void 0 ? void 0 : itm.getData('row-id');
|
|
725
712
|
if (id !== undefined) {
|
|
726
713
|
this._selectItem(id, itm);
|
|
727
714
|
let idx = itm.getData('row-idx');
|
|
File without changes
|
|
@@ -27,6 +27,15 @@
|
|
|
27
27
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
28
28
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
29
29
|
**/
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
30
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
40
|
exports.Icon = exports.EvLoaded = void 0;
|
|
32
41
|
const component_1 = require("./component");
|
|
@@ -47,7 +56,6 @@ function trimQuotes(str) {
|
|
|
47
56
|
return str;
|
|
48
57
|
}
|
|
49
58
|
class Loader extends x4events_1.EventSource {
|
|
50
|
-
svgs;
|
|
51
59
|
constructor() {
|
|
52
60
|
super();
|
|
53
61
|
this.svgs = new Map();
|
|
@@ -64,7 +72,7 @@ class Loader extends x4events_1.EventSource {
|
|
|
64
72
|
// mark it as loading
|
|
65
73
|
this.svgs.set(url, null);
|
|
66
74
|
// then start loading
|
|
67
|
-
const _load =
|
|
75
|
+
const _load = (url) => __awaiter(this, void 0, void 0, function* () {
|
|
68
76
|
// shortcut
|
|
69
77
|
if (url.substring(0, 24) == "data:image/svg+xml;utf8,") {
|
|
70
78
|
const svg = url.substring(24);
|
|
@@ -72,9 +80,9 @@ class Loader extends x4events_1.EventSource {
|
|
|
72
80
|
this.signal('loaded', EvLoaded(url, svg));
|
|
73
81
|
}
|
|
74
82
|
else {
|
|
75
|
-
const r =
|
|
83
|
+
const r = yield fetch(url);
|
|
76
84
|
if (r.ok) {
|
|
77
|
-
const svg =
|
|
85
|
+
const svg = yield r.text();
|
|
78
86
|
// check response, must be svg
|
|
79
87
|
//TODO: find better
|
|
80
88
|
if (!svg.startsWith("<svg") && !svg.startsWith('<?xml')) {
|
|
@@ -87,7 +95,7 @@ class Loader extends x4events_1.EventSource {
|
|
|
87
95
|
}
|
|
88
96
|
}
|
|
89
97
|
}
|
|
90
|
-
};
|
|
98
|
+
});
|
|
91
99
|
_load(url);
|
|
92
100
|
}
|
|
93
101
|
}
|
|
@@ -97,8 +105,6 @@ const svgLoader = new Loader();
|
|
|
97
105
|
* standard icon
|
|
98
106
|
*/
|
|
99
107
|
class Icon extends component_1.Component {
|
|
100
|
-
m_icon;
|
|
101
|
-
m_iconName;
|
|
102
108
|
constructor(props) {
|
|
103
109
|
if ((0, tools_1.isString)(props)) {
|
|
104
110
|
super({ icon: props });
|
|
@@ -253,9 +259,9 @@ class Icon extends component_1.Component {
|
|
|
253
259
|
this.addClass('@svg-icon');
|
|
254
260
|
this.setContent(tools_1.HtmlString.from(`<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="${pth}/></svg>`), false);
|
|
255
261
|
}
|
|
256
|
-
/**
|
|
257
|
-
*
|
|
258
|
-
*/
|
|
259
|
-
static icon_cache = [];
|
|
260
262
|
}
|
|
261
263
|
exports.Icon = Icon;
|
|
264
|
+
/**
|
|
265
|
+
*
|
|
266
|
+
*/
|
|
267
|
+
Icon.icon_cache = [];
|