@expressms/smartapp-ui 0.0.1
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/README.md +11 -0
- package/build/main/assets/icons/arrow-back.svg +3 -0
- package/build/main/assets/icons/calendar.svg +4 -0
- package/build/main/assets/icons/cancel-cross.svg +3 -0
- package/build/main/assets/icons/check-mark.svg +3 -0
- package/build/main/assets/icons/close.svg +3 -0
- package/build/main/assets/icons/download.svg +4 -0
- package/build/main/assets/icons/ellipse.svg +3 -0
- package/build/main/assets/icons/error.svg +5 -0
- package/build/main/assets/icons/file.svg +3 -0
- package/build/main/assets/icons/logout.svg +4 -0
- package/build/main/assets/icons/order.svg +6 -0
- package/build/main/assets/icons/plus.svg +4 -0
- package/build/main/assets/icons/trash.svg +3 -0
- package/build/main/index.d.ts +1 -0
- package/build/main/index.js +1 -0
- package/build/main/styles/aac6c83b0a358f7f0f6a.svg +3 -0
- package/build/main/styles/stories.module.scss +939 -0
- package/build/main/styles/styles.min.css +274 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.d.ts +5 -0
- package/build/main//321/201omponents/ActionModal/ActionModal.js +39 -0
- package/build/main//321/201omponents/ActionModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ActionModal/index.js +1 -0
- package/build/main//321/201omponents/ActionModal/types.d.ts +9 -0
- package/build/main//321/201omponents/ActionModal/types.js +1 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.d.ts +5 -0
- package/build/main//321/201omponents/AttachedFile/AttachedFile.js +22 -0
- package/build/main//321/201omponents/AttachedFile/index.d.ts +1 -0
- package/build/main//321/201omponents/AttachedFile/index.js +1 -0
- package/build/main//321/201omponents/AttachedFile/types.d.ts +12 -0
- package/build/main//321/201omponents/AttachedFile/types.js +1 -0
- package/build/main//321/201omponents/Avatar/Avatar.d.ts +5 -0
- package/build/main//321/201omponents/Avatar/Avatar.js +39 -0
- package/build/main//321/201omponents/Avatar/index.d.ts +1 -0
- package/build/main//321/201omponents/Avatar/index.js +1 -0
- package/build/main//321/201omponents/Avatar/types.d.ts +10 -0
- package/build/main//321/201omponents/Avatar/types.js +6 -0
- package/build/main//321/201omponents/Button/Button.d.ts +5 -0
- package/build/main//321/201omponents/Button/Button.js +19 -0
- package/build/main//321/201omponents/Button/index.d.ts +1 -0
- package/build/main//321/201omponents/Button/index.js +1 -0
- package/build/main//321/201omponents/Button/types.d.ts +11 -0
- package/build/main//321/201omponents/Button/types.js +1 -0
- package/build/main//321/201omponents/Calendar/Calendar.d.ts +5 -0
- package/build/main//321/201omponents/Calendar/Calendar.js +49 -0
- package/build/main//321/201omponents/Calendar/index.d.ts +1 -0
- package/build/main//321/201omponents/Calendar/index.js +1 -0
- package/build/main//321/201omponents/Calendar/types.d.ts +14 -0
- package/build/main//321/201omponents/Calendar/types.js +1 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.d.ts +5 -0
- package/build/main//321/201omponents/Checkbox/Checkbox.js +18 -0
- package/build/main//321/201omponents/Checkbox/index.d.ts +1 -0
- package/build/main//321/201omponents/Checkbox/index.js +1 -0
- package/build/main//321/201omponents/Checkbox/types.d.ts +6 -0
- package/build/main//321/201omponents/Checkbox/types.js +1 -0
- package/build/main//321/201omponents/Chips/Chips.d.ts +5 -0
- package/build/main//321/201omponents/Chips/Chips.js +20 -0
- package/build/main//321/201omponents/Chips/index.d.ts +1 -0
- package/build/main//321/201omponents/Chips/index.js +1 -0
- package/build/main//321/201omponents/Chips/types.d.ts +4 -0
- package/build/main//321/201omponents/Chips/types.js +1 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.d.ts +5 -0
- package/build/main//321/201omponents/ConfirmationModal/ConfirmationModal.js +33 -0
- package/build/main//321/201omponents/ConfirmationModal/index.d.ts +1 -0
- package/build/main//321/201omponents/ConfirmationModal/index.js +1 -0
- package/build/main//321/201omponents/ConfirmationModal/types.d.ts +9 -0
- package/build/main//321/201omponents/ConfirmationModal/types.js +1 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.d.ts +5 -0
- package/build/main//321/201omponents/CustomSelect/CustomSelect.js +34 -0
- package/build/main//321/201omponents/CustomSelect/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelect/index.js +1 -0
- package/build/main//321/201omponents/CustomSelect/types.d.ts +14 -0
- package/build/main//321/201omponents/CustomSelect/types.js +1 -0
- package/build/main//321/201omponents/CustomSelectPriority/CustomSelectPriority.d.ts +5 -0
- package/build/main//321/201omponents/CustomSelectPriority/CustomSelectPriority.js +58 -0
- package/build/main//321/201omponents/CustomSelectPriority/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelectPriority/index.js +1 -0
- package/build/main//321/201omponents/CustomSelectPriority/types.d.ts +14 -0
- package/build/main//321/201omponents/CustomSelectPriority/types.js +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.d.ts +5 -0
- package/build/main//321/201omponents/CustomSelectProfiles/CustomSelectProfiles.js +53 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.d.ts +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/index.js +1 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.d.ts +13 -0
- package/build/main//321/201omponents/CustomSelectProfiles/types.js +1 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.d.ts +5 -0
- package/build/main//321/201omponents/DragAndDrop/DragAndDrop.js +54 -0
- package/build/main//321/201omponents/DragAndDrop/index.d.ts +1 -0
- package/build/main//321/201omponents/DragAndDrop/index.js +1 -0
- package/build/main//321/201omponents/DragAndDrop/types.d.ts +16 -0
- package/build/main//321/201omponents/DragAndDrop/types.js +1 -0
- package/build/main//321/201omponents/Error/Error.d.ts +5 -0
- package/build/main//321/201omponents/Error/Error.js +19 -0
- package/build/main//321/201omponents/Error/index.d.ts +1 -0
- package/build/main//321/201omponents/Error/index.js +1 -0
- package/build/main//321/201omponents/Error/types.d.ts +4 -0
- package/build/main//321/201omponents/Error/types.js +1 -0
- package/build/main//321/201omponents/Header/Header.d.ts +5 -0
- package/build/main//321/201omponents/Header/Header.js +20 -0
- package/build/main//321/201omponents/Header/index.d.ts +1 -0
- package/build/main//321/201omponents/Header/index.js +1 -0
- package/build/main//321/201omponents/Header/types.d.ts +7 -0
- package/build/main//321/201omponents/Header/types.js +1 -0
- package/build/main//321/201omponents/Input/Input.d.ts +5 -0
- package/build/main//321/201omponents/Input/Input.js +18 -0
- package/build/main//321/201omponents/Input/index.d.ts +1 -0
- package/build/main//321/201omponents/Input/index.js +1 -0
- package/build/main//321/201omponents/Input/types.d.ts +8 -0
- package/build/main//321/201omponents/Input/types.js +1 -0
- package/build/main//321/201omponents/Loader/Loader.d.ts +5 -0
- package/build/main//321/201omponents/Loader/Loader.js +19 -0
- package/build/main//321/201omponents/Loader/index.d.ts +1 -0
- package/build/main//321/201omponents/Loader/index.js +1 -0
- package/build/main//321/201omponents/Loader/types.d.ts +4 -0
- package/build/main//321/201omponents/Loader/types.js +1 -0
- package/build/main//321/201omponents/Profile/Profile.d.ts +5 -0
- package/build/main//321/201omponents/Profile/Profile.js +36 -0
- package/build/main//321/201omponents/Profile/index.d.ts +1 -0
- package/build/main//321/201omponents/Profile/index.js +1 -0
- package/build/main//321/201omponents/Profile/types.d.ts +11 -0
- package/build/main//321/201omponents/Profile/types.js +1 -0
- package/build/main//321/201omponents/Switcher/Switcher.d.ts +5 -0
- package/build/main//321/201omponents/Switcher/Switcher.js +33 -0
- package/build/main//321/201omponents/Switcher/index.d.ts +1 -0
- package/build/main//321/201omponents/Switcher/index.js +1 -0
- package/build/main//321/201omponents/Switcher/types.d.ts +6 -0
- package/build/main//321/201omponents/Switcher/types.js +1 -0
- package/build/main//321/201omponents/Toggle/Toggle.d.ts +5 -0
- package/build/main//321/201omponents/Toggle/Toggle.js +18 -0
- package/build/main//321/201omponents/Toggle/index.d.ts +1 -0
- package/build/main//321/201omponents/Toggle/index.js +1 -0
- package/build/main//321/201omponents/Toggle/types.d.ts +5 -0
- package/build/main//321/201omponents/Toggle/types.js +1 -0
- package/build/main//321/201omponents/index.d.ts +19 -0
- package/build/main//321/201omponents/index.js +19 -0
- package/build/main//321/201omponents/types.d.ts +2 -0
- package/build/main//321/201omponents/types.js +1 -0
- package/package.json +214 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelectPriority';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelectPriority';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export type TCustomSelectOptionPriority = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
color: string;
|
|
6
|
+
};
|
|
7
|
+
export interface ICustomSelectPriority {
|
|
8
|
+
options: TCustomSelectOptionPriority[];
|
|
9
|
+
onChange: (option: any) => void;
|
|
10
|
+
field?: any;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
defaultValue?: TCustomSelectOptionPriority;
|
|
13
|
+
width?: IntRange<130, 360>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICustomSelectProfiles } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function CustomSelectPriority({ options, defaultValue, placeholder, onChange, width }: ICustomSelectProfiles): JSX.Element;
|
|
5
|
+
export default CustomSelectPriority;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import Select, { components } from 'react-select';
|
|
25
|
+
import '../../styles/stories.module.scss';
|
|
26
|
+
import Avatar from '../Avatar';
|
|
27
|
+
function CustomSelectPriority(_a) {
|
|
28
|
+
var options = _a.options, defaultValue = _a.defaultValue, placeholder = _a.placeholder, onChange = _a.onChange, width = _a.width;
|
|
29
|
+
var customStyles = {
|
|
30
|
+
option: function (provided, state) { return (__assign(__assign({}, provided), { cursor: 'pointer', color: '#000000', background: state.isSelected ? 'rgba(71, 153, 227, 0.1)' : '#ffffff', display: 'flex', textOverflow: 'ellipsis', width: width && "".concat(width, "px"), padding: '10px 0', '&:focus': {
|
|
31
|
+
background: '#ffffff',
|
|
32
|
+
color: 'none',
|
|
33
|
+
}, '&:hover': {
|
|
34
|
+
background: 'rgba(71, 153, 227, 0.1)',
|
|
35
|
+
} })); },
|
|
36
|
+
control: function (provided) { return (__assign(__assign({}, provided), { width: width && "".concat(width, "px"), textOverflow: 'ellipsis', padding: '5px 0 5px 5px' })); },
|
|
37
|
+
};
|
|
38
|
+
var DropdownIndicator = function (props) {
|
|
39
|
+
return _jsx(components.DropdownIndicator, __assign({}, props));
|
|
40
|
+
};
|
|
41
|
+
var Control = function (_a) {
|
|
42
|
+
var _b, _c, _d;
|
|
43
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
44
|
+
return (_jsxs(components.Control, __assign({}, props, { children: [((_b = props.selectProps) === null || _b === void 0 ? void 0 : _b.value) && (_jsx("div", __assign({ className: "smartapp-custom-select__control" }, { children: _jsx("span", { children: _jsx(Avatar, { widthHeight: 32, username: (_d = (_c = props === null || props === void 0 ? void 0 : props.selectProps) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.username }) }) }))), children] })));
|
|
45
|
+
};
|
|
46
|
+
var Option = function (_a) {
|
|
47
|
+
var _b, _c, _d;
|
|
48
|
+
var props = __rest(_a, []);
|
|
49
|
+
return (_jsx(components.Option, __assign({}, props, { children: _jsxs("div", __assign({ className: "smartapp-custom-select__option" }, { children: [_jsx("div", __assign({ className: "smartapp-custom-select__option--avatar" }, { children: _jsx(Avatar, { widthHeight: 32, username: (_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.username }) })), _jsxs("div", __assign({ className: "smartapp-custom-select__option--info" }, { children: [_jsxs("p", __assign({ className: "smartapp-custom-select__option--info__title" }, { children: [(_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.username, " "] })), _jsxs("p", __assign({ className: "smartapp-custom-select__option--info__email" }, { children: [(_d = props === null || props === void 0 ? void 0 : props.data) === null || _d === void 0 ? void 0 : _d.email, " "] }))] }))] })) })));
|
|
50
|
+
};
|
|
51
|
+
return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); }, options: options, defaultValue: defaultValue, styles: customStyles, getOptionLabel: function (option) { return option.username; }, getOptionValue: function (option) { return option.email; }, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
|
|
52
|
+
}
|
|
53
|
+
export default CustomSelectPriority;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelectProfiles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelectProfiles';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export type TCustomSelectOptionProfiles = {
|
|
3
|
+
username: string;
|
|
4
|
+
email: string;
|
|
5
|
+
};
|
|
6
|
+
export interface ICustomSelectProfiles {
|
|
7
|
+
options: TCustomSelectOptionProfiles[];
|
|
8
|
+
onChange: (option: any) => void;
|
|
9
|
+
field?: any;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
defaultValue?: TCustomSelectOptionProfiles;
|
|
12
|
+
width?: IntRange<130, 360>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IDragAndDrop } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function DragAndDrop({ options, onDragEndFunction, onChangeIsCompletedOption, onChangeOption, onClickDeleteOption, placeholder, width, }: IDragAndDrop): JSX.Element;
|
|
5
|
+
export default DragAndDrop;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
15
|
+
import { ReactComponent as Order } from '../../assets/icons/order.svg';
|
|
16
|
+
import { ReactComponent as Close } from '../../assets/icons/close.svg';
|
|
17
|
+
import CheckBox from '../Checkbox';
|
|
18
|
+
import '../../styles/stories.module.scss';
|
|
19
|
+
function DragAndDrop(_a) {
|
|
20
|
+
var options = _a.options, onDragEndFunction = _a.onDragEndFunction, onChangeIsCompletedOption = _a.onChangeIsCompletedOption, onChangeOption = _a.onChangeOption, onClickDeleteOption = _a.onClickDeleteOption, placeholder = _a.placeholder, width = _a.width;
|
|
21
|
+
var _b = useState(false), isOnDragStart = _b[0], setIsOnDragStart = _b[1];
|
|
22
|
+
var isCheckbox = function (option) { return (option === null || option === void 0 ? void 0 : option.isCompleted) !== undefined; };
|
|
23
|
+
var reorderOptions = function (options, startIndex, endIndex) {
|
|
24
|
+
var result = Array.from(options);
|
|
25
|
+
console.log(options);
|
|
26
|
+
result.forEach(function (item, index) {
|
|
27
|
+
if (startIndex > endIndex && index < startIndex && index >= endIndex) {
|
|
28
|
+
item.orderId = item.orderId + 1;
|
|
29
|
+
}
|
|
30
|
+
else if (startIndex < endIndex && index > startIndex && index <= endIndex) {
|
|
31
|
+
item.orderId = item.orderId - 1;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
var removed = result.splice(startIndex, 1)[0];
|
|
35
|
+
removed.orderId = endIndex + 1;
|
|
36
|
+
result.splice(endIndex, 0, removed);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
var onDragStart = function () {
|
|
40
|
+
if (!isOnDragStart) {
|
|
41
|
+
setIsOnDragStart(true);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
var onDragEnd = function (result) {
|
|
45
|
+
setIsOnDragStart(false);
|
|
46
|
+
if (!(result === null || result === void 0 ? void 0 : result.destination)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
var newOptions = reorderOptions(options, result.source.index, result.destination.index);
|
|
50
|
+
onDragEndFunction(newOptions);
|
|
51
|
+
};
|
|
52
|
+
return (_jsx("div", __assign({ style: { width: "".concat(width, "px") }, className: "smartapp-drag-drop" }, { children: _jsx(DragDropContext, __assign({ onDragStart: onDragStart, onDragEnd: onDragEnd }, { children: _jsx(Droppable, __assign({ droppableId: "droppable" }, { children: function (provided) { return (_jsx("div", __assign({}, provided.droppableProps, { ref: provided.innerRef, className: "smartapp-drag-drop__container" }, { children: options === null || options === void 0 ? void 0 : options.map(function (instanceOption, index) { return (_jsx(Draggable, __assign({ draggableId: instanceOption.id, index: index }, { children: function (provided) { return (_jsxs("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { className: "smartapp-drag-drop__container--instance" }, { children: [_jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__info" }, { children: [isCheckbox(instanceOption) && onChangeIsCompletedOption && (_jsx(CheckBox, { checked: instanceOption.isCompleted, id: instanceOption.id, onChange: function () { return onChangeIsCompletedOption(instanceOption); } })), onChangeOption ? (_jsx("input", { onChange: function (e) { return onChangeOption && onChangeOption(e, instanceOption); }, defaultValue: instanceOption.defaultValue, className: "smartapp-drag-drop__container--instance__info--name", type: "text", enterKeyHint: "enter", placeholder: placeholder }, instanceOption === null || instanceOption === void 0 ? void 0 : instanceOption.id)) : (_jsx("p", __assign({ className: "smartapp-drag-drop__container--instance__info--name" }, { children: instanceOption.defaultValue })))] })), _jsxs("div", __assign({ className: "smartapp-drag-drop__container--instance__icons" }, { children: [_jsx(Order, {}), onClickDeleteOption && _jsx(Close, { onClick: function () { return onClickDeleteOption(instanceOption); }, className: "cp" })] }))] }))); } }), instanceOption.id)); }) }))); } })) })) })));
|
|
53
|
+
}
|
|
54
|
+
export default DragAndDrop;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DragAndDrop';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DragAndDrop';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export type TDragAndDropOption = {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultValue: string;
|
|
5
|
+
isCompleted?: boolean;
|
|
6
|
+
orderId: number;
|
|
7
|
+
};
|
|
8
|
+
export interface IDragAndDrop {
|
|
9
|
+
options: TDragAndDropOption[];
|
|
10
|
+
onDragEndFunction: (result: any) => void;
|
|
11
|
+
onChangeIsCompletedOption?: (instanceOption: TDragAndDropOption) => void;
|
|
12
|
+
onChangeOption?: (e: any, instanceOption: TDragAndDropOption) => void;
|
|
13
|
+
onClickDeleteOption?: (instanceOption: TDragAndDropOption) => void;
|
|
14
|
+
placeholder: string;
|
|
15
|
+
width?: IntRange<130, 360>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ReactComponent as ErrorIcon } from '../../assets/icons/error.svg';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
function Error(_a) {
|
|
16
|
+
var _b = _a.title, title = _b === void 0 ? 'Ошибка' : _b, _c = _a.text, text = _c === void 0 ? 'Попробуйте еще раз' : _c;
|
|
17
|
+
return (_jsxs("div", __assign({ className: "smartapp-error" }, { children: [_jsx("div", __assign({ className: "smartapp-error__icon" }, { children: _jsx(ErrorIcon, {}) })), _jsx("p", __assign({ className: "smartapp-error__title" }, { children: title })), _jsx("p", __assign({ className: "smartapp-error__text" }, { children: text }))] })));
|
|
18
|
+
}
|
|
19
|
+
export default Error;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Error';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Error';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ReactComponent as ArrowBack } from '../../assets/icons/arrow-back.svg';
|
|
14
|
+
import { ReactComponent as Trash } from '../../assets/icons/trash.svg';
|
|
15
|
+
import '../../styles/stories.module.scss';
|
|
16
|
+
function Header(props) {
|
|
17
|
+
var _a = props.title, title = _a === void 0 ? '' : _a, _b = props.isBack, isBack = _b === void 0 ? false : _b, _c = props.isRemove, isRemove = _c === void 0 ? false : _c, _d = props.onClickBack, onClickBack = _d === void 0 ? function () { return undefined; } : _d, _e = props.onClickRemove, onClickRemove = _e === void 0 ? function () { return undefined; } : _e;
|
|
18
|
+
return (_jsxs("div", __assign({ className: "smartapp-header" }, { children: [_jsxs("div", __assign({ className: "smartapp-header__info" }, { children: [isBack && _jsx(ArrowBack, { onClick: function () { return onClickBack(); }, className: "smartapp-header__info--arrow-back" }), title && _jsx("p", __assign({ className: "smartapp-header__info--title" }, { children: title }))] })), isRemove && (_jsx("div", __assign({ onClick: function () { return onClickRemove(); }, className: "smartapp-header__trash" }, { children: _jsx(Trash, {}) })))] })));
|
|
19
|
+
}
|
|
20
|
+
export default Header;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Header';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import '../../styles/stories.module.scss';
|
|
14
|
+
function Input(_a) {
|
|
15
|
+
var title = _a.title, onChange = _a.onChange, placeholder = _a.placeholder, width = _a.width, defaultValue = _a.defaultValue;
|
|
16
|
+
return (_jsxs("div", __assign({ style: { width: "".concat(width, "px") }, className: "smartapp-input" }, { children: [title && _jsx("p", __assign({ className: "smartapp-input__title" }, { children: title })), _jsx("input", { defaultValue: defaultValue, placeholder: placeholder, onChange: function (e) { return onChange(e.target.value); }, className: "smartapp-input__field" })] })));
|
|
17
|
+
}
|
|
18
|
+
export default Input;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Input';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Input';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { ColorRing } from 'react-loader-spinner';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
function Loader(_a) {
|
|
16
|
+
var _b = _a.isLoader, isLoader = _b === void 0 ? false : _b, title = _a.title;
|
|
17
|
+
return (_jsx("div", __assign({ className: "smartapp-loader-wrapper" }, { children: _jsxs("div", __assign({ className: "smartapp-loader" }, { children: [_jsx(ColorRing, { visible: isLoader, height: "32", width: "32", ariaLabel: "blocks-loading", wrapperStyle: {}, wrapperClass: "blocks-wrapper", colors: ['#4799E3', '#4799E3', '#4799E3', '#4799E3', '#4799E3'] }), title && _jsx("p", __assign({ className: "smartapp-loader__title" }, { children: title }))] })) })));
|
|
18
|
+
}
|
|
19
|
+
export default Loader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Loader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Loader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IProfileProps } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function Profile({ username, email, isShowProfile, onChange, onClickLogout, isMultipleProfile, onClickAddProfile, width, }: IProfileProps): JSX.Element;
|
|
5
|
+
export default Profile;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useRef } from 'react';
|
|
14
|
+
import { ReactComponent as Logout } from '../../assets/icons/logout.svg';
|
|
15
|
+
import { ReactComponent as AddProfile } from '../../assets/icons/plus.svg';
|
|
16
|
+
import '../../styles/stories.module.scss';
|
|
17
|
+
function Profile(_a) {
|
|
18
|
+
var _b, _c, _d;
|
|
19
|
+
var username = _a.username, email = _a.email, _e = _a.isShowProfile, isShowProfile = _e === void 0 ? false : _e, _f = _a.onChange, onChange = _f === void 0 ? function () { return undefined; } : _f, onClickLogout = _a.onClickLogout, isMultipleProfile = _a.isMultipleProfile, onClickAddProfile = _a.onClickAddProfile, width = _a.width;
|
|
20
|
+
var ref = useRef(null);
|
|
21
|
+
var initials = (_d = (_c = (_b = username === null || username === void 0 ? void 0 : username.split(' ')) === null || _b === void 0 ? void 0 : _b.map(function (n) { return n[0]; })) === null || _c === void 0 ? void 0 : _c.join('.')) === null || _d === void 0 ? void 0 : _d.toUpperCase();
|
|
22
|
+
useEffect(function () {
|
|
23
|
+
var checkIfClickedOutside = function (e) {
|
|
24
|
+
var _a;
|
|
25
|
+
if (isShowProfile && (ref === null || ref === void 0 ? void 0 : ref.current) && !((_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.contains(e === null || e === void 0 ? void 0 : e.target))) {
|
|
26
|
+
onChange(false);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
document.addEventListener('mousedown', checkIfClickedOutside);
|
|
30
|
+
return function () {
|
|
31
|
+
document.removeEventListener('mousedown', checkIfClickedOutside);
|
|
32
|
+
};
|
|
33
|
+
}, [isShowProfile, onChange]);
|
|
34
|
+
return (_jsxs("div", __assign({ ref: ref, className: "smartapp-profile__container" }, { children: [_jsx("div", __assign({ onClick: function () { return onChange(!isShowProfile); }, className: "smartapp-profile__avatar" }, { children: initials })), isShowProfile && (_jsxs("div", __assign({ style: { width: "".concat(width, "px") }, className: "smartapp-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile" }, { children: [_jsxs("div", __assign({ className: "smartapp-profile__current-profile--info" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__avatar" }, { children: initials })), _jsxs("div", __assign({ className: "smartapp-profile__current-profile--info__data" }, { children: [_jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--username" }, { children: username })), email && _jsx("p", __assign({ className: "smartapp-profile__current-profile--info__data--email" }, { children: email }))] }))] })), _jsx("div", __assign({ onClick: onClickLogout, className: "smartapp-profile__current-profile--logout" }, { children: _jsx(Logout, {}) }))] })), isMultipleProfile && (_jsxs("div", __assign({ onClick: onClickAddProfile, className: "smartapp-profile__add-profile" }, { children: [_jsx("div", __assign({ className: "smartapp-profile__add-profile--icon" }, { children: _jsx(AddProfile, {}) })), _jsx("p", __assign({ className: "smartapp-profile__add-profile--title" }, { children: "\u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u0430\u043A\u043A\u0430\u0443\u043D\u0442" }))] })))] })))] })));
|
|
35
|
+
}
|
|
36
|
+
export default Profile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Profile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Profile';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export interface IProfileProps {
|
|
3
|
+
username: string;
|
|
4
|
+
email?: string;
|
|
5
|
+
isShowProfile: boolean;
|
|
6
|
+
onChange: (isShowProfile: boolean) => void;
|
|
7
|
+
onClickLogout?: () => void;
|
|
8
|
+
isMultipleProfile?: boolean;
|
|
9
|
+
onClickAddProfile?: () => void;
|
|
10
|
+
width?: IntRange<250, 360>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import Slider from 'react-slick';
|
|
14
|
+
import { NavLink } from 'react-router-dom';
|
|
15
|
+
import '../../styles/stories.module.scss';
|
|
16
|
+
function Switcher(_a) {
|
|
17
|
+
var pages = _a.pages;
|
|
18
|
+
var sliderSettings = {
|
|
19
|
+
variableWidth: true,
|
|
20
|
+
dots: false,
|
|
21
|
+
centerPadding: '60px',
|
|
22
|
+
swipeToSlide: true,
|
|
23
|
+
slidesToShow: 3,
|
|
24
|
+
arrows: false,
|
|
25
|
+
infinite: false,
|
|
26
|
+
speed: 300,
|
|
27
|
+
};
|
|
28
|
+
return (_jsx("div", __assign({ className: "smartapp-switcher" }, { children: _jsx(Slider, __assign({}, sliderSettings, { children: pages === null || pages === void 0 ? void 0 : pages.map(function (page) { return (_jsx(NavLink, __assign({ className: function (_a) {
|
|
29
|
+
var isActive = _a.isActive;
|
|
30
|
+
return isActive ? ' smartapp-switcher__instance smartapp-switcher__instance--active' : 'smartapp-switcher__instance';
|
|
31
|
+
}, to: page === null || page === void 0 ? void 0 : page.route }, { children: page.title }), page === null || page === void 0 ? void 0 : page.route)); }) })) })));
|
|
32
|
+
}
|
|
33
|
+
export default Switcher;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Switcher';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Switcher';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import '../../styles/stories.module.scss';
|
|
14
|
+
function Toggle(_a) {
|
|
15
|
+
var _b = _a.id, id = _b === void 0 ? 'toggle' : _b, _c = _a.onClick, onClick = _c === void 0 ? function () { return undefined; } : _c, _d = _a.checked, checked = _d === void 0 ? false : _d;
|
|
16
|
+
return (_jsx("div", __assign({ className: "smartapp-toggle-wrapper" }, { children: _jsxs("label", __assign({ htmlFor: "smartapp-toggle-".concat(id), onClick: function () { return onClick(); }, className: "smartapp-toggle" }, { children: [_jsx("input", { type: "checkbox", id: "smartapp-toggle-".concat(id), checked: checked, disabled: true }), _jsx("span", { className: "smartapp-slider round" })] })) })));
|
|
17
|
+
}
|
|
18
|
+
export default Toggle;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Toggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Toggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
2
|
+
export { default as Header } from './Header';
|
|
3
|
+
export { default as ActionModal } from './ActionModal';
|
|
4
|
+
export { default as AttachedFile } from './AttachedFile';
|
|
5
|
+
export { default as Avatar } from './Avatar';
|
|
6
|
+
export { default as Calendar } from './Calendar';
|
|
7
|
+
export { default as Checkbox } from './Checkbox';
|
|
8
|
+
export { default as Chips } from './Chips';
|
|
9
|
+
export { default as ConfirmationModal } from './ConfirmationModal';
|
|
10
|
+
export { default as CustomSelect } from './CustomSelect';
|
|
11
|
+
export { default as CustomSelectPriority } from './CustomSelectPriority';
|
|
12
|
+
export { default as CustomSelectProfiles } from './CustomSelectProfiles';
|
|
13
|
+
export { default as DragAndDrop } from './DragAndDrop';
|
|
14
|
+
export { default as Error } from './Error';
|
|
15
|
+
export { default as Input } from './Input';
|
|
16
|
+
export { default as Loader } from './Loader';
|
|
17
|
+
export { default as Profile } from './Profile';
|
|
18
|
+
export { default as Switcher } from './Switcher';
|
|
19
|
+
export { default as Toggle } from './Toggle';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as Button } from './Button';
|
|
2
|
+
export { default as Header } from './Header';
|
|
3
|
+
export { default as ActionModal } from './ActionModal';
|
|
4
|
+
export { default as AttachedFile } from './AttachedFile';
|
|
5
|
+
export { default as Avatar } from './Avatar';
|
|
6
|
+
export { default as Calendar } from './Calendar';
|
|
7
|
+
export { default as Checkbox } from './Checkbox';
|
|
8
|
+
export { default as Chips } from './Chips';
|
|
9
|
+
export { default as ConfirmationModal } from './ConfirmationModal';
|
|
10
|
+
export { default as CustomSelect } from './CustomSelect';
|
|
11
|
+
export { default as CustomSelectPriority } from './CustomSelectPriority';
|
|
12
|
+
export { default as CustomSelectProfiles } from './CustomSelectProfiles';
|
|
13
|
+
export { default as DragAndDrop } from './DragAndDrop';
|
|
14
|
+
export { default as Error } from './Error';
|
|
15
|
+
export { default as Input } from './Input';
|
|
16
|
+
export { default as Loader } from './Loader';
|
|
17
|
+
export { default as Profile } from './Profile';
|
|
18
|
+
export { default as Switcher } from './Switcher';
|
|
19
|
+
export { default as Toggle } from './Toggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|