mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 14:46:01 +00:00
fixed TS + code tidy
This commit is contained in:
26
packages/web/src/macro/MacroParameters.svelte
Normal file
26
packages/web/src/macro/MacroParameters.svelte
Normal file
@@ -0,0 +1,26 @@
|
||||
<script lang="ts">
|
||||
import _ from 'lodash';
|
||||
import { getContext } from 'svelte';
|
||||
import { writable } from 'svelte/store';
|
||||
import FormArgumentList from '../forms/FormArgumentList.svelte';
|
||||
import FormProviderCore from '../forms/FormProviderCore.svelte';
|
||||
import FormFieldTemplateRow from '../forms/FormFieldTemplateRow.svelte';
|
||||
|
||||
export let args = [];
|
||||
const macroValues = getContext('macroValues');
|
||||
export let namePrefix;
|
||||
// export let onChangeValues;
|
||||
|
||||
// const initialValues = {
|
||||
// ..._.fromPairs(args.filter(x => x.default != null).map(x => [`${namePrefix}${x.name}`, x.default])),
|
||||
// ...macroValues,
|
||||
// };
|
||||
|
||||
// const values = writable(initialValues);
|
||||
|
||||
// $: if (onChangeValues) onChangeValues($values);
|
||||
</script>
|
||||
|
||||
<FormProviderCore values={macroValues} template={FormFieldTemplateRow}>
|
||||
<FormArgumentList {args} {namePrefix} />
|
||||
</FormProviderCore>
|
||||
Reference in New Issue
Block a user