@bimatrix-aud-platform/aud_mcp_server 1.1.70 → 1.1.73

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.
@@ -5,6 +5,29 @@
5
5
  * 간소화된 .design.json 형태로 변환합니다.
6
6
  */
7
7
  import { defaultStyle, defaultDocking, defaultValidator, ELEMENT_DEFAULTS_MAP, } from "./defaults.js";
8
+ import { rgbaToHex } from "../utils/color.js";
9
+ // ============================================
10
+ // Color 변환 유틸
11
+ // ============================================
12
+ /** Color 객체({R,G,B,A})를 hex 문자열로 변환 */
13
+ function colorToHex(color) {
14
+ if (color && typeof color === "object" && color.R !== undefined && color.G !== undefined && color.B !== undefined) {
15
+ return rgbaToHex(color);
16
+ }
17
+ return color;
18
+ }
19
+ /** Style 내 Background.Color, Border.Color, Font.Color를 hex 문자열로 변환 */
20
+ function convertStyleColorsToHex(style) {
21
+ if (style.Background && style.Background.Color) {
22
+ style.Background.Color = colorToHex(style.Background.Color);
23
+ }
24
+ if (style.Border && style.Border.Color) {
25
+ style.Border.Color = colorToHex(style.Border.Color);
26
+ }
27
+ if (style.Font && style.Font.Color) {
28
+ style.Font.Color = colorToHex(style.Font.Color);
29
+ }
30
+ }
8
31
  // ============================================
9
32
  // 공통 유틸
10
33
  // ============================================
@@ -123,6 +146,10 @@ export function compactElement(element) {
123
146
  result.Style = compactStyle;
124
147
  }
125
148
  }
149
+ // Style 내 Color 객체를 hex 문자열로 변환
150
+ if (result.Style) {
151
+ convertStyleColorsToHex(result.Style);
152
+ }
126
153
  // Visible: true(기본값)이면 제거
127
154
  if (element.Visible === false) {
128
155
  result.Visible = false;
@@ -115,6 +115,8 @@ declare abstract class ElementContainer {
115
115
  addSlider(name: string, opts?: ElementOpts): this;
116
116
  addCalendarYear(name: string, opts?: ElementOpts): this;
117
117
  addCalendarYM(name: string, opts?: ElementOpts): this;
118
+ addCalendarFromTo(name: string, opts?: ElementOpts): this;
119
+ addCalendarWeeklyFromTo(name: string, opts?: ElementOpts): this;
118
120
  addFileUploadButton(name: string, textOrOpts?: string | (ElementOpts & {
119
121
  allowExt?: string;
120
122
  saveFolderName?: string;
@@ -489,6 +489,30 @@ class ElementContainer {
489
489
  this._addElement(element);
490
490
  return this;
491
491
  }
492
+ addCalendarFromTo(name, opts = {}) {
493
+ const id = generateId("CalendarFromTo");
494
+ const element = {
495
+ Type: "CalendarFromTo", Id: id, Name: name,
496
+ Position: buildPosition({ width: 280, height: 28, ...opts }),
497
+ Style: buildStyle(opts),
498
+ ...getTypeDefaults("CalendarFromTo"),
499
+ };
500
+ this._applyPassThrough(element, opts);
501
+ this._addElement(element);
502
+ return this;
503
+ }
504
+ addCalendarWeeklyFromTo(name, opts = {}) {
505
+ const id = generateId("CalendarWeeklyFromTo");
506
+ const element = {
507
+ Type: "CalendarWeeklyFromTo", Id: id, Name: name,
508
+ Position: buildPosition({ width: 280, height: 28, ...opts }),
509
+ Style: buildStyle(opts),
510
+ ...getTypeDefaults("CalendarWeeklyFromTo"),
511
+ };
512
+ this._applyPassThrough(element, opts);
513
+ this._addElement(element);
514
+ return this;
515
+ }
492
516
  // ---- Upload ----
493
517
  addFileUploadButton(name, textOrOpts = "Upload", opts = {}) {
494
518
  let text;