@steroidsjs/bootstrap 3.0.0-beta.113 → 3.0.0-beta.114
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/content/CalendarSystem/CalendarSystemEventGroupModalView.js +1 -1
- package/content/CalendarSystem/WeekGrid/WeekGrid.d.ts +2 -1
- package/content/Chat/ChatView.d.ts +2 -0
- package/content/Chat/ChatView.js +52 -0
- package/content/Chat/ChatView.scss +53 -0
- package/content/Chat/index.d.ts +2 -0
- package/content/Chat/index.js +7 -0
- package/content/Chat/views/BubbleMessage/BubbleMessageView.d.ts +14 -0
- package/content/Chat/views/BubbleMessage/BubbleMessageView.js +52 -0
- package/content/Chat/views/BubbleMessage/BubbleMessageView.scss +157 -0
- package/content/Chat/views/BubbleMessage/index.d.ts +2 -0
- package/content/Chat/views/BubbleMessage/index.js +7 -0
- package/content/Chat/views/BubblesDateGroup/BubblesDateGroup.d.ts +12 -0
- package/content/Chat/views/BubblesDateGroup/BubblesDateGroup.js +48 -0
- package/content/Chat/views/BubblesDateGroup/BubblesDateGroup.scss +78 -0
- package/content/Chat/views/BubblesDateGroup/index.d.ts +2 -0
- package/content/Chat/views/BubblesDateGroup/index.js +7 -0
- package/content/Chat/views/ChatInput/ChatInputView.d.ts +6 -0
- package/content/Chat/views/ChatInput/ChatInputView.js +41 -0
- package/content/Chat/views/ChatInput/ChatInputView.scss +36 -0
- package/content/Chat/views/ChatInput/index.d.ts +2 -0
- package/content/Chat/views/ChatInput/index.js +7 -0
- package/icons/index.js +2 -0
- package/icons/svgs/done-all.svg +4 -0
- package/icons/svgs/send.svg +3 -0
- package/index.d.ts +3 -0
- package/index.js +3 -0
- package/index.scss +1 -0
- package/package.json +2 -2
|
@@ -14,7 +14,7 @@ function CalendarSystemEventGroupModalView(props) {
|
|
|
14
14
|
react_1["default"].createElement(form_1.Form, { className: bem.element('form'), onSubmit: function (fields) {
|
|
15
15
|
props.onEventGroupSubmit(fields);
|
|
16
16
|
props.onClose();
|
|
17
|
-
}, submitLabel: props.isCreate ? __('Создать') : __('Сохранить') },
|
|
17
|
+
}, submitLabel: props.isCreate ? __('Создать') : __('Сохранить'), initialValues: props.eventGroupInitialValues },
|
|
18
18
|
react_1["default"].createElement("div", null,
|
|
19
19
|
react_1["default"].createElement(typography_1.Text, { className: bem.element('label'), content: __('Имя') }),
|
|
20
20
|
react_1["default"].createElement(form_1.InputField, { attribute: 'label', required: true, className: bem.element('name-field') })),
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IDay, IEvent } from '@steroidsjs/core/ui/content/CalendarSystem/CalendarSystem';
|
|
3
|
+
import CalendarEnum from '@steroidsjs/core/ui/content/CalendarSystem/enums/CalendarType';
|
|
3
4
|
import './WeekGrid.scss';
|
|
4
5
|
interface IWeekGridProps {
|
|
5
6
|
currentWeekDays: IDay[];
|
|
6
7
|
allHours: string[];
|
|
7
|
-
getEventsFromDate: (dateFromDay: Date,
|
|
8
|
+
getEventsFromDate: (dateFromDay: Date, currentCalendarType: CalendarEnum) => IEvent[];
|
|
8
9
|
openEditModal: (event: IEvent) => void;
|
|
9
10
|
openCreateModal: (eventInitialDay?: IDay) => void;
|
|
10
11
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var react_use_1 = require("react-use");
|
|
31
|
+
var useBem_1 = __importDefault(require("@steroidsjs/core/hooks/useBem"));
|
|
32
|
+
var ChatInput_1 = __importDefault(require("./views/ChatInput"));
|
|
33
|
+
var BubblesDateGroup_1 = __importDefault(require("./views/BubblesDateGroup"));
|
|
34
|
+
function ChatView(props) {
|
|
35
|
+
var bem = (0, useBem_1["default"])('ChatView');
|
|
36
|
+
var endOfMessagesRef = (0, react_1.useRef)(null);
|
|
37
|
+
(0, react_use_1.useUpdateEffect)(function () {
|
|
38
|
+
endOfMessagesRef === null || endOfMessagesRef === void 0 ? void 0 : endOfMessagesRef.current.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
|
|
39
|
+
}, [props.groupedMessagesByDates]);
|
|
40
|
+
var renderChatScreen = (0, react_1.useCallback)(function () { return (react_1["default"].createElement("div", { className: bem.element('screen') },
|
|
41
|
+
react_1["default"].createElement("div", { className: bem.element('content') },
|
|
42
|
+
Object.entries(props.groupedMessagesByDates)
|
|
43
|
+
.map(function (_a) {
|
|
44
|
+
var date = _a[0], groupedMessages = _a[1];
|
|
45
|
+
return (react_1["default"].createElement(BubblesDateGroup_1["default"], { key: date, date: date, groupedMessages: groupedMessages, currentUser: props.currentUser }));
|
|
46
|
+
}),
|
|
47
|
+
react_1["default"].createElement("div", { ref: endOfMessagesRef })))); }, [bem, props.groupedMessagesByDates, props.currentUser]);
|
|
48
|
+
return (react_1["default"].createElement("div", { className: bem.block() },
|
|
49
|
+
renderChatScreen(),
|
|
50
|
+
react_1["default"].createElement(ChatInput_1["default"], { chatId: props.chatId })));
|
|
51
|
+
}
|
|
52
|
+
exports["default"] = ChatView;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@use "../../scss/variables";
|
|
2
|
+
@use "../../scss/mixins";
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--chat-background-color: #fff;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
html[data-theme="dark"] {
|
|
9
|
+
--chat-background-color: #101216;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$chat-background-color: var(--chat-background-color);
|
|
13
|
+
$sidebar-scroll-thumb-color: var(--sidebar-scroll-thumb-color);
|
|
14
|
+
$sidebar-scroll-track-color: var(--sidebar-scroll-track-color);
|
|
15
|
+
|
|
16
|
+
.ChatView {
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
|
|
20
|
+
padding: 0 16px;
|
|
21
|
+
background-color: $chat-background-color;
|
|
22
|
+
|
|
23
|
+
&__screen {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
justify-content: flex-end;
|
|
27
|
+
align-items: center;
|
|
28
|
+
margin-bottom: 10px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__content {
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
margin-right: -8px;
|
|
36
|
+
overflow-y: scroll;
|
|
37
|
+
|
|
38
|
+
@include mixins.scrollWrapper(#{700px}, 8px, $sidebar-scroll-thumb-color, $sidebar-scroll-track-color);
|
|
39
|
+
|
|
40
|
+
&::-webkit-scrollbar {
|
|
41
|
+
width: 4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::-webkit-scrollbar-track {
|
|
45
|
+
margin-bottom: 16px;
|
|
46
|
+
margin-top: 16px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:first-child {
|
|
50
|
+
margin-top: 15px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var ChatView_1 = __importDefault(require("./ChatView"));
|
|
7
|
+
exports["default"] = ChatView_1["default"];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IChatUser } from '@steroidsjs/core/ui/content/Chat/Chat';
|
|
3
|
+
import './BubbleMessageView.scss';
|
|
4
|
+
interface IBubbleMessageProps {
|
|
5
|
+
user: IChatUser;
|
|
6
|
+
text: string;
|
|
7
|
+
timeAgo: string;
|
|
8
|
+
isCurrentUser: boolean;
|
|
9
|
+
isFirstMessage?: boolean;
|
|
10
|
+
isLastMessage?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function BubbleMessageView(props: IBubbleMessageProps): JSX.Element;
|
|
13
|
+
declare const _default: React.MemoExoticComponent<typeof BubbleMessageView>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var useBem_1 = __importDefault(require("@steroidsjs/core/hooks/useBem"));
|
|
31
|
+
var Avatar_1 = require("@steroidsjs/core/ui/content/Avatar");
|
|
32
|
+
var typography_1 = require("@steroidsjs/core/ui/typography");
|
|
33
|
+
var Title_1 = __importDefault(require("@steroidsjs/core/ui/typography/Title"));
|
|
34
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
35
|
+
require("./BubbleMessageView.scss");
|
|
36
|
+
function BubbleMessageView(props) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
var bem = (0, useBem_1["default"])('BubbleMessageView');
|
|
39
|
+
return (react_1["default"].createElement("div", { className: bem.block({
|
|
40
|
+
'another-user': !props.isCurrentUser,
|
|
41
|
+
'last-message': !!props.isLastMessage
|
|
42
|
+
}) },
|
|
43
|
+
react_1["default"].createElement("div", { className: bem.element('user-message') },
|
|
44
|
+
!props.isCurrentUser && props.isFirstMessage && (react_1["default"].createElement(Title_1["default"], { className: bem.element('username'), type: 'h4', tag: 'h4', content: "".concat(props.user.firstName, " ").concat(props.user.lastName) })),
|
|
45
|
+
react_1["default"].createElement(typography_1.Text, { className: bem.element('text'), type: "body", content: props.text }),
|
|
46
|
+
react_1["default"].createElement("div", { className: bem.element('indicators') },
|
|
47
|
+
react_1["default"].createElement(typography_1.Text, { className: bem.element('time'), type: "body3", content: props.timeAgo }),
|
|
48
|
+
props.isCurrentUser && (react_1["default"].createElement(Icon_1["default"], { className: bem.element('check'), name: "done-all" })))),
|
|
49
|
+
props.user && (react_1["default"].createElement("div", { className: bem.element('avatar') },
|
|
50
|
+
react_1["default"].createElement(Avatar_1.Avatar, { src: (_a = props.user.avatar) === null || _a === void 0 ? void 0 : _a.src, title: "".concat(props.user.firstName, " ").concat(props.user.lastName), status: (_b = props.user.avatar) === null || _b === void 0 ? void 0 : _b.status, size: 'sm' })))));
|
|
51
|
+
}
|
|
52
|
+
exports["default"] = (0, react_1.memo)(BubbleMessageView);
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
@use "../../../../scss/variables";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--bubble-background-color: #6b76ad;
|
|
5
|
+
--bubble-border-color: #6b76ad;
|
|
6
|
+
--username-text-color: #fff;
|
|
7
|
+
--message-text-color: #fff;
|
|
8
|
+
--message-time-color: #fff;
|
|
9
|
+
|
|
10
|
+
--another-user-bubble-background-color: #f8f8f8;
|
|
11
|
+
--another-user-bubble-border-color: #f1f5f7;
|
|
12
|
+
--another-user-username-text-color: #fff;
|
|
13
|
+
--another-user-message-text-color: #323232;
|
|
14
|
+
--another-user-message-time-color: rgba(0, 0, 0, 0.30);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html[data-theme="dark"] {
|
|
18
|
+
--bubble-background-color: #727EB7;
|
|
19
|
+
--bubble-border-color: #727EB7;
|
|
20
|
+
--message-text-color: #fff;
|
|
21
|
+
--message-time-color: #fff;
|
|
22
|
+
|
|
23
|
+
--another-user-bubble-background-color: #333646;
|
|
24
|
+
--another-user-bubble-border-color: #333646;
|
|
25
|
+
--another-user-message-text-color: #fff;
|
|
26
|
+
--another-user-message-time-color: rgba(255, 255, 255, 0.30);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
$bubble-background-color: var(--bubble-background-color);
|
|
30
|
+
$bubble-border-color: var(--bubble-border-color);
|
|
31
|
+
$message-text-color: var(--message-text-color);
|
|
32
|
+
$message-time-color: var(--message-time-color);
|
|
33
|
+
|
|
34
|
+
$another-user-bubble-background-color: var(--another-user-bubble-background-color);
|
|
35
|
+
$another-user-bubble-border-color: var(--another-user-bubble-border-color);
|
|
36
|
+
$another-user-message-text-color: var(--another-user-message-text-color);
|
|
37
|
+
$another-user-message-time-color: var(--another-user-message-time-color);
|
|
38
|
+
|
|
39
|
+
.BubbleMessageView {
|
|
40
|
+
$root: &;
|
|
41
|
+
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-flow: row nowrap;
|
|
44
|
+
justify-content: flex-end;
|
|
45
|
+
align-items: flex-end;
|
|
46
|
+
align-self: flex-end;
|
|
47
|
+
gap: 8px;
|
|
48
|
+
max-width: 548px;
|
|
49
|
+
width: 100%;
|
|
50
|
+
margin-bottom: 4px;
|
|
51
|
+
|
|
52
|
+
&_another-user {
|
|
53
|
+
justify-content: flex-start;
|
|
54
|
+
align-self: flex-start;
|
|
55
|
+
|
|
56
|
+
#{$root}__avatar {
|
|
57
|
+
order: -1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#{$root}__username {
|
|
61
|
+
color: $another-user-message-text-color;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
#{$root}__user-message {
|
|
65
|
+
border: 1px solid $another-user-bubble-border-color;
|
|
66
|
+
background: $another-user-bubble-background-color;
|
|
67
|
+
color: $another-user-message-text-color;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
#{$root}__text {
|
|
71
|
+
text-align: left;
|
|
72
|
+
color: $another-user-message-text-color;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#{$root}__time {
|
|
76
|
+
color: $another-user-message-time-color;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&#{$root}_last-message {
|
|
80
|
+
#{$root}__user-message {
|
|
81
|
+
border-radius: 16px 16px 16px 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
#{$root}__avatar {
|
|
85
|
+
visibility: visible;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
#{$root}__username {
|
|
89
|
+
color: $another-user-message-text-color;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&_last-message {
|
|
95
|
+
margin-bottom: 8px;
|
|
96
|
+
|
|
97
|
+
#{$root}__user-message {
|
|
98
|
+
border-radius: 16px 16px 0 16px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#{$root}__avatar {
|
|
102
|
+
visibility: visible;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&__avatar {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
min-width: 36px;
|
|
111
|
+
min-height: 36px;
|
|
112
|
+
visibility: hidden;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
&__username {
|
|
116
|
+
align-self: flex-start;
|
|
117
|
+
margin-bottom: 0;
|
|
118
|
+
color: $message-text-color;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&__user-message {
|
|
122
|
+
display: flex;
|
|
123
|
+
padding: 12px;
|
|
124
|
+
flex-flow: column nowrap;
|
|
125
|
+
justify-content: flex-end;
|
|
126
|
+
align-items: flex-end;
|
|
127
|
+
gap: 4px;
|
|
128
|
+
border-radius: 16px;
|
|
129
|
+
|
|
130
|
+
border: 1px solid $bubble-border-color;
|
|
131
|
+
background: $bubble-background-color;
|
|
132
|
+
color: $message-text-color;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__text {
|
|
136
|
+
margin-bottom: 0;
|
|
137
|
+
white-space: break-spaces;
|
|
138
|
+
width: 100%;
|
|
139
|
+
text-align: left;
|
|
140
|
+
color: $message-text-color;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&__indicators {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-flow: row nowrap;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&__time {
|
|
149
|
+
margin-bottom: 0;
|
|
150
|
+
font-weight: 500;
|
|
151
|
+
color: $message-time-color;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&__check {
|
|
155
|
+
margin-left: 4px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var BubbleMessageView_1 = __importDefault(require("./BubbleMessageView"));
|
|
7
|
+
exports["default"] = BubbleMessageView_1["default"];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IGroupedMessage } from '@steroidsjs/core/ui/content/Chat/hooks/useChat';
|
|
3
|
+
import { IChatUser } from '@steroidsjs/core/ui/content/Chat/Chat';
|
|
4
|
+
import './BubblesDateGroup.scss';
|
|
5
|
+
interface IBubblesDateGroupProps {
|
|
6
|
+
date: string;
|
|
7
|
+
groupedMessages: IGroupedMessage[][];
|
|
8
|
+
currentUser: IChatUser;
|
|
9
|
+
}
|
|
10
|
+
declare function BubblesDateGroup(props: IBubblesDateGroupProps): JSX.Element;
|
|
11
|
+
declare const _default: React.MemoExoticComponent<typeof BubblesDateGroup>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var useBem_1 = __importDefault(require("@steroidsjs/core/hooks/useBem"));
|
|
31
|
+
var utils_1 = require("@steroidsjs/core/ui/content/Chat/utils");
|
|
32
|
+
var BubbleMessage_1 = __importDefault(require("../BubbleMessage"));
|
|
33
|
+
require("./BubblesDateGroup.scss");
|
|
34
|
+
function BubblesDateGroup(props) {
|
|
35
|
+
var _a;
|
|
36
|
+
var bem = (0, useBem_1["default"])('BubblesDateGroup');
|
|
37
|
+
var toBubbles = (0, react_1.useCallback)(function (groupedMessages) { return (react_1["default"].createElement("div", { className: bem.element('bubbles') }, groupedMessages.map(function (bubbleMessage) { return (react_1["default"].createElement(BubbleMessage_1["default"], { key: bubbleMessage.id, user: bubbleMessage.user, text: bubbleMessage.text, timeAgo: (0, utils_1.calculateMessageTimeAgo)(bubbleMessage.timestamp), isCurrentUser: bubbleMessage.user.id === props.currentUser.id, isFirstMessage: bubbleMessage.isFirstMessage, isLastMessage: bubbleMessage.isLastMessage })); }))); }, [bem, props.currentUser.id]);
|
|
38
|
+
var renderDate = (0, react_1.useCallback)(function () { return (react_1["default"].createElement(react_1["default"].Fragment, null,
|
|
39
|
+
react_1["default"].createElement("div", { className: bem.element('date') },
|
|
40
|
+
react_1["default"].createElement("div", { className: bem.element('date-wrapper') },
|
|
41
|
+
react_1["default"].createElement("span", { className: bem.element('date-text') }, props.date))),
|
|
42
|
+
react_1["default"].createElement("div", { className: bem.element('date', 'invisible-date') },
|
|
43
|
+
react_1["default"].createElement("div", { className: bem.element('date-wrapper', 'invisible-date') }, props.date)))); }, [bem, props.date]);
|
|
44
|
+
return (react_1["default"].createElement("div", { className: bem.block() },
|
|
45
|
+
renderDate(), (_a = props.groupedMessages) === null || _a === void 0 ? void 0 :
|
|
46
|
+
_a.map(toBubbles)));
|
|
47
|
+
}
|
|
48
|
+
exports["default"] = (0, react_1.memo)(BubblesDateGroup);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
@use "../../../../scss/variables";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--date-text-color: #191b1f;
|
|
5
|
+
--date-background-color: #f1f5f7;
|
|
6
|
+
--decorative-line-color: rgba(0, 0, 0, 0.10);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
html[data-theme="dark"] {
|
|
10
|
+
--date-text-color: #fff;
|
|
11
|
+
--date-background-color: #272a37;
|
|
12
|
+
--decorative-line-color: rgba(255, 255, 255, 0.10);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
$date-text-color: var(--date-text-color);
|
|
16
|
+
$date-background-color: var(--date-background-color);
|
|
17
|
+
$decorative-line-color: var(--decorative-line-color);
|
|
18
|
+
|
|
19
|
+
.BubblesDateGroup {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-flow: column nowrap;
|
|
22
|
+
position: relative;
|
|
23
|
+
|
|
24
|
+
&__date {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
position: sticky;
|
|
28
|
+
top: 10px;
|
|
29
|
+
width: 100%;
|
|
30
|
+
text-align: center;
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
line-height: 16px;
|
|
33
|
+
margin: 8px 0 16px 0;
|
|
34
|
+
|
|
35
|
+
&_invisible-date {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 0;
|
|
38
|
+
|
|
39
|
+
&::before,
|
|
40
|
+
&::after {
|
|
41
|
+
content: "";
|
|
42
|
+
flex: 1 1;
|
|
43
|
+
border-bottom: 1px solid;
|
|
44
|
+
margin: auto;
|
|
45
|
+
color: $decorative-line-color;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&::before {
|
|
49
|
+
margin-right: 10px
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&::after {
|
|
53
|
+
margin-left: 10px
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__date-wrapper {
|
|
59
|
+
padding: 8px;
|
|
60
|
+
border-radius: 16px;
|
|
61
|
+
background: $date-background-color;
|
|
62
|
+
|
|
63
|
+
&_invisible-date {
|
|
64
|
+
opacity: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__date-text {
|
|
69
|
+
font-weight: 700;
|
|
70
|
+
color: $date-text-color;
|
|
71
|
+
opacity: 0.4;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&__bubbles {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-flow: column nowrap;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var BubblesDateGroup_1 = __importDefault(require("./BubblesDateGroup"));
|
|
7
|
+
exports["default"] = BubblesDateGroup_1["default"];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
exports.__esModule = true;
|
|
29
|
+
var react_1 = __importStar(require("react"));
|
|
30
|
+
var useBem_1 = __importDefault(require("@steroidsjs/core/hooks/useBem"));
|
|
31
|
+
var form_1 = require("@steroidsjs/core/ui/form");
|
|
32
|
+
require("./ChatInputView.scss");
|
|
33
|
+
function ChatInputView(props) {
|
|
34
|
+
var bem = (0, useBem_1["default"])('ChatInputView');
|
|
35
|
+
var renderInputActions = (0, react_1.useCallback)(function () { return (react_1["default"].createElement("div", { className: bem.element('actions') },
|
|
36
|
+
react_1["default"].createElement(form_1.Button, { className: bem.element('action'), icon: "send", type: "submit" }))); }, [bem]);
|
|
37
|
+
return (react_1["default"].createElement("div", { className: bem.block() },
|
|
38
|
+
react_1["default"].createElement(form_1.Form, { formId: props.chatId, className: bem.element('form'), useRedux: true },
|
|
39
|
+
react_1["default"].createElement(form_1.InputField, { className: bem.element('input'), attribute: "text", size: "lg", required: true, placeholder: __('Введите сообщение'), addonAfter: renderInputActions() }))));
|
|
40
|
+
}
|
|
41
|
+
exports["default"] = ChatInputView;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@use "../../../../scss/variables";
|
|
2
|
+
|
|
3
|
+
.ChatInputView {
|
|
4
|
+
&__actions {
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: 24px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&__action {
|
|
12
|
+
svg > * {
|
|
13
|
+
stroke: variables.$text-color
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&__input {
|
|
18
|
+
.InputFieldView__addon-after {
|
|
19
|
+
background-color: inherit;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.InputFieldView__input {
|
|
23
|
+
border: none;
|
|
24
|
+
padding: 16px 0 16px 16px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-style: normal;
|
|
27
|
+
font-weight: 400;
|
|
28
|
+
line-height: 18px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ButtonView_button {
|
|
32
|
+
background-color: inherit;
|
|
33
|
+
padding: 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
exports.__esModule = true;
|
|
6
|
+
var ChatInputView_1 = __importDefault(require("./ChatInputView"));
|
|
7
|
+
exports["default"] = ChatInputView_1["default"];
|
package/icons/index.js
CHANGED
|
@@ -41,6 +41,7 @@ exports["default"] = (function (customIcons) {
|
|
|
41
41
|
'cross_8x8',
|
|
42
42
|
'default_16x16',
|
|
43
43
|
'default_24x24',
|
|
44
|
+
'done-all',
|
|
44
45
|
'cut',
|
|
45
46
|
'error_16x16',
|
|
46
47
|
'error_24x24',
|
|
@@ -78,6 +79,7 @@ exports["default"] = (function (customIcons) {
|
|
|
78
79
|
'pin',
|
|
79
80
|
'sad',
|
|
80
81
|
'search',
|
|
82
|
+
'send',
|
|
81
83
|
'setting_line',
|
|
82
84
|
'share',
|
|
83
85
|
'star',
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
|
|
2
|
+
<path d="M0.999998 9.09091L3.04198 10.4986C3.45739 10.785 4.02106 10.7171 4.35652 10.3402L10 4" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51367 10.5551L7.80269 10.784C8.44255 11.2907 9.37013 11.1928 9.89012 10.5637L15.0519 4.31856C15.2279 4.10571 15.1979 3.79054 14.9851 3.61462C14.7722 3.43869 14.4571 3.46862 14.2811 3.68147L9.11932 9.92663C8.94599 10.1363 8.6368 10.169 8.42351 10.0001L8.17965 9.80694L7.51367 10.5551Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
|
|
2
|
+
<path d="M6.99811 10.2467L7.43298 11.0077C7.70983 11.4922 7.84825 11.7344 7.84825 12C7.84825 12.2656 7.70983 12.5078 7.43299 12.9923L7.43298 12.9923L6.99811 13.7533C5.75981 15.9203 5.14066 17.0039 5.62348 17.5412C6.1063 18.0785 7.24961 17.5783 9.53623 16.5779L15.8119 13.8323C17.6074 13.0468 18.5051 12.654 18.5051 12C18.5051 11.346 17.6074 10.9532 15.8119 10.1677L9.53624 7.4221C7.24962 6.42171 6.1063 5.92151 5.62348 6.45883C5.14066 6.99615 5.75981 8.07966 6.99811 10.2467Z" stroke="#323232"/>
|
|
3
|
+
</svg>
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -62,6 +62,9 @@ exports["default"] = {
|
|
|
62
62
|
'content.CalendarSystemView': {
|
|
63
63
|
lazy: function () { return require('./content/CalendarSystem/CalendarSystemView')["default"]; }
|
|
64
64
|
},
|
|
65
|
+
'content.ChatView': {
|
|
66
|
+
lazy: function () { return require('./content/Chat/ChatView')["default"]; }
|
|
67
|
+
},
|
|
65
68
|
'form.AutoCompleteFieldView': {
|
|
66
69
|
lazy: function () { return require('./form/AutoCompleteField/AutoCompleteFieldView')["default"]; }
|
|
67
70
|
},
|
package/index.scss
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
@include meta.load-css('content/Kanban/views/KanbanColumn/KanbanColumnView');
|
|
31
31
|
@include meta.load-css('content/Kanban/views/KanbanTask/KanbanTaskView');
|
|
32
32
|
@include meta.load-css('content/Kanban/views/KanbanModal/KanbanModalView');
|
|
33
|
+
@include meta.load-css('content/Chat/ChatView');
|
|
33
34
|
@include meta.load-css('crud/Crud/CrudView');
|
|
34
35
|
@include meta.load-css('form/AutoCompleteField/AutoCompleteFieldView');
|
|
35
36
|
@include meta.load-css('form/Button/ButtonView');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steroidsjs/bootstrap",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.114",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Vladimir Kozhin <hello@kozhindev.com>",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"react-use": "^17.4.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.
|
|
40
|
+
"@steroidsjs/core": "^3.0 || >=3.0.0-beta.99",
|
|
41
41
|
"@steroidsjs/eslint-config": "^2.1.4",
|
|
42
42
|
"@types/enzyme": "^3.10.8",
|
|
43
43
|
"@types/googlemaps": "^3.43.3",
|