sti-antd-package 0.0.22 → 0.0.24

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.
@@ -11,4 +11,6 @@ export interface TabsComponentProps {
11
11
  icon?: React.ReactNode;
12
12
  content: React.ReactNode;
13
13
  }[];
14
+ onChange?: (activeKey: string) => void;
15
+ defaultActiveKey?: string;
14
16
  }
package/dist/index.d.ts CHANGED
@@ -1020,6 +1020,8 @@ interface TabsComponentProps {
1020
1020
  icon?: React.ReactNode;
1021
1021
  content: React.ReactNode;
1022
1022
  }[];
1023
+ onChange?: (activeKey: string) => void;
1024
+ defaultActiveKey?: string;
1023
1025
  }
1024
1026
 
1025
1027
  declare const TabsComponent: React$1.FC<TabsComponentProps>;
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);
@@ -8648,15 +8649,15 @@ const TableCellEditableComponent = (_a) => {
8648
8649
  return jsxRuntimeExports.jsx("td", Object.assign({}, props, { children: childNode }));
8649
8650
  };
8650
8651
 
8651
- const TabsComponent = ({ centered, type, tabPosition, tabBarExtraContent, tabBarGutter, tabs, }) => {
8652
+ const TabsComponent = ({ centered, type, tabPosition, tabBarExtraContent, tabBarGutter, tabs, onChange, defaultActiveKey, }) => {
8652
8653
  var _a;
8653
8654
  return (jsxRuntimeExports.jsx(Tabs, { centered: centered, type: type, tabPosition: tabPosition, tabBarExtraContent: tabBarExtraContent, tabBarGutter: tabBarGutter, items: (_a = tabs === null || tabs === void 0 ? void 0 : tabs.map) === null || _a === void 0 ? void 0 : _a.call(tabs, tab => ({
8654
8655
  key: tab.key,
8655
8656
  label: tab.name,
8656
8657
  children: tab.content,
8657
8658
  icon: tab.icon,
8658
- })), indicator: {
8659
- size: (origin) => origin - 20,
8659
+ })), onChange: onChange, defaultActiveKey: defaultActiveKey, indicator: {
8660
+ size: origin => origin - 20,
8660
8661
  // align: ,
8661
8662
  }, animated: {
8662
8663
  inkBar: true,
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);
@@ -8667,15 +8668,15 @@ const TableCellEditableComponent = (_a) => {
8667
8668
  return jsxRuntimeExports.jsx("td", Object.assign({}, props, { children: childNode }));
8668
8669
  };
8669
8670
 
8670
- const TabsComponent = ({ centered, type, tabPosition, tabBarExtraContent, tabBarGutter, tabs, }) => {
8671
+ const TabsComponent = ({ centered, type, tabPosition, tabBarExtraContent, tabBarGutter, tabs, onChange, defaultActiveKey, }) => {
8671
8672
  var _a;
8672
8673
  return (jsxRuntimeExports.jsx(antd.Tabs, { centered: centered, type: type, tabPosition: tabPosition, tabBarExtraContent: tabBarExtraContent, tabBarGutter: tabBarGutter, items: (_a = tabs === null || tabs === void 0 ? void 0 : tabs.map) === null || _a === void 0 ? void 0 : _a.call(tabs, tab => ({
8673
8674
  key: tab.key,
8674
8675
  label: tab.name,
8675
8676
  children: tab.content,
8676
8677
  icon: tab.icon,
8677
- })), indicator: {
8678
- size: (origin) => origin - 20,
8678
+ })), onChange: onChange, defaultActiveKey: defaultActiveKey, indicator: {
8679
+ size: origin => origin - 20,
8679
8680
  // align: ,
8680
8681
  }, animated: {
8681
8682
  inkBar: true,
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.22",
4
+ "version": "0.0.24",
5
5
  "type": "module",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",