@colisweb/rescript-toolkit 4.14.10 → 4.14.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "4.14.10",
3
+ "version": "4.14.12",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -10,12 +10,21 @@ type options = array<item>
10
10
 
11
11
  module Footer = {
12
12
  @react.component
13
- let make = (~onCancel, ~onValidateClick, ~validateMessage=?) => {
13
+ let make = (
14
+ ~onCancel,
15
+ ~onValidateClick,
16
+ ~validateMessage=?,
17
+ ~cancelButtonClassName="",
18
+ ~validateButtonClassName="",
19
+ ) => {
14
20
  let dropdownContext = React.useContext(Toolkit__Ui_Dropdown.dropdownContext)
15
21
 
16
22
  <footer className="bg-white p-1 flex flex-row justify-between">
17
23
  <Toolkit__Ui_Button
18
24
  type_="button"
25
+ color=#neutralLight
26
+ className={cancelButtonClassName}
27
+ variant=#outline
19
28
  onClick={_ => {
20
29
  dropdownContext.hide()
21
30
  onCancel()
@@ -25,6 +34,7 @@ module Footer = {
25
34
  <Toolkit__Ui_Button
26
35
  color=#primary
27
36
  type_="button"
37
+ className={validateButtonClassName}
28
38
  onClick={_ => {
29
39
  onValidateClick()
30
40
  dropdownContext.hide()
@@ -78,6 +88,8 @@ let make = (
78
88
  ~placeholder: React.element,
79
89
  ~buttonClassName="",
80
90
  ~dropdownClassName="",
91
+ ~validateButtonClassName="",
92
+ ~cancelButtonClassName="",
81
93
  ~itemClassName="",
82
94
  ~searchPlaceholder: option<string>=?,
83
95
  ~allowFilter=true,
@@ -152,6 +164,8 @@ let make = (
152
164
  }}
153
165
  ?validateMessage
154
166
  onValidateClick={() => selectedOption->Option.forEach(onValidate)}
167
+ validateButtonClassName
168
+ cancelButtonClassName
155
169
  />
156
170
  </Toolkit__Ui_Dropdown>
157
171
  }
@@ -7,6 +7,8 @@ let make: (
7
7
  ~placeholder: React.element,
8
8
  ~buttonClassName: string=?,
9
9
  ~dropdownClassName: string=?,
10
+ ~validateButtonClassName: string=?,
11
+ ~cancelButtonClassName: string=?,
10
12
  ~itemClassName: string=?,
11
13
  ~searchPlaceholder: string=?,
12
14
  ~allowFilter: bool=?,
@@ -39,33 +39,36 @@ module Browser = {
39
39
 
40
40
  let use = (~options: initOptions, ~sessionData, ~contextCallback=?, ()) => {
41
41
  React.useLayoutEffect0(() => {
42
- datadogRumInit({
43
- ...options,
44
- site: "datadoghq.com",
45
- allowedTracingUrls: [%re("/https:\/\/api.*\.colisweb\.com/")],
46
- allowedTracingOrigins: [
47
- %re("/https:\/\/api.*\.colisweb\.com/"),
48
- %re("/https:\/\/bo.*\.colisweb\.com/"),
49
- ],
50
- trackInteractions: true,
51
- defaultPrivacyLevel: "allow",
52
- enableExperimentalFeatures: ["clickmap"],
53
- })
54
-
55
- startSessionReplayRecording()
42
+ if options.env !== "local" {
43
+ datadogRumInit({
44
+ ...options,
45
+ site: "datadoghq.com",
46
+ allowedTracingUrls: [%re("/https:\/\/api.*\.colisweb\.com/")],
47
+ allowedTracingOrigins: [
48
+ %re("/https:\/\/api.*\.colisweb\.com/"),
49
+ %re("/https:\/\/bo.*\.colisweb\.com/"),
50
+ ],
51
+ trackInteractions: true,
52
+ defaultPrivacyLevel: "allow",
53
+ enableExperimentalFeatures: ["clickmap"],
54
+ })
56
55
 
56
+ startSessionReplayRecording()
57
+ }
57
58
  None
58
59
  })
59
60
 
60
61
  React.useLayoutEffect1(() => {
61
- setUser(sessionData)
62
+ if options.env !== "local" {
63
+ setUser(sessionData)
62
64
 
63
- addRumGlobalContext(
64
- "screen_resolution",
65
- `${Browser.screenWidth->Int.toString}x${Browser.screenHeight->Int.toString}`,
66
- )
65
+ addRumGlobalContext(
66
+ "screen_resolution",
67
+ `${Browser.screenWidth->Int.toString}x${Browser.screenHeight->Int.toString}`,
68
+ )
67
69
 
68
- contextCallback->Option.forEach(fn => fn(addRumGlobalContext))
70
+ contextCallback->Option.forEach(fn => fn(addRumGlobalContext))
71
+ }
69
72
 
70
73
  None
71
74
  }, [sessionData->Js.Json.stringifyAny])
@@ -108,6 +108,7 @@ external make: (
108
108
  ~data: array<'data>,
109
109
  ~debug: bool=?,
110
110
  ~initialState: 'initialState=?,
111
+ ~useControlledState: 'initialState => 'initialState=?,
111
112
  ~manualPagination: bool=?,
112
113
  ~manualFilters: bool=?,
113
114
  ~manualSortBy: bool=?,