|
| 1 | +import { Meta, Story } from "@storybook/addon-docs"; |
| 2 | +import { ContentBrowser } from "./contentbrowser.stories.js"; |
| 3 | + |
| 4 | +<Meta title="Patterns/ContentBrowser" /> |
| 5 | + |
| 6 | +# Contentbrowser |
| 7 | + |
| 8 | +Show a widget to select items in an offcanvas miller-column browser. |
| 9 | + |
| 10 | +## Configuration |
| 11 | + |
| 12 | +```md |
| 13 | +| Option | Type | Default | Description | |
| 14 | +| :------------------: | :-----: | :-------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------: | |
| 15 | +| vocabularyUrl | string | null | This is a URL to a JSON-formatted file used to populate the list | |
| 16 | +| attributes | array | ['UID', 'Title', 'portal_type', 'path'] | This list is passed to the server during an AJAX request to specify the attributes which should be included on each item. | |
| 17 | +| rootPath | string | "/" | Browsing/searching root path. You will not get beneath this path | |
| 18 | +| rootUrl | string | | Browsing/searching root url. | |
| 19 | +| basePath | string | set to rootPath. | Start browse/search in this path. | |
| 20 | +| contextPath | string | | Path of the object, which is currently edited. If this path is given, this object will not be selectable. | |
| 21 | +| favorites | array | [] | Array of objects. These are favorites, which can be used to quickly jump to different locations. Objects have the attributes "title" and "path". | |
| 22 | +| maximumSelectionSize | integer | -1 | The maximum number of items that can be selected in a multi-select control. If this number is less than 1 selection is not limited. | |
| 23 | +| mode | string | "browse" | Toggle between "browse" and "search" | |
| 24 | +| width | integer | | Override the width of the selected items field | |
| 25 | +| bSize | integer | 10 | Batch size of the items listed in levels | |
| 26 | +| maxDepth | integer | | Maximum level depth for "browse" mode | |
| 27 | +| separator | string | ',' | Select2 option. String which separates multiple items. | |
| 28 | +| upload | boolean | | Allow file and image uploads from within the related items widget. | |
| 29 | +| recentlyUsed | boolean | false | Show the recently used items dropdown. | |
| 30 | +| recentlyUsedKey | integer | | Storage key for saving the recently used items. This is generated with fieldname and username in the patternoptions. | |
| 31 | +| recentlyUsedMaxItems | integer | 20 | Maximum items to keep in recently used list. 0: no restriction. | |
| 32 | +| customComponentKeys | dict | {} | Register custom components. Currently only "SelectedItem" implemented | |
| 33 | +``` |
| 34 | + |
| 35 | +## Examples |
| 36 | + |
| 37 | +### Simple |
| 38 | + |
| 39 | +<br /> |
| 40 | +<Story name="Content Browser" of={ContentBrowser} /> |
| 41 | + |
| 42 | +```html |
| 43 | +<input |
| 44 | + type="text" |
| 45 | + class="pat-contentbrowser" |
| 46 | + data-pat-contentbrowser='{"selectableTypes": ["Document"], "vocabularyUrl": "contentbrowser-test.json"}' |
| 47 | +/> |
| 48 | +``` |
0 commit comments