@olympeio-extensions/reactgrid 2.9.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/codeAsData/import_order.json +1 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/.ReactGrid.newInst.json +73 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/.ReactGrid.newRel.json +283 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Create_Column_Config.newInst.json +186 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Create_Column_Config.newRel.json +481 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Create_Column_Config.updateInst.json +17 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Get_Change_Metadata.newInst.json +116 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Get_Change_Metadata.newRel.json +301 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Get_Change_Properties.newInst.json +100 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Get_Change_Properties.newRel.json +259 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Group_Tuples_by_Indexes.newInst.json +70 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Group_Tuples_by_Indexes.newRel.json +175 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_Signature.newInst.json +84 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_Signature.newRel.json +247 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_CloudObjects.newInst.json +99 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_CloudObjects.newRel.json +259 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_JSON_String.newInst.json +113 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_JSON_String.newRel.json +301 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_Objects.newInst.json +114 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Process_Changes_for_Objects.newRel.json +301 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Public_Config_Types.newInst.json +246 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Public_Config_Types.newRel.json +631 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Public_Enums.newInst.json +147 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Public_Enums.newRel.json +397 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_ReactGrid.newInst.json +465 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_ReactGrid.newRel.json +1357 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_ReactGrid.updateInst.json +17 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Wrap_Object.newInst.json +71 -0
- package/codeAsData/olympeio-extensions.reactgrid/Olympe_Libraries/Extensions/UI/ReactGrid/RG58_Wrap_Object.newRel.json +175 -0
- package/main-node.js +2056 -0
- package/main-node.js.map +1 -0
- package/main-web.js +2258 -0
- package/main-web.js.map +1 -0
- package/package.json +1 -0
package/main-node.js
ADDED
|
@@ -0,0 +1,2056 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory(require("olympe"));
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define(["olympe"], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["@olympeio-extensions/reactgrid"] = factory(require("olympe"));
|
|
8
|
+
else
|
|
9
|
+
root["@olympeio-extensions/reactgrid"] = factory(root["olympe"]);
|
|
10
|
+
})(this, (__WEBPACK_EXTERNAL_MODULE_olympe__) => {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ "use strict";
|
|
13
|
+
/******/ var __webpack_modules__ = ({
|
|
14
|
+
|
|
15
|
+
/***/ "./src/common/RGCreateColumnConfig.js":
|
|
16
|
+
/*!********************************************!*\
|
|
17
|
+
!*** ./src/common/RGCreateColumnConfig.js ***!
|
|
18
|
+
\********************************************/
|
|
19
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
20
|
+
|
|
21
|
+
__webpack_require__.r(__webpack_exports__);
|
|
22
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
23
|
+
/* harmony export */ "default": () => (/* binding */ RGCreateColumnConfig)
|
|
24
|
+
/* harmony export */ });
|
|
25
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
26
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
27
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/common/helpers.js");
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class RGCreateColumnConfig extends olympe__WEBPACK_IMPORTED_MODULE_0__.Brick {
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @override
|
|
35
|
+
* @protected
|
|
36
|
+
* @param {!BrickContext} $
|
|
37
|
+
* @param {number} rank
|
|
38
|
+
* @param {string} propertyPath
|
|
39
|
+
* @param {string} header
|
|
40
|
+
* @param {number} width
|
|
41
|
+
* @param {string} type
|
|
42
|
+
* @param {string|!Object} options
|
|
43
|
+
* @param {boolean} editable
|
|
44
|
+
* @param {boolean} resizable
|
|
45
|
+
* @param {number} level
|
|
46
|
+
* @param {function(!Object)} setObject
|
|
47
|
+
*/
|
|
48
|
+
update(_$, [rank, propertyPath, header, width, type, options, editable, resizable, level], [setObject]) {
|
|
49
|
+
setObject({
|
|
50
|
+
Rank: rank,
|
|
51
|
+
'Property Path': propertyPath,
|
|
52
|
+
Header: header,
|
|
53
|
+
Width: width,
|
|
54
|
+
Type: type,
|
|
55
|
+
Options: (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.fromJson)(options)[0],
|
|
56
|
+
Editable: editable,
|
|
57
|
+
Resizable: resizable,
|
|
58
|
+
Level: level
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('01921d9038d9eb72f609', RGCreateColumnConfig);
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/***/ }),
|
|
67
|
+
|
|
68
|
+
/***/ "./src/common/RGGetChangeMetadata.js":
|
|
69
|
+
/*!*******************************************!*\
|
|
70
|
+
!*** ./src/common/RGGetChangeMetadata.js ***!
|
|
71
|
+
\*******************************************/
|
|
72
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
73
|
+
|
|
74
|
+
__webpack_require__.r(__webpack_exports__);
|
|
75
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
76
|
+
/* harmony export */ "default": () => (/* binding */ RGGetChangeMetadata)
|
|
77
|
+
/* harmony export */ });
|
|
78
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
79
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
class RGGetChangeMetadata extends olympe__WEBPACK_IMPORTED_MODULE_0__.Brick {
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @override
|
|
86
|
+
* @protected
|
|
87
|
+
* @param {!BrickContext} $
|
|
88
|
+
* @param {!RGChange} change
|
|
89
|
+
* @param {function(!Object)} setNewCell
|
|
90
|
+
* @param {function(!Object)} setPreviousCell
|
|
91
|
+
* @param {function(string|number)} setRowId
|
|
92
|
+
* @param {function(string|number)} setColumnId
|
|
93
|
+
* @param {function(string)} setType
|
|
94
|
+
*/
|
|
95
|
+
update(_$, [change], [setNewCell, setPreviousCell, setRowId, setColumnId, setType]) {
|
|
96
|
+
setNewCell(change.metadata.newCell);
|
|
97
|
+
setPreviousCell(change.metadata.previousCell);
|
|
98
|
+
setRowId(change.metadata.rowId);
|
|
99
|
+
setColumnId(change.metadata.columnId);
|
|
100
|
+
setType(change.metadata.type);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('01920a4d4d8390252c91', RGGetChangeMetadata);
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
/***/ }),
|
|
108
|
+
|
|
109
|
+
/***/ "./src/common/RGGetChangeProperties.js":
|
|
110
|
+
/*!*********************************************!*\
|
|
111
|
+
!*** ./src/common/RGGetChangeProperties.js ***!
|
|
112
|
+
\*********************************************/
|
|
113
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
114
|
+
|
|
115
|
+
__webpack_require__.r(__webpack_exports__);
|
|
116
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
117
|
+
/* harmony export */ "default": () => (/* binding */ RGGetChangeProperties)
|
|
118
|
+
/* harmony export */ });
|
|
119
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
120
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class RGGetChangeProperties extends olympe__WEBPACK_IMPORTED_MODULE_0__.Brick {
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @override
|
|
127
|
+
* @protected
|
|
128
|
+
* @param {!BrickContext} $
|
|
129
|
+
* @param {!RGChange} change
|
|
130
|
+
* @param {function(!Object|!CloudObject)} setObject
|
|
131
|
+
* @param {function(!Object|!CloudObject)} setProperty
|
|
132
|
+
* @param {function(!*)} setNewValue
|
|
133
|
+
* @param {function(!*)} setOldValue
|
|
134
|
+
*/
|
|
135
|
+
update(_$, [change], [setObject, setProperty, setNewValue, setOldValue]) {
|
|
136
|
+
setObject(change.object);
|
|
137
|
+
setProperty(change.property);
|
|
138
|
+
setNewValue(change.newValue);
|
|
139
|
+
setOldValue(change.oldValue);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('0192055d7857bd08279c', RGGetChangeProperties);
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
/***/ }),
|
|
147
|
+
|
|
148
|
+
/***/ "./src/common/RGGroupTuplesByIndexes.js":
|
|
149
|
+
/*!**********************************************!*\
|
|
150
|
+
!*** ./src/common/RGGroupTuplesByIndexes.js ***!
|
|
151
|
+
\**********************************************/
|
|
152
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
153
|
+
|
|
154
|
+
__webpack_require__.r(__webpack_exports__);
|
|
155
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
156
|
+
/* harmony export */ "default": () => (/* binding */ RGGroupTuplesByIndexes)
|
|
157
|
+
/* harmony export */ });
|
|
158
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
159
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
160
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/common/helpers.js");
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class RGGroupTuplesByIndexes extends olympe__WEBPACK_IMPORTED_MODULE_0__.Brick {
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @override
|
|
168
|
+
* @protected
|
|
169
|
+
* @param {!BrickContext} $
|
|
170
|
+
* @param {!Array} data
|
|
171
|
+
* @param {string} indexes
|
|
172
|
+
* @param {function(!Array)} setGroupedData
|
|
173
|
+
*/
|
|
174
|
+
update(_$, [data, indexes], [setGroupedData]) {
|
|
175
|
+
// Get the indexes and make the grouping recursively
|
|
176
|
+
const _indexes = indexes.split(',').map(index => parseInt(index));
|
|
177
|
+
setGroupedData(groupBy(data.map(d => (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.rgWrap)(d)), _indexes, 0));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('0192288806aa3cc82b95', RGGroupTuplesByIndexes);
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Group data by indexes, for the given level
|
|
185
|
+
* @param {!Array} wrappers
|
|
186
|
+
* @param {!Array<number>} indexes
|
|
187
|
+
* @param {number} level
|
|
188
|
+
* @return {!Array}
|
|
189
|
+
*/
|
|
190
|
+
function groupBy(wrappers, indexes, level) {
|
|
191
|
+
// End of recursion
|
|
192
|
+
if(level >= indexes.length || !Array.isArray(wrappers)) {
|
|
193
|
+
return wrappers;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Get the current working index
|
|
197
|
+
const index = indexes[level] - level;
|
|
198
|
+
|
|
199
|
+
// Group the data in a Map
|
|
200
|
+
const groupedWrappers = wrappers.reduce((parents, wrapper) => {
|
|
201
|
+
// Split the tuple into parts
|
|
202
|
+
const [wrapped, child] = splitTuple(wrapper, index, level);
|
|
203
|
+
const key = wrapped.rgGetKey();
|
|
204
|
+
|
|
205
|
+
// If this key is not in a group yet
|
|
206
|
+
if(!parents.has(key)) {
|
|
207
|
+
// Create the new group
|
|
208
|
+
parents.set(key, wrapped);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// If there is a child, add it to the group
|
|
212
|
+
// (group the child itself also)
|
|
213
|
+
if(child) {
|
|
214
|
+
const parent = parents.get(key);
|
|
215
|
+
parent.rgChildren.push(child);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Done
|
|
219
|
+
return parents;
|
|
220
|
+
}, new Map());
|
|
221
|
+
|
|
222
|
+
// Apply the grouping on the children
|
|
223
|
+
return Array.from(groupedWrappers.values()).map(({ rgChildren, ...others }) => ({
|
|
224
|
+
rgChildren: groupBy(rgChildren.map(c => (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.rgWrap)(c, level + 1)), indexes, level + 1),
|
|
225
|
+
...others
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* @param {!RGWrapper} wrapper
|
|
231
|
+
* @param {number} index
|
|
232
|
+
* @param {number} level
|
|
233
|
+
* @return {[!RGWrapper, *]}
|
|
234
|
+
*/
|
|
235
|
+
function splitTuple(wrapper, index, level) {
|
|
236
|
+
// Real tuple case
|
|
237
|
+
if(wrapper._rgType === 'tuple') {
|
|
238
|
+
// Extract the info
|
|
239
|
+
const tuple = wrapper.rgObject;
|
|
240
|
+
const wrapped = (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.rgWrap)(tuple[index], level);
|
|
241
|
+
const before = tuple.slice(0, index);
|
|
242
|
+
const after = tuple.slice(index + 1);
|
|
243
|
+
const child = [...before, ...after];
|
|
244
|
+
|
|
245
|
+
// Handle all cases
|
|
246
|
+
if(child.length > 1) {
|
|
247
|
+
return [wrapped, child];
|
|
248
|
+
}
|
|
249
|
+
else if(child.length > 0) {
|
|
250
|
+
return [wrapped, child[0]];
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
return [wrapped, null];
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// Not a tuple case
|
|
258
|
+
else {
|
|
259
|
+
return [wrapper, null];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
/***/ }),
|
|
265
|
+
|
|
266
|
+
/***/ "./src/common/RGProcessChangesForCloudObjects.js":
|
|
267
|
+
/*!*******************************************************!*\
|
|
268
|
+
!*** ./src/common/RGProcessChangesForCloudObjects.js ***!
|
|
269
|
+
\*******************************************************/
|
|
270
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
271
|
+
|
|
272
|
+
__webpack_require__.r(__webpack_exports__);
|
|
273
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
274
|
+
/* harmony export */ "default": () => (/* binding */ RGProcessChangesForCloudObjects)
|
|
275
|
+
/* harmony export */ });
|
|
276
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
277
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
class RGProcessChangesForCloudObjects extends olympe__WEBPACK_IMPORTED_MODULE_0__.ActionBrick {
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @override
|
|
284
|
+
* @protected
|
|
285
|
+
* @param {!BrickContext} $
|
|
286
|
+
* @param {!Array<!RGChange>} changes
|
|
287
|
+
* @param {boolean} executeAsLarge
|
|
288
|
+
* @param {function()} forwardEvent
|
|
289
|
+
* @param {function(!ErrorFlow)} setErrorFlow
|
|
290
|
+
*/
|
|
291
|
+
update(_$, [changes, executeAsLarge], [forwardEvent, setErrorFlow]) {
|
|
292
|
+
const t = new olympe__WEBPACK_IMPORTED_MODULE_0__.Transaction();
|
|
293
|
+
const errors = ['No changes applied because:'];
|
|
294
|
+
changes.forEach(change => {
|
|
295
|
+
if(change.metadata.newCell.validator?.(change.newValue) ?? true) {
|
|
296
|
+
t.update(change.object, change.property, change.newValue);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
errors.push(`This value is not valid: ${change.newValue}`);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
if(errors.length > 1) {
|
|
303
|
+
setErrorFlow(olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow.create(errors.join('\n'), 1));
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const promise = executeAsLarge ? t.executeAsLarge() : t.execute();
|
|
307
|
+
promise.then(forwardEvent)
|
|
308
|
+
.catch(error => setErrorFlow(olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow.create(error.message, 0)));
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('01920a8134e1cf0fa551', RGProcessChangesForCloudObjects);
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
/***/ }),
|
|
316
|
+
|
|
317
|
+
/***/ "./src/common/RGProcessChangesForJSONString.js":
|
|
318
|
+
/*!*****************************************************!*\
|
|
319
|
+
!*** ./src/common/RGProcessChangesForJSONString.js ***!
|
|
320
|
+
\*****************************************************/
|
|
321
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
322
|
+
|
|
323
|
+
__webpack_require__.r(__webpack_exports__);
|
|
324
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
325
|
+
/* harmony export */ "default": () => (/* binding */ RGProcessChangesForJSONString)
|
|
326
|
+
/* harmony export */ });
|
|
327
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
328
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
329
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/common/helpers.js");
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class RGProcessChangesForJSONString extends olympe__WEBPACK_IMPORTED_MODULE_0__.ActionBrick {
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* @override
|
|
337
|
+
* @protected
|
|
338
|
+
* @param {!BrickContext} $
|
|
339
|
+
* @param {!Array<!RGChange>} changes
|
|
340
|
+
* @param {string} json
|
|
341
|
+
* @param {function()} forwardEvent
|
|
342
|
+
* @param {function(!ErrorFlow)} setErrorFlow
|
|
343
|
+
* @param {function(string)} setNewJson
|
|
344
|
+
*/
|
|
345
|
+
update(_$, [changes, json], [forwardEvent, setErrorFlow, setNewJson]) {
|
|
346
|
+
const [data, error] = (0,_helpers__WEBPACK_IMPORTED_MODULE_1__.fromJson)(json);
|
|
347
|
+
if(!error) {
|
|
348
|
+
const errors = ['No changes applied because:'];
|
|
349
|
+
changes.forEach(change => {
|
|
350
|
+
if(change.metadata.newCell.validator?.(change.newValue) ?? true) {
|
|
351
|
+
data[change.metadata.rowId][change.property] = change.newValue;
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
errors.push(`This value is not valid: ${change.newValue}`);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
if(errors.length > 1) {
|
|
358
|
+
setErrorFlow(olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow.create(errors.join('\n'), 1));
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
setNewJson(JSON.stringify(data));
|
|
362
|
+
forwardEvent();
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
setErrorFlow(olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow.create(`input 'json' is not valid, error: ${error.message}`, 0));
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('01921e064dbe25faec55', RGProcessChangesForJSONString);
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
/***/ }),
|
|
374
|
+
|
|
375
|
+
/***/ "./src/common/RGProcessChangesForObjects.js":
|
|
376
|
+
/*!**************************************************!*\
|
|
377
|
+
!*** ./src/common/RGProcessChangesForObjects.js ***!
|
|
378
|
+
\**************************************************/
|
|
379
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
380
|
+
|
|
381
|
+
__webpack_require__.r(__webpack_exports__);
|
|
382
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
383
|
+
/* harmony export */ "default": () => (/* binding */ RGProcessChangesForObjects)
|
|
384
|
+
/* harmony export */ });
|
|
385
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
386
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
class RGProcessChangesForObjects extends olympe__WEBPACK_IMPORTED_MODULE_0__.ActionBrick {
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* @override
|
|
393
|
+
* @protected
|
|
394
|
+
* @param {!BrickContext} $
|
|
395
|
+
* @param {!Array<!RGChange>} changes
|
|
396
|
+
* @param {boolean} inPlace
|
|
397
|
+
* @param {Array} data
|
|
398
|
+
* @param {function()} forwardEvent
|
|
399
|
+
* @param {function(!ErrorFlow)} setErrorFlow
|
|
400
|
+
*/
|
|
401
|
+
update(_$, [changes, inPlace, data], [forwardEvent, setErrorFlow]) {
|
|
402
|
+
const errors = ['No changes applied because:'];
|
|
403
|
+
changes.forEach(change => {
|
|
404
|
+
if(!(change.metadata.newCell.validator?.(change.newValue) ?? true)) {
|
|
405
|
+
errors.push(`This value is not valid: ${change.newValue}`);
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
if(errors.length > 1) {
|
|
409
|
+
setErrorFlow(olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow.create(errors.join('\n'), 1));
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
if(inPlace) {
|
|
413
|
+
changes.forEach(change => {
|
|
414
|
+
change.object[change.property] = change.newValue;
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
changes.forEach(change => {
|
|
419
|
+
data[change.metadata.rowId][change.property] = change.newValue;
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
forwardEvent();
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('01921e0d2b383c95bd22', RGProcessChangesForObjects);
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
/***/ }),
|
|
430
|
+
|
|
431
|
+
/***/ "./src/common/RGWrapObject.js":
|
|
432
|
+
/*!************************************!*\
|
|
433
|
+
!*** ./src/common/RGWrapObject.js ***!
|
|
434
|
+
\************************************/
|
|
435
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
436
|
+
|
|
437
|
+
__webpack_require__.r(__webpack_exports__);
|
|
438
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
439
|
+
/* harmony export */ "default": () => (/* binding */ RGWrapObject)
|
|
440
|
+
/* harmony export */ });
|
|
441
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
442
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
443
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/common/helpers.js");
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class RGWrapObject extends olympe__WEBPACK_IMPORTED_MODULE_0__.Brick {
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
* @override
|
|
451
|
+
* @protected
|
|
452
|
+
* @param {!BrickContext} $
|
|
453
|
+
* @param {!*} object
|
|
454
|
+
* @param {number} level
|
|
455
|
+
* @param {function(!RGWrapper)} setWrapped
|
|
456
|
+
*/
|
|
457
|
+
update(_$, [object, level], [setWrapped]) {
|
|
458
|
+
setWrapped((0,_helpers__WEBPACK_IMPORTED_MODULE_1__.rgWrap)(object, level));
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
(0,olympe__WEBPACK_IMPORTED_MODULE_0__.registerBrick)('019232c3d1873de0d259', RGWrapObject);
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
/***/ }),
|
|
466
|
+
|
|
467
|
+
/***/ "./src/common/helpers.js":
|
|
468
|
+
/*!*******************************!*\
|
|
469
|
+
!*** ./src/common/helpers.js ***!
|
|
470
|
+
\*******************************/
|
|
471
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
472
|
+
|
|
473
|
+
__webpack_require__.r(__webpack_exports__);
|
|
474
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
475
|
+
/* harmony export */ RGChange: () => (/* reexport safe */ _internal_changes__WEBPACK_IMPORTED_MODULE_1__.RGChange),
|
|
476
|
+
/* harmony export */ RGWrapper: () => (/* reexport safe */ _internal_wrappers__WEBPACK_IMPORTED_MODULE_0__.RGWrapper),
|
|
477
|
+
/* harmony export */ fromJson: () => (/* reexport safe */ _internal_helpers__WEBPACK_IMPORTED_MODULE_2__.fromJson),
|
|
478
|
+
/* harmony export */ rgWrap: () => (/* reexport safe */ _internal_wrappers__WEBPACK_IMPORTED_MODULE_0__.rgWrap)
|
|
479
|
+
/* harmony export */ });
|
|
480
|
+
/* harmony import */ var _internal_wrappers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./internal/wrappers */ "./src/common/internal/wrappers.js");
|
|
481
|
+
/* harmony import */ var _internal_changes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/changes */ "./src/common/internal/changes.js");
|
|
482
|
+
/* harmony import */ var _internal_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internal/helpers */ "./src/common/internal/helpers.js");
|
|
483
|
+
// Re-export
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
/***/ }),
|
|
490
|
+
|
|
491
|
+
/***/ "./src/common/internal/box.js":
|
|
492
|
+
/*!************************************!*\
|
|
493
|
+
!*** ./src/common/internal/box.js ***!
|
|
494
|
+
\************************************/
|
|
495
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
496
|
+
|
|
497
|
+
__webpack_require__.r(__webpack_exports__);
|
|
498
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
499
|
+
/* harmony export */ initBox: () => (/* binding */ initBox),
|
|
500
|
+
/* harmony export */ useBox: () => (/* binding */ useBox)
|
|
501
|
+
/* harmony export */ });
|
|
502
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @olympeio/core */ "@olympeio/core");
|
|
503
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_olympeio_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
504
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
505
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
506
|
+
// Olympe
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
// Rxjs
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Init the bounding box
|
|
514
|
+
* @param {!BrickContext} $
|
|
515
|
+
*/
|
|
516
|
+
function initBox($) {
|
|
517
|
+
// Listen to the component position and size
|
|
518
|
+
(0,rxjs__WEBPACK_IMPORTED_MODULE_1__.combineLatest)([$.observe('X'), $.observe('Y'), $.observe('Width'), $.observe('Height')])
|
|
519
|
+
|
|
520
|
+
// Debounce the changes to avoid to many rerendering
|
|
521
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.throttleTime)(100, undefined, { leading: true, trailing: true }))
|
|
522
|
+
|
|
523
|
+
// Set the final box
|
|
524
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.tap)(([x, y, width, height]) => $.set('_rgBox', { x, y, width, height })))
|
|
525
|
+
|
|
526
|
+
// Run
|
|
527
|
+
.subscribe();
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* @param {!BrickContext}
|
|
532
|
+
* @return {!*}
|
|
533
|
+
*/
|
|
534
|
+
function useBox($) {
|
|
535
|
+
return (0,_olympeio_core__WEBPACK_IMPORTED_MODULE_0__.useProperty)($, '_rgBox')
|
|
536
|
+
?? { x: $.get('X'), y: $.get('Y'), width: $.get('Width'), height: $.get('Height') };
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
/***/ }),
|
|
542
|
+
|
|
543
|
+
/***/ "./src/common/internal/cells.js":
|
|
544
|
+
/*!**************************************!*\
|
|
545
|
+
!*** ./src/common/internal/cells.js ***!
|
|
546
|
+
\**************************************/
|
|
547
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
548
|
+
|
|
549
|
+
__webpack_require__.r(__webpack_exports__);
|
|
550
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
551
|
+
/* harmony export */ generateCell: () => (/* binding */ generateCell),
|
|
552
|
+
/* harmony export */ getCellStyle: () => (/* binding */ getCellStyle),
|
|
553
|
+
/* harmony export */ getCellValue: () => (/* binding */ getCellValue),
|
|
554
|
+
/* harmony export */ handleChevronCellChange: () => (/* binding */ handleChevronCellChange),
|
|
555
|
+
/* harmony export */ handleDropdownCellChange: () => (/* binding */ handleDropdownCellChange),
|
|
556
|
+
/* harmony export */ initCells: () => (/* binding */ initCells),
|
|
557
|
+
/* harmony export */ isChevronCellExpanded: () => (/* binding */ isChevronCellExpanded)
|
|
558
|
+
/* harmony export */ });
|
|
559
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
560
|
+
// Internal
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
/**
|
|
564
|
+
* @param {!BrickContext} $
|
|
565
|
+
*/
|
|
566
|
+
function initCells($) {
|
|
567
|
+
$.set('_rgDropdownIsOpen', '');
|
|
568
|
+
$.set('_rgDropdownInputValue', '');
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Generate a cell for the defined wrapper/column
|
|
573
|
+
* @param {!BrickContext} $
|
|
574
|
+
* @param {!RGWrapper} wrapper
|
|
575
|
+
* @param {number} rowId
|
|
576
|
+
* @param {!Object} column
|
|
577
|
+
* @param {boolean} cellEdition
|
|
578
|
+
* @return {!Object}
|
|
579
|
+
*/
|
|
580
|
+
function generateCell($, wrapper, rowId, column, cellEdition) {
|
|
581
|
+
try {
|
|
582
|
+
// Get the cell value
|
|
583
|
+
const value = wrapper.__rgGetValue(column['Property Path'] ?? '');
|
|
584
|
+
|
|
585
|
+
// Get the options
|
|
586
|
+
const [options, optionsError] = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.fromJson)(column.Options);
|
|
587
|
+
if(optionsError) {
|
|
588
|
+
warn(`cannot parse column options, error: ${optionsError.message}`);
|
|
589
|
+
}
|
|
590
|
+
const validator = options.validator ? s => new RegExp(options.validator).test(s) : undefined;
|
|
591
|
+
const common = {
|
|
592
|
+
nonEditable: cellEdition === 'DISABLED' || (cellEdition === 'USE CONFIG' && !column.Editable),
|
|
593
|
+
style: getCellStyle($)
|
|
594
|
+
};
|
|
595
|
+
|
|
596
|
+
// Generate the cell depending on the type
|
|
597
|
+
switch(column.Type) {
|
|
598
|
+
case 'TEXT': return generateTextCell(value, options, common, column, validator);
|
|
599
|
+
case 'NUMBER': return generateNumberCell(value, options, common);
|
|
600
|
+
case 'EMAIL': return generateEmailCell(value, common, validator);
|
|
601
|
+
case 'DATE':
|
|
602
|
+
case 'TIME': return generateDateTimeCell(value, options, common, column);
|
|
603
|
+
case 'CHECKBOX': return generateCheckboxCell(value, options, common);
|
|
604
|
+
case 'DROPDOWN': return generateDropdownCell(value, options, common, column, $, rowId);
|
|
605
|
+
case 'HEADER': return generateHeaderCell(value, options, common);
|
|
606
|
+
case 'CHEVRON': return generateChevronCell(value, options, common, wrapper, $);
|
|
607
|
+
|
|
608
|
+
// AUTO case
|
|
609
|
+
default:
|
|
610
|
+
if(value instanceof Date) {
|
|
611
|
+
return generateCell($, wrapper, rowId, { ...column, Type: 'DATE' }, cellEdition);
|
|
612
|
+
}
|
|
613
|
+
switch(typeof value) {
|
|
614
|
+
case 'number': return generateCell($, wrapper, rowId, { ...column, Type: 'NUMBER' }, cellEdition);
|
|
615
|
+
case 'boolean': return generateCell($, wrapper, rowId, { ...column, Type: 'CHECKBOX' }, cellEdition);
|
|
616
|
+
default: return generateCell($, wrapper, rowId, { ...column, Type: 'TEXT', _cast: true }, cellEdition);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
catch(err) {
|
|
621
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_0__.error)(`cannot generate cell, error: ${err.message}`);
|
|
622
|
+
return errorCell();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Get the cell value, depending on its type
|
|
628
|
+
* @param {!Object} cell
|
|
629
|
+
* @return {*}
|
|
630
|
+
*/
|
|
631
|
+
function getCellValue(cell) {
|
|
632
|
+
switch(cell.type) {
|
|
633
|
+
case 'number': return cell.value;
|
|
634
|
+
case 'date': return cell.date;
|
|
635
|
+
case 'time': return cell.time;
|
|
636
|
+
case 'checkbox': return cell.checked;
|
|
637
|
+
case 'dropdown': return cell.selectedValue;
|
|
638
|
+
default: return cell.text;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* @param {*} value
|
|
644
|
+
* @param {!Object} options
|
|
645
|
+
* @param {!Object} common
|
|
646
|
+
* @param {!Object} column
|
|
647
|
+
* @param {function(string):boolean} validator
|
|
648
|
+
* @return {!TextCell}
|
|
649
|
+
*/
|
|
650
|
+
function generateTextCell(value, options, common, column, validator) {
|
|
651
|
+
return {
|
|
652
|
+
type: 'text',
|
|
653
|
+
text: (column._cast ? String(value ?? '') : value ?? ''),
|
|
654
|
+
placeholder: options.placeholder,
|
|
655
|
+
validator: validator,
|
|
656
|
+
...common
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* @param {*} value
|
|
662
|
+
* @param {!Object} options
|
|
663
|
+
* @param {!Object} common
|
|
664
|
+
* @return {!NumberCell}
|
|
665
|
+
*/
|
|
666
|
+
function generateNumberCell(value, options, common) {
|
|
667
|
+
return {
|
|
668
|
+
type: 'number',
|
|
669
|
+
value: value,
|
|
670
|
+
format: new Intl.NumberFormat(options.locale, options.format),
|
|
671
|
+
nanToZero: options.nanToZero,
|
|
672
|
+
hideZero: options.hideZero,
|
|
673
|
+
...common
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* @param {*} value
|
|
679
|
+
* @param {!Object} common
|
|
680
|
+
* @param {function(string):boolean} validator
|
|
681
|
+
* @return {!EmailCell}
|
|
682
|
+
*/
|
|
683
|
+
function generateEmailCell(value, common, validator) {
|
|
684
|
+
return {
|
|
685
|
+
type: 'email',
|
|
686
|
+
text: value ?? '',
|
|
687
|
+
validator: validator ?? _helpers__WEBPACK_IMPORTED_MODULE_0__.validateEmail,
|
|
688
|
+
...common
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* @param {*} value
|
|
694
|
+
* @param {!Object} options
|
|
695
|
+
* @param {!Object} common
|
|
696
|
+
* @param {!Object} column
|
|
697
|
+
* @return {!DateCell|!TimeCell}
|
|
698
|
+
*/
|
|
699
|
+
function generateDateTimeCell(value, options, common, column) {
|
|
700
|
+
const type = column.Type.toLowerCase();
|
|
701
|
+
return {
|
|
702
|
+
type: type,
|
|
703
|
+
[type]: value instanceof Date ? value : new Date(value),
|
|
704
|
+
format: new Intl.DateTimeFormat(options.locale, options.format ?? { [`${type}Style`]: 'short' }),
|
|
705
|
+
...common
|
|
706
|
+
};
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* @param {*} value
|
|
711
|
+
* @param {!Object} options
|
|
712
|
+
* @param {!Object} common
|
|
713
|
+
* @return {!CheckboxCell}
|
|
714
|
+
*/
|
|
715
|
+
function generateCheckboxCell(value, options, common) {
|
|
716
|
+
return {
|
|
717
|
+
type: 'checkbox',
|
|
718
|
+
checked: Boolean(value ?? false),
|
|
719
|
+
checkedText: options.checkedText,
|
|
720
|
+
uncheckedText: options.uncheckedText,
|
|
721
|
+
...common
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* @param {*} value
|
|
727
|
+
* @param {!Object} options
|
|
728
|
+
* @param {!Object} common
|
|
729
|
+
* @param {!Object} column
|
|
730
|
+
* @param {!BrickContext} $
|
|
731
|
+
* @param {number} rowId
|
|
732
|
+
* @return {!DropdownCell}
|
|
733
|
+
*/
|
|
734
|
+
function generateDropdownCell(value, options, common, column, $, rowId) {
|
|
735
|
+
const id = `${rowId}.${column.columnId}`;
|
|
736
|
+
const isOpen = id === $.get('_rgDropdownIsOpen');
|
|
737
|
+
const inputValue = isOpen ? $.get('_rgDropdownInputValue') : '';
|
|
738
|
+
return {
|
|
739
|
+
type: 'dropdown',
|
|
740
|
+
selectedValue: value,
|
|
741
|
+
values: options.values ?? [],
|
|
742
|
+
isDisabled: options.isDisabled,
|
|
743
|
+
isOpen: isOpen,
|
|
744
|
+
inputValue: inputValue,
|
|
745
|
+
...common
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Handle the dropdowns internal states
|
|
751
|
+
* @param {!BrickContext} $
|
|
752
|
+
* @param {!CellChange} change
|
|
753
|
+
*/
|
|
754
|
+
function handleDropdownCellChange($, change) {
|
|
755
|
+
const id = `${change.rowId}.${change.columnId}`;
|
|
756
|
+
if(change.newCell.isOpen && !change.newCell.isDisabled) {
|
|
757
|
+
$.set('_rgDropdownIsOpen', id);
|
|
758
|
+
$.set('_rgDropdownInputValue', change.newCell.inputValue);
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
$.set('_rgDropdownIsOpen', '');
|
|
762
|
+
$.set('_rgDropdownInputValue', '');
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* @param {*} value
|
|
768
|
+
* @param {!Object} options
|
|
769
|
+
* @param {!Object} common
|
|
770
|
+
* @return {!HeaderCell}
|
|
771
|
+
*/
|
|
772
|
+
function generateHeaderCell(value, options, common) {
|
|
773
|
+
return {
|
|
774
|
+
type: 'header',
|
|
775
|
+
text: value ?? options.text ?? '',
|
|
776
|
+
...common
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* @param {*} value
|
|
782
|
+
* @param {!Object} options
|
|
783
|
+
* @param {!Object} common
|
|
784
|
+
* @param {!RGWrapper} wrapper
|
|
785
|
+
* @param {!BrickContext} $
|
|
786
|
+
* @return {!ChevronCell}
|
|
787
|
+
*/
|
|
788
|
+
function generateChevronCell(value, options, common, wrapper, $) {
|
|
789
|
+
const id = `_rgChevron.${wrapper.rgGetKey()}`;
|
|
790
|
+
if(!$.has(id)) {
|
|
791
|
+
$.set(id, { isExpanded: options.isExpanded ?? false });
|
|
792
|
+
}
|
|
793
|
+
const state = $.get(id);
|
|
794
|
+
return {
|
|
795
|
+
type: 'chevron',
|
|
796
|
+
text: value ?? options.text ?? '',
|
|
797
|
+
indent: options.indent,
|
|
798
|
+
hasChildren: wrapper.rgChildren.length > 0,
|
|
799
|
+
...state,
|
|
800
|
+
...common
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Handle the chevrons internal states
|
|
806
|
+
* @param {!BrickContext} $
|
|
807
|
+
* @param {!CellChange} change
|
|
808
|
+
* @param {!RGWrapper} wrapper
|
|
809
|
+
*/
|
|
810
|
+
function handleChevronCellChange($, change, wrapper) {
|
|
811
|
+
const id = `_rgChevron.${wrapper.rgGetKey()}`;
|
|
812
|
+
$.set(id, { isExpanded: change.newCell.isExpanded });
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
/**
|
|
816
|
+
* @param {!BrickContext} $
|
|
817
|
+
* @param {!RGWrapper} wrapper
|
|
818
|
+
* @return {boolean}
|
|
819
|
+
*/
|
|
820
|
+
function isChevronCellExpanded($, wrapper) {
|
|
821
|
+
const id = `_rgChevron.${wrapper.rgGetKey()}`;
|
|
822
|
+
return $.get(id)?.isExpanded ?? false;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* @param {!BrickContext} $
|
|
827
|
+
* @return {!Object}
|
|
828
|
+
*/
|
|
829
|
+
function getCellStyle($) {
|
|
830
|
+
const borderStyle = {
|
|
831
|
+
color: $.get('Border Color'),
|
|
832
|
+
width: $.get('Border Width')
|
|
833
|
+
};
|
|
834
|
+
return {
|
|
835
|
+
background: $.get('Default Color'),
|
|
836
|
+
border: {
|
|
837
|
+
left: borderStyle,
|
|
838
|
+
top: borderStyle,
|
|
839
|
+
right: borderStyle,
|
|
840
|
+
bottom: borderStyle
|
|
841
|
+
}
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/**
|
|
846
|
+
* @return {!TextCell}
|
|
847
|
+
*/
|
|
848
|
+
function errorCell() {
|
|
849
|
+
return {
|
|
850
|
+
type: 'text',
|
|
851
|
+
text: '!ERROR',
|
|
852
|
+
nonEditable: true,
|
|
853
|
+
style: {
|
|
854
|
+
color: 'red'
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
/***/ }),
|
|
861
|
+
|
|
862
|
+
/***/ "./src/common/internal/changes.js":
|
|
863
|
+
/*!****************************************!*\
|
|
864
|
+
!*** ./src/common/internal/changes.js ***!
|
|
865
|
+
\****************************************/
|
|
866
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
867
|
+
|
|
868
|
+
__webpack_require__.r(__webpack_exports__);
|
|
869
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
870
|
+
/* harmony export */ RGChange: () => (/* binding */ RGChange),
|
|
871
|
+
/* harmony export */ handleOnCellsChanged: () => (/* binding */ handleOnCellsChanged)
|
|
872
|
+
/* harmony export */ });
|
|
873
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
874
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
875
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
876
|
+
/* harmony import */ var _wrappers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wrappers */ "./src/common/internal/wrappers.js");
|
|
877
|
+
/* harmony import */ var _cells__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cells */ "./src/common/internal/cells.js");
|
|
878
|
+
/* harmony import */ var _columns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./columns */ "./src/common/internal/columns.js");
|
|
879
|
+
/* harmony import */ var _triggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./triggers */ "./src/common/internal/triggers.js");
|
|
880
|
+
// Olympe
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
// Internal
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
|
|
887
|
+
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* @typedef {Object} RGChange
|
|
892
|
+
* @property {(!Object|!CloudObject)} object
|
|
893
|
+
* @property {(string|!PropertyModel)} property
|
|
894
|
+
* @property {*} oldValue
|
|
895
|
+
* @property {*} newValue
|
|
896
|
+
* @property {!CellChange} metadata
|
|
897
|
+
*/
|
|
898
|
+
const RGChange = {};
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Process the changes event from the reactgrid, and forward it to a lambda
|
|
902
|
+
* @param {!BrickContext} $
|
|
903
|
+
* @param {!Array} changes
|
|
904
|
+
*/
|
|
905
|
+
function handleOnCellsChanged($, changes) {
|
|
906
|
+
// Only process changes when a lambda is defined
|
|
907
|
+
const processor = $.get('Process Changes');
|
|
908
|
+
if(!processor) {
|
|
909
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_1__.warn)('no change is processed, the `Process Changes` lambda is no defined');
|
|
910
|
+
return;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
// Adapt the changes to olympe
|
|
914
|
+
let internalStateChanged = false;
|
|
915
|
+
const flattenWrappers = (0,_wrappers__WEBPACK_IMPORTED_MODULE_2__.getFlattenWrappers)($);
|
|
916
|
+
const _changes = changes
|
|
917
|
+
// Transform the changes to work well with Olympe
|
|
918
|
+
.map(change => {
|
|
919
|
+
// Get the required data
|
|
920
|
+
const wrapper = flattenWrappers[change.rowId].wrapper;
|
|
921
|
+
const columns = (0,_columns__WEBPACK_IMPORTED_MODULE_4__.getColumns)($, wrapper._rgLevel);
|
|
922
|
+
const column = columns.find(c => c.Rank === change.columnId);
|
|
923
|
+
|
|
924
|
+
// Guard
|
|
925
|
+
if(column === undefined) {
|
|
926
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_1__.warn)(`no column found for level ${wrapper._rgLevel} and rank ${change.columnId}`);
|
|
927
|
+
return null;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
// Handle dropdowns states
|
|
931
|
+
if(change.type === 'dropdown') {
|
|
932
|
+
(0,_cells__WEBPACK_IMPORTED_MODULE_3__.handleDropdownCellChange)($, change);
|
|
933
|
+
internalStateChanged = true;
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// Handle chevrons states
|
|
937
|
+
else if(change.type === 'chevron') {
|
|
938
|
+
(0,_cells__WEBPACK_IMPORTED_MODULE_3__.handleChevronCellChange)($, change, wrapper);
|
|
939
|
+
internalStateChanged = true;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
// Create the RGChange object
|
|
943
|
+
return {
|
|
944
|
+
object: wrapper.__rgGetObject(column['Property Path']),
|
|
945
|
+
property: wrapper.__rgGetProperty(column['Property Path']),
|
|
946
|
+
oldValue: (0,_cells__WEBPACK_IMPORTED_MODULE_3__.getCellValue)(change.previousCell),
|
|
947
|
+
newValue: (0,_cells__WEBPACK_IMPORTED_MODULE_3__.getCellValue)(change.newCell),
|
|
948
|
+
metadata: change
|
|
949
|
+
};
|
|
950
|
+
})
|
|
951
|
+
// Filter out null change
|
|
952
|
+
.filter(change => change !== null)
|
|
953
|
+
// Filter out the dropdown change that are only about the internal state
|
|
954
|
+
.filter(change => change.metadata.type !== 'dropdown' || change.newValue !== change.oldValue)
|
|
955
|
+
// Filter out the chevron change that are only about the internal state
|
|
956
|
+
.filter(change => change.metadata.type !== 'chevron' || change.newValue !== change.oldValue)
|
|
957
|
+
// Filter out changes with no value, only if there is change with value -> hack to fix paste from excel until a better solution
|
|
958
|
+
.filter((change, _index, all) => change.newValue !== "" || all.every(c => c.newValue === ""));
|
|
959
|
+
|
|
960
|
+
// Guard
|
|
961
|
+
if(_changes.length === 0) {
|
|
962
|
+
if(internalStateChanged) {
|
|
963
|
+
(0,_triggers__WEBPACK_IMPORTED_MODULE_5__.triggerReload)($);
|
|
964
|
+
}
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
// Call the lambda
|
|
969
|
+
const [iFlow, iChanges] = processor.getInputs();
|
|
970
|
+
const [oFlow, oErrorFlow] = processor.getOutputs();
|
|
971
|
+
const processor$ = $.runner(processor);
|
|
972
|
+
processor$.set(iChanges, _changes);
|
|
973
|
+
processor$.trigger(iFlow);
|
|
974
|
+
|
|
975
|
+
// Wait for the end of it
|
|
976
|
+
Promise.race([
|
|
977
|
+
processor$.waitFor(oFlow),
|
|
978
|
+
processor$.waitFor(oErrorFlow)
|
|
979
|
+
])
|
|
980
|
+
.then(value => {
|
|
981
|
+
// In case of error, throw it again
|
|
982
|
+
if(value instanceof olympe__WEBPACK_IMPORTED_MODULE_0__.ErrorFlow) {
|
|
983
|
+
$.throw(value);
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// Success
|
|
987
|
+
else {
|
|
988
|
+
(0,_triggers__WEBPACK_IMPORTED_MODULE_5__.triggerReload)($);
|
|
989
|
+
}
|
|
990
|
+
})
|
|
991
|
+
|
|
992
|
+
// Free the lambda
|
|
993
|
+
.finally(() => processor$.destroy());
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
|
|
997
|
+
/***/ }),
|
|
998
|
+
|
|
999
|
+
/***/ "./src/common/internal/cloudobjects.js":
|
|
1000
|
+
/*!*********************************************!*\
|
|
1001
|
+
!*** ./src/common/internal/cloudobjects.js ***!
|
|
1002
|
+
\*********************************************/
|
|
1003
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1004
|
+
|
|
1005
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1006
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1007
|
+
/* harmony export */ findObjectProperty: () => (/* binding */ findObjectProperty),
|
|
1008
|
+
/* harmony export */ getModelPropertiesName: () => (/* binding */ getModelPropertiesName)
|
|
1009
|
+
/* harmony export */ });
|
|
1010
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
1011
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
/**
|
|
1015
|
+
* Find an object property based on its name
|
|
1016
|
+
* @param {!CloudObject} object
|
|
1017
|
+
* @param {string} path
|
|
1018
|
+
* @return {!PropertyModel}
|
|
1019
|
+
*/
|
|
1020
|
+
function findObjectProperty(object, path) {
|
|
1021
|
+
const mapping = getModelPropertiesMapping(object);
|
|
1022
|
+
return mapping.get(path);
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* Get all properties name of an object
|
|
1027
|
+
* @param {!CloudObject} object
|
|
1028
|
+
* @return {!Array<string>}
|
|
1029
|
+
*/
|
|
1030
|
+
function getModelPropertiesName(object) {
|
|
1031
|
+
const mapping = getModelPropertiesMapping(object);
|
|
1032
|
+
return Array.from(mapping.keys());
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Get an object model properties mapping
|
|
1037
|
+
* @param {!CloudObject} object
|
|
1038
|
+
* @return {!Map<string, PropertyModel>}
|
|
1039
|
+
*/
|
|
1040
|
+
function getModelPropertiesMapping(object) {
|
|
1041
|
+
const model = object.getModel();
|
|
1042
|
+
if(!modelProperties.has(model.getTag())) {
|
|
1043
|
+
const mapping = new Map();
|
|
1044
|
+
model.query()
|
|
1045
|
+
.follow(olympe__WEBPACK_IMPORTED_MODULE_0__.CloudObject.propertyRel)
|
|
1046
|
+
.executeFromCache()
|
|
1047
|
+
.forEach(property => mapping.set(property.name(), property));
|
|
1048
|
+
modelProperties.set(model.getTag(), mapping);
|
|
1049
|
+
}
|
|
1050
|
+
return modelProperties.get(model.getTag());
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Singleton map for model properties mapping (name <-> instance)
|
|
1055
|
+
* @type {!Map<string, !Map<string, PropertyModel>>}
|
|
1056
|
+
*/
|
|
1057
|
+
const modelProperties = new Map();
|
|
1058
|
+
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
/***/ }),
|
|
1062
|
+
|
|
1063
|
+
/***/ "./src/common/internal/columns.js":
|
|
1064
|
+
/*!****************************************!*\
|
|
1065
|
+
!*** ./src/common/internal/columns.js ***!
|
|
1066
|
+
\****************************************/
|
|
1067
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1068
|
+
|
|
1069
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1070
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1071
|
+
/* harmony export */ getColumns: () => (/* binding */ getColumns),
|
|
1072
|
+
/* harmony export */ handleOnColumnResized: () => (/* binding */ handleOnColumnResized),
|
|
1073
|
+
/* harmony export */ handleOnColumnsReordered: () => (/* binding */ handleOnColumnsReordered),
|
|
1074
|
+
/* harmony export */ initFilteredColumns: () => (/* binding */ initFilteredColumns),
|
|
1075
|
+
/* harmony export */ useColumns: () => (/* binding */ useColumns)
|
|
1076
|
+
/* harmony export */ });
|
|
1077
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
1078
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
1079
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @olympeio/core */ "@olympeio/core");
|
|
1080
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_olympeio_core__WEBPACK_IMPORTED_MODULE_1__);
|
|
1081
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
1082
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_2__);
|
|
1083
|
+
/* harmony import */ var _wrappers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrappers */ "./src/common/internal/wrappers.js");
|
|
1084
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
1085
|
+
// Olympe
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
// Rxjs
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
// Internal
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
/**
|
|
1097
|
+
* Init the columns
|
|
1098
|
+
* @param {!BrickContext} $
|
|
1099
|
+
* @param {!Observable} _wrappers
|
|
1100
|
+
* @return {!Observable}
|
|
1101
|
+
*/
|
|
1102
|
+
function initFilteredColumns($, _wrappers) {
|
|
1103
|
+
// Internal states
|
|
1104
|
+
$.set('_rgColumnWidth', {}); // Column width overrides
|
|
1105
|
+
$.set('_rgColumnOrder', {}); // Column order (rank) overrides
|
|
1106
|
+
|
|
1107
|
+
// Listen to the config and the _wrappers first object properties
|
|
1108
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.combineLatest)([
|
|
1109
|
+
$.observe('Config', false),
|
|
1110
|
+
_wrappers
|
|
1111
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)(wrappers => (wrappers[0] ?? (0,_wrappers__WEBPACK_IMPORTED_MODULE_3__.defaultWrap)()).__rgProperties()))
|
|
1112
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)()),
|
|
1113
|
+
$.observe('Enable Column Reordering', false),
|
|
1114
|
+
$.observe('_rgColumnWidth'),
|
|
1115
|
+
$.observe('_rgColumnOrder'),
|
|
1116
|
+
$.observe('Default Width')
|
|
1117
|
+
])
|
|
1118
|
+
|
|
1119
|
+
// Build the columns
|
|
1120
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)(([config, properties, ...others]) => {
|
|
1121
|
+
// Config is set by the user
|
|
1122
|
+
if (config) {
|
|
1123
|
+
return [config, ...others];
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// Config is auto-generated from the data
|
|
1127
|
+
if (properties.length > 0) {
|
|
1128
|
+
return [
|
|
1129
|
+
properties.map((path, index) => ({ 'Property Path': path, Type: 'AUTO', Rank: index })),
|
|
1130
|
+
...others
|
|
1131
|
+
];
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
// Empty config
|
|
1135
|
+
return [[], ...others];
|
|
1136
|
+
}))
|
|
1137
|
+
|
|
1138
|
+
// Transform to an array of objects
|
|
1139
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)(([config, reorderableColumns, columnWidth, columnOrder, defaultWidth]) => {
|
|
1140
|
+
return config
|
|
1141
|
+
.map(column => column instanceof olympe__WEBPACK_IMPORTED_MODULE_0__.CloudObject ? column.toObject(true, true) : column)
|
|
1142
|
+
.sort((a, b) => getColumnRank(a, columnOrder) - getColumnRank(b, columnOrder))
|
|
1143
|
+
.map(column => generateColumn(column, reorderableColumns, columnWidth, defaultWidth));
|
|
1144
|
+
}))
|
|
1145
|
+
|
|
1146
|
+
// Cache the filtered columns (per level) for quick access
|
|
1147
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)(columns => {
|
|
1148
|
+
const filteredColumns = filterLevelledColumns(columns);
|
|
1149
|
+
$.set('_rgFilteredColumns', filteredColumns);
|
|
1150
|
+
return filteredColumns;
|
|
1151
|
+
}));
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* @param {!BrickContext} $
|
|
1156
|
+
* @return {!*}
|
|
1157
|
+
*/
|
|
1158
|
+
function useColumns($) {
|
|
1159
|
+
const filteredColumns = (0,_olympeio_core__WEBPACK_IMPORTED_MODULE_1__.useProperty)($, '_rgFilteredColumns');
|
|
1160
|
+
return filteredColumns?.get(0) ?? [];
|
|
1161
|
+
}
|
|
1162
|
+
|
|
1163
|
+
/**
|
|
1164
|
+
* @param {!BrickContext} $
|
|
1165
|
+
* @param {number} level
|
|
1166
|
+
* @return {!Array}
|
|
1167
|
+
*/
|
|
1168
|
+
function getColumns($, level) {
|
|
1169
|
+
const filteredColumns = $.get('_rgFilteredColumns');
|
|
1170
|
+
return filteredColumns?.get(level ?? 0) ?? [];
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Handle the resizing of columns
|
|
1175
|
+
* @param {!BrickContext} $
|
|
1176
|
+
* @param {string} columnId
|
|
1177
|
+
* @param {number} width
|
|
1178
|
+
*/
|
|
1179
|
+
function handleOnColumnResized($, columnId, width) {
|
|
1180
|
+
const currentCols = { ...$.get('_rgColumnWidth') };
|
|
1181
|
+
currentCols[columnId] = width;
|
|
1182
|
+
$.set('_rgColumnWidth', currentCols);
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
/**
|
|
1186
|
+
* @param {!Array} columns
|
|
1187
|
+
* @return {!Map<number, !Array>}
|
|
1188
|
+
*/
|
|
1189
|
+
function filterLevelledColumns(columns) {
|
|
1190
|
+
// Group the columns by rank and save all levels
|
|
1191
|
+
const levels = new Set();
|
|
1192
|
+
const perRank = columns.reduce((acc, cur) => {
|
|
1193
|
+
const rank = cur.Rank ?? 0;
|
|
1194
|
+
if(!acc.has(rank)) {
|
|
1195
|
+
acc.set(rank, []);
|
|
1196
|
+
}
|
|
1197
|
+
acc.get(rank).push(cur);
|
|
1198
|
+
levels.add(cur.Level ?? 0);
|
|
1199
|
+
return acc;
|
|
1200
|
+
}, new Map());
|
|
1201
|
+
const allRanks = Array.from(perRank.keys());
|
|
1202
|
+
|
|
1203
|
+
// Get the columns for each level
|
|
1204
|
+
const filterLevel = level => {
|
|
1205
|
+
return allRanks.map(rank => {
|
|
1206
|
+
const rankColumns = perRank.get(rank);
|
|
1207
|
+
const atLevel = rankColumns.find(column => (column.Level ?? 0) === level);
|
|
1208
|
+
const generic = rankColumns.find(column => (column.Level ?? 0) === -1);
|
|
1209
|
+
return atLevel ?? generic ?? rankColumns[0];
|
|
1210
|
+
});
|
|
1211
|
+
};
|
|
1212
|
+
|
|
1213
|
+
// Return all levels
|
|
1214
|
+
return Array.from(levels.values()).reduce((acc, cur) => acc.set(cur, filterLevel(cur)), new Map());
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* @param {!Object} column
|
|
1219
|
+
* @param {boolean} reorderableColumns
|
|
1220
|
+
* @param {!Object} columnWidth
|
|
1221
|
+
* @param {number} defaultWidth
|
|
1222
|
+
* @return {!Object}
|
|
1223
|
+
*/
|
|
1224
|
+
function generateColumn(column, reorderableColumns, columnWidth, defaultWidth) {
|
|
1225
|
+
if(typeof column.Rank !== 'number') {
|
|
1226
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_4__.warn)(`column rank is missing, using 0 as fallback (column: ${column.Header ?? column['Property Path']})`);
|
|
1227
|
+
}
|
|
1228
|
+
const rank = column.Rank ?? 0;
|
|
1229
|
+
return {
|
|
1230
|
+
columnId: rank,
|
|
1231
|
+
reorderable: reorderableColumns,
|
|
1232
|
+
width: columnWidth?.[rank] ?? column.Width ?? defaultWidth ?? 150,
|
|
1233
|
+
resizable: column.Resizable,
|
|
1234
|
+
Level: column.Level ?? 0,
|
|
1235
|
+
...column
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/**
|
|
1240
|
+
* @param {!BrickContext} $
|
|
1241
|
+
* @param {number} targetColumnId
|
|
1242
|
+
* @param {!Array} columnIds
|
|
1243
|
+
*/
|
|
1244
|
+
function handleOnColumnsReordered($, targetColumnId, columnIds) {
|
|
1245
|
+
const columns = getColumns($, 0);
|
|
1246
|
+
const ranks = columns.map(column => column.Rank);
|
|
1247
|
+
const targetIndex = ranks.indexOf(targetColumnId);
|
|
1248
|
+
const movingIndexes = columnIds.map(id => ranks.indexOf(id));
|
|
1249
|
+
const newRanks = (0,_helpers__WEBPACK_IMPORTED_MODULE_4__.reorderObject)(ranks, movingIndexes, targetIndex);
|
|
1250
|
+
const newOrder = newRanks.reduce((acc, cur, index) => ({ [cur]: index, ...acc }), {});
|
|
1251
|
+
$.set('_rgColumnOrder', newOrder);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* @param {!Object} column
|
|
1256
|
+
* @param {!Object} overrides
|
|
1257
|
+
* @return {number}
|
|
1258
|
+
*/
|
|
1259
|
+
function getColumnRank(column, overrides) {
|
|
1260
|
+
return overrides[column.Rank] ?? column.Rank;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
/***/ }),
|
|
1265
|
+
|
|
1266
|
+
/***/ "./src/common/internal/data.js":
|
|
1267
|
+
/*!*************************************!*\
|
|
1268
|
+
!*** ./src/common/internal/data.js ***!
|
|
1269
|
+
\*************************************/
|
|
1270
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1271
|
+
|
|
1272
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1273
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1274
|
+
/* harmony export */ initData: () => (/* binding */ initData)
|
|
1275
|
+
/* harmony export */ });
|
|
1276
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
1277
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
1278
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
1279
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
1280
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
1281
|
+
// Olympe
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
// Rxjs
|
|
1285
|
+
|
|
1286
|
+
|
|
1287
|
+
// Internal
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* Init the internal data state, make sure it is an array
|
|
1292
|
+
* @param {!BrickContext} $
|
|
1293
|
+
* @param {!Observable} _reload
|
|
1294
|
+
* @return {!Observable}
|
|
1295
|
+
*/
|
|
1296
|
+
function initData($, _reload) {
|
|
1297
|
+
// Listen to the data and for any refresh
|
|
1298
|
+
return (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.combineLatest)([
|
|
1299
|
+
$.observe('Data', false),
|
|
1300
|
+
_reload
|
|
1301
|
+
])
|
|
1302
|
+
|
|
1303
|
+
// Default values
|
|
1304
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.map)(([data]) => data ? data : []))
|
|
1305
|
+
|
|
1306
|
+
// Transform to an array
|
|
1307
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.map)(data => {
|
|
1308
|
+
// The data is already an array
|
|
1309
|
+
if (Array.isArray(data)) {
|
|
1310
|
+
return data;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
// QueryResult case
|
|
1314
|
+
if (data instanceof olympe__WEBPACK_IMPORTED_MODULE_0__.QueryResult) {
|
|
1315
|
+
return data.toArray();
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
// JSON case
|
|
1319
|
+
if (typeof data === 'string') {
|
|
1320
|
+
const [json, error] = (0,_helpers__WEBPACK_IMPORTED_MODULE_2__.fromJson)(data);
|
|
1321
|
+
if (!error && Array.isArray(json)) {
|
|
1322
|
+
return json;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// Type is not supported
|
|
1327
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_2__.warn)('the `Data` property is not convertible to an array');
|
|
1328
|
+
return [];
|
|
1329
|
+
}))
|
|
1330
|
+
|
|
1331
|
+
// Set the transformed data into _Data
|
|
1332
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.tap)(data => $.set('_rgData', data)));
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
/***/ }),
|
|
1338
|
+
|
|
1339
|
+
/***/ "./src/common/internal/helpers.js":
|
|
1340
|
+
/*!****************************************!*\
|
|
1341
|
+
!*** ./src/common/internal/helpers.js ***!
|
|
1342
|
+
\****************************************/
|
|
1343
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1344
|
+
|
|
1345
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1346
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1347
|
+
/* harmony export */ error: () => (/* binding */ error),
|
|
1348
|
+
/* harmony export */ fromJson: () => (/* binding */ fromJson),
|
|
1349
|
+
/* harmony export */ reorderObject: () => (/* binding */ reorderObject),
|
|
1350
|
+
/* harmony export */ trimPath: () => (/* binding */ trimPath),
|
|
1351
|
+
/* harmony export */ validateEmail: () => (/* binding */ validateEmail),
|
|
1352
|
+
/* harmony export */ warn: () => (/* binding */ warn)
|
|
1353
|
+
/* harmony export */ });
|
|
1354
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @olympeio/core */ "@olympeio/core");
|
|
1355
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_olympeio_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1356
|
+
// Olympe
|
|
1357
|
+
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* Parse a json string without throwing an exception
|
|
1361
|
+
* @param {string|!Object} json
|
|
1362
|
+
* @return {!Array}
|
|
1363
|
+
*/
|
|
1364
|
+
function fromJson(json) {
|
|
1365
|
+
try {
|
|
1366
|
+
return typeof json === 'string'
|
|
1367
|
+
? [JSON.parse(json), null]
|
|
1368
|
+
: [json ?? {}, null];
|
|
1369
|
+
}
|
|
1370
|
+
catch(err) {
|
|
1371
|
+
return [{}, err];
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Warn message with a default format
|
|
1377
|
+
* @param {string} message
|
|
1378
|
+
*/
|
|
1379
|
+
function warn(message) {
|
|
1380
|
+
(0,_olympeio_core__WEBPACK_IMPORTED_MODULE_0__.getLogger)('ReactGrid').warn(`ReactGrid: ${message}`);
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
/**
|
|
1384
|
+
* Error message with a default format
|
|
1385
|
+
* @param {string} message
|
|
1386
|
+
*/
|
|
1387
|
+
function error(message) {
|
|
1388
|
+
(0,_olympeio_core__WEBPACK_IMPORTED_MODULE_0__.getLogger)('ReactGrid').error(`ReactGrid: ${message}`);
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
/**
|
|
1392
|
+
* Make a jsonpath-plus path readable
|
|
1393
|
+
* @param {string} path
|
|
1394
|
+
* @return {string}
|
|
1395
|
+
*/
|
|
1396
|
+
function trimPath(path) {
|
|
1397
|
+
if(path.startsWith('$') || path.startsWith('.')) {
|
|
1398
|
+
return trimPath(path.substring(1));
|
|
1399
|
+
}
|
|
1400
|
+
if(path.startsWith('[')) {
|
|
1401
|
+
return trimPath(path.substring(path.indexOf(']') + 1));
|
|
1402
|
+
}
|
|
1403
|
+
return path;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* Test for email format
|
|
1408
|
+
* @param {string} text
|
|
1409
|
+
* @return {boolean}
|
|
1410
|
+
*/
|
|
1411
|
+
function validateEmail(text) {
|
|
1412
|
+
return emailRegex.test(text);
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
// Email regex (https://emailregex.com/)
|
|
1416
|
+
const emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* Reorders elements in an object by moving specific elements to a new position.
|
|
1420
|
+
*
|
|
1421
|
+
* @param {Array} values - The original array to reorder.
|
|
1422
|
+
* @param {number[]} ids - An array of indices representing the elements to move.
|
|
1423
|
+
* @param {number} to - The target index where the selected elements should be moved.
|
|
1424
|
+
* @return {Object} - A new object with the specified elements reordered.
|
|
1425
|
+
*/
|
|
1426
|
+
function reorderObject(values, ids, to) {
|
|
1427
|
+
const reorderedValues = [...values];
|
|
1428
|
+
|
|
1429
|
+
// Get elements to move based on the ids
|
|
1430
|
+
const elementsToMove = ids.map(index => reorderedValues[index]);
|
|
1431
|
+
ids.sort((a, b) => b - a).forEach(index => {
|
|
1432
|
+
reorderedValues.splice(index, 1);
|
|
1433
|
+
});
|
|
1434
|
+
|
|
1435
|
+
// Adjust the target id based on moving forward or backward
|
|
1436
|
+
const adjustedTargetId = to >= Math.min(...ids) ? to - elementsToMove.length + 1 : to;
|
|
1437
|
+
|
|
1438
|
+
// Insert the elements in target id
|
|
1439
|
+
if (elementsToMove.length > 0) {
|
|
1440
|
+
reorderedValues.splice(adjustedTargetId, 0, ...elementsToMove);
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
return reorderedValues;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
1448
|
+
/***/ }),
|
|
1449
|
+
|
|
1450
|
+
/***/ "./src/common/internal/rows.js":
|
|
1451
|
+
/*!*************************************!*\
|
|
1452
|
+
!*** ./src/common/internal/rows.js ***!
|
|
1453
|
+
\*************************************/
|
|
1454
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1455
|
+
|
|
1456
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1457
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1458
|
+
/* harmony export */ initRows: () => (/* binding */ initRows),
|
|
1459
|
+
/* harmony export */ useRows: () => (/* binding */ useRows)
|
|
1460
|
+
/* harmony export */ });
|
|
1461
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @olympeio/core */ "@olympeio/core");
|
|
1462
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_olympeio_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1463
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
1464
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
1465
|
+
/* harmony import */ var _cells__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cells */ "./src/common/internal/cells.js");
|
|
1466
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
1467
|
+
/* harmony import */ var _columns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./columns */ "./src/common/internal/columns.js");
|
|
1468
|
+
/* harmony import */ var _wrappers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./wrappers */ "./src/common/internal/wrappers.js");
|
|
1469
|
+
// Olympe
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
// Rxjs
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
// Internal
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
|
|
1481
|
+
/**
|
|
1482
|
+
* Init the rows
|
|
1483
|
+
* @param {!BrickContext} $
|
|
1484
|
+
* @param {!Observable} _wrappers
|
|
1485
|
+
* @param {!Observable} _filteredColumns
|
|
1486
|
+
*/
|
|
1487
|
+
function initRows($, _wrappers, _filteredColumns) {
|
|
1488
|
+
// Listen to the _data and the _columns
|
|
1489
|
+
(0,rxjs__WEBPACK_IMPORTED_MODULE_1__.combineLatest)([
|
|
1490
|
+
_wrappers,
|
|
1491
|
+
_filteredColumns
|
|
1492
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.distinctUntilChanged)(undefined, filteredColumns => {
|
|
1493
|
+
// Avoid updating the rows for some changes on the column config: width, resizable, etc.
|
|
1494
|
+
return Array.from(filteredColumns.values())
|
|
1495
|
+
.flat()
|
|
1496
|
+
.map(c => `${c.Header}${c['Property Path']}${c.Type}${c.Options}${c.Rank}${c.Editable}${c.Level}`)
|
|
1497
|
+
.join('');
|
|
1498
|
+
})),
|
|
1499
|
+
$.observe('Row Height', false),
|
|
1500
|
+
$.observe('Cell Edition', false),
|
|
1501
|
+
$.observe('Disable Header Row', false),
|
|
1502
|
+
$.observe('Default Color', false),
|
|
1503
|
+
$.observe('Border Color', false),
|
|
1504
|
+
$.observe('Border Width', false)
|
|
1505
|
+
])
|
|
1506
|
+
|
|
1507
|
+
// Use the reactgrid format for rows
|
|
1508
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.map)(([_wrappers, _filteredColumns, rowHeight, cellEdition, removeHeaderRow]) => {
|
|
1509
|
+
// Optional header row
|
|
1510
|
+
const headerRow = removeHeaderRow ? [] : [{
|
|
1511
|
+
rowId: '_header',
|
|
1512
|
+
height: rowHeight,
|
|
1513
|
+
cells: (0,_columns__WEBPACK_IMPORTED_MODULE_4__.getColumns)($, 0).map(column => {
|
|
1514
|
+
const text = column.Header ?? (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.trimPath)(column['Property Path'] ?? '');
|
|
1515
|
+
const finalText = column.Level === 0 ? text : '';
|
|
1516
|
+
return { type: 'header', text: finalText, style: (0,_cells__WEBPACK_IMPORTED_MODULE_2__.getCellStyle)($) };
|
|
1517
|
+
})
|
|
1518
|
+
}];
|
|
1519
|
+
|
|
1520
|
+
// Generate all the rows
|
|
1521
|
+
const rows = (0,_wrappers__WEBPACK_IMPORTED_MODULE_5__.getFlattenWrappers)($).map(({ wrapper, level }, index) => {
|
|
1522
|
+
const rowColumns = (0,_columns__WEBPACK_IMPORTED_MODULE_4__.getColumns)($, level);
|
|
1523
|
+
return generateRow(wrapper, rowColumns, index, $, rowHeight, cellEdition);
|
|
1524
|
+
});
|
|
1525
|
+
|
|
1526
|
+
// Final rows
|
|
1527
|
+
return [headerRow, rows].flat();
|
|
1528
|
+
}))
|
|
1529
|
+
|
|
1530
|
+
// Set the final rows
|
|
1531
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.tap)(rows => $.set('_rgRows', rows)))
|
|
1532
|
+
|
|
1533
|
+
// Run
|
|
1534
|
+
.subscribe();
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
/**
|
|
1538
|
+
* @param {!BrickContext}
|
|
1539
|
+
* @return {!*}
|
|
1540
|
+
*/
|
|
1541
|
+
function useRows($) {
|
|
1542
|
+
return (0,_olympeio_core__WEBPACK_IMPORTED_MODULE_0__.useProperty)($, '_rgRows') ?? [];
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/**
|
|
1546
|
+
* @param {!RGWrapper} wrapper
|
|
1547
|
+
* @param {!Array} columns
|
|
1548
|
+
* @param {number} index
|
|
1549
|
+
* @param {!BrickContext} $
|
|
1550
|
+
* @param {number} rowHeight
|
|
1551
|
+
* @param {boolean} cellEdition
|
|
1552
|
+
* @return {!Object}
|
|
1553
|
+
*/
|
|
1554
|
+
function generateRow(wrapper, columns, index, $, rowHeight, cellEdition) {
|
|
1555
|
+
return {
|
|
1556
|
+
rowId: index,
|
|
1557
|
+
height: rowHeight,
|
|
1558
|
+
cells: columns.map(column => (0,_cells__WEBPACK_IMPORTED_MODULE_2__.generateCell)($, wrapper, index, column, cellEdition))
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
|
|
1563
|
+
/***/ }),
|
|
1564
|
+
|
|
1565
|
+
/***/ "./src/common/internal/scroll.js":
|
|
1566
|
+
/*!***************************************!*\
|
|
1567
|
+
!*** ./src/common/internal/scroll.js ***!
|
|
1568
|
+
\***************************************/
|
|
1569
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1570
|
+
|
|
1571
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1572
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1573
|
+
/* harmony export */ initScroll: () => (/* binding */ initScroll),
|
|
1574
|
+
/* harmony export */ useRedrawAfterScroll: () => (/* binding */ useRedrawAfterScroll)
|
|
1575
|
+
/* harmony export */ });
|
|
1576
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
1577
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
1578
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
1579
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
1580
|
+
/* harmony import */ var _triggers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triggers */ "./src/common/internal/triggers.js");
|
|
1581
|
+
// React
|
|
1582
|
+
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
// Internal
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
/**
|
|
1589
|
+
* @param {!BrickContext} $
|
|
1590
|
+
*/
|
|
1591
|
+
function initScroll($) {
|
|
1592
|
+
// Auto-redraw on scroll (fix fast scrolling issue)
|
|
1593
|
+
$.set('_rgLastScroll', 0);
|
|
1594
|
+
$.set('_rgLastScrollRedraw', 0);
|
|
1595
|
+
(0,rxjs__WEBPACK_IMPORTED_MODULE_1__.interval)(1000)
|
|
1596
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.tap)(() => {
|
|
1597
|
+
if($.get('_rgLastScroll') !== $.get('_rgLastScrollRedraw')) {
|
|
1598
|
+
$.set('_rgLastScrollRedraw', $.get('_rgLastScroll'));
|
|
1599
|
+
(0,_triggers__WEBPACK_IMPORTED_MODULE_2__.triggerRedraw)($);
|
|
1600
|
+
}
|
|
1601
|
+
}))
|
|
1602
|
+
.subscribe();
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
/**
|
|
1606
|
+
* @param {!BrickContext} $
|
|
1607
|
+
* @param {!*} ref
|
|
1608
|
+
*/
|
|
1609
|
+
function useRedrawAfterScroll($, ref) {
|
|
1610
|
+
const registerScroll = () => $.set('_rgLastScroll', Date.now());
|
|
1611
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
|
|
1612
|
+
if (ref.current) {
|
|
1613
|
+
ref.current.parentElement.style.overflow = 'visible';
|
|
1614
|
+
ref.current.addEventListener('scroll', registerScroll);
|
|
1615
|
+
}
|
|
1616
|
+
return () => {
|
|
1617
|
+
if (ref.current) {
|
|
1618
|
+
ref.current.removeEventListener('scroll', registerScroll);
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
}, [ref]);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
|
|
1626
|
+
/***/ }),
|
|
1627
|
+
|
|
1628
|
+
/***/ "./src/common/internal/triggers.js":
|
|
1629
|
+
/*!*****************************************!*\
|
|
1630
|
+
!*** ./src/common/internal/triggers.js ***!
|
|
1631
|
+
\*****************************************/
|
|
1632
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1633
|
+
|
|
1634
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1635
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1636
|
+
/* harmony export */ initTriggers: () => (/* binding */ initTriggers),
|
|
1637
|
+
/* harmony export */ triggerRedraw: () => (/* binding */ triggerRedraw),
|
|
1638
|
+
/* harmony export */ triggerReload: () => (/* binding */ triggerReload),
|
|
1639
|
+
/* harmony export */ useRedraw: () => (/* binding */ useRedraw)
|
|
1640
|
+
/* harmony export */ });
|
|
1641
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @olympeio/core */ "@olympeio/core");
|
|
1642
|
+
/* harmony import */ var _olympeio_core__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_olympeio_core__WEBPACK_IMPORTED_MODULE_0__);
|
|
1643
|
+
// Olympe
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* @param {!BrickContext} $
|
|
1648
|
+
* @return {!Observable}
|
|
1649
|
+
*/
|
|
1650
|
+
function initTriggers($) {
|
|
1651
|
+
return $.observe('Reload', false);
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
/**
|
|
1655
|
+
* @param {!BrickContext} $
|
|
1656
|
+
*/
|
|
1657
|
+
function useRedraw($) {
|
|
1658
|
+
(0,_olympeio_core__WEBPACK_IMPORTED_MODULE_0__.useProperty)($, 'Redraw');
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* @param {!BrickContext} $
|
|
1663
|
+
*/
|
|
1664
|
+
function triggerRedraw($) {
|
|
1665
|
+
$.trigger('Redraw');
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
/**
|
|
1669
|
+
* @param {!BrickContext} $
|
|
1670
|
+
*/
|
|
1671
|
+
function triggerReload($) {
|
|
1672
|
+
$.trigger('Reload');
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
/***/ }),
|
|
1678
|
+
|
|
1679
|
+
/***/ "./src/common/internal/wrappers.js":
|
|
1680
|
+
/*!*****************************************!*\
|
|
1681
|
+
!*** ./src/common/internal/wrappers.js ***!
|
|
1682
|
+
\*****************************************/
|
|
1683
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1684
|
+
|
|
1685
|
+
__webpack_require__.r(__webpack_exports__);
|
|
1686
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1687
|
+
/* harmony export */ RGWrapper: () => (/* binding */ RGWrapper),
|
|
1688
|
+
/* harmony export */ defaultWrap: () => (/* binding */ defaultWrap),
|
|
1689
|
+
/* harmony export */ getFlattenWrappers: () => (/* binding */ getFlattenWrappers),
|
|
1690
|
+
/* harmony export */ initWrappers: () => (/* binding */ initWrappers),
|
|
1691
|
+
/* harmony export */ rgWrap: () => (/* binding */ rgWrap)
|
|
1692
|
+
/* harmony export */ });
|
|
1693
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
1694
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
1695
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ "rxjs");
|
|
1696
|
+
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_1__);
|
|
1697
|
+
/* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! jsonpath-plus */ "jsonpath-plus");
|
|
1698
|
+
/* harmony import */ var jsonpath_plus__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(jsonpath_plus__WEBPACK_IMPORTED_MODULE_2__);
|
|
1699
|
+
/* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers */ "./src/common/internal/helpers.js");
|
|
1700
|
+
/* harmony import */ var _cloudobjects__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloudobjects */ "./src/common/internal/cloudobjects.js");
|
|
1701
|
+
/* harmony import */ var _cells__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cells */ "./src/common/internal/cells.js");
|
|
1702
|
+
// Olympe
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
// Rxjs
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
// Json
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
// Internal
|
|
1712
|
+
|
|
1713
|
+
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* @typedef RGWrapper
|
|
1718
|
+
* @property {!*} rgObject - The wrapped object
|
|
1719
|
+
* @property {!Array} rgChildren - Potential children of the object
|
|
1720
|
+
* @property {function():string} rgGetKey - Get a unique key
|
|
1721
|
+
* @property {string} _rgType - The type of the wrapped object
|
|
1722
|
+
* @property {number} _rgLevel - The level in the hierarchy
|
|
1723
|
+
* @property {function():!Array<string>} __rgProperties - Get all the properties name
|
|
1724
|
+
* @property {function(string):!*} __rgGetProperty - Get a property by its path
|
|
1725
|
+
* @property {function(string):!*} __rgGetValue - Get a value for a path
|
|
1726
|
+
* @property {function(string):!*} __rgGetObject - Get the object for a path
|
|
1727
|
+
*/
|
|
1728
|
+
const RGWrapper = {};
|
|
1729
|
+
|
|
1730
|
+
/**
|
|
1731
|
+
* Init the internal data state, make sure it is an array
|
|
1732
|
+
* @param {!BrickContext} $
|
|
1733
|
+
* @param {!Observable} _data
|
|
1734
|
+
* @return {!Observable}
|
|
1735
|
+
*/
|
|
1736
|
+
function initWrappers($, _data) {
|
|
1737
|
+
// Observe the data
|
|
1738
|
+
return _data
|
|
1739
|
+
|
|
1740
|
+
// Wrap all objects
|
|
1741
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.map)(data => data.map(d => rgWrap(d))))
|
|
1742
|
+
|
|
1743
|
+
// Set the transformed data into _Data
|
|
1744
|
+
.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_1__.tap)(wrappers => $.set('_rgWrappers', wrappers)));
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* @param {!*} object
|
|
1749
|
+
* @param {number=} level
|
|
1750
|
+
* @return {!RGWrapper}
|
|
1751
|
+
*/
|
|
1752
|
+
function rgWrap(object, level) {
|
|
1753
|
+
// Already wrapped -> rewrap missing properties
|
|
1754
|
+
if(object.hasOwnProperty('rgObject')) {
|
|
1755
|
+
const missingProps = ['rgChildren', 'rgGetKey', '_rgType', '_rgLevel',
|
|
1756
|
+
'__rgProperties', '__rgGetProperty', '__rgGetValue',
|
|
1757
|
+
'__rgGetObject'].filter(prop => !object.hasOwnProperty(prop));
|
|
1758
|
+
if(missingProps.length > 0) {
|
|
1759
|
+
const wrapped = rgWrap(object.rgObject, level ?? 0);
|
|
1760
|
+
return missingProps.reduce((acc, cur) => {
|
|
1761
|
+
acc[cur] = wrapped[cur];
|
|
1762
|
+
return acc;
|
|
1763
|
+
}, object);
|
|
1764
|
+
}
|
|
1765
|
+
return object;
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
// Tuple case
|
|
1769
|
+
if(Array.isArray(object)) {
|
|
1770
|
+
return wrapTuple(object, level ?? 0);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
// CloudObject case
|
|
1774
|
+
if(object instanceof olympe__WEBPACK_IMPORTED_MODULE_0__.CloudObject) {
|
|
1775
|
+
return wrapCloudObject(object, level ?? 0);
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
// Object case
|
|
1779
|
+
if(typeof object === 'object') {
|
|
1780
|
+
return wrapObject(object, level ?? 0);
|
|
1781
|
+
}
|
|
1782
|
+
|
|
1783
|
+
// Wrong type
|
|
1784
|
+
(0,_helpers__WEBPACK_IMPORTED_MODULE_3__.warn)('some data are not of the following type: Object, CloudObject, Array');
|
|
1785
|
+
return defaultWrap(level ?? 0);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
/**
|
|
1789
|
+
* @param {!Object} object
|
|
1790
|
+
* @param {number} level
|
|
1791
|
+
* @return {!RGWrapper}
|
|
1792
|
+
*/
|
|
1793
|
+
function wrapObject(object, level) {
|
|
1794
|
+
return {
|
|
1795
|
+
rgObject: object,
|
|
1796
|
+
rgChildren: [],
|
|
1797
|
+
rgGetKey: () => Object.values(object).join('.'),
|
|
1798
|
+
_rgType: 'object',
|
|
1799
|
+
_rgLevel: level,
|
|
1800
|
+
__rgProperties: () => Object.keys(object),
|
|
1801
|
+
__rgGetProperty: path => (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.trimPath)(path),
|
|
1802
|
+
__rgGetValue: path => (0,jsonpath_plus__WEBPACK_IMPORTED_MODULE_2__.JSONPath)({ path, json: object, wrap: false }),
|
|
1803
|
+
__rgGetObject: () => object
|
|
1804
|
+
};
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* @param {!CloudObject} object
|
|
1809
|
+
* @param {number} level
|
|
1810
|
+
* @return {!RGWrapper}
|
|
1811
|
+
*/
|
|
1812
|
+
function wrapCloudObject(object, level) {
|
|
1813
|
+
return {
|
|
1814
|
+
rgObject: object,
|
|
1815
|
+
rgChildren: [],
|
|
1816
|
+
rgGetKey: () => object.getTag(),
|
|
1817
|
+
_rgType: 'cloudobject',
|
|
1818
|
+
_rgLevel: level,
|
|
1819
|
+
__rgProperties: () => (0,_cloudobjects__WEBPACK_IMPORTED_MODULE_4__.getModelPropertiesName)(object),
|
|
1820
|
+
__rgGetProperty: path => (0,_cloudobjects__WEBPACK_IMPORTED_MODULE_4__.findObjectProperty)(object, path),
|
|
1821
|
+
__rgGetValue: path => object.get((0,_cloudobjects__WEBPACK_IMPORTED_MODULE_4__.findObjectProperty)(object, path)),
|
|
1822
|
+
__rgGetObject: () => object
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
/**
|
|
1827
|
+
* @param {!Array} object
|
|
1828
|
+
* @param {number} level
|
|
1829
|
+
* @return {!RGWrapper}
|
|
1830
|
+
*/
|
|
1831
|
+
function wrapTuple(object, level) {
|
|
1832
|
+
const wrapped = object.map(o => rgWrap(o, level + 1));
|
|
1833
|
+
return {
|
|
1834
|
+
rgObject: object,
|
|
1835
|
+
rgChildren: [],
|
|
1836
|
+
rgGetKey: () => `[${wrapped.map(w => w.rgGetKey()).join('.')}]`,
|
|
1837
|
+
_rgType: 'tuple',
|
|
1838
|
+
_rgLevel: level,
|
|
1839
|
+
__rgProperties: () => wrapped.map((w, i) => w.__rgProperties().map(p => `$[${i}].${p}`)).flat(),
|
|
1840
|
+
__rgGetProperty: path => {
|
|
1841
|
+
const [index, subPath] = splitTuplePath(path);
|
|
1842
|
+
return wrapped[index].__rgGetProperty(subPath);
|
|
1843
|
+
},
|
|
1844
|
+
__rgGetValue: path => {
|
|
1845
|
+
const [index, subPath] = splitTuplePath(path);
|
|
1846
|
+
return wrapped[index].__rgGetValue(subPath);
|
|
1847
|
+
},
|
|
1848
|
+
__rgGetObject: path => {
|
|
1849
|
+
const [index, subPath] = splitTuplePath(path);
|
|
1850
|
+
return wrapped[index].__rgGetObject(subPath);
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* @param {number=} level
|
|
1857
|
+
* @return {!RGWrapper}
|
|
1858
|
+
*/
|
|
1859
|
+
function defaultWrap(level) {
|
|
1860
|
+
return wrapObject({}, level ?? 0);
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
/**
|
|
1864
|
+
* @param {string} path
|
|
1865
|
+
* @returns {![number, string]}
|
|
1866
|
+
*/
|
|
1867
|
+
function splitTuplePath(path) {
|
|
1868
|
+
const endBracket = path.indexOf(']');
|
|
1869
|
+
const index = parseInt(path.substring(path.indexOf('[') + 1, endBracket));
|
|
1870
|
+
const subPath = (0,_helpers__WEBPACK_IMPORTED_MODULE_3__.trimPath)(path.substring(endBracket + 1));
|
|
1871
|
+
return [index, subPath];
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* @param {!BrickContext} $
|
|
1876
|
+
* @param {!Array} wrappers
|
|
1877
|
+
* @param {number} level
|
|
1878
|
+
* @return {!Array}
|
|
1879
|
+
*/
|
|
1880
|
+
function flatten($, wrappers, level) {
|
|
1881
|
+
return wrappers.flatMap(wrapper => {
|
|
1882
|
+
const isExpanded = (0,_cells__WEBPACK_IMPORTED_MODULE_5__.isChevronCellExpanded)($, wrapper);
|
|
1883
|
+
const children = isExpanded ? flatten($, wrapper.rgChildren, level + 1) : [];
|
|
1884
|
+
return [{ wrapper, level }, ...children];
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
/**
|
|
1889
|
+
* @param {!BrickContext} $
|
|
1890
|
+
* @return {!Array}
|
|
1891
|
+
*/
|
|
1892
|
+
function getFlattenWrappers($) {
|
|
1893
|
+
return flatten($, $.get('_rgWrappers'), 0);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
/***/ }),
|
|
1898
|
+
|
|
1899
|
+
/***/ "@olympeio/core":
|
|
1900
|
+
/*!*********************************!*\
|
|
1901
|
+
!*** external "@olympeio/core" ***!
|
|
1902
|
+
\*********************************/
|
|
1903
|
+
/***/ ((module) => {
|
|
1904
|
+
|
|
1905
|
+
module.exports = require("@olympeio/core");
|
|
1906
|
+
|
|
1907
|
+
/***/ }),
|
|
1908
|
+
|
|
1909
|
+
/***/ "jsonpath-plus":
|
|
1910
|
+
/*!********************************!*\
|
|
1911
|
+
!*** external "jsonpath-plus" ***!
|
|
1912
|
+
\********************************/
|
|
1913
|
+
/***/ ((module) => {
|
|
1914
|
+
|
|
1915
|
+
module.exports = require("jsonpath-plus");
|
|
1916
|
+
|
|
1917
|
+
/***/ }),
|
|
1918
|
+
|
|
1919
|
+
/***/ "react":
|
|
1920
|
+
/*!************************!*\
|
|
1921
|
+
!*** external "react" ***!
|
|
1922
|
+
\************************/
|
|
1923
|
+
/***/ ((module) => {
|
|
1924
|
+
|
|
1925
|
+
module.exports = require("react");
|
|
1926
|
+
|
|
1927
|
+
/***/ }),
|
|
1928
|
+
|
|
1929
|
+
/***/ "rxjs":
|
|
1930
|
+
/*!***********************!*\
|
|
1931
|
+
!*** external "rxjs" ***!
|
|
1932
|
+
\***********************/
|
|
1933
|
+
/***/ ((module) => {
|
|
1934
|
+
|
|
1935
|
+
module.exports = require("rxjs");
|
|
1936
|
+
|
|
1937
|
+
/***/ }),
|
|
1938
|
+
|
|
1939
|
+
/***/ "olympe":
|
|
1940
|
+
/*!*************************!*\
|
|
1941
|
+
!*** external "olympe" ***!
|
|
1942
|
+
\*************************/
|
|
1943
|
+
/***/ ((module) => {
|
|
1944
|
+
|
|
1945
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_olympe__;
|
|
1946
|
+
|
|
1947
|
+
/***/ })
|
|
1948
|
+
|
|
1949
|
+
/******/ });
|
|
1950
|
+
/************************************************************************/
|
|
1951
|
+
/******/ // The module cache
|
|
1952
|
+
/******/ var __webpack_module_cache__ = {};
|
|
1953
|
+
/******/
|
|
1954
|
+
/******/ // The require function
|
|
1955
|
+
/******/ function __webpack_require__(moduleId) {
|
|
1956
|
+
/******/ // Check if module is in cache
|
|
1957
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
1958
|
+
/******/ if (cachedModule !== undefined) {
|
|
1959
|
+
/******/ return cachedModule.exports;
|
|
1960
|
+
/******/ }
|
|
1961
|
+
/******/ // Create a new module (and put it into the cache)
|
|
1962
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
1963
|
+
/******/ // no module.id needed
|
|
1964
|
+
/******/ // no module.loaded needed
|
|
1965
|
+
/******/ exports: {}
|
|
1966
|
+
/******/ };
|
|
1967
|
+
/******/
|
|
1968
|
+
/******/ // Execute the module function
|
|
1969
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
1970
|
+
/******/
|
|
1971
|
+
/******/ // Return the exports of the module
|
|
1972
|
+
/******/ return module.exports;
|
|
1973
|
+
/******/ }
|
|
1974
|
+
/******/
|
|
1975
|
+
/************************************************************************/
|
|
1976
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
1977
|
+
/******/ (() => {
|
|
1978
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
1979
|
+
/******/ __webpack_require__.n = (module) => {
|
|
1980
|
+
/******/ var getter = module && module.__esModule ?
|
|
1981
|
+
/******/ () => (module['default']) :
|
|
1982
|
+
/******/ () => (module);
|
|
1983
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
1984
|
+
/******/ return getter;
|
|
1985
|
+
/******/ };
|
|
1986
|
+
/******/ })();
|
|
1987
|
+
/******/
|
|
1988
|
+
/******/ /* webpack/runtime/define property getters */
|
|
1989
|
+
/******/ (() => {
|
|
1990
|
+
/******/ // define getter functions for harmony exports
|
|
1991
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
1992
|
+
/******/ for(var key in definition) {
|
|
1993
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
1994
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
1995
|
+
/******/ }
|
|
1996
|
+
/******/ }
|
|
1997
|
+
/******/ };
|
|
1998
|
+
/******/ })();
|
|
1999
|
+
/******/
|
|
2000
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
2001
|
+
/******/ (() => {
|
|
2002
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2003
|
+
/******/ })();
|
|
2004
|
+
/******/
|
|
2005
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
2006
|
+
/******/ (() => {
|
|
2007
|
+
/******/ // define __esModule on exports
|
|
2008
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
2009
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
2010
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2011
|
+
/******/ }
|
|
2012
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
2013
|
+
/******/ };
|
|
2014
|
+
/******/ })();
|
|
2015
|
+
/******/
|
|
2016
|
+
/************************************************************************/
|
|
2017
|
+
var __webpack_exports__ = {};
|
|
2018
|
+
/*!**************************!*\
|
|
2019
|
+
!*** ./src/main-node.js ***!
|
|
2020
|
+
\**************************/
|
|
2021
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2022
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! olympe */ "olympe");
|
|
2023
|
+
/* harmony import */ var olympe__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(olympe__WEBPACK_IMPORTED_MODULE_0__);
|
|
2024
|
+
/* harmony import */ var _common_helpers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./common/helpers.js */ "./src/common/helpers.js");
|
|
2025
|
+
/* harmony import */ var _common_internal_box_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/internal/box.js */ "./src/common/internal/box.js");
|
|
2026
|
+
/* harmony import */ var _common_internal_cells_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common/internal/cells.js */ "./src/common/internal/cells.js");
|
|
2027
|
+
/* harmony import */ var _common_internal_changes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./common/internal/changes.js */ "./src/common/internal/changes.js");
|
|
2028
|
+
/* harmony import */ var _common_internal_cloudobjects_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./common/internal/cloudobjects.js */ "./src/common/internal/cloudobjects.js");
|
|
2029
|
+
/* harmony import */ var _common_internal_columns_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./common/internal/columns.js */ "./src/common/internal/columns.js");
|
|
2030
|
+
/* harmony import */ var _common_internal_data_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./common/internal/data.js */ "./src/common/internal/data.js");
|
|
2031
|
+
/* harmony import */ var _common_internal_helpers_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./common/internal/helpers.js */ "./src/common/internal/helpers.js");
|
|
2032
|
+
/* harmony import */ var _common_internal_rows_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./common/internal/rows.js */ "./src/common/internal/rows.js");
|
|
2033
|
+
/* harmony import */ var _common_internal_scroll_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./common/internal/scroll.js */ "./src/common/internal/scroll.js");
|
|
2034
|
+
/* harmony import */ var _common_internal_triggers_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./common/internal/triggers.js */ "./src/common/internal/triggers.js");
|
|
2035
|
+
/* harmony import */ var _common_internal_wrappers_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./common/internal/wrappers.js */ "./src/common/internal/wrappers.js");
|
|
2036
|
+
/* harmony import */ var _common_RGCreateColumnConfig_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./common/RGCreateColumnConfig.js */ "./src/common/RGCreateColumnConfig.js");
|
|
2037
|
+
/* harmony import */ var _common_RGGetChangeMetadata_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./common/RGGetChangeMetadata.js */ "./src/common/RGGetChangeMetadata.js");
|
|
2038
|
+
/* harmony import */ var _common_RGGetChangeProperties_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./common/RGGetChangeProperties.js */ "./src/common/RGGetChangeProperties.js");
|
|
2039
|
+
/* harmony import */ var _common_RGGroupTuplesByIndexes_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./common/RGGroupTuplesByIndexes.js */ "./src/common/RGGroupTuplesByIndexes.js");
|
|
2040
|
+
/* harmony import */ var _common_RGProcessChangesForCloudObjects_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./common/RGProcessChangesForCloudObjects.js */ "./src/common/RGProcessChangesForCloudObjects.js");
|
|
2041
|
+
/* harmony import */ var _common_RGProcessChangesForJSONString_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./common/RGProcessChangesForJSONString.js */ "./src/common/RGProcessChangesForJSONString.js");
|
|
2042
|
+
/* harmony import */ var _common_RGProcessChangesForObjects_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./common/RGProcessChangesForObjects.js */ "./src/common/RGProcessChangesForObjects.js");
|
|
2043
|
+
/* harmony import */ var _common_RGWrapObject_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./common/RGWrapObject.js */ "./src/common/RGWrapObject.js");
|
|
2044
|
+
|
|
2045
|
+
// Import Olympe runtime or DRAW
|
|
2046
|
+
|
|
2047
|
+
|
|
2048
|
+
// Import project bricks (we use webpack-import-glob-loader to import all bricks)
|
|
2049
|
+
|
|
2050
|
+
;
|
|
2051
|
+
|
|
2052
|
+
/******/ return __webpack_exports__;
|
|
2053
|
+
/******/ })()
|
|
2054
|
+
;
|
|
2055
|
+
});
|
|
2056
|
+
//# sourceMappingURL=main-node.js.map
|