@uipath/ui-widgets-validation-station 1.0.1 → 1.1.0-rc.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 +384 -191
- package/dist/ValidationStation.d.ts +12 -0
- package/dist/ValidationStation.d.ts.map +1 -1
- package/dist/ValidationStation.js +72 -49
- package/dist/ValidationStation.js.map +1 -1
- package/dist/ValidationStation.stories.d.ts.map +1 -1
- package/dist/ValidationStation.stories.js +30 -19
- package/dist/ValidationStation.stories.js.map +1 -1
- package/dist/bucketArtifactsUtil.d.ts +13 -3
- package/dist/bucketArtifactsUtil.d.ts.map +1 -1
- package/dist/bucketArtifactsUtil.js +42 -32
- package/dist/bucketArtifactsUtil.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/loadValidationStationWc.d.ts +59 -7
- package/dist/loadValidationStationWc.d.ts.map +1 -1
- package/dist/loadValidationStationWc.js +81 -20
- package/dist/loadValidationStationWc.js.map +1 -1
- package/dist/saveHandlers.d.ts +19 -0
- package/dist/saveHandlers.d.ts.map +1 -0
- package/dist/saveHandlers.js +41 -0
- package/dist/saveHandlers.js.map +1 -0
- package/dist/saveValidatedDataUtil.d.ts +2 -2
- package/dist/saveValidatedDataUtil.d.ts.map +1 -1
- package/dist/saveValidatedDataUtil.js +32 -22
- package/dist/saveValidatedDataUtil.js.map +1 -1
- package/dist/subcomponents/CompactFieldsForm.d.ts +4 -4
- package/dist/subcomponents/CompactFieldsForm.d.ts.map +1 -1
- package/dist/subcomponents/CompactFieldsForm.js +8 -27
- package/dist/subcomponents/CompactFieldsForm.js.map +1 -1
- package/dist/subcomponents/shared.d.ts +3 -3
- package/dist/subcomponents/shared.d.ts.map +1 -1
- package/dist/subcomponents/shared.js.map +1 -1
- package/dist/subcomponents/types.d.ts +8 -54
- package/dist/subcomponents/types.d.ts.map +1 -1
- package/dist/subcomponents/useWcElement.d.ts +5 -6
- package/dist/subcomponents/useWcElement.d.ts.map +1 -1
- package/dist/subcomponents/useWcElement.js +2 -4
- package/dist/subcomponents/useWcElement.js.map +1 -1
- package/dist/types.d.ts +150 -31
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -1
- package/dist/urlUtil.d.ts +9 -0
- package/dist/urlUtil.d.ts.map +1 -0
- package/dist/urlUtil.js +11 -0
- package/dist/urlUtil.js.map +1 -0
- package/dist/useDuDocumentArtifacts.d.ts +12 -0
- package/dist/useDuDocumentArtifacts.d.ts.map +1 -0
- package/dist/useDuDocumentArtifacts.js +11 -0
- package/dist/useDuDocumentArtifacts.js.map +1 -0
- package/dist/useResolvedArtifacts.d.ts +41 -0
- package/dist/useResolvedArtifacts.d.ts.map +1 -0
- package/dist/{useSubcomponentArtifacts.js → useResolvedArtifacts.js} +24 -26
- package/dist/useResolvedArtifacts.js.map +1 -0
- package/dist/useWcReady.d.ts +7 -3
- package/dist/useWcReady.d.ts.map +1 -1
- package/dist/useWcReady.js +11 -3
- package/dist/useWcReady.js.map +1 -1
- package/dist/utils/telemetryUtils.d.ts +3 -0
- package/dist/utils/telemetryUtils.d.ts.map +1 -0
- package/dist/utils/telemetryUtils.js +10 -0
- package/dist/utils/telemetryUtils.js.map +1 -0
- package/package.json +2 -2
- package/dist/useBucketArtifacts.d.ts +0 -16
- package/dist/useBucketArtifacts.d.ts.map +0 -1
- package/dist/useBucketArtifacts.js +0 -19
- package/dist/useBucketArtifacts.js.map +0 -1
- package/dist/useSubcomponentArtifacts.d.ts +0 -44
- package/dist/useSubcomponentArtifacts.d.ts.map +0 -1
- package/dist/useSubcomponentArtifacts.js.map +0 -1
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import { type ValidationStationProps } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The all-in-one Document Understanding Validation Station: document viewer,
|
|
4
|
+
* fields form, table editor, business rules and save actions in one element.
|
|
5
|
+
*
|
|
6
|
+
* Takes its document either pre-fetched (`artifacts`) or self-fetched from the
|
|
7
|
+
* bucket paths on `data` (`sdk` + `data`) — see {@link DuArtifactsSource}.
|
|
8
|
+
*
|
|
9
|
+
* Reports every event in the element's public
|
|
10
|
+
* `IValidationStationStandaloneWcEventMap`: the save flows through
|
|
11
|
+
* {@link DuSaveCallbacks}, and the edit, validity, command-outcome and panel
|
|
12
|
+
* events through {@link ValidationStationEventProps}.
|
|
13
|
+
*/
|
|
2
14
|
export declare const ValidationStation: React.FC<ValidationStationProps>;
|
|
3
15
|
//# sourceMappingURL=ValidationStation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationStation.d.ts","sourceRoot":"","sources":["../src/ValidationStation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ValidationStation.d.ts","sourceRoot":"","sources":["../src/ValidationStation.tsx"],"names":[],"mappings":"AAWA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,YAAY,CAAC;AAIpB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmG9D,CAAC"}
|
|
@@ -1,53 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { submitValidatedData, saveValidatedDataAsDraft, } from "./saveValidatedDataUtil.js";
|
|
1
|
+
import { useWcRef } from "./bindWcEvents.js";
|
|
2
|
+
import { convertToPersistentTag, VALIDATION_STATION_TAG, } from "./loadValidationStationWc.js";
|
|
3
|
+
import { createSaveHandlers } from "./saveHandlers.js";
|
|
4
|
+
import { renderWcElement, resolveArtifacts } from "./subcomponents/shared.js";
|
|
6
5
|
import { ValidationStationLanguage, } from "./types.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
6
|
+
import { useResolvedArtifacts } from "./useResolvedArtifacts.js";
|
|
7
|
+
import { useWcReady } from "./useWcReady.js";
|
|
8
|
+
/**
|
|
9
|
+
* The all-in-one Document Understanding Validation Station: document viewer,
|
|
10
|
+
* fields form, table editor, business rules and save actions in one element.
|
|
11
|
+
*
|
|
12
|
+
* Takes its document either pre-fetched (`artifacts`) or self-fetched from the
|
|
13
|
+
* bucket paths on `data` (`sdk` + `data`) — see {@link DuArtifactsSource}.
|
|
14
|
+
*
|
|
15
|
+
* Reports every event in the element's public
|
|
16
|
+
* `IValidationStationStandaloneWcEventMap`: the save flows through
|
|
17
|
+
* {@link DuSaveCallbacks}, and the edit, validity, command-outcome and panel
|
|
18
|
+
* events through {@link ValidationStationEventProps}.
|
|
19
|
+
*/
|
|
20
|
+
export const ValidationStation = ({ sdk, data, artifacts: providedArtifacts, documentId: documentIdProp, theme = "light", language = ValidationStationLanguage.English, isReadonly = false, persistent = false, options, save, discardChanges, setFieldValueByPath, selectAndFocusFieldValueByPath, deleteFieldValueByPath, onSubmit, onSaveAsDraft, onReportException, onLoaded, onDirtyChange, onIsValidChange, onDocumentTypeChanged, onExtractionResultChanged, onFieldValueSelected, onFieldValueChanged, onBusinessRulesEvaluated, onSaveResult, onSetFieldValueByPathResult, onSelectAndFocusFieldValueByPathResult, onDeleteFieldValueByPathResult, onFieldsPanelWidthChanged, onFieldsPanelSideChanged, }) => {
|
|
21
|
+
const { artifacts, error, documentId } = useResolvedArtifacts({
|
|
22
|
+
sdk,
|
|
23
|
+
data,
|
|
24
|
+
artifacts: providedArtifacts,
|
|
25
|
+
documentId: documentIdProp,
|
|
26
|
+
});
|
|
27
|
+
const tag = persistent
|
|
28
|
+
? convertToPersistentTag(VALIDATION_STATION_TAG)
|
|
29
|
+
: VALIDATION_STATION_TAG;
|
|
30
|
+
// Gate on the tag actually rendered, not always the base one.
|
|
31
|
+
const wcReady = useWcReady(tag);
|
|
32
|
+
const { handleSubmit, handleSaveAsDraft, handleException } = createSaveHandlers({ sdk, data }, { onSubmit, onSaveAsDraft, onReportException });
|
|
33
|
+
const ref = useWcRef({
|
|
34
|
+
loaded: onLoaded,
|
|
35
|
+
dirty: onDirtyChange,
|
|
36
|
+
isValid: onIsValidChange,
|
|
37
|
+
documentTypeChanged: onDocumentTypeChanged,
|
|
38
|
+
extractionResultChanged: onExtractionResultChanged,
|
|
39
|
+
fieldValueSelected: onFieldValueSelected,
|
|
40
|
+
fieldValueChanged: onFieldValueChanged,
|
|
41
|
+
businessRulesEvaluated: onBusinessRulesEvaluated,
|
|
42
|
+
saveResult: onSaveResult,
|
|
43
|
+
setFieldValueByPathResult: onSetFieldValueByPathResult,
|
|
44
|
+
selectAndFocusFieldValueByPathResult: onSelectAndFocusFieldValueByPathResult,
|
|
45
|
+
deleteFieldValueByPathResult: onDeleteFieldValueByPathResult,
|
|
46
|
+
fieldsPanelWidthChanged: onFieldsPanelWidthChanged,
|
|
47
|
+
fieldsPanelSideChanged: onFieldsPanelSideChanged,
|
|
48
|
+
saveValidatedDataRequest: handleSubmit,
|
|
49
|
+
saveValidatedDataAsDraftRequest: handleSaveAsDraft,
|
|
50
|
+
saveExceptionReportRequest: handleException,
|
|
51
|
+
}, persistent);
|
|
52
|
+
const gate = resolveArtifacts(error, wcReady, artifacts);
|
|
53
|
+
if (!gate.ready)
|
|
54
|
+
return gate.fallback;
|
|
55
|
+
const props = {
|
|
56
|
+
theme,
|
|
57
|
+
language,
|
|
58
|
+
isReadonly,
|
|
59
|
+
enableSaveAsDraft: true,
|
|
60
|
+
documentId,
|
|
61
|
+
taxonomy: gate.artifacts.taxonomy,
|
|
62
|
+
extractionResult: gate.artifacts.extractionResult,
|
|
63
|
+
dom: gate.artifacts.dom,
|
|
64
|
+
text: gate.artifacts.text,
|
|
65
|
+
customizationInfo: gate.artifacts.customizationInfo,
|
|
66
|
+
original: gate.artifacts.original,
|
|
67
|
+
options,
|
|
68
|
+
save,
|
|
69
|
+
discardChanges,
|
|
70
|
+
setFieldValueByPath,
|
|
71
|
+
selectAndFocusFieldValueByPath,
|
|
72
|
+
deleteFieldValueByPath,
|
|
50
73
|
};
|
|
51
|
-
return (
|
|
74
|
+
return renderWcElement(tag, props, ref);
|
|
52
75
|
};
|
|
53
76
|
//# sourceMappingURL=ValidationStation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationStation.js","sourceRoot":"","sources":["../src/ValidationStation.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ValidationStation.js","sourceRoot":"","sources":["../src/ValidationStation.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,yBAAyB,GAE1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,CAAC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EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"ValidationStation.stories.d.ts","sourceRoot":"","sources":["../src/ValidationStation.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAO5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAatD,UAAU,0BAA2B,SAAQ,IAAI,CAC/C,sBAAsB,EACtB,KAAK,CACN;IACC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,QAAA,MAAM,wBAAwB,GAAI,oDAM/B,0BAA0B,4CAoE5B,CAAC;AAkBF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,wBAAwB,CAsJ/C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC"}
|
|
@@ -2,7 +2,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { UiPath } from "@uipath/uipath-typescript/core";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { ValidationStation } from "./ValidationStation";
|
|
5
|
+
import { configureValidationStationWc } from "./loadValidationStationWc";
|
|
5
6
|
import { ValidationStationLanguage } from "./types";
|
|
7
|
+
// Served from `public/du-vs-wc` — staged by the `prestorybook` script and
|
|
8
|
+
// exposed via `staticDirs` in `.storybook/main.ts`. `includeFonts` because
|
|
9
|
+
// Storybook does not load Apollo fonts or Material Icons globally, without which
|
|
10
|
+
// icon glyphs render as empty boxes.
|
|
11
|
+
configureValidationStationWc({
|
|
12
|
+
deploymentUrl: "/du-vs-wc",
|
|
13
|
+
includeFonts: true,
|
|
14
|
+
}).catch((error) => {
|
|
15
|
+
console.error("Failed to load the Validation Station web component:", error);
|
|
16
|
+
});
|
|
6
17
|
const ValidationStationWithSdk = ({ baseUrl, orgName, tenantName, secret, ...props }) => {
|
|
7
18
|
const [state, setState] = useState({ sdk: null, error: null });
|
|
8
19
|
useEffect(() => {
|
|
@@ -55,7 +66,8 @@ const ValidationStationWithSdk = ({ baseUrl, orgName, tenantName, secret, ...pro
|
|
|
55
66
|
const mockData = {
|
|
56
67
|
BucketName: "",
|
|
57
68
|
BucketId: 0,
|
|
58
|
-
|
|
69
|
+
// The folder the bucket lives in — fill in one of the two.
|
|
70
|
+
FolderId: undefined,
|
|
59
71
|
FolderKey: "",
|
|
60
72
|
DocumentId: "",
|
|
61
73
|
EncodedDocumentPath: "",
|
|
@@ -97,18 +109,23 @@ npm install @uipath/ui-widgets-validation-station
|
|
|
97
109
|
|
|
98
110
|
> **Note:** Add either \`light\` or \`dark\` class to your HTML \`<body>\` element to enable proper theming.
|
|
99
111
|
|
|
100
|
-
The
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
dev server). For production, copy the contents of
|
|
105
|
-
\`node_modules/@uipath/du-validation-station-wc\` into your public assets and
|
|
106
|
-
point \`wcAssetsUrl\` at that location.
|
|
112
|
+
The underlying Validation Station web component is loaded at runtime from a URL
|
|
113
|
+
you host — serve the contents of \`node_modules/@uipath/du-validation-station-wc\`
|
|
114
|
+
as static files, then call \`configureValidationStationWc\` once at app startup.
|
|
115
|
+
There is no bundler configuration to write.
|
|
107
116
|
|
|
108
117
|
\`\`\`tsx
|
|
109
|
-
import {
|
|
118
|
+
import {
|
|
119
|
+
configureValidationStationWc,
|
|
120
|
+
ValidationStation,
|
|
121
|
+
} from '@uipath/ui-widgets-validation-station';
|
|
110
122
|
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
111
123
|
|
|
124
|
+
configureValidationStationWc({
|
|
125
|
+
deploymentUrl: '/du-vs-wc',
|
|
126
|
+
includeFonts: true,
|
|
127
|
+
});
|
|
128
|
+
|
|
112
129
|
const sdk = new UiPath({
|
|
113
130
|
baseUrl: 'https://cloud.uipath.com',
|
|
114
131
|
orgName: 'your-org',
|
|
@@ -123,11 +140,9 @@ function App() {
|
|
|
123
140
|
<ValidationStation
|
|
124
141
|
sdk={sdk}
|
|
125
142
|
data={myContentValidationData}
|
|
126
|
-
folderId={12345}
|
|
127
143
|
theme="light"
|
|
128
144
|
language="en"
|
|
129
145
|
save={{ validate: true }}
|
|
130
|
-
// wcAssetsUrl="/assets/du-validation-station-wc"
|
|
131
146
|
/>
|
|
132
147
|
);
|
|
133
148
|
}
|
|
@@ -137,8 +152,9 @@ function App() {
|
|
|
137
152
|
|
|
138
153
|
- React 19.2.0+
|
|
139
154
|
- React DOM 19.2.0+
|
|
140
|
-
- @uipath/
|
|
141
|
-
-
|
|
155
|
+
- @uipath/uipath-typescript
|
|
156
|
+
- The web component's files (from \`@uipath/du-validation-station-wc\`) served at
|
|
157
|
+
the \`deploymentUrl\` you configure`,
|
|
142
158
|
},
|
|
143
159
|
},
|
|
144
160
|
},
|
|
@@ -165,13 +181,9 @@ function App() {
|
|
|
165
181
|
table: { category: "SDK Configuration" },
|
|
166
182
|
},
|
|
167
183
|
data: {
|
|
168
|
-
description: "ContentValidationData object containing bucket paths, document ID, and folder
|
|
184
|
+
description: "ContentValidationData object containing bucket paths, document ID, and the folder they live in (FolderId or FolderKey).",
|
|
169
185
|
control: "object",
|
|
170
186
|
},
|
|
171
|
-
folderId: {
|
|
172
|
-
description: "Storage bucket folder ID. Falls back to data.folderId if not provided.",
|
|
173
|
-
control: "number",
|
|
174
|
-
},
|
|
175
187
|
theme: {
|
|
176
188
|
description: "Visual theme for the validation station",
|
|
177
189
|
control: "select",
|
|
@@ -206,7 +218,6 @@ function App() {
|
|
|
206
218
|
tenantName: "",
|
|
207
219
|
secret: "",
|
|
208
220
|
data: mockData,
|
|
209
|
-
folderId: 0,
|
|
210
221
|
theme: "light",
|
|
211
222
|
language: ValidationStationLanguage.English,
|
|
212
223
|
isReadonly: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationStation.stories.js","sourceRoot":"","sources":["../src/ValidationStation.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ValidationStation.stories.js","sourceRoot":"","sources":["../src/ValidationStation.stories.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAGpD,0EAA0E;AAC1E,2EAA2E;AAC3E,iFAAiF;AACjF,qCAAqC;AACrC,4BAA4B,CAAC;IAC3B,aAAa,EAAE,WAAW;IAC1B,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC1B,OAAO,CAAC,KAAK,CAAC,sDAAsD,EAAE,KAAK,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC;AAYH,MAAM,wBAAwB,GAAG,CAAC,EAChC,OAAO,EACP,OAAO,EACP,UAAU,EACV,MAAM,EACN,GAAG,KAAK,EACmB,EAAE,EAAE;IAC/B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAG/B,EAAE,GAAG,EAAE,IAAI,E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E,uCAAuC;YACpD,OAAO,EAAE,QAAQ;SAClB;QACD,cAAc,EAAE;YACd,WAAW,EAAE,yBAAyB;YACtC,OAAO,EAAE,QAAQ;SAClB;KACF;IACD,IAAI,EAAE;QACJ,OAAO,EAAE,kBAAkB;QAC3B,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,EAAE;QACd,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,yBAAyB,CAAC,OAAO;QAC3C,UAAU,EAAE,KAAK;KAClB;CACF,CAAC;AAEF,eAAe,IAAI,CAAC;AAGpB,MAAM,CAAC,MAAM,OAAO,GAAU;IAC5B,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,WAAW,EAAE;gBACX,KAAK,EACH,gIAAgI;aACnI;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { DuFramework } from "@uipath/uipath-typescript/document-understanding";
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
|
|
2
|
+
import { BucketService } from "@uipath/uipath-typescript/buckets";
|
|
3
|
+
import type { UiPath } from "@uipath/uipath-typescript/core";
|
|
4
|
+
import type { DuDocumentArtifacts } from "./types.js";
|
|
5
|
+
/**
|
|
6
|
+
* Fetches a document's artifacts from the storage bucket paths on
|
|
7
|
+
* `ContentValidationData`, ready to pass as the `artifacts` prop. The
|
|
8
|
+
* imperative counterpart of `useDuDocumentArtifacts`.
|
|
9
|
+
*
|
|
10
|
+
* @throws if `data` is missing any of the bucket fields the artifacts are read
|
|
11
|
+
* from — the bucket, the paths, or the folder they live in.
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchDuDocumentArtifacts(sdk: UiPath, data: DuFramework.ContentValidationData): Promise<DuDocumentArtifacts>;
|
|
14
|
+
export declare function fetchBucketArtifacts(bucketService: BucketService, data: DuFramework.ContentValidationData): Promise<DuDocumentArtifacts>;
|
|
5
15
|
//# sourceMappingURL=bucketArtifactsUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketArtifactsUtil.d.ts","sourceRoot":"","sources":["../src/bucketArtifactsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,
|
|
1
|
+
{"version":3,"file":"bucketArtifactsUtil.d.ts","sourceRoot":"","sources":["../src/bucketArtifactsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAgBtD;;;;;;;GAOG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,WAAW,CAAC,qBAAqB,GACtC,OAAO,CAAC,mBAAmB,CAAC,CAE9B;AAED,wBAAsB,oBAAoB,CACxC,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,WAAW,CAAC,qBAAqB,GACtC,OAAO,CAAC,mBAAmB,CAAC,CAuE9B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BucketService } from "@uipath/uipath-typescript/buckets";
|
|
1
2
|
import { unzipSync } from "fflate";
|
|
2
3
|
/** Fetch a URI, unzip the first file in the archive, and return the raw text. */
|
|
3
4
|
async function fetchAndUnzip(uri) {
|
|
@@ -11,49 +12,58 @@ async function fetchAndUnzipJson(uri) {
|
|
|
11
12
|
const text = await fetchAndUnzip(uri);
|
|
12
13
|
return JSON.parse(text);
|
|
13
14
|
}
|
|
14
|
-
/** Get URI then immediately fetch + unzip as JSON. */
|
|
15
|
-
async function fetchArtifactJson(bucketService, bucketId, folderId, path) {
|
|
16
|
-
const r = await bucketService.getReadUri({ bucketId, folderId, path });
|
|
17
|
-
return fetchAndUnzipJson(r.uri);
|
|
18
|
-
}
|
|
19
15
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
16
|
+
* Fetches a document's artifacts from the storage bucket paths on
|
|
17
|
+
* `ContentValidationData`, ready to pass as the `artifacts` prop. The
|
|
18
|
+
* imperative counterpart of `useDuDocumentArtifacts`.
|
|
19
|
+
*
|
|
20
|
+
* @throws if `data` is missing any of the bucket fields the artifacts are read
|
|
21
|
+
* from — the bucket, the paths, or the folder they live in.
|
|
22
22
|
*/
|
|
23
|
-
async function
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
return await fetchArtifactJson(bucketService, bucketId, folderId, validatedPath);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
// Validated result not saved yet — fall through to automatic.
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return fetchArtifactJson(bucketService, bucketId, folderId, automaticPath);
|
|
23
|
+
export async function fetchDuDocumentArtifacts(sdk, data) {
|
|
24
|
+
return fetchBucketArtifacts(new BucketService(sdk), data);
|
|
33
25
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
export async function fetchBucketArtifacts(bucketService, data) {
|
|
27
|
+
const { BucketId, FolderId, FolderKey, TextPath, TaxonomyPath, EncodedDocumentPath, CustomizationInfoPath, DocumentObjectModelPath, AutomaticExtractionResultsPath, ValidatedExtractionResultsPath, } = data;
|
|
28
|
+
// The folder every bucket call is scoped to. FolderKey wins when both are
|
|
29
|
+
// set, matching the server's own precedence.
|
|
30
|
+
const scope = FolderKey
|
|
31
|
+
? { folderKey: FolderKey }
|
|
32
|
+
: FolderId
|
|
33
|
+
? { folderId: FolderId }
|
|
34
|
+
: undefined;
|
|
41
35
|
if (!BucketId ||
|
|
36
|
+
!scope ||
|
|
42
37
|
!TextPath ||
|
|
43
38
|
!TaxonomyPath ||
|
|
44
39
|
!EncodedDocumentPath ||
|
|
45
|
-
!CustomizationInfoPath ||
|
|
46
40
|
!DocumentObjectModelPath ||
|
|
47
41
|
!AutomaticExtractionResultsPath) {
|
|
48
|
-
throw new Error("ContentValidationData is missing required bucket artifact
|
|
42
|
+
throw new Error("ContentValidationData is missing required bucket fields (BucketId, artifact paths, or FolderId / FolderKey).");
|
|
49
43
|
}
|
|
44
|
+
const readUri = async (path) => (await bucketService.getReadUri({ bucketId: BucketId, path, ...scope }))
|
|
45
|
+
.uri;
|
|
46
|
+
const readJson = async (path) => fetchAndUnzipJson(await readUri(path));
|
|
47
|
+
const readText = async (path) => fetchAndUnzip(await readUri(path));
|
|
48
|
+
/** The validated result once the reviewer has saved one, else the automatic one. */
|
|
49
|
+
const readExtractionResult = async () => {
|
|
50
|
+
if (ValidatedExtractionResultsPath) {
|
|
51
|
+
try {
|
|
52
|
+
return await readJson(ValidatedExtractionResultsPath);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// Validated result not saved yet — fall through to automatic.
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return readJson(AutomaticExtractionResultsPath);
|
|
59
|
+
};
|
|
50
60
|
const [taxonomy, extractionResult, dom, text, customizationInfo, original] = await Promise.all([
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
readJson(TaxonomyPath),
|
|
62
|
+
readExtractionResult(),
|
|
63
|
+
readJson(DocumentObjectModelPath),
|
|
64
|
+
readText(TextPath),
|
|
65
|
+
CustomizationInfoPath ? readJson(CustomizationInfoPath) : {},
|
|
66
|
+
readText(EncodedDocumentPath),
|
|
57
67
|
]);
|
|
58
68
|
return {
|
|
59
69
|
taxonomy: taxonomy,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bucketArtifactsUtil.js","sourceRoot":"","sources":["../src/bucketArtifactsUtil.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":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,CAAC;QACtB,oBAAoB,EAAE;QACtB,QAAQ,CAAC,uBAAuB,CAAC;QACjC,QAAQ,CAAC,QAAQ,CAAC;QAClB,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,EAAE;QAC5D,QAAQ,CAAC,mBAAmB,CAAC;KAC9B,CAAC,CAAC;IAEL,OAAO;QACL,QAAQ,EAAE,QAAwC;QAClD,gBAAgB,EAAE,gBAAgD;QAClE,GAAG,EAAE,GAAiC;QACtC,IAAI;QACJ,iBAAiB;QACjB,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
export { ValidationStationLanguage } from "./types.js";
|
|
2
|
-
export type {
|
|
2
|
+
export type { DuArtifactsSource } from "./useResolvedArtifacts.js";
|
|
3
|
+
export type { DeleteFieldValueByPath, DeleteFieldValueByPathResult, DuCommonProps, DuDocumentArtifacts, DuSaveCallbacks, DuTheme, EvaluatedBusinessRulesForFieldValueDto, IFieldValueDetailsDto, ISaveResult, IValidationStationOptions, IVsSaveExceptionReportRequest, IVsSaveValidatedDataAsDraftRequest, IVsSaveValidatedDataRequest, SaveValidatedDataResult, SelectAndFocusFieldValueByPath, SelectAndFocusFieldValueByPathResult, SetFieldValueByPath, SetFieldValueByPathResult, ValidationStationEventProps, ValidationStationProps, VsSaveResultEventProps, VsStateEventProps, } from "./types.js";
|
|
3
4
|
export { ValidationStation } from "./ValidationStation.js";
|
|
4
|
-
export {
|
|
5
|
+
export { useDuDocumentArtifacts } from "./useDuDocumentArtifacts.js";
|
|
6
|
+
export { fetchDuDocumentArtifacts } from "./bucketArtifactsUtil.js";
|
|
7
|
+
export { saveValidatedDataAsDraft, submitValidatedData, } from "./saveValidatedDataUtil.js";
|
|
8
|
+
export { configureValidationStationWc, DU_WC_TAGS, VALIDATION_STATION_TAG, } from "./loadValidationStationWc.js";
|
|
9
|
+
export type { ValidationStationWcConfig } from "./loadValidationStationWc.js";
|
|
10
|
+
export { joinDeploymentUrl } from "./urlUtil.js";
|
|
5
11
|
export { CompactBusinessRules } from "./subcomponents/CompactBusinessRules.js";
|
|
6
12
|
export { CompactDocTypeField } from "./subcomponents/CompactDocTypeField.js";
|
|
7
13
|
export { CompactFieldsForm } from "./subcomponents/CompactFieldsForm.js";
|
|
8
14
|
export { CompactTableEditor } from "./subcomponents/CompactTableEditor.js";
|
|
9
15
|
export { DocumentViewer } from "./subcomponents/DocumentViewer.js";
|
|
10
|
-
export type {
|
|
11
|
-
export type { CompactBusinessRulesProps, CompactDocTypeFieldProps, CompactFieldsFormProps, CompactTableEditorProps, DocumentViewerProps, SubcomponentCommandProps, SubcomponentCommonProps, SubcomponentStateEventProps, } from "./subcomponents/types.js";
|
|
16
|
+
export type { CompactBusinessRulesProps, CompactDocTypeFieldProps, CompactFieldsFormProps, CompactTableEditorProps, DocumentViewerProps, SubcomponentCommandProps, SubcomponentCommonProps, } from "./subcomponents/types.js";
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EACV,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,OAAO,EACP,sCAAsC,EACtC,qBAAqB,EACrB,WAAW,EACX,yBAAyB,EACzB,6BAA6B,EAC7B,kCAAkC,EAClC,2BAA2B,EAC3B,uBAAuB,EACvB,8BAA8B,EAC9B,oCAAoC,EACpC,mBAAmB,EACnB,yBAAyB,EACzB,2BAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,4BAA4B,EAC5B,UAAU,EACV,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export { ValidationStationLanguage } from "./types.js";
|
|
2
2
|
export { ValidationStation } from "./ValidationStation.js";
|
|
3
|
-
export {
|
|
3
|
+
export { useDuDocumentArtifacts } from "./useDuDocumentArtifacts.js";
|
|
4
|
+
// ─── Host-driven fetch & persistence ──────────────────────────────────────────
|
|
5
|
+
export { fetchDuDocumentArtifacts } from "./bucketArtifactsUtil.js";
|
|
6
|
+
export { saveValidatedDataAsDraft, submitValidatedData, } from "./saveValidatedDataUtil.js";
|
|
7
|
+
// ─── Web component loading ────────────────────────────────────────────────────
|
|
8
|
+
export { configureValidationStationWc, DU_WC_TAGS, VALIDATION_STATION_TAG, } from "./loadValidationStationWc.js";
|
|
9
|
+
export { joinDeploymentUrl } from "./urlUtil.js";
|
|
4
10
|
// ─── Subcomponents ────────────────────────────────────────────────────────────
|
|
5
11
|
export { CompactBusinessRules } from "./subcomponents/CompactBusinessRules.js";
|
|
6
12
|
export { CompactDocTypeField } from "./subcomponents/CompactDocTypeField.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AA0BvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,iFAAiF;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,iFAAiF;AACjF,OAAO,EACL,4BAA4B,EAC5B,UAAU,EACV,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,iFAAiF;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1,12 +1,58 @@
|
|
|
1
|
-
import "@uipath/du-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type LoadWebComponentOptions, type ResolveBaseUrl } from "@uipath/du-utils";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for {@link configureValidationStationWc} — the deployment URL
|
|
4
|
+
* plus every option the underlying loader accepts (currently `includeFonts`:
|
|
5
|
+
* inject the web component's `fonts.css` as a light-DOM stylesheet, needed
|
|
6
|
+
* unless the host already loads Apollo fonts and Material Icons globally).
|
|
7
|
+
*/
|
|
8
|
+
export interface ValidationStationWcConfig extends LoadWebComponentOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Base URL the web component's build artifacts (`polyfills.js`, `main.js`,
|
|
11
|
+
* `styles.css`, `fonts.css`) are served from — e.g. `/du-vs-wc` when the
|
|
12
|
+
* contents of `@uipath/du-validation-station-wc` are hosted from the app's
|
|
13
|
+
* own static assets. Accepts a resolver (`() => string | Promise<string>`)
|
|
14
|
+
* for cases where the URL isn't known synchronously — it's called lazily,
|
|
15
|
+
* at most once per load.
|
|
16
|
+
*
|
|
17
|
+
* Defaults to `du-vs-wc` joined onto {@link getAppBase}, which resolves to
|
|
18
|
+
* `/du-vs-wc` for a plain host and to the deployed app's own base path for a
|
|
19
|
+
* UiPath Coded App — no decision needed for either case. Pass an explicit
|
|
20
|
+
* `deploymentUrl` only when the web component is actually hosted somewhere
|
|
21
|
+
* that default doesn't reach (a different origin, a renamed path).
|
|
22
|
+
*
|
|
23
|
+
* Treat this as trusted application configuration: the loader injects
|
|
24
|
+
* `<script type="module" src>` from it, so whoever controls this URL executes
|
|
25
|
+
* script in your app's origin. Pass a literal, a build-time value, or a
|
|
26
|
+
* resolver derived from one of those — never one derived from `location`, a
|
|
27
|
+
* query parameter, or any other user input.
|
|
28
|
+
*/
|
|
29
|
+
deploymentUrl?: string | ResolveBaseUrl;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Loads the Validation Station web component from `deploymentUrl` (or its
|
|
33
|
+
* default — see {@link ValidationStationWcConfig.deploymentUrl}) and registers
|
|
34
|
+
* every custom element in {@link DU_WC_TAGS}. Call this once at app startup,
|
|
35
|
+
* before rendering any component from this package. Every argument is
|
|
36
|
+
* optional, so `configureValidationStationWc()` is a valid call on a plain
|
|
37
|
+
* host or a UiPath Coded App alike.
|
|
38
|
+
*
|
|
39
|
+
* Loading is per-page and idempotent: while a load is pending or has succeeded,
|
|
40
|
+
* repeat calls return that same promise without re-injecting scripts, so a later
|
|
41
|
+
* call with a different `deploymentUrl` has no effect. Calling it again *after* a
|
|
42
|
+
* failure starts a fresh attempt.
|
|
43
|
+
*
|
|
44
|
+
* The returned promise is the error channel for load failures (a bad URL, a 404,
|
|
45
|
+
* an offline network). The rejection is retained, so components waiting via
|
|
46
|
+
* {@link waitForWcElementReady} observe the same error rather than waiting
|
|
47
|
+
* forever.
|
|
48
|
+
*/
|
|
49
|
+
export declare function configureValidationStationWc(config?: ValidationStationWcConfig): Promise<void>;
|
|
5
50
|
export declare const VALIDATION_STATION_TAG = "ui-du-validation-station-standalone-wc-element";
|
|
6
51
|
/**
|
|
7
52
|
* Custom-element tag names for every standalone DU web component registered by
|
|
8
|
-
*
|
|
9
|
-
* {@link convertToPersistentTag}) that survives portal detachment via
|
|
53
|
+
* {@link configureValidationStationWc}. Each has a `-persistent-element` sibling
|
|
54
|
+
* (see {@link convertToPersistentTag}) that survives portal detachment via
|
|
55
|
+
* `forceDestroy()`.
|
|
10
56
|
*/
|
|
11
57
|
export declare const DU_WC_TAGS: {
|
|
12
58
|
readonly validationStation: "ui-du-validation-station-standalone-wc-element";
|
|
@@ -18,6 +64,12 @@ export declare const DU_WC_TAGS: {
|
|
|
18
64
|
};
|
|
19
65
|
/** Maps a base element tag to its persistent (`forceDestroy()`-capable) variant. */
|
|
20
66
|
export declare function convertToPersistentTag(tag: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Resolves once `tag` has been registered in the browser's custom-element
|
|
69
|
+
* registry — i.e. after {@link configureValidationStationWc}'s scripts have run.
|
|
70
|
+
*
|
|
71
|
+
* The loader resolves on the bundle's `load` event, which is before Angular
|
|
72
|
+
* Elements has defined the elements, so both waits are needed.
|
|
73
|
+
*/
|
|
21
74
|
export declare function waitForWcElementReady(tag: string): Promise<void>;
|
|
22
|
-
export declare const validationStationWcReady: Promise<void>;
|
|
23
75
|
//# sourceMappingURL=loadValidationStationWc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadValidationStationWc.d.ts","sourceRoot":"","sources":["../src/loadValidationStationWc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadValidationStationWc.d.ts","sourceRoot":"","sources":["../src/loadValidationStationWc.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAI1B;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE;;;;;;;;;;;;;;;;;;;OAmBG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC;CACzC;AAqBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,GAAE,yBAA8B,GACrC,OAAO,CAAC,IAAI,CAAC,CAoBf;AAED,eAAO,MAAM,sBAAsB,mDACe,CAAC;AAEnD;;;;;GAKG;AACH,eAAO,MAAM,UAAU;;;;;;;CAOb,CAAC;AAEX,oFAAoF;AACpF,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BtE"}
|