@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,622 @@
1
+ # Accordion Component
2
+
3
+ A collapsible content container component that allows organizing multiple sections of content in a space-efficient expandable/collapsible format.
4
+
5
+ ## Overview
6
+
7
+ The Accordion component provides an elegant way to display multiple sections of content where users can expand and collapse individual sections. It supports both exclusive (only one section open at a time) and multi-open modes, making it perfect for FAQs, navigation menus, content organization, and dashboard sections.
8
+
9
+ ## Installation
10
+
11
+ ```typescript
12
+ import Accordion from '@ticatec/uniface-element/Accordion';
13
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
14
+ ```
15
+
16
+ ## Basic Usage
17
+
18
+ ```svelte
19
+ <script lang="ts">
20
+ import Accordion from '@ticatec/uniface-element/Accordion';
21
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
22
+
23
+ // Import your components
24
+ import UserProfile from './UserProfile.svelte';
25
+ import Settings from './Settings.svelte';
26
+ import Reports from './Reports.svelte';
27
+
28
+ let accordionItems: AccordionItem[] = [
29
+ {
30
+ title: 'User Profile',
31
+ component: UserProfile,
32
+ params: { userId: 123 }
33
+ },
34
+ {
35
+ title: 'Settings',
36
+ component: Settings
37
+ },
38
+ {
39
+ title: 'Reports',
40
+ component: Reports,
41
+ params: { type: 'monthly' }
42
+ }
43
+ ];
44
+ </script>
45
+
46
+ <Accordion accordions={accordionItems} />
47
+ ```
48
+
49
+ ## Properties
50
+
51
+ | Property | Type | Default | Description |
52
+ |----------|------|---------|-------------|
53
+ | `style` | `string` | `''` | Custom CSS styles for the accordion container |
54
+ | `class` | `string` | `''` | Additional CSS class names |
55
+ | `compact` | `boolean` | `false` | Use compact styling with reduced padding |
56
+ | `accordions` | `Array<AccordionItem>` | `[]` | Array of accordion items to display |
57
+ | `exclusive` | `boolean` | `false` | Only allow one accordion to be open at a time |
58
+ | `activeItem` | `AccordionItem` | `null` | Currently active item (used with exclusive mode) |
59
+
60
+ ## AccordionItem Interface
61
+
62
+ ```typescript
63
+ interface AccordionItem {
64
+ /**
65
+ * Display title for the accordion section
66
+ */
67
+ title: string;
68
+
69
+ /**
70
+ * Svelte component to render in the accordion content
71
+ */
72
+ component: any;
73
+
74
+ /**
75
+ * Parameters/props to pass to the component
76
+ */
77
+ params?: any;
78
+ }
79
+ ```
80
+
81
+ ## Usage Examples
82
+
83
+ ### Basic Accordion
84
+
85
+ ```svelte
86
+ <script lang="ts">
87
+ import Accordion from '@ticatec/uniface-element/Accordion';
88
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
89
+
90
+ // Simple text components for demo
91
+ let TextSection = (text: string) => `<div class="section-content"><p>${text}</p></div>`;
92
+
93
+ let items: AccordionItem[] = [
94
+ {
95
+ title: 'Getting Started',
96
+ component: TextSection,
97
+ params: { text: 'Welcome to our platform! Here you\'ll find everything you need to get started.' }
98
+ },
99
+ {
100
+ title: 'Features',
101
+ component: TextSection,
102
+ params: { text: 'Explore the powerful features available in our application.' }
103
+ },
104
+ {
105
+ title: 'Support',
106
+ component: TextSection,
107
+ params: { text: 'Need help? Contact our support team for assistance.' }
108
+ }
109
+ ];
110
+ </script>
111
+
112
+ <Accordion accordions={items} />
113
+ ```
114
+
115
+ ### Exclusive Mode Accordion
116
+
117
+ ```svelte
118
+ <script lang="ts">
119
+ import Accordion from '@ticatec/uniface-element/Accordion';
120
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
121
+
122
+ import DashboardPanel from './DashboardPanel.svelte';
123
+ import AnalyticsPanel from './AnalyticsPanel.svelte';
124
+ import SettingsPanel from './SettingsPanel.svelte';
125
+
126
+ let dashboardItems: AccordionItem[] = [
127
+ {
128
+ title: 'Dashboard Overview',
129
+ component: DashboardPanel,
130
+ params: { view: 'overview' }
131
+ },
132
+ {
133
+ title: 'Analytics',
134
+ component: AnalyticsPanel,
135
+ params: { period: '30d' }
136
+ },
137
+ {
138
+ title: 'Settings',
139
+ component: SettingsPanel
140
+ }
141
+ ];
142
+
143
+ let activeItem: AccordionItem = dashboardItems[0];
144
+ </script>
145
+
146
+ <Accordion
147
+ accordions={dashboardItems}
148
+ exclusive={true}
149
+ bind:activeItem
150
+ />
151
+ ```
152
+
153
+ ### Compact Accordion
154
+
155
+ ```svelte
156
+ <script lang="ts">
157
+ import Accordion from '@ticatec/uniface-element/Accordion';
158
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
159
+
160
+ import QuickAction from './QuickAction.svelte';
161
+
162
+ let quickActions: AccordionItem[] = [
163
+ {
164
+ title: 'Quick Actions',
165
+ component: QuickAction,
166
+ params: { actions: ['create', 'edit', 'delete'] }
167
+ },
168
+ {
169
+ title: 'Recent Items',
170
+ component: QuickAction,
171
+ params: { type: 'recent', limit: 5 }
172
+ },
173
+ {
174
+ title: 'Favorites',
175
+ component: QuickAction,
176
+ params: { type: 'favorites' }
177
+ }
178
+ ];
179
+ </script>
180
+
181
+ <Accordion
182
+ accordions={quickActions}
183
+ compact={true}
184
+ class="sidebar-accordion"
185
+ style="max-width: 300px;"
186
+ />
187
+ ```
188
+
189
+ ### Dynamic Accordion with Real Components
190
+
191
+ ```svelte
192
+ <script lang="ts">
193
+ import Accordion from '@ticatec/uniface-element/Accordion';
194
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
195
+
196
+ // Import actual components
197
+ import UserListComponent from './components/UserListComponent.svelte';
198
+ import ProductCatalog from './components/ProductCatalog.svelte';
199
+ import OrderHistory from './components/OrderHistory.svelte';
200
+ import SystemLogs from './components/SystemLogs.svelte';
201
+
202
+ let currentUser = { id: 1, role: 'admin' };
203
+
204
+ let adminSections: AccordionItem[] = [
205
+ {
206
+ title: 'User Management',
207
+ component: UserListComponent,
208
+ params: {
209
+ editable: true,
210
+ filters: ['active', 'pending'],
211
+ currentUser: currentUser
212
+ }
213
+ },
214
+ {
215
+ title: 'Product Catalog',
216
+ component: ProductCatalog,
217
+ params: {
218
+ mode: 'admin',
219
+ showHidden: true,
220
+ allowEdit: true
221
+ }
222
+ },
223
+ {
224
+ title: 'Order History',
225
+ component: OrderHistory,
226
+ params: {
227
+ dateRange: '30d',
228
+ status: 'all',
229
+ exportEnabled: true
230
+ }
231
+ },
232
+ {
233
+ title: 'System Logs',
234
+ component: SystemLogs,
235
+ params: {
236
+ level: 'info',
237
+ realTime: true,
238
+ maxLines: 1000
239
+ }
240
+ }
241
+ ];
242
+
243
+ // Handle dynamic updates
244
+ function refreshAccordion() {
245
+ adminSections = [...adminSections];
246
+ }
247
+ </script>
248
+
249
+ <div class="admin-dashboard">
250
+ <h2>Admin Dashboard</h2>
251
+
252
+ <Accordion
253
+ accordions={adminSections}
254
+ style="border: 1px solid #e0e0e0; border-radius: 8px;"
255
+ class="admin-accordion"
256
+ />
257
+
258
+ <button on:click={refreshAccordion} class="refresh-btn">
259
+ Refresh Data
260
+ </button>
261
+ </div>
262
+
263
+ <style>
264
+ .admin-dashboard {
265
+ max-width: 1200px;
266
+ margin: 0 auto;
267
+ padding: 20px;
268
+ }
269
+
270
+ .refresh-btn {
271
+ margin-top: 20px;
272
+ padding: 10px 20px;
273
+ background: #007bff;
274
+ color: white;
275
+ border: none;
276
+ border-radius: 4px;
277
+ cursor: pointer;
278
+ }
279
+
280
+ .refresh-btn:hover {
281
+ background: #0056b3;
282
+ }
283
+
284
+ :global(.admin-accordion) {
285
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
286
+ }
287
+ </style>
288
+ ```
289
+
290
+ ### FAQ Accordion
291
+
292
+ ```svelte
293
+ <script lang="ts">
294
+ import Accordion from '@ticatec/uniface-element/Accordion';
295
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
296
+
297
+ // Create a simple FAQ content component
298
+ const FAQContent = (content: string) => {
299
+ return `<div class="faq-content">${content}</div>`;
300
+ };
301
+
302
+ let faqItems: AccordionItem[] = [
303
+ {
304
+ title: 'What is this platform?',
305
+ component: FAQContent,
306
+ params: 'Our platform is a comprehensive solution for managing your business operations, including user management, analytics, and reporting tools.'
307
+ },
308
+ {
309
+ title: 'How do I get started?',
310
+ component: FAQContent,
311
+ params: 'Getting started is easy! Sign up for an account, complete your profile, and follow our step-by-step onboarding guide.'
312
+ },
313
+ {
314
+ title: 'What are the pricing options?',
315
+ component: FAQContent,
316
+ params: 'We offer flexible pricing plans including a free tier, professional plan at $29/month, and enterprise solutions. Contact our sales team for custom pricing.'
317
+ },
318
+ {
319
+ title: 'How can I contact support?',
320
+ component: FAQContent,
321
+ params: 'You can reach our support team 24/7 through the chat widget, email us at support@company.com, or call our hotline at 1-800-SUPPORT.'
322
+ },
323
+ {
324
+ title: 'Is my data secure?',
325
+ component: FAQContent,
326
+ params: 'Absolutely! We use enterprise-grade encryption, regular security audits, and comply with GDPR, SOC 2, and other security standards.'
327
+ }
328
+ ];
329
+ </script>
330
+
331
+ <div class="faq-section">
332
+ <h2>Frequently Asked Questions</h2>
333
+ <p class="faq-subtitle">Find answers to common questions about our platform</p>
334
+
335
+ <Accordion
336
+ accordions={faqItems}
337
+ class="faq-accordion"
338
+ style="margin-top: 30px;"
339
+ />
340
+ </div>
341
+
342
+ <style>
343
+ .faq-section {
344
+ max-width: 800px;
345
+ margin: 0 auto;
346
+ padding: 40px 20px;
347
+ }
348
+
349
+ .faq-section h2 {
350
+ text-align: center;
351
+ color: #333;
352
+ margin-bottom: 10px;
353
+ }
354
+
355
+ .faq-subtitle {
356
+ text-align: center;
357
+ color: #666;
358
+ margin-bottom: 0;
359
+ }
360
+
361
+ :global(.faq-content) {
362
+ padding: 16px;
363
+ line-height: 1.6;
364
+ color: #555;
365
+ }
366
+
367
+ :global(.faq-accordion .uniface-accordion-panel) {
368
+ border: 1px solid #e0e0e0;
369
+ border-radius: 8px;
370
+ margin-bottom: 12px;
371
+ }
372
+ </style>
373
+ ```
374
+
375
+ ### Nested Content Accordion
376
+
377
+ ```svelte
378
+ <script lang="ts">
379
+ import Accordion from '@ticatec/uniface-element/Accordion';
380
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
381
+
382
+ // Complex nested component example
383
+ import ProjectDetails from './ProjectDetails.svelte';
384
+ import TaskManager from './TaskManager.svelte';
385
+ import TeamOverview from './TeamOverview.svelte';
386
+ import FileManager from './FileManager.svelte';
387
+
388
+ let projectId = 'proj-123';
389
+ let projectData = {
390
+ name: 'Website Redesign',
391
+ status: 'active',
392
+ deadline: '2024-06-30'
393
+ };
394
+
395
+ let projectSections: AccordionItem[] = [
396
+ {
397
+ title: `Project Details - ${projectData.name}`,
398
+ component: ProjectDetails,
399
+ params: {
400
+ projectId,
401
+ projectData,
402
+ editable: true,
403
+ showTimeline: true
404
+ }
405
+ },
406
+ {
407
+ title: 'Task Management',
408
+ component: TaskManager,
409
+ params: {
410
+ projectId,
411
+ view: 'kanban',
412
+ allowAssignment: true,
413
+ filters: ['all', 'assigned', 'completed']
414
+ }
415
+ },
416
+ {
417
+ title: 'Team & Collaboration',
418
+ component: TeamOverview,
419
+ params: {
420
+ projectId,
421
+ showActivity: true,
422
+ allowInvite: true,
423
+ roles: ['admin', 'member', 'viewer']
424
+ }
425
+ },
426
+ {
427
+ title: 'Files & Documents',
428
+ component: FileManager,
429
+ params: {
430
+ projectId,
431
+ allowUpload: true,
432
+ maxFileSize: '10MB',
433
+ allowedTypes: ['.pdf', '.doc', '.jpg', '.png']
434
+ }
435
+ }
436
+ ];
437
+
438
+ // Auto-select first item
439
+ let activeSection = projectSections[0];
440
+ </script>
441
+
442
+ <div class="project-workspace">
443
+ <div class="project-header">
444
+ <h1>{projectData.name}</h1>
445
+ <span class="status-badge status-{projectData.status}">
446
+ {projectData.status.toUpperCase()}
447
+ </span>
448
+ </div>
449
+
450
+ <Accordion
451
+ accordions={projectSections}
452
+ exclusive={true}
453
+ bind:activeItem={activeSection}
454
+ class="project-accordion"
455
+ style="margin-top: 20px;"
456
+ />
457
+ </div>
458
+
459
+ <style>
460
+ .project-workspace {
461
+ max-width: 1200px;
462
+ margin: 0 auto;
463
+ padding: 20px;
464
+ }
465
+
466
+ .project-header {
467
+ display: flex;
468
+ align-items: center;
469
+ gap: 16px;
470
+ margin-bottom: 20px;
471
+ }
472
+
473
+ .project-header h1 {
474
+ margin: 0;
475
+ color: #333;
476
+ }
477
+
478
+ .status-badge {
479
+ padding: 4px 12px;
480
+ border-radius: 16px;
481
+ font-size: 0.75rem;
482
+ font-weight: 600;
483
+ text-transform: uppercase;
484
+ }
485
+
486
+ .status-active {
487
+ background: #d4edda;
488
+ color: #155724;
489
+ }
490
+
491
+ :global(.project-accordion) {
492
+ border: 1px solid #dee2e6;
493
+ border-radius: 8px;
494
+ overflow: hidden;
495
+ }
496
+ </style>
497
+ ```
498
+
499
+ ## Styling
500
+
501
+ The Accordion component uses the following CSS classes:
502
+
503
+ ```css
504
+ .uniface-accordion-panel {
505
+ /* Main accordion container */
506
+ }
507
+
508
+ .uniface-accordion-panel.compact {
509
+ /* Compact variant with reduced padding */
510
+ }
511
+
512
+ /* Individual accordion items are styled by the AccordionItemView component */
513
+ ```
514
+
515
+ ## Advanced Usage
516
+
517
+ ### Programmatic Control
518
+
519
+ ```svelte
520
+ <script lang="ts">
521
+ import Accordion from '@ticatec/uniface-element/Accordion';
522
+ import type { AccordionItem } from '@ticatec/uniface-element/Accordion';
523
+
524
+ let accordionRef: Accordion;
525
+ let items: AccordionItem[] = [...];
526
+ let activeItem: AccordionItem;
527
+
528
+ function openSpecificSection(index: number) {
529
+ if (items[index]) {
530
+ activeItem = items[index];
531
+ }
532
+ }
533
+
534
+ function addNewSection() {
535
+ const newItem: AccordionItem = {
536
+ title: `New Section ${items.length + 1}`,
537
+ component: SomeComponent,
538
+ params: { id: Date.now() }
539
+ };
540
+ items = [...items, newItem];
541
+ }
542
+
543
+ function removeSection(index: number) {
544
+ items = items.filter((_, i) => i !== index);
545
+ }
546
+ </script>
547
+
548
+ <div class="controls">
549
+ <button on:click={() => openSpecificSection(0)}>Open First</button>
550
+ <button on:click={addNewSection}>Add Section</button>
551
+ </div>
552
+
553
+ <Accordion
554
+ bind:this={accordionRef}
555
+ accordions={items}
556
+ bind:activeItem
557
+ exclusive={true}
558
+ />
559
+ ```
560
+
561
+ ## API Reference
562
+
563
+ ### Accordion Component Props
564
+
565
+ ```typescript
566
+ interface AccordionProps {
567
+ style?: string; // Custom CSS styles
568
+ class?: string; // Additional CSS classes
569
+ compact?: boolean; // Use compact styling
570
+ accordions: Array<AccordionItem>; // Accordion items array
571
+ exclusive?: boolean; // Only one open at a time
572
+ activeItem?: AccordionItem; // Currently active item
573
+ }
574
+ ```
575
+
576
+ ### AccordionItem Interface
577
+
578
+ ```typescript
579
+ interface AccordionItem {
580
+ /**
581
+ * Display title for the accordion section
582
+ */
583
+ title: string;
584
+
585
+ /**
586
+ * Svelte component to render in accordion content
587
+ */
588
+ component: any;
589
+
590
+ /**
591
+ * Parameters/props to pass to the component
592
+ */
593
+ params?: any;
594
+ }
595
+ ```
596
+
597
+ ## Best Practices
598
+
599
+ 1. **Meaningful Titles** - Use clear, descriptive titles that indicate what content the section contains
600
+ 2. **Component Organization** - Keep accordion content components focused and self-contained
601
+ 3. **Performance** - Consider lazy loading for heavy content components
602
+ 4. **Exclusive Mode** - Use exclusive mode for navigation-style accordions, multi-open for content organization
603
+ 5. **Responsive Design** - Ensure accordion content works well on mobile devices
604
+ 6. **Loading States** - Handle loading states gracefully when accordion content requires data fetching
605
+ 7. **Keyboard Navigation** - Ensure accordion sections are keyboard accessible
606
+ 8. **Visual Hierarchy** - Use consistent styling to maintain visual hierarchy within accordion content
607
+
608
+ ## Accessibility
609
+
610
+ The Accordion component follows accessibility best practices:
611
+
612
+ - Proper ARIA attributes for screen readers
613
+ - Keyboard navigation support
614
+ - Focus management when expanding/collapsing
615
+ - Semantic HTML structure
616
+
617
+ ## Performance Considerations
618
+
619
+ - Components are only instantiated when their accordion section is opened
620
+ - Use the `params` prop to pass only necessary data to components
621
+ - Consider implementing lazy loading for data-heavy components
622
+ - Avoid deeply nested accordion structures for better performance