Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计提醒

sap-sac-custom-widgetSAP sac 自定义小部件

Agent Skill

sap-sac-custom-widget 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,175

周安装

48

GitHub Stars

239

下载量

380
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sap-sac-custom-widget(SAP sac 自定义小部件)
来源仓库:https://github.com/secondsky/sap-skills
仓库路径:skills/sap-sac-custom-widget
安装命令:
npx skills add https://github.com/secondsky/sap-skills --skill sap-sac-custom-widget
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/secondsky/sap-skills --skill sap-sac-custom-widget

简介

用于查找、检索和筛选 SAP SAC 自定义小部件相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词快速定位资料。
  • 通过 npx skills add 命令从 GitHub 仓库安装使用。
  • 建议确认权限范围和维护状态,避免触发联网或文件读写操作。
  • 可结合原始 README 进一步核验具体用法和功能边界。

SKILL.md

SAP Analytics Cloud Custom Widget Development

Table of Contents

Overview

This skill enables development of custom widgets for SAP Analytics Cloud (SAC). Custom widgets are Web Components that extend SAC stories and applications with custom visualizations, interactive elements, and specialized functionality.

Use this skill when:

  • Building custom visualizations not available in standard SAC
  • Integrating third-party charting libraries (ECharts, D3.js, Chart.js)
  • Creating interactive input components for SAC applications
  • Implementing specialized data displays or KPI widgets
  • Extending Analytics Designer applications with custom functionality
  • Troubleshooting custom widget loading or data binding issues

Requirements:

  • SAC tenant with Optimized Story Experience or Analytics Designer
  • JavaScript/Web Components knowledge
  • External hosting (GitHub Pages, AWS S3, Azure) OR SAC-hosted resources (QRC Q2 2023+)

Plugin Components

This plugin provides specialized agents, commands, and validation hooks for comprehensive widget development support.

Agents

AgentColorPurposeTrigger Examples
widget-architectBlueDesign widget structure, metadata, and integration patterns"design custom widget", "plan widget architecture"
widget-debuggerYellowTroubleshoot loading, data binding, CORS, and runtime issues"widget won't load", "CORS error", "data not binding"
widget-api-assistantGreenWrite JavaScript widget code, lifecycle functions, API integrations"write widget code", "implement lifecycle functions"

Commands

CommandUsageDescription
/widget-validate/widget-validate [file]Validate widget.json schema and widget.js structure
/widget-generate/widget-generateInteractively generate widget scaffold with JSON + JS
/widget-lint/widget-lint [file]Performance, security, and best practices analysis

Validation Hooks

Automatic quality checks triggered on Write/Edit operations:

  • widget.json: Required fields, tag naming, property types, data binding config
  • widget.js: Lifecycle functions, Shadow DOM, propertiesChanged dispatch
  • Performance: Resize debouncing, chart disposal, XSS prevention
  • Context Reminders: Template suggestions, command recommendations

Templates

Ready-to-use scaffolds in templates/ directory:

  • basic-widget.js - Minimal Web Component with all lifecycle functions
  • data-bound-chart.js - ECharts widget with data binding
  • styling-panel.js - Runtime customization panel
  • widget.json-minimal - Bare-minimum metadata
  • widget.json-complete - Full-featured metadata with all options

Quick Start

Minimal Custom Widget Structure

A custom widget requires two files:

1. widget.json (Metadata)

{
  "id": "com.company.mywidget",
  "version": "1.0.0",
  "name": "My Custom Widget",
  "description": "A simple custom widget",
  "vendor": "Company Name",
  "license": "MIT",
  "icon": "",
  "webcomponents": [
    {
      "kind": "main",
      "tag": "my-custom-widget",
      "url": "[https://your-host.com/widget.js",](https://your-host.com/widget.js",)
      "integrity": "",
      "ignoreIntegrity": true
    }
  ],
  "properties": {
    "title": {
      "type": "string",
      "default": "My Widget"
    }
  },
  "methods": {},
  "events": {}
}

2. widget.js (Web Component)

(function() {
  const template = document.createElement("template");
  template.innerHTML = `
    <style>
      :host {
        display: block;
        width: 100%;
        height: 100%;
      }
      .container {
        padding: 16px;
        font-family: Arial, sans-serif;
      }
    </style>
    <div class="container">
      <h3 id="title">My Widget</h3>
      <div id="content"></div>
    </div>
  `;

  class MyCustomWidget extends HTMLElement {
    constructor() {
      super();
      this._shadowRoot = this.attachShadow({ mode: "open" });
      this._shadowRoot.appendChild(template.content.cloneNode(true));
      this._props = {};
    }

    connectedCallback() {
      // Called when element is added to DOM
    }

    onCustomWidgetBeforeUpdate(changedProperties) {
      // Called BEFORE properties are updated
      this._props = { ...this._props, ...changedProperties };
    }

    onCustomWidgetAfterUpdate(changedProperties) {
      // Called AFTER properties are updated - render here
      if (changedProperties.title !== undefined) {
        this._shadowRoot.getElementById("title").textContent = changedProperties.title;
      }
    }

    onCustomWidgetResize() {
      // Called when widget is resized
    }

    onCustomWidgetDestroy() {
      // Cleanup when widget is removed
    }

    // Property getter/setter (required for SAC framework)
    get title() {
      return this._props.title;
    }
    set title(value) {
      this._props.title = value;
      this.dispatchEvent(new CustomEvent("propertiesChanged", {
        detail: { properties: { title: value } }
      }));
    }
  }

  customElements.define("my-custom-widget", MyCustomWidget);
})();

⚠️ Production Note: The ignoreIntegrity: true setting above is development only. For production deployments, generate a SHA256 integrity hash and set ignoreIntegrity: false.


Community Sample Widgets

SAP provides 15+ ready-to-use custom widget samples:

Repository: SAP-samples/SAC_Custom_Widgets

CategoryWidgets
ChartsFunnel, Pareto, Sankey, Sunburst, Tree, Line, UI5 Gantt
KPI/GaugeKPI Ring, Gauge Grade, Half Donut, Nested Pie, Custom Pie
UtilitiesFile Upload, Word Cloud, Bar Gradient, Widget Add-on Sample

Requirements: Optimized View Mode (OVM) enabled, data binding support

Note: Check third-party library licenses before production use.


Key Concepts

Lifecycle Functions

Essential functions called by SAC framework:

  • onCustomWidgetBeforeUpdate(changedProperties) - Pre-update hook
  • onCustomWidgetAfterUpdate(changedProperties) - Post-update (render here)
  • onCustomWidgetResize() - Handle resize events
  • onCustomWidgetDestroy() - Cleanup resources

Data Binding

Configure in widget.json to receive SAC model data:

{
  "dataBindings": {
    "myDataBinding": {
      "feeds": [
        {
          "id": "dimensions",
          "description": "Dimensions",
          "type": "dimension"
        },
        {
          "id": "measures",
          "description": "Measures",
          "type": "mainStructureMember"
        }
      ]
    }
  }
}

Access data in JavaScript:

// Get data binding
const dataBinding = this.dataBindings.getDataBinding("myDataBinding");

// Access result set
const data = this.myDataBinding.data;
const metadata = this.myDataBinding.metadata;

// Iterate over rows
this.myDataBinding.data.forEach(row => {
  const dimensionValue = row.dimensions_0.label;
  const measureValue = row.measures_0.raw;
});

Hosting Options

1. SAC-Hosted (Recommended, QRC Q2 2023+)

  • Upload files directly to SAC > Files > Public Files
  • Use relative paths: "/path/to/widget.js"
  • Set "integrity": "" and "ignoreIntegrity": true

2. GitHub Pages

3. External Web Server

  • AWS S3, Azure Blob, or any HTTPS server
  • Must include CORS headers: Access-Control-Allow-Origin: *

Security: Integrity Hash

For production, generate SHA256 hash:

# Generate hash
openssl dgst -sha256 -binary widget.js | openssl base64 -A

# Update JSON
"integrity": "sha256-abc123...",
"ignoreIntegrity": false

Common Errors & Solutions

ErrorCauseSolution
"The system couldn't load the custom widget"Incorrect URL or hosting issueVerify URL is accessible, check CORS
"Integrity check failed"Hash mismatchRegenerate hash after JS changes
Widget not appearingMissing connectedCallback renderCall render in onCustomWidgetAfterUpdate
Properties not updatingMissing propertiesChanged dispatchUse dispatchEvent with propertiesChanged
Data not displayingData binding misconfiguredVerify feeds in JSON match usage

Debugging

Browser DevTools

  1. Open Chrome DevTools (F12)
  2. Sources tab: Find widget.js, set breakpoints
  3. Console tab: View console.log output
  4. Network tab: Check if files load (200 status)

Debug Pattern

onCustomWidgetAfterUpdate(changedProperties) {
  console.log("Widget updated:", changedProperties);
  console.log("Current props:", this._props);
  console.log("Data binding:", this.myDataBinding?.data);
  this._render();
}

Widget Add-Ons (QRC Q4 2023+)

Widget Add-Ons extend built-in SAC widgets without building from scratch.

Use Cases:

  • Customize chart tooltips
  • Add visual elements to plot areas
  • Override built-in styling

Supported Charts: Bar/Column, Stacked Bar/Column, Line, Stacked Area, Numeric Point

Key Differences:

  • Only main and builder components (no styling)
  • Must specify extension target (tooltip, plotArea, numericPoint)
  • SAC provides chart context data via methods

See references/widget-addon-guide.md for complete implementation.


Bundled Resources

Templates (Ready-to-Use Code)

  • templates/basic-widget.js - Minimal Web Component scaffold (~60 lines)
  • templates/data-bound-chart.js - ECharts widget with SAC data binding (~120 lines)
  • templates/styling-panel.js - Styling panel for runtime customization (~150 lines)
  • templates/widget.json-minimal - Bare-minimum metadata (~25 lines)
  • templates/widget.json-complete - Full-featured metadata (~100 lines)

Reference Documentation

  1. references/json-schema-reference.md - Complete JSON schema documentation
  2. references/widget-templates.md - Additional widget template patterns (6 templates)
  3. references/echarts-integration.md - ECharts library integration guide
  4. references/widget-addon-guide.md - Widget Add-On development (QRC Q4 2023+)
  5. references/best-practices-guide.md - Performance, security, and development guidelines
  6. references/advanced-topics.md - Custom types, script API types, installation
  7. references/integration-and-migration.md - Script integration, content transport
  8. references/script-api-reference.md - DataSource, Selection, MemberInfo APIs

Official Documentation Links

Primary References (for skill updates):

Sample Widgets:


Version History

v2.0.0 (2025-12-27)

  • Added 3 specialized agents: widget-architect, widget-debugger, widget-api-assistant
  • Added 3 slash commands: /widget-validate, /widget-generate, /widget-lint
  • Added validation hooks for automatic quality checks on Write/Edit
  • Added 5 production-ready templates in templates/ directory
  • Enhanced plugin structure to match comprehensive plugin pattern
  • Updated last verified date

v1.2.0 (2025-11-26)

  • Updated SAC version reference to 2025.21
  • Optimized SKILL.md length from 563 to ~200 lines
  • Added Table of Contents to all 8 reference files
  • Improved progressive disclosure architecture

v1.1.0 (2025-11-22)

  • Added Widget Add-On feature documentation (QRC Q4 2023+)
  • Added best practices guide (performance, security, development)
  • Added advanced topics (custom types, script API types, installation)
  • Enhanced description with additional keywords
  • Increased error prevention coverage to 25+

v1.0.0 (2025-11-22)

  • Initial release
  • Complete JSON metadata reference
  • Lifecycle functions documentation
  • Data binding guide
  • Styling panel implementation
  • Hosting options (SAC-hosted, GitHub, external)
  • Security (integrity hash, CORS)
  • Common errors and debugging

Last Verified: 2025-12-27 | SAC Version: 2025.21 | Skill Version: 2.0.0

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.02%
按下载量换算137

Claude

28.31%
按下载量换算108

Cursor

18.93%
按下载量换算72

Gemini CLI

9.32%
按下载量换算35

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills