@webitel/ui-datalist 1.1.11 → 1.1.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": "@webitel/ui-datalist",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "description": "Toolkit for building data lists in webitel ui system",
5
5
  "scripts": {
6
6
  "make-all": "npm version patch --git-tag-version false && ( npm run lint:fix || true) && (npm run build:types || true) && npm run utils:publish",
@@ -132,9 +132,11 @@ export const tableHeadersStoreBody = ({
132
132
 
133
133
  const updateSort = (
134
134
  column,
135
- options: {
136
- order?: SortSymbols;
137
- } = {},
135
+ options:
136
+ | {
137
+ order?: SortSymbols;
138
+ }
139
+ | SortSymbols = {},
138
140
  ) => {
139
141
  const getNextSortOrder = (sort) => {
140
142
  switch (sort) {
@@ -167,10 +169,15 @@ export const tableHeadersStoreBody = ({
167
169
  });
168
170
  };
169
171
 
170
- const order =
171
- options.order !== undefined
172
- ? options.order
173
- : getNextSortOrder(column.sort);
172
+ let order: SortSymbols;
173
+
174
+ if (typeof options === 'string') {
175
+ order = options;
176
+ } else if (options?.order !== undefined) {
177
+ order = options.order;
178
+ } else {
179
+ order = getNextSortOrder(column.sort);
180
+ }
174
181
 
175
182
  headers.value = changeHeadersSort({
176
183
  headers: headers.value,
@@ -100,7 +100,7 @@ export declare const filterPresetsStoreBody: (namespace?: string) => {
100
100
  updateSize: (newSize: number) => void;
101
101
  updateSort: (column: any, options?: {
102
102
  order?: EnginePresetQuery;
103
- }) => void;
103
+ } | EnginePresetQuery) => void;
104
104
  columnResize: ({ columnName, columnWidth }: {
105
105
  columnName: any;
106
106
  columnWidth: any;
@@ -213,7 +213,7 @@ export declare const createFilterPresetsStore: (namespace: string) => () => {
213
213
  updateSize: (newSize: number) => void;
214
214
  updateSort: (column: any, options?: {
215
215
  order?: EnginePresetQuery;
216
- }) => void;
216
+ } | EnginePresetQuery) => void;
217
217
  columnResize: ({ columnName, columnWidth }: {
218
218
  columnName: any;
219
219
  columnWidth: any;
@@ -15,7 +15,7 @@ export declare const tableHeadersStoreBody: ({ rawHeaders, id, }: TableHeadersSt
15
15
  updateShownHeaders: (value: any) => void;
16
16
  updateSort: (column: any, options?: {
17
17
  order?: SortSymbols;
18
- }) => void;
18
+ } | SortSymbols) => void;
19
19
  columnResize: ({ columnName, columnWidth }: {
20
20
  columnName: any;
21
21
  columnWidth: any;
@@ -36,7 +36,7 @@ export declare const createTableHeadersStore: <Entity>(namespace: string, config
36
36
  updateShownHeaders: (value: any) => void;
37
37
  updateSort: (column: any, options?: {
38
38
  order?: SortSymbols;
39
- }) => void;
39
+ } | SortSymbols) => void;
40
40
  columnResize: ({ columnName, columnWidth }: {
41
41
  columnName: any;
42
42
  columnWidth: any;
@@ -102,7 +102,7 @@ export declare const tableStoreBody: <Entity extends {
102
102
  updateSize: (newSize: number) => void;
103
103
  updateSort: (column: any, options?: {
104
104
  order?: deepEqual;
105
- }) => void;
105
+ } | deepEqual) => void;
106
106
  columnResize: ({ columnName, columnWidth }: {
107
107
  columnName: any;
108
108
  columnWidth: any;
@@ -215,7 +215,7 @@ export declare const createTableStore: <Entity extends {
215
215
  updateSize: (newSize: number) => void;
216
216
  updateSort: (column: any, options?: {
217
217
  order?: deepEqual;
218
- }) => void;
218
+ } | deepEqual) => void;
219
219
  columnResize: ({ columnName, columnWidth }: {
220
220
  columnName: any;
221
221
  columnWidth: any;