@singularsystems/neo-react 0.10.42 → 0.10.45

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.
@@ -78,5 +78,6 @@ export default class AutoCompleteDropDown<T> extends DropDownBase<T, IAutoComple
78
78
  private mapTArrayToOptions;
79
79
  private onItemSelected;
80
80
  render(): JSX.Element;
81
+ private getOption;
81
82
  }
82
83
  export {};
@@ -141,16 +141,15 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
141
141
  }
142
142
  var components = (_j = nativeProps.components, (_j !== null && _j !== void 0 ? _j : {}));
143
143
  if (this.props.option) {
144
- components.Option = function (item) { return (React.createElement("div", __assign({ ref: item.innerRef }, item.innerProps, { className: "react-select-row" + (item.isFocused ? " focused" : "") }), _this.props.option(item.data))); };
144
+ components.Option = this.getOption(this.props.option);
145
145
  }
146
146
  else if (components.Option) {
147
- var originalOption_1 = components.Option;
148
- components.Option = function (item) { return (React.createElement("div", __assign({ ref: item.innerRef }, item.innerProps, { className: "react-select-row" + (item.isFocused ? " focused" : "") }), originalOption_1(item))); };
147
+ components.Option = this.getOption(components.Option);
149
148
  }
150
149
  else if (descriptionMember) {
151
- components.Option = function (item) { return (React.createElement("div", __assign({ ref: item.innerRef }, item.innerProps, { className: "react-select-row with-description" + (item.isFocused ? " focused" : "") }),
152
- React.createElement("div", { className: "react-select-name" }, item.label),
153
- React.createElement("div", { className: "react-select-description" }, item.data[descriptionMember]))); };
150
+ components.Option = this.getOption(function (item) { return React.createElement(React.Fragment, null,
151
+ React.createElement("div", { className: "react-select-name" }, item[_this.displayMember]),
152
+ React.createElement("div", { className: "react-select-description" }, item[descriptionMember])); }, "with-description");
154
153
  }
155
154
  if (nativeProps.isClearable === undefined) {
156
155
  nativeProps.isClearable = true;
@@ -176,6 +175,9 @@ var AutoCompleteDropDown = /** @class */ (function (_super) {
176
175
  return Tooltip.fromDataAttributes(InputHelpers.surroundWithInputGroup(React.createElement(this.selectImplementation, __assign({}, nativeProps, { placeholder: (_l = this.props.placeholder, (_l !== null && _l !== void 0 ? _l : "")), classNamePrefix: "react-select-bs", options: defaultItems, isLoading: this.isLoading, isMulti: bindItems !== undefined, noOptionsMessage: function (c) { var _a; return _a = _this.props.noRecordsPrompt, (_a !== null && _a !== void 0 ? _a : "No records found"); }, value: value, onChange: this.onItemSelected, components: components })), splitProps.editor), nativeProps);
177
176
  }
178
177
  };
178
+ AutoCompleteDropDown.prototype.getOption = function (content, additionalClass) {
179
+ return function (item) { return (React.createElement("div", __assign({ ref: item.innerRef }, item.innerProps, { className: Utils.joinWithSpaces("react-select-row", additionalClass, item.isFocused ? "focused" : undefined, item.isSelected ? "selected" : undefined) }), content(item.data))); };
180
+ };
179
181
  AutoCompleteDropDown.contextType = FormContext;
180
182
  AutoCompleteDropDown = __decorate([
181
183
  observer,
@@ -96,7 +96,7 @@ var DropDown = /** @class */ (function (_super) {
96
96
  var selectedItem = this.getSelectedOption(this.props.bind.value); // This sets the sort value to allow sorting of drop downs in grids.
97
97
  var value = this.props.bind.value;
98
98
  var addBlankItem = (_b = (_a = splitProps.select) === null || _a === void 0 ? void 0 : _a.allowNulls, (_b !== null && _b !== void 0 ? _b : this.props.bind.propertyInfo.allowNulls)) || !value;
99
- if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null; })) {
99
+ if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === ""; })) {
100
100
  // If there is an item with a null value, don't add a blank drop down item.
101
101
  addBlankItem = false;
102
102
  }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import * as NeoGrid from './ReactComponents/Grid/_Exports';
5
5
  import * as Routing from './Routing';
6
6
  import * as Views from './Views/';
7
7
  import * as Managers from './ReactComponents/_Managers';
8
+ import { TooltipHelper } from './ReactComponents/TooltipHelper';
8
9
  export * from './React/Decorators';
9
- export { Managers, NeoReactModule, NeoReactTypes, Neo, NeoGrid, Routing, Views };
10
+ export { Managers, NeoReactModule, NeoReactTypes, Neo, NeoGrid, Routing, Views, TooltipHelper, };
10
11
  export { ICancellableEvent } from './ReactComponents/Misc';
package/dist/index.js CHANGED
@@ -5,5 +5,6 @@ import * as NeoGrid from './ReactComponents/Grid/_Exports';
5
5
  import * as Routing from './Routing';
6
6
  import * as Views from './Views/';
7
7
  import * as Managers from './ReactComponents/_Managers';
8
+ import { TooltipHelper } from './ReactComponents/TooltipHelper';
8
9
  export * from './React/Decorators';
9
- export { Managers, NeoReactModule, NeoReactTypes, Neo, NeoGrid, Routing, Views };
10
+ export { Managers, NeoReactModule, NeoReactTypes, Neo, NeoGrid, Routing, Views, TooltipHelper, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "0.10.42",
3
+ "version": "0.10.45",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/styles/Forms.scss CHANGED
@@ -139,11 +139,7 @@ div.neo-form-group-floating {
139
139
  justify-content: space-between;
140
140
  border-bottom: 1px solid #eee;
141
141
  cursor: pointer;
142
-
143
- &.focused, &:hover {
144
- background: $input-btn-focus-color;
145
- }
146
-
142
+
147
143
  &.with-description {
148
144
  div.react-select-name {
149
145
  width: 100%;
@@ -153,4 +149,16 @@ div.neo-form-group-floating {
153
149
  color: #999;
154
150
  }
155
151
  }
152
+
153
+ &.focused, &:hover {
154
+ background: $input-btn-focus-color;
155
+ }
156
+ &.selected {
157
+ background: #1E90FF;
158
+ color: #fff;
159
+
160
+ div.react-select-description {
161
+ color: #C7E4FF;
162
+ }
163
+ }
156
164
  }
@@ -1,10 +1,14 @@
1
1
  // Input boxes
2
2
  .form-control {
3
3
  &.is-invalid {
4
- padding-right: 0.75rem;
5
- background: none;
4
+ padding-right: 0.75rem !important;
5
+ background-image: none;
6
6
  }
7
7
  }
8
+ select.form-control.is-invalid {
9
+ padding-right: 0.75rem !important;
10
+ }
11
+
8
12
  .form-control.is-invalid.warning {
9
13
  border-color: $validation-border-warning;
10
14
 
@@ -30,6 +34,37 @@
30
34
  }
31
35
  }
32
36
 
37
+ // Autocomplete drop down
38
+ .react-select-bs {
39
+ &.is-invalid.error {
40
+ .react-select-bs__control {
41
+ border-color: $validation-color-error;
42
+
43
+ &.react-select-bs__control--is-focused {
44
+ box-shadow: $validation-shadow-error;
45
+ }
46
+ }
47
+ }
48
+ &.is-invalid.warning {
49
+ .react-select-bs__control {
50
+ border-color: $validation-color-warning;
51
+
52
+ &.react-select-bs__control--is-focused {
53
+ box-shadow: $validation-shadow-warning;
54
+ }
55
+ }
56
+ }
57
+ &.is-invalid.info {
58
+ .react-select-bs__control {
59
+ border-color: $validation-color-info;
60
+
61
+ &.react-select-bs__control--is-focused {
62
+ box-shadow: $validation-shadow-info;
63
+ }
64
+ }
65
+ }
66
+ }
67
+
33
68
  // Text below input boxes
34
69
  .invalid-feedback {
35
70