|
|
@ -32,7 +32,7 @@ export const getBindableProperties = (asset, componentId) => { |
|
|
const urlBindings = getUrlBindings(asset) |
|
|
const urlBindings = getUrlBindings(asset) |
|
|
const deviceBindings = getDeviceBindings() |
|
|
const deviceBindings = getDeviceBindings() |
|
|
const stateBindings = getStateBindings() |
|
|
const stateBindings = getStateBindings() |
|
|
const rowBindings = getRowBindings() |
|
|
const rowBindings = getRowBindings(asset, componentId) |
|
|
return [ |
|
|
return [ |
|
|
...contextBindings, |
|
|
...contextBindings, |
|
|
...urlBindings, |
|
|
...urlBindings, |
|
|
@ -321,16 +321,21 @@ const getDeviceBindings = () => { |
|
|
* Gets all row bindings that are globally available. |
|
|
* Gets all row bindings that are globally available. |
|
|
*/ |
|
|
*/ |
|
|
const getRowBindings = () => { |
|
|
const getRowBindings = () => { |
|
|
|
|
|
let tables = [] |
|
|
|
|
|
getAllAssets().forEach(asset => { |
|
|
|
|
|
tables = findAllMatchingComponents(asset.props, component => |
|
|
|
|
|
component._component.endsWith("table") |
|
|
|
|
|
) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
let bindings = [] |
|
|
let bindings = [] |
|
|
if (get(store).clientFeatures?.rowSelection) { |
|
|
if (get(store).clientFeatures?.rowSelection) { |
|
|
const safeState = makePropSafe("rowSelection") |
|
|
const safeState = makePropSafe("rowSelection") |
|
|
bindings = [ |
|
|
bindings = tables.map(table => ({ |
|
|
{ |
|
|
type: "context", |
|
|
type: "context", |
|
|
runtimeBinding: `${safeState}.${makePropSafe(table._id)}`, |
|
|
runtimeBinding: `${safeState}`, |
|
|
readableBinding: `${table._instanceName}.Rows`, |
|
|
readableBinding: "Row Selection.Rows", |
|
|
})) |
|
|
}, |
|
|
|
|
|
] |
|
|
|
|
|
} |
|
|
} |
|
|
return bindings |
|
|
return bindings |
|
|
} |
|
|
} |
|
|
@ -340,8 +345,8 @@ const getRowBindings = () => { |
|
|
*/ |
|
|
*/ |
|
|
const getStateBindings = () => { |
|
|
const getStateBindings = () => { |
|
|
let bindings = [] |
|
|
let bindings = [] |
|
|
if (get(store).clientFeatures?.rowSelection) { |
|
|
if (get(store).clientFeatures?.state) { |
|
|
const safeState = makePropSafe("rowSelection") |
|
|
const safeState = makePropSafe("state") |
|
|
bindings = getAllStateVariables().map(key => ({ |
|
|
bindings = getAllStateVariables().map(key => ({ |
|
|
type: "context", |
|
|
type: "context", |
|
|
runtimeBinding: `${safeState}.${makePropSafe(key)}`, |
|
|
runtimeBinding: `${safeState}.${makePropSafe(key)}`, |
|
|
@ -617,14 +622,9 @@ const buildFormSchema = component => { |
|
|
* in the app. |
|
|
* in the app. |
|
|
*/ |
|
|
*/ |
|
|
export const getAllStateVariables = () => { |
|
|
export const getAllStateVariables = () => { |
|
|
// Get all component containing assets
|
|
|
|
|
|
let allAssets = [] |
|
|
|
|
|
allAssets = allAssets.concat(get(store).layouts || []) |
|
|
|
|
|
allAssets = allAssets.concat(get(store).screens || []) |
|
|
|
|
|
|
|
|
|
|
|
// Find all button action settings in all components
|
|
|
// Find all button action settings in all components
|
|
|
let eventSettings = [] |
|
|
let eventSettings = [] |
|
|
allAssets.forEach(asset => { |
|
|
getAllAssets().forEach(asset => { |
|
|
findAllMatchingComponents(asset.props, component => { |
|
|
findAllMatchingComponents(asset.props, component => { |
|
|
const settings = getComponentSettings(component._component) |
|
|
const settings = getComponentSettings(component._component) |
|
|
settings |
|
|
settings |
|
|
@ -655,6 +655,15 @@ export const getAllStateVariables = () => { |
|
|
return Array.from(bindingSet) |
|
|
return Array.from(bindingSet) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export const getAllAssets = () => { |
|
|
|
|
|
// Get all component containing assets
|
|
|
|
|
|
let allAssets = [] |
|
|
|
|
|
allAssets = allAssets.concat(get(store).layouts || []) |
|
|
|
|
|
allAssets = allAssets.concat(get(store).screens || []) |
|
|
|
|
|
|
|
|
|
|
|
return allAssets |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Recurses the input object to remove any instances of bindings. |
|
|
* Recurses the input object to remove any instances of bindings. |
|
|
*/ |
|
|
*/ |
|
|
|