@wipco/sdui 0.24.0 → 0.25.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-DDQh8bKF.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-DDQh8bKF.js';
3
+ import { S as SduiPage, a as SduiAction, b as SduiPropValue, c as SduiRule } from './types-Bum2uMjl.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-Bum2uMjl.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
@@ -2114,10 +2114,16 @@ function deferChainEntry(container, key) {
2114
2114
  return typeof container.action === "string" && (key === "onSuccess" || key === "onError");
2115
2115
  }
2116
2116
  async function runRequestAction(action, deps) {
2117
+ const pendingKey = typeof action.pendingKey === "string" && action.pendingKey !== "" ? action.pendingKey : null;
2118
+ let pendingOn = false;
2117
2119
  try {
2118
2120
  if (typeof action.endpoint !== "string" || action.endpoint === "") {
2119
2121
  throw new Error("request \uC561\uC158\uC758 endpoint\uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4 \u2014 $state \uCC38\uC870\uC5D0 \uC544\uC9C1 \uAC12\uC774 \uC5C6\uB294\uC9C0 \uD655\uC778\uD558\uC138\uC694");
2120
2122
  }
2123
+ if (pendingKey) {
2124
+ pendingOn = true;
2125
+ deps.dispatch({ action: "setState", key: pendingKey, value: true });
2126
+ }
2121
2127
  const response = await deps.fetch(action.endpoint, {
2122
2128
  method: action.method ?? "POST",
2123
2129
  ...action.body === void 0 ? {} : { body: action.body }
@@ -2144,6 +2150,8 @@ async function runRequestAction(action, deps) {
2144
2150
  } else {
2145
2151
  deps.toast({ tone: "danger", title: "\uC694\uCCAD \uC2E4\uD328", message });
2146
2152
  }
2153
+ } finally {
2154
+ if (pendingKey && pendingOn) deps.dispatch({ action: "setState", key: pendingKey, value: false });
2147
2155
  }
2148
2156
  }
2149
2157
 
package/dist/meta.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { b as SduiPropValue, i as SduiNode } from './types-DDQh8bKF.js';
1
+ import { b as SduiPropValue, i as SduiNode } from './types-Bum2uMjl.js';
2
2
 
3
3
  /**
4
4
  * 시각 빌더용 컴포넌트 메타데이터 스키마.
@@ -221,6 +221,14 @@ type SduiAction = {
221
221
  * (계약은 {@link SduiAdapter.fetch} 참고). 안 얹으면 message 만 남는다.
222
222
  */
223
223
  errorKey?: string;
224
+ /**
225
+ * 진행 상태를 담을 상태 키. 요청 직전에 `true`, 끝나면(성공·실패 모두) `false`.
226
+ *
227
+ * `submitForm`이 `{form}.$submitting`을 관리하는 것과 같은 자리다 — 그쪽은 폼이
228
+ * 있어 이름이 파생되지만 `request`는 폼이 없으므로 키를 받는다. 버튼의
229
+ * `loading`·`disabled`를 여기 물리면 이중 제출과 무반응이 함께 사라진다.
230
+ */
231
+ pendingKey?: string;
224
232
  }
225
233
  /**
226
234
  * 단발 API 호출 — submitForm에서 폼 수집·검증을 뺀 것. 서버의 2단계 커밋 계약
@@ -254,6 +262,14 @@ type SduiAction = {
254
262
  * (계약은 {@link SduiAdapter.fetch} 참고). 안 얹으면 message 만 남는다.
255
263
  */
256
264
  errorKey?: string;
265
+ /**
266
+ * 진행 상태를 담을 상태 키. 요청 직전에 `true`, 끝나면(성공·실패 모두) `false`.
267
+ *
268
+ * `submitForm`이 `{form}.$submitting`을 관리하는 것과 같은 자리다 — 그쪽은 폼이
269
+ * 있어 이름이 파생되지만 `request`는 폼이 없으므로 키를 받는다. 버튼의
270
+ * `loading`·`disabled`를 여기 물리면 이중 제출과 무반응이 함께 사라진다.
271
+ */
272
+ pendingKey?: string;
257
273
  /** 성공 시 무효화할 조회 prefix — onSuccess의 invalidate 액션 단축 */
258
274
  invalidate?: string;
259
275
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipco/sdui",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "WIPCO 서버 주도 UI(SDUI) 렌더러 — JSON 페이지 스펙을 React 컴포넌트로 렌더링",
5
5
  "keywords": [
6
6
  "sdui",