@colisweb/rescript-toolkit 3.2.3 → 3.2.5

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colisweb/rescript-toolkit",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "clean": "rescript clean",
@@ -18,6 +18,7 @@ module Alert = Toolkit__Ui_Alert
18
18
  module IconButton = Toolkit__Ui_IconButton
19
19
  module Tag = Toolkit__Ui_Tag
20
20
  module Select = Toolkit__Ui_Select
21
+ module SelectPolyvariant = Toolkit__Ui_SelectPolyvariant
21
22
  module Table = Toolkit__Ui_Table
22
23
  module Reference = Toolkit__Ui_Reference
23
24
  module RichText = Toolkit__Ui_RichText
@@ -36,7 +36,7 @@ let make = (
36
36
  ?placeholder
37
37
  value=?{value->Option.map(encodeValueToString)}
38
38
  defaultValue=?{defaultValue->Option.map(encodeValueToString)}
39
- options={options->Array.map((option): Toolkit__Ui.Select.selectOption => {
39
+ options={options->Array.map((option): Toolkit__Ui_Select.selectOption => {
40
40
  label: option.label,
41
41
  value: option.value->encodeValueToString,
42
42
  disabled: ?option.disabled,
@@ -27,7 +27,7 @@ module MakeFeature = (C: Config) => {
27
27
  type t = config<C.argument>
28
28
 
29
29
  let exec = (var: C.input) =>
30
- Axios.get(C.envUrl ++ C.featureName, ())
30
+ Axios.get(C.envUrl ++ C.featureName,~config={Axios.makeConfig()}, ())
31
31
  ->Promise.Js.toResult
32
32
  ->Promise.flatMapOk(({data}) => {
33
33
  Promise.resolved(t_decode(data))
@@ -72,30 +72,25 @@ external makeConfig: (
72
72
  ) => config = ""
73
73
 
74
74
  @module("axios")
75
- external get: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "get"
75
+ external get: (string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> = "get"
76
76
 
77
77
  @module("axios")
78
- external post: (string, ~data: 'a, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
78
+ external post: (string, ~data: 'a, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> =
79
79
  "post"
80
80
 
81
81
  @module("axios")
82
- external put: (string, ~data: 'a, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
82
+ external put: (string, ~data: 'a, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> =
83
83
  "put"
84
84
 
85
85
  @module("axios")
86
- external patch: (
87
- string,
88
- ~data: 'a,
89
- ~config: config=?,
90
- unit,
91
- ) => Promise.Js.t<response<'data>, 'err> = "patch"
86
+ external patch: (string, ~data: 'a, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> =
87
+ "patch"
92
88
 
93
89
  @module("axios")
94
- external delete: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "delete"
90
+ external delete: (string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> = "delete"
95
91
 
96
92
  @module("axios")
97
- external options: (string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
98
- "options"
93
+ external options: (string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> = "options"
99
94
 
100
95
  module Instance = {
101
96
  type t
@@ -104,14 +99,14 @@ module Instance = {
104
99
  external create: config => t = "create"
105
100
 
106
101
  @send
107
- external get: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> = "get"
102
+ external get: (t, string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> = "get"
108
103
 
109
104
  @send
110
105
  external post: (
111
106
  t,
112
107
  string,
113
108
  ~data: 'a,
114
- ~config: config=?,
109
+ ~config: config,
115
110
  unit,
116
111
  ) => Promise.Js.t<response<'data>, 'err> = "post"
117
112
 
@@ -120,7 +115,7 @@ module Instance = {
120
115
  t,
121
116
  string,
122
117
  ~data: 'a,
123
- ~config: config=?,
118
+ ~config: config,
124
119
  unit,
125
120
  ) => Promise.Js.t<response<'data>, 'err> = "put"
126
121
 
@@ -129,16 +124,16 @@ module Instance = {
129
124
  t,
130
125
  string,
131
126
  ~data: 'a,
132
- ~config: config=?,
127
+ ~config: config,
133
128
  unit,
134
129
  ) => Promise.Js.t<response<'data>, 'err> = "patch"
135
130
 
136
131
  @send
137
- external delete: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
132
+ external delete: (t, string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> =
138
133
  "delete"
139
134
 
140
135
  @send
141
- external options: (t, string, ~config: config=?, unit) => Promise.Js.t<response<'data>, 'err> =
136
+ external options: (t, string, ~config: config, unit) => Promise.Js.t<response<'data>, 'err> =
142
137
  "options"
143
138
 
144
139
  module Interceptors = {
@@ -206,82 +201,82 @@ module WithResult = {
206
201
 
207
202
  let get = (
208
203
  ~instance=?,
209
- ~config=?,
204
+ ~config,
210
205
  ~decodeData: decodeData<'newData>,
211
206
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
212
207
  string,
213
208
  ) =>
214
209
  switch instance {
215
- | None => get(string, ~config?, ())->toResult(~decodeData, ~mapError)
210
+ | None => get(string, ~config, ())->toResult(~decodeData, ~mapError)
216
211
  | Some(instance) =>
217
- instance->Instance.get(string, ~config?, ())->toResult(~decodeData, ~mapError)
212
+ instance->Instance.get(string, ~config, ())->toResult(~decodeData, ~mapError)
218
213
  }
219
214
 
220
215
  let post = (
221
216
  ~instance=?,
222
217
  ~data,
223
- ~config=?,
218
+ ~config,
224
219
  ~decodeData: decodeData<'newData>,
225
220
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
226
221
  string,
227
222
  ) =>
228
223
  switch instance {
229
- | None => post(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
224
+ | None => post(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
230
225
  | Some(instance) =>
231
- instance->Instance.post(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
226
+ instance->Instance.post(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
232
227
  }
233
228
 
234
229
  let put = (
235
230
  ~instance=?,
236
231
  ~data,
237
- ~config=?,
232
+ ~config,
238
233
  ~decodeData: decodeData<'newData>,
239
234
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
240
235
  string,
241
236
  ) =>
242
237
  switch instance {
243
- | None => put(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
238
+ | None => put(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
244
239
  | Some(instance) =>
245
- instance->Instance.put(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
240
+ instance->Instance.put(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
246
241
  }
247
242
 
248
243
  let patch = (
249
244
  ~instance=?,
250
245
  ~data,
251
- ~config=?,
246
+ ~config,
252
247
  ~decodeData: decodeData<'newData>,
253
248
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
254
249
  string,
255
250
  ) =>
256
251
  switch instance {
257
- | None => patch(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
252
+ | None => patch(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
258
253
  | Some(instance) =>
259
- instance->Instance.patch(string, ~data, ~config?, ())->toResult(~decodeData, ~mapError)
254
+ instance->Instance.patch(string, ~data, ~config, ())->toResult(~decodeData, ~mapError)
260
255
  }
261
256
 
262
257
  let delete = (
263
258
  ~instance=?,
264
- ~config=?,
259
+ ~config,
265
260
  ~decodeData: decodeData<'newData>,
266
261
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
267
262
  string,
268
263
  ) =>
269
264
  switch instance {
270
- | None => delete(string, ~config?, ())->toResult(~decodeData, ~mapError)
265
+ | None => delete(string, ~config, ())->toResult(~decodeData, ~mapError)
271
266
  | Some(instance) =>
272
- instance->Instance.delete(string, ~config?, ())->toResult(~decodeData, ~mapError)
267
+ instance->Instance.delete(string, ~config, ())->toResult(~decodeData, ~mapError)
273
268
  }
274
269
 
275
270
  let options = (
276
271
  ~instance=?,
277
- ~config=?,
272
+ ~config,
278
273
  ~decodeData: decodeData<'newData>,
279
274
  ~mapError: option<mapError<'a, 'response, 'headers, 'request>>=?,
280
275
  string,
281
276
  ) =>
282
277
  switch instance {
283
- | None => options(string, ~config?, ())->toResult(~decodeData, ~mapError)
278
+ | None => options(string, ~config, ())->toResult(~decodeData, ~mapError)
284
279
  | Some(instance) =>
285
- instance->Instance.options(string, ~config?, ())->toResult(~decodeData, ~mapError)
280
+ instance->Instance.options(string, ~config, ())->toResult(~decodeData, ~mapError)
286
281
  }
287
282
  }
@@ -20,6 +20,7 @@ module ReactSelect = {
20
20
  ~isDisabled: bool=?,
21
21
  ~isLoading: bool=?,
22
22
  ~isSearchable: bool=?,
23
+ ~isClearable: bool=?,
23
24
  ~placeholder: string=?,
24
25
  ~className: string=?,
25
26
  ~classNamePrefix: string=?,