@pihanga2/shadcn 0.2.18 → 0.2.19
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/README.md +4 -1
- package/cards/button/button.types.d.ts +2 -2
- package/cards/checkbox/checkbox.types.d.ts +2 -2
- package/cards/codeMirror/codeMirror.types.d.ts +1 -1
- package/cards/collapsibleCard/collapsibleCard.types.d.ts +1 -1
- package/cards/dataTable/dataTable.types.d.ts +5 -5
- package/cards/dialog/dialog.types.d.ts +3 -3
- package/cards/drawer/drawer.types.d.ts +3 -3
- package/cards/dropDownMenu/drop-down.types.d.ts +1 -1
- package/cards/emptyCard/emptyCard.component.js +25 -0
- package/cards/emptyCard/emptyCard.component.js.map +1 -0
- package/cards/emptyCard/emptyCard.types.js +7 -0
- package/cards/emptyCard/emptyCard.types.js.map +1 -0
- package/cards/emptyCard/index.js +12 -0
- package/cards/emptyCard/index.js.map +1 -0
- package/cards/fileDrop/fileDrop.types.d.ts +2 -2
- package/cards/form/form.types.d.ts +2 -2
- package/cards/graphin/graphin.types.d.ts +9 -9
- package/cards/input/input.component.js +28 -23
- package/cards/input/input.component.js.map +1 -1
- package/cards/input/input.types.d.ts +10 -4
- package/cards/input/input.types.js.map +1 -1
- package/cards/jsonViewer/jsonViewer.types.d.ts +2 -2
- package/cards/keyboardOverlay/keyboardOverlay.component.js +1 -0
- package/cards/keyboardOverlay/keyboardOverlay.component.js.map +1 -1
- package/cards/keyboardOverlay/keyboardOverlay.types.d.ts +1 -1
- package/cards/list/list.types.d.ts +1 -1
- package/cards/menu/menu.types.d.ts +1 -1
- package/cards/modeToggle/mode-toggle.types.d.ts +1 -1
- package/cards/navbarSearch/navbarSearch.type.d.ts +3 -3
- package/cards/observable/index.d.ts +1 -0
- package/cards/observable/index.js +13 -0
- package/cards/observable/index.js.map +1 -0
- package/cards/observable/observable.component.d.ts +4 -0
- package/cards/observable/observable.component.js +74 -0
- package/cards/observable/observable.component.js.map +1 -0
- package/cards/observable/observable.types.d.ts +253 -0
- package/cards/observable/observable.types.js +21 -0
- package/cards/observable/observable.types.js.map +1 -0
- package/cards/pageWithNavbar/pageWithNavbar.type.d.ts +1 -1
- package/cards/pageWithNavbarMeta/pageWithNavbarMeta.types.d.ts +1 -1
- package/cards/pasteTarget/pasteTarget.types.d.ts +2 -2
- package/cards/scrollbarWithAnnotations/scrollbarWithAnnotations.types.d.ts +2 -2
- package/cards/select/select.types.d.ts +6 -6
- package/cards/sheetCard/sheetCard.types.d.ts +3 -3
- package/cards/slider/slider.types.d.ts +4 -4
- package/cards/stack/stack.component.js +51 -38
- package/cards/stack/stack.component.js.map +1 -1
- package/cards/stepper/stepper.types.d.ts +1 -1
- package/cards/switch/switch.types.d.ts +2 -2
- package/cards/tabs/tabs.types.d.ts +1 -1
- package/cards/textArea/index.d.ts +1 -0
- package/cards/textArea/index.js +13 -0
- package/cards/textArea/index.js.map +1 -0
- package/cards/textArea/textArea.component.d.ts +4 -0
- package/cards/textArea/textArea.component.js +83 -0
- package/cards/textArea/textArea.component.js.map +1 -0
- package/cards/textArea/textArea.types.d.ts +147 -0
- package/cards/textArea/textArea.types.js +7 -0
- package/cards/textArea/textArea.types.js.map +1 -0
- package/cards/textField/textField.types.d.ts +2 -2
- package/cards/toast/toast.types.d.ts +3 -3
- package/cards/toggleGroup/toggleGroup.types.d.ts +2 -2
- package/components/ui/empty.js +40 -0
- package/components/ui/empty.js.map +1 -0
- package/components/ui/input.js +11 -11
- package/components/ui/input.js.map +1 -1
- package/components/ui/textarea.js +15 -0
- package/components/ui/textarea.js.map +1 -0
- package/package.json +18 -2
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ import "@pihanga2/shadcn/cards/dataTable";
|
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
-
## Included cards (
|
|
65
|
+
## Included cards (50)
|
|
66
66
|
|
|
67
67
|
- `avatar`
|
|
68
68
|
- `badge`
|
|
@@ -75,6 +75,7 @@ import "@pihanga2/shadcn/cards/dataTable";
|
|
|
75
75
|
- `dialog`
|
|
76
76
|
- `drawer`
|
|
77
77
|
- `dropDownMenu`
|
|
78
|
+
- `emptyCard`
|
|
78
79
|
- `field`
|
|
79
80
|
- `fileDrop`
|
|
80
81
|
- `flexGrid`
|
|
@@ -91,6 +92,7 @@ import "@pihanga2/shadcn/cards/dataTable";
|
|
|
91
92
|
- `menu`
|
|
92
93
|
- `modeToggle`
|
|
93
94
|
- `navbarSearch`
|
|
95
|
+
- `observable`
|
|
94
96
|
- `pageWithNavbar`
|
|
95
97
|
- `pageWithNavbarMeta`
|
|
96
98
|
- `pasteTarget`
|
|
@@ -107,6 +109,7 @@ import "@pihanga2/shadcn/cards/dataTable";
|
|
|
107
109
|
- `suspense`
|
|
108
110
|
- `switch`
|
|
109
111
|
- `tabs`
|
|
112
|
+
- `textArea`
|
|
110
113
|
- `textField`
|
|
111
114
|
- `toast`
|
|
112
115
|
- `toggleGroup`
|
|
@@ -4,11 +4,11 @@ export declare const Button: <S extends import('@pihanga2/core').ReduxState>(p:
|
|
|
4
4
|
export declare const PI_BUTTON_ACTION: {
|
|
5
5
|
CLICKED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & PiButtonClickedEvent>) => void;
|
|
10
10
|
/** @deprecated Use `onButtonClicked` instead. */
|
|
11
|
-
export declare const onPiButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
11
|
+
export declare const onPiButtonClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
12
12
|
cardID: string;
|
|
13
13
|
} & PiButtonClickedEvent>) => void;
|
|
14
14
|
/**
|
|
@@ -3,11 +3,11 @@ export declare const Checkbox: <S extends import('@pihanga2/core').ReduxState>(p
|
|
|
3
3
|
export declare const PI_CHECKBOX_ACTION: {
|
|
4
4
|
CHANGED: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const onCheckboxChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
6
|
+
export declare const onCheckboxChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
7
7
|
cardID: string;
|
|
8
8
|
} & PiCheckboxChangedEvent>) => void;
|
|
9
9
|
/** @deprecated Use `onCheckboxChanged` instead. */
|
|
10
|
-
export declare const onPiCheckboxChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
10
|
+
export declare const onPiCheckboxChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
11
11
|
cardID: string;
|
|
12
12
|
} & PiCheckboxChangedEvent>) => void;
|
|
13
13
|
export type PiCheckboxProps = {
|
|
@@ -5,7 +5,7 @@ export declare const CodeMirrorCard: <S extends import('@pihanga2/core').ReduxSt
|
|
|
5
5
|
export declare const CODE_MIRROR_ACTION: {
|
|
6
6
|
CHANGED: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const onCodeMirrorChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
8
|
+
export declare const onCodeMirrorChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
9
9
|
cardID: string;
|
|
10
10
|
} & ChangedEvent>) => void;
|
|
11
11
|
/**
|
|
@@ -7,7 +7,7 @@ export declare const COLLAPSIBLE_CARD_ACTION: {
|
|
|
7
7
|
export type CollapsibleCardOpenChangedEvent = {
|
|
8
8
|
open: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare const onCollapsibleCardOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
10
|
+
export declare const onCollapsibleCardOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
11
11
|
cardID: string;
|
|
12
12
|
} & CollapsibleCardOpenChangedEvent>) => void;
|
|
13
13
|
export type CollapsibleCardEvents = {
|
|
@@ -9,19 +9,19 @@ export declare const DATA_TABLE_ACTION: {
|
|
|
9
9
|
HIDE_DETAIL: string;
|
|
10
10
|
PAGE_CHANGED: string;
|
|
11
11
|
};
|
|
12
|
-
export declare const onDataTableRowClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
12
|
+
export declare const onDataTableRowClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
13
13
|
cardID: string;
|
|
14
14
|
} & DataTableRowClickedEvent>) => void;
|
|
15
|
-
export declare const onDataTableSortChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
15
|
+
export declare const onDataTableSortChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
16
16
|
cardID: string;
|
|
17
17
|
} & DataTableSortChangedEvent>) => void;
|
|
18
|
-
export declare const onDataTableShowDetail: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
18
|
+
export declare const onDataTableShowDetail: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
19
19
|
cardID: string;
|
|
20
20
|
} & DataTableDetailEvent>) => void;
|
|
21
|
-
export declare const onDataTableHideDetail: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
21
|
+
export declare const onDataTableHideDetail: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
22
22
|
cardID: string;
|
|
23
23
|
} & DataTableDetailEvent>) => void;
|
|
24
|
-
export declare const onDataTablePageChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
24
|
+
export declare const onDataTablePageChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
25
25
|
cardID: string;
|
|
26
26
|
} & DataTablePageChangedEvent>) => void;
|
|
27
27
|
/** Shared base for all column definitions */
|
|
@@ -6,13 +6,13 @@ export declare const PI_DIALOG_ACTION: {
|
|
|
6
6
|
OPENED: string;
|
|
7
7
|
OPEN_CHANGED: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const onDialogOpened: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
9
|
+
export declare const onDialogOpened: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
10
10
|
cardID: string;
|
|
11
11
|
} & DialogOpenedEvent>) => void;
|
|
12
|
-
export declare const onDialogClosed: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
12
|
+
export declare const onDialogClosed: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
13
13
|
cardID: string;
|
|
14
14
|
} & DialogClosedEvent>) => void;
|
|
15
|
-
export declare const onDialogOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
15
|
+
export declare const onDialogOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
16
16
|
cardID: string;
|
|
17
17
|
} & DialogOpenChangedEvent>) => void;
|
|
18
18
|
export type PiDialogProps = {
|
|
@@ -6,13 +6,13 @@ export declare const PI_DRAWER_ACTION: {
|
|
|
6
6
|
OPENED: string;
|
|
7
7
|
OPEN_CHANGED: string;
|
|
8
8
|
};
|
|
9
|
-
export declare const onDrawerOpened: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
9
|
+
export declare const onDrawerOpened: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
10
10
|
cardID: string;
|
|
11
11
|
} & DrawerOpenedEvent>) => void;
|
|
12
|
-
export declare const onDrawerClosed: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
12
|
+
export declare const onDrawerClosed: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
13
13
|
cardID: string;
|
|
14
14
|
} & DrawerClosedEvent>) => void;
|
|
15
|
-
export declare const onDrawerOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
15
|
+
export declare const onDrawerOpenChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
16
16
|
cardID: string;
|
|
17
17
|
} & DrawerOpenChangedEvent>) => void;
|
|
18
18
|
export type PiDrawerProps = {
|
|
@@ -4,7 +4,7 @@ export declare const DropDownMenu: <S extends import('@pihanga2/core').ReduxStat
|
|
|
4
4
|
export declare const DROP_DOWN_MENU_ACTION: {
|
|
5
5
|
SELECTED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onDropDownMenuClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onDropDownMenuClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & DropDownMenuSelectedEventAdvanced>) => void;
|
|
10
10
|
export type DropDownMenuProps = {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getIcon as e } from "../icons.js";
|
|
2
|
+
import { Empty as t, EmptyContent as n, EmptyMedia as r } from "../../components/ui/empty.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Card as i } from "@pihanga2/core";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/cards/emptyCard/emptyCard.component.tsx
|
|
7
|
+
var s = (s) => {
|
|
8
|
+
let { icon: c, content: l, className: u, style: d, cardName: f } = s;
|
|
9
|
+
return /* @__PURE__ */ o(t, {
|
|
10
|
+
className: u,
|
|
11
|
+
style: d,
|
|
12
|
+
"data-pihanga": f,
|
|
13
|
+
children: [c && /* @__PURE__ */ a(r, {
|
|
14
|
+
variant: "icon",
|
|
15
|
+
children: e(c)
|
|
16
|
+
}), l && /* @__PURE__ */ a(n, { children: /* @__PURE__ */ a(i, {
|
|
17
|
+
cardName: l,
|
|
18
|
+
parentCard: f
|
|
19
|
+
}) })]
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
23
|
+
export { s as EmptyCardComponent };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=emptyCard.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyCard.component.js","names":[],"sources":["../../../src/cards/emptyCard/emptyCard.component.tsx"],"sourcesContent":["import * as React from \"react\";\n\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport {Empty, EmptyContent, EmptyMedia} from \"@/components/ui/empty\";\nimport {getIcon} from \"@/cards/icons\";\nimport type {EmptyCardProps} from \"./emptyCard.types\";\n\nexport const EmptyCardComponent = (\n props: PiCardProps<EmptyCardProps>,\n): React.ReactNode => {\n const {icon, content, className, style, cardName} = props;\n\n return (\n <Empty className={className} style={style} data-pihanga={cardName}>\n {icon && <EmptyMedia variant=\"icon\">{getIcon(icon)}</EmptyMedia>}\n {content && (\n <EmptyContent>\n <Card cardName={content} parentCard={cardName} />\n </EmptyContent>\n )}\n </Empty>\n );\n};\n"],"mappings":";;;;;;AAOA,IAAa,KACX,MACoB;CACpB,IAAM,EAAC,SAAM,YAAS,cAAW,UAAO,gBAAY;CAEpD,OACE,kBAAC,GAAD;EAAkB;EAAkB;EAAO,gBAAc;YAAzD,CACG,KAAQ,kBAAC,GAAD;GAAY,SAAQ;aAAQ,EAAQ,CAAI;EAAc,CAAA,GAC9D,KACC,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;GAAM,UAAU;GAAS,YAAY;EAAW,CAAA,EACpC,CAAA,CAEX;;AAEX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyCard.types.js","names":[],"sources":["../../../src/cards/emptyCard/emptyCard.types.ts"],"sourcesContent":["import {createCardDeclaration, type PiCardRef} from \"@pihanga2/core\";\nimport type React from \"react\";\n\nexport const EMPTY_CARD = \"empty-card\";\n\nexport type EmptyCardProps = {\n /**\n * Icon name from the pihanga icon registry.\n * When provided, renders an `EmptyMedia` slot with `variant=\"icon\"`.\n */\n icon?: string;\n\n /**\n * Pihanga card reference rendered inside `EmptyContent`.\n * Use this to show a call-to-action button, form, or any other card.\n */\n content?: PiCardRef;\n\n /** Additional Tailwind / CSS classes forwarded to the root `Empty` element. */\n className?: string;\n\n /** Inline styles forwarded to the root `Empty` element. */\n style?: React.CSSProperties;\n};\n\n/**\n * Factory function for declaring an `empty-card` instance.\n *\n * ```ts\n * import {registerCard} from \"@pihanga2/core\";\n * import {EmptyCard} from \"@/cards/emptyCard\";\n * import {Button} from \"@/cards/button\";\n *\n * registerCard(\"myApp/noResults\", EmptyCard({\n * icon: \"search\",\n * content: \"myApp/createButton\",\n * }));\n *\n * registerCard(\"myApp/createButton\", Button({label: \"Create new\"}));\n * ```\n */\nexport const EmptyCard = createCardDeclaration<EmptyCardProps>(EMPTY_CARD);\n"],"mappings":";;AAGA,IAAa,IAAa,cAsCb,IAAY,EAAsC,CAAU"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EmptyCardComponent as e } from "./emptyCard.component.js";
|
|
2
|
+
import { EMPTY_CARD as t, EmptyCard as n } from "./emptyCard.types.js";
|
|
3
|
+
import { registerCardComponent as r } from "@pihanga2/core";
|
|
4
|
+
//#region src/cards/emptyCard/index.tsx
|
|
5
|
+
r({
|
|
6
|
+
name: t,
|
|
7
|
+
component: e
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as EMPTY_CARD, n as EmptyCard };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/emptyCard/index.tsx"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {EmptyCardComponent} from \"./emptyCard.component\";\nimport {EMPTY_CARD} from \"./emptyCard.types\";\n\nexport * from \"./emptyCard.types\";\n\nregisterCardComponent({\n name: EMPTY_CARD,\n component: EmptyCardComponent,\n});\n"],"mappings":";;;;AAOA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
|
|
@@ -4,10 +4,10 @@ export declare const FILE_DROP_ACTION: {
|
|
|
4
4
|
ERROR: string;
|
|
5
5
|
FILE_DROPPED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onFileDropped: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onFileDropped: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & FileDroppedEvent>) => void;
|
|
10
|
-
export declare const onFileDropError: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
10
|
+
export declare const onFileDropError: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
11
11
|
cardID: string;
|
|
12
12
|
} & FileDropErrorEvent>) => void;
|
|
13
13
|
/** Per-element Tailwind / CSS class overrides for the FileDrop card. */
|
|
@@ -4,11 +4,11 @@ export declare const Form: <S extends import('@pihanga2/core').ReduxState>(p: im
|
|
|
4
4
|
export declare const PI_FORM_ACTION: {
|
|
5
5
|
SUBMITTED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onFormSubmitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onFormSubmitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & PiFormSubmittedEvent>) => void;
|
|
10
10
|
/** @deprecated Use `onFormSubmitted` instead. */
|
|
11
|
-
export declare const onPiFormSubmitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
11
|
+
export declare const onPiFormSubmitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
12
12
|
cardID: string;
|
|
13
13
|
} & PiFormSubmittedEvent>) => void;
|
|
14
14
|
export type PiFormProps = {
|
|
@@ -14,31 +14,31 @@ export declare const GRAPHIN_ACTION: {
|
|
|
14
14
|
CONTEXT_MENU_CLOSE: string;
|
|
15
15
|
AFTER_LAYOUT: string;
|
|
16
16
|
};
|
|
17
|
-
export declare const onGraphinNodeHovered: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
17
|
+
export declare const onGraphinNodeHovered: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
18
18
|
cardID: string;
|
|
19
19
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
20
|
-
export declare const onGraphinNodeHoverEnd: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
20
|
+
export declare const onGraphinNodeHoverEnd: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
21
21
|
cardID: string;
|
|
22
22
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
23
|
-
export declare const onGraphinNodeClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
23
|
+
export declare const onGraphinNodeClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
24
24
|
cardID: string;
|
|
25
25
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
26
|
-
export declare const onGraphinNodeDblClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
26
|
+
export declare const onGraphinNodeDblClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
27
27
|
cardID: string;
|
|
28
28
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
29
|
-
export declare const onGraphinTooltipOpen: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
29
|
+
export declare const onGraphinTooltipOpen: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
30
30
|
cardID: string;
|
|
31
31
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
32
|
-
export declare const onGraphinTooltipClose: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
32
|
+
export declare const onGraphinTooltipClose: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
33
33
|
cardID: string;
|
|
34
34
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
35
|
-
export declare const onGraphinContextMenuOpen: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
35
|
+
export declare const onGraphinContextMenuOpen: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
36
36
|
cardID: string;
|
|
37
37
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
38
|
-
export declare const onGraphinContextMenuClose: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
38
|
+
export declare const onGraphinContextMenuClose: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
39
39
|
cardID: string;
|
|
40
40
|
} & GraphinNodeEventContext<Record<string, unknown>>>) => void;
|
|
41
|
-
export declare const onGraphinAfterLayout: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
41
|
+
export declare const onGraphinAfterLayout: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, ReduxAction & {
|
|
42
42
|
cardID: string;
|
|
43
43
|
} & Record<string, unknown> & {
|
|
44
44
|
cardID: string;
|
|
@@ -6,58 +6,63 @@ import "@pihanga2/core";
|
|
|
6
6
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
7
7
|
//#region src/cards/input/input.component.tsx
|
|
8
8
|
var o = (o) => {
|
|
9
|
-
let { name: s, value: c = "", type: l = "text", placeholder: u, disabled: d, label: f, description: p, className: m,
|
|
9
|
+
let { name: s, value: c = "", type: l = "text", placeholder: u, disabled: d, label: f, description: p, className: m, autoFocus: h, cardName: g, onChanged: _, onCommitted: v } = o, y = r.useRef(null);
|
|
10
10
|
r.useEffect(() => {
|
|
11
|
-
|
|
11
|
+
h && y.current?.focus();
|
|
12
|
+
}, []);
|
|
13
|
+
let b = o.id, x = !!o.invalid, S = e(), C = S.isInForm && !!s, [w, T] = r.useState(l === "file" ? "" : c);
|
|
14
|
+
r.useEffect(() => {
|
|
15
|
+
!C && l !== "file" && T(c);
|
|
12
16
|
}, [
|
|
13
17
|
c,
|
|
14
|
-
|
|
18
|
+
C,
|
|
15
19
|
l
|
|
16
20
|
]);
|
|
17
|
-
let
|
|
18
|
-
function
|
|
21
|
+
let E = l === "file" ? void 0 : C ? S.formData[s] ?? "" : w;
|
|
22
|
+
function D(e) {
|
|
19
23
|
let t = l === "file" ? e.target.files?.[0]?.name ?? "" : e.target.value;
|
|
20
|
-
|
|
24
|
+
C ? S.handleChange(s, t) : (T(t), _({
|
|
21
25
|
name: s,
|
|
22
26
|
value: t
|
|
23
27
|
}));
|
|
24
28
|
}
|
|
25
|
-
function
|
|
26
|
-
!
|
|
29
|
+
function O() {
|
|
30
|
+
!C && l !== "file" && v({
|
|
27
31
|
name: s,
|
|
28
|
-
value:
|
|
32
|
+
value: w
|
|
29
33
|
});
|
|
30
34
|
}
|
|
31
|
-
function
|
|
32
|
-
e.key === "Enter" && !
|
|
35
|
+
function k(e) {
|
|
36
|
+
e.key === "Enter" && !C && l !== "file" && v({
|
|
33
37
|
name: s,
|
|
34
|
-
value:
|
|
38
|
+
value: w
|
|
35
39
|
});
|
|
36
40
|
}
|
|
37
|
-
let
|
|
41
|
+
let A = `${g}-${s ?? "input"}`, j = b ?? A;
|
|
38
42
|
return /* @__PURE__ */ a("div", {
|
|
39
|
-
"data-pihanga":
|
|
43
|
+
"data-pihanga": g,
|
|
40
44
|
className: "grid w-full gap-1.5",
|
|
41
45
|
children: [
|
|
42
46
|
f && /* @__PURE__ */ i(t, {
|
|
43
|
-
htmlFor:
|
|
47
|
+
htmlFor: j,
|
|
44
48
|
children: f
|
|
45
49
|
}),
|
|
46
50
|
/* @__PURE__ */ i(n, {
|
|
47
|
-
|
|
51
|
+
ref: y,
|
|
52
|
+
id: j,
|
|
48
53
|
type: l,
|
|
49
|
-
value:
|
|
50
|
-
onChange:
|
|
51
|
-
onBlur:
|
|
52
|
-
onKeyDown:
|
|
54
|
+
value: E,
|
|
55
|
+
onChange: D,
|
|
56
|
+
onBlur: O,
|
|
57
|
+
onKeyDown: k,
|
|
53
58
|
placeholder: u,
|
|
54
59
|
disabled: d,
|
|
55
60
|
className: m,
|
|
56
|
-
"aria-invalid":
|
|
57
|
-
"aria-describedby": p ? `${
|
|
61
|
+
"aria-invalid": x || void 0,
|
|
62
|
+
"aria-describedby": p ? `${j}-desc` : void 0
|
|
58
63
|
}),
|
|
59
64
|
p && /* @__PURE__ */ i("p", {
|
|
60
|
-
id: `${
|
|
65
|
+
id: `${j}-desc`,
|
|
61
66
|
className: "text-sm text-muted-foreground",
|
|
62
67
|
children: p
|
|
63
68
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.component.js","names":[],"sources":["../../../src/cards/input/input.component.tsx"],"sourcesContent":["import React from \"react\";\nimport {type PiCardProps} from \"@pihanga2/core\";\nimport {Input} from \"@/components/ui/input\";\nimport {Label} from \"@/components/ui/label\";\nimport {useFormContext} from \"@/cards/form/form.context\";\nimport type {PiInputEvents, PiInputProps} from \"./input.types\";\n\nexport const InputComponent = (\n props: PiCardProps<PiInputProps, PiInputEvents>,\n): React.ReactNode => {\n const {\n name,\n value: propValue = \"\",\n type = \"text\",\n placeholder,\n disabled,\n label,\n description,\n className,\n cardName,\n onChanged,\n onCommitted,\n } = props;\n\n // `id` and `invalid` may be injected by a parent pi/field card via\n // Pihanga's extra-prop forwarding. They are not in the official type so\n // we read them through an escape hatch.\n const injectedId = (props as {id?: string}).id;\n const invalid = Boolean((props as {invalid?: boolean}).invalid);\n\n // Detect if we are inside a pi/form card via React context.\n const form = useFormContext();\n const useFormData = form.isInForm && Boolean(name);\n\n // Local display state — lets the user type freely without triggering Redux\n // on every keystroke. Only `onCommitted` (blur / Enter) writes back to\n // Redux, so callers that use `onCommitted` instead of `onChanged` avoid\n // per-keystroke panel rebuilds.\n const [localValue, setLocalValue] = React.useState<string>(\n type === \"file\" ? \"\" : propValue,\n );\n\n // Sync local value when the prop changes from outside (e.g. when a different\n // card is selected in the playground, resetting the controls panel).\n React.useEffect(() => {\n if (!useFormData && type !== \"file\") {\n setLocalValue(propValue);\n }\n }, [propValue, useFormData, type]);\n\n // Derive the effective value for the controlled <Input>:\n // - inside a form → read from form.formData[name]\n // - standalone → use localValue (updated on every keystroke locally)\n // - file inputs → uncontrolled (no value binding)\n const inputValue =\n type === \"file\"\n ? undefined\n : useFormData\n ? ((form.formData[name!] as string | undefined) ?? \"\")\n : localValue;\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const newValue =\n type === \"file\" ? (e.target.files?.[0]?.name ?? \"\") : e.target.value;\n if (useFormData) {\n form.handleChange(name!, newValue);\n } else {\n setLocalValue(newValue);\n onChanged({name, value: newValue});\n }\n }\n\n // Fire onCommitted when the user leaves the field or presses Enter.\n function handleBlur() {\n if (!useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === \"Enter\" && !useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n // Use the id injected by pi/field (for label↔control linking); fall back\n // to a locally-generated id when used standalone.\n const selfId = `${cardName}-${name ?? \"input\"}`;\n const fieldId = injectedId ?? selfId;\n\n return (\n <div data-pihanga={cardName} className=\"grid w-full gap-1.5\">\n {label && <Label htmlFor={fieldId}>{label}</Label>}\n <Input\n id={fieldId}\n type={type}\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n className={className}\n aria-invalid={invalid || undefined}\n aria-describedby={description ? `${fieldId}-desc` : undefined}\n />\n {description && (\n <p id={`${fieldId}-desc`} className=\"text-sm text-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,SACA,OAAO,IAAY,IACnB,UAAO,QACP,gBACA,aACA,UACA,gBACA,cACA,aACA,cACA,mBACE,GAKE,IAAc,EAAwB,IACtC,IAAU,EAAS,EAA8B,SAGjD,IAAO,EAAe,GACtB,IAAc,EAAK,YAAY,EAAQ,GAMvC,CAAC,GAAY,KAAiB,EAAM,SACxC,MAAS,SAAS,KAAK,CACzB;CAIA,EAAM,gBAAgB;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAc,CAAS;CAE3B,GAAG;EAAC;EAAW;EAAa;CAAI,CAAC;CAMjC,IAAM,IACJ,MAAS,SACL,KAAA,IACA,IACI,EAAK,SAAS,MAAiC,KACjD;CAER,SAAS,EAAa,GAAwC;EAC5D,IAAM,IACJ,MAAS,SAAU,EAAE,OAAO,QAAQ,IAAI,QAAQ,KAAM,EAAE,OAAO;EACjE,AAAI,IACF,EAAK,aAAa,GAAO,CAAQ,KAEjC,EAAc,CAAQ,GACtB,EAAU;GAAC;GAAM,OAAO;EAAQ,CAAC;CAErC;CAGA,SAAS,IAAa;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAEA,SAAS,EAAc,GAA0C;EAC/D,AAAI,EAAE,QAAQ,WAAW,CAAC,KAAe,MAAS,UAChD,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAIA,IAAM,IAAS,GAAG,EAAS,GAAG,KAAQ,WAChC,IAAU,KAAc;CAE9B,OACE,kBAAC,OAAD;EAAK,gBAAc;EAAU,WAAU;YAAvC;GACG,KAAS,kBAAC,GAAD;IAAO,SAAS;cAAU;GAAa,CAAA;GACjD,kBAAC,GAAD;IACE,IAAI;IACE;IACN,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACE;IACH;IACC;IACX,gBAAc,KAAW,KAAA;IACzB,oBAAkB,IAAc,GAAG,EAAQ,SAAS,KAAA;GACrD,CAAA;GACA,KACC,kBAAC,KAAD;IAAG,IAAI,GAAG,EAAQ;IAAQ,WAAU;cACjC;GACA,CAAA;EAEF;;AAET"}
|
|
1
|
+
{"version":3,"file":"input.component.js","names":[],"sources":["../../../src/cards/input/input.component.tsx"],"sourcesContent":["import React from \"react\";\nimport {type PiCardProps} from \"@pihanga2/core\";\nimport {Input} from \"@/components/ui/input\";\nimport {Label} from \"@/components/ui/label\";\nimport {useFormContext} from \"@/cards/form/form.context\";\nimport type {PiInputEvents, PiInputProps} from \"./input.types\";\n\nexport const InputComponent = (\n props: PiCardProps<PiInputProps, PiInputEvents>,\n): React.ReactNode => {\n const {\n name,\n value: propValue = \"\",\n type = \"text\",\n placeholder,\n disabled,\n label,\n description,\n className,\n autoFocus,\n cardName,\n onChanged,\n onCommitted,\n } = props;\n\n // Focus the input once, the first time it is mounted/shown (e.g. when a\n // dialog or drawer opens). Intentionally an empty dependency array — this\n // must not re-fire on subsequent re-renders.\n const inputRef = React.useRef<HTMLInputElement>(null);\n React.useEffect(() => {\n if (autoFocus) inputRef.current?.focus();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // `id` and `invalid` may be injected by a parent pi/field card via\n // Pihanga's extra-prop forwarding. They are not in the official type so\n // we read them through an escape hatch.\n const injectedId = (props as {id?: string}).id;\n const invalid = Boolean((props as {invalid?: boolean}).invalid);\n\n // Detect if we are inside a pi/form card via React context.\n const form = useFormContext();\n const useFormData = form.isInForm && Boolean(name);\n\n // Local display state — lets the user type freely without triggering Redux\n // on every keystroke. Only `onCommitted` (blur / Enter) writes back to\n // Redux, so callers that use `onCommitted` instead of `onChanged` avoid\n // per-keystroke panel rebuilds.\n const [localValue, setLocalValue] = React.useState<string>(\n type === \"file\" ? \"\" : propValue,\n );\n\n // Sync local value when the prop changes from outside (e.g. when a different\n // card is selected in the playground, resetting the controls panel).\n React.useEffect(() => {\n if (!useFormData && type !== \"file\") {\n setLocalValue(propValue);\n }\n }, [propValue, useFormData, type]);\n\n // Derive the effective value for the controlled <Input>:\n // - inside a form → read from form.formData[name]\n // - standalone → use localValue (updated on every keystroke locally)\n // - file inputs → uncontrolled (no value binding)\n const inputValue =\n type === \"file\"\n ? undefined\n : useFormData\n ? ((form.formData[name!] as string | undefined) ?? \"\")\n : localValue;\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const newValue =\n type === \"file\" ? (e.target.files?.[0]?.name ?? \"\") : e.target.value;\n if (useFormData) {\n form.handleChange(name!, newValue);\n } else {\n setLocalValue(newValue);\n onChanged({name, value: newValue});\n }\n }\n\n // Fire onCommitted when the user leaves the field or presses Enter.\n function handleBlur() {\n if (!useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === \"Enter\" && !useFormData && type !== \"file\") {\n onCommitted({name, value: localValue});\n }\n }\n\n // Use the id injected by pi/field (for label↔control linking); fall back\n // to a locally-generated id when used standalone.\n const selfId = `${cardName}-${name ?? \"input\"}`;\n const fieldId = injectedId ?? selfId;\n\n return (\n <div data-pihanga={cardName} className=\"grid w-full gap-1.5\">\n {label && <Label htmlFor={fieldId}>{label}</Label>}\n <Input\n ref={inputRef}\n id={fieldId}\n type={type}\n value={inputValue}\n onChange={handleChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n placeholder={placeholder}\n disabled={disabled}\n className={className}\n aria-invalid={invalid || undefined}\n aria-describedby={description ? `${fieldId}-desc` : undefined}\n />\n {description && (\n <p id={`${fieldId}-desc`} className=\"text-sm text-muted-foreground\">\n {description}\n </p>\n )}\n </div>\n );\n};\n"],"mappings":";;;;;;;AAOA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,SACA,OAAO,IAAY,IACnB,UAAO,QACP,gBACA,aACA,UACA,gBACA,cACA,cACA,aACA,cACA,mBACE,GAKE,IAAW,EAAM,OAAyB,IAAI;CACpD,EAAM,gBAAgB;EACpB,AAAI,KAAW,EAAS,SAAS,MAAM;CAEzC,GAAG,CAAC,CAAC;CAKL,IAAM,IAAc,EAAwB,IACtC,IAAU,EAAS,EAA8B,SAGjD,IAAO,EAAe,GACtB,IAAc,EAAK,YAAY,EAAQ,GAMvC,CAAC,GAAY,KAAiB,EAAM,SACxC,MAAS,SAAS,KAAK,CACzB;CAIA,EAAM,gBAAgB;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAc,CAAS;CAE3B,GAAG;EAAC;EAAW;EAAa;CAAI,CAAC;CAMjC,IAAM,IACJ,MAAS,SACL,KAAA,IACA,IACI,EAAK,SAAS,MAAiC,KACjD;CAER,SAAS,EAAa,GAAwC;EAC5D,IAAM,IACJ,MAAS,SAAU,EAAE,OAAO,QAAQ,IAAI,QAAQ,KAAM,EAAE,OAAO;EACjE,AAAI,IACF,EAAK,aAAa,GAAO,CAAQ,KAEjC,EAAc,CAAQ,GACtB,EAAU;GAAC;GAAM,OAAO;EAAQ,CAAC;CAErC;CAGA,SAAS,IAAa;EACpB,AAAI,CAAC,KAAe,MAAS,UAC3B,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAEA,SAAS,EAAc,GAA0C;EAC/D,AAAI,EAAE,QAAQ,WAAW,CAAC,KAAe,MAAS,UAChD,EAAY;GAAC;GAAM,OAAO;EAAU,CAAC;CAEzC;CAIA,IAAM,IAAS,GAAG,EAAS,GAAG,KAAQ,WAChC,IAAU,KAAc;CAE9B,OACE,kBAAC,OAAD;EAAK,gBAAc;EAAU,WAAU;YAAvC;GACG,KAAS,kBAAC,GAAD;IAAO,SAAS;cAAU;GAAa,CAAA;GACjD,kBAAC,GAAD;IACE,KAAK;IACL,IAAI;IACE;IACN,OAAO;IACP,UAAU;IACV,QAAQ;IACR,WAAW;IACE;IACH;IACC;IACX,gBAAc,KAAW,KAAA;IACzB,oBAAkB,IAAc,GAAG,EAAQ,SAAS,KAAA;GACrD,CAAA;GACA,KACC,kBAAC,KAAD;IAAG,IAAI,GAAG,EAAQ;IAAQ,WAAU;cACjC;GACA,CAAA;EAEF;;AAET"}
|
|
@@ -4,11 +4,11 @@ export declare const PI_INPUT_ACTION: {
|
|
|
4
4
|
CHANGED: string;
|
|
5
5
|
COMMITTED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onInputChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onInputChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & PiInputChangedEvent>) => void;
|
|
10
10
|
/** @deprecated Use `onInputChanged` instead. */
|
|
11
|
-
export declare const onPiInputChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
11
|
+
export declare const onPiInputChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
12
12
|
cardID: string;
|
|
13
13
|
} & PiInputChangedEvent>) => void;
|
|
14
14
|
/**
|
|
@@ -17,11 +17,11 @@ export declare const onPiInputChanged: <S extends import('@pihanga2/core').Redux
|
|
|
17
17
|
* `onInputCommitted` only fires once per editing session, making it the preferred
|
|
18
18
|
* handler for controlled inputs that trigger expensive downstream work.
|
|
19
19
|
*/
|
|
20
|
-
export declare const onInputCommitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
20
|
+
export declare const onInputCommitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
21
21
|
cardID: string;
|
|
22
22
|
} & PiInputCommittedEvent>) => void;
|
|
23
23
|
/** @deprecated Use `onInputCommitted` instead. */
|
|
24
|
-
export declare const onPiInputCommitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
24
|
+
export declare const onPiInputCommitted: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
25
25
|
cardID: string;
|
|
26
26
|
} & PiInputCommittedEvent>) => void;
|
|
27
27
|
export type PiInputProps = {
|
|
@@ -59,6 +59,12 @@ export type PiInputProps = {
|
|
|
59
59
|
description?: string;
|
|
60
60
|
/** Extra Tailwind / CSS classes forwarded to the underlying <input> element. */
|
|
61
61
|
className?: string;
|
|
62
|
+
/**
|
|
63
|
+
* When true, the input grabs keyboard focus the first time it is
|
|
64
|
+
* mounted/shown (e.g. when a dialog or drawer opens). Only applies once,
|
|
65
|
+
* on mount — it does not re-focus on subsequent re-renders.
|
|
66
|
+
*/
|
|
67
|
+
autoFocus?: boolean;
|
|
62
68
|
};
|
|
63
69
|
export type PiInputChangedEvent = {
|
|
64
70
|
/** Field name, mirrors the `name` prop if provided. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.types.js","names":[],"sources":["../../../src/cards/input/input.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_INPUT_CARD = \"pi/input\";\n\nexport const PiInput = createCardDeclaration<PiInputProps, PiInputEvents>(\n PI_INPUT_CARD,\n);\n\nexport const PI_INPUT_ACTION = registerActions(PI_INPUT_CARD, [\n \"changed\",\n \"committed\",\n]);\n\nexport const onInputChanged = createOnAction<PiInputChangedEvent>(\n PI_INPUT_ACTION.CHANGED,\n);\n\n/** @deprecated Use `onInputChanged` instead. */\nexport const onPiInputChanged = onInputChanged;\n\n/**\n * Subscribe to \"committed\" events — fired when the user finishes editing\n * (blur or Enter key). Unlike `onInputChanged` (which fires on every keystroke),\n * `onInputCommitted` only fires once per editing session, making it the preferred\n * handler for controlled inputs that trigger expensive downstream work.\n */\nexport const onInputCommitted = createOnAction<PiInputCommittedEvent>(\n PI_INPUT_ACTION.COMMITTED,\n);\n\n/** @deprecated Use `onInputCommitted` instead. */\nexport const onPiInputCommitted = onInputCommitted;\n\n// ---------------------------------------------------------------------------\n// Props & Events\n// ---------------------------------------------------------------------------\n\nexport type PiInputProps = {\n /**\n * Field name used to bind to FormContext when inside a pi/form card.\n * When provided the component reads its value from form state and writes\n * back via form.handleChange.\n */\n name?: string;\n\n /**\n * Controlled value used in standalone mode (outside a Form).\n * Ignored when `name` is set and the component is inside a pi/form.\n */\n value?: string;\n\n /**\n * HTML input type.\n * Common values: \"text\" | \"email\" | \"password\" | \"number\" | \"search\" |\n * \"url\" | \"tel\" | \"date\" | \"file\".\n * Defaults to \"text\".\n */\n type?: string;\n\n /** Placeholder text shown when the input is empty. */\n placeholder?: string;\n\n /** When true, the input is disabled and non-interactive. */\n disabled?: boolean;\n\n /**\n * Optional label text rendered in a `<label>` element above the input.\n * The label is automatically associated with the input via `htmlFor`.\n */\n label?: string;\n\n /**\n * Optional helper / description text rendered below the input.\n * Use this for hints, formatting guidance, or validation feedback.\n */\n description?: string;\n\n /** Extra Tailwind / CSS classes forwarded to the underlying <input> element. */\n className?: string;\n};\n\nexport type PiInputChangedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** New value after the change. */\n value: string;\n};\n\n/**\n * Payload for the `onCommitted` event (blur / Enter key).\n * Same shape as `PiInputChangedEvent`.\n */\nexport type PiInputCommittedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** Final committed value. */\n value: string;\n};\n\nexport type PiInputEvents = {\n /** Fires on every keystroke. */\n onChanged: PiInputChangedEvent;\n /**\n * Fires once when the user finishes editing (blur or Enter key).\n * Use this instead of `onChanged` when each change triggers expensive\n * downstream work (e.g. rebuilding a panel).\n */\n onCommitted: PiInputCommittedEvent;\n};\n"],"mappings":";;AAMA,IAAa,IAAgB,YAEhB,IAAU,EACrB,CACF,GAEa,IAAkB,EAAgB,GAAe,CAC5D,WACA,WACF,CAAC,GAEY,IAAiB,EAC5B,EAAgB,OAClB,GAGa,IAAmB,GAQnB,IAAmB,EAC9B,EAAgB,SAClB,GAGa,IAAqB"}
|
|
1
|
+
{"version":3,"file":"input.types.js","names":[],"sources":["../../../src/cards/input/input.types.ts"],"sourcesContent":["import {\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const PI_INPUT_CARD = \"pi/input\";\n\nexport const PiInput = createCardDeclaration<PiInputProps, PiInputEvents>(\n PI_INPUT_CARD,\n);\n\nexport const PI_INPUT_ACTION = registerActions(PI_INPUT_CARD, [\n \"changed\",\n \"committed\",\n]);\n\nexport const onInputChanged = createOnAction<PiInputChangedEvent>(\n PI_INPUT_ACTION.CHANGED,\n);\n\n/** @deprecated Use `onInputChanged` instead. */\nexport const onPiInputChanged = onInputChanged;\n\n/**\n * Subscribe to \"committed\" events — fired when the user finishes editing\n * (blur or Enter key). Unlike `onInputChanged` (which fires on every keystroke),\n * `onInputCommitted` only fires once per editing session, making it the preferred\n * handler for controlled inputs that trigger expensive downstream work.\n */\nexport const onInputCommitted = createOnAction<PiInputCommittedEvent>(\n PI_INPUT_ACTION.COMMITTED,\n);\n\n/** @deprecated Use `onInputCommitted` instead. */\nexport const onPiInputCommitted = onInputCommitted;\n\n// ---------------------------------------------------------------------------\n// Props & Events\n// ---------------------------------------------------------------------------\n\nexport type PiInputProps = {\n /**\n * Field name used to bind to FormContext when inside a pi/form card.\n * When provided the component reads its value from form state and writes\n * back via form.handleChange.\n */\n name?: string;\n\n /**\n * Controlled value used in standalone mode (outside a Form).\n * Ignored when `name` is set and the component is inside a pi/form.\n */\n value?: string;\n\n /**\n * HTML input type.\n * Common values: \"text\" | \"email\" | \"password\" | \"number\" | \"search\" |\n * \"url\" | \"tel\" | \"date\" | \"file\".\n * Defaults to \"text\".\n */\n type?: string;\n\n /** Placeholder text shown when the input is empty. */\n placeholder?: string;\n\n /** When true, the input is disabled and non-interactive. */\n disabled?: boolean;\n\n /**\n * Optional label text rendered in a `<label>` element above the input.\n * The label is automatically associated with the input via `htmlFor`.\n */\n label?: string;\n\n /**\n * Optional helper / description text rendered below the input.\n * Use this for hints, formatting guidance, or validation feedback.\n */\n description?: string;\n\n /** Extra Tailwind / CSS classes forwarded to the underlying <input> element. */\n className?: string;\n\n /**\n * When true, the input grabs keyboard focus the first time it is\n * mounted/shown (e.g. when a dialog or drawer opens). Only applies once,\n * on mount — it does not re-focus on subsequent re-renders.\n */\n autoFocus?: boolean;\n};\n\nexport type PiInputChangedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** New value after the change. */\n value: string;\n};\n\n/**\n * Payload for the `onCommitted` event (blur / Enter key).\n * Same shape as `PiInputChangedEvent`.\n */\nexport type PiInputCommittedEvent = {\n /** Field name, mirrors the `name` prop if provided. */\n name?: string;\n /** Final committed value. */\n value: string;\n};\n\nexport type PiInputEvents = {\n /** Fires on every keystroke. */\n onChanged: PiInputChangedEvent;\n /**\n * Fires once when the user finishes editing (blur or Enter key).\n * Use this instead of `onChanged` when each change triggers expensive\n * downstream work (e.g. rebuilding a panel).\n */\n onCommitted: PiInputCommittedEvent;\n};\n"],"mappings":";;AAMA,IAAa,IAAgB,YAEhB,IAAU,EACrB,CACF,GAEa,IAAkB,EAAgB,GAAe,CAC5D,WACA,WACF,CAAC,GAEY,IAAiB,EAC5B,EAAgB,OAClB,GAGa,IAAmB,GAQnB,IAAmB,EAC9B,EAAgB,SAClB,GAGa,IAAqB"}
|
|
@@ -4,10 +4,10 @@ export declare const JSON_VIEWER_ACTION: {
|
|
|
4
4
|
CLICKED: string;
|
|
5
5
|
COPIED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onJsonViewerClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onJsonViewerClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & ClickedEvent>) => void;
|
|
10
|
-
export declare const onJsonViewerCopied: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
10
|
+
export declare const onJsonViewerCopied: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
11
11
|
cardID: string;
|
|
12
12
|
} & CopiedEvent>) => void;
|
|
13
13
|
export type JsonViewerProps<S = object> = {
|
|
@@ -11,6 +11,7 @@ function i(e, t) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function a(e, t) {
|
|
14
|
+
if (t.length === 0) return !0;
|
|
14
15
|
let n = new Set(t);
|
|
15
16
|
return (n.has("ctrl") ? e.ctrlKey : !e.ctrlKey) && (n.has("shift") ? e.shiftKey : !e.shiftKey) && (n.has("alt") ? e.altKey : !e.altKey) && (n.has("meta") ? e.metaKey : !e.metaKey);
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboardOverlay.component.js","names":[],"sources":["../../../src/cards/keyboardOverlay/keyboardOverlay.component.tsx"],"sourcesContent":["import {Card, type PiCardProps} from \"@pihanga2/core\";\nimport React, {useEffect, useRef} from \"react\";\n\nimport type {\n KeyboardOverlayEvents,\n KeyboardOverlayProps,\n Modifier,\n} from \"./keyboardOverlay.types\";\n\n/** Walk up the DOM from `el` and return the first value of `data-{dataKey}` found. */\nfunction findDataAttribute(\n el: Element | null,\n dataKey: string,\n): string | undefined {\n let node: Element | null = el;\n while (node) {\n const attr = node.getAttribute(`data-${dataKey}`);\n if (attr) return attr;\n node = node.parentElement;\n }\n return undefined;\n}\n\n
|
|
1
|
+
{"version":3,"file":"keyboardOverlay.component.js","names":[],"sources":["../../../src/cards/keyboardOverlay/keyboardOverlay.component.tsx"],"sourcesContent":["import {Card, type PiCardProps} from \"@pihanga2/core\";\nimport React, {useEffect, useRef} from \"react\";\n\nimport type {\n KeyboardOverlayEvents,\n KeyboardOverlayProps,\n Modifier,\n} from \"./keyboardOverlay.types\";\n\n/** Walk up the DOM from `el` and return the first value of `data-{dataKey}` found. */\nfunction findDataAttribute(\n el: Element | null,\n dataKey: string,\n): string | undefined {\n let node: Element | null = el;\n while (node) {\n const attr = node.getAttribute(`data-${dataKey}`);\n if (attr) return attr;\n node = node.parentElement;\n }\n return undefined;\n}\n\n/**\n * Returns `true` when the keyboard event's active modifiers match the definition.\n *\n * When `required` is empty every key press matches regardless of which modifier\n * flags the OS/browser may inject (e.g. Windows can set ctrlKey on ArrowDown\n * in some configurations). When modifiers ARE specified they must match exactly\n * so that e.g. Ctrl+K and plain K remain distinct shortcuts.\n */\nfunction modifiersMatch(e: KeyboardEvent, required: Modifier[]): boolean {\n if (required.length === 0) return true;\n const need = new Set(required);\n return (\n (need.has(\"ctrl\") ? e.ctrlKey : !e.ctrlKey) &&\n (need.has(\"shift\") ? e.shiftKey : !e.shiftKey) &&\n (need.has(\"alt\") ? e.altKey : !e.altKey) &&\n (need.has(\"meta\") ? e.metaKey : !e.metaKey)\n );\n}\n\nexport const KeyboardOverlayComponent = (\n props: PiCardProps<KeyboardOverlayProps, KeyboardOverlayEvents>,\n): React.ReactNode => {\n const {\n content,\n shortcuts,\n onShortcut,\n cardName,\n className,\n style,\n captureFocus = true,\n dataKey = \"pihanga\",\n } = props;\n\n // Track cursor position passively — no re-render needed.\n const cursorPos = useRef<{x: number; y: number}>({x: 0, y: 0});\n const divRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const onMouseMove = (e: MouseEvent) => {\n cursorPos.current = {x: e.clientX, y: e.clientY};\n };\n\n const onKeyDown = (e: KeyboardEvent) => {\n for (const shortcut of shortcuts) {\n const mods: Modifier[] = shortcut.modifiers ?? [];\n const keyMatch = e.key === shortcut.key || e.code === shortcut.key;\n if (!keyMatch || !modifiersMatch(e, mods)) continue;\n\n // Only consume the event when propagate !== true.\n if (!shortcut.propagate) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n const {x, y} = cursorPos.current;\n const el = document.elementFromPoint(x, y);\n const dataValue = findDataAttribute(el, dataKey);\n\n onShortcut({\n shortcutId: shortcut.id ?? shortcut.key,\n key: shortcut.key,\n modifiers: mods,\n dataValue,\n cursorX: x,\n cursorY: y,\n });\n break;\n }\n };\n\n // capture:true ensures we see the keydown before any focused child element.\n document.addEventListener(\"mousemove\", onMouseMove, {passive: true});\n document.addEventListener(\"keydown\", onKeyDown, {capture: true});\n return () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"keydown\", onKeyDown, {capture: true});\n };\n }, [shortcuts, onShortcut, dataKey]);\n\n function onMouseEnter() {\n if (captureFocus) {\n divRef.current?.focus();\n }\n }\n\n return (\n <div\n ref={divRef}\n tabIndex={captureFocus ? -1 : undefined}\n onMouseEnter={onMouseEnter}\n data-pihanga={cardName}\n className={className}\n style={{...style, position: \"relative\", outline: \"none\"}}\n >\n <Card cardName={content} parentCard={cardName} />\n </div>\n );\n};\n"],"mappings":";;;;AAUA,SAAS,EACP,GACA,GACoB;CACpB,IAAI,IAAuB;CAC3B,OAAO,IAAM;EACX,IAAM,IAAO,EAAK,aAAa,QAAQ,GAAS;EAChD,IAAI,GAAM,OAAO;EACjB,IAAO,EAAK;CACd;AAEF;AAUA,SAAS,EAAe,GAAkB,GAA+B;CACvE,IAAI,EAAS,WAAW,GAAG,OAAO;CAClC,IAAM,IAAO,IAAI,IAAI,CAAQ;CAC7B,QACG,EAAK,IAAI,MAAM,IAAI,EAAE,UAAU,CAAC,EAAE,aAClC,EAAK,IAAI,OAAO,IAAI,EAAE,WAAW,CAAC,EAAE,cACpC,EAAK,IAAI,KAAK,IAAI,EAAE,SAAS,CAAC,EAAE,YAChC,EAAK,IAAI,MAAM,IAAI,EAAE,UAAU,CAAC,EAAE;AAEvC;AAEA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,YACA,cACA,eACA,aACA,cACA,UACA,kBAAe,IACf,aAAU,cACR,GAGE,IAAY,EAA+B;EAAC,GAAG;EAAG,GAAG;CAAC,CAAC,GACvD,IAAS,EAAuB,IAAI;CAE1C,QAAgB;EACd,IAAM,KAAe,MAAkB;GACrC,EAAU,UAAU;IAAC,GAAG,EAAE;IAAS,GAAG,EAAE;GAAO;EACjD,GAEM,KAAa,MAAqB;GACtC,KAAK,IAAM,KAAY,GAAW;IAChC,IAAM,IAAmB,EAAS,aAAa,CAAC;IAEhD,IAAI,EADa,EAAE,QAAQ,EAAS,OAAO,EAAE,SAAS,EAAS,QAC9C,CAAC,EAAe,GAAG,CAAI,GAAG;IAG3C,AAAK,EAAS,cACZ,EAAE,eAAe,GACjB,EAAE,gBAAgB;IAGpB,IAAM,EAAC,MAAG,SAAK,EAAU,SAEnB,IAAY,EADP,SAAS,iBAAiB,GAAG,CACJ,GAAI,CAAO;IAE/C,EAAW;KACT,YAAY,EAAS,MAAM,EAAS;KACpC,KAAK,EAAS;KACd,WAAW;KACX;KACA,SAAS;KACT,SAAS;IACX,CAAC;IACD;GACF;EACF;EAKA,OAFA,SAAS,iBAAiB,aAAa,GAAa,EAAC,SAAS,GAAI,CAAC,GACnE,SAAS,iBAAiB,WAAW,GAAW,EAAC,SAAS,GAAI,CAAC,SAClD;GAEX,AADA,SAAS,oBAAoB,aAAa,CAAW,GACrD,SAAS,oBAAoB,WAAW,GAAW,EAAC,SAAS,GAAI,CAAC;EACpE;CACF,GAAG;EAAC;EAAW;EAAY;CAAO,CAAC;CAEnC,SAAS,IAAe;EACtB,AAAI,KACF,EAAO,SAAS,MAAM;CAE1B;CAEA,OACE,kBAAC,OAAD;EACE,KAAK;EACL,UAAU,IAAe,KAAK,KAAA;EAChB;EACd,gBAAc;EACH;EACX,OAAO;GAAC,GAAG;GAAO,UAAU;GAAY,SAAS;EAAM;YAEvD,kBAAC,GAAD;GAAM,UAAU;GAAS,YAAY;EAAW,CAAA;CAC7C,CAAA;AAET"}
|
|
@@ -4,7 +4,7 @@ export declare const KeyboardOverlay: <S extends import('@pihanga2/core').ReduxS
|
|
|
4
4
|
export declare const KEYBOARD_OVERLAY_ACTION: {
|
|
5
5
|
SHORTCUT: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onKeyboardShortcut: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onKeyboardShortcut: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & KeyboardOverlayShortcutEvent>) => void;
|
|
10
10
|
/** Modifier keys that can be part of a shortcut definition. */
|
|
@@ -5,7 +5,7 @@ export declare const List: <S extends import('@pihanga2/core').ReduxState>(p: im
|
|
|
5
5
|
export declare const LIST_ACTION: {
|
|
6
6
|
ITEM_CLICKED: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const onListItemClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
8
|
+
export declare const onListItemClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
9
9
|
cardID: string;
|
|
10
10
|
} & ItemClickedEvent>) => void;
|
|
11
11
|
export type IconDecorator = {
|
|
@@ -4,7 +4,7 @@ export declare const Menu: <S extends import('@pihanga2/core').ReduxState>(p: im
|
|
|
4
4
|
export declare const MENU_ACTION: {
|
|
5
5
|
CLICKED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onMenuClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onMenuClicked: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & MenuClickEvent>) => void;
|
|
10
10
|
export type BaseButtonProps = {
|
|
@@ -4,7 +4,7 @@ export declare const ModeToggle: <S extends import('@pihanga2/core').ReduxState>
|
|
|
4
4
|
export declare const MODE_TOGGLE_ACTION: {
|
|
5
5
|
MODE_CHANGED: string;
|
|
6
6
|
};
|
|
7
|
-
export declare const onModeToggleChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core').
|
|
7
|
+
export declare const onModeToggleChanged: <S extends import('@pihanga2/core').ReduxState>(register: import('@pihanga2/core/types').PiRegisterMinimal, f: import('@pihanga2/core').ReduceF<S, import('@pihanga2/core').ReduxAction & {
|
|
8
8
|
cardID: string;
|
|
9
9
|
} & ModeChangeEvent>) => void;
|
|
10
10
|
export type ModeToggleProps = {
|