superdesk-ui-framework 3.0.8 → 3.0.10
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/Layouts/AuthoringInnerBody.tsx +3 -1
- package/app-typescript/components/Select.tsx +22 -27
- package/dist/examples.bundle.js +27 -25
- package/dist/react/Selects.tsx +54 -64
- package/dist/superdesk-ui.bundle.js +6 -7
- package/examples/pages/react/Selects.tsx +54 -64
- package/package.json +1 -1
- package/react/components/Layouts/AuthoringInnerBody.js +3 -1
- package/react/components/Select.d.ts +0 -5
- package/react/components/Select.js +3 -6
- package/.vscode/settings.json +0 -5
- package/app-typescript/dist/components/Alert.d.ts +0 -16
- package/app-typescript/dist/components/Autocomplete.d.ts +0 -48
- package/app-typescript/dist/components/Avatar.d.ts +0 -33
- package/app-typescript/dist/components/Badge.d.ts +0 -13
- package/app-typescript/dist/components/Button.d.ts +0 -23
- package/app-typescript/dist/components/ButtonGroup.d.ts +0 -12
- package/app-typescript/dist/components/CheckButtonGroup.d.ts +0 -11
- package/app-typescript/dist/components/CheckGroup.d.ts +0 -9
- package/app-typescript/dist/components/Checkbox.d.ts +0 -19
- package/app-typescript/dist/components/CheckboxButton.d.ts +0 -19
- package/app-typescript/dist/components/DatePicker.d.ts +0 -37
- package/app-typescript/dist/components/Divider.d.ts +0 -9
- package/app-typescript/dist/components/DonutChart.d.ts +0 -12
- package/app-typescript/dist/components/Dropdown.d.ts +0 -28
- package/app-typescript/dist/components/DropdownFirst.d.ts +0 -42
- package/app-typescript/dist/components/EmptyState.d.ts +0 -11
- package/app-typescript/dist/components/FormLabel.d.ts +0 -9
- package/app-typescript/dist/components/Genie.d.ts +0 -13
- package/app-typescript/dist/components/GridItem.d.ts +0 -69
- package/app-typescript/dist/components/GridList.d.ts +0 -14
- package/app-typescript/dist/components/HeadingText.d.ts +0 -10
- package/app-typescript/dist/components/HelloWorld.d.ts +0 -8
- package/app-typescript/dist/components/Icon.d.ts +0 -12
- package/app-typescript/dist/components/IconButton.d.ts +0 -12
- package/app-typescript/dist/components/IconLabel.d.ts +0 -11
- package/app-typescript/dist/components/Input.d.ts +0 -24
- package/app-typescript/dist/components/Label.d.ts +0 -15
- package/app-typescript/dist/components/LeftMenu.d.ts +0 -26
- package/app-typescript/dist/components/Loader.d.ts +0 -8
- package/app-typescript/dist/components/NavButton.d.ts +0 -15
- package/app-typescript/dist/components/Popover.d.ts +0 -13
- package/app-typescript/dist/components/PropsList.d.ts +0 -15
- package/app-typescript/dist/components/Radio.d.ts +0 -19
- package/app-typescript/dist/components/RadioButton.d.ts +0 -20
- package/app-typescript/dist/components/Select.d.ts +0 -29
- package/app-typescript/dist/components/SelectWithTemplate.d.ts +0 -32
- package/app-typescript/dist/components/SlidingToolbar.d.ts +0 -8
- package/app-typescript/dist/components/StrechBar.d.ts +0 -4
- package/app-typescript/dist/components/SubNav.d.ts +0 -10
- package/app-typescript/dist/components/Switch.d.ts +0 -12
- package/app-typescript/dist/components/TabCustom.d.ts +0 -25
- package/app-typescript/dist/components/TabList.d.ts +0 -22
- package/app-typescript/dist/components/Tag.d.ts +0 -9
- package/app-typescript/dist/components/TagInput.d.ts +0 -7
- package/app-typescript/dist/components/TagInputTest.d.ts +0 -18
- package/app-typescript/dist/components/TimePicker.d.ts +0 -11
- package/app-typescript/dist/components/Tooltip.d.ts +0 -11
- package/app-typescript/dist/components/_Positioner.d.ts +0 -27
- package/app-typescript/dist/index.d.ts +0 -56
- package/yarn-error.log +0 -111
@@ -12,7 +12,9 @@ export class AuthoringInnerBody extends React.PureComponent<IProps> {
|
|
12
12
|
<article
|
13
13
|
className={classNames(
|
14
14
|
'sd-editor-content__authoring-body',
|
15
|
-
{
|
15
|
+
{
|
16
|
+
'sd-editor-content__authoring-body-padding': !this.props.noPadding,
|
17
|
+
},
|
16
18
|
)}
|
17
19
|
>
|
18
20
|
{this.props.children}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
// import classNames from 'classnames';
|
3
2
|
import nextId from "react-id-generator";
|
4
3
|
import { InputWrapper } from './Form';
|
5
4
|
|
@@ -16,14 +15,9 @@ interface ISelect {
|
|
16
15
|
tabindex?: number;
|
17
16
|
fullWidth?: boolean;
|
18
17
|
onChange(newValue: string): void;
|
19
|
-
boxedStyle?: boolean;
|
20
|
-
boxedLable?: boolean;
|
21
|
-
placeholder?: string;
|
22
|
-
size?: 'medium' | 'large' | 'x-large';
|
23
18
|
}
|
24
19
|
|
25
20
|
interface IState {
|
26
|
-
value: string;
|
27
21
|
invalid: boolean;
|
28
22
|
}
|
29
23
|
|
@@ -33,7 +27,6 @@ class Select extends React.Component<ISelect, IState> {
|
|
33
27
|
super(props);
|
34
28
|
|
35
29
|
this.state = {
|
36
|
-
value: this.props.value ?? '',
|
37
30
|
invalid: this.props.invalid ?? false,
|
38
31
|
};
|
39
32
|
|
@@ -41,32 +34,34 @@ class Select extends React.Component<ISelect, IState> {
|
|
41
34
|
}
|
42
35
|
|
43
36
|
handleChange(event: React.ChangeEvent<HTMLSelectElement>) {
|
44
|
-
this.setState({ value: event.target.value });
|
45
37
|
this.props.onChange(event.target.value);
|
46
38
|
}
|
47
39
|
|
48
40
|
render() {
|
49
41
|
return (
|
50
42
|
<InputWrapper
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
43
|
+
label={this.props.label}
|
44
|
+
error={this.props.error}
|
45
|
+
required={this.props.required}
|
46
|
+
disabled={this.props.disabled}
|
47
|
+
invalid={this.state.invalid}
|
48
|
+
info={this.props.info}
|
49
|
+
inlineLabel={this.props.inlineLabel}
|
50
|
+
labelHidden={this.props.labelHidden}
|
51
|
+
fullWidth={this.props.fullWidth}
|
52
|
+
htmlId={this.htmlId}
|
53
|
+
tabindex={this.props.tabindex}
|
54
|
+
>
|
55
|
+
<select
|
56
|
+
className='sd-input__select'
|
57
|
+
id={this.htmlId}
|
58
|
+
value={this.props.value}
|
59
|
+
aria-describedby={this.htmlId}
|
60
|
+
tabIndex={this.props.tabindex}
|
61
|
+
onChange={this.handleChange}
|
62
|
+
disabled={this.props.disabled}
|
63
|
+
>
|
64
|
+
{this.props.children}
|
70
65
|
</select>
|
71
66
|
</InputWrapper>
|
72
67
|
);
|
package/dist/examples.bundle.js
CHANGED
@@ -66440,29 +66440,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
66440
66440
|
Object.defineProperty(exports, "__esModule", { value: true });
|
66441
66441
|
exports.Option = exports.Select = void 0;
|
66442
66442
|
var React = __importStar(__webpack_require__(0));
|
66443
|
-
// import classNames from 'classnames';
|
66444
66443
|
var react_id_generator_1 = __importDefault(__webpack_require__(7));
|
66445
66444
|
var Form_1 = __webpack_require__(12);
|
66446
66445
|
var Select = /** @class */ (function (_super) {
|
66447
66446
|
__extends(Select, _super);
|
66448
66447
|
function Select(props) {
|
66449
|
-
var _a
|
66448
|
+
var _a;
|
66450
66449
|
var _this = _super.call(this, props) || this;
|
66451
66450
|
_this.htmlId = (0, react_id_generator_1.default)();
|
66452
66451
|
_this.state = {
|
66453
|
-
|
66454
|
-
invalid: (_b = _this.props.invalid) !== null && _b !== void 0 ? _b : false,
|
66452
|
+
invalid: (_a = _this.props.invalid) !== null && _a !== void 0 ? _a : false,
|
66455
66453
|
};
|
66456
66454
|
_this.handleChange = _this.handleChange.bind(_this);
|
66457
66455
|
return _this;
|
66458
66456
|
}
|
66459
66457
|
Select.prototype.handleChange = function (event) {
|
66460
|
-
this.setState({ value: event.target.value });
|
66461
66458
|
this.props.onChange(event.target.value);
|
66462
66459
|
};
|
66463
66460
|
Select.prototype.render = function () {
|
66464
66461
|
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 },
|
66465
|
-
React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.
|
66462
|
+
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.children)));
|
66466
66463
|
};
|
66467
66464
|
return Select;
|
66468
66465
|
}(React.Component));
|
@@ -102315,7 +102312,9 @@ var AuthoringInnerBody = /** @class */ (function (_super) {
|
|
102315
102312
|
return _super !== null && _super.apply(this, arguments) || this;
|
102316
102313
|
}
|
102317
102314
|
AuthoringInnerBody.prototype.render = function () {
|
102318
|
-
return (React.createElement("article", { className: (0, classnames_1.default)('sd-editor-content__authoring-body', {
|
102315
|
+
return (React.createElement("article", { className: (0, classnames_1.default)('sd-editor-content__authoring-body', {
|
102316
|
+
'sd-editor-content__authoring-body-padding': !this.props.noPadding,
|
102317
|
+
}) }, this.props.children));
|
102319
102318
|
};
|
102320
102319
|
return AuthoringInnerBody;
|
102321
102320
|
}(React.PureComponent));
|
@@ -127342,7 +127341,9 @@ var InputsDoc = /** @class */ (function (_super) {
|
|
127342
127341
|
inlineLabel: false,
|
127343
127342
|
required: true,
|
127344
127343
|
disabled: false,
|
127345
|
-
invalid: false
|
127344
|
+
invalid: false,
|
127345
|
+
value: '',
|
127346
|
+
value2: '',
|
127346
127347
|
};
|
127347
127348
|
return _this;
|
127348
127349
|
}
|
@@ -127350,7 +127351,7 @@ var InputsDoc = /** @class */ (function (_super) {
|
|
127350
127351
|
var _this = this;
|
127351
127352
|
return (React.createElement("section", { className: 'docs-page__container' },
|
127352
127353
|
React.createElement("h2", { className: 'docs-page__h2' }, "Select"),
|
127353
|
-
React.createElement(Markup.ReactMarkupCodePreview, null, "\n <Select
|
127354
|
+
React.createElement(Markup.ReactMarkupCodePreview, null, "\n <Select\n value={this.state.value}\n onChange={(value) => {\n this.setState({\n value: value,\n })\n }}\n >\n <Option>Option 1</Option>\n <Option>Option 2</Option>\n </Select>\n "),
|
127354
127355
|
React.createElement("p", { className: 'docs-page__paragraph' }),
|
127355
127356
|
React.createElement(Markup.ReactMarkup, null,
|
127356
127357
|
React.createElement(Markup.ReactMarkupPreview, null,
|
@@ -127362,34 +127363,35 @@ var InputsDoc = /** @class */ (function (_super) {
|
|
127362
127363
|
React.createElement(app_typescript_1.Checkbox, { checked: this.state.invalid, label: { text: 'Invalid input' }, onChange: function (value) { _this.setState({ invalid: value }); } }),
|
127363
127364
|
React.createElement(app_typescript_1.Checkbox, { checked: this.state.inlineLabel, label: { text: 'Label positioned inline' }, onChange: function (value) { _this.setState({ inlineLabel: value }); } }))),
|
127364
127365
|
React.createElement("div", { className: 'form__row' },
|
127365
|
-
React.createElement(app_typescript_1.Select, {
|
127366
|
+
React.createElement(app_typescript_1.Select, { value: this.state.value, label: 'Select label', error: 'This is error message', info: 'This is some hint message', inlineLabel: this.state.inlineLabel, required: this.state.required, disabled: this.state.disabled, invalid: this.state.invalid, tabindex: 0, onChange: function (value) {
|
127367
|
+
_this.setState({
|
127368
|
+
value: value,
|
127369
|
+
});
|
127370
|
+
} },
|
127366
127371
|
React.createElement(app_typescript_1.Option, null, "Option 1"),
|
127367
127372
|
React.createElement(app_typescript_1.Option, null, "Option 2"))),
|
127368
127373
|
React.createElement("p", { className: "docs-page__paragraph" }, "// Boxed with hidden label"),
|
127369
127374
|
React.createElement("div", { className: 'form__row' },
|
127370
|
-
React.createElement(app_typescript_1.Select, {
|
127371
|
-
|
127372
|
-
|
127373
|
-
|
127374
|
-
|
127375
|
-
React.createElement(app_typescript_1.Option, null, "Option 1"),
|
127376
|
-
React.createElement(app_typescript_1.Option, null, "Option 2"))),
|
127377
|
-
React.createElement("div", { className: 'form__row' },
|
127378
|
-
React.createElement(app_typescript_1.Select, { label: 'Select label', value: 'Option 2', boxedStyle: true, labelHidden: true, size: 'x-large', error: 'This is error message', info: 'This is some hint message', inlineLabel: this.state.inlineLabel, required: this.state.required, disabled: this.state.disabled, invalid: this.state.invalid, tabindex: 0, onChange: function (value) { console.log(value); } },
|
127375
|
+
React.createElement(app_typescript_1.Select, { value: this.state.value2, label: 'Select label', labelHidden: true, error: 'This is error message', info: 'This is some hint message', tabindex: 0, onChange: function (value) {
|
127376
|
+
_this.setState({
|
127377
|
+
value2: value,
|
127378
|
+
});
|
127379
|
+
} },
|
127379
127380
|
React.createElement(app_typescript_1.Option, null, "Option 1"),
|
127380
127381
|
React.createElement(app_typescript_1.Option, null, "Option 2"))))),
|
127381
|
-
React.createElement(Markup.ReactMarkupCode, null, "\n <Select
|
127382
|
+
React.createElement(Markup.ReactMarkupCode, null, "\n <Select\n value={this.state.value}\n label='Select label'\n error='This is error message'\n info='This is some hint message'\n inlineLabel={this.state.inlineLabel}\n required={this.state.required}\n disabled={this.state.disabled}\n invalid={this.state.invalid}\n tabindex={0}\n onChange={(value) => {\n this.setState({\n value: value,\n })\n }}\n >\n <Option>Option 1</Option>\n <Option>Option 2</Option>\n </Select>\n ")),
|
127382
127383
|
React.createElement("h3", { className: 'docs-page__h3' }, "Props"),
|
127383
127384
|
React.createElement(app_typescript_1.PropsList, null,
|
127384
127385
|
React.createElement(app_typescript_1.Prop, { name: 'value', isRequired: false, type: 'string', default: '/', description: 'Item value' }),
|
127385
|
-
React.createElement(app_typescript_1.Prop, { name: 'label', isRequired: false, type: 'string', default: '/', description: '
|
127386
|
-
React.createElement(app_typescript_1.Prop, { name: 'info', isRequired: false, type: 'string', default: '/', description: '
|
127387
|
-
React.createElement(app_typescript_1.Prop, { name: 'error', isRequired: false, type: 'string', default: '/', description: 'Error
|
127386
|
+
React.createElement(app_typescript_1.Prop, { name: 'label', isRequired: false, type: 'string', default: '/', description: 'Label of component' }),
|
127387
|
+
React.createElement(app_typescript_1.Prop, { name: 'info', isRequired: false, type: 'string', default: '/', description: 'Info message of component' }),
|
127388
|
+
React.createElement(app_typescript_1.Prop, { name: 'error', isRequired: false, type: 'string', default: '/', description: 'Error message of component' }),
|
127388
127389
|
React.createElement(app_typescript_1.Prop, { name: 'inlineLabel', isRequired: false, type: 'boolean', default: 'false', description: 'Position labels as inline' }),
|
127389
127390
|
React.createElement(app_typescript_1.Prop, { name: 'required', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as required' }),
|
127390
127391
|
React.createElement(app_typescript_1.Prop, { name: 'disabled', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as disabled' }),
|
127391
127392
|
React.createElement(app_typescript_1.Prop, { name: 'invalid', isRequired: false, type: 'boolean', default: 'false', description: 'Mark field as invalid' }),
|
127392
|
-
React.createElement(app_typescript_1.Prop, { name: 'tabindex', isRequired: false, type: 'number', default: '/', description: 'Indicates an element can be focused on, and determines how that focus is handled.' })
|
127393
|
+
React.createElement(app_typescript_1.Prop, { name: 'tabindex', isRequired: false, type: 'number', default: '/', description: 'Indicates an element can be focused on, and determines how that focus is handled.' }),
|
127394
|
+
React.createElement(app_typescript_1.Prop, { name: 'onChange', isRequired: true, type: 'Function', default: '/', description: 'Callback to invoke when value changes.' }))));
|
127393
127395
|
};
|
127394
127396
|
return InputsDoc;
|
127395
127397
|
}(React.Component));
|
@@ -139316,7 +139318,7 @@ exports.WithSizeObserverDocs = WithSizeObserverDocs;
|
|
139316
139318
|
/* 653 */
|
139317
139319
|
/***/ (function(module, exports) {
|
139318
139320
|
|
139319
|
-
module.exports = {"name":"superdesk-ui-framework","version":"3.0.
|
139321
|
+
module.exports = {"name":"superdesk-ui-framework","version":"3.0.10","license":"AGPL-3.0","repository":{"type":"git","url":"https://github.com/superdesk/superdesk-ui-framework.git"},"main":"dist/superdesk-ui.bundle.js","types":"react/index.d.ts","contributors":["Nemanja Pavlovic","Vladimir Stefanovic","Darko Tomic","Aleksandar Jelicic","Tomas Kikutis","Dragana Zivkovic"],"scripts":{"start":"webpack-dev-server --config tasks/webpack.dev.js","server":"webpack --watch --config tasks/webpack.prod.js && tsc-watch","build":"webpack --config tasks/webpack.prod.js && tsc","build-ui":"webpack && tsc && npm run lint","lint":"eslint --parser=@typescript-eslint/parser app && tslint -c tslint.json 'app-typescript/**/*.{ts,tsx}'","lint-fix":"tsc -p tsconfig.json --noEmit && tslint --fix -c tslint.json 'app-typescript/**/*.{ts,tsx}'","prepublishOnly":"npm run build"},"devDependencies":{"@types/chart.js":"^2.9.24","@types/classnames":"^2.2.9","@types/lodash":"^4.14.161","@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.14.0","angular":"^1.7.9","angular-animate":"^1.7.9","angular-route":"^1.7.9","babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","classnames":"^2.2.5","clean-webpack-plugin":"^1.0.0","code-prettify":"^0.1.0","copy-webpack-plugin":"^4.6.0","css-loader":"^2.1.1","eslint":"^4.6.1","eslint-loader":"^1.9.0","eslint-plugin-angular":"^3.1.1","eslint-plugin-react":"^7.3.0","extract-text-webpack-plugin":"^3.0.2","file-loader":"^0.11.2","html-loader":"^0.5.1","html-webpack-plugin":"^2.30.1","jquery":"^3.1.1","jquery-ui":"^1.12.1","lodash":"4.17.21","node-sass":"6.0","prismjs":"^1.28.0","prop-types":"^15.6.0","react":"16.8.6","react-bootstrap":"^0.31.2","react-dom":"16.8.6","react-redux":"^5.0.6","react-router-dom":"^5.1.2","redux":"^3.7.2","redux-form":"^7.0.4","sass-loader":"^6.0.6","style-loader":"^0.18.2","superdesk-code-style":"^1.1.2","ts-loader":"^6.0.2","tslint":"^5.18.0","typescript":"4.5.2","url-loader":"^1.1.2","webpack":"^3.5.5","webpack-cli":"3.3.10","webpack-dev-server":"2.11.1","webpack-merge":"^4.2.1"},"dependencies":{"@material-ui/lab":"^4.0.0-alpha.56","@popperjs/core":"^2.4.0","@superdesk/primereact":"^5.0.2-10","@types/node":"^14.10.2","chart.js":"^2.9.3","date-fns":"2.7.0","moment":"^2.29.3","popper.js":"1.14.4","primeicons":"2.0.0","react-beautiful-dnd":"^13.0.0","react-id-generator":"^3.0.0","react-popper":"^2.2.3","react-scrollspy":"^3.4.3"}}
|
139320
139322
|
|
139321
139323
|
/***/ }),
|
139322
139324
|
/* 654 */
|
package/dist/react/Selects.tsx
CHANGED
@@ -9,6 +9,8 @@ interface IState {
|
|
9
9
|
required: boolean;
|
10
10
|
disabled: boolean;
|
11
11
|
invalid: boolean;
|
12
|
+
value: string;
|
13
|
+
value2: string;
|
12
14
|
}
|
13
15
|
|
14
16
|
export default class InputsDoc extends React.Component<{}, IState> {
|
@@ -18,7 +20,9 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
18
20
|
inlineLabel: false,
|
19
21
|
required: true,
|
20
22
|
disabled: false,
|
21
|
-
invalid: false
|
23
|
+
invalid: false,
|
24
|
+
value: '',
|
25
|
+
value2: '',
|
22
26
|
}
|
23
27
|
}
|
24
28
|
|
@@ -28,7 +32,14 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
28
32
|
|
29
33
|
<h2 className='docs-page__h2'>Select</h2>
|
30
34
|
<Markup.ReactMarkupCodePreview>{`
|
31
|
-
<Select
|
35
|
+
<Select
|
36
|
+
value={this.state.value}
|
37
|
+
onChange={(value) => {
|
38
|
+
this.setState({
|
39
|
+
value: value,
|
40
|
+
})
|
41
|
+
}}
|
42
|
+
>
|
32
43
|
<Option>Option 1</Option>
|
33
44
|
<Option>Option 2</Option>
|
34
45
|
</Select>
|
@@ -48,8 +59,9 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
48
59
|
</div>
|
49
60
|
|
50
61
|
<div className='form__row'>
|
51
|
-
<Select
|
52
|
-
value=
|
62
|
+
<Select
|
63
|
+
value={this.state.value}
|
64
|
+
label='Select label'
|
53
65
|
error='This is error message'
|
54
66
|
info='This is some hint message'
|
55
67
|
inlineLabel={this.state.inlineLabel}
|
@@ -57,7 +69,12 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
57
69
|
disabled={this.state.disabled}
|
58
70
|
invalid={this.state.invalid}
|
59
71
|
tabindex={0}
|
60
|
-
onChange={(value) => {
|
72
|
+
onChange={(value) => {
|
73
|
+
this.setState({
|
74
|
+
value: value,
|
75
|
+
})
|
76
|
+
}}
|
77
|
+
>
|
61
78
|
<Option>Option 1</Option>
|
62
79
|
<Option>Option 2</Option>
|
63
80
|
</Select>
|
@@ -65,73 +82,45 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
65
82
|
|
66
83
|
<p className="docs-page__paragraph">// Boxed with hidden label</p>
|
67
84
|
<div className='form__row'>
|
68
|
-
<Select
|
69
|
-
value=
|
70
|
-
|
85
|
+
<Select
|
86
|
+
value={this.state.value2}
|
87
|
+
label='Select label'
|
71
88
|
labelHidden
|
72
89
|
error='This is error message'
|
73
90
|
info='This is some hint message'
|
74
|
-
inlineLabel={this.state.inlineLabel}
|
75
|
-
required={this.state.required}
|
76
|
-
disabled={this.state.disabled}
|
77
|
-
invalid={this.state.invalid}
|
78
91
|
tabindex={0}
|
79
|
-
onChange={(value) => {
|
80
|
-
|
81
|
-
|
92
|
+
onChange={(value) => {
|
93
|
+
this.setState({
|
94
|
+
value2: value,
|
95
|
+
})
|
96
|
+
}}
|
97
|
+
>
|
98
|
+
<Option>Option 1</Option>
|
99
|
+
<Option>Option 2</Option>
|
82
100
|
</Select>
|
83
|
-
</div>
|
84
|
-
<div className='form__row'>
|
85
|
-
<Select label='Select label'
|
86
|
-
value='Option 2'
|
87
|
-
boxedStyle
|
88
|
-
labelHidden
|
89
|
-
size='large'
|
90
|
-
error='This is error message'
|
91
|
-
info='This is some hint message'
|
92
|
-
inlineLabel={this.state.inlineLabel}
|
93
|
-
required={this.state.required}
|
94
|
-
disabled={this.state.disabled}
|
95
|
-
invalid={this.state.invalid}
|
96
|
-
tabindex={0}
|
97
|
-
onChange={(value) => { console.log(value) }}>
|
98
|
-
<Option>Option 1</Option>
|
99
|
-
<Option>Option 2</Option>
|
100
|
-
</Select>
|
101
|
-
</div>
|
102
|
-
<div className='form__row'>
|
103
|
-
<Select label='Select label'
|
104
|
-
value='Option 2'
|
105
|
-
boxedStyle
|
106
|
-
labelHidden
|
107
|
-
size='x-large'
|
108
|
-
error='This is error message'
|
109
|
-
info='This is some hint message'
|
110
|
-
inlineLabel={this.state.inlineLabel}
|
111
|
-
required={this.state.required}
|
112
|
-
disabled={this.state.disabled}
|
113
|
-
invalid={this.state.invalid}
|
114
|
-
tabindex={0}
|
115
|
-
onChange={(value) => { console.log(value) }}>
|
116
|
-
<Option>Option 1</Option>
|
117
|
-
<Option>Option 2</Option>
|
118
|
-
</Select>
|
119
|
-
</div>
|
101
|
+
</div>
|
120
102
|
</div>
|
121
103
|
|
122
104
|
</Markup.ReactMarkupPreview>
|
123
105
|
<Markup.ReactMarkupCode>{`
|
124
|
-
<Select
|
125
|
-
value=
|
106
|
+
<Select
|
107
|
+
value={this.state.value}
|
108
|
+
label='Select label'
|
126
109
|
error='This is error message'
|
127
110
|
info='This is some hint message'
|
128
|
-
inlineLabel={
|
129
|
-
required={
|
130
|
-
disabled={
|
131
|
-
invalid={
|
132
|
-
|
133
|
-
|
134
|
-
|
111
|
+
inlineLabel={this.state.inlineLabel}
|
112
|
+
required={this.state.required}
|
113
|
+
disabled={this.state.disabled}
|
114
|
+
invalid={this.state.invalid}
|
115
|
+
tabindex={0}
|
116
|
+
onChange={(value) => {
|
117
|
+
this.setState({
|
118
|
+
value: value,
|
119
|
+
})
|
120
|
+
}}
|
121
|
+
>
|
122
|
+
<Option>Option 1</Option>
|
123
|
+
<Option>Option 2</Option>
|
135
124
|
</Select>
|
136
125
|
`}</Markup.ReactMarkupCode>
|
137
126
|
</Markup.ReactMarkup>
|
@@ -139,14 +128,15 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
139
128
|
<h3 className='docs-page__h3'>Props</h3>
|
140
129
|
<PropsList>
|
141
130
|
<Prop name='value' isRequired={false} type='string' default='/' description='Item value' />
|
142
|
-
<Prop name='label' isRequired={false} type='string' default='/' description='
|
143
|
-
<Prop name='info' isRequired={false} type='string' default='/' description='
|
144
|
-
<Prop name='error' isRequired={false} type='string' default='/' description='Error
|
131
|
+
<Prop name='label' isRequired={false} type='string' default='/' description='Label of component' />
|
132
|
+
<Prop name='info' isRequired={false} type='string' default='/' description='Info message of component' />
|
133
|
+
<Prop name='error' isRequired={false} type='string' default='/' description='Error message of component' />
|
145
134
|
<Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline' />
|
146
135
|
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required' />
|
147
136
|
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled' />
|
148
137
|
<Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid' />
|
149
138
|
<Prop name='tabindex' isRequired={false} type='number' default='/' description='Indicates an element can be focused on, and determines how that focus is handled.' />
|
139
|
+
<Prop name='onChange' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
150
140
|
</PropsList>
|
151
141
|
</section>
|
152
142
|
)
|
@@ -65701,29 +65701,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65701
65701
|
Object.defineProperty(exports, "__esModule", { value: true });
|
65702
65702
|
exports.Option = exports.Select = void 0;
|
65703
65703
|
var React = __importStar(__webpack_require__(0));
|
65704
|
-
// import classNames from 'classnames';
|
65705
65704
|
var react_id_generator_1 = __importDefault(__webpack_require__(7));
|
65706
65705
|
var Form_1 = __webpack_require__(12);
|
65707
65706
|
var Select = /** @class */ (function (_super) {
|
65708
65707
|
__extends(Select, _super);
|
65709
65708
|
function Select(props) {
|
65710
|
-
var _a
|
65709
|
+
var _a;
|
65711
65710
|
var _this = _super.call(this, props) || this;
|
65712
65711
|
_this.htmlId = (0, react_id_generator_1.default)();
|
65713
65712
|
_this.state = {
|
65714
|
-
|
65715
|
-
invalid: (_b = _this.props.invalid) !== null && _b !== void 0 ? _b : false,
|
65713
|
+
invalid: (_a = _this.props.invalid) !== null && _a !== void 0 ? _a : false,
|
65716
65714
|
};
|
65717
65715
|
_this.handleChange = _this.handleChange.bind(_this);
|
65718
65716
|
return _this;
|
65719
65717
|
}
|
65720
65718
|
Select.prototype.handleChange = function (event) {
|
65721
|
-
this.setState({ value: event.target.value });
|
65722
65719
|
this.props.onChange(event.target.value);
|
65723
65720
|
};
|
65724
65721
|
Select.prototype.render = function () {
|
65725
65722
|
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 },
|
65726
|
-
React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.
|
65723
|
+
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.children)));
|
65727
65724
|
};
|
65728
65725
|
return Select;
|
65729
65726
|
}(React.Component));
|
@@ -101576,7 +101573,9 @@ var AuthoringInnerBody = /** @class */ (function (_super) {
|
|
101576
101573
|
return _super !== null && _super.apply(this, arguments) || this;
|
101577
101574
|
}
|
101578
101575
|
AuthoringInnerBody.prototype.render = function () {
|
101579
|
-
return (React.createElement("article", { className: (0, classnames_1.default)('sd-editor-content__authoring-body', {
|
101576
|
+
return (React.createElement("article", { className: (0, classnames_1.default)('sd-editor-content__authoring-body', {
|
101577
|
+
'sd-editor-content__authoring-body-padding': !this.props.noPadding,
|
101578
|
+
}) }, this.props.children));
|
101580
101579
|
};
|
101581
101580
|
return AuthoringInnerBody;
|
101582
101581
|
}(React.PureComponent));
|