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,40 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IProps<T> {
|
3
|
+
value: Array<T>;
|
4
|
+
options: Array<T>;
|
5
|
+
placeholder?: string;
|
6
|
+
optionLabel: string;
|
7
|
+
emptyFilterMessage?: string;
|
8
|
+
filterPlaceholder?: string;
|
9
|
+
maxSelectedLabels?: number;
|
10
|
+
selectedItemsLabel?: string;
|
11
|
+
ariaLabelledBy?: string;
|
12
|
+
tabIndex?: string | any;
|
13
|
+
filter?: boolean;
|
14
|
+
showClear?: boolean;
|
15
|
+
showSelectAll?: boolean;
|
16
|
+
itemTemplate?(item: any): JSX.Element | undefined;
|
17
|
+
selectedItemTemplate?(value: any): JSX.Element | undefined;
|
18
|
+
onChange(newValue: string): void;
|
19
|
+
invalid?: boolean;
|
20
|
+
inlineLabel?: boolean;
|
21
|
+
labelHidden?: boolean;
|
22
|
+
tabindex?: number;
|
23
|
+
fullWidth?: boolean;
|
24
|
+
info?: string;
|
25
|
+
error?: string;
|
26
|
+
required?: boolean;
|
27
|
+
label?: string;
|
28
|
+
disabled?: boolean;
|
29
|
+
}
|
30
|
+
interface IState<T> {
|
31
|
+
options: Array<T>;
|
32
|
+
value: Array<T>;
|
33
|
+
invalid: boolean;
|
34
|
+
}
|
35
|
+
export declare class MultiSelect<T> extends React.Component<IProps<T>, IState<T>> {
|
36
|
+
private htmlId;
|
37
|
+
constructor(props: IProps<T>);
|
38
|
+
render(): JSX.Element;
|
39
|
+
}
|
40
|
+
export {};
|
@@ -0,0 +1,70 @@
|
|
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.MultiSelect = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var multiselect_1 = require("@superdesk/primereact/multiselect");
|
43
|
+
var classnames_1 = __importDefault(require("classnames"));
|
44
|
+
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
45
|
+
var Form_1 = require("./Form");
|
46
|
+
var MultiSelect = /** @class */ (function (_super) {
|
47
|
+
__extends(MultiSelect, _super);
|
48
|
+
function MultiSelect(props) {
|
49
|
+
var _this = _super.call(this, props) || this;
|
50
|
+
_this.htmlId = (0, react_id_generator_1.default)();
|
51
|
+
_this.state = {
|
52
|
+
value: [],
|
53
|
+
options: [],
|
54
|
+
invalid: _this.props.invalid ? _this.props.invalid : false,
|
55
|
+
};
|
56
|
+
return _this;
|
57
|
+
}
|
58
|
+
MultiSelect.prototype.render = function () {
|
59
|
+
var _this = this;
|
60
|
+
var _a;
|
61
|
+
var classes = (0, classnames_1.default)({
|
62
|
+
'showSelectAll': this.props.showSelectAll,
|
63
|
+
'showFilter': this.props.filter,
|
64
|
+
});
|
65
|
+
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 },
|
66
|
+
React.createElement(multiselect_1.MultiSelect, { panelClassName: classes, value: this.props.value, options: this.props.options, onChange: function (e) { return _this.props.onChange(e); }, display: "chip", filter: this.props.filter, filterBy: this.props.optionLabel, appendTo: document.body, placeholder: this.props.placeholder, optionLabel: this.props.optionLabel, emptyFilterMessage: this.props.emptyFilterMessage, filterPlaceholder: this.props.filterPlaceholder, itemTemplate: this.props.itemTemplate, selectedItemTemplate: this.props.selectedItemTemplate, maxSelectedLabels: (_a = this.props.maxSelectedLabels) !== null && _a !== void 0 ? _a : 4, selectedItemsLabel: this.props.selectedItemsLabel, ariaLabelledBy: this.htmlId + 'label', tabIndex: this.props.tabIndex ? this.props.tabIndex : '0', showClear: this.props.showClear, disabled: this.props.disabled, inputId: this.htmlId })));
|
67
|
+
};
|
68
|
+
return MultiSelect;
|
69
|
+
}(React.Component));
|
70
|
+
exports.MultiSelect = MultiSelect;
|
@@ -5,7 +5,7 @@ interface IProps {
|
|
5
5
|
text?: string;
|
6
6
|
iconSize?: 'small' | 'big';
|
7
7
|
theme?: 'light' | 'dark';
|
8
|
-
type?: 'default' | 'primary' | 'highlight' | 'darker';
|
8
|
+
type?: 'default' | 'primary' | 'highlight' | 'darker' | 'dark';
|
9
9
|
state?: 'normal' | 'active';
|
10
10
|
value?: 'button' | 'submit' | 'reset';
|
11
11
|
onClick(): void;
|
@@ -71,7 +71,7 @@ var BottomNav = /** @class */ (function (_super) {
|
|
71
71
|
};
|
72
72
|
BottomNav.prototype.render = function () {
|
73
73
|
var _this = this;
|
74
|
-
return (React.createElement("ul", { className: 'sd-bottom-nav-list' }, this.
|
74
|
+
return (React.createElement("ul", { className: 'sd-bottom-nav-list' }, this.props.items.map(function (item, index) {
|
75
75
|
return (React.createElement("li", { key: index, className: 'sd-bottom-nav-list__item' + (item['active'] ? ' sd-bottom-nav-list__item--active' : (index === _this.state.index ? ' sd-bottom-nav-list__item--active' : '')) },
|
76
76
|
React.createElement("a", { className: 'sd-bottom-nav-list__item-title', onClick: function (event) {
|
77
77
|
_this.handleClick(index);
|
@@ -80,7 +80,7 @@ var BottomNav = /** @class */ (function (_super) {
|
|
80
80
|
item['icon'] &&
|
81
81
|
React.createElement(Icon_1.Icon, { name: item['icon'] }),
|
82
82
|
React.createElement("span", null, item.title)),
|
83
|
-
React.createElement(IconButton_1.IconButton, { size: 'small', icon: "close-small", ariaValue: 'Delete', onClick: function () { return
|
83
|
+
React.createElement(IconButton_1.IconButton, { size: 'small', icon: "close-small", ariaValue: 'Delete', onClick: function () { return item.onRemove(index); } })));
|
84
84
|
})));
|
85
85
|
};
|
86
86
|
return BottomNav;
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
interface IProps {
|
3
|
-
value?: string
|
3
|
+
value?: string;
|
4
4
|
type?: 'expanded' | 'collapsed' | 'boxed';
|
5
5
|
placeholder: string;
|
6
6
|
focused?: boolean;
|
7
7
|
boxed?: boolean;
|
8
|
-
onSubmit?(): void;
|
8
|
+
onSubmit?(value: string | number): void;
|
9
9
|
}
|
10
10
|
interface IState {
|
11
11
|
inputValue: any;
|
12
12
|
type: string;
|
13
13
|
focused: boolean;
|
14
14
|
boxed?: boolean;
|
15
|
+
keyDown?: boolean;
|
15
16
|
}
|
16
17
|
export declare class SearchBar extends React.PureComponent<IProps, IState> {
|
17
18
|
private inputRef;
|
@@ -57,6 +57,7 @@ var SearchBar = /** @class */ (function (_super) {
|
|
57
57
|
focused: _this.props.focused ? _this.props.focused : false,
|
58
58
|
type: _this.props.type ? _this.props.type : 'expanded',
|
59
59
|
boxed: _this.props.boxed ? _this.props.boxed : false,
|
60
|
+
keyDown: false,
|
60
61
|
};
|
61
62
|
_this.inputRef = React.createRef();
|
62
63
|
return _this;
|
@@ -77,12 +78,35 @@ var SearchBar = /** @class */ (function (_super) {
|
|
77
78
|
_a));
|
78
79
|
return (React.createElement("div", { className: classes, ref: this.inputRef },
|
79
80
|
React.createElement("label", { className: "sd-searchbar__icon" }),
|
80
|
-
React.createElement("input", { id: "search-input", ref: function (input) { return (input && _this.props.focused) && input.focus(); }, className: "sd-searchbar__input", type: "text", placeholder: this.props.placeholder, value: this.state.inputValue,
|
81
|
+
React.createElement("input", { id: "search-input", ref: function (input) { return (input && _this.props.focused) && input.focus(); }, className: "sd-searchbar__input", type: "text", placeholder: this.props.placeholder, value: this.state.inputValue, onKeyPress: function (event) {
|
82
|
+
if (event.key === 'Enter') {
|
83
|
+
if (_this.props.onSubmit) {
|
84
|
+
_this.props.onSubmit(_this.state.inputValue);
|
85
|
+
}
|
86
|
+
_this.setState({ keyDown: true });
|
87
|
+
}
|
88
|
+
}, onKeyUp: function (event) {
|
89
|
+
if (event.key === 'Enter') {
|
90
|
+
_this.setState({ keyDown: false });
|
91
|
+
}
|
92
|
+
}, onChange: function (event) { return _this.setState({ inputValue: event.target.value }); }, onFocus: function () { return _this.setState({ focused: true }); } }),
|
81
93
|
this.state.inputValue &&
|
82
|
-
React.createElement("button", { className: "sd-searchbar__cancel", onClick: function () {
|
94
|
+
React.createElement("button", { className: "sd-searchbar__cancel", onClick: function () {
|
95
|
+
_this.setState({ inputValue: '' });
|
96
|
+
setTimeout(function () {
|
97
|
+
if (_this.props.onSubmit) {
|
98
|
+
_this.props.onSubmit(_this.state.inputValue);
|
99
|
+
}
|
100
|
+
});
|
101
|
+
} },
|
83
102
|
React.createElement(Icon_1.Icon, { name: 'remove-sign' })),
|
84
|
-
|
85
|
-
React.createElement(
|
103
|
+
this.state.inputValue &&
|
104
|
+
React.createElement("button", { id: "sd-searchbar__search-btn", className: "sd-searchbar__search-btn ".concat(this.state.keyDown ? 'sd-searchbar__search-btn--active' : ''), onClick: function () {
|
105
|
+
if (_this.props.onSubmit) {
|
106
|
+
_this.props.onSubmit(_this.state.inputValue);
|
107
|
+
}
|
108
|
+
} },
|
109
|
+
React.createElement(Icon_1.Icon, { name: 'chevron-right-thin' }))));
|
86
110
|
};
|
87
111
|
return SearchBar;
|
88
112
|
}(React.PureComponent));
|
@@ -22,8 +22,8 @@ interface IState {
|
|
22
22
|
invalid: boolean;
|
23
23
|
}
|
24
24
|
declare class Select extends React.Component<ISelect, IState> {
|
25
|
+
private htmlId;
|
25
26
|
constructor(props: ISelect);
|
26
|
-
htmlId: string;
|
27
27
|
handleChange(event: React.ChangeEvent<HTMLSelectElement>): void;
|
28
28
|
render(): JSX.Element;
|
29
29
|
}
|
@@ -39,8 +39,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
40
40
|
exports.Option = exports.Select = 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 Select = /** @class */ (function (_super) {
|
45
46
|
__extends(Select, _super);
|
46
47
|
function Select(props) {
|
@@ -59,31 +60,8 @@ var Select = /** @class */ (function (_super) {
|
|
59
60
|
this.props.onChange(event.target.value);
|
60
61
|
};
|
61
62
|
Select.prototype.render = function () {
|
62
|
-
|
63
|
-
|
64
|
-
'sd-input--inline-label': this.props.inlineLabel,
|
65
|
-
'sd-input--required': this.props.required,
|
66
|
-
'sd-input--disabled': this.props.disabled,
|
67
|
-
'sd-input--full-width': this.props.fullWidth,
|
68
|
-
'sd-input--invalid': this.props.invalid || this.state.invalid,
|
69
|
-
'sd-input--medium': this.props.size === undefined
|
70
|
-
},
|
71
|
-
_a["sd-input--".concat(this.props.size)] = this.props.size || this.props.size !== undefined,
|
72
|
-
_a['sd-input--boxed-style'] = this.props.boxedStyle,
|
73
|
-
_a['sd-input--boxed-label'] = this.props.boxedLable,
|
74
|
-
_a));
|
75
|
-
var labelClasses = (0, classnames_1.default)('sd-input__label', {
|
76
|
-
'a11y-only': this.props.labelHidden,
|
77
|
-
});
|
78
|
-
return (React.createElement("div", { className: classes },
|
79
|
-
React.createElement("label", { className: labelClasses, htmlFor: this.htmlId, tabIndex: this.props.tabindex === undefined ? undefined : -1 }, this.props.label),
|
80
|
-
React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId, tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled }, this.props.children),
|
81
|
-
React.createElement("div", { className: 'sd-input__message-box' },
|
82
|
-
this.props.info && !this.props.invalid && !this.state.invalid ?
|
83
|
-
React.createElement("div", { className: 'sd-input__hint' }, this.props.info) : null,
|
84
|
-
this.props.invalid || this.state.invalid ?
|
85
|
-
React.createElement("div", { className: 'sd-input__message' }, this.props.error)
|
86
|
-
: null)));
|
63
|
+
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 },
|
64
|
+
React.createElement("select", { className: 'sd-input__select', id: this.htmlId, value: this.state.value, "aria-describedby": this.htmlId, tabIndex: this.props.tabindex, onChange: this.handleChange, disabled: this.props.disabled }, this.props.children)));
|
87
65
|
};
|
88
66
|
return Select;
|
89
67
|
}(React.Component));
|
@@ -12,19 +12,29 @@ interface IProps<T> {
|
|
12
12
|
noResultsFoundMessage: string;
|
13
13
|
filterPlaceholder?: string;
|
14
14
|
disabled?: boolean;
|
15
|
-
required?: boolean;
|
16
15
|
autoFocus?: boolean;
|
17
16
|
autoOpen?: boolean;
|
18
17
|
width?: 'min' | '100%';
|
19
18
|
zIndex?: number;
|
20
19
|
'data-test-id'?: string;
|
20
|
+
inlineLabel?: boolean;
|
21
|
+
required?: boolean;
|
22
|
+
fullWidth?: boolean;
|
23
|
+
invalid?: boolean;
|
24
|
+
labelHidden?: boolean;
|
25
|
+
tabindex?: number;
|
26
|
+
label?: string;
|
27
|
+
info?: string;
|
28
|
+
error?: string;
|
21
29
|
}
|
22
30
|
interface IState<T> {
|
23
31
|
options: Array<T>;
|
24
32
|
loading: boolean;
|
33
|
+
invalid: boolean;
|
25
34
|
}
|
26
35
|
export declare class SelectWithTemplate<T> extends React.Component<IProps<T>, IState<T>> {
|
27
36
|
componentRef: Dropdown | null;
|
37
|
+
private htmlId;
|
28
38
|
constructor(props: IProps<T>);
|
29
39
|
componentDidMount(): void;
|
30
40
|
render(): JSX.Element;
|
@@ -33,18 +33,26 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
33
|
__setModuleDefault(result, mod);
|
34
34
|
return result;
|
35
35
|
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
37
40
|
exports.SelectWithTemplate = void 0;
|
38
41
|
var React = __importStar(require("react"));
|
39
42
|
var dropdown_1 = require("@superdesk/primereact/dropdown");
|
43
|
+
// import classNames from 'classnames';
|
44
|
+
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
45
|
+
var Form_1 = require("./Form");
|
40
46
|
var labelKey = 'label';
|
41
47
|
var SelectWithTemplate = /** @class */ (function (_super) {
|
42
48
|
__extends(SelectWithTemplate, _super);
|
43
49
|
function SelectWithTemplate(props) {
|
44
50
|
var _this = _super.call(this, props) || this;
|
51
|
+
_this.htmlId = (0, react_id_generator_1.default)();
|
45
52
|
_this.state = {
|
46
53
|
options: [],
|
47
54
|
loading: false,
|
55
|
+
invalid: _this.props.invalid ? _this.props.invalid : false,
|
48
56
|
};
|
49
57
|
_this.componentRef = null;
|
50
58
|
return _this;
|
@@ -84,16 +92,17 @@ var SelectWithTemplate = /** @class */ (function (_super) {
|
|
84
92
|
// needs to be passed to prime react component
|
85
93
|
// or it will not be displayed at all, even if returned by itemTemplate
|
86
94
|
var fakePlaceholderWithNonBreakingSpace = ' ';
|
87
|
-
return (React.createElement(
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
95
|
+
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 },
|
96
|
+
React.createElement(dropdown_1.Dropdown, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', value: valueInternal, options: optionsInternal, onChange: function (e) {
|
97
|
+
onChange(e.value == null ? null : e.value.original);
|
98
|
+
}, placeholder: fakePlaceholderWithNonBreakingSpace, filterPlaceholder: filterPlaceholder, filter: true, filterBy: labelKey, showClear: !required, emptyFilterMessage: emptyFilterMessage, valueTemplate: function (option) { return React.createElement(ItemTemplate, { option: option == null ? null : option.original }); }, itemTemplate: function (option) { return React.createElement(ItemTemplate, { option: option.original }); }, disabled: disabled, required: required, autoFocus: autoFocus, appendTo: document.body, loading: loading, onFilterInputChange: function (searchString) {
|
99
|
+
_this.setState({ loading: true });
|
100
|
+
getItems(searchString).then(function (_options) {
|
101
|
+
_this.setState({ options: _options, loading: false });
|
102
|
+
});
|
103
|
+
}, zIndex: zIndex, style: width === '100%' ? { display: 'flex', width: '100%' } : {}, ref: function (componentRef) {
|
104
|
+
_this.componentRef = componentRef;
|
105
|
+
} })));
|
97
106
|
};
|
98
107
|
return SelectWithTemplate;
|
99
108
|
}(React.Component));
|
@@ -2,10 +2,20 @@ import * as React from 'react';
|
|
2
2
|
interface IProps {
|
3
3
|
value: string;
|
4
4
|
onChange(valueNext: string): void;
|
5
|
-
|
5
|
+
allowSeconds?: boolean;
|
6
6
|
disabled?: boolean;
|
7
|
+
inlineLabel?: boolean;
|
8
|
+
required?: boolean;
|
9
|
+
fullWidth?: boolean;
|
10
|
+
invalid?: boolean;
|
11
|
+
labelHidden?: boolean;
|
12
|
+
tabindex?: number;
|
13
|
+
label?: string;
|
14
|
+
info?: string;
|
15
|
+
error?: string;
|
7
16
|
}
|
8
17
|
export declare class TimePicker extends React.PureComponent<IProps> {
|
18
|
+
private htmlId;
|
9
19
|
render(): JSX.Element;
|
10
20
|
}
|
11
21
|
export {};
|
@@ -33,18 +33,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
33
|
__setModuleDefault(result, mod);
|
34
34
|
return result;
|
35
35
|
};
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
38
|
+
};
|
36
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
37
40
|
exports.TimePicker = void 0;
|
38
41
|
var React = __importStar(require("react"));
|
42
|
+
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
43
|
+
var Form_1 = require("./Form");
|
39
44
|
var TimePicker = /** @class */ (function (_super) {
|
40
45
|
__extends(TimePicker, _super);
|
41
46
|
function TimePicker() {
|
42
|
-
|
47
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
48
|
+
_this.htmlId = (0, react_id_generator_1.default)();
|
49
|
+
return _this;
|
43
50
|
}
|
44
51
|
TimePicker.prototype.render = function () {
|
45
52
|
var _this = this;
|
46
|
-
return (React.createElement(
|
47
|
-
React.createElement("input", { type: "time", className: "sd-input__input", value: this.props.value, required: this.props.required, disabled: this.props.disabled, onChange: function (event) {
|
53
|
+
return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, required: this.props.required, disabled: this.props.disabled, invalid: this.props.invalid, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, fullWidth: this.props.fullWidth, htmlId: this.htmlId, tabindex: this.props.tabindex },
|
54
|
+
React.createElement("input", { id: this.htmlId, "aria-labelledby": this.htmlId + 'label', type: "time", step: this.props.allowSeconds ? 1 : undefined, className: "sd-input__input", value: this.props.value, required: this.props.required, disabled: this.props.disabled, onChange: function (event) {
|
48
55
|
_this.props.onChange(event.target.value);
|
49
56
|
} })));
|
50
57
|
};
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import * as React from "react";
|
2
|
+
interface IState<T> {
|
3
|
+
value: Array<T>;
|
4
|
+
options: Array<ITreeNode<T>>;
|
5
|
+
firstBranchOptions: Array<any>;
|
6
|
+
openDropdown: boolean;
|
7
|
+
activeTree: Array<any>;
|
8
|
+
filterArr: Array<any>;
|
9
|
+
searchFieldValue: string;
|
10
|
+
buttonTree: Array<any>;
|
11
|
+
buttonValue: any;
|
12
|
+
buttonMouseEvent: boolean;
|
13
|
+
loading: boolean;
|
14
|
+
}
|
15
|
+
interface IPropsBase<T> {
|
16
|
+
value?: Array<T>;
|
17
|
+
selectBranchWithChildren?: boolean;
|
18
|
+
readOnly?: boolean;
|
19
|
+
width?: string;
|
20
|
+
allowMultiple?: boolean;
|
21
|
+
loading?: boolean;
|
22
|
+
singleLevelSearch?: boolean;
|
23
|
+
placeholder?: string;
|
24
|
+
searchPlaceholder?: string;
|
25
|
+
invalid?: boolean;
|
26
|
+
inlineLabel?: boolean;
|
27
|
+
labelHidden?: boolean;
|
28
|
+
tabindex?: number;
|
29
|
+
fullWidth?: boolean;
|
30
|
+
info?: string;
|
31
|
+
error?: string;
|
32
|
+
required?: boolean;
|
33
|
+
label?: string;
|
34
|
+
disabled?: boolean;
|
35
|
+
getLabel(item: T): string;
|
36
|
+
getId(item: T): string;
|
37
|
+
getBackgroundColor?(item: T): string;
|
38
|
+
getBorderColor?(item: T): string;
|
39
|
+
optionTemplate?(item: T): React.ComponentType<T> | JSX.Element;
|
40
|
+
valueTemplate?(item: T, Wrapper: any): React.ComponentType<T> | JSX.Element;
|
41
|
+
onChange(e: Array<T>): void;
|
42
|
+
}
|
43
|
+
interface IPropsSync<T> extends IPropsBase<T> {
|
44
|
+
kind: 'synchronous';
|
45
|
+
getOptions(): Array<ITreeNode<T>>;
|
46
|
+
}
|
47
|
+
interface IPropsAsync<T> extends IPropsBase<T> {
|
48
|
+
kind: 'asynchronous';
|
49
|
+
getOptions?(): Array<ITreeNode<T>>;
|
50
|
+
searchOptions(term: string, callback?: (options: Array<ITreeNode<T>>) => void): any;
|
51
|
+
}
|
52
|
+
declare type IProps<T> = IPropsSync<T> | IPropsAsync<T>;
|
53
|
+
export interface ITreeNode<T> {
|
54
|
+
value: T;
|
55
|
+
children?: Array<ITreeNode<T>>;
|
56
|
+
}
|
57
|
+
export declare class TreeSelect<T> extends React.Component<IProps<T>, IState<T>> {
|
58
|
+
private dropdownRef;
|
59
|
+
private openDropdownRef;
|
60
|
+
private htmlId;
|
61
|
+
private popperInstance;
|
62
|
+
constructor(props: IProps<T>);
|
63
|
+
componentDidMount: () => void;
|
64
|
+
componentDidUpdate(prevProps: Readonly<IProps<T>>, prevState: Readonly<IState<T>>): void;
|
65
|
+
toggleMenu(): void;
|
66
|
+
removeClick(i: number): void;
|
67
|
+
handleMultiLevel(item: ITreeNode<T>): void;
|
68
|
+
handleButton(item: ITreeNode<T>): void;
|
69
|
+
handleValue(event: React.MouseEvent<HTMLLIElement, MouseEvent>, item: ITreeNode<T>): void;
|
70
|
+
handleBranchValue(event: React.MouseEvent<HTMLButtonElement, MouseEvent>, item: ITreeNode<T>): void;
|
71
|
+
handleTree(event: React.MouseEvent<HTMLLIElement, MouseEvent>, option: ITreeNode<T>): void;
|
72
|
+
backButton: () => false | undefined;
|
73
|
+
backButtonValue: () => void;
|
74
|
+
recursion(arr: Array<ITreeNode<T>>): void;
|
75
|
+
filteredItem(arr: Array<ITreeNode<T>>): JSX.Element | JSX.Element[] | undefined;
|
76
|
+
banchButton(): JSX.Element;
|
77
|
+
private debounceFn;
|
78
|
+
private ICancelFn;
|
79
|
+
handleDebounce(): void;
|
80
|
+
render(): JSX.Element;
|
81
|
+
}
|
82
|
+
export {};
|