@grapecity-software/spread-sheets-designer-react 17.0.2
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/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# SpreadJS Designer Wrapper Components for React
|
|
2
|
+
|
|
3
|
+
包含了用于在 React 中使用 [SpreadJS Designer](https://www.grapecity.com.cn/developer/spreadjs) 的表格编辑器包装组件插件。
|
|
4
|
+
|
|
5
|
+
SpreadJS Designer React 包装组件。
|
|
6
|
+
|
|
7
|
+
## 安装模块/插件
|
|
8
|
+
```sh
|
|
9
|
+
npm install @grapecity-software/spread-sheets-designer-react
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## 获取更多帮助
|
|
13
|
+
想需要获取更多产品信息,请浏览 [SpreadJS 主页](https://www.grapecity.com.cn/developer/spreadjs)
|
|
14
|
+
|
|
15
|
+
您可以在论坛中提出任何您使用产品过程中遇到的问题: [技术支持论坛](https://gcdn.grapecity.com.cn/showforum-232-1.html)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import * as GC from '@grapecity-software/spread-sheets-designer';
|
|
4
|
+
import {Spread} from '@grapecity-software/spread-sheets';
|
|
5
|
+
import * as CSS from 'csstype';
|
|
6
|
+
|
|
7
|
+
export interface DesignerProp {
|
|
8
|
+
config? : GC.Spread.Sheets.Designer.IDesignerConfig;
|
|
9
|
+
styleInfo? : CSS.Properties;
|
|
10
|
+
spreadOptions? : Spread.Sheets.IWorkBookDefaultOptions;
|
|
11
|
+
designerInitialized?: Function;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare class Designer extends React.Component<DesignerProp, any> {
|
|
15
|
+
}
|
|
16
|
+
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Spread.Sheets.Designer Wrapper Components for React 17.0.2
|
|
4
|
+
*
|
|
5
|
+
* Copyright(c) GrapeCity Software inc. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the SpreadJS Commercial License.
|
|
8
|
+
* info.xa@grapecity.com
|
|
9
|
+
* https://www.grapecity.com.cn/developer/spreadjs
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
13
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
14
|
+
module.exports = factory(require("react"), require("@grapecity-software/spread-sheets"), require("@grapecity-software/spread-sheets-designer"));
|
|
15
|
+
else if(typeof define === 'function' && define.amd)
|
|
16
|
+
define(["react", "@grapecity-software/spread-sheets", "@grapecity-software/spread-sheets-designer"], factory);
|
|
17
|
+
else if(typeof exports === 'object')
|
|
18
|
+
exports["SpreadSheetsDesignerComponents"] = factory(require("react"), require("@grapecity-software/spread-sheets"), require("@grapecity-software/spread-sheets-designer"));
|
|
19
|
+
else
|
|
20
|
+
root["SpreadSheetsDesignerComponents"] = factory(root["react"], root["@grapecity-software/spread-sheets"], root["@grapecity-software/spread-sheets-designer"]);
|
|
21
|
+
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_6__) {
|
|
22
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
23
|
+
/******/ // The module cache
|
|
24
|
+
/******/ var installedModules = {};
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // The require function
|
|
27
|
+
/******/ function __webpack_require__(moduleId) {
|
|
28
|
+
/******/
|
|
29
|
+
/******/ // Check if module is in cache
|
|
30
|
+
/******/ if(installedModules[moduleId])
|
|
31
|
+
/******/ return installedModules[moduleId].exports;
|
|
32
|
+
/******/
|
|
33
|
+
/******/ // Create a new module (and put it into the cache)
|
|
34
|
+
/******/ var module = installedModules[moduleId] = {
|
|
35
|
+
/******/ exports: {},
|
|
36
|
+
/******/ id: moduleId,
|
|
37
|
+
/******/ loaded: false
|
|
38
|
+
/******/ };
|
|
39
|
+
/******/
|
|
40
|
+
/******/ // Execute the module function
|
|
41
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
42
|
+
/******/
|
|
43
|
+
/******/ // Flag the module as loaded
|
|
44
|
+
/******/ module.loaded = true;
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // Return the exports of the module
|
|
47
|
+
/******/ return module.exports;
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/
|
|
50
|
+
/******/
|
|
51
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
52
|
+
/******/ __webpack_require__.m = modules;
|
|
53
|
+
/******/
|
|
54
|
+
/******/ // expose the module cache
|
|
55
|
+
/******/ __webpack_require__.c = installedModules;
|
|
56
|
+
/******/
|
|
57
|
+
/******/ // __webpack_public_path__
|
|
58
|
+
/******/ __webpack_require__.p = "";
|
|
59
|
+
/******/
|
|
60
|
+
/******/ // Load entry module and return exports
|
|
61
|
+
/******/ return __webpack_require__(0);
|
|
62
|
+
/******/ })
|
|
63
|
+
/************************************************************************/
|
|
64
|
+
/******/ ([
|
|
65
|
+
/* 0 */
|
|
66
|
+
/*!**********************!*\
|
|
67
|
+
!*** ./lib/entry.js ***!
|
|
68
|
+
\**********************/
|
|
69
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
70
|
+
|
|
71
|
+
'use strict';
|
|
72
|
+
|
|
73
|
+
Object.defineProperty(exports, "__esModule", {
|
|
74
|
+
value: true
|
|
75
|
+
});
|
|
76
|
+
exports.Designer = undefined;
|
|
77
|
+
|
|
78
|
+
var _Designer = __webpack_require__(/*! ./Designer/Designer */ 1);
|
|
79
|
+
|
|
80
|
+
var _Designer2 = _interopRequireDefault(_Designer);
|
|
81
|
+
|
|
82
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
+
|
|
84
|
+
exports.Designer = _Designer2.default;
|
|
85
|
+
|
|
86
|
+
/***/ }),
|
|
87
|
+
/* 1 */
|
|
88
|
+
/*!**********************************!*\
|
|
89
|
+
!*** ./lib/Designer/Designer.js ***!
|
|
90
|
+
\**********************************/
|
|
91
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
92
|
+
|
|
93
|
+
"use strict";
|
|
94
|
+
|
|
95
|
+
Object.defineProperty(exports, "__esModule", {
|
|
96
|
+
value: true
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
100
|
+
|
|
101
|
+
var _reactJSImport = __webpack_require__(/*! ../utils/reactJSImport */ 2);
|
|
102
|
+
|
|
103
|
+
var _reactJSImport2 = _interopRequireDefault(_reactJSImport);
|
|
104
|
+
|
|
105
|
+
var _spreadJSImport = __webpack_require__(/*! ../utils/spreadJSImport */ 4);
|
|
106
|
+
|
|
107
|
+
var _spreadJSImport2 = _interopRequireDefault(_spreadJSImport);
|
|
108
|
+
|
|
109
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
110
|
+
|
|
111
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
112
|
+
|
|
113
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
114
|
+
|
|
115
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
116
|
+
|
|
117
|
+
var Designer = function (_React$Component) {
|
|
118
|
+
_inherits(Designer, _React$Component);
|
|
119
|
+
|
|
120
|
+
function Designer(props) {
|
|
121
|
+
_classCallCheck(this, Designer);
|
|
122
|
+
|
|
123
|
+
var _this = _possibleConstructorReturn(this, (Designer.__proto__ || Object.getPrototypeOf(Designer)).call(this, props));
|
|
124
|
+
|
|
125
|
+
_this.designerHost = _reactJSImport2.default.createRef();
|
|
126
|
+
_this.designer = null;
|
|
127
|
+
_this.config = props.config;
|
|
128
|
+
_this.styleInfo = props.styleInfo;
|
|
129
|
+
_this.spreadOptions = props.spreadOptions;
|
|
130
|
+
return _this;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
_createClass(Designer, [{
|
|
134
|
+
key: "render",
|
|
135
|
+
value: function render() {
|
|
136
|
+
return _reactJSImport2.default.createElement("div", { id: "designer", className: "designer", ref: this.designerHost, style: this.styleInfo });
|
|
137
|
+
}
|
|
138
|
+
}, {
|
|
139
|
+
key: "componentDidMount",
|
|
140
|
+
value: function componentDidMount() {
|
|
141
|
+
var designer = new _spreadJSImport2.default.Spread.Sheets.Designer.Designer(this.designerHost.current, /**designer host */
|
|
142
|
+
this.config /**If you want to change Designer's layout or rewrite it, you can pass in your own Config JSON */
|
|
143
|
+
, undefined /**If you want to use the spread you already created instead of generating a new spread, pass in */
|
|
144
|
+
, this.spreadOptions);
|
|
145
|
+
this.designer = designer;
|
|
146
|
+
var designerInitialized = this.props.designerInitialized;
|
|
147
|
+
if (designerInitialized) {
|
|
148
|
+
designerInitialized(designer);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, {
|
|
152
|
+
key: "componentWillUnmount",
|
|
153
|
+
value: function componentWillUnmount() {
|
|
154
|
+
this.designer.destroy();
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "shouldComponentUpdate",
|
|
158
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
159
|
+
if (nextProps.styleInfo !== this.styleInfo) {
|
|
160
|
+
this.styleInfo = nextProps.styleInfo;
|
|
161
|
+
for (var key in nextProps.styleInfo) {
|
|
162
|
+
this.designerHost.current.style[key] = nextProps.styleInfo[key];
|
|
163
|
+
}
|
|
164
|
+
this.designer.refresh();
|
|
165
|
+
}
|
|
166
|
+
if (nextProps.config !== this.config) {
|
|
167
|
+
this.config = nextProps.config;
|
|
168
|
+
this.designer.setConfig(nextProps.config);
|
|
169
|
+
}
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
}]);
|
|
173
|
+
|
|
174
|
+
return Designer;
|
|
175
|
+
}(_reactJSImport2.default.Component);
|
|
176
|
+
|
|
177
|
+
exports.default = Designer;
|
|
178
|
+
|
|
179
|
+
/***/ }),
|
|
180
|
+
/* 2 */
|
|
181
|
+
/*!************************************!*\
|
|
182
|
+
!*** ./lib/utils/reactJSImport.js ***!
|
|
183
|
+
\************************************/
|
|
184
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
185
|
+
|
|
186
|
+
'use strict';
|
|
187
|
+
|
|
188
|
+
Object.defineProperty(exports, "__esModule", {
|
|
189
|
+
value: true
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
var _react = __webpack_require__(/*! react */ 3);
|
|
193
|
+
|
|
194
|
+
var _react2 = _interopRequireDefault(_react);
|
|
195
|
+
|
|
196
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
197
|
+
|
|
198
|
+
exports.default = _react2.default;
|
|
199
|
+
|
|
200
|
+
/***/ }),
|
|
201
|
+
/* 3 */
|
|
202
|
+
/*!************************!*\
|
|
203
|
+
!*** external "react" ***!
|
|
204
|
+
\************************/
|
|
205
|
+
/***/ (function(module, exports) {
|
|
206
|
+
|
|
207
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
|
|
208
|
+
|
|
209
|
+
/***/ }),
|
|
210
|
+
/* 4 */
|
|
211
|
+
/*!*************************************!*\
|
|
212
|
+
!*** ./lib/utils/spreadJSImport.js ***!
|
|
213
|
+
\*************************************/
|
|
214
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
215
|
+
|
|
216
|
+
'use strict';
|
|
217
|
+
|
|
218
|
+
Object.defineProperty(exports, "__esModule", {
|
|
219
|
+
value: true
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
var _spreadSheets = __webpack_require__(/*! @grapecity-software/spread-sheets */ 5);
|
|
223
|
+
|
|
224
|
+
var _spreadSheets2 = _interopRequireDefault(_spreadSheets);
|
|
225
|
+
|
|
226
|
+
__webpack_require__(/*! @grapecity-software/spread-sheets-designer */ 6);
|
|
227
|
+
|
|
228
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
229
|
+
|
|
230
|
+
exports.default = _spreadSheets2.default;
|
|
231
|
+
|
|
232
|
+
/***/ }),
|
|
233
|
+
/* 5 */
|
|
234
|
+
/*!****************************************************!*\
|
|
235
|
+
!*** external "@grapecity-software/spread-sheets" ***!
|
|
236
|
+
\****************************************************/
|
|
237
|
+
/***/ (function(module, exports) {
|
|
238
|
+
|
|
239
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_5__;
|
|
240
|
+
|
|
241
|
+
/***/ }),
|
|
242
|
+
/* 6 */
|
|
243
|
+
/*!*************************************************************!*\
|
|
244
|
+
!*** external "@grapecity-software/spread-sheets-designer" ***!
|
|
245
|
+
\*************************************************************/
|
|
246
|
+
/***/ (function(module, exports) {
|
|
247
|
+
|
|
248
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
|
|
249
|
+
|
|
250
|
+
/***/ })
|
|
251
|
+
/******/ ])
|
|
252
|
+
});
|
|
253
|
+
;
|
|
254
|
+
//# sourceMappingURL=gc.spread.sheets.designer.react.17.0.2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@grapecity-software/spread-sheets"),require("@grapecity-software/spread-sheets-designer")):"function"==typeof define&&define.amd?define(["react","@grapecity-software/spread-sheets","@grapecity-software/spread-sheets-designer"],t):"object"==typeof exports?exports.SpreadSheetsDesignerComponents=t(require("react"),require("@grapecity-software/spread-sheets"),require("@grapecity-software/spread-sheets-designer")):e.SpreadSheetsDesignerComponents=t(e.react,e["@grapecity-software/spread-sheets"],e["@grapecity-software/spread-sheets-designer"])}(this,function(r,n,o){return function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={exports:{},id:e,loaded:!1};return r[e].call(t.exports,t,t.exports,o),t.loaded=!0,t.exports}return o.m=r,o.c=n,o.p="",o(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Designer=void 0;var n,o=r(1),s=(n=o)&&n.__esModule?n:{default:n};t.Designer=s.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),o=i(r(2)),s=i(r(4));function i(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.designerHost=o.default.createRef(),t.designer=null,t.config=e.config,t.styleInfo=e.styleInfo,t.spreadOptions=e.spreadOptions,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,o.default.Component),n(r,[{key:"render",value:function(){return o.default.createElement("div",{id:"designer",className:"designer",ref:this.designerHost,style:this.styleInfo})}},{key:"componentDidMount",value:function(){var e=new s.default.Spread.Sheets.Designer.Designer(this.designerHost.current,this.config,void 0,this.spreadOptions);this.designer=e;var t=this.props.designerInitialized;t&&t(e)}},{key:"componentWillUnmount",value:function(){this.designer.destroy()}},{key:"shouldComponentUpdate",value:function(e){if(e.styleInfo!==this.styleInfo){for(var t in this.styleInfo=e.styleInfo,e.styleInfo)this.designerHost.current.style[t]=e.styleInfo[t];this.designer.refresh()}return e.config!==this.config&&(this.config=e.config,this.designer.setConfig(e.config)),!1}}]),r}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(3),s=(n=o)&&n.__esModule?n:{default:n};t.default=s.default},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,o=r(5),s=(n=o)&&n.__esModule?n:{default:n};r(6),t.default=s.default},function(e,t){e.exports=n},function(e,t){e.exports=o}])});
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/gc.spread.sheets.designer.react.min.js');
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grapecity-software/spread-sheets-designer-react",
|
|
3
|
+
"version": "17.0.2",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"description":"SpreadJS Designer React Wrapper Components.",
|
|
6
|
+
"scripts": {},
|
|
7
|
+
"keywords": [
|
|
8
|
+
"spread-sheets",
|
|
9
|
+
"javascript spreadsheet",
|
|
10
|
+
"javascript excel",
|
|
11
|
+
"excel io",
|
|
12
|
+
"sheets",
|
|
13
|
+
"sheet",
|
|
14
|
+
"designer",
|
|
15
|
+
"javascript",
|
|
16
|
+
"excel",
|
|
17
|
+
"grapecity software",
|
|
18
|
+
"spreadjs",
|
|
19
|
+
"spreaddesigner",
|
|
20
|
+
"react"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"email": "info.xa@grapecity.com",
|
|
26
|
+
"name": "GrapeCity Software inc"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "http://www.grapecity.com.cn/",
|
|
29
|
+
"license": "Commercial"
|
|
30
|
+
}
|