You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_EXPERIMENTAL! This API will most likely change in future versions._
284
+
Customize rendering of the values. By default, `renderValue` is used, which renders a value as an editable div and depending on the value can also render a boolean toggle, a color picker, and a timestamp tag. Multiple components can be rendered alongside each other, like the boolean toggle and color picker being rendered left from the editable div. Built in value renderer components: `EditableValue`, `ReadonlyValue`, `BooleanToggle`, `ColorPicker`, `TimestampTag`, `EnumValue`.
285
285
286
-
Customize rendering of the values. By default, `renderValue` is used, which renders a value as an editable div and depending on the value can also render a boolean toggle, a color picker, and a timestamp tag. Multiple components can be rendered alongside each other, like the boolean toggle and color picker being rendered left from the editable div. Built in value renderer components: `EditableValue`, `ReadonlyValue`, `BooleanToggle`, `ColorPicker`, `TimestampTag`, `EnumValue`.
286
+
For JSON Schema enums, there is aready-made value renderer `renderJSONSchemaEnum` which renders enums using the `EnumValue` component. This can be used like:
287
287
288
-
For JSON Schema enums, there is a value renderer `renderJSONSchemaEnum` which renders enums using the `EnumValue` component. This can be used like:
288
+
```js
289
+
import { renderJSONSchemaEnum, renderValue } from 'svelte-jsoneditor'
import { renderJSONSchemaEnum, renderValue } from 'svelte-jsoneditor'
311
+
The `SvelteComponentRenderer` interface can be used to provide Svelte components like the `EnumValue` component mentioned above. The `SvelteActionRenderer` expects a [Svelte Action](https://svelte.dev/docs/svelte-action) as `action` property. Since this interface is a plain JavaScript interface, this allows to create custom components in a vanilla JS environment. Basically it is a function that gets a DOM node passed, and needs to return an object with `update` and `destroy` functions:
Callback which can be used to make changes to the menu items. New items can
331
+
be added, or existing items can be removed or reorganized. When the function
332
+
returns `undefined`, the original `items` will be applied. Using the context values `mode` and `modal`, different actions can be taken depending on the mode of the editor and whether the editor is rendered inside a modal or not.
333
+
334
+
A menu item `MenuItem` can be one of the following types:
Callback which can be used to make changes to the menu items. New items can
301
-
be added, or existing items can be removed or reorganized. When the function
302
-
returns `undefined`, the original `items` will be applied. Using the context values `mode` and `modal`, different actions can be taken depending on the mode of the editor and whether the editor is rendered inside a modal or not.
returns `undefined`, the original `items` will be applied. Using the context values `mode`, `modal` and `selection`, different actions can be taken depending on the mode of the editor, whether the editor is rendered inside a modal or not and the path of selection.
Callback which can be used to make changes to the context menu items. New items can
338
-
be added, or existing items can be removed or reorganized. When the function
339
-
returns `undefined`, the original `items` will be applied. Using the context values `mode`, `modal` and `selection`, different actions can be taken depending on the mode of the editor, whether the editor is rendered inside a modal or not and the path of selection.
340
-
341
-
Amenu item `ContextMenuItem` can be one of the following types:
0 commit comments