x4js 2.3.21 → 2.3.23

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 (58) hide show
  1. package/aicontext.md +91 -5
  2. package/package.json +1 -1
  3. package/src/components/btngroup/btngroup.module.scss +1 -1
  4. package/src/components/btngroup/btngroup.ts +6 -1
  5. package/src/components/button/button.module.scss +4 -4
  6. package/src/components/button/button.ts +20 -0
  7. package/src/components/calendar/calendar.module.scss +2 -1
  8. package/src/components/calendar/calendar.ts +2 -1
  9. package/src/components/chart/chart.module.scss +4 -4
  10. package/src/components/checkbox/checkbox.module.scss +2 -1
  11. package/src/components/checkbox/checkbox.ts +1 -0
  12. package/src/components/colorpicker/colorpicker.module.scss +0 -1
  13. package/src/components/components.ts +1 -0
  14. package/src/components/dialog/dialog.module.scss +2 -2
  15. package/src/components/dialog/dialog.ts +1 -0
  16. package/src/components/dockingview/dockingview.module.scss +9 -8
  17. package/src/components/dockingview/dockingview.ts +1 -0
  18. package/src/components/form/form.module.scss +2 -2
  19. package/src/components/form/form.ts +1 -1
  20. package/src/components/gauge/gauge.module.scss +2 -2
  21. package/src/components/gridview/gridview.module.scss +0 -1
  22. package/src/components/input/input.module.scss +2 -2
  23. package/src/components/input/input.ts +3 -0
  24. package/src/components/keyboard/keyboard.ts +25 -3
  25. package/src/components/label/label.module.scss +1 -1
  26. package/src/components/listbox/listbox.module.scss +6 -3
  27. package/src/components/listbox/listbox.ts +2 -0
  28. package/src/components/menu/menu.module.scss +1 -2
  29. package/src/components/messages/messages.module.scss +11 -11
  30. package/src/components/messages/messages.ts +7 -1
  31. package/src/components/messages/pen-field.svg +1 -1
  32. package/src/components/panel/panel.module.scss +4 -3
  33. package/src/components/panel/panel.ts +1 -0
  34. package/src/components/popup/popup.module.scss +2 -3
  35. package/src/components/popup/popup.ts +1 -0
  36. package/src/components/propgrid/progrid.module.scss +4 -4
  37. package/src/components/radio/radio.module.scss +9 -3
  38. package/src/components/radio/radio.ts +7 -1
  39. package/src/components/select/select.module.scss +17 -12
  40. package/src/components/select/select.ts +9 -0
  41. package/src/components/settingsview/settingsview.module.scss +178 -0
  42. package/src/components/settingsview/settingsview.ts +289 -0
  43. package/src/components/spreadsheet/spreadsheet.module.scss +0 -1
  44. package/src/components/switch/switch.module.scss +3 -2
  45. package/src/components/switch/switch.ts +1 -0
  46. package/src/components/tabs/tabs.module.scss +6 -3
  47. package/src/components/tabs/tabs.ts +3 -0
  48. package/src/components/tag/tag.module.scss +1 -1
  49. package/src/components/textarea/textarea.module.scss +8 -1
  50. package/src/components/textarea/textarea.ts +3 -0
  51. package/src/components/themes.scss +25 -12
  52. package/src/components/tickline/tickline.module.scss +1 -1
  53. package/src/components/tooltips/tooltips.scss +4 -3
  54. package/src/components/tooltips/tooltips.ts +1 -0
  55. package/src/components/treeview/treeview.module.scss +6 -2
  56. package/src/components/treeview/treeview.ts +1 -0
  57. package/src/core/core_colors.ts +112 -17
  58. package/src/core/core_i18n.ts +157 -0
@@ -20,12 +20,16 @@
20
20
  --msgbox-caption-color: var( --alert-color );
21
21
 
22
22
  --msgbox-icon-color: var( --alert-background );
23
+ --msgbox-question-icon-color: var( --accent-background ); // a question, an InputBox, a PromptBox
24
+
25
+ --msgbox-log-background: var( --background-ternary ); // the lines of a ProgressionBox
23
26
  }
24
27
 
25
28
  .x4messagebox {
26
29
  max-width: 60vw;
27
30
 
28
- & > .caption {
31
+ // an error has its own title bar; a question has the one of a Dialog
32
+ &.error > .caption {
29
33
  background-color: var( --msgbox-caption-background );
30
34
 
31
35
  & > #title {
@@ -45,24 +49,20 @@
45
49
  line-height: 1.8em;
46
50
  }
47
51
  }
52
+
53
+ &.question .x4form .x4icon {
54
+ color: var( --msgbox-question-icon-color );
55
+ }
48
56
  }
49
57
 
50
58
  .x4inputbox,
51
59
  .x4promptbox {
52
60
  max-width: 60vw;
53
61
 
54
- & > .caption {
55
- background-color: var( --msgbox-caption-background );
56
-
57
- & > #title {
58
- color: var( --msgbox-caption-color );
59
- }
60
- }
61
-
62
62
  & .x4form {
63
63
  min-width: 400px;
64
64
  .x4icon {
65
- color: var( --msgbox-icon-color );
65
+ color: var( --msgbox-question-icon-color );
66
66
  height: 64px;
67
67
  }
68
68
 
@@ -134,7 +134,7 @@
134
134
  flex-grow: 1;
135
135
  max-height: 400px;
136
136
  overflow: auto;
137
- background-color: #f5f5f5;
137
+ background-color: var( --msgbox-log-background );
138
138
  padding: 4px 8px;
139
139
  margin: 0 16px;
140
140
 
@@ -34,7 +34,11 @@ export interface MessageBoxProps extends DialogProps {
34
34
  * --msgbox-caption-background
35
35
  * --msgbox-caption-color
36
36
  * --msgbox-icon-color
37
+ * --msgbox-question-icon-color
38
+ * --msgbox-log-background
37
39
  * ```
40
+ * --msgbox-caption-* and --msgbox-icon-color are the ones of an error; a question, an InputBox
41
+ * and a PromptBox have the title bar of a Dialog and their icon in --msgbox-question-icon-color
38
42
  */
39
43
 
40
44
  @class_ns( "x4" )
@@ -58,7 +62,9 @@ export class MessageBox extends Dialog<DialogProps>
58
62
  }
59
63
  }
60
64
 
61
- const box = new MessageBox({
65
+ // the kind as a class: an error has its own title bar
66
+ const box = new MessageBox({
67
+ cls: icon_type ?? "error",
62
68
  modal: true,
63
69
  title: title ?? _tr.global.error,
64
70
  movable: true,
@@ -1 +1 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Pro 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 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 class="fa-secondary" opacity=".4" d="M0 128l32 0 224 0 32 0 0 64-32 0L64 192l0 256 448 0 0-128 0-32 64 0 0 32 0 160 0 32-32 0L32 512 0 512l0-32L0 160l0-32z"/><path class="fa-primary" d="M288 352l16-112L468.7 75.3l96 96L400 336 288 352zM587.3 148.7l-96-96L544 0l96 96-52.7 52.7zM96 288l64 0 0 64-64 0 0-64zm160 0l0 64-64 0 0-64 64 0z"/></svg>
@@ -18,7 +18,8 @@
18
18
 
19
19
  :root {
20
20
  --panel-border: var( --border );
21
- --panel-title-color: var( --border );
21
+ --panel-title-color: var( --text-primary );
22
+ --panel-title-background: var( --background-primary );
22
23
  }
23
24
 
24
25
 
@@ -34,9 +35,9 @@
34
35
  position: absolute;
35
36
  left: 4px;
36
37
  top: -0.7em;
37
- background-color: white;
38
+ background-color: var( --panel-title-background );
38
39
  font-weight: bold;
39
- color: var(--color-gray-9);
40
+ color: var( --panel-title-color );
40
41
  }
41
42
 
42
43
  & > .body {
@@ -33,6 +33,7 @@ interface PanelProps extends ComponentProps {
33
33
  * ```
34
34
  * --panel-border
35
35
  * --panel-title-color
36
+ * --panel-title-background
36
37
  * ```
37
38
  */
38
39
 
@@ -16,15 +16,14 @@
16
16
 
17
17
  :root {
18
18
  --modal-mask-background: rgb(0 0 0 / 60% );
19
+ --popup-background: transparent;
19
20
  }
20
21
 
21
22
  .x4popup {
22
23
  position: absolute !important;
23
- background-color: var(--fill-color);
24
- border: 1px solid var(--border-color);
24
+ background-color: var( --popup-background );
25
25
  overflow: hidden;
26
26
  z-index: 1000;
27
- border-radius: var(--bradius);
28
27
 
29
28
  &.popup-caption,
30
29
  .popup-caption {
@@ -66,6 +66,7 @@ function dismissLast( e: UIEvent ) {
66
66
  * @cssvar
67
67
  * ```
68
68
  * --modal-mask-background
69
+ * --popup-background
69
70
  * ```
70
71
  */
71
72
 
@@ -5,16 +5,16 @@
5
5
  **/
6
6
 
7
7
  :root {
8
- --propertygrid-background: white;
9
- --propertygrid-gadget-background: white;
10
- --propertygrid-gadget-color: black;
8
+ --propertygrid-background: var( --background-primary );
9
+ --propertygrid-gadget-background: var( --background-primary );
10
+ --propertygrid-gadget-color: var( --text-primary );
11
11
 
12
12
  --propertygrid-odd-background: var(--color-primary-a5);
13
13
  --propertygrid-even-background: transparent;
14
14
  --propertygrid-disabled-background: rgb(170 170 170 / 14%);
15
15
  --propertygrid-hover-background: var(--color-primary-a10);
16
16
  --propertygrid-focus-background: var(--color-primary-a20);
17
- --propertygrid-input-background: rgba(255,255,255,0.6);
17
+ --propertygrid-input-background: var( --background-input );
18
18
 
19
19
  --propertygrid-group-background: var( --color-primary-a5 );
20
20
  --propertygrid-group-color: var( --color-primary-a50 );
@@ -14,6 +14,12 @@
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
16
 
17
+ :root {
18
+ --radio-background: var( --background-primary );
19
+ --radio-check-color: var( --accent-color );
20
+ --radio-square-border-checked: var( --accent-color );
21
+ }
22
+
17
23
  .x4radio {
18
24
  display: flex;
19
25
  flex-direction: row;
@@ -36,7 +42,7 @@
36
42
  input {
37
43
  appearance: none;
38
44
  border-radius: 50%;
39
- background-color: white;
45
+ background-color: var( --radio-background );
40
46
  cursor: pointer;
41
47
  display: block;
42
48
 
@@ -67,7 +73,7 @@
67
73
  }
68
74
 
69
75
  .fa-secondary {
70
- fill: white;
76
+ fill: var( --radio-check-color );
71
77
  }
72
78
  }
73
79
 
@@ -157,7 +163,7 @@
157
163
 
158
164
  &:has(input:checked) {
159
165
  background-color: var( --accent-background-active );
160
- border-color: white;
166
+ border-color: var( --radio-square-border-checked );
161
167
  font-weight: 700;
162
168
  }
163
169
  }
@@ -48,7 +48,13 @@ interface RadioProps extends ComponentProps {
48
48
  }
49
49
 
50
50
  /**
51
- *
51
+ *
52
+ * @cssvar
53
+ * ```
54
+ * --radio-background
55
+ * --radio-check-color
56
+ * --radio-square-border-checked
57
+ * ```
52
58
  */
53
59
 
54
60
  @class_ns( "x4" )
@@ -1,10 +1,11 @@
1
1
 
2
- /**
3
- * @cssvar
4
- * --select-border
5
- * --select-border-focus
6
- * --select-background
7
- */
2
+ :root {
3
+ --select-border: var( --border );
4
+ --select-border-focus: var( --accent-background );
5
+ --select-background: var( --background-primary );
6
+ --select-color: var( --text-primary );
7
+ --select-arrow-color: var( --text-ternary );
8
+ }
8
9
 
9
10
  .x4select,
10
11
  ::picker(select) {
@@ -14,22 +15,26 @@
14
15
  outline: none;
15
16
 
16
17
  border-radius: 0;
17
- border: 1px solid var( --select-border, var( --border ) );
18
- background-color: var( --select-background, white );
18
+ border: 1px solid var( --select-border );
19
+ background-color: var( --select-background );
20
+ color: var( --select-color );
19
21
  }
20
22
 
21
23
  .x4select {
22
24
  appearance: none;
23
25
  -webkit-appearance: none;
24
26
  -moz-appearance: none;
25
- background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
27
+ // the arrow: two halves of a square side by side, in the colour of the variable
28
+ background-image:
29
+ linear-gradient( 45deg, transparent 50%, var( --select-arrow-color ) 50% ),
30
+ linear-gradient( 135deg, var( --select-arrow-color ) 50%, transparent 50% );
26
31
  background-repeat: no-repeat;
27
- background-position: right 6px center;
28
- background-size: 12px 8px;
32
+ background-position: right 13px center, right 8px center;
33
+ background-size: 5px 5px, 5px 5px;
29
34
  padding-right: 23px;
30
35
 
31
36
  &:focus-visible {
32
- border-color: var( --select-border-focus, var( --accent-background ) );
37
+ border-color: var( --select-border-focus );
33
38
  }
34
39
 
35
40
  .select-option {
@@ -46,6 +46,15 @@ interface SelectEvents extends ComponentEvents {
46
46
  /**
47
47
  * simple select
48
48
  * cf. Combobox
49
+ *
50
+ * @cssvar
51
+ * ```
52
+ * --select-border
53
+ * --select-border-focus
54
+ * --select-background
55
+ * --select-color
56
+ * --select-arrow-color
57
+ * ```
49
58
  */
50
59
 
51
60
  @class_ns( "x4" )
@@ -0,0 +1,178 @@
1
+ /**
2
+ * ___ ___ __
3
+ * \ \/ / / _
4
+ * \ / /_| |_
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file settingsview.module.scss
9
+ * @author Etienne Cochard
10
+ *
11
+ * @copyright (c) 2026 R-libre ingenierie
12
+ *
13
+ * Use of this source code is governed by an MIT-style license
14
+ * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
+ **/
16
+
17
+ :root {
18
+ --settingsview-toc-width: 210px;
19
+ --settingsview-section-background: var( --color-primary-a10 );
20
+ --settingsview-section-title-background: var( --color-primary-a20 );
21
+ --settingsview-hover-background: var( --color-primary-a20 );
22
+ --settingsview-marker: var( --accent-background );
23
+ }
24
+
25
+ .x4settingsview {
26
+ min-height: 0;
27
+
28
+ > .search {
29
+ flex-shrink: 0;
30
+ padding: 12px 32px 12px calc( var( --settingsview-toc-width ) + 32px );
31
+ border-bottom: 1px solid var( --border );
32
+
33
+ > .x4input {
34
+ flex: 1;
35
+ max-width: 900px;
36
+ margin: 0;
37
+ padding: 6px 10px;
38
+ border: 1px solid var( --border );
39
+ border-radius: 4px;
40
+
41
+ &:focus {
42
+ border-color: var( --settingsview-marker );
43
+ }
44
+ }
45
+ }
46
+
47
+ > .body {
48
+ min-height: 0;
49
+ align-items: stretch;
50
+ }
51
+
52
+ // the summary: the section at the top in the color of the text, marked on its left
53
+ .toc {
54
+ flex-shrink: 0;
55
+ width: var( --settingsview-toc-width );
56
+ margin: 0;
57
+ padding: 12px 0;
58
+ border: none;
59
+ border-right: 1px solid var( --border );
60
+ border-radius: 0;
61
+ background: transparent;
62
+
63
+ .x4item {
64
+ padding: 4px 4px 4px 16px;
65
+ border-left: 2px solid transparent;
66
+ border-radius: 0;
67
+ --label-color: var( --text-secondary );
68
+
69
+ &:hover {
70
+ background: transparent;
71
+ --label-color: var( --text-primary );
72
+ }
73
+
74
+ &.selected {
75
+ background: transparent;
76
+ border-left-color: var( --settingsview-marker );
77
+ --label-color: var( --text-primary );
78
+ font-weight: 600;
79
+ }
80
+ }
81
+ }
82
+
83
+ .sections {
84
+ align-items: flex-start;
85
+ gap: 24px;
86
+ min-height: 0;
87
+ overflow-y: auto;
88
+ padding: 20px 32px 32px;
89
+
90
+ > .nomatch {
91
+ padding: 8px;
92
+ --label-color: var( --text-secondary );
93
+ }
94
+ }
95
+
96
+ // a section: a panel, its title on a band
97
+ .section {
98
+ flex-shrink: 0;
99
+ width: 100%;
100
+ max-width: 900px;
101
+ padding: 0 8px 10px;
102
+ border: 1px solid var( --border );
103
+ border-radius: 8px;
104
+ background: var( --settingsview-section-background );
105
+ overflow: hidden;
106
+ scroll-margin-top: 20px; // brought to the top: below the padding of the view
107
+
108
+ // the last one shown: as high as the view, a click in the summary brings it to the top too
109
+ &.last {
110
+ min-height: 100%;
111
+ }
112
+
113
+ > .title {
114
+ margin: 0 -8px 6px;
115
+ padding: 12px 16px;
116
+ border-bottom: 1px solid var( --border );
117
+ background: var( --settingsview-section-title-background );
118
+ font-size: 1.1rem;
119
+ font-weight: 600;
120
+ --label-color: var( --text-primary );
121
+ }
122
+
123
+ > .description {
124
+ padding: 10px 8px 4px;
125
+ white-space: normal;
126
+ --label-color: var( --text-secondary );
127
+ }
128
+
129
+ // a section is as high as its content: what it holds takes its own height,
130
+ // a flex child (a Form) would get none
131
+ > * {
132
+ flex: none;
133
+ }
134
+
135
+ // a form of settings: the settings set the spaces
136
+ > .x4form {
137
+ padding: 0;
138
+ }
139
+ }
140
+
141
+ // a setting: its name, what it does, its controls; marked on its left while one has the focus
142
+ .x4settingitem {
143
+ flex-shrink: 0;
144
+ gap: 4px;
145
+ padding: 10px 8px 12px;
146
+ border-left: 2px solid transparent;
147
+ border-radius: 4px;
148
+
149
+ &:hover {
150
+ background: var( --settingsview-hover-background );
151
+ }
152
+
153
+ &:focus-within {
154
+ border-left-color: var( --settingsview-marker );
155
+ }
156
+
157
+ > .name {
158
+ font-weight: 600;
159
+ --label-color: var( --text-primary );
160
+ }
161
+
162
+ > .description {
163
+ white-space: normal;
164
+ --label-color: var( --text-secondary );
165
+ }
166
+
167
+ > .controls {
168
+ align-items: center;
169
+ gap: 10px;
170
+ padding-top: 4px;
171
+ flex-wrap: wrap;
172
+
173
+ > * {
174
+ margin: 0;
175
+ }
176
+ }
177
+ }
178
+ }