Treat component store the same as other stores, and move component utils into helpers
This commit is contained in:
parent
090460a8f5
commit
1650f37329
|
@ -1,9 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { Label, Select, Body, Multiselect } from "@budibase/bbui"
|
import { Label, Select, Body, Multiselect } from "@budibase/bbui"
|
||||||
import {
|
import { findAllMatchingComponents, findComponent } from "helpers/components"
|
||||||
findAllMatchingComponents,
|
|
||||||
findComponent,
|
|
||||||
} from "stores/builder/components/utils"
|
|
||||||
import { currentAsset } from "stores/builder"
|
import { currentAsset } from "stores/builder"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { selectedScreen } from "stores/builder"
|
import { selectedScreen } from "stores/builder"
|
||||||
import { findAllMatchingComponents } from "stores/builder/components/utils"
|
import { findAllMatchingComponents } from "helpers/components"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { Select, Label } from "@budibase/bbui"
|
import { Select, Label } from "@budibase/bbui"
|
||||||
import { currentAsset } from "stores/builder"
|
import { currentAsset } from "stores/builder"
|
||||||
import { findAllMatchingComponents } from "stores/builder/components/utils"
|
import { findAllMatchingComponents } from "helpers/components"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
getActionProviders,
|
getActionProviders,
|
||||||
buildFormSchema,
|
buildFormSchema,
|
||||||
} from "../../../../../../dataBinding"
|
} from "../../../../../../dataBinding"
|
||||||
import { findComponent } from "stores/builder/components/utils"
|
import { findComponent } from "helpers/components"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let nested
|
export let nested
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
getActionProviders,
|
getActionProviders,
|
||||||
buildFormSchema,
|
buildFormSchema,
|
||||||
} from "../../../../../../dataBinding"
|
} from "../../../../../../dataBinding"
|
||||||
import { findComponent } from "stores/builder/components/utils"
|
import { findComponent } from "helpers/components"
|
||||||
|
|
||||||
export let parameters
|
export let parameters
|
||||||
export let bindings = []
|
export let bindings = []
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { Select } from "@budibase/bbui"
|
import { Select } from "@budibase/bbui"
|
||||||
import { makePropSafe } from "@budibase/string-templates"
|
import { makePropSafe } from "@budibase/string-templates"
|
||||||
import { currentAsset } from "stores/builder"
|
import { currentAsset } from "stores/builder"
|
||||||
import { findAllMatchingComponents } from "stores/builder/components/utils"
|
import { findAllMatchingComponents } from "helpers/components"
|
||||||
|
|
||||||
export let value
|
export let value
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
|
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
|
||||||
import IntegrationQueryEditor from "components/integration/index.svelte"
|
import IntegrationQueryEditor from "components/integration/index.svelte"
|
||||||
import { makePropSafe as safe } from "@budibase/string-templates"
|
import { makePropSafe as safe } from "@budibase/string-templates"
|
||||||
import { findAllComponents } from "stores/builder/components/utils"
|
import { findAllComponents } from "helpers/components"
|
||||||
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
import ClientBindingPanel from "components/common/bindings/ClientBindingPanel.svelte"
|
||||||
import DataSourceCategory from "components/design/settings/controls/DataSourceSelect/DataSourceCategory.svelte"
|
import DataSourceCategory from "components/design/settings/controls/DataSourceSelect/DataSourceCategory.svelte"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import {
|
import {
|
||||||
findClosestMatchingComponent,
|
findClosestMatchingComponent,
|
||||||
findComponent,
|
findComponent,
|
||||||
} from "stores/builder/components/utils"
|
} from "helpers/components"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { ActionButton, notifications } from "@budibase/bbui"
|
import { ActionButton, notifications } from "@budibase/bbui"
|
||||||
import { currentAsset, componentStore } from "stores/builder"
|
import { currentAsset, componentStore } from "stores/builder"
|
||||||
import { findClosestMatchingComponent } from "stores/builder/components/utils"
|
import { findClosestMatchingComponent } from "helpers/components"
|
||||||
import { makeDatasourceFormComponents } from "../../../../templates/commonComponents"
|
import { makeDatasourceFormComponents } from "../../../../templates/commonComponents"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
DatePicker,
|
DatePicker,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import { currentAsset, selectedComponent } from "stores/builder"
|
import { currentAsset, selectedComponent } from "stores/builder"
|
||||||
import { findClosestMatchingComponent } from "stores/builder/components/utils"
|
import { findClosestMatchingComponent } from "helpers/components"
|
||||||
import {
|
import {
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
findAllMatchingComponents,
|
findAllMatchingComponents,
|
||||||
findComponent,
|
findComponent,
|
||||||
findComponentPath,
|
findComponentPath,
|
||||||
} from "stores/builder/components/utils"
|
} from "helpers/components"
|
||||||
import {
|
import {
|
||||||
currentAsset,
|
currentAsset,
|
||||||
componentStore,
|
componentStore,
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
encodeJSBinding,
|
encodeJSBinding,
|
||||||
findHBSBlocks,
|
findHBSBlocks,
|
||||||
} from "@budibase/string-templates"
|
} from "@budibase/string-templates"
|
||||||
import { capitalise } from "helpers"
|
import { capitalise } from "./index"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively searches for a specific component ID
|
* Recursively searches for a specific component ID
|
|
@ -1,4 +1,4 @@
|
||||||
import { findClosestMatchingComponent } from "stores/builder/components/utils"
|
import { findClosestMatchingComponent } from "helpers/components"
|
||||||
import {
|
import {
|
||||||
getDatasourceForProvider,
|
getDatasourceForProvider,
|
||||||
getSchemaForDatasource,
|
getSchemaForDatasource,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
import DesignSection from "./DesignSection.svelte"
|
import DesignSection from "./DesignSection.svelte"
|
||||||
import CustomStylesSection from "./CustomStylesSection.svelte"
|
import CustomStylesSection from "./CustomStylesSection.svelte"
|
||||||
import ConditionalUISection from "./ConditionalUISection.svelte"
|
import ConditionalUISection from "./ConditionalUISection.svelte"
|
||||||
import { getComponentName } from "stores/builder/components/utils"
|
import { getComponentName } from "helpers/components"
|
||||||
import {
|
import {
|
||||||
getBindableProperties,
|
getBindableProperties,
|
||||||
getComponentBindableProperties,
|
getComponentBindableProperties,
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
} from "stores/builder"
|
} from "stores/builder"
|
||||||
import * as routify from "@roxi/routify"
|
import * as routify from "@roxi/routify"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
import { findComponent } from "stores/builder/components/utils"
|
import { findComponent } from "helpers/components"
|
||||||
import ComponentSettingsPanel from "./_components/Component/ComponentSettingsPanel.svelte"
|
import ComponentSettingsPanel from "./_components/Component/ComponentSettingsPanel.svelte"
|
||||||
import NavigationPanel from "./_components/Navigation/index.svelte"
|
import NavigationPanel from "./_components/Navigation/index.svelte"
|
||||||
import ScreenSettingsPanel from "./_components/Screen/index.svelte"
|
import ScreenSettingsPanel from "./_components/Screen/index.svelte"
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
} from "stores/builder"
|
} from "stores/builder"
|
||||||
import { onMount } from "svelte"
|
import { onMount } from "svelte"
|
||||||
import { fly } from "svelte/transition"
|
import { fly } from "svelte/transition"
|
||||||
import { findComponentPath } from "stores/builder/components/utils"
|
import { findComponentPath } from "helpers/components"
|
||||||
|
|
||||||
let searchString
|
let searchString
|
||||||
let searchRef
|
let searchRef
|
||||||
|
|
|
@ -22,10 +22,7 @@
|
||||||
notifications,
|
notifications,
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import ErrorSVG from "@budibase/frontend-core/assets/error.svg?raw"
|
import ErrorSVG from "@budibase/frontend-core/assets/error.svg?raw"
|
||||||
import {
|
import { findComponent, findComponentPath } from "helpers/components"
|
||||||
findComponent,
|
|
||||||
findComponentPath,
|
|
||||||
} from "stores/builder/components/utils"
|
|
||||||
import { isActive, goto } from "@roxi/routify"
|
import { isActive, goto } from "@roxi/routify"
|
||||||
|
|
||||||
let iframe
|
let iframe
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
componentStore,
|
componentStore,
|
||||||
selectedComponent,
|
selectedComponent,
|
||||||
} from "stores/builder"
|
} from "stores/builder"
|
||||||
import { findComponent } from "stores/builder/components/utils"
|
import { findComponent } from "helpers/components"
|
||||||
import { goto, isActive } from "@roxi/routify"
|
import { goto, isActive } from "@roxi/routify"
|
||||||
import { notifications } from "@budibase/bbui"
|
import { notifications } from "@budibase/bbui"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
findComponentPath,
|
findComponentPath,
|
||||||
getComponentText,
|
getComponentText,
|
||||||
getComponentName,
|
getComponentName,
|
||||||
} from "stores/builder/components/utils"
|
} from "helpers/components"
|
||||||
import { get } from "svelte/store"
|
import { get } from "svelte/store"
|
||||||
import { dndStore } from "./dndStore"
|
import { dndStore } from "./dndStore"
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import { writable, get } from "svelte/store"
|
import { writable, get } from "svelte/store"
|
||||||
import {
|
import { findComponentParent, findComponentPath } from "helpers/components"
|
||||||
findComponentParent,
|
|
||||||
findComponentPath,
|
|
||||||
} from "stores/builder/components/utils"
|
|
||||||
import { selectedScreen, componentStore } from "stores/builder"
|
import { selectedScreen, componentStore } from "stores/builder"
|
||||||
|
|
||||||
export const DropPosition = {
|
export const DropPosition = {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
} from "@budibase/bbui"
|
} from "@budibase/bbui"
|
||||||
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
|
import ScreenDetailsModal from "components/design/ScreenDetailsModal.svelte"
|
||||||
import sanitizeUrl from "helpers/sanitizeUrl"
|
import sanitizeUrl from "helpers/sanitizeUrl"
|
||||||
import { makeComponentUnique } from "stores/builder/components/utils"
|
import { makeComponentUnique } from "helpers/components"
|
||||||
|
|
||||||
export let screenId
|
export let screenId
|
||||||
|
|
||||||
|
|
|
@ -11,18 +11,23 @@ import {
|
||||||
findComponentParent,
|
findComponentParent,
|
||||||
findAllMatchingComponents,
|
findAllMatchingComponents,
|
||||||
makeComponentUnique,
|
makeComponentUnique,
|
||||||
} from "stores/builder/components/utils"
|
} from "helpers/components"
|
||||||
import { getComponentFieldOptions } from "helpers/formFields"
|
import { getComponentFieldOptions } from "helpers/formFields"
|
||||||
import { selectedScreen } from "../screens"
|
import { selectedScreen } from "./screens"
|
||||||
import { screenStore, appStore, previewStore, tables } from "stores/builder"
|
import {
|
||||||
import { buildFormSchema, getSchemaForDatasource } from "../../../dataBinding"
|
screenStore,
|
||||||
|
appStore,
|
||||||
|
previewStore,
|
||||||
|
tables,
|
||||||
|
} from "stores/builder/index"
|
||||||
|
import { buildFormSchema, getSchemaForDatasource } from "../../dataBinding"
|
||||||
import {
|
import {
|
||||||
BUDIBASE_INTERNAL_DB_ID,
|
BUDIBASE_INTERNAL_DB_ID,
|
||||||
DEFAULT_BB_DATASOURCE_ID,
|
DEFAULT_BB_DATASOURCE_ID,
|
||||||
DB_TYPE_INTERNAL,
|
DB_TYPE_INTERNAL,
|
||||||
DB_TYPE_EXTERNAL,
|
DB_TYPE_EXTERNAL,
|
||||||
} from "constants/backend"
|
} from "constants/backend"
|
||||||
import BudiStore from "../BudiStore"
|
import BudiStore from "./BudiStore"
|
||||||
import { Utils } from "@budibase/frontend-core"
|
import { Utils } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export const INITIAL_COMPONENTS_STATE = {
|
export const INITIAL_COMPONENTS_STATE = {
|
|
@ -2,7 +2,7 @@ import { derived, get } from "svelte/store"
|
||||||
import { cloneDeep } from "lodash/fp"
|
import { cloneDeep } from "lodash/fp"
|
||||||
import { Helpers } from "@budibase/bbui"
|
import { Helpers } from "@budibase/bbui"
|
||||||
import { RoleUtils, Utils } from "@budibase/frontend-core"
|
import { RoleUtils, Utils } from "@budibase/frontend-core"
|
||||||
import { findAllMatchingComponents } from "stores/builder/components/utils"
|
import { findAllMatchingComponents } from "helpers/components"
|
||||||
import {
|
import {
|
||||||
layoutStore,
|
layoutStore,
|
||||||
appStore,
|
appStore,
|
||||||
|
|
Loading…
Reference in New Issue