Skip to content

Commit 3c6f791

Browse files
FredLL-AvaigaFred Lefévère-Laoide
andauthored
Selector in table width (#2687)
resolves #2685 Co-authored-by: Fred Lefévère-Laoide <Fred.Lefevere-Laoide@Taipy.io>
1 parent cfe612b commit 3c6f791

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

frontend/taipy-gui/src/components/Taipy/tableUtils.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ export const iconsWrapperSx = { gridColumnStart: 2, display: "flex", alignItems:
193193
const CellBoxSx = { display: "grid", gridTemplateColumns: "1fr auto", alignItems: "center" } as CSSProperties;
194194
const TableFontSx = { fontSize: "body2.fontSize" };
195195
const ButtonSx = { minHeight: "unset", mb: "unset", padding: "unset", lineHeight: "unset" };
196+
const Width100pSx = { width: "100%" };
197+
const CellBox100pSx = {...CellBoxSx, ...Width100pSx};
196198
export interface OnCellValidation {
197199
(value: RowValue, rowIndex: number, colName: string, userValue: string, tz?: string): void;
198200
}
@@ -606,7 +608,12 @@ export const EditableCell = (props: EditableCellProps) => {
606608
component={colDesc.multi !== undefined ? "th" : undefined}
607609
rowSpan={rowSpan}
608610
>
609-
<Badge color="primary" variant="dot" invisible={comp === undefined || comp === null}>
611+
<Badge
612+
color="primary"
613+
variant="dot"
614+
invisible={comp === undefined || comp === null}
615+
sx={edit && colDesc.lov ? Width100pSx : undefined}
616+
>
610617
{edit ? (
611618
colDesc.type?.startsWith("bool") ? (
612619
<Box sx={CellBoxSx}>
@@ -671,7 +678,7 @@ export const EditableCell = (props: EditableCellProps) => {
671678
</Box>
672679
</Box>
673680
) : colDesc.lov ? (
674-
<Box sx={CellBoxSx}>
681+
<Box sx={CellBox100pSx}>
675682
<Autocomplete
676683
autoComplete={true}
677684
fullWidth

tools/frontend/bundle_build.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
1010
# specific language governing permissions and limitations under the License.
1111

12+
import os
1213
import platform
1314
import subprocess
1415
import sys
@@ -23,9 +24,19 @@ def build_gui(root_path: Path):
2324
if already_exists:
2425
print(f'Found taipy-gui frontend bundle in {root_path / "taipy" / "gui" / "webapp"}.') # noqa: T201
2526
else:
26-
subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy-gui" / "dom", check=True, shell=with_shell)
27-
subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=with_shell)
28-
subprocess.run(["npm", "run", "build"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=with_shell)
27+
my_env = os.environ.copy()
28+
if my_env.get("NODE_OPTIONS") is None:
29+
print("Setting NODE_OPTIONS to --max-old-space-size=16384") # noqa: T201
30+
my_env["NODE_OPTIONS"] = "--max-old-space-size=16384"
31+
subprocess.run(
32+
["npm", "ci"], cwd=root_path / "frontend" / "taipy-gui" / "dom", check=True, shell=with_shell, env=my_env
33+
)
34+
subprocess.run(
35+
["npm", "ci"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=with_shell, env=my_env
36+
)
37+
subprocess.run(
38+
["npm", "run", "build"], cwd=root_path / "frontend" / "taipy-gui", check=True, shell=with_shell, env=my_env
39+
)
2940

3041

3142
def build_taipy(root_path: Path):
@@ -39,8 +50,14 @@ def build_taipy(root_path: Path):
3950
if not env_file_path.exists():
4051
with open(env_file_path, "w") as env_file:
4152
env_file.write(f"TAIPY_DIR={root_path}\n")
42-
subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy", check=True, shell=with_shell)
43-
subprocess.run(["npm", "run", "build"], cwd=root_path / "frontend" / "taipy", check=True, shell=with_shell)
53+
my_env = os.environ.copy()
54+
if my_env.get("NODE_OPTIONS") is None:
55+
print("Setting NODE_OPTIONS to --max-old-space-size=16384") # noqa: T201
56+
my_env["NODE_OPTIONS"] = "--max-old-space-size=16384"
57+
subprocess.run(["npm", "ci"], cwd=root_path / "frontend" / "taipy", check=True, shell=with_shell, env=my_env)
58+
subprocess.run(
59+
["npm", "run", "build"], cwd=root_path / "frontend" / "taipy", check=True, shell=with_shell, env=my_env
60+
)
4461

4562

4663
if __name__ == "__main__":

0 commit comments

Comments
 (0)