@colisweb/rescript-toolkit 2.4.1 → 2.5.3

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": "2.4.1",
3
+ "version": "2.5.3",
4
4
  "scripts": {
5
5
  "clean": "rescript clean",
6
6
  "build": "rescript build",
@@ -285,3 +285,8 @@ module StringArray = {
285
285
  @decco
286
286
  type t<'a> = @decco.codec((encoder, decoder)) array<'a>
287
287
  }
288
+
289
+ module SortOrder = Enum({
290
+ @deriving(jsConverter)
291
+ type enum = [#asc | #desc]
292
+ })
@@ -8,6 +8,11 @@ type filterOption = {
8
8
  value: string,
9
9
  }
10
10
 
11
+ type sortOption = {
12
+ id: string,
13
+ desc: bool,
14
+ }
15
+
11
16
  type rec filterProps<'filterValue> = {column: filterColumn<'filterValue>}
12
17
  and filterColumn<'filterValue> = {
13
18
  filterValue: option<'filterValue>,
@@ -40,6 +45,7 @@ type rec instance<'data> = {
40
45
  setAllFilters: array<filterOption> => unit,
41
46
  setFilter: (string, string) => unit,
42
47
  toggleSortBy: (~column: string, ~descending: bool, ~isMulti: bool) => unit,
48
+ setSortBy: array<sortOption> => unit,
43
49
  }
44
50
  and state = {
45
51
  pageIndex: int,
@@ -106,6 +112,7 @@ external make: (
106
112
  ~manualSortBy: bool=?,
107
113
  ~pageCount: option<int>=?,
108
114
  ~disableFilters: bool=?,
115
+ ~disableMultiSort: bool=?,
109
116
  unit,
110
117
  ) => options<array<'data>> = ""
111
118
 
@@ -148,6 +155,18 @@ external useTable6: (
148
155
  plugin,
149
156
  ) => instance<'data> = "useTable"
150
157
 
158
+ @module("react-table")
159
+ external useTable7: (
160
+ options<'data>,
161
+ plugin,
162
+ plugin,
163
+ plugin,
164
+ plugin,
165
+ plugin,
166
+ plugin,
167
+ plugin,
168
+ ) => instance<'data> = "useTable"
169
+
151
170
  // Utils :
152
171
 
153
172
  let getFiltersDictFromArray = (filters: array<currentFilter>): Js.Dict.t<string> =>