@appcorp/app-corp-vista 0.1.56 → 0.1.58
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-button-v1/vista-button-v1.js +11 -5
- package/molecules/vista-table-footer-v1.js +14 -8
- package/molecules/vista-table-header-v1.js +1 -1
- package/organisms/vista-table-v1/vista-table-v1.js +2 -2
- package/package.json +1 -1
- package/type/vista-button-type.d.ts +2 -0
- package/type/vista-table-footer-type.d.ts +6 -0
- package/type/vista-table-type.d.ts +6 -0
|
@@ -8,6 +8,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.VistaButtonV1 = void 0;
|
|
9
9
|
var react_1 = __importDefault(require("react"));
|
|
10
10
|
var vista_button_type_1 = require("../../type/vista-button-type");
|
|
11
|
+
var vista_dashboard_type_1 = require("../../type/vista-dashboard-type");
|
|
11
12
|
var vistaButtonSizeMap = (_a = {},
|
|
12
13
|
_a[vista_button_type_1.VISTA_BUTTON_SIZE.XS] = 'px-2 py-1 text-xs',
|
|
13
14
|
_a[vista_button_type_1.VISTA_BUTTON_SIZE.SM] = 'px-2 py-1 text-sm',
|
|
@@ -31,14 +32,19 @@ var vistaButtonRoundedMap = (_c = {},
|
|
|
31
32
|
_c[vista_button_type_1.VISTA_BUTTON_ROUNDED.FULL] = 'rounded-full',
|
|
32
33
|
_c);
|
|
33
34
|
var VistaButtonV1 = function (_a) {
|
|
34
|
-
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.disabled, disabled =
|
|
35
|
-
|
|
35
|
+
var _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.dir, dir = _c === void 0 ? vista_dashboard_type_1.APP_DIR.LTR : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, handleOnClick = _a.handleOnClick, icon = _a.icon, label = _a.label, _e = _a.loading, loading = _e === void 0 ? false : _e, prefixIcon = _a.prefixIcon, _f = _a.rounded, rounded = _f === void 0 ? vista_button_type_1.VISTA_BUTTON_ROUNDED.MD : _f, _g = _a.size, size = _g === void 0 ? vista_button_type_1.VISTA_BUTTON_SIZE.SM : _g, suffixIcon = _a.suffixIcon, _h = _a.variant, variant = _h === void 0 ? vista_button_type_1.VISTA_BUTTON_VARIANT.PRIMARY : _h;
|
|
36
|
+
var labelNextClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-1' : 'order-2';
|
|
37
|
+
var labelPreviousClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-2' : 'order-1';
|
|
38
|
+
var prefixClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-1' : 'order-2';
|
|
39
|
+
var suffixClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-2' : 'order-1';
|
|
40
|
+
var labelClassName = label === 'Next' ? labelNextClassName : labelPreviousClassName;
|
|
41
|
+
return (react_1.default.createElement("button", { className: "flex flex-row justify-center items-center font-semibold shadow-sm focus-visible:outline focus-visible:outline-offset-2 disabled:bg-gray-200 disabled:text-gray-400 cursor-pointer ".concat(className, " ").concat(vistaButtonVariantMap[variant], " ").concat(vistaButtonRoundedMap[rounded], " ").concat(vistaButtonSizeMap[size]), onClick: handleOnClick, disabled: disabled, type: "button" },
|
|
36
42
|
react_1.default.createElement("div", { className: 'flex flex-row justify-center items-center gap-2' },
|
|
37
|
-
react_1.default.createElement(
|
|
43
|
+
prefixIcon && (react_1.default.createElement("div", { className: prefixClassName }, variant !== vista_button_type_1.VISTA_BUTTON_VARIANT.ICON && prefixIcon)),
|
|
38
44
|
loading && react_1.default.createElement("div", { className: "border-gray-300 h-4 w-4 animate-spin rounded-full border-1 border-t-gray-500" }),
|
|
39
45
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
|
-
variant !== vista_button_type_1.VISTA_BUTTON_VARIANT.ICON && label,
|
|
46
|
+
react_1.default.createElement("p", { className: labelClassName }, variant !== vista_button_type_1.VISTA_BUTTON_VARIANT.ICON && label),
|
|
41
47
|
variant === vista_button_type_1.VISTA_BUTTON_VARIANT.ICON && icon),
|
|
42
|
-
react_1.default.createElement(
|
|
48
|
+
suffixIcon && (react_1.default.createElement("div", { className: suffixClassName }, variant !== vista_button_type_1.VISTA_BUTTON_VARIANT.ICON && suffixIcon)))));
|
|
43
49
|
};
|
|
44
50
|
exports.VistaButtonV1 = VistaButtonV1;
|
|
@@ -9,21 +9,27 @@ var solid_1 = require("@heroicons/react/20/solid");
|
|
|
9
9
|
var vista_select_v1_1 = require("./vista-select-v1/vista-select-v1");
|
|
10
10
|
var vista_button_v1_1 = require("./vista-button-v1/vista-button-v1");
|
|
11
11
|
var vista_button_type_1 = require("../type/vista-button-type");
|
|
12
|
+
var vista_dashboard_type_1 = require("../type/vista-dashboard-type");
|
|
12
13
|
var VistaTableFooterV1 = function (_a) {
|
|
13
|
-
var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, nodeSelectedKey = _a.nodeSelectedKey, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, totalPages = _a.totalPages;
|
|
14
|
-
|
|
14
|
+
var currentPage = _a.currentPage, _b = _a.dir, dir = _b === void 0 ? vista_dashboard_type_1.APP_DIR.LTR : _b, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, _c = _a.nextLabel, nextLabel = _c === void 0 ? 'Next' : _c, nodeSelectedKey = _a.nodeSelectedKey, _d = _a.ofLabel, ofLabel = _d === void 0 ? 'of' : _d, _e = _a.pageLabel, pageLabel = _e === void 0 ? 'Page' : _e, _f = _a.previousLabel, previousLabel = _f === void 0 ? 'Previous' : _f, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, totalPages = _a.totalPages;
|
|
15
|
+
var selectClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-1' : 'order-3';
|
|
16
|
+
var previousClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-2' : 'order-2';
|
|
17
|
+
var nextClassName = dir === vista_dashboard_type_1.APP_DIR.LTR ? 'order-3' : 'order-1';
|
|
18
|
+
return (react_1.default.createElement("div", { className: "flex flex-row justify-between items-center py-4" },
|
|
15
19
|
react_1.default.createElement("div", { className: "col-span-6 text-gray-900 dark:text-white" },
|
|
16
20
|
react_1.default.createElement("span", { className: "font-bold" },
|
|
17
|
-
|
|
21
|
+
pageLabel,
|
|
22
|
+
" ",
|
|
18
23
|
currentPage),
|
|
19
24
|
' ',
|
|
20
25
|
react_1.default.createElement("span", null,
|
|
21
|
-
|
|
26
|
+
ofLabel,
|
|
27
|
+
" ",
|
|
22
28
|
totalPages)),
|
|
23
29
|
react_1.default.createElement("div", { className: "col-span-6 flex flex-row items-center justify-end gap-4" },
|
|
24
|
-
react_1.default.createElement("div", { className: "min-w-36" },
|
|
25
|
-
react_1.default.createElement(vista_select_v1_1.VistaSelectV1, {
|
|
26
|
-
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { disabled: isPreviousDisabled, handleOnClick: handlePreviousOnClick, prefixIcon: react_1.default.createElement(solid_1.ChevronLeftIcon, { className: 'size-5' }),
|
|
27
|
-
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { disabled: isNextDisabled, handleOnClick: handleNextOnClick, suffixIcon: react_1.default.createElement(solid_1.ChevronRightIcon, { className: 'size-5' })
|
|
30
|
+
react_1.default.createElement("div", { className: "min-w-36 ".concat(selectClassName) },
|
|
31
|
+
react_1.default.createElement(vista_select_v1_1.VistaSelectV1, { handleOnChange: handleOnSelect, listItems: listOptions, nodeSelectedKey: nodeSelectedKey, selectKey1: selectKey1, selectKey2: selectKey2, selectedItem: selectedItem })),
|
|
32
|
+
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { className: "".concat(previousClassName), dir: dir, disabled: isPreviousDisabled, handleOnClick: handlePreviousOnClick, label: previousLabel, prefixIcon: react_1.default.createElement(solid_1.ChevronLeftIcon, { className: 'size-5' }), size: vista_button_type_1.VISTA_BUTTON_SIZE.LG }),
|
|
33
|
+
react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { className: "".concat(nextClassName), dir: dir, disabled: isNextDisabled, handleOnClick: handleNextOnClick, label: nextLabel, size: vista_button_type_1.VISTA_BUTTON_SIZE.LG, suffixIcon: react_1.default.createElement(solid_1.ChevronRightIcon, { className: 'size-5' }) }))));
|
|
28
34
|
};
|
|
29
35
|
exports.VistaTableFooterV1 = VistaTableFooterV1;
|
|
@@ -15,7 +15,7 @@ var VistaTableHeaderV1 = function (_a) {
|
|
|
15
15
|
react_1.default.createElement("div", { className: "sm:flex-auto" },
|
|
16
16
|
react_1.default.createElement("h1", { className: "text-base font-semibold text-gray-900 dark:text-white" }, tableHeading),
|
|
17
17
|
react_1.default.createElement("p", { className: "mt-2 text-sm text-gray-900 dark:text-white" }, tableDescription)),
|
|
18
|
-
react_1.default.createElement("div", { className: "mt-4 flex gap-4 sm:
|
|
18
|
+
react_1.default.createElement("div", { className: "mt-4 flex gap-4 sm:mt-0 sm:flex-none" },
|
|
19
19
|
searchEnabled && (react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { disabled: searchDisabled, handleOnChange: handleSearchInput, handleSuffixOnClick: handleSuffixOnClick, id: searchId, placeholder: searchPlaceholder, suffix: react_1.default.createElement(outline_1.XMarkIcon, { className: 'size-5' }), value: searchValue })),
|
|
20
20
|
headerActions
|
|
21
21
|
.filter(function (_a) {
|
|
@@ -10,7 +10,7 @@ var vista_table_footer_v1_1 = require("../../molecules/vista-table-footer-v1");
|
|
|
10
10
|
var vista_table_head_v1_1 = require("./vista-table-head-v1");
|
|
11
11
|
var vista_table_body_v1_1 = require("./vista-table-body-v1");
|
|
12
12
|
var VistaTableV1 = function (_a) {
|
|
13
|
-
var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, handleSearchInput = _a.handleSearchInput, handleSuffixOnClick = _a.handleSuffixOnClick, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, loading = _a.loading, nodeSelectedKey = _a.nodeSelectedKey, pageLimit = _a.pageLimit, rowActions = _a.rowActions, searchDisabled = _a.searchDisabled,
|
|
13
|
+
var currentPage = _a.currentPage, dir = _a.dir, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, handleSearchInput = _a.handleSearchInput, handleSuffixOnClick = _a.handleSuffixOnClick, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, loading = _a.loading, _b = _a.nextLabel, nextLabel = _b === void 0 ? 'Next' : _b, nodeSelectedKey = _a.nodeSelectedKey, _c = _a.ofLabel, ofLabel = _c === void 0 ? 'of' : _c, _d = _a.pageLabel, pageLabel = _d === void 0 ? 'Page' : _d, pageLimit = _a.pageLimit, _e = _a.previousLabel, previousLabel = _e === void 0 ? 'Previous' : _e, rowActions = _a.rowActions, searchDisabled = _a.searchDisabled, _f = _a.searchEnabled, searchEnabled = _f === void 0 ? false : _f, searchId = _a.searchId, searchPlaceholder = _a.searchPlaceholder, searchValue = _a.searchValue, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, tableBodyCols = _a.tableBodyCols, tableBodyRows = _a.tableBodyRows, tableDescription = _a.tableDescription, tableHeadItems = _a.tableHeadItems, tableHeading = _a.tableHeading, totalPages = _a.totalPages;
|
|
14
14
|
return (react_1.default.createElement("div", null,
|
|
15
15
|
react_1.default.createElement(vista_table_header_v1_1.VistaTableHeaderV1, { handleSearchInput: handleSearchInput, handleSuffixOnClick: handleSuffixOnClick, headerActions: headerActions, searchDisabled: searchDisabled, searchEnabled: searchEnabled, searchId: searchId, searchPlaceholder: searchPlaceholder, searchValue: searchValue, tableDescription: tableDescription, tableHeading: tableHeading }),
|
|
16
16
|
react_1.default.createElement("div", { className: "mt-8 inline-block min-w-full py-2 align-middle" },
|
|
@@ -19,6 +19,6 @@ var VistaTableV1 = function (_a) {
|
|
|
19
19
|
react_1.default.createElement(vista_table_head_v1_1.VistaTableHeadV1, { items: tableHeadItems })),
|
|
20
20
|
react_1.default.createElement("tbody", { className: "divide-y divide-gray-700 overflow-y-auto" },
|
|
21
21
|
react_1.default.createElement(vista_table_body_v1_1.VistaTableBodyV1, { colLength: tableHeadItems.length, loading: loading, pageLimit: pageLimit, rowActions: rowActions, tableBodyCols: tableBodyCols, tableBodyRows: tableBodyRows }))),
|
|
22
|
-
react_1.default.createElement(vista_table_footer_v1_1.VistaTableFooterV1, { currentPage: currentPage, handleNextOnClick: handleNextOnClick, handleOnSelect: handleOnSelect, handlePreviousOnClick: handlePreviousOnClick, isNextDisabled: isNextDisabled, isPreviousDisabled: isPreviousDisabled, listOptions: listOptions, nodeSelectedKey: nodeSelectedKey, selectKey1: selectKey1, selectKey2: selectKey2, selectedItem: selectedItem, totalPages: totalPages }))));
|
|
22
|
+
react_1.default.createElement(vista_table_footer_v1_1.VistaTableFooterV1, { currentPage: currentPage, dir: dir, handleNextOnClick: handleNextOnClick, handleOnSelect: handleOnSelect, handlePreviousOnClick: handlePreviousOnClick, isNextDisabled: isNextDisabled, isPreviousDisabled: isPreviousDisabled, listOptions: listOptions, nextLabel: nextLabel, nodeSelectedKey: nodeSelectedKey, ofLabel: ofLabel, pageLabel: pageLabel, previousLabel: previousLabel, selectKey1: selectKey1, selectKey2: selectKey2, selectedItem: selectedItem, totalPages: totalPages }))));
|
|
23
23
|
};
|
|
24
24
|
exports.VistaTableV1 = VistaTableV1;
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode, MouseEvent } from "react";
|
|
2
|
+
import { APP_DIR } from "./vista-dashboard-type";
|
|
2
3
|
export declare enum VISTA_BUTTON_SIZE {
|
|
3
4
|
XS = "XS",
|
|
4
5
|
SM = "SM",
|
|
@@ -33,4 +34,5 @@ export interface VistaButtonV1Props {
|
|
|
33
34
|
size?: VISTA_BUTTON_SIZE;
|
|
34
35
|
suffixIcon?: ReactNode;
|
|
35
36
|
variant?: VISTA_BUTTON_VARIANT;
|
|
37
|
+
dir?: APP_DIR;
|
|
36
38
|
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { APP_DIR } from "./vista-dashboard-type";
|
|
1
2
|
export interface VistaTableFooterV1Props {
|
|
2
3
|
currentPage: number;
|
|
4
|
+
dir?: APP_DIR;
|
|
3
5
|
handleNextOnClick: () => void;
|
|
4
6
|
handleOnSelect: (k: string, v: object | string) => void;
|
|
5
7
|
handlePreviousOnClick: () => void;
|
|
6
8
|
isNextDisabled: boolean;
|
|
7
9
|
isPreviousDisabled: boolean;
|
|
8
10
|
listOptions: Object[];
|
|
11
|
+
nextLabel: string;
|
|
9
12
|
nodeSelectedKey: string;
|
|
13
|
+
ofLabel?: string;
|
|
14
|
+
pageLabel?: string;
|
|
15
|
+
previousLabel: string;
|
|
10
16
|
selectKey1: string;
|
|
11
17
|
selectKey2?: string;
|
|
12
18
|
selectedItem: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { RowActionItem } from "./vista-dropdown-menu-type";
|
|
3
|
+
import { APP_DIR } from "./vista-dashboard-type";
|
|
3
4
|
export interface VistaTableHeaderActionItem {
|
|
4
5
|
enabled: boolean;
|
|
5
6
|
handleOnClick: () => void;
|
|
@@ -22,6 +23,7 @@ export declare enum VISTA_TABLE_CELL_TYPE {
|
|
|
22
23
|
}
|
|
23
24
|
export interface VistaTableV1Props {
|
|
24
25
|
currentPage: number;
|
|
26
|
+
dir?: APP_DIR;
|
|
25
27
|
handleNextOnClick: () => void;
|
|
26
28
|
handleOnSelect: (k: string, v: object | string) => void;
|
|
27
29
|
handlePreviousOnClick: () => void;
|
|
@@ -32,8 +34,12 @@ export interface VistaTableV1Props {
|
|
|
32
34
|
isPreviousDisabled: boolean;
|
|
33
35
|
listOptions: Object[];
|
|
34
36
|
loading: boolean;
|
|
37
|
+
nextLabel?: string;
|
|
35
38
|
nodeSelectedKey: string;
|
|
39
|
+
ofLabel?: string;
|
|
40
|
+
pageLabel?: string;
|
|
36
41
|
pageLimit: number;
|
|
42
|
+
previousLabel?: string;
|
|
37
43
|
rowActions: RowActionItem[];
|
|
38
44
|
searchDisabled: boolean;
|
|
39
45
|
searchEnabled?: boolean;
|