@pointcloud/pcloud-components 0.1.15 → 0.1.17

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.
@@ -76,9 +76,15 @@ declare type MentionItemProps = {
76
76
  declare type CheckboxItemProps = {
77
77
  renderType?: 'checkbox';
78
78
  } & DItemBaseProps & CheckboxProps;
79
+ declare type DCheckboxGroupProps = {
80
+ renderType?: 'checkboxGroup';
81
+ } & DItemBaseProps & CheckboxGroupProps;
79
82
  declare type RadioItemProps = {
80
83
  renderType?: 'radio';
81
84
  } & DItemBaseProps & RadioProps;
85
+ declare type DRadioGorupProps = {
86
+ renderType?: 'radioGroup';
87
+ } & DItemBaseProps & RadioGroupProps;
82
88
  declare type RateItemProps = {
83
89
  renderType?: 'rate';
84
90
  } & DItemBaseProps & RateProps;
@@ -103,5 +109,5 @@ declare type ButtonItemProps = {
103
109
  declare type DividerItemProps = {
104
110
  renderType?: 'divider';
105
111
  } & DItemBaseProps & DividerProps;
106
- export declare type DItemProps = CustomItemProps | DInputItemProps | InputItemProps | TextAreaItemProps | PasswordItemProps | InputNumberItemProps | AutoCompleteItemProps | DSelectItemProps | SelectItemProps | DCascaderItemProps | CascaderItemProps | DTreeSelectItemProps | TreeSelectItemProps | DatePickerItemProps | TimePickerItemProps | RangePickerItemProps | MentionItemProps | CheckboxItemProps | CheckboxGroupProps | RadioItemProps | RadioGroupProps | RateItemProps | SliderItemProps | SwitchItemProps | TransferItemProps | UploadItemProps | DUploadItemProps | ButtonItemProps | DividerItemProps;
112
+ export declare type DItemProps = CustomItemProps | DInputItemProps | InputItemProps | TextAreaItemProps | PasswordItemProps | InputNumberItemProps | AutoCompleteItemProps | DSelectItemProps | SelectItemProps | DCascaderItemProps | CascaderItemProps | DTreeSelectItemProps | TreeSelectItemProps | DatePickerItemProps | TimePickerItemProps | RangePickerItemProps | MentionItemProps | CheckboxItemProps | CheckboxGroupProps | DCheckboxGroupProps | RadioItemProps | RadioGroupProps | DRadioGorupProps | RateItemProps | SliderItemProps | SwitchItemProps | TransferItemProps | UploadItemProps | DUploadItemProps | ButtonItemProps | DividerItemProps;
107
113
  export {};
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { DModalProps, DeleteModalProps } from './interface';
3
+ import './styles/index.less';
4
+ declare function DModal(props: DModalProps): JSX.Element;
5
+ declare namespace DModal {
6
+ export var useModal: typeof import("antd/lib/modal/useModal").default;
7
+ export var info: import("antd/lib/modal/confirm").ModalFunc;
8
+ export var success: import("antd/lib/modal/confirm").ModalFunc;
9
+ export var error: import("antd/lib/modal/confirm").ModalFunc;
10
+ export var warning: import("antd/lib/modal/confirm").ModalFunc;
11
+ export var confirm: import("antd/lib/modal/confirm").ModalFunc;
12
+ var _a: ({ content, onOk, onCancel, zIndex }: DeleteModalProps) => {
13
+ destroy: () => void;
14
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
15
+ };
16
+ export { _a as delete };
17
+ }
18
+ export default DModal;
@@ -3,10 +3,10 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
3
3
  var _excluded = ["children", "mode"];
4
4
  import { ConfigContext } from "../ConfigProvider";
5
5
  import { Modal } from 'antd';
6
- import React, { useContext, useEffect, useMemo, useRef } from 'react';
6
+ import { useContext, useEffect, useMemo, useRef } from 'react';
7
7
  import "./styles/index.less";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
- function LModal(props) {
9
+ function DModal(props) {
10
10
  var children = props.children,
11
11
  _props$mode = props.mode,
12
12
  mode = _props$mode === void 0 ? 'absolute' : _props$mode,
@@ -19,7 +19,8 @@ function LModal(props) {
19
19
  return _objectSpread({
20
20
  getContainer: containerRef.current,
21
21
  width: ((_otherProps$style = otherProps.style) === null || _otherProps$style === void 0 ? void 0 : _otherProps$style.width) || '80%',
22
- centered: true
22
+ centered: true,
23
+ maskClosable: false
23
24
  }, otherProps);
24
25
  }, [otherProps]);
25
26
  useEffect(function () {
@@ -49,4 +50,28 @@ function LModal(props) {
49
50
  }))
50
51
  });
51
52
  }
52
- export default LModal;
53
+ DModal.useModal = Modal.useModal;
54
+ DModal.info = Modal.info;
55
+ DModal.success = Modal.success;
56
+ DModal.error = Modal.error;
57
+ DModal.warning = Modal.warning;
58
+ DModal.confirm = Modal.confirm;
59
+ DModal.delete = function (_ref) {
60
+ var content = _ref.content,
61
+ onOk = _ref.onOk,
62
+ onCancel = _ref.onCancel,
63
+ zIndex = _ref.zIndex;
64
+ return DModal.confirm({
65
+ title: '删除提示',
66
+ content: content,
67
+ centered: true,
68
+ closable: true,
69
+ okText: '确定',
70
+ cancelText: '取消',
71
+ className: 'pui-modal-container',
72
+ onOk: onOk,
73
+ onCancel: onCancel,
74
+ zIndex: zIndex
75
+ });
76
+ };
77
+ export default DModal;
@@ -1,8 +1,14 @@
1
- import { ModalProps } from 'antd';
2
1
  import { ReactNode } from 'react';
2
+ import { ModalProps } from 'antd';
3
3
  declare type IModalProps = Omit<ModalProps, 'width' | 'className'>;
4
- export interface LModalProps extends IModalProps {
4
+ export interface DModalProps extends IModalProps {
5
5
  children?: ReactNode | undefined;
6
6
  mode?: 'absolute' | 'relative' | 'panel';
7
7
  }
8
+ export interface DeleteModalProps {
9
+ content?: React.ReactNode;
10
+ onOk?: (...args: any[]) => any;
11
+ onCancel?: (...args: any[]) => any;
12
+ zIndex?: number;
13
+ }
8
14
  export {};
@@ -1,27 +1,27 @@
1
- @import '../../commonStyle/index.less';
2
-
3
- .@{prefix}-modal-container {
4
- .ant-modal-wrap {
5
- .ant-modal {
6
- max-width: unset;
7
- height: 100%;
8
-
9
- .ant-modal-content {
10
- width: 100%;
11
- height: 100%;
12
- }
13
- }
14
- }
15
- }
16
-
17
- .@{prefix}-absolute-modal-container {
18
- .ant-modal-wrap {
19
- position: fixed;
20
- }
21
- }
22
-
23
- .@{prefix}-relative-modal-container {
24
- .ant-modal-wrap {
25
- position: absolute;
26
- }
27
- }
1
+ @import '../../commonStyle/index.less';
2
+
3
+ .@{prefix}-modal-container {
4
+ .ant-modal-wrap {
5
+ .ant-modal {
6
+ max-width: unset;
7
+ height: 100%;
8
+
9
+ .ant-modal-content {
10
+ width: 100%;
11
+ height: 100%;
12
+ }
13
+ }
14
+ }
15
+ }
16
+
17
+ .@{prefix}-absolute-modal-container {
18
+ .ant-modal-wrap {
19
+ position: fixed;
20
+ }
21
+ }
22
+
23
+ .@{prefix}-relative-modal-container {
24
+ .ant-modal-wrap {
25
+ position: absolute;
26
+ }
27
+ }
@@ -9,7 +9,7 @@ var _excluded = ["loadMore", "defaultColumnProps", "actionColumn", "showErrorMsg
9
9
  * @LastEditTime : 2023-08-16 16:45:15
10
10
  * @Description : 基于antd的Table组件
11
11
  */
12
- import React, { forwardRef, useEffect, useRef, useState, useContext } from 'react';
12
+ import React, { forwardRef, useEffect, useRef, useState, useContext, useMemo } from 'react';
13
13
  import { message, Table } from 'antd';
14
14
  import { ConfigContext } from "../ConfigProvider";
15
15
  import "./index.less";
@@ -125,13 +125,15 @@ function InternalTable(props, ref) {
125
125
  var _className = "".concat(getPrefixCls('table'), " ").concat(className || '', " ").concat(_pagination ? 'height-on-page' : '');
126
126
 
127
127
  // loading 默认延迟 600ms
128
- var _loading = typeof loading === 'boolean' ? {
129
- spinning: loading,
130
- delay: 600
131
- } : _objectSpread({
132
- delay: 600,
133
- spinning: false
134
- }, loading);
128
+ var _loading = useMemo(function () {
129
+ return typeof loading === 'boolean' ? {
130
+ spinning: loading,
131
+ delay: 500
132
+ } : _objectSpread({
133
+ delay: 500,
134
+ spinning: false
135
+ }, loading);
136
+ }, [loading]);
135
137
 
136
138
  // 加载数据
137
139
  var loadData = function loadData(params) {
@@ -212,7 +214,7 @@ function InternalTable(props, ref) {
212
214
  dataSource: tableSource.records,
213
215
  pagination: _tablePagination,
214
216
  scroll: _scroll,
215
- loading: _objectSpread(_objectSpread({}, _loading), {}, {
217
+ loading: dataSource ? _loading : _objectSpread(_objectSpread({}, _loading), {}, {
216
218
  spinning: tableSource.loading
217
219
  })
218
220
  }));
@@ -20,8 +20,8 @@ export type { DColumnType, DTableProps, DTableSourceProps, TableParamsProps } fr
20
20
  export { default as DTable } from './DTable';
21
21
  export type { DFormProps, DFormRefProps, DItemProps } from './DForm';
22
22
  export { default as DForm } from './DForm';
23
- export type { LModalProps } from './LModal/interface';
24
- export { default as LModal } from './LModal';
23
+ export type { DModalProps } from './DModal/interface';
24
+ export { default as DModal } from './DModal';
25
25
  export { default as ColorPicker } from './ColorPicker';
26
26
  export type { ColorPickerType, TwitterPickerType, HuePickerType, AlphaPickerType, BlockPickerType, ChromePickerType, CompactPickerType, CirclePickerType, SliderPickerType, } from './ColorPicker/interface';
27
27
  export { default as ScrollNumber } from './ScrollNumber';
package/dist/esm/index.js CHANGED
@@ -12,6 +12,6 @@ export { default as DTreeSelect } from "./DTreeSelect";
12
12
  export { default as DUpload } from "./DUpload";
13
13
  export { default as DTable } from "./DTable";
14
14
  export { default as DForm } from "./DForm";
15
- export { default as LModal } from "./LModal";
15
+ export { default as DModal } from "./DModal";
16
16
  export { default as ColorPicker } from "./ColorPicker";
17
17
  export { default as ScrollNumber } from "./ScrollNumber";