commit
3f73e109ca
|
@ -12,6 +12,5 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="bb-margin-m">
|
<div class="bb-margin-m">
|
||||||
<Label small forAttr={'datepicker-label'}>{label}</Label>
|
|
||||||
<DatePicker placeholder={label} on:change={onChange} {value} />
|
<DatePicker placeholder={label} on:change={onChange} {value} />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -71,7 +71,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function addFilter() {
|
function addFilter() {
|
||||||
view.filters = [...view.filters, {}]
|
view.filters.push({})
|
||||||
|
view.filters = view.filters
|
||||||
|
}
|
||||||
|
|
||||||
|
function isMultipleChoice(field) {
|
||||||
|
return (
|
||||||
|
viewModel.schema[field].constraints &&
|
||||||
|
viewModel.schema[field].constraints.inclusion &&
|
||||||
|
viewModel.schema[field].constraints.inclusion.length
|
||||||
|
)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -108,10 +117,18 @@
|
||||||
<option value={condition.key}>{condition.name}</option>
|
<option value={condition.key}>{condition.name}</option>
|
||||||
{/each}
|
{/each}
|
||||||
</Select>
|
</Select>
|
||||||
<Input
|
{#if filter.key && isMultipleChoice(filter.key)}
|
||||||
thin
|
<Select secondary thin bind:value={filter.value}>
|
||||||
placeholder={filter.key || fields[0]}
|
{#each viewModel.schema[filter.key].constraints.inclusion as option}
|
||||||
bind:value={filter.value} />
|
<option value={option}>{option}</option>
|
||||||
|
{/each}
|
||||||
|
</Select>
|
||||||
|
{:else}
|
||||||
|
<Input
|
||||||
|
thin
|
||||||
|
placeholder={filter.key || fields[0]}
|
||||||
|
bind:value={filter.value} />
|
||||||
|
{/if}
|
||||||
<i class="ri-close-circle-fill" on:click={() => removeFilter(idx)} />
|
<i class="ri-close-circle-fill" on:click={() => removeFilter(idx)} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -41,7 +41,6 @@
|
||||||
([field, message]) => `${field} ${message}`
|
([field, message]) => `${field} ${message}`
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
async function fetchModel() {
|
async function fetchModel() {
|
||||||
const FETCH_MODEL_URL = `/api/models/${model}`
|
const FETCH_MODEL_URL = `/api/models/${model}`
|
||||||
const response = await _bb.api.get(FETCH_MODEL_URL)
|
const response = await _bb.api.get(FETCH_MODEL_URL)
|
||||||
|
|
Loading…
Reference in New Issue