abstract-controls.xml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- ENHANCED Abstract Control Definitions for UI Layout Definition Format -->
  3. <patterns xmlns="ui-layout-patterns">
  4. <!-- ENHANCEMENT: Base abstract control with data binding and accessibility -->
  5. <control name="CommonControl" type="base" category="abstract">
  6. <description>Base abstract control defining common attributes including data binding and accessibility</description>
  7. <constraints>
  8. <allowed-parents>any</allowed-parents>
  9. <allowed-children>depends-on-implementation</allowed-children>
  10. <container>depends-on-implementation</container>
  11. </constraints>
  12. <attributes>
  13. <!-- Original attributes -->
  14. <attribute name="name" type="string" required="true" />
  15. <attribute name="enabled" type="bool" default="true" />
  16. <attribute name="text" type="string" default="" />
  17. <attribute name="visible" type="bool" default="true" />
  18. <attribute name="data-source" type="string" default="" />
  19. <attribute name="dock" type="enum" values="none,left,right,top,bottom" default="none" />
  20. <attribute name="tooltip" type="string" default="" />
  21. <!-- ENHANCEMENT: Data Binding Support -->
  22. <attribute name="data-context" type="string" default="" />
  23. <attribute name="binding-path" type="string" default="" />
  24. <attribute name="command-binding" type="string" default="" />
  25. <attribute name="validation-rule" type="string" default="" />
  26. <attribute name="converter" type="string" default="" />
  27. <attribute name="binding-mode" type="enum" values="OneWay,TwoWay,OneTime,OneWayToSource" default="TwoWay" />
  28. <!-- ENHANCEMENT: Accessibility Support -->
  29. <attribute name="aria-label" type="string" default="" />
  30. <attribute name="aria-description" type="string" default="" />
  31. <attribute name="aria-role" type="string" default="" />
  32. <attribute name="aria-live" type="enum" values="off,polite,assertive" default="off" />
  33. <attribute name="tab-index" type="int" default="0" />
  34. <attribute name="access-key" type="string" default="" />
  35. <attribute name="high-contrast-support" type="bool" default="true" />
  36. <attribute name="screen-reader-text" type="string" default="" />
  37. <!-- ENHANCEMENT: Version Compatibility -->
  38. <attribute name="min-version" type="string" default="1.0" />
  39. <attribute name="max-version" type="string" default="2.0" />
  40. <attribute name="deprecated-in" type="string" default="" />
  41. <attribute name="replaced-by" type="string" default="" />
  42. </attributes>
  43. </control>
  44. <!-- ENHANCEMENT: StatusBar Control (was missing) -->
  45. <control name="StatusBar" type="container" category="layout" inherits="CommonControl">
  46. <description>Status bar container for displaying application status information</description>
  47. <constraints>
  48. <allowed-parents>Panel,window</allowed-parents>
  49. <allowed-children>items,context-menu</allowed-children>
  50. <container>true</container>
  51. <max-children>unlimited</max-children>
  52. <requires-structure>items</requires-structure>
  53. </constraints>
  54. <attributes>
  55. <attribute name="show-panels" type="bool" default="true" />
  56. <attribute name="sizing-grip" type="bool" default="true" />
  57. <attribute name="height" type="int" default="22" min="16" max="50" />
  58. <attribute name="dock-position" type="enum" values="bottom,top" default="bottom" />
  59. <attribute name="auto-size-panels" type="bool" default="true" />
  60. </attributes>
  61. <structure>
  62. <items min-count="0" max-count="unlimited">
  63. <status-item>
  64. <control-ref allowed-types="Label,Image,ComboBox,Button,ProgressBar" />
  65. </status-item>
  66. </items>
  67. <context-menu max-count="1" />
  68. </structure>
  69. </control>
  70. <!-- ENHANCEMENT: ProgressBar Control -->
  71. <control name="ProgressBar" type="display" category="basic" inherits="CommonControl">
  72. <description>Progress indicator control with enhanced features</description>
  73. <constraints>
  74. <allowed-parents>Panel,SplitPanel,StatusBar,FormField</allowed-parents>
  75. <allowed-children>none</allowed-children>
  76. <container>false</container>
  77. </constraints>
  78. <attributes>
  79. <attribute name="minimum" type="int" default="0" />
  80. <attribute name="maximum" type="int" default="100" />
  81. <attribute name="value" type="int" default="0" />
  82. <attribute name="step" type="int" default="1" />
  83. <attribute name="style" type="enum" values="blocks,continuous,marquee" default="continuous" />
  84. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  85. <attribute name="show-text" type="bool" default="false" />
  86. <attribute name="text-format" type="string" default="{0}%" />
  87. <attribute name="indeterminate" type="bool" default="false" />
  88. <attribute name="animation-speed" type="int" default="100" min="0" max="1000" />
  89. <attribute name="color" type="color" default="#0078d4" />
  90. <attribute name="background-color" type="color" default="#f0f0f0" />
  91. </attributes>
  92. <behavior>
  93. <event name="value-changed" />
  94. <event name="progress-completed" />
  95. </behavior>
  96. </control>
  97. <!-- ENHANCEMENT: DatePicker Control -->
  98. <control name="DatePicker" type="input" category="basic" inherits="CommonControl">
  99. <description>Date selection control with calendar popup</description>
  100. <constraints>
  101. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  102. <allowed-children>none</allowed-children>
  103. <container>false</container>
  104. </constraints>
  105. <attributes>
  106. <attribute name="selected-date" type="date" default="null" />
  107. <attribute name="min-date" type="date" default="1900-01-01" />
  108. <attribute name="max-date" type="date" default="2100-12-31" />
  109. <attribute name="format" type="string" default="yyyy-MM-dd" />
  110. <attribute name="placeholder-text" type="string" default="" />
  111. <attribute name="show-calendar-button" type="bool" default="true" />
  112. <attribute name="show-clear-button" type="bool" default="false" />
  113. <attribute name="first-day-of-week" type="enum" values="sunday,monday,tuesday,wednesday,thursday,friday,saturday" default="sunday" />
  114. <attribute name="highlight-today" type="bool" default="true" />
  115. <attribute name="allow-text-input" type="bool" default="true" />
  116. </attributes>
  117. <behavior>
  118. <event name="date-selected" />
  119. <event name="date-changed" />
  120. <event name="calendar-opened" />
  121. <event name="calendar-closed" />
  122. </behavior>
  123. </control>
  124. <!-- ENHANCEMENT: NumericUpDown Control -->
  125. <control name="NumericUpDown" type="input" category="basic" inherits="CommonControl">
  126. <description>Numeric input control with up/down buttons</description>
  127. <constraints>
  128. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  129. <allowed-children>none</allowed-children>
  130. <container>false</container>
  131. </constraints>
  132. <attributes>
  133. <attribute name="value" type="decimal" default="0" />
  134. <attribute name="minimum" type="decimal" default="0" />
  135. <attribute name="maximum" type="decimal" default="100" />
  136. <attribute name="increment" type="decimal" default="1" />
  137. <attribute name="decimal-places" type="int" default="0" min="0" max="10" />
  138. <attribute name="thousands-separator" type="bool" default="false" />
  139. <attribute name="format-string" type="string" default="" />
  140. <attribute name="show-buttons" type="bool" default="true" />
  141. <attribute name="button-position" type="enum" values="right,left" default="right" />
  142. <attribute name="wrap-value" type="bool" default="false" />
  143. <attribute name="allow-null" type="bool" default="false" />
  144. </attributes>
  145. <behavior>
  146. <event name="value-changed" />
  147. <event name="increment" />
  148. <event name="decrement" />
  149. </behavior>
  150. </control>
  151. <!-- ENHANCEMENT: Slider Control -->
  152. <control name="Slider" type="input" category="basic" inherits="CommonControl">
  153. <description>Range slider control for selecting numeric values</description>
  154. <constraints>
  155. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  156. <allowed-children>none</allowed-children>
  157. <container>false</container>
  158. </constraints>
  159. <attributes>
  160. <attribute name="value" type="double" default="0" />
  161. <attribute name="minimum" type="double" default="0" />
  162. <attribute name="maximum" type="double" default="100" />
  163. <attribute name="step" type="double" default="1" />
  164. <attribute name="orientation" type="enum" values="horizontal,vertical" default="horizontal" />
  165. <attribute name="show-ticks" type="bool" default="false" />
  166. <attribute name="tick-frequency" type="double" default="10" />
  167. <attribute name="tick-placement" type="enum" values="none,top-left,bottom-right,both" default="bottom-right" />
  168. <attribute name="show-value" type="bool" default="false" />
  169. <attribute name="value-format" type="string" default="{0}" />
  170. <attribute name="snap-to-ticks" type="bool" default="false" />
  171. <attribute name="thumb-style" type="enum" values="round,square,custom" default="round" />
  172. </attributes>
  173. <behavior>
  174. <event name="value-changed" />
  175. <event name="thumb-drag-started" />
  176. <event name="thumb-drag-completed" />
  177. </behavior>
  178. </control>
  179. <!-- ENHANCEMENT: Enhanced TextBox Control -->
  180. <control name="TextBox" type="input" category="basic" inherits="CommonControl">
  181. <description>Enhanced text input control with validation and data binding</description>
  182. <constraints>
  183. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  184. <allowed-children>none</allowed-children>
  185. <container>false</container>
  186. </constraints>
  187. <attributes>
  188. <attribute name="placeholder" type="string" default="" />
  189. <attribute name="max-length" type="int" default="255" min="1" max="10000" />
  190. <attribute name="readonly" type="bool" default="false" />
  191. <attribute name="multiline" type="bool" default="false" />
  192. <attribute name="password" type="bool" default="false" />
  193. <!-- ENHANCEMENT: Additional input types and features -->
  194. <attribute name="input-type" type="enum" values="text,email,url,tel,number,search" default="text" />
  195. <attribute name="auto-complete" type="enum" values="off,on,name,email,username,current-password" default="off" />
  196. <attribute name="spell-check" type="bool" default="true" />
  197. <attribute name="text-transform" type="enum" values="none,uppercase,lowercase,capitalize" default="none" />
  198. <attribute name="validation-pattern" type="string" default="" />
  199. <attribute name="validation-message" type="string" default="" />
  200. <attribute name="required" type="bool" default="false" />
  201. <attribute name="auto-focus" type="bool" default="false" />
  202. </attributes>
  203. <behavior>
  204. <event name="text-changed" />
  205. <event name="focus" />
  206. <event name="blur" />
  207. <event name="enter-pressed" />
  208. <!-- ENHANCEMENT: Validation events -->
  209. <event name="validation-error" />
  210. <event name="validation-success" />
  211. </behavior>
  212. </control>
  213. <!-- ENHANCEMENT: Enhanced Button Control -->
  214. <control name="Button" type="action" category="basic" inherits="CommonControl">
  215. <description>Enhanced clickable button control with command binding</description>
  216. <constraints>
  217. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField,ButtonBar</allowed-parents>
  218. <allowed-children>none</allowed-children>
  219. <container>false</container>
  220. </constraints>
  221. <attributes>
  222. <attribute name="type" type="enum" values="text,image,text-image" default="text" />
  223. <attribute name="image" type="string" default="" />
  224. <attribute name="image-position" type="enum" values="left,right,top,bottom" default="left" />
  225. <attribute name="style" type="enum" values="normal,primary,secondary,danger,success,warning,info,borderless" default="normal" />
  226. <!-- ENHANCEMENT: Additional button features -->
  227. <attribute name="size" type="enum" values="small,medium,large,extra-large" default="medium" />
  228. <attribute name="auto-size" type="bool" default="false" />
  229. <attribute name="width" type="int" min="20" max="300" />
  230. <attribute name="height" type="int" min="20" max="100" />
  231. <attribute name="is-default" type="bool" default="false" />
  232. <attribute name="is-cancel" type="bool" default="false" />
  233. <attribute name="command-parameter" type="string" default="" />
  234. <attribute name="confirm-message" type="string" default="" />
  235. <attribute name="loading-text" type="string" default="" />
  236. <attribute name="disabled-reason" type="string" default="" />
  237. </attributes>
  238. <behavior>
  239. <event name="click" alias="on-click" required="true" />
  240. <event name="mouse-enter" />
  241. <event name="mouse-leave" />
  242. <!-- ENHANCEMENT: Command events -->
  243. <event name="command-executed" />
  244. <event name="command-can-execute-changed" />
  245. </behavior>
  246. </control>
  247. <!-- ENHANCEMENT: Enhanced ComboBox Control -->
  248. <control name="ComboBox" type="input" category="basic" inherits="CommonControl">
  249. <description>Enhanced dropdown selection control with data binding and filtering</description>
  250. <constraints>
  251. <allowed-parents>Panel,SplitPanel,StatusBar,ToolBar,FormField</allowed-parents>
  252. <allowed-children>items</allowed-children>
  253. <container>false</container>
  254. <requires-structure>items</requires-structure>
  255. </constraints>
  256. <attributes>
  257. <attribute name="selected-value" type="string" default="" />
  258. <attribute name="selected-index" type="int" default="-1" />
  259. <attribute name="editable" type="bool" default="false" />
  260. <attribute name="dropdown-height" type="int" default="200" min="100" max="500" />
  261. <!-- ENHANCEMENT: Advanced features -->
  262. <attribute name="auto-complete" type="bool" default="false" />
  263. <attribute name="auto-complete-mode" type="enum" values="none,suggest,append,suggest-append" default="suggest" />
  264. <attribute name="filter-mode" type="enum" values="none,starts-with,contains,custom" default="none" />
  265. <attribute name="placeholder-text" type="string" default="" />
  266. <attribute name="allow-custom-values" type="bool" default="false" />
  267. <attribute name="items-source" type="string" default="" />
  268. <attribute name="display-member-path" type="string" default="" />
  269. <attribute name="value-member-path" type="string" default="" />
  270. <attribute name="group-member-path" type="string" default="" />
  271. </attributes>
  272. <behavior>
  273. <event name="selection-changed" alias="on-select" />
  274. <event name="text-changed" />
  275. <!-- ENHANCEMENT: Advanced events -->
  276. <event name="dropdown-opened" />
  277. <event name="dropdown-closed" />
  278. <event name="item-filtering" />
  279. </behavior>
  280. <structure>
  281. <items min-count="0" max-count="unlimited">
  282. <listbox-item inherits="ListBoxItem" />
  283. </items>
  284. <selected-items max-count="1" />
  285. </structure>
  286. </control>
  287. <!-- ENHANCEMENT: Enhanced Panel Control -->
  288. <control name="Panel" type="container" category="layout" inherits="CommonControl">
  289. <description>Enhanced container panel with advanced layout options</description>
  290. <constraints>
  291. <allowed-parents>Panel,SplitPanel,window,wireframe-instance</allowed-parents>
  292. <allowed-children>any-control</allowed-children>
  293. <container>true</container>
  294. <max-children>unlimited</max-children>
  295. </constraints>
  296. <attributes>
  297. <attribute name="border" type="bool" default="false" />
  298. <attribute name="border-style" type="enum" values="none,solid,dashed,dotted,double,groove,ridge,inset,outset" default="none" />
  299. <!-- ENHANCEMENT: Advanced styling -->
  300. <attribute name="border-width" type="int" default="1" min="0" max="10" />
  301. <attribute name="border-color" type="color" default="#000000" />
  302. <attribute name="border-radius" type="int" default="0" min="0" max="50" />
  303. <attribute name="background-color" type="color" default="transparent" />
  304. <attribute name="background-image" type="string" default="" />
  305. <attribute name="background-repeat" type="enum" values="no-repeat,repeat,repeat-x,repeat-y" default="no-repeat" />
  306. <attribute name="padding" type="int" default="0" min="0" max="50" />
  307. <attribute name="margin" type="int" default="0" min="0" max="50" />
  308. <attribute name="orientation" type="enum" values="horizontal,vertical" default="vertical" />
  309. <attribute name="alignment" type="enum" values="left,center,right,stretch,space-between,space-around" default="left" />
  310. <attribute name="vertical-alignment" type="enum" values="top,center,bottom,stretch" default="top" />
  311. <attribute name="auto-scroll" type="bool" default="false" />
  312. <attribute name="scroll-bars" type="enum" values="none,horizontal,vertical,both,auto" default="none" />
  313. <attribute name="width" type="int" min="10" max="2000" />
  314. <attribute name="height" type="int" min="10" max="2000" />
  315. <!-- ENHANCEMENT: Size constraints -->
  316. <attribute name="min-width" type="int" default="0" />
  317. <attribute name="min-height" type="int" default="0" />
  318. <attribute name="max-width" type="int" default="0" />
  319. <attribute name="max-height" type="int" default="0" />
  320. <attribute name="overflow" type="enum" values="visible,hidden,scroll,auto" default="visible" />
  321. <attribute name="z-index" type="int" default="0" />
  322. <attribute name="layout-mode" type="enum" values="flow,grid,flex,absolute" default="flow" />
  323. </attributes>
  324. <structure>
  325. <children allow-multiple="true" />
  326. </structure>
  327. </control>
  328. <!-- ENHANCEMENT: Enhanced ListView Control -->
  329. <control name="ListView" type="data" category="basic" inherits="CommonControl">
  330. <description>Enhanced list view control with advanced data binding and virtualization</description>
  331. <constraints>
  332. <allowed-parents>Panel,SplitPanel,FormField</allowed-parents>
  333. <allowed-children>columns,items,context-menu</allowed-children>
  334. <container>false</container>
  335. <requires-structure>columns,items</requires-structure>
  336. </constraints>
  337. <attributes>
  338. <attribute name="view-mode" type="enum" values="list,details,icons,tiles,cards" default="details" />
  339. <attribute name="multi-select" type="bool" default="false" />
  340. <attribute name="selection-mode" type="enum" values="none,single,multiple,extended" default="single" />
  341. <attribute name="grid-lines" type="bool" default="true" />
  342. <attribute name="full-row-select" type="bool" default="true" />
  343. <attribute name="sort-column" type="string" default="" />
  344. <attribute name="sort-direction" type="enum" values="asc,desc" default="asc" />
  345. <!-- ENHANCEMENT: Advanced features -->
  346. <attribute name="allow-column-reorder" type="bool" default="true" />
  347. <attribute name="allow-column-resize" type="bool" default="true" />
  348. <attribute name="virtualization-enabled" type="bool" default="false" />
  349. <attribute name="items-source" type="string" default="" />
  350. <attribute name="selected-items-binding" type="string" default="" />
  351. <attribute name="current-item-binding" type="string" default="" />
  352. <attribute name="filter-expression" type="string" default="" />
  353. <attribute name="group-by" type="string" default="" />
  354. <attribute name="page-size" type="int" default="0" min="0" max="1000" />
  355. <attribute name="loading-message" type="string" default="Loading..." />
  356. <attribute name="empty-message" type="string" default="No items to display" />
  357. </attributes>
  358. <behavior>
  359. <event name="selection-changed" alias="on-select" />
  360. <event name="item-double-click" />
  361. <event name="column-click" />
  362. <!-- ENHANCEMENT: Advanced events -->
  363. <event name="column-header-click" />
  364. <event name="items-loading" />
  365. <event name="items-loaded" />
  366. <event name="filter-changed" />
  367. <event name="sort-changed" />
  368. </behavior>
  369. <structure>
  370. <columns min-count="1" max-count="20">
  371. <column-item inherits="ColumnItem" />
  372. </columns>
  373. <items min-count="0" max-count="unlimited">
  374. <listview-item>
  375. <values>
  376. <value column="" text="" />
  377. </values>
  378. </listview-item>
  379. </items>
  380. <selected-items max-count="depends-on-multi-select" />
  381. <context-menu max-count="1" />
  382. </structure>
  383. </control>
  384. <!-- ENHANCEMENT: Enhanced structure definitions -->
  385. <structure name="ListBoxItem" type="data-item" category="basic">
  386. <description>Enhanced individual item within list-based controls</description>
  387. <attributes>
  388. <attribute name="value" type="string" required="true" />
  389. <attribute name="text" type="string" required="true" />
  390. <attribute name="selected" type="bool" default="false" />
  391. <attribute name="enabled" type="bool" default="true" />
  392. <attribute name="image" type="string" default="" />
  393. <attribute name="tooltip" type="string" default="" />
  394. <!-- ENHANCEMENT: Data binding and accessibility -->
  395. <attribute name="data-context" type="string" default="" />
  396. <attribute name="command" type="string" default="" />
  397. <attribute name="command-parameter" type="string" default="" />
  398. <attribute name="aria-label" type="string" default="" />
  399. <attribute name="group" type="string" default="" />
  400. </attributes>
  401. </structure>
  402. <structure name="ColumnItem" type="data-item" category="basic">
  403. <description>Enhanced column definition for ListView control</description>
  404. <attributes>
  405. <attribute name="name" type="string" required="true" />
  406. <attribute name="text" type="string" required="true" />
  407. <attribute name="width" type="int" default="100" min="20" max="500" />
  408. <attribute name="sortable" type="bool" default="true" />
  409. <attribute name="visible" type="bool" default="true" />
  410. <attribute name="alignment" type="enum" values="left,center,right" default="left" />
  411. <attribute name="data-type" type="enum" values="text,number,date,boolean,image,custom" default="text" />
  412. <!-- ENHANCEMENT: Advanced data binding -->
  413. <attribute name="binding-path" type="string" default="" />
  414. <attribute name="converter" type="string" default="" />
  415. <attribute name="format-string" type="string" default="" />
  416. <attribute name="sort-member-path" type="string" default="" />
  417. <attribute name="group-member-path" type="string" default="" />
  418. <attribute name="cell-template" type="string" default="" />
  419. <attribute name="header-template" type="string" default="" />
  420. <attribute name="frozen" type="bool" default="false" />
  421. <attribute name="resizable" type="bool" default="true" />
  422. <attribute name="aria-label" type="string" default="" />
  423. </attributes>
  424. </structure>
  425. <!-- Keep all other existing controls unchanged (Label, TreeView, Menu, etc.) -->
  426. <!-- ... (original controls remain the same) ... -->
  427. </patterns>