x4js 2.3.25 → 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 (63) hide show
  1. package/aicontext.md +46 -12
  2. package/package.json +1 -1
  3. package/src/components/autocomplete/autocomplete.ts +2 -2
  4. package/src/components/boxes/boxes.module.scss +16 -2
  5. package/src/components/boxes/boxes.ts +24 -11
  6. package/src/components/breadcrumb/breadcrumb.ts +1 -2
  7. package/src/components/btngroup/btngroup.ts +2 -2
  8. package/src/components/button/button.ts +2 -2
  9. package/src/components/calendar/calendar.ts +4 -2
  10. package/src/components/canvas/canvas.ts +1 -2
  11. package/src/components/chart/chart.ts +3 -3
  12. package/src/components/checkbox/checkbox.ts +2 -2
  13. package/src/components/colorinput/colorinput.ts +3 -2
  14. package/src/components/colorpicker/colorpicker.ts +5 -5
  15. package/src/components/combobox/combobox.ts +3 -3
  16. package/src/components/dialog/dialog.ts +2 -2
  17. package/src/components/dockingview/dockingview.ts +1 -2
  18. package/src/components/filedrop/filedrop.ts +3 -2
  19. package/src/components/form/form.ts +4 -3
  20. package/src/components/gauge/gauge.ts +2 -2
  21. package/src/components/gridview/gridview.module.scss +8 -5
  22. package/src/components/gridview/gridview.ts +11 -13
  23. package/src/components/header/header.ts +2 -2
  24. package/src/components/icon/icon.ts +1 -2
  25. package/src/components/image/image.ts +1 -2
  26. package/src/components/input/input.ts +3 -2
  27. package/src/components/keyboard/keyboard.ts +2 -2
  28. package/src/components/label/label.ts +3 -3
  29. package/src/components/link/link.ts +3 -2
  30. package/src/components/listbox/listbox.ts +2 -2
  31. package/src/components/menu/menu.ts +5 -4
  32. package/src/components/messages/messages.module.scss +29 -5
  33. package/src/components/messages/messages.ts +42 -50
  34. package/src/components/notification/notification.ts +3 -2
  35. package/src/components/panel/panel.ts +2 -2
  36. package/src/components/popup/popup.ts +2 -2
  37. package/src/components/progress/progress.ts +1 -2
  38. package/src/components/propgrid/progrid.module.scss +2 -3
  39. package/src/components/propgrid/propgrid.ts +2 -2
  40. package/src/components/radio/radio.ts +1 -2
  41. package/src/components/rating/rating.ts +2 -2
  42. package/src/components/select/select.ts +2 -2
  43. package/src/components/settingsview/settingsview.module.scss +6 -5
  44. package/src/components/settingsview/settingsview.ts +3 -3
  45. package/src/components/sizers/sizer.ts +21 -29
  46. package/src/components/slider/slider.ts +2 -2
  47. package/src/components/spreadsheet/spreadsheet.ts +8 -10
  48. package/src/components/switch/switch.ts +2 -2
  49. package/src/components/tabs/tabs.ts +4 -4
  50. package/src/components/tag/tag.ts +2 -2
  51. package/src/components/textarea/textarea.ts +3 -3
  52. package/src/components/textedit/textedit.ts +2 -2
  53. package/src/components/themes.scss +2 -0
  54. package/src/components/tickline/tickline.ts +3 -3
  55. package/src/components/tooltips/tooltips.ts +2 -2
  56. package/src/components/treeview/treeview.ts +3 -3
  57. package/src/components/video/video.ts +1 -2
  58. package/src/components/viewport/viewport.ts +4 -3
  59. package/src/core/component.ts +15 -24
  60. package/src/core/core_application.ts +29 -1
  61. package/src/core/core_i18n.ts +39 -0
  62. package/src/core/core_svg.ts +1 -0
  63. package/src/core/core_tools.ts +83 -24
@@ -17,7 +17,7 @@
17
17
  import { Component, ComponentEvent, ComponentEvents, ComponentProps, componentFromDOM, makeUniqueComponentId } from "../../core/component"
18
18
 
19
19
  import { CSizer } from '../sizers/sizer';
20
- import { Rect, Point, class_ns, asap } from '../../core/core_tools';
20
+ import { Rect, Point, asap } from '../../core/core_tools';
21
21
  import { Box } from '../boxes/boxes'
22
22
 
23
23
  import "./popup.module.scss"
@@ -70,8 +70,8 @@ function dismissLast( e: UIEvent ) {
70
70
  * ```
71
71
  */
72
72
 
73
- @class_ns( "x4" )
74
73
  export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = PopupEvents> extends Box<P,E> {
74
+ static classPrefix = "x4";
75
75
 
76
76
  private _isshown = false;
77
77
  protected _ismodal = false;
@@ -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 "./progress.module.scss";
@@ -33,8 +32,8 @@ interface ProgressProps extends ComponentProps {
33
32
  * ```
34
33
  */
35
34
 
36
- @class_ns( "x4" )
37
35
  export class Progress extends Component<ProgressProps> {
36
+ static classPrefix = "x4";
38
37
 
39
38
  private _bar: Component;
40
39
 
@@ -117,9 +117,8 @@
117
117
  }
118
118
 
119
119
  // A row has no box of its own: its two cells go straight on the columns
120
- // of the grid, which is how all the titles get the same width. (A row is
121
- // a fieldset: it cannot be a subgrid.) What a row looked like, background
122
- // and bottom line, is carried by its cells.
120
+ // of the grid, which is how all the titles get the same width. What a row
121
+ // looked like, background and bottom line, is carried by its cells.
123
122
  .row {
124
123
  display: contents;
125
124
 
@@ -21,7 +21,7 @@ import { HBox, VBox } from "../boxes/boxes"
21
21
  import { Input } from "../input/input"
22
22
  import { ListboxID, ListItem } from "../listbox/listbox"
23
23
  import { Label, SimpleText } from "../label/label"
24
- import { asap, class_ns, isFunction, isNumber } from '../../core/core_tools';
24
+ import { asap, isFunction, isNumber } from '../../core/core_tools';
25
25
  import { Icon, ScrollView } from '../components'
26
26
  import { ColorInput } from '../colorinput/colorinput'
27
27
  import { EvColorChange } from '../colorpicker/colorpicker'
@@ -84,8 +84,8 @@ export interface PropertyProps extends ComponentProps {
84
84
  * ```
85
85
  */
86
86
 
87
- @class_ns( "x4" )
88
87
  export class PropertyGrid extends VBox {
88
+ static classPrefix = "x4";
89
89
 
90
90
  private root: Component;
91
91
  private groups: PropertyGroup[];
@@ -15,7 +15,6 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentEvents, ComponentProps, EvChange, makeUniqueComponentId } from '../../core/component';
18
- import { class_ns } from '../../core/core_tools';
19
18
  import { EventCallback } from '../../core/core_events';
20
19
 
21
20
  import { Label } from '../label/label';
@@ -57,8 +56,8 @@ interface RadioProps extends ComponentProps {
57
56
  * ```
58
57
  */
59
58
 
60
- @class_ns( "x4" )
61
59
  export class Radio extends Component<RadioProps,RadioEvents> {
60
+ static classPrefix = "x4";
62
61
 
63
62
  private _check: HBox;
64
63
  private _input: Input;
@@ -18,7 +18,7 @@ import { Component, ComponentEvents, ComponentProps, EvChange } from '../../core
18
18
  import { EventCallback } from '../../core/core_events';
19
19
  import { HBox } from '../boxes/boxes';
20
20
  import { Icon } from '../icon/icon';
21
- import { class_ns, IComponentInterface, IFormElement } from '../../core/core_tools';
21
+ import { IComponentInterface, IFormElement } from '../../core/core_tools';
22
22
 
23
23
  import icons from "../assets/icons"
24
24
 
@@ -49,8 +49,8 @@ export interface RatingProps extends ComponentProps {
49
49
  * ```
50
50
  */
51
51
 
52
- @class_ns( "x4" )
53
52
  export class Rating extends HBox<RatingProps,RatingEventMap> {
53
+ static classPrefix = "x4";
54
54
 
55
55
  private m_els: Component[];
56
56
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  import { EventCallback } from '../../core/core_events';
19
19
  import { Component, ComponentEvents, ComponentProps, EvChange, EvFocus } from '../../core/component';
20
- import { class_ns, IComponentInterface, IFormElement, isArray } from '../../core/core_tools';
20
+ import { IComponentInterface, IFormElement, isArray } from '../../core/core_tools';
21
21
 
22
22
  import { ListboxID, ListItem } from '../components';
23
23
 
@@ -57,8 +57,8 @@ interface SelectEvents extends ComponentEvents {
57
57
  * ```
58
58
  */
59
59
 
60
- @class_ns( "x4" )
61
60
  export class Select extends Component<SelectProps,SelectEvents> {
61
+ static classPrefix = "x4";
62
62
 
63
63
  private _items: ListItem[];
64
64
 
@@ -16,8 +16,9 @@
16
16
 
17
17
  :root {
18
18
  --settingsview-toc-width: 210px;
19
- --settingsview-section-background: var( --color-primary-a10 );
20
- --settingsview-section-title-background: var( --color-primary-a20 );
19
+ --settingsview-section-background: var( --background-primary );
20
+ --settingsview-section-title-background: transparent;
21
+ --settingsview-section-title-color: var( --accent-background );
21
22
  --settingsview-hover-background: var( --color-primary-a20 );
22
23
  --settingsview-marker: var( --accent-background );
23
24
  }
@@ -92,13 +93,13 @@
92
93
  }
93
94
  }
94
95
 
95
- // a section: a panel, its title on a band
96
+ // a section: no frame, its title in the accent colour on a line
96
97
  .section {
97
98
  flex-shrink: 0;
98
99
  width: 100%;
99
100
  max-width: 900px;
100
101
  padding: 0 8px 10px;
101
- border: 1px solid var( --border );
102
+ border: none;
102
103
  background: var( --settingsview-section-background );
103
104
  overflow: hidden;
104
105
  scroll-margin-top: 20px; // brought to the top: below the padding of the view
@@ -115,7 +116,7 @@
115
116
  background: var( --settingsview-section-title-background );
116
117
  font-size: 1.1rem;
117
118
  font-weight: 600;
118
- --label-color: var( --text-primary );
119
+ --label-color: var( --settingsview-section-title-color );
119
120
  }
120
121
 
121
122
  > .description {
@@ -16,7 +16,6 @@
16
16
 
17
17
  import { Component, ComponentEvent, ComponentEvents } from '../../core/component';
18
18
  import { EventCallback } from '../../core/core_events';
19
- import { class_ns } from '../../core/core_tools';
20
19
 
21
20
  import { BoxProps, HBox, VBox } from '../boxes/boxes';
22
21
  import { Input } from '../input/input';
@@ -43,8 +42,8 @@ export interface SettingItemProps extends BoxProps {
43
42
  * together, put the items in a Form and give the controls a name.
44
43
  */
45
44
 
46
- @class_ns( "x4" )
47
45
  export class SettingItem extends VBox<SettingItemProps> {
46
+ static classPrefix = "x4";
48
47
 
49
48
  constructor( props: SettingItemProps ) {
50
49
  // the content goes under the name and the description, not in the box itself
@@ -112,13 +111,14 @@ function normalize( text: string ) {
112
111
  * --settingsview-toc-width
113
112
  * --settingsview-section-background
114
113
  * --settingsview-section-title-background
114
+ * --settingsview-section-title-color
115
115
  * --settingsview-hover-background
116
116
  * --settingsview-marker
117
117
  * ```
118
118
  */
119
119
 
120
- @class_ns( "x4" )
121
120
  export class SettingsView<P extends SettingsViewProps = SettingsViewProps> extends VBox<P,SettingsViewEvents> {
121
+ static classPrefix = "x4";
122
122
 
123
123
  // fields, not refs: refs belong to the classes that derive from this one
124
124
  private _search: Input = null;
@@ -15,7 +15,7 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentEvent, ComponentEvents, ComponentProps, componentFromDOM } from '../../core/component';
18
- import { class_ns, Point } from '../../core/core_tools';
18
+ import { Point } from '../../core/core_tools';
19
19
 
20
20
  import "./sizer.module.scss"
21
21
 
@@ -43,8 +43,8 @@ type SizerType = "left" | "top" | "right" | "bottom" | "top-left" | "top-right"
43
43
  */
44
44
 
45
45
 
46
- @class_ns( "x4" )
47
46
  export class CSizer extends Component<ComponentProps,CSizerEvent> {
47
+ static classPrefix = "x4";
48
48
 
49
49
  private _type: SizerType;
50
50
  private _ref: Component;
@@ -98,6 +98,15 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
98
98
  this._ref = null;
99
99
  });
100
100
 
101
+ // cancelled by the browser (a touch taken by a scroll, a gesture...): no pointerup will
102
+ // come, the moves after are not a resize. The browser releases the capture itself
103
+ this.addDOMEvent( "pointercancel", ( ) => {
104
+ if( this._ref ) {
105
+ this.fire( "stop", { })
106
+ this._ref = null;
107
+ }
108
+ });
109
+
101
110
  this.addDOMEvent( "pointermove", ( e: PointerEvent ) => {
102
111
  this._onMouseMove( e );
103
112
  });
@@ -153,36 +162,17 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
153
162
  size = nr.width = (pt.x-rc.left);
154
163
  }
155
164
 
156
- const isFlex = ( c : Component ) => {
157
- if( !c ) {
158
- return false;
159
- }
160
-
161
- if( c.hasClass( "x4flex" ) ) {
162
- return true;
163
- }
164
-
165
- return c.getStyleValue( "flexGrow" )!==undefined;
166
- }
167
-
168
- if( this._type.includes("-prev") ) {
169
- if( isFlex(this.prevElement() ) ) {
170
- this._ref.setStyleValue( "flex", `0 0 ${size}px` );
165
+ // between two boxes: the neighbour sized by the basis of its flex; without a neighbour
166
+ // (the sizer first or last in its box), the box itself by its size
167
+ if( this._type.includes("-prev") || this._type.includes("-next") ) {
168
+ const neighbour = this._type.includes("-prev") ? this.prevElement( ) : this.nextElement( );
169
+ if( neighbour ) {
170
+ this._ref.setStyleValue( "flex", `0 0 ${size}px` );
171
171
  }
172
172
  else {
173
173
  this._ref.setStyle( nr );
174
174
  }
175
175
  }
176
- else if( this._type.includes("-next") ) {
177
- if( isFlex(this.nextElement() ) ) {
178
- this._ref.setStyleValue( "flex", `0 0 ${size}px` );
179
- }
180
- else {
181
- this._ref.setStyle( nr );
182
- }
183
-
184
- return;
185
- }
186
176
  else {
187
177
  this._ref.setStyle( nr );
188
178
  }
@@ -195,15 +185,17 @@ export class CSizer extends Component<ComponentProps,CSizerEvent> {
195
185
  }
196
186
  }
197
187
 
198
- @class_ns( "x4" )
199
188
  export class HSizer extends CSizer {
189
+ static classPrefix = "x4";
190
+
200
191
  constructor( next = true ) {
201
192
  super( next ? "hsize-next" : "hsize-prev" );
202
193
  }
203
194
  }
204
195
 
205
- @class_ns( "x4" )
206
196
  export class VSizer extends CSizer {
197
+ static classPrefix = "x4";
198
+
207
199
  constructor( next = true ) {
208
200
  super( next ? "vsize-next" : "vsize-prev" );
209
201
  }
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { EventCallback } from '../../core/core_events';
18
18
  import { Component, ComponentEvents, ComponentProps, EvChange } from '../../core/component';
19
- import { class_ns, IComponentInterface, IFormElement, Rect } from '../../core/core_tools';
19
+ import { IComponentInterface, IFormElement, Rect } from '../../core/core_tools';
20
20
 
21
21
  import { HBox } from '../boxes/boxes';
22
22
  import { Input } from '../input/input';
@@ -49,8 +49,8 @@ interface SliderProps extends ComponentProps {
49
49
  * ```
50
50
  */
51
51
 
52
- @class_ns( "x4" )
53
52
  export class Slider extends Component<SliderProps,SliderEvents> {
53
+ static classPrefix = "x4";
54
54
 
55
55
  private _mdown = false;
56
56
  private _irect: Rect = null;
@@ -18,7 +18,7 @@
18
18
  import { Component, ComponentContent, ComponentEvent, ComponentEvents, ComponentProps, EvChange, EvClick, EvContextMenu, EvDblClick, EvSelectionChange, componentFromDOM } from '../../core/component';
19
19
  import { GridColumn } from '../gridview/gridview'
20
20
 
21
- import { class_ns, IFormElement, isFunction, isNumber, isString, UnsafeHtml } from '../../core/core_tools';
21
+ import { formatDate, formatMoney, formatNumber, IFormElement, isFunction, isNumber, isString, UnsafeHtml } from '../../core/core_tools';
22
22
  import { CoreEvent, EventCallback, EventMap } from '../../core/core_events';
23
23
  import { kbNav } from '../../core/core_tools';
24
24
 
@@ -282,8 +282,8 @@ export interface SpreadsheetProps extends ComponentProps {
282
282
  * ```
283
283
  */
284
284
 
285
- @class_ns("x4")
286
285
  export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extends SpreadsheetEvents = SpreadsheetEvents> extends Component<P, E> {
286
+ static classPrefix = "x4";
287
287
 
288
288
  private _columns: SpreadsheetColumn[];
289
289
  private _store: Store;
@@ -310,9 +310,6 @@ export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extend
310
310
  private _end: number;
311
311
 
312
312
  private _selection: Set<number>;
313
- private _num_fmt = new Intl.NumberFormat('fr-FR');
314
- private _mny_fmt = new Intl.NumberFormat('fr-FR', { style: 'currency', currency: 'EUR' });
315
- private _dte_fmt = new Intl.DateTimeFormat('fr-FR', {});
316
313
 
317
314
  private _has_fixed: boolean;
318
315
  private _has_footer: boolean;
@@ -821,12 +818,13 @@ export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extend
821
818
  })
822
819
 
823
820
  sizer.on("resize", (ev) => {
824
- cdata.width = ev.size;
821
+ const size = Math.max( ev.size, 16 ); // 16px at least: the min-width of a .cell
822
+ cdata.width = size;
825
823
  cdata.flex = 0;
826
824
 
827
825
  const cols = this.queryAll(`[data-col="${col}"]`)
828
826
  cols.forEach(c => {
829
- c.setStyleValue("width", ev.size + "px");
827
+ c.setStyleValue("width", size + "px");
830
828
  });
831
829
 
832
830
  const rh = header.getBoundingRect();
@@ -990,7 +988,7 @@ export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extend
990
988
  return "NaN";
991
989
  }
992
990
 
993
- data = this._num_fmt.format(data as number);
991
+ data = formatNumber(data as number);
994
992
  break;
995
993
  }
996
994
 
@@ -999,7 +997,7 @@ export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extend
999
997
  return "NaN";
1000
998
  }
1001
999
 
1002
- data = this._mny_fmt.format(data as number);
1000
+ data = formatMoney(data as number);
1003
1001
  break;
1004
1002
  }
1005
1003
 
@@ -1015,7 +1013,7 @@ export class Spreadsheet<P extends SpreadsheetProps = SpreadsheetProps, E extend
1015
1013
  }
1016
1014
 
1017
1015
  case "date": {
1018
- data = this._dte_fmt.format(data as Date);
1016
+ data = formatDate(data as Date);
1019
1017
  break;
1020
1018
  }
1021
1019
 
@@ -22,7 +22,6 @@ import { Label } from '../label/label';
22
22
  import { HBox } from '../boxes/boxes';
23
23
 
24
24
  import "./switch.module.scss";
25
- import { class_ns } from '../../core/core_tools';
26
25
 
27
26
  interface SwitchProps extends ComponentProps {
28
27
  label: string;
@@ -43,8 +42,9 @@ interface SwitchProps extends ComponentProps {
43
42
  * ```
44
43
  */
45
44
 
46
- @class_ns( "x4" )
47
45
  export class Switch extends HBox<SwitchProps> {
46
+ static classPrefix = "x4";
47
+
48
48
  constructor(props: SwitchProps ) {
49
49
  super( props );
50
50
 
@@ -20,7 +20,6 @@ import { Button, ButtonProps } from '../button/button';
20
20
  import { HBox, VBox, StackBox, Box } from '../boxes/boxes';
21
21
 
22
22
  import "./tabs.module.scss"
23
- import { class_ns } from '../../core/core_tools';
24
23
 
25
24
  /**
26
25
  *
@@ -40,8 +39,9 @@ export interface TabItem {
40
39
  *
41
40
  */
42
41
 
43
- @class_ns( "x4" )
44
42
  class CTab extends Button {
43
+ static classPrefix = "x4";
44
+
45
45
  constructor( props: ButtonProps, item: TabItem ) {
46
46
  super( props );
47
47
 
@@ -78,8 +78,8 @@ interface TablistEvents extends ComponentEvents {
78
78
  * @internal
79
79
  */
80
80
 
81
- @class_ns( "x4" )
82
81
  class CTabList extends HBox<TablistProps,TablistEvents> {
82
+ static classPrefix = "x4";
83
83
 
84
84
  private _selitem: Button;
85
85
 
@@ -152,8 +152,8 @@ interface TabsProps extends Omit<ComponentProps,"content"> {
152
152
  * ```
153
153
  */
154
154
 
155
- @class_ns( "x4" )
156
155
  export class Tabs extends Box<TabsProps> {
156
+ static classPrefix = "x4";
157
157
 
158
158
  private _list: CTabList;
159
159
  private _stack: StackBox;
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
  import { ComponentProps } from '../../core/component';
19
- import { class_ns, UnsafeHtml } from '../../core/core_tools';
19
+ import { UnsafeHtml } from '../../core/core_tools';
20
20
  import { HBox } from '../boxes/boxes';
21
21
  import { Icon } from '../icon/icon';
22
22
  import { SimpleText } from '../label/label';
@@ -40,8 +40,8 @@ export interface TagProps extends ComponentProps {
40
40
  * ```
41
41
  */
42
42
 
43
- @class_ns( "x4" )
44
43
  export class Tag extends HBox<TagProps> {
44
+ static classPrefix = "x4";
45
45
 
46
46
  constructor( props: TagProps ) {
47
47
  super( props );
@@ -23,7 +23,7 @@ import { Label } from '../label/label';
23
23
  import { VBox } from '../boxes/boxes';
24
24
 
25
25
  import "./textarea.module.scss";
26
- import { class_ns, IFormElement } from '../../core/core_tools';
26
+ import { IFormElement } from '../../core/core_tools';
27
27
 
28
28
  /**
29
29
  *
@@ -50,8 +50,8 @@ export interface TextAreaEvents extends ComponentEvents {
50
50
  *
51
51
  */
52
52
 
53
- @class_ns( "x4" )
54
53
  export class SimpleTextArea extends Component<SimpleTextAreaProps,TextAreaEvents> {
54
+ static classPrefix = "x4";
55
55
 
56
56
  constructor( props: SimpleTextAreaProps ) {
57
57
  super( { ...props, tag: "textarea" } );
@@ -142,8 +142,8 @@ export class SimpleTextArea extends Component<SimpleTextAreaProps,TextAreaEvents
142
142
  * ```
143
143
  */
144
144
 
145
- @class_ns( "x4" )
146
145
  export class TextArea extends VBox {
146
+ static classPrefix = "x4";
147
147
 
148
148
  private _input: SimpleTextArea;
149
149
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  //import { EventCallback } from '../../core/core_events';
18
18
  import { Component, ComponentEvents, makeUniqueComponentId } from '../../core/component';
19
- import { class_ns, UnsafeHtml } from '../../core/core_tools';
19
+ import { UnsafeHtml } from '../../core/core_tools';
20
20
 
21
21
  import { BoxProps, HBox } from '../boxes/boxes';
22
22
  import { DateProps, Input, InputProps, NumberProps, TextInputProps, TimeProps } from "../input/input"
@@ -81,8 +81,8 @@ interface TextEditProps extends InputProps {
81
81
  * ```
82
82
  */
83
83
 
84
- @class_ns( "x4" )
85
84
  export class TextEdit<E extends ComponentEvents = ComponentEvents> extends HBox<BoxProps,E> {
85
+ static classPrefix = "x4";
86
86
 
87
87
  private input: Input;
88
88
 
@@ -92,9 +92,11 @@ $color--interval: 8.4%;
92
92
  // the red, orange and green do not follow the scale: their text stays white
93
93
  --alert-background: var(--color-danger-a50);
94
94
  --alert-background-active: var(--color-danger-a60);
95
+ --alert-background-light: color-mix(in srgb, var(--alert-background) 15%, transparent); // the red at 15%
95
96
  --alert-color: #ffffff;
96
97
 
97
98
  --warning-background: var(--color-warning-a50);
99
+ --warning-background-light: color-mix(in srgb, var(--warning-background) 15%, transparent); // the orange at 15%
98
100
  --warning-color: #ffffff;
99
101
 
100
102
  --success-background: var(--color-success-a50);
@@ -3,7 +3,7 @@ import { Color } from '../../core/core_colors';
3
3
  import { Component, ComponentProps } from '../../core/component';
4
4
 
5
5
  import "./tickline.module.scss"
6
- import { class_ns } from '../../core/core_tools';
6
+ import { formatNumber } from '../../core/core_tools';
7
7
 
8
8
  export interface TickLineProps extends ComponentProps {
9
9
  values: number[];
@@ -31,8 +31,8 @@ export interface TickLineProps extends ComponentProps {
31
31
  *
32
32
  */
33
33
 
34
- @class_ns( "x4" )
35
34
  export class TickLine extends Component<TickLineProps> {
35
+ static classPrefix = "x4";
36
36
 
37
37
  constructor( props: TickLineProps ) {
38
38
  super( props );
@@ -102,7 +102,7 @@ export class TickLine extends Component<TickLineProps> {
102
102
  .antiAlias( false );
103
103
 
104
104
  if( props.display?.tooltips ) {
105
- r.setAttr( 'tooltip', vals[x].toFixed(1) )
105
+ r.setAttr( 'tooltip', formatNumber( vals[x], 1 ) )
106
106
  }
107
107
  }
108
108
  }
@@ -15,7 +15,7 @@
15
15
  **/
16
16
 
17
17
  import { Component, wrapDOM } from '../../core/component';
18
- import { class_ns, ITipHandler, Point, Rect, Timer, UnsafeHtml, unsafeHtml } from '../../core/core_tools';
18
+ import { ITipHandler, Point, Rect, Timer, UnsafeHtml, unsafeHtml } from '../../core/core_tools';
19
19
 
20
20
  import { HBox } from '../boxes/boxes';
21
21
  import { Popup, PopupProps } from '../popup/popup';
@@ -117,8 +117,8 @@ function closeTT( ) {
117
117
  * ```
118
118
  */
119
119
 
120
- @class_ns( "x4" )
121
120
  class Tooltip extends Popup {
121
+ static classPrefix = "x4";
122
122
 
123
123
  constructor( props: PopupProps ) {
124
124
  super( props );
@@ -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 { asap, class_ns } from '../../core/core_tools';
17
+ import { asap } from '../../core/core_tools';
18
18
  import { EventCallback } from '../../core/core_events';
19
19
  import { Component, ComponentEvent, ComponentEvents, ComponentProps, EvClick, EvDblClick, EvSelectionChange, componentFromDOM } from '../../core/component';
20
20
 
@@ -84,8 +84,8 @@ export interface TreeviewEvents extends ComponentEvents {
84
84
  * ```
85
85
  */
86
86
 
87
- @class_ns( "x4" )
88
87
  class CTreeViewItem extends Box {
88
+ static classPrefix = "x4";
89
89
 
90
90
  private _item: TreeItem;
91
91
  private _label: Component;
@@ -187,8 +187,8 @@ class CTreeViewItem extends Box {
187
187
  *
188
188
  */
189
189
 
190
- @class_ns( "x4" )
191
190
  export class Treeview extends Component<TreeviewProps,TreeviewEvents> {
191
+ static classPrefix = "x4";
192
192
 
193
193
  private _view: Viewport;
194
194
  private _selection: ListboxID;
@@ -15,7 +15,6 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentProps } from '../../core/component';
18
- import { class_ns } from '../../core/core_tools';
19
18
  import { Box } from '../boxes/boxes';
20
19
 
21
20
  import "./video.module.scss"
@@ -31,8 +30,8 @@ interface VideoProps extends ComponentProps {
31
30
  *
32
31
  */
33
32
 
34
- @class_ns( "x4" )
35
33
  export class Video extends Box {
34
+ static classPrefix = "x4";
36
35
 
37
36
  private _vplayer: HTMLVideoElement;
38
37
 
@@ -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 "./viewport.module.scss"
@@ -24,8 +23,9 @@ import { Box, BoxProps } from '../components';
24
23
  *
25
24
  */
26
25
 
27
- @class_ns( "x4" )
28
26
  export class Viewport extends Component {
27
+ static classPrefix = "x4";
28
+
29
29
  constructor( props: ComponentProps ) {
30
30
  super( props );
31
31
  }
@@ -35,8 +35,9 @@ export class Viewport extends Component {
35
35
  *
36
36
  */
37
37
 
38
- @class_ns( "x4" )
39
38
  export class ScrollView extends Box {
39
+ static classPrefix = "x4";
40
+
40
41
  constructor( props: BoxProps ) {
41
42
  super( props );
42
43
  this.setContent( new Viewport( {} ) );