@wipco/sdui 0.35.0 → 0.36.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/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default, { CSSProperties, ReactNode, ComponentType } from 'react';
|
|
3
|
-
import { S as SduiPage, a as SduiAction, b as SduiPropValue, c as SduiRule } from './types-
|
|
4
|
-
export { d as SduiArgRef, e as SduiCalcRef, f as SduiChild, g as SduiIndexRef, h as SduiItemRef, i as SduiNode, j as SduiPageQuery, k as SduiScalar, l as SduiStateRef } from './types-
|
|
3
|
+
import { S as SduiPage, a as SduiAction, b as SduiPropValue, c as SduiRule } from './types-Rngs8hw_.js';
|
|
4
|
+
export { d as SduiArgRef, e as SduiCalcRef, f as SduiChild, g as SduiIndexRef, h as SduiItemRef, i as SduiNode, j as SduiPageQuery, k as SduiScalar, l as SduiStateRef } from './types-Rngs8hw_.js';
|
|
5
5
|
import { S as SduiBoxProps, a as SduiContainerLayoutProps, b as SduiColumnsScale, c as SduiGapScale, d as SduiWeightScale, e as SduiTextAlignScale } from './layout-B1QrIBm6.js';
|
|
6
6
|
export { C as CHILD_LAYOUT_PROPS, L as LAYOUT_CSS, f as SduiAlignScale, g as SduiChildLayoutProps, h as SduiSizeScale, i as SduiSpanScale, j as childLayoutFrom, k as columnsClass, l as containerLayoutStyle, m as joinClass, n as mergeStyle, t as typographyStyle } from './layout-B1QrIBm6.js';
|
|
7
7
|
import { D as DatePickerProps, a as DateRangePickerProps, T as TimePickerProps } from './DatePicker-D2EtpvkQ.js';
|
package/dist/index.js
CHANGED
|
@@ -1767,6 +1767,8 @@ var CALC_OPS = /* @__PURE__ */ new Set([
|
|
|
1767
1767
|
"includes",
|
|
1768
1768
|
"distinct",
|
|
1769
1769
|
"except",
|
|
1770
|
+
"groupBy",
|
|
1771
|
+
"groupCount",
|
|
1770
1772
|
"entries",
|
|
1771
1773
|
"fromEntries",
|
|
1772
1774
|
"length",
|
|
@@ -1896,6 +1898,20 @@ function evaluateCalc(calc, resolved, resolve) {
|
|
|
1896
1898
|
(row) => !remove.has(String(fieldOf(row, field) ?? ""))
|
|
1897
1899
|
);
|
|
1898
1900
|
}
|
|
1901
|
+
case "groupBy":
|
|
1902
|
+
case "groupCount": {
|
|
1903
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1904
|
+
for (const row of listOrEmpty()) {
|
|
1905
|
+
const key = String(fieldOf(row, field) ?? "");
|
|
1906
|
+
const bucket = groups.get(key);
|
|
1907
|
+
if (bucket) bucket.push(row);
|
|
1908
|
+
else groups.set(key, [row]);
|
|
1909
|
+
}
|
|
1910
|
+
const out = [...groups.entries()].map(
|
|
1911
|
+
([key, items]) => op === "groupCount" ? { key, count: items.length } : { key, items }
|
|
1912
|
+
);
|
|
1913
|
+
return out;
|
|
1914
|
+
}
|
|
1899
1915
|
case "entries": {
|
|
1900
1916
|
if (!isPlainObject(first)) return [];
|
|
1901
1917
|
return Object.entries(first).map(([key, value]) => ({
|
package/dist/meta.d.ts
CHANGED
|
@@ -87,6 +87,8 @@ interface SduiCalcRef {
|
|
|
87
87
|
* - `includes` 목록(또는 문자열)이 args[1]을 담고 있는지
|
|
88
88
|
* - `distinct` `field`(없으면 값 자체) 기준 중복 제거
|
|
89
89
|
* - `except` args[0]에서 args[1]에 있는 것을 뺀다(`field`로 맞춘다)
|
|
90
|
+
* - `groupBy`/`groupCount` `field` 기준으로 묶어 `{key,items}`·`{key,count}` 배열로.
|
|
91
|
+
* 키가 처음 나타난 순서를 지킨다. 정렬은 `sortBy` 를 이어서 한다
|
|
90
92
|
* - `entries` 객체를 `{key, value}` 배열로 편다 — ForEach가 돌 수 있는 모양
|
|
91
93
|
* - `fromEntries` 그 짝. `{key,value}` 배열을 객체로 되돌린다(걸러낸 폼 페이로드 조립)
|
|
92
94
|
* - `length` 배열·문자열의 길이
|
|
@@ -94,7 +96,7 @@ interface SduiCalcRef {
|
|
|
94
96
|
* - `split` `sep`(기본 ',')으로 가른다. `take`를 주면 그 조각 하나(음수는 뒤에서)
|
|
95
97
|
* - `sortBy` `field` 기준 정렬(`desc: true`면 내림차순). 원본은 건드리지 않는다
|
|
96
98
|
*/
|
|
97
|
-
| 'get' | 'pluck' | 'filter' | 'some' | 'every' | 'includes' | 'distinct' | 'except' | 'entries' | 'fromEntries' | 'length' | 'join' | 'split' | 'sortBy';
|
|
99
|
+
| 'get' | 'pluck' | 'filter' | 'some' | 'every' | 'includes' | 'distinct' | 'except' | 'groupBy' | 'groupCount' | 'entries' | 'fromEntries' | 'length' | 'join' | 'split' | 'sortBy';
|
|
98
100
|
args: SduiPropValue[];
|
|
99
101
|
/** sum/count·목록 연산에서 객체 배열의 필드를 지정 */
|
|
100
102
|
field?: string;
|