@keenaioc/data-view 0.0.0-poc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @keenaioc/data-view
2
+
3
+ HomeYa 共用資料視圖的跨 Sites 引用驗證套件。
4
+
5
+ 目前的 `0.0.0-poc.*` 版本只驗證公開 npm 安裝、React/CSS 入口、固定版本升級與回退。它不是正式 V1,也不包含業務資料、資料庫連線或 HomeYa 專案設定。
6
+
7
+ 正式版本將以 HomeYa 設計待辦工作台的既有表格成果為主要來源,抽出欄位註冊、表格操作、檢視設定與通用資料/權限介面。
8
+
9
+ ```bash
10
+ npm install --save-exact @keenaioc/data-view@0.0.0-poc.1
11
+ ```
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function normalizeColumnWidth(width: number): number;
2
+ export declare const dataViewVersion: string;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export function normalizeColumnWidth(width) {
2
+ const finiteWidth = Number.isFinite(width) ? width : 56;
3
+ return Math.min(600, Math.max(56, Math.round(finiteWidth)));
4
+ }
5
+ export const dataViewVersion = "0.0.0-poc.1";
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@keenaioc/data-view",
3
+ "version": "0.0.0-poc.1",
4
+ "description": "HomeYa shared data-view engine (feasibility preview)",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "publishConfig": {
8
+ "access": "public",
9
+ "tag": "next"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./index.d.ts",
14
+ "import": "./index.js"
15
+ },
16
+ "./react": {
17
+ "types": "./react.d.ts",
18
+ "import": "./react.js"
19
+ },
20
+ "./style.css": "./style.css"
21
+ },
22
+ "files": [
23
+ "README.md",
24
+ "index.js",
25
+ "index.d.ts",
26
+ "react.js",
27
+ "react.d.ts",
28
+ "style.css"
29
+ ],
30
+ "sideEffects": [
31
+ "*.css"
32
+ ],
33
+ "peerDependencies": {
34
+ "react": "^19.0.0"
35
+ }
36
+ }
package/react.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type {ReactElement} from "react";
2
+ export declare function WidthProbe(): ReactElement;
package/react.js ADDED
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {createElement, useState} from "react";
3
+ import {normalizeColumnWidth} from "./index.js";
4
+ // Feasibility probe only; not the final table component.
5
+ export function WidthProbe() {
6
+ const [width,setWidth]=useState(220);
7
+ return createElement("label",{className:"hy-width-probe"},"欄寬測試 ",createElement("input",{type:"number",value:width,min:56,max:600,onChange:e=>setWidth(normalizeColumnWidth(Number(e.target.value)))}));
8
+ }
package/style.css ADDED
@@ -0,0 +1 @@
1
+ .hy-width-probe{display:block;font-size:1rem;color:#18334d}.hy-width-probe input{width:6rem;border:1px solid #64748b;padding:0.5rem}