x4js 2.0.15 → 2.0.18
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/x4.css +1 -1
- package/lib/cjs/x4.js +2 -2
- package/lib/esm/x4.css +1 -1
- package/lib/esm/x4.mjs +2 -2
- package/lib/src/components/components.ts +2 -1
- package/lib/src/core/component.ts +0 -9
- package/lib/src/x4.ts +4 -0
- package/lib/styles/x4.css +1 -1
- package/lib/types/x4js.d.ts +294 -193
- package/package.json +18 -28
- package/src/components/canvas/canvas.ts +1 -1
- package/src/components/components.ts +3 -1
- package/src/core/component.ts +0 -9
- package/src/x4.ts +4 -0
- package/.vscode/launch.json +0 -14
- package/demo/assets/house-light.svg +0 -1
- package/demo/assets/radio.svg +0 -4
- package/demo/index.html +0 -12
- package/demo/main.scss +0 -23
- package/demo/main.ts +0 -324
- package/demo/package.json +0 -26
- package/demo/scss.d.ts +0 -4
- package/demo/svg.d.ts +0 -1
- package/demo/tsconfig.json +0 -14
- package/scripts/build.mjs +0 -378
- package/scripts/prepack.mjs +0 -346
- package/tsconfig.json +0 -14
package/lib/types/x4js.d.ts
CHANGED
|
@@ -423,11 +423,6 @@ declare module 'x4js' {
|
|
|
423
423
|
uievent: UIEvent;
|
|
424
424
|
}
|
|
425
425
|
|
|
426
|
-
export interface EvMessage extends ComponentEvent {
|
|
427
|
-
msg: string;
|
|
428
|
-
params?: any;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
426
|
export interface EvDrag extends ComponentEvent {
|
|
432
427
|
element: unknown;
|
|
433
428
|
data: any;
|
|
@@ -441,6 +436,43 @@ declare module 'x4js' {
|
|
|
441
436
|
export interface EvDblClick extends ComponentEvent {
|
|
442
437
|
}
|
|
443
438
|
|
|
439
|
+
// ---------------------------------------
|
|
440
|
+
// from /src/core/core_application.ts
|
|
441
|
+
|
|
442
|
+
export interface EvMessage extends CoreEvent {
|
|
443
|
+
msg: string;
|
|
444
|
+
params: any;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface ApplicationEvents extends EventMap {
|
|
448
|
+
global: EvMessage;
|
|
449
|
+
message: EvMessage;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
class Process {
|
|
453
|
+
getMaxTouchPoints( ): void;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
export class Application<E extends ApplicationEvents = ApplicationEvents> extends CoreElement<E> {
|
|
457
|
+
env: any;
|
|
458
|
+
mainview: Component;
|
|
459
|
+
process: any;
|
|
460
|
+
constructor( );
|
|
461
|
+
setMainView( view: Component ): void;
|
|
462
|
+
instance<P extends Application = Application>( ): P;
|
|
463
|
+
getMainView( ): void;
|
|
464
|
+
setEnv( name: string, value: any ): void;
|
|
465
|
+
getEnv( name: string, def_value: any ): void;
|
|
466
|
+
fireGlobal( msg: string, params: any ): void;
|
|
467
|
+
_setupKeyboard( ): void;
|
|
468
|
+
focusNext( next: boolean ): void;
|
|
469
|
+
setupSocketMessaging( path: string, looseCallback: ( ) => void ): void;
|
|
470
|
+
getStorage( name: string ): string;
|
|
471
|
+
getStorageJSON( name: string ): any;
|
|
472
|
+
setStorage( name: string, value: string | number ): void;
|
|
473
|
+
setStorageJSON( name: string, value: any ): void;
|
|
474
|
+
}
|
|
475
|
+
|
|
444
476
|
// ---------------------------------------
|
|
445
477
|
// from /src/core/core_colors.ts
|
|
446
478
|
|
|
@@ -476,6 +508,177 @@ declare module 'x4js' {
|
|
|
476
508
|
isInvalid( ): void;
|
|
477
509
|
}
|
|
478
510
|
|
|
511
|
+
// ---------------------------------------
|
|
512
|
+
// from /src/core/core_data.ts
|
|
513
|
+
|
|
514
|
+
type DataRecordID = any;
|
|
515
|
+
|
|
516
|
+
type DataFieldValue = string | Date | number | boolean;
|
|
517
|
+
|
|
518
|
+
type ChangeCallback = (type: string, id?: DataRecordID) => void;
|
|
519
|
+
|
|
520
|
+
type CalcCallback = () => string;
|
|
521
|
+
|
|
522
|
+
type FieldType = 'string' | 'int' | 'float' | 'date' | 'bool' | 'array' | 'object' | 'any' | 'calc';
|
|
523
|
+
|
|
524
|
+
type DataIndex = Uint32Array;
|
|
525
|
+
|
|
526
|
+
export interface EvDataChange extends CoreEvent {
|
|
527
|
+
change_type: 'create' | 'update' | 'delete' | 'data' | 'change';
|
|
528
|
+
id?: DataRecordID;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export interface MetaData {
|
|
532
|
+
type?: FieldType;
|
|
533
|
+
prec?: number;
|
|
534
|
+
required?: boolean;
|
|
535
|
+
calc?: (rec: DataRecord) => any;
|
|
536
|
+
model?: DataModel;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
export interface FieldInfo extends MetaData {
|
|
540
|
+
name: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
class MetaInfos {
|
|
544
|
+
name: string;
|
|
545
|
+
id: string;
|
|
546
|
+
fields: FieldInfo[];
|
|
547
|
+
constructor( name: string );
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
interface ModelConstructor {
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export class DataModel {
|
|
554
|
+
getFields( ): FieldInfo[];
|
|
555
|
+
validate( record: DataRecord ): Error[];
|
|
556
|
+
getFieldIndex( name: string ): number;
|
|
557
|
+
serialize<T = any>( input: DataRecord ): T;
|
|
558
|
+
unSerialize( data: any, id: DataRecordID ): DataRecord;
|
|
559
|
+
_convertField( field: FieldInfo, input: any ): any;
|
|
560
|
+
getID( rec: DataRecord ): any;
|
|
561
|
+
getRaw( name: string | number, rec: DataRecord ): any;
|
|
562
|
+
getField( name: string, rec: DataRecord ): string;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export class DataRecord {
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
interface DataEventMap extends EventMap {
|
|
569
|
+
change?: EvChange;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
type DataSolver = ( data: any ) => DataRecord[];
|
|
573
|
+
|
|
574
|
+
export interface DataProxyProps {
|
|
575
|
+
url: string;
|
|
576
|
+
params?: string[];
|
|
577
|
+
solver?: DataSolver;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export class DataProxy extends CoreElement<DataEventMap> {
|
|
581
|
+
m_props: DataProxyProps;
|
|
582
|
+
constructor( props: DataProxyProps );
|
|
583
|
+
load( url: string ): void;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
interface DataStoreProps {
|
|
587
|
+
model: DataModel;
|
|
588
|
+
data?: any[];
|
|
589
|
+
url?: string;
|
|
590
|
+
autoload?: false;
|
|
591
|
+
solver?: DataSolver;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
interface DataStoreEventMap extends EventMap {
|
|
595
|
+
data_change: EvDataChange;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export class DataStore extends EventSource<DataStoreEventMap> {
|
|
599
|
+
m_model: DataModel;
|
|
600
|
+
m_fields: FieldInfo[];
|
|
601
|
+
m_records: DataRecord[];
|
|
602
|
+
m_proxy: DataProxy;
|
|
603
|
+
m_rec_index: DataIndex;
|
|
604
|
+
constructor( props: DataStoreProps );
|
|
605
|
+
load( url: string ): void;
|
|
606
|
+
reload( ): void;
|
|
607
|
+
setData( records: any[] ): void;
|
|
608
|
+
setRawData( records: DataRecord[] ): void;
|
|
609
|
+
_rebuildIndex( ): void;
|
|
610
|
+
update( rec: DataRecord ): void;
|
|
611
|
+
append( rec: DataRecord | any ): void;
|
|
612
|
+
getMaxId( ): void;
|
|
613
|
+
delete( id: DataRecordID ): boolean;
|
|
614
|
+
indexOfId( id: DataRecordID ): number;
|
|
615
|
+
getById( id: DataRecordID ): DataRecord;
|
|
616
|
+
getByIndex( index: number ): DataRecord;
|
|
617
|
+
_getRecord( index: number ): DataRecord;
|
|
618
|
+
moveTo( other: DataStore ): void;
|
|
619
|
+
createView( opts: DataViewProps ): DataView;
|
|
620
|
+
createIndex( filter: FilterInfo ): DataIndex;
|
|
621
|
+
sortIndex( index: DataIndex, sort: SortProp[] ): void;
|
|
622
|
+
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
623
|
+
export( ): void;
|
|
624
|
+
changed( ): void;
|
|
625
|
+
getModel( ): void;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
export interface EvViewChange extends CoreEvent {
|
|
629
|
+
change_type: "change" | "filter" | "sort";
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
interface DataViewEventMap extends EventMap {
|
|
633
|
+
view_change: EvViewChange;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
interface DataViewProps {
|
|
637
|
+
store?: DataStore;
|
|
638
|
+
filter?: FilterInfo;
|
|
639
|
+
order?: string | SortProp[] | SortProp;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
type FilterFunc = ( rec: DataRecord ) => boolean;
|
|
643
|
+
|
|
644
|
+
export interface FilterInfo {
|
|
645
|
+
op: '<' | '<=' | '=' | '>=' | '>' | '<>' | 'empty-result' | FilterFunc;
|
|
646
|
+
field?: string;
|
|
647
|
+
value?: string | RegExp;
|
|
648
|
+
caseSensitive?: boolean;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export interface SortProp {
|
|
652
|
+
field: string;
|
|
653
|
+
ascending: boolean;
|
|
654
|
+
numeric?: boolean;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export class DataView extends CoreElement<DataViewEventMap> {
|
|
658
|
+
m_index: DataIndex;
|
|
659
|
+
m_store: DataStore;
|
|
660
|
+
m_model: DataModel;
|
|
661
|
+
m_sort: SortProp[];
|
|
662
|
+
m_filter: FilterInfo;
|
|
663
|
+
m_props: DataViewProps;
|
|
664
|
+
constructor( props: DataViewProps );
|
|
665
|
+
_storeChange( ev: EvDataChange ): void;
|
|
666
|
+
filter( filter: FilterInfo ): number;
|
|
667
|
+
_filter( filter: FilterInfo, notify: boolean ): number;
|
|
668
|
+
sort( props: SortProp[] ): void;
|
|
669
|
+
_sort( props: SortProp[], notify: boolean ): void;
|
|
670
|
+
getStore( ): void;
|
|
671
|
+
getCount( ): void;
|
|
672
|
+
indexOfId( id: DataRecordID ): number;
|
|
673
|
+
getByIndex( index: number ): DataRecord;
|
|
674
|
+
getIdByIndex( index: number ): DataRecordID;
|
|
675
|
+
getRecId( rec: DataRecord ): DataRecordID;
|
|
676
|
+
getById( id: DataRecordID ): DataRecord;
|
|
677
|
+
getModel( ): void;
|
|
678
|
+
changed( ): void;
|
|
679
|
+
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
680
|
+
}
|
|
681
|
+
|
|
479
682
|
// ---------------------------------------
|
|
480
683
|
// from /src/core/core_dragdrop.ts
|
|
481
684
|
|
|
@@ -500,6 +703,14 @@ declare module 'x4js' {
|
|
|
500
703
|
_check( ): void;
|
|
501
704
|
}
|
|
502
705
|
|
|
706
|
+
// ---------------------------------------
|
|
707
|
+
// from /src/core/core_react.ts
|
|
708
|
+
|
|
709
|
+
export class x4_react {
|
|
710
|
+
create_element( tag: string, props: any, content: any[] ): Component;
|
|
711
|
+
create_element<X extends Component>( tag: string | Constructor<X>, props: X["props"], content: any[] ): void;
|
|
712
|
+
}
|
|
713
|
+
|
|
503
714
|
// ---------------------------------------
|
|
504
715
|
// from /src/core/core_router.ts
|
|
505
716
|
|
|
@@ -532,6 +743,22 @@ declare module 'x4js' {
|
|
|
532
743
|
_find( url: string ): { params: Record<string,any>, handlers: RouteHandler[] };
|
|
533
744
|
}
|
|
534
745
|
|
|
746
|
+
// ---------------------------------------
|
|
747
|
+
// from /src/core/core_state.ts
|
|
748
|
+
|
|
749
|
+
type StateData = boolean | number | string | Date | any;
|
|
750
|
+
|
|
751
|
+
type State = Record<string,StateData>;
|
|
752
|
+
|
|
753
|
+
export class StateManager {
|
|
754
|
+
_state: StateData;
|
|
755
|
+
_subscribers: Map<string,any>;
|
|
756
|
+
_currentTracking: Set<string>;
|
|
757
|
+
constructor( initialState: StateData );
|
|
758
|
+
getState( path: string, defaultValue: StateData ): void;
|
|
759
|
+
setState( path: string, value: StateData, context: any ): void;
|
|
760
|
+
}
|
|
761
|
+
|
|
535
762
|
// ---------------------------------------
|
|
536
763
|
// from /src/core/core_svg.ts
|
|
537
764
|
|
|
@@ -1033,6 +1260,51 @@ declare module 'x4js' {
|
|
|
1033
1260
|
setDate( date: Date ): void;
|
|
1034
1261
|
}
|
|
1035
1262
|
|
|
1263
|
+
// ---------------------------------------
|
|
1264
|
+
// from /src/components/canvas/canvas_ex.ts
|
|
1265
|
+
|
|
1266
|
+
export interface CanvasEx extends CanvasRenderingContext2D {
|
|
1267
|
+
width: number;
|
|
1268
|
+
height: number;
|
|
1269
|
+
smoothLine( points: any[], path: CanvasPath, move: boolean ): void;
|
|
1270
|
+
smoothLineEx( _points: any[], tension: number, numOfSeg: number, path: CanvasPath, move: boolean, close: boolean ): void;
|
|
1271
|
+
line( x1: number, y1: number, x2: number, y2: number, color: string, lineWidth: number ): void;
|
|
1272
|
+
roundRect( x: number, y: number, width: number, height: number, radius: number ): void;
|
|
1273
|
+
calcTextSize( text: string, rounded: boolean ): { width: number, height: number };
|
|
1274
|
+
setFontSize( fs: number ): void;
|
|
1275
|
+
circle( x: number, y: number, radius: number ): void;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// ---------------------------------------
|
|
1279
|
+
// from /src/components/canvas/canvas.ts
|
|
1280
|
+
|
|
1281
|
+
export interface EvPaint extends ComponentEvent {
|
|
1282
|
+
ctx: CanvasEx;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
interface CanvasEventMap extends ComponentEvents {
|
|
1286
|
+
paint: EvPaint;
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
export interface CanvasProps extends ComponentProps {
|
|
1290
|
+
paint: EventCallback<EvPaint>;
|
|
1291
|
+
clear?: boolean;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
@class_ns( "x4" ) export class Canvas extends Component<CanvasProps, CanvasEventMap> {
|
|
1295
|
+
m_iwidth: number;
|
|
1296
|
+
m_iheight: number;
|
|
1297
|
+
m_scale: any;
|
|
1298
|
+
m_canvas: Component;
|
|
1299
|
+
constructor( props: CanvasProps );
|
|
1300
|
+
scale( scale: number ): void;
|
|
1301
|
+
getContext( ): void;
|
|
1302
|
+
$update_rep: any;
|
|
1303
|
+
redraw( wait: number ): void;
|
|
1304
|
+
_paint( ): void;
|
|
1305
|
+
paint( ctx: CanvasEx ): void;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1036
1308
|
// ---------------------------------------
|
|
1037
1309
|
// from /src/components/input/input.ts
|
|
1038
1310
|
|
|
@@ -1416,177 +1688,6 @@ declare module 'x4js' {
|
|
|
1416
1688
|
constructor( props: FileDropProps );
|
|
1417
1689
|
}
|
|
1418
1690
|
|
|
1419
|
-
// ---------------------------------------
|
|
1420
|
-
// from /src/core/core_data.ts
|
|
1421
|
-
|
|
1422
|
-
type DataRecordID = any;
|
|
1423
|
-
|
|
1424
|
-
type DataFieldValue = string | Date | number | boolean;
|
|
1425
|
-
|
|
1426
|
-
type ChangeCallback = (type: string, id?: DataRecordID) => void;
|
|
1427
|
-
|
|
1428
|
-
type CalcCallback = () => string;
|
|
1429
|
-
|
|
1430
|
-
type FieldType = 'string' | 'int' | 'float' | 'date' | 'bool' | 'array' | 'object' | 'any' | 'calc';
|
|
1431
|
-
|
|
1432
|
-
type DataIndex = Uint32Array;
|
|
1433
|
-
|
|
1434
|
-
export interface EvDataChange extends CoreEvent {
|
|
1435
|
-
change_type: 'create' | 'update' | 'delete' | 'data' | 'change';
|
|
1436
|
-
id?: DataRecordID;
|
|
1437
|
-
}
|
|
1438
|
-
|
|
1439
|
-
export interface MetaData {
|
|
1440
|
-
type?: FieldType;
|
|
1441
|
-
prec?: number;
|
|
1442
|
-
required?: boolean;
|
|
1443
|
-
calc?: (rec: DataRecord) => any;
|
|
1444
|
-
model?: DataModel;
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
export interface FieldInfo extends MetaData {
|
|
1448
|
-
name: string;
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
class MetaInfos {
|
|
1452
|
-
name: string;
|
|
1453
|
-
id: string;
|
|
1454
|
-
fields: FieldInfo[];
|
|
1455
|
-
constructor( name: string );
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
interface ModelConstructor {
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
export class DataModel {
|
|
1462
|
-
getFields( ): FieldInfo[];
|
|
1463
|
-
validate( record: DataRecord ): Error[];
|
|
1464
|
-
getFieldIndex( name: string ): number;
|
|
1465
|
-
serialize<T = any>( input: DataRecord ): T;
|
|
1466
|
-
unSerialize( data: any, id: DataRecordID ): DataRecord;
|
|
1467
|
-
_convertField( field: FieldInfo, input: any ): any;
|
|
1468
|
-
getID( rec: DataRecord ): any;
|
|
1469
|
-
getRaw( name: string | number, rec: DataRecord ): any;
|
|
1470
|
-
getField( name: string, rec: DataRecord ): string;
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
|
-
export class DataRecord {
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
interface DataEventMap extends EventMap {
|
|
1477
|
-
change?: EvChange;
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
type DataSolver = ( data: any ) => DataRecord[];
|
|
1481
|
-
|
|
1482
|
-
export interface DataProxyProps {
|
|
1483
|
-
url: string;
|
|
1484
|
-
params?: string[];
|
|
1485
|
-
solver?: DataSolver;
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
export class DataProxy extends CoreElement<DataEventMap> {
|
|
1489
|
-
m_props: DataProxyProps;
|
|
1490
|
-
constructor( props: DataProxyProps );
|
|
1491
|
-
load( url: string ): void;
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
interface DataStoreProps {
|
|
1495
|
-
model: DataModel;
|
|
1496
|
-
data?: any[];
|
|
1497
|
-
url?: string;
|
|
1498
|
-
autoload?: false;
|
|
1499
|
-
solver?: DataSolver;
|
|
1500
|
-
}
|
|
1501
|
-
|
|
1502
|
-
interface DataStoreEventMap extends EventMap {
|
|
1503
|
-
data_change: EvDataChange;
|
|
1504
|
-
}
|
|
1505
|
-
|
|
1506
|
-
export class DataStore extends EventSource<DataStoreEventMap> {
|
|
1507
|
-
m_model: DataModel;
|
|
1508
|
-
m_fields: FieldInfo[];
|
|
1509
|
-
m_records: DataRecord[];
|
|
1510
|
-
m_proxy: DataProxy;
|
|
1511
|
-
m_rec_index: DataIndex;
|
|
1512
|
-
constructor( props: DataStoreProps );
|
|
1513
|
-
load( url: string ): void;
|
|
1514
|
-
reload( ): void;
|
|
1515
|
-
setData( records: any[] ): void;
|
|
1516
|
-
setRawData( records: DataRecord[] ): void;
|
|
1517
|
-
_rebuildIndex( ): void;
|
|
1518
|
-
update( rec: DataRecord ): void;
|
|
1519
|
-
append( rec: DataRecord | any ): void;
|
|
1520
|
-
getMaxId( ): void;
|
|
1521
|
-
delete( id: DataRecordID ): boolean;
|
|
1522
|
-
indexOfId( id: DataRecordID ): number;
|
|
1523
|
-
getById( id: DataRecordID ): DataRecord;
|
|
1524
|
-
getByIndex( index: number ): DataRecord;
|
|
1525
|
-
_getRecord( index: number ): DataRecord;
|
|
1526
|
-
moveTo( other: DataStore ): void;
|
|
1527
|
-
createView( opts: DataViewProps ): DataView;
|
|
1528
|
-
createIndex( filter: FilterInfo ): DataIndex;
|
|
1529
|
-
sortIndex( index: DataIndex, sort: SortProp[] ): void;
|
|
1530
|
-
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
1531
|
-
export( ): void;
|
|
1532
|
-
changed( ): void;
|
|
1533
|
-
getModel( ): void;
|
|
1534
|
-
}
|
|
1535
|
-
|
|
1536
|
-
export interface EvViewChange extends CoreEvent {
|
|
1537
|
-
change_type: "change" | "filter" | "sort";
|
|
1538
|
-
}
|
|
1539
|
-
|
|
1540
|
-
interface DataViewEventMap extends EventMap {
|
|
1541
|
-
view_change: EvViewChange;
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
interface DataViewProps {
|
|
1545
|
-
store?: DataStore;
|
|
1546
|
-
filter?: FilterInfo;
|
|
1547
|
-
order?: string | SortProp[] | SortProp;
|
|
1548
|
-
}
|
|
1549
|
-
|
|
1550
|
-
type FilterFunc = ( rec: DataRecord ) => boolean;
|
|
1551
|
-
|
|
1552
|
-
export interface FilterInfo {
|
|
1553
|
-
op: '<' | '<=' | '=' | '>=' | '>' | '<>' | 'empty-result' | FilterFunc;
|
|
1554
|
-
field?: string;
|
|
1555
|
-
value?: string | RegExp;
|
|
1556
|
-
caseSensitive?: boolean;
|
|
1557
|
-
}
|
|
1558
|
-
|
|
1559
|
-
export interface SortProp {
|
|
1560
|
-
field: string;
|
|
1561
|
-
ascending: boolean;
|
|
1562
|
-
numeric?: boolean;
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
export class DataView extends CoreElement<DataViewEventMap> {
|
|
1566
|
-
m_index: DataIndex;
|
|
1567
|
-
m_store: DataStore;
|
|
1568
|
-
m_model: DataModel;
|
|
1569
|
-
m_sort: SortProp[];
|
|
1570
|
-
m_filter: FilterInfo;
|
|
1571
|
-
m_props: DataViewProps;
|
|
1572
|
-
constructor( props: DataViewProps );
|
|
1573
|
-
_storeChange( ev: EvDataChange ): void;
|
|
1574
|
-
filter( filter: FilterInfo ): number;
|
|
1575
|
-
_filter( filter: FilterInfo, notify: boolean ): number;
|
|
1576
|
-
sort( props: SortProp[] ): void;
|
|
1577
|
-
_sort( props: SortProp[], notify: boolean ): void;
|
|
1578
|
-
getStore( ): void;
|
|
1579
|
-
getCount( ): void;
|
|
1580
|
-
indexOfId( id: DataRecordID ): number;
|
|
1581
|
-
getByIndex( index: number ): DataRecord;
|
|
1582
|
-
getIdByIndex( index: number ): DataRecordID;
|
|
1583
|
-
getRecId( rec: DataRecord ): DataRecordID;
|
|
1584
|
-
getById( id: DataRecordID ): DataRecord;
|
|
1585
|
-
getModel( ): void;
|
|
1586
|
-
changed( ): void;
|
|
1587
|
-
forEach( cb: ( rec: DataRecord, index: number ) => any ): void;
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
1691
|
// ---------------------------------------
|
|
1591
1692
|
// from /src/components/image/image.ts
|
|
1592
1693
|
|
|
@@ -1989,23 +2090,6 @@ declare module 'x4js' {
|
|
|
1989
2090
|
_on_click( ev: MouseEvent ): void;
|
|
1990
2091
|
}
|
|
1991
2092
|
|
|
1992
|
-
// ---------------------------------------
|
|
1993
|
-
// from /src/components/tickline/tickline.ts
|
|
1994
|
-
|
|
1995
|
-
interface TickLineProps extends ComponentProps {
|
|
1996
|
-
values: number[];
|
|
1997
|
-
min?: number;
|
|
1998
|
-
max?: number;
|
|
1999
|
-
color?: Color;
|
|
2000
|
-
background?: Color;
|
|
2001
|
-
type: "bars" | "line";
|
|
2002
|
-
}
|
|
2003
|
-
|
|
2004
|
-
export class TickLine extends Component<TickLineProps> {
|
|
2005
|
-
constructor( props: TickLineProps );
|
|
2006
|
-
update( ): void;
|
|
2007
|
-
}
|
|
2008
|
-
|
|
2009
2093
|
// ---------------------------------------
|
|
2010
2094
|
// from /src/components/slider/slider.ts
|
|
2011
2095
|
|
|
@@ -2155,6 +2239,23 @@ declare module 'x4js' {
|
|
|
2155
2239
|
getInput( ): void;
|
|
2156
2240
|
}
|
|
2157
2241
|
|
|
2242
|
+
// ---------------------------------------
|
|
2243
|
+
// from /src/components/tickline/tickline.ts
|
|
2244
|
+
|
|
2245
|
+
interface TickLineProps extends ComponentProps {
|
|
2246
|
+
values: number[];
|
|
2247
|
+
min?: number;
|
|
2248
|
+
max?: number;
|
|
2249
|
+
color?: Color;
|
|
2250
|
+
background?: Color;
|
|
2251
|
+
type: "bars" | "line";
|
|
2252
|
+
}
|
|
2253
|
+
|
|
2254
|
+
export class TickLine extends Component<TickLineProps> {
|
|
2255
|
+
constructor( props: TickLineProps );
|
|
2256
|
+
update( ): void;
|
|
2257
|
+
}
|
|
2258
|
+
|
|
2158
2259
|
// ---------------------------------------
|
|
2159
2260
|
// from /src/components/tooltips/tooltips.ts
|
|
2160
2261
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x4js",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18",
|
|
4
4
|
"description": "X4 framework",
|
|
5
5
|
"author": "etienne cochard",
|
|
6
|
-
"main": "src/x4.ts",
|
|
7
|
-
"typess": "lib/types/x4js.d.ts",
|
|
8
|
-
"filess": [
|
|
9
|
-
"lib/**/*"
|
|
10
|
-
],
|
|
11
6
|
"license": "MIT",
|
|
12
7
|
"repository": {
|
|
13
8
|
"type": "git",
|
|
@@ -25,37 +20,32 @@
|
|
|
25
20
|
"application"
|
|
26
21
|
],
|
|
27
22
|
"scripts": {
|
|
28
|
-
"build": "
|
|
29
|
-
"build-release": "
|
|
23
|
+
"build": "x4build --watch --hmr --serve",
|
|
24
|
+
"build-release": "x4build --release",
|
|
30
25
|
"prepack": "node scripts/prepack.mjs"
|
|
31
26
|
},
|
|
32
27
|
"homepage": "https://x4js.org",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
28
|
+
"files": ["lib","src"],
|
|
29
|
+
"types": "./src/x4.ts",
|
|
30
|
+
"module": "./lib/esm/x4.mjs",
|
|
31
|
+
"main": "./lib/cjs/x4.js",
|
|
32
|
+
"exports": {
|
|
35
33
|
".": {
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
"require": {
|
|
41
|
-
"types": "./lib/types/x4.d.ts",
|
|
42
|
-
"default": "./lib/cjs/x4.js"
|
|
43
|
-
}
|
|
34
|
+
"types": "./src/x4.ts",
|
|
35
|
+
"module": "./lib/esm/x4.mjs",
|
|
36
|
+
"require": "./lib/cjs/x4.js"
|
|
44
37
|
}
|
|
45
38
|
},
|
|
46
|
-
"devDependencies": {
|
|
47
|
-
"chalk": "^5.3",
|
|
48
|
-
"esbuild": "^0.24",
|
|
49
|
-
"esbuild-plugin-d.ts": "^1.3",
|
|
50
|
-
"esbuild-sass-plugin": "^3.3",
|
|
51
|
-
"typescript": "^5.6.3",
|
|
52
|
-
"watcher": "^2.3",
|
|
53
|
-
"ws": "^8.18"
|
|
54
|
-
},
|
|
55
39
|
"x4build": {
|
|
56
40
|
"entryPoints": [
|
|
57
41
|
"src/x4.ts"
|
|
58
42
|
],
|
|
59
|
-
"outdir": "
|
|
43
|
+
"outdir": "lib"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"typescript": "^5.8.3",
|
|
47
|
+
"x4build": "^1.6.8",
|
|
48
|
+
"esbuild-plugin-d.ts": "^1.3",
|
|
49
|
+
"esbuild-sass-plugin": "^3.3"
|
|
60
50
|
}
|
|
61
51
|
}
|
|
@@ -3,6 +3,8 @@ export * from "./breadcrumb/breadcrumb"
|
|
|
3
3
|
export * from "./btngroup/btngroup"
|
|
4
4
|
export * from "./button/button"
|
|
5
5
|
export * from "./calendar/calendar"
|
|
6
|
+
export * from "./canvas/canvas"
|
|
7
|
+
export * from "./canvas/canvas_ex"
|
|
6
8
|
export * from "./checkbox/checkbox"
|
|
7
9
|
export * from "./colorinput/colorinput"
|
|
8
10
|
export * from "./colorpicker/colorpicker"
|
|
@@ -28,7 +30,6 @@ export * from "./progress/progress"
|
|
|
28
30
|
export * from "./propgrid/propgrid"
|
|
29
31
|
export * from "./radio/radio"
|
|
30
32
|
export * from "./rating/rating"
|
|
31
|
-
export * from "./tickline/tickline"
|
|
32
33
|
export * from "./select/select"
|
|
33
34
|
export * from "./sizers/sizer"
|
|
34
35
|
export * from "./slider/slider"
|
|
@@ -36,6 +37,7 @@ export * from "./switch/switch"
|
|
|
36
37
|
export * from "./tabs/tabs"
|
|
37
38
|
export * from "./textarea/textarea"
|
|
38
39
|
export * from "./textedit/textedit"
|
|
40
|
+
export * from "./tickline/tickline"
|
|
39
41
|
export * from "./tooltips/tooltips"
|
|
40
42
|
export * from "./treeview/treeview"
|
|
41
43
|
export * from "./viewport/viewport"
|
package/src/core/component.ts
CHANGED
|
@@ -1039,15 +1039,6 @@ export interface EvContextMenu extends ComponentEvent {
|
|
|
1039
1039
|
uievent: UIEvent; // UI event that fire this event
|
|
1040
1040
|
}
|
|
1041
1041
|
|
|
1042
|
-
/**
|
|
1043
|
-
* Simple message
|
|
1044
|
-
*/
|
|
1045
|
-
|
|
1046
|
-
export interface EvMessage extends ComponentEvent {
|
|
1047
|
-
readonly msg: string;
|
|
1048
|
-
readonly params?: any;
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
1042
|
/**
|
|
1052
1043
|
* Drag/Drop event
|
|
1053
1044
|
*/
|
package/src/x4.ts
CHANGED
|
@@ -15,13 +15,17 @@
|
|
|
15
15
|
**/
|
|
16
16
|
|
|
17
17
|
export * from "./core/component"
|
|
18
|
+
export * from "./core/core_application"
|
|
18
19
|
export * from "./core/core_colors"
|
|
20
|
+
export * from "./core/core_data"
|
|
19
21
|
export * from "./core/core_dom"
|
|
20
22
|
export * from "./core/core_dragdrop"
|
|
21
23
|
export * from "./core/core_element"
|
|
22
24
|
export * from "./core/core_events"
|
|
23
25
|
export * from "./core/core_i18n"
|
|
26
|
+
export * from "./core/core_react"
|
|
24
27
|
export * from "./core/core_router"
|
|
28
|
+
export * from "./core/core_state"
|
|
25
29
|
export * from "./core/core_styles"
|
|
26
30
|
export * from "./core/core_svg"
|
|
27
31
|
export * from "./core/core_tools"
|
package/.vscode/launch.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "debug prepack",
|
|
11
|
-
"program": "${workspaceFolder}/scripts/prepack.mjs",
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" fill="currentColor"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path d="M298.6 4c-6-5.3-15.1-5.3-21.2 0L5.4 244c-6.6 5.8-7.3 16-1.4 22.6s16 7.3 22.6 1.4L64 235l0 197c0 44.2 35.8 80 80 80l288 0c44.2 0 80-35.8 80-80l0-197 37.4 33c6.6 5.8 16.7 5.2 22.6-1.4s5.2-16.7-1.4-22.6L298.6 4zM96 432l0-225.3L288 37.3 480 206.7 480 432c0 26.5-21.5 48-48 48l-64 0 0-160c0-17.7-14.3-32-32-32l-96 0c-17.7 0-32 14.3-32 32l0 160-64 0c-26.5 0-48-21.5-48-48zm144 48l0-160 96 0 0 160-96 0z"/></svg>
|