@nocobase/client 0.9.0-alpha.2 → 0.9.1-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/es/acl/ACLProvider.js +7 -8
  2. package/es/api-client/APIClient.js +6 -0
  3. package/es/block-provider/BlockProvider.js +9 -6
  4. package/es/block-provider/FormBlockProvider.js +18 -9
  5. package/es/block-provider/KanbanBlockProvider.js +1 -1
  6. package/es/block-provider/SharedFilterProvider.js +9 -1
  7. package/es/block-provider/TableBlockProvider.js +1 -1
  8. package/es/block-provider/TableSelectorProvider.js +2 -2
  9. package/es/block-provider/hooks/index.js +22 -7
  10. package/es/collection-manager/CollectionManagerProvider.d.ts +1 -0
  11. package/es/collection-manager/CollectionManagerProvider.js +71 -9
  12. package/es/collection-manager/CollectionManagerShortcut.js +36 -23
  13. package/es/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  14. package/es/collection-manager/Configuration/AddCategoryAction.js +117 -0
  15. package/es/collection-manager/Configuration/AddCollectionAction.js +8 -3
  16. package/es/collection-manager/Configuration/AddFieldAction.js +1 -0
  17. package/es/collection-manager/Configuration/ConfigurationTable.js +33 -4
  18. package/es/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  19. package/es/collection-manager/Configuration/ConfigurationTabs.js +381 -0
  20. package/es/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  21. package/es/collection-manager/Configuration/EditCategoryAction.js +150 -0
  22. package/es/collection-manager/Configuration/EditCollectionAction.js +6 -2
  23. package/es/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  24. package/es/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  25. package/es/collection-manager/Configuration/components/CollectionCategory.js +13 -0
  26. package/es/collection-manager/Configuration/index.d.ts +3 -0
  27. package/es/collection-manager/Configuration/index.js +3 -0
  28. package/es/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  29. package/es/collection-manager/Configuration/schemas/collections.js +309 -176
  30. package/es/collection-manager/Configuration/templates.d.ts +1 -0
  31. package/es/collection-manager/Configuration/templates.js +1 -1
  32. package/es/collection-manager/action-hooks.d.ts +4 -0
  33. package/es/collection-manager/action-hooks.js +26 -12
  34. package/es/collection-manager/context.d.ts +4 -0
  35. package/es/collection-manager/context.js +5 -1
  36. package/es/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  37. package/es/collection-manager/hooks/useCollectionManager.js +52 -7
  38. package/es/collection-manager/interfaces/m2m.js +2 -2
  39. package/es/collection-manager/interfaces/properties/index.d.ts +0 -56
  40. package/es/collection-manager/interfaces/properties/index.js +1 -2
  41. package/es/collection-manager/templates/calendar.js +1 -1
  42. package/es/collection-manager/templates/general.js +1 -1
  43. package/es/collection-manager/templates/properties/index.d.ts +12 -1
  44. package/es/collection-manager/templates/properties/index.js +11 -0
  45. package/es/i18n/i18n.js +3 -1
  46. package/es/locale/en_US.d.ts +23 -0
  47. package/es/locale/en_US.js +23 -0
  48. package/es/locale/ja_JP.d.ts +23 -0
  49. package/es/locale/ja_JP.js +24 -1
  50. package/es/locale/ru_RU.d.ts +1 -0
  51. package/es/locale/ru_RU.js +1 -0
  52. package/es/locale/zh_CN.d.ts +43 -4
  53. package/es/locale/zh_CN.js +44 -5
  54. package/es/route-switch/antd/admin-layout/index.js +13 -33
  55. package/es/schema-component/antd/action/Action.Designer.js +28 -15
  56. package/es/schema-component/antd/action/Action.js +28 -5
  57. package/es/schema-component/antd/action/utils.d.ts +1 -0
  58. package/es/schema-component/antd/action/utils.js +49 -0
  59. package/es/schema-component/antd/association-filter/AssociationFilter.js +4 -4
  60. package/es/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  61. package/es/schema-component/antd/association-select/useServiceOptions.js +47 -6
  62. package/es/schema-component/antd/calendar/Calendar.Designer.js +17 -36
  63. package/es/schema-component/antd/checkbox/Checkbox.js +9 -8
  64. package/es/schema-component/antd/date-picker/util.d.ts +1 -1
  65. package/es/schema-component/antd/date-picker/util.js +1 -1
  66. package/es/schema-component/antd/filter/DynamicComponent.js +3 -1
  67. package/es/schema-component/antd/filter/Filter.js +2 -1
  68. package/es/schema-component/antd/filter/FilterGroup.js +7 -4
  69. package/es/schema-component/antd/filter/FilterItem.js +3 -2
  70. package/es/schema-component/antd/filter/context.d.ts +1 -0
  71. package/es/schema-component/antd/filter/useValues.js +14 -11
  72. package/es/schema-component/antd/form/Form.js +11 -5
  73. package/es/schema-component/antd/form-item/FormItem.js +17 -8
  74. package/es/schema-component/antd/form-v2/Form.Designer.js +2 -0
  75. package/es/schema-component/antd/form-v2/Form.js +94 -7
  76. package/es/schema-component/antd/form-v2/utils.d.ts +5 -0
  77. package/es/schema-component/antd/form-v2/utils.js +161 -0
  78. package/es/schema-component/antd/g2plot/G2Plot.js +3 -1
  79. package/es/schema-component/antd/grid/Grid.js +10 -5
  80. package/es/schema-component/antd/icon-picker/IconPicker.js +1 -0
  81. package/es/schema-component/antd/index.d.ts +1 -0
  82. package/es/schema-component/antd/index.js +1 -0
  83. package/es/schema-component/antd/input/Input.d.ts +2 -1
  84. package/es/schema-component/antd/input/Json.d.ts +5 -3
  85. package/es/schema-component/antd/input/Json.js +3 -2
  86. package/es/schema-component/antd/input/ReadPretty.js +1 -1
  87. package/es/schema-component/antd/input-number/InputNumber.js +3 -1
  88. package/es/schema-component/antd/page/FixedBlock.js +3 -1
  89. package/es/schema-component/antd/page/Page.js +11 -5
  90. package/es/schema-component/antd/page/PageTabDesigner.js +3 -3
  91. package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  92. package/es/schema-component/antd/record-picker/RecordPicker.js +1 -2
  93. package/es/schema-component/antd/record-picker/util.js +7 -0
  94. package/es/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  95. package/es/schema-component/antd/remote-select/RemoteSelect.js +78 -36
  96. package/es/schema-component/antd/rich-text/RichText.js +4 -2
  97. package/es/schema-component/antd/select/Select.js +14 -4
  98. package/es/schema-component/antd/table/Table.Array.js +10 -3
  99. package/es/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  100. package/es/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  101. package/es/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  102. package/es/schema-component/antd/tabs/Tabs.js +1 -0
  103. package/es/schema-component/antd/time-picker/TimePicker.js +1 -1
  104. package/es/schema-component/antd/variable/Input.d.ts +2 -0
  105. package/es/schema-component/antd/variable/Input.js +244 -0
  106. package/es/schema-component/antd/variable/JSONInput.d.ts +2 -0
  107. package/es/schema-component/antd/variable/JSONInput.js +82 -0
  108. package/es/schema-component/antd/variable/TextArea.d.ts +2 -0
  109. package/es/schema-component/antd/variable/TextArea.js +322 -0
  110. package/es/schema-component/antd/variable/Variable.d.ts +8 -0
  111. package/es/schema-component/antd/variable/Variable.js +11 -0
  112. package/es/schema-component/antd/variable/index.d.ts +1 -0
  113. package/es/schema-component/antd/variable/index.js +1 -0
  114. package/es/schema-component/common/sortable-item/SortableItem.js +36 -6
  115. package/es/schema-component/common/utils/logic.js +523 -0
  116. package/es/schema-component/common/utils/uitls.d.ts +1 -0
  117. package/es/schema-component/common/utils/uitls.js +89 -0
  118. package/es/schema-initializer/SchemaInitializer.js +9 -4
  119. package/es/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  120. package/es/schema-initializer/buttons/BlockInitializers.js +1 -102
  121. package/es/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  122. package/es/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  123. package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -3
  124. package/es/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  125. package/es/schema-initializer/components/CreateRecordAction.js +174 -0
  126. package/es/schema-initializer/components/index.d.ts +1 -0
  127. package/es/schema-initializer/components/index.js +2 -1
  128. package/es/schema-initializer/index.d.ts +2 -1
  129. package/es/schema-initializer/index.js +2 -1
  130. package/es/schema-initializer/items/CalendarBlockInitializer.js +24 -41
  131. package/es/schema-initializer/items/CreateActionInitializer.js +3 -3
  132. package/es/schema-initializer/items/RecordFormBlockInitializer.js +9 -9
  133. package/es/schema-initializer/items/index.d.ts +4 -4
  134. package/es/schema-initializer/items/index.js +6 -6
  135. package/es/schema-initializer/utils.js +22 -7
  136. package/es/schema-settings/EnableChildCollections/index.d.ts +2 -0
  137. package/es/schema-settings/EnableChildCollections/index.js +141 -0
  138. package/es/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  139. package/es/schema-settings/LinkageRules/DynamicComponent.js +113 -0
  140. package/es/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  141. package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +15 -0
  142. package/es/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  143. package/es/schema-settings/LinkageRules/LinkageRuleAction.js +162 -0
  144. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  145. package/es/schema-settings/LinkageRules/LinkageRuleActionGroup.js +71 -0
  146. package/es/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  147. package/es/schema-settings/LinkageRules/ValueDynamicComponent.js +82 -0
  148. package/es/schema-settings/LinkageRules/Variables.d.ts +7 -0
  149. package/es/schema-settings/LinkageRules/Variables.js +115 -0
  150. package/es/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  151. package/es/schema-settings/LinkageRules/action-hooks.js +115 -0
  152. package/es/schema-settings/LinkageRules/context.d.ts +13 -0
  153. package/es/schema-settings/LinkageRules/context.js +4 -0
  154. package/es/schema-settings/LinkageRules/index.d.ts +2 -0
  155. package/es/schema-settings/LinkageRules/index.js +132 -0
  156. package/es/schema-settings/LinkageRules/type.d.ts +13 -0
  157. package/es/schema-settings/LinkageRules/type.js +15 -0
  158. package/es/schema-settings/LinkageRules/useValues.d.ts +1 -0
  159. package/es/schema-settings/LinkageRules/useValues.js +84 -0
  160. package/es/schema-settings/SchemaSettings.d.ts +4 -1
  161. package/es/schema-settings/SchemaSettings.js +219 -26
  162. package/es/schema-templates/BlockTemplate.js +9 -1
  163. package/es/system-settings/SystemSettingsShortcut.js +1 -1
  164. package/lib/acl/ACLProvider.js +7 -8
  165. package/lib/api-client/APIClient.js +6 -0
  166. package/lib/block-provider/BlockProvider.js +9 -6
  167. package/lib/block-provider/FormBlockProvider.js +17 -8
  168. package/lib/block-provider/KanbanBlockProvider.js +1 -1
  169. package/lib/block-provider/SharedFilterProvider.js +9 -3
  170. package/lib/block-provider/TableBlockProvider.js +1 -1
  171. package/lib/block-provider/TableSelectorProvider.js +2 -2
  172. package/lib/block-provider/hooks/index.js +23 -7
  173. package/lib/collection-manager/CollectionManagerProvider.d.ts +1 -0
  174. package/lib/collection-manager/CollectionManagerProvider.js +81 -16
  175. package/lib/collection-manager/CollectionManagerShortcut.js +36 -23
  176. package/lib/collection-manager/Configuration/AddCategoryAction.d.ts +2 -0
  177. package/lib/collection-manager/Configuration/AddCategoryAction.js +145 -0
  178. package/lib/collection-manager/Configuration/AddCollectionAction.js +8 -3
  179. package/lib/collection-manager/Configuration/AddFieldAction.js +1 -0
  180. package/lib/collection-manager/Configuration/ConfigurationTable.js +34 -4
  181. package/lib/collection-manager/Configuration/ConfigurationTabs.d.ts +1 -0
  182. package/lib/collection-manager/Configuration/ConfigurationTabs.js +407 -0
  183. package/lib/collection-manager/Configuration/EditCategoryAction.d.ts +2 -0
  184. package/lib/collection-manager/Configuration/EditCategoryAction.js +178 -0
  185. package/lib/collection-manager/Configuration/EditCollectionAction.js +6 -2
  186. package/lib/collection-manager/Configuration/OverridingCollectionField.js +17 -8
  187. package/lib/collection-manager/Configuration/components/CollectionCategory.d.ts +2 -0
  188. package/lib/collection-manager/Configuration/components/CollectionCategory.js +27 -0
  189. package/lib/collection-manager/Configuration/index.d.ts +3 -0
  190. package/lib/collection-manager/Configuration/index.js +39 -0
  191. package/lib/collection-manager/Configuration/schemas/collections.d.ts +3 -0
  192. package/lib/collection-manager/Configuration/schemas/collections.js +316 -178
  193. package/lib/collection-manager/Configuration/templates.d.ts +1 -0
  194. package/lib/collection-manager/Configuration/templates.js +2 -0
  195. package/lib/collection-manager/action-hooks.d.ts +4 -0
  196. package/lib/collection-manager/action-hooks.js +30 -13
  197. package/lib/collection-manager/context.d.ts +4 -0
  198. package/lib/collection-manager/context.js +7 -2
  199. package/lib/collection-manager/hooks/useCollectionManager.d.ts +7 -0
  200. package/lib/collection-manager/hooks/useCollectionManager.js +52 -6
  201. package/lib/collection-manager/interfaces/m2m.js +2 -2
  202. package/lib/collection-manager/interfaces/properties/index.d.ts +0 -56
  203. package/lib/collection-manager/interfaces/properties/index.js +1 -2
  204. package/lib/collection-manager/templates/calendar.js +1 -1
  205. package/lib/collection-manager/templates/general.js +1 -1
  206. package/lib/collection-manager/templates/properties/index.d.ts +12 -1
  207. package/lib/collection-manager/templates/properties/index.js +11 -0
  208. package/lib/i18n/i18n.js +3 -1
  209. package/lib/locale/en_US.d.ts +23 -0
  210. package/lib/locale/en_US.js +23 -0
  211. package/lib/locale/ja_JP.d.ts +23 -0
  212. package/lib/locale/ja_JP.js +24 -1
  213. package/lib/locale/ru_RU.d.ts +1 -0
  214. package/lib/locale/ru_RU.js +1 -0
  215. package/lib/locale/zh_CN.d.ts +43 -4
  216. package/lib/locale/zh_CN.js +44 -5
  217. package/lib/route-switch/antd/admin-layout/index.js +13 -33
  218. package/lib/schema-component/antd/action/Action.Designer.js +30 -14
  219. package/lib/schema-component/antd/action/Action.js +29 -3
  220. package/lib/schema-component/antd/action/utils.d.ts +1 -0
  221. package/lib/schema-component/antd/action/utils.js +58 -2
  222. package/lib/schema-component/antd/association-filter/AssociationFilter.js +3 -3
  223. package/lib/schema-component/antd/association-select/AssociationSelect.d.ts +2 -2
  224. package/lib/schema-component/antd/association-select/useServiceOptions.js +47 -4
  225. package/lib/schema-component/antd/calendar/Calendar.Designer.js +15 -33
  226. package/lib/schema-component/antd/checkbox/Checkbox.js +8 -7
  227. package/lib/schema-component/antd/date-picker/util.d.ts +1 -1
  228. package/lib/schema-component/antd/date-picker/util.js +1 -1
  229. package/lib/schema-component/antd/filter/DynamicComponent.js +3 -1
  230. package/lib/schema-component/antd/filter/Filter.js +2 -1
  231. package/lib/schema-component/antd/filter/FilterGroup.js +7 -4
  232. package/lib/schema-component/antd/filter/FilterItem.js +3 -2
  233. package/lib/schema-component/antd/filter/context.d.ts +1 -0
  234. package/lib/schema-component/antd/filter/useValues.js +15 -11
  235. package/lib/schema-component/antd/form/Form.js +9 -3
  236. package/lib/schema-component/antd/form-item/FormItem.js +21 -7
  237. package/lib/schema-component/antd/form-v2/Form.Designer.js +2 -0
  238. package/lib/schema-component/antd/form-v2/Form.js +93 -5
  239. package/lib/schema-component/antd/form-v2/utils.d.ts +5 -0
  240. package/lib/schema-component/antd/form-v2/utils.js +181 -0
  241. package/lib/schema-component/antd/g2plot/G2Plot.js +3 -1
  242. package/lib/schema-component/antd/grid/Grid.js +10 -5
  243. package/lib/schema-component/antd/icon-picker/IconPicker.js +1 -0
  244. package/lib/schema-component/antd/index.d.ts +1 -0
  245. package/lib/schema-component/antd/index.js +13 -0
  246. package/lib/schema-component/antd/input/Input.d.ts +2 -1
  247. package/lib/schema-component/antd/input/Json.d.ts +5 -3
  248. package/lib/schema-component/antd/input/Json.js +6 -3
  249. package/lib/schema-component/antd/input/ReadPretty.js +1 -1
  250. package/lib/schema-component/antd/input-number/InputNumber.js +2 -0
  251. package/lib/schema-component/antd/page/FixedBlock.js +3 -1
  252. package/lib/schema-component/antd/page/Page.js +14 -5
  253. package/lib/schema-component/antd/page/PageTabDesigner.js +1 -1
  254. package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +3 -1
  255. package/lib/schema-component/antd/record-picker/RecordPicker.js +1 -2
  256. package/lib/schema-component/antd/record-picker/util.js +7 -0
  257. package/lib/schema-component/antd/remote-select/RemoteSelect.d.ts +2 -0
  258. package/lib/schema-component/antd/remote-select/RemoteSelect.js +78 -37
  259. package/lib/schema-component/antd/rich-text/RichText.js +4 -2
  260. package/lib/schema-component/antd/select/Select.js +14 -4
  261. package/lib/schema-component/antd/table/Table.Array.js +8 -1
  262. package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +2 -2
  263. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +3 -2
  264. package/lib/schema-component/antd/tabs/Tabs.Designer.js +1 -0
  265. package/lib/schema-component/antd/tabs/Tabs.js +1 -0
  266. package/lib/schema-component/antd/time-picker/TimePicker.js +1 -1
  267. package/lib/schema-component/antd/variable/Input.d.ts +2 -0
  268. package/lib/schema-component/antd/variable/Input.js +262 -0
  269. package/lib/schema-component/antd/variable/JSONInput.d.ts +2 -0
  270. package/lib/schema-component/antd/variable/JSONInput.js +100 -0
  271. package/lib/schema-component/antd/variable/TextArea.d.ts +2 -0
  272. package/lib/schema-component/antd/variable/TextArea.js +341 -0
  273. package/lib/schema-component/antd/variable/Variable.d.ts +8 -0
  274. package/lib/schema-component/antd/variable/Variable.js +25 -0
  275. package/lib/schema-component/antd/variable/index.d.ts +1 -0
  276. package/lib/schema-component/antd/variable/index.js +18 -0
  277. package/lib/schema-component/common/sortable-item/SortableItem.js +36 -6
  278. package/lib/schema-component/common/utils/logic.js +525 -0
  279. package/lib/schema-component/common/utils/uitls.d.ts +1 -0
  280. package/lib/schema-component/common/utils/uitls.js +103 -0
  281. package/lib/schema-initializer/SchemaInitializer.js +9 -4
  282. package/lib/schema-initializer/buttons/BlockInitializers.d.ts +2 -184
  283. package/lib/schema-initializer/buttons/BlockInitializers.js +0 -108
  284. package/lib/schema-initializer/buttons/RecordBlockInitializers.js +72 -16
  285. package/lib/schema-initializer/buttons/TableActionColumnInitializers.d.ts +1 -0
  286. package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +3 -1
  287. package/lib/schema-initializer/components/CreateRecordAction.d.ts +3 -0
  288. package/lib/schema-initializer/components/CreateRecordAction.js +199 -0
  289. package/lib/schema-initializer/components/index.d.ts +1 -0
  290. package/lib/schema-initializer/components/index.js +13 -0
  291. package/lib/schema-initializer/index.d.ts +2 -1
  292. package/lib/schema-initializer/index.js +51 -2
  293. package/lib/schema-initializer/items/CalendarBlockInitializer.js +16 -33
  294. package/lib/schema-initializer/items/CreateActionInitializer.js +3 -3
  295. package/lib/schema-initializer/items/RecordFormBlockInitializer.js +3 -3
  296. package/lib/schema-initializer/items/index.d.ts +4 -4
  297. package/lib/schema-initializer/items/index.js +52 -52
  298. package/lib/schema-initializer/utils.js +22 -6
  299. package/lib/schema-settings/EnableChildCollections/index.d.ts +2 -0
  300. package/lib/schema-settings/EnableChildCollections/index.js +156 -0
  301. package/lib/schema-settings/LinkageRules/DynamicComponent.d.ts +1 -0
  302. package/lib/schema-settings/LinkageRules/DynamicComponent.js +139 -0
  303. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.d.ts +2 -0
  304. package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +27 -0
  305. package/lib/schema-settings/LinkageRules/LinkageRuleAction.d.ts +3 -0
  306. package/lib/schema-settings/LinkageRules/LinkageRuleAction.js +190 -0
  307. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.d.ts +3 -0
  308. package/lib/schema-settings/LinkageRules/LinkageRuleActionGroup.js +90 -0
  309. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.d.ts +1 -0
  310. package/lib/schema-settings/LinkageRules/ValueDynamicComponent.js +104 -0
  311. package/lib/schema-settings/LinkageRules/Variables.d.ts +7 -0
  312. package/lib/schema-settings/LinkageRules/Variables.js +124 -0
  313. package/lib/schema-settings/LinkageRules/action-hooks.d.ts +1 -0
  314. package/lib/schema-settings/LinkageRules/action-hooks.js +127 -0
  315. package/lib/schema-settings/LinkageRules/context.d.ts +13 -0
  316. package/lib/schema-settings/LinkageRules/context.js +15 -0
  317. package/lib/schema-settings/LinkageRules/index.d.ts +2 -0
  318. package/lib/schema-settings/LinkageRules/index.js +149 -0
  319. package/lib/schema-settings/LinkageRules/type.d.ts +13 -0
  320. package/lib/schema-settings/LinkageRules/type.js +22 -0
  321. package/lib/schema-settings/LinkageRules/useValues.d.ts +1 -0
  322. package/lib/schema-settings/LinkageRules/useValues.js +95 -0
  323. package/lib/schema-settings/SchemaSettings.d.ts +4 -1
  324. package/lib/schema-settings/SchemaSettings.js +243 -48
  325. package/lib/schema-templates/BlockTemplate.js +9 -1
  326. package/lib/system-settings/SystemSettingsShortcut.js +1 -1
  327. package/package.json +4 -4
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.JSONInput = JSONInput;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _antd = require("antd");
13
+
14
+ var _css = require("@emotion/css");
15
+
16
+ var _input = require("../input");
17
+
18
+ var _reactI18next = require("react-i18next");
19
+
20
+ var _templateObject, _templateObject2, _templateObject3;
21
+
22
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
+
24
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
+
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
32
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
33
+
34
+ // NOTE: https://stackoverflow.com/questions/23892547/what-is-the-best-way-to-trigger-onchange-event-in-react-js/46012210#46012210
35
+ function setNativeInputValue(input, value) {
36
+ var nativeInputValueSetter = Object.getOwnPropertyDescriptor(input.constructor.prototype, 'value').set;
37
+ nativeInputValueSetter.call(input, value);
38
+ input.dispatchEvent(new Event('input', {
39
+ bubbles: true
40
+ }));
41
+ }
42
+
43
+ function JSONInput(props) {
44
+ var inputRef = (0, _react.useRef)(null);
45
+ var value = props.value,
46
+ _props$space = props.space,
47
+ space = _props$space === void 0 ? 2 : _props$space,
48
+ scope = props.scope;
49
+
50
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
51
+ t = _useTranslation.t;
52
+
53
+ var options = typeof scope === 'function' ? scope() : scope !== null && scope !== void 0 ? scope : [];
54
+
55
+ function onFormat() {
56
+ if (!inputRef.current) {
57
+ return;
58
+ }
59
+
60
+ if (!value) {
61
+ return;
62
+ }
63
+
64
+ var textArea = inputRef.current.resizableTextArea.textArea;
65
+ var nextValue = JSON.stringify(value, null, space);
66
+ setNativeInputValue(textArea, nextValue);
67
+ textArea.setSelectionRange(nextValue.length, nextValue.length);
68
+ textArea.focus();
69
+ }
70
+
71
+ function onInsert(selected) {
72
+ if (!inputRef.current) {
73
+ return;
74
+ }
75
+
76
+ var variable = "{{".concat(selected.join('.'), "}}");
77
+ var textArea = inputRef.current.resizableTextArea.textArea;
78
+ var nextValue = textArea.value.slice(0, textArea.selectionStart) + variable + textArea.value.slice(textArea.selectionEnd);
79
+ var nextPos = [textArea.selectionStart, textArea.selectionStart + variable.length];
80
+ setNativeInputValue(textArea, nextValue);
81
+ textArea.setSelectionRange.apply(textArea, nextPos);
82
+ textArea.focus();
83
+ }
84
+
85
+ return /*#__PURE__*/_react.default.createElement("div", {
86
+ className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n .ant-input{\n width: 100%;\n }\n "])))
87
+ }, /*#__PURE__*/_react.default.createElement(_input.Input.JSON, _objectSpread(_objectSpread({}, props), {}, {
88
+ ref: inputRef
89
+ })), /*#__PURE__*/_react.default.createElement(_antd.Button.Group, {
90
+ className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: absolute;\n right: 0;\n top: 0;\n .ant-btn-sm{\n font-size: 85%;\n }\n "])))
91
+ }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
92
+ onClick: onFormat
93
+ }, t('Prettify')), /*#__PURE__*/_react.default.createElement(_antd.Cascader, {
94
+ value: [],
95
+ options: options,
96
+ onChange: onInsert
97
+ }, /*#__PURE__*/_react.default.createElement(_antd.Button, {
98
+ className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-style: italic;\n font-family: \"New York\", \"Times New Roman\", Times, serif;\n "])))
99
+ }, "x"))));
100
+ }
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function TextArea(props: any): JSX.Element;
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.TextArea = TextArea;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _antd = require("antd");
13
+
14
+ var _react2 = require("@formily/react");
15
+
16
+ var _css = require("@emotion/css");
17
+
18
+ var _reactI18next = require("react-i18next");
19
+
20
+ var _2 = require("../..");
21
+
22
+ var _templateObject, _templateObject2, _templateObject3;
23
+
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+
26
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
+
28
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
29
+
30
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
31
+
32
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
33
+
34
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
35
+
36
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
37
+
38
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
+
40
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
41
+
42
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
43
+
44
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
45
+
46
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
47
+
48
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
49
+
50
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
51
+
52
+ var VARIABLE_RE = /{{\s*([^{}]+)\s*}}/g;
53
+
54
+ function pasteHtml(container, html, _ref) {
55
+ var _window$getSelection, _window;
56
+
57
+ var _ref$selectPastedCont = _ref.selectPastedContent,
58
+ selectPastedContent = _ref$selectPastedCont === void 0 ? false : _ref$selectPastedCont,
59
+ indexes = _ref.range;
60
+ // IE9 and non-IE
61
+ var sel = (_window$getSelection = (_window = window).getSelection) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.call(_window);
62
+
63
+ if (!(sel === null || sel === void 0 ? void 0 : sel.getRangeAt) || !sel.rangeCount) {
64
+ return;
65
+ }
66
+
67
+ var range = sel.getRangeAt(0);
68
+
69
+ if (!range) {
70
+ return;
71
+ }
72
+
73
+ var children = Array.from(container.childNodes);
74
+
75
+ if (indexes[0] === -1) {
76
+ if (indexes[1]) {
77
+ range.setStartAfter(children[indexes[1] - 1]);
78
+ }
79
+ } else {
80
+ range.setStart(children[indexes[0]], indexes[1]);
81
+ }
82
+
83
+ if (indexes[2] === -1) {
84
+ if (indexes[3]) {
85
+ range.setEndAfter(children[indexes[3] - 1]);
86
+ }
87
+ } else {
88
+ range.setEnd(children[indexes[2]], indexes[3]);
89
+ }
90
+
91
+ range.deleteContents(); // Range.createContextualFragment() would be useful here but is
92
+ // only relatively recently standardized and is not supported in
93
+ // some browsers (IE9, for one)
94
+
95
+ var el = document.createElement('div');
96
+ el.innerHTML = html;
97
+ var frag = document.createDocumentFragment();
98
+ var lastNode;
99
+
100
+ while (el.firstChild) {
101
+ lastNode = frag.appendChild(el.firstChild);
102
+ }
103
+
104
+ var firstChild = frag.firstChild;
105
+ range.insertNode(frag); // Preserve the selection
106
+
107
+ if (lastNode) {
108
+ var next = range.cloneRange();
109
+ next.setStartAfter(lastNode);
110
+
111
+ if (selectPastedContent) {
112
+ if (firstChild) {
113
+ next.setStartBefore(firstChild);
114
+ }
115
+ } else {
116
+ next.collapse(true);
117
+ }
118
+
119
+ sel.removeAllRanges();
120
+ sel.addRange(next);
121
+ }
122
+ }
123
+
124
+ function getValue(el) {
125
+ var values = [];
126
+
127
+ var _iterator = _createForOfIteratorHelper(el.childNodes),
128
+ _step;
129
+
130
+ try {
131
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
132
+ var node = _step.value;
133
+
134
+ if (node.nodeName === 'SPAN') {
135
+ values.push("{{".concat(node['dataset']['key'], "}}"));
136
+ } else {
137
+ var _node$textContent, _node$textContent$tri;
138
+
139
+ values.push((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : (_node$textContent$tri = _node$textContent.trim) === null || _node$textContent$tri === void 0 ? void 0 : _node$textContent$tri.call(_node$textContent));
140
+ }
141
+ }
142
+ } catch (err) {
143
+ _iterator.e(err);
144
+ } finally {
145
+ _iterator.f();
146
+ }
147
+
148
+ return values.join(' ').replace(/\s+/g, ' ').trim();
149
+ }
150
+
151
+ function renderHTML(exp, keyLabelMap) {
152
+ return exp.replace(VARIABLE_RE, function (_, i) {
153
+ var _createVariableTagHTM;
154
+
155
+ var key = i.trim();
156
+ return (_createVariableTagHTM = createVariableTagHTML(key, keyLabelMap)) !== null && _createVariableTagHTM !== void 0 ? _createVariableTagHTM : '';
157
+ });
158
+ }
159
+
160
+ function createOptionsValueLabelMap(options) {
161
+ var map = new Map();
162
+
163
+ var _iterator2 = _createForOfIteratorHelper(options),
164
+ _step2;
165
+
166
+ try {
167
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
168
+ var option = _step2.value;
169
+ map.set(option.value, [option.label]);
170
+
171
+ if (option.children) {
172
+ var _iterator3 = _createForOfIteratorHelper(createOptionsValueLabelMap(option.children)),
173
+ _step3;
174
+
175
+ try {
176
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
177
+ var _step3$value = _slicedToArray(_step3.value, 2),
178
+ value = _step3$value[0],
179
+ labels = _step3$value[1];
180
+
181
+ map.set("".concat(option.value, ".").concat(value), [option.label].concat(_toConsumableArray(labels)));
182
+ }
183
+ } catch (err) {
184
+ _iterator3.e(err);
185
+ } finally {
186
+ _iterator3.f();
187
+ }
188
+ }
189
+ }
190
+ } catch (err) {
191
+ _iterator2.e(err);
192
+ } finally {
193
+ _iterator2.f();
194
+ }
195
+
196
+ return map;
197
+ }
198
+
199
+ function createVariableTagHTML(variable, keyLabelMap) {
200
+ var labels = keyLabelMap.get(variable);
201
+ return "<span class=\"ant-tag ant-tag-blue\" contentEditable=\"false\" data-key=\"".concat(variable, "\">").concat(labels === null || labels === void 0 ? void 0 : labels.join(' / '), "</span>");
202
+ }
203
+
204
+ function TextArea(props) {
205
+ var _ref2;
206
+
207
+ var _props$value = props.value,
208
+ value = _props$value === void 0 ? '' : _props$value,
209
+ scope = props.scope,
210
+ onChange = props.onChange,
211
+ _props$multiline = props.multiline,
212
+ multiline = _props$multiline === void 0 ? true : _props$multiline,
213
+ button = props.button;
214
+ var compile = (0, _2.useCompile)();
215
+
216
+ var _useTranslation = (0, _reactI18next.useTranslation)(),
217
+ t = _useTranslation.t;
218
+
219
+ var inputRef = (0, _react.useRef)(null);
220
+ var options = compile((_ref2 = typeof scope === 'function' ? scope() : scope) !== null && _ref2 !== void 0 ? _ref2 : []);
221
+ var form = (0, _react2.useForm)();
222
+ var keyLabelMap = (0, _react.useMemo)(function () {
223
+ return createOptionsValueLabelMap(options);
224
+ }, [scope]);
225
+
226
+ var _useState = (0, _react.useState)(false),
227
+ _useState2 = _slicedToArray(_useState, 2),
228
+ changed = _useState2[0],
229
+ setChanged = _useState2[1];
230
+
231
+ var _useState3 = (0, _react.useState)(function () {
232
+ return renderHTML(value !== null && value !== void 0 ? value : '', keyLabelMap);
233
+ }),
234
+ _useState4 = _slicedToArray(_useState3, 2),
235
+ html = _useState4[0],
236
+ setHtml = _useState4[1]; // [startElementIndex, startOffset, endElementIndex, endOffset]
237
+
238
+
239
+ var _useState5 = (0, _react.useState)([-1, 0, -1, 0]),
240
+ _useState6 = _slicedToArray(_useState5, 2),
241
+ range = _useState6[0],
242
+ setRange = _useState6[1];
243
+
244
+ (0, _react.useEffect)(function () {
245
+ if (changed) {
246
+ return;
247
+ }
248
+
249
+ setHtml(renderHTML(value !== null && value !== void 0 ? value : '', keyLabelMap));
250
+ }, [value]);
251
+ (0, _react.useEffect)(function () {
252
+ var current = inputRef.current;
253
+
254
+ if (!current || changed) {
255
+ return;
256
+ }
257
+
258
+ var nextRange = new Range();
259
+ var lastChild = current.lastChild;
260
+
261
+ if (lastChild) {
262
+ nextRange.setStartAfter(lastChild);
263
+ nextRange.setEndAfter(lastChild);
264
+ var nodes = Array.from(current.childNodes);
265
+ var startElementIndex = nextRange.startContainer === current ? -1 : nodes.indexOf(lastChild);
266
+ var endElementIndex = nextRange.startContainer === current ? -1 : nodes.indexOf(lastChild);
267
+ setRange([startElementIndex, nextRange.startOffset, endElementIndex, nextRange.endOffset]);
268
+ }
269
+ }, [html]);
270
+
271
+ function onInsert(keyPath) {
272
+ var variable = keyPath.filter(function (key) {
273
+ return Boolean(key.trim());
274
+ });
275
+ var current = inputRef.current;
276
+
277
+ if (!current || !variable) {
278
+ return;
279
+ }
280
+
281
+ current.focus();
282
+ pasteHtml(current, createVariableTagHTML(variable.join('.'), keyLabelMap), {
283
+ range: range
284
+ });
285
+ setChanged(true);
286
+ onChange(getValue(current));
287
+ }
288
+
289
+ function onInput(_ref3) {
290
+ var currentTarget = _ref3.currentTarget;
291
+ setChanged(true);
292
+ onChange(getValue(currentTarget));
293
+ }
294
+
295
+ function onBlur(_ref4) {
296
+ var _window$getSelection2, _window2;
297
+
298
+ var currentTarget = _ref4.currentTarget;
299
+ var sel = (_window$getSelection2 = (_window2 = window).getSelection) === null || _window$getSelection2 === void 0 ? void 0 : _window$getSelection2.call(_window2);
300
+
301
+ if (!(sel === null || sel === void 0 ? void 0 : sel.getRangeAt) || !sel.rangeCount) {
302
+ return;
303
+ }
304
+
305
+ var r = sel.getRangeAt(0);
306
+ var nodes = Array.from(currentTarget.childNodes);
307
+ var startElementIndex = nodes.indexOf(r.startContainer);
308
+ var endElementIndex = nodes.indexOf(r.endContainer);
309
+ setRange([startElementIndex, r.startOffset, endElementIndex, r.endOffset]);
310
+ }
311
+
312
+ var disabled = props.disabled || form.disabled;
313
+ return /*#__PURE__*/_react.default.createElement(_antd.Input.Group, {
314
+ compact: true,
315
+ className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.ant-input-group.ant-input-group-compact {\n display: flex;\n .ant-input {\n flex-grow: 1;\n min-width: 200px;\n }\n .ant-input-disabled {\n .ant-tag {\n color: #bfbfbf;\n border-color: #d9d9d9;\n }\n }\n }\n "])))
316
+ }, /*#__PURE__*/_react.default.createElement("div", {
317
+ onInput: onInput,
318
+ onBlur: onBlur,
319
+ onKeyDown: function onKeyDown(e) {
320
+ if (e.key === 'Enter') {
321
+ e.preventDefault();
322
+ }
323
+ },
324
+ className: (0, _css.cx)('ant-input', {
325
+ 'ant-input-disabled': disabled
326
+ }, (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n overflow: auto;\n white-space: ", ";\n\n .ant-tag {\n display: inline;\n line-height: 19px;\n margin: 0 0.5em;\n padding: 2px 7px;\n border-radius: 10px;\n }\n "])), multiline ? 'normal' : 'nowrap')),
327
+ ref: inputRef,
328
+ contentEditable: !disabled,
329
+ dangerouslySetInnerHTML: {
330
+ __html: html
331
+ }
332
+ }), /*#__PURE__*/_react.default.createElement(_antd.Tooltip, {
333
+ title: t('Use variable')
334
+ }, /*#__PURE__*/_react.default.createElement(_antd.Cascader, {
335
+ value: [],
336
+ options: options,
337
+ onChange: onInsert
338
+ }, button !== null && button !== void 0 ? button : /*#__PURE__*/_react.default.createElement(_antd.Button, {
339
+ className: (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-style: italic;\n font-family: 'New York', 'Times New Roman', Times, serif;\n "])))
340
+ }, "x"))));
341
+ }
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ export declare function Variable(): any;
3
+ export declare namespace Variable {
4
+ var Input: import("react").ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & import("react").RefAttributes<unknown>>;
5
+ var TextArea: import("react").ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & import("react").RefAttributes<unknown>>;
6
+ var JSON: import("react").ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & import("react").RefAttributes<unknown>>;
7
+ }
8
+ export default Variable;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Variable = Variable;
7
+ exports.default = void 0;
8
+
9
+ var _react = require("@formily/react");
10
+
11
+ var _Input = require("./Input");
12
+
13
+ var _TextArea = require("./TextArea");
14
+
15
+ var _JSONInput = require("./JSONInput");
16
+
17
+ function Variable() {
18
+ return null;
19
+ }
20
+
21
+ Variable.Input = (0, _react.connect)(_Input.Input);
22
+ Variable.TextArea = (0, _react.connect)(_TextArea.TextArea);
23
+ Variable.JSON = (0, _react.connect)(_JSONInput.JSONInput);
24
+ var _default = Variable;
25
+ exports.default = _default;
@@ -0,0 +1 @@
1
+ export * from './Variable';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _Variable = require("./Variable");
8
+
9
+ Object.keys(_Variable).forEach(function (key) {
10
+ if (key === "default" || key === "__esModule") return;
11
+ if (key in exports && exports[key] === _Variable[key]) return;
12
+ Object.defineProperty(exports, key, {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _Variable[key];
16
+ }
17
+ });
18
+ });
@@ -13,7 +13,8 @@ var _react = require("@formily/react");
13
13
 
14
14
  var _react2 = _interopRequireWildcard(require("react"));
15
15
 
16
- var _excluded = ["component", "style", "children", "openMode"];
16
+ var _excluded = ["component", "style", "children", "openMode"],
17
+ _excluded2 = ["schema", "id"];
17
18
 
18
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
20
 
@@ -82,16 +83,45 @@ var Sortable = function Sortable(props) {
82
83
  };
83
84
 
84
85
  exports.Sortable = Sortable;
85
- var SortableItem = (0, _react.observer)(function (props) {
86
+
87
+ var useSortableItemProps = function useSortableItemProps(props) {
88
+ var id = useSortableItemId(props);
89
+
90
+ if (props.schema) {
91
+ return _objectSpread(_objectSpread({}, props), {}, {
92
+ id: id
93
+ });
94
+ }
95
+
96
+ var schema = (0, _react.useFieldSchema)();
97
+ return _objectSpread(_objectSpread({}, props), {}, {
98
+ id: id,
99
+ schema: schema
100
+ });
101
+ };
102
+
103
+ var useSortableItemId = function useSortableItemId(props) {
104
+ if (props.id) {
105
+ return props.id;
106
+ }
107
+
86
108
  var field = (0, _react.useField)();
87
- var fieldSchema = (0, _react.useFieldSchema)();
109
+ return field.address.toString();
110
+ };
111
+
112
+ var SortableItem = (0, _react.observer)(function (props) {
113
+ var _useSortableItemProps = useSortableItemProps(props),
114
+ schema = _useSortableItemProps.schema,
115
+ id = _useSortableItemProps.id,
116
+ others = _objectWithoutProperties(_useSortableItemProps, _excluded2);
117
+
88
118
  return /*#__PURE__*/_react2.default.createElement(SortableProvider, {
89
- id: field.address.toString(),
119
+ id: id,
90
120
  data: {
91
121
  insertAdjacent: 'afterEnd',
92
- schema: fieldSchema
122
+ schema: schema
93
123
  }
94
- }, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, props), props.children));
124
+ }, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, others), props.children));
95
125
  });
96
126
  exports.SortableItem = SortableItem;
97
127