revdev-components 0.100.0 → 0.101.0

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.
@@ -0,0 +1 @@
1
+ export declare const CONSOLE_COLOR = "background:rgb(28, 46, 82); color:rgb(231, 231, 231)";
@@ -13,5 +13,6 @@ export interface AppFormProps<T = any> {
13
13
  form?: FormInstance;
14
14
  onValid?: (valid: boolean) => void;
15
15
  initialValues?: Partial<T>;
16
+ debug?: boolean;
16
17
  }
17
- export declare function AppForm<T = any>({ form: propForm, children, className, onFinish, onValuesChange, onFieldsChange, onValid, initialValues, }: AppFormProps<T>): React.ReactElement<AppFormProps<T>>;
18
+ export declare function AppForm<T = any>({ form: propForm, children, className, onFinish, onValuesChange, onFieldsChange, onValid, initialValues, debug, }: AppFormProps<T>): React.ReactElement<AppFormProps<T>>;
package/build/index.js CHANGED
@@ -4710,12 +4710,14 @@ var SocialIcon = function (props) {
4710
4710
 
4711
4711
  var s$s = {"root":"index-module_root__gtTIa","action":"index-module_action__pOSde"};
4712
4712
 
4713
+ var CONSOLE_COLOR = "background:rgb(28, 46, 82); color:rgb(231, 231, 231)";
4714
+
4713
4715
  function useForm(form) {
4714
4716
  var newForm = antd.Form.useForm()[0];
4715
4717
  return form ? form : newForm;
4716
4718
  }
4717
4719
  function AppForm(_a) {
4718
- var propForm = _a.form, children = _a.children, className = _a.className, onFinish = _a.onFinish, onValuesChange = _a.onValuesChange, onFieldsChange = _a.onFieldsChange, onValid = _a.onValid, initialValues = _a.initialValues;
4720
+ var propForm = _a.form, children = _a.children, className = _a.className, onFinish = _a.onFinish, onValuesChange = _a.onValuesChange, onFieldsChange = _a.onFieldsChange, onValid = _a.onValid, initialValues = _a.initialValues, debug = _a.debug;
4719
4721
  var form = useForm(propForm);
4720
4722
  var _b = React.useState(false), valid = _b[0], setValid = _b[1];
4721
4723
  var values = antd.Form.useWatch([], form);
@@ -4726,8 +4728,14 @@ function AppForm(_a) {
4726
4728
  .catch(function () { return setValid(false); });
4727
4729
  }, [form, values]);
4728
4730
  React.useEffect(function () {
4731
+ if (debug) {
4732
+ console.info("%cform", CONSOLE_COLOR, "valid", valid);
4733
+ }
4729
4734
  onValid === null || onValid === void 0 ? void 0 : onValid(valid);
4730
4735
  }, [onValid, valid]);
4736
+ React.useEffect(function () {
4737
+ console.info("%cform", CONSOLE_COLOR, "values", values);
4738
+ }, [values]);
4731
4739
  return (React.createElement(antd.Form, { form: form, onFinish: onFinish, className: classNames(s$s.root, className), layout: "vertical", onValuesChange: onValuesChange, onFieldsChange: onFieldsChange, initialValues: initialValues }, typeof children === "function" ? children({ valid: valid }) : children));
4732
4740
  }
4733
4741
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "revdev-components",
3
- "version": "0.100.0",
3
+ "version": "0.101.0",
4
4
  "main": "build/index.js",
5
5
  "module": "build/index.esm.js",
6
6
  "scripts": {