x4js 2.2.66 → 2.2.68
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/package.json
CHANGED
|
@@ -18,6 +18,8 @@ interface HeaderProps extends Omit<ComponentProps,"content"> {
|
|
|
18
18
|
target?: Component; // target element to set header col variable width var( --{name}-width ) parent element if not set
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
const CELL_MW = 8;
|
|
22
|
+
|
|
21
23
|
/**
|
|
22
24
|
* by default when a header item is resized, the 'target' style '--{name}-width' is updated
|
|
23
25
|
*
|
|
@@ -63,10 +65,19 @@ export class Header extends HBox<HeaderProps> {
|
|
|
63
65
|
this._calc_sizes( );
|
|
64
66
|
})
|
|
65
67
|
|
|
68
|
+
sizer.on( "start", ( ) => {
|
|
69
|
+
//todo: remove flex on all cols
|
|
70
|
+
} );
|
|
71
|
+
|
|
72
|
+
sizer.on( "stop", ( ) => {
|
|
73
|
+
//todo: restore flex
|
|
74
|
+
} );
|
|
75
|
+
|
|
66
76
|
sizer.on( "resize", ( ev ) => {
|
|
67
77
|
//cell.setStyleValue( "flexGrow", "0" );
|
|
78
|
+
const sze = ev.size<CELL_MW ? CELL_MW : ev.size;
|
|
68
79
|
cell.setInternalData("flex",0);
|
|
69
|
-
cell.setInternalData("width",
|
|
80
|
+
cell.setInternalData("width",sze);
|
|
70
81
|
this._calc_sizes( );
|
|
71
82
|
});
|
|
72
83
|
|
|
@@ -129,6 +140,10 @@ export class Header extends HBox<HeaderProps> {
|
|
|
129
140
|
width = c.getInternalData( "width" );
|
|
130
141
|
}
|
|
131
142
|
|
|
143
|
+
if( width<CELL_MW ) {
|
|
144
|
+
width = CELL_MW;
|
|
145
|
+
}
|
|
146
|
+
|
|
132
147
|
c.setWidth( width );
|
|
133
148
|
|
|
134
149
|
const item = c.getInternalData<HeaderItem>( 'data' );
|
|
@@ -137,7 +152,7 @@ export class Header extends HBox<HeaderProps> {
|
|
|
137
152
|
this.parentElement().setStyleVariable( `--${item.name}-width`, width + "px");
|
|
138
153
|
}
|
|
139
154
|
else {
|
|
140
|
-
|
|
155
|
+
this.props.target?.setStyleVariable( `--${item.name}-width`, width + "px");
|
|
141
156
|
}
|
|
142
157
|
|
|
143
158
|
fullw += width;
|
package/src/core/core_data.ts
CHANGED