x4js 1.4.9 → 1.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/listview.ts CHANGED
@@ -27,7 +27,7 @@
27
27
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
28
  **/
29
29
 
30
- import { Container, Component, CProps, ContainerEventMap, EvDblClick } from './component'
30
+ import { Container, Component, ContainerProps, ContainerEventMap, EvDblClick } from './component'
31
31
  import { IconID } from './icon';
32
32
  import { HLayout, VLayout } from './layout'
33
33
  import { Popup, PopupEventMap, PopupProps } from './popup';
@@ -40,7 +40,7 @@ import { EvContextMenu, EvSelectionChange, EvClick, EventCallback, BasicEvent, E
40
40
  * item definition
41
41
  */
42
42
 
43
- export class ListViewItem {
43
+ export interface ListViewItem {
44
44
  id: any;
45
45
  text?: string | HtmlString; // if you need pure text
46
46
  html?: boolean; // if text is html
@@ -79,7 +79,7 @@ export interface ListViewEventMap extends ContainerEventMap {
79
79
  /**
80
80
  * listview properties
81
81
  */
82
- export interface ListViewProps<E extends ListViewEventMap = ListViewEventMap> extends CProps<E> {
82
+ export interface ListViewProps<E extends ListViewEventMap = ListViewEventMap> extends ContainerProps<E> {
83
83
  items?: ListViewItem[];
84
84
  populate?: PopulateItems;
85
85
  gadgets?: Component[]; // gadgets to instert at bottom
package/src/md5.ts CHANGED
@@ -363,6 +363,7 @@ export class Md5 {
363
363
  const s = self._state;
364
364
 
365
365
  return {
366
+ //@ts-ignore
366
367
  buffer: String.fromCharCode.apply(null, self._buffer8),
367
368
  buflen: self._bufferLength,
368
369
  length: self._dataLength,
package/src/popup.ts CHANGED
@@ -148,15 +148,13 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEventMap =
148
148
  autofocus.focus( )
149
149
  }
150
150
  else {
151
- let tabbable = this.queryItem('[tabindex]');
151
+ let tabbable = this.queryAll('[tabindex]');
152
152
 
153
153
  if( tabbable ) {
154
- let tab_indexes: HTMLElement[] = [].map.call(tabbable, (e) => { return e; });
155
-
156
154
  // remove hidden elements
157
- tab_indexes = tab_indexes.filter((el) => el.offsetParent !== null);
158
- if (tab_indexes.length) {
159
- tab_indexes[0].focus( );
155
+ tabbable = tabbable.filter((el) => el.offsetParent !== null);
156
+ if (tabbable.length) {
157
+ tabbable[0].focus( );
160
158
  }
161
159
  }
162
160
  }
@@ -447,8 +445,7 @@ function _nextTab(root: HTMLElement, el: HTMLElement, prev: boolean) {
447
445
 
448
446
  // get a list of elements with tab index, this way we should abble to
449
447
  // cycle on them (not on browser address nor under dialog elements)
450
- let tabbable = root.querySelectorAll('[tabindex]');
451
- let tab_indexes: HTMLElement[] = [].map.call(tabbable, (e) => { return e; });
448
+ let tab_indexes:HTMLElement[] = Array.from( root.querySelectorAll<HTMLElement>('[tabindex]') );
452
449
 
453
450
  // remove hidden elements
454
451
  tab_indexes = tab_indexes.filter((el) => el.offsetParent !== null);
package/src/request.ts CHANGED
@@ -108,7 +108,7 @@ export function ajaxRequest( cfg: RequestProps ) : Function {
108
108
 
109
109
  if( cfg.headers ) {
110
110
  for( let h in cfg.headers) {
111
- this.xhr.setRequestHeader( h, cfg.headers[h] );
111
+ xhr.setRequestHeader( h, cfg.headers[h] );
112
112
  }
113
113
  }
114
114
 
package/src/textedit.ts CHANGED
@@ -171,7 +171,7 @@ export class TextEdit<T extends TextEditProps = TextEditProps> extends Component
171
171
 
172
172
  button = new Button({
173
173
  cls: 'gadget',
174
- icon: 'cls(far fa-calendar-days)', // todo: resolve that
174
+ icon: 'var( --x4-icon-calendar-days )',
175
175
  tabIndex: false,
176
176
  click: () => this._showDatePicker(button)
177
177
  });
@@ -461,7 +461,7 @@ export class TextEdit<T extends TextEditProps = TextEditProps> extends Component
461
461
  this.value = props.validator(value);
462
462
  }
463
463
  catch (err) {
464
- this.showError(err instanceof Error ? err.message : err);
464
+ this.showError(err instanceof Error ? err.message : err as string);
465
465
  return false;
466
466
  }
467
467
  }
package/src/tools.ts CHANGED
@@ -551,9 +551,11 @@ export function parseIntlDate(value: string, fmts: string = _tr.global.date_inpu
551
551
  let match = rematch.exec(value);
552
552
 
553
553
  if (match) {
554
+ const now = new Date( );
555
+
554
556
  let d = parseInt(match.groups.day ?? '1');
555
557
  let m = parseInt(match.groups.month ?? '1');
556
- let y = parseInt(match.groups.year ?? '1970');
558
+ let y = parseInt(match.groups.year ?? now.getFullYear()+'');
557
559
  let h = parseInt(match.groups.hour ?? '0');
558
560
  let i = parseInt(match.groups.min ?? '0');
559
561
  let s = parseInt(match.groups.sec ?? '0');
package/src/tooltips.ts CHANGED
@@ -52,7 +52,7 @@ export class Tooltip extends Component {
52
52
  render() {
53
53
  this.setClass('@non-maskable', true);
54
54
  this.setContent([
55
- new Icon({ icon: 'cls(far fa-circle-info)' }),
55
+ new Icon({ icon: 'var( --x4-icon-tip )' }),
56
56
  this.m_text = new Label({ text: 'help' })
57
57
  ]);
58
58
  }
package/src/x4.less CHANGED
@@ -1,4 +1,4 @@
1
- // out: ../x4.css
1
+ // out: ../lib/x4.css
2
2
 
3
3
  /**
4
4
  * ___ ___ __
@@ -69,6 +69,8 @@
69
69
  --x4-icon-rectangle-times: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M448 32C483.3 32 512 60.65 512 96V416C512 451.3 483.3 480 448 480H64C28.65 480 0 451.3 0 416V96C0 60.65 28.65 32 64 32H448zM175 208.1L222.1 255.1L175 303C165.7 312.4 165.7 327.6 175 336.1C184.4 346.3 199.6 346.3 208.1 336.1L255.1 289.9L303 336.1C312.4 346.3 327.6 346.3 336.1 336.1C346.3 327.6 346.3 312.4 336.1 303L289.9 255.1L336.1 208.1C346.3 199.6 346.3 184.4 336.1 175C327.6 165.7 312.4 165.7 303 175L255.1 222.1L208.1 175C199.6 165.7 184.4 165.7 175 175C165.7 184.4 165.7 199.6 175 208.1V208.1z"/></svg>';
70
70
  --x4-icon-xmark: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>';
71
71
  --x4-icon-angle-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><path d="M192 384c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L192 306.8l137.4-137.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-160 160C208.4 380.9 200.2 384 192 384z"/></svg>';
72
+ --x4-icon-calendar-days: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32zM0 192H448V464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192zM64 304C64 312.8 71.16 320 80 320H112C120.8 320 128 312.8 128 304V272C128 263.2 120.8 256 112 256H80C71.16 256 64 263.2 64 272V304zM192 304C192 312.8 199.2 320 208 320H240C248.8 320 256 312.8 256 304V272C256 263.2 248.8 256 240 256H208C199.2 256 192 263.2 192 272V304zM336 256C327.2 256 320 263.2 320 272V304C320 312.8 327.2 320 336 320H368C376.8 320 384 312.8 384 304V272C384 263.2 376.8 256 368 256H336zM64 432C64 440.8 71.16 448 80 448H112C120.8 448 128 440.8 128 432V400C128 391.2 120.8 384 112 384H80C71.16 384 64 391.2 64 400V432zM208 384C199.2 384 192 391.2 192 400V432C192 440.8 199.2 448 208 448H240C248.8 448 256 440.8 256 432V400C256 391.2 248.8 384 240 384H208zM320 432C320 440.8 327.2 448 336 448H368C376.8 448 384 440.8 384 432V400C384 391.2 376.8 384 368 384H336C327.2 384 320 391.2 320 400V432z"/></svg>';
73
+ --x4-icon-tip: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"/></svg>';
72
74
  }
73
75
 
74
76
  @BLACK10: rgba(0,0,0,0.1);
@@ -95,6 +97,112 @@
95
97
  @WHITE90: rgba(255,255,255,0.9);
96
98
  @WHITE: #fff;
97
99
 
100
+ /* source: https://tailwindcss.com/docs/customizing-colors/#default-color-palette */
101
+ :root {
102
+ --black: #000000;
103
+ --white: #ffffff;
104
+
105
+ --gray-100: #f7fafc;
106
+ --gray-200: #edf2f7;
107
+ --gray-300: #e2e8f0;
108
+ --gray-400: #cbd5e0;
109
+ --gray-500: #a0aec0;
110
+ --gray-600: #718096;
111
+ --gray-700: #4a5568;
112
+ --gray-800: #2d3748;
113
+ --gray-900: #1a202c;
114
+
115
+ --red-100: #fff5f5;
116
+ --red-200: #fed7d7;
117
+ --red-300: #feb2b2;
118
+ --red-400: #fc8181;
119
+ --red-500: #f56565;
120
+ --red-600: #e53e3e;
121
+ --red-700: #c53030;
122
+ --red-800: #9b2c2c;
123
+ --red-900: #742a2a;
124
+
125
+ --orange-100: #fffaf0;
126
+ --orange-200: #feebc8;
127
+ --orange-300: #fbd38d;
128
+ --orange-400: #f6ad55;
129
+ --orange-500: #ed8936;
130
+ --orange-600: #dd6b20;
131
+ --orange-700: #c05621;
132
+ --orange-800: #9c4221;
133
+ --orange-900: #7b341e;
134
+
135
+ --yellow-100: #fffff0;
136
+ --yellow-200: #fefcbf;
137
+ --yellow-300: #faf089;
138
+ --yellow-400: #f6e05e;
139
+ --yellow-500: #ecc94b;
140
+ --yellow-600: #d69e2e;
141
+ --yellow-700: #b7791f;
142
+ --yellow-800: #975a16;
143
+ --yellow-900: #744210;
144
+
145
+ --green-100: #f0fff4;
146
+ --green-200: #c6f6d5;
147
+ --green-300: #9ae6b4;
148
+ --green-400: #68d391;
149
+ --green-500: #48bb78;
150
+ --green-600: #38a169;
151
+ --green-700: #2f855a;
152
+ --green-800: #276749;
153
+ --green-900: #22543d;
154
+
155
+ --teal-100: #e6fffa;
156
+ --teal-200: #b2f5ea;
157
+ --teal-300: #81e6d9;
158
+ --teal-400: #4fd1c5;
159
+ --teal-500: #38b2ac;
160
+ --teal-600: #319795;
161
+ --teal-700: #2c7a7b;
162
+ --teal-800: #285e61;
163
+ --teal-900: #234e52;
164
+
165
+ --blue-100: #ebf8ff;
166
+ --blue-200: #bee3f8;
167
+ --blue-300: #90cdf4;
168
+ --blue-400: #63b3ed;
169
+ --blue-500: #4299e1;
170
+ --blue-600: #3182ce;
171
+ --blue-700: #2b6cb0;
172
+ --blue-800: #2c5282;
173
+ --blue-900: #2a4365;
174
+
175
+ --indigo-100: #ebf4ff;
176
+ --indigo-200: #c3dafe;
177
+ --indigo-300: #a3bffa;
178
+ --indigo-400: #7f9cf5;
179
+ --indigo-500: #667eea;
180
+ --indigo-600: #5a67d8;
181
+ --indigo-700: #4c51bf;
182
+ --indigo-800: #434190;
183
+ --indigo-900: #3c366b;
184
+
185
+ --purple-100: #faf5ff;
186
+ --purple-200: #e9d8fd;
187
+ --purple-300: #d6bcfa;
188
+ --purple-400: #b794f4;
189
+ --purple-500: #9f7aea;
190
+ --purple-600: #805ad5;
191
+ --purple-700: #6b46c1;
192
+ --purple-800: #553c9a;
193
+ --purple-900: #44337a;
194
+
195
+ --pink-100: #fff5f7;
196
+ --pink-200: #fed7e2;
197
+ --pink-300: #fbb6ce;
198
+ --pink-400: #f687b3;
199
+ --pink-500: #ed64a6;
200
+ --pink-600: #d53f8c;
201
+ --pink-700: #b83280;
202
+ --pink-800: #97266d;
203
+ --pink-900: #702459;
204
+ }
205
+
98
206
  .x4-root-element {
99
207
  padding: 0;
100
208
  margin: 0;
@@ -261,9 +369,14 @@ textarea {
261
369
  text-align: center;
262
370
  flex-direction: column;
263
371
 
264
- &.x-svg-icon, svg {
265
- width: 1em;
266
- height: 1em;
372
+ &.x-svg-icon {
373
+ width: 1rem;
374
+ height: 1rem;
375
+
376
+ & > svg {
377
+ width: 100%;
378
+ height: 100%;
379
+ }
267
380
  }
268
381
  }
269
382
 
@@ -424,7 +537,7 @@ textarea {
424
537
  }
425
538
 
426
539
  padding: 4px;
427
- color: @BLACK80;
540
+ color: var( --gray-900 );
428
541
  margin-top: 1px; // hack alignement label / edit
429
542
  line-height: 1.3em;
430
543
  min-height: 2em;
@@ -437,14 +550,13 @@ textarea {
437
550
  outline: none;
438
551
  border: none;
439
552
  padding: 4px;
440
- color: @BLACK90;
441
- background-color: @WHITE25;
553
+ color: var( --gray-900 );
442
554
  border-bottom: 1px solid transparent;
443
555
  margin-top: 1px; // hack alignement label / edit
444
556
  line-height: 1.3em;
445
557
 
446
558
  &::placeholder {
447
- color: @WHITE50;
559
+ color: var( --gray-800 );
448
560
  }
449
561
 
450
562
  &::selection {
@@ -466,7 +578,7 @@ textarea {
466
578
  .x-button.gadget {
467
579
  background-color: transparent;
468
580
  font-size: var( --x4-font-size );
469
- color: black;
581
+ color: var( --gray-900 );
470
582
  border: none;
471
583
 
472
584
  margin: 0;
@@ -474,6 +586,10 @@ textarea {
474
586
  height: 2em;
475
587
  margin-top: 1px;
476
588
 
589
+ &:hover {
590
+ background-color: transparent;
591
+ }
592
+
477
593
  &:focus {
478
594
  color: var( --x4-focus-color );
479
595
  }
@@ -524,6 +640,14 @@ textarea {
524
640
  }
525
641
  }
526
642
 
643
+ .x-text-edit {
644
+ // align with combo
645
+ .x-button.gadget {
646
+ margin-left:1 px;
647
+ margin-right:1 px;
648
+ }
649
+ }
650
+
527
651
  .x-combo-box {
528
652
 
529
653
  &> .x-label {
@@ -618,9 +742,10 @@ textarea {
618
742
 
619
743
  }
620
744
 
745
+ .x-radio-btn,
621
746
  .x-check-box {
622
747
  align-items: center;
623
- color: @BLACK80;
748
+ color: var( --gray-900 );
624
749
  outline: none;
625
750
  //min-height: 2em;
626
751
  padding: 4px 0;
@@ -725,7 +850,7 @@ textarea {
725
850
  outline: none;
726
851
 
727
852
  background-color: transparent;
728
- color: @BLACK80;
853
+ color: var( --gray-900 );
729
854
 
730
855
  padding: 0px 8px;
731
856
  min-width: 120px;
@@ -734,7 +859,7 @@ textarea {
734
859
  .x-icon {
735
860
  width: 1em;
736
861
  margin-right: 8px;
737
- color: @BLACK30;
862
+ color: var( --gray-700 );
738
863
  }
739
864
 
740
865
  .x-label {
@@ -743,9 +868,9 @@ textarea {
743
868
 
744
869
  &:hover {
745
870
  background-color: #c6d3d9;
746
- color: black;
871
+ color: var( --gray-900 );
747
872
  .x-icon {
748
- color: black;
873
+ color: var( --gray-900 );
749
874
  }
750
875
  }
751
876
  }
@@ -891,7 +1016,7 @@ textarea {
891
1016
  border: none;
892
1017
  box-shadow: none;
893
1018
  &:focus {
894
- color: black;
1019
+ color: var( --gray-900 );
895
1020
  }
896
1021
  }
897
1022
 
@@ -1065,13 +1190,15 @@ textarea {
1065
1190
  .x-form {
1066
1191
  background-color: var( --x4-form-color );
1067
1192
  margin-block-end: 0;
1068
- padding: 8px;
1193
+ padding: 8px 0;
1069
1194
  min-width: 250px;
1070
1195
  min-height: 50px;
1071
- overflow: auto;
1072
-
1196
+ padding-right: 4px;
1197
+
1073
1198
  &>.container {
1074
1199
  padding: 0px;
1200
+ overflow: auto;
1201
+ padding: 0 4px 0 8px;
1075
1202
  }
1076
1203
 
1077
1204
  &>.footer {
@@ -1080,7 +1207,7 @@ textarea {
1080
1207
  bottom: 0;
1081
1208
  width: 100%;
1082
1209
  justify-content: flex-end;
1083
- padding: 0px;
1210
+ padding: 0px 4px 0 8px;
1084
1211
  margin-top: 8px;
1085
1212
  align-items: center;
1086
1213
 
@@ -1200,7 +1327,7 @@ textarea {
1200
1327
  padding: 4px;
1201
1328
  white-space: nowrap;
1202
1329
  //min-width: 50px;
1203
- color: black;
1330
+ color: var( --gray-900 );
1204
1331
  height: @def-height;
1205
1332
  }
1206
1333
 
@@ -1216,21 +1343,20 @@ textarea {
1216
1343
  }
1217
1344
 
1218
1345
  .x-cell {
1219
- text-overflow: ellipsis;
1220
1346
  border-right: 1px solid rgba(0,0,0,0.1);
1221
- //text-transform: capitalize;
1222
1347
  height: unset;
1223
1348
 
1224
- &.sort {
1225
- background-image: var( --x4-icon-arrow-down-long );
1226
- background-repeat: no-repeat;
1227
- background-size: 1rem 1rem;
1228
- background-position: right 0 top 6px;
1229
- padding-right: calc( 1rem + 4px );
1349
+ span {
1350
+ min-width: 0;
1351
+ text-transform: uppercase;
1352
+ text-overflow: ellipsis;
1353
+ overflow: hidden;
1354
+ font-weight: bold;
1230
1355
  }
1231
1356
 
1232
- &.sort.desc {
1233
- background-image: var( --x4-icon-arrow-up-long );
1357
+ &.sort {
1358
+ height: 0.7rem;
1359
+ opacity: 0.7;
1234
1360
  }
1235
1361
  }
1236
1362
  }
@@ -1406,19 +1532,17 @@ textarea {
1406
1532
  pointer-events: none;
1407
1533
 
1408
1534
  background-color: white;
1409
- //border: 1px solid fadeout(darken(#2e404f,5%),10%);
1410
1535
  color: white;
1411
- //padding: 4px 8px;
1412
1536
  padding-left: 24px;
1413
1537
 
1414
- font-size: 0.8rem;
1415
- font-weight: 300;
1416
-
1538
+ font-family: var( --x4-font );
1539
+ font-size: var( --x4-font-size );
1540
+
1417
1541
  .x-icon {
1418
1542
  position: absolute;
1419
- left: 6px;
1543
+ left: 5px;
1420
1544
  top: 7px;
1421
- color: var( --x4-tip-background );
1545
+ color: var( --x4-selection-color );
1422
1546
  }
1423
1547
 
1424
1548
  .x-label {
@@ -1470,6 +1594,7 @@ textarea {
1470
1594
 
1471
1595
 
1472
1596
  .x-popup-list-view {
1597
+ .z-float-4( );
1473
1598
  background-color: white;
1474
1599
 
1475
1600
  .x-combo-popup {
@@ -1484,7 +1609,7 @@ textarea {
1484
1609
  }
1485
1610
 
1486
1611
  overflow: auto;
1487
- color: black;
1612
+ color: var( --gray-900 );
1488
1613
  }
1489
1614
  }
1490
1615
 
@@ -1519,7 +1644,7 @@ textarea {
1519
1644
 
1520
1645
  .x-button {
1521
1646
  height: auto;
1522
- color: black;
1647
+ color: var( --gray-900 );
1523
1648
  }
1524
1649
 
1525
1650
  margin-bottom: 8px;
@@ -1527,16 +1652,16 @@ textarea {
1527
1652
 
1528
1653
  .week {
1529
1654
  align-items: center;
1530
- //border-bottom: 1px solid @BLACK10;
1655
+ border: 1px solid transparent;
1531
1656
 
1532
1657
  &:hover {
1533
- background-color: var( --x4-hover-color );
1658
+ border-color: var( --x4-hover-color );
1534
1659
  border-radius: 4px;
1535
1660
  }
1536
1661
 
1537
1662
  .cell {
1538
1663
  height: 100%;
1539
- color: @BLACK70;
1664
+ color: var( --gray-900 );
1540
1665
  text-align: center;
1541
1666
  span {
1542
1667
  margin: auto;
@@ -1577,7 +1702,7 @@ textarea {
1577
1702
 
1578
1703
  .header {
1579
1704
  .cell {
1580
- color: @BLACK50;
1705
+ color: var( --gray-800 );
1581
1706
  height: 1.5em;
1582
1707
  }
1583
1708
 
@@ -1950,7 +2075,7 @@ textarea {
1950
2075
 
1951
2076
  color: transparent;
1952
2077
  background-color: transparent;
1953
- caret-color: black;
2078
+ color: var( --gray-900 );
1954
2079
 
1955
2080
  -moz-tab-size : 4;
1956
2081
  -o-tab-size : 4;
@@ -2001,4 +2126,11 @@ textarea {
2001
2126
  left: 0;
2002
2127
  right: 0;
2003
2128
  }
2129
+ }
2130
+
2131
+ .x-masonry {
2132
+ display: grid;
2133
+ grid-gap: 10px;
2134
+ grid-template-columns: repeat(auto-fill, minmax(250px,1fr));
2135
+ grid-auto-rows: 10px;
2004
2136
  }
package/src/x4_events.ts CHANGED
@@ -28,12 +28,12 @@
28
28
  **/
29
29
 
30
30
  // default stopPropagation implementation for Events
31
- const stopPropagation = function () {
31
+ const stopPropagation = function ( this: any ) {
32
32
  this.propagationStopped = true;
33
33
  }
34
34
 
35
35
  // default preventDefault implementation for Events
36
- const preventDefault = function () {
36
+ const preventDefault = function ( this: any ) {
37
37
  this.defaultPrevented = true;
38
38
  }
39
39
 
@@ -389,13 +389,14 @@ export class EventSource<Q extends EventMap, T extends EventTypes = MapEvents<Q>
389
389
  */
390
390
 
391
391
  once<K extends keyof Q>(type: K, callback: (ev: Q[K]) => any) {
392
+ //@ts-ignore
392
393
  this._once(type as string, callback);
393
394
  }
394
395
 
395
396
  _once(eventName: string, callback: EventCallback) {
396
397
 
397
398
  const newCallback = ( ev ) => {
398
- this.off(eventName, newCallback);
399
+ this._off(eventName, newCallback);
399
400
  callback( ev );
400
401
  }
401
402
 
@@ -489,6 +490,7 @@ export class EventSource<Q extends EventMap, T extends EventTypes = MapEvents<Q>
489
490
  */
490
491
 
491
492
  on<K extends keyof Q>(type: K, callback: (ev: Q[K]) => any) : EventDisposer {
493
+ //@ts-ignore
492
494
  return this._on(type as string, callback);
493
495
  }
494
496
 
@@ -514,7 +516,7 @@ export class EventSource<Q extends EventMap, T extends EventTypes = MapEvents<Q>
514
516
  }
515
517
 
516
518
  return {
517
- dispose: ( ) => { this.off( eventName, callback ); }
519
+ dispose: ( ) => { this._off( eventName, callback ); }
518
520
  }
519
521
  }
520
522
 
@@ -524,7 +526,12 @@ export class EventSource<Q extends EventMap, T extends EventTypes = MapEvents<Q>
524
526
  * @param callback - callback to remove (must be the same as in on )
525
527
  */
526
528
 
527
- off(eventName: string, callback: EventCallback ): void {
529
+ off<K extends keyof Q>(type: K, callback: (ev: Q[K]) => any) {
530
+ //@ts-ignore
531
+ return this._off(type as string, callback);
532
+ }
533
+
534
+ _off(eventName: string, callback: EventCallback ): void {
528
535
  if (!this.m_eventRegistry) {
529
536
  return;
530
537
  }
package/tsconfig.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "outDir": "./lib",
8
8
  "declaration": true,
9
9
  "module": "commonjs",
10
- "strict": false,
10
+ "strict": true//false,
11
11
  },
12
12
  "include": [
13
13
  "./src/*",