@dloizides/ui-tables 1.29.0 → 1.29.1
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/CHANGELOG.md +10 -0
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +39 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -328,23 +328,6 @@ var chromeStyles = StyleSheet.create({
|
|
|
328
328
|
sizeOption: { minHeight: MIN_TARGET_PX, justifyContent: "center", paddingHorizontal: CONTROL_PAD_H, paddingVertical: MENU_OPT_PAD_V },
|
|
329
329
|
sizeOptionText: { fontSize: CONTROL_FONT, fontVariant: ["tabular-nums"] }
|
|
330
330
|
});
|
|
331
|
-
|
|
332
|
-
// src/DataTable/joinedFrameContext.ts
|
|
333
|
-
var SQUARE = 0;
|
|
334
|
-
var INNER_RADIUS = BORDER_RADIUS - BORDER_WIDTH;
|
|
335
|
-
var NO_OUTER_BORDER = { borderTopWidth: 0, borderRightWidth: 0, borderBottomWidth: 0, borderLeftWidth: 0 };
|
|
336
|
-
function cornerRadii(top, bottom) {
|
|
337
|
-
return { borderTopLeftRadius: top, borderTopRightRadius: top, borderBottomLeftRadius: bottom, borderBottomRightRadius: bottom };
|
|
338
|
-
}
|
|
339
|
-
var AT_FRAME_TOP = { ...NO_OUTER_BORDER, ...cornerRadii(INNER_RADIUS, SQUARE) };
|
|
340
|
-
var AT_FRAME_BOTTOM = { ...NO_OUTER_BORDER, ...cornerRadii(SQUARE, INNER_RADIUS) };
|
|
341
|
-
var JOINED_FRAME_STYLES = {
|
|
342
|
-
toolbar: { wrap: AT_FRAME_BOTTOM },
|
|
343
|
-
spaced: null,
|
|
344
|
-
footer: { wrap: AT_FRAME_TOP },
|
|
345
|
-
panel: { wrap: AT_FRAME_BOTTOM, filters: AT_FRAME_TOP }
|
|
346
|
-
};
|
|
347
|
-
var JoinedFrameContext = createContext(null);
|
|
348
331
|
function cellContent(column, row, textColor, overrides) {
|
|
349
332
|
const content = column.render(row);
|
|
350
333
|
if (typeof content === "string" || typeof content === "number") {
|
|
@@ -600,11 +583,37 @@ function DataTableRow({
|
|
|
600
583
|
accessibilityRole: "summary",
|
|
601
584
|
style: [tableStyles.rowDetail, { borderTopColor: colors.border, backgroundColor: colors.background }, o?.rowDetail],
|
|
602
585
|
testID: rowDetailTestID(tableTestID, rowKey),
|
|
603
|
-
children:
|
|
586
|
+
children: renderRowDetail(row)
|
|
604
587
|
}
|
|
605
588
|
)
|
|
606
589
|
] });
|
|
607
590
|
}
|
|
591
|
+
|
|
592
|
+
// src/DataTable/PagedTableLayoutKind.ts
|
|
593
|
+
var PagedTableLayoutKind = /* @__PURE__ */ ((PagedTableLayoutKind2) => {
|
|
594
|
+
PagedTableLayoutKind2["Toolbar"] = "toolbar";
|
|
595
|
+
PagedTableLayoutKind2["Spaced"] = "spaced";
|
|
596
|
+
PagedTableLayoutKind2["Footer"] = "footer";
|
|
597
|
+
PagedTableLayoutKind2["Panel"] = "panel";
|
|
598
|
+
return PagedTableLayoutKind2;
|
|
599
|
+
})(PagedTableLayoutKind || {});
|
|
600
|
+
|
|
601
|
+
// src/DataTable/joinedFrameContext.ts
|
|
602
|
+
var SQUARE = 0;
|
|
603
|
+
var INNER_RADIUS = BORDER_RADIUS - BORDER_WIDTH;
|
|
604
|
+
var NO_OUTER_BORDER = { borderTopWidth: 0, borderRightWidth: 0, borderBottomWidth: 0, borderLeftWidth: 0 };
|
|
605
|
+
function cornerRadii(top, bottom) {
|
|
606
|
+
return { borderTopLeftRadius: top, borderTopRightRadius: top, borderBottomLeftRadius: bottom, borderBottomRightRadius: bottom };
|
|
607
|
+
}
|
|
608
|
+
var AT_FRAME_TOP = { ...NO_OUTER_BORDER, ...cornerRadii(INNER_RADIUS, SQUARE) };
|
|
609
|
+
var AT_FRAME_BOTTOM = { ...NO_OUTER_BORDER, ...cornerRadii(SQUARE, INNER_RADIUS) };
|
|
610
|
+
var JOINED_FRAME_STYLES = {
|
|
611
|
+
["toolbar" /* Toolbar */]: { wrap: AT_FRAME_BOTTOM },
|
|
612
|
+
["spaced" /* Spaced */]: null,
|
|
613
|
+
["footer" /* Footer */]: { wrap: AT_FRAME_TOP },
|
|
614
|
+
["panel" /* Panel */]: { wrap: AT_FRAME_BOTTOM, filters: AT_FRAME_TOP }
|
|
615
|
+
};
|
|
616
|
+
var JoinedFrameContext = createContext(null);
|
|
608
617
|
function SelectAllBanner({
|
|
609
618
|
mode,
|
|
610
619
|
pageCount,
|
|
@@ -976,8 +985,9 @@ function DataTable(props) {
|
|
|
976
985
|
onRowPress
|
|
977
986
|
}
|
|
978
987
|
);
|
|
979
|
-
|
|
980
|
-
return /* @__PURE__ */ jsx(
|
|
988
|
+
const detachedFromFrame = /* @__PURE__ */ jsx(JoinedFrameContext.Provider, { value: null, children: node });
|
|
989
|
+
if (!animateRowEntrance) return /* @__PURE__ */ jsx(React2.Fragment, { children: detachedFromFrame }, key);
|
|
990
|
+
return /* @__PURE__ */ jsx(FadeIn, { delay: rowEntranceDelayMs(index), testID: rowFadeTestID(testID, key), children: detachedFromFrame }, key);
|
|
981
991
|
};
|
|
982
992
|
const banner = /* @__PURE__ */ jsx(
|
|
983
993
|
SelectAllBanner,
|
|
@@ -1448,28 +1458,28 @@ var PAGER_SLOT_PAD_V = 8;
|
|
|
1448
1458
|
var PAGER_IN_FRAME = { paddingHorizontal: ROW_PAD_H, paddingVertical: PAGER_SLOT_PAD_V };
|
|
1449
1459
|
var FRAME = { borderWidth: BORDER_WIDTH, borderRadius: BORDER_RADIUS };
|
|
1450
1460
|
var SLOT_STYLES = {
|
|
1451
|
-
toolbar: { filters: { marginBottom: LAYOUT_GAP }, pager: { ...PAGER_IN_FRAME, borderBottomWidth: BORDER_WIDTH } },
|
|
1452
|
-
spaced: { filters: {}, pager: { marginTop: LAYOUT_GAP, marginBottom: LAYOUT_GAP } },
|
|
1453
|
-
footer: { filters: { marginBottom: LAYOUT_GAP }, pager: { ...PAGER_IN_FRAME, borderTopWidth: BORDER_WIDTH } },
|
|
1454
|
-
panel: { filters: { borderBottomWidth: BORDER_WIDTH }, pager: { ...PAGER_IN_FRAME, borderBottomWidth: BORDER_WIDTH } }
|
|
1461
|
+
["toolbar" /* Toolbar */]: { filters: { marginBottom: LAYOUT_GAP }, pager: { ...PAGER_IN_FRAME, borderBottomWidth: BORDER_WIDTH } },
|
|
1462
|
+
["spaced" /* Spaced */]: { filters: {}, pager: { marginTop: LAYOUT_GAP, marginBottom: LAYOUT_GAP } },
|
|
1463
|
+
["footer" /* Footer */]: { filters: { marginBottom: LAYOUT_GAP }, pager: { ...PAGER_IN_FRAME, borderTopWidth: BORDER_WIDTH } },
|
|
1464
|
+
["panel" /* Panel */]: { filters: { borderBottomWidth: BORDER_WIDTH }, pager: { ...PAGER_IN_FRAME, borderBottomWidth: BORDER_WIDTH } }
|
|
1455
1465
|
};
|
|
1456
1466
|
function PagedTableLayout({
|
|
1457
1467
|
filters,
|
|
1458
1468
|
pager,
|
|
1459
1469
|
table,
|
|
1460
|
-
layout = "toolbar"
|
|
1470
|
+
layout = "toolbar" /* Toolbar */,
|
|
1461
1471
|
testID = TABLE_TEST_IDS.pagedLayout
|
|
1462
1472
|
}) {
|
|
1463
1473
|
const { colors } = useUi().theme;
|
|
1464
1474
|
const slots = SLOT_STYLES[layout];
|
|
1465
1475
|
const line = { borderColor: colors.border };
|
|
1466
1476
|
const hasFilters = filters !== void 0 && filters !== null && filters !== false;
|
|
1467
|
-
const filtersInFrame = layout === "panel"
|
|
1468
|
-
const isJoined = layout !== "spaced"
|
|
1477
|
+
const filtersInFrame = layout === "panel" /* Panel */;
|
|
1478
|
+
const isJoined = layout !== "spaced" /* Spaced */;
|
|
1469
1479
|
const filtersSlot = hasFilters ? /* @__PURE__ */ jsx(View, { style: [slots.filters, line], testID: `${testID}-filters`, children: filters }) : null;
|
|
1470
1480
|
const pagerSlot = /* @__PURE__ */ jsx(View, { style: [slots.pager, line], testID: `${testID}-pager`, children: pager });
|
|
1471
1481
|
const tableSlot = /* @__PURE__ */ jsx(View, { testID: `${testID}-table`, children: table });
|
|
1472
|
-
const pagerAndTable = layout === "footer" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1482
|
+
const pagerAndTable = layout === "footer" /* Footer */ ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1473
1483
|
tableSlot,
|
|
1474
1484
|
pagerSlot
|
|
1475
1485
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -2350,6 +2360,6 @@ var MonthStatusGrid = ({
|
|
|
2350
2360
|
] }, row[0]?.id)) });
|
|
2351
2361
|
};
|
|
2352
2362
|
|
|
2353
|
-
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, FIELD_MIN_WIDTH, FILTERS_I18N, FILTERS_TEST_ID, FilterBar, Filters, LedgerLayout, MONTH_STATUS_GRID_TEST_ID, MonthGridColumns, MonthStatusGrid, PagedTableLayout, Pager, RelativeTime, STATUS_LEDGER_TEST_ID, SortDirection, StatCard, StatTone, StatusLedger, StatusPill, StatusTone, TABLE_I18N, TABLE_TEST_IDS, applyTestID, clearTestID, distinctValues, fieldTestID, filterLedgerRows, fitMonthGridColumns, formatRelativeTime, isAttentionTone, ledgerSectionTestID, ledgerSortDirectionTestID, monthCellTestID, resolveStatToneColor, rowDetailTestID, rowFadeTestID, rowSelectTestID, rowTestID, selectAllTestID, sortLedgerRows, splitNeedsLook, toEpochMs, useFilterDraft, usePagedRows };
|
|
2363
|
+
export { CARD_STACK_BREAKPOINT, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DataTable, FIELD_MIN_WIDTH, FILTERS_I18N, FILTERS_TEST_ID, FilterBar, Filters, LedgerLayout, MONTH_STATUS_GRID_TEST_ID, MonthGridColumns, MonthStatusGrid, PagedTableLayout, PagedTableLayoutKind, Pager, RelativeTime, STATUS_LEDGER_TEST_ID, SortDirection, StatCard, StatTone, StatusLedger, StatusPill, StatusTone, TABLE_I18N, TABLE_TEST_IDS, applyTestID, clearTestID, distinctValues, fieldTestID, filterLedgerRows, fitMonthGridColumns, formatRelativeTime, isAttentionTone, ledgerSectionTestID, ledgerSortDirectionTestID, monthCellTestID, resolveStatToneColor, rowDetailTestID, rowFadeTestID, rowSelectTestID, rowTestID, selectAllTestID, sortLedgerRows, splitNeedsLook, toEpochMs, useFilterDraft, usePagedRows };
|
|
2354
2364
|
//# sourceMappingURL=index.mjs.map
|
|
2355
2365
|
//# sourceMappingURL=index.mjs.map
|