@lingk/sync 1.1.49 → 1.1.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,303 +0,0 @@
1
- module.exports =
2
- /******/ (function(modules) { // webpackBootstrap
3
- /******/ // The module cache
4
- /******/ var installedModules = {};
5
- /******/
6
- /******/ // The require function
7
- /******/ function __webpack_require__(moduleId) {
8
- /******/
9
- /******/ // Check if module is in cache
10
- /******/ if(installedModules[moduleId])
11
- /******/ return installedModules[moduleId].exports;
12
- /******/
13
- /******/ // Create a new module (and put it into the cache)
14
- /******/ var module = installedModules[moduleId] = {
15
- /******/ exports: {},
16
- /******/ id: moduleId,
17
- /******/ loaded: false
18
- /******/ };
19
- /******/
20
- /******/ // Execute the module function
21
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
22
- /******/
23
- /******/ // Flag the module as loaded
24
- /******/ module.loaded = true;
25
- /******/
26
- /******/ // Return the exports of the module
27
- /******/ return module.exports;
28
- /******/ }
29
- /******/
30
- /******/
31
- /******/ // expose the modules object (__webpack_modules__)
32
- /******/ __webpack_require__.m = modules;
33
- /******/
34
- /******/ // expose the module cache
35
- /******/ __webpack_require__.c = installedModules;
36
- /******/
37
- /******/ // __webpack_public_path__
38
- /******/ __webpack_require__.p = "";
39
- /******/
40
- /******/ // Load entry module and return exports
41
- /******/ return __webpack_require__(0);
42
- /******/ })
43
- /************************************************************************/
44
- /******/ ({
45
-
46
- /***/ 0:
47
- /***/ function(module, exports, __webpack_require__) {
48
-
49
- module.exports = __webpack_require__(28);
50
-
51
-
52
- /***/ },
53
-
54
- /***/ 1:
55
- /***/ function(module, exports) {
56
-
57
- module.exports = require("react");
58
-
59
- /***/ },
60
-
61
- /***/ 28:
62
- /***/ function(module, exports, __webpack_require__) {
63
-
64
- 'use strict';
65
-
66
- Object.defineProperty(exports, "__esModule", {
67
- value: true
68
- });
69
-
70
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
71
-
72
- var _react = __webpack_require__(1);
73
-
74
- var _react2 = _interopRequireDefault(_react);
75
-
76
- var _nestExpand = __webpack_require__(53);
77
-
78
- var _nestExpand2 = _interopRequireDefault(_nestExpand);
79
-
80
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81
-
82
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
83
-
84
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
85
-
86
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
87
-
88
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
89
-
90
- var SelectWrapper = function (_Component) {
91
- _inherits(SelectWrapper, _Component);
92
-
93
- function SelectWrapper() {
94
- _classCallCheck(this, SelectWrapper);
95
-
96
- var _this = _possibleConstructorReturn(this, (SelectWrapper.__proto__ || Object.getPrototypeOf(SelectWrapper)).call(this));
97
-
98
- _this.state = {
99
- expanded: {},
100
- searchTerms: {} // {sectionname: searchterm}
101
- };
102
- _this.expand = _this.expand.bind(_this);
103
- _this.changeSearchTerm = _this.changeSearchTerm.bind(_this);
104
- return _this;
105
- }
106
-
107
- _createClass(SelectWrapper, [{
108
- key: 'expand',
109
- value: function expand(v, parents) {
110
- this.setState({ expanded: _nestExpand2.default.expand(v, parents, this.state.expanded) });
111
- }
112
- }, {
113
- key: 'changeSearchTerm',
114
- value: function changeSearchTerm(v, section) {
115
- var searchTerms = Object.assign({}, this.state.searchTerms);
116
- searchTerms[section] = v;
117
- this.setState({ searchTerms: searchTerms });
118
- }
119
- }, {
120
- key: 'render',
121
- value: function render() {
122
- var _props = this.props,
123
- values = _props.values,
124
- inputs = _props.inputs,
125
- selectedValues = _props.selectedValues,
126
- sectionLabels = _props.sectionLabels,
127
- sectionTypes = _props.sectionTypes,
128
- fieldPropLabel = _props.fieldPropLabel,
129
- fieldPropType = _props.fieldPropType,
130
- showApiNames = _props.showApiNames;
131
- var searchTerms = this.state.searchTerms;
132
-
133
- var iterator = function (sectionValues, entity, sectionLabel, iteration, parents, newParent, sectionType) {
134
- if (newParent) {
135
- parents = parents.concat(newParent);
136
- }
137
-
138
- var title = '';
139
- parents && parents.forEach(function (pt) {
140
- title += pt;
141
- title += ': ';
142
- });
143
- // CHOOSE HERE TYPE OR LABEL
144
- title += entity[showApiNames && fieldPropType ? fieldPropType : fieldPropLabel];
145
-
146
- // ADD REQUIRED
147
- if (entity.required) {
148
- title += ' *';
149
- }
150
-
151
- var isExpanded = _nestExpand2.default.checkIfExpanded(entity[fieldPropLabel], parents, this.state.expanded);
152
- var isSelected = false;
153
- isSelected = selectedValues && selectedValues.length > 0 && selectedValues.some(function (rsc) {
154
- return rsc[fieldPropLabel] === entity[fieldPropLabel] && (!(parents && rsc.parents) || JSON.stringify(rsc.parents) === JSON.stringify(parents)) && (!rsc.section || sectionLabel === rsc.section);
155
- });
156
-
157
- sectionValues.push(Object.assign({}, entity, {
158
- title: title,
159
- section: sectionLabel,
160
- __section: sectionType,
161
- iteration: iteration,
162
- parents: parents,
163
- isExpanded: isExpanded,
164
- isSelected: isSelected
165
- }));
166
-
167
- if (entity.object && isExpanded) {
168
- entity.object.properties.forEach(function (p) {
169
- iterator(sectionValues, p, sectionLabel, iteration + 1, parents, entity[fieldPropLabel], sectionType);
170
- });
171
- }
172
- return sectionValues;
173
- }.bind(this);
174
-
175
- var vals = values && [].concat(_toConsumableArray(values));
176
-
177
- if (sectionLabels) {
178
- var v = [];
179
- sectionLabels.forEach(function (s, i) {
180
- if (values && values[i] && values[i].length > 0) {
181
- // ADD TITLE OF SECTION HERE
182
- v = v.concat(showApiNames && sectionTypes ? sectionTypes[i] : sectionLabels[i]);
183
- var sectionValues = [];
184
- values[i].forEach(function (entity) {
185
- var sectionType = sectionTypes && sectionTypes[i];
186
- iterator(sectionValues, entity, sectionLabels[i], 0, [], null, sectionType);
187
- });
188
- //search
189
- sectionValues.forEach(function (sv, ii) {
190
- var satisfiesSearch = true; // default show everything
191
- if (searchTerms && searchTerms[sectionLabels[i]]) {
192
- satisfiesSearch = sv[showApiNames ? fieldPropType : fieldPropLabel].toLowerCase().indexOf(searchTerms[sectionLabels[i]].toLowerCase()) > -1;
193
- }
194
- sv.satisfiesSearch = satisfiesSearch;
195
- //satisfy parents
196
- if (searchTerms && satisfiesSearch) {
197
- // for nested resources (parentRef)
198
- if (sv.parentRef) {
199
- sv.parentRef.forEach(function (pr) {
200
- var parentString = pr.ref.split('/')[2];
201
- var parent = sectionValues.find(function (p) {
202
- return parentString === p[fieldPropLabel];
203
- });
204
- if (parent) {
205
- parent.satisfiesSearch = true;
206
- }
207
- });
208
- }
209
- // for nested props (parents array)
210
- if (sv.parents) {
211
- sv.parents.forEach(function (pr) {
212
- var parent = sectionValues.find(function (p) {
213
- return pr === p[fieldPropLabel];
214
- });
215
- if (parent) {
216
- parent.satisfiesSearch = true;
217
- }
218
- });
219
- }
220
- }
221
- });
222
- v = v.concat(sectionValues);
223
- }
224
- });
225
- vals = v;
226
- } else {
227
- var sectionValues = [];
228
- values && values.forEach(function (entity) {
229
- iterator(sectionValues, entity, '', 0, []);
230
- });
231
- sectionValues.forEach(function (sv) {
232
- sv.satisfiesSearch = true; // no sections = no search
233
- });
234
- vals = sectionValues;
235
- }
236
-
237
- return _react2.default.createElement(
238
- 'div',
239
- { style: { display: 'inline-block' } },
240
- _react2.default.createElement(inputs.Select, Object.assign({}, this.props, { vals: vals, expand: this.expand,
241
- changeSearchTerm: this.changeSearchTerm }))
242
- );
243
- }
244
- }]);
245
-
246
- return SelectWrapper;
247
- }(_react.Component);
248
-
249
- exports.default = SelectWrapper;
250
-
251
- /***/ },
252
-
253
- /***/ 53:
254
- /***/ function(module, exports) {
255
-
256
- "use strict";
257
-
258
- Object.defineProperty(exports, "__esModule", {
259
- value: true
260
- });
261
-
262
- var nest = {
263
-
264
- expand: function expand(v, parents, expandedProp) {
265
- var expanded = Object.assign({}, expandedProp);
266
- if (parents.length === 0) {
267
- if (expanded[v]) delete expanded[v];else expanded[v] = {};
268
- } else if (parents.length === 1) {
269
- if (expanded[parents[0]][v]) delete expanded[parents[0]][v];else expanded[parents[0]][v] = {};
270
- } else if (parents.length === 2) {
271
- if (expanded[parents[0]][parents[1]][v]) delete expanded[parents[0]][parents[1]][v];else expanded[parents[0]][parents[1]][v] = {};
272
- } else if (parents.length === 3) {
273
- if (expanded[parents[0]][parents[1]][parents[2]][v]) delete expanded[parents[0]][parents[1]][parents[2]][v];else expanded[parents[0]][parents[1]][parents[2]][v] = {};
274
- } else if (parents.length === 4) {
275
- if (expanded[parents[0]][parents[1]][parents[2]][parents[3]][v]) delete expanded[parents[0]][parents[1]][parents[2]][parents[3]][v];else expanded[parents[0]][parents[1]][parents[2]][parents[3]][v] = {};
276
- }
277
- return expanded;
278
- },
279
-
280
- checkIfExpanded: function checkIfExpanded(v, parents, expandedProp) {
281
- var expanded = Object.assign({}, expandedProp);
282
- if (parents.length === 0) {
283
- if (expanded[v]) return true;
284
- } else if (parents.length === 1) {
285
- if (expanded[parents[0]][v]) return true;
286
- } else if (parents.length === 2) {
287
- if (expanded[parents[0]][parents[1]][v]) return true;
288
- } else if (parents.length === 3) {
289
- if (expanded[parents[0]][parents[1]][parents[2]][v]) return true;
290
- } else if (parents.length === 4) {
291
- if (expanded[parents[0]][parents[1]][parents[2]][parents[3]][v]) return true;
292
- }
293
- return false;
294
- }
295
-
296
- };
297
-
298
- exports.default = nest;
299
-
300
- /***/ }
301
-
302
- /******/ });
303
- //# sourceMappingURL=metadataDropdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap 98069d81b39d41c0199b?b070****","webpack:///external \"react\"?3c62***","webpack:///./src/lib/wizard/stepTypes/utils/selectWrapper.js?f5b9","webpack:///./src/lib/wizard/stepTypes/utils/nestExpand.js?c1ed"],"names":["SelectWrapper","state","expanded","searchTerms","expand","bind","changeSearchTerm","v","parents","setState","nest","section","props","values","inputs","selectedValues","sectionLabels","sectionTypes","fieldPropLabel","fieldPropType","showApiNames","iterator","sectionValues","entity","sectionLabel","iteration","newParent","sectionType","concat","title","forEach","pt","required","isExpanded","checkIfExpanded","isSelected","length","some","rsc","JSON","stringify","push","__section","object","properties","p","vals","s","i","sv","ii","satisfiesSearch","toLowerCase","indexOf","parentRef","pr","parentString","ref","split","parent","find","display","Component","expandedProp"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;ACtCA,mC;;;;;;;;;;;;;;;ACAA;;;;AACA;;;;;;;;;;;;;;KAEMA,a;;;AAEJ,4BAAa;AAAA;;AAAA;;AAEX,WAAKC,KAAL,GAAW;AACTC,iBAAS,EADA;AAETC,oBAAY,EAFH,CAEM;AAFN,MAAX;AAIA,WAAKC,MAAL,GAAc,MAAKA,MAAL,CAAYC,IAAZ,OAAd;AACA,WAAKC,gBAAL,GAAwB,MAAKA,gBAAL,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C,EAAyDD,CAAzD,CAAH,EAAgE,OAAO,IAAP;AACjE;AACD,YAAO,KAAP;AACD;;AA1CU,EAAb;;mBA+CeG,I","file":"metadataDropdown.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 98069d81b39d41c0199b","module.exports = require(\"react\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 1\n// module chunks = 0 1 2 3 4","import React, {Component} from 'react';\nimport nest from './nestExpand'\n\nclass SelectWrapper extends Component {\n\n constructor(){\n super()\n this.state={\n expanded:{},\n searchTerms:{} // {sectionname: searchterm}\n }\n this.expand = this.expand.bind(this)\n this.changeSearchTerm = this.changeSearchTerm.bind(this)\n }\n\n expand(v, parents){\n this.setState({expanded: nest.expand(v, parents, this.state.expanded)})\n }\n\n changeSearchTerm(v, section){\n const searchTerms = {...this.state.searchTerms}\n searchTerms[section] = v\n this.setState({searchTerms})\n }\n\n render(){\n const { values, inputs, selectedValues, sectionLabels, sectionTypes, fieldPropLabel, fieldPropType, showApiNames } = this.props\n\n const {searchTerms} = this.state\n const iterator = function(sectionValues, entity, sectionLabel, iteration, parents, newParent, sectionType){\n if(newParent){\n parents = parents.concat(newParent)\n }\n\n let title = ''\n parents && parents.forEach(pt=>{\n title += pt\n title += ': '\n })\n // CHOOSE HERE TYPE OR LABEL\n title += entity[showApiNames&&fieldPropType ? fieldPropType : fieldPropLabel]\n\n // ADD REQUIRED\n if(entity.required){\n title += ' *'\n }\n\n const isExpanded = nest.checkIfExpanded(entity[fieldPropLabel], parents, this.state.expanded)\n let isSelected = false\n isSelected = selectedValues && selectedValues.length>0 && selectedValues\n .some(rsc=>{\n return rsc[fieldPropLabel]===entity[fieldPropLabel] &&\n (!(parents&&rsc.parents)||JSON.stringify(rsc.parents)===JSON.stringify(parents)) &&\n (!rsc.section||sectionLabel===rsc.section)\n })\n\n sectionValues.push({\n ...entity,\n title,\n section: sectionLabel,\n __section: sectionType,\n iteration,\n parents,\n isExpanded,\n isSelected,\n })\n\n if(entity.object && isExpanded){\n entity.object.properties.forEach(p=>{\n iterator(sectionValues, p, sectionLabel, iteration+1, parents, entity[fieldPropLabel], sectionType)\n })\n }\n return sectionValues\n }.bind(this)\n\n var vals = values && [ ...values ]\n\n if(sectionLabels){\n var v = []\n sectionLabels.forEach((s,i)=>{\n if(values && values[i] && values[i].length>0){\n // ADD TITLE OF SECTION HERE\n v = v.concat(showApiNames&&sectionTypes ? sectionTypes[i] : sectionLabels[i])\n let sectionValues = []\n values[i].forEach(entity=>{\n const sectionType = sectionTypes && sectionTypes[i]\n iterator(sectionValues, entity, sectionLabels[i], 0, [], null, sectionType)\n })\n //search\n sectionValues.forEach((sv,ii)=>{\n let satisfiesSearch = true // default show everything\n if(searchTerms && searchTerms[sectionLabels[i]]){\n satisfiesSearch = sv[showApiNames ? fieldPropType : fieldPropLabel]\n .toLowerCase().indexOf(searchTerms[sectionLabels[i]].toLowerCase()) \n > -1\n }\n sv.satisfiesSearch = satisfiesSearch\n //satisfy parents\n if(searchTerms && satisfiesSearch){\n // for nested resources (parentRef)\n if(sv.parentRef){\n sv.parentRef.forEach((pr)=>{\n const parentString = pr.ref.split('/')[2]\n const parent = sectionValues.find((p)=>{\n return parentString === p[fieldPropLabel]\n })\n if(parent){\n parent.satisfiesSearch = true\n }\n })\n }\n // for nested props (parents array)\n if(sv.parents){\n sv.parents.forEach((pr)=>{\n const parent = sectionValues.find((p)=>{\n return pr === p[fieldPropLabel]\n })\n if(parent){\n parent.satisfiesSearch = true\n }\n })\n }\n }\n })\n v = v.concat(sectionValues)\n }\n })\n vals = v\n } else {\n let sectionValues = []\n values && values.forEach(entity=>{\n iterator(sectionValues, entity, '', 0, [])\n })\n sectionValues.forEach((sv)=>{\n sv.satisfiesSearch = true // no sections = no search\n })\n vals = sectionValues\n }\n\n return (\n <div style={{display:'inline-block'}}> \n <inputs.Select {...this.props} vals={vals} expand={this.expand} \n changeSearchTerm={this.changeSearchTerm} />\n </div>\n ) \n }\n}\n\nexport default SelectWrapper\n\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/lib/wizard/stepTypes/utils/selectWrapper.js","\nconst nest = {\n\n expand: function(v, parents, expandedProp){\n let expanded = {...expandedProp}\n if(parents.length===0){\n if(expanded[v]) \n delete expanded[v]\n else expanded[v] = {}\n } else if(parents.length===1){\n if(expanded[parents[0]][v]) \n delete expanded[parents[0]][v]\n else expanded[parents[0]][v]={}\n } else if(parents.length===2){\n if(expanded[parents[0]][parents[1]][v]) \n delete expanded[parents[0]][parents[1]][v]\n else expanded[parents[0]][parents[1]][v]={}\n } else if(parents.length===3){\n if(expanded[parents[0]][parents[1]][parents[2]][v]) \n delete expanded[parents[0]][parents[1]][parents[2]][v]\n else expanded[parents[0]][parents[1]][parents[2]][v]={}\n } else if(parents.length===4){\n if(expanded[parents[0]][parents[1]][parents[2]][parents[3]][v])\n delete expanded[parents[0]][parents[1]][parents[2]][parents[3]][v]\n else expanded[parents[0]][parents[1]][parents[2]][parents[3]][v]={}\n } \n return(expanded)\n },\n\n checkIfExpanded: function(v,parents,expandedProp){\n let expanded = {...expandedProp}\n if(parents.length===0){\n if(expanded[v]) return true\n } else if(parents.length===1){\n if(expanded[parents[0]][v]) return true\n } else if(parents.length===2){\n if(expanded[parents[0]][parents[1]][v]) return true\n } else if(parents.length===3){\n if(expanded[parents[0]][parents[1]][parents[2]][v]) return true\n } else if(parents.length===4){\n if(expanded[parents[0]][parents[1]][parents[2]][parents[3]][v]) return true\n } \n return false\n }\n\n}\n\n\nexport default nest\n\n\n\n\n// WEBPACK FOOTER //\n// ./src/lib/wizard/stepTypes/utils/nestExpand.js"],"sourceRoot":""}