amis-core 6.0.0 → 6.2.0

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 (307) hide show
  1. package/esm/Root.js +2 -2
  2. package/esm/RootRenderer.js +4 -3
  3. package/esm/SchemaRenderer.js +5 -2
  4. package/esm/Scoped.d.ts +6 -0
  5. package/esm/Scoped.js +47 -8
  6. package/esm/StatusScoped.js +2 -2
  7. package/esm/WithRootStore.js +2 -2
  8. package/esm/WithStore.js +4 -6
  9. package/esm/actions/Action.js +2 -2
  10. package/esm/actions/AjaxAction.js +2 -2
  11. package/esm/actions/BreakAction.js +2 -2
  12. package/esm/actions/BroadcastAction.js +2 -2
  13. package/esm/actions/CmptAction.js +2 -2
  14. package/esm/actions/ContinueAction.js +2 -2
  15. package/esm/actions/CopyAction.js +2 -2
  16. package/esm/actions/CustomAction.js +3 -3
  17. package/esm/actions/DialogAction.js +2 -2
  18. package/esm/actions/DrawerAction.js +2 -2
  19. package/esm/actions/EmailAction.js +2 -2
  20. package/esm/actions/LinkAction.js +10 -5
  21. package/esm/actions/LoopAction.js +2 -2
  22. package/esm/actions/PageAction.js +2 -2
  23. package/esm/actions/ParallelAction.js +2 -2
  24. package/esm/actions/PrintAction.d.ts +19 -0
  25. package/esm/actions/PrintAction.js +49 -0
  26. package/esm/actions/StatusAction.js +2 -2
  27. package/esm/actions/SwitchAction.js +2 -2
  28. package/esm/actions/ToastAction.js +2 -2
  29. package/esm/actions/index.d.ts +1 -0
  30. package/esm/components/CustomStyle.d.ts +1 -2
  31. package/esm/components/CustomStyle.js +20 -7
  32. package/esm/components/ErrorBoundary.js +2 -2
  33. package/esm/components/LazyComponent.js +2 -2
  34. package/esm/components/Overlay.js +11 -9
  35. package/esm/components/PopOver.js +7 -5
  36. package/esm/env.d.ts +4 -0
  37. package/esm/env.js +2 -2
  38. package/esm/envOverwrite.js +2 -2
  39. package/esm/factory.js +15 -2
  40. package/esm/index.d.ts +3 -2
  41. package/esm/index.js +16 -9
  42. package/esm/locale.js +2 -2
  43. package/esm/polyfills.js +2 -2
  44. package/esm/renderers/Form.d.ts +4 -3
  45. package/esm/renderers/Form.js +97 -45
  46. package/esm/renderers/Item.d.ts +1 -0
  47. package/esm/renderers/Item.js +15 -16
  48. package/esm/renderers/Options.d.ts +5 -0
  49. package/esm/renderers/Options.js +27 -10
  50. package/esm/renderers/Placeholder.js +2 -2
  51. package/esm/renderers/builtin.js +2 -2
  52. package/esm/renderers/register.js +2 -2
  53. package/esm/renderers/wrapControl.js +37 -29
  54. package/esm/store/app.js +3 -3
  55. package/esm/store/combo.d.ts +48 -24
  56. package/esm/store/combo.js +2 -2
  57. package/esm/store/crud.js +2 -2
  58. package/esm/store/form.d.ts +20 -10
  59. package/esm/store/form.js +2 -2
  60. package/esm/store/formItem.d.ts +2 -1
  61. package/esm/store/formItem.js +4 -3
  62. package/esm/store/iRenderer.js +5 -3
  63. package/esm/store/index.js +2 -2
  64. package/esm/store/list.d.ts +11 -0
  65. package/esm/store/list.js +9 -2
  66. package/esm/store/manager.js +2 -2
  67. package/esm/store/modal.js +2 -2
  68. package/esm/store/node.js +2 -2
  69. package/esm/store/pagination.js +2 -2
  70. package/esm/store/root.js +3 -3
  71. package/esm/store/service.js +6 -3
  72. package/esm/store/status.js +2 -2
  73. package/esm/store/table.d.ts +70 -47
  74. package/esm/store/table.js +40 -24
  75. package/esm/store/table2.js +2 -2
  76. package/esm/theme.js +2 -2
  77. package/esm/utils/Animation.js +2 -2
  78. package/esm/utils/ColorScale.js +2 -2
  79. package/esm/utils/DataSchema.js +2 -2
  80. package/esm/utils/DataScope.js +2 -2
  81. package/esm/utils/RootClose.js +2 -2
  82. package/esm/utils/SimpleMap.js +2 -2
  83. package/esm/utils/api.js +4 -3
  84. package/esm/utils/arraySlice.js +2 -2
  85. package/esm/utils/attachmentAdpator.js +4 -3
  86. package/esm/utils/autobind.js +2 -2
  87. package/esm/utils/browser.d.ts +1 -0
  88. package/esm/utils/browser.js +8 -3
  89. package/esm/utils/columnsSplit.js +2 -2
  90. package/esm/utils/concatData.js +2 -2
  91. package/esm/utils/dataMapping.js +2 -2
  92. package/esm/utils/date.js +2 -2
  93. package/esm/utils/debug.js +2 -2
  94. package/esm/utils/decodeEntity.js +2 -2
  95. package/esm/utils/dom.js +8 -3
  96. package/esm/utils/errors.js +2 -2
  97. package/esm/utils/escapeHtml.js +2 -2
  98. package/esm/utils/filter-schema.js +2 -2
  99. package/esm/utils/filter.js +2 -2
  100. package/esm/utils/formatDuration.js +2 -2
  101. package/esm/utils/formula.js +2 -2
  102. package/esm/utils/getVariable.js +2 -2
  103. package/esm/utils/grammar.js +2 -2
  104. package/esm/utils/handleAction.js +2 -2
  105. package/esm/utils/helper.d.ts +8 -1
  106. package/esm/utils/helper.js +28 -10
  107. package/esm/utils/highlight.js +4 -3
  108. package/esm/utils/icon.js +2 -2
  109. package/esm/utils/image.js +2 -2
  110. package/esm/utils/index.d.ts +1 -0
  111. package/esm/utils/isPureVariable.js +2 -2
  112. package/esm/utils/json-schema-2-amis-schema.js +2 -2
  113. package/esm/utils/keyToPath.js +2 -2
  114. package/esm/utils/labelToString.d.ts +1 -0
  115. package/esm/utils/labelToString.js +38 -0
  116. package/esm/utils/makeSorter.js +2 -2
  117. package/esm/utils/math.js +2 -2
  118. package/esm/utils/memoryParse.js +2 -2
  119. package/esm/utils/normalizeLink.js +2 -2
  120. package/esm/utils/normalizeOptions.js +2 -2
  121. package/esm/utils/object.js +2 -2
  122. package/esm/utils/offset.js +2 -2
  123. package/esm/utils/offsetParent.js +2 -2
  124. package/esm/utils/optionValueCompare.js +2 -2
  125. package/esm/utils/position.js +2 -2
  126. package/esm/utils/prettyBytes.js +2 -2
  127. package/esm/utils/printElement.d.ts +6 -0
  128. package/esm/utils/printElement.js +71 -0
  129. package/esm/utils/renderer-event.js +2 -2
  130. package/esm/utils/replaceText.js +10 -12
  131. package/esm/utils/resize-sensor.js +2 -2
  132. package/esm/utils/resolveCondition.js +2 -2
  133. package/esm/utils/resolveVariable.js +2 -2
  134. package/esm/utils/resolveVariableAndFilter.js +2 -2
  135. package/esm/utils/resolveVariableAndFilterForAsync.js +2 -2
  136. package/esm/utils/scrollPosition.js +2 -2
  137. package/esm/utils/string2regExp.d.ts +1 -1
  138. package/esm/utils/string2regExp.js +5 -4
  139. package/esm/utils/stripNumber.js +2 -2
  140. package/esm/utils/style-helper.d.ts +24 -5
  141. package/esm/utils/style-helper.js +47 -17
  142. package/esm/utils/style.js +2 -2
  143. package/esm/utils/toNumber.js +2 -2
  144. package/esm/utils/tokenize.d.ts +1 -0
  145. package/esm/utils/tokenize.js +11 -4
  146. package/esm/utils/tpl-builtin.js +2 -2
  147. package/esm/utils/tpl-lodash.js +2 -2
  148. package/esm/utils/tpl.js +7 -9
  149. package/esm/utils/uncontrollable.js +2 -2
  150. package/esm/utils/validateId.d.ts +16 -0
  151. package/esm/utils/validateId.js +154 -0
  152. package/esm/utils/validations.js +17 -9
  153. package/lib/Root.js +2 -2
  154. package/lib/RootRenderer.d.ts +1 -1
  155. package/lib/RootRenderer.js +4 -3
  156. package/lib/SchemaRenderer.js +5 -2
  157. package/lib/Scoped.d.ts +6 -0
  158. package/lib/Scoped.js +47 -7
  159. package/lib/StatusScoped.js +2 -2
  160. package/lib/WithRootStore.js +2 -2
  161. package/lib/WithStore.js +4 -6
  162. package/lib/actions/Action.js +2 -2
  163. package/lib/actions/AjaxAction.js +2 -2
  164. package/lib/actions/BreakAction.js +2 -2
  165. package/lib/actions/BroadcastAction.js +2 -2
  166. package/lib/actions/CmptAction.js +2 -2
  167. package/lib/actions/ContinueAction.js +2 -2
  168. package/lib/actions/CopyAction.js +2 -2
  169. package/lib/actions/CustomAction.js +3 -3
  170. package/lib/actions/DialogAction.js +2 -2
  171. package/lib/actions/DrawerAction.js +2 -2
  172. package/lib/actions/EmailAction.js +2 -2
  173. package/lib/actions/LinkAction.js +10 -5
  174. package/lib/actions/LoopAction.js +2 -2
  175. package/lib/actions/PageAction.js +2 -2
  176. package/lib/actions/ParallelAction.js +2 -2
  177. package/lib/actions/PrintAction.d.ts +19 -0
  178. package/lib/actions/PrintAction.js +53 -0
  179. package/lib/actions/StatusAction.js +2 -2
  180. package/lib/actions/SwitchAction.js +2 -2
  181. package/lib/actions/ToastAction.js +2 -2
  182. package/lib/actions/index.d.ts +1 -0
  183. package/lib/components/CustomStyle.d.ts +1 -2
  184. package/lib/components/CustomStyle.js +20 -7
  185. package/lib/components/ErrorBoundary.js +2 -2
  186. package/lib/components/LazyComponent.js +2 -2
  187. package/lib/components/Overlay.js +10 -8
  188. package/lib/components/PopOver.js +7 -5
  189. package/lib/env.d.ts +4 -0
  190. package/lib/env.js +2 -2
  191. package/lib/envOverwrite.js +2 -2
  192. package/lib/factory.js +15 -2
  193. package/lib/index.d.ts +3 -2
  194. package/lib/index.js +19 -5
  195. package/lib/locale.js +2 -2
  196. package/lib/polyfills.js +2 -2
  197. package/lib/renderers/Form.d.ts +4 -3
  198. package/lib/renderers/Form.js +96 -44
  199. package/lib/renderers/Item.d.ts +1 -0
  200. package/lib/renderers/Item.js +15 -16
  201. package/lib/renderers/Options.d.ts +5 -0
  202. package/lib/renderers/Options.js +27 -10
  203. package/lib/renderers/Placeholder.js +2 -2
  204. package/lib/renderers/builtin.js +2 -2
  205. package/lib/renderers/register.js +2 -2
  206. package/lib/renderers/wrapControl.js +36 -28
  207. package/lib/store/app.js +3 -3
  208. package/lib/store/combo.d.ts +72 -48
  209. package/lib/store/combo.js +2 -2
  210. package/lib/store/crud.js +2 -2
  211. package/lib/store/form.d.ts +30 -20
  212. package/lib/store/form.js +2 -2
  213. package/lib/store/formItem.d.ts +2 -1
  214. package/lib/store/formItem.js +4 -3
  215. package/lib/store/iRenderer.js +5 -3
  216. package/lib/store/index.js +2 -2
  217. package/lib/store/list.d.ts +11 -0
  218. package/lib/store/list.js +9 -2
  219. package/lib/store/manager.js +2 -2
  220. package/lib/store/modal.js +2 -2
  221. package/lib/store/node.js +2 -2
  222. package/lib/store/pagination.js +2 -2
  223. package/lib/store/root.js +3 -3
  224. package/lib/store/service.js +6 -3
  225. package/lib/store/status.js +2 -2
  226. package/lib/store/table.d.ts +90 -68
  227. package/lib/store/table.js +40 -24
  228. package/lib/store/table2.js +2 -2
  229. package/lib/theme.js +2 -2
  230. package/lib/utils/Animation.js +2 -2
  231. package/lib/utils/ColorScale.js +2 -2
  232. package/lib/utils/DataSchema.js +2 -2
  233. package/lib/utils/DataScope.js +2 -2
  234. package/lib/utils/RootClose.js +2 -2
  235. package/lib/utils/SimpleMap.js +2 -2
  236. package/lib/utils/api.js +4 -3
  237. package/lib/utils/arraySlice.js +2 -2
  238. package/lib/utils/attachmentAdpator.js +4 -3
  239. package/lib/utils/autobind.js +2 -2
  240. package/lib/utils/browser.d.ts +1 -0
  241. package/lib/utils/browser.js +8 -2
  242. package/lib/utils/columnsSplit.js +2 -2
  243. package/lib/utils/concatData.js +2 -2
  244. package/lib/utils/dataMapping.js +2 -2
  245. package/lib/utils/date.js +2 -2
  246. package/lib/utils/debug.js +2 -2
  247. package/lib/utils/decodeEntity.js +2 -2
  248. package/lib/utils/dom.js +8 -3
  249. package/lib/utils/errors.js +2 -2
  250. package/lib/utils/escapeHtml.js +2 -2
  251. package/lib/utils/filter-schema.js +2 -2
  252. package/lib/utils/filter.js +2 -2
  253. package/lib/utils/formatDuration.js +2 -2
  254. package/lib/utils/formula.js +2 -2
  255. package/lib/utils/getVariable.js +2 -2
  256. package/lib/utils/grammar.js +2 -2
  257. package/lib/utils/handleAction.js +2 -2
  258. package/lib/utils/helper.d.ts +8 -1
  259. package/lib/utils/helper.js +29 -8
  260. package/lib/utils/highlight.js +4 -3
  261. package/lib/utils/icon.js +2 -2
  262. package/lib/utils/image.js +2 -2
  263. package/lib/utils/index.d.ts +1 -0
  264. package/lib/utils/isPureVariable.js +2 -2
  265. package/lib/utils/json-schema-2-amis-schema.js +2 -2
  266. package/lib/utils/keyToPath.js +2 -2
  267. package/lib/utils/labelToString.d.ts +1 -0
  268. package/lib/utils/labelToString.js +46 -0
  269. package/lib/utils/makeSorter.js +2 -2
  270. package/lib/utils/math.js +2 -2
  271. package/lib/utils/memoryParse.js +2 -2
  272. package/lib/utils/normalizeLink.js +2 -2
  273. package/lib/utils/normalizeOptions.js +2 -2
  274. package/lib/utils/object.js +2 -2
  275. package/lib/utils/offset.js +2 -2
  276. package/lib/utils/offsetParent.js +2 -2
  277. package/lib/utils/optionValueCompare.js +2 -2
  278. package/lib/utils/position.js +2 -2
  279. package/lib/utils/prettyBytes.js +2 -2
  280. package/lib/utils/printElement.d.ts +6 -0
  281. package/lib/utils/printElement.js +75 -0
  282. package/lib/utils/renderer-event.js +2 -2
  283. package/lib/utils/replaceText.js +9 -15
  284. package/lib/utils/resize-sensor.js +2 -2
  285. package/lib/utils/resolveCondition.js +2 -2
  286. package/lib/utils/resolveVariable.js +2 -2
  287. package/lib/utils/resolveVariableAndFilter.js +2 -2
  288. package/lib/utils/resolveVariableAndFilterForAsync.js +2 -2
  289. package/lib/utils/scrollPosition.js +2 -2
  290. package/lib/utils/string2regExp.d.ts +1 -1
  291. package/lib/utils/string2regExp.js +5 -4
  292. package/lib/utils/stripNumber.js +2 -2
  293. package/lib/utils/style-helper.d.ts +24 -5
  294. package/lib/utils/style-helper.js +47 -17
  295. package/lib/utils/style.js +2 -2
  296. package/lib/utils/toNumber.js +2 -2
  297. package/lib/utils/tokenize.d.ts +1 -0
  298. package/lib/utils/tokenize.js +11 -3
  299. package/lib/utils/tpl-builtin.js +2 -2
  300. package/lib/utils/tpl-lodash.js +2 -2
  301. package/lib/utils/tpl.js +6 -8
  302. package/lib/utils/uncontrollable.js +2 -2
  303. package/lib/utils/validateId.d.ts +16 -0
  304. package/lib/utils/validateId.js +160 -0
  305. package/lib/utils/validations.js +17 -9
  306. package/package.json +4 -9
  307. package/LICENSE +0 -201
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -262,11 +262,9 @@ var Row = mobxStateTree.types
262
262
  get isCheckAvaiableOnClick() {
263
263
  var _a;
264
264
  var table = mobxStateTree.getParent(self, self.depth * 2);
265
- var keepItemSelectionOnPageChange = table === null || table === void 0 ? void 0 : table.keepItemSelectionOnPageChange;
266
- var selectionUpperLimit = table === null || table === void 0 ? void 0 : table.maxKeepItemSelectionLength;
265
+ var selectionUpperLimit = table.getSelectionUpperLimit();
267
266
  // 如果未做配置,或者配置不合法直接通过检查
268
- if (!keepItemSelectionOnPageChange ||
269
- !Number.isInteger(selectionUpperLimit) ||
267
+ if (!Number.isInteger(selectionUpperLimit) ||
270
268
  selectionUpperLimit === Infinity) {
271
269
  return true;
272
270
  }
@@ -360,7 +358,7 @@ var Row = mobxStateTree.types
360
358
  self.error = '';
361
359
  self.loaded = false;
362
360
  },
363
- setDeferData: function (_a) {
361
+ updateData: function (_a) {
364
362
  var children = _a.children, rest = tslib.__rest(_a, ["children"]);
365
363
  self.data = tslib.__assign(tslib.__assign({}, self.data), rest);
366
364
  if (Array.isArray(children)) {
@@ -372,6 +370,7 @@ var TableStore = iRenderer.iRendererStore
372
370
  .named('TableStore')
373
371
  .props({
374
372
  columns: mobxStateTree.types.array(Column),
373
+ columnsKey: '',
375
374
  rows: mobxStateTree.types.array(Row),
376
375
  selectedRows: mobxStateTree.types.array(mobxStateTree.types.reference(Row)),
377
376
  expandedRows: mobxStateTree.types.array(mobxStateTree.types.string),
@@ -396,6 +395,7 @@ var TableStore = iRenderer.iRendererStore
396
395
  formsRef: mobxStateTree.types.optional(mobxStateTree.types.array(mobxStateTree.types.frozen()), []),
397
396
  maxKeepItemSelectionLength: Infinity,
398
397
  keepItemSelectionOnPageChange: false,
398
+ maxItemSelectionLength: Infinity,
399
399
  // 导出 Excel 按钮的 loading 状态
400
400
  exportExcelLoading: false,
401
401
  searchFormExpanded: false,
@@ -581,7 +581,17 @@ var TableStore = iRenderer.iRendererStore
581
581
  function getSearchableColumns() {
582
582
  return self.columns.filter(function (column) { return column.searchable; });
583
583
  }
584
+ function getSelectionUpperLimit() {
585
+ var keep = self.keepItemSelectionOnPageChange;
586
+ var selectionUpperLimit = keep
587
+ ? self.maxKeepItemSelectionLength !== Infinity
588
+ ? self.maxKeepItemSelectionLength
589
+ : self.maxItemSelectionLength
590
+ : self.maxItemSelectionLength;
591
+ return selectionUpperLimit;
592
+ }
584
593
  return {
594
+ getSelectionUpperLimit: getSelectionUpperLimit,
585
595
  get columnsData() {
586
596
  return getColumnsExceptBuiltinTypes();
587
597
  },
@@ -614,6 +624,10 @@ var TableStore = iRenderer.iRendererStore
614
624
  return !!self.selectedRows.length;
615
625
  },
616
626
  get allChecked() {
627
+ var selectionUpperLimit = getSelectionUpperLimit();
628
+ if (selectionUpperLimit !== Infinity) {
629
+ return self.isSelectionThresholdReached;
630
+ }
617
631
  // 只要selectedRows中包含checkableRows中的全部数据,就认为是全选
618
632
  return self.checkableRows.every(function (item) {
619
633
  return self.selectedRows.includes(item);
@@ -659,8 +673,8 @@ var TableStore = iRenderer.iRendererStore
659
673
  get isSelectionThresholdReached() {
660
674
  var _a, _b;
661
675
  var selectedLength = (_b = (_a = self.data) === null || _a === void 0 ? void 0 : _a.selectedItems) === null || _b === void 0 ? void 0 : _b.length;
662
- var maxLength = self.maxKeepItemSelectionLength;
663
- if (!self.data || !self.keepItemSelectionOnPageChange || !maxLength) {
676
+ var maxLength = getSelectionUpperLimit();
677
+ if (!self.data || maxLength === Infinity) {
664
678
  return false;
665
679
  }
666
680
  return maxLength <= selectedLength;
@@ -807,6 +821,8 @@ var TableStore = iRenderer.iRendererStore
807
821
  config.keepItemSelectionOnPageChange !== undefined &&
808
822
  (self.keepItemSelectionOnPageChange =
809
823
  config.keepItemSelectionOnPageChange);
824
+ config.maxItemSelectionLength !== undefined &&
825
+ (self.maxItemSelectionLength = config.maxItemSelectionLength);
810
826
  config.exportExcelLoading !== undefined &&
811
827
  (self.exportExcelLoading = config.exportExcelLoading);
812
828
  config.loading !== undefined && (self.loading = config.loading);
@@ -817,6 +833,7 @@ var TableStore = iRenderer.iRendererStore
817
833
  typeof config.tableLayout === 'string' &&
818
834
  (self.tableLayout = config.tableLayout);
819
835
  if (config.columns && Array.isArray(config.columns)) {
836
+ self.columnsKey = getPersistDataKey(config.columns);
820
837
  var columns = config.columns
821
838
  .map(function (column) {
822
839
  if ((options === null || options === void 0 ? void 0 : options.resolveDefinitions) &&
@@ -828,7 +845,7 @@ var TableStore = iRenderer.iRendererStore
828
845
  })
829
846
  .filter(function (column) { return column; });
830
847
  // 更新列顺序,afterCreate生命周期中更新columns不会触发组件的render
831
- var key = getPersistDataKey(columns);
848
+ var key = self.columnsKey;
832
849
  var data = localStorage.getItem(key);
833
850
  var tableMetaData = null;
834
851
  if (data) {
@@ -932,7 +949,7 @@ var TableStore = iRenderer.iRendererStore
932
949
  th.style.cssText += "".concat(typeof column.pristine.width === 'number'
933
950
  ? "width: ".concat(column.pristine.width, "px;")
934
951
  : column.pristine.width
935
- ? "width: ".concat(column.pristine.width, ";")
952
+ ? "width: ".concat(column.pristine.width, ";min-width: ").concat(column.pristine.width, ";")
936
953
  : '' // todo 可能需要让修改过列宽的保持相应宽度,目前这样相当于重置了
937
954
  );
938
955
  });
@@ -1127,10 +1144,10 @@ var TableStore = iRenderer.iRendererStore
1127
1144
  function updateSelected(selected, valueField) {
1128
1145
  self.selectedRows.clear();
1129
1146
  selected.forEach(function (item) {
1130
- var resolved = self.rows.find(function (a) { return a.pristine === item; });
1147
+ var resolved = helper.findTree(self.rows, function (a) { return a.pristine === item; });
1131
1148
  // 先严格比较,
1132
1149
  if (!resolved) {
1133
- resolved = self.rows.find(function (a) {
1150
+ resolved = helper.findTree(self.rows, function (a) {
1134
1151
  var selectValue = item[valueField || 'value'];
1135
1152
  var itemValue = a.pristine[valueField || 'value'];
1136
1153
  return selectValue === itemValue;
@@ -1138,7 +1155,7 @@ var TableStore = iRenderer.iRendererStore
1138
1155
  }
1139
1156
  // 再宽松比较
1140
1157
  if (!resolved) {
1141
- resolved = self.rows.find(function (a) {
1158
+ resolved = helper.findTree(self.rows, function (a) {
1142
1159
  var selectValue = item[valueField || 'value'];
1143
1160
  var itemValue = a.pristine[valueField || 'value'];
1144
1161
  return selectValue == itemValue;
@@ -1150,11 +1167,9 @@ var TableStore = iRenderer.iRendererStore
1150
1167
  }
1151
1168
  function getSelectedRows() {
1152
1169
  var _a;
1153
- var maxLength = self.maxKeepItemSelectionLength;
1154
- var keep = self.keepItemSelectionOnPageChange;
1170
+ var maxLength = self.getSelectionUpperLimit();
1155
1171
  var selectedItems = (_a = self.data) === null || _a === void 0 ? void 0 : _a.selectedItems;
1156
- if (keep &&
1157
- maxLength &&
1172
+ if (maxLength !== Infinity &&
1158
1173
  selectedItems &&
1159
1174
  maxLength >= selectedItems.length) {
1160
1175
  var restCheckableRows = self.checkableRows.filter(function (item) { return !item.checked; });
@@ -1269,10 +1284,10 @@ var TableStore = iRenderer.iRendererStore
1269
1284
  if (!self.data) {
1270
1285
  return;
1271
1286
  }
1272
- var maxLength = self.maxKeepItemSelectionLength;
1287
+ var maxLength = self.getSelectionUpperLimit();
1273
1288
  var selectedItems = self.data.selectedItems;
1274
1289
  self.selectedRows.map(function (item) { return item.setCheckdisable(false); });
1275
- if (maxLength && maxLength <= selectedItems.length) {
1290
+ if (maxLength !== Infinity && maxLength <= selectedItems.length) {
1276
1291
  self.unSelectedRows.map(function (item) { return !item.checked && item.setCheckdisable(true); });
1277
1292
  }
1278
1293
  else {
@@ -1367,7 +1382,7 @@ var TableStore = iRenderer.iRendererStore
1367
1382
  * 前端持久化记录列排序,查询字段,显示列信息
1368
1383
  */
1369
1384
  function persistSaveToggledColumns() {
1370
- var key = getPersistDataKey(self.columnsData);
1385
+ var key = self.columnsKey;
1371
1386
  localStorage.setItem(key, JSON.stringify({
1372
1387
  // 可显示列index
1373
1388
  toggledColumnIndex: self.activeToggaleColumns.map(function (item) { return item.index; }),
@@ -1411,10 +1426,11 @@ var TableStore = iRenderer.iRendererStore
1411
1426
  }
1412
1427
  function getPersistDataKey(columns) {
1413
1428
  // 这里的columns使用除了__开头的所有列
1414
- // sort保证存储和读取的key值保持一致
1415
1429
  return (location.pathname +
1416
1430
  self.path +
1417
- sortBy__default["default"](columns.map(function (item, index) { return item.name || item.label || index; })).join('-'));
1431
+ // 不能 sort 因为原始列的顺序设计器是可能改变的,此时如果缓存了打开会失效
1432
+ // 还是缓存的顺序,不符合用户调整列顺序的预期
1433
+ columns.map(function (item, index) { return item.name || item.label || index; }).join('-'));
1418
1434
  }
1419
1435
  function setSearchFormExpanded(value) {
1420
1436
  self.searchFormExpanded = !!value;
@@ -1460,7 +1476,7 @@ var TableStore = iRenderer.iRendererStore
1460
1476
  if (!mobxStateTree.isAlive(self)) {
1461
1477
  return;
1462
1478
  }
1463
- var key = getPersistDataKey(self.columnsData);
1479
+ var key = self.columnsKey;
1464
1480
  var data = localStorage.getItem(key);
1465
1481
  if (data) {
1466
1482
  var tableMetaData_1 = JSON.parse(data);
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
package/lib/theme.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
package/lib/utils/api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -278,6 +278,7 @@ function callStrFunction(fn, argNames) {
278
278
  }
279
279
  }
280
280
  function responseAdaptor(ret, api) {
281
+ var _a;
281
282
  var data = ret.data;
282
283
  var hasStatusField = true;
283
284
  if (!data) {
@@ -285,7 +286,7 @@ function responseAdaptor(ret, api) {
285
286
  }
286
287
  // 返回内容是 string,说明 content-type 不是 json,这时可能是返回了纯文本或 html
287
288
  if (typeof data === 'string') {
288
- var contentType = ret.headers['content-type'] || '';
289
+ var contentType = ((_a = ret.headers) === null || _a === void 0 ? void 0 : _a['content-type']) || '';
289
290
  // 如果是文本类型就尝试解析一下
290
291
  if (ret.headers &&
291
292
  contentType.startsWith('text/') &&
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -16,6 +16,7 @@ var tslib = require('tslib');
16
16
  * @returns
17
17
  */
18
18
  function attachmentAdpator(response, __, api) {
19
+ var _a;
19
20
  if (response && response.headers && response.headers['content-disposition']) {
20
21
  var disposition = response.headers['content-disposition'];
21
22
  var filename = '';
@@ -39,7 +40,7 @@ function attachmentAdpator(response, __, api) {
39
40
  filename = filename.replace(/\+/g, ' ');
40
41
  }
41
42
  }
42
- var type = response.headers['content-type'];
43
+ var type = (_a = response.headers) === null || _a === void 0 ? void 0 : _a['content-type'];
43
44
  var blob = response.data.toString() === '[object Blob]'
44
45
  ? response.data
45
46
  : new Blob([response.data], { type: type });
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1 +1,2 @@
1
1
  export declare const chromeVersion: number | boolean;
2
+ export declare const isSafari: boolean | "";
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -11,5 +11,11 @@ var chromeVersion = (function getChromeVersion() {
11
11
  var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
12
12
  return raw ? parseInt(raw[2], 10) : false;
13
13
  })();
14
+ var isSafari = navigator.vendor &&
15
+ navigator.vendor.indexOf('Apple') > -1 &&
16
+ navigator.userAgent &&
17
+ navigator.userAgent.indexOf('CriOS') == -1 &&
18
+ navigator.userAgent.indexOf('FxiOS') == -1;
14
19
 
15
20
  exports.chromeVersion = chromeVersion;
21
+ exports.isSafari = isSafari;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
package/lib/utils/date.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
package/lib/utils/dom.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -134,7 +134,7 @@ function calculatePosition(placement, overlayNode, target, container, padding, c
134
134
  ? overlayHeight
135
135
  : overlayHeight / 2;
136
136
  // 如果还有其他可选项,则做位置判断,是否在可视区域,不完全在则继续看其他定位情况。
137
- if (tests.length) {
137
+ if (tests.length || isAuto) {
138
138
  var transformed = {
139
139
  x: clip.x + positionLeft / scaleX,
140
140
  y: clip.y + positionTop / scaleY,
@@ -158,6 +158,11 @@ function calculatePosition(placement, overlayNode, target, container, padding, c
158
158
  if (visibleX && visibleY) {
159
159
  break;
160
160
  }
161
+ else if (isAuto && tests.length === 0) {
162
+ // 如果是 auto 模式,且最后一个方向都不可见,则直接平移到可见区域
163
+ visibleY || (positionTop = window.innerHeight - transformed.height);
164
+ visibleX || (positionLeft = window.innerWidth - transformed.width);
165
+ }
161
166
  }
162
167
  }
163
168
  // todo arrow 位置支持
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -1,6 +1,6 @@
1
1
  /**
2
- * amis-core v6.0.0
3
- * Copyright 2018-2023 fex
2
+ * amis-core v6.2.0
3
+ * Copyright 2018-2024 fex
4
4
  */
5
5
 
6
6
  'use strict';
@@ -41,7 +41,7 @@ type Mutable<T> = {
41
41
  };
42
42
  export declare function changedEffect<T extends Record<string, any>>(attrs: string | Array<string>, origin: T, data: T, effect: (changes: Partial<Mutable<T>>) => void, strictMode?: boolean): void;
43
43
  export declare function rmUndefined(obj: PlainObject): PlainObject;
44
- export declare function isObjectShallowModified(prev: any, next: any, strictModeOrFunc?: boolean | ((lhs: any, rhs: any) => boolean), ignoreUndefined?: boolean, stack?: Array<any>): boolean;
44
+ export declare function isObjectShallowModified(prev: any, next: any, strictModeOrFunc?: boolean | ((lhs: any, rhs: any) => boolean), ignoreUndefined?: boolean, stack?: Array<any>, maxDepth?: number): boolean;
45
45
  export declare function isArrayChildrenModified(prev: Array<any>, next: Array<any>, strictMode?: boolean): boolean;
46
46
  export declare function immutableExtends(to: any, from: any, deep?: boolean): any;
47
47
  export declare function makeColumnClassBuild(steps: number, classNameTpl?: string): (schema: Schema) => any;
@@ -383,3 +383,10 @@ export declare function buildTrackExpression(schema: any): string;
383
383
  export declare function evalTrackExpression(expression: string, data: Record<string, any>): string;
384
384
  export declare function importLazyComponent(mod: any): any;
385
385
  export declare function replaceUrlParams(path: string, params: Record<string, any>): string;
386
+ export declare const TEST_ID_KEY: 'data-testid';
387
+ export declare function buildTestId(testid?: string, data?: PlainObject): {
388
+ "data-testid"?: undefined;
389
+ } | {
390
+ "data-testid": string;
391
+ };
392
+ export declare function getTestId(testid?: string, data?: PlainObject): string | undefined;