@grapecity-software/spread-sheets-designer-react 17.0.9 → 17.1.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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
*
|
|
3
|
-
* Spread.Sheets.Designer Wrapper Components for React 17.0
|
|
3
|
+
* Spread.Sheets.Designer Wrapper Components for React 17.1.0
|
|
4
4
|
*
|
|
5
5
|
* Copyright(c) GrapeCity Software inc. All rights reserved.
|
|
6
6
|
*
|
|
@@ -90,7 +90,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
90
90
|
\**********************************/
|
|
91
91
|
/***/ (function(module, exports, __webpack_require__) {
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
'use strict';
|
|
94
94
|
|
|
95
95
|
Object.defineProperty(exports, "__esModule", {
|
|
96
96
|
value: true
|
|
@@ -106,6 +106,8 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
106
106
|
|
|
107
107
|
var _spreadJSImport2 = _interopRequireDefault(_spreadJSImport);
|
|
108
108
|
|
|
109
|
+
var _utils = __webpack_require__(/*! ../utils/utils */ 7);
|
|
110
|
+
|
|
109
111
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
110
112
|
|
|
111
113
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
@@ -131,12 +133,12 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
_createClass(Designer, [{
|
|
134
|
-
key:
|
|
136
|
+
key: 'render',
|
|
135
137
|
value: function render() {
|
|
136
|
-
return _reactJSImport2.default.createElement(
|
|
138
|
+
return _reactJSImport2.default.createElement('div', { id: 'designer', className: 'designer', ref: this.designerHost, style: this.styleInfo });
|
|
137
139
|
}
|
|
138
140
|
}, {
|
|
139
|
-
key:
|
|
141
|
+
key: 'componentDidMount',
|
|
140
142
|
value: function componentDidMount() {
|
|
141
143
|
var designer = new _spreadJSImport2.default.Spread.Sheets.Designer.Designer(this.designerHost.current, /**designer host */
|
|
142
144
|
this.config /**If you want to change Designer's layout or rewrite it, you can pass in your own Config JSON */
|
|
@@ -149,19 +151,26 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
149
151
|
}
|
|
150
152
|
}
|
|
151
153
|
}, {
|
|
152
|
-
key:
|
|
154
|
+
key: 'componentWillUnmount',
|
|
153
155
|
value: function componentWillUnmount() {
|
|
154
156
|
this.designer.destroy();
|
|
155
157
|
}
|
|
156
158
|
}, {
|
|
157
|
-
key:
|
|
159
|
+
key: 'shouldComponentUpdate',
|
|
158
160
|
value: function shouldComponentUpdate(nextProps) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
var _this2 = this;
|
|
162
|
+
|
|
163
|
+
var styleInfoChange = (0, _utils.getObjectChange)(this.styleInfo, nextProps.styleInfo);
|
|
164
|
+
if (styleInfoChange[0].length !== 0 || styleInfoChange[1].length !== 0) {
|
|
165
|
+
styleInfoChange[0].forEach(function (update) {
|
|
166
|
+
var key = update[0],
|
|
167
|
+
value = update[1];
|
|
168
|
+
_this2.designerHost.current.style[key] = value;
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
styleInfoChange[1].forEach(function (removeKey) {
|
|
172
|
+
_this2.designerHost.current.style[removeKey] = "";
|
|
173
|
+
});
|
|
165
174
|
}
|
|
166
175
|
if (nextProps.config !== this.config) {
|
|
167
176
|
this.config = nextProps.config;
|
|
@@ -247,8 +256,42 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
|
247
256
|
|
|
248
257
|
module.exports = __WEBPACK_EXTERNAL_MODULE_6__;
|
|
249
258
|
|
|
259
|
+
/***/ }),
|
|
260
|
+
/* 7 */
|
|
261
|
+
/*!****************************!*\
|
|
262
|
+
!*** ./lib/utils/utils.js ***!
|
|
263
|
+
\****************************/
|
|
264
|
+
/***/ (function(module, exports) {
|
|
265
|
+
|
|
266
|
+
"use strict";
|
|
267
|
+
|
|
268
|
+
Object.defineProperty(exports, "__esModule", {
|
|
269
|
+
value: true
|
|
270
|
+
});
|
|
271
|
+
var getObjectChange = exports.getObjectChange = function getObjectChange(curObj, newObj) {
|
|
272
|
+
var _curObj = curObj ? curObj : {};
|
|
273
|
+
var _newObj = newObj ? newObj : {};
|
|
274
|
+
var updates = [],
|
|
275
|
+
remove = [];
|
|
276
|
+
var curKeys = Object.keys(_curObj);
|
|
277
|
+
var newKeys = Object.keys(_newObj);
|
|
278
|
+
curKeys.forEach(function (key) {
|
|
279
|
+
if (!(key in _newObj)) {
|
|
280
|
+
remove.push(key);
|
|
281
|
+
} else if (_curObj[key] !== _newObj[key]) {
|
|
282
|
+
updates.push([key, _newObj[key]]);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
newKeys.forEach(function (key) {
|
|
286
|
+
if (!(key in _curObj)) {
|
|
287
|
+
updates.push([key, _newObj[key]]);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
return [updates, remove];
|
|
291
|
+
};
|
|
292
|
+
|
|
250
293
|
/***/ })
|
|
251
294
|
/******/ ])
|
|
252
295
|
});
|
|
253
296
|
;
|
|
254
|
-
//# sourceMappingURL=gc.spread.sheets.designer.react.17.0.
|
|
297
|
+
//# sourceMappingURL=gc.spread.sheets.designer.react.17.1.0.js.map
|
|
@@ -1 +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=
|
|
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=u(r(2)),s=u(r(4)),i=r(7);function u(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){var n=this,t=(0,i.getObjectChange)(this.styleInfo,e.styleInfo);return 0===t[0].length&&0===t[1].length||(t[0].forEach(function(e){var t=e[0],r=e[1];n.designerHost.current.style[t]=r}),t[1].forEach(function(e){n.designerHost.current.style[e]=""})),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},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.getObjectChange=function(e,t){var r=e||{},n=t||{},o=[],s=[],i=Object.keys(r),u=Object.keys(n);return i.forEach(function(e){e in n?r[e]!==n[e]&&o.push([e,n[e]]):s.push(e)}),u.forEach(function(e){e in r||o.push([e,n[e]])}),[o,s]}}])});
|