From ba4a7f83709cd149ae39276029724537e7880ee0 Mon Sep 17 00:00:00 2001 From: wangchangqi Date: Fri, 2 Sep 2022 13:45:38 +0800 Subject: [PATCH] (todo)Add confirm & prompt target. --- src/components/confirm/README.md | 26 ++++++++++++++++++++++++++ src/components/confirm/confirm.ts | 27 +++++++++++++++++++++++++++ src/components/prompt/README.md | 27 +++++++++++++++++++++++++++ src/components/prompt/prompt.ts | 27 +++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 src/components/confirm/README.md create mode 100644 src/components/confirm/confirm.ts create mode 100644 src/components/prompt/README.md create mode 100644 src/components/prompt/prompt.ts diff --git a/src/components/confirm/README.md b/src/components/confirm/README.md new file mode 100644 index 0000000..37fc26f --- /dev/null +++ b/src/components/confirm/README.md @@ -0,0 +1,26 @@ +# 确认弹窗-Confirm + +参考:UI设计 + +## 内容排布 + +- 括号中的内容为可选项 + +从上到下: + +``` +(图标) + 标题 +子标题 +按钮1(按钮2) +``` + +特点: +- 支持模态模式 +- 支持非模态模式 +- 支持静态资源插槽(此处为图片) + +## 关联组件 + +- button +- 静态资源容器 \ No newline at end of file diff --git a/src/components/confirm/confirm.ts b/src/components/confirm/confirm.ts new file mode 100644 index 0000000..2942e66 --- /dev/null +++ b/src/components/confirm/confirm.ts @@ -0,0 +1,27 @@ +import { html, css, LitElement } from 'lit' +import { customElement, property, state } from 'lit/decorators.js' + +@customElement('star-confirm') +export class StarConfirm extends LitElement { + @property() + foo = '' + + @state() + bar = '' + + render() { + return html` + + ` + } + + static styles = css` + + ` +} + +declare global { + interface HTMLElementTagNameMap { + 'star-confirm': StarConfirm + } +} \ No newline at end of file diff --git a/src/components/prompt/README.md b/src/components/prompt/README.md new file mode 100644 index 0000000..048f01a --- /dev/null +++ b/src/components/prompt/README.md @@ -0,0 +1,27 @@ +# 提示输入弹窗-Prompt + +参考:UI设计 + +## 内容排布 + +- 括号中的内容为可选项 + +从上到下: + +``` +标题 +(子标题) +输入框 +输入状态提示 外部链接 +按钮1 按钮2 +``` + +特点: +- 支持模态模式 +- 支持非模态模式 + +## 关联组件 + +- button +- input +- 外部链接slot \ No newline at end of file diff --git a/src/components/prompt/prompt.ts b/src/components/prompt/prompt.ts new file mode 100644 index 0000000..1e91b55 --- /dev/null +++ b/src/components/prompt/prompt.ts @@ -0,0 +1,27 @@ +import { html, css, LitElement } from 'lit' +import { customElement, property, state } from 'lit/decorators.js' + +@customElement('star-prompt') +export class StarPrompt extends LitElement { + @property() + foo = '' + + @state() + bar = '' + + render() { + return html` + + ` + } + + static styles = css` + + ` +} + +declare global { + interface HTMLElementTagNameMap { + 'star-prompt': StarPrompt + } +} \ No newline at end of file