formio-sfds
Version:
The Form.io theme for sf.gov
29 lines (26 loc) • 3.7 kB
HTML
<html lang="en">
<head>
<title>Autocomplete | formio-sfds examples</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/sfgov/forms.css">
</head>
<body>
<div class="formio-sfds">
<div class="container p-2">
<h1 class="h3 mb-4">
<a href="/">formio-sfds@10.0.0</a> /
Autocomplete
</h1>
<sfgov-form
data-form="{"components":[{"type":"select","key":"job","label":"Your job","tags":["autocomplete"],"data":{"values":[{"label":"Healthcare worker","value":"healthCareWorker"},{"label":"Emergency services","value":"emergencyServices"},{"label":"Food and agriculture","value":"foodAndAgriculture"},{"label":"Energy","value":"energy"},{"label":"Water and wastewater","value":"waterAndWastewater"}]}},{"type":"select","key":"words","label":"Pick some words","tags":["autocomplete"],"multiple":true,"customOptions":{"maxItemCount":3},"properties":{"en:autocomplete.maxItemText":"Sorry, {{count}} tags max!"},"description":"This uses <code>multiple</code> and\n<code>customOptions.maxItemCount</code> to limit the number of\nchoices, and the <code>autocomplete.maxItemText</code> translation\nkey to change the text that shows up when two are selected.\n","data":{"values":[{"label":"green","value":"green"},{"label":"empathic","value":"empathic"},{"label":"never","value":"never"},{"label":"eleven","value":"eleven"},{"label":"dry","value":"dry"},{"label":"valuable","value":"valuable"},{"label":"fortify","value":"fortify"},{"label":"whatever","value":"whatever"},{"label":"leaven","value":"leaven"}]}},{"type":"htmlelement","tag":"div","content":"<b>ProTip:</b> Add <a\nhref=\"?language=debug\"><code>?language=debug</code></a> to the\nquery string to see the <code>autocomplete.*</code> translation keys\nin context.\n"}]}"
data-options="{"i18n":{"debug":{"autocomplete.noResultsText":"autocomplete.noResultsText","autocomplete.itemSelectText":"autocomplete.itemSelectText","autocomplete.maxItemText":"autocomplete.maxItemText","autocomplete.noChoicesText":"autocomplete.noChoicesText","autocomplete.searchPlaceholderValue":"autocomplete.searchPlaceholderValue"}}}">
</sfgov-form>
</div>
</div>
<script src="https://unpkg.com/formiojs@4.14.8/dist/formio.full.min.js"></script>
<script src="/dist/formio-sfds.standalone.js"></script>
<script src="/dist/examples.js"></script>
</body>
</html>