@karta.io/utils 1.0.0-beta.19 → 1.0.0-beta.2
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/index.cjs +51 -129
- package/dist/index.d.ts +12 -16
- package/dist/index.mjs +51 -129
- package/package.json +34 -33
- package/dist/index.d.cts +0 -354
- package/dist/index.d.mts +0 -354
package/dist/index.cjs
CHANGED
|
@@ -42,16 +42,14 @@ function AppComponentsResolver(options = {}) {
|
|
|
42
42
|
return (name) => {
|
|
43
43
|
const componentName = prefix && name.startsWith(prefix) ? name.substring(prefix.length) : name;
|
|
44
44
|
const isAppComponent = componentName.startsWith("App");
|
|
45
|
-
if (isAppComponent)
|
|
45
|
+
if (isAppComponent)
|
|
46
46
|
return { name: componentName, from: "@karta.io/app-components" };
|
|
47
|
-
}
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
function camelizeKeys(object) {
|
|
52
|
-
if (Array.isArray(object))
|
|
51
|
+
if (Array.isArray(object))
|
|
53
52
|
return object.map((v) => camelizeKeys(v));
|
|
54
|
-
}
|
|
55
53
|
if (object !== null && object.constructor === Object) {
|
|
56
54
|
return Object.keys(object).reduce(
|
|
57
55
|
(result, key) => ({
|
|
@@ -95,7 +93,7 @@ function formatMoney(value, currency = commonData.CURRENCY_DEFAULT, options = {}
|
|
|
95
93
|
...otherOptions
|
|
96
94
|
});
|
|
97
95
|
return formatter.format(convertedValue);
|
|
98
|
-
} catch (
|
|
96
|
+
} catch (error) {
|
|
99
97
|
return defaultValue;
|
|
100
98
|
}
|
|
101
99
|
}
|
|
@@ -125,7 +123,7 @@ function genUUID() {
|
|
|
125
123
|
r = (d2 + r) % 16 | 0;
|
|
126
124
|
d2 = Math.floor(d2 / 16);
|
|
127
125
|
}
|
|
128
|
-
return (c
|
|
126
|
+
return (c == "x" ? r : r & 7 | 8).toString(16);
|
|
129
127
|
});
|
|
130
128
|
}
|
|
131
129
|
|
|
@@ -205,9 +203,7 @@ function getPaginationParams({
|
|
|
205
203
|
offset: validatedPage * validatedLimit - validatedLimit
|
|
206
204
|
};
|
|
207
205
|
}
|
|
208
|
-
function getPaginationLimit({
|
|
209
|
-
limit
|
|
210
|
-
}) {
|
|
206
|
+
function getPaginationLimit({ limit }) {
|
|
211
207
|
return validateNumber(limit, LIMIT_DEFAULT);
|
|
212
208
|
}
|
|
213
209
|
function getPaginationOffset({
|
|
@@ -229,17 +225,15 @@ function parsePhone(phone) {
|
|
|
229
225
|
if (!phone || typeof phone !== "string")
|
|
230
226
|
return "";
|
|
231
227
|
const replacedPhone = phone.replace(/[a-zA-Z]/g, "");
|
|
232
|
-
if (replacedPhone.length === 1 && replacedPhone !== "+")
|
|
228
|
+
if (replacedPhone.length === 1 && replacedPhone !== "+")
|
|
233
229
|
return `+${replacedPhone}`;
|
|
234
|
-
}
|
|
235
230
|
const phoneNumber = libphonenumberJs.parsePhoneNumberFromString(replacedPhone);
|
|
236
231
|
return phoneNumber ? phoneNumber.formatInternational() : replacedPhone;
|
|
237
232
|
}
|
|
238
233
|
|
|
239
234
|
function snakelizeKeys(prop) {
|
|
240
|
-
if (Array.isArray(prop))
|
|
235
|
+
if (Array.isArray(prop))
|
|
241
236
|
return prop.map((item) => snakelizeKeys(item));
|
|
242
|
-
}
|
|
243
237
|
if (prop !== null && prop !== void 0 && prop.constructor === Object) {
|
|
244
238
|
return Object.keys(prop).reduce(
|
|
245
239
|
(accum, current) => ({
|
|
@@ -279,9 +273,8 @@ function unformatNumber(value) {
|
|
|
279
273
|
if (commasCount === 1 && !hasSpace && !hasDot) {
|
|
280
274
|
locale = string.length - 1 - commaIndex === 3 ? LOCALE_EN : LOCALE_RU;
|
|
281
275
|
}
|
|
282
|
-
if (locale === LOCALE_RU)
|
|
276
|
+
if (locale === LOCALE_RU)
|
|
283
277
|
return Number(string.replaceAll(" ", "").replace(",", "."));
|
|
284
|
-
}
|
|
285
278
|
if (locale === LOCALE_EN)
|
|
286
279
|
return Number(string.replaceAll(",", ""));
|
|
287
280
|
return value;
|
|
@@ -292,9 +285,8 @@ function UiComponentsResolver(options = {}) {
|
|
|
292
285
|
return (name) => {
|
|
293
286
|
const componentName = prefix && name.startsWith(prefix) ? name.substring(prefix.length) : name;
|
|
294
287
|
const isUiComponent = componentName.startsWith("Ui");
|
|
295
|
-
if (isUiComponent)
|
|
288
|
+
if (isUiComponent)
|
|
296
289
|
return { name: componentName, from: "@karta.io/ui-components" };
|
|
297
|
-
}
|
|
298
290
|
};
|
|
299
291
|
}
|
|
300
292
|
|
|
@@ -342,9 +334,7 @@ function useAsyncItems({
|
|
|
342
334
|
queryKey: getQueryKey(),
|
|
343
335
|
queryFn: () => call(core.toValue(params), config)
|
|
344
336
|
});
|
|
345
|
-
const items = vue.computed(
|
|
346
|
-
() => data.value?.results || []
|
|
347
|
-
);
|
|
337
|
+
const items = vue.computed(() => data.value?.results || []);
|
|
348
338
|
const count = vue.ref(0);
|
|
349
339
|
vue.watch(
|
|
350
340
|
data,
|
|
@@ -421,12 +411,7 @@ function useAsyncMultiselect({
|
|
|
421
411
|
color: "#b54708",
|
|
422
412
|
debug: true
|
|
423
413
|
});
|
|
424
|
-
const paramsForLogger = {
|
|
425
|
-
queryKey,
|
|
426
|
-
dataItemsKey,
|
|
427
|
-
dataItemIdKey,
|
|
428
|
-
dataCountKey
|
|
429
|
-
};
|
|
414
|
+
const paramsForLogger = { queryKey, dataItemsKey, dataItemIdKey, dataCountKey };
|
|
430
415
|
const reactiveData = vue.reactive({
|
|
431
416
|
search: "",
|
|
432
417
|
page: 1,
|
|
@@ -472,9 +457,8 @@ function useAsyncMultiselect({
|
|
|
472
457
|
);
|
|
473
458
|
return;
|
|
474
459
|
}
|
|
475
|
-
if (!get__default(newValue, dataItemsKey) || get__default(newValue, dataCountKey) === void 0)
|
|
460
|
+
if (!get__default(newValue, dataItemsKey) || get__default(newValue, dataCountKey) === void 0)
|
|
476
461
|
return;
|
|
477
|
-
}
|
|
478
462
|
count.value = get__default(newValue, dataCountKey, 0);
|
|
479
463
|
const newItems = get__default(newValue, dataItemsKey);
|
|
480
464
|
itemsByPages.value = {
|
|
@@ -505,9 +489,8 @@ function useAsyncMultiselect({
|
|
|
505
489
|
const items = vue.computed(() => {
|
|
506
490
|
if (!itemsByPages.value)
|
|
507
491
|
return selectedItemsCached.value;
|
|
508
|
-
if (!Object.keys(itemsByPages.value).length)
|
|
492
|
+
if (!Object.keys(itemsByPages.value).length)
|
|
509
493
|
return selectedItemsCached.value;
|
|
510
|
-
}
|
|
511
494
|
const itemsByPagesAsArray = Object.values(itemsByPages.value).reduce(
|
|
512
495
|
(acc, item) => [...acc, ...item],
|
|
513
496
|
[]
|
|
@@ -523,7 +506,7 @@ function useAsyncMultiselect({
|
|
|
523
506
|
if (!items.value.length)
|
|
524
507
|
return [];
|
|
525
508
|
if (!mapOptionCallback)
|
|
526
|
-
return items.value;
|
|
509
|
+
return this.items.value;
|
|
527
510
|
return items.value.map(mapOptionCallback);
|
|
528
511
|
});
|
|
529
512
|
const hasNextPage = vue.computed(() => count.value > items.value.length);
|
|
@@ -542,28 +525,6 @@ function useAsyncMultiselect({
|
|
|
542
525
|
search.value = value;
|
|
543
526
|
updateSearchWithDebounce(value);
|
|
544
527
|
};
|
|
545
|
-
const queryClient = vueQuery.useQueryClient();
|
|
546
|
-
const refetch = () => {
|
|
547
|
-
if (reactiveData.page !== 1) {
|
|
548
|
-
queryClient.invalidateQueries({
|
|
549
|
-
queryKey: [queryKey],
|
|
550
|
-
refetchType: "none"
|
|
551
|
-
});
|
|
552
|
-
loadPage(1);
|
|
553
|
-
} else {
|
|
554
|
-
queryClient.invalidateQueries({
|
|
555
|
-
queryKey: [queryKey]
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
const reload = () => {
|
|
560
|
-
if (reactiveData.page !== 1) {
|
|
561
|
-
queryClient.removeQueries({ queryKey: [queryKey] });
|
|
562
|
-
loadPage(1);
|
|
563
|
-
} else {
|
|
564
|
-
queryClient.resetQueries({ queryKey: [queryKey] });
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
528
|
if (vue.isRef(selectedValues)) {
|
|
568
529
|
vue.watch(selectedValues, async (newSelectedValues) => {
|
|
569
530
|
if (!newSelectedValues.length) {
|
|
@@ -604,9 +565,7 @@ function useAsyncMultiselect({
|
|
|
604
565
|
isFetching,
|
|
605
566
|
isLoading,
|
|
606
567
|
loadPage,
|
|
607
|
-
updateSearch
|
|
608
|
-
refetch,
|
|
609
|
-
reload
|
|
568
|
+
updateSearch
|
|
610
569
|
};
|
|
611
570
|
}
|
|
612
571
|
|
|
@@ -638,9 +597,7 @@ function useAsyncSelect({
|
|
|
638
597
|
const loadWAC = () => call({
|
|
639
598
|
page: reactiveData.page,
|
|
640
599
|
search: reactiveData.search,
|
|
641
|
-
...reactiveData.selectedValue && {
|
|
642
|
-
includedIds: [reactiveData.selectedValue]
|
|
643
|
-
},
|
|
600
|
+
...reactiveData.selectedValue && { includedIds: [reactiveData.selectedValue] },
|
|
644
601
|
...reactiveData.params && { ...JSON.parse(reactiveData.params) }
|
|
645
602
|
});
|
|
646
603
|
const { data, isFetching, isLoading } = vueQuery.useQuery({
|
|
@@ -668,9 +625,8 @@ function useAsyncSelect({
|
|
|
668
625
|
);
|
|
669
626
|
return;
|
|
670
627
|
}
|
|
671
|
-
if (!get__default(newValue, dataItemsKey) || get__default(newValue, dataCountKey) === void 0)
|
|
628
|
+
if (!get__default(newValue, dataItemsKey) || get__default(newValue, dataCountKey) === void 0)
|
|
672
629
|
return;
|
|
673
|
-
}
|
|
674
630
|
count.value = get__default(newValue, dataCountKey, 0);
|
|
675
631
|
const newItems = get__default(newValue, dataItemsKey);
|
|
676
632
|
itemsByPages.value = {
|
|
@@ -700,7 +656,7 @@ function useAsyncSelect({
|
|
|
700
656
|
if (!items.value.length)
|
|
701
657
|
return [];
|
|
702
658
|
if (!mapOptionCallback)
|
|
703
|
-
return items.value;
|
|
659
|
+
return this.items.value;
|
|
704
660
|
return items.value.map(mapOptionCallback);
|
|
705
661
|
});
|
|
706
662
|
const hasNextPage = vue.computed(() => count.value > items.value.length);
|
|
@@ -715,28 +671,6 @@ function useAsyncSelect({
|
|
|
715
671
|
search.value = value;
|
|
716
672
|
updateSearchWithDebounce(value);
|
|
717
673
|
};
|
|
718
|
-
const queryClient = vueQuery.useQueryClient();
|
|
719
|
-
const refetch = () => {
|
|
720
|
-
if (reactiveData.page !== 1) {
|
|
721
|
-
queryClient.invalidateQueries({
|
|
722
|
-
queryKey: [queryKey],
|
|
723
|
-
refetchType: "none"
|
|
724
|
-
});
|
|
725
|
-
loadPage(1);
|
|
726
|
-
} else {
|
|
727
|
-
queryClient.invalidateQueries({
|
|
728
|
-
queryKey: [queryKey]
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
};
|
|
732
|
-
const reload = () => {
|
|
733
|
-
if (reactiveData.page !== 1) {
|
|
734
|
-
queryClient.removeQueries({ queryKey: [queryKey] });
|
|
735
|
-
loadPage(1);
|
|
736
|
-
} else {
|
|
737
|
-
queryClient.resetQueries({ queryKey: [queryKey] });
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
674
|
if (vue.isRef(selectedValue)) {
|
|
741
675
|
vue.watch(selectedValue, (newSelectedValue) => {
|
|
742
676
|
reactiveData.page = 1;
|
|
@@ -760,9 +694,7 @@ function useAsyncSelect({
|
|
|
760
694
|
isFetching,
|
|
761
695
|
isLoading,
|
|
762
696
|
loadPage,
|
|
763
|
-
updateSearch
|
|
764
|
-
refetch,
|
|
765
|
-
reload
|
|
697
|
+
updateSearch
|
|
766
698
|
};
|
|
767
699
|
}
|
|
768
700
|
|
|
@@ -842,9 +774,7 @@ function useDayjs(timezone) {
|
|
|
842
774
|
|
|
843
775
|
function parseVersion(version) {
|
|
844
776
|
if (typeof version !== "string" && typeof version !== "number") {
|
|
845
|
-
throw new TypeError(
|
|
846
|
-
"Browser version must be type of string, number or negative boolean"
|
|
847
|
-
);
|
|
777
|
+
throw new TypeError("Browser version must be type of string, number or negative boolean");
|
|
848
778
|
}
|
|
849
779
|
const [major, minor = 0, patch = 0, build = 0] = typeof version === "string" ? version.split(".").map(Number) : [version];
|
|
850
780
|
return {
|
|
@@ -924,7 +854,7 @@ function useDialog() {
|
|
|
924
854
|
let dataFromHash;
|
|
925
855
|
try {
|
|
926
856
|
dataFromHash = JSON.parse(window.atob(hash.slice(HASH_PREFIX.length)));
|
|
927
|
-
} catch (
|
|
857
|
+
} catch (error) {
|
|
928
858
|
logger.warn("*parseHash* cant parse hash");
|
|
929
859
|
}
|
|
930
860
|
if (typeof dataFromHash !== "object")
|
|
@@ -1144,7 +1074,10 @@ const QS_STRINGIFY_PARAMS = {
|
|
|
1144
1074
|
addQueryPrefix: true
|
|
1145
1075
|
};
|
|
1146
1076
|
const isOpen = vue.ref(false);
|
|
1147
|
-
function useFilters({
|
|
1077
|
+
function useFilters({
|
|
1078
|
+
config,
|
|
1079
|
+
initialFilters
|
|
1080
|
+
}) {
|
|
1148
1081
|
const router = vueRouter.useRouter();
|
|
1149
1082
|
const route = vueRouter.useRoute();
|
|
1150
1083
|
const parseRouteQuery = (query) => qs__default.parse(query ?? route.query);
|
|
@@ -1152,43 +1085,35 @@ function useFilters({ config, initialFilters }) {
|
|
|
1152
1085
|
const parsedRouteQuery = parseRouteQuery();
|
|
1153
1086
|
if (!parsedRouteQuery.filters)
|
|
1154
1087
|
return void 0;
|
|
1155
|
-
return Object.entries(config).reduce(
|
|
1156
|
-
(
|
|
1157
|
-
|
|
1088
|
+
return Object.entries(config).reduce((accum, [currentKey, currentValue]) => {
|
|
1089
|
+
if (!parsedRouteQuery.filters[currentKey])
|
|
1090
|
+
return accum;
|
|
1091
|
+
if (currentValue.type === "ARRAY" /* Array */) {
|
|
1092
|
+
const splitValues = parsedRouteQuery.filters[currentKey].split(",");
|
|
1093
|
+
const checkedValue = currentValue?.possibleValues ? splitValues.filter((k) => currentValue?.possibleValues?.includes(k)) : splitValues;
|
|
1094
|
+
if (!checkedValue?.length)
|
|
1158
1095
|
return accum;
|
|
1159
|
-
if (currentValue.type === "ARRAY" /* Array */) {
|
|
1160
|
-
const splitValues = parsedRouteQuery.filters[currentKey].split(",");
|
|
1161
|
-
const checkedValue = currentValue?.possibleValues ? splitValues.filter(
|
|
1162
|
-
(k) => currentValue?.possibleValues?.includes(k)
|
|
1163
|
-
) : splitValues;
|
|
1164
|
-
if (!checkedValue?.length)
|
|
1165
|
-
return accum;
|
|
1166
|
-
return {
|
|
1167
|
-
...accum,
|
|
1168
|
-
[currentKey]: checkedValue
|
|
1169
|
-
};
|
|
1170
|
-
}
|
|
1171
1096
|
return {
|
|
1172
1097
|
...accum,
|
|
1173
|
-
[currentKey]:
|
|
1098
|
+
[currentKey]: checkedValue
|
|
1174
1099
|
};
|
|
1175
|
-
}
|
|
1176
|
-
{
|
|
1177
|
-
|
|
1100
|
+
}
|
|
1101
|
+
return {
|
|
1102
|
+
...accum,
|
|
1103
|
+
[currentKey]: parsedRouteQuery.filters[currentKey]
|
|
1104
|
+
};
|
|
1105
|
+
}, {});
|
|
1178
1106
|
});
|
|
1179
1107
|
const filtersCount = vue.computed(
|
|
1180
1108
|
() => filtersFromQuery.value ? Object.keys(filtersFromQuery.value).length : 0
|
|
1181
1109
|
);
|
|
1182
1110
|
const setQueryFromFilters = (filters) => {
|
|
1183
1111
|
const parsedRouteQuery = parseRouteQuery();
|
|
1184
|
-
const filteredValue = Object.entries(filters).reduce(
|
|
1185
|
-
(
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
},
|
|
1190
|
-
{}
|
|
1191
|
-
);
|
|
1112
|
+
const filteredValue = Object.entries(filters).reduce((accum, [currentKey, currentValue]) => {
|
|
1113
|
+
if (!currentValue?.length)
|
|
1114
|
+
return accum;
|
|
1115
|
+
return { ...accum, [currentKey]: currentValue };
|
|
1116
|
+
}, {});
|
|
1192
1117
|
const query = qs__default.stringify(
|
|
1193
1118
|
{
|
|
1194
1119
|
...parsedRouteQuery,
|
|
@@ -1225,15 +1150,12 @@ function useFilters({ config, initialFilters }) {
|
|
|
1225
1150
|
});
|
|
1226
1151
|
};
|
|
1227
1152
|
const updateMany = (filters) => {
|
|
1228
|
-
const newFilters = Object.entries(filters).reduce(
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
},
|
|
1235
|
-
{}
|
|
1236
|
-
);
|
|
1153
|
+
const newFilters = Object.entries(filters).reduce((accum, [currentKey, currentValue]) => {
|
|
1154
|
+
return {
|
|
1155
|
+
...accum,
|
|
1156
|
+
[currentKey]: currentValue ? String(currentValue) : void 0
|
|
1157
|
+
};
|
|
1158
|
+
}, {});
|
|
1237
1159
|
setQueryFromFilters({
|
|
1238
1160
|
...filtersModel.value,
|
|
1239
1161
|
...newFilters
|
|
@@ -1409,7 +1331,7 @@ function usePanel() {
|
|
|
1409
1331
|
let dataFromHash;
|
|
1410
1332
|
try {
|
|
1411
1333
|
dataFromHash = JSON.parse(window.atob(newHash.slice(1)));
|
|
1412
|
-
} catch (
|
|
1334
|
+
} catch (error) {
|
|
1413
1335
|
logger.error("*watchHash* cant parse hash");
|
|
1414
1336
|
}
|
|
1415
1337
|
if (typeof dataFromHash !== "object")
|
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ interface ResponseError {
|
|
|
23
23
|
data: Record<string, string | string[]> | null;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
declare function camelizeKeys
|
|
26
|
+
declare function camelizeKeys(object: Dictionary): Dictionary;
|
|
27
27
|
|
|
28
28
|
interface Options$3 {
|
|
29
29
|
labelType: 'key' | 'value';
|
|
@@ -78,7 +78,7 @@ declare function getPaginationParams({ page, limit, }: {
|
|
|
78
78
|
limit: number;
|
|
79
79
|
offset: number;
|
|
80
80
|
};
|
|
81
|
-
declare function getPaginationLimit({ limit
|
|
81
|
+
declare function getPaginationLimit({ limit }: {
|
|
82
82
|
limit: string | number;
|
|
83
83
|
}): number;
|
|
84
84
|
declare function getPaginationOffset({ page, limit, }: {
|
|
@@ -93,7 +93,7 @@ declare function getPaginationPages({ count, limit, }: {
|
|
|
93
93
|
declare function parsePhone(phone: string | null | undefined): string;
|
|
94
94
|
|
|
95
95
|
type SnakelizeKeysProp = Record<string | number, any>;
|
|
96
|
-
declare function snakelizeKeys
|
|
96
|
+
declare function snakelizeKeys(prop: SnakelizeKeysProp): SnakelizeKeysProp;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
99
|
* Принимает на вход число в виде строки или числа,
|
|
@@ -134,11 +134,11 @@ declare function useAsyncItems<T extends (...args: any[]) => any>({ apiMethod, q
|
|
|
134
134
|
params: MaybeRef<Parameters<T>[0]>;
|
|
135
135
|
config?: AxiosRequestConfig;
|
|
136
136
|
}): {
|
|
137
|
-
isLoading: vue.Ref<
|
|
137
|
+
isLoading: vue.Ref<false> | vue.Ref<true>;
|
|
138
138
|
isFetching: vue.Ref<boolean>;
|
|
139
139
|
isError: vue.Ref<false> | vue.Ref<true>;
|
|
140
|
-
data: vue.Ref<any
|
|
141
|
-
error: vue.Ref<
|
|
140
|
+
data: vue.Ref<any>;
|
|
141
|
+
error: vue.Ref<unknown>;
|
|
142
142
|
items: vue.ComputedRef<Awaited<ReturnType<T>>["results"]>;
|
|
143
143
|
count: vue.Ref<number>;
|
|
144
144
|
refetch: () => void;
|
|
@@ -169,11 +169,9 @@ declare function useAsyncMultiselect<T extends (...args: any[]) => any, K extend
|
|
|
169
169
|
search: vue.Ref<string>;
|
|
170
170
|
hasNextPage: vue.ComputedRef<boolean>;
|
|
171
171
|
isFetching: vue.Ref<boolean>;
|
|
172
|
-
isLoading: vue.Ref<
|
|
172
|
+
isLoading: vue.Ref<false> | vue.Ref<true>;
|
|
173
173
|
loadPage: (newPage?: number) => void;
|
|
174
174
|
updateSearch: (value: string) => void;
|
|
175
|
-
refetch: () => void;
|
|
176
|
-
reload: () => void;
|
|
177
175
|
};
|
|
178
176
|
|
|
179
177
|
interface ReactiveData {
|
|
@@ -198,11 +196,9 @@ declare function useAsyncSelect<T extends (...args: any[]) => any, K extends (pa
|
|
|
198
196
|
search: vue.Ref<string>;
|
|
199
197
|
hasNextPage: vue.ComputedRef<boolean>;
|
|
200
198
|
isFetching: vue.Ref<boolean>;
|
|
201
|
-
isLoading: vue.Ref<
|
|
199
|
+
isLoading: vue.Ref<false> | vue.Ref<true>;
|
|
202
200
|
loadPage: (newPage?: number) => void;
|
|
203
201
|
updateSearch: (value: string) => void;
|
|
204
|
-
refetch: () => void;
|
|
205
|
-
reload: () => void;
|
|
206
202
|
};
|
|
207
203
|
|
|
208
204
|
declare function useBreakpoint(): {
|
|
@@ -250,7 +246,7 @@ type VersionsList = {
|
|
|
250
246
|
declare function useDetectBrowser(versions: VersionsList, userAgent?: any): BrowserInfo;
|
|
251
247
|
|
|
252
248
|
interface VNodeCustom$1 extends VNode {
|
|
253
|
-
close
|
|
249
|
+
close(): void;
|
|
254
250
|
}
|
|
255
251
|
declare function useDialog(): {
|
|
256
252
|
open: ({ layer, component, props, }: {
|
|
@@ -280,7 +276,7 @@ declare function useGlobalScroll(): {
|
|
|
280
276
|
unlock: () => void;
|
|
281
277
|
};
|
|
282
278
|
|
|
283
|
-
declare function useFilters<T extends Record<string, any>, K extends Record<string, any>>({ config, initialFilters }: {
|
|
279
|
+
declare function useFilters<T extends Record<string, any>, K extends Record<string, any>>({ config, initialFilters, }: {
|
|
284
280
|
config: T;
|
|
285
281
|
initialFilters: K;
|
|
286
282
|
}): {
|
|
@@ -310,7 +306,7 @@ interface Options {
|
|
|
310
306
|
declare function useLogger(scope: string, options?: Options): logdown.Logger;
|
|
311
307
|
|
|
312
308
|
interface VNodeCustom extends VNode {
|
|
313
|
-
close
|
|
309
|
+
close(): void;
|
|
314
310
|
}
|
|
315
311
|
/**
|
|
316
312
|
* @deprecated use useDialog
|
|
@@ -351,4 +347,4 @@ declare function isTypeUrl(message?: string): RuleItem;
|
|
|
351
347
|
declare function isTypeNumber(value?: number, message?: string): RuleItem;
|
|
352
348
|
declare function isStrictLength(value?: number, message?: string): RuleItem;
|
|
353
349
|
|
|
354
|
-
export { AppComponentsResolver,
|
|
350
|
+
export { AppComponentsResolver, BrowserInfo, Dictionary, ResponseError, UiComponentsResolver, VersionsList, camelizeKeys, convertEnumToOptions, formatMoney, genHash, genRandomNumber, genUUID, getCardNumber, getCountryFromPhone, getPaginationLimit, getPaginationOffset, getPaginationPages, getPaginationParams, isElementIgnored, isEmptyObject, isMax, isMin, isRequired, isStrictLength, isTypeEmail, isTypeNumber, isTypeUrl, mapDataObjectForFilters, parsePhone, snakelizeKeys, unformatNumber, useAbortController, useAsyncItems, useAsyncMultiselect, useAsyncSelect, useBreakpoint, useClassName, useDayjs, useDetectBrowser, useDialog, useFilters, useGlobalScroll, useLogger, usePanel, validateNumber, validatePhone };
|