dce-reactkit 3.9.9 → 3.10.0
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 +15 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/RadioButton.d.ts +2 -0
- package/dist/esm/index.js +15 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/RadioButton.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/CheckboxButton.tsx +15 -15
- package/src/components/RadioButton.tsx +25 -2
- package/src/helpers/genRouteHandler.ts +7 -7
|
@@ -11,10 +11,12 @@ type Props = {
|
|
|
11
11
|
title?: string;
|
|
12
12
|
selected?: boolean;
|
|
13
13
|
id?: string;
|
|
14
|
+
className?: string;
|
|
14
15
|
noMarginOnRight?: boolean;
|
|
15
16
|
selectedVariant?: Variant;
|
|
16
17
|
unselectedVariant?: Variant;
|
|
17
18
|
small?: boolean;
|
|
19
|
+
useComplexFormatting?: boolean;
|
|
18
20
|
};
|
|
19
21
|
declare const RadioButton: React.FC<Props>;
|
|
20
22
|
export default RadioButton;
|
package/dist/index.d.ts
CHANGED
|
@@ -244,10 +244,12 @@ type Props$i = {
|
|
|
244
244
|
title?: string;
|
|
245
245
|
selected?: boolean;
|
|
246
246
|
id?: string;
|
|
247
|
+
className?: string;
|
|
247
248
|
noMarginOnRight?: boolean;
|
|
248
249
|
selectedVariant?: Variant;
|
|
249
250
|
unselectedVariant?: Variant;
|
|
250
251
|
small?: boolean;
|
|
252
|
+
useComplexFormatting?: boolean;
|
|
251
253
|
};
|
|
252
254
|
declare const RadioButton: React$1.FC<Props$i>;
|
|
253
255
|
|
package/package.json
CHANGED
|
@@ -126,21 +126,21 @@ const CheckboxButton: React.FC<Props> = (props) => {
|
|
|
126
126
|
</div>
|
|
127
127
|
{
|
|
128
128
|
useComplexFormatting
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
? (
|
|
130
|
+
<pre
|
|
131
|
+
className="ps-2 text-start text-break"
|
|
132
|
+
style={{
|
|
133
|
+
whiteSpace: 'pre-wrap',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{text}
|
|
137
|
+
</pre>
|
|
138
|
+
)
|
|
139
|
+
: (
|
|
140
|
+
<div className="flex-grow-1 text-start text-break ps-2">
|
|
141
|
+
{text}
|
|
142
|
+
</div>
|
|
143
|
+
)
|
|
144
144
|
}
|
|
145
145
|
</div>
|
|
146
146
|
</button>
|
|
@@ -32,6 +32,8 @@ type Props = {
|
|
|
32
32
|
selected?: boolean,
|
|
33
33
|
// The id of the button
|
|
34
34
|
id?: string,
|
|
35
|
+
// Custom class name of the button
|
|
36
|
+
className?: string,
|
|
35
37
|
// If true, no margin on right
|
|
36
38
|
noMarginOnRight?: boolean,
|
|
37
39
|
// Variant for when radio is selected
|
|
@@ -40,6 +42,8 @@ type Props = {
|
|
|
40
42
|
unselectedVariant?: Variant,
|
|
41
43
|
// True if using a small button
|
|
42
44
|
small?: boolean,
|
|
45
|
+
// If true, use complex formatting (tabs, newlines) in the text
|
|
46
|
+
useComplexFormatting?: boolean,
|
|
43
47
|
};
|
|
44
48
|
|
|
45
49
|
/*------------------------------------------------------------------------*/
|
|
@@ -60,6 +64,7 @@ const RadioButton: React.FC<Props> = (props) => {
|
|
|
60
64
|
title,
|
|
61
65
|
selected,
|
|
62
66
|
id,
|
|
67
|
+
className,
|
|
63
68
|
noMarginOnRight,
|
|
64
69
|
selectedVariant = (
|
|
65
70
|
isDarkModeOn()
|
|
@@ -72,6 +77,7 @@ const RadioButton: React.FC<Props> = (props) => {
|
|
|
72
77
|
: Variant.Light
|
|
73
78
|
),
|
|
74
79
|
small,
|
|
80
|
+
useComplexFormatting,
|
|
75
81
|
} = props;
|
|
76
82
|
|
|
77
83
|
/*------------------------------------------------------------------------*/
|
|
@@ -87,7 +93,7 @@ const RadioButton: React.FC<Props> = (props) => {
|
|
|
87
93
|
type="button"
|
|
88
94
|
id={id}
|
|
89
95
|
title={title}
|
|
90
|
-
className={`btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'}`}
|
|
96
|
+
className={`btn btn-${selected ? selectedVariant : unselectedVariant}${selected ? ' selected' : ''}${small ? ' btn-sm' : ''} m-0${noMarginOnRight ? '' : ' me-1'} ${className ?? ''}`}
|
|
91
97
|
aria-label={`${ariaLabel}${selected ? ': currently selected' : ''}`}
|
|
92
98
|
onClick={() => {
|
|
93
99
|
if (!selected) {
|
|
@@ -99,7 +105,24 @@ const RadioButton: React.FC<Props> = (props) => {
|
|
|
99
105
|
icon={selected ? faDotCircle : faCircle}
|
|
100
106
|
className="me-1"
|
|
101
107
|
/>
|
|
102
|
-
{
|
|
108
|
+
{
|
|
109
|
+
useComplexFormatting
|
|
110
|
+
? (
|
|
111
|
+
<pre
|
|
112
|
+
className="ps-2 text-start text-break"
|
|
113
|
+
style={{
|
|
114
|
+
whiteSpace: 'pre-wrap',
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{text}
|
|
118
|
+
</pre>
|
|
119
|
+
)
|
|
120
|
+
: (
|
|
121
|
+
<div className="flex-grow-1 text-start text-break ps-2">
|
|
122
|
+
{text}
|
|
123
|
+
</div>
|
|
124
|
+
)
|
|
125
|
+
}
|
|
103
126
|
</button>
|
|
104
127
|
);
|
|
105
128
|
};
|
|
@@ -625,16 +625,16 @@ const genRouteHandler = (
|
|
|
625
625
|
|
|
626
626
|
// Main log info
|
|
627
627
|
const mainLogInfo: LogMainInfo = {
|
|
628
|
-
id: `${launchInfo ? 'unknown'
|
|
629
|
-
userFirstName: (launchInfo ? 'unknown'
|
|
630
|
-
userLastName: (launchInfo ? 'unknown'
|
|
631
|
-
userEmail: (launchInfo ? 'unknown'
|
|
632
|
-
userId: (launchInfo ? 'unknown'
|
|
628
|
+
id: `${launchInfo ? launchInfo.userId : 'unknown'}-${Date.now()}-${Math.floor(Math.random() * 100000)}-${Math.floor(Math.random() * 100000)}`,
|
|
629
|
+
userFirstName: (launchInfo ? launchInfo.userFirstName: 'unknown'),
|
|
630
|
+
userLastName: (launchInfo ? launchInfo.userLastName : 'unknown'),
|
|
631
|
+
userEmail: (launchInfo ? launchInfo.userEmail : 'unknown'),
|
|
632
|
+
userId: (launchInfo ? launchInfo.userId : 'unknown'),
|
|
633
633
|
isLearner: (launchInfo && !!launchInfo.isLearner),
|
|
634
634
|
isAdmin: (launchInfo && !!launchInfo.isAdmin),
|
|
635
635
|
isTTM: (launchInfo && !!launchInfo.isTTM),
|
|
636
|
-
courseId: (launchInfo ? 'unknown'
|
|
637
|
-
courseName: (launchInfo ? 'unknown'
|
|
636
|
+
courseId: (launchInfo ? launchInfo.courseId : 'unknown' ),
|
|
637
|
+
courseName: (launchInfo ? launchInfo.contextLabel : 'unknown'),
|
|
638
638
|
browser,
|
|
639
639
|
device,
|
|
640
640
|
year,
|