@pisell/materials 1.0.485 → 1.0.487

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 (61) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +16 -16
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +17 -17
  11. package/es/components/badge/index.d.ts +8 -0
  12. package/es/components/badge/index.js +44 -0
  13. package/es/components/badge/index.less +2 -0
  14. package/es/components/pisellCard/index.d.ts +7 -5
  15. package/es/components/pisellCard/index.js +2 -3
  16. package/es/components/pisellEmpty/index.d.ts +1 -1
  17. package/es/components/pisellInformationEntry/Input/index.d.ts +0 -1
  18. package/es/components/pisellInformationEntry/Input/index.js +2 -3
  19. package/es/components/pisellInformationEntry/index.d.ts +0 -2
  20. package/es/components/pisellInformationEntry/index.js +2 -5
  21. package/es/components/pisellQrcode/index.js +3 -2
  22. package/es/components/pisellWalletPassCard/index.d.ts +1 -1
  23. package/es/components/pisellWalletPassCard/index.js +1 -1
  24. package/es/components/pisellWalletPassCard/index.less +3 -1
  25. package/es/components/record-view/index.js +5 -4
  26. package/es/components/tabs/index.js +3 -1
  27. package/es/index.d.ts +1 -1
  28. package/es/index.js +4 -1
  29. package/es/locales/en-US.d.ts +2 -0
  30. package/es/locales/en-US.js +4 -1
  31. package/es/locales/zh-CN.d.ts +2 -0
  32. package/es/locales/zh-CN.js +4 -1
  33. package/es/locales/zh-TW.d.ts +2 -0
  34. package/es/locales/zh-TW.js +4 -1
  35. package/lib/components/badge/index.d.ts +8 -0
  36. package/lib/components/badge/index.js +70 -0
  37. package/lib/components/badge/index.less +2 -0
  38. package/lib/components/pisellCard/index.d.ts +7 -5
  39. package/lib/components/pisellCard/index.js +2 -7
  40. package/lib/components/pisellEmpty/index.d.ts +1 -1
  41. package/lib/components/pisellInformationEntry/Input/index.d.ts +0 -1
  42. package/lib/components/pisellInformationEntry/Input/index.js +2 -2
  43. package/lib/components/pisellInformationEntry/index.d.ts +0 -2
  44. package/lib/components/pisellInformationEntry/index.js +2 -10
  45. package/lib/components/pisellQrcode/index.js +3 -2
  46. package/lib/components/pisellWalletPassCard/index.d.ts +1 -1
  47. package/lib/components/pisellWalletPassCard/index.js +1 -1
  48. package/lib/components/pisellWalletPassCard/index.less +3 -1
  49. package/lib/components/record-view/index.js +3 -3
  50. package/lib/components/tabs/index.js +2 -1
  51. package/lib/index.d.ts +1 -1
  52. package/lib/index.js +36 -36
  53. package/lib/locales/en-US.d.ts +2 -0
  54. package/lib/locales/en-US.js +4 -1
  55. package/lib/locales/zh-CN.d.ts +2 -0
  56. package/lib/locales/zh-CN.js +4 -1
  57. package/lib/locales/zh-TW.d.ts +2 -0
  58. package/lib/locales/zh-TW.js +4 -1
  59. package/lowcode/badge/meta.ts +10 -1
  60. package/lowcode/badge/snippets.ts +2 -0
  61. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { BadgeProps as OriginalBadgeprops } from 'antd';
3
+ import './index.less';
4
+ export interface Badgeprops extends OriginalBadgeprops {
5
+ styleType: 'default' | 'warning';
6
+ }
7
+ declare const Badge: (props: any) => React.JSX.Element;
8
+ export default Badge;
@@ -0,0 +1,44 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ import React, { useEffect } from 'react';
9
+ import { Badge as OriginalBadge } from 'antd';
10
+ import { withWrap } from "../../utils/hoc";
11
+ import "./index.less";
12
+ // @ts-ignore
13
+
14
+ var Badge = withWrap(function (props) {
15
+ var _props$styleType = props.styleType,
16
+ styleType = _props$styleType === void 0 ? '' : _props$styleType,
17
+ _props$color = props.color,
18
+ color = _props$color === void 0 ? '' : _props$color;
19
+ var state = props;
20
+ useEffect(function () {
21
+ document.body.id = 'body';
22
+ }, []);
23
+ var formatColor = function formatColor() {
24
+ var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
25
+ var newColor = color;
26
+ if (styleType === 'default') {
27
+ newColor = '#f6f7f9';
28
+ } else if (styleType === 'warning') {
29
+ newColor = '#D92D20';
30
+ }
31
+ return newColor;
32
+ };
33
+ var BadgeProps = _objectSpread(_objectSpread({}, state), {}, {
34
+ className: 'pisell-badge-wrap',
35
+ color: formatColor(color)
36
+ });
37
+ return /*#__PURE__*/React.createElement(OriginalBadge, _extends({}, BadgeProps, {
38
+ style: {
39
+ borderColor: styleType === 'default' ? '#e7e9ed' : state.color,
40
+ color: styleType === 'default' ? '#344054' : '#fff'
41
+ }
42
+ }));
43
+ });
44
+ export default Badge;
@@ -0,0 +1,2 @@
1
+ .pisell-badge-wrap {
2
+ }
@@ -2,11 +2,13 @@ import React from 'react';
2
2
  import { CardProps } from 'antd';
3
3
  import './index.less';
4
4
  export interface PisellCardProps extends CardProps {
5
- bordered: boolean;
6
- selected: boolean;
7
- loading: boolean;
8
- padding: number;
9
- borderRadius: number;
5
+ bordered?: boolean;
6
+ selected?: boolean;
7
+ loading?: boolean;
8
+ padding?: number;
9
+ borderRadius?: number;
10
+ disabled?: boolean;
11
+ onClick?: () => void;
10
12
  }
11
13
  /**
12
14
  * Pisell 卡片容器组件
@@ -28,17 +28,16 @@ var PisellCard = function PisellCard(props) {
28
28
  disabled = _props$disabled === void 0 ? false : _props$disabled,
29
29
  style = props.style,
30
30
  className = props.className;
31
- console.log('%c [ props ]-30', 'font-size:13px; background:pink; color:#bf2c9f;', props);
32
31
  useEffect(function () {
33
32
  document.body.id = 'body';
34
33
  }, []);
35
- var cardProps = _objectSpread({
34
+ var cardProps = _objectSpread(_objectSpread({}, props), {}, {
36
35
  style: _objectSpread({
37
36
  '--card-padding': "".concat(padding, "px"),
38
37
  '--card-borderRadius': "".concat(borderRadius, "px")
39
38
  }, style),
40
39
  className: classNames('pisell-card-wrap', selected && 'pisell-card-wrap-selected', disabled && 'pisell-card-wrap-disabled', className)
41
- }, props);
40
+ });
42
41
  return /*#__PURE__*/React.createElement(Card, cardProps);
43
42
  };
44
43
  export default PisellCard;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EmptyProps } from 'antd';
3
- import { PisellContextType } from "../pisell-config-provider/context";
3
+ import { PisellContextType } from '../pisell-config-provider/context';
4
4
  import './index.less';
5
5
  export interface PisellEmptyProps extends EmptyProps {
6
6
  /** 平台 */
@@ -3,7 +3,6 @@ import './index.less';
3
3
  export interface PisellEntryInputProps {
4
4
  onChange: (val: string) => void;
5
5
  searchDescribe?: React.ReactNode;
6
- isBlurSearch?: boolean;
7
6
  }
8
7
  declare const PisellEntryInput: (props: PisellEntryInputProps) => React.JSX.Element;
9
8
  export default PisellEntryInput;
@@ -12,8 +12,7 @@ import "./index.less";
12
12
  import { getText } from "../../../locales";
13
13
  var PisellEntryInput = function PisellEntryInput(props) {
14
14
  var _onChange = props.onChange,
15
- searchDescribe = props.searchDescribe,
16
- isBlurSearch = props.isBlurSearch;
15
+ searchDescribe = props.searchDescribe;
17
16
  var _useState = useState(''),
18
17
  _useState2 = _slicedToArray(_useState, 2),
19
18
  value = _useState2[0],
@@ -50,7 +49,7 @@ var PisellEntryInput = function PisellEntryInput(props) {
50
49
  return _onChange(value);
51
50
  },
52
51
  disabled: !value
53
- }, isBlurSearch ? getText('pisell-information-entry-input-confirm') : getText('pisell-information-entry-input-search'))), /*#__PURE__*/React.createElement("div", {
52
+ }, getText('pisell-information-entry-input-search'))), /*#__PURE__*/React.createElement("div", {
54
53
  className: "pisell-entry-input-describe"
55
54
  }, searchDescribe));
56
55
  };
@@ -26,8 +26,6 @@ export interface PisellInformationEntryProps extends Omit<React.HTMLAttributes<H
26
26
  searchDescribe?: React.ReactNode;
27
27
  /** 录入信息值改变 */
28
28
  onChange?: (val: string) => void;
29
- /** 是否支持模糊搜索 在启用了手动录入的前提下 */
30
- isBlurSearch: boolean;
31
29
  }
32
30
  declare const PisellInformationEntry: (props: PisellInformationEntryProps) => React.JSX.Element;
33
31
  export default PisellInformationEntry;
@@ -38,9 +38,7 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
38
38
  _props$entryModes = props.entryModes,
39
39
  entryModes = _props$entryModes === void 0 ? [] : _props$entryModes,
40
40
  searchDescribe = props.searchDescribe,
41
- onChange = props.onChange,
42
- _props$isBlurSearch = props.isBlurSearch,
43
- isBlurSearch = _props$isBlurSearch === void 0 ? false : _props$isBlurSearch;
41
+ onChange = props.onChange;
44
42
  var config = usePisellConfig();
45
43
  var platform = config.platform;
46
44
  var _useState = useState(null),
@@ -201,8 +199,7 @@ var PisellInformationEntry = function PisellInformationEntry(props) {
201
199
  }
202
200
  }), currentType === 'input' && /*#__PURE__*/React.createElement(Input, {
203
201
  onChange: handleChange,
204
- searchDescribe: searchDescribe,
205
- isBlurSearch: isBlurSearch
202
+ searchDescribe: searchDescribe
206
203
  })));
207
204
  };
208
205
  export default PisellInformationEntry;
@@ -8,6 +8,7 @@ import React, { useEffect, useState, useRef } from 'react';
8
8
  import { QRCode, Button, Divider } from 'antd';
9
9
  import classNames from 'classnames';
10
10
  import PisellModal from "./../pisellModal";
11
+ import { getText } from "../../locales/index";
11
12
  import "./index.less";
12
13
  var PisellQrcode = function PisellQrcode(props) {
13
14
  var size = props.size,
@@ -26,7 +27,7 @@ var PisellQrcode = function PisellQrcode(props) {
26
27
  if (open) {}
27
28
  }, [open]);
28
29
  var modalProps = {
29
- title: 'QR code',
30
+ title: getText('pisellQrcode-qrcode'),
30
31
  platform: platform,
31
32
  onCancel: function onCancel() {
32
33
  return setOpen(false);
@@ -63,6 +64,6 @@ var PisellQrcode = function PisellQrcode(props) {
63
64
  return setOpen(false);
64
65
  },
65
66
  className: classNames('pisell-qrcode-modal-button')
66
- }, "Done")));
67
+ }, getText('pisellQrcode-done'))));
67
68
  };
68
69
  export default PisellQrcode;
@@ -9,7 +9,7 @@ export interface PisellWalletPassCardProps {
9
9
  /** 共享店铺名称 */
10
10
  storeName: string;
11
11
  /** 余额 */
12
- balance: number;
12
+ balance?: number;
13
13
  /** 识别码编号 */
14
14
  code: string;
15
15
  /** 有效期 */
@@ -106,7 +106,7 @@ var PisellWalletPassCard = function PisellWalletPassCard(props) {
106
106
  className: "pisell-card-code-wrap"
107
107
  }, /*#__PURE__*/React.createElement("div", {
108
108
  className: "pisell-card-code"
109
- }, showCode && /*#__PURE__*/React.createElement("div", null, code), showValidDate && /*#__PURE__*/React.createElement("div", null, getText('pisell-wallet-pass-card-valid-to'), " ", validDate)), showQrCode && /*#__PURE__*/React.createElement("div", {
109
+ }, showCode && /*#__PURE__*/React.createElement("div", null, code), showValidDate && /*#__PURE__*/React.createElement("div", null, getText('pisell-wallet-pass-card-valid-to'), ' ', !!validDate ? validDate : '长期')), showQrCode && /*#__PURE__*/React.createElement("div", {
110
110
  className: "pisell-card-qr-code"
111
111
  }, /*#__PURE__*/React.createElement(PisellQrcode, {
112
112
  value: qrCode,
@@ -9,11 +9,13 @@
9
9
  background-size: cover;
10
10
  height: 190px;
11
11
  background-position: center center;
12
- border-width: 2px;
12
+ border-width: 1px;
13
13
  border-style: solid;
14
14
  border-color: var(--Gray-300, #d0d5dd);
15
15
  cursor: pointer;
16
+ box-sizing: border-box;
16
17
  &.pisell-card-active {
18
+ border-width: 2px;
17
19
  border-color: var(--theme-color, #7f56d9);
18
20
  }
19
21
  .pisell-card-name-wrap {
@@ -9,11 +9,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
9
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
10
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
11
  import React, { useCallback, useMemo, useState, useEffect, forwardRef, useImperativeHandle } from 'react';
12
- import { Col, Empty, List, Row, Skeleton, Badge } from 'antd';
12
+ import { Col, List, Row, Skeleton, Badge } from 'antd';
13
13
  import { getUniqueId } from '@pisell/utils';
14
14
  import Pagination from "../Pagination";
15
15
  import { CloseOutlined } from '@ant-design/icons';
16
16
  import InfiniteScroll from 'react-infinite-scroll-component';
17
+ import PisellEmpty from "./../pisellEmpty";
17
18
  import { useResponsive } from "../../hooks";
18
19
  import "./index.less";
19
20
  var prefix = 'pisell-lowcode-';
@@ -104,9 +105,9 @@ var RecordView = function RecordView(props, ref) {
104
105
  if (dataSource.length > 0) {
105
106
  return null;
106
107
  }
107
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Empty, {
108
- description: locale === null || locale === void 0 ? void 0 : locale.emptyText,
109
- image: Empty.PRESENTED_IMAGE_SIMPLE
108
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellEmpty, {
109
+ description: locale === null || locale === void 0 ? void 0 : locale.emptyText
110
+ // image={Empty.PRESENTED_IMAGE_SIMPLE}
110
111
  }));
111
112
  }, [props.dataSource, locale, emptyButtons]);
112
113
  var scrollListId = useMemo(function () {
@@ -19,8 +19,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
19
19
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
20
20
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
21
21
  import React, { Component } from 'react';
22
- import { Badge, Tabs as OriginalTabs } from 'antd';
22
+ import { Tabs as OriginalTabs } from 'antd';
23
23
  import { warning } from "../../utils/warning";
24
+ import Badge from "./../badge";
24
25
  import classNames from 'classnames';
25
26
  import "./index.less";
26
27
  var prefix = 'pisell-lowcode-';
@@ -138,6 +139,7 @@ var Tabs = /*#__PURE__*/function (_Component) {
138
139
  margin: '0 9px'
139
140
  }
140
141
  }, /*#__PURE__*/React.createElement(Badge, {
142
+ styleType: "default",
141
143
  count: item.badge,
142
144
  offset: [18, 10]
143
145
  }, /*#__PURE__*/React.createElement("span", {
package/es/index.d.ts CHANGED
@@ -2,7 +2,6 @@ export { Affix } from 'antd';
2
2
  export { Anchor } from 'antd';
3
3
  export { Alert } from 'antd';
4
4
  export { Avatar } from 'antd';
5
- export { Badge } from 'antd';
6
5
  export { Breadcrumb } from 'antd';
7
6
  export { Card } from 'antd';
8
7
  export { Carousel } from 'antd';
@@ -35,6 +34,7 @@ export { Tag } from 'antd';
35
34
  export { Timeline } from 'antd';
36
35
  export { Tooltip } from 'antd';
37
36
  export { version } from 'antd';
37
+ export { default as Badge } from './components/badge';
38
38
  export { default as Typography } from './components/typography';
39
39
  export { default as ButtonGroupEdit } from './components/buttonGroupEdit';
40
40
  export { default as ButtonGroupPreview } from './components/buttonGroupPreview';
package/es/index.js CHANGED
@@ -2,7 +2,9 @@ export { Affix } from 'antd';
2
2
  export { Anchor } from 'antd';
3
3
  export { Alert } from 'antd';
4
4
  export { Avatar } from 'antd';
5
- export { Badge } from 'antd';
5
+
6
+ // export { Badge } from 'antd';
7
+
6
8
  export { Breadcrumb } from 'antd';
7
9
  export { Card } from 'antd';
8
10
 
@@ -60,6 +62,7 @@ export { Tag } from 'antd';
60
62
  export { Timeline } from 'antd';
61
63
  export { Tooltip } from 'antd';
62
64
  export { version } from 'antd';
65
+ export { default as Badge } from "./components/badge";
63
66
  export { default as Typography } from "./components/typography";
64
67
  export { default as ButtonGroupEdit } from "./components/buttonGroupEdit";
65
68
  export { default as ButtonGroupPreview } from "./components/buttonGroupPreview";
@@ -155,5 +155,7 @@ declare const _default: {
155
155
  'walletCard-rechargeable': string;
156
156
  'walletCard-voucher': string;
157
157
  'walletCard-discount': string;
158
+ 'pisellQrcode-done': string;
159
+ 'pisellQrcode-qrcode': string;
158
160
  };
159
161
  export default _default;
@@ -199,5 +199,8 @@ export default {
199
199
  'walletCard-points': 'Points',
200
200
  'walletCard-rechargeable': 'Recharge',
201
201
  'walletCard-voucher': 'Voucher',
202
- 'walletCard-discount': 'Discount'
202
+ 'walletCard-discount': 'Discount',
203
+ //PisellQrcode组件
204
+ 'pisellQrcode-done': 'Done',
205
+ 'pisellQrcode-qrcode': 'QR code'
203
206
  };
@@ -155,5 +155,7 @@ declare const _default: {
155
155
  'walletCard-rechargeable': string;
156
156
  'walletCard-voucher': string;
157
157
  'walletCard-discount': string;
158
+ 'pisellQrcode-done': string;
159
+ 'pisellQrcode-qrcode': string;
158
160
  };
159
161
  export default _default;
@@ -198,5 +198,8 @@ export default {
198
198
  'walletCard-points': '积分卡',
199
199
  'walletCard-rechargeable': '充值卡',
200
200
  'walletCard-voucher': '代金券',
201
- 'walletCard-discount': '折扣卡'
201
+ 'walletCard-discount': '折扣卡',
202
+ //PisellQrcode组件
203
+ 'pisellQrcode-done': '完成',
204
+ 'pisellQrcode-qrcode': '二维码'
202
205
  };
@@ -155,5 +155,7 @@ declare const _default: {
155
155
  'walletCard-rechargeable': string;
156
156
  'walletCard-voucher': string;
157
157
  'walletCard-discount': string;
158
+ 'pisellQrcode-done': string;
159
+ 'pisellQrcode-qrcode': string;
158
160
  };
159
161
  export default _default;
@@ -199,5 +199,8 @@ export default {
199
199
  'walletCard-points': '積分卡',
200
200
  'walletCard-rechargeable': '充值卡',
201
201
  'walletCard-voucher': '代金券',
202
- 'walletCard-discount': '折扣卡'
202
+ 'walletCard-discount': '折扣卡',
203
+ //PisellQrcode组件
204
+ 'pisellQrcode-done': '完成',
205
+ 'pisellQrcode-qrcode': '二維碼'
203
206
  };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { BadgeProps as OriginalBadgeprops } from 'antd';
3
+ import './index.less';
4
+ export interface Badgeprops extends OriginalBadgeprops {
5
+ styleType: 'default' | 'warning';
6
+ }
7
+ declare const Badge: (props: any) => React.JSX.Element;
8
+ export default Badge;
@@ -0,0 +1,70 @@
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/badge/index.tsx
30
+ var badge_exports = {};
31
+ __export(badge_exports, {
32
+ default: () => badge_default
33
+ });
34
+ module.exports = __toCommonJS(badge_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_hoc = require("../../utils/hoc");
38
+ var import_index = require("./index.less");
39
+ var Badge = (0, import_hoc.withWrap)((props) => {
40
+ const { styleType = "", color = "" } = props;
41
+ let state = props;
42
+ (0, import_react.useEffect)(() => {
43
+ document.body.id = "body";
44
+ }, []);
45
+ const formatColor = (color2 = "") => {
46
+ let newColor = color2;
47
+ if (styleType === "default") {
48
+ newColor = "#f6f7f9";
49
+ } else if (styleType === "warning") {
50
+ newColor = "#D92D20";
51
+ }
52
+ return newColor;
53
+ };
54
+ const BadgeProps = {
55
+ ...state,
56
+ className: "pisell-badge-wrap",
57
+ color: formatColor(color)
58
+ };
59
+ return /* @__PURE__ */ import_react.default.createElement(
60
+ import_antd.Badge,
61
+ {
62
+ ...BadgeProps,
63
+ style: {
64
+ borderColor: styleType === "default" ? "#e7e9ed" : state.color,
65
+ color: styleType === "default" ? "#344054" : "#fff"
66
+ }
67
+ }
68
+ );
69
+ });
70
+ var badge_default = Badge;
@@ -0,0 +1,2 @@
1
+ .pisell-badge-wrap {
2
+ }
@@ -2,11 +2,13 @@ import React from 'react';
2
2
  import { CardProps } from 'antd';
3
3
  import './index.less';
4
4
  export interface PisellCardProps extends CardProps {
5
- bordered: boolean;
6
- selected: boolean;
7
- loading: boolean;
8
- padding: number;
9
- borderRadius: number;
5
+ bordered?: boolean;
6
+ selected?: boolean;
7
+ loading?: boolean;
8
+ padding?: number;
9
+ borderRadius?: number;
10
+ disabled?: boolean;
11
+ onClick?: () => void;
10
12
  }
11
13
  /**
12
14
  * Pisell 卡片容器组件
@@ -47,15 +47,11 @@ var PisellCard = (props) => {
47
47
  style,
48
48
  className
49
49
  } = props;
50
- console.log(
51
- "%c [ props ]-30",
52
- "font-size:13px; background:pink; color:#bf2c9f;",
53
- props
54
- );
55
50
  (0, import_react.useEffect)(() => {
56
51
  document.body.id = "body";
57
52
  }, []);
58
53
  const cardProps = {
54
+ ...props,
59
55
  style: {
60
56
  "--card-padding": `${padding}px`,
61
57
  "--card-borderRadius": `${borderRadius}px`,
@@ -66,8 +62,7 @@ var PisellCard = (props) => {
66
62
  selected && "pisell-card-wrap-selected",
67
63
  disabled && "pisell-card-wrap-disabled",
68
64
  className
69
- ),
70
- ...props
65
+ )
71
66
  };
72
67
  return /* @__PURE__ */ import_react.default.createElement(import_antd.Card, { ...cardProps });
73
68
  };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { EmptyProps } from 'antd';
3
- import { PisellContextType } from "../pisell-config-provider/context";
3
+ import { PisellContextType } from '../pisell-config-provider/context';
4
4
  import './index.less';
5
5
  export interface PisellEmptyProps extends EmptyProps {
6
6
  /** 平台 */
@@ -3,7 +3,6 @@ import './index.less';
3
3
  export interface PisellEntryInputProps {
4
4
  onChange: (val: string) => void;
5
5
  searchDescribe?: React.ReactNode;
6
- isBlurSearch?: boolean;
7
6
  }
8
7
  declare const PisellEntryInput: (props: PisellEntryInputProps) => React.JSX.Element;
9
8
  export default PisellEntryInput;
@@ -39,7 +39,7 @@ var import_iconfont = __toESM(require("../../iconfont"));
39
39
  var import_index = require("./index.less");
40
40
  var import_locales = require("../../../locales");
41
41
  var PisellEntryInput = (props) => {
42
- const { onChange, searchDescribe, isBlurSearch } = props;
42
+ const { onChange, searchDescribe } = props;
43
43
  const [value, setValue] = (0, import_react.useState)("");
44
44
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-entry-input-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-entry-input-line" }, /* @__PURE__ */ import_react.default.createElement(
45
45
  import_pisellInput.default,
@@ -59,6 +59,6 @@ var PisellEntryInput = (props) => {
59
59
  prefix: /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { style: { color: "#667085" }, type: "pisell2-search-lg" }),
60
60
  allowClear: true
61
61
  }
62
- ), /* @__PURE__ */ import_react.default.createElement(import_button.default, { size: "large", onClick: () => onChange(value), disabled: !value }, isBlurSearch ? (0, import_locales.getText)("pisell-information-entry-input-confirm") : (0, import_locales.getText)("pisell-information-entry-input-search"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-entry-input-describe" }, searchDescribe));
62
+ ), /* @__PURE__ */ import_react.default.createElement(import_button.default, { size: "large", onClick: () => onChange(value), disabled: !value }, (0, import_locales.getText)("pisell-information-entry-input-search"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-entry-input-describe" }, searchDescribe));
63
63
  };
64
64
  var Input_default = PisellEntryInput;
@@ -26,8 +26,6 @@ export interface PisellInformationEntryProps extends Omit<React.HTMLAttributes<H
26
26
  searchDescribe?: React.ReactNode;
27
27
  /** 录入信息值改变 */
28
28
  onChange?: (val: string) => void;
29
- /** 是否支持模糊搜索 在启用了手动录入的前提下 */
30
- isBlurSearch: boolean;
31
29
  }
32
30
  declare const PisellInformationEntry: (props: PisellInformationEntryProps) => React.JSX.Element;
33
31
  export default PisellInformationEntry;
@@ -54,8 +54,7 @@ var PisellInformationEntry = (props) => {
54
54
  title,
55
55
  entryModes = [],
56
56
  searchDescribe,
57
- onChange,
58
- isBlurSearch = false
57
+ onChange
59
58
  } = props;
60
59
  const config = (0, import_usePisellConfig.default)();
61
60
  const { platform } = config;
@@ -168,13 +167,6 @@ var PisellInformationEntry = (props) => {
168
167
  },
169
168
  item.name || detail.text
170
169
  );
171
- })), /* @__PURE__ */ import_react.default.createElement("div", null, currentType === "scanCode" && /* @__PURE__ */ import_react.default.createElement(import_Scan.default, { onChange: handleChange, onCancel: () => setCurrentType(null) }), currentType === "input" && /* @__PURE__ */ import_react.default.createElement(
172
- import_Input.default,
173
- {
174
- onChange: handleChange,
175
- searchDescribe,
176
- isBlurSearch
177
- }
178
- )));
170
+ })), /* @__PURE__ */ import_react.default.createElement("div", null, currentType === "scanCode" && /* @__PURE__ */ import_react.default.createElement(import_Scan.default, { onChange: handleChange, onCancel: () => setCurrentType(null) }), currentType === "input" && /* @__PURE__ */ import_react.default.createElement(import_Input.default, { onChange: handleChange, searchDescribe })));
179
171
  };
180
172
  var pisellInformationEntry_default = PisellInformationEntry;
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_classnames = __toESM(require("classnames"));
38
38
  var import_pisellModal = __toESM(require("./../pisellModal"));
39
+ var import_locales = require("../../locales/index");
39
40
  var import_index = require("./index.less");
40
41
  var PisellQrcode = (props) => {
41
42
  const { size, platform, value = "" } = props;
@@ -49,7 +50,7 @@ var PisellQrcode = (props) => {
49
50
  }
50
51
  }, [open]);
51
52
  const modalProps = {
52
- title: "QR code",
53
+ title: (0, import_locales.getText)("pisellQrcode-qrcode"),
53
54
  platform,
54
55
  onCancel: () => setOpen(false),
55
56
  open,
@@ -75,7 +76,7 @@ var PisellQrcode = (props) => {
75
76
  onClick: () => setOpen(false),
76
77
  className: (0, import_classnames.default)("pisell-qrcode-modal-button")
77
78
  },
78
- "Done"
79
+ (0, import_locales.getText)("pisellQrcode-done")
79
80
  )));
80
81
  };
81
82
  var pisellQrcode_default = PisellQrcode;
@@ -9,7 +9,7 @@ export interface PisellWalletPassCardProps {
9
9
  /** 共享店铺名称 */
10
10
  storeName: string;
11
11
  /** 余额 */
12
- balance: number;
12
+ balance?: number;
13
13
  /** 识别码编号 */
14
14
  code: string;
15
15
  /** 有效期 */
@@ -106,7 +106,7 @@ var PisellWalletPassCard = (props) => {
106
106
  showCurrencySymbol: showBalanceSymbol
107
107
  }
108
108
  )), showDiscount && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-label" }, (0, import_locales.getText)("pisell-discount-card-title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-amount-item-value" }, discount, "% ", (0, import_locales.getText)("pisell-discount-card-unit")))),
109
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code" }, showCode && /* @__PURE__ */ import_react.default.createElement("div", null, code), showValidDate && /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("pisell-wallet-pass-card-valid-to"), " ", validDate)), showQrCode && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-qr-code" }, /* @__PURE__ */ import_react.default.createElement(import_pisellQrcode.default, { value: qrCode, size: 60 }))),
109
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-code" }, showCode && /* @__PURE__ */ import_react.default.createElement("div", null, code), showValidDate && /* @__PURE__ */ import_react.default.createElement("div", null, (0, import_locales.getText)("pisell-wallet-pass-card-valid-to"), " ", !!validDate ? validDate : "长期")), showQrCode && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-qr-code" }, /* @__PURE__ */ import_react.default.createElement(import_pisellQrcode.default, { value: qrCode, size: 60 }))),
110
110
  (disabled || disabledReason) && showDisabledReason && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-card-warn-message" }, /* @__PURE__ */ import_react.default.createElement(import_iconfont.default, { className: "pisell-card-icon", type: "pisell2-alert-circle" }), /* @__PURE__ */ import_react.default.createElement("span", null, disabledReason))
111
111
  );
112
112
  };