@rovula/ui 0.0.53 → 0.0.54
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/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/Tree/type.d.ts +1 -1
- package/dist/components/Tree/Tree.js +1 -3
- package/dist/components/Tree/Tree.stories.js +1 -1
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/Tree/type.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Tree/Tree.stories.tsx +5 -10
- package/src/components/Tree/Tree.tsx +1 -6
- package/src/components/Tree/type.ts +1 -5
|
@@ -82,7 +82,7 @@ export interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRig
|
|
|
82
82
|
checkedId?: string[];
|
|
83
83
|
loadingId?: string[];
|
|
84
84
|
onExpandChange?: (id: string, expanded: boolean) => void;
|
|
85
|
-
onCheckedChange?: (
|
|
85
|
+
onCheckedChange?: (checkedState: Record<string, boolean>) => void;
|
|
86
86
|
onClickItem?: (id: string) => void;
|
|
87
87
|
onCheckedItem?: (id: string, checked: boolean) => void;
|
|
88
88
|
defaultExpandAll?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -696,7 +696,7 @@ interface TreeProps extends Pick<TreeItemProps, "renderIcon" | "renderRightSecti
|
|
|
696
696
|
checkedId?: string[];
|
|
697
697
|
loadingId?: string[];
|
|
698
698
|
onExpandChange?: (id: string, expanded: boolean) => void;
|
|
699
|
-
onCheckedChange?: (
|
|
699
|
+
onCheckedChange?: (checkedState: Record<string, boolean>) => void;
|
|
700
700
|
onClickItem?: (id: string) => void;
|
|
701
701
|
onCheckedItem?: (id: string, checked: boolean) => void;
|
|
702
702
|
defaultExpandAll?: boolean;
|
package/package.json
CHANGED
|
@@ -107,16 +107,11 @@ export const Controller: StoryObj<typeof Tree> = {
|
|
|
107
107
|
defaultExpandAll
|
|
108
108
|
defaultCheckedId={checkedId}
|
|
109
109
|
checkedId={checkedId}
|
|
110
|
-
onCheckedChange={(ids
|
|
111
|
-
setSelectedSectionList(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
[id]: ids.includes(id),
|
|
116
|
-
}),
|
|
117
|
-
{}
|
|
118
|
-
)
|
|
119
|
-
);
|
|
110
|
+
onCheckedChange={(ids) => {
|
|
111
|
+
setSelectedSectionList((prev) => ({
|
|
112
|
+
...prev,
|
|
113
|
+
...ids,
|
|
114
|
+
}));
|
|
120
115
|
}}
|
|
121
116
|
/>
|
|
122
117
|
</div>
|
|
@@ -144,12 +144,7 @@ const Tree: FC<TreeProps> = ({
|
|
|
144
144
|
setCheckedState(newState);
|
|
145
145
|
|
|
146
146
|
if (onCheckedChange) {
|
|
147
|
-
|
|
148
|
-
const uncheckedIds = Object.keys(newState).filter(
|
|
149
|
-
(key) => !newState[key]
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
onCheckedChange?.(checkedIds, uncheckedIds, newState);
|
|
147
|
+
onCheckedChange?.(newState);
|
|
153
148
|
}
|
|
154
149
|
},
|
|
155
150
|
[checkedState, data, onCheckedChange, hierarchicalCheck, onCheckedItem]
|
|
@@ -100,11 +100,7 @@ export interface TreeProps
|
|
|
100
100
|
checkedId?: string[];
|
|
101
101
|
loadingId?: string[];
|
|
102
102
|
onExpandChange?: (id: string, expanded: boolean) => void;
|
|
103
|
-
onCheckedChange?: (
|
|
104
|
-
checkedId: string[],
|
|
105
|
-
uncheckedId: string[],
|
|
106
|
-
checkedState: Record<string, boolean>
|
|
107
|
-
) => void;
|
|
103
|
+
onCheckedChange?: (checkedState: Record<string, boolean>) => void;
|
|
108
104
|
onClickItem?: (id: string) => void;
|
|
109
105
|
onCheckedItem?: (id: string, checked: boolean) => void;
|
|
110
106
|
defaultExpandAll?: boolean;
|