@taikai/rocket-kit 3.0.5 → 3.0.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/atoms/checkbox/index.d.ts +2 -2
- package/dist/atoms/error-field/index.d.ts +1 -1
- package/dist/atoms/spinner/index.d.ts +1 -1
- package/dist/atoms/text-field/index.d.ts +1 -1
- package/dist/molecules/actions-menu/index.d.ts +2 -2
- package/dist/molecules/field-with-button/index.d.ts +1 -1
- package/dist/molecules/note-card/index.d.ts +1 -1
- package/dist/rocket-kit.cjs.development.js +21 -18
- package/dist/rocket-kit.cjs.development.js.map +1 -1
- package/dist/rocket-kit.cjs.production.min.js +146 -146
- package/dist/rocket-kit.cjs.production.min.js.map +1 -1
- package/dist/rocket-kit.esm.js +21 -18
- package/dist/rocket-kit.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
-
interface
|
|
2
|
+
export interface CheckboxProps {
|
|
3
3
|
value: string;
|
|
4
4
|
label?: string | React.ReactNode;
|
|
5
5
|
checked?: boolean | undefined;
|
|
@@ -11,5 +11,5 @@ interface Props {
|
|
|
11
11
|
dataTestId?: string;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const Checkbox: ({ label, value, checked, onChange, error, disabled, className, style, dataTestId, required, }:
|
|
14
|
+
declare const Checkbox: ({ label, value, checked, onChange, error, disabled, className, style, dataTestId, required, }: CheckboxProps) => React.JSX.Element;
|
|
15
15
|
export default Checkbox;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ActionMenu } from './types';
|
|
3
|
-
interface ActionsMenuListInterface<T> {
|
|
3
|
+
export interface ActionsMenuListInterface<T> {
|
|
4
4
|
actions: ActionMenu<T>[];
|
|
5
5
|
data?: any;
|
|
6
6
|
rowIndex?: number;
|
|
7
7
|
handleOptionClick?: () => void;
|
|
8
8
|
}
|
|
9
|
-
interface ActionsMenuInterface<T> {
|
|
9
|
+
export interface ActionsMenuInterface<T> {
|
|
10
10
|
className?: string;
|
|
11
11
|
ariaLabel?: string;
|
|
12
12
|
actions: ActionMenu<T>[];
|
|
@@ -15,5 +15,5 @@ export interface FieldWidthButtonProps {
|
|
|
15
15
|
buttonDisabled?: boolean;
|
|
16
16
|
clearFieldAfterSubmit?: boolean;
|
|
17
17
|
}
|
|
18
|
-
declare const FieldWidthButton: (
|
|
18
|
+
declare const FieldWidthButton: ({ label, type, name, placeholder, value, onChange, dataTestId, buttonIcon, buttonValue, buttonAction, buttonDisabled, disabled, clearFieldAfterSubmit, }: FieldWidthButtonProps) => React.JSX.Element;
|
|
19
19
|
export default FieldWidthButton;
|
|
@@ -457,7 +457,7 @@ const CheckboxLabel = /*#__PURE__*/_styled__default.span.withConfig({
|
|
|
457
457
|
const CheckboxInput = /*#__PURE__*/_styled__default.input.withConfig({
|
|
458
458
|
displayName: "styles__CheckboxInput",
|
|
459
459
|
componentId: "sc-w5t014-2"
|
|
460
|
-
})(["position:absolute;left:0;opacity:0;cursor:pointer
|
|
460
|
+
})(["position:absolute;left:0;opacity:0;cursor:pointer;"]);
|
|
461
461
|
const Checkmark = /*#__PURE__*/_styled__default.span.withConfig({
|
|
462
462
|
displayName: "styles__Checkmark",
|
|
463
463
|
componentId: "sc-w5t014-3"
|
|
@@ -5336,24 +5336,23 @@ const Field = _styled__default.div`
|
|
|
5336
5336
|
}
|
|
5337
5337
|
`;
|
|
5338
5338
|
|
|
5339
|
-
const FieldWidthButton =
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
} = props;
|
|
5339
|
+
const FieldWidthButton = ({
|
|
5340
|
+
label,
|
|
5341
|
+
type = 'text',
|
|
5342
|
+
name,
|
|
5343
|
+
placeholder,
|
|
5344
|
+
value,
|
|
5345
|
+
onChange,
|
|
5346
|
+
dataTestId,
|
|
5347
|
+
buttonIcon,
|
|
5348
|
+
buttonValue,
|
|
5349
|
+
buttonAction,
|
|
5350
|
+
buttonDisabled,
|
|
5351
|
+
disabled = true,
|
|
5352
|
+
clearFieldAfterSubmit = false
|
|
5353
|
+
}) => {
|
|
5355
5354
|
const [loading, setLoading] = React.useState(false);
|
|
5356
|
-
const [fieldValue, setFieldValue] = React.useState(value ??
|
|
5355
|
+
const [fieldValue, setFieldValue] = React.useState(value ?? '');
|
|
5357
5356
|
const handleOnClickAction = async () => {
|
|
5358
5357
|
if ((buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction.constructor.name) !== 'AsyncFunction') {
|
|
5359
5358
|
buttonAction === null || buttonAction === void 0 ? void 0 : buttonAction(fieldValue);
|
|
@@ -5364,6 +5363,10 @@ const FieldWidthButton = props => {
|
|
|
5364
5363
|
}
|
|
5365
5364
|
clearFieldAfterSubmit && setFieldValue('');
|
|
5366
5365
|
};
|
|
5366
|
+
React.useEffect(() => {
|
|
5367
|
+
if (!value) return;
|
|
5368
|
+
setFieldValue(value);
|
|
5369
|
+
}, [value]);
|
|
5367
5370
|
return /*#__PURE__*/React__default.createElement(Wrapper$e, null, label && /*#__PURE__*/React__default.createElement(Label, {
|
|
5368
5371
|
value: label
|
|
5369
5372
|
}), /*#__PURE__*/React__default.createElement(Field, null, /*#__PURE__*/React__default.createElement(TextField, {
|