x4js 2.3.24 → 2.3.26

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.
Files changed (68) hide show
  1. package/aicontext.md +101 -17
  2. package/aiguide.md +64 -15
  3. package/package.json +1 -1
  4. package/src/components/assets/icons.ts +2 -0
  5. package/src/components/autocomplete/autocomplete.ts +2 -2
  6. package/src/components/boxes/boxes.module.scss +16 -2
  7. package/src/components/boxes/boxes.ts +24 -11
  8. package/src/components/breadcrumb/breadcrumb.ts +1 -2
  9. package/src/components/btngroup/btngroup.ts +2 -2
  10. package/src/components/button/button.ts +7 -2
  11. package/src/components/calendar/calendar.ts +4 -2
  12. package/src/components/canvas/canvas.ts +1 -2
  13. package/src/components/chart/chart.ts +3 -3
  14. package/src/components/checkbox/checkbox.ts +2 -2
  15. package/src/components/colorinput/colorinput.ts +3 -2
  16. package/src/components/colorpicker/colorpicker.ts +5 -5
  17. package/src/components/combobox/combobox.ts +3 -3
  18. package/src/components/dialog/dialog.ts +8 -2
  19. package/src/components/dockingview/dockingview.ts +1 -2
  20. package/src/components/filedrop/filedrop.ts +3 -2
  21. package/src/components/form/form.module.scss +2 -1
  22. package/src/components/form/form.ts +7 -3
  23. package/src/components/gauge/gauge.ts +2 -2
  24. package/src/components/gridview/gridview.module.scss +8 -5
  25. package/src/components/gridview/gridview.ts +11 -13
  26. package/src/components/header/header.ts +2 -2
  27. package/src/components/icon/icon.ts +1 -2
  28. package/src/components/image/image.ts +1 -2
  29. package/src/components/input/input.ts +3 -2
  30. package/src/components/keyboard/keyboard.ts +2 -2
  31. package/src/components/label/label.ts +3 -3
  32. package/src/components/link/link.ts +3 -2
  33. package/src/components/listbox/listbox.module.scss +59 -2
  34. package/src/components/listbox/listbox.ts +133 -23
  35. package/src/components/menu/menu.ts +5 -4
  36. package/src/components/messages/messages.module.scss +95 -3
  37. package/src/components/messages/messages.ts +113 -27
  38. package/src/components/notification/notification.ts +6 -6
  39. package/src/components/panel/panel.ts +2 -2
  40. package/src/components/popup/popup.ts +17 -2
  41. package/src/components/progress/progress.ts +1 -2
  42. package/src/components/propgrid/progrid.module.scss +2 -3
  43. package/src/components/propgrid/propgrid.ts +32 -38
  44. package/src/components/radio/radio.ts +1 -2
  45. package/src/components/rating/rating.ts +2 -2
  46. package/src/components/select/select.ts +2 -2
  47. package/src/components/settingsview/settingsview.module.scss +6 -5
  48. package/src/components/settingsview/settingsview.ts +3 -3
  49. package/src/components/sizers/sizer.ts +21 -29
  50. package/src/components/slider/slider.ts +2 -2
  51. package/src/components/spreadsheet/spreadsheet.ts +8 -10
  52. package/src/components/switch/switch.ts +2 -2
  53. package/src/components/tabs/tabs.ts +4 -4
  54. package/src/components/tag/tag.ts +2 -2
  55. package/src/components/textarea/textarea.ts +3 -3
  56. package/src/components/textedit/textedit.ts +2 -2
  57. package/src/components/themes.scss +2 -0
  58. package/src/components/tickline/tickline.ts +3 -3
  59. package/src/components/tooltips/tooltips.ts +11 -2
  60. package/src/components/treeview/treeview.ts +3 -3
  61. package/src/components/video/video.ts +1 -2
  62. package/src/components/viewport/viewport.ts +4 -3
  63. package/src/core/component.ts +15 -24
  64. package/src/core/core_application.ts +36 -3
  65. package/src/core/core_events.ts +14 -2
  66. package/src/core/core_i18n.ts +67 -0
  67. package/src/core/core_svg.ts +1 -0
  68. package/src/core/core_tools.ts +83 -24
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { Component, ComponentEvents, ComponentProps, EvClick } from "../../core/component"
18
18
  import { EventCallback } from '../../core/core_events';
19
- import { class_ns, isFunction, UnsafeHtml } from '../../core/core_tools';
19
+ import { isFunction, UnsafeHtml } from '../../core/core_tools';
20
20
 
21
21
  import { Icon } from "../icon/icon"
22
22
  import { Menu, MenuElement } from '../menu/menu';
@@ -113,8 +113,8 @@ export interface ButtonProps extends ComponentProps {
113
113
  * the --ol-button-* variables are the ones of the outline buttons
114
114
  */
115
115
 
116
- @class_ns( "x4" )
117
116
  export class Button extends Component<ButtonProps,ButtonEvents> {
117
+ static classPrefix = "x4";
118
118
 
119
119
  #text: Component;
120
120
 
@@ -134,6 +134,11 @@ export class Button extends Component<ButtonProps,ButtonEvents> {
134
134
  constructor( props: ButtonProps ) {
135
135
  super( { ...props, tag: 'button', content: null } );
136
136
 
137
+ // a button, not a submit: in a <form>, Enter in a field would click the first submit
138
+ if( !props.attrs?.type ) {
139
+ this.setAttribute( "type", "button" );
140
+ }
141
+
137
142
  this.mapPropEvents( props, 'click' );
138
143
 
139
144
  if( props.autorepeat ) {
@@ -15,7 +15,7 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentEvents, ComponentProps, EvChange, Flex } from '../../core/component'
18
- import { class_ns, date_clone, date_hash, formatIntlDate, Point, unsafeHtml } from "../../core/core_tools"
18
+ import { date_clone, date_hash, formatIntlDate, Point, unsafeHtml } from "../../core/core_tools"
19
19
  import { _tr } from '../../core/core_i18n';
20
20
  import { EventCallback } from '../../core/core_events';
21
21
 
@@ -70,9 +70,10 @@ interface CalendarProps extends ComponentProps {
70
70
  * ```
71
71
  */
72
72
 
73
- @class_ns( "x4" )
74
73
  export class Calendar extends VBox<CalendarProps, CalendarEventMap>
75
74
  {
75
+ static classPrefix = "x4";
76
+
76
77
  private m_date: Date;
77
78
 
78
79
  constructor(props: CalendarProps) {
@@ -333,6 +334,7 @@ export class Calendar extends VBox<CalendarProps, CalendarEventMap>
333
334
  * /
334
335
 
335
336
  export class PopupCalendar extends Popup {
337
+ static classPrefix = "x4";
336
338
 
337
339
  m_cal: Calendar;
338
340
 
@@ -14,7 +14,6 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { class_ns } from '../../core/core_tools';
18
17
  import { Component, ComponentEvent, ComponentEvents, ComponentProps } from '../../core/component';
19
18
  import { EventCallback } from "../../core/core_events"
20
19
  import { CanvasEx, createPainter } from './canvas_ex';
@@ -45,8 +44,8 @@ export interface CanvasProps extends ComponentProps {
45
44
  * Standard Canvas
46
45
  */
47
46
 
48
- @class_ns( "x4" )
49
47
  export class Canvas extends Component<CanvasProps, CanvasEventMap> {
48
+ static classPrefix = "x4";
50
49
 
51
50
  private m_iwidth: number = -1;
52
51
  private m_iheight: number = -1;
@@ -17,7 +17,7 @@
17
17
  import { ComponentEvent, ComponentEvents } from '../../core/component';
18
18
  import { EventCallback } from '../../core/core_events';
19
19
  import { SvgBuilder, SvgComponent, SvgGroup, SvgPath, SvgProps, SvgShape } from '../../core/core_svg';
20
- import { class_ns, clamp, IRect, isNumber, sanitizeHtml } from '../../core/core_tools';
20
+ import { clamp, formatNumber, IRect, isNumber, sanitizeHtml } from '../../core/core_tools';
21
21
 
22
22
  import "./chart.module.scss"
23
23
 
@@ -91,7 +91,7 @@ export function chartFormatUnit( value: number, decimals = 2 ) {
91
91
 
92
92
  const pow = Math.pow(10, decimals);
93
93
  const roundedValue = Math.round(scaledValue * pow) / pow;
94
- const text = roundedValue % 1 == 0 ? `${roundedValue}` : roundedValue.toFixed(decimals).replace(/\.?0+$/, '');
94
+ const text = formatNumber( roundedValue, decimals ); // the decimal separator of the locale
95
95
 
96
96
  return ( value<0 && roundedValue!=0 ? '-' : '' ) + text + units[unitIndex];
97
97
  }
@@ -234,8 +234,8 @@ function drawBar( grp: SvgGroup, x: number, w: number, y0: number, y1: number, r
234
234
  * ```
235
235
  */
236
236
 
237
- @class_ns( "x4" )
238
237
  export class Chart extends SvgComponent<ChartProps,ChartEvents> {
238
+ static classPrefix = "x4";
239
239
 
240
240
  private _type: ChartType;
241
241
  private _series: ChartSerie[];
@@ -3,7 +3,6 @@ import { EventCallback } from '../../core/core_events';
3
3
 
4
4
  import { Input } from '../input/input';
5
5
  import { Label } from '../label/label';
6
- import { class_ns } from '../../core/core_tools';
7
6
 
8
7
  import icons from "../assets/icons";
9
8
 
@@ -45,8 +44,9 @@ interface CheckboxProps extends ComponentProps {
45
44
  * ```
46
45
  */
47
46
 
48
- @class_ns( "x4" )
49
47
  export class Checkbox extends Component<CheckboxProps,CheckBoxEvents> {
48
+ static classPrefix = "x4";
49
+
50
50
  readonly _input: Input;
51
51
 
52
52
  /**
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { Component, ComponentEvents } from '../../core/component';
18
18
  import { EventCallback } from '../../core/core_events';
19
- import { isFeatureAvailable, class_ns, isFunction, IComponentInterface, IFormElement } from '../../core/core_tools';
19
+ import { isFeatureAvailable, isFunction, IComponentInterface, IFormElement } from '../../core/core_tools';
20
20
  import { Color } from '../../core/core_colors';
21
21
 
22
22
  import { BoxProps, HBox } from '../boxes/boxes';
@@ -84,8 +84,9 @@ interface ColorInputEvents extends ComponentEvents {
84
84
  * ```
85
85
  */
86
86
 
87
- @class_ns( "x4" )
88
87
  export class ColorInput extends HBox<ColorInputProps,ColorInputEvents> {
88
+ static classPrefix = "x4";
89
+
89
90
  static "$cls-ns" = "x4";
90
91
 
91
92
  private _color: Color; // null: no color
@@ -15,7 +15,7 @@
15
15
  **/
16
16
 
17
17
  import { Color, Hsv } from '../../core/core_colors';
18
- import { Rect, clamp, class_ns, isFeatureAvailable } from '../../core/core_tools';
18
+ import { Rect, clamp, isFeatureAvailable } from '../../core/core_tools';
19
19
 
20
20
  import { Component, ComponentEvent, ComponentEvents, ComponentProps, EvChange } from '../../core/component';
21
21
  import { Box, BoxProps, HBox, VBox } from '../boxes/boxes';
@@ -58,8 +58,8 @@ interface CommonEvents extends ComponentEvents {
58
58
  *
59
59
  */
60
60
 
61
- @class_ns( "x4" )
62
61
  export class Saturation extends Box<BoxProps,CommonEvents> {
62
+ static classPrefix = "x4";
63
63
 
64
64
  private mdown = false;
65
65
  private irect: Rect;
@@ -191,8 +191,8 @@ export class Saturation extends Box<BoxProps,CommonEvents> {
191
191
  * @internal
192
192
  */
193
193
 
194
- @class_ns( "x4" )
195
194
  class HueSlider extends Box<BoxProps,CommonEvents> {
195
+ static classPrefix = "x4";
196
196
 
197
197
  private thumb: Component;
198
198
  private hsv: Hsv = { hue: 1, saturation: 1, value: 1, alpha: 1 };
@@ -271,8 +271,8 @@ class HueSlider extends Box<BoxProps,CommonEvents> {
271
271
  * @internal
272
272
  */
273
273
 
274
- @class_ns( "x4" )
275
274
  class AlphaSlider extends Box<BoxProps,CommonEvents> {
275
+ static classPrefix = "x4";
276
276
 
277
277
  private thumb: Component;
278
278
  private color: Component;
@@ -389,8 +389,8 @@ interface ColorPickerChangeEvents extends ComponentEvents {
389
389
  * ```
390
390
  */
391
391
 
392
- @class_ns( "x4" )
393
392
  export class ColorPicker extends VBox<ColorPickerProps,ColorPickerChangeEvents> {
393
+ static classPrefix = "x4";
394
394
 
395
395
  private _base: Color;
396
396
  private _hsv: Hsv;
@@ -15,7 +15,7 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentEvents, ComponentProps, EvClick, EvSelectionChange, makeUniqueComponentId } from '../../core/component';
18
- import { class_ns, IComponentInterface, IFormElement, kbNav } from '../../core/core_tools';
18
+ import { IComponentInterface, IFormElement, kbNav } from '../../core/core_tools';
19
19
  import { EventCallback } from '../../core/core_events';
20
20
 
21
21
  import { Listbox, ListboxID, ListItem } from '../listbox/listbox';
@@ -42,8 +42,8 @@ interface DropdownProps extends Omit<PopupProps,"content"> {
42
42
  }
43
43
 
44
44
 
45
- @class_ns( "x4" )
46
45
  export class DropdownList extends Popup<DropdownProps,DropdownEvents> {
46
+ static classPrefix = "x4";
47
47
 
48
48
  private _list: Listbox;
49
49
 
@@ -108,8 +108,8 @@ interface ComboboxProps extends Omit<ComponentProps,"content"> {
108
108
  * ```
109
109
  */
110
110
 
111
- @class_ns( "x4" )
112
111
  export class Combobox extends Component<ComboboxProps,ComboboxEvents> {
112
+ static classPrefix = "x4";
113
113
 
114
114
  private _popup: DropdownList;
115
115
  //private _label: Label;
@@ -20,7 +20,7 @@ import { BtnGroup, BtnGroupItem } from "../btngroup/btngroup"
20
20
  import { HBox } from '../boxes/boxes';
21
21
  import { Label } from '../label/label';
22
22
  import { CoreEvent, EventCallback } from '../../core/core_events';
23
- import { asap, class_ns, getFocusableElements, IComponentInterface, isString, ITabHandler } from '../../core/core_tools';
23
+ import { asap, getFocusableElements, IComponentInterface, isString, ITabHandler } from '../../core/core_tools';
24
24
  import { ComponentEvent } from '../../core/component';
25
25
  import { Button } from '../button/button';
26
26
  import icons from "../assets/icons"
@@ -58,8 +58,8 @@ interface DialogEvents extends PopupEvents {
58
58
  * ```
59
59
  */
60
60
 
61
- @class_ns("x4")
62
61
  export class Dialog<P extends DialogProps = DialogProps, E extends DialogEvents = DialogEvents> extends Popup<P, E> {
62
+ static classPrefix = "x4";
63
63
 
64
64
  private form: Form;
65
65
  private _title: Label;
@@ -125,6 +125,12 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogEvents
125
125
  }
126
126
  }
127
127
  else if (ev.key == 'Enter') {
128
+ // in a text of several lines Enter is a new line: Ctrl+Enter (Cmd+Enter) validates
129
+ const target = ev.target as HTMLElement;
130
+ if( ( target.tagName==="TEXTAREA" || target.isContentEditable ) && !ev.ctrlKey && !ev.metaKey ) {
131
+ return;
132
+ }
133
+
128
134
  const def = this.query<Button>('button.default');
129
135
  if (def) {
130
136
  ev.preventDefault();
@@ -14,7 +14,6 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { class_ns } from '../../core/core_tools';
18
17
  import { Component, ComponentEvent, ComponentEvents, ComponentProps } from '../../core/component';
19
18
  import { EventCallback } from '../../core/core_events';
20
19
  import { CSizer } from '../sizers/sizer';
@@ -185,8 +184,8 @@ interface Drag {
185
184
  * ```
186
185
  */
187
186
 
188
- @class_ns( "x4" )
189
187
  export class DockingView extends Component<DockingViewProps, DockingViewEvents> {
188
+ static classPrefix = "x4";
190
189
 
191
190
  private layout: DockLayout;
192
191
  private saved: { layout: DockLayout } = null; // the state that remembers it
@@ -18,7 +18,7 @@ import { Component, ComponentEvents, ComponentProps } from '../../core/component
18
18
  import { _tr } from '../../core/core_i18n';
19
19
  import { dragManager } from '../../core/core_dragdrop';
20
20
  import { CoreEvent, EventCallback } from '../../core/core_events';
21
- import { class_ns, UnsafeHtml } from '../../core/core_tools';
21
+ import { UnsafeHtml } from '../../core/core_tools';
22
22
 
23
23
  import { VBox } from '../boxes/boxes';
24
24
  import { SimpleText } from '../label/label';
@@ -47,6 +47,7 @@ interface FileDialogProps extends ComponentProps {
47
47
  */
48
48
 
49
49
  export class FileDialog extends Component {
50
+ static classPrefix = "x4";
50
51
 
51
52
  constructor( props: FileDialogProps ) {
52
53
  super( {
@@ -97,8 +98,8 @@ interface FileDropProps extends ComponentProps {
97
98
  *
98
99
  */
99
100
 
100
- @class_ns( "x4" )
101
101
  export class FileDrop extends VBox<FileDropProps,FileDropEvents> {
102
+ static classPrefix = "x4";
102
103
 
103
104
  constructor( props: FileDropProps ) {
104
105
  super( props );
@@ -31,8 +31,9 @@
31
31
  flex-direction: row;
32
32
  }
33
33
 
34
+ // flex: false: the height of its content (flex-grow alone would leave it at 0, flex-basis 0)
34
35
  &.no-flex {
35
- flex-grow: 0;
36
+ flex: none;
36
37
  }
37
38
  }
38
39
 
@@ -14,7 +14,8 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { class_ns, IFormElement } from '../../core/core_tools';
17
+ import { IFormElement } from '../../core/core_tools';
18
+ import { ComponentEvents } from '../../core/component';
18
19
  import { Box, BoxProps } from '../boxes/boxes';
19
20
 
20
21
  import "./form.module.scss"
@@ -35,14 +36,17 @@ type ValidationFn = ( values: FormValues, is_valid: boolean ) => boolean;
35
36
  * ```
36
37
  */
37
38
 
38
- @class_ns( "x4" )
39
- export class Form<P extends FormProps = FormProps> extends Box<P> {
39
+ export class Form<P extends FormProps = FormProps, E extends ComponentEvents = ComponentEvents> extends Box<P,E> {
40
+ static classPrefix = "x4";
40
41
 
41
42
  private validator: ValidationFn;
42
43
 
43
44
  constructor( props: P ) {
44
45
  super( { tag: "form", ...props } );
45
46
 
47
+ // read by getValues, never sent by the browser (Enter in its only field would send it)
48
+ this.addDOMEvent( "submit", ( ev ) => ev.preventDefault( ) );
49
+
46
50
  if( props.flex===false ) {
47
51
  this.addClass( "no-flex" );
48
52
  }
@@ -14,7 +14,7 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { centerRect, class_ns } from '../../core/core_tools';
17
+ import { centerRect } from '../../core/core_tools';
18
18
  import { Component, ComponentProps } from '../../core/component'
19
19
  import { SvgBuilder, SvgComponent } from '../../core/core_svg';
20
20
 
@@ -49,8 +49,8 @@ export const simpleColorStop = [
49
49
  * ```
50
50
  */
51
51
 
52
- @class_ns( "x4" )
53
52
  export class Gauge extends Component<GaugeProps> {
53
+ static classPrefix = "x4";
54
54
 
55
55
  private pos: number;
56
56
  private stops: string[];
@@ -22,6 +22,7 @@
22
22
 
23
23
  --gridview-header-cell-background: var( --background-primary );
24
24
  --gridview-header-cell-color: var( --text-primary );
25
+ --gridview-header-sort-color: var( --gridview-header-cell-color ); // the arrow of the column sorted
25
26
  --gridview-header-cell-vline: var( --border );
26
27
  --gridview-header-cell-border: var( --border );
27
28
 
@@ -245,17 +246,19 @@
245
246
  width: 1em;
246
247
  }
247
248
 
249
+ // the arrow is the mask of the box: its colour follows the theme
248
250
  &.sorted .sorter {
249
- background-image: url("./arrow-down-light.svg");
250
251
  display: block;
251
252
  width: 20px;
252
253
  height: 0.7em;
253
- background-repeat: no-repeat;
254
- background-position: 50% 50%;
254
+ background-color: var( --gridview-header-sort-color );
255
+ -webkit-mask: url("./arrow-down-light.svg") no-repeat 50% 50% / contain;
256
+ mask: url("./arrow-down-light.svg") no-repeat 50% 50% / contain;
255
257
  }
256
-
258
+
257
259
  &.sorted.desc .sorter {
258
- background-image: url("./arrow-up-light.svg");
260
+ -webkit-mask-image: url("./arrow-up-light.svg");
261
+ mask-image: url("./arrow-up-light.svg");
259
262
  }
260
263
 
261
264
  .x-c-sizer:hover {
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
  import { Component, ComponentContent, ComponentEvents, ComponentProps, EvClick, EvContextMenu, EvDblClick, EvSelectionChange } from '../../core/component';
19
- import { class_ns, isNumber, isString, setWaitCursor, UnsafeHtml } from '../../core/core_tools';
19
+ import { formatDate, formatDateTime, formatMoney, formatNumber, isNumber, isString, setWaitCursor, UnsafeHtml } from '../../core/core_tools';
20
20
  import { DataModel, DataStore, DataView, DataRecord, EvViewChange, SortCallback } from '../../core/core_data';
21
21
  import { EventCallback } from '../../core/core_events';
22
22
  import { kbNav } from '../../core/core_tools';
@@ -108,6 +108,7 @@ export interface GridviewProps extends ComponentProps {
108
108
  * --gridview-border
109
109
  * --gridview-header-cell-background
110
110
  * --gridview-header-cell-color
111
+ * --gridview-header-sort-color
111
112
  * --gridview-header-cell-vline
112
113
  * --gridview-header-cell-border
113
114
  * --grid-check-background
@@ -132,8 +133,8 @@ export interface GridviewProps extends ComponentProps {
132
133
  * ```
133
134
  */
134
135
 
135
- @class_ns("x4")
136
136
  export class Gridview<P extends GridviewProps = GridviewProps, E extends GridviewEvents = GridviewEvents> extends Component<P,E> {
137
+ static classPrefix = "x4";
137
138
 
138
139
  private _dataview: DataView;
139
140
  private _datamodel: DataModel;
@@ -165,10 +166,6 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
165
166
 
166
167
 
167
168
  // TODO: that
168
- private _num_fmt = new Intl.NumberFormat('fr-FR');
169
- private _mny_fmt = new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' });
170
- private _dte_fmt = new Intl.DateTimeFormat('fr-FR', {});
171
- private _dtetme_fmt = new Intl.DateTimeFormat('fr-FR', {day:'2-digit',month:'2-digit',year:'numeric',hour:'2-digit',minute:"2-digit"});
172
169
 
173
170
  private _has_fixed: boolean;
174
171
  private _has_footer: boolean;
@@ -744,12 +741,13 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
744
741
  })
745
742
 
746
743
  sizer.on("resize", (ev) => {
747
- cdata.width = ev.size;
744
+ const size = Math.max( ev.size, 16 ); // 16px at least: the min-width of a .cell
745
+ cdata.width = size;
748
746
  cdata.flex = 0;
749
-
747
+
750
748
  const cols = this.queryAll(`[data-col="${col}"]`)
751
749
  cols.forEach(c => {
752
- c.setStyleValue("width", ev.size + "px");
750
+ c.setStyleValue("width", size + "px");
753
751
  });
754
752
 
755
753
  const rh = header.getBoundingRect();
@@ -1005,7 +1003,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
1005
1003
  return "NaN";
1006
1004
  }
1007
1005
 
1008
- data = this._num_fmt.format(data as number);
1006
+ data = formatNumber(data as number);
1009
1007
  break;
1010
1008
  }
1011
1009
 
@@ -1014,7 +1012,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
1014
1012
  return "NaN";
1015
1013
  }
1016
1014
 
1017
- data = this._mny_fmt.format(data as number);
1015
+ data = formatMoney(data as number);
1018
1016
  break;
1019
1017
  }
1020
1018
 
@@ -1034,7 +1032,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
1034
1032
  data = new Date( data );
1035
1033
  }
1036
1034
 
1037
- data = this._dte_fmt.format(data as Date);
1035
+ data = formatDate(data as Date);
1038
1036
  break;
1039
1037
  }
1040
1038
 
@@ -1043,7 +1041,7 @@ export class Gridview<P extends GridviewProps = GridviewProps, E extends Gridvie
1043
1041
  data = new Date( data );
1044
1042
  }
1045
1043
 
1046
- data = this._dtetme_fmt.format(data as Date);
1044
+ data = formatDateTime(data as Date);
1047
1045
  break;
1048
1046
  }
1049
1047
 
@@ -1,4 +1,4 @@
1
- import { class_ns, getScrollbarSize } from '../../core/core_tools';
1
+ import { getScrollbarSize } from '../../core/core_tools';
2
2
  import { Component, ComponentProps } from '../../core/component';
3
3
  import { HBox } from '../boxes/boxes';
4
4
  import { Label } from '../label/label';
@@ -36,8 +36,8 @@ const MAX_COLS = 10; // columns with a default name (ref-c1...ref-c10) handled b
36
36
  * ```
37
37
  */
38
38
 
39
- @class_ns( "x4" )
40
39
  export class Header extends HBox<HeaderProps> {
40
+ static classPrefix = "x4";
41
41
 
42
42
  private _els: Component[];
43
43
  private _vwp: Component;
@@ -14,7 +14,6 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { class_ns } from '../../core/core_tools';
18
17
  import { Component, ComponentProps } from '../../core/component';
19
18
 
20
19
  import "./icon.module.scss"
@@ -111,8 +110,8 @@ export interface IconProps extends ComponentProps {
111
110
  * The CSS class for this component is automatically generated as `x4icon`.
112
111
  */
113
112
 
114
- @class_ns( "x4" )
115
113
  export class Icon extends Component<IconProps> {
114
+ static classPrefix = "x4";
116
115
 
117
116
  /**
118
117
  * Create a new Icon.
@@ -14,7 +14,6 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
- import { class_ns } from '../../core/core_tools';
18
17
  import { Component, ComponentEvents, ComponentProps } from '../../core/component';
19
18
  import { EventCallback, CoreEvent } from '../../core/core_events';
20
19
  import { dragManager } from '../../core/core_dragdrop';
@@ -56,8 +55,8 @@ export interface ImageProps extends ComponentProps {
56
55
  * ```
57
56
  */
58
57
 
59
- @class_ns( "x4" )
60
58
  export class Image<P extends ImageProps = ImageProps, E extends ImageEvents = ImageEvents> extends Component<P,E> {
59
+ static classPrefix = "x4";
61
60
 
62
61
  private _img: Component;
63
62
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { EventCallback } from '../../core/core_events';
18
18
  import { Component, ComponentEvent, ComponentProps, EvChange, EvFocus } from '../../core/component';
19
- import { class_ns, formatIntlDate, IComponentInterface, IFormElement, isString } from '../../core/core_tools';
19
+ import { formatIntlDate, IComponentInterface, IFormElement, isString } from '../../core/core_tools';
20
20
 
21
21
  import "./input.module.scss"
22
22
 
@@ -214,8 +214,9 @@ interface InputEvents extends ComponentEvent {
214
214
  * ```
215
215
  */
216
216
 
217
- @class_ns( "x4" )
218
217
  export class Input extends Component<InputProps,InputEvents> {
218
+ static classPrefix = "x4";
219
+
219
220
  constructor( props: InputProps ) {
220
221
  super( { tag: "input", ...props } );
221
222
 
@@ -19,7 +19,6 @@ import { Box, BoxProps, Button, HBox, VBox } from '../components';
19
19
  import { _tr } from '../../core/core_i18n';
20
20
 
21
21
  import "./keyboard.module.scss"
22
- import { class_ns } from '../../core/core_tools';
23
22
  import { Application } from '../../core/core_application';
24
23
 
25
24
  import icon_bksp from "./delete-left.svg";
@@ -275,9 +274,10 @@ interface KeyboardProps extends BoxProps {
275
274
  * --keyboard-zoom
276
275
  * ```
277
276
  */
278
- @class_ns( "x4" )
279
277
  export class Keyboard extends HBox<KeyboardProps>
280
278
  {
279
+ static classPrefix = "x4";
280
+
281
281
  mode: KbMode;
282
282
  upper: boolean;
283
283
  locale: string;
@@ -18,7 +18,7 @@ import { Component, ComponentProps } from "../../core/component"
18
18
  import { Icon } from "../icon/icon"
19
19
 
20
20
  import "./label.module.scss";
21
- import { class_ns, UnsafeHtml } from '../../core/core_tools';
21
+ import { UnsafeHtml } from '../../core/core_tools';
22
22
 
23
23
  export interface LabelProps extends ComponentProps {
24
24
  text?: string | UnsafeHtml;
@@ -37,8 +37,8 @@ export interface LabelProps extends ComponentProps {
37
37
  * ```
38
38
  */
39
39
 
40
- @class_ns( "x4" )
41
40
  export class Label extends Component<LabelProps> {
41
+ static classPrefix = "x4";
42
42
 
43
43
  constructor( p: LabelProps ) {
44
44
  super( { ...p, content: null } );
@@ -79,8 +79,8 @@ export interface SimpleTextProps extends ComponentProps {
79
79
  align?: "left" | "center" | "right";
80
80
  }
81
81
 
82
- @class_ns( "x4" )
83
82
  export class SimpleText extends Component<SimpleTextProps> {
83
+ static classPrefix = "x4";
84
84
 
85
85
  /**
86
86
  *
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { Component, ComponentEvents, ComponentProps, EvClick } from '../../core/component';
18
18
  import { EventCallback } from '../../core/core_events';
19
- import { class_ns, UnsafeHtml } from '../../core/core_tools';
19
+ import { UnsafeHtml } from '../../core/core_tools';
20
20
  import { Label } from '../label/label';
21
21
 
22
22
  import "./link.module.scss"
@@ -45,8 +45,9 @@ interface LinkProps extends ComponentProps {
45
45
  *
46
46
  */
47
47
 
48
- @class_ns( "x4" )
49
48
  export class Link extends Component<LinkProps,LinkEvents> {
49
+ static classPrefix = "x4";
50
+
50
51
  constructor( props: LinkProps ) {
51
52
  super( { tag: "a", ...props} );
52
53