superdesk-ui-framework 4.0.20 → 4.0.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "4.0.20",
3
+ "version": "4.0.22",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,8 +49,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
50
  exports.IconPicker = void 0;
51
51
  var React = __importStar(require("react"));
52
- // @ts-ignore
53
- var iconFont = __importStar(require("../../app/styles/_icon-font.scss"));
54
52
  var Button_1 = require("./Button");
55
53
  var Icon_1 = require("./Icon");
56
54
  var SelectGrid_1 = require("./SelectGrid");
@@ -281,11 +279,8 @@ var getIcons = function (translateFunction) {
281
279
  'zoom-in': 'Zoom In',
282
280
  'zoom-out': 'Zoom Out',
283
281
  };
284
- return iconFont.icon
285
- .split(', ')
286
- .sort()
287
- .map(function (icon) { return ({
282
+ return Object.keys(translatedIconNameMap).sort().map(function (icon) { return ({
288
283
  value: icon,
289
- label: translatedIconNameMap[icon] ? translateFunction(translatedIconNameMap[icon]) : icon,
284
+ label: translateFunction(translatedIconNameMap[icon]),
290
285
  }); });
291
286
  };
@@ -13,7 +13,7 @@ export declare class CustomHeaderToggleBox extends React.PureComponent<IPropsCus
13
13
  * Called via ref
14
14
  */
15
15
  isOpen: () => boolean;
16
- toggle: () => void;
16
+ toggle: () => Promise<boolean>;
17
17
  componentDidUpdate(_prevProps: IPropsCustomHeader, prevState: IState): void;
18
18
  handleAnimationEnd: () => void;
19
19
  render(): JSX.Element;
@@ -60,9 +60,21 @@ var CustomHeaderToggleBox = /** @class */ (function (_super) {
60
60
  return _this.state.isOpen;
61
61
  };
62
62
  _this.toggle = function () {
63
- _this.setState({ isOpen: !_this.state.isOpen }, function () {
64
- var _a, _b;
65
- (_b = (_a = _this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, _this.state.isOpen);
63
+ return new Promise(function (resolve, reject) {
64
+ _this.setState({ isOpen: !_this.state.isOpen, isAnimating: true }, function () {
65
+ if (_this.contentRef.current) {
66
+ var handleAnimation = function () {
67
+ var _a, _b;
68
+ (_b = (_a = _this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, _this.state.isOpen);
69
+ _this.handleAnimationEnd();
70
+ resolve(_this.state.isOpen);
71
+ };
72
+ _this.contentRef.current.addEventListener("animationend", handleAnimation, { once: true });
73
+ }
74
+ else {
75
+ reject();
76
+ }
77
+ });
66
78
  });
67
79
  };
68
80
  _this.handleAnimationEnd = function () {
@@ -101,7 +113,7 @@ var CustomHeaderToggleBox = /** @class */ (function (_super) {
101
113
  React.createElement("button", { className: 'new-collapse-box__divider', onClick: this.toggle, "aria-controls": this.htmlId },
102
114
  React.createElement("span", { className: 'label label--translucent new-collapse-box__divider-label' }, this.props.getToggleButtonLabel(isOpen)))),
103
115
  React.createElement("div", { className: 'new-collapse-box__content' },
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', {
116
+ React.createElement("div", { ref: this.contentRef, id: this.htmlId, "aria-hidden": !isOpen, className: (0, classnames_1.default)('new-collapse-box__content-inner p-2 pt-0-5', {
105
117
  'toggle-box__content--animation': this.state.isAnimating,
106
118
  }) }, this.state.isOpen || this.state.wasOpened || this.props.alwaysRenderChildren === true
107
119
  ? this.props.children
@@ -5,5 +5,6 @@ module.exports = merge(webpackConfig, {
5
5
  externals: [
6
6
  'react',
7
7
  'react-dom',
8
+ 'angular',
8
9
  ],
9
10
  });