cx 24.0.2 → 24.2.0

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 (62) hide show
  1. package/dist/data.js +15 -26
  2. package/dist/manifest.js +525 -522
  3. package/dist/ui.js +1 -1
  4. package/dist/widgets.js +162 -77
  5. package/locale/de-de.js +6 -1
  6. package/locale/en-us.js +5 -1
  7. package/locale/es-es.js +6 -1
  8. package/locale/fr-fr.js +7 -2
  9. package/locale/nl-nl.js +4 -5
  10. package/locale/pt-pt.js +12 -1
  11. package/locale/sr-latn-ba.js +6 -2
  12. package/package.json +1 -1
  13. package/src/charts/ColorMap.js +4 -6
  14. package/src/charts/axis/Axis.d.ts +96 -96
  15. package/src/charts/axis/Axis.js +252 -252
  16. package/src/data/Expression.js +212 -212
  17. package/src/data/Expression.spec.js +174 -174
  18. package/src/data/StringTemplate.spec.js +105 -105
  19. package/src/data/StructuredSelector.d.ts +1 -1
  20. package/src/data/ops/updateTree.js +1 -1
  21. package/src/data/ops/updateTree.spec.js +16 -14
  22. package/src/ui/Controller.d.ts +182 -182
  23. package/src/ui/Culture.d.ts +0 -3
  24. package/src/ui/DataProxy.d.ts +1 -0
  25. package/src/ui/DataProxy.js +2 -2
  26. package/src/ui/FocusManager.js +171 -171
  27. package/src/ui/Format.js +87 -87
  28. package/src/ui/Instance.d.ts +72 -72
  29. package/src/ui/Localization.js +0 -2
  30. package/src/ui/Rescope.js +2 -2
  31. package/src/ui/Text.js +2 -4
  32. package/src/ui/adapter/DataAdapter.js +7 -12
  33. package/src/ui/adapter/GroupAdapter.d.ts +22 -3
  34. package/src/ui/adapter/TreeAdapter.d.ts +23 -3
  35. package/src/ui/keyboardShortcuts.js +4 -5
  36. package/src/ui/selection/KeySelection.d.ts +1 -1
  37. package/src/ui/selection/PropertySelection.d.ts +1 -1
  38. package/src/ui/selection/PropertySelection.js +2 -4
  39. package/src/ui/selection/Selection.d.ts +1 -1
  40. package/src/widgets/form/ColorField.js +14 -9
  41. package/src/widgets/form/ColorPicker.scss +275 -275
  42. package/src/widgets/form/ColorPicker.variables.scss +22 -22
  43. package/src/widgets/form/DateTimeField.d.ts +86 -86
  44. package/src/widgets/form/DateTimeField.js +573 -572
  45. package/src/widgets/form/Field.js +24 -9
  46. package/src/widgets/form/FieldIcon.js +42 -0
  47. package/src/widgets/form/Label.js +88 -88
  48. package/src/widgets/form/LookupField.d.ts +173 -174
  49. package/src/widgets/form/LookupField.js +1130 -1131
  50. package/src/widgets/form/MonthField.d.ts +37 -38
  51. package/src/widgets/form/MonthField.js +16 -15
  52. package/src/widgets/form/NumberField.d.ts +2 -2
  53. package/src/widgets/form/NumberField.js +13 -13
  54. package/src/widgets/form/Select.d.ts +31 -35
  55. package/src/widgets/form/Select.js +7 -12
  56. package/src/widgets/form/TextArea.js +10 -6
  57. package/src/widgets/form/TextField.d.ts +2 -2
  58. package/src/widgets/form/TextField.js +17 -14
  59. package/src/widgets/form/UploadButton.d.ts +34 -34
  60. package/src/widgets/form/index.js +1 -2
  61. package/src/widgets/grid/Grid.d.ts +5 -2
  62. package/src/widgets/overlay/Dropdown.d.ts +1 -0
@@ -15,6 +15,7 @@ import { tooltipMouseLeave, tooltipMouseMove } from "../overlay/tooltip-ops";
15
15
  import { coalesce } from "../../util/coalesce";
16
16
  import { isUndefined } from "../../util/isUndefined";
17
17
  import { shallowEquals } from "../../util/shallowEquals";
18
+ import { FieldIcon } from "./FieldIcon";
18
19
 
19
20
  export class Field extends PureContainer {
20
21
  declareData() {
@@ -36,11 +37,16 @@ export class Field extends PureContainer {
36
37
  tabIndex: undefined,
37
38
  validationParams: { structured: true },
38
39
  },
39
- ...arguments
40
+ ...arguments,
40
41
  );
41
42
  }
42
43
 
43
44
  init() {
45
+ this.inputStyle = parseStyle(this.inputStyle);
46
+ super.init();
47
+ }
48
+
49
+ initComponents(context, instance) {
44
50
  if (this.validationMode == "tooltip" && isUndefined(this.errorTooltip)) {
45
51
  this.errorTooltip = {
46
52
  text: { bind: "$error" },
@@ -92,15 +98,20 @@ export class Field extends PureContainer {
92
98
  this.label = Label.create(labelConfig);
93
99
  }
94
100
 
95
- this.inputStyle = parseStyle(this.inputStyle);
101
+ if (this.icon != null) {
102
+ let iconConfig = {
103
+ className: this.CSS.element(this.baseClass, "icon"),
104
+ };
105
+ if (isSelector(this.icon)) iconConfig.name = this.icon;
106
+ else Object.assign(iconConfig, this.icon);
96
107
 
97
- super.init();
98
- }
108
+ this.icon = FieldIcon.create(iconConfig);
109
+ }
99
110
 
100
- initComponents(context, instance) {
101
111
  return super.initComponents(...arguments, {
102
112
  label: this.label,
103
113
  help: this.help,
114
+ icon: this.icon,
104
115
  });
105
116
  }
106
117
 
@@ -148,22 +159,22 @@ export class Field extends PureContainer {
148
159
  data.disabled = coalesce(
149
160
  context.parentStrict ? context.parentDisabled : null,
150
161
  data._disabled,
151
- context.parentDisabled
162
+ context.parentDisabled,
152
163
  );
153
164
  data.readOnly = coalesce(
154
165
  context.parentStrict ? context.parentReadOnly : null,
155
166
  data._readOnly,
156
- context.parentReadOnly
167
+ context.parentReadOnly,
157
168
  );
158
169
  data.viewMode = coalesce(
159
170
  context.parentStrict ? context.parentViewMode : null,
160
171
  data._viewMode,
161
- context.parentViewMode
172
+ context.parentViewMode,
162
173
  );
163
174
  data.tabOnEnterKey = coalesce(
164
175
  context.parentStrict ? context.parentTabOnEnterKey : null,
165
176
  data._tabOnEnterKey,
166
- context.parentTabOnEnterKey
177
+ context.parentTabOnEnterKey,
167
178
  );
168
179
  data.visited = coalesce(context.parentStrict ? context.parentVisited : null, data.visited, context.parentVisited);
169
180
 
@@ -312,6 +323,10 @@ export class Field extends PureContainer {
312
323
  if (instance.components.help) return getContent(instance.components.help.render(context, key));
313
324
  }
314
325
 
326
+ renderIcon(context, instance, key) {
327
+ if (instance.components.icon) return getContent(instance.components.icon.render(context, key));
328
+ }
329
+
315
330
  formatValue(context, { data }) {
316
331
  return data.text || data.value;
317
332
  }
@@ -0,0 +1,42 @@
1
+ import { Widget } from "../../ui/Widget";
2
+ import { Icon } from "../Icon";
3
+ import { tooltipMouseLeave, tooltipMouseMove } from "../overlay/tooltip-ops";
4
+
5
+ export class FieldIcon extends Widget {
6
+ declareData(...args) {
7
+ super.declareData(...args, {
8
+ name: undefined,
9
+ });
10
+ }
11
+
12
+ render(context, instance, key) {
13
+ let { data } = instance;
14
+ if (!data.name) return null;
15
+
16
+ let onClick, onMouseMove, onMouseLeave;
17
+
18
+ if (this.onClick)
19
+ onClick = (e) => {
20
+ instance.invoke("onClick", e, instance);
21
+ };
22
+
23
+ if (this.tooltip) {
24
+ onMouseLeave = (e) => {
25
+ tooltipMouseLeave(e, instance, this.tooltip);
26
+ };
27
+ onMouseMove = (e) => {
28
+ tooltipMouseMove(e, instance, this.tooltip);
29
+ };
30
+ }
31
+
32
+ return Icon.render(data.name, {
33
+ className: data.classNames,
34
+ style: data.style,
35
+ onClick,
36
+ onMouseMove,
37
+ onMouseLeave,
38
+ });
39
+ }
40
+ }
41
+
42
+ FieldIcon.prototype.styled = true;
@@ -1,88 +1,88 @@
1
- import { Widget, VDOM } from "../../ui/Widget";
2
- import { HtmlElement } from "../HtmlElement";
3
- import { FocusManager } from "../../ui/FocusManager";
4
- import { isArray } from "../../util/isArray";
5
- import { coalesce } from "../../util/coalesce";
6
-
7
- export class Label extends HtmlElement {
8
- declareData() {
9
- super.declareData(...arguments, {
10
- required: undefined,
11
- disabled: undefined,
12
- htmlFor: undefined,
13
- });
14
- }
15
-
16
- prepareData(context, instance) {
17
- let { data } = instance;
18
- data.stateMods = {
19
- ...data.stateMods,
20
- disabled: data.disabled,
21
- };
22
- data._disabled = data.disabled;
23
- super.prepareData(context, instance);
24
- }
25
-
26
- explore(context, instance) {
27
- let { data } = instance;
28
-
29
- if (!data.htmlFor) data.htmlFor = context.lastFieldId;
30
-
31
- data.disabled = data.stateMods.disabled = coalesce(
32
- context.parentStrict ? context.parentDisabled : null,
33
- data._disabled,
34
- context.parentDisabled
35
- );
36
-
37
- data.asterisk = context.parentAsterisk || this.asterisk;
38
-
39
- if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
40
- instance.markShouldUpdate(context);
41
- this.prepareCSS(context, instance);
42
- }
43
-
44
- super.explore(context, instance);
45
- }
46
-
47
- isValidHtmlAttribute(attrName) {
48
- switch (attrName) {
49
- case "asterisk":
50
- case "required":
51
- return false;
52
- }
53
- return super.isValidHtmlAttribute(attrName);
54
- }
55
-
56
- attachProps(context, instance, props) {
57
- super.attachProps(context, instance, props);
58
-
59
- let { data } = instance;
60
-
61
- if (data.htmlFor) {
62
- props.htmlFor = data.htmlFor;
63
-
64
- if (!props.onClick)
65
- props.onClick = () => {
66
- //additional focus for LookupFields which are not input based
67
- let el = document.getElementById(instance.data.htmlFor);
68
- if (el) FocusManager.focusFirst(el);
69
- };
70
- }
71
-
72
- if (!props.id && data.htmlFor) props.id = `${data.htmlFor}-label`;
73
-
74
- if (data.required && data.asterisk) {
75
- if (!isArray(props.children)) props.children = [props.children];
76
- props.children.push(" ");
77
- props.children.push(
78
- <span key="asterisk" className={this.CSS.element(this.baseClass, "asterisk")}>
79
- *
80
- </span>
81
- );
82
- }
83
- }
84
- }
85
-
86
- Label.prototype.baseClass = "label";
87
- Label.prototype.tag = "label";
88
- Label.prototype.asterisk = false;
1
+ import { Widget, VDOM } from "../../ui/Widget";
2
+ import { HtmlElement } from "../HtmlElement";
3
+ import { FocusManager } from "../../ui/FocusManager";
4
+ import { isArray } from "../../util/isArray";
5
+ import { coalesce } from "../../util/coalesce";
6
+
7
+ export class Label extends HtmlElement {
8
+ declareData() {
9
+ super.declareData(...arguments, {
10
+ required: undefined,
11
+ disabled: undefined,
12
+ htmlFor: undefined,
13
+ });
14
+ }
15
+
16
+ prepareData(context, instance) {
17
+ let { data } = instance;
18
+ data.stateMods = {
19
+ ...data.stateMods,
20
+ disabled: data.disabled,
21
+ };
22
+ data._disabled = data.disabled;
23
+ super.prepareData(context, instance);
24
+ }
25
+
26
+ explore(context, instance) {
27
+ let { data } = instance;
28
+
29
+ if (!data.htmlFor) data.htmlFor = context.lastFieldId;
30
+
31
+ data.disabled = data.stateMods.disabled = coalesce(
32
+ context.parentStrict ? context.parentDisabled : null,
33
+ data._disabled,
34
+ context.parentDisabled
35
+ );
36
+
37
+ data.asterisk = context.parentAsterisk || this.asterisk;
38
+
39
+ if (instance.cache("disabled", data.disabled) || instance.cache("asterisk", data.asterisk)) {
40
+ instance.markShouldUpdate(context);
41
+ this.prepareCSS(context, instance);
42
+ }
43
+
44
+ super.explore(context, instance);
45
+ }
46
+
47
+ isValidHtmlAttribute(attrName) {
48
+ switch (attrName) {
49
+ case "asterisk":
50
+ case "required":
51
+ return false;
52
+ }
53
+ return super.isValidHtmlAttribute(attrName);
54
+ }
55
+
56
+ attachProps(context, instance, props) {
57
+ super.attachProps(context, instance, props);
58
+
59
+ let { data } = instance;
60
+
61
+ if (data.htmlFor) {
62
+ props.htmlFor = data.htmlFor;
63
+
64
+ if (!props.onClick)
65
+ props.onClick = () => {
66
+ //additional focus for LookupFields which are not input based
67
+ let el = document.getElementById(instance.data.htmlFor);
68
+ if (el) FocusManager.focusFirst(el);
69
+ };
70
+ }
71
+
72
+ if (!props.id && data.htmlFor) props.id = `${data.htmlFor}-label`;
73
+
74
+ if (data.required && data.asterisk) {
75
+ if (!isArray(props.children)) props.children = [props.children];
76
+ props.children.push(" ");
77
+ props.children.push(
78
+ <span key="asterisk" className={this.CSS.element(this.baseClass, "asterisk")}>
79
+ *
80
+ </span>
81
+ );
82
+ }
83
+ }
84
+ }
85
+
86
+ Label.prototype.baseClass = "label";
87
+ Label.prototype.tag = "label";
88
+ Label.prototype.asterisk = false;
@@ -1,174 +1,173 @@
1
- import { Instance } from "./../../ui/Instance";
2
- import * as Cx from "../../core";
3
- import { FieldProps } from "./Field";
4
-
5
- export interface LookupBinding {
6
- local: string;
7
- remote: string;
8
- key?: boolean;
9
- }
10
-
11
- interface LookupFieldProps extends FieldProps {
12
- /** Defaults to `false`. Set to `true` to enable multiple selection. */
13
- multiple?: Cx.BooleanProp;
14
-
15
- /** Selected value. Used only if `multiple` is set to `false`. */
16
- value?: Cx.Prop<number | string>;
17
-
18
- /** A list of selected ids. Used only if `multiple` is set to `true`. */
19
- values?: Cx.Prop<any[]>;
20
-
21
- /** A list of selected records. Used only if `multiple` is set to `true`. */
22
- records?: Cx.RecordsProp;
23
-
24
- /** Text associated with the selection. Used only if `multiple` is set to `false`. */
25
- text?: Cx.StringProp;
26
-
27
- /** The opposite of `disabled`. */
28
- enabled?: Cx.BooleanProp;
29
-
30
- /** Default text displayed when the field is empty. */
31
- placeholder?: Cx.StringProp;
32
-
33
- /** A list of available options. */
34
- options?: Cx.RecordsProp;
35
-
36
- /**
37
- * Set to `true` to hide the clear button. It can be used interchangeably with the `showClear` property.
38
- * No effect if `multiple` is used. Default value is `false`.
39
- */
40
- hideClear?: boolean;
41
-
42
- /**
43
- * Set to `false` to hide the clear button. It can be used interchangeably with the `hideClear` property.
44
- * No effect if `multiple` is used. Default value is `true`.
45
- */
46
- showClear?: boolean;
47
-
48
- /**
49
- * Set to `true` to display the clear button even if `required` is set. Default is `false`.
50
- */
51
- alwaysShowClear?: boolean;
52
-
53
- /** Base CSS class to be applied to the field. Defaults to `lookupfield`. */
54
- baseClass?: string;
55
-
56
- /* TODO: Check type */
57
-
58
- /** Additional config to be applied to all items */
59
- itemsConfig?: any;
60
-
61
- /**
62
- * An array of objects describing the mapping of option data to store data.
63
- * Each entry must define `local`, `remote` bindings. `key: true` is used to indicate fields that are used in the primary key.
64
- */
65
- bindings?: LookupBinding[];
66
-
67
- /** A delay in milliseconds between the moment the user stops typing and when tha query is made. Default value is `150`. */
68
- queryDelay?: number;
69
-
70
- /** Minimal number of characters required before query is made. */
71
- minQueryLength?: number;
72
-
73
- /** Set to `true` to hide the search field. */
74
- hideSearchField?: boolean;
75
-
76
- /**
77
- * Number of options required to show the search field.
78
- * If there are only a few options, there is no need for search. Defaults to `7`.
79
- */
80
- minOptionsForSearchField?: number;
81
-
82
- /** Text to display while data is being loaded. */
83
- loadingText?: string;
84
-
85
- /** Error message displayed to the user if server query throws an exception. */
86
- queryErrorText?: string;
87
-
88
- /** Message to be displayed if no entries match the user query. */
89
- noResultsText?: string;
90
-
91
- /** Name of the field which holds the id of the option. Default value is `id`. */
92
- optionIdField?: string;
93
-
94
- /** Name of the field which holds the display text of the option. Default value is `text`. */
95
- optionTextField?: string;
96
-
97
- /**
98
- * Available only in `multiple` selection mode and without custom `bindings`.
99
- * Name of the field to store id of the selected value. Default value is `id`.
100
- */
101
- valueIdField?: string;
102
-
103
- /**
104
- * Available only in `multiple` selection mode.
105
- * Name of the field to store display text of the selected value. Default value is `text`.
106
- */
107
- valueTextField?: string;
108
-
109
- /**
110
- * If `true` `onQuery` will be called only once to fetch all options.
111
- * After that options are filtered client-side.
112
- */
113
- fetchAll?: boolean;
114
-
115
- /**
116
- * If this flag is set along with `fetchAll`, fetched options are cached for the lifetime of the widget.
117
- * Otherwise, data is fetched whenever the dropdown is shown.
118
- */
119
- cacheAll?: boolean;
120
-
121
- /** Close the dropdown after selection. Default is `true`. */
122
- closeOnSelect?: boolean;
123
-
124
- /** Mesasge to be displayed to the user if the entered search query is too short. */
125
- minQueryLengthMessageText?: string;
126
-
127
- /** Name of the icon to be put on the left side of the input. */
128
- icon?: Cx.StringProp;
129
-
130
- /** Query function. */
131
- onQuery?: (
132
- query: string | { query: string; page: number; pageSize: number },
133
- instance: Instance
134
- ) => Cx.Record[] | Promise<Cx.Record>;
135
-
136
- /** Set to true to sort dropdown options. */
137
- sort?: boolean;
138
-
139
- /** Additional list options, such as grouping configuration, custom sorting, etc. */
140
- listOptions?: Cx.Config;
141
-
142
- /** Set to true to show the dropdown immediately after the component has mounted.
143
- * This is commonly used for cell editing in grids. */
144
- autoOpen?: Cx.BooleanProp;
145
-
146
- /** Set to true to allow enter key events to be propagated. This is useful for submitting forms or closing grid cell editors. */
147
- submitOnEnterKey?: Cx.BooleanProp;
148
-
149
- /** Set to true to allow dropdown enter key events to be propagated. This is useful for submitting forms on dropdown enter key selection. */
150
- submitOnDropdownEnterKey?: Cx.BooleanProp;
151
-
152
- /** Defaults to `false`. Used to make the field read-only. */
153
- readOnly?: Cx.BooleanProp;
154
-
155
- /** Set to `true` to enable loading of additional lookup options when the scroll is reaching the end. */
156
- infinite?: boolean;
157
-
158
- /** Number of additional items to be loaded in `infinite` mode. Default is 100. */
159
- pageSize?: number;
160
-
161
- /** Set to `true` to allow quick selection of all displayed lookup items on `ctrl + a` keys combination. */
162
- quickSelectAll?: boolean;
163
-
164
- /** Parameters that affect filtering. */
165
- filterParams?: Cx.StructuredProp;
166
-
167
- /** Callback to create a filter function for given filter params. */
168
- onCreateVisibleOptionsFilter?: (filterParams: any, instance?: Instance) => (record: Record) => boolean;
169
-
170
- /** Used in multiple selection lookups in combination with records, to construct the display text out of multiple fields or when additional formatting is needed. */
171
- onGetRecordDisplayText?: (record: any, instance?: Instance) => string;
172
- }
173
-
174
- export class LookupField extends Cx.Widget<LookupFieldProps> {}
1
+ import { Instance } from "./../../ui/Instance";
2
+ import * as Cx from "../../core";
3
+ import { FieldProps } from "./Field";
4
+
5
+ export interface LookupBinding {
6
+ local: string;
7
+ remote: string;
8
+ key?: boolean;
9
+ }
10
+
11
+ interface LookupFieldProps<T = unknown> extends FieldProps {
12
+ /** Defaults to `false`. Set to `true` to enable multiple selection. */
13
+ multiple?: Cx.BooleanProp;
14
+
15
+ /** Selected value. Used only if `multiple` is set to `false`. */
16
+ value?: Cx.Prop<number | string>;
17
+
18
+ /** A list of selected ids. Used only if `multiple` is set to `true`. */
19
+ values?: Cx.Prop<any[]>;
20
+
21
+ /** A list of selected records. Used only if `multiple` is set to `true`. */
22
+ records?: Cx.RecordsProp;
23
+
24
+ /** Text associated with the selection. Used only if `multiple` is set to `false`. */
25
+ text?: Cx.StringProp;
26
+
27
+ /** The opposite of `disabled`. */
28
+ enabled?: Cx.BooleanProp;
29
+
30
+ /** Default text displayed when the field is empty. */
31
+ placeholder?: Cx.StringProp;
32
+
33
+ /** A list of available options. */
34
+ options?: Cx.Prop<T[]>;
35
+
36
+ /**
37
+ * Set to `true` to hide the clear button. It can be used interchangeably with the `showClear` property.
38
+ * No effect if `multiple` is used. Default value is `false`.
39
+ */
40
+ hideClear?: boolean;
41
+
42
+ /**
43
+ * Set to `false` to hide the clear button. It can be used interchangeably with the `hideClear` property.
44
+ * No effect if `multiple` is used. Default value is `true`.
45
+ */
46
+ showClear?: boolean;
47
+
48
+ /**
49
+ * Set to `true` to display the clear button even if `required` is set. Default is `false`.
50
+ */
51
+ alwaysShowClear?: boolean;
52
+
53
+ /** Base CSS class to be applied to the field. Defaults to `lookupfield`. */
54
+ baseClass?: string;
55
+
56
+ /* TODO: Check type */
57
+
58
+ /** Additional config to be applied to all items */
59
+ itemsConfig?: any;
60
+
61
+ /**
62
+ * An array of objects describing the mapping of option data to store data.
63
+ * Each entry must define `local`, `remote` bindings. `key: true` is used to indicate fields that are used in the primary key.
64
+ */
65
+ bindings?: LookupBinding[];
66
+
67
+ /** A delay in milliseconds between the moment the user stops typing and when tha query is made. Default value is `150`. */
68
+ queryDelay?: number;
69
+
70
+ /** Minimal number of characters required before query is made. */
71
+ minQueryLength?: number;
72
+
73
+ /** Set to `true` to hide the search field. */
74
+ hideSearchField?: boolean;
75
+
76
+ /**
77
+ * Number of options required to show the search field.
78
+ * If there are only a few options, there is no need for search. Defaults to `7`.
79
+ */
80
+ minOptionsForSearchField?: number;
81
+
82
+ /** Text to display while data is being loaded. */
83
+ loadingText?: string;
84
+
85
+ /** Error message displayed to the user if server query throws an exception. */
86
+ queryErrorText?: string;
87
+
88
+ /** Message to be displayed if no entries match the user query. */
89
+ noResultsText?: string;
90
+
91
+ /** Name of the field which holds the id of the option. Default value is `id`. */
92
+ optionIdField?: string;
93
+
94
+ /** Name of the field which holds the display text of the option. Default value is `text`. */
95
+ optionTextField?: string;
96
+
97
+ /**
98
+ * Available only in `multiple` selection mode and without custom `bindings`.
99
+ * Name of the field to store id of the selected value. Default value is `id`.
100
+ */
101
+ valueIdField?: string;
102
+
103
+ /**
104
+ * Available only in `multiple` selection mode.
105
+ * Name of the field to store display text of the selected value. Default value is `text`.
106
+ */
107
+ valueTextField?: string;
108
+
109
+ /**
110
+ * If `true` `onQuery` will be called only once to fetch all options.
111
+ * After that options are filtered client-side.
112
+ */
113
+ fetchAll?: boolean;
114
+
115
+ /**
116
+ * If this flag is set along with `fetchAll`, fetched options are cached for the lifetime of the widget.
117
+ * Otherwise, data is fetched whenever the dropdown is shown.
118
+ */
119
+ cacheAll?: boolean;
120
+
121
+ /** Close the dropdown after selection. Default is `true`. */
122
+ closeOnSelect?: boolean;
123
+
124
+ /** Mesasge to be displayed to the user if the entered search query is too short. */
125
+ minQueryLengthMessageText?: string;
126
+
127
+ /** Name or configuration of the icon to be put on the left side of the input. */
128
+ icon?: Cx.StringProp | Cx.Record;
129
+
130
+ /** Query function. */
131
+ onQuery?:
132
+ | string
133
+ | ((query: string | { query: string; page: number; pageSize: number }, instance: Instance) => T[] | Promise<T[]>);
134
+
135
+ /** Set to true to sort dropdown options. */
136
+ sort?: boolean;
137
+
138
+ /** Additional list options, such as grouping configuration, custom sorting, etc. */
139
+ listOptions?: Cx.Config;
140
+
141
+ /** Set to true to show the dropdown immediately after the component has mounted.
142
+ * This is commonly used for cell editing in grids. */
143
+ autoOpen?: Cx.BooleanProp;
144
+
145
+ /** Set to true to allow enter key events to be propagated. This is useful for submitting forms or closing grid cell editors. */
146
+ submitOnEnterKey?: Cx.BooleanProp;
147
+
148
+ /** Set to true to allow dropdown enter key events to be propagated. This is useful for submitting forms on dropdown enter key selection. */
149
+ submitOnDropdownEnterKey?: Cx.BooleanProp;
150
+
151
+ /** Defaults to `false`. Used to make the field read-only. */
152
+ readOnly?: Cx.BooleanProp;
153
+
154
+ /** Set to `true` to enable loading of additional lookup options when the scroll is reaching the end. */
155
+ infinite?: boolean;
156
+
157
+ /** Number of additional items to be loaded in `infinite` mode. Default is 100. */
158
+ pageSize?: number;
159
+
160
+ /** Set to `true` to allow quick selection of all displayed lookup items on `ctrl + a` keys combination. */
161
+ quickSelectAll?: boolean;
162
+
163
+ /** Parameters that affect filtering. */
164
+ filterParams?: Cx.StructuredProp;
165
+
166
+ /** Callback to create a filter function for given filter params. */
167
+ onCreateVisibleOptionsFilter?: (filterParams: any, instance?: Instance) => (record: T) => boolean;
168
+
169
+ /** Used in multiple selection lookups in combination with records, to construct the display text out of multiple fields or when additional formatting is needed. */
170
+ onGetRecordDisplayText?: (record: T, instance?: Instance) => string;
171
+ }
172
+
173
+ export class LookupField<T = unknown> extends Cx.Widget<LookupFieldProps<T>> {}