kts-component-invoice-operate 3.2.10 → 3.2.12

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.
@@ -10,6 +10,8 @@ export interface IFormValues {
10
10
  invoiceType?: any;
11
11
  }
12
12
  export interface IInvoiceTypeModalProps {
13
+ /** 是否禁用 */
14
+ isDisabled?: boolean;
13
15
  /** 窗口标题 */
14
16
  modalTitle?: string;
15
17
  /** 是否开启 */
package/dist/index.esm.js CHANGED
@@ -14514,7 +14514,7 @@ function TableVirtual$1 (props) {
14514
14514
  }, [props.dataSource, pointer, rowSize]); // 监听滚动
14515
14515
 
14516
14516
  React.useEffect(function () {
14517
- if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody) return;
14517
+ if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
14518
14518
 
14519
14519
  var onScroll = function onScroll() {
14520
14520
  if (!props.dataSource || !tableBody) return;
@@ -18601,10 +18601,11 @@ var useReselectInvoiceType = (function () {
18601
18601
  onClose();
18602
18602
  }, [onClose, typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.onOk]);
18603
18603
  var isEnable = React.useMemo(function () {
18604
+ if ((typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.isDisabled) === true) return false;
18604
18605
  if (model === 'readOnly') return false;
18605
18606
  if (model === 'prefab') return false;
18606
18607
  return true;
18607
- }, [model]);
18608
+ }, [model, typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.isDisabled]);
18608
18609
  var button = React.useMemo(function () {
18609
18610
  if (isEnable === false) return React.createElement(React.Fragment, null);
18610
18611
  return React.createElement(React.Fragment, null, React.createElement(Button$1, {
package/dist/index.js CHANGED
@@ -14524,7 +14524,7 @@ function TableVirtual$1 (props) {
14524
14524
  }, [props.dataSource, pointer, rowSize]); // 监听滚动
14525
14525
 
14526
14526
  React__default['default'].useEffect(function () {
14527
- if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody) return;
14527
+ if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10) return;
14528
14528
 
14529
14529
  var onScroll = function onScroll() {
14530
14530
  if (!props.dataSource || !tableBody) return;
@@ -18611,10 +18611,11 @@ var useReselectInvoiceType = (function () {
18611
18611
  onClose();
18612
18612
  }, [onClose, typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.onOk]);
18613
18613
  var isEnable = React__default['default'].useMemo(function () {
18614
+ if ((typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.isDisabled) === true) return false;
18614
18615
  if (model === 'readOnly') return false;
18615
18616
  if (model === 'prefab') return false;
18616
18617
  return true;
18617
- }, [model]);
18618
+ }, [model, typeModalProps === null || typeModalProps === void 0 ? void 0 : typeModalProps.isDisabled]);
18618
18619
  var button = React__default['default'].useMemo(function () {
18619
18620
  if (isEnable === false) return React__default['default'].createElement(React__default['default'].Fragment, null);
18620
18621
  return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(ktsXui.Button, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kts-component-invoice-operate",
3
- "version": "3.2.10",
3
+ "version": "3.2.12",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",
@@ -82,7 +82,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
82
82
  const endowCodeButton = useEndowCodeButton();
83
83
 
84
84
  /** 重选发票类型 */
85
- const reselectInvoiceType = useReselectInvoiceType()
85
+ const reselectInvoiceType = useReselectInvoiceType();
86
86
 
87
87
  /** 清空重填 */
88
88
  const emptyRefill = useEmptyRefill();
@@ -4,7 +4,6 @@ import { Button } from "kts-xui";
4
4
  import React from "react";
5
5
  import Invoice from '../../../../../../..';
6
6
  import InvoiceTypeModal from "../../../../../../../../InvoiceTypeModal";
7
- import { e } from "mathjs";
8
7
 
9
8
  export default () => {
10
9
 
@@ -29,11 +28,12 @@ export default () => {
29
28
  onClose();
30
29
  }, [onClose, typeModalProps?.onOk]);
31
30
 
32
- const isEnable = React.useMemo(()=>{
31
+ const isEnable = React.useMemo(() => {
32
+ if (typeModalProps?.isDisabled === true) return false
33
33
  if (model === 'readOnly') return false;
34
34
  if (model === 'prefab') return false;
35
35
  return true;
36
- }, [model])
36
+ }, [model, typeModalProps?.isDisabled])
37
37
 
38
38
  const button = React.useMemo(() => {
39
39
  if (isEnable === false) return <></>;
@@ -63,7 +63,7 @@ export default function <T extends object = any>(props: TableProps<T>) {
63
63
 
64
64
  // 监听滚动
65
65
  React.useEffect(() => {
66
- if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody)
66
+ if (!self || !placeholder || !props.dataSource || !rowHeight || !tableBody || props.dataSource.length < 10)
67
67
  return;
68
68
 
69
69
  const onScroll = () => {
@@ -18,6 +18,9 @@ export interface IFormValues {
18
18
 
19
19
  export interface IInvoiceTypeModalProps {
20
20
 
21
+ /** 是否禁用 */
22
+ isDisabled?:boolean;
23
+
21
24
  /** 窗口标题 */
22
25
  modalTitle?: string;
23
26