sti-antd-package 0.1.4 → 0.1.6
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.
- package/dist/esm/components/Card/Component.js +2 -2
- package/dist/esm/components/DatePicker/Component.js +2 -2
- package/dist/esm/components/DateRangePicker/Component.js +2 -2
- package/dist/esm/components/Input/Component.js +2 -2
- package/dist/esm/components/Select/Component.js +2 -2
- package/dist/esm/components/TextArea/Component.js +2 -2
- package/dist/esm/types/components/Card/types.d.ts +1 -0
- package/dist/esm/types/components/DatePicker/types.d.ts +1 -0
- package/dist/esm/types/components/DateRangePicker/types.d.ts +1 -0
- package/dist/esm/types/components/Input/types.d.ts +2 -1
- package/dist/esm/types/components/Select/types.d.ts +1 -0
- package/dist/esm/types/components/TextArea/types.d.ts +2 -0
- package/dist/lib/components/Card/Component.js +2 -2
- package/dist/lib/components/DatePicker/Component.js +2 -2
- package/dist/lib/components/DateRangePicker/Component.js +2 -2
- package/dist/lib/components/Input/Component.js +2 -2
- package/dist/lib/components/Select/Component.js +2 -2
- package/dist/lib/components/TextArea/Component.js +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../_virtual/jsx-runtime.js';
|
|
2
2
|
import { Card } from 'antd';
|
|
3
3
|
|
|
4
|
-
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
|
|
5
|
-
return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
|
|
4
|
+
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, ref, }) => {
|
|
5
|
+
return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, ref: ref, children: children }));
|
|
6
6
|
};
|
|
7
7
|
CardComponent.Meta = Card.Meta;
|
|
8
8
|
|
|
@@ -6,7 +6,7 @@ import FormItemComponent from '../Form/Item/Component.js';
|
|
|
6
6
|
import { DatePicker, Skeleton } from 'antd';
|
|
7
7
|
import React__default, { useState, useImperativeHandle, useMemo } from 'react';
|
|
8
8
|
|
|
9
|
-
const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
9
|
+
const DatePickerComponent = ({ noItem, size, variant, status, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
10
10
|
const [valueDate, setValueDate] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
|
|
11
11
|
const handleChange = (date, dateString) => {
|
|
12
12
|
setValueDate(date);
|
|
@@ -23,7 +23,7 @@ const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefi
|
|
|
23
23
|
classNames && className.push(...classNames);
|
|
24
24
|
return className;
|
|
25
25
|
}, [readOnly]);
|
|
26
|
-
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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
26
|
+
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, status: status, 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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
27
27
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: "date", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
28
28
|
: datePicker }));
|
|
29
29
|
};
|
|
@@ -7,7 +7,7 @@ import { DatePicker, Skeleton } from 'antd';
|
|
|
7
7
|
import React__default, { useState, useImperativeHandle, useMemo } from 'react';
|
|
8
8
|
|
|
9
9
|
const { RangePicker } = DatePicker;
|
|
10
|
-
const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
10
|
+
const DateRangePickerComponent = ({ noItem, size, variant, status, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
11
11
|
var _a;
|
|
12
12
|
const [valueDateRange, setValueDateRange] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
|
|
13
13
|
const handleChange = (date, dateStrings) => {
|
|
@@ -25,7 +25,7 @@ const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix,
|
|
|
25
25
|
classNames && className.push(...classNames);
|
|
26
26
|
return className;
|
|
27
27
|
}, [readOnly]);
|
|
28
|
-
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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, 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 });
|
|
28
|
+
const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, status: status, 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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, 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 });
|
|
29
29
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: "array", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
30
30
|
: datePicker }));
|
|
31
31
|
};
|
|
@@ -5,7 +5,7 @@ import styleInput from './style.module.css.js';
|
|
|
5
5
|
import { Input, Space, Skeleton } from 'antd';
|
|
6
6
|
import React__default, { useState, useImperativeHandle } from 'react';
|
|
7
7
|
|
|
8
|
-
const InputComponent = React__default.memo(({ noItem, password, autoFocus, allowClear, size, formClassNames, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
8
|
+
const InputComponent = React__default.memo(({ noItem, password, autoFocus, allowClear, size, formClassNames, classNames, variant, status, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
9
9
|
const [valueInput, setValueInput] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
10
10
|
const handleChange = (event) => {
|
|
11
11
|
setValueInput(event.target.value);
|
|
@@ -20,7 +20,7 @@ const InputComponent = React__default.memo(({ noItem, password, autoFocus, allow
|
|
|
20
20
|
classNames && classInput.push(...classNames);
|
|
21
21
|
uppercase && classInput.push(styleInput['uppercase']);
|
|
22
22
|
const InputType = !password ? Input : Input.Password;
|
|
23
|
-
const input = (jsxRuntimeExports.jsx(InputType, { autoFocus: autoFocus, allowClear: allowClear, size: size, className: classInput === null || classInput === void 0 ? void 0 : classInput.join(' '), variant: variant, autoComplete: autoCompleteOff ? 'off' : undefined, disabled: disabled, readOnly: readOnly, maxLength: maxLength, prefix: prefix, suffix: suffix, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onPressEnter: onPressEnter, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur }));
|
|
23
|
+
const input = (jsxRuntimeExports.jsx(InputType, { autoFocus: autoFocus, allowClear: allowClear, size: size, className: classInput === null || classInput === void 0 ? void 0 : classInput.join(' '), variant: variant, status: status, autoComplete: autoCompleteOff ? 'off' : undefined, disabled: disabled, readOnly: readOnly, maxLength: maxLength, prefix: prefix, suffix: suffix, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onPressEnter: onPressEnter, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur }));
|
|
24
24
|
const inputComponent = !loading ? ((addonBefore || addonAfter) ? (jsxRuntimeExports.jsxs(Space.Compact, { children: [addonBefore, input, addonAfter] })) : input) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
25
25
|
const normalize = (value, prevValue, allValues) => {
|
|
26
26
|
// if (uppercase) return value.toUpperCase()
|
|
@@ -6,7 +6,7 @@ import React__default, { useState, useMemo } from 'react';
|
|
|
6
6
|
import RefIcon from '../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js';
|
|
7
7
|
|
|
8
8
|
const { Link } = Typography;
|
|
9
|
-
const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, formClassNames, classNames, loading, readOnly, disabled, open, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
9
|
+
const SelectComponent = ({ noItem, showSearch, mode, variant, status, size, suffixIcon, formClassNames, classNames, loading, readOnly, disabled, open, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
10
10
|
const [addItemValue, setAddItemValue] = useState('');
|
|
11
11
|
const classNameSelect = useMemo(() => {
|
|
12
12
|
const className = [styleSelect['select']];
|
|
@@ -25,7 +25,7 @@ const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon,
|
|
|
25
25
|
};
|
|
26
26
|
const popupRender = menu => (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [menu, addItem &&
|
|
27
27
|
jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Divider, { className: styleSelect['add-item-divider'] }), jsxRuntimeExports.jsxs(Space, { align: "center", className: styleSelect['add-item-space'], children: [jsxRuntimeExports.jsx(Input, { placeholder: "Please enter item", value: addItemValue, onChange: event => setAddItemValue(event.target.value) }), jsxRuntimeExports.jsxs(Link, { className: styleSelect['add-item-link'], onClick: handleAddItem, children: [jsxRuntimeExports.jsx(RefIcon, {}), " Add item"] })] })] })] }));
|
|
28
|
-
const select = !loading ? (jsxRuntimeExports.jsx(Select, { mode: mode, showSearch: showSearch, variant: variant, allowClear: !required, size: size, suffixIcon: suffixIcon, className: classNameSelect.join(' '), disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, open: open, placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: (value, event) => {
|
|
28
|
+
const select = !loading ? (jsxRuntimeExports.jsx(Select, { mode: mode, showSearch: showSearch, variant: variant, status: status, allowClear: !required, size: size, suffixIcon: suffixIcon, className: classNameSelect.join(' '), disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, open: open, placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: (value, event) => {
|
|
29
29
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
30
30
|
onChange === null || onChange === void 0 ? void 0 : onChange(value, event);
|
|
31
31
|
}, onKeyDown: onKeyDown, onFocus: onFocus, notFoundContent: notFoundContent, tokenSeparators: tokenSeparators, options: options === null || options === void 0 ? void 0 : options.filter(option => option.value !== undefined), optionLabelProp: "label", optionRender: optionRender, popupRender: popupRender, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
@@ -5,7 +5,7 @@ import { Skeleton } from 'antd';
|
|
|
5
5
|
import TextArea from '../../node_modules/antd/es/input/TextArea.js';
|
|
6
6
|
import React__default, { useState, useImperativeHandle } from 'react';
|
|
7
7
|
|
|
8
|
-
const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, removeError, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
8
|
+
const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className, rows, variant, status, loading, disabled, readOnly, placeholder, value, defaultValue, removeError, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
9
9
|
const classTextArea = [];
|
|
10
10
|
className && classTextArea.push(...className);
|
|
11
11
|
noResize && classTextArea.push(styleTextArea['resize-none']);
|
|
@@ -19,7 +19,7 @@ const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className,
|
|
|
19
19
|
value: () => valueTextArea,
|
|
20
20
|
setValue: () => setValueTextArea,
|
|
21
21
|
}));
|
|
22
|
-
const textArea = !loading ? (jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
22
|
+
const textArea = !loading ? (jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, status: status, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
23
23
|
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: textArea })))
|
|
24
24
|
: textArea }));
|
|
25
25
|
};
|
|
@@ -11,6 +11,7 @@ export interface CardComponentProps {
|
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
styles?: CardProps['styles'];
|
|
13
13
|
children?: React.ReactNode;
|
|
14
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
14
15
|
}
|
|
15
16
|
export type CardComponentType = React.FC<CardComponentProps> & {
|
|
16
17
|
Meta: React.FC<CardMetaProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormItemInput } from "../Form/Item";
|
|
2
|
-
import { FormItemProps } from "antd";
|
|
2
|
+
import { FormItemProps, InputProps } from "antd";
|
|
3
3
|
import { Variant } from "antd/es/config-provider";
|
|
4
4
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
5
5
|
import { valueType } from "antd/es/statistic/utils";
|
|
@@ -17,6 +17,7 @@ interface Input {
|
|
|
17
17
|
size?: SizeType;
|
|
18
18
|
classNames?: string[];
|
|
19
19
|
variant?: Variant;
|
|
20
|
+
status?: InputProps['status'];
|
|
20
21
|
autoCompleteOff?: boolean;
|
|
21
22
|
readOnly?: boolean;
|
|
22
23
|
maxLength?: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FormItemTextArea } from "../Form/Item";
|
|
2
2
|
import { Variant } from "antd/es/config-provider";
|
|
3
3
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
|
+
import { TextAreaProps } from "antd/es/input";
|
|
4
5
|
import { valueType } from "antd/es/statistic/utils";
|
|
5
6
|
import { Ref } from "react";
|
|
6
7
|
export interface TextAreaComponentRef {
|
|
@@ -13,6 +14,7 @@ interface TextArea {
|
|
|
13
14
|
className?: string[];
|
|
14
15
|
rows?: number;
|
|
15
16
|
variant?: Variant;
|
|
17
|
+
status?: TextAreaProps['status'];
|
|
16
18
|
readOnly?: boolean;
|
|
17
19
|
placeholder?: string;
|
|
18
20
|
value?: valueType;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var jsxRuntime = require('../../_virtual/jsx-runtime.js');
|
|
4
4
|
var antd = require('antd');
|
|
5
5
|
|
|
6
|
-
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, }) => {
|
|
7
|
-
return (jsxRuntime.jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, children: children }));
|
|
6
|
+
const CardComponent = ({ size, title, onClick, classNames, className, actions, style, styles, children, ref, }) => {
|
|
7
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, actions: actions, style: style, styles: styles, ref: ref, children: children }));
|
|
8
8
|
};
|
|
9
9
|
CardComponent.Meta = antd.Card.Meta;
|
|
10
10
|
|
|
@@ -8,7 +8,7 @@ var Component = require('../Form/Item/Component.js');
|
|
|
8
8
|
var antd = require('antd');
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
|
-
const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
11
|
+
const DatePickerComponent = ({ noItem, size, variant, status, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
12
12
|
const [valueDate, setValueDate] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
|
|
13
13
|
const handleChange = (date, dateString) => {
|
|
14
14
|
setValueDate(date);
|
|
@@ -25,7 +25,7 @@ const DatePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefi
|
|
|
25
25
|
classNames && className.push(...classNames);
|
|
26
26
|
return className;
|
|
27
27
|
}, [readOnly]);
|
|
28
|
-
const datePicker = !loading ? (jsxRuntime.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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
28
|
+
const datePicker = !loading ? (jsxRuntime.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, status: status, 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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
29
29
|
return (jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntime.jsxRuntimeExports.jsx(Component, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: "date", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
30
30
|
: datePicker }));
|
|
31
31
|
};
|
|
@@ -9,7 +9,7 @@ var antd = require('antd');
|
|
|
9
9
|
var React = require('react');
|
|
10
10
|
|
|
11
11
|
const { RangePicker } = antd.DatePicker;
|
|
12
|
-
const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
12
|
+
const DateRangePickerComponent = ({ noItem, size, variant, status, placeholder, prefix, prefixCls, suffixIcon, picker, format, disabledDate, disabledTime, loading, readOnly, disabled, value, defaultValue, removeError, onChange, style, formColLayout, name, label, formClassNames, classNames = [], className, required, rules, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
13
13
|
var _a;
|
|
14
14
|
const [valueDateRange, setValueDateRange] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : null);
|
|
15
15
|
const handleChange = (date, dateStrings) => {
|
|
@@ -27,7 +27,7 @@ const DateRangePickerComponent = ({ noItem, size, variant, placeholder, prefix,
|
|
|
27
27
|
classNames && className.push(...classNames);
|
|
28
28
|
return className;
|
|
29
29
|
}, [readOnly]);
|
|
30
|
-
const datePicker = !loading ? (jsxRuntime.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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
30
|
+
const datePicker = !loading ? (jsxRuntime.jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, status: status, 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, inputReadOnly: readOnly, readOnly: readOnly, disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, disabledDate: disabledDate, disabledTime: disabledTime, value: (_a = value !== null && value !== void 0 ? value : valueDateRange) !== null && _a !== void 0 ? _a : null, onChange: handleChange, style: style })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
31
31
|
return (jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntime.jsxRuntimeExports.jsx(Component, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: "array", ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
32
32
|
: datePicker }));
|
|
33
33
|
};
|
|
@@ -7,7 +7,7 @@ var style_module = require('./style.module.css.js');
|
|
|
7
7
|
var antd = require('antd');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
|
|
10
|
-
const InputComponent = React.memo(({ noItem, password, autoFocus, allowClear, size, formClassNames, classNames, variant, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
10
|
+
const InputComponent = React.memo(({ noItem, password, autoFocus, allowClear, size, formClassNames, classNames, variant, status, autoCompleteOff, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, removeError, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
11
11
|
const [valueInput, setValueInput] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
12
12
|
const handleChange = (event) => {
|
|
13
13
|
setValueInput(event.target.value);
|
|
@@ -22,7 +22,7 @@ const InputComponent = React.memo(({ noItem, password, autoFocus, allowClear, si
|
|
|
22
22
|
classNames && classInput.push(...classNames);
|
|
23
23
|
uppercase && classInput.push(style_module['uppercase']);
|
|
24
24
|
const InputType = !password ? antd.Input : antd.Input.Password;
|
|
25
|
-
const input = (jsxRuntime.jsxRuntimeExports.jsx(InputType, { autoFocus: autoFocus, allowClear: allowClear, size: size, className: classInput === null || classInput === void 0 ? void 0 : classInput.join(' '), variant: variant, autoComplete: autoCompleteOff ? 'off' : undefined, disabled: disabled, readOnly: readOnly, maxLength: maxLength, prefix: prefix, suffix: suffix, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onPressEnter: onPressEnter, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur }));
|
|
25
|
+
const input = (jsxRuntime.jsxRuntimeExports.jsx(InputType, { autoFocus: autoFocus, allowClear: allowClear, size: size, className: classInput === null || classInput === void 0 ? void 0 : classInput.join(' '), variant: variant, status: status, autoComplete: autoCompleteOff ? 'off' : undefined, disabled: disabled, readOnly: readOnly, maxLength: maxLength, prefix: prefix, suffix: suffix, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueInput, onChange: handleChange, onKeyDown: onKeyDown, onPressEnter: onPressEnter, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onClick: onClick, onFocus: onFocus, onBlur: onBlur }));
|
|
26
26
|
const inputComponent = !loading ? ((addonBefore || addonAfter) ? (jsxRuntime.jsxRuntimeExports.jsxs(antd.Space.Compact, { children: [addonBefore, input, addonAfter] })) : input) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
27
27
|
const normalize = (value, prevValue, allValues) => {
|
|
28
28
|
// if (uppercase) return value.toUpperCase()
|
|
@@ -8,7 +8,7 @@ var React = require('react');
|
|
|
8
8
|
var PlusOutlined = require('../../node_modules/@ant-design/icons/es/icons/PlusOutlined.js');
|
|
9
9
|
|
|
10
10
|
const { Link } = antd.Typography;
|
|
11
|
-
const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon, formClassNames, classNames, loading, readOnly, disabled, open, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
11
|
+
const SelectComponent = ({ noItem, showSearch, mode, variant, status, size, suffixIcon, formClassNames, classNames, loading, readOnly, disabled, open, placeholder, value, defaultValue, removeError, onChange, onKeyDown, onFocus, notFoundContent, tokenSeparators, options, style, addItem, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
12
12
|
const [addItemValue, setAddItemValue] = React.useState('');
|
|
13
13
|
const classNameSelect = React.useMemo(() => {
|
|
14
14
|
const className = [style_module['select']];
|
|
@@ -27,7 +27,7 @@ const SelectComponent = ({ noItem, showSearch, mode, variant, size, suffixIcon,
|
|
|
27
27
|
};
|
|
28
28
|
const popupRender = menu => (jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [menu, addItem &&
|
|
29
29
|
jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx(antd.Divider, { className: style_module['add-item-divider'] }), jsxRuntime.jsxRuntimeExports.jsxs(antd.Space, { align: "center", className: style_module['add-item-space'], children: [jsxRuntime.jsxRuntimeExports.jsx(antd.Input, { placeholder: "Please enter item", value: addItemValue, onChange: event => setAddItemValue(event.target.value) }), jsxRuntime.jsxRuntimeExports.jsxs(Link, { className: style_module['add-item-link'], onClick: handleAddItem, children: [jsxRuntime.jsxRuntimeExports.jsx(PlusOutlined, {}), " Add item"] })] })] })] }));
|
|
30
|
-
const select = !loading ? (jsxRuntime.jsxRuntimeExports.jsx(antd.Select, { mode: mode, showSearch: showSearch, variant: variant, allowClear: !required, size: size, suffixIcon: suffixIcon, className: classNameSelect.join(' '), disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, open: open, placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: (value, event) => {
|
|
30
|
+
const select = !loading ? (jsxRuntime.jsxRuntimeExports.jsx(antd.Select, { mode: mode, showSearch: showSearch, variant: variant, status: status, allowClear: !required, size: size, suffixIcon: suffixIcon, className: classNameSelect.join(' '), disabled: disabled !== null && disabled !== void 0 ? disabled : readOnly, open: open, placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: (value, event) => {
|
|
31
31
|
removeError === null || removeError === void 0 ? void 0 : removeError(name);
|
|
32
32
|
onChange === null || onChange === void 0 ? void 0 : onChange(value, event);
|
|
33
33
|
}, onKeyDown: onKeyDown, onFocus: onFocus, notFoundContent: notFoundContent, tokenSeparators: tokenSeparators, options: options === null || options === void 0 ? void 0 : options.filter(option => option.value !== undefined), optionLabelProp: "label", optionRender: optionRender, popupRender: popupRender, style: style })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
@@ -7,7 +7,7 @@ var antd = require('antd');
|
|
|
7
7
|
var TextArea = require('../../node_modules/antd/es/input/TextArea.js');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
|
|
10
|
-
const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, removeError, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
10
|
+
const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className, rows, variant, status, loading, disabled, readOnly, placeholder, value, defaultValue, removeError, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
11
11
|
const classTextArea = [];
|
|
12
12
|
className && classTextArea.push(...className);
|
|
13
13
|
noResize && classTextArea.push(style_module['resize-none']);
|
|
@@ -21,7 +21,7 @@ const TextAreaComponent = ({ noItem, noResize, size, formClassNames, className,
|
|
|
21
21
|
value: () => valueTextArea,
|
|
22
22
|
setValue: () => setValueTextArea,
|
|
23
23
|
}));
|
|
24
|
-
const textArea = !loading ? (jsxRuntime.jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
24
|
+
const textArea = !loading ? (jsxRuntime.jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, status: status, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntime.jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
25
25
|
return (jsxRuntime.jsxRuntimeExports.jsx(jsxRuntime.jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntime.jsxRuntimeExports.jsx(Component$1, Object.assign({}, formColLayout, { name: name, label: label, classNames: formClassNames, required: required, ruleType: ruleType, ruleMessage: ruleMessage, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: textArea })))
|
|
26
26
|
: textArea }));
|
|
27
27
|
};
|