@appcorp/app-corp-vista 0.0.25 → 0.0.26

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.
@@ -45,8 +45,8 @@ var VistaComboboxV1 = function (_a) {
45
45
  ? listItems
46
46
  : listItems.filter(function (item) { var _a; return (_a = item[selectKey1]) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(query.toLowerCase()); });
47
47
  }, [listItems, query]);
48
- return (react_1.default.createElement(react_2.Combobox, { as: "div", value: selectedItem, onChange: function (v) { return handleOnChange(nodeSelectKey, v); } },
49
- react_1.default.createElement(react_2.Label, { className: "flex items-center gap-2 text-sm/6 font-medium text-gray-900 dark:text-white" },
48
+ return (react_1.default.createElement(react_2.Combobox, { as: "div", onChange: function (v) { return handleOnChange(nodeSelectKey, v); }, value: selectedItem[selectKey1] },
49
+ react_1.default.createElement(react_2.Label, { className: "block text-sm/6 font-medium text-gray-900 dark:text-white" },
50
50
  label,
51
51
  " ",
52
52
  required && react_1.default.createElement("sup", { className: "text-red-500" }, "*")),
@@ -45,7 +45,7 @@ var VistaDashboardSidebarV1 = function (_a) {
45
45
  return enabled;
46
46
  });
47
47
  }, [apps]);
48
- return (react_1.default.createElement("div", { className: "flex grow flex-col gap-y-5 overflow-y-auto bg-gray-100 dark:bg-gray-900 px-6 ring-1 ring-white/10" },
48
+ return (react_1.default.createElement("div", { className: "flex grow flex-col gap-y-5 overflow-y-auto bg-gray-200 dark:bg-gray-900 px-6 ring-1 ring-white/10" },
49
49
  react_1.default.createElement("div", { className: "flex h-16 shrink-0 items-center" },
50
50
  react_1.default.createElement("img", { alt: appName, src: logo, className: "h-8 w-auto" })),
51
51
  react_1.default.createElement("nav", { className: "flex flex-1 flex-col" },
@@ -9,12 +9,15 @@ var react_1 = __importDefault(require("react"));
9
9
  var react_2 = require("@headlessui/react");
10
10
  var solid_1 = require("@heroicons/react/20/solid");
11
11
  var VistaSelectV1 = function (_a) {
12
- var handleOnSelect = _a.handleOnSelect, label = _a.label, listItems = _a.listItems, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selected = _a.selected;
13
- return (react_1.default.createElement(react_2.Listbox, { value: selected, onChange: handleOnSelect },
14
- label && (react_1.default.createElement(react_2.Label, { className: "block text-sm/6 font-medium text-gray-900 dark:text-white" }, label)),
12
+ var handleOnSelect = _a.handleOnSelect, label = _a.label, listItems = _a.listItems, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, _b = _a.required, required = _b === void 0 ? false : _b;
13
+ return (react_1.default.createElement(react_2.Listbox, { value: selectedItem, onChange: handleOnSelect },
14
+ label && (react_1.default.createElement(react_2.Label, { className: "block text-sm/6 font-medium text-gray-900 dark:text-white" },
15
+ label,
16
+ " ",
17
+ required && react_1.default.createElement("sup", { className: "text-red-500" }, "*"))),
15
18
  react_1.default.createElement("div", { className: "relative ".concat(label ? 'mt-2' : '') },
16
19
  react_1.default.createElement(react_2.ListboxButton, { className: "relative w-full cursor-default rounded-md bg-white/5 dark:bg-white/5 py-1.5 pl-3 pr-10 text-left text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-500 focus:ring-2 focus:ring-inset focus:ring-primary sm:text-sm/6" },
17
- react_1.default.createElement("span", { className: "block truncate" }, selected[selectKey1]),
20
+ react_1.default.createElement("span", { className: "block truncate" }, selectedItem[selectKey1]),
18
21
  react_1.default.createElement("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2" },
19
22
  react_1.default.createElement(solid_1.ChevronUpDownIcon, { "aria-hidden": "true", className: "size-5 text-gray-900 dark:text-white" }))),
20
23
  react_1.default.createElement(react_2.ListboxOptions, { className: "absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-gray-200 dark:bg-gray-700 py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in sm:text-sm", transition: true }, listItems.map(function (item) { return (react_1.default.createElement(react_2.ListboxOption, { className: "group relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 dark:text-white data-[focus]:bg-indigo-600 data-[focus]:text-white", key: item[selectKey1], value: item[selectKey1] },
@@ -9,7 +9,7 @@ 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 VistaTableFooterV1 = function (_a) {
12
- var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selected = _a.selected, totalPages = _a.totalPages;
12
+ var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, totalPages = _a.totalPages;
13
13
  return (react_1.default.createElement("div", { className: "grid w-full grid-cols-12 items-center border-t border-gray-300 px-4 py-4 text-white" },
14
14
  react_1.default.createElement("div", { className: "col-span-6 text-gray-900 dark:text-white" },
15
15
  react_1.default.createElement("span", { className: "font-bold" },
@@ -21,7 +21,7 @@ var VistaTableFooterV1 = function (_a) {
21
21
  totalPages)),
22
22
  react_1.default.createElement("div", { className: "col-span-6 flex flex-row items-center justify-end gap-4" },
23
23
  react_1.default.createElement("div", { className: "min-w-36" },
24
- react_1.default.createElement(vista_select_v1_1.VistaSelectV1, { listItems: listOptions, selected: selected, handleOnSelect: handleOnSelect, selectKey1: selectKey1, selectKey2: selectKey2 })),
24
+ react_1.default.createElement(vista_select_v1_1.VistaSelectV1, { listItems: listOptions, selectedItem: selectedItem, handleOnSelect: handleOnSelect, selectKey1: selectKey1, selectKey2: selectKey2 })),
25
25
  react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { disabled: isPreviousDisabled, handleOnClick: handlePreviousOnClick, prefixIcon: react_1.default.createElement(solid_1.ChevronLeftIcon, { className: '5' }), label: "Previous" }),
26
26
  react_1.default.createElement(vista_button_v1_1.VistaButtonV1, { disabled: isNextDisabled, handleOnClick: handleNextOnClick, suffixIcon: react_1.default.createElement(solid_1.ChevronRightIcon, { className: '5' }), label: "Next" }))));
27
27
  };
@@ -10,7 +10,10 @@ var VistaTextAreaV1 = function (_a) {
10
10
  var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, id = _a.id, info = _a.info, label = _a.label, optional = _a.optional, placeholder = _a.placeholder, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _f === void 0 ? false : _f, _g = _a.rows, rows = _g === void 0 ? 4 : _g, value = _a.value;
11
11
  return (react_1.default.createElement("div", null,
12
12
  react_1.default.createElement("div", { className: "flex justify-between" },
13
- react_1.default.createElement("label", { htmlFor: id, className: "block text-sm/6 font-medium text-gray-900 dark:text-white" }, label),
13
+ react_1.default.createElement("label", { htmlFor: id, className: "block text-sm/6 font-medium text-gray-900 dark:text-white" },
14
+ label,
15
+ " ",
16
+ required && react_1.default.createElement("sup", { className: "text-red-500" }, "*")),
14
17
  optional && (react_1.default.createElement("span", { id: "".concat(id, "-optional"), className: "text-sm/6 text-gray-500" }, optional))),
15
18
  react_1.default.createElement("div", { className: "mt-2" },
16
19
  react_1.default.createElement("textarea", { autoFocus: autoFocus, className: "block w-full rounded-md border-0 bg-white/5 dark:bg-white/5 py-1.5 text-gray-900 dark:text-white shadow-sm ring-1 ring-inset ring-gray-500 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-500 disabled:ring-gray-200 sm:text-sm/6 dark:disabled:bg-gray-800 dark:disabled:text-gray-400 dark:disabled:ring-gray-700 placeholder:text-gray-500 ".concat(className), cols: 200, disabled: disabled, id: id, name: id, onChange: function (e) {
@@ -10,9 +10,11 @@ var VistaTextInputV1 = function (_a) {
10
10
  var _b = _a.autoFocus, autoFocus = _b === void 0 ? false : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, error = _a.error, handleOnChange = _a.handleOnChange, id = _a.id, info = _a.info, label = _a.label, optional = _a.optional, placeholder = _a.placeholder, _e = _a.required, required = _e === void 0 ? false : _e, prefix = _a.prefix, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
11
11
  return (react_1.default.createElement("div", null,
12
12
  react_1.default.createElement("div", { className: "flex justify-between" },
13
- label && (react_1.default.createElement("div", { className: "flex items-center gap-2 mb-2" },
14
- react_1.default.createElement("label", { htmlFor: id, className: "block text-sm/6 font-medium text-gray-900 dark:text-white" }, label),
15
- required && react_1.default.createElement("sup", { className: "text-red-500" }, "*"))),
13
+ label && (react_1.default.createElement("div", { className: "mb-2" },
14
+ react_1.default.createElement("label", { htmlFor: id, className: "block text-sm/6 font-medium text-gray-900 dark:text-white" },
15
+ label,
16
+ " ",
17
+ required && react_1.default.createElement("sup", { className: "text-red-500" }, "*")))),
16
18
  optional && (react_1.default.createElement("span", { id: "".concat(id, "-optional"), className: "text-sm/6 text-gray-500" }, optional))),
17
19
  react_1.default.createElement("div", { className: "relative" },
18
20
  prefix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3" },
@@ -8,7 +8,7 @@ var react_1 = __importDefault(require("react"));
8
8
  var vista_table_header_v1_1 = require("../../molecules/vista-table-header-v1");
9
9
  var vista_table_footer_v1_1 = require("../../molecules/vista-table-footer-v1");
10
10
  var VistaTableV1 = function (_a) {
11
- var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selected = _a.selected, tableBody = _a.tableBody, tableDescription = _a.tableDescription, tableHead = _a.tableHead, tableHeading = _a.tableHeading, totalPages = _a.totalPages;
11
+ var currentPage = _a.currentPage, handleNextOnClick = _a.handleNextOnClick, handleOnSelect = _a.handleOnSelect, handlePreviousOnClick = _a.handlePreviousOnClick, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, tableBody = _a.tableBody, tableDescription = _a.tableDescription, tableHead = _a.tableHead, tableHeading = _a.tableHeading, totalPages = _a.totalPages;
12
12
  return (react_1.default.createElement("div", { className: "px-4 sm:px-6 lg:px-8" },
13
13
  react_1.default.createElement(vista_table_header_v1_1.VistaTableHeaderV1, { tableDescription: tableDescription, tableHeading: tableHeading, headerActions: headerActions }),
14
14
  react_1.default.createElement("div", { className: "mt-8 flow-root" },
@@ -17,6 +17,6 @@ var VistaTableV1 = function (_a) {
17
17
  react_1.default.createElement("table", { className: "min-w-full divide-y divide-gray-700" },
18
18
  react_1.default.createElement("thead", null, tableHead),
19
19
  react_1.default.createElement("tbody", { className: "divide-y divide-gray-700" }, tableBody)),
20
- react_1.default.createElement(vista_table_footer_v1_1.VistaTableFooterV1, { currentPage: currentPage, handleNextOnClick: handleNextOnClick, handleOnSelect: handleOnSelect, handlePreviousOnClick: handlePreviousOnClick, isNextDisabled: isNextDisabled, isPreviousDisabled: isPreviousDisabled, listOptions: listOptions, selectKey1: selectKey1, selectKey2: selectKey2, selected: selected, totalPages: totalPages }))))));
20
+ react_1.default.createElement(vista_table_footer_v1_1.VistaTableFooterV1, { currentPage: currentPage, handleNextOnClick: handleNextOnClick, handleOnSelect: handleOnSelect, handlePreviousOnClick: handlePreviousOnClick, isNextDisabled: isNextDisabled, isPreviousDisabled: isPreviousDisabled, listOptions: listOptions, selectKey1: selectKey1, selectKey2: selectKey2, selectedItem: selectedItem, totalPages: totalPages }))))));
21
21
  };
22
22
  exports.VistaTableV1 = VistaTableV1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
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",
@@ -22,7 +22,7 @@ var outline_1 = require("@heroicons/react/24/outline");
22
22
  var vista_dashboard_sidebar_v1_1 = require("../../molecules/vista-dashboard-sidebar-v1/vista-dashboard-sidebar-v1");
23
23
  var vista_dashboard_topbar_v1_1 = require("../../molecules/vista-dashboard-topbar-v1/vista-dashboard-topbar-v1");
24
24
  var VistaDashboardV1 = function (_a) {
25
- var children = _a.children, sideBar = _a.sideBar, topBar = _a.topBar, isSideBarOpen = _a.isSideBarOpen, handleIsSideBarOpen = _a.handleIsSideBarOpen;
25
+ var children = _a.children, handleIsSideBarOpen = _a.handleIsSideBarOpen, isSideBarOpen = _a.isSideBarOpen, sideBar = _a.sideBar, topBar = _a.topBar;
26
26
  return (react_1.default.createElement("section", { className: 'h-full' },
27
27
  react_1.default.createElement(react_2.Dialog, { className: "relative z-10 xl:hidden", onClose: handleIsSideBarOpen, open: isSideBarOpen },
28
28
  react_1.default.createElement(react_2.DialogBackdrop, { className: "fixed inset-0 bg-gray-900/80 transition-opacity duration-300 ease-linear data-[closed]:opacity-0", transition: true }),
@@ -10,5 +10,7 @@ export interface VistaComboboxV1Props {
10
10
  query: string;
11
11
  required?: boolean;
12
12
  selectKey1: string;
13
- selectedItem: any;
13
+ selectedItem: {
14
+ [key: string]: any;
15
+ };
14
16
  }
@@ -1,8 +1,11 @@
1
1
  export interface VistaSelectV1Props {
2
+ handleOnSelect: () => void;
2
3
  label?: string;
3
4
  listItems: any[];
4
- selected: any;
5
- handleOnSelect: () => void;
5
+ required?: boolean;
6
6
  selectKey1: string;
7
7
  selectKey2?: string;
8
+ selectedItem: {
9
+ [key: string]: any;
10
+ };
8
11
  }
@@ -8,6 +8,8 @@ export interface VistaTableFooterV1Props {
8
8
  listOptions: Object[];
9
9
  selectKey1: string;
10
10
  selectKey2?: string;
11
- selected: Object;
11
+ selectedItem: {
12
+ [key: string]: any;
13
+ };
12
14
  totalPages: number;
13
15
  }
@@ -17,7 +17,9 @@ export interface VistaTableV1Props {
17
17
  listOptions: Object[];
18
18
  selectKey1: string;
19
19
  selectKey2?: string;
20
- selected: Object;
20
+ selectedItem: {
21
+ [key: string]: any;
22
+ };
21
23
  tableBody: ReactNode;
22
24
  tableDescription: string;
23
25
  tableHead: ReactNode;