x4js 1.5.12 → 1.5.15
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/cjs/checkbox.js +2 -1
- package/lib/cjs/form.js +8 -1
- package/lib/cjs/spreadsheet.js +7 -1
- package/lib/cjs/svgcomponent.js +36 -8
- package/lib/cjs/treeview.js +2 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/checkbox.js +2 -1
- package/lib/esm/form.js +8 -1
- package/lib/esm/spreadsheet.js +7 -1
- package/lib/esm/svgcomponent.js +37 -9
- package/lib/esm/treeview.js +2 -1
- package/lib/esm/version.js +1 -1
- package/lib/src/checkbox.ts +2 -1
- package/lib/src/form.ts +10 -1
- package/lib/src/spreadsheet.ts +9 -2
- package/lib/src/svgcomponent.ts +49 -9
- package/lib/src/treeview.ts +4 -2
- package/lib/src/version.ts +1 -1
- package/lib/src/x4.less +33 -28
- package/lib/styles/x4.css +10 -6
- package/lib/styles/x4.less +33 -28
- package/lib/types/form.d.ts +8 -1
- package/lib/types/spreadsheet.d.ts +5 -1
- package/lib/types/svgcomponent.d.ts +27 -3
- package/lib/types/treeview.d.ts +1 -0
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/checkbox.js
CHANGED
|
@@ -69,6 +69,7 @@ class CheckBox extends component_1.Component {
|
|
|
69
69
|
change: this._change.bind(this),
|
|
70
70
|
}
|
|
71
71
|
}),
|
|
72
|
+
props.slider ? new component_1.Component({ cls: '@slide-el' }) : null,
|
|
72
73
|
new label_1.Label({
|
|
73
74
|
text: (_d = props.text) !== null && _d !== void 0 ? _d : '',
|
|
74
75
|
width: labelWidth < 0 ? undefined : labelWidth,
|
|
@@ -80,7 +81,7 @@ class CheckBox extends component_1.Component {
|
|
|
80
81
|
attrs: {
|
|
81
82
|
"for": uid
|
|
82
83
|
}
|
|
83
|
-
})
|
|
84
|
+
}),
|
|
84
85
|
]);
|
|
85
86
|
}
|
|
86
87
|
/**
|
package/lib/cjs/form.js
CHANGED
|
@@ -271,7 +271,8 @@ class Form extends layout_1.VLayout {
|
|
|
271
271
|
return (0, request_1.ajaxRequest)(cfg);
|
|
272
272
|
}
|
|
273
273
|
/**
|
|
274
|
-
*
|
|
274
|
+
* to be abble to see the dirty flag, you need to call this method
|
|
275
|
+
* cf. isDirty, setDirty
|
|
275
276
|
*/
|
|
276
277
|
watchChanges() {
|
|
277
278
|
if (this.dom) {
|
|
@@ -287,9 +288,15 @@ class Form extends layout_1.VLayout {
|
|
|
287
288
|
this.m_watchChanges = true;
|
|
288
289
|
}
|
|
289
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* cf. watchChanges
|
|
293
|
+
*/
|
|
290
294
|
setDirty(set = true) {
|
|
291
295
|
this.m_dirty = set;
|
|
292
296
|
}
|
|
297
|
+
/**
|
|
298
|
+
* cf. watchChanges
|
|
299
|
+
*/
|
|
293
300
|
isDirty() {
|
|
294
301
|
return this.m_dirty;
|
|
295
302
|
}
|
package/lib/cjs/spreadsheet.js
CHANGED
|
@@ -99,8 +99,14 @@ class Spreadsheet extends layout_1.VLayout {
|
|
|
99
99
|
this.m_columns[col].title = title;
|
|
100
100
|
this.update(10);
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* reset the spreadsheet
|
|
104
|
+
* @param columns
|
|
105
|
+
*/
|
|
102
106
|
reset(columns) {
|
|
103
|
-
|
|
107
|
+
if (columns) {
|
|
108
|
+
this.m_columns = columns;
|
|
109
|
+
}
|
|
104
110
|
this.m_cells_data = new Map();
|
|
105
111
|
this.m_rows_data = new Map();
|
|
106
112
|
this.update(10);
|
package/lib/cjs/svgcomponent.js
CHANGED
|
@@ -169,6 +169,24 @@ class SVGItem {
|
|
|
169
169
|
this.attr("clip-path", `url(#${id})`);
|
|
170
170
|
return this;
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
transform(tr) {
|
|
176
|
+
this.attr("transform", tr);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
*/
|
|
181
|
+
rotate(deg, cx, cy) {
|
|
182
|
+
this.transform(`rotate( ${deg} ${cx} ${cy} )`);
|
|
183
|
+
}
|
|
184
|
+
translate(dx, dy) {
|
|
185
|
+
this.transform(`translate( ${dx} ${dy} )`);
|
|
186
|
+
}
|
|
187
|
+
scale(x) {
|
|
188
|
+
this.transform(`scale( ${x} )`);
|
|
189
|
+
}
|
|
172
190
|
}
|
|
173
191
|
/**
|
|
174
192
|
*
|
|
@@ -294,18 +312,15 @@ class SVGShape extends SVGItem {
|
|
|
294
312
|
super(tag);
|
|
295
313
|
}
|
|
296
314
|
}
|
|
297
|
-
/**
|
|
298
|
-
*
|
|
299
|
-
*/
|
|
300
315
|
class SVGGradient extends SVGItem {
|
|
301
316
|
constructor(x1, y1, x2, y2) {
|
|
302
317
|
super('linearGradient');
|
|
303
318
|
this.m_id = 'gx-' + SVGGradient.g_id;
|
|
304
319
|
this.attr('id', this.m_id);
|
|
305
|
-
this.attr('x1', num(x1) + '');
|
|
306
|
-
this.attr('x2', num(x2) + '');
|
|
307
|
-
this.attr('y1', num(y1) + '');
|
|
308
|
-
this.attr('y2', num(y2) + '');
|
|
320
|
+
this.attr('x1', (0, tools_1.isString)(x1) ? x1 : num(x1) + '');
|
|
321
|
+
this.attr('x2', (0, tools_1.isString)(x2) ? x2 : num(x2) + '');
|
|
322
|
+
this.attr('y1', (0, tools_1.isString)(y1) ? y1 : num(y1) + '');
|
|
323
|
+
this.attr('y2', (0, tools_1.isString)(y2) ? y2 : num(y2) + '');
|
|
309
324
|
this.m_stops = [];
|
|
310
325
|
SVGGradient.g_id++;
|
|
311
326
|
}
|
|
@@ -361,7 +376,20 @@ class SVGGroup extends SVGItem {
|
|
|
361
376
|
this.m_items.push(shape);
|
|
362
377
|
return shape;
|
|
363
378
|
}
|
|
364
|
-
|
|
379
|
+
/**
|
|
380
|
+
*
|
|
381
|
+
* example
|
|
382
|
+
* ```ts
|
|
383
|
+
* const g = c.linear_gradient( '0%', '0%', '0%', '100%' )
|
|
384
|
+
* .addStop( 0, 'red' )
|
|
385
|
+
* .addStop( 100, 'green' );
|
|
386
|
+
*
|
|
387
|
+
* p.rect( 0, 0, 100, 100 )
|
|
388
|
+
* .stroke( g.id );
|
|
389
|
+
*
|
|
390
|
+
* ```
|
|
391
|
+
*/
|
|
392
|
+
linear_gradient(x1, y1, x2, y2) {
|
|
365
393
|
const grad = new SVGGradient(x1, y1, x2, y2);
|
|
366
394
|
this.m_items.push(grad);
|
|
367
395
|
return grad;
|
package/lib/cjs/treeview.js
CHANGED
package/lib/cjs/version.js
CHANGED
package/lib/esm/checkbox.js
CHANGED
|
@@ -65,6 +65,7 @@ export class CheckBox extends Component {
|
|
|
65
65
|
change: this._change.bind(this),
|
|
66
66
|
}
|
|
67
67
|
}),
|
|
68
|
+
props.slider ? new Component({ cls: '@slide-el' }) : null,
|
|
68
69
|
new Label({
|
|
69
70
|
text: props.text ?? '',
|
|
70
71
|
width: labelWidth < 0 ? undefined : labelWidth,
|
|
@@ -76,7 +77,7 @@ export class CheckBox extends Component {
|
|
|
76
77
|
attrs: {
|
|
77
78
|
"for": uid
|
|
78
79
|
}
|
|
79
|
-
})
|
|
80
|
+
}),
|
|
80
81
|
]);
|
|
81
82
|
}
|
|
82
83
|
/**
|
package/lib/esm/form.js
CHANGED
|
@@ -272,7 +272,8 @@ export class Form extends VLayout {
|
|
|
272
272
|
return ajaxRequest(cfg);
|
|
273
273
|
}
|
|
274
274
|
/**
|
|
275
|
-
*
|
|
275
|
+
* to be abble to see the dirty flag, you need to call this method
|
|
276
|
+
* cf. isDirty, setDirty
|
|
276
277
|
*/
|
|
277
278
|
watchChanges() {
|
|
278
279
|
if (this.dom) {
|
|
@@ -288,9 +289,15 @@ export class Form extends VLayout {
|
|
|
288
289
|
this.m_watchChanges = true;
|
|
289
290
|
}
|
|
290
291
|
}
|
|
292
|
+
/**
|
|
293
|
+
* cf. watchChanges
|
|
294
|
+
*/
|
|
291
295
|
setDirty(set = true) {
|
|
292
296
|
this.m_dirty = set;
|
|
293
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* cf. watchChanges
|
|
300
|
+
*/
|
|
294
301
|
isDirty() {
|
|
295
302
|
return this.m_dirty;
|
|
296
303
|
}
|
package/lib/esm/spreadsheet.js
CHANGED
|
@@ -116,8 +116,14 @@ export class Spreadsheet extends VLayout {
|
|
|
116
116
|
this.m_columns[col].title = title;
|
|
117
117
|
this.update(10);
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* reset the spreadsheet
|
|
121
|
+
* @param columns
|
|
122
|
+
*/
|
|
119
123
|
reset(columns) {
|
|
120
|
-
|
|
124
|
+
if (columns) {
|
|
125
|
+
this.m_columns = columns;
|
|
126
|
+
}
|
|
121
127
|
this.m_cells_data = new Map();
|
|
122
128
|
this.m_rows_data = new Map();
|
|
123
129
|
this.update(10);
|
package/lib/esm/svgcomponent.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
**/
|
|
29
29
|
import { Component, _x4_unitless } from './component';
|
|
30
|
-
import { isNumber } from "./tools";
|
|
30
|
+
import { isNumber, isString } from "./tools";
|
|
31
31
|
const reNumber = /^-?\d+(\.\d+)?$/;
|
|
32
32
|
// degrees to radian
|
|
33
33
|
function d2r(d) {
|
|
@@ -169,6 +169,24 @@ class SVGItem {
|
|
|
169
169
|
this.attr("clip-path", `url(#${id})`);
|
|
170
170
|
return this;
|
|
171
171
|
}
|
|
172
|
+
/**
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
transform(tr) {
|
|
176
|
+
this.attr("transform", tr);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
*
|
|
180
|
+
*/
|
|
181
|
+
rotate(deg, cx, cy) {
|
|
182
|
+
this.transform(`rotate( ${deg} ${cx} ${cy} )`);
|
|
183
|
+
}
|
|
184
|
+
translate(dx, dy) {
|
|
185
|
+
this.transform(`translate( ${dx} ${dy} )`);
|
|
186
|
+
}
|
|
187
|
+
scale(x) {
|
|
188
|
+
this.transform(`scale( ${x} )`);
|
|
189
|
+
}
|
|
172
190
|
}
|
|
173
191
|
/**
|
|
174
192
|
*
|
|
@@ -296,9 +314,6 @@ class SVGShape extends SVGItem {
|
|
|
296
314
|
super(tag);
|
|
297
315
|
}
|
|
298
316
|
}
|
|
299
|
-
/**
|
|
300
|
-
*
|
|
301
|
-
*/
|
|
302
317
|
class SVGGradient extends SVGItem {
|
|
303
318
|
static g_id = 1;
|
|
304
319
|
m_id;
|
|
@@ -307,10 +322,10 @@ class SVGGradient extends SVGItem {
|
|
|
307
322
|
super('linearGradient');
|
|
308
323
|
this.m_id = 'gx-' + SVGGradient.g_id;
|
|
309
324
|
this.attr('id', this.m_id);
|
|
310
|
-
this.attr('x1', num(x1) + '');
|
|
311
|
-
this.attr('x2', num(x2) + '');
|
|
312
|
-
this.attr('y1', num(y1) + '');
|
|
313
|
-
this.attr('y2', num(y2) + '');
|
|
325
|
+
this.attr('x1', isString(x1) ? x1 : num(x1) + '');
|
|
326
|
+
this.attr('x2', isString(x2) ? x2 : num(x2) + '');
|
|
327
|
+
this.attr('y1', isString(y1) ? y1 : num(y1) + '');
|
|
328
|
+
this.attr('y2', isString(y2) ? y2 : num(y2) + '');
|
|
314
329
|
this.m_stops = [];
|
|
315
330
|
SVGGradient.g_id++;
|
|
316
331
|
}
|
|
@@ -366,7 +381,20 @@ class SVGGroup extends SVGItem {
|
|
|
366
381
|
this.m_items.push(shape);
|
|
367
382
|
return shape;
|
|
368
383
|
}
|
|
369
|
-
|
|
384
|
+
/**
|
|
385
|
+
*
|
|
386
|
+
* example
|
|
387
|
+
* ```ts
|
|
388
|
+
* const g = c.linear_gradient( '0%', '0%', '0%', '100%' )
|
|
389
|
+
* .addStop( 0, 'red' )
|
|
390
|
+
* .addStop( 100, 'green' );
|
|
391
|
+
*
|
|
392
|
+
* p.rect( 0, 0, 100, 100 )
|
|
393
|
+
* .stroke( g.id );
|
|
394
|
+
*
|
|
395
|
+
* ```
|
|
396
|
+
*/
|
|
397
|
+
linear_gradient(x1, y1, x2, y2) {
|
|
370
398
|
const grad = new SVGGradient(x1, y1, x2, y2);
|
|
371
399
|
this.m_items.push(grad);
|
|
372
400
|
return grad;
|
package/lib/esm/treeview.js
CHANGED
package/lib/esm/version.js
CHANGED
package/lib/src/checkbox.ts
CHANGED
|
@@ -103,6 +103,7 @@ export class CheckBox extends Component<CheckBoxProps, CheckBoxEventMap> {
|
|
|
103
103
|
change: this._change.bind(this),
|
|
104
104
|
}
|
|
105
105
|
}),
|
|
106
|
+
props.slider ? new Component( { cls: '@slide-el' } ) : null,
|
|
106
107
|
new Label({
|
|
107
108
|
text: props.text ?? '',
|
|
108
109
|
width: labelWidth < 0 ? undefined : labelWidth,
|
|
@@ -114,7 +115,7 @@ export class CheckBox extends Component<CheckBoxProps, CheckBoxEventMap> {
|
|
|
114
115
|
attrs: {
|
|
115
116
|
"for": uid
|
|
116
117
|
}
|
|
117
|
-
})
|
|
118
|
+
}),
|
|
118
119
|
]);
|
|
119
120
|
}
|
|
120
121
|
|
package/lib/src/form.ts
CHANGED
|
@@ -337,7 +337,8 @@ export class Form<T extends FormProps = FormProps, E extends FormEventMap = Form
|
|
|
337
337
|
}
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
|
-
*
|
|
340
|
+
* to be abble to see the dirty flag, you need to call this method
|
|
341
|
+
* cf. isDirty, setDirty
|
|
341
342
|
*/
|
|
342
343
|
|
|
343
344
|
watchChanges() {
|
|
@@ -356,10 +357,18 @@ export class Form<T extends FormProps = FormProps, E extends FormEventMap = Form
|
|
|
356
357
|
}
|
|
357
358
|
}
|
|
358
359
|
|
|
360
|
+
/**
|
|
361
|
+
* cf. watchChanges
|
|
362
|
+
*/
|
|
363
|
+
|
|
359
364
|
setDirty(set = true) {
|
|
360
365
|
this.m_dirty = set;
|
|
361
366
|
}
|
|
362
367
|
|
|
368
|
+
/**
|
|
369
|
+
* cf. watchChanges
|
|
370
|
+
*/
|
|
371
|
+
|
|
363
372
|
isDirty() {
|
|
364
373
|
return this.m_dirty;
|
|
365
374
|
}
|
package/lib/src/spreadsheet.ts
CHANGED
|
@@ -192,8 +192,15 @@ export class Spreadsheet extends VLayout<SpreadsheetProps, SpreadsheetEventSet>
|
|
|
192
192
|
this.update(10);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
/**
|
|
196
|
+
* reset the spreadsheet
|
|
197
|
+
* @param columns
|
|
198
|
+
*/
|
|
199
|
+
reset(columns?: ColProp[]) {
|
|
200
|
+
if( columns ) {
|
|
201
|
+
this.m_columns = columns;
|
|
202
|
+
}
|
|
203
|
+
|
|
197
204
|
this.m_cells_data = new Map<number, CellData>();
|
|
198
205
|
this.m_rows_data = new Map<number, string>();
|
|
199
206
|
this.update(10);
|
package/lib/src/svgcomponent.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
**/
|
|
29
29
|
|
|
30
30
|
import { Component, CProps, _x4_unitless } from './component'
|
|
31
|
-
import { isNumber } from "./tools"
|
|
31
|
+
import { isNumber, isString } from "./tools"
|
|
32
32
|
|
|
33
33
|
const reNumber = /^-?\d+(\.\d+)?$/;
|
|
34
34
|
|
|
@@ -208,6 +208,30 @@ abstract class SVGItem {
|
|
|
208
208
|
this.attr( "clip-path", `url(#${id})` );
|
|
209
209
|
return this;
|
|
210
210
|
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
*
|
|
214
|
+
*/
|
|
215
|
+
|
|
216
|
+
transform( tr: string ) {
|
|
217
|
+
this.attr( "transform", tr );
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
rotate( deg: number, cx: number, cy: number ) {
|
|
225
|
+
this.transform( `rotate( ${deg} ${cx} ${cy} )` );
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
translate( dx: number, dy: number ) {
|
|
229
|
+
this.transform( `translate( ${dx} ${dy} )` );
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
scale( x: number ) {
|
|
233
|
+
this.transform( `scale( ${x} )` );
|
|
234
|
+
}
|
|
211
235
|
}
|
|
212
236
|
|
|
213
237
|
/**
|
|
@@ -359,22 +383,24 @@ class SVGShape extends SVGItem {
|
|
|
359
383
|
*
|
|
360
384
|
*/
|
|
361
385
|
|
|
386
|
+
type number_or_perc = number | `${string}%`
|
|
387
|
+
|
|
362
388
|
class SVGGradient extends SVGItem {
|
|
363
389
|
|
|
364
390
|
private static g_id = 1;
|
|
365
391
|
|
|
366
392
|
private m_id: string;
|
|
367
|
-
private m_stops: { offset:
|
|
393
|
+
private m_stops: { offset: number_or_perc, color: string } [];
|
|
368
394
|
|
|
369
|
-
constructor( x1:
|
|
395
|
+
constructor( x1: number_or_perc, y1: number_or_perc, x2: number_or_perc, y2: number_or_perc ) {
|
|
370
396
|
super( 'linearGradient')
|
|
371
397
|
|
|
372
398
|
this.m_id = 'gx-'+SVGGradient.g_id;
|
|
373
399
|
this.attr( 'id', this.m_id );
|
|
374
|
-
this.attr( 'x1', num(x1)+'' );
|
|
375
|
-
this.attr( 'x2', num(x2)+'' );
|
|
376
|
-
this.attr( 'y1', num(y1)+'' );
|
|
377
|
-
this.attr( 'y2', num(y2)+'' );
|
|
400
|
+
this.attr( 'x1', isString(x1) ? x1 : num(x1)+'' );
|
|
401
|
+
this.attr( 'x2', isString(x2) ? x2 : num(x2)+'' );
|
|
402
|
+
this.attr( 'y1', isString(y1) ? y1 : num(y1)+'' );
|
|
403
|
+
this.attr( 'y2', isString(y2) ? y2 : num(y2)+'' );
|
|
378
404
|
|
|
379
405
|
this.m_stops = [];
|
|
380
406
|
SVGGradient.g_id++;
|
|
@@ -384,7 +410,7 @@ class SVGGradient extends SVGItem {
|
|
|
384
410
|
return 'url(#'+this.m_id+')';
|
|
385
411
|
}
|
|
386
412
|
|
|
387
|
-
addStop( offset:
|
|
413
|
+
addStop( offset: number_or_perc, color: string ): this {
|
|
388
414
|
this.m_stops.push( {offset,color} );
|
|
389
415
|
return this;
|
|
390
416
|
}
|
|
@@ -445,7 +471,21 @@ class SVGGroup extends SVGItem {
|
|
|
445
471
|
return shape;
|
|
446
472
|
}
|
|
447
473
|
|
|
448
|
-
|
|
474
|
+
/**
|
|
475
|
+
*
|
|
476
|
+
* example
|
|
477
|
+
* ```ts
|
|
478
|
+
* const g = c.linear_gradient( '0%', '0%', '0%', '100%' )
|
|
479
|
+
* .addStop( 0, 'red' )
|
|
480
|
+
* .addStop( 100, 'green' );
|
|
481
|
+
*
|
|
482
|
+
* p.rect( 0, 0, 100, 100 )
|
|
483
|
+
* .stroke( g.id );
|
|
484
|
+
*
|
|
485
|
+
* ```
|
|
486
|
+
*/
|
|
487
|
+
|
|
488
|
+
linear_gradient( x1: number_or_perc, y1: number_or_perc, x2: number_or_perc, y2: number_or_perc ) {
|
|
449
489
|
const grad = new SVGGradient( x1, y1, x2, y2 );
|
|
450
490
|
this.m_items.push( grad );
|
|
451
491
|
return grad;
|
package/lib/src/treeview.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface HierarchicalNode {
|
|
|
49
49
|
cls?: string;
|
|
50
50
|
leaf?: boolean
|
|
51
51
|
icon?: string;
|
|
52
|
+
data?: any;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
export interface TreeNode {
|
|
@@ -659,8 +660,9 @@ export class TreeView extends VLayout<TreeViewProps, TreeViewEventMap> {
|
|
|
659
660
|
id: node.id,
|
|
660
661
|
text: node.name,
|
|
661
662
|
parent: node.parent,
|
|
662
|
-
cls: node.cls
|
|
663
|
-
icon: node.icon
|
|
663
|
+
cls: node.cls,
|
|
664
|
+
icon: node.icon,
|
|
665
|
+
data: node.data,
|
|
664
666
|
};
|
|
665
667
|
|
|
666
668
|
if (!node.leaf) {
|
package/lib/src/version.ts
CHANGED
package/lib/src/x4.less
CHANGED
|
@@ -812,41 +812,46 @@ textarea {
|
|
|
812
812
|
height: 1px;
|
|
813
813
|
}
|
|
814
814
|
|
|
815
|
-
.x-
|
|
816
|
-
box-sizing: border-box;
|
|
817
|
-
position: absolute;
|
|
818
|
-
left: 0px;
|
|
819
|
-
top: 3px;
|
|
820
|
-
content: "";
|
|
821
|
-
display: inline-block;
|
|
815
|
+
.x-slide-el {
|
|
822
816
|
width: 2.4em;
|
|
823
817
|
height: 1.4em;
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
818
|
+
|
|
819
|
+
&:before {
|
|
820
|
+
box-sizing: border-box;
|
|
821
|
+
position: absolute;
|
|
822
|
+
left: 0px;
|
|
823
|
+
top: 0px;
|
|
824
|
+
content: "";
|
|
825
|
+
display: inline-block;
|
|
826
|
+
width: 2.4em;
|
|
827
|
+
height: 1.4em;
|
|
828
|
+
border-radius: 1.4rem;
|
|
829
|
+
padding: 2px;
|
|
830
|
+
background-color: @BLACK30;
|
|
831
|
+
transition: all .2s;
|
|
832
|
+
border: 1px solid @WHITE50
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// circle
|
|
836
|
+
&:after {
|
|
837
|
+
box-sizing: border-box;
|
|
838
|
+
content: "";
|
|
839
|
+
top: 2px;
|
|
840
|
+
height: calc(1.4em - 4px);
|
|
841
|
+
width: calc(1.4em - 4px);
|
|
842
|
+
border-radius: 50%;
|
|
843
|
+
background-color: #fff;
|
|
844
|
+
transition: all .2s;
|
|
845
|
+
position: absolute;
|
|
846
|
+
left: 2px;
|
|
847
|
+
}
|
|
843
848
|
}
|
|
844
849
|
|
|
845
|
-
input:checked + .x-
|
|
850
|
+
input:checked + .x-slide-el:before {
|
|
846
851
|
background-color: var( --x4-selection-color );
|
|
847
852
|
}
|
|
848
853
|
|
|
849
|
-
input:checked + .x-
|
|
854
|
+
input:checked + .x-slide-el:after {
|
|
850
855
|
left: calc( 1em + 2px);
|
|
851
856
|
background-color: white;
|
|
852
857
|
}
|
package/lib/styles/x4.css
CHANGED
|
@@ -646,11 +646,15 @@ textarea::selection {
|
|
|
646
646
|
width: 1px;
|
|
647
647
|
height: 1px;
|
|
648
648
|
}
|
|
649
|
-
.x-check-box.slider .x-
|
|
649
|
+
.x-check-box.slider .x-slide-el {
|
|
650
|
+
width: 2.4em;
|
|
651
|
+
height: 1.4em;
|
|
652
|
+
}
|
|
653
|
+
.x-check-box.slider .x-slide-el:before {
|
|
650
654
|
box-sizing: border-box;
|
|
651
655
|
position: absolute;
|
|
652
656
|
left: 0px;
|
|
653
|
-
top:
|
|
657
|
+
top: 0px;
|
|
654
658
|
content: "";
|
|
655
659
|
display: inline-block;
|
|
656
660
|
width: 2.4em;
|
|
@@ -661,10 +665,10 @@ textarea::selection {
|
|
|
661
665
|
transition: all 0.2s;
|
|
662
666
|
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
663
667
|
}
|
|
664
|
-
.x-check-box.slider .x-
|
|
668
|
+
.x-check-box.slider .x-slide-el:after {
|
|
665
669
|
box-sizing: border-box;
|
|
666
670
|
content: "";
|
|
667
|
-
top:
|
|
671
|
+
top: 2px;
|
|
668
672
|
height: calc(1.4em - 4px);
|
|
669
673
|
width: calc(1.4em - 4px);
|
|
670
674
|
border-radius: 50%;
|
|
@@ -673,10 +677,10 @@ textarea::selection {
|
|
|
673
677
|
position: absolute;
|
|
674
678
|
left: 2px;
|
|
675
679
|
}
|
|
676
|
-
.x-check-box.slider input:checked + .x-
|
|
680
|
+
.x-check-box.slider input:checked + .x-slide-el:before {
|
|
677
681
|
background-color: var(--x4-selection-color);
|
|
678
682
|
}
|
|
679
|
-
.x-check-box.slider input:checked + .x-
|
|
683
|
+
.x-check-box.slider input:checked + .x-slide-el:after {
|
|
680
684
|
left: calc(1em + 2px);
|
|
681
685
|
background-color: white;
|
|
682
686
|
}
|
package/lib/styles/x4.less
CHANGED
|
@@ -812,41 +812,46 @@ textarea {
|
|
|
812
812
|
height: 1px;
|
|
813
813
|
}
|
|
814
814
|
|
|
815
|
-
.x-
|
|
816
|
-
box-sizing: border-box;
|
|
817
|
-
position: absolute;
|
|
818
|
-
left: 0px;
|
|
819
|
-
top: 3px;
|
|
820
|
-
content: "";
|
|
821
|
-
display: inline-block;
|
|
815
|
+
.x-slide-el {
|
|
822
816
|
width: 2.4em;
|
|
823
817
|
height: 1.4em;
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
818
|
+
|
|
819
|
+
&:before {
|
|
820
|
+
box-sizing: border-box;
|
|
821
|
+
position: absolute;
|
|
822
|
+
left: 0px;
|
|
823
|
+
top: 0px;
|
|
824
|
+
content: "";
|
|
825
|
+
display: inline-block;
|
|
826
|
+
width: 2.4em;
|
|
827
|
+
height: 1.4em;
|
|
828
|
+
border-radius: 1.4rem;
|
|
829
|
+
padding: 2px;
|
|
830
|
+
background-color: @BLACK30;
|
|
831
|
+
transition: all .2s;
|
|
832
|
+
border: 1px solid @WHITE50
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// circle
|
|
836
|
+
&:after {
|
|
837
|
+
box-sizing: border-box;
|
|
838
|
+
content: "";
|
|
839
|
+
top: 2px;
|
|
840
|
+
height: calc(1.4em - 4px);
|
|
841
|
+
width: calc(1.4em - 4px);
|
|
842
|
+
border-radius: 50%;
|
|
843
|
+
background-color: #fff;
|
|
844
|
+
transition: all .2s;
|
|
845
|
+
position: absolute;
|
|
846
|
+
left: 2px;
|
|
847
|
+
}
|
|
843
848
|
}
|
|
844
849
|
|
|
845
|
-
input:checked + .x-
|
|
850
|
+
input:checked + .x-slide-el:before {
|
|
846
851
|
background-color: var( --x4-selection-color );
|
|
847
852
|
}
|
|
848
853
|
|
|
849
|
-
input:checked + .x-
|
|
854
|
+
input:checked + .x-slide-el:after {
|
|
850
855
|
left: calc( 1em + 2px);
|
|
851
856
|
background-color: white;
|
|
852
857
|
}
|
package/lib/types/form.d.ts
CHANGED
|
@@ -118,9 +118,16 @@ export declare class Form<T extends FormProps = FormProps, E extends FormEventMa
|
|
|
118
118
|
*/
|
|
119
119
|
submit(cfg: RequestProps, cbvalidation: Function): false | Function;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* to be abble to see the dirty flag, you need to call this method
|
|
122
|
+
* cf. isDirty, setDirty
|
|
122
123
|
*/
|
|
123
124
|
watchChanges(): void;
|
|
125
|
+
/**
|
|
126
|
+
* cf. watchChanges
|
|
127
|
+
*/
|
|
124
128
|
setDirty(set?: boolean): void;
|
|
129
|
+
/**
|
|
130
|
+
* cf. watchChanges
|
|
131
|
+
*/
|
|
125
132
|
isDirty(): boolean;
|
|
126
133
|
}
|
|
@@ -95,7 +95,11 @@ export declare class Spreadsheet extends VLayout<SpreadsheetProps, SpreadsheetEv
|
|
|
95
95
|
setColWidth(col: number, width: number): void;
|
|
96
96
|
getColWidth(col: number): number;
|
|
97
97
|
setColTitle(col: number, title: string): void;
|
|
98
|
-
|
|
98
|
+
/**
|
|
99
|
+
* reset the spreadsheet
|
|
100
|
+
* @param columns
|
|
101
|
+
*/
|
|
102
|
+
reset(columns?: ColProp[]): void;
|
|
99
103
|
/**
|
|
100
104
|
* insert a row
|
|
101
105
|
* @param before row number before wich insert the new row
|
|
@@ -84,6 +84,16 @@ declare abstract class SVGItem {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
clip(id: string): this;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
*/
|
|
90
|
+
transform(tr: string): void;
|
|
91
|
+
/**
|
|
92
|
+
*
|
|
93
|
+
*/
|
|
94
|
+
rotate(deg: number, cx: number, cy: number): void;
|
|
95
|
+
translate(dx: number, dy: number): void;
|
|
96
|
+
scale(x: number): void;
|
|
87
97
|
}
|
|
88
98
|
/**
|
|
89
99
|
*
|
|
@@ -143,13 +153,14 @@ declare class SVGShape extends SVGItem {
|
|
|
143
153
|
/**
|
|
144
154
|
*
|
|
145
155
|
*/
|
|
156
|
+
type number_or_perc = number | `${string}%`;
|
|
146
157
|
declare class SVGGradient extends SVGItem {
|
|
147
158
|
private static g_id;
|
|
148
159
|
private m_id;
|
|
149
160
|
private m_stops;
|
|
150
|
-
constructor(x1:
|
|
161
|
+
constructor(x1: number_or_perc, y1: number_or_perc, x2: number_or_perc, y2: number_or_perc);
|
|
151
162
|
get id(): string;
|
|
152
|
-
addStop(offset:
|
|
163
|
+
addStop(offset: number_or_perc, color: string): this;
|
|
153
164
|
renderContent(): string;
|
|
154
165
|
}
|
|
155
166
|
/**
|
|
@@ -162,7 +173,20 @@ declare class SVGGroup extends SVGItem {
|
|
|
162
173
|
text(x: any, y: any, txt: any): SVGText;
|
|
163
174
|
ellipse(x: any, y: any, r1: any, r2?: any): SVGShape;
|
|
164
175
|
rect(x: any, y: any, w: any, h: any): SVGShape;
|
|
165
|
-
|
|
176
|
+
/**
|
|
177
|
+
*
|
|
178
|
+
* example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const g = c.linear_gradient( '0%', '0%', '0%', '100%' )
|
|
181
|
+
* .addStop( 0, 'red' )
|
|
182
|
+
* .addStop( 100, 'green' );
|
|
183
|
+
*
|
|
184
|
+
* p.rect( 0, 0, 100, 100 )
|
|
185
|
+
* .stroke( g.id );
|
|
186
|
+
*
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
linear_gradient(x1: number_or_perc, y1: number_or_perc, x2: number_or_perc, y2: number_or_perc): SVGGradient;
|
|
166
190
|
/**
|
|
167
191
|
* clear
|
|
168
192
|
*/
|
package/lib/types/treeview.d.ts
CHANGED
package/lib/types/version.d.ts
CHANGED