Skip to content

Commit

Permalink
updated per Fab
Browse files Browse the repository at this point in the history
  • Loading branch information
namnguyen20999 committed Nov 20, 2024
1 parent f6f4a5d commit 5f507c2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions doc/gui/extension/example_library/example_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ def __init__(self) -> None:
# element, exported as GameTable in front-end/src/index.ts
# react_component="GameTable",
),
"labeled_item_list": Element(
"visual_label_list": Element(
"lov",
{
"lov": ElementProperty(PropertyType.lov),
"sort": ElementProperty(PropertyType.string),
},
# The name of the React component (LabeledItem) that implements this custom
# The name of the React component (VisualLabelList) that implements this custom
# element, exported as LabeledItemList in front-end/src/index.ts
react_component="LabeledItem",
react_component="VisualLabelList",
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useMemo } from "react";
import { LoV, useLovListMemo } from "taipy-gui";

interface LabeledItemProps {
interface VisualLabelListProps {
lov?: LoV;
defaultLov?: string;
sort?: "asc" | "desc";
Expand All @@ -19,7 +19,7 @@ const styles = {
},
};

const LabeledItem: React.FC<LabeledItemProps> = ({ lov, defaultLov = "", sort }) => {
const VisualLabelList: React.FC<VisualLabelListProps> = ({ lov, defaultLov = "", sort }) => {
const lovList = useLovListMemo(lov, defaultLov);

const sortedLovList = useMemo(() => {
Expand Down Expand Up @@ -47,4 +47,4 @@ const LabeledItem: React.FC<LabeledItemProps> = ({ lov, defaultLov = "", sort })
);
};

export default LabeledItem;
export default VisualLabelList;
4 changes: 2 additions & 2 deletions doc/gui/extension/example_library/front-end/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
// the name used in the element declaration in the element library.
import ColoredLabel from "./ColoredLabel";
import GameTable from "./GameTable";
import LabeledItem from "./LabeledItem";
import VisualLabelList from "./VisualLabelList";

export { ColoredLabel as ExampleLabel, GameTable, LabeledItem };
export { ColoredLabel as ExampleLabel, GameTable, VisualLabelList };
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
]

page = """
<|{languages}|example.labeled_item_list|sort=asc|>
<|{languages}|example.visual_label_list|sort=asc|>
"""

if __name__ == "__main__":
Expand Down

0 comments on commit 5f507c2

Please sign in to comment.