@shwfed/config 1.1.5 → 2.0.1

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 (286) hide show
  1. package/dist/module.d.mts +2 -19
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +15 -34
  4. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.d.vue.ts +36 -4
  5. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue +45 -8
  6. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/config.vue.d.ts +36 -4
  7. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/runtime.vue +15 -9
  8. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.d.ts +17 -1
  9. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json/schema.js +23 -4
  10. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.d.vue.ts +36 -4
  11. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue +39 -5
  12. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/config.vue.d.ts +36 -4
  13. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/runtime.vue +15 -9
  14. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.d.ts +17 -1
  15. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.http.request.json.confirm/schema.js +23 -5
  16. package/dist/runtime/components/actions/buttons/2026-04-18/com.shwfed.actions.button.prototype/config.vue +1 -0
  17. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/config.d.vue.ts +2 -2
  18. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/config.vue.d.ts +2 -2
  19. package/dist/runtime/components/actions/buttons/2026-04-21/com.shwfed.actions.button.navigation/runtime.vue +2 -3
  20. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.d.vue.ts +1 -1
  21. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue +44 -10
  22. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/config.vue.d.ts +1 -1
  23. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/runtime.vue +24 -7
  24. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.d.ts +6 -1
  25. package/dist/runtime/components/actions/buttons/2026-05-11/com.shwfed.actions.button.modal.layout/schema.js +6 -3
  26. package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/config.d.vue.ts +13 -5
  27. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/config.vue +32 -0
  28. package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/config.vue.d.ts +13 -5
  29. package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.search → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.vue +5 -7
  30. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.d.ts +17 -0
  31. package/dist/runtime/components/actions/buttons/2026-05-15/com.shwfed.actions.button.event.dispatch/schema.js +18 -0
  32. package/dist/runtime/components/actions/components/group.vue +2 -3
  33. package/dist/runtime/components/actions/components/triggers-field.d.vue.ts +17 -0
  34. package/dist/runtime/components/actions/components/triggers-field.vue +209 -0
  35. package/dist/runtime/components/actions/components/triggers-field.vue.d.ts +17 -0
  36. package/dist/runtime/components/actions/config.vue +51 -1
  37. package/dist/runtime/components/actions/schema.d.ts +4 -0
  38. package/dist/runtime/components/actions/schema.js +6 -0
  39. package/dist/runtime/components/actions/utils/resolve.d.ts +25 -1
  40. package/dist/runtime/components/actions/utils/resolve.js +37 -9
  41. package/dist/runtime/components/app.vue +1 -1
  42. package/dist/runtime/components/block-layout-editor/index.vue +11 -11
  43. package/dist/runtime/components/block-layout-editor/sidebar.vue +0 -4
  44. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.d.vue.ts +2 -0
  45. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/config.vue.d.ts +2 -0
  46. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.d.vue.ts +2 -0
  47. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/runtime.vue.d.ts +2 -0
  48. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.form/schema.d.ts +2 -0
  49. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.d.vue.ts +6 -0
  50. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/config.vue.d.ts +6 -0
  51. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.d.vue.ts +6 -0
  52. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/runtime.vue.d.ts +6 -0
  53. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.table/schema.d.ts +7 -0
  54. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.d.vue.ts +1 -1
  55. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue +16 -2
  56. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/config.vue.d.ts +1 -1
  57. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/runtime.vue +1 -0
  58. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.d.ts +18 -9
  59. package/dist/runtime/components/config/blocks/2026-05-06/com.shwfed.block.tabs/schema.js +8 -4
  60. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.d.vue.ts +77 -0
  61. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.vue +535 -0
  62. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/config.vue.d.ts +77 -0
  63. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.d.vue.ts +77 -0
  64. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.vue +233 -0
  65. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/runtime.vue.d.ts +77 -0
  66. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/schema.d.ts +134 -0
  67. package/dist/runtime/components/config/blocks/2026-05-17/com.shwfed.block.chart.line/schema.js +142 -0
  68. package/dist/runtime/components/config/index.vue +1 -1
  69. package/dist/runtime/components/config/use-editor.js +4 -3
  70. package/dist/runtime/components/form/DerivedValueEditor.d.vue.ts +19 -0
  71. package/dist/runtime/components/form/DerivedValueEditor.vue +77 -0
  72. package/dist/runtime/components/form/DerivedValueEditor.vue.d.ts +19 -0
  73. package/dist/runtime/components/form/config.vue +58 -24
  74. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.d.vue.ts +8 -0
  75. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue +21 -0
  76. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/config.vue.d.ts +8 -0
  77. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/runtime.vue +29 -31
  78. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.d.ts +4 -0
  79. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.text/schema.js +3 -2
  80. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.d.vue.ts +8 -0
  81. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue +21 -0
  82. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/config.vue.d.ts +8 -0
  83. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/runtime.vue +24 -26
  84. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.d.ts +4 -0
  85. package/dist/runtime/components/form/fields/2026-04-22/com.shwfed.form.field.textarea/schema.js +3 -2
  86. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.d.vue.ts +10 -2
  87. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue +21 -0
  88. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/config.vue.d.ts +10 -2
  89. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/runtime.vue +15 -7
  90. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.d.ts +4 -0
  91. package/dist/runtime/components/form/fields/2026-04-24/com.shwfed.form.field.combobox.single/schema.js +2 -1
  92. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.d.vue.ts +10 -2
  93. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue +21 -0
  94. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/config.vue.d.ts +10 -2
  95. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/runtime.vue +14 -6
  96. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.d.ts +4 -0
  97. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.date/schema.js +2 -1
  98. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.d.vue.ts +10 -2
  99. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue +21 -0
  100. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/config.vue.d.ts +10 -2
  101. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/runtime.vue +14 -6
  102. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.d.ts +4 -0
  103. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.daterange/schema.js +2 -1
  104. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.d.vue.ts +12 -4
  105. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue +21 -0
  106. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/config.vue.d.ts +12 -4
  107. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/runtime.vue +14 -6
  108. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.d.ts +4 -0
  109. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetime/schema.js +2 -1
  110. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.d.vue.ts +12 -4
  111. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue +21 -0
  112. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/config.vue.d.ts +12 -4
  113. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/runtime.vue +14 -6
  114. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.d.ts +4 -0
  115. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.datetimerange/schema.js +2 -1
  116. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.d.vue.ts +12 -4
  117. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue +21 -0
  118. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/config.vue.d.ts +12 -4
  119. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/runtime.vue +14 -6
  120. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.d.ts +4 -0
  121. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.time/schema.js +2 -1
  122. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.d.vue.ts +12 -4
  123. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue +21 -0
  124. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/config.vue.d.ts +12 -4
  125. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/runtime.vue +14 -6
  126. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.d.ts +4 -0
  127. package/dist/runtime/components/form/fields/2026-04-27/com.shwfed.form.field.timerange/schema.js +2 -1
  128. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.d.vue.ts +8 -0
  129. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue +21 -0
  130. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/config.vue.d.ts +8 -0
  131. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/runtime.vue +37 -38
  132. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.d.ts +4 -0
  133. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.number/schema.js +2 -1
  134. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.d.vue.ts +10 -2
  135. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue +21 -0
  136. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/config.vue.d.ts +10 -2
  137. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/runtime.vue +33 -22
  138. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.d.ts +4 -0
  139. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.numberrange/schema.js +2 -1
  140. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.d.vue.ts +8 -0
  141. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue +21 -0
  142. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/config.vue.d.ts +8 -0
  143. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/runtime.vue +14 -6
  144. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.d.ts +4 -0
  145. package/dist/runtime/components/form/fields/2026-04-28/com.shwfed.form.field.switch/schema.js +3 -2
  146. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.d.vue.ts +8 -0
  147. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.vue +21 -0
  148. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/config.vue.d.ts +8 -0
  149. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/runtime.vue +14 -7
  150. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.d.ts +4 -0
  151. package/dist/runtime/components/form/fields/2026-04-29/com.shwfed.form.field.combobox.single/schema.js +2 -1
  152. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/config.vue +1 -0
  153. package/dist/runtime/components/form/fields/2026-05-12/com.shwfed.form.field.upload/runtime.vue +13 -8
  154. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.d.vue.ts +10 -2
  155. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue +25 -1
  156. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/config.vue.d.ts +10 -2
  157. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/runtime.vue +102 -44
  158. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.d.ts +14 -0
  159. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.combobox.single.remote/schema.js +14 -5
  160. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/config.vue +1 -0
  161. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/row.vue +22 -5
  162. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/runtime.vue +7 -4
  163. package/dist/runtime/components/form/fields/2026-05-13/com.shwfed.form.field.list/schema.js +7 -1
  164. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.d.vue.ts +113 -0
  165. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue +426 -0
  166. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/config.vue.d.ts +113 -0
  167. package/dist/runtime/components/{actions/buttons/2026-04-27/com.shwfed.actions.button.table.search → form/fields/2026-05-17/com.shwfed.form.field.checkbox.group}/runtime.d.vue.ts +1 -1
  168. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/runtime.vue +176 -0
  169. package/dist/runtime/components/{actions/buttons/2026-04-27/com.shwfed.actions.button.table.search → form/fields/2026-05-17/com.shwfed.form.field.checkbox.group}/runtime.vue.d.ts +1 -1
  170. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.d.ts +121 -0
  171. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.checkbox.group/schema.js +78 -0
  172. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.d.vue.ts +113 -0
  173. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue +426 -0
  174. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/config.vue.d.ts +113 -0
  175. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.d.vue.ts +8 -0
  176. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue +159 -0
  177. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/runtime.vue.d.ts +8 -0
  178. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.d.ts +121 -0
  179. package/dist/runtime/components/form/fields/2026-05-17/com.shwfed.form.field.radio.group/schema.js +78 -0
  180. package/dist/runtime/components/form/index.d.vue.ts +6 -0
  181. package/dist/runtime/components/form/index.vue +41 -6
  182. package/dist/runtime/components/form/index.vue.d.ts +6 -0
  183. package/dist/runtime/components/form/schema.d.ts +5 -1
  184. package/dist/runtime/components/form/schema.js +13 -1
  185. package/dist/runtime/components/form/unit-config.d.vue.ts +0 -3
  186. package/dist/runtime/components/form/unit-config.vue +4 -10
  187. package/dist/runtime/components/form/unit-config.vue.d.ts +0 -3
  188. package/dist/runtime/components/form/utils/commit-bus.d.ts +26 -0
  189. package/dist/runtime/components/form/utils/commit-bus.js +27 -0
  190. package/dist/runtime/components/form/utils/common.d.ts +27 -0
  191. package/dist/runtime/components/form/utils/common.js +31 -0
  192. package/dist/runtime/components/form/utils/derived.d.ts +72 -0
  193. package/dist/runtime/components/form/utils/derived.js +116 -0
  194. package/dist/runtime/components/form/utils/field-value.d.ts +35 -0
  195. package/dist/runtime/components/form/utils/field-value.js +40 -0
  196. package/dist/runtime/components/form/utils/history.d.ts +36 -0
  197. package/dist/runtime/components/form/utils/history.js +74 -0
  198. package/dist/runtime/components/form/utils/readonly.d.ts +8 -0
  199. package/dist/runtime/components/form/utils/readonly.js +9 -0
  200. package/dist/runtime/components/form/utils/state.d.ts +27 -1
  201. package/dist/runtime/components/form/utils/state.js +16 -8
  202. package/dist/runtime/components/table/ai/columns-button.vue +3 -4
  203. package/dist/runtime/components/table/ai/data-source-button.vue +3 -4
  204. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.icon/runtime.vue +2 -3
  205. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.markdown/runtime.vue +2 -3
  206. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.select/runtime.vue +2 -3
  207. package/dist/runtime/components/table/columns/2026-04-14/com.shwfed.table.column.text/runtime.vue +2 -3
  208. package/dist/runtime/components/table/columns/2026-05-13/com.shwfed.table.column.switch/runtime.vue +11 -6
  209. package/dist/runtime/components/table/config.vue +46 -2
  210. package/dist/runtime/components/table/index.d.vue.ts +4 -0
  211. package/dist/runtime/components/table/index.vue +28 -22
  212. package/dist/runtime/components/table/index.vue.d.ts +4 -0
  213. package/dist/runtime/components/table/schema.d.ts +33 -0
  214. package/dist/runtime/components/table/schema.js +21 -0
  215. package/dist/runtime/components/table/utils/instance.d.ts +2 -0
  216. package/dist/runtime/components/table/utils/instance.js +8 -0
  217. package/dist/runtime/components/ui/date-picker/DatePickerInput.vue +2 -2
  218. package/dist/runtime/components/ui/date-picker/DatePickerTimeInput.vue +2 -2
  219. package/dist/runtime/components/ui/date-range-picker/DateRangePickerInput.vue +2 -2
  220. package/dist/runtime/components/ui/date-range-picker/DateRangePickerTimeInput.vue +2 -2
  221. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.d.vue.ts +13 -1
  222. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue +11 -3
  223. package/dist/runtime/components/ui/expression-editor/ExpressionEditor.vue.d.ts +13 -1
  224. package/dist/runtime/components/ui/locale/Locale.vue +2 -2
  225. package/dist/runtime/components/ui/radio-group/RadioGroup.d.vue.ts +22 -0
  226. package/dist/runtime/components/ui/radio-group/RadioGroup.vue +32 -0
  227. package/dist/runtime/components/ui/radio-group/RadioGroup.vue.d.ts +22 -0
  228. package/dist/runtime/components/ui/radio-group/RadioGroupItem.d.vue.ts +8 -0
  229. package/dist/runtime/components/ui/radio-group/RadioGroupItem.vue +36 -0
  230. package/dist/runtime/components/ui/radio-group/RadioGroupItem.vue.d.ts +8 -0
  231. package/dist/runtime/components/ui/radio-group/index.d.ts +2 -0
  232. package/dist/runtime/components/ui/radio-group/index.js +2 -0
  233. package/dist/runtime/composables/useOverlay.d.ts +1 -5
  234. package/dist/runtime/composables/useOverlay.js +4 -3
  235. package/dist/runtime/composables/useTranslateLocale.js +1 -2
  236. package/dist/runtime/share/event-bus.d.ts +118 -0
  237. package/dist/runtime/share/event-bus.js +55 -0
  238. package/dist/runtime/share/expression.d.ts +7 -0
  239. package/dist/runtime/share/expression.js +3 -1
  240. package/dist/runtime/share/layout.d.ts +1 -0
  241. package/dist/runtime/share/layout.js +3 -2
  242. package/dist/runtime/share/slot-renderer.vue +6 -4
  243. package/dist/runtime/{plugins → utils}/ai/cel-prompt.d.ts +1 -1
  244. package/dist/runtime/{plugins → utils}/ai/index.d.ts +1 -6
  245. package/dist/runtime/{plugins → utils}/ai/index.js +5 -14
  246. package/dist/runtime/utils/cel.d.ts +5 -0
  247. package/dist/runtime/utils/cel.js +42 -0
  248. package/dist/runtime/vendor/cel-js/CLAUDE.md +8 -2
  249. package/dist/runtime/vendor/cel-js/PROMPT.md +35 -10
  250. package/dist/runtime/vendor/cel-js/lib/functions.js +63 -1
  251. package/dist/runtime/vendor/cel-js/lib/http-builder.d.ts +35 -0
  252. package/dist/runtime/{plugins/http/builder.js → vendor/cel-js/lib/http-builder.js} +25 -23
  253. package/dist/runtime/vendor/cel-js/lib/http-builtins.d.ts +9 -10
  254. package/dist/runtime/vendor/cel-js/lib/http-builtins.js +53 -13
  255. package/dist/types.d.mts +7 -1
  256. package/package.json +1 -1
  257. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/config.vue +0 -10
  258. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/runtime.vue +0 -25
  259. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/schema.d.ts +0 -13
  260. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.reset/schema.js +0 -16
  261. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.d.vue.ts +0 -17
  262. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.vue +0 -10
  263. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/config.vue.d.ts +0 -17
  264. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/schema.d.ts +0 -13
  265. package/dist/runtime/components/actions/buttons/2026-04-27/com.shwfed.actions.button.table.search/schema.js +0 -16
  266. package/dist/runtime/components/table/utils/host.d.ts +0 -9
  267. package/dist/runtime/components/table/utils/host.js +0 -8
  268. package/dist/runtime/composables/useCel.d.ts +0 -16
  269. package/dist/runtime/composables/useCel.js +0 -8
  270. package/dist/runtime/middleware/token.d.ts +0 -2
  271. package/dist/runtime/middleware/token.js +0 -20
  272. package/dist/runtime/plugins/cel/http.d.ts +0 -8
  273. package/dist/runtime/plugins/cel/http.js +0 -49
  274. package/dist/runtime/plugins/cel/index.d.ts +0 -9
  275. package/dist/runtime/plugins/cel/index.js +0 -59
  276. package/dist/runtime/plugins/http/builder.d.ts +0 -14
  277. package/dist/runtime/plugins/http/index.d.ts +0 -19
  278. package/dist/runtime/plugins/http/index.js +0 -35
  279. package/dist/runtime/plugins/toast/index.d.ts +0 -108
  280. package/dist/runtime/plugins/toast/index.js +0 -10
  281. package/dist/runtime/types.d.ts +0 -25
  282. /package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.d.vue.ts +0 -0
  283. /package/dist/runtime/components/actions/buttons/{2026-04-27/com.shwfed.actions.button.table.reset → 2026-05-15/com.shwfed.actions.button.event.dispatch}/runtime.vue.d.ts +0 -0
  284. /package/dist/runtime/{plugins → utils}/ai/cel-prompt.js +0 -0
  285. /package/dist/runtime/{plugins/cel/context.d.ts → utils/cel-context.d.ts} +0 -0
  286. /package/dist/runtime/{plugins/cel/context.js → utils/cel-context.js} +0 -0
@@ -0,0 +1,233 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, watch } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { Effect, Option } from "effect";
5
+ import { Fetch } from "fx-fetch";
6
+ import { CurveType } from "@unovis/ts";
7
+ import { VisAxis, VisBulletLegend, VisCrosshair, VisLine, VisTooltip, VisXYContainer } from "@unovis/vue";
8
+ import { Markdown } from "../../../../ui/markdown";
9
+ import { cel } from "../../../../../utils/cel";
10
+ import { celBindings, injectCELContext } from "../../../../../utils/cel-context";
11
+ import { getLocalizedText } from "../../../../../share/locale";
12
+ defineOptions({ name: "ShwfedBlockChartLineRuntime" });
13
+ const block = defineModel("block", { type: null, ...{ required: true } });
14
+ const { locale } = useI18n();
15
+ const inheritedContext = injectCELContext();
16
+ const mounted = ref(false);
17
+ const dataValues = ref({});
18
+ const fetchError = ref(null);
19
+ const CURVE = {
20
+ linear: CurveType.Linear,
21
+ monotoneX: CurveType.MonotoneX,
22
+ natural: CurveType.Natural,
23
+ basis: CurveType.Basis,
24
+ cardinal: CurveType.Cardinal,
25
+ catmullRom: CurveType.CatmullRom,
26
+ step: CurveType.Step,
27
+ stepAfter: CurveType.StepAfter,
28
+ stepBefore: CurveType.StepBefore
29
+ };
30
+ const PALETTE = [
31
+ "#4e79a7",
32
+ "#f28e2b",
33
+ "#e15759",
34
+ "#76b7b2",
35
+ "#59a14f",
36
+ "#edc948",
37
+ "#b07aa1",
38
+ "#ff9da7",
39
+ "#9c755f",
40
+ "#bab0ac"
41
+ ];
42
+ const lineColors = computed(
43
+ () => block.value.y.map(
44
+ (s, i) => s.color && s.color.length > 0 ? s.color : PALETTE[i % PALETTE.length]
45
+ )
46
+ );
47
+ const caption = computed(() => getLocalizedText(block.value.caption, locale.value) || "");
48
+ function seriesLabel(s) {
49
+ return getLocalizedText(s.label, locale.value) || null;
50
+ }
51
+ function baseContext() {
52
+ return celBindings(inheritedContext);
53
+ }
54
+ async function fetchAll() {
55
+ const ctx = baseContext();
56
+ const out = {};
57
+ const failed = [];
58
+ for (const ds of block.value.dataSources) {
59
+ const program = Effect.gen(function* () {
60
+ let jsonOpt = Option.none();
61
+ if (ds.request) {
62
+ const builder = yield* cel(ds.request, ctx);
63
+ jsonOpt = Option.some(yield* builder.json());
64
+ }
65
+ return yield* cel(ds.data, { ...ctx, json: jsonOpt });
66
+ });
67
+ try {
68
+ out[ds.name] = await Effect.runPromise(Effect.provide(program, Fetch.layer));
69
+ } catch (e) {
70
+ console.warn("[shwfed-chart-line] data source failed", ds.name, e);
71
+ failed.push(ds.name);
72
+ out[ds.name] = [];
73
+ }
74
+ }
75
+ dataValues.value = out;
76
+ fetchError.value = failed.length > 0 ? `\u6570\u636E\u6E90\u52A0\u8F7D\u5931\u8D25\uFF1A${failed.join("\u3001")}` : null;
77
+ }
78
+ onMounted(() => {
79
+ mounted.value = true;
80
+ void fetchAll();
81
+ });
82
+ watch(
83
+ () => block.value.dataSources.map((d) => `${d.name}|${d.request ?? ""}|${d.data}`).join("\n"),
84
+ () => {
85
+ void fetchAll();
86
+ }
87
+ );
88
+ function isFiniteNum(v) {
89
+ return typeof v === "number" && Number.isFinite(v);
90
+ }
91
+ function toY(v) {
92
+ if (isFiniteNum(v)) return v;
93
+ if (typeof v === "string" && v.trim() !== "") {
94
+ const n = Number(v);
95
+ return Number.isFinite(n) ? n : void 0;
96
+ }
97
+ return void 0;
98
+ }
99
+ function evalList(expression, ctx) {
100
+ try {
101
+ const r = Effect.runSync(cel(expression, ctx));
102
+ return Array.isArray(r) ? r : [];
103
+ } catch {
104
+ return [];
105
+ }
106
+ }
107
+ const chartData = computed(() => {
108
+ const ctx = { ...baseContext(), ...dataValues.value };
109
+ const xRaw = evalList(block.value.x, ctx);
110
+ const yLists = block.value.y.map((s) => evalList(s.value, ctx));
111
+ const xMode = xRaw.length === 0 ? "ordinal" : xRaw.every((v) => v instanceof Date) ? "time" : xRaw.every((v) => isFiniteNum(v)) ? "number" : "ordinal";
112
+ const xLabels = /* @__PURE__ */ new Map();
113
+ const records = xRaw.map((xv, i) => {
114
+ const rec = { __x: i };
115
+ if (xMode === "time") rec.__x = xv.getTime();
116
+ else if (xMode === "number") rec.__x = xv;
117
+ else xLabels.set(i, xv === null || xv === void 0 ? "" : String(xv));
118
+ yLists.forEach((list, k) => {
119
+ rec[`y${k}`] = toY(list[i]);
120
+ });
121
+ return rec;
122
+ });
123
+ return { records, xMode, xLabels };
124
+ });
125
+ const xAccessor = (d) => d.__x;
126
+ const yAccessors = computed(
127
+ () => block.value.y.map((_, k) => (d) => d[`y${k}`])
128
+ );
129
+ const legendItems = computed(() => {
130
+ const items = [];
131
+ block.value.y.forEach((s, i) => {
132
+ const label = seriesLabel(s);
133
+ if (label) items.push({ name: label, color: lineColors.value[i] });
134
+ });
135
+ return items;
136
+ });
137
+ const xTickFormat = computed(() => {
138
+ const mode = chartData.value.xMode;
139
+ if (mode === "ordinal") {
140
+ const labels = chartData.value.xLabels;
141
+ return (tick) => labels.get(tick) ?? "";
142
+ }
143
+ if (mode === "time") return (tick) => new Date(tick).toLocaleDateString();
144
+ return void 0;
145
+ });
146
+ const xTickValues = computed(() => {
147
+ if (chartData.value.xMode !== "ordinal") return void 0;
148
+ const keys = [...chartData.value.xLabels.keys()];
149
+ if (keys.length <= 12) return keys;
150
+ const stride = Math.ceil(keys.length / 10);
151
+ return keys.filter((_, i) => i % stride === 0);
152
+ });
153
+ function formatNumber(n) {
154
+ return Number.isInteger(n) ? String(n) : n.toFixed(2);
155
+ }
156
+ function escapeHtml(s) {
157
+ return s.replace(/[&<>"]/g, (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;" })[c] ?? c);
158
+ }
159
+ function crosshairTemplate(d) {
160
+ const mode = chartData.value.xMode;
161
+ const xLabel = mode === "ordinal" ? chartData.value.xLabels.get(d.__x) ?? "" : mode === "time" ? new Date(d.__x).toLocaleDateString() : String(d.__x);
162
+ const rows = [];
163
+ block.value.y.forEach((s, k) => {
164
+ const label = seriesLabel(s);
165
+ if (!label) return;
166
+ const v = d[`y${k}`];
167
+ rows.push(
168
+ `<div style="display:flex;align-items:center;gap:6px;padding:1px 0"><span style="width:8px;height:8px;border-radius:9999px;background:${lineColors.value[k]}"></span><span style="color:#3f3f46">${escapeHtml(label)}</span><span style="margin-left:auto;font-variant-numeric:tabular-nums;color:#18181b">${v === void 0 ? "\u2014" : formatNumber(v)}</span></div>`
169
+ );
170
+ });
171
+ const lines = rows.join("");
172
+ return `<div style="font-size:12px;min-width:160px"><div style="font-weight:600;color:#18181b;margin-bottom:4px">${escapeHtml(xLabel)}</div>${lines}</div>`;
173
+ }
174
+ const placeholder = computed(() => {
175
+ if (fetchError.value) return fetchError.value;
176
+ if (chartData.value.records.length === 0) return "\u6682\u65E0\u6570\u636E";
177
+ return null;
178
+ });
179
+ </script>
180
+
181
+ <template>
182
+ <div class="flex h-full min-h-[200px] w-full flex-col gap-2">
183
+ <div
184
+ v-if="placeholder"
185
+ class="flex flex-1 items-center justify-center text-sm text-zinc-400"
186
+ >
187
+ {{ placeholder }}
188
+ </div>
189
+
190
+ <template v-else-if="mounted">
191
+ <VisXYContainer
192
+ :data="chartData.records"
193
+ :margin="{ top: 8, right: 16, bottom: 4, left: 8 }"
194
+ class="min-h-0 flex-1"
195
+ >
196
+ <VisLine
197
+ :x="xAccessor"
198
+ :y="yAccessors"
199
+ :color="lineColors"
200
+ :curve-type="CURVE[block.curveType]"
201
+ :line-width="block.lineWidth"
202
+ />
203
+ <VisAxis
204
+ type="x"
205
+ :tick-format="xTickFormat"
206
+ :tick-values="xTickValues"
207
+ :tick-text-hide-overlapping="true"
208
+ :grid-line="false"
209
+ />
210
+ <VisAxis type="y" />
211
+ <VisCrosshair
212
+ :x="xAccessor"
213
+ :y="yAccessors"
214
+ :color="lineColors"
215
+ :template="crosshairTemplate"
216
+ />
217
+ <VisTooltip />
218
+ </VisXYContainer>
219
+
220
+ <VisBulletLegend
221
+ v-if="legendItems.length > 0"
222
+ :items="legendItems"
223
+ class="mx-auto w-fit shrink-0 text-xs"
224
+ />
225
+ <Markdown
226
+ v-if="caption"
227
+ :source="caption"
228
+ block
229
+ class="prose prose-sm prose-zinc max-w-none shrink-0 text-center"
230
+ />
231
+ </template>
232
+ </div>
233
+ </template>
@@ -0,0 +1,77 @@
1
+ import type { Value } from './schema.js';
2
+ type __VLS_ModelProps = {
3
+ 'block': Value;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ "update:block": (value: {
7
+ readonly type: "com.shwfed.block.chart.line";
8
+ readonly id: string;
9
+ readonly caption?: readonly [{
10
+ readonly locale: "zh";
11
+ readonly message: string;
12
+ }, ...{
13
+ readonly locale: "en" | "ja" | "ko";
14
+ readonly message: string;
15
+ }[]] | undefined;
16
+ readonly x: string;
17
+ readonly y: readonly {
18
+ readonly label?: readonly [{
19
+ readonly locale: "zh";
20
+ readonly message: string;
21
+ }, ...{
22
+ readonly locale: "en" | "ja" | "ko";
23
+ readonly message: string;
24
+ }[]] | undefined;
25
+ readonly id: string;
26
+ readonly color?: string | undefined;
27
+ readonly value: string;
28
+ }[];
29
+ readonly displayName?: string | undefined;
30
+ readonly compatibilityDate: "2026-05-17";
31
+ readonly dataSources: readonly {
32
+ readonly name: string;
33
+ readonly data: string;
34
+ readonly id: string;
35
+ readonly request?: string | undefined;
36
+ }[];
37
+ readonly curveType: "linear" | "step" | "monotoneX" | "natural" | "basis" | "cardinal" | "catmullRom" | "stepAfter" | "stepBefore";
38
+ readonly lineWidth: number;
39
+ }) => any;
40
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
41
+ "onUpdate:block"?: ((value: {
42
+ readonly type: "com.shwfed.block.chart.line";
43
+ readonly id: string;
44
+ readonly caption?: readonly [{
45
+ readonly locale: "zh";
46
+ readonly message: string;
47
+ }, ...{
48
+ readonly locale: "en" | "ja" | "ko";
49
+ readonly message: string;
50
+ }[]] | undefined;
51
+ readonly x: string;
52
+ readonly y: readonly {
53
+ readonly label?: readonly [{
54
+ readonly locale: "zh";
55
+ readonly message: string;
56
+ }, ...{
57
+ readonly locale: "en" | "ja" | "ko";
58
+ readonly message: string;
59
+ }[]] | undefined;
60
+ readonly id: string;
61
+ readonly color?: string | undefined;
62
+ readonly value: string;
63
+ }[];
64
+ readonly displayName?: string | undefined;
65
+ readonly compatibilityDate: "2026-05-17";
66
+ readonly dataSources: readonly {
67
+ readonly name: string;
68
+ readonly data: string;
69
+ readonly id: string;
70
+ readonly request?: string | undefined;
71
+ }[];
72
+ readonly curveType: "linear" | "step" | "monotoneX" | "natural" | "basis" | "cardinal" | "catmullRom" | "stepAfter" | "stepBefore";
73
+ readonly lineWidth: number;
74
+ }) => any) | undefined;
75
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
76
+ declare const _default: typeof __VLS_export;
77
+ export default _default;
@@ -0,0 +1,134 @@
1
+ import { Schema } from 'effect';
2
+ import type { Environment } from '../../../../../vendor/cel-js/lib/index.js';
3
+ export { getStructFieldDescription, getStructFieldTitle } from '../../../../table/utils/schema-meta.js';
4
+ type AnySchema = Schema.Schema<any, any, never>;
5
+ type Configure = (env: Environment) => void;
6
+ export declare const type: "com.shwfed.block.chart.line";
7
+ export declare const compatibilityDate: "2026-05-17";
8
+ export declare const metadata: {
9
+ readonly name: "折线图";
10
+ readonly icon: "fluent:data-line-20-regular";
11
+ readonly w: {
12
+ readonly initial: 20;
13
+ readonly min: 8;
14
+ readonly max: number;
15
+ };
16
+ readonly h: {
17
+ readonly initial: 9;
18
+ readonly min: 5;
19
+ readonly max: number;
20
+ };
21
+ };
22
+ export declare const CurveType: Schema.Literal<["linear", "monotoneX", "natural", "basis", "cardinal", "catmullRom", "step", "stepAfter", "stepBefore"]>;
23
+ /**
24
+ * A named data source. Exported so the config editor can read field
25
+ * `title` / `description` annotations without rebuilding the whole schema.
26
+ */
27
+ export declare function dataSourceSchema(configure: Configure): Schema.Struct<{
28
+ id: Schema.refine<string, typeof Schema.String>;
29
+ name: Schema.refine<string, typeof Schema.String>;
30
+ request: Schema.optional<Schema.Schema<string, string, never>>;
31
+ data: Schema.Schema<string, string, never>;
32
+ }>;
33
+ /**
34
+ * One Y series. Exported so the config editor can read field
35
+ * `title` / `description` annotations off it.
36
+ */
37
+ export declare function ySeriesSchema(configure: Configure): Schema.Struct<{
38
+ id: Schema.refine<string, typeof Schema.String>;
39
+ value: Schema.Schema<string, string, never>;
40
+ label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
41
+ locale: Schema.Literal<["zh"]>;
42
+ message: Schema.SchemaClass<string, string, never>;
43
+ }>], [Schema.Struct<{
44
+ locale: Schema.Literal<["ja", "en", "ko"]>;
45
+ message: Schema.SchemaClass<string, string, never>;
46
+ }>]>>;
47
+ color: Schema.optional<typeof Schema.String>;
48
+ }>;
49
+ export declare function schema(configure: Configure, _blockRef?: AnySchema): Schema.refine<{
50
+ readonly type: "com.shwfed.block.chart.line";
51
+ readonly id: string;
52
+ readonly caption?: readonly [{
53
+ readonly locale: "zh";
54
+ readonly message: string;
55
+ }, ...{
56
+ readonly locale: "en" | "ja" | "ko";
57
+ readonly message: string;
58
+ }[]] | undefined;
59
+ readonly x: string;
60
+ readonly y: readonly {
61
+ readonly label?: readonly [{
62
+ readonly locale: "zh";
63
+ readonly message: string;
64
+ }, ...{
65
+ readonly locale: "en" | "ja" | "ko";
66
+ readonly message: string;
67
+ }[]] | undefined;
68
+ readonly id: string;
69
+ readonly color?: string | undefined;
70
+ readonly value: string;
71
+ }[];
72
+ readonly displayName?: string | undefined;
73
+ readonly compatibilityDate: "2026-05-17";
74
+ readonly dataSources: readonly {
75
+ readonly name: string;
76
+ readonly data: string;
77
+ readonly id: string;
78
+ readonly request?: string | undefined;
79
+ }[];
80
+ readonly curveType: "linear" | "step" | "monotoneX" | "natural" | "basis" | "cardinal" | "catmullRom" | "stepAfter" | "stepBefore";
81
+ readonly lineWidth: number;
82
+ }, Schema.Struct<{
83
+ id: Schema.refine<string, typeof Schema.String>;
84
+ type: Schema.tag<"com.shwfed.block.chart.line">;
85
+ compatibilityDate: Schema.tag<"2026-05-17">;
86
+ displayName: Schema.optional<Schema.SchemaClass<string, string, never>>;
87
+ caption: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
88
+ locale: Schema.Literal<["zh"]>;
89
+ message: Schema.SchemaClass<string, string, never>;
90
+ }>], [Schema.Struct<{
91
+ locale: Schema.Literal<["ja", "en", "ko"]>;
92
+ message: Schema.SchemaClass<string, string, never>;
93
+ }>]>>;
94
+ dataSources: Schema.Array$<Schema.Struct<{
95
+ id: Schema.refine<string, typeof Schema.String>;
96
+ name: Schema.refine<string, typeof Schema.String>;
97
+ request: Schema.optional<Schema.Schema<string, string, never>>;
98
+ data: Schema.Schema<string, string, never>;
99
+ }>>;
100
+ x: Schema.Schema<string, string, never>;
101
+ y: Schema.refine<readonly {
102
+ readonly label?: readonly [{
103
+ readonly locale: "zh";
104
+ readonly message: string;
105
+ }, ...{
106
+ readonly locale: "en" | "ja" | "ko";
107
+ readonly message: string;
108
+ }[]] | undefined;
109
+ readonly id: string;
110
+ readonly color?: string | undefined;
111
+ readonly value: string;
112
+ }[], Schema.Array$<Schema.Struct<{
113
+ id: Schema.refine<string, typeof Schema.String>;
114
+ value: Schema.Schema<string, string, never>;
115
+ label: Schema.optional<Schema.TupleType<readonly [Schema.Struct<{
116
+ locale: Schema.Literal<["zh"]>;
117
+ message: Schema.SchemaClass<string, string, never>;
118
+ }>], [Schema.Struct<{
119
+ locale: Schema.Literal<["ja", "en", "ko"]>;
120
+ message: Schema.SchemaClass<string, string, never>;
121
+ }>]>>;
122
+ color: Schema.optional<typeof Schema.String>;
123
+ }>>>;
124
+ curveType: Schema.optionalWith<Schema.Literal<["linear", "monotoneX", "natural", "basis", "cardinal", "catmullRom", "step", "stepAfter", "stepBefore"]>, {
125
+ default: () => "monotoneX";
126
+ }>;
127
+ lineWidth: Schema.optionalWith<Schema.filter<typeof Schema.Number>, {
128
+ default: () => number;
129
+ }>;
130
+ }>>;
131
+ export declare function defaultBody(): Record<string, unknown>;
132
+ export type Value = Schema.Schema.Type<ReturnType<typeof schema>>;
133
+ export type YSeriesValue = Value['y'][number];
134
+ export type DataSourceValue = Value['dataSources'][number];
@@ -0,0 +1,142 @@
1
+ import { Schema } from "effect";
2
+ import { Expression } from "../../../../../share/expression.js";
3
+ import { Locale } from "../../../../../share/locale.js";
4
+ export { getStructFieldDescription, getStructFieldTitle } from "../../../../table/utils/schema-meta.js";
5
+ export const type = "com.shwfed.block.chart.line";
6
+ export const compatibilityDate = "2026-05-17";
7
+ export const metadata = {
8
+ name: "\u6298\u7EBF\u56FE",
9
+ icon: "fluent:data-line-20-regular",
10
+ w: { initial: 20, min: 8, max: Infinity },
11
+ h: { initial: 9, min: 5, max: Infinity }
12
+ };
13
+ export const CurveType = Schema.Literal(
14
+ "linear",
15
+ "monotoneX",
16
+ "natural",
17
+ "basis",
18
+ "cardinal",
19
+ "catmullRom",
20
+ "step",
21
+ "stepAfter",
22
+ "stepBefore"
23
+ );
24
+ const isListType = (t) => t === "dyn" || t.startsWith("list") || t.startsWith("optional");
25
+ function listExpression(configure) {
26
+ return Expression({
27
+ configure,
28
+ resultType: isListType,
29
+ unlistedVariablesAreDyn: true
30
+ });
31
+ }
32
+ export function dataSourceSchema(configure) {
33
+ const CelRequest = Expression({
34
+ configure: (env) => {
35
+ configure(env);
36
+ },
37
+ resultType: "HttpRequest"
38
+ });
39
+ const CelData = Expression({
40
+ configure: (env) => {
41
+ configure(env);
42
+ env.registerVariable("json", "optional<dyn>", {
43
+ description: "HTTP \u54CD\u5E94\u4F53\uFF08\u5DF2\u89E3\u6790 JSON\uFF09\uFF1B\u672A\u914D\u7F6E request \u65F6\u4E3A none"
44
+ });
45
+ },
46
+ resultType: isListType
47
+ });
48
+ return Schema.Struct({
49
+ id: Schema.UUID.annotations({ description: "\u6570\u636E\u6E90\u552F\u4E00\u6807\u8BC6" }),
50
+ name: Schema.String.pipe(Schema.pattern(/^[a-z_]\w*$/i)).annotations({
51
+ title: "\u53D8\u91CF\u540D",
52
+ description: "\u5728 X / Y \u8868\u8FBE\u5F0F\u4E2D\u5F15\u7528\u8BE5\u6570\u636E\u6E90\u7684 CEL \u6807\u8BC6\u7B26\uFF08\u5B57\u6BCD\u6216\u4E0B\u5212\u7EBF\u5F00\u5934\uFF0C\u4EC5\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\uFF09"
53
+ }),
54
+ request: Schema.optional(CelRequest).annotations({
55
+ title: "\u8BF7\u6C42",
56
+ description: "\u53EF\u9009\u7684 HTTP \u8BF7\u6C42\u8868\u8FBE\u5F0F\uFF1B\u672A\u914D\u7F6E\u65F6\u6570\u636E\u76F4\u63A5\u4ECE `\u6570\u636E` \u8868\u8FBE\u5F0F\u8BFB\u53D6\uFF08\u901A\u5E38\u5F15\u7528\u4E0A\u4E0B\u6587\u53D8\u91CF\uFF09"
57
+ }),
58
+ data: CelData.annotations({
59
+ title: "\u6570\u636E",
60
+ description: "\u8FD4\u56DE\u4E00\u4E2A\u5217\u8868\uFF08`list<dyn>`\uFF09\u7684 CEL \u8868\u8FBE\u5F0F\uFF1B\u914D\u7F6E\u4E86 `\u8BF7\u6C42` \u65F6\u53EF\u901A\u8FC7 `json` \u5F15\u7528\u54CD\u5E94\u4F53\u3002\u7ED3\u679C\u4EE5\u4E0A\u9762\u7684\u53D8\u91CF\u540D\u66B4\u9732\u7ED9 X / Y"
61
+ })
62
+ }).annotations({
63
+ title: "\u6570\u636E\u6E90",
64
+ description: "\u4E00\u4E2A\u547D\u540D\u6570\u636E\u6E90\uFF1B\u5176\u7ED3\u679C\u5217\u8868\u4EE5\u53D8\u91CF\u540D\u63D0\u4F9B\u7ED9 X / Y \u8868\u8FBE\u5F0F"
65
+ });
66
+ }
67
+ export function ySeriesSchema(configure) {
68
+ return Schema.Struct({
69
+ id: Schema.UUID.annotations({ description: "Y \u7CFB\u5217\u552F\u4E00\u6807\u8BC6" }),
70
+ value: listExpression(configure).annotations({
71
+ title: "Y \u8868\u8FBE\u5F0F",
72
+ description: "\u8FD4\u56DE\u4E00\u4E2A\u5217\u8868\u4F5C\u4E3A\u8BE5\u7CFB\u5217\u7684 Y \u503C\uFF0C\u4E0E X \u6309\u4E0B\u6807\u5BF9\u9F50\uFF1B\u53EF\u5F15\u7528\u6570\u636E\u6E90\u53D8\u91CF\uFF0C\u5982 `source1.map(r, r.value)`"
73
+ }),
74
+ label: Schema.optional(Locale).annotations({
75
+ title: "\u6807\u7B7E",
76
+ description: "\u56FE\u4F8B\u4E0E\u63D0\u793A\u6846\u4E2D\u663E\u793A\u7684\u7CFB\u5217\u540D\uFF1B\u7559\u7A7A\u5219\u7528\u8868\u8FBE\u5F0F\u539F\u6587"
77
+ }),
78
+ color: Schema.optional(Schema.String).annotations({
79
+ title: "\u989C\u8272",
80
+ description: "\u7EBF\u6761\u989C\u8272\uFF08CSS \u989C\u8272\u503C\uFF09\uFF1B\u7559\u7A7A\u5219\u6309\u8C03\u8272\u677F\u81EA\u52A8\u53D6\u8272"
81
+ })
82
+ }).annotations({ title: "Y \u7CFB\u5217", description: "\u4E00\u4E2A Y \u7CFB\u5217\u5BF9\u5E94\u4E00\u6761\u6298\u7EBF" });
83
+ }
84
+ export function schema(configure, _blockRef) {
85
+ return Schema.Struct({
86
+ id: Schema.UUID.annotations({ description: "\u5757\u552F\u4E00\u6807\u8BC6" }),
87
+ type: Schema.tag(type),
88
+ compatibilityDate: Schema.tag(compatibilityDate),
89
+ displayName: Schema.optional(Schema.String.annotations({
90
+ title: "\u5185\u90E8\u540D\u79F0",
91
+ description: "\u4EC5\u5728\u7F16\u8F91\u5668\u5185\u53EF\u89C1\u7684\u5757\u540D\uFF0C\u7528\u4E8E\u5728\u4FA7\u8FB9\u680F\u548C\u5E03\u5C40\u7F16\u8F91\u5668\u4E2D\u8BC6\u522B\u5757\uFF1B\u8FD0\u884C\u65F6\u4E0D\u5C55\u793A"
92
+ })),
93
+ caption: Schema.optional(Locale).annotations({
94
+ title: "\u8BF4\u660E\u6587\u5B57",
95
+ description: "\u663E\u793A\u5728\u56FE\u8868\u4E0B\u65B9\u7684\u672C\u5730\u5316\u8BF4\u660E\u6587\u5B57\uFF1B\u7559\u7A7A\u5219\u4E0D\u663E\u793A"
96
+ }),
97
+ dataSources: Schema.Array(dataSourceSchema(configure)).annotations({
98
+ title: "\u6570\u636E\u6E90",
99
+ description: "\u4E00\u4E2A\u6216\u591A\u4E2A\u547D\u540D\u6570\u636E\u6E90\uFF1B\u6BCF\u4E2A\u6570\u636E\u6E90\u7684\u7ED3\u679C\u5217\u8868\u4EE5\u5176\u53D8\u91CF\u540D\u63D0\u4F9B\u7ED9 X / Y \u8868\u8FBE\u5F0F"
100
+ }),
101
+ x: listExpression(configure).annotations({
102
+ title: "X",
103
+ description: '\u8FD4\u56DE\u4E00\u4E2A\u5217\u8868\u4F5C\u4E3A X \u503C\uFF1B\u53EF\u7531 `range` \u751F\u6210\uFF08\u5982 `range(date("2024-01-01"), date("2024-12-01"), "month")`\uFF09\uFF0C\u6216\u5BF9\u6570\u636E\u6E90\u505A `.map`\uFF1B\u5B57\u7B26\u4E32\u5217\u8868\u89C6\u4F5C\u5206\u7C7B\u8F74\uFF0C\u6570\u5B57 / \u65E5\u671F\u5217\u8868\u89C6\u4F5C\u8FDE\u7EED\u8F74'
104
+ }),
105
+ y: Schema.Array(ySeriesSchema(configure)).pipe(Schema.minItems(1)).annotations({
106
+ title: "Y",
107
+ description: "\u6BCF\u4E2A\u7CFB\u5217\u753B\u4E00\u6761\u7EBF\uFF0C\u8FD4\u56DE\u7684\u5217\u8868\u4E0E X \u6309\u4E0B\u6807\u5BF9\u9F50\uFF1B\u81F3\u5C11\u914D\u7F6E\u4E00\u6761"
108
+ }),
109
+ curveType: Schema.optionalWith(CurveType, { default: () => "monotoneX" }).annotations({
110
+ title: "\u66F2\u7EBF\u7C7B\u578B",
111
+ description: "\u6298\u7EBF\u5728\u76F8\u90BB\u6570\u636E\u70B9\u4E4B\u95F4\u7684\u63D2\u503C\u65B9\u5F0F\uFF08\u5BF9\u5E94 unovis `CurveType`\uFF09"
112
+ }),
113
+ lineWidth: Schema.optionalWith(
114
+ Schema.Number.pipe(Schema.positive()),
115
+ { default: () => 2 }
116
+ ).annotations({
117
+ title: "\u7EBF\u5BBD",
118
+ description: "\u6298\u7EBF\u5BBD\u5EA6\uFF08\u50CF\u7D20\uFF09"
119
+ })
120
+ }).pipe(
121
+ Schema.filter((value) => {
122
+ const seen = /* @__PURE__ */ new Set();
123
+ for (const ds of value.dataSources) {
124
+ if (seen.has(ds.name)) return `\u6570\u636E\u6E90\u53D8\u91CF\u540D\u91CD\u590D\uFF1A${ds.name}`;
125
+ seen.add(ds.name);
126
+ }
127
+ return true;
128
+ })
129
+ ).annotations({
130
+ title: "\u6298\u7EBF\u56FE\u5757",
131
+ description: "\u4ECE\u547D\u540D\u6570\u636E\u6E90\u53D6\u6570\uFF0C\u628A X / Y \u5217\u8868\u6E32\u67D3\u4E3A\u6298\u7EBF\u56FE"
132
+ });
133
+ }
134
+ export function defaultBody() {
135
+ return {
136
+ dataSources: [],
137
+ x: "[]",
138
+ y: [{ id: crypto.randomUUID(), value: "[]" }],
139
+ curveType: "monotoneX",
140
+ lineWidth: 2
141
+ };
142
+ }
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed, ref, watch } from "vue";
3
- import { injectCELContext } from "../../plugins/cel/context";
3
+ import { injectCELContext } from "../../utils/cel-context";
4
4
  import SlotRenderer from "../../share/slot-renderer.vue";
5
5
  import ShwfedModal from "../modal.vue";
6
6
  import EditorBody from "./config.vue";
@@ -132,7 +132,9 @@ export function useSlotEditor(slot, options = {}) {
132
132
  }
133
133
  function getBlockLabel(b) {
134
134
  const entry = findBlock(b.type, b.compatibilityDate);
135
- return entry?.metadata.name ?? "\u672A\u547D\u540D\u5757";
135
+ const typeName = entry?.metadata.name ?? "\u672A\u547D\u540D\u5757";
136
+ const displayName = b.displayName;
137
+ return typeof displayName === "string" && displayName.length > 0 ? displayName : typeName;
136
138
  }
137
139
  function findBlockMeta(type, compatibilityDate) {
138
140
  return findBlock(type, compatibilityDate);
@@ -251,8 +253,7 @@ export function useConfigEditor(model, options = {}) {
251
253
  const base = stack.value.map((entry, i) => {
252
254
  if (entry.kind === "layout") return { kind: "layout", label: "\u5E03\u5C40", index: i };
253
255
  const b = topSlotEditor.blocks.value.find((x) => x.id === entry.blockId);
254
- const meta = b ? findBlock(b.type, b.compatibilityDate)?.metadata : void 0;
255
- const baseLabel = meta?.name ?? "\u5757";
256
+ const baseLabel = b ? topSlotEditor.getBlockLabel(b) : "\u5757";
256
257
  const label = i === lastBlockStackIndex ? `${baseLabel}${suffixDecoration}` : baseLabel;
257
258
  return {
258
259
  kind: "block",
@@ -0,0 +1,19 @@
1
+ import { type DerivedMode } from './utils/common.js';
2
+ type DerivedConfig = {
3
+ mode: DerivedMode;
4
+ expression: string;
5
+ };
6
+ type __VLS_Props = {
7
+ /** The field's current `derived` config, or `undefined` when it has none. */
8
+ modelValue?: DerivedConfig;
9
+ /** Constrains the expression's CEL return type — the field's value type. */
10
+ resultType?: string | string[];
11
+ placeholder?: string;
12
+ };
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "update:modelValue": (value: DerivedConfig | undefined) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: DerivedConfig | undefined) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;