@pisell/private-materials 3.0.156 → 3.0.157

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.
Files changed (37) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +5 -5
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/forms/model.d.ts +1 -2
  13. package/es/components/booking/notes/index.d.ts +1 -1
  14. package/es/components/booking/notes/model.d.ts +1 -2
  15. package/es/components/booking/payments/model.d.ts +1 -2
  16. package/es/components/schedules/index.d.ts +1 -1
  17. package/es/components/schedules/model.d.ts +1 -2
  18. package/es/components/schedules/resources/add/index.js +9 -9
  19. package/es/components/schedules/resources/edit/index.d.ts +4 -0
  20. package/es/components/schedules/resources/edit/index.js +116 -0
  21. package/es/components/schedules/resources/edit/index.less +19 -0
  22. package/es/components/schedules/resources/index.d.ts +2 -2
  23. package/es/components/schedules/resources/index.js +24 -16
  24. package/lib/components/booking/addons/model.d.ts +1 -2
  25. package/lib/components/booking/forms/model.d.ts +1 -2
  26. package/lib/components/booking/notes/index.d.ts +1 -1
  27. package/lib/components/booking/notes/model.d.ts +1 -2
  28. package/lib/components/booking/payments/model.d.ts +1 -2
  29. package/lib/components/schedules/index.d.ts +1 -1
  30. package/lib/components/schedules/model.d.ts +1 -2
  31. package/lib/components/schedules/resources/add/index.js +7 -7
  32. package/lib/components/schedules/resources/edit/index.d.ts +4 -0
  33. package/lib/components/schedules/resources/edit/index.js +132 -0
  34. package/lib/components/schedules/resources/edit/index.less +19 -0
  35. package/lib/components/schedules/resources/index.d.ts +2 -2
  36. package/lib/components/schedules/resources/index.js +7 -4
  37. package/package.json +3 -3
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: any;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
@@ -4,17 +4,17 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
4
4
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
5
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import { Modal } from "antd";
8
- import { forwardRef, useImperativeHandle, useRef, useState } from "react";
7
+ import { Modal } from 'antd';
8
+ import { forwardRef, useImperativeHandle, useRef, useState } from 'react';
9
9
  import useComponents from "../../../../hooks/useComponents";
10
10
  var ResourcesAdd = function ResourcesAdd(_ref, refs) {
11
11
  var onSuccess = _ref.onSuccess;
12
- var fromDataNewRef = useRef();
12
+ var formDataNewRef = useRef();
13
13
  var _useComponents = useComponents({
14
- components: ["FromDataNew"]
14
+ components: ['FormDataNew']
15
15
  }),
16
16
  _useComponents2 = _slicedToArray(_useComponents, 1),
17
- FromDataNew = _useComponents2[0];
17
+ FormDataNew = _useComponents2[0];
18
18
  var _useState = useState(false),
19
19
  _useState2 = _slicedToArray(_useState, 2),
20
20
  open = _useState2[0],
@@ -38,8 +38,8 @@ var ResourcesAdd = function ResourcesAdd(_ref, refs) {
38
38
  };
39
39
  });
40
40
  var onSubmit = function onSubmit() {
41
- var _fromDataNewRef$curre;
42
- (_fromDataNewRef$curre = fromDataNewRef.current) === null || _fromDataNewRef$curre === void 0 ? void 0 : _fromDataNewRef$curre.submit();
41
+ var _formDataNewRef$curre;
42
+ (_formDataNewRef$curre = formDataNewRef.current) === null || _formDataNewRef$curre === void 0 ? void 0 : _formDataNewRef$curre.submit();
43
43
  };
44
44
  return /*#__PURE__*/React.createElement(Modal, {
45
45
  open: open,
@@ -47,9 +47,9 @@ var ResourcesAdd = function ResourcesAdd(_ref, refs) {
47
47
  onCancel: onClose,
48
48
  onOk: onSubmit,
49
49
  destroyOnClose: true
50
- }, FromDataNew && /*#__PURE__*/React.createElement(FromDataNew, {
50
+ }, FormDataNew && /*#__PURE__*/React.createElement(FormDataNew, {
51
51
  formId: formId,
52
- ref: fromDataNewRef,
52
+ ref: formDataNewRef,
53
53
  formChange: function formChange(isSuccess, params) {
54
54
  if (isSuccess) {
55
55
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(params);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
+ export default _default;
@@ -0,0 +1,116 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
8
+ import { Button } from 'antd';
9
+ import Drawer from "../../../booking/components/drawer";
10
+ import useComponents from "../../../../hooks/useComponents";
11
+ import { locales } from '@pisell/utils';
12
+ import "./index.less";
13
+
14
+ // 过滤白名单
15
+ // ● Schedule / 日程计划 (2.0版)
16
+ // ● Max participants / 最大参与人数
17
+ // ● Products / 关联商品
18
+ // ● Capacity / 容量(本次新增的form组件)
19
+ // ● Services / 关联服务(本次新增的form组件)
20
+
21
+ var filterList = ['schedule', 'max_participants', 'partyroom_package', 'products', 'capacity'];
22
+ var ResourcesDetail = function ResourcesDetail(_ref, refs) {
23
+ var onSuccess = _ref.onSuccess;
24
+ var formDataEditRef = useRef();
25
+ var _useComponents = useComponents({
26
+ components: ['FormDataEdit']
27
+ }),
28
+ _useComponents2 = _slicedToArray(_useComponents, 1),
29
+ FormDataEdit = _useComponents2[0];
30
+ var _useState = useState(false),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ open = _useState2[0],
33
+ setOpen = _useState2[1];
34
+ var _useState3 = useState({}),
35
+ _useState4 = _slicedToArray(_useState3, 2),
36
+ currentResource = _useState4[0],
37
+ setCurrentResource = _useState4[1];
38
+ var _useState5 = useState(0),
39
+ _useState6 = _slicedToArray(_useState5, 2),
40
+ formId = _useState6[0],
41
+ setFormId = _useState6[1];
42
+ var _useState7 = useState(0),
43
+ _useState8 = _slicedToArray(_useState7, 2),
44
+ formRecordId = _useState8[0],
45
+ setFormRecordId = _useState8[1];
46
+ var _onClose = function onClose() {
47
+ setOpen(false);
48
+ };
49
+ var onOpen = function onOpen() {
50
+ setOpen(true);
51
+ };
52
+ useImperativeHandle(refs, function () {
53
+ return {
54
+ open: function open(item) {
55
+ onOpen();
56
+ setCurrentResource(item);
57
+ setFormId(item.form_id);
58
+ setFormRecordId(item.id);
59
+ }
60
+ };
61
+ });
62
+ var onSubmit = function onSubmit() {
63
+ var _formDataEditRef$curr;
64
+ console.log('formDataEditRef', formDataEditRef);
65
+ (_formDataEditRef$curr = formDataEditRef.current) === null || _formDataEditRef$curr === void 0 ? void 0 : _formDataEditRef$curr.submit();
66
+ };
67
+ useEffect(function () {
68
+ console.log('formDataEditRef?.current', formDataEditRef === null || formDataEditRef === void 0 ? void 0 : formDataEditRef.current);
69
+ }, [formDataEditRef === null || formDataEditRef === void 0 ? void 0 : formDataEditRef.current]);
70
+ return /*#__PURE__*/React.createElement(Drawer, {
71
+ width: "100%",
72
+ placement: "right",
73
+ open: open,
74
+ getContainer: document.querySelector('.pisell-lowcode__schedules-component-resources') || document.body,
75
+ titleNoWrap: true,
76
+ headerStyle: {
77
+ display: 'none'
78
+ },
79
+ onClose: function onClose() {
80
+ _onClose(false);
81
+ },
82
+ bodyStyle: {
83
+ padding: 0
84
+ },
85
+ title: currentResource === null || currentResource === void 0 ? void 0 : currentResource.title,
86
+ rootStyle: {
87
+ position: 'absolute'
88
+ },
89
+ contentWrapperStyle: {
90
+ boxShadow: 'none'
91
+ },
92
+ destroyOnClose: true
93
+ }, FormDataEdit && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormDataEdit, {
94
+ formId: formId,
95
+ formRecordId: formRecordId,
96
+ filterList: filterList,
97
+ onReady: function onReady(ref) {
98
+ formDataEditRef.current = ref;
99
+ },
100
+ formChange: function formChange(isSuccess, params) {
101
+ if (isSuccess) {
102
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(params);
103
+ _onClose();
104
+ }
105
+ }
106
+ }), /*#__PURE__*/React.createElement("div", {
107
+ className: "pisell-lowcode__schedules-component-resources-detail-footer"
108
+ }, /*#__PURE__*/React.createElement(Button, {
109
+ className: "footer-btn",
110
+ type: "primary",
111
+ onClick: onSubmit
112
+ // loading={_setResourceRelation.loading}
113
+ // disabled={!isChangeData}
114
+ }, locales.getText('pisell2.text.schedules.save')))));
115
+ };
116
+ export default /*#__PURE__*/forwardRef(ResourcesDetail);
@@ -0,0 +1,19 @@
1
+ .pisell-lowcode__schedules-component-resources-detail-footer {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ position: absolute;
6
+ padding: 8px 16px;
7
+ border-top: 1px solid rgba(22, 44, 88, 0.09);
8
+ bottom: 0;
9
+ width: 100%;
10
+ left: 0;
11
+ background-color: #ffffff;
12
+ z-index: 999;
13
+ .footer-btn {
14
+ flex: 1;
15
+ &.cancel-btn {
16
+ margin-right: 12px;
17
+ }
18
+ }
19
+ }
@@ -1,4 +1,4 @@
1
- import React from "react";
2
- import "./index.less";
1
+ import React from 'react';
2
+ import './index.less';
3
3
  declare const Resources: () => React.JSX.Element;
4
4
  export default Resources;
@@ -10,18 +10,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
10
10
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
11
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
12
12
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- import { useRequest } from "ahooks";
14
- import { Collapse, Empty, Skeleton } from "antd";
15
- import React, { useContext, useEffect, useMemo, useRef, useState } from "react";
13
+ import { useRequest } from 'ahooks';
14
+ import { Collapse, Empty, Skeleton } from 'antd';
15
+ import React, { useContext, useEffect, useMemo, useRef, useState } from 'react';
16
16
  import CurrentDay from "../components/CurrentDay";
17
17
  import Search from "../components/Search";
18
18
  import { Context } from "../model";
19
19
  import ResourcesAdd from "./add";
20
+ import ResourcesEdit from "./edit";
20
21
  import ResourcesDetail from "./detail";
21
22
  import "./index.less";
22
23
  import List from "./list";
23
24
  import { getFormTypes, getRelationResource } from "./serve";
24
- import { locales } from "@pisell/utils";
25
+ import { locales } from '@pisell/utils';
25
26
  var Resources = function Resources() {
26
27
  var _useContext = useContext(Context),
27
28
  state = _useContext.state,
@@ -31,8 +32,9 @@ var Resources = function Resources() {
31
32
  tabKey = state.tabKey;
32
33
  var cacheResource = resources === null || resources === void 0 ? void 0 : resources.cacheResource;
33
34
  var resourcesAddRef = useRef();
35
+ var resourcesEditRef = useRef();
34
36
  var resourcesDetailRef = useRef();
35
- var _useState = useState(""),
37
+ var _useState = useState(''),
36
38
  _useState2 = _slicedToArray(_useState, 2),
37
39
  seachText = _useState2[0],
38
40
  setSearchText = _useState2[1];
@@ -89,12 +91,12 @@ var Resources = function Resources() {
89
91
  skip: 1,
90
92
  num: 500,
91
93
  schedule_ids: currentSelectDayDetail ? currentSelectDayDetail.scheduleIds || [] : undefined,
92
- exclude_form_code: ["opening_hours"]
94
+ exclude_form_code: ['opening_hours']
93
95
  }, params || null);
94
96
  };
95
97
  useEffect(function () {
96
98
  _getFormTypes.run({
97
- type: "manual",
99
+ type: 'manual',
98
100
  num: 500,
99
101
  skip: 1
100
102
  });
@@ -104,13 +106,14 @@ var Resources = function Resources() {
104
106
  }, [currentSelectDayDetail === null || currentSelectDayDetail === void 0 ? void 0 : currentSelectDayDetail.scheduleIds]);
105
107
  useEffect(function () {
106
108
  if (cacheResource) {
107
- var _resourcesDetailRef$c, _resourcesDetailRef$c2;
108
- (_resourcesDetailRef$c = resourcesDetailRef.current) === null || _resourcesDetailRef$c === void 0 ? void 0 : (_resourcesDetailRef$c2 = _resourcesDetailRef$c.open) === null || _resourcesDetailRef$c2 === void 0 ? void 0 : _resourcesDetailRef$c2.call(_resourcesDetailRef$c, cacheResource);
109
+ var _resourcesEditRef$cur, _resourcesEditRef$cur2;
110
+ // resourcesDetailRef.current?.open?.(cacheResource);
111
+ (_resourcesEditRef$cur = resourcesEditRef.current) === null || _resourcesEditRef$cur === void 0 ? void 0 : (_resourcesEditRef$cur2 = _resourcesEditRef$cur.open) === null || _resourcesEditRef$cur2 === void 0 ? void 0 : _resourcesEditRef$cur2.call(_resourcesEditRef$cur, cacheResource);
109
112
  // 滚动到 id 对应的位置
110
113
  setTimeout(function () {
111
114
  var _el$scrollIntoView;
112
115
  var el = document.getElementById("".concat(cacheResource.id));
113
- console.log("el", el);
116
+ console.log('el', el);
114
117
  el === null || el === void 0 ? void 0 : (_el$scrollIntoView = el.scrollIntoView) === null || _el$scrollIntoView === void 0 ? void 0 : _el$scrollIntoView.call(el, true);
115
118
  }, 100);
116
119
  }
@@ -142,7 +145,8 @@ var Resources = function Resources() {
142
145
  list: resources.map(function (resource) {
143
146
  return {
144
147
  id: resource.id,
145
- title: resource.title
148
+ title: resource.title,
149
+ form_id: item.id
146
150
  };
147
151
  }),
148
152
  addClick: function addClick() {
@@ -150,8 +154,9 @@ var Resources = function Resources() {
150
154
  (_resourcesAddRef$curr = resourcesAddRef.current) === null || _resourcesAddRef$curr === void 0 ? void 0 : (_resourcesAddRef$curr2 = _resourcesAddRef$curr.open) === null || _resourcesAddRef$curr2 === void 0 ? void 0 : _resourcesAddRef$curr2.call(_resourcesAddRef$curr, item.id);
151
155
  },
152
156
  itemClick: function itemClick(resource) {
153
- var _resourcesDetailRef$c3, _resourcesDetailRef$c4;
154
- (_resourcesDetailRef$c3 = resourcesDetailRef.current) === null || _resourcesDetailRef$c3 === void 0 ? void 0 : (_resourcesDetailRef$c4 = _resourcesDetailRef$c3.open) === null || _resourcesDetailRef$c4 === void 0 ? void 0 : _resourcesDetailRef$c4.call(_resourcesDetailRef$c3, resource);
157
+ var _resourcesEditRef$cur3, _resourcesEditRef$cur4;
158
+ // resourcesDetailRef.current?.open?.(resource);
159
+ (_resourcesEditRef$cur3 = resourcesEditRef.current) === null || _resourcesEditRef$cur3 === void 0 ? void 0 : (_resourcesEditRef$cur4 = _resourcesEditRef$cur3.open) === null || _resourcesEditRef$cur4 === void 0 ? void 0 : _resourcesEditRef$cur4.call(_resourcesEditRef$cur3, resource);
155
160
  }
156
161
  })
157
162
  };
@@ -159,7 +164,7 @@ var Resources = function Resources() {
159
164
  }, [formTypes, seachText, relationResource]);
160
165
  var handleClose = function handleClose() {
161
166
  dispatch({
162
- type: "setState",
167
+ type: 'setState',
163
168
  payload: {
164
169
  currentSelectDayDetail: null
165
170
  }
@@ -169,7 +174,7 @@ var Resources = function Resources() {
169
174
  className: "pisell-lowcode__schedules-component-resources"
170
175
  }, /*#__PURE__*/React.createElement("div", {
171
176
  style: {
172
- padding: "0 32px"
177
+ padding: '0 32px'
173
178
  }
174
179
  }, /*#__PURE__*/React.createElement(CurrentDay, {
175
180
  onClose: handleClose,
@@ -196,10 +201,13 @@ var Resources = function Resources() {
196
201
  }
197
202
  }) : /*#__PURE__*/React.createElement(Empty, {
198
203
  image: Empty.PRESENTED_IMAGE_SIMPLE,
199
- description: locales.getText("pisell2.text.products.no-resources")
204
+ description: locales.getText('pisell2.text.products.no-resources')
200
205
  })))), /*#__PURE__*/React.createElement(ResourcesAdd, {
201
206
  ref: resourcesAddRef,
202
207
  onSuccess: init
208
+ }), /*#__PURE__*/React.createElement(ResourcesEdit, {
209
+ ref: resourcesEditRef,
210
+ onSuccess: init
203
211
  }), /*#__PURE__*/React.createElement(ResourcesDetail, {
204
212
  tabKey: tabKey,
205
213
  ref: resourcesDetailRef,
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => any;
7
+ declare const Notes: any;
8
8
  export default Notes;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
2
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
4
3
  state: FormState;
5
4
  } & {
6
5
  dispatch: (params: {
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => any;
2
+ declare const Schedules: (props: any) => JSX.Element;
3
3
  export default Schedules;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CalendarDataItem, ScheduleItem } from "./type";
3
2
  import dayjs from "dayjs";
4
3
  export interface FormState {
@@ -69,7 +68,7 @@ export interface FormState {
69
68
  };
70
69
  setGlobalState: Function | null;
71
70
  }
72
- export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
71
+ export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
73
72
  state: FormState;
74
73
  } & {
75
74
  dispatch: (params: {
@@ -36,9 +36,9 @@ var import_antd = require("antd");
36
36
  var import_react = require("react");
37
37
  var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
38
38
  var ResourcesAdd = ({ onSuccess }, refs) => {
39
- const fromDataNewRef = (0, import_react.useRef)();
40
- const [FromDataNew] = (0, import_useComponents.default)({
41
- components: ["FromDataNew"]
39
+ const formDataNewRef = (0, import_react.useRef)();
40
+ const [FormDataNew] = (0, import_useComponents.default)({
41
+ components: ["FormDataNew"]
42
42
  });
43
43
  const [open, setOpen] = (0, import_react.useState)(false);
44
44
  const [formId, setFormId] = (0, import_react.useState)(0);
@@ -58,7 +58,7 @@ var ResourcesAdd = ({ onSuccess }, refs) => {
58
58
  });
59
59
  const onSubmit = () => {
60
60
  var _a;
61
- (_a = fromDataNewRef.current) == null ? void 0 : _a.submit();
61
+ (_a = formDataNewRef.current) == null ? void 0 : _a.submit();
62
62
  };
63
63
  return /* @__PURE__ */ React.createElement(
64
64
  import_antd.Modal,
@@ -69,11 +69,11 @@ var ResourcesAdd = ({ onSuccess }, refs) => {
69
69
  onOk: onSubmit,
70
70
  destroyOnClose: true
71
71
  },
72
- FromDataNew && /* @__PURE__ */ React.createElement(
73
- FromDataNew,
72
+ FormDataNew && /* @__PURE__ */ React.createElement(
73
+ FormDataNew,
74
74
  {
75
75
  formId,
76
- ref: fromDataNewRef,
76
+ ref: formDataNewRef,
77
77
  formChange: (isSuccess, params) => {
78
78
  if (isSuccess) {
79
79
  onSuccess == null ? void 0 : onSuccess(params);
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
+ export default _default;
@@ -0,0 +1,132 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/schedules/resources/edit/index.tsx
30
+ var edit_exports = {};
31
+ __export(edit_exports, {
32
+ default: () => edit_default
33
+ });
34
+ module.exports = __toCommonJS(edit_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_drawer = __toESM(require("../../../booking/components/drawer"));
38
+ var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
39
+ var import_utils = require("@pisell/utils");
40
+ var import_index = require("./index.less");
41
+ var filterList = [
42
+ "schedule",
43
+ "max_participants",
44
+ "partyroom_package",
45
+ "products",
46
+ "capacity"
47
+ ];
48
+ var ResourcesDetail = ({ onSuccess }, refs) => {
49
+ const formDataEditRef = (0, import_react.useRef)();
50
+ const [FormDataEdit] = (0, import_useComponents.default)({
51
+ components: ["FormDataEdit"]
52
+ });
53
+ const [open, setOpen] = (0, import_react.useState)(false);
54
+ const [currentResource, setCurrentResource] = (0, import_react.useState)({});
55
+ const [formId, setFormId] = (0, import_react.useState)(0);
56
+ const [formRecordId, setFormRecordId] = (0, import_react.useState)(0);
57
+ const onClose = () => {
58
+ setOpen(false);
59
+ };
60
+ const onOpen = () => {
61
+ setOpen(true);
62
+ };
63
+ (0, import_react.useImperativeHandle)(refs, () => {
64
+ return {
65
+ open: (item) => {
66
+ onOpen();
67
+ setCurrentResource(item);
68
+ setFormId(item.form_id);
69
+ setFormRecordId(item.id);
70
+ }
71
+ };
72
+ });
73
+ const onSubmit = () => {
74
+ var _a;
75
+ console.log("formDataEditRef", formDataEditRef);
76
+ (_a = formDataEditRef.current) == null ? void 0 : _a.submit();
77
+ };
78
+ (0, import_react.useEffect)(() => {
79
+ console.log("formDataEditRef?.current", formDataEditRef == null ? void 0 : formDataEditRef.current);
80
+ }, [formDataEditRef == null ? void 0 : formDataEditRef.current]);
81
+ return /* @__PURE__ */ import_react.default.createElement(
82
+ import_drawer.default,
83
+ {
84
+ width: "100%",
85
+ placement: "right",
86
+ open,
87
+ getContainer: document.querySelector(
88
+ ".pisell-lowcode__schedules-component-resources"
89
+ ) || document.body,
90
+ titleNoWrap: true,
91
+ headerStyle: {
92
+ display: "none"
93
+ },
94
+ onClose: () => {
95
+ onClose(false);
96
+ },
97
+ bodyStyle: {
98
+ padding: 0
99
+ },
100
+ title: currentResource == null ? void 0 : currentResource.title,
101
+ rootStyle: { position: "absolute" },
102
+ contentWrapperStyle: { boxShadow: "none" },
103
+ destroyOnClose: true
104
+ },
105
+ FormDataEdit && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
106
+ FormDataEdit,
107
+ {
108
+ formId,
109
+ formRecordId,
110
+ filterList,
111
+ onReady: (ref) => {
112
+ formDataEditRef.current = ref;
113
+ },
114
+ formChange: (isSuccess, params) => {
115
+ if (isSuccess) {
116
+ onSuccess == null ? void 0 : onSuccess(params);
117
+ onClose();
118
+ }
119
+ }
120
+ }
121
+ ), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__schedules-component-resources-detail-footer" }, /* @__PURE__ */ import_react.default.createElement(
122
+ import_antd.Button,
123
+ {
124
+ className: "footer-btn",
125
+ type: "primary",
126
+ onClick: onSubmit
127
+ },
128
+ import_utils.locales.getText("pisell2.text.schedules.save")
129
+ )))
130
+ );
131
+ };
132
+ var edit_default = (0, import_react.forwardRef)(ResourcesDetail);
@@ -0,0 +1,19 @@
1
+ .pisell-lowcode__schedules-component-resources-detail-footer {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ position: absolute;
6
+ padding: 8px 16px;
7
+ border-top: 1px solid rgba(22, 44, 88, 0.09);
8
+ bottom: 0;
9
+ width: 100%;
10
+ left: 0;
11
+ background-color: #ffffff;
12
+ z-index: 999;
13
+ .footer-btn {
14
+ flex: 1;
15
+ &.cancel-btn {
16
+ margin-right: 12px;
17
+ }
18
+ }
19
+ }