kts-components-document-access-point 1.3.22 → 1.3.26

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.
package/.editorconfig CHANGED
@@ -1,16 +1,16 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
14
-
15
- [Makefile]
16
- indent_style = tab
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [*]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [*.md]
13
+ trim_trailing_whitespace = false
14
+
15
+ [Makefile]
16
+ indent_style = tab
package/.prettierignore CHANGED
@@ -1,7 +1,7 @@
1
- **/*.svg
2
- **/*.ejs
3
- **/*.html
4
- package.json
5
- .umi
6
- .umi-production
7
- .umi-test
1
+ **/*.svg
2
+ **/*.ejs
3
+ **/*.html
4
+ package.json
5
+ .umi
6
+ .umi-production
7
+ .umi-test
package/.prettierrc CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 80,
5
- "overrides": [
6
- {
7
- "files": ".prettierrc",
8
- "options": { "parser": "json" }
9
- }
10
- ]
11
- }
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "printWidth": 80,
5
+ "overrides": [
6
+ {
7
+ "files": ".prettierrc",
8
+ "options": { "parser": "json" }
9
+ }
10
+ ]
11
+ }
package/.umirc.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { defineConfig } from 'dumi';
2
-
3
- export default defineConfig({
4
- title: '单据中心组件',
5
- favicon:
6
- 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
7
- logo: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
8
- outputPath: 'docs-dist',
9
- publicPath:'/docs-dist/',
10
- // more config: https://d.umijs.org/config
11
- });
1
+ import { defineConfig } from 'dumi';
2
+
3
+ export default defineConfig({
4
+ title: '单据中心组件',
5
+ favicon:
6
+ 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
7
+ logo: 'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
8
+ outputPath: 'docs-dist',
9
+ publicPath:'/docs-dist/',
10
+ // more config: https://d.umijs.org/config
11
+ });
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # kts-components-document-access-point
2
-
3
- 文档地址:http://kts-components-document-access-point.dev.kingxunlian.com/docs-dist/
1
+ # kts-components-document-access-point
2
+
3
+ 文档地址:http://kts-components-document-access-point.dev.kingxunlian.com/docs-dist/
package/dist/index.esm.js CHANGED
@@ -604,7 +604,7 @@ var defaultSchema = {
604
604
 
605
605
  var addProperties = /*#__PURE__*/(function () {
606
606
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s, options) {
607
- var current, properties, values, obj;
607
+ var current, properties, values, info;
608
608
  return regeneratorRuntime.wrap(function _callee$(_context) {
609
609
  while (1) {
610
610
  switch (_context.prev = _context.next) {
@@ -636,18 +636,18 @@ var addProperties = /*#__PURE__*/(function () {
636
636
  return _context.abrupt("return");
637
637
 
638
638
  case 8:
639
- // 对象 还是 数组
639
+ info = current.items ? current.items : current; // let obj: any;
640
+ // 创建 properties (对象 还是 数组)
641
+
640
642
  if (current.type === 'object') {
641
643
  if (!current.properties) current.properties = {};
642
- obj = current.properties;
643
644
  } else if (current.type === 'array' && current.items) {
644
645
  if (!current.items.properties) current.items.properties = {};
645
- obj = current.items.properties;
646
646
  }
647
647
 
648
- if (!current.required) current.required = [];
649
- values.required && current.required.push(values.$name);
650
- obj[values.$name] = {
648
+ if (!info.required) info.required = [];
649
+ values.required && info.required.push(values.$name);
650
+ info.properties[values.$name] = {
651
651
  alias: values.title,
652
652
  detailed: values.description,
653
653
  $ref: properties.$id,
@@ -657,7 +657,7 @@ var addProperties = /*#__PURE__*/(function () {
657
657
  s.schema.definitions[properties.$name] = properties;
658
658
  s.schema = _objectSpread2({}, s.schema);
659
659
 
660
- case 14:
660
+ case 15:
661
661
  case "end":
662
662
  return _context.stop();
663
663
  }
@@ -685,12 +685,13 @@ var editProperties = /*#__PURE__*/(function () {
685
685
  return _context.abrupt("return");
686
686
 
687
687
  case 2:
688
- editProperties = options.editProperties, properties = options.properties, current = options.current; // 对象数据
688
+ editProperties = options.editProperties, properties = options.properties;
689
+ current = options.current.properties ? options.current : options.current.items; // 对象数据
689
690
 
690
691
  current.properties[properties.$name].alias = properties.title;
691
692
  current.properties[properties.$name].detailed = properties.description; // 设置必填
692
693
 
693
- required = current.required;
694
+ required = current.required || (current.required = []);
694
695
 
695
696
  if (properties.required) {
696
697
  if (required.indexOf(properties.$name) < 0) {
@@ -751,7 +752,7 @@ var editProperties = /*#__PURE__*/(function () {
751
752
 
752
753
  s.schema = _objectSpread2({}, s.schema);
753
754
 
754
- case 17:
755
+ case 18:
755
756
  case "end":
756
757
  return _context.stop();
757
758
  }
@@ -766,48 +767,64 @@ var editProperties = /*#__PURE__*/(function () {
766
767
 
767
768
  var delProperties = /*#__PURE__*/(function () {
768
769
  var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(s, options) {
769
- var _s$propertyTableState, _s$propertyTableState2, _s$propertyTableState3;
770
+ var _s$propertyTableState, _s$propertyTableState2;
771
+
772
+ var current, _del, key;
770
773
 
771
- var properties;
772
774
  return regeneratorRuntime.wrap(function _callee$(_context) {
773
775
  while (1) {
774
776
  switch (_context.prev = _context.next) {
775
777
  case 0:
776
- if (options) {
777
- _context.next = 2;
778
- break;
779
- }
780
-
781
- return _context.abrupt("return");
782
-
783
- case 2:
784
- properties = ((_s$propertyTableState = s.propertyTableState.current) === null || _s$propertyTableState === void 0 ? void 0 : _s$propertyTableState.items) ? (_s$propertyTableState2 = s.propertyTableState.current) === null || _s$propertyTableState2 === void 0 ? void 0 : _s$propertyTableState2.items.properties : (_s$propertyTableState3 = s.propertyTableState.current) === null || _s$propertyTableState3 === void 0 ? void 0 : _s$propertyTableState3.properties; // 删除必填
785
-
786
- (function () {
787
- var p = options.required.indexOf(options.value.$name);
788
- options.required.splice(p, 1);
789
- })(); // 删除引用
790
-
778
+ _del = function _del2(current, name, refName) {
779
+ // 删除必填
780
+ (function () {
781
+ if (!current.required) return;
782
+ var p = current.required.indexOf(name);
783
+ current.required.splice(p, 1);
784
+ })(); // 删除引用
785
+
786
+
787
+ (function () {
788
+ if (!current.properties) return;
789
+ delete current.properties[name];
790
+ s.schema.definitions[refName].$count--;
791
+ })(); // 删除孩子
792
+
793
+
794
+ (function () {
795
+ var items = s.schema.definitions[refName].items;
796
+ var current = items ? items : s.schema.definitions[refName];
797
+ var properties = current.properties;
798
+ if (!properties) return;
799
+
800
+ for (var _name in properties) {
801
+ _del(current, _name, properties[_name].$refName);
802
+ }
803
+ })();
804
+ };
791
805
 
792
- if (properties) {
793
- _context.next = 6;
806
+ if (!(!options || !s.propertyTableState.current)) {
807
+ _context.next = 3;
794
808
  break;
795
809
  }
796
810
 
797
811
  return _context.abrupt("return");
798
812
 
799
- case 6:
800
- delete properties[options.value.$name]; // 删除对象
813
+ case 3:
814
+ current = ((_s$propertyTableState = s.propertyTableState.current) === null || _s$propertyTableState === void 0 ? void 0 : _s$propertyTableState.items) ? (_s$propertyTableState2 = s.propertyTableState.current) === null || _s$propertyTableState2 === void 0 ? void 0 : _s$propertyTableState2.items : s.propertyTableState.current;
801
815
 
802
- s.schema.definitions[options.value.$refName].$count--;
816
+ _del(current, options.value.$name, options.value.$refName);
803
817
 
804
- if (s.schema.definitions[options.value.$refName].$count <= 0) {
805
- delete s.schema.definitions[options.value.$refName];
818
+ // 删除对象
819
+ for (key in s.schema.definitions) {
820
+ if (s.schema.definitions[key].$count <= 0) {
821
+ delete s.schema.definitions[key];
822
+ }
806
823
  }
807
824
 
808
825
  s.schema = _objectSpread2({}, s.schema);
809
826
 
810
- case 10:
827
+ case 7:
811
828
  case "end":
812
829
  return _context.stop();
813
830
  }
@@ -1078,19 +1095,7 @@ var AddPropertyButton = (function () {
1078
1095
  items: getItems(_objectSpread2(_objectSpread2({}, values), {}, {
1079
1096
  $name: name
1080
1097
  })),
1081
- // required: values.required,
1082
1098
  description: values.description,
1083
- // rules: values.isArray ? [{
1084
- // _index: 0,
1085
- // name: '数组容量校验',
1086
- // checkType: 'control',
1087
- // message: '数组超过最大容量',
1088
- // algorithm: 'array-0',
1089
- // minItems: values.minItems ? parseInt(values.minItems) : undefined,
1090
- // maxItems: values.maxItems ? parseInt(values.maxItems) : undefined,
1091
- // exclusiveMinItems: values.exclusiveMinItems,
1092
- // exclusiveMaxItems: values.exclusiveMaxItems,
1093
- // }] : [],
1094
1099
  rules: values.isArray ? [{
1095
1100
  _index: 0,
1096
1101
  name: '数组容量校验(Min)',
@@ -1590,6 +1595,7 @@ var useTableProps = (function () {
1590
1595
 
1591
1596
  var current = s.propertyTableState.current;
1592
1597
  if (!current) return [];
1598
+ var info = current.items ? current.items : current;
1593
1599
  var properties = current.type === 'object' ? current.properties : (_current$items = current.items) === null || _current$items === void 0 ? void 0 : _current$items.properties;
1594
1600
  if (!properties) return [];
1595
1601
  return Object.entries(properties).map(function (e) {
@@ -1598,7 +1604,7 @@ var useTableProps = (function () {
1598
1604
  $name: e[0]
1599
1605
  }),
1600
1606
  ref: s.schema.definitions[e[1].$refName],
1601
- required: current.required || []
1607
+ required: info.required || []
1602
1608
  };
1603
1609
  });
1604
1610
  }, []);
@@ -1780,16 +1786,19 @@ var EditProperty = (function () {
1780
1786
  }, _callee3);
1781
1787
  })), [current, controller, editProperties]);
1782
1788
  React.useEffect(function () {
1789
+ var _info$required;
1790
+
1783
1791
  if (!editProperties) return;
1792
+ var info = (current === null || current === void 0 ? void 0 : current.items) ? current === null || current === void 0 ? void 0 : current.items : current;
1784
1793
  setIsArray(!!editProperties.ref.items);
1785
1794
  form.setFieldsValue({
1786
1795
  $name: editProperties.value.$name,
1787
1796
  title: editProperties.value.alias,
1788
1797
  isArray: !!editProperties.ref.items,
1789
- required: editProperties.required.indexOf(editProperties.value.$name) >= 0,
1798
+ required: ((_info$required = info === null || info === void 0 ? void 0 : info.required) !== null && _info$required !== void 0 ? _info$required : []).indexOf(editProperties.value.$name) >= 0,
1790
1799
  description: editProperties.value.detailed,
1791
1800
  type: initType(editProperties.ref)
1792
- });
1801
+ }); // 数组的设置
1793
1802
 
1794
1803
  if (!!editProperties.ref.items && editProperties.ref.rules) {
1795
1804
  var values = _objectSpread2(_objectSpread2({}, editProperties.ref.rules[0]), editProperties.ref.rules[1]);
@@ -1812,7 +1821,7 @@ var EditProperty = (function () {
1812
1821
  return function () {
1813
1822
  setIsChangeType(false);
1814
1823
  };
1815
- }, [editProperties, form]);
1824
+ }, [editProperties, form, current]);
1816
1825
  var submitButton = React.useMemo(function () {
1817
1826
  if (isChangeType) {
1818
1827
  return /*#__PURE__*/React.createElement(Popconfirm, {
@@ -2536,16 +2545,14 @@ var DelRuleButton = (function (props) {
2536
2545
  while (1) {
2537
2546
  switch (_context.prev = _context.next) {
2538
2547
  case 0:
2539
- debugger;
2540
-
2541
2548
  if (s.ruleState.ruleProperties) {
2542
- _context.next = 3;
2549
+ _context.next = 2;
2543
2550
  break;
2544
2551
  }
2545
2552
 
2546
2553
  return _context.abrupt("return");
2547
2554
 
2548
- case 3:
2555
+ case 2:
2549
2556
  if (s.ruleState.ruleProperties.ref.items) {
2550
2557
  (_s$ruleState$ruleProp = s.ruleState.ruleProperties.ref.items.rules) === null || _s$ruleState$ruleProp === void 0 ? void 0 : _s$ruleState$ruleProp.splice(props.index, 1);
2551
2558
  s.ruleState.ruleProperties.ref.items.rules = (_s$ruleState$ruleProp2 = (_s$ruleState$ruleProp3 = s.ruleState.ruleProperties.ref.items.rules) === null || _s$ruleState$ruleProp3 === void 0 ? void 0 : _s$ruleState$ruleProp3.slice()) !== null && _s$ruleState$ruleProp2 !== void 0 ? _s$ruleState$ruleProp2 : [];
@@ -2554,7 +2561,7 @@ var DelRuleButton = (function (props) {
2554
2561
  s.ruleState.ruleProperties.ref.rules = (_s$ruleState$ruleProp5 = (_s$ruleState$ruleProp6 = s.ruleState.ruleProperties.ref.rules) === null || _s$ruleState$ruleProp6 === void 0 ? void 0 : _s$ruleState$ruleProp6.slice()) !== null && _s$ruleState$ruleProp5 !== void 0 ? _s$ruleState$ruleProp5 : [];
2555
2562
  }
2556
2563
 
2557
- case 4:
2564
+ case 3:
2558
2565
  case "end":
2559
2566
  return _context.stop();
2560
2567
  }
@@ -3465,17 +3472,19 @@ var PageHeader = (function () {
3465
3472
  mode: "multiple"
3466
3473
  }
3467
3474
  },
3468
- '[beginCreateTime,endCreateTime]': {
3469
- key: "[beginCreateTime,endCreateTime]",
3470
- name: "[beginCreateTime,endCreateTime]",
3475
+ createTime: {
3471
3476
  type: "daterange",
3472
- title: "创建时间"
3477
+ title: "创建时间",
3478
+ 'x-props': {
3479
+ extendsFields: ['beginCreateTime', 'endCreateTime']
3480
+ }
3473
3481
  },
3474
- '[beginSendTime,endSendTime]': {
3475
- key: "[beginSendTime,endSendTime]",
3476
- name: "[beginSendTime,endSendTime]",
3482
+ sendTime: {
3477
3483
  type: "daterange",
3478
- title: "更新时间"
3484
+ title: "更新时间",
3485
+ 'x-props': {
3486
+ extendsFields: ['beginSendTime', 'endSendTime']
3487
+ }
3479
3488
  }
3480
3489
  }
3481
3490
  };
@@ -3539,11 +3548,12 @@ var PageHeader = (function () {
3539
3548
  enum: profileEnum,
3540
3549
  visible: false
3541
3550
  },
3542
- '[beginCreateTime,endCreateTime]': {
3543
- key: "[beginCreateTime,endCreateTime]",
3544
- name: "[beginCreateTime,endCreateTime]",
3551
+ createTime: {
3545
3552
  type: "daterange",
3546
- title: "发布时间"
3553
+ title: "发布时间",
3554
+ 'x-props': {
3555
+ extendsFields: ['beginCreateTime', 'endCreateTime']
3556
+ }
3547
3557
  } // '[beginSendTime,endSendTime]': {
3548
3558
  // key: "[beginSendTime,endSendTime]",
3549
3559
  // name: "[beginSendTime,endSendTime]",
@@ -3912,7 +3922,7 @@ function validaterule(props) {
3912
3922
  return moment(text).format('YYYY-MM-DD HH:mm');
3913
3923
  }
3914
3924
  }, {
3915
- title: '最近更新时间',
3925
+ title: '更新时间',
3916
3926
  dataIndex: 'updateAt',
3917
3927
  render: function render(text) {
3918
3928
  return moment(text).format('YYYY-MM-DD HH:mm');
@@ -6487,11 +6497,12 @@ var Header = (function () {
6487
6497
  "value": 2
6488
6498
  }]
6489
6499
  },
6490
- '[beginCreateTime,endCreateTime]': {
6491
- key: "[beginCreateTime,endCreateTime]",
6492
- name: "[beginCreateTime,endCreateTime]",
6500
+ createTime: {
6493
6501
  type: "daterange",
6494
- title: "创建时间"
6502
+ title: "创建时间",
6503
+ 'x-props': {
6504
+ extendsFields: ['beginCreateTime', 'endCreateTime']
6505
+ }
6495
6506
  } // '[beginUpdateTime,endUpdateTime]': {
6496
6507
  // key: "[beginUpdateTime,endUpdateTime]",
6497
6508
  // name: "[beginUpdateTime,endUpdateTime]",
@@ -6954,11 +6965,12 @@ var Header$1 = (function () {
6954
6965
  "value": 2
6955
6966
  }]
6956
6967
  },
6957
- '[beginCreateTime,endCreateTime]': {
6958
- key: "[beginCreateTime,endCreateTime]",
6959
- name: "[beginCreateTime,endCreateTime]",
6968
+ createTime: {
6960
6969
  type: "daterange",
6961
- title: "创建时间"
6970
+ title: "创建时间",
6971
+ 'x-props': {
6972
+ extendsFields: ['beginCreateTime', 'endCreateTime']
6973
+ }
6962
6974
  } // '[beginUpdateTime,endUpdateTime]': {
6963
6975
  // key: "[beginUpdateTime,endUpdateTime]",
6964
6976
  // name: "[beginUpdateTime,endUpdateTime]",