awing-library 2.1.104-beta → 2.1.106-beta

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.
@@ -87,9 +87,15 @@ var NotificationDetail = function (props) {
87
87
  };
88
88
  }, []);
89
89
  (0, react_1.useEffect)(function () {
90
+ console.log({
91
+ count: count,
92
+ totalItemCount: totalItemCount,
93
+ notificationMessage: notificationMessage
94
+ });
90
95
  if (count >= 0 &&
91
96
  (totalItemCount.current > notificationMessage.length ||
92
97
  notificationMessage.length === 0)) {
98
+ console.log("run");
93
99
  setIsLoading(true);
94
100
  service
95
101
  .notificationsPaging(count, Constant_1.Constants.PAGE_SIZE_DEFAULT, valueFilter.textSearch, valueFilter.status, [])
@@ -73,16 +73,16 @@ var Recoil_1 = require("../Recoil");
73
73
  var Utils_1 = require("../Utils");
74
74
  var Styles_1 = require("./Styles");
75
75
  var ViewContent = function (_a) {
76
- var _b, _c, _d;
76
+ var _b, _c, _d, _e;
77
77
  var viewInfoData = _a.viewInfoData, pageId = _a.pageId, viewNumber = _a.viewNumber, onChange = _a.onChange, isCreate = _a.isCreate;
78
- var _e = (0, Context_2.default)(), service = _e.service, pageCode = _e.pageCode, domainId = _e.domainId, CONFIGS = _e.configs;
78
+ var _f = (0, Context_2.default)(), service = _f.service, pageCode = _f.pageCode, domainId = _f.domainId, CONFIGS = _f.configs;
79
79
  var appHelper = (0, Context_1.useAwing)().appHelper;
80
- var _f = react_1.default.useState(''), scriptValidationTemplate = _f[0], setScriptValidationTemplate = _f[1];
81
- var _g = react_1.default.useState(''), scriptAutoField = _g[0], setScriptAutoField = _g[1];
82
- var _h = react_1.default.useState(false), loading = _h[0], setLoading = _h[1];
80
+ var _g = react_1.default.useState(''), scriptValidationTemplate = _g[0], setScriptValidationTemplate = _g[1];
81
+ var _h = react_1.default.useState(''), scriptAutoField = _h[0], setScriptAutoField = _h[1];
82
+ var _j = react_1.default.useState(false), loading = _j[0], setLoading = _j[1];
83
83
  var isUniq = react_1.default.useRef(false);
84
84
  var rootDirectory = (0, recoil_1.useRecoilValue)(Recoil_1.pageRootDeirectory);
85
- var _j = (0, recoil_1.useRecoilState)(Recoil_1.pageEventState), events = _j[0], setEvent = _j[1];
85
+ var _k = (0, recoil_1.useRecoilState)(Recoil_1.pageEventState), events = _k[0], setEvent = _k[1];
86
86
  react_1.default.useEffect(function () {
87
87
  if (viewInfoData === null || viewInfoData === void 0 ? void 0 : viewInfoData.templateId) {
88
88
  setLoading(true);
@@ -174,9 +174,9 @@ var ViewContent = function (_a) {
174
174
  ? CONFIGS.FILE_TEMP_PATH
175
175
  : CONFIGS.FILE_STATIC_PATH, "/").concat(pageCode === enums_1.PageCode.Lgn
176
176
  ? 'lgn'
177
- : '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: viewInfoData.viewDatas.filter(function (item) { return item === null || item === void 0 ? void 0 : item.isAdvanced; }).map(function (field) { return field.fieldName; }), scriptValidate: scriptValidationTemplate, scriptAutoField: scriptAutoField, domainId: domainId, configs: CONFIGS,
177
+ : '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: (_e = viewInfoData.viewDatas) === null || _e === void 0 ? void 0 : _e.filter(function (item) { return item === null || item === void 0 ? void 0 : item.isAdvanced; }).map(function (field) { return field.fieldName; }), scriptValidate: scriptValidationTemplate, scriptAutoField: scriptAutoField, domainId: domainId, configs: CONFIGS,
178
178
  // validStatus={validStatus}
179
- validStatus: viewInfoData.validStatus, viewEvents: events.filter(function (item) { return item.viewNumber === viewNumber + 1; }), onChange: handleOnChange, onChangeViewValid: function (status) {
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) {
180
180
  onChange(['isValidationFields'], [status]);
181
181
  }, onChangeValidateProcess: function (processValue) {
182
182
  onChange(['validProcessStatus'], processValue);
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { PathType } from '../enums';
3
- type ICreateOrEditComp = React.FC<{
3
+ declare const _default: React.FC<{
4
4
  type: PathType;
5
5
  }>;
6
- declare const PageCreateOrEdit: ICreateOrEditComp;
7
- export default PageCreateOrEdit;
6
+ export default _default;
@@ -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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -54,6 +43,7 @@ var Recoil_1 = require("./Recoil");
54
43
  var Utils_1 = require("./Utils");
55
44
  var Helpers_1 = require("../../../Utils/Helpers");
56
45
  var lodash_1 = require("lodash");
46
+ var Wrapper_1 = __importDefault(require("../../../AWING/HOC/Wrapper"));
57
47
  var CreateOrEdit = function (_a) {
58
48
  var type = _a.type;
59
49
  var t = (0, react_i18next_1.useTranslation)().t;
@@ -106,7 +96,4 @@ var CreateOrEdit = function (_a) {
106
96
  };
107
97
  return ((0, jsx_runtime_1.jsx)(ClassicDrawer_1.default, { customAction: type === enums_1.PathType.EDIT ? ((0, jsx_runtime_1.jsx)(DrawerAction_1.default, { type: type })) : undefined, title: t("Page.".concat(pageCode === enums_1.PageCode.Lgn ? 'TitleLogin' : 'TitleWelcome').concat(type)), disableButtonSubmit: Object.values(formValid).includes(false), confirmExit: Object.values(pageChangedForm).includes(true), onSubmit: handleSubmit, childrenWrapperStyle: { padding: 0 }, children: type === enums_1.PathType.EDIT ? ((0, jsx_runtime_1.jsx)(PageTabView_1.default, { loading: loading })) : ((0, jsx_runtime_1.jsx)(PageStepView_1.default, {})) }));
108
98
  };
109
- var PageCreateOrEdit = function (props) {
110
- return ((0, jsx_runtime_1.jsx)(recoil_1.RecoilRoot, { children: (0, jsx_runtime_1.jsx)(CreateOrEdit, __assign({}, props)) }));
111
- };
112
- exports.default = PageCreateOrEdit;
99
+ exports.default = (0, Wrapper_1.default)(CreateOrEdit, { component: recoil_1.RecoilRoot });
@@ -133,7 +133,7 @@ var CreateOrEdit = function () {
133
133
  },
134
134
  {
135
135
  label: t('Common.File'),
136
- compoent: ((0, jsx_runtime_1.jsx)(TabFile_1.default, { rootDirectory: ((_a = (0, lodash_1.minBy)(directories, 'level')) === null || _a === void 0 ? void 0 : _a.directoryId) || '', isCreate: Boolean(templateId), pathName: '{acmTemplatePath}', service: service, pageId: templateData.template.id, pageCode: enums_1.FileTypeCode.Template })),
136
+ compoent: ((0, jsx_runtime_1.jsx)(TabFile_1.default, { rootDirectory: ((_a = (0, lodash_1.minBy)(directories, 'level')) === null || _a === void 0 ? void 0 : _a.directoryId) || '', isCreate: !templateId, pathName: '{acmTemplatePath}', service: service, pageId: templateData.template.id, pageCode: enums_1.FileTypeCode.Template })),
137
137
  },
138
138
  ];
139
139
  },
@@ -1,15 +1,38 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  var jsx_runtime_1 = require("react/jsx-runtime");
7
- var react_1 = require("react");
30
+ var react_1 = __importStar(require("react"));
8
31
  var styles_1 = require("@mui/styles");
9
32
  var material_1 = require("@mui/material");
10
33
  var Refresh_1 = __importDefault(require("@mui/icons-material/Refresh"));
11
34
  var react_i18next_1 = require("react-i18next");
12
- var debounce = require("lodash/debounce");
35
+ var lodash_1 = require("lodash");
13
36
  var useStyles = (0, styles_1.makeStyles)(function () { return ({
14
37
  root: {
15
38
  width: "100%",
@@ -20,52 +43,43 @@ var Preview = function (props) {
20
43
  var _a;
21
44
  var classes = useStyles();
22
45
  var t = (0, react_i18next_1.useTranslation)().t;
23
- var validStatus = props.validStatus, pagePath = props.pagePath, templateDatas = props.templateDatas, domainId = props.domainId, configs = props.configs, onChangeField = props.onChangeField;
46
+ var validStatus = props.validStatus, pagePath = props.pagePath, templateDatas = props.templateDatas,
47
+ // domainId,
48
+ configs = props.configs;
24
49
  var viewIndex = ((_a = templateDatas[0]) === null || _a === void 0 ? void 0 : _a.viewNumber) || -1;
50
+ var formRef = react_1.default.useRef(null);
25
51
  var iframeSrc = (0, react_1.useMemo)(function () {
26
- var result = "".concat(configs.CAPTIVE_DOMAIN, "/").concat(configs.TEMPLATE_PREVIEW, "?domainId=").concat(domainId);
52
+ var result = "".concat(configs.CAPTIVE_DOMAIN, "/").concat(configs.TEMPLATE_PREVIEW);
27
53
  if (result.startsWith("http://"))
28
54
  result = result.replace("http://", "https://");
29
55
  return result;
30
- }, [configs.CAPTIVE_DOMAIN, configs.TEMPLATE_PREVIEW, domainId]);
31
- var templatePagePath = (0, react_1.useMemo)(function () {
32
- var result = pagePath;
33
- if (pagePath.startsWith("/")) {
34
- result = result.slice(1);
35
- }
36
- return result;
37
- }, [pagePath]);
38
- var handleLoadContent = (0, react_1.useMemo)(function () {
39
- return debounce(function (tempDatas, tempPagePath, status) {
40
- var _a;
41
- if (!status)
42
- return;
43
- var iframe = document.getElementById("iframe-demo-".concat(viewIndex));
44
- var mess = JSON.stringify({
45
- pagePath: tempPagePath,
46
- templateDatas: tempDatas,
47
- });
48
- (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(mess, "*");
49
- }, 2000);
50
- },
51
- // eslint-disable-next-line react-hooks/exhaustive-deps
52
- [onChangeField]);
56
+ }, [configs.CAPTIVE_DOMAIN, configs.TEMPLATE_PREVIEW]);
53
57
  (0, react_1.useEffect)(function () {
54
- handleLoadContent(templateDatas, templatePagePath, validStatus);
55
- }, [
56
- onChangeField,
57
- handleLoadContent,
58
- validStatus,
59
- templateDatas,
60
- templatePagePath,
61
- ]);
62
- var handleRefresh = function () {
63
- var iframe = document.getElementById("iframe-demo-".concat(viewIndex));
64
- if (iframe) {
65
- iframe.src = iframeSrc;
58
+ var handleFormdata = function (_a) {
59
+ var formData = _a.formData;
60
+ formData.append('pagePath', pagePath.split('/').filter(Boolean).join('/'));
61
+ templateDatas.forEach(function (templateData, index) {
62
+ Object.keys(templateData).forEach(function (key) {
63
+ formData.append("templateDatas[".concat(index, "][").concat(key, "]"), templateData[key]);
64
+ });
65
+ });
66
+ };
67
+ if (formRef.current) {
68
+ formRef.current.addEventListener('formdata', handleFormdata);
69
+ handleSubmit();
66
70
  }
67
- handleLoadContent(templateDatas, templatePagePath, validStatus);
68
- };
71
+ return function () {
72
+ if (formRef.current)
73
+ // eslint-disable-next-line react-hooks/exhaustive-deps
74
+ formRef.current.removeEventListener('formdata', handleFormdata);
75
+ };
76
+ // eslint-disable-next-line react-hooks/exhaustive-deps
77
+ }, [viewIndex, templateDatas, pagePath]);
78
+ // eslint-disable-next-line react-hooks/exhaustive-deps
79
+ var handleSubmit = react_1.default.useCallback((0, lodash_1.debounce)(function () {
80
+ if (formRef.current)
81
+ formRef.current.submit();
82
+ }, 2000), []);
69
83
  return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { style: {
70
84
  display: "flex",
71
85
  alignItems: "center",
@@ -73,8 +87,6 @@ var Preview = function (props) {
73
87
  }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", style: {
74
88
  fontWeight: "bold",
75
89
  textTransform: "uppercase",
76
- }, children: t("ViewTemplate.PreviewTitle") }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t("Common.Refresh") || "", placement: "top", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: handleRefresh, "aria-label": "refresh", style: { float: "right" }, disabled: !validStatus, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }) })] }), (0, jsx_runtime_1.jsx)("iframe", { title: "iframe-demo-".concat(viewIndex), id: "iframe-demo-".concat(viewIndex), className: classes.root, src: iframeSrc,
77
- // src={"https://httpbin.org/post"}
78
- width: "100%" })] }));
90
+ }, children: t("ViewTemplate.PreviewTitle") }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t("Common.Refresh") || "", placement: "top", children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: function () { return formRef.current.submit(); }, "aria-label": "refresh", style: { float: "right" }, disabled: !validStatus, children: (0, jsx_runtime_1.jsx)(Refresh_1.default, {}) }) }) })] }), (0, jsx_runtime_1.jsx)("form", { action: iframeSrc, method: "post", target: "iframe-demo", ref: formRef }), (0, jsx_runtime_1.jsx)("iframe", { title: "iframe-demo-".concat(viewIndex), id: "iframe-demo", name: "iframe-demo", className: classes.root, width: "100%" })] }));
79
91
  };
80
92
  exports.default = Preview;
@@ -69,7 +69,7 @@ var BarLineComponent = function (props) {
69
69
  titleColor: '#212121',
70
70
  bodyFont: {
71
71
  size: 14,
72
- family: 'Roboto',
72
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
73
73
  lineHeight: 1.5,
74
74
  },
75
75
  },
@@ -84,7 +84,7 @@ var BarLineComponent = function (props) {
84
84
  boxPadding: 50,
85
85
  font: {
86
86
  size: 15,
87
- family: 'Roboto',
87
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
88
88
  lineHeight: 1.5,
89
89
  },
90
90
  },
@@ -119,7 +119,7 @@ var BarLineComponent = function (props) {
119
119
  title: {
120
120
  font: {
121
121
  size: 14,
122
- family: 'Roboto',
122
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
123
123
  },
124
124
  },
125
125
  },
@@ -142,7 +142,7 @@ var BarLineComponent = function (props) {
142
142
  font: {
143
143
  size: 14,
144
144
  weight: 'bold',
145
- family: 'Roboto',
145
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
146
146
  },
147
147
  },
148
148
  },
@@ -161,7 +161,7 @@ var BarLineComponent = function (props) {
161
161
  font: {
162
162
  size: 14,
163
163
  weight: 'bold',
164
- family: 'Roboto',
164
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
165
165
  },
166
166
  },
167
167
  },
@@ -38,7 +38,7 @@ var PieComponent = function (_a) {
38
38
  pointStyle: 'circle',
39
39
  font: {
40
40
  size: 14,
41
- family: 'Roboto',
41
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
42
42
  lineHeight: 1.5,
43
43
  },
44
44
  },
@@ -54,7 +54,7 @@ var PieComponent = function (_a) {
54
54
  bodySpacing: 8,
55
55
  bodyFont: {
56
56
  size: 14,
57
- family: 'Roboto',
57
+ family: "'AW-Roboto', Helvetica, Arial, sans-serif",
58
58
  lineHeight: 1.5,
59
59
  },
60
60
  callbacks: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.104-beta",
3
+ "version": "2.1.106-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",