@multiplatform.one/table 7.75.0 → 7.77.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/DataTableRoot.cjs +4 -5
- package/dist/cjs/components/DataTable/DataTableRoot.native.js +4 -5
- package/dist/cjs/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/cjs/components/DataTable/index.native.js +4 -5
- package/dist/cjs/components/DataTable/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.cjs +4 -4
- package/dist/cjs/components/DataTableFilterButton/index.native.js +4 -4
- package/dist/cjs/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilters/index.cjs +4 -5
- package/dist/cjs/components/DataTableFilters/index.native.js +4 -5
- package/dist/cjs/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableViewOptions/index.cjs +3 -7
- package/dist/cjs/components/DataTableViewOptions/index.native.js +3 -7
- package/dist/cjs/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/cjs/components/FilterManager.cjs +6 -10
- package/dist/cjs/components/FilterManager.native.js +6 -10
- package/dist/cjs/components/FilterManager.native.js.map +1 -1
- package/dist/cjs/components/TableInput/index.cjs +4 -7
- package/dist/cjs/components/TableInput/index.native.js +4 -7
- package/dist/cjs/components/TableInput/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.mjs +6 -7
- package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.native.js +6 -7
- package/dist/esm/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/esm/components/DataTable/index.native.js +6 -7
- package/dist/esm/components/DataTable/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.mjs +5 -5
- package/dist/esm/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.native.js +5 -5
- package/dist/esm/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilters/index.mjs +4 -5
- package/dist/esm/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilters/index.native.js +4 -5
- package/dist/esm/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.mjs +4 -8
- package/dist/esm/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.native.js +4 -8
- package/dist/esm/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/esm/components/FilterManager.mjs +7 -11
- package/dist/esm/components/FilterManager.mjs.map +1 -1
- package/dist/esm/components/FilterManager.native.js +7 -11
- package/dist/esm/components/FilterManager.native.js.map +1 -1
- package/dist/esm/components/TableInput/index.mjs +5 -8
- package/dist/esm/components/TableInput/index.mjs.map +1 -1
- package/dist/esm/components/TableInput/index.native.js +5 -8
- package/dist/esm/components/TableInput/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.mjs +6 -7
- package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.native.js +4 -5
- package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/jsx/components/DataTable/index.native.js +4 -5
- package/dist/jsx/components/DataTable/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.mjs +5 -5
- package/dist/jsx/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js +4 -4
- package/dist/jsx/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.mjs +4 -5
- package/dist/jsx/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.native.js +4 -5
- package/dist/jsx/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.mjs +4 -8
- package/dist/jsx/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.native.js +3 -7
- package/dist/jsx/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/jsx/components/FilterManager.mjs +7 -11
- package/dist/jsx/components/FilterManager.mjs.map +1 -1
- package/dist/jsx/components/FilterManager.native.js +6 -10
- package/dist/jsx/components/FilterManager.native.js.map +1 -1
- package/dist/jsx/components/TableInput/index.mjs +5 -8
- package/dist/jsx/components/TableInput/index.mjs.map +1 -1
- package/dist/jsx/components/TableInput/index.native.js +4 -7
- package/dist/jsx/components/TableInput/index.native.js.map +1 -1
- package/package.json +12 -12
- package/src/components/ChildTable/ChildTable.stories.tsx +4 -3
- package/src/components/DataTable/DataTable.stories.tsx +38 -46
- package/src/components/DataTable/DataTableRoot.tsx +5 -7
- package/src/components/DataTable/FieldsInCells.stories.tsx +4 -4
- package/src/components/DataTable/index.native.tsx +5 -7
- package/src/components/DataTableFilterButton/index.tsx +12 -4
- package/src/components/DataTableFilters/index.tsx +4 -6
- package/src/components/DataTableViewOptions/index.tsx +2 -7
- package/src/components/FilterManager.spec.tsx +4 -5
- package/src/components/FilterManager.tsx +7 -13
- package/src/components/TableInput/TableInput.stories.tsx +4 -4
- package/src/components/TableInput/index.native.tsx +5 -6
- package/src/components/TableInput/index.tsx +5 -6
- package/src/components/phoneCardPolish.spec.tsx +4 -1
- package/src/components/tableDropdowns.spec.tsx +1 -1
- package/types/components/DataTable/DataTableRoot.d.ts.map +1 -1
- package/types/components/DataTable/index.native.d.ts.map +1 -1
- package/types/components/DataTableFilterButton/index.d.ts.map +1 -1
- package/types/components/FilterManager.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
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
formatCurrency,
|
|
9
9
|
type GuardrailSpecimenParameter,
|
|
10
10
|
useLayoutSizeClass,
|
|
11
|
-
usePageGutter,
|
|
12
11
|
} from "@multiplatform.one/theme";
|
|
13
12
|
import { Button } from "@multiplatform.one/forms";
|
|
14
13
|
import {
|
|
15
14
|
ActionButton,
|
|
16
15
|
Avatar,
|
|
16
|
+
GutterFrame,
|
|
17
17
|
PageHeader,
|
|
18
18
|
PageSection,
|
|
19
19
|
Screen,
|
|
@@ -46,28 +46,20 @@ const meta: Meta<typeof DataTable> = {
|
|
|
46
46
|
onDataChange: fn(),
|
|
47
47
|
},
|
|
48
48
|
// A story that renders its own Screen owns the page gutter; padding it here
|
|
49
|
-
// too put its cards two gutters in from the screen edge (FZ-7889).
|
|
49
|
+
// too put its cards two gutters in from the screen edge (FZ-7889). Every
|
|
50
|
+
// other story takes the gutter once: its host's, or its own (FZ-7993).
|
|
50
51
|
decorators: [
|
|
51
52
|
(Story, context) =>
|
|
52
53
|
context.parameters?.pageShell ? (
|
|
53
54
|
<Story />
|
|
54
55
|
) : (
|
|
55
|
-
<
|
|
56
|
+
<GutterFrame flex={1} width="100%">
|
|
56
57
|
<Story />
|
|
57
|
-
</
|
|
58
|
+
</GutterFrame>
|
|
58
59
|
),
|
|
59
60
|
],
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
function StoryGutter({ children }: { children: React.ReactNode }) {
|
|
63
|
-
if (usePageGutter() !== null) return <>{children}</>;
|
|
64
|
-
return (
|
|
65
|
-
<View flex={1} padding="$4" width="100%">
|
|
66
|
-
{children}
|
|
67
|
-
</View>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
63
|
export default meta;
|
|
72
64
|
type Story = StoryObj<typeof DataTable>;
|
|
73
65
|
|
|
@@ -321,7 +313,7 @@ const AdvancedTableStory = () => {
|
|
|
321
313
|
}, [data]);
|
|
322
314
|
|
|
323
315
|
return (
|
|
324
|
-
<View flex={1}
|
|
316
|
+
<View flex={1}>
|
|
325
317
|
<YStack gap="$3">
|
|
326
318
|
{desktop ? (
|
|
327
319
|
<YStack gap="$1">
|
|
@@ -382,7 +374,7 @@ const SimpleTableStory = () => {
|
|
|
382
374
|
const simpleColumns = columns.slice(1, 6);
|
|
383
375
|
|
|
384
376
|
return (
|
|
385
|
-
<View flex={1}
|
|
377
|
+
<View flex={1}>
|
|
386
378
|
<DataTable
|
|
387
379
|
data={data}
|
|
388
380
|
columns={simpleColumns}
|
|
@@ -936,7 +928,7 @@ const EditableTableStory = () => {
|
|
|
936
928
|
const [data, setData] = React.useState(editableData);
|
|
937
929
|
|
|
938
930
|
return (
|
|
939
|
-
<View flex={1}
|
|
931
|
+
<View flex={1}>
|
|
940
932
|
<DataTable
|
|
941
933
|
data={data}
|
|
942
934
|
columns={editableColumns as DataTableColumn<Record<string, any>>[]}
|
|
@@ -1200,7 +1192,7 @@ const AllFieldTypesEditableStory = () => {
|
|
|
1200
1192
|
const [data, setData] = React.useState(allFieldsData);
|
|
1201
1193
|
|
|
1202
1194
|
return (
|
|
1203
|
-
<YStack gap="$4" flex={1}
|
|
1195
|
+
<YStack gap="$4" flex={1}>
|
|
1204
1196
|
<YStack gap="$2">
|
|
1205
1197
|
<Text fontSize="$6" fontWeight="bold">
|
|
1206
1198
|
All Field Types - Editable
|
|
@@ -1248,7 +1240,7 @@ export const AllFieldTypesEditable: Story = {
|
|
|
1248
1240
|
// Story: All Field Types Read-Only
|
|
1249
1241
|
const AllFieldTypesReadOnlyStory = () => {
|
|
1250
1242
|
return (
|
|
1251
|
-
<YStack gap="$4" flex={1}
|
|
1243
|
+
<YStack gap="$4" flex={1}>
|
|
1252
1244
|
<YStack gap="$2">
|
|
1253
1245
|
<Text fontSize="$6" fontWeight="bold">
|
|
1254
1246
|
All Field Types - Read Only
|
|
@@ -1299,7 +1291,7 @@ const textFieldColumns: DataTableColumn<TextFieldRow>[] = [
|
|
|
1299
1291
|
const TextFieldStory = () => {
|
|
1300
1292
|
const [data, setData] = React.useState(textFieldData);
|
|
1301
1293
|
return (
|
|
1302
|
-
<YStack gap="$4" flex={1}
|
|
1294
|
+
<YStack gap="$4" flex={1}>
|
|
1303
1295
|
<Text fontSize="$5" fontWeight="bold">
|
|
1304
1296
|
Text Field Type
|
|
1305
1297
|
</Text>
|
|
@@ -1355,7 +1347,7 @@ const numberFieldColumns: DataTableColumn<NumberFieldRow>[] = [
|
|
|
1355
1347
|
const NumberFieldStory = () => {
|
|
1356
1348
|
const [data, setData] = React.useState(numberFieldData);
|
|
1357
1349
|
return (
|
|
1358
|
-
<YStack gap="$4" flex={1}
|
|
1350
|
+
<YStack gap="$4" flex={1}>
|
|
1359
1351
|
<Text fontSize="$5" fontWeight="bold">
|
|
1360
1352
|
Number Field Type
|
|
1361
1353
|
</Text>
|
|
@@ -1449,7 +1441,7 @@ const selectFieldColumns: DataTableColumn<SelectFieldRow>[] = [
|
|
|
1449
1441
|
const SelectFieldStory = () => {
|
|
1450
1442
|
const [data, setData] = React.useState(selectFieldData);
|
|
1451
1443
|
return (
|
|
1452
|
-
<YStack gap="$4" flex={1}
|
|
1444
|
+
<YStack gap="$4" flex={1}>
|
|
1453
1445
|
<Text fontSize="$5" fontWeight="bold">
|
|
1454
1446
|
Select Field Type
|
|
1455
1447
|
</Text>
|
|
@@ -1500,7 +1492,7 @@ const checkboxFieldColumns: DataTableColumn<CheckboxFieldRow>[] = [
|
|
|
1500
1492
|
const CheckboxFieldStory = () => {
|
|
1501
1493
|
const [data, setData] = React.useState(checkboxFieldData);
|
|
1502
1494
|
return (
|
|
1503
|
-
<YStack gap="$4" flex={1}
|
|
1495
|
+
<YStack gap="$4" flex={1}>
|
|
1504
1496
|
<Text fontSize="$5" fontWeight="bold">
|
|
1505
1497
|
Checkbox Field Type
|
|
1506
1498
|
</Text>
|
|
@@ -1551,7 +1543,7 @@ const switchFieldColumns: DataTableColumn<SwitchFieldRow>[] = [
|
|
|
1551
1543
|
const SwitchFieldStory = () => {
|
|
1552
1544
|
const [data, setData] = React.useState(switchFieldData);
|
|
1553
1545
|
return (
|
|
1554
|
-
<YStack gap="$4" flex={1}
|
|
1546
|
+
<YStack gap="$4" flex={1}>
|
|
1555
1547
|
<Text fontSize="$5" fontWeight="bold">
|
|
1556
1548
|
Switch Field Type
|
|
1557
1549
|
</Text>
|
|
@@ -1602,7 +1594,7 @@ const dateTimeFieldColumns: DataTableColumn<DateTimeFieldRow>[] = [
|
|
|
1602
1594
|
const DateTimeFieldStory = () => {
|
|
1603
1595
|
const [data, setData] = React.useState(dateTimeFieldData);
|
|
1604
1596
|
return (
|
|
1605
|
-
<YStack gap="$4" flex={1}
|
|
1597
|
+
<YStack gap="$4" flex={1}>
|
|
1606
1598
|
<Text fontSize="$5" fontWeight="bold">
|
|
1607
1599
|
Date/Time Field Types
|
|
1608
1600
|
</Text>
|
|
@@ -1653,7 +1645,7 @@ const durationFieldColumns: DataTableColumn<DurationFieldRow>[] = [
|
|
|
1653
1645
|
const DurationFieldStory = () => {
|
|
1654
1646
|
const [data, setData] = React.useState(durationFieldData);
|
|
1655
1647
|
return (
|
|
1656
|
-
<YStack gap="$4" flex={1}
|
|
1648
|
+
<YStack gap="$4" flex={1}>
|
|
1657
1649
|
<Text fontSize="$5" fontWeight="bold">
|
|
1658
1650
|
Duration Field Type
|
|
1659
1651
|
</Text>
|
|
@@ -1704,7 +1696,7 @@ const colorFieldColumns: DataTableColumn<ColorFieldRow>[] = [
|
|
|
1704
1696
|
const ColorFieldStory = () => {
|
|
1705
1697
|
const [data, setData] = React.useState(colorFieldData);
|
|
1706
1698
|
return (
|
|
1707
|
-
<YStack gap="$4" flex={1}
|
|
1699
|
+
<YStack gap="$4" flex={1}>
|
|
1708
1700
|
<Text fontSize="$5" fontWeight="bold">
|
|
1709
1701
|
Color Field Type
|
|
1710
1702
|
</Text>
|
|
@@ -1755,7 +1747,7 @@ const ratingFieldColumns: DataTableColumn<RatingFieldRow>[] = [
|
|
|
1755
1747
|
const RatingFieldStory = () => {
|
|
1756
1748
|
const [data, setData] = React.useState(ratingFieldData);
|
|
1757
1749
|
return (
|
|
1758
|
-
<YStack gap="$4" flex={1}
|
|
1750
|
+
<YStack gap="$4" flex={1}>
|
|
1759
1751
|
<Text fontSize="$5" fontWeight="bold">
|
|
1760
1752
|
Rating Field Type
|
|
1761
1753
|
</Text>
|
|
@@ -1806,7 +1798,7 @@ const phoneFieldColumns: DataTableColumn<PhoneFieldRow>[] = [
|
|
|
1806
1798
|
const PhoneFieldStory = () => {
|
|
1807
1799
|
const [data, setData] = React.useState(phoneFieldData);
|
|
1808
1800
|
return (
|
|
1809
|
-
<YStack gap="$4" flex={1}
|
|
1801
|
+
<YStack gap="$4" flex={1}>
|
|
1810
1802
|
<Text fontSize="$5" fontWeight="bold">
|
|
1811
1803
|
Phone Field Type
|
|
1812
1804
|
</Text>
|
|
@@ -1872,7 +1864,7 @@ const currencyFieldColumns: DataTableColumn<CurrencyFieldRow>[] = [
|
|
|
1872
1864
|
const CurrencyFieldStory = () => {
|
|
1873
1865
|
const [data, setData] = React.useState(currencyFieldData);
|
|
1874
1866
|
return (
|
|
1875
|
-
<YStack gap="$4" flex={1}
|
|
1867
|
+
<YStack gap="$4" flex={1}>
|
|
1876
1868
|
<Text fontSize="$5" fontWeight="bold">
|
|
1877
1869
|
Currency Field Type
|
|
1878
1870
|
</Text>
|
|
@@ -1923,7 +1915,7 @@ const percentFieldColumns: DataTableColumn<PercentFieldRow>[] = [
|
|
|
1923
1915
|
const PercentFieldStory = () => {
|
|
1924
1916
|
const [data, setData] = React.useState(percentFieldData);
|
|
1925
1917
|
return (
|
|
1926
|
-
<YStack gap="$4" flex={1}
|
|
1918
|
+
<YStack gap="$4" flex={1}>
|
|
1927
1919
|
<Text fontSize="$5" fontWeight="bold">
|
|
1928
1920
|
Percent Field Type
|
|
1929
1921
|
</Text>
|
|
@@ -2013,7 +2005,7 @@ const comboboxFieldColumns: DataTableColumn<ComboboxFieldRow>[] = [
|
|
|
2013
2005
|
const ComboboxFieldStory = () => {
|
|
2014
2006
|
const [data, setData] = React.useState(comboboxFieldData);
|
|
2015
2007
|
return (
|
|
2016
|
-
<YStack gap="$4" flex={1}
|
|
2008
|
+
<YStack gap="$4" flex={1}>
|
|
2017
2009
|
<Text fontSize="$5" fontWeight="bold">
|
|
2018
2010
|
Combobox Field Type
|
|
2019
2011
|
</Text>
|
|
@@ -2097,7 +2089,7 @@ const linkFieldColumns: DataTableColumn<LinkFieldRow>[] = [
|
|
|
2097
2089
|
const LinkFieldStory = () => {
|
|
2098
2090
|
const [data, setData] = React.useState(linkFieldData);
|
|
2099
2091
|
return (
|
|
2100
|
-
<YStack gap="$4" flex={1}
|
|
2092
|
+
<YStack gap="$4" flex={1}>
|
|
2101
2093
|
<Text fontSize="$5" fontWeight="bold">
|
|
2102
2094
|
Link Field Type
|
|
2103
2095
|
</Text>
|
|
@@ -2186,7 +2178,7 @@ const customFieldColumns: DataTableColumn<CustomFieldRow>[] = [
|
|
|
2186
2178
|
const CustomFieldStory = () => {
|
|
2187
2179
|
const [data, setData] = React.useState(customFieldData);
|
|
2188
2180
|
return (
|
|
2189
|
-
<YStack gap="$4" flex={1}
|
|
2181
|
+
<YStack gap="$4" flex={1}>
|
|
2190
2182
|
<Text fontSize="$5" fontWeight="bold">
|
|
2191
2183
|
Custom Field Type
|
|
2192
2184
|
</Text>
|
|
@@ -2251,7 +2243,7 @@ const GlobalSearchStory = () => {
|
|
|
2251
2243
|
const [data] = React.useState(searchableData);
|
|
2252
2244
|
|
|
2253
2245
|
return (
|
|
2254
|
-
<YStack gap="$4" flex={1}
|
|
2246
|
+
<YStack gap="$4" flex={1}>
|
|
2255
2247
|
<YStack gap="$2">
|
|
2256
2248
|
<Text fontSize="$5" fontWeight="bold">
|
|
2257
2249
|
Global Search
|
|
@@ -2304,7 +2296,7 @@ const ServerSideSearchStory = () => {
|
|
|
2304
2296
|
}, []);
|
|
2305
2297
|
|
|
2306
2298
|
return (
|
|
2307
|
-
<YStack gap="$4" flex={1}
|
|
2299
|
+
<YStack gap="$4" flex={1}>
|
|
2308
2300
|
<YStack gap="$2">
|
|
2309
2301
|
<Text fontSize="$5" fontWeight="bold">
|
|
2310
2302
|
Server-Side Search (Simulated)
|
|
@@ -2377,7 +2369,7 @@ const textareaFieldColumns: DataTableColumn<TextareaFieldRow>[] = [
|
|
|
2377
2369
|
const TextareaFieldStory = () => {
|
|
2378
2370
|
const [data, setData] = React.useState(textareaFieldData);
|
|
2379
2371
|
return (
|
|
2380
|
-
<YStack gap="$4" flex={1}
|
|
2372
|
+
<YStack gap="$4" flex={1}>
|
|
2381
2373
|
<Text fontSize="$5" fontWeight="bold">
|
|
2382
2374
|
Textarea Field Type
|
|
2383
2375
|
</Text>
|
|
@@ -2438,7 +2430,7 @@ const signatureFieldColumns: DataTableColumn<SignatureFieldRow>[] = [
|
|
|
2438
2430
|
const SignatureFieldStory = () => {
|
|
2439
2431
|
const [data, setData] = React.useState(signatureFieldData);
|
|
2440
2432
|
return (
|
|
2441
|
-
<YStack gap="$4" flex={1}
|
|
2433
|
+
<YStack gap="$4" flex={1}>
|
|
2442
2434
|
<Text fontSize="$5" fontWeight="bold">
|
|
2443
2435
|
Signature Field Type
|
|
2444
2436
|
</Text>
|
|
@@ -2489,7 +2481,7 @@ const fileFieldColumns: DataTableColumn<FileFieldRow>[] = [
|
|
|
2489
2481
|
const FileFieldStory = () => {
|
|
2490
2482
|
const [data, setData] = React.useState(fileFieldData);
|
|
2491
2483
|
return (
|
|
2492
|
-
<YStack gap="$4" flex={1}
|
|
2484
|
+
<YStack gap="$4" flex={1}>
|
|
2493
2485
|
<Text fontSize="$5" fontWeight="bold">
|
|
2494
2486
|
File Field Type
|
|
2495
2487
|
</Text>
|
|
@@ -2540,7 +2532,7 @@ const imageFieldColumns: DataTableColumn<ImageFieldRow>[] = [
|
|
|
2540
2532
|
const ImageFieldStory = () => {
|
|
2541
2533
|
const [data, setData] = React.useState(imageFieldData);
|
|
2542
2534
|
return (
|
|
2543
|
-
<YStack gap="$4" flex={1}
|
|
2535
|
+
<YStack gap="$4" flex={1}>
|
|
2544
2536
|
<Text fontSize="$5" fontWeight="bold">
|
|
2545
2537
|
Image Field Type
|
|
2546
2538
|
</Text>
|
|
@@ -2606,7 +2598,7 @@ const geolocationFieldColumns: DataTableColumn<GeolocationFieldRow>[] = [
|
|
|
2606
2598
|
const GeolocationFieldStory = () => {
|
|
2607
2599
|
const [data, setData] = React.useState(geolocationFieldData);
|
|
2608
2600
|
return (
|
|
2609
|
-
<YStack gap="$4" flex={1}
|
|
2601
|
+
<YStack gap="$4" flex={1}>
|
|
2610
2602
|
<Text fontSize="$5" fontWeight="bold">
|
|
2611
2603
|
Geolocation Field Type
|
|
2612
2604
|
</Text>
|
|
@@ -2657,7 +2649,7 @@ const barcodeFieldColumns: DataTableColumn<BarcodeFieldRow>[] = [
|
|
|
2657
2649
|
const BarcodeFieldStory = () => {
|
|
2658
2650
|
const [data, setData] = React.useState(barcodeFieldData);
|
|
2659
2651
|
return (
|
|
2660
|
-
<YStack gap="$4" flex={1}
|
|
2652
|
+
<YStack gap="$4" flex={1}>
|
|
2661
2653
|
<Text fontSize="$5" fontWeight="bold">
|
|
2662
2654
|
Barcode Field Type
|
|
2663
2655
|
</Text>
|
|
@@ -2713,7 +2705,7 @@ const sliderFieldColumns: DataTableColumn<SliderFieldRow>[] = [
|
|
|
2713
2705
|
const SliderFieldStory = () => {
|
|
2714
2706
|
const [data, setData] = React.useState(sliderFieldData);
|
|
2715
2707
|
return (
|
|
2716
|
-
<YStack gap="$4" flex={1}
|
|
2708
|
+
<YStack gap="$4" flex={1}>
|
|
2717
2709
|
<Text fontSize="$5" fontWeight="bold">
|
|
2718
2710
|
Slider Field Type
|
|
2719
2711
|
</Text>
|
|
@@ -2764,7 +2756,7 @@ const progressFieldColumns: DataTableColumn<ProgressFieldRow>[] = [
|
|
|
2764
2756
|
const ProgressFieldStory = () => {
|
|
2765
2757
|
const [data, setData] = React.useState(progressFieldData);
|
|
2766
2758
|
return (
|
|
2767
|
-
<YStack gap="$4" flex={1}
|
|
2759
|
+
<YStack gap="$4" flex={1}>
|
|
2768
2760
|
<Text fontSize="$5" fontWeight="bold">
|
|
2769
2761
|
Progress Field Type
|
|
2770
2762
|
</Text>
|
|
@@ -2817,7 +2809,7 @@ export const ColumnLayoutAuto: Story = {
|
|
|
2817
2809
|
const ScrollLayoutStory = () => {
|
|
2818
2810
|
const data = useMemo(() => generateUsers(20), []);
|
|
2819
2811
|
return (
|
|
2820
|
-
<View
|
|
2812
|
+
<View>
|
|
2821
2813
|
<DataTable
|
|
2822
2814
|
data={data}
|
|
2823
2815
|
columns={columns}
|
|
@@ -2847,7 +2839,7 @@ export const ColumnLayoutScroll: Story = {
|
|
|
2847
2839
|
const CardLayoutStory = () => {
|
|
2848
2840
|
const data = useMemo(() => generateUsers(25), []);
|
|
2849
2841
|
return (
|
|
2850
|
-
<View
|
|
2842
|
+
<View maxWidth={480} width="100%">
|
|
2851
2843
|
<DataTable
|
|
2852
2844
|
data={data}
|
|
2853
2845
|
columns={columns}
|
|
@@ -2888,7 +2880,7 @@ const documentListColumns: DataTableColumn<Person>[] = [
|
|
|
2888
2880
|
|
|
2889
2881
|
export const DocumentList: Story = {
|
|
2890
2882
|
render: () => (
|
|
2891
|
-
<View
|
|
2883
|
+
<View maxWidth={720} width="100%">
|
|
2892
2884
|
<DataTable
|
|
2893
2885
|
data={sampleData}
|
|
2894
2886
|
columns={documentListColumns}
|
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
CaretLeftIcon,
|
|
15
15
|
CaretRightIcon,
|
|
16
16
|
CaretUpDownIcon,
|
|
17
|
-
PlusIcon,
|
|
18
17
|
TrashIcon,
|
|
19
18
|
} from "@phosphor-icons/react";
|
|
20
19
|
import { Button, Checkbox, Field, useFormField } from "@multiplatform.one/forms";
|
|
@@ -29,6 +28,7 @@ import {
|
|
|
29
28
|
} from "@multiplatform.one/theme";
|
|
30
29
|
import React, { useEffect, useRef, useMemo, useCallback, useState } from "react";
|
|
31
30
|
import {
|
|
31
|
+
ActionButton,
|
|
32
32
|
AsyncBoundary,
|
|
33
33
|
EmptyState,
|
|
34
34
|
Tooltip,
|
|
@@ -2360,14 +2360,12 @@ export function DataTableRoot<TData extends Record<string, any> = Record<string,
|
|
|
2360
2360
|
{/* Add Row Button */}
|
|
2361
2361
|
{showAddRow && !readOnly && (
|
|
2362
2362
|
<View>
|
|
2363
|
-
<
|
|
2364
|
-
|
|
2363
|
+
<ActionButton
|
|
2364
|
+
kind="add"
|
|
2365
|
+
label={t("Add Row")}
|
|
2365
2366
|
disabled={disabled || (maxRows !== undefined && tableData.length >= maxRows)}
|
|
2366
2367
|
onPress={effectiveHandleAddRow}
|
|
2367
|
-
|
|
2368
|
-
>
|
|
2369
|
-
{t("Add Row")}
|
|
2370
|
-
</Button>
|
|
2368
|
+
/>
|
|
2371
2369
|
</View>
|
|
2372
2370
|
)}
|
|
2373
2371
|
</Surface>
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
8
8
|
import { fn } from "storybook/test";
|
|
9
9
|
import React from "react";
|
|
10
|
-
import { Text as TamaguiText,
|
|
10
|
+
import { Text as TamaguiText, YStack } from "tamagui";
|
|
11
11
|
import type { DataTableColumn, DataTableData } from "../../types";
|
|
12
12
|
import { DataTable } from "./index";
|
|
13
|
-
import { H3, Text } from "@multiplatform.one/components";
|
|
13
|
+
import { GutterFrame, H3, Text } from "@multiplatform.one/components";
|
|
14
14
|
|
|
15
15
|
interface SampleRow extends DataTableData {
|
|
16
16
|
id: string;
|
|
@@ -193,9 +193,9 @@ const meta: Meta<typeof DataTable> = {
|
|
|
193
193
|
},
|
|
194
194
|
decorators: [
|
|
195
195
|
(Story) => (
|
|
196
|
-
<
|
|
196
|
+
<GutterFrame flex={1} width="100%">
|
|
197
197
|
<Story />
|
|
198
|
-
</
|
|
198
|
+
</GutterFrame>
|
|
199
199
|
),
|
|
200
200
|
],
|
|
201
201
|
};
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
CaretLeftIcon,
|
|
11
11
|
CaretRightIcon,
|
|
12
12
|
CaretUpDownIcon,
|
|
13
|
-
PlusIcon,
|
|
14
13
|
TrashIcon,
|
|
15
14
|
} from "@phosphor-icons/react";
|
|
16
15
|
import { FlashList, type FlashListRef } from "@shopify/flash-list";
|
|
17
16
|
import {
|
|
17
|
+
ActionButton,
|
|
18
18
|
AsyncBoundary,
|
|
19
19
|
EmptyState,
|
|
20
20
|
useDirection,
|
|
@@ -1204,14 +1204,12 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
1204
1204
|
|
|
1205
1205
|
{showAddRow && !readOnly && (
|
|
1206
1206
|
<View>
|
|
1207
|
-
<
|
|
1208
|
-
|
|
1207
|
+
<ActionButton
|
|
1208
|
+
kind="add"
|
|
1209
|
+
label={t("Add Row")}
|
|
1209
1210
|
disabled={disabled || (maxRows !== undefined && tableData.length >= maxRows)}
|
|
1210
1211
|
onPress={isFormMode ? effectiveHandleAddRow : handleAddRow}
|
|
1211
|
-
|
|
1212
|
-
>
|
|
1213
|
-
{t("Add Row")}
|
|
1214
|
-
</Button>
|
|
1212
|
+
/>
|
|
1215
1213
|
</View>
|
|
1216
1214
|
)}
|
|
1217
1215
|
</Surface>
|
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
import { CaretLeftIcon, CaretRightIcon, FunnelIcon, type IconProps } from "@phosphor-icons/react";
|
|
17
17
|
import { useDirection, Text } from "@multiplatform.one/components";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
Button,
|
|
20
|
+
FloatingPanel,
|
|
21
|
+
IconButton,
|
|
22
|
+
SearchInput,
|
|
23
|
+
standardActions,
|
|
24
|
+
} from "@multiplatform.one/forms";
|
|
19
25
|
import {
|
|
20
26
|
keyboardFocusRingProps,
|
|
21
27
|
useResolvedKnobs,
|
|
@@ -391,9 +397,11 @@ function FilterButton({
|
|
|
391
397
|
|
|
392
398
|
{editingExisting && (
|
|
393
399
|
<XStack justifyContent="flex-end">
|
|
394
|
-
<
|
|
395
|
-
{
|
|
396
|
-
|
|
400
|
+
<IconButton
|
|
401
|
+
icon={standardActions.remove.icon}
|
|
402
|
+
aria-label={t("Remove filter")}
|
|
403
|
+
onPress={handleRemoveCurrent}
|
|
404
|
+
/>
|
|
397
405
|
</XStack>
|
|
398
406
|
)}
|
|
399
407
|
</YStack>
|
|
@@ -260,14 +260,12 @@ function FilterBuilder({
|
|
|
260
260
|
|
|
261
261
|
<XStack gap="$2" justifyContent="flex-end" alignItems="center">
|
|
262
262
|
<ActionButton kind="cancel" onPress={onCancel} />
|
|
263
|
-
<
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
<ActionButton
|
|
264
|
+
kind="done"
|
|
265
|
+
label={editingFilter ? t("Update") : t("Add filter")}
|
|
266
266
|
onPress={handleCommit}
|
|
267
267
|
disabled={!selectedColumnId || !selectedOperator || !canAdd}
|
|
268
|
-
|
|
269
|
-
{editingFilter ? t("Update") : t("Add filter")}
|
|
270
|
-
</Button>
|
|
268
|
+
/>
|
|
271
269
|
</XStack>
|
|
272
270
|
</YStack>
|
|
273
271
|
);
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
sizeTokenStep,
|
|
13
13
|
} from "@multiplatform.one/theme";
|
|
14
14
|
import React, { useState } from "react";
|
|
15
|
-
import { Button, FloatingPanel, Input, Slider, Switch } from "@multiplatform.one/forms";
|
|
15
|
+
import { Button, FloatingPanel, IconButton, Input, Slider, Switch } from "@multiplatform.one/forms";
|
|
16
16
|
import { DropdownMenu, ScrollView, Text, ActionButton } from "@multiplatform.one/components";
|
|
17
17
|
import {
|
|
18
18
|
Separator,
|
|
@@ -412,7 +412,6 @@ function ViewManagementSection({
|
|
|
412
412
|
onLoadView,
|
|
413
413
|
}: ViewManagementSectionProps) {
|
|
414
414
|
const { knobProps } = useResolvedKnobs();
|
|
415
|
-
const iconPx = iconSizeForToken(String(knobProps.sizeToken));
|
|
416
415
|
const [showSaveDialog, setShowSaveDialog] = useState(false);
|
|
417
416
|
const [viewName, setViewName] = useState("");
|
|
418
417
|
|
|
@@ -434,11 +433,7 @@ function ViewManagementSection({
|
|
|
434
433
|
<FloatingPanel
|
|
435
434
|
open={showSaveDialog}
|
|
436
435
|
onOpenChange={setShowSaveDialog}
|
|
437
|
-
trigger={
|
|
438
|
-
<Button size={knobProps.sizeToken} icon={<FloppyDiskIcon size={iconPx} />}>
|
|
439
|
-
{t("Save Current View")}
|
|
440
|
-
</Button>
|
|
441
|
-
}
|
|
436
|
+
trigger={<IconButton icon={FloppyDiskIcon} aria-label={t("Save Current View")} />}
|
|
442
437
|
>
|
|
443
438
|
<YStack gap="$3" minWidth={250} data-dismiss-class="compose">
|
|
444
439
|
<TamaguiText {...knobProps.label} fontWeight="400">
|
|
@@ -10,12 +10,11 @@ describe("FilterManager", () => {
|
|
|
10
10
|
];
|
|
11
11
|
const onSave = vi.fn();
|
|
12
12
|
|
|
13
|
-
const {
|
|
13
|
+
const { getByRole } = renderWithProviders(
|
|
14
14
|
<FilterManager currentFilters={genericFilters} onSaveFilter={onSave} />,
|
|
15
15
|
);
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
expect(getByText("Save Filter")).toBeDefined();
|
|
17
|
+
expect(getByRole("button", { name: "Save filter" })).toBeDefined();
|
|
19
18
|
});
|
|
20
19
|
|
|
21
20
|
it("shows filter count from generic filter array", () => {
|
|
@@ -53,7 +52,7 @@ describe("FilterManager", () => {
|
|
|
53
52
|
const onSave = vi.fn();
|
|
54
53
|
|
|
55
54
|
// Should render without errors — no Frappe provider needed
|
|
56
|
-
const {
|
|
55
|
+
const { getByRole } = renderWithProviders(
|
|
57
56
|
<FilterManager
|
|
58
57
|
currentFilters={genericFilters}
|
|
59
58
|
onSaveFilter={onSave}
|
|
@@ -61,6 +60,6 @@ describe("FilterManager", () => {
|
|
|
61
60
|
/>,
|
|
62
61
|
);
|
|
63
62
|
|
|
64
|
-
expect(
|
|
63
|
+
expect(getByRole("button", { name: "Save filter" })).toBeDefined();
|
|
65
64
|
});
|
|
66
65
|
});
|
|
@@ -2,7 +2,7 @@ import { FloppyDiskIcon, XIcon } from "@phosphor-icons/react";
|
|
|
2
2
|
import { useResolvedKnobs } from "@multiplatform.one/theme";
|
|
3
3
|
import type React from "react";
|
|
4
4
|
import { useState } from "react";
|
|
5
|
-
import { Button, Checkbox, Input } from "@multiplatform.one/forms";
|
|
5
|
+
import { Button, Checkbox, IconButton, Input } from "@multiplatform.one/forms";
|
|
6
6
|
import { XStack, YStack } from "tamagui";
|
|
7
7
|
import { t } from "../shared/t";
|
|
8
8
|
import {
|
|
@@ -80,8 +80,7 @@ export function FilterManager({
|
|
|
80
80
|
<KnobDialog open={open} onOpenChange={setOpen}>
|
|
81
81
|
<KnobDialogTrigger asChild>
|
|
82
82
|
{trigger || (
|
|
83
|
-
<
|
|
84
|
-
size={knobProps.sizeToken}
|
|
83
|
+
<IconButton
|
|
85
84
|
icon={FloppyDiskIcon}
|
|
86
85
|
disabled={disabled || !hasFilters}
|
|
87
86
|
// DG-ST-03 explain: an unfiltered table is the common RESTING
|
|
@@ -93,9 +92,7 @@ export function FilterManager({
|
|
|
93
92
|
}
|
|
94
93
|
disabledReasonPlacement={disabledReasonPlacement}
|
|
95
94
|
aria-label={t("Save filter")}
|
|
96
|
-
|
|
97
|
-
{t("Save Filter")}
|
|
98
|
-
</Button>
|
|
95
|
+
/>
|
|
99
96
|
)}
|
|
100
97
|
</KnobDialogTrigger>
|
|
101
98
|
|
|
@@ -143,15 +140,12 @@ export function FilterManager({
|
|
|
143
140
|
inline "Filter name is required" instead of a bare-disabled
|
|
144
141
|
dangle (DG-ST-03); busy is derived state via `loading`.
|
|
145
142
|
`accent` = the dialog's one primary (LC-05), not theme="active". */}
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
icon={FloppyDiskIcon}
|
|
143
|
+
<ActionButton
|
|
144
|
+
kind="save"
|
|
145
|
+
label={t("Save Filter")}
|
|
150
146
|
onPress={handleSave}
|
|
151
147
|
loading={isSaving}
|
|
152
|
-
|
|
153
|
-
{t("Save Filter")}
|
|
154
|
-
</Button>
|
|
148
|
+
/>
|
|
155
149
|
</XStack>
|
|
156
150
|
|
|
157
151
|
<KnobDialogClose asChild>
|
|
@@ -19,10 +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 as TamaguiText,
|
|
22
|
+
import { Text as TamaguiText, 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
|
+
import { GutterFrame, Text } from "@multiplatform.one/components";
|
|
26
26
|
|
|
27
27
|
interface LineItem extends DataTableData {
|
|
28
28
|
id: string;
|
|
@@ -121,9 +121,9 @@ const meta: Meta<typeof TableInput> = {
|
|
|
121
121
|
},
|
|
122
122
|
decorators: [
|
|
123
123
|
(Story) => (
|
|
124
|
-
<
|
|
124
|
+
<GutterFrame flex={1} width="100%">
|
|
125
125
|
<Story />
|
|
126
|
-
</
|
|
126
|
+
</GutterFrame>
|
|
127
127
|
),
|
|
128
128
|
],
|
|
129
129
|
};
|
|
@@ -13,6 +13,7 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
13
13
|
import {
|
|
14
14
|
Button,
|
|
15
15
|
Field,
|
|
16
|
+
IconButton,
|
|
16
17
|
Skeleton,
|
|
17
18
|
useFormField,
|
|
18
19
|
useResolvedValidators,
|
|
@@ -441,14 +442,12 @@ function TableInputInner<TData extends DataTableData>({
|
|
|
441
442
|
)}
|
|
442
443
|
{showAddRow && !readOnly && !skeleton && (
|
|
443
444
|
<XStack {...hairline.top} {...cellPad}>
|
|
444
|
-
<
|
|
445
|
-
|
|
445
|
+
<IconButton
|
|
446
|
+
icon={PlusIcon}
|
|
447
|
+
aria-label={t("Add Row")}
|
|
446
448
|
onPress={handleAddRow}
|
|
447
449
|
disabled={!canAddRow}
|
|
448
|
-
|
|
449
|
-
>
|
|
450
|
-
{t("Add Row")}
|
|
451
|
-
</Button>
|
|
450
|
+
/>
|
|
452
451
|
</XStack>
|
|
453
452
|
)}
|
|
454
453
|
</YStack>
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
import {
|
|
32
32
|
Button,
|
|
33
33
|
Field,
|
|
34
|
+
IconButton,
|
|
34
35
|
Skeleton,
|
|
35
36
|
useFormField,
|
|
36
37
|
useResolvedValidators,
|
|
@@ -576,14 +577,12 @@ function TableInputInner<TData extends DataTableData>({
|
|
|
576
577
|
</XStack>
|
|
577
578
|
) : showAdd && !skeleton ? (
|
|
578
579
|
<XStack {...hairline.top} {...cellPad}>
|
|
579
|
-
<
|
|
580
|
-
|
|
580
|
+
<IconButton
|
|
581
|
+
icon={PlusIcon}
|
|
582
|
+
aria-label={t("Add Row")}
|
|
581
583
|
onPress={handleAddRow}
|
|
582
584
|
disabled={!canAddRow}
|
|
583
|
-
|
|
584
|
-
>
|
|
585
|
-
{t("Add Row")}
|
|
586
|
-
</Button>
|
|
585
|
+
/>
|
|
587
586
|
</XStack>
|
|
588
587
|
) : null;
|
|
589
588
|
|