@apia/dashboard-controller 3.0.1 → 3.0.6
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.d.ts +414 -23
- package/dist/index.js +2238 -22
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/dist/actions/basicAction.d.ts +0 -15
- package/dist/actions/basicAction.d.ts.map +0 -1
- package/dist/actions/basicAction.js +0 -40
- package/dist/actions/basicAction.js.map +0 -1
- package/dist/actions/externalFirePanelAction.d.ts +0 -6
- package/dist/actions/externalFirePanelAction.d.ts.map +0 -1
- package/dist/actions/externalFirePanelAction.js +0 -12
- package/dist/actions/externalFirePanelAction.js.map +0 -1
- package/dist/actions/firePanelAction.d.ts +0 -6
- package/dist/actions/firePanelAction.d.ts.map +0 -1
- package/dist/actions/firePanelAction.js +0 -75
- package/dist/actions/firePanelAction.js.map +0 -1
- package/dist/actions/usePanelActions.d.ts +0 -63
- package/dist/actions/usePanelActions.d.ts.map +0 -1
- package/dist/actions/usePanelActions.js +0 -55
- package/dist/actions/usePanelActions.js.map +0 -1
- package/dist/actions/usePanelIsLoading.d.ts +0 -4
- package/dist/actions/usePanelIsLoading.d.ts.map +0 -1
- package/dist/actions/usePanelIsLoading.js +0 -14
- package/dist/actions/usePanelIsLoading.js.map +0 -1
- package/dist/actions/usePanelNetworkState.d.ts +0 -8
- package/dist/actions/usePanelNetworkState.d.ts.map +0 -1
- package/dist/actions/usePanelNetworkState.js +0 -21
- package/dist/actions/usePanelNetworkState.js.map +0 -1
- package/dist/common/usePanelIdentity.d.ts +0 -10
- package/dist/common/usePanelIdentity.d.ts.map +0 -1
- package/dist/common/usePanelIdentity.js +0 -12
- package/dist/common/usePanelIdentity.js.map +0 -1
- package/dist/config/parametersStore.d.ts +0 -15
- package/dist/config/parametersStore.d.ts.map +0 -1
- package/dist/config/parametersStore.js +0 -25
- package/dist/config/parametersStore.js.map +0 -1
- package/dist/config/saveParameters.d.ts +0 -11
- package/dist/config/saveParameters.d.ts.map +0 -1
- package/dist/config/saveParameters.js +0 -16
- package/dist/config/saveParameters.js.map +0 -1
- package/dist/config/usePanelConfig.js +0 -22
- package/dist/config/usePanelConfig.js.map +0 -1
- package/dist/config/usePanelParametersSelector.d.ts +0 -25
- package/dist/config/usePanelParametersSelector.d.ts.map +0 -1
- package/dist/config/usePanelParametersSelector.js +0 -17
- package/dist/config/usePanelParametersSelector.js.map +0 -1
- package/dist/dashboard/DashboardContext.d.ts +0 -6
- package/dist/dashboard/DashboardContext.d.ts.map +0 -1
- package/dist/dashboard/DashboardContext.js +0 -12
- package/dist/dashboard/DashboardContext.js.map +0 -1
- package/dist/dashboard/DashboardPanel.d.ts +0 -45
- package/dist/dashboard/DashboardPanel.d.ts.map +0 -1
- package/dist/dashboard/DashboardPanel.js +0 -236
- package/dist/dashboard/DashboardPanel.js.map +0 -1
- package/dist/dashboard/DashboardPanelContext.d.ts +0 -6
- package/dist/dashboard/DashboardPanelContext.d.ts.map +0 -1
- package/dist/dashboard/DashboardPanelContext.js +0 -12
- package/dist/dashboard/DashboardPanelContext.js.map +0 -1
- package/dist/dashboard/DashboardPanelsBootstraper.d.ts +0 -33
- package/dist/dashboard/DashboardPanelsBootstraper.d.ts.map +0 -1
- package/dist/dashboard/DashboardPanelsBootstraper.js +0 -135
- package/dist/dashboard/DashboardPanelsBootstraper.js.map +0 -1
- package/dist/dashboard/DashboardRouter.d.ts +0 -30
- package/dist/dashboard/DashboardRouter.d.ts.map +0 -1
- package/dist/dashboard/DashboardRouter.js +0 -74
- package/dist/dashboard/DashboardRouter.js.map +0 -1
- package/dist/dashboard/PanelNotFound.js +0 -14
- package/dist/dashboard/PanelNotFound.js.map +0 -1
- package/dist/dashboard/dashboard.d.ts +0 -26
- package/dist/dashboard/dashboard.d.ts.map +0 -1
- package/dist/dashboard/dashboard.js +0 -167
- package/dist/dashboard/dashboard.js.map +0 -1
- package/dist/eventsController/eventsController.d.ts +0 -11
- package/dist/eventsController/eventsController.d.ts.map +0 -1
- package/dist/eventsController/eventsController.js +0 -57
- package/dist/eventsController/eventsController.js.map +0 -1
- package/dist/eventsController/types.d.ts +0 -21
- package/dist/eventsController/types.d.ts.map +0 -1
- package/dist/eventsController/usePanelFireEvent.d.ts +0 -13
- package/dist/eventsController/usePanelFireEvent.d.ts.map +0 -1
- package/dist/eventsController/usePanelFireEvent.js +0 -21
- package/dist/eventsController/usePanelFireEvent.js.map +0 -1
- package/dist/eventsController/usePanelOnEvent.d.ts +0 -12
- package/dist/eventsController/usePanelOnEvent.d.ts.map +0 -1
- package/dist/eventsController/usePanelOnEvent.js +0 -14
- package/dist/eventsController/usePanelOnEvent.js.map +0 -1
- package/dist/panelsStore/createPanelStore.d.ts +0 -16
- package/dist/panelsStore/createPanelStore.d.ts.map +0 -1
- package/dist/panelsStore/createPanelStore.js +0 -58
- package/dist/panelsStore/createPanelStore.js.map +0 -1
- package/dist/panelsStore/panelsStore.js +0 -59
- package/dist/panelsStore/panelsStore.js.map +0 -1
- package/dist/panelsStore/usePanelSelector.js +0 -32
- package/dist/panelsStore/usePanelSelector.js.map +0 -1
- package/dist/panelsUtil/usePanelChangeTitle.d.ts +0 -5
- package/dist/panelsUtil/usePanelChangeTitle.d.ts.map +0 -1
- package/dist/panelsUtil/usePanelChangeTitle.js +0 -23
- package/dist/panelsUtil/usePanelChangeTitle.js.map +0 -1
- package/dist/panelsUtil/usePanelTitleAction.js +0 -34
- package/dist/panelsUtil/usePanelTitleAction.js.map +0 -1
- package/dist/position/usePanelPosition.d.ts +0 -13
- package/dist/position/usePanelPosition.d.ts.map +0 -1
- package/dist/position/usePanelPosition.js +0 -40
- package/dist/position/usePanelPosition.js.map +0 -1
- package/dist/splash/events/Dragleave.js +0 -15
- package/dist/splash/events/Dragleave.js.map +0 -1
- package/dist/splash/events/Dragover.js +0 -120
- package/dist/splash/events/Dragover.js.map +0 -1
- package/dist/splash/events/Dragstart.js +0 -65
- package/dist/splash/events/Dragstart.js.map +0 -1
- package/dist/splash/events/Drop.js +0 -60
- package/dist/splash/events/Drop.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/NetworkState.js +0 -28
- package/dist/splash/panels/DefaultPanelWrapper/NetworkState.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/PanelButtons.js +0 -16
- package/dist/splash/panels/DefaultPanelWrapper/PanelButtons.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/RefreshButton.js +0 -35
- package/dist/splash/panels/DefaultPanelWrapper/RefreshButton.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/SettingsButton.js +0 -45
- package/dist/splash/panels/DefaultPanelWrapper/SettingsButton.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/defaultPanelWrapperStyles.js +0 -103
- package/dist/splash/panels/DefaultPanelWrapper/defaultPanelWrapperStyles.js.map +0 -1
- package/dist/splash/panels/DefaultPanelWrapper/index.js +0 -57
- package/dist/splash/panels/DefaultPanelWrapper/index.js.map +0 -1
- package/dist/splash/panels/LandingPagePanelWrapper.d.ts +0 -6
- package/dist/splash/panels/LandingPagePanelWrapper.d.ts.map +0 -1
- package/dist/splash/panels/LandingPagePanelWrapper.js +0 -52
- package/dist/splash/panels/LandingPagePanelWrapper.js.map +0 -1
- package/dist/splash/panels/PanelContext/PanelFooter.js +0 -70
- package/dist/splash/panels/PanelContext/PanelFooter.js.map +0 -1
- package/dist/splash/panels/PanelContext/index.d.ts +0 -26
- package/dist/splash/panels/PanelContext/index.d.ts.map +0 -1
- package/dist/splash/panels/PanelContext/index.js +0 -73
- package/dist/splash/panels/PanelContext/index.js.map +0 -1
- package/dist/splash/panels/PanelContext/usePanelContextLayout.d.ts +0 -6
- package/dist/splash/panels/PanelContext/usePanelContextLayout.d.ts.map +0 -1
- package/dist/splash/panels/PanelContext/usePanelContextLayout.js +0 -38
- package/dist/splash/panels/PanelContext/usePanelContextLayout.js.map +0 -1
- package/dist/splash/panels/PanelContext/usePanelFooter.js +0 -38
- package/dist/splash/panels/PanelContext/usePanelFooter.js.map +0 -1
- package/dist/splash/panels/PanelContext/useYieldPanelIsReady.d.ts +0 -45
- package/dist/splash/panels/PanelContext/useYieldPanelIsReady.d.ts.map +0 -1
- package/dist/splash/panels/PanelContext/useYieldPanelIsReady.js +0 -12
- package/dist/splash/panels/PanelContext/useYieldPanelIsReady.js.map +0 -1
- package/dist/splash/panels/PanelErrorBoundary.js +0 -53
- package/dist/splash/panels/PanelErrorBoundary.js.map +0 -1
- package/dist/splash/panels/PanelIdentifier.d.ts +0 -16
- package/dist/splash/panels/PanelIdentifier.d.ts.map +0 -1
- package/dist/splash/panels/PanelIdentifier.js +0 -19
- package/dist/splash/panels/PanelIdentifier.js.map +0 -1
- package/dist/splash/util/DragAndDrop.js +0 -243
- package/dist/splash/util/DragAndDrop.js.map +0 -1
- package/dist/splash/util/getColumnAreas.js +0 -19
- package/dist/splash/util/getColumnAreas.js.map +0 -1
- package/dist/splash/util/isCursorInArea.js +0 -13
- package/dist/splash/util/isCursorInArea.js.map +0 -1
- package/dist/types.d.ts +0 -27
- package/dist/types.d.ts.map +0 -1
- package/dist/util.d.ts +0 -8
- package/dist/util.d.ts.map +0 -1
- package/dist/util.js +0 -30
- package/dist/util.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePanelChangeTitle.js","sources":["../../src/panelsUtil/usePanelChangeTitle.ts"],"sourcesContent":["import { useCallback } from 'react';\nimport {\n TPanelIdentifier,\n eventsController,\n usePanelFireEvent,\n} from '../eventsController';\n\nexport function changePanelTitle(panelId: string, newTitle: string) {\n eventsController.fireEvent(\n { panelId } as TPanelIdentifier,\n 'changeTitle',\n newTitle,\n );\n}\n\nexport function usePanelChangeTitle() {\n const fireEvent = usePanelFireEvent();\n\n return useCallback(\n (newTitle: string) => {\n fireEvent('changeTitle', newTitle);\n },\n [fireEvent],\n );\n}\n"],"names":[],"mappings":";;;;AAOgB,SAAA,gBAAA,CAAiB,SAAiB,QAAkB,EAAA;AAClE,EAAiB,gBAAA,CAAA,SAAA;AAAA,IACf,EAAE,OAAQ,EAAA;AAAA,IACV,aAAA;AAAA,IACA,QAAA;AAAA,GACF,CAAA;AACF,CAAA;AAEO,SAAS,mBAAsB,GAAA;AACpC,EAAA,MAAM,YAAY,iBAAkB,EAAA,CAAA;AAEpC,EAAO,OAAA,WAAA;AAAA,IACL,CAAC,QAAqB,KAAA;AACpB,MAAA,SAAA,CAAU,eAAe,QAAQ,CAAA,CAAA;AAAA,KACnC;AAAA,IACA,CAAC,SAAS,CAAA;AAAA,GACZ,CAAA;AACF;;;;"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { usePanelParametersSelector } from '../config/usePanelParametersSelector.js';
|
|
2
|
-
import { parametersStore as store, parametersActions } from '../config/parametersStore.js';
|
|
3
|
-
|
|
4
|
-
const panelActionParameterName = "__panelTitleAction";
|
|
5
|
-
const panelDescriptionParameterName = "__panelTitleDescription";
|
|
6
|
-
function setPanelTitleAction(panelId, newAction) {
|
|
7
|
-
store.dispatch(
|
|
8
|
-
parametersActions.udpate({
|
|
9
|
-
panelId,
|
|
10
|
-
parameters: { [panelActionParameterName]: newAction }
|
|
11
|
-
})
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
function setPanelTitleDescritpion(panelId, newDescription) {
|
|
15
|
-
store.dispatch(
|
|
16
|
-
parametersActions.udpate({
|
|
17
|
-
panelId,
|
|
18
|
-
parameters: { [panelDescriptionParameterName]: newDescription }
|
|
19
|
-
})
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
function usePanelTitleAction() {
|
|
23
|
-
return usePanelParametersSelector(
|
|
24
|
-
(current) => current[panelActionParameterName]
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
function usePanelTitleDescription() {
|
|
28
|
-
return usePanelParametersSelector(
|
|
29
|
-
(current) => current[panelDescriptionParameterName]
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { setPanelTitleAction, setPanelTitleDescritpion, usePanelTitleAction, usePanelTitleDescription };
|
|
34
|
-
//# sourceMappingURL=usePanelTitleAction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePanelTitleAction.js","sources":["../../src/panelsUtil/usePanelTitleAction.ts"],"sourcesContent":["import { parametersStore, usePanelParametersSelector } from '../config';\nimport { parametersActions } from '../config/parametersStore';\n\nconst panelActionParameterName = '__panelTitleAction';\nconst panelDescriptionParameterName = '__panelTitleDescription';\n\nexport function setPanelTitleAction(panelId: string, newAction: string) {\n parametersStore.dispatch(\n parametersActions.udpate({\n panelId,\n parameters: { [panelActionParameterName]: newAction },\n }),\n );\n}\nexport function setPanelTitleDescritpion(\n panelId: string,\n newDescription: string,\n) {\n parametersStore.dispatch(\n parametersActions.udpate({\n panelId,\n parameters: { [panelDescriptionParameterName]: newDescription },\n }),\n );\n}\n\nexport function usePanelTitleAction() {\n return usePanelParametersSelector(\n (current) => current[panelActionParameterName] as string,\n );\n}\n\nexport function usePanelTitleDescription() {\n return usePanelParametersSelector(\n (current) => current[panelDescriptionParameterName] as string,\n );\n}\n"],"names":["parametersStore"],"mappings":";;;AAGA,MAAM,wBAA2B,GAAA,oBAAA,CAAA;AACjC,MAAM,6BAAgC,GAAA,yBAAA,CAAA;AAEtB,SAAA,mBAAA,CAAoB,SAAiB,SAAmB,EAAA;AACtE,EAAgBA,KAAA,CAAA,QAAA;AAAA,IACd,kBAAkB,MAAO,CAAA;AAAA,MACvB,OAAA;AAAA,MACA,UAAY,EAAA,EAAE,CAAC,wBAAwB,GAAG,SAAU,EAAA;AAAA,KACrD,CAAA;AAAA,GACH,CAAA;AACF,CAAA;AACgB,SAAA,wBAAA,CACd,SACA,cACA,EAAA;AACA,EAAgBA,KAAA,CAAA,QAAA;AAAA,IACd,kBAAkB,MAAO,CAAA;AAAA,MACvB,OAAA;AAAA,MACA,UAAY,EAAA,EAAE,CAAC,6BAA6B,GAAG,cAAe,EAAA;AAAA,KAC/D,CAAA;AAAA,GACH,CAAA;AACF,CAAA;AAEO,SAAS,mBAAsB,GAAA;AACpC,EAAO,OAAA,0BAAA;AAAA,IACL,CAAC,OAAY,KAAA,OAAA,CAAQ,wBAAwB,CAAA;AAAA,GAC/C,CAAA;AACF,CAAA;AAEO,SAAS,wBAA2B,GAAA;AACzC,EAAO,OAAA,0BAAA;AAAA,IACL,CAAC,OAAY,KAAA,OAAA,CAAQ,6BAA6B,CAAA;AAAA,GACpD,CAAA;AACF;;;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TId } from '@apia/util';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Permite conocer la posición del panel, se actualiza automáticamente cuando
|
|
5
|
-
* ésta cambia provocando un renderizado en el padre
|
|
6
|
-
*/
|
|
7
|
-
declare function usePanelPosition(): {
|
|
8
|
-
containerId: TId;
|
|
9
|
-
position: number;
|
|
10
|
-
} | undefined;
|
|
11
|
-
|
|
12
|
-
export { usePanelPosition };
|
|
13
|
-
//# sourceMappingURL=usePanelPosition.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePanelPosition.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ApiaApi, makeApiaUrl } from '@apia/api';
|
|
2
|
-
import { EventEmitter } from '@apia/util';
|
|
3
|
-
import { usePanelIdentity } from '../common/usePanelIdentity.js';
|
|
4
|
-
import { useState, useEffect } from 'react';
|
|
5
|
-
|
|
6
|
-
class PanelPositionEmitter extends EventEmitter {
|
|
7
|
-
}
|
|
8
|
-
const panelPositionEmitter = new PanelPositionEmitter();
|
|
9
|
-
function usePanelPosition() {
|
|
10
|
-
const { panelId } = usePanelIdentity();
|
|
11
|
-
const [position, setPosition] = useState();
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
return panelPositionEmitter.on("panelUpdate", (ev) => {
|
|
14
|
-
if (ev.panelId === panelId)
|
|
15
|
-
setPosition({ containerId: ev.containerId, position: ev.newPosition });
|
|
16
|
-
});
|
|
17
|
-
}, [panelId]);
|
|
18
|
-
return position;
|
|
19
|
-
}
|
|
20
|
-
async function updatePanelPosition(panelId, containerId, newPosition) {
|
|
21
|
-
const result = await ApiaApi.post(
|
|
22
|
-
makeApiaUrl({
|
|
23
|
-
action: "panelMove",
|
|
24
|
-
pnlId: panelId,
|
|
25
|
-
containerId,
|
|
26
|
-
newPosition
|
|
27
|
-
})
|
|
28
|
-
);
|
|
29
|
-
const hasUpdated = result?.data && !result.hasError && !result.hasMessages;
|
|
30
|
-
if (hasUpdated)
|
|
31
|
-
panelPositionEmitter.emit("panelUpdate", {
|
|
32
|
-
panelId,
|
|
33
|
-
containerId,
|
|
34
|
-
newPosition
|
|
35
|
-
});
|
|
36
|
-
return hasUpdated;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { panelPositionEmitter, updatePanelPosition, usePanelPosition };
|
|
40
|
-
//# sourceMappingURL=usePanelPosition.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePanelPosition.js","sources":["../../src/position/usePanelPosition.ts"],"sourcesContent":["import { ApiaApi, makeApiaUrl } from '@apia/api';\nimport { EventEmitter, TId } from '@apia/util';\nimport { usePanelIdentity } from '../common';\nimport { useEffect, useState } from 'react';\n\nclass PanelPositionEmitter extends EventEmitter<{\n panelUpdate: {\n panelId: TId;\n containerId: TId;\n newPosition: number;\n };\n}> {}\n\nexport const panelPositionEmitter = new PanelPositionEmitter();\n\n/**\n * Permite conocer la posición del panel, se actualiza automáticamente cuando\n * ésta cambia provocando un renderizado en el padre\n */\nexport function usePanelPosition() {\n const { panelId } = usePanelIdentity();\n\n const [position, setPosition] = useState<{\n containerId: TId;\n position: number;\n }>();\n\n useEffect(() => {\n return panelPositionEmitter.on('panelUpdate', (ev) => {\n if (ev.panelId === panelId)\n setPosition({ containerId: ev.containerId, position: ev.newPosition });\n });\n }, [panelId]);\n\n return position;\n}\n\nexport async function updatePanelPosition(\n panelId: TId,\n containerId: TId,\n newPosition: number,\n) {\n const result = await ApiaApi.post(\n makeApiaUrl({\n action: 'panelMove',\n pnlId: panelId,\n containerId,\n newPosition,\n }),\n );\n\n const hasUpdated = result?.data && !result.hasError && !result.hasMessages;\n\n if (hasUpdated)\n panelPositionEmitter.emit('panelUpdate', {\n panelId,\n containerId,\n newPosition,\n });\n\n return hasUpdated;\n}\n\nexport function useUpdatePanelPosition() {\n const { panelId } = usePanelIdentity();\n return async function updatePosition(containerId: TId, newPosition: number) {\n return updatePanelPosition(panelId, containerId, newPosition);\n };\n}\n"],"names":[],"mappings":";;;;;AAKA,MAAM,6BAA6B,YAMhC,CAAA;AAAC,CAAA;AAES,MAAA,oBAAA,GAAuB,IAAI,oBAAqB,GAAA;AAMtD,SAAS,gBAAmB,GAAA;AACjC,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,gBAAiB,EAAA,CAAA;AAErC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,QAG7B,EAAA,CAAA;AAEH,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,OAAO,oBAAqB,CAAA,EAAA,CAAG,aAAe,EAAA,CAAC,EAAO,KAAA;AACpD,MAAA,IAAI,GAAG,OAAY,KAAA,OAAA;AACjB,QAAA,WAAA,CAAY,EAAE,WAAa,EAAA,EAAA,CAAG,aAAa,QAAU,EAAA,EAAA,CAAG,aAAa,CAAA,CAAA;AAAA,KACxE,CAAA,CAAA;AAAA,GACH,EAAG,CAAC,OAAO,CAAC,CAAA,CAAA;AAEZ,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEsB,eAAA,mBAAA,CACpB,OACA,EAAA,WAAA,EACA,WACA,EAAA;AACA,EAAM,MAAA,MAAA,GAAS,MAAM,OAAQ,CAAA,IAAA;AAAA,IAC3B,WAAY,CAAA;AAAA,MACV,MAAQ,EAAA,WAAA;AAAA,MACR,KAAO,EAAA,OAAA;AAAA,MACP,WAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA;AAAA,GACH,CAAA;AAEA,EAAA,MAAM,aAAa,MAAQ,EAAA,IAAA,IAAQ,CAAC,MAAO,CAAA,QAAA,IAAY,CAAC,MAAO,CAAA,WAAA,CAAA;AAE/D,EAAI,IAAA,UAAA;AACF,IAAA,oBAAA,CAAqB,KAAK,aAAe,EAAA;AAAA,MACvC,OAAA;AAAA,MACA,WAAA;AAAA,MACA,WAAA;AAAA,KACD,CAAA,CAAA;AAEH,EAAO,OAAA,UAAA,CAAA;AACT;;;;"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { isChild } from '@apia/util';
|
|
2
|
-
|
|
3
|
-
function dragleave(_ev, DragAndDrop2) {
|
|
4
|
-
const ev = _ev;
|
|
5
|
-
if (ev.relatedTarget === null || isChild(ev.relatedTarget, (current) => {
|
|
6
|
-
return current.parentElement === null && current === document.getRootNode() && current.dataset.splash === void 0;
|
|
7
|
-
})) {
|
|
8
|
-
const shadows = document.querySelectorAll(".apia_panel_falseDiv");
|
|
9
|
-
shadows.forEach((el) => el.remove());
|
|
10
|
-
DragAndDrop2.draggingPanel?.setAttribute("style", "");
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { dragleave };
|
|
15
|
-
//# sourceMappingURL=Dragleave.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dragleave.js","sources":["../../../src/splash/events/Dragleave.ts"],"sourcesContent":["import { isChild } from '@apia/util';\nimport { DragAndDrop } from '../util/DragAndDrop';\n\nexport function dragleave(_ev: Event, DragAndDrop: DragAndDrop) {\n const ev = _ev as DragEvent;\n\n if (\n ev.relatedTarget === null ||\n isChild(ev.relatedTarget as HTMLElement, (current) => {\n return (\n current.parentElement === null &&\n current === document.getRootNode() &&\n current.dataset.splash === undefined\n );\n })\n ) {\n const shadows = document.querySelectorAll('.apia_panel_falseDiv');\n\n shadows.forEach((el) => el.remove());\n DragAndDrop.draggingPanel?.setAttribute('style', '');\n }\n}\n"],"names":["DragAndDrop"],"mappings":";;AAGgB,SAAA,SAAA,CAAU,KAAYA,YAA0B,EAAA;AAC9D,EAAA,MAAM,EAAK,GAAA,GAAA,CAAA;AAEX,EAAA,IACE,GAAG,aAAkB,KAAA,IAAA,IACrB,QAAQ,EAAG,CAAA,aAAA,EAA8B,CAAC,OAAY,KAAA;AACpD,IACE,OAAA,OAAA,CAAQ,kBAAkB,IAC1B,IAAA,OAAA,KAAY,SAAS,WAAY,EAAA,IACjC,OAAQ,CAAA,OAAA,CAAQ,MAAW,KAAA,KAAA,CAAA,CAAA;AAAA,GAE9B,CACD,EAAA;AACA,IAAM,MAAA,OAAA,GAAU,QAAS,CAAA,gBAAA,CAAiB,sBAAsB,CAAA,CAAA;AAEhE,IAAA,OAAA,CAAQ,OAAQ,CAAA,CAAC,EAAO,KAAA,EAAA,CAAG,QAAQ,CAAA,CAAA;AACnC,IAAAA,YAAY,CAAA,aAAA,EAAe,YAAa,CAAA,OAAA,EAAS,EAAE,CAAA,CAAA;AAAA,GACrD;AACF;;;;"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { isCursorInArea } from '../util/isCursorInArea.js';
|
|
2
|
-
import { getColumnAreas } from '../util/getColumnAreas.js';
|
|
3
|
-
|
|
4
|
-
function dragover(event, DragAndDrop2) {
|
|
5
|
-
const ev = event;
|
|
6
|
-
ev.preventDefault();
|
|
7
|
-
DragAndDrop2.timeout = -1;
|
|
8
|
-
if ((ev.clientX !== DragAndDrop2.dragoverPosition.x || ev.clientY !== DragAndDrop2.dragoverPosition.y) && DragAndDrop2.draggingPanelId !== "" && DragAndDrop2.shadowDiv) {
|
|
9
|
-
DragAndDrop2.clearTimeout();
|
|
10
|
-
DragAndDrop2.currentBottomPanel = DragAndDrop2.findBottomPanel(
|
|
11
|
-
ev.clientX,
|
|
12
|
-
ev.clientY + DragAndDrop2.currentScroll
|
|
13
|
-
);
|
|
14
|
-
DragAndDrop2.dragoverPosition.x = ev.clientX;
|
|
15
|
-
DragAndDrop2.dragoverPosition.y = ev.clientY;
|
|
16
|
-
const snapshotSection = DragAndDrop2.findBottomSection(
|
|
17
|
-
ev.clientX,
|
|
18
|
-
ev.clientY + DragAndDrop2.currentScroll
|
|
19
|
-
);
|
|
20
|
-
if (DragAndDrop2.shadowDivData && isCursorInArea({
|
|
21
|
-
cursorX: ev.clientX,
|
|
22
|
-
cursorY: ev.clientY + DragAndDrop2.currentScroll,
|
|
23
|
-
bottom: DragAndDrop2.shadowDivData?.panelBottom,
|
|
24
|
-
top: DragAndDrop2.shadowDivData?.panelTop,
|
|
25
|
-
left: DragAndDrop2.shadowDivData?.panelLeft,
|
|
26
|
-
right: DragAndDrop2.shadowDivData?.panelRight
|
|
27
|
-
})) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (DragAndDrop2.currentBottomPanel && snapshotSection) {
|
|
31
|
-
const bottomPanel = DragAndDrop2.splash.querySelector(
|
|
32
|
-
`[data-panel][data-id='${DragAndDrop2.currentBottomPanel.id}']`
|
|
33
|
-
);
|
|
34
|
-
const draggingPanel = DragAndDrop2.splash.querySelector(
|
|
35
|
-
`[data-panel][data-id='${DragAndDrop2.draggingPanelId}']`
|
|
36
|
-
);
|
|
37
|
-
const bottomSection = DragAndDrop2.splash.querySelector(
|
|
38
|
-
`[data-locationid='${snapshotSection.sectionId}']`
|
|
39
|
-
);
|
|
40
|
-
if (bottomSection) {
|
|
41
|
-
if (isCursorInArea({
|
|
42
|
-
cursorX: ev.clientX,
|
|
43
|
-
cursorY: ev.clientY + DragAndDrop2.currentScroll,
|
|
44
|
-
...getColumnAreas({
|
|
45
|
-
...DragAndDrop2.currentBottomPanel,
|
|
46
|
-
panelLeft: bottomSection?.getBoundingClientRect().left ?? 0,
|
|
47
|
-
panelRight: bottomSection?.getBoundingClientRect().right ?? 0
|
|
48
|
-
}).top
|
|
49
|
-
})) {
|
|
50
|
-
if (draggingPanel) {
|
|
51
|
-
draggingPanel.setAttribute("style", "display: none; height: 0;");
|
|
52
|
-
}
|
|
53
|
-
if (bottomPanel && snapshotSection) {
|
|
54
|
-
if (bottomSection) {
|
|
55
|
-
DragAndDrop2.shadowDiv.setAttribute("style", "opacity: 50%;");
|
|
56
|
-
DragAndDrop2.debounceBefore(
|
|
57
|
-
bottomPanel,
|
|
58
|
-
DragAndDrop2.shadowDiv,
|
|
59
|
-
bottomSection
|
|
60
|
-
);
|
|
61
|
-
DragAndDrop2.snapshot();
|
|
62
|
-
DragAndDrop2.clearTimeout();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} else if (isCursorInArea({
|
|
66
|
-
cursorX: ev.clientX,
|
|
67
|
-
cursorY: ev.clientY + DragAndDrop2.currentScroll,
|
|
68
|
-
...getColumnAreas({
|
|
69
|
-
...DragAndDrop2.currentBottomPanel,
|
|
70
|
-
panelLeft: bottomSection?.getBoundingClientRect().left ?? 0,
|
|
71
|
-
panelRight: bottomSection?.getBoundingClientRect().right ?? 0
|
|
72
|
-
}).bottom
|
|
73
|
-
})) {
|
|
74
|
-
const bottomPanel2 = DragAndDrop2.splash.querySelector(
|
|
75
|
-
`[data-panel][data-id='${DragAndDrop2.currentBottomPanel.id}']`
|
|
76
|
-
);
|
|
77
|
-
const draggingPanel2 = DragAndDrop2.splash.querySelector(
|
|
78
|
-
`[data-panel][data-id='${DragAndDrop2.draggingPanelId}']`
|
|
79
|
-
);
|
|
80
|
-
if (draggingPanel2) {
|
|
81
|
-
draggingPanel2.setAttribute("style", "display: none;");
|
|
82
|
-
}
|
|
83
|
-
if (bottomPanel2 && snapshotSection) {
|
|
84
|
-
const bottomSection2 = DragAndDrop2.splash.querySelector(
|
|
85
|
-
`[data-locationid='${snapshotSection.sectionId}']`
|
|
86
|
-
);
|
|
87
|
-
if (bottomSection2) {
|
|
88
|
-
DragAndDrop2.shadowDiv.setAttribute("style", "opacity: 50%;");
|
|
89
|
-
DragAndDrop2.debounceAfter(DragAndDrop2.shadowDiv, bottomPanel2);
|
|
90
|
-
DragAndDrop2.snapshot();
|
|
91
|
-
DragAndDrop2.clearTimeout();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
} else if (!DragAndDrop2.currentBottomPanel && snapshotSection) {
|
|
97
|
-
const bottomSection = DragAndDrop2.splash.querySelector(
|
|
98
|
-
`[data-locationid='${snapshotSection.sectionId}']`
|
|
99
|
-
);
|
|
100
|
-
if (bottomSection) {
|
|
101
|
-
const draggingPanel = DragAndDrop2.splash.querySelector(
|
|
102
|
-
`[data-panel][data-id='${DragAndDrop2.draggingPanelId}']`
|
|
103
|
-
);
|
|
104
|
-
if (draggingPanel) {
|
|
105
|
-
draggingPanel.setAttribute("style", "display: none;");
|
|
106
|
-
}
|
|
107
|
-
DragAndDrop2.shadowDiv.setAttribute("style", "opacity: 50%;");
|
|
108
|
-
DragAndDrop2.debounceAppend(
|
|
109
|
-
bottomSection,
|
|
110
|
-
DragAndDrop2.shadowDiv
|
|
111
|
-
);
|
|
112
|
-
DragAndDrop2.snapshot();
|
|
113
|
-
DragAndDrop2.clearTimeout();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export { dragover };
|
|
120
|
-
//# sourceMappingURL=Dragover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dragover.js","sources":["../../../src/splash/events/Dragover.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport { isCursorInArea } from '../util/isCursorInArea';\nimport { getColumnAreas } from '../util/getColumnAreas';\nimport { DragAndDrop } from '../util/DragAndDrop';\n\nexport function dragover(event: Event, DragAndDrop: DragAndDrop) {\n const ev = event as DragEvent;\n ev.preventDefault();\n\n DragAndDrop.timeout = -1;\n if (\n (ev.clientX !== DragAndDrop.dragoverPosition.x ||\n ev.clientY !== DragAndDrop.dragoverPosition.y) &&\n DragAndDrop.draggingPanelId !== '' &&\n DragAndDrop.shadowDiv\n ) {\n DragAndDrop.clearTimeout();\n DragAndDrop.currentBottomPanel = DragAndDrop.findBottomPanel(\n ev.clientX,\n ev.clientY + DragAndDrop.currentScroll,\n );\n\n DragAndDrop.dragoverPosition.x = ev.clientX;\n DragAndDrop.dragoverPosition.y = ev.clientY;\n\n const snapshotSection = DragAndDrop.findBottomSection(\n ev.clientX,\n ev.clientY + DragAndDrop.currentScroll,\n );\n\n if (\n DragAndDrop.shadowDivData &&\n isCursorInArea({\n cursorX: ev.clientX,\n cursorY: ev.clientY + DragAndDrop.currentScroll,\n bottom: DragAndDrop.shadowDivData?.panelBottom,\n top: DragAndDrop.shadowDivData?.panelTop,\n left: DragAndDrop.shadowDivData?.panelLeft,\n right: DragAndDrop.shadowDivData?.panelRight,\n })\n ) {\n return;\n }\n\n if (DragAndDrop.currentBottomPanel && snapshotSection) {\n const bottomPanel = DragAndDrop.splash.querySelector(\n `[data-panel][data-id='${DragAndDrop.currentBottomPanel.id}']`,\n );\n const draggingPanel = DragAndDrop.splash.querySelector(\n `[data-panel][data-id='${DragAndDrop.draggingPanelId}']`,\n );\n const bottomSection = DragAndDrop.splash.querySelector(\n `[data-locationid='${snapshotSection.sectionId}']`,\n );\n\n if (bottomSection) {\n if (\n isCursorInArea({\n cursorX: ev.clientX,\n cursorY: ev.clientY + DragAndDrop.currentScroll,\n ...getColumnAreas({\n ...DragAndDrop.currentBottomPanel,\n panelLeft: bottomSection?.getBoundingClientRect().left ?? 0,\n panelRight: bottomSection?.getBoundingClientRect().right ?? 0,\n }).top,\n })\n ) {\n if (draggingPanel) {\n draggingPanel.setAttribute('style', 'display: none; height: 0;');\n }\n if (bottomPanel && snapshotSection) {\n if (bottomSection) {\n DragAndDrop.shadowDiv.setAttribute('style', 'opacity: 50%;');\n DragAndDrop.debounceBefore(\n bottomPanel,\n DragAndDrop.shadowDiv,\n bottomSection as HTMLElement,\n );\n DragAndDrop.snapshot();\n DragAndDrop.clearTimeout();\n }\n }\n } else if (\n isCursorInArea({\n cursorX: ev.clientX,\n cursorY: ev.clientY + DragAndDrop.currentScroll,\n ...getColumnAreas({\n ...DragAndDrop.currentBottomPanel,\n panelLeft: bottomSection?.getBoundingClientRect().left ?? 0,\n panelRight: bottomSection?.getBoundingClientRect().right ?? 0,\n }).bottom,\n })\n ) {\n const bottomPanel = DragAndDrop.splash.querySelector(\n `[data-panel][data-id='${DragAndDrop.currentBottomPanel.id}']`,\n );\n const draggingPanel = DragAndDrop.splash.querySelector(\n `[data-panel][data-id='${DragAndDrop.draggingPanelId}']`,\n );\n if (draggingPanel) {\n draggingPanel.setAttribute('style', 'display: none;');\n }\n if (bottomPanel && snapshotSection) {\n const bottomSection = DragAndDrop.splash.querySelector(\n `[data-locationid='${snapshotSection.sectionId}']`,\n );\n if (bottomSection) {\n DragAndDrop.shadowDiv.setAttribute('style', 'opacity: 50%;');\n DragAndDrop.debounceAfter(DragAndDrop.shadowDiv, bottomPanel);\n DragAndDrop.snapshot();\n DragAndDrop.clearTimeout();\n }\n }\n }\n }\n } else if (!DragAndDrop.currentBottomPanel && snapshotSection) {\n const bottomSection = DragAndDrop.splash.querySelector(\n `[data-locationid='${snapshotSection.sectionId}']`,\n );\n if (bottomSection) {\n const draggingPanel = DragAndDrop.splash.querySelector(\n `[data-panel][data-id='${DragAndDrop.draggingPanelId}']`,\n );\n if (draggingPanel) {\n draggingPanel.setAttribute('style', 'display: none;');\n }\n DragAndDrop.shadowDiv.setAttribute('style', 'opacity: 50%;');\n DragAndDrop.debounceAppend(\n bottomSection as HTMLElement,\n DragAndDrop.shadowDiv,\n );\n DragAndDrop.snapshot();\n DragAndDrop.clearTimeout();\n }\n }\n }\n}\n"],"names":["DragAndDrop","bottomPanel","draggingPanel","bottomSection"],"mappings":";;;AAKgB,SAAA,QAAA,CAAS,OAAcA,YAA0B,EAAA;AAC/D,EAAA,MAAM,EAAK,GAAA,KAAA,CAAA;AACX,EAAA,EAA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,CAAcA,YAAY,CAAA,SAAA,EAAWC,YAAW,CAAA,CAAA;AAC5D,cAAAD,aAAY,QAAS,EAAA,CAAA;AACrB,cAAAA,aAAY,YAAa,EAAA,CAAA;AAAA,aAC3B;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACS,MAAA,IAAA,CAACA,YAAY,CAAA,kBAAA,IAAsB,eAAiB,EAAA;AAC7D,MAAM,MAAA,aAAA,GAAgBA,aAAY,MAAO,CAAA,aAAA;AAAA,QACvC,CAAA,kBAAA,EAAqB,gBAAgB,SAAS,CAAA,EAAA,CAAA;AAAA,OAChD,CAAA;AACA,MAAA,IAAI,aAAe,EAAA;AACjB,QAAM,MAAA,aAAA,GAAgBA,aAAY,MAAO,CAAA,aAAA;AAAA,UACvC,CAAA,sBAAA,EAAyBA,aAAY,eAAe,CAAA,EAAA,CAAA;AAAA,SACtD,CAAA;AACA,QAAA,IAAI,aAAe,EAAA;AACjB,UAAc,aAAA,CAAA,YAAA,CAAa,SAAS,gBAAgB,CAAA,CAAA;AAAA,SACtD;AACA,QAAAA,YAAY,CAAA,SAAA,CAAU,YAAa,CAAA,OAAA,EAAS,eAAe,CAAA,CAAA;AAC3D,QAAAA,YAAY,CAAA,cAAA;AAAA,UACV,aAAA;AAAA,UACAA,YAAY,CAAA,SAAA;AAAA,SACd,CAAA;AACA,QAAAA,aAAY,QAAS,EAAA,CAAA;AACrB,QAAAA,aAAY,YAAa,EAAA,CAAA;AAAA,OAC3B;AAAA,KACF;AAAA,GACF;AACF;;;;"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { getSpecificParent } from '@apia/util';
|
|
2
|
-
|
|
3
|
-
function dragstart(ev, el, DragAndDrop2) {
|
|
4
|
-
if (!(el instanceof HTMLElement))
|
|
5
|
-
return;
|
|
6
|
-
DragAndDrop2.drawMinimap();
|
|
7
|
-
DragAndDrop2.sectionData = [];
|
|
8
|
-
const targetPanel = getSpecificParent(
|
|
9
|
-
ev.target,
|
|
10
|
-
(current) => !!current.dataset?.id && !!current.dataset?.panel
|
|
11
|
-
);
|
|
12
|
-
ev?.dataTransfer?.setData("text", targetPanel?.dataset.id);
|
|
13
|
-
if (targetPanel) {
|
|
14
|
-
DragAndDrop2.placeholderImage = targetPanel.cloneNode(true);
|
|
15
|
-
DragAndDrop2.placeholderImage.style.position = "fixed";
|
|
16
|
-
DragAndDrop2.placeholderImage.style.top = "-10000000.45px";
|
|
17
|
-
const children = DragAndDrop2.placeholderImage.querySelectorAll("*");
|
|
18
|
-
children.forEach((current) => current.style.overflow = "hidden");
|
|
19
|
-
document.body.append(DragAndDrop2.placeholderImage);
|
|
20
|
-
ev?.dataTransfer?.setDragImage(DragAndDrop2.placeholderImage, 0, 0);
|
|
21
|
-
}
|
|
22
|
-
if (ev.dataTransfer) {
|
|
23
|
-
ev.dataTransfer.effectAllowed = "move";
|
|
24
|
-
}
|
|
25
|
-
setTimeout(() => {
|
|
26
|
-
const targetSection = getSpecificParent(
|
|
27
|
-
ev.target,
|
|
28
|
-
(current) => !!current.dataset?.locationid
|
|
29
|
-
);
|
|
30
|
-
const sections = DragAndDrop2.body?.querySelectorAll("[data-locationid]");
|
|
31
|
-
const emptySectionsId = [];
|
|
32
|
-
sections?.forEach((sec) => {
|
|
33
|
-
if (sec.children.length === 0) {
|
|
34
|
-
emptySectionsId.push(sec.dataset.locationid ?? "");
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
emptySectionsId.forEach((emptySecId) => {
|
|
38
|
-
const section = DragAndDrop2.body?.querySelector(
|
|
39
|
-
`[data-locationid="${emptySecId}"]`
|
|
40
|
-
);
|
|
41
|
-
if (section) {
|
|
42
|
-
section.setAttribute("style", "padding: 10px; border:2px dashed #ccc");
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
DragAndDrop2.snapshot();
|
|
46
|
-
if (targetPanel) {
|
|
47
|
-
DragAndDrop2.draggingPanelSectionId = targetSection?.dataset.locationid ?? "";
|
|
48
|
-
DragAndDrop2.draggingPanelId = targetPanel.dataset.id;
|
|
49
|
-
DragAndDrop2.draggingPanel = targetPanel;
|
|
50
|
-
}
|
|
51
|
-
if (DragAndDrop2.draggingPanelId === "") {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const falseDiv = targetPanel?.cloneNode(true);
|
|
55
|
-
falseDiv.style.opacity = `50%`;
|
|
56
|
-
falseDiv.style.width = `100%`;
|
|
57
|
-
falseDiv.style.height = `auto`;
|
|
58
|
-
falseDiv.style.backgroundColor = `rgba(0,0,0,0.1)`;
|
|
59
|
-
falseDiv.className = "apia_panel_falseDiv";
|
|
60
|
-
DragAndDrop2.shadowDiv = falseDiv;
|
|
61
|
-
}, 0);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export { dragstart };
|
|
65
|
-
//# sourceMappingURL=Dragstart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dragstart.js","sources":["../../../src/splash/events/Dragstart.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport { getSpecificParent } from '@apia/util';\nimport { DragAndDrop } from '../util/DragAndDrop';\n\nexport function dragstart(\n ev: DragEvent,\n el: Element,\n DragAndDrop: DragAndDrop,\n) {\n if (!(el instanceof HTMLElement)) return;\n DragAndDrop.drawMinimap();\n DragAndDrop.sectionData = [];\n\n const targetPanel = getSpecificParent(\n ev.target as HTMLElement,\n (current) => !!current.dataset?.id && !!current.dataset?.panel,\n );\n\n ev?.dataTransfer?.setData('text', targetPanel?.dataset.id as string);\n if (targetPanel) {\n DragAndDrop.placeholderImage = targetPanel.cloneNode(true) as HTMLElement;\n DragAndDrop.placeholderImage.style.position = 'fixed';\n DragAndDrop.placeholderImage.style.top = '-10000000.45px';\n\n const children =\n DragAndDrop.placeholderImage.querySelectorAll<HTMLElement>('*');\n children.forEach((current) => (current.style.overflow = 'hidden'));\n document.body.append(DragAndDrop.placeholderImage);\n ev?.dataTransfer?.setDragImage(DragAndDrop.placeholderImage, 0, 0);\n }\n if (ev.dataTransfer) {\n // eslint-disable-next-line no-param-reassign\n ev.dataTransfer.effectAllowed = 'move';\n }\n\n setTimeout(() => {\n const targetSection = getSpecificParent(\n ev.target as HTMLElement,\n (current) => !!current.dataset?.locationid,\n );\n\n const sections = DragAndDrop.body?.querySelectorAll('[data-locationid]');\n\n const emptySectionsId: string[] = [];\n\n sections?.forEach((sec) => {\n if (sec.children.length === 0) {\n emptySectionsId.push((sec as HTMLElement).dataset.locationid ?? '');\n }\n });\n\n emptySectionsId.forEach((emptySecId) => {\n const section = DragAndDrop.body?.querySelector(\n `[data-locationid=\"${emptySecId}\"]`,\n );\n if (section) {\n section.setAttribute('style', 'padding: 10px; border:2px dashed #ccc');\n }\n });\n\n DragAndDrop.snapshot();\n\n if (targetPanel) {\n DragAndDrop.draggingPanelSectionId =\n targetSection?.dataset.locationid ?? '';\n DragAndDrop.draggingPanelId = targetPanel.dataset.id as string;\n DragAndDrop.draggingPanel = targetPanel;\n }\n if (DragAndDrop.draggingPanelId === '') {\n return;\n }\n const falseDiv = targetPanel?.cloneNode(true) as HTMLDivElement;\n falseDiv.style.opacity = `50%`;\n falseDiv.style.width = `100%`;\n falseDiv.style.height = `auto`;\n falseDiv.style.backgroundColor = `rgba(0,0,0,0.1)`;\n falseDiv.className = 'apia_panel_falseDiv';\n DragAndDrop.shadowDiv = falseDiv;\n }, 0);\n}\n"],"names":["DragAndDrop"],"mappings":";;AAIgB,SAAA,SAAA,CACd,EACA,EAAA,EAAA,EACAA,YACA,EAAA;AACA,EAAA,IAAI,EAAE,EAAc,YAAA,WAAA,CAAA;AAAc,IAAA,OAAA;AAClC,EAAAA,aAAY,WAAY,EAAA,CAAA;AACxB,EAAAA,YAAAA,CAAY,cAAc,EAAC,CAAA;AAE3B,EAAA,MAAM,WAAc,GAAA,iBAAA;AAAA,IAClB,EAAG,CAAA,MAAA;AAAA,IACH,CAAC,OAAY,KAAA,CAAC,CAAC,OAAA,CAAQ,SAAS,EAAM,IAAA,C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GAAA,CAAA,eAAA,CAAA,CAAA;AACjC,IAAA,QAAA,CAAS,SAAY,GAAA,qBAAA,CAAA;AACrB,IAAAA,aAAY,SAAY,GAAA,QAAA,CAAA;AAAA,KACvB,CAAC,CAAA,CAAA;AACN;;;;"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { getSpecificParent } from '@apia/util';
|
|
2
|
-
import { updatePanelPosition } from '../../position/usePanelPosition.js';
|
|
3
|
-
|
|
4
|
-
function Drop(event, DragAndDrop2) {
|
|
5
|
-
if (DragAndDrop2.body) {
|
|
6
|
-
const ev = event;
|
|
7
|
-
const data = ev?.dataTransfer?.getData("text");
|
|
8
|
-
const sections = DragAndDrop2.body?.querySelectorAll("[data-locationid]");
|
|
9
|
-
sections.forEach((sec) => {
|
|
10
|
-
sec.setAttribute("style", "");
|
|
11
|
-
});
|
|
12
|
-
const draggingPanel = DragAndDrop2.body.querySelector(
|
|
13
|
-
`[data-panel][data-id="${DragAndDrop2.draggingPanelId}"]:not(.apia_panel_falseDiv)`
|
|
14
|
-
);
|
|
15
|
-
if (draggingPanel) {
|
|
16
|
-
draggingPanel.setAttribute("style", "");
|
|
17
|
-
}
|
|
18
|
-
const falseDiv = document.querySelector(".apia_panel_falseDiv");
|
|
19
|
-
if (data) {
|
|
20
|
-
const child = document.querySelector(
|
|
21
|
-
`[data-panel][data-id="${data}"]:not(.apia_panel_falseDiv)`
|
|
22
|
-
);
|
|
23
|
-
sections.forEach((sec) => {
|
|
24
|
-
if (sec.children.length === 1) {
|
|
25
|
-
sec.setAttribute("style", "");
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
if (falseDiv) {
|
|
29
|
-
const newSection = getSpecificParent(
|
|
30
|
-
falseDiv,
|
|
31
|
-
(current) => !!current.dataset.locationid
|
|
32
|
-
);
|
|
33
|
-
if (newSection) {
|
|
34
|
-
const panelsArray = Array.from(newSection.children);
|
|
35
|
-
const childId = child.dataset.id;
|
|
36
|
-
if (childId) {
|
|
37
|
-
const index = panelsArray.findIndex(
|
|
38
|
-
(panel) => panel.dataset.id === childId
|
|
39
|
-
);
|
|
40
|
-
if (typeof index === "number" && newSection.dataset.locationid) {
|
|
41
|
-
void updatePanelPosition(
|
|
42
|
-
childId,
|
|
43
|
-
newSection.dataset.locationid,
|
|
44
|
-
index + 1
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
falseDiv.replaceWith(child);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
DragAndDrop2.draggingPanelId = "";
|
|
53
|
-
DragAndDrop2.panelData = [];
|
|
54
|
-
DragAndDrop2.drawMinimap();
|
|
55
|
-
DragAndDrop2.removePlaceholder();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export { Drop };
|
|
60
|
-
//# sourceMappingURL=Drop.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Drop.js","sources":["../../../src/splash/events/Drop.ts"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport { getSpecificParent } from '@apia/util';\nimport { updatePanelPosition } from '../../position/usePanelPosition';\nimport { DragAndDrop } from '../util/DragAndDrop';\n\nexport function Drop(event: Event, DragAndDrop: DragAndDrop) {\n if (DragAndDrop.body) {\n const ev = event as DragEvent;\n const data = ev?.dataTransfer?.getData('text');\n\n const sections = DragAndDrop.body?.querySelectorAll('[data-locationid]');\n\n sections.forEach((sec) => {\n sec.setAttribute('style', '');\n });\n\n const draggingPanel = DragAndDrop.body.querySelector(\n `[data-panel][data-id=\"${DragAndDrop.draggingPanelId}\"]:not(.apia_panel_falseDiv)`,\n );\n\n if (draggingPanel) {\n draggingPanel.setAttribute('style', '');\n }\n const falseDiv = document.querySelector('.apia_panel_falseDiv');\n\n if (data) {\n const child = document.querySelector(\n `[data-panel][data-id=\"${data}\"]:not(.apia_panel_falseDiv)`,\n );\n sections.forEach((sec) => {\n if (sec.children.length === 1) {\n sec.setAttribute('style', '');\n }\n });\n if (falseDiv) {\n const newSection = getSpecificParent(\n falseDiv as HTMLElement,\n (current) => !!current.dataset.locationid,\n );\n\n if (newSection) {\n const panelsArray = Array.from(newSection.children);\n const childId = (child as HTMLElement).dataset.id;\n\n if (childId) {\n const index = panelsArray.findIndex(\n (panel) => (panel as HTMLElement).dataset.id === childId,\n );\n\n if (typeof index === 'number' && newSection.dataset.locationid) {\n void updatePanelPosition(\n childId,\n newSection.dataset.locationid,\n index + 1,\n );\n }\n }\n }\n falseDiv.replaceWith(child as Node);\n }\n }\n\n DragAndDrop.draggingPanelId = '';\n DragAndDrop.panelData = [];\n DragAndDrop.drawMinimap();\n\n DragAndDrop.removePlaceholder();\n }\n}\n"],"names":["DragAndDrop"],"mappings":";;;AAKgB,SAAA,IAAA,CAAK,OAAcA,YAA0B,EAAA;AAC3D,EAAA,IAAIA,aAAY,IAAM,EAAA;AACpB,IAAA,MAAM,EAAK,GAAA,KAAA,CAAA;AACX,IAAA,MAAM,IAAO,GAAA,EAAA,EAAI,YAAc,EAAA,OAAA,CAAQ,MAAM,CAAA,CAAA;AAE7C,IAAA,MAAM,QAAWA,GAAAA,YAAAA,CAAY,IAAM,EAAA,gBAAA,CAAiB,mBAAmB,CAAA,CAAA;AAEvE,IAAS,QAAA,CAAA,OAAA,CAAQ,CAAC,GAAQ,KAAA;AACxB,MAAI,GAAA,CAAA,YAAA,CAAa,SAAS,EAAE,CAAA,CAAA;AAAA,KAC7B,CAAA,CAAA;AAED,IAAM,MAAA,aAAA,GAAgBA,aAAY,IAAK,CAAA,aAAA;AAAA,MACrC,CAAA,sBAAA,EAAyBA,aAAY,eAAe,CAAA,4BAAA,CAAA;AAAA,KACtD,CAAA;AAEA,IAAA,IAAI,aAAe,EAAA;AACjB,MAAc,aAAA,CAAA,YAAA,CAAa,SAAS,EAAE,CAAA,CAAA;AAAA,KACxC;AACA,IAAM,MAAA,QAAA,GAAW,QAAS,CAAA,aAAA,CAAc,sBAAsB,CAAA,CAA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C9B,IAAAA,YAAAA,CAAY,YAAY,EAAC,CAAA;AACzB,IAAAA,aAAY,WAAY,EAAA,CAAA;AAExB,IAAAA,aAAY,iBAAkB,EAAA,CAAA;AAAA,GAChC;AACF;;;;"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from '@apia/theme/jsx-runtime';
|
|
2
|
-
import { Icon } from '@apia/icons';
|
|
3
|
-
import { getLabel } from '@apia/util';
|
|
4
|
-
import { usePanelNetworkState } from '../../../actions/usePanelNetworkState.js';
|
|
5
|
-
|
|
6
|
-
const NetworkState = ({ title }) => {
|
|
7
|
-
const isConnected = usePanelNetworkState();
|
|
8
|
-
return /* @__PURE__ */ jsx(Fragment, { children: !isConnected && /* @__PURE__ */ jsx(
|
|
9
|
-
Icon,
|
|
10
|
-
{
|
|
11
|
-
tabIndex: 0,
|
|
12
|
-
title: getLabel("lblTestDBNoOk", {
|
|
13
|
-
text: {
|
|
14
|
-
TOK1: title
|
|
15
|
-
}
|
|
16
|
-
}).text,
|
|
17
|
-
"aria-label": getLabel("lblTestDBNoOk", {
|
|
18
|
-
text: {
|
|
19
|
-
TOK1: title
|
|
20
|
-
}
|
|
21
|
-
}).text,
|
|
22
|
-
name: "Alert"
|
|
23
|
-
}
|
|
24
|
-
) });
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export { NetworkState };
|
|
28
|
-
//# sourceMappingURL=NetworkState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkState.js","sources":["../../../../src/splash/panels/DefaultPanelWrapper/NetworkState.tsx"],"sourcesContent":["import { Icon } from '@apia/icons';\nimport { getLabel } from '@apia/util';\nimport { usePanelNetworkState } from '../../../actions';\n\nexport const NetworkState = ({ title }: { title: string }) => {\n const isConnected = usePanelNetworkState();\n return (\n <>\n {!isConnected && (\n <Icon\n tabIndex={0}\n title={\n getLabel('lblTestDBNoOk', {\n text: {\n TOK1: title,\n },\n }).text\n }\n aria-label={\n getLabel('lblTestDBNoOk', {\n text: {\n TOK1: title,\n },\n }).text\n }\n name=\"Alert\"\n />\n )}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;AAIO,MAAM,YAAe,GAAA,CAAC,EAAE,KAAA,EAA+B,KAAA;AAC5D,EAAA,MAAM,cAAc,oBAAqB,EAAA,CAAA;AACzC,EACE,uBAAA,GAAA,CAAA,QAAA,EAAA,EACG,WAAC,WACA,oBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,QAAU,EAAA,CAAA;AAAA,MACV,KAAA,EACE,SAAS,eAAiB,EAAA;AAAA,QACxB,IAAM,EAAA;AAAA,UACJ,IAAM,EAAA,KAAA;AAAA,SACR;AAAA,OACD,CAAE,CAAA,IAAA;AAAA,MAEL,YAAA,EACE,SAAS,eAAiB,EAAA;AAAA,QACxB,IAAM,EAAA;AAAA,UACJ,IAAM,EAAA,KAAA;AAAA,SACR;AAAA,OACD,CAAE,CAAA,IAAA;AAAA,MAEL,IAAK,EAAA,OAAA;AAAA,KAAA;AAAA,GAGX,EAAA,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { jsxs, Fragment, jsx } from '@apia/theme/jsx-runtime';
|
|
2
|
-
import { makeImperativeComponent } from '@apia/util';
|
|
3
|
-
import { RefreshButton } from './RefreshButton.js';
|
|
4
|
-
import { SettingsButton } from './SettingsButton.js';
|
|
5
|
-
|
|
6
|
-
const [, panelButtonsActions, PanelButtons] = makeImperativeComponent()({
|
|
7
|
-
Component: (props) => {
|
|
8
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
-
props.isRefreshable && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(RefreshButton, { ...props }) }),
|
|
10
|
-
props.isConfigurable && /* @__PURE__ */ jsx(SettingsButton, { title: props.title })
|
|
11
|
-
] });
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
export { PanelButtons, panelButtonsActions };
|
|
16
|
-
//# sourceMappingURL=PanelButtons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PanelButtons.js","sources":["../../../../src/splash/panels/DefaultPanelWrapper/PanelButtons.tsx"],"sourcesContent":["import { makeImperativeComponent } from '@apia/util';\nimport { RefreshButton } from './RefreshButton';\nimport { SettingsButton } from './SettingsButton';\nimport { TPanelProps } from '../../../types';\n\nexport const [, panelButtonsActions, PanelButtons] = makeImperativeComponent<\n Omit<TPanelProps, 'initialData' | 'children'>,\n {\n disable: boolean;\n }\n>()({\n Component: (props) => {\n return (\n <>\n {props.isRefreshable && (\n <>\n <RefreshButton {...props} />\n </>\n )}\n {props.isConfigurable && <SettingsButton title={props.title} />}\n </>\n );\n },\n});\n"],"names":[],"mappings":";;;;;AAKO,MAAM,GAAG,mBAAA,EAAqB,YAAY,CAAA,GAAI,yBAKjD,CAAA;AAAA,EACF,SAAA,EAAW,CAAC,KAAU,KAAA;AACpB,IAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,MAAA,KAAA,CAAM,iCAEH,GAAA,CAAA,QAAA,EAAA,EAAA,QAAA,kBAAA,GAAA,CAAC,aAAe,EAAA,EAAA,GAAG,OAAO,CAC5B,EAAA,CAAA;AAAA,MAED,MAAM,cAAkB,oBAAA,GAAA,CAAC,cAAe,EAAA,EAAA,KAAA,EAAO,MAAM,KAAO,EAAA,CAAA;AAAA,KAC/D,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,CAAC;;;;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx } from '@apia/theme/jsx-runtime';
|
|
2
|
-
import { IconButton } from '@apia/components';
|
|
3
|
-
import { useImperativeComponentEvents, getLabel } from '@apia/util';
|
|
4
|
-
import { useState, useCallback } from 'react';
|
|
5
|
-
import { usePanelActions } from '../../../actions/usePanelActions.js';
|
|
6
|
-
import { usePanelIsLoading } from '../../../actions/usePanelIsLoading.js';
|
|
7
|
-
|
|
8
|
-
const RefreshButton = (props) => {
|
|
9
|
-
const [isDisabled, setIsDisabled] = useState(false);
|
|
10
|
-
const isLoading = usePanelIsLoading();
|
|
11
|
-
const dispatch = usePanelActions();
|
|
12
|
-
useImperativeComponentEvents({
|
|
13
|
-
disable(newDisabledValue) {
|
|
14
|
-
setIsDisabled(newDisabledValue);
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return /* @__PURE__ */ jsx(
|
|
18
|
-
IconButton,
|
|
19
|
-
{
|
|
20
|
-
icon: "Refresh",
|
|
21
|
-
variant: "buttons.icon-outline",
|
|
22
|
-
className: "panel__iconButton",
|
|
23
|
-
size: "Md",
|
|
24
|
-
onClick: useCallback(() => {
|
|
25
|
-
void dispatch({ action: "refresh" });
|
|
26
|
-
}, [dispatch]),
|
|
27
|
-
title: getLabel("lblRefreshPnl", { text: { TOK1: props.title } }).text,
|
|
28
|
-
isLoading,
|
|
29
|
-
disabled: isDisabled
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { RefreshButton };
|
|
35
|
-
//# sourceMappingURL=RefreshButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RefreshButton.js","sources":["../../../../src/splash/panels/DefaultPanelWrapper/RefreshButton.tsx"],"sourcesContent":["import { IconButton } from '@apia/components';\nimport { getLabel, useImperativeComponentEvents } from '@apia/util';\nimport { useCallback, useState } from 'react';\nimport { usePanelActions, usePanelIsLoading } from '../../../actions';\n\nexport const RefreshButton = (props: {\n refreshOnStart: boolean;\n refreshOnHome: boolean;\n title: string;\n}) => {\n const [isDisabled, setIsDisabled] = useState(false);\n\n const isLoading = usePanelIsLoading();\n const dispatch = usePanelActions();\n\n useImperativeComponentEvents({\n disable(newDisabledValue: boolean) {\n setIsDisabled(newDisabledValue);\n },\n });\n\n return (\n <IconButton\n icon=\"Refresh\"\n variant=\"buttons.icon-outline\"\n className=\"panel__iconButton\"\n size=\"Md\"\n onClick={useCallback(() => {\n void dispatch({ action: 'refresh' });\n }, [dispatch])}\n title={getLabel('lblRefreshPnl', { text: { TOK1: props.title } }).text}\n isLoading={isLoading}\n disabled={isDisabled}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;AAKa,MAAA,aAAA,GAAgB,CAAC,KAIxB,KAAA;AACJ,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAElD,EAAA,MAAM,YAAY,iBAAkB,EAAA,CAAA;AACpC,EAAA,MAAM,WAAW,eAAgB,EAAA,CAAA;AAEjC,EAA6B,4BAAA,CAAA;AAAA,IAC3B,QAAQ,gBAA2B,EAAA;AACjC,MAAA,aAAA,CAAc,gBAAgB,CAAA,CAAA;AAAA,KAChC;AAAA,GACD,CAAA,CAAA;AAED,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,SAAA;AAAA,MACL,OAAQ,EAAA,sBAAA;AAAA,MACR,SAAU,EAAA,mBAAA;AAAA,MACV,IAAK,EAAA,IAAA;AAAA,MACL,OAAA,EAAS,YAAY,MAAM;AACzB,QAAA,KAAK,QAAS,CAAA,EAAE,MAAQ,EAAA,SAAA,EAAW,CAAA,CAAA;AAAA,OACrC,EAAG,CAAC,QAAQ,CAAC,CAAA;AAAA,MACb,KAAA,EAAO,QAAS,CAAA,eAAA,EAAiB,EAAE,IAAA,EAAM,EAAE,IAAA,EAAM,KAAM,CAAA,KAAA,EAAQ,EAAC,CAAE,CAAA,IAAA;AAAA,MAClE,SAAA;AAAA,MACA,QAAU,EAAA,UAAA;AAAA,KAAA;AAAA,GACZ,CAAA;AAEJ;;;;"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx } from '@apia/theme/jsx-runtime';
|
|
2
|
-
import { IconButton } from '@apia/components';
|
|
3
|
-
import { useImperativeComponentEvents, getLabel } from '@apia/util';
|
|
4
|
-
import { useState, useCallback } from 'react';
|
|
5
|
-
import { usePanelConfig } from '../../../config/usePanelConfig.js';
|
|
6
|
-
import { usePanelActions } from '../../../actions/usePanelActions.js';
|
|
7
|
-
import { panelButtonsActions } from './PanelButtons.js';
|
|
8
|
-
import { usePanelIdentity } from '../../../common/usePanelIdentity.js';
|
|
9
|
-
|
|
10
|
-
const SettingsButton = (props) => {
|
|
11
|
-
const { panelId } = usePanelIdentity();
|
|
12
|
-
const configure = usePanelConfig();
|
|
13
|
-
const [isDisabled, setIsDisabled] = useState(false);
|
|
14
|
-
useImperativeComponentEvents({
|
|
15
|
-
disable(newDisabledValue) {
|
|
16
|
-
setIsDisabled(newDisabledValue);
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
usePanelActions({
|
|
20
|
-
refresh() {
|
|
21
|
-
panelButtonsActions(panelId, "disable", false);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
const openSettings = useCallback(() => {
|
|
25
|
-
try {
|
|
26
|
-
configure();
|
|
27
|
-
} catch (e) {
|
|
28
|
-
}
|
|
29
|
-
}, [configure]);
|
|
30
|
-
return /* @__PURE__ */ jsx(
|
|
31
|
-
IconButton,
|
|
32
|
-
{
|
|
33
|
-
icon: "Settings",
|
|
34
|
-
size: "Md",
|
|
35
|
-
variant: "buttons.icon-outline",
|
|
36
|
-
className: "panel__iconButton",
|
|
37
|
-
onClick: openSettings,
|
|
38
|
-
title: getLabel("lblOpenPnlConf", { text: { TOK1: props.title } }).text,
|
|
39
|
-
disabled: isDisabled
|
|
40
|
-
}
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export { SettingsButton };
|
|
45
|
-
//# sourceMappingURL=SettingsButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsButton.js","sources":["../../../../src/splash/panels/DefaultPanelWrapper/SettingsButton.tsx"],"sourcesContent":["import { IconButton } from '@apia/components';\nimport { getLabel, useImperativeComponentEvents } from '@apia/util';\nimport { useCallback, useState } from 'react';\nimport { usePanelConfig } from '../../../config/usePanelConfig';\nimport { usePanelActions } from '../../../actions';\nimport { panelButtonsActions } from './PanelButtons';\nimport { usePanelIdentity } from '../../../common';\n\nexport const SettingsButton = (props: { title: string }) => {\n const { panelId } = usePanelIdentity();\n const configure = usePanelConfig();\n\n const [isDisabled, setIsDisabled] = useState(false);\n useImperativeComponentEvents({\n disable(newDisabledValue: boolean) {\n setIsDisabled(newDisabledValue);\n },\n });\n\n usePanelActions({\n refresh() {\n panelButtonsActions(panelId, 'disable', false);\n },\n });\n\n const openSettings = useCallback(() => {\n try {\n configure();\n } catch (e) {}\n }, [configure]);\n\n return (\n <IconButton\n icon=\"Settings\"\n size=\"Md\"\n variant=\"buttons.icon-outline\"\n className=\"panel__iconButton\"\n onClick={openSettings}\n title={getLabel('lblOpenPnlConf', { text: { TOK1: props.title } }).text}\n disabled={isDisabled}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAQa,MAAA,cAAA,GAAiB,CAAC,KAA6B,KAAA;AAC1D,EAAM,MAAA,EAAE,OAAQ,EAAA,GAAI,gBAAiB,EAAA,CAAA;AACrC,EAAA,MAAM,YAAY,cAAe,EAAA,CAAA;AAEjC,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAClD,EAA6B,4BAAA,CAAA;AAAA,IAC3B,QAAQ,gBAA2B,EAAA;AACjC,MAAA,aAAA,CAAc,gBAAgB,CAAA,CAAA;AAAA,KAChC;AAAA,GACD,CAAA,CAAA;AAED,EAAgB,eAAA,CAAA;AAAA,IACd,OAAU,GAAA;AACR,MAAoB,mBAAA,CAAA,OAAA,EAAS,WAAW,KAAK,CAAA,CAAA;AAAA,KAC/C;AAAA,GACD,CAAA,CAAA;AAED,EAAM,MAAA,YAAA,GAAe,YAAY,MAAM;AACrC,IAAI,IAAA;AACF,MAAU,SAAA,EAAA,CAAA;AAAA,aACH,CAAG,EAAA;AAAA,KAAC;AAAA,GACf,EAAG,CAAC,SAAS,CAAC,CAAA,CAAA;AAEd,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,UAAA;AAAA,MACL,IAAK,EAAA,IAAA;AAAA,MACL,OAAQ,EAAA,sBAAA;AAAA,MACR,SAAU,EAAA,mBAAA;AAAA,MACV,OAAS,EAAA,YAAA;AAAA,MACT,KAAA,EAAO,QAAS,CAAA,gBAAA,EAAkB,EAAE,IAAA,EAAM,EAAE,IAAA,EAAM,KAAM,CAAA,KAAA,EAAQ,EAAC,CAAE,CAAA,IAAA;AAAA,MACnE,QAAU,EAAA,UAAA;AAAA,KAAA;AAAA,GACZ,CAAA;AAEJ;;;;"}
|