open-grid 1.5.1 → 1.6.0
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/CHANGELOG.md +460 -418
- package/README.ja.md +39 -0
- package/README.md +39 -0
- package/README.zh.md +39 -0
- package/dist/{OpenGrid-CT9bV6On.cjs → OpenGrid-DgZtbVD0.cjs} +343 -338
- package/dist/{OpenGrid-DACnZdEy.js → OpenGrid-E11B7Xa7.js} +782 -777
- package/dist/angular/fesm2022/open-grid-angular.mjs +247 -0
- package/dist/angular/index.d.ts +5 -0
- package/dist/angular/lib/open-grid.component.d.ts +97 -0
- package/dist/angular/public-api.d.ts +6 -0
- package/dist/{index-Brfso4Ry.cjs → index-B_e5BXnW.cjs} +2 -2
- package/dist/{index-al9Mbv3E.js → index-Brnev66-.js} +2 -2
- package/dist/open-grid-base.css +4 -4
- package/dist/open-grid-header.cjs +4 -4
- package/dist/open-grid-header.css +21 -21
- package/dist/open-grid-header.js +4 -4
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-skins.css +2 -2
- package/dist/open-grid-themes.css +48 -48
- package/dist/open-grid-typography.cjs +2 -2
- package/dist/open-grid-typography.js +2 -2
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/core/DetailManager.d.ts +1 -1
- package/dist/types/core/ExportManager.d.ts +7 -0
- package/dist/types/core/ExtensionPointRegistry.d.ts +2 -2
- package/dist/types/core/OpenGrid.d.ts +14 -9
- package/dist/types/core/appearance/AppearanceAxis.d.ts +54 -6
- package/dist/types/core/appearance/HeaderRegistry.d.ts +213 -21
- package/dist/types/core/appearance/TypographyRegistry.d.ts +63 -3
- package/dist/types/core/chart/DataExtractor.d.ts +1 -1
- package/dist/types/core/detail/DetailGlyph.d.ts +3 -3
- package/dist/types/core/types.d.ts +9 -9
- package/dist/types/header/index.d.ts +146 -6
- package/dist/types/typography/index.d.ts +134 -4
- package/package.json +42 -13
- package/dist/OpenGrid-CT9bV6On.cjs.map +0 -1
- package/dist/OpenGrid-DACnZdEy.js.map +0 -1
- package/dist/Registry-CPJYOqCn.js.map +0 -1
- package/dist/Registry-D74ZmdDz.cjs.map +0 -1
- package/dist/index-Brfso4Ry.cjs.map +0 -1
- package/dist/index-CeJ-0-80.cjs.map +0 -1
- package/dist/index-DnarQ4eR.js.map +0 -1
- package/dist/index-al9Mbv3E.js.map +0 -1
- package/dist/open-grid-header.cjs.map +0 -1
- package/dist/open-grid-header.js.map +0 -1
- package/dist/open-grid-react.cjs.map +0 -1
- package/dist/open-grid-react.js.map +0 -1
- package/dist/open-grid-typography.cjs.map +0 -1
- package/dist/open-grid-typography.js.map +0 -1
- package/dist/open-grid-vue.cjs.map +0 -1
- package/dist/open-grid-vue.js.map +0 -1
- package/dist/open-grid.cjs.map +0 -1
- package/dist/open-grid.js.map +0 -1
- package/dist/xlsx.min-BQ1o3sB6.cjs.map +0 -1
- package/dist/xlsx.min-Bbz2ZypC.js.map +0 -1
|
@@ -1635,7 +1635,7 @@ export interface EditorDef {
|
|
|
1635
1635
|
}
|
|
1636
1636
|
/**
|
|
1637
1637
|
* 컬럼 한 개를 어떻게 보이고 동작하게 할지 담는 설정 뭉치입니다. 그리드는 `columns` 배열에 담긴 이
|
|
1638
|
-
* 정의들을 왼쪽부터 순서대로 그립니다. 최소한 `field`(어떤 데이터를 보여줄지)와 `header`(
|
|
1638
|
+
* 정의들을 왼쪽부터 순서대로 그립니다. 최소한 `field`(어떤 데이터를 보여줄지)와 `header`(헤더 글자)만
|
|
1639
1639
|
* 있으면 되고, 나머지는 필요할 때만 켜는 선택 항목입니다.
|
|
1640
1640
|
*
|
|
1641
1641
|
* The settings bundle for a single column — what it shows and how it behaves. The grid draws the
|
|
@@ -1672,7 +1672,7 @@ export interface ColumnDef<T = any> {
|
|
|
1672
1672
|
*/
|
|
1673
1673
|
field: string;
|
|
1674
1674
|
/**
|
|
1675
|
-
*
|
|
1675
|
+
* 헤더에 보일 글자. 문자열 안의 '\n' 은 두 줄로 나뉩니다.
|
|
1676
1676
|
*
|
|
1677
1677
|
* The caption shown in the header. A '\n' inside splits into two lines.
|
|
1678
1678
|
*
|
|
@@ -1844,7 +1844,7 @@ export interface ColumnDef<T = any> {
|
|
|
1844
1844
|
*/
|
|
1845
1845
|
headerStyle?: CSSProperties;
|
|
1846
1846
|
/**
|
|
1847
|
-
* 이 컬럼
|
|
1847
|
+
* 이 컬럼 헤더를 클릭하면 정렬되게 할지. 특정 컬럼만 정렬을 막거나 허용할 때 씁니다.
|
|
1848
1848
|
*
|
|
1849
1849
|
* Whether clicking this header sorts. Use it to allow/deny sorting per column.
|
|
1850
1850
|
*
|
|
@@ -1864,7 +1864,7 @@ export interface ColumnDef<T = any> {
|
|
|
1864
1864
|
*/
|
|
1865
1865
|
filterable?: boolean;
|
|
1866
1866
|
/**
|
|
1867
|
-
*
|
|
1867
|
+
* 헤더 경계를 드래그해 폭을 조절하게 할지.
|
|
1868
1868
|
*
|
|
1869
1869
|
* Whether the user can drag the header edge to resize.
|
|
1870
1870
|
*
|
|
@@ -1904,7 +1904,7 @@ export interface ColumnDef<T = any> {
|
|
|
1904
1904
|
*/
|
|
1905
1905
|
wrap?: boolean;
|
|
1906
1906
|
/**
|
|
1907
|
-
*
|
|
1907
|
+
* 컬럼 헤더 줄바꿈: true 면 헤더 텍스트가 잘리지 않고 여러 줄로 줄바꿈된다.
|
|
1908
1908
|
* (셀 본문용 wrap 과 별개로 헤더에만 적용. header 문자열의 '\n' 은 headerWrap 여부와 무관하게 항상 줄바꿈됨)
|
|
1909
1909
|
* 줄바꿈된 헤더에 맞춰 헤더 행 높이가 자동으로 늘어난다.
|
|
1910
1910
|
*
|
|
@@ -2442,7 +2442,7 @@ export interface ExportOptions {
|
|
|
2442
2442
|
*/
|
|
2443
2443
|
sheetName?: string;
|
|
2444
2444
|
/**
|
|
2445
|
-
*
|
|
2445
|
+
* 헤더 행을 포함할지. 기본 true.
|
|
2446
2446
|
*
|
|
2447
2447
|
* Whether to include the header row. Default true.
|
|
2448
2448
|
*
|
|
@@ -2625,7 +2625,7 @@ export interface GridOptions<T = any> {
|
|
|
2625
2625
|
*/
|
|
2626
2626
|
rowHeight?: number;
|
|
2627
2627
|
/**
|
|
2628
|
-
*
|
|
2628
|
+
* 헤더 행의 높이(px). 여러 줄 헤더면 자동으로 늘어나므로 보통은 생략.
|
|
2629
2629
|
*
|
|
2630
2630
|
* Header row height (px). Grows automatically for multi-line headers, so usually omitted.
|
|
2631
2631
|
*
|
|
@@ -2829,7 +2829,7 @@ export interface GridOptions<T = any> {
|
|
|
2829
2829
|
*/
|
|
2830
2830
|
conditionalFormat?: import('./cf/CFRule.js').CFRule[];
|
|
2831
2831
|
/**
|
|
2832
|
-
*
|
|
2832
|
+
* 헤더 클릭 정렬을 그리드 전체에서 켤지. 컬럼별 sortable 로 예외를 둘 수 있습니다.
|
|
2833
2833
|
*
|
|
2834
2834
|
* Turn header-click sorting on grid-wide. Per-column sortable can override.
|
|
2835
2835
|
*
|
|
@@ -3206,7 +3206,7 @@ export interface GridOptions<T = any> {
|
|
|
3206
3206
|
*/
|
|
3207
3207
|
calcPrecision?: number;
|
|
3208
3208
|
/**
|
|
3209
|
-
*
|
|
3209
|
+
* 헤더를 드래그해 컬럼 순서를 바꾸게 할지.
|
|
3210
3210
|
*
|
|
3211
3211
|
* Whether headers can be dragged to reorder columns.
|
|
3212
3212
|
*
|
|
@@ -14,6 +14,16 @@ export type { RegisterOptions, RegisterResult, RegistryEntry } from '../core/ext
|
|
|
14
14
|
* The four built-in presets — id → shape-token delta.
|
|
15
15
|
*
|
|
16
16
|
* These mirror the fallbacks in the preset blocks of `src/styles/header.css`.
|
|
17
|
+
*
|
|
18
|
+
* 組み込みプリセット4種 — id → 形状トークンのデルタ。
|
|
19
|
+
*
|
|
20
|
+
* 値の正本は `src/styles/header.css` のプリセットブロックのフォールバックと同じです。要素の経路では
|
|
21
|
+
* CSS が、グリッドの経路ではこのデルタが、同じ形状に収束します。
|
|
22
|
+
*
|
|
23
|
+
* 内置预设4种 — id → 形状令牌增量。
|
|
24
|
+
*
|
|
25
|
+
* 值的正本与 `src/styles/header.css` 预设块的回退值相同。元素路径由 CSS,表格路径由这份增量,
|
|
26
|
+
* 收敛到同一个形状。
|
|
17
27
|
*/
|
|
18
28
|
export declare const HEADER_PRESETS: Readonly<Record<string, TokenDelta>>;
|
|
19
29
|
/**
|
|
@@ -23,13 +33,47 @@ export declare const HEADER_PRESETS: Readonly<Record<string, TokenDelta>>;
|
|
|
23
33
|
*
|
|
24
34
|
* - `'element'` — 컨테이너 요소에 `data-og-header` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
|
|
25
35
|
* - `'grid-vars'` — 그리드 공개 API 로 형태 토큰만 주입했다. 속성이 없어 **프리셋 규칙은 비활성**이다.
|
|
36
|
+
*
|
|
37
|
+
* `applyHeader` がどちらの経路で適用したか。
|
|
38
|
+
*
|
|
39
|
+
* - `'element'` — コンテナ要素に `data-og-header` を付けました。CSS プリセットがすべて働きます(完全適用)。
|
|
40
|
+
* - `'grid-vars'` — グリッドの公開 API で形状トークンだけを注入しました。属性がないので**プリセット規則は無効**です。
|
|
41
|
+
*
|
|
42
|
+
* `applyHeader` 走了哪条路径。
|
|
43
|
+
*
|
|
44
|
+
* - `'element'` — 给容器元素加上了 `data-og-header`。CSS 预设全部生效(完全应用)。
|
|
45
|
+
* - `'grid-vars'` — 通过表格公开 API 只注入了形状令牌。没有属性,因此**预设规则不生效**。
|
|
26
46
|
*/
|
|
27
47
|
export type HeaderApplyMode = 'element' | 'grid-vars';
|
|
28
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* `applyHeader` 결과.
|
|
50
|
+
*
|
|
51
|
+
* Result of `applyHeader`.
|
|
52
|
+
*
|
|
53
|
+
* `applyHeader` の結果。
|
|
54
|
+
*
|
|
55
|
+
* `applyHeader` 的结果。
|
|
56
|
+
*/
|
|
29
57
|
export interface HeaderApplyResult {
|
|
30
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* 적용 경로.
|
|
60
|
+
*
|
|
61
|
+
* The path taken.
|
|
62
|
+
*
|
|
63
|
+
* 適用した経路。
|
|
64
|
+
*
|
|
65
|
+
* 采用的路径。
|
|
66
|
+
*/
|
|
31
67
|
readonly mode: HeaderApplyMode;
|
|
32
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용.
|
|
70
|
+
*
|
|
71
|
+
* Honest notices; empty means fully applied.
|
|
72
|
+
*
|
|
73
|
+
* 正直な注意書き(経路の制約・未登録 id など)。空配列なら完全適用。
|
|
74
|
+
*
|
|
75
|
+
* 如实告知(路径限制、未注册 id 等)。空数组表示完全应用。
|
|
76
|
+
*/
|
|
33
77
|
readonly warnings: string[];
|
|
34
78
|
}
|
|
35
79
|
/**
|
|
@@ -39,12 +83,22 @@ export interface HeaderApplyResult {
|
|
|
39
83
|
* 하기 위함이다. `setThemeVar(k, v)` 는 컨테이너 인라인 CSS 변수를 세팅하는 공개 메서드다.
|
|
40
84
|
*
|
|
41
85
|
* The minimal shape the grid path needs — `OpenGrid` satisfies it structurally.
|
|
86
|
+
*
|
|
87
|
+
* グリッドの経路が要求する最小構造 — `OpenGrid` が構造的に満たします。
|
|
88
|
+
*
|
|
89
|
+
* `OpenGrid` を型として import しないのは、プラグインのバンドルがコアの型グラフに縛られないように
|
|
90
|
+
* するためです。`setThemeVar(k, v)` はコンテナのインライン CSS 変数を設定する公開メソッドです。
|
|
91
|
+
*
|
|
92
|
+
* 表格路径所要求的最小结构 — `OpenGrid` 在结构上满足它。
|
|
93
|
+
*
|
|
94
|
+
* 不把 `OpenGrid` 作为类型 import,是为了让插件的包不被绑进核心的类型图。`setThemeVar(k, v)` 是
|
|
95
|
+
* 在容器上设置内联 CSS 变量的公开方法。
|
|
42
96
|
*/
|
|
43
97
|
export interface HeaderGridTarget {
|
|
44
98
|
setThemeVar(name: string, value: string): void;
|
|
45
99
|
}
|
|
46
100
|
/**
|
|
47
|
-
*
|
|
101
|
+
* 헤더 프리셋을 적용한다. 코어 무수정 경로.
|
|
48
102
|
*
|
|
49
103
|
* **두 경로가 있고, 능력 차이가 타이포 축보다 훨씬 크다. 정직하게 밝힌다.**
|
|
50
104
|
*
|
|
@@ -69,18 +123,64 @@ export interface HeaderGridTarget {
|
|
|
69
123
|
* preset rules are attribute-conditional, this path produces almost no visible change — this is
|
|
70
124
|
* returned as a warning rather than failing silently.
|
|
71
125
|
*
|
|
126
|
+
* ヘッダープリセットを適用します。コアの修正は要りません。
|
|
127
|
+
*
|
|
128
|
+
* **経路は2つあり、その能力差はタイポグラフィ軸よりずっと大きいです。正直に明かします。**
|
|
129
|
+
*
|
|
130
|
+
* 1. `target` が **HTMLElement**(グリッドのコンテナ = `.og-container`)なら `data-og-header` 属性を
|
|
131
|
+
* 付けます。`header.css` のプリセットブロックがすべて生きます。**この経路が完全版であり、
|
|
132
|
+
* `open-grid/header.css` の読み込みが前提です。** 値をインライン化しないのは、インラインスタイルが
|
|
133
|
+
* プリセットの T1(トークン再定義)規則より強く、プリセットを上書きしてしまうからです。
|
|
134
|
+
* 2. `target` が **グリッドインスタンス**なら、公開 API の `setThemeVar()` で形状トークン8個だけを
|
|
135
|
+
* インライン注入します。`OpenGrid` はコンテナ要素を返す公開アクセサーを提供しないため
|
|
136
|
+
* (`_container` は private)、**属性を付ける手段がありません。** ヘッダー軸はプリセットのほとんどが
|
|
137
|
+
* 属性条件付きセレクターなので、**この経路では事実上まったく変化がありません** — タイポグラフィ軸と
|
|
138
|
+
* 違って「半分」ではなく「ほぼ無動作」です。その事実を警告として返します。
|
|
139
|
+
*
|
|
140
|
+
* 完全に適用したいときは、コンテナ要素を直接渡してください(`document.querySelector('.og-container')`)。
|
|
141
|
+
*
|
|
142
|
+
* 应用表头预设。不需要修改核心。
|
|
143
|
+
*
|
|
144
|
+
* **有两条路径,能力差距比排版轴大得多。这里如实说明。**
|
|
145
|
+
*
|
|
146
|
+
* 1. `target` 是 **HTMLElement**(表格容器 = `.og-container`)时,加上 `data-og-header` 属性。
|
|
147
|
+
* `header.css` 的预设块全部生效。**这条路径才是完整版,前提是加载了 `open-grid/header.css`。**
|
|
148
|
+
* 不把值内联的理由是: 内联样式比预设的 T1(令牌重定义)规则更强,会把预设覆盖掉。
|
|
149
|
+
* 2. `target` 是**表格实例**时,通过公开的 `setThemeVar()` 只内联注入8个形状令牌。`OpenGrid` 不提供
|
|
150
|
+
* 返回容器元素的公开访问器(`_container` 是 private),因此**没有办法加上属性**。表头轴的预设几乎
|
|
151
|
+
* 全是属性条件选择器,所以**这条路径实际上什么也不会变** — 与排版轴不同,不是「一半」而是
|
|
152
|
+
* 「几乎不动」。这个事实会作为警告返回。
|
|
153
|
+
*
|
|
154
|
+
* 需要完全应用时,请直接传入容器元素(`document.querySelector('.og-container')`)。
|
|
155
|
+
*
|
|
72
156
|
* @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
|
|
73
157
|
*
|
|
74
158
|
* The grid container element, or a grid instance
|
|
75
|
-
*
|
|
159
|
+
*
|
|
160
|
+
* グリッドのコンテナ要素、またはグリッドインスタンス
|
|
161
|
+
*
|
|
162
|
+
* 表格容器元素,或表格实例
|
|
163
|
+
* @param id - 프리셋 id(`'default'` 는 축 해제 = 오늘의 헤더)
|
|
76
164
|
*
|
|
77
165
|
* Preset id (`'default'` clears the axis)
|
|
166
|
+
*
|
|
167
|
+
* プリセット id(`'default'` は軸の解除 = 今のヘッダーそのまま)
|
|
168
|
+
*
|
|
169
|
+
* 预设 id(`'default'` 为解除该轴 = 保持现在的表头)
|
|
78
170
|
* @returns 적용 경로 + 정직 고지
|
|
79
171
|
*
|
|
80
172
|
* The path taken plus honest notices
|
|
173
|
+
*
|
|
174
|
+
* 適用した経路 + 正直な注意書き
|
|
175
|
+
*
|
|
176
|
+
* 采用的路径 + 如实告知
|
|
81
177
|
* @throws target 이 요소도 그리드도 아니면 Error
|
|
82
178
|
*
|
|
83
179
|
* Throws when the target is neither an element nor a grid
|
|
180
|
+
*
|
|
181
|
+
* target が要素でもグリッドでもなければ Error
|
|
182
|
+
*
|
|
183
|
+
* target 既不是元素也不是表格时抛出 Error
|
|
84
184
|
* @example
|
|
85
185
|
* import { applyHeader } from 'open-grid/header';
|
|
86
186
|
* import 'open-grid/header.css';
|
|
@@ -92,7 +192,7 @@ export declare function applyHeader(target: HTMLElement | HeaderGridTarget, id:
|
|
|
92
192
|
/**
|
|
93
193
|
* 사용자 정의 프리셋 등록.
|
|
94
194
|
*
|
|
95
|
-
*
|
|
195
|
+
* 색·타이포그래피·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 섞임 금지).
|
|
96
196
|
* 특히 `--og-header-bg` 처럼 **접두사가 같아 헤더 것처럼 보이는 색 토큰**도 거부한다 —
|
|
97
197
|
* 그것은 테마 축 소유다. 불투명도는 0~1 로, 음수 길이는 0 으로 클램프하고 경고한다.
|
|
98
198
|
*
|
|
@@ -108,18 +208,54 @@ export declare function applyHeader(target: HTMLElement | HeaderGridTarget, id:
|
|
|
108
208
|
* Built-ins are protected: re-registering `'rule'` without `{ override: true }` is rejected and the
|
|
109
209
|
* reason comes back in `registration` — it never throws. The sibling axes lack this protection.
|
|
110
210
|
*
|
|
211
|
+
* ユーザー定義プリセットの登録。
|
|
212
|
+
*
|
|
213
|
+
* 色・タイポグラフィ・密度・質感のトークンが混ざっていると、登録ゲートが即座に throw します
|
|
214
|
+
* (軸の混在は禁止)。とくに `--og-header-bg` のように**接頭辞が同じでヘッダーのものに見える色トークン**も
|
|
215
|
+
* 拒否します — それはテーマ軸の所有です。不透明度は 0~1 に、負の長さは 0 にクランプして警告します。
|
|
216
|
+
*
|
|
217
|
+
* **組み込み5種は黙って上書きされません。** `{ override: true }` なしで `'rule'` を再登録すると拒否され、
|
|
218
|
+
* 理由が `registration` で返ります(throw はしません)。兄弟軸(密度・質感・タイポグラフィ)にはこの保護が
|
|
219
|
+
* なく、組み込みの値が音もなく消えます — ヘッダー軸が初めて持つ安全装置です。
|
|
220
|
+
*
|
|
221
|
+
* 注册用户自定义预设。
|
|
222
|
+
*
|
|
223
|
+
* 混进颜色、排版、密度、质感的令牌时,注册关卡立即 throw(禁止轴混用)。尤其是像 `--og-header-bg`
|
|
224
|
+
* 这种**前缀相同、看着像表头的颜色令牌**也会被拒绝 — 那归主题轴所有。不透明度钳制到 0~1,负长度
|
|
225
|
+
* 钳制到 0,并给出警告。
|
|
226
|
+
*
|
|
227
|
+
* **内置5种不会被静默覆盖。** 不带 `{ override: true }` 重新注册 `'rule'` 会被拒绝,理由通过
|
|
228
|
+
* `registration` 返回(不 throw)。兄弟轴(密度、质感、排版)没有这道保护,内置值会无声消失 — 这是
|
|
229
|
+
* 表头轴第一次拥有的安全装置。
|
|
230
|
+
*
|
|
111
231
|
* @param id - 프리셋 id
|
|
112
232
|
*
|
|
113
233
|
* Preset id
|
|
234
|
+
*
|
|
235
|
+
* プリセット id
|
|
236
|
+
*
|
|
237
|
+
* 预设 id
|
|
114
238
|
* @param delta - 헤더 형태 토큰 델타
|
|
115
239
|
*
|
|
116
240
|
* Header shape-token delta
|
|
241
|
+
*
|
|
242
|
+
* ヘッダー形状トークンのデルタ
|
|
243
|
+
*
|
|
244
|
+
* 表头形状令牌增量
|
|
117
245
|
* @param opts - 등록 정책 옵션(`override`·`pluginId`·`priority`) + 프리셋 메타
|
|
118
246
|
*
|
|
119
247
|
* Registration policy options plus preset metadata
|
|
248
|
+
*
|
|
249
|
+
* 登録ポリシーのオプション(`override`・`pluginId`・`priority`)+ プリセットのメタ情報
|
|
250
|
+
*
|
|
251
|
+
* 注册策略选项(`override`、`pluginId`、`priority`)+ 预设元信息
|
|
120
252
|
* @returns 클램프 반영된 델타 + 경고 + 등록 판정
|
|
121
253
|
*
|
|
122
254
|
* The clamped delta, warnings, and the registration verdict
|
|
255
|
+
*
|
|
256
|
+
* クランプを反映したデルタ + 警告 + 登録の判定
|
|
257
|
+
*
|
|
258
|
+
* 钳制后的增量 + 警告 + 注册判定
|
|
123
259
|
* @example
|
|
124
260
|
* defineHeader('hairline', { '--og-header-rule-width': '1px', '--og-header-hint-opacity': '0.3' });
|
|
125
261
|
*
|
|
@@ -140,5 +276,9 @@ export declare function defineHeader(id: string, delta: TokenDelta, opts?: Regis
|
|
|
140
276
|
* 등록된 프리셋 id 목록(피커 UI·인스펙터용).
|
|
141
277
|
*
|
|
142
278
|
* Registered preset ids (for picker UIs and inspectors).
|
|
279
|
+
*
|
|
280
|
+
* 登録済みプリセット id の一覧(ピッカー UI・インスペクター用)。
|
|
281
|
+
*
|
|
282
|
+
* 已注册的预设 id 列表(供预设选择 UI 与检查器使用)。
|
|
143
283
|
*/
|
|
144
284
|
export declare function listHeader(): string[];
|
|
@@ -11,6 +11,16 @@ export type { TokenDelta } from '../core/appearance/AppearanceAxis.js';
|
|
|
11
11
|
*
|
|
12
12
|
* These values mirror the preset blocks in `src/styles/typography.css`: the element path is
|
|
13
13
|
* driven by CSS, the grid path by this delta, and both land on the same tokens.
|
|
14
|
+
*
|
|
15
|
+
* 組み込みプリセット7種 — id → トークンのデルタ。
|
|
16
|
+
*
|
|
17
|
+
* 値の正本は `src/styles/typography.css` のプリセットブロックと同じです。要素の経路では CSS が、
|
|
18
|
+
* グリッドの経路ではこのデルタが、同じ結果を出します(§「2つの経路」参照)。
|
|
19
|
+
*
|
|
20
|
+
* 内置预设7种 — id → 令牌增量。
|
|
21
|
+
*
|
|
22
|
+
* 值的正本与 `src/styles/typography.css` 的预设块相同。元素路径由 CSS 驱动,表格路径由这份增量
|
|
23
|
+
* 驱动,两条路径落到同一个结果(参见§「两条路径」)。
|
|
14
24
|
*/
|
|
15
25
|
export declare const TYPOGRAPHY_PRESETS: Readonly<Record<string, TokenDelta>>;
|
|
16
26
|
/**
|
|
@@ -20,13 +30,47 @@ export declare const TYPOGRAPHY_PRESETS: Readonly<Record<string, TokenDelta>>;
|
|
|
20
30
|
*
|
|
21
31
|
* - `'element'` — 컨테이너 요소에 `data-og-typography` 를 붙였다. CSS 프리셋이 전부 작동한다(완전 적용).
|
|
22
32
|
* - `'grid-vars'` — 그리드 공개 API 로 CSS 변수만 주입했다. 속성이 없어 **속성 조건부 규칙은 비활성**이다.
|
|
33
|
+
*
|
|
34
|
+
* `applyTypography` がどちらの経路で適用したか。
|
|
35
|
+
*
|
|
36
|
+
* - `'element'` — コンテナ要素に `data-og-typography` を付けました。CSS プリセットがすべて働きます(完全適用)。
|
|
37
|
+
* - `'grid-vars'` — グリッドの公開 API で CSS 変数だけを注入しました。属性がないので**属性条件付き規則は無効**です。
|
|
38
|
+
*
|
|
39
|
+
* `applyTypography` 走了哪条路径。
|
|
40
|
+
*
|
|
41
|
+
* - `'element'` — 给容器元素加上了 `data-og-typography`。CSS 预设全部生效(完全应用)。
|
|
42
|
+
* - `'grid-vars'` — 通过表格公开 API 只注入了 CSS 变量。没有属性,因此**属性条件规则不生效**。
|
|
23
43
|
*/
|
|
24
44
|
export type TypographyApplyMode = 'element' | 'grid-vars';
|
|
25
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* `applyTypography` 결과.
|
|
47
|
+
*
|
|
48
|
+
* Result of `applyTypography`.
|
|
49
|
+
*
|
|
50
|
+
* `applyTypography` の結果。
|
|
51
|
+
*
|
|
52
|
+
* `applyTypography` 的结果。
|
|
53
|
+
*/
|
|
26
54
|
export interface TypographyApplyResult {
|
|
27
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* 적용 경로.
|
|
57
|
+
*
|
|
58
|
+
* The path taken.
|
|
59
|
+
*
|
|
60
|
+
* 適用した経路。
|
|
61
|
+
*
|
|
62
|
+
* 采用的路径。
|
|
63
|
+
*/
|
|
28
64
|
readonly mode: TypographyApplyMode;
|
|
29
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* 정직 고지(경로 제약·미등록 id 등). 빈 배열이면 완전 적용.
|
|
67
|
+
*
|
|
68
|
+
* Honest notices; empty means fully applied.
|
|
69
|
+
*
|
|
70
|
+
* 正直な注意書き(経路の制約・未登録 id など)。空配列なら完全適用。
|
|
71
|
+
*
|
|
72
|
+
* 如实告知(路径限制、未注册 id 等)。空数组表示完全应用。
|
|
73
|
+
*/
|
|
30
74
|
readonly warnings: string[];
|
|
31
75
|
}
|
|
32
76
|
/**
|
|
@@ -39,6 +83,16 @@ export interface TypographyApplyResult {
|
|
|
39
83
|
*
|
|
40
84
|
* `OpenGrid` is not imported as a type so the plugin bundle stays untangled from the core type
|
|
41
85
|
* graph. `setThemeVar(k, v)` is the public method that sets an inline CSS variable on the container.
|
|
86
|
+
*
|
|
87
|
+
* グリッドの経路が要求する最小構造 — `OpenGrid` が構造的に満たします。
|
|
88
|
+
*
|
|
89
|
+
* `OpenGrid` を型として import しないのは、プラグインのバンドルがコアの型グラフに縛られないように
|
|
90
|
+
* するためです。`setThemeVar(k, v)` はコンテナのインライン CSS 変数を設定する公開メソッドです。
|
|
91
|
+
*
|
|
92
|
+
* 表格路径所要求的最小结构 — `OpenGrid` 在结构上满足它。
|
|
93
|
+
*
|
|
94
|
+
* 不把 `OpenGrid` 作为类型 import,是为了让插件的包不被绑进核心的类型图。`setThemeVar(k, v)` 是
|
|
95
|
+
* 在容器上设置内联 CSS 变量的公开方法。
|
|
42
96
|
*/
|
|
43
97
|
export interface TypographyGridTarget {
|
|
44
98
|
setThemeVar(name: string, value: string): void;
|
|
@@ -72,18 +126,67 @@ export interface TypographyGridTarget {
|
|
|
72
126
|
* 2026-08: `_container` is private with no public getter), so the attribute cannot be set.
|
|
73
127
|
* Attribute-conditional rules therefore do not apply; this is returned as a warning.
|
|
74
128
|
*
|
|
129
|
+
* プリセットを適用します。コアの修正は要りません。
|
|
130
|
+
*
|
|
131
|
+
* **経路は2つあり、能力が違います。正直に明かします。**
|
|
132
|
+
*
|
|
133
|
+
* 1. `target` が **HTMLElement**(グリッドのコンテナ = `.og-container`)なら `data-og-typography`
|
|
134
|
+
* 属性を付けます。`typography.css` のプリセットブロック・密度の複合セレクター(オプティカルサイズ)・
|
|
135
|
+
* `:lang()` の漢字の分岐まですべて生きます。**この経路が完全版であり、
|
|
136
|
+
* `open-grid-typography.css` の読み込みが前提です**(値をインライン化しない理由: インラインは
|
|
137
|
+
* 複合セレクターの補正を上書きしてしまいます)。
|
|
138
|
+
* 2. `target` が **グリッドインスタンス**なら、公開 API の `setThemeVar()` で9個のトークンを
|
|
139
|
+
* インライン注入します。`OpenGrid` はコンテナ要素を返す公開アクセサーを提供しないため
|
|
140
|
+
* (2026-08 の調査結果: `_container` は private で、公開表面に getter はありません)、
|
|
141
|
+
* **属性を付ける手段がありません。** したがって
|
|
142
|
+
* `[data-og-typography="dense-scan"][data-og-density="compact"]` のような属性条件付き規則と、
|
|
143
|
+
* `cjk-doc` の `:lang()` の分岐は**働きません。** その事実を警告として返します。
|
|
144
|
+
*
|
|
145
|
+
* 完全に適用したいときは、コンテナ要素を直接渡してください(`document.querySelector('#myGrid')`)。
|
|
146
|
+
*
|
|
147
|
+
* 应用预设。不需要修改核心。
|
|
148
|
+
*
|
|
149
|
+
* **有两条路径,能力并不相同。这里如实说明。**
|
|
150
|
+
*
|
|
151
|
+
* 1. `target` 是 **HTMLElement**(表格容器 = `.og-container`)时,加上 `data-og-typography` 属性。
|
|
152
|
+
* `typography.css` 的预设块、密度复合选择器(光学尺寸)、`:lang()` 的汉字分支全部生效。
|
|
153
|
+
* **这条路径才是完整版,前提是加载了 `open-grid-typography.css`**(不把值内联的理由: 内联会
|
|
154
|
+
* 覆盖复合选择器的修正)。
|
|
155
|
+
* 2. `target` 是**表格实例**时,通过公开的 `setThemeVar()` 内联注入9个令牌。`OpenGrid` 不提供返回
|
|
156
|
+
* 容器元素的公开访问器(2026-08 核实: `_container` 是 private,公开表面上没有 getter),因此
|
|
157
|
+
* **没有办法加上属性**。于是 `[data-og-typography="dense-scan"][data-og-density="compact"]` 这类
|
|
158
|
+
* 属性条件规则,以及 `cjk-doc` 的 `:lang()` 分支**都不起作用**。这个事实会作为警告返回。
|
|
159
|
+
*
|
|
160
|
+
* 需要完全应用时,请直接传入容器元素(`document.querySelector('#myGrid')`)。
|
|
161
|
+
*
|
|
75
162
|
* @param target - 그리드 컨테이너 요소 또는 그리드 인스턴스
|
|
76
163
|
*
|
|
77
164
|
* The grid container element, or a grid instance
|
|
165
|
+
*
|
|
166
|
+
* グリッドのコンテナ要素、またはグリッドインスタンス
|
|
167
|
+
*
|
|
168
|
+
* 表格容器元素,或表格实例
|
|
78
169
|
* @param id - 프리셋 id(`'default'` 는 축 해제)
|
|
79
170
|
*
|
|
80
171
|
* Preset id (`'default'` clears the axis)
|
|
172
|
+
*
|
|
173
|
+
* プリセット id(`'default'` は軸の解除)
|
|
174
|
+
*
|
|
175
|
+
* 预设 id(`'default'` 为解除该轴)
|
|
81
176
|
* @returns 적용 경로 + 정직 고지
|
|
82
177
|
*
|
|
83
178
|
* The path taken plus honest notices
|
|
179
|
+
*
|
|
180
|
+
* 適用した経路 + 正直な注意書き
|
|
181
|
+
*
|
|
182
|
+
* 采用的路径 + 如实告知
|
|
84
183
|
* @throws target 이 요소도 그리드도 아니면 Error
|
|
85
184
|
*
|
|
86
185
|
* Throws when the target is neither an element nor a grid
|
|
186
|
+
*
|
|
187
|
+
* target が要素でもグリッドでもなければ Error
|
|
188
|
+
*
|
|
189
|
+
* target 既不是元素也不是表格时抛出 Error
|
|
87
190
|
* @example
|
|
88
191
|
* import { applyTypography } from 'open-grid/typography';
|
|
89
192
|
* import 'open-grid/dist/open-grid-typography.css';
|
|
@@ -95,7 +198,7 @@ export declare function applyTypography(target: HTMLElement | TypographyGridTarg
|
|
|
95
198
|
/**
|
|
96
199
|
* 사용자 정의 프리셋 등록.
|
|
97
200
|
*
|
|
98
|
-
* 색·형태·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축
|
|
201
|
+
* 색·형태·밀도·질감 토큰이 섞여 있으면 등록 게이트가 즉시 throw 한다(축 섞임 금지). 웹폰트
|
|
99
202
|
* 선언(`url(`/`@font-face`)도 throw. 음수 자간 × CJK 스택은 `normal` 로 클램프하고 경고한다.
|
|
100
203
|
*
|
|
101
204
|
* Register a user-defined preset.
|
|
@@ -104,15 +207,38 @@ export declare function applyTypography(target: HTMLElement | TypographyGridTarg
|
|
|
104
207
|
* and on web-font declarations. A negative tracking value on a CJK stack is clamped to `normal`
|
|
105
208
|
* with a warning.
|
|
106
209
|
*
|
|
210
|
+
* ユーザー定義プリセットの登録。
|
|
211
|
+
*
|
|
212
|
+
* 色・形状・密度・質感のトークンが混ざっていると、登録ゲートが即座に throw します(軸の混在は禁止)。
|
|
213
|
+
* ウェブフォント宣言(`url(`/`@font-face`)も throw します。負の字間 × CJK スタックは `normal` に
|
|
214
|
+
* クランプして警告します。
|
|
215
|
+
*
|
|
216
|
+
* 注册用户自定义预设。
|
|
217
|
+
*
|
|
218
|
+
* 混进颜色、形状、密度、质感的令牌时,注册关卡立即 throw(禁止轴混用)。网页字体声明
|
|
219
|
+
* (`url(`/`@font-face`)同样 throw。负字距 × CJK 字体栈会被钳制为 `normal` 并给出警告。
|
|
220
|
+
*
|
|
107
221
|
* @param id - 프리셋 id
|
|
108
222
|
*
|
|
109
223
|
* Preset id
|
|
224
|
+
*
|
|
225
|
+
* プリセット id
|
|
226
|
+
*
|
|
227
|
+
* 预设 id
|
|
110
228
|
* @param delta - 타이포 토큰 델타
|
|
111
229
|
*
|
|
112
230
|
* Typography token delta
|
|
231
|
+
*
|
|
232
|
+
* タイポグラフィトークンのデルタ
|
|
233
|
+
*
|
|
234
|
+
* 排版令牌增量
|
|
113
235
|
* @returns 클램프 반영된 델타 + 경고
|
|
114
236
|
*
|
|
115
237
|
* The clamped delta plus warnings
|
|
238
|
+
*
|
|
239
|
+
* クランプを反映したデルタ + 警告
|
|
240
|
+
*
|
|
241
|
+
* 钳制后的增量 + 警告
|
|
116
242
|
* @example
|
|
117
243
|
* defineTypography('brand', { '--og-font-family': '"My Sans", sans-serif', '--og-font-weight': '450' });
|
|
118
244
|
*/
|
|
@@ -124,5 +250,9 @@ export declare function defineTypography(id: string, delta: TokenDelta): {
|
|
|
124
250
|
* 등록된 프리셋 id 목록(피커 UI·인스펙터용).
|
|
125
251
|
*
|
|
126
252
|
* Registered preset ids (for picker UIs and inspectors).
|
|
253
|
+
*
|
|
254
|
+
* 登録済みプリセット id の一覧(ピッカー UI・インスペクター用)。
|
|
255
|
+
*
|
|
256
|
+
* 已注册的预设 id 列表(供预设选择 UI 与检查器使用)。
|
|
127
257
|
*/
|
|
128
258
|
export declare function listTypography(): string[];
|
package/package.json
CHANGED
|
@@ -1,37 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-grid",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "초경량·제로 의존성 데이터 그리드 — React·Vue·Angular·jQuery·Vanilla 어디서나. 가상 스크롤·인라인 편집·다국어(i18n), MIT 라이선스, AI 친화 override 가이드. / Ultra-light data grid with a zero-dependency core — works with React, Vue, Angular, jQuery, or vanilla JS. Virtual scroll, inline editing, i18n. MIT-licensed, endlessly customizable, with an AI-friendly override guide.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/open-grid.cjs",
|
|
7
7
|
"module": "dist/open-grid.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
9
|
+
"typesVersions": {
|
|
10
|
+
"*": {
|
|
11
|
+
"vue": [
|
|
12
|
+
"./dist/types/vue/index.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"react": [
|
|
15
|
+
"./dist/types/react/index.d.ts"
|
|
16
|
+
],
|
|
17
|
+
"angular": [
|
|
18
|
+
"./dist/angular/index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"typography": [
|
|
21
|
+
"./dist/types/typography/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"header": [
|
|
24
|
+
"./dist/types/header/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
9
28
|
"exports": {
|
|
10
29
|
".": {
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
11
31
|
"import": "./dist/open-grid.js",
|
|
12
|
-
"require": "./dist/open-grid.cjs"
|
|
13
|
-
"types": "./dist/types/index.d.ts"
|
|
32
|
+
"require": "./dist/open-grid.cjs"
|
|
14
33
|
},
|
|
15
34
|
"./vue": {
|
|
35
|
+
"types": "./dist/types/vue/index.d.ts",
|
|
16
36
|
"import": "./dist/open-grid-vue.js",
|
|
17
|
-
"require": "./dist/open-grid-vue.cjs"
|
|
18
|
-
"types": "./dist/types/vue/index.d.ts"
|
|
37
|
+
"require": "./dist/open-grid-vue.cjs"
|
|
19
38
|
},
|
|
20
39
|
"./react": {
|
|
40
|
+
"types": "./dist/types/react/index.d.ts",
|
|
21
41
|
"import": "./dist/open-grid-react.js",
|
|
22
|
-
"require": "./dist/open-grid-react.cjs"
|
|
23
|
-
|
|
42
|
+
"require": "./dist/open-grid-react.cjs"
|
|
43
|
+
},
|
|
44
|
+
"./angular": {
|
|
45
|
+
"types": "./dist/angular/index.d.ts",
|
|
46
|
+
"default": "./dist/angular/fesm2022/open-grid-angular.mjs"
|
|
24
47
|
},
|
|
25
48
|
"./typography": {
|
|
49
|
+
"types": "./dist/types/typography/index.d.ts",
|
|
26
50
|
"import": "./dist/open-grid-typography.js",
|
|
27
|
-
"require": "./dist/open-grid-typography.cjs"
|
|
28
|
-
"types": "./dist/types/typography/index.d.ts"
|
|
51
|
+
"require": "./dist/open-grid-typography.cjs"
|
|
29
52
|
},
|
|
30
53
|
"./typography.css": "./dist/open-grid-typography.css",
|
|
31
54
|
"./header": {
|
|
55
|
+
"types": "./dist/types/header/index.d.ts",
|
|
32
56
|
"import": "./dist/open-grid-header.js",
|
|
33
|
-
"require": "./dist/open-grid-header.cjs"
|
|
34
|
-
"types": "./dist/types/header/index.d.ts"
|
|
57
|
+
"require": "./dist/open-grid-header.cjs"
|
|
35
58
|
},
|
|
36
59
|
"./header.css": "./dist/open-grid-header.css",
|
|
37
60
|
"./style.css": "./dist/style.css"
|
|
@@ -48,7 +71,8 @@
|
|
|
48
71
|
],
|
|
49
72
|
"scripts": {
|
|
50
73
|
"dev": "vite",
|
|
51
|
-
"build": "tsc && vite build && vite build --config vite.config.typography.ts && vite build --config vite.config.header.ts",
|
|
74
|
+
"build": "tsc && vite build && vite build --config vite.config.typography.ts && vite build --config vite.config.header.ts && npm run build:angular",
|
|
75
|
+
"build:angular": "npm --prefix angular install --no-audit --no-fund && npm --prefix angular run build && node -e \"require('fs').rmSync('dist/angular/esm2022',{recursive:true,force:true})\"",
|
|
52
76
|
"build:types": "tsc --emitDeclarationOnly",
|
|
53
77
|
"test": "vitest run",
|
|
54
78
|
"test:watch": "vitest",
|
|
@@ -66,7 +90,8 @@
|
|
|
66
90
|
"peerDependencies": {
|
|
67
91
|
"react": ">=18.0.0",
|
|
68
92
|
"react-dom": ">=18.0.0",
|
|
69
|
-
"vue": ">=3.0.0"
|
|
93
|
+
"vue": ">=3.0.0",
|
|
94
|
+
"@angular/core": ">=17.0.0"
|
|
70
95
|
},
|
|
71
96
|
"peerDependenciesMeta": {
|
|
72
97
|
"react": {
|
|
@@ -77,6 +102,9 @@
|
|
|
77
102
|
},
|
|
78
103
|
"vue": {
|
|
79
104
|
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"@angular/core": {
|
|
107
|
+
"optional": true
|
|
80
108
|
}
|
|
81
109
|
},
|
|
82
110
|
"devDependencies": {
|
|
@@ -109,6 +137,7 @@
|
|
|
109
137
|
"table",
|
|
110
138
|
"vue",
|
|
111
139
|
"react",
|
|
140
|
+
"angular",
|
|
112
141
|
"typescript",
|
|
113
142
|
"virtual-scroll",
|
|
114
143
|
"editable"
|