@sebgroup/green-core 3.9.0 → 3.11.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.
Files changed (113) hide show
  1. package/assets/icons/regular/arrow-box-left-alt.svg +1 -1
  2. package/assets/icons/regular/arrow-box-left.svg +1 -1
  3. package/assets/icons/regular/arrow-box-right.svg +1 -1
  4. package/assets/icons/regular/arrow-inbox.svg +1 -1
  5. package/assets/icons/regular/arrow-out-of-box.svg +1 -1
  6. package/assets/icons/regular/arrow-split.svg +1 -1
  7. package/assets/icons/regular/arrow-wall-left.svg +1 -1
  8. package/assets/icons/regular/arrow-wall-right.svg +1 -1
  9. package/assets/icons/regular/arrow-wall-up.svg +1 -1
  10. package/assets/icons/regular/bookmark-remove.svg +1 -1
  11. package/assets/icons/regular/cloud-download.svg +1 -1
  12. package/assets/icons/regular/cloud-upload.svg +1 -1
  13. package/assets/icons/regular/file-bend.svg +1 -1
  14. package/assets/icons/regular/file-chart.svg +1 -1
  15. package/assets/icons/regular/file-text.svg +1 -1
  16. package/assets/icons/regular/files.svg +1 -1
  17. package/assets/icons/regular/lab.svg +1 -1
  18. package/assets/icons/regular/minimize.svg +1 -1
  19. package/assets/icons/regular/money-hand.svg +1 -1
  20. package/assets/icons/regular/newspaper.svg +1 -0
  21. package/assets/icons/regular/pension.svg +1 -1
  22. package/assets/icons/regular/people-add.svg +1 -1
  23. package/assets/icons/regular/people-added.svg +1 -1
  24. package/assets/icons/regular/people-circle.svg +1 -1
  25. package/assets/icons/regular/people-remove.svg +1 -1
  26. package/assets/icons/regular/printer.svg +1 -1
  27. package/assets/icons/regular/sort-ascending.svg +1 -1
  28. package/assets/icons/regular/sort-descending.svg +1 -1
  29. package/assets/icons/regular/square-arrow-top-right.svg +1 -1
  30. package/assets/icons/regular/warning-sign.svg +1 -1
  31. package/assets/icons/solid/newspaper.svg +3 -0
  32. package/components/card/card.styles.js +1 -0
  33. package/components/icon/icons/arrow-box-left-alt.component.js +1 -1
  34. package/components/icon/icons/arrow-box-left.component.js +1 -1
  35. package/components/icon/icons/arrow-box-right.component.js +1 -1
  36. package/components/icon/icons/arrow-inbox.component.js +1 -1
  37. package/components/icon/icons/arrow-out-of-box.component.js +1 -1
  38. package/components/icon/icons/arrow-split.component.js +1 -1
  39. package/components/icon/icons/arrow-wall-left.component.js +1 -1
  40. package/components/icon/icons/arrow-wall-right.component.js +1 -1
  41. package/components/icon/icons/arrow-wall-up.component.js +1 -1
  42. package/components/icon/icons/bookmark-remove.component.js +1 -1
  43. package/components/icon/icons/cloud-download.component.js +1 -1
  44. package/components/icon/icons/cloud-upload.component.js +1 -1
  45. package/components/icon/icons/file-bend.component.js +1 -1
  46. package/components/icon/icons/file-chart.component.js +1 -1
  47. package/components/icon/icons/file-text.component.js +1 -1
  48. package/components/icon/icons/files.component.js +1 -1
  49. package/components/icon/icons/index.d.ts +1 -0
  50. package/components/icon/icons/index.js +1 -0
  51. package/components/icon/icons/lab.component.js +1 -1
  52. package/components/icon/icons/minimize.component.js +1 -1
  53. package/components/icon/icons/money-hand.component.js +1 -1
  54. package/components/icon/icons/newspaper.component.d.ts +18 -0
  55. package/components/icon/icons/newspaper.component.js +25 -0
  56. package/components/icon/icons/newspaper.d.ts +2 -0
  57. package/components/icon/icons/newspaper.js +6 -0
  58. package/components/icon/icons/pension.component.js +1 -1
  59. package/components/icon/icons/people-add.component.js +1 -1
  60. package/components/icon/icons/people-added.component.js +1 -1
  61. package/components/icon/icons/people-circle.component.js +1 -1
  62. package/components/icon/icons/people-remove.component.js +1 -1
  63. package/components/icon/icons/printer.component.js +1 -1
  64. package/components/icon/icons/pure.d.ts +1 -0
  65. package/components/icon/icons/pure.js +1 -0
  66. package/components/icon/icons/sort-ascending.component.js +1 -1
  67. package/components/icon/icons/sort-descending.component.js +1 -1
  68. package/components/icon/icons/square-arrow-top-right.component.js +1 -1
  69. package/components/icon/icons/warning-sign.component.js +1 -1
  70. package/components/table/table.component.d.ts +27 -7
  71. package/components/table/table.component.js +730 -101
  72. package/components/table/table.imports.js +8 -0
  73. package/components/table/table.stories.data.d.ts +8 -5
  74. package/components/table/table.stories.data.js +705 -31
  75. package/components/table/table.styles.js +409 -189
  76. package/components/table/table.types.d.ts +97 -11
  77. package/custom-elements.json +19661 -18968
  78. package/gds-element.js +1 -1
  79. package/generated/locales/da.d.ts +4 -1
  80. package/generated/locales/da.js +4 -1
  81. package/generated/locales/de.d.ts +4 -1
  82. package/generated/locales/de.js +4 -1
  83. package/generated/locales/fi.d.ts +4 -1
  84. package/generated/locales/fi.js +4 -1
  85. package/generated/locales/fr.d.ts +4 -1
  86. package/generated/locales/fr.js +4 -1
  87. package/generated/locales/it.d.ts +4 -1
  88. package/generated/locales/it.js +4 -1
  89. package/generated/locales/nl.d.ts +4 -1
  90. package/generated/locales/nl.js +4 -1
  91. package/generated/locales/no.d.ts +4 -1
  92. package/generated/locales/no.js +4 -1
  93. package/generated/locales/sv.d.ts +4 -1
  94. package/generated/locales/sv.js +4 -1
  95. package/generated/mcp/components.json +1 -1
  96. package/generated/mcp/icon-newspaper/angular.md +15 -0
  97. package/generated/mcp/icon-newspaper/api.md +31 -0
  98. package/generated/mcp/icon-newspaper/index.json +8 -0
  99. package/generated/mcp/icon-newspaper/react.md +15 -0
  100. package/generated/mcp/icons.json +13 -1
  101. package/generated/mcp/index.json +1 -1
  102. package/generated/mcp/table/angular.md +1 -0
  103. package/generated/mcp/table/api.md +32 -2
  104. package/generated/mcp/table/react.md +1 -0
  105. package/generated/mcp/tokens.json +1 -1
  106. package/generated/react/icons/icon-newspaper/index.d.ts +672 -0
  107. package/generated/react/icons/icon-newspaper/index.js +14 -0
  108. package/generated/react/index.d.ts +6 -5
  109. package/generated/react/index.js +6 -5
  110. package/generated/react/table/index.d.ts +10 -4
  111. package/package.json +2 -1
  112. package/shared-styles/rbcb-toggle.style.js +1 -1
  113. package/utils/helpers/custom-element-scoping.js +1 -1
@@ -3,47 +3,121 @@
3
3
  * TABLE TYPES
4
4
  * ============================================================================
5
5
  */
6
+ /**
7
+ * Column definition describing how a row field is rendered and behaves.
8
+ */
6
9
  export interface Column {
10
+ /** Property key in the row object and the basis for generated slot names. */
7
11
  key: string;
12
+ /**
13
+ * Optional raw value extractor used for display, sorting, and search when a
14
+ * simple row[key] lookup is not sufficient.
15
+ */
8
16
  value?: (row: any) => string;
17
+ /** Text shown in the column header. */
9
18
  label: string;
19
+ /** Enables click-to-sort for the column header. */
10
20
  sortable?: boolean;
21
+ /** Vertical alignment for cell content. */
11
22
  align?: 'start' | 'center' | 'stretch' | 'end';
23
+ /** Horizontal justification for cell content. */
12
24
  justify?: 'start' | 'center' | 'space-between' | 'end';
25
+ /** Controls whether the column is shown in the table and settings UI. */
13
26
  visible?: boolean;
27
+ /** Fixed CSS width for the column. */
14
28
  width?: string;
29
+ /** Keeps the column pinned to the left or right while horizontally scrolling. */
30
+ sticky?: 'left' | 'right';
15
31
  }
16
- export interface Actions {
17
- label?: string;
18
- align?: 'start' | 'center' | 'stretch' | 'end';
19
- justify?: 'start' | 'center' | 'space-between' | 'end';
20
- width?: string;
21
- sticky?: boolean;
22
- }
32
+ /**
33
+ * Footer row configuration for aggregated or summary content rendered through
34
+ * `tfoot:columnKey` slots.
35
+ */
23
36
  export interface Tfoot {
37
+ /** Optional first-cell label rendered as a row header for accessibility. */
24
38
  label?: string;
39
+ /** Pins the footer row to the bottom of the scroll area. */
25
40
  sticky?: boolean;
26
41
  }
27
- export interface Row {
28
- [key: string]: any;
29
- }
42
+ /**
43
+ * Built-in expandable metadata available on each row.
44
+ */
45
+ export type RowMeta<T extends Record<string, unknown> = Record<string, unknown>> = {
46
+ /** Marks whether this row should render an expand toggle. */
47
+ isExpandable?: boolean;
48
+ /** Optional per-row label for collapsed state toggle action. */
49
+ expandLabel?: string;
50
+ /** Optional per-row label for expanded state toggle action. */
51
+ collapseLabel?: string;
52
+ /**
53
+ * Async readiness signal for slotted full-width expanded content.
54
+ * Called when the row is expanded. The table shows a loading skeleton
55
+ * until the returned promise resolves, then reveals the
56
+ * `expand:ROW_KEY:full` slot. Consumers can resolve immediately or
57
+ * after fetching dynamic data into the slot.
58
+ */
59
+ fullContent?: () => Promise<boolean>;
60
+ /**
61
+ * Optional expected number of sub rows, used to size loading placeholders
62
+ * while async sub rows are being resolved.
63
+ */
64
+ subRowCount?: number;
65
+ /**
66
+ * Async sub row provider called when the parent row is expanded.
67
+ * The table shows skeleton placeholder rows (sized by `subRowCount`)
68
+ * until the returned promise resolves, then renders the child rows
69
+ * using the same column structure. Consumers can resolve immediately
70
+ * with pre-fetched data or after a dynamic fetch.
71
+ */
72
+ subRows?: () => Promise<Row<T>[]>;
73
+ };
74
+ /**
75
+ * Generic table row shape. Consumers extend this with application-specific
76
+ * fields while keeping built-in row metadata strongly typed.
77
+ */
78
+ export type Row<T extends Record<string, unknown> = Record<string, unknown>> = Omit<T, keyof RowMeta<T>> & RowMeta<T>;
79
+ /**
80
+ * Internal table state used to drive paging, sorting, searching, and column
81
+ * visibility.
82
+ */
30
83
  export interface State {
84
+ /** Current page number, using 1-based indexing. */
31
85
  page: number;
86
+ /** Number of rows requested per page. */
32
87
  rows: number;
88
+ /** Column key currently used for sorting. */
33
89
  sortColumn?: string;
90
+ /** Active sort direction for the current sort column. */
34
91
  sortDirection?: 'asc' | 'desc';
92
+ /** Current search term applied to the dataset. */
35
93
  searchQuery: string;
94
+ /** Set of column keys currently visible in the table. */
36
95
  visibleColumns: Set<string>;
37
96
  }
97
+ /**
98
+ * Request object sent from the table to the data provider for fetching the
99
+ * current page of rows.
100
+ */
38
101
  export interface Request {
102
+ /** Current page number, using 1-based indexing. */
39
103
  page: number;
104
+ /** Number of rows requested per page. */
40
105
  rows: number;
106
+ /** Column key to sort by. */
41
107
  sortColumn?: string;
108
+ /** Requested sort direction. */
42
109
  sortDirection?: 'asc' | 'desc';
110
+ /** Optional search term to filter the dataset. */
43
111
  searchQuery?: string;
44
112
  }
113
+ /**
114
+ * Data provider response containing the current page rows and the total number
115
+ * of matching rows for pagination.
116
+ */
45
117
  export interface Response<T> {
118
+ /** Rows to render for the current page. */
46
119
  rows: T[];
120
+ /** Total number of matching rows across all pages. */
47
121
  total: number;
48
122
  }
49
123
  /**
@@ -65,25 +139,37 @@ export declare const DENSITY_CONFIG: {
65
139
  readonly dropdown: "medium";
66
140
  };
67
141
  };
142
+ /** Density options for the table's built-in controls. */
68
143
  export type Density = 'comfortable' | 'compact' | 'spacious';
144
+ /** Cached data provider result keyed by page, rows, sort, and search state. */
69
145
  export interface CacheEntry<T> {
146
+ /** Cached rows for the request key. */
70
147
  rows: T[];
148
+ /** Cached total matching row count. */
71
149
  total: number;
150
+ /** Timestamp in milliseconds used to expire stale cache entries. */
72
151
  timestamp: number;
73
152
  }
153
+ /** Map of cache keys to cached table responses. */
74
154
  export interface Cache<T> {
75
155
  [key: string]: CacheEntry<T>;
76
156
  }
157
+ /**
158
+ * Slot-enabled cell value used to compose rich cell content while preserving a
159
+ * fallback value for sorting, searching, and string coercion.
160
+ */
77
161
  export type SlotValue = {
162
+ /** Fallback plain value used for display, search, and sort comparisons. */
78
163
  value?: unknown;
164
+ /** Ordered slot ids that define the cell layout. Use `value` for inline text. */
79
165
  slots: string[];
166
+ /** Optional row key override used when generating slot names. */
80
167
  key?: string | number;
81
168
  };
82
169
  export declare const isSlotValue: (value: unknown) => value is SlotValue;
83
170
  export declare function Slot(config: SlotValue): SlotValue;
84
171
  export declare function Slot(value?: unknown, slots?: string[], key?: string | number): SlotValue;
85
172
  export declare function Slot(value?: unknown, key?: string | number, slots?: string[]): SlotValue;
86
- export type TableActions = Actions;
87
173
  export type TableColumn = Column;
88
174
  export type TableRow = Row;
89
175
  export type TableState = State;