@hw-component/form 0.0.1-beta-v3 → 0.0.1-beta-v5

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,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { HModalFormInstance, ModifyPropsModal } from "@/components/ModalForm/modal";
3
- export declare const useModifyProps: ({ visible, configData, initialValues, modalForm }: ModifyPropsModal) => {
3
+ export declare const useModifyProps: ({ visible, configData, initialValues, modalForm, }: ModifyPropsModal) => {
4
4
  modalFormData: import("../Form/modal").HItemProps[];
5
5
  modalVisible: boolean | undefined;
6
6
  setModalVisible: import("react").Dispatch<import("react").SetStateAction<boolean | undefined>>;
package/es/config.js CHANGED
@@ -10,12 +10,12 @@ var baseConfig = {
10
10
  value: "value"
11
11
  },
12
12
  valueCheckMap: {
13
- checked: true,
14
- noChecked: false
13
+ checked: 1,
14
+ noChecked: 0
15
15
  },
16
16
  valueSwitchMap: {
17
- open: true,
18
- close: false
17
+ open: 1,
18
+ close: 0
19
19
  },
20
20
  valueRangePickerValueMap: {
21
21
  start: function start(name) {
package/es/index.css CHANGED
@@ -10,7 +10,7 @@
10
10
  .ant-hw-form-item-colon:after {
11
11
  position: relative;
12
12
  top: -0.5px;
13
- margin: 0 8px 0 2px;
13
+ margin: 0 0 0 2px;
14
14
  content: ":";
15
15
  }
16
16
  .ant-hw-form-item-required:before {
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { HModalFormInstance, ModifyPropsModal } from "@/components/ModalForm/modal";
3
- export declare const useModifyProps: ({ visible, configData, initialValues, modalForm }: ModifyPropsModal) => {
3
+ export declare const useModifyProps: ({ visible, configData, initialValues, modalForm, }: ModifyPropsModal) => {
4
4
  modalFormData: import("../Form/modal").HItemProps[];
5
5
  modalVisible: boolean | undefined;
6
6
  setModalVisible: import("react").Dispatch<import("react").SetStateAction<boolean | undefined>>;
package/lib/config.js CHANGED
@@ -11,12 +11,12 @@ var baseConfig = {
11
11
  value: "value"
12
12
  },
13
13
  valueCheckMap: {
14
- checked: true,
15
- noChecked: false
14
+ checked: 1,
15
+ noChecked: 0
16
16
  },
17
17
  valueSwitchMap: {
18
- open: true,
19
- close: false
18
+ open: 1,
19
+ close: 0
20
20
  },
21
21
  valueRangePickerValueMap: {
22
22
  start: function start(name) {
package/lib/index.css CHANGED
@@ -10,7 +10,7 @@
10
10
  .ant-hw-form-item-colon:after {
11
11
  position: relative;
12
12
  top: -0.5px;
13
- margin: 0 8px 0 2px;
13
+ margin: 0 0 0 2px;
14
14
  content: ":";
15
15
  }
16
16
  .ant-hw-form-item-required:before {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hw-component/form",
3
- "version": "0.0.1-beta-v3",
3
+ "version": "0.0.1-beta-v5",
4
4
  "description": "基于antd二次开发",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,7 +2,7 @@
2
2
  .@{ant-prefix}-hw-form-item-colon:after {
3
3
  position: relative;
4
4
  top: -0.5px;
5
- margin: 0 8px 0 2px;
5
+ margin: 0 0 0 2px;
6
6
  content: ":";
7
7
  }
8
8
  .@{ant-prefix}-hw-form-item-required:before {
@@ -2,14 +2,14 @@ import { useEffect, useMemo, useState } from "react";
2
2
  import useHForm from "../Form/hooks/useHForm";
3
3
  import type {
4
4
  HModalFormInstance,
5
- ModifyPropsModal
5
+ ModifyPropsModal,
6
6
  } from "@/components/ModalForm/modal";
7
7
 
8
8
  export const useModifyProps = ({
9
9
  visible,
10
10
  configData,
11
11
  initialValues,
12
- modalForm
12
+ modalForm,
13
13
  }: ModifyPropsModal) => {
14
14
  const [modalVisible, setModalVisible] = useState(visible);
15
15
  const [modalFormData, setModalFormData] = useState(configData);
@@ -22,9 +22,9 @@ export const useModifyProps = ({
22
22
  }, [configData]);
23
23
  useEffect(() => {
24
24
  modalForm.show = ({
25
- configData: changeConfigData,
26
- initialValues: changeInitialValues,
27
- }) => {
25
+ configData: changeConfigData,
26
+ initialValues: changeInitialValues,
27
+ }) => {
28
28
  if (!!changeConfigData) {
29
29
  setModalFormData(changeConfigData);
30
30
  }
@@ -2,7 +2,6 @@ import { Modal } from "antd";
2
2
  import type { ModalFormProps } from "@/components/ModalForm/modal";
3
3
  import HForm from "../Form";
4
4
  import { useCurrentForm, useModifyProps } from "./hooks";
5
- import { useEffect } from "react";
6
5
  export default ({
7
6
  visible,
8
7
  title,
@@ -16,12 +15,13 @@ export default ({
16
15
  ...props
17
16
  }: ModalFormProps) => {
18
17
  const currentForm = useCurrentForm(modalForm);
19
- const {
20
- modalVisible,
21
- modalFormData,
22
- setModalVisible,
23
- initValue,
24
- } = useModifyProps({ configData, visible, initialValues ,modalForm:currentForm});
18
+ const { modalVisible, modalFormData, setModalVisible, initValue } =
19
+ useModifyProps({
20
+ configData,
21
+ visible,
22
+ initialValues,
23
+ modalForm: currentForm,
24
+ });
25
25
  const cancel = (e) => {
26
26
  if (onCancel) {
27
27
  return onCancel?.(e);
@@ -8,9 +8,9 @@ export interface ModifyPropsModal {
8
8
  configData: HItemProps[];
9
9
  visible?: boolean;
10
10
  initialValues?: Record<string, any>;
11
- modalForm:HModalFormInstance
11
+ modalForm: HModalFormInstance;
12
12
  }
13
- export interface ShowParamsModal{
13
+ export interface ShowParamsModal {
14
14
  configData?: HItemProps[];
15
15
  visible?: boolean;
16
16
  initialValues?: Record<string, any>;
@@ -7,12 +7,12 @@ export const baseConfig: IFormConfigContextProps = {
7
7
  value: "value",
8
8
  },
9
9
  valueCheckMap: {
10
- checked: true,
11
- noChecked: false,
10
+ checked: 1,
11
+ noChecked:0,
12
12
  },
13
13
  valueSwitchMap: {
14
- open: true,
15
- close: false,
14
+ open: 1,
15
+ close: 0,
16
16
  },
17
17
  valueRangePickerValueMap: {
18
18
  start: (name) => {