odaptos_design_system 2.0.270 → 2.0.271
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/Checkbox.d.ts +3 -1
- package/dist/odaptos_design_system.cjs.development.js +10 -2
- package/dist/odaptos_design_system.cjs.development.js.map +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js +1 -1
- package/dist/odaptos_design_system.cjs.production.min.js.map +1 -1
- package/dist/odaptos_design_system.esm.js +10 -2
- package/dist/odaptos_design_system.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/Atoms/Checkbox/Checkbox.tsx +11 -1
|
@@ -11,6 +11,8 @@ interface CheckboxProps {
|
|
|
11
11
|
className?: string;
|
|
12
12
|
color?: string;
|
|
13
13
|
name?: string;
|
|
14
|
+
stopPropagation?: boolean;
|
|
15
|
+
preventDefault?: boolean;
|
|
14
16
|
}
|
|
15
|
-
export declare const Checkbox: ({ id, label, leftLabel, onBlur, checked, disabled, onChange, required, className, color, name, }: CheckboxProps) => React.JSX.Element;
|
|
17
|
+
export declare const Checkbox: ({ id, label, leftLabel, onBlur, checked, disabled, onChange, required, className, color, name, stopPropagation, preventDefault, }: CheckboxProps) => React.JSX.Element;
|
|
16
18
|
export {};
|
|
@@ -18464,14 +18464,22 @@ const Checkbox = ({
|
|
|
18464
18464
|
required,
|
|
18465
18465
|
className,
|
|
18466
18466
|
color,
|
|
18467
|
-
name
|
|
18467
|
+
name,
|
|
18468
|
+
stopPropagation = false,
|
|
18469
|
+
preventDefault = false
|
|
18468
18470
|
}) => {
|
|
18469
18471
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
18470
18472
|
className: `${styles$b.checkboxContainer} ${disabled ? styles$b.disabled : ''} ${className}`,
|
|
18471
18473
|
style: {
|
|
18472
18474
|
cursor: disabled ? 'not-allowed' : 'pointer'
|
|
18473
18475
|
},
|
|
18474
|
-
onClick:
|
|
18476
|
+
onClick: e => {
|
|
18477
|
+
if (stopPropagation) {
|
|
18478
|
+
e.stopPropagation();
|
|
18479
|
+
}
|
|
18480
|
+
if (preventDefault) {
|
|
18481
|
+
e.preventDefault();
|
|
18482
|
+
}
|
|
18475
18483
|
if (!disabled) {
|
|
18476
18484
|
const newValue = !checked;
|
|
18477
18485
|
onChange({
|