Code review updates
This commit is contained in:
parent
91e63ca2c9
commit
806d832dff
|
@ -3163,7 +3163,6 @@
|
||||||
"styles": [
|
"styles": [
|
||||||
"size"
|
"size"
|
||||||
],
|
],
|
||||||
"draggable": true,
|
|
||||||
"illegalChildren": [
|
"illegalChildren": [
|
||||||
"section"
|
"section"
|
||||||
],
|
],
|
||||||
|
@ -3181,7 +3180,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"label": "Button",
|
"label": "Button text",
|
||||||
"key": "scanButtonText"
|
"key": "scanButtonText"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -4450,7 +4449,9 @@
|
||||||
"formblock": {
|
"formblock": {
|
||||||
"name": "Form Block",
|
"name": "Form Block",
|
||||||
"icon": "Form",
|
"icon": "Form",
|
||||||
"styles": ["size"],
|
"styles": [
|
||||||
|
"size"
|
||||||
|
],
|
||||||
"block": true,
|
"block": true,
|
||||||
"info": "Form blocks are only compatible with internal or SQL tables",
|
"info": "Form blocks are only compatible with internal or SQL tables",
|
||||||
"settings": [
|
"settings": [
|
||||||
|
@ -4458,7 +4459,11 @@
|
||||||
"type": "select",
|
"type": "select",
|
||||||
"label": "Type",
|
"label": "Type",
|
||||||
"key": "actionType",
|
"key": "actionType",
|
||||||
"options": ["Create", "Update", "View"],
|
"options": [
|
||||||
|
"Create",
|
||||||
|
"Update",
|
||||||
|
"View"
|
||||||
|
],
|
||||||
"defaultValue": "Create"
|
"defaultValue": "Create"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
export let value
|
export let value
|
||||||
export let disabled = false
|
export let disabled = false
|
||||||
export let allowManualEntry = false
|
export let allowManualEntry = false
|
||||||
export let scanButtonText = "Scan Code"
|
export let scanButtonText = "Scan code"
|
||||||
|
|
||||||
import { createEventDispatcher } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
@ -161,17 +161,17 @@
|
||||||
|
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<div class="footer-buttons">
|
<div class="footer-buttons">
|
||||||
{#if allowManualEntry}
|
{#if allowManualEntry && !manualMode}
|
||||||
<Button
|
<Button
|
||||||
group
|
group
|
||||||
secondary
|
secondary
|
||||||
newStyles
|
newStyles
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
manualMode = !manualMode
|
manualMode = true
|
||||||
camModal.hide()
|
camModal.hide()
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Enter Manually
|
Enter manually
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@
|
||||||
<style>
|
<style>
|
||||||
#reader :global(video) {
|
#reader :global(video) {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: var(--border-light-2);
|
border: 2px solid var(--spectrum-global-color-gray-300);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.field-display :global(.spectrum-Tags-item) {
|
.field-display :global(.spectrum-Tags-item) {
|
||||||
|
@ -219,7 +219,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
border: var(--border-light-2);
|
border: 2px solid var(--spectrum-global-color-gray-300);
|
||||||
background-color: var(--spectrum-global-color-gray-200);
|
background-color: var(--spectrum-global-color-gray-200);
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: var(--spectrum-global-dimension-static-size-200);
|
gap: var(--spectrum-global-dimension-static-size-200);
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import Field from "./Field.svelte"
|
import Field from "./Field.svelte"
|
||||||
import CodeScanner from "../CodeScanner.svelte"
|
import CodeScanner from "./CodeScanner.svelte"
|
||||||
|
|
||||||
export let field
|
export let field
|
||||||
export let label
|
export let label
|
||||||
|
@ -15,6 +15,8 @@
|
||||||
let fieldState
|
let fieldState
|
||||||
let fieldApi
|
let fieldApi
|
||||||
|
|
||||||
|
$: scanText = scanButtonText || "Scan code"
|
||||||
|
|
||||||
const handleUpdate = e => {
|
const handleUpdate = e => {
|
||||||
const changed = fieldApi.setValue(e.detail)
|
const changed = fieldApi.setValue(e.detail)
|
||||||
if (onChange && changed) {
|
if (onChange && changed) {
|
||||||
|
@ -39,7 +41,7 @@
|
||||||
on:change={handleUpdate}
|
on:change={handleUpdate}
|
||||||
disabled={fieldState.disabled}
|
disabled={fieldState.disabled}
|
||||||
{allowManualEntry}
|
{allowManualEntry}
|
||||||
{scanButtonText}
|
{scanText}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</Field>
|
</Field>
|
||||||
|
|
Loading…
Reference in New Issue