@ticatec/uniface-element 5.0.1 → 5.0.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 (255) hide show
  1. package/README.md +29 -54
  2. package/README_CN.md +37 -57
  3. package/dist/base-calendar/CalendarBase.svelte +29 -6
  4. package/dist/base-calendar/CalendarBase.svelte.d.ts +4 -0
  5. package/dist/base-calendar/MonthPickupPanel.svelte +19 -6
  6. package/dist/base-calendar/MonthPickupPanel.svelte.d.ts +1 -1
  7. package/dist/base-calendar/MonthlyCalendar.svelte +18 -2
  8. package/dist/base-calendar/YearPickupPanel.svelte +24 -6
  9. package/dist/base-calendar/YearPickupPanel.svelte.d.ts +1 -1
  10. package/dist/composite/pagination_panel/PaginationPanel.svelte +2 -0
  11. package/dist/data_display/card/CommonCardActionBar.svelte +34 -14
  12. package/dist/data_display/concise_data_table/Column.d.ts +6 -0
  13. package/dist/data_display/concise_data_table/ConciseListTable.svelte +4 -3
  14. package/dist/data_display/concise_data_table/DataCell.svelte +3 -3
  15. package/dist/data_display/list_box/ListBox.svelte +90 -15
  16. package/dist/data_display/list_box/ListBox.svelte.d.ts +4 -0
  17. package/dist/data_display/tree_view/TreeNodeView.svelte +25 -4
  18. package/dist/data_table/DataTable.svelte +5 -5
  19. package/dist/data_table/DataTable.svelte.d.ts +36 -16
  20. package/dist/data_table/lib/ActionsColumn.d.ts +2 -2
  21. package/dist/data_table/lib/DataColumn.d.ts +7 -1
  22. package/dist/data_table/lib/RowAction.d.ts +5 -5
  23. package/dist/data_table/parts/FixedHeaderPanel.svelte +18 -3
  24. package/dist/data_table/parts/FixedRow.svelte +10 -1
  25. package/dist/data_table/parts/HrefCell.svelte +1 -1
  26. package/dist/data_table/parts/TableHeaderPanel.svelte +18 -2
  27. package/dist/data_table/parts/TextCell.svelte +2 -2
  28. package/dist/form/attachment_files/AttachmentEditor.svelte +9 -9
  29. package/dist/form/attachment_files/FileRender.svelte +1 -1
  30. package/dist/form/attachment_files/FileUploadPanel.svelte +5 -1
  31. package/dist/form/cascade_options_select/CascadeOptionSelect.svelte +10 -2
  32. package/dist/form/cascade_options_select/OptionsBox.svelte +48 -2
  33. package/dist/form/color_picker/ColorPickerPanel.svelte +23 -20
  34. package/dist/form/color_picker/ColorPickerPanel.svelte.d.ts +5 -18
  35. package/dist/form/common_editor/CommonEditor.svelte +18 -4
  36. package/dist/form/common_editor/CommonPicker.svelte +11 -4
  37. package/dist/form/common_editor/CommonPopupEditor.svelte +8 -1
  38. package/dist/form/common_range_editor/CommonRangeEditor.svelte +11 -2
  39. package/dist/form/date_picker/DatePicker.svelte +1 -1
  40. package/dist/form/date_picker/DateTimePicker.svelte +1 -1
  41. package/dist/form/date_picker/ScrollBar.svelte +20 -12
  42. package/dist/form/date_picker/ScrollBar.svelte.d.ts +4 -18
  43. package/dist/form/date_range/DateRangeEditor.svelte +11 -3
  44. package/dist/form/group_box/group-check-box/GroupCheckBox.svelte +6 -1
  45. package/dist/form/group_box/group-radio-box/GroupRadioBox.svelte +6 -1
  46. package/dist/form/image-files/ImageFilesField.svelte +51 -7
  47. package/dist/form/image-files/ImagePreview.svelte +8 -2
  48. package/dist/form/image-files/ImageRender.svelte +69 -11
  49. package/dist/form/input_options_select/InputOptionsSelect.svelte +10 -2
  50. package/dist/form/lookup_editor/LookupEditor.svelte +9 -2
  51. package/dist/form/options_multi_select/OptionsMultiSelect.svelte +19 -3
  52. package/dist/form/options_select/OptionsSelect.svelte +15 -6
  53. package/dist/form/options_select/OptionsSelect.svelte.d.ts +39 -17
  54. package/dist/form/prompts_text_editor/PromptsTextEditor.svelte +10 -2
  55. package/dist/form/switch/Switch.svelte +4 -4
  56. package/dist/form/unit-number-editor/UnitNumberEditor.svelte +10 -2
  57. package/dist/general/button/Button.svelte +3 -0
  58. package/dist/general/button/Button.svelte.d.ts +1 -0
  59. package/dist/general/button/IconButton.svelte +3 -1
  60. package/dist/general/button/IconButton.svelte.d.ts +1 -0
  61. package/dist/general/button/TextButton.svelte +3 -0
  62. package/dist/general/button/TextButton.svelte.d.ts +1 -0
  63. package/dist/general/icon/Icon.svelte +18 -1
  64. package/dist/general/tag/Tag.svelte +9 -1
  65. package/dist/navigation/nav_menu/NavigatorMenu.svelte +2 -2
  66. package/dist/navigation/nav_menu/NavigatorMenuItem.svelte +10 -1
  67. package/dist/navigation/navigator/Navigator.svelte +17 -17
  68. package/dist/navigation/page-stack/PageStack.svelte +160 -0
  69. package/dist/navigation/page-stack/PageStack.svelte.d.ts +24 -0
  70. package/dist/navigation/page-stack/PageStackContext.d.ts +25 -0
  71. package/dist/navigation/page-stack/PageStackContext.js +12 -0
  72. package/dist/navigation/page-stack/PageStackFrame.svelte +24 -0
  73. package/dist/navigation/page-stack/PageStackFrame.svelte.d.ts +11 -0
  74. package/dist/navigation/page-stack/README.md +154 -0
  75. package/dist/navigation/page-stack/README_CN.md +154 -0
  76. package/dist/navigation/page-stack/index.d.ts +6 -0
  77. package/dist/navigation/page-stack/index.js +4 -0
  78. package/dist/navigation/pagination/Pagination.svelte +114 -14
  79. package/dist/navigation/tabs/Tabs.svelte +42 -10
  80. package/dist/navigation/tabs/Tabs.svelte.d.ts +2 -2
  81. package/dist/overlay/common/FloatingPanel.svelte +3 -11
  82. package/dist/overlay/common/FullscreenOverlay.svelte +27 -3
  83. package/dist/overlay/common/FullscreenOverlay.svelte.d.ts +6 -27
  84. package/dist/overlay/common/ModalPopover.svelte +18 -2
  85. package/dist/overlay/common/Popover.svelte +56 -57
  86. package/dist/overlay/common/Popover.svelte.d.ts +1 -5
  87. package/dist/overlay/common/escapeClose.d.ts +28 -0
  88. package/dist/overlay/common/escapeClose.js +47 -0
  89. package/dist/overlay/common/focusTrap.d.ts +8 -0
  90. package/dist/overlay/common/focusTrap.js +83 -0
  91. package/dist/overlay/common/mountSingleton.d.ts +27 -0
  92. package/dist/overlay/common/mountSingleton.js +45 -0
  93. package/dist/overlay/common/outsideClick.d.ts +28 -0
  94. package/dist/overlay/common/outsideClick.js +20 -0
  95. package/dist/overlay/common/scrollLock.d.ts +8 -0
  96. package/dist/overlay/common/scrollLock.js +49 -0
  97. package/dist/overlay/context-menu/ContextMenu.svelte.js +2 -15
  98. package/dist/overlay/context-menu/ContextMenuPanel.svelte +13 -1
  99. package/dist/overlay/dialog/Dialog.svelte +46 -29
  100. package/dist/overlay/dialog/DialogManager.svelte.js +7 -9
  101. package/dist/overlay/drawer/Drawer.svelte +30 -3
  102. package/dist/overlay/indicator/Indicator.svelte.js +2 -15
  103. package/dist/overlay/indicator/IndicatorPanel.svelte +4 -1
  104. package/dist/overlay/message-box/MessageBox.svelte.js +2 -15
  105. package/dist/overlay/message-box/MessageBoxPanel.svelte +19 -3
  106. package/dist/overlay/toast/Toast.svelte.js +2 -15
  107. package/dist/overlay/toast/ToastPanel.svelte +1 -1
  108. package/dist/overlay/tooltip/Tooltip.svelte +1 -1
  109. package/dist/ticatec-uniface-web.css +102 -7
  110. package/dist/types.d.ts +4 -3
  111. package/docs/components/README.md +133 -0
  112. package/docs/components/accordion/README.md +60 -0
  113. package/docs/components/accordion/example.svelte +7 -0
  114. package/docs/components/action-bar/README.md +114 -0
  115. package/docs/components/action-bar/example.svelte +7 -0
  116. package/docs/components/app-top-bar/README.md +60 -0
  117. package/docs/components/app-top-bar/example.svelte +9 -0
  118. package/docs/components/attachment-files/README.md +332 -0
  119. package/docs/components/attachment-files/example.svelte +16 -0
  120. package/docs/components/box/README.md +63 -0
  121. package/docs/components/box/example.svelte +10 -0
  122. package/docs/components/breadcrumbs/README.md +86 -0
  123. package/docs/components/breadcrumbs/example.svelte +11 -0
  124. package/docs/components/button/README.md +103 -0
  125. package/docs/components/button/example.svelte +10 -0
  126. package/docs/components/card/README.md +113 -0
  127. package/docs/components/card/example.svelte +10 -0
  128. package/docs/components/cascade-options-select/README.md +162 -0
  129. package/docs/components/cascade-options-select/example.svelte +18 -0
  130. package/docs/components/checkbox/README.md +103 -0
  131. package/docs/components/checkbox/example.svelte +15 -0
  132. package/docs/components/classic-layout/README.md +76 -0
  133. package/docs/components/classic-layout/example.svelte +16 -0
  134. package/docs/components/color-picker/README.md +132 -0
  135. package/docs/components/color-picker/example.svelte +16 -0
  136. package/docs/components/columns-layout/README.md +70 -0
  137. package/docs/components/columns-layout/example.svelte +12 -0
  138. package/docs/components/common-dialog/README.md +109 -0
  139. package/docs/components/common-dialog/example.svelte +12 -0
  140. package/docs/components/concise-data-table/README.md +307 -0
  141. package/docs/components/concise-data-table/example.svelte +16 -0
  142. package/docs/components/context-menu/README.md +99 -0
  143. package/docs/components/context-menu/example.svelte +10 -0
  144. package/docs/components/criteria-field/README.md +69 -0
  145. package/docs/components/criteria-field/example.svelte +9 -0
  146. package/docs/components/data-table/README.md +365 -0
  147. package/docs/components/data-table/example.svelte +23 -0
  148. package/docs/components/date-picker/README.md +136 -0
  149. package/docs/components/date-picker/example.svelte +16 -0
  150. package/docs/components/date-range/README.md +122 -0
  151. package/docs/components/date-range/example.svelte +15 -0
  152. package/docs/components/date-time-picker/README.md +142 -0
  153. package/docs/components/date-time-picker/example.svelte +16 -0
  154. package/docs/components/dialog/README.md +174 -0
  155. package/docs/components/dialog/example.svelte +13 -0
  156. package/docs/components/dialog-board/README.md +41 -0
  157. package/docs/components/dialog-board/example.svelte +5 -0
  158. package/docs/components/drawer/README.md +70 -0
  159. package/docs/components/drawer/example.svelte +12 -0
  160. package/docs/components/flex-form/README.md +55 -0
  161. package/docs/components/flex-form/example.svelte +7 -0
  162. package/docs/components/flex-row-form/README.md +56 -0
  163. package/docs/components/flex-row-form/example.svelte +7 -0
  164. package/docs/components/form-field/README.md +84 -0
  165. package/docs/components/form-field/example.svelte +10 -0
  166. package/docs/components/full-screen-overlay/README.md +66 -0
  167. package/docs/components/full-screen-overlay/example.svelte +11 -0
  168. package/docs/components/grid-form/README.md +75 -0
  169. package/docs/components/grid-form/example.svelte +9 -0
  170. package/docs/components/group-check-box/README.md +147 -0
  171. package/docs/components/group-check-box/example.svelte +21 -0
  172. package/docs/components/group-radio-box/README.md +144 -0
  173. package/docs/components/group-radio-box/example.svelte +21 -0
  174. package/docs/components/header-layout/README.md +65 -0
  175. package/docs/components/header-layout/example.svelte +12 -0
  176. package/docs/components/icon/README.md +87 -0
  177. package/docs/components/icon/example.svelte +9 -0
  178. package/docs/components/icon-button/README.md +91 -0
  179. package/docs/components/icon-button/example.svelte +10 -0
  180. package/docs/components/image-files/README.md +174 -0
  181. package/docs/components/image-files/example.svelte +19 -0
  182. package/docs/components/indicator/README.md +53 -0
  183. package/docs/components/indicator/example.svelte +14 -0
  184. package/docs/components/input-options-select/README.md +163 -0
  185. package/docs/components/input-options-select/example.svelte +16 -0
  186. package/docs/components/list-box/ListItem.svelte +14 -0
  187. package/docs/components/list-box/README.md +221 -0
  188. package/docs/components/list-box/example.svelte +61 -0
  189. package/docs/components/lookup-editor/README.md +137 -0
  190. package/docs/components/lookup-editor/example.svelte +16 -0
  191. package/docs/components/memo-editor/README.md +143 -0
  192. package/docs/components/memo-editor/example.svelte +16 -0
  193. package/docs/components/message-box/README.md +68 -0
  194. package/docs/components/message-box/example.svelte +10 -0
  195. package/docs/components/navigator/README.md +75 -0
  196. package/docs/components/navigator/example.svelte +13 -0
  197. package/docs/components/navigator-menu/README.md +113 -0
  198. package/docs/components/navigator-menu/example.svelte +10 -0
  199. package/docs/components/number-editor/README.md +144 -0
  200. package/docs/components/number-editor/example.svelte +16 -0
  201. package/docs/components/number-range/README.md +116 -0
  202. package/docs/components/number-range/example.svelte +15 -0
  203. package/docs/components/options-multi-select/README.md +161 -0
  204. package/docs/components/options-multi-select/example.svelte +20 -0
  205. package/docs/components/options-select/README.md +160 -0
  206. package/docs/components/options-select/example.svelte +21 -0
  207. package/docs/components/page/README.md +77 -0
  208. package/docs/components/page/example.svelte +10 -0
  209. package/docs/components/pagination/README.md +88 -0
  210. package/docs/components/pagination/example.svelte +10 -0
  211. package/docs/components/pagination-panel/README.md +120 -0
  212. package/docs/components/pagination-panel/example.svelte +16 -0
  213. package/docs/components/popup-hint/README.md +44 -0
  214. package/docs/components/popup-hint/example.svelte +5 -0
  215. package/docs/components/progress-bar/README.md +64 -0
  216. package/docs/components/progress-bar/example.svelte +8 -0
  217. package/docs/components/progress-step-bar/README.md +93 -0
  218. package/docs/components/progress-step-bar/example.svelte +7 -0
  219. package/docs/components/prompts-text-editor/README.md +146 -0
  220. package/docs/components/prompts-text-editor/example.svelte +17 -0
  221. package/docs/components/radio-button/README.md +121 -0
  222. package/docs/components/radio-button/example.svelte +18 -0
  223. package/docs/components/rows-layout/README.md +70 -0
  224. package/docs/components/rows-layout/example.svelte +12 -0
  225. package/docs/components/search-box/README.md +136 -0
  226. package/docs/components/search-box/example.svelte +16 -0
  227. package/docs/components/separator/README.md +44 -0
  228. package/docs/components/separator/example.svelte +7 -0
  229. package/docs/components/sidebar-layout/README.md +65 -0
  230. package/docs/components/sidebar-layout/example.svelte +12 -0
  231. package/docs/components/split/README.md +48 -0
  232. package/docs/components/split/example.svelte +8 -0
  233. package/docs/components/switch/README.md +77 -0
  234. package/docs/components/switch/example.svelte +11 -0
  235. package/docs/components/tabs/README.md +127 -0
  236. package/docs/components/tabs/example.svelte +22 -0
  237. package/docs/components/tag/README.md +63 -0
  238. package/docs/components/tag/example.svelte +8 -0
  239. package/docs/components/text-button/README.md +90 -0
  240. package/docs/components/text-button/example.svelte +9 -0
  241. package/docs/components/text-editor/README.md +147 -0
  242. package/docs/components/text-editor/example.svelte +16 -0
  243. package/docs/components/time-editor/README.md +130 -0
  244. package/docs/components/time-editor/example.svelte +16 -0
  245. package/docs/components/toast/README.md +52 -0
  246. package/docs/components/toast/example.svelte +9 -0
  247. package/docs/components/tooltip/README.md +44 -0
  248. package/docs/components/tooltip/example.svelte +5 -0
  249. package/docs/components/transfer/README.md +109 -0
  250. package/docs/components/transfer/example.svelte +13 -0
  251. package/docs/components/tree-view/README.md +163 -0
  252. package/docs/components/tree-view/example.svelte +26 -0
  253. package/docs/components/unit-number-editor/README.md +192 -0
  254. package/docs/components/unit-number-editor/example.svelte +18 -0
  255. package/package.json +15 -7
@@ -0,0 +1,70 @@
1
+ # ColumnsLayout
2
+
3
+ 应用布局组件。本文档由源码自动生成,类型以当前版本为准。
4
+
5
+ ## 简介
6
+
7
+ 以多列方式组织可调整区域的应用布局。
8
+
9
+ ## 适用场景
10
+
11
+ - 主从视图和多面板工作台
12
+ - 左右或多列区域需要独立宽度配置
13
+
14
+ ## 导入
15
+
16
+ ```ts
17
+ import ColumnsLayout from '@ticatec/uniface-element/app-layout/ColumnsLayout';
18
+ ```
19
+
20
+ ## 属性
21
+
22
+ | 属性 | 重要 | 类型 | 必填 | 默认值 | 可绑定/响应式 | 说明 |
23
+ | --- | --- | --- | --- | --- | --- | --- |
24
+ | `width` | 否 | `string` | 否 | `'100%'` | 否 | 宽度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
25
+ | `height` | 否 | `string` | 否 | `'100%'` | 否 | 高度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
26
+ | `leftWidth` | 否 | `string \| null` | 否 | `null` | 否 | 宽度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
27
+ | `rightWidth` | 否 | `string \| null` | 否 | `null` | 否 | 宽度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
28
+ | `leftMin` | 否 | `string \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
29
+ | `leftMax` | 否 | `string \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
30
+ | `rightMin` | 否 | `string \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
31
+ | `rightMax` | 否 | `string \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
32
+ | `leftResize` | 否 | `boolean` | 否 | `false` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
33
+ | `rightResize` | 否 | `boolean` | 否 | `false` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
34
+ | `left` | 否 | `Snippet` | 否 | `undefined` | 否 | Svelte Snippet 渲染入口,用于替换或补充默认内容。 |
35
+ | `children` | 是 | `Snippet` | 否 | `undefined` | 否 | Svelte Snippet 子内容,用于自定义组件主体。 |
36
+ | `right` | 否 | `Snippet` | 否 | `undefined` | 否 | Svelte Snippet 渲染入口,用于替换或补充默认内容。 |
37
+
38
+ > 组件的“可绑定”表示源码使用了 Svelte 5 的 `$bindable`;服务的“响应式”表示成员使用了 `$state`。复杂类型请同时参考 TypeScript 自动补全。
39
+
40
+ ## 重要属性说明
41
+
42
+ ### `children`
43
+
44
+ Svelte Snippet 子内容,用于自定义组件主体。
45
+
46
+ - 类型:`Snippet`
47
+ - 默认值:`undefined`
48
+ - 示例写法:`children={children}`
49
+
50
+ ## 示例
51
+
52
+ 完整示例见 [example.svelte](./example.svelte)。
53
+ ```svelte
54
+ <script lang="ts">
55
+ import ColumnsLayout from '@ticatec/uniface-element/app-layout/ColumnsLayout';
56
+ </script>
57
+
58
+ <ColumnsLayout
59
+ width="240px"
60
+ height="48px"
61
+ leftWidth="240px"
62
+ rightWidth="240px"
63
+ >
64
+ <div>在这里放置子内容</div>
65
+ </ColumnsLayout>
66
+ ```
67
+
68
+ ## 源码
69
+
70
+ - `src/lib/app_layout/ColumnsLayout.svelte`
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import ColumnsLayout from '@ticatec/uniface-element/app-layout/ColumnsLayout';
3
+ </script>
4
+
5
+ <ColumnsLayout
6
+ width="240px"
7
+ height="48px"
8
+ leftWidth="240px"
9
+ rightWidth="240px"
10
+ >
11
+ <div>在这里放置子内容</div>
12
+ </ColumnsLayout>
@@ -0,0 +1,109 @@
1
+ # CommonDialog
2
+
3
+ 浮层与弹窗组件。本文档由源码自动生成,类型以当前版本为准。
4
+
5
+ ## 简介
6
+
7
+ 带标准标题、内容和操作区的通用对话框壳。
8
+
9
+ ## 适用场景
10
+
11
+ - 编辑表单和详情确认弹窗
12
+ - 需要统一对话框结构的业务组件
13
+
14
+ ## 导入
15
+
16
+ ```ts
17
+ import CommonDialog from '@ticatec/uniface-element/CommonDialog';
18
+ ```
19
+
20
+ ## 属性
21
+
22
+ | 属性 | 重要 | 类型 | 必填 | 默认值 | 可绑定/响应式 | 说明 |
23
+ | --- | --- | --- | --- | --- | --- | --- |
24
+ | `title` | 是 | `string` | 是 | `—` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
25
+ | `width` | 否 | `string` | 否 | `'unset'` | 否 | 宽度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
26
+ | `height` | 否 | `string` | 否 | `'unset'` | 否 | 高度配置;字符串可以使用 px、rem、% 等 CSS 单位。 |
27
+ | `closeConfirm` | 否 | `DialogCloseConfirm \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
28
+ | `content$style` | 否 | `string` | 否 | `''` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
29
+ | `enableConfirm` | 否 | `boolean` | 否 | `true` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
30
+ | `confirmHandler` | 否 | `(() => Promise<any>) \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
31
+ | `confirmText` | 否 | `string \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
32
+ | `onClose` | 是 | `OnClose \| null` | 否 | `null` | 否 | 事件或行为回调;参数与返回值以类型签名为准。 |
33
+ | `children` | 是 | `Snippet` | 否 | `undefined` | 否 | Svelte Snippet 子内容,用于自定义组件主体。 |
34
+
35
+ > 组件的“可绑定”表示源码使用了 Svelte 5 的 `$bindable`;服务的“响应式”表示成员使用了 `$state`。复杂类型请同时参考 TypeScript 自动补全。
36
+
37
+ ## 重要属性说明
38
+
39
+ ### `title`
40
+
41
+ 可选配置,具体取值范围和数据结构见类型列。
42
+
43
+ - 类型:`string`
44
+ - 默认值:`—`
45
+ - 示例写法:`title="示例标题"`
46
+
47
+ ### `onClose`
48
+
49
+ 事件或行为回调;参数与返回值以类型签名为准。
50
+
51
+ - 类型:`OnClose | null`
52
+ - 默认值:`null`
53
+ - 示例写法:`onClose={async (...args: any[]) => { console.log('onClose', ...args); return true; }}`
54
+
55
+ ### `children`
56
+
57
+ Svelte Snippet 子内容,用于自定义组件主体。
58
+
59
+ - 类型:`Snippet`
60
+ - 默认值:`undefined`
61
+ - 示例写法:`children={children}`
62
+
63
+ ## 相关类型定义
64
+
65
+ 以下定义帮助理解复杂属性的数据结构;其中部分辅助类型属于内部实现,不一定是独立导出入口。
66
+
67
+ ### `DialogCloseConfirm`
68
+
69
+ ```ts
70
+ export type DialogCloseConfirm = () => Promise<boolean>;
71
+ ```
72
+
73
+ ### `OnClose`
74
+
75
+ ```ts
76
+ export type OnClose = (result: ModalResult) => void;
77
+ ```
78
+
79
+ ### `ModalResult`
80
+
81
+ ```ts
82
+ export enum ModalResult {
83
+ MR_OK = 1,
84
+ MR_CANCEL = 2,
85
+ MR_CLOSE = 3
86
+ }
87
+ ```
88
+
89
+ ## 示例
90
+
91
+ 完整示例见 [example.svelte](./example.svelte)。
92
+ ```svelte
93
+ <script lang="ts">
94
+ import CommonDialog from '@ticatec/uniface-element/CommonDialog';
95
+ </script>
96
+
97
+ <CommonDialog
98
+ title="示例标题"
99
+ onClose={async (...args: any[]) => { console.log('onClose', ...args); return true; }}
100
+ width="240px"
101
+ height="48px"
102
+ >
103
+ <div>在这里放置子内容</div>
104
+ </CommonDialog>
105
+ ```
106
+
107
+ ## 源码
108
+
109
+ - `src/lib/overlay/dialog/CommonDialog.svelte`
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import CommonDialog from '@ticatec/uniface-element/CommonDialog';
3
+ </script>
4
+
5
+ <CommonDialog
6
+ title="示例标题"
7
+ onClose={async (...args: any[]) => { console.log('onClose', ...args); return true; }}
8
+ width="240px"
9
+ height="48px"
10
+ >
11
+ <div>在这里放置子内容</div>
12
+ </CommonDialog>
@@ -0,0 +1,307 @@
1
+ # ConciseDataTable
2
+
3
+ 数据展示组件。本文档由源码自动生成,类型以当前版本为准。
4
+
5
+ ## 简介
6
+
7
+ 轻量紧凑的数据表格,适合快速展示较少列。
8
+
9
+ ## 适用场景
10
+
11
+ - 弹窗内列表和摘要数据
12
+ - 不需要复杂冻结列与行操作的表格
13
+
14
+ ## 导入
15
+
16
+ ```ts
17
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
18
+ ```
19
+
20
+ ## 属性
21
+
22
+ | 属性 | 重要 | 类型 | 必填 | 默认值 | 可绑定/响应式 | 说明 |
23
+ | --- | --- | --- | --- | --- | --- | --- |
24
+ | `list` | 是 | `Array<any>` | 是 | `—` | 否 | 组件展示的数据集合。数据项结构由相关列、字段映射或渲染器决定。 |
25
+ | `columns` | 是 | `Array<Column>` | 是 | `—` | 否 | 表格列定义,控制字段、标题、宽度、格式化、链接和自定义渲染。 |
26
+ | `autoScroll` | 否 | `boolean` | 否 | `false` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
27
+ | `scrollInterval` | 否 | `number` | 否 | `2000` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
28
+ | `rowClickHandler` | 否 | `RowClickHandler \| null` | 否 | `null` | 否 | 可选配置,具体取值范围和数据结构见类型列。 |
29
+ | `options` | 是 | `TableOptions` | 否 | `{}` | 否 | 可选项数据源;通常配合 `keyField` 与 `textField` 指定值字段和显示字段。 |
30
+ | `style` | 否 | `string` | 否 | `''` | 否 | 附加到组件根元素的内联样式。 |
31
+ | `class` | 否 | `string` | 否 | `''` | 否 | 附加到组件根元素的 CSS class。 |
32
+ | `onfocus` | 否 | `(event: FocusEvent) => void` | 否 | `undefined` | 否 | 组件获得焦点时调用。 |
33
+ | `onblur` | 否 | `(event: FocusEvent) => void` | 否 | `undefined` | 否 | 组件失去焦点时调用。 |
34
+
35
+ > 组件的“可绑定”表示源码使用了 Svelte 5 的 `$bindable`;服务的“响应式”表示成员使用了 `$state`。复杂类型请同时参考 TypeScript 自动补全。
36
+
37
+ ## 重要属性说明
38
+
39
+ ### `list`
40
+
41
+ 组件展示的数据集合。数据项结构由相关列、字段映射或渲染器决定。
42
+
43
+ - 类型:`Array<any>`
44
+ - 默认值:`—`
45
+ - 示例写法:`list={[
46
+ {id: 1, name: '张三', department: '研发部'},
47
+ {id: 2, name: '李四', department: '产品部'}
48
+ ]}`
49
+
50
+ ### `columns`
51
+
52
+ 表格列定义,控制字段、标题、宽度、格式化、链接和自定义渲染。
53
+
54
+ - 类型:`Array<Column>`
55
+ - 默认值:`—`
56
+ - 示例写法:`columns={[
57
+ {field: 'name', title: '姓名', width: 160},
58
+ {field: 'department', title: '部门', width: 180}
59
+ ]}`
60
+
61
+ ### `options`
62
+
63
+ 可选项数据源;通常配合 `keyField` 与 `textField` 指定值字段和显示字段。
64
+
65
+ - 类型:`TableOptions`
66
+ - 默认值:`{}`
67
+ - 示例写法:参见下方完整示例中的类型化实现。
68
+
69
+ ## 组件实例方法
70
+
71
+ 通过 `bind:this` 获取组件实例后调用。
72
+
73
+ | 方法 | 类型 | 说明 |
74
+ | --- | --- | --- |
75
+ | `setFocus()` | `() => void` | 组件实例方法。 |
76
+
77
+ ## 相关类型定义
78
+
79
+ 以下定义帮助理解复杂属性的数据结构;其中部分辅助类型属于内部实现,不一定是独立导出入口。
80
+
81
+ ### `Column`
82
+
83
+ ```ts
84
+ export default interface Column {
85
+ // Display title for column header
86
+ title: string;
87
+ // Field name in data object
88
+ field: string;
89
+ // Width in pixels
90
+ width: number;
91
+ // Alignment: "left", "center", "right"
92
+ align?: "left" | "center" | "right",
93
+ // Flex weight: 0 = fixed width, >0 = proportional scaling
94
+ weight?: number;
95
+ // Optional formatter function
96
+ formatter?: (value: any) => string
97
+ // When true, the cell's (formatted) value is rendered as raw HTML ({@html}).
98
+ // Defaults to false/unset (safe, escaped plain text). Only set true when the
99
+ // field/formatter output is trusted markup — this is the same opt-in semantic as
100
+ // DataColumn#renderHTML in the data_table component.
101
+ renderHTML?: boolean;
102
+
103
+ /**
104
+ * @deprecated Use renderHTML instead; "escapeHTML" reads as "this escapes HTML"
105
+ * when it actually means the opposite — true renders raw, trusted HTML. Still
106
+ * honored as a fallback for existing callers.
107
+ */
108
+ escapeHTML?: boolean;
109
+ }
110
+ ```
111
+
112
+ ### `RowClickHandler`
113
+
114
+ ```ts
115
+ export type RowClickHandler = (row:any) => void;
116
+ ```
117
+
118
+ ### `TableOptions`
119
+
120
+ ```ts
121
+ export interface TableOptions {
122
+ //表格的背景色
123
+ backgroundColor?: string;
124
+ //表格的文字颜色
125
+ color?: string;
126
+ //标题行高
127
+ headerHeight?: number;
128
+ //标题行的背景色
129
+ headerBackgroundColor?: string;
130
+ //标题行文字颜色
131
+ headerColor?: string;
132
+ //间隔行背景色
133
+ alternativeBackgroundColor?: string;
134
+ //间隔行颜色
135
+ alternativeColor?: string;
136
+ //数据行高度
137
+ rowHeight?: number;
138
+ }
139
+ ```
140
+
141
+ ### `DataColumn`
142
+
143
+ ```ts
144
+ export default interface DataColumn {
145
+
146
+ /**
147
+ * 列头文字
148
+ */
149
+ text: string;
150
+
151
+ /**
152
+ * 对应的字段/属性名
153
+ */
154
+ field?: string;
155
+
156
+ /**
157
+ * 是否冻结在数据表中,如果前面的frozen是false,那么就无效
158
+ */
159
+ frozen?: boolean;
160
+
161
+ /**
162
+ * 对齐方式
163
+ */
164
+ align?: 'left' | 'center' | 'right';
165
+
166
+ /**
167
+ *
168
+ */
169
+ width: number;
170
+
171
+ minWidth?: number;
172
+
173
+ /**
174
+ * 是否可以换行,默认为false
175
+ */
176
+ warp?: boolean;
177
+
178
+ /**
179
+ * 单元格转换函数
180
+ */
181
+ formatter?: FormatCell;
182
+
183
+ /**
184
+ * 是否将单元格内容作为可信 HTML 渲染({@html}),而非纯文本转义。
185
+ * 仅当 field/formatter 输出为可信标记时才应设为 true。
186
+ */
187
+ renderHTML?: boolean;
188
+
189
+ /**
190
+ * @deprecated 请使用 renderHTML;名称容易被误读为"转义 HTML",
191
+ * 实际含义相反——设为 true 会把内容作为可信 HTML 渲染。仍受支持以兼容旧调用。
192
+ */
193
+ escapeHTML?: boolean;
194
+
195
+ /**
196
+ * 超链接设置
197
+ */
198
+ href?: HrefBuilder;
199
+
200
+ /**
201
+ * 是否生产hint
202
+ */
203
+ hint?: CellHint;
204
+
205
+ /**
206
+ * 渲染器
207
+ */
208
+ render?: any;
209
+
210
+ /**
211
+ *
212
+ */
213
+ visible?: boolean;
214
+
215
+ /**
216
+ *
217
+ */
218
+ resizable?: boolean;
219
+
220
+ /**
221
+ *
222
+ */
223
+ compareFunction?: CompareFunction;
224
+
225
+ /**
226
+ * 获取表格的样式
227
+ */
228
+ cellStyle?: GetCellStyle;
229
+ }
230
+ ```
231
+
232
+ ### `FormatCell`
233
+
234
+ ```ts
235
+ export type FormatCell = (value: any) => string;
236
+ ```
237
+
238
+ ### `HrefBuilder`
239
+
240
+ ```ts
241
+ export type HrefBuilder = (item: any) => Array<HrefLink> | HrefLink | string;
242
+ ```
243
+
244
+ ### `CellHint`
245
+
246
+ ```ts
247
+ export type CellHint = (value: any) => string;
248
+ ```
249
+
250
+ ### `CompareFunction`
251
+
252
+ ```ts
253
+ export type CompareFunction = (o1: any, o2: any) => number;
254
+ ```
255
+
256
+ ### `GetCellStyle`
257
+
258
+ ```ts
259
+ export type GetCellStyle = (data: any) => string;
260
+ ```
261
+
262
+ ### `HrefLink`
263
+
264
+ ```ts
265
+ export default interface HrefLink {
266
+ /**
267
+ * 显示超链接的文字
268
+ */
269
+ text: string;
270
+ /**
271
+ * 点击的处理函数
272
+ */
273
+ action: HrefAction;
274
+ }
275
+ ```
276
+
277
+ ### `HrefAction`
278
+
279
+ ```ts
280
+ export type HrefAction = () => void;
281
+ ```
282
+
283
+ ## 示例
284
+
285
+ 完整示例见 [example.svelte](./example.svelte)。
286
+ ```svelte
287
+ <script lang="ts">
288
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
289
+ </script>
290
+
291
+ <ConciseDataTable
292
+ list={[
293
+ {id: 1, name: '张三', department: '研发部'},
294
+ {id: 2, name: '李四', department: '产品部'}
295
+ ]}
296
+ columns={[
297
+ {field: 'name', title: '姓名', width: 160},
298
+ {field: 'department', title: '部门', width: 180}
299
+ ]}
300
+ onfocus={async (...args: any[]) => { console.log('onfocus', ...args); return true; }}
301
+ onblur={async (...args: any[]) => { console.log('onblur', ...args); return true; }}
302
+ />
303
+ ```
304
+
305
+ ## 源码
306
+
307
+ - `src/lib/data_display/concise_data_table/ConciseListTable.svelte`
@@ -0,0 +1,16 @@
1
+ <script lang="ts">
2
+ import ConciseDataTable from '@ticatec/uniface-element/ConciseDataTable';
3
+ </script>
4
+
5
+ <ConciseDataTable
6
+ list={[
7
+ {id: 1, name: '张三', department: '研发部'},
8
+ {id: 2, name: '李四', department: '产品部'}
9
+ ]}
10
+ columns={[
11
+ {field: 'name', title: '姓名', width: 160},
12
+ {field: 'department', title: '部门', width: 180}
13
+ ]}
14
+ onfocus={async (...args: any[]) => { console.log('onfocus', ...args); return true; }}
15
+ onblur={async (...args: any[]) => { console.log('onblur', ...args); return true; }}
16
+ />
@@ -0,0 +1,99 @@
1
+ # ContextMenu
2
+
3
+ 命令式服务。本文档由源码自动生成,类型以当前版本为准。
4
+
5
+ ## 简介
6
+
7
+ 通过命令式 API 在鼠标位置显示上下文菜单。
8
+
9
+ ## 适用场景
10
+
11
+ - 表格行、树节点和画布右键操作
12
+ - 需要根据当前对象动态构建菜单项
13
+
14
+ ## 导入
15
+
16
+ ```ts
17
+ import ContextMenu from '@ticatec/uniface-element/ContextMenu';
18
+ ```
19
+
20
+ ## 公开成员与方法
21
+
22
+ | 成员 | 重要 | 类型 | 必填 | 默认值 | 可绑定/响应式 | 说明 |
23
+ | --- | --- | --- | --- | --- | --- | --- |
24
+ | `visible` | 是 | `boolean` | 否 | `$state(false)` | 是 | 内部响应式状态:标记当前是否正在显示。由 `show()`/`hide()` 等方法统一管理;这是一个单例服务而非组件,不能使用 `bind:visible`,不建议直接修改。 |
25
+ | `position` | 是 | `{ x: number; y: number }` | 否 | `$state({ x: 0, y: 0 })` | 是 | 内部响应式状态;由上方方法统一管理。这是一个单例服务而非组件,不能使用 `bind:position`,仅供参考,不建议直接修改。 |
26
+ | `items` | 是 | `ContextMenuItem[]` | 否 | `$state<ContextMenuItem[]>([])` | 是 | 内部响应式状态;由上方方法统一管理。这是一个单例服务而非组件,不能使用 `bind:items`,仅供参考,不建议直接修改。 |
27
+ | `width` | 是 | `number` | 否 | `$state(150)` | 是 | 内部响应式状态;由上方方法统一管理。这是一个单例服务而非组件,不能使用 `bind:width`,仅供参考,不建议直接修改。 |
28
+ | `height` | 是 | `number` | 否 | `$state(150)` | 是 | 内部响应式状态;由上方方法统一管理。这是一个单例服务而非组件,不能使用 `bind:height`,仅供参考,不建议直接修改。 |
29
+ | `theme` | 是 | `unknown` | 否 | `$state()` | 是 | 内部响应式状态;由上方方法统一管理。这是一个单例服务而非组件,不能使用 `bind:theme`,仅供参考,不建议直接修改。 |
30
+ | `show()` | 否 | `(event: MouseEvent, list: ContextMenuItem[], width = 150, height = 150, currentTheme?: string) => void` | 否 | `—` | 否 | 唤起右键菜单 |
31
+ | `hide()` | 否 | `() => void` | 否 | `—` | 否 | 关闭右键菜单 |
32
+
33
+ > 组件的“可绑定”表示源码使用了 Svelte 5 的 `$bindable`;服务的“响应式”表示成员使用了 `$state`。复杂类型请同时参考 TypeScript 自动补全。
34
+
35
+ ## 相关类型定义
36
+
37
+ 以下定义帮助理解复杂属性的数据结构;其中部分辅助类型属于内部实现,不一定是独立导出入口。
38
+
39
+ ### `ContextMenuItem`
40
+
41
+ ```ts
42
+ export interface ContextMenuItem {
43
+ /**
44
+ * Display text for the menu item
45
+ */
46
+ text?: string;
47
+
48
+ /**
49
+ * Action to execute when item is clicked
50
+ */
51
+ action?: ActionCallback;
52
+
53
+ /**
54
+ * Whether the item is disabled
55
+ */
56
+ disabled?: boolean;
57
+
58
+ /**
59
+ * Whether this is a separator item
60
+ */
61
+ separator?: boolean;
62
+
63
+ /**
64
+ * Icon class or name for the menu item
65
+ */
66
+ icon?: string;
67
+
68
+ /**
69
+ * Custom CSS styles for the item
70
+ */
71
+ style?: string;
72
+ }
73
+ ```
74
+
75
+ ### `ActionCallback`
76
+
77
+ ```ts
78
+ export type ActionCallback = () => void;
79
+ ```
80
+
81
+ ## 示例
82
+
83
+ 完整示例见 [example.svelte](./example.svelte)。
84
+ ```svelte
85
+ <script lang="ts">
86
+ import ContextMenu from '@ticatec/uniface-element/ContextMenu';
87
+
88
+ function openMenu(event: MouseEvent) {
89
+ event.preventDefault();
90
+ ContextMenu.show(event, [{text: '查看', action: () => console.log('查看')}]);
91
+ }
92
+ </script>
93
+
94
+ <button type="button" oncontextmenu={openMenu}>在此区域右键点击</button>
95
+ ```
96
+
97
+ ## 源码
98
+
99
+ - `src/lib/overlay/context-menu/ContextMenu.svelte.ts`
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import ContextMenu from '@ticatec/uniface-element/ContextMenu';
3
+
4
+ function openMenu(event: MouseEvent) {
5
+ event.preventDefault();
6
+ ContextMenu.show(event, [{text: '查看', action: () => console.log('查看')}]);
7
+ }
8
+ </script>
9
+
10
+ <button type="button" oncontextmenu={openMenu}>在此区域右键点击</button>