@ticatec/uniface-element 0.2.0 → 0.2.2

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 (209) hide show
  1. package/README.md +320 -1
  2. package/README_CN.md +392 -0
  3. package/dist/accordion/Accordion.svelte +1 -1
  4. package/dist/action-bar/ActionBar.svelte +7 -1
  5. package/dist/attachment-files/FileRender.svelte +1 -1
  6. package/dist/attachment-files/FileUploadBar.svelte +7 -6
  7. package/dist/attachment-files/FileUploadPanel.svelte +2 -2
  8. package/dist/base-calendar/DateContext.js +5 -4
  9. package/dist/base-calendar/YearPickupPanel.svelte +4 -4
  10. package/dist/card/Card.svelte +1 -1
  11. package/dist/card/Card.svelte.d.ts +1 -1
  12. package/dist/cascade-options-select/CascadeOptionSelect.svelte +2 -3
  13. package/dist/cascade-options-select/CascadeOptionSelect.svelte.d.ts +46 -1
  14. package/dist/cascade-options-select/CascadePanel.svelte +1 -1
  15. package/dist/checkbox/CheckBox.svelte +1 -1
  16. package/dist/color-picker/ColorPicker.svelte +9 -9
  17. package/dist/color-picker/ColorPicker.svelte.d.ts +0 -2
  18. package/dist/color-picker/ColorPickerPanel.svelte +11 -15
  19. package/dist/color-picker/ColorPickerPanel.svelte.d.ts +1 -1
  20. package/dist/common/CommonPicker.svelte +2 -2
  21. package/dist/common/CommonPicker.svelte.d.ts +1 -1
  22. package/dist/common/MouseClickHandler.d.ts +1 -1
  23. package/dist/common/Popover.svelte +28 -6
  24. package/dist/common/Popover.svelte.d.ts +9 -3
  25. package/dist/common/uniface-utils.js +6 -4
  26. package/dist/common-editor/CommonEditor.svelte +1 -1
  27. package/dist/common-editor/CommonEditor.svelte.d.ts +1 -1
  28. package/dist/common-editor/NumberInput.svelte +1 -1
  29. package/dist/common-editor/NumberInput.svelte.d.ts +1 -1
  30. package/dist/concise-data-table/ConciseListTable.svelte +7 -2
  31. package/dist/concise-data-table/ConciseListTable.svelte.d.ts +1 -0
  32. package/dist/concise-data-table/DataRow.svelte +1 -1
  33. package/dist/concise-data-table/TableOptions.d.ts +1 -1
  34. package/dist/data-table/DataTable.svelte +1 -1
  35. package/dist/data-table/parts/ActionsPanel.svelte +4 -3
  36. package/dist/data-table/parts/ActionsRow.svelte +3 -3
  37. package/dist/data-table/parts/ContentPanel.svelte +3 -2
  38. package/dist/data-table/parts/FixedColumnsPanel.svelte +0 -1
  39. package/dist/data-table/parts/FixedColumnsPanel.svelte.d.ts +1 -2
  40. package/dist/data-table/parts/FixedHeaderPanel.svelte +2 -2
  41. package/dist/data-table/parts/FixedRow.svelte +2 -1
  42. package/dist/data-table/parts/FixedRow.svelte.d.ts +1 -1
  43. package/dist/data-table/parts/HrefCell.svelte +23 -2
  44. package/dist/data-table/parts/PopupMenu.svelte +25 -2
  45. package/dist/data-table/parts/PopupMenu.svelte.d.ts +8 -1
  46. package/dist/date-picker/DatePicker.svelte +0 -1
  47. package/dist/date-picker/DateTimePicker.svelte +3 -3
  48. package/dist/date-picker/ScrollBar.svelte +4 -7
  49. package/dist/date-range/DateRangeEditor.svelte +1 -1
  50. package/dist/dialog/CommonDialog.svelte +8 -5
  51. package/dist/dialog/CommonDialog.svelte.d.ts +2 -1
  52. package/dist/dialog/Dialog.svelte +37 -12
  53. package/dist/dialog/Dialog.svelte.d.ts +4 -3
  54. package/dist/dialog/DialogBoard.svelte +11 -8
  55. package/dist/dialog/DialogWrapper.svelte +10 -0
  56. package/dist/{common-editor/DateInput.svelte.d.ts → dialog/DialogWrapper.svelte.d.ts} +6 -13
  57. package/dist/dialog/Dialogs.js +1 -1
  58. package/dist/dialog/ModalResult.d.ts +5 -0
  59. package/dist/dialog/ModalResult.js +5 -0
  60. package/dist/drawer/Drawer.svelte +1 -1
  61. package/dist/form-field/FormField.svelte +2 -1
  62. package/dist/form-field/FormField.svelte.d.ts +1 -0
  63. package/dist/form-panel/flex-row-form/FormContainer.svelte +1 -1
  64. package/dist/form-panel/grid-form/EmptyCell.svelte +8 -7
  65. package/dist/form-panel/grid-form/EmptyCell.svelte.d.ts +2 -2
  66. package/dist/form-panel/grid-form/GridField.svelte +1 -1
  67. package/dist/i18nRes/i18nRes.d.ts +2 -0
  68. package/dist/i18nRes/i18nRes.js +44 -0
  69. package/dist/i18nRes/index.d.ts +2 -0
  70. package/dist/i18nRes/index.js +2 -0
  71. package/dist/image-files/ImageFilesField.svelte +1 -1
  72. package/dist/indicator/IndicatorBoard.svelte +1 -1
  73. package/dist/inline-cell-editor/InvalidEditor.svelte +1 -0
  74. package/dist/input-options-select/InputOptionsSelect.svelte +6 -6
  75. package/dist/input-options-select/InputOptionsSelect.svelte.d.ts +1 -1
  76. package/dist/layout/flex/FlexBlock.svelte +1 -1
  77. package/dist/lookup-editor/LookupEditor.svelte +1 -1
  78. package/dist/memo-editor/MemoEditor.svelte +2 -2
  79. package/dist/message-box/IMessageBox.d.ts +2 -4
  80. package/dist/message-box/IMessageBox.js +4 -6
  81. package/dist/message-box/MessageBoxBoard.svelte +1 -3
  82. package/dist/options-multi-select/OptionsMultiSelect.svelte +1 -1
  83. package/dist/prompts-text-editor/PromptsTextEditor.svelte +2 -2
  84. package/dist/prompts-text-editor/PromptsTextEditor.svelte.d.ts +1 -1
  85. package/dist/property-editor/PropertyEditor.svelte +3 -3
  86. package/dist/text-editor/PasswordEditor.svelte +1 -1
  87. package/dist/transfer/Transfer.svelte +17 -12
  88. package/dist/transfer/Transfer.svelte.d.ts +0 -1
  89. package/dist/unit-number-editor/UnitNumberEditor.svelte +2 -2
  90. package/docs/buttons/cn/ActionBar.md +459 -0
  91. package/docs/buttons/cn/Button.md +228 -0
  92. package/docs/buttons/cn/IconButton.md +294 -0
  93. package/docs/buttons/cn/README.md +600 -0
  94. package/docs/buttons/cn/TextButton.md +163 -0
  95. package/docs/buttons/en/ActionBar.md +459 -0
  96. package/docs/buttons/en/Button.md +228 -0
  97. package/docs/buttons/en/IconButton.md +294 -0
  98. package/docs/buttons/en/README.md +600 -0
  99. package/docs/buttons/en/TextButton.md +163 -0
  100. package/docs/containers/cn/accordion.md +622 -0
  101. package/docs/containers/cn/box.md +445 -0
  102. package/docs/containers/cn/card.md +404 -0
  103. package/docs/containers/cn/page.md +576 -0
  104. package/docs/containers/cn/tabs.md +686 -0
  105. package/docs/containers/en/accordion.md +622 -0
  106. package/docs/containers/en/box.md +445 -0
  107. package/docs/containers/en/card.md +404 -0
  108. package/docs/containers/en/page.md +576 -0
  109. package/docs/containers/en/tabs.md +686 -0
  110. package/docs/data-display/cn/concise-data-table.md +731 -0
  111. package/docs/data-display/cn/listbox.md +786 -0
  112. package/docs/data-display/cn/treeview.md +863 -0
  113. package/docs/data-display/en/concise-data-table.md +732 -0
  114. package/docs/data-display/en/listbox.md +786 -0
  115. package/docs/data-display/en/treeview.md +863 -0
  116. package/docs/data-table/cn/README.md +596 -0
  117. package/docs/data-table/en/README.md +596 -0
  118. package/docs/dialog/cn/README.md +767 -0
  119. package/docs/dialog/en/README.md +767 -0
  120. package/docs/form/cn/README.md +847 -0
  121. package/docs/form/en/README.md +847 -0
  122. package/docs/form-components/cn/README.md +495 -0
  123. package/docs/form-components/cn/attachmentfilesfield.md +757 -0
  124. package/docs/form-components/cn/cascade-options-select.md +374 -0
  125. package/docs/form-components/cn/checkbox.md +58 -0
  126. package/docs/form-components/cn/date-picker.md +138 -0
  127. package/docs/form-components/cn/datetime-picker.md +228 -0
  128. package/docs/form-components/cn/group-checkbox.md +405 -0
  129. package/docs/form-components/cn/group-radiobox.md +525 -0
  130. package/docs/form-components/cn/imagefilesfield.md +651 -0
  131. package/docs/form-components/cn/input-options-select.md +250 -0
  132. package/docs/form-components/cn/lookup-editor.md +406 -0
  133. package/docs/form-components/cn/memoeditor.md +409 -0
  134. package/docs/form-components/cn/number-editor.md +261 -0
  135. package/docs/form-components/cn/options-multi-select.md +177 -0
  136. package/docs/form-components/cn/options-select.md +83 -0
  137. package/docs/form-components/cn/passwordeditor.md +538 -0
  138. package/docs/form-components/cn/prompts-text-editor.md +241 -0
  139. package/docs/form-components/cn/radiobutton.md +84 -0
  140. package/docs/form-components/cn/switch.md +178 -0
  141. package/docs/form-components/cn/text-editor.md +142 -0
  142. package/docs/form-components/cn/time-editor.md +159 -0
  143. package/docs/form-components/cn/unit-number-editor.md +164 -0
  144. package/docs/form-components/en/README.md +463 -0
  145. package/docs/form-components/en/attachmentfilesfield.md +757 -0
  146. package/docs/form-components/en/cascade-options-select.md +358 -0
  147. package/docs/form-components/en/checkbox.md +59 -0
  148. package/docs/form-components/en/date-picker.md +138 -0
  149. package/docs/form-components/en/datetime-picker.md +228 -0
  150. package/docs/form-components/en/group-checkbox.md +395 -0
  151. package/docs/form-components/en/group-radiobox.md +498 -0
  152. package/docs/form-components/en/imagefilesfield.md +651 -0
  153. package/docs/form-components/en/input-options-select.md +239 -0
  154. package/docs/form-components/en/lookup-editor.md +389 -0
  155. package/docs/form-components/en/memoeditor.md +409 -0
  156. package/docs/form-components/en/number-editor.md +249 -0
  157. package/docs/form-components/en/options-multi-select.md +177 -0
  158. package/docs/form-components/en/options-select.md +83 -0
  159. package/docs/form-components/en/passwordeditor.md +538 -0
  160. package/docs/form-components/en/prompts-text-editor.md +241 -0
  161. package/docs/form-components/en/radiobutton.md +84 -0
  162. package/docs/form-components/en/switch.md +180 -0
  163. package/docs/form-components/en/text-editor.md +142 -0
  164. package/docs/form-components/en/time-editor.md +159 -0
  165. package/docs/form-components/en/unit-number-editor.md +164 -0
  166. package/docs/form-layout/cn/criteria-field.md +652 -0
  167. package/docs/form-layout/cn/flex-form.md +454 -0
  168. package/docs/form-layout/cn/flex-row-form.md +542 -0
  169. package/docs/form-layout/cn/form-field.md +923 -0
  170. package/docs/form-layout/cn/grid-form.md +676 -0
  171. package/docs/form-layout/en/criteria-field.md +652 -0
  172. package/docs/form-layout/en/flex-form.md +454 -0
  173. package/docs/form-layout/en/flex-row-form.md +542 -0
  174. package/docs/form-layout/en/form-field.md +923 -0
  175. package/docs/form-layout/en/grid-form.md +676 -0
  176. package/docs/global/cn/README.md +534 -0
  177. package/docs/global/en/README.md +534 -0
  178. package/docs/layout/cn/classiclayout.md +460 -0
  179. package/docs/layout/cn/headerlayout.md +524 -0
  180. package/docs/layout/cn/sidebarlayout.md +263 -0
  181. package/docs/layout/en/classiclayout.md +951 -0
  182. package/docs/layout/en/headerlayout.md +524 -0
  183. package/docs/layout/en/sidebarlayout.md +262 -0
  184. package/docs/misc/cn/README.md +1217 -0
  185. package/docs/misc/en/README.md +1217 -0
  186. package/docs/navigation/cn/breadcrumb.md +291 -0
  187. package/docs/navigation/cn/navigator.md +322 -0
  188. package/docs/navigation/cn/navigatormenu.md +512 -0
  189. package/docs/navigation/cn/progressbar.md +199 -0
  190. package/docs/navigation/cn/progressstepbar.md +299 -0
  191. package/docs/navigation/en/breadcrumb.md +291 -0
  192. package/docs/navigation/en/navigator.md +322 -0
  193. package/docs/navigation/en/navigatormenu.md +512 -0
  194. package/docs/navigation/en/progressbar.md +199 -0
  195. package/docs/navigation/en/progressstepbar.md +299 -0
  196. package/docs/search-filters/cn/daterange.md +1156 -0
  197. package/docs/search-filters/cn/numberrange.md +688 -0
  198. package/docs/search-filters/cn/searchbox.md +1582 -0
  199. package/docs/search-filters/en/daterange.md +1156 -0
  200. package/docs/search-filters/en/numberrange.md +688 -0
  201. package/docs/search-filters/en/searchbox.md +1582 -0
  202. package/package.json +53 -13
  203. package/dist/common-editor/DateInput.svelte +0 -27
  204. package/dist/i18n_resources/index.d.ts +0 -3
  205. package/dist/i18n_resources/index.js +0 -3
  206. /package/dist/{i18n_resources → i18nRes}/uniface_cn_resource.d.ts +0 -0
  207. /package/dist/{i18n_resources → i18nRes}/uniface_cn_resource.js +0 -0
  208. /package/dist/{i18n_resources → i18nRes}/uniface_en_resource.d.ts +0 -0
  209. /package/dist/{i18n_resources → i18nRes}/uniface_en_resource.js +0 -0
@@ -0,0 +1,732 @@
1
+ # ConciseDataTable Component
2
+
3
+ A lightweight, feature-rich data table component with auto-scrolling capabilities, flexible column configuration, and customizable styling for displaying tabular data efficiently.
4
+
5
+ ## Overview
6
+
7
+ The ConciseDataTable component provides a streamlined solution for displaying structured data in a table format. It features automatic scrolling for large datasets, flexible column definitions with fixed and proportional widths, custom data formatting, and comprehensive theming options. Perfect for dashboards, data monitoring systems, and applications requiring continuous data display.
8
+
9
+ ## Installation
10
+
11
+ ```typescript
12
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
13
+ import type { Column, TableOptions, RowClickHandler } from '@ticatec/uniface-element/ConciseDataTable';
14
+ ```
15
+
16
+ ## Basic Usage
17
+
18
+ ```svelte
19
+ <script lang="ts">
20
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
21
+ import type { Column, TableOptions } from '@ticatec/uniface-element/ConciseDataTable';
22
+
23
+ let data = [
24
+ { id: 1, name: 'John Doe', department: 'Engineering', salary: 75000, joinDate: '2023-01-15' },
25
+ { id: 2, name: 'Jane Smith', department: 'Marketing', salary: 68000, joinDate: '2023-02-20' },
26
+ { id: 3, name: 'Mike Johnson', department: 'Sales', salary: 72000, joinDate: '2023-03-10' }
27
+ ];
28
+
29
+ const columns: Column[] = [
30
+ { title: 'Name', field: 'name', width: 150 },
31
+ { title: 'Department', field: 'department', width: 120 },
32
+ { title: 'Salary', field: 'salary', width: 100, align: 'right' },
33
+ { title: 'Join Date', field: 'joinDate', width: 120, align: 'center' }
34
+ ];
35
+
36
+ const options: TableOptions = {
37
+ headerHeight: 40,
38
+ rowHeight: 35
39
+ };
40
+ </script>
41
+
42
+ <ConciseDataTable
43
+ list={data}
44
+ {columns}
45
+ {options}
46
+ />
47
+ ```
48
+
49
+ ## Properties
50
+
51
+ | Property | Type | Default | Description |
52
+ |----------|------|---------|-------------|
53
+ | `list` | `Array<any>` | - | Array of data objects to display |
54
+ | `columns` | `Array<Column>` | - | Column definitions for the table |
55
+ | `autoScroll` | `boolean` | `false` | Enable automatic scrolling |
56
+ | `scrollInterval` | `number` | `2000` | Milliseconds between scroll steps |
57
+ | `rowClickHandler` | `RowClickHandler \| null` | `null` | Handler function for row clicks |
58
+ | `options` | `TableOptions` | `{}` | Table styling and behavior options |
59
+
60
+ ## Type Definitions
61
+
62
+ ```typescript
63
+ /**
64
+ * Column configuration interface
65
+ */
66
+ interface Column {
67
+ title: string; // Display title for column header
68
+ field: string; // Field name in data object
69
+ width: number; // Width in pixels
70
+ align?: "left" | "center" | "right"; // Text alignment (default: "left")
71
+ weight?: number; // Flex weight (0 = fixed, >0 = proportional)
72
+ formatter?: (value: any) => string; // Custom formatter function
73
+ escapeHTML?: boolean; // Allow HTML content (default: false)
74
+ }
75
+
76
+ /**
77
+ * Table styling and behavior options
78
+ */
79
+ interface TableOptions {
80
+ backgroundColor?: string; // Table background color
81
+ color?: string; // Table text color
82
+ headerHeight?: number; // Header row height (default: 36px)
83
+ headerBackgroundColor?: string; // Header background color
84
+ headerColor?: string; // Header text color
85
+ alternativeBackgroundColor?: string; // Alternating row background color
86
+ alternativeColor?: string; // Alternating row text color
87
+ rowHeight?: number; // Data row height (default: 32px)
88
+ }
89
+
90
+ /**
91
+ * Row click handler function
92
+ */
93
+ type RowClickHandler = (row: any) => (event: MouseEvent) => void;
94
+ ```
95
+
96
+ ## Usage Examples
97
+
98
+ ### Auto-Scrolling Table
99
+
100
+ ```svelte
101
+ <script lang="ts">
102
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
103
+ import type { Column, TableOptions } from '@ticatec/uniface-element/ConciseDataTable';
104
+
105
+ // Sample real-time data for monitoring
106
+ let serverStats = [
107
+ { server: 'Web-01', cpu: '45%', memory: '68%', disk: '32%', status: 'Online' },
108
+ { server: 'Web-02', cpu: '62%', memory: '71%', disk: '28%', status: 'Online' },
109
+ { server: 'DB-01', cpu: '78%', memory: '85%', disk: '65%', status: 'Warning' },
110
+ { server: 'Cache-01', cpu: '23%', memory: '34%', disk: '12%', status: 'Online' },
111
+ { server: 'API-01', cpu: '56%', memory: '67%', disk: '45%', status: 'Online' },
112
+ { server: 'API-02', cpu: '89%', memory: '92%', disk: '78%', status: 'Critical' },
113
+ { server: 'Load-01', cpu: '34%', memory: '45%', disk: '23%', status: 'Online' },
114
+ { server: 'Monitor-01', cpu: '12%', memory: '28%', disk: '15%', status: 'Online' }
115
+ ];
116
+
117
+ const columns: Column[] = [
118
+ {
119
+ title: 'Server',
120
+ field: 'server',
121
+ width: 120,
122
+ align: 'center'
123
+ },
124
+ {
125
+ title: 'CPU Usage',
126
+ field: 'cpu',
127
+ width: 100,
128
+ align: 'center'
129
+ },
130
+ {
131
+ title: 'Memory',
132
+ field: 'memory',
133
+ width: 100,
134
+ align: 'center'
135
+ },
136
+ {
137
+ title: 'Disk',
138
+ field: 'disk',
139
+ width: 100,
140
+ align: 'center'
141
+ },
142
+ {
143
+ title: 'Status',
144
+ field: 'status',
145
+ width: 120,
146
+ align: 'center',
147
+ formatter: (status) => {
148
+ const colors = {
149
+ 'Online': '#10b981',
150
+ 'Warning': '#f59e0b',
151
+ 'Critical': '#ef4444'
152
+ };
153
+ return `<span style="color: ${colors[status] || '#6b7280'}; font-weight: 500;">${status}</span>`;
154
+ },
155
+ escapeHTML: true
156
+ }
157
+ ];
158
+
159
+ const options: TableOptions = {
160
+ headerHeight: 40,
161
+ rowHeight: 36,
162
+ headerBackgroundColor: '#1f2937',
163
+ headerColor: '#f9fafb',
164
+ backgroundColor: '#ffffff',
165
+ alternativeBackgroundColor: '#f8fafc'
166
+ };
167
+
168
+ // Simulate data updates
169
+ setInterval(() => {
170
+ serverStats = serverStats.map(server => ({
171
+ ...server,
172
+ cpu: Math.floor(Math.random() * 100) + '%',
173
+ memory: Math.floor(Math.random() * 100) + '%',
174
+ disk: Math.floor(Math.random() * 100) + '%'
175
+ }));
176
+ }, 3000);
177
+ </script>
178
+
179
+ <div class="monitoring-dashboard">
180
+ <h2>Server Monitoring Dashboard</h2>
181
+
182
+ <ConciseDataTable
183
+ list={serverStats}
184
+ {columns}
185
+ {options}
186
+ autoScroll={true}
187
+ scrollInterval={4000}
188
+ />
189
+ </div>
190
+
191
+ <style>
192
+ .monitoring-dashboard {
193
+ padding: 20px;
194
+ max-width: 800px;
195
+ margin: 0 auto;
196
+ }
197
+
198
+ h2 {
199
+ color: #1f2937;
200
+ margin-bottom: 20px;
201
+ text-align: center;
202
+ }
203
+ </style>
204
+ ```
205
+
206
+ ### Financial Data Table with Formatters
207
+
208
+ ```svelte
209
+ <script lang="ts">
210
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
211
+ import type { Column, TableOptions, RowClickHandler } from '@ticatec/uniface-element/ConciseDataTable';
212
+
213
+ interface StockData {
214
+ symbol: string;
215
+ company: string;
216
+ price: number;
217
+ change: number;
218
+ changePercent: number;
219
+ volume: number;
220
+ marketCap: number;
221
+ }
222
+
223
+ let stockData: StockData[] = [
224
+ { symbol: 'AAPL', company: 'Apple Inc.', price: 182.52, change: 2.34, changePercent: 1.30, volume: 45678912, marketCap: 2847000000000 },
225
+ { symbol: 'MSFT', company: 'Microsoft Corp.', price: 378.85, change: -1.23, changePercent: -0.32, volume: 23456789, marketCap: 2817000000000 },
226
+ { symbol: 'GOOGL', company: 'Alphabet Inc.', price: 142.56, change: 0.87, changePercent: 0.61, volume: 34567890, marketCap: 1798000000000 },
227
+ { symbol: 'AMZN', company: 'Amazon.com Inc.', price: 151.23, change: -2.45, changePercent: -1.59, volume: 56789012, marketCap: 1567000000000 }
228
+ ];
229
+
230
+ const columns: Column[] = [
231
+ {
232
+ title: 'Symbol',
233
+ field: 'symbol',
234
+ width: 80,
235
+ align: 'center'
236
+ },
237
+ {
238
+ title: 'Company',
239
+ field: 'company',
240
+ width: 200,
241
+ weight: 1 // This column will expand to fill available space
242
+ },
243
+ {
244
+ title: 'Price',
245
+ field: 'price',
246
+ width: 100,
247
+ align: 'right',
248
+ formatter: (value) => `$${value.toFixed(2)}`
249
+ },
250
+ {
251
+ title: 'Change',
252
+ field: 'change',
253
+ width: 100,
254
+ align: 'right',
255
+ formatter: (value) => {
256
+ const sign = value >= 0 ? '+' : '';
257
+ const color = value >= 0 ? '#10b981' : '#ef4444';
258
+ return `<span style="color: ${color}; font-weight: 500;">${sign}${value.toFixed(2)}</span>`;
259
+ },
260
+ escapeHTML: true
261
+ },
262
+ {
263
+ title: 'Change %',
264
+ field: 'changePercent',
265
+ width: 100,
266
+ align: 'right',
267
+ formatter: (value) => {
268
+ const sign = value >= 0 ? '+' : '';
269
+ const color = value >= 0 ? '#10b981' : '#ef4444';
270
+ return `<span style="color: ${color}; font-weight: 500;">${sign}${value.toFixed(2)}%</span>`;
271
+ },
272
+ escapeHTML: true
273
+ },
274
+ {
275
+ title: 'Volume',
276
+ field: 'volume',
277
+ width: 120,
278
+ align: 'right',
279
+ formatter: (value) => {
280
+ if (value >= 1000000) {
281
+ return `${(value / 1000000).toFixed(1)}M`;
282
+ } else if (value >= 1000) {
283
+ return `${(value / 1000).toFixed(1)}K`;
284
+ }
285
+ return value.toString();
286
+ }
287
+ },
288
+ {
289
+ title: 'Market Cap',
290
+ field: 'marketCap',
291
+ width: 120,
292
+ align: 'right',
293
+ formatter: (value) => {
294
+ if (value >= 1000000000000) {
295
+ return `$${(value / 1000000000000).toFixed(2)}T`;
296
+ } else if (value >= 1000000000) {
297
+ return `$${(value / 1000000000).toFixed(2)}B`;
298
+ }
299
+ return `$${(value / 1000000).toFixed(2)}M`;
300
+ }
301
+ }
302
+ ];
303
+
304
+ const options: TableOptions = {
305
+ headerHeight: 45,
306
+ rowHeight: 40,
307
+ headerBackgroundColor: '#0f172a',
308
+ headerColor: '#f1f5f9',
309
+ backgroundColor: '#ffffff',
310
+ alternativeBackgroundColor: '#f8fafc',
311
+ color: '#334155'
312
+ };
313
+
314
+ const handleRowClick: RowClickHandler = (stock) => (event) => {
315
+ console.log(`Clicked on ${stock.symbol} - ${stock.company}`);
316
+ // Could open detailed view, navigate to stock page, etc.
317
+ alert(`Stock Details:\n${stock.company} (${stock.symbol})\nPrice: $${stock.price.toFixed(2)}`);
318
+ };
319
+
320
+ // Simulate real-time price updates
321
+ setInterval(() => {
322
+ stockData = stockData.map(stock => ({
323
+ ...stock,
324
+ price: stock.price + (Math.random() - 0.5) * 5,
325
+ change: (Math.random() - 0.5) * 4,
326
+ changePercent: (Math.random() - 0.5) * 3,
327
+ volume: Math.floor(Math.random() * 100000000)
328
+ }));
329
+ }, 2000);
330
+ </script>
331
+
332
+ <div class="stock-tracker">
333
+ <h2>Stock Price Tracker</h2>
334
+
335
+ <ConciseDataTable
336
+ list={stockData}
337
+ {columns}
338
+ {options}
339
+ rowClickHandler={handleRowClick}
340
+ />
341
+
342
+ <div class="disclaimer">
343
+ <p><em>Click on any row to view stock details. Prices update every 2 seconds.</em></p>
344
+ </div>
345
+ </div>
346
+
347
+ <style>
348
+ .stock-tracker {
349
+ padding: 20px;
350
+ max-width: 1000px;
351
+ margin: 0 auto;
352
+ }
353
+
354
+ h2 {
355
+ color: #0f172a;
356
+ margin-bottom: 20px;
357
+ text-align: center;
358
+ font-size: 1.8rem;
359
+ }
360
+
361
+ .disclaimer {
362
+ margin-top: 16px;
363
+ text-align: center;
364
+ color: #64748b;
365
+ font-size: 0.875rem;
366
+ }
367
+ </style>
368
+ ```
369
+
370
+ ### Employee Directory with Interactive Features
371
+
372
+ ```svelte
373
+ <script lang="ts">
374
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
375
+ import type { Column, TableOptions, RowClickHandler } from '@ticatec/uniface-element/ConciseDataTable';
376
+
377
+ interface Employee {
378
+ id: number;
379
+ name: string;
380
+ email: string;
381
+ department: string;
382
+ position: string;
383
+ salary: number;
384
+ joinDate: string;
385
+ status: 'Active' | 'On Leave' | 'Remote';
386
+ }
387
+
388
+ let employees: Employee[] = [
389
+ { id: 1, name: 'John Doe', email: 'john.doe@company.com', department: 'Engineering', position: 'Senior Developer', salary: 95000, joinDate: '2022-01-15', status: 'Active' },
390
+ { id: 2, name: 'Jane Smith', email: 'jane.smith@company.com', department: 'Marketing', position: 'Marketing Manager', salary: 78000, joinDate: '2021-11-20', status: 'Active' },
391
+ { id: 3, name: 'Mike Johnson', email: 'mike.johnson@company.com', department: 'Sales', position: 'Sales Representative', salary: 65000, joinDate: '2023-03-10', status: 'Remote' },
392
+ { id: 4, name: 'Sarah Williams', email: 'sarah.williams@company.com', department: 'HR', position: 'HR Specialist', salary: 58000, joinDate: '2022-07-08', status: 'On Leave' },
393
+ { id: 5, name: 'David Brown', email: 'david.brown@company.com', department: 'Engineering', position: 'Tech Lead', salary: 110000, joinDate: '2020-05-12', status: 'Active' }
394
+ ];
395
+
396
+ const columns: Column[] = [
397
+ {
398
+ title: 'ID',
399
+ field: 'id',
400
+ width: 60,
401
+ align: 'center'
402
+ },
403
+ {
404
+ title: 'Name',
405
+ field: 'name',
406
+ width: 140,
407
+ align: 'left'
408
+ },
409
+ {
410
+ title: 'Email',
411
+ field: 'email',
412
+ width: 200,
413
+ weight: 1,
414
+ formatter: (email) => `<a href="mailto:${email}" style="color: #3b82f6; text-decoration: none;">${email}</a>`,
415
+ escapeHTML: true
416
+ },
417
+ {
418
+ title: 'Department',
419
+ field: 'department',
420
+ width: 120,
421
+ align: 'center'
422
+ },
423
+ {
424
+ title: 'Position',
425
+ field: 'position',
426
+ width: 150,
427
+ align: 'left'
428
+ },
429
+ {
430
+ title: 'Salary',
431
+ field: 'salary',
432
+ width: 100,
433
+ align: 'right',
434
+ formatter: (value) => `$${value.toLocaleString()}`
435
+ },
436
+ {
437
+ title: 'Join Date',
438
+ field: 'joinDate',
439
+ width: 110,
440
+ align: 'center',
441
+ formatter: (date) => new Date(date).toLocaleDateString()
442
+ },
443
+ {
444
+ title: 'Status',
445
+ field: 'status',
446
+ width: 100,
447
+ align: 'center',
448
+ formatter: (status) => {
449
+ const statusConfig = {
450
+ 'Active': { color: '#10b981', bg: '#ecfdf5' },
451
+ 'Remote': { color: '#3b82f6', bg: '#eff6ff' },
452
+ 'On Leave': { color: '#f59e0b', bg: '#fffbeb' }
453
+ };
454
+ const config = statusConfig[status] || { color: '#6b7280', bg: '#f9fafb' };
455
+ return `<span style="background: ${config.bg}; color: ${config.color}; padding: 4px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 500;">${status}</span>`;
456
+ },
457
+ escapeHTML: true
458
+ }
459
+ ];
460
+
461
+ const options: TableOptions = {
462
+ headerHeight: 48,
463
+ rowHeight: 44,
464
+ headerBackgroundColor: '#f8fafc',
465
+ headerColor: '#374151',
466
+ backgroundColor: '#ffffff',
467
+ alternativeBackgroundColor: '#f9fafb',
468
+ color: '#374151'
469
+ };
470
+
471
+ const handleEmployeeClick: RowClickHandler = (employee) => (event) => {
472
+ console.log('Employee clicked:', employee);
473
+ showEmployeeDetails(employee);
474
+ };
475
+
476
+ let selectedEmployee: Employee | null = null;
477
+ let showModal = false;
478
+
479
+ function showEmployeeDetails(employee: Employee) {
480
+ selectedEmployee = employee;
481
+ showModal = true;
482
+ }
483
+
484
+ function closeModal() {
485
+ showModal = false;
486
+ selectedEmployee = null;
487
+ }
488
+ </script>
489
+
490
+ <div class="employee-directory">
491
+ <h2>Employee Directory</h2>
492
+ <p class="subtitle">Click on any employee row to view detailed information</p>
493
+
494
+ <ConciseDataTable
495
+ list={employees}
496
+ {columns}
497
+ {options}
498
+ rowClickHandler={handleEmployeeClick}
499
+ />
500
+ </div>
501
+
502
+ {#if showModal && selectedEmployee}
503
+ <div class="modal-overlay" on:click={closeModal}>
504
+ <div class="modal" on:click|stopPropagation>
505
+ <div class="modal-header">
506
+ <h3>Employee Details</h3>
507
+ <button class="close-btn" on:click={closeModal}>&times;</button>
508
+ </div>
509
+ <div class="modal-content">
510
+ <div class="employee-info">
511
+ <div class="info-row">
512
+ <span class="label">Full Name:</span>
513
+ <span class="value">{selectedEmployee.name}</span>
514
+ </div>
515
+ <div class="info-row">
516
+ <span class="label">Employee ID:</span>
517
+ <span class="value">#{selectedEmployee.id.toString().padStart(4, '0')}</span>
518
+ </div>
519
+ <div class="info-row">
520
+ <span class="label">Email:</span>
521
+ <span class="value">{selectedEmployee.email}</span>
522
+ </div>
523
+ <div class="info-row">
524
+ <span class="label">Department:</span>
525
+ <span class="value">{selectedEmployee.department}</span>
526
+ </div>
527
+ <div class="info-row">
528
+ <span class="label">Position:</span>
529
+ <span class="value">{selectedEmployee.position}</span>
530
+ </div>
531
+ <div class="info-row">
532
+ <span class="label">Annual Salary:</span>
533
+ <span class="value">${selectedEmployee.salary.toLocaleString()}</span>
534
+ </div>
535
+ <div class="info-row">
536
+ <span class="label">Join Date:</span>
537
+ <span class="value">{new Date(selectedEmployee.joinDate).toLocaleDateString()}</span>
538
+ </div>
539
+ <div class="info-row">
540
+ <span class="label">Status:</span>
541
+ <span class="value status-{selectedEmployee.status.toLowerCase().replace(' ', '-')}">{selectedEmployee.status}</span>
542
+ </div>
543
+ </div>
544
+ </div>
545
+ </div>
546
+ </div>
547
+ {/if}
548
+
549
+ <style>
550
+ .employee-directory {
551
+ padding: 20px;
552
+ max-width: 1200px;
553
+ margin: 0 auto;
554
+ }
555
+
556
+ h2 {
557
+ color: #111827;
558
+ margin-bottom: 8px;
559
+ text-align: center;
560
+ font-size: 2rem;
561
+ }
562
+
563
+ .subtitle {
564
+ color: #6b7280;
565
+ text-align: center;
566
+ margin-bottom: 24px;
567
+ font-style: italic;
568
+ }
569
+
570
+ .modal-overlay {
571
+ position: fixed;
572
+ top: 0;
573
+ left: 0;
574
+ right: 0;
575
+ bottom: 0;
576
+ background: rgba(0, 0, 0, 0.5);
577
+ display: flex;
578
+ align-items: center;
579
+ justify-content: center;
580
+ z-index: 1000;
581
+ }
582
+
583
+ .modal {
584
+ background: white;
585
+ border-radius: 12px;
586
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
587
+ max-width: 500px;
588
+ width: 90%;
589
+ max-height: 80vh;
590
+ overflow: hidden;
591
+ }
592
+
593
+ .modal-header {
594
+ display: flex;
595
+ justify-content: space-between;
596
+ align-items: center;
597
+ padding: 20px 24px;
598
+ background: #f8fafc;
599
+ border-bottom: 1px solid #e2e8f0;
600
+ }
601
+
602
+ .modal-header h3 {
603
+ margin: 0;
604
+ color: #1f2937;
605
+ font-size: 1.25rem;
606
+ }
607
+
608
+ .close-btn {
609
+ background: none;
610
+ border: none;
611
+ font-size: 24px;
612
+ cursor: pointer;
613
+ color: #6b7280;
614
+ padding: 0;
615
+ width: 30px;
616
+ height: 30px;
617
+ display: flex;
618
+ align-items: center;
619
+ justify-content: center;
620
+ border-radius: 50%;
621
+ transition: background-color 0.2s;
622
+ }
623
+
624
+ .close-btn:hover {
625
+ background: #e5e7eb;
626
+ color: #374151;
627
+ }
628
+
629
+ .modal-content {
630
+ padding: 24px;
631
+ }
632
+
633
+ .employee-info {
634
+ display: grid;
635
+ gap: 16px;
636
+ }
637
+
638
+ .info-row {
639
+ display: flex;
640
+ justify-content: space-between;
641
+ align-items: center;
642
+ padding: 12px 0;
643
+ border-bottom: 1px solid #f3f4f6;
644
+ }
645
+
646
+ .info-row:last-child {
647
+ border-bottom: none;
648
+ }
649
+
650
+ .label {
651
+ font-weight: 500;
652
+ color: #374151;
653
+ }
654
+
655
+ .value {
656
+ color: #111827;
657
+ }
658
+
659
+ .value.status-active {
660
+ color: #10b981;
661
+ font-weight: 500;
662
+ }
663
+
664
+ .value.status-remote {
665
+ color: #3b82f6;
666
+ font-weight: 500;
667
+ }
668
+
669
+ .value.status-on-leave {
670
+ color: #f59e0b;
671
+ font-weight: 500;
672
+ }
673
+ </style>
674
+ ```
675
+
676
+ ## Styling
677
+
678
+ The ConciseDataTable component uses the following CSS classes and custom properties:
679
+
680
+ ```css
681
+ .uniface-concise-table {
682
+ /* Main table container */
683
+ }
684
+
685
+ .concise-table-header {
686
+ /* Header row styling */
687
+ }
688
+
689
+ .concise-table-row {
690
+ /* Data row styling */
691
+ }
692
+
693
+ .concise-table-cell {
694
+ /* Individual cell styling */
695
+ }
696
+
697
+ /* CSS Custom Properties for Theming */
698
+ :root {
699
+ --uniface-concise-table-primary-color: #374151;
700
+ --uniface-concise-table-primary-background-color: #ffffff;
701
+ --uniface-concise-table-header-background: #f8fafc;
702
+ --uniface-concise-table-header-color: #374151;
703
+ --uniface-concise-table-row-alter-bg: #f9fafb;
704
+ --uniface-concise-table-row-alter-color: #374151;
705
+ }
706
+ ```
707
+
708
+ ## API Reference
709
+
710
+ ### ConciseDataTable Component Props
711
+
712
+ ```typescript
713
+ interface ConciseDataTableProps {
714
+ list: Array<any>; // Data array to display
715
+ columns: Array<Column>; // Column definitions
716
+ autoScroll?: boolean; // Enable auto-scrolling
717
+ scrollInterval?: number; // Scroll interval in ms
718
+ rowClickHandler?: RowClickHandler; // Row click handler
719
+ options?: TableOptions; // Styling options
720
+ }
721
+ ```
722
+
723
+ ## Best Practices
724
+
725
+ 1. **Performance** - Use auto-scroll judiciously for large datasets to avoid performance issues
726
+ 2. **Column Design** - Balance fixed-width and flexible columns using the `weight` property
727
+ 3. **Data Formatting** - Use formatters for consistent data presentation (currency, dates, percentages)
728
+ 4. **Accessibility** - Ensure adequate color contrast and meaningful row click behaviors
729
+ 5. **Mobile Responsiveness** - Consider horizontal scrolling for tables with many columns
730
+ 6. **Error Handling** - Validate data structure before passing to the component
731
+ 7. **Memory Management** - For auto-scrolling tables, monitor memory usage with large datasets
732
+ 8. **User Feedback** - Provide clear visual feedback for interactive elements like clickable rows