@hw-component/form 1.10.68 → 1.10.70

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.
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import type { HItemProps } from "@/components/Form/modal";
2
+ import type { HItemProps } from "../Form/modal";
3
3
  declare const _default: {
4
- Component: React.ForwardRefExoticComponent<import("@/components/Form/modal").HFormItemProps & React.RefAttributes<any>>;
4
+ Component: React.ForwardRefExoticComponent<import("../Form/modal").HFormItemProps & React.RefAttributes<any>>;
5
5
  placeholder: ({ label }: HItemProps) => string[];
6
6
  };
7
7
  export default _default;
package/es/Input/hooks.js CHANGED
@@ -26,7 +26,7 @@ var useNumberGroupRestriction = function useNumberGroupRestriction(_ref) {
26
26
  };
27
27
  var minValControl = function minValControl() {
28
28
  if (minValMk) {
29
- return minValMk(maxVal);
29
+ return minValMk(minVal);
30
30
  }
31
31
  if (!(minVal !== null && minVal !== void 0 && minVal.toString())) {
32
32
  return min;
@@ -12,7 +12,7 @@ import Index$2 from './components/AllSelect.js';
12
12
  import { useMatchConfigProps, useChangeOptions, useClassName } from '../hooks/index.js';
13
13
  import HFormConnect from '../Form/HFormConnect.js';
14
14
 
15
- var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter", "className"],
15
+ var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter", "className", "selfPopupContainer"],
16
16
  _excluded2 = ["value", "label"];
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -53,6 +53,7 @@ var Index = function Index(_ref) {
53
53
  addonAfter = _ref.addonAfter,
54
54
  _ref$className = _ref.className,
55
55
  className = _ref$className === void 0 ? "" : _ref$className,
56
+ selfPopupContainer = _ref.selfPopupContainer,
56
57
  props = _objectWithoutProperties(_ref, _excluded);
57
58
  var ref = useRef();
58
59
  var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
@@ -146,9 +147,9 @@ var Index = function Index(_ref) {
146
147
  showSearch: mathShowSearch,
147
148
  labelInValue: true,
148
149
  onPopupScroll: propsOnPopupScroll || onPopupScroll,
149
- getPopupContainer: function getPopupContainer() {
150
+ getPopupContainer: selfPopupContainer ? function () {
150
151
  return ref.current || document.body;
151
- }
152
+ } : undefined
152
153
  }, props), {}, {
153
154
  children: data === null || data === void 0 ? void 0 : data.map(function (item) {
154
155
  var optionValue = item.value,
@@ -39,6 +39,7 @@ export interface HSelectProps extends Omit<SelectProps, "options" | "placeholder
39
39
  addonBefore?: React.ReactNode;
40
40
  addonAfter?: React.ReactNode;
41
41
  onChange?: (value: any, opts?: OptionType[] | OptionType) => void;
42
+ selfPopupContainer?: boolean;
42
43
  }
43
44
  export interface FilterDataModal {
44
45
  value: any;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import type { HItemProps } from "@/components/Form/modal";
2
+ import type { HItemProps } from "../Form/modal";
3
3
  declare const _default: {
4
- Component: React.ForwardRefExoticComponent<import("@/components/Form/modal").HFormItemProps & React.RefAttributes<any>>;
4
+ Component: React.ForwardRefExoticComponent<import("../Form/modal").HFormItemProps & React.RefAttributes<any>>;
5
5
  placeholder: ({ label }: HItemProps) => string[];
6
6
  };
7
7
  export default _default;
@@ -27,7 +27,7 @@ var useNumberGroupRestriction = function useNumberGroupRestriction(_ref) {
27
27
  };
28
28
  var minValControl = function minValControl() {
29
29
  if (minValMk) {
30
- return minValMk(maxVal);
30
+ return minValMk(minVal);
31
31
  }
32
32
  if (!(minVal !== null && minVal !== void 0 && minVal.toString())) {
33
33
  return min;
@@ -15,7 +15,7 @@ var AllSelect = require('./components/AllSelect.js');
15
15
  var index = require('../hooks/index.js');
16
16
  var HFormConnect = require('../Form/HFormConnect.js');
17
17
 
18
- var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter", "className"],
18
+ var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch", "isList", "onPopupScroll", "addonBefore", "addonAfter", "className", "selfPopupContainer"],
19
19
  _excluded2 = ["value", "label"];
20
20
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
21
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -56,6 +56,7 @@ var Index = function Index(_ref) {
56
56
  addonAfter = _ref.addonAfter,
57
57
  _ref$className = _ref.className,
58
58
  className = _ref$className === void 0 ? "" : _ref$className,
59
+ selfPopupContainer = _ref.selfPopupContainer,
59
60
  props = _objectWithoutProperties(_ref, _excluded);
60
61
  var ref = React.useRef();
61
62
  var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
@@ -149,9 +150,9 @@ var Index = function Index(_ref) {
149
150
  showSearch: mathShowSearch,
150
151
  labelInValue: true,
151
152
  onPopupScroll: propsOnPopupScroll || onPopupScroll,
152
- getPopupContainer: function getPopupContainer() {
153
+ getPopupContainer: selfPopupContainer ? function () {
153
154
  return ref.current || document.body;
154
- }
155
+ } : undefined
155
156
  }, props), {}, {
156
157
  children: data === null || data === void 0 ? void 0 : data.map(function (item) {
157
158
  var optionValue = item.value,
@@ -39,6 +39,7 @@ export interface HSelectProps extends Omit<SelectProps, "options" | "placeholder
39
39
  addonBefore?: React.ReactNode;
40
40
  addonAfter?: React.ReactNode;
41
41
  onChange?: (value: any, opts?: OptionType[] | OptionType) => void;
42
+ selfPopupContainer?: boolean;
42
43
  }
43
44
  export interface FilterDataModal {
44
45
  value: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.68",
3
+ "version": "1.10.70",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -3,10 +3,10 @@ import { SwapRightOutlined } from "@ant-design/icons";
3
3
  import React, { useMemo, useState } from "react";
4
4
  import type { InputNumberProps } from "antd/lib/input-number";
5
5
  import { useClassName } from "../hooks";
6
- import type { addFormatItemModal, HItemProps } from "@/components/Form/modal";
6
+ import type { addFormatItemModal, HItemProps } from "../Form/modal";
7
7
  import HFormConnect from "../Form/HFormConnect";
8
8
  import InputGroup from "../InputGroup";
9
- import { useNumberGroupRestriction } from "@/components/Input/hooks";
9
+ import { useNumberGroupRestriction } from "./hooks";
10
10
 
11
11
  interface IProps<T = any> {
12
12
  placeholder?: [string, string] | string;
@@ -28,7 +28,7 @@ export const useNumberGroupRestriction = ({
28
28
  };
29
29
  const minValControl = () => {
30
30
  if (minValMk) {
31
- return minValMk(maxVal);
31
+ return minValMk(minVal);
32
32
  }
33
33
  if (!minVal?.toString()) {
34
34
  return min;
@@ -39,6 +39,7 @@ const Index: React.FC<HSelectProps> = ({
39
39
  addonBefore,
40
40
  addonAfter,
41
41
  className = "",
42
+ selfPopupContainer,
42
43
  ...props
43
44
  }) => {
44
45
  const ref = useRef<HTMLDivElement | null>();
@@ -131,9 +132,9 @@ const Index: React.FC<HSelectProps> = ({
131
132
  showSearch={mathShowSearch}
132
133
  labelInValue={true}
133
134
  onPopupScroll={propsOnPopupScroll || onPopupScroll}
134
- getPopupContainer={() => {
135
+ getPopupContainer={selfPopupContainer?() => {
135
136
  return ref.current || document.body;
136
- }}
137
+ }:undefined}
137
138
  {...props}
138
139
  >
139
140
  {data?.map((item) => {
@@ -43,6 +43,7 @@ export interface HSelectProps
43
43
  addonBefore?: React.ReactNode;
44
44
  addonAfter?: React.ReactNode;
45
45
  onChange?: (value: any, opts?: OptionType[] | OptionType) => void;
46
+ selfPopupContainer?:boolean;
46
47
  }
47
48
  export interface FilterDataModal {
48
49
  value: any;
@@ -6,6 +6,7 @@ import { MediaTypeEnum } from "../../components/Upload/enums";
6
6
  export default () => {
7
7
  const [files, setFiles] = useState([{}]);
8
8
  const [files1, setFiles1] = useState([]);
9
+ console.log(files,"files")
9
10
  return (
10
11
  <Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
11
12
  <HUpload
@@ -39,8 +40,8 @@ export default () => {
39
40
  </HUpload>
40
41
  <HUrlUpload
41
42
  inputHelper="测试"
42
- mediaType={MediaTypeEnum.video}
43
- value={files}
43
+ mediaType={MediaTypeEnum.img}
44
+ value={["https://img1.baidu.com/it/u=2172818577,3783888802&fm=253&app=138&f=JPEG?w=800&h=1422"]}
44
45
  onChange={setFiles}
45
46
  />
46
47
  </Space>