From 592b45f5f70a40cdbfb77e33f1be9a5b60c796ec Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 6 Apr 2022 16:06:08 +0800 Subject: [PATCH] feat: columns of type number/percent in the table are right-aligned --- .../src/schema-component/antd/input-number/ReadPretty.tsx | 2 +- packages/client/src/schema-component/antd/table-v2/Table.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/client/src/schema-component/antd/input-number/ReadPretty.tsx b/packages/client/src/schema-component/antd/input-number/ReadPretty.tsx index 279f41b17..40505d140 100644 --- a/packages/client/src/schema-component/antd/input-number/ReadPretty.tsx +++ b/packages/client/src/schema-component/antd/input-number/ReadPretty.tsx @@ -12,7 +12,7 @@ export const ReadPretty: React.FC = (props: any) } const precision = Math.max(getNumberPrecision(String(value)), getNumberPrecision(step)); return ( -
+
{addonBefore} {toFixed(String(value), '.', precision)} {addonAfter} diff --git a/packages/client/src/schema-component/antd/table-v2/Table.tsx b/packages/client/src/schema-component/antd/table-v2/Table.tsx index c22808b7b..678e599da 100644 --- a/packages/client/src/schema-component/antd/table-v2/Table.tsx +++ b/packages/client/src/schema-component/antd/table-v2/Table.tsx @@ -100,6 +100,9 @@ export const components = { css` max-width: 300px; white-space: nowrap; + .nb-read-pretty-input-number { + text-align: right; + } `, )} />