libmodulor 0.16.0 → 0.18.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/dist/esm/app/workers/AppSrcFilePathBuilder.js +1 -1
- package/dist/esm/apps/Helper/src/lib/project.js +6 -6
- package/dist/esm/apps/Helper/src/ucds/CreateProjectUCD.js +1 -1
- package/dist/esm/dt/DataType.d.ts +9 -9
- package/dist/esm/dt/base/TBase.d.ts +1 -1
- package/dist/esm/dt/base/TBoolean.d.ts +1 -1
- package/dist/esm/dt/base/TInt.d.ts +1 -1
- package/dist/esm/dt/base/TNumber.d.ts +1 -1
- package/dist/esm/dt/final/TDateISO8601.d.ts +1 -1
- package/dist/esm/dt/final/TEmail.js +1 -1
- package/dist/esm/dt/final/TFile.d.ts +1 -1
- package/dist/esm/dt/final/TGeolocation.d.ts +1 -1
- package/dist/esm/dt/final/TJSONString.d.ts +1 -1
- package/dist/esm/dt/final/TJSONString.js +1 -1
- package/dist/esm/dt/final/TJWT.d.ts +1 -1
- package/dist/esm/dt/final/TJWT.js +1 -1
- package/dist/esm/dt/final/TURL.d.ts +1 -1
- package/dist/esm/dt/final/TURL.js +1 -1
- package/dist/esm/dt/index.d.ts +16 -16
- package/dist/esm/dt/index.js +8 -8
- package/dist/esm/i18n/locales/en.js +2 -2
- package/dist/esm/i18n/locales/fr.js +3 -3
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.react.d.ts +4 -3
- package/dist/esm/index.react.js +2 -1
- package/dist/esm/index.rn.d.ts +1 -0
- package/dist/esm/index.rn.js +1 -0
- package/dist/esm/index.web.d.ts +1 -1
- package/dist/esm/index.web.js +1 -1
- package/dist/esm/std/HTTPAPICallExecutor.d.ts +2 -5
- package/dist/esm/std/HTTPAPICaller.d.ts +6 -0
- package/dist/esm/std/consts.d.ts +1 -1
- package/dist/esm/std/impl/JoseJWTManager.js +1 -1
- package/dist/esm/std/impl/MistralAILLMManager.js +2 -2
- package/dist/esm/std/impl/NodeCryptoManager.d.ts +1 -1
- package/dist/esm/std/impl/NodeEnvironmentManager.js +1 -1
- package/dist/esm/std/impl/NodeFSManager.js +1 -1
- package/dist/esm/std/impl/OllamaLLMManager.js +1 -1
- package/dist/esm/std/impl/OpenAILLMManager.js +2 -2
- package/dist/esm/std/impl/SimpleHTTPAPICaller.js +2 -2
- package/dist/esm/std/impl/WebCryptoManager.d.ts +1 -1
- package/dist/esm/std/index.d.ts +3 -3
- package/dist/esm/std/index.js +3 -3
- package/dist/esm/target/lib/cli/CommandExecutor.js +2 -2
- package/dist/esm/target/lib/react/DIContextProvider.d.ts +3 -5
- package/dist/esm/target/lib/react/DIContextProvider.js +4 -3
- package/dist/esm/target/lib/react/StyleContextProvider.d.ts +32 -0
- package/dist/esm/target/lib/react/StyleContextProvider.js +17 -0
- package/dist/esm/target/lib/react/UCContainer.js +4 -3
- package/dist/esm/target/lib/react/UCEntrypoint.d.ts +2 -2
- package/dist/esm/target/lib/react/UCEntrypoint.js +3 -3
- package/dist/esm/target/lib/react/UCOutputFieldValueFragment.d.ts +5 -6
- package/dist/esm/target/lib/react/UCOutputFieldValueFragment.js +4 -4
- package/dist/esm/target/lib/react/UCPanel.js +15 -21
- package/dist/esm/target/lib/react/entrypoint.d.ts +1 -1
- package/dist/esm/target/lib/react/form.d.ts +10 -11
- package/dist/esm/target/lib/react/form.js +4 -0
- package/dist/esm/target/lib/react/touchable.d.ts +2 -3
- package/dist/esm/target/lib/react/useAction.d.ts +1 -1
- package/dist/esm/target/lib/react/useAction.js +11 -13
- package/dist/esm/target/lib/rn/input.d.ts +2 -2
- package/dist/esm/target/lib/rn/input.js +3 -3
- package/dist/esm/target/lib/server/RequestChecker.js +1 -1
- package/dist/esm/target/lib/server/ServerRequestHandler.js +3 -3
- package/dist/esm/target/lib/web/input.d.ts +2 -3
- package/dist/esm/target/lib/web/input.js +3 -4
- package/dist/esm/target/node-core-cli/NodeCoreCLIManager.js +1 -1
- package/dist/esm/target/node-core-cli/commands.js +1 -1
- package/dist/esm/target/node-express-server/NodeExpressServerManager.js +1 -1
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.js +1 -1
- package/dist/esm/target/node-mcp-server/NodeLocalStdioMCPServerManager.js +2 -2
- package/dist/esm/target/node-mcp-server/funcs.js +1 -1
- package/dist/esm/target/react-native-pure/UCAutoExecLoader.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCAutoExecLoader.js +4 -2
- package/dist/esm/target/react-native-pure/UCEntrypointTouchable.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCEntrypointTouchable.js +4 -3
- package/dist/esm/target/react-native-pure/UCExecTouchable.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCExecTouchable.js +4 -3
- package/dist/esm/target/react-native-pure/UCForm.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCForm.js +4 -5
- package/dist/esm/target/react-native-pure/UCFormField.js +6 -6
- package/dist/esm/target/react-native-pure/UCFormFieldControl.d.ts +2 -2
- package/dist/esm/target/react-native-pure/UCFormFieldControl.js +63 -6
- package/dist/esm/target/react-native-pure/UCFormFieldDesc.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldDesc.js +4 -2
- package/dist/esm/target/react-native-pure/UCFormFieldErr.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldErr.js +4 -2
- package/dist/esm/target/react-native-pure/UCFormFieldLabel.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormFieldLabel.js +6 -2
- package/dist/esm/target/react-native-pure/UCFormSubmitControl.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCFormSubmitControl.js +4 -3
- package/dist/esm/target/react-native-pure/UCOutputFieldValue.d.ts +1 -1
- package/dist/esm/target/react-native-pure/UCOutputFieldValue.js +4 -3
- package/dist/esm/target/react-web-pure/UCAutoExecLoader.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCAutoExecLoader.js +4 -2
- package/dist/esm/target/react-web-pure/UCEntrypointTouchable.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCEntrypointTouchable.js +5 -3
- package/dist/esm/target/react-web-pure/UCExecTouchable.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCExecTouchable.js +5 -3
- package/dist/esm/target/react-web-pure/UCForm.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCForm.js +6 -5
- package/dist/esm/target/react-web-pure/UCFormField.d.ts +1 -1
- package/dist/esm/target/react-web-pure/UCFormField.js +6 -7
- package/dist/esm/target/react-web-pure/UCFormFieldControl.d.ts +3 -3
- package/dist/esm/target/react-web-pure/UCFormFieldControl.js +27 -8
- package/dist/esm/target/react-web-pure/UCFormFieldDesc.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCFormFieldDesc.js +5 -3
- package/dist/esm/target/react-web-pure/UCFormFieldErr.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCFormFieldErr.js +5 -3
- package/dist/esm/target/react-web-pure/UCFormFieldLabel.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCFormFieldLabel.js +7 -4
- package/dist/esm/target/react-web-pure/UCFormSubmitControl.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCFormSubmitControl.js +5 -3
- package/dist/esm/target/react-web-pure/UCOutputFieldValue.d.ts +2 -2
- package/dist/esm/target/react-web-pure/UCOutputFieldValue.js +5 -4
- package/dist/esm/testing/AppTester.d.ts +2 -2
- package/dist/esm/testing/AppTester.js +2 -2
- package/dist/esm/testing/UCDefASTParser.js +1 -1
- package/dist/esm/testing/impl/SimpleAppDocsEmitter.js +1 -1
- package/dist/esm/testing/impl/TypeScriptLibUCDefASTParser.d.ts +1 -1
- package/dist/esm/testing/impl/TypeScriptLibUCDefASTParser.js +2 -3
- package/dist/esm/testing/index.d.ts +6 -6
- package/dist/esm/testing/index.js +2 -2
- package/dist/esm/testing/uc-auth.js +1 -1
- package/dist/esm/testing/workers/AppTesterCtxInitializer.js +1 -1
- package/dist/esm/testing/workers/UCExecutor.js +1 -1
- package/dist/esm/testing/workers/checkers/UCDefSourcesChecker.d.ts +1 -1
- package/dist/esm/testing/workers/checkers/UCDefSourcesChecker.js +3 -3
- package/dist/esm/uc/UC.d.ts +2 -2
- package/dist/esm/uc/UC.js +2 -2
- package/dist/esm/uc/UCInputField.d.ts +1 -1
- package/dist/esm/uc/helpers/UCOutputReader.d.ts +3 -3
- package/dist/esm/uc/impl/HTTPUCTransporter.d.ts +1 -1
- package/dist/esm/uc/impl/HTTPUCTransporter.js +3 -4
- package/dist/esm/uc/impl/InMemoryUCDataStore.d.ts +1 -1
- package/dist/esm/uc/impl/KnexUCDataStore.d.ts +1 -1
- package/dist/esm/uc/impl/RNUCClientConfirmManager.d.ts +10 -0
- package/dist/esm/uc/impl/RNUCClientConfirmManager.js +44 -0
- package/dist/esm/uc/impl/SimpleUCManager.d.ts +2 -2
- package/dist/esm/uc/index.d.ts +30 -30
- package/dist/esm/uc/index.js +30 -30
- package/dist/esm/uc/io/input/AggregateInput.d.ts +1 -1
- package/dist/esm/uc/io/input/ListInput.d.ts +1 -1
- package/dist/esm/uc/main.d.ts +1 -1
- package/dist/esm/uc/manager.d.ts +2 -2
- package/dist/esm/uc/output-part.d.ts +1 -1
- package/dist/esm/uc/policy.d.ts +1 -1
- package/dist/esm/uc/transporter.d.ts +1 -1
- package/dist/esm/uc/utils/appendUCInputToURL.d.ts +1 -1
- package/dist/esm/uc/utils/fmtVal.d.ts +1 -1
- package/dist/esm/uc/utils/rInput.d.ts +1 -1
- package/dist/esm/uc/utils/recIs.d.ts +1 -1
- package/dist/esm/uc/utils/ucHTTPContract.d.ts +1 -1
- package/dist/esm/uc/utils/ucMountingPoint.d.ts +1 -1
- package/dist/esm/uc/workers/SimpleAggregateFinder.d.ts +1 -1
- package/dist/esm/uc/workers/SimpleAggregateOwnershipChecker.d.ts +2 -2
- package/dist/esm/uc/workers/UCBuilder.d.ts +1 -1
- package/dist/esm/uc/workers/UCExecChecker.d.ts +1 -1
- package/dist/esm/uc/workers/UCInputFilesProcessor.d.ts +1 -1
- package/dist/esm/uc/workers/UCInputValidator.d.ts +1 -1
- package/dist/esm/utils/index.d.ts +1 -1
- package/dist/esm/utils/ioc/bindNodeCore.js +1 -1
- package/dist/esm/utils/ioc/bindRN.js +5 -0
- package/dist/esm/utils/numbers/fmt.js +1 -1
- package/package.json +8 -8
- package/pnpm-workspace.yaml +5 -4
- package/tsconfig.json +36 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Password, UIntQuantity, UUID } from '../../dt/index.js';
|
|
2
2
|
import type { BufferManagerBase64String } from '../BufferManager.js';
|
|
3
|
-
import type { CryptoManager, CryptoManagerBinaryToTextEncoding,
|
|
3
|
+
import type { CryptoManager, CryptoManagerBinaryToTextEncoding, CryptoManagerHash, CryptoManagerHashAlgorithm, CryptoManagerHMACKey, CryptoManagerHMACKeyEncoding, CryptoManagerRandomString, CryptoManagerSalt, CryptoManagerSaltedScrypt } from '../CryptoManager.js';
|
|
4
4
|
export declare class NodeCryptoManager implements CryptoManager {
|
|
5
5
|
clear(): Promise<void>;
|
|
6
6
|
hash(algorithm: CryptoManagerHashAlgorithm, base: string, binaryToTextEncoding: CryptoManagerBinaryToTextEncoding): CryptoManagerHash;
|
|
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { appendFile, chmod, cp, mkdir,
|
|
7
|
+
import { appendFile, chmod, cp, mkdir, readdir, readFile, rm, stat, writeFile, } from 'node:fs/promises';
|
|
8
8
|
import { extname, join, parse } from 'node:path';
|
|
9
9
|
import { injectable } from 'inversify';
|
|
10
10
|
import { FSManagerItemInfoType, } from '../FSManager.js';
|
|
@@ -36,12 +36,12 @@ let OllamaLLMManager = class OllamaLLMManager {
|
|
|
36
36
|
choices: [{ message: { content: res.response } }],
|
|
37
37
|
}),
|
|
38
38
|
req: {
|
|
39
|
-
envelope: 'json',
|
|
40
39
|
builder: async () => ({
|
|
41
40
|
model: req.model,
|
|
42
41
|
prompt: firstMessage.content,
|
|
43
42
|
stream: false,
|
|
44
43
|
}),
|
|
44
|
+
envelope: 'json',
|
|
45
45
|
},
|
|
46
46
|
urlBuilder: async () => `${this.s().oll_base_url}/api/generate`,
|
|
47
47
|
});
|
|
@@ -29,14 +29,14 @@ let OpenAILLMManager = class OpenAILLMManager {
|
|
|
29
29
|
async send(req, opts) {
|
|
30
30
|
return await this.httpAPICaller.exec({
|
|
31
31
|
authorizationHeader: {
|
|
32
|
-
value: opts?.auth?.apiKey ?? this.s().oai_api_key,
|
|
33
32
|
prefix: 'Bearer',
|
|
33
|
+
value: opts?.auth?.apiKey ?? this.s().oai_api_key,
|
|
34
34
|
},
|
|
35
35
|
errBuilder: async (error) => error.error.message,
|
|
36
36
|
method: 'POST',
|
|
37
37
|
req: {
|
|
38
|
-
envelope: 'json',
|
|
39
38
|
builder: async () => req,
|
|
39
|
+
envelope: 'json',
|
|
40
40
|
},
|
|
41
41
|
urlBuilder: async () => `${OpenAILLMManager_1.BASE_URL}/chat/completions`,
|
|
42
42
|
});
|
|
@@ -96,13 +96,13 @@ let SimpleHTTPAPICaller = class SimpleHTTPAPICaller {
|
|
|
96
96
|
}
|
|
97
97
|
if (authorizationHeader) {
|
|
98
98
|
const { prefix, value } = authorizationHeader;
|
|
99
|
-
headers
|
|
99
|
+
headers.Authorization = [prefix, value].join(' ').trim();
|
|
100
100
|
}
|
|
101
101
|
if (basicAuth) {
|
|
102
102
|
const { password, username } = basicAuth;
|
|
103
103
|
const prefix = 'Basic';
|
|
104
104
|
const value = this.bufferManager.encodeBase64([username, password].join(':'));
|
|
105
|
-
headers
|
|
105
|
+
headers.Authorization = [prefix, value].join(' ').trim();
|
|
106
106
|
}
|
|
107
107
|
if (additionalHeadersBuilder) {
|
|
108
108
|
const additionalHeaders = await additionalHeadersBuilder();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Password, UIntQuantity, UUID } from '../../dt/index.js';
|
|
2
2
|
import type { BufferManagerBase64String } from '../BufferManager.js';
|
|
3
|
-
import type { CryptoManager,
|
|
3
|
+
import type { CryptoManager, CryptoManagerHash, CryptoManagerHashAlgorithm, CryptoManagerHMACKey, CryptoManagerHMACKeyEncoding, CryptoManagerRandomString, CryptoManagerSalt, CryptoManagerSaltedScrypt } from '../CryptoManager.js';
|
|
4
4
|
export declare class WebCryptoManager implements CryptoManager {
|
|
5
5
|
clear(): Promise<void>;
|
|
6
6
|
hash(_algorithm: CryptoManagerHashAlgorithm, _base: string): CryptoManagerHash;
|
package/dist/esm/std/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './consts.js';
|
|
2
1
|
export * from './BufferManager.js';
|
|
3
2
|
export * from './ClockManager.js';
|
|
4
3
|
export * from './CryptoManager.js';
|
|
4
|
+
export * from './consts.js';
|
|
5
5
|
export * from './EmailManager.js';
|
|
6
6
|
export * from './EnvironmentManager.js';
|
|
7
7
|
export * from './ExternalResourceInstaller.js';
|
|
8
8
|
export * from './ExternalResourceManager.js';
|
|
9
|
-
export * from './FSManager.js';
|
|
10
9
|
export * from './FormDataBuilder.js';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './FSManager.js';
|
|
12
11
|
export * from './HTTPAPICallExecutor.js';
|
|
12
|
+
export * from './HTTPAPICaller.js';
|
|
13
13
|
export * from './I18nManager.js';
|
|
14
14
|
export * from './JobManager.js';
|
|
15
15
|
export * from './JWTManager.js';
|
package/dist/esm/std/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './consts.js';
|
|
2
1
|
export * from './BufferManager.js';
|
|
3
2
|
export * from './ClockManager.js';
|
|
4
3
|
export * from './CryptoManager.js';
|
|
4
|
+
export * from './consts.js';
|
|
5
5
|
export * from './EmailManager.js';
|
|
6
6
|
export * from './EnvironmentManager.js';
|
|
7
7
|
export * from './ExternalResourceInstaller.js';
|
|
8
8
|
export * from './ExternalResourceManager.js';
|
|
9
|
-
export * from './FSManager.js';
|
|
10
9
|
export * from './FormDataBuilder.js';
|
|
11
|
-
export * from './
|
|
10
|
+
export * from './FSManager.js';
|
|
12
11
|
export * from './HTTPAPICallExecutor.js';
|
|
12
|
+
export * from './HTTPAPICaller.js';
|
|
13
13
|
export * from './I18nManager.js';
|
|
14
14
|
export * from './JobManager.js';
|
|
15
15
|
export * from './JWTManager.js';
|
|
@@ -57,7 +57,7 @@ let CommandExecutor = class CommandExecutor {
|
|
|
57
57
|
async version() {
|
|
58
58
|
let i = 0;
|
|
59
59
|
let currentPath = CommandExecutor_1.VERSION_FETCH_START_PATH;
|
|
60
|
-
let file
|
|
60
|
+
let file;
|
|
61
61
|
while (i < CommandExecutor_1.VERSION_FETCH_MAX_TRIES && !file) {
|
|
62
62
|
const items = await this.fsManager.ls(currentPath, {
|
|
63
63
|
withFullPath: true,
|
|
@@ -75,7 +75,7 @@ let CommandExecutor = class CommandExecutor {
|
|
|
75
75
|
const { version } = JSON.parse(contents);
|
|
76
76
|
return version;
|
|
77
77
|
}
|
|
78
|
-
catch (
|
|
78
|
+
catch (_err) {
|
|
79
79
|
return CommandExecutor_1.DEFAULT_VERSION;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Container } from 'inversify';
|
|
2
|
-
import
|
|
2
|
+
import { type PropsWithChildren, type ReactElement } from 'react';
|
|
3
3
|
import { WordingManager } from '../../../i18n/index.js';
|
|
4
4
|
import type { I18nManager } from '../../../std/index.js';
|
|
5
5
|
export interface DIContextT {
|
|
@@ -7,10 +7,8 @@ export interface DIContextT {
|
|
|
7
7
|
i18nManager: I18nManager;
|
|
8
8
|
wordingManager: WordingManager;
|
|
9
9
|
}
|
|
10
|
-
export declare const DIContext:
|
|
10
|
+
export declare const DIContext: import("react").Context<DIContextT | null>;
|
|
11
11
|
export declare function useDIContext(): DIContextT;
|
|
12
|
-
|
|
13
|
-
container: Container;
|
|
14
|
-
}
|
|
12
|
+
type Props = Pick<DIContextT, 'container'>;
|
|
15
13
|
export declare function DIContextProvider({ children, container, }: PropsWithChildren<Props>): ReactElement;
|
|
16
14
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useState, } from 'react';
|
|
2
3
|
import { WordingManager } from '../../../i18n/index.js';
|
|
3
4
|
export const DIContext = createContext(null);
|
|
4
5
|
export function useDIContext() {
|
|
@@ -11,9 +12,9 @@ export function useDIContext() {
|
|
|
11
12
|
export function DIContextProvider({ children, container, }) {
|
|
12
13
|
const [i18nManager] = useState(container.get('I18nManager'));
|
|
13
14
|
const [wordingManager] = useState(container.get(WordingManager));
|
|
14
|
-
return (
|
|
15
|
+
return (_jsx(DIContext.Provider, { value: {
|
|
15
16
|
container,
|
|
16
17
|
i18nManager,
|
|
17
18
|
wordingManager,
|
|
18
|
-
}
|
|
19
|
+
}, children: children }));
|
|
19
20
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PropsWithChildren, type ReactElement } from 'react';
|
|
2
|
+
import type { Color, DataType } from '../../../dt/index.js';
|
|
3
|
+
import type { UCFormFieldControlProps } from './form.js';
|
|
4
|
+
export interface StyleDef {
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
style?: Record<string, unknown> | undefined;
|
|
7
|
+
}
|
|
8
|
+
export type SelectiveStyleDefKey = 'default' | (string & {});
|
|
9
|
+
export interface StyleContextT {
|
|
10
|
+
autoExecLoader?: StyleDef | undefined;
|
|
11
|
+
colors?: {
|
|
12
|
+
onPrimary: Color;
|
|
13
|
+
primary: Color;
|
|
14
|
+
};
|
|
15
|
+
entrypointTouchable?: StyleDef | undefined;
|
|
16
|
+
execTouchable?: StyleDef | undefined;
|
|
17
|
+
form?: StyleDef | undefined;
|
|
18
|
+
formField?: StyleDef | undefined;
|
|
19
|
+
formFieldControl?: Record<SelectiveStyleDefKey, StyleDef | undefined>;
|
|
20
|
+
formFieldDesc?: StyleDef | undefined;
|
|
21
|
+
formFieldErr?: StyleDef | undefined;
|
|
22
|
+
formFieldLabel?: StyleDef | undefined;
|
|
23
|
+
formSubmitControl?: StyleDef | undefined;
|
|
24
|
+
outputFieldValue?: StyleDef | undefined;
|
|
25
|
+
renderFormFieldControl?: <T extends DataType>(props: UCFormFieldControlProps<T>) => ReactElement | null;
|
|
26
|
+
}
|
|
27
|
+
export declare const StyleContext: import("react").Context<StyleContextT>;
|
|
28
|
+
export declare function useStyleContext(): StyleContextT;
|
|
29
|
+
type Props = StyleContextT;
|
|
30
|
+
export declare function StyleContextProvider({ children, ...rest }: PropsWithChildren<Props>): ReactElement;
|
|
31
|
+
export declare function styleDef(def: StyleContextT['formFieldControl'], k1: SelectiveStyleDefKey, fallback?: SelectiveStyleDefKey | undefined): StyleDef;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, } from 'react';
|
|
3
|
+
export const StyleContext = createContext({});
|
|
4
|
+
export function useStyleContext() {
|
|
5
|
+
return useContext(StyleContext);
|
|
6
|
+
}
|
|
7
|
+
export function StyleContextProvider({ children, ...rest }) {
|
|
8
|
+
return (_jsx(StyleContext.Provider, { value: rest, children: children }));
|
|
9
|
+
}
|
|
10
|
+
export function styleDef(def, k1, fallback) {
|
|
11
|
+
const main = def?.[k1];
|
|
12
|
+
const fb = fallback ? def?.[fallback] : null;
|
|
13
|
+
return {
|
|
14
|
+
className: main?.className ?? fb?.className,
|
|
15
|
+
style: main?.style ?? fb?.style,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState, } from 'react';
|
|
2
3
|
import { UCExecChecker, } from '../../../uc/index.js';
|
|
3
4
|
import { useDIContext } from './DIContextProvider.js';
|
|
4
5
|
export function UCContainer({ children, uc, }) {
|
|
@@ -16,10 +17,10 @@ export function UCContainer({ children, uc, }) {
|
|
|
16
17
|
}, [uc, ucExecChecker]);
|
|
17
18
|
if (isAllowed === undefined) {
|
|
18
19
|
// TODO : Add some loader while we check if can do
|
|
19
|
-
return
|
|
20
|
+
return _jsx(_Fragment, {});
|
|
20
21
|
}
|
|
21
22
|
if (isAllowed === false) {
|
|
22
23
|
return null;
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
+
return _jsx(_Fragment, { children: children });
|
|
25
26
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase } from '../../../uc/index.js';
|
|
3
3
|
import type { UCEntrypointCtx } from './entrypoint.js';
|
|
4
4
|
import type { RenderUCEntrypointTouchable } from './touchable.js';
|
|
5
5
|
type Props<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCEntrypointCtx<I, OPI0, OPI1> & {
|
|
6
6
|
renderTouchable: RenderUCEntrypointTouchable<I, OPI0, OPI1>;
|
|
7
7
|
};
|
|
8
|
-
export declare function UCEntrypoint<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>({ path, renderTouchable, uc }: Props<I, OPI0, OPI1>): ReactElement;
|
|
8
|
+
export declare function UCEntrypoint<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>({ onPress, path, renderTouchable, uc }: Props<I, OPI0, OPI1>): ReactElement;
|
|
9
9
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useDIContext } from './DIContextProvider.js';
|
|
3
3
|
import { UCContainer } from './UCContainer.js';
|
|
4
|
-
export function UCEntrypoint({ path, renderTouchable, uc }) {
|
|
4
|
+
export function UCEntrypoint({ onPress, path, renderTouchable, uc }) {
|
|
5
5
|
const { wordingManager } = useDIContext();
|
|
6
6
|
const wording = wordingManager.uc(uc.def);
|
|
7
|
-
return (
|
|
7
|
+
return (_jsx(UCContainer, { uc: uc, children: renderTouchable({ onPress, path, uc, wording }) }));
|
|
8
8
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
2
|
import type { DataType } from '../../../dt/index.js';
|
|
3
3
|
import type { UCOPIBase, UCOutputField } from '../../../uc/index.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
field: UCOutputField<OPI, T>;
|
|
4
|
+
export interface Props<OPI extends UCOPIBase, T extends DataType> {
|
|
5
|
+
f: UCOutputField<OPI, T>;
|
|
7
6
|
value: T;
|
|
8
|
-
}
|
|
9
|
-
export declare function UCOutputFieldValueFragment<OPI extends UCOPIBase, T extends DataType>({
|
|
7
|
+
}
|
|
8
|
+
export declare function UCOutputFieldValueFragment<OPI extends UCOPIBase, T extends DataType>({ f, value }: Props<OPI, T>): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
export function UCOutputFieldValueFragment({
|
|
3
|
-
const { def: { type }, } =
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function UCOutputFieldValueFragment({ f, value }) {
|
|
3
|
+
const { def: { type }, } = f;
|
|
4
4
|
type.assign(value);
|
|
5
|
-
return
|
|
5
|
+
return _jsx(_Fragment, { children: type.fmt() });
|
|
6
6
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ucIsDisabled, } from '../../../uc/index.js';
|
|
3
4
|
import { sleep } from '../../../utils/index.js';
|
|
4
5
|
import { useDIContext } from './DIContextProvider.js';
|
|
5
6
|
import { UCContainer } from './UCContainer.js';
|
|
@@ -35,28 +36,21 @@ export function UCPanel({ autoExec = false, clearAfterExec = true, onDone, onErr
|
|
|
35
36
|
}
|
|
36
37
|
uc.clear();
|
|
37
38
|
};
|
|
38
|
-
const
|
|
39
|
-
const loading = ucIsLoading(execState);
|
|
40
|
-
// TODO : Keep these as a state to avoid recomputation
|
|
39
|
+
const needsInputFilling = uc.needsInputFilling();
|
|
41
40
|
const ctx = {
|
|
42
41
|
clearAfterExec,
|
|
43
|
-
disabled,
|
|
42
|
+
disabled: ucIsDisabled(execState),
|
|
44
43
|
execState,
|
|
45
44
|
uc,
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
renderForm({
|
|
58
|
-
...ctx,
|
|
59
|
-
onChange,
|
|
60
|
-
onSubmit: exec,
|
|
61
|
-
})))));
|
|
46
|
+
return (_jsxs(UCContainer, { uc: uc, children: [autoExec && ctx.disabled && renderAutoExecLoader(), !autoExec && (_jsxs(_Fragment, { children: [needsInputFilling &&
|
|
47
|
+
renderForm({
|
|
48
|
+
...ctx,
|
|
49
|
+
onChange,
|
|
50
|
+
onSubmit: exec,
|
|
51
|
+
}), !needsInputFilling &&
|
|
52
|
+
renderExecTouchable({
|
|
53
|
+
...ctx,
|
|
54
|
+
onSubmit: exec,
|
|
55
|
+
})] }))] }));
|
|
62
56
|
}
|
|
@@ -2,7 +2,7 @@ import type { URLPath } from '../../../dt/index.js';
|
|
|
2
2
|
import type { UC, UCInput, UCOPIBase } from '../../../uc/index.js';
|
|
3
3
|
export type UCEntrypointOnPress = () => Promise<void>;
|
|
4
4
|
export interface UCEntrypointCtx<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> {
|
|
5
|
-
onPress?: UCEntrypointOnPress;
|
|
5
|
+
onPress?: UCEntrypointOnPress | undefined;
|
|
6
6
|
path?: URLPath | undefined;
|
|
7
7
|
uc: UC<I, OPI0, OPI1>;
|
|
8
8
|
}
|
|
@@ -2,33 +2,32 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import type { DataType, ErrorMessage } from '../../../dt/index.js';
|
|
3
3
|
import type { I18nManager } from '../../../std/index.js';
|
|
4
4
|
import type { UCInput, UCInputField, UCInputFieldChangeOperator, UCInputFieldValue, UCOPIBase } from '../../../uc/index.js';
|
|
5
|
-
import type { Stylable } from './common.js';
|
|
6
5
|
import type { UCPanelCtx, UCPanelOnSubmit, UCPanelState } from './panel.js';
|
|
7
6
|
export type UCFormFieldControlOnChange<T extends DataType = DataType> = (f: UCInputField<T>, op: UCInputFieldChangeOperator, v: UCInputFieldValue<T>) => void;
|
|
8
|
-
export type UCFormFieldControlProps<T extends DataType> =
|
|
7
|
+
export type UCFormFieldControlProps<T extends DataType> = UCPanelState & {
|
|
9
8
|
errMsg?: ErrorMessage | null;
|
|
10
9
|
f: UCInputField<T>;
|
|
11
10
|
onChange: UCFormFieldControlOnChange<T>;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
12
|
+
export interface UCFormFieldDescProps<T extends DataType> {
|
|
14
13
|
f: UCInputField<T>;
|
|
15
|
-
}
|
|
16
|
-
export
|
|
14
|
+
}
|
|
15
|
+
export interface UCFormFieldErrProps {
|
|
17
16
|
errMsg?: ErrorMessage | null;
|
|
18
|
-
}
|
|
19
|
-
export
|
|
17
|
+
}
|
|
18
|
+
export interface UCFormFieldLabelProps<T extends DataType> {
|
|
20
19
|
f: UCInputField<T>;
|
|
21
|
-
}
|
|
20
|
+
}
|
|
22
21
|
export declare const UC_FORM_FIELD_ELEMENTS: readonly ["control", "desc", "err", "label"];
|
|
23
22
|
export type UCFormFieldElement = (typeof UC_FORM_FIELD_ELEMENTS)[number];
|
|
24
|
-
export type UCFormFieldProps<T extends DataType> =
|
|
23
|
+
export type UCFormFieldProps<T extends DataType> = UCFormFieldControlProps<T> & {
|
|
25
24
|
only?: UCFormFieldElement[];
|
|
26
25
|
};
|
|
27
|
-
export type UCFormProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> =
|
|
26
|
+
export type UCFormProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCPanelCtx<I, OPI0, OPI1> & {
|
|
28
27
|
onChange: UCFormFieldControlOnChange;
|
|
29
28
|
onSubmit: UCPanelOnSubmit;
|
|
30
29
|
};
|
|
31
|
-
export type UCFormSubmitControlProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> =
|
|
30
|
+
export type UCFormSubmitControlProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCPanelCtx<I, OPI0, OPI1> & {
|
|
32
31
|
onPress?: () => Promise<void>;
|
|
33
32
|
};
|
|
34
33
|
export type RenderUCForm<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (props: UCFormProps<I, OPI0, OPI1>) => ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isBlank } from '../../../utils/index.js';
|
|
1
2
|
export const UC_FORM_FIELD_ELEMENTS = [
|
|
2
3
|
'control',
|
|
3
4
|
'desc',
|
|
@@ -5,6 +6,9 @@ export const UC_FORM_FIELD_ELEMENTS = [
|
|
|
5
6
|
'label',
|
|
6
7
|
];
|
|
7
8
|
export function validateFormField(i18nManager, f, v) {
|
|
9
|
+
if (isBlank(v)) {
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
8
12
|
const vArr = Array.isArray(v) ? v : [v];
|
|
9
13
|
for (const vv of vArr) {
|
|
10
14
|
const validation = f.def.type.assign(vv).validate();
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { UCInput, UCOPIBase, UCWording } from '../../../uc/index.js';
|
|
3
|
-
import type { Stylable } from './common.js';
|
|
4
3
|
import type { UCEntrypointCtx } from './entrypoint.js';
|
|
5
4
|
import type { UCPanelCtx, UCPanelOnSubmit } from './panel.js';
|
|
6
|
-
export type UCEntrypointTouchableProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> =
|
|
5
|
+
export type UCEntrypointTouchableProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCEntrypointCtx<I, OPI0, OPI1> & {
|
|
7
6
|
wording: UCWording;
|
|
8
7
|
};
|
|
9
8
|
export type RenderUCEntrypointTouchable<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (props: UCEntrypointTouchableProps<I, OPI0, OPI1>) => ReactElement;
|
|
10
|
-
export type UCExecTouchableProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> =
|
|
9
|
+
export type UCExecTouchableProps<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = UCPanelCtx<I, OPI0, OPI1> & {
|
|
11
10
|
onSubmit: UCPanelOnSubmit;
|
|
12
11
|
};
|
|
13
12
|
export type RenderUCExecTouchable<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined> = (props: UCExecTouchableProps<I, OPI0, OPI1>) => ReactElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ErrorMessage, UIntDuration } from '../../../dt/index.js';
|
|
2
|
-
import type { UCExecRes, UCExecState } from '../../../uc/
|
|
2
|
+
import type { UCExecRes, UCExecState } from '../../../uc/index.js';
|
|
3
3
|
export type UseActionAction = () => Promise<void>;
|
|
4
4
|
export type UseActionConfirm = () => Promise<boolean>;
|
|
5
5
|
export type UseActionExec = () => Promise<UCExecRes>;
|
|
@@ -4,15 +4,20 @@ export function useAction({ action, autoExec = false, confirm, onError, onInit,
|
|
|
4
4
|
const [errMsg, setErrMsg] = useState(null);
|
|
5
5
|
const [execRes, setExecRes] = useState(null);
|
|
6
6
|
const [execState, setExecState] = useState(onInit ? 'initializing' : 'idle');
|
|
7
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies : must run only once
|
|
7
8
|
useEffect(() => {
|
|
8
|
-
if (execState !== 'initializing') {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
9
|
(async () => {
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
if (execState === 'initializing') {
|
|
11
|
+
await onInit?.();
|
|
12
|
+
}
|
|
13
|
+
if (autoExec) {
|
|
14
|
+
await exec();
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
setExecState('idle');
|
|
18
|
+
}
|
|
14
19
|
})();
|
|
15
|
-
}, [
|
|
20
|
+
}, []);
|
|
16
21
|
const exec = async () => {
|
|
17
22
|
setErrMsg(null);
|
|
18
23
|
setExecRes(null);
|
|
@@ -46,12 +51,5 @@ export function useAction({ action, autoExec = false, confirm, onError, onInit,
|
|
|
46
51
|
setExecState('idle');
|
|
47
52
|
}
|
|
48
53
|
};
|
|
49
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies(exec): it complains if I add it AND if I don't add it !
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
if (!autoExec) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
exec();
|
|
55
|
-
}, [autoExec]);
|
|
56
54
|
return { errMsg, exec, execRes, execState };
|
|
57
55
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextInputProps } from 'react-native';
|
|
2
2
|
import { type DataType, type ErrorMessage } from '../../../dt/index.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type UCInputField } from '../../../uc/index.js';
|
|
4
4
|
export interface RNInputDef {
|
|
5
5
|
internal?: undefined;
|
|
6
6
|
/**
|
|
@@ -12,4 +12,4 @@ export interface RNInputDef {
|
|
|
12
12
|
*/
|
|
13
13
|
spec?: TextInputProps;
|
|
14
14
|
}
|
|
15
|
-
export declare function rnInputDef<T extends DataType>(field: UCInputField<T>,
|
|
15
|
+
export declare function rnInputDef<T extends DataType>(field: UCInputField<T>, disabled: boolean, _errMsg: ErrorMessage | null): RNInputDef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TString, } from '../../../dt/index.js';
|
|
2
|
-
import {
|
|
3
|
-
export function rnInputDef(field,
|
|
2
|
+
import { ucifHint, ucifId } from '../../../uc/index.js';
|
|
3
|
+
export function rnInputDef(field, disabled, _errMsg) {
|
|
4
4
|
const def = {
|
|
5
5
|
internal: undefined,
|
|
6
6
|
spec: {},
|
|
@@ -11,7 +11,7 @@ export function rnInputDef(field, execState, _errMsg) {
|
|
|
11
11
|
}
|
|
12
12
|
const { key, def: fDef } = field;
|
|
13
13
|
const { type: fType } = fDef;
|
|
14
|
-
def.spec.editable = !
|
|
14
|
+
def.spec.editable = !disabled;
|
|
15
15
|
def.spec.id = ucifId(key);
|
|
16
16
|
// Testing the types by usage probability to make the if/else evaluation stop ideally earlier
|
|
17
17
|
if (fType instanceof TString) {
|
|
@@ -33,9 +33,9 @@ let RequestChecker = class RequestChecker {
|
|
|
33
33
|
const isSSLCertificateCheck = !!url.match(/^\/\.well-known\/acme-challenge\/(.*)/); // http://localhost:8443/.well-known/acme-challenge/ywml7k8e8qxdjwFf1pN4hIKWJ1Jrc0CvAP3t9PSmnzw
|
|
34
34
|
this.logger.trace('Request checker', {
|
|
35
35
|
isNotProd,
|
|
36
|
-
isSSLCertificateCheck,
|
|
37
36
|
isSecure,
|
|
38
37
|
isSecureForwarded,
|
|
38
|
+
isSSLCertificateCheck,
|
|
39
39
|
});
|
|
40
40
|
const allowed = isSecure || isSecureForwarded || isNotProd || isSSLCertificateCheck;
|
|
41
41
|
if (!allowed) {
|
|
@@ -119,7 +119,7 @@ let ServerRequestHandler = class ServerRequestHandler {
|
|
|
119
119
|
try {
|
|
120
120
|
uc.fill((await req.bodyFromJSON()));
|
|
121
121
|
}
|
|
122
|
-
catch (
|
|
122
|
+
catch (_err) {
|
|
123
123
|
// Ignore any JSON.parse error as everything is validated afterwards
|
|
124
124
|
}
|
|
125
125
|
break;
|
|
@@ -165,14 +165,14 @@ let ServerRequestHandler = class ServerRequestHandler {
|
|
|
165
165
|
async applyRedirectSideEffect(res, item) {
|
|
166
166
|
if (!item ||
|
|
167
167
|
!('redirect' in item) ||
|
|
168
|
-
typeof item
|
|
168
|
+
typeof item.redirect !== 'string') {
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
const { redirect } = item;
|
|
172
172
|
res.redirect(redirect);
|
|
173
173
|
}
|
|
174
174
|
async applySetAuthSideEffect(res, item) {
|
|
175
|
-
if (!item || !('jwt' in item) || typeof item
|
|
175
|
+
if (!item || !('jwt' in item) || typeof item.jwt !== 'string') {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
const { jwt } = item;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DataType, type ErrorMessage, type HTMLInputType } from '../../../dt/index.js';
|
|
2
|
-
import { type
|
|
2
|
+
import { type UCInputField } from '../../../uc/index.js';
|
|
3
3
|
export interface HTMLInputDef {
|
|
4
4
|
/**
|
|
5
5
|
* Internal types that are not part of the W3C spec
|
|
@@ -36,7 +36,6 @@ export interface HTMLInputDef {
|
|
|
36
36
|
spec?: {
|
|
37
37
|
'aria-errormessage'?: string | undefined;
|
|
38
38
|
'aria-invalid'?: boolean | undefined;
|
|
39
|
-
className?: string | undefined;
|
|
40
39
|
disabled?: boolean | undefined;
|
|
41
40
|
id?: string | undefined;
|
|
42
41
|
max?: number | undefined;
|
|
@@ -51,4 +50,4 @@ export interface HTMLInputDef {
|
|
|
51
50
|
type?: HTMLInputType | undefined;
|
|
52
51
|
};
|
|
53
52
|
}
|
|
54
|
-
export declare function htmlInputDef<T extends DataType>(field: UCInputField<T>,
|
|
53
|
+
export declare function htmlInputDef<T extends DataType>(field: UCInputField<T>, disabled: boolean, errMsg: ErrorMessage | null): HTMLInputDef;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TBoolean, TNumber, TString, } from '../../../dt/index.js';
|
|
2
|
-
import {
|
|
3
|
-
export function htmlInputDef(field,
|
|
2
|
+
import { ucifHint, ucifId, ucifIsMandatory, } from '../../../uc/index.js';
|
|
3
|
+
export function htmlInputDef(field, disabled, errMsg) {
|
|
4
4
|
const def = {
|
|
5
5
|
internal: {},
|
|
6
6
|
spec: {},
|
|
@@ -11,8 +11,7 @@ export function htmlInputDef(field, execState, errMsg, className) {
|
|
|
11
11
|
}
|
|
12
12
|
const { key, def: fDef } = field;
|
|
13
13
|
const { type: fType } = fDef;
|
|
14
|
-
def.spec.
|
|
15
|
-
def.spec.disabled = ucIsDisabled(execState);
|
|
14
|
+
def.spec.disabled = disabled;
|
|
16
15
|
def.spec.id = ucifId(key);
|
|
17
16
|
def.spec.name = key;
|
|
18
17
|
// Testing the types by usage probability to make the if/else evaluation stop ideally earlier
|
|
@@ -15,7 +15,7 @@ import { inject, injectable } from 'inversify';
|
|
|
15
15
|
import { TBoolean } from '../../dt/index.js';
|
|
16
16
|
import { WordingManager } from '../../i18n/index.js';
|
|
17
17
|
import { ProductUCsLoader } from '../../product/index.js';
|
|
18
|
-
import {
|
|
18
|
+
import { ucifRepeatability, ucMountingPoint, } from '../../uc/index.js';
|
|
19
19
|
import { CommandExecutor } from '../lib/cli/CommandExecutor.js';
|
|
20
20
|
import { print } from '../lib/cli/renderer.js';
|
|
21
21
|
import { showHelp } from './commands.js';
|