@skhemata/skhemata-form
Version:
Skhemata Form Web Component. This web component can be used as base web component when working with forms and inputs.
65 lines • 1.9 kB
JavaScript
import { html } from 'lit-html';
import '../skhemata-form';
import { argTypes } from './argTypes';
export default {
title: 'General/SkhemataForm/SkhemataFormAutocomplete',
component: 'skhemata-form-autocomplete',
argTypes: {
...argTypes,
api: {
control: 'object',
description: 'API endpoint for the automcomplete data',
table: {
category: 'HTML Attributes',
type: {
summary: 'object',
detail: JSON.stringify({
url: 'string',
}, null, 2),
},
},
},
mapvalue: {
control: 'string',
description: 'The value from the API to map the value of select options',
table: {
type: 'string',
category: 'HTML Attributes',
},
},
maplabel: {
control: 'string',
description: 'The value from the API to map the label of select options',
table: {
type: 'string',
category: 'HTML Attributes',
},
},
},
};
const Template = ({ label = 'Autocomplete', api = {
url: 'https:/coral.thrinacia.com/api/service/restv1/locale/city/',
}, }) => html `
<skhemata-form-autocomplete
.label=${label}
.api=${api}
maplabel="name"
mapvalue="id"
></skhemata-form-autocomplete>
`;
export const Example = Template.bind({});
Example.parameters = {
docs: {
source: {
code: `
<skhemata-form-autocomplete
label="Autocomplete"
api="${JSON.stringify({
url: 'https:/coral.thrinacia.com/api/service/restv1/',
}).replaceAll('"', '\\"')}"
></skhemata-form-autocomplete>
`,
},
},
};
//# sourceMappingURL=SkhemataFormAutocomplete.stories.js.map