@hw-component/form 1.10.61 → 1.10.62

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
  // welcome to hoo hoo hoo
2
2
  import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
3
3
  import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
4
- import { createElement } from 'react';
4
+ import { useRef, createElement } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
6
6
  import { Select } from 'antd';
7
7
  import { useFilterOption, useSelectReq } from './hooks/norHooks.js';
@@ -54,6 +54,7 @@ var Index = function Index(_ref) {
54
54
  _ref$className = _ref.className,
55
55
  className = _ref$className === void 0 ? "" : _ref$className,
56
56
  props = _objectWithoutProperties(_ref, _excluded);
57
+ var ref = useRef();
57
58
  var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
58
59
  icon = _ref2.icon,
59
60
  render = _ref2.render;
@@ -106,6 +107,7 @@ var Index = function Index(_ref) {
106
107
  change = _useValueChange.change;
107
108
  addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
108
109
  return jsxs("div", {
110
+ ref: ref,
109
111
  className: "".concat(boxClassName, " ").concat(addonBefore ? addonBeforeBoxClassName : "", " ").concat(addonAfter ? addonAfterBoxClassName : "", " ").concat(className),
110
112
  style: style,
111
113
  children: [addonBefore && jsx("div", {
@@ -143,7 +145,10 @@ var Index = function Index(_ref) {
143
145
  filterOption: selfFilterOption,
144
146
  showSearch: mathShowSearch,
145
147
  labelInValue: true,
146
- onPopupScroll: propsOnPopupScroll || onPopupScroll
148
+ onPopupScroll: propsOnPopupScroll || onPopupScroll,
149
+ getPopupContainer: function getPopupContainer() {
150
+ return ref.current || document.body;
151
+ }
147
152
  }, props), {}, {
148
153
  children: data === null || data === void 0 ? void 0 : data.map(function (item) {
149
154
  var optionValue = item.value,
package/es/index.css CHANGED
@@ -17,6 +17,7 @@
17
17
  -webkit-flex-direction: row;
18
18
  -ms-flex-direction: row;
19
19
  flex-direction: row;
20
+ width: 100%;
20
21
  }
21
22
  .ant-hw-select-box .ant-hw-group-addon-before {
22
23
  line-height: 0;
@@ -57,6 +57,7 @@ var Index = function Index(_ref) {
57
57
  _ref$className = _ref.className,
58
58
  className = _ref$className === void 0 ? "" : _ref$className,
59
59
  props = _objectWithoutProperties(_ref, _excluded);
60
+ var ref = React.useRef();
60
61
  var _ref2 = (modeConfig === null || modeConfig === void 0 ? void 0 : modeConfig[mode || ""]) || {},
61
62
  icon = _ref2.icon,
62
63
  render = _ref2.render;
@@ -109,6 +110,7 @@ var Index = function Index(_ref) {
109
110
  change = _useValueChange.change;
110
111
  addDispatchListener === null || addDispatchListener === void 0 || addDispatchListener("reload", reload);
111
112
  return jsxRuntime.jsxs("div", {
113
+ ref: ref,
112
114
  className: "".concat(boxClassName, " ").concat(addonBefore ? addonBeforeBoxClassName : "", " ").concat(addonAfter ? addonAfterBoxClassName : "", " ").concat(className),
113
115
  style: style,
114
116
  children: [addonBefore && jsxRuntime.jsx("div", {
@@ -146,7 +148,10 @@ var Index = function Index(_ref) {
146
148
  filterOption: selfFilterOption,
147
149
  showSearch: mathShowSearch,
148
150
  labelInValue: true,
149
- onPopupScroll: propsOnPopupScroll || onPopupScroll
151
+ onPopupScroll: propsOnPopupScroll || onPopupScroll,
152
+ getPopupContainer: function getPopupContainer() {
153
+ return ref.current || document.body;
154
+ }
150
155
  }, props), {}, {
151
156
  children: data === null || data === void 0 ? void 0 : data.map(function (item) {
152
157
  var optionValue = item.value,
package/lib/index.css CHANGED
@@ -17,6 +17,7 @@
17
17
  -webkit-flex-direction: row;
18
18
  -ms-flex-direction: row;
19
19
  flex-direction: row;
20
+ width: 100%;
20
21
  }
21
22
  .ant-hw-select-box .ant-hw-group-addon-before {
22
23
  line-height: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "1.10.61",
3
+ "version": "1.10.62",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,7 @@
23
23
  .@{ant-prefix}-hw-select-box {
24
24
  display: flex;
25
25
  flex-direction: row;
26
-
26
+ width: 100%;
27
27
  .@{ant-prefix}-hw-group-addon-before {
28
28
  line-height: 0;
29
29
  border-right: 0;
@@ -1,5 +1,5 @@
1
1
  import { Select } from "antd";
2
- import React from "react";
2
+ import React, {useRef} from "react";
3
3
  import { useFilterOption, useSelectReq } from "./hooks/norHooks";
4
4
  import { useValueChange } from "./hooks/changeHooks";
5
5
  import type { HSelectProps } from "./modal";
@@ -8,6 +8,7 @@ import DropdownComponent from "./components/DropdownComponent";
8
8
  import AllSelect from "./components/AllSelect";
9
9
  import { useChangeOptions, useClassName, useMatchConfigProps } from "../hooks";
10
10
  import HFormConnect from "../Form/HFormConnect";
11
+
11
12
  const { Option } = Select;
12
13
 
13
14
  const Index: React.FC<HSelectProps> = ({
@@ -40,6 +41,7 @@ const Index: React.FC<HSelectProps> = ({
40
41
  className = "",
41
42
  ...props
42
43
  }) => {
44
+ const ref=useRef<HTMLDivElement|null>();
43
45
  const { icon, render } = modeConfig?.[mode || ""] || {};
44
46
  const { fieldNames } = useMatchConfigProps({ fieldNames: propsFieldNames });
45
47
  const selfFilterOption = useFilterOption({ filterOption, serviceSearch });
@@ -83,6 +85,7 @@ const Index: React.FC<HSelectProps> = ({
83
85
  addDispatchListener?.("reload", reload);
84
86
  return (
85
87
  <div
88
+ ref={(ref as any)}
86
89
  className={`${boxClassName} ${
87
90
  addonBefore ? addonBeforeBoxClassName : ""
88
91
  } ${addonAfter ? addonAfterBoxClassName : ""} ${className}`}
@@ -128,6 +131,7 @@ const Index: React.FC<HSelectProps> = ({
128
131
  showSearch={mathShowSearch}
129
132
  labelInValue={true}
130
133
  onPopupScroll={propsOnPopupScroll || onPopupScroll}
134
+ getPopupContainer={()=>{return ref.current||document.body}}
131
135
  {...props}
132
136
  >
133
137
  {data?.map((item) => {
@@ -141,6 +141,10 @@ export default () => {
141
141
  </div>
142
142
  <div style={{ width: 1000 }}>
143
143
  <HForm
144
+
145
+ request={(values, params)=>{
146
+ console.log(values,"request")
147
+ }}
144
148
  configData={[
145
149
  // {
146
150
  // noStyle: true,
@@ -152,24 +156,22 @@ export default () => {
152
156
  {
153
157
  name: "num",
154
158
  label: "num",
155
- type: "inputNumberGroup",
159
+ type: "rangePicker",
160
+ itemProps: {
161
+ valueMap:{
162
+ start:"start",
163
+ end:"end",
164
+ }
165
+ }
156
166
  },
157
167
  {
158
168
  name: "time",
159
169
  label: "time",
160
170
  type: "select",
161
- rules: [{ required: true }],
162
171
  itemProps: {
163
172
  options: [{ value: "label", key: 1 }],
164
173
  mode: "multiple",
165
- },
166
- render: (props, node) => {
167
- return (
168
- <Row style={{ width: 800 }}>
169
- <Col span={12}>{node}</Col>
170
- </Row>
171
- );
172
- },
174
+ }
173
175
  },
174
176
  {
175
177
  name: "tt",
@@ -195,12 +197,9 @@ export default () => {
195
197
  }}
196
198
  labelAlign={"left"}
197
199
  onValuesChange={(val) => {
198
- console.log(val, "onValuesChange");
200
+ // console.log(val, "onValuesChange");
199
201
  }}
200
202
  requiredMode
201
- onFinish={(val) => {
202
- console.log(val);
203
- }}
204
203
  />
205
204
  </div>
206
205
  </HFormConfigProvider>