@aures5g/vue-component-library 3.67.0 → 3.69.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.
@@ -6,6 +6,7 @@ type __VLS_Props = {
6
6
  isLast: boolean;
7
7
  name: string;
8
8
  header: string;
9
+ description?: string;
9
10
  isSortable?: boolean;
10
11
  hasHeaderFilter?: boolean;
11
12
  icon?: FontAwesomeIconProps['icon'];
@@ -11,6 +11,7 @@ type __VLS_Props = {
11
11
  sort?: SortDirections;
12
12
  hasHeaderFilter?: boolean;
13
13
  header: string;
14
+ description?: string;
14
15
  icon?: FontAwesomeIconProps['icon'];
15
16
  getColumnWidth: (field: string) => Record<string, string | number>;
16
17
  };
@@ -4,14 +4,49 @@ export type SortState = {
4
4
  direction: SortDirections;
5
5
  } | null;
6
6
  /**
7
- * Pure state machine for the header sort click cycle (Bug #76979).
7
+ * Local click-count state for the header sort cycle (Bug #76979 / #76979
8
+ * follow-up). Tracks ONLY "which field was clicked, how many times in a
9
+ * row" — never the resulting `direction`, and never anything read back from
10
+ * the externally-bound `sortModel`. This is deliberate: a view can have its
11
+ * own default sort (`useDefineSort`'s `defaultSort`), so `sortModel` can
12
+ * already read e.g. `{ field: 'make', direction: 'asc' }` before the user
13
+ * has ever clicked anything. An earlier version of this state machine
14
+ * derived the next step from that externally-visible `direction` alone
15
+ * (`current.direction === DESC ? ASC : off`) — for a column whose default
16
+ * sort direction happens to be ASC (not DESC), the very first click was
17
+ * indistinguishable from "already at the ASC step, 3rd click coming up" and
18
+ * immediately reset the sort back to that same default (`off` -> `resetSort()`
19
+ * -> the identical default), so clicking such a column appeared to do
20
+ * nothing on the 1st click and never flipped on the 2nd (confirmed live: PR
21
+ * 11389, build 79082 — every system view's own default-sorted column, e.g.
22
+ * `make` on `basicView`, failed both checks in `view-suite.ts`).
23
+ * Deriving purely from click COUNT (this file), independent of whatever
24
+ * `sortModel` happened to already contain, cannot exhibit that ambiguity.
25
+ */
26
+ export declare const SORT_CLICK_STEP: {
27
+ readonly FIRST: 1;
28
+ readonly SECOND: 2;
29
+ };
30
+ type SortClickStep = (typeof SORT_CLICK_STEP)[keyof typeof SORT_CLICK_STEP];
31
+ export type SortClickState = {
32
+ field: string;
33
+ step: SortClickStep;
34
+ } | null;
35
+ /**
36
+ * Pure click-count state machine for the header sort click cycle.
8
37
  *
9
- * Single-column sort: clicking a column other than the currently sorted one
10
- * always starts that column fresh at DESC and drops the previous column's
11
- * sort — the direction is never inherited from another field. Clicking the
12
- * SAME column cycles DESC -> ASC -> off (null); off -> DESC restarts it. The
13
- * caller (TableHeaderRow.vue) reads `current` from its own `sortModel` and
14
- * feeds the clicked field name; the parent's `sortModel` setter already
15
- * treats `null` as "reset to the view's default sort".
38
+ * Single-column sort: clicking a column other than the one currently being
39
+ * cycled always restarts the cycle on that column (FIRST) — the previous
40
+ * column's cycle is dropped entirely, regardless of what `sortModel`
41
+ * currently shows for it. Clicking the SAME column advances FIRST -> SECOND
42
+ * -> off (null); off -> FIRST restarts it.
43
+ */
44
+ export declare function nextSortClickState(current: SortClickState, clickedField: string): SortClickState;
45
+ /**
46
+ * Maps a click-count state to the `sortModel` value `TableHeaderRow.vue`
47
+ * should assign: FIRST -> DESC, SECOND -> ASC, off (null) -> null (the
48
+ * parent's `sortModel` setter already treats `null` as "reset to the view's
49
+ * default sort").
16
50
  */
17
- export declare function nextSortState(current: SortState, clickedField: string): SortState;
51
+ export declare function sortClickStateToSortModel(state: SortClickState): SortState;
52
+ export {};
@@ -4,6 +4,7 @@ import type { ClassValue, Component } from 'vue';
4
4
  export type Field = {
5
5
  name: string;
6
6
  header: string;
7
+ description?: string;
7
8
  icon?: FontAwesomeIconProps['icon'];
8
9
  isSortable?: boolean;
9
10
  hasHeaderFilter?: boolean;