dce-reactkit 3.7.14 → 3.7.16
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/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ButtonInputGroup.d.ts +3 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ButtonInputGroup.d.ts +3 -1
- package/dist/index.d.ts +3 -1
- package/package.json +1 -1
- package/src/components/ButtonInputGroup.tsx +10 -4
|
@@ -4,11 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
type Props = {
|
|
7
|
-
label:
|
|
7
|
+
label: React.ReactNode;
|
|
8
8
|
minLabelWidth?: string;
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
className?: string;
|
|
11
11
|
wrapButtonsAndAddGaps?: boolean;
|
|
12
|
+
isAdminFeature?: boolean;
|
|
13
|
+
noMarginOnBottom?: boolean;
|
|
12
14
|
};
|
|
13
15
|
declare const ButtonInputGroup: React.FC<Props>;
|
|
14
16
|
export default ButtonInputGroup;
|
package/dist/index.d.ts
CHANGED
|
@@ -244,11 +244,13 @@ declare const CheckboxButton: React$1.FC<Props$g>;
|
|
|
244
244
|
*/
|
|
245
245
|
|
|
246
246
|
type Props$f = {
|
|
247
|
-
label:
|
|
247
|
+
label: React$1.ReactNode;
|
|
248
248
|
minLabelWidth?: string;
|
|
249
249
|
children: React$1.ReactNode;
|
|
250
250
|
className?: string;
|
|
251
251
|
wrapButtonsAndAddGaps?: boolean;
|
|
252
|
+
isAdminFeature?: boolean;
|
|
253
|
+
noMarginOnBottom?: boolean;
|
|
252
254
|
};
|
|
253
255
|
declare const ButtonInputGroup: React$1.FC<Props$f>;
|
|
254
256
|
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ import React from 'react';
|
|
|
13
13
|
// Props definition
|
|
14
14
|
type Props = {
|
|
15
15
|
// Label text
|
|
16
|
-
label:
|
|
16
|
+
label: React.ReactNode,
|
|
17
17
|
// Minimum width of the label (css units)
|
|
18
18
|
minLabelWidth?: string,
|
|
19
19
|
// Buttons
|
|
@@ -22,6 +22,10 @@ type Props = {
|
|
|
22
22
|
className?: string,
|
|
23
23
|
// If true, wrap buttons and create gaps
|
|
24
24
|
wrapButtonsAndAddGaps?: boolean,
|
|
25
|
+
// If true, is an admin feature
|
|
26
|
+
isAdminFeature?: boolean,
|
|
27
|
+
// If true, don't add a margin on the bottom
|
|
28
|
+
noMarginOnBottom?: boolean,
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
/*------------------------------------------------------------------------*/
|
|
@@ -42,6 +46,8 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
42
46
|
children,
|
|
43
47
|
className,
|
|
44
48
|
wrapButtonsAndAddGaps,
|
|
49
|
+
isAdminFeature,
|
|
50
|
+
noMarginOnBottom,
|
|
45
51
|
} = props;
|
|
46
52
|
|
|
47
53
|
/*------------------------------------------------------------------------*/
|
|
@@ -53,11 +59,11 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
53
59
|
/*----------------------------------------*/
|
|
54
60
|
|
|
55
61
|
return (
|
|
56
|
-
<div className={`input-group ${className ?? ''}`}>
|
|
62
|
+
<div className={`input-group ${className ?? ''} ${noMarginOnBottom ? '' : 'mb-2'}`}>
|
|
57
63
|
<div className="input-group-prepend d-flex w-100">
|
|
58
64
|
{/* Label */}
|
|
59
65
|
<span
|
|
60
|
-
className=
|
|
66
|
+
className={`input-group-text ${isAdminFeature ? 'border border-success progress-bar-striped bg-success text-white fw-bold' : ''}`}
|
|
61
67
|
style={{
|
|
62
68
|
minWidth: (
|
|
63
69
|
minLabelWidth
|
|
@@ -72,7 +78,7 @@ const ButtonInputGroup: React.FC<Props> = (props) => {
|
|
|
72
78
|
|
|
73
79
|
{/* Contents */}
|
|
74
80
|
<span
|
|
75
|
-
className=
|
|
81
|
+
className={`input-group-text flex-grow-1 ${isAdminFeature ? 'border-success ' : ''}rounded-right d-flex flex-wrap`}
|
|
76
82
|
style={{
|
|
77
83
|
backgroundColor: 'white',
|
|
78
84
|
borderTopLeftRadius: 0,
|