@pisell/materials 3.0.62 → 3.0.64

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 (159) 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 +2 -2
  6. package/build/lowcode/preview.js +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +22 -54
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +22 -54
  11. package/es/components/Pagination/index.d.ts +1 -1
  12. package/es/components/TimeResourceSelector/index.d.ts +21 -0
  13. package/es/components/TimeResourceSelector/index.js +115 -0
  14. package/es/components/TimeResourceSelector/index.less +59 -0
  15. package/es/components/cardPro/index.js +1 -4
  16. package/es/components/iconfont/index.js +1 -1
  17. package/es/components/pisellAnchor/index.d.ts +15 -0
  18. package/es/components/pisellAnchor/index.js +126 -0
  19. package/es/components/pisellAnchor/index.less +177 -0
  20. package/es/components/pisellAvatar/index.d.ts +19 -0
  21. package/es/components/pisellAvatar/index.js +90 -0
  22. package/es/components/pisellAvatar/index.less +26 -0
  23. package/es/components/pisellCard/index.d.ts +8 -0
  24. package/es/components/pisellCard/index.js +34 -5
  25. package/es/components/pisellCard/index.less +31 -4
  26. package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  27. package/es/components/pisellCustomCheckboxGroup/index.js +72 -0
  28. package/es/components/pisellCustomCheckboxGroup/index.less +0 -0
  29. package/es/components/pisellDropdown/index.d.ts +20 -0
  30. package/es/components/pisellDropdown/index.js +51 -0
  31. package/es/components/pisellDropdown/index.less +44 -0
  32. package/es/components/pisellEmpty/index.d.ts +2 -1
  33. package/es/components/pisellHeaderProgressBar/index.d.ts +29 -0
  34. package/es/components/pisellHeaderProgressBar/index.js +76 -0
  35. package/es/components/pisellHeaderProgressBar/index.less +18 -0
  36. package/es/components/pisellImageCarousels/index.d.ts +18 -0
  37. package/es/components/pisellImageCarousels/index.js +108 -0
  38. package/es/components/pisellImageCarousels/index.less +92 -0
  39. package/es/components/pisellList01/index.d.ts +17 -0
  40. package/es/components/pisellList01/index.js +105 -0
  41. package/es/components/pisellList01/index.less +53 -0
  42. package/es/components/pisellModal/components/PcModal/index.js +1 -1
  43. package/es/components/pisellSectionHeaders/index.d.ts +21 -0
  44. package/es/components/pisellSectionHeaders/index.js +35 -0
  45. package/es/components/pisellSectionHeaders/index.less +46 -0
  46. package/es/components/pisellText/components/Amount/index.js +1 -1
  47. package/es/components/pisellViewGrid/index.d.ts +16 -0
  48. package/es/components/pisellViewGrid/index.js +66 -0
  49. package/es/components/pisellViewGrid/index.less +31 -0
  50. package/es/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
  51. package/es/components/productCard/components/Header/DeleteButton/index.js +21 -0
  52. package/es/components/productCard/components/Header/DeleteButton/index.less +15 -0
  53. package/es/components/productCard/components/Header/index.js +6 -15
  54. package/es/components/productCard/components/Header/index.less +0 -11
  55. package/es/components/productCard/hooks/useOpenNote.js +3 -2
  56. package/es/components/productCard/index.js +18 -5
  57. package/es/components/productCard/index.less +30 -2
  58. package/es/components/productCard/status.js +3 -1
  59. package/es/components/productCard/types.d.ts +2 -0
  60. package/es/components/productCard/utils.js +17 -1
  61. package/es/components/section-footers/index.d.ts +9 -0
  62. package/es/components/section-footers/index.js +17 -0
  63. package/es/components/section-footers/index.less +5 -0
  64. package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  65. package/es/components/table/Actions/component/ExportImport/utils/index.js +11 -0
  66. package/es/index.d.ts +10 -0
  67. package/es/index.js +10 -0
  68. package/lib/components/Pagination/index.d.ts +1 -1
  69. package/lib/components/TimeResourceSelector/index.d.ts +21 -0
  70. package/lib/components/TimeResourceSelector/index.js +109 -0
  71. package/lib/components/TimeResourceSelector/index.less +59 -0
  72. package/lib/components/cardPro/index.js +0 -3
  73. package/lib/components/iconfont/index.js +1 -1
  74. package/lib/components/pisellAnchor/index.d.ts +15 -0
  75. package/lib/components/pisellAnchor/index.js +120 -0
  76. package/lib/components/pisellAnchor/index.less +177 -0
  77. package/lib/components/pisellAvatar/index.d.ts +19 -0
  78. package/lib/components/pisellAvatar/index.js +108 -0
  79. package/lib/components/pisellAvatar/index.less +26 -0
  80. package/lib/components/pisellCard/index.d.ts +8 -0
  81. package/lib/components/pisellCard/index.js +30 -7
  82. package/lib/components/pisellCard/index.less +31 -4
  83. package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
  84. package/lib/components/pisellCustomCheckboxGroup/index.js +71 -0
  85. package/lib/components/pisellCustomCheckboxGroup/index.less +0 -0
  86. package/lib/components/pisellDropdown/index.d.ts +20 -0
  87. package/lib/components/pisellDropdown/index.js +72 -0
  88. package/lib/components/pisellDropdown/index.less +44 -0
  89. package/lib/components/pisellEmpty/index.d.ts +2 -1
  90. package/lib/components/pisellHeaderProgressBar/index.d.ts +29 -0
  91. package/lib/components/pisellHeaderProgressBar/index.js +88 -0
  92. package/lib/components/pisellHeaderProgressBar/index.less +18 -0
  93. package/lib/components/pisellImageCarousels/index.d.ts +18 -0
  94. package/lib/components/pisellImageCarousels/index.js +108 -0
  95. package/lib/components/pisellImageCarousels/index.less +92 -0
  96. package/lib/components/pisellList01/index.d.ts +17 -0
  97. package/lib/components/pisellList01/index.js +113 -0
  98. package/lib/components/pisellList01/index.less +53 -0
  99. package/lib/components/pisellModal/components/PcModal/index.js +1 -1
  100. package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
  101. package/lib/components/pisellSectionHeaders/index.js +52 -0
  102. package/lib/components/pisellSectionHeaders/index.less +46 -0
  103. package/lib/components/pisellText/components/Amount/index.js +2 -2
  104. package/lib/components/pisellViewGrid/index.d.ts +16 -0
  105. package/lib/components/pisellViewGrid/index.js +98 -0
  106. package/lib/components/pisellViewGrid/index.less +31 -0
  107. package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
  108. package/lib/components/productCard/components/Header/DeleteButton/index.js +53 -0
  109. package/lib/components/productCard/components/Header/DeleteButton/index.less +15 -0
  110. package/lib/components/productCard/components/Header/index.js +4 -14
  111. package/lib/components/productCard/components/Header/index.less +0 -11
  112. package/lib/components/productCard/hooks/useOpenNote.js +2 -1
  113. package/lib/components/productCard/index.js +94 -74
  114. package/lib/components/productCard/index.less +30 -2
  115. package/lib/components/productCard/status.js +3 -1
  116. package/lib/components/productCard/types.d.ts +2 -0
  117. package/lib/components/productCard/utils.js +15 -4
  118. package/lib/components/section-footers/index.d.ts +9 -0
  119. package/lib/components/section-footers/index.js +44 -0
  120. package/lib/components/section-footers/index.less +5 -0
  121. package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
  122. package/lib/components/table/Actions/component/ExportImport/utils/index.js +31 -0
  123. package/lib/index.d.ts +10 -0
  124. package/lib/index.js +30 -0
  125. package/lowcode/pisell-anchor/meta.ts +118 -0
  126. package/lowcode/pisell-anchor/snippets.ts +26 -0
  127. package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
  128. package/lowcode/pisell-avatar/meta.ts +111 -0
  129. package/lowcode/pisell-avatar/snippets.ts +14 -0
  130. package/lowcode/pisell-card/meta.ts +62 -27
  131. package/lowcode/pisell-card/snippets.ts +6 -0
  132. package/lowcode/pisell-custom-checkbox-group/__screenshots__/card-1.png +0 -0
  133. package/lowcode/pisell-custom-checkbox-group/meta.ts +204 -0
  134. package/lowcode/pisell-custom-checkbox-group/snippets.ts +56 -0
  135. package/lowcode/pisell-dropdown/__screenshots__/dropdown-1.png +0 -0
  136. package/lowcode/pisell-dropdown/meta.ts +180 -0
  137. package/lowcode/pisell-dropdown/snippets.ts +69 -0
  138. package/lowcode/pisell-header-progress-bar/meta.ts +116 -0
  139. package/lowcode/pisell-header-progress-bar/snippets.ts +24 -0
  140. package/lowcode/pisell-image-carousels/meta.ts +143 -0
  141. package/lowcode/pisell-image-carousels/snippets.ts +20 -0
  142. package/lowcode/pisell-list01/meta.ts +74 -0
  143. package/lowcode/pisell-list01/snippets.ts +35 -0
  144. package/lowcode/pisell-section-headers/meta.ts +91 -0
  145. package/lowcode/pisell-section-headers/snippets.ts +22 -0
  146. package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
  147. package/lowcode/pisell-view-grid/meta.ts +167 -0
  148. package/lowcode/pisell-view-grid/snippets.ts +54 -0
  149. package/lowcode/section-footers/meta.ts +66 -0
  150. package/lowcode/section-footers/snippe.ts +21 -0
  151. package/package.json +4 -3
  152. package/dist/umd/materials.min.css +0 -1
  153. package/dist/umd/materials.min.js +0 -1
  154. package/dist/umd/static/DotsSix.57d66266.svg +0 -1
  155. package/dist/umd/static/arrow-left.e542294f.svg +0 -1
  156. package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
  157. package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
  158. package/dist/umd/static/help-circle.31c9be40.svg +0 -1
  159. package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
@@ -14,6 +14,7 @@ import { Alert } from 'antd';
14
14
  import { locales } from '@pisell/utils';
15
15
  import CardPro from "../cardPro";
16
16
  import Header from "./components/Header";
17
+ import DeleteButton from "./components/Header/DeleteButton";
17
18
  import Time from "./components/Time";
18
19
  import Packages from "./components/Packages";
19
20
  import Sales from "./components/Sales";
@@ -24,10 +25,12 @@ import Action from "./components/Action";
24
25
  import UseOpenNote from "./hooks/useOpenNote";
25
26
  import localeTexts from "./locales";
26
27
  import { defaultValue } from "./status";
28
+ import useEngineContext from "../../hooks/useEngineContext";
27
29
  import "./index.less";
28
- locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
29
30
  var ProductCard = function ProductCard(props) {
30
- var _classNames, _dataSource$items;
31
+ var _utils$storage, _classNames2, _dataSource$items;
32
+ var context = useEngineContext();
33
+ var utils = context.appHelper.utils || {};
31
34
  var _props$dataSource = props.dataSource,
32
35
  dataSource = _props$dataSource === void 0 ? defaultValue.dataSource : _props$dataSource,
33
36
  _props$isShowImage = props.isShowImage,
@@ -47,6 +50,8 @@ var ProductCard = function ProductCard(props) {
47
50
  onCard = props.onCard,
48
51
  other = _objectWithoutProperties(props, _excluded);
49
52
  var useOpenNoteRef = useRef();
53
+ var locale = (utils === null || utils === void 0 ? void 0 : (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || localStorage.getItem('umi_locale');
54
+ locales.init(localeTexts, locale || 'en');
50
55
  console.log(dataSource, isShowImage, isShowNote, 'dataSource');
51
56
  var image = dataSource.image,
52
57
  bundle = dataSource.bundle,
@@ -80,8 +85,16 @@ var ProductCard = function ProductCard(props) {
80
85
  var hideDivider = useMemo(function () {
81
86
  return (bundle === null || bundle === void 0 ? void 0 : bundle.length) || (relation_products === null || relation_products === void 0 ? void 0 : relation_products.length);
82
87
  }, [bundle, relation_products]);
83
- return /*#__PURE__*/React.createElement(CardPro, {
84
- className: classNames('pisell-lowcode-product-card', (_classNames = {}, _defineProperty(_classNames, 'pisell-lowcode-product-card-image', !showImage), _defineProperty(_classNames, 'pisell-lowcode-normal-product-card', !showImage && isNormalProduct), _classNames)),
88
+ return /*#__PURE__*/React.createElement("div", {
89
+ className: classNames('pisell-lowcode-product-card-wrap', _defineProperty({}, 'pisell-lowcode-product-card-disabled', dataSource === null || dataSource === void 0 ? void 0 : dataSource.disabled))
90
+ }, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.disabled) && /*#__PURE__*/React.createElement("div", {
91
+ className: "delete-btn-wrapper"
92
+ }, /*#__PURE__*/React.createElement(DeleteButton, {
93
+ onDelete: function onDelete() {
94
+ return _onDelete === null || _onDelete === void 0 ? void 0 : _onDelete(dataSource);
95
+ }
96
+ })), /*#__PURE__*/React.createElement(CardPro, {
97
+ className: classNames('pisell-lowcode-product-card', (_classNames2 = {}, _defineProperty(_classNames2, 'pisell-lowcode-product-card-image', !showImage), _defineProperty(_classNames2, 'pisell-lowcode-normal-product-card', !showImage && isNormalProduct), _classNames2)),
85
98
  key: _id
86
99
  }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
87
100
  onClick: function onClick(e) {
@@ -140,6 +153,6 @@ var ProductCard = function ProductCard(props) {
140
153
  note: e || ''
141
154
  }));
142
155
  }
143
- })));
156
+ }))));
144
157
  };
145
158
  export default ProductCard;
@@ -37,7 +37,7 @@
37
37
  width: 6px;
38
38
  height: 100%;
39
39
  background: var(--Blue-400, #53b1fd);
40
- z-index: 0 !important;
40
+ z-index: 1 !important;
41
41
  }
42
42
  }
43
43
 
@@ -47,8 +47,36 @@
47
47
  }
48
48
  }
49
49
 
50
+ .pisell-lowcode-product-card-wrap {
51
+ position: relative;
52
+ }
53
+
54
+ .pisell-lowcode-product-card-disabled {
55
+ opacity: 1;
56
+
57
+ .pisell-lowcode-product-card {
58
+ opacity: 0.4;
59
+ pointer-events: none;
60
+ }
61
+
62
+ .delete-btn-wrapper {
63
+ opacity: 1;
64
+ pointer-events: auto;
65
+ position: absolute;
66
+ top: 1px;
67
+ right: 1px;
68
+ z-index: 10;
69
+
70
+ .anticon {
71
+ color: red;
72
+ cursor: pointer;
73
+ opacity: 1;
74
+ }
75
+ }
76
+ }
77
+
50
78
  .pisell-lowcode-product-card-error {
51
79
  border: none !important;
52
80
  margin: 8px -16px -8px;
53
81
  border-radius: 0 0 8px 8px;
54
- }
82
+ }
@@ -43,7 +43,9 @@ export var defaultProduct = {
43
43
  num: 1,
44
44
  image: '',
45
45
  isShowNote: true,
46
- note: ''
46
+ note: '',
47
+ is_show_duration: true,
48
+ is_show_week: true
47
49
  };
48
50
 
49
51
  /**
@@ -54,6 +54,8 @@ export declare type productType = {
54
54
  holder_title?: string;
55
55
  start_date?: string;
56
56
  end_date?: string;
57
+ is_show_duration?: boolean;
58
+ is_show_week?: boolean;
57
59
  };
58
60
  /**
59
61
  * 排序总配置
@@ -3,6 +3,7 @@ import { locales } from '@pisell/utils';
3
3
  import 'dayjs/locale/zh-cn';
4
4
  import 'dayjs/locale/en';
5
5
  import 'dayjs/locale/zh-tw';
6
+ import useEngineContext from "../../hooks/useEngineContext";
6
7
 
7
8
  /**
8
9
  * @title: 是否英文
@@ -53,8 +54,11 @@ export var formatMultiDayDate = function formatMultiDayDate(item) {
53
54
  * @Date: 2024-04-26 14:04
54
55
  */
55
56
  export var getServiceTime = function getServiceTime(item, currentDate) {
57
+ var _utils$storage, _item$format;
56
58
  if (!dayjs(currentDate).isValid()) return '';
57
- var locale = (item === null || item === void 0 ? void 0 : item.locale) || 'en-US';
59
+ var context = useEngineContext();
60
+ var utils = context.appHelper.utils || {};
61
+ var locale = (item === null || item === void 0 ? void 0 : item.locale) || (utils === null || utils === void 0 ? void 0 : (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('umi_locale')) || 'en-US';
58
62
  var isEn = locale === 'en-US' || locale === 'en';
59
63
  var localeTypes = {
60
64
  'en-US': 'en',
@@ -66,6 +70,18 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
66
70
  var endDate = dayjs(item === null || item === void 0 ? void 0 : item.end_date);
67
71
  var diffInDays = endDate.diff(startDate, 'day');
68
72
  var _format = isEn ? 'ddd, DD/MM/YYYY' : 'YYYY-MM-DD,ddd';
73
+
74
+ // 是否自定义格式
75
+ if (item !== null && item !== void 0 && item.hasOwnProperty('format') && (item === null || item === void 0 ? void 0 : (_item$format = item.format) === null || _item$format === void 0 ? void 0 : _item$format.length) > 0) {
76
+ var _item$format2, _item$format3;
77
+ _format = isEn ? item === null || item === void 0 ? void 0 : (_item$format2 = item.format) === null || _item$format2 === void 0 ? void 0 : _item$format2[0] : item === null || item === void 0 ? void 0 : (_item$format3 = item.format) === null || _item$format3 === void 0 ? void 0 : _item$format3[1];
78
+ }
79
+
80
+ // 是否显示时间
81
+ if (item !== null && item !== void 0 && item.show_time) {
82
+ startDate = dayjs("".concat(item === null || item === void 0 ? void 0 : item.start_date, " ").concat(item === null || item === void 0 ? void 0 : item.start_time));
83
+ endDate = dayjs("".concat(item === null || item === void 0 ? void 0 : item.end_date, " ").concat(item === null || item === void 0 ? void 0 : item.end_time));
84
+ }
69
85
  var date = "".concat(startDate.format(_format), " ~ ").concat(endDate.format(_format));
70
86
  var duration = "".concat(diffInDays, " ").concat(locales.getText('pisell2.product.card.day')(diffInDays));
71
87
  return "".concat(date, " (").concat(duration, ")");
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ interface SectionFooterProps {
3
+ left?: React.ReactNode;
4
+ middle?: React.ReactNode;
5
+ right?: React.ReactNode;
6
+ className?: string;
7
+ }
8
+ declare const SectionFooters: (props: SectionFooterProps) => import("react").JSX.Element;
9
+ export default SectionFooters;
@@ -0,0 +1,17 @@
1
+ import { useEffect } from 'react';
2
+ import { Flex } from 'antd';
3
+ var SectionFooters = function SectionFooters(props) {
4
+ useEffect(function () {
5
+ document.body.id = 'body';
6
+ }, []);
7
+ var left = props.left,
8
+ middle = props.middle,
9
+ right = props.right,
10
+ className = props.className;
11
+ return /*#__PURE__*/React.createElement(Flex, {
12
+ gap: "middle",
13
+ justify: "space-between",
14
+ className: "pisell-section-footers-wrapper ".concat(className)
15
+ }, left, middle, right);
16
+ };
17
+ export default SectionFooters;
@@ -0,0 +1,5 @@
1
+ .pisell-section-footers-wrapper {
2
+ position: fixed;
3
+ bottom: 0;
4
+ width: 100%;
5
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export declare const formatApiUrl: (url: string) => string;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @title: 格式化导出导入接口地址
3
+ * @description:
4
+ * @param {string} url
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2024-09-05 11:39
8
+ */
9
+ export var formatApiUrl = function formatApiUrl(url) {
10
+ return url || '/shop/form/data';
11
+ };
package/es/index.d.ts CHANGED
@@ -108,5 +108,15 @@ export { default as PisellAdjustPrice } from './components/pisellAdjustPrice';
108
108
  export { default as PisellAdjustPriceInputNumber } from './components/pisellAdjustPrice/PisellAdjustPriceInputNumber';
109
109
  export { default as PisellStatisticList } from './components/pisellStatisticList';
110
110
  export { default as PisellFloatingPanel } from './components/pisellFloatingPanel';
111
+ export { default as PisellAvatar } from './components/pisellAvatar';
112
+ export { default as PisellViewGrid } from './components/pisellViewGrid';
113
+ export { default as PisellCustomCheckboxGroup } from './components/pisellCustomCheckboxGroup';
114
+ export { default as PisellDropdown } from './components/pisellDropdown';
115
+ export { default as PisellSectionHeaders } from './components/pisellSectionHeaders';
116
+ export { default as PisellImageCarousels } from './components/pisellImageCarousels';
117
+ export { default as PisellHeaderProgressBar } from './components/pisellHeaderProgressBar';
118
+ export { default as PisellList01 } from './components/pisellList01';
119
+ export { default as PisellAnchor } from './components/pisellAnchor';
120
+ export { default as SectionFooters } from './components/section-footers';
111
121
  export { default as ProductCard } from './components/productCard';
112
122
  export { default as Collapse } from './components/collapse';
package/es/index.js CHANGED
@@ -133,5 +133,15 @@ export { default as PisellAdjustPrice } from "./components/pisellAdjustPrice";
133
133
  export { default as PisellAdjustPriceInputNumber } from "./components/pisellAdjustPrice/PisellAdjustPriceInputNumber";
134
134
  export { default as PisellStatisticList } from "./components/pisellStatisticList";
135
135
  export { default as PisellFloatingPanel } from "./components/pisellFloatingPanel";
136
+ export { default as PisellAvatar } from "./components/pisellAvatar";
137
+ export { default as PisellViewGrid } from "./components/pisellViewGrid";
138
+ export { default as PisellCustomCheckboxGroup } from "./components/pisellCustomCheckboxGroup";
139
+ export { default as PisellDropdown } from "./components/pisellDropdown";
140
+ export { default as PisellSectionHeaders } from "./components/pisellSectionHeaders";
141
+ export { default as PisellImageCarousels } from "./components/pisellImageCarousels";
142
+ export { default as PisellHeaderProgressBar } from "./components/pisellHeaderProgressBar";
143
+ export { default as PisellList01 } from "./components/pisellList01";
144
+ export { default as PisellAnchor } from "./components/pisellAnchor";
145
+ export { default as SectionFooters } from "./components/section-footers";
136
146
  export { default as ProductCard } from "./components/productCard";
137
147
  export { default as Collapse } from "./components/collapse";
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
5
5
  className: string;
6
6
  defaultCurrent: number;
7
7
  showTotal: (total: number, range: [number, number]) => string;
8
- itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
8
+ itemRender: (page: number, type: "next" | "page" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
9
9
  responsive: boolean;
10
10
  size: string;
11
11
  };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface TimeSlot {
4
+ value: string;
5
+ label: string;
6
+ time: string;
7
+ remainingCount: number;
8
+ disabled?: boolean;
9
+ }
10
+ export interface TimeResourceSelectorProps {
11
+ timeSlots?: TimeSlot[];
12
+ multiple?: boolean;
13
+ showUnavailable?: boolean;
14
+ defaultExpanded?: boolean;
15
+ defaultSelectFirst?: boolean;
16
+ onChange?: (values: string | string[]) => void;
17
+ className?: string;
18
+ style?: React.CSSProperties;
19
+ }
20
+ declare const TimeResourceSelector: React.FC<TimeResourceSelectorProps>;
21
+ export default TimeResourceSelector;
@@ -0,0 +1,109 @@
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/TimeResourceSelector/index.tsx
30
+ var TimeResourceSelector_exports = {};
31
+ __export(TimeResourceSelector_exports, {
32
+ default: () => TimeResourceSelector_default
33
+ });
34
+ module.exports = __toCommonJS(TimeResourceSelector_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_materials = require("@pisell/materials");
38
+ var import_PisellCustomCheckboxGroup = __toESM(require("../PisellCustomCheckboxGroup"));
39
+ var import_index = require("./index.less");
40
+ var TimeResourceSelector = ({
41
+ timeSlots = [],
42
+ multiple = false,
43
+ showUnavailable = true,
44
+ defaultExpanded = true,
45
+ defaultSelectFirst = true,
46
+ onChange,
47
+ className,
48
+ style
49
+ }) => {
50
+ const [selectedValues, setSelectedValues] = (0, import_react.useState)([]);
51
+ const [error, setError] = (0, import_react.useState)("");
52
+ const filteredTimeSlots = timeSlots.filter(
53
+ (slot) => showUnavailable ? true : !slot.disabled
54
+ );
55
+ (0, import_react.useEffect)(() => {
56
+ if (defaultSelectFirst && filteredTimeSlots.length > 0 && selectedValues.length === 0) {
57
+ const firstAvailable = filteredTimeSlots.find((slot) => !slot.disabled);
58
+ if (firstAvailable) {
59
+ const value = firstAvailable.value;
60
+ setSelectedValues([value]);
61
+ onChange == null ? void 0 : onChange(multiple ? [value] : value);
62
+ }
63
+ }
64
+ }, [filteredTimeSlots, defaultSelectFirst, multiple, onChange]);
65
+ const renderTimeCard = (item) => {
66
+ const { time, remainingCount, disabled } = item;
67
+ return /* @__PURE__ */ import_react.default.createElement(
68
+ import_materials.PisellCard,
69
+ {
70
+ className: "time-resource-card",
71
+ bodyStyle: { padding: "12px" }
72
+ },
73
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "time-slot-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "time-text" }, time), /* @__PURE__ */ import_react.default.createElement("div", { className: "remaining-count" }, "剩余: ", remainingCount))
74
+ );
75
+ };
76
+ const handleChange = (0, import_react.useCallback)(
77
+ (value) => {
78
+ if (Array.isArray(value)) {
79
+ setSelectedValues(value);
80
+ setError(value.length === 0 ? "Please select a session time" : "");
81
+ } else {
82
+ setSelectedValues([value]);
83
+ setError("");
84
+ }
85
+ onChange == null ? void 0 : onChange(value);
86
+ },
87
+ [onChange]
88
+ );
89
+ const renderContent = () => {
90
+ if (filteredTimeSlots.length === 0) {
91
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Empty, { description: "No dates are available" });
92
+ }
93
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, error && /* @__PURE__ */ import_react.default.createElement("div", { className: "time-resource-error" }, error), /* @__PURE__ */ import_react.default.createElement(
94
+ import_PisellCustomCheckboxGroup.default,
95
+ {
96
+ dataSource: filteredTimeSlots,
97
+ renderItem: renderTimeCard,
98
+ value: selectedValues,
99
+ onChange: handleChange,
100
+ isMultiple: multiple,
101
+ columns: 4,
102
+ horizontalGap: 16,
103
+ verticalGap: 16
104
+ }
105
+ ));
106
+ };
107
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: `time-resource-selector ${className || ""}`, style }, /* @__PURE__ */ import_react.default.createElement(import_antd.Collapse, { defaultActiveKey: defaultExpanded ? ["1"] : [] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Collapse.Panel, { header: "选择时间段", key: "1" }, renderContent())));
108
+ };
109
+ var TimeResourceSelector_default = TimeResourceSelector;
@@ -0,0 +1,59 @@
1
+ .time-resource-selector {
2
+ .time-resource-card {
3
+ cursor: pointer;
4
+ transition: all 0.3s;
5
+
6
+ &:hover {
7
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
8
+ }
9
+ }
10
+
11
+ .time-slot-content {
12
+ display: flex;
13
+ flex-direction: column;
14
+ align-items: center;
15
+ justify-content: center;
16
+ min-height: 80px;
17
+
18
+ .time-text {
19
+ font-size: 16px;
20
+ font-weight: 500;
21
+ margin-bottom: 8px;
22
+ }
23
+
24
+ .remaining-count {
25
+ font-size: 14px;
26
+ color: #666;
27
+ }
28
+ }
29
+
30
+ // 选中状态
31
+ .pisell-checkbox-item-selected {
32
+ .time-resource-card {
33
+ border-color: #1890ff;
34
+ background: rgba(24, 144, 255, 0.1);
35
+ }
36
+ }
37
+
38
+ // 禁用状态
39
+ .pisell-checkbox-item-disabled {
40
+ .time-resource-card {
41
+ cursor: not-allowed;
42
+ opacity: 0.5;
43
+
44
+ &:hover {
45
+ box-shadow: none;
46
+ }
47
+ }
48
+ }
49
+
50
+ // 错误提示
51
+ .time-resource-error {
52
+ color: #ff4d4f;
53
+ padding: 8px 0;
54
+ text-align: center;
55
+ background-color: #fff2f0;
56
+ border-radius: 4px;
57
+ margin-bottom: 16px;
58
+ }
59
+ }
@@ -53,9 +53,6 @@ var CardPro = (props) => {
53
53
  coverHeight,
54
54
  badge
55
55
  } = props;
56
- (0, import_react.useEffect)(() => {
57
- document.body.id = "body";
58
- }, []);
59
56
  return /* @__PURE__ */ import_react.default.createElement(
60
57
  import_antd.Card,
61
58
  {
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(iconfont_exports);
35
35
  var import_icons = require("@ant-design/icons");
36
36
  var import_react = __toESM(require("react"));
37
37
  var MyIcon = (0, import_icons.createFromIconfontCN)({
38
- scriptUrl: "https://static.pisellcdn.com/pisell2iconfont.js"
38
+ scriptUrl: "https://static.pisellcdn.com/pisell2/iconfont_1.0.js"
39
39
  // 在 iconfont.cn 上生成
40
40
  });
41
41
  var IconFont = (props) => {
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ export interface Option {
4
+ id: string | number;
5
+ name: React.ReactNode;
6
+ }
7
+ export interface PisellAnchorProps {
8
+ options?: Option[];
9
+ tab?: string | number;
10
+ className?: string;
11
+ style?: React.CSSProperties;
12
+ onChange?: (key: string | number) => void;
13
+ }
14
+ declare const PisellAnchor: React.ForwardRefExoticComponent<PisellAnchorProps & React.RefAttributes<any>>;
15
+ export default PisellAnchor;
@@ -0,0 +1,120 @@
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/pisellAnchor/index.tsx
30
+ var pisellAnchor_exports = {};
31
+ __export(pisellAnchor_exports, {
32
+ default: () => pisellAnchor_default
33
+ });
34
+ module.exports = __toCommonJS(pisellAnchor_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 PisellAnchor = (0, import_react.forwardRef)((props, ref) => {
42
+ const { options = [], tab, className, style, onChange } = props;
43
+ const contentRef = (0, import_react.useRef)(null);
44
+ const [isShowButton, setIsShowButton] = (0, import_react.useState)(true);
45
+ const [leftWidth, setLeftWidth] = (0, import_react.useState)(0);
46
+ const [rightWidth, setRightWidth] = (0, import_react.useState)(40);
47
+ const { run: onScroll } = (0, import_ahooks.useDebounceFn)(
48
+ (e) => {
49
+ const { scrollLeft, scrollWidth, clientWidth } = e.target;
50
+ setLeftWidth(scrollLeft > 0 ? 40 : 0);
51
+ setRightWidth(scrollLeft + clientWidth >= scrollWidth ? 0 : 40);
52
+ },
53
+ { wait: 200 }
54
+ );
55
+ const setTabScroll = (offsetLeft) => {
56
+ if (contentRef.current) {
57
+ contentRef.current.scrollTo({
58
+ left: offsetLeft,
59
+ behavior: "smooth"
60
+ });
61
+ }
62
+ };
63
+ (0, import_react.useImperativeHandle)(ref, () => ({
64
+ scroll: (tab2) => {
65
+ if (tab2) {
66
+ const dom = document.querySelector(`#tab-${tab2}`);
67
+ if (dom) {
68
+ setTabScroll(dom.offsetLeft);
69
+ }
70
+ }
71
+ }
72
+ }));
73
+ const onPageChange = (type) => {
74
+ if (contentRef.current) {
75
+ const { scrollLeft, clientWidth } = contentRef.current;
76
+ contentRef.current.scrollTo({
77
+ left: scrollLeft + (type === "left" ? -clientWidth : clientWidth),
78
+ behavior: "smooth"
79
+ });
80
+ }
81
+ };
82
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-tabs", className), style }, /* @__PURE__ */ import_react.default.createElement(
83
+ "div",
84
+ {
85
+ className: "pisell-tabs-btn-left",
86
+ style: { width: leftWidth },
87
+ onClick: () => onPageChange("left")
88
+ },
89
+ /* @__PURE__ */ import_react.default.createElement(import_ChevronLeft.default, { className: "pisell-tabs-btn-icon" })
90
+ ), /* @__PURE__ */ import_react.default.createElement(
91
+ "div",
92
+ {
93
+ ref: contentRef,
94
+ className: "pisell-tabs-content",
95
+ id: `tab-${tab}-content`,
96
+ onScroll
97
+ },
98
+ options.map((item) => /* @__PURE__ */ import_react.default.createElement(
99
+ "div",
100
+ {
101
+ key: item.id,
102
+ id: `tab-${item.id}`,
103
+ className: (0, import_classnames.default)("pisell-tabs-tab", {
104
+ "pisell-tabs-tab-active": tab === item.id
105
+ }),
106
+ onClick: () => onChange == null ? void 0 : onChange(item.id)
107
+ },
108
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-tabs-tab-content" }, item.name)
109
+ ))
110
+ ), /* @__PURE__ */ import_react.default.createElement(
111
+ "div",
112
+ {
113
+ className: "pisell-tabs-btn-right",
114
+ style: { width: rightWidth },
115
+ onClick: () => onPageChange("right")
116
+ },
117
+ /* @__PURE__ */ import_react.default.createElement(import_ChevronRight.default, { className: "pisell-tabs-btn-icon" })
118
+ ));
119
+ });
120
+ var pisellAnchor_default = PisellAnchor;