x4js 2.0.13 → 2.0.14

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 (258) hide show
  1. package/.vscode/launch.json +14 -0
  2. package/README.md +5 -0
  3. package/{lib/src/demo → demo}/main.scss +3 -1
  4. package/{lib/src/demo/main.tsx → demo/main.ts} +37 -36
  5. package/demo/package.json +26 -0
  6. package/demo/scss.d.ts +4 -0
  7. package/demo/svg.d.ts +1 -0
  8. package/demo/tsconfig.json +14 -0
  9. package/lib/README.txt +5 -0
  10. package/lib/cjs/x4.css +1 -1
  11. package/lib/cjs/x4.js +2 -1
  12. package/lib/esm/x4.css +1 -1
  13. package/lib/esm/x4.mjs +2 -1
  14. package/lib/src/components/boxes/boxes.module.scss +17 -0
  15. package/lib/src/components/boxes/boxes.ts +162 -13
  16. package/lib/src/components/breadcrumb/breadcrumb.scss +56 -28
  17. package/lib/src/components/breadcrumb/breadcrumb.ts +93 -84
  18. package/lib/src/components/btngroup/btngroup.module.scss +12 -0
  19. package/lib/src/components/btngroup/btngroup.ts +41 -8
  20. package/lib/src/components/button/button.module.scss +23 -5
  21. package/lib/src/components/button/button.ts +72 -4
  22. package/lib/src/components/canvas/canvas.module.scss +25 -0
  23. package/lib/src/components/canvas/canvas.ts +189 -0
  24. package/lib/src/components/canvas/canvas_ex.ts +269 -0
  25. package/lib/src/components/checkbox/checkbox.ts +18 -4
  26. package/lib/src/components/combobox/combobox.module.scss +24 -15
  27. package/lib/src/components/combobox/combobox.ts +107 -24
  28. package/lib/src/components/components.ts +7 -0
  29. package/lib/src/components/dialog/dialog.module.scss +37 -3
  30. package/lib/src/components/dialog/dialog.ts +149 -31
  31. package/lib/src/components/filedrop/cloud-arrow-up.svg +1 -0
  32. package/lib/src/components/filedrop/filedrop.module.scss +70 -0
  33. package/lib/src/components/filedrop/filedrop.ts +131 -0
  34. package/lib/src/components/form/form.module.scss +4 -0
  35. package/lib/src/components/form/form.ts +137 -6
  36. package/lib/src/components/gridview/arrow-down-light.svg +1 -0
  37. package/lib/src/components/gridview/arrow-up-light.svg +1 -0
  38. package/lib/src/components/gridview/gridview.module.scss +324 -0
  39. package/lib/src/components/gridview/gridview.ts +1175 -0
  40. package/lib/src/components/icon/icon.module.scss +1 -1
  41. package/lib/src/components/icon/icon.ts +4 -1
  42. package/lib/src/components/image/image.module.scss +8 -1
  43. package/lib/src/components/image/image.ts +105 -6
  44. package/lib/src/components/input/input.module.scss +8 -3
  45. package/lib/src/components/input/input.ts +137 -14
  46. package/lib/src/components/keyboard/arrow-up.svg +1 -0
  47. package/lib/src/components/keyboard/delete-left.svg +1 -0
  48. package/lib/src/components/keyboard/eye-slash.svg +1 -0
  49. package/lib/src/components/keyboard/keyboard.module.scss +134 -0
  50. package/lib/src/components/keyboard/keyboard.ts +525 -0
  51. package/lib/src/components/label/label.module.scss +22 -4
  52. package/lib/src/components/label/label.ts +33 -0
  53. package/lib/src/components/link/link.ts +81 -78
  54. package/lib/src/components/listbox/listbox.module.scss +61 -3
  55. package/lib/src/components/listbox/listbox.ts +164 -56
  56. package/lib/src/components/menu/menu.module.scss +10 -1
  57. package/lib/src/components/menu/menu.ts +4 -1
  58. package/lib/src/components/messages/messages.module.scss +44 -0
  59. package/lib/src/components/messages/messages.ts +164 -18
  60. package/lib/src/components/messages/pen-field.svg +1 -0
  61. package/lib/src/components/normalize.scss +5 -0
  62. package/lib/src/components/notification/notification.module.scss +4 -2
  63. package/lib/src/components/notification/notification.ts +2 -4
  64. package/lib/src/components/panel/panel.module.scss +12 -0
  65. package/lib/src/components/popup/popup.module.scss +4 -2
  66. package/lib/src/components/popup/popup.ts +136 -92
  67. package/lib/src/components/propgrid/folder-closed.svg +1 -0
  68. package/lib/src/components/propgrid/folder-open.svg +1 -0
  69. package/lib/src/components/propgrid/progrid.module.scss +108 -0
  70. package/lib/src/components/propgrid/propgrid.ts +271 -0
  71. package/lib/src/components/propgrid/updown.svg +4 -0
  72. package/lib/src/components/radio/radio.module.scss +147 -0
  73. package/lib/src/components/radio/radio.svg +4 -0
  74. package/lib/src/components/radio/radio.ts +142 -0
  75. package/lib/src/components/select/select.module.scss +9 -0
  76. package/lib/src/components/select/select.ts +134 -0
  77. package/lib/src/components/shared.scss +47 -0
  78. package/lib/src/components/sizers/sizer.ts +9 -2
  79. package/lib/src/components/slider/slider.module.scss +77 -30
  80. package/lib/src/components/slider/slider.ts +72 -22
  81. package/lib/src/components/tabs/tabs.module.scss +1 -2
  82. package/lib/src/components/tabs/tabs.ts +43 -12
  83. package/lib/src/components/textarea/textarea.module.scss +6 -2
  84. package/lib/src/components/textarea/textarea.ts +73 -8
  85. package/lib/src/components/textedit/textedit.module.scss +3 -1
  86. package/lib/src/components/textedit/textedit.ts +31 -4
  87. package/lib/src/components/themes.scss +7 -0
  88. package/lib/src/components/tickline/tickline.module.scss +26 -0
  89. package/lib/src/components/tickline/tickline.ts +82 -0
  90. package/lib/src/components/tooltips/comments-question.svg +1 -0
  91. package/lib/src/components/tooltips/tooltips.scss +30 -9
  92. package/lib/src/components/tooltips/tooltips.ts +10 -5
  93. package/lib/src/components/treeview/treeview.module.scss +129 -60
  94. package/lib/src/components/treeview/treeview.ts +47 -12
  95. package/lib/src/components/viewport/viewport.module.scss +7 -0
  96. package/lib/src/core/component.ts +102 -32
  97. package/lib/src/core/core_application.ts +222 -2
  98. package/lib/src/core/core_colors.ts +2 -2
  99. package/lib/src/{components/grid/datastore.ts → core/core_data.ts} +261 -250
  100. package/lib/src/core/core_dragdrop.ts +3 -3
  101. package/lib/src/core/core_element.ts +13 -1
  102. package/lib/src/core/core_events.ts +28 -0
  103. package/lib/src/core/core_i18n.ts +18 -2
  104. package/lib/src/core/core_react.ts +79 -0
  105. package/lib/src/core/core_router.ts +23 -7
  106. package/lib/src/core/core_styles.ts +5 -5
  107. package/lib/src/core/core_svg.ts +173 -12
  108. package/lib/src/core/core_tools.ts +305 -87
  109. package/lib/src/x4tsx.d.ts +25 -0
  110. package/lib/styles/x4.css +1 -1
  111. package/lib/types/x4js.d.ts +767 -92
  112. package/package.json +4 -4
  113. package/scripts/build.mjs +378 -0
  114. package/scripts/prepack.mjs +346 -0
  115. package/src/components/base.scss +25 -0
  116. package/src/components/boxes/boxes.module.scss +54 -0
  117. package/src/components/boxes/boxes.ts +278 -0
  118. package/src/components/breadcrumb/breadcrumb.scss +56 -0
  119. package/src/components/breadcrumb/breadcrumb.ts +93 -0
  120. package/src/components/breadcrumb/chevron-right.svg +1 -0
  121. package/src/components/btngroup/btngroup.module.scss +41 -0
  122. package/src/components/btngroup/btngroup.ts +153 -0
  123. package/src/components/button/button.module.scss +173 -0
  124. package/src/components/button/button.ts +185 -0
  125. package/src/components/calendar/calendar-check-sharp-light.svg +1 -0
  126. package/src/components/calendar/calendar.module.scss +163 -0
  127. package/src/components/calendar/calendar.ts +327 -0
  128. package/src/components/calendar/chevron-left-sharp-light.svg +1 -0
  129. package/src/components/calendar/chevron-right-sharp-light.svg +1 -0
  130. package/src/components/canvas/canvas.module.scss +25 -0
  131. package/src/components/canvas/canvas.ts +189 -0
  132. package/src/components/canvas/canvas_ex.ts +269 -0
  133. package/src/components/checkbox/check.svg +4 -0
  134. package/src/components/checkbox/checkbox.module.scss +142 -0
  135. package/src/components/checkbox/checkbox.ts +140 -0
  136. package/src/components/colorinput/colorinput.module.scss +65 -0
  137. package/src/components/colorinput/colorinput.ts +91 -0
  138. package/src/components/colorinput/crosshairs-simple-sharp-light.svg +1 -0
  139. package/src/components/colorpicker/colorpicker.module.scss +133 -0
  140. package/src/components/colorpicker/colorpicker.ts +482 -0
  141. package/src/components/combobox/combobox.module.scss +133 -0
  142. package/src/components/combobox/combobox.ts +275 -0
  143. package/src/components/combobox/updown.svg +4 -0
  144. package/src/components/components.ts +41 -0
  145. package/src/components/dialog/dialog.module.scss +105 -0
  146. package/src/components/dialog/dialog.ts +212 -0
  147. package/src/components/dialog/xmark-sharp-light.svg +1 -0
  148. package/src/components/filedrop/cloud-arrow-up.svg +1 -0
  149. package/src/components/filedrop/filedrop.module.scss +70 -0
  150. package/src/components/filedrop/filedrop.ts +131 -0
  151. package/src/components/form/form.module.scss +38 -0
  152. package/src/components/form/form.ts +172 -0
  153. package/src/components/gridview/arrow-down-light.svg +1 -0
  154. package/src/components/gridview/arrow-up-light.svg +1 -0
  155. package/src/components/gridview/gridview.module.scss +324 -0
  156. package/src/components/gridview/gridview.ts +1175 -0
  157. package/src/components/header/header.module.scss +40 -0
  158. package/src/components/header/header.ts +130 -0
  159. package/src/components/icon/icon.module.scss +30 -0
  160. package/src/components/icon/icon.ts +139 -0
  161. package/src/components/image/image.module.scss +28 -0
  162. package/src/components/image/image.ts +168 -0
  163. package/src/components/input/input.module.scss +74 -0
  164. package/src/components/input/input.ts +398 -0
  165. package/src/components/keyboard/arrow-up.svg +1 -0
  166. package/src/components/keyboard/delete-left.svg +1 -0
  167. package/src/components/keyboard/eye-slash.svg +1 -0
  168. package/src/components/keyboard/keyboard.module.scss +134 -0
  169. package/src/components/keyboard/keyboard.ts +525 -0
  170. package/src/components/label/label.module.scss +76 -0
  171. package/src/components/label/label.ts +97 -0
  172. package/src/components/link/link.ts +81 -0
  173. package/src/components/listbox/listbox.module.scss +161 -0
  174. package/src/components/listbox/listbox.ts +539 -0
  175. package/src/components/menu/caret-right-solid.svg +1 -0
  176. package/src/components/menu/menu.module.scss +117 -0
  177. package/src/components/menu/menu.ts +174 -0
  178. package/src/components/messages/circle-exclamation.svg +1 -0
  179. package/src/components/messages/messages.module.scss +92 -0
  180. package/src/components/messages/messages.ts +215 -0
  181. package/src/components/messages/pen-field.svg +1 -0
  182. package/src/components/normalize.scss +391 -0
  183. package/src/components/notification/circle-check-solid.svg +1 -0
  184. package/src/components/notification/circle-exclamation-solid.svg +1 -0
  185. package/src/components/notification/circle-notch-light.svg +1 -0
  186. package/src/components/notification/notification.module.scss +84 -0
  187. package/src/components/notification/notification.ts +107 -0
  188. package/src/components/notification/xmark-sharp-light.svg +1 -0
  189. package/src/components/panel/panel.module.scss +60 -0
  190. package/src/components/panel/panel.ts +58 -0
  191. package/src/components/popup/popup.module.scss +45 -0
  192. package/src/components/popup/popup.ts +440 -0
  193. package/src/components/progress/progress.module.scss +57 -0
  194. package/src/components/progress/progress.ts +44 -0
  195. package/src/components/propgrid/folder-closed.svg +1 -0
  196. package/src/components/propgrid/folder-open.svg +1 -0
  197. package/src/components/propgrid/progrid.module.scss +108 -0
  198. package/src/components/propgrid/propgrid.ts +271 -0
  199. package/src/components/propgrid/updown.svg +4 -0
  200. package/src/components/radio/radio.module.scss +147 -0
  201. package/src/components/radio/radio.svg +4 -0
  202. package/src/components/radio/radio.ts +142 -0
  203. package/src/components/rating/rating.module.scss +23 -0
  204. package/src/components/rating/rating.ts +131 -0
  205. package/src/components/rating/star-sharp-light.svg +1 -0
  206. package/src/components/rating/star-sharp-solid.svg +1 -0
  207. package/src/components/select/select.module.scss +9 -0
  208. package/src/components/select/select.ts +134 -0
  209. package/src/components/shared.scss +137 -0
  210. package/src/components/sizers/sizer.module.scss +90 -0
  211. package/src/components/sizers/sizer.ts +131 -0
  212. package/src/components/slider/slider.module.scss +118 -0
  213. package/src/components/slider/slider.ts +198 -0
  214. package/src/components/switch/switch.module.scss +127 -0
  215. package/src/components/switch/switch.ts +62 -0
  216. package/src/components/tabs/tabs.module.scss +45 -0
  217. package/src/components/tabs/tabs.ts +199 -0
  218. package/src/components/textarea/textarea.module.scss +63 -0
  219. package/src/components/textarea/textarea.ts +125 -0
  220. package/src/components/textedit/textedit.module.scss +116 -0
  221. package/src/components/textedit/textedit.ts +110 -0
  222. package/src/components/themes.scss +88 -0
  223. package/src/components/tickline/tickline.module.scss +26 -0
  224. package/src/components/tickline/tickline.ts +82 -0
  225. package/src/components/tooltips/circle-info-sharp-light.svg +1 -0
  226. package/src/components/tooltips/comments-question.svg +1 -0
  227. package/src/components/tooltips/tooltips.scss +72 -0
  228. package/src/components/tooltips/tooltips.ts +109 -0
  229. package/src/components/treeview/chevron-down-light.svg +1 -0
  230. package/src/components/treeview/treeview.module.scss +185 -0
  231. package/src/components/treeview/treeview.ts +445 -0
  232. package/src/components/viewport/viewport.module.scss +32 -0
  233. package/src/components/viewport/viewport.ts +41 -0
  234. package/src/core/component.ts +1072 -0
  235. package/src/core/core_application.ts +264 -0
  236. package/src/core/core_colors.ts +250 -0
  237. package/src/core/core_data.ts +1309 -0
  238. package/src/core/core_dom.ts +471 -0
  239. package/src/core/core_dragdrop.ts +201 -0
  240. package/src/core/core_element.ts +110 -0
  241. package/src/core/core_events.ts +177 -0
  242. package/src/core/core_i18n.ts +393 -0
  243. package/src/core/core_react.ts +79 -0
  244. package/src/core/core_router.ts +237 -0
  245. package/src/core/core_styles.ts +214 -0
  246. package/src/core/core_svg.ts +711 -0
  247. package/src/core/core_tools.ts +906 -0
  248. package/src/types/scss.d.ts +4 -0
  249. package/src/types/svg.d.ts +1 -0
  250. package/src/types/x4react.d.ts +9 -0
  251. package/src/x4.scss +19 -0
  252. package/src/x4tsx.d.ts +25 -0
  253. package/tsconfig.json +14 -0
  254. package/lib/src/components/grid/gridview.ts +0 -1108
  255. package/lib/src/components/grid/memdb.ts +0 -325
  256. /package/{lib/src/demo → demo}/assets/house-light.svg +0 -0
  257. /package/{lib/src/demo → demo}/assets/radio.svg +0 -0
  258. /package/{lib/src/demo → demo}/index.html +0 -0
@@ -15,43 +15,44 @@
15
15
  **/
16
16
 
17
17
  import { Component, ComponentEvent, ComponentEvents, ComponentProps, componentFromDOM, makeUniqueComponentId } from "../../core/component"
18
+
18
19
  import { CSizer } from '../sizers/sizer';
19
- import { Rect, Point, class_ns } from '../../core/core_tools.js';
20
+ import { Rect, Point, class_ns, asap } from '../../core/core_tools.js';
21
+ import { Box } from '../boxes/boxes'
20
22
 
21
23
  import "./popup.module.scss"
22
24
 
23
-
24
25
  export interface PopupEvents extends ComponentEvents {
25
26
  closed: ComponentEvent;
26
27
  opened: ComponentEvent;
27
28
  }
28
29
 
29
30
  export interface PopupProps extends ComponentProps {
30
- modal?: boolean;
31
31
  autoClose?: boolean | string;
32
32
  sizable?: boolean;
33
33
  movable?: boolean;
34
34
  }
35
35
 
36
-
37
- let modal_mask: Component;
38
- let modal_count = 0;
39
-
40
- let modal_stack: Popup[] = [];
41
36
  let autoclose_list: Popup[] = [];
42
37
  let popup_list: Popup[] = [];
43
38
 
39
+ let modal_stack: Popup[] = [];
40
+ let modal_mask: Component;
44
41
 
45
42
 
43
+ function getRoot( ) {
44
+ return document.body;
45
+ }
46
+
46
47
  /**
47
48
  *
48
49
  */
49
50
 
50
51
  @class_ns( "x4" )
51
- export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = PopupEvents> extends Component<P,E> {
52
+ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = PopupEvents> extends Box<P,E> {
52
53
 
53
- private _isopen = false;
54
54
  private _isshown = false;
55
+ protected _ismodal = false;
55
56
 
56
57
  constructor( props: P ) {
57
58
  super( props );
@@ -59,12 +60,28 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
59
60
  if( this.props.sizable ) {
60
61
  this._createSizers( );
61
62
  }
63
+
64
+ // wait for element to create it's childs
65
+ asap( ( ) => {
66
+ if( this.props.movable===true || (this.props.sizable && this.props.movable===undefined) ) {
67
+ const movers = this.queryAll( ".caption-element" );
68
+ movers.forEach( m => new CMover(m,this) );
69
+
70
+ if( this.hasClass("popup-caption") ) {
71
+ new CMover(this,this);
72
+ }
73
+ }
74
+ } );
62
75
  }
63
76
 
77
+ /**
78
+ *
79
+ */
80
+
64
81
  displayNear( rc: Rect, dst = "top left", src = "top left", offset = {x:0,y:0} ) {
65
82
 
66
83
  this.setStyle( { left: "0px", top: "0px" } ); // avoid scrollbar
67
- this._show( ); // to compute size
84
+ this._do_show( ); // to compute size
68
85
 
69
86
  let rm = this.getBoundingRect();
70
87
 
@@ -85,7 +102,6 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
85
102
  yref = rc.top + rc.height/2;
86
103
  }
87
104
 
88
- let halign = 'l';
89
105
  if (dst.indexOf('right') >= 0) {
90
106
  xref -= rm.width;
91
107
  }
@@ -93,7 +109,6 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
93
109
  xref -= rm.width/2;
94
110
  }
95
111
 
96
- let valign = 't';
97
112
  if (dst.indexOf('bottom') >= 0) {
98
113
  yref -= rm.height;
99
114
  }
@@ -132,7 +147,7 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
132
147
  top: y+"px",
133
148
  })
134
149
 
135
- this._show( );
150
+ this._do_show( ); // to compute size
136
151
 
137
152
  const rc = this.getBoundingRect( );
138
153
  const width = window.innerWidth - 16;
@@ -145,29 +160,65 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
145
160
  if( rc.bottom>height ) {
146
161
  this.setStyleValue( "top", height-rc.height );
147
162
  }
163
+ }
164
+
165
+ isOpen( ) {
166
+ return this._isshown;
167
+ }
148
168
 
149
- if( this.props.movable ) {
150
- const movers = this.queryAll( ".caption-element" );
151
- movers.forEach( m => new CMover(m,this) );
169
+ protected _do_hide( ) {
152
170
 
153
- if( this.hasClass("popup-caption") ) {
154
- new CMover(this,this);
155
- }
171
+ if( !this._isshown ) {
172
+ return;
156
173
  }
157
174
 
158
- this.fire( "opened", {} );
175
+ this.__hide( );
176
+ this.__remove( );
177
+
178
+ if( this._ismodal ) {
179
+ modal_stack.pop( );
180
+ this._hideModalMask( );
181
+ }
182
+
183
+ // remove from popup list
184
+ const idx = popup_list.indexOf( this );
185
+ console.assert( idx>=0 );
186
+ popup_list.splice( idx, 1 );
187
+
188
+ // remove from auto close list
189
+ if( this.props.autoClose ) {
190
+ const idx = autoclose_list.indexOf( this );
191
+ if( idx>=0 ) {
192
+ autoclose_list.splice( idx, 1 );
193
+ if( autoclose_list.length==0 ) {
194
+ document.removeEventListener( "pointerdown", this._dismiss );
195
+ }
196
+ }
197
+ }
198
+
199
+ this._isshown = false;
200
+ this.fire( "closed", {} );
159
201
  }
160
202
 
161
- private _show( ) {
162
-
163
- if( this.props.modal && !this._isshown ) {
164
- this._showModalMask( );
165
- modal_stack.push( this );
166
- modal_count++;
203
+ /**
204
+ *
205
+ */
206
+
207
+ protected _do_show( ) {
208
+ if( this._isshown ) {
209
+ return;
167
210
  }
168
211
 
169
212
  this._isshown = true;
170
-
213
+ this.__append( );
214
+
215
+ if( this._ismodal ) {
216
+ modal_stack.push( this );
217
+ this._showModalMask( );
218
+ }
219
+
220
+ this.__show( );
221
+
171
222
  if( this.props.autoClose ) {
172
223
  if( autoclose_list.length==0 ) {
173
224
  document.addEventListener( "pointerdown", this._dismiss );
@@ -178,52 +229,53 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
178
229
  }
179
230
 
180
231
  popup_list.push( this );
181
- document.body.appendChild( this.dom );
232
+
233
+ this.fire( "opened", {} );
234
+ }
182
235
 
183
- this.show( );
236
+ /**
237
+ *
238
+ */
239
+
240
+ protected __show( ) {
241
+ super.show( true );
184
242
  }
185
243
 
186
- override show( show = true ) {
187
- this._isopen = show;
188
- super.show( show );
244
+ protected __hide( ) {
245
+ super.show( false );
189
246
  }
190
247
 
191
- isOpen( ) {
192
- return this._isopen;
248
+ protected __append( ) {
249
+ const root = getRoot( );
250
+ root.appendChild( this.dom );
251
+ }
252
+
253
+ protected __remove( ) {
254
+ const root = getRoot( );
255
+ root.removeChild( this.dom );
193
256
  }
194
257
 
195
258
  /**
196
259
  *
197
260
  */
198
261
 
199
- close( ) {
200
- document.body.removeChild( this.dom );
201
-
202
- // remove from popup list
203
- const idx = popup_list.indexOf( this );
204
- console.assert( idx>=0 );
205
- popup_list.splice( idx, 1 );
206
-
207
- // remove from auto close list
208
- if( this.props.autoClose ) {
209
- const idx = autoclose_list.indexOf( this );
210
- if( idx>=0 ) {
211
- autoclose_list.splice( idx, 1 );
212
- if( autoclose_list.length==0 ) {
213
- document.removeEventListener( "pointerdown", this._dismiss );
214
- }
215
- }
262
+ override show( show = true ) : this {
263
+ if( show ) {
264
+ this.displayCenter( );
216
265
  }
217
-
218
- // update mask
219
- if( this.props.modal ) {
220
- const top = modal_stack.pop( );
221
- console.assert( top==this );
222
- this._updateModalMask( );
266
+ else {
267
+ this._do_hide( );
223
268
  }
224
269
 
225
- this._isshown = false;
226
- this.fire( "closed", {} );
270
+ return this;
271
+ }
272
+
273
+ /**
274
+ *
275
+ */
276
+
277
+ close( ) {
278
+ this._do_hide( );
227
279
  }
228
280
 
229
281
  /**
@@ -280,38 +332,6 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
280
332
  list.forEach( x => x.close() );
281
333
  }
282
334
 
283
- /**
284
- *
285
- */
286
-
287
- private _showModalMask( ) {
288
-
289
- if( !modal_mask ) {
290
- modal_mask = new Component( {
291
- cls: "x4modal-mask",
292
- domEvents: {
293
- click: this._dismiss
294
- }
295
- });
296
- }
297
-
298
- modal_mask.show( true );
299
- document.body.insertAdjacentElement( "beforeend", modal_mask.dom );
300
- }
301
-
302
- /**
303
- *
304
- */
305
-
306
- private _updateModalMask( ) {
307
- if( --modal_count == 0 ) {
308
- modal_mask.show( false );
309
- }
310
- else {
311
- this.dom.insertAdjacentElement( "beforebegin", modal_mask.dom );
312
- }
313
- }
314
-
315
335
  /**
316
336
  *
317
337
  */
@@ -328,6 +348,29 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
328
348
  new CSizer( "bottom-right" ),
329
349
  ])
330
350
  }
351
+
352
+ private _showModalMask( ) {
353
+ if( !modal_mask ) {
354
+ modal_mask = new Component( { cls: 'x4modal-mask' } )
355
+ //document.body.appendChild( modal_mask.dom );
356
+ }
357
+
358
+ const root = getRoot( );
359
+ root.insertBefore( modal_mask.dom, this.dom );
360
+ }
361
+
362
+ private _hideModalMask( ) {
363
+ if( modal_mask ) {
364
+ const root = getRoot( );
365
+ if( modal_stack.length ) {
366
+ const top = modal_stack[ modal_stack.length-1 ];
367
+ root.insertBefore( modal_mask.dom, top.dom );
368
+ }
369
+ else {
370
+ root.removeChild( modal_mask.dom );
371
+ }
372
+ }
373
+ }
331
374
  }
332
375
 
333
376
 
@@ -335,6 +378,7 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
335
378
  *
336
379
  */
337
380
 
381
+ export
338
382
  class CMover {
339
383
  private ref: Component;
340
384
  private delta: Point;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M32 224l448 0 0 224L32 448l0-224z"/><path class="fa-primary" d="M32 32l192 0 48 64 208 0 32 0 0 32 0 320 0 32-32 0L32 480 0 480l0-32L0 64 0 32l32 0zm240 96l-16 0-9.6-12.8L208 64 32 64l0 128 448 0 0-64-208 0zM32 224l0 224 448 0 0-224L32 224z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--!Font Awesome Pro 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path class="fa-secondary" opacity=".4" d="M32 64l0 280.4L108.2 192 448 192l0-64-176 0-13.3 0-9.4-9.4L194.7 64 32 64zM51.8 448L384 448l44.2 0 96-192-376.4 0-96 192z"/><path class="fa-primary" d="M272 96L208 32 32 32 0 32 0 64 0 448l0 32 32 0 3.8 0L384 480l64 0L560 256l16-32-35.8 0L128 224 32 416 32 64l162.7 0 54.6 54.6 9.4 9.4 13.3 0 176 0 0 64 32 0 0-64 0-32-32 0L272 96zM51.8 448l96-192 376.4 0-96 192L384 448 51.8 448z"/></svg>
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @file progrid.module.scss
3
+ * @author Etienne Cochard
4
+ * @copyright (c) 2025 InCare
5
+ **/
6
+
7
+ :root {
8
+ --propertygrid-background: white;
9
+ }
10
+
11
+ .x4propertygrid {
12
+ background: var( --propertygrid-background );
13
+ border: 1px solid var(--color-primary-a50);
14
+ overflow-y: auto;
15
+ flex-basis: 0;
16
+
17
+ .root {
18
+ display: grid;
19
+ grid-template-columns: 1fr;
20
+ grid-template-rows: auto;
21
+ }
22
+
23
+ .group {
24
+ padding: 6px 4px 4px 4px;
25
+ min-height: 2em;
26
+ font-weight: bold;
27
+ background-color: white;
28
+ color: var(--color-primary-a50);
29
+
30
+ .x4box > .desc {
31
+ font-style: italic;
32
+ font-weight: normal;
33
+ font-size: 90%;
34
+ color: var( --text-ternary );
35
+ }
36
+
37
+ &:not(:first-child ) {
38
+ border-top: 1px solid var(--color-primary-a50);
39
+ }
40
+
41
+ &:not( :last-child ) {
42
+ border-bottom: 1px solid var(--color-primary-a50);
43
+ box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.2);
44
+ }
45
+
46
+ display: flex;
47
+ align-items: center;
48
+ padding-left: 8px;
49
+ gap: 8px;
50
+
51
+ &>.x4box {
52
+ flex-grow: 1;
53
+ }
54
+
55
+ &>.x4icon {
56
+ .fa-secondary,
57
+ .fa-primary {
58
+ fill: var( --color-primary-a50 );
59
+ }
60
+
61
+ width: 1em;
62
+ height: 1em;
63
+ }
64
+
65
+ &>.x4button {
66
+ background-color: transparent;
67
+ color: var(--color-primary-a50);
68
+ }
69
+ }
70
+
71
+ .row {
72
+ border-bottom: 1px solid var( --border-light );
73
+ //border-top: none;
74
+ //border-left: 1px solid var(--color-primary-a50);
75
+ //border-right: 1px solid var(--color-primary-a50);
76
+
77
+ &:has(:focus) {
78
+ background-color: var(--color-primary-a20);
79
+ }
80
+
81
+ &:hover {
82
+ background-color: var(--color-primary-a10);
83
+ }
84
+
85
+ .cell {
86
+ flex-grow: 1;
87
+ flex-basis: 10px;
88
+ padding: 4px;
89
+
90
+ &>* {
91
+ width: 100%;
92
+ }
93
+
94
+ input {
95
+ background: rgba(255,255,255,0.6);
96
+ }
97
+ }
98
+
99
+ .cell:first-child {
100
+ border-right: 1px solid var( --border );
101
+ }
102
+
103
+ .hdr {
104
+ padding: 8px;
105
+ padding-left: 34px;
106
+ }
107
+ }
108
+ }