@singularsystems/neo-react 1.3.4 → 1.3.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  This file details all new features and changes to functionality. If you only need to see changes that require updates to your project, see the [breaking changes](./Breaking.md) readme.
4
4
 
5
+ ## Version 1.3.5
6
+
7
+ - Fixed drop down to not add a blank item if the bound value is zero, and the items contains an item with id of zero.
8
+ - Minor changes to `IRoute` to allow `basePath` property.
9
+
5
10
  ## Version 1.3.4
6
11
 
7
12
  - Added `PopupHost` component
@@ -105,9 +105,10 @@ var DropDown = /** @class */ (function (_super) {
105
105
  var items = this.items;
106
106
  var selectedItem = this.getSelectedOption(this.props.bind.value); // This sets the sort value to allow sorting of drop downs in grids.
107
107
  var value = this.props.bind.value;
108
- var notFound = items.length > 0 && value && selectedItem[this.valueMember] !== value;
109
- var addBlankItem = ((_c = (_b = splitProps.select) === null || _b === void 0 ? void 0 : _b.allowNulls) !== null && _c !== void 0 ? _c : this.props.bind.propertyInfo.allowNulls) || !value || notFound;
110
- if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === ""; })) {
108
+ var valueIsEmpty = !value;
109
+ var notFound = items.length > 0 && !valueIsEmpty && selectedItem[this.valueMember] !== value;
110
+ var addBlankItem = ((_c = (_b = splitProps.select) === null || _b === void 0 ? void 0 : _b.allowNulls) !== null && _c !== void 0 ? _c : this.props.bind.propertyInfo.allowNulls) || valueIsEmpty || notFound;
111
+ if (addBlankItem && items.find(function (item) { return item[_this.valueMember] === null || item[_this.valueMember] === "" || (valueIsEmpty && item[_this.valueMember] === value); })) {
111
112
  // If there is an item with a null value, don't add a blank drop down item.
112
113
  addBlankItem = false;
113
114
  }
@@ -126,13 +127,13 @@ var DropDown = /** @class */ (function (_super) {
126
127
  if (domProps.readOnly) {
127
128
  domProps.disabled = true;
128
129
  }
129
- var valueIsBlank = value === undefined || value === null;
130
- var nullText = (valueIsBlank || ((_e = splitProps.select) === null || _e === void 0 ? void 0 : _e.deSelectText) === undefined) ? (_f = splitProps.select) === null || _f === void 0 ? void 0 : _f.nullText : (_g = splitProps.select) === null || _g === void 0 ? void 0 : _g.deSelectText;
131
- if (valueIsBlank) {
130
+ var valueIsNull = value === undefined || value === null;
131
+ var nullText = (valueIsNull || ((_e = splitProps.select) === null || _e === void 0 ? void 0 : _e.deSelectText) === undefined) ? (_f = splitProps.select) === null || _f === void 0 ? void 0 : _f.nullText : (_g = splitProps.select) === null || _g === void 0 ? void 0 : _g.deSelectText;
132
+ if (valueIsNull) {
132
133
  domProps.className = Utils.joinWithSpaces(domProps.className, "select-no-value");
133
134
  }
134
135
  control =
135
- React.createElement("select", __assign({ value: valueIsBlank ? "" : value, onChange: this.onItemSelected, ref: splitProps.editor.inputElement }, domProps),
136
+ React.createElement("select", __assign({ value: valueIsNull ? "" : value, onChange: this.onItemSelected, ref: splitProps.editor.inputElement }, domProps),
136
137
  addBlankItem && React.createElement("option", { className: "option-default" }, notFound ? "(Not found): ".concat(value) : nullText),
137
138
  items.map(function (item) { return (React.createElement("option", { value: item[_this.valueMember], key: item[_this.valueMember] }, item[_this.displayMember])); }));
138
139
  }
@@ -1,5 +1,4 @@
1
1
  import { __assign, __spreadArray } from "tslib";
2
- import { MenuRoute } from './MenuRoute';
3
2
  var RouteProvider = /** @class */ (function () {
4
3
  /**
5
4
  * Creates a route provider which provides a list of flattened routes.
@@ -106,10 +105,9 @@ var RouteProvider = /** @class */ (function () {
106
105
  * Adds a unique key, and adds route parameters extracted from the component static params object.
107
106
  */
108
107
  RouteProvider.prototype.processRoute = function (into, route) {
108
+ var _a;
109
109
  var processed = __assign(__assign({}, route), { path: route.path, params: [], key: this.key++, order: 0 });
110
- if (route instanceof MenuRoute) {
111
- processed.path = route.basePath;
112
- }
110
+ processed.path = (_a = route.basePath) !== null && _a !== void 0 ? _a : route.path;
113
111
  processed.path = processed.path.toLowerCase();
114
112
  if (processed.path.length > 1 && processed.path.endsWith("/")) {
115
113
  processed.path = processed.path.substring(0, processed.path.length - 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
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",