x4js 1.4.42 → 1.4.45
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.d.ts +2 -2
- package/lib/action.js +2 -3
- package/lib/application.js +1 -2
- package/lib/button.js +4 -0
- package/lib/cardview.js +3 -0
- package/lib/form.d.ts +2 -2
- package/lib/gridview.d.ts +4 -0
- package/lib/gridview.js +41 -15
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/sidebarview.d.ts +2 -1
- package/lib/sidebarview.js +3 -1
- package/lib/svgcomponent.d.ts +19 -3
- package/lib/svgcomponent.js +37 -2
- package/lib/textedit.d.ts +3 -3
- package/lib/tools.d.ts +7 -0
- package/lib/tools.js +50 -2
- package/lib/treeview.js +6 -4
- package/lib/version.d.ts +1 -0
- package/lib/version.js +4 -0
- package/lib/x4.css +24 -15
- package/package.json +1 -1
- package/src/action.ts +2 -2
- package/src/application.ts +1 -3
- package/src/button.ts +5 -1
- package/src/component.ts +1 -2
- package/src/form.ts +2 -2
- package/src/gridview.ts +48 -18
- package/src/index.ts +2 -0
- package/src/sidebarview.ts +5 -3
- package/src/svgcomponent.ts +55 -6
- package/src/textedit.ts +3 -3
- package/src/tools.ts +61 -1
- package/src/treeview.ts +7 -5
- package/src/version.ts +1 -0
- package/src/x4.less +27 -22
package/lib/action.d.ts
CHANGED
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
|
-
import { BasicEvent } from './x4events';
|
|
29
|
+
import { BasicEvent, EvChange } from './x4events';
|
|
30
30
|
import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component';
|
|
31
31
|
import { IconID } from "./icon";
|
|
32
|
-
import {
|
|
32
|
+
import { EventHandler } from './component';
|
|
33
33
|
export interface EvAction extends BasicEvent {
|
|
34
34
|
}
|
|
35
35
|
export declare function EvAction(source: Action): EvAction;
|
package/lib/action.js
CHANGED
|
@@ -31,7 +31,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
exports.Action = exports.EvAction = void 0;
|
|
32
32
|
const x4events_1 = require("./x4events");
|
|
33
33
|
const base_component_1 = require("./base_component");
|
|
34
|
-
const x4js_1 = require("x4js");
|
|
35
34
|
function EvAction(source) {
|
|
36
35
|
return (0, x4events_1.BasicEvent)({ source });
|
|
37
36
|
}
|
|
@@ -46,11 +45,11 @@ class Action extends base_component_1.BaseComponent {
|
|
|
46
45
|
}
|
|
47
46
|
set text(t) {
|
|
48
47
|
this.m_props.text = t;
|
|
49
|
-
this.emit("change", (0,
|
|
48
|
+
this.emit("change", (0, x4events_1.EvChange)(this));
|
|
50
49
|
}
|
|
51
50
|
set icon(i) {
|
|
52
51
|
this.m_props.icon = i;
|
|
53
|
-
this.emit("change", (0,
|
|
52
|
+
this.emit("change", (0, x4events_1.EvChange)(this));
|
|
54
53
|
}
|
|
55
54
|
fire() {
|
|
56
55
|
this.emit("run", EvAction(this));
|
package/lib/application.js
CHANGED
|
@@ -33,7 +33,6 @@ const x4dom_1 = require("./x4dom");
|
|
|
33
33
|
const base_component_1 = require("./base_component");
|
|
34
34
|
const component_1 = require("./component");
|
|
35
35
|
const settings_1 = require("./settings");
|
|
36
|
-
const x4js_1 = require("x4js");
|
|
37
36
|
const _x4_touch_time = Symbol();
|
|
38
37
|
/**
|
|
39
38
|
* Represents an x4 application, which is typically a single page app.
|
|
@@ -128,7 +127,7 @@ class Application extends base_component_1.BaseComponent {
|
|
|
128
127
|
*/
|
|
129
128
|
setMainView(root, clearBefore) {
|
|
130
129
|
const ddom = this.m_props.renderTo ?? x4dom_1.x4document.body;
|
|
131
|
-
const dest = (0,
|
|
130
|
+
const dest = (0, component_1.flyWrap)(ddom);
|
|
132
131
|
if (!this.m_props.renderTo) {
|
|
133
132
|
dest.setStyleValue('position', 'absolute');
|
|
134
133
|
}
|
package/lib/button.js
CHANGED
|
@@ -63,6 +63,9 @@ class BaseButton extends component_1.Component {
|
|
|
63
63
|
const ui_icon = icon ? new icon_1.Icon({ icon, cls: 'left', ref: 'l_icon' }) : null;
|
|
64
64
|
const ui_label = new label_1.Label({ flex: 1, text: text ?? '', align: props.align, ref: 'label' });
|
|
65
65
|
const ui_ricon = props.rightIcon ? new icon_1.Icon({ icon: props.rightIcon, cls: 'right', ref: 'r_icon' }) : null;
|
|
66
|
+
if (text === undefined) {
|
|
67
|
+
ui_label.addClass("@hidden");
|
|
68
|
+
}
|
|
66
69
|
this.setContent([ui_icon, ui_label, ui_ricon]);
|
|
67
70
|
this._setTabIndex(props.tabIndex);
|
|
68
71
|
}
|
|
@@ -147,6 +150,7 @@ class BaseButton extends component_1.Component {
|
|
|
147
150
|
let label = this.itemWithRef('label');
|
|
148
151
|
if (label) {
|
|
149
152
|
label.text = text;
|
|
153
|
+
label.removeClass("@hidden");
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
156
|
get text() {
|
package/lib/cardview.js
CHANGED
|
@@ -99,6 +99,9 @@ class CardView extends component_1.Component {
|
|
|
99
99
|
if (!page.dom) {
|
|
100
100
|
this._preparePage(page);
|
|
101
101
|
}
|
|
102
|
+
if (this.m_cpage.selector) {
|
|
103
|
+
this.m_cpage.selector.addClass('@active');
|
|
104
|
+
}
|
|
102
105
|
}
|
|
103
106
|
this.emit('change', (0, x4events_1.EvChange)(this.m_cpage.name));
|
|
104
107
|
}
|
package/lib/form.d.ts
CHANGED
|
@@ -45,13 +45,13 @@ export interface FormProps extends CProps<FormEventMap> {
|
|
|
45
45
|
/**
|
|
46
46
|
*
|
|
47
47
|
*/
|
|
48
|
-
export declare class Form extends
|
|
48
|
+
export declare class Form<T extends FormProps = FormProps, E extends FormEventMap = FormEventMap> extends VLayout<T, E> {
|
|
49
49
|
protected m_height: string | number;
|
|
50
50
|
protected m_container: Container;
|
|
51
51
|
protected m_buttons: HLayout;
|
|
52
52
|
protected m_dirty: boolean;
|
|
53
53
|
protected m_watchChanges: boolean;
|
|
54
|
-
constructor(props:
|
|
54
|
+
constructor(props: T);
|
|
55
55
|
/**
|
|
56
56
|
* returns the container object
|
|
57
57
|
*/
|
package/lib/gridview.d.ts
CHANGED
package/lib/gridview.js
CHANGED
|
@@ -69,17 +69,24 @@ class ColHeader extends component_1.Component {
|
|
|
69
69
|
get sorted() {
|
|
70
70
|
return this.m_sorted;
|
|
71
71
|
}
|
|
72
|
-
set sorted(v) {
|
|
72
|
+
//set sorted( v ) {
|
|
73
|
+
// this.m_sorted = v;
|
|
74
|
+
// this.m_sens = 'dn';
|
|
75
|
+
// this.itemWithRef<Icon>( 'sorter' ).show( v );
|
|
76
|
+
//}
|
|
77
|
+
sort(v, sens) {
|
|
73
78
|
this.m_sorted = v;
|
|
74
|
-
this.m_sens =
|
|
75
|
-
this.itemWithRef('sorter')
|
|
79
|
+
this.m_sens = sens;
|
|
80
|
+
const ic = this.itemWithRef('sorter');
|
|
81
|
+
ic.icon = this.m_sens == 'up' ? 'var( --x4-icon-arrow-down )' : 'var( --x4-icon-arrow-up )';
|
|
82
|
+
ic.show(v);
|
|
76
83
|
}
|
|
77
84
|
get sens() {
|
|
78
85
|
return this.m_sens;
|
|
79
86
|
}
|
|
80
87
|
toggleSens() {
|
|
81
88
|
this.m_sens = this.m_sens == 'up' ? 'dn' : 'up';
|
|
82
|
-
this.itemWithRef('sorter').icon = this.m_sens == '
|
|
89
|
+
this.itemWithRef('sorter').icon = this.m_sens == 'up' ? 'var( --x4-icon-arrow-down )' : 'var( --x4-icon-arrow-up )';
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
92
|
/**
|
|
@@ -426,13 +433,24 @@ class GridView extends layout_1.VLayout {
|
|
|
426
433
|
/**
|
|
427
434
|
*
|
|
428
435
|
*/
|
|
429
|
-
|
|
436
|
+
sortCol(name, asc = true) {
|
|
437
|
+
const col = this.m_columns.find(c => c.id == name);
|
|
438
|
+
if (col === undefined) {
|
|
439
|
+
console.assert(false, "unknown field " + name + " in grid.sortCol");
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
this._sortCol(col, asc ? "dn" : "up");
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
*
|
|
446
|
+
*/
|
|
447
|
+
_sortCol(col, sens = "up") {
|
|
430
448
|
if (col.sortable === false) {
|
|
431
449
|
return;
|
|
432
450
|
}
|
|
433
451
|
this.m_columns.forEach((c) => {
|
|
434
452
|
if (c !== col) {
|
|
435
|
-
c.$hdr.
|
|
453
|
+
c.$hdr.sort(false, "dn");
|
|
436
454
|
}
|
|
437
455
|
});
|
|
438
456
|
const $hdr = col.$hdr;
|
|
@@ -440,7 +458,7 @@ class GridView extends layout_1.VLayout {
|
|
|
440
458
|
$hdr.toggleSens();
|
|
441
459
|
}
|
|
442
460
|
else {
|
|
443
|
-
$hdr.
|
|
461
|
+
$hdr.sort(true, sens);
|
|
444
462
|
}
|
|
445
463
|
if (this.m_dataview) {
|
|
446
464
|
this.m_dataview.sort([
|
|
@@ -852,15 +870,23 @@ class GridView extends layout_1.VLayout {
|
|
|
852
870
|
let cid = c.getData('col');
|
|
853
871
|
if (cid) {
|
|
854
872
|
let col = this.m_columns[cid];
|
|
855
|
-
let
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
873
|
+
let value = rec[col.id];
|
|
874
|
+
if (value !== undefined) {
|
|
875
|
+
if ((0, tools_1.isFunction)(value)) { // FooterRenderer
|
|
876
|
+
value(c);
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
let text;
|
|
880
|
+
const fmt = col.formatter;
|
|
881
|
+
if (fmt && fmt instanceof Function) {
|
|
882
|
+
text = fmt(value, rec);
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
text = value;
|
|
886
|
+
}
|
|
887
|
+
c.setContent(text, false);
|
|
888
|
+
}
|
|
862
889
|
}
|
|
863
|
-
c.setContent(text, false);
|
|
864
890
|
}
|
|
865
891
|
});
|
|
866
892
|
}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/sidebarview.d.ts
CHANGED
|
@@ -33,11 +33,12 @@ export interface SideBarItem extends ICardViewItem {
|
|
|
33
33
|
}
|
|
34
34
|
export interface SideBarProps extends CardViewProps {
|
|
35
35
|
bar_sizable?: boolean;
|
|
36
|
+
bar_width?: number;
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
*
|
|
39
40
|
*/
|
|
40
|
-
export declare class SideBarView extends CardView {
|
|
41
|
+
export declare class SideBarView extends CardView<SideBarProps> {
|
|
41
42
|
m_sidebar: VLayout;
|
|
42
43
|
m_content: Component;
|
|
43
44
|
constructor(props: SideBarProps);
|
package/lib/sidebarview.js
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
**/
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
31
|
exports.SideBarView = void 0;
|
|
32
|
+
const component_1 = require("./component");
|
|
32
33
|
const layout_1 = require("./layout");
|
|
33
34
|
const button_1 = require("./button");
|
|
34
35
|
const cardview_1 = require("./cardview");
|
|
@@ -43,7 +44,7 @@ class SideBarView extends cardview_1.CardView {
|
|
|
43
44
|
this.addClass('@hlayout');
|
|
44
45
|
this.m_sidebar = new layout_1.VLayout({
|
|
45
46
|
cls: '@side-bar',
|
|
46
|
-
|
|
47
|
+
width: props.bar_width ?? undefined,
|
|
47
48
|
});
|
|
48
49
|
this.m_content = new layout_1.HLayout({ flex: 1, cls: '@tab-container' });
|
|
49
50
|
}
|
|
@@ -60,6 +61,7 @@ class SideBarView extends cardview_1.CardView {
|
|
|
60
61
|
}));
|
|
61
62
|
this.setContent([
|
|
62
63
|
this.m_sidebar,
|
|
64
|
+
this.m_props.bar_sizable ? new component_1.Separator({ orientation: "horizontal", sizing: "before" }) : undefined,
|
|
63
65
|
this.m_content
|
|
64
66
|
]);
|
|
65
67
|
}
|
package/lib/svgcomponent.d.ts
CHANGED
|
@@ -76,7 +76,14 @@ declare abstract class SVGItem {
|
|
|
76
76
|
*
|
|
77
77
|
*/
|
|
78
78
|
renderStyle(): string;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
*/
|
|
79
82
|
renderContent(): string;
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
clip(id: string): this;
|
|
80
87
|
}
|
|
81
88
|
/**
|
|
82
89
|
*
|
|
@@ -148,9 +155,9 @@ declare class SVGGradient extends SVGItem {
|
|
|
148
155
|
/**
|
|
149
156
|
*
|
|
150
157
|
*/
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
constructor();
|
|
158
|
+
declare class SVGGroup extends SVGItem {
|
|
159
|
+
protected m_items: SVGItem[];
|
|
160
|
+
constructor(tag?: string);
|
|
154
161
|
path(): SVGPath;
|
|
155
162
|
text(x: any, y: any, txt: any): SVGText;
|
|
156
163
|
ellipse(x: any, y: any, r1: any, r2?: any): SVGShape;
|
|
@@ -160,6 +167,15 @@ export declare class SVGPathBuilder {
|
|
|
160
167
|
* clear
|
|
161
168
|
*/
|
|
162
169
|
clear(): void;
|
|
170
|
+
renderContent(): string;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
export declare class SVGPathBuilder extends SVGGroup {
|
|
176
|
+
private static g_clip_id;
|
|
177
|
+
constructor();
|
|
178
|
+
addClip(x: number, y: number, w: number, h: number): string;
|
|
163
179
|
render(): string;
|
|
164
180
|
}
|
|
165
181
|
/**
|
package/lib/svgcomponent.js
CHANGED
|
@@ -159,9 +159,19 @@ class SVGItem {
|
|
|
159
159
|
});
|
|
160
160
|
return result + '"';
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
162
165
|
renderContent() {
|
|
163
166
|
return '';
|
|
164
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
*
|
|
170
|
+
*/
|
|
171
|
+
clip(id) {
|
|
172
|
+
this.attr("clip-path", `url(#${id})`);
|
|
173
|
+
return this;
|
|
174
|
+
}
|
|
165
175
|
}
|
|
166
176
|
/**
|
|
167
177
|
*
|
|
@@ -325,9 +335,10 @@ class SVGGradient extends SVGItem {
|
|
|
325
335
|
/**
|
|
326
336
|
*
|
|
327
337
|
*/
|
|
328
|
-
class
|
|
338
|
+
class SVGGroup extends SVGItem {
|
|
329
339
|
m_items;
|
|
330
|
-
constructor() {
|
|
340
|
+
constructor(tag = "g") {
|
|
341
|
+
super(tag);
|
|
331
342
|
this.m_items = [];
|
|
332
343
|
}
|
|
333
344
|
path() {
|
|
@@ -369,6 +380,30 @@ class SVGPathBuilder {
|
|
|
369
380
|
clear() {
|
|
370
381
|
this.m_items = [];
|
|
371
382
|
}
|
|
383
|
+
renderContent() {
|
|
384
|
+
let result = [];
|
|
385
|
+
this.m_items.forEach(i => {
|
|
386
|
+
result.push(i.render());
|
|
387
|
+
});
|
|
388
|
+
return result.join('\n');
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
*
|
|
393
|
+
*/
|
|
394
|
+
class SVGPathBuilder extends SVGGroup {
|
|
395
|
+
static g_clip_id = 1;
|
|
396
|
+
constructor() {
|
|
397
|
+
super('');
|
|
398
|
+
}
|
|
399
|
+
addClip(x, y, w, h) {
|
|
400
|
+
const id = 'c-' + SVGPathBuilder.g_clip_id++;
|
|
401
|
+
const clip = new SVGGroup('clipPath');
|
|
402
|
+
clip.attr('id', id);
|
|
403
|
+
clip.rect(x, y, w, h);
|
|
404
|
+
this.m_items.push(clip);
|
|
405
|
+
return id;
|
|
406
|
+
}
|
|
372
407
|
render() {
|
|
373
408
|
let result = [];
|
|
374
409
|
this.m_items.forEach(i => {
|
package/lib/textedit.d.ts
CHANGED
|
@@ -55,11 +55,11 @@ export interface TextEditProps extends InputProps<TextEditEventMap> {
|
|
|
55
55
|
/**
|
|
56
56
|
* TextEdit is a single line editor, it can have a label and an error descriptor.
|
|
57
57
|
*/
|
|
58
|
-
export declare class TextEdit<T extends TextEditProps = TextEditProps> extends Component<
|
|
58
|
+
export declare class TextEdit<T extends TextEditProps = TextEditProps, E extends TextEditEventMap = TextEditEventMap> extends Component<T, E> {
|
|
59
59
|
private m_cal_popup;
|
|
60
60
|
protected m_ui_input: Input;
|
|
61
61
|
private m_error_tip;
|
|
62
|
-
constructor(props:
|
|
62
|
+
constructor(props: T);
|
|
63
63
|
componentCreated(): void;
|
|
64
64
|
componentDisposed(): void;
|
|
65
65
|
focus(): void;
|
|
@@ -113,7 +113,7 @@ export declare class TextEdit<T extends TextEditProps = TextEditProps> extends C
|
|
|
113
113
|
* @returns
|
|
114
114
|
*/
|
|
115
115
|
validate(): boolean;
|
|
116
|
-
|
|
116
|
+
protected _validate(value: string): boolean;
|
|
117
117
|
_date_validator(value: string): string;
|
|
118
118
|
private _showDatePicker;
|
|
119
119
|
get input(): Input;
|
package/lib/tools.d.ts
CHANGED
|
@@ -384,4 +384,11 @@ interface PasswordRule {
|
|
|
384
384
|
min: number;
|
|
385
385
|
}
|
|
386
386
|
export declare function generatePassword(length: number, rules?: PasswordRule[]): string;
|
|
387
|
+
/**
|
|
388
|
+
* taken from live-server
|
|
389
|
+
* https://github.com/tapio/live-server
|
|
390
|
+
* @param host
|
|
391
|
+
* @param port
|
|
392
|
+
*/
|
|
393
|
+
export declare function installHMR(host?: string, port?: string, reloadCallback?: Function): void;
|
|
387
394
|
export {};
|
package/lib/tools.js
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
29
29
|
**/
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.generatePassword = exports.classNames = exports.mix = exports.crc32 = exports.Clipboard = exports.isHtmlString = exports.html = exports.HtmlString = exports.clamp = exports.getMousePos = exports.NetworkError = exports.markdownToHtml = exports.asap = exports.deferCall = exports.waitFontLoading = exports.isNumber = exports.pad = exports.isLiteralObject = exports.isFunction = exports.isArray = exports.isString = exports.downloadData = exports.calcAge = exports.formatIntlDate = exports.parseIntlDate = exports.date_calc_weeknum = exports.date_clone = exports.date_hash = exports.date_sql_utc = exports.date_to_sql = exports.date_diff = exports.date_format = exports._date_set_locale = exports.removeHtmlTags = exports.escapeHtml = exports.sprintf = exports.Rect = exports.Size = exports.Point = exports.camelCase = exports.pascalCase = exports.parseIntlFloat = exports.roundTo = exports.isTouchDevice = void 0;
|
|
31
|
+
exports.installHMR = exports.generatePassword = exports.classNames = exports.mix = exports.crc32 = exports.Clipboard = exports.isHtmlString = exports.html = exports.HtmlString = exports.clamp = exports.getMousePos = exports.NetworkError = exports.markdownToHtml = exports.asap = exports.deferCall = exports.waitFontLoading = exports.isNumber = exports.pad = exports.isLiteralObject = exports.isFunction = exports.isArray = exports.isString = exports.downloadData = exports.calcAge = exports.formatIntlDate = exports.parseIntlDate = exports.date_calc_weeknum = exports.date_clone = exports.date_hash = exports.date_sql_utc = exports.date_to_sql = exports.date_diff = exports.date_format = exports._date_set_locale = exports.removeHtmlTags = exports.escapeHtml = exports.sprintf = exports.Rect = exports.Size = exports.Point = exports.camelCase = exports.pascalCase = exports.parseIntlFloat = exports.roundTo = exports.isTouchDevice = void 0;
|
|
32
32
|
const x4dom_1 = require("./x4dom");
|
|
33
33
|
const i18n_1 = require("./i18n"); // you MUST create a file named translation.js
|
|
34
34
|
// :: ENVIRONMENT ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
@@ -407,7 +407,7 @@ exports.date_clone = date_clone;
|
|
|
407
407
|
function date_calc_weeknum(date) {
|
|
408
408
|
const firstDayOfYear = new Date(date.getFullYear(), 0, 1);
|
|
409
409
|
const pastDaysOfYear = (date.valueOf() - firstDayOfYear.valueOf()) / 86400000;
|
|
410
|
-
return Math.
|
|
410
|
+
return Math.floor((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
|
|
411
411
|
}
|
|
412
412
|
exports.date_calc_weeknum = date_calc_weeknum;
|
|
413
413
|
/**
|
|
@@ -1153,3 +1153,51 @@ function shuffle(str, maxlength) {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
return shuffled;
|
|
1155
1155
|
}
|
|
1156
|
+
/**
|
|
1157
|
+
* taken from live-server
|
|
1158
|
+
* https://github.com/tapio/live-server
|
|
1159
|
+
* @param host
|
|
1160
|
+
* @param port
|
|
1161
|
+
*/
|
|
1162
|
+
function installHMR(host = "127.0.0.1", port = "9876", reloadCallback) {
|
|
1163
|
+
let tm;
|
|
1164
|
+
function refreshCSS() {
|
|
1165
|
+
document.body.style.visibility = "hidden";
|
|
1166
|
+
let sheets = [].slice.call(document.getElementsByTagName("link"));
|
|
1167
|
+
let head = document.getElementsByTagName("head")[0];
|
|
1168
|
+
for (let i = 0; i < sheets.length; ++i) {
|
|
1169
|
+
let elem = sheets[i];
|
|
1170
|
+
head.removeChild(elem);
|
|
1171
|
+
let rel = elem.rel;
|
|
1172
|
+
if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") {
|
|
1173
|
+
let url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, '');
|
|
1174
|
+
elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());
|
|
1175
|
+
}
|
|
1176
|
+
head.appendChild(elem);
|
|
1177
|
+
}
|
|
1178
|
+
if (tm) {
|
|
1179
|
+
clearTimeout(tm);
|
|
1180
|
+
}
|
|
1181
|
+
tm = setTimeout(() => {
|
|
1182
|
+
document.body.style.visibility = "unset";
|
|
1183
|
+
}, 50);
|
|
1184
|
+
}
|
|
1185
|
+
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
|
1186
|
+
const address = `${protocol}${host}:${port}/ws`;
|
|
1187
|
+
const socket = new WebSocket(address);
|
|
1188
|
+
socket.onmessage = function (msg) {
|
|
1189
|
+
if (msg.data == 'reload') {
|
|
1190
|
+
if (reloadCallback) {
|
|
1191
|
+
reloadCallback();
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
window.location.reload();
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
else if (msg.data == 'refreshcss') {
|
|
1198
|
+
refreshCSS();
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
|
+
console.log('Live reload enabled.');
|
|
1202
|
+
}
|
|
1203
|
+
exports.installHMR = installHMR;
|
package/lib/treeview.js
CHANGED
|
@@ -196,10 +196,12 @@ class TreeView extends layout_1.VLayout {
|
|
|
196
196
|
let icon = node.icon;
|
|
197
197
|
if (icon === undefined) {
|
|
198
198
|
if (node.children) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
if (node.open === true) {
|
|
200
|
+
icon = 'var(--x4-icon-folder-opened)';
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
icon = 'var(--x4-icon-folder-closed)';
|
|
204
|
+
}
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
if (level >= 0) {
|
package/lib/version.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const x4js_version = "1.4";
|
package/lib/version.js
ADDED
package/lib/x4.css
CHANGED
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
--x4-default-border-color: rgba(0, 0, 0, 0.1);
|
|
50
50
|
--x4-icon-font-family: "fonteawesome";
|
|
51
51
|
--x4-icon-circle-exclamation: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4 400 256 400z"/></svg>';
|
|
52
|
-
--x4-icon-chevron-right: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/></svg>';
|
|
53
52
|
--x4-icon-arrow-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M9.375 329.4c12.51-12.51 32.76-12.49 45.25 0L128 402.8V32c0-17.69 14.31-32 32-32s32 14.31 32 32v370.8l73.38-73.38c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-128 128c-12.5 12.5-32.75 12.5-45.25 0l-128-128C-3.125 362.1-3.125 341.9 9.375 329.4z"/></svg>';
|
|
54
53
|
--x4-icon-arrow-up: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M310.6 182.6c-12.51 12.51-32.76 12.49-45.25 0L192 109.3V480c0 17.69-14.31 32-32 32s-32-14.31-32-32V109.3L54.63 182.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l128-128c12.5-12.5 32.75-12.5 45.25 0l128 128C323.1 149.9 323.1 170.1 310.6 182.6z"/></svg>';
|
|
55
54
|
--x4-icon-exclamation: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512" fill="currentColor"><path d="M64 352c17.69 0 32-14.32 32-31.1V64.01c0-17.67-14.31-32.01-32-32.01S32 46.34 32 64.01v255.1C32 337.7 46.31 352 64 352zM64 400c-22.09 0-40 17.91-40 40s17.91 39.1 40 39.1s40-17.9 40-39.1S86.09 400 64 400z"/></svg>';
|
|
@@ -62,6 +61,12 @@
|
|
|
62
61
|
--x4-icon-calendar-days: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32zM0 192H448V464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192zM64 304C64 312.8 71.16 320 80 320H112C120.8 320 128 312.8 128 304V272C128 263.2 120.8 256 112 256H80C71.16 256 64 263.2 64 272V304zM192 304C192 312.8 199.2 320 208 320H240C248.8 320 256 312.8 256 304V272C256 263.2 248.8 256 240 256H208C199.2 256 192 263.2 192 272V304zM336 256C327.2 256 320 263.2 320 272V304C320 312.8 327.2 320 336 320H368C376.8 320 384 312.8 384 304V272C384 263.2 376.8 256 368 256H336zM64 432C64 440.8 71.16 448 80 448H112C120.8 448 128 440.8 128 432V400C128 391.2 120.8 384 112 384H80C71.16 384 64 391.2 64 400V432zM208 384C199.2 384 192 391.2 192 400V432C192 440.8 199.2 448 208 448H240C248.8 448 256 440.8 256 432V400C256 391.2 248.8 384 240 384H208zM320 432C320 440.8 327.2 448 336 448H368C376.8 448 384 440.8 384 432V400C384 391.2 376.8 384 368 384H336C327.2 384 320 391.2 320 400V432z"/></svg>';
|
|
63
62
|
--x4-icon-tip: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"/></svg>';
|
|
64
63
|
--x4-icon-check: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M440.1 103C450.3 112.4 450.3 127.6 440.1 136.1L176.1 400.1C167.6 410.3 152.4 410.3 143 400.1L7.029 264.1C-2.343 255.6-2.343 240.4 7.029 231C16.4 221.7 31.6 221.7 40.97 231L160 350.1L407 103C416.4 93.66 431.6 93.66 440.1 103V103z"/></svg>';
|
|
64
|
+
--x4-icon-folder-closed: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M448 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H64C28.65 32 0 60.66 0 96v320c0 35.34 28.65 64 64 64h384c35.35 0 64-28.66 64-64V160C512 124.7 483.3 96 448 96zM64 80h117.5c4.273 0 8.293 1.664 11.31 4.688L256 144h192c8.822 0 16 7.176 16 16v32h-416V96C48 87.18 55.18 80 64 80zM448 432H64c-8.822 0-16-7.176-16-16V240h416V416C464 424.8 456.8 432 448 432z"/></svg>';
|
|
65
|
+
--x4-icon-folder-opened: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--! Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M572.6 270.3l-96 192C471.2 473.2 460.1 480 447.1 480H64c-35.35 0-64-28.66-64-64V96c0-35.34 28.65-64 64-64h117.5c16.97 0 33.25 6.742 45.26 18.75L275.9 96H416c35.35 0 64 28.66 64 64v32h-48V160c0-8.824-7.178-16-16-16H256L192.8 84.69C189.8 81.66 185.8 80 181.5 80H64C55.18 80 48 87.18 48 96v288l71.16-142.3C124.6 230.8 135.7 224 147.8 224h396.2C567.7 224 583.2 249 572.6 270.3z"/></svg>';
|
|
66
|
+
--x4-icon-chevron-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--! Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M432.6 209.3l-191.1 183.1C235.1 397.8 229.1 400 224 400s-11.97-2.219-16.59-6.688L15.41 209.3C5.814 200.2 5.502 184.1 14.69 175.4c9.125-9.625 24.38-9.938 33.91-.7187L224 342.8l175.4-168c9.5-9.219 24.78-8.906 33.91 .7187C442.5 184.1 442.2 200.2 432.6 209.3z"/></svg>';
|
|
67
|
+
--x4-icon-chevron-right: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/></svg>';
|
|
68
|
+
--x4-icon-chevron-left: 'data:image/svg+xml;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/></svg>';
|
|
69
|
+
--x4-icon-chevron-up: 'data:image/svg+xml;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M15.41 302.7l191.1-183.1C212 114.2 218 111.1 224 111.1s11.97 2.219 16.59 6.688l191.1 183.1c9.594 9.152 9.906 24.34 .7187 33.9c-9.125 9.625-24.38 9.938-33.91 .7187L224 169.2l-175.4 168c-9.5 9.219-24.78 8.906-33.91-.7187C5.502 327 5.814 311.8 15.41 302.7z"/></svg>';
|
|
65
70
|
}
|
|
66
71
|
/* source: https://tailwindcss.com/docs/customizing-colors/#default-color-palette */
|
|
67
72
|
:root {
|
|
@@ -416,7 +421,7 @@ textarea::selection {
|
|
|
416
421
|
.x-combo-box {
|
|
417
422
|
display: flex;
|
|
418
423
|
align-items: center;
|
|
419
|
-
width: min-content;
|
|
424
|
+
min-width: min-content;
|
|
420
425
|
min-height: 32px;
|
|
421
426
|
padding: 0;
|
|
422
427
|
margin: 0;
|
|
@@ -1115,17 +1120,17 @@ textarea::selection {
|
|
|
1115
1120
|
.x-spreadsheet .x-header .x-cell,
|
|
1116
1121
|
.x-grid-view .x-header .x-cell {
|
|
1117
1122
|
border-right: 1px solid rgba(0, 0, 0, 0.1);
|
|
1118
|
-
height:
|
|
1123
|
+
height: 100%;
|
|
1124
|
+
display: flex;
|
|
1125
|
+
align-items: center;
|
|
1119
1126
|
}
|
|
1120
1127
|
.x-spreadsheet .x-footer .x-cell span,
|
|
1121
1128
|
.x-grid-view .x-footer .x-cell span,
|
|
1122
1129
|
.x-spreadsheet .x-header .x-cell span,
|
|
1123
1130
|
.x-grid-view .x-header .x-cell span {
|
|
1124
1131
|
min-width: 0;
|
|
1125
|
-
text-transform: uppercase;
|
|
1126
1132
|
text-overflow: ellipsis;
|
|
1127
1133
|
overflow: hidden;
|
|
1128
|
-
font-weight: bold;
|
|
1129
1134
|
}
|
|
1130
1135
|
.x-spreadsheet .x-footer .x-cell.sort,
|
|
1131
1136
|
.x-grid-view .x-footer .x-cell.sort,
|
|
@@ -1134,14 +1139,11 @@ textarea::selection {
|
|
|
1134
1139
|
height: 0.7rem;
|
|
1135
1140
|
opacity: 0.7;
|
|
1136
1141
|
}
|
|
1137
|
-
.x-spreadsheet .x-header .x-cell,
|
|
1138
|
-
.x-grid-view .x-header .x-cell {
|
|
1139
|
-
display: flex;
|
|
1140
|
-
align-items: center;
|
|
1141
|
-
}
|
|
1142
1142
|
.x-spreadsheet .x-header .x-cell span,
|
|
1143
1143
|
.x-grid-view .x-header .x-cell span {
|
|
1144
1144
|
width: unset;
|
|
1145
|
+
text-transform: uppercase;
|
|
1146
|
+
font-weight: bold;
|
|
1145
1147
|
}
|
|
1146
1148
|
.x-spreadsheet .x-header .x-cell .sort,
|
|
1147
1149
|
.x-grid-view .x-header .x-cell .sort {
|
|
@@ -1622,15 +1624,22 @@ textarea::selection {
|
|
|
1622
1624
|
}
|
|
1623
1625
|
.x-tree-view .x-tree-item .tree-icon {
|
|
1624
1626
|
width: 2em;
|
|
1627
|
+
color: #999;
|
|
1628
|
+
height: 0.8em;
|
|
1629
|
+
}
|
|
1630
|
+
.x-tree-view .x-tree-item.selected {
|
|
1631
|
+
background-color: var(--x4-selection-color);
|
|
1632
|
+
color: var(--x4-selection-text);
|
|
1625
1633
|
}
|
|
1626
|
-
.x-tree-view .x-tree-item.
|
|
1627
|
-
|
|
1634
|
+
.x-tree-view .x-tree-item.selected .tree-icon {
|
|
1635
|
+
color: var(--x4-selection-text);
|
|
1628
1636
|
}
|
|
1629
1637
|
.x-tree-view .x-tree-item:hover {
|
|
1630
|
-
background-color:
|
|
1638
|
+
background-color: var(--x4-hover-color);
|
|
1639
|
+
color: var(--x4-hover-text);
|
|
1631
1640
|
}
|
|
1632
|
-
.x-tree-view .x-tree-item.
|
|
1633
|
-
|
|
1641
|
+
.x-tree-view .x-tree-item:hover .tree-icon {
|
|
1642
|
+
color: var(--x4-hover-text);
|
|
1634
1643
|
}
|
|
1635
1644
|
.x-tree-view .x-tree-item .indent {
|
|
1636
1645
|
position: absolute;
|
package/package.json
CHANGED
package/src/action.ts
CHANGED
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
-
import { BasicEvent } from './x4events'
|
|
30
|
+
import { BasicEvent, EvChange } from './x4events'
|
|
31
31
|
import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component'
|
|
32
32
|
import { IconID } from "./icon"
|
|
33
|
-
import {
|
|
33
|
+
import { EventHandler } from './component';
|
|
34
34
|
|
|
35
35
|
//TODO: implement all
|
|
36
36
|
|
package/src/application.ts
CHANGED
|
@@ -30,11 +30,9 @@
|
|
|
30
30
|
import { x4document } from './x4dom'
|
|
31
31
|
import { EvMessage } from './x4events'
|
|
32
32
|
import { BaseComponent, BaseComponentEventMap, BaseComponentProps } from './base_component'
|
|
33
|
-
import { Component } from './component'
|
|
33
|
+
import { Component, flyWrap } from './component'
|
|
34
34
|
import { Settings } from './settings'
|
|
35
|
-
import { deferCall } from './tools'
|
|
36
35
|
import { _tr } from './i18n'
|
|
37
|
-
import { flyWrap } from 'x4js'
|
|
38
36
|
|
|
39
37
|
const _x4_touch_time = Symbol( );
|
|
40
38
|
|
package/src/button.ts
CHANGED
|
@@ -104,6 +104,10 @@ export class BaseButton<P extends ButtonProps = ButtonProps, E extends ButtonEve
|
|
|
104
104
|
const ui_label = new Label({ flex: 1, text: text ?? '', align: props.align, ref: 'label' });
|
|
105
105
|
const ui_ricon = props.rightIcon ? new Icon({ icon: props.rightIcon, cls: 'right', ref: 'r_icon' }) : null;
|
|
106
106
|
|
|
107
|
+
if( text===undefined ) {
|
|
108
|
+
ui_label.addClass( "@hidden" );
|
|
109
|
+
}
|
|
110
|
+
|
|
107
111
|
this.setContent([ui_icon, ui_label, ui_ricon]);
|
|
108
112
|
this._setTabIndex(props.tabIndex);
|
|
109
113
|
}
|
|
@@ -203,7 +207,7 @@ export class BaseButton<P extends ButtonProps = ButtonProps, E extends ButtonEve
|
|
|
203
207
|
this.m_props.text = text;
|
|
204
208
|
|
|
205
209
|
let label = this.itemWithRef<Label>('label');
|
|
206
|
-
if (label) { label.text = text; }
|
|
210
|
+
if (label) { label.text = text; label.removeClass("@hidden") }
|
|
207
211
|
}
|
|
208
212
|
|
|
209
213
|
public get text(): string | HtmlString {
|
package/src/component.ts
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* create Container class
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
import { pascalCase, Rect, isString, isArray, Size,
|
|
36
|
+
import { pascalCase, Rect, isString, isArray, Size, isNumber, asap, HtmlString, isHtmlString, Constructor, getMousePos } from './tools';
|
|
37
37
|
import { x4document } from './x4dom';
|
|
38
38
|
|
|
39
39
|
import { Stylesheet, ComputedStyle } from './styles';
|
|
@@ -41,7 +41,6 @@ import { _tr } from './i18n';
|
|
|
41
41
|
import { BasicEvent, EventCallback } from './x4events';
|
|
42
42
|
import { BaseComponent, BaseComponentProps, BaseComponentEventMap } from './base_component';
|
|
43
43
|
import { IDOMEvents, X4ElementEventMap } from './dom_events';
|
|
44
|
-
import { IconID } from 'x4js';
|
|
45
44
|
|
|
46
45
|
export { HtmlString, isHtmlString, html } from './tools'
|
|
47
46
|
|
package/src/form.ts
CHANGED
|
@@ -59,7 +59,7 @@ export interface FormProps extends CProps<FormEventMap> {
|
|
|
59
59
|
*
|
|
60
60
|
*/
|
|
61
61
|
|
|
62
|
-
export class Form extends
|
|
62
|
+
export class Form<T extends FormProps = FormProps, E extends FormEventMap = FormEventMap> extends VLayout<T, E>
|
|
63
63
|
{
|
|
64
64
|
protected m_height: string | number;
|
|
65
65
|
protected m_container: Container;
|
|
@@ -67,7 +67,7 @@ export class Form extends VLayout<FormProps, FormEventMap>
|
|
|
67
67
|
protected m_dirty: boolean;
|
|
68
68
|
protected m_watchChanges: boolean;
|
|
69
69
|
|
|
70
|
-
constructor(props:
|
|
70
|
+
constructor(props: T) {
|
|
71
71
|
|
|
72
72
|
let content = props.content;
|
|
73
73
|
props.content = null;
|
package/src/gridview.ts
CHANGED
|
@@ -41,7 +41,7 @@ import { Component, ContainerEventMap, EvSize, EvDblClick, CProps, flyWrap, html
|
|
|
41
41
|
import { Label } from './label'
|
|
42
42
|
import { _tr } from './i18n'
|
|
43
43
|
import * as Formatters from './formatters'
|
|
44
|
-
import { downloadData } from './tools'
|
|
44
|
+
import { downloadData, isFunction } from './tools'
|
|
45
45
|
import { DataView, DataStore, Record } from './datastore'
|
|
46
46
|
|
|
47
47
|
import { EvContextMenu, EvSelectionChange, BasicEvent, EventDisposer } from "./x4events";
|
|
@@ -134,10 +134,19 @@ class ColHeader extends Component {
|
|
|
134
134
|
return this.m_sorted;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
set sorted( v ) {
|
|
137
|
+
//set sorted( v ) {
|
|
138
|
+
// this.m_sorted = v;
|
|
139
|
+
// this.m_sens = 'dn';
|
|
140
|
+
// this.itemWithRef<Icon>( 'sorter' ).show( v );
|
|
141
|
+
//}
|
|
142
|
+
|
|
143
|
+
sort( v: boolean, sens: "up" | "dn" ) {
|
|
138
144
|
this.m_sorted = v;
|
|
139
|
-
|
|
140
|
-
|
|
145
|
+
this.m_sens = sens;
|
|
146
|
+
|
|
147
|
+
const ic = this.itemWithRef<Icon>('sorter');
|
|
148
|
+
ic.icon = this.m_sens == 'up' ? 'var( --x4-icon-arrow-down )' : 'var( --x4-icon-arrow-up )';
|
|
149
|
+
ic.show(v);
|
|
141
150
|
}
|
|
142
151
|
|
|
143
152
|
get sens( ) {
|
|
@@ -146,7 +155,7 @@ class ColHeader extends Component {
|
|
|
146
155
|
|
|
147
156
|
toggleSens( ) {
|
|
148
157
|
this.m_sens = this.m_sens=='up' ? 'dn' : 'up';
|
|
149
|
-
this.itemWithRef<Icon>( 'sorter' ).icon = this.m_sens=='
|
|
158
|
+
this.itemWithRef<Icon>( 'sorter' ).icon = this.m_sens=='up' ? 'var( --x4-icon-arrow-down )' : 'var( --x4-icon-arrow-up )';
|
|
150
159
|
}
|
|
151
160
|
}
|
|
152
161
|
|
|
@@ -588,7 +597,21 @@ export class GridView extends VLayout<GridViewProps, GridViewEventMap> {
|
|
|
588
597
|
*
|
|
589
598
|
*/
|
|
590
599
|
|
|
591
|
-
|
|
600
|
+
sortCol( name: string, asc = true ) {
|
|
601
|
+
const col = this.m_columns.find(c => c.id==name );
|
|
602
|
+
if( col===undefined ) {
|
|
603
|
+
console.assert( false, "unknown field "+name+" in grid.sortCol" );
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
this._sortCol( col, asc ? "dn" : "up" );
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
*
|
|
612
|
+
*/
|
|
613
|
+
|
|
614
|
+
private _sortCol(col: GridColumn, sens: "up" | "dn" = "up" ) {
|
|
592
615
|
|
|
593
616
|
if (col.sortable === false) {
|
|
594
617
|
return;
|
|
@@ -596,7 +619,7 @@ export class GridView extends VLayout<GridViewProps, GridViewEventMap> {
|
|
|
596
619
|
|
|
597
620
|
this.m_columns.forEach((c) => {
|
|
598
621
|
if (c !== col) {
|
|
599
|
-
(c as GridColumnInternal).$hdr.
|
|
622
|
+
(c as GridColumnInternal).$hdr.sort( false, "dn" );
|
|
600
623
|
}
|
|
601
624
|
});
|
|
602
625
|
|
|
@@ -606,7 +629,7 @@ export class GridView extends VLayout<GridViewProps, GridViewEventMap> {
|
|
|
606
629
|
$hdr.toggleSens( );
|
|
607
630
|
}
|
|
608
631
|
else {
|
|
609
|
-
$hdr.
|
|
632
|
+
$hdr.sort( true, sens );
|
|
610
633
|
}
|
|
611
634
|
|
|
612
635
|
if (this.m_dataview) {
|
|
@@ -1137,17 +1160,24 @@ export class GridView extends VLayout<GridViewProps, GridViewEventMap> {
|
|
|
1137
1160
|
if( cid ) {
|
|
1138
1161
|
let col = this.m_columns[cid];
|
|
1139
1162
|
|
|
1140
|
-
let
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1163
|
+
let value = rec[col.id];
|
|
1164
|
+
if( value!==undefined ) {
|
|
1165
|
+
if( isFunction(value) ) { // FooterRenderer
|
|
1166
|
+
value( c );
|
|
1167
|
+
}
|
|
1168
|
+
else {
|
|
1169
|
+
let text;
|
|
1170
|
+
const fmt = col.formatter;
|
|
1171
|
+
if (fmt && fmt instanceof Function) {
|
|
1172
|
+
text = fmt(value, rec);
|
|
1173
|
+
}
|
|
1174
|
+
else {
|
|
1175
|
+
text = value;
|
|
1176
|
+
}
|
|
1149
1177
|
|
|
1150
|
-
|
|
1178
|
+
c.setContent( text, false );
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1151
1181
|
}
|
|
1152
1182
|
});
|
|
1153
1183
|
}
|
package/src/index.ts
CHANGED
package/src/sidebarview.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
|
-
import { Component, CProps, Flex } from './component'
|
|
30
|
+
import { Component, CProps, Flex, Separator } from './component'
|
|
31
31
|
import { HLayout, VLayout } from './layout'
|
|
32
32
|
import { Button } from './button'
|
|
33
33
|
import { CardView, CardViewProps, ICardViewItem } from './cardview'
|
|
@@ -37,13 +37,14 @@ export interface SideBarItem extends ICardViewItem {
|
|
|
37
37
|
|
|
38
38
|
export interface SideBarProps extends CardViewProps {
|
|
39
39
|
bar_sizable?: boolean;
|
|
40
|
+
bar_width?: number;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
*
|
|
44
45
|
*/
|
|
45
46
|
|
|
46
|
-
export class SideBarView extends CardView {
|
|
47
|
+
export class SideBarView extends CardView<SideBarProps> {
|
|
47
48
|
m_sidebar: VLayout;
|
|
48
49
|
m_content: Component;
|
|
49
50
|
|
|
@@ -55,7 +56,7 @@ export class SideBarView extends CardView {
|
|
|
55
56
|
|
|
56
57
|
this.m_sidebar = new VLayout( {
|
|
57
58
|
cls: '@side-bar',
|
|
58
|
-
|
|
59
|
+
width: props.bar_width ?? undefined,
|
|
59
60
|
});
|
|
60
61
|
|
|
61
62
|
this.m_content = new HLayout( { flex: 1, cls: '@tab-container' } );
|
|
@@ -78,6 +79,7 @@ export class SideBarView extends CardView {
|
|
|
78
79
|
|
|
79
80
|
this.setContent( [
|
|
80
81
|
this.m_sidebar,
|
|
82
|
+
this.m_props.bar_sizable ? new Separator( { orientation: "horizontal", sizing: "before" }) : undefined,
|
|
81
83
|
this.m_content
|
|
82
84
|
] );
|
|
83
85
|
}
|
package/src/svgcomponent.ts
CHANGED
|
@@ -192,9 +192,22 @@ abstract class SVGItem {
|
|
|
192
192
|
return result+'"';
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
*/
|
|
198
|
+
|
|
195
199
|
renderContent( ): string {
|
|
196
200
|
return '';
|
|
197
201
|
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
*
|
|
205
|
+
*/
|
|
206
|
+
|
|
207
|
+
clip( id: string ) {
|
|
208
|
+
this.attr( "clip-path", `url(#${id})` );
|
|
209
|
+
return this;
|
|
210
|
+
}
|
|
198
211
|
}
|
|
199
212
|
|
|
200
213
|
/**
|
|
@@ -391,12 +404,13 @@ class SVGGradient extends SVGItem {
|
|
|
391
404
|
*
|
|
392
405
|
*/
|
|
393
406
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
private m_items: SVGItem[];
|
|
407
|
+
class SVGGroup extends SVGItem {
|
|
408
|
+
protected m_items: SVGItem[];
|
|
397
409
|
|
|
398
|
-
constructor( ) {
|
|
399
|
-
|
|
410
|
+
constructor( tag = "g" ) {
|
|
411
|
+
super( tag )
|
|
412
|
+
|
|
413
|
+
this.m_items = [];
|
|
400
414
|
}
|
|
401
415
|
|
|
402
416
|
path( ) {
|
|
@@ -445,7 +459,7 @@ export class SVGPathBuilder
|
|
|
445
459
|
this.m_items = [];
|
|
446
460
|
}
|
|
447
461
|
|
|
448
|
-
|
|
462
|
+
renderContent( ) {
|
|
449
463
|
let result: string[] = [];
|
|
450
464
|
this.m_items.forEach( i => {
|
|
451
465
|
result.push( i.render() );
|
|
@@ -455,6 +469,41 @@ export class SVGPathBuilder
|
|
|
455
469
|
}
|
|
456
470
|
}
|
|
457
471
|
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
*
|
|
475
|
+
*/
|
|
476
|
+
|
|
477
|
+
export class SVGPathBuilder extends SVGGroup
|
|
478
|
+
{
|
|
479
|
+
private static g_clip_id = 1;
|
|
480
|
+
|
|
481
|
+
constructor( ) {
|
|
482
|
+
super( '' );
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
addClip( x: number, y: number, w: number, h: number ) {
|
|
486
|
+
|
|
487
|
+
const id = 'c-'+SVGPathBuilder.g_clip_id++;
|
|
488
|
+
const clip = new SVGGroup( 'clipPath' );
|
|
489
|
+
clip.attr('id', id );
|
|
490
|
+
clip.rect( x, y, w, h );
|
|
491
|
+
|
|
492
|
+
this.m_items.push(clip);
|
|
493
|
+
return id;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
render() {
|
|
497
|
+
|
|
498
|
+
let result = [];
|
|
499
|
+
this.m_items.forEach(i => {
|
|
500
|
+
result.push(i.render());
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
return result.join('\n');
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
458
507
|
/**
|
|
459
508
|
*
|
|
460
509
|
*/
|
package/src/textedit.ts
CHANGED
|
@@ -87,13 +87,13 @@ export interface TextEditProps extends InputProps<TextEditEventMap> {
|
|
|
87
87
|
* TextEdit is a single line editor, it can have a label and an error descriptor.
|
|
88
88
|
*/
|
|
89
89
|
|
|
90
|
-
export class TextEdit<T extends TextEditProps = TextEditProps> extends Component<
|
|
90
|
+
export class TextEdit<T extends TextEditProps = TextEditProps, E extends TextEditEventMap = TextEditEventMap > extends Component<T, E> {
|
|
91
91
|
|
|
92
92
|
private m_cal_popup: PopupCalendar;
|
|
93
93
|
protected m_ui_input: Input;
|
|
94
94
|
private m_error_tip: Tooltip;
|
|
95
95
|
|
|
96
|
-
constructor(props:
|
|
96
|
+
constructor(props: T) {
|
|
97
97
|
super(props);
|
|
98
98
|
this.addClass( '@hlayout' );
|
|
99
99
|
this.mapPropEvents( props, 'change', 'click', 'focus' );
|
|
@@ -410,7 +410,7 @@ export class TextEdit<T extends TextEditProps = TextEditProps> extends Component
|
|
|
410
410
|
return this._validate(this.value);
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
|
|
413
|
+
protected _validate(value: string): boolean {
|
|
414
414
|
let props = this.m_props;
|
|
415
415
|
let update = false;
|
|
416
416
|
|
package/src/tools.ts
CHANGED
|
@@ -496,7 +496,7 @@ export function date_clone(date: Date): Date {
|
|
|
496
496
|
export function date_calc_weeknum(date: Date): number {
|
|
497
497
|
const firstDayOfYear = new Date(date.getFullYear(), 0, 1);
|
|
498
498
|
const pastDaysOfYear = (date.valueOf() - firstDayOfYear.valueOf()) / 86400000;
|
|
499
|
-
return Math.
|
|
499
|
+
return Math.floor((pastDaysOfYear + firstDayOfYear.getDay() + 1) / 7);
|
|
500
500
|
}
|
|
501
501
|
|
|
502
502
|
|
|
@@ -1406,3 +1406,63 @@ function shuffle(str: string, maxlength?: number) {
|
|
|
1406
1406
|
|
|
1407
1407
|
return shuffled;
|
|
1408
1408
|
}
|
|
1409
|
+
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
/**
|
|
1413
|
+
* taken from live-server
|
|
1414
|
+
* https://github.com/tapio/live-server
|
|
1415
|
+
* @param host
|
|
1416
|
+
* @param port
|
|
1417
|
+
*/
|
|
1418
|
+
|
|
1419
|
+
export function installHMR(host = "127.0.0.1", port = "9876", reloadCallback?: Function ) {
|
|
1420
|
+
|
|
1421
|
+
let tm;
|
|
1422
|
+
|
|
1423
|
+
function refreshCSS() {
|
|
1424
|
+
|
|
1425
|
+
document.body.style.visibility = "hidden";
|
|
1426
|
+
|
|
1427
|
+
let sheets = [].slice.call(document.getElementsByTagName("link"));
|
|
1428
|
+
let head = document.getElementsByTagName("head")[0];
|
|
1429
|
+
|
|
1430
|
+
for (let i = 0; i < sheets.length; ++i) {
|
|
1431
|
+
let elem = sheets[i];
|
|
1432
|
+
head.removeChild(elem);
|
|
1433
|
+
|
|
1434
|
+
let rel = elem.rel;
|
|
1435
|
+
if (elem.href && typeof rel != "string" || rel.length == 0 || rel.toLowerCase() == "stylesheet") {
|
|
1436
|
+
let url = elem.href.replace(/(&|\?)_cacheOverride=\d+/, '');
|
|
1437
|
+
elem.href = url + (url.indexOf('?') >= 0 ? '&' : '?') + '_cacheOverride=' + (new Date().valueOf());
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
head.appendChild(elem);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
if( tm ) { clearTimeout(tm); }
|
|
1444
|
+
tm = setTimeout( () => {
|
|
1445
|
+
document.body.style.visibility = "unset";
|
|
1446
|
+
}, 50 );
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
|
|
1450
|
+
const address = `${protocol}${host}:${port}/ws`;
|
|
1451
|
+
const socket = new WebSocket(address);
|
|
1452
|
+
|
|
1453
|
+
socket.onmessage = function (msg) {
|
|
1454
|
+
if (msg.data == 'reload') {
|
|
1455
|
+
if( reloadCallback ) {
|
|
1456
|
+
reloadCallback( );
|
|
1457
|
+
}
|
|
1458
|
+
else {
|
|
1459
|
+
window.location.reload();
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
else if (msg.data == 'refreshcss') {
|
|
1463
|
+
refreshCSS();
|
|
1464
|
+
}
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
console.log('Live reload enabled.');
|
|
1468
|
+
}
|
package/src/treeview.ts
CHANGED
|
@@ -289,12 +289,14 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
let icon: IconID = node.icon;
|
|
292
|
-
if (icon === undefined) {
|
|
292
|
+
if (icon === undefined ) {
|
|
293
293
|
if (node.children) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
294
|
+
if( node.open===true ) {
|
|
295
|
+
icon = 'var(--x4-icon-folder-opened)';
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
icon = 'var(--x4-icon-folder-closed)';
|
|
299
|
+
}
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const x4js_version = "1.4";
|
package/src/x4.less
CHANGED
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
// todo: svg
|
|
62
62
|
--x4-icon-font-family: "fonteawesome";
|
|
63
63
|
|
|
64
|
+
// icons are from Font Awesome by @fontawesome - https://fontawesome.com
|
|
64
65
|
--x4-icon-circle-exclamation: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM232 152C232 138.8 242.8 128 256 128s24 10.75 24 24v128c0 13.25-10.75 24-24 24S232 293.3 232 280V152zM256 400c-17.36 0-31.44-14.08-31.44-31.44c0-17.36 14.07-31.44 31.44-31.44s31.44 14.08 31.44 31.44C287.4 385.9 273.4 400 256 400z"/></svg>';
|
|
65
|
-
--x4-icon-chevron-right: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/></svg>';
|
|
66
66
|
--x4-icon-window-restore: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M432 64H208C199.2 64 192 71.16 192 80V96H128V80C128 35.82 163.8 0 208 0H432C476.2 0 512 35.82 512 80V304C512 348.2 476.2 384 432 384H416V320H432C440.8 320 448 312.8 448 304V80C448 71.16 440.8 64 432 64zM0 192C0 156.7 28.65 128 64 128H320C355.3 128 384 156.7 384 192V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V192zM96 256H288C305.7 256 320 241.7 320 224C320 206.3 305.7 192 288 192H96C78.33 192 64 206.3 64 224C64 241.7 78.33 256 96 256z"/></svg>';
|
|
67
67
|
--x4-icon-arrow-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M9.375 329.4c12.51-12.51 32.76-12.49 45.25 0L128 402.8V32c0-17.69 14.31-32 32-32s32 14.31 32 32v370.8l73.38-73.38c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-128 128c-12.5 12.5-32.75 12.5-45.25 0l-128-128C-3.125 362.1-3.125 341.9 9.375 329.4z"/></svg>';
|
|
68
68
|
--x4-icon-arrow-up: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M310.6 182.6c-12.51 12.51-32.76 12.49-45.25 0L192 109.3V480c0 17.69-14.31 32-32 32s-32-14.31-32-32V109.3L54.63 182.6c-12.5 12.5-32.75 12.5-45.25 0s-12.5-32.75 0-45.25l128-128c12.5-12.5 32.75-12.5 45.25 0l128 128C323.1 149.9 323.1 170.1 310.6 182.6z"/></svg>';
|
|
@@ -76,6 +76,12 @@
|
|
|
76
76
|
--x4-icon-calendar-days: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32zM0 192H448V464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192zM64 304C64 312.8 71.16 320 80 320H112C120.8 320 128 312.8 128 304V272C128 263.2 120.8 256 112 256H80C71.16 256 64 263.2 64 272V304zM192 304C192 312.8 199.2 320 208 320H240C248.8 320 256 312.8 256 304V272C256 263.2 248.8 256 240 256H208C199.2 256 192 263.2 192 272V304zM336 256C327.2 256 320 263.2 320 272V304C320 312.8 327.2 320 336 320H368C376.8 320 384 312.8 384 304V272C384 263.2 376.8 256 368 256H336zM64 432C64 440.8 71.16 448 80 448H112C120.8 448 128 440.8 128 432V400C128 391.2 120.8 384 112 384H80C71.16 384 64 391.2 64 400V432zM208 384C199.2 384 192 391.2 192 400V432C192 440.8 199.2 448 208 448H240C248.8 448 256 440.8 256 432V400C256 391.2 248.8 384 240 384H208zM320 432C320 440.8 327.2 448 336 448H368C376.8 448 384 440.8 384 432V400C384 391.2 376.8 384 368 384H336C327.2 384 320 391.2 320 400V432z"/></svg>';
|
|
77
77
|
--x4-icon-tip: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"/></svg>';
|
|
78
78
|
--x4-icon-check: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M440.1 103C450.3 112.4 450.3 127.6 440.1 136.1L176.1 400.1C167.6 410.3 152.4 410.3 143 400.1L7.029 264.1C-2.343 255.6-2.343 240.4 7.029 231C16.4 221.7 31.6 221.7 40.97 231L160 350.1L407 103C416.4 93.66 431.6 93.66 440.1 103V103z"/></svg>';
|
|
79
|
+
--x4-icon-folder-closed: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M448 96h-172.1L226.7 50.75C214.7 38.74 198.5 32 181.5 32H64C28.65 32 0 60.66 0 96v320c0 35.34 28.65 64 64 64h384c35.35 0 64-28.66 64-64V160C512 124.7 483.3 96 448 96zM64 80h117.5c4.273 0 8.293 1.664 11.31 4.688L256 144h192c8.822 0 16 7.176 16 16v32h-416V96C48 87.18 55.18 80 64 80zM448 432H64c-8.822 0-16-7.176-16-16V240h416V416C464 424.8 456.8 432 448 432z"/></svg>';
|
|
80
|
+
--x4-icon-folder-opened: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--! Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M572.6 270.3l-96 192C471.2 473.2 460.1 480 447.1 480H64c-35.35 0-64-28.66-64-64V96c0-35.34 28.65-64 64-64h117.5c16.97 0 33.25 6.742 45.26 18.75L275.9 96H416c35.35 0 64 28.66 64 64v32h-48V160c0-8.824-7.178-16-16-16H256L192.8 84.69C189.8 81.66 185.8 80 181.5 80H64C55.18 80 48 87.18 48 96v288l71.16-142.3C124.6 230.8 135.7 224 147.8 224h396.2C567.7 224 583.2 249 572.6 270.3z"/></svg>';
|
|
81
|
+
--x4-icon-chevron-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><!--! Font Awesome Pro 6.1.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --><path d="M432.6 209.3l-191.1 183.1C235.1 397.8 229.1 400 224 400s-11.97-2.219-16.59-6.688L15.41 209.3C5.814 200.2 5.502 184.1 14.69 175.4c9.125-9.625 24.38-9.938 33.91-.7187L224 342.8l175.4-168c9.5-9.219 24.78-8.906 33.91 .7187C442.5 184.1 442.2 200.2 432.6 209.3z"/></svg>';
|
|
82
|
+
--x4-icon-chevron-right: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"/></svg>';
|
|
83
|
+
--x4-icon-chevron-left: 'data:image/svg+xml;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M206.7 464.6l-183.1-191.1C18.22 267.1 16 261.1 16 256s2.219-11.97 6.688-16.59l183.1-191.1c9.152-9.594 24.34-9.906 33.9-.7187c9.625 9.125 9.938 24.37 .7187 33.91L73.24 256l168 175.4c9.219 9.5 8.906 24.78-.7187 33.91C231 474.5 215.8 474.2 206.7 464.6z"/></svg>';
|
|
84
|
+
--x4-icon-chevron-up: 'data:image/svg+xml;<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M15.41 302.7l191.1-183.1C212 114.2 218 111.1 224 111.1s11.97 2.219 16.59 6.688l191.1 183.1c9.594 9.152 9.906 24.34 .7187 33.9c-9.125 9.625-24.38 9.938-33.91 .7187L224 169.2l-175.4 168c-9.5 9.219-24.78 8.906-33.91-.7187C5.502 327 5.814 311.8 15.41 302.7z"/></svg>';
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
@BLACK10: rgba(0,0,0,0.1);
|
|
@@ -526,7 +532,7 @@ textarea {
|
|
|
526
532
|
display: flex;
|
|
527
533
|
align-items: center;
|
|
528
534
|
//width: 100%;
|
|
529
|
-
width: min-content;
|
|
535
|
+
min-width: min-content;
|
|
530
536
|
min-height: 32px;
|
|
531
537
|
padding: 0;
|
|
532
538
|
|
|
@@ -1366,14 +1372,14 @@ textarea {
|
|
|
1366
1372
|
|
|
1367
1373
|
.x-cell {
|
|
1368
1374
|
border-right: 1px solid rgba(0,0,0,0.1);
|
|
1369
|
-
height:
|
|
1375
|
+
height: 100%;
|
|
1376
|
+
display: flex;
|
|
1377
|
+
align-items: center;
|
|
1370
1378
|
|
|
1371
1379
|
span {
|
|
1372
1380
|
min-width: 0;
|
|
1373
|
-
text-transform: uppercase;
|
|
1374
1381
|
text-overflow: ellipsis;
|
|
1375
1382
|
overflow: hidden;
|
|
1376
|
-
font-weight: bold;
|
|
1377
1383
|
}
|
|
1378
1384
|
|
|
1379
1385
|
&.sort {
|
|
@@ -1385,10 +1391,10 @@ textarea {
|
|
|
1385
1391
|
|
|
1386
1392
|
.x-header {
|
|
1387
1393
|
.x-cell {
|
|
1388
|
-
display: flex;
|
|
1389
|
-
align-items: center;
|
|
1390
1394
|
span {
|
|
1391
1395
|
width: unset;
|
|
1396
|
+
text-transform: uppercase;
|
|
1397
|
+
font-weight: bold;
|
|
1392
1398
|
}
|
|
1393
1399
|
|
|
1394
1400
|
.sort {
|
|
@@ -2031,29 +2037,28 @@ textarea {
|
|
|
2031
2037
|
padding: 0 4px;
|
|
2032
2038
|
}
|
|
2033
2039
|
|
|
2034
|
-
//&::before {
|
|
2035
|
-
// content: attr( icon );
|
|
2036
|
-
// font-family: var( --x4-icon-font-family );
|
|
2037
|
-
// display: inline-block;
|
|
2038
|
-
// width: 1em;
|
|
2039
|
-
// color: @BLACK40;
|
|
2040
|
-
// pointer-events: none;
|
|
2041
|
-
//}
|
|
2042
|
-
|
|
2043
2040
|
.tree-icon {
|
|
2044
2041
|
width: 2em;
|
|
2042
|
+
color:#999;
|
|
2043
|
+
height: 0.8em;
|
|
2045
2044
|
}
|
|
2046
2045
|
|
|
2047
|
-
&.
|
|
2048
|
-
|
|
2046
|
+
&.selected {
|
|
2047
|
+
background-color: var( --x4-selection-color );
|
|
2048
|
+
color: var( --x4-selection-text );
|
|
2049
|
+
|
|
2050
|
+
.tree-icon {
|
|
2051
|
+
color: var( --x4-selection-text );
|
|
2052
|
+
}
|
|
2049
2053
|
}
|
|
2050
2054
|
|
|
2051
2055
|
&:hover {
|
|
2052
|
-
background-color:
|
|
2053
|
-
|
|
2056
|
+
background-color: var( --x4-hover-color );
|
|
2057
|
+
color: var( --x4-hover-text );
|
|
2054
2058
|
|
|
2055
|
-
|
|
2056
|
-
|
|
2059
|
+
.tree-icon {
|
|
2060
|
+
color: var( --x4-hover-text );
|
|
2061
|
+
}
|
|
2057
2062
|
}
|
|
2058
2063
|
|
|
2059
2064
|
.indent {
|