superdesk-ui-framework 3.0.54 → 3.0.55

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.
@@ -11,6 +11,7 @@ import {IInputWrapper} from '../Form/InputWrapper';
11
11
  import {SelectPreview} from '../SelectPreview';
12
12
  import {TreeSelectPill} from './TreeSelectPill';
13
13
  import {getPrefixedItemId, TreeSelectItem} from './TreeSelectItem';
14
+ import {createPortal} from 'react-dom';
14
15
 
15
16
  interface IState<T> {
16
17
  value: Array<T>;
@@ -47,6 +48,7 @@ interface IPropsBase<T> extends IInputWrapper {
47
48
  optionTemplate?(item: T): React.ComponentType<T> | JSX.Element;
48
49
  valueTemplate?(item: T, Wrapper: React.ElementType): React.ComponentType<T> | JSX.Element;
49
50
  onChange(e: Array<T>): void;
51
+ 'data-test-id'?: string;
50
52
  }
51
53
 
52
54
  interface IPropsSync<T> extends IPropsBase<T> {
@@ -131,7 +133,8 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
131
133
 
132
134
  onMouseDown = (event: MouseEvent) => {
133
135
  if (
134
- (this.treeSelectRef .current?.contains(event.target as HTMLElement) !== true)
136
+ (this.dropdownRef.current?.contains(event.target as HTMLElement) !== true)
137
+ && (this.treeSelectRef.current?.contains(event.target as HTMLElement) !== true)
135
138
  && this.state.openDropdown
136
139
  ) {
137
140
  this.setState({openDropdown: false});
@@ -701,6 +704,7 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
701
704
  onClick={() => {
702
705
  this.setState({openDropdown: !this.state.openDropdown});
703
706
  }}
707
+ data-test-id={this.state.openDropdown ? undefined : this.props['data-test-id']}
704
708
  />
705
709
  }
706
710
 
@@ -770,129 +774,138 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
770
774
  })}
771
775
  </div>
772
776
  }
777
+ </div>
773
778
 
774
- {this.state.openDropdown
775
- && <div
776
- className={
777
- "autocomplete autocomplete--multi-select"
778
- + (this.props.width === 'medium' ? ' autocomplete--fixed-width' : '')
779
- }
780
- style={{zIndex: this.props.zIndex}}
781
- ref={this.dropdownRef}
782
- >
783
- <div className='autocomplete__header'>
784
- <div
785
- className="autocomplete__icon"
786
- onClick={() => {
787
- this.backButton();
788
- }}
789
- >
790
- <Icon name="search" className="search"></Icon>
791
- </div>
792
-
793
- <div className='autocomplete__filter'>
794
- <input
795
- className="autocomplete__input"
796
- type="text"
797
- placeholder={this.props.searchPlaceholder}
798
- ref={this.inputRef}
799
- value={this.state.searchFieldValue}
800
- onChange={(event) => {
801
- if (this.props.kind === 'synchronous') {
802
- this.setState({searchFieldValue: event.target.value});
803
- this.popperInstance?.update();
804
- } else if (this.props.kind === 'asynchronous') {
805
- if (this.ICancelFn) {
806
- this.ICancelFn();
807
- }
808
-
809
- this.setState({searchFieldValue: event.target.value, options: []});
810
- this.popperInstance?.update();
811
- this.debounceFn();
812
- } else {
813
- return;
814
- }
815
- }}
816
- />
817
- </div>
818
- </div>
819
-
820
- {(this.state.activeTree.length > 0 && this.state.buttonValue != null)
821
- && <div className='autocomplete__category-header'>
779
+ {createPortal(
780
+ this.state.openDropdown
781
+ && <div id='TREESELECT_DROPDOWN' data-test-id={this.props['data-test-id']}>
782
+ <div
783
+ className={
784
+ "autocomplete autocomplete--multi-select"
785
+ + (this.props.width === 'medium' ? ' autocomplete--fixed-width' : '')
786
+ }
787
+ style={{
788
+ zIndex: this.props.zIndex,
789
+ width: this.treeSelectRef.current?.offsetWidth,
790
+ }}
791
+ ref={this.dropdownRef}
792
+ >
793
+ <div className='autocomplete__header'>
822
794
  <div
823
795
  className="autocomplete__icon"
824
796
  onClick={() => {
825
797
  this.backButton();
826
798
  }}
827
799
  >
828
- <Icon name="arrow-left" className="arrow-left"></Icon>
800
+ <Icon name="search" className="search"></Icon>
829
801
  </div>
830
802
 
831
803
  <div className='autocomplete__filter'>
832
- <button className='autocomplete__category-title'>
833
- {this.props.optionTemplate
834
- ? this.props.optionTemplate(this.state.buttonValue.value)
835
- : this.props.getLabel(this.state.buttonValue.value)
836
- }
837
- </button>
838
-
839
- {this.props.selectBranchWithChildren
840
- && this.branchButton(this.state.buttonValue)
841
- }
804
+ <input
805
+ className="autocomplete__input"
806
+ type="text"
807
+ placeholder={this.props.searchPlaceholder}
808
+ ref={this.inputRef}
809
+ value={this.state.searchFieldValue}
810
+ onChange={(event) => {
811
+ if (this.props.kind === 'synchronous') {
812
+ this.setState({searchFieldValue: event.target.value});
813
+ this.popperInstance?.update();
814
+ } else if (this.props.kind === 'asynchronous') {
815
+ if (this.ICancelFn) {
816
+ this.ICancelFn();
817
+ }
818
+
819
+ this.setState({searchFieldValue: event.target.value, options: []});
820
+ this.popperInstance?.update();
821
+ this.debounceFn();
822
+ } else {
823
+ return;
824
+ }
825
+ }}
826
+ data-test-id="filter-input"
827
+ />
842
828
  </div>
843
829
  </div>
844
- }
845
830
 
846
- {this.state.loading
847
- ? <ul className="suggestion-list--loader"><Loader overlay={true}></Loader></ul>
848
- : this.state.searchFieldValue === ''
849
- ? this.props.getOptions
850
- ? <ul
831
+ {(this.state.activeTree.length > 0 && this.state.buttonValue != null)
832
+ && <div className='autocomplete__category-header'>
833
+ <div
834
+ className="autocomplete__icon"
835
+ onClick={() => {
836
+ this.backButton();
837
+ }}
838
+ >
839
+ <Icon name="arrow-left" className="arrow-left"></Icon>
840
+ </div>
841
+
842
+ <div className='autocomplete__filter'>
843
+ <button className='autocomplete__category-title'>
844
+ {this.props.optionTemplate
845
+ ? this.props.optionTemplate(this.state.buttonValue.value)
846
+ : this.props.getLabel(this.state.buttonValue.value)
847
+ }
848
+ </button>
849
+
850
+ {this.props.selectBranchWithChildren
851
+ && this.branchButton(this.state.buttonValue)
852
+ }
853
+ </div>
854
+ </div>
855
+ }
856
+
857
+ {this.state.loading
858
+ ? <ul className="suggestion-list--loader"><Loader overlay={true}></Loader></ul>
859
+ : this.state.searchFieldValue === ''
860
+ ? this.props.getOptions
861
+ ? <ul
862
+ className="suggestion-list suggestion-list--multi-select"
863
+ ref={this.ref}
864
+ data-test-id="options"
865
+ >
866
+ {this.state.options.map((option, i: React.Key | undefined) => {
867
+ let selectedItem = this.state.value.some((obj) =>
868
+ this.props.getId(obj) === this.props.getId(option.value),
869
+ );
870
+
871
+ return (
872
+ <TreeSelectItem
873
+ key={i}
874
+ option={option}
875
+ handleTree={this.handleTree}
876
+ selectedItem={selectedItem}
877
+ allowMultiple={this.props.allowMultiple}
878
+ getBorderColor={this.props.getBorderColor}
879
+ getBackgroundColor={this.props.getBackgroundColor}
880
+ getId={this.props.getId}
881
+ optionTemplate={this.props.optionTemplate}
882
+ getLabel={this.props.getLabel}
883
+ onKeyDown={() => this.setState({
884
+ buttonTarget: [
885
+ ...this.state.buttonTarget,
886
+ this.props.getId(option.value),
887
+ ],
888
+ })}
889
+ />
890
+ );
891
+ })}
892
+ </ul>
893
+ : null
894
+ : <ul
851
895
  className="suggestion-list suggestion-list--multi-select"
852
896
  ref={this.ref}
853
897
  >
854
- {this.state.options.map((option, i: React.Key | undefined) => {
855
- let selectedItem = this.state.value.some((obj) =>
856
- this.props.getId(obj) === this.props.getId(option.value),
857
- );
858
-
859
- return (
860
- <TreeSelectItem
861
- key={i}
862
- option={option}
863
- handleTree={this.handleTree}
864
- selectedItem={selectedItem}
865
- allowMultiple={this.props.allowMultiple}
866
- getBorderColor={this.props.getBorderColor}
867
- getBackgroundColor={this.props.getBackgroundColor}
868
- getId={this.props.getId}
869
- optionTemplate={this.props.optionTemplate}
870
- getLabel={this.props.getLabel}
871
- onKeyDown={() => this.setState({
872
- buttonTarget: [
873
- ...this.state.buttonTarget,
874
- this.props.getId(option.value),
875
- ],
876
- })}
877
- />
878
- );
879
- })}
898
+ {this.filteredItem(
899
+ this.props.singleLevelSearch
900
+ ? this.state.options
901
+ : this.state.filterArr,
902
+ )}
880
903
  </ul>
881
- : null
882
- : <ul
883
- className="suggestion-list suggestion-list--multi-select"
884
- ref={this.ref}
885
- >
886
- {this.filteredItem(
887
- this.props.singleLevelSearch
888
- ? this.state.options
889
- : this.state.filterArr,
890
- )}
891
- </ul>
892
- }
893
- </div>
894
- }
895
- </div>
904
+ }
905
+ </div>
906
+ </div>,
907
+ document.body,
908
+ )}
896
909
  </InputWrapper>
897
910
  );
898
911
  }
@@ -40147,6 +40147,10 @@ var DatePicker = /** @class */ (function (_super) {
40147
40147
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
40148
40148
  React.createElement(calendar_1.Calendar, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
40149
40149
  _this.instance = ref;
40150
+ var refAny = ref;
40151
+ if (_this.props['data-test-id'] != null && (refAny === null || refAny === void 0 ? void 0 : refAny.inputElement) != null) {
40152
+ refAny.inputElement.setAttribute('data-test-id', _this.props['data-test-id']);
40153
+ }
40150
40154
  }, value: this.state.value === null ? undefined : this.state.value, onChange: function (event) {
40151
40155
  var result = parseFromPrimeReactCalendarFormat(event.value);
40152
40156
  if (result !== 'failed-to-parse') {
@@ -64140,7 +64144,7 @@ var TimePicker = /** @class */ (function (_super) {
64140
64144
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
64141
64145
  React.createElement("input", { value: this.props.value, type: "time", className: "sd-input__input", id: this.htmlId, "aria-labelledby": this.htmlId + 'label', step: this.props.allowSeconds ? 1 : undefined, required: this.props.required, disabled: this.props.disabled, onChange: function (event) {
64142
64146
  _this.props.onChange(event.target.value);
64143
- } })));
64147
+ }, "data-test-id": this.props['data-test-id'] })));
64144
64148
  };
64145
64149
  return TimePicker;
64146
64150
  }(React.PureComponent));
@@ -64503,6 +64507,7 @@ var Label_1 = __webpack_require__(36);
64503
64507
  var SelectPreview_1 = __webpack_require__(75);
64504
64508
  var TreeSelectPill_1 = __webpack_require__(513);
64505
64509
  var TreeSelectItem_1 = __webpack_require__(514);
64510
+ var react_dom_1 = __webpack_require__(8);
64506
64511
  var TreeSelect = /** @class */ (function (_super) {
64507
64512
  __extends(TreeSelect, _super);
64508
64513
  function TreeSelect(props) {
@@ -64521,8 +64526,9 @@ var TreeSelect = /** @class */ (function (_super) {
64521
64526
  (_a = _this.categoryButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
64522
64527
  };
64523
64528
  _this.onMouseDown = function (event) {
64524
- var _a;
64525
- if ((((_a = _this.treeSelectRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) !== true)
64529
+ var _a, _b;
64530
+ if ((((_a = _this.dropdownRef.current) === null || _a === void 0 ? void 0 : _a.contains(event.target)) !== true)
64531
+ && (((_b = _this.treeSelectRef.current) === null || _b === void 0 ? void 0 : _b.contains(event.target)) !== true)
64526
64532
  && _this.state.openDropdown) {
64527
64533
  _this.setState({ openDropdown: false });
64528
64534
  }
@@ -64925,6 +64931,7 @@ var TreeSelect = /** @class */ (function (_super) {
64925
64931
  };
64926
64932
  TreeSelect.prototype.render = function () {
64927
64933
  var _this = this;
64934
+ var _a;
64928
64935
  if (this.props.preview) {
64929
64936
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: this.props.allowMultiple
64930
64937
  ? {
@@ -64937,67 +64944,70 @@ var TreeSelect = /** @class */ (function (_super) {
64937
64944
  }, items: this.state.value, valueTemplate: this.props.valueTemplate, getLabel: this.props.getLabel }));
64938
64945
  }
64939
64946
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
64940
- React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef },
64941
- this.props.allowMultiple
64942
- ? React.createElement("div", { className: "tags-input__tags" },
64943
- this.props.readOnly
64944
- || React.createElement("button", { ref: this.openDropdownRef, className: "tags-input__add-button ".concat(this.props.disabled ? 'tags-input__add-button--disabled' : ''), onClick: function (e) {
64947
+ React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef }, this.props.allowMultiple
64948
+ ? React.createElement("div", { className: "tags-input__tags" },
64949
+ this.props.readOnly
64950
+ || React.createElement("button", { ref: this.openDropdownRef, className: "tags-input__add-button ".concat(this.props.disabled ? 'tags-input__add-button--disabled' : ''), onClick: function (e) {
64951
+ e.stopPropagation();
64952
+ if (!_this.props.disabled) {
64953
+ _this.setState({ openDropdown: !_this.state.openDropdown });
64954
+ }
64955
+ } },
64956
+ React.createElement("i", { className: "icon-plus-large" })),
64957
+ React.createElement("ul", { className: "tags-input__tag-list" }, this.state.value.map(function (item, i) {
64958
+ var Wrapper = function (_a) {
64959
+ var backgroundColor = _a.backgroundColor, children = _a.children;
64960
+ return (React.createElement(TreeSelectPill_1.TreeSelectPill, { item: item, readOnly: _this.props.readOnly, disabled: _this.props.disabled, valueTemplate: _this.props.valueTemplate, backgroundColor: backgroundColor, onRemove: function () { return _this.removeClick(i); }, getBackgroundColor: _this.props.getBackgroundColor }, children));
64961
+ };
64962
+ return (React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
64963
+ ? _this.props.valueTemplate(item, Wrapper)
64964
+ : (React.createElement(Wrapper, null,
64965
+ React.createElement("span", null, _this.props.getLabel(item))))));
64966
+ })),
64967
+ this.state.value.length > 0
64968
+ ? (this.props.readOnly || this.props.disabled)
64969
+ || React.createElement("button", { className: "tags-input__remove-value", style: { position: 'relative', bottom: '2px' }, onClick: function (e) {
64945
64970
  e.stopPropagation();
64946
- if (!_this.props.disabled) {
64947
- _this.setState({ openDropdown: !_this.state.openDropdown });
64948
- }
64971
+ _this.setState({ value: [] });
64949
64972
  } },
64950
- React.createElement("i", { className: "icon-plus-large" })),
64951
- React.createElement("ul", { className: "tags-input__tag-list" }, this.state.value.map(function (item, i) {
64952
- var Wrapper = function (_a) {
64953
- var backgroundColor = _a.backgroundColor, children = _a.children;
64954
- return (React.createElement(TreeSelectPill_1.TreeSelectPill, { item: item, readOnly: _this.props.readOnly, disabled: _this.props.disabled, valueTemplate: _this.props.valueTemplate, backgroundColor: backgroundColor, onRemove: function () { return _this.removeClick(i); }, getBackgroundColor: _this.props.getBackgroundColor }, children));
64955
- };
64956
- return (React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
64957
- ? _this.props.valueTemplate(item, Wrapper)
64958
- : (React.createElement(Wrapper, null,
64959
- React.createElement("span", null, _this.props.getLabel(item))))));
64960
- })),
64961
- this.state.value.length > 0
64962
- ? (this.props.readOnly || this.props.disabled)
64963
- || React.createElement("button", { className: "tags-input__remove-value", style: { position: 'relative', bottom: '2px' }, onClick: function (e) {
64964
- e.stopPropagation();
64965
- _this.setState({ value: [] });
64966
- } },
64967
- React.createElement(Icon_1.Icon, { name: 'remove-sign' }))
64968
- : null)
64969
- : React.createElement("div", { className: "tags-input__tags" },
64970
- this.props.readOnly
64971
- || React.createElement("button", { className: "tags-input__overlay-button", ref: this.openDropdownRef, onClick: function () {
64972
- _this.setState({ openDropdown: !_this.state.openDropdown });
64973
- } }),
64974
- this.state.value.length < 1
64975
- && React.createElement("span", { className: 'tags-input__single-item'
64976
- + (this.props.readOnly ? ' tags-input__tag-item--readonly' : '') },
64977
- React.createElement("span", { className: "tags-input__placeholder" }, this.props.placeholder)),
64978
- this.state.value.map(function (item, i) {
64979
- var Wrapper = function (_a) {
64980
- var backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, children = _a.children;
64981
- return (React.createElement("span", { className: 'tags-input__single-item'
64982
- + (_this.props.readOnly ? ' tags-input__tag-item--readonly' : ''), onClick: function () { return !_this.props.readOnly && _this.removeClick(i); } },
64983
- _this.props.getBorderColor
64984
- && React.createElement("div", { className: "item-border item-border-selected", style: borderColor
64985
- ? { backgroundColor: borderColor }
64986
- : { backgroundColor: _this.props.getBorderColor(item) } }),
64987
- React.createElement("span", { className: "tags-input__helper-box", style: { color: backgroundColor && (0, Label_1.getTextColor)(backgroundColor) } },
64988
- React.createElement("span", { className: backgroundColor && "tags-input__tag-item", style: { backgroundColor: backgroundColor, margin: 0 } }, children),
64989
- _this.props.readOnly
64990
- || React.createElement("span", { className: "tags-input__remove-button" },
64991
- React.createElement(Icon_1.Icon, { name: 'remove-sign' })))));
64992
- };
64993
- return React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
64994
- ? _this.props.valueTemplate(item, Wrapper)
64995
- : (React.createElement(Wrapper, null,
64996
- React.createElement("span", null, _this.props.getLabel(item)))));
64997
- })),
64998
- this.state.openDropdown
64999
- && React.createElement("div", { className: "autocomplete autocomplete--multi-select"
65000
- + (this.props.width === 'medium' ? ' autocomplete--fixed-width' : ''), style: { zIndex: this.props.zIndex }, ref: this.dropdownRef },
64973
+ React.createElement(Icon_1.Icon, { name: 'remove-sign' }))
64974
+ : null)
64975
+ : React.createElement("div", { className: "tags-input__tags" },
64976
+ this.props.readOnly
64977
+ || React.createElement("button", { className: "tags-input__overlay-button", ref: this.openDropdownRef, onClick: function () {
64978
+ _this.setState({ openDropdown: !_this.state.openDropdown });
64979
+ }, "data-test-id": this.state.openDropdown ? undefined : this.props['data-test-id'] }),
64980
+ this.state.value.length < 1
64981
+ && React.createElement("span", { className: 'tags-input__single-item'
64982
+ + (this.props.readOnly ? ' tags-input__tag-item--readonly' : '') },
64983
+ React.createElement("span", { className: "tags-input__placeholder" }, this.props.placeholder)),
64984
+ this.state.value.map(function (item, i) {
64985
+ var Wrapper = function (_a) {
64986
+ var backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, children = _a.children;
64987
+ return (React.createElement("span", { className: 'tags-input__single-item'
64988
+ + (_this.props.readOnly ? ' tags-input__tag-item--readonly' : ''), onClick: function () { return !_this.props.readOnly && _this.removeClick(i); } },
64989
+ _this.props.getBorderColor
64990
+ && React.createElement("div", { className: "item-border item-border-selected", style: borderColor
64991
+ ? { backgroundColor: borderColor }
64992
+ : { backgroundColor: _this.props.getBorderColor(item) } }),
64993
+ React.createElement("span", { className: "tags-input__helper-box", style: { color: backgroundColor && (0, Label_1.getTextColor)(backgroundColor) } },
64994
+ React.createElement("span", { className: backgroundColor && "tags-input__tag-item", style: { backgroundColor: backgroundColor, margin: 0 } }, children),
64995
+ _this.props.readOnly
64996
+ || React.createElement("span", { className: "tags-input__remove-button" },
64997
+ React.createElement(Icon_1.Icon, { name: 'remove-sign' })))));
64998
+ };
64999
+ return React.createElement(React.Fragment, { key: i }, _this.props.valueTemplate
65000
+ ? _this.props.valueTemplate(item, Wrapper)
65001
+ : (React.createElement(Wrapper, null,
65002
+ React.createElement("span", null, _this.props.getLabel(item)))));
65003
+ }))),
65004
+ (0, react_dom_1.createPortal)(this.state.openDropdown
65005
+ && React.createElement("div", { id: 'TREESELECT_DROPDOWN', "data-test-id": this.props['data-test-id'] },
65006
+ React.createElement("div", { className: "autocomplete autocomplete--multi-select"
65007
+ + (this.props.width === 'medium' ? ' autocomplete--fixed-width' : ''), style: {
65008
+ zIndex: this.props.zIndex,
65009
+ width: (_a = this.treeSelectRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth,
65010
+ }, ref: this.dropdownRef },
65001
65011
  React.createElement("div", { className: 'autocomplete__header' },
65002
65012
  React.createElement("div", { className: "autocomplete__icon", onClick: function () {
65003
65013
  _this.backButton();
@@ -65021,7 +65031,7 @@ var TreeSelect = /** @class */ (function (_super) {
65021
65031
  else {
65022
65032
  return;
65023
65033
  }
65024
- } }))),
65034
+ }, "data-test-id": "filter-input" }))),
65025
65035
  (this.state.activeTree.length > 0 && this.state.buttonValue != null)
65026
65036
  && React.createElement("div", { className: 'autocomplete__category-header' },
65027
65037
  React.createElement("div", { className: "autocomplete__icon", onClick: function () {
@@ -65039,7 +65049,7 @@ var TreeSelect = /** @class */ (function (_super) {
65039
65049
  React.createElement(Loader_1.Loader, { overlay: true }))
65040
65050
  : this.state.searchFieldValue === ''
65041
65051
  ? this.props.getOptions
65042
- ? React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref }, this.state.options.map(function (option, i) {
65052
+ ? React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref, "data-test-id": "options" }, this.state.options.map(function (option, i) {
65043
65053
  var selectedItem = _this.state.value.some(function (obj) {
65044
65054
  return _this.props.getId(obj) === _this.props.getId(option.value);
65045
65055
  });
@@ -65052,7 +65062,7 @@ var TreeSelect = /** @class */ (function (_super) {
65052
65062
  : null
65053
65063
  : React.createElement("ul", { className: "suggestion-list suggestion-list--multi-select", ref: this.ref }, this.filteredItem(this.props.singleLevelSearch
65054
65064
  ? this.state.options
65055
- : this.state.filterArr))))));
65065
+ : this.state.filterArr)))), document.body)));
65056
65066
  };
65057
65067
  return TreeSelect;
65058
65068
  }(React.Component));
@@ -66727,7 +66737,7 @@ var Input = /** @class */ (function (_super) {
66727
66737
  React.createElement("span", null, this.props.value)));
66728
66738
  }
66729
66739
  return (React.createElement(InputWrapper_1.InputWrapper, { label: this.props.label, required: this.props.required, disabled: this.props.disabled, value: this.props.value, error: this.props.error, invalid: this.props.error != null, info: this.props.info, maxLength: this.props.maxLength, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, size: (_a = this.props.size) !== null && _a !== void 0 ? _a : 'medium', fullWidth: this.props.fullWidth, htmlId: this.htmlId, boxedStyle: this.props.boxedStyle, boxedLable: this.props.boxedLable, tabindex: this.props.tabindex },
66730
- React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled })));
66740
+ React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled, "data-test-id": this.props['data-test-id'] })));
66731
66741
  };
66732
66742
  return Input;
66733
66743
  }(React.Component));
@@ -78453,7 +78463,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
78453
78463
  _a));
78454
78464
  return (React.createElement(React.Fragment, null,
78455
78465
  !((_j = this.props.group) === null || _j === void 0 ? void 0 : _j.groupLabel) ?
78456
- React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
78466
+ React.createElement("div", { role: "radiogroup", className: classes, "aria-labelledby": (_k = this.props.group) === null || _k === void 0 ? void 0 : _k.groupLabelledBy, "data-test-id": this.props['data-test-id'] }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: _this.props.tabindex === undefined ? undefined : -1 },
78457
78467
  React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: _this.props.tabindex, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
78458
78468
  React.createElement("label", { className: "sd-check-button__text-label", htmlFor: _this.htmlId + index, "aria-label": item.labelHidden ? item.label : undefined },
78459
78469
  item.icon ? React.createElement("i", { className: "icon-".concat(item.icon), "aria-hidden": "true" }) : null,
@@ -78461,7 +78471,7 @@ var RadioButtonGroup = /** @class */ (function (_super) {
78461
78471
  React.createElement("span", { className: "sd-check-button__text-label-inner" }, item.label) : null))); }))
78462
78472
  : null,
78463
78473
  ((_l = this.props.group) === null || _l === void 0 ? void 0 : _l.groupLabel) ?
78464
- React.createElement("div", { className: 'sd-check-button__group-wrapper' },
78474
+ React.createElement("div", { className: 'sd-check-button__group-wrapper', "data-test-id": this.props['data-test-id'] },
78465
78475
  React.createElement(FormLabel_1.FormLabel, { forId: this.htmlId + 'group', text: this.props.group.groupLabel }),
78466
78476
  React.createElement("div", { role: "radiogroup", id: this.htmlId + 'group', className: classes }, this.props.options.map(function (item, index) { return (React.createElement("span", { className: "sd-check-button sd-check-button--native", key: index, tabIndex: -1 },
78467
78477
  React.createElement("input", { type: "radio", className: "sd-check-button__input", id: _this.htmlId + index, tabIndex: 0, name: _this.htmlId, onChange: function () { return _this.handleChange(item); }, disabled: item.disabled, required: _this.props.required, checked: item.value === _this.props.value }),
@@ -80381,10 +80391,10 @@ var TabLabel = function (_a) {
80381
80391
  return (React.createElement("span", null, label));
80382
80392
  };
80383
80393
  exports.TabLabel = TabLabel;
80384
- var Tabs = function (_a) {
80385
- var _b;
80386
- var initiallySelectedIndex = _a.initiallySelectedIndex, size = _a.size, theme = _a.theme, ariaLabel = _a.ariaLabel, children = _a.children, onClick = _a.onClick;
80387
- var _c = React.useState(initiallySelectedIndex !== null && initiallySelectedIndex !== void 0 ? initiallySelectedIndex : 0), index = _c[0], setIndex = _c[1];
80394
+ var Tabs = function (props) {
80395
+ var _a;
80396
+ var initiallySelectedIndex = props.initiallySelectedIndex, size = props.size, theme = props.theme, ariaLabel = props.ariaLabel, children = props.children, onClick = props.onClick;
80397
+ var _b = React.useState(initiallySelectedIndex !== null && initiallySelectedIndex !== void 0 ? initiallySelectedIndex : 0), index = _b[0], setIndex = _b[1];
80388
80398
  function handleSelected(i) {
80389
80399
  setIndex(i);
80390
80400
  handleClick(i);
@@ -80392,11 +80402,11 @@ var Tabs = function (_a) {
80392
80402
  var handleClick = function (i) {
80393
80403
  onClick(i);
80394
80404
  };
80395
- var classes = (0, classnames_1.default)('sd-nav-tabs', (_b = {},
80396
- _b["sd-nav-tabs--".concat(size)] = size && size !== undefined,
80397
- _b['sd-nav-tabs--ui-dark'] = theme === 'dark',
80398
- _b));
80399
- return (React.createElement("div", { className: classes, role: 'tablist', "aria-label": ariaLabel ? ariaLabel : 'tabs' }, children.map(function (item, i) { return (React.createElement("button", { key: i, "aria-controls": 'tabpanel-' + i, className: 'sd-nav-tabs__tab' + (index === i ? ' sd-nav-tabs__tab--active' : ''), onClick: function () { return handleSelected(i); }, role: 'tab', "aria-selected": index === i ? 'true' : 'false' }, item)); })));
80405
+ var classes = (0, classnames_1.default)('sd-nav-tabs', (_a = {},
80406
+ _a["sd-nav-tabs--".concat(size)] = size && size !== undefined,
80407
+ _a['sd-nav-tabs--ui-dark'] = theme === 'dark',
80408
+ _a));
80409
+ return (React.createElement("div", { className: classes, role: 'tablist', "aria-label": ariaLabel ? ariaLabel : 'tabs', "data-test-id": props['data-test-id'] }, children.map(function (item, i) { return (React.createElement("button", { key: i, "aria-controls": 'tabpanel-' + i, className: 'sd-nav-tabs__tab' + (index === i ? ' sd-nav-tabs__tab--active' : ''), onClick: function () { return handleSelected(i); }, role: 'tab', "aria-selected": index === i ? 'true' : 'false' }, item)); })));
80400
80410
  };
80401
80411
  exports.Tabs = Tabs;
80402
80412
  var TabContent = function (_a) {
@@ -143464,7 +143474,7 @@ exports.ResizablePanelsDoc = ResizablePanelsDoc;
143464
143474
  /* 689 */
143465
143475
  /***/ (function(module, exports) {
143466
143476
 
143467
- module.exports = {"name":"superdesk-ui-framework","version":"3.0.54","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","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","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/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","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","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","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":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-12","@superdesk/react-resizable-panels":"0.0.39","@types/enzyme-adapter-react-16":"^1.0.6","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","moment":"^2.29.3","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-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
143477
+ module.exports = {"name":"superdesk-ui-framework","version":"3.0.55","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","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","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/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","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","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","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":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-12","@superdesk/react-resizable-panels":"0.0.39","@types/enzyme-adapter-react-16":"^1.0.6","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","enzyme":"^3.11.0","enzyme-adapter-react-16":"^1.15.7","moment":"^2.29.3","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-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
143468
143478
 
143469
143479
  /***/ }),
143470
143480
  /* 690 */