superdesk-ui-framework 3.0.45 → 3.0.46

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/styles/form-elements/_inputs.scss +15 -31
  2. package/app-typescript/components/DatePicker.tsx +1 -0
  3. package/app-typescript/components/DurationInput.tsx +1 -0
  4. package/app-typescript/components/Input.tsx +1 -1
  5. package/app-typescript/components/MultiSelect.tsx +1 -0
  6. package/app-typescript/components/Select.tsx +1 -0
  7. package/app-typescript/components/TagInput.tsx +1 -0
  8. package/app-typescript/components/TimePicker.tsx +1 -0
  9. package/app-typescript/components/TreeSelect/TreeSelect.tsx +1 -0
  10. package/dist/examples.bundle.js +27 -27
  11. package/dist/react/DatePicker.tsx +10 -12
  12. package/dist/react/DurationInput.tsx +2 -2
  13. package/dist/react/MultiSelect.tsx +0 -1
  14. package/dist/react/Selects.tsx +0 -2
  15. package/dist/react/TagInputDocs.tsx +4 -6
  16. package/dist/react/TimePicker.tsx +5 -7
  17. package/dist/react/TreeSelect.tsx +16 -20
  18. package/dist/superdesk-ui.bundle.css +17 -18
  19. package/dist/superdesk-ui.bundle.js +8 -8
  20. package/examples/pages/react/DatePicker.tsx +10 -12
  21. package/examples/pages/react/DurationInput.tsx +2 -2
  22. package/examples/pages/react/MultiSelect.tsx +0 -1
  23. package/examples/pages/react/Selects.tsx +0 -2
  24. package/examples/pages/react/TagInputDocs.tsx +4 -6
  25. package/examples/pages/react/TimePicker.tsx +5 -7
  26. package/examples/pages/react/TreeSelect.tsx +16 -20
  27. package/package.json +1 -1
  28. package/react/components/DatePicker.js +1 -1
  29. package/react/components/DurationInput.js +1 -1
  30. package/react/components/Input.js +1 -1
  31. package/react/components/MultiSelect.js +1 -1
  32. package/react/components/Select.js +1 -1
  33. package/react/components/TagInput.js +1 -1
  34. package/react/components/TimePicker.js +1 -1
  35. package/react/components/TreeSelect/TreeSelect.js +1 -1
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as Markup from '../../js/react';
3
3
  import { PropsList, Prop } from '../../../app-typescript';
4
- import { MultiSelect } from '../../../app-typescript/components/MultiSelect';
5
- import { ITreeNode, TreeSelect } from '../../../app-typescript/components/TreeSelect/TreeSelect';
4
+ import { TreeSelect } from '../../../app-typescript/components/TreeSelect/TreeSelect';
6
5
 
7
6
  interface IState {
8
7
  value: any;
@@ -171,8 +170,7 @@ let options2 = [
171
170
  ]
172
171
 
173
172
  let fetchedArr = [];
174
- fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data
175
- );
173
+ fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data);
176
174
 
177
175
  type ICancelFn = () => void;
178
176
 
@@ -206,7 +204,6 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
206
204
  arr: []
207
205
  }
208
206
 
209
-
210
207
  this.handleChange = this.handleChange.bind(this);
211
208
  }
212
209
 
@@ -252,10 +249,9 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
252
249
  getLabel={(item) => item.name}
253
250
  selectBranchWithChildren
254
251
  allowMultiple
255
- searchPlaceholder='Search...'
256
- info='Info Message'
257
- error='Error Message'
258
252
  label='TreeSelect Label'
253
+ info='Info Message'
254
+ searchPlaceholder='Search...'
259
255
  getBackgroundColor={(item: any) => item.bgColor}
260
256
  valueTemplate={(item, Wrapper) => {
261
257
  return (
@@ -273,16 +269,15 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
273
269
  <Markup.ReactMarkupCode>{`
274
270
  <TreeSelect
275
271
  kind='synchronous'
276
- value={[{name: 'Item 1'}, {name: 'Item 2'}]}
272
+ value={[{name: 'Category1'}]}
277
273
  getOptions={() => options}
278
274
  getId={(item) => item.name}
279
275
  getLabel={(item) => item.name}
280
276
  selectBranchWithChildren
281
277
  allowMultiple
278
+ label='TreeSelect Label'
279
+ info='Info Message'
282
280
  searchPlaceholder='Search...'
283
- info={'Info Message'}
284
- error={'Error Message'}
285
- label={'TreeSelect Label'}
286
281
  getBackgroundColor={(item: any) => item.bgColor}
287
282
  valueTemplate={(item, Wrapper) => {
288
283
  return (
@@ -310,9 +305,8 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
310
305
  selectBranchWithChildren
311
306
  allowMultiple
312
307
  searchOptions={searchOptions}
313
- info='Info Message'
314
- error='Error Message'
315
308
  label='TreeSelect Label'
309
+ info='Info Message'
316
310
  onChange={(val) => {
317
311
  this.setState({value: val});
318
312
  }}
@@ -326,10 +320,12 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
326
320
  kind="asynchronous"
327
321
  value={this.state.value}
328
322
  getLabel={({display_name}) => display_name}
329
- getId={({qcode}) => qcode.display_name}
323
+ getId={({display_name}) => display_name}
330
324
  selectBranchWithChildren
331
325
  allowMultiple
332
326
  searchOptions={searchOptions}
327
+ label='TreeSelect Label'
328
+ info='Info Message'
333
329
  onChange={(val) => {
334
330
  this.setState({value: val});
335
331
  }}
@@ -351,10 +347,9 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
351
347
  getId={(item) => item.name}
352
348
  getBorderColor={(item) => item.border}
353
349
  selectBranchWithChildren
354
- placeholder='Select one'
355
- info='Info Message'
356
- error='Error Message'
357
350
  label='TreeSelect Label'
351
+ info='Info Message'
352
+ placeholder='Select one'
358
353
  optionTemplate={(item: any) => {
359
354
  return <div>Label: {item.name}</div>
360
355
  }}
@@ -372,13 +367,14 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
372
367
  <Markup.ReactMarkupCode>{`
373
368
  <TreeSelect
374
369
  kind='synchronous'
375
- value={[{name: 'Item 1'}]}
370
+ value={[]}
376
371
  getOptions={() => options2}
377
372
  getLabel={(item) => item.name}
378
373
  getId={(item) => item.name}
379
- getBackgroundColor={(item) => item.bgColor}
380
374
  getBorderColor={(item) => item.border}
381
375
  selectBranchWithChildren
376
+ label='TreeSelect Label'
377
+ info='Info Message'
382
378
  placeholder='Select one'
383
379
  optionTemplate={(item: any) => {
384
380
  return <div>Label: {item.name}</div>
@@ -49687,33 +49687,32 @@ textarea.sd-media-carousel__media-title {
49687
49687
  inset-block-start: -2px;
49688
49688
  inset-inline-end: 4px; }
49689
49689
 
49690
- .sd-input--invalid input.sd-input__input,
49691
- .sd-input--invalid textarea.sd-input__input {
49690
+ .sd-input--invalid .sd-input__input,
49691
+ .sd-input--invalid .sd-input__select,
49692
+ .sd-input--invalid .sd-input__duration-input,
49693
+ .sd-input--invalid .p-multiselect,
49694
+ .sd-input--invalid .p-calendar {
49692
49695
  background-color: rgba(228, 27, 37, 0.075);
49693
49696
  border-color: #e41b21; }
49694
- .sd-input--invalid input.sd-input__input:hover,
49695
- .sd-input--invalid textarea.sd-input__input:hover {
49697
+ .sd-input--invalid .sd-input__input:hover,
49698
+ .sd-input--invalid .sd-input__select:hover,
49699
+ .sd-input--invalid .sd-input__duration-input:hover,
49700
+ .sd-input--invalid .p-multiselect:hover,
49701
+ .sd-input--invalid .p-calendar:hover {
49696
49702
  background-color: rgba(228, 27, 37, 0.12);
49697
49703
  border-color: #e41b21; }
49698
- .sd-input--invalid input.sd-input__input:focus,
49699
- .sd-input--invalid textarea.sd-input__input:focus {
49700
- background-color: rgba(228, 27, 37, 0.16);
49701
- border-color: #e41b21;
49702
- box-shadow: 0 1px 0 0 #e41b21; }
49703
-
49704
- .sd-input--invalid select.sd-input__select {
49705
- background-color: rgba(228, 27, 37, 0.075);
49706
- border-color: #e41b21; }
49707
- .sd-input--invalid select.sd-input__select:hover {
49708
- background-color: rgba(228, 27, 37, 0.12);
49709
- border-color: #e41b21; }
49710
- .sd-input--invalid select.sd-input__select:focus {
49704
+ .sd-input--invalid .sd-input__input:focus,
49705
+ .sd-input--invalid .sd-input__select:focus,
49706
+ .sd-input--invalid .sd-input__duration-input:focus,
49707
+ .sd-input--invalid .p-multiselect:focus,
49708
+ .sd-input--invalid .p-calendar:focus {
49711
49709
  background-color: rgba(228, 27, 37, 0.16);
49712
49710
  border-color: #e41b21;
49713
49711
  box-shadow: 0 1px 0 0 #e41b21; }
49714
49712
 
49715
49713
  .sd-input--invalid .sd-input__label,
49716
- .sd-input--invalid .sd-input__message {
49714
+ .sd-input--invalid .sd-input__message,
49715
+ .sd-input--invalid .sd-input__message-box {
49717
49716
  color: #e41b21; }
49718
49717
 
49719
49718
  .sd-input--required .sd-input__label::after {
@@ -39701,7 +39701,7 @@ var DatePicker = /** @class */ (function (_super) {
39701
39701
  React.createElement("div", null,
39702
39702
  React.createElement("span", null, (0, moment_1.default)(this.state.value).format(this.props.dateFormat))));
39703
39703
  }
39704
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
39704
+ 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 },
39705
39705
  React.createElement(calendar_1.Calendar, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
39706
39706
  _this.instance = ref;
39707
39707
  }, value: this.state.value === null ? undefined : this.state.value, onChange: function (event) {
@@ -41259,7 +41259,7 @@ var DurationInput = /** @class */ (function (_super) {
41259
41259
  React.createElement("span", { className: 'duration-input-preview' }, this.state.seconds),
41260
41260
  React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
41261
41261
  }
41262
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
41262
+ 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 },
41263
41263
  React.createElement("div", { className: 'sd-input__duration-input' },
41264
41264
  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) {
41265
41265
  if (!/[0-9]/.test(event.key)) {
@@ -63717,7 +63717,7 @@ var TimePicker = /** @class */ (function (_super) {
63717
63717
  return (React.createElement("div", null,
63718
63718
  React.createElement("span", null, this.props.value)));
63719
63719
  }
63720
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
63720
+ 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 },
63721
63721
  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) {
63722
63722
  _this.props.onChange(event.target.value);
63723
63723
  } })));
@@ -63793,7 +63793,7 @@ var TagInput = /** @class */ (function (_super) {
63793
63793
  if (this.props.preview) {
63794
63794
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.props.value, getLabel: function (item) { return item; } }));
63795
63795
  }
63796
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
63796
+ 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 },
63797
63797
  React.createElement(chips_1.Chips, { className: "tags-input--multi-select sd-input__input ".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 })));
63798
63798
  };
63799
63799
  return TagInput;
@@ -64514,7 +64514,7 @@ var TreeSelect = /** @class */ (function (_super) {
64514
64514
  getBorderColor: this.props.getBorderColor,
64515
64515
  }, items: this.state.value, valueTemplate: this.props.valueTemplate, getLabel: this.props.getLabel }));
64516
64516
  }
64517
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
64517
+ 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 },
64518
64518
  React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef },
64519
64519
  this.props.allowMultiple
64520
64520
  ? React.createElement("div", { className: "tags-input__tags" },
@@ -65948,7 +65948,7 @@ var Input = /** @class */ (function (_super) {
65948
65948
  return (React.createElement("div", null,
65949
65949
  React.createElement("span", null, this.props.value)));
65950
65950
  }
65951
- return (React.createElement(InputWrapper_1.InputWrapper, { label: this.props.label, required: this.props.required, disabled: this.props.disabled, value: this.props.value, invalid: this.props.error != null ? true : false, error: this.props.error, 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 },
65951
+ 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 },
65952
65952
  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 })));
65953
65953
  };
65954
65954
  return Input;
@@ -66024,7 +66024,7 @@ var Select = /** @class */ (function (_super) {
66024
66024
  return (React.createElement("div", null,
66025
66025
  React.createElement("span", null, this.props.value)));
66026
66026
  }
66027
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
66027
+ 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 },
66028
66028
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId, tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled || this.props.readonly }, this.props.children)));
66029
66029
  };
66030
66030
  return Select;
@@ -116560,7 +116560,7 @@ var MultiSelect = /** @class */ (function (_super) {
116560
116560
  if (this.props.preview) {
116561
116561
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
116562
116562
  }
116563
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
116563
+ 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 },
116564
116564
  React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
116565
116565
  var value = _a.value;
116566
116566
  return _this.props.onChange(value);
@@ -10,6 +10,7 @@ class DatePickerExample extends React.PureComponent<{}, {date: Date | null}> {
10
10
  date: new Date(),
11
11
  };
12
12
  }
13
+
13
14
  render() {
14
15
  return (
15
16
  <DatePicker
@@ -18,9 +19,8 @@ class DatePickerExample extends React.PureComponent<{}, {date: Date | null}> {
18
19
  onChange={(date) => {
19
20
  this.setState({date});
20
21
  }}
21
- label={'This is Label'}
22
- info={'This is info'}
23
- error={'This is error'}
22
+ label='This is Label'
23
+ info='This is info'
24
24
  />
25
25
  );
26
26
  }
@@ -40,6 +40,7 @@ export default class DatePickerDoc extends React.Component<{}, IState> {
40
40
  date: new Date(),
41
41
  };
42
42
  }
43
+
43
44
  render() {
44
45
  return (
45
46
  <section className="docs-page__container">
@@ -67,9 +68,8 @@ export default class DatePickerDoc extends React.Component<{}, IState> {
67
68
  onChange={(date) => {
68
69
  this.setState({today: date});
69
70
  }}
70
- label={'This is Label'}
71
- info={'This is info'}
72
- error={'This is error'}
71
+ label='This is Label'
72
+ info='This is info'
73
73
  />
74
74
  </div>
75
75
  </Markup.ReactMarkupPreview>
@@ -123,9 +123,8 @@ export default class DatePickerDoc extends React.Component<{}, IState> {
123
123
  onChange={(date) => {
124
124
  this.setState({date});
125
125
  }}
126
- label={'This is Label'}
127
- info={'This is info'}
128
- error={'This is error'}
126
+ label='This is Label'
127
+ info='This is info'
129
128
  headerButtonBar={[{days: 0, label: 'today'}, {days: 1, label: 'tomorow'}, {days: 2, label: 'in 2 days'}]}
130
129
  />
131
130
  </div>
@@ -137,9 +136,8 @@ export default class DatePickerDoc extends React.Component<{}, IState> {
137
136
  onChange={(date) => {
138
137
  this.setState({date});
139
138
  }}
140
- label={'This is Label'}
141
- info={'This is info'}
142
- error={'This is error'}
139
+ label='This is Label'
140
+ info='This is info'
143
141
  headerButtonBar={[{days: 0, label: 'today'}, {days: 1, label: 'tomorow'}, {days: 2, label: 'in 2 days'}]}
144
142
  />
145
143
  `}</Markup.ReactMarkupCode>
@@ -70,8 +70,8 @@ export default class DurationInputDoc extends React.Component<{}, IState> {
70
70
  disabled={this.state.disabled}
71
71
  required={this.state.required}
72
72
  inlineLabel={this.state.inlineLabel}
73
- onChange={(e) => {
74
- this.setState({value: e})
73
+ onChange={(value) => {
74
+ this.setState({value})
75
75
  }}
76
76
  />
77
77
  `}</Markup.ReactMarkupCode>
@@ -63,7 +63,6 @@ export class MultiselectDocs extends React.Component<{}, IState> {
63
63
  <div className='docs-page__content-row docs-page__content-row--no-margin'>
64
64
  <div className='form__row'>
65
65
  <MultiSelect
66
- preview
67
66
  value={this.state.value}
68
67
  options={ItemArr}
69
68
  optionLabel={(option) => option.name}
@@ -55,7 +55,6 @@ export default class InputsDoc extends React.Component<{}, IState> {
55
55
  <Select
56
56
  value={this.state.value}
57
57
  label='Select label'
58
- error='This is error message'
59
58
  info='This is some hint message'
60
59
  required={this.state.required}
61
60
  disabled={this.state.disabled}
@@ -77,7 +76,6 @@ export default class InputsDoc extends React.Component<{}, IState> {
77
76
  <Select
78
77
  value={this.state.value}
79
78
  label='Select label'
80
- error='This is error message'
81
79
  info='This is some hint message'
82
80
  required={this.state.required}
83
81
  disabled={this.state.disabled}
@@ -30,9 +30,8 @@ export default class TagInputDocs extends React.Component<{}, {value: Array<stri
30
30
  <TagInput
31
31
  value={this.state.value}
32
32
  placeholder="Type Here"
33
- label={'Tag-input Label'}
34
- info={'Info Message'}
35
- error={'Error Message'}
33
+ label='Tag-input Label'
34
+ info='Info Message'
36
35
  onChange={(value) => {
37
36
  this.setState({
38
37
  value: value,
@@ -45,9 +44,8 @@ export default class TagInputDocs extends React.Component<{}, {value: Array<stri
45
44
  <TagInput
46
45
  value={this.state.value}
47
46
  placeholder="Type Here"
48
- label={'Tag-input Label'}
49
- info={'Info Message'}
50
- error={'Error Message'}
47
+ label='Tag-input Label'
48
+ info='Info Message'
51
49
  onChange={(value) => {
52
50
  this.setState({
53
51
  value: value,
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
-
3
2
  import * as Markup from '../../js/react';
4
3
  import {PropsList, Prop} from '../../../app-typescript';
5
4
  import {TimePicker} from '../../../app-typescript/components/TimePicker';
@@ -12,6 +11,7 @@ class TimePickerExample extends React.PureComponent<{}, {time: string}> {
12
11
  time: '',
13
12
  };
14
13
  }
14
+
15
15
  render() {
16
16
  return (
17
17
  <TimePicker
@@ -20,9 +20,8 @@ class TimePickerExample extends React.PureComponent<{}, {time: string}> {
20
20
  this.setState({time});
21
21
  }}
22
22
  allowSeconds
23
- label={'This is Label'}
24
- info={'This is info'}
25
- error={'This is error'}
23
+ label='This is Label'
24
+ info='This is info'
26
25
  />
27
26
  );
28
27
  }
@@ -54,9 +53,8 @@ export default class TimePickerDoc extends React.Component {
54
53
  this.setState({time});
55
54
  }}
56
55
  allowSeconds
57
- label={'This is Label'}
58
- info={'This is info'}
59
- error={'This is error'}
56
+ label='This is Label'
57
+ info='This is info'
60
58
  />
61
59
  `}</Markup.ReactMarkupCode>
62
60
  </Markup.ReactMarkup>
@@ -1,8 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as Markup from '../../js/react';
3
3
  import { PropsList, Prop } from '../../../app-typescript';
4
- import { MultiSelect } from '../../../app-typescript/components/MultiSelect';
5
- import { ITreeNode, TreeSelect } from '../../../app-typescript/components/TreeSelect/TreeSelect';
4
+ import { TreeSelect } from '../../../app-typescript/components/TreeSelect/TreeSelect';
6
5
 
7
6
  interface IState {
8
7
  value: any;
@@ -171,8 +170,7 @@ let options2 = [
171
170
  ]
172
171
 
173
172
  let fetchedArr = [];
174
- fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data
175
- );
173
+ fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data);
176
174
 
177
175
  type ICancelFn = () => void;
178
176
 
@@ -206,7 +204,6 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
206
204
  arr: []
207
205
  }
208
206
 
209
-
210
207
  this.handleChange = this.handleChange.bind(this);
211
208
  }
212
209
 
@@ -252,10 +249,9 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
252
249
  getLabel={(item) => item.name}
253
250
  selectBranchWithChildren
254
251
  allowMultiple
255
- searchPlaceholder='Search...'
256
- info='Info Message'
257
- error='Error Message'
258
252
  label='TreeSelect Label'
253
+ info='Info Message'
254
+ searchPlaceholder='Search...'
259
255
  getBackgroundColor={(item: any) => item.bgColor}
260
256
  valueTemplate={(item, Wrapper) => {
261
257
  return (
@@ -273,16 +269,15 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
273
269
  <Markup.ReactMarkupCode>{`
274
270
  <TreeSelect
275
271
  kind='synchronous'
276
- value={[{name: 'Item 1'}, {name: 'Item 2'}]}
272
+ value={[{name: 'Category1'}]}
277
273
  getOptions={() => options}
278
274
  getId={(item) => item.name}
279
275
  getLabel={(item) => item.name}
280
276
  selectBranchWithChildren
281
277
  allowMultiple
278
+ label='TreeSelect Label'
279
+ info='Info Message'
282
280
  searchPlaceholder='Search...'
283
- info={'Info Message'}
284
- error={'Error Message'}
285
- label={'TreeSelect Label'}
286
281
  getBackgroundColor={(item: any) => item.bgColor}
287
282
  valueTemplate={(item, Wrapper) => {
288
283
  return (
@@ -310,9 +305,8 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
310
305
  selectBranchWithChildren
311
306
  allowMultiple
312
307
  searchOptions={searchOptions}
313
- info='Info Message'
314
- error='Error Message'
315
308
  label='TreeSelect Label'
309
+ info='Info Message'
316
310
  onChange={(val) => {
317
311
  this.setState({value: val});
318
312
  }}
@@ -326,10 +320,12 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
326
320
  kind="asynchronous"
327
321
  value={this.state.value}
328
322
  getLabel={({display_name}) => display_name}
329
- getId={({qcode}) => qcode.display_name}
323
+ getId={({display_name}) => display_name}
330
324
  selectBranchWithChildren
331
325
  allowMultiple
332
326
  searchOptions={searchOptions}
327
+ label='TreeSelect Label'
328
+ info='Info Message'
333
329
  onChange={(val) => {
334
330
  this.setState({value: val});
335
331
  }}
@@ -351,10 +347,9 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
351
347
  getId={(item) => item.name}
352
348
  getBorderColor={(item) => item.border}
353
349
  selectBranchWithChildren
354
- placeholder='Select one'
355
- info='Info Message'
356
- error='Error Message'
357
350
  label='TreeSelect Label'
351
+ info='Info Message'
352
+ placeholder='Select one'
358
353
  optionTemplate={(item: any) => {
359
354
  return <div>Label: {item.name}</div>
360
355
  }}
@@ -372,13 +367,14 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
372
367
  <Markup.ReactMarkupCode>{`
373
368
  <TreeSelect
374
369
  kind='synchronous'
375
- value={[{name: 'Item 1'}]}
370
+ value={[]}
376
371
  getOptions={() => options2}
377
372
  getLabel={(item) => item.name}
378
373
  getId={(item) => item.name}
379
- getBackgroundColor={(item) => item.bgColor}
380
374
  getBorderColor={(item) => item.border}
381
375
  selectBranchWithChildren
376
+ label='TreeSelect Label'
377
+ info='Info Message'
382
378
  placeholder='Select one'
383
379
  optionTemplate={(item: any) => {
384
380
  return <div>Label: {item.name}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "3.0.45",
3
+ "version": "3.0.46",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -136,7 +136,7 @@ var DatePicker = /** @class */ (function (_super) {
136
136
  React.createElement("div", null,
137
137
  React.createElement("span", null, (0, moment_1.default)(this.state.value).format(this.props.dateFormat))));
138
138
  }
139
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
139
+ 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 },
140
140
  React.createElement(calendar_1.Calendar, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
141
141
  _this.instance = ref;
142
142
  }, value: this.state.value === null ? undefined : this.state.value, onChange: function (event) {
@@ -312,7 +312,7 @@ var DurationInput = /** @class */ (function (_super) {
312
312
  React.createElement("span", { className: 'duration-input-preview' }, this.state.seconds),
313
313
  React.createElement("span", { className: 'sd-input__suffix' }, "s"))));
314
314
  }
315
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
315
+ 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 },
316
316
  React.createElement("div", { className: 'sd-input__duration-input' },
317
317
  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) {
318
318
  if (!/[0-9]/.test(event.key)) {
@@ -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, invalid: this.props.error != null ? true : false, error: this.props.error, 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 },
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 })));
72
72
  };
73
73
  return Input;
@@ -70,7 +70,7 @@ var MultiSelect = /** @class */ (function (_super) {
70
70
  if (this.props.preview) {
71
71
  return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
72
72
  }
73
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
73
+ 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 },
74
74
  React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
75
75
  var value = _a.value;
76
76
  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, 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 },
65
65
  React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.props.value, "aria-describedby": this.htmlId, tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled || this.props.readonly }, this.props.children)));
66
66
  };
67
67
  return Select;
@@ -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, 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 },
63
63
  React.createElement(chips_1.Chips, { className: "tags-input--multi-select sd-input__input ".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, 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 },
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
  } })));
@@ -494,7 +494,7 @@ var TreeSelect = /** @class */ (function (_super) {
494
494
  getBorderColor: this.props.getBorderColor,
495
495
  }, items: this.state.value, valueTemplate: this.props.valueTemplate, getLabel: this.props.getLabel }));
496
496
  }
497
- return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, 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 },
497
+ 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 },
498
498
  React.createElement("div", { className: "tags-input sd-input__input tags-input--".concat(this.props.allowMultiple ? 'multi-select' : 'single-select'), ref: this.treeSelectRef },
499
499
  this.props.allowMultiple
500
500
  ? React.createElement("div", { className: "tags-input__tags" },