@pisell/materials 1.0.1042 → 1.0.1044

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 (80) 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/meta.js +2 -2
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +5 -5
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +5 -5
  9. package/es/components/Pagination/index.js +37 -23
  10. package/es/components/PisellCards/index.d.ts +6 -6
  11. package/es/components/calendar/index.d.ts +2 -2
  12. package/es/components/checkbox/index.d.ts +2 -2
  13. package/es/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
  14. package/es/components/dataSourceComponents/fields/Input.Password/index.d.ts +2 -2
  15. package/es/components/dataSourceComponents/fields/Input.TextArea/index.d.ts +2 -2
  16. package/es/components/dataSourceComponents/fields/Select/index.d.ts +2 -2
  17. package/es/components/dataSourceComponents/fields/Switch/index.d.ts +2 -2
  18. package/es/components/date-picker/index.d.ts +2 -2
  19. package/es/components/filter/components/FilterButton/index.js +10 -4
  20. package/es/components/filter/components/FilterButton/types.d.ts +2 -1
  21. package/es/components/input/index.d.ts +2 -2
  22. package/es/components/pisell-config-provider/context.d.ts +2 -2
  23. package/es/components/pisellBatchActionBar/PisellBatchActionBar.js +26 -21
  24. package/es/components/pisellDatePicker/index.d.ts +2 -2
  25. package/es/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
  26. package/es/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
  27. package/es/components/pisellDateTimeDisplay/utils/localeUtils.js +6 -2
  28. package/es/components/pisellFind/index.js +2 -1
  29. package/es/components/pisellGridPro/ToolBar/index.less +23 -0
  30. package/es/components/pisellModal/index.d.ts +6 -6
  31. package/es/components/pisellRecordBoard/docs/PisellRecordBoard.md +58 -0
  32. package/es/components/pisellRecordBoard/docs/ShellFrame.md +1 -1
  33. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.js +25 -13
  34. package/es/components/pisellRecordBoard/layouts/GridLayout/Grid.less +14 -0
  35. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -0
  36. package/es/components/pisellRecordBoard/shellFrame/Pagination/index.less +12 -0
  37. package/es/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +35 -0
  38. package/es/components/pisellRecordBoard/shellFrame/ToolBar/index.js +39 -7
  39. package/es/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -1
  40. package/es/components/pisellRecordBoard/types.d.ts +2 -1
  41. package/es/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
  42. package/es/components/radio/index.d.ts +2 -2
  43. package/es/components/section-footers/index.d.ts +2 -2
  44. package/es/components/skeleton/index.d.ts +2 -2
  45. package/es/components/time-picker/index.d.ts +2 -2
  46. package/es/components/typography/index.d.ts +2 -2
  47. package/es/components/upload/index.d.ts +2 -2
  48. package/es/locales/zh-CN.js +2 -2
  49. package/es/locales/zh-TW.js +2 -2
  50. package/lib/components/Pagination/index.js +37 -23
  51. package/lib/components/dataSourceComponents/dataSourceShow/dataSourceQRCode/index.d.ts +2 -2
  52. package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +2 -2
  53. package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +2 -2
  54. package/lib/components/dataSourceComponents/fields/Input.Url/index.d.ts +2 -2
  55. package/lib/components/date-picker/index.d.ts +2 -2
  56. package/lib/components/filter/components/FilterButton/index.js +8 -2
  57. package/lib/components/filter/components/FilterButton/types.d.ts +2 -1
  58. package/lib/components/pisellBatchActionBar/PisellBatchActionBar.js +26 -21
  59. package/lib/components/pisellDateTimeDisplay/PisellDateTimeDisplay.less +2 -1
  60. package/lib/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.js +5 -5
  61. package/lib/components/pisellDateTimeDisplay/utils/localeUtils.js +7 -2
  62. package/lib/components/pisellFind/index.js +2 -1
  63. package/lib/components/pisellGridPro/ToolBar/index.less +23 -0
  64. package/lib/components/pisellRecordBoard/docs/PisellRecordBoard.md +58 -0
  65. package/lib/components/pisellRecordBoard/docs/ShellFrame.md +1 -1
  66. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.js +25 -13
  67. package/lib/components/pisellRecordBoard/layouts/GridLayout/Grid.less +14 -0
  68. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.js +1 -0
  69. package/lib/components/pisellRecordBoard/shellFrame/Pagination/index.less +12 -0
  70. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/ToolBarFilter.less +35 -0
  71. package/lib/components/pisellRecordBoard/shellFrame/ToolBar/index.js +39 -7
  72. package/lib/components/pisellRecordBoard/shellFrame/ToolBarReset/index.js +6 -1
  73. package/lib/components/pisellRecordBoard/types.d.ts +2 -1
  74. package/lib/components/pisellTimeRangeDisplay/PisellTimeRangeDisplay.js +1 -1
  75. package/lib/components/skeleton/index.d.ts +2 -2
  76. package/lib/components/time-picker/index.d.ts +2 -2
  77. package/lib/components/upload/index.d.ts +2 -2
  78. package/lib/locales/zh-CN.js +2 -2
  79. package/lib/locales/zh-TW.js +2 -2
  80. package/package.json +4 -4
@@ -1,9 +1,9 @@
1
1
  import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
2
- import * as antd19 from "antd";
2
+ import * as antd22 from "antd";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts
6
- declare const Subdomain: React.FC<antd19.InputProps & {
6
+ declare const Subdomain: React.FC<antd22.InputProps & {
7
7
  onChange: (value: string) => void;
8
8
  onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
9
9
  rootDomain: "custom" | "saas" | "xzero";
@@ -1,8 +1,8 @@
1
1
  import { WithFormItemProps, WithModeProps } from "../../dataSourceForm/utils.js";
2
- import * as antd20 from "antd";
2
+ import * as antd19 from "antd";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/components/dataSourceComponents/fields/Input.Url/index.d.ts
6
- declare const Url: React.FC<antd20.InputProps & React.RefAttributes<antd20.InputRef> & WithModeProps & WithFormItemProps>;
6
+ declare const Url: React.FC<antd19.InputProps & React.RefAttributes<antd19.InputRef> & WithModeProps & WithFormItemProps>;
7
7
  //#endregion
8
8
  export { Url };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import * as react2 from "react";
2
+ import * as react1 from "react";
3
3
 
4
4
  //#region src/components/date-picker/index.d.ts
5
- declare const DatePicker: (props: any) => react2.JSX.Element;
5
+ declare const DatePicker: (props: any) => react1.JSX.Element;
6
6
  //#endregion
7
7
  export { DatePicker };
@@ -6,11 +6,17 @@ const require_platform = require('../../../../utils/platform.js');
6
6
  let antd = require("antd");
7
7
  let react = require("react");
8
8
  react = require_rolldown_runtime.__toESM(react);
9
+ let _pisell_utils = require("@pisell/utils");
9
10
  let _pisell_icon_es_FilterLines = require("@pisell/icon/es/FilterLines");
10
11
  _pisell_icon_es_FilterLines = require_rolldown_runtime.__toESM(_pisell_icon_es_FilterLines);
11
12
 
12
13
  //#region src/components/filter/components/FilterButton/index.tsx
13
- const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFilterMaxLength, formFiltersPrefix, renderItem, placement, size = "large", buttonClassName }) => {
14
+ /** Quick Filter 同源:优先 @pisell/utils locales,无 key 时回退 materials getText */
15
+ function getFilterButtonLabel(buttonText) {
16
+ if (buttonText != null && buttonText !== "") return buttonText;
17
+ return _pisell_utils.locales.getText("pisell2.recordBoard.toolbar.filter") || require_index.getText("table-action-filter-button");
18
+ }
19
+ const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFilterMaxLength, formFiltersPrefix, renderItem, placement, size = "large", buttonClassName, buttonText }) => {
14
20
  const ref = (0, react.useRef)(null);
15
21
  const [open, setOpen] = (0, react.useState)(false);
16
22
  const [dateRangeOpen, setDateRangeOpen] = (0, react.useState)(false);
@@ -61,7 +67,7 @@ const Filter = ({ value, hiddenQuickFilter, hiddenOtherFilter, onChange, quickFi
61
67
  className: buttonClassName,
62
68
  icon: /* @__PURE__ */ react.default.createElement(_pisell_icon_es_FilterLines.default, null),
63
69
  size
64
- }, isMobileBool ? null : require_index.getText("table-action-filter-button"))));
70
+ }, isMobileBool ? null : getFilterButtonLabel(buttonText))));
65
71
  };
66
72
  var FilterButton_default = Filter;
67
73
 
@@ -17,7 +17,8 @@ type FilterListProps = {
17
17
  renderItem?: (item: any, otherProps?: any) => React.ReactNode;
18
18
  placement?: 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom'; /** 筛选按钮尺寸,与 antd Button size 一致 */
19
19
  size?: 'small' | 'middle' | 'large'; /** 筛选触发按钮的 className,用于定制样式(如与设计系统对齐) */
20
- buttonClassName?: string;
20
+ buttonClassName?: string; /** 筛选按钮文案,不传则使用 materials 内置多语言 */
21
+ buttonText?: string;
21
22
  };
22
23
  //#endregion
23
24
  export { FilterListProps };
@@ -8,9 +8,15 @@ let classnames = require("classnames");
8
8
  classnames = require_rolldown_runtime.__toESM(classnames);
9
9
  let react = require("react");
10
10
  react = require_rolldown_runtime.__toESM(react);
11
+ let _pisell_utils = require("@pisell/utils");
11
12
  require("./PisellBatchActionBar.less");
12
13
 
13
14
  //#region src/components/pisellBatchActionBar/PisellBatchActionBar.tsx
15
+ /** 优先 @pisell/utils locales(pisell2.salesManagement.batchActionBar.*),无则回退 materials getText */
16
+ function getBatchBarText(key) {
17
+ var _utilsLocales$getText;
18
+ return (_utilsLocales$getText = _pisell_utils.locales.getText(`pisell2.salesManagement.batchActionBar.${key}`)) !== null && _utilsLocales$getText !== void 0 ? _utilsLocales$getText : require_index.getText(`batch-action-bar-${key}`);
19
+ }
14
20
  /**
15
21
  * PisellBatchActionBar 批量操作栏组件
16
22
  *
@@ -38,7 +44,7 @@ require("./PisellBatchActionBar.less");
38
44
  * ```
39
45
  */
40
46
  const PisellBatchActionBar = (props) => {
41
- const { className, style, selectedKeys, selectedRows, total, currentPageTotal, currentPageKeys, position = "float", offset = 0, showSelectedCount = true, selectedCountText, defaultActions, actions = [], actionOrder, enableOverflow = true, overflowThreshold = 5, moreText = require_index.getText("batch-action-bar-more"), onSelectAll, onClear, onInvert, onDelete, deleteConfirmConfig, onActionClick } = props;
47
+ const { className, style, selectedKeys, selectedRows, total, currentPageTotal, currentPageKeys, position = "float", offset = 0, showSelectedCount = true, selectedCountText, defaultActions, actions = [], actionOrder, enableOverflow = true, overflowThreshold = 5, moreText = getBatchBarText("more"), onSelectAll, onClear, onInvert, onDelete, deleteConfirmConfig, onActionClick } = props;
42
48
  /**
43
49
  * 用于防止删除按钮重复点击的标记
44
50
  */
@@ -113,7 +119,7 @@ const PisellBatchActionBar = (props) => {
113
119
  const count = selectionState.selectedCount;
114
120
  if (typeof selectedCountText === "function") return selectedCountText(count);
115
121
  if (selectedCountText) return selectedCountText.replace("{count}", String(count));
116
- const i18nText = require_index.getText("batch-action-bar-selected-count");
122
+ const i18nText = getBatchBarText("selectedCount");
117
123
  if (typeof i18nText === "function") return i18nText(count);
118
124
  return i18nText || `已选择 ${count} 项`;
119
125
  }, [
@@ -130,7 +136,7 @@ const PisellBatchActionBar = (props) => {
130
136
  const defaultActionNodes = [];
131
137
  if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showSelectAll) !== false) defaultActionNodes.push(/* @__PURE__ */ react.default.createElement(require_GraphicTextCard.default, {
132
138
  key: "select-all",
133
- text: require_index.getText("batch-action-bar-select-all"),
139
+ text: getBatchBarText("selectAll"),
134
140
  icon: "pisell2-check-square",
135
141
  variant: "horizontal",
136
142
  size: "small",
@@ -161,7 +167,7 @@ const PisellBatchActionBar = (props) => {
161
167
  }));
162
168
  if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showInvert) !== false) defaultActionNodes.push(/* @__PURE__ */ react.default.createElement(require_GraphicTextCard.default, {
163
169
  key: "invert",
164
- text: require_index.getText("batch-action-bar-invert"),
170
+ text: getBatchBarText("invert"),
165
171
  icon: "pisell2-check-done-01",
166
172
  variant: "horizontal",
167
173
  size: "small",
@@ -192,7 +198,7 @@ const PisellBatchActionBar = (props) => {
192
198
  }));
193
199
  if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showClear) !== false) defaultActionNodes.push(/* @__PURE__ */ react.default.createElement(require_GraphicTextCard.default, {
194
200
  key: "clear",
195
- text: require_index.getText("batch-action-bar-clear"),
201
+ text: getBatchBarText("clear"),
196
202
  icon: "pisell2-square",
197
203
  variant: "horizontal",
198
204
  size: "small",
@@ -223,7 +229,7 @@ const PisellBatchActionBar = (props) => {
223
229
  }));
224
230
  if ((defaultActions === null || defaultActions === void 0 ? void 0 : defaultActions.showDelete) !== false) defaultActionNodes.push(/* @__PURE__ */ react.default.createElement(require_GraphicTextCard.default, {
225
231
  key: "delete",
226
- text: require_index.getText("batch-action-bar-delete"),
232
+ text: getBatchBarText("delete"),
227
233
  icon: "pisell2-delete_wght300_24px",
228
234
  variant: "horizontal",
229
235
  size: "small",
@@ -249,18 +255,16 @@ const PisellBatchActionBar = (props) => {
249
255
  height: "48px"
250
256
  },
251
257
  onClick: () => {
258
+ var _deleteConfirmConfig$, _deleteConfirmConfig$2, _deleteConfirmConfig$3, _deleteConfirmConfig$4;
252
259
  if (isDeleteModalOpenRef.current) return;
253
260
  isDeleteModalOpenRef.current = true;
254
- const deleteContent = (() => {
255
- const i18nContent = require_index.getText("batch-action-bar-delete-confirm-content");
256
- if (typeof i18nContent === "function") return i18nContent(selectionState.selectedCount);
257
- return i18nContent || `确定要删除选中的 ${selectionState.selectedCount} 项吗?`;
258
- })();
261
+ const i18nContent = getBatchBarText("deleteConfirmContent");
262
+ const deleteContent = typeof i18nContent === "function" ? i18nContent(selectionState.selectedCount) : i18nContent || `确定要删除选中的 ${selectionState.selectedCount} 项吗?`;
259
263
  antd.Modal.confirm({
260
- title: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title) || require_index.getText("batch-action-bar-delete-confirm-title"),
261
- content: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description) || deleteContent,
262
- okText: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText) || require_index.getText("batch-action-bar-delete-confirm-ok"),
263
- cancelText: (deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText) || require_index.getText("batch-action-bar-delete-confirm-cancel"),
264
+ title: (_deleteConfirmConfig$ = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.title) !== null && _deleteConfirmConfig$ !== void 0 ? _deleteConfirmConfig$ : getBatchBarText("deleteConfirmTitle"),
265
+ content: (_deleteConfirmConfig$2 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.description) !== null && _deleteConfirmConfig$2 !== void 0 ? _deleteConfirmConfig$2 : deleteContent,
266
+ okText: (_deleteConfirmConfig$3 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.okText) !== null && _deleteConfirmConfig$3 !== void 0 ? _deleteConfirmConfig$3 : getBatchBarText("deleteConfirmOk"),
267
+ cancelText: (_deleteConfirmConfig$4 = deleteConfirmConfig === null || deleteConfirmConfig === void 0 ? void 0 : deleteConfirmConfig.cancelText) !== null && _deleteConfirmConfig$4 !== void 0 ? _deleteConfirmConfig$4 : getBatchBarText("deleteConfirmCancel"),
264
268
  okButtonProps: { danger: true },
265
269
  onOk: () => {
266
270
  onDelete === null || onDelete === void 0 || onDelete(selectedKeys, selectedRows);
@@ -345,17 +349,16 @@ const PisellBatchActionBar = (props) => {
345
349
  minWidth: "120px",
346
350
  height: "48px"
347
351
  }, action.style),
348
- className: action.className,
349
352
  onClick: () => handleActionClick(action)
350
353
  });
351
354
  if (action.confirm) {
352
355
  const confirmConfig = typeof action.confirm === "object" ? action.confirm : {};
353
356
  return /* @__PURE__ */ react.default.createElement(antd.Popconfirm, {
354
357
  key: action.key,
355
- title: confirmConfig.title || require_index.getText("batch-action-bar-confirm-title"),
358
+ title: confirmConfig.title || getBatchBarText("confirmTitle"),
356
359
  description: confirmConfig.description,
357
- okText: confirmConfig.okText || require_index.getText("batch-action-bar-delete-confirm-ok"),
358
- cancelText: confirmConfig.cancelText || require_index.getText("batch-action-bar-delete-confirm-cancel"),
360
+ okText: confirmConfig.okText || getBatchBarText("deleteConfirmOk"),
361
+ cancelText: confirmConfig.cancelText || getBatchBarText("deleteConfirmCancel"),
359
362
  onConfirm: () => handleActionClick(action)
360
363
  }, card);
361
364
  }
@@ -402,8 +405,10 @@ const PisellBatchActionBar = (props) => {
402
405
  if (!hasOverflow || overflowActions.length === 0) return null;
403
406
  const modifiedOverflowActions = overflowActions.map((action) => {
404
407
  if (react.default.isValidElement(action)) {
405
- var _action$props;
406
- return react.default.cloneElement(action, { style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, ((_action$props = action.props) === null || _action$props === void 0 ? void 0 : _action$props.style) || {}), {}, {
408
+ var _el$props;
409
+ const el = action;
410
+ const prevStyle = (_el$props = el.props) === null || _el$props === void 0 ? void 0 : _el$props.style;
411
+ return react.default.cloneElement(el, { style: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, prevStyle || {}), {}, {
407
412
  minWidth: "160px",
408
413
  width: "160px"
409
414
  }) });
@@ -64,9 +64,10 @@
64
64
  line-height: 1.2;
65
65
  }
66
66
 
67
- // 分隔符
67
+ // 分隔符:保留空格占位,避免纯空格时被折叠不显示
68
68
  &-separator {
69
69
  display: inline-block;
70
+ white-space: pre;
70
71
  }
71
72
 
72
73
  // 自定义格式化
@@ -2,8 +2,8 @@
2
2
  //#region src/components/pisellDateTimeDisplay/formats/dateTimeDisplayFormats.ts
3
3
  /**
4
4
  * PisellDateTimeDisplay 按语言预设的格式
5
- * - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00 周四)、相对日今天/昨天/明天
6
- * - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026)、相对日 Today/Yesterday/Tomorrow
5
+ * - zh-cn:完整日期 - 时间 星期(如 2025-12-31 - 2:00 周四);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
6
+ * - en:时间 星期, 日期(如 2:00 Sat, 21 Mar, 2026);默认不展示相对日,可传 dateFormat.showRelativeDay: true 开启
7
7
  */
8
8
  const DATETIME_DISPLAY_FORMATS = {
9
9
  "zh-cn": {
@@ -12,7 +12,7 @@ const DATETIME_DISPLAY_FORMATS = {
12
12
  showYear: true,
13
13
  separator: "-",
14
14
  showChineseUnit: false,
15
- showRelativeDay: true
15
+ showRelativeDay: false
16
16
  },
17
17
  timeFormat: {
18
18
  use12Hour: false,
@@ -40,7 +40,7 @@ const DATETIME_DISPLAY_FORMATS = {
40
40
  showYear: true,
41
41
  separator: "-",
42
42
  showChineseUnit: false,
43
- showRelativeDay: true
43
+ showRelativeDay: false
44
44
  },
45
45
  timeFormat: {
46
46
  use12Hour: false,
@@ -67,7 +67,7 @@ const DATETIME_DISPLAY_FORMATS = {
67
67
  order: "DMY",
68
68
  shortMonth: true,
69
69
  showYear: true,
70
- showRelativeDay: true,
70
+ showRelativeDay: false,
71
71
  useCommaBeforeYear: true
72
72
  },
73
73
  timeFormat: {
@@ -1,4 +1,6 @@
1
+ const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.js');
1
2
  const require_locale = require('../../../utils/locale.js');
3
+ let _pisell_utils = require("@pisell/utils");
2
4
 
3
5
  //#region src/components/pisellDateTimeDisplay/utils/localeUtils.ts
4
6
  /**
@@ -21,13 +23,16 @@ function isChinese(locale) {
21
23
  }
22
24
  /**
23
25
  * 获取 dayjs 兼容的 locale 代码
24
- * 未传 locale 时使用 i18n 当前语言(全局配置 / umi_locale),不再使用浏览器语言
26
+ * 未传 locale 时与 locale.getText 同源:优先 @pisell/utils 当前语言(getLocale),无则 materials 全局配置 / umi_locale
25
27
  * @param locale 原始 locale 代码(可选)
26
28
  * @returns dayjs 兼容的 locale 代码
27
29
  * @example 'zh-CN' -> 'zh-cn', 'en-US' -> 'en'
28
30
  */
29
31
  function getDayjsLocale(locale) {
30
- if (!locale) return normalizeLocale(require_locale.getCurrentLocale());
32
+ if (!locale) {
33
+ const fromUtils = typeof _pisell_utils.locales.getLocale === "function" ? _pisell_utils.locales.getLocale() : void 0;
34
+ return normalizeLocale(typeof fromUtils === "string" && fromUtils ? fromUtils : require_locale.getCurrentLocale());
35
+ }
31
36
  return normalizeLocale(locale);
32
37
  }
33
38
 
@@ -5,6 +5,7 @@ const require_index = require('../../locales/index.js');
5
5
  const require_PisellLookup = require('../pisellLookup/PisellLookup.js');
6
6
  let react = require("react");
7
7
  react = require_rolldown_runtime.__toESM(react);
8
+ let _pisell_utils = require("@pisell/utils");
8
9
 
9
10
  //#region src/components/pisellFind/index.tsx
10
11
  const _excluded = [
@@ -43,7 +44,7 @@ const _excluded = [
43
44
  * ```
44
45
  */
45
46
  const PisellFind = (0, react.forwardRef)((props, ref) => {
46
- const { triggerType = "button", buttonText = require_index.getText("pisell-find-button-text"), placeholder = require_index.getText("pisell-find-placeholder"), showConfirmButton = false, showHistory = true, historyKey = "pisell_find_history" } = props, restProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
47
+ const { triggerType = "button", buttonText = _pisell_utils.locales.getText("pisell2.recordBoard.toolbar.find") || require_index.getText("pisell-find-button-text"), placeholder = _pisell_utils.locales.getText("pisell2.recordBoard.toolbar.findPlaceholder") || require_index.getText("pisell-find-placeholder"), showConfirmButton = false, showHistory = true, historyKey = "pisell_find_history" } = props, restProps = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
47
48
  return /* @__PURE__ */ react.default.createElement(require_PisellLookup.PisellLookup, require_objectSpread2._objectSpread2({
48
49
  ref,
49
50
  triggerType,
@@ -14,6 +14,7 @@
14
14
  /**
15
15
  * 工具栏行通用样式
16
16
  */
17
+
17
18
  &-row {
18
19
  display: flex;
19
20
  flex-direction: row;
@@ -21,8 +22,10 @@
21
22
  gap: 12px;
22
23
  align-self: stretch;
23
24
  }
25
+
24
26
  .toolbar-row {
25
27
  justify-content: space-between;
28
+
26
29
  &-left {
27
30
  display: flex;
28
31
  flex-direction: row;
@@ -40,3 +43,23 @@
40
43
  }
41
44
  }
42
45
  }
46
+
47
+ /**
48
+ * 手机版宽度:左侧区域与右侧区域换行,避免挤在一行
49
+ */
50
+ @media (max-width: 768px) {
51
+ .pisell-grid-pro-toolbar .toolbar-row {
52
+ flex-wrap: wrap;
53
+ }
54
+
55
+ .pisell-grid-pro-toolbar .toolbar-row-left {
56
+ flex: 1 1 100%;
57
+ min-width: 0;
58
+ }
59
+
60
+ .pisell-grid-pro-toolbar .toolbar-row-right {
61
+ flex: 1 1 100%;
62
+ min-width: 0;
63
+ justify-content: flex-start;
64
+ }
65
+ }
@@ -387,6 +387,64 @@ export default () => {
387
387
  };
388
388
  ```
389
389
 
390
+ ### 筛选默认值(QuickFilter)
391
+
392
+ 左侧 QuickFilter 的表单展示和请求参数都来自 **`searchParams.filter.values`**。要带默认值(如订单日期默认「近 7 天」),在**受控**使用时,用初始的 `searchParams` 把默认值写进 `filter.values` 即可。
393
+
394
+ - 传入 RecordBoard 的 `searchParams` 初始值里包含 `filter: { values: { [字段名]: 默认值 }, quickFilter: [], otherFilter: [...] }`。
395
+ - `filter.values` 的 key 需与 quickFilter 的 `filterList` 里每一项的 `name`/`key` 一致(如 `orderDate`)。
396
+ - 日期范围等建议用 dayjs 实例,例如 `orderDate: [dayjs().subtract(7, 'day'), dayjs()]`。
397
+
398
+ 示例(orderDate 默认近 7 天):
399
+
400
+ ```tsx
401
+ import React, { useState } from 'react';
402
+ import dayjs from 'dayjs';
403
+ import { PisellRecordBoard } from '@pisell/materials';
404
+
405
+ // 初始 searchParams 带默认筛选
406
+ const [searchParams, setSearchParams] = useState<Record<string, unknown>>({
407
+ filter: {
408
+ quickFilter: [],
409
+ otherFilter: [], // 或你的 otherFilter 配置
410
+ values: {
411
+ orderDate: [dayjs().subtract(7, 'day'), dayjs()],
412
+ },
413
+ },
414
+ });
415
+
416
+ // value 里 searchParams、onSearch 照常
417
+ const value = {
418
+ data: list,
419
+ searchParams,
420
+ onSearch: (params) => setSearchParams(params),
421
+ // ...
422
+ };
423
+
424
+ // toolBar 里 quickFilter.filterList 的 name/key 为 orderDate,与上面 values.orderDate 对应
425
+ <PisellRecordBoard
426
+ {...value}
427
+ toolBar={{
428
+ quickFilter: {
429
+ filterList: [
430
+ {
431
+ type: 'rangePicker',
432
+ name: 'orderDate',
433
+ key: 'orderDate',
434
+ label: '订单日期',
435
+ props: { placeholder: ['开始', '结束'] },
436
+ },
437
+ ],
438
+ },
439
+ filter: { hiddenQuickFilter: true },
440
+ }}
441
+ >
442
+ ...
443
+ </PisellRecordBoard>
444
+ ```
445
+
446
+ 这样首屏会显示默认日期范围,且首次请求会带上该筛选条件。
447
+
390
448
  ### 自定义组合(不用 ShellFrame)
391
449
 
392
450
  可单独使用 ToolBar、BatchActionBar、Grid、Pagination 自由组合。
@@ -87,7 +87,7 @@ Shell Frame 内各块通过 RecordBoard 打散传入的 **grid**、**toolBar**
87
87
  ## 搜索与筛选约定
88
88
 
89
89
  - **搜索**:默认绑定 `searchParams.keyword`,变更时调用 `onSearch({ ...searchParams, keyword: value })`。
90
- - **筛选**:绑定 `searchParams.filter`,结构为 `{ quickFilter, otherFilter, values }`;ToolBar 内右侧 Filter 弹层默认 `hiddenQuickFilter: true`,快筛全部在左侧 QuickFilter 展示。
90
+ - **筛选**:绑定 `searchParams.filter`,结构为 `{ quickFilter, otherFilter, values }`;ToolBar 内右侧 Filter 弹层默认 `hiddenQuickFilter: true`,快筛全部在左侧 QuickFilter 展示。**筛选默认值**:在受控用法下,给传入的 `searchParams` 设置初始值,在 `filter.values` 里按 quickFilter 的 `name`/`key` 写好默认值即可(详见 [PisellRecordBoard - 筛选默认值](./PisellRecordBoard.md#筛选默认值quickfilter))。
91
91
  - **排序**:绑定 `searchParams.sort`,单值字符串;Sort 与 Filter 变更均通过 `onSearch` 写回 `searchParams`。
92
92
 
93
93
  ## 相关文档
@@ -50,7 +50,7 @@ const CONTEXT_ONLY_KEYS = [
50
50
  "setScrollAreaHeight"
51
51
  ];
52
52
  const RecordBoardGridView = (props) => {
53
- var _ref2, _ctx$data;
53
+ var _ref2, _ctx$data, _ctx$data2;
54
54
  const ctx = require_useRecordBoardContext.useRecordBoardContext({ displayName: "grid" });
55
55
  const { render, columns: columnsProp, rowKey: rowKeyProp, rowSelection: rowSelectionProp } = props, rest = require_objectWithoutProperties._objectWithoutProperties(props, _excluded);
56
56
  const rawColumns = (_ref2 = columnsProp !== null && columnsProp !== void 0 ? columnsProp : ctx.columns) !== null && _ref2 !== void 0 ? _ref2 : [];
@@ -64,9 +64,10 @@ const RecordBoardGridView = (props) => {
64
64
  const key = (_ref3 = (_ctx$rowKey = ctx.rowKey) !== null && _ctx$rowKey !== void 0 ? _ctx$rowKey : rowKeyProp) !== null && _ref3 !== void 0 ? _ref3 : "id";
65
65
  return typeof key === "function" ? key : (record) => getRowKey(record, typeof key === "string" ? key : String(key));
66
66
  }, [ctx.rowKey, rowKeyProp]);
67
+ const rowSelectionConfig = rowSelectionProp !== null && rowSelectionProp !== void 0 ? rowSelectionProp : ctx.rowSelection;
67
68
  const rowSelection = (0, react.useMemo)(() => {
68
- if (rowSelectionProp === false) return void 0;
69
- const base = typeof rowSelectionProp === "object" ? rowSelectionProp : {};
69
+ if (rowSelectionConfig === false) return void 0;
70
+ const base = typeof rowSelectionConfig === "object" ? rowSelectionConfig : {};
70
71
  return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, base), {}, {
71
72
  selectedRowKeys: ctx.selectedKeys,
72
73
  onChange: (selectedRowKeys, selectedRows) => {
@@ -78,7 +79,7 @@ const RecordBoardGridView = (props) => {
78
79
  }, [
79
80
  ctx.selectedKeys,
80
81
  ctx.onSelectionChange,
81
- rowSelectionProp
82
+ rowSelectionConfig
82
83
  ]);
83
84
  const gridTableProps = (0, react.useMemo)(() => {
84
85
  const picked = {};
@@ -89,25 +90,34 @@ const RecordBoardGridView = (props) => {
89
90
  return picked;
90
91
  }, [ctx]);
91
92
  if (typeof render === "function") return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, render(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, ctx), rest)));
93
+ const dataSource = (_ctx$data = ctx.data) !== null && _ctx$data !== void 0 ? _ctx$data : [];
94
+ const isEmpty = !Array.isArray(dataSource) || dataSource.length === 0;
95
+ const sumColumnWidths = (0, react.useMemo)(() => {
96
+ return columns.reduce((sum, col) => {
97
+ var _col$width;
98
+ return sum + ((_col$width = col.width) !== null && _col$width !== void 0 ? _col$width : 250);
99
+ }, 0) || 2e3;
100
+ }, [columns]);
92
101
  const tableScroll = (0, react.useMemo)(() => {
93
102
  var _rest$scroll;
94
103
  const scroll = (_rest$scroll = rest.scroll) !== null && _rest$scroll !== void 0 ? _rest$scroll : ctx.scroll;
104
+ const scrollX = isEmpty && scroll && typeof scroll.x !== "number" ? sumColumnWidths : scroll === null || scroll === void 0 ? void 0 : scroll.x;
95
105
  if ((scroll === null || scroll === void 0 ? void 0 : scroll.autoCalc) && typeof ctx.scrollAreaHeight === "number") {
96
- var _scroll$x;
97
106
  const wrapHeight = ctx.scrollAreaHeight;
98
- ctx.pagination;
99
107
  return {
100
- x: (_scroll$x = scroll.x) !== null && _scroll$x !== void 0 ? _scroll$x : columns.reduce((p, c) => {
101
- var _c$width;
102
- return p + ((_c$width = c.width) !== null && _c$width !== void 0 ? _c$width : 250);
103
- }, 0) || 2e3,
108
+ x: scrollX !== null && scrollX !== void 0 ? scrollX : sumColumnWidths,
104
109
  y: Math.max(wrapHeight - 40, 100),
105
110
  scrollToFirstRowOnChange: scroll.scrollToFirstRowOnChange
106
111
  };
107
112
  }
108
113
  if (scroll && typeof scroll === "object") {
109
114
  const _ref4 = scroll, { autoCalc: _a } = _ref4, restScroll = require_objectWithoutProperties._objectWithoutProperties(_ref4, _excluded2);
110
- return Object.keys(restScroll).length ? restScroll : void 0;
115
+ const resolved = Object.keys(restScroll).length ? restScroll : void 0;
116
+ if (resolved) {
117
+ var _ref5;
118
+ return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, resolved), {}, { x: (_ref5 = scrollX !== null && scrollX !== void 0 ? scrollX : resolved.x) !== null && _ref5 !== void 0 ? _ref5 : sumColumnWidths });
119
+ }
120
+ return resolved;
111
121
  }
112
122
  return scroll;
113
123
  }, [
@@ -115,7 +125,9 @@ const RecordBoardGridView = (props) => {
115
125
  ctx.scroll,
116
126
  ctx.scrollAreaHeight,
117
127
  ctx.pagination,
118
- columns
128
+ columns,
129
+ sumColumnWidths,
130
+ isEmpty
119
131
  ]);
120
132
  return /* @__PURE__ */ react.default.createElement("div", {
121
133
  "data-layout-slot": "grid",
@@ -123,7 +135,7 @@ const RecordBoardGridView = (props) => {
123
135
  }, /* @__PURE__ */ react.default.createElement(antd.Table, require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, rest), gridTableProps), {}, {
124
136
  scroll: tableScroll,
125
137
  rowKey: tableRowKey,
126
- dataSource: (_ctx$data = ctx.data) !== null && _ctx$data !== void 0 ? _ctx$data : [],
138
+ dataSource: (_ctx$data2 = ctx.data) !== null && _ctx$data2 !== void 0 ? _ctx$data2 : [],
127
139
  loading: ctx.loading,
128
140
  columns,
129
141
  rowSelection,
@@ -21,6 +21,18 @@
21
21
  background: var(--ant-color-bg-container, #ffffff);
22
22
  }
23
23
 
24
+ /*
25
+ * 根本原因:表头所有单元格统一用了 z-index: 1,横向滚动时后面的列(非固定列)与固定列同层叠,
26
+ * 非固定列会盖住固定列。解决:仅对「固定列」提高 z-index。
27
+ * antd/rc-table 会给所有 fixed 列(含多选列)的 th/td 加上 .*-table-cell-fix-left,
28
+ * 用该类选择器即可覆盖任意数量的固定列,无需按 nth-child 逐个写。
29
+ */
30
+
31
+ .pisell-lowcode-table-thead .pisell-lowcode-table-cell-fix-left {
32
+ z-index: 2 !important;
33
+ background: var(--ant-color-bg-container, #ffffff) !important;
34
+ }
35
+
24
36
  // 让 antd Table 外层占满,使 scroll.y 生效且高度链不断
25
37
  .pisell-lowcode-table-wrapper {
26
38
  flex: 1;
@@ -28,12 +40,14 @@
28
40
  display: flex;
29
41
  flex-direction: column;
30
42
  }
43
+
31
44
  .pisell-lowcode-table-wrapper .pisell-lowcode-table {
32
45
  flex: 1;
33
46
  min-height: 0;
34
47
  display: flex;
35
48
  flex-direction: column;
36
49
  }
50
+
37
51
  .pisell-lowcode-table-wrapper .pisell-lowcode-table .pisell-lowcode-table-container {
38
52
  flex: 1;
39
53
  min-height: 0;
@@ -38,6 +38,7 @@ const RecordBoardPagination = (props) => {
38
38
  (_ctx$childComponentPr3 = ctx.childComponentProps) === null || _ctx$childComponentPr3 === void 0 ? void 0 : _ctx$childComponentPr3.pagination
39
39
  ]);
40
40
  if (typeof render === "function") return /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, render(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, ctx), rest)));
41
+ if (ctx.total === 0) return null;
41
42
  return /* @__PURE__ */ react.default.createElement("div", {
42
43
  "data-layout-slot": "pagination",
43
44
  className: "record-board-shell-frame-pagination",
@@ -64,3 +64,15 @@
64
64
  }
65
65
  }
66
66
  }
67
+
68
+ /**
69
+ * 手机宽度下:不展示 "page x of x" 文案,仅保留上一页/下一页
70
+ */
71
+ @media (max-width: 768px) {
72
+ .record-board-shell-frame-pagination {
73
+ .materials-grid-paginator-center,
74
+ .pisell-lowcode-pagination-total-text {
75
+ display: none !important;
76
+ }
77
+ }
78
+ }
@@ -18,6 +18,23 @@
18
18
  max-width: 100%;
19
19
  }
20
20
  }
21
+
22
+ .pisell-lowcode-form-item {
23
+ margin-right: 0;
24
+ }
25
+
26
+ .MuiFormLabel-root {
27
+ line-height: 30px;
28
+ }
29
+
30
+ .MuiInputBase-root {
31
+ height: 48px !important;
32
+ border-radius: 8px !important;
33
+
34
+ input {
35
+ //height: 48px !important;
36
+ }
37
+ }
21
38
  }
22
39
 
23
40
  .record-board-toolbar-quick-filter-form {
@@ -26,6 +43,24 @@
26
43
  align-items: center;
27
44
  }
28
45
 
46
+ /**
47
+ * 手机版宽度:左侧快筛 + 搜索 支持换行,避免挤在一行
48
+ */
49
+ @media (max-width: 768px) {
50
+ .record-board-toolbar-top-left {
51
+ flex-wrap: wrap;
52
+ }
53
+
54
+ .record-board-toolbar-top-left .record-board-toolbar-find-wrap {
55
+ flex: 1 1 100%;
56
+ min-width: 100%;
57
+ }
58
+
59
+ .record-board-toolbar-quick-filter-form {
60
+ flex-wrap: wrap;
61
+ }
62
+ }
63
+
29
64
  /**
30
65
  * RecordBoard 工具栏「筛选」按钮样式
31
66
  * 依据 Figma Pisell 2.0 Component Library - Filter Button (node-id=13586-90537)