diff --git a/docs/changelog.md b/docs/changelog.md index 57bc8851b8..2952b8657e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,24 @@ title: type: Other --- +### 1.0.6 + +`2018-6-4` + +- @delon/abc + - simple-table + - 优化列描述 `click` 若返回字符串值表示自动导航该路由 + - 修复 `reload`、`load` 组件方法若不指定 `extraParams` 时应保持上一次结果 +- @delon/form + - 增加 SFComponent 的 `validator` 方法用于手动触发一次校验 + - 增加 Select 小部件 `change` 事件,[#482](https://github.com/cipchk/ng-alain/issues/482) + - 修复非必填项时空值也会被校验,[#91](https://github.com/cipchk/delon/issues/91) + - 修复 `ueditor` 无效参数 `ngContentChange` 为 `ngModelChange`,[@vellengs](https://github.com/vellengs) +- @delon/util + - 修复 `deepGet` 路径中间空值时返回错误,此 bug 受影响 `simple-table` 若值为空时也会相同错误 +- Schematics + - 新增 `yarn` 插件 + ### 1.0.5 `2018-5-28` diff --git a/package.json b/package.json index 814e3c8d1f..7c3c302b03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "delon", - "version": "1.0.5", + "version": "1.0.6", "typings": "index.d.ts", "description": "Delon is a set of essential modules for ng-alain.", "repository": { diff --git a/packages/abc/sidebar-nav/index.md b/packages/abc/sidebar-nav/index.md index f08732bca7..eb3fb32162 100644 --- a/packages/abc/sidebar-nav/index.md +++ b/packages/abc/sidebar-nav/index.md @@ -7,11 +7,29 @@ module: AdSidebarNavModule ng-alain 左边主菜单,依赖于 `@delon/theme`。 -组件的数据来自 `MenuService`,因此变更它也会同步变更组件。 +组件的数据来自 `MenuService`,其结构为 [Menu](https://github.com/cipchk/delon/blob/master/packages/theme/services/menu/interface.ts),同时对 `MenuService` 的操作会直接同步主菜单组件。 -## 关于隐藏 +## 常见问题 -若希望永远不显示菜单,可以在菜单设置 `hide: true`。 +### 为什么会有两个快捷菜单 + +快捷菜单生成规则是【统一在下标0的节点下(即【主导航】节点下方)】为寻找点,且按以下顺序来获取: + +1. 【推荐】 children 存在 `shortcut_root: true` 则最优先 +2. 否则查找带有【dashboard】字样链接,若存在则在此菜单的下方创建快捷入口 +3. 否则放在0节点位置 + +因此,建议在菜单数据的第 `0` 个下标里保持一个有效的 `shortcut_root: true` 数据。 + +### 关于隐藏 + +**隐藏主菜单项** + +表示永远不显示菜单,可以在菜单设置 `hide: true`。 + +**隐藏自动生成导航隐藏面包屑** + +表示不显示该节点,可以在菜单设置 `hideInBreadcrumb: true`。 ## API @@ -21,3 +39,25 @@ ng-alain 左边主菜单,依赖于 `@delon/theme`。 ----|------|-----|------ autoCloseUnderPad | 小于Pad宽度时路由切换后自动关闭侧边栏 | `boolean` | `true` select | 切换时回调 | `EventEmitter` | - + +### 菜单数据结构 + +参数 | 类型 | 说明 +----|------|----- +text | `string` | 文本,必填项 +i18n | `string` | i18n主键 +group | `string` | 是否菜单组,指[示例](https://cipchk.github.io/ng-alain/)中的【主导航】字样 +link | `string` | angular 路由,`link`、`externalLink` 二选其一 +externalLink | `string` | 外部链接,`link`、`externalLink` 二选其一 +target | `_blank,_self,_parent,_top` | 链接 target +icon | `string` | 图标,指[示例](https://cipchk.github.io/ng-alain/)中的【仪表盘】前图标,只对一级菜单有效 +badge | `number` | 徽标数,展示的数字,指[示例](https://cipchk.github.io/ng-alain/)中的【小部件】后的红色块。(注:`group:true` 时无效) +badge_dot | `boolean` | 徽标数,显示小红点 +badge_status | `string` | 徽标 Badge 颜色 (默认:error, 所有颜色值见:https://github.com/cipchk/ng-alain/blob/master/_documents/utils.md#色彩) +hide | `boolean` | 是否隐藏菜单 +hideInBreadcrumb | `boolean` | 隐藏面包屑,指 `page-header` 组件的自动生成面包屑时有效 +acl | `any` | ACL配置,若导入 `@delon/acl` 时自动有效,等同于 `ACLService.can(roleOrAbility: ACLCanType)` 参数值 +shortcut | `boolean` | 是否快捷菜单项 +shortcut_root | `boolean` | 快捷菜单根节点 +reuse | `boolean` | 是否允许复用,需配合 `reuse-tab` 组件 +children | `Menu[]` | 子菜单 diff --git a/packages/form/widgets-third/ueditor/ueditor.widget.ts b/packages/form/widgets-third/ueditor/ueditor.widget.ts index 101a466c87..2e6e1ba596 100644 --- a/packages/form/widgets-third/ueditor/ueditor.widget.ts +++ b/packages/form/widgets-third/ueditor/ueditor.widget.ts @@ -10,7 +10,7 @@ import { ControlWidget } from '@delon/form'; [config]="config" [loadingTip]="loading" [delay]="delay" - (onContentChange)="change($event)"> + (ngModelChange)="change($event)"> `, diff --git a/packages/schematics/docs/plugin.md b/packages/schematics/docs/plugin.md index c94937e571..879af85fe4 100644 --- a/packages/schematics/docs/plugin.md +++ b/packages/schematics/docs/plugin.md @@ -47,6 +47,6 @@ ng-alain 默认提供了一部分的代码风格配置方案,你可以在项 在国内使用 npm 始终是一个“痛”,因此你可以增加一个使用淘宝镜像配置文件 `.npmrc`,来解决网络问题。 -### yarn (待发布) +### yarn 修复由于降级 Less 导致无法使用 `yarn` 安装依赖包问题。 diff --git a/scaffold b/scaffold index 3a724459d5..4613db047c 160000 --- a/scaffold +++ b/scaffold @@ -1 +1 @@ -Subproject commit 3a724459d5cc5136a9348145b4d5bbf2f5d25a0a +Subproject commit 4613db047c97a49493da30392541f4aab02aae66 diff --git a/site/app/routes/home/home.component.html b/site/app/routes/home/home.component.html index ad00f41eac..d27c5e92b5 100644 --- a/site/app/routes/home/home.component.html +++ b/site/app/routes/home/home.component.html @@ -12,5 +12,9 @@

Ng Alain

- + diff --git a/site/app/routes/home/home.component.less b/site/app/routes/home/home.component.less index 56fc1d3520..b27cdbf7e4 100644 --- a/site/app/routes/home/home.component.less +++ b/site/app/routes/home/home.component.less @@ -1,83 +1,85 @@ ::ng-deep { - .index-page { - app-header { - box-shadow: none; - } + .index-page { + app-header { + box-shadow: none; } + } } :host { - width: 100%; - color: #697b8c; - display: block; - - ::ng-deep { - .ant-btn { - min-width: 110px; - height: 40px; - border-radius: 20px; - font-size: 16px; - margin-right: 16px; - &:hover { - transform: translateY(-4px); - box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4); - } - } - .banner-wrapper { - height: 526px; - width: 100%; - max-width: 1500px; - margin: auto; - position: relative; - .banner-title-wrapper { - width: 40%; - max-width: 480px; - height: 245px; - position: absolute; - top: 0; - bottom: 0; - left: 8%; - margin: auto; - z-index: 1; - > * { - will-change: transform; - } - h1 { - font-family: "Futura", "Helvetica Neue For Number", - -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, - "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", - "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 54px; - margin: 12px 0; - } - p { - font-size: 20px; - } - .button-wrapper { - margin-top: 64px; - line-height: 40px; - align-items: center; - display: flex; - .github { - display: flex; - } - } - .title-line { - transform: translateX(-64px); - animation: bannerTitleLine 3s ease-in-out 0s infinite; - } - } - .banner-image-wrapper { - width: 45%; - max-width: 598px; - height: 324px; - position: absolute; - right: 8%; - margin: auto; - top: 0; - bottom: 0; - opacity: 0; - } - } - } + width: 100%; + color: #697b8c; + display: block; + ::ng-deep { + .ant-btn { + min-width: 110px; + height: 40px; + border-radius: 20px; + font-size: 16px; + margin-right: 16px; + &:hover { + transform: translateY(-4px); + box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4); + } + } + .banner-wrapper { + height: 526px; + width: 100%; + max-width: 1500px; + margin: auto; + position: relative; + .banner-title-wrapper { + width: 40%; + max-width: 480px; + height: 245px; + position: absolute; + top: 0; + bottom: 0; + left: 8%; + margin: auto; + z-index: 1; + > * { + will-change: transform; + } + h1 { + font-family: 'Futura', 'Helvetica Neue For Number', -apple-system, + BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', + 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, + Arial, sans-serif; + font-size: 54px; + margin: 12px 0; + } + p { + font-size: 20px; + } + .button-wrapper { + margin-top: 64px; + line-height: 40px; + align-items: center; + display: flex; + .github { + display: flex; + } + } + .title-line { + transform: translateX(-64px); + animation: bannerTitleLine 3s ease-in-out 0s infinite; + } + } + .banner-image-wrapper { + width: 45%; + max-width: 360px; + height: 324px; + position: absolute; + margin: auto; + top: 0; + bottom: 0; + right: 15%; + img { + max-width: 100%; + border-radius: 8px; + } + } + } + } }