diff --git a/CHANGELOG.md b/CHANGELOG.md index 6059c6e..c1204be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## v0.5.0 - 增加了 SVG 图标补全 +- 修正了部分组件的 HTML 补全,精简了组件使用示例 ## v0.4.0 - 增加了组件的 CSS 变量补全 diff --git a/README.md b/README.md index 060b4c2..dbdce35 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ - 一点 HTML 代码片段 - Material 图标 SVG 补全 -目前已支持 Sober.js 0.2.15 的所有组件和 CSS 变量(见下表) +目前已支持 `Sober.js 0.2.15` 的所有组件、CSS 变量(见下表)和 SVG 图标
支持的组件(点击展开) @@ -103,10 +103,6 @@ - [x] `--border-color` - [x] `--padding` - [x] 全局变量 - -
- 点击展开(共 68 个) - - [x] `--s-color-primary` - [x] `--s-color-on-primary` - [x] `--s-color-primary-container` @@ -177,7 +173,6 @@ - [x] `--s-elevation-level4` - [x] `--s-elevation-level5` -
### 功能展示 diff --git a/custom-data/components.html-data.json b/custom-data/components.html-data.json index 7c8c288..6dab98c 100644 --- a/custom-data/components.html-data.json +++ b/custom-data/components.html-data.json @@ -110,11 +110,15 @@ "attributes": [ { "name": "type", - "description": "按钮样式。\n\n可选值为:\n- `filled`\n- `elevated`\n- `filled-tonal`\n- `outlined`\n- `text`", + "description": "按钮样式。\n\n可选值为:\n- `text`\n- `filled`\n- `elevated`\n- `filled-tonal`\n- `outlined`", "values": [ + { + "name": "text", + "description": "默认值。只包含文字的按钮,没有其他样式" + }, { "name": "filled", - "description": "默认值。带有较明显背景色的按钮" + "description": "带有较明显背景色的按钮" }, { "name": "elevated", @@ -127,10 +131,6 @@ { "name": "outlined", "description": "带有边框的按钮" - }, - { - "name": "text", - "description": "只包含文字的按钮,没有其他样式" } ] }, @@ -380,7 +380,7 @@ }, { "name": "s-linear-progress", - "description": "**线性进度 Linear Progress**\n\n```html\n\n```\n\n设置 `indeterminate` 来启用未知进度。```html\n\n```\n\n设置 `animated` 来启用变更过渡动画。\n\n使用`color`自定义颜色。\n\n**属性:**\n\n- `indeterminate` (`boolean`): 是否未知\n- `animated` (`boolean`): 是否启用变更时过渡动画\n- `max` (`number`): 最大值\n- `value` (`number`): 当前值", + "description": "**线性进度 Linear Progress**\n\n```html\n\n```\n\n设置 `indeterminate` 来启用未知进度。\n```html\n\n```\n\n设置 `animated` 来启用变更过渡动画。\n\n使用`color`自定义颜色。\n\n**属性:**\n\n- `indeterminate` (`boolean`): 是否未知\n- `animated` (`boolean`): 是否启用变更时过渡动画\n- `max` (`number`): 最大值\n- `value` (`number`): 当前值", "attributes": [ { "name": "indeterminate", @@ -418,7 +418,7 @@ }, { "name": "s-circular-progress", - "description": "**圆形进度 Circular Progress**\n\n```html\n\n```\n\n设置 `indeterminate` 来启用未知进度。```html\n\n```\n\n设置 `animated` 来启用变更过渡动画。\n\n使用`color`自定义颜色。\n\n**属性:**\n\n- `indeterminate` (`boolean`): 是否未知\n- `animated` (`boolean`): 是否启用变更时过渡动画\n- `max` (`number`): 最大值\n- `value` (`number`): 当前值", + "description": "**圆形进度 Circular Progress**\n\n```html\n\n```\n\n设置 `indeterminate` 来启用未知进度。\n```html\n\n```\n\n设置 `animated` 来启用变更过渡动画。\n\n使用`color`自定义颜色。\n\n**属性:**\n\n- `indeterminate` (`boolean`): 是否未知\n- `animated` (`boolean`): 是否启用变更时过渡动画\n- `max` (`number`): 最大值\n- `value` (`number`): 当前值", "attributes": [ { "name": "indeterminate", @@ -551,7 +551,7 @@ }, { "name": "s-picker", - "description": "**选择框 Picker**\n\n通常用于单选数据,它的目标是替代 `select`。\n\n```html\n\n 贵阳\n 北京\n 上海\n 深圳\n```\n\n由于内部封装性较高,定义样式变得很复杂,因此我们开放了一些CSS变量来允许你定义一些样式\n\n**属性:**\n\n- `label` (`string`): 标签文本\n- `options` _[只读]_ (`Item[]`): 子项目\n- `selectedIndex` (`number`): 当前选中下标\n\n**插槽:**\n- `trigger`: 触发\n\n**事件:**\n- `change`: 选中变化后触发\n\n**CSS 变量:**\n\n- `--border-width`: 边框宽度\n- `--border-color`: 边框颜色\n- `--padding`: 内边距", + "description": "**选择框 Picker**\n\n通常用于单选数据,它的目标是替代 `select`。\n\n```html\n\n 贵阳\n 北京\n 上海\n 深圳\n\n```\n\n由于内部封装性较高,定义样式变得很复杂,因此我们开放了一些CSS变量来允许你定义一些样式\n\n**属性:**\n\n- `label` (`string`): 标签文本\n- `options` _[只读]_ (`Item[]`): 子项目\n- `selectedIndex` (`number`): 当前选中下标\n\n**插槽:**\n- `trigger`: 触发\n\n**事件:**\n- `change`: 选中变化后触发\n\n**CSS 变量:**\n\n- `--border-width`: 边框宽度\n- `--border-color`: 边框颜色\n- `--padding`: 内边距", "attributes": [ { "name": "label", @@ -680,7 +680,7 @@ }, { "name": "s-card", - "description": "**卡片 Card**\n\n用于显示内容的卡片组件,支持多种样式,可以作为容器使用。\n\n```html\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n Card\n\n```\n\n**属性:**\n\n- `type` (`elevated`, `filled`, `outlined`): 卡片样式,默认为 `elevated`\n- `clickable` (`boolean`): 是否启用可点击,默认为 `false`\n- `selectable` (`boolean`): 是否启用选中,默认为 `false`\n\n**插槽:**\n- `image`: 图片\n- `headline`: 标题\n- `subhead`: 副标题\n- `text`: 卡片文本\n- `action`: 操作按钮\n\n**CSS 变量:**\n\n- `--border-radius`: 边框半径\n- `--border-width`: 边框宽度\n- `--border-color`: 边框颜色\n- `--padding`: 内边距", + "description": "**卡片 Card**\n\n用于显示内容的卡片组件,支持多种样式,可以作为容器使用。\n\n```html\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n
\n
Headline
\n
Subhead
\n
Cards are often used for grid lists, which provide click effects
\n Action\n Action\n
\n\n\n Card\n\n```\n\n**属性:**\n\n- `type` (`elevated`, `filled`, `outlined`): 卡片样式,默认为 `elevated`\n- `clickable` (`boolean`): 是否启用可点击,默认为 `false`\n- `selectable` (`boolean`): 是否启用选中,默认为 `false`\n\n**插槽:**\n- `image`: 图片\n- `headline`: 标题\n- `subhead`: 副标题\n- `text`: 卡片文本\n- `action`: 操作按钮\n\n**CSS 变量:**\n\n- `--border-radius`: 边框半径\n- `--border-width`: 边框宽度\n- `--border-color`: 边框颜色\n- `--padding`: 内边距", "attributes": [ { "name": "type", @@ -724,7 +724,7 @@ }, { "name": "s-search", - "description": "**搜索栏 Search**\n\n搜索组件支持不同尺寸和插槽。可以使用图标按钮、设置不同的尺寸以及自定义下拉插槽。\n\n```html\n\n \n \n \n\n\n\n \n \n \n \n \n \n \n\n\n\n \n \n \n\n\n \n \n \n\n\n \n \n \n\n\n\n \n \n \n
\n hello\n
\n
\n```\n\n**属性:**\n\n- `size` (`string`): 按钮大小,可选值为 `medium`, `small`, `large`,默认值为 `medium`。\n\n**插槽:**\n- `start`: 开始插槽\n- `end`: 结束插槽\n- `dropdown`: 下拉插槽", + "description": "**搜索栏 Search**\n\n搜索组件支持不同尺寸和插槽。可以使用图标按钮、设置不同的尺寸以及自定义下拉插槽。\n\n```html\n\n \n \n \n \n \n \n \n\n\n\n \n \n \n
\n hello\n
\n
\n```\n\n**属性:**\n\n- `size` (`string`): 按钮大小,可选值为 `medium`, `small`, `large`,默认值为 `medium`。\n\n**插槽:**\n- `start`: 开始插槽\n- `end`: 结束插槽\n- `dropdown`: 下拉插槽", "attributes": [ { "name": "size", @@ -778,7 +778,7 @@ }, { "name": "s-tab", - "description": "**选项卡 Tab**\n\n选项卡组件用于在同一个区域内切换不同的内容。支持徽章、左右对齐以及固定模式。\n\n```html\n\n \n
Item 1
\n
\n \n
Item 2
\n
\n \n
Item 3
\n
\n
\n\n\n \n
Item 1
\n \n
\n \n
Item 2
\n
\n \n
Item 3
\n 99\n
\n
\n\n\n \n
Item 1
\n
\n \n
Item 2
\n
\n \n
Item 3
\n
\n
\n\n\n \n
Item 1
\n
\n \n
Item 2
\n
\n \n
Item 3
\n
\n
\n```\n\n**属性:**\n\n- `mode` (`string`): 设置固定模式,使 item 均分占据宽度,不再支持滚动。\n\n**事件:**\n- `change`: 选中变化后触发。", + "description": "**选项卡 Tab**\n\n选项卡组件用于在同一个区域内切换不同的内容。支持徽章、左右对齐以及固定模式。\n\n```html\n\n \n
Item 1
\n
\n \n
Item 2
\n
\n \n
Item 3
\n
\n
\n```\n\n**属性:**\n\n- `mode` (`string`): 设置固定模式,使 item 均分占据宽度,不再支持滚动。\n\n**事件:**\n- `change`: 选中变化后触发。", "attributes": [ { "name": "mode", @@ -829,7 +829,7 @@ }, { "name": "s-navigation", - "description": "**导航栏 Navigation**\n\n导航组件用于在应用中进行页面切换或执行其他操作。支持图标、文本、徽章插槽,以及导轨模式。\n\n```html\n\n \n \n
Item 1
\n
\n \n \n
Item 2
\n
\n \n \n
Item 3
\n
\n
\n\n\n \n \n
Item 1
\n \n
\n \n \n
Item 2
\n
\n \n \n
Item 3
\n 99\n
\n
\n\n\n \n \n
Item 1
\n
\n \n \n
Item 2\">
\n
\n \n \n
Item 3\">
\n
\n
\n```\n\n**属性:**\n\n- `mode` (`string`): 设置导轨模式。\n\n**事件:**\n- `change`: 选中变化后触发。\n\n**插槽:**\n- `start`: 开始插槽\n- `end`: 结束插槽", + "description": "**导航栏 Navigation**\n\n导航组件用于在应用中进行页面切换或执行其他操作。支持图标、文本、徽章插槽,以及导轨模式。\n\n```html\n\n \n \n
Item 1
\n
\n \n \n
Item 2
\n
\n \n \n
Item 3
\n
\n
\n\n\n \n \n
Item 1
\n
\n \n \n
Item 2\">
\n
\n \n \n
Item 3\">
\n
\n
\n```\n\n**属性:**\n\n- `mode` (`string`): 设置导轨模式。\n\n**事件:**\n- `change`: 选中变化后触发。\n\n**插槽:**\n- `start`: 开始插槽\n- `end`: 结束插槽", "attributes": [ { "name": "mode", @@ -880,7 +880,7 @@ }, { "name": "s-appbar", - "description": "**应用栏 Appbar**\n\nAppbar 的表现更像一个容器,它没有事件和行为。\n\n在屏幕宽度小于 **840px** 时,它的高度会变为 **56px**。\n\n支持导航、标题和操作按钮的插槽。\n\n你可以嵌套该组件,内部的 appbar 会居中并且设置一个最大宽度,默认为 **1280px**。\n\n```html\n\n \n \n \n \n \n
Title
\n \n \n \n \n
\n\n\n \n \n \n \n \n \n
Title
\n \n \n \n \n
\n
\n```\n\n**插槽:**\n- `navigation`: 导航\n- `headline`: 标题\n- `action`: 操作", + "description": "**应用栏 Appbar**\n\nAppbar 的表现更像一个容器,它没有事件和行为。\n\n在屏幕宽度小于 **840px** 时,它的高度会变为 **56px**。\n\n支持导航、标题和操作按钮的插槽。\n\n你可以嵌套该组件,内部的 Appbar 会居中并且设置一个最大宽度,默认为 **1280px**。\n\n```html\n\n \n \n \n \n \n
Title
\n \n \n \n \n
\n```\n\n**插槽:**\n- `navigation`: 导航\n- `headline`: 标题\n- `action`: 操作", "references": [ { "name": "文档", @@ -1077,7 +1077,7 @@ }, { "name": "s-table", - "description": "**Table 组件**\n\nTable 表格组件用于显示结构化的数据。\n\n```html\n\n \n \n title1\n title2\n title3\n title4\n title5\n \n \n \n \n item1\n item2\n item3\n item4\n item5\n \n \n item1\n item2\n item3\n item4\n item5\n \n \n item1\n item2\n item3\n item4\n item5\n \n \n\n```\n\n**插槽:**\n- `thead`: 表头\n- `tbody`: 表身\n- `tr`: 表格行\n- `th`: 表格头\n- `td`: 表格数据", + "description": "**Table 组件**\n\nTable 表格组件用于显示结构化的数据。\n\n```html\n\n \n \n title1\n title2\n title3\n title4\n title5\n \n \n \n \n item1\n item2\n item3\n item4\n item5\n \n \n\n```\n\n**插槽:**\n- `thead`: 表头\n- `tbody`: 表身\n- `tr`: 表格行\n- `th`: 表格头\n- `td`: 表格数据", "attributes": [], "references": [ {