sti-antd-package 0.0.18 → 0.0.19

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.
@@ -8,6 +8,7 @@ export interface FormItemComponentProps {
8
8
  formColLayout?: typeof formColLayout;
9
9
  name?: NamePath;
10
10
  label?: React.ReactNode;
11
+ trigger?: string;
11
12
  normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
12
13
  required?: boolean;
13
14
  rules?: Rule[];
package/dist/index.d.ts CHANGED
@@ -455,6 +455,7 @@ interface FormItemComponentProps {
455
455
  formColLayout?: typeof _default;
456
456
  name?: NamePath;
457
457
  label?: React$1.ReactNode;
458
+ trigger?: string;
458
459
  normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
459
460
  required?: boolean;
460
461
  rules?: Rule$1[];
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { useState, useImperativeHandle, createContext, useContext, useEffect, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, useRef, useCallback, cloneElement, forwardRef, isValidElement, version as version$1 } from 'react';
3
- import { Button, Tooltip, ConfigProvider as ConfigProvider$2, Row, Col, Card, Form as Form$2, Cascader, Checkbox, Skeleton, message, notification, Modal, Spin, Space, DatePicker, Dropdown, Input as Input$2, Radio, Typography, Select, Divider, Flex, Tag, Switch, Table, Drawer, Tabs } from 'antd';
3
+ import { Button, Tooltip, ConfigProvider as ConfigProvider$2, Row, Col, Card, Form as Form$2, Cascader, Checkbox, Skeleton, message, notification, Modal, Spin, Input as Input$2, Space, DatePicker, Dropdown, Radio, Typography, Select, Divider, Flex, Tag, Switch, Table, Drawer, Tabs } from 'antd';
4
4
  export { Form } from 'antd';
5
5
  import ReactDOM from 'react-dom';
6
6
  import { NumericFormat } from 'react-number-format';
@@ -3867,7 +3867,7 @@ const CardComponent = ({ size, title, onClick, classNames, className, style, sty
3867
3867
  };
3868
3868
 
3869
3869
  const { Item: Item$1 } = Form$2;
3870
- const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
3870
+ const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
3871
3871
  const rule = {
3872
3872
  required: required,
3873
3873
  type: ruleType,
@@ -3877,7 +3877,7 @@ const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, requ
3877
3877
  max: ruleMax,
3878
3878
  min: ruleMin,
3879
3879
  };
3880
- return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
3880
+ return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, trigger: trigger, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
3881
3881
  };
3882
3882
 
3883
3883
  const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, open, disabled, suffixIcon, placeholder, value, defaultValue, options, displayRender, onChange, onSearch, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
@@ -5339,7 +5339,7 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5339
5339
  }, [classNames, text, size, validateStatus, status, variant, align]);
5340
5340
  return (jsxRuntimeExports.jsx("div", Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onClick: onClick }, text && align === 'right' && {
5341
5341
  style: { textAlign: 'right' }
5342
- }, { children: jsxRuntimeExports.jsx(NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, className: classNumberFormat.join(' '), disabled: disabled, readOnly: readOnly, required: required, allowNegative: allowNegative, displayType: text ? 'text' : undefined, prefix: prefix, suffix: suffix, placeholder: placeholder, decimalScale: trailingProps !== null && trailingProps !== void 0 ? trailingProps : trailing, min: ruleMin, max: ruleMax, value: value !== null && value !== void 0 ? value : valueNumberFormat, onChange: event => {
5342
+ }, { children: jsxRuntimeExports.jsx(NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, className: classNumberFormat.join(' '), disabled: disabled, readOnly: readOnly, required: required, allowNegative: allowNegative, displayType: text ? 'text' : undefined, prefix: prefix, suffix: suffix, placeholder: placeholder, decimalScale: trailingProps !== null && trailingProps !== void 0 ? trailingProps : trailing, customInput: Input$2, min: ruleMin, max: ruleMax, value: value !== null && value !== void 0 ? value : valueNumberFormat, onChange: event => {
5343
5343
  removeError === null || removeError === void 0 ? void 0 : removeError(name);
5344
5344
  setValueNumberFormat(event.target.value);
5345
5345
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
@@ -5347,7 +5347,7 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5347
5347
  };
5348
5348
  const NumberFormatComponent = props => {
5349
5349
  const numberFormat = jsxRuntimeExports.jsx(NumberFormat, Object.assign({}, props));
5350
- return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !props.noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, props.formColLayout, { name: props.name, label: props.label, required: props.required, ruleType: "number", ruleTransform: value => Number(value), ruleMessage: props.ruleMessage, ruleMax: props.ruleMax, ruleMin: props.ruleMin, rules: props.rules, validateStatus: props.validateStatus, help: props.help, shouldUpdate: props.shouldUpdate, children: numberFormat })))
5350
+ return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !props.noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, props.formColLayout, { name: props.name, label: props.label, required: props.required, ruleType: "number", ruleTransform: value => Number(value), ruleMessage: props.ruleMessage, ruleMax: props.ruleMax, ruleMin: props.ruleMin, rules: props.rules, validateStatus: props.validateStatus, help: props.help, shouldUpdate: props.shouldUpdate, trigger: "onValueChange", normalize: values => values.value, children: numberFormat })))
5351
5351
  : numberFormat }));
5352
5352
  };
5353
5353
 
package/dist/index.js CHANGED
@@ -3886,7 +3886,7 @@ const CardComponent = ({ size, title, onClick, classNames, className, style, sty
3886
3886
  };
3887
3887
 
3888
3888
  const { Item: Item$1 } = antd.Form;
3889
- const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
3889
+ const FormItemComponent = ({ noItem, formColLayout, name, label, trigger, normalize, required, rules, ruleType, ruleMessage, ruleTransform, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
3890
3890
  const rule = {
3891
3891
  required: required,
3892
3892
  type: ruleType,
@@ -3896,7 +3896,7 @@ const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, requ
3896
3896
  max: ruleMax,
3897
3897
  min: ruleMin,
3898
3898
  };
3899
- return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
3899
+ return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, trigger: trigger, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
3900
3900
  };
3901
3901
 
3902
3902
  const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, open, disabled, suffixIcon, placeholder, value, defaultValue, options, displayRender, onChange, onSearch, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
@@ -5358,7 +5358,7 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5358
5358
  }, [classNames, text, size, validateStatus, status, variant, align]);
5359
5359
  return (jsxRuntimeExports.jsx("div", Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onClick: onClick }, text && align === 'right' && {
5360
5360
  style: { textAlign: 'right' }
5361
- }, { children: jsxRuntimeExports.jsx(reactNumberFormat.NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, className: classNumberFormat.join(' '), disabled: disabled, readOnly: readOnly, required: required, allowNegative: allowNegative, displayType: text ? 'text' : undefined, prefix: prefix, suffix: suffix, placeholder: placeholder, decimalScale: trailingProps !== null && trailingProps !== void 0 ? trailingProps : trailing, min: ruleMin, max: ruleMax, value: value !== null && value !== void 0 ? value : valueNumberFormat, onChange: event => {
5361
+ }, { children: jsxRuntimeExports.jsx(reactNumberFormat.NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, className: classNumberFormat.join(' '), disabled: disabled, readOnly: readOnly, required: required, allowNegative: allowNegative, displayType: text ? 'text' : undefined, prefix: prefix, suffix: suffix, placeholder: placeholder, decimalScale: trailingProps !== null && trailingProps !== void 0 ? trailingProps : trailing, customInput: antd.Input, min: ruleMin, max: ruleMax, value: value !== null && value !== void 0 ? value : valueNumberFormat, onChange: event => {
5362
5362
  removeError === null || removeError === void 0 ? void 0 : removeError(name);
5363
5363
  setValueNumberFormat(event.target.value);
5364
5364
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
@@ -5366,7 +5366,7 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5366
5366
  };
5367
5367
  const NumberFormatComponent = props => {
5368
5368
  const numberFormat = jsxRuntimeExports.jsx(NumberFormat, Object.assign({}, props));
5369
- return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !props.noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, props.formColLayout, { name: props.name, label: props.label, required: props.required, ruleType: "number", ruleTransform: value => Number(value), ruleMessage: props.ruleMessage, ruleMax: props.ruleMax, ruleMin: props.ruleMin, rules: props.rules, validateStatus: props.validateStatus, help: props.help, shouldUpdate: props.shouldUpdate, children: numberFormat })))
5369
+ return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !props.noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, props.formColLayout, { name: props.name, label: props.label, required: props.required, ruleType: "number", ruleTransform: value => Number(value), ruleMessage: props.ruleMessage, ruleMax: props.ruleMax, ruleMin: props.ruleMin, rules: props.rules, validateStatus: props.validateStatus, help: props.help, shouldUpdate: props.shouldUpdate, trigger: "onValueChange", normalize: values => values.value, children: numberFormat })))
5370
5370
  : numberFormat }));
5371
5371
  };
5372
5372
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sti-antd-package",
3
3
  "description": "STI ANT Design",
4
- "version": "0.0.18",
4
+ "version": "0.0.19",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",