Merge branch 'master' into revert-12832-revert-11830-global-bindings
This commit is contained in:
commit
0ced1d29c5
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"version": "2.15.5",
|
||||
"version": "2.15.6",
|
||||
"npmClient": "yarn",
|
||||
"packages": [
|
||||
"packages/*",
|
||||
|
|
|
@ -18,7 +18,6 @@ export default function positionDropdown(element, opts) {
|
|||
useAnchorWidth,
|
||||
offset = 5,
|
||||
customUpdate,
|
||||
offsetBelow,
|
||||
} = opts
|
||||
if (!anchor) {
|
||||
return
|
||||
|
@ -48,7 +47,7 @@ export default function positionDropdown(element, opts) {
|
|||
styles.top = anchorBounds.top - elementBounds.height - offset
|
||||
styles.maxHeight = maxHeight || 240
|
||||
} else {
|
||||
styles.top = anchorBounds.bottom + (offsetBelow || offset)
|
||||
styles.top = anchorBounds.bottom + offset
|
||||
styles.maxHeight =
|
||||
maxHeight || window.innerHeight - anchorBounds.bottom - 20
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
export let autoWidth = false
|
||||
export let searchTerm = null
|
||||
export let customPopoverHeight
|
||||
export let customPopoverOffsetBelow
|
||||
export let customPopoverMaxHeight
|
||||
export let open = false
|
||||
export let loading
|
||||
|
||||
|
@ -98,7 +96,5 @@
|
|||
{sort}
|
||||
{autoWidth}
|
||||
{customPopoverHeight}
|
||||
{customPopoverOffsetBelow}
|
||||
{customPopoverMaxHeight}
|
||||
{loading}
|
||||
/>
|
||||
|
|
|
@ -37,8 +37,6 @@
|
|||
export let sort = false
|
||||
export let searchTerm = null
|
||||
export let customPopoverHeight
|
||||
export let customPopoverOffsetBelow
|
||||
export let customPopoverMaxHeight
|
||||
export let align = "left"
|
||||
export let footer = null
|
||||
export let customAnchor = null
|
||||
|
@ -156,9 +154,7 @@
|
|||
on:close={() => (open = false)}
|
||||
useAnchorWidth={!autoWidth}
|
||||
maxWidth={autoWidth ? 400 : null}
|
||||
maxHeight={customPopoverMaxHeight}
|
||||
customHeight={customPopoverHeight}
|
||||
offsetBelow={customPopoverOffsetBelow}
|
||||
>
|
||||
<div
|
||||
class="popover-content"
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
export let footer = null
|
||||
export let open = false
|
||||
export let tag = null
|
||||
export let customPopoverOffsetBelow
|
||||
export let customPopoverMaxHeight
|
||||
export let searchTerm = null
|
||||
export let loading
|
||||
|
||||
|
@ -97,8 +95,6 @@
|
|||
{autocomplete}
|
||||
{sort}
|
||||
{tag}
|
||||
{customPopoverOffsetBelow}
|
||||
{customPopoverMaxHeight}
|
||||
isPlaceholder={value == null || value === ""}
|
||||
placeholderOption={placeholder === false ? null : placeholder}
|
||||
isOptionSelected={option => compareOptionAndValue(option, value)}
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
export let useAnchorWidth = false
|
||||
export let dismissible = true
|
||||
export let offset = 5
|
||||
export let offsetBelow
|
||||
export let customHeight
|
||||
export let animate = true
|
||||
export let customZindex
|
||||
|
@ -89,7 +88,6 @@
|
|||
maxWidth,
|
||||
useAnchorWidth,
|
||||
offset,
|
||||
offsetBelow,
|
||||
customUpdate: handlePostionUpdate,
|
||||
}}
|
||||
use:clickOutside={{
|
||||
|
|
|
@ -88,8 +88,12 @@
|
|||
hasValidated = false
|
||||
})
|
||||
}
|
||||
|
||||
$: valid =
|
||||
getErrorCount(errors) === 0 && allRequiredAttributesSet(relationshipType)
|
||||
getErrorCount(errors) === 0 &&
|
||||
allRequiredAttributesSet(relationshipType) &&
|
||||
fromId &&
|
||||
toId
|
||||
$: isManyToMany = relationshipType === RelationshipType.MANY_TO_MANY
|
||||
$: isManyToOne =
|
||||
relationshipType === RelationshipType.MANY_TO_ONE ||
|
||||
|
|
|
@ -3964,6 +3964,12 @@
|
|||
"key": "allowManualEntry",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"label": "Auto confirm",
|
||||
"key": "autoConfirm",
|
||||
"defaultValue": false
|
||||
},
|
||||
{
|
||||
"type": "boolean",
|
||||
"label": "Play sound on scan",
|
||||
|
|
|
@ -14,11 +14,13 @@
|
|||
export let value
|
||||
export let disabled = false
|
||||
export let allowManualEntry = false
|
||||
export let autoConfirm = false
|
||||
export let scanButtonText = "Scan code"
|
||||
export let beepOnScan = false
|
||||
export let beepFrequency = 2637
|
||||
export let customFrequency = 1046
|
||||
export let preferredCamera = "environment"
|
||||
export let validator
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
@ -41,6 +43,9 @@
|
|||
beep()
|
||||
}
|
||||
dispatch("change", decodedText)
|
||||
if (autoConfirm && !validator?.(decodedText)) {
|
||||
camModal?.hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +132,11 @@
|
|||
<div class="scanner-video-wrapper">
|
||||
{#if value && !manualMode}
|
||||
<div class="scanner-value field-display">
|
||||
<StatusLight positive />
|
||||
{#if validator?.(value)}
|
||||
<StatusLight negative />
|
||||
{:else}
|
||||
<StatusLight positive />
|
||||
{/if}
|
||||
{value}
|
||||
</div>
|
||||
{/if}
|
||||
|
@ -183,11 +192,16 @@
|
|||
</div>
|
||||
{#if cameraEnabled === true}
|
||||
<div class="code-wrap">
|
||||
{#if value}
|
||||
{#if value && !validator?.(value)}
|
||||
<div class="scanner-value">
|
||||
<StatusLight positive />
|
||||
{value}
|
||||
</div>
|
||||
{:else if value && validator?.(value)}
|
||||
<div class="scanner-value">
|
||||
<StatusLight negative />
|
||||
{value}
|
||||
</div>
|
||||
{:else}
|
||||
<div class="scanner-value">
|
||||
<StatusLight neutral />
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
export let defaultValue = ""
|
||||
export let onChange
|
||||
export let allowManualEntry
|
||||
export let autoConfirm
|
||||
export let scanButtonText
|
||||
export let beepOnScan
|
||||
export let beepFrequency
|
||||
|
@ -49,11 +50,13 @@
|
|||
on:change={handleUpdate}
|
||||
disabled={fieldState.disabled || fieldState.readonly}
|
||||
{allowManualEntry}
|
||||
{autoConfirm}
|
||||
scanButtonText={scanText}
|
||||
{beepOnScan}
|
||||
{beepFrequency}
|
||||
{customFrequency}
|
||||
{preferredCamera}
|
||||
validator={fieldState.validator}
|
||||
/>
|
||||
{/if}
|
||||
</Field>
|
||||
|
|
|
@ -239,7 +239,6 @@
|
|||
bind:searchTerm
|
||||
loading={$fetch.loading}
|
||||
bind:open
|
||||
customPopoverMaxHeight={400}
|
||||
/>
|
||||
{/if}
|
||||
</Field>
|
||||
|
|
Loading…
Reference in New Issue