mcpField
A
aquila

aquila

github.com/allianz开发251161 次安装1 天前更新
代码仓库

关于 aquila

Aquila 是 Allianz Design System 的 Angular 组件库,面向使用 Angular v19+ 构建界面的开发者。它采用独立组件,并提供表单、导航、布局、反馈等组件及相应使用规则。

主要功能

  1. 01Angular 独立组件
  2. 02表单与验证组件
  3. 03导航和交互组件
  4. 04响应式 12 列网格
  5. 05组件导入与使用规范

适用场景

  1. 01构建 Angular 表单与验证界面
  2. 02实现导航、弹窗和反馈交互
  3. 03按断点排列响应式页面布局
  4. 04在项目中查阅组件 API 文档

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/allianz/ng-aquila --skill aquila

安装后在 Claude Code 中输入/aquila确认已加载。

详细介绍

Aquila – Angular 品牌套件组件库

Aquila(开源)/ Angular 品牌套件(前身为 NDBX)是 Allianz Design System 的 Angular 组件库。使用现代 Angular(v19+)模式: 独立组件、信号、新控制流(@if、@for)、inject() 等。

导入规则

Aquila 组件均为独立组件。直接导入组件:

import { NxButtonComponent } from '@allianz/ng-aquila/button';
import { NxFormfieldComponent } from '@allianz/ng-aquila/formfield';
import { NxInputDirective } from '@allianz/ng-aquila/input';

@Component({
  imports: [NxButtonComponent, NxFormfieldComponent, NxInputDirective],
})

导入路径模式:@allianz/ng-aquila/{component-name}

Aquila 特定规则

  • 使用 NxInputDirective 时,必须将 <input nxInput> 包裹在 <nx-formfield> 中
  • 在 formfield 内使用 <nx-error nxFormfieldError> 显示验证消息
  • 始终为 <button nxButton> 设置 type="button",以避免意外提交表单
  • 使用 Aquila 表单组件时,优先采用响应式表单
  • 不要使用内联 CSS 样式;请依赖 Aquila 内置样式

带验证的 Formfield(响应式表单)

<form [formGroup]="form">
  <nx-formfield label="Email">
    <input nxInput formControlName="email" type="email" />
    @if (form.controls.email.errors) {
      <nx-error nxFormfieldError>Please enter a valid email</nx-error>
    }
  </nx-formfield>
</form>

下拉菜单

<nx-formfield label="Country">
  <nx-dropdown formControlName="country">
    <nx-dropdown-item value="DE">Germany</nx-dropdown-item>
    <nx-dropdown-item value="CH">Switzerland</nx-dropdown-item>
    <nx-dropdown-item value="AT">Austria</nx-dropdown-item>
  </nx-dropdown>
</nx-formfield>

模态对话框

import { NxDialogService } from '@allianz/ng-aquila/modal';

const modalRef = inject(NxDialogService).open(MyDialogComponent);
modalRef.afterClosed().subscribe(result => { /* handle result */ });

网格系统

12 列响应式网格。nxCol 最多接受 7 个以逗号分隔的断点值,
顺序为:tiny、small、medium、large、xlarge、2xlarge、3xlarge。
如果提供的值少于 7 个,最后一个值会重复应用于其余断点
(例如,nxCol="12,8" → 12,8,8,8,8,8,8)。

<div nxLayout="grid">
  <div nxRow>
    <div nxCol="12,12,6">Left</div>
    <div nxCol="12,12,6">Right</div>
  </div>
</div>

最常用组件

组件选择器
formfieldnx-formfield
inputinput[nxInput]
buttonbutton[nxButton]
iconnx-icon
dropdownnx-dropdown
checkboxnx-checkbox
grid[nxLayout]
headline[nxHeadline]
copytext[nxCopytext]
linknx-link
accordionnx-accordion
popover[nxPopoverTriggerFor]
badgenx-badge
datefieldinput[nxDatefield]
modalnx-modal
messagenx-message
data-displaynx-data-display
table[nxHeaderCell]
tabsnx-tab
listul[nxList]
radio-togglenx-radio-toggle
tooltip[nxTooltip]
switchernx-switcher
spinnernx-spinner
paginationnx-pagination

按使用场景查找组件

  • 表单:autocomplete、checkbox、circle-toggle、code-input、datefield、dropdown、file-uploader、formfield、input、natural-language-form、phone-input、radio-toggle、rating、slider、switcher、timefield
  • 导航:breadcrumb、header、menu、tabs、pagination
  • 表格:comparison-table、dynamic-table、table
  • 反馈:badge、indicator、message、modal、notification-panel、progress-stepper、progressbar、spinner、tooltip
  • 布局:accordion、card、footer、grid、sidepanel、small-stage、toolbar
  • 覆盖层:modal、overlay、popover
  • 媒体:avatar、icon、image、video
  • 交互:action、button、link、page-search、signal-button
  • 选择:checkbox、circle-toggle、dropdown、radio-toggle、taglist

详细 API

如需了解完整组件 API(输入、输出、方法),请阅读项目已安装软件包中的组件文档: 通常位于 node_modules/@allianz/ng-aquila/mcp/generated/components/{component-name}.md,也可能因项目配置而位于类似路径。 备用方式:使用 glob 搜索 **/mcp/generated/**/。

评论

支持 Markdown