@ticatec/uniface-element 5.0.5 → 5.1.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 (395) hide show
  1. package/README.md +4 -3
  2. package/README_CN.md +4 -3
  3. package/dist/app_layout/ColumnsLayout.svelte +14 -10
  4. package/dist/app_layout/ColumnsLayout.svelte.d.ts +8 -4
  5. package/dist/app_layout/README.md +14 -12
  6. package/dist/app_layout/README_CN.md +14 -12
  7. package/dist/app_layout/RowsLayout.svelte +14 -10
  8. package/dist/app_layout/RowsLayout.svelte.d.ts +8 -4
  9. package/dist/base-calendar/CalendarBase.svelte +4 -10
  10. package/dist/base-calendar/CalendarBase.svelte.d.ts +0 -4
  11. package/dist/base-calendar/MonthlyCalendar.svelte +11 -3
  12. package/dist/base-calendar/MonthlyCalendar.svelte.d.ts +1 -2
  13. package/dist/base-calendar/YearPickupPanel.svelte +5 -5
  14. package/dist/base-calendar/YearPickupPanel.svelte.d.ts +2 -2
  15. package/dist/base-calendar/dateUtils.js +9 -5
  16. package/dist/composite/pagination_panel/PaginationPanel.svelte +15 -12
  17. package/dist/composite/pagination_panel/PaginationPanel.svelte.d.ts +8 -5
  18. package/dist/composite/pagination_panel/README.md +3 -1
  19. package/dist/composite/pagination_panel/README_CN.md +3 -1
  20. package/dist/composite/transfer/Transfer.svelte +30 -15
  21. package/dist/composite/transfer/Transfer.svelte.d.ts +11 -4
  22. package/dist/composite/transfer/index.d.ts +2 -2
  23. package/dist/data_display/accordion/Accordion.svelte +10 -9
  24. package/dist/data_display/accordion/Accordion.svelte.d.ts +2 -1
  25. package/dist/data_display/accordion/AccordionItemView.svelte +6 -6
  26. package/dist/data_display/accordion/AccordionItemView.svelte.d.ts +1 -1
  27. package/dist/data_display/accordion/README.md +6 -4
  28. package/dist/data_display/accordion/README_CN.md +6 -4
  29. package/dist/data_display/card/Card.svelte +13 -11
  30. package/dist/data_display/card/Card.svelte.d.ts +5 -3
  31. package/dist/data_display/card/CardAction.d.ts +7 -2
  32. package/dist/data_display/card/CommonCardActionBar.svelte +2 -2
  33. package/dist/data_display/card/README.md +11 -9
  34. package/dist/data_display/card/README_CN.md +11 -9
  35. package/dist/data_display/card/index.d.ts +2 -1
  36. package/dist/data_display/concise_data_table/Column.d.ts +0 -6
  37. package/dist/data_display/concise_data_table/ConciseListTable.svelte +6 -5
  38. package/dist/data_display/concise_data_table/ConciseListTable.svelte.d.ts +4 -3
  39. package/dist/data_display/concise_data_table/DataCell.svelte +1 -1
  40. package/dist/data_display/concise_data_table/README.md +7 -5
  41. package/dist/data_display/concise_data_table/README_CN.md +7 -5
  42. package/dist/data_display/concise_data_table/TableOptions.d.ts +1 -1
  43. package/dist/data_display/list_box/ListBox.svelte +11 -15
  44. package/dist/data_display/list_box/ListBox.svelte.d.ts +6 -9
  45. package/dist/data_display/list_box/README.md +10 -8
  46. package/dist/data_display/list_box/README_CN.md +10 -8
  47. package/dist/data_display/list_box/index.d.ts +2 -3
  48. package/dist/data_display/tree_view/README.md +4 -2
  49. package/dist/data_display/tree_view/README_CN.md +4 -2
  50. package/dist/data_display/tree_view/TreeNodeView.svelte +15 -16
  51. package/dist/data_display/tree_view/TreeNodeView.svelte.d.ts +4 -5
  52. package/dist/data_display/tree_view/TreeView.svelte +27 -19
  53. package/dist/data_display/tree_view/TreeView.svelte.d.ts +12 -4
  54. package/dist/data_display/tree_view/index.d.ts +2 -3
  55. package/dist/data_table/DataTable.svelte +15 -14
  56. package/dist/data_table/DataTable.svelte.d.ts +2 -1
  57. package/dist/data_table/README.md +10 -8
  58. package/dist/data_table/README_CN.md +10 -8
  59. package/dist/data_table/UniDataTable.d.ts +4 -4
  60. package/dist/data_table/UniDataTable.js +2 -2
  61. package/dist/data_table/index.d.ts +5 -5
  62. package/dist/data_table/lib/CellAction.d.ts +9 -0
  63. package/dist/data_table/lib/CommonHeaderCell.d.ts +2 -2
  64. package/dist/data_table/lib/CompareFn.d.ts +3 -0
  65. package/dist/data_table/lib/DataColumn.d.ts +7 -12
  66. package/dist/data_table/lib/FormatCellFn.d.ts +2 -0
  67. package/dist/data_table/lib/HrefLink.d.ts +3 -3
  68. package/dist/data_table/lib/IndicatorColumn.d.ts +2 -1
  69. package/dist/data_table/lib/RowAction.d.ts +14 -20
  70. package/dist/data_table/parts/ActionCell.svelte +3 -3
  71. package/dist/data_table/parts/ActionCell.svelte.d.ts +1 -1
  72. package/dist/data_table/parts/ActionsRow.svelte +7 -5
  73. package/dist/data_table/parts/ContentPanel.svelte +14 -14
  74. package/dist/data_table/parts/ContentPanel.svelte.d.ts +5 -5
  75. package/dist/data_table/parts/FixedColumnsPanel.svelte +15 -15
  76. package/dist/data_table/parts/FixedColumnsPanel.svelte.d.ts +4 -4
  77. package/dist/data_table/parts/FixedHeaderPanel.svelte +13 -13
  78. package/dist/data_table/parts/FixedHeaderPanel.svelte.d.ts +4 -4
  79. package/dist/data_table/parts/FixedRow.svelte +9 -9
  80. package/dist/data_table/parts/FixedRow.svelte.d.ts +3 -3
  81. package/dist/data_table/parts/HrefCell.svelte +1 -1
  82. package/dist/data_table/parts/PopupMenu.svelte +3 -3
  83. package/dist/data_table/parts/PopupMenu.svelte.d.ts +1 -1
  84. package/dist/data_table/parts/TableHeaderPanel.svelte +14 -14
  85. package/dist/data_table/parts/TableHeaderPanel.svelte.d.ts +4 -4
  86. package/dist/data_table/parts/TextCell.svelte +1 -1
  87. package/dist/feedback/progress-bar/ProgressBar.svelte +13 -10
  88. package/dist/feedback/progress-bar/ProgressBar.svelte.d.ts +6 -3
  89. package/dist/form/FormEditor.svelte +2 -2
  90. package/dist/form/FormEditor.svelte.d.ts +1 -1
  91. package/dist/form/attachment_files/AttachmentEditor.svelte +407 -92
  92. package/dist/form/attachment_files/AttachmentEditor.svelte.d.ts +71 -15
  93. package/dist/form/attachment_files/AttachmentFile.d.ts +35 -8
  94. package/dist/form/attachment_files/AttachmentFile.js +54 -29
  95. package/dist/form/attachment_files/AttachmentListItem.svelte +208 -0
  96. package/dist/form/attachment_files/AttachmentListItem.svelte.d.ts +25 -0
  97. package/dist/form/attachment_files/AttachmentTile.svelte +296 -0
  98. package/dist/form/attachment_files/AttachmentTile.svelte.d.ts +25 -0
  99. package/dist/form/attachment_files/FileUpload.d.ts +2 -2
  100. package/dist/form/attachment_files/README.md +71 -452
  101. package/dist/form/attachment_files/README_CN.md +68 -449
  102. package/dist/form/attachment_files/UploadTask.d.ts +27 -0
  103. package/dist/form/attachment_files/index.d.ts +8 -5
  104. package/dist/form/attachment_files/index.js +4 -2
  105. package/dist/form/cascade_options_select/CascadeOptionSelect.svelte +16 -15
  106. package/dist/form/cascade_options_select/CascadeOptionSelect.svelte.d.ts +6 -5
  107. package/dist/form/cascade_options_select/IsLeaf.d.ts +4 -0
  108. package/dist/form/cascade_options_select/IsLeaf.js +1 -0
  109. package/dist/form/cascade_options_select/OptionsBox.svelte +4 -4
  110. package/dist/form/cascade_options_select/OptionsBox.svelte.d.ts +2 -2
  111. package/dist/form/color_picker/ColorPicker.svelte +3 -3
  112. package/dist/form/common_editor/BasePicker.svelte +7 -7
  113. package/dist/form/common_editor/BasePicker.svelte.d.ts +3 -3
  114. package/dist/form/common_editor/CommonEditor.svelte +8 -8
  115. package/dist/form/common_editor/CommonEditor.svelte.d.ts +2 -2
  116. package/dist/form/common_editor/CommonPicker.svelte +43 -31
  117. package/dist/form/common_editor/CommonPicker.svelte.d.ts +6 -6
  118. package/dist/form/common_editor/CommonPickerProps.d.ts +2 -2
  119. package/dist/form/common_editor/CommonPopupEditor.svelte +13 -13
  120. package/dist/form/common_editor/CommonPopupEditor.svelte.d.ts +3 -4
  121. package/dist/form/common_editor/NumberInput.svelte +10 -2
  122. package/dist/form/common_editor/NumberInput.svelte.d.ts +1 -1
  123. package/dist/form/common_range_editor/CommonRangeEditor.svelte +17 -17
  124. package/dist/form/common_range_editor/CommonRangeEditor.svelte.d.ts +5 -5
  125. package/dist/form/date_picker/DatePicker.svelte +5 -5
  126. package/dist/form/date_picker/DatePicker.svelte.d.ts +1 -1
  127. package/dist/form/date_picker/DateTimePicker.svelte +15 -5
  128. package/dist/form/date_picker/README.md +7 -5
  129. package/dist/form/date_picker/README_CN.md +7 -5
  130. package/dist/form/date_picker/ScrollBar.svelte +21 -20
  131. package/dist/form/date_picker/ScrollBar.svelte.d.ts +3 -3
  132. package/dist/form/date_range/DateRangeEditor.svelte +6 -6
  133. package/dist/form/events.d.ts +70 -0
  134. package/dist/form/events.js +6 -0
  135. package/dist/form/group_box/group-check-box/GroupCheckBox.svelte +9 -7
  136. package/dist/form/group_box/group-check-box/GroupCheckBox.svelte.d.ts +4 -3
  137. package/dist/form/group_box/group-check-box/README.md +5 -3
  138. package/dist/form/group_box/group-check-box/README_CN.md +5 -3
  139. package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte +9 -7
  140. package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte.d.ts +4 -3
  141. package/dist/form/group_box/group-radio-box/README.md +3 -1
  142. package/dist/form/group_box/group-radio-box/README_CN.md +3 -1
  143. package/dist/form/image_editor/ImageEditor.svelte +118 -0
  144. package/dist/form/image_editor/ImageEditor.svelte.d.ts +52 -0
  145. package/dist/form/image_editor/ImageFile.d.ts +11 -0
  146. package/dist/form/image_editor/ImageFile.js +1 -0
  147. package/dist/form/{image-files → image_editor}/ImagePreview.svelte +10 -2
  148. package/dist/form/image_editor/README.md +89 -0
  149. package/dist/form/image_editor/README_CN.md +89 -0
  150. package/dist/form/image_editor/index.d.ts +11 -0
  151. package/dist/form/image_editor/index.js +4 -0
  152. package/dist/form/input_options_select/InputOptionsSelect.svelte +11 -8
  153. package/dist/form/input_options_select/InputOptionsSelect.svelte.d.ts +2 -1
  154. package/dist/form/input_options_select/README.md +44 -218
  155. package/dist/form/input_options_select/README_CN.md +38 -211
  156. package/dist/form/lookup_editor/LookupEditor.svelte +7 -10
  157. package/dist/form/lookup_editor/LookupEditor.svelte.d.ts +2 -1
  158. package/dist/form/memo_editor/MemoEditor.svelte +2 -2
  159. package/dist/form/memo_editor/MemoEditor.svelte.d.ts +1 -1
  160. package/dist/form/number_editor/NumberEditor.svelte +13 -1
  161. package/dist/form/number_editor/NumberEditor.svelte.d.ts +1 -1
  162. package/dist/form/number_range/NumberRange.svelte +5 -5
  163. package/dist/form/options_multi_select/OptionsMultiSelect.svelte +13 -13
  164. package/dist/form/options_multi_select/OptionsMultiSelect.svelte.d.ts +3 -2
  165. package/dist/form/options_multi_select/README.md +5 -3
  166. package/dist/form/options_multi_select/README_CN.md +5 -3
  167. package/dist/form/options_select/OptionsSelect.svelte +17 -13
  168. package/dist/form/options_select/OptionsSelect.svelte.d.ts +2 -1
  169. package/dist/form/options_select/README.md +9 -7
  170. package/dist/form/options_select/README_CN.md +8 -6
  171. package/dist/form/prompts_text_editor/PromptsTextEditor.svelte +6 -5
  172. package/dist/form/prompts_text_editor/PromptsTextEditor.svelte.d.ts +2 -1
  173. package/dist/form/prompts_text_editor/README.md +16 -14
  174. package/dist/form/prompts_text_editor/README_CN.md +16 -14
  175. package/dist/form/search_box/SearchBox.svelte +3 -2
  176. package/dist/form/search_box/SearchBox.svelte.d.ts +1 -1
  177. package/dist/form/switch/README.md +7 -5
  178. package/dist/form/switch/README_CN.md +7 -5
  179. package/dist/form/switch/Switch.svelte +7 -5
  180. package/dist/form/switch/Switch.svelte.d.ts +4 -2
  181. package/dist/form/text_editor/PasswordEditor.svelte +2 -2
  182. package/dist/form/text_editor/PasswordEditor.svelte.d.ts +1 -1
  183. package/dist/form/text_editor/TextEditor.svelte +6 -4
  184. package/dist/form/text_editor/TextEditor.svelte.d.ts +1 -1
  185. package/dist/form/time_editor/README.md +4 -2
  186. package/dist/form/time_editor/README_CN.md +4 -2
  187. package/dist/form/time_editor/TimeEditor.svelte +10 -7
  188. package/dist/form/time_editor/TimeEditor.svelte.d.ts +2 -1
  189. package/dist/form/types.d.ts +5 -42
  190. package/dist/form/unit-number-editor/README.md +21 -19
  191. package/dist/form/unit-number-editor/README_CN.md +21 -19
  192. package/dist/form/unit-number-editor/UnitNumberEditor.svelte +12 -11
  193. package/dist/form/unit-number-editor/UnitNumberEditor.svelte.d.ts +4 -3
  194. package/dist/general/button/Button.svelte +4 -1
  195. package/dist/general/button/Button.svelte.d.ts +3 -1
  196. package/dist/general/button/IconButton.svelte +11 -5
  197. package/dist/general/button/IconButton.svelte.d.ts +5 -2
  198. package/dist/general/button/IconButton_README.md +9 -6
  199. package/dist/general/button/IconButton_README_CN.md +9 -6
  200. package/dist/general/button/TextButton.svelte +15 -5
  201. package/dist/general/button/TextButton.svelte.d.ts +6 -2
  202. package/dist/general/button/TextButton_README.md +10 -6
  203. package/dist/general/button/TextButton_README_CN.md +10 -6
  204. package/dist/general/icon/Icon.svelte +6 -4
  205. package/dist/general/icon/Icon.svelte.d.ts +3 -2
  206. package/dist/general/tag/Tag.svelte +8 -4
  207. package/dist/general/tag/Tag.svelte.d.ts +3 -1
  208. package/dist/i18nRes/i18nRes.d.ts +5 -1
  209. package/dist/i18nRes/i18nRes.js +5 -1
  210. package/dist/layouts/action_bar/ActionBar.svelte +5 -4
  211. package/dist/layouts/action_bar/ActionBar.svelte.d.ts +2 -1
  212. package/dist/layouts/action_bar/ButtonAction.d.ts +1 -23
  213. package/dist/layouts/action_bar/README.md +20 -18
  214. package/dist/layouts/action_bar/README_CN.md +19 -17
  215. package/dist/layouts/box/Box.svelte +4 -3
  216. package/dist/layouts/box/Box.svelte.d.ts +2 -1
  217. package/dist/layouts/box/README.md +13 -11
  218. package/dist/layouts/box/README_CN.md +13 -11
  219. package/dist/layouts/form_field/FormField.svelte +5 -4
  220. package/dist/layouts/form_field/FormField.svelte.d.ts +3 -2
  221. package/dist/layouts/form_field/README.md +11 -9
  222. package/dist/layouts/form_field/README_CN.md +9 -7
  223. package/dist/layouts/form_panel/flex_row_form/Cell.svelte +3 -1
  224. package/dist/layouts/form_panel/flex_row_form/Cell.svelte.d.ts +3 -1
  225. package/dist/layouts/form_panel/flex_row_form/Row.svelte +3 -1
  226. package/dist/layouts/form_panel/flex_row_form/Row.svelte.d.ts +3 -1
  227. package/dist/layouts/form_panel/grid_form/GridField.svelte +8 -4
  228. package/dist/layouts/form_panel/grid_form/GridField.svelte.d.ts +6 -2
  229. package/dist/layouts/form_panel/grid_form/GridForm.svelte +3 -1
  230. package/dist/layouts/form_panel/grid_form/GridForm.svelte.d.ts +3 -1
  231. package/dist/layouts/form_panel/grid_form/README.md +6 -4
  232. package/dist/layouts/form_panel/grid_form/README_CN.md +6 -4
  233. package/dist/layouts/page/Page.svelte +7 -7
  234. package/dist/layouts/page/Page.svelte.d.ts +2 -2
  235. package/dist/layouts/page/PageHeader.svelte +4 -4
  236. package/dist/layouts/page/PageHeader.svelte.d.ts +1 -1
  237. package/dist/layouts/page/README.md +18 -18
  238. package/dist/layouts/page/README_CN.md +18 -18
  239. package/dist/navigation/nav_menu/MenuItem.d.ts +1 -1
  240. package/dist/navigation/nav_menu/NavigatorMenu.svelte +16 -14
  241. package/dist/navigation/nav_menu/NavigatorMenu.svelte.d.ts +7 -5
  242. package/dist/navigation/nav_menu/NavigatorMenuItem.svelte +2 -2
  243. package/dist/navigation/nav_menu/NavigatorMenuItem.svelte.d.ts +2 -2
  244. package/dist/navigation/nav_menu/README.md +8 -6
  245. package/dist/navigation/nav_menu/README_CN.md +8 -6
  246. package/dist/navigation/nav_menu/index.d.ts +2 -2
  247. package/dist/navigation/navigator/Navigator.svelte +5 -4
  248. package/dist/navigation/navigator/Navigator.svelte.d.ts +3 -2
  249. package/dist/navigation/navigator/README.md +12 -10
  250. package/dist/navigation/navigator/README_CN.md +12 -10
  251. package/dist/navigation/pagination/Pagination.svelte +23 -15
  252. package/dist/navigation/pagination/Pagination.svelte.d.ts +6 -4
  253. package/dist/navigation/progress_step_bar/ProgressStep.d.ts +2 -1
  254. package/dist/navigation/progress_step_bar/ProgressStepBar.svelte +5 -4
  255. package/dist/navigation/progress_step_bar/ProgressStepBar.svelte.d.ts +2 -1
  256. package/dist/navigation/progress_step_bar/ProgressStepBlock.svelte +3 -3
  257. package/dist/navigation/progress_step_bar/ProgressStepBlock.svelte.d.ts +1 -1
  258. package/dist/navigation/progress_step_bar/README.md +37 -35
  259. package/dist/navigation/progress_step_bar/README_CN.md +36 -34
  260. package/dist/navigation/tabs/Tabs.svelte +14 -5
  261. package/dist/navigation/tabs/Tabs.svelte.d.ts +11 -4
  262. package/dist/navigation/tabs/index.d.ts +2 -2
  263. package/dist/overlay/common/ModalPopover.svelte +5 -4
  264. package/dist/overlay/common/ModalPopover.svelte.d.ts +2 -1
  265. package/dist/overlay/common/Popover.svelte +4 -3
  266. package/dist/overlay/common/Popover.svelte.d.ts +2 -1
  267. package/dist/overlay/context-menu/ContextMenuItem.d.ts +3 -3
  268. package/dist/overlay/context-menu/ContextMenuPanel.svelte +4 -4
  269. package/dist/overlay/context-menu/index.d.ts +2 -2
  270. package/dist/overlay/dialog/CommonDialog.svelte +16 -12
  271. package/dist/overlay/dialog/CommonDialog.svelte.d.ts +9 -5
  272. package/dist/overlay/dialog/Dialog.svelte +25 -19
  273. package/dist/overlay/dialog/Dialog.svelte.d.ts +11 -5
  274. package/dist/overlay/dialog/DialogActions.d.ts +1 -1
  275. package/dist/overlay/dialog/DialogCloseConfirm.d.ts +4 -1
  276. package/dist/overlay/dialog/DialogCloseConfirm.js +1 -1
  277. package/dist/overlay/dialog/DialogManager.svelte.js +2 -1
  278. package/dist/overlay/dialog/README.md +19 -17
  279. package/dist/overlay/dialog/README_CN.md +19 -17
  280. package/dist/overlay/dialog/index.d.ts +2 -2
  281. package/dist/overlay/message-box/IMessageBox.d.ts +4 -4
  282. package/dist/ticatec-uniface-web.css +38 -12
  283. package/dist/types.d.ts +38 -46
  284. package/dist/unifaceContext.d.ts +2 -2
  285. package/dist/utils/prefixFilter.js +0 -1
  286. package/docs/NAMING.md +362 -0
  287. package/docs/NAMING_CN.md +362 -0
  288. package/docs/components/README.md +16 -14
  289. package/docs/components/accordion/README.md +13 -2
  290. package/docs/components/accordion/example.svelte +1 -0
  291. package/docs/components/action-bar/README.md +4 -4
  292. package/docs/components/attachment-editor/README.md +224 -0
  293. package/docs/components/attachment-editor/example.svelte +22 -0
  294. package/docs/components/box/README.md +1 -1
  295. package/docs/components/button/README.md +8 -1
  296. package/docs/components/button/example.svelte +1 -0
  297. package/docs/components/card/README.md +19 -5
  298. package/docs/components/cascade-options-select/README.md +11 -5
  299. package/docs/components/columns-layout/README.md +8 -4
  300. package/docs/components/columns-layout/example.svelte +4 -0
  301. package/docs/components/common-dialog/README.md +19 -10
  302. package/docs/components/common-dialog/example.svelte +2 -1
  303. package/docs/components/concise-data-table/README.md +18 -29
  304. package/docs/components/concise-data-table/example.svelte +1 -1
  305. package/docs/components/context-menu/README.md +5 -5
  306. package/docs/components/context-menu/example.svelte +1 -1
  307. package/docs/components/criteria-field/README.md +1 -0
  308. package/docs/components/criteria-field/example.svelte +1 -0
  309. package/docs/components/data-table/README.md +63 -40
  310. package/docs/components/data-table/example.svelte +2 -2
  311. package/docs/components/date-picker/README.md +1 -1
  312. package/docs/components/date-time-picker/README.md +1 -1
  313. package/docs/components/dialog/README.md +21 -14
  314. package/docs/components/dialog/example.svelte +1 -1
  315. package/docs/components/form-field/README.md +3 -3
  316. package/docs/components/grid-form/README.md +15 -5
  317. package/docs/components/grid-form/example.svelte +1 -1
  318. package/docs/components/group-check-box/README.md +3 -3
  319. package/docs/components/group-radio-box/README.md +3 -3
  320. package/docs/components/icon/README.md +6 -5
  321. package/docs/components/icon-button/README.md +10 -1
  322. package/docs/components/icon-button/example.svelte +1 -0
  323. package/docs/components/image-editor/README.md +262 -0
  324. package/docs/components/{image-files → image-editor}/example.svelte +5 -3
  325. package/docs/components/input-options-select/README.md +2 -2
  326. package/docs/components/list-box/README.md +12 -13
  327. package/docs/components/list-box/example.svelte +3 -3
  328. package/docs/components/lookup-editor/README.md +1 -1
  329. package/docs/components/navigator/README.md +2 -1
  330. package/docs/components/navigator/example.svelte +1 -0
  331. package/docs/components/navigator-menu/README.md +24 -21
  332. package/docs/components/navigator-menu/example.svelte +4 -2
  333. package/docs/components/options-multi-select/README.md +2 -2
  334. package/docs/components/options-select/README.md +4 -4
  335. package/docs/components/page/README.md +2 -2
  336. package/docs/components/page-stack/README.md +67 -0
  337. package/docs/components/page-stack/example.svelte +7 -0
  338. package/docs/components/pagination/README.md +24 -7
  339. package/docs/components/pagination/example.svelte +5 -2
  340. package/docs/components/pagination-panel/README.md +25 -10
  341. package/docs/components/pagination-panel/example.svelte +5 -4
  342. package/docs/components/password-editor/README.md +128 -0
  343. package/docs/components/{attachment-files → password-editor}/example.svelte +5 -5
  344. package/docs/components/progress-bar/README.md +14 -4
  345. package/docs/components/progress-bar/example.svelte +1 -1
  346. package/docs/components/progress-step-bar/README.md +16 -7
  347. package/docs/components/progress-step-bar/example.svelte +5 -1
  348. package/docs/components/prompts-text-editor/README.md +8 -6
  349. package/docs/components/prompts-text-editor/example.svelte +0 -1
  350. package/docs/components/rows-layout/README.md +8 -4
  351. package/docs/components/rows-layout/example.svelte +4 -0
  352. package/docs/components/switch/README.md +2 -2
  353. package/docs/components/tabs/README.md +24 -9
  354. package/docs/components/tag/README.md +13 -2
  355. package/docs/components/tag/example.svelte +1 -0
  356. package/docs/components/text-button/README.md +20 -1
  357. package/docs/components/text-button/example.svelte +2 -0
  358. package/docs/components/time-editor/README.md +1 -1
  359. package/docs/components/transfer/README.md +16 -9
  360. package/docs/components/tree-view/README.md +29 -13
  361. package/docs/components/tree-view/example.svelte +2 -1
  362. package/docs/components/unit-number-editor/README.md +11 -8
  363. package/docs/components/unit-number-editor/example.svelte +0 -1
  364. package/package.json +13 -7
  365. package/dist/data_table/lib/CompareFunction.d.ts +0 -3
  366. package/dist/data_table/lib/FormatCell.d.ts +0 -2
  367. package/dist/form/attachment_files/FileRender.svelte +0 -125
  368. package/dist/form/attachment_files/FileRender.svelte.d.ts +0 -9
  369. package/dist/form/attachment_files/FileUploadBar.svelte +0 -66
  370. package/dist/form/attachment_files/FileUploadBar.svelte.d.ts +0 -8
  371. package/dist/form/attachment_files/FileUploadPanel.svelte +0 -161
  372. package/dist/form/attachment_files/FileUploadPanel.svelte.d.ts +0 -14
  373. package/dist/form/attachment_files/UploadFile.d.ts +0 -43
  374. package/dist/form/attachment_files/UploadFile.js +0 -80
  375. package/dist/form/cascade_options_select/CascadePanel.svelte +0 -52
  376. package/dist/form/cascade_options_select/CascadePanel.svelte.d.ts +0 -26
  377. package/dist/form/cascade_options_select/isLeafDetermine.d.ts +0 -4
  378. package/dist/form/common_editor/EditorEvents.d.ts +0 -14
  379. package/dist/form/common_editor/EditorEvents.js +0 -2
  380. package/dist/form/image-files/ImageFile.d.ts +0 -12
  381. package/dist/form/image-files/ImageFilesField.svelte +0 -128
  382. package/dist/form/image-files/ImageFilesField.svelte.d.ts +0 -18
  383. package/dist/form/image-files/ImageRender.svelte +0 -95
  384. package/dist/form/image-files/ImageRender.svelte.d.ts +0 -10
  385. package/dist/form/image-files/README.md +0 -468
  386. package/dist/form/image-files/README_CN.md +0 -468
  387. package/dist/form/image-files/index.d.ts +0 -10
  388. package/dist/form/image-files/index.js +0 -2
  389. package/docs/components/attachment-files/README.md +0 -332
  390. package/docs/components/image-files/README.md +0 -174
  391. /package/dist/data_table/lib/{FormatCell.js → CellAction.js} +0 -0
  392. /package/dist/data_table/lib/{CompareFunction.js → CompareFn.js} +0 -0
  393. /package/dist/{form/cascade_options_select/isLeafDetermine.js → data_table/lib/FormatCellFn.js} +0 -0
  394. /package/dist/form/{image-files/ImageFile.js → attachment_files/UploadTask.js} +0 -0
  395. /package/dist/form/{image-files → image_editor}/ImagePreview.svelte.d.ts +0 -0
@@ -1,492 +1,111 @@
1
- # AttachmentFilesField
1
+ # AttachmentEditor
2
2
 
3
- A file upload component for attaching documents, spreadsheets, presentations, PDFs, and other file types. Users can drag-and-drop files or click to browse. Each file is displayed as a row with an icon, filename, and action buttons (download, delete). Supports multiple files, file type detection, and optional confirmation before deletion.
3
+ A form field for uploading and managing attachments (documents, spreadsheets, PDFs, media, anything). The whole field is a drop zone; the upload entry is a placeholder that sits at the end of the content (a dashed row in `list` layout, a "+" tile in `icon` layout) and expands to fill the field while it is empty. Uploads run inline with a progress indicator and a cancel button; failed uploads can be retried or discarded.
4
4
 
5
- > Think of it as a file manager for your form. Upload, preview, and manage attachments with a consistent UI.
5
+ > Rewritten in 5.1.0. Names follow the [API Naming Guide](../../../docs/NAMING.md); the old `onUpload` prop and the modal `FileUploadPanel` are gone (no compatibility aliases).
6
6
 
7
7
  ## Features
8
8
 
9
- - **File upload** supports drag-and-drop and click-to-browse.
10
- - **File type detection** — automatically detects file types (image, PDF, DOC, XLS, PPT, audio, video, other).
11
- - **File list display** shows uploaded files with icons, filenames, and action buttons.
12
- - **Delete with confirmation** — optional `removeFileConfirm` callback for deletion confirmation.
13
- - **Multiple files** supports uploading multiple files at once.
14
- - **Download** — click the download icon to download a file.
15
- - **Upload progress** shows upload progress with a progress bar.
16
- - **Disabled / readonly** modes.
17
- - **Compact mode** for dense UIs.
9
+ - **Drag & drop** anywhere inside the field, or click the placeholder to open the file dialog.
10
+ - **Two layouts** — `list` (one row per file, download + delete at the end of the row) and `icon` (tiles that wrap automatically).
11
+ - **Fixed height** via `height`; the content scrolls inside.
12
+ - **Inline upload progress** — list rows show a bar, percentage and a cancel button; tiles overlay a progress ring with the cancel button in the middle.
13
+ - **Retry / discard** failed uploads.
14
+ - **Limits** — `accept`, `maxSize`, `maxFiles`, `multiple`; rejected files are reported through `onFileRejected`.
15
+ - **Veto hook** `beforeRemove` and notifications `onremove`, `onchange`, `onFileUploaded`, `onUploadError`.
16
+ - **Readonly / disabled** — download stays available, delete and the upload entry disappear, drops are ignored.
17
+ - Inherits the shared field props (`variant`, `compact`, `theme`, `tooltip`, `error`, `style`, `onfocus`, `onblur`).
18
18
 
19
- ## Installation
20
-
21
- ```bash
22
- npm install @ticatec/uniface-element
23
- ```
24
-
25
- ## 引入
19
+ ## Import
26
20
 
27
21
  ```typescript
28
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
29
- import type { AttachmentFile, RemoveConfirm, FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
22
+ import AttachmentEditor from "@ticatec/uniface-element/AttachmentEditor";
23
+ import type {AttachmentFile, AttachmentLayout, FileUpload, RejectReason} from "@ticatec/uniface-element/AttachmentEditor";
30
24
  ```
31
25
 
32
- ## Basic Usage
26
+ ## Basic usage
33
27
 
34
28
  ```svelte
35
29
  <script lang="ts">
36
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
37
- import type { AttachmentFile, FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
30
+ import AttachmentEditor from "@ticatec/uniface-element/AttachmentEditor";
31
+ import type {AttachmentFile, FileUpload} from "@ticatec/uniface-element/AttachmentEditor";
38
32
 
39
33
  let files = $state<AttachmentFile[]>([]);
40
34
 
41
- // Simulated upload function
42
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
43
- // Simulate upload progress
44
- let progress = 0;
45
- const interval = setInterval(() => {
46
- progress += 10;
47
- progressUpdate(Math.floor(file.size * (progress / 100)));
48
-
49
- if (progress >= 100) {
50
- clearInterval(interval);
51
- // Simulate successful upload
52
- const fakeUrl = `/uploads/${file.name}`;
53
- onUploaded(fakeUrl);
54
- }
55
- }, 100);
56
-
57
- return {
58
- cancel: async () => {
59
- clearInterval(interval);
60
- return true;
61
- }
62
- };
35
+ const uploadFile: FileUpload = (file, progressUpdate, onUploaded, onError) => {
36
+ const xhr = new XMLHttpRequest();
37
+ xhr.upload.onprogress = (e) => progressUpdate(e.loaded);
38
+ xhr.onload = () => xhr.status < 300 ? onUploaded(JSON.parse(xhr.responseText).url) : onError(new Error(xhr.statusText));
39
+ xhr.onerror = () => onError(new Error('Network error'));
40
+ const body = new FormData();
41
+ body.append('file', file);
42
+ xhr.open('POST', '/api/upload');
43
+ xhr.send(body);
44
+ return {cancel: async () => { xhr.abort(); return true; }};
63
45
  };
64
-
65
- function handleFilesChange(updatedFiles: AttachmentFile[]) {
66
- console.log("Files updated:", updatedFiles);
67
- // ... save to backend
68
- }
69
46
  </script>
70
47
 
71
- <AttachmentFilesField
72
- bind:files={files}
73
- uploadFile={uploadFile}
74
- onchange={handleFilesChange}
75
- maxFiles={5}
76
- />
48
+ <AttachmentEditor bind:files {uploadFile} layout="icon" height={160} maxFiles={5}
49
+ onchange={(list) => console.log('files', list)}/>
77
50
  ```
78
51
 
79
52
  ## Props
80
53
 
81
- `AttachmentFilesField` extends `CommonFieldProps`, so it inherits `variant`, `compact`, `disabled`, `readonly`, `style`, `error`, `tooltip`, `theme`, `placeholder`.
54
+ Props inherited from `CommonFieldProps` (`variant`, `compact`, `disabled`, `readonly`, `theme`, `tooltip`, `error`, `style`, `onfocus`, `onblur`) are not repeated.
82
55
 
83
56
  | Prop | Type | Default | Description |
84
57
  |------|------|---------|-------------|
85
- | `files` | `Array<AttachmentFile>` (bindable) | `[]` | Array of uploaded files. Each file has `name`, `uri`, and `type` properties. |
86
- | `uploadFile` | `FileUpload` | | **Required.** Function that handles file upload. Receives `(file, progressUpdate, onUploaded, errorHandler)` and returns an `UploadProgress` object with a `cancel()` method. |
87
- | `maxFiles` | `number` | `10` | Maximum number of files allowed. |
88
- | `removeFileConfirm` | `RemoveConfirm` | — | Optional callback for deletion confirmation. Receives the file to be deleted and returns a Promise<boolean>. |
89
- | `variant` | `'' \| 'plain' \| 'outlined' \| 'filled'` | `''` | Visual style variant. |
90
- | `compact` | `boolean` | `false` | Dense layout for table cells and inline forms. |
91
- | `disabled` | `boolean` | `false` | Fully disabled no upload or delete actions. |
92
- | `readonly` | `boolean` | `false` | Read-only no upload or delete actions, but files are visible. |
93
- | `style` | `string` | | Inline CSS on the editor root. |
94
- | `error` | `string` | | Validation error text triggers the editor's error state. |
95
- | `tooltip` | `string` | | Hover tooltip on the editor. |
96
- | `theme` | `string` | — | Rendered as `data-theme` on the editor for scoped styling. |
97
- | `onchange` | `(files: Array<AttachmentFile>) => void` | — | Fires when the files array changes (upload or delete). Receives the updated files array. |
98
- | `onfocus` | `(event: FocusEvent) => void` | — | Editor focus. |
99
- | `onblur` | `(event: FocusEvent) => void` | — | Editor blur. |
100
-
101
- ## Events
102
-
103
- | Event | Signature | Description |
104
- |-------|-----------|-------------|
105
- | `onchange` | `(files: Array<AttachmentFile>) => void` | Fires when the files array changes (upload or delete). Receives the updated files array. |
106
- | `onfocus` | `(event: FocusEvent) => void` | Editor focus. |
107
- | `onblur` | `(event: FocusEvent) => void` | Editor blur. |
58
+ | `files` | `AttachmentFile[]` (bindable) | `[]` | Uploaded files. Each has `name`, `type`, `uri` and optional `size` / `thumbnail`. |
59
+ | `layout` | `'list' \| 'icon'` | `'list'` | `list`: one row per file; `icon`: tiles that wrap. |
60
+ | `height` | `number \| string` | | Height of the content area (number = px). Content scrolls inside; omit for auto height. |
61
+ | `uploadFile` | `FileUpload` | — | Upload function (see below). Without it the field only displays files and shows no upload entry. |
62
+ | `accept` | `string` | `"*/*"` | Allowed types, same syntax as `<input accept>`. |
63
+ | `maxSize` | `number` | `10 MB` | Per-file size limit in bytes. |
64
+ | `maxFiles` | `number` | `10` | Maximum number of files, uploads in progress included. The upload entry disappears when reached. |
65
+ | `multiple` | `boolean` | `true` | Allow picking / dropping several files at once. |
66
+ | `uploadText` | `string` | i18n `upload.dropHint` | Text of the upload entry; also the empty-state hint. |
67
+ | `emptyText` | `string` | i18n `upload.emptyText` | Shown when there are no files and uploading is not possible. |
68
+ | `showThumbnail` | `boolean` | `false` | Show image files as thumbnails (`thumbnail ?? uri`) and a local preview while an image is uploading. A file that carries `thumbnail` is always shown as one. |
69
+ | `onPreview` | `(file: AttachmentFile) => void` | — | When set, every file gets a preview button. |
70
+ | `beforeRemove` | `BeforeRemove<AttachmentFile>` | — | Veto hook; return `false` (or a promise of it) to keep the file. |
71
+ | `onremove` | `(file: AttachmentFile) => void` | — | A file was removed. |
72
+ | `ondownload` | `(file: AttachmentFile) => void` | — | Custom download. Without it the download icon is a plain link to `file.uri`. |
73
+ | `onFileUploaded` | `(file: AttachmentFile, source: File) => void` | — | One upload finished and was appended to `files`. |
74
+ | `onFileRejected` | `(file: File, reason: 'accept' \| 'size' \| 'count') => void` | — | A picked / dropped file was refused. |
75
+ | `onUploadError` | `(file: File, error: Error) => void` | — | An upload failed; the task stays in the list with retry / remove. |
76
+ | `onchange` | `(files: AttachmentFile[]) => void` | | `files` changed (upload completed or file removed). |
108
77
 
109
78
  ## Methods
110
79
 
111
- | Method | Signature | Description |
112
- |--------|-----------|-------------|
113
- | `focus()` | `() => void` | Moves focus to the editor. |
114
-
115
- ```svelte
116
- <script lang="ts">
117
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
118
-
119
- let editorRef;
120
-
121
- function focusEditor() {
122
- editorRef.focus();
123
- }
124
- </script>
125
-
126
- <AttachmentFilesField bind:this={editorRef} bind:files={files} uploadFile={uploadFile} />
127
- <button onclick={focusEditor}>Focus</button>
128
- ```
129
-
130
- ## `FileUpload` — upload function
80
+ | Method | Description |
81
+ |--------|-------------|
82
+ | `openFileDialog()` | Opens the system file dialog (same as clicking the upload entry). No-op when uploading is not possible. |
83
+ | `focus()` | Moves focus to the first control inside the field. |
131
84
 
132
- The `uploadFile` callback is required. It receives:
133
-
134
- | Parameter | Type | Description |
135
- |-----------|------|-------------|
136
- | `file` | `File` | The file to upload. |
137
- | `progressUpdate` | `(bytesUploaded: number) => void` | Call this to report upload progress. |
138
- | `onUploaded` | `(url: string) => void` | Call this when upload is complete. Pass the file URL. |
139
- | `errorHandler` | `(error: Error) => void` | Call this if upload fails. Pass an Error object. |
140
-
141
- It must return an `UploadProgress` object:
85
+ ## `FileUpload`
142
86
 
143
87
  ```typescript
144
- interface UploadProgress {
145
- cancel: () => Promise<boolean>;
146
- }
88
+ type FileUpload = (
89
+ file: File,
90
+ progressUpdate: (uploadedBytes: number) => void,
91
+ onUploaded: (url: string, thumbnail?: string) => void,
92
+ onError: (error: Error) => void
93
+ ) => {cancel: () => Promise<boolean>};
147
94
  ```
148
95
 
149
- The `cancel()` method allows the user to cancel an in-progress upload.
150
-
151
- ```svelte
152
- <script lang="ts">
153
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
154
- import type { FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
155
-
156
- let files = $state([]);
157
-
158
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
159
- // Simulate upload with progress
160
- let bytesUploaded = 0;
161
- const totalBytes = file.size;
162
- const interval = setInterval(() => {
163
- bytesUploaded += 1024; // 1KB per tick
164
- if (bytesUploaded >= totalBytes) {
165
- clearInterval(interval);
166
- onUploaded(`/uploads/${file.name}`);
167
- } else {
168
- progressUpdate(bytesUploaded);
169
- }
170
- }, 100);
171
-
172
- return {
173
- cancel: async () => {
174
- clearInterval(interval);
175
- return true; // upload was cancelled
176
- }
177
- };
178
- };
179
- </script>
180
-
181
- <AttachmentFilesField bind:files={files} uploadFile={uploadFile} />
182
- ```
183
-
184
- ## `AttachmentFile` — file object
185
-
186
- Each file in the `files` array is an `AttachmentFile` object:
187
-
188
- ```typescript
189
- interface AttachmentFile {
190
- name: string; // File name
191
- uri: string; // File URL (after upload)
192
- type: FileType; // File type (IMAGE, PDF, DOC, XLS, PPT, AUDIO, VIDEO, OTHER)
193
- }
194
- ```
195
-
196
- ## `FileType` — file type enum
197
-
198
- ```typescript
199
- enum FileType {
200
- IMAGE = 'img',
201
- PDF = 'pdf',
202
- DOC = 'doc',
203
- XLS = 'xml',
204
- PPT = 'ppt',
205
- AUDIO = 'wav',
206
- VIDEO = 'mov',
207
- OTHER = 'dat'
208
- }
209
- ```
210
-
211
- ## Examples
212
-
213
- ### File upload with confirmation
214
-
215
- ```svelte
216
- <script lang="ts">
217
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
218
- import type { AttachmentFile, FileUpload, RemoveConfirm } from "@ticatec/uniface-element/AttachmentFilesField";
219
-
220
- let files = $state<AttachmentFile[]>([]);
221
-
222
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
223
- let bytesUploaded = 0;
224
- const totalBytes = file.size;
225
- const interval = setInterval(() => {
226
- bytesUploaded += 1024;
227
- if (bytesUploaded >= totalBytes) {
228
- clearInterval(interval);
229
- onUploaded(`/uploads/${file.name}`);
230
- } else {
231
- progressUpdate(bytesUploaded);
232
- }
233
- }, 100);
234
-
235
- return {
236
- cancel: async () => {
237
- clearInterval(interval);
238
- return true;
239
- }
240
- };
241
- };
242
-
243
- const removeFileConfirm: RemoveConfirm = async (file) => {
244
- return confirm(`Are you sure you want to delete ${file.name}?`);
245
- };
246
-
247
- function handleFilesChange(updatedFiles: AttachmentFile[]) {
248
- console.log("Files updated:", updatedFiles);
249
- // ... save to backend
250
- }
251
- </script>
252
-
253
- <AttachmentFilesField
254
- bind:files={files}
255
- uploadFile={uploadFile}
256
- removeFileConfirm={removeFileConfirm}
257
- onchange={handleFilesChange}
258
- maxFiles={5}
259
- />
260
- ```
261
-
262
- ### Multiple file types
263
-
264
- ```svelte
265
- <script lang="ts">
266
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
267
- import type { AttachmentFile, FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
268
-
269
- let files = $state<AttachmentFile[]>([]);
270
-
271
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
272
- // Simulate upload
273
- let progress = 0;
274
- const interval = setInterval(() => {
275
- progress += 10;
276
- progressUpdate(Math.floor(file.size * (progress / 100)));
277
-
278
- if (progress >= 100) {
279
- clearInterval(interval);
280
- onUploaded(`/uploads/${file.name}`);
281
- }
282
- }, 100);
283
-
284
- return {
285
- cancel: async () => {
286
- clearInterval(interval);
287
- return true;
288
- }
289
- };
290
- };
291
- </script>
292
-
293
- <div class="file-upload-section">
294
- <h3>Upload Files</h3>
295
- <AttachmentFilesField
296
- bind:files={files}
297
- uploadFile={uploadFile}
298
- maxFiles={10}
299
- />
300
- <div class="file-list">
301
- {#each files as file}
302
- <div class="file-item">
303
- <span class="file-icon">📄</span>
304
- <span class="file-name">{file.name}</span>
305
- <span class="file-type">{file.type}</span>
306
- </div>
307
- {/each}
308
- </div>
309
- </div>
310
-
311
- <style>
312
- .file-upload-section {
313
- max-width: 600px;
314
- margin: 20px;
315
- padding: 20px;
316
- border: 1px solid #e5e7eb;
317
- border-radius: 8px;
318
- }
319
- .file-list {
320
- margin-top: 16px;
321
- }
322
- .file-item {
323
- display: flex;
324
- align-items: center;
325
- gap: 8px;
326
- padding: 8px;
327
- border-bottom: 1px solid #f3f4f6;
328
- }
329
- .file-icon {
330
- font-size: 20px;
331
- }
332
- .file-name {
333
- flex: 1;
334
- }
335
- .file-type {
336
- color: #6b7280;
337
- }
338
- </style>
339
- ```
340
-
341
- ### Disabled and readonly modes
342
-
343
- ```svelte
344
- <script lang="ts">
345
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
346
- import type { AttachmentFile, FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
347
-
348
- let disabledFiles: AttachmentFile[] = [
349
- { name: "disabled-file.pdf", uri: "/uploads/disabled-file.pdf", type: "pdf" }
350
- ];
351
- let readonlyFiles: AttachmentFile[] = [
352
- { name: "readonly-file.docx", uri: "/uploads/readonly-file.docx", type: "doc" }
353
- ];
354
- let normalFiles: AttachmentFile[] = [];
355
-
356
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
357
- let progress = 0;
358
- const interval = setInterval(() => {
359
- progress += 10;
360
- progressUpdate(Math.floor(file.size * (progress / 100)));
361
-
362
- if (progress >= 100) {
363
- clearInterval(interval);
364
- onUploaded(`/uploads/${file.name}`);
365
- }
366
- }, 100);
367
-
368
- return {
369
- cancel: async () => {
370
- clearInterval(interval);
371
- return true;
372
- }
373
- };
374
- };
375
- </script>
376
-
377
- <div style="display: flex; flex-direction: column; gap: 16px;">
378
- <AttachmentFilesField
379
- bind:files={disabledFiles}
380
- uploadFile={uploadFile}
381
- disabled
382
- />
383
- <AttachmentFilesField
384
- bind:files={readonlyFiles}
385
- uploadFile={uploadFile}
386
- readonly
387
- />
388
- <AttachmentFilesField
389
- bind:files={normalFiles}
390
- uploadFile={uploadFile}
391
- />
392
- </div>
393
- ```
394
-
395
- ### Compact mode
396
-
397
- ```svelte
398
- <script lang="ts">
399
- import AttachmentFilesField from "@ticatec/uniface-element/AttachmentFilesField";
400
- import type { AttachmentFile, FileUpload } from "@ticatec/uniface-element/AttachmentFilesField";
401
-
402
- let files = $state<AttachmentFile[]>([]);
403
-
404
- const uploadFile: FileUpload = (file, progressUpdate, onUploaded, errorHandler) => {
405
- let progress = 0;
406
- const interval = setInterval(() => {
407
- progress += 10;
408
- progressUpdate(Math.floor(file.size * (progress / 100)));
409
-
410
- if (progress >= 100) {
411
- clearInterval(interval);
412
- onUploaded(`/uploads/${file.name}`);
413
- }
414
- }, 100);
415
-
416
- return {
417
- cancel: async () => {
418
- clearInterval(interval);
419
- return true;
420
- }
421
- };
422
- };
423
- </script>
424
-
425
- <table>
426
- <thead>
427
- <tr>
428
- <th>Name</th>
429
- <th>Files</th>
430
- </tr>
431
- </thead>
432
- <tbody>
433
- <tr>
434
- <td>Row 1</td>
435
- <td>
436
- <AttachmentFilesField
437
- bind:files={files}
438
- uploadFile={uploadFile}
439
- compact
440
- />
441
- </td>
442
- </tr>
443
- </tbody>
444
- </table>
445
- ```
446
-
447
- ## Behavior Notes
448
-
449
- ### Upload flow
450
-
451
- 1. User clicks the upload icon or drags and drops files.
452
- 2. The `FileUploadPanel` opens, showing a file picker.
453
- 3. When a file is selected, `uploadFile` is called with the file and progress callbacks.
454
- 4. `uploadFile` calls `progressUpdate(bytesUploaded)` to report progress.
455
- 5. When upload is complete, `uploadFile` calls `onUploaded(url)` with the file URL.
456
- 6. The file is added to the `files` array and displayed in the file list.
457
-
458
- ### Delete flow
459
-
460
- 1. User clicks the delete icon on a file.
461
- 2. If `removeFileConfirm` is provided, the callback is called with the file.
462
- 3. If the callback returns `true`, the file is removed from the `files` array.
463
- 4. The `onchange` event fires with the updated files array.
464
-
465
- ### File type detection
466
-
467
- File types are detected based on file extensions:
468
-
469
- - **IMAGE**: jpg, jpeg, png, gif, bmp, tiff, webp, svg, ico, heif, heic
470
- - **PDF**: pdf
471
- - **DOC**: doc, docx, dot, dotx, docm, dotm
472
- - **XLS**: xls, xlsx, xlsm, xlsb, csv, ods, xlt, xltx, xltm
473
- - **PPT**: ppt, pptx, pptm, pps, ppsx, ppsm, pot, potx, potm
474
- - **AUDIO**: mp3, wav, aac, flac, ogg, wma, m4a, aiff, alac
475
- - **VIDEO**: mp4, avi, mkv, mov, wmv, flv, webm, mpeg, mpg, 3gp, m4v, vob
476
- - **OTHER**: anything else
96
+ Call `progressUpdate` with the number of bytes sent so far (the component converts it to a percentage), `onUploaded` with the stored URL when done, or `onError` on failure. `cancel()` resolving `false` keeps the task in the list.
477
97
 
478
- ### Read-only / disabled rendering
98
+ ## Behavior notes
479
99
 
480
- Both modes hide the upload icon and delete icons. Files are displayed but cannot be modified.
100
+ - Files that fail `accept` / `maxSize` / the remaining `maxFiles` quota never start uploading; each is reported once through `onFileRejected`.
101
+ - An upload that succeeds appends `{name, type, uri, size, thumbnail}` to `files` (type derived from the extension, `thumbnail` from the uploader's second `onUploaded` argument), then fires `onFileUploaded` and `onchange`.
102
+ - `readonly` and `disabled` both hide delete and the upload entry and ignore drops; download links remain in `readonly`.
103
+ - The drag highlight only reacts to drags that carry files.
481
104
 
482
- ## Accessibility
105
+ ## Styling
483
106
 
484
- - The upload icon has `aria-hidden="true"` (decorative).
485
- - File names are displayed as plain text.
486
- - For full ARIA, wrap with `<label>` or use `aria-label`.
107
+ Component-level CSS variables (all have fallbacks): `--uniface-attachment-item-height`, `--uniface-attachment-tile-size`, `--uniface-attachment-icon-color`, `--uniface-attachment-add-border-color`, `--uniface-attachment-add-color`, `--uniface-attachment-drag-bg`, `--uniface-attachment-error-color`, `--uniface-attachment-overlay-bg`. `compact` switches to 26 px rows / 64 px tiles.
487
108
 
488
- ## Related Components
109
+ ## Related components
489
110
 
490
- - [ImageFilesField](../image-files/README.md) — specialized image upload component.
491
- - [TextEditor](../text_editor/README.md) — multi-line text area.
492
- - [NumberEditor](../number_editor/README.md) — numeric input.
111
+ - [ImageEditor](../image_editor/README.md) — same implementation for images: thumbnail tiles and a built-in preview.