@vef-framework-react/components 2.11.0 → 2.13.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 (329) hide show
  1. package/dist/cjs/code-editor/completions.cjs +1 -0
  2. package/dist/cjs/code-editor/format.cjs +3 -0
  3. package/dist/cjs/code-editor/index.cjs +1 -1
  4. package/dist/cjs/crud/components/scene-form.cjs +1 -1
  5. package/dist/cjs/crud/index.cjs +1 -1
  6. package/dist/cjs/editable-table/index.cjs +1 -1
  7. package/dist/cjs/flex-tabs/index.cjs +1 -0
  8. package/dist/cjs/flex-tabs/styles.cjs +1 -0
  9. package/dist/cjs/form-drawer/index.cjs +1 -1
  10. package/dist/cjs/form-modal/index.cjs +1 -1
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/cjs/labeled/index.cjs +1 -0
  13. package/dist/cjs/labels/index.cjs +1 -0
  14. package/dist/cjs/pro-search/components/advanced-search-toggler.cjs +1 -1
  15. package/dist/cjs/pro-search/styles.cjs +1 -1
  16. package/dist/cjs/select/hooks/index.cjs +1 -1
  17. package/dist/cjs/select/hooks/use-code-set-options-select.cjs +1 -0
  18. package/dist/cjs/select/index.cjs +1 -1
  19. package/dist/es/_base/constants/breakpoints.js +1 -1
  20. package/dist/es/_base/constants/common.js +1 -1
  21. package/dist/es/_base/constants/css-vars.js +1 -1
  22. package/dist/es/_base/constants/event.js +1 -1
  23. package/dist/es/_base/constants/index.js +1 -1
  24. package/dist/es/_base/constants/symbols.js +1 -1
  25. package/dist/es/_base/constants/theme.js +1 -1
  26. package/dist/es/_base/globals.js +1 -1
  27. package/dist/es/_base/helpers/breakpoints.js +1 -1
  28. package/dist/es/_base/helpers/color.js +1 -1
  29. package/dist/es/_base/helpers/common.js +1 -1
  30. package/dist/es/_base/helpers/event.js +1 -1
  31. package/dist/es/_base/helpers/index.js +1 -1
  32. package/dist/es/_base/helpers/message.js +1 -1
  33. package/dist/es/_base/helpers/modal.js +1 -1
  34. package/dist/es/_base/helpers/notification.js +1 -1
  35. package/dist/es/_base/helpers/props.js +1 -1
  36. package/dist/es/_base/helpers/react.js +1 -1
  37. package/dist/es/_base/hooks/index.js +1 -1
  38. package/dist/es/_base/hooks/use-theme-tokens.js +1 -1
  39. package/dist/es/_base/index.js +1 -1
  40. package/dist/es/_base/styles/common.js +1 -1
  41. package/dist/es/_base/styles/index.js +1 -1
  42. package/dist/es/_base/types/breakpoints.js +1 -1
  43. package/dist/es/_base/types/common.js +1 -1
  44. package/dist/es/_base/types/index.js +1 -1
  45. package/dist/es/action-button/index.js +1 -1
  46. package/dist/es/action-button/use-action-button.js +1 -1
  47. package/dist/es/action-group/index.js +1 -1
  48. package/dist/es/action-group/use-action-group.js +1 -1
  49. package/dist/es/action-group/use-computed-action-buttons.js +1 -1
  50. package/dist/es/affix/index.js +1 -1
  51. package/dist/es/alert/index.js +1 -1
  52. package/dist/es/anchor/index.js +1 -1
  53. package/dist/es/auto-complete/index.js +1 -1
  54. package/dist/es/avatar/index.js +1 -1
  55. package/dist/es/badge/index.js +1 -1
  56. package/dist/es/bool/index.js +1 -1
  57. package/dist/es/border-beam/index.js +1 -1
  58. package/dist/es/breadcrumb/index.js +1 -1
  59. package/dist/es/button/index.js +1 -1
  60. package/dist/es/calendar/index.js +1 -1
  61. package/dist/es/card/index.js +1 -1
  62. package/dist/es/carousel/index.js +1 -1
  63. package/dist/es/cascader/index.js +1 -1
  64. package/dist/es/center/index.js +1 -1
  65. package/dist/es/charts/chart.js +1 -1
  66. package/dist/es/charts/helpers/group.js +1 -1
  67. package/dist/es/charts/helpers/index.js +1 -1
  68. package/dist/es/charts/hooks/index.js +1 -1
  69. package/dist/es/charts/hooks/use-chart.js +1 -1
  70. package/dist/es/charts/index.js +1 -1
  71. package/dist/es/charts/themes/index.js +1 -1
  72. package/dist/es/charts/themes/walden-dark.js +1 -1
  73. package/dist/es/charts/themes/walden.js +1 -1
  74. package/dist/es/charts/themes/wonderland-dark.js +1 -1
  75. package/dist/es/charts/themes/wonderland.js +1 -1
  76. package/dist/es/checkbox/index.js +1 -1
  77. package/dist/es/code-editor/completions.js +51 -0
  78. package/dist/es/code-editor/format.js +26 -0
  79. package/dist/es/code-editor/index.js +193 -117
  80. package/dist/es/code-highlighter/index.js +1 -1
  81. package/dist/es/col/index.js +1 -1
  82. package/dist/es/collapse/index.js +1 -1
  83. package/dist/es/color-picker/index.js +1 -1
  84. package/dist/es/compact/index.js +1 -1
  85. package/dist/es/config-provider/app.js +1 -1
  86. package/dist/es/config-provider/constants.js +1 -1
  87. package/dist/es/config-provider/context-holder.js +1 -1
  88. package/dist/es/config-provider/css-vars.js +1 -1
  89. package/dist/es/config-provider/dark-mode-context.js +1 -1
  90. package/dist/es/config-provider/error-fallback.js +1 -1
  91. package/dist/es/config-provider/global-style.js +1 -1
  92. package/dist/es/config-provider/index.js +1 -1
  93. package/dist/es/config-provider/theme-config.js +1 -1
  94. package/dist/es/config-provider/use-config-provider.js +1 -1
  95. package/dist/es/crud/components/action-button-group.js +1 -1
  96. package/dist/es/crud/components/index.js +1 -1
  97. package/dist/es/crud/components/main.js +1 -1
  98. package/dist/es/crud/components/mutation-holder.js +1 -1
  99. package/dist/es/crud/components/operation-button-group.js +1 -1
  100. package/dist/es/crud/components/scene-form.js +23 -22
  101. package/dist/es/crud/components/selection-indicator.js +1 -1
  102. package/dist/es/crud/components/toolbar-actions.js +1 -1
  103. package/dist/es/crud/components/toolbar.js +1 -1
  104. package/dist/es/crud/event.js +1 -1
  105. package/dist/es/crud/helpers.js +1 -1
  106. package/dist/es/crud/hooks/index.js +1 -1
  107. package/dist/es/crud/hooks/use-query-observer.js +1 -1
  108. package/dist/es/crud/hooks/use-search-values.js +1 -1
  109. package/dist/es/crud/hooks/use-selected-rows.js +1 -1
  110. package/dist/es/crud/index.js +17 -16
  111. package/dist/es/crud/store.js +1 -1
  112. package/dist/es/crud/styles.js +1 -1
  113. package/dist/es/crud-page/index.js +1 -1
  114. package/dist/es/date-picker/index.js +1 -1
  115. package/dist/es/descriptions/index.js +1 -1
  116. package/dist/es/divider/index.js +1 -1
  117. package/dist/es/drawer/index.js +1 -1
  118. package/dist/es/dropdown/index.js +1 -1
  119. package/dist/es/dynamic-icon/index.js +1 -1
  120. package/dist/es/dynamic-icon/load-icon-node.js +1 -1
  121. package/dist/es/dynamic-icon/placeholder-icon.js +1 -1
  122. package/dist/es/dynamic-icon/unknown-icon.js +1 -1
  123. package/dist/es/editable-table/components/add-row-button.js +1 -1
  124. package/dist/es/editable-table/components/editable-cell.js +1 -1
  125. package/dist/es/editable-table/components/editable-row-actions.js +1 -1
  126. package/dist/es/editable-table/components/index.js +1 -1
  127. package/dist/es/editable-table/helpers.js +1 -1
  128. package/dist/es/editable-table/hooks/index.js +1 -1
  129. package/dist/es/editable-table/hooks/use-editable-actions.js +1 -1
  130. package/dist/es/editable-table/hooks/use-editable-columns.js +1 -1
  131. package/dist/es/editable-table/index.js +28 -26
  132. package/dist/es/editable-table/store.js +1 -1
  133. package/dist/es/empty/empty.js +1 -1
  134. package/dist/es/empty/index.js +1 -1
  135. package/dist/es/file-preview/index.js +1 -1
  136. package/dist/es/file-upload/helpers.js +1 -1
  137. package/dist/es/file-upload/index.js +1 -1
  138. package/dist/es/flex/index.js +1 -1
  139. package/dist/es/flex-card/index.js +1 -1
  140. package/dist/es/flex-card/styles.js +1 -1
  141. package/dist/es/flex-tabs/index.js +13 -0
  142. package/dist/es/flex-tabs/styles.js +16 -0
  143. package/dist/es/flip-text/index.js +1 -1
  144. package/dist/es/float-button/index.js +1 -1
  145. package/dist/es/form/components/form.js +1 -1
  146. package/dist/es/form/components/index.js +1 -1
  147. package/dist/es/form/components/reset-button.js +1 -1
  148. package/dist/es/form/components/submit-button.js +1 -1
  149. package/dist/es/form/contexts/form-context.js +1 -1
  150. package/dist/es/form/contexts/form-layout.js +1 -1
  151. package/dist/es/form/contexts/index.js +1 -1
  152. package/dist/es/form/fields/auto-complete/index.js +1 -1
  153. package/dist/es/form/fields/bool/index.js +1 -1
  154. package/dist/es/form/fields/cascader/index.js +1 -1
  155. package/dist/es/form/fields/checkbox/index.js +1 -1
  156. package/dist/es/form/fields/code-editor/index.js +1 -1
  157. package/dist/es/form/fields/color-picker/index.js +1 -1
  158. package/dist/es/form/fields/date-picker/index.js +1 -1
  159. package/dist/es/form/fields/date-range-picker/index.js +1 -1
  160. package/dist/es/form/fields/icon-picker/index.js +1 -1
  161. package/dist/es/form/fields/index.js +1 -1
  162. package/dist/es/form/fields/input/index.js +1 -1
  163. package/dist/es/form/fields/input-number/index.js +1 -1
  164. package/dist/es/form/fields/mentions/index.js +1 -1
  165. package/dist/es/form/fields/password/index.js +1 -1
  166. package/dist/es/form/fields/radio/index.js +1 -1
  167. package/dist/es/form/fields/rate/index.js +1 -1
  168. package/dist/es/form/fields/select/index.js +1 -1
  169. package/dist/es/form/fields/slider/index.js +1 -1
  170. package/dist/es/form/fields/textarea/index.js +1 -1
  171. package/dist/es/form/fields/time-picker/index.js +1 -1
  172. package/dist/es/form/fields/time-range-picker/index.js +1 -1
  173. package/dist/es/form/fields/transfer/index.js +1 -1
  174. package/dist/es/form/fields/tree-select/index.js +1 -1
  175. package/dist/es/form/fields/upload/index.js +1 -1
  176. package/dist/es/form/form-actions.js +1 -1
  177. package/dist/es/form/form.js +1 -1
  178. package/dist/es/form/helpers/create-field.js +1 -1
  179. package/dist/es/form/helpers/index.js +1 -1
  180. package/dist/es/form/helpers/with-form-item.js +1 -1
  181. package/dist/es/form/hooks/use-form-item-props.js +1 -1
  182. package/dist/es/form/hooks/use-label-width.js +1 -1
  183. package/dist/es/form/index.js +1 -1
  184. package/dist/es/form/use-form.js +1 -1
  185. package/dist/es/form-drawer/index.js +38 -37
  186. package/dist/es/form-modal/index.js +29 -28
  187. package/dist/es/generic-select/index.js +1 -1
  188. package/dist/es/grid/context.js +1 -1
  189. package/dist/es/grid/grid-item.js +1 -1
  190. package/dist/es/grid/hooks/index.js +1 -1
  191. package/dist/es/grid/hooks/use-container-breakpoints.js +1 -1
  192. package/dist/es/grid/hooks/use-container-width.js +1 -1
  193. package/dist/es/grid/hooks/use-grid-collapsed.js +1 -1
  194. package/dist/es/grid/hooks/use-normalized-gap.js +1 -1
  195. package/dist/es/grid/hooks/use-responsive-breakpoint.js +1 -1
  196. package/dist/es/grid/hooks/use-responsive-value.js +1 -1
  197. package/dist/es/grid/index.js +1 -1
  198. package/dist/es/grid/styles.js +1 -1
  199. package/dist/es/group/index.js +1 -1
  200. package/dist/es/icon/index.js +1 -1
  201. package/dist/es/icon-button/index.js +1 -1
  202. package/dist/es/icon-picker/icon-grid.js +1 -1
  203. package/dist/es/icon-picker/index.js +1 -1
  204. package/dist/es/image/index.js +1 -1
  205. package/dist/es/index.js +98 -94
  206. package/dist/es/input/index.js +1 -1
  207. package/dist/es/input-number/index.js +1 -1
  208. package/dist/es/keyboard/index.js +1 -1
  209. package/dist/es/labeled/index.js +50 -0
  210. package/dist/es/labels/index.js +136 -0
  211. package/dist/es/list/index.js +1 -1
  212. package/dist/es/loader/index.js +1 -1
  213. package/dist/es/logo-icon/index.js +1 -1
  214. package/dist/es/mentions/index.js +1 -1
  215. package/dist/es/menu/index.js +1 -1
  216. package/dist/es/modal/index.js +1 -1
  217. package/dist/es/modal/modal.js +1 -1
  218. package/dist/es/operation-button/index.js +1 -1
  219. package/dist/es/page/components/aside-panel.js +1 -1
  220. package/dist/es/page/components/index.js +1 -1
  221. package/dist/es/page/components/resize-handle.js +1 -1
  222. package/dist/es/page/components/scroll-content.js +1 -1
  223. package/dist/es/page/entrance.js +1 -1
  224. package/dist/es/page/hooks/index.js +1 -1
  225. package/dist/es/page/hooks/use-page-key.js +1 -1
  226. package/dist/es/page/hooks/use-resize.js +1 -1
  227. package/dist/es/page/index.js +1 -1
  228. package/dist/es/page/styles.js +1 -1
  229. package/dist/es/page/viewport-context.js +1 -1
  230. package/dist/es/pagination/index.js +1 -1
  231. package/dist/es/permission-gate/index.js +1 -1
  232. package/dist/es/popconfirm/index.js +1 -1
  233. package/dist/es/popover/index.js +1 -1
  234. package/dist/es/pro-search/components/advanced-search-toggler.js +2 -2
  235. package/dist/es/pro-search/components/advanced-search.js +1 -1
  236. package/dist/es/pro-search/components/index.js +1 -1
  237. package/dist/es/pro-search/components/search-actions.js +1 -1
  238. package/dist/es/pro-search/index.js +1 -1
  239. package/dist/es/pro-search/styles.js +12 -7
  240. package/dist/es/pro-table/components/column-setting-item.js +8 -8
  241. package/dist/es/pro-table/components/column-settings-panel.js +1 -1
  242. package/dist/es/pro-table/components/column-settings.js +1 -1
  243. package/dist/es/pro-table/components/index.js +1 -1
  244. package/dist/es/pro-table/components/operation-button-group.js +1 -1
  245. package/dist/es/pro-table/components/ref.js +1 -1
  246. package/dist/es/pro-table/components/table-subscriber.js +1 -1
  247. package/dist/es/pro-table/components/table-summary.js +1 -1
  248. package/dist/es/pro-table/components/table-title.js +1 -1
  249. package/dist/es/pro-table/components/table.js +1 -1
  250. package/dist/es/pro-table/components/width-popover.js +1 -1
  251. package/dist/es/pro-table/context.js +1 -1
  252. package/dist/es/pro-table/event.js +1 -1
  253. package/dist/es/pro-table/hooks/index.js +1 -1
  254. package/dist/es/pro-table/hooks/use-column-settings-persistence.js +1 -1
  255. package/dist/es/pro-table/hooks/use-row-selection.js +1 -1
  256. package/dist/es/pro-table/hooks/use-table-columns.js +1 -1
  257. package/dist/es/pro-table/index.js +1 -1
  258. package/dist/es/pro-table/store.js +1 -1
  259. package/dist/es/progress/index.js +1 -1
  260. package/dist/es/qrcode/index.js +1 -1
  261. package/dist/es/radio/index.js +1 -1
  262. package/dist/es/rate/index.js +1 -1
  263. package/dist/es/result/index.js +1 -1
  264. package/dist/es/row/index.js +1 -1
  265. package/dist/es/scroll-area/index.js +1 -1
  266. package/dist/es/scroll-area/styles.js +1 -1
  267. package/dist/es/segmented/index.js +1 -1
  268. package/dist/es/select/hooks/index.js +4 -4
  269. package/dist/es/select/hooks/use-code-set-options-select.js +55 -0
  270. package/dist/es/select/hooks/use-data-options-select.js +1 -1
  271. package/dist/es/select/index.js +4 -4
  272. package/dist/es/skeleton/index.js +1 -1
  273. package/dist/es/slider/index.js +1 -1
  274. package/dist/es/space/index.js +1 -1
  275. package/dist/es/space/space.js +1 -1
  276. package/dist/es/sparkles-text/index.js +1 -1
  277. package/dist/es/sparkles-text/sparkle.js +1 -1
  278. package/dist/es/spin/index.js +1 -1
  279. package/dist/es/split-text/index.js +1 -1
  280. package/dist/es/splitter/index.js +1 -1
  281. package/dist/es/stack/index.js +1 -1
  282. package/dist/es/statistic/index.js +1 -1
  283. package/dist/es/steps/index.js +1 -1
  284. package/dist/es/switch/index.js +1 -1
  285. package/dist/es/table/index.js +1 -1
  286. package/dist/es/table/use-pagination-props.js +1 -1
  287. package/dist/es/tabs/index.js +1 -1
  288. package/dist/es/tag/index.js +1 -1
  289. package/dist/es/time-picker/index.js +1 -1
  290. package/dist/es/timeline/index.js +1 -1
  291. package/dist/es/tooltip/index.js +1 -1
  292. package/dist/es/tour/index.js +1 -1
  293. package/dist/es/transfer/index.js +1 -1
  294. package/dist/es/tree/hooks/index.js +1 -1
  295. package/dist/es/tree/hooks/use-data-options-tree.js +1 -1
  296. package/dist/es/tree/index.js +1 -1
  297. package/dist/es/tree-select/hooks/index.js +1 -1
  298. package/dist/es/tree-select/hooks/use-data-options-tree-select.js +1 -1
  299. package/dist/es/tree-select/index.js +1 -1
  300. package/dist/es/typing-animation/index.js +1 -1
  301. package/dist/es/typography/index.js +1 -1
  302. package/dist/es/upload/helpers.js +1 -1
  303. package/dist/es/upload/index.js +1 -1
  304. package/dist/es/watermark/index.js +1 -1
  305. package/dist/types/code-editor/completions.d.ts +62 -0
  306. package/dist/types/code-editor/format.d.ts +10 -0
  307. package/dist/types/code-editor/index.d.ts +2 -1
  308. package/dist/types/code-editor/props.d.ts +20 -1
  309. package/dist/types/crud/components/scene-form.d.ts +1 -1
  310. package/dist/types/crud/index.d.ts +1 -1
  311. package/dist/types/crud/props.d.ts +6 -0
  312. package/dist/types/dynamic-icon/index.d.ts +1 -1
  313. package/dist/types/editable-table/props.d.ts +14 -0
  314. package/dist/types/flex-tabs/index.d.ts +10 -0
  315. package/dist/types/flex-tabs/props.d.ts +2 -0
  316. package/dist/types/flex-tabs/styles.d.ts +2 -0
  317. package/dist/types/form/index.d.ts +1 -0
  318. package/dist/types/form-drawer/props.d.ts +6 -1
  319. package/dist/types/form-modal/props.d.ts +6 -1
  320. package/dist/types/index.d.ts +5 -2
  321. package/dist/types/labeled/index.d.ts +29 -0
  322. package/dist/types/labels/index.d.ts +54 -0
  323. package/dist/types/select/hooks/index.d.ts +1 -1
  324. package/dist/types/select/hooks/use-code-set-options-select.d.ts +14 -0
  325. package/dist/types/select/index.d.ts +1 -1
  326. package/package.json +6 -4
  327. package/dist/cjs/select/hooks/use-dictionary-options-select.cjs +0 -1
  328. package/dist/es/select/hooks/use-dictionary-options-select.js +0 -55
  329. package/dist/types/select/hooks/use-dictionary-options-select.d.ts +0 -14
@@ -3,7 +3,7 @@ import { Awaitable } from '@vef-framework-react/shared';
3
3
  import { ElementType, ReactNode } from 'react';
4
4
  import { Length } from '../_base';
5
5
  import { DrawerProps } from '../drawer';
6
- import { FormActionsProps, FormApi } from '../form';
6
+ import { FormActionsProps, FormApi, FormLayout } from '../form';
7
7
  /**
8
8
  * Props for the FormDrawer component
9
9
  *
@@ -37,6 +37,11 @@ export interface FormDrawerProps<TValues extends object, TData = unknown> extend
37
37
  * @default "form"
38
38
  */
39
39
  formComponent?: ElementType;
40
+ /**
41
+ * Layout of the form items inside the drawer (label position, alignment and
42
+ * width). Defaults to the horizontal, right-aligned label layout.
43
+ */
44
+ formLayout?: FormLayout;
40
45
  /**
41
46
  * Custom render function for footer actions.
42
47
  * Receives the form API and default action buttons (submit and reset) as arguments.
@@ -1,7 +1,7 @@
1
1
  import { ApiResult, MutationFunction, MutationMeta } from '@vef-framework-react/core';
2
2
  import { Awaitable } from '@vef-framework-react/shared';
3
3
  import { ElementType, ReactNode } from 'react';
4
- import { FormActionsProps, FormApi } from '../form';
4
+ import { FormActionsProps, FormApi, FormLayout } from '../form';
5
5
  import { ModalProps } from '../modal';
6
6
  /**
7
7
  * Props for the FormModal component
@@ -38,6 +38,11 @@ export interface FormModalProps<TValues extends object, TData = unknown> extends
38
38
  * @default "form"
39
39
  */
40
40
  formComponent?: ElementType;
41
+ /**
42
+ * Layout of the form items inside the modal (label position, alignment and
43
+ * width). Defaults to the horizontal, right-aligned label layout.
44
+ */
45
+ formLayout?: FormLayout;
41
46
  /**
42
47
  * Custom render function for footer actions.
43
48
  * Receives the form API and default action buttons (submit and reset) as arguments.
@@ -18,7 +18,7 @@ export { Cascader, type CascaderOption, type CascaderProps } from './cascader';
18
18
  export { Center, type CenterProps } from './center';
19
19
  export { Chart, connectCharts, disconnectCharts, useChart, type ChartInstance, type ChartOption, type ChartProps, type UseChartOptions } from './charts';
20
20
  export { Checkbox, type CheckboxGroupProps, type CheckboxOption, type CheckboxProps } from './checkbox';
21
- export { CodeEditor, type CodeEditorLanguage, type CodeEditorProps, type CodeEditorRef, type CodeEditorTheme } from './code-editor';
21
+ export { CodeEditor, completeFromEntries, type CodeEditorLanguage, type CodeEditorProps, type CodeEditorRef, type CodeEditorTheme, type CompletionEntry } from './code-editor';
22
22
  export { CodeHighlighter, type CodeHighlighterProps } from './code-highlighter';
23
23
  export { Col, type ColProps } from './col';
24
24
  export { Collapse, type CollapseItem, type CollapseProps } from './collapse';
@@ -40,6 +40,7 @@ export { FilePreviewProvider, useFilePreview, type FilePreviewHandler, type File
40
40
  export { FileUpload, type FileUploadProps } from './file-upload';
41
41
  export { Flex, type FlexProps } from './flex';
42
42
  export { FlexCard, type FlexCardProps } from './flex-card';
43
+ export { FlexTabs, type FlexTabsProps } from './flex-tabs';
43
44
  export { FlipText, type FlipTextProps } from './flip-text';
44
45
  export { FloatButton, type FloatButtonProps } from './float-button';
45
46
  export { createFormOptions, restoreFieldOptions, useForm, useFormContext, useFormStore, withFieldGroup, withForm } from './form';
@@ -56,6 +57,8 @@ export { Image, type ImageProps } from './image';
56
57
  export { Input, type InputProps, type InputRef, type OTPProps, type PasswordProps, type SearchProps, type TextAreaProps } from './input';
57
58
  export { InputNumber, type InputNumberProps } from './input-number';
58
59
  export { Keyboard, type KeyboardProps } from './keyboard';
60
+ export { Labeled, type LabeledProps } from './labeled';
61
+ export { formatLabelFilters, isValidLabel, LABEL_KEY_PATTERN, LabelFilterSelect, LabelsDisplay, LabelsEditor, parseLabelFilters, type LabelFilterSelectProps, type LabelsDisplayProps, type LabelsEditorProps } from './labels';
59
62
  export { List, type ListGridType, type ListItemMetaProps, type ListItemProps, type ListProps } from './list';
60
63
  export { Loader, type LoaderProps } from './loader';
61
64
  export { LogoIcon, type LogoIconProps } from './logo-icon';
@@ -78,7 +81,7 @@ export { Result, type ResultProps } from './result';
78
81
  export { Row, type RowProps } from './row';
79
82
  export { ScrollArea, type ScrollAreaProps, type ScrollAreaScrollbars } from './scroll-area';
80
83
  export { Segmented, type SegmentedOption, type SegmentedProps } from './segmented';
81
- export { Select, useDataOptionsSelect, useDictionaryOptionsSelect, type SelectOption, type SelectProps, type UseDataOptionsSelectOptions, type UseDictionaryOptionsSelectOptions, type UseDictionaryOptionsSelectResult } from './select';
84
+ export { Select, useCodeSetOptionsSelect, useDataOptionsSelect, type SelectOption, type SelectProps, type UseCodeSetOptionsSelectOptions, type UseCodeSetOptionsSelectResult, type UseDataOptionsSelectOptions } from './select';
82
85
  export { Skeleton, type SkeletonButtonProps, type SkeletonImageProps, type SkeletonInputProps, type SkeletonNodeProps, type SkeletonParagraphProps, type SkeletonProps, type SkeletonTitleProps } from './skeleton';
83
86
  export { Slider, type SliderProps, type SliderRangeProps, type SliderSingleProps } from './slider';
84
87
  export { Space, type SpaceProps } from './space';
@@ -0,0 +1,29 @@
1
+ import { PropsWithChildren, ReactNode } from 'react';
2
+ export interface LabeledProps extends PropsWithChildren {
3
+ /**
4
+ * Label shown above the control, matching the vertical form-item typography.
5
+ */
6
+ label: ReactNode;
7
+ /**
8
+ * Render the required marker before the label.
9
+ */
10
+ required?: boolean;
11
+ /**
12
+ * Secondary hint under the control.
13
+ */
14
+ hint?: ReactNode;
15
+ /**
16
+ * Id of the labeled control, for the native label-click association. When
17
+ * omitted (composite children have no single control id), the group
18
+ * labelling still names the children for assistive tech.
19
+ */
20
+ htmlFor?: string;
21
+ }
22
+ /**
23
+ * A top label for controls that live outside the form system (key-value
24
+ * editors, principal pickers, code editors), so they align with the vertical
25
+ * form items around them. The children are arbitrary, so the accessible name
26
+ * rides on a labelled group (plus the native association when `htmlFor` is
27
+ * given) instead of prop injection.
28
+ */
29
+ export declare function Labeled({ label, required, hint, htmlFor, children }: LabeledProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { CSSProperties } from 'react';
2
+ /**
3
+ * The key charset the backend accepts for labels (`orm.ValidateLabels`,
4
+ * shared by approval flow labels and integration contract labels): a dotted
5
+ * or otherwise out-of-charset key would be stored but silently never match
6
+ * the equality filter, so the editor validates it client-side too.
7
+ */
8
+ export declare const LABEL_KEY_PATTERN: RegExp;
9
+ /**
10
+ * Client-side mirror of the backend label validation: key charset and length,
11
+ * value length (in characters, matching the backend's rune count).
12
+ */
13
+ export declare function isValidLabel(key: string, value: string): boolean;
14
+ export interface LabelsEditorProps {
15
+ value?: Record<string, string>;
16
+ onChange?: (labels: Record<string, string>) => void;
17
+ disabled?: boolean;
18
+ }
19
+ /**
20
+ * A key-value editor for labels. Emits a plain `Record<string, string>`;
21
+ * rows with an empty key are kept locally but excluded from the emitted map,
22
+ * and out-of-charset keys are flagged inline (the backend rejects them at
23
+ * save with the same rule).
24
+ */
25
+ export declare function LabelsEditor({ value, onChange, disabled }: LabelsEditorProps): import("@emotion/react/jsx-runtime").JSX.Element;
26
+ /**
27
+ * Parse `key=value` tag entries into a label-filter map (`key` alone means an
28
+ * empty-value presence match). Entries without a key are dropped.
29
+ */
30
+ export declare function parseLabelFilters(entries: string[]): Record<string, string> | undefined;
31
+ /**
32
+ * Serialize a label-filter map back into `key=value` tag entries.
33
+ */
34
+ export declare function formatLabelFilters(labels: Record<string, string> | undefined): string[];
35
+ export interface LabelFilterSelectProps {
36
+ value: Record<string, string> | undefined;
37
+ onChange: (labels: Record<string, string> | undefined) => void;
38
+ placeholder?: string;
39
+ style?: CSSProperties;
40
+ }
41
+ /**
42
+ * A compact label-filter input: pairs typed as `key=value` tags, emitted as
43
+ * the equality-filter map the label-carrying list queries accept
44
+ * (AND-combined).
45
+ */
46
+ export declare function LabelFilterSelect({ value, onChange, placeholder, style }: LabelFilterSelectProps): import("@emotion/react/jsx-runtime").JSX.Element;
47
+ export interface LabelsDisplayProps {
48
+ labels?: Record<string, string>;
49
+ }
50
+ /**
51
+ * Labels as compact `key: value` tags (`key` alone when the value is an
52
+ * empty presence flag).
53
+ */
54
+ export declare function LabelsDisplay({ labels }: LabelsDisplayProps): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
+ export { useCodeSetOptionsSelect, type UseCodeSetOptionsSelectOptions, type UseCodeSetOptionsSelectResult } from './use-code-set-options-select';
1
2
  export { useDataOptionsSelect, type UseDataOptionsSelectOptions } from './use-data-options-select';
2
- export { useDictionaryOptionsSelect, type UseDictionaryOptionsSelectOptions, type UseDictionaryOptionsSelectResult } from './use-dictionary-options-select';
@@ -0,0 +1,14 @@
1
+ import { DataOption, DataOptionWithPinyin } from '@vef-framework-react/core';
2
+ import { CodeSetAliasMap } from '@vef-framework-react/hooks';
3
+ import { Key } from '@vef-framework-react/shared';
4
+ import { SelectProps } from '..';
5
+ export interface UseCodeSetOptionsSelectOptions {
6
+ /**
7
+ * Whether each select should enable search.
8
+ *
9
+ * @default false
10
+ */
11
+ filterable?: boolean;
12
+ }
13
+ export type UseCodeSetOptionsSelectResult<T extends CodeSetAliasMap> = Record<Extract<keyof T, string>, SelectProps<Key, DataOptionWithPinyin<DataOption>>>;
14
+ export declare function useCodeSetOptionsSelect<const T extends CodeSetAliasMap>(keys: T, options?: UseCodeSetOptionsSelectOptions): UseCodeSetOptionsSelectResult<T>;
@@ -1,5 +1,5 @@
1
1
  import { DefaultOptionType } from 'antd/es/select';
2
- export { useDataOptionsSelect, useDictionaryOptionsSelect, type UseDataOptionsSelectOptions, type UseDictionaryOptionsSelectOptions, type UseDictionaryOptionsSelectResult } from './hooks';
2
+ export { useCodeSetOptionsSelect, useDataOptionsSelect, type UseCodeSetOptionsSelectOptions, type UseCodeSetOptionsSelectResult, type UseDataOptionsSelectOptions } from './hooks';
3
3
  export { Select } from 'antd';
4
4
  export type SelectOption = DefaultOptionType;
5
5
  export type { SelectProps } from 'antd';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vef-framework-react/components",
3
- "version": "2.11.0",
3
+ "version": "2.13.0",
4
4
  "private": false,
5
5
  "description": "Components for VEF Framework",
6
6
  "keywords": [
@@ -49,6 +49,7 @@
49
49
  "@codemirror/lang-markdown": "^6.5.0",
50
50
  "@codemirror/lang-python": "^6.2.1",
51
51
  "@codemirror/lang-sql": "^6.10.0",
52
+ "@codemirror/lang-xml": "^6.1.0",
52
53
  "@codemirror/language": "^6.12.4",
53
54
  "@codemirror/lint": "^6.9.7",
54
55
  "@codemirror/state": "^6.7.0",
@@ -70,12 +71,13 @@
70
71
  "gsap": "^3.15.0",
71
72
  "lucide-react": "^1.23.0",
72
73
  "modern-normalize": "^3.0.1",
74
+ "prettier": "^3.9.4",
73
75
  "react-error-boundary": "^6.1.2",
74
76
  "react-syntax-highlighter": "^16.1.1",
75
77
  "tslib": "^2.8.1",
76
- "@vef-framework-react/core": "2.11.0",
77
- "@vef-framework-react/shared": "2.11.0",
78
- "@vef-framework-react/hooks": "2.11.0"
78
+ "@vef-framework-react/hooks": "2.13.0",
79
+ "@vef-framework-react/core": "2.13.0",
80
+ "@vef-framework-react/shared": "2.13.0"
79
81
  },
80
82
  "devDependencies": {
81
83
  "@types/react-syntax-highlighter": "^15.5.13",
@@ -1 +0,0 @@
1
- const e=require("../../loader/index.cjs");let t=require("@emotion/react/jsx-runtime"),n=require("@vef-framework-react/shared"),r=require("@vef-framework-react/hooks"),i=require("react"),a=require("@emotion/react");var o={label:`label`,value:`value`,options:`children`,groupLabel:`label`},s=280,c=(0,t.jsx)(`div`,{css:(0,a.css)({height:s/2},process.env.NODE_ENV===`production`?``:`/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVzZS1kaWN0aW9uYXJ5LW9wdGlvbnMtc2VsZWN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q08iLCJmaWxlIjoidXNlLWRpY3Rpb25hcnktb3B0aW9ucy1zZWxlY3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBEYXRhT3B0aW9uLCBEYXRhT3B0aW9uV2l0aFBpbnlpbiB9IGZyb20gXCJAdmVmLWZyYW1ld29yay1yZWFjdC9jb3JlXCI7XG5pbXBvcnQgdHlwZSB7IERpY3Rpb25hcnlBbGlhc01hcCB9IGZyb20gXCJAdmVmLWZyYW1ld29yay1yZWFjdC9ob29rc1wiO1xuaW1wb3J0IHR5cGUgeyBLZXkgfSBmcm9tIFwiQHZlZi1mcmFtZXdvcmstcmVhY3Qvc2hhcmVkXCI7XG5cbmltcG9ydCB0eXBlIHsgU2VsZWN0UHJvcHMgfSBmcm9tIFwiLi5cIjtcbmltcG9ydCB0eXBlIHsgR2V0UHJvcCB9IGZyb20gXCIuLi8uLi9fYmFzZVwiO1xuXG5pbXBvcnQgeyB1c2VEaWN0aW9uYXJ5UXVlcnkgfSBmcm9tIFwiQHZlZi1mcmFtZXdvcmstcmVhY3QvaG9va3NcIjtcbmltcG9ydCB7IGlzQXJyYXksIHdpdGhQaW55aW4gfSBmcm9tIFwiQHZlZi1mcmFtZXdvcmstcmVhY3Qvc2hhcmVkXCI7XG5pbXBvcnQgeyB1c2VNZ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HRpb25XaXRob3V0Q2hpbGRyZW4sXG4gICAgLi4uaXNBcnJheSh0cmFuc2Zvcm1lZENoaWxkcmVuKSAmJiB7IGNoaWxkcmVuOiB0cmFuc2Zvcm1lZENoaWxkcmVuIH1cbiAgfTtcblxuICByZXR1cm4gd2l0aFBpbnlpbihcbiAgICBvcHRpb25XaXRoQ2hpbGRyZW4sXG4gICAgXCJsYWJlbFwiLFxuICAgIFwiZGVzY3JpcHRpb25cIlxuICApO1xufVxuXG5mdW5jdGlvbiBmaWx0ZXJPcHRpb24oaW5wdXQ6IHN0cmluZywgb3B0aW9uPzogRGF0YU9wdGlvbldpdGhQaW55aW48RGF0YU9wdGlvbj4pIHtcbiAgaWYgKCFvcHRpb24pIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICBjb25zdCB7XG4gICAgbGFiZWwsXG4gICAgbGFiZWxQaW55aW4sXG4gICAgbGFiZWxQaW55aW5Jbml0aWFscyxcbiAgICBkZXNjcmlwdGlvbixcbiAgICBkZXNjcmlwdGlvblBpbnlpbixcbiAgICBkZXNjcmlwdGlvblBpbnlpbkluaXRpYWxzXG4gIH0gPSBvcHRpb247XG4gIHJldHVybiAoXG4gICAgbGFiZWwuaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgbGFiZWxQaW55aW4uaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgbGFiZWxQaW55aW5Jbml0aWFscy5pbmNsdWRlcyhpbnB1dClcbiAgICB8fCBkZXNjcmlwdGlvbj8uaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgZGVzY3JpcHRpb25QaW55aW4/LmluY2x1ZGVzKGlucHV0KVxuICAgIHx8IGRlc2NyaXB0aW9uUGlueWluSW5pdGlhbHM/LmluY2x1ZGVzKGlucHV0KVxuICApID8/IGZhbHNlO1xufVxuIl19 */`),children:(0,t.jsx)(e.Loader,{})});function l(e,t){let{filterable:n=!1}=t??{},{data:a,isFetching:l}=(0,r.useDictionaryQuery)(e);return(0,i.useMemo)(()=>Object.fromEntries(Object.entries(e).map(([e,t])=>{let r=typeof t==`string`?n:t.filterable??n;return[e,{options:u(a?.[e]??[]),loading:l,fieldNames:o,maxTagCount:`responsive`,listHeight:s,notFoundContent:l?c:void 0,showSearch:r,filterOption:r&&f}]})),[a,e,l,n])}function u(e){return e.map(e=>d(e))}function d(e){let{children:t,...r}=e,i=Array.isArray(t)&&t.length>0?t.map(e=>d(e)):void 0,a={...r,...(0,n.isArray)(i)&&{children:i}};return(0,n.withPinyin)(a,`label`,`description`)}function f(e,t){if(!t)return!1;let{label:n,labelPinyin:r,labelPinyinInitials:i,description:a,descriptionPinyin:o,descriptionPinyinInitials:s}=t;return(n.includes(e)||r.includes(e)||i.includes(e)||a?.includes(e)||o?.includes(e)||s?.includes(e))??!1}exports.useDictionaryOptionsSelect=l;
@@ -1,55 +0,0 @@
1
- /*! @vef-framework-react/components v2.11.0 made by Venus | 2026-07-15T09:37:59.038Z */
2
- import { Loader as e } from "../../loader/index.js";
3
- import { jsx as t } from "@emotion/react/jsx-runtime";
4
- import { isArray as n, withPinyin as r } from "@vef-framework-react/shared";
5
- import { useDictionaryQuery as i } from "@vef-framework-react/hooks";
6
- import { useMemo as a } from "react";
7
- import { css as o } from "@emotion/react";
8
- //#region src/select/hooks/use-dictionary-options-select.tsx
9
- var s = {
10
- label: "label",
11
- value: "value",
12
- options: "children",
13
- groupLabel: "label"
14
- }, c = 280, l = /* @__PURE__ */ t("div", {
15
- css: /*#__PURE__*/ o({ height: c / 2 }, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVzZS1kaWN0aW9uYXJ5LW9wdGlvbnMtc2VsZWN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q08iLCJmaWxlIjoidXNlLWRpY3Rpb25hcnktb3B0aW9ucy1zZWxlY3QudHN4Iiwic291cmNlc0NvbnRlbnQi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CB7XG4gICAgbGFiZWwsXG4gICAgbGFiZWxQaW55aW4sXG4gICAgbGFiZWxQaW55aW5Jbml0aWFscyxcbiAgICBkZXNjcmlwdGlvbixcbiAgICBkZXNjcmlwdGlvblBpbnlpbixcbiAgICBkZXNjcmlwdGlvblBpbnlpbkluaXRpYWxzXG4gIH0gPSBvcHRpb247XG4gIHJldHVybiAoXG4gICAgbGFiZWwuaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgbGFiZWxQaW55aW4uaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgbGFiZWxQaW55aW5Jbml0aWFscy5pbmNsdWRlcyhpbnB1dClcbiAgICB8fCBkZXNjcmlwdGlvbj8uaW5jbHVkZXMoaW5wdXQpXG4gICAgfHwgZGVzY3JpcHRpb25QaW55aW4/LmluY2x1ZGVzKGlucHV0KVxuICAgIHx8IGRlc2NyaXB0aW9uUGlueWluSW5pdGlhbHM/LmluY2x1ZGVzKGlucHV0KVxuICApID8/IGZhbHNlO1xufVxuIl19 */"),
16
- children: /* @__PURE__ */ t(e, {})
17
- });
18
- function u(e, t) {
19
- let { filterable: n = !1 } = t ?? {}, { data: r, isFetching: o } = i(e);
20
- return a(() => Object.fromEntries(Object.entries(e).map(([e, t]) => {
21
- let i = typeof t == "string" ? n : t.filterable ?? n;
22
- return [e, {
23
- options: d(r?.[e] ?? []),
24
- loading: o,
25
- fieldNames: s,
26
- maxTagCount: "responsive",
27
- listHeight: c,
28
- notFoundContent: o ? l : void 0,
29
- showSearch: i,
30
- filterOption: i && p
31
- }];
32
- })), [
33
- r,
34
- e,
35
- o,
36
- n
37
- ]);
38
- }
39
- function d(e) {
40
- return e.map((e) => f(e));
41
- }
42
- function f(e) {
43
- let { children: t, ...i } = e, a = Array.isArray(t) && t.length > 0 ? t.map((e) => f(e)) : void 0;
44
- return r({
45
- ...i,
46
- ...n(a) && { children: a }
47
- }, "label", "description");
48
- }
49
- function p(e, t) {
50
- if (!t) return !1;
51
- let { label: n, labelPinyin: r, labelPinyinInitials: i, description: a, descriptionPinyin: o, descriptionPinyinInitials: s } = t;
52
- return (n.includes(e) || r.includes(e) || i.includes(e) || a?.includes(e) || o?.includes(e) || s?.includes(e)) ?? !1;
53
- }
54
- //#endregion
55
- export { u as useDictionaryOptionsSelect };
@@ -1,14 +0,0 @@
1
- import { DataOption, DataOptionWithPinyin } from '@vef-framework-react/core';
2
- import { DictionaryAliasMap } from '@vef-framework-react/hooks';
3
- import { Key } from '@vef-framework-react/shared';
4
- import { SelectProps } from '..';
5
- export interface UseDictionaryOptionsSelectOptions {
6
- /**
7
- * Whether each select should enable search.
8
- *
9
- * @default false
10
- */
11
- filterable?: boolean;
12
- }
13
- export type UseDictionaryOptionsSelectResult<T extends DictionaryAliasMap> = Record<Extract<keyof T, string>, SelectProps<Key, DataOptionWithPinyin<DataOption>>>;
14
- export declare function useDictionaryOptionsSelect<const T extends DictionaryAliasMap>(keys: T, options?: UseDictionaryOptionsSelectOptions): UseDictionaryOptionsSelectResult<T>;