1
0
Fork 0
mirror of synced 2024-07-07 15:25:52 +12:00

Merge remote-tracking branch 'origin/master' into multistep-formblock-feedback

This commit is contained in:
Dean 2024-01-11 15:22:13 +00:00
commit 205dc7d690
5 changed files with 43 additions and 596 deletions

View file

@ -1,5 +1,5 @@
{ {
"version": "2.14.5", "version": "2.14.6",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*", "packages/*",

View file

@ -6,7 +6,7 @@
import { Helpers } from "@budibase/bbui" import { Helpers } from "@budibase/bbui"
import { derived, writable } from "svelte/store" import { derived, writable } from "svelte/store"
import { Utils } from "@budibase/frontend-core" import { Utils } from "@budibase/frontend-core"
import { cloneDeep } from "lodash" import { cloneDeep, isEqual } from "lodash"
export let componentInstance export let componentInstance
export let componentBindings export let componentBindings
@ -21,21 +21,32 @@
const currentStep = derived(multiStepStore, state => state.currentStep) const currentStep = derived(multiStepStore, state => state.currentStep)
const componentType = "@budibase/standard-components/multistepformblockstep" const componentType = "@budibase/standard-components/multistepformblockstep"
let cachedValue
let cachedInstance = {}
$: if (!isEqual(cachedValue, value)) {
cachedValue = value
}
$: if (!isEqual(componentInstance, cachedInstance)) {
cachedInstance = componentInstance
}
setContext("multi-step-form-block", multiStepStore) setContext("multi-step-form-block", multiStepStore)
$: stepCount = value?.length || 0 $: stepCount = cachedValue?.length || 0
$: updateStore(stepCount) $: updateStore(stepCount)
$: dataSource = getDatasourceForProvider($currentAsset, componentInstance) $: dataSource = getDatasourceForProvider($currentAsset, cachedInstance)
$: emitCurrentStep($currentStep) $: emitCurrentStep($currentStep)
$: stepLabel = getStepLabel($multiStepStore) $: stepLabel = getStepLabel($multiStepStore)
$: stepDef = getDefinition(stepLabel) $: stepDef = getDefinition(stepLabel)
$: stepSettings = value?.[$currentStep] || {} $: stepSettings = cachedValue?.[$currentStep] || {}
$: defaults = Utils.buildMultiStepFormBlockDefaultProps({ $: defaults = Utils.buildMultiStepFormBlockDefaultProps({
_id: componentInstance._id, _id: cachedInstance._id,
stepCount: $multiStepStore.stepCount, stepCount: $multiStepStore.stepCount,
currentStep: $multiStepStore.currentStep, currentStep: $multiStepStore.currentStep,
actionType: componentInstance.actionType, actionType: cachedInstance.actionType,
dataSource: componentInstance.dataSource, dataSource: cachedInstance.dataSource,
}) })
$: stepInstance = { $: stepInstance = {
_id: Helpers.uuid(), _id: Helpers.uuid(),

View file

@ -25,10 +25,10 @@
"manifest": "node ./scripts/gen-collection-info.js" "manifest": "node ./scripts/gen-collection-info.js"
}, },
"dependencies": { "dependencies": {
"@budibase/handlebars-helpers": "^0.11.11", "@budibase/handlebars-helpers": "^0.12.0",
"dayjs": "^1.10.8", "dayjs": "^1.10.8",
"handlebars": "^4.7.6", "handlebars": "^4.7.6",
"lodash": "4.17.21", "lodash.clonedeep": "^4.5.0",
"vm2": "^3.9.19" "vm2": "^3.9.19"
}, },
"devDependencies": { "devDependencies": {

View file

@ -1,5 +1,5 @@
const { atob } = require("../utilities") const { atob } = require("../utilities")
const { cloneDeep } = require("lodash/fp") const cloneDeep = require("lodash.clonedeep")
const { LITERAL_MARKER } = require("../helpers/constants") const { LITERAL_MARKER } = require("../helpers/constants")
const { getHelperList } = require("./list") const { getHelperList } = require("./list")

606
yarn.lock

File diff suppressed because it is too large Load diff