@veeqo/transfigure 0.0.1
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/README.md +54 -0
- package/dist/BusinessLogic/BusinessLogicManager.d.ts +6 -0
- package/dist/BusinessLogic/index.d.ts +4 -0
- package/dist/BusinessLogic/mocks.d.ts +10 -0
- package/dist/BusinessLogic/types.d.ts +18 -0
- package/dist/BusinessLogic/useBusinessLogic.d.ts +1 -0
- package/dist/api/createCustomView/createCustomView.d.ts +6 -0
- package/dist/api/createCustomView/index.d.ts +1 -0
- package/dist/api/deleteCustomView/deleteCustomView.d.ts +1 -0
- package/dist/api/deleteCustomView/index.d.ts +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/patchCurrentUser/index.d.ts +1 -0
- package/dist/api/patchCurrentUser/patchCurrentUser.d.ts +1 -0
- package/dist/api/patchCustomView/index.d.ts +1 -0
- package/dist/api/patchCustomView/patchCustomView.d.ts +6 -0
- package/dist/api/types.d.ts +16 -0
- package/dist/axiosWrappers/axiosWrappers.d.ts +15 -0
- package/dist/axiosWrappers/axiosWrappers.test.d.ts +1 -0
- package/dist/axiosWrappers/constants.d.ts +10 -0
- package/dist/axiosWrappers/index.d.ts +1 -0
- package/dist/axiosWrappers/types.d.ts +6 -0
- package/dist/axiosWrappers/utils/filterErrorStack/filterErrorStack.d.ts +14 -0
- package/dist/axiosWrappers/utils/filterErrorStack/filterErrorStack.test.d.ts +1 -0
- package/dist/axiosWrappers/utils/filterErrorStack/index.d.ts +1 -0
- package/dist/axiosWrappers/utils/filteringUtils/filteringUtils.d.ts +3 -0
- package/dist/axiosWrappers/utils/filteringUtils/filteringUtils.test.d.ts +1 -0
- package/dist/axiosWrappers/utils/filteringUtils/index.d.ts +1 -0
- package/dist/axiosWrappers/utils/injectIntoError/index.d.ts +1 -0
- package/dist/axiosWrappers/utils/injectIntoError/injectIntoError.d.ts +18 -0
- package/dist/axiosWrappers/utils/injectIntoError/injectIntoError.test.d.ts +1 -0
- package/dist/axiosWrappers/utils/isError/index.d.ts +1 -0
- package/dist/axiosWrappers/utils/isError/isError.d.ts +4 -0
- package/dist/components/ErrorBoundary/ErrorBoundary.d.ts +17 -0
- package/dist/components/ErrorBoundary/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterArrayTag/ActiveFilterArrayTag.d.ts +6 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterArrayTag/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterDateRangeTag/ActiveFilterDateRangeTag.d.ts +6 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterDateRangeTag/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterNumberRangeTag/ActiveFilterNumberRangeTag.d.ts +6 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterNumberRangeTag/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterTag/ActiveFilterTag.d.ts +6 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilterTag/index.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/ActiveFilters.d.ts +1 -0
- package/dist/components/Filters/ActiveFilters/index.d.ts +5 -0
- package/dist/components/Filters/AdaptiveHeightContainer/AdaptiveHeightContainer.d.ts +8 -0
- package/dist/components/Filters/AdaptiveHeightContainer/index.d.ts +1 -0
- package/dist/components/Filters/AdaptiveHeightContainer/styled.d.ts +3 -0
- package/dist/components/Filters/Fields/AsyncCheckboxFilter/AsyncCheckboxFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/AsyncCheckboxFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/AsyncInlineCheckboxFilter.d.ts +8 -0
- package/dist/components/Filters/Fields/AsyncInlineCheckboxFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/AsyncInlineRadioFilter/AsyncInlineRadioFilter.d.ts +8 -0
- package/dist/components/Filters/Fields/AsyncInlineRadioFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/AsyncRadioFilter/AsyncRadioFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/AsyncRadioFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/CheckboxFilter/CheckboxFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/CheckboxFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/DateRangeFilter/DateRangeFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/DateRangeFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/FilterArrayField/FilterArrayField.d.ts +8 -0
- package/dist/components/Filters/Fields/FilterArrayField/index.d.ts +1 -0
- package/dist/components/Filters/Fields/FilterField/FilterField.d.ts +8 -0
- package/dist/components/Filters/Fields/FilterField/index.d.ts +1 -0
- package/dist/components/Filters/Fields/FilterGroup/FilterGroup.d.ts +6 -0
- package/dist/components/Filters/Fields/FilterGroup/index.d.ts +1 -0
- package/dist/components/Filters/Fields/FilterNumberRangeFilter/FilterNumberRangeFilter.d.ts +9 -0
- package/dist/components/Filters/Fields/FilterNumberRangeFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/MultipleFieldFilter/MultipleFieldFilter.d.ts +7 -0
- package/dist/components/Filters/Fields/MultipleFieldFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/NumberRangeFilter/MuiSlider.d.ts +27 -0
- package/dist/components/Filters/Fields/NumberRangeFilter/NumberRangeFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/NumberRangeFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/RadioFilter/RadioFilter.d.ts +6 -0
- package/dist/components/Filters/Fields/RadioFilter/index.d.ts +1 -0
- package/dist/components/Filters/Fields/index.d.ts +13 -0
- package/dist/components/Filters/FiltersDropdown/FiltersDropdown.d.ts +2 -0
- package/dist/components/Filters/FiltersDropdown/index.d.ts +1 -0
- package/dist/components/Filters/FiltersList/FiltersList.d.ts +2 -0
- package/dist/components/Filters/FiltersList/index.d.ts +1 -0
- package/dist/components/Filters/index.d.ts +4 -0
- package/dist/components/SearchBar/SearchBar.d.ts +1 -0
- package/dist/components/SearchBar/index.d.ts +1 -0
- package/dist/components/Table/Table.d.ts +1 -0
- package/dist/components/ToastsManager/ToastsManager.d.ts +1 -0
- package/dist/components/ToastsManager/index.d.ts +1 -0
- package/dist/components/Views/CreateView/CreateView.d.ts +5 -0
- package/dist/components/Views/CreateView/index.d.ts +1 -0
- package/dist/components/Views/EditDropdown/EditDropdown.d.ts +7 -0
- package/dist/components/Views/EditDropdown/index.d.ts +1 -0
- package/dist/components/Views/OptionsDropdown/OptionsDropdown.d.ts +10 -0
- package/dist/components/Views/OptionsDropdown/index.d.ts +1 -0
- package/dist/components/Views/OptionsDropdown/styled.d.ts +17 -0
- package/dist/components/Views/PillNotifications/InfoPill.d.ts +1 -0
- package/dist/components/Views/PillNotifications/PillNotifications.d.ts +9 -0
- package/dist/components/Views/PillNotifications/index.d.ts +1 -0
- package/dist/components/Views/PillNotifications/styled.d.ts +33 -0
- package/dist/components/Views/SortableViews/LegacySortableViews.d.ts +3 -0
- package/dist/components/Views/SortableViews/SortableViews.d.ts +1 -0
- package/dist/components/Views/SortableViews/index.d.ts +1 -0
- package/dist/components/Views/SortableViews/styled.d.ts +8 -0
- package/dist/components/Views/UnsavedChanges/UnsavedChanges.d.ts +5 -0
- package/dist/components/Views/UnsavedChanges/index.d.ts +1 -0
- package/dist/components/Views/UnsavedChanges/styled.d.ts +33 -0
- package/dist/components/Views/ViewDropdowns/ViewDropdowns.d.ts +1 -0
- package/dist/components/Views/ViewDropdowns/index.d.ts +1 -0
- package/dist/components/Views/ViewList/ViewsList.d.ts +1 -0
- package/dist/components/Views/ViewList/index.d.ts +1 -0
- package/dist/components/Views/ViewList/styled.d.ts +2 -0
- package/dist/components/Views/ViewTab/Confirmation/Confirmation.d.ts +8 -0
- package/dist/components/Views/ViewTab/Confirmation/index.d.ts +1 -0
- package/dist/components/Views/ViewTab/ViewTab.d.ts +6 -0
- package/dist/components/Views/ViewTab/index.d.ts +1 -0
- package/dist/components/Views/constants.d.ts +10 -0
- package/dist/components/Views/index.d.ts +10 -0
- package/dist/constants/constants.d.ts +8 -0
- package/dist/constants/dateConstants.d.ts +17 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/context/ModalContext/ModalContext.d.ts +6 -0
- package/dist/context/ModalContext/hooks.d.ts +1 -0
- package/dist/context/ModalContext/index.d.ts +3 -0
- package/dist/context/ModalContext/mocks/mockUseModal.d.ts +6 -0
- package/dist/context/ModalContext/modalId.d.ts +3 -0
- package/dist/context/ModalContext/types.d.ts +7 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/fetchers/constants.d.ts +12 -0
- package/dist/fetchers/fetchers.d.ts +12 -0
- package/dist/fetchers/index.d.ts +3 -0
- package/dist/fetchers/withCSRF.d.ts +2 -0
- package/dist/hooks/index.d.ts +9 -0
- package/dist/hooks/useCustomViews/index.d.ts +1 -0
- package/dist/hooks/useCustomViews/useCustomViews.d.ts +16 -0
- package/dist/hooks/useDropdownManager/index.d.ts +1 -0
- package/dist/hooks/useDropdownManager/useDropdownManager.d.ts +35 -0
- package/dist/hooks/useDuplicateActiveView/index.d.ts +1 -0
- package/dist/hooks/useDuplicateActiveView/useDuplicateActiveView.d.ts +3 -0
- package/dist/hooks/useFilterArrayLabel/index.d.ts +1 -0
- package/dist/hooks/useFilterArrayLabel/useFilterArrayLabel.d.ts +8 -0
- package/dist/hooks/useFilterLabel/index.d.ts +1 -0
- package/dist/hooks/useFilterLabel/useFilterLabel.d.ts +8 -0
- package/dist/hooks/usePersistUnsavedChanges/index.d.ts +1 -0
- package/dist/hooks/usePersistUnsavedChanges/usePersistUnsavedChanges.d.ts +18 -0
- package/dist/hooks/useStores/index.d.ts +1 -0
- package/dist/hooks/useStores/types.d.ts +8 -0
- package/dist/hooks/useStores/useStores.d.ts +2 -0
- package/dist/hooks/useViewUrlChange/index.d.ts +1 -0
- package/dist/hooks/useViewUrlChange/useViewUrlChange.d.ts +1 -0
- package/dist/hooks/useViews/index.d.ts +1 -0
- package/dist/hooks/useViews/useViews.d.ts +15 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +143 -0
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +29 -0
- package/dist/index11.cjs +1 -0
- package/dist/index11.js +23 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +24 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +42 -0
- package/dist/index14.cjs +1 -0
- package/dist/index14.js +42 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +57 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +49 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +45 -0
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +55 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +39 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +7 -0
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +39 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +55 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +36 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +62 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +21 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +34 -0
- package/dist/index26.cjs +1 -0
- package/dist/index26.js +43 -0
- package/dist/index27.cjs +1 -0
- package/dist/index27.js +38 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +53 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +111 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +9 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +36 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +33 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +17 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +96 -0
- package/dist/index34.cjs +1 -0
- package/dist/index34.js +21 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +75 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +30 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +31 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +57 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +34 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +14 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +40 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +37 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +13 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +9 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +4 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +23 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +4 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +6 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +15 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +15 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +18 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +23 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +221 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +44 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +36 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +39 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +100 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +11 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +63 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +65 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +28 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +110 -0
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +301 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +66 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +65 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +39 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +34 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +11 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +14 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +21 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +21 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +44 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +6 -0
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +19 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +4 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +11 -0
- package/dist/index73.cjs +3 -0
- package/dist/index73.js +16 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +11 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +28 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +21 -0
- package/dist/index77.cjs +19 -0
- package/dist/index77.js +32 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +18 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +11 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +16 -0
- package/dist/index80.cjs +12 -0
- package/dist/index80.js +18 -0
- package/dist/index81.cjs +80 -0
- package/dist/index81.js +99 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +4 -0
- package/dist/index83.cjs +80 -0
- package/dist/index83.js +99 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +38 -0
- package/dist/index85.cjs +13 -0
- package/dist/index85.js +21 -0
- package/dist/index86.cjs +7 -0
- package/dist/index86.js +14 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +149 -0
- package/dist/mobx/Filters/Filters.d.ts +51 -0
- package/dist/mobx/Filters/index.d.ts +1 -0
- package/dist/mobx/MobXProvider/MobXProvider.d.ts +12 -0
- package/dist/mobx/MobXProvider/index.d.ts +1 -0
- package/dist/mobx/Notifications/Notifications.d.ts +13 -0
- package/dist/mobx/Notifications/index.d.ts +1 -0
- package/dist/mobx/NumberRangeFilter/NumberRangeFilter.d.ts +20 -0
- package/dist/mobx/NumberRangeFilter/index.d.ts +1 -0
- package/dist/mobx/RangeFilter/RangeFilter.d.ts +18 -0
- package/dist/mobx/RangeFilter/index.d.ts +1 -0
- package/dist/mobx/Views/Views.d.ts +10 -0
- package/dist/mobx/Views/index.d.ts +1 -0
- package/dist/mobx/index.d.ts +6 -0
- package/dist/setupTests.d.ts +0 -0
- package/dist/storybookHelpers/StoryWrapper.d.ts +13 -0
- package/dist/storybookHelpers/apiMocks/current_user.d.ts +272 -0
- package/dist/storybookHelpers/apiMocks/custom_views.d.ts +53 -0
- package/dist/storybookHelpers/constants.d.ts +5 -0
- package/dist/types.d.ts +93 -0
- package/dist/utils/createAllView/createAllView.d.ts +3 -0
- package/dist/utils/createAllView/createAllView.test.d.ts +1 -0
- package/dist/utils/createAllView/index.d.ts +1 -0
- package/dist/utils/getAsyncOptions/getAsyncOptions.d.ts +10 -0
- package/dist/utils/getAsyncOptions/getAsyncOptions.test.d.ts +1 -0
- package/dist/utils/getAsyncOptions/index.d.ts +1 -0
- package/dist/utils/getFetcherFunction/getFetcherFunction.d.ts +5 -0
- package/dist/utils/getFetcherFunction/getFetcherFunction.test.d.ts +1 -0
- package/dist/utils/getFetcherFunction/index.d.ts +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/isValidDateRange/index.d.ts +1 -0
- package/dist/utils/isValidDateRange/isValidDateRange.d.ts +2 -0
- package/dist/utils/isValidDateRange/isValidDateRange.test.d.ts +1 -0
- package/dist/utils/viewsAdapter/index.d.ts +1 -0
- package/dist/utils/viewsAdapter/viewsAdapter.d.ts +7 -0
- package/dist/utils/viewsAdapter/viewsAdapter.test.d.ts +1 -0
- package/package.json +126 -0
package/dist/index49.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const n = {
|
|
2
|
+
headers: {
|
|
3
|
+
Accept: "application/json",
|
|
4
|
+
"Content-Type": "application/json"
|
|
5
|
+
}
|
|
6
|
+
}, p = {
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": "application/vnd.api+json",
|
|
9
|
+
Accept: "application/vnd.api+json"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
n as onlyJSON,
|
|
14
|
+
p as vndAPI
|
|
15
|
+
};
|
package/dist/index5.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("kitsu-core"),r=require("./index6.cjs"),i=require("./index48.cjs"),o=require("./index49.cjs"),a=async({attributes:e})=>{const t=await r.axios.post("/api/v2/custom_views",{data:{attributes:e,type:"custom_view"}},i.withCSRF(o.vndAPI));return s.deserialise(t.data)};exports.createCustomView=a;
|
package/dist/index5.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { deserialise as r } from "kitsu-core";
|
|
2
|
+
import { axios as e } from "./index6.js";
|
|
3
|
+
import { withCSRF as i } from "./index48.js";
|
|
4
|
+
import { vndAPI as s } from "./index49.js";
|
|
5
|
+
const n = async ({
|
|
6
|
+
attributes: t
|
|
7
|
+
}) => {
|
|
8
|
+
const o = await e.post("/api/v2/custom_views", {
|
|
9
|
+
data: {
|
|
10
|
+
attributes: t,
|
|
11
|
+
type: "custom_view"
|
|
12
|
+
}
|
|
13
|
+
}, i(s));
|
|
14
|
+
return r(o.data);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
n as createCustomView
|
|
18
|
+
};
|
package/dist/index50.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("kitsu-core"),a=require("./index48.cjs"),n=require("./index49.cjs"),i=require("./index6.cjs"),f=async e=>(await i.axios.get(e,a.withCSRF(n.onlyJSON))).data,l=async(e,t={})=>{const{serialize:o=!0,includeMeta:c=!1}=t,r=await i.axios.get(e,a.withCSRF(n.vndAPI));if(!o)return r.data;const{data:s,meta:u}=d.deserialise(r.data);return c?{data:s,meta:u}:s};exports.fetcherV1=f;exports.fetcherV2=l;
|
package/dist/index50.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { deserialise as f } from "kitsu-core";
|
|
2
|
+
import { withCSRF as o } from "./index48.js";
|
|
3
|
+
import { onlyJSON as m, vndAPI as p } from "./index49.js";
|
|
4
|
+
import { axios as s } from "./index6.js";
|
|
5
|
+
const w = async (t) => (await s.get(t, o(m))).data, y = async (t, e = {}) => {
|
|
6
|
+
const {
|
|
7
|
+
serialize: n = !0,
|
|
8
|
+
includeMeta: i = !1
|
|
9
|
+
} = e, r = await s.get(t, o(p));
|
|
10
|
+
if (!n) return r.data;
|
|
11
|
+
const {
|
|
12
|
+
data: a,
|
|
13
|
+
meta: c
|
|
14
|
+
} = f(r.data);
|
|
15
|
+
return i ? {
|
|
16
|
+
data: a,
|
|
17
|
+
meta: c
|
|
18
|
+
} : a;
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
w as fetcherV1,
|
|
22
|
+
y as fetcherV2
|
|
23
|
+
};
|
package/dist/index51.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),C=require("./index70.cjs"),Y=require("./index69.cjs"),k=require("./index59.cjs"),G=require("./index52.cjs"),H=require("./index55.cjs"),W=require("./index57.cjs"),a=require("./index42.cjs"),N=require("./index3.cjs"),$=require("./index2.cjs"),B=require("./index7.cjs"),b=require("./index56.cjs"),j=require("./index5.cjs"),z=require("./index4.cjs"),J=e=>{const{VIEW_TYPE:r}=B.useBusinessLogic(),{duplicateView:P}=G.useDuplicateActiveView(),{getActiveViewInAPIFormat:q}=H.usePersistUnsavedChanges(),{canDeleteCustomViews:_,defaultCustomViewId:E,canUpdateCustomViews:M,mutate:x}=k.useCustomViews({type:r}),{mutate:w,viewsMap:p,viewsArray:L}=W.useViews(),[I,o]=c.useState(!1),[A,h]=c.useState(!1),[f,n]=c.useState(!1),[F,S]=c.useState(!1),{Views:{removeDraftViewById:D,draftViewsMap:R},Filters:{initFiltersFromView:u,updateUrl:d,setActiveViewId:O},Notifications:{notify:s}}=b.useStores();return{actions:{delete:{handleDeleteDraftView:()=>{if(!e.originalView)throw Error("No draft view found");D(e.id);const t=p.get(E);if(t)t&&u(t);else{const i=p.get(C.ALL_VIEW_ID);i&&u(i)}d()},handleDelete:async()=>{try{if(_){await $.deleteCustomView(Number(e.id)),await w();const t=p.get(C.ALL_VIEW_ID);t&&u(t),d(),A&&h(!1),f&&n(f),s({type:"success",text:`'${e.label}' has been deleted`})}else s({type:"info",text:"You require additional user permissions to delete a company shared view"})}catch{s({type:"error",text:"Failed to delete view"})}},handleShowDeleteConfirmation:()=>{if(R.has(e.id)){D(e.id),e.originalView?O(e.originalView.id):O(C.ALL_VIEW_ID);return}_?h(!0):s({type:"info",text:"You require additional user permissions to delete a company shared view"})},closeDeleteConfirmation:()=>h(!1)},edit:{handleShowEditDropdown:()=>{o(!1),n(!0)},closeEditDropdown:()=>n(!1)},menu:{handleSave:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,l={attributes:{title:i,shared:y.key===a.SHARING_OPTIONS.COMPANY.key}};await z.patchCustomView(e.id,l),V&&(await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),await x()),await w(),d(),s({type:"success",text:`'${i}' view updated`}),n(!1)}catch{s({type:"error",text:"Failed to save view"})}},handleDuplicate:()=>{P(),o(!1)},handleMakeDefault:async()=>{try{await N.patchCurrentUser({user_setting_attributes:{default_custom_view:{id:Number(e.id),type:r}}}),s({type:"success",text:`'${e.label}' is now your default view`}),o(!1)}catch{s({type:"error",text:"Failed to set default view"})}},openDropdown:()=>o(!0),closeDropdown:()=>o(!1),toggleDropdown:()=>o(!I)},create:{handleCreate:async t=>{try{const{viewName:i,shareOption:m,isDefault:V}=t,y=m==="company"?a.SHARING_OPTIONS.COMPANY:a.SHARING_OPTIONS.PERSONAL,{arg:l}=q(),{data:v}=await j.createCustomView({attributes:{...l,title:i,shared:y.key===a.SHARING_OPTIONS.COMPANY.key}}),g=L.map(U=>U.id);g.push(v.id),await N.patchCurrentUser({user_setting_attributes:{custom_view_positions:{order:g},...V?{default_custom_view:{id:Number(v.id),type:r}}:{}}}),await w(),D(e.id);const T=Y.viewsAdapter({view:v,canUpdateCustomViews:M});u(T),d(),S(!1),s({type:"success",text:`New view '${l.title}' created`})}catch(i){console.log(i),s({type:"error",text:"Failed to save draft view"})}},closeCreateDropdown:()=>S(!1),handleSaveDraft:async()=>{S(!0)}}},state:{shouldShowDropdown:I,shouldShowEditDropdown:f,shouldShowCreateDropdown:F,shouldShowDeleteConfirmation:A}}};exports.useDropdownManager=J;
|
package/dist/index51.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { useState as c } from "react";
|
|
2
|
+
import { ALL_VIEW_ID as C } from "./index70.js";
|
|
3
|
+
import { viewsAdapter as R } from "./index69.js";
|
|
4
|
+
import { useCustomViews as q } from "./index59.js";
|
|
5
|
+
import { useDuplicateActiveView as B } from "./index52.js";
|
|
6
|
+
import { usePersistUnsavedChanges as T } from "./index55.js";
|
|
7
|
+
import { useViews as W } from "./index57.js";
|
|
8
|
+
import { SHARING_OPTIONS as s } from "./index42.js";
|
|
9
|
+
import { patchCurrentUser as _ } from "./index3.js";
|
|
10
|
+
import { deleteCustomView as G } from "./index2.js";
|
|
11
|
+
import { useBusinessLogic as H } from "./index7.js";
|
|
12
|
+
import { useStores as b } from "./index56.js";
|
|
13
|
+
import { createCustomView as j } from "./index5.js";
|
|
14
|
+
import { patchCustomView as z } from "./index4.js";
|
|
15
|
+
const ye = (e) => {
|
|
16
|
+
const {
|
|
17
|
+
VIEW_TYPE: r
|
|
18
|
+
} = H(), {
|
|
19
|
+
duplicateView: E
|
|
20
|
+
} = B(), {
|
|
21
|
+
getActiveViewInAPIFormat: I
|
|
22
|
+
} = T(), {
|
|
23
|
+
canDeleteCustomViews: g,
|
|
24
|
+
defaultCustomViewId: P,
|
|
25
|
+
canUpdateCustomViews: M,
|
|
26
|
+
mutate: F
|
|
27
|
+
} = q({
|
|
28
|
+
type: r
|
|
29
|
+
}), {
|
|
30
|
+
mutate: u,
|
|
31
|
+
viewsMap: f,
|
|
32
|
+
viewsArray: Y
|
|
33
|
+
} = W(), [N, a] = c(!1), [A, p] = c(!1), [m, n] = c(!1), [k, h] = c(!1), {
|
|
34
|
+
Views: {
|
|
35
|
+
removeDraftViewById: D,
|
|
36
|
+
draftViewsMap: L
|
|
37
|
+
},
|
|
38
|
+
Filters: {
|
|
39
|
+
initFiltersFromView: d,
|
|
40
|
+
updateUrl: l,
|
|
41
|
+
setActiveViewId: O
|
|
42
|
+
},
|
|
43
|
+
Notifications: {
|
|
44
|
+
notify: o
|
|
45
|
+
}
|
|
46
|
+
} = b();
|
|
47
|
+
return {
|
|
48
|
+
actions: {
|
|
49
|
+
delete: {
|
|
50
|
+
handleDeleteDraftView: () => {
|
|
51
|
+
if (!e.originalView) throw Error("No draft view found");
|
|
52
|
+
D(e.id);
|
|
53
|
+
const t = f.get(P);
|
|
54
|
+
if (t)
|
|
55
|
+
t && d(t);
|
|
56
|
+
else {
|
|
57
|
+
const i = f.get(C);
|
|
58
|
+
i && d(i);
|
|
59
|
+
}
|
|
60
|
+
l();
|
|
61
|
+
},
|
|
62
|
+
handleDelete: async () => {
|
|
63
|
+
try {
|
|
64
|
+
if (g) {
|
|
65
|
+
await G(Number(e.id)), await u();
|
|
66
|
+
const t = f.get(C);
|
|
67
|
+
t && d(t), l(), A && p(!1), m && n(m), o({
|
|
68
|
+
type: "success",
|
|
69
|
+
text: `'${e.label}' has been deleted`
|
|
70
|
+
});
|
|
71
|
+
} else
|
|
72
|
+
o({
|
|
73
|
+
type: "info",
|
|
74
|
+
text: "You require additional user permissions to delete a company shared view"
|
|
75
|
+
});
|
|
76
|
+
} catch {
|
|
77
|
+
o({
|
|
78
|
+
type: "error",
|
|
79
|
+
text: "Failed to delete view"
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
handleShowDeleteConfirmation: () => {
|
|
84
|
+
if (L.has(e.id)) {
|
|
85
|
+
D(e.id), e.originalView ? O(e.originalView.id) : O(C);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
g ? p(!0) : o({
|
|
89
|
+
type: "info",
|
|
90
|
+
text: "You require additional user permissions to delete a company shared view"
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
closeDeleteConfirmation: () => p(!1)
|
|
94
|
+
},
|
|
95
|
+
edit: {
|
|
96
|
+
handleShowEditDropdown: () => {
|
|
97
|
+
a(!1), n(!0);
|
|
98
|
+
},
|
|
99
|
+
closeEditDropdown: () => n(!1)
|
|
100
|
+
},
|
|
101
|
+
menu: {
|
|
102
|
+
handleSave: async (t) => {
|
|
103
|
+
try {
|
|
104
|
+
const {
|
|
105
|
+
viewName: i,
|
|
106
|
+
shareOption: y,
|
|
107
|
+
isDefault: v
|
|
108
|
+
} = t, V = y === "company" ? s.COMPANY : s.PERSONAL, w = {
|
|
109
|
+
attributes: {
|
|
110
|
+
title: i,
|
|
111
|
+
shared: V.key === s.COMPANY.key
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
await z(e.id, w), v && (await _({
|
|
115
|
+
user_setting_attributes: {
|
|
116
|
+
default_custom_view: {
|
|
117
|
+
id: Number(e.id),
|
|
118
|
+
type: r
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}), await F()), await u(), l(), o({
|
|
122
|
+
type: "success",
|
|
123
|
+
text: `'${i}' view updated`
|
|
124
|
+
}), n(!1);
|
|
125
|
+
} catch {
|
|
126
|
+
o({
|
|
127
|
+
type: "error",
|
|
128
|
+
text: "Failed to save view"
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
handleDuplicate: () => {
|
|
133
|
+
E(), a(!1);
|
|
134
|
+
},
|
|
135
|
+
handleMakeDefault: async () => {
|
|
136
|
+
try {
|
|
137
|
+
await _({
|
|
138
|
+
user_setting_attributes: {
|
|
139
|
+
default_custom_view: {
|
|
140
|
+
id: Number(e.id),
|
|
141
|
+
type: r
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}), o({
|
|
145
|
+
type: "success",
|
|
146
|
+
text: `'${e.label}' is now your default view`
|
|
147
|
+
}), a(!1);
|
|
148
|
+
} catch {
|
|
149
|
+
o({
|
|
150
|
+
type: "error",
|
|
151
|
+
text: "Failed to set default view"
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
openDropdown: () => a(!0),
|
|
156
|
+
closeDropdown: () => a(!1),
|
|
157
|
+
toggleDropdown: () => a(!N)
|
|
158
|
+
},
|
|
159
|
+
create: {
|
|
160
|
+
handleCreate: async (t) => {
|
|
161
|
+
try {
|
|
162
|
+
const {
|
|
163
|
+
viewName: i,
|
|
164
|
+
shareOption: y,
|
|
165
|
+
isDefault: v
|
|
166
|
+
} = t, V = y === "company" ? s.COMPANY : s.PERSONAL, {
|
|
167
|
+
arg: w
|
|
168
|
+
} = I(), {
|
|
169
|
+
data: S
|
|
170
|
+
} = await j({
|
|
171
|
+
attributes: {
|
|
172
|
+
...w,
|
|
173
|
+
title: i,
|
|
174
|
+
shared: V.key === s.COMPANY.key
|
|
175
|
+
}
|
|
176
|
+
}), x = Y.map(($) => $.id);
|
|
177
|
+
x.push(S.id), await _({
|
|
178
|
+
user_setting_attributes: {
|
|
179
|
+
custom_view_positions: {
|
|
180
|
+
order: x
|
|
181
|
+
},
|
|
182
|
+
...v ? {
|
|
183
|
+
default_custom_view: {
|
|
184
|
+
id: Number(S.id),
|
|
185
|
+
type: r
|
|
186
|
+
}
|
|
187
|
+
} : {}
|
|
188
|
+
}
|
|
189
|
+
}), await u(), D(e.id);
|
|
190
|
+
const U = R({
|
|
191
|
+
view: S,
|
|
192
|
+
canUpdateCustomViews: M
|
|
193
|
+
});
|
|
194
|
+
d(U), l(), h(!1), o({
|
|
195
|
+
type: "success",
|
|
196
|
+
text: `New view '${w.title}' created`
|
|
197
|
+
});
|
|
198
|
+
} catch (i) {
|
|
199
|
+
console.log(i), o({
|
|
200
|
+
type: "error",
|
|
201
|
+
text: "Failed to save draft view"
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
closeCreateDropdown: () => h(!1),
|
|
206
|
+
handleSaveDraft: async () => {
|
|
207
|
+
h(!0);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
state: {
|
|
212
|
+
shouldShowDropdown: N,
|
|
213
|
+
shouldShowEditDropdown: m,
|
|
214
|
+
shouldShowCreateDropdown: k,
|
|
215
|
+
shouldShowDeleteConfirmation: A
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
export {
|
|
220
|
+
ye as useDropdownManager
|
|
221
|
+
};
|
package/dist/index52.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index57.cjs"),u=require("./index56.cjs"),c=()=>{const{viewsMap:r}=a.useViews(),{Filters:{activeViewId:i,initFiltersFromView:s,updateUrl:w},Views:{addDraftView:o,draftViewsMap:n}}=u.useStores();return{duplicateView:()=>{if(!i)throw Error("Creating views from all is not supported...implement me");if(r.has(i)){const e=r.get(i);if(!e)throw Error("Could not find view in viewsMap");const t=o({...e});s(t)}else{const e=n.get(i);if(!e)throw Error("Could not find view in draftViewsMap");const t=o({...e});s(t)}w()}}};exports.useDuplicateActiveView=c;
|
package/dist/index52.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useViews as a } from "./index57.js";
|
|
2
|
+
import { useStores as f } from "./index56.js";
|
|
3
|
+
const d = () => {
|
|
4
|
+
const {
|
|
5
|
+
viewsMap: r
|
|
6
|
+
} = a(), {
|
|
7
|
+
Filters: {
|
|
8
|
+
activeViewId: i,
|
|
9
|
+
initFiltersFromView: o,
|
|
10
|
+
updateUrl: s
|
|
11
|
+
},
|
|
12
|
+
Views: {
|
|
13
|
+
addDraftView: w,
|
|
14
|
+
draftViewsMap: n
|
|
15
|
+
}
|
|
16
|
+
} = f();
|
|
17
|
+
return {
|
|
18
|
+
duplicateView: () => {
|
|
19
|
+
if (!i)
|
|
20
|
+
throw Error("Creating views from all is not supported...implement me");
|
|
21
|
+
if (r.has(i)) {
|
|
22
|
+
const e = r.get(i);
|
|
23
|
+
if (!e)
|
|
24
|
+
throw Error("Could not find view in viewsMap");
|
|
25
|
+
const t = w({
|
|
26
|
+
...e
|
|
27
|
+
});
|
|
28
|
+
o(t);
|
|
29
|
+
} else {
|
|
30
|
+
const e = n.get(i);
|
|
31
|
+
if (!e)
|
|
32
|
+
throw Error("Could not find view in draftViewsMap");
|
|
33
|
+
const t = w({
|
|
34
|
+
...e
|
|
35
|
+
});
|
|
36
|
+
o(t);
|
|
37
|
+
}
|
|
38
|
+
s();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
d as useDuplicateActiveView
|
|
44
|
+
};
|
package/dist/index53.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react"),u=require("./index66.cjs"),l=require("./index67.cjs"),a=require("swr/immutable"),F=require("./index56.cjs"),y=e=>e&&e.__esModule?e:{default:e},d=y(a),f=({filterData:e})=>{var c;const{Filters:{arrayFilters:o}}=F.useStores(),s=o.get(e.id),{data:r}=d.default((c=e.fetchAsyncFilterOptions)==null?void 0:c.URL,()=>{var t;return l.getFetcherFunction({fetcherName:(t=e.fetchAsyncFilterOptions)==null?void 0:t.fetcher})(e.fetchAsyncFilterOptions.URL)},{revalidateOnFocus:!1});return{filterLabel:i.useMemo(()=>{const n=r?u.getAsyncOptions({data:r,config:e.fetchAsyncFilterOptions}):e.options;return(n==null?void 0:n.filter(t=>s==null?void 0:s.includes(t.value.toString())).map(t=>t.label).join(", "))||""},[r,e.options,s,e.fetchAsyncFilterOptions])}};exports.useFilterArrayLabel=f;
|
package/dist/index53.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useMemo as i } from "react";
|
|
2
|
+
import { getAsyncOptions as m } from "./index66.js";
|
|
3
|
+
import { getFetcherFunction as p } from "./index67.js";
|
|
4
|
+
import l from "swr/immutable";
|
|
5
|
+
import { useStores as f } from "./index56.js";
|
|
6
|
+
const a = ({
|
|
7
|
+
filterData: e
|
|
8
|
+
}) => {
|
|
9
|
+
var s;
|
|
10
|
+
const {
|
|
11
|
+
Filters: {
|
|
12
|
+
arrayFilters: c
|
|
13
|
+
}
|
|
14
|
+
} = f(), o = c.get(e.id), {
|
|
15
|
+
data: n
|
|
16
|
+
} = l((s = e.fetchAsyncFilterOptions) == null ? void 0 : s.URL, () => {
|
|
17
|
+
var t;
|
|
18
|
+
return p({
|
|
19
|
+
fetcherName: (t = e.fetchAsyncFilterOptions) == null ? void 0 : t.fetcher
|
|
20
|
+
})(e.fetchAsyncFilterOptions.URL);
|
|
21
|
+
}, {
|
|
22
|
+
revalidateOnFocus: !1
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
filterLabel: i(() => {
|
|
26
|
+
const r = n ? m({
|
|
27
|
+
data: n,
|
|
28
|
+
config: e.fetchAsyncFilterOptions
|
|
29
|
+
}) : e.options;
|
|
30
|
+
return (r == null ? void 0 : r.filter((t) => o == null ? void 0 : o.includes(t.value.toString())).map((t) => t.label).join(", ")) || "";
|
|
31
|
+
}, [n, e.options, o, e.fetchAsyncFilterOptions])
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
a as useFilterArrayLabel
|
|
36
|
+
};
|
package/dist/index54.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),l=require("./index66.cjs"),F=require("./index67.cjs"),f=require("swr/immutable"),h=require("./index56.cjs"),p=e=>e&&e.__esModule?e:{default:e},d=p(f),y=({filterData:e})=>{var o;const{Filters:{filters:r}}=h.useStores(),t=r.get(e.id),{data:c}=d.default((o=e.fetchAsyncFilterOptions)==null?void 0:o.URL,()=>{var n;return F.getFetcherFunction({fetcherName:(n=e.fetchAsyncFilterOptions)==null?void 0:n.fetcher})(e.fetchAsyncFilterOptions.URL)},{revalidateOnFocus:!1});return{filterLabel:u.useMemo(()=>{var n;if(!e.options&&!e.fetchAsyncFilterOptions)return t;const s=c?l.getAsyncOptions({data:c,config:e.fetchAsyncFilterOptions}):e.options;return((n=s==null?void 0:s.find(i=>i.value.toString()===(t==null?void 0:t.toString())))==null?void 0:n.label)||""},[c,e.options,t,e.fetchAsyncFilterOptions])}};exports.useFilterLabel=y;
|
package/dist/index54.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo as p } from "react";
|
|
2
|
+
import { getAsyncOptions as m } from "./index66.js";
|
|
3
|
+
import { getFetcherFunction as f } from "./index67.js";
|
|
4
|
+
import h from "swr/immutable";
|
|
5
|
+
import { useStores as u } from "./index56.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
filterData: t
|
|
8
|
+
}) => {
|
|
9
|
+
var c;
|
|
10
|
+
const {
|
|
11
|
+
Filters: {
|
|
12
|
+
filters: r
|
|
13
|
+
}
|
|
14
|
+
} = u(), e = r.get(t.id), {
|
|
15
|
+
data: s
|
|
16
|
+
} = h((c = t.fetchAsyncFilterOptions) == null ? void 0 : c.URL, () => {
|
|
17
|
+
var o;
|
|
18
|
+
return f({
|
|
19
|
+
fetcherName: (o = t.fetchAsyncFilterOptions) == null ? void 0 : o.fetcher
|
|
20
|
+
})(t.fetchAsyncFilterOptions.URL);
|
|
21
|
+
}, {
|
|
22
|
+
revalidateOnFocus: !1
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
filterLabel: p(() => {
|
|
26
|
+
var o;
|
|
27
|
+
if (!t.options && !t.fetchAsyncFilterOptions)
|
|
28
|
+
return e;
|
|
29
|
+
const n = s ? m({
|
|
30
|
+
data: s,
|
|
31
|
+
config: t.fetchAsyncFilterOptions
|
|
32
|
+
}) : t.options;
|
|
33
|
+
return ((o = n == null ? void 0 : n.find((i) => i.value.toString() === (e == null ? void 0 : e.toString()))) == null ? void 0 : o.label) || "";
|
|
34
|
+
}, [s, t.options, e, t.fetchAsyncFilterOptions])
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
b as useFilterLabel
|
|
39
|
+
};
|
package/dist/index55.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),g=require("@internationalized/date"),R=require("./index61.cjs"),T=require("./index62.cjs"),M=require("./index57.cjs"),I=require("./index7.cjs"),V=require("./index56.cjs"),C=require("./index4.cjs"),q=()=>{const{DATE_RANGE_FILTERS:a,NUMBER_RANGE_FILTERS:u,SEARCH_FILTER_ID:p,VIEW_TYPE:m}=I.useBusinessLogic(),{Filters:{activeViewId:n,filters:F,arrayFilters:d,dateRangeFilters:w,numberRangeFilters:y,initFiltersFromView:b},Views:{draftViewsMap:S}}=V.useStores(),{viewsMap:l,mutate:E}=M.useViews(),[h,o]=A.useState(!1),f=()=>{if(!n)throw Error("No active view");const r={};Array.from(F.entries()).filter(([e,t])=>t!==""&&e!==p).forEach(([e,t])=>{r[e]=t}),Array.from(d.entries()).filter(([,e])=>e.length>0).forEach(([e,t])=>{r[e]=t}),Array.from(w.entries()).filter(([,e])=>e.filterType!==void 0).forEach(([e,t])=>{t.filterType==="CUSTOM"?r[e]={gte:t.gte.toString(),lte:t.lte.toString()}:r[e]=t.filterType}),Array.from(y.entries()).filter(([,e])=>e.gte!==void 0||e.lte!==void 0).forEach(([e,t])=>{r[e]={},t.gte!==void 0&&(r[e].gte=t.gte.toString()),t.isValidLte&&t.lte&&(r[e].lte=t.lte.toString())});let i=l.get(n);return l.has(n)||(i=S.get(n)),{arg:{type:m,filters:{filter:r,page:i==null?void 0:i.page},title:i==null?void 0:i.label},currentView:i}};return{getActiveViewInAPIFormat:f,saveChanges:async()=>{if(n)try{o(!0);const{arg:r,currentView:i}=f();await C.patchCustomView(n,{attributes:r}),await E();const c={...i,filterMaps:{filters:new Map(Object.entries(r.filters.filter).filter(([e,t])=>!Array.isArray(t)&&typeof t=="string"&&!a.includes(e)).map(([e,t])=>[e,t])),arrayFilters:new Map(Object.entries(r.filters.filter).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t])),rangeFilters:new Map(Object.entries(r.filters.filter).filter(([e])=>a.includes(e)).map(([e,t])=>{const s=new T.RangeFilter;return typeof t=="object"?(s.setFilterType("CUSTOM"),s.setDates(g.parseDate(t.gte),g.parseDate(t.lte))):s.setFilterType(t),[e,s]})),numberRangeFilters:new Map(Object.entries(r.filters.filter).filter(([e])=>u.includes(e)).map(([e,t])=>{const s=new R.NumberRangeFilter({filterId:e});return t.gte&&s.setGte(Number(t.gte)),t.lte&&s.setLte(Number(t.lte)),[e,s]}))}};b(c)}catch(r){console.log(r)}finally{o(!1)}},isSubmitting:h}};exports.usePersistUnsavedChanges=q;
|
package/dist/index55.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { useState as h } from "react";
|
|
2
|
+
import { parseDate as c } from "@internationalized/date";
|
|
3
|
+
import { NumberRangeFilter as R } from "./index61.js";
|
|
4
|
+
import { RangeFilter as T } from "./index62.js";
|
|
5
|
+
import { useViews as I } from "./index57.js";
|
|
6
|
+
import { useBusinessLogic as M } from "./index7.js";
|
|
7
|
+
import { useStores as V } from "./index56.js";
|
|
8
|
+
import { patchCustomView as C } from "./index4.js";
|
|
9
|
+
const P = () => {
|
|
10
|
+
const {
|
|
11
|
+
DATE_RANGE_FILTERS: l,
|
|
12
|
+
NUMBER_RANGE_FILTERS: p,
|
|
13
|
+
SEARCH_FILTER_ID: g,
|
|
14
|
+
VIEW_TYPE: F
|
|
15
|
+
} = M(), {
|
|
16
|
+
Filters: {
|
|
17
|
+
activeViewId: o,
|
|
18
|
+
filters: u,
|
|
19
|
+
arrayFilters: w,
|
|
20
|
+
dateRangeFilters: y,
|
|
21
|
+
numberRangeFilters: b,
|
|
22
|
+
initFiltersFromView: d
|
|
23
|
+
},
|
|
24
|
+
Views: {
|
|
25
|
+
draftViewsMap: E
|
|
26
|
+
}
|
|
27
|
+
} = V(), {
|
|
28
|
+
viewsMap: f,
|
|
29
|
+
mutate: A
|
|
30
|
+
} = I(), [S, a] = h(!1), n = () => {
|
|
31
|
+
if (!o) throw Error("No active view");
|
|
32
|
+
const r = {};
|
|
33
|
+
Array.from(u.entries()).filter(([t, e]) => e !== "" && t !== g).forEach(([t, e]) => {
|
|
34
|
+
r[t] = e;
|
|
35
|
+
}), Array.from(w.entries()).filter(([, t]) => t.length > 0).forEach(([t, e]) => {
|
|
36
|
+
r[t] = e;
|
|
37
|
+
}), Array.from(y.entries()).filter(([, t]) => t.filterType !== void 0).forEach(([t, e]) => {
|
|
38
|
+
e.filterType === "CUSTOM" ? r[t] = {
|
|
39
|
+
gte: e.gte.toString(),
|
|
40
|
+
lte: e.lte.toString()
|
|
41
|
+
} : r[t] = e.filterType;
|
|
42
|
+
}), Array.from(b.entries()).filter(([, t]) => t.gte !== void 0 || t.lte !== void 0).forEach(([t, e]) => {
|
|
43
|
+
r[t] = {}, e.gte !== void 0 && (r[t].gte = e.gte.toString()), e.isValidLte && e.lte && (r[t].lte = e.lte.toString());
|
|
44
|
+
});
|
|
45
|
+
let i = f.get(o);
|
|
46
|
+
return f.has(o) || (i = E.get(o)), {
|
|
47
|
+
arg: {
|
|
48
|
+
type: F,
|
|
49
|
+
filters: {
|
|
50
|
+
filter: r,
|
|
51
|
+
page: i == null ? void 0 : i.page
|
|
52
|
+
},
|
|
53
|
+
title: i == null ? void 0 : i.label
|
|
54
|
+
},
|
|
55
|
+
currentView: i
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
getActiveViewInAPIFormat: n,
|
|
60
|
+
saveChanges: async () => {
|
|
61
|
+
if (o)
|
|
62
|
+
try {
|
|
63
|
+
a(!0);
|
|
64
|
+
const {
|
|
65
|
+
arg: r,
|
|
66
|
+
currentView: i
|
|
67
|
+
} = n();
|
|
68
|
+
await C(o, {
|
|
69
|
+
attributes: r
|
|
70
|
+
}), await A();
|
|
71
|
+
const m = {
|
|
72
|
+
...i,
|
|
73
|
+
filterMaps: {
|
|
74
|
+
filters: new Map(Object.entries(r.filters.filter).filter(([t, e]) => !Array.isArray(e) && typeof e == "string" && !l.includes(t)).map(([t, e]) => [t, e])),
|
|
75
|
+
arrayFilters: new Map(Object.entries(r.filters.filter).filter(([, t]) => Array.isArray(t)).map(([t, e]) => [t, e])),
|
|
76
|
+
rangeFilters: new Map(Object.entries(r.filters.filter).filter(([t]) => l.includes(t)).map(([t, e]) => {
|
|
77
|
+
const s = new T();
|
|
78
|
+
return typeof e == "object" ? (s.setFilterType("CUSTOM"), s.setDates(c(e.gte), c(e.lte))) : s.setFilterType(e), [t, s];
|
|
79
|
+
})),
|
|
80
|
+
numberRangeFilters: new Map(Object.entries(r.filters.filter).filter(([t]) => p.includes(t)).map(([t, e]) => {
|
|
81
|
+
const s = new R({
|
|
82
|
+
filterId: t
|
|
83
|
+
});
|
|
84
|
+
return e.gte && s.setGte(Number(e.gte)), e.lte && s.setLte(Number(e.lte)), [t, s];
|
|
85
|
+
}))
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
d(m);
|
|
89
|
+
} catch (r) {
|
|
90
|
+
console.log(r);
|
|
91
|
+
} finally {
|
|
92
|
+
a(!1);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
isSubmitting: S
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export {
|
|
99
|
+
P as usePersistUnsavedChanges
|
|
100
|
+
};
|
package/dist/index56.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),r=require("mobx-react"),o=()=>{const e=t.useContext(r.MobXProviderContext);if(!e)throw new Error("useStores must be used within a StoresProvider.");return e};exports.useStores=o;
|
package/dist/index56.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useContext as o } from "react";
|
|
2
|
+
import { MobXProviderContext as t } from "mobx-react";
|
|
3
|
+
const i = () => {
|
|
4
|
+
const r = o(t);
|
|
5
|
+
if (!r)
|
|
6
|
+
throw new Error("useStores must be used within a StoresProvider.");
|
|
7
|
+
return r;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as useStores
|
|
11
|
+
};
|
package/dist/index57.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("swr"),c=require("react"),q=require("./index70.cjs"),y=require("./index69.cjs"),S=require("./index59.cjs"),b=require("./index7.cjs"),I=require("./index50.cjs"),h=e=>e&&e.__esModule?e:{default:e},O=h(E),t=q.createAllView(),P=()=>{const{DEFAULT_PAGE_NUMBER:e,DEFAULT_PAGE_SIZE:m,VIEW_TYPE:w}=b.useBusinessLogic(),{canUpdateCustomViews:V,orderedListOfCustomViews:o,defaultCustomViewId:p,isLoading:g,isValidating:M}=S.useCustomViews({type:w}),{data:n,isLoading:A,isValidating:_,error:L,mutate:v}=O.default(`/api/v2/custom_views?filter[type]=${w}&page[number]=${e}&page[size]=${m}`,I.fetcherV2),f=c.useMemo(()=>({fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}),[]),{viewsMap:x,customViews:u,fixedViews:l}=c.useMemo(()=>n?n.reduce((s,r)=>{const i=y.viewsAdapter({view:r,canUpdateCustomViews:V});return s.viewsMap.set(r.id,i),r.editable?s.customViews.push(i):s.fixedViews.push(i),s},{fixedViews:[t],customViews:[],viewsMap:new Map([[t.id,t]])}):f,[n,f,V]),C=c.useMemo(()=>u.sort((s,r)=>{const i=Array.isArray(o)?o:[],a=i.indexOf(s.id),d=i.indexOf(r.id);return a===-1&&d===-1?0:a===-1?1:d===-1?-1:a-d}),[u,o]);return{defaultCustomViewId:p,viewsArray:[...l,...u],fixedViews:l,customViews:u,sortedCustomViews:C,viewsMap:x,isLoading:A||_||g||M,error:L,mutate:v}};exports.useViews=P;
|
package/dist/index57.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import _ from "swr";
|
|
2
|
+
import { useMemo as d } from "react";
|
|
3
|
+
import { createAllView as y } from "./index70.js";
|
|
4
|
+
import { viewsAdapter as I } from "./index69.js";
|
|
5
|
+
import { useCustomViews as U } from "./index59.js";
|
|
6
|
+
import { useBusinessLogic as b } from "./index7.js";
|
|
7
|
+
import { fetcherV2 as h } from "./index50.js";
|
|
8
|
+
const s = y(), F = () => {
|
|
9
|
+
const {
|
|
10
|
+
DEFAULT_PAGE_NUMBER: p,
|
|
11
|
+
DEFAULT_PAGE_SIZE: c,
|
|
12
|
+
VIEW_TYPE: m
|
|
13
|
+
} = b(), {
|
|
14
|
+
canUpdateCustomViews: w,
|
|
15
|
+
orderedListOfCustomViews: o,
|
|
16
|
+
defaultCustomViewId: l,
|
|
17
|
+
isLoading: g,
|
|
18
|
+
isValidating: x
|
|
19
|
+
} = U({
|
|
20
|
+
type: m
|
|
21
|
+
}), {
|
|
22
|
+
data: n,
|
|
23
|
+
isLoading: A,
|
|
24
|
+
isValidating: L,
|
|
25
|
+
error: E,
|
|
26
|
+
mutate: M
|
|
27
|
+
} = _(`/api/v2/custom_views?filter[type]=${m}&page[number]=${p}&page[size]=${c}`, h), V = d(() => ({
|
|
28
|
+
fixedViews: [s],
|
|
29
|
+
customViews: [],
|
|
30
|
+
viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
|
|
31
|
+
}), []), {
|
|
32
|
+
viewsMap: C,
|
|
33
|
+
customViews: r,
|
|
34
|
+
fixedViews: f
|
|
35
|
+
} = d(() => n ? n.reduce((e, t) => {
|
|
36
|
+
const i = I({
|
|
37
|
+
view: t,
|
|
38
|
+
canUpdateCustomViews: w
|
|
39
|
+
});
|
|
40
|
+
return e.viewsMap.set(t.id, i), t.editable ? e.customViews.push(i) : e.fixedViews.push(i), e;
|
|
41
|
+
}, {
|
|
42
|
+
fixedViews: [s],
|
|
43
|
+
customViews: [],
|
|
44
|
+
viewsMap: /* @__PURE__ */ new Map([[s.id, s]])
|
|
45
|
+
}) : V, [n, V, w]), v = d(() => r.sort((e, t) => {
|
|
46
|
+
const i = Array.isArray(o) ? o : [], a = i.indexOf(e.id), u = i.indexOf(t.id);
|
|
47
|
+
return a === -1 && u === -1 ? 0 : a === -1 ? 1 : u === -1 ? -1 : a - u;
|
|
48
|
+
}), [r, o]);
|
|
49
|
+
return {
|
|
50
|
+
defaultCustomViewId: l,
|
|
51
|
+
viewsArray: [...f, ...r],
|
|
52
|
+
fixedViews: f,
|
|
53
|
+
customViews: r,
|
|
54
|
+
sortedCustomViews: v,
|
|
55
|
+
viewsMap: C,
|
|
56
|
+
isLoading: A || L || g || x,
|
|
57
|
+
error: E,
|
|
58
|
+
mutate: M
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
F as useViews
|
|
63
|
+
};
|
package/dist/index58.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const V=require("react"),E=require("./index70.cjs"),I=require("./index59.cjs"),C=require("./index57.cjs"),S=require("./index7.cjs"),F=require("./index56.cjs"),q=()=>{const{VIEW_TYPE:m,SEARCH_FILTER_ID:c}=S.useBusinessLogic(),{Filters:{activeViewId:d,initFiltersFromView:e,initFromUrl:t,discardChanges:u,updateUrl:L,setFilter:f}}=F.useStores(),{isLoading:v,isValidating:p}=I.useCustomViews({type:m}),{viewsMap:s,defaultCustomViewId:w,isLoading:h}=C.useViews(),g=p||h||v;V.useEffect(()=>{if(g)return;const i=new URLSearchParams(window.location.search),l=i.get("view"),a=i.get(c),n=i.size>0;if(!d){if(l){const o=s.get(l);if(o)e(o),n&&t();else{const r=s.get(w);r&&(e(r),n&&t(!1))}}else{const o=s.get(w);if(o)e(o),u(!0),n&&t();else{const r=s.get(E.ALL_VIEW_ID);r&&e(r)}}a&&f(c,a)}},[c,d,w,u,e,t,g,f,L,s]),V.useEffect(()=>{const i=()=>{const a=new URLSearchParams(window.location.search).get("view");if(!a)return;const n=s.get(a);n&&(e(n),t())};return window.addEventListener("popstate",i),()=>window.removeEventListener("popstate",i)},[u,e,t,s])};exports.useViewUrlChange=q;
|