amis 1.9.1-beta.25 → 1.9.1-beta.28

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. package/lib/components/Select.d.ts +388 -193
  2. package/lib/components/Select.js +9 -6
  3. package/lib/components/Select.js.map +2 -2
  4. package/lib/factory.js +1 -1
  5. package/lib/factory.js.map +2 -2
  6. package/lib/index.js +1 -1
  7. package/lib/renderers/Dialog.d.ts +147 -169
  8. package/lib/renderers/Dialog.js.map +2 -2
  9. package/lib/renderers/Form/InputText.js +7 -1
  10. package/lib/renderers/Form/InputText.js.map +2 -2
  11. package/lib/renderers/Form/Item.js +2 -1
  12. package/lib/renderers/Form/Item.js.map +2 -2
  13. package/lib/renderers/Form/Select.d.ts +5 -0
  14. package/lib/renderers/Form/Select.js +4 -3
  15. package/lib/renderers/Form/Select.js.map +2 -2
  16. package/lib/renderers/Form/index.d.ts +4 -4
  17. package/lib/renderers/Form/index.js +256 -252
  18. package/lib/renderers/Form/index.js.map +2 -2
  19. package/lib/renderers/Steps.js +2 -1
  20. package/lib/renderers/Steps.js.map +2 -2
  21. package/lib/renderers/Table/index.d.ts +2 -0
  22. package/lib/renderers/Table/index.js +75 -30
  23. package/lib/renderers/Table/index.js.map +2 -2
  24. package/lib/themes/ang-ie11.css +8 -3
  25. package/lib/themes/ang.css +7 -0
  26. package/lib/themes/ang.css.map +1 -1
  27. package/lib/themes/antd-ie11.css +26 -21
  28. package/lib/themes/antd.css +11 -0
  29. package/lib/themes/antd.css.map +1 -1
  30. package/lib/themes/cxd-ie11.css +5 -0
  31. package/lib/themes/cxd.css +7 -2
  32. package/lib/themes/cxd.css.map +1 -1
  33. package/lib/themes/dark-ie11.css +8 -3
  34. package/lib/themes/dark.css +7 -0
  35. package/lib/themes/dark.css.map +1 -1
  36. package/lib/themes/default-ie11.css +5 -0
  37. package/lib/themes/default.css +7 -2
  38. package/lib/themes/default.css.map +1 -1
  39. package/lib/utils/helper.js +2 -1
  40. package/lib/utils/helper.js.map +2 -2
  41. package/package.json +1 -1
  42. package/schema.json +36 -26
  43. package/scss/_properties.scss +5 -0
  44. package/scss/components/_table.scss +9 -1
  45. package/scss/themes/_antd-variables.scss +6 -0
  46. package/scss/themes/_cxd-variables.scss +0 -2
  47. package/sdk/ang-ie11.css +10 -3
  48. package/sdk/ang.css +9 -0
  49. package/sdk/antd-ie11.css +28 -21
  50. package/sdk/antd.css +13 -0
  51. package/sdk/barcode.js +51 -51
  52. package/sdk/charts.js +14 -14
  53. package/sdk/codemirror.js +7 -7
  54. package/sdk/color-picker.js +65 -65
  55. package/sdk/cropperjs.js +2 -2
  56. package/sdk/cxd-ie11.css +7 -0
  57. package/sdk/cxd.css +9 -2
  58. package/sdk/dark-ie11.css +10 -3
  59. package/sdk/dark.css +9 -0
  60. package/sdk/exceljs.js +1 -1
  61. package/sdk/markdown.js +69 -69
  62. package/sdk/papaparse.js +1 -1
  63. package/sdk/renderers/Form/CityDB.js +1 -1
  64. package/sdk/rest.js +16 -16
  65. package/sdk/rich-text.js +62 -62
  66. package/sdk/sdk-ie11.css +7 -0
  67. package/sdk/sdk.css +9 -2
  68. package/sdk/sdk.js +1648 -1643
  69. package/sdk/thirds/hls.js/hls.js +1 -1
  70. package/sdk/thirds/mpegts.js/mpegts.js +1 -1
  71. package/sdk/tinymce.js +57 -57
  72. package/src/components/Select.tsx +10 -5
  73. package/src/factory.tsx +1 -1
  74. package/src/renderers/Dialog.tsx +0 -1
  75. package/src/renderers/Form/InputText.tsx +9 -1
  76. package/src/renderers/Form/Item.tsx +2 -1
  77. package/src/renderers/Form/Select.tsx +10 -1
  78. package/src/renderers/Form/index.tsx +18 -25
  79. package/src/renderers/Steps.tsx +7 -2
  80. package/src/renderers/Table/index.tsx +82 -30
  81. package/src/utils/helper.ts +2 -1
@@ -34,6 +34,7 @@ var Table = /** @class */ (function (_super) {
34
34
  function Table(props, context) {
35
35
  var _this = _super.call(this, props) || this;
36
36
  _this.lastScrollLeft = -1;
37
+ _this.lastScrollTop = 0;
37
38
  _this.totalWidth = 0;
38
39
  _this.totalHeight = 0;
39
40
  _this.outterWidth = 0;
@@ -166,6 +167,8 @@ var Table = /** @class */ (function (_super) {
166
167
  var tableContent = table.querySelector(".".concat(ns, "Table-content"));
167
168
  var tableContentWrap = table.querySelector(".".concat(ns, "Table-contentWrap"));
168
169
  var footToolbar = table.querySelector(".".concat(ns, "Table-footToolbar"));
170
+ var leftFixedColumns = table.querySelector(".".concat(ns, "Table-fixedLeft"));
171
+ var rightFixedColumns = table.querySelector(".".concat(ns, "Table-fixedRight"));
169
172
  if (!tableContent) {
170
173
  return;
171
174
  }
@@ -192,11 +195,21 @@ var Table = /** @class */ (function (_super) {
192
195
  allParentPaddingButtom + paddingButtom + borderBottom;
193
196
  parentNode = parentNode.parentElement;
194
197
  }
195
- tableContent.style.height = "".concat(viewportHeight -
198
+ var tableContentHeight = "".concat(viewportHeight -
196
199
  tableContentTop -
197
200
  tableContentWrapMarginButtom -
198
201
  footToolbarHeight -
199
202
  allParentPaddingButtom, "px");
203
+ tableContent.style.height = tableContentHeight;
204
+ /**autoFillHeight开启后固定列会溢出Table高度,需要同步一下 */
205
+ if (leftFixedColumns) {
206
+ leftFixedColumns.style.height = tableContentHeight;
207
+ leftFixedColumns.style.overflowY = 'auto';
208
+ }
209
+ if (rightFixedColumns) {
210
+ rightFixedColumns.style.height = tableContentHeight;
211
+ rightFixedColumns.style.overflowY = 'auto';
212
+ }
200
213
  };
201
214
  Table.prototype.componentDidUpdate = function (prevProps) {
202
215
  var props = this.props;
@@ -551,34 +564,55 @@ var Table = /** @class */ (function (_super) {
551
564
  Table.prototype.handleOutterScroll = function () {
552
565
  var outter = this.table.parentNode;
553
566
  var scrollLeft = outter.scrollLeft;
554
- if (scrollLeft === this.lastScrollLeft) {
555
- return;
556
- }
557
- this.lastScrollLeft = scrollLeft;
558
- var leading = scrollLeft === 0;
559
- var trailing = Math.ceil(scrollLeft) + this.outterWidth >= this.totalWidth;
560
- // console.log(scrollLeft, store.outterWidth, store.totalWidth, (scrollLeft + store.outterWidth) === store.totalWidth);
561
- // store.setLeading(leading);
562
- // store.setTrailing(trailing);
563
567
  var ns = this.props.classPrefix;
564
568
  var dom = (0, react_dom_1.findDOMNode)(this);
565
569
  var fixedLeft = dom.querySelectorAll(".".concat(ns, "Table-fixedLeft"));
566
- if (fixedLeft && fixedLeft.length) {
567
- for (var i = 0, len = fixedLeft.length; i < len; i++) {
568
- var node = fixedLeft[i];
569
- leading ? node.classList.remove('in') : node.classList.add('in');
570
+ var fixedRight = dom.querySelectorAll(".".concat(ns, "Table-fixedRight"));
571
+ if (scrollLeft !== this.lastScrollLeft) {
572
+ this.lastScrollLeft = scrollLeft;
573
+ var leading = scrollLeft === 0;
574
+ var trailing = Math.ceil(scrollLeft) + this.outterWidth >= this.totalWidth;
575
+ // console.log(scrollLeft, store.outterWidth, store.totalWidth, (scrollLeft + store.outterWidth) === store.totalWidth);
576
+ // store.setLeading(leading);
577
+ // store.setTrailing(trailing);
578
+ if (fixedLeft && fixedLeft.length) {
579
+ for (var i = 0, len = fixedLeft.length; i < len; i++) {
580
+ var node = fixedLeft[i];
581
+ leading ? node.classList.remove('in') : node.classList.add('in');
582
+ }
583
+ }
584
+ if (fixedRight && fixedRight.length) {
585
+ for (var i = 0, len = fixedRight.length; i < len; i++) {
586
+ var node = fixedRight[i];
587
+ trailing ? node.classList.remove('in') : node.classList.add('in');
588
+ }
589
+ }
590
+ var table = this.affixedTable;
591
+ if (table) {
592
+ table.style.cssText += "transform: translateX(-".concat(scrollLeft, "px)");
570
593
  }
571
594
  }
572
- var fixedRight = dom.querySelectorAll(".".concat(ns, "Table-fixedRight"));
573
- if (fixedRight && fixedRight.length) {
574
- for (var i = 0, len = fixedRight.length; i < len; i++) {
575
- var node = fixedRight[i];
576
- trailing ? node.classList.remove('in') : node.classList.add('in');
595
+ /* 同步固定列内容的垂直滚动 */
596
+ if (outter.scrollTop !== this.lastScrollTop) {
597
+ this.lastScrollTop = outter.scrollTop;
598
+ if (fixedLeft && fixedLeft.length) {
599
+ (0, forEach_1.default)(fixedLeft, function (node) { return node.scrollTo({ top: outter.scrollTop }); });
600
+ }
601
+ if (fixedRight && fixedRight.length) {
602
+ (0, forEach_1.default)(fixedRight, function (node) { return node.scrollTo({ top: outter.scrollTop }); });
577
603
  }
578
604
  }
579
- var table = this.affixedTable;
580
- if (table) {
581
- table.style.cssText += "transform: translateX(-".concat(scrollLeft, "px)");
605
+ };
606
+ Table.prototype.handleFixedColumnsScroll = function (event) {
607
+ /** table内容区当前Top */
608
+ var currentScrollTop = this.lastScrollTop;
609
+ /** 固定列的新Top */
610
+ var fixedScrollTop = event.currentTarget.scrollTop;
611
+ if (currentScrollTop !== fixedScrollTop) {
612
+ this.lastScrollTop = fixedScrollTop;
613
+ var tableContentDom = this.table
614
+ .parentNode;
615
+ tableContentDom.scrollTo({ top: fixedScrollTop });
582
616
  }
583
617
  };
584
618
  Table.prototype.tableRef = function (ref) {
@@ -796,7 +830,8 @@ var Table = /** @class */ (function (_super) {
796
830
  // 垂直线拖拽移动
797
831
  Table.prototype.handleColResizeMouseMove = function (e) {
798
832
  var moveX = e.clientX - this.lineStartX;
799
- this.resizeLine.style.left = this.resizeLineLeft + moveX + 'px';
833
+ // 光标right为-4px,列宽改变时会自动跟随,不需要单独处理位置
834
+ // this.resizeLine.style.left = this.resizeLineLeft + moveX + 'px';
800
835
  this.targetTh.style.width = this.targetThWidth + moveX + 'px';
801
836
  };
802
837
  // 垂直线拖拽结束
@@ -1365,17 +1400,21 @@ var Table = /** @class */ (function (_super) {
1365
1400
  header,
1366
1401
  heading,
1367
1402
  react_1.default.createElement("div", { className: cx('Table-contentWrap'), onMouseLeave: this.handleMouseLeave },
1368
- react_1.default.createElement("div", { className: cx('Table-fixedLeft'), onMouseMove: this.handleMouseMove }, affixColumns !== false && store.leftFixedColumns.length
1403
+ react_1.default.createElement("div", { className: cx('Table-fixedLeft', {
1404
+ 'Table-fixedLeft--autoFillHeight': autoFillHeight
1405
+ }), onMouseMove: this.handleMouseMove, onScroll: this.handleFixedColumnsScroll }, affixColumns !== false && store.leftFixedColumns.length
1369
1406
  ? this.renderFixedColumns(store.rows, store.leftFixedColumns, false, tableClassName)
1370
1407
  : null),
1371
- react_1.default.createElement("div", { className: cx('Table-fixedRight'), onMouseMove: this.handleMouseMove }, affixColumns !== false && store.rightFixedColumns.length
1408
+ react_1.default.createElement("div", { className: cx('Table-fixedRight', {
1409
+ 'Table-fixedLeft--autoFillHeight': autoFillHeight
1410
+ }), onMouseMove: this.handleMouseMove, onScroll: this.handleFixedColumnsScroll }, affixColumns !== false && store.rightFixedColumns.length
1372
1411
  ? this.renderFixedColumns(store.rows, store.rightFixedColumns, false, tableClassName)
1373
1412
  : null),
1374
1413
  this.renderTableContent()),
1375
1414
  this.renderAffixHeader(tableClassName),
1376
1415
  footer));
1377
1416
  };
1378
- var _a, _b, _c, _d;
1417
+ var _a, _b, _c, _d, _e;
1379
1418
  Table.contextType = Scoped_1.ScopedContext;
1380
1419
  Table.propsList = [
1381
1420
  'header',
@@ -1447,7 +1486,13 @@ var Table = /** @class */ (function (_super) {
1447
1486
  (0, tslib_1.__decorate)([
1448
1487
  helper_1.autobind,
1449
1488
  (0, tslib_1.__metadata)("design:type", Function),
1450
- (0, tslib_1.__metadata)("design:paramtypes", [typeof (_a = typeof react_1.default !== "undefined" && react_1.default.DragEvent) === "function" ? _a : Object]),
1489
+ (0, tslib_1.__metadata)("design:paramtypes", [typeof (_a = typeof react_1.default !== "undefined" && react_1.default.UIEvent) === "function" ? _a : Object]),
1490
+ (0, tslib_1.__metadata)("design:returntype", void 0)
1491
+ ], Table.prototype, "handleFixedColumnsScroll", null);
1492
+ (0, tslib_1.__decorate)([
1493
+ helper_1.autobind,
1494
+ (0, tslib_1.__metadata)("design:type", Function),
1495
+ (0, tslib_1.__metadata)("design:paramtypes", [typeof (_b = typeof react_1.default !== "undefined" && react_1.default.DragEvent) === "function" ? _b : Object]),
1451
1496
  (0, tslib_1.__metadata)("design:returntype", void 0)
1452
1497
  ], Table.prototype, "handleDragStart", null);
1453
1498
  (0, tslib_1.__decorate)([
@@ -1477,19 +1522,19 @@ var Table = /** @class */ (function (_super) {
1477
1522
  (0, tslib_1.__decorate)([
1478
1523
  helper_1.autobind,
1479
1524
  (0, tslib_1.__metadata)("design:type", Function),
1480
- (0, tslib_1.__metadata)("design:paramtypes", [typeof (_b = typeof react_1.default !== "undefined" && react_1.default.MouseEvent) === "function" ? _b : Object]),
1525
+ (0, tslib_1.__metadata)("design:paramtypes", [typeof (_c = typeof react_1.default !== "undefined" && react_1.default.MouseEvent) === "function" ? _c : Object]),
1481
1526
  (0, tslib_1.__metadata)("design:returntype", void 0)
1482
1527
  ], Table.prototype, "handleColResizeMouseDown", null);
1483
1528
  (0, tslib_1.__decorate)([
1484
1529
  helper_1.autobind,
1485
1530
  (0, tslib_1.__metadata)("design:type", Function),
1486
- (0, tslib_1.__metadata)("design:paramtypes", [typeof (_c = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _c : Object]),
1531
+ (0, tslib_1.__metadata)("design:paramtypes", [typeof (_d = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _d : Object]),
1487
1532
  (0, tslib_1.__metadata)("design:returntype", void 0)
1488
1533
  ], Table.prototype, "handleColResizeMouseMove", null);
1489
1534
  (0, tslib_1.__decorate)([
1490
1535
  helper_1.autobind,
1491
1536
  (0, tslib_1.__metadata)("design:type", Function),
1492
- (0, tslib_1.__metadata)("design:paramtypes", [typeof (_d = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _d : Object]),
1537
+ (0, tslib_1.__metadata)("design:paramtypes", [typeof (_e = typeof MouseEvent !== "undefined" && MouseEvent) === "function" ? _e : Object]),
1493
1538
  (0, tslib_1.__metadata)("design:returntype", void 0)
1494
1539
  ], Table.prototype, "handleColResizeMouseUp", null);
1495
1540
  return Table;