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
@@ -38,11 +38,22 @@ exports.AuthoringFrameRightBar = void 0;
|
|
38
38
|
var React = __importStar(require("react"));
|
39
39
|
var AuthoringFrameRightBar = /** @class */ (function (_super) {
|
40
40
|
__extends(AuthoringFrameRightBar, _super);
|
41
|
-
function AuthoringFrameRightBar() {
|
42
|
-
|
41
|
+
function AuthoringFrameRightBar(props) {
|
42
|
+
var _this = _super.call(this, props) || this;
|
43
|
+
_this.state = {
|
44
|
+
closed: _this.props.closed ? _this.props.closed : false,
|
45
|
+
};
|
46
|
+
return _this;
|
43
47
|
}
|
48
|
+
AuthoringFrameRightBar.prototype.componentDidUpdate = function (prevProps) {
|
49
|
+
if (prevProps.closed !== this.props.closed) {
|
50
|
+
this.setState({
|
51
|
+
closed: this.props.closed,
|
52
|
+
});
|
53
|
+
}
|
54
|
+
};
|
44
55
|
AuthoringFrameRightBar.prototype.render = function () {
|
45
|
-
return (React.createElement("div", { className: "sd-editor-grid__sidetabs-bar" }, this.props.children));
|
56
|
+
return (!this.state.closed && React.createElement("div", { className: "sd-editor-grid__sidetabs-bar" }, this.props.children));
|
46
57
|
};
|
47
58
|
return AuthoringFrameRightBar;
|
48
59
|
}(React.PureComponent));
|
@@ -46,7 +46,7 @@ var AuthoringInnerHeader = /** @class */ (function (_super) {
|
|
46
46
|
function AuthoringInnerHeader(props) {
|
47
47
|
var _this = _super.call(this, props) || this;
|
48
48
|
_this.state = {
|
49
|
-
collapsed: false,
|
49
|
+
collapsed: _this.props.collapsed ? _this.props.collapsed : false,
|
50
50
|
};
|
51
51
|
return _this;
|
52
52
|
}
|
@@ -46,7 +46,7 @@ var AuthoringMain = /** @class */ (function (_super) {
|
|
46
46
|
return (React.createElement(_1.AuthoringMainContainer, null,
|
47
47
|
this.props.toolBar && (React.createElement(_1.AuthoringMainToolBar, { toolbarCustom: this.props.toolbarCustom }, this.props.toolBar)),
|
48
48
|
React.createElement(_1.AuthoringMainContent, null,
|
49
|
-
this.props.authoringHeader && (React.createElement(_1.AuthoringInnerHeader, { headerPadding: this.props.headerPadding }, this.props.authoringHeader)),
|
49
|
+
this.props.authoringHeader && (React.createElement(_1.AuthoringInnerHeader, { headerPadding: this.props.headerPadding, collapsed: this.props.headerCollapsed }, this.props.authoringHeader)),
|
50
50
|
this.props.authoringBookmarks && (React.createElement(_1.AuthorinInnerSideBar, null, this.props.authoringBookmarks)),
|
51
51
|
React.createElement(_1.AuthoringInnerBody, null, this.props.children))));
|
52
52
|
};
|
@@ -46,7 +46,7 @@ var CoreLayout = /** @class */ (function (_super) {
|
|
46
46
|
return (React.createElement(_1.CoreLayoutContainer, null,
|
47
47
|
this.props.slideInMenu && (React.createElement(_1.CoreLayoutSlideInMenu, { menuId: this.props.menuId, menuOpen: this.props.menuOpen }, this.props.slideInMenu)),
|
48
48
|
this.props.topMenu && (React.createElement(_1.CoreLayoutTopMenu, { buttonAnimation: this.props.buttonAnimation, heading: this.props.heading, onClick: this.props.onClick, active: this.props.active, ariaControls: this.props.ariaControls }, this.props.topMenu)),
|
49
|
-
React.createElement(_1.CoreLayoutMain,
|
49
|
+
React.createElement(_1.CoreLayoutMain, { editorFullWidth: this.props.editorFullWidth }, this.props.children),
|
50
50
|
this.props.footer && (React.createElement(_1.CoreLayoutFooter, null, this.props.footer)),
|
51
51
|
this.props.overlay && (React.createElement(_1.CoreLayoutOverlay, null, this.props.overlay))));
|
52
52
|
};
|
@@ -33,16 +33,23 @@ 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.CoreLayoutMain = void 0;
|
38
41
|
var React = __importStar(require("react"));
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
39
43
|
var CoreLayoutMain = /** @class */ (function (_super) {
|
40
44
|
__extends(CoreLayoutMain, _super);
|
41
45
|
function CoreLayoutMain() {
|
42
46
|
return _super !== null && _super.apply(this, arguments) || this;
|
43
47
|
}
|
44
48
|
CoreLayoutMain.prototype.render = function () {
|
45
|
-
|
49
|
+
var classes = (0, classnames_1.default)('sd-content sd-content-wrapper', {
|
50
|
+
'sd-content-wrapper--editor-full': this.props.editorFullWidth,
|
51
|
+
});
|
52
|
+
return (React.createElement("section", { id: this.props.id, className: classes }, this.props.children));
|
46
53
|
};
|
47
54
|
return CoreLayoutMain;
|
48
55
|
}(React.PureComponent));
|
@@ -31,6 +31,6 @@ var Layout = function (_a) {
|
|
31
31
|
React.createElement("i", { className: 'icon-collapse icon--white' })),
|
32
32
|
React.createElement("p", { className: 'sd-top-menu__header' }, header)),
|
33
33
|
React.createElement("section", { id: '1', className: 'sd-content sd-content-wrapper' }, children),
|
34
|
-
React.createElement("footer", { className: 'sd-bottom-bar' }, "
|
34
|
+
React.createElement("footer", { className: 'sd-bottom-bar' }, "Footer")));
|
35
35
|
};
|
36
36
|
exports.Layout = Layout;
|
@@ -13,7 +13,8 @@ interface IMenuGroup {
|
|
13
13
|
interface IMenu {
|
14
14
|
className?: string;
|
15
15
|
groups: Array<IMenuGroup>;
|
16
|
-
activeItemId
|
16
|
+
activeItemId?: string;
|
17
|
+
scrollTo?: string;
|
17
18
|
ariaLabel?: string;
|
18
19
|
scrollSpy?: string;
|
19
20
|
offset?: number;
|
@@ -28,6 +29,7 @@ interface IState {
|
|
28
29
|
export declare class LeftMenu extends React.PureComponent<IMenu, IState> {
|
29
30
|
constructor(props: IMenu);
|
30
31
|
handleClick(item: IMenuItem, event?: React.MouseEvent): void;
|
32
|
+
componentDidMount(): void;
|
31
33
|
render(): JSX.Element;
|
32
34
|
}
|
33
35
|
export {};
|
@@ -55,7 +55,7 @@ var LeftMenu = /** @class */ (function (_super) {
|
|
55
55
|
function LeftMenu(props) {
|
56
56
|
var _this = _super.call(this, props) || this;
|
57
57
|
_this.state = {
|
58
|
-
active:
|
58
|
+
active: _this.props.activeItemId ? _this.props.activeItemId : '',
|
59
59
|
};
|
60
60
|
return _this;
|
61
61
|
}
|
@@ -74,6 +74,13 @@ var LeftMenu = /** @class */ (function (_super) {
|
|
74
74
|
}
|
75
75
|
this.props.onSelect(item.id, item.route ? item.route : "");
|
76
76
|
};
|
77
|
+
LeftMenu.prototype.componentDidMount = function () {
|
78
|
+
var _a;
|
79
|
+
if (this.props.scrollTo) {
|
80
|
+
return (_a = document
|
81
|
+
.getElementById(this.props.scrollTo)) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest", behavior: "smooth" });
|
82
|
+
}
|
83
|
+
};
|
77
84
|
LeftMenu.prototype.render = function () {
|
78
85
|
var _a;
|
79
86
|
var _this = this;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
interface IPropsItem {
|
3
|
+
action?: React.ReactNode;
|
4
|
+
locked?: boolean;
|
5
|
+
itemColum: Array<{
|
6
|
+
itemRow: Array<{
|
7
|
+
content: any;
|
8
|
+
}>;
|
9
|
+
border?: boolean;
|
10
|
+
fullwidth?: boolean;
|
11
|
+
}>;
|
12
|
+
activated?: boolean;
|
13
|
+
selected?: boolean;
|
14
|
+
archived?: boolean;
|
15
|
+
loading?: boolean;
|
16
|
+
onClick?(): void;
|
17
|
+
onDoubleClick?(): void;
|
18
|
+
}
|
19
|
+
declare class ContentListItem extends React.PureComponent<IPropsItem> {
|
20
|
+
private timer;
|
21
|
+
private delay;
|
22
|
+
private prevent;
|
23
|
+
onSingleClick: () => void;
|
24
|
+
onDoubleClick: () => void;
|
25
|
+
onActionMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
|
26
|
+
render(): JSX.Element;
|
27
|
+
}
|
28
|
+
interface IProps {
|
29
|
+
items: Array<{
|
30
|
+
itemColum: Array<IItemArray>;
|
31
|
+
locked?: boolean;
|
32
|
+
action?: React.ReactNode;
|
33
|
+
loading?: boolean;
|
34
|
+
activated?: boolean;
|
35
|
+
selected?: boolean;
|
36
|
+
archived?: boolean;
|
37
|
+
onClick?(): void;
|
38
|
+
onDoubleClick?(): void;
|
39
|
+
}>;
|
40
|
+
}
|
41
|
+
interface IItemArray {
|
42
|
+
itemRow: Array<{
|
43
|
+
content: React.ReactNode;
|
44
|
+
}>;
|
45
|
+
border?: boolean;
|
46
|
+
fullwidth?: boolean;
|
47
|
+
}
|
48
|
+
declare class ContentList extends React.PureComponent<IProps> {
|
49
|
+
render(): JSX.Element;
|
50
|
+
}
|
51
|
+
export { ContentList, ContentListItem };
|
@@ -0,0 +1,110 @@
|
|
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.ContentListItem = exports.ContentList = void 0;
|
41
|
+
var React = __importStar(require("react"));
|
42
|
+
var classnames_1 = __importDefault(require("classnames"));
|
43
|
+
var ContentListItem = /** @class */ (function (_super) {
|
44
|
+
__extends(ContentListItem, _super);
|
45
|
+
function ContentListItem() {
|
46
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
47
|
+
_this.delay = 200;
|
48
|
+
_this.prevent = false;
|
49
|
+
_this.onSingleClick = function () {
|
50
|
+
_this.timer = setTimeout(function () {
|
51
|
+
if (!_this.prevent) {
|
52
|
+
if (_this.props.onClick) {
|
53
|
+
_this.props.onClick();
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}, _this.delay);
|
57
|
+
};
|
58
|
+
_this.onDoubleClick = function () {
|
59
|
+
clearTimeout(_this.timer);
|
60
|
+
_this.prevent = true;
|
61
|
+
if (_this.props.onDoubleClick) {
|
62
|
+
_this.props.onDoubleClick();
|
63
|
+
}
|
64
|
+
setTimeout(function () {
|
65
|
+
_this.prevent = false;
|
66
|
+
}, _this.delay);
|
67
|
+
};
|
68
|
+
_this.onActionMenuClick = function (event) {
|
69
|
+
event.preventDefault();
|
70
|
+
event.stopPropagation();
|
71
|
+
};
|
72
|
+
return _this;
|
73
|
+
}
|
74
|
+
ContentListItem.prototype.render = function () {
|
75
|
+
var classes = (0, classnames_1.default)('sd-list-item sd-shadow--z1', {
|
76
|
+
'sd-list-item--activated': this.props.activated,
|
77
|
+
'sd-list-item--selected': this.props.selected,
|
78
|
+
'fetched': this.props.archived,
|
79
|
+
'actioning': this.props.loading,
|
80
|
+
});
|
81
|
+
return (React.createElement("div", { role: 'listitem', className: classes, onClick: this.onSingleClick, onDoubleClick: this.onDoubleClick },
|
82
|
+
this.props.locked
|
83
|
+
? React.createElement("div", { className: "sd-list-item__border sd-list-item__border--locked" })
|
84
|
+
: React.createElement("div", { className: "sd-list-item__border" }),
|
85
|
+
this.props.itemColum.map(function (item, index) {
|
86
|
+
return React.createElement("div", { className: "sd-list-item__column ".concat(item.fullwidth && 'sd-list-item__column--grow', " ").concat(!item.border && 'sd-list-item__column--no-border'), key: index }, item.itemRow.map(function (e, i) {
|
87
|
+
return (item.itemRow.length <= 1
|
88
|
+
? React.createElement(React.Fragment, { key: i }, e.content)
|
89
|
+
: React.createElement("div", { className: "sd-list-item__row", key: i }, e.content));
|
90
|
+
}));
|
91
|
+
}),
|
92
|
+
React.createElement("div", { className: "sd-list-item__action-menu", onClick: this.onActionMenuClick }, this.props.action)));
|
93
|
+
};
|
94
|
+
return ContentListItem;
|
95
|
+
}(React.PureComponent));
|
96
|
+
exports.ContentListItem = ContentListItem;
|
97
|
+
var ContentList = /** @class */ (function (_super) {
|
98
|
+
__extends(ContentList, _super);
|
99
|
+
function ContentList() {
|
100
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
101
|
+
}
|
102
|
+
ContentList.prototype.render = function () {
|
103
|
+
var classes = (0, classnames_1.default)('sd-list-item-group sd-list-item-group--space-between-items');
|
104
|
+
return (React.createElement("div", { role: 'list', className: classes }, this.props.items.map(function (item, index) {
|
105
|
+
return React.createElement(ContentListItem, { key: index, itemColum: item.itemColum, locked: item.locked, action: item.action, loading: item.loading, activated: item.activated, selected: item.selected, archived: item.archived, onClick: item.onClick, onDoubleClick: item.onDoubleClick });
|
106
|
+
})));
|
107
|
+
};
|
108
|
+
return ContentList;
|
109
|
+
}(React.PureComponent));
|
110
|
+
exports.ContentList = ContentList;
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { DropResult } from "react-beautiful-dnd";
|
3
|
+
import { IMenuItem, ISubmenu, IMenuGroup } from '../Dropdown';
|
4
|
+
export interface IProps {
|
5
|
+
array: Array<IPropsArrayItem>;
|
6
|
+
addItem?: boolean;
|
7
|
+
dragAndDrop?: boolean;
|
8
|
+
className?: string;
|
9
|
+
readOnly?: boolean;
|
10
|
+
showDragHandle?: 'always' | 'onHover' | 'none';
|
11
|
+
append?: boolean;
|
12
|
+
onDrag?(start: number, end: number): void;
|
13
|
+
onAddItem?(index: number, item?: IPropsArrayItem): void;
|
14
|
+
itemsDropdown?(index?: number): Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
15
|
+
}
|
16
|
+
export interface IPropsArrayItem {
|
17
|
+
start?: React.ReactNode;
|
18
|
+
center?: React.ReactNode;
|
19
|
+
end?: React.ReactNode;
|
20
|
+
action?: React.ReactNode;
|
21
|
+
hexColor?: string;
|
22
|
+
onClick?(): void;
|
23
|
+
onDoubleClick?(): void;
|
24
|
+
locked?: boolean;
|
25
|
+
positionLocked?: boolean;
|
26
|
+
}
|
27
|
+
interface IState {
|
28
|
+
items: Array<IPropsArrayItem>;
|
29
|
+
}
|
30
|
+
declare class TableList extends React.PureComponent<IProps, IState> {
|
31
|
+
constructor(props: IProps);
|
32
|
+
componentDidMount(): void;
|
33
|
+
componentDidUpdate(prevProps: IProps): void;
|
34
|
+
onDragEnd(result: DropResult): void | null;
|
35
|
+
dropDown(): JSX.Element;
|
36
|
+
render(): JSX.Element | null;
|
37
|
+
}
|
38
|
+
export interface IPropsItem {
|
39
|
+
start?: React.ReactNode;
|
40
|
+
center?: React.ReactNode;
|
41
|
+
end?: React.ReactNode;
|
42
|
+
action?: React.ReactNode;
|
43
|
+
addItem?: boolean;
|
44
|
+
dragAndDrop?: boolean;
|
45
|
+
hexColor?: string;
|
46
|
+
showDragHandle?: 'always' | 'onHover' | 'none';
|
47
|
+
locked?: boolean;
|
48
|
+
positionLocked?: boolean;
|
49
|
+
onClick?(): void;
|
50
|
+
onDoubleClick?(): void;
|
51
|
+
onSelect?(): void;
|
52
|
+
onAddItem?(e: number): void;
|
53
|
+
itemsDropdown?(index?: number): Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
54
|
+
}
|
55
|
+
declare class TableListItem extends React.PureComponent<IPropsItem> {
|
56
|
+
private timer;
|
57
|
+
private delay;
|
58
|
+
private prevent;
|
59
|
+
onSingleClick: () => void;
|
60
|
+
onDoubleClick: () => void;
|
61
|
+
onActionMenuClick: (event: React.MouseEvent<HTMLElement>) => void;
|
62
|
+
render(): JSX.Element;
|
63
|
+
}
|
64
|
+
export { TableList, TableListItem };
|
@@ -0,0 +1,240 @@
|
|
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 __assign = (this && this.__assign) || function () {
|
18
|
+
__assign = Object.assign || function(t) {
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
20
|
+
s = arguments[i];
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
22
|
+
t[p] = s[p];
|
23
|
+
}
|
24
|
+
return t;
|
25
|
+
};
|
26
|
+
return __assign.apply(this, arguments);
|
27
|
+
};
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
29
|
+
if (k2 === undefined) k2 = k;
|
30
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
31
|
+
}) : (function(o, m, k, k2) {
|
32
|
+
if (k2 === undefined) k2 = k;
|
33
|
+
o[k2] = m[k];
|
34
|
+
}));
|
35
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
36
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
37
|
+
}) : function(o, v) {
|
38
|
+
o["default"] = v;
|
39
|
+
});
|
40
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
41
|
+
if (mod && mod.__esModule) return mod;
|
42
|
+
var result = {};
|
43
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
44
|
+
__setModuleDefault(result, mod);
|
45
|
+
return result;
|
46
|
+
};
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
49
|
+
};
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
51
|
+
exports.TableListItem = exports.TableList = void 0;
|
52
|
+
var React = __importStar(require("react"));
|
53
|
+
var classnames_1 = __importDefault(require("classnames"));
|
54
|
+
var react_beautiful_dnd_1 = require("react-beautiful-dnd");
|
55
|
+
var Tooltip_1 = require("../Tooltip");
|
56
|
+
var Button_1 = require("../Button");
|
57
|
+
var Dropdown_1 = require("../Dropdown");
|
58
|
+
var react_dom_1 = __importDefault(require("react-dom"));
|
59
|
+
var reorder = function (list, startIndex, endIndex) {
|
60
|
+
var result = Array.from(list);
|
61
|
+
var removed = result.splice(startIndex, 1)[0];
|
62
|
+
result.splice(endIndex, 0, removed);
|
63
|
+
return result;
|
64
|
+
};
|
65
|
+
var TableList = /** @class */ (function (_super) {
|
66
|
+
__extends(TableList, _super);
|
67
|
+
function TableList(props) {
|
68
|
+
var _this = _super.call(this, props) || this;
|
69
|
+
_this.state = {
|
70
|
+
items: [],
|
71
|
+
};
|
72
|
+
_this.onDragEnd = _this.onDragEnd.bind(_this);
|
73
|
+
_this.dropDown = _this.dropDown.bind(_this);
|
74
|
+
return _this;
|
75
|
+
}
|
76
|
+
TableList.prototype.componentDidMount = function () {
|
77
|
+
if (this.props.array) {
|
78
|
+
this.setState({ items: this.props.array });
|
79
|
+
}
|
80
|
+
};
|
81
|
+
TableList.prototype.componentDidUpdate = function (prevProps) {
|
82
|
+
if (this.props.array) {
|
83
|
+
if (prevProps.array !== this.props.array) {
|
84
|
+
this.setState({
|
85
|
+
items: this.props.array,
|
86
|
+
});
|
87
|
+
}
|
88
|
+
}
|
89
|
+
};
|
90
|
+
TableList.prototype.onDragEnd = function (result) {
|
91
|
+
if (!result.destination) {
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
var items = reorder(this.state.items, result.source.index, result.destination.index);
|
95
|
+
this.setState({
|
96
|
+
items: items,
|
97
|
+
});
|
98
|
+
return this.props.onDrag ?
|
99
|
+
this.props.onDrag(result.source.index, result.destination.index) : null;
|
100
|
+
};
|
101
|
+
TableList.prototype.dropDown = function () {
|
102
|
+
return (React.createElement(Dropdown_1.Dropdown, { items: this.props.itemsDropdown ? this.props.itemsDropdown() : [] },
|
103
|
+
React.createElement(Button_1.Button, { type: "primary", icon: "plus-large", text: "Add item", size: "small", shape: "round", iconOnly: true, onClick: function () { return false; } })));
|
104
|
+
};
|
105
|
+
TableList.prototype.render = function () {
|
106
|
+
var _a;
|
107
|
+
var _this = this;
|
108
|
+
var classes = (0, classnames_1.default)('', (_a = {
|
109
|
+
'table-list': !this.props.addItem,
|
110
|
+
'table-list--read-only': this.props.readOnly
|
111
|
+
},
|
112
|
+
_a["".concat(this.props.className)] = this.props.className,
|
113
|
+
_a));
|
114
|
+
return (this.state.items.length > 0
|
115
|
+
? this.props.dragAndDrop
|
116
|
+
? React.createElement(react_beautiful_dnd_1.DragDropContext, { onDragEnd: this.onDragEnd },
|
117
|
+
React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "droppable" }, function (provided, _snapshot) { return (React.createElement("div", __assign({ role: 'list', className: classes, ref: provided.innerRef }, provided.droppableProps),
|
118
|
+
_this.state.items.map(function (item, index) { return (React.createElement(react_beautiful_dnd_1.Draggable, { key: index, draggableId: "".concat(index), index: index }, function (provided2, snapshot) { return (_this.props.append
|
119
|
+
? React.createElement(PortalItem, { provided: provided2, snapshot: snapshot, item: item, index: index, dragAndDrop: _this.props.dragAndDrop, showDragHandle: _this.props.showDragHandle, addItem: _this.props.addItem, onAddItem: function () { return _this.props.onAddItem
|
120
|
+
&& _this.props.onAddItem(index, item); }, itemsDropdown: function () { return _this.props.itemsDropdown
|
121
|
+
? _this.props.itemsDropdown(index)
|
122
|
+
: []; } })
|
123
|
+
: React.createElement("div", __assign({ ref: provided2.innerRef }, provided2.draggableProps, provided2.dragHandleProps),
|
124
|
+
React.createElement(TableListItem, { dragAndDrop: _this.props.dragAndDrop, start: item.start, center: item.center, end: item.end, action: item.action, onClick: item.onClick ? item.onClick : undefined, onDoubleClick: item.onDoubleClick
|
125
|
+
? item.onDoubleClick
|
126
|
+
: undefined, addItem: _this.props.addItem, itemsDropdown: function () { return _this.props.itemsDropdown
|
127
|
+
? _this.props.itemsDropdown(index)
|
128
|
+
: []; }, hexColor: item.hexColor, locked: item.locked, positionLocked: item.positionLocked, onAddItem: function () { return _this.props.onAddItem
|
129
|
+
&& _this.props.onAddItem(index, item); }, showDragHandle: _this.props.showDragHandle }))); })); }),
|
130
|
+
provided.placeholder,
|
131
|
+
(_this.props.addItem && !_this.props.readOnly) &&
|
132
|
+
React.createElement("div", { className: "table-list__add-item table-list__item--margin" },
|
133
|
+
React.createElement(Tooltip_1.Tooltip, { text: 'Add item', flow: 'top', appendToBody: true },
|
134
|
+
React.createElement("div", { className: 'table-list__add-item--container sd-margin-x--auto' }, _this.dropDown()))))); }))
|
135
|
+
: React.createElement("div", { role: 'list', className: classes },
|
136
|
+
this.state.items.map(function (item, index) { return (React.createElement(TableListItem, { key: index, start: item.start, center: item.center, end: item.end, action: item.action, onClick: item.onClick ? item.onClick : undefined, onDoubleClick: item.onDoubleClick
|
137
|
+
? item.onDoubleClick
|
138
|
+
: undefined, addItem: _this.props.addItem, itemsDropdown: function () { return _this.props.itemsDropdown ? _this.props.itemsDropdown(index) : []; }, hexColor: item.hexColor, locked: item.locked, positionLocked: item.positionLocked, onAddItem: function () { return _this.props.onAddItem
|
139
|
+
&& _this.props.onAddItem(index, item); } })); }),
|
140
|
+
(this.props.addItem && !this.props.readOnly) &&
|
141
|
+
React.createElement("div", { className: "table-list__add-item table-list__item--margin" },
|
142
|
+
React.createElement(Tooltip_1.Tooltip, { text: 'Add item', flow: 'top', appendToBody: true },
|
143
|
+
React.createElement("div", { className: 'table-list__add-item--container sd-margin-x--auto' }, this.dropDown()))))
|
144
|
+
: (this.props.addItem && !this.props.readOnly) ? React.createElement("div", { role: 'list', className: classes },
|
145
|
+
React.createElement("div", { className: "table-list__add-item table-list__item--margin" },
|
146
|
+
React.createElement(Tooltip_1.Tooltip, { text: 'Add item', flow: 'top', appendToBody: true },
|
147
|
+
React.createElement("div", { className: 'table-list__add-item--container sd-margin-x--auto' }, this.dropDown()))))
|
148
|
+
: null);
|
149
|
+
};
|
150
|
+
return TableList;
|
151
|
+
}(React.PureComponent));
|
152
|
+
exports.TableList = TableList;
|
153
|
+
var TableListItem = /** @class */ (function (_super) {
|
154
|
+
__extends(TableListItem, _super);
|
155
|
+
function TableListItem() {
|
156
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
157
|
+
_this.delay = 200;
|
158
|
+
_this.prevent = false;
|
159
|
+
_this.onSingleClick = function () {
|
160
|
+
_this.timer = setTimeout(function () {
|
161
|
+
if (!_this.prevent) {
|
162
|
+
if (_this.props.onClick) {
|
163
|
+
_this.props.onClick();
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}, _this.delay);
|
167
|
+
};
|
168
|
+
_this.onDoubleClick = function () {
|
169
|
+
clearTimeout(_this.timer);
|
170
|
+
_this.prevent = true;
|
171
|
+
if (_this.props.onDoubleClick) {
|
172
|
+
_this.props.onDoubleClick();
|
173
|
+
}
|
174
|
+
setTimeout(function () {
|
175
|
+
_this.prevent = false;
|
176
|
+
}, _this.delay);
|
177
|
+
};
|
178
|
+
_this.onActionMenuClick = function (event) {
|
179
|
+
event.preventDefault();
|
180
|
+
event.stopPropagation();
|
181
|
+
};
|
182
|
+
return _this;
|
183
|
+
}
|
184
|
+
TableListItem.prototype.render = function () {
|
185
|
+
var _this = this;
|
186
|
+
var classes = (0, classnames_1.default)('table-list__item', {
|
187
|
+
'table-list__item--clickable': this.props.onClick,
|
188
|
+
'table-list__item--draggable': this.props.dragAndDrop,
|
189
|
+
'table-list__item--locked': this.props.locked,
|
190
|
+
'table-list__item--position-locked': this.props.positionLocked,
|
191
|
+
'table-list__item--drag-handles-always': !this.props.showDragHandle,
|
192
|
+
'table-list__item--drag-handles-none': this.props.showDragHandle === 'none',
|
193
|
+
});
|
194
|
+
return (this.props.addItem ?
|
195
|
+
React.createElement("div", { className: 'table-list__item-container' },
|
196
|
+
React.createElement("div", { role: 'listitem', onClick: function () { return _this.onSingleClick(); }, onDoubleClick: function () { return _this.onDoubleClick(); }, className: classes },
|
197
|
+
React.createElement("div", { className: 'table-list__item-border', style: { backgroundColor: this.props.hexColor } }),
|
198
|
+
React.createElement("div", { className: 'table-list__item-content' },
|
199
|
+
React.createElement("div", { className: 'table-list__item-content-block' }, this.props.start && this.props.start),
|
200
|
+
React.createElement("div", { className: 'table-list__item-content-block table-list__item-content-block--center' }, this.props.center && this.props.center),
|
201
|
+
React.createElement("div", { className: 'table-list__item-content-block' }, this.props.end && this.props.end)),
|
202
|
+
this.props.action && React.createElement("div", { className: 'table-list__slide-in-actions', onClick: this.onActionMenuClick }, this.props.action)),
|
203
|
+
React.createElement("div", { className: 'table-list__add-bar-container' },
|
204
|
+
React.createElement(Tooltip_1.Tooltip, { text: 'Add item', flow: 'top', appendToBody: true },
|
205
|
+
React.createElement("div", { className: 'table-list__add-bar' },
|
206
|
+
React.createElement(Dropdown_1.Dropdown, { onChange: this.props.onAddItem, items: this.props.itemsDropdown ? this.props.itemsDropdown() : [] },
|
207
|
+
React.createElement(Button_1.Button, { type: "primary", icon: "plus-large", text: "Add item", size: "small", shape: "round", iconOnly: true, onClick: function () { return false; } }))))))
|
208
|
+
: React.createElement("div", { role: 'listitem', className: "".concat(classes, " table-list__item--margin"), onClick: function () { return _this.onSingleClick(); }, onDoubleClick: function () { return _this.onDoubleClick(); } },
|
209
|
+
React.createElement("div", { className: 'table-list__item-border', style: { backgroundColor: this.props.hexColor } }),
|
210
|
+
React.createElement("div", { className: 'table-list__item-content' },
|
211
|
+
React.createElement("div", { className: 'table-list__item-content-block' }, this.props.start && this.props.start),
|
212
|
+
React.createElement("div", { className: 'table-list__item-content-block table-list__item-content-block--center' }, this.props.center && this.props.center),
|
213
|
+
React.createElement("div", { className: 'table-list__item-content-block' }, this.props.end && this.props.end)),
|
214
|
+
this.props.action && React.createElement("div", { className: 'table-list__slide-in-actions', onClick: this.onActionMenuClick }, this.props.action)));
|
215
|
+
};
|
216
|
+
return TableListItem;
|
217
|
+
}(React.PureComponent));
|
218
|
+
exports.TableListItem = TableListItem;
|
219
|
+
var PortalItem = /** @class */ (function (_super) {
|
220
|
+
__extends(PortalItem, _super);
|
221
|
+
function PortalItem() {
|
222
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
223
|
+
}
|
224
|
+
PortalItem.prototype.render = function () {
|
225
|
+
var _this = this;
|
226
|
+
var provided = this.props.provided;
|
227
|
+
var snapshot = this.props.snapshot;
|
228
|
+
var usePortal = snapshot.isDragging;
|
229
|
+
var child = (React.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
|
230
|
+
React.createElement(TableListItem, { dragAndDrop: this.props.dragAndDrop, start: this.props.item.start, center: this.props.item.center, end: this.props.item.end, action: this.props.item.action, onClick: this.props.item.onClick ? this.props.item.onClick : undefined, onDoubleClick: this.props.item.onDoubleClick
|
231
|
+
? this.props.item.onDoubleClick
|
232
|
+
: undefined, addItem: this.props.addItem, itemsDropdown: this.props.itemsDropdown, hexColor: this.props.item.hexColor, locked: this.props.item.locked, positionLocked: this.props.item.positionLocked, onAddItem: function () { return _this.props.onAddItem; }, showDragHandle: this.props.showDragHandle })));
|
233
|
+
if (!usePortal) {
|
234
|
+
return child;
|
235
|
+
}
|
236
|
+
// if dragging - put the item in a portal
|
237
|
+
return react_dom_1.default.createPortal(child, document.body);
|
238
|
+
};
|
239
|
+
return PortalItem;
|
240
|
+
}(React.PureComponent));
|
package/react/components/Menu.js
CHANGED
@@ -104,7 +104,7 @@ var Menu = /** @class */ (function (_super) {
|
|
104
104
|
Menu.prototype.render = function () {
|
105
105
|
var _this = this;
|
106
106
|
var _a;
|
107
|
-
return (React.createElement(
|
107
|
+
return (React.createElement(React.Fragment, null,
|
108
108
|
this.props.children(this.toggle),
|
109
109
|
React.createElement("div", { onKeyDown: function (event) {
|
110
110
|
if (event.key === 'Escape') {
|