@darajs/core 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +101 -0
- package/dist/actions/download-variable.d.ts +8 -0
- package/dist/actions/download-variable.d.ts.map +1 -0
- package/dist/actions/download-variable.js +140 -0
- package/dist/actions/download-variable.js.map +1 -0
- package/dist/actions/index.d.ts +7 -0
- package/dist/actions/index.d.ts.map +1 -0
- package/dist/actions/index.js +7 -0
- package/dist/actions/index.js.map +1 -0
- package/dist/actions/navigate-to.d.ts +8 -0
- package/dist/actions/navigate-to.d.ts.map +1 -0
- package/dist/actions/navigate-to.js +37 -0
- package/dist/actions/navigate-to.js.map +1 -0
- package/dist/actions/notify.d.ts +4 -0
- package/dist/actions/notify.d.ts.map +1 -0
- package/dist/actions/notify.js +11 -0
- package/dist/actions/notify.js.map +1 -0
- package/dist/actions/reset-variables.d.ts +8 -0
- package/dist/actions/reset-variables.d.ts.map +1 -0
- package/dist/actions/reset-variables.js +37 -0
- package/dist/actions/reset-variables.js.map +1 -0
- package/dist/actions/trigger-variable.d.ts +8 -0
- package/dist/actions/trigger-variable.d.ts.map +1 -0
- package/dist/actions/trigger-variable.js +14 -0
- package/dist/actions/trigger-variable.js.map +1 -0
- package/dist/actions/update-variable.d.ts +15 -0
- package/dist/actions/update-variable.d.ts.map +1 -0
- package/dist/actions/update-variable.js +56 -0
- package/dist/actions/update-variable.js.map +1 -0
- package/dist/api/core.d.ts +35 -0
- package/dist/api/core.d.ts.map +1 -0
- package/dist/api/core.js +112 -0
- package/dist/api/core.js.map +1 -0
- package/dist/api/http.d.ts +29 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/http.js +126 -0
- package/dist/api/http.js.map +1 -0
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +5 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/websocket.d.ts +222 -0
- package/dist/api/websocket.d.ts.map +1 -0
- package/dist/api/websocket.js +353 -0
- package/dist/api/websocket.js.map +1 -0
- package/dist/assets/causalens-dark.svg +29 -0
- package/dist/assets/causalens-light.svg +29 -0
- package/dist/assets/dara-dark.svg +20 -0
- package/dist/assets/dara-light.svg +15 -0
- package/dist/assets/fonts/Manrope-VariableFont_wght.ttf +0 -0
- package/dist/auth/auth-wrapper.d.ts +15 -0
- package/dist/auth/auth-wrapper.d.ts.map +1 -0
- package/dist/auth/auth-wrapper.js +72 -0
- package/dist/auth/auth-wrapper.js.map +1 -0
- package/dist/auth/auth.d.ts +61 -0
- package/dist/auth/auth.d.ts.map +1 -0
- package/dist/auth/auth.js +163 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/auth/basic/basic-auth-login.d.ts +6 -0
- package/dist/auth/basic/basic-auth-login.d.ts.map +1 -0
- package/dist/auth/basic/basic-auth-login.js +171 -0
- package/dist/auth/basic/basic-auth-login.js.map +1 -0
- package/dist/auth/basic/basic-auth-logout.d.ts +6 -0
- package/dist/auth/basic/basic-auth-logout.d.ts.map +1 -0
- package/dist/auth/basic/basic-auth-logout.js +18 -0
- package/dist/auth/basic/basic-auth-logout.js.map +1 -0
- package/dist/auth/default/default-auth-login.d.ts +6 -0
- package/dist/auth/default/default-auth-login.d.ts.map +1 -0
- package/dist/auth/default/default-auth-login.js +59 -0
- package/dist/auth/default/default-auth-login.js.map +1 -0
- package/dist/auth/index.d.ts +7 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/use-session-token.d.ts +19 -0
- package/dist/auth/use-session-token.d.ts.map +1 -0
- package/dist/auth/use-session-token.js +30 -0
- package/dist/auth/use-session-token.js.map +1 -0
- package/dist/components/fallback/default.d.ts +5 -0
- package/dist/components/fallback/default.d.ts.map +1 -0
- package/dist/components/fallback/default.js +10 -0
- package/dist/components/fallback/default.js.map +1 -0
- package/dist/components/fallback/dots.d.ts +7 -0
- package/dist/components/fallback/dots.d.ts.map +1 -0
- package/dist/components/fallback/dots.js +78 -0
- package/dist/components/fallback/dots.js.map +1 -0
- package/dist/components/fallback/row.d.ts +5 -0
- package/dist/components/fallback/row.d.ts.map +1 -0
- package/dist/components/fallback/row.js +14 -0
- package/dist/components/fallback/row.js.map +1 -0
- package/dist/components/for/for.d.ts +35 -0
- package/dist/components/for/for.d.ts.map +1 -0
- package/dist/components/for/for.js +44 -0
- package/dist/components/for/for.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/menu/menu.d.ts +14 -0
- package/dist/components/menu/menu.d.ts.map +1 -0
- package/dist/components/menu/menu.js +58 -0
- package/dist/components/menu/menu.js.map +1 -0
- package/dist/components/progress-tracker/progress-tracker.d.ts +18 -0
- package/dist/components/progress-tracker/progress-tracker.d.ts.map +1 -0
- package/dist/components/progress-tracker/progress-tracker.js +204 -0
- package/dist/components/progress-tracker/progress-tracker.js.map +1 -0
- package/dist/components/router-content/router-content.d.ts +14 -0
- package/dist/components/router-content/router-content.d.ts.map +1 -0
- package/dist/components/router-content/router-content.js +17 -0
- package/dist/components/router-content/router-content.js.map +1 -0
- package/dist/components/side-bar-frame/side-bar-frame.d.ts +21 -0
- package/dist/components/side-bar-frame/side-bar-frame.d.ts.map +1 -0
- package/dist/components/side-bar-frame/side-bar-frame.js +87 -0
- package/dist/components/side-bar-frame/side-bar-frame.js.map +1 -0
- package/dist/components/top-bar-frame/top-bar-frame.d.ts +16 -0
- package/dist/components/top-bar-frame/top-bar-frame.d.ts.map +1 -0
- package/dist/components/top-bar-frame/top-bar-frame.js +89 -0
- package/dist/components/top-bar-frame/top-bar-frame.js.map +1 -0
- package/dist/dara_core-0.4.8-py3-none-any.whl +0 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.d.ts +17 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.d.ts.map +1 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.js +37 -0
- package/dist/devtools/backend-errors/backend-errors-ctx.js.map +1 -0
- package/dist/devtools/backend-errors/backend-errors.d.ts +6 -0
- package/dist/devtools/backend-errors/backend-errors.d.ts.map +1 -0
- package/dist/devtools/backend-errors/backend-errors.js +57 -0
- package/dist/devtools/backend-errors/backend-errors.js.map +1 -0
- package/dist/devtools/backend-errors/error-display.d.ts +22 -0
- package/dist/devtools/backend-errors/error-display.d.ts.map +1 -0
- package/dist/devtools/backend-errors/error-display.js +101 -0
- package/dist/devtools/backend-errors/error-display.js.map +1 -0
- package/dist/devtools/backend-errors/index.d.ts +3 -0
- package/dist/devtools/backend-errors/index.d.ts.map +1 -0
- package/dist/devtools/backend-errors/index.js +3 -0
- package/dist/devtools/backend-errors/index.js.map +1 -0
- package/dist/devtools/devtools-content.d.ts +12 -0
- package/dist/devtools/devtools-content.d.ts.map +1 -0
- package/dist/devtools/devtools-content.js +73 -0
- package/dist/devtools/devtools-content.js.map +1 -0
- package/dist/devtools/devtools-context.d.ts +7 -0
- package/dist/devtools/devtools-context.d.ts.map +1 -0
- package/dist/devtools/devtools-context.js +9 -0
- package/dist/devtools/devtools-context.js.map +1 -0
- package/dist/devtools/devtools-wrapper.d.ts +8 -0
- package/dist/devtools/devtools-wrapper.d.ts.map +1 -0
- package/dist/devtools/devtools-wrapper.js +64 -0
- package/dist/devtools/devtools-wrapper.js.map +1 -0
- package/dist/devtools/devtools.d.ts +5 -0
- package/dist/devtools/devtools.d.ts.map +1 -0
- package/dist/devtools/devtools.js +10 -0
- package/dist/devtools/devtools.js.map +1 -0
- package/dist/devtools/floating-button.d.ts +23 -0
- package/dist/devtools/floating-button.d.ts.map +1 -0
- package/dist/devtools/floating-button.js +94 -0
- package/dist/devtools/floating-button.js.map +1 -0
- package/dist/devtools/index.d.ts +2 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/devtools/resizer.d.ts +18 -0
- package/dist/devtools/resizer.d.ts.map +1 -0
- package/dist/devtools/resizer.js +49 -0
- package/dist/devtools/resizer.js.map +1 -0
- package/dist/devtools/use-move.d.ts +21 -0
- package/dist/devtools/use-move.d.ts.map +1 -0
- package/dist/devtools/use-move.js +56 -0
- package/dist/devtools/use-move.js.map +1 -0
- package/dist/index.css +95 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/jest-setup.d.ts +2 -0
- package/dist/jest-setup.d.ts.map +1 -0
- package/dist/jest-setup.js +18 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/pages/error-page.d.ts +3 -0
- package/dist/pages/error-page.d.ts.map +1 -0
- package/dist/pages/error-page.js +32 -0
- package/dist/pages/error-page.js.map +1 -0
- package/dist/pages/sso-callback-page.d.ts +6 -0
- package/dist/pages/sso-callback-page.d.ts.map +1 -0
- package/dist/pages/sso-callback-page.js +8 -0
- package/dist/pages/sso-callback-page.js.map +1 -0
- package/dist/run.d.ts +22 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +40 -0
- package/dist/run.js.map +1 -0
- package/dist/shared/center/center.d.ts +5 -0
- package/dist/shared/center/center.d.ts.map +1 -0
- package/dist/shared/center/center.js +15 -0
- package/dist/shared/center/center.js.map +1 -0
- package/dist/shared/context/direction-context.d.ts +6 -0
- package/dist/shared/context/direction-context.d.ts.map +1 -0
- package/dist/shared/context/direction-context.js +4 -0
- package/dist/shared/context/direction-context.js.map +1 -0
- package/dist/shared/context/display-context.d.ts +13 -0
- package/dist/shared/context/display-context.d.ts.map +1 -0
- package/dist/shared/context/display-context.js +4 -0
- package/dist/shared/context/display-context.js.map +1 -0
- package/dist/shared/context/fallback-context.d.ts +11 -0
- package/dist/shared/context/fallback-context.d.ts.map +1 -0
- package/dist/shared/context/fallback-context.js +4 -0
- package/dist/shared/context/fallback-context.js.map +1 -0
- package/dist/shared/context/global-task-context.d.ts +40 -0
- package/dist/shared/context/global-task-context.d.ts.map +1 -0
- package/dist/shared/context/global-task-context.js +81 -0
- package/dist/shared/context/global-task-context.js.map +1 -0
- package/dist/shared/context/importers-context.d.ts +6 -0
- package/dist/shared/context/importers-context.d.ts.map +1 -0
- package/dist/shared/context/importers-context.js +4 -0
- package/dist/shared/context/importers-context.js.map +1 -0
- package/dist/shared/context/index.d.ts +10 -0
- package/dist/shared/context/index.d.ts.map +1 -0
- package/dist/shared/context/index.js +10 -0
- package/dist/shared/context/index.js.map +1 -0
- package/dist/shared/context/registries-context.d.ts +20 -0
- package/dist/shared/context/registries-context.d.ts.map +1 -0
- package/dist/shared/context/registries-context.js +8 -0
- package/dist/shared/context/registries-context.js.map +1 -0
- package/dist/shared/context/request-extras-context.d.ts +33 -0
- package/dist/shared/context/request-extras-context.d.ts.map +1 -0
- package/dist/shared/context/request-extras-context.js +55 -0
- package/dist/shared/context/request-extras-context.js.map +1 -0
- package/dist/shared/context/variable-context.d.ts +10 -0
- package/dist/shared/context/variable-context.d.ts.map +1 -0
- package/dist/shared/context/variable-context.js +4 -0
- package/dist/shared/context/variable-context.js.map +1 -0
- package/dist/shared/context/websocket-context.d.ts +7 -0
- package/dist/shared/context/websocket-context.d.ts.map +1 -0
- package/dist/shared/context/websocket-context.js +4 -0
- package/dist/shared/context/websocket-context.js.map +1 -0
- package/dist/shared/dynamic-component/clean-props.d.ts +6 -0
- package/dist/shared/dynamic-component/clean-props.d.ts.map +1 -0
- package/dist/shared/dynamic-component/clean-props.js +13 -0
- package/dist/shared/dynamic-component/clean-props.js.map +1 -0
- package/dist/shared/dynamic-component/dynamic-component.d.ts +16 -0
- package/dist/shared/dynamic-component/dynamic-component.d.ts.map +1 -0
- package/dist/shared/dynamic-component/dynamic-component.js +252 -0
- package/dist/shared/dynamic-component/dynamic-component.js.map +1 -0
- package/dist/shared/error-handling/error-display.d.ts +8 -0
- package/dist/shared/error-handling/error-display.d.ts.map +1 -0
- package/dist/shared/error-handling/error-display.js +94 -0
- package/dist/shared/error-handling/error-display.js.map +1 -0
- package/dist/shared/error-handling/index.d.ts +3 -0
- package/dist/shared/error-handling/index.d.ts.map +1 -0
- package/dist/shared/error-handling/index.js +3 -0
- package/dist/shared/error-handling/index.js.map +1 -0
- package/dist/shared/error-handling/types.d.ts +11 -0
- package/dist/shared/error-handling/types.d.ts.map +1 -0
- package/dist/shared/error-handling/types.js +9 -0
- package/dist/shared/error-handling/types.js.map +1 -0
- package/dist/shared/event-bus/event-bus.d.ts +27 -0
- package/dist/shared/event-bus/event-bus.d.ts.map +1 -0
- package/dist/shared/event-bus/event-bus.js +58 -0
- package/dist/shared/event-bus/event-bus.js.map +1 -0
- package/dist/shared/global-state-store.d.ts +54 -0
- package/dist/shared/global-state-store.d.ts.map +1 -0
- package/dist/shared/global-state-store.js +168 -0
- package/dist/shared/global-state-store.js.map +1 -0
- package/dist/shared/index.d.ts +12 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +10 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/interactivity/data-variable.d.ts +78 -0
- package/dist/shared/interactivity/data-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/data-variable.js +218 -0
- package/dist/shared/interactivity/data-variable.js.map +1 -0
- package/dist/shared/interactivity/derived-variable.d.ts +160 -0
- package/dist/shared/interactivity/derived-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/derived-variable.js +446 -0
- package/dist/shared/interactivity/derived-variable.js.map +1 -0
- package/dist/shared/interactivity/filtering.d.ts +9 -0
- package/dist/shared/interactivity/filtering.d.ts.map +1 -0
- package/dist/shared/interactivity/filtering.js +20 -0
- package/dist/shared/interactivity/filtering.js.map +1 -0
- package/dist/shared/interactivity/index.d.ts +10 -0
- package/dist/shared/interactivity/index.d.ts.map +1 -0
- package/dist/shared/interactivity/index.js +9 -0
- package/dist/shared/interactivity/index.js.map +1 -0
- package/dist/shared/interactivity/internal.d.ts +9 -0
- package/dist/shared/interactivity/internal.d.ts.map +1 -0
- package/dist/shared/interactivity/internal.js +11 -0
- package/dist/shared/interactivity/internal.js.map +1 -0
- package/dist/shared/interactivity/nested.d.ts +16 -0
- package/dist/shared/interactivity/nested.d.ts.map +1 -0
- package/dist/shared/interactivity/nested.js +54 -0
- package/dist/shared/interactivity/nested.js.map +1 -0
- package/dist/shared/interactivity/persistence.d.ts +43 -0
- package/dist/shared/interactivity/persistence.d.ts.map +1 -0
- package/dist/shared/interactivity/persistence.js +215 -0
- package/dist/shared/interactivity/persistence.js.map +1 -0
- package/dist/shared/interactivity/plain-variable.d.ts +17 -0
- package/dist/shared/interactivity/plain-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/plain-variable.js +222 -0
- package/dist/shared/interactivity/plain-variable.js.map +1 -0
- package/dist/shared/interactivity/resolve-value.d.ts +13 -0
- package/dist/shared/interactivity/resolve-value.d.ts.map +1 -0
- package/dist/shared/interactivity/resolve-value.js +36 -0
- package/dist/shared/interactivity/resolve-value.js.map +1 -0
- package/dist/shared/interactivity/resolve-variable.d.ts +18 -0
- package/dist/shared/interactivity/resolve-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/resolve-variable.js +46 -0
- package/dist/shared/interactivity/resolve-variable.js.map +1 -0
- package/dist/shared/interactivity/store.d.ts +76 -0
- package/dist/shared/interactivity/store.d.ts.map +1 -0
- package/dist/shared/interactivity/store.js +99 -0
- package/dist/shared/interactivity/store.js.map +1 -0
- package/dist/shared/interactivity/triggers.d.ts +31 -0
- package/dist/shared/interactivity/triggers.d.ts.map +1 -0
- package/dist/shared/interactivity/triggers.js +105 -0
- package/dist/shared/interactivity/triggers.js.map +1 -0
- package/dist/shared/interactivity/url-variable.d.ts +12 -0
- package/dist/shared/interactivity/url-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/url-variable.js +27 -0
- package/dist/shared/interactivity/url-variable.js.map +1 -0
- package/dist/shared/interactivity/use-any-variable.d.ts +8 -0
- package/dist/shared/interactivity/use-any-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-any-variable.js +39 -0
- package/dist/shared/interactivity/use-any-variable.js.map +1 -0
- package/dist/shared/interactivity/use-data-variable.d.ts +18 -0
- package/dist/shared/interactivity/use-data-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-data-variable.js +58 -0
- package/dist/shared/interactivity/use-data-variable.js.map +1 -0
- package/dist/shared/interactivity/use-refresh-selector.d.ts +5 -0
- package/dist/shared/interactivity/use-refresh-selector.d.ts.map +1 -0
- package/dist/shared/interactivity/use-refresh-selector.js +20 -0
- package/dist/shared/interactivity/use-refresh-selector.js.map +1 -0
- package/dist/shared/interactivity/use-server-component.d.ts +24 -0
- package/dist/shared/interactivity/use-server-component.d.ts.map +1 -0
- package/dist/shared/interactivity/use-server-component.js +256 -0
- package/dist/shared/interactivity/use-server-component.js.map +1 -0
- package/dist/shared/interactivity/use-variable-state.d.ts +9 -0
- package/dist/shared/interactivity/use-variable-state.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable-state.js +26 -0
- package/dist/shared/interactivity/use-variable-state.js.map +1 -0
- package/dist/shared/interactivity/use-variable-value.d.ts +33 -0
- package/dist/shared/interactivity/use-variable-value.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable-value.js +94 -0
- package/dist/shared/interactivity/use-variable-value.js.map +1 -0
- package/dist/shared/interactivity/use-variable.d.ts +12 -0
- package/dist/shared/interactivity/use-variable.d.ts.map +1 -0
- package/dist/shared/interactivity/use-variable.js +84 -0
- package/dist/shared/interactivity/use-variable.js.map +1 -0
- package/dist/shared/private-route/private-route.d.ts +19 -0
- package/dist/shared/private-route/private-route.d.ts.map +1 -0
- package/dist/shared/private-route/private-route.js +35 -0
- package/dist/shared/private-route/private-route.js.map +1 -0
- package/dist/shared/template-root/dynamic-context.d.ts +9 -0
- package/dist/shared/template-root/dynamic-context.d.ts.map +1 -0
- package/dist/shared/template-root/dynamic-context.js +29 -0
- package/dist/shared/template-root/dynamic-context.js.map +1 -0
- package/dist/shared/template-root/template-root.d.ts +12 -0
- package/dist/shared/template-root/template-root.d.ts.map +1 -0
- package/dist/shared/template-root/template-root.js +94 -0
- package/dist/shared/template-root/template-root.js.map +1 -0
- package/dist/shared/utils/clean-session-cache.d.ts +9 -0
- package/dist/shared/utils/clean-session-cache.d.ts.map +1 -0
- package/dist/shared/utils/clean-session-cache.js +19 -0
- package/dist/shared/utils/clean-session-cache.js.map +1 -0
- package/dist/shared/utils/embed.d.ts +22 -0
- package/dist/shared/utils/embed.d.ts.map +1 -0
- package/dist/shared/utils/embed.js +43 -0
- package/dist/shared/utils/embed.js.map +1 -0
- package/dist/shared/utils/get-icon.d.ts +9 -0
- package/dist/shared/utils/get-icon.d.ts.map +1 -0
- package/dist/shared/utils/get-icon.js +30 -0
- package/dist/shared/utils/get-icon.js.map +1 -0
- package/dist/shared/utils/hashing.d.ts +14 -0
- package/dist/shared/utils/hashing.d.ts.map +1 -0
- package/dist/shared/utils/hashing.js +26 -0
- package/dist/shared/utils/hashing.js.map +1 -0
- package/dist/shared/utils/index.d.ts +19 -0
- package/dist/shared/utils/index.d.ts.map +1 -0
- package/dist/shared/utils/index.js +17 -0
- package/dist/shared/utils/index.js.map +1 -0
- package/dist/shared/utils/inject-css.d.ts +12 -0
- package/dist/shared/utils/inject-css.d.ts.map +1 -0
- package/dist/shared/utils/inject-css.js +25 -0
- package/dist/shared/utils/inject-css.js.map +1 -0
- package/dist/shared/utils/is-js-component.d.ts +9 -0
- package/dist/shared/utils/is-js-component.d.ts.map +1 -0
- package/dist/shared/utils/is-js-component.js +11 -0
- package/dist/shared/utils/is-js-component.js.map +1 -0
- package/dist/shared/utils/normalization.d.ts +19 -0
- package/dist/shared/utils/normalization.d.ts.map +1 -0
- package/dist/shared/utils/normalization.js +121 -0
- package/dist/shared/utils/normalization.js.map +1 -0
- package/dist/shared/utils/resolve-theme.d.ts +9 -0
- package/dist/shared/utils/resolve-theme.d.ts.map +1 -0
- package/dist/shared/utils/resolve-theme.js +28 -0
- package/dist/shared/utils/resolve-theme.js.map +1 -0
- package/dist/shared/utils/templating.d.ts +24 -0
- package/dist/shared/utils/templating.d.ts.map +1 -0
- package/dist/shared/utils/templating.js +67 -0
- package/dist/shared/utils/templating.js.map +1 -0
- package/dist/shared/utils/use-action-registry.d.ts +11 -0
- package/dist/shared/utils/use-action-registry.d.ts.map +1 -0
- package/dist/shared/utils/use-action-registry.js +18 -0
- package/dist/shared/utils/use-action-registry.js.map +1 -0
- package/dist/shared/utils/use-action.d.ts +34 -0
- package/dist/shared/utils/use-action.d.ts.map +1 -0
- package/dist/shared/utils/use-action.js +314 -0
- package/dist/shared/utils/use-action.js.map +1 -0
- package/dist/shared/utils/use-component-registry.d.ts +11 -0
- package/dist/shared/utils/use-component-registry.d.ts.map +1 -0
- package/dist/shared/utils/use-component-registry.js +57 -0
- package/dist/shared/utils/use-component-registry.js.map +1 -0
- package/dist/shared/utils/use-component-styles.d.ts +24 -0
- package/dist/shared/utils/use-component-styles.d.ts.map +1 -0
- package/dist/shared/utils/use-component-styles.js +69 -0
- package/dist/shared/utils/use-component-styles.js.map +1 -0
- package/dist/shared/utils/use-defer-loadable.d.ts +8 -0
- package/dist/shared/utils/use-defer-loadable.d.ts.map +1 -0
- package/dist/shared/utils/use-defer-loadable.js +44 -0
- package/dist/shared/utils/use-defer-loadable.js.map +1 -0
- package/dist/shared/utils/use-interval.d.ts +9 -0
- package/dist/shared/utils/use-interval.d.ts.map +1 -0
- package/dist/shared/utils/use-interval.js +19 -0
- package/dist/shared/utils/use-interval.js.map +1 -0
- package/dist/shared/utils/use-previous.d.ts +10 -0
- package/dist/shared/utils/use-previous.d.ts.map +1 -0
- package/dist/shared/utils/use-previous.js +17 -0
- package/dist/shared/utils/use-previous.js.map +1 -0
- package/dist/shared/utils/use-url-sync.d.ts +20 -0
- package/dist/shared/utils/use-url-sync.d.ts.map +1 -0
- package/dist/shared/utils/use-url-sync.js +68 -0
- package/dist/shared/utils/use-url-sync.js.map +1 -0
- package/dist/shared/utils/use-window-title.d.ts +3 -0
- package/dist/shared/utils/use-window-title.d.ts.map +1 -0
- package/dist/shared/utils/use-window-title.js +14 -0
- package/dist/shared/utils/use-window-title.js.map +1 -0
- package/dist/shared/variable-state-provider/variable-state-provider.d.ts +10 -0
- package/dist/shared/variable-state-provider/variable-state-provider.d.ts.map +1 -0
- package/dist/shared/variable-state-provider/variable-state-provider.js +29 -0
- package/dist/shared/variable-state-provider/variable-state-provider.js.map +1 -0
- package/dist/shared/wrapper/wrapper.d.ts +7 -0
- package/dist/shared/wrapper/wrapper.d.ts.map +1 -0
- package/dist/shared/wrapper/wrapper.js +14 -0
- package/dist/shared/wrapper/wrapper.js.map +1 -0
- package/dist/types/auth.d.ts +15 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/auth.js +6 -0
- package/dist/types/auth.js.map +1 -0
- package/dist/types/core.d.ts +440 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +22 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/utils.d.ts +56 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +93 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/umd/dara.core.umd.js +86508 -0
- package/dist/umd/style.css +848 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +20 -0
- package/dist/utils.js.map +1 -0
- package/package.json +121 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2023 Impulse Innovations Ltd.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Dara Application Framework
|
|
2
|
+
|
|
3
|
+
<picture>
|
|
4
|
+
<source srcset="https://github.com/causalens/dara/blob/master/img/dara_dark.svg?raw=true" media="(prefers-color-scheme: dark)">
|
|
5
|
+
<img src="https://github.com/causalens/dara/blob/master/img/dara_light.svg?raw=true" alt="Dara Logo">
|
|
6
|
+
</picture>
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
10
|
+
[](https://pypi.org/project/dara-core/)
|
|
11
|
+
[](https://pypi.org/project/dara-core/)
|
|
12
|
+
[](https://www.npmjs.com/package/@darajs/components)
|
|
13
|
+
|
|
14
|
+
### Build decision apps in Python
|
|
15
|
+
|
|
16
|
+
_Tap into the power of causality by transforming data into interactive graphs and applications_
|
|
17
|
+
|
|
18
|
+
Dara is a dynamic application framework designed for creating interactive web apps with ease, all in pure Python. Over the past two years, Dara has fueled the development of hundreds of apps, now widely used and appreciated by both our customers and our in-house teams!
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
To get started with Dara, you can use the `create-dara-app` CLI tool to create a new app.
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install create-dara-app
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
You can also use [`pipx`](https://pypa.github.io/pipx/) to install the CLI tool in an isolated environment.
|
|
29
|
+
|
|
30
|
+
Then simply run the following command to create a new app.
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
create-dara-app
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
By default the CLI will attempt to scaffold your project with [`poetry`](https://python-poetry.org/) but will fall back to `pip` if `poetry` is not present. This can be overriden with `--packaging pip` or `--packaging poetry` flag.
|
|
37
|
+
|
|
38
|
+
After the project is created, you can run it with:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
cd my-dara-app
|
|
42
|
+
|
|
43
|
+
# with poetry installation
|
|
44
|
+
poetry run dara start
|
|
45
|
+
|
|
46
|
+
# with pip installation make sure to activate the new virtual environment
|
|
47
|
+
source .venv/bin/activate
|
|
48
|
+
dara start
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+

|
|
52
|
+
|
|
53
|
+
Note: `pip` installation uses [PEP 660](https://peps.python.org/pep-0660/) `pyproject.toml`-based editable installs which require `pip >= 21.3` and `setuptools >= 64.0.0`. You can upgrade both with:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
python -m pip install --upgrade pip
|
|
57
|
+
pip install --user --upgrade setuptools
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For more details check out our [Documentation](https://dara.causalens.com/docs/category/build-dara-apps).
|
|
61
|
+
|
|
62
|
+
## Dara App examples
|
|
63
|
+
|
|
64
|
+
Explore some of our favorite apps - a great way of getting started and getting to know the framework!
|
|
65
|
+
|
|
66
|
+
| Dara App | Description |
|
|
67
|
+
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
|  | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
|
|
69
|
+
|  | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
|
|
70
|
+
|  | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
|
|
71
|
+
|
|
72
|
+
Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
|
|
73
|
+
|
|
74
|
+
## Repository introduction
|
|
75
|
+
|
|
76
|
+
This repository covers the Dara Application Framework first-party packages.
|
|
77
|
+
|
|
78
|
+
- `dara-core`: The core of the Dara framework, this includes the core framework code for creating applications.
|
|
79
|
+
- `dara-components`: Components for the Dara Framework.
|
|
80
|
+
- `create-dara-app`: A CLI tool for creating new Dara applications.
|
|
81
|
+
|
|
82
|
+
And the supporting UI packages and tools.
|
|
83
|
+
|
|
84
|
+
- `eslint-config` - base ESLint configuration
|
|
85
|
+
- `prettier-config` - base Prettier configuration
|
|
86
|
+
- `stylelint-config` - base Stylelint configuration
|
|
87
|
+
- `styled-components` - styled-components theme
|
|
88
|
+
- `ui-causal-graph-editor` - causal graph editor component
|
|
89
|
+
- `ui-code-editor` - code editor component
|
|
90
|
+
- `ui-components` - base UI components
|
|
91
|
+
- `ui-hierarchy-viewer` - hierarchy viewer component
|
|
92
|
+
- `ui-icons` - icon components for Dara packages
|
|
93
|
+
- `ui-notifications` - notification components
|
|
94
|
+
- `ui-utils` - miscellaneous utility functions
|
|
95
|
+
- `ui-widgets` - widget components
|
|
96
|
+
|
|
97
|
+
More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/master/CONTRIBUTING.md) file.
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/master/LICENSE).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionHandler, DownloadVariableImpl } from '../types/core';
|
|
2
|
+
/**
|
|
3
|
+
* Frontend handler for DownloadVariable action
|
|
4
|
+
* Retrieves the variable value and downloads the variable as either a csv, json or xl file
|
|
5
|
+
*/
|
|
6
|
+
declare const DownloadVariable: ActionHandler<DownloadVariableImpl>;
|
|
7
|
+
export default DownloadVariable;
|
|
8
|
+
//# sourceMappingURL=download-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-variable.d.ts","sourceRoot":"","sources":["../../js/actions/download-variable.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAmHnE;;;GAGG;AACH,QAAA,MAAM,gBAAgB,EAAE,aAAa,CAAC,oBAAoB,CAoCzD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import * as xl from 'exceljs';
|
|
11
|
+
import { saveAs } from 'file-saver';
|
|
12
|
+
import { getVariableValue } from '../shared/interactivity/use-variable-value';
|
|
13
|
+
const createMatrixFromArrayOfObjects = (content) => {
|
|
14
|
+
const headings = [];
|
|
15
|
+
const indexes = {};
|
|
16
|
+
content.forEach((c) => {
|
|
17
|
+
Object.keys(c).forEach((k) => {
|
|
18
|
+
if (!headings.includes(k)) {
|
|
19
|
+
headings.push(k);
|
|
20
|
+
indexes[k] = headings.length - 1;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
const headingsLength = headings.length;
|
|
25
|
+
const matrix = [];
|
|
26
|
+
content.forEach((c) => {
|
|
27
|
+
const row = new Array(headingsLength);
|
|
28
|
+
Object.entries(c).forEach(([k, v]) => {
|
|
29
|
+
row[indexes[k]] = v;
|
|
30
|
+
});
|
|
31
|
+
matrix.push(row);
|
|
32
|
+
});
|
|
33
|
+
matrix.unshift(headings);
|
|
34
|
+
return matrix;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Process a cell value - convert it to a string and wrap in quotes if required
|
|
38
|
+
*/
|
|
39
|
+
const processCell = (cell) => {
|
|
40
|
+
let cellValue = cell === null ? '' : String(cell);
|
|
41
|
+
// Wrap the cell in quotes if it has a quote itself, a comma or a newline (outside of the 0 index)
|
|
42
|
+
if (cellValue.search(/("|,|\n)/g) > 0) {
|
|
43
|
+
cellValue = `"${cellValue}"`;
|
|
44
|
+
}
|
|
45
|
+
return cellValue;
|
|
46
|
+
};
|
|
47
|
+
const createCsvFromMatrix = (matrix) => {
|
|
48
|
+
const csv = matrix.map((col) => col.map((cell) => processCell(cell)).join(',')).join('\n');
|
|
49
|
+
const blob = new Blob([csv], { type: 'text/csv' });
|
|
50
|
+
return blob;
|
|
51
|
+
};
|
|
52
|
+
const createJsonBlob = (jso) => {
|
|
53
|
+
const json = JSON.stringify(jso, null, 2);
|
|
54
|
+
return new Blob([json], { type: 'application/json' });
|
|
55
|
+
};
|
|
56
|
+
const createXLFromMatrix = (name, matrix) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
+
const wb = new xl.Workbook();
|
|
58
|
+
const ws = wb.addWorksheet(name);
|
|
59
|
+
const columns = matrix[0].map((h) => ({
|
|
60
|
+
filterButton: true,
|
|
61
|
+
name: h,
|
|
62
|
+
}));
|
|
63
|
+
const rows = [...matrix];
|
|
64
|
+
rows.shift();
|
|
65
|
+
ws.addTable({
|
|
66
|
+
columns,
|
|
67
|
+
headerRow: true,
|
|
68
|
+
name: 'DataTable',
|
|
69
|
+
ref: 'B2',
|
|
70
|
+
rows,
|
|
71
|
+
style: {
|
|
72
|
+
showRowStripes: true,
|
|
73
|
+
theme: 'TableStyleMedium2',
|
|
74
|
+
},
|
|
75
|
+
totalsRow: false,
|
|
76
|
+
});
|
|
77
|
+
const buff = yield wb.xlsx.writeBuffer();
|
|
78
|
+
const blob = new Blob([buff], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
|
79
|
+
return blob;
|
|
80
|
+
});
|
|
81
|
+
const createMatrixFromValue = (val) => {
|
|
82
|
+
let isMatrix = false;
|
|
83
|
+
let isArrayOfObjects = false;
|
|
84
|
+
if (Array.isArray(val) && val.length > 0) {
|
|
85
|
+
const first = val[0];
|
|
86
|
+
if (Array.isArray(first)) {
|
|
87
|
+
isMatrix = true;
|
|
88
|
+
}
|
|
89
|
+
if (typeof val === 'object') {
|
|
90
|
+
isArrayOfObjects = true;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
if (isArrayOfObjects) {
|
|
94
|
+
return createMatrixFromArrayOfObjects(val);
|
|
95
|
+
}
|
|
96
|
+
if (isMatrix) {
|
|
97
|
+
return val;
|
|
98
|
+
}
|
|
99
|
+
return undefined;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Frontend handler for DownloadVariable action
|
|
103
|
+
* Retrieves the variable value and downloads the variable as either a csv, json or xl file
|
|
104
|
+
*/
|
|
105
|
+
const DownloadVariable = (ctx, actionImpl) => __awaiter(void 0, void 0, void 0, function* () {
|
|
106
|
+
let value = getVariableValue(actionImpl.variable, true, {
|
|
107
|
+
client: ctx.wsClient,
|
|
108
|
+
extras: ctx.extras,
|
|
109
|
+
search: ctx.location.search,
|
|
110
|
+
snapshot: ctx.snapshot,
|
|
111
|
+
taskContext: ctx.taskCtx,
|
|
112
|
+
});
|
|
113
|
+
if (value instanceof Promise) {
|
|
114
|
+
value = yield value;
|
|
115
|
+
}
|
|
116
|
+
// strip the __index__ column from data vars
|
|
117
|
+
if (actionImpl.variable.__typename === 'DataVariable' || actionImpl.variable.__typename === 'DerivedDataVariable') {
|
|
118
|
+
for (const row of value) {
|
|
119
|
+
if ('__index__' in row) {
|
|
120
|
+
delete row.__index__;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const fileName = actionImpl.file_name || 'Data';
|
|
125
|
+
const fileNameWithExt = `${fileName}.${actionImpl.type}`;
|
|
126
|
+
if (actionImpl.type === 'json') {
|
|
127
|
+
const blob = createJsonBlob(value);
|
|
128
|
+
saveAs(blob, fileNameWithExt);
|
|
129
|
+
return Promise.resolve();
|
|
130
|
+
}
|
|
131
|
+
const matrix = createMatrixFromValue(value);
|
|
132
|
+
if (!matrix) {
|
|
133
|
+
throw new Error('Unable to create matrix from value');
|
|
134
|
+
}
|
|
135
|
+
const notExcel = !actionImpl.type || actionImpl.type !== 'xlsx';
|
|
136
|
+
const blob = notExcel ? createCsvFromMatrix(matrix) : yield createXLFromMatrix(fileName, matrix);
|
|
137
|
+
saveAs(blob, fileNameWithExt);
|
|
138
|
+
});
|
|
139
|
+
export default DownloadVariable;
|
|
140
|
+
//# sourceMappingURL=download-variable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-variable.js","sourceRoot":"","sources":["../../js/actions/download-variable.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAG7E,MAAM,8BAA8B,GAAG,CAAC,OAAmC,EAAW,EAAE;IACpF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;QAClB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YACzB,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;gBACxB,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;YACrC,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC;IAEvC,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,OAAO,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AAC,UAAU,KAAK,qBAAqB,EAAE,CAAC;QAChH,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE,CAAC;YACtB,IAAI,WAAW,IAAI,GAAG,EAAE,CAAC;gBACrB,OAAO,GAAG,CAAC,SAAS,CAAC;YACzB,CAAC;QACL,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,IAAI,MAAM,CAAC;IAChD,MAAM,eAAe,GAAG,GAAG,QAAQ,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;IACzD,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAC9B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IACD,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC5C,IAAI,CAAC,MAAM,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,CAAC;IAChE,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACjG,MAAM,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;AAClC,CAAC,CAAA,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as NavigateTo } from './navigate-to';
|
|
2
|
+
export { default as ResetVariables } from './reset-variables';
|
|
3
|
+
export { default as TriggerVariable } from './trigger-variable';
|
|
4
|
+
export { default as UpdateVariable } from './update-variable';
|
|
5
|
+
export { default as DownloadVariable } from './download-variable';
|
|
6
|
+
export { default as Notify } from './notify';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../js/actions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as NavigateTo } from './navigate-to';
|
|
2
|
+
export { default as ResetVariables } from './reset-variables';
|
|
3
|
+
export { default as TriggerVariable } from './trigger-variable';
|
|
4
|
+
export { default as UpdateVariable } from './update-variable';
|
|
5
|
+
export { default as DownloadVariable } from './download-variable';
|
|
6
|
+
export { default as Notify } from './notify';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../js/actions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionHandler, NavigateToImpl } from '../types/core';
|
|
2
|
+
/**
|
|
3
|
+
* Front-end handler for NavigateTo action.
|
|
4
|
+
* Navigates to a specified URL.
|
|
5
|
+
*/
|
|
6
|
+
declare const NavigateTo: ActionHandler<NavigateToImpl>;
|
|
7
|
+
export default NavigateTo;
|
|
8
|
+
//# sourceMappingURL=navigate-to.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigate-to.d.ts","sourceRoot":"","sources":["../../js/actions/navigate-to.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAwB7D;;;GAGG;AACH,QAAA,MAAM,UAAU,EAAE,aAAa,CAAC,cAAc,CAY7C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check whether the passed url is a valid url
|
|
3
|
+
*
|
|
4
|
+
* @param url the url to check
|
|
5
|
+
*/
|
|
6
|
+
function isValidHttpUrl(url) {
|
|
7
|
+
// Check if the url starts with a slash, which is a valid relative url
|
|
8
|
+
if (url.startsWith('/')) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
let newUrl;
|
|
12
|
+
try {
|
|
13
|
+
newUrl = new URL(url);
|
|
14
|
+
}
|
|
15
|
+
catch (_a) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
return newUrl.protocol === 'http:' || newUrl.protocol === 'https:';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Front-end handler for NavigateTo action.
|
|
22
|
+
* Navigates to a specified URL.
|
|
23
|
+
*/
|
|
24
|
+
const NavigateTo = (ctx, actionImpl) => {
|
|
25
|
+
const isValidUrl = isValidHttpUrl(actionImpl.url);
|
|
26
|
+
if (!isValidUrl) {
|
|
27
|
+
throw new Error(`Invalid URL: ${actionImpl.url}`);
|
|
28
|
+
}
|
|
29
|
+
if (actionImpl.new_tab) {
|
|
30
|
+
window.open(actionImpl.url, actionImpl.new_tab ? '_blank' : undefined);
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
ctx.history.push(actionImpl.url);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export default NavigateTo;
|
|
37
|
+
//# sourceMappingURL=navigate-to.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigate-to.js","sourceRoot":"","sources":["../../js/actions/navigate-to.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAW;IAC/B,sEAAsE;IACtE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI,MAAM,CAAC;IAEX,IAAI,CAAC;QACD,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,MAAM,CAAC,QAAQ,KAAK,OAAO,IAAI,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC;AACvE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,GAAkC,CAAC,GAAG,EAAE,UAAU,EAAQ,EAAE;IACxE,MAAM,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAElD,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,gBAAgB,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;SAAM,CAAC;QACJ,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;AACL,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../js/actions/notify.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzD,QAAA,MAAM,MAAM,EAAE,aAAa,CAAC,UAAU,CAOrC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const Notify = (ctx, actionImpl) => {
|
|
2
|
+
var _a;
|
|
3
|
+
ctx.notificationCtx.pushNotification({
|
|
4
|
+
key: (_a = actionImpl.key) !== null && _a !== void 0 ? _a : actionImpl.title,
|
|
5
|
+
message: actionImpl.message,
|
|
6
|
+
status: actionImpl.status,
|
|
7
|
+
title: actionImpl.title,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export default Notify;
|
|
11
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","sourceRoot":"","sources":["../../js/actions/notify.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAA8B,CAAC,GAAG,EAAE,UAAU,EAAQ,EAAE;;IAChE,GAAG,CAAC,eAAe,CAAC,gBAAgB,CAAC;QACjC,GAAG,EAAE,MAAA,UAAU,CAAC,GAAG,mCAAI,UAAU,CAAC,KAAK;QACvC,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,KAAK,EAAE,UAAU,CAAC,KAAK;KAC1B,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionHandler, ResetVariablesImpl } from '../types/core';
|
|
2
|
+
/**
|
|
3
|
+
* Front-end handler for ResetVariables action.
|
|
4
|
+
* Sequentially resets variables to their default values (or forces a recalculation for DerivedVariables)
|
|
5
|
+
*/
|
|
6
|
+
declare const ResetVariables: ActionHandler<ResetVariablesImpl>;
|
|
7
|
+
export default ResetVariables;
|
|
8
|
+
//# sourceMappingURL=reset-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-variables.d.ts","sourceRoot":"","sources":["../../js/actions/reset-variables.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGjE;;;GAGG;AACH,QAAA,MAAM,cAAc,EAAE,aAAa,CAAC,kBAAkB,CA0BrD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { getOrRegisterPlainVariable } from '../shared/interactivity/plain-variable';
|
|
2
|
+
import { getOrRegisterTrigger } from '../shared/interactivity/triggers';
|
|
3
|
+
import { getOrRegisterUrlVariable } from '../shared/interactivity/url-variable';
|
|
4
|
+
import { isDataVariable, isDerivedDataVariable, isDerivedVariable, isUrlVariable, isVariable } from '../types/utils';
|
|
5
|
+
/**
|
|
6
|
+
* Front-end handler for ResetVariables action.
|
|
7
|
+
* Sequentially resets variables to their default values (or forces a recalculation for DerivedVariables)
|
|
8
|
+
*/
|
|
9
|
+
const ResetVariables = (ctx, actionImpl) => {
|
|
10
|
+
actionImpl.variables.filter(isVariable).forEach((variable) => {
|
|
11
|
+
// For DVs, trigger their recalculation
|
|
12
|
+
if (isDerivedVariable(variable) || isDerivedDataVariable(variable)) {
|
|
13
|
+
const triggerAtom = getOrRegisterTrigger(variable);
|
|
14
|
+
ctx.set(triggerAtom, (triggerIndexValue) => ({
|
|
15
|
+
force: true,
|
|
16
|
+
inc: triggerIndexValue.inc + 1,
|
|
17
|
+
}));
|
|
18
|
+
}
|
|
19
|
+
else if (isUrlVariable(variable)) {
|
|
20
|
+
// For UrlVariables, we use set instead of reset to update the URL as well; otherwise just the atom is reset
|
|
21
|
+
const urlAtom = getOrRegisterUrlVariable(variable);
|
|
22
|
+
ctx.set(urlAtom, variable.default);
|
|
23
|
+
ctx.eventBus.publish('URL_VARIABLE_LOADED', { variable, value: variable.default });
|
|
24
|
+
}
|
|
25
|
+
else if (isDataVariable(variable)) {
|
|
26
|
+
// for data variables this is a noop
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// For plain variables reset them to default values
|
|
30
|
+
const plainAtom = getOrRegisterPlainVariable(variable, ctx.wsClient, ctx.taskCtx, ctx.extras);
|
|
31
|
+
ctx.reset(plainAtom);
|
|
32
|
+
ctx.eventBus.publish('PLAIN_VARIABLE_LOADED', { variable, value: variable.default });
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export default ResetVariables;
|
|
37
|
+
//# sourceMappingURL=reset-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reset-variables.js","sourceRoot":"","sources":["../../js/actions/reset-variables.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEpH;;;GAGG;AACH,MAAM,cAAc,GAAsC,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;IAC1E,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAA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ableImpl } from '../types/core';
|
|
2
|
+
/**
|
|
3
|
+
* Front-end handler for TriggerVariable action.
|
|
4
|
+
* Forces the recalculation of a particular DerivedVariable.
|
|
5
|
+
*/
|
|
6
|
+
declare const TriggerVariable: ActionHandler<TriggerVariableImpl>;
|
|
7
|
+
export default TriggerVariable;
|
|
8
|
+
//# sourceMappingURL=trigger-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-variable.d.ts","sourceRoot":"","sources":["../../js/actions/trigger-variable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAElE;;;GAGG;AACH,QAAA,MAAM,eAAe,EAAE,aAAa,CAAC,mBAAmB,CAOvD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|