@wipco/sdui 0.31.0 → 0.33.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/chunk-CTSVZTIT.js +122 -0
- package/dist/chunk-KVFHPBAY.js +124 -0
- package/dist/chunk-PCMJE2GO.js +109 -0
- package/dist/chunk-QO6UJAQN.js +145 -0
- package/dist/chunk-TIY4A223.js +140 -0
- package/dist/index.js +14 -151
- package/dist/meta.d.ts +9 -1
- package/dist/meta.js +174 -1
- package/dist/rich.js +1 -1
- package/dist/widgets/OptionSchemaEditor.d.ts +63 -0
- package/dist/widgets/OptionSchemaEditor.js +4 -0
- package/dist/widgets/OptionValueFields.d.ts +21 -0
- package/dist/widgets/OptionValueFields.js +4 -0
- package/dist/widgets/QRDisplay.d.ts +45 -0
- package/dist/widgets/QRDisplay.js +4 -0
- package/dist/widgets/StagePeriodEditor.d.ts +45 -0
- package/dist/widgets/StagePeriodEditor.js +6 -0
- package/dist/widgets/index.d.ts +13 -1
- package/dist/widgets/index.js +22 -8
- package/package.json +17 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { TimePicker } from './chunk-SNRKPEWT.js';
|
|
2
|
-
export { TimePicker } from './chunk-SNRKPEWT.js';
|
|
3
1
|
export { loadOptionalModule } from './chunk-RRMKCZYQ.js';
|
|
4
2
|
import { useSduiDispatch, SduiDialog, useSduiCan, SduiDispatchContext, SduiPermissionProvider } from './chunk-QU7YVMFA.js';
|
|
5
3
|
export { SduiDialog, SduiPermissionProvider, useSduiCan, useSduiDispatch } from './chunk-QU7YVMFA.js';
|
|
4
|
+
import { Text, Spacer, Show, Section, Row, PageHead, KeyValueList, Grid, Divider, Col, Actions } from './chunk-QO6UJAQN.js';
|
|
5
|
+
export { Actions, Col, Divider, Grid, KeyValueList, PageHead, Row, Section, Show, Spacer, Text } from './chunk-QO6UJAQN.js';
|
|
6
6
|
import { ImageViewer } from './chunk-THEP3VWY.js';
|
|
7
7
|
export { ImageViewer } from './chunk-THEP3VWY.js';
|
|
8
|
+
import { TimePicker } from './chunk-SNRKPEWT.js';
|
|
9
|
+
export { TimePicker } from './chunk-SNRKPEWT.js';
|
|
8
10
|
import { normalizeSearchFields, searchValuesFromParams, splitMultiValue, includesLooseSearch, cascadingValuePaths, SearchToolbar, searchFieldKeys, Popover } from './chunk-BD75U73S.js';
|
|
9
11
|
export { SearchToolbar, cascadingValuePaths, cleanSearchValues, includesLooseSearch, joinMultiValue, normalizeSearchText, searchFieldKeys, searchValuesFromParams, splitMultiValue } from './chunk-BD75U73S.js';
|
|
10
12
|
import { HoistedStyle, DateRangePicker, DatePicker } from './chunk-EFMKWPZ3.js';
|
|
@@ -14,9 +16,9 @@ import { DEV, isSafeNavigationTarget, useSduiAdapter, hostFetchOf, useSduiSandbo
|
|
|
14
16
|
export { defaultAdapter, useSduiAssetResolver, useSduiSandbox } from './chunk-DKPNFEVU.js';
|
|
15
17
|
import { EmptyState, Button, Checkbox, SegmentedControl, Spinner, Select, Pagination, Icon, Card, Badge, ProgressBar, Tag, Toast, Textarea, Tabs, Table, Switch, StatCard, Input, IconButton, Field, Alert, warnOnce } from './chunk-WIDDHR7L.js';
|
|
16
18
|
export { Alert, Avatar, Badge, Breadcrumb, Button, Card, Checkbox, Dialog, EmptyState, Field, Icon, IconButton, Input, Pagination, ProgressBar, Radio, SegmentedControl, Select, SidebarNav, Spinner, StatCard, Switch, Table, Tabs, Tag, Textarea, Toast, Tooltip } from './chunk-WIDDHR7L.js';
|
|
17
|
-
import { boxed,
|
|
19
|
+
import { boxed, LAYOUT_CSS, childLayoutFrom, CHILD_LAYOUT_PROPS } from './chunk-SAN4IX6N.js';
|
|
18
20
|
export { CHILD_LAYOUT_PROPS, LAYOUT_CSS, boxed, childLayoutFrom, columnsClass, containerLayoutStyle, joinClass, mergeStyle, typographyStyle } from './chunk-SAN4IX6N.js';
|
|
19
|
-
import
|
|
21
|
+
import React9, { createContext, useState, useMemo, useRef, useEffect, useCallback, useContext } from 'react';
|
|
20
22
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
21
23
|
|
|
22
24
|
// src/asset-url.ts
|
|
@@ -113,7 +115,7 @@ function resolveAssetsIn(propName, value, resolve, component) {
|
|
|
113
115
|
return out ?? record;
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
|
-
var NodeErrorBoundary = class extends
|
|
118
|
+
var NodeErrorBoundary = class extends React9.Component {
|
|
117
119
|
state = { error: null };
|
|
118
120
|
static getDerivedStateFromError(error) {
|
|
119
121
|
return { error };
|
|
@@ -161,145 +163,6 @@ function Can({ entity, action = "read", scope, fallback = null, children }) {
|
|
|
161
163
|
}
|
|
162
164
|
return can({ entity, action: typeof action === "string" ? action : "read", scope }) ? /* @__PURE__ */ jsx(Fragment, { children }) : /* @__PURE__ */ jsx(Fragment, { children: fallback });
|
|
163
165
|
}
|
|
164
|
-
function paddingStyle(padding) {
|
|
165
|
-
const value = padding === void 0 ? void 0 : PADDING_CSS[padding];
|
|
166
|
-
return value === void 0 ? {} : { padding: value };
|
|
167
|
-
}
|
|
168
|
-
var PADDING_CSS = {
|
|
169
|
-
"2": "2px",
|
|
170
|
-
"4": "4px",
|
|
171
|
-
"8": "8px",
|
|
172
|
-
"12": "12px",
|
|
173
|
-
"16": "16px",
|
|
174
|
-
"20": "20px",
|
|
175
|
-
"24": "24px",
|
|
176
|
-
"32": "32px"
|
|
177
|
-
};
|
|
178
|
-
function Grid({
|
|
179
|
-
columns = 3,
|
|
180
|
-
template,
|
|
181
|
-
gap,
|
|
182
|
-
align,
|
|
183
|
-
justify,
|
|
184
|
-
wrap,
|
|
185
|
-
padding,
|
|
186
|
-
className,
|
|
187
|
-
style,
|
|
188
|
-
children
|
|
189
|
-
}) {
|
|
190
|
-
return /* @__PURE__ */ jsx(
|
|
191
|
-
"div",
|
|
192
|
-
{
|
|
193
|
-
className: joinClass("wp-grid", !template && columnsClass(columns), className),
|
|
194
|
-
style: mergeStyle(
|
|
195
|
-
{
|
|
196
|
-
...template ? { gridTemplateColumns: template } : null,
|
|
197
|
-
...containerLayoutStyle({ gap, align, justify, wrap }),
|
|
198
|
-
...paddingStyle(padding)
|
|
199
|
-
},
|
|
200
|
-
style
|
|
201
|
-
),
|
|
202
|
-
children
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
function Row({ justify, gap, align, wrap, className, style, children }) {
|
|
207
|
-
return /* @__PURE__ */ jsx(
|
|
208
|
-
"div",
|
|
209
|
-
{
|
|
210
|
-
className: joinClass("wp-row", justify === "between" && "wp-row--between", className),
|
|
211
|
-
style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style),
|
|
212
|
-
children
|
|
213
|
-
}
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
function Actions({ justify = "end", gap, align, wrap, className, style, children }) {
|
|
217
|
-
return /* @__PURE__ */ jsx(
|
|
218
|
-
"div",
|
|
219
|
-
{
|
|
220
|
-
className: joinClass("wp-row", className),
|
|
221
|
-
style: mergeStyle({ flex: 1, ...containerLayoutStyle({ gap, align, justify, wrap }) }, style),
|
|
222
|
-
children
|
|
223
|
-
}
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
function Col({ gap, align, justify, wrap, className, style, children }) {
|
|
227
|
-
return /* @__PURE__ */ jsx("div", { className: joinClass("wp-col", className), style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style), children });
|
|
228
|
-
}
|
|
229
|
-
var SPACER_STEPS = /* @__PURE__ */ new Set([1, 2, 3, 4, 5, 6, 8]);
|
|
230
|
-
function Spacer({ size, className, style }) {
|
|
231
|
-
const step = size !== void 0 && SPACER_STEPS.has(Number(size)) ? Number(size) : void 0;
|
|
232
|
-
return /* @__PURE__ */ jsx(
|
|
233
|
-
"div",
|
|
234
|
-
{
|
|
235
|
-
className: joinClass("wp-spacer", step !== void 0 && `wp-spacer--${step}`, className),
|
|
236
|
-
style
|
|
237
|
-
}
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
function Section({ title, gap, align, justify, wrap, className, style, children }) {
|
|
241
|
-
return /* @__PURE__ */ jsxs(
|
|
242
|
-
"section",
|
|
243
|
-
{
|
|
244
|
-
className: joinClass("wp-col", className),
|
|
245
|
-
style: mergeStyle(containerLayoutStyle({ gap, align, justify, wrap }), style),
|
|
246
|
-
children: [
|
|
247
|
-
title ? /* @__PURE__ */ jsx("h2", { className: "wp-h4", children: title }) : null,
|
|
248
|
-
children
|
|
249
|
-
]
|
|
250
|
-
}
|
|
251
|
-
);
|
|
252
|
-
}
|
|
253
|
-
var TEXT_WRAP_CSS = {
|
|
254
|
-
normal: {},
|
|
255
|
-
preserve: { whiteSpace: "pre-wrap" },
|
|
256
|
-
anywhere: { whiteSpace: "pre-wrap", wordBreak: "break-all" }
|
|
257
|
-
};
|
|
258
|
-
function Text({
|
|
259
|
-
preset = "body",
|
|
260
|
-
as: Tag2 = "p",
|
|
261
|
-
weight,
|
|
262
|
-
textAlign,
|
|
263
|
-
wrap,
|
|
264
|
-
className,
|
|
265
|
-
style,
|
|
266
|
-
value,
|
|
267
|
-
children
|
|
268
|
-
}) {
|
|
269
|
-
return /* @__PURE__ */ jsx(
|
|
270
|
-
Tag2,
|
|
271
|
-
{
|
|
272
|
-
className: joinClass(`wp-${preset}`, className),
|
|
273
|
-
style: mergeStyle({ ...typographyStyle({ weight, textAlign }), ...TEXT_WRAP_CSS[wrap ?? "normal"] }, style),
|
|
274
|
-
children: value ?? children
|
|
275
|
-
}
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
function KeyValueList({ source, items, className, style }) {
|
|
279
|
-
return /* @__PURE__ */ jsx("div", { className: joinClass("wp-kv", className), style, children: (items ?? []).map((item, index) => {
|
|
280
|
-
const raw = item.key ? source?.[item.key] : item.value;
|
|
281
|
-
const content = raw === null || raw === void 0 || raw === "" ? "\u2014" : raw;
|
|
282
|
-
return /* @__PURE__ */ jsxs(React10.Fragment, { children: [
|
|
283
|
-
/* @__PURE__ */ jsx("span", { className: "wp-kv__k", children: item.label }),
|
|
284
|
-
/* @__PURE__ */ jsx("span", { className: joinClass("wp-kv__v", item.mono && "wp-mono"), children: content })
|
|
285
|
-
] }, index);
|
|
286
|
-
}) });
|
|
287
|
-
}
|
|
288
|
-
function PageHead({ title, subtitle, actions, className, style }) {
|
|
289
|
-
return /* @__PURE__ */ jsxs("div", { className: joinClass("wp-page-head", className), style, children: [
|
|
290
|
-
/* @__PURE__ */ jsxs("div", { className: "wp-page-head__text", children: [
|
|
291
|
-
title ? /* @__PURE__ */ jsx("h1", { className: "wp-page-head__title", children: title }) : null,
|
|
292
|
-
subtitle ? /* @__PURE__ */ jsx("div", { className: "wp-page-head__sub", children: subtitle }) : null
|
|
293
|
-
] }),
|
|
294
|
-
actions ? /* @__PURE__ */ jsx("div", { className: "wp-page-head__actions", children: actions }) : null
|
|
295
|
-
] });
|
|
296
|
-
}
|
|
297
|
-
function Show({ when, children }) {
|
|
298
|
-
return when ? /* @__PURE__ */ jsx(Fragment, { children }) : null;
|
|
299
|
-
}
|
|
300
|
-
function Divider({ style, className }) {
|
|
301
|
-
return /* @__PURE__ */ jsx("hr", { className: joinClass("wp-divider", className), style });
|
|
302
|
-
}
|
|
303
166
|
function imageRenderer(cell, key, width = cell.width ?? 72) {
|
|
304
167
|
const height = cell.height ?? 52;
|
|
305
168
|
return (row) => /* @__PURE__ */ jsx(
|
|
@@ -2640,7 +2503,7 @@ function SduiNodeRenderer({
|
|
|
2640
2503
|
return /* @__PURE__ */ jsx(Fragment, { children: rows.map((item, rowIndex) => {
|
|
2641
2504
|
const rowScope = [...scope, { item, index: rowIndex }];
|
|
2642
2505
|
const rowKey = isPlainObject4(item) && typeof item.id === "string" ? item.id : rowIndex;
|
|
2643
|
-
return /* @__PURE__ */ jsx(
|
|
2506
|
+
return /* @__PURE__ */ jsx(React9.Fragment, { children: childList?.map((child, i) => renderChild(child, i, rowScope, engine)) }, rowKey);
|
|
2644
2507
|
}) });
|
|
2645
2508
|
}
|
|
2646
2509
|
if (node.component === "Fragment") {
|
|
@@ -2716,11 +2579,11 @@ function SduiNodeRenderer({
|
|
|
2716
2579
|
const children = childList?.map((child, i) => renderChild(child, i, scope, engine));
|
|
2717
2580
|
return /* @__PURE__ */ jsx(Component, { ...props, children });
|
|
2718
2581
|
}
|
|
2719
|
-
var SduiFragmentChainContext =
|
|
2582
|
+
var SduiFragmentChainContext = React9.createContext([]);
|
|
2720
2583
|
var FRAGMENT_MAX_DEPTH = 4;
|
|
2721
2584
|
function SduiFragment({ node, scope, engine }) {
|
|
2722
2585
|
const adapter = useSduiAdapter();
|
|
2723
|
-
const chain =
|
|
2586
|
+
const chain = React9.useContext(SduiFragmentChainContext);
|
|
2724
2587
|
const raw = isPlainObject4(node.props) ? node.props.id : void 0;
|
|
2725
2588
|
const id = engine.resolveValue(raw, scope);
|
|
2726
2589
|
if (typeof id !== "string" || id === "") {
|
|
@@ -2775,9 +2638,9 @@ function SduiFragmentBody({
|
|
|
2775
2638
|
engine
|
|
2776
2639
|
}) {
|
|
2777
2640
|
const spec = useSpec(id);
|
|
2778
|
-
const nextChain =
|
|
2779
|
-
const bodyScope =
|
|
2780
|
-
|
|
2641
|
+
const nextChain = React9.useMemo(() => [...chain, id], [chain, id]);
|
|
2642
|
+
const bodyScope = React9.useMemo(() => [...scope, { args, callSiteScope: scope }], [scope, args]);
|
|
2643
|
+
React9.useEffect(() => {
|
|
2781
2644
|
if (!DEV || !isPlainObject4(spec) || !Array.isArray(spec.body)) return;
|
|
2782
2645
|
validateSpec(spec, new Set(Object.keys(engine.registry))).forEach(
|
|
2783
2646
|
(issue) => console.warn(`[sdui:spec:${id}] ${issue.path} \u2014 ${issue.message}`)
|
|
@@ -3268,4 +3131,4 @@ function SduiRenderer({
|
|
|
3268
3131
|
);
|
|
3269
3132
|
}
|
|
3270
3133
|
|
|
3271
|
-
export {
|
|
3134
|
+
export { CALC_OPS, Can, NodeErrorBoundary, RemoteSearchResults, ResultTable, SduiForm, SduiRenderer, SduiSearchDataProvider, SduiSearchResults, SearchResults, SortHandle, SortableList, cellRenderer, createRegistry, defaultRegistry, imageRenderer, normalizePageSizes, sortableDropIndex, sortableMove, useRemoteSearchPage, useSduiRuntime, useSearchFetcher, validateSpec };
|
package/dist/meta.d.ts
CHANGED
|
@@ -432,6 +432,10 @@ declare const PermissionMatrixEditorMeta: SduiComponentMeta;
|
|
|
432
432
|
declare const RoleMemberPickerMeta: SduiComponentMeta;
|
|
433
433
|
declare const FileDropzoneMeta: SduiComponentMeta;
|
|
434
434
|
declare const ExcelUploadCardMeta: SduiComponentMeta;
|
|
435
|
+
declare const OptionSchemaEditorMeta: SduiComponentMeta;
|
|
436
|
+
declare const OptionValueFieldsMeta: SduiComponentMeta;
|
|
437
|
+
declare const StagePeriodEditorMeta: SduiComponentMeta;
|
|
438
|
+
declare const QRDisplayMeta: SduiComponentMeta;
|
|
435
439
|
declare const AutocompleteFieldMeta: SduiComponentMeta;
|
|
436
440
|
declare const InlineEditMeta: SduiComponentMeta;
|
|
437
441
|
declare const JsonFieldMeta: SduiComponentMeta;
|
|
@@ -468,6 +472,10 @@ declare const widgetComponentMeta: {
|
|
|
468
472
|
ApprovalLineEditor: SduiComponentMeta;
|
|
469
473
|
ApprovalOverridesEditor: SduiComponentMeta;
|
|
470
474
|
ApprovalStepper: SduiComponentMeta;
|
|
475
|
+
QRDisplay: SduiComponentMeta;
|
|
476
|
+
OptionSchemaEditor: SduiComponentMeta;
|
|
477
|
+
OptionValueFields: SduiComponentMeta;
|
|
478
|
+
StagePeriodEditor: SduiComponentMeta;
|
|
471
479
|
ExcelUploadCard: SduiComponentMeta;
|
|
472
480
|
FileDropzone: SduiComponentMeta;
|
|
473
481
|
PermissionMatrixEditor: SduiComponentMeta;
|
|
@@ -606,4 +614,4 @@ declare function paletteGroups(catalog?: Record<string, SduiComponentMeta>): Arr
|
|
|
606
614
|
items: SduiComponentMeta[];
|
|
607
615
|
}>;
|
|
608
616
|
|
|
609
|
-
export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, ExcelUploadCardMeta, FieldMeta, FileDropzoneMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
|
|
617
|
+
export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, ExcelUploadCardMeta, FieldMeta, FileDropzoneMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OptionSchemaEditorMeta, OptionValueFieldsMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, QRDisplayMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, type SduiCategory, type SduiChildrenMeta, type SduiComponentMeta, type SduiDomMeta, type SduiEnumOption, type SduiPropGroup, type SduiPropKind, type SduiPropMeta, type SduiResizeMeta, type SduiSlotMeta, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StagePeriodEditorMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
|
package/dist/meta.js
CHANGED
|
@@ -4060,6 +4060,175 @@ var ExcelUploadCardMeta = {
|
|
|
4060
4060
|
},
|
|
4061
4061
|
resize: { kind: "none" }
|
|
4062
4062
|
};
|
|
4063
|
+
var OptionSchemaEditorMeta = {
|
|
4064
|
+
name: "OptionSchemaEditor",
|
|
4065
|
+
label: "\uC635\uC158 \uC11C\uC2DD \uD3B8\uC9D1",
|
|
4066
|
+
category: "input",
|
|
4067
|
+
icon: "sliders-horizontal",
|
|
4068
|
+
description: "\uC7A5\uBE44\uAC00 \uC790\uAE30 \uC720\uB2DB\uC5D0\uAC8C \uBC1B\uC744 \uC635\uC158\uC758 \uC11C\uC2DD(\uC774\uB984\xB7\uD615\uC2DD\xB7\uC120\uD0DD\uC9C0)\uC744 \uC815\uD55C\uB2E4. \uAC12\uC774 \uC544\uB2C8\uB77C \uC11C\uC2DD\uC774\uB2E4 \u2014 \uC720\uB2DB \uC218\uC815\uC740 \uC774 \uC11C\uC2DD\uB300\uB85C \uCE78\uC744 \uADF8\uB9B0\uB2E4(OptionValueFields).",
|
|
4069
|
+
props: [
|
|
4070
|
+
{
|
|
4071
|
+
name: "value",
|
|
4072
|
+
kind: "object",
|
|
4073
|
+
label: "\uC7A5\uBE44 config",
|
|
4074
|
+
bindable: true,
|
|
4075
|
+
description: "\uC11C\uC2DD\uC740 \uC774 \uAC1D\uCCB4\uC758 options\uC5D0 \uB2F4\uAE34\uB2E4 \u2014 { options: [{ key, label?, type, options?, unit? }] }. \uBC30\uC5F4\uC774 \uC544\uB2C8\uB77C config \uD1B5\uC9F8\uB85C \uC8FC\uACE0\uBC1B\uB294 \uC774\uC720\uB294 setState\uAC00 \uC810 \uACBD\uB85C\uB97C \uD3C9\uBA74 \uD0A4\uB85C \uC800\uC7A5\uD558\uAE30 \uB54C\uBB38\uC774\uB2E4.",
|
|
4076
|
+
group: "data"
|
|
4077
|
+
},
|
|
4078
|
+
{
|
|
4079
|
+
name: "onChange",
|
|
4080
|
+
kind: "action",
|
|
4081
|
+
label: "\uBCC0\uACBD",
|
|
4082
|
+
eventArg: "options\uAC00 \uAC31\uC2E0\uB41C config \uAC1D\uCCB4",
|
|
4083
|
+
description: '{ "action": "setState", "key": "assetEditForm.config", "fromEvent": true }',
|
|
4084
|
+
group: "behavior"
|
|
4085
|
+
},
|
|
4086
|
+
{ name: "disabled", kind: "boolean", label: "\uBE44\uD65C\uC131", default: false, bindable: true, group: "behavior" }
|
|
4087
|
+
],
|
|
4088
|
+
children: { accepts: false },
|
|
4089
|
+
dom: { element: "div" },
|
|
4090
|
+
preset: {
|
|
4091
|
+
component: "OptionSchemaEditor",
|
|
4092
|
+
props: {
|
|
4093
|
+
value: { $state: "form.config", default: {} },
|
|
4094
|
+
onChange: { action: "setState", key: "form.config", fromEvent: true }
|
|
4095
|
+
}
|
|
4096
|
+
},
|
|
4097
|
+
resize: { kind: "none" }
|
|
4098
|
+
};
|
|
4099
|
+
var OptionValueFieldsMeta = {
|
|
4100
|
+
name: "OptionValueFields",
|
|
4101
|
+
label: "\uC635\uC158 \uAC12 \uC785\uB825",
|
|
4102
|
+
category: "input",
|
|
4103
|
+
icon: "list-filter",
|
|
4104
|
+
description: "\uC7A5\uBE44\uAC00 \uC815\uD574 \uB454 \uC635\uC158 \uC11C\uC2DD\uB300\uB85C \uC720\uB2DB\uC758 \uAC12 \uCE78\uC744 \uADF8\uB9B0\uB2E4. \uC11C\uC2DD\uC5D0 \uC5C6\uB294 \uD0A4\uB294 \uAC74\uB4DC\uB9AC\uC9C0 \uC54A\uACE0 \uADF8\uB300\uB85C \uBCF4\uAD00\uD55C\uB2E4.",
|
|
4105
|
+
props: [
|
|
4106
|
+
{
|
|
4107
|
+
name: "schema",
|
|
4108
|
+
kind: "array",
|
|
4109
|
+
label: "\uC635\uC158 \uC11C\uC2DD",
|
|
4110
|
+
bindable: true,
|
|
4111
|
+
description: "\uC7A5\uBE44\uC758 assets.config.options \u2014 OptionSchemaEditor\uAC00 \uB9CC\uB4E0 \uBC30\uC5F4 \uADF8\uB300\uB85C.",
|
|
4112
|
+
group: "data",
|
|
4113
|
+
item: [
|
|
4114
|
+
{ name: "key", kind: "string", label: "\uC774\uB984(\uD0A4)", required: true },
|
|
4115
|
+
{ name: "label", kind: "string", label: "\uD45C\uC2DC \uC774\uB984" },
|
|
4116
|
+
{ name: "type", kind: "string", label: "\uD615\uC2DD", required: true },
|
|
4117
|
+
{ name: "options", kind: "array", label: "\uC120\uD0DD\uC9C0", itemKind: "string", item: [] },
|
|
4118
|
+
{ name: "unit", kind: "string", label: "\uB2E8\uC704" }
|
|
4119
|
+
]
|
|
4120
|
+
},
|
|
4121
|
+
{
|
|
4122
|
+
name: "value",
|
|
4123
|
+
kind: "object",
|
|
4124
|
+
label: "\uC635\uC158 \uAC12",
|
|
4125
|
+
bindable: true,
|
|
4126
|
+
description: "{ \uD0A4: \uAC12 } \uD3C9\uBA74 \uAC1D\uCCB4 \u2014 asset_units.config.",
|
|
4127
|
+
group: "data"
|
|
4128
|
+
},
|
|
4129
|
+
{
|
|
4130
|
+
name: "onChange",
|
|
4131
|
+
kind: "action",
|
|
4132
|
+
label: "\uBCC0\uACBD",
|
|
4133
|
+
eventArg: "\uC635\uC158 \uAC12 \uAC1D\uCCB4",
|
|
4134
|
+
description: '{ "action": "setState", "key": "unitForm.config", "fromEvent": true }',
|
|
4135
|
+
group: "behavior"
|
|
4136
|
+
},
|
|
4137
|
+
{ name: "disabled", kind: "boolean", label: "\uBE44\uD65C\uC131", default: false, bindable: true, group: "behavior" },
|
|
4138
|
+
{
|
|
4139
|
+
name: "readOnly",
|
|
4140
|
+
kind: "boolean",
|
|
4141
|
+
label: "\uC77D\uAE30 \uD45C\uC2DC",
|
|
4142
|
+
default: false,
|
|
4143
|
+
description: "\uC0C1\uC138 \uD654\uBA74\uC6A9 \u2014 \uC785\uB825\uCE78 \uB300\uC2E0 \uAC12\uC774 \uC788\uB294 \uCE78\uB9CC \uB77C\uBCA8\xB7\uAC12 \uC904\uB85C \uC138\uC6B4\uB2E4.",
|
|
4144
|
+
group: "appearance"
|
|
4145
|
+
}
|
|
4146
|
+
],
|
|
4147
|
+
children: { accepts: false },
|
|
4148
|
+
dom: { element: "div" },
|
|
4149
|
+
preset: {
|
|
4150
|
+
component: "OptionValueFields",
|
|
4151
|
+
props: {
|
|
4152
|
+
schema: { $state: "rt.assetOptions.config.options", default: [] },
|
|
4153
|
+
value: { $state: "unitForm.config", default: {} },
|
|
4154
|
+
onChange: { action: "setState", key: "unitForm.config", fromEvent: true }
|
|
4155
|
+
}
|
|
4156
|
+
},
|
|
4157
|
+
resize: { kind: "none" }
|
|
4158
|
+
};
|
|
4159
|
+
var StagePeriodEditorMeta = {
|
|
4160
|
+
name: "StagePeriodEditor",
|
|
4161
|
+
label: "\uB2E8\uACC4 \uAE30\uAC04 \uC785\uB825\uAE30",
|
|
4162
|
+
category: "input",
|
|
4163
|
+
icon: "calendar",
|
|
4164
|
+
description: "\uD3C9\uAC00 \uB2E8\uACC4\uC758 \uAE30\uAC04 4\uD544\uB4DC(startDate/endDate/startTime/endTime)\uB97C \uD3B8\uC9D1\uD55C\uB2E4. \uBE48\uAC12\u2192null \uC815\uADDC\uD654\uC640 \uC11C\uBC84 validate_period \uBBF8\uB7EC(\uC885\uB8CC\uC77C<\uC2DC\uC791\uC77C, \uAC19\uC740 \uB0A0 \uC2DC\uAC04 \uC21C\uC11C)\uAC00 \uC874\uC7AC \uC774\uC720 \u2014 onChange \uBD09\uD22C\uC758 error\uAC00 \uC788\uC73C\uBA74 \uC800\uC7A5\uC744 \uC7A0\uADFC\uB2E4. \uC800\uC7A5\uC740 \uC2A4\uD399\uC774 PATCH \uCCB4\uC778\uC73C\uB85C \uD55C\uB2E4.",
|
|
4165
|
+
props: [
|
|
4166
|
+
{ name: "value", kind: "object", label: "\uC800\uC7A5\uB41C \uAE30\uAC04", bindable: true, description: "\uB2E8\uACC4 \uD589(stages[]) \uADF8\uB300\uB85C \u2014 \uC2DC\uAC01 HH:MM:SS \uD5C8\uC6A9, HH:MM\uB85C \uC815\uADDC\uD654\uD574 \uC77D\uB294\uB2E4. \uC2DC\uB529 \uC804\uC6A9.", group: "data" },
|
|
4167
|
+
{ name: "onChange", kind: "action", label: "\uBCC0\uACBD", description: "{startDate,endDate,startTime,endTime(null|\uC720\uD6A8\uAC12), error} \uBD09\uD22C. \uB9C8\uC6B4\uD2B8 \uC9C1\uD6C4\uC5D0\uB3C4 1\uD68C \uD758\uB9B0\uB2E4.", group: "behavior" },
|
|
4168
|
+
{ name: "resetKey", kind: "string", label: "\uC7AC\uC2DC\uB529 \uD0A4", bindable: true, group: "data", advanced: true },
|
|
4169
|
+
{ name: "disabled", kind: "boolean", label: "\uBE44\uD65C\uC131", default: false, bindable: true, group: "behavior" }
|
|
4170
|
+
],
|
|
4171
|
+
children: { accepts: false },
|
|
4172
|
+
dom: { element: "div" },
|
|
4173
|
+
preset: {
|
|
4174
|
+
component: "StagePeriodEditor",
|
|
4175
|
+
// 빈 props 는 저장 왕복에서 사라진다(편집기 계약) — 프리셋은 실제로 채운다.
|
|
4176
|
+
props: { value: { startDate: "", endDate: "", startTime: "09:00", endTime: "18:00" } }
|
|
4177
|
+
},
|
|
4178
|
+
resize: { kind: "none" }
|
|
4179
|
+
};
|
|
4180
|
+
var QRDisplayMeta = {
|
|
4181
|
+
name: "QRDisplay",
|
|
4182
|
+
label: "QR \uCF54\uB4DC",
|
|
4183
|
+
category: "display",
|
|
4184
|
+
icon: "scan",
|
|
4185
|
+
description: "\uBC31\uC5D4\uB4DC QR \uB80C\uB354\uB7EC(GET /qr)\uB85C \uB9CC\uB4E0 QR \uC774\uBBF8\uC9C0\uB97C \uCEA1\uC158\uACFC \uD568\uAED8 \uBCF4\uC5EC\uC900\uB2E4. \uB85C\uB4DC\uC5D0 \uC2E4\uD328\uD558\uBA74 \uC810\uC120 \uD50C\uB808\uC774\uC2A4\uD640\uB354\uB85C \uB300\uCCB4\uB41C\uB2E4.",
|
|
4186
|
+
props: [
|
|
4187
|
+
{
|
|
4188
|
+
name: "path",
|
|
4189
|
+
kind: "string",
|
|
4190
|
+
label: "\uC571 \uB0B4\uBD80 \uACBD\uB85C",
|
|
4191
|
+
bindable: true,
|
|
4192
|
+
description: '\uC608: "/public/asset/unit/WP-0001". \uB9C8\uC6B4\uD2B8 \uD6C4 \uC808\uB300 URL\uB85C \uBCC0\uD658\uD574 \uC778\uCF54\uB529\uD55C\uB2E4.',
|
|
4193
|
+
group: "content"
|
|
4194
|
+
},
|
|
4195
|
+
// 실측 2/2
|
|
4196
|
+
{
|
|
4197
|
+
name: "url",
|
|
4198
|
+
kind: "string",
|
|
4199
|
+
label: "URL \uC9C1\uC811 \uC9C0\uC815",
|
|
4200
|
+
bindable: true,
|
|
4201
|
+
description: "path\uBCF4\uB2E4 \uC6B0\uC120\uD55C\uB2E4.",
|
|
4202
|
+
group: "content",
|
|
4203
|
+
advanced: true
|
|
4204
|
+
},
|
|
4205
|
+
// 실측 0/2 — 구현에는 있다
|
|
4206
|
+
{
|
|
4207
|
+
name: "size",
|
|
4208
|
+
kind: "number",
|
|
4209
|
+
label: "\uD06C\uAE30(px)",
|
|
4210
|
+
default: 128,
|
|
4211
|
+
description: "QR \uD55C \uBCC0. \uAC00\uB85C\xB7\uC138\uB85C\uAC00 \uAC19\uC774 \uC6C0\uC9C1\uC778\uB2E4.",
|
|
4212
|
+
group: "appearance"
|
|
4213
|
+
},
|
|
4214
|
+
// 실측 2/2 (148, 112)
|
|
4215
|
+
{ name: "caption", kind: "string", label: "\uCEA1\uC158", group: "content" }
|
|
4216
|
+
// 실측 2/2
|
|
4217
|
+
],
|
|
4218
|
+
children: { accepts: false },
|
|
4219
|
+
dom: { element: "figure" },
|
|
4220
|
+
// 실측: 루트가 <figure>
|
|
4221
|
+
preset: {
|
|
4222
|
+
component: "QRDisplay",
|
|
4223
|
+
props: { path: "/", size: 128, caption: "QR \uCF54\uB4DC" }
|
|
4224
|
+
},
|
|
4225
|
+
// size 하나가 한 변이라 가로 손잡이든 세로 손잡이든 같은 프롭을 움직인다.
|
|
4226
|
+
// 실측(resizePatch 직접 호출): dx=+40 dy=0 → {size:168} · dx=0 dy=+40 → {size:168} ·
|
|
4227
|
+
// dx=+40 dy=+10 → {size:168}. 대각선은 더 많이 끈 축을 따른다(합산이 아니다).
|
|
4228
|
+
// 처음 적을 때는 이 문장을 재보지 않고 썼고 실제로는 거짓이었다 — 가로 손잡이가
|
|
4229
|
+
// 죽어 있었다. resize.ts의 "같은 프롭이면 축을 합친다" 분기를 그때 넣어 참으로 만들었다.
|
|
4230
|
+
resize: { kind: "numeric", widthProp: "size", heightProp: "size", unit: "px", axis: "both" }
|
|
4231
|
+
};
|
|
4063
4232
|
var AutocompleteFieldMeta = {
|
|
4064
4233
|
name: "AutocompleteField",
|
|
4065
4234
|
label: "\uC790\uB3D9\uC644\uC131",
|
|
@@ -5480,6 +5649,10 @@ var widgetComponentMeta = {
|
|
|
5480
5649
|
ApprovalLineEditor: ApprovalLineEditorMeta,
|
|
5481
5650
|
ApprovalOverridesEditor: ApprovalOverridesEditorMeta,
|
|
5482
5651
|
ApprovalStepper: ApprovalStepperMeta,
|
|
5652
|
+
QRDisplay: QRDisplayMeta,
|
|
5653
|
+
OptionSchemaEditor: OptionSchemaEditorMeta,
|
|
5654
|
+
OptionValueFields: OptionValueFieldsMeta,
|
|
5655
|
+
StagePeriodEditor: StagePeriodEditorMeta,
|
|
5483
5656
|
ExcelUploadCard: ExcelUploadCardMeta,
|
|
5484
5657
|
FileDropzone: FileDropzoneMeta,
|
|
5485
5658
|
PermissionMatrixEditor: PermissionMatrixEditorMeta,
|
|
@@ -5543,4 +5716,4 @@ function paletteGroups(catalog = allComponentMeta) {
|
|
|
5543
5716
|
})).filter((group) => group.items.length > 0);
|
|
5544
5717
|
}
|
|
5545
5718
|
|
|
5546
|
-
export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, ExcelUploadCardMeta, FieldMeta, FileDropzoneMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
|
|
5719
|
+
export { ActionsMeta, AlertMeta, ApprovalLineEditorMeta, ApprovalOverridesEditorMeta, ApprovalStepperMeta, AutocompleteFieldMeta, AvatarMeta, BadgeMeta, BreadcrumbMeta, ButtonMeta, CanMeta, CardMeta, ChartMeta, CheckboxMeta, ColMeta, ColumnBoardMeta, DatePickerMeta, DateRangePickerMeta, DialogMeta, DiffViewMeta, DisclosureMeta, DividerMeta, EmptyStateMeta, EventCalendarMeta, ExcelUploadCardMeta, FieldMeta, FileDropzoneMeta, ForEachMeta, FormMeta, FragmentMeta, GridMeta, IconButtonMeta, IconMeta, ImageLightboxMeta, InlineEditMeta, InputMeta, JsonFieldMeta, KeyValueListMeta, LiveClockMeta, MapPreviewMeta, OptionSchemaEditorMeta, OptionValueFieldsMeta, OrgChartBoardMeta, OrgChartMeta, PageHeadMeta, PaginationMeta, PeriodFilterMeta, PermissionMatrixEditorMeta, PrintSheetMeta, ProgressBarMeta, QRDisplayMeta, RadioMeta, RankBoardMeta, RecordSheetMeta, RemoteSearchResultsMeta, RoleMemberPickerMeta, RowMeta, SDUI_CATEGORIES, SELF_AXIS_PROPS, SearchResultsMeta, SearchableMultiPickerMeta, SectionMeta, SecureScreenMeta, SegmentedControlMeta, SelectMeta, ShowMeta, SidebarNavMeta, SortHandleMeta, SortableListMeta, SpacerMeta, SpinnerMeta, StackedMeterMeta, StagePeriodEditorMeta, StatCardMeta, StripMeta, SummaryTableMeta, SwitchMeta, TableMeta, TabsMeta, TagMeta, TagMultiSelectMeta, TextMeta, TextareaMeta, TimePickerMeta, TimelineMeta, ToastMeta, TooltipMeta, TreePickerMeta, TreeViewMeta, allComponentMeta, builtinComponentMeta, coreComponentMeta, dsComponentMeta, getComponentMeta, paletteGroups, richComponentMeta, slotNamesOf, widgetComponentMeta, withSelfAxis, withSelfAxisAll };
|
package/dist/rich.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { TimePicker } from './chunk-SNRKPEWT.js';
|
|
2
1
|
import { useOptionalModule, DependencyPlaceholder } from './chunk-RRMKCZYQ.js';
|
|
2
|
+
export { TimePicker } from './chunk-SNRKPEWT.js';
|
|
3
3
|
import { HoistedStyle } from './chunk-EFMKWPZ3.js';
|
|
4
4
|
export { DatePicker, DateRangePicker } from './chunk-EFMKWPZ3.js';
|
|
5
5
|
import './chunk-XQPTSEJC.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* OptionSchemaEditor — 장비가 자기 유닛에게 받을 **옵션 서식**을 정한다.
|
|
6
|
+
*
|
|
7
|
+
* 유닛의 사양(CPU·RAM·해상도…)은 장비 종류마다 달라서 컬럼으로 세울 수 없다.
|
|
8
|
+
* 그래서 값은 `asset_units.config`(JSON)에 담기는데, 지금까지는 그 JSON을 사람이
|
|
9
|
+
* 직접 쓰고 있었다 — 키 이름이 유닛마다 갈리고(`cpu`/`CPU`/`씨피유`) 숫자여야 할
|
|
10
|
+
* 자리에 문자열이 들어가도 아무도 못 막는다.
|
|
11
|
+
*
|
|
12
|
+
* 여기서 정하는 것은 **값이 아니라 서식**이다. 장비에 한 번 정해 두면
|
|
13
|
+
* (`assets.config.options`) 유닛 수정 화면이 그 서식대로 칸을 그린다
|
|
14
|
+
* ({@link ./OptionValueFields.tsx}). SDUI가 스펙을 화면으로 만드는 것과 같은 결이고,
|
|
15
|
+
* 서식이 스펙이 아니라 **데이터**라는 점만 다르다 — 장비마다 다르니 스펙일 수 없다.
|
|
16
|
+
*
|
|
17
|
+
* 계약: `value`는 장비의 **config 객체 통째**이고 서식은 그 안의 `options`다.
|
|
18
|
+
* { options: [{ key, label?, type: 'text'|'number'|'select'|'boolean', options?, unit? }] }
|
|
19
|
+
*
|
|
20
|
+
* 배열만 주고받지 않는 이유는 SDUI의 `setState`가 **점 경로를 평면 키로 저장**하기
|
|
21
|
+
* 때문이다 — `assetEditForm.config.options`로 쓰면 그 이름의 납작한 키가 하나 생길 뿐
|
|
22
|
+
* `config` 안에 들어가지 않아 폼 본문에 실리지 않는다. 그래서 다른 폼 칸과 똑같이
|
|
23
|
+
* 키 하나(`assetEditForm.config`)를 주고받고, `options` 밖의 값은 그대로 보존한다.
|
|
24
|
+
* - `key`가 유닛 config의 실제 키다. 비었거나 겹치면 저장 못 하게 사유를 띄운다
|
|
25
|
+
* (스펙은 이 위젯 밖이라 검증을 여기서 보여 준다).
|
|
26
|
+
* - `label`은 화면에 쓸 이름 — 비면 key를 그대로 쓴다.
|
|
27
|
+
*/
|
|
28
|
+
declare const OPTION_TYPES: readonly [{
|
|
29
|
+
readonly value: "text";
|
|
30
|
+
readonly label: "문자열";
|
|
31
|
+
}, {
|
|
32
|
+
readonly value: "number";
|
|
33
|
+
readonly label: "숫자";
|
|
34
|
+
}, {
|
|
35
|
+
readonly value: "select";
|
|
36
|
+
readonly label: "선택";
|
|
37
|
+
}, {
|
|
38
|
+
readonly value: "boolean";
|
|
39
|
+
readonly label: "예/아니오";
|
|
40
|
+
}];
|
|
41
|
+
type OptionFieldType = (typeof OPTION_TYPES)[number]['value'];
|
|
42
|
+
interface OptionField {
|
|
43
|
+
key: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
type: OptionFieldType;
|
|
46
|
+
/** type=select일 때의 선택지 */
|
|
47
|
+
options?: string[];
|
|
48
|
+
/** 숫자 뒤에 붙는 단위 표시 — GB·인치처럼 값에 섞지 않을 것들 */
|
|
49
|
+
unit?: string;
|
|
50
|
+
}
|
|
51
|
+
/** 장비의 config — 서식은 options에 담고 나머지 키는 손대지 않는다 */
|
|
52
|
+
interface AssetOptionConfig {
|
|
53
|
+
options?: OptionField[];
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface OptionSchemaEditorProps {
|
|
57
|
+
value?: AssetOptionConfig | null;
|
|
58
|
+
onChange?: (config: AssetOptionConfig) => void;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
}
|
|
61
|
+
declare const OptionSchemaEditor: React.FC<OptionSchemaEditorProps & SduiBoxProps>;
|
|
62
|
+
|
|
63
|
+
export { type AssetOptionConfig, OPTION_TYPES, type OptionField, type OptionFieldType, OptionSchemaEditor, type OptionSchemaEditorProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import { OptionField } from './OptionSchemaEditor.js';
|
|
4
|
+
|
|
5
|
+
interface OptionValueFieldsProps {
|
|
6
|
+
/** 장비의 옵션 서식 (assets.config.options) */
|
|
7
|
+
schema?: OptionField[];
|
|
8
|
+
/** 유닛의 옵션 값 (asset_units.config) */
|
|
9
|
+
value?: Record<string, unknown> | null;
|
|
10
|
+
onChange?: (value: Record<string, unknown>) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 입력 대신 읽기 표시 — 상세 화면용. 값이 있는 칸만 라벨·값 줄로 세운다.
|
|
14
|
+
* 잠긴 입력칸으로 대신하지 않는 이유: 회색 입력칸은 "고칠 수 있는데 지금은 막혔다"로
|
|
15
|
+
* 읽히고, 빈 칸이 줄줄이 서면 값이 없다는 사실만 크게 보인다.
|
|
16
|
+
*/
|
|
17
|
+
readOnly?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const OptionValueFields: React__default.FC<OptionValueFieldsProps & SduiBoxProps>;
|
|
20
|
+
|
|
21
|
+
export { OptionValueFields, type OptionValueFieldsProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* QRDisplay — 백엔드 QR 렌더러(GET {API_BASE}/qr)로 만든 QR 이미지를 카드로 표시.
|
|
6
|
+
*
|
|
7
|
+
* path(앱 내부 경로) 또는 url을 받아 마운트 후 절대 URL로 변환해
|
|
8
|
+
* 인코딩한다(SSR 안전). 백엔드가 없어 이미지 로드가 실패하면 점선
|
|
9
|
+
* 플레이스홀더 + 안내 문구로 대체한다.
|
|
10
|
+
*
|
|
11
|
+
* ## 자산 관문을 스스로 통과시킨다 (useSduiAssetResolver)
|
|
12
|
+
*
|
|
13
|
+
* 렌더러의 자산 순회는 **스펙이 준 URL**만 본다. 이 컴포넌트는 그 검사에 걸릴 문자열이
|
|
14
|
+
* 애초에 없다 — `src`를 프롭으로 받지 않고 `apiUrl('/qr?data=…')`로 **안에서 만들어**
|
|
15
|
+
* 붙이기 때문이다. 그래서 편집기 캔버스가 클릭·fetch·navigate를 다 막아 둔 상태에서도
|
|
16
|
+
* 이 `<img>` 하나는 잠금 밖이었다. 목적지가 동일 오리진이라 **세션 쿠키까지 실린다.**
|
|
17
|
+
*
|
|
18
|
+
* 더 나쁜 경우가 둘 더 있다.
|
|
19
|
+
* - 프롭을 아예 안 주면 `window.location.href`로 채우는데(아래 effect), 캔버스에서 그건
|
|
20
|
+
* **편집기 자신의 URL**이다. 남의 스펙을 여는 것만으로 편집 중인 화면 주소가 QR 인코딩
|
|
21
|
+
* 요청에 실려 나간다.
|
|
22
|
+
* - Tauri 데스크톱에서 `apiUrl`의 기준은 **사용자가 설정한 임의 호스트**다. 웹처럼
|
|
23
|
+
* 동일 오리진으로 끝나지 않는다.
|
|
24
|
+
*
|
|
25
|
+
* 그래서 URL을 만든 쪽이 직접 관문에 태운다. 진짜 앱에서는 항등함수라
|
|
26
|
+
* (`defaultAdapter.resolveAsset`) 바이트 단위로 같은 요청이 나간다.
|
|
27
|
+
*/
|
|
28
|
+
interface QRDisplayProps {
|
|
29
|
+
/** QR에 담을 앱 내부 경로(예: "/hr/employees/1"). 마운트 후 절대 URL로 변환. */
|
|
30
|
+
path?: string;
|
|
31
|
+
/** 절대/상대 URL을 직접 지정. path보다 우선한다. */
|
|
32
|
+
url?: string;
|
|
33
|
+
/** QR 한 변(px). 기본 128. */
|
|
34
|
+
size?: number;
|
|
35
|
+
/**
|
|
36
|
+
* QR 이미지를 내주는 서버 경로. `?data=<인코딩된 URL>&size=<px>` 가 붙는다.
|
|
37
|
+
* 기본 '/qr'. API 가 다른 오리진이면 그 절대 주소를 넘긴다.
|
|
38
|
+
*/
|
|
39
|
+
endpoint?: string;
|
|
40
|
+
caption?: string;
|
|
41
|
+
}
|
|
42
|
+
/** 바깥에서 온 `style`·`className`을 뿌리에 얹어 내보낸다 — 자기 축(폭·여백)이 닿게 하는 통로. */
|
|
43
|
+
declare const QRDisplay: React.FC<QRDisplayProps & SduiBoxProps>;
|
|
44
|
+
|
|
45
|
+
export { QRDisplay, type QRDisplayProps };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { S as SduiBoxProps } from '../layout-B1QrIBm6.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* StagePeriodEditor — 평가 단계(회차 소속 세션)의 기간 4필드 편집기.
|
|
6
|
+
*
|
|
7
|
+
* v2 evaluation-campaign-management.tsx의 StagePeriodDialog 본문 이식이다.
|
|
8
|
+
* 스펙만으로는 안 되는 두 가지가 이 계층의 존재 이유다:
|
|
9
|
+
* 1. **빈값 → null 정규화** — 서버 PATCH /evaluation-sessions/{id}는 빈 문자열을
|
|
10
|
+
* 400("YYYY-MM-DD/HH:MM 형식")으로 거부하고 null만 "기간 없음"으로 받는다.
|
|
11
|
+
* 스펙($calc)에는 ""→null 변환 연산이 없다.
|
|
12
|
+
* 2. **서버 validate_period의 클라이언트 미러** — 종료일<시작일, 같은 날
|
|
13
|
+
* 종료시간≤시작시간. 날짜 문자열 비교 연산이 스펙에 없다.
|
|
14
|
+
*
|
|
15
|
+
* 프롭 계약:
|
|
16
|
+
* - value: 저장된 기간(서버 stages[]의 startDate/endDate/startTime/endTime —
|
|
17
|
+
* 시각은 'HH:MM:SS'도 허용, 'HH:MM'으로 정규화해 읽는다). **시딩 전용** —
|
|
18
|
+
* resetKey가 바뀔 때만 다시 읽는다(편집 중 재조회가 입력을 덮지 않게, v2와
|
|
19
|
+
* 같은 마운트 1회 초기화 의미론).
|
|
20
|
+
* - onChange: { startDate, endDate, startTime, endTime, error } 봉투.
|
|
21
|
+
* 4필드는 항상 null 또는 유효값이라 그대로 PATCH body에 바인딩할 수 있고,
|
|
22
|
+
* error가 있으면 스펙은 저장 버튼을 잠근다. 마운트 직후에도 한 번 흘린다.
|
|
23
|
+
* - 저장은 스펙이 한다(PATCH camel 4필드). 시간을 날짜 없이 두는 조합은 입력
|
|
24
|
+
* 단계에서 막는다(날짜를 지우면 시각도 함께 비움 — v2 동일).
|
|
25
|
+
*/
|
|
26
|
+
/** onChange 봉투 — 4필드는 null 또는 유효값, error가 있으면 저장 금지. */
|
|
27
|
+
interface StagePeriodValue {
|
|
28
|
+
startDate: string | null;
|
|
29
|
+
endDate: string | null;
|
|
30
|
+
startTime: string | null;
|
|
31
|
+
endTime: string | null;
|
|
32
|
+
error: string | null;
|
|
33
|
+
}
|
|
34
|
+
interface StagePeriodEditorProps {
|
|
35
|
+
/** 저장된 기간(서버 응답 그대로). 시딩 전용 — resetKey가 바뀔 때 다시 읽는다. */
|
|
36
|
+
value?: unknown;
|
|
37
|
+
onChange?: (value: StagePeriodValue) => void;
|
|
38
|
+
/** 단계 id — 바뀌면 value로 폼을 다시 시딩한다(다이얼로그 재사용 대비). */
|
|
39
|
+
resetKey?: string;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** 바깥 style·className을 뿌리에 얹는다 — 자기 축(폭·여백) 통로. */
|
|
43
|
+
declare const StagePeriodEditor: React.FC<StagePeriodEditorProps & SduiBoxProps>;
|
|
44
|
+
|
|
45
|
+
export { StagePeriodEditor, type StagePeriodEditorProps, type StagePeriodValue };
|