cloud-b2b 1.0.0 → 1.0.1

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 (172) hide show
  1. package/es/Card/Card.js +20 -0
  2. package/es/Card/package.json +6 -0
  3. package/es/Control/Control.js +402 -0
  4. package/es/Control/event.js +57 -0
  5. package/es/Control/package.json +6 -0
  6. package/es/Enhance/Dialogs.js +67 -0
  7. package/es/Enhance/Loading.js +151 -0
  8. package/es/Enhance/index.js +8 -0
  9. package/es/Enhance/package.json +6 -0
  10. package/es/Header/Header.js +194 -0
  11. package/es/Header/Header.less +94 -0
  12. package/es/Header/Vertical.js +129 -0
  13. package/es/Header/Vertical.less +60 -0
  14. package/es/Header/package.json +6 -0
  15. package/es/HomeHeader/Header.js +75 -0
  16. package/es/HomeHeader/Header.less +73 -0
  17. package/es/HomeHeader/package.json +6 -0
  18. package/es/ImageView/ImageView.js +117 -0
  19. package/es/ImageView/ImageView.less +14 -0
  20. package/es/ImageView/package.json +6 -0
  21. package/es/InpurCascader/InputCascader.js +135 -0
  22. package/es/InpurCascader/package.json +6 -0
  23. package/es/InputEditor/InputEditor.js +118 -0
  24. package/es/InputEditor/inputEditor.less +8 -0
  25. package/es/InputEditor/package.json +6 -0
  26. package/es/InputSearch/InputSearch.js +306 -0
  27. package/es/InputSearch/package.json +6 -0
  28. package/es/InputSelect/InputSelect.js +185 -0
  29. package/es/InputSelect/package.json +6 -0
  30. package/es/InputWriting/InputWriting.js +107 -0
  31. package/es/InputWriting/package.json +6 -0
  32. package/es/Layout/Layout.js +232 -0
  33. package/es/Layout/Layout.less +28 -0
  34. package/es/Layout/package.json +6 -0
  35. package/es/LayoutLink/LayoutLink.js +82 -0
  36. package/es/LayoutLink/LayoutLink.less +53 -0
  37. package/es/LayoutLink/package.json +6 -0
  38. package/es/Link/Link.js +108 -0
  39. package/es/Link/package.json +6 -0
  40. package/es/Loading/Loading.js +15 -0
  41. package/es/Loading/Loading.less +13 -0
  42. package/es/Loading/package.json +6 -0
  43. package/es/Loading2/Loading2.js +11 -0
  44. package/es/Loading2/Loading2.less +19 -0
  45. package/es/Loading2/package.json +6 -0
  46. package/es/ModalWithDrag/ModalWithDrag.js +34 -0
  47. package/es/ModalWithDrag/ModalWithDrag.less +6 -0
  48. package/es/ModalWithDrag/drag.js +133 -0
  49. package/es/ModalWithDrag/package.json +6 -0
  50. package/es/NumberInput/NumberInput.js +237 -0
  51. package/es/NumberInput/package.json +6 -0
  52. package/es/Search/Search.js +581 -0
  53. package/es/Search/Search.less +63 -0
  54. package/es/Search/package.json +6 -0
  55. package/es/Sidebar/Sidebar.js +165 -0
  56. package/es/Sidebar/Sidebar.less +77 -0
  57. package/es/Sidebar/package.json +6 -0
  58. package/es/Sidebar2/Sidebar.js +192 -0
  59. package/es/Sidebar2/Sidebar.less +153 -0
  60. package/es/Sidebar2/package.json +6 -0
  61. package/es/SuperForm/SuperForm.js +641 -0
  62. package/es/SuperForm/SuperForm.less +52 -0
  63. package/es/SuperForm/package.json +6 -0
  64. package/es/SuperIcon/SuperIcon.js +30 -0
  65. package/es/SuperIcon/package.json +6 -0
  66. package/es/SuperPagination/SuperPagination.js +126 -0
  67. package/es/SuperPagination/package.json +6 -0
  68. package/es/SuperToolbar/SuperToolbar.js +223 -0
  69. package/es/SuperToolbar/SuperToolbar.less +17 -0
  70. package/es/SuperToolbar/package.json +6 -0
  71. package/es/SuperUpload/SuperUpload.js +282 -0
  72. package/es/SuperUpload/SuperUpload.less +27 -0
  73. package/es/SuperUpload/package.json +6 -0
  74. package/es/Viewer/ImageViews.js +311 -0
  75. package/es/Viewer/Viewer.js +149 -0
  76. package/es/Viewer/Viewer.less +67 -0
  77. package/es/Viewer/imgView.less +59 -0
  78. package/es/Viewer/package.json +7 -0
  79. package/es/WingBlank/WingBlank.js +20 -0
  80. package/es/WingBlank/WingBlank.less +12 -0
  81. package/es/WingBlank/package.json +6 -0
  82. package/es/helper.js +118 -0
  83. package/es/history.js +5 -0
  84. package/es/index.js +24 -1
  85. package/es/variables.less +73 -73
  86. package/lib/Card/Card.js +38 -0
  87. package/lib/Card/package.json +6 -0
  88. package/lib/Control/Control.js +449 -0
  89. package/lib/Control/event.js +68 -0
  90. package/lib/Control/package.json +6 -0
  91. package/lib/Enhance/Dialogs.js +87 -0
  92. package/lib/Enhance/Loading.js +175 -0
  93. package/lib/Enhance/index.js +35 -0
  94. package/lib/Enhance/package.json +6 -0
  95. package/lib/Header/Header.js +215 -0
  96. package/lib/Header/Header.less +94 -0
  97. package/lib/Header/Vertical.js +150 -0
  98. package/lib/Header/Vertical.less +60 -0
  99. package/lib/Header/package.json +6 -0
  100. package/lib/HomeHeader/Header.js +95 -0
  101. package/lib/HomeHeader/Header.less +73 -0
  102. package/lib/HomeHeader/package.json +6 -0
  103. package/lib/ImageView/ImageView.js +134 -0
  104. package/lib/ImageView/ImageView.less +14 -0
  105. package/lib/ImageView/package.json +6 -0
  106. package/lib/InpurCascader/InputCascader.js +156 -0
  107. package/lib/InpurCascader/package.json +6 -0
  108. package/lib/InputEditor/InputEditor.js +136 -0
  109. package/lib/InputEditor/inputEditor.less +8 -0
  110. package/lib/InputEditor/package.json +6 -0
  111. package/lib/InputSearch/InputSearch.js +322 -0
  112. package/lib/InputSearch/package.json +6 -0
  113. package/lib/InputSelect/InputSelect.js +208 -0
  114. package/lib/InputSelect/package.json +6 -0
  115. package/lib/InputWriting/InputWriting.js +123 -0
  116. package/lib/InputWriting/package.json +6 -0
  117. package/lib/Layout/Layout.js +258 -0
  118. package/lib/Layout/Layout.less +28 -0
  119. package/lib/Layout/package.json +6 -0
  120. package/lib/LayoutLink/LayoutLink.js +114 -0
  121. package/lib/LayoutLink/LayoutLink.less +53 -0
  122. package/lib/LayoutLink/package.json +6 -0
  123. package/lib/Link/Link.js +130 -0
  124. package/lib/Link/package.json +6 -0
  125. package/lib/Loading/Loading.js +30 -0
  126. package/lib/Loading/Loading.less +13 -0
  127. package/lib/Loading/package.json +6 -0
  128. package/lib/Loading2/Loading2.js +26 -0
  129. package/lib/Loading2/Loading2.less +19 -0
  130. package/lib/Loading2/package.json +6 -0
  131. package/lib/ModalWithDrag/ModalWithDrag.js +53 -0
  132. package/lib/ModalWithDrag/ModalWithDrag.less +6 -0
  133. package/lib/ModalWithDrag/drag.js +147 -0
  134. package/lib/ModalWithDrag/package.json +6 -0
  135. package/lib/NumberInput/NumberInput.js +259 -0
  136. package/lib/NumberInput/package.json +6 -0
  137. package/lib/Search/Search.js +603 -0
  138. package/lib/Search/Search.less +63 -0
  139. package/lib/Search/package.json +6 -0
  140. package/lib/Sidebar/Sidebar.js +186 -0
  141. package/lib/Sidebar/Sidebar.less +77 -0
  142. package/lib/Sidebar/package.json +6 -0
  143. package/lib/Sidebar2/Sidebar.js +213 -0
  144. package/lib/Sidebar2/Sidebar.less +153 -0
  145. package/lib/Sidebar2/package.json +6 -0
  146. package/lib/SuperForm/SuperForm.js +657 -0
  147. package/lib/SuperForm/SuperForm.less +52 -0
  148. package/lib/SuperForm/package.json +6 -0
  149. package/lib/SuperIcon/SuperIcon.js +47 -0
  150. package/lib/SuperIcon/package.json +6 -0
  151. package/lib/SuperPagination/SuperPagination.js +145 -0
  152. package/lib/SuperPagination/package.json +6 -0
  153. package/lib/SuperToolbar/SuperToolbar.js +248 -0
  154. package/lib/SuperToolbar/SuperToolbar.less +17 -0
  155. package/lib/SuperToolbar/package.json +6 -0
  156. package/lib/SuperUpload/SuperUpload.js +324 -0
  157. package/lib/SuperUpload/SuperUpload.less +27 -0
  158. package/lib/SuperUpload/package.json +6 -0
  159. package/lib/Viewer/ImageViews.js +323 -0
  160. package/lib/Viewer/Viewer.js +167 -0
  161. package/lib/Viewer/Viewer.less +67 -0
  162. package/lib/Viewer/imgView.less +59 -0
  163. package/lib/Viewer/package.json +7 -0
  164. package/lib/WingBlank/WingBlank.js +37 -0
  165. package/lib/WingBlank/WingBlank.less +12 -0
  166. package/lib/WingBlank/package.json +6 -0
  167. package/lib/helper.js +147 -0
  168. package/lib/history.js +18 -0
  169. package/lib/index.js +208 -1
  170. package/lib/index.less +20 -1
  171. package/lib/variables.less +73 -73
  172. package/package.json +3 -2
@@ -0,0 +1,75 @@
1
+ import _DatePicker from "antd/es/date-picker";
2
+ import _Radio from "antd/es/radio";
3
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
4
+ import _bindInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/bind";
5
+ import React from 'react';
6
+ import moment from 'moment';
7
+ import variables from '../variables';
8
+ var RadioGroup = _Radio.Group;
9
+ var RadioButton = _Radio.Button;
10
+ var FILTERS = [{
11
+ key: 'day',
12
+ title: '日'
13
+ }, {
14
+ key: 'week',
15
+ title: '周'
16
+ }, {
17
+ key: 'month',
18
+ title: '月'
19
+ }, {
20
+ key: 'year',
21
+ title: '年'
22
+ }];
23
+
24
+ function Tabs(_ref) {
25
+ var items = _ref.items,
26
+ activeKey = _ref.activeKey,
27
+ onKeyChange = _ref.onKeyChange;
28
+ return /*#__PURE__*/React.createElement(RadioGroup, {
29
+ value: activeKey,
30
+ onChange: function onChange(e) {
31
+ return onKeyChange(e.target.value);
32
+ },
33
+ buttonStyle: "solid",
34
+ size: "small"
35
+ }, _mapInstanceProperty(items).call(items, function (item, index) {
36
+ return /*#__PURE__*/React.createElement(RadioButton, {
37
+ key: index,
38
+ value: item.key
39
+ }, item.title + (item.unit || ''));
40
+ }));
41
+ }
42
+
43
+ function Header(_ref2) {
44
+ var title = _ref2.title,
45
+ activeKey = _ref2.activeKey,
46
+ tabs = _ref2.tabs,
47
+ onPageChange = _ref2.onPageChange,
48
+ filterKey = _ref2.filterKey,
49
+ filterDate = _ref2.filterDate,
50
+ onFilterChange = _ref2.onFilterChange;
51
+
52
+ var onChange = function onChange(date, strDate) {
53
+ onFilterChange && onFilterChange('date', strDate);
54
+ };
55
+
56
+ var dateValue = filterDate ? moment(filterDate) : null;
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ className: variables('HomeHeader')
59
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", null, title)), /*#__PURE__*/React.createElement(Tabs, {
60
+ items: tabs,
61
+ activeKey: activeKey,
62
+ onKeyChange: onPageChange
63
+ }), /*#__PURE__*/React.createElement("div", null, false ? /*#__PURE__*/React.createElement(Tabs, {
64
+ items: FILTERS,
65
+ activeKey: filterKey,
66
+ onKeyChange: _bindInstanceProperty(onFilterChange).call(onFilterChange, null, 'tab')
67
+ }) : null, activeKey === 'platform' ? /*#__PURE__*/React.createElement(_DatePicker, {
68
+ onChange: onChange,
69
+ size: "small",
70
+ allowClear: false,
71
+ value: dateValue
72
+ }) : null));
73
+ }
74
+
75
+ export default Header;
@@ -0,0 +1,73 @@
1
+ @import '../variables';
2
+
3
+ @header-height: @one-pixel * 80;
4
+
5
+ .@{cloudlink-prefix}-HomeHeader {
6
+ > div:first-child {
7
+ position: relative;
8
+ height: @header-height;
9
+ line-height: @header-height - @one-pixel * 6;
10
+ text-align: center;
11
+ background: url('/platformHome/head_bg.png') no-repeat;
12
+ background-size: 100% 100%;
13
+ color: #33EDFC;
14
+ font-size: @one-pixel * 32;
15
+ font-weight: bold;
16
+ margin: 0 280 * @one-pixel;
17
+ }
18
+
19
+ > div:nth-child(2) {
20
+ color: white;
21
+ float: left;
22
+ margin-top: -@header-height + 20 * @one-pixel;
23
+ }
24
+
25
+ > div:last-child {
26
+ float: right;
27
+ margin-top: -@header-height + 20 * @one-pixel;
28
+ color: white;
29
+
30
+ > div {
31
+ display: inline-block;
32
+ margin-right: 5 * @one-pixel;
33
+ }
34
+
35
+ > span > div {
36
+ > input {
37
+ background-color: transparent;
38
+ color: white;
39
+ border-color: #33edfc;
40
+ width: 100px;
41
+ }
42
+
43
+ > i {
44
+ color: white;
45
+ }
46
+ }
47
+ }
48
+
49
+ :global {
50
+ .ant-radio-button-wrapper {
51
+ background: transparent;
52
+ color: white;
53
+ border-radius: 0;
54
+ border-color: #33EDFC;
55
+ transition: none;
56
+ }
57
+
58
+ .ant-radio-button-wrapper-checked,
59
+ .ant-radio-button-wrapper-checked:hover {
60
+ background: #33EDFC;
61
+ color: #162C55;
62
+ border-color: #33EDFC;
63
+ }
64
+
65
+ .ant-radio-button-wrapper-checked {
66
+ box-shadow: none;
67
+ }
68
+
69
+ .ant-radio-button-wrapper:hover {
70
+ border-color: #33EDFC;
71
+ }
72
+ }
73
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "Header",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./Header.js"
6
+ }
@@ -0,0 +1,117 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Empty from "antd/es/empty";
3
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
4
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
5
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
6
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
7
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
8
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
9
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
10
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
11
+
12
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
13
+
14
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
15
+
16
+ import React from 'react';
17
+ import { ModalWithDrag, Title } from '../index';
18
+ import variables from '../variables';
19
+
20
+ var ImageView = /*#__PURE__*/function (_React$Component) {
21
+ _inherits(ImageView, _React$Component);
22
+
23
+ var _super = _createSuper(ImageView);
24
+
25
+ function ImageView(_props) {
26
+ var _this;
27
+
28
+ _classCallCheck(this, ImageView);
29
+
30
+ _this = _super.call(this, _props);
31
+
32
+ _defineProperty(_assertThisInitialized(_this), "ClosePreview", function () {
33
+ _this.setState({
34
+ previewVisible: false
35
+ });
36
+ });
37
+
38
+ _defineProperty(_assertThisInitialized(_this), "showBigImg", function () {
39
+ var imgList = _this.props.imgList;
40
+ var _this$state = _this.state,
41
+ previewVisible = _this$state.previewVisible,
42
+ index = _this$state.index;
43
+ var props = {
44
+ width: 900,
45
+ title: imgList[index].fileName,
46
+ onCancel: _this.ClosePreview,
47
+ visible: previewVisible,
48
+ maskClosable: true,
49
+ footer: null
50
+ };
51
+ return /*#__PURE__*/React.createElement(ModalWithDrag, props, /*#__PURE__*/React.createElement("img", {
52
+ alt: "example",
53
+ style: {
54
+ width: '100%'
55
+ },
56
+ src: imgList[index].fileUrl
57
+ }));
58
+ });
59
+
60
+ _defineProperty(_assertThisInitialized(_this), "toSeeImg", function (e) {
61
+ if (_this.props.toSeeImg) {
62
+ _this.props.toSeeImg(e);
63
+ } else {
64
+ _this.myClick(e.index);
65
+ }
66
+ });
67
+
68
+ _defineProperty(_assertThisInitialized(_this), "myClick", function (index) {
69
+ _this.setState({
70
+ previewVisible: true,
71
+ index: index
72
+ });
73
+ });
74
+
75
+ _this.state = {
76
+ previewVisible: false,
77
+ index: 0
78
+ };
79
+ return _this;
80
+ }
81
+
82
+ _createClass(ImageView, [{
83
+ key: "render",
84
+ value: function render() {
85
+ var _this2 = this;
86
+
87
+ var _this$props = this.props,
88
+ imgList = _this$props.imgList,
89
+ title = _this$props.title,
90
+ toSeeImg = _this$props.toSeeImg;
91
+ return /*#__PURE__*/React.createElement("div", {
92
+ className: variables('ImageView')
93
+ }, title ? /*#__PURE__*/React.createElement(Title, {
94
+ title: title
95
+ }) : null, imgList.length === 0 ? /*#__PURE__*/React.createElement(_Empty, {
96
+ image: _Empty.PRESENTED_IMAGE_SIMPLE
97
+ }) : _mapInstanceProperty(imgList).call(imgList, function (item, index) {
98
+ return /*#__PURE__*/React.createElement("div", {
99
+ className: 'imgBox',
100
+ key: index,
101
+ onClick: function onClick() {
102
+ return _this2.toSeeImg({
103
+ imgArr: imgList,
104
+ index: index
105
+ });
106
+ }
107
+ }, /*#__PURE__*/React.createElement("img", {
108
+ src: item.fileUrl
109
+ }), /*#__PURE__*/React.createElement("p", null, item.fileName));
110
+ }), toSeeImg ? null : this.showBigImg());
111
+ }
112
+ }]);
113
+
114
+ return ImageView;
115
+ }(React.Component);
116
+
117
+ export default ImageView;
@@ -0,0 +1,14 @@
1
+ @import '../variables';
2
+
3
+ .@{cloudlink-prefix}-ImageView {
4
+ overflow: hidden;
5
+ img{
6
+ width: 200px;
7
+ height: 200px;
8
+ }
9
+ .imgBox{
10
+ float: left;
11
+ text-align: center;
12
+ margin-right: 10px;
13
+ }
14
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "ImageView",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./ImageView.js"
6
+ }
@@ -0,0 +1,135 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
3
+ import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
4
+ import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
5
+ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
6
+ import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
7
+ import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
8
+ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
9
+ import _Cascader from "antd/es/cascader";
10
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
11
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
12
+ import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
13
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
14
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
15
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
16
+ import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
17
+
18
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
+
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
21
+
22
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
23
+
24
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
25
+
26
+ import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
27
+ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
28
+ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
29
+ //级联选择input
30
+ import React from 'react';
31
+ import PropTypes from 'prop-types';
32
+ import { getObjectExclude } from '../helper';
33
+ var optionsType = {
34
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
35
+ disabled: PropTypes.bool,
36
+ children: PropTypes.array,
37
+ title: PropTypes.string,
38
+ isLeaf: PropTypes.bool //false 就会触发 loadData 方法,从而在loadData方法中请求下一级数据,
39
+
40
+ };
41
+ var PROPS = {
42
+ options: PropTypes.arrayOf(PropTypes.shape(optionsType)).isRequired,
43
+ value: PropTypes.array.isRequired,
44
+ placeholder: PropTypes.string,
45
+ onChange: PropTypes.func,
46
+ loadData: PropTypes.func,
47
+ //动态加载 ps:loadData 与 showSearch 无法一起使用
48
+ showSearch: PropTypes.func
49
+ };
50
+
51
+ var PROPS_KEYS = _Object$keys(PROPS);
52
+
53
+ var InputCascader = /*#__PURE__*/function (_React$Component) {
54
+ _inherits(InputCascader, _React$Component);
55
+
56
+ var _super = _createSuper(InputCascader);
57
+
58
+ function InputCascader(_props) {
59
+ var _this;
60
+
61
+ _classCallCheck(this, InputCascader);
62
+
63
+ _this = _super.call(this, _props);
64
+
65
+ _defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
66
+ var onChange = _this.props.onChange;
67
+ onChange && onChange(value);
68
+ });
69
+
70
+ _defineProperty(_assertThisInitialized(_this), "loadData", function (selectedOptions) {
71
+ var onSearch = _this.props.onSearch;
72
+ onSearch && onSearch(selectedOptions[0]);
73
+ });
74
+
75
+ _defineProperty(_assertThisInitialized(_this), "getOptions", function (options) {
76
+ return _mapInstanceProperty(options).call(options, function (option) {
77
+ var obj = _objectSpread(_objectSpread({}, option), {}, {
78
+ label: option.title
79
+ });
80
+
81
+ if (option.children && option.children.length > 0) {
82
+ obj.children = _this.getOptions(option.children);
83
+ }
84
+
85
+ return obj;
86
+ });
87
+ });
88
+
89
+ _defineProperty(_assertThisInitialized(_this), "showSearch", function (inputValue, path) {});
90
+
91
+ _defineProperty(_assertThisInitialized(_this), "getProps", function () {
92
+ var _this$props = _this.props,
93
+ _this$props$options = _this$props.options,
94
+ options = _this$props$options === void 0 ? [] : _this$props$options,
95
+ placeholder = _this$props.placeholder,
96
+ size = _this$props.size,
97
+ value = _this$props.value,
98
+ loadData = _this$props.loadData,
99
+ showSearch = _this$props.showSearch;
100
+
101
+ var props = _Object$assign(getObjectExclude({}, PROPS_KEYS), {
102
+ onChange: _this.onChange,
103
+ value: value,
104
+ options: _this.getOptions(options),
105
+ changeOnSelect: true,
106
+ placeholder: placeholder,
107
+ size: size
108
+ }); //动态加载 ps:loadData 与 showSearch 无法一起使用
109
+
110
+
111
+ if (loadData) {
112
+ props.loadData = _this.loadData;
113
+ } else if (showSearch) {
114
+ props.showSearch = _this.showSearch;
115
+ }
116
+
117
+ return props;
118
+ });
119
+
120
+ return _this;
121
+ }
122
+
123
+ _createClass(InputCascader, [{
124
+ key: "render",
125
+ value: function render() {
126
+ return /*#__PURE__*/React.createElement(_Cascader, this.getProps());
127
+ }
128
+ }]);
129
+
130
+ return InputCascader;
131
+ }(React.Component);
132
+
133
+ _defineProperty(InputCascader, "propTypes", PROPS);
134
+
135
+ export default InputCascader;
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "InputCascader",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./InputCascader.js"
6
+ }
@@ -0,0 +1,118 @@
1
+ import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
2
+ import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
3
+ import _createClass from "@babel/runtime-corejs3/helpers/createClass";
4
+ import _inherits from "@babel/runtime-corejs3/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime-corejs3/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime-corejs3/helpers/getPrototypeOf";
7
+
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+
10
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
11
+
12
+ import React from 'react';
13
+ import variables from '../variables';
14
+ var defaultMenus = ['head', // 标题
15
+ 'bold', // 粗体
16
+ 'fontSize', // 字号
17
+ 'fontName', // 字体
18
+ 'italic', // 斜体
19
+ 'underline', // 下划线
20
+ 'strikeThrough', // 删除线
21
+ 'foreColor', // 文字颜色
22
+ 'backColor', // 背景颜色
23
+ 'link', // 插入链接
24
+ 'list', // 列表
25
+ 'justify', // 对齐方式
26
+ 'quote', // 引用
27
+ 'image', // 插入图片
28
+ 'table', // 表格
29
+ 'code' // 插入代码
30
+ ];
31
+
32
+ var InputEditor = /*#__PURE__*/function (_React$Component) {
33
+ _inherits(InputEditor, _React$Component);
34
+
35
+ var _super = _createSuper(InputEditor);
36
+
37
+ function InputEditor() {
38
+ _classCallCheck(this, InputEditor);
39
+
40
+ return _super.apply(this, arguments);
41
+ }
42
+
43
+ _createClass(InputEditor, [{
44
+ key: "componentDidMount",
45
+ value: function componentDidMount() {
46
+ var _this$props = this.props,
47
+ inputKey = _this$props.inputKey,
48
+ menus = _this$props.menus,
49
+ color = _this$props.color,
50
+ _this$props$showLinkI = _this$props.showLinkImg,
51
+ showLinkImg = _this$props$showLinkI === void 0 ? true : _this$props$showLinkI,
52
+ _this$props$uploadImg = _this$props.uploadImgShowBase64,
53
+ uploadImgShowBase64 = _this$props$uploadImg === void 0 ? true : _this$props$uploadImg,
54
+ onChange = _this$props.onChange,
55
+ value = _this$props.value,
56
+ readonly = _this$props.readonly;
57
+
58
+ if (!readonly) {
59
+ var elem = this.refs[inputKey];
60
+ this[inputKey] = new E(elem); //配置菜单
61
+
62
+ menus && (this[inputKey].customConfig.menus = menus); //配置颜色
63
+
64
+ color && (this[inputKey].customConfig.menus = color); //配置菜单
65
+
66
+ this[inputKey].customConfig.menus = defaultMenus;
67
+
68
+ if (menus) {
69
+ this[inputKey].customConfig.menus = menus;
70
+ }
71
+
72
+ this[inputKey].customConfig.uploadImgShowBase64 = uploadImgShowBase64; //是否可以上传图片
73
+
74
+ this[inputKey].customConfig.showLinkImg = showLinkImg; //隐藏网络图片
75
+
76
+ this[inputKey].customConfig.onchange = function (html) {
77
+ onChange && onChange(html);
78
+ }; //配置编辑区域的 z-index
79
+
80
+
81
+ this[inputKey].customConfig.zIndex = 0;
82
+ this[inputKey].create();
83
+ this[inputKey].txt.html(value);
84
+ }
85
+ }
86
+ }, {
87
+ key: "componentDidUpdate",
88
+ value: function componentDidUpdate() {
89
+ var _this$props2 = this.props,
90
+ inputKey = _this$props2.inputKey,
91
+ _this$props2$value = _this$props2.value,
92
+ value = _this$props2$value === void 0 ? '' : _this$props2$value,
93
+ readonly = _this$props2.readonly;
94
+ !readonly && !value && this[inputKey].txt.html(value); //支持清空操作
95
+ }
96
+ }, {
97
+ key: "render",
98
+ value: function render() {
99
+ var _this$props3 = this.props,
100
+ inputKey = _this$props3.inputKey,
101
+ readonly = _this$props3.readonly,
102
+ value = _this$props3.value;
103
+ return /*#__PURE__*/React.createElement("div", {
104
+ className: variables('InputEditor')
105
+ }, readonly ? /*#__PURE__*/React.createElement("div", {
106
+ dangerouslySetInnerHTML: {
107
+ __html: "".concat(value)
108
+ }
109
+ }) : /*#__PURE__*/React.createElement("div", {
110
+ ref: inputKey
111
+ }));
112
+ }
113
+ }]);
114
+
115
+ return InputEditor;
116
+ }(React.Component);
117
+
118
+ export default InputEditor;
@@ -0,0 +1,8 @@
1
+ .@{cloudlink-prefix}-InputEditor {
2
+ ol{
3
+ list-style-type:decimal;
4
+ }
5
+ ul{
6
+ list-style:outside;
7
+ }
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "InputEditor",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "main": "./InputEditor.js"
6
+ }