avine-react-components
Advanced tools
Comparing version 0.1.23 to 0.1.24
@@ -1116,4 +1116,5 @@ "use strict"; | ||
}; | ||
(0, import_react21.useEffect)(() => setInnerColumns(columns), [columns]); | ||
(0, import_react21.useEffect)(() => setInnerData(data), [data]); | ||
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full" }, /* @__PURE__ */ import_react21.default.createElement("p", null, "P\xE1gina atual: ", currentPage), !viewOnly && /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 justify-end mb-4" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 items-center justify-end" }, searchable && /* @__PURE__ */ import_react21.default.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ import_react21.default.createElement(LuSearch, { className: "absolute top-2.5 left-2 text-gray-300", size: 20 }), /* @__PURE__ */ import_react21.default.createElement( | ||
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full" }, !viewOnly && /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 justify-end mb-4" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 items-center justify-end" }, searchable && /* @__PURE__ */ import_react21.default.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ import_react21.default.createElement(LuSearch, { className: "absolute top-2.5 left-2 text-gray-300", size: 20 }), /* @__PURE__ */ import_react21.default.createElement( | ||
"input", | ||
@@ -1120,0 +1121,0 @@ { |
export { ETableColumnOrder, Table, TableColumn, TableProps } from './components/table/table.js'; | ||
export { Button, ButtonProps } from './components/button/button.js'; | ||
export { NumberInput, NumberInputProps } from './components/number-input/number-input.js'; | ||
export { TextInput, TextInputProps } from './components/text-input/text-input.js'; | ||
export { getNestedValues, sortData } from './components/table/utils.js'; | ||
export { usePagination } from './hooks/use-pagination.js'; | ||
import 'react'; |
@@ -33,4 +33,7 @@ "use strict"; | ||
__export(src_exports, { | ||
Button: () => Button, | ||
ETableColumnOrder: () => ETableColumnOrder, | ||
NumberInput: () => NumberInput, | ||
Table: () => Table, | ||
TextInput: () => TextInput, | ||
getNestedValues: () => getNestedValues, | ||
@@ -1122,4 +1125,5 @@ sortData: () => sortData, | ||
}; | ||
(0, import_react21.useEffect)(() => setInnerColumns(columns), [columns]); | ||
(0, import_react21.useEffect)(() => setInnerData(data), [data]); | ||
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full" }, /* @__PURE__ */ import_react21.default.createElement("p", null, "P\xE1gina atual: ", currentPage), !viewOnly && /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 justify-end mb-4" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 items-center justify-end" }, searchable && /* @__PURE__ */ import_react21.default.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ import_react21.default.createElement(LuSearch, { className: "absolute top-2.5 left-2 text-gray-300", size: 20 }), /* @__PURE__ */ import_react21.default.createElement( | ||
return /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full" }, !viewOnly && /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 justify-end mb-4" }, /* @__PURE__ */ import_react21.default.createElement("div", { className: "w-full flex space-x-4 items-center justify-end" }, searchable && /* @__PURE__ */ import_react21.default.createElement("div", { className: "relative flex-1" }, /* @__PURE__ */ import_react21.default.createElement(LuSearch, { className: "absolute top-2.5 left-2 text-gray-300", size: 20 }), /* @__PURE__ */ import_react21.default.createElement( | ||
"input", | ||
@@ -1172,6 +1176,96 @@ { | ||
}; | ||
// src/components/button/button.tsx | ||
var import_react23 = __toESM(require("react")); | ||
var Button = ({ | ||
className = "", | ||
loading = false, | ||
disabled = false, | ||
children = "", | ||
onClick, | ||
...rest | ||
}) => { | ||
return /* @__PURE__ */ import_react23.default.createElement("button", { className, disabled, onClick, ...rest }, /* @__PURE__ */ import_react23.default.createElement(import_react23.default.Fragment, null, children)); | ||
}; | ||
// src/components/number-input/number-input.tsx | ||
var import_react24 = __toESM(require("react")); | ||
var isOnlyNumbers = (value) => { | ||
if (/^(-)?(\d)*(,)?([0-9]{1})?([0-9]{1})?$/.test(value)) | ||
return true; | ||
return false; | ||
}; | ||
var NumberInput = ({ | ||
placeholder = "", | ||
disabled = false, | ||
value, | ||
onChange, | ||
_size = "md", | ||
...props | ||
}) => { | ||
const sizeClasses = (0, import_react24.useMemo)(() => { | ||
const classes = { | ||
sm: "p-2 sm:text-xs", | ||
md: "p-2.5 text-sm", | ||
lg: "p-4 sm:Text-md" | ||
}; | ||
return classes[_size]; | ||
}, [_size]); | ||
const setAllowedValue = (element) => { | ||
if (isOnlyNumbers(element.target.value) && onChange) | ||
onChange(element); | ||
}; | ||
return /* @__PURE__ */ import_react24.default.createElement( | ||
"input", | ||
{ | ||
className: `block text-gray-900 ${sizeClasses} border border-gray-300 rounded-lg bg-gray-50 outline-none focus:ring-green-500 focus:border-green-500`, | ||
type: "text", | ||
placeholder, | ||
value, | ||
onChange: setAllowedValue, | ||
disabled, | ||
...props | ||
} | ||
); | ||
}; | ||
// src/components/text-input/text-input.tsx | ||
var import_react25 = __toESM(require("react")); | ||
var TextInput = ({ | ||
type = "text", | ||
placeholder = "", | ||
disabled = false, | ||
onChange, | ||
value, | ||
_size = "md", | ||
...rest | ||
}) => { | ||
const sizeClasses = (0, import_react25.useMemo)(() => { | ||
const classes = { | ||
sm: "p-2 sm:text-xs", | ||
md: "p-2.5 text-sm", | ||
lg: "p-4 sm:Text-md" | ||
}; | ||
return classes[_size]; | ||
}, [_size]); | ||
return /* @__PURE__ */ import_react25.default.createElement( | ||
"input", | ||
{ | ||
className: `block text-gray-900 ${sizeClasses} border border-gray-300 rounded-lg bg-gray-50 outline-none focus:ring-green-500 focus:border-green-500`, | ||
type, | ||
placeholder, | ||
value, | ||
onChange, | ||
disabled, | ||
...rest | ||
} | ||
); | ||
}; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
Button, | ||
ETableColumnOrder, | ||
NumberInput, | ||
Table, | ||
TextInput, | ||
getNestedValues, | ||
@@ -1178,0 +1272,0 @@ sortData, |
{ | ||
"name": "avine-react-components", | ||
"version": "0.1.23", | ||
"version": "0.1.24", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "", |
export * from './components/table/table'; | ||
export * from './components/button/button'; | ||
export * from './components/number-input/number-input'; | ||
export * from './components/text-input/text-input'; | ||
@@ -3,0 +6,0 @@ export * from './components/table/utils'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5174899
80
10622