@webx-ui/core 0.15.0 → 0.16.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.
@@ -47,6 +47,11 @@ declare const _default: <T extends TableRow = TableRow>(__VLS_props: NonNullable
47
47
  row: T;
48
48
  index: number;
49
49
  }) => unknown;
50
+ /** Buttons along the top of a card, where a row has no room for a column of them. */
51
+ 'card-actions'?: (props: {
52
+ row: T;
53
+ index: number;
54
+ }) => unknown;
50
55
  }> & {
51
56
  [key: `header-${string}`]: ((props: {
52
57
  column: TableColumn<T>;
@@ -70,6 +75,11 @@ declare const _default: <T extends TableRow = TableRow>(__VLS_props: NonNullable
70
75
  row: T;
71
76
  index: number;
72
77
  }) => unknown;
78
+ /** Buttons along the top of a card, where a row has no room for a column of them. */
79
+ 'card-actions'?: (props: {
80
+ row: T;
81
+ index: number;
82
+ }) => unknown;
73
83
  };
74
84
  emit: (((evt: "search", term: string) => void) & ((evt: "row-click", row: T, index: number, event: MouseEvent) => void) & ((evt: "sort-change", sort: TableSort | null) => void) & ((evt: "selection-change", keys: RowKey[], rows: T[]) => void) & ((evt: "expand-change", keys: RowKey[], rows: T[]) => void) & ((evt: "node-drop", event: import('./types').TableNodeDropEvent<T>) => void) & ((evt: "state-change", state: TableState) => void)) & (((evt: "update:page", value: number) => void) & ((evt: "update:perPage", value: number) => void) & ((evt: "update:selected", value: RowKey[]) => void) & ((evt: "update:expanded", value: RowKey[]) => void) & ((evt: "update:sort", value: TableSort | null) => void) & ((evt: "update:search", value: string) => void));
75
85
  }>) => import('vue').VNode & {
@@ -50,6 +50,21 @@ export interface TableColumn<T = TableRow> {
50
50
  cellClass?: string;
51
51
  /** Leaves the column out without changing the array. */
52
52
  hidden?: boolean;
53
+ /**
54
+ * Drops the column while the table is narrower than this.
55
+ *
56
+ * The alternative is a horizontal scrollbar, and a column somebody has to drag sideways to
57
+ * read is a column they will not read. Say it about the ones that can go — a date, a count —
58
+ * and the ones that identify the row stay whatever the width.
59
+ */
60
+ hideBelow?: number;
61
+ /**
62
+ * Leaves the column out of a card, where space is the scarce thing.
63
+ *
64
+ * A date somebody scans down a column is worth a line of its own on a wide screen and is the
65
+ * first thing to go on a narrow one.
66
+ */
67
+ hideOnCards?: boolean;
53
68
  }
54
69
  /**
55
70
  * One line of the summary under the table. `label` occupies every column ahead of the
@@ -158,6 +173,21 @@ export interface TableProps<T = TableRow> {
158
173
  expandableIf?: (row: T) => boolean;
159
174
  /** Lines under the table: totals, discounts, whatever the figures are. */
160
175
  summary?: TableSummaryRow[];
176
+ /**
177
+ * Below this width — of the table, not the window — each row is drawn as a card instead.
178
+ *
179
+ * A table narrower than about forty characters is a row of columns nobody can read, and on a
180
+ * phone that is every table. `0` turns it off and keeps the columns at any width.
181
+ */
182
+ cardsBelow?: number;
183
+ /**
184
+ * Drops the table's own margins around the header and the cards.
185
+ *
186
+ * On its own the table is a surface, and its search field and cards keep clear of its rounded
187
+ * edge. Inside a card the card keeps the margins already, and a second set puts the search
188
+ * field a step in from whatever the card has above it.
189
+ */
190
+ flush?: boolean;
161
191
  /**
162
192
  * Puts the pagination in the footer. On by default as soon as `data` is a paginator,
163
193
  * since a paginated response is a promise that there are more pages to reach.