x4js 1.4.2 → 1.4.5
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/application.js +10 -6
- package/lib/base64.js +5 -1
- package/lib/base_component.js +7 -3
- package/lib/button.js +24 -18
- package/lib/calendar.js +44 -39
- package/lib/canvas.js +9 -5
- package/lib/cardview.js +11 -7
- package/lib/checkbox.js +12 -8
- package/lib/color.js +7 -3
- package/lib/colorpicker.js +86 -80
- package/lib/combobox.js +26 -22
- package/lib/component.js +65 -48
- package/lib/datastore.js +29 -20
- package/lib/dialog.js +41 -36
- package/lib/dom_events.js +2 -1
- package/lib/drag_manager.js +4 -1
- package/lib/drawtext.js +9 -5
- package/lib/fileupload.js +19 -12
- package/lib/form.js +29 -25
- package/lib/formatters.js +19 -10
- package/lib/gridview.js +40 -35
- package/lib/hosts/host.js +7 -3
- package/lib/i18n.js +11 -5
- package/lib/icon.js +16 -11
- package/lib/image.js +7 -3
- package/lib/index.d.ts +55 -0
- package/lib/index.js +71 -1
- package/lib/input.js +6 -2
- package/lib/label.js +15 -11
- package/lib/layout.js +23 -13
- package/lib/link.js +9 -5
- package/lib/listview.js +34 -27
- package/lib/md5.js +5 -1
- package/lib/menu.js +27 -19
- package/lib/messagebox.js +22 -17
- package/lib/panel.js +13 -9
- package/lib/popup.js +25 -20
- package/lib/property_editor.js +20 -16
- package/lib/radiobtn.js +13 -9
- package/lib/rating.js +13 -9
- package/lib/request.js +16 -9
- package/lib/router.d.ts +1 -8
- package/lib/router.js +4 -0
- package/lib/settings.js +8 -4
- package/lib/sidebarview.js +12 -8
- package/lib/smartedit.js +16 -11
- package/lib/spreadsheet.js +35 -31
- package/lib/styles.js +15 -9
- package/lib/svgcomponent.js +8 -3
- package/lib/tabbar.js +10 -6
- package/lib/tabview.js +10 -6
- package/lib/textarea.js +10 -6
- package/lib/textedit.js +39 -35
- package/lib/texthiliter.js +8 -4
- package/lib/toaster.js +8 -4
- package/lib/tools.js +97 -51
- package/lib/tooltips.js +14 -9
- package/lib/treeview.js +30 -26
- package/lib/x4_events.js +21 -9
- package/package.json +2 -1
- package/src/index.ts +55 -0
- package/src/router.ts +1 -1
- package/tsconfig.json +2 -1
package/lib/spreadsheet.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -22,13 +23,15 @@
|
|
|
22
23
|
*
|
|
23
24
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
25
|
**/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.Spreadsheet = void 0;
|
|
28
|
+
const component_1 = require("./component");
|
|
29
|
+
const layout_1 = require("./layout");
|
|
30
|
+
const textedit_1 = require("./textedit");
|
|
31
|
+
const tools_1 = require("./tools");
|
|
32
|
+
const tools_2 = require("./tools");
|
|
33
|
+
const x4_events_1 = require("./x4_events");
|
|
34
|
+
const combobox_1 = require("./combobox");
|
|
32
35
|
class CellData {
|
|
33
36
|
text;
|
|
34
37
|
cls;
|
|
@@ -39,7 +42,7 @@ class CellData {
|
|
|
39
42
|
/**
|
|
40
43
|
*
|
|
41
44
|
*/
|
|
42
|
-
|
|
45
|
+
class Spreadsheet extends layout_1.VLayout {
|
|
43
46
|
m_columns;
|
|
44
47
|
m_row_limit;
|
|
45
48
|
m_cells_data;
|
|
@@ -237,10 +240,10 @@ export class Spreadsheet extends VLayout {
|
|
|
237
240
|
_ctxMenu(e) {
|
|
238
241
|
let dom = e.target, self = this.dom;
|
|
239
242
|
while (dom && dom != self) {
|
|
240
|
-
let itm = Component.getElement(dom), row = itm.getData('row-id'), col = itm.getData('col-id');
|
|
243
|
+
let itm = component_1.Component.getElement(dom), row = itm.getData('row-id'), col = itm.getData('col-id');
|
|
241
244
|
if (row !== undefined) {
|
|
242
245
|
this._selectItem(row, col);
|
|
243
|
-
this.emit('contextMenu', EvContextMenu(e, { row, col, item: itm }));
|
|
246
|
+
this.emit('contextMenu', (0, x4_events_1.EvContextMenu)(e, { row, col, item: itm }));
|
|
244
247
|
e.preventDefault();
|
|
245
248
|
return;
|
|
246
249
|
}
|
|
@@ -250,10 +253,10 @@ export class Spreadsheet extends VLayout {
|
|
|
250
253
|
/** @ignore */
|
|
251
254
|
render() {
|
|
252
255
|
this.m_recycler = [];
|
|
253
|
-
this.m_container = new Component({
|
|
256
|
+
this.m_container = new component_1.Component({
|
|
254
257
|
cls: 'content',
|
|
255
258
|
});
|
|
256
|
-
this.m_view = new Component({
|
|
259
|
+
this.m_view = new component_1.Component({
|
|
257
260
|
cls: '@scroll-view',
|
|
258
261
|
flex: 1,
|
|
259
262
|
dom_events: {
|
|
@@ -263,7 +266,7 @@ export class Spreadsheet extends VLayout {
|
|
|
263
266
|
content: this.m_container
|
|
264
267
|
});
|
|
265
268
|
let cols = this.m_columns.map((col, index) => {
|
|
266
|
-
let comp = new Component({
|
|
269
|
+
let comp = new component_1.Component({
|
|
267
270
|
cls: '@cell c' + index,
|
|
268
271
|
content: col.title ? col.title : ' ',
|
|
269
272
|
flex: col.width < 0 ? -col.width : undefined,
|
|
@@ -275,7 +278,7 @@ export class Spreadsheet extends VLayout {
|
|
|
275
278
|
minWidth: col.min_width
|
|
276
279
|
},
|
|
277
280
|
});
|
|
278
|
-
new SizerOverlay({
|
|
281
|
+
new component_1.SizerOverlay({
|
|
279
282
|
target: comp,
|
|
280
283
|
sens: 'right',
|
|
281
284
|
resize: (ev) => {
|
|
@@ -285,7 +288,7 @@ export class Spreadsheet extends VLayout {
|
|
|
285
288
|
col.$col = comp;
|
|
286
289
|
return comp;
|
|
287
290
|
});
|
|
288
|
-
this.m_header = new HLayout({
|
|
291
|
+
this.m_header = new layout_1.HLayout({
|
|
289
292
|
cls: '@header',
|
|
290
293
|
content: cols,
|
|
291
294
|
});
|
|
@@ -383,7 +386,7 @@ export class Spreadsheet extends VLayout {
|
|
|
383
386
|
cell.clearClasses();
|
|
384
387
|
}
|
|
385
388
|
else {
|
|
386
|
-
cell = new Component({
|
|
389
|
+
cell = new component_1.Component({
|
|
387
390
|
cls: '@cell'
|
|
388
391
|
});
|
|
389
392
|
}
|
|
@@ -415,7 +418,7 @@ export class Spreadsheet extends VLayout {
|
|
|
415
418
|
}
|
|
416
419
|
let right_pos = 0;
|
|
417
420
|
if ((count * this.m_itemHeight) > height) {
|
|
418
|
-
let w = Component.getScrollbarSize();
|
|
421
|
+
let w = component_1.Component.getScrollbarSize();
|
|
419
422
|
rc.width -= w;
|
|
420
423
|
right_pos = w;
|
|
421
424
|
}
|
|
@@ -519,7 +522,7 @@ export class Spreadsheet extends VLayout {
|
|
|
519
522
|
if (this.m_editor && this.m_editor.dom.contains(dom)) {
|
|
520
523
|
return;
|
|
521
524
|
}
|
|
522
|
-
let itm = Component.getElement(dom, Component);
|
|
525
|
+
let itm = component_1.Component.getElement(dom, component_1.Component);
|
|
523
526
|
if (!itm) {
|
|
524
527
|
return;
|
|
525
528
|
}
|
|
@@ -534,11 +537,11 @@ export class Spreadsheet extends VLayout {
|
|
|
534
537
|
if (this.m_editor && this.m_editor.dom.contains(dom)) {
|
|
535
538
|
return;
|
|
536
539
|
}
|
|
537
|
-
let itm = Component.getElement(dom), rowIdx = itm.getData('row-id'), colIdx = itm.getData('col-id');
|
|
540
|
+
let itm = component_1.Component.getElement(dom), rowIdx = itm.getData('row-id'), colIdx = itm.getData('col-id');
|
|
538
541
|
if (rowIdx === undefined || colIdx === undefined) {
|
|
539
542
|
return;
|
|
540
543
|
}
|
|
541
|
-
this.emit('dblClick', EvDblClick({ row: rowIdx, col: colIdx }));
|
|
544
|
+
this.emit('dblClick', (0, component_1.EvDblClick)({ row: rowIdx, col: colIdx }));
|
|
542
545
|
this.editCell(rowIdx, colIdx);
|
|
543
546
|
}
|
|
544
547
|
/**
|
|
@@ -788,7 +791,7 @@ export class Spreadsheet extends VLayout {
|
|
|
788
791
|
if (newSel) {
|
|
789
792
|
newSel.addClass('@selected');
|
|
790
793
|
}
|
|
791
|
-
this.emit('selectionChange', EvSelectionChange({ row, col }));
|
|
794
|
+
this.emit('selectionChange', (0, x4_events_1.EvSelectionChange)({ row, col }));
|
|
792
795
|
}
|
|
793
796
|
/**
|
|
794
797
|
* return the row count
|
|
@@ -843,7 +846,7 @@ export class Spreadsheet extends VLayout {
|
|
|
843
846
|
}
|
|
844
847
|
getCellNumber(row, col) {
|
|
845
848
|
let text = this._getCellData(row, col).text;
|
|
846
|
-
return parseIntlFloat(text);
|
|
849
|
+
return (0, tools_1.parseIntlFloat)(text);
|
|
847
850
|
}
|
|
848
851
|
clearRow(row) {
|
|
849
852
|
for (let c = 0; c < this.m_columns.length; c++) {
|
|
@@ -873,7 +876,7 @@ export class Spreadsheet extends VLayout {
|
|
|
873
876
|
let prc = parent.getBoundingClientRect();
|
|
874
877
|
let cell = this._getCellData(row, col, true);
|
|
875
878
|
let edtBuilder = (props, col, row) => {
|
|
876
|
-
return new TextEdit(props);
|
|
879
|
+
return new textedit_1.TextEdit(props);
|
|
877
880
|
};
|
|
878
881
|
if (this.m_columns[col].createEditor) {
|
|
879
882
|
edtBuilder = this.m_columns[col].createEditor;
|
|
@@ -901,20 +904,20 @@ export class Spreadsheet extends VLayout {
|
|
|
901
904
|
this._setupEditor();
|
|
902
905
|
this.m_editor.setData('old-value', cellvalue);
|
|
903
906
|
this.m_editor.focus();
|
|
904
|
-
if (this.m_editor instanceof TextEdit) {
|
|
907
|
+
if (this.m_editor instanceof textedit_1.TextEdit) {
|
|
905
908
|
this.m_editor.selectAll();
|
|
906
909
|
}
|
|
907
910
|
}
|
|
908
911
|
_setupEditor() {
|
|
909
912
|
let movesel = (sensy, sensx) => {
|
|
910
|
-
deferCall(() => {
|
|
913
|
+
(0, tools_2.deferCall)(() => {
|
|
911
914
|
this.killEditor(true);
|
|
912
915
|
this._moveSel(sensy, sensx);
|
|
913
916
|
this.editCurCell();
|
|
914
917
|
});
|
|
915
918
|
};
|
|
916
919
|
// todo: better
|
|
917
|
-
if (this.m_editor instanceof TextEdit) {
|
|
920
|
+
if (this.m_editor instanceof textedit_1.TextEdit) {
|
|
918
921
|
let editor = this.m_editor;
|
|
919
922
|
let input = editor.input;
|
|
920
923
|
input.setDomEvent('blur', () => {
|
|
@@ -952,7 +955,7 @@ export class Spreadsheet extends VLayout {
|
|
|
952
955
|
}
|
|
953
956
|
});
|
|
954
957
|
}
|
|
955
|
-
else if (this.m_editor instanceof ComboBox) {
|
|
958
|
+
else if (this.m_editor instanceof combobox_1.ComboBox) {
|
|
956
959
|
let input = this.m_editor.input;
|
|
957
960
|
input.setDomEvent('blur', () => {
|
|
958
961
|
this.killEditor(true);
|
|
@@ -989,10 +992,10 @@ export class Spreadsheet extends VLayout {
|
|
|
989
992
|
if (this.m_editor) {
|
|
990
993
|
if (save) {
|
|
991
994
|
let text, id;
|
|
992
|
-
if (this.m_editor instanceof TextEdit) {
|
|
995
|
+
if (this.m_editor instanceof textedit_1.TextEdit) {
|
|
993
996
|
text = this.m_editor.value;
|
|
994
997
|
}
|
|
995
|
-
else if (this.m_editor instanceof ComboBox) {
|
|
998
|
+
else if (this.m_editor instanceof combobox_1.ComboBox) {
|
|
996
999
|
id = this.m_editor.value;
|
|
997
1000
|
text = this.m_editor.valueText;
|
|
998
1001
|
}
|
|
@@ -1000,7 +1003,7 @@ export class Spreadsheet extends VLayout {
|
|
|
1000
1003
|
let col = this.m_editor.getData('col');
|
|
1001
1004
|
let old = this.m_editor.getData('old-value');
|
|
1002
1005
|
this.setCellText(row, col, text);
|
|
1003
|
-
const ev = EvChange(text, { row, col, oldValue: old, id });
|
|
1006
|
+
const ev = (0, x4_events_1.EvChange)(text, { row, col, oldValue: old, id });
|
|
1004
1007
|
this.emit('change', ev);
|
|
1005
1008
|
if (ev.defaultPrevented) {
|
|
1006
1009
|
this.setCellText(row, col, old);
|
|
@@ -1008,7 +1011,7 @@ export class Spreadsheet extends VLayout {
|
|
|
1008
1011
|
}
|
|
1009
1012
|
// cannot dipose while handling blur event, so we defer...
|
|
1010
1013
|
let t = this.m_editor;
|
|
1011
|
-
asap(() => {
|
|
1014
|
+
(0, tools_1.asap)(() => {
|
|
1012
1015
|
t.dispose();
|
|
1013
1016
|
});
|
|
1014
1017
|
this.m_editor = null;
|
|
@@ -1056,6 +1059,7 @@ export class Spreadsheet extends VLayout {
|
|
|
1056
1059
|
}
|
|
1057
1060
|
}
|
|
1058
1061
|
}
|
|
1062
|
+
exports.Spreadsheet = Spreadsheet;
|
|
1059
1063
|
/**
|
|
1060
1064
|
* @ignore
|
|
1061
1065
|
*/
|
package/lib/styles.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -22,11 +23,13 @@
|
|
|
22
23
|
*
|
|
23
24
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
25
|
**/
|
|
25
|
-
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ComputedStyle = exports.CSSParser = exports.Stylesheet = void 0;
|
|
28
|
+
const tools_1 = require("./tools");
|
|
26
29
|
/**
|
|
27
30
|
* -- [ @STYLESHEET ] -----------------------------------------------------------------
|
|
28
31
|
*/
|
|
29
|
-
|
|
32
|
+
class Stylesheet {
|
|
30
33
|
m_sheet;
|
|
31
34
|
m_rules = new Map();
|
|
32
35
|
constructor() {
|
|
@@ -54,7 +57,7 @@ export class Stylesheet {
|
|
|
54
57
|
* setRule('xbody', "body { background-color: #ff0000; }" );
|
|
55
58
|
*/
|
|
56
59
|
setRule(name, definition) {
|
|
57
|
-
if (isString(definition)) {
|
|
60
|
+
if ((0, tools_1.isString)(definition)) {
|
|
58
61
|
let index = this.m_rules.get(name);
|
|
59
62
|
if (index !== undefined) {
|
|
60
63
|
this.m_sheet.deleteRule(index);
|
|
@@ -98,12 +101,13 @@ export class Stylesheet {
|
|
|
98
101
|
static guid = 1;
|
|
99
102
|
static doc_style;
|
|
100
103
|
}
|
|
104
|
+
exports.Stylesheet = Stylesheet;
|
|
101
105
|
/**
|
|
102
106
|
* -- [ @CSSPARSER ] -----------------------------------------------------------------
|
|
103
107
|
*
|
|
104
108
|
* adaptation of jss-for-node-js
|
|
105
109
|
*/
|
|
106
|
-
|
|
110
|
+
class CSSParser {
|
|
107
111
|
result = {};
|
|
108
112
|
parse(css) {
|
|
109
113
|
this.result = {};
|
|
@@ -132,7 +136,7 @@ export class CSSParser {
|
|
|
132
136
|
}
|
|
133
137
|
for (let property in css) {
|
|
134
138
|
let value = css[property];
|
|
135
|
-
if (isArray(value)) {
|
|
139
|
+
if ((0, tools_1.isArray)(value)) {
|
|
136
140
|
let values = value;
|
|
137
141
|
for (let i = 0; i < values.length; i++) {
|
|
138
142
|
this.addProperty(scope, property, values[i]);
|
|
@@ -164,7 +168,7 @@ export class CSSParser {
|
|
|
164
168
|
}
|
|
165
169
|
}
|
|
166
170
|
makePropertyName(n) {
|
|
167
|
-
return pascalCase(n);
|
|
171
|
+
return (0, tools_1.pascalCase)(n);
|
|
168
172
|
}
|
|
169
173
|
makeSelectorName(scope, name) {
|
|
170
174
|
let snames = [];
|
|
@@ -234,7 +238,8 @@ export class CSSParser {
|
|
|
234
238
|
}
|
|
235
239
|
}
|
|
236
240
|
}
|
|
237
|
-
|
|
241
|
+
exports.CSSParser = CSSParser;
|
|
242
|
+
class ComputedStyle {
|
|
238
243
|
m_style;
|
|
239
244
|
constructor(style) {
|
|
240
245
|
this.m_style = style;
|
|
@@ -243,14 +248,14 @@ export class ComputedStyle {
|
|
|
243
248
|
* return the raw value
|
|
244
249
|
*/
|
|
245
250
|
value(name) {
|
|
246
|
-
name = pascalCase(name);
|
|
251
|
+
name = (0, tools_1.pascalCase)(name);
|
|
247
252
|
return this.m_style[name];
|
|
248
253
|
}
|
|
249
254
|
/**
|
|
250
255
|
* return the interpreted value
|
|
251
256
|
*/
|
|
252
257
|
parse(name) {
|
|
253
|
-
name = pascalCase(name);
|
|
258
|
+
name = (0, tools_1.pascalCase)(name);
|
|
254
259
|
return parseInt(this.m_style[name]);
|
|
255
260
|
}
|
|
256
261
|
/**
|
|
@@ -260,3 +265,4 @@ export class ComputedStyle {
|
|
|
260
265
|
return this.m_style;
|
|
261
266
|
}
|
|
262
267
|
}
|
|
268
|
+
exports.ComputedStyle = ComputedStyle;
|
package/lib/svgcomponent.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -22,7 +23,9 @@
|
|
|
22
23
|
*
|
|
23
24
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
25
|
**/
|
|
25
|
-
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SVGComponent = exports.SVGPathBuilder = void 0;
|
|
28
|
+
const component_1 = require("./component");
|
|
26
29
|
// degrees to radian
|
|
27
30
|
function d2r(d) {
|
|
28
31
|
return d * Math.PI / 180.0;
|
|
@@ -284,7 +287,7 @@ class SVGGradient extends SVGItem {
|
|
|
284
287
|
/**
|
|
285
288
|
*
|
|
286
289
|
*/
|
|
287
|
-
|
|
290
|
+
class SVGPathBuilder {
|
|
288
291
|
m_items;
|
|
289
292
|
constructor() {
|
|
290
293
|
this.m_items = [];
|
|
@@ -336,7 +339,8 @@ export class SVGPathBuilder {
|
|
|
336
339
|
return result.join('\n');
|
|
337
340
|
}
|
|
338
341
|
}
|
|
339
|
-
|
|
342
|
+
exports.SVGPathBuilder = SVGPathBuilder;
|
|
343
|
+
class SVGComponent extends component_1.Component {
|
|
340
344
|
constructor(props) {
|
|
341
345
|
super(props);
|
|
342
346
|
this.setProp('tag', 'svg');
|
|
@@ -348,3 +352,4 @@ export class SVGComponent extends Component {
|
|
|
348
352
|
this.setContent(props.path);
|
|
349
353
|
}
|
|
350
354
|
}
|
|
355
|
+
exports.SVGComponent = SVGComponent;
|
package/lib/tabbar.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -11,10 +12,12 @@
|
|
|
11
12
|
*
|
|
12
13
|
* @description Tab
|
|
13
14
|
**/
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TabBar = void 0;
|
|
17
|
+
const component_1 = require("./component");
|
|
18
|
+
const button_1 = require("./button");
|
|
19
|
+
const x4_events_1 = require("./x4_events");
|
|
20
|
+
class TabBar extends component_1.Container {
|
|
18
21
|
m_pages;
|
|
19
22
|
m_curPage;
|
|
20
23
|
constructor(props) {
|
|
@@ -40,7 +43,7 @@ export class TabBar extends Container {
|
|
|
40
43
|
render() {
|
|
41
44
|
let buttons = [];
|
|
42
45
|
this.m_pages.forEach(p => {
|
|
43
|
-
p.btn = new Button({ cls: p === this.m_curPage ? 'selected' : '', text: p.title, icon: p.icon, click: () => this._select(p) });
|
|
46
|
+
p.btn = new button_1.Button({ cls: p === this.m_curPage ? 'selected' : '', text: p.title, icon: p.icon, click: () => this._select(p) });
|
|
44
47
|
buttons.push(p.btn);
|
|
45
48
|
});
|
|
46
49
|
this.setContent(buttons);
|
|
@@ -57,10 +60,11 @@ export class TabBar extends Container {
|
|
|
57
60
|
this.m_curPage.page.hide();
|
|
58
61
|
}
|
|
59
62
|
this.m_curPage = p;
|
|
60
|
-
this.signal('change', EvChange(p ? p.id : null));
|
|
63
|
+
this.signal('change', (0, x4_events_1.EvChange)(p ? p.id : null));
|
|
61
64
|
if (this.dom && this.m_curPage && this.m_curPage.page) {
|
|
62
65
|
this.m_curPage.btn.addClass('selected');
|
|
63
66
|
this.m_curPage.page.show();
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
exports.TabBar = TabBar;
|
package/lib/tabview.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -22,13 +23,15 @@
|
|
|
22
23
|
*
|
|
23
24
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
25
|
**/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.TabView = void 0;
|
|
28
|
+
const layout_1 = require("./layout");
|
|
29
|
+
const button_1 = require("./button");
|
|
30
|
+
const cardview_1 = require("./cardview");
|
|
28
31
|
/**
|
|
29
32
|
* Standard TabView class
|
|
30
33
|
*/
|
|
31
|
-
|
|
34
|
+
class TabView extends cardview_1.CardView {
|
|
32
35
|
m_tab_selector;
|
|
33
36
|
m_menu;
|
|
34
37
|
constructor(props) {
|
|
@@ -53,7 +56,7 @@ export class TabView extends CardView {
|
|
|
53
56
|
}
|
|
54
57
|
});
|
|
55
58
|
if (this.m_tab_selector) {
|
|
56
|
-
pages.unshift(new HLayout({
|
|
59
|
+
pages.unshift(new layout_1.HLayout({
|
|
57
60
|
cls: '@tab-switch',
|
|
58
61
|
content: tabs
|
|
59
62
|
}));
|
|
@@ -63,7 +66,7 @@ export class TabView extends CardView {
|
|
|
63
66
|
_updateSelector() {
|
|
64
67
|
}
|
|
65
68
|
_prepareSelector(card) {
|
|
66
|
-
return new Button({
|
|
69
|
+
return new button_1.Button({
|
|
67
70
|
cls: '@tab-btn',
|
|
68
71
|
text: card.title,
|
|
69
72
|
icon: card.icon,
|
|
@@ -77,3 +80,4 @@ export class TabView extends CardView {
|
|
|
77
80
|
}
|
|
78
81
|
}
|
|
79
82
|
}
|
|
83
|
+
exports.TabView = TabView;
|
package/lib/textarea.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* ___ ___ __
|
|
3
4
|
* \ \_/ / / _
|
|
@@ -22,10 +23,12 @@
|
|
|
22
23
|
*
|
|
23
24
|
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
24
25
|
**/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.TextArea = void 0;
|
|
28
|
+
const component_1 = require("./component");
|
|
29
|
+
const x4_events_1 = require("./x4_events");
|
|
30
|
+
const tools_1 = require("./tools");
|
|
31
|
+
class TextArea extends component_1.Component {
|
|
29
32
|
constructor(props) {
|
|
30
33
|
super(props);
|
|
31
34
|
this.mapPropEvents(props, 'change');
|
|
@@ -56,7 +59,7 @@ export class TextArea extends Component {
|
|
|
56
59
|
this.setProp('autoGrow', true);
|
|
57
60
|
this.setAttribute('rows', this._calcHeight(props.text));
|
|
58
61
|
this.setDomEvent('keydown', () => {
|
|
59
|
-
asap(() => this._updateHeight());
|
|
62
|
+
(0, tools_1.asap)(() => this._updateHeight());
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
65
|
// avoid going to next element on enter
|
|
@@ -67,7 +70,7 @@ export class TextArea extends Component {
|
|
|
67
70
|
this.setProp('tag', 'textarea');
|
|
68
71
|
}
|
|
69
72
|
_change() {
|
|
70
|
-
this.emit('change', EvChange(this.value));
|
|
73
|
+
this.emit('change', (0, x4_events_1.EvChange)(this.value));
|
|
71
74
|
}
|
|
72
75
|
componentCreated() {
|
|
73
76
|
this.value = this.m_props.text;
|
|
@@ -117,3 +120,4 @@ export class TextArea extends Component {
|
|
|
117
120
|
this.value = value;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
123
|
+
exports.TextArea = TextArea;
|