@iyulab/enterprise 0.4.0 → 0.5.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/README.md CHANGED
@@ -50,8 +50,16 @@ import { FormSection, FormRow } from '@iyulab/enterprise'
50
50
  </FormSection>
51
51
  ```
52
52
 
53
- - `FormRow`는 기본 2컬럼 그리드입니다. 한 칸을 차지하려면 `full`을 씁니다.
54
- - (3컬럼 이상 커스텀 레이아웃이 필요하면 현재는 직접 CSS grid를 쓰세요. `columns` prop 확장은 로드맵에 있습니다.)
53
+ - `FormRow`는 기본 2컬럼 그리드입니다. 한 칸을 차지하려면 `full`을, 다른 열 수가 필요하면 `columns`를 씁니다.
54
+ - 컴포넌트 모두 `className`·`style`을 받아 기본값 **뒤에** 병합합니다 블록을 복제하지 않고 조정하는 정규 경로입니다. `FormSection`은 제목 줄만 바꾸는 `titleStyle`도 받습니다.
55
+
56
+ ```tsx
57
+ <FormRow columns={3}>…</FormRow>
58
+ <FormSection title="기본 정보" style={{ marginBottom: 32 }}>…</FormSection>
59
+ ```
60
+
61
+ > 이 계층이 무엇을 소유하고 무엇을 소유하지 않는지, 새 패턴이 언제 추가되는지는
62
+ > **[LOB 계층 헌장](./docs/lob-layers.md)** 이 정합니다. 패턴을 제안하기 전에 읽어 주세요.
55
63
 
56
64
  ### API 설정
57
65
 
package/dist/FormRow.d.ts CHANGED
@@ -1,5 +1,17 @@
1
- import { ReactNode } from 'react';
2
- export declare function FormRow({ children, full, }: {
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * L2 폼 행 — 기본 2열, `full` 이면 1열.
4
+ *
5
+ * 오버라이드 계약(docs/lob-layers.md §2)에 따라 `className`·`style` 을 받아 병합한다.
6
+ * `columns` 는 2열 고정이 맞지 않는 소비자가 **컴포넌트를 복제하지 않고** 조정하는 경로다
7
+ * — 복제가 시작되면 이 계층은 쓰기 전보다 나쁜 상태를 만든다.
8
+ */
9
+ export declare function FormRow({ children, full, columns, className, style, }: {
3
10
  children: ReactNode;
11
+ /** 한 행 전체를 한 칸으로 쓴다. `columns` 보다 우선한다. */
4
12
  full?: boolean;
5
- }): import("react/jsx-runtime").JSX.Element;
13
+ /** 열 수. 기본 2. */
14
+ columns?: number;
15
+ className?: string;
16
+ style?: CSSProperties;
17
+ }): import("react").JSX.Element;
@@ -1,5 +1,17 @@
1
- import { ReactNode } from 'react';
2
- export declare function FormSection({ title, children, }: {
3
- title: string;
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /**
3
+ * L2 폼 블록 — 제목이 붙은 필드 묶음.
4
+ *
5
+ * 오버라이드 계약(docs/lob-layers.md §2): 구조는 두고 **children 치환 + prop** 으로 바꾼다.
6
+ * ⚠기본 스타일은 병합 가능한 형태로만 둔다 — 호출자의 `style` 이 뒤에 오므로 필요한
7
+ * 항목만 골라 덮을 수 있다. 인라인으로 굳혀 두면 소비자 CSS 가 이길 수 없어(`!important`
8
+ * 외) 계약이 원천적으로 무효가 된다.
9
+ */
10
+ export declare function FormSection({ title, children, className, style, titleStyle, }: {
11
+ title: ReactNode;
4
12
  children: ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;
13
+ className?: string;
14
+ style?: CSSProperties;
15
+ /** 제목 줄만 따로 조정할 때. 블록을 통째로 갈아엎지 않기 위한 훅이다. */
16
+ titleStyle?: CSSProperties;
17
+ }): import("react").JSX.Element;
package/dist/index.js CHANGED
@@ -1,19 +1,32 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { HttpClient } from "@iyulab/http-client";
3
3
  //#region src/FormSection.tsx
4
- function FormSection({ title, children }) {
4
+ /**
5
+ * L2 폼 블록 — 제목이 붙은 필드 묶음.
6
+ *
7
+ * 오버라이드 계약(docs/lob-layers.md §2): 구조는 두고 **children 치환 + prop** 으로 바꾼다.
8
+ * ⚠기본 스타일은 병합 가능한 형태로만 둔다 — 호출자의 `style` 이 뒤에 오므로 필요한
9
+ * 항목만 골라 덮을 수 있다. 인라인으로 굳혀 두면 소비자 CSS 가 이길 수 없어(`!important`
10
+ * 외) 계약이 원천적으로 무효가 된다.
11
+ */
12
+ function FormSection({ title, children, className, style, titleStyle }) {
5
13
  return /* @__PURE__ */ jsxs("div", {
6
- style: { marginBottom: "20px" },
14
+ className,
15
+ style: {
16
+ marginBottom: "20px",
17
+ ...style
18
+ },
7
19
  children: [/* @__PURE__ */ jsx("div", {
8
20
  style: {
9
21
  fontSize: "11px",
10
22
  fontWeight: 700,
11
23
  textTransform: "uppercase",
12
24
  letterSpacing: "0.5px",
13
- color: "var(--u-blue-600, #1E88E5)",
25
+ color: "color-mix(in srgb, var(--u-primary-color, #1E88E5) 85%, black)",
14
26
  paddingBottom: "6px",
15
27
  borderBottom: "1px solid var(--u-border-color-weak, #EEEEEE)",
16
- marginBottom: "10px"
28
+ marginBottom: "10px",
29
+ ...titleStyle
17
30
  },
18
31
  children: title
19
32
  }), /* @__PURE__ */ jsx("div", {
@@ -28,16 +41,29 @@ function FormSection({ title, children }) {
28
41
  }
29
42
  //#endregion
30
43
  //#region src/FormRow.tsx
31
- function FormRow({ children, full }) {
44
+ /**
45
+ * L2 폼 행 — 기본 2열, `full` 이면 1열.
46
+ *
47
+ * 오버라이드 계약(docs/lob-layers.md §2)에 따라 `className`·`style` 을 받아 병합한다.
48
+ * `columns` 는 2열 고정이 맞지 않는 소비자가 **컴포넌트를 복제하지 않고** 조정하는 경로다
49
+ * — 복제가 시작되면 이 계층은 쓰기 전보다 나쁜 상태를 만든다.
50
+ */
51
+ function FormRow({ children, full, columns = 2, className, style }) {
32
52
  if (full) return /* @__PURE__ */ jsx("div", {
33
- style: { width: "100%" },
53
+ className,
54
+ style: {
55
+ width: "100%",
56
+ ...style
57
+ },
34
58
  children
35
59
  });
36
60
  return /* @__PURE__ */ jsx("div", {
61
+ className,
37
62
  style: {
38
63
  display: "grid",
39
- gridTemplateColumns: "1fr 1fr",
40
- gap: "8px"
64
+ gridTemplateColumns: `repeat(${columns}, 1fr)`,
65
+ gap: "8px",
66
+ ...style
41
67
  },
42
68
  children
43
69
  });
@@ -154,7 +180,7 @@ var DateHelper = class {
154
180
  static getDaysDifference(startDate, endDate) {
155
181
  const start = typeof startDate === "string" ? new Date(startDate) : startDate;
156
182
  const timeDiff = (typeof endDate === "string" ? new Date(endDate) : endDate).getTime() - start.getTime();
157
- return Math.ceil(timeDiff / (1e3 * 3600 * 24));
183
+ return Math.ceil(timeDiff / 864e5);
158
184
  }
159
185
  /**
160
186
  * Calculate days from now to target date
@@ -512,23 +538,30 @@ var ApiConfig = class {
512
538
  this._apiPrefix = "api";
513
539
  this._isDevelopment = void 0;
514
540
  }
515
- }, e = [
541
+ };
542
+ //#endregion
543
+ //#region node_modules/odata-query/dist/index.mjs
544
+ var e = [
516
545
  "eq",
517
546
  "ne",
518
547
  "gt",
519
548
  "ge",
520
549
  "lt",
521
550
  "le"
522
- ], t = [
551
+ ];
552
+ var t = [
523
553
  "and",
524
554
  "or",
525
555
  "not"
526
- ], n = ["any", "all"], r = [
556
+ ];
557
+ var n = ["any", "all"];
558
+ var r = [
527
559
  "startswith",
528
560
  "endswith",
529
561
  "contains",
530
562
  "matchespattern"
531
- ], i = [
563
+ ];
564
+ var i = [
532
565
  "expand",
533
566
  "levels",
534
567
  "select",
@@ -537,7 +570,9 @@ var ApiConfig = class {
537
570
  "count",
538
571
  "orderby",
539
572
  "filter"
540
- ], a = /\((.*)\)/, o = /(?!indexof)\((\w+)\)/;
573
+ ];
574
+ var a = /\((.*)\)/;
575
+ var o = /(?!indexof)\((\w+)\)/;
541
576
  function g(e, t) {
542
577
  if (t) {
543
578
  let n = e === "", r = o.test(e), i = a.test(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/enterprise",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Enterprise utilities and components for iyulab framework",
5
5
  "keywords": [
6
6
  "enterprise",
@@ -32,17 +32,17 @@
32
32
  "test": "vitest run"
33
33
  },
34
34
  "dependencies": {
35
- "@iyulab/components": "^1.1.1",
36
- "@iyulab/data-components": "^0.6.1",
37
- "@iyulab/http-client": "^0.9.0",
38
- "@iyulab/modern-app": "^0.3.7",
39
- "odata-query": "^8.0.7"
35
+ "@iyulab/components": "^1.8.0",
36
+ "@iyulab/data-components": "^0.7.0",
37
+ "@iyulab/http-client": "^0.10.0",
38
+ "@iyulab/modern-app": "^0.6.0",
39
+ "odata-query": "^8.1.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@types/node": "^25.8.0",
42
+ "@types/node": "^26.1.1",
43
43
  "typescript": "^5.9.3",
44
- "vite": "^8.0.13",
45
- "vite-plugin-dts": "^5.0.0",
46
- "vitest": "^3.0.0"
44
+ "vite": "^8.1.4",
45
+ "vite-plugin-dts": "^5.0.3",
46
+ "vitest": "^4.1.10"
47
47
  }
48
48
  }