awing-library 2.1.29 → 2.1.30

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,15 +1,4 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -46,15 +35,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
36
  }
48
37
  };
49
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
50
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
51
- if (ar || !(i in from)) {
52
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
53
- ar[i] = from[i];
54
- }
55
- }
56
- return to.concat(ar || Array.prototype.slice.call(from));
57
- };
58
38
  var __importDefault = (this && this.__importDefault) || function (mod) {
59
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
60
40
  };
@@ -98,25 +78,24 @@ var ViewContent = function (_a) {
98
78
  }
99
79
  // eslint-disable-next-line react-hooks/exhaustive-deps
100
80
  }, [viewInfoData.templateId, viewInfoData.viewDatas.length]);
101
- react_1.default.useEffect(function () {
102
- if (!isUniq.current) {
103
- console.log("uniq...");
104
- setEvent(function (prev) {
105
- return (0, lodash_1.uniqBy)(prev, function (a) {
106
- return JSON.stringify({
107
- event: a.event,
108
- viewNumber: a.viewNumber,
109
- pageId: a.pageId,
110
- });
111
- });
112
- });
113
- isUniq.current = true;
114
- }
115
- // eslint-disable-next-line react-hooks/exhaustive-deps
116
- }, [events]);
81
+ // React.useEffect(() => {
82
+ // if (!isUniq.current) {
83
+ // setEvent((prev) =>
84
+ // uniqBy(prev, (a) =>
85
+ // JSON.stringify({
86
+ // event: a.event,
87
+ // viewNumber: a.viewNumber,
88
+ // pageId: a.pageId,
89
+ // })
90
+ // )
91
+ // )
92
+ // isUniq.current = true
93
+ // }
94
+ // // eslint-disable-next-line react-hooks/exhaustive-deps
95
+ // }, [events])
117
96
  var handleResData = function (res) {
118
97
  onChange(['viewDatas'], (0, Utils_1.getTemplateDatas)(res.templateParameters, viewInfoData, pageId, viewNumber));
119
- setEvent(function (prev) { var _a; return __spreadArray(__spreadArray([], (_a = res === null || res === void 0 ? void 0 : res.templateEvents) === null || _a === void 0 ? void 0 : _a.map(function (item) { return ({ id: item.id, event: item.event, viewNumber: viewNumber + 1, pageId: pageId, protected: true }); }), true), prev, true); });
98
+ // setEvent(prev => [...res?.templateEvents?.map(item => ({ id: item.id, event: item.event, viewNumber: viewNumber+1, pageId, protected: true})), ...prev])
120
99
  isUniq.current = false;
121
100
  onChange(['templateValidation'], res.template.validation);
122
101
  onChange(['templateHandleEvent'], res.template.autoField);
@@ -176,17 +155,14 @@ var ViewContent = function (_a) {
176
155
  ? 'lgn'
177
156
  : 'wlc', "/").concat((_d = (_c = viewInfoData.viewDatas) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.pageId), enablePreview: pageCode === enums_1.PageCode.Lgn, advanceFields: (_f = (_e = viewInfoData.viewDatas) === null || _e === void 0 ? void 0 : _e.filter(function (item) { return item === null || item === void 0 ? void 0 : item.isAdvanced; })) === null || _f === void 0 ? void 0 : _f.map(function (field) { return field.fieldName; }), scriptValidate: scriptValidationTemplate, scriptAutoField: scriptAutoField, domainId: domainId, configs: CONFIGS,
178
157
  // validStatus={validStatus}
179
- validStatus: viewInfoData.validStatus, viewEvents: events === null || events === void 0 ? void 0 : events.filter(function (item) { return item.viewNumber === viewNumber + 1; }), onChange: handleOnChange, onChangeViewValid: function (status) {
158
+ validStatus: viewInfoData.validStatus,
159
+ // viewEvents={events?.filter(item => item.viewNumber === viewNumber+1)}
160
+ onChange: handleOnChange, onChangeViewValid: function (status) {
180
161
  onChange(['isValidationFields'], [status]);
181
162
  }, onChangeValidateProcess: function (processValue) {
182
163
  onChange(['validProcessStatus'], processValue);
183
164
  }, onNotifyError: function (errorMessage) {
184
165
  appHelper.snackbar('error', errorMessage);
185
- }, onUploadFile: onUploadFile, onChangeEvent: function (values) {
186
- setEvent(function (prev) {
187
- return prev.filter(function (item) { return item.viewNumber !== viewNumber + 1; }).concat(values.map(function (value) { return (__assign(__assign({}, value), { viewNumber: viewNumber + 1, pageId: pageId })); }));
188
- });
189
- isUniq.current = false;
190
- } }) }) })) })) }));
166
+ }, onUploadFile: onUploadFile }) }) })) })) }));
191
167
  };
192
168
  exports.default = ViewContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.29",
3
+ "version": "2.1.30",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",