@nokecy/qc-ui-components 2.0.0-beta.5 → 2.0.0-beta.8

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.
@@ -953,10 +953,21 @@ function AgGridPlus(props) {
953
953
  });
954
954
  setSortColumn(sortedColumn);
955
955
  };
956
- var onRefresh = (0, _react.useCallback)(function () {
957
- if (requestRef.current) {
958
- onRequest(stableQueryFilter);
956
+ var onRefresh = (0, _react.useCallback)(function (options) {
957
+ if (!requestRef.current) return;
958
+ if (options !== null && options !== void 0 && options.resetPage && paginationRef.current.current !== 1) {
959
+ // 作废当前页在途请求,由页码 effect 发起唯一一次首页请求。@author jwy
960
+ requestSeqRef.current++;
961
+ setPagination(function (prev) {
962
+ return prev.current === 1 ? prev : _objectSpread(_objectSpread({}, prev), {}, {
963
+ current: 1
964
+ });
965
+ });
966
+ return;
959
967
  }
968
+
969
+ // 当前已在首页或采用兼容的无参数调用时,按当前筛选和排序请求一次。@author jwy
970
+ onRequest(stableQueryFilter);
960
971
  }, [onRequest, stableQueryFilter]);
961
972
 
962
973
  // 查询区、高级查询的回调可能是旧渲染里捕获的闭包(实测在第 2 页点「重置」时拿到的是第 1 页),
@@ -1496,7 +1507,9 @@ function AgGridPlus(props) {
1496
1507
  actions: actionDom,
1497
1508
  settings: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index4.default, {
1498
1509
  title: "\u5237\u65B0",
1499
- onClick: onRefresh,
1510
+ onClick: function onClick() {
1511
+ return onRefresh();
1512
+ },
1500
1513
  icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.RedoOutlined, {})
1501
1514
  }, "refresh"), /*#__PURE__*/(0, _jsxRuntime.jsx)(_index5.default, {
1502
1515
  gridKey: gridKey,
@@ -1616,6 +1629,8 @@ function AgGridPlus(props) {
1616
1629
  selectionColumnDef: {
1617
1630
  pinned: 'left',
1618
1631
  lockPosition: true,
1632
+ // 窄屏时保留系统选择列冻结,避免列状态反复重排。@author jwy
1633
+ lockPinned: true,
1619
1634
  width: 50,
1620
1635
  suppressHeaderMenuButton: true
1621
1636
  },
@@ -11,8 +11,16 @@ interface GridPagination {
11
11
  /** 总条数;request 模式下首次请求返回前为 0 */
12
12
  total: number;
13
13
  }
14
+ /** Controls how an imperative grid refresh handles pagination. @author jwy */
15
+ interface GridRefreshOptions {
16
+ /** Return to the first page before refreshing. @author jwy */
17
+ resetPage?: boolean;
18
+ }
14
19
  interface GridRef {
15
- onRefresh: () => void;
20
+ /** 保留无参数签名,兼容直接作为按钮点击回调的既有用法。@author jwy */
21
+ onRefresh(): void;
22
+ /** 刷新结果;可选择先返回第一页。@author jwy */
23
+ onRefresh(options: GridRefreshOptions): void;
16
24
  /**
17
25
  * 跳到第 n 页(1-based),按总页数收口;页码变化时自动重新请求。
18
26
  * 已在该页时不重复请求,需要重取请用 onRefresh。
@@ -262,4 +270,4 @@ interface AgGridColumnPropsClone extends ColDef {
262
270
  calculateType?: "sum" | "avg" | "standardDeviation" | false;
263
271
  }
264
272
  declare function AgGridColumn(props: AgGridColumnPropsClone | ColGroupDef): React.JSX.Element;
265
- export { GridProps, AgGridColumn, GridRef, GridPagination, AgGridColumnPropsClone };
273
+ export { GridProps, AgGridColumn, GridRefreshOptions, GridRef, GridPagination, AgGridColumnPropsClone };
@@ -14,7 +14,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
14
14
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
15
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // 注意: QueryStorageAdapter 和 ColumnStorageAdapter 已废弃
16
16
  // 请使用集中式方案管理 API
17
- /** 当前分页状态;页码 1-based。 */ //column的行内传参
17
+ /** 当前分页状态;页码 1-based。 */ /** Controls how an imperative grid refresh handles pagination. @author jwy */ //column的行内传参
18
18
  function AgGridColumn(props) {
19
19
  ///@ts-ignore
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(AgGridColumnClone, _objectSpread({}, props));
@@ -28,10 +28,9 @@ var QueryFormMetaContext = exports.QueryFormMetaContext = /*#__PURE__*/_react.de
28
28
  var useCollapseGrid = function useCollapseGrid(maxRows, defaultExpand) {
29
29
  var grid = (0, _react.useMemo)(function () {
30
30
  return _formilyAntd.FormGrid.createFormGrid({
31
- // 外显条数随宽度增长,宽屏不再卡在 4 个。@author nokecy
31
+ // 只约束查询项最小宽度;相同的最大/最小宽度会让 Formily 在临界宽度反复调整列数。@author jwy
32
32
  maxColumns: QUERY_MAX_COLUMNS,
33
33
  minWidth: QUERY_ITEM_WIDTH,
34
- maxWidth: QUERY_ITEM_WIDTH,
35
34
  maxRows: defaultExpand ? Infinity : maxRows,
36
35
  shouldVisible: function shouldVisible(node, grid) {
37
36
  // 展开状态时,显示所有元素
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _antd = require("antd");
10
10
  var _icons = require("@ant-design/icons");
11
11
  var _agGridReact = require("ag-grid-react");
12
+ var _locale = require("../locale");
12
13
  var _columnGroupUtils = require("./columnGroupUtils");
13
14
  var _DebounceInputs = require("./DebounceInputs");
14
15
  var _theme = require("../theme");
@@ -747,6 +748,7 @@ var ColumnConfigTable = function ColumnConfigTable(_ref2) {
747
748
  height: scrollY
748
749
  },
749
750
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_agGridReact.AgGridReact, {
751
+ localeText: _locale.localeText,
750
752
  theme: gridTheme,
751
753
  rowData: visibleItems,
752
754
  columnDefs: columnDefs,
@@ -10,6 +10,7 @@ var _antd = require("antd");
10
10
  var _index = _interopRequireDefault(require("../../draggableModal/index"));
11
11
  var _icons = require("@ant-design/icons");
12
12
  var _agGridReact = require("ag-grid-react");
13
+ var _locale = require("../locale");
13
14
  var _useSchemeManager = require("../context/useSchemeManager");
14
15
  var _queryFormContext = require("../context/queryFormContext");
15
16
  var _uuid = require("uuid");
@@ -787,6 +788,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
787
788
  width: '100%'
788
789
  },
789
790
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_agGridReact.AgGridReact, {
791
+ localeText: _locale.localeText,
790
792
  ref: queryGridRef,
791
793
  theme: gridTheme,
792
794
  rowData: queryItemsData,
@@ -839,6 +841,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
839
841
  width: '100%'
840
842
  },
841
843
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_agGridReact.AgGridReact, {
844
+ localeText: _locale.localeText,
842
845
  ref: schemeGridRef,
843
846
  theme: gridTheme,
844
847
  rowData: schemes,
@@ -270,9 +270,11 @@ function useArrayTableBatchRemove(field, sources, props, apiRef, getId) {
270
270
  };
271
271
  return {
272
272
  rowSelection: rowSelection,
273
+ // 选择列与显示序号同属固定的系统列,窄屏优先释放业务列的冻结空间。@author jwy
273
274
  selectionColumnDef: enabled ? _objectSpread({
274
275
  pinned: 'left',
275
276
  lockPosition: true,
277
+ lockPinned: true,
276
278
  width: 46,
277
279
  resizable: false,
278
280
  suppressHeaderMenuButton: true
@@ -19,6 +19,8 @@ export interface DraggableModalProps extends ModalProps {
19
19
  * 关闭后只保留标题拖动,尺寸完全由 width / style 决定。缩放结果不持久化,重新打开恢复默认。
20
20
  */
21
21
  resizable?: boolean;
22
+ /** 是否在打开或缩放时广播全局 resize;关闭后由弹窗内容自行响应容器尺寸变化。@author jwy */
23
+ notifyWindowResize?: boolean;
22
24
  /** 缩放的最小宽度,默认 400;表单类弹层应传 560(规范最小一档)。超出视口 95% 时以视口为准。 */
23
25
  minWidth?: number;
24
26
  /** 缩放的最小高度,默认 300:容纳标题、底栏与至少一行内容。 */
@@ -10,7 +10,7 @@ var _reactDraggable = _interopRequireDefault(require("react-draggable"));
10
10
  var _leaveGuard = require("../documentPage/leaveGuard");
11
11
  require("./style.less");
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
- var _excluded = ["wrapClassName", "width", "open", "style", "destroyOnClose", "destroyOnHidden", "mask", "maskClosable", "dirty", "confirmOnDirtyClose", "onCancel", "resizable", "minWidth", "minHeight"];
13
+ var _excluded = ["wrapClassName", "width", "open", "style", "destroyOnClose", "destroyOnHidden", "mask", "maskClosable", "dirty", "confirmOnDirtyClose", "onCancel", "notifyWindowResize", "resizable", "minWidth", "minHeight"];
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -86,6 +86,8 @@ var DraggableModal = function DraggableModal(props) {
86
86
  _props$confirmOnDirty = props.confirmOnDirtyClose,
87
87
  confirmOnDirtyClose = _props$confirmOnDirty === void 0 ? true : _props$confirmOnDirty,
88
88
  onCancel = props.onCancel,
89
+ _props$notifyWindowRe = props.notifyWindowResize,
90
+ notifyWindowResize = _props$notifyWindowRe === void 0 ? true : _props$notifyWindowRe,
89
91
  _props$resizable = props.resizable,
90
92
  resizable = _props$resizable === void 0 ? true : _props$resizable,
91
93
  _props$minWidth = props.minWidth,
@@ -115,6 +117,7 @@ var DraggableModal = function DraggableModal(props) {
115
117
 
116
118
  // 每帧最多通知一次表格重新测量。关闭或卸载时取消通知及全局鼠标监听。@author nokecy
117
119
  var notifyResize = function notifyResize() {
120
+ if (!notifyWindowResize) return;
118
121
  if (resizeFrame.current !== undefined) return;
119
122
  resizeFrame.current = requestAnimationFrame(function () {
120
123
  resizeFrame.current = undefined;
@@ -131,6 +134,7 @@ var DraggableModal = function DraggableModal(props) {
131
134
  });
132
135
  return;
133
136
  }
137
+ if (!notifyWindowResize) return;
134
138
  var timer;
135
139
  var frame = requestAnimationFrame(function () {
136
140
  timer = setTimeout(function () {
@@ -145,7 +149,7 @@ var DraggableModal = function DraggableModal(props) {
145
149
  if (resizeFrame.current !== undefined) cancelAnimationFrame(resizeFrame.current);
146
150
  resizeFrame.current = undefined;
147
151
  };
148
- }, [open]);
152
+ }, [open, notifyWindowResize]);
149
153
  var onStart = function onStart(_event, uiData) {
150
154
  var _draggleRef$current;
151
155
  var _window$document$docu = window.document.documentElement,
@@ -13,6 +13,7 @@ var _theme = require("../array-table/theme");
13
13
  var _hoistStatics = require("./hoistStatics");
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
  var _gridSequence = require("../shared/gridSequence");
16
+ var _locale = require("../ag-grid-plus/locale");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
17
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
18
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -58,6 +59,7 @@ var ReadingArrayTable = (0, _formilyReact.observer)(function (_ref) {
58
59
  theme: theme,
59
60
  rowHeight: rowHeight,
60
61
  headerHeight: headerHeight,
62
+ localeText: _locale.localeText,
61
63
  enableCellTextSelection: true,
62
64
  ensureDomOrder: true,
63
65
  defaultColDef: {
@@ -947,10 +947,21 @@ function AgGridPlus(props) {
947
947
  });
948
948
  setSortColumn(sortedColumn);
949
949
  };
950
- var onRefresh = useCallback(function () {
951
- if (requestRef.current) {
952
- onRequest(stableQueryFilter);
950
+ var onRefresh = useCallback(function (options) {
951
+ if (!requestRef.current) return;
952
+ if (options !== null && options !== void 0 && options.resetPage && paginationRef.current.current !== 1) {
953
+ // 作废当前页在途请求,由页码 effect 发起唯一一次首页请求。@author jwy
954
+ requestSeqRef.current++;
955
+ setPagination(function (prev) {
956
+ return prev.current === 1 ? prev : _objectSpread(_objectSpread({}, prev), {}, {
957
+ current: 1
958
+ });
959
+ });
960
+ return;
953
961
  }
962
+
963
+ // 当前已在首页或采用兼容的无参数调用时,按当前筛选和排序请求一次。@author jwy
964
+ onRequest(stableQueryFilter);
954
965
  }, [onRequest, stableQueryFilter]);
955
966
 
956
967
  // 查询区、高级查询的回调可能是旧渲染里捕获的闭包(实测在第 2 页点「重置」时拿到的是第 1 页),
@@ -1490,7 +1501,9 @@ function AgGridPlus(props) {
1490
1501
  actions: actionDom,
1491
1502
  settings: [/*#__PURE__*/_jsx(SettingItem, {
1492
1503
  title: "\u5237\u65B0",
1493
- onClick: onRefresh,
1504
+ onClick: function onClick() {
1505
+ return onRefresh();
1506
+ },
1494
1507
  icon: /*#__PURE__*/_jsx(RedoOutlined, {})
1495
1508
  }, "refresh"), /*#__PURE__*/_jsx(Setting, {
1496
1509
  gridKey: gridKey,
@@ -1610,6 +1623,8 @@ function AgGridPlus(props) {
1610
1623
  selectionColumnDef: {
1611
1624
  pinned: 'left',
1612
1625
  lockPosition: true,
1626
+ // 窄屏时保留系统选择列冻结,避免列状态反复重排。@author jwy
1627
+ lockPinned: true,
1613
1628
  width: 50,
1614
1629
  suppressHeaderMenuButton: true
1615
1630
  },
@@ -11,8 +11,16 @@ interface GridPagination {
11
11
  /** 总条数;request 模式下首次请求返回前为 0 */
12
12
  total: number;
13
13
  }
14
+ /** Controls how an imperative grid refresh handles pagination. @author jwy */
15
+ interface GridRefreshOptions {
16
+ /** Return to the first page before refreshing. @author jwy */
17
+ resetPage?: boolean;
18
+ }
14
19
  interface GridRef {
15
- onRefresh: () => void;
20
+ /** 保留无参数签名,兼容直接作为按钮点击回调的既有用法。@author jwy */
21
+ onRefresh(): void;
22
+ /** 刷新结果;可选择先返回第一页。@author jwy */
23
+ onRefresh(options: GridRefreshOptions): void;
16
24
  /**
17
25
  * 跳到第 n 页(1-based),按总页数收口;页码变化时自动重新请求。
18
26
  * 已在该页时不重复请求,需要重取请用 onRefresh。
@@ -262,4 +270,4 @@ interface AgGridColumnPropsClone extends ColDef {
262
270
  calculateType?: "sum" | "avg" | "standardDeviation" | false;
263
271
  }
264
272
  declare function AgGridColumn(props: AgGridColumnPropsClone | ColGroupDef): React.JSX.Element;
265
- export { GridProps, AgGridColumn, GridRef, GridPagination, AgGridColumnPropsClone };
273
+ export { GridProps, AgGridColumn, GridRefreshOptions, GridRef, GridPagination, AgGridColumnPropsClone };
@@ -10,6 +10,8 @@ import React from "react";
10
10
 
11
11
  /** 当前分页状态;页码 1-based。 */
12
12
 
13
+ /** Controls how an imperative grid refresh handles pagination. @author jwy */
14
+
13
15
  //column的行内传参
14
16
  import { jsx as _jsx } from "react/jsx-runtime";
15
17
  function AgGridColumn(props) {
@@ -22,10 +22,9 @@ export var QueryFormMetaContext = /*#__PURE__*/React.createContext({});
22
22
  var useCollapseGrid = function useCollapseGrid(maxRows, defaultExpand) {
23
23
  var grid = useMemo(function () {
24
24
  return FormGrid.createFormGrid({
25
- // 外显条数随宽度增长,宽屏不再卡在 4 个。@author nokecy
25
+ // 只约束查询项最小宽度;相同的最大/最小宽度会让 Formily 在临界宽度反复调整列数。@author jwy
26
26
  maxColumns: QUERY_MAX_COLUMNS,
27
27
  minWidth: QUERY_ITEM_WIDTH,
28
- maxWidth: QUERY_ITEM_WIDTH,
29
28
  maxRows: defaultExpand ? Infinity : maxRows,
30
29
  shouldVisible: function shouldVisible(node, grid) {
31
30
  // 展开状态时,显示所有元素
@@ -23,6 +23,7 @@ import React, { useCallback, useMemo, useState, useRef, useEffect } from 'react'
23
23
  import { Button, Select, Switch, Space, Popconfirm, message, Tag, theme } from 'antd';
24
24
  import { DeleteOutlined, FolderOutlined, FolderAddOutlined, FileOutlined } from '@ant-design/icons';
25
25
  import { AgGridReact } from 'ag-grid-react';
26
+ import { localeText } from "../locale";
26
27
  import { generateId, getColumnIdentity, normalizeCellAlign } from "./columnGroupUtils";
27
28
  import { DebounceNumberInput } from "./DebounceInputs";
28
29
  import { useAgGridTheme } from "../theme";
@@ -742,6 +743,7 @@ var ColumnConfigTable = function ColumnConfigTable(_ref2) {
742
743
  height: scrollY
743
744
  },
744
745
  children: /*#__PURE__*/_jsx(AgGridReact, {
746
+ localeText: localeText,
745
747
  theme: gridTheme,
746
748
  rowData: visibleItems,
747
749
  columnDefs: columnDefs,
@@ -29,6 +29,7 @@ import { Tabs, Button, Input, Space, message, Popconfirm, Tag, Tooltip, Switch,
29
29
  import DraggableModal from "../../draggableModal/index";
30
30
  import { EditOutlined, DeleteOutlined, StarOutlined, StarFilled } from '@ant-design/icons';
31
31
  import { AgGridReact } from 'ag-grid-react';
32
+ import { localeText } from "../locale";
32
33
  import { useGridSchemes } from "../context/useSchemeManager";
33
34
  import { useQueryForm } from "../context/queryFormContext";
34
35
  import { v4 as uuidv4 } from 'uuid';
@@ -783,6 +784,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
783
784
  width: '100%'
784
785
  },
785
786
  children: /*#__PURE__*/_jsx(AgGridReact, {
787
+ localeText: localeText,
786
788
  ref: queryGridRef,
787
789
  theme: gridTheme,
788
790
  rowData: queryItemsData,
@@ -835,6 +837,7 @@ var QuerySchemeManager = function QuerySchemeManager(_ref) {
835
837
  width: '100%'
836
838
  },
837
839
  children: /*#__PURE__*/_jsx(AgGridReact, {
840
+ localeText: localeText,
838
841
  ref: schemeGridRef,
839
842
  theme: gridTheme,
840
843
  rowData: schemes,
@@ -263,9 +263,11 @@ export function useArrayTableBatchRemove(field, sources, props, apiRef, getId) {
263
263
  };
264
264
  return {
265
265
  rowSelection: rowSelection,
266
+ // 选择列与显示序号同属固定的系统列,窄屏优先释放业务列的冻结空间。@author jwy
266
267
  selectionColumnDef: enabled ? _objectSpread({
267
268
  pinned: 'left',
268
269
  lockPosition: true,
270
+ lockPinned: true,
269
271
  width: 46,
270
272
  resizable: false,
271
273
  suppressHeaderMenuButton: true
@@ -19,6 +19,8 @@ export interface DraggableModalProps extends ModalProps {
19
19
  * 关闭后只保留标题拖动,尺寸完全由 width / style 决定。缩放结果不持久化,重新打开恢复默认。
20
20
  */
21
21
  resizable?: boolean;
22
+ /** 是否在打开或缩放时广播全局 resize;关闭后由弹窗内容自行响应容器尺寸变化。@author jwy */
23
+ notifyWindowResize?: boolean;
22
24
  /** 缩放的最小宽度,默认 400;表单类弹层应传 560(规范最小一档)。超出视口 95% 时以视口为准。 */
23
25
  minWidth?: number;
24
26
  /** 缩放的最小高度,默认 300:容纳标题、底栏与至少一行内容。 */
@@ -1,4 +1,4 @@
1
- var _excluded = ["wrapClassName", "width", "open", "style", "destroyOnClose", "destroyOnHidden", "mask", "maskClosable", "dirty", "confirmOnDirtyClose", "onCancel", "resizable", "minWidth", "minHeight"];
1
+ var _excluded = ["wrapClassName", "width", "open", "style", "destroyOnClose", "destroyOnHidden", "mask", "maskClosable", "dirty", "confirmOnDirtyClose", "onCancel", "notifyWindowResize", "resizable", "minWidth", "minHeight"];
2
2
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
3
  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; }
4
4
  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; }
@@ -80,6 +80,8 @@ var DraggableModal = function DraggableModal(props) {
80
80
  _props$confirmOnDirty = props.confirmOnDirtyClose,
81
81
  confirmOnDirtyClose = _props$confirmOnDirty === void 0 ? true : _props$confirmOnDirty,
82
82
  onCancel = props.onCancel,
83
+ _props$notifyWindowRe = props.notifyWindowResize,
84
+ notifyWindowResize = _props$notifyWindowRe === void 0 ? true : _props$notifyWindowRe,
83
85
  _props$resizable = props.resizable,
84
86
  resizable = _props$resizable === void 0 ? true : _props$resizable,
85
87
  _props$minWidth = props.minWidth,
@@ -109,6 +111,7 @@ var DraggableModal = function DraggableModal(props) {
109
111
 
110
112
  // 每帧最多通知一次表格重新测量。关闭或卸载时取消通知及全局鼠标监听。@author nokecy
111
113
  var notifyResize = function notifyResize() {
114
+ if (!notifyWindowResize) return;
112
115
  if (resizeFrame.current !== undefined) return;
113
116
  resizeFrame.current = requestAnimationFrame(function () {
114
117
  resizeFrame.current = undefined;
@@ -125,6 +128,7 @@ var DraggableModal = function DraggableModal(props) {
125
128
  });
126
129
  return;
127
130
  }
131
+ if (!notifyWindowResize) return;
128
132
  var timer;
129
133
  var frame = requestAnimationFrame(function () {
130
134
  timer = setTimeout(function () {
@@ -139,7 +143,7 @@ var DraggableModal = function DraggableModal(props) {
139
143
  if (resizeFrame.current !== undefined) cancelAnimationFrame(resizeFrame.current);
140
144
  resizeFrame.current = undefined;
141
145
  };
142
- }, [open]);
146
+ }, [open, notifyWindowResize]);
143
147
  var onStart = function onStart(_event, uiData) {
144
148
  var _draggleRef$current;
145
149
  var _window$document$docu = window.document.documentElement,
@@ -16,6 +16,7 @@ import { useArrayTableMetrics, useArrayTableTheme } from "../array-table/theme";
16
16
  import { hoistStatics } from "./hoistStatics";
17
17
  import React, { useMemo, useRef } from 'react';
18
18
  import { installDisplaySequenceOrder } from "../shared/gridSequence";
19
+ import { localeText } from "../ag-grid-plus/locale";
19
20
 
20
21
  /** 阅读态直接使用 ArrayTable 的列定义,避免 AgGridPlus 的原值渲染器覆盖格式化结果。@author nokecy */
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -54,6 +55,7 @@ var ReadingArrayTable = observer(function (_ref) {
54
55
  theme: theme,
55
56
  rowHeight: rowHeight,
56
57
  headerHeight: headerHeight,
58
+ localeText: localeText,
57
59
  enableCellTextSelection: true,
58
60
  ensureDomOrder: true,
59
61
  defaultColDef: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nokecy/qc-ui-components",
3
- "version": "2.0.0-beta.5",
3
+ "version": "2.0.0-beta.8",
4
4
  "description": "QC_UI backend-neutral React components",
5
5
  "license": "MIT",
6
6
  "private": false,