mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 21:50:34 +03:00
fix: handle readonly in number presenter (#6026)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
8e7212e4a9
commit
617c144daf
@ -21,9 +21,10 @@
|
||||
export let onChange: ((value: number | undefined) => void) | undefined = undefined
|
||||
export let placeholder: IntlString = getEmbeddedLabel(' ')
|
||||
export let kind: 'no-border' | 'link' | 'button' = 'link'
|
||||
export let readonly = false
|
||||
</script>
|
||||
|
||||
{#if onChange !== undefined}
|
||||
{#if onChange !== undefined && !readonly}
|
||||
<NumberEditor {onChange} {value} {placeholder} {kind} />
|
||||
{:else}
|
||||
<span>{value || ''}</span>
|
||||
|
@ -430,7 +430,7 @@
|
||||
this={attribute.presenter}
|
||||
value={getValue(attribute, object)}
|
||||
onChange={getOnChange(object, attribute)}
|
||||
{...joinProps(attribute, object, $restrictionStore.readonly)}
|
||||
{...joinProps(attribute, object, readonly || $restrictionStore.readonly)}
|
||||
/>
|
||||
</div>
|
||||
</td>
|
||||
|
Loading…
Reference in New Issue
Block a user