@appcorp/app-corp-vista 0.1.76 → 0.1.78
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/molecules/vista-chat-bubble-v1/vista-chat-bubble-v1.js +47 -6
- package/organisms/vista-chat-v2/vista-chat-v2.js +2 -2
- package/organisms/vista-table-v1/vista-table-body-v1.d.ts +1 -0
- package/organisms/vista-table-v1/vista-table-body-v1.js +20 -8
- package/organisms/vista-table-v1/vista-table-head-v1.js +1 -1
- package/package.json +2 -1
- package/type/vista-chat-bubble-type.d.ts +1 -0
- package/type/vista-table-type.d.ts +1 -0
- package/type/vista-table-type.js +1 -0
- /package/atoms/{table-cell-v1 → vista-table-cell-v1}/vista-table-cell-v1.d.ts +0 -0
- /package/atoms/{table-cell-v1 → vista-table-cell-v1}/vista-table-cell-v1.js +0 -0
|
@@ -1,22 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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 () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
36
|
exports.VistaChatBubbleV1 = void 0;
|
|
7
|
-
var react_1 =
|
|
37
|
+
var react_1 = __importStar(require("react"));
|
|
8
38
|
var vista_avatar_v1_1 = require("../vista-avatar-v1/vista-avatar-v1");
|
|
9
39
|
var format_timestamp_1 = require("../../utils/format-timestamp");
|
|
10
40
|
var chat_triangle_1 = require("../../atoms/chat-triangle/chat-triangle");
|
|
11
41
|
var VistaChatBubbleV1 = function (_a) {
|
|
12
|
-
var
|
|
42
|
+
var createdAt = _a.createdAt, isLast = _a.isLast, isUser = _a.isUser, message = _a.message, psychic = _a.psychic, user = _a.user;
|
|
43
|
+
var lastChatBubble = (0, react_1.useRef)(null);
|
|
13
44
|
var getBubbleStyles = function () { return ({
|
|
14
45
|
borderTopLeftRadius: isUser ? '8px' : '0px',
|
|
15
46
|
borderTopRightRadius: isUser ? '0px' : '8px',
|
|
16
47
|
borderBottomLeftRadius: '8px',
|
|
17
48
|
borderBottomRightRadius: '8px',
|
|
18
49
|
}); };
|
|
19
|
-
|
|
50
|
+
(0, react_1.useEffect)(function () {
|
|
51
|
+
var _a;
|
|
52
|
+
if (isLast) {
|
|
53
|
+
(_a = lastChatBubble.current) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
|
|
54
|
+
behavior: 'smooth',
|
|
55
|
+
block: 'center',
|
|
56
|
+
inline: 'end',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, [isLast]);
|
|
60
|
+
return (react_1.default.createElement("div", { className: "flex items-start gap-6 my-2 ".concat(isUser ? 'justify-end' : 'justify-start'), ref: isLast ? lastChatBubble : null },
|
|
20
61
|
react_1.default.createElement("div", { className: isUser ? 'order-1' : 'order-2' },
|
|
21
62
|
react_1.default.createElement("div", { className: "relative ".concat(isUser ? 'bg-primary text-white' : 'bg-gray-200 text-black'), style: getBubbleStyles() },
|
|
22
63
|
react_1.default.createElement("div", { className: "absolute top-0 size-4 ".concat(isUser ? '-right-4 rotate-90' : '-left-4 rotate-180') },
|
|
@@ -15,9 +15,9 @@ var vista_chat_bubble_v1_1 = require("../../molecules/vista-chat-bubble-v1/vista
|
|
|
15
15
|
var VistaChatV2 = function (_a) {
|
|
16
16
|
var actionItems = _a.actionItems, chatId = _a.chatId, chatValue = _a.chatValue, _b = _a.containerClassName, containerClassName = _b === void 0 ? '' : _b, handleChatOnChange = _a.handleChatOnChange, messages = _a.messages, name = _a.name, psychic = _a.psychic, sideBarHeading = _a.sideBarHeading, sideBarNode = _a.sideBarNode, timer = _a.timer, user = _a.user;
|
|
17
17
|
var renderChatMessages = function () {
|
|
18
|
-
return (react_1.default.createElement("div", { className: 'overflow-y-scroll' }, messages.map((function (_a) {
|
|
18
|
+
return (react_1.default.createElement("div", { className: 'overflow-y-scroll' }, messages.map((function (_a, ind) {
|
|
19
19
|
var createdAt = _a.createdAt, id = _a.id, isUser = _a.isUser, message = _a.message;
|
|
20
|
-
return (react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isUser: isUser, key: id, message: message, psychic: psychic, user: user }));
|
|
20
|
+
return (react_1.default.createElement(vista_chat_bubble_v1_1.VistaChatBubbleV1, { createdAt: createdAt, isUser: isUser, key: id, message: message, psychic: psychic, user: user, isLast: ind === messages.length - 1 }));
|
|
21
21
|
}))));
|
|
22
22
|
};
|
|
23
23
|
var handleOnKeyDown = function (e) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { VistaTableV1Props } from '../../type/vista-table-type';
|
|
3
|
+
import 'react-photo-view/dist/react-photo-view.css';
|
|
3
4
|
export declare const TOOLTIP_OFFSET = -8;
|
|
4
5
|
export declare const rowClasses = "odd:bg-gray-100 even:bg-gray-200 hover:bg-gray-300 dark:odd:bg-gray-800 dark:even:bg-gray-700 dark:hover:bg-gray-600";
|
|
5
6
|
export declare const dataClasses = "p-2 cursor-pointer";
|
|
@@ -38,11 +38,13 @@ exports.VistaTableBodyV1 = exports.dataClasses = exports.rowClasses = exports.TO
|
|
|
38
38
|
var react_1 = __importStar(require("react"));
|
|
39
39
|
var util_functions_1 = require("@react-pakistan/util-functions");
|
|
40
40
|
var react_tooltip_1 = require("react-tooltip");
|
|
41
|
-
var vista_table_cell_v1_1 = require("../../atoms/table-cell-v1/vista-table-cell-v1");
|
|
41
|
+
var vista_table_cell_v1_1 = require("../../atoms/vista-table-cell-v1/vista-table-cell-v1");
|
|
42
42
|
var vista_dropdown_menu_v1_1 = require("../../molecules/vista-dropdown-menu-v1/vista-dropdown-menu-v1");
|
|
43
43
|
var vista_shimmer_v1_1 = require("../../atoms/vista-shimmer-v1/vista-shimmer-v1");
|
|
44
44
|
var vista_table_type_1 = require("../../type/vista-table-type");
|
|
45
45
|
var uuid_1 = require("uuid");
|
|
46
|
+
var react_photo_view_1 = require("react-photo-view");
|
|
47
|
+
require("react-photo-view/dist/react-photo-view.css");
|
|
46
48
|
exports.TOOLTIP_OFFSET = -8;
|
|
47
49
|
exports.rowClasses = 'odd:bg-gray-100 even:bg-gray-200 hover:bg-gray-300 dark:odd:bg-gray-800 dark:even:bg-gray-700 dark:hover:bg-gray-600';
|
|
48
50
|
exports.dataClasses = 'p-2 cursor-pointer';
|
|
@@ -64,7 +66,12 @@ var componentMap = (_a = {},
|
|
|
64
66
|
_a[vista_table_type_1.VISTA_TABLE_CELL_TYPE.ACTIONS] = function (id, rowActions) { return (react_1.default.createElement("td", { className: exports.dataClasses },
|
|
65
67
|
react_1.default.createElement("div", { className: "flex flex-row justify-center" },
|
|
66
68
|
react_1.default.createElement(vista_dropdown_menu_v1_1.VistaDropdownMenuV1, { assetId: id, rowActions: rowActions })))); },
|
|
67
|
-
_a[vista_table_type_1.VISTA_TABLE_CELL_TYPE.IMAGE] = function () { return (react_1.default.createElement(
|
|
69
|
+
_a[vista_table_type_1.VISTA_TABLE_CELL_TYPE.IMAGE] = function (images) { return (react_1.default.createElement("td", { className: exports.dataClasses },
|
|
70
|
+
react_1.default.createElement(react_photo_view_1.PhotoProvider, null,
|
|
71
|
+
react_1.default.createElement("div", { className: 'flex flex-row gap-2 flex-wrap' }, images.map(function (item, index) { return (react_1.default.createElement(react_photo_view_1.PhotoView, { key: index, src: item },
|
|
72
|
+
react_1.default.createElement("img", { src: item, alt: "image", height: 70, width: 70, className: 'rounded-lg' }))); }))))); },
|
|
73
|
+
_a[vista_table_type_1.VISTA_TABLE_CELL_TYPE.OBJECT] = function (val) { return (react_1.default.createElement("td", { className: exports.dataClasses },
|
|
74
|
+
react_1.default.createElement(vista_table_cell_v1_1.VistaTableCellV1, { label: val }))); },
|
|
68
75
|
_a[vista_table_type_1.VISTA_TABLE_CELL_TYPE.MULTIPLE_TEXT_LINES] = function (val) { return (react_1.default.createElement("td", { className: exports.dataClasses }, val.map(function (v) {
|
|
69
76
|
var id = (0, uuid_1.v4)();
|
|
70
77
|
return (react_1.default.createElement(vista_table_cell_v1_1.VistaTableCellV1, { key: id, label: v }));
|
|
@@ -84,18 +91,26 @@ var VistaTableBodyV1 = function (_a) {
|
|
|
84
91
|
}),
|
|
85
92
|
!loading && (tableBodyRows === null || tableBodyRows === void 0 ? void 0 : tableBodyRows.map(function (row) {
|
|
86
93
|
var ref = (0, uuid_1.v4)();
|
|
87
|
-
return (react_1.default.createElement("tr", { key: ref, className: exports.rowClasses }, tableBodyCols.map(function (_a
|
|
94
|
+
return (react_1.default.createElement("tr", { key: ref, className: exports.rowClasses }, tableBodyCols.map(function (_a) {
|
|
88
95
|
var _b;
|
|
89
96
|
var key = _a.key, componentType = _a.componentType, expression = _a.expression;
|
|
90
97
|
var computedValue = '';
|
|
91
|
-
if (Array.isArray(key) && componentType
|
|
98
|
+
if (Array.isArray(key) && componentType === vista_table_type_1.VISTA_TABLE_CELL_TYPE.OBJECT) {
|
|
92
99
|
computedValue = row[key[0]][key[1]];
|
|
93
100
|
}
|
|
94
101
|
else if (Array.isArray(key) && componentType === vista_table_type_1.VISTA_TABLE_CELL_TYPE.MULTIPLE_TEXT_LINES) {
|
|
95
|
-
|
|
102
|
+
if (expression) {
|
|
103
|
+
computedValue = key.map(function (k) { return expression(row[k]); });
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
computedValue = key.map(function (k) { return row[k]; });
|
|
107
|
+
}
|
|
96
108
|
}
|
|
97
109
|
else {
|
|
98
110
|
computedValue = row[key];
|
|
111
|
+
if (expression) {
|
|
112
|
+
computedValue = expression(row[key]);
|
|
113
|
+
}
|
|
99
114
|
}
|
|
100
115
|
if (componentType === vista_table_type_1.VISTA_TABLE_CELL_TYPE.CREATED_UPDATED_AT) {
|
|
101
116
|
computedValue = "".concat(row['createdAt']).concat(util_functions_1.VALUE_DELIMITER.DOLLAR).concat(row['updatedAt']);
|
|
@@ -103,9 +118,6 @@ var VistaTableBodyV1 = function (_a) {
|
|
|
103
118
|
if (componentType === vista_table_type_1.VISTA_TABLE_CELL_TYPE.ACTIONS) {
|
|
104
119
|
computedValue = row.id;
|
|
105
120
|
}
|
|
106
|
-
if (expression) {
|
|
107
|
-
computedValue = expression(row[key]);
|
|
108
|
-
}
|
|
109
121
|
var reff = (0, uuid_1.v4)();
|
|
110
122
|
return (react_1.default.createElement(react_1.Fragment, { key: reff }, (_b = componentMap[componentType]) === null || _b === void 0 ? void 0 : _b.call(componentMap, computedValue, rowActions)));
|
|
111
123
|
})));
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.VistaTableHeadV1 = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
|
-
var vista_table_cell_v1_1 = require("../../atoms/table-cell-v1/vista-table-cell-v1");
|
|
8
|
+
var vista_table_cell_v1_1 = require("../../atoms/vista-table-cell-v1/vista-table-cell-v1");
|
|
9
9
|
var VistaTableHeadV1 = function (_a) {
|
|
10
10
|
var items = _a.items;
|
|
11
11
|
return (react_1.default.createElement("tr", null, items.map(function (_a) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/app-corp-vista",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "yarn clean && yarn build:ts && cp package.json lib && cp README.md lib",
|
|
6
6
|
"build:next": "next build",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"react": "^19",
|
|
81
81
|
"react-copy-to-clipboard": "^5.1.0",
|
|
82
82
|
"react-dom": "^19",
|
|
83
|
+
"react-photo-view": "^1.2.7",
|
|
83
84
|
"react-slick": "^0.30.3",
|
|
84
85
|
"react-tooltip": "^5.28.1",
|
|
85
86
|
"slick-carousel": "^1",
|
package/type/vista-table-type.js
CHANGED
|
@@ -9,5 +9,6 @@ var VISTA_TABLE_CELL_TYPE;
|
|
|
9
9
|
VISTA_TABLE_CELL_TYPE["ID"] = "ID";
|
|
10
10
|
VISTA_TABLE_CELL_TYPE["IMAGE"] = "IMAGE";
|
|
11
11
|
VISTA_TABLE_CELL_TYPE["MULTIPLE_TEXT_LINES"] = "MULTIPLE_TEXT_LINES";
|
|
12
|
+
VISTA_TABLE_CELL_TYPE["OBJECT"] = "OBJECT";
|
|
12
13
|
VISTA_TABLE_CELL_TYPE["TEXT"] = "TEXT";
|
|
13
14
|
})(VISTA_TABLE_CELL_TYPE || (exports.VISTA_TABLE_CELL_TYPE = VISTA_TABLE_CELL_TYPE = {}));
|
|
File without changes
|
|
File without changes
|