@appcorp/app-corp-vista 0.1.77 → 0.1.79
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-combobox-v1/vista-combobox-v1.js +1 -1
- 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-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
|
@@ -51,7 +51,7 @@ var VistaComboboxV1 = function (_a) {
|
|
|
51
51
|
return id === selectedItem.id;
|
|
52
52
|
})[0];
|
|
53
53
|
}, [selectedItem]);
|
|
54
|
-
return (react_1.default.createElement(react_2.Combobox, { as: "div", className: "".concat(comboboxClassName), onChange: function (v) { return handleOnChange(nodeSelectKey, v); }, value: (filteredItem === null || filteredItem === void 0 ? void 0 : filteredItem[selectKey1]) || '', disabled: disabled },
|
|
54
|
+
return (react_1.default.createElement(react_2.Combobox, { as: "div", className: "".concat(comboboxClassName), onChange: function (v) { return handleOnChange(nodeSelectKey, v); }, value: (filteredItem === null || filteredItem === void 0 ? void 0 : filteredItem[selectKey1]) || selectedItem[selectKey1] || '', disabled: disabled },
|
|
55
55
|
react_1.default.createElement(react_2.Label, { className: "block text-sm/6 font-medium text-gray-900 dark:text-white ".concat(labelClassName) },
|
|
56
56
|
label,
|
|
57
57
|
" ",
|
|
@@ -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.79",
|
|
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
|