@para-ui/core 4.0.29 → 4.0.30

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.
package/Cascader/index.js CHANGED
@@ -1,15 +1,14 @@
1
- import { C as Cascader } from '../_verture/index-68f0506c.js';
2
- export { C as default } from '../_verture/index-68f0506c.js';
1
+ import { C as Cascader } from '../_verture/index-8ec857b4.js';
2
+ export { C as default } from '../_verture/index-8ec857b4.js';
3
3
  import '../_verture/tslib.es6-55ed4bd2.js';
4
4
  import 'react/jsx-runtime';
5
- import '../_verture/Portal-5bd49559.js';
5
+ import '../_verture/Portal-5bf66fed.js';
6
6
  import '../_verture/slicedToArray-a8206399.js';
7
7
  import '../_verture/unsupportedIterableToArray-cb478f24.js';
8
8
  import 'react';
9
9
  import 'react-dom';
10
- import '../_verture/typeof-adeedc13.js';
10
+ import '../_verture/defineProperty-f0e15205.js';
11
11
  import '../_verture/toConsumableArray-8f4c9589.js';
12
- import '../_verture/defineProperty-6f62bb2a.js';
13
12
  import 'rc-motion';
14
13
  import 'clsx';
15
14
  import '../_verture/typeof-6ec38efd.js';
@@ -6,7 +6,7 @@ import SearchIcon from '@para-ui/icons/Search';
6
6
  import CloseIcon from '@para-ui/icons/Close';
7
7
  import CloseCircleF from '@para-ui/icons/CloseCircleF';
8
8
  import Table from '../Table/index.js';
9
- import { T as Tree } from '../_verture/index-e9405e35.js';
9
+ import { T as Tree } from '../_verture/index-28edf318.js';
10
10
  import { Button } from '../Button/index.js';
11
11
  import { D as Dropdown } from '../_verture/index-bde7aabe.js';
12
12
  import { Popover } from '../Popover/index.js';
@@ -56,11 +56,14 @@ import 'rc-pagination';
56
56
  import '@para-ui/icons/Right';
57
57
  import '@para-ui/icons/DoubleLeft';
58
58
  import '@para-ui/icons/DoubleRight';
59
+ import '../_verture/toConsumableArray-8f4c9589.js';
60
+ import '../_verture/unsupportedIterableToArray-cb478f24.js';
61
+ import '../_verture/defineProperty-f0e15205.js';
62
+ import '../_verture/slicedToArray-a8206399.js';
63
+ import '../_verture/index-8ac46bd9.js';
64
+ import '../_verture/typeof-6ec38efd.js';
59
65
  import 'rc-tree';
60
- import '../_verture/typeof-adeedc13.js';
61
66
  import '@para-ui/icons/Document';
62
- import '../_verture/slicedToArray-a8206399.js';
63
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
64
67
  import 'react-dom';
65
68
  import '@para-ui/icons/EditFile';
66
69
  import '@para-ui/icons/PlusCircle';
@@ -27,8 +27,7 @@ import '@para-ui/icons/Forbid';
27
27
  import '@paraview/lib';
28
28
  import '../_verture/tinycolor-ece3542d.js';
29
29
  import '@para-ui/icons/Plus';
30
- import '../_verture/defineProperty-6f62bb2a.js';
31
- import '../_verture/typeof-adeedc13.js';
30
+ import '../_verture/defineProperty-f0e15205.js';
32
31
  import 'rc-picker';
33
32
  import '@para-ui/icons/CloseCircleF';
34
33
  import '@para-ui/icons/Calendar';
@@ -2,7 +2,7 @@ import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { Button } from '../Button/index.js';
4
4
  import { Tag } from '../Tag/index.js';
5
- import { _ as _defineProperty } from '../_verture/defineProperty-6f62bb2a.js';
5
+ import { a as _defineProperty } from '../_verture/defineProperty-f0e15205.js';
6
6
  import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
7
7
  import React__default, { forwardRef, useImperativeHandle } from 'react';
8
8
  import clsx from 'clsx';
@@ -35,7 +35,6 @@ import '@para-ui/icons/Close';
35
35
  import '@para-ui/icons/EditOutline';
36
36
  import '../_verture/tinycolor-ece3542d.js';
37
37
  import '@para-ui/icons/Plus';
38
- import '../_verture/typeof-adeedc13.js';
39
38
  import '../Help/index.js';
40
39
  import '@para-ui/icons/Help';
41
40
 
@@ -70,12 +70,15 @@ import 'rc-pagination';
70
70
  import '@para-ui/icons/Right';
71
71
  import '@para-ui/icons/DoubleLeft';
72
72
  import '@para-ui/icons/DoubleRight';
73
- import '../_verture/index-e9405e35.js';
73
+ import '../_verture/index-28edf318.js';
74
+ import '../_verture/toConsumableArray-8f4c9589.js';
75
+ import '../_verture/unsupportedIterableToArray-cb478f24.js';
76
+ import '../_verture/defineProperty-f0e15205.js';
77
+ import '../_verture/slicedToArray-a8206399.js';
78
+ import '../_verture/index-8ac46bd9.js';
79
+ import '../_verture/typeof-6ec38efd.js';
74
80
  import 'rc-tree';
75
- import '../_verture/typeof-adeedc13.js';
76
81
  import '@para-ui/icons/Document';
77
- import '../_verture/slicedToArray-a8206399.js';
78
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
79
82
  import 'react-dom';
80
83
  import '@para-ui/icons/EditFile';
81
84
  import '@para-ui/icons/PlusCircle';
@@ -87,7 +90,6 @@ import '../Tag/index.js';
87
90
  import '@para-ui/icons/EditOutline';
88
91
  import '../_verture/tinycolor-ece3542d.js';
89
92
  import '@para-ui/icons/Plus';
90
- import '../_verture/defineProperty-6f62bb2a.js';
91
93
  import 'rc-picker';
92
94
  import '@para-ui/icons/Calendar';
93
95
  import '@para-ui/icons/Time';
package/Form/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { DeepClone } from '@paraview/lib';
3
3
  import React__default from 'react';
4
- import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-15a0b6a6.js';
4
+ import { F as FormItem, l as localeJson, v as validate } from '../_verture/index-33866394.js';
5
5
  import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
6
6
  import { u as useFormatMessage } from '../_verture/useFormatMessage-1fc7c957.js';
7
7
  import '../TextField/index.js';
@@ -69,9 +69,12 @@ import 'rc-pagination';
69
69
  import '@para-ui/icons/Right';
70
70
  import '@para-ui/icons/DoubleLeft';
71
71
  import '@para-ui/icons/DoubleRight';
72
- import '../_verture/index-e9405e35.js';
72
+ import '../_verture/index-28edf318.js';
73
+ import '../_verture/toConsumableArray-8f4c9589.js';
74
+ import '../_verture/defineProperty-f0e15205.js';
75
+ import '../_verture/index-8ac46bd9.js';
76
+ import '../_verture/typeof-6ec38efd.js';
73
77
  import 'rc-tree';
74
- import '../_verture/typeof-adeedc13.js';
75
78
  import '@para-ui/icons/Document';
76
79
  import 'react-dom';
77
80
  import '@para-ui/icons/EditFile';
package/FormItem/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'react/jsx-runtime';
2
2
  import 'react';
3
- export { F as default } from '../_verture/index-15a0b6a6.js';
3
+ export { F as default } from '../_verture/index-33866394.js';
4
4
  import 'clsx';
5
5
  import '../Label/index.js';
6
6
  import '../_verture/constant-5317fc89.js';
@@ -69,9 +69,12 @@ import 'rc-pagination';
69
69
  import '@para-ui/icons/Right';
70
70
  import '@para-ui/icons/DoubleLeft';
71
71
  import '@para-ui/icons/DoubleRight';
72
- import '../_verture/index-e9405e35.js';
72
+ import '../_verture/index-28edf318.js';
73
+ import '../_verture/toConsumableArray-8f4c9589.js';
74
+ import '../_verture/defineProperty-f0e15205.js';
75
+ import '../_verture/index-8ac46bd9.js';
76
+ import '../_verture/typeof-6ec38efd.js';
73
77
  import 'rc-tree';
74
- import '../_verture/typeof-adeedc13.js';
75
78
  import '@para-ui/icons/Document';
76
79
  import 'react-dom';
77
80
  import '@para-ui/icons/EditFile';
@@ -1,5 +1,5 @@
1
- import { u as useModal } from '../_verture/modalContext-10f0c5aa.js';
2
- export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-10f0c5aa.js';
1
+ import { u as useModal } from '../_verture/modalContext-c57b51b7.js';
2
+ export { F as FunctionModalProvider, u as default, a as useClose } from '../_verture/modalContext-c57b51b7.js';
3
3
  import '../_verture/tslib.es6-55ed4bd2.js';
4
4
  import 'react/jsx-runtime';
5
5
  import 'react';
package/Image/index.js CHANGED
@@ -2,10 +2,9 @@ import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import React__default, { useState, useRef, useEffect, useContext, useMemo } from 'react';
5
- import { i as warningOnce, d as wrapperRaf, _ as _objectSpread2, w as warning, c as clsx, P as Portal, K as KeyCode, b as _objectWithoutProperties, a as _extends, j as useMergedState } from '../_verture/Portal-5bd49559.js';
6
- import { _ as _defineProperty } from '../_verture/defineProperty-6f62bb2a.js';
5
+ import { i as warningOnce, d as wrapperRaf, _ as _objectSpread2, w as warning, c as clsx, P as Portal, K as KeyCode, b as _objectWithoutProperties, a as _extends, j as useMergedState } from '../_verture/Portal-5bf66fed.js';
6
+ import { _ as _typeof, a as _defineProperty } from '../_verture/defineProperty-f0e15205.js';
7
7
  import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
8
- import { _ as _typeof } from '../_verture/typeof-adeedc13.js';
9
8
  import Dialog from 'rc-dialog';
10
9
  import ReactDOM from 'react-dom';
11
10
  import CSSMotion from 'rc-motion';
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 版本: 4.0.30
2
+ para-ui/core@4.0.30 发布
3
+ 【范围输入框-RangeInput】新增组件范围输入框
4
+
1
5
  ## 版本: 4.0.29
2
6
  【展示内容容器-ContentBox】新增展示内容容器-ContentBox
3
7
 
@@ -0,0 +1,55 @@
1
+ /**
2
+ * @author linhd
3
+ * @date 2024/7/29 10:21
4
+ * @description 范围输入框
5
+ */
6
+ import React, { FunctionComponent, ReactNode } from 'react';
7
+ import { LabelTooltipProps } from '../Label';
8
+ import { InputNumberProps } from '../InputNumber';
9
+ import { HelperTextDetailProps } from '../HelperText';
10
+ import { TooltipProps } from '../Tooltip';
11
+ import './index.scss';
12
+ export interface RangeInputProps extends HelperTextDetailProps {
13
+ /** 样式class */
14
+ className?: string;
15
+ /** style */
16
+ style?: React.CSSProperties;
17
+ /** 标题 */
18
+ label?: ReactNode;
19
+ /** 帮组提示信息 */
20
+ labelTooltip?: LabelTooltipProps;
21
+ /** 尺寸 */
22
+ size?: 'small' | 'medium' | 'large';
23
+ /** 是否必填 */
24
+ required?: boolean;
25
+ /** 是否禁用 */
26
+ disabled?: boolean | [boolean, boolean];
27
+ /**
28
+ * 禁用提示
29
+ */
30
+ disabledTooltip?: TooltipProps | [TooltipProps, TooltipProps];
31
+ /** 默认值 不受控 */
32
+ defaultValue?: [number | null, number | null];
33
+ /** 默认值 */
34
+ value?: [number | null, number | null];
35
+ /** 中间符号 */
36
+ separator?: ReactNode;
37
+ /** 单位 */
38
+ unit?: ReactNode;
39
+ /** 提示语 */
40
+ placeholder?: ReactNode | [ReactNode, ReactNode];
41
+ /** 输入框其他参数 */
42
+ otherProps?: [InputNumberProps, InputNumberProps];
43
+ /**
44
+ * 改变值
45
+ * */
46
+ onChange?: (val: [number | null, number | null], index: number) => void;
47
+ /** 失去焦点 */
48
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>, index: number) => void;
49
+ /** 得到焦点 */
50
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>, index: number) => void;
51
+ /** 回车事件 */
52
+ onEnter?: (event: React.KeyboardEventHandler<HTMLInputElement>, index: number) => void;
53
+ }
54
+ export declare const RangeInput: FunctionComponent<RangeInputProps>;
55
+ export default RangeInput;
@@ -0,0 +1,169 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
3
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
4
+ import Label from '../Label/index.js';
5
+ import { InputNumber } from '../InputNumber/index.js';
6
+ import HelperText from '../HelperText/index.js';
7
+ import clsx from 'clsx';
8
+ import { Tooltip } from '../Tooltip/index.js';
9
+ import { DeepClone } from '@paraview/lib';
10
+ import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
11
+ import '../_verture/tslib.es6-55ed4bd2.js';
12
+ import '../Help/index.js';
13
+ import '@para-ui/icons/Help';
14
+ import 'rc-tooltip';
15
+ import 'rc-tooltip/lib/placements';
16
+ import '@para-ui/icons/Forbid';
17
+ import 'rc-input-number';
18
+ import '@para-ui/icons/Up';
19
+ import '@para-ui/icons/Down';
20
+
21
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-range-input {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n display: inline-block;\n width: 100%;\n}\n.paraui-v4-range-input > .range-input-content {\n border: 1px solid;\n border-radius: 4px;\n border-color: rgb(212, 218, 227);\n display: flex;\n align-items: center;\n width: 100%;\n position: relative;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-range-input > .range-input-content:hover {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-range-input > .range-input-content > .paraui-v4-input-number > .input-number-content {\n border: none;\n background-color: rgb(255, 255, 255);\n}\n.paraui-v4-range-input > .range-input-content > .separator {\n color: rgb(29, 33, 38);\n font-size: 14px;\n padding-left: 10px;\n height: 100%;\n display: flex;\n align-items: center;\n line-height: 1;\n}\n.paraui-v4-range-input > .range-input-content > .unit {\n color: rgb(29, 33, 38);\n font-size: 14px;\n padding: 0 10px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-focus > .range-input-content {\n border-color: rgb(46, 101, 230);\n}\n.paraui-v4-range-input.paraui-v4-range-input-disabled > .range-input-content {\n cursor: not-allowed;\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-range-input.paraui-v4-range-input-disabled > .range-input-content:hover {\n border-color: rgb(212, 218, 227);\n}\n.paraui-v4-range-input.paraui-v4-range-input-disabled > .range-input-content > .paraui-v4-input-number > .input-number-content {\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-range-input.paraui-v4-range-input-error > .range-input-content {\n border-color: rgb(244, 66, 66);\n}\n.paraui-v4-range-input.paraui-v4-range-input-error > .range-input-content:hover {\n border-color: rgb(244, 66, 66);\n}\n.paraui-v4-range-input.paraui-v4-range-input-small > .range-input-content {\n height: 28px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-small > .range-input-content > .paraui-v4-input-number .input-number-content {\n height: 26px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-medium > .range-input-content {\n height: 28px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-medium > .range-input-content > .paraui-v4-input-number .input-number-content {\n height: 26px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-large > .range-input-content {\n height: 32px;\n}\n.paraui-v4-range-input.paraui-v4-range-input-large > .range-input-content > .paraui-v4-input-number .input-number-content {\n height: 30px;\n}";
22
+ styleInject(css_248z);
23
+
24
+ const RangeInput = props => {
25
+ const {
26
+ className,
27
+ style,
28
+ label,
29
+ labelTooltip,
30
+ size = 'large',
31
+ required = false,
32
+ disabled = false,
33
+ disabledTooltip,
34
+ defaultValue,
35
+ value,
36
+ error = false,
37
+ hideErrorDom,
38
+ helperText = '',
39
+ separator = '~',
40
+ unit,
41
+ placeholder,
42
+ onFocus,
43
+ onBlur,
44
+ onEnter,
45
+ onChange,
46
+ otherProps
47
+ } = props;
48
+ const [valueCom, setValueCom] = useState([null, null]);
49
+ const [focus, setFocus] = useState(false); // 是否获取焦点
50
+ useEffect(() => {
51
+ if (props.defaultValue !== undefined) setValueCom(props.defaultValue);
52
+ }, []);
53
+ // 监听value
54
+ useEffect(() => {
55
+ if (value !== undefined) {
56
+ setValueCom(value);
57
+ }
58
+ }, [value]);
59
+ /** 处理placeholder */
60
+ const handlePlaceholder = index => {
61
+ if (placeholder && placeholder instanceof Array) {
62
+ return placeholder[index];
63
+ }
64
+ return placeholder;
65
+ };
66
+ /** 处理disabled */
67
+ const handleDisabled = index => {
68
+ if (disabled && disabled instanceof Array) {
69
+ return disabled[index];
70
+ }
71
+ return disabled;
72
+ };
73
+ /** 得到焦点 */
74
+ const onFocusCom = index => event => {
75
+ setFocus(true);
76
+ onFocus && onFocus(event, index);
77
+ };
78
+ /** 失去焦点 */
79
+ const onBlurCom = index => event => {
80
+ setFocus(false);
81
+ onBlur && onBlur(event, index);
82
+ if (valueCom[0] !== null && valueCom[1] !== null) {
83
+ if (valueCom[0] > valueCom[1]) {
84
+ onChangeCom(index)(null);
85
+ }
86
+ }
87
+ };
88
+ /** 回车事件 */
89
+ const onEnterCom = index => event => {
90
+ onEnter && onEnter(event, index);
91
+ };
92
+ /** change事件 */
93
+ const onChangeCom = index => val => {
94
+ const valHandle = valueCom ? DeepClone(valueCom) : [];
95
+ valHandle[index] = val;
96
+ if (props.value === undefined) {
97
+ setValueCom(valHandle);
98
+ }
99
+ onChange && onChange(valHandle, index);
100
+ };
101
+ const contentRender = () => {
102
+ return jsxs("div", Object.assign({
103
+ className: 'range-input-content'
104
+ }, {
105
+ children: [jsx(InputNumber, Object.assign({}, otherProps && otherProps[0], {
106
+ btnMode: "none",
107
+ hideErrorDom: true,
108
+ placeholder: handlePlaceholder(0),
109
+ disabled: handleDisabled(0),
110
+ disabledTooltip: disabledTooltip === null || disabledTooltip === void 0 ? void 0 : disabledTooltip[0],
111
+ value: valueCom[0],
112
+ onFocus: onFocusCom(0),
113
+ onBlur: onBlurCom(0),
114
+ onPressEnter: onEnterCom(0),
115
+ onChange: onChangeCom(0)
116
+ })), jsx("span", Object.assign({
117
+ className: 'separator'
118
+ }, {
119
+ children: separator
120
+ })), jsx(InputNumber, Object.assign({}, otherProps && otherProps[1], {
121
+ btnMode: "none",
122
+ hideErrorDom: true,
123
+ placeholder: handlePlaceholder(1),
124
+ disabled: handleDisabled(1),
125
+ disabledTooltip: disabledTooltip === null || disabledTooltip === void 0 ? void 0 : disabledTooltip[1],
126
+ value: valueCom[1],
127
+ onFocus: onFocusCom(1),
128
+ onBlur: onBlurCom(1),
129
+ onPressEnter: onEnterCom(1),
130
+ onChange: onChangeCom(1)
131
+ })), unit && jsx("span", Object.assign({
132
+ className: 'unit'
133
+ }, {
134
+ children: unit
135
+ }))]
136
+ }));
137
+ };
138
+ /** 处理内容 */
139
+ const handleContent = () => {
140
+ if (disabledTooltip && !(disabledTooltip instanceof Array)) {
141
+ return jsx(Tooltip, Object.assign({
142
+ disabled: true
143
+ }, disabledTooltip, {
144
+ children: contentRender()
145
+ }));
146
+ }
147
+ return contentRender();
148
+ };
149
+ return jsxs("div", Object.assign({
150
+ className: clsx(className, "".concat($prefixCls, "-range-input"), "".concat($prefixCls, "-range-input-").concat(size), {
151
+ ["".concat($prefixCls, "-range-input-focus")]: focus,
152
+ ["".concat($prefixCls, "-range-input-disabled")]: disabled === true || handleDisabled(0) && handleDisabled(1),
153
+ ["".concat($prefixCls, "-range-input-error")]: error
154
+ }),
155
+ style: style
156
+ }, {
157
+ children: [jsx(Label, Object.assign({
158
+ label: label,
159
+ required: required
160
+ }, labelTooltip)), handleContent(), jsx(HelperText, {
161
+ className: "range-input-error-text",
162
+ error: error,
163
+ helperText: helperText,
164
+ hideErrorDom: hideErrorDom
165
+ })]
166
+ }));
167
+ };
168
+
169
+ export { RangeInput, RangeInput as default };