@pisell/private-materials 3.3.53 → 3.3.55

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 (81) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +6 -6
  11. package/es/components/appointmentBooking/components/Resource/index.js +5 -44
  12. package/es/components/appointmentBooking/hooks.js +177 -218
  13. package/es/components/appointmentBooking/locales.d.ts +0 -3
  14. package/es/components/appointmentBooking/locales.js +0 -9
  15. package/es/components/booking/components/TabProduct/productItem/index.js +2 -14
  16. package/es/components/booking/components/drawer/index.js +2 -4
  17. package/es/components/booking/components/voucher/index.js +17 -25
  18. package/es/components/booking/info/client/index.js +1 -2
  19. package/es/components/booking/info/pet/index.js +0 -3
  20. package/es/components/booking/info/service2/utils.js +27 -27
  21. package/es/components/booking/info2/index.js +3 -3
  22. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.js +2 -5
  24. package/es/components/booking/info2/service/editService/index.js +0 -1
  25. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +4 -23
  26. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  27. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +6 -18
  28. package/es/components/productSelect/components/TabProduct/index.js +10 -28
  29. package/es/components/productSelect/components/productGroup/index.js +7 -20
  30. package/es/components/productSelect/components/productGroup/index.less +1 -14
  31. package/es/components/productSelect/index.less +2 -1
  32. package/es/components/ticketBooking/components/addServiceVariant/addService.js +10 -16
  33. package/es/components/ticketBooking/components/addServiceVariant/index.less +0 -10
  34. package/es/components/ticketBooking/components/ticketBooking/index.js +1 -3
  35. package/es/components/ticketBooking/index.js +1 -2
  36. package/es/components/ticketBooking/locales.d.ts +0 -3
  37. package/es/components/ticketBooking/locales.js +3 -12
  38. package/es/components/ticketBooking/utils/index.d.ts +1 -5
  39. package/es/components/ticketBooking/utils/index.js +3 -35
  40. package/lib/components/appointmentBooking/components/Resource/index.js +5 -44
  41. package/lib/components/appointmentBooking/hooks.js +3 -12
  42. package/lib/components/appointmentBooking/locales.d.ts +0 -3
  43. package/lib/components/appointmentBooking/locales.js +0 -3
  44. package/lib/components/booking/components/TabProduct/productItem/index.js +1 -8
  45. package/lib/components/booking/components/drawer/index.js +2 -2
  46. package/lib/components/booking/components/voucher/index.js +27 -31
  47. package/lib/components/booking/info/client/index.js +1 -2
  48. package/lib/components/booking/info/pet/index.js +0 -3
  49. package/lib/components/booking/info/service2/utils.js +2 -2
  50. package/lib/components/booking/info2/index.js +4 -7
  51. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  52. package/lib/components/booking/info2/service/addService/utils.js +2 -4
  53. package/lib/components/booking/info2/service/editService/index.js +0 -1
  54. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +8 -18
  55. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
  56. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +1 -8
  57. package/lib/components/productSelect/components/TabProduct/index.js +6 -19
  58. package/lib/components/productSelect/components/productGroup/index.js +4 -24
  59. package/lib/components/productSelect/components/productGroup/index.less +1 -14
  60. package/lib/components/productSelect/index.less +2 -1
  61. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +14 -25
  62. package/lib/components/ticketBooking/components/addServiceVariant/index.less +0 -10
  63. package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -3
  64. package/lib/components/ticketBooking/index.js +1 -2
  65. package/lib/components/ticketBooking/locales.d.ts +0 -3
  66. package/lib/components/ticketBooking/locales.js +3 -6
  67. package/lib/components/ticketBooking/utils/index.d.ts +1 -5
  68. package/lib/components/ticketBooking/utils/index.js +3 -35
  69. package/package.json +4 -4
  70. package/es/components/appointmentBooking/assets/resource.svg +0 -1
  71. package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
  72. package/es/components/productSelect/components/TabProduct/tabs/index.js +0 -243
  73. package/es/components/productSelect/components/TabProduct/tabs/index.less +0 -126
  74. package/es/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
  75. package/es/components/productSelect/components/pisellPriceText/index.js +0 -43
  76. package/lib/components/appointmentBooking/assets/resource.svg +0 -1
  77. package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
  78. package/lib/components/productSelect/components/TabProduct/tabs/index.js +0 -202
  79. package/lib/components/productSelect/components/TabProduct/tabs/index.less +0 -126
  80. package/lib/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
  81. package/lib/components/productSelect/components/pisellPriceText/index.js +0 -72
@@ -1,243 +0,0 @@
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
8
- import classNames from 'classnames';
9
- import { useDebounceFn } from 'ahooks';
10
- import ChevronLeft from '@pisell/icon/es/ChevronLeft';
11
- import ChevronRight from '@pisell/icon/es/ChevronRight';
12
- import "./index.less";
13
-
14
- // tabs 子组件定义
15
-
16
- // 定义主键类型
17
-
18
- // Tabs 可传递的参数
19
-
20
- var Tabs = function Tabs(_ref, ref) {
21
- var renderTab = _ref.renderTab,
22
- rowKey = _ref.rowKey,
23
- _ref$name = _ref.name,
24
- name = _ref$name === void 0 ? 'tabs-' : _ref$name,
25
- onChange = _ref.onChange,
26
- tab = _ref.tab,
27
- className = _ref.className,
28
- options = _ref.options;
29
- var _useState = useState(false),
30
- _useState2 = _slicedToArray(_useState, 2),
31
- isShowButton = _useState2[0],
32
- setIsShowButton = _useState2[1];
33
- useImperativeHandle(ref, function () {
34
- return {
35
- scroll: function scroll(tab) {
36
- if (tab) {
37
- var dom = document.querySelector("#".concat(name).concat(tab));
38
- if (dom) {
39
- setTabScroll(dom === null || dom === void 0 ? void 0 : dom.offsetLeft);
40
- }
41
- }
42
- }
43
- };
44
- });
45
- /**
46
- * @Title: 改变tab事件
47
- * @Describe:
48
- * @Author: Wzw
49
- * @param {RowKey} _key
50
- */
51
- var _onChange = function _onChange(_key, _item, e) {
52
- // setScroll(_tab, _key);
53
- // 如果传入了tab 并且有onChange, 则调用onChange, 否则设置组件内部tab
54
- if (onChange) {
55
- onChange(_key, _item);
56
- }
57
- setTabScroll(e.target.offsetLeft);
58
- };
59
- useEffect(function () {
60
- if (options !== null && options !== void 0 && options.length) {
61
- calculateWidth();
62
- }
63
- }, [options]);
64
-
65
- /**
66
- * @title: 判断是否展示箭头
67
- * @description:
68
- * @return {*}
69
- * @Author: chensheng.gu
70
- * @Date: 2023-08-01 15:59
71
- */
72
- var calculateWidth = function calculateWidth() {
73
- var tabsWrapper = document.querySelector('#pisell-tabs');
74
- var tabsContent = document.querySelector('#pisell-tabs-content');
75
- if ((tabsContent === null || tabsContent === void 0 ? void 0 : tabsContent.offsetWidth) + 60 > (tabsWrapper === null || tabsWrapper === void 0 ? void 0 : tabsWrapper.offsetWidth)) {
76
- setIsShowButton(true);
77
- }
78
- };
79
-
80
- /**
81
- * @title: 选项
82
- * @description:
83
- * @param {*} useMemo
84
- * @return {*}
85
- * @Author: zhiwei.Wang
86
- * @Date: 2023-06-03 10:44
87
- */
88
- var _options = useMemo(function () {
89
- return options || [];
90
- }, [options]);
91
-
92
- // 左侧按钮宽度
93
- var _useState3 = useState(40),
94
- _useState4 = _slicedToArray(_useState3, 2),
95
- leftWidth = _useState4[0],
96
- setLeftWidth = _useState4[1];
97
- var _useState5 = useState(false),
98
- _useState6 = _slicedToArray(_useState5, 2),
99
- leftActive = _useState6[0],
100
- setLeftActive = _useState6[1];
101
- //右侧按钮宽度
102
- var _useState7 = useState(40),
103
- _useState8 = _slicedToArray(_useState7, 2),
104
- rightWidth = _useState8[0],
105
- setRightWidth = _useState8[1];
106
- var _useState9 = useState(true),
107
- _useState10 = _slicedToArray(_useState9, 2),
108
- rightActive = _useState10[0],
109
- setRightActive = _useState10[1];
110
-
111
- // 防抖
112
- var debounceChange = useDebounceFn(function (_ref2) {
113
- var current = _ref2.current,
114
- total = _ref2.total;
115
- if (current === 0) {
116
- // setLeftWidth(0);
117
- setLeftActive(false);
118
- } else {
119
- // setLeftWidth(40);
120
- setLeftActive(true);
121
- }
122
- if (current + 10 >= total) {
123
- // setRightWidth(0);
124
- setRightActive(false);
125
- } else {
126
- // setRightWidth(40);
127
- setRightActive(true);
128
- }
129
- }, {
130
- wait: 200
131
- });
132
-
133
- // 滚动时触发
134
- var onScroll = function onScroll(e) {
135
- var total = e.target.scrollWidth - e.target.clientWidth;
136
- var current = e.target.scrollLeft;
137
- debounceChange.run({
138
- current: current,
139
- total: total
140
- });
141
- };
142
-
143
- // 设置滚动位置
144
- var setTabScroll = function setTabScroll(val) {
145
- var dom = document.querySelector('#pisell-tabs-content');
146
- console.log('domdom', dom);
147
- if (!dom) {
148
- return;
149
- }
150
- dom.scrollLeft = val;
151
- };
152
-
153
- /**
154
- * @title: 手动触发滚动位置
155
- * @description:
156
- * @param {*} type
157
- * @return {*}
158
- * @Author: zhiwei.Wang
159
- * @Date: 2023-06-03 10:45
160
- */
161
- var onPageChange = function onPageChange(type) {
162
- var dom = document.querySelector('#pisell-tabs-content');
163
- if (!dom) {
164
- return;
165
- }
166
- if (type === 'left') {
167
- setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) - dom.clientWidth / 2);
168
- } else {
169
- setTabScroll((dom === null || dom === void 0 ? void 0 : dom.scrollLeft) + dom.clientWidth / 2);
170
- }
171
- };
172
-
173
- // 左侧按钮
174
- var leftBtn = useMemo(function () {
175
- return /*#__PURE__*/React.createElement("div", {
176
- className: "booking-pisell-tabs-btn-left",
177
- style: {
178
- width: leftWidth,
179
- // marginLeft: !leftWidth ? '20px' : 0,
180
- opacity: leftActive ? 1 : 0.3
181
- },
182
- onClick: function onClick() {
183
- onPageChange('left');
184
- }
185
- }, /*#__PURE__*/React.createElement(ChevronRight, {
186
- className: "booking-pisell-tabs-btn-icon"
187
- }));
188
- }, [leftWidth, leftActive]);
189
-
190
- // 右侧按钮
191
- var rightBtn = useMemo(function () {
192
- return /*#__PURE__*/React.createElement("div", {
193
- className: "booking-pisell-tabs-btn-right",
194
- style: {
195
- width: rightWidth,
196
- // marginRight: !rightWidth ? '20px' : 0,
197
- opacity: rightActive ? 1 : 0.3
198
- },
199
- onClick: function onClick() {
200
- onPageChange('right');
201
- }
202
- }, /*#__PURE__*/React.createElement(ChevronLeft, {
203
- type: "icona-iconArrowsLine",
204
- className: "booking-pisell-tabs-btn-icon"
205
- }));
206
- }, [rightWidth, rightActive]);
207
-
208
- // 中间内容
209
- var content = useMemo(function () {
210
- return /*#__PURE__*/React.createElement("div", {
211
- className: "booking-pisell-tabs-content",
212
- id: "pisell-tabs-content",
213
- onScroll: onScroll,
214
- style: {
215
- width: 'unset'
216
- }
217
- }, !isShowButton ? /*#__PURE__*/React.createElement("div", {
218
- style: {
219
- width: 4
220
- }
221
- }) : null, _options.map(function (d, i) {
222
- var _key = rowKey ? d[rowKey] : i;
223
- return /*#__PURE__*/React.createElement("div", {
224
- className: classNames('booking-pisell-tabs-tab', {
225
- 'booking-pisell-tabs-tab-active': tab === _key
226
- }),
227
- key: _key,
228
- id: name + '' + _key,
229
- onClick: function onClick(e) {
230
- _onChange(_key, d, e);
231
- }
232
- }, renderTab ? renderTab(d) : /*#__PURE__*/React.createElement("div", {
233
- className: "booking-pisell-tabs-tab-content"
234
- }, d.name));
235
- }));
236
- }, [_options, rowKey, name, tab, isShowButton]);
237
- console.log('isShow', isShowButton);
238
- return /*#__PURE__*/React.createElement("div", {
239
- className: classNames('booking-pisell-tabs', className),
240
- id: "pisell-tabs"
241
- }, isShowButton && leftBtn, content, isShowButton && rightBtn);
242
- };
243
- export default /*#__PURE__*/forwardRef(Tabs);
@@ -1,126 +0,0 @@
1
- .booking-pisell-tabs {
2
- display: flex;
3
- -webkit-box-align: center;
4
- align-items: center;
5
- width: 100%;
6
- height: 100%;
7
- font-size: 17px;
8
- font-weight: 400;
9
- color: #0d1619;
10
- cursor: default;
11
-
12
- .booking-pisell-tabs-btn-left,
13
- .booking-pisell-tabs-btn-right {
14
- -webkit-box-flex: 0;
15
- flex-grow: 0;
16
- flex-shrink: 0;
17
- transition: width 300ms ease 0s;
18
- cursor: pointer;
19
- overflow: visible;
20
- background: #fff;
21
- z-index: 1;
22
- width: 40px;
23
- height: 40px;
24
- display: flex;
25
- -webkit-box-align: center;
26
- align-items: center;
27
- -webkit-box-pack: center;
28
- justify-content: center;
29
- overflow: hidden;
30
- user-select: none;
31
-
32
- .booking-pisell-tabs-btn-icon {
33
- width: 24px;
34
- height: 24px;
35
- background: #f1f1f1;
36
- border-radius: 50%;
37
- display: flex;
38
- align-items: center;
39
- justify-content: center;
40
- color: #262626;
41
- font-size: 20px;
42
- }
43
- }
44
-
45
- .booking-pisell-tabs-btn-left {
46
- .booking-pisell-tabs-btn-icon {
47
- transform: rotate(180deg);
48
-
49
- }
50
- }
51
-
52
- .booking-pisell-tabs-btn-right {
53
- /* White */
54
-
55
- background: #ffffff;
56
- /* shadow-lg */
57
-
58
- // box-shadow: 0px 6px 15px -3px rgba(0, 0, 0, 0.15);
59
-
60
- .booking-pisell-tabs-btn-icon {
61
- transform: rotate(180deg);
62
- }
63
- }
64
-
65
- .booking-pisell-tabs-content {
66
- width: 100%;
67
- max-width: none;
68
- overflow: scroll hidden;
69
- scroll-snap-type: x mandatory;
70
- white-space: nowrap;
71
- display: flex;
72
- position: relative;
73
- scroll-behavior: smooth;
74
-
75
- /*滚动条样式*/
76
- &::-webkit-scrollbar {
77
- display: none;
78
- }
79
-
80
- &::-webkit-scrollbar-thumb {
81
- display: none;
82
- }
83
-
84
- &::-webkit-scrollbar-track {
85
- display: none;
86
- }
87
-
88
- .booking-pisell-tabs-tab {
89
- scroll-snap-align: start;
90
- white-space: initial;
91
- flex-shrink: 0;
92
- cursor: pointer;
93
-
94
- .booking-pisell-tabs-tab-content {
95
- display: inline-flex;
96
- height: 40px;
97
- padding: 0px 16px;
98
- border-radius: 88px;
99
- -webkit-box-align: center;
100
- align-items: center;
101
- transition: all 300ms ease 0s;
102
- color: #1b1b1b;
103
- letter-spacing: 0px;
104
- min-width: 0px;
105
- font-weight: 600;
106
- font-size: 14px;
107
- text-overflow: ellipsis;
108
- overflow: hidden;
109
- white-space: nowrap;
110
- }
111
-
112
- &:hover {
113
- .booking-pisell-tabs-tab-content {
114
- background-color: #f1f1f1;
115
- }
116
- }
117
-
118
- &.booking-pisell-tabs-tab-active {
119
- .booking-pisell-tabs-tab-content {
120
- color: #fff;
121
- background: var(--primary-600, #7F56D9);
122
- }
123
- }
124
- }
125
- }
126
- }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface IProps {
3
- value: string | number;
4
- isMini?: boolean;
5
- className?: string;
6
- style?: React.CSSProperties;
7
- prefix?: React.ReactElement;
8
- suffix?: React.ReactElement;
9
- }
10
- declare const index: (props: IProps) => JSX.Element;
11
- export default index;
@@ -1,43 +0,0 @@
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(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useMemo } from 'react';
8
- import { PisellText } from '@pisell/materials';
9
- import classNames from 'classnames';
10
- import useEngineContext from "../../../../hooks/useEngineContext";
11
- var index = function index(props) {
12
- var _context$appHelper$ut;
13
- var context = useEngineContext();
14
- var value = props.value;
15
- var locale = ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get('umi_locale')) || 'en';
16
- var _useMemo = useMemo(function () {
17
- if (!props.isMini) return ['', ''];
18
- if (!locale) return ['From', ''];
19
- if (locale.toLowerCase().includes('zh')) return ['', '起'];
20
- return ['From', ''];
21
- }, [locale, props.isMini]),
22
- _useMemo2 = _slicedToArray(_useMemo, 2),
23
- _prefix = _useMemo2[0],
24
- _suffix = _useMemo2[1];
25
- return /*#__PURE__*/React.createElement("div", {
26
- className: classNames('pisell-price-text', props.className)
27
- }, props.prefix, _prefix ? /*#__PURE__*/React.createElement("span", {
28
- className: "pisell-price-text-prefix-text",
29
- style: {
30
- fontSize: '0.65em',
31
- marginRight: 4
32
- }
33
- }, _prefix) : null, /*#__PURE__*/React.createElement(PisellText.Amount, {
34
- value: value
35
- }), _suffix ? /*#__PURE__*/React.createElement("span", {
36
- style: {
37
- fontSize: '0.65em',
38
- marginLeft: 4
39
- },
40
- className: "pisell-price-text-suffix-text"
41
- }, _suffix) : null, props.suffix);
42
- };
43
- export default index;
@@ -1 +0,0 @@
1
- <svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1275.59 1275.59"><defs><style>.cls-1{fill:#a6a6a6;}</style></defs><g id="DxmwFQ.tif"><path class="cls-1" d="M636.87,977.58c-114.72,1.47-224.68-20.79-329.21-68-15.86-7.16-27.21-5.9-41.28,3.48C213.52,948.26,160,982.43,106.5,1016.73c-9.48,6.08-19.25,13.77-31.41,4.9-13-9.52-8.84-21.72-5.11-33.57,17.49-55.52,34-111.4,53.34-166.26,7.84-22.23,4.17-36.79-11.17-54.36C36.65,680.94,2.43,581,23.2,466.21c18-99.46,74-176.57,151-238.71C273.46,147.32,388.47,104,514.45,86.05c118.93-16.93,236.23-12.26,351.34,21.89,145.61,43.18,271,116.11,348.42,253.1,49,86.79,56.45,179,26.18,273.75-4.88,15.27-7.87,40.71-32.33,33.2-26.2-8-10.69-29.31-5.9-44.58,43.67-139.14-3.45-251.65-104.6-345.78C991.83,179.25,861.31,135,720.56,120c-146.14-15.54-287.38,5.21-419.35,72.83C199.54,244.92,115.73,315.67,75.28,426.91c-38.67,106.33-15.56,203,49.22,292.24,4.14,5.7,8,12.14,13.45,16.28,38,28.73,40.16,63.43,21.87,104.72C148.1,866.6,141.39,895.27,132.55,923c-2.35,7.39-7.94,16.28-1.15,22.29,7.8,6.92,14.27-2.48,20.45-6.38,37.3-23.55,74.68-47,111.42-71.41,15-10,28.85-10.45,44.66-2.72,148,72.35,303.66,87.56,464.76,62.18,2.62-.41,5.25-.7,7.86-1.16,14.24-2.49,28.51-1.69,31.3,15.32s-10.53,22.14-24.72,24.41c-41,6.55-82.07,12.48-123.76,12.07C654.53,977.5,645.7,977.58,636.87,977.58Z"/><path class="cls-1" d="M1033.47,1198.82c-10.6,0-21.19.18-31.78,0-39.56-.77-60.71-20.83-61.28-60.26-.27-19.06-1.81-36.46-15.66-51.38-4.39-4.72-7.17-13-7-19.55,1-39.88-20.87-70.15-41.08-101.14C821.4,881.7,821.09,797.61,876,725.15c62.22-82.07,179.6-102.34,265.78-45.9,89.35,58.51,116.38,169.16,63.78,262.88-12.06,21.5-25.44,42.29-38.6,63.17a108.78,108.78,0,0,0-16.33,49.79c-1.41,17.07-4.09,33.17-17.53,45.64-8.07,7.48-6.06,17.91-6.27,27.49-1.12,53.27-18.56,70.41-72.19,70.82-7.07,0-14.13,0-21.19,0Zm158.82-356.91c-3.34-65.92-35.67-113.78-95.24-140.62-60.42-27.23-118.46-17.53-167.61,26.49-47.76,42.77-66.7,96.58-47.38,160.23,7.78,25.6,22.78,47.57,37,69.91,18,28.32,36.23,56.7,37.17,92,.29,10.66,3.07,20.93,16,19.1,12.71-1.79,9.38-13,7.91-21.35q-9.6-54.74-19.93-109.33c-2-10.22-1.75-19.22,6.61-26.62,9.23-8.17,18.11-4.49,26.63,1,7.15,4.58,14.3,7.73,21.9,1.9,12.06-9.25,23.72-10.48,36-.34,6.3,5.21,12.84,3,19.81.11,29.47-12.11,39.23-5,34.33,26.56-5.53,35.71-13,71.11-19.52,106.68-1.56,8.62-4.23,19,7.81,21.78,11.43,2.62,16.2-6.24,16.73-15.66,2.4-42.66,25.38-76.24,47.2-110.54C1177.31,912.39,1194.61,880.63,1192.29,841.91Zm-159.57,316.58v-.28c12.32,0,24.71.84,36.94-.2,17-1.43,17.21-14.74,17.48-27.46.27-12.54-4.83-20.42-18.34-20.45q-34.33-.07-68.69.21c-13.61.13-21.4,6-20.94,20.9.43,13.63,4,25.14,19.26,27C1009.7,1159.59,1021.28,1158.49,1032.72,1158.49Zm1.72-202.58c-14,3-28.37,5.21-25.36,24,4,25.21,8.92,50.28,14,75.31,1.19,5.91,4.1,12.5,11.94,11.66,6.39-.68,7.5-7,8.54-12,4.85-23.27,8.23-46.91,14.29-69.85C1063.81,962.48,1048.2,960.53,1034.44,955.91Z"/><path class="cls-1" d="M639.31,407.39q-177.43-.06-354.85-.09c-8.8,0-17.7,0-26.37-1.3-9.74-1.42-16.3-7.62-16.29-17.81,0-9.93,5.86-16.66,15.75-18.41a122.26,122.26,0,0,1,21.06-1.36q356.16-.14,712.33-.08c8.81,0,17.7,0,26.42,1.09,10.46,1.33,19,6.48,19,18.27,0,13.21-9.32,18.08-21.07,18.91-8.79.63-17.63.79-26.45.79Q814.09,407.48,639.31,407.39Z"/><path class="cls-1" d="M639.72,508.17q178.74,0,357.48.06c8.77,0,17.76.22,26.24,2.13s13.39,8.66,13.14,17.6c-.21,7.72-4.61,13.91-12,15.69a113,113,0,0,1-26,3.06q-360.13.25-720.27.1a106,106,0,0,1-21-1.71c-9.79-2-15.52-8.75-15.41-18.73.12-10.32,6.62-16.18,16.63-17.19,8.75-.89,17.61-.95,26.43-1Q462.3,508.15,639.72,508.17Z"/><path class="cls-1" d="M448.43,687.14q-82,0-164,0c-7.05,0-14.1-.2-21.14-.51-12.23-.54-20.81-6.52-21-19.05-.27-14,8.57-20,22.32-20q183.78.17,367.57.13c13.67,0,26.26,4.07,25.34,20-1,16.95-15.35,19.67-29.28,19.71-59.93.18-119.87.08-179.81.08Z"/></g></svg>
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export interface Com<T> extends React.FC<T> {
4
- }
5
- export declare type RowKey = string | number;
6
- export interface Option {
7
- id: number | string;
8
- name: React.ReactNode;
9
- }
10
- export interface TabsProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'> {
11
- renderTab: (item: any) => React.ReactNode;
12
- rowKey: RowKey;
13
- name: RowKey;
14
- onChange: (key: RowKey, _item: any) => void;
15
- tab: RowKey;
16
- className: string;
17
- tabsRef: any;
18
- options: Option[];
19
- }
20
- declare const _default: React.ForwardRefExoticComponent<Omit<Partial<TabsProps>, "ref"> & React.RefAttributes<unknown>>;
21
- export default _default;
@@ -1,202 +0,0 @@
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/productSelect/components/TabProduct/tabs/index.tsx
30
- var tabs_exports = {};
31
- __export(tabs_exports, {
32
- default: () => tabs_default
33
- });
34
- module.exports = __toCommonJS(tabs_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_classnames = __toESM(require("classnames"));
37
- var import_ahooks = require("ahooks");
38
- var import_ChevronLeft = __toESM(require("@pisell/icon/es/ChevronLeft"));
39
- var import_ChevronRight = __toESM(require("@pisell/icon/es/ChevronRight"));
40
- var import_index = require("./index.less");
41
- var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, options }, ref) => {
42
- const [isShowButton, setIsShowButton] = (0, import_react.useState)(false);
43
- (0, import_react.useImperativeHandle)(ref, () => {
44
- return {
45
- scroll: (tab2) => {
46
- if (tab2) {
47
- const dom = document.querySelector(`#${name}${tab2}`);
48
- if (dom) {
49
- setTabScroll(dom == null ? void 0 : dom.offsetLeft);
50
- }
51
- }
52
- }
53
- };
54
- });
55
- const _onChange = (_key, _item, e) => {
56
- if (onChange) {
57
- onChange(_key, _item);
58
- }
59
- setTabScroll(e.target.offsetLeft);
60
- };
61
- (0, import_react.useEffect)(() => {
62
- if (options == null ? void 0 : options.length) {
63
- calculateWidth();
64
- }
65
- }, [options]);
66
- const calculateWidth = () => {
67
- const tabsWrapper = document.querySelector("#pisell-tabs");
68
- const tabsContent = document.querySelector("#pisell-tabs-content");
69
- if ((tabsContent == null ? void 0 : tabsContent.offsetWidth) + 60 > (tabsWrapper == null ? void 0 : tabsWrapper.offsetWidth)) {
70
- setIsShowButton(true);
71
- }
72
- };
73
- const _options = (0, import_react.useMemo)(() => {
74
- return options || [];
75
- }, [options]);
76
- const [leftWidth, setLeftWidth] = (0, import_react.useState)(40);
77
- const [leftActive, setLeftActive] = (0, import_react.useState)(false);
78
- const [rightWidth, setRightWidth] = (0, import_react.useState)(40);
79
- const [rightActive, setRightActive] = (0, import_react.useState)(true);
80
- const debounceChange = (0, import_ahooks.useDebounceFn)(
81
- ({ current, total }) => {
82
- if (current === 0) {
83
- setLeftActive(false);
84
- } else {
85
- setLeftActive(true);
86
- }
87
- if (current + 10 >= total) {
88
- setRightActive(false);
89
- } else {
90
- setRightActive(true);
91
- }
92
- },
93
- {
94
- wait: 200
95
- }
96
- );
97
- const onScroll = (e) => {
98
- let total = e.target.scrollWidth - e.target.clientWidth;
99
- let current = e.target.scrollLeft;
100
- debounceChange.run({ current, total });
101
- };
102
- const setTabScroll = (val) => {
103
- let dom = document.querySelector("#pisell-tabs-content");
104
- console.log("domdom", dom);
105
- if (!dom) {
106
- return;
107
- }
108
- dom.scrollLeft = val;
109
- };
110
- const onPageChange = (type) => {
111
- let dom = document.querySelector("#pisell-tabs-content");
112
- if (!dom) {
113
- return;
114
- }
115
- if (type === "left") {
116
- setTabScroll((dom == null ? void 0 : dom.scrollLeft) - dom.clientWidth / 2);
117
- } else {
118
- setTabScroll((dom == null ? void 0 : dom.scrollLeft) + dom.clientWidth / 2);
119
- }
120
- };
121
- const leftBtn = (0, import_react.useMemo)(() => {
122
- return /* @__PURE__ */ import_react.default.createElement(
123
- "div",
124
- {
125
- className: "booking-pisell-tabs-btn-left",
126
- style: {
127
- width: leftWidth,
128
- // marginLeft: !leftWidth ? '20px' : 0,
129
- opacity: leftActive ? 1 : 0.3
130
- },
131
- onClick: () => {
132
- onPageChange("left");
133
- }
134
- },
135
- /* @__PURE__ */ import_react.default.createElement(import_ChevronRight.default, { className: "booking-pisell-tabs-btn-icon" })
136
- );
137
- }, [leftWidth, leftActive]);
138
- const rightBtn = (0, import_react.useMemo)(() => {
139
- return /* @__PURE__ */ import_react.default.createElement(
140
- "div",
141
- {
142
- className: "booking-pisell-tabs-btn-right",
143
- style: {
144
- width: rightWidth,
145
- // marginRight: !rightWidth ? '20px' : 0,
146
- opacity: rightActive ? 1 : 0.3
147
- },
148
- onClick: () => {
149
- onPageChange("right");
150
- }
151
- },
152
- /* @__PURE__ */ import_react.default.createElement(
153
- import_ChevronLeft.default,
154
- {
155
- type: "icona-iconArrowsLine",
156
- className: "booking-pisell-tabs-btn-icon"
157
- }
158
- )
159
- );
160
- }, [rightWidth, rightActive]);
161
- const content = (0, import_react.useMemo)(() => {
162
- return /* @__PURE__ */ import_react.default.createElement(
163
- "div",
164
- {
165
- className: "booking-pisell-tabs-content",
166
- id: "pisell-tabs-content",
167
- onScroll,
168
- style: { width: "unset" }
169
- },
170
- !isShowButton ? /* @__PURE__ */ import_react.default.createElement("div", { style: { width: 4 } }) : null,
171
- _options.map((d, i) => {
172
- let _key = rowKey ? d[rowKey] : i;
173
- return /* @__PURE__ */ import_react.default.createElement(
174
- "div",
175
- {
176
- className: (0, import_classnames.default)("booking-pisell-tabs-tab", {
177
- "booking-pisell-tabs-tab-active": tab === _key
178
- }),
179
- key: _key,
180
- id: name + "" + _key,
181
- onClick: (e) => {
182
- _onChange(_key, d, e);
183
- }
184
- },
185
- renderTab ? renderTab(d) : /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-pisell-tabs-tab-content" }, d.name)
186
- );
187
- })
188
- );
189
- }, [_options, rowKey, name, tab, isShowButton]);
190
- console.log("isShow", isShowButton);
191
- return /* @__PURE__ */ import_react.default.createElement(
192
- "div",
193
- {
194
- className: (0, import_classnames.default)("booking-pisell-tabs", className),
195
- id: "pisell-tabs"
196
- },
197
- isShowButton && leftBtn,
198
- content,
199
- isShowButton && rightBtn
200
- );
201
- };
202
- var tabs_default = (0, import_react.forwardRef)(Tabs);