superdesk-ui-framework 4.0.36 → 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.
- package/app-typescript/components/DatePicker.tsx +1 -0
- package/app-typescript/components/DateTimePicker.tsx +1 -0
- package/app-typescript/components/DurationInput.tsx +1 -0
- package/app-typescript/components/Form/InputWrapper.tsx +16 -3
- package/app-typescript/components/FormLabel.tsx +12 -1
- package/app-typescript/components/Input.tsx +3 -1
- package/app-typescript/components/MultiSelect.tsx +1 -0
- package/app-typescript/components/Select.tsx +1 -0
- package/app-typescript/components/SelectWithTemplate.tsx +52 -49
- package/app-typescript/components/TagInput.tsx +1 -0
- package/app-typescript/components/TimePicker.tsx +1 -0
- package/app-typescript/components/TimePickerV2.tsx +1 -0
- package/app-typescript/components/TreeSelect/TreeSelect.tsx +1 -0
- package/dist/examples.bundle.js +28 -17
- package/dist/superdesk-ui.bundle.js +27 -16
- package/package.json +1 -1
- package/react/components/DatePicker.js +1 -1
- package/react/components/DateTimePicker.js +1 -1
- package/react/components/DurationInput.js +1 -1
- package/react/components/Form/InputWrapper.d.ts +10 -3
- package/react/components/Form/InputWrapper.js +8 -4
- package/react/components/FormLabel.d.ts +1 -0
- package/react/components/FormLabel.js +8 -1
- package/react/components/Input.d.ts +2 -1
- package/react/components/Input.js +1 -1
- package/react/components/MultiSelect.js +1 -1
- package/react/components/Select.js +1 -1
- package/react/components/SelectWithTemplate.js +1 -1
- package/react/components/TagInput.js +1 -1
- package/react/components/TimePicker.js +1 -1
- package/react/components/TimePickerV2.js +1 -1
- 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
|
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<
|
44
|
-
constructor(props:
|
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={
|
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}
|
@@ -94,57 +94,60 @@ export class SelectWithTemplate<T> extends React.Component<IProps<T>, IState<T>>
|
|
94
94
|
|
95
95
|
return (
|
96
96
|
<InputWrapper
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
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
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
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
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
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
|
}
|
@@ -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'>
|
@@ -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={`
|
package/dist/examples.bundle.js
CHANGED
@@ -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
|
-
|
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' }, (
|
44823
|
-
|
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
|
@@ -84176,7 +84180,7 @@ var Input = /** @class */ (function (_super) {
|
|
84176
84180
|
return (React.createElement("div", null,
|
84177
84181
|
React.createElement("span", null, this.props.value)));
|
84178
84182
|
}
|
84179
|
-
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 },
|
84180
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'] })));
|
84181
84185
|
};
|
84182
84186
|
return Input;
|
@@ -84252,7 +84256,7 @@ var Select = /** @class */ (function (_super) {
|
|
84252
84256
|
return (React.createElement("div", null,
|
84253
84257
|
React.createElement("span", null, this.props.value)));
|
84254
84258
|
}
|
84255
|
-
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 },
|
84256
84260
|
React.createElement("span", { className: 'sd-input__select-caret-wrapper' },
|
84257
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))));
|
84258
84262
|
};
|
@@ -84917,7 +84921,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
|
|
84917
84921
|
// needs to be passed to prime react component
|
84918
84922
|
// or it will not be displayed at all, even if returned by itemTemplate
|
84919
84923
|
var fakePlaceholderWithNonBreakingSpace = ' ';
|
84920
|
-
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 },
|
84921
84925
|
React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
|
84922
84926
|
onChange(e.value == null ? null : e.value.original);
|
84923
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) {
|
@@ -125820,7 +125824,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
125820
125824
|
var convertedTimeValue = this.props.value != null
|
125821
125825
|
? "".concat(this.prepareFormat(this.props.value.getHours()), ":").concat(this.prepareFormat(this.props.value.getMinutes()))
|
125822
125826
|
: "";
|
125823
|
-
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 },
|
125824
125828
|
React.createElement(common_1.Spacer, { h: true, gap: "8", alignItems: "end", noWrap: true },
|
125825
125829
|
React.createElement("div", { style: { flexGrow: 1 } },
|
125826
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) {
|
@@ -125899,7 +125903,14 @@ var FormLabel = /** @class */ (function (_super) {
|
|
125899
125903
|
var classes = (0, classnames_1.default)('form-label form-label--block', {
|
125900
125904
|
'form-label--light': this.props.style === 'light',
|
125901
125905
|
});
|
125902
|
-
|
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));
|
125903
125914
|
};
|
125904
125915
|
return FormLabel;
|
125905
125916
|
}(React.PureComponent));
|
@@ -156400,7 +156411,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
156400
156411
|
if (this.props.preview) {
|
156401
156412
|
return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
|
156402
156413
|
}
|
156403
|
-
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 },
|
156404
156415
|
React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
|
156405
156416
|
var value = _a.value;
|
156406
156417
|
return _this.props.onChange(value);
|
@@ -186356,7 +186367,7 @@ exports.ThreePaneLayoutPattern = ThreePaneLayoutPattern;
|
|
186356
186367
|
/* 938 */
|
186357
186368
|
/***/ (function(module, exports) {
|
186358
186369
|
|
186359
|
-
module.exports = {"name":"superdesk-ui-framework","version":"4.0.
|
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"}}
|
186360
186371
|
|
186361
186372
|
/***/ }),
|
186362
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
|
-
|
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' }, (
|
44327
|
-
|
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
|
@@ -83297,7 +83301,7 @@ var Input = /** @class */ (function (_super) {
|
|
83297
83301
|
return (React.createElement("div", null,
|
83298
83302
|
React.createElement("span", null, this.props.value)));
|
83299
83303
|
}
|
83300
|
-
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 },
|
83301
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'] })));
|
83302
83306
|
};
|
83303
83307
|
return Input;
|
@@ -83373,7 +83377,7 @@ var Select = /** @class */ (function (_super) {
|
|
83373
83377
|
return (React.createElement("div", null,
|
83374
83378
|
React.createElement("span", null, this.props.value)));
|
83375
83379
|
}
|
83376
|
-
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 },
|
83377
83381
|
React.createElement("span", { className: 'sd-input__select-caret-wrapper' },
|
83378
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))));
|
83379
83383
|
};
|
@@ -84038,7 +84042,7 @@ var SelectWithTemplate = /** @class */ (function (_super) {
|
|
84038
84042
|
// needs to be passed to prime react component
|
84039
84043
|
// or it will not be displayed at all, even if returned by itemTemplate
|
84040
84044
|
var fakePlaceholderWithNonBreakingSpace = ' ';
|
84041
|
-
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 },
|
84042
84046
|
React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
|
84043
84047
|
onChange(e.value == null ? null : e.value.original);
|
84044
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) {
|
@@ -124941,7 +124945,7 @@ var DateTimePicker = /** @class */ (function (_super) {
|
|
124941
124945
|
var convertedTimeValue = this.props.value != null
|
124942
124946
|
? "".concat(this.prepareFormat(this.props.value.getHours()), ":").concat(this.prepareFormat(this.props.value.getMinutes()))
|
124943
124947
|
: "";
|
124944
|
-
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 },
|
124945
124949
|
React.createElement(common_1.Spacer, { h: true, gap: "8", alignItems: "end", noWrap: true },
|
124946
124950
|
React.createElement("div", { style: { flexGrow: 1 } },
|
124947
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) {
|
@@ -125020,7 +125024,14 @@ var FormLabel = /** @class */ (function (_super) {
|
|
125020
125024
|
var classes = (0, classnames_1.default)('form-label form-label--block', {
|
125021
125025
|
'form-label--light': this.props.style === 'light',
|
125022
125026
|
});
|
125023
|
-
|
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));
|
125024
125035
|
};
|
125025
125036
|
return FormLabel;
|
125026
125037
|
}(React.PureComponent));
|
@@ -155521,7 +155532,7 @@ var MultiSelect = /** @class */ (function (_super) {
|
|
155521
155532
|
if (this.props.preview) {
|
155522
155533
|
return (React.createElement(SelectPreview_1.SelectPreview, { kind: { mode: 'multi-select' }, items: this.state.value, valueTemplate: this.props.selectedItemTemplate, getLabel: this.props.optionLabel }));
|
155523
155534
|
}
|
155524
|
-
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 },
|
155525
155536
|
React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (_a) {
|
155526
155537
|
var value = _a.value;
|
155527
155538
|
return _this.props.onChange(value);
|
package/package.json
CHANGED
@@ -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
|
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<
|
36
|
-
constructor(props:
|
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
|
-
|
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' }, (
|
84
|
-
|
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' },
|
@@ -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
|
-
|
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) {
|
@@ -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
|