@farris/ui-vue 1.3.1 → 1.3.3

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 (259) hide show
  1. package/components/accordion/index.esm.js +103 -99
  2. package/components/accordion/index.umd.cjs +1 -1
  3. package/components/avatar/index.esm.js +301 -351
  4. package/components/avatar/index.umd.cjs +1 -1
  5. package/components/binding-selector/index.esm.js +444 -0
  6. package/components/binding-selector/index.umd.cjs +1 -0
  7. package/components/binding-selector/package.json +8 -0
  8. package/components/border-editor/index.esm.js +5 -3
  9. package/components/border-editor/index.umd.cjs +1 -1
  10. package/components/button-edit/index.esm.js +143 -139
  11. package/components/button-edit/index.umd.cjs +1 -1
  12. package/components/calendar/index.esm.js +407 -396
  13. package/components/calendar/index.umd.cjs +1 -1
  14. package/components/capsule/index.esm.js +266 -255
  15. package/components/capsule/index.umd.cjs +1 -1
  16. package/components/checkbox/index.esm.js +628 -641
  17. package/components/checkbox/index.umd.cjs +1 -1
  18. package/components/color-picker/index.esm.js +379 -374
  19. package/components/color-picker/index.umd.cjs +2 -2
  20. package/components/combo-list/index.esm.js +471 -471
  21. package/components/combo-list/index.umd.cjs +1 -1
  22. package/components/combo-tree/index.esm.js +155 -148
  23. package/components/combo-tree/index.umd.cjs +1 -1
  24. package/components/common/index.esm.js +487 -478
  25. package/components/common/index.umd.cjs +1 -1
  26. package/components/component/index.esm.js +330 -279
  27. package/components/component/index.umd.cjs +1 -1
  28. package/components/condition/index.esm.js +1171 -1277
  29. package/components/condition/index.umd.cjs +1 -1
  30. package/components/content-container/index.esm.js +220 -204
  31. package/components/content-container/index.umd.cjs +1 -1
  32. package/components/data-grid/index.esm.js +4743 -4641
  33. package/components/data-grid/index.umd.cjs +1 -1
  34. package/components/data-view/index.esm.js +2916 -3019
  35. package/components/data-view/index.umd.cjs +1 -1
  36. package/components/date-picker/index.esm.js +2375 -2590
  37. package/components/date-picker/index.umd.cjs +1 -1
  38. package/components/designer-canvas/index.css +1 -1
  39. package/components/designer-canvas/index.esm.js +9518 -1198
  40. package/components/designer-canvas/index.umd.cjs +1 -1
  41. package/components/designer-outline/index.esm.js +2 -1
  42. package/components/designer-outline/index.umd.cjs +1 -1
  43. package/components/drawer/index.esm.js +34 -38
  44. package/components/drawer/index.umd.cjs +1 -1
  45. package/components/dropdown/index.esm.js +149 -138
  46. package/components/dropdown/index.umd.cjs +2 -2
  47. package/components/dynamic-form/index.esm.js +1602 -1740
  48. package/components/dynamic-form/index.umd.cjs +1 -1
  49. package/components/dynamic-resolver/index.esm.js +159 -151
  50. package/components/dynamic-resolver/index.umd.cjs +1 -1
  51. package/components/dynamic-view/index.esm.js +218 -218
  52. package/components/dynamic-view/index.umd.cjs +1 -1
  53. package/components/event-parameter/index.esm.js +311 -0
  54. package/components/event-parameter/index.umd.cjs +1 -0
  55. package/components/event-parameter/package.json +8 -0
  56. package/components/events-editor/index.css +1 -1
  57. package/components/events-editor/index.esm.js +533 -563
  58. package/components/events-editor/index.umd.cjs +1 -1
  59. package/components/expression-editor/index.esm.js +95 -91
  60. package/components/expression-editor/index.umd.cjs +1 -1
  61. package/components/external-container/index.esm.js +2356 -2455
  62. package/components/external-container/index.umd.cjs +1 -1
  63. package/components/field-selector/index.esm.js +3048 -3308
  64. package/components/field-selector/index.umd.cjs +1 -1
  65. package/components/filter-bar/index.css +1 -1
  66. package/components/filter-bar/index.esm.js +10537 -3249
  67. package/components/filter-bar/index.umd.cjs +1 -1
  68. package/components/flow-canvas/index.css +1 -1
  69. package/components/flow-canvas/index.esm.js +9781 -1327
  70. package/components/flow-canvas/index.umd.cjs +1 -1
  71. package/components/image-cropper/index.esm.js +353 -341
  72. package/components/image-cropper/index.umd.cjs +1 -1
  73. package/components/input-group/index.esm.js +510 -827
  74. package/components/input-group/index.umd.cjs +1 -1
  75. package/components/layout/index.esm.js +278 -268
  76. package/components/layout/index.umd.cjs +1 -1
  77. package/components/list-nav/index.esm.js +144 -136
  78. package/components/list-nav/index.umd.cjs +1 -1
  79. package/components/list-view/index.esm.js +2139 -2237
  80. package/components/list-view/index.umd.cjs +1 -1
  81. package/components/lookup/index.esm.js +6414 -6367
  82. package/components/lookup/index.umd.cjs +1 -1
  83. package/components/mapping-editor/index.esm.js +5216 -5114
  84. package/components/mapping-editor/index.umd.cjs +1 -1
  85. package/components/message-box/index.esm.js +252 -252
  86. package/components/message-box/index.umd.cjs +1 -1
  87. package/components/modal/index.esm.js +70 -70
  88. package/components/modal/index.umd.cjs +1 -1
  89. package/components/nav/index.esm.js +486 -984
  90. package/components/nav/index.umd.cjs +3 -3
  91. package/components/number-range/index.esm.js +446 -498
  92. package/components/number-range/index.umd.cjs +1 -1
  93. package/components/number-spinner/index.esm.js +363 -388
  94. package/components/number-spinner/index.umd.cjs +1 -1
  95. package/components/order/index.esm.js +1050 -1308
  96. package/components/order/index.umd.cjs +1 -1
  97. package/components/page-footer/index.esm.js +134 -131
  98. package/components/page-footer/index.umd.cjs +1 -1
  99. package/components/page-header/index.esm.js +1072 -1082
  100. package/components/page-header/index.umd.cjs +1 -1
  101. package/components/pagination/index.esm.js +412 -910
  102. package/components/pagination/index.umd.cjs +1 -1
  103. package/components/progress/index.esm.js +214 -203
  104. package/components/progress/index.umd.cjs +3 -3
  105. package/components/property-editor/index.esm.js +1361 -1536
  106. package/components/property-editor/index.umd.cjs +2 -2
  107. package/components/property-panel/index.esm.js +650 -677
  108. package/components/property-panel/index.umd.cjs +1 -1
  109. package/components/query-solution/index.css +1 -1
  110. package/components/query-solution/index.esm.js +12344 -5048
  111. package/components/query-solution/index.umd.cjs +6 -1
  112. package/components/radio-button/index.esm.js +97 -97
  113. package/components/radio-button/index.umd.cjs +1 -1
  114. package/components/radio-group/index.css +1 -1
  115. package/components/radio-group/index.esm.js +1821 -565
  116. package/components/radio-group/index.umd.cjs +1 -1
  117. package/components/rate/index.esm.js +251 -244
  118. package/components/rate/index.umd.cjs +1 -1
  119. package/components/response-layout/index.esm.js +151 -140
  120. package/components/response-layout/index.umd.cjs +1 -1
  121. package/components/response-layout-editor/index.esm.js +707 -676
  122. package/components/response-layout-editor/index.umd.cjs +1 -1
  123. package/components/response-toolbar/index.esm.js +719 -740
  124. package/components/response-toolbar/index.umd.cjs +1 -1
  125. package/components/schema-selector/index.esm.js +4977 -5249
  126. package/components/schema-selector/index.umd.cjs +2 -2
  127. package/components/search-box/index.esm.js +145 -134
  128. package/components/search-box/index.umd.cjs +1 -1
  129. package/components/section/index.esm.js +348 -337
  130. package/components/section/index.umd.cjs +1 -1
  131. package/components/smoke-detector/index.esm.js +141 -130
  132. package/components/smoke-detector/index.umd.cjs +1 -1
  133. package/components/splitter/index.esm.js +311 -301
  134. package/components/splitter/index.umd.cjs +1 -1
  135. package/components/step/index.esm.js +231 -220
  136. package/components/step/index.umd.cjs +1 -1
  137. package/components/switch/index.esm.js +385 -432
  138. package/components/switch/index.umd.cjs +1 -1
  139. package/components/tabs/index.esm.js +1932 -1914
  140. package/components/tabs/index.umd.cjs +1 -1
  141. package/components/tags/index.esm.js +351 -340
  142. package/components/tags/index.umd.cjs +1 -1
  143. package/components/text/index.esm.js +209 -199
  144. package/components/text/index.umd.cjs +1 -1
  145. package/components/textarea/index.esm.js +388 -415
  146. package/components/textarea/index.umd.cjs +1 -1
  147. package/components/time-picker/index.esm.js +619 -666
  148. package/components/time-picker/index.umd.cjs +1 -1
  149. package/components/transfer/index.esm.js +493 -486
  150. package/components/transfer/index.umd.cjs +1 -1
  151. package/components/tree-grid/index.esm.js +3169 -3278
  152. package/components/tree-grid/index.umd.cjs +1 -1
  153. package/components/tree-view/index.esm.js +2320 -2418
  154. package/components/tree-view/index.umd.cjs +1 -1
  155. package/components/uploader/index.esm.js +563 -554
  156. package/components/uploader/index.umd.cjs +2 -2
  157. package/components/verify-detail/index.esm.js +287 -276
  158. package/components/verify-detail/index.umd.cjs +1 -1
  159. package/components/video/index.esm.js +368 -324
  160. package/components/video/index.umd.cjs +1 -1
  161. package/components/weather/index.esm.js +498 -487
  162. package/components/weather/index.umd.cjs +5 -5
  163. package/farris.all.esm.js +51302 -47651
  164. package/farris.all.umd.cjs +14 -9
  165. package/index.css +1 -1
  166. package/package.json +1 -1
  167. package/types/binding-selector/index.d.ts +55 -0
  168. package/types/binding-selector/src/binding-selector.component.d.ts +11 -0
  169. package/types/binding-selector/src/binding-selector.props.d.ts +52 -0
  170. package/types/binding-selector/src/components/binding-selector-container.component.d.ts +13 -0
  171. package/types/binding-selector/src/composition/use-field-selection.d.ts +9 -0
  172. package/types/combo-list/src/components/list-container.component.d.ts +6 -6
  173. package/types/combo-list/src/components/list-container.props.d.ts +1 -1
  174. package/types/combo-tree/src/components/tree-container.component.d.ts +5 -5
  175. package/types/common/entity/entity-schema.d.ts +26 -11
  176. package/types/common/index.d.ts +1 -0
  177. package/types/common/types.d.ts +2 -2
  178. package/types/condition/src/condition-fields.design.component.d.ts +18 -0
  179. package/types/condition/src/types.d.ts +6 -6
  180. package/types/data-grid/src/composition/data-grid-component-creator.service.d.ts +20 -0
  181. package/types/data-grid/src/{designer/data-grid-column.props.d.ts → data-grid-column.props.d.ts} +1 -1
  182. package/types/data-grid/src/data-grid.props.d.ts +2 -2
  183. package/types/data-grid/src/designer/grid-field-editor.component.d.ts +14 -14
  184. package/types/data-grid/src/schema/schema-resolver.d.ts +1 -1
  185. package/types/data-view/composition/types.d.ts +2 -2
  186. package/types/date-picker/src/components/calendar/calendar.component.d.ts +3 -3
  187. package/types/date-picker/src/components/month/month.component.d.ts +3 -3
  188. package/types/date-picker/src/components/year/year.component.d.ts +3 -3
  189. package/types/designer-canvas/index.d.ts +2 -1
  190. package/types/designer-canvas/src/composition/dg-control.d.ts +5 -0
  191. package/types/designer-canvas/src/composition/function/drag-resolve.d.ts +5 -0
  192. package/types/designer-canvas/src/composition/types.d.ts +49 -40
  193. package/types/designer-canvas/src/types.d.ts +8 -20
  194. package/types/dynamic-form/index.d.ts +1 -1
  195. package/types/dynamic-form/src/designer/form-group-use-designer-rules.d.ts +3 -0
  196. package/types/dynamic-form/src/schema/{schema-resolver.d.ts → response-form-schema-resolver.d.ts} +1 -1
  197. package/types/dynamic-form/src/types.d.ts +1 -1
  198. package/types/dynamic-resolver/src/common/toolbar-resolver.d.ts +5 -0
  199. package/types/dynamic-resolver/src/converter/row-number.converter.d.ts +3 -0
  200. package/types/entity-binding-selector/composition/use-entity-tree.d.ts +7 -0
  201. package/types/entity-binding-selector/entity-binding-selector.component.d.ts +11 -0
  202. package/types/entity-binding-selector/entity-binding-selector.props.d.ts +3 -0
  203. package/types/enum-editor/src/components/enum-editor-container.component.d.ts +3 -3
  204. package/types/enum-editor/src/enum-editor.component.d.ts +3 -3
  205. package/types/event-parameter/index.d.ts +31 -0
  206. package/types/event-parameter/src/composition/type.d.ts +77 -0
  207. package/types/event-parameter/src/composition/use-editor-combotree.d.ts +3 -0
  208. package/types/event-parameter/src/composition/use-editor-input.d.ts +3 -0
  209. package/types/event-parameter/src/composition/use-editor-select.d.ts +3 -0
  210. package/types/event-parameter/src/composition/use-editor-switch.d.ts +3 -0
  211. package/types/event-parameter/src/composition/use-editor.d.ts +3 -0
  212. package/types/event-parameter/src/event-parameter.component.d.ts +8 -0
  213. package/types/event-parameter/src/event-parameter.props.d.ts +34 -0
  214. package/types/external-container/src/designer/import-external-schema.component.d.ts +1 -1
  215. package/types/field-selector/src/field-selector.component.d.ts +1 -2
  216. package/types/field-selector/src/field-selector.props.d.ts +0 -9
  217. package/types/input-group/src/designer/use-input-group-rules.d.ts +1 -2
  218. package/types/list-view/src/designer/list-view-table.design.component.d.ts +15 -0
  219. package/types/list-view/src/list-view-table.component.d.ts +15 -0
  220. package/types/lookup/src/composition/use-user-data.d.ts +2 -2
  221. package/types/lookup/src/property-config/lookup.property-config.d.ts +2 -6
  222. package/types/modal/src/composition/modal.service.d.ts +2 -1
  223. package/types/page-header/src/designer/page-header.design.component.d.ts +1 -1
  224. package/types/page-header/src/page-header.component.d.ts +1 -1
  225. package/types/property-panel/index.d.ts +2 -1
  226. package/types/property-panel/src/composition/entity/property-entity.d.ts +1 -1
  227. package/types/property-panel/src/composition/type.d.ts +0 -13
  228. package/types/query-solution/src/composition/types.d.ts +35 -4
  229. package/types/query-solution/src/composition/use-header.d.ts +21 -0
  230. package/types/query-solution/src/composition/{use-filter.d.ts → use-http.d.ts} +2 -2
  231. package/types/query-solution/src/composition/use-solution.d.ts +20 -0
  232. package/types/query-solution/src/designer/query-solution-config/composition/types.d.ts +17 -16
  233. package/types/query-solution/src/designer/query-solution-config/query-solution-config.props.d.ts +14 -14
  234. package/types/query-solution/src/property-config/query-solution.property-config.d.ts +3 -51
  235. package/types/query-solution/src/query-solution.d.ts +10 -2
  236. package/types/radio-group/src/designer/item-collection-editor-inner.component.d.ts +29 -0
  237. package/types/radio-group/src/designer/item-collection-editor.component.d.ts +29 -0
  238. package/types/radio-group/src/designer/item-collection-editor.props.d.ts +21 -0
  239. package/types/radio-group/src/schema/schema-mapper.d.ts +1 -0
  240. package/types/radio-group/src/schema/schema-resolver.d.ts +1 -0
  241. package/types/response-toolbar/src/property-config/response-toolbar.property-config.d.ts +1 -0
  242. package/types/section/src/property-config/section.property-config.d.ts +17 -17
  243. package/types/section/src/schema/schema-resolver.d.ts +1 -2
  244. package/types/section/src/schema/toolbar-resolver.d.ts +1 -1
  245. package/types/tabs/src/composition/types.d.ts +4 -1
  246. package/types/tabs/src/property-config/tab-page.property-config.d.ts +9 -59
  247. package/types/tabs/src/property-config/tabs.property-config.d.ts +8 -71
  248. package/types/tabs/src/schema/schema-resolver.d.ts +1 -2
  249. package/types/text/src/composition/types.d.ts +4 -4
  250. package/types/textarea/src/property-config/textarea.property-config.d.ts +23 -0
  251. package/types/weather/src/composition/use-weather-charts.d.ts +15 -0
  252. package/types/weather/src/composition/use-weather-color.d.ts +15 -0
  253. package/types/weather/src/composition/use-weather-data.d.ts +15 -0
  254. package/types/weather/src/composition/use-weather-format-number.d.ts +15 -0
  255. package/types/property-panel/src/composition/entity/use-input-rules.d.ts +0 -3
  256. package/types/tree-grid/src/schema/column-resolver.d.ts +0 -3
  257. package/types/weather/src/composition/types.d.ts +0 -2
  258. /package/types/dynamic-form/src/designer/{use-designer-rules.d.ts → response-form-use-designer-rules.d.ts} +0 -0
  259. /package/types/dynamic-form/src/property-config/{form.property-config.d.ts → response-form.property-config.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { defineComponent as N, ref as m, watch as D, computed as V, onMounted as P, createVNode as M, nextTick as T, inject as Q } from "vue";
1
+ import { defineComponent as F, ref as m, watch as P, computed as S, onMounted as T, createVNode as w, nextTick as k, inject as Q } from "vue";
2
2
  import { isPlainObject as L, cloneDeep as U } from "lodash-es";
3
3
  import { withInstall as X } from "../common/index.esm.js";
4
4
  const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-design.gitee.io/capsule.schema.json", I = "capsule", K = "A Farris Component", x = "object", ee = {
@@ -75,114 +75,118 @@ const Y = "https://json-schema.org/draft/2020-12/schema", Z = "https://farris-de
75
75
  properties: ee,
76
76
  required: te
77
77
  }, q = {}, _ = {};
78
- function F(n) {
79
- const { properties: e, title: r, ignore: a } = n, s = a && Array.isArray(a), o = Object.keys(e).reduce((p, h) => ((!s || !a.find((O) => O == h)) && (p[h] = e[h].type === "object" && e[h].properties ? F(e[h]) : U(e[h].default)), p), {});
80
- return r && (!s || !a.find((p) => p == "id")) && (o.id = `${r}-${Date.now()}`), o;
78
+ function C(t) {
79
+ const { properties: e, title: r, ignore: l } = t, s = l && Array.isArray(l), o = Object.keys(e).reduce((i, h) => ((!s || !l.find((A) => A === h)) && (i[h] = e[h].type === "object" && e[h].properties ? C(e[h]) : U(e[h].default)), i), {});
80
+ if (r && (!s || !l.find((i) => i === "id"))) {
81
+ const i = r.toLowerCase().replace(/-/g, "_");
82
+ o.id = `${i}_${Math.random().toString().slice(2, 6)}`;
83
+ }
84
+ return o;
81
85
  }
82
- function z(n, e = {}, r) {
83
- const a = q[n];
84
- if (a) {
85
- let s = F(a);
86
- const o = _[n];
87
- return s = o ? o({ getSchemaByType: z }, s, e, r) : s, s;
86
+ function H(t, e = {}, r) {
87
+ const l = q[t];
88
+ if (l) {
89
+ let s = C(l);
90
+ const o = _[t];
91
+ return s = o ? o({ getSchemaByType: H }, s, e, r) : s, s;
88
92
  }
89
93
  return null;
90
94
  }
91
- function ae(n, e) {
92
- const r = F(e);
93
- return Object.keys(n).reduce((a, s) => (a[s] && L(a[s]) && L(n[s]) ? Object.assign(a[s], n[s]) : a[s] = n[s], a), r), r;
95
+ function ae(t, e) {
96
+ const r = C(e);
97
+ return Object.keys(r).reduce((l, s) => (l[s] && L(l[s]) && L(t[s] || !t[s]) ? Object.assign(l[s], t[s] || {}) : l[s] = t[s], l), r), r;
94
98
  }
95
- function le(n, e) {
96
- return Object.keys(n).filter((a) => n[a] != null).reduce((a, s) => {
99
+ function le(t, e) {
100
+ return Object.keys(t).filter((l) => t[l] != null).reduce((l, s) => {
97
101
  if (e.has(s)) {
98
102
  const o = e.get(s);
99
103
  if (typeof o == "string")
100
- a[o] = n[s];
104
+ l[o] = t[s];
101
105
  else {
102
- const p = o(s, n[s], n);
103
- Object.assign(a, p);
106
+ const i = o(s, t[s], t);
107
+ Object.assign(l, i);
104
108
  }
105
109
  } else
106
- a[s] = n[s];
107
- return a;
110
+ l[s] = t[s];
111
+ return l;
108
112
  }, {});
109
113
  }
110
- function se(n, e, r = /* @__PURE__ */ new Map()) {
111
- const a = ae(n, e);
112
- return le(a, r);
114
+ function se(t, e, r = /* @__PURE__ */ new Map()) {
115
+ const l = ae(t, e);
116
+ return le(l, r);
113
117
  }
114
- function ce(n = {}) {
115
- function e(c, f, i, d) {
116
- if (typeof i == "number")
117
- return d[c].length === i;
118
- if (typeof i == "object") {
119
- const y = Object.keys(i)[0], g = i[y];
118
+ function ce(t = {}) {
119
+ function e(c, p, f, v) {
120
+ if (typeof f == "number")
121
+ return v[c].length === f;
122
+ if (typeof f == "object") {
123
+ const y = Object.keys(f)[0], b = f[y];
120
124
  if (y === "not")
121
- return Number(d[c].length) !== Number(g);
125
+ return Number(v[c].length) !== Number(b);
122
126
  if (y === "moreThan")
123
- return Number(d[c].length) >= Number(g);
127
+ return Number(v[c].length) >= Number(b);
124
128
  if (y === "lessThan")
125
- return Number(d[c].length) <= Number(g);
129
+ return Number(v[c].length) <= Number(b);
126
130
  }
127
131
  return !1;
128
132
  }
129
- function r(c, f, i, d) {
130
- return d[c] && d[c].propertyValue && String(d[c].propertyValue.value) === String(i);
133
+ function r(c, p, f, v) {
134
+ return v[c] && v[c].propertyValue && String(v[c].propertyValue.value) === String(f);
131
135
  }
132
- const a = /* @__PURE__ */ new Map([
136
+ const l = /* @__PURE__ */ new Map([
133
137
  ["length", e],
134
138
  ["getProperty", r]
135
139
  ]);
136
- Object.keys(n).reduce((c, f) => (c.set(f, n[f]), c), a);
137
- function s(c, f) {
138
- const i = c;
139
- return typeof f == "number" ? [{ target: i, operator: "length", param: null, value: Number(f) }] : typeof f == "boolean" ? [{ target: i, operator: "getProperty", param: c, value: !!f }] : typeof f == "object" ? Object.keys(f).map((d) => {
140
- if (d === "length")
141
- return { target: i, operator: "length", param: null, value: f[d] };
142
- const y = d, g = f[d];
143
- return { target: i, operator: "getProperty", param: y, value: g };
140
+ Object.keys(t).reduce((c, p) => (c.set(p, t[p]), c), l);
141
+ function s(c, p) {
142
+ const f = c;
143
+ return typeof p == "number" ? [{ target: f, operator: "length", param: null, value: Number(p) }] : typeof p == "boolean" ? [{ target: f, operator: "getProperty", param: c, value: !!p }] : typeof p == "object" ? Object.keys(p).map((v) => {
144
+ if (v === "length")
145
+ return { target: f, operator: "length", param: null, value: p[v] };
146
+ const y = v, b = p[v];
147
+ return { target: f, operator: "getProperty", param: y, value: b };
144
148
  }) : [];
145
149
  }
146
150
  function o(c) {
147
- return Object.keys(c).reduce((i, d) => {
148
- const y = s(d, c[d]);
149
- return i.push(...y), i;
151
+ return Object.keys(c).reduce((f, v) => {
152
+ const y = s(v, c[v]);
153
+ return f.push(...y), f;
150
154
  }, []);
151
155
  }
152
- function p(c, f) {
153
- if (a.has(c.operator)) {
154
- const i = a.get(c.operator);
155
- return i && i(c.target, c.param, c.value, f) || !1;
156
+ function i(c, p) {
157
+ if (l.has(c.operator)) {
158
+ const f = l.get(c.operator);
159
+ return f && f(c.target, c.param, c.value, p) || !1;
156
160
  }
157
161
  return !1;
158
162
  }
159
- function h(c, f) {
160
- return o(c).reduce((y, g) => y && p(g, f), !0);
163
+ function h(c, p) {
164
+ return o(c).reduce((y, b) => y && i(b, p), !0);
161
165
  }
162
- function O(c, f) {
163
- const i = Object.keys(c), d = i.includes("allOf"), y = i.includes("anyOf"), g = d || y, S = (g ? c[g ? d ? "allOf" : "anyOf" : "allOf"] : [c]).map((E) => h(E, f));
164
- return d ? !S.includes(!1) : S.includes(!0);
166
+ function A(c, p) {
167
+ const f = Object.keys(c), v = f.includes("allOf"), y = f.includes("anyOf"), b = v || y, $ = (b ? c[b ? v ? "allOf" : "anyOf" : "allOf"] : [c]).map((B) => h(B, p));
168
+ return v ? !$.includes(!1) : $.includes(!0);
165
169
  }
166
- return { parseValueSchema: O };
170
+ return { parseValueSchema: A };
167
171
  }
168
172
  const ue = {}, re = {};
169
173
  ce();
170
- function oe(n, e, r = /* @__PURE__ */ new Map(), a = (p, h, O) => h, s = {}, o = (p) => p) {
171
- return q[e.title] = e, _[e.title] = a, ue[e.title] = s, re[e.title] = o, (p = {}) => {
172
- const h = se(p, e, r), O = Object.keys(n).reduce((c, f) => (c[f] = n[f].default, c), {});
173
- return Object.assign(O, h);
174
+ function oe(t, e, r = /* @__PURE__ */ new Map(), l = (i, h, A, c) => h, s = {}, o = (i) => i) {
175
+ return q[e.title] = e, _[e.title] = l, ue[e.title] = s, re[e.title] = o, (i = {}) => {
176
+ const h = se(i, e, r), A = Object.keys(t).reduce((c, p) => (c[p] = t[p].default, c), {});
177
+ return Object.assign(A, h);
174
178
  };
175
179
  }
176
- function ie(n, e) {
180
+ function ie(t, e) {
177
181
  return { customClass: e.class, customStyle: e.style };
178
182
  }
179
183
  const pe = /* @__PURE__ */ new Map([
180
184
  ["appearance", ie]
181
185
  ]);
182
- function fe(n, e, r) {
186
+ function fe(t, e, r) {
183
187
  return e;
184
188
  }
185
- const de = "capsule", ve = "A Farris Component", me = "object", ye = {
189
+ const ve = "capsule", de = "A Farris Component", me = "object", ye = {
186
190
  basic: {
187
191
  description: "Basic Infomation",
188
192
  title: "基本信息",
@@ -205,8 +209,8 @@ const de = "capsule", ve = "A Farris Component", me = "object", ye = {
205
209
  }
206
210
  }
207
211
  }, he = {
208
- title: de,
209
- description: ve,
212
+ title: ve,
213
+ description: de,
210
214
  type: me,
211
215
  categories: ye
212
216
  }, W = {
@@ -222,7 +226,7 @@ const de = "capsule", ve = "A Farris Component", me = "object", ye = {
222
226
  */
223
227
  modelValue: { type: String, default: "" },
224
228
  type: { type: String, default: "primary" }
225
- }, ge = {
229
+ }, be = {
226
230
  name: { type: String, default: "" },
227
231
  value: { type: String, default: "" },
228
232
  isActive: { type: Boolean, default: !1 },
@@ -230,284 +234,291 @@ const de = "capsule", ve = "A Farris Component", me = "object", ye = {
230
234
  index: { type: Number, default: 0 },
231
235
  show: { type: Boolean, default: !0 },
232
236
  disabled: { type: Boolean, default: !1 }
233
- }, G = oe(W, ne, pe, fe, he), H = /* @__PURE__ */ N({
237
+ }, z = oe(W, ne, pe, fe, he), G = /* @__PURE__ */ F({
234
238
  name: "FCapsuleItem",
235
- props: ge,
239
+ props: be,
236
240
  emits: ["mounted", "active"],
237
- setup(n, e) {
238
- const r = m(), a = m(n.isActive);
239
- D(() => n.isActive, (p) => {
240
- a.value = p;
241
+ setup(t, e) {
242
+ const r = m(), l = m(t.isActive);
243
+ P(() => t.isActive, (i) => {
244
+ l.value = i;
241
245
  });
242
- const s = V(() => ({
246
+ const s = S(() => ({
243
247
  "f-capsule-item": !0,
244
- "f-capsule-active-item": a.value,
245
- "f-capsule-disabled": n.disabled
248
+ "f-capsule-active-item": l.value,
249
+ "f-capsule-disabled": t.disabled
246
250
  }));
247
- P(() => {
248
- e.emit("mounted", r, n.value);
251
+ T(() => {
252
+ e.emit("mounted", r, t.value);
249
253
  });
250
- function o(p) {
251
- n.disabled || e.emit("active", p, {
252
- name: n.name,
253
- value: n.value
254
+ function o(i) {
255
+ t.disabled || e.emit("active", i, {
256
+ name: t.name,
257
+ value: t.value
254
258
  });
255
259
  }
256
- return () => M("div", {
260
+ return () => w("div", {
257
261
  ref: r,
258
262
  class: s.value,
259
- onClick: (p) => o(p)
260
- }, [n.icon && M("i", {
261
- class: n.icon
262
- }, null), n.name]);
263
+ onClick: (i) => o(i)
264
+ }, [t.icon && w("i", {
265
+ class: t.icon
266
+ }, null), t.name]);
263
267
  }
264
- }), k = /* @__PURE__ */ N({
268
+ }), N = /* @__PURE__ */ F({
265
269
  name: "FCapsule",
266
270
  props: W,
267
271
  emits: ["change", "update:modelValue"],
268
- setup(n, e) {
269
- const r = m(n.items), a = m(), s = 2, o = m(n.modelValue), p = m("none"), h = m(n.type), O = V(() => {
270
- const l = {
272
+ setup(t, e) {
273
+ const r = m(t.items), l = m(), s = 2, o = m(t.modelValue), i = m("none"), h = m(t.type), A = S(() => {
274
+ const a = {
271
275
  "f-capsule-container": !0
272
276
  };
273
- return h.value && (l[h.value] = !0), l;
274
- }), c = V(() => ({})), f = V(() => ({
277
+ return h.value && (a[h.value] = !0), a;
278
+ }), c = S(() => ({})), p = S(() => ({
275
279
  "f-capsule": !0
276
- })), i = m(s), d = m(0), y = m(0), g = V(() => ({
277
- left: `${i.value}px`,
278
- width: `${d.value}px`,
279
- transition: p.value
280
- })), B = V(() => ({
280
+ })), f = m(s), v = m(0), y = m(0), b = S(() => ({
281
+ left: `${f.value}px`,
282
+ width: `${v.value}px`,
283
+ transition: i.value
284
+ })), V = S(() => ({
281
285
  width: `${y.value}px`
282
- })), A = /* @__PURE__ */ new Map();
283
- function S(l) {
284
- var t;
285
- if (A.has(l.value)) {
286
- const u = (t = A.get(l.value)) == null ? void 0 : t.value;
286
+ })), M = /* @__PURE__ */ new Map();
287
+ function $(a) {
288
+ var n;
289
+ if (M.has(a.value)) {
290
+ const u = (n = M.get(a.value)) == null ? void 0 : n.value;
287
291
  if (u) {
288
- const b = u.getBoundingClientRect(), $ = a.value.getBoundingClientRect();
289
- i.value = b.left - $.left + s + a.value.scrollLeft, d.value = b.width - 2 * s;
292
+ const j = u.getBoundingClientRect(), D = l.value.getBoundingClientRect();
293
+ f.value = j.left - D.left + s + l.value.scrollLeft, v.value = j.width - 2 * s;
290
294
  }
291
295
  }
292
296
  }
293
- function R(l, t) {
294
- const u = l.value;
295
- o.value = u, e.emit("update:modelValue", u), S(l), t && e.emit("change", u);
297
+ function R(a, n) {
298
+ const u = a.value;
299
+ o.value = u, e.emit("update:modelValue", u), $(a), n && e.emit("change", u);
296
300
  }
297
- function E(l) {
298
- const t = r.value.findIndex((u) => u.value === l);
299
- t > -1 && R(r.value[t], !1);
301
+ function B(a) {
302
+ const n = r.value.findIndex((u) => u.value === a);
303
+ n > -1 && R(r.value[n], !1);
300
304
  }
301
- D(() => n.modelValue, (l) => {
302
- o.value = l, E(o.value);
303
- }), D(() => n.items, async (l) => {
304
- const t = l.filter((u) => u.show);
305
- j(t), r.value = t, await T(), E(o.value), y.value = Array.from(A.values()).reduce((u, b) => (u += b.value.clientWidth, u), 0);
306
- }), P(async () => {
307
- E(o.value), await T(), p.value = "0.1s ease-out all", y.value = Array.from(A.values()).reduce((l, t) => (l += t.value.clientWidth, l), 0);
305
+ P(() => t.modelValue, (a) => {
306
+ o.value = a, B(o.value);
307
+ }), T(async () => {
308
+ B(o.value), await k(), i.value = "0.1s ease-out all", y.value = Array.from(M.values()).reduce((a, n) => (a += n.value.clientWidth, a), 0);
308
309
  });
309
- function C(l, t) {
310
- R(t, !0);
310
+ function E(a, n) {
311
+ R(n, !0);
311
312
  }
312
- function v(l, t) {
313
- A.set(t, l);
313
+ function d(a, n) {
314
+ M.set(n, a);
314
315
  }
315
- function j(l) {
316
- Array.from(A.keys()).forEach((t) => {
317
- l.find((b) => b.value === t) || A.delete(t);
316
+ function O(a) {
317
+ Array.from(M.keys()).forEach((n) => {
318
+ a.find((j) => j.value === n) || M.delete(n);
318
319
  });
319
320
  }
320
- function w(l, t) {
321
- return M(H, {
322
- name: l.name,
323
- value: l.value,
324
- isActive: l.value === o.value,
325
- index: t,
326
- disabled: l.disabled,
327
- key: l.value,
328
- onMounted: v,
329
- onActive: C
321
+ function g(a, n) {
322
+ return w(G, {
323
+ name: a.name,
324
+ value: a.value,
325
+ isActive: a.value === o.value,
326
+ index: n,
327
+ disabled: a.disabled,
328
+ key: a.value,
329
+ onMounted: d,
330
+ onActive: E
330
331
  }, null);
331
332
  }
332
- return () => M("span", {
333
- ref: a,
334
- class: O.value,
333
+ return P(() => t.items, async (a) => {
334
+ const n = a.filter((u) => u.show);
335
+ O(n), r.value = n, await k(), B(o.value), y.value = Array.from(M.values()).reduce((u, j) => (u += j.value.clientWidth, u), 0);
336
+ }), () => w("span", {
337
+ ref: l,
338
+ class: A.value,
335
339
  style: c.value
336
- }, [M("span", {
340
+ }, [w("span", {
337
341
  class: "f-capsule-pane"
338
- }, [r.value.map((l, t) => w(l, t))]), M("small", {
339
- class: f.value,
340
- style: g.value
341
- }, null), M("div", {
342
+ }, [r.value.map((a, n) => g(a, n))]), w("small", {
343
+ class: p.value,
344
+ style: b.value
345
+ }, null), w("div", {
342
346
  class: "f-capsule-board",
343
- style: B.value
347
+ style: V.value
344
348
  }, null)]);
345
349
  }
346
350
  });
347
- function be(n, e, r) {
348
- var C;
349
- function a() {
350
- }
351
- const s = "", o = "", p = m();
352
- function h() {
351
+ function ge(t, e, r) {
352
+ var E;
353
+ const l = "", s = "", o = m();
354
+ function i() {
353
355
  return (e == null ? void 0 : e.schema.componentType) !== "frame";
354
356
  }
355
- function O() {
357
+ function h() {
356
358
  return !1;
357
359
  }
358
- function c() {
360
+ function A() {
359
361
  return (e == null ? void 0 : e.schema.componentType) !== "frame";
360
362
  }
361
- function f() {
363
+ function c() {
362
364
  return (e == null ? void 0 : e.schema.componentType) === "frame";
363
365
  }
364
- function i(v) {
365
- if (!v || !v.value)
366
+ function p(d) {
367
+ if (!d || !d.value)
366
368
  return null;
367
- if (v.value.schema && v.value.schema.type === "component")
368
- return v.value;
369
- const j = m(v == null ? void 0 : v.value.parent), w = i(j);
370
- return w || null;
369
+ if (d.value.schema && d.value.schema.type === "component")
370
+ return d.value;
371
+ const O = m(d == null ? void 0 : d.value.parent), g = p(O);
372
+ return g || null;
371
373
  }
372
- function d(v = e) {
373
- const { componentInstance: j, designerItemElementRef: w } = v;
374
- return !j || !j.value ? null : j.value.canMove ? w : d(v.parent);
374
+ function f(d = e) {
375
+ const { componentInstance: O, designerItemElementRef: g } = d;
376
+ return !O || !O.value ? null : O.value.canMove ? g : f(d.parent);
375
377
  }
376
- function y(v) {
378
+ function v(d) {
377
379
  return !!r;
378
380
  }
379
- function g() {
381
+ function y() {
380
382
  return (e == null ? void 0 : e.schema.label) || (e == null ? void 0 : e.schema.title) || (e == null ? void 0 : e.schema.name);
381
383
  }
382
- function B() {
384
+ function b() {
383
385
  }
384
- function A(v, j) {
386
+ function V(d, O) {
385
387
  }
386
- function S(v, j) {
387
- const { componentType: w } = v;
388
- let l = z(w, v, j);
389
- const t = w.toLowerCase().replace("-", "_");
390
- return l && !l.id && l.type === w && (l.id = `${t}_${Math.random().toString().slice(2, 6)}`), l;
388
+ function M(d, O) {
389
+ const { componentType: g } = d;
390
+ let a = H(g, d, O);
391
+ const n = g.toLowerCase().replace(/-/g, "_");
392
+ return a && !a.id && a.type === g && (a.id = `${n}_${Math.random().toString().slice(2, 6)}`), a;
391
393
  }
392
- function R(v) {
394
+ function $(d) {
393
395
  }
394
- function E(...v) {
396
+ function R(...d) {
395
397
  }
396
- return p.value = {
397
- canMove: h(),
398
- canSelectParent: O(),
399
- canDelete: c(),
400
- canNested: !f(),
398
+ function B() {
399
+ e != null && e.schema.contents && e.schema.contents.map((d) => {
400
+ var a;
401
+ let O = d.id;
402
+ d.type === "component-ref" && (O = d.component);
403
+ const g = t.value.querySelector(`#${O}-design-item`);
404
+ (a = g == null ? void 0 : g.componentInstance) != null && a.value.onRemoveComponent && g.componentInstance.value.onRemoveComponent();
405
+ });
406
+ }
407
+ return o.value = {
408
+ canMove: i(),
409
+ canSelectParent: h(),
410
+ canDelete: A(),
411
+ canNested: !c(),
401
412
  contents: e == null ? void 0 : e.schema.contents,
402
- elementRef: n,
403
- parent: (C = e == null ? void 0 : e.parent) == null ? void 0 : C.componentInstance,
413
+ elementRef: t,
414
+ parent: (E = e == null ? void 0 : e.parent) == null ? void 0 : E.componentInstance,
404
415
  schema: e == null ? void 0 : e.schema,
405
- styles: s,
406
- designerClass: o,
407
- canAccepts: y,
408
- getBelongedComponentInstance: i,
409
- getDraggableDesignItemElement: d,
410
- getDraggingDisplayText: g,
411
- getPropConfig: E,
412
- getDragScopeElement: B,
413
- onAcceptMovedChildElement: A,
414
- onChildElementMovedOut: R,
415
- addNewChildComponentSchema: S,
416
- updateDragAndDropRules: a,
416
+ styles: l,
417
+ designerClass: s,
418
+ canAccepts: v,
419
+ getBelongedComponentInstance: p,
420
+ getDraggableDesignItemElement: f,
421
+ getDraggingDisplayText: y,
422
+ getPropConfig: R,
423
+ getDragScopeElement: b,
424
+ onAcceptMovedChildElement: V,
425
+ onChildElementMovedOut: $,
426
+ addNewChildComponentSchema: M,
417
427
  triggerBelongedComponentToMoveWhenMoved: m(!1),
418
- triggerBelongedComponentToDeleteWhenDeleted: m(!1)
419
- }, p;
428
+ triggerBelongedComponentToDeleteWhenDeleted: m(!1),
429
+ onRemoveComponent: B
430
+ }, o;
420
431
  }
421
- const je = /* @__PURE__ */ N({
432
+ const je = /* @__PURE__ */ F({
422
433
  name: "FCapsuleDesign",
423
434
  props: W,
424
435
  emits: ["change", "update:modelValue"],
425
- setup(n, e) {
426
- const r = m(n.items), a = m(), s = 2, o = m(n.modelValue), p = m("none"), h = m(n.type), O = Q("design-item-context"), c = be(a, O);
427
- P(() => {
428
- a.value.componentInstance = c;
436
+ setup(t, e) {
437
+ const r = m(t.items), l = m(), s = 2, o = m(t.modelValue), i = m("none"), h = m(t.type), A = Q("design-item-context"), c = ge(l, A);
438
+ T(() => {
439
+ l.value.componentInstance = c;
429
440
  }), e.expose(c.value);
430
- const f = V(() => {
431
- const t = {
441
+ const p = S(() => {
442
+ const n = {
432
443
  "f-capsule-container": !0
433
444
  };
434
- return h.value && (t[h.value] = !0), t;
435
- }), i = V(() => ({})), d = V(() => ({
445
+ return h.value && (n[h.value] = !0), n;
446
+ }), f = S(() => ({})), v = S(() => ({
436
447
  "f-capsule": !0
437
- })), y = m(s), g = m(0), B = m(0), A = V(() => ({
448
+ })), y = m(s), b = m(0), V = m(0), M = S(() => ({
438
449
  left: `${y.value}px`,
439
- width: `${g.value}px`,
440
- transition: p.value
441
- })), S = V(() => ({
442
- width: `${B.value}px`
450
+ width: `${b.value}px`,
451
+ transition: i.value
452
+ })), $ = S(() => ({
453
+ width: `${V.value}px`
443
454
  })), R = /* @__PURE__ */ new Map();
444
- function E(t) {
455
+ function B(n) {
445
456
  var u;
446
- if (R.has(t.value)) {
447
- const b = (u = R.get(t.value)) == null ? void 0 : u.value;
448
- if (b) {
449
- const $ = b.getBoundingClientRect(), J = a.value.getBoundingClientRect();
450
- y.value = $.left - J.left + s + a.value.scrollLeft, g.value = $.width - 2 * s;
457
+ if (R.has(n.value)) {
458
+ const j = (u = R.get(n.value)) == null ? void 0 : u.value;
459
+ if (j) {
460
+ const D = j.getBoundingClientRect(), J = l.value.getBoundingClientRect();
461
+ y.value = D.left - J.left + s + l.value.scrollLeft, b.value = D.width - 2 * s;
451
462
  }
452
463
  }
453
464
  }
454
- function C(t, u) {
455
- const b = t.value;
456
- o.value = b, e.emit("update:modelValue", b), E(t), u && e.emit("change", b);
465
+ function E(n, u) {
466
+ const j = n.value;
467
+ o.value = j, e.emit("update:modelValue", j), B(n), u && e.emit("change", j);
457
468
  }
458
- function v(t) {
459
- const u = r.value.findIndex((b) => b.value === t);
460
- u > -1 && C(r.value[u], !1);
469
+ function d(n) {
470
+ const u = r.value.findIndex((j) => j.value === n);
471
+ u > -1 && E(r.value[u], !1);
461
472
  }
462
- D(() => n.modelValue, (t) => {
463
- o.value = t, v(o.value);
464
- }), D(() => n.items, async (t) => {
465
- r.value = t, await T(), v(o.value), B.value = Array.from(R.values()).reduce((u, b) => (u += b.value.clientWidth, u), 0);
466
- }), P(async () => {
467
- v(o.value), await T(), p.value = "0.1s ease-out all", B.value = Array.from(R.values()).reduce((t, u) => (t += u.value.clientWidth, t), 0);
473
+ P(() => t.modelValue, (n) => {
474
+ o.value = n, d(o.value);
475
+ }), P(() => t.items, async (n) => {
476
+ r.value = n, await k(), d(o.value), V.value = Array.from(R.values()).reduce((u, j) => (u += j.value.clientWidth, u), 0);
477
+ }), T(async () => {
478
+ d(o.value), await k(), i.value = "0.1s ease-out all", V.value = Array.from(R.values()).reduce((n, u) => (n += u.value.clientWidth, n), 0);
468
479
  });
469
- function j(t, u) {
470
- C(u, !0);
480
+ function O(n, u) {
481
+ E(u, !0);
471
482
  }
472
- function w(t, u) {
473
- R.set(u, t);
483
+ function g(n, u) {
484
+ R.set(u, n);
474
485
  }
475
- function l(t, u) {
476
- return M(H, {
477
- name: t.name,
478
- value: t.value,
479
- isActive: t.value === o.value,
486
+ function a(n, u) {
487
+ return w(G, {
488
+ name: n.name,
489
+ value: n.value,
490
+ isActive: n.value === o.value,
480
491
  index: u,
481
- onMounted: w,
482
- onActive: j
492
+ onMounted: g,
493
+ onActive: O
483
494
  }, null);
484
495
  }
485
- return () => M("span", {
486
- ref: a,
487
- class: f.value,
488
- style: i.value
489
- }, [M("span", {
496
+ return () => w("span", {
497
+ ref: l,
498
+ class: p.value,
499
+ style: f.value
500
+ }, [w("span", {
490
501
  class: "f-capsule-pane"
491
- }, [r.value.map((t, u) => l(t, u))]), M("small", {
492
- class: d.value,
493
- style: A.value
494
- }, null), M("div", {
502
+ }, [r.value.map((n, u) => a(n, u))]), w("small", {
503
+ class: v.value,
504
+ style: M.value
505
+ }, null), w("div", {
495
506
  class: "f-capsule-board",
496
- style: S.value
507
+ style: $.value
497
508
  }, null)]);
498
509
  }
499
510
  });
500
- k.register = (n, e, r) => {
501
- n.capsule = k, e.capsule = G;
511
+ N.register = (t, e, r) => {
512
+ t.capsule = N, e.capsule = z;
502
513
  };
503
- k.registerDesigner = (n, e, r) => {
504
- n.capsule = je, e.capsule = G;
514
+ N.registerDesigner = (t, e, r) => {
515
+ t.capsule = je, e.capsule = z;
505
516
  };
506
- const Me = X(k);
517
+ const we = X(N);
507
518
  export {
508
- k as FCapsule,
509
- ge as capsuleItemProps,
519
+ N as FCapsule,
520
+ be as capsuleItemProps,
510
521
  W as capsuleProps,
511
- Me as default,
512
- G as propsResolver
522
+ we as default,
523
+ z as propsResolver
513
524
  };