x4js 1.4.39 → 1.4.40

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.
@@ -91,7 +91,8 @@ export interface ColorPickerEditorProps extends ColorPickerProps {
91
91
  labelWidth?: number;
92
92
  cust_colors?: Color[];
93
93
  displayValue?: false;
94
- change: EventCallback<EvChange>;
94
+ change?: EventCallback<EvChange>;
95
+ name?: string;
95
96
  }
96
97
  export declare class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPickerEventMap> {
97
98
  constructor(props: ColorPickerEditorProps);
package/lib/combobox.js CHANGED
@@ -131,7 +131,7 @@ class ComboBox extends layout_1.HLayout {
131
131
  */
132
132
  showPopup() {
133
133
  let props = this.m_props;
134
- if (props.readOnly) {
134
+ if (props.readOnly || this.hasClass("@disable")) {
135
135
  return;
136
136
  }
137
137
  // need creation ?
@@ -200,6 +200,11 @@ class ComboBox extends layout_1.HLayout {
200
200
  this.m_props.value = item.id;
201
201
  }
202
202
  }
203
+ else {
204
+ if (this.m_ui_input && this.m_ui_input instanceof input_1.Input) {
205
+ this.m_ui_input.value = "";
206
+ }
207
+ }
203
208
  }
204
209
  /**
205
210
  *
@@ -218,13 +223,17 @@ class ComboBox extends layout_1.HLayout {
218
223
  if ((0, tools_1.isFunction)(items)) {
219
224
  items = items();
220
225
  }
221
- items.some((v) => {
226
+ const found = items.some((v) => {
222
227
  if (v.id === id) {
223
228
  this._setInput(v);
224
229
  this.m_selection = v;
225
230
  return true;
226
231
  }
227
232
  });
233
+ if (!found) {
234
+ this._setInput(null);
235
+ this.m_selection = null;
236
+ }
228
237
  }
229
238
  get input() {
230
239
  return this.m_ui_input instanceof input_1.Input ? this.m_ui_input : null;
package/lib/dialog.js CHANGED
@@ -149,7 +149,9 @@ class Dialog extends popup_1.Popup {
149
149
  this.setStyleValue('height', this.m_props.dlgHeight + '%');
150
150
  }
151
151
  this.addClass('@resized');
152
- this.m_el_title.setStyleValue("width", "auto");
152
+ if (this.m_el_title) {
153
+ this.m_el_title.setStyleValue("width", "auto");
154
+ }
153
155
  if (this.m_props.maximized) {
154
156
  this._maximize();
155
157
  this.emit('size', (0, component_1.EvSize)(null));
@@ -344,9 +346,9 @@ class Dialog extends popup_1.Popup {
344
346
  let { x, y } = (0, tools_1.getMousePos)(event, true);
345
347
  let wrc = (0, component_1.flyWrap)(x4dom_1.x4document.body).getBoundingRect();
346
348
  let rc = this.getBoundingRect(true);
347
- let trc = this.m_el_title.getBoundingRect();
349
+ ///let trc = this.m_el_title.getBoundingRect();
348
350
  let dx = x - rc.left, dy = y - rc.top;
349
- let cstyle = this.getComputedStyle();
351
+ //let cstyle = this.getComputedStyle();
350
352
  //let topw = cstyle.parse('marginTop') + cstyle.parse('paddingTop') + cstyle.parse('borderTopWidth');
351
353
  //let botw = cstyle.parse('marginBottom') + cstyle.parse('paddingBottom') + cstyle.parse('borderBottomWidth');
352
354
  //let lftw = cstyle.parse('marginLeft') + cstyle.parse('paddingLeft') + cstyle.parse('borderLeftWidth');
package/lib/listview.js CHANGED
@@ -481,6 +481,7 @@ class PopupListView extends popup_1.Popup {
481
481
  constructor(props) {
482
482
  super({ tabIndex: false });
483
483
  this.enableMask(false);
484
+ this.addClass("@non-maskable");
484
485
  props.tabIndex = false;
485
486
  this.m_list = new ListView(props);
486
487
  //this.m_list.addClass( '@fit' );
package/lib/x4.css CHANGED
@@ -1153,7 +1153,7 @@ textarea::selection {
1153
1153
  .x-grid-view .x-row {
1154
1154
  position: absolute;
1155
1155
  width: calc(100% - 4px);
1156
- border-bottom: 1px solid #f0f0f0;
1156
+ border-bottom: 1px solid #d0d0d0;
1157
1157
  align-items: center;
1158
1158
  height: 2em;
1159
1159
  }
@@ -1163,7 +1163,7 @@ textarea::selection {
1163
1163
  }
1164
1164
  .x-spreadsheet .x-cell,
1165
1165
  .x-grid-view .x-cell {
1166
- border-right: 1px solid #f0f0f0;
1166
+ border-right: 1px solid #d0d0d0;
1167
1167
  }
1168
1168
  .x-spreadsheet .x-cell.center,
1169
1169
  .x-grid-view .x-cell.center {
package/lib/x4events.d.ts CHANGED
@@ -70,10 +70,12 @@ export declare function EvChange(value: unknown, context?: any): EvChange;
70
70
  * Selection Event
71
71
  * value is the new selection or null
72
72
  */
73
+ interface X4Selection {
74
+ }
73
75
  export interface EvSelectionChange extends BasicEvent {
74
- readonly selection: unknown;
76
+ readonly selection: X4Selection;
75
77
  }
76
- export declare function EvSelectionChange(selection: unknown, context?: any): EvSelectionChange;
78
+ export declare function EvSelectionChange(selection: X4Selection, context?: any): EvSelectionChange;
77
79
  /**
78
80
  * ContextMenu Event
79
81
  */
@@ -264,3 +266,4 @@ export declare class EventSource<Q extends EventMap, T extends EventTypes = MapE
264
266
  */
265
267
  removeAllListeners(eventName: string | null): void;
266
268
  }
269
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "1.4.39",
3
+ "version": "1.4.40",
4
4
  "description": "X4js core files",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -631,8 +631,8 @@ export interface ColorPickerEditorProps extends ColorPickerProps {
631
631
  labelWidth?: number;
632
632
  cust_colors?: Color[];
633
633
  displayValue?: false,
634
-
635
- change: EventCallback<EvChange>;
634
+ change?: EventCallback<EvChange>;
635
+ name?: string;
636
636
  }
637
637
 
638
638
  export class ColorPickerEditor extends HLayout<ColorPickerEditorProps, ColorPickerEventMap> {
package/src/combobox.ts CHANGED
@@ -191,7 +191,7 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
191
191
  showPopup() {
192
192
 
193
193
  let props = this.m_props;
194
- if (props.readOnly) {
194
+ if (props.readOnly || this.hasClass("@disable") ) {
195
195
  return;
196
196
  }
197
197
 
@@ -278,6 +278,11 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
278
278
  this.m_props.value = item.id;
279
279
  }
280
280
  }
281
+ else {
282
+ if( this.m_ui_input && this.m_ui_input instanceof Input ) {
283
+ this.m_ui_input.value = "";
284
+ }
285
+ }
281
286
  }
282
287
 
283
288
  /**
@@ -303,13 +308,18 @@ export class ComboBox extends HLayout<ComboBoxProps,ComboBoxEventMap> {
303
308
  items = items( );
304
309
  }
305
310
 
306
- items.some( (v) => {
311
+ const found = items.some( (v) => {
307
312
  if (v.id === id) {
308
313
  this._setInput( v );
309
314
  this.m_selection = v;
310
315
  return true;
311
316
  }
312
317
  });
318
+
319
+ if( !found ) {
320
+ this._setInput( null );
321
+ this.m_selection = null;
322
+ }
313
323
  }
314
324
 
315
325
  get input( ) : Input {
package/src/dialog.ts CHANGED
@@ -233,7 +233,10 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogBoxEven
233
233
  }
234
234
 
235
235
  this.addClass('@resized');
236
- this.m_el_title.setStyleValue( "width", "auto" );
236
+
237
+ if( this.m_el_title ) {
238
+ this.m_el_title.setStyleValue( "width", "auto" );
239
+ }
237
240
 
238
241
  if (this.m_props.maximized) {
239
242
  this._maximize();
@@ -463,13 +466,12 @@ export class Dialog<P extends DialogProps = DialogProps, E extends DialogBoxEven
463
466
 
464
467
  let wrc = flyWrap(x4document.body).getBoundingRect();
465
468
  let rc = this.getBoundingRect(true);
466
- let trc = this.m_el_title.getBoundingRect();
469
+ ///let trc = this.m_el_title.getBoundingRect();
467
470
 
468
471
  let dx = x - rc.left,
469
472
  dy = y - rc.top;
470
473
 
471
- let cstyle = this.getComputedStyle();
472
-
474
+ //let cstyle = this.getComputedStyle();
473
475
  //let topw = cstyle.parse('marginTop') + cstyle.parse('paddingTop') + cstyle.parse('borderTopWidth');
474
476
  //let botw = cstyle.parse('marginBottom') + cstyle.parse('paddingBottom') + cstyle.parse('borderBottomWidth');
475
477
  //let lftw = cstyle.parse('marginLeft') + cstyle.parse('paddingLeft') + cstyle.parse('borderLeftWidth');
package/src/listview.ts CHANGED
@@ -691,6 +691,7 @@ export class PopupListView extends Popup<PopupListViewProps,PopupListViewEventMa
691
691
  super({ tabIndex: false });
692
692
 
693
693
  this.enableMask(false);
694
+ this.addClass( "@non-maskable" );
694
695
 
695
696
  props.tabIndex = false;
696
697
  this.m_list = new ListView(props);
package/src/x4.less CHANGED
@@ -1401,7 +1401,7 @@ textarea {
1401
1401
  .x-row {
1402
1402
  position: absolute;
1403
1403
  width: calc( 100% - @bwidth ); // todo: border of 1st col
1404
- border-bottom: 1px solid #f0f0f0;
1404
+ border-bottom: 1px solid #d0d0d0;
1405
1405
  align-items: center;
1406
1406
  height: @def-height;
1407
1407
 
@@ -1411,7 +1411,7 @@ textarea {
1411
1411
  }
1412
1412
 
1413
1413
  .x-cell {
1414
- border-right: 1px solid #f0f0f0;
1414
+ border-right: 1px solid #d0d0d0;
1415
1415
 
1416
1416
  &.center {
1417
1417
  text-align: center;
package/src/x4events.ts CHANGED
@@ -108,11 +108,14 @@ export function EvChange(value: unknown, context = null ) {
108
108
  * value is the new selection or null
109
109
  */
110
110
 
111
+ interface X4Selection {
112
+ }
113
+
111
114
  export interface EvSelectionChange extends BasicEvent {
112
- readonly selection: unknown;
115
+ readonly selection: X4Selection;
113
116
  }
114
117
 
115
- export function EvSelectionChange( selection: unknown, context = null ) {
118
+ export function EvSelectionChange( selection: X4Selection, context = null ) {
116
119
  return BasicEvent<EvSelectionChange>( { selection, context } );
117
120
  }
118
121