superdesk-ui-framework 4.0.35 → 4.0.37

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.
Files changed (35) hide show
  1. package/app-typescript/components/DatePicker.tsx +1 -0
  2. package/app-typescript/components/DateTimePicker.tsx +1 -0
  3. package/app-typescript/components/DurationInput.tsx +1 -0
  4. package/app-typescript/components/Form/InputWrapper.tsx +16 -3
  5. package/app-typescript/components/FormLabel.tsx +12 -1
  6. package/app-typescript/components/Input.tsx +3 -1
  7. package/app-typescript/components/MultiSelect.tsx +1 -0
  8. package/app-typescript/components/Select.tsx +1 -0
  9. package/app-typescript/components/SelectWithTemplate.tsx +52 -49
  10. package/app-typescript/components/TagInput.tsx +1 -0
  11. package/app-typescript/components/TimePicker.tsx +1 -0
  12. package/app-typescript/components/TimePickerV2.tsx +1 -0
  13. package/app-typescript/components/TreeMenu.tsx +13 -1
  14. package/app-typescript/components/TreeSelect/TreeSelect.tsx +1 -0
  15. package/dist/examples.bundle.js +41 -18
  16. package/dist/superdesk-ui.bundle.js +40 -17
  17. package/package.json +1 -1
  18. package/react/components/DatePicker.js +1 -1
  19. package/react/components/DateTimePicker.js +1 -1
  20. package/react/components/DurationInput.js +1 -1
  21. package/react/components/Form/InputWrapper.d.ts +10 -3
  22. package/react/components/Form/InputWrapper.js +8 -4
  23. package/react/components/FormLabel.d.ts +1 -0
  24. package/react/components/FormLabel.js +8 -1
  25. package/react/components/Input.d.ts +2 -1
  26. package/react/components/Input.js +1 -1
  27. package/react/components/MultiSelect.js +1 -1
  28. package/react/components/Select.js +1 -1
  29. package/react/components/SelectWithTemplate.js +1 -1
  30. package/react/components/TagInput.js +1 -1
  31. package/react/components/TimePicker.js +1 -1
  32. package/react/components/TimePickerV2.js +1 -1
  33. package/react/components/TreeMenu.d.ts +1 -1
  34. package/react/components/TreeMenu.js +13 -1
  35. package/react/components/TreeSelect/TreeSelect.js +1 -1
@@ -164,6 +164,7 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
164
164
  labelHidden={this.props.labelHidden}
165
165
  htmlId={this.htmlId}
166
166
  tabindex={this.props.tabindex}
167
+ inputWrapper={this.props.inputWrapper}
167
168
  >
168
169
  <Calendar
169
170
  className='sd-input__input'
@@ -75,6 +75,7 @@ export class DateTimePicker extends React.PureComponent<IProps> {
75
75
  htmlId={this.htmlId}
76
76
  tabindex={this.props.tabindex}
77
77
  fullWidth={this.props.fullWidth}
78
+ inputWrapper={this.props.inputWrapper}
78
79
  data-test-id={this.props["data-test-id"]}
79
80
  ref={this.props.ref}
80
81
  >
@@ -312,6 +312,7 @@ export class DurationInput extends React.PureComponent<IProps, IState> {
312
312
  labelHidden={this.props.labelHidden}
313
313
  htmlId={this.htmlId}
314
314
  tabindex={this.props.tabindex}
315
+ inputWrapper={this.props.inputWrapper}
315
316
  >
316
317
  <div className={'sd-input__duration-input'}>
317
318
  <input
@@ -25,9 +25,14 @@ export interface IInputCommon {
25
25
 
26
26
  export interface IInputWrapper extends IInputCommon {
27
27
  invalid?: boolean;
28
+
29
+ inputWrapper?: {
30
+ kind: 'custom'; // added to allow union types later
31
+ component: React.ComponentType<{label: string; input: React.ReactNode}>;
32
+ };
28
33
  }
29
34
 
30
- interface IPropsBase extends IInputWrapper {
35
+ interface IProps extends IInputWrapper {
31
36
  children: React.ReactNode;
32
37
  maxLength?: number;
33
38
  value?: string | number;
@@ -40,8 +45,8 @@ interface IState {
40
45
  value: string | number;
41
46
  }
42
47
 
43
- export class InputWrapper extends React.Component<IPropsBase, IState> {
44
- constructor(props: IPropsBase) {
48
+ export class InputWrapper extends React.Component<IProps, IState> {
49
+ constructor(props: IProps) {
45
50
  super(props);
46
51
 
47
52
  this.state = {
@@ -50,6 +55,14 @@ export class InputWrapper extends React.Component<IPropsBase, IState> {
50
55
  }
51
56
 
52
57
  render() {
58
+ if (this.props.inputWrapper?.kind === 'custom') {
59
+ const Component = this.props.inputWrapper.component;
60
+
61
+ return (
62
+ <Component input={this.props.children} label={this.props.label ?? ''} />
63
+ );
64
+ }
65
+
53
66
  const fullWidth = this.props.fullWidth ?? true;
54
67
 
55
68
  const classes = classNames('sd-input', {
@@ -5,6 +5,7 @@ interface IProps {
5
5
  text: string;
6
6
  style?: 'normal' | 'light'; // defaults to normal
7
7
  noMinHeight?: boolean;
8
+ noMinWidth?: boolean;
8
9
  }
9
10
 
10
11
  export class FormLabel extends React.PureComponent<IProps> {
@@ -14,10 +15,20 @@ export class FormLabel extends React.PureComponent<IProps> {
14
15
 
15
16
  });
16
17
 
18
+ const style: React.CSSProperties = {};
19
+
20
+ if (this.props.noMinWidth) {
21
+ style.minWidth = 'auto';
22
+ }
23
+
24
+ if (this.props.noMinHeight) {
25
+ style.minHeight = 'auto';
26
+ }
27
+
17
28
  return (
18
29
  <label
19
30
  className={classes}
20
- style={this.props.noMinHeight === true ? {minHeight: 'auto'} : undefined}
31
+ style={style}
21
32
  >
22
33
  {this.props.text}
23
34
  </label>
@@ -1,12 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import nextId from "react-id-generator";
3
- import {IInputCommon, InputWrapper} from './Form/InputWrapper';
3
+ import {IInputCommon, IInputWrapper, InputWrapper} from './Form/InputWrapper';
4
4
 
5
5
  interface IPropsBase extends IInputCommon {
6
6
  maxLength?: number;
7
7
  placeholder?: string;
8
8
  size?: 'medium' | 'large' | 'x-large'; // default: 'medium'
9
9
  'data-test-id'?: string;
10
+ inputWrapper?: IInputWrapper['inputWrapper'];
10
11
  }
11
12
 
12
13
  interface IPropsText extends IPropsBase {
@@ -73,6 +74,7 @@ export class Input extends React.Component<IProps> {
73
74
  boxedStyle={this.props.boxedStyle}
74
75
  boxedLable={this.props.boxedLable}
75
76
  tabindex={this.props.tabindex}
77
+ inputWrapper={this.props.inputWrapper}
76
78
  >
77
79
  <input
78
80
  className='sd-input__input'
@@ -74,6 +74,7 @@ export class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
74
74
  labelHidden={this.props.labelHidden}
75
75
  htmlId={this.htmlId}
76
76
  tabindex={this.props.tabindex}
77
+ inputWrapper={this.props.inputWrapper}
77
78
  >
78
79
  <PrimeMultiSelect
79
80
  panelClassName={classes}
@@ -44,6 +44,7 @@ class Select extends React.Component<ISelect> {
44
44
  fullWidth={this.props.fullWidth}
45
45
  htmlId={this.htmlId}
46
46
  tabindex={this.props.tabindex}
47
+ inputWrapper={this.props.inputWrapper}
47
48
  >
48
49
  <span className='sd-input__select-caret-wrapper'>
49
50
  <select
@@ -94,57 +94,60 @@ export class SelectWithTemplate<T> extends React.Component<IProps<T>, IState<T>>
94
94
 
95
95
  return (
96
96
  <InputWrapper
97
- label={this.props.label}
98
- error={this.props.error}
99
- required={this.props.required}
100
- disabled={this.props.disabled}
101
- invalid={this.state.invalid}
102
- info={this.props.info}
103
- inlineLabel={this.props.inlineLabel}
104
- labelHidden={this.props.labelHidden}
105
- fullWidth={this.props.fullWidth}
106
- htmlId={this.htmlId}
107
- tabindex={this.props.tabindex}>
97
+ label={this.props.label}
98
+ error={this.props.error}
99
+ required={this.props.required}
100
+ disabled={this.props.disabled}
101
+ invalid={this.state.invalid}
102
+ info={this.props.info}
103
+ inlineLabel={this.props.inlineLabel}
104
+ labelHidden={this.props.labelHidden}
105
+ fullWidth={this.props.fullWidth}
106
+ htmlId={this.htmlId}
107
+ tabindex={this.props.tabindex}
108
+ inputWrapper={this.props.inputWrapper}
109
+ >
108
110
  <Dropdown
109
- inputId={this.htmlId}
110
- ariaLabelledBy={this.htmlId + 'label'}
111
- value={valueInternal}
112
- options={optionsInternal}
113
- onChange={(e) => {
114
- onChange(e.value == null ? null : e.value.original);
115
- }}
116
- placeholder={fakePlaceholderWithNonBreakingSpace}
117
- filterPlaceholder={filterPlaceholder}
118
- filter
119
- filterBy={labelKey}
120
- showClear={!required}
121
- emptyFilterMessage={emptyFilterMessage}
122
- itemTemplate={(option) => <ItemTemplate option={option?.original ?? null} />}
123
- valueTemplate={(option) => ValueTemplate != null
124
- ? (
125
- <ValueTemplate option={option?.original ?? null} />
111
+ inputId={this.htmlId}
112
+ ariaLabelledBy={this.htmlId + 'label'}
113
+ value={valueInternal}
114
+ options={optionsInternal}
115
+ onChange={(e) => {
116
+ onChange(e.value == null ? null : e.value.original);
117
+ }}
118
+ placeholder={fakePlaceholderWithNonBreakingSpace}
119
+ filterPlaceholder={filterPlaceholder}
120
+ filter
121
+ filterBy={labelKey}
122
+ showClear={!required}
123
+ emptyFilterMessage={emptyFilterMessage}
124
+ itemTemplate={(option) => <ItemTemplate option={option?.original ?? null} />}
125
+ valueTemplate={(option) => ValueTemplate != null
126
+ ? (
127
+ <ValueTemplate option={option?.original ?? null} />
126
128
 
127
- )
128
- : (
129
- <ItemTemplate option={option?.original ?? null} />
130
- )
131
- }
132
- disabled={disabled}
133
- required={required}
134
- autoFocus={autoFocus}
135
- appendTo={document.body}
136
- loading={loading}
137
- onFilterInputChange={(searchString) => {
138
- this.setState({loading: true});
139
- getItems(searchString).then((_options) => {
140
- this.setState({options: _options, loading: false});
141
- });
142
- }}
143
- zIndex={zIndex}
144
- style={width === '100%' ? {display: 'flex', width: '100%'} : {}}
145
- ref={(componentRef) => {
146
- this.componentRef = componentRef;
147
- }}/>
129
+ )
130
+ : (
131
+ <ItemTemplate option={option?.original ?? null} />
132
+ )
133
+ }
134
+ disabled={disabled}
135
+ required={required}
136
+ autoFocus={autoFocus}
137
+ appendTo={document.body}
138
+ loading={loading}
139
+ onFilterInputChange={(searchString) => {
140
+ this.setState({loading: true});
141
+ getItems(searchString).then((_options) => {
142
+ this.setState({options: _options, loading: false});
143
+ });
144
+ }}
145
+ zIndex={zIndex}
146
+ style={width === '100%' ? {display: 'flex', width: '100%'} : {}}
147
+ ref={(componentRef) => {
148
+ this.componentRef = componentRef;
149
+ }}
150
+ />
148
151
  </InputWrapper>
149
152
  );
150
153
  }
@@ -39,6 +39,7 @@ export class TagInput extends React.Component<IProps> {
39
39
  labelHidden={this.props.labelHidden}
40
40
  htmlId={this.htmlId}
41
41
  tabindex={this.props.tabindex}
42
+ inputWrapper={this.props.inputWrapper}
42
43
  >
43
44
  <Chips
44
45
  className={`
@@ -34,6 +34,7 @@ export class TimePicker extends React.PureComponent<IProps> {
34
34
  labelHidden={this.props.labelHidden}
35
35
  htmlId={this.htmlId}
36
36
  tabindex={this.props.tabindex}
37
+ inputWrapper={this.props.inputWrapper}
37
38
  >
38
39
  <input
39
40
  value={this.props.value}
@@ -147,6 +147,7 @@ export class TimePickerV2 extends React.PureComponent<IProps> {
147
147
  inlineLabel={this.props.inlineLabel}
148
148
  labelHidden={this.props.labelHidden}
149
149
  tabindex={this.props.tabindex}
150
+ inputWrapper={this.props.inputWrapper}
150
151
  >
151
152
  <div className='sd__input__time-picker-v2' data-test-id={this.props['data-test-id']}>
152
153
  <div className='input-wrapper__time-picker-v2'>
@@ -180,7 +180,7 @@ export class TreeMenu<T> extends React.Component<IProps<T>, IState<T>> {
180
180
  document.addEventListener("keydown", this.onPressEsc);
181
181
  }
182
182
 
183
- componentDidUpdate(_prevProps: Readonly<IProps<T>>, prevState: Readonly<IState<T>>): void {
183
+ componentDidUpdate(prevProps: Readonly<IProps<T>>, prevState: Readonly<IState<T>>): void {
184
184
  if (prevState.openDropdown !== this.state.openDropdown) {
185
185
  this.toggleMenu();
186
186
  }
@@ -192,6 +192,18 @@ export class TreeMenu<T> extends React.Component<IProps<T>, IState<T>> {
192
192
  ) {
193
193
  this.popperInstance?.update();
194
194
  }
195
+
196
+ // Update options when getOptions prop is updated
197
+ if (this.props.getOptions && prevProps.getOptions !== this.props.getOptions) {
198
+ const newOptions = this.props.getOptions();
199
+ this.setState({
200
+ options: newOptions,
201
+ firstBranchOptions: newOptions,
202
+ filterArr: [],
203
+ }, () => {
204
+ this.recursion(newOptions);
205
+ });
206
+ }
195
207
  }
196
208
 
197
209
  toggleMenu() {
@@ -725,6 +725,7 @@ export class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
725
725
  tabindex={this.props.tabindex}
726
726
  fullWidth={this.props.fullWidth}
727
727
  data-test-id={this.props['data-test-id']}
728
+ inputWrapper={this.props.inputWrapper}
728
729
  >
729
730
  <div
730
731
  className={`
@@ -28282,7 +28282,7 @@ var DatePicker = /** @class */ (function (_super) {
28282
28282
  var showClearButton = this.props.required === true
28283
28283
  ? false
28284
28284
  : this.props.hideClearButton !== true;
28285
- 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 },
28285
+ 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, inputWrapper: this.props.inputWrapper },
28286
28286
  React.createElement(calendar_1.Calendar, { className: 'sd-input__input', footerTemplate: showClearButton ? function () { return (React.createElement("div", { className: 'd-flex justify-end' },
28287
28287
  React.createElement(Button_1.Button, { onClick: function () {
28288
28288
  _this.props.onChange(null);
@@ -43586,7 +43586,7 @@ var DurationInput = /** @class */ (function (_super) {
43586
43586
  React.createElement("span", { className: 'duration-input-preview' }, this.state.seconds),
43587
43587
  React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
43588
43588
  }
43589
- 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 },
43589
+ 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, inputWrapper: this.props.inputWrapper },
43590
43590
  React.createElement("div", { className: 'sd-input__duration-input' },
43591
43591
  React.createElement("input", { className: "duration-input ".concat(this.state.blink === 'hour' ? 'blink_me' : ''), type: 'text', id: 'hours', autoComplete: "off", max: 99, min: 0, ref: this.hourRef, value: this.state.hours, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.minuteRef.current); }, onChange: function (event) { _this.handleChange(event, 'hours'); }, onBlur: function (event) { return _this.setState({ hours: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
43592
43592
  if (!/[0-9]/.test(event.key)) {
@@ -43717,7 +43717,7 @@ var TimePicker = /** @class */ (function (_super) {
43717
43717
  return (React.createElement("div", null,
43718
43718
  React.createElement("span", null, this.props.value)));
43719
43719
  }
43720
- 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 },
43720
+ 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, inputWrapper: this.props.inputWrapper },
43721
43721
  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) {
43722
43722
  _this.props.onChange(event.target.value);
43723
43723
  }, "data-test-id": this.props['data-test-id'] })));
@@ -44796,8 +44796,12 @@ var InputWrapper = /** @class */ (function (_super) {
44796
44796
  }
44797
44797
  InputWrapper.prototype.render = function () {
44798
44798
  var _a;
44799
- var _b, _c;
44800
- var fullWidth = (_b = this.props.fullWidth) !== null && _b !== void 0 ? _b : true;
44799
+ var _b, _c, _d, _e;
44800
+ if (((_b = this.props.inputWrapper) === null || _b === void 0 ? void 0 : _b.kind) === 'custom') {
44801
+ var Component = this.props.inputWrapper.component;
44802
+ return (React.createElement(Component, { input: this.props.children, label: (_c = this.props.label) !== null && _c !== void 0 ? _c : '' }));
44803
+ }
44804
+ var fullWidth = (_d = this.props.fullWidth) !== null && _d !== void 0 ? _d : true;
44801
44805
  var classes = (0, classnames_1.default)('sd-input', (_a = {
44802
44806
  'sd-input--inline-label': this.props.inlineLabel,
44803
44807
  'sd-input--required': this.props.required,
@@ -44819,8 +44823,8 @@ var InputWrapper = /** @class */ (function (_super) {
44819
44823
  React.createElement("label", { className: labelClasses, htmlFor: this.props.htmlId, id: this.props.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
44820
44824
  React.createElement("div", { className: "sd-input__input-container" }, this.props.children),
44821
44825
  this.props.maxLength
44822
- && React.createElement("div", { className: 'sd-input__char-count' }, (_c = this.props.value) === null || _c === void 0 ? void 0 :
44823
- _c.toString().length,
44826
+ && React.createElement("div", { className: 'sd-input__char-count' }, (_e = this.props.value) === null || _e === void 0 ? void 0 :
44827
+ _e.toString().length,
44824
44828
  " / ",
44825
44829
  this.props.maxLength),
44826
44830
  React.createElement("div", { className: 'sd-input__message-box' },
@@ -78167,7 +78171,7 @@ var TimePickerV2 = /** @class */ (function (_super) {
78167
78171
  TimePickerV2.prototype.render = function () {
78168
78172
  var _this = this;
78169
78173
  var timeUnitValuesArray = this.updatedTimeUnit();
78170
- 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, tabindex: this.props.tabindex },
78174
+ 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, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
78171
78175
  React.createElement("div", { className: 'sd__input__time-picker-v2', "data-test-id": this.props['data-test-id'] },
78172
78176
  React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
78173
78177
  React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[0], onChange: function (_a) {
@@ -78273,7 +78277,7 @@ var TagInput = /** @class */ (function (_super) {
78273
78277
  if (this.props.preview) {
78274
78278
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.props.value, getLabel: function (item) { return item; } }));
78275
78279
  }
78276
- 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 },
78280
+ 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, inputWrapper: this.props.inputWrapper },
78277
78281
  React.createElement(chips_1.Chips, { className: "\n tags-input--multi-select sd-input__input\n ".concat(this.props.disabled ? ' tags-input__padding-disabled' : ''), allowDuplicate: false, separator: ",", onChange: function (event) { return onChange(event.value); }, value: value, placeholder: this.props.disabled ? undefined : placeholder, disabled: this.props.disabled })));
78278
78282
  };
78279
78283
  return TagInput;
@@ -79144,7 +79148,7 @@ var TreeSelect = /** @class */ (function (_super) {
79144
79148
  var children = _a.children;
79145
79149
  return React.createElement(React.Fragment, null, children);
79146
79150
  };
79147
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'] },
79151
+ 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'], inputWrapper: this.props.inputWrapper },
79148
79152
  React.createElement("div", { className: "\n tags-input sd-input__input\n tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef, "data-test-id": this.props.allowMultiple ? undefined : 'open-popover' }, this.props.allowMultiple
79149
79153
  ? React.createElement("div", { className: "tags-input__tags" },
79150
79154
  this.props.readOnly
@@ -79448,7 +79452,8 @@ var TreeMenu = /** @class */ (function (_super) {
79448
79452
  document.removeEventListener("keydown", this.onKeyDown);
79449
79453
  document.addEventListener("keydown", this.onPressEsc);
79450
79454
  };
79451
- TreeMenu.prototype.componentDidUpdate = function (_prevProps, prevState) {
79455
+ TreeMenu.prototype.componentDidUpdate = function (prevProps, prevState) {
79456
+ var _this = this;
79452
79457
  var _a;
79453
79458
  if (prevState.openDropdown !== this.state.openDropdown) {
79454
79459
  this.toggleMenu();
@@ -79458,6 +79463,17 @@ var TreeMenu = /** @class */ (function (_super) {
79458
79463
  || (prevState.options !== this.state.options)) {
79459
79464
  (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
79460
79465
  }
79466
+ // Update options when getOptions prop is updated
79467
+ if (this.props.getOptions && prevProps.getOptions !== this.props.getOptions) {
79468
+ var newOptions_1 = this.props.getOptions();
79469
+ this.setState({
79470
+ options: newOptions_1,
79471
+ firstBranchOptions: newOptions_1,
79472
+ filterArr: [],
79473
+ }, function () {
79474
+ _this.recursion(newOptions_1);
79475
+ });
79476
+ }
79461
79477
  };
79462
79478
  TreeMenu.prototype.toggleMenu = function () {
79463
79479
  var _this = this;
@@ -84164,7 +84180,7 @@ var Input = /** @class */ (function (_super) {
84164
84180
  return (React.createElement("div", null,
84165
84181
  React.createElement("span", null, this.props.value)));
84166
84182
  }
84167
- 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 },
84183
+ 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, inputWrapper: this.props.inputWrapper },
84168
84184
  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'] })));
84169
84185
  };
84170
84186
  return Input;
@@ -84240,7 +84256,7 @@ var Select = /** @class */ (function (_super) {
84240
84256
  return (React.createElement("div", null,
84241
84257
  React.createElement("span", null, this.props.value)));
84242
84258
  }
84243
- 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
84259
+ 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
84244
84260
  React.createElement("span", { className: 'sd-input__select-caret-wrapper' },
84245
84261
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled || this.props.readonly, "data-test-id": this.props['data-test-id'] }, this.props.children))));
84246
84262
  };
@@ -84905,7 +84921,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
84905
84921
  // needs to be passed to prime react component
84906
84922
  // or it will not be displayed at all, even if returned by itemTemplate
84907
84923
  var fakePlaceholderWithNonBreakingSpace = ' ';
84908
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
84924
+ return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
84909
84925
  React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
84910
84926
  onChange(e.value == null ? null : e.value.original);
84911
84927
  }, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage, itemTemplate: function (option) { var _a; return React.createElement(ItemTemplate, { option: (_a = option === null || option === void 0 ? void 0 : option.original) !== null && _a !== void 0 ? _a : null }); }, valueTemplate: function (option) {
@@ -125808,7 +125824,7 @@ var DateTimePicker = /** @class */ (function (_super) {
125808
125824
  var convertedTimeValue = this.props.value != null
125809
125825
  ? "".concat(this.prepareFormat(this.props.value.getHours()), ":").concat(this.prepareFormat(this.props.value.getMinutes()))
125810
125826
  : "";
125811
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
125827
+ 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, fullWidth: this.props.fullWidth, inputWrapper: this.props.inputWrapper, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
125812
125828
  React.createElement(common_1.Spacer, { h: true, gap: "8", alignItems: "end", noWrap: true },
125813
125829
  React.createElement("div", { style: { flexGrow: 1 } },
125814
125830
  React.createElement(DatePicker_1.DatePicker, { disabled: this.props.disabled, preview: this.props.preview, required: this.props.required, hideClearButton: true, value: this.props.value, onChange: function (val) {
@@ -125887,7 +125903,14 @@ var FormLabel = /** @class */ (function (_super) {
125887
125903
  var classes = (0, classnames_1.default)('form-label form-label--block', {
125888
125904
  'form-label--light': this.props.style === 'light',
125889
125905
  });
125890
- return (React.createElement("label", { className: classes, style: this.props.noMinHeight === true ? { minHeight: 'auto' } : undefined }, this.props.text));
125906
+ var style = {};
125907
+ if (this.props.noMinWidth) {
125908
+ style.minWidth = 'auto';
125909
+ }
125910
+ if (this.props.noMinHeight) {
125911
+ style.minHeight = 'auto';
125912
+ }
125913
+ return (React.createElement("label", { className: classes, style: style }, this.props.text));
125891
125914
  };
125892
125915
  return FormLabel;
125893
125916
  }(React.PureComponent));
@@ -156388,7 +156411,7 @@ var MultiSelect = /** @class */ (function (_super) {
156388
156411
  if (this.props.preview) {
156389
156412
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
156390
156413
  }
156391
- 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 },
156414
+ 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, inputWrapper: this.props.inputWrapper },
156392
156415
  React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
156393
156416
  var value = _a.value;
156394
156417
  return _this.props.onChange(value);
@@ -186344,7 +186367,7 @@ exports.ThreePaneLayoutPattern = ThreePaneLayoutPattern;
186344
186367
  /* 938 */
186345
186368
  /***/ (function(module, exports) {
186346
186369
 
186347
- module.exports = {"name":"superdesk-ui-framework","version":"4.0.35","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-13","@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"}}
186370
+ module.exports = {"name":"superdesk-ui-framework","version":"4.0.37","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-13","@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"}}
186348
186371
 
186349
186372
  /***/ }),
186350
186373
  /* 939 */
@@ -27786,7 +27786,7 @@ var DatePicker = /** @class */ (function (_super) {
27786
27786
  var showClearButton = this.props.required === true
27787
27787
  ? false
27788
27788
  : this.props.hideClearButton !== true;
27789
- 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 },
27789
+ 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, inputWrapper: this.props.inputWrapper },
27790
27790
  React.createElement(calendar_1.Calendar, { className: 'sd-input__input', footerTemplate: showClearButton ? function () { return (React.createElement("div", { className: 'd-flex justify-end' },
27791
27791
  React.createElement(Button_1.Button, { onClick: function () {
27792
27792
  _this.props.onChange(null);
@@ -43090,7 +43090,7 @@ var DurationInput = /** @class */ (function (_super) {
43090
43090
  React.createElement("span", { className: 'duration-input-preview' }, this.state.seconds),
43091
43091
  React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
43092
43092
  }
43093
- 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 },
43093
+ 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, inputWrapper: this.props.inputWrapper },
43094
43094
  React.createElement("div", { className: 'sd-input__duration-input' },
43095
43095
  React.createElement("input", { className: "duration-input ".concat(this.state.blink === 'hour' ? 'blink_me' : ''), type: 'text', id: 'hours', autoComplete: "off", max: 99, min: 0, ref: this.hourRef, value: this.state.hours, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.minuteRef.current); }, onChange: function (event) { _this.handleChange(event, 'hours'); }, onBlur: function (event) { return _this.setState({ hours: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
43096
43096
  if (!/[0-9]/.test(event.key)) {
@@ -43221,7 +43221,7 @@ var TimePicker = /** @class */ (function (_super) {
43221
43221
  return (React.createElement("div", null,
43222
43222
  React.createElement("span", null, this.props.value)));
43223
43223
  }
43224
- 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 },
43224
+ 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, inputWrapper: this.props.inputWrapper },
43225
43225
  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) {
43226
43226
  _this.props.onChange(event.target.value);
43227
43227
  }, "data-test-id": this.props['data-test-id'] })));
@@ -44300,8 +44300,12 @@ var InputWrapper = /** @class */ (function (_super) {
44300
44300
  }
44301
44301
  InputWrapper.prototype.render = function () {
44302
44302
  var _a;
44303
- var _b, _c;
44304
- var fullWidth = (_b = this.props.fullWidth) !== null && _b !== void 0 ? _b : true;
44303
+ var _b, _c, _d, _e;
44304
+ if (((_b = this.props.inputWrapper) === null || _b === void 0 ? void 0 : _b.kind) === 'custom') {
44305
+ var Component = this.props.inputWrapper.component;
44306
+ return (React.createElement(Component, { input: this.props.children, label: (_c = this.props.label) !== null && _c !== void 0 ? _c : '' }));
44307
+ }
44308
+ var fullWidth = (_d = this.props.fullWidth) !== null && _d !== void 0 ? _d : true;
44305
44309
  var classes = (0, classnames_1.default)('sd-input', (_a = {
44306
44310
  'sd-input--inline-label': this.props.inlineLabel,
44307
44311
  'sd-input--required': this.props.required,
@@ -44323,8 +44327,8 @@ var InputWrapper = /** @class */ (function (_super) {
44323
44327
  React.createElement("label", { className: labelClasses, htmlFor: this.props.htmlId, id: this.props.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
44324
44328
  React.createElement("div", { className: "sd-input__input-container" }, this.props.children),
44325
44329
  this.props.maxLength
44326
- && React.createElement("div", { className: 'sd-input__char-count' }, (_c = this.props.value) === null || _c === void 0 ? void 0 :
44327
- _c.toString().length,
44330
+ && React.createElement("div", { className: 'sd-input__char-count' }, (_e = this.props.value) === null || _e === void 0 ? void 0 :
44331
+ _e.toString().length,
44328
44332
  " / ",
44329
44333
  this.props.maxLength),
44330
44334
  React.createElement("div", { className: 'sd-input__message-box' },
@@ -77288,7 +77292,7 @@ var TimePickerV2 = /** @class */ (function (_super) {
77288
77292
  TimePickerV2.prototype.render = function () {
77289
77293
  var _this = this;
77290
77294
  var timeUnitValuesArray = this.updatedTimeUnit();
77291
- 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, tabindex: this.props.tabindex },
77295
+ 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, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
77292
77296
  React.createElement("div", { className: 'sd__input__time-picker-v2', "data-test-id": this.props['data-test-id'] },
77293
77297
  React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
77294
77298
  React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[0], onChange: function (_a) {
@@ -77394,7 +77398,7 @@ var TagInput = /** @class */ (function (_super) {
77394
77398
  if (this.props.preview) {
77395
77399
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.props.value, getLabel: function (item) { return item; } }));
77396
77400
  }
77397
- 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 },
77401
+ 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, inputWrapper: this.props.inputWrapper },
77398
77402
  React.createElement(chips_1.Chips, { className: "\n tags-input--multi-select sd-input__input\n ".concat(this.props.disabled ? ' tags-input__padding-disabled' : ''), allowDuplicate: false, separator: ",", onChange: function (event) { return onChange(event.value); }, value: value, placeholder: this.props.disabled ? undefined : placeholder, disabled: this.props.disabled })));
77399
77403
  };
77400
77404
  return TagInput;
@@ -78265,7 +78269,7 @@ var TreeSelect = /** @class */ (function (_super) {
78265
78269
  var children = _a.children;
78266
78270
  return React.createElement(React.Fragment, null, children);
78267
78271
  };
78268
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'] },
78272
+ 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'], inputWrapper: this.props.inputWrapper },
78269
78273
  React.createElement("div", { className: "\n tags-input sd-input__input\n tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef, "data-test-id": this.props.allowMultiple ? undefined : 'open-popover' }, this.props.allowMultiple
78270
78274
  ? React.createElement("div", { className: "tags-input__tags" },
78271
78275
  this.props.readOnly
@@ -78569,7 +78573,8 @@ var TreeMenu = /** @class */ (function (_super) {
78569
78573
  document.removeEventListener("keydown", this.onKeyDown);
78570
78574
  document.addEventListener("keydown", this.onPressEsc);
78571
78575
  };
78572
- TreeMenu.prototype.componentDidUpdate = function (_prevProps, prevState) {
78576
+ TreeMenu.prototype.componentDidUpdate = function (prevProps, prevState) {
78577
+ var _this = this;
78573
78578
  var _a;
78574
78579
  if (prevState.openDropdown !== this.state.openDropdown) {
78575
78580
  this.toggleMenu();
@@ -78579,6 +78584,17 @@ var TreeMenu = /** @class */ (function (_super) {
78579
78584
  || (prevState.options !== this.state.options)) {
78580
78585
  (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
78581
78586
  }
78587
+ // Update options when getOptions prop is updated
78588
+ if (this.props.getOptions && prevProps.getOptions !== this.props.getOptions) {
78589
+ var newOptions_1 = this.props.getOptions();
78590
+ this.setState({
78591
+ options: newOptions_1,
78592
+ firstBranchOptions: newOptions_1,
78593
+ filterArr: [],
78594
+ }, function () {
78595
+ _this.recursion(newOptions_1);
78596
+ });
78597
+ }
78582
78598
  };
78583
78599
  TreeMenu.prototype.toggleMenu = function () {
78584
78600
  var _this = this;
@@ -83285,7 +83301,7 @@ var Input = /** @class */ (function (_super) {
83285
83301
  return (React.createElement("div", null,
83286
83302
  React.createElement("span", null, this.props.value)));
83287
83303
  }
83288
- 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 },
83304
+ 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, inputWrapper: this.props.inputWrapper },
83289
83305
  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'] })));
83290
83306
  };
83291
83307
  return Input;
@@ -83361,7 +83377,7 @@ var Select = /** @class */ (function (_super) {
83361
83377
  return (React.createElement("div", null,
83362
83378
  React.createElement("span", null, this.props.value)));
83363
83379
  }
83364
- 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
83380
+ 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
83365
83381
  React.createElement("span", { className: 'sd-input__select-caret-wrapper' },
83366
83382
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled || this.props.readonly, "data-test-id": this.props['data-test-id'] }, this.props.children))));
83367
83383
  };
@@ -84026,7 +84042,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
84026
84042
  // needs to be passed to prime react component
84027
84043
  // or it will not be displayed at all, even if returned by itemTemplate
84028
84044
  var fakePlaceholderWithNonBreakingSpace = ' ';
84029
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
84045
+ return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
84030
84046
  React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
84031
84047
  onChange(e.value == null ? null : e.value.original);
84032
84048
  }, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage, itemTemplate: function (option) { var _a; return React.createElement(ItemTemplate, { option: (_a = option === null || option === void 0 ? void 0 : option.original) !== null && _a !== void 0 ? _a : null }); }, valueTemplate: function (option) {
@@ -124929,7 +124945,7 @@ var DateTimePicker = /** @class */ (function (_super) {
124929
124945
  var convertedTimeValue = this.props.value != null
124930
124946
  ? "".concat(this.prepareFormat(this.props.value.getHours()), ":").concat(this.prepareFormat(this.props.value.getMinutes()))
124931
124947
  : "";
124932
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
124948
+ 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, fullWidth: this.props.fullWidth, inputWrapper: this.props.inputWrapper, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
124933
124949
  React.createElement(common_1.Spacer, { h: true, gap: "8", alignItems: "end", noWrap: true },
124934
124950
  React.createElement("div", { style: { flexGrow: 1 } },
124935
124951
  React.createElement(DatePicker_1.DatePicker, { disabled: this.props.disabled, preview: this.props.preview, required: this.props.required, hideClearButton: true, value: this.props.value, onChange: function (val) {
@@ -125008,7 +125024,14 @@ var FormLabel = /** @class */ (function (_super) {
125008
125024
  var classes = (0, classnames_1.default)('form-label form-label--block', {
125009
125025
  'form-label--light': this.props.style === 'light',
125010
125026
  });
125011
- return (React.createElement("label", { className: classes, style: this.props.noMinHeight === true ? { minHeight: 'auto' } : undefined }, this.props.text));
125027
+ var style = {};
125028
+ if (this.props.noMinWidth) {
125029
+ style.minWidth = 'auto';
125030
+ }
125031
+ if (this.props.noMinHeight) {
125032
+ style.minHeight = 'auto';
125033
+ }
125034
+ return (React.createElement("label", { className: classes, style: style }, this.props.text));
125012
125035
  };
125013
125036
  return FormLabel;
125014
125037
  }(React.PureComponent));
@@ -155509,7 +155532,7 @@ var MultiSelect = /** @class */ (function (_super) {
155509
155532
  if (this.props.preview) {
155510
155533
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
155511
155534
  }
155512
- 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 },
155535
+ 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, inputWrapper: this.props.inputWrapper },
155513
155536
  React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
155514
155537
  var value = _a.value;
155515
155538
  return _this.props.onChange(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "4.0.35",
3
+ "version": "4.0.37",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -140,7 +140,7 @@ var DatePicker = /** @class */ (function (_super) {
140
140
  var showClearButton = this.props.required === true
141
141
  ? false
142
142
  : this.props.hideClearButton !== true;
143
- 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 },
143
+ 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, inputWrapper: this.props.inputWrapper },
144
144
  React.createElement(calendar_1.Calendar, { className: 'sd-input__input', footerTemplate: showClearButton ? function () { return (React.createElement("div", { className: 'd-flex justify-end' },
145
145
  React.createElement(Button_1.Button, { onClick: function () {
146
146
  _this.props.onChange(null);
@@ -84,7 +84,7 @@ var DateTimePicker = /** @class */ (function (_super) {
84
84
  var convertedTimeValue = this.props.value != null
85
85
  ? "".concat(this.prepareFormat(this.props.value.getHours()), ":").concat(this.prepareFormat(this.props.value.getMinutes()))
86
86
  : "";
87
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
87
+ 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, fullWidth: this.props.fullWidth, inputWrapper: this.props.inputWrapper, "data-test-id": this.props["data-test-id"], ref: this.props.ref },
88
88
  React.createElement(common_1.Spacer, { h: true, gap: "8", alignItems: "end", noWrap: true },
89
89
  React.createElement("div", { style: { flexGrow: 1 } },
90
90
  React.createElement(DatePicker_1.DatePicker, { disabled: this.props.disabled, preview: this.props.preview, required: this.props.required, hideClearButton: true, value: this.props.value, onChange: function (val) {
@@ -316,7 +316,7 @@ var DurationInput = /** @class */ (function (_super) {
316
316
  React.createElement("span", { className: 'duration-input-preview' }, this.state.seconds),
317
317
  React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
318
318
  }
319
- 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 },
319
+ 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, inputWrapper: this.props.inputWrapper },
320
320
  React.createElement("div", { className: 'sd-input__duration-input' },
321
321
  React.createElement("input", { className: "duration-input ".concat(this.state.blink === 'hour' ? 'blink_me' : ''), type: 'text', id: 'hours', autoComplete: "off", max: 99, min: 0, ref: this.hourRef, value: this.state.hours, disabled: this.props.disabled, onKeyDown: function (event) { return _this.handleKeyDown(event); }, onKeyUp: function (event) { return _this.handleFocusOnKeyUp(event, _this.minuteRef.current); }, onChange: function (event) { _this.handleChange(event, 'hours'); }, onBlur: function (event) { return _this.setState({ hours: _this.zeroPad(event.target.value) }); }, onKeyPress: function (event) {
322
322
  if (!/[0-9]/.test(event.key)) {
@@ -20,8 +20,15 @@ export interface IInputCommon {
20
20
  }
21
21
  export interface IInputWrapper extends IInputCommon {
22
22
  invalid?: boolean;
23
+ inputWrapper?: {
24
+ kind: 'custom';
25
+ component: React.ComponentType<{
26
+ label: string;
27
+ input: React.ReactNode;
28
+ }>;
29
+ };
23
30
  }
24
- interface IPropsBase extends IInputWrapper {
31
+ interface IProps extends IInputWrapper {
25
32
  children: React.ReactNode;
26
33
  maxLength?: number;
27
34
  value?: string | number;
@@ -32,8 +39,8 @@ interface IPropsBase extends IInputWrapper {
32
39
  interface IState {
33
40
  value: string | number;
34
41
  }
35
- export declare class InputWrapper extends React.Component<IPropsBase, IState> {
36
- constructor(props: IPropsBase);
42
+ export declare class InputWrapper extends React.Component<IProps, IState> {
43
+ constructor(props: IProps);
37
44
  render(): JSX.Element;
38
45
  }
39
46
  export {};
@@ -57,8 +57,12 @@ var InputWrapper = /** @class */ (function (_super) {
57
57
  }
58
58
  InputWrapper.prototype.render = function () {
59
59
  var _a;
60
- var _b, _c;
61
- var fullWidth = (_b = this.props.fullWidth) !== null && _b !== void 0 ? _b : true;
60
+ var _b, _c, _d, _e;
61
+ if (((_b = this.props.inputWrapper) === null || _b === void 0 ? void 0 : _b.kind) === 'custom') {
62
+ var Component = this.props.inputWrapper.component;
63
+ return (React.createElement(Component, { input: this.props.children, label: (_c = this.props.label) !== null && _c !== void 0 ? _c : '' }));
64
+ }
65
+ var fullWidth = (_d = this.props.fullWidth) !== null && _d !== void 0 ? _d : true;
62
66
  var classes = (0, classnames_1.default)('sd-input', (_a = {
63
67
  'sd-input--inline-label': this.props.inlineLabel,
64
68
  'sd-input--required': this.props.required,
@@ -80,8 +84,8 @@ var InputWrapper = /** @class */ (function (_super) {
80
84
  React.createElement("label", { className: labelClasses, htmlFor: this.props.htmlId, id: this.props.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
81
85
  React.createElement("div", { className: "sd-input__input-container" }, this.props.children),
82
86
  this.props.maxLength
83
- && React.createElement("div", { className: 'sd-input__char-count' }, (_c = this.props.value) === null || _c === void 0 ? void 0 :
84
- _c.toString().length,
87
+ && React.createElement("div", { className: 'sd-input__char-count' }, (_e = this.props.value) === null || _e === void 0 ? void 0 :
88
+ _e.toString().length,
85
89
  " / ",
86
90
  this.props.maxLength),
87
91
  React.createElement("div", { className: 'sd-input__message-box' },
@@ -3,6 +3,7 @@ interface IProps {
3
3
  text: string;
4
4
  style?: 'normal' | 'light';
5
5
  noMinHeight?: boolean;
6
+ noMinWidth?: boolean;
6
7
  }
7
8
  export declare class FormLabel extends React.PureComponent<IProps> {
8
9
  render(): JSX.Element;
@@ -53,7 +53,14 @@ var FormLabel = /** @class */ (function (_super) {
53
53
  var classes = (0, classnames_1.default)('form-label form-label--block', {
54
54
  'form-label--light': this.props.style === 'light',
55
55
  });
56
- return (React.createElement("label", { className: classes, style: this.props.noMinHeight === true ? { minHeight: 'auto' } : undefined }, this.props.text));
56
+ var style = {};
57
+ if (this.props.noMinWidth) {
58
+ style.minWidth = 'auto';
59
+ }
60
+ if (this.props.noMinHeight) {
61
+ style.minHeight = 'auto';
62
+ }
63
+ return (React.createElement("label", { className: classes, style: style }, this.props.text));
57
64
  };
58
65
  return FormLabel;
59
66
  }(React.PureComponent));
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
- import { IInputCommon } from './Form/InputWrapper';
2
+ import { IInputCommon, IInputWrapper } from './Form/InputWrapper';
3
3
  interface IPropsBase extends IInputCommon {
4
4
  maxLength?: number;
5
5
  placeholder?: string;
6
6
  size?: 'medium' | 'large' | 'x-large';
7
7
  'data-test-id'?: string;
8
+ inputWrapper?: IInputWrapper['inputWrapper'];
8
9
  }
9
10
  interface IPropsText extends IPropsBase {
10
11
  type: 'text';
@@ -67,7 +67,7 @@ var Input = /** @class */ (function (_super) {
67
67
  return (React.createElement("div", null,
68
68
  React.createElement("span", null, this.props.value)));
69
69
  }
70
- 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 },
70
+ 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, inputWrapper: this.props.inputWrapper },
71
71
  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'] })));
72
72
  };
73
73
  return Input;
@@ -72,7 +72,7 @@ var MultiSelect = /** @class */ (function (_super) {
72
72
  if (this.props.preview) {
73
73
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
74
74
  }
75
- 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 },
75
+ 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, inputWrapper: this.props.inputWrapper },
76
76
  React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
77
77
  var value = _a.value;
78
78
  return _this.props.onChange(value);
@@ -61,7 +61,7 @@ var Select = /** @class */ (function (_super) {
61
61
  return (React.createElement("div", null,
62
62
  React.createElement("span", null, this.props.value)));
63
63
  }
64
- 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
64
+ 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, readonly: this.props.readonly, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
65
65
  React.createElement("span", { className: 'sd-input__select-caret-wrapper' },
66
66
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled || this.props.readonly, "data-test-id": this.props['data-test-id'] }, this.props.children))));
67
67
  };
@@ -99,7 +99,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
99
99
  // needs to be passed to prime react component
100
100
  // or it will not be displayed at all, even if returned by itemTemplate
101
101
  var fakePlaceholderWithNonBreakingSpace = ' ';
102
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
102
+ return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.state.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
103
103
  React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
104
104
  onChange(e.value == null ? null : e.value.original);
105
105
  }, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage, itemTemplate: function (option) { var _a; return React.createElement(ItemTemplate, { option: (_a = option === null || option === void 0 ? void 0 : option.original) !== null && _a !== void 0 ? _a : null }); }, valueTemplate: function (option) {
@@ -59,7 +59,7 @@ var TagInput = /** @class */ (function (_super) {
59
59
  if (this.props.preview) {
60
60
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.props.value, getLabel: function (item) { return item; } }));
61
61
  }
62
- 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 },
62
+ 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, inputWrapper: this.props.inputWrapper },
63
63
  React.createElement(chips_1.Chips, { className: "\n tags-input--multi-select sd-input__input\n ".concat(this.props.disabled ? ' tags-input__padding-disabled' : ''), allowDuplicate: false, separator: ",", onChange: function (event) { return onChange(event.value); }, value: value, placeholder: this.props.disabled ? undefined : placeholder, disabled: this.props.disabled })));
64
64
  };
65
65
  return TagInput;
@@ -58,7 +58,7 @@ var TimePicker = /** @class */ (function (_super) {
58
58
  return (React.createElement("div", null,
59
59
  React.createElement("span", null, this.props.value)));
60
60
  }
61
- 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 },
61
+ 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, inputWrapper: this.props.inputWrapper },
62
62
  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) {
63
63
  _this.props.onChange(event.target.value);
64
64
  }, "data-test-id": this.props['data-test-id'] })));
@@ -149,7 +149,7 @@ var TimePickerV2 = /** @class */ (function (_super) {
149
149
  TimePickerV2.prototype.render = function () {
150
150
  var _this = this;
151
151
  var timeUnitValuesArray = this.updatedTimeUnit();
152
- 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, tabindex: this.props.tabindex },
152
+ 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, tabindex: this.props.tabindex, inputWrapper: this.props.inputWrapper },
153
153
  React.createElement("div", { className: 'sd__input__time-picker-v2', "data-test-id": this.props['data-test-id'] },
154
154
  React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
155
155
  React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[0], onChange: function (_a) {
@@ -48,7 +48,7 @@ export declare class TreeMenu<T> extends React.Component<IProps<T>, IState<T>> {
48
48
  onPressEsc: (event: KeyboardEvent) => void;
49
49
  componentDidMount: () => void;
50
50
  componentWillUnmount(): void;
51
- componentDidUpdate(_prevProps: Readonly<IProps<T>>, prevState: Readonly<IState<T>>): void;
51
+ componentDidUpdate(prevProps: Readonly<IProps<T>>, prevState: Readonly<IState<T>>): void;
52
52
  toggleMenu(): void;
53
53
  toggle(event: React.SyntheticEvent): void;
54
54
  handleMultiLevel(item: ITreeMenuNode<T>): void;
@@ -170,7 +170,8 @@ var TreeMenu = /** @class */ (function (_super) {
170
170
  document.removeEventListener("keydown", this.onKeyDown);
171
171
  document.addEventListener("keydown", this.onPressEsc);
172
172
  };
173
- TreeMenu.prototype.componentDidUpdate = function (_prevProps, prevState) {
173
+ TreeMenu.prototype.componentDidUpdate = function (prevProps, prevState) {
174
+ var _this = this;
174
175
  var _a;
175
176
  if (prevState.openDropdown !== this.state.openDropdown) {
176
177
  this.toggleMenu();
@@ -180,6 +181,17 @@ var TreeMenu = /** @class */ (function (_super) {
180
181
  || (prevState.options !== this.state.options)) {
181
182
  (_a = this.popperInstance) === null || _a === void 0 ? void 0 : _a.update();
182
183
  }
184
+ // Update options when getOptions prop is updated
185
+ if (this.props.getOptions && prevProps.getOptions !== this.props.getOptions) {
186
+ var newOptions_1 = this.props.getOptions();
187
+ this.setState({
188
+ options: newOptions_1,
189
+ firstBranchOptions: newOptions_1,
190
+ filterArr: [],
191
+ }, function () {
192
+ _this.recursion(newOptions_1);
193
+ });
194
+ }
183
195
  };
184
196
  TreeMenu.prototype.toggleMenu = function () {
185
197
  var _this = this;
@@ -570,7 +570,7 @@ var TreeSelect = /** @class */ (function (_super) {
570
570
  var children = _a.children;
571
571
  return React.createElement(React.Fragment, null, children);
572
572
  };
573
- 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'] },
573
+ 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, fullWidth: this.props.fullWidth, "data-test-id": this.props['data-test-id'], inputWrapper: this.props.inputWrapper },
574
574
  React.createElement("div", { className: "\n tags-input sd-input__input\n tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef, "data-test-id": this.props.allowMultiple ? undefined : 'open-popover' }, this.props.allowMultiple
575
575
  ? React.createElement("div", { className: "tags-input__tags" },
576
576
  this.props.readOnly