@xy-planning-network/trees 0.6.2-rc-6 → 0.6.2-rc-8
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/trees.es.js +14 -23
- package/dist/trees.umd.js +6 -6
- package/package.json +1 -1
- package/src/lib-components/lists/Table.vue +2 -2
- package/types/api/base.d.ts +14 -2
- package/types/api/client.d.ts +41 -61
- package/types/composables/useBaseAPI.d.ts +6 -6
- package/types/entry.d.ts +4 -4
package/dist/trees.es.js
CHANGED
|
@@ -1259,12 +1259,12 @@ axios$1.isAxiosError = isAxiosError;
|
|
|
1259
1259
|
axios$2.exports = axios$1;
|
|
1260
1260
|
axios$2.exports.default = axios$1;
|
|
1261
1261
|
var axios = axios$2.exports;
|
|
1262
|
-
const
|
|
1263
|
-
const
|
|
1262
|
+
const HTTP_ERR = "HttpError";
|
|
1263
|
+
const HTTP_ERR_CANCEL = "HttpErrorCanceled";
|
|
1264
1264
|
class HttpError extends Error {
|
|
1265
1265
|
constructor(message, status, response, name) {
|
|
1266
1266
|
super(message || "");
|
|
1267
|
-
this.name = name ||
|
|
1267
|
+
this.name = name || HTTP_ERR;
|
|
1268
1268
|
this.status = status || 0;
|
|
1269
1269
|
this.response = response;
|
|
1270
1270
|
}
|
|
@@ -1348,7 +1348,7 @@ const httpRequest = (config, opts) => {
|
|
|
1348
1348
|
err.message,
|
|
1349
1349
|
(_a = err.response) == null ? void 0 : _a.status,
|
|
1350
1350
|
(_b = err.response) == null ? void 0 : _b.data,
|
|
1351
|
-
axios.isCancel(err) ?
|
|
1351
|
+
axios.isCancel(err) ? HTTP_ERR_CANCEL : HTTP_ERR
|
|
1352
1352
|
);
|
|
1353
1353
|
}
|
|
1354
1354
|
if (err instanceof Error) {
|
|
@@ -1363,26 +1363,11 @@ const httpRequest = (config, opts) => {
|
|
|
1363
1363
|
});
|
|
1364
1364
|
};
|
|
1365
1365
|
const BaseAPI = {
|
|
1366
|
-
get(path, opts, params) {
|
|
1367
|
-
return httpRequest({ url: path, method: "GET", params }, opts || {});
|
|
1368
|
-
},
|
|
1369
1366
|
delete(path, opts) {
|
|
1370
1367
|
return httpRequest({ url: path, method: "DELETE" }, opts || {});
|
|
1371
1368
|
},
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
codes = [codes];
|
|
1375
|
-
}
|
|
1376
|
-
if (this.isHttpError(err)) {
|
|
1377
|
-
return codes.includes(err.status);
|
|
1378
|
-
}
|
|
1379
|
-
return false;
|
|
1380
|
-
},
|
|
1381
|
-
isHttpCancel(err) {
|
|
1382
|
-
return this.isHttpError(err) && err.name === HTTP_CANCELLED_ERROR;
|
|
1383
|
-
},
|
|
1384
|
-
isHttpError(err) {
|
|
1385
|
-
return err instanceof HttpError;
|
|
1369
|
+
get(path, opts, params) {
|
|
1370
|
+
return httpRequest({ url: path, method: "GET", params }, opts || {});
|
|
1386
1371
|
},
|
|
1387
1372
|
patch(path, data2, opts) {
|
|
1388
1373
|
return httpRequest({ url: path, data: data2, method: "PATCH" }, opts || {});
|
|
@@ -1401,6 +1386,12 @@ const BaseAPI = {
|
|
|
1401
1386
|
);
|
|
1402
1387
|
}
|
|
1403
1388
|
};
|
|
1389
|
+
const isHttpError = (err) => {
|
|
1390
|
+
return err instanceof HttpError;
|
|
1391
|
+
};
|
|
1392
|
+
const isHttpCancel = (err) => {
|
|
1393
|
+
return isHttpError(err) && err.name === HTTP_ERR_CANCEL;
|
|
1394
|
+
};
|
|
1404
1395
|
function _extends() {
|
|
1405
1396
|
_extends = Object.assign || function(target) {
|
|
1406
1397
|
for (var i = 1; i < arguments.length; i++) {
|
|
@@ -7513,7 +7504,7 @@ function useBaseAPI(path, method = "GET", initOpts = {}) {
|
|
|
7513
7504
|
},
|
|
7514
7505
|
(err) => {
|
|
7515
7506
|
error.value = err;
|
|
7516
|
-
if (
|
|
7507
|
+
if (isHttpCancel(err)) {
|
|
7517
7508
|
isAborted.value = true;
|
|
7518
7509
|
}
|
|
7519
7510
|
throw err;
|
|
@@ -10386,4 +10377,4 @@ const install = function installTrees(app) {
|
|
|
10386
10377
|
app.component(componentName, component);
|
|
10387
10378
|
});
|
|
10388
10379
|
};
|
|
10389
|
-
export { _sfc_main$x as ActionsDropdown, BaseAPI, _sfc_main$s as BaseInput, _sfc_main$w as Cards, _sfc_main$6 as Checkbox, _sfc_main$v as ContentModal, _sfc_main$p as DateFilter, _sfc_main$r as DateRangePicker, _sfc_main$n as DetailList, _sfc_main$m as DownloadCell, _sfc_main$5 as FieldsetLegend, _sfc_main$l as Flash, _sfc_main$t as InputHelp, _sfc_main$u as InputLabel, _sfc_main$k as Modal, _sfc_main$4 as MultiCheckboxes, _sfc_main$o as Paginator, _sfc_main$g as Popover, PopoverContent, _sfc_main$g as PopoverPosition, _sfc_main$3 as Radio, _sfc_main$2 as RadioCards, _sfc_main$q as Select, _sfc_main$h as SidebarLayout, _sfc_main$e as Slideover, _sfc_main$i as Spinner, _sfc_main$c as StackedLayout, _sfc_main$b as StaticTable, _sfc_main$a as Steps, _sfc_main$9 as Table, _sfc_main$8 as Tabs, _sfc_main$1 as TextArea, _sfc_main$7 as Toggle, _sfc_main$d as Tooltip, _sfc_main$j as XYSpinner, _sfc_main as YesOrNoRadio, install as default, useAppFlasher, useAppFlashes, useAppSpinner, useBaseAPI, useBaseAPIDelete, useBaseAPIGet, useBaseAPIPost, useBaseAPIPut, useFlashes, useSpinnerDisplay };
|
|
10380
|
+
export { _sfc_main$x as ActionsDropdown, BaseAPI, _sfc_main$s as BaseInput, _sfc_main$w as Cards, _sfc_main$6 as Checkbox, _sfc_main$v as ContentModal, _sfc_main$p as DateFilter, _sfc_main$r as DateRangePicker, _sfc_main$n as DetailList, _sfc_main$m as DownloadCell, _sfc_main$5 as FieldsetLegend, _sfc_main$l as Flash, _sfc_main$t as InputHelp, _sfc_main$u as InputLabel, _sfc_main$k as Modal, _sfc_main$4 as MultiCheckboxes, _sfc_main$o as Paginator, _sfc_main$g as Popover, PopoverContent, _sfc_main$g as PopoverPosition, _sfc_main$3 as Radio, _sfc_main$2 as RadioCards, _sfc_main$q as Select, _sfc_main$h as SidebarLayout, _sfc_main$e as Slideover, _sfc_main$i as Spinner, _sfc_main$c as StackedLayout, _sfc_main$b as StaticTable, _sfc_main$a as Steps, _sfc_main$9 as Table, _sfc_main$8 as Tabs, _sfc_main$1 as TextArea, _sfc_main$7 as Toggle, _sfc_main$d as Tooltip, _sfc_main$j as XYSpinner, _sfc_main as YesOrNoRadio, install as default, isHttpCancel, isHttpError, useAppFlasher, useAppFlashes, useAppSpinner, useBaseAPI, useBaseAPIDelete, useBaseAPIGet, useBaseAPIPost, useBaseAPIPut, useFlashes, useSpinnerDisplay };
|