@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +22 -54
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +22 -54
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/TimeResourceSelector/index.d.ts +21 -0
- package/es/components/TimeResourceSelector/index.js +115 -0
- package/es/components/TimeResourceSelector/index.less +59 -0
- package/es/components/cardPro/index.js +1 -4
- package/es/components/iconfont/index.js +1 -1
- package/es/components/pisellAnchor/index.d.ts +15 -0
- package/es/components/pisellAnchor/index.js +126 -0
- package/es/components/pisellAnchor/index.less +177 -0
- package/es/components/pisellAvatar/index.d.ts +19 -0
- package/es/components/pisellAvatar/index.js +90 -0
- package/es/components/pisellAvatar/index.less +26 -0
- package/es/components/pisellCard/index.d.ts +8 -0
- package/es/components/pisellCard/index.js +34 -5
- package/es/components/pisellCard/index.less +31 -4
- package/es/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/es/components/pisellCustomCheckboxGroup/index.js +72 -0
- package/es/components/pisellCustomCheckboxGroup/index.less +0 -0
- package/es/components/pisellDropdown/index.d.ts +20 -0
- package/es/components/pisellDropdown/index.js +51 -0
- package/es/components/pisellDropdown/index.less +44 -0
- package/es/components/pisellEmpty/index.d.ts +2 -1
- package/es/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/es/components/pisellHeaderProgressBar/index.js +76 -0
- package/es/components/pisellHeaderProgressBar/index.less +18 -0
- package/es/components/pisellImageCarousels/index.d.ts +18 -0
- package/es/components/pisellImageCarousels/index.js +108 -0
- package/es/components/pisellImageCarousels/index.less +92 -0
- package/es/components/pisellList01/index.d.ts +17 -0
- package/es/components/pisellList01/index.js +105 -0
- package/es/components/pisellList01/index.less +53 -0
- package/es/components/pisellModal/components/PcModal/index.js +1 -1
- package/es/components/pisellSectionHeaders/index.d.ts +21 -0
- package/es/components/pisellSectionHeaders/index.js +35 -0
- package/es/components/pisellSectionHeaders/index.less +46 -0
- package/es/components/pisellText/components/Amount/index.js +1 -1
- package/es/components/pisellViewGrid/index.d.ts +16 -0
- package/es/components/pisellViewGrid/index.js +66 -0
- package/es/components/pisellViewGrid/index.less +31 -0
- package/es/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
- package/es/components/productCard/components/Header/DeleteButton/index.js +21 -0
- package/es/components/productCard/components/Header/DeleteButton/index.less +15 -0
- package/es/components/productCard/components/Header/index.js +6 -15
- package/es/components/productCard/components/Header/index.less +0 -11
- package/es/components/productCard/hooks/useOpenNote.js +3 -2
- package/es/components/productCard/index.js +18 -5
- package/es/components/productCard/index.less +30 -2
- package/es/components/productCard/status.js +3 -1
- package/es/components/productCard/types.d.ts +2 -0
- package/es/components/productCard/utils.js +17 -1
- package/es/components/section-footers/index.d.ts +9 -0
- package/es/components/section-footers/index.js +17 -0
- package/es/components/section-footers/index.less +5 -0
- package/es/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/es/components/table/Actions/component/ExportImport/utils/index.js +11 -0
- package/es/index.d.ts +10 -0
- package/es/index.js +10 -0
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/TimeResourceSelector/index.d.ts +21 -0
- package/lib/components/TimeResourceSelector/index.js +109 -0
- package/lib/components/TimeResourceSelector/index.less +59 -0
- package/lib/components/cardPro/index.js +0 -3
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/pisellAnchor/index.d.ts +15 -0
- package/lib/components/pisellAnchor/index.js +120 -0
- package/lib/components/pisellAnchor/index.less +177 -0
- package/lib/components/pisellAvatar/index.d.ts +19 -0
- package/lib/components/pisellAvatar/index.js +108 -0
- package/lib/components/pisellAvatar/index.less +26 -0
- package/lib/components/pisellCard/index.d.ts +8 -0
- package/lib/components/pisellCard/index.js +30 -7
- package/lib/components/pisellCard/index.less +31 -4
- package/lib/components/pisellCustomCheckboxGroup/index.d.ts +16 -0
- package/lib/components/pisellCustomCheckboxGroup/index.js +71 -0
- package/lib/components/pisellCustomCheckboxGroup/index.less +0 -0
- package/lib/components/pisellDropdown/index.d.ts +20 -0
- package/lib/components/pisellDropdown/index.js +72 -0
- package/lib/components/pisellDropdown/index.less +44 -0
- package/lib/components/pisellEmpty/index.d.ts +2 -1
- package/lib/components/pisellHeaderProgressBar/index.d.ts +29 -0
- package/lib/components/pisellHeaderProgressBar/index.js +88 -0
- package/lib/components/pisellHeaderProgressBar/index.less +18 -0
- package/lib/components/pisellImageCarousels/index.d.ts +18 -0
- package/lib/components/pisellImageCarousels/index.js +108 -0
- package/lib/components/pisellImageCarousels/index.less +92 -0
- package/lib/components/pisellList01/index.d.ts +17 -0
- package/lib/components/pisellList01/index.js +113 -0
- package/lib/components/pisellList01/index.less +53 -0
- package/lib/components/pisellModal/components/PcModal/index.js +1 -1
- package/lib/components/pisellSectionHeaders/index.d.ts +21 -0
- package/lib/components/pisellSectionHeaders/index.js +52 -0
- package/lib/components/pisellSectionHeaders/index.less +46 -0
- package/lib/components/pisellText/components/Amount/index.js +2 -2
- package/lib/components/pisellViewGrid/index.d.ts +16 -0
- package/lib/components/pisellViewGrid/index.js +98 -0
- package/lib/components/pisellViewGrid/index.less +31 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.d.ts +4 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.js +53 -0
- package/lib/components/productCard/components/Header/DeleteButton/index.less +15 -0
- package/lib/components/productCard/components/Header/index.js +4 -14
- package/lib/components/productCard/components/Header/index.less +0 -11
- package/lib/components/productCard/hooks/useOpenNote.js +2 -1
- package/lib/components/productCard/index.js +94 -74
- package/lib/components/productCard/index.less +30 -2
- package/lib/components/productCard/status.js +3 -1
- package/lib/components/productCard/types.d.ts +2 -0
- package/lib/components/productCard/utils.js +15 -4
- package/lib/components/section-footers/index.d.ts +9 -0
- package/lib/components/section-footers/index.js +44 -0
- package/lib/components/section-footers/index.less +5 -0
- package/lib/components/table/Actions/component/ExportImport/utils/index.d.ts +9 -0
- package/lib/components/table/Actions/component/ExportImport/utils/index.js +31 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +30 -0
- package/lowcode/pisell-anchor/meta.ts +118 -0
- package/lowcode/pisell-anchor/snippets.ts +26 -0
- package/lowcode/pisell-avatar/__screenshots__/avatar-1.jpg +0 -0
- package/lowcode/pisell-avatar/meta.ts +111 -0
- package/lowcode/pisell-avatar/snippets.ts +14 -0
- package/lowcode/pisell-card/meta.ts +62 -27
- package/lowcode/pisell-card/snippets.ts +6 -0
- package/lowcode/pisell-custom-checkbox-group/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-custom-checkbox-group/meta.ts +204 -0
- package/lowcode/pisell-custom-checkbox-group/snippets.ts +56 -0
- package/lowcode/pisell-dropdown/__screenshots__/dropdown-1.png +0 -0
- package/lowcode/pisell-dropdown/meta.ts +180 -0
- package/lowcode/pisell-dropdown/snippets.ts +69 -0
- package/lowcode/pisell-header-progress-bar/meta.ts +116 -0
- package/lowcode/pisell-header-progress-bar/snippets.ts +24 -0
- package/lowcode/pisell-image-carousels/meta.ts +143 -0
- package/lowcode/pisell-image-carousels/snippets.ts +20 -0
- package/lowcode/pisell-list01/meta.ts +74 -0
- package/lowcode/pisell-list01/snippets.ts +35 -0
- package/lowcode/pisell-section-headers/meta.ts +91 -0
- package/lowcode/pisell-section-headers/snippets.ts +22 -0
- package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-view-grid/meta.ts +167 -0
- package/lowcode/pisell-view-grid/snippets.ts +54 -0
- package/lowcode/section-footers/meta.ts +66 -0
- package/lowcode/section-footers/snippe.ts +21 -0
- package/package.json +4 -3
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- 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
|
|
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(
|
|
84
|
-
className: classNames('pisell-lowcode-product-card', (
|
|
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:
|
|
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
|
+
}
|
|
@@ -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
|
|
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;
|
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: "
|
|
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
|
+
}
|
|
@@ -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/
|
|
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;
|