@iyulab/enterprise 0.4.0 → 0.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/README.md +10 -2
- package/dist/FormRow.d.ts +15 -3
- package/dist/FormSection.d.ts +16 -4
- package/dist/index.js +38 -266
- package/package.json +10 -10
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
13
|
+
/** 열 수. 기본 2. */
|
|
14
|
+
columns?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
}): any;
|
package/dist/FormSection.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
13
|
+
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
15
|
+
/** 제목 줄만 따로 조정할 때. 블록을 통째로 갈아엎지 않기 위한 훅이다. */
|
|
16
|
+
titleStyle?: CSSProperties;
|
|
17
|
+
}): any;
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { HttpClient } from "@iyulab/http-client";
|
|
3
|
+
import buildQuery from "odata-query";
|
|
3
4
|
//#region src/FormSection.tsx
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* L2 폼 블록 — 제목이 붙은 필드 묶음.
|
|
7
|
+
*
|
|
8
|
+
* 오버라이드 계약(docs/lob-layers.md §2): 구조는 두고 **children 치환 + prop** 으로 바꾼다.
|
|
9
|
+
* ⚠기본 스타일은 병합 가능한 형태로만 둔다 — 호출자의 `style` 이 뒤에 오므로 필요한
|
|
10
|
+
* 항목만 골라 덮을 수 있다. 인라인으로 굳혀 두면 소비자 CSS 가 이길 수 없어(`!important`
|
|
11
|
+
* 외) 계약이 원천적으로 무효가 된다.
|
|
12
|
+
*/
|
|
13
|
+
function FormSection({ title, children, className, style, titleStyle }) {
|
|
5
14
|
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
-
|
|
15
|
+
className,
|
|
16
|
+
style: {
|
|
17
|
+
marginBottom: "20px",
|
|
18
|
+
...style
|
|
19
|
+
},
|
|
7
20
|
children: [/* @__PURE__ */ jsx("div", {
|
|
8
21
|
style: {
|
|
9
22
|
fontSize: "11px",
|
|
10
23
|
fontWeight: 700,
|
|
11
24
|
textTransform: "uppercase",
|
|
12
25
|
letterSpacing: "0.5px",
|
|
13
|
-
color: "var(--u-
|
|
26
|
+
color: "color-mix(in srgb, var(--u-primary-color, #1E88E5) 85%, black)",
|
|
14
27
|
paddingBottom: "6px",
|
|
15
28
|
borderBottom: "1px solid var(--u-border-color-weak, #EEEEEE)",
|
|
16
|
-
marginBottom: "10px"
|
|
29
|
+
marginBottom: "10px",
|
|
30
|
+
...titleStyle
|
|
17
31
|
},
|
|
18
32
|
children: title
|
|
19
33
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -28,16 +42,29 @@ function FormSection({ title, children }) {
|
|
|
28
42
|
}
|
|
29
43
|
//#endregion
|
|
30
44
|
//#region src/FormRow.tsx
|
|
31
|
-
|
|
45
|
+
/**
|
|
46
|
+
* L2 폼 행 — 기본 2열, `full` 이면 1열.
|
|
47
|
+
*
|
|
48
|
+
* 오버라이드 계약(docs/lob-layers.md §2)에 따라 `className`·`style` 을 받아 병합한다.
|
|
49
|
+
* `columns` 는 2열 고정이 맞지 않는 소비자가 **컴포넌트를 복제하지 않고** 조정하는 경로다
|
|
50
|
+
* — 복제가 시작되면 이 계층은 쓰기 전보다 나쁜 상태를 만든다.
|
|
51
|
+
*/
|
|
52
|
+
function FormRow({ children, full, columns = 2, className, style }) {
|
|
32
53
|
if (full) return /* @__PURE__ */ jsx("div", {
|
|
33
|
-
|
|
54
|
+
className,
|
|
55
|
+
style: {
|
|
56
|
+
width: "100%",
|
|
57
|
+
...style
|
|
58
|
+
},
|
|
34
59
|
children
|
|
35
60
|
});
|
|
36
61
|
return /* @__PURE__ */ jsx("div", {
|
|
62
|
+
className,
|
|
37
63
|
style: {
|
|
38
64
|
display: "grid",
|
|
39
|
-
gridTemplateColumns:
|
|
40
|
-
gap: "8px"
|
|
65
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
66
|
+
gap: "8px",
|
|
67
|
+
...style
|
|
41
68
|
},
|
|
42
69
|
children
|
|
43
70
|
});
|
|
@@ -154,7 +181,7 @@ var DateHelper = class {
|
|
|
154
181
|
static getDaysDifference(startDate, endDate) {
|
|
155
182
|
const start = typeof startDate === "string" ? new Date(startDate) : startDate;
|
|
156
183
|
const timeDiff = (typeof endDate === "string" ? new Date(endDate) : endDate).getTime() - start.getTime();
|
|
157
|
-
return Math.ceil(timeDiff /
|
|
184
|
+
return Math.ceil(timeDiff / 864e5);
|
|
158
185
|
}
|
|
159
186
|
/**
|
|
160
187
|
* Calculate days from now to target date
|
|
@@ -512,262 +539,7 @@ var ApiConfig = class {
|
|
|
512
539
|
this._apiPrefix = "api";
|
|
513
540
|
this._isDevelopment = void 0;
|
|
514
541
|
}
|
|
515
|
-
}
|
|
516
|
-
"eq",
|
|
517
|
-
"ne",
|
|
518
|
-
"gt",
|
|
519
|
-
"ge",
|
|
520
|
-
"lt",
|
|
521
|
-
"le"
|
|
522
|
-
], t = [
|
|
523
|
-
"and",
|
|
524
|
-
"or",
|
|
525
|
-
"not"
|
|
526
|
-
], n = ["any", "all"], r = [
|
|
527
|
-
"startswith",
|
|
528
|
-
"endswith",
|
|
529
|
-
"contains",
|
|
530
|
-
"matchespattern"
|
|
531
|
-
], i = [
|
|
532
|
-
"expand",
|
|
533
|
-
"levels",
|
|
534
|
-
"select",
|
|
535
|
-
"skip",
|
|
536
|
-
"top",
|
|
537
|
-
"count",
|
|
538
|
-
"orderby",
|
|
539
|
-
"filter"
|
|
540
|
-
], a = /\((.*)\)/, o = /(?!indexof)\((\w+)\)/;
|
|
541
|
-
function g(e, t) {
|
|
542
|
-
if (t) {
|
|
543
|
-
let n = e === "", r = o.test(e), i = a.test(e);
|
|
544
|
-
return n ? t : r ? y(e, t, o) : i ? y(e, t, a) : `${t}/${e}`;
|
|
545
|
-
}
|
|
546
|
-
return e;
|
|
547
|
-
}
|
|
548
|
-
function _(e) {
|
|
549
|
-
return t.indexOf(e) !== -1;
|
|
550
|
-
}
|
|
551
|
-
function v(e) {
|
|
552
|
-
return `not (${e.join(" and ")})`;
|
|
553
|
-
}
|
|
554
|
-
function y(e, t, n) {
|
|
555
|
-
return e.replace(n, (e, n) => n.trim() === "" ? `(${t})` : `(${t}/${n.trim()})`);
|
|
556
|
-
}
|
|
557
|
-
function b(e, t, n = []) {
|
|
558
|
-
return `${e} eq ${w(t, n)}`;
|
|
559
|
-
}
|
|
560
|
-
function x({ key: e, value: t, aliases: n, propPrefix: r }) {
|
|
561
|
-
let i = [], a = e, o = _(a), s = t.map((e) => O(e, n, r)).filter((e) => e).map((e) => o ? `(${e})` : e);
|
|
562
|
-
return s.length && (o ? a === "not" ? i.push(v(s)) : i.push(`(${s.join(` ${a} `)})`) : i.push(s.join(` ${a} `))), i;
|
|
563
|
-
}
|
|
564
|
-
function S({ propName: e, value: t }) {
|
|
565
|
-
let n = [], r = e, i = Object.keys(t).map((e) => k({ [e]: t[e] }));
|
|
566
|
-
return i.length && (r === "not" ? n.push(v(i)) : n.push(`(${i.join(` ${r} `)})`)), n;
|
|
567
|
-
}
|
|
568
|
-
function C({ key: i, propName: a, value: o, aliases: s }) {
|
|
569
|
-
let c = [];
|
|
570
|
-
return "type" in o ? c.push(b(a, o, s)) : Object.keys(o).forEach((l) => {
|
|
571
|
-
if (o[l] !== void 0) if (e.indexOf(l) !== -1) c.push(`${a} ${l} ${w(o[l], s)}`);
|
|
572
|
-
else if (t.indexOf(l) !== -1) Array.isArray(o[l]) ? c.push(o[l].map((e) => "(" + O(e, s, a) + ")").join(` ${l} `)) : c.push("(" + O(o[l], s, a) + ")");
|
|
573
|
-
else if (n.indexOf(l) !== -1) {
|
|
574
|
-
let e = A({
|
|
575
|
-
lambdaParameter: i.toLowerCase(),
|
|
576
|
-
value: o[l],
|
|
577
|
-
op: l,
|
|
578
|
-
propName: a,
|
|
579
|
-
aliases: s
|
|
580
|
-
});
|
|
581
|
-
e && c.push(e);
|
|
582
|
-
} else if (l === "has") c.push(`${a} ${l} ${w(o[l], s)}`);
|
|
583
|
-
else if (l === "in") {
|
|
584
|
-
let e = Array.isArray(o[l]) ? o[l] : o[l].value.map((e) => ({
|
|
585
|
-
type: o[l].type,
|
|
586
|
-
value: e
|
|
587
|
-
}));
|
|
588
|
-
c.push(a + " in (" + e.map((e) => w(e, s)).join(",") + ")");
|
|
589
|
-
} else if (r.indexOf(l) !== -1) c.push(`${l}(${a},${w(o[l], s)})`);
|
|
590
|
-
else {
|
|
591
|
-
let e = /\/not/g.test(a), t = e ? a.replace(/\/not/g, "") : a, n = e ? v([O({ [l]: o[l] }, s, t)]) : O({ [l]: o[l] }, s, t);
|
|
592
|
-
n && c.push(n);
|
|
593
|
-
}
|
|
594
|
-
}), c;
|
|
595
|
-
}
|
|
596
|
-
function w(e, t) {
|
|
597
|
-
if (typeof e == "string") return `'${D(e)}'`;
|
|
598
|
-
if (e instanceof Date) return e.toISOString();
|
|
599
|
-
if (typeof e == "number") return e;
|
|
600
|
-
if (Array.isArray(e)) return `[${e.map((e) => w(e)).join(",")}]`;
|
|
601
|
-
if (e === null) return e;
|
|
602
|
-
if (typeof e == "object") switch (e.type) {
|
|
603
|
-
case "raw":
|
|
604
|
-
case "guid": return e.value;
|
|
605
|
-
case "duration": return `duration'${e.value}'`;
|
|
606
|
-
case "binary": return `binary'${e.value}'`;
|
|
607
|
-
case "alias": return Array.isArray(t) && t.push(e), `@${e.name}`;
|
|
608
|
-
case "json": return escape(JSON.stringify(e.value));
|
|
609
|
-
case "decimal": return `${e.value}M`;
|
|
610
|
-
default: return Object.entries(e).filter(([, e]) => e !== void 0).map(([e, n]) => `${e}=${w(n, t)}`).join(",");
|
|
611
|
-
}
|
|
612
|
-
return e;
|
|
613
|
-
}
|
|
614
|
-
function T(e, t, n, r) {
|
|
615
|
-
return `${r}/${n}(${e}: ${e} ${n == "all" ? "ne" : "eq"} '${t}')`;
|
|
616
|
-
}
|
|
617
|
-
function E(e) {
|
|
618
|
-
return e.replace(/'/g, "''");
|
|
619
|
-
}
|
|
620
|
-
function D(e) {
|
|
621
|
-
return encodeURIComponent(E(e));
|
|
622
|
-
}
|
|
623
|
-
function O(e = {}, t = [], n = "") {
|
|
624
|
-
return (Array.isArray(e) ? e : [e]).reduce((e, r) => {
|
|
625
|
-
if (r) {
|
|
626
|
-
let i = k(r, t, n);
|
|
627
|
-
i && e.push(i);
|
|
628
|
-
}
|
|
629
|
-
return e;
|
|
630
|
-
}, []).join(" and ");
|
|
631
|
-
}
|
|
632
|
-
function k(e = {}, t = [], n = "") {
|
|
633
|
-
let r = "";
|
|
634
|
-
return typeof e == "string" ? r = e : e && typeof e == "object" && (r = Object.keys(e).reduce((r, i) => {
|
|
635
|
-
let a = e[i];
|
|
636
|
-
if (a === void 0) return r;
|
|
637
|
-
let o = i === "", s = g(i, n);
|
|
638
|
-
if (o && Array.isArray(a)) return r.concat(a.map((e) => b(s, e)));
|
|
639
|
-
let c = [
|
|
640
|
-
"number",
|
|
641
|
-
"string",
|
|
642
|
-
"boolean"
|
|
643
|
-
].indexOf(typeof a) !== -1 || a instanceof Date || a === null, l = Array.isArray(a), u = typeof a == "object";
|
|
644
|
-
if (c) r.push(b(s, a, t));
|
|
645
|
-
else if (l) r.push(...x({
|
|
646
|
-
key: i,
|
|
647
|
-
value: a,
|
|
648
|
-
aliases: t,
|
|
649
|
-
propPrefix: n
|
|
650
|
-
}));
|
|
651
|
-
else if (_(s)) r.push(...S({
|
|
652
|
-
propName: s,
|
|
653
|
-
value: a
|
|
654
|
-
}));
|
|
655
|
-
else if (u) r.push(...C({
|
|
656
|
-
key: i,
|
|
657
|
-
propName: s,
|
|
658
|
-
value: a,
|
|
659
|
-
aliases: t
|
|
660
|
-
}));
|
|
661
|
-
else throw Error(`Unexpected value type: ${a}`);
|
|
662
|
-
return r;
|
|
663
|
-
}, []).join(" and ")), r;
|
|
664
|
-
}
|
|
665
|
-
function A({ lambdaParameter: e, value: t, op: n, propName: r, aliases: i }) {
|
|
666
|
-
let a = "";
|
|
667
|
-
if (typeof t == "string" || t instanceof String) a = T(e, t, n, r);
|
|
668
|
-
else if (t) {
|
|
669
|
-
let o = O(Array.isArray(t) ? t.reduce((e, t) => t.hasOwnProperty("") ? (e.hasOwnProperty("") || (e[""] = []), e[""].push(t[""]), e) : {
|
|
670
|
-
...e,
|
|
671
|
-
...t
|
|
672
|
-
}, {}) : t, i, e);
|
|
673
|
-
a = `${r}/${n}(${o ? `${e}:${o}` : ""})`;
|
|
674
|
-
}
|
|
675
|
-
return a;
|
|
676
|
-
}
|
|
677
|
-
function j(e) {
|
|
678
|
-
if (typeof e == "number") return e;
|
|
679
|
-
if (typeof e == "string") return e.indexOf("/") === -1 ? e : e.split("/").reverse().reduce((e, t, n, r) => n === 0 ? `$expand=${t}` : n === r.length - 1 ? `${t}(${e})` : `$expand=${t}(${e})`, "");
|
|
680
|
-
if (Array.isArray(e)) return `${e.map((e) => j(e)).join(",")}`;
|
|
681
|
-
if (typeof e == "object") {
|
|
682
|
-
let t = Object.keys(e);
|
|
683
|
-
return t.some((e) => i.indexOf(e.toLowerCase()) !== -1) ? t.map((t) => {
|
|
684
|
-
let n;
|
|
685
|
-
switch (t) {
|
|
686
|
-
case "filter":
|
|
687
|
-
n = O(e[t]);
|
|
688
|
-
break;
|
|
689
|
-
case "orderBy":
|
|
690
|
-
n = F(e[t]);
|
|
691
|
-
break;
|
|
692
|
-
case "levels":
|
|
693
|
-
case "count":
|
|
694
|
-
case "skip":
|
|
695
|
-
case "top":
|
|
696
|
-
n = `${e[t]}`;
|
|
697
|
-
break;
|
|
698
|
-
default: n = j(e[t]);
|
|
699
|
-
}
|
|
700
|
-
return `$${t.toLowerCase()}=${n}`;
|
|
701
|
-
}).join(";") : t.map((t) => {
|
|
702
|
-
let n = j(e[t]);
|
|
703
|
-
return n ? `${t}(${n})` : t;
|
|
704
|
-
}).join(",");
|
|
705
|
-
}
|
|
706
|
-
return "";
|
|
707
|
-
}
|
|
708
|
-
function M(e) {
|
|
709
|
-
return (Array.isArray(e) ? e : [e]).reduce((e, t) => {
|
|
710
|
-
for (let n of Object.keys(t)) switch (n) {
|
|
711
|
-
case "aggregate": {
|
|
712
|
-
let r = t[n];
|
|
713
|
-
r && e.push(`aggregate(${N(r)})`);
|
|
714
|
-
break;
|
|
715
|
-
}
|
|
716
|
-
case "filter": {
|
|
717
|
-
let r = t[n];
|
|
718
|
-
if (r) {
|
|
719
|
-
let t = O(r);
|
|
720
|
-
t && e.push(`filter(${t})`);
|
|
721
|
-
}
|
|
722
|
-
break;
|
|
723
|
-
}
|
|
724
|
-
case "groupBy": {
|
|
725
|
-
let r = t[n];
|
|
726
|
-
r && e.push(`groupby(${P(r)})`);
|
|
727
|
-
break;
|
|
728
|
-
}
|
|
729
|
-
default: throw Error(`Unsupported transform: ${n}`);
|
|
730
|
-
}
|
|
731
|
-
return e;
|
|
732
|
-
}, []).join("/") || void 0;
|
|
733
|
-
}
|
|
734
|
-
function N(e) {
|
|
735
|
-
return (Array.isArray(e) ? e : [e]).map((e) => typeof e == "string" ? e : Object.keys(e).map((t) => {
|
|
736
|
-
let n = e[t];
|
|
737
|
-
if (!n.with && n.as) return `${t} as ${n.as}`;
|
|
738
|
-
if (!n.with) throw Error(`'with' property required for '${t}'`);
|
|
739
|
-
if (!n.as) throw Error(`'as' property required for '${t}'`);
|
|
740
|
-
return `${t} with ${n.with} as ${n.as}`;
|
|
741
|
-
})).join(",");
|
|
742
|
-
}
|
|
743
|
-
function P(e) {
|
|
744
|
-
if (!e.properties) throw Error("'properties' property required for groupBy");
|
|
745
|
-
let t = `(${e.properties.join(",")})`;
|
|
746
|
-
return e.transform && (t += `,${M(e.transform)}`), t;
|
|
747
|
-
}
|
|
748
|
-
function F(e, t = "") {
|
|
749
|
-
return Array.isArray(e) ? e.map((e) => Array.isArray(e) && e.length === 2 && ["asc", "desc"].indexOf(e[1]) !== -1 ? e.join(" ") : e).map((e) => `${t}${String(e)}`).join(",") : typeof e == "object" ? Object.entries(e).map(([e, t]) => F(t, `${e}/`)).map((e) => `${t}${e}`).join(",") : `${t}${String(e)}`;
|
|
750
|
-
}
|
|
751
|
-
function I(e, t) {
|
|
752
|
-
let n = Object.getOwnPropertyNames(t).filter((e) => t[e] !== void 0 && t[e] !== "").map((e) => `${e}=${t[e]}`);
|
|
753
|
-
return n.length ? `${e}?${n.join("&")}` : e;
|
|
754
|
-
}
|
|
755
|
-
function L({ select: e, search: t, skiptoken: n, format: r, top: i, skip: a, filter: o, transform: s, orderBy: c, key: l, count: u, expand: d, action: f, func: p } = {}) {
|
|
756
|
-
let m = "", h = [], g = {};
|
|
757
|
-
if (l != null && (m += `(${w(l, h)})`), (o || typeof u == "object") && (g.$filter = O(typeof u == "object" ? u : o, h)), s && (g.$apply = M(s)), d && (g.$expand = j(d)), c && (g.$orderby = F(c)), u && (typeof u == "boolean" ? g.$count = !0 : m += "/$count"), typeof i == "number" && (g.$top = i), typeof a == "number" && (g.$skip = a), f && (m += `/${f}`), p) {
|
|
758
|
-
if (typeof p == "string") m += `/${p}`;
|
|
759
|
-
else if (typeof p == "object") {
|
|
760
|
-
let [e] = Object.keys(p), t = w(p[e], h);
|
|
761
|
-
m += `/${e}`, t !== "" && (m += `(${t})`);
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
return h.length > 0 && Object.assign(g, h.reduce((e, t) => Object.assign(e, { [`@${t.name}`]: w(t.value) }), {})), t && (g.$search = encodeURIComponent(t)), I(m, {
|
|
765
|
-
$select: e,
|
|
766
|
-
$skiptoken: n,
|
|
767
|
-
$format: r,
|
|
768
|
-
...g
|
|
769
|
-
});
|
|
770
|
-
}
|
|
542
|
+
};
|
|
771
543
|
//#endregion
|
|
772
544
|
//#region src/data/ODataService.ts
|
|
773
545
|
/**
|
|
@@ -894,7 +666,7 @@ function createODataService(config) {
|
|
|
894
666
|
return res.json();
|
|
895
667
|
}
|
|
896
668
|
async function odataCount(entity, filter) {
|
|
897
|
-
const qs =
|
|
669
|
+
const qs = buildQuery({
|
|
898
670
|
filter,
|
|
899
671
|
top: 0,
|
|
900
672
|
count: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iyulab/enterprise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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/
|
|
36
|
-
"
|
|
37
|
-
"@iyulab/http-client": "^0.9.0",
|
|
38
|
-
"@iyulab/modern-app": "^0.3.7",
|
|
39
|
-
"odata-query": "^8.0.7"
|
|
35
|
+
"@iyulab/http-client": "^0.10.0",
|
|
36
|
+
"odata-query": "^8.1.0"
|
|
40
37
|
},
|
|
41
38
|
"devDependencies": {
|
|
42
|
-
"@types/node": "^
|
|
39
|
+
"@types/node": "^26.1.1",
|
|
43
40
|
"typescript": "^5.9.3",
|
|
44
|
-
"vite": "^8.
|
|
45
|
-
"vite-plugin-dts": "^5.0.
|
|
46
|
-
"vitest": "^
|
|
41
|
+
"vite": "^8.1.4",
|
|
42
|
+
"vite-plugin-dts": "^5.0.3",
|
|
43
|
+
"vitest": "^4.1.10"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": ">=18"
|
|
47
47
|
}
|
|
48
48
|
}
|