dce-reactkit 5.0.5 → 5.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/cjs/index.js +5 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/CheckboxButton.d.ts +1 -0
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/CheckboxButton.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/CheckboxButton.tsx +25 -20
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -48,6 +48,8 @@ type Props = {
|
|
|
48
48
|
dashed?: boolean,
|
|
49
49
|
// If true, use complex formatting (tabs, newlines) in the text
|
|
50
50
|
useComplexFormatting?: boolean,
|
|
51
|
+
// Min bootstrap size to show the label
|
|
52
|
+
minSizeToShowLabel?: 'sm' | 'md' | 'lg' | 'xl',
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
/*------------------------------------------------------------------------*/
|
|
@@ -83,6 +85,7 @@ const CheckboxButton: React.FC<Props> = (props) => {
|
|
|
83
85
|
small,
|
|
84
86
|
dashed,
|
|
85
87
|
useComplexFormatting,
|
|
88
|
+
minSizeToShowLabel,
|
|
86
89
|
} = props;
|
|
87
90
|
|
|
88
91
|
/*------------------------------------------------------------------------*/
|
|
@@ -118,30 +121,32 @@ const CheckboxButton: React.FC<Props> = (props) => {
|
|
|
118
121
|
}}
|
|
119
122
|
>
|
|
120
123
|
<div className="d-flex align-items-center">
|
|
121
|
-
<div
|
|
124
|
+
<div>
|
|
122
125
|
<FontAwesomeIcon
|
|
123
126
|
icon={icon}
|
|
124
127
|
/>
|
|
125
128
|
</div>
|
|
126
|
-
{
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
129
|
+
<div className={`text-start flex-grow-1 ms-1 ${minSizeToShowLabel ? `d-none d-${minSizeToShowLabel}-block` : ''}`}>
|
|
130
|
+
{
|
|
131
|
+
useComplexFormatting
|
|
132
|
+
? (
|
|
133
|
+
<pre
|
|
134
|
+
className="ps-1 text-break m-0"
|
|
135
|
+
style={{
|
|
136
|
+
whiteSpace: 'pre-wrap',
|
|
137
|
+
tabSize: 2,
|
|
138
|
+
}}
|
|
139
|
+
>
|
|
140
|
+
{text}
|
|
141
|
+
</pre>
|
|
142
|
+
)
|
|
143
|
+
: (
|
|
144
|
+
<div className="text-break">
|
|
145
|
+
{text}
|
|
146
|
+
</div>
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
</div>
|
|
145
150
|
</div>
|
|
146
151
|
</button>
|
|
147
152
|
);
|