@pisell/materials 1.0.472 → 1.0.473

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 (277) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +7 -7
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +18 -18
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +15 -15
  11. package/es/components/dataSourceComponents/dataSourceForm/index.less +1 -1
  12. package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
  13. package/es/components/dataSourceComponents/dataSourceForm/serve.js +4 -3
  14. package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
  15. package/es/components/dataSourceComponents/dataSourceForm/utils.js +41 -17
  16. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
  17. package/es/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +4 -0
  18. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
  19. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +4 -0
  20. package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
  21. package/es/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +15 -0
  22. package/es/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
  23. package/es/components/dataSourceComponents/dataSourceShow/utils.js +82 -0
  24. package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +33 -139
  25. package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
  26. package/es/components/dataSourceComponents/dataSourceTable/filter/index.js +162 -0
  27. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
  28. package/es/components/dataSourceComponents/dataSourceTable/filter/utils.js +135 -0
  29. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  30. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
  31. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +35 -39
  32. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
  33. package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +65 -11
  34. package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
  35. package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +105 -6
  36. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
  37. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +245 -0
  38. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
  39. package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +41 -12
  40. package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
  41. package/es/components/dataSourceComponents/dataSourceTable/index.js +1 -0
  42. package/es/components/dataSourceComponents/dataSourceTable/index.less +5 -0
  43. package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
  44. package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
  45. package/es/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +23 -0
  46. package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
  47. package/es/components/dataSourceComponents/dataSourceWrapper/index.js +17 -2
  48. package/es/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +7 -1
  49. package/es/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
  50. package/es/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
  51. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
  52. package/es/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +7 -0
  53. package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
  54. package/es/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +5 -0
  55. package/es/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
  56. package/es/components/dataSourceComponents/fields/DateRangePicker/index.js +5 -0
  57. package/es/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
  58. package/es/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
  59. package/es/components/dataSourceComponents/fields/DateRangePicker/type.js +1 -0
  60. package/es/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
  61. package/es/components/dataSourceComponents/fields/Input/index.js +4 -0
  62. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
  63. package/es/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +5 -0
  64. package/es/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
  65. package/es/components/dataSourceComponents/fields/Input.Email/WithMode.js +17 -0
  66. package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
  67. package/es/components/dataSourceComponents/fields/Input.Email/index.js +4 -0
  68. package/es/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
  69. package/es/components/dataSourceComponents/fields/Input.Email/type.js +1 -0
  70. package/es/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
  71. package/es/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
  72. package/es/components/dataSourceComponents/fields/Input.Json/WithMode.js +41 -1
  73. package/es/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
  74. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
  75. package/es/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +5 -0
  76. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
  77. package/es/components/dataSourceComponents/fields/Input.Phone/WithMode.js +12 -0
  78. package/es/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
  79. package/es/components/dataSourceComponents/fields/Input.Phone/index.js +4 -0
  80. package/es/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
  81. package/es/components/dataSourceComponents/fields/Input.Phone/type.js +1 -0
  82. package/es/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
  83. package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  84. package/es/components/dataSourceComponents/fields/index.d.ts +46 -5
  85. package/es/components/dataSourceComponents/fields/index.js +7 -2
  86. package/es/components/dataSourceComponents/fields/type.d.ts +18 -0
  87. package/es/components/dataSourceComponents/fields/type.js +1 -0
  88. package/es/components/dataSourceComponents/fields/utils.d.ts +3 -0
  89. package/es/components/dataSourceComponents/fields/utils.js +111 -0
  90. package/es/components/dataSourceComponents/hooks/useActions.js +22 -7
  91. package/es/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
  92. package/es/components/dataSourceComponents/hooks/useComponentId.js +9 -0
  93. package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
  94. package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
  95. package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +37 -27
  96. package/es/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
  97. package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +19 -13
  98. package/es/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
  99. package/es/components/dataSourceComponents/provider/variables/utils.js +9 -0
  100. package/es/components/filter/components/Dropdown/index.d.ts +1 -0
  101. package/es/components/filter/components/Dropdown/index.js +6 -2
  102. package/es/components/filter/components/FilterButton/index.js +5 -3
  103. package/es/components/filter/components/FilterButton/types.d.ts +2 -0
  104. package/es/components/table/Actions/index.js +16 -7
  105. package/es/components/table/Gallery/index.d.ts +3 -3
  106. package/es/components/table/Gallery/index.js +25 -7
  107. package/es/components/table/Gallery/index.less +1 -0
  108. package/es/components/table/Header/index.d.ts +10 -3
  109. package/es/components/table/Header/index.js +37 -11
  110. package/es/components/table/Header/index.less +10 -2
  111. package/es/components/table/Table/utils.js +4 -0
  112. package/es/components/table/Tabs/index.d.ts +14 -0
  113. package/es/components/table/Tabs/index.js +37 -0
  114. package/es/components/table/hooks/useTriggerValuesChange.js +3 -0
  115. package/es/components/table/index.js +16 -3
  116. package/es/components/table/types.d.ts +14 -2
  117. package/es/components/typography/index.d.ts +2 -2
  118. package/es/components/typography/index.js +4 -3
  119. package/es/index.d.ts +4 -0
  120. package/es/index.js +5 -1
  121. package/es/locales/en-US.d.ts +7 -0
  122. package/es/locales/en-US.js +16 -1
  123. package/es/locales/zh-CN.d.ts +7 -0
  124. package/es/locales/zh-CN.js +16 -1
  125. package/es/locales/zh-TW.d.ts +7 -0
  126. package/es/locales/zh-TW.js +16 -1
  127. package/lib/components/dataSourceComponents/dataSourceForm/index.less +1 -1
  128. package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +1 -0
  129. package/lib/components/dataSourceComponents/dataSourceForm/serve.js +3 -2
  130. package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +2 -2
  131. package/lib/components/dataSourceComponents/dataSourceForm/utils.js +58 -11
  132. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.d.ts +3 -0
  133. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.js +38 -0
  134. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +3 -0
  135. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.js +38 -0
  136. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.d.ts +10 -0
  137. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.js +44 -0
  138. package/lib/components/dataSourceComponents/dataSourceShow/utils.d.ts +6 -0
  139. package/lib/components/dataSourceComponents/dataSourceShow/utils.js +95 -0
  140. package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +29 -90
  141. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +25 -0
  142. package/lib/components/dataSourceComponents/dataSourceTable/filter/index.js +176 -0
  143. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +8 -0
  144. package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.js +176 -0
  145. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.d.ts +2 -2
  146. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDataSourceKey.js +1 -1
  147. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDesignMode.js +24 -37
  148. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +20 -4
  149. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.js +53 -7
  150. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.d.ts +17 -1
  151. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +73 -3
  152. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +77 -0
  153. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +236 -0
  154. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +20 -7
  155. package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +38 -11
  156. package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +1 -0
  157. package/lib/components/dataSourceComponents/dataSourceTable/index.js +1 -0
  158. package/lib/components/dataSourceComponents/dataSourceTable/index.less +5 -0
  159. package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +57 -9
  160. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.d.ts +7 -0
  161. package/lib/components/dataSourceComponents/dataSourceWrapper/BaseWrapper.js +51 -0
  162. package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +2 -4
  163. package/lib/components/dataSourceComponents/dataSourceWrapper/index.js +14 -2
  164. package/lib/components/dataSourceComponents/fields/Checkbox/ReadPretty.js +3 -1
  165. package/lib/components/dataSourceComponents/fields/Checkbox/index.js +3 -1
  166. package/lib/components/dataSourceComponents/fields/DatePicker/index.js +5 -1
  167. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.d.ts +4 -0
  168. package/lib/components/dataSourceComponents/fields/DateRangePicker/ReadPretty.js +41 -0
  169. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.d.ts +4 -0
  170. package/lib/components/dataSourceComponents/fields/DateRangePicker/WithMode.js +42 -0
  171. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.d.ts +4 -0
  172. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.js +39 -0
  173. package/lib/components/dataSourceComponents/fields/DateRangePicker/index.less +14 -0
  174. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.d.ts +4 -0
  175. package/lib/components/dataSourceComponents/fields/DateRangePicker/type.js +17 -0
  176. package/lib/components/dataSourceComponents/fields/Input/index.d.ts +6 -1
  177. package/lib/components/dataSourceComponents/fields/Input/index.js +4 -0
  178. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.d.ts +4 -0
  179. package/lib/components/dataSourceComponents/fields/Input.Email/ReadPretty.js +39 -0
  180. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +4 -0
  181. package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +57 -0
  182. package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -0
  183. package/lib/components/dataSourceComponents/fields/Input.Email/index.js +38 -0
  184. package/lib/components/dataSourceComponents/fields/Input.Email/type.d.ts +5 -0
  185. package/lib/components/dataSourceComponents/fields/Input.Email/type.js +17 -0
  186. package/lib/components/dataSourceComponents/fields/Input.Json/ReadPretty.js +2 -2
  187. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.d.ts +2 -2
  188. package/lib/components/dataSourceComponents/fields/Input.Json/WithMode.js +30 -2
  189. package/lib/components/dataSourceComponents/fields/Input.Json/index.d.ts +1 -1
  190. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.d.ts +4 -0
  191. package/lib/components/dataSourceComponents/fields/Input.Phone/ReadPretty.js +39 -0
  192. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.d.ts +4 -0
  193. package/lib/components/dataSourceComponents/fields/Input.Phone/WithMode.js +43 -0
  194. package/lib/components/dataSourceComponents/fields/Input.Phone/index.d.ts +3 -0
  195. package/lib/components/dataSourceComponents/fields/Input.Phone/index.js +38 -0
  196. package/lib/components/dataSourceComponents/fields/Input.Phone/type.d.ts +5 -0
  197. package/lib/components/dataSourceComponents/fields/Input.Phone/type.js +17 -0
  198. package/lib/components/dataSourceComponents/fields/InputNumber/index.js +5 -1
  199. package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -1
  200. package/lib/components/dataSourceComponents/fields/index.d.ts +46 -5
  201. package/lib/components/dataSourceComponents/fields/index.js +6 -1
  202. package/lib/components/dataSourceComponents/fields/type.d.ts +18 -0
  203. package/lib/components/dataSourceComponents/fields/type.js +17 -0
  204. package/lib/components/dataSourceComponents/fields/utils.d.ts +3 -0
  205. package/lib/components/dataSourceComponents/fields/utils.js +134 -0
  206. package/lib/components/dataSourceComponents/hooks/useActions.js +14 -5
  207. package/lib/components/dataSourceComponents/hooks/useComponentId.d.ts +2 -0
  208. package/lib/components/dataSourceComponents/hooks/useComponentId.js +32 -0
  209. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +19 -2
  210. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.d.ts +1 -1
  211. package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +29 -16
  212. package/lib/components/dataSourceComponents/provider/variables/VariablesContext.d.ts +3 -2
  213. package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +17 -8
  214. package/lib/components/dataSourceComponents/provider/variables/utils.d.ts +2 -0
  215. package/lib/components/dataSourceComponents/provider/variables/utils.js +15 -2
  216. package/lib/components/filter/components/Dropdown/index.d.ts +1 -0
  217. package/lib/components/filter/components/Dropdown/index.js +6 -2
  218. package/lib/components/filter/components/FilterButton/index.js +5 -3
  219. package/lib/components/filter/components/FilterButton/types.d.ts +2 -0
  220. package/lib/components/table/Actions/index.js +18 -9
  221. package/lib/components/table/Gallery/index.d.ts +3 -3
  222. package/lib/components/table/Gallery/index.js +17 -0
  223. package/lib/components/table/Gallery/index.less +1 -0
  224. package/lib/components/table/Header/index.d.ts +10 -3
  225. package/lib/components/table/Header/index.js +29 -4
  226. package/lib/components/table/Header/index.less +10 -2
  227. package/lib/components/table/Table/utils.js +4 -0
  228. package/lib/components/table/Tabs/index.d.ts +14 -0
  229. package/lib/components/table/Tabs/index.js +70 -0
  230. package/lib/components/table/hooks/useTriggerValuesChange.js +3 -0
  231. package/lib/components/table/index.js +17 -2
  232. package/lib/components/table/types.d.ts +14 -2
  233. package/lib/components/typography/index.d.ts +2 -2
  234. package/lib/components/typography/index.js +4 -3
  235. package/lib/index.d.ts +4 -0
  236. package/lib/index.js +12 -0
  237. package/lib/locales/en-US.d.ts +7 -0
  238. package/lib/locales/en-US.js +8 -1
  239. package/lib/locales/zh-CN.d.ts +7 -0
  240. package/lib/locales/zh-CN.js +8 -1
  241. package/lib/locales/zh-TW.d.ts +7 -0
  242. package/lib/locales/zh-TW.js +8 -1
  243. package/lowcode/_utils/defaultSchema.ts +452 -83
  244. package/lowcode/_utils/type.ts +5 -0
  245. package/lowcode/_utils/utils.ts +1 -0
  246. package/lowcode/button/meta.ts +1 -2
  247. package/lowcode/data-source-form/constants.ts +5 -0
  248. package/lowcode/data-source-form/meta.ts +259 -273
  249. package/lowcode/data-source-form/snippets.ts +9 -0
  250. package/lowcode/data-source-form/utils.ts +80 -15
  251. package/lowcode/data-source-image/meta.ts +74 -0
  252. package/lowcode/data-source-image/snippets.ts +14 -0
  253. package/lowcode/data-source-qrcode/meta.ts +158 -0
  254. package/lowcode/data-source-qrcode/snippets.ts +20 -0
  255. package/lowcode/data-source-table/meta.ts +4577 -2285
  256. package/lowcode/data-source-table/snippets.ts +10 -4
  257. package/lowcode/data-source-table/utils.tsx +254 -0
  258. package/lowcode/data-source-typography/meta.ts +54 -0
  259. package/lowcode/data-source-typography.text/meta.ts +212 -0
  260. package/lowcode/data-source-typography.text/snippets.ts +12 -0
  261. package/lowcode/data-source-wrapper/meta.ts +243 -0
  262. package/lowcode/data-source-wrapper/snippets.ts +11 -0
  263. package/lowcode/data-source-wrapper/utils.ts +45 -0
  264. package/lowcode/form-item-color-picker/snippets.ts +1 -0
  265. package/lowcode/form-item-input/meta.ts +2 -1
  266. package/lowcode/form-item-input/snippets.ts +2 -1
  267. package/lowcode/form-item-input.email/meta.ts +284 -0
  268. package/lowcode/form-item-input.email/snippets.ts +35 -0
  269. package/lowcode/form-item-input.phone/meta.ts +295 -0
  270. package/lowcode/form-item-input.phone/snippets.ts +16 -0
  271. package/lowcode/form-item-input.text-area/meta.ts +243 -32
  272. package/lowcode/form-item-input.text-area/snippets.ts +2 -1
  273. package/lowcode/form-item-input.url/meta.ts +44 -20
  274. package/lowcode/form-item-input.url/snippets.ts +5 -5
  275. package/lowcode/table/snippets.ts +6 -0
  276. package/lowcode/test/meta.ts +1 -2
  277. package/package.json +2 -2
@@ -43,6 +43,7 @@ module.exports = __toCommonJS(utils_exports);
43
43
  var import_react = __toESM(require("react"));
44
44
  var import_utils = require("@pisell/utils");
45
45
  var import_antd = require("antd");
46
+ var import_locales = require("../../../locales");
46
47
  var import_form = __toESM(require("../../form"));
47
48
  var import_useDataSource = __toESM(require("../hooks/useDataSource"));
48
49
  var import_useFormSetting = __toESM(require("./provider/hooks/useFormSetting"));
@@ -81,7 +82,7 @@ var formItemNameReplace = (name) => {
81
82
  var formItemNameReverse = (name) => {
82
83
  return name.replace(new RegExp(FORM_ITEM_SPLIT_CHAR, "g"), ".");
83
84
  };
84
- var withFormItem = (WrappedComponent) => {
85
+ var withFormItem = (WrappedComponent, otherFormItemProps) => {
85
86
  return ({
86
87
  name: propsName,
87
88
  label: propsLabel,
@@ -100,7 +101,10 @@ var withFormItem = (WrappedComponent) => {
100
101
  getValueProps,
101
102
  validator,
102
103
  style,
104
+ validateTrigger,
103
105
  __designMode,
106
+ labelCol,
107
+ innerStyle,
104
108
  ...otherProps
105
109
  }) => {
106
110
  var _a;
@@ -112,30 +116,70 @@ var withFormItem = (WrappedComponent) => {
112
116
  const label = propsLabel || ((_a = field == null ? void 0 : field.uiSchema) == null ? void 0 : _a.title) || propsName;
113
117
  const effectiveMode = propsMode || globalMode;
114
118
  const renderComponent = (0, import_react.useMemo)(() => {
115
- return /* @__PURE__ */ import_react.default.createElement(WrappedComponent, { ...otherProps, renderMode: effectiveMode });
116
- }, [effectiveMode, otherProps]);
119
+ return /* @__PURE__ */ import_react.default.createElement(
120
+ WrappedComponent,
121
+ {
122
+ ...otherProps,
123
+ mode: propsMode,
124
+ renderMode: effectiveMode,
125
+ style: {
126
+ ...(otherFormItemProps == null ? void 0 : otherFormItemProps.innerStyle) || {},
127
+ ...innerStyle
128
+ }
129
+ }
130
+ );
131
+ }, [effectiveMode, otherProps, propsMode, innerStyle, otherFormItemProps == null ? void 0 : otherFormItemProps.innerStyle]);
117
132
  const isDesignMode = __designMode === "design";
118
133
  const isHidden = effectiveMode === "hidden";
119
134
  const name = (0, import_utils.isString)(propsName) && propsName.includes(".") ? [propsName] : propsName;
120
135
  const concatName = name !== void 0 ? [...prefixPath, ...toArr(name)] : void 0;
121
136
  const rules = [];
122
137
  if (requiredobj && requiredobj.required) {
123
- rules.push(requiredobj);
138
+ rules.push({
139
+ ...requiredobj,
140
+ message: requiredobj.message || (0, import_locales.getText)("pisell-data-source-form-required-message")
141
+ });
124
142
  }
125
143
  if (typeobj && typeobj.enabled) {
126
- rules.push(typeobj);
144
+ if (typeobj.type === "email") {
145
+ rules.push({
146
+ ...typeobj,
147
+ message: typeobj.message || (0, import_locales.getText)("pisell-data-source-form-email-message")
148
+ });
149
+ } else {
150
+ rules.push({
151
+ ...typeobj,
152
+ message: typeobj.message || (0, import_locales.getText)("pisell-data-source-form-type-message")(typeobj == null ? void 0 : typeobj.type)
153
+ });
154
+ }
127
155
  }
128
156
  if (maxLengthobj && maxLengthobj.enabled) {
129
- rules.push(maxLengthobj);
157
+ rules.push({
158
+ ...maxLengthobj,
159
+ message: maxLengthobj.message || (0, import_locales.getText)("pisell-data-source-form-max-length-message")(
160
+ maxLengthobj == null ? void 0 : maxLengthobj.max
161
+ )
162
+ });
130
163
  }
131
164
  if (minLengthobj && minLengthobj.enabled) {
132
- rules.push(minLengthobj);
165
+ rules.push({
166
+ ...minLengthobj,
167
+ message: minLengthobj.message || (0, import_locales.getText)("pisell-data-source-form-min-length-message")(
168
+ minLengthobj == null ? void 0 : minLengthobj.min
169
+ )
170
+ });
133
171
  }
134
172
  if (maxobj && maxobj.enabled) {
135
- rules.push(maxobj);
173
+ rules.push({
174
+ ...maxobj,
175
+ message: maxobj.message || (0, import_locales.getText)("pisell-data-source-form-max-value-message")(maxobj == null ? void 0 : maxobj.max)
176
+ });
136
177
  }
137
178
  if (minobj && minobj.enabled) {
138
- rules.push(minobj);
179
+ rules.push({
180
+ ...minobj,
181
+ message: minobj.message || (0, import_locales.getText)("pisell-data-source-form-min-value-message")(minobj == null ? void 0 : minobj.min)
182
+ });
139
183
  }
140
184
  return /* @__PURE__ */ import_react.default.createElement(
141
185
  import_form.default.Item,
@@ -155,7 +199,10 @@ var withFormItem = (WrappedComponent) => {
155
199
  rules,
156
200
  normalize,
157
201
  getValueProps,
158
- validator
202
+ validator,
203
+ validateTrigger,
204
+ labelCol,
205
+ ...otherFormItemProps
159
206
  },
160
207
  renderComponent
161
208
  );
@@ -195,7 +242,7 @@ var withOptions = (WrappedComponent) => {
195
242
  value: item[valueField]
196
243
  }))) || [];
197
244
  }, [propsOptions, optionSourceType, (_a = list == null ? void 0 : list.data) == null ? void 0 : _a.data]);
198
- return /* @__PURE__ */ import_react.default.createElement(import_DataSourceProvider.default, { dataSource: options }, /* @__PURE__ */ import_react.default.createElement(WrappedComponent, { ...props, options }));
245
+ return /* @__PURE__ */ import_react.default.createElement(WrappedComponent, { ...props, options });
199
246
  };
200
247
  };
201
248
  var getNestedValue = (obj, path) => {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DataSourceImage: (props: import("../utils").ParsedProps) => React.JSX.Element;
3
+ export default DataSourceImage;
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/dataSourceShow/dataSourceImage/index.tsx
30
+ var dataSourceImage_exports = {};
31
+ __export(dataSourceImage_exports, {
32
+ default: () => dataSourceImage_default
33
+ });
34
+ module.exports = __toCommonJS(dataSourceImage_exports);
35
+ var import_antd = require("antd");
36
+ var import_utils = __toESM(require("../utils"));
37
+ var DataSourceImage = (0, import_utils.default)(import_antd.Image, ["src"]);
38
+ var dataSourceImage_default = DataSourceImage;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const DataSourceQRCode: (props: any) => import("react").JSX.Element;
3
+ export default DataSourceQRCode;
@@ -0,0 +1,38 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.tsx
30
+ var dataSourceQRCode_exports = {};
31
+ __export(dataSourceQRCode_exports, {
32
+ default: () => dataSourceQRCode_default
33
+ });
34
+ module.exports = __toCommonJS(dataSourceQRCode_exports);
35
+ var import_qrcode = __toESM(require("../../../qrcode"));
36
+ var import_utils = __toESM(require("../utils"));
37
+ var DataSourceQRCode = (0, import_utils.default)(import_qrcode.default, ["value"]);
38
+ var dataSourceQRCode_default = DataSourceQRCode;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface DataSourceTypographyProps {
3
+ dataSourceKey: string;
4
+ children: React.ReactNode;
5
+ }
6
+ declare const DataSourceTypography: {
7
+ (props: DataSourceTypographyProps): React.JSX.Element;
8
+ Text: (props: import("../utils").ParsedProps) => React.JSX.Element;
9
+ };
10
+ export default DataSourceTypography;
@@ -0,0 +1,44 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/dataSourceShow/dataSourceTypography/index.tsx
30
+ var dataSourceTypography_exports = {};
31
+ __export(dataSourceTypography_exports, {
32
+ default: () => dataSourceTypography_default
33
+ });
34
+ module.exports = __toCommonJS(dataSourceTypography_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_typography = __toESM(require("../../../typography"));
37
+ var import_utils = __toESM(require("../utils"));
38
+ var DataSourceTypography = (props) => {
39
+ const { children, dataSourceKey, ...rest } = props;
40
+ return /* @__PURE__ */ import_react.default.createElement(import_typography.default, { ...rest }, children);
41
+ };
42
+ var Text = (0, import_utils.default)(import_typography.default.Text, ["children"]);
43
+ DataSourceTypography.Text = Text;
44
+ var dataSourceTypography_default = DataSourceTypography;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface ParsedProps {
3
+ [key: string]: unknown;
4
+ }
5
+ declare const withParseVariables: <P extends ParsedProps>(Component: React.ComponentType<P>, keys: string[]) => (props: P) => React.JSX.Element;
6
+ export default withParseVariables;
@@ -0,0 +1,95 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/dataSourceComponents/dataSourceShow/utils.tsx
30
+ var utils_exports = {};
31
+ __export(utils_exports, {
32
+ default: () => utils_default
33
+ });
34
+ module.exports = __toCommonJS(utils_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var import_ahooks = require("ahooks");
38
+ var import_utils2 = require("../provider/variables/utils");
39
+ var import_useVariables = __toESM(require("../hooks/useVariables"));
40
+ var parseValueToVariableKey = (value) => {
41
+ if ((0, import_utils.isArr)(value) && value.length === 1 && (0, import_utils.isString)(value[0])) {
42
+ const key = (0, import_utils2.getVariableKey)(value[0]);
43
+ return key ? key.split(".")[0] : null;
44
+ }
45
+ if ((0, import_utils.isString)(value)) {
46
+ const key = (0, import_utils2.getVariableKey)(value);
47
+ return key ? key.split(".")[0] : null;
48
+ }
49
+ return null;
50
+ };
51
+ var withParseVariables = (Component, keys) => {
52
+ return (props) => {
53
+ const [variables, setVariables] = (0, import_react.useState)({});
54
+ const { parseVariable, subscribeVariables } = (0, import_useVariables.default)();
55
+ const valuesRef = (0, import_react.useRef)(/* @__PURE__ */ new Set());
56
+ const handleVariableChange = (0, import_ahooks.useMemoizedFn)(
57
+ (allVariables, updateVariables) => {
58
+ const changedKey = Object.keys(updateVariables)[0];
59
+ if (valuesRef.current.has(changedKey)) {
60
+ setVariables((prev) => ({ ...prev, ...allVariables }));
61
+ }
62
+ }
63
+ );
64
+ (0, import_react.useEffect)(() => {
65
+ const values = /* @__PURE__ */ new Set();
66
+ keys.forEach((key) => {
67
+ const variableKey = parseValueToVariableKey(props[key]);
68
+ if (variableKey) {
69
+ values.add(variableKey);
70
+ }
71
+ });
72
+ valuesRef.current = values;
73
+ }, [props, keys]);
74
+ (0, import_react.useEffect)(() => {
75
+ const unsubscribe = subscribeVariables == null ? void 0 : subscribeVariables(handleVariableChange);
76
+ return () => {
77
+ unsubscribe == null ? void 0 : unsubscribe();
78
+ };
79
+ }, []);
80
+ const parsedProps = (0, import_react.useMemo)(() => {
81
+ const result = { ...props };
82
+ keys.forEach((key) => {
83
+ const value = props[key];
84
+ if ((0, import_utils.isArr)(value) && value.length === 1 && (0, import_utils.isString)(value[0])) {
85
+ result[key] = parseVariable == null ? void 0 : parseVariable(value[0], variables);
86
+ } else if ((0, import_utils.isString)(value)) {
87
+ result[key] = parseVariable == null ? void 0 : parseVariable(value, variables);
88
+ }
89
+ });
90
+ return result;
91
+ }, [props, variables, keys]);
92
+ return /* @__PURE__ */ import_react.default.createElement(Component, { ...parsedProps });
93
+ };
94
+ };
95
+ var utils_default = withParseVariables;
@@ -33,58 +33,47 @@ __export(BaseTable_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(BaseTable_exports);
35
35
  var import_react = __toESM(require("react"));
36
- var import_antd = require("antd");
36
+ var import_ahooks = require("ahooks");
37
37
  var import_table = __toESM(require("../../table"));
38
38
  var import_useVariables = __toESM(require("../hooks/useVariables"));
39
- var import_useColumns = __toESM(require("./hooks/useColumns"));
40
- var import_usePagination = __toESM(require("./hooks/usePagination"));
41
39
  var import_ActionsProvider = __toESM(require("../provider/actions/ActionsProvider"));
42
40
  var import_useDrawerState = __toESM(require("./hooks/useDrawerState"));
43
41
  var import_useDesignMode = __toESM(require("./hooks/useDesignMode"));
42
+ var import_useComponentId = __toESM(require("../hooks/useComponentId"));
44
43
  var import_useTableQuery = __toESM(require("./hooks/useTableQuery"));
45
- var import_locales = require("../../../locales");
46
44
  var import_useDataSource = __toESM(require("../hooks/useDataSource"));
47
45
  var import_TableSettingProvider = __toESM(require("./provider/tableSetting/TableSettingProvider"));
48
46
  var import_useDataSourceKey = __toESM(require("./hooks/useDataSourceKey"));
49
- var DRAWER_TITLES = {
50
- detail: (0, import_locales.getText)("pisell-data-source-table-detail"),
51
- edit: (0, import_locales.getText)("pisell-data-source-table-edit"),
52
- add: (0, import_locales.getText)("pisell-data-source-table-add")
53
- };
47
+ var import_useTableProps = __toESM(require("./hooks/useTableProps"));
54
48
  var BaseTable = (props) => {
55
49
  const {
56
50
  columns: propsColumns,
57
51
  dataSource,
58
- detailContent,
59
- editContent,
60
- showDetailButton,
61
- showEditButton,
62
- showDeleteButton,
63
- showAddButton,
64
- addContent,
65
- __designMode,
66
- componentId,
52
+ operationContent,
67
53
  ...others
68
54
  } = props;
55
+ const componentId = (0, import_useComponentId.default)(props);
69
56
  const { registerValueVariable } = (0, import_useVariables.default)();
70
- const { list, destroy } = (0, import_useDataSource.default)();
57
+ const { list } = (0, import_useDataSource.default)();
71
58
  const { data } = list;
72
59
  const { dataSourceKey, dataSourceKeyRef } = (0, import_useDataSourceKey.default)();
73
60
  const {
74
61
  drawerVisible,
75
62
  setDrawerVisible,
76
- drawerType,
77
63
  openDrawer,
78
- closeDrawer
79
- } = (0, import_useDrawerState.default)();
80
- const { queryPageConfig, handleValuesChange, refreshData } = (0, import_useTableQuery.default)();
64
+ closeDrawer,
65
+ containerProps,
66
+ Container,
67
+ drawerContent
68
+ } = (0, import_useDrawerState.default)(operationContent);
69
+ const { queryPageConfig, handleValuesChange, refreshData, handleFilterChange } = (0, import_useTableQuery.default)(props);
81
70
  (0, import_useDesignMode.default)(props, {
82
71
  registerValueVariable,
83
72
  openDrawer,
84
73
  closeDrawer,
85
74
  data: data == null ? void 0 : data.data
86
75
  });
87
- (0, import_react.useEffect)(() => {
76
+ (0, import_ahooks.useUpdateEffect)(() => {
88
77
  refreshData();
89
78
  }, [dataSourceKey]);
90
79
  (0, import_react.useEffect)(() => {
@@ -94,84 +83,33 @@ var BaseTable = (props) => {
94
83
  list == null ? void 0 : list.mutate([]);
95
84
  }
96
85
  }, [queryPageConfig]);
97
- const handleOpenDrawer = (record, type) => {
86
+ (0, import_react.useEffect)(() => {
98
87
  registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
99
- currentRecord: record
88
+ currentDataSource: dataSource
100
89
  });
101
- openDrawer(type);
102
- };
90
+ }, [dataSource]);
103
91
  const handleCloseDrawer = () => {
104
92
  closeDrawer();
105
93
  registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
106
94
  currentRecord: null
107
95
  });
108
96
  };
109
- const handleDelete = async (record) => {
110
- try {
111
- registerValueVariable == null ? void 0 : registerValueVariable(componentId, {
112
- currentRecord: record
113
- });
114
- setTimeout(async () => {
115
- await (destroy == null ? void 0 : destroy.run(record.id));
116
- refreshData();
117
- });
118
- } catch (error) {
119
- console.error(error);
120
- import_antd.message.error("删除失败,请重试");
121
- }
122
- };
123
- const actionsColumns = (0, import_react.useMemo)(() => {
124
- return [
125
- {
126
- title: "操作",
127
- key: "actions",
128
- showDetailButton,
129
- showEditButton,
130
- showDeleteButton,
131
- render: (_, record) => {
132
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Space, null, showDetailButton && /* @__PURE__ */ import_react.default.createElement(
133
- import_antd.Button,
134
- {
135
- onClick: () => handleOpenDrawer(record, "detail"),
136
- type: "link"
137
- },
138
- (0, import_locales.getText)("pisell-data-source-table-detail")
139
- ), showEditButton && /* @__PURE__ */ import_react.default.createElement(
140
- import_antd.Button,
141
- {
142
- onClick: () => handleOpenDrawer(record, "edit"),
143
- type: "link"
144
- },
145
- (0, import_locales.getText)("pisell-data-source-table-edit")
146
- ), showDeleteButton && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: () => handleDelete(record), type: "link", danger: true }, (0, import_locales.getText)("pisell-data-source-table-delete")));
147
- }
148
- }
149
- ];
150
- }, [showDetailButton, showEditButton, showDeleteButton]);
151
- const columns = (0, import_useColumns.default)({
152
- columns: propsColumns,
153
- fields: dataSource == null ? void 0 : dataSource.fields,
154
- // 操作列
155
- actionsColumns
97
+ const transformProps = (0, import_useTableProps.default)({
98
+ data,
99
+ originProps: props,
100
+ openDrawer,
101
+ closeDrawer,
102
+ refreshData,
103
+ handleFilterChange
156
104
  });
157
- const pagination = (0, import_usePagination.default)({ data });
158
- const drawerContent = (0, import_react.useMemo)(() => {
159
- const contentMap = {
160
- detail: detailContent,
161
- edit: editContent,
162
- add: addContent
163
- };
164
- return contentMap[drawerType];
165
- }, [drawerType, detailContent, editContent, addContent]);
166
- return /* @__PURE__ */ import_react.default.createElement(import_TableSettingProvider.default, null, showAddButton && /* @__PURE__ */ import_react.default.createElement("div", { style: { marginBottom: 16 } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "primary", onClick: () => handleOpenDrawer(null, "add") }, (0, import_locales.getText)("pisell-data-source-table-add"))), /* @__PURE__ */ import_react.default.createElement(
105
+ return /* @__PURE__ */ import_react.default.createElement(import_TableSettingProvider.default, null, /* @__PURE__ */ import_react.default.createElement(
167
106
  import_table.default,
168
107
  {
169
108
  ...others,
170
- columns,
109
+ ...transformProps,
171
110
  dataSource: (data == null ? void 0 : data.data) || [],
172
111
  loading: list == null ? void 0 : list.loading,
173
- onValuesChange: handleValuesChange,
174
- pagination
112
+ onValuesChange: handleValuesChange
175
113
  }
176
114
  ), /* @__PURE__ */ import_react.default.createElement(
177
115
  import_ActionsProvider.default,
@@ -181,11 +119,12 @@ var BaseTable = (props) => {
181
119
  refreshTableData: refreshData
182
120
  },
183
121
  /* @__PURE__ */ import_react.default.createElement(
184
- import_antd.Drawer,
122
+ Container,
185
123
  {
186
- title: DRAWER_TITLES[drawerType],
124
+ ...containerProps,
187
125
  open: drawerVisible,
188
126
  onClose: handleCloseDrawer,
127
+ onCancel: handleCloseDrawer,
189
128
  destroyOnClose: true
190
129
  },
191
130
  drawerContent
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ interface BaseFilterItem {
3
+ name?: string;
4
+ value: string;
5
+ label?: string;
6
+ type?: string;
7
+ isHidden: boolean;
8
+ isCustom?: boolean;
9
+ }
10
+ interface FilterProps {
11
+ componentId: string;
12
+ filterBy: Record<string, any>;
13
+ quickFilterMaxLength?: number;
14
+ sortButtonShow?: boolean;
15
+ mode?: 'simple' | 'complex';
16
+ items: BaseFilterItem[];
17
+ handleValuesChange: (changedFields: any, allFields: any) => void;
18
+ search: {
19
+ show: boolean;
20
+ placeholder: string;
21
+ key: string;
22
+ };
23
+ }
24
+ declare const Filter: (props: FilterProps) => React.JSX.Element;
25
+ export default Filter;