@multiplatform.one/table 7.45.1 → 7.47.0
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/components/DataTable/DataTableDocumentList.cjs +16 -6
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js +16 -6
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableMobileCards.cjs +17 -5
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js +17 -5
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableRoot.cjs +46 -33
- package/dist/cjs/components/DataTable/DataTableRoot.native.js +58 -36
- package/dist/cjs/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableVirtualized.cjs +8 -3
- package/dist/cjs/components/DataTable/DataTableVirtualized.native.js +9 -3
- package/dist/cjs/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/cjs/components/DataTable/dataTableChrome.cjs +12 -0
- package/dist/cjs/components/DataTable/dataTableChrome.native.js +12 -0
- package/dist/cjs/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/cjs/components/DataTable/index.native.js +58 -32
- package/dist/cjs/components/DataTable/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/rowStateChrome.cjs +3 -2
- package/dist/cjs/components/DataTable/rowStateChrome.native.js +4 -3
- package/dist/cjs/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/cjs/components/DataTableDateFilter/index.cjs +2 -2
- package/dist/cjs/components/DataTableDateFilter/index.native.js +2 -2
- package/dist/cjs/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableExport/index.cjs +4 -4
- package/dist/cjs/components/DataTableExport/index.native.js +4 -4
- package/dist/cjs/components/DataTableExport/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.cjs +3 -3
- package/dist/cjs/components/DataTableFilterButton/index.native.js +3 -3
- package/dist/cjs/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilters/index.cjs +2 -1
- package/dist/cjs/components/DataTableFilters/index.native.js +2 -1
- package/dist/cjs/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableGrouping/index.cjs +19 -13
- package/dist/cjs/components/DataTableGrouping/index.native.js +20 -13
- package/dist/cjs/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableSearch/index.cjs +2 -1
- package/dist/cjs/components/DataTableSearch/index.native.js +2 -1
- package/dist/cjs/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableViewOptions/index.cjs +4 -5
- package/dist/cjs/components/DataTableViewOptions/index.native.js +4 -5
- package/dist/cjs/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/cjs/components/FilterManager.cjs +3 -2
- package/dist/cjs/components/FilterManager.native.js +3 -2
- package/dist/cjs/components/FilterManager.native.js.map +1 -1
- package/dist/cjs/components/SimpleTable/index.cjs +16 -2
- package/dist/cjs/components/SimpleTable/index.native.js +17 -2
- package/dist/cjs/components/SimpleTable/index.native.js.map +1 -1
- package/dist/cjs/components/TableInput/index.cjs +3 -3
- package/dist/cjs/components/TableInput/index.native.js +5 -4
- package/dist/cjs/components/TableInput/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.mjs +16 -6
- package/dist/esm/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js +16 -6
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs +16 -4
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js +16 -4
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.mjs +49 -36
- package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.native.js +61 -39
- package/dist/esm/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.mjs +10 -5
- package/dist/esm/components/DataTable/DataTableVirtualized.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.native.js +11 -5
- package/dist/esm/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/esm/components/DataTable/dataTableChrome.mjs +12 -1
- package/dist/esm/components/DataTable/dataTableChrome.mjs.map +1 -1
- package/dist/esm/components/DataTable/dataTableChrome.native.js +12 -1
- package/dist/esm/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/esm/components/DataTable/index.native.js +61 -35
- package/dist/esm/components/DataTable/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/rowStateChrome.mjs +3 -2
- package/dist/esm/components/DataTable/rowStateChrome.mjs.map +1 -1
- package/dist/esm/components/DataTable/rowStateChrome.native.js +4 -3
- package/dist/esm/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/esm/components/DataTableDateFilter/index.mjs +7 -7
- package/dist/esm/components/DataTableDateFilter/index.mjs.map +1 -1
- package/dist/esm/components/DataTableDateFilter/index.native.js +7 -7
- package/dist/esm/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/esm/components/DataTableExport/index.mjs +7 -7
- package/dist/esm/components/DataTableExport/index.mjs.map +1 -1
- package/dist/esm/components/DataTableExport/index.native.js +7 -7
- package/dist/esm/components/DataTableExport/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.mjs +2 -2
- package/dist/esm/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.native.js +2 -2
- package/dist/esm/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilters/index.mjs +2 -1
- package/dist/esm/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilters/index.native.js +2 -1
- package/dist/esm/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/esm/components/DataTableGrouping/index.mjs +18 -12
- package/dist/esm/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/esm/components/DataTableGrouping/index.native.js +19 -12
- package/dist/esm/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/esm/components/DataTableSearch/index.mjs +7 -6
- package/dist/esm/components/DataTableSearch/index.mjs.map +1 -1
- package/dist/esm/components/DataTableSearch/index.native.js +7 -6
- package/dist/esm/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.mjs +10 -11
- package/dist/esm/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.native.js +10 -11
- package/dist/esm/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/esm/components/FilterManager.mjs +2 -1
- package/dist/esm/components/FilterManager.mjs.map +1 -1
- package/dist/esm/components/FilterManager.native.js +2 -1
- package/dist/esm/components/FilterManager.native.js.map +1 -1
- package/dist/esm/components/SimpleTable/index.mjs +18 -4
- package/dist/esm/components/SimpleTable/index.mjs.map +1 -1
- package/dist/esm/components/SimpleTable/index.native.js +19 -4
- package/dist/esm/components/SimpleTable/index.native.js.map +1 -1
- package/dist/esm/components/TableInput/index.mjs +2 -2
- package/dist/esm/components/TableInput/index.mjs.map +1 -1
- package/dist/esm/components/TableInput/index.native.js +2 -1
- package/dist/esm/components/TableInput/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs +16 -6
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js +16 -6
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs +16 -4
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js +17 -5
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.mjs +49 -36
- package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.native.js +58 -36
- package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.mjs +10 -5
- package/dist/jsx/components/DataTable/DataTableVirtualized.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.native.js +9 -3
- package/dist/jsx/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/jsx/components/DataTable/dataTableChrome.mjs +12 -1
- package/dist/jsx/components/DataTable/dataTableChrome.mjs.map +1 -1
- package/dist/jsx/components/DataTable/dataTableChrome.native.js +12 -0
- package/dist/jsx/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/jsx/components/DataTable/index.native.js +58 -32
- package/dist/jsx/components/DataTable/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/rowStateChrome.mjs +3 -2
- package/dist/jsx/components/DataTable/rowStateChrome.mjs.map +1 -1
- package/dist/jsx/components/DataTable/rowStateChrome.native.js +4 -3
- package/dist/jsx/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/jsx/components/DataTableDateFilter/index.mjs +7 -7
- package/dist/jsx/components/DataTableDateFilter/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableDateFilter/index.native.js +2 -2
- package/dist/jsx/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableExport/index.mjs +7 -7
- package/dist/jsx/components/DataTableExport/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableExport/index.native.js +4 -4
- package/dist/jsx/components/DataTableExport/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.mjs +2 -2
- package/dist/jsx/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js +3 -3
- package/dist/jsx/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.mjs +2 -1
- package/dist/jsx/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.native.js +2 -1
- package/dist/jsx/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableGrouping/index.mjs +18 -12
- package/dist/jsx/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableGrouping/index.native.js +20 -13
- package/dist/jsx/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableSearch/index.mjs +7 -6
- package/dist/jsx/components/DataTableSearch/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableSearch/index.native.js +2 -1
- package/dist/jsx/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.mjs +10 -11
- package/dist/jsx/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.native.js +4 -5
- package/dist/jsx/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/jsx/components/FilterManager.mjs +2 -1
- package/dist/jsx/components/FilterManager.mjs.map +1 -1
- package/dist/jsx/components/FilterManager.native.js +3 -2
- package/dist/jsx/components/FilterManager.native.js.map +1 -1
- package/dist/jsx/components/SimpleTable/index.mjs +18 -4
- package/dist/jsx/components/SimpleTable/index.mjs.map +1 -1
- package/dist/jsx/components/SimpleTable/index.native.js +17 -2
- package/dist/jsx/components/SimpleTable/index.native.js.map +1 -1
- package/dist/jsx/components/TableInput/index.mjs +2 -2
- package/dist/jsx/components/TableInput/index.mjs.map +1 -1
- package/dist/jsx/components/TableInput/index.native.js +5 -4
- package/dist/jsx/components/TableInput/index.native.js.map +1 -1
- package/package.json +12 -12
- package/src/components/DataTable/DataTable.stories.tsx +72 -2
- package/src/components/DataTable/DataTableCardControls.stories.tsx +2 -1
- package/src/components/DataTable/DataTableDocumentList.tsx +17 -3
- package/src/components/DataTable/DataTableMobileCards.tsx +17 -4
- package/src/components/DataTable/DataTableRoot.tsx +126 -89
- package/src/components/DataTable/DataTableVirtualized.tsx +10 -5
- package/src/components/DataTable/FieldsInCells.stories.tsx +4 -3
- package/src/components/DataTable/caretTransform.native.spec.tsx +129 -0
- package/src/components/DataTable/dataTableCardControls.spec.tsx +18 -9
- package/src/components/DataTable/dataTableChrome.ts +21 -0
- package/src/components/DataTable/index.native.tsx +87 -35
- package/src/components/DataTable/numericHeaderEdge.spec.tsx +96 -0
- package/src/components/DataTable/rowStateChrome.ts +9 -2
- package/src/components/DataTableBulkActions/DataTableBulkActions.stories.tsx +2 -1
- package/src/components/DataTableCell/CellOptionsEditor.stories.tsx +2 -1
- package/src/components/DataTableCell/DataTableCell.stories.tsx +8 -7
- package/src/components/DataTableColumnPinning/DataTableColumnPinning.stories.tsx +2 -1
- package/src/components/DataTableDateFilter/DataTableDateFilter.stories.tsx +2 -1
- package/src/components/DataTableDateFilter/index.tsx +20 -12
- package/src/components/DataTableExport/DataTableExport.stories.tsx +2 -1
- package/src/components/DataTableExport/index.tsx +12 -12
- package/src/components/DataTableFilterButton/index.tsx +2 -2
- package/src/components/DataTableFilterChips/FilterChip.stories.tsx +2 -1
- package/src/components/DataTableFilters/DataTableFilters.stories.tsx +2 -2
- package/src/components/DataTableFilters/index.tsx +2 -1
- package/src/components/DataTableGrouping/DataTableGrouping.stories.tsx +2 -1
- package/src/components/DataTableGrouping/index.tsx +22 -19
- package/src/components/DataTablePagination/DataTablePagination.stories.tsx +9 -4
- package/src/components/DataTableSearch/index.tsx +12 -11
- package/src/components/DataTableViewOptions/DataTableViewOptions.stories.tsx +2 -1
- package/src/components/DataTableViewOptions/index.tsx +26 -19
- package/src/components/FilterManager.tsx +2 -1
- package/src/components/FilterOperatorValueEditor/FilterOperatorValueEditor.stories.tsx +2 -1
- package/src/components/KnobDialog.stories.tsx +2 -1
- package/src/components/SimpleTable/SimpleTable.stories.tsx +28 -0
- package/src/components/SimpleTable/index.tsx +27 -4
- package/src/components/SimpleTable/simpleTable.spec.tsx +1 -1
- package/src/components/TableInput/TableInput.stories.tsx +6 -5
- package/src/components/TableInput/index.native.tsx +2 -1
- package/src/components/TableInput/index.tsx +2 -1
- package/src/components/phoneTableBleed.spec.tsx +224 -0
- package/src/components/tableZebraDefault.spec.tsx +98 -0
- package/types/components/DataTable/DataTableDocumentList.d.ts +4 -1
- package/types/components/DataTable/DataTableDocumentList.d.ts.map +1 -1
- package/types/components/DataTable/DataTableMobileCards.d.ts +4 -1
- package/types/components/DataTable/DataTableMobileCards.d.ts.map +1 -1
- package/types/components/DataTable/DataTableRoot.d.ts.map +1 -1
- package/types/components/DataTable/DataTableVirtualized.d.ts.map +1 -1
- package/types/components/DataTable/dataTableChrome.d.ts +6 -0
- package/types/components/DataTable/dataTableChrome.d.ts.map +1 -1
- package/types/components/DataTable/index.native.d.ts.map +1 -1
- package/types/components/DataTable/rowStateChrome.d.ts +6 -0
- package/types/components/DataTable/rowStateChrome.d.ts.map +1 -1
- package/types/components/DataTableDateFilter/index.d.ts.map +1 -1
- package/types/components/DataTableFilters/index.d.ts.map +1 -1
- package/types/components/DataTableGrouping/index.d.ts.map +1 -1
- package/types/components/DataTableSearch/index.d.ts.map +1 -1
- package/types/components/DataTableViewOptions/index.d.ts.map +1 -1
- package/types/components/FilterManager.d.ts.map +1 -1
- package/types/components/SimpleTable/index.d.ts.map +1 -1
- package/types/components/TableInput/index.d.ts.map +1 -1
- package/types/components/TableInput/index.native.d.ts.map +1 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { CaretLeftIcon, CaretRightIcon, FunnelIcon } from "@phosphor-icons/react";
|
|
17
|
-
import { useDirection } from "@multiplatform.one/components";
|
|
17
|
+
import { useDirection, Text } from "@multiplatform.one/components";
|
|
18
18
|
import { Button, FloatingPanel, SearchInput } from "@multiplatform.one/forms";
|
|
19
19
|
import {
|
|
20
20
|
keyboardFocusRingProps,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
wasKeyboardFocus,
|
|
23
23
|
} from "@multiplatform.one/theme";
|
|
24
24
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
25
|
-
import { SizableText,
|
|
25
|
+
import { SizableText, View, XStack, YStack } from "tamagui";
|
|
26
26
|
import { t } from "../../shared/t";
|
|
27
27
|
import type { FilterOperator, FilterValue, ResolvedFilterField } from "../../types";
|
|
28
28
|
import {
|
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
import { action } from "@multiplatform.one/storybook";
|
|
13
13
|
import type { Meta } from "@storybook/react-native-web-vite";
|
|
14
14
|
import { useState } from "react";
|
|
15
|
-
import {
|
|
15
|
+
import { XStack, YStack } from "tamagui";
|
|
16
16
|
import { FilterChip } from "./FilterChip";
|
|
17
|
+
import { Paragraph } from "@multiplatform.one/components";
|
|
17
18
|
|
|
18
19
|
const meta: Meta<typeof FilterChip> = {
|
|
19
20
|
title: "Table/FilterChip",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Card } from "@multiplatform.one/components";
|
|
1
|
+
import { Card, Text } from "@multiplatform.one/components";
|
|
2
2
|
import { action } from "@multiplatform.one/storybook";
|
|
3
3
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
4
|
-
import {
|
|
4
|
+
import { View, YStack } from "tamagui";
|
|
5
5
|
import type { DataTableColumnType, FacetedFilterOption, TableFilter } from "../../types";
|
|
6
6
|
import { DataTableFilters } from "./index";
|
|
7
7
|
|
|
@@ -14,7 +14,7 @@ import { FunnelIcon, PlusIcon } from "@phosphor-icons/react";
|
|
|
14
14
|
import { useResolvedKnobs, sizeTokenStep } from "@multiplatform.one/theme";
|
|
15
15
|
import { useEffect, useState } from "react";
|
|
16
16
|
import { Button, FloatingPanel, Select } from "@multiplatform.one/forms";
|
|
17
|
-
import {
|
|
17
|
+
import { View, XStack, YStack, type SizeTokens } from "tamagui";
|
|
18
18
|
import type {
|
|
19
19
|
DataTableColumnType,
|
|
20
20
|
FacetedFilterOption,
|
|
@@ -31,6 +31,7 @@ import { t } from "../../shared/t";
|
|
|
31
31
|
import { useDataTableState } from "../DataTable/DataTableStateContext";
|
|
32
32
|
import { FilterChip } from "../DataTableFilterChips";
|
|
33
33
|
import { FilterOperatorValueEditor } from "../FilterOperatorValueEditor";
|
|
34
|
+
import { Text } from "@multiplatform.one/components";
|
|
34
35
|
|
|
35
36
|
export interface DataTableFiltersProps {
|
|
36
37
|
filters?: TableFilter[];
|
|
@@ -2,8 +2,9 @@ import { action } from "@multiplatform.one/storybook";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { formatCurrency } from "@multiplatform.one/theme";
|
|
4
4
|
import { Button } from "@multiplatform.one/forms";
|
|
5
|
-
import { Card,
|
|
5
|
+
import { Card, XStack, YStack } from "tamagui";
|
|
6
6
|
import { type AggregationConfig, DataTableGrouping, type GroupingConfig } from "./index";
|
|
7
|
+
import { Text } from "@multiplatform.one/components";
|
|
7
8
|
|
|
8
9
|
// Define the data type
|
|
9
10
|
type SalesRecord = {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
PlusIcon,
|
|
13
13
|
GearIcon,
|
|
14
14
|
} from "@phosphor-icons/react";
|
|
15
|
-
import { useDirection } from "@multiplatform.one/components";
|
|
15
|
+
import { useDirection, Text } from "@multiplatform.one/components";
|
|
16
16
|
import {
|
|
17
17
|
ensureFocusVisibleRing,
|
|
18
18
|
formatNumber,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from "@multiplatform.one/theme";
|
|
27
27
|
import { useCallback, useMemo, useState } from "react";
|
|
28
28
|
import { Button, FloatingPanel, Select } from "@multiplatform.one/forms";
|
|
29
|
-
import { Separator, Text, View, XStack, YStack, isWeb } from "tamagui";
|
|
29
|
+
import { Separator, Text as TamaguiText, View, XStack, YStack, isWeb } from "tamagui";
|
|
30
30
|
import { getViewLeafRows } from "../../utils/viewData";
|
|
31
31
|
import { iconSizeForToken } from "../../utils/chromeIcons";
|
|
32
32
|
import { useDataTableState } from "../DataTable/DataTableStateContext";
|
|
@@ -114,8 +114,11 @@ const groupMetaSizeMap: Record<string, string> = {
|
|
|
114
114
|
// generated recipe's icon channel (lossless vs the old $3/$4/$5 map).
|
|
115
115
|
const groupIconSize = (token: string): number => iconSizeForToken(token);
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
// LC-148: keyed by the resolved stop, since web draws small and medium alike at 1px.
|
|
118
|
+
const groupStartRailWidth: Record<string, number> = { none: 0, small: 2, medium: 4, large: 8 };
|
|
119
|
+
|
|
120
|
+
function groupStartRail(stop: string) {
|
|
121
|
+
const width = groupStartRailWidth[stop] ?? 4;
|
|
119
122
|
return isWeb
|
|
120
123
|
? {
|
|
121
124
|
borderInlineStartWidth: width,
|
|
@@ -394,7 +397,7 @@ function GroupHeader<T = any>({
|
|
|
394
397
|
return (
|
|
395
398
|
<XStack
|
|
396
399
|
{...corners}
|
|
397
|
-
{...groupStartRail(
|
|
400
|
+
{...groupStartRail(knobProps.borderWidthStop)}
|
|
398
401
|
alignItems="center"
|
|
399
402
|
gap="$2"
|
|
400
403
|
minHeight={44}
|
|
@@ -432,9 +435,9 @@ function GroupHeader<T = any>({
|
|
|
432
435
|
|
|
433
436
|
<XStack flex={1} alignItems="center" justifyContent="space-between" gap="$3" flexWrap="wrap">
|
|
434
437
|
<XStack alignItems="center" gap="$2" flexShrink={1} minWidth={0}>
|
|
435
|
-
<
|
|
438
|
+
<TamaguiText {...knobProps.label} fontWeight="400" numberOfLines={1}>
|
|
436
439
|
{label}
|
|
437
|
-
</
|
|
440
|
+
</TamaguiText>
|
|
438
441
|
<Text fontSize={metaSize} color="$color11">
|
|
439
442
|
({countLabel})
|
|
440
443
|
</Text>
|
|
@@ -447,9 +450,9 @@ function GroupHeader<T = any>({
|
|
|
447
450
|
<Text fontSize={metaSize} color="$color11">
|
|
448
451
|
{`${agg.label || `${agg.function}(${agg.column})`}:`}
|
|
449
452
|
</Text>
|
|
450
|
-
<
|
|
453
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
451
454
|
{formatAggregateValue(group.aggregations[agg.column]?.[agg.function], agg)}
|
|
452
|
-
</
|
|
455
|
+
</TamaguiText>
|
|
453
456
|
</XStack>
|
|
454
457
|
))}
|
|
455
458
|
</XStack>
|
|
@@ -649,9 +652,9 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
649
652
|
minWidth={20}
|
|
650
653
|
alignItems="center"
|
|
651
654
|
>
|
|
652
|
-
<
|
|
655
|
+
<TamaguiText {...knobProps.label} fontWeight="400" color="$color12">
|
|
653
656
|
{currentConfig.columns.length + currentConfig.aggregations.length}
|
|
654
|
-
</
|
|
657
|
+
</TamaguiText>
|
|
655
658
|
</View>
|
|
656
659
|
)}
|
|
657
660
|
</XStack>
|
|
@@ -676,16 +679,16 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
676
679
|
maxWidth={popoverMaxWidth}
|
|
677
680
|
data-dismiss-class="compose"
|
|
678
681
|
>
|
|
679
|
-
<
|
|
682
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
680
683
|
Grouping & Aggregation
|
|
681
|
-
</
|
|
684
|
+
</TamaguiText>
|
|
682
685
|
|
|
683
686
|
{/* Group By Section */}
|
|
684
687
|
<YStack gap="$3">
|
|
685
688
|
<XStack justifyContent="space-between" alignItems="center">
|
|
686
|
-
<
|
|
689
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
687
690
|
Group By
|
|
688
|
-
</
|
|
691
|
+
</TamaguiText>
|
|
689
692
|
<Text fontSize="$2" color="$color10">
|
|
690
693
|
{currentConfig.columns.length} selected
|
|
691
694
|
</Text>
|
|
@@ -768,9 +771,9 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
768
771
|
{/* Aggregation Section */}
|
|
769
772
|
<YStack gap="$3">
|
|
770
773
|
<XStack justifyContent="space-between" alignItems="center">
|
|
771
|
-
<
|
|
774
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
772
775
|
Aggregations
|
|
773
|
-
</
|
|
776
|
+
</TamaguiText>
|
|
774
777
|
<Text fontSize="$2" color="$color10">
|
|
775
778
|
{currentConfig.aggregations.length} configured
|
|
776
779
|
</Text>
|
|
@@ -906,9 +909,9 @@ function AggregationSelector<T = any>({ columns, onAddAggregation }: Aggregation
|
|
|
906
909
|
|
|
907
910
|
return (
|
|
908
911
|
<YStack gap="$2">
|
|
909
|
-
<
|
|
912
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
910
913
|
Add Aggregation
|
|
911
|
-
</
|
|
914
|
+
</TamaguiText>
|
|
912
915
|
|
|
913
916
|
<XStack gap="$2" alignItems="flex-end">
|
|
914
917
|
<View flex={1}>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Card } from "@multiplatform.one/components";
|
|
1
|
+
import { Card, Text } from "@multiplatform.one/components";
|
|
2
2
|
import { action } from "@multiplatform.one/storybook";
|
|
3
3
|
import type { GuardrailSpecimenParameter } from "@multiplatform.one/theme";
|
|
4
4
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
@@ -6,7 +6,7 @@ import React from "react";
|
|
|
6
6
|
import { within } from "storybook/test";
|
|
7
7
|
// Catalog Button + Input (LC-56 STORY-HONESTY — no raw interactive primitives).
|
|
8
8
|
import { Button, Input } from "@multiplatform.one/forms";
|
|
9
|
-
import { Text, View, XStack, YStack } from "tamagui";
|
|
9
|
+
import { Text as TamaguiText, View, XStack, YStack } from "tamagui";
|
|
10
10
|
import type {
|
|
11
11
|
DataTableColumn,
|
|
12
12
|
PageLoadQuery,
|
|
@@ -720,9 +720,14 @@ function InfiniteLoaderDemo({
|
|
|
720
720
|
>
|
|
721
721
|
<Text fontWeight="600">Loader log (page requests):</Text>
|
|
722
722
|
{log.map((entry, i) => (
|
|
723
|
-
<
|
|
723
|
+
<TamaguiText
|
|
724
|
+
key={i}
|
|
725
|
+
fontFamily="$mono"
|
|
726
|
+
fontSize="$2"
|
|
727
|
+
{...({ "data-log-entry": entry } as any)}
|
|
728
|
+
>
|
|
724
729
|
{entry}
|
|
725
|
-
</
|
|
730
|
+
</TamaguiText>
|
|
726
731
|
))}
|
|
727
732
|
</YStack>
|
|
728
733
|
</YStack>
|
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
SearchInput,
|
|
10
10
|
formCommonColors,
|
|
11
11
|
} from "@multiplatform.one/forms";
|
|
12
|
-
import { Separator, Text, View, XStack, YStack, isWeb } from "tamagui";
|
|
12
|
+
import { Separator, Text as TamaguiText, View, XStack, YStack, isWeb } from "tamagui";
|
|
13
13
|
import { useDataTableState } from "../DataTable/DataTableStateContext";
|
|
14
14
|
import { t } from "../../shared/t";
|
|
15
15
|
import { bidiIsolate } from "../../utils/withInterp";
|
|
16
|
+
import { Text } from "@multiplatform.one/components";
|
|
16
17
|
|
|
17
18
|
export interface SearchOptions {
|
|
18
19
|
searchTerm: string;
|
|
@@ -183,7 +184,7 @@ export function DataTableSearch<T = any>(props: DataTableSearchProps<T>) {
|
|
|
183
184
|
)}
|
|
184
185
|
|
|
185
186
|
{showStatus ? (
|
|
186
|
-
<
|
|
187
|
+
<TamaguiText
|
|
187
188
|
id={resultsId}
|
|
188
189
|
role="status"
|
|
189
190
|
aria-live="polite"
|
|
@@ -200,7 +201,7 @@ export function DataTableSearch<T = any>(props: DataTableSearchProps<T>) {
|
|
|
200
201
|
total: data.length,
|
|
201
202
|
}),
|
|
202
203
|
)}
|
|
203
|
-
</
|
|
204
|
+
</TamaguiText>
|
|
204
205
|
) : null}
|
|
205
206
|
</XStack>
|
|
206
207
|
);
|
|
@@ -273,14 +274,14 @@ function SearchOptionsPanel({
|
|
|
273
274
|
scrollable
|
|
274
275
|
>
|
|
275
276
|
<YStack {...knobProps.gapLg} minWidth={280} data-dismiss-class="compose">
|
|
276
|
-
<
|
|
277
|
+
<TamaguiText {...knobProps.heading} {...knobProps.label} fontWeight="400">
|
|
277
278
|
{t("Search Options")}
|
|
278
|
-
</
|
|
279
|
+
</TamaguiText>
|
|
279
280
|
|
|
280
281
|
<YStack {...knobProps.gap}>
|
|
281
|
-
<
|
|
282
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
282
283
|
{t("Search Settings")}
|
|
283
|
-
</
|
|
284
|
+
</TamaguiText>
|
|
284
285
|
|
|
285
286
|
<Checkbox
|
|
286
287
|
size="$3"
|
|
@@ -315,17 +316,17 @@ function SearchOptionsPanel({
|
|
|
315
316
|
|
|
316
317
|
<YStack {...knobProps.gap}>
|
|
317
318
|
<XStack justifyContent="space-between" alignItems="center">
|
|
318
|
-
<
|
|
319
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
319
320
|
{t("Search Columns")}
|
|
320
|
-
</
|
|
321
|
-
<
|
|
321
|
+
</TamaguiText>
|
|
322
|
+
<TamaguiText {...knobProps.label} color={formCommonColors.muted}>
|
|
322
323
|
{bidiIsolate(
|
|
323
324
|
t("{{selected}} of {{total}}", {
|
|
324
325
|
selected: selectedColumnCount,
|
|
325
326
|
total: totalColumnCount,
|
|
326
327
|
}),
|
|
327
328
|
)}
|
|
328
|
-
</
|
|
329
|
+
</TamaguiText>
|
|
329
330
|
</XStack>
|
|
330
331
|
|
|
331
332
|
<XStack {...knobProps.gap}>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { action } from "@multiplatform.one/storybook";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { formatAbsoluteDate } from "@multiplatform.one/theme";
|
|
4
|
-
import { Card,
|
|
4
|
+
import { Card, View, XStack, YStack } from "tamagui";
|
|
5
5
|
import type { TableView } from "../../types";
|
|
6
6
|
import { DataTableViewOptions } from "./index";
|
|
7
|
+
import { Text } from "@multiplatform.one/components";
|
|
7
8
|
|
|
8
9
|
// Columns definition
|
|
9
10
|
const allColumns = [
|
|
@@ -13,8 +13,16 @@ import {
|
|
|
13
13
|
} from "@multiplatform.one/theme";
|
|
14
14
|
import React, { useState } from "react";
|
|
15
15
|
import { Button, FloatingPanel, Input, Slider, Switch } from "@multiplatform.one/forms";
|
|
16
|
-
import { DropdownMenu, ScrollView } from "@multiplatform.one/components";
|
|
17
|
-
import {
|
|
16
|
+
import { DropdownMenu, ScrollView, Text } from "@multiplatform.one/components";
|
|
17
|
+
import {
|
|
18
|
+
Separator,
|
|
19
|
+
Text as TamaguiText,
|
|
20
|
+
View,
|
|
21
|
+
XStack,
|
|
22
|
+
YStack,
|
|
23
|
+
useTheme,
|
|
24
|
+
type SizeTokens,
|
|
25
|
+
} from "tamagui";
|
|
18
26
|
import type { TableView } from "../../types";
|
|
19
27
|
import { t } from "../../shared/t";
|
|
20
28
|
import { iconSizeForToken } from "../../utils/chromeIcons";
|
|
@@ -171,15 +179,14 @@ export function DataTableViewOptions(props: DataTableViewOptionsProps) {
|
|
|
171
179
|
{...knobProps.panelPadding}
|
|
172
180
|
{...knobProps.gap}
|
|
173
181
|
{...{ backgroundColor: "$background" }}
|
|
174
|
-
borderColor="$borderColor"
|
|
175
182
|
aria-label={t("Table view options")}
|
|
176
183
|
>
|
|
177
184
|
<XStack alignItems="center" justifyContent="space-between">
|
|
178
185
|
<XStack alignItems="center" gap="$2">
|
|
179
186
|
<GearIcon size={iconPx} />
|
|
180
|
-
<
|
|
187
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
181
188
|
{t("View Options")}
|
|
182
|
-
</
|
|
189
|
+
</TamaguiText>
|
|
183
190
|
</XStack>
|
|
184
191
|
|
|
185
192
|
<Button
|
|
@@ -273,16 +280,16 @@ function ColumnVisibilitySection({
|
|
|
273
280
|
const mutedIconColor = theme.color10?.get();
|
|
274
281
|
return (
|
|
275
282
|
<YStack {...knobProps.gap}>
|
|
276
|
-
<
|
|
283
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
277
284
|
{t("Column Visibility")}
|
|
278
|
-
</
|
|
285
|
+
</TamaguiText>
|
|
279
286
|
|
|
280
287
|
{/* Visible Columns */}
|
|
281
288
|
{visibleColumns.length > 0 && (
|
|
282
289
|
<YStack gap="$2">
|
|
283
|
-
<
|
|
290
|
+
<TamaguiText {...knobProps.label} fontWeight="400" color="$color10">
|
|
284
291
|
{t("Visible Columns")}
|
|
285
|
-
</
|
|
292
|
+
</TamaguiText>
|
|
286
293
|
<YStack gap="$1">
|
|
287
294
|
{visibleColumns.map((column) => (
|
|
288
295
|
<XStack key={column.id} alignItems="center" justifyContent="space-between">
|
|
@@ -308,9 +315,9 @@ function ColumnVisibilitySection({
|
|
|
308
315
|
{/* Hidden Columns */}
|
|
309
316
|
{hiddenColumns.length > 0 && (
|
|
310
317
|
<YStack gap="$2">
|
|
311
|
-
<
|
|
318
|
+
<TamaguiText {...knobProps.label} fontWeight="400" color="$color10">
|
|
312
319
|
{t("Hidden Columns")}
|
|
313
|
-
</
|
|
320
|
+
</TamaguiText>
|
|
314
321
|
<YStack gap="$1">
|
|
315
322
|
{hiddenColumns.map((column) => (
|
|
316
323
|
<XStack key={column.id} alignItems="center" justifyContent="space-between">
|
|
@@ -357,16 +364,16 @@ function ColumnResizingSection({
|
|
|
357
364
|
const { knobProps } = useResolvedKnobs();
|
|
358
365
|
return (
|
|
359
366
|
<YStack gap="$3">
|
|
360
|
-
<
|
|
367
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
361
368
|
{t("Column Widths")}
|
|
362
|
-
</
|
|
369
|
+
</TamaguiText>
|
|
363
370
|
|
|
364
371
|
<YStack gap="$3">
|
|
365
372
|
{columns.map((column) => (
|
|
366
373
|
<YStack key={column.id} gap="$2">
|
|
367
|
-
<
|
|
374
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
368
375
|
{column.label}
|
|
369
|
-
</
|
|
376
|
+
</TamaguiText>
|
|
370
377
|
<XStack alignItems="center" gap="$3">
|
|
371
378
|
<View flex={1}>
|
|
372
379
|
<Slider
|
|
@@ -419,9 +426,9 @@ function ViewManagementSection({
|
|
|
419
426
|
|
|
420
427
|
return (
|
|
421
428
|
<YStack gap="$3">
|
|
422
|
-
<
|
|
429
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
423
430
|
{t("Saved Views")}
|
|
424
|
-
</
|
|
431
|
+
</TamaguiText>
|
|
425
432
|
|
|
426
433
|
{/* Save Current View */}
|
|
427
434
|
<FloatingPanel
|
|
@@ -434,9 +441,9 @@ function ViewManagementSection({
|
|
|
434
441
|
}
|
|
435
442
|
>
|
|
436
443
|
<YStack gap="$3" minWidth={250} data-dismiss-class="compose">
|
|
437
|
-
<
|
|
444
|
+
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
438
445
|
{t("Save View")}
|
|
439
|
-
</
|
|
446
|
+
</TamaguiText>
|
|
440
447
|
<Input
|
|
441
448
|
placeholder={t("Enter view name...")}
|
|
442
449
|
value={viewName}
|
|
@@ -3,7 +3,7 @@ import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { Button, Checkbox, Input } from "@multiplatform.one/forms";
|
|
6
|
-
import {
|
|
6
|
+
import { XStack, YStack } from "tamagui";
|
|
7
7
|
import { t } from "../shared/t";
|
|
8
8
|
import {
|
|
9
9
|
KnobDialog,
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
KnobDialogDescription,
|
|
14
14
|
KnobDialogClose,
|
|
15
15
|
} from "./KnobDialog";
|
|
16
|
+
import { Text } from "@multiplatform.one/components";
|
|
16
17
|
|
|
17
18
|
export interface FilterManagerProps {
|
|
18
19
|
currentFilters: Array<[string, string, any]>;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { action } from "@multiplatform.one/storybook";
|
|
10
10
|
import type { Meta } from "@storybook/react-native-web-vite";
|
|
11
11
|
import React, { useState } from "react";
|
|
12
|
-
import { Card,
|
|
12
|
+
import { Card, XStack, YStack } from "tamagui";
|
|
13
13
|
import type { DataTableColumnType, FilterOperator } from "../../types";
|
|
14
14
|
import {
|
|
15
15
|
defaultOperatorForFilterType,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
operatorNeedsNoValue,
|
|
18
18
|
} from "../../utils/filterFields";
|
|
19
19
|
import { FilterOperatorValueEditor } from "./index";
|
|
20
|
+
import { Text } from "@multiplatform.one/components";
|
|
20
21
|
|
|
21
22
|
const meta: Meta<typeof FilterOperatorValueEditor> = {
|
|
22
23
|
title: "Table/FilterOperatorValueEditor",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import type { Meta } from "@storybook/react-native-web-vite";
|
|
8
8
|
import { useState } from "react";
|
|
9
9
|
import { Button } from "@multiplatform.one/forms";
|
|
10
|
-
import {
|
|
10
|
+
import { XStack, YStack } from "tamagui";
|
|
11
11
|
import {
|
|
12
12
|
KnobDialog,
|
|
13
13
|
KnobDialogClose,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
KnobDialogTitle,
|
|
17
17
|
KnobDialogTrigger,
|
|
18
18
|
} from "./KnobDialog";
|
|
19
|
+
import { Paragraph } from "@multiplatform.one/components";
|
|
19
20
|
|
|
20
21
|
const meta: Meta = {
|
|
21
22
|
title: "Table/KnobDialog",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PageHeader, PageSection, Screen } from "@multiplatform.one/components";
|
|
1
2
|
import { useState } from "react";
|
|
2
3
|
import { SimpleTable, type SimpleTableColumn, type SimpleTableProps } from "./index";
|
|
3
4
|
|
|
@@ -38,6 +39,33 @@ export const phoneReport = () => (
|
|
|
38
39
|
/>
|
|
39
40
|
);
|
|
40
41
|
|
|
42
|
+
/**
|
|
43
|
+
* LC-146 on a phone page: the grid and the cards drop the page gutter and run
|
|
44
|
+
* edge to edge, their first and last cells carrying it, so text stays on the
|
|
45
|
+
* page line with the title. LC-144: odd rows stripe.
|
|
46
|
+
*/
|
|
47
|
+
export const onPhonePage = () => (
|
|
48
|
+
<Screen>
|
|
49
|
+
<PageHeader title="Pokemon" divider={false} />
|
|
50
|
+
<PageSection title="Report">
|
|
51
|
+
<SimpleTable
|
|
52
|
+
layout="table"
|
|
53
|
+
aria-label="Pokemon report"
|
|
54
|
+
columns={[
|
|
55
|
+
{ accessorKey: "name", header: "Pokemon Name" },
|
|
56
|
+
{ accessorKey: "id", header: "Poke ID" },
|
|
57
|
+
{ accessorKey: "weight", header: "Weight" },
|
|
58
|
+
]}
|
|
59
|
+
data={[...pokemonData, { name: "Pidgey", id: 16, weight: 18, height: 3 }]}
|
|
60
|
+
/>
|
|
61
|
+
</PageSection>
|
|
62
|
+
<PageSection title="Cards">
|
|
63
|
+
<SimpleTable layout="cards" aria-label="People" columns={peopleColumns} data={peopleData} />
|
|
64
|
+
</PageSection>
|
|
65
|
+
</Screen>
|
|
66
|
+
);
|
|
67
|
+
onPhonePage.parameters = { viewport: { defaultViewport: "mobile1" }, layout: "fullscreen" };
|
|
68
|
+
|
|
41
69
|
export const pinnedOverflow = () => (
|
|
42
70
|
<SimpleTable
|
|
43
71
|
layout="table"
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
useResolvedKnobs,
|
|
16
16
|
type DisabledRecipe,
|
|
17
17
|
transitionProps,
|
|
18
|
+
usePhoneTableBleed,
|
|
18
19
|
} from "@multiplatform.one/theme";
|
|
19
20
|
import { useCallback, useState, type ReactNode } from "react";
|
|
20
21
|
import type { LayoutChangeEvent } from "react-native";
|
|
@@ -25,7 +26,12 @@ import { resolveSimpleTableColumns, type SimpleTableColumn } from "./columnSizin
|
|
|
25
26
|
import { PinnedCell, ScrollFrame } from "./ScrollFrame";
|
|
26
27
|
export type { SimpleTableColumn, SimpleTableSizeToken } from "./columnSizing";
|
|
27
28
|
export { resolveSimpleTableColumns } from "./columnSizing";
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
Table,
|
|
31
|
+
phoneBleedListProps,
|
|
32
|
+
phoneBleedRowProps,
|
|
33
|
+
tableZebraFill,
|
|
34
|
+
} from "@multiplatform.one/table-primitives";
|
|
29
35
|
import type { DataTableLayout } from "../../types";
|
|
30
36
|
import { isInteractiveInnerTarget } from "../../utils/rowPress";
|
|
31
37
|
import { withInterp } from "../../utils/withInterp";
|
|
@@ -244,7 +250,11 @@ function useSimpleTableRowPress({
|
|
|
244
250
|
},
|
|
245
251
|
onBlur: (e: any) => {
|
|
246
252
|
const next = e.relatedTarget;
|
|
247
|
-
if (
|
|
253
|
+
if (
|
|
254
|
+
typeof Element === "undefined" ||
|
|
255
|
+
!(next instanceof Element) ||
|
|
256
|
+
!next.closest('[data-row-press="true"]')
|
|
257
|
+
) {
|
|
248
258
|
setRowPressAnchor(0);
|
|
249
259
|
}
|
|
250
260
|
},
|
|
@@ -325,6 +335,8 @@ function SimpleTableMobileCards({
|
|
|
325
335
|
disabled,
|
|
326
336
|
});
|
|
327
337
|
const tableZebraOn = knobProps.tableZebra === "on";
|
|
338
|
+
// LC-146: on the page line below `$sm` the cards run edge to edge.
|
|
339
|
+
const bleed = usePhoneTableBleed();
|
|
328
340
|
const [titleCol, ...detailCols] = columns;
|
|
329
341
|
const typeSize = knobProps.label.fontSize;
|
|
330
342
|
const motion = transitionProps(knobProps.motion.control);
|
|
@@ -351,9 +363,14 @@ function SimpleTableMobileCards({
|
|
|
351
363
|
flexDirection="column"
|
|
352
364
|
{...knobProps.gap}
|
|
353
365
|
{...(rowPressActive ? ({ "data-row-press-scope": "true" } as any) : {})}
|
|
366
|
+
{...(bleed ? { ...phoneBleedListProps(bleed), "data-phone-bleed": "true" } : {})}
|
|
354
367
|
>
|
|
355
368
|
{caption ? (
|
|
356
|
-
<Text
|
|
369
|
+
<Text
|
|
370
|
+
{...knobProps.label}
|
|
371
|
+
color={knobProps.textAccentColor}
|
|
372
|
+
{...(bleed ? { paddingHorizontal: bleed.inset } : {})}
|
|
373
|
+
>
|
|
357
374
|
{caption}
|
|
358
375
|
</Text>
|
|
359
376
|
) : null}
|
|
@@ -370,11 +387,12 @@ function SimpleTableMobileCards({
|
|
|
370
387
|
testID="simple-table-card"
|
|
371
388
|
{...knobProps.surface}
|
|
372
389
|
{...knobProps.cardSurface}
|
|
373
|
-
elevation
|
|
390
|
+
{...(bleed ? {} : { elevation: knobProps.elevation })}
|
|
374
391
|
{...(tableZebraOn && rowIndex % 2 === 1
|
|
375
392
|
? { backgroundColor: tableZebraFill(knobProps.cardSurface.backgroundColor) }
|
|
376
393
|
: {})}
|
|
377
394
|
{...(intent ? { theme: intent, backgroundColor: "$color3" as const } : {})}
|
|
395
|
+
{...(bleed ? phoneBleedRowProps(bleed.inset) : {})}
|
|
378
396
|
{...(disabled ? {} : { hoverStyle: { backgroundColor: "$backgroundHover" } })}
|
|
379
397
|
{...motion}
|
|
380
398
|
{...disabledChrome(Boolean(disabled), disabledState)}
|
|
@@ -486,10 +504,14 @@ export function SimpleTableDesktop({
|
|
|
486
504
|
const motion = transitionProps(knobProps.motion.control);
|
|
487
505
|
const pad = cellPad(knobProps.gap.gap);
|
|
488
506
|
const frameBorder = knobProps.surface.borderWidth;
|
|
507
|
+
// LC-146: a grid pinned on a phone scrolls edge to edge; its first and last
|
|
508
|
+
// cells carry the page gutter.
|
|
509
|
+
const bleed = usePhoneTableBleed();
|
|
489
510
|
|
|
490
511
|
return (
|
|
491
512
|
<View
|
|
492
513
|
minWidth={0}
|
|
514
|
+
{...(bleed ? bleed.frame : {})}
|
|
493
515
|
onLayout={(event) => {
|
|
494
516
|
setViewportWidth(Math.max(0, event.nativeEvent.layout.width - frameBorder * 2));
|
|
495
517
|
onLayout?.(event);
|
|
@@ -501,6 +523,7 @@ export function SimpleTableDesktop({
|
|
|
501
523
|
displayMode="flex"
|
|
502
524
|
width={tableWidth}
|
|
503
525
|
minWidth={tableWidth}
|
|
526
|
+
edgeInset={bleed?.inset ?? null}
|
|
504
527
|
{...({
|
|
505
528
|
overflow: "visible",
|
|
506
529
|
"data-simple-table-frame": "true",
|
|
@@ -224,7 +224,7 @@ describe("SimpleTable", () => {
|
|
|
224
224
|
expect(container.textContent).toContain("No data available");
|
|
225
225
|
});
|
|
226
226
|
|
|
227
|
-
it("stripes rows when tableZebra is on and
|
|
227
|
+
it("stripes rows when tableZebra is on and not when it is off", () => {
|
|
228
228
|
const columns: SimpleTableColumn[] = [
|
|
229
229
|
{ accessorKey: "name", header: "Name" },
|
|
230
230
|
{ accessorKey: "age", header: "Age" },
|
|
@@ -19,9 +19,10 @@ import { fn } from "storybook/test";
|
|
|
19
19
|
import { useForm } from "@tanstack/react-form";
|
|
20
20
|
import { FieldLayout } from "@multiplatform.one/forms";
|
|
21
21
|
import React from "react";
|
|
22
|
-
import { Text, View, YStack } from "tamagui";
|
|
22
|
+
import { Text as TamaguiText, View, YStack } from "tamagui";
|
|
23
23
|
import type { DataTableColumn, DataTableData } from "../../types";
|
|
24
24
|
import { TableInput } from "./index";
|
|
25
|
+
import { Text } from "@multiplatform.one/components";
|
|
25
26
|
|
|
26
27
|
interface LineItem extends DataTableData {
|
|
27
28
|
id: string;
|
|
@@ -166,9 +167,9 @@ const ControlledTableInput = ({
|
|
|
166
167
|
onCellChange={onCellChange}
|
|
167
168
|
{...rest}
|
|
168
169
|
/>
|
|
169
|
-
<
|
|
170
|
+
<TamaguiText testID="tableinput-data" fontSize="$2" color="$color10" fontFamily="$mono">
|
|
170
171
|
rows: {data.length} · data: {JSON.stringify(data)}
|
|
171
|
-
</
|
|
172
|
+
</TamaguiText>
|
|
172
173
|
</YStack>
|
|
173
174
|
);
|
|
174
175
|
};
|
|
@@ -264,9 +265,9 @@ const InsideFormStory = () => {
|
|
|
264
265
|
aria-label="Line items"
|
|
265
266
|
/>
|
|
266
267
|
</FieldLayout>
|
|
267
|
-
<
|
|
268
|
+
<TamaguiText testID="form-value" fontSize="$2" color="$color10" fontFamily="$mono">
|
|
268
269
|
form.lineItems: {JSON.stringify(form.state.values.lineItems?.map((row) => row.item))}
|
|
269
|
-
</
|
|
270
|
+
</TamaguiText>
|
|
270
271
|
</YStack>
|
|
271
272
|
);
|
|
272
273
|
};
|