sti-antd-package 0.0.23 → 0.0.25

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
- import { CheckboxForm } from "../types";
2
1
  import { CheckboxOptionType } from "antd";
3
2
  import React, { Ref } from "react";
3
+ import { FormItemCheckboxProps } from "../../Form/Item";
4
4
  export interface CheckboxGroupComponentRef<T> {
5
5
  value: () => T[];
6
6
  setValue: React.Dispatch<React.SetStateAction<T[]>>;
@@ -12,5 +12,5 @@ interface CheckboxGroup<T> {
12
12
  onChange?: (checkedValue: T[]) => void;
13
13
  ref?: Ref<CheckboxGroupComponentRef<T>>;
14
14
  }
15
- export type CheckboxGroupComponentProps<T> = CheckboxGroup<T> & CheckboxForm;
15
+ export type CheckboxGroupComponentProps<T> = CheckboxGroup<T> & FormItemCheckboxProps;
16
16
  export {};
@@ -1,8 +1,5 @@
1
- import { formColLayout } from "../../constants";
1
+ import { FormItemCheckboxProps } from "../Form/Item";
2
2
  import { CheckboxChangeEvent } from "antd";
3
- import { ValidateStatus } from "antd/es/form/FormItem";
4
- import { ShouldUpdate } from "rc-field-form/lib/Field";
5
- import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
6
3
  import { Ref } from "react";
7
4
  export interface CheckboxComponentRef {
8
5
  checked: () => boolean;
@@ -15,21 +12,5 @@ interface Checkbox {
15
12
  children?: React.ReactNode;
16
13
  ref?: Ref<CheckboxComponentRef>;
17
14
  }
18
- export interface CheckboxForm {
19
- noItem?: boolean;
20
- loading?: boolean;
21
- disabled?: boolean;
22
- removeError?: (name?: NamePath) => void;
23
- formColLayout?: typeof formColLayout;
24
- name?: NamePath;
25
- label?: React.ReactNode;
26
- required?: boolean;
27
- rules?: Rule[];
28
- ruleType?: RuleObject['type'];
29
- ruleMessage?: string;
30
- validateStatus?: ValidateStatus;
31
- help?: React.ReactNode;
32
- shouldUpdate?: ShouldUpdate<string | string[]>;
33
- }
34
- export type CheckboxComponentProps = Checkbox & CheckboxForm;
15
+ export type CheckboxComponentProps = Checkbox & FormItemCheckboxProps;
35
16
  export {};
@@ -2,12 +2,12 @@ import { DatePickerFormatType, formColLayout } from "../../constants";
2
2
  import { Variant } from "antd/es/config-provider";
3
3
  import { SizeType } from "antd/es/config-provider/SizeContext";
4
4
  import { DatePickerProps } from "antd/es/date-picker";
5
+ import { PickerClassNames } from "antd/es/date-picker/generatePicker/interface";
5
6
  import { Rule } from "antd/es/form";
6
7
  import { ValidateStatus } from "antd/es/form/FormItem";
7
8
  import { Dayjs } from "dayjs";
8
9
  import { ShouldUpdate } from "rc-field-form/lib/Field";
9
10
  import { NamePath } from "rc-field-form/lib/interface";
10
- import { SemanticStructure } from "rc-picker/lib/interface";
11
11
  import { Ref } from "react";
12
12
  export interface DatePickerComponentRef {
13
13
  value: () => Dayjs | null;
@@ -17,6 +17,10 @@ export interface DatePickerComponentProps {
17
17
  noItem?: boolean;
18
18
  size?: SizeType;
19
19
  variant?: Variant;
20
+ placeholder?: string;
21
+ prefix?: React.ReactNode;
22
+ prefixCls?: string[];
23
+ suffixIcon?: React.ReactNode;
20
24
  picker?: DatePickerProps['picker'];
21
25
  format?: DatePickerFormatType;
22
26
  loading?: boolean;
@@ -32,7 +36,7 @@ export interface DatePickerComponentProps {
32
36
  name?: NamePath;
33
37
  label?: React.ReactNode;
34
38
  classNames?: string[];
35
- className?: Partial<Record<SemanticStructure, string>>;
39
+ className?: PickerClassNames;
36
40
  required?: boolean;
37
41
  rules?: Rule[];
38
42
  ruleMessage?: string;
@@ -3,11 +3,11 @@ import { DatePicker, DatePickerProps } from "antd";
3
3
  import { Variant } from "antd/es/config-provider";
4
4
  import { SizeType } from "antd/es/config-provider/SizeContext";
5
5
  import { RangePickerProps } from "antd/es/date-picker";
6
+ import { PickerClassNames } from "antd/es/date-picker/generatePicker/interface";
6
7
  import { ValidateStatus } from "antd/es/form/FormItem";
7
8
  import dayjs from "dayjs";
8
9
  import { ShouldUpdate } from "rc-field-form/lib/Field";
9
10
  import { NamePath, Rule } from "rc-field-form/lib/interface";
10
- import { SemanticStructure } from "rc-picker/lib/interface";
11
11
  import { RangeValueType } from "rc-picker/lib/PickerInput/RangePicker";
12
12
  import { Ref } from "react";
13
13
  export interface DateRangePickerComponentRef {
@@ -18,6 +18,10 @@ export interface DateRangePickerComponentProps {
18
18
  noItem?: boolean;
19
19
  size?: SizeType;
20
20
  variant?: Variant;
21
+ placeholder?: [string, string];
22
+ prefix?: React.ReactNode;
23
+ prefixCls?: string[];
24
+ suffixIcon?: React.ReactNode;
21
25
  picker?: DatePickerProps['picker'];
22
26
  format?: DatePickerFormatType;
23
27
  loading?: boolean;
@@ -33,7 +37,7 @@ export interface DateRangePickerComponentProps {
33
37
  name?: NamePath;
34
38
  label?: React.ReactNode;
35
39
  classNames?: string[];
36
- className?: Partial<Record<SemanticStructure, string>>;
40
+ className?: PickerClassNames;
37
41
  required?: boolean;
38
42
  rules?: Rule[];
39
43
  ruleMessage?: string;
@@ -3,6 +3,24 @@ import { ValidateStatus } from "antd/es/form/FormItem";
3
3
  import { ShouldUpdate } from "rc-field-form/lib/Field";
4
4
  import { NamePath, Rule, RuleObject, Store, StoreValue } from "rc-field-form/lib/interface";
5
5
  import React from "react";
6
+ export interface FormItemDefaultProps {
7
+ noItem?: boolean;
8
+ loading?: boolean;
9
+ disabled?: boolean;
10
+ removeError?: (name?: NamePath) => void;
11
+ formColLayout?: typeof formColLayout;
12
+ name?: NamePath;
13
+ label?: React.ReactNode;
14
+ required?: boolean;
15
+ }
16
+ export type FormItemCheckboxProps = FormItemDefaultProps & {
17
+ rules?: Rule[];
18
+ ruleType?: RuleObject['type'];
19
+ ruleMessage?: string;
20
+ validateStatus?: ValidateStatus;
21
+ help?: React.ReactNode;
22
+ shouldUpdate?: ShouldUpdate<string | string[]>;
23
+ };
6
24
  export interface FormItemComponentProps {
7
25
  noItem?: boolean;
8
26
  formColLayout?: typeof formColLayout;
@@ -17,7 +17,7 @@ export interface SelectComponentProps {
17
17
  variant?: Variant;
18
18
  size?: SizeType;
19
19
  suffixIcon?: React.ReactNode;
20
- className?: string[];
20
+ classNames?: string[];
21
21
  loading?: boolean;
22
22
  disabled?: boolean;
23
23
  open?: boolean;
package/dist/index.d.ts CHANGED
@@ -16,9 +16,9 @@ import { AnyObject } from 'antd/es/_util/type';
16
16
  import { AxiosResponse } from 'axios';
17
17
  import { ColumnOrColumnGroup } from 'react-data-grid';
18
18
  import { DatePickerProps, RangePickerProps } from 'antd/es/date-picker';
19
+ import { PickerClassNames } from 'antd/es/date-picker/generatePicker/interface';
19
20
  import { Rule as Rule$2, RuleObject as RuleObject$2 } from 'antd/es/form';
20
21
  import dayjs, { Dayjs } from 'dayjs';
21
- import { SemanticStructure } from 'rc-picker/lib/interface';
22
22
  import { RangeValueType } from 'rc-picker/lib/PickerInput/RangePicker';
23
23
  import { valueType } from 'antd/es/statistic/utils';
24
24
  import { OnValueChange } from 'react-number-format';
@@ -191,34 +191,59 @@ interface CascaderComponentProps<OptionType extends DefaultOptionType, ValueFiel
191
191
 
192
192
  declare const CascaderComponent: <OptionType extends DefaultOptionType, ValueField extends keyof OptionType>({ 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, }: CascaderComponentProps<OptionType, ValueField>) => React$1.ReactElement;
193
193
 
194
- interface CheckboxComponentRef {
195
- checked: () => boolean;
196
- setChecked: React.Dispatch<React.SetStateAction<boolean>>;
197
- }
198
- interface Checkbox {
199
- checked?: boolean;
200
- defaultChecked?: boolean;
201
- onChange?: (event: CheckboxChangeEvent) => void;
202
- children?: React.ReactNode;
203
- ref?: Ref<CheckboxComponentRef>;
204
- }
205
- interface CheckboxForm {
194
+ interface FormItemDefaultProps {
206
195
  noItem?: boolean;
207
196
  loading?: boolean;
208
197
  disabled?: boolean;
209
198
  removeError?: (name?: NamePath) => void;
210
199
  formColLayout?: typeof _default;
211
200
  name?: NamePath;
212
- label?: React.ReactNode;
201
+ label?: React$1.ReactNode;
213
202
  required?: boolean;
203
+ }
204
+ type FormItemCheckboxProps = FormItemDefaultProps & {
214
205
  rules?: Rule$1[];
215
206
  ruleType?: RuleObject$1['type'];
216
207
  ruleMessage?: string;
217
208
  validateStatus?: ValidateStatus;
218
- help?: React.ReactNode;
209
+ help?: React$1.ReactNode;
210
+ shouldUpdate?: ShouldUpdate<string | string[]>;
211
+ };
212
+ interface FormItemComponentProps {
213
+ noItem?: boolean;
214
+ formColLayout?: typeof _default;
215
+ name?: NamePath;
216
+ label?: React$1.ReactNode;
217
+ trigger?: string;
218
+ normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
219
+ required?: boolean;
220
+ rules?: Rule$1[];
221
+ ruleType?: RuleObject$1['type'];
222
+ ruleMessage?: string;
223
+ ruleTransform?: (value: StoreValue) => StoreValue;
224
+ ruleMin?: number;
225
+ ruleMax?: number;
226
+ valuePropName?: string;
227
+ validateStatus?: ValidateStatus;
228
+ help?: React$1.ReactNode;
219
229
  shouldUpdate?: ShouldUpdate<string | string[]>;
230
+ children?: React$1.ReactNode;
231
+ }
232
+
233
+ declare const FormItemComponent: React$1.FC<FormItemComponentProps>;
234
+
235
+ interface CheckboxComponentRef {
236
+ checked: () => boolean;
237
+ setChecked: React.Dispatch<React.SetStateAction<boolean>>;
238
+ }
239
+ interface Checkbox {
240
+ checked?: boolean;
241
+ defaultChecked?: boolean;
242
+ onChange?: (event: CheckboxChangeEvent) => void;
243
+ children?: React.ReactNode;
244
+ ref?: Ref<CheckboxComponentRef>;
220
245
  }
221
- type CheckboxComponentProps = Checkbox & CheckboxForm;
246
+ type CheckboxComponentProps = Checkbox & FormItemCheckboxProps;
222
247
 
223
248
  declare const CheckboxComponent$1: React$1.FC<CheckboxComponentProps>;
224
249
 
@@ -233,7 +258,7 @@ interface CheckboxGroup<T> {
233
258
  onChange?: (checkedValue: T[]) => void;
234
259
  ref?: Ref<CheckboxGroupComponentRef<T>>;
235
260
  }
236
- type CheckboxGroupComponentProps<T> = CheckboxGroup<T> & CheckboxForm;
261
+ type CheckboxGroupComponentProps<T> = CheckboxGroup<T> & FormItemCheckboxProps;
237
262
 
238
263
  declare const CheckboxComponent: <T>({ noItem, loading, disabled, options, value, defaultValue, onChange, removeError, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }: CheckboxGroupComponentProps<T>) => react_jsx_runtime.JSX.Element;
239
264
 
@@ -370,6 +395,10 @@ interface DatePickerComponentProps {
370
395
  noItem?: boolean;
371
396
  size?: SizeType;
372
397
  variant?: Variant;
398
+ placeholder?: string;
399
+ prefix?: React.ReactNode;
400
+ prefixCls?: string[];
401
+ suffixIcon?: React.ReactNode;
373
402
  picker?: DatePickerProps['picker'];
374
403
  format?: DatePickerFormatType;
375
404
  loading?: boolean;
@@ -385,7 +414,7 @@ interface DatePickerComponentProps {
385
414
  name?: NamePath;
386
415
  label?: React.ReactNode;
387
416
  classNames?: string[];
388
- className?: Partial<Record<SemanticStructure, string>>;
417
+ className?: PickerClassNames;
389
418
  required?: boolean;
390
419
  rules?: Rule$2[];
391
420
  ruleMessage?: string;
@@ -405,6 +434,10 @@ interface DateRangePickerComponentProps {
405
434
  noItem?: boolean;
406
435
  size?: SizeType;
407
436
  variant?: Variant;
437
+ placeholder?: [string, string];
438
+ prefix?: React.ReactNode;
439
+ prefixCls?: string[];
440
+ suffixIcon?: React.ReactNode;
408
441
  picker?: DatePickerProps$1['picker'];
409
442
  format?: DatePickerFormatType;
410
443
  loading?: boolean;
@@ -420,7 +453,7 @@ interface DateRangePickerComponentProps {
420
453
  name?: NamePath;
421
454
  label?: React.ReactNode;
422
455
  classNames?: string[];
423
- className?: Partial<Record<SemanticStructure, string>>;
456
+ className?: PickerClassNames;
424
457
  required?: boolean;
425
458
  rules?: Rule$1[];
426
459
  ruleMessage?: string;
@@ -450,29 +483,6 @@ interface DropdownButtonComponentProps<T> {
450
483
 
451
484
  declare const DropdownButtonComponent: <T>({ trigger, placement, menuItems, disabled, data, }: DropdownButtonComponentProps<T>) => React$1.ReactElement;
452
485
 
453
- interface FormItemComponentProps {
454
- noItem?: boolean;
455
- formColLayout?: typeof _default;
456
- name?: NamePath;
457
- label?: React$1.ReactNode;
458
- trigger?: string;
459
- normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
460
- required?: boolean;
461
- rules?: Rule$1[];
462
- ruleType?: RuleObject$1['type'];
463
- ruleMessage?: string;
464
- ruleTransform?: (value: StoreValue) => StoreValue;
465
- ruleMin?: number;
466
- ruleMax?: number;
467
- valuePropName?: string;
468
- validateStatus?: ValidateStatus;
469
- help?: React$1.ReactNode;
470
- shouldUpdate?: ShouldUpdate<string | string[]>;
471
- children?: React$1.ReactNode;
472
- }
473
-
474
- declare const FormItemComponent: React$1.FC<FormItemComponentProps>;
475
-
476
486
  interface IconCheckOrCloseProps {
477
487
  check: boolean;
478
488
  classNames?: string[];
@@ -621,7 +631,7 @@ interface SelectComponentProps {
621
631
  variant?: Variant;
622
632
  size?: SizeType;
623
633
  suffixIcon?: React.ReactNode;
624
- className?: string[];
634
+ classNames?: string[];
625
635
  loading?: boolean;
626
636
  disabled?: boolean;
627
637
  open?: boolean;
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
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';
2
+ import React__default, { useState, useImperativeHandle, createContext, useContext, useEffect, useMemo as useMemo$1, useLayoutEffect as useLayoutEffect$1, useRef, useCallback, memo, cloneElement, forwardRef, isValidElement, version as version$1 } from 'react';
3
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';
@@ -5345,10 +5345,11 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5345
5345
  !text && align === 'right' && classNumberFormat.push(styleNumberFormat['number-format-align-right']);
5346
5346
  classNames && classNumberFormat.push(...classNames);
5347
5347
  return classNumberFormat;
5348
- }, [classNames, text, size, validateStatus, status, variant, align]);
5348
+ }, [classNames, text, align]);
5349
+ const CustomInput = useCallback(memo((props) => (jsxRuntimeExports.jsx(Input$2, Object.assign({}, props, { variant: variant })))), [variant]);
5349
5350
  return (jsxRuntimeExports.jsx("div", Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onClick: onClick }, text && align === 'right' && {
5350
5351
  style: { textAlign: 'right' }
5351
- }, { children: jsxRuntimeExports.jsx(NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, customInput: Input$2, size: size, 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 => {
5352
+ }, { children: jsxRuntimeExports.jsx(NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, customInput: CustomInput, size: size, 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 => {
5352
5353
  removeError === null || removeError === void 0 ? void 0 : removeError(name);
5353
5354
  setValueNumberFormat(event.target.value);
5354
5355
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
@@ -5492,7 +5493,7 @@ var formColLayout = {
5492
5493
  notInline: {},
5493
5494
  };
5494
5495
 
5495
- const DatePickerComponent = ({ noItem, size, variant, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5496
+ const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5496
5497
  const [valueDate, setValueDate] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
5497
5498
  const handleChange = (date, dateString) => {
5498
5499
  setValueDate(date);
@@ -5505,13 +5506,13 @@ const DatePickerComponent = ({ noItem, size, variant, picker, format, disabledDa
5505
5506
  }));
5506
5507
  const classDate = [styleCSS['w-100']];
5507
5508
  classNames && classDate.push(...classNames);
5508
- const datePicker = !loading ? (jsxRuntimeExports.jsx(DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
5509
+ const datePicker = !loading ? (jsxRuntimeExports.jsx(DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, placeholder: placeholder, prefix: prefix, prefixCls: prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.join(' '), suffixIcon: suffixIcon, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
5509
5510
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "date", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
5510
5511
  : datePicker }));
5511
5512
  };
5512
5513
 
5513
5514
  const { RangePicker } = DatePicker;
5514
- const DateRangePickerComponent = ({ noItem, size, variant, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5515
+ const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5515
5516
  var _a;
5516
5517
  const [valueDateRange, setValueDateRange] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
5517
5518
  const handleChange = (date, dateStrings) => {
@@ -5525,7 +5526,7 @@ const DateRangePickerComponent = ({ noItem, size, variant, picker, format, disab
5525
5526
  }));
5526
5527
  const classDateRange = [styleCSS['w-100']];
5527
5528
  classNames && classDateRange.push(...classNames);
5528
- const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowEmpty: !required, allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
5529
+ const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, placeholder: placeholder, prefix: prefix, prefixCls: prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.join(' '), suffixIcon: suffixIcon, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowEmpty: !required, allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
5529
5530
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "array", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
5530
5531
  : datePicker }));
5531
5532
  };
@@ -7578,10 +7579,10 @@ var styleSelect = {"select":"style-module_select__vcvBg","add-item-divider":"sty
7578
7579
  styleInject(css_248z$4);
7579
7580
 
7580
7581
  const { Link } = Typography;
7581
- const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, className, loading, disabled, open, filterOption, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onSearch, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
7582
+ const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, classNames, loading, disabled, open, filterOption, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onSearch, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
7582
7583
  const [addItemValue, setAddItemValue] = useState('');
7583
7584
  const classNameSelect = [styleSelect['select']];
7584
- className && classNameSelect.push(...className);
7585
+ classNames && classNameSelect.push(...classNames);
7585
7586
  const handleAddItem = (_) => {
7586
7587
  var _a;
7587
7588
  (_a = addItem === null || addItem === void 0 ? void 0 : addItem.onClick) === null || _a === void 0 ? void 0 : _a.call(addItem, addItemValue);
package/dist/index.js CHANGED
@@ -5364,10 +5364,11 @@ const NumberFormat = ({ noItem, text, size, align, classNames, variant, trailing
5364
5364
  !text && align === 'right' && classNumberFormat.push(styleNumberFormat['number-format-align-right']);
5365
5365
  classNames && classNumberFormat.push(...classNames);
5366
5366
  return classNumberFormat;
5367
- }, [classNames, text, size, validateStatus, status, variant, align]);
5367
+ }, [classNames, text, align]);
5368
+ const CustomInput = React.useCallback(React.memo((props) => (jsxRuntimeExports.jsx(antd.Input, Object.assign({}, props, { variant: variant })))), [variant]);
5368
5369
  return (jsxRuntimeExports.jsx("div", Object.assign({ onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onFocus, onClick: onClick }, text && align === 'right' && {
5369
5370
  style: { textAlign: 'right' }
5370
- }, { children: jsxRuntimeExports.jsx(reactNumberFormat.NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, customInput: antd.Input, size: size, 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 => {
5371
+ }, { children: jsxRuntimeExports.jsx(reactNumberFormat.NumericFormat, { thousandSeparator: true, fixedDecimalScale: true, customInput: CustomInput, size: size, 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 => {
5371
5372
  removeError === null || removeError === void 0 ? void 0 : removeError(name);
5372
5373
  setValueNumberFormat(event.target.value);
5373
5374
  onChange === null || onChange === void 0 ? void 0 : onChange(event);
@@ -5511,7 +5512,7 @@ var formColLayout = {
5511
5512
  notInline: {},
5512
5513
  };
5513
5514
 
5514
- const DatePickerComponent = ({ noItem, size, variant, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5515
+ const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5515
5516
  const [valueDate, setValueDate] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
5516
5517
  const handleChange = (date, dateString) => {
5517
5518
  setValueDate(date);
@@ -5524,13 +5525,13 @@ const DatePickerComponent = ({ noItem, size, variant, picker, format, disabledDa
5524
5525
  }));
5525
5526
  const classDate = [styleCSS['w-100']];
5526
5527
  classNames && classDate.push(...classNames);
5527
- const datePicker = !loading ? (jsxRuntimeExports.jsx(antd.DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
5528
+ const datePicker = !loading ? (jsxRuntimeExports.jsx(antd.DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, placeholder: placeholder, prefix: prefix, prefixCls: prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.join(' '), suffixIcon: suffixIcon, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
5528
5529
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "date", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
5529
5530
  : datePicker }));
5530
5531
  };
5531
5532
 
5532
5533
  const { RangePicker } = antd.DatePicker;
5533
- const DateRangePickerComponent = ({ noItem, size, variant, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5534
+ const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
5534
5535
  var _a;
5535
5536
  const [valueDateRange, setValueDateRange] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
5536
5537
  const handleChange = (date, dateStrings) => {
@@ -5544,7 +5545,7 @@ const DateRangePickerComponent = ({ noItem, size, variant, picker, format, disab
5544
5545
  }));
5545
5546
  const classDateRange = [styleCSS['w-100']];
5546
5547
  classNames && classDateRange.push(...classNames);
5547
- const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowEmpty: !required, allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
5548
+ const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, placeholder: placeholder, prefix: prefix, prefixCls: prefixCls === null || prefixCls === void 0 ? void 0 : prefixCls.join(' '), suffixIcon: suffixIcon, picker: picker, format: datePickerFormat[format !== null && format !== void 0 ? format : 'default'], allowEmpty: !required, allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
5548
5549
  return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleType: "array", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
5549
5550
  : datePicker }));
5550
5551
  };
@@ -7597,10 +7598,10 @@ var styleSelect = {"select":"style-module_select__vcvBg","add-item-divider":"sty
7597
7598
  styleInject(css_248z$4);
7598
7599
 
7599
7600
  const { Link } = antd.Typography;
7600
- const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, className, loading, disabled, open, filterOption, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onSearch, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
7601
+ const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, classNames, loading, disabled, open, filterOption, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onSearch, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
7601
7602
  const [addItemValue, setAddItemValue] = React.useState('');
7602
7603
  const classNameSelect = [styleSelect['select']];
7603
- className && classNameSelect.push(...className);
7604
+ classNames && classNameSelect.push(...classNames);
7604
7605
  const handleAddItem = (_) => {
7605
7606
  var _a;
7606
7607
  (_a = addItem === null || addItem === void 0 ? void 0 : addItem.onClick) === null || _a === void 0 ? void 0 : _a.call(addItem, addItemValue);
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.23",
4
+ "version": "0.0.25",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {
13
- "build": "rollup -c",
13
+ "build": "rm -rf dist && rollup -c",
14
14
  "prepare": "npm run build"
15
15
  },
16
16
  "directories": {