refactor: Improve typings for element-ui imports (no-changelog) (#4678)

* convert all stories to typescript

* stricter typing for element-ui imports
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-25 10:51:51 +01:00
committed by GitHub
parent 78c66f16d6
commit 55c201eb21
53 changed files with 75 additions and 232 deletions

View File

@@ -0,0 +1,68 @@
import N8nUserSelect from './UserSelect.vue';
import { action } from '@storybook/addon-actions';
export default {
title: 'Modules/UserSelect',
component: N8nUserSelect,
argTypes: {},
parameters: {
backgrounds: { default: '--color-background-light' },
},
};
const methods = {
onChange: action('change'),
onBlur: action('blur'),
onFocus: action('focus'),
};
const Template = (args, { argTypes }) => ({
props: Object.keys(argTypes),
components: {
N8nUserSelect,
},
template:
'<n8n-user-select v-bind="$props" v-model="val" @change="onChange" @blur="onBlur" @focus="onFocus" />',
methods,
data() {
return {
val: '',
};
},
});
export const UserSelect = Template.bind({});
UserSelect.args = {
users: [
{
id: '1',
firstName: 'Sunny',
lastName: 'Side',
email: 'sunny@n8n.io',
globalRole: {
name: 'owner',
id: '1',
},
},
{
id: '2',
firstName: 'Kobi',
lastName: 'Dog',
email: 'kobi@n8n.io',
globalRole: {
name: 'member',
id: '2',
},
},
{
id: '3',
email: 'invited@n8n.io',
globalRole: {
name: 'member',
id: '2',
},
},
],
placeholder: 'Select user to transfer to',
currentUserId: '1',
};