diff --git a/packages/documentation/pages/usage/components/form-fields.vue b/packages/documentation/pages/usage/components/form-fields.vue index 374a543ec7..81adad75d0 100644 --- a/packages/documentation/pages/usage/components/form-fields.vue +++ b/packages/documentation/pages/usage/components/form-fields.vue @@ -48,10 +48,12 @@

Settings

+ + + + + + + diff --git a/packages/kotti-ui/source/kotti-field-email/constants.ts b/packages/kotti-ui/source/kotti-field-email/constants.ts new file mode 100644 index 0000000000..160f81632e --- /dev/null +++ b/packages/kotti-ui/source/kotti-field-email/constants.ts @@ -0,0 +1,8 @@ +import { KottiField } from '../kotti-field/types' + +export const KOTTI_FIELD_EMAIL_SUPPORTS: KottiField.Supports = { + clear: true, + decoration: true, + placeholder: true, + tabIndex: true, +} diff --git a/packages/kotti-ui/source/kotti-field-email/index.ts b/packages/kotti-ui/source/kotti-field-email/index.ts new file mode 100644 index 0000000000..bf1c1c2333 --- /dev/null +++ b/packages/kotti-ui/source/kotti-field-email/index.ts @@ -0,0 +1,25 @@ +import { FIELD_META_BASE_SLOTS } from '../kotti-field/meta' +import { MetaDesignType } from '../types/kotti' +import { attachMeta, makeInstallable } from '../utilities' + +import { KOTTI_FIELD_EMAIL_SUPPORTS } from './constants' +import KtFieldEmailVue from './KtFieldEmail.vue' + +export const KtFieldEmail = attachMeta( + makeInstallable(KtFieldEmailVue), + { + addedVersion: '2.0.0', + deprecated: null, + designs: { + type: MetaDesignType.FIGMA, + url: 'https://www.figma.com/file/0yFVivSWXgFf2ddEF92zkf/Kotti-Design-System?node-id=415%3A4', + }, + slots: FIELD_META_BASE_SLOTS, + typeScript: { + namespace: 'Kotti.FieldEmail', + }, + }, + { supports: KOTTI_FIELD_EMAIL_SUPPORTS }, +) + +export * from './constants' diff --git a/packages/kotti-ui/source/kotti-field-email/types.ts b/packages/kotti-ui/source/kotti-field-email/types.ts new file mode 100644 index 0000000000..62db6a6b04 --- /dev/null +++ b/packages/kotti-ui/source/kotti-field-email/types.ts @@ -0,0 +1,9 @@ +import { KottiField } from '../kotti-field/types' + +export namespace KottiFieldEmail { + export type Props = KottiField.Props & { + autoComplete: 'email' | 'username' + } + + export type Value = string | null +} diff --git a/packages/kotti-ui/source/kotti-input/index.ts b/packages/kotti-ui/source/kotti-input/index.ts index 746044f5d1..ce381eeda5 100755 --- a/packages/kotti-ui/source/kotti-input/index.ts +++ b/packages/kotti-ui/source/kotti-input/index.ts @@ -9,10 +9,10 @@ export const KtInput = attachMeta(makeInstallable(KtInputVue), { addedVersion: '0.0.1', deprecated: { alternatives: [ - 'KtFieldText', - 'KtFieldNumber', 'KtFieldEmail', + 'KtFieldNumber', 'KtFieldPassword', + 'KtFieldText', ], reason: 'Replaced by Kotti v2.0.0 Forms', version: '3.0.0',