awing-library 2.1.162-dev → 2.1.163-dev
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/lib/ACM-AXN/Campaign/CreateOrEdit/TabStatistic/Customer/component.js +5 -4
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewContent.js +1 -3
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.d.ts +1 -1
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/ViewInfo.js +19 -42
- package/lib/ACM-AXN/Page/CreateOrEdit/Tabview/index.js +6 -4
- package/lib/ACM-AXN/ViewTemplate/container.js +7 -1
- package/lib/Commons/Components/ClassicDrawer.js +0 -1
- package/package.json +1 -1
|
@@ -53,10 +53,11 @@ var Customer = function (props) {
|
|
|
53
53
|
// noBorder
|
|
54
54
|
label: t('Common.View'), callback: function (value) {
|
|
55
55
|
var _a, _b;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
Object.values(value).filter(Boolean).length > 1 &&
|
|
57
|
+
changeQueryInput('time', {
|
|
58
|
+
startDate: (0, Helpers_1.getStartOfDay)((_a = value === null || value === void 0 ? void 0 : value.startDate) === null || _a === void 0 ? void 0 : _a.toDate()),
|
|
59
|
+
endDate: (0, Helpers_1.getStartOfDay)((_b = value === null || value === void 0 ? void 0 : value.endDate) === null || _b === void 0 ? void 0 : _b.toDate()),
|
|
60
|
+
});
|
|
60
61
|
}, initialStartDate: (0, moment_1.default)(queryInput.time.startDate), initialEndDate: (0, moment_1.default)(queryInput.time.endDate), isShowCalendarInfo: true, variant: "outlined", textFieldProps: {
|
|
61
62
|
fullWidth: true,
|
|
62
63
|
sx: {
|
|
@@ -122,9 +122,7 @@ var ViewContent = function (_a) {
|
|
|
122
122
|
setScriptAutoField(res.template.autoField || '');
|
|
123
123
|
};
|
|
124
124
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
125
|
-
var setChanged =
|
|
126
|
-
onChange(['isChanged'], true);
|
|
127
|
-
}, 300), []);
|
|
125
|
+
var setChanged = function () { onChange(['isChanged'], true); };
|
|
128
126
|
var handleOnChange = function (fieldPath, templateDatasUpdated) {
|
|
129
127
|
var _a;
|
|
130
128
|
var keys = fieldPath.split('.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ITemplateType } from '../../../../ACM-AXN/Template/Types';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { ViewModel } from '../../Types';
|
|
3
|
-
import { ITemplateType } from '../../../../ACM-AXN/Template/Types';
|
|
4
4
|
interface ViewInfoProps {
|
|
5
5
|
templateTypes: ITemplateType[];
|
|
6
6
|
onChange: (keys: string[], value: unknown) => void;
|
|
@@ -10,47 +10,24 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}) : (function(o, m, k, k2) {
|
|
21
|
-
if (k2 === undefined) k2 = k;
|
|
22
|
-
o[k2] = m[k];
|
|
23
|
-
}));
|
|
24
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
-
}) : function(o, v) {
|
|
27
|
-
o["default"] = v;
|
|
28
|
-
});
|
|
29
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
-
if (mod && mod.__esModule) return mod;
|
|
31
|
-
var result = {};
|
|
32
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
-
__setModuleDefault(result, mod);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
15
|
};
|
|
39
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var react_i18next_1 = require("react-i18next");
|
|
44
|
-
var Context_1 = __importDefault(require("../../Context"));
|
|
18
|
+
var Constant_1 = require("../../../../ACM-AXN/Common/Constant");
|
|
19
|
+
var Constant_2 = require("../../../../ACM-AXN/Page/Constant");
|
|
45
20
|
var lodash_1 = require("lodash");
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var Constant_1 = require("../../../../ACM-AXN/Page/Constant");
|
|
21
|
+
var react_1 = __importDefault(require("react"));
|
|
22
|
+
var react_i18next_1 = require("react-i18next");
|
|
49
23
|
var react_router_dom_1 = require("react-router-dom");
|
|
50
24
|
var recoil_1 = require("recoil");
|
|
51
|
-
var
|
|
52
|
-
var
|
|
25
|
+
var AWING_1 = require("../../../../AWING");
|
|
26
|
+
var Context_1 = __importDefault(require("../../Context"));
|
|
27
|
+
var enums_1 = require("../../enums");
|
|
53
28
|
var ListenTemplate_1 = require("../ListenTemplate");
|
|
29
|
+
var Recoil_1 = require("../Recoil");
|
|
30
|
+
var Utils_1 = require("../Utils");
|
|
54
31
|
var ViewInfo = function (_a) {
|
|
55
32
|
var templateTypes = _a.templateTypes, onChange = _a.onChange, viewInfoData = _a.viewInfoData, viewNumber = _a.viewNumber;
|
|
56
33
|
var pageId = (0, react_router_dom_1.useParams)().pageId;
|
|
@@ -64,14 +41,6 @@ var ViewInfo = function (_a) {
|
|
|
64
41
|
var _d = react_1.default.useState([]), templates = _d[0], setTemplates = _d[1];
|
|
65
42
|
var _e = react_1.default.useState(false), loadingTemplate = _e[0], setLoadingTemplate = _e[1];
|
|
66
43
|
var defaultDirectory = react_1.default.useMemo(function () { return directories.find(function (item) { return item.parentDirectoryId === '99'; }); }, [directories]);
|
|
67
|
-
(0, react_1.useEffect)(function () {
|
|
68
|
-
var savedDirectoryId = JSON.parse(localStorage.getItem(Constant_1.PAGE_LOGIN_DIRECTORY_SELECTED) || '{}')[Array.isArray(domainId) ? 'awingPge' : domainId];
|
|
69
|
-
if (savedDirectoryId && !pageId && !isMounted) {
|
|
70
|
-
setIsMounted(true);
|
|
71
|
-
handleChangeForm({ directoryId: savedDirectoryId }, true, 'directoryId');
|
|
72
|
-
}
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
74
|
-
}, []);
|
|
75
44
|
var overWriteOnChange = function (keys, value) {
|
|
76
45
|
if (keys.includes('templateId')) {
|
|
77
46
|
setDeprecated(false);
|
|
@@ -84,7 +53,7 @@ var ViewInfo = function (_a) {
|
|
|
84
53
|
return;
|
|
85
54
|
if (['templateTypeId', 'directoryId'].includes(keyUpdate)) {
|
|
86
55
|
if (keyUpdate === 'directoryId') {
|
|
87
|
-
localStorage.setItem(
|
|
56
|
+
localStorage.setItem(Constant_2.PAGE_LOGIN_DIRECTORY_SELECTED, JSON.stringify((_a = {}, _a[Array.isArray(domainId) ? 'awingPge' : domainId] = obj[keyUpdate], _a)));
|
|
88
57
|
}
|
|
89
58
|
overWriteOnChange(['templateId'], '');
|
|
90
59
|
}
|
|
@@ -93,6 +62,14 @@ var ViewInfo = function (_a) {
|
|
|
93
62
|
},
|
|
94
63
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
95
64
|
[]);
|
|
65
|
+
react_1.default.useEffect(function () {
|
|
66
|
+
var savedDirectoryId = JSON.parse(localStorage.getItem(Constant_2.PAGE_LOGIN_DIRECTORY_SELECTED) || '{}')[Array.isArray(domainId) ? 'awingPge' : domainId];
|
|
67
|
+
if (savedDirectoryId && !pageId && !isMounted) {
|
|
68
|
+
setIsMounted(true);
|
|
69
|
+
handleChangeForm({ directoryId: savedDirectoryId }, true, 'directoryId');
|
|
70
|
+
}
|
|
71
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
+
}, []);
|
|
96
73
|
react_1.default.useEffect(function () {
|
|
97
74
|
var fieldsRequireStatus = !(0, Utils_1.getFieldsValid)(viewInfoData.viewDatas).includes(false);
|
|
98
75
|
onChange(['fieldsRequireStatus'], fieldsRequireStatus);
|
|
@@ -127,7 +104,7 @@ var ViewInfo = function (_a) {
|
|
|
127
104
|
setTemplates(res.filter(function (x) { return !x.isDeprecated; }).concat(viewDeprecate ? [viewDeprecate] : []));
|
|
128
105
|
})
|
|
129
106
|
.finally(function () { return setLoadingTemplate(false); });
|
|
130
|
-
},
|
|
107
|
+
}, Constant_1.Constants.DEBOUNCE_TIME_300), []);
|
|
131
108
|
var templateOptions = react_1.default.useMemo(function () {
|
|
132
109
|
var result = [];
|
|
133
110
|
if (viewInfoData.templateTypeId) {
|
|
@@ -119,21 +119,23 @@ var TabView = function (_a) {
|
|
|
119
119
|
}));
|
|
120
120
|
};
|
|
121
121
|
var onChange = function (keys, value) {
|
|
122
|
+
// console.log("keys", keys, "value", value, views, activeViewIndex)
|
|
122
123
|
if (keys.includes('activeViewIndex')) {
|
|
123
124
|
setActiveViewIndex(Number(value));
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
|
-
setView((0, immer_1.produce)(function (
|
|
127
|
-
(
|
|
127
|
+
setView((0, immer_1.produce)(function (draft) {
|
|
128
|
+
if (draft.views.length < Number(keys[1] || 0) + 1)
|
|
129
|
+
return;
|
|
130
|
+
(0, Helpers_1.setObject)(draft, keys, value);
|
|
128
131
|
}));
|
|
129
132
|
};
|
|
130
133
|
var handleChange = function (key) {
|
|
131
134
|
if (key === void 0) { key = []; }
|
|
132
135
|
return (0, Utils_1.composeKey)(onChange, (0, Utils_1.concatKey)(key));
|
|
133
136
|
};
|
|
134
|
-
var handleChangeView = react_1.default.useMemo(function () { return handleChange(['views', String(activeViewIndex)]); },
|
|
135
137
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
-
[activeViewIndex]);
|
|
138
|
+
var handleChangeView = react_1.default.useMemo(function () { return handleChange(['views', String(activeViewIndex)]); }, [activeViewIndex]);
|
|
137
139
|
return ((0, jsx_runtime_1.jsx)(ViewList_1.default, { isDisableTabHeader: false, activeViewIndex: activeViewIndex, viewCount: views.length, onChangeView: handleChange(), addView: addPageView, deleteView: deletePageView, children: (0, jsx_runtime_1.jsx)(Panel_1.default, { value: activeViewIndex, index: activeViewIndex, children: views.map(function (view, index) { return ((0, jsx_runtime_1.jsx)(react_1.Fragment, { children: activeViewIndex === index && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ViewInfo_1.default, { onChange: handleChangeView, templateTypes: templateTypes, viewInfoData: view, viewNumber: index + 1 }), (0, jsx_runtime_1.jsx)(ViewContent_1.default, { viewInfoData: view, pageId: page.pageId, viewNumber: index, onChange: handleChangeView, isCreate: Boolean(isCreate) })] })) }, index)); }) }) }));
|
|
138
140
|
};
|
|
139
141
|
exports.default = TabView;
|
|
@@ -93,7 +93,13 @@ function ViewTemplate(_a) {
|
|
|
93
93
|
cursor: "pointer",
|
|
94
94
|
}, onClick: function () {
|
|
95
95
|
setAdvanceOptionExpand(!advanceOptionExpand);
|
|
96
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { style: { fontWeight: "bold" }, children: t("ViewTemplate.AdvanceOption") }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: advanceOptionExpand ? ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {})) : ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {})) })] }),
|
|
96
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { style: { fontWeight: "bold" }, children: t("ViewTemplate.AdvanceOption") }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { children: advanceOptionExpand ? ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {})) : ((0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {})) })] }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, sx: {
|
|
97
|
+
transition: "all 3s",
|
|
98
|
+
}, style: advanceOptionExpand ? {
|
|
99
|
+
display: "block",
|
|
100
|
+
} : {
|
|
101
|
+
display: "none",
|
|
102
|
+
}, children: [fields && advanceFields.length > 0 && renderFields(fields, true), (0, jsx_runtime_1.jsx)(Event_1.default, __assign({}, props))] })] })] }), enablePreview && ((0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: 4, children: [(0, jsx_runtime_1.jsx)(Preview_1.default, { domainId: domainId || "", validStatus: validStatus, configs: CONFIGS, pagePath: pagePath, templateDatas: templateDatas }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: t("ViewTemplate.PreviewLoadingNote") })] }))] }));
|
|
97
103
|
}
|
|
98
104
|
exports.default = ViewTemplate;
|
|
99
105
|
var getChilds = function (fields, fieldInfo) {
|