@appcorp/app-corp-vista 0.1.30 → 0.1.32

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.
@@ -11,7 +11,7 @@ var solid_1 = require("@heroicons/react/20/solid");
11
11
  var VistaSelectV1 = function (_a) {
12
12
  var _b = _a.className, className = _b === void 0 ? '' : _b, handleOnChange = _a.handleOnChange, label = _a.label, listItems = _a.listItems, nodeSelectedKey = _a.nodeSelectedKey, _c = _a.required, required = _c === void 0 ? false : _c, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem;
13
13
  return (react_1.default.createElement("div", { className: className },
14
- react_1.default.createElement(react_2.Listbox, { value: selectedItem, onChange: function (v) { return handleOnChange(nodeSelectedKey, v); } },
14
+ react_1.default.createElement(react_2.Listbox, { value: selectedItem, onChange: function (v) { handleOnChange(nodeSelectedKey, v[selectKey1]); } },
15
15
  label && (react_1.default.createElement(react_2.Label, { className: "block text-sm/6 font-medium text-gray-900 dark:text-white" },
16
16
  label,
17
17
  " ",
@@ -8,14 +8,15 @@ var react_1 = __importDefault(require("react"));
8
8
  var vista_button_v1_1 = require("./vista-button-v1/vista-button-v1");
9
9
  var vista_button_type_1 = require("../type/vista-button-type");
10
10
  var vista_text_input_v1_1 = require("./vista-text-input-v1");
11
+ var outline_1 = require("@heroicons/react/24/outline");
11
12
  var VistaTableHeaderV1 = function (_a) {
12
- var handleSearchInput = _a.handleSearchInput, headerActions = _a.headerActions, searchDisabled = _a.searchDisabled, searchEnabled = _a.searchEnabled, searchId = _a.searchId, searchPlaceholder = _a.searchPlaceholder, searchValue = _a.searchValue, tableDescription = _a.tableDescription, tableHeading = _a.tableHeading;
13
+ var handleSearchInput = _a.handleSearchInput, handleSuffixOnClick = _a.handleSuffixOnClick, headerActions = _a.headerActions, searchDisabled = _a.searchDisabled, searchEnabled = _a.searchEnabled, searchId = _a.searchId, searchPlaceholder = _a.searchPlaceholder, searchValue = _a.searchValue, tableDescription = _a.tableDescription, tableHeading = _a.tableHeading;
13
14
  return (react_1.default.createElement("div", { className: "sm:flex sm:items-center" },
14
15
  react_1.default.createElement("div", { className: "sm:flex-auto" },
15
16
  react_1.default.createElement("h1", { className: "text-base font-semibold text-gray-900 dark:text-white" }, tableHeading),
16
17
  react_1.default.createElement("p", { className: "mt-2 text-sm text-gray-900 dark:text-white" }, tableDescription)),
17
18
  react_1.default.createElement("div", { className: "mt-4 flex gap-4 sm:ml-16 sm:mt-0 sm:flex-none" },
18
- searchEnabled && (react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, { disabled: searchDisabled, handleOnChange: handleSearchInput, id: searchId, placeholder: searchPlaceholder, value: searchValue })),
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 })),
19
20
  headerActions
20
21
  .filter(function (_a) {
21
22
  var enabled = _a.enabled;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.VistaTextInputV1 = void 0;
8
8
  var react_1 = __importDefault(require("react"));
9
9
  var VistaTextInputV1 = function (_a) {
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, handleOnKeyDown = _a.handleOnKeyDown, id = _a.id, info = _a.info, label = _a.label, max = _a.max, min = _a.min, optional = _a.optional, placeholder = _a.placeholder, prefix = _a.prefix, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _f === void 0 ? false : _f, suffix = _a.suffix, _g = _a.type, type = _g === void 0 ? 'text' : _g, value = _a.value;
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, handleOnKeyDown = _a.handleOnKeyDown, handleSuffixOnClick = _a.handleSuffixOnClick, id = _a.id, info = _a.info, label = _a.label, max = _a.max, min = _a.min, optional = _a.optional, placeholder = _a.placeholder, prefix = _a.prefix, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.required, required = _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
13
  label && (react_1.default.createElement("div", { className: "mb-2" },
@@ -22,7 +22,7 @@ var VistaTextInputV1 = function (_a) {
22
22
  react_1.default.createElement("input", { autoComplete: id, 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-200 focus:ring-2 focus:ring-inset focus:ring-primary disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-300 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(prefix && 'pl-7', " ").concat(className), disabled: disabled, id: id, name: id, onChange: function (e) {
23
23
  return handleOnChange(id, e.target.value);
24
24
  }, autoFocus: autoFocus, max: max, min: min, onKeyDown: handleOnKeyDown, placeholder: placeholder, readOnly: readOnly, required: required, type: type, value: value }),
25
- suffix && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3" },
25
+ suffix && handleSuffixOnClick && (react_1.default.createElement("div", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3", onClick: handleSuffixOnClick },
26
26
  react_1.default.createElement("span", { id: "price-currency", className: "text-gray-500 sm:text-sm" }, suffix)))),
27
27
  info && !error && (react_1.default.createElement("p", { id: "".concat(id, "-info"), className: "mt-2 text-sm text-primary" }, info)),
28
28
  error && !info && (react_1.default.createElement("p", { id: "".concat(id, "-error"), className: "mt-2 text-sm text-red-500 dark:text-red-500" }, error))));
@@ -8,9 +8,9 @@ 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, handleSearchInput = _a.handleSearchInput, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, nodeSelectedKey = _a.nodeSelectedKey, searchDisabled = _a.searchDisabled, _b = _a.searchEnabled, searchEnabled = _b === void 0 ? false : _b, searchId = _a.searchId, searchPlaceholder = _a.searchPlaceholder, searchValue = _a.searchValue, selectKey1 = _a.selectKey1, selectKey2 = _a.selectKey2, selectedItem = _a.selectedItem, 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, handleSearchInput = _a.handleSearchInput, handleSuffixOnClick = _a.handleSuffixOnClick, headerActions = _a.headerActions, isNextDisabled = _a.isNextDisabled, isPreviousDisabled = _a.isPreviousDisabled, listOptions = _a.listOptions, nodeSelectedKey = _a.nodeSelectedKey, searchDisabled = _a.searchDisabled, _b = _a.searchEnabled, searchEnabled = _b === void 0 ? false : _b, searchId = _a.searchId, searchPlaceholder = _a.searchPlaceholder, searchValue = _a.searchValue, 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", null,
13
- react_1.default.createElement(vista_table_header_v1_1.VistaTableHeaderV1, { handleSearchInput: handleSearchInput, headerActions: headerActions, searchDisabled: searchDisabled, searchEnabled: searchEnabled, searchId: searchId, searchPlaceholder: searchPlaceholder, searchValue: searchValue, tableDescription: tableDescription, tableHeading: tableHeading }),
13
+ 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 }),
14
14
  react_1.default.createElement("div", { className: "mt-8 inline-block min-w-full py-2 align-middle" },
15
15
  react_1.default.createElement("table", { className: "min-w-full divide-y divide-gray-700" },
16
16
  react_1.default.createElement("thead", null, tableHead),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/app-corp-vista",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
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",
@@ -1,6 +1,7 @@
1
1
  import { VistaTableHeaderActionItem } from "./vista-table-type";
2
2
  export interface VistaTableHeaderV1Props {
3
3
  handleSearchInput: (k: string, v: string) => void;
4
+ handleSuffixOnClick?: () => void;
4
5
  headerActions: VistaTableHeaderActionItem[];
5
6
  searchDisabled: boolean;
6
7
  searchEnabled?: boolean;
@@ -12,16 +12,17 @@ export interface VistaTableV1Props {
12
12
  handleOnSelect: (k: string, v: string) => void;
13
13
  handlePreviousOnClick: () => void;
14
14
  handleSearchInput: (k: string, v: string) => void;
15
+ handleSuffixOnClick?: () => void;
15
16
  headerActions: VistaTableHeaderActionItem[];
16
- searchEnabled?: boolean;
17
- searchDisabled: boolean;
18
- searchId: string;
19
- searchPlaceholder: string;
20
- searchValue: string;
21
17
  isNextDisabled: boolean;
22
18
  isPreviousDisabled: boolean;
23
19
  listOptions: Object[];
24
20
  nodeSelectedKey: string;
21
+ searchDisabled: boolean;
22
+ searchEnabled?: boolean;
23
+ searchId: string;
24
+ searchPlaceholder: string;
25
+ searchValue: string;
25
26
  selectKey1: string;
26
27
  selectKey2?: string;
27
28
  selectedItem: {
@@ -6,6 +6,7 @@ export interface VistaTextInputV1Props {
6
6
  error?: string;
7
7
  handleOnChange: (k: string, v: string) => void;
8
8
  handleOnKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;
9
+ handleSuffixOnClick?: () => void;
9
10
  id: string;
10
11
  info?: string;
11
12
  label?: string;