@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,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IActionModalProps } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function ActionModal({ title, buttonName, confirmButtonFunction, isModalOpen, placeholder, cancelButtonFunction, defaultValue, }: IActionModalProps): JSX.Element;
|
|
5
|
+
export default ActionModal;
|
|
@@ -0,0 +1,39 @@
|
|
|
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, useState } from 'react';
|
|
14
|
+
import { ReactComponent as CancelCross } from '../../assets/icons/cancel-cross.svg';
|
|
15
|
+
import Popup from 'reactjs-popup';
|
|
16
|
+
import { Button } from '../index';
|
|
17
|
+
import '../../styles/stories.module.scss';
|
|
18
|
+
import Input from '../Input';
|
|
19
|
+
function ActionModal(_a) {
|
|
20
|
+
var title = _a.title, buttonName = _a.buttonName, confirmButtonFunction = _a.confirmButtonFunction, isModalOpen = _a.isModalOpen, placeholder = _a.placeholder, cancelButtonFunction = _a.cancelButtonFunction, _b = _a.defaultValue, defaultValue = _b === void 0 ? '' : _b;
|
|
21
|
+
var _c = useState(defaultValue), value = _c[0], setValue = _c[1];
|
|
22
|
+
var ref = useRef();
|
|
23
|
+
useEffect(function () {
|
|
24
|
+
var checkIfClickedOutside = function (e) {
|
|
25
|
+
if (isModalOpen && ref.current && !ref.current.contains(e.target)) {
|
|
26
|
+
cancelButtonFunction();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
document === null || document === void 0 ? void 0 : document.addEventListener('click', checkIfClickedOutside, true);
|
|
30
|
+
return function () {
|
|
31
|
+
document === null || document === void 0 ? void 0 : document.removeEventListener('click', checkIfClickedOutside, true);
|
|
32
|
+
};
|
|
33
|
+
}, [isModalOpen, cancelButtonFunction]);
|
|
34
|
+
var onChange = function (value) {
|
|
35
|
+
setValue(value);
|
|
36
|
+
};
|
|
37
|
+
return (_jsx(Popup, __assign({ closeOnDocumentClick: true, modal: true, open: isModalOpen }, { children: _jsx("div", __assign({ ref: ref, className: "smartapp-action-modal" }, { children: _jsxs("div", __assign({ className: "smartapp-action-modal__content" }, { children: [_jsx("p", __assign({ className: "smartapp-action-modal__content--title" }, { children: title })), _jsx("div", __assign({ onClick: cancelButtonFunction, className: "smartapp-action-modal__content__cancel-cross" }, { children: _jsx(CancelCross, {}) })), _jsx("div", __assign({ className: "smartapp-action-modal__content--input" }, { children: _jsx(Input, { defaultValue: value, onChange: onChange, placeholder: placeholder }) })), _jsx("div", __assign({ className: "smartapp-action-modal__content--buttons" }, { children: _jsx(Button, { title: buttonName, typeButton: "low", onClickFunction: function () { return confirmButtonFunction(value); }, color: "blue" }) }))] })) })) })));
|
|
38
|
+
}
|
|
39
|
+
export default ActionModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ActionModal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ActionModal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IAttachedFile } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function AttachedFile({ fileName, weight, weightType, isSpaceBetween, onClickDownloadFile, onClickRemoveFile, isRemoveFile, isDownloadFile, width, }: IAttachedFile): JSX.Element;
|
|
5
|
+
export default AttachedFile;
|
|
@@ -0,0 +1,22 @@
|
|
|
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 File } from '../../assets/icons/file.svg';
|
|
14
|
+
import { ReactComponent as Close } from '../../assets/icons/close.svg';
|
|
15
|
+
import { ReactComponent as Download } from '../../assets/icons/download.svg';
|
|
16
|
+
import '../../styles/stories.module.scss';
|
|
17
|
+
import classNames from 'classnames';
|
|
18
|
+
function AttachedFile(_a) {
|
|
19
|
+
var fileName = _a.fileName, weight = _a.weight, weightType = _a.weightType, _b = _a.isSpaceBetween, isSpaceBetween = _b === void 0 ? false : _b, _c = _a.onClickDownloadFile, onClickDownloadFile = _c === void 0 ? undefined : _c, _d = _a.onClickRemoveFile, onClickRemoveFile = _d === void 0 ? undefined : _d, _e = _a.isRemoveFile, isRemoveFile = _e === void 0 ? false : _e, _f = _a.isDownloadFile, isDownloadFile = _f === void 0 ? false : _f, width = _a.width;
|
|
20
|
+
return (_jsxs("div", __assign({ style: { width: "".concat(width, "px") }, className: "smartapp-attached-file" }, { children: [_jsx("div", __assign({ className: "smartapp-attached-file--icon" }, { children: _jsx(File, {}) })), _jsxs("div", __assign({ className: classNames({ 'smartapp-attached-file__value': true }, { 'justify-space-between': isSpaceBetween }) }, { children: [_jsxs("div", __assign({ className: "smartapp-attached-file__value--info" }, { children: [_jsx("p", __assign({ className: "smartapp-attached-file__value--info__name" }, { children: fileName })), _jsx("p", __assign({ className: "smartapp-attached-file__value--info__weight" }, { children: "".concat(weight, " ").concat(weightType) }))] })), _jsxs("div", __assign({ className: "smartapp-attached-file__value--icons" }, { children: [onClickRemoveFile && isRemoveFile && (_jsx("div", __assign({ onClick: function () { return onClickRemoveFile(fileName); }, className: "smartapp-attached-file__value--icons__close" }, { children: _jsx(Close, {}) }))), onClickDownloadFile && isDownloadFile && (_jsx("div", __assign({ onClick: function () { return onClickDownloadFile(fileName); }, className: "smartapp-attached-file__value--icons__download" }, { children: _jsx(Download, {}) })))] }))] }))] }), weight));
|
|
21
|
+
}
|
|
22
|
+
export default AttachedFile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AttachedFile';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AttachedFile';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export interface IAttachedFile {
|
|
3
|
+
fileName: string;
|
|
4
|
+
weight: number;
|
|
5
|
+
weightType: string;
|
|
6
|
+
isSpaceBetween?: boolean;
|
|
7
|
+
onClickRemoveFile?: (file: any) => void;
|
|
8
|
+
onClickDownloadFile?: (file: any) => void;
|
|
9
|
+
isRemoveFile?: boolean;
|
|
10
|
+
isDownloadFile?: boolean;
|
|
11
|
+
width?: IntRange<150, 360>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { AvatarFontSizes } from './types';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
function Avatar(_a) {
|
|
16
|
+
var _b, _c, _d;
|
|
17
|
+
var username = _a.username, _e = _a.onClick, onClick = _e === void 0 ? function () { return undefined; } : _e, _f = _a.widthHeight, widthHeight = _f === void 0 ? 44 : _f;
|
|
18
|
+
var initials = (username === null || username === void 0 ? void 0 : username.split(' ').length) <= 2
|
|
19
|
+
? (_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()
|
|
20
|
+
: username[0].toUpperCase();
|
|
21
|
+
var getFontSizeAvatar = function () {
|
|
22
|
+
if (typeof widthHeight === 'number') {
|
|
23
|
+
switch (widthHeight) {
|
|
24
|
+
case (widthHeight = 24): {
|
|
25
|
+
return AvatarFontSizes.small;
|
|
26
|
+
}
|
|
27
|
+
case (widthHeight = 32): {
|
|
28
|
+
return AvatarFontSizes.average;
|
|
29
|
+
}
|
|
30
|
+
case (widthHeight = 44): {
|
|
31
|
+
return AvatarFontSizes.high;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return AvatarFontSizes.high;
|
|
36
|
+
};
|
|
37
|
+
return (_jsx("div", __assign({ style: { width: "".concat(widthHeight, "px"), height: "".concat(widthHeight, "px"), fontSize: getFontSizeAvatar() }, onClick: onClick, className: "smartapp-avatar" }, { children: initials })));
|
|
38
|
+
}
|
|
39
|
+
export default Avatar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Avatar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Avatar';
|
|
@@ -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 } from "react/jsx-runtime";
|
|
13
|
+
import cn from 'classnames';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
var Button = function (props) {
|
|
16
|
+
var title = props.title, _a = props.isDisabled, isDisabled = _a === void 0 ? false : _a, _b = props.typeButton, typeButton = _b === void 0 ? 'standart' : _b, _c = props.color, color = _c === void 0 ? 'white' : _c, widthPercentage = props.widthPercentage, _d = props.onClickFunction, onClickFunction = _d === void 0 ? function () { return undefined; } : _d;
|
|
17
|
+
return (_jsx("button", __assign({ onClick: function () { return onClickFunction(); }, className: cn(typeButton ? 'smartapp-button__' + typeButton : null, color ? 'smartapp-button__color--' + color : null, isDisabled && 'smartapp-button__disabled'), style: widthPercentage && { width: "".concat(widthPercentage, "%") } }, { children: title })));
|
|
18
|
+
};
|
|
19
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Button';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Button';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export type TButtonType = 'standart' | 'low';
|
|
3
|
+
export type TButtonColor = 'white' | 'blue' | 'red';
|
|
4
|
+
export interface IButtonProps {
|
|
5
|
+
title: string;
|
|
6
|
+
isDisabled?: boolean;
|
|
7
|
+
typeButton: TButtonType;
|
|
8
|
+
color?: TButtonColor;
|
|
9
|
+
onClickFunction?: () => void;
|
|
10
|
+
widthPercentage?: IntRange<1, 100>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import '../../styles/stories.module.scss';
|
|
3
|
+
import { ICalendarProps } from './types';
|
|
4
|
+
declare function CalendarDatepicker({ placeholder, initialCurrentDate, initialCurrentDateRange, minDate, onChangeCurrentDate, onChangeCurrentDateRange, calendarComponentClassName, calendarInputClassName, isRange, width, }: ICalendarProps): JSX.Element;
|
|
5
|
+
export default CalendarDatepicker;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { useState } from 'react';
|
|
14
|
+
import DatePicker, { registerLocale } from 'react-datepicker';
|
|
15
|
+
import ru from 'date-fns/locale/ru';
|
|
16
|
+
import en from 'date-fns/locale/en-US';
|
|
17
|
+
import '../../styles/stories.module.scss';
|
|
18
|
+
import classNames from 'classnames';
|
|
19
|
+
registerLocale('ru', ru);
|
|
20
|
+
registerLocale('en', en);
|
|
21
|
+
function CalendarDatepicker(_a) {
|
|
22
|
+
var _b = _a.placeholder, placeholder = _b === void 0 ? 'Введите дату' : _b, initialCurrentDate = _a.initialCurrentDate, initialCurrentDateRange = _a.initialCurrentDateRange, _c = _a.minDate, minDate = _c === void 0 ? null : _c, _d = _a.onChangeCurrentDate, onChangeCurrentDate = _d === void 0 ? function (date) { return undefined; } : _d, _e = _a.onChangeCurrentDateRange, onChangeCurrentDateRange = _e === void 0 ? function (period) { return undefined; } : _e, calendarComponentClassName = _a.calendarComponentClassName, calendarInputClassName = _a.calendarInputClassName, _f = _a.isRange, isRange = _f === void 0 ? false : _f, width = _a.width;
|
|
23
|
+
var _g = useState(initialCurrentDate ? initialCurrentDate : null), currentDate = _g[0], setCurrentDate = _g[1];
|
|
24
|
+
var _h = useState(initialCurrentDateRange ? initialCurrentDateRange : [null, null]), currentDateRange = _h[0], setCurrentDateRange = _h[1];
|
|
25
|
+
var startDate = currentDateRange[0], endDate = currentDateRange[1];
|
|
26
|
+
var onChangeDate = function (date) {
|
|
27
|
+
if (date) {
|
|
28
|
+
setCurrentDate(date);
|
|
29
|
+
onChangeCurrentDate(date);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var onChangeDateRange = function (period) {
|
|
33
|
+
setCurrentDateRange(period);
|
|
34
|
+
onChangeCurrentDateRange(period);
|
|
35
|
+
};
|
|
36
|
+
return (_jsx("div", __assign({ className: classNames({
|
|
37
|
+
'smartapp-calendar-component': !calendarInputClassName,
|
|
38
|
+
calendarInputClassName: calendarInputClassName,
|
|
39
|
+
}), style: { width: "".concat(width, "px") } }, { children: isRange ? (_jsx(DatePicker, { selectsRange: true, startDate: startDate, endDate: endDate, dateFormat: "dd.MM.yyyy", placeholderText: placeholder, locale: ru, className: classNames({
|
|
40
|
+
'smartapp-calendar-input': !calendarComponentClassName,
|
|
41
|
+
calendarComponentClassName: calendarComponentClassName,
|
|
42
|
+
}), onChange: function (period) { return onChangeDateRange(period); } })) : (_jsx(DatePicker, { selected: currentDate, dateFormat: "dd.MM.yyyy", locale: ru, placeholderText: placeholder, minDate: minDate, className: classNames({
|
|
43
|
+
'smartapp-calendar-input': !calendarComponentClassName,
|
|
44
|
+
calendarComponentClassName: calendarComponentClassName,
|
|
45
|
+
}), onChange: function (date) {
|
|
46
|
+
onChangeDate(date);
|
|
47
|
+
} })) })));
|
|
48
|
+
}
|
|
49
|
+
export default CalendarDatepicker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Calendar';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Calendar';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
export type TDateRange = [Date | null, Date | null];
|
|
3
|
+
export interface ICalendarProps {
|
|
4
|
+
initialCurrentDate?: Date;
|
|
5
|
+
initialCurrentDateRange?: TDateRange;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
minDate?: Date | null;
|
|
8
|
+
calendarComponentClassName?: string;
|
|
9
|
+
calendarInputClassName?: string;
|
|
10
|
+
isRange?: boolean;
|
|
11
|
+
onChangeCurrentDate?: (date: Date | null) => void;
|
|
12
|
+
onChangeCurrentDateRange?: (period: TDateRange) => void;
|
|
13
|
+
width?: IntRange<200, 360>;
|
|
14
|
+
}
|
|
@@ -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 CheckBox(_a) {
|
|
15
|
+
var id = _a.id, _b = _a.onChange, onChange = _b === void 0 ? function () { return undefined; } : _b, disabled = _a.disabled, checked = _a.checked;
|
|
16
|
+
return (_jsx("div", __assign({ className: "smartapp-check-box" }, { children: _jsx("div", __assign({ className: "smartapp-check-box__container" }, { children: _jsxs("label", __assign({ htmlFor: "cb-".concat(id) }, { children: [_jsx("input", { id: "cb-".concat(id), disabled: disabled, checked: checked, onChange: function () { return onChange(); }, className: "smartapp-check-box__container__custom-check-box", type: "checkbox", name: "marker" }), _jsx("span", { className: "checkmark" })] })) }), "cb-".concat(id, "}")) })));
|
|
17
|
+
}
|
|
18
|
+
export default CheckBox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Checkbox';
|
|
@@ -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 Cancel } from '../../assets/icons/cancel-cross.svg';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
import Avatar from '../Avatar';
|
|
16
|
+
function Chips(_a) {
|
|
17
|
+
var name = _a.name, _b = _a.onCancelFunction, onCancelFunction = _b === void 0 ? function () { return undefined; } : _b;
|
|
18
|
+
return (_jsxs("div", __assign({ className: "smartapp-chips" }, { children: [_jsxs("div", __assign({ className: "smartapp-chips__info" }, { children: [_jsx(Avatar, { username: name, widthHeight: 24 }), _jsx("p", __assign({ className: "smartapp-chips__info--name" }, { children: name }))] })), _jsx("div", __assign({ onClick: onCancelFunction, className: "smartapp-chips__cancel-icon" }, { children: _jsx(Cancel, {}) }))] })));
|
|
19
|
+
}
|
|
20
|
+
export default Chips;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Chips';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Chips';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IConfirmationModalProps } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function ConfirmationModal({ title, text, cancelButtonName, confirmButtonName, cancelButtonFunction, confirmButtonFunction, isModalOpen, }: IConfirmationModalProps): JSX.Element;
|
|
5
|
+
export default ConfirmationModal;
|
|
@@ -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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useEffect, useRef } from 'react';
|
|
14
|
+
import Popup from 'reactjs-popup';
|
|
15
|
+
import { Button } from '../index';
|
|
16
|
+
import '../../styles/stories.module.scss';
|
|
17
|
+
function ConfirmationModal(_a) {
|
|
18
|
+
var title = _a.title, text = _a.text, cancelButtonName = _a.cancelButtonName, confirmButtonName = _a.confirmButtonName, _b = _a.cancelButtonFunction, cancelButtonFunction = _b === void 0 ? function () { return undefined; } : _b, confirmButtonFunction = _a.confirmButtonFunction, isModalOpen = _a.isModalOpen;
|
|
19
|
+
var ref = useRef();
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
var checkIfClickedOutside = function (e) {
|
|
22
|
+
if (isModalOpen && ref.current && !ref.current.contains(e.target)) {
|
|
23
|
+
cancelButtonFunction();
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
document === null || document === void 0 ? void 0 : document.addEventListener('click', checkIfClickedOutside, true);
|
|
27
|
+
return function () {
|
|
28
|
+
document === null || document === void 0 ? void 0 : document.removeEventListener('click', checkIfClickedOutside, true);
|
|
29
|
+
};
|
|
30
|
+
}, [isModalOpen, cancelButtonFunction]);
|
|
31
|
+
return (_jsx(Popup, __assign({ closeOnDocumentClick: true, modal: true, open: isModalOpen }, { children: _jsx("div", __assign({ ref: ref, className: "smartapp-confirmation-modal" }, { children: _jsxs("div", __assign({ className: "smartapp-confirmation-modal__content" }, { children: [_jsx("p", __assign({ className: "smartapp-confirmation-modal__content--title" }, { children: title })), _jsx("p", __assign({ className: "smartapp-confirmation-modal__content--text" }, { children: text })), _jsxs("div", __assign({ className: "smartapp-confirmation-modal__content--buttons" }, { children: [_jsx(Button, { widthPercentage: 50, title: cancelButtonName, typeButton: "low", onClickFunction: cancelButtonFunction, color: "white" }), _jsx(Button, { widthPercentage: 50, title: confirmButtonName, typeButton: "low", onClickFunction: confirmButtonFunction, color: "red" })] }))] })) })) })));
|
|
32
|
+
}
|
|
33
|
+
export default ConfirmationModal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ConfirmationModal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ConfirmationModal';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
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 Select from 'react-select';
|
|
14
|
+
import '../../styles/stories.module.scss';
|
|
15
|
+
function CustomSelect(_a) {
|
|
16
|
+
var options = _a.options, defaultValue = _a.defaultValue, placeholder = _a.placeholder, onChange = _a.onChange, width = _a.width;
|
|
17
|
+
var customStyles = {
|
|
18
|
+
option: function (provided, state) { return (__assign(__assign({}, provided), { cursor: 'pointer', background: '#ffffff', color: (state === null || state === void 0 ? void 0 : state.isSelected) ? '#4799E3' : '#000000', width: width && "".concat(width, "px"), textOverflow: 'ellipsis', '&:focus': {
|
|
19
|
+
background: '#ffffff',
|
|
20
|
+
color: 'none',
|
|
21
|
+
}, '&:hover': {
|
|
22
|
+
background: '#ffffff',
|
|
23
|
+
color: '#4799E3',
|
|
24
|
+
}, ':active': {
|
|
25
|
+
color: '#4799E3',
|
|
26
|
+
background: '#000000',
|
|
27
|
+
} })); },
|
|
28
|
+
control: function (provided) { return (__assign(__assign({}, provided), { width: width && "".concat(width, "px"), textOverflow: 'ellipsis' })); },
|
|
29
|
+
};
|
|
30
|
+
return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); },
|
|
31
|
+
/* @ts-ignore */
|
|
32
|
+
options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { IndicatorSeparator: function () { return null; } } }) })));
|
|
33
|
+
}
|
|
34
|
+
export default CustomSelect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelect';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './CustomSelect';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IntRange } from '../types';
|
|
2
|
+
type TCustomSelectOption = {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
export type ICustomSelect = {
|
|
7
|
+
options: TCustomSelectOption;
|
|
8
|
+
onChange: (option: any) => void;
|
|
9
|
+
field?: any;
|
|
10
|
+
placeholder: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
width?: IntRange<120, 360>;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ICustomSelectPriority } from './types';
|
|
3
|
+
import '../../styles/stories.module.scss';
|
|
4
|
+
declare function CustomSelectPriority({ options, defaultValue, placeholder, onChange, width }: ICustomSelectPriority): JSX.Element;
|
|
5
|
+
export default CustomSelectPriority;
|
|
@@ -0,0 +1,58 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import Select, { components } from 'react-select';
|
|
25
|
+
import { ReactComponent as Ellipse } from '../../assets/icons/ellipse.svg';
|
|
26
|
+
import '../../styles/stories.module.scss';
|
|
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) {
|
|
31
|
+
var _a;
|
|
32
|
+
return (__assign(__assign({}, provided), { cursor: 'pointer', background: state.isSelected ? 'rgba(71, 153, 227, 0.1)' : '#ffffff', color: (_a = state === null || state === void 0 ? void 0 : state.value) === null || _a === void 0 ? void 0 : _a.color, display: 'flex', textOverflow: 'ellipsis', width: width && "".concat(width, "px"), '&:focus': {
|
|
33
|
+
background: '#ffffff',
|
|
34
|
+
color: 'none',
|
|
35
|
+
}, '&:hover': {
|
|
36
|
+
background: 'rgba(71, 153, 227, 0.1)',
|
|
37
|
+
} }));
|
|
38
|
+
},
|
|
39
|
+
control: function (provided) { return (__assign(__assign({}, provided), { width: width && "".concat(width, "px"), textOverflow: 'ellipsis' })); },
|
|
40
|
+
};
|
|
41
|
+
var DropdownIndicator = function (props) {
|
|
42
|
+
return _jsx(components.DropdownIndicator, __assign({}, props));
|
|
43
|
+
};
|
|
44
|
+
var Control = function (_a) {
|
|
45
|
+
var _b, _c, _d, _e;
|
|
46
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
47
|
+
return (_jsxs(components.Control, __assign({}, props, { children: [((_c = (_b = props === null || props === void 0 ? void 0 : props.selectProps) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.color) && (_jsx(_Fragment, { children: _jsx("span", __assign({ style: { marginLeft: '8px' } }, { children: _jsx(Ellipse, { color: (_e = (_d = props === null || props === void 0 ? void 0 : props.selectProps) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.color }) })) })), children] })));
|
|
48
|
+
};
|
|
49
|
+
var Option = function (_a) {
|
|
50
|
+
var _b, _c;
|
|
51
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
52
|
+
return (_jsxs(components.Option, __assign({}, props, { children: [((_b = props === null || props === void 0 ? void 0 : props.data) === null || _b === void 0 ? void 0 : _b.color) && (_jsx("span", __assign({ style: { marginRight: '8px' } }, { children: _jsx(Ellipse, { style: { paddingBottom: '1px' }, color: (_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.color }) }))), children] })));
|
|
53
|
+
};
|
|
54
|
+
return (_jsx("div", __assign({ className: "smartapp-custom-select" }, { children: _jsx(Select, { onChange: function (option) { return onChange(option); },
|
|
55
|
+
/* @ts-ignore */
|
|
56
|
+
options: options, defaultValue: defaultValue, styles: customStyles, placeholder: _jsx("div", __assign({ className: "smartapp-custom-select__placeholder" }, { children: placeholder })), components: { Option: Option, Control: Control, DropdownIndicator: DropdownIndicator, IndicatorSeparator: function () { return null; } } }) })));
|
|
57
|
+
}
|
|
58
|
+
export default CustomSelectPriority;
|