superdesk-ui-framework 4.0.18 → 4.0.20

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.
@@ -97,7 +97,11 @@ export class CustomHeaderToggleBox extends React.PureComponent<IPropsCustomHeade
97
97
  'toggle-box__content--animation': this.state.isAnimating,
98
98
  })}
99
99
  >
100
- {this.state.isOpen || this.state.wasOpened ? this.props.children : null}
100
+ {
101
+ this.state.isOpen || this.state.wasOpened || this.props.alwaysRenderChildren === true
102
+ ? this.props.children
103
+ : null
104
+ }
101
105
  </div>
102
106
  </div>
103
107
  </div>
@@ -26,6 +26,11 @@ export interface IPropsCustomHeader {
26
26
  initiallyOpen?: boolean;
27
27
  onToggle?(isOpen: boolean): void;
28
28
  toggleBoxRef?: React.RefObject<CustomHeaderToggleBox>;
29
+
30
+ /**
31
+ * by default - children would only get rendered when toggle box is expanded
32
+ */
33
+ alwaysRenderChildren?: boolean;
29
34
  }
30
35
 
31
36
  type IProps = IPropsSimple | IPropsCustomHeader;
@@ -225,7 +225,7 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
225
225
  } else {
226
226
  this.props.onChange(this.state.value);
227
227
  }
228
- } else if (!isEqual(prevProps.value, this.props.value)) {
228
+ } else if (!isEqual(prevProps.value, this.props.value) && !isEqual(this.props.value, this.state.value)) {
229
229
  this.changesFromOutside = true;
230
230
  this.setState({
231
231
  value: this.props.value ?? [],
@@ -79186,7 +79186,7 @@ var TreeSelect = /** @class */ (function (_super) {
79186
79186
  this.props.onChange(this.state.value);
79187
79187
  }
79188
79188
  }
79189
- else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value)) {
79189
+ else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value) && !(0, lodash_1.isEqual)(this.props.value, this.state.value)) {
79190
79190
  this.changesFromOutside = true;
79191
79191
  this.setState({
79192
79192
  value: (_a = this.props.value) !== null && _a !== void 0 ? _a : [],
@@ -150097,7 +150097,9 @@ var CustomHeaderToggleBox = /** @class */ (function (_super) {
150097
150097
  React.createElement("div", { className: 'new-collapse-box__content' },
150098
150098
  React.createElement("div", { id: this.htmlId, "aria-hidden": !isOpen, className: (0, classnames_1.default)('new-collapse-box__content-inner p-2 pt-0-5', {
150099
150099
  'toggle-box__content--animation': this.state.isAnimating,
150100
- }) }, this.state.isOpen || this.state.wasOpened ? this.props.children : null))));
150100
+ }) }, this.state.isOpen || this.state.wasOpened || this.props.alwaysRenderChildren === true
150101
+ ? this.props.children
150102
+ : null))));
150101
150103
  };
150102
150104
  return CustomHeaderToggleBox;
150103
150105
  }(React.PureComponent));
@@ -187894,7 +187896,7 @@ exports.ThreePaneLayoutPattern = ThreePaneLayoutPattern;
187894
187896
  /* 938 */
187895
187897
  /***/ (function(module, exports) {
187896
187898
 
187897
- module.exports = {"name":"superdesk-ui-framework","version":"4.0.18","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","playground-lint":"tsc -p examples/pages/playgrounds/react-playgrounds --noEmit","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}' && npm run playground-lint","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","unit-test":"mocha","debug-unit-tests":"mocha --inspect-brk"},"devDependencies":{"@types/assert":"^1.5.6","@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/enzyme":"^3.10.12","@types/enzyme-adapter-react-16":"^1.0.6","@types/lodash":"^4.14.161","@types/mocha":"^9.1.1","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"^5.58.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","jsdom":"20.0.3","jsdom-global":"3.0.2","lodash":"4.17.21","mocha":"^8.4.0","moment":"^2.29.3","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","ts-node":"^10.9.1","tslint":"^5.18.0","typescript":"4.9.5","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@popperjs/core":"^2.4.0","@superdesk/common":"0.0.28","@superdesk/primereact":"^5.0.2-12","@superdesk/react-resizable-panels":"0.0.39","chart.js":"^2.9.3","date-fns":"2.7.0","popper-max-size-modifier":"^0.2.0","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-scrollspy":"^3.4.3","tippy.js":"^6.3.7"},"peerDependencies":{"moment":"*"},"volta":{"node":"14.21.3"}}
187899
+ module.exports = {"name":"superdesk-ui-framework","version":"4.0.20","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","playground-lint":"tsc -p examples/pages/playgrounds/react-playgrounds --noEmit","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}' && npm run playground-lint","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build","unit-test":"mocha","debug-unit-tests":"mocha --inspect-brk"},"devDependencies":{"@types/assert":"^1.5.6","@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/enzyme":"^3.10.12","@types/enzyme-adapter-react-16":"^1.0.6","@types/lodash":"^4.14.161","@types/mocha":"^9.1.1","@types/react":"16.8.23","@types/react-beautiful-dnd":"^13.1.2","@types/react-dom":"16.8.0","@types/react-router-dom":"^5.1.2","@types/react-scrollspy":"^3.3.5","@typescript-eslint/parser":"^5.58.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","jsdom":"20.0.3","jsdom-global":"3.0.2","lodash":"4.17.21","mocha":"^8.4.0","moment":"^2.29.3","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","ts-node":"^10.9.1","tslint":"^5.18.0","typescript":"4.9.5","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@popperjs/core":"^2.4.0","@superdesk/common":"0.0.28","@superdesk/primereact":"^5.0.2-12","@superdesk/react-resizable-panels":"0.0.39","chart.js":"^2.9.3","date-fns":"2.7.0","popper-max-size-modifier":"^0.2.0","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-scrollspy":"^3.4.3","tippy.js":"^6.3.7"},"peerDependencies":{"moment":"*"},"volta":{"node":"14.21.3"}}
187898
187900
 
187899
187901
  /***/ }),
187900
187902
  /* 939 */
@@ -78307,7 +78307,7 @@ var TreeSelect = /** @class */ (function (_super) {
78307
78307
  this.props.onChange(this.state.value);
78308
78308
  }
78309
78309
  }
78310
- else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value)) {
78310
+ else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value) && !(0, lodash_1.isEqual)(this.props.value, this.state.value)) {
78311
78311
  this.changesFromOutside = true;
78312
78312
  this.setState({
78313
78313
  value: (_a = this.props.value) !== null && _a !== void 0 ? _a : [],
@@ -149218,7 +149218,9 @@ var CustomHeaderToggleBox = /** @class */ (function (_super) {
149218
149218
  React.createElement("div", { className: 'new-collapse-box__content' },
149219
149219
  React.createElement("div", { id: this.htmlId, "aria-hidden": !isOpen, className: (0, classnames_1.default)('new-collapse-box__content-inner p-2 pt-0-5', {
149220
149220
  'toggle-box__content--animation': this.state.isAnimating,
149221
- }) }, this.state.isOpen || this.state.wasOpened ? this.props.children : null))));
149221
+ }) }, this.state.isOpen || this.state.wasOpened || this.props.alwaysRenderChildren === true
149222
+ ? this.props.children
149223
+ : null))));
149222
149224
  };
149223
149225
  return CustomHeaderToggleBox;
149224
149226
  }(React.PureComponent));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "4.0.18",
3
+ "version": "4.0.20",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -103,7 +103,9 @@ var CustomHeaderToggleBox = /** @class */ (function (_super) {
103
103
  React.createElement("div", { className: 'new-collapse-box__content' },
104
104
  React.createElement("div", { id: this.htmlId, "aria-hidden": !isOpen, className: (0, classnames_1.default)('new-collapse-box__content-inner p-2 pt-0-5', {
105
105
  'toggle-box__content--animation': this.state.isAnimating,
106
- }) }, this.state.isOpen || this.state.wasOpened ? this.props.children : null))));
106
+ }) }, this.state.isOpen || this.state.wasOpened || this.props.alwaysRenderChildren === true
107
+ ? this.props.children
108
+ : null))));
107
109
  };
108
110
  return CustomHeaderToggleBox;
109
111
  }(React.PureComponent));
@@ -23,6 +23,10 @@ export interface IPropsCustomHeader {
23
23
  initiallyOpen?: boolean;
24
24
  onToggle?(isOpen: boolean): void;
25
25
  toggleBoxRef?: React.RefObject<CustomHeaderToggleBox>;
26
+ /**
27
+ * by default - children would only get rendered when toggle box is expanded
28
+ */
29
+ alwaysRenderChildren?: boolean;
26
30
  }
27
31
  type IProps = IPropsSimple | IPropsCustomHeader;
28
32
  export declare class ToggleBox extends React.PureComponent<IProps> {
@@ -197,7 +197,7 @@ var TreeSelect = /** @class */ (function (_super) {
197
197
  this.props.onChange(this.state.value);
198
198
  }
199
199
  }
200
- else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value)) {
200
+ else if (!(0, lodash_1.isEqual)(prevProps.value, this.props.value) && !(0, lodash_1.isEqual)(this.props.value, this.state.value)) {
201
201
  this.changesFromOutside = true;
202
202
  this.setState({
203
203
  value: (_a = this.props.value) !== null && _a !== void 0 ? _a : [],