awing-library 2.1.23 → 2.1.24

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.
@@ -37,7 +37,6 @@ var react_1 = require("react");
37
37
  var react_i18next_1 = require("react-i18next");
38
38
  var i18n_1 = __importDefault(require("../../i18n"));
39
39
  var Form_1 = require("../../AWING/Form");
40
- var Event_1 = __importDefault(require("./TemplateField/Event"));
41
40
  function ViewTemplate(_a) {
42
41
  var _b = _a.templateDatas, templateDatas = _b === void 0 ? [] : _b, pagePath = _a.pagePath, _c = _a.enablePreview, enablePreview = _c === void 0 ? true : _c, _d = _a.advanceFields, advanceFields = _d === void 0 ? [] : _d, _e = _a.templateLabelName, templateLabelName = _e === void 0 ? "" : _e, _f = _a.domainId, domainId = _f === void 0 ? "" : _f, _g = _a.validStatus, validStatus = _g === void 0 ? true : _g, _h = _a.scriptAutoField, scriptAutoField = _h === void 0 ? "" : _h, _j = _a.scriptValidate, scriptValidate = _j === void 0 ? "" : _j, configs = _a.configs, onChange = _a.onChange, _k = _a.onChangeViewValid, onChangeViewValid = _k === void 0 ? function (status) {
43
42
  console.log(status);
@@ -89,7 +88,7 @@ function ViewTemplate(_a) {
89
88
  return ((0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 4, children: [(0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, xs: enablePreview ? 8 : 12, children: [templateLabelName && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", style: {
90
89
  fontWeight: "bold",
91
90
  textTransform: "uppercase",
92
- }, children: templateLabelName })), fields && renderFields(fields, false), (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { id: "advance-option", style: {
91
+ }, children: templateLabelName })), fields && renderFields(fields, false), fields && advanceFields.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { id: "advance-option", style: {
93
92
  display: "flex",
94
93
  flexDirection: "row",
95
94
  justifyContent: "space-between",
@@ -97,7 +96,7 @@ function ViewTemplate(_a) {
97
96
  cursor: "pointer",
98
97
  }, onClick: function () {
99
98
  setAdvanceOptionExpand(!advanceOptionExpand);
100
- }, 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, {})) })] }), advanceOptionExpand && ((0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, 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") })] }))] }));
99
+ }, 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, {})) })] }), advanceOptionExpand && ((0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, children: renderFields(fields, true) }))] }))] }), 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") })] }))] }));
101
100
  }
102
101
  exports.default = ViewTemplate;
103
102
  var getChilds = function (fields, fieldInfo) {
@@ -49,7 +49,7 @@ export interface FieldProps {
49
49
  onNotifyError: (errorMessage: string) => void;
50
50
  onUploadFile: (files: any[]) => Promise<string>;
51
51
  }
52
- export interface ViewTemplateProps extends EventsProps {
52
+ export interface ViewTemplateProps extends Partial<EventsProps> {
53
53
  templateDatas: FieldInfo[];
54
54
  /**
55
55
  * Đường dẫn tuyệt đối các file của page
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.23",
3
+ "version": "2.1.24",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",