@mescius/spread-sheets-designer-react 17.0.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.
package/README.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SpreadJS Designer Wrapper Components for React
|
|
2
|
+
|
|
3
|
+
This package is part of the [SpreadJS Designer](https://developer.mescius.com/spreadjs).
|
|
4
|
+
|
|
5
|
+
Provide SpreadJS Designer React Wrapper Components.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
```sh
|
|
9
|
+
npm install @mescius/spread-sheets-designer-react
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Getting more help
|
|
13
|
+
Visit SpreadJS home page to get more info about the library:
|
|
14
|
+
[https://developer.mescius.com/spreadjs](https://developer.mescius.com/spreadjs)
|
|
15
|
+
|
|
16
|
+
You can ask any question about SpreadJS or report an error using the [SpreadJS Forum](https://developer.mescius.com/forums/spreadjs).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
// @ts-ignore
|
|
3
|
+
import * as GC from '@mescius/spread-sheets-designer';
|
|
4
|
+
import {Spread} from '@mescius/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.0
|
|
4
|
+
*
|
|
5
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the SpreadJS Commercial License.
|
|
8
|
+
* us.sales@mescius.com
|
|
9
|
+
* https://developer.mescius.com/spreadjs
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
13
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
14
|
+
module.exports = factory(require("react"), require("@mescius/spread-sheets"), require("@mescius/spread-sheets-designer"));
|
|
15
|
+
else if(typeof define === 'function' && define.amd)
|
|
16
|
+
define(["react", "@mescius/spread-sheets", "@mescius/spread-sheets-designer"], factory);
|
|
17
|
+
else if(typeof exports === 'object')
|
|
18
|
+
exports["SpreadSheetsDesignerComponents"] = factory(require("react"), require("@mescius/spread-sheets"), require("@mescius/spread-sheets-designer"));
|
|
19
|
+
else
|
|
20
|
+
root["SpreadSheetsDesignerComponents"] = factory(root["react"], root["@mescius/spread-sheets"], root["@mescius/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__(/*! @mescius/spread-sheets */ 5);
|
|
223
|
+
|
|
224
|
+
var _spreadSheets2 = _interopRequireDefault(_spreadSheets);
|
|
225
|
+
|
|
226
|
+
__webpack_require__(/*! @mescius/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 "@mescius/spread-sheets" ***!
|
|
236
|
+
\*****************************************/
|
|
237
|
+
/***/ (function(module, exports) {
|
|
238
|
+
|
|
239
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_5__;
|
|
240
|
+
|
|
241
|
+
/***/ }),
|
|
242
|
+
/* 6 */
|
|
243
|
+
/*!**************************************************!*\
|
|
244
|
+
!*** external "@mescius/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.0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@mescius/spread-sheets"),require("@mescius/spread-sheets-designer")):"function"==typeof define&&define.amd?define(["react","@mescius/spread-sheets","@mescius/spread-sheets-designer"],t):"object"==typeof exports?exports.SpreadSheetsDesignerComponents=t(require("react"),require("@mescius/spread-sheets"),require("@mescius/spread-sheets-designer")):e.SpreadSheetsDesignerComponents=t(e.react,e["@mescius/spread-sheets"],e["@mescius/spread-sheets-designer"])}(this,function(n,r,s){return function(n){var r={};function s(e){if(r[e])return r[e].exports;var t=r[e]={exports:{},id:e,loaded:!1};return n[e].call(t.exports,t,t.exports,s),t.loaded=!0,t.exports}return s.m=n,s.c=r,s.p="",s(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Designer=void 0;var r,s=n(1),o=(r=s)&&r.__esModule?r:{default:r};t.Designer=o.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),s=i(n(2)),o=i(n(4));function i(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function n(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n);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,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.designerHost=s.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)}(n,s.default.Component),r(n,[{key:"render",value:function(){return s.default.createElement("div",{id:"designer",className:"designer",ref:this.designerHost,style:this.styleInfo})}},{key:"componentDidMount",value:function(){var e=new o.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}}]),n}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,s=n(3),o=(r=s)&&r.__esModule?r:{default:r};t.default=o.default},function(e,t){e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,s=n(5),o=(r=s)&&r.__esModule?r:{default:r};n(6),t.default=o.default},function(e,t){e.exports=r},function(e,t){e.exports=s}])});
|
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": "@mescius/spread-sheets-designer-react",
|
|
3
|
+
"version": "17.0.0",
|
|
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
|
+
"mescius",
|
|
18
|
+
"spreadjs",
|
|
19
|
+
"spreaddesigner",
|
|
20
|
+
"react"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"email": "us.sales@mescius.com",
|
|
26
|
+
"name": "MESCIUS inc"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://developer.mescius.com/spreadjs",
|
|
29
|
+
"license": "Commercial"
|
|
30
|
+
}
|