superdesk-ui-framework 3.0.1-beta.3 → 3.0.1-beta.30
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/fonts/sd_icons.eot +0 -0
- package/app/fonts/sd_icons.svg +14 -7
- package/app/fonts/sd_icons.ttf +0 -0
- package/app/fonts/sd_icons.woff +0 -0
- package/app/scripts/toggleBoxNext.js +1 -1
- package/app/styles/_big-icon-font.scss +1 -1
- package/app/styles/_buttons.scss +11 -6
- package/app/styles/_content-divider.scss +63 -8
- package/app/styles/_helpers.scss +24 -1
- package/app/styles/_icon-font.scss +17 -10
- package/app/styles/_labels.scss +0 -1
- package/app/styles/_master-desk.scss +3 -2
- package/app/styles/_modals.scss +6 -3
- package/app/styles/_normalize.scss +4 -0
- package/app/styles/_sd-tag-input.scss +256 -296
- package/app/styles/_simple-list.scss +0 -2
- package/app/styles/_table-list.scss +116 -12
- package/app/styles/app.scss +1 -0
- package/app/styles/components/_list-item.scss +36 -17
- package/app/styles/components/_sd-collapse-box.scss +6 -6
- package/app/styles/components/_sd-comment-box.scss +8 -4
- package/app/styles/components/_sd-editor-popup.scss +4 -4
- package/app/styles/components/_sd-grid-item.scss +30 -16
- package/app/styles/components/_sd-media-carousel.scss +37 -2
- package/app/styles/components/_sd-photo-preview.scss +3 -3
- package/app/styles/components/_sd-searchbar.scss +7 -0
- package/app/styles/components/_subnav.scss +470 -470
- package/app/styles/design-tokens/_design-tokens-general.scss +1 -1
- package/app/styles/design-tokens/_new-colors.scss +30 -13
- package/app/styles/dropdowns/_basic-dropdown.scss +6 -0
- package/app/styles/form-elements/_forms-general.scss +81 -7
- package/app/styles/form-elements/_input-wrap.scss +138 -0
- package/app/styles/form-elements/_inputs.scss +368 -110
- package/app/styles/grids/_grid-layout.scss +34 -1
- package/app/styles/interface-elements/_side-panel.scss +1 -1
- package/app/styles/layout/_basic-layout.scss +2 -2
- package/app/styles/layout/_editor.scss +10 -4
- package/app/styles/primereact/_pr-datepicker.scss +4 -2
- package/app/styles/primereact/_pr-dialog.scss +5 -0
- package/app/styles/primereact/_pr-dropdown.scss +17 -1
- package/app/styles/primereact/_pr-menu.scss +6 -5
- package/app/styles/variables/_colors.scss +21 -21
- package/app-typescript/components/Badge.tsx +3 -2
- package/app-typescript/components/ContentDivider.tsx +3 -0
- package/app-typescript/components/DatePicker.tsx +40 -52
- package/app-typescript/components/Dropdown.tsx +127 -82
- package/app-typescript/components/DurationInput.tsx +400 -0
- package/app-typescript/components/EmptyState.tsx +2 -1
- package/app-typescript/components/Form/FormLabel.tsx +8 -1
- package/app-typescript/components/Form/FormRowNew.tsx +41 -0
- package/app-typescript/components/Form/InputBase.tsx +95 -0
- package/app-typescript/components/Form/InputNew.tsx +107 -0
- package/app-typescript/components/Form/InputWrapper.tsx +79 -0
- package/app-typescript/components/Form/index.tsx +4 -0
- package/app-typescript/components/Input.tsx +28 -45
- package/app-typescript/components/Label.tsx +65 -10
- package/app-typescript/components/Layouts/AuthoringContainer.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrame.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrameRightBar.tsx +21 -2
- package/app-typescript/components/Layouts/AuthoringInnerHeader.tsx +1 -1
- package/app-typescript/components/Layouts/AuthoringMain.tsx +4 -2
- package/app-typescript/components/Layouts/CoreLayout.tsx +2 -1
- package/app-typescript/components/Layouts/CoreLayoutMain.tsx +7 -1
- package/app-typescript/components/Layouts/Layout.tsx +1 -1
- package/app-typescript/components/LeftMenu.tsx +127 -122
- package/app-typescript/components/Lists/ContentList.tsx +66 -33
- package/app-typescript/components/Lists/TableList.tsx +348 -151
- package/app-typescript/components/Menu.tsx +2 -2
- package/app-typescript/components/MultiSelect.tsx +37 -50
- package/app-typescript/components/NavButton.tsx +2 -1
- package/app-typescript/components/Navigation/BottomNav.tsx +3 -2
- package/app-typescript/components/SearchBar.tsx +39 -12
- package/app-typescript/components/Select.tsx +23 -41
- package/app-typescript/components/SelectWithTemplate.tsx +32 -7
- package/app-typescript/components/Spacer.tsx +87 -0
- package/app-typescript/components/TimePicker.tsx +38 -15
- package/app-typescript/components/TreeSelect.tsx +546 -212
- package/app-typescript/index.ts +6 -1
- package/dist/examples.bundle.css +344 -71
- package/dist/examples.bundle.js +48203 -45174
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/dist/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/dist/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/dist/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/dist/react/Badges.tsx +18 -0
- package/dist/react/ContentDivider.tsx +22 -18
- package/dist/react/ContentList.tsx +200 -18
- package/dist/react/DatePicker.tsx +21 -1
- package/dist/react/Dropdowns.tsx +580 -48
- package/dist/react/DurationInput.tsx +108 -0
- package/dist/react/Index.tsx +5 -0
- package/dist/react/Inputs.tsx +147 -2
- package/dist/react/Labels.tsx +51 -1
- package/dist/react/LeftNavigations.tsx +71 -44
- package/dist/react/MultiSelect.tsx +10 -7
- package/dist/react/NavButtons.tsx +31 -1
- package/dist/react/SelectWithTemplate.tsx +6 -1
- package/dist/react/TableList.tsx +79 -186
- package/dist/react/TimePicker.tsx +22 -12
- package/dist/react/Togglebox.tsx +1 -1
- package/dist/react/TreeSelect.tsx +295 -51
- package/dist/react/tree-select/TreeSelect.tsx +273 -0
- package/dist/react/tree-select/example-1.tsx +71 -0
- package/dist/react/tree-select/example-2.tsx +59 -0
- package/dist/sd_icons.eot +0 -0
- package/dist/sd_icons.svg +14 -7
- package/dist/sd_icons.ttf +0 -0
- package/dist/sd_icons.woff +0 -0
- package/dist/superdesk-ui.bundle.css +2282 -782
- package/dist/superdesk-ui.bundle.js +37312 -21800
- package/dist/vendor.bundle.js +27 -27
- package/examples/css/docs-page.css +4 -4
- package/examples/index.js +4 -0
- package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/examples/pages/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/examples/pages/react/Badges.tsx +18 -0
- package/examples/pages/react/ContentDivider.tsx +22 -18
- package/examples/pages/react/ContentList.tsx +200 -18
- package/examples/pages/react/DatePicker.tsx +21 -1
- package/examples/pages/react/Dropdowns.tsx +580 -48
- package/examples/pages/react/DurationInput.tsx +108 -0
- package/examples/pages/react/Index.tsx +5 -0
- package/examples/pages/react/Inputs.tsx +147 -2
- package/examples/pages/react/Labels.tsx +51 -1
- package/examples/pages/react/LeftNavigations.tsx +71 -44
- package/examples/pages/react/MultiSelect.tsx +10 -7
- package/examples/pages/react/NavButtons.tsx +31 -1
- package/examples/pages/react/SelectWithTemplate.tsx +6 -1
- package/examples/pages/react/TableList.tsx +79 -186
- package/examples/pages/react/TimePicker.tsx +22 -12
- package/examples/pages/react/Togglebox.tsx +1 -1
- package/examples/pages/react/TreeSelect.tsx +295 -51
- package/examples/pages/react/tree-select/TreeSelect.tsx +273 -0
- package/examples/pages/react/tree-select/example-1.tsx +71 -0
- package/examples/pages/react/tree-select/example-2.tsx +59 -0
- package/package.json +5 -5
- package/react/components/Badge.d.ts +1 -0
- package/react/components/Badge.js +2 -2
- package/react/components/ContentDivider.d.ts +1 -0
- package/react/components/ContentDivider.js +2 -0
- package/react/components/DatePicker.d.ts +1 -0
- package/react/components/DatePicker.js +6 -22
- package/react/components/Dropdown.d.ts +6 -5
- package/react/components/Dropdown.js +57 -30
- package/react/components/DurationInput.d.ts +42 -0
- package/react/components/DurationInput.js +364 -0
- package/react/components/EmptyState.d.ts +1 -0
- package/react/components/EmptyState.js +1 -1
- package/react/components/Form/FormLabel.d.ts +4 -1
- package/react/components/Form/FormLabel.js +9 -3
- package/react/components/Form/FormRowNew.d.ts +12 -0
- package/react/components/Form/FormRowNew.js +67 -0
- package/react/components/Form/InputBase.d.ts +41 -0
- package/react/components/Form/InputBase.js +86 -0
- package/react/components/Form/InputNew.d.ts +45 -0
- package/react/components/Form/InputNew.js +75 -0
- package/react/components/Form/InputWrapper.d.ts +28 -0
- package/react/components/Form/InputWrapper.js +91 -0
- package/react/components/Form/index.d.ts +4 -0
- package/react/components/Form/index.js +9 -1
- package/react/components/Input.js +5 -34
- package/react/components/Label.d.ts +2 -0
- package/react/components/Label.js +34 -3
- package/react/components/Layouts/AuthoringContainer.d.ts +1 -0
- package/react/components/Layouts/AuthoringContainer.js +1 -1
- package/react/components/Layouts/AuthoringFrame.d.ts +1 -0
- package/react/components/Layouts/AuthoringFrame.js +1 -1
- package/react/components/Layouts/AuthoringFrameRightBar.d.ts +9 -2
- package/react/components/Layouts/AuthoringFrameRightBar.js +14 -3
- package/react/components/Layouts/AuthoringInnerHeader.js +1 -1
- package/react/components/Layouts/AuthoringMain.js +1 -1
- package/react/components/Layouts/CoreLayout.d.ts +1 -0
- package/react/components/Layouts/CoreLayout.js +1 -1
- package/react/components/Layouts/CoreLayoutMain.d.ts +1 -0
- package/react/components/Layouts/CoreLayoutMain.js +8 -1
- package/react/components/Layouts/Layout.js +1 -1
- package/react/components/LeftMenu.d.ts +3 -1
- package/react/components/LeftMenu.js +8 -1
- package/react/components/Lists/ContentList.d.ts +51 -0
- package/react/components/Lists/ContentList.js +110 -0
- package/react/components/Lists/TableList.d.ts +64 -0
- package/react/components/Lists/TableList.js +240 -0
- package/react/components/Menu.js +1 -1
- package/react/components/MultiSelect.d.ts +40 -0
- package/react/components/MultiSelect.js +70 -0
- package/react/components/NavButton.d.ts +1 -1
- package/react/components/Navigation/BottomNav.d.ts +1 -0
- package/react/components/Navigation/BottomNav.js +2 -2
- package/react/components/SearchBar.d.ts +3 -2
- package/react/components/SearchBar.js +28 -4
- package/react/components/Select.d.ts +1 -1
- package/react/components/Select.js +4 -26
- package/react/components/SelectWithTemplate.d.ts +11 -1
- package/react/components/SelectWithTemplate.js +19 -10
- package/react/components/TimePicker.d.ts +11 -1
- package/react/components/TimePicker.js +10 -3
- package/react/components/TreeSelect.d.ts +82 -0
- package/react/components/TreeSelect.js +521 -0
- package/react/index.d.ts +6 -0
- package/react/index.js +16 -3
- 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/patches/@superdesk+primereact+5.0.2-4.patch +0 -57
- package/yarn-error.log +0 -111
@@ -0,0 +1,67 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
18
|
+
if (k2 === undefined) k2 = k;
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
40
|
+
exports.FormRowNew = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
43
|
+
var FormRowNew = /** @class */ (function (_super) {
|
44
|
+
__extends(FormRowNew, _super);
|
45
|
+
function FormRowNew() {
|
46
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
47
|
+
}
|
48
|
+
FormRowNew.prototype.render = function () {
|
49
|
+
var _a;
|
50
|
+
var classes = (0, classnames_1.default)('form__group-new', (_a = {},
|
51
|
+
_a["form__group-new--".concat(this.props.spaces)] = this.props.spaces,
|
52
|
+
_a["form__group-new--mb-".concat(this.props.marginBottom)] = this.props.marginBottom,
|
53
|
+
_a['form__group-new--inline-labels'] = this.props.inlineLabels,
|
54
|
+
_a['form__group-new--has_row-label'] = this.props.rowLabel,
|
55
|
+
_a));
|
56
|
+
if (this.props.rowLabel) {
|
57
|
+
return (React.createElement("div", { className: 'form__group-new__wrapper' },
|
58
|
+
React.createElement("label", { className: 'form__group-new__label', htmlFor: "form__group-new__label" }, this.props.rowLabel),
|
59
|
+
React.createElement("div", { className: classes }, this.props.children)));
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
return (React.createElement("div", { className: classes }, this.props.children));
|
63
|
+
}
|
64
|
+
};
|
65
|
+
return FormRowNew;
|
66
|
+
}(React.PureComponent));
|
67
|
+
exports.FormRowNew = FormRowNew;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IPropsBase {
|
3
|
+
error?: string;
|
4
|
+
required?: boolean;
|
5
|
+
disabled?: boolean;
|
6
|
+
invalid?: boolean;
|
7
|
+
tabIndex?: number;
|
8
|
+
fullWidth?: boolean;
|
9
|
+
boxedStyle?: boolean;
|
10
|
+
placeholder?: string;
|
11
|
+
htmlId?: string;
|
12
|
+
id?: string;
|
13
|
+
size?: 'medium' | 'large' | 'x-large';
|
14
|
+
}
|
15
|
+
interface IPropsText extends IPropsBase {
|
16
|
+
type: 'text';
|
17
|
+
value: string;
|
18
|
+
onChange(newValue: string): void;
|
19
|
+
}
|
20
|
+
interface IPropsPassword extends IPropsBase {
|
21
|
+
type: 'password';
|
22
|
+
value: string;
|
23
|
+
onChange(newValue: string): void;
|
24
|
+
}
|
25
|
+
interface IPropsNumber extends IPropsBase {
|
26
|
+
type: 'number';
|
27
|
+
value: number;
|
28
|
+
onChange(newValue: number): void;
|
29
|
+
}
|
30
|
+
declare type IProps = IPropsText | IPropsNumber | IPropsPassword;
|
31
|
+
interface IState {
|
32
|
+
value: string | number;
|
33
|
+
invalid: boolean;
|
34
|
+
}
|
35
|
+
export declare class InputBase extends React.Component<IProps, IState> {
|
36
|
+
constructor(props: IProps);
|
37
|
+
handleChange(event: React.ChangeEvent<HTMLInputElement>): void;
|
38
|
+
componentDidUpdate(prevProps: any): void;
|
39
|
+
render(): JSX.Element;
|
40
|
+
}
|
41
|
+
export {};
|
@@ -0,0 +1,86 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
18
|
+
if (k2 === undefined) k2 = k;
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
40
|
+
exports.InputBase = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
43
|
+
var InputBase = /** @class */ (function (_super) {
|
44
|
+
__extends(InputBase, _super);
|
45
|
+
function InputBase(props) {
|
46
|
+
var _a, _b;
|
47
|
+
var _this = _super.call(this, props) || this;
|
48
|
+
_this.state = {
|
49
|
+
value: (_a = _this.props.value) !== null && _a !== void 0 ? _a : '',
|
50
|
+
invalid: (_b = _this.props.invalid) !== null && _b !== void 0 ? _b : false,
|
51
|
+
};
|
52
|
+
_this.handleChange = _this.handleChange.bind(_this);
|
53
|
+
return _this;
|
54
|
+
}
|
55
|
+
// htmlId = nextId();
|
56
|
+
InputBase.prototype.handleChange = function (event) {
|
57
|
+
this.setState({ value: event.target.value });
|
58
|
+
if (this.props.type === 'number') {
|
59
|
+
this.props.onChange(Number(event.target.value));
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
this.props.onChange(event.target.value);
|
63
|
+
}
|
64
|
+
};
|
65
|
+
InputBase.prototype.componentDidUpdate = function (prevProps) {
|
66
|
+
if (prevProps.value !== this.props.value) {
|
67
|
+
this.setState({ value: this.props.value });
|
68
|
+
}
|
69
|
+
};
|
70
|
+
InputBase.prototype.render = function () {
|
71
|
+
var _a;
|
72
|
+
var _b;
|
73
|
+
var classes = (0, classnames_1.default)('sd-input__input', (_a = {
|
74
|
+
'sd-input__input--boxed-style': this.props.boxedStyle,
|
75
|
+
'sd-input__input--required': this.props.required,
|
76
|
+
'sd-input__input--invalid': this.props.invalid,
|
77
|
+
'sd-input__input--disabled': this.props.disabled,
|
78
|
+
'sd-input__input--medium': this.props.size === undefined
|
79
|
+
},
|
80
|
+
_a["sd-input__input--".concat(this.props.size)] = this.props.size || this.props.size !== undefined,
|
81
|
+
_a));
|
82
|
+
return (React.createElement("input", { className: classes, type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.props.htmlId, value: this.state.value, "aria-describedby": this.props.htmlId + 'label', tabIndex: this.props.tabIndex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled }));
|
83
|
+
};
|
84
|
+
return InputBase;
|
85
|
+
}(React.Component));
|
86
|
+
exports.InputBase = InputBase;
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IPropsBase {
|
3
|
+
label?: string;
|
4
|
+
maxLength?: number;
|
5
|
+
info?: string;
|
6
|
+
inlineLabel?: boolean;
|
7
|
+
labelHidden?: boolean;
|
8
|
+
error?: string;
|
9
|
+
required?: boolean;
|
10
|
+
disabled?: boolean;
|
11
|
+
invalid?: boolean;
|
12
|
+
tabindex?: number;
|
13
|
+
fullWidth?: boolean;
|
14
|
+
boxedStyle?: boolean;
|
15
|
+
boxedLable?: boolean;
|
16
|
+
placeholder?: string;
|
17
|
+
size?: 'medium' | 'large' | 'x-large';
|
18
|
+
}
|
19
|
+
interface IPropsText extends IPropsBase {
|
20
|
+
type: 'text';
|
21
|
+
value: string;
|
22
|
+
onChange(newValue: string): void;
|
23
|
+
}
|
24
|
+
interface IPropsPassword extends IPropsBase {
|
25
|
+
type: 'password';
|
26
|
+
value: string;
|
27
|
+
onChange(newValue: string): void;
|
28
|
+
}
|
29
|
+
interface IPropsNumber extends IPropsBase {
|
30
|
+
type: 'number';
|
31
|
+
value: string;
|
32
|
+
onChange(newValue: string): void;
|
33
|
+
}
|
34
|
+
declare type IProps = IPropsText | IPropsNumber | IPropsPassword;
|
35
|
+
interface IState {
|
36
|
+
value: string;
|
37
|
+
invalid: boolean;
|
38
|
+
}
|
39
|
+
export declare class InputNew extends React.PureComponent<IProps, IState> {
|
40
|
+
constructor(props: IProps);
|
41
|
+
componentDidUpdate(prevProps: any): void;
|
42
|
+
htmlId: string;
|
43
|
+
render(): JSX.Element;
|
44
|
+
}
|
45
|
+
export {};
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
18
|
+
if (k2 === undefined) k2 = k;
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
40
|
+
exports.InputNew = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
43
|
+
var _1 = require(".");
|
44
|
+
var InputNew = /** @class */ (function (_super) {
|
45
|
+
__extends(InputNew, _super);
|
46
|
+
function InputNew(props) {
|
47
|
+
var _a, _b;
|
48
|
+
var _this = _super.call(this, props) || this;
|
49
|
+
_this.htmlId = (0, react_id_generator_1.default)();
|
50
|
+
_this.state = {
|
51
|
+
value: (_a = _this.props.value) !== null && _a !== void 0 ? _a : '',
|
52
|
+
invalid: (_b = _this.props.invalid) !== null && _b !== void 0 ? _b : false,
|
53
|
+
};
|
54
|
+
return _this;
|
55
|
+
}
|
56
|
+
InputNew.prototype.componentDidUpdate = function (prevProps) {
|
57
|
+
if (prevProps.value !== this.props.value) {
|
58
|
+
this.setState({ value: this.props.value });
|
59
|
+
}
|
60
|
+
};
|
61
|
+
InputNew.prototype.render = function () {
|
62
|
+
var _this = this;
|
63
|
+
var _a;
|
64
|
+
return (React.createElement(_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, value: this.state.value, invalid: this.state.invalid, 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 },
|
65
|
+
React.createElement(_1.InputBase, { type: "text", onChange: function (value) {
|
66
|
+
_this.setState({ value: value });
|
67
|
+
_this.setState({ invalid: _this.props.maxLength
|
68
|
+
? value.length > _this.props.maxLength
|
69
|
+
: false });
|
70
|
+
_this.props.onChange(value);
|
71
|
+
}, disabled: this.props.disabled, htmlId: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, placeholder: this.props.placeholder })));
|
72
|
+
};
|
73
|
+
return InputNew;
|
74
|
+
}(React.PureComponent));
|
75
|
+
exports.InputNew = InputNew;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IPropsBase {
|
3
|
+
label?: string;
|
4
|
+
children: React.ReactNode;
|
5
|
+
maxLength?: number;
|
6
|
+
info?: string;
|
7
|
+
error?: string;
|
8
|
+
required?: boolean;
|
9
|
+
disabled?: boolean;
|
10
|
+
invalid?: boolean;
|
11
|
+
inlineLabel?: boolean;
|
12
|
+
labelHidden?: boolean;
|
13
|
+
tabindex?: number;
|
14
|
+
fullWidth?: boolean;
|
15
|
+
boxedStyle?: boolean;
|
16
|
+
boxedLable?: boolean;
|
17
|
+
value?: string | number;
|
18
|
+
htmlId?: string;
|
19
|
+
size?: 'medium' | 'large' | 'x-large';
|
20
|
+
}
|
21
|
+
interface IState {
|
22
|
+
value: string | number;
|
23
|
+
}
|
24
|
+
export declare class InputWrapper extends React.Component<IPropsBase, IState> {
|
25
|
+
constructor(props: IPropsBase);
|
26
|
+
render(): JSX.Element;
|
27
|
+
}
|
28
|
+
export {};
|
@@ -0,0 +1,91 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
18
|
+
if (k2 === undefined) k2 = k;
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
20
|
+
}) : (function(o, m, k, k2) {
|
21
|
+
if (k2 === undefined) k2 = k;
|
22
|
+
o[k2] = m[k];
|
23
|
+
}));
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
26
|
+
}) : function(o, v) {
|
27
|
+
o["default"] = v;
|
28
|
+
});
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
30
|
+
if (mod && mod.__esModule) return mod;
|
31
|
+
var result = {};
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
33
|
+
__setModuleDefault(result, mod);
|
34
|
+
return result;
|
35
|
+
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
40
|
+
exports.InputWrapper = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
43
|
+
var InputWrapper = /** @class */ (function (_super) {
|
44
|
+
__extends(InputWrapper, _super);
|
45
|
+
function InputWrapper(props) {
|
46
|
+
var _a;
|
47
|
+
var _this = _super.call(this, props) || this;
|
48
|
+
_this.state = {
|
49
|
+
value: (_a = _this.props.value) !== null && _a !== void 0 ? _a : '',
|
50
|
+
};
|
51
|
+
return _this;
|
52
|
+
}
|
53
|
+
InputWrapper.prototype.render = function () {
|
54
|
+
var _a;
|
55
|
+
var _b;
|
56
|
+
var classes = (0, classnames_1.default)('sd-input', (_a = {
|
57
|
+
'sd-input--inline-label': this.props.inlineLabel,
|
58
|
+
'sd-input--required': this.props.required,
|
59
|
+
'sd-input--disabled': this.props.disabled,
|
60
|
+
'sd-input--full-width': this.props.fullWidth,
|
61
|
+
'sd-input--invalid': this.props.invalid,
|
62
|
+
'sd-input--medium': this.props.size === undefined
|
63
|
+
},
|
64
|
+
_a["sd-input--".concat(this.props.size)] = this.props.size || this.props.size !== undefined,
|
65
|
+
_a['sd-input--boxed-style'] = this.props.boxedStyle,
|
66
|
+
_a['sd-input--boxed-label'] = this.props.boxedLable,
|
67
|
+
_a));
|
68
|
+
var labelClasses = (0, classnames_1.default)('sd-input__label', {
|
69
|
+
'a11y-only': this.props.labelHidden,
|
70
|
+
'sd-input__label--boxed': this.props.boxedLable,
|
71
|
+
});
|
72
|
+
return (React.createElement("div", { className: classes },
|
73
|
+
React.createElement("label", { className: labelClasses, htmlFor: this.props.htmlId, id: this.props.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
|
74
|
+
React.createElement("div", { className: "sd-input__input-container" }, this.props.children),
|
75
|
+
this.props.maxLength
|
76
|
+
? React.createElement("div", { className: 'sd-input__char-count' }, (_b = this.props.value) === null || _b === void 0 ? void 0 :
|
77
|
+
_b.toString().length,
|
78
|
+
" / ",
|
79
|
+
this.props.maxLength)
|
80
|
+
: null,
|
81
|
+
React.createElement("div", { className: 'sd-input__message-box' },
|
82
|
+
this.props.info && !this.props.invalid && !this.props.invalid
|
83
|
+
? React.createElement("div", { className: 'sd-input__hint' }, this.props.info)
|
84
|
+
: null,
|
85
|
+
this.props.invalid || this.props.invalid
|
86
|
+
? React.createElement("div", { className: 'sd-input__message' }, this.props.error)
|
87
|
+
: null)));
|
88
|
+
};
|
89
|
+
return InputWrapper;
|
90
|
+
}(React.Component));
|
91
|
+
exports.InputWrapper = InputWrapper;
|
@@ -3,3 +3,7 @@ export { FormGroup } from './FormGroup';
|
|
3
3
|
export { FormItem } from './FormItem';
|
4
4
|
export { FormText } from './FormText';
|
5
5
|
export { FormLabel } from './FormLabel';
|
6
|
+
export { InputWrapper } from './InputWrapper';
|
7
|
+
export { InputBase } from './InputBase';
|
8
|
+
export { InputNew } from './InputNew';
|
9
|
+
export { FormRowNew } from './FormRowNew';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.FormLabel = exports.FormText = exports.FormItem = exports.FormGroup = exports.FormRow = void 0;
|
3
|
+
exports.FormRowNew = exports.InputNew = exports.InputBase = exports.InputWrapper = exports.FormLabel = exports.FormText = exports.FormItem = exports.FormGroup = exports.FormRow = void 0;
|
4
4
|
var FormRow_1 = require("./FormRow");
|
5
5
|
Object.defineProperty(exports, "FormRow", { enumerable: true, get: function () { return FormRow_1.FormRow; } });
|
6
6
|
var FormGroup_1 = require("./FormGroup");
|
@@ -11,3 +11,11 @@ var FormText_1 = require("./FormText");
|
|
11
11
|
Object.defineProperty(exports, "FormText", { enumerable: true, get: function () { return FormText_1.FormText; } });
|
12
12
|
var FormLabel_1 = require("./FormLabel");
|
13
13
|
Object.defineProperty(exports, "FormLabel", { enumerable: true, get: function () { return FormLabel_1.FormLabel; } });
|
14
|
+
var InputWrapper_1 = require("./InputWrapper");
|
15
|
+
Object.defineProperty(exports, "InputWrapper", { enumerable: true, get: function () { return InputWrapper_1.InputWrapper; } });
|
16
|
+
var InputBase_1 = require("./InputBase");
|
17
|
+
Object.defineProperty(exports, "InputBase", { enumerable: true, get: function () { return InputBase_1.InputBase; } });
|
18
|
+
var InputNew_1 = require("./InputNew");
|
19
|
+
Object.defineProperty(exports, "InputNew", { enumerable: true, get: function () { return InputNew_1.InputNew; } });
|
20
|
+
var FormRowNew_1 = require("./FormRowNew");
|
21
|
+
Object.defineProperty(exports, "FormRowNew", { enumerable: true, get: function () { return FormRowNew_1.FormRowNew; } });
|
@@ -39,8 +39,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
40
40
|
exports.Input = void 0;
|
41
41
|
var React = __importStar(require("react"));
|
42
|
-
|
42
|
+
// import classNames from 'classnames';
|
43
43
|
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
44
|
+
var Form_1 = require("./Form");
|
44
45
|
var Input = /** @class */ (function (_super) {
|
45
46
|
__extends(Input, _super);
|
46
47
|
function Input(props) {
|
@@ -72,39 +73,9 @@ var Input = /** @class */ (function (_super) {
|
|
72
73
|
}
|
73
74
|
};
|
74
75
|
Input.prototype.render = function () {
|
75
|
-
var _a;
|
76
|
-
|
77
|
-
|
78
|
-
'sd-input--inline-label': this.props.inlineLabel,
|
79
|
-
'sd-input--required': this.props.required,
|
80
|
-
'sd-input--disabled': this.props.disabled,
|
81
|
-
'sd-input--full-width': this.props.fullWidth,
|
82
|
-
'sd-input--invalid': this.props.invalid || this.state.invalid,
|
83
|
-
'sd-input--medium': this.props.size === undefined
|
84
|
-
},
|
85
|
-
_a["sd-input--".concat(this.props.size)] = this.props.size || this.props.size !== undefined,
|
86
|
-
_a['sd-input--boxed-style'] = this.props.boxedStyle,
|
87
|
-
_a['sd-input--boxed-label'] = this.props.boxedLable,
|
88
|
-
_a));
|
89
|
-
var labelClasses = (0, classnames_1.default)('sd-input__label', {
|
90
|
-
'a11y-only': this.props.labelHidden,
|
91
|
-
'sd-input__label--boxed': this.props.boxedLable,
|
92
|
-
});
|
93
|
-
return (React.createElement("div", { className: classes },
|
94
|
-
React.createElement("label", { className: labelClasses, htmlFor: this.htmlId, id: this.htmlId + 'label', tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
|
95
|
-
React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled }),
|
96
|
-
this.props.maxLength ?
|
97
|
-
React.createElement("div", { className: 'sd-input__char-count' },
|
98
|
-
this.state.value.toString().length,
|
99
|
-
" / ",
|
100
|
-
this.props.maxLength)
|
101
|
-
: null,
|
102
|
-
React.createElement("div", { className: 'sd-input__message-box' },
|
103
|
-
this.props.info && !this.props.invalid && !this.state.invalid ?
|
104
|
-
React.createElement("div", { className: 'sd-input__hint' }, this.props.info) : null,
|
105
|
-
this.props.invalid || this.state.invalid ?
|
106
|
-
React.createElement("div", { className: 'sd-input__message' }, this.props.error)
|
107
|
-
: null)));
|
76
|
+
var _a, _b;
|
77
|
+
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, value: this.state.value, invalid: this.props.invalid, 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 },
|
78
|
+
React.createElement("input", { className: 'sd-input__input', type: (_b = this.props.type) !== null && _b !== void 0 ? _b : 'text', id: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId + 'label', tabIndex: this.props.tabindex, onChange: this.handleChange, placeholder: this.props.placeholder, disabled: this.props.disabled })));
|
108
79
|
};
|
109
80
|
return Input;
|
110
81
|
}(React.Component));
|
@@ -7,9 +7,11 @@ interface IProps {
|
|
7
7
|
size?: 'small' | 'normal' | 'large';
|
8
8
|
onClick?(): void;
|
9
9
|
noTransform?: boolean;
|
10
|
+
hexColor?: string;
|
10
11
|
style?: 'filled' | 'hollow' | 'translucent';
|
11
12
|
}
|
12
13
|
export declare class Label extends React.PureComponent<IProps> {
|
13
14
|
render(): JSX.Element;
|
14
15
|
}
|
16
|
+
export declare function getTextColor(backgroundColor: string): 'black' | 'white' | undefined;
|
15
17
|
export {};
|
@@ -37,7 +37,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
38
|
};
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
40
|
-
exports.Label = void 0;
|
40
|
+
exports.getTextColor = exports.Label = void 0;
|
41
41
|
var React = __importStar(require("react"));
|
42
42
|
var classnames_1 = __importDefault(require("classnames"));
|
43
43
|
var Label = /** @class */ (function (_super) {
|
@@ -56,12 +56,43 @@ var Label = /** @class */ (function (_super) {
|
|
56
56
|
_a["hollow-".concat(this.props.color)] = this.props.color && this.props.style === 'hollow',
|
57
57
|
_a));
|
58
58
|
if (this.props.link || this.props.onClick) {
|
59
|
-
|
59
|
+
if (this.props.style === 'hollow') {
|
60
|
+
return (React.createElement("a", { className: classes, href: this.props.link, onClick: this.props.onClick, style: { color: this.props.hexColor, borderColor: this.props.hexColor } }, this.props.text));
|
61
|
+
}
|
62
|
+
else if (this.props.style === 'translucent') {
|
63
|
+
return (React.createElement("a", { className: classes, href: this.props.link, onClick: this.props.onClick, style: { color: this.props.hexColor, backgroundColor: "".concat(this.props.hexColor, "33") } }, this.props.text));
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
return (React.createElement("a", { className: classes, href: this.props.link, onClick: this.props.onClick, style: { backgroundColor: this.props.hexColor } }, this.props.text));
|
67
|
+
}
|
60
68
|
}
|
61
69
|
else {
|
62
|
-
|
70
|
+
if (this.props.style === 'hollow') {
|
71
|
+
return (React.createElement("span", { className: classes, style: { color: this.props.hexColor, borderColor: this.props.hexColor } }, this.props.text));
|
72
|
+
}
|
73
|
+
else if (this.props.style === 'translucent') {
|
74
|
+
return (React.createElement("span", { className: classes, style: { color: this.props.hexColor, backgroundColor: "".concat(this.props.hexColor, "33") } }, this.props.text));
|
75
|
+
}
|
76
|
+
else {
|
77
|
+
return (React.createElement("span", { className: classes, style: this.props.hexColor
|
78
|
+
? { backgroundColor: this.props.hexColor, color: getTextColor(this.props.hexColor) }
|
79
|
+
: undefined }, this.props.text));
|
80
|
+
}
|
63
81
|
}
|
64
82
|
};
|
65
83
|
return Label;
|
66
84
|
}(React.PureComponent));
|
67
85
|
exports.Label = Label;
|
86
|
+
function getTextColor(backgroundColor) {
|
87
|
+
if (backgroundColor) {
|
88
|
+
var r = parseInt(backgroundColor.substr(1, 2), 16);
|
89
|
+
var g = parseInt(backgroundColor.substr(3, 2), 16);
|
90
|
+
var b = parseInt(backgroundColor.substr(5, 2), 16);
|
91
|
+
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
|
92
|
+
return (yiq >= 128) ? 'black' : 'white';
|
93
|
+
}
|
94
|
+
else {
|
95
|
+
return;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
exports.getTextColor = getTextColor;
|
@@ -53,7 +53,7 @@ var AuthoringContainer = /** @class */ (function (_super) {
|
|
53
53
|
_a['open-editor'] = this.props.open,
|
54
54
|
_a));
|
55
55
|
return (React.createElement("div", { className: classes },
|
56
|
-
React.createElement("div", { className: 'sd-editor__container' }, this.props.children)));
|
56
|
+
React.createElement("div", { className: "sd-editor__container ".concat(this.props.large ? 'sd-editor__container--large' : '') }, this.props.children)));
|
57
57
|
};
|
58
58
|
return AuthoringContainer;
|
59
59
|
}(React.PureComponent));
|
@@ -50,7 +50,7 @@ var AuthoringFrame = /** @class */ (function (_super) {
|
|
50
50
|
this.props.main && (React.createElement(_1.AuthoringFrameMain, null, this.props.main)),
|
51
51
|
this.props.sidePanel && (React.createElement(_1.AuthoringFrameSidePanel, { opened: this.props.sidePanelOpen, pinned: this.props.sidePanelPinned }, this.props.sidePanel)),
|
52
52
|
this.props.sideOverlay && (React.createElement(_1.AuthoringFrameSidePanelOverlay, { opened: this.props.sideOverlayOpen }, this.props.sideOverlay)),
|
53
|
-
this.props.sideBar && (React.createElement(_1.AuthoringFrameRightBar,
|
53
|
+
this.props.sideBar && (React.createElement(_1.AuthoringFrameRightBar, { closed: this.props.sideBarClosed }, this.props.sideBar)),
|
54
54
|
this.props.overlayPanel && (React.createElement(_1.AuthoringFrameOverlay, null, this.props.overlayPanel))));
|
55
55
|
};
|
56
56
|
return AuthoringFrame;
|
@@ -1,8 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
interface IProps {
|
3
3
|
children?: React.ReactNode;
|
4
|
+
closed?: boolean;
|
4
5
|
}
|
5
|
-
|
6
|
-
|
6
|
+
interface IState {
|
7
|
+
children?: React.ReactNode;
|
8
|
+
closed?: boolean;
|
9
|
+
}
|
10
|
+
export declare class AuthoringFrameRightBar extends React.PureComponent<IProps, IState> {
|
11
|
+
constructor(props: IProps);
|
12
|
+
componentDidUpdate(prevProps: Readonly<IProps>): void;
|
13
|
+
render(): false | JSX.Element;
|
7
14
|
}
|
8
15
|
export {};
|