Skip to content

Commit

Permalink
Merge pull request #1965 from apuliasoft/inputpanel
Browse files Browse the repository at this point in the history
bugifx(kup-input-panel): update custom button click handler event
  • Loading branch information
lucafoscili authored Jun 27, 2024
2 parents 10f652e + 96ce11b commit 55a22c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ export type InputPanelOptionsHandler = (
currentState: KupInputPanelData
) => Promise<GenericObject>;

export type InputPanelButtonClickHandler = (
fun: string,
cellId: string,
currentState: KupInputPanelData
) => void;
export type InputPanelButtonClickHandler = (event: {
fun: string;
cellId: string;
currentState: KupInputPanelData;
}) => void;

export enum KupInputPanelProps {
customStyle = 'Custom style of the component.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ export class KupInputPanel {
wrapperClass="form__submit"
onClick={() => {
cell.data.fun
? this.customButtonClickHandler(
cell.data.fun,
? this.customButtonClickHandler({
fun: cell.data.fun,
cellId,
this.#reverseMapCells()
)
currentState: this.#reverseMapCells(),
})
: this.submitCb({
value: {
before: { ...this.#originalData },
Expand Down
2 changes: 1 addition & 1 deletion packages/ketchup/src/components/kup-input-panel/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| Property | Attribute | Description | Type | Default |
| -------------------------- | ---------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------- |
| `customButtonClickHandler` | -- | Sets the handler to use when click on custom buttons | `(fun: string, cellId: string, currentState: KupInputPanelData) => void` | `null` |
| `customButtonClickHandler` | -- | Sets the handler to use when click on custom buttons | `(event: { fun: string; cellId: string; currentState: KupInputPanelData; }) => void` | `null` |
| `customStyle` | `custom-style` | Custom style of the component. | `string` | `''` |
| `data` | -- | Actual data of the form. | `KupInputPanelData` | `null` |
| `hiddenSubmitButton` | `hidden-submit-button` | Creates a hidden submit button in order to submit the form with enter. | `boolean` | `false` |
Expand Down

0 comments on commit 55a22c8

Please sign in to comment.