componenteshospitais 3.9.9 → 4.0.1
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/dist/cjs/index.js
CHANGED
|
@@ -16761,14 +16761,14 @@ var TableStandardButtons = function (_a) {
|
|
|
16761
16761
|
// Atualiza o estado com o estado inicial
|
|
16762
16762
|
setInputStates(function (prevState) { return (__assign(__assign({}, prevState), initialStateInput)); });
|
|
16763
16763
|
}, [dados]);
|
|
16764
|
-
var handleCheckboxChange = function (
|
|
16765
|
-
var newId = "".concat(
|
|
16764
|
+
var handleCheckboxChange = function (index, rowId, position) {
|
|
16765
|
+
var newId = "".concat(index, "_").concat(rowId, "_").concat(position);
|
|
16766
16766
|
setCheckboxStates(function (prevState) {
|
|
16767
16767
|
var _a;
|
|
16768
16768
|
var newState = __assign(__assign({}, prevState), (_a = {}, _a[newId] = !prevState[newId], _a));
|
|
16769
16769
|
// Chama a função passada por parâmetro (se existir)
|
|
16770
16770
|
if (onCheckboxChange) {
|
|
16771
|
-
onCheckboxChange(
|
|
16771
|
+
onCheckboxChange(rowId, newState[newId], position);
|
|
16772
16772
|
}
|
|
16773
16773
|
return newState; // Retorna o novo estado
|
|
16774
16774
|
});
|
package/dist/esm/index.js
CHANGED
|
@@ -16759,14 +16759,14 @@ var TableStandardButtons = function (_a) {
|
|
|
16759
16759
|
// Atualiza o estado com o estado inicial
|
|
16760
16760
|
setInputStates(function (prevState) { return (__assign(__assign({}, prevState), initialStateInput)); });
|
|
16761
16761
|
}, [dados]);
|
|
16762
|
-
var handleCheckboxChange = function (
|
|
16763
|
-
var newId = "".concat(
|
|
16762
|
+
var handleCheckboxChange = function (index, rowId, position) {
|
|
16763
|
+
var newId = "".concat(index, "_").concat(rowId, "_").concat(position);
|
|
16764
16764
|
setCheckboxStates(function (prevState) {
|
|
16765
16765
|
var _a;
|
|
16766
16766
|
var newState = __assign(__assign({}, prevState), (_a = {}, _a[newId] = !prevState[newId], _a));
|
|
16767
16767
|
// Chama a função passada por parâmetro (se existir)
|
|
16768
16768
|
if (onCheckboxChange) {
|
|
16769
|
-
onCheckboxChange(
|
|
16769
|
+
onCheckboxChange(rowId, newState[newId], position);
|
|
16770
16770
|
}
|
|
16771
16771
|
return newState; // Retorna o novo estado
|
|
16772
16772
|
});
|
|
@@ -37,7 +37,7 @@ export interface TableStandardButtonsProps {
|
|
|
37
37
|
cellsPadding?: string;
|
|
38
38
|
cellSpacing?: string;
|
|
39
39
|
linhasZebradas?: boolean;
|
|
40
|
-
onCheckboxChange?: (rowId: string, checked: boolean) => void;
|
|
40
|
+
onCheckboxChange?: (rowId: string, checked: boolean, position: String) => void;
|
|
41
41
|
onInputChange?: (rowId: string, value: string) => void;
|
|
42
42
|
onInputKeyDown?: (rowId: string) => void;
|
|
43
43
|
minWidth?: string;
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ export interface TableStandardButtonsProps {
|
|
|
46
46
|
cellsPadding?: string;
|
|
47
47
|
cellSpacing?: string;
|
|
48
48
|
linhasZebradas?: boolean;
|
|
49
|
-
onCheckboxChange?: (rowId: string, checked: boolean) => void;
|
|
49
|
+
onCheckboxChange?: (rowId: string, checked: boolean, position: String) => void;
|
|
50
50
|
onInputChange?: (rowId: string, value: string) => void;
|
|
51
51
|
onInputKeyDown?: (rowId: string) => void;
|
|
52
52
|
minWidth?: string;
|
|
@@ -166,8 +166,8 @@ const TableStandardButtons: React.FC<TableStandardButtonsProps> = ({
|
|
|
166
166
|
}));
|
|
167
167
|
}, [dados]);
|
|
168
168
|
|
|
169
|
-
const handleCheckboxChange = (
|
|
170
|
-
let newId = `${
|
|
169
|
+
const handleCheckboxChange = (index: string, rowId: string, position: String) => {
|
|
170
|
+
let newId = `${index}_${rowId}_${position}`;
|
|
171
171
|
setCheckboxStates((prevState) => {
|
|
172
172
|
const newState = {
|
|
173
173
|
...prevState,
|
|
@@ -176,7 +176,7 @@ const TableStandardButtons: React.FC<TableStandardButtonsProps> = ({
|
|
|
176
176
|
|
|
177
177
|
// Chama a função passada por parâmetro (se existir)
|
|
178
178
|
if (onCheckboxChange) {
|
|
179
|
-
onCheckboxChange(
|
|
179
|
+
onCheckboxChange(rowId, newState[newId], position);
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
return newState; // Retorna o novo estado
|