xmlui 0.8.6 → 0.9.1
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/{apiInterceptorWorker-fLBfPj2T.mjs → apiInterceptorWorker-230V_-Ds.mjs} +1 -1
- package/dist/{index-wd8FRzuM.mjs → index-DUwwx3L4.mjs} +5864 -6108
- package/dist/index.css +274 -301
- package/dist/language-server.mjs +25 -1
- package/dist/{lint-B18Ko6Sy.mjs → lint-gX2osbkz.mjs} +920 -1120
- package/dist/scripts/bin/build.js +2 -2
- package/dist/scripts/bin/start.js +3 -9
- package/dist/scripts/bin/vite-xmlui-plugin.js +2 -2
- package/dist/scripts/bin/viteConfig.js +89 -63
- package/dist/scripts/src/abstractions/scripting/ScriptingSourceTreeExp.js +1 -2
- package/dist/scripts/src/components/Accordion/Accordion.js +6 -16
- package/dist/scripts/src/components/App/AppNative.js +8 -0
- package/dist/scripts/src/components/AppHeader/AppHeader.js +1 -5
- package/dist/scripts/src/components/AppHeader/AppHeaderNative.js +10 -4
- package/dist/scripts/src/components/AutoComplete/AutoComplete.js +13 -19
- package/dist/scripts/src/components/AutoComplete/AutoCompleteContext.js +2 -0
- package/dist/scripts/src/components/AutoComplete/AutoCompleteNative.js +7 -3
- package/dist/scripts/src/components/Avatar/Avatar.js +2 -9
- package/dist/scripts/src/components/Badge/Badge.js +2 -8
- package/dist/scripts/src/components/Button/Button.js +28 -60
- package/dist/scripts/src/components/Card/Card.js +1 -6
- package/dist/scripts/src/components/Checkbox/Checkbox.js +4 -12
- package/dist/scripts/src/components/ComponentProvider.js +4 -0
- package/dist/scripts/src/components/DatePicker/DatePicker.js +3 -10
- package/dist/scripts/src/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/scripts/src/components/Form/Form.js +12 -28
- package/dist/scripts/src/components/Form/FormNative.js +9 -0
- package/dist/scripts/src/components/FormItem/HelperText.js +1 -1
- package/dist/scripts/src/components/FormItem/ItemWithLabel.js +2 -2
- package/dist/scripts/src/components/Heading/HeadingNative.js +0 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +4 -19
- package/dist/scripts/src/components/IconProvider.js +2 -2
- package/dist/scripts/src/components/Link/Link.js +2 -8
- package/dist/scripts/src/components/Markdown/MarkdownNative.js +4 -4
- package/dist/scripts/src/components/ModalDialog/ModalDialog.js +1 -3
- package/dist/scripts/src/components/NavGroup/NavGroup.js +34 -3
- package/dist/scripts/src/components/NavGroup/NavGroupNative.js +24 -12
- package/dist/scripts/src/components/NavLink/NavLink.js +4 -11
- package/dist/scripts/src/components/NavPanel/NavPanel.js +1 -6
- package/dist/scripts/src/components/ProgressBar/ProgressBar.js +2 -8
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +4 -12
- package/dist/scripts/src/components/Select/Select.js +5 -13
- package/dist/scripts/src/components/Select/SelectNative.js +7 -3
- package/dist/scripts/src/components/Slider/Slider.js +2 -8
- package/dist/scripts/src/components/Spinner/Spinner.js +1 -6
- package/dist/scripts/src/components/SubNavPanel/SubNavPanel.js +22 -0
- package/dist/scripts/src/components/SubNavPanel/SubNavPanelNative.js +9 -0
- package/dist/scripts/src/components/Switch/Switch.js +6 -16
- package/dist/scripts/src/components/Table/Table.js +8 -17
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +4 -12
- package/dist/scripts/src/components/Tabs/Tabs.js +3 -10
- package/dist/scripts/src/components/Text/Text.js +10 -24
- package/dist/scripts/src/components/TextBox/TextBoxNative.js +1 -1
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
- package/dist/scripts/src/components/ValidationSummary/ValidationSummary.js +3 -3
- package/dist/scripts/src/components-core/DevTools.js +5 -4
- package/dist/scripts/src/components-core/RestApiProxy.js +7 -3
- package/dist/scripts/src/components-core/action/APICall.js +2 -1
- package/dist/scripts/src/components-core/rendering/Container.js +15 -11
- package/dist/scripts/src/components-core/rendering/StateContainer.js +3 -2
- package/dist/scripts/src/components-core/script-runner/BindingTreeEvaluationContext.js +0 -2
- package/dist/scripts/src/components-core/script-runner/ParameterParser.js +1 -1
- package/dist/scripts/src/components-core/script-runner/asyncProxy.js +11 -64
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +196 -175
- package/dist/scripts/src/components-core/script-runner/eval-tree-common.js +173 -231
- package/dist/scripts/src/components-core/script-runner/eval-tree-sync.js +129 -100
- package/dist/scripts/src/components-core/script-runner/process-statement-async.js +170 -175
- package/dist/scripts/src/components-core/script-runner/process-statement-common.js +48 -33
- package/dist/scripts/src/components-core/script-runner/process-statement-sync.js +164 -170
- package/dist/scripts/src/components-core/script-runner/statement-queue.js +5 -4
- package/dist/scripts/src/components-core/script-runner/visitors.js +124 -116
- package/dist/scripts/src/components-core/theming/themes/palette.js +1 -0
- package/dist/scripts/src/components-core/theming/themes/root.js +300 -154
- package/dist/scripts/src/components-core/theming/themes/theme-colors.js +510 -510
- package/dist/scripts/src/components-core/theming/themes/xmlui.js +0 -1
- package/dist/scripts/src/components-core/theming/transformThemeVars.js +11 -11
- package/dist/scripts/src/components-core/utils/misc.js +13 -0
- package/dist/scripts/src/components-core/utils/statementUtils.js +56 -53
- package/dist/scripts/src/components-core/xmlui-parser.js +1 -1
- package/dist/scripts/src/parsers/scripting-exp/Lexer.js +1092 -0
- package/dist/scripts/src/parsers/scripting-exp/Parser.js +2635 -0
- package/dist/scripts/src/parsers/scripting-exp/ParserError.js +47 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenTrait.js +109 -0
- package/dist/scripts/src/parsers/scripting-exp/TokenType.js +2 -4
- package/dist/scripts/src/parsers/scripting-exp/code-behind-collect.js +101 -0
- package/dist/scripts/src/parsers/scripting-exp/modules.js +107 -0
- package/dist/scripts/src/parsers/{scripting → scripting-exp}/tree-visitor.js +103 -107
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +12 -12
- package/dist/style.css +245 -286
- package/dist/xmlui-metadata.mjs +2741 -2211
- package/dist/xmlui-metadata.umd.js +2740 -2212
- package/dist/xmlui-parser.d.ts +320 -232
- package/dist/xmlui-parser.mjs +19 -19
- package/dist/xmlui-standalone.umd.js +6770 -7220
- package/dist/xmlui.d.ts +322 -230
- package/dist/xmlui.mjs +1 -1
- package/package.json +10 -6
- package/dist/_commonjsHelpers-CcAunmGO.mjs +0 -33
- package/dist/scripts/src/components-core/script-runner/ICustomOperations.js +0 -34
- package/dist/scripts/src/components-core/script-runner/custom-operations-registry.js +0 -40
- package/dist/scripts/src/components-core/script-runner/custom-ui-data.js +0 -40
- package/dist/scripts/src/components-core/script-runner/syncProxy.js +0 -31
- package/dist/scripts/src/parsers/scripting/code-behind-collect.js +0 -153
- package/dist/scripts/src/parsers/scripting/modules.js +0 -284
- /package/dist/scripts/src/abstractions/scripting/{LogicalThread.js → LogicalThreadExp.js} +0 -0
- /package/dist/scripts/src/abstractions/scripting/{TryScope.js → TryScopeExp.js} +0 -0
|
@@ -111,11 +111,11 @@ const build = (_a) => __awaiter(void 0, [_a], void 0, function* ({ buildMode = "
|
|
|
111
111
|
withHostingMetaFiles,
|
|
112
112
|
withRelativeRoot,
|
|
113
113
|
});
|
|
114
|
-
yield (0, vite_1.build)(Object.assign(Object.assign({}, (0, viteConfig_1.getViteConfig)({
|
|
114
|
+
yield (0, vite_1.build)(Object.assign(Object.assign({}, (yield (0, viteConfig_1.getViteConfig)({
|
|
115
115
|
flatDist,
|
|
116
116
|
withRelativeRoot,
|
|
117
117
|
flatDistUiPrefix,
|
|
118
|
-
})), { define: {
|
|
118
|
+
}))), { define: {
|
|
119
119
|
"process.env.VITE_BUILD_MODE": JSON.stringify(buildMode),
|
|
120
120
|
"process.env.VITE_DEV_MODE": false,
|
|
121
121
|
"process.env.VITE_MOCK_ENABLED": withMock,
|
|
@@ -33,17 +33,11 @@ const start = (_a) => __awaiter(void 0, [_a], void 0, function* ({ port, withMoc
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
try {
|
|
36
|
-
|
|
36
|
+
let viteConfig = yield (0, viteConfig_1.getViteConfig)({});
|
|
37
|
+
const server = yield (0, vite_1.createServer)(Object.assign(Object.assign({}, viteConfig), { server: {
|
|
37
38
|
port,
|
|
38
39
|
proxy: proxyDef,
|
|
39
|
-
}, define: {
|
|
40
|
-
"process.env.VITE_BUILD_MODE": JSON.stringify("ALL"),
|
|
41
|
-
"process.env.VITE_DEV_MODE": true,
|
|
42
|
-
"process.env.VITE_STANDALONE": process.env.VITE_STANDALONE,
|
|
43
|
-
"process.env.VITE_MOCK_ENABLED": withMock,
|
|
44
|
-
"process.env.VITE_INCLUDE_ALL_COMPONENTS": JSON.stringify("true"),
|
|
45
|
-
"process.env.VITE_USER_COMPONENTS_Inspect": JSON.stringify("true"),
|
|
46
|
-
} }));
|
|
40
|
+
}, define: Object.assign(Object.assign({}, viteConfig.define), { "process.env.VITE_BUILD_MODE": JSON.stringify("ALL"), "process.env.VITE_DEV_MODE": true, "process.env.VITE_STANDALONE": process.env.VITE_STANDALONE, "process.env.VITE_MOCK_ENABLED": withMock, "process.env.VITE_INCLUDE_ALL_COMPONENTS": JSON.stringify("true"), "process.env.VITE_USER_COMPONENTS_Inspect": JSON.stringify("true") }) }));
|
|
47
41
|
// server.
|
|
48
42
|
if (!server.httpServer) {
|
|
49
43
|
throw new Error("HTTP server not available");
|
|
@@ -44,7 +44,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
45
|
exports.default = viteXmluiPlugin;
|
|
46
46
|
const pluginutils_1 = require("@rollup/pluginutils");
|
|
47
|
-
const code_behind_collect_1 = require("../src/parsers/scripting/code-behind-collect");
|
|
47
|
+
const code_behind_collect_1 = require("../src/parsers/scripting-exp/code-behind-collect");
|
|
48
48
|
const fileExtensions_1 = require("../src/parsers/xmlui-parser/fileExtensions");
|
|
49
49
|
const Parser_1 = require("../src/parsers/scripting/Parser");
|
|
50
50
|
const fs = __importStar(require("fs"));
|
|
@@ -109,7 +109,7 @@ function viteXmluiPlugin(pluginOptions = {}) {
|
|
|
109
109
|
const moduleName = hasXmluiScriptExtension
|
|
110
110
|
? id.substring(0, id.length - (fileExtensions_1.codeBehindFileExtension.length + 1))
|
|
111
111
|
: id.substring(0, id.length - (fileExtensions_1.moduleFileExtension.length + 1));
|
|
112
|
-
const codeBehind = (0, code_behind_collect_1.collectCodeBehindFromSource)(moduleNameResolver(moduleName), code
|
|
112
|
+
const codeBehind = (0, code_behind_collect_1.collectCodeBehindFromSource)(moduleNameResolver(moduleName), code);
|
|
113
113
|
(0, code_behind_collect_1.removeCodeBehindTokensFromTree)(codeBehind);
|
|
114
114
|
// TODO: Add error handling.
|
|
115
115
|
// Check, if codeBehind.moduleErrors is not empty (Record<string, ModuleErrors[]>); each module
|
|
@@ -32,6 +32,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
35
44
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
45
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
46
|
};
|
|
@@ -43,72 +52,89 @@ const vite_plugin_svgr_1 = __importDefault(require("vite-plugin-svgr"));
|
|
|
43
52
|
const vite_plugin_yaml_1 = __importDefault(require("@modyfi/vite-plugin-yaml"));
|
|
44
53
|
const vite_xmlui_plugin_1 = __importDefault(require("./vite-xmlui-plugin"));
|
|
45
54
|
const path = __importStar(require("path"));
|
|
46
|
-
function getViteConfig(
|
|
47
|
-
return (0,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
55
|
+
function getViteConfig() {
|
|
56
|
+
return __awaiter(this, arguments, void 0, function* ({ flatDist = false, withRelativeRoot = false, flatDistUiPrefix = "", } = {}) {
|
|
57
|
+
var _a;
|
|
58
|
+
//TODO finish this (merge smart)
|
|
59
|
+
let overrides = {};
|
|
60
|
+
try {
|
|
61
|
+
const configOverrides = yield Promise.resolve(`${process.cwd() + `/vite.config-overrides`}`).then(s => __importStar(require(s)));
|
|
62
|
+
overrides = configOverrides.default || {};
|
|
63
|
+
}
|
|
64
|
+
catch (e) { }
|
|
65
|
+
return (0, vite_1.defineConfig)({
|
|
66
|
+
plugins: [(0, plugin_react_1.default)(), (0, vite_plugin_svgr_1.default)(), (0, vite_plugin_yaml_1.default)(), (0, vite_xmlui_plugin_1.default)({}), ...(overrides.plugins || [])],
|
|
67
|
+
base: withRelativeRoot ? "" : undefined,
|
|
68
|
+
// experimental: {
|
|
69
|
+
// renderBuiltUrl: (filename, {type, hostType, hostId}) =>{
|
|
70
|
+
// if (type === 'asset') {
|
|
71
|
+
// // return { runtime: `window.__toCdnUrl(${JSON.stringify(filename)})` }
|
|
72
|
+
// return 'https://static.themohoz.com/xmlui/v0.31/' + filename
|
|
73
|
+
// } else {
|
|
74
|
+
// return { relative: true }
|
|
75
|
+
// }
|
|
76
|
+
// }
|
|
77
|
+
// },
|
|
78
|
+
define: overrides.define,
|
|
79
|
+
resolve: {
|
|
80
|
+
alias: (_a = overrides.resolve) === null || _a === void 0 ? void 0 : _a.alias,
|
|
81
|
+
},
|
|
82
|
+
css: overrides.css,
|
|
83
|
+
build: {
|
|
84
|
+
rollupOptions: {
|
|
85
|
+
input: path.resolve(process.cwd(), "index.html"),
|
|
86
|
+
output: {
|
|
87
|
+
assetFileNames: (assetInfo) => {
|
|
88
|
+
var _a;
|
|
89
|
+
const extType = (_a = assetInfo.name) === null || _a === void 0 ? void 0 : _a.split(".").pop();
|
|
90
|
+
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType)) {
|
|
91
|
+
return flatDist
|
|
92
|
+
? `${flatDistUiPrefix}internal_img_[name].[hash][extname]`
|
|
93
|
+
: `internal/img/[name].[hash][extname]`;
|
|
94
|
+
}
|
|
95
|
+
if (assetInfo.name === "index.css") {
|
|
96
|
+
return flatDist
|
|
97
|
+
? `${flatDistUiPrefix}internal_[name].[hash][extname]`
|
|
98
|
+
: `internal/[name].[hash][extname]`;
|
|
99
|
+
}
|
|
73
100
|
return flatDist
|
|
74
|
-
? `${flatDistUiPrefix}
|
|
75
|
-
: `internal/[name].[hash][extname]`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
? `${flatDistUiPrefix}internal_chunks_[name].[hash]
|
|
79
|
-
:
|
|
101
|
+
? `${flatDistUiPrefix}internal_chunks_[name].[hash][extname]`
|
|
102
|
+
: `internal/chunks/[name].[hash][extname]`;
|
|
103
|
+
},
|
|
104
|
+
chunkFileNames: flatDist
|
|
105
|
+
? `${flatDistUiPrefix}internal_chunks_[name].[hash].js`
|
|
106
|
+
: "internal/chunks/[name].[hash].js",
|
|
107
|
+
entryFileNames: flatDist
|
|
108
|
+
? `${flatDistUiPrefix}internal_[name].[hash].js`
|
|
109
|
+
: "internal/[name].[hash].js",
|
|
80
110
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
111
|
+
// treeshake: {
|
|
112
|
+
// preset: "recommended",
|
|
113
|
+
// moduleSideEffects: (id: string, external: boolean)=>{
|
|
114
|
+
// if(id.includes(path.resolve(process.cwd(), 'index.html'))){ //otherwise tree shaking doesn't work
|
|
115
|
+
// return true;
|
|
116
|
+
// }
|
|
117
|
+
// if(id.includes(path.resolve(process.cwd(), "src", 'main.tsx'))){ //otherwise tree shaking doesn't work
|
|
118
|
+
// return true;
|
|
119
|
+
// }
|
|
120
|
+
// return false;
|
|
121
|
+
// }
|
|
122
|
+
// }
|
|
123
|
+
// assetFileNames: (assetInfo) => {
|
|
124
|
+
// let extType = assetInfo.name?.split(".").pop();
|
|
125
|
+
// if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType!)) {
|
|
126
|
+
// return `img/[name][extname]`;
|
|
127
|
+
// }
|
|
128
|
+
// if (assetInfo.name === "index.css") {
|
|
129
|
+
// return `[name][extname]`;
|
|
130
|
+
// }
|
|
131
|
+
// return `chunks/[name][extname]`;
|
|
132
|
+
// },
|
|
133
|
+
// chunkFileNames: "chunks/[name].js",
|
|
134
|
+
// entryFileNames: "[name].js",
|
|
135
|
+
// },
|
|
85
136
|
},
|
|
86
|
-
// treeshake: {
|
|
87
|
-
// preset: "recommended",
|
|
88
|
-
// moduleSideEffects: (id: string, external: boolean)=>{
|
|
89
|
-
// if(id.includes(path.resolve(process.cwd(), 'index.html'))){ //otherwise tree shaking doesn't work
|
|
90
|
-
// return true;
|
|
91
|
-
// }
|
|
92
|
-
// if(id.includes(path.resolve(process.cwd(), "src", 'main.tsx'))){ //otherwise tree shaking doesn't work
|
|
93
|
-
// return true;
|
|
94
|
-
// }
|
|
95
|
-
// return false;
|
|
96
|
-
// }
|
|
97
|
-
// }
|
|
98
|
-
// assetFileNames: (assetInfo) => {
|
|
99
|
-
// let extType = assetInfo.name?.split(".").pop();
|
|
100
|
-
// if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(extType!)) {
|
|
101
|
-
// return `img/[name][extname]`;
|
|
102
|
-
// }
|
|
103
|
-
// if (assetInfo.name === "index.css") {
|
|
104
|
-
// return `[name][extname]`;
|
|
105
|
-
// }
|
|
106
|
-
// return `chunks/[name][extname]`;
|
|
107
|
-
// },
|
|
108
|
-
// chunkFileNames: "chunks/[name].js",
|
|
109
|
-
// entryFileNames: "[name].js",
|
|
110
|
-
// },
|
|
111
137
|
},
|
|
112
|
-
}
|
|
138
|
+
});
|
|
113
139
|
});
|
|
114
140
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.T_SWITCH_CASE = exports.T_OBJECT_DESTRUCTURE = exports.T_ARRAY_DESTRUCTURE = exports.T_DESTRUCTURE = exports.T_VAR_DECLARATION = exports.T_REACTIVE_VAR_DECLARATION = exports.T_POSTFIX_OP_EXPRESSION = exports.T_PREFIX_OP_EXPRESSION = exports.T_ARROW_EXPRESSION = exports.T_NO_ARG_EXPRESSION = exports.T_ASSIGNMENT_EXPRESSION = exports.T_SPREAD_EXPRESSION = exports.T_OBJECT_LITERAL = exports.T_ARRAY_LITERAL = exports.T_LITERAL = exports.T_TEMPLATE_LITERAL_EXPRESSION = exports.T_IDENTIFIER = exports.T_CALCULATED_MEMBER_ACCESS_EXPRESSION = exports.T_MEMBER_ACCESS_EXPRESSION = exports.T_FUNCTION_INVOCATION_EXPRESSION = exports.T_CONDITIONAL_EXPRESSION = exports.T_SEQUENCE_EXPRESSION = exports.T_BINARY_EXPRESSION = exports.T_UNARY_EXPRESSION = exports.
|
|
3
|
+
exports.T_SWITCH_CASE = exports.T_OBJECT_DESTRUCTURE = exports.T_ARRAY_DESTRUCTURE = exports.T_DESTRUCTURE = exports.T_VAR_DECLARATION = exports.T_REACTIVE_VAR_DECLARATION = exports.T_POSTFIX_OP_EXPRESSION = exports.T_PREFIX_OP_EXPRESSION = exports.T_ARROW_EXPRESSION = exports.T_NO_ARG_EXPRESSION = exports.T_ASSIGNMENT_EXPRESSION = exports.T_SPREAD_EXPRESSION = exports.T_OBJECT_LITERAL = exports.T_ARRAY_LITERAL = exports.T_LITERAL = exports.T_TEMPLATE_LITERAL_EXPRESSION = exports.T_IDENTIFIER = exports.T_CALCULATED_MEMBER_ACCESS_EXPRESSION = exports.T_MEMBER_ACCESS_EXPRESSION = exports.T_FUNCTION_INVOCATION_EXPRESSION = exports.T_CONDITIONAL_EXPRESSION = exports.T_SEQUENCE_EXPRESSION = exports.T_BINARY_EXPRESSION = exports.T_UNARY_EXPRESSION = exports.T_FUNCTION_DECLARATION = exports.T_SWITCH_STATEMENT = exports.T_TRY_STATEMENT = exports.T_THROW_STATEMENT = exports.T_FOR_OF_STATEMENT = exports.T_FOR_IN_STATEMENT = exports.T_FOR_STATEMENT = exports.T_DO_WHILE_STATEMENT = exports.T_WHILE_STATEMENT = exports.T_CONTINUE_STATEMENT = exports.T_BREAK_STATEMENT = exports.T_RETURN_STATEMENT = exports.T_IF_STATEMENT = exports.T_VAR_STATEMENT = exports.T_CONST_STATEMENT = exports.T_LET_STATEMENT = exports.T_ARROW_EXPRESSION_STATEMENT = exports.T_EXPRESSION_STATEMENT = exports.T_EMPTY_STATEMENT = exports.T_BLOCK_STATEMENT = void 0;
|
|
4
4
|
// --- Statement node type values
|
|
5
5
|
exports.T_BLOCK_STATEMENT = 1;
|
|
6
6
|
exports.T_EMPTY_STATEMENT = 2;
|
|
@@ -22,7 +22,6 @@ exports.T_THROW_STATEMENT = 17;
|
|
|
22
22
|
exports.T_TRY_STATEMENT = 18;
|
|
23
23
|
exports.T_SWITCH_STATEMENT = 19;
|
|
24
24
|
exports.T_FUNCTION_DECLARATION = 20;
|
|
25
|
-
exports.T_IMPORT_DECLARATION = 21;
|
|
26
25
|
// --- Expression node type values
|
|
27
26
|
exports.T_UNARY_EXPRESSION = 100;
|
|
28
27
|
exports.T_BINARY_EXPRESSION = 101;
|
|
@@ -70,22 +70,12 @@ exports.AccordionMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
70
70
|
[`border-${COMP}`]: "0px solid $borderColor",
|
|
71
71
|
[`width-icon-${COMP}`]: "",
|
|
72
72
|
[`height-icon-${COMP}`]: "",
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
[`color-icon-${COMP}`]: "$color-surface-50",
|
|
80
|
-
},
|
|
81
|
-
dark: {
|
|
82
|
-
[`backgroundColor-header-${COMP}`]: "$color-primary-500",
|
|
83
|
-
[`backgroundColor-header-${COMP}-hover`]: "$color-primary-600",
|
|
84
|
-
[`color-header-${COMP}`]: "$color-surface-50",
|
|
85
|
-
[`color-content-${COMP}`]: "$textColor-primary",
|
|
86
|
-
[`backgroundColor-content-${COMP}`]: "transparent",
|
|
87
|
-
[`color-icon-${COMP}`]: "$color-surface-50",
|
|
88
|
-
},
|
|
73
|
+
[`backgroundColor-header-${COMP}`]: "$color-primary-500",
|
|
74
|
+
[`backgroundColor-header-${COMP}-hover`]: "$color-primary-400",
|
|
75
|
+
[`color-header-${COMP}`]: "$color-surface-50",
|
|
76
|
+
[`color-content-${COMP}`]: "$textColor-primary",
|
|
77
|
+
[`backgroundColor-content-${COMP}`]: "transparent",
|
|
78
|
+
[`color-icon-${COMP}`]: "$color-surface-50",
|
|
89
79
|
},
|
|
90
80
|
});
|
|
91
81
|
exports.accordionComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AccordionMd, ({ node, renderChild, extractValue, lookupEventHandler, registerComponentApi, layoutCss }) => {
|
|
@@ -113,6 +113,10 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
113
113
|
behavior: "instant", // Optional if you want to skip the scrolling animation
|
|
114
114
|
});
|
|
115
115
|
}, [location.pathname]);
|
|
116
|
+
const [subNavPanelSlot, setSubNavPanelSlot] = (0, react_1.useState)(null);
|
|
117
|
+
const registerSubNavPanelSlot = (0, react_1.useCallback)((element) => {
|
|
118
|
+
setSubNavPanelSlot(element);
|
|
119
|
+
}, []);
|
|
116
120
|
const layoutContextValue = (0, react_1.useMemo)(() => {
|
|
117
121
|
return {
|
|
118
122
|
hasRegisteredNavPanel,
|
|
@@ -132,6 +136,8 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
132
136
|
toggleDrawer,
|
|
133
137
|
navPanelDef,
|
|
134
138
|
logoContentDef,
|
|
139
|
+
registerSubNavPanelSlot,
|
|
140
|
+
subNavPanelSlot,
|
|
135
141
|
};
|
|
136
142
|
}, [
|
|
137
143
|
hasRegisteredNavPanel,
|
|
@@ -145,6 +151,8 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
145
151
|
toggleDrawer,
|
|
146
152
|
navPanelDef,
|
|
147
153
|
logoContentDef,
|
|
154
|
+
registerSubNavPanelSlot,
|
|
155
|
+
subNavPanelSlot,
|
|
148
156
|
]);
|
|
149
157
|
(0, react_1.useEffect)(() => {
|
|
150
158
|
if (navPanelVisible) {
|
|
@@ -39,11 +39,7 @@ exports.AppHeaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
39
39
|
"`padding` variants, such as `paddingLeft-logo-AppHeader` and others).",
|
|
40
40
|
[`width‑logo‑${COMP}`]: "Sets the width of the displayed logo",
|
|
41
41
|
},
|
|
42
|
-
defaultThemeVars: Object.assign(Object.assign(Object.assign({ [`height-${COMP}`]: "$space-14", [`maxWidth-content-${COMP}`]: "$maxWidth-content-App", [`borderBottom-${COMP}`]: "1px solid $borderColor" }, (0, base_utils_1.paddingSubject)(`logo-${COMP}`, { horizontal: "$space-0", vertical: "$space-4" })), (0, base_utils_1.paddingSubject)(COMP, { horizontal: "$space-4", vertical: "$space-0" })), { [`borderRadius-${COMP}`]: "0px",
|
|
43
|
-
[`backgroundColor-${COMP}`]: "white",
|
|
44
|
-
}, dark: {
|
|
45
|
-
[`backgroundColor-${COMP}`]: "$color-surface-900",
|
|
46
|
-
} }),
|
|
42
|
+
defaultThemeVars: Object.assign(Object.assign(Object.assign({ [`height-${COMP}`]: "$space-14", [`maxWidth-content-${COMP}`]: "$maxWidth-content-App", [`borderBottom-${COMP}`]: "1px solid $borderColor" }, (0, base_utils_1.paddingSubject)(`logo-${COMP}`, { horizontal: "$space-0", vertical: "$space-4" })), (0, base_utils_1.paddingSubject)(COMP, { horizontal: "$space-4", vertical: "$space-0" })), { [`borderRadius-${COMP}`]: "0px", [`backgroundColor-${COMP}`]: "$color-surface-raised" }),
|
|
47
43
|
});
|
|
48
44
|
exports.appHeaderComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AppHeaderMd, ({ node, renderChild, layoutCss, layoutContext, extractValue }) => {
|
|
49
45
|
var _a, _b;
|
|
@@ -7,6 +7,7 @@ exports.AppHeader = void 0;
|
|
|
7
7
|
exports.useLogoUrl = useLogoUrl;
|
|
8
8
|
exports.AppContextAwareAppHeader = AppContextAwareAppHeader;
|
|
9
9
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
+
const react_1 = require("react");
|
|
10
11
|
const classnames_1 = __importDefault(require("classnames"));
|
|
11
12
|
const AppHeader_module_scss_1 = __importDefault(require("./AppHeader.module.scss"));
|
|
12
13
|
const ThemeContext_1 = require("../../components-core/theming/ThemeContext");
|
|
@@ -17,6 +18,7 @@ const LogoNative_1 = require("../../components/Logo/LogoNative");
|
|
|
17
18
|
const AppLayoutContext_1 = require("../../components/App/AppLayoutContext");
|
|
18
19
|
const ButtonNative_1 = require("../../components/Button/ButtonNative");
|
|
19
20
|
const NavLinkNative_1 = require("../../components/NavLink/NavLinkNative");
|
|
21
|
+
const hooks_1 = require("../../components-core/utils/hooks");
|
|
20
22
|
function tryLoadImage(url, onLoaded, onError) {
|
|
21
23
|
const img = new Image();
|
|
22
24
|
img.src = url;
|
|
@@ -38,21 +40,25 @@ function useLogoUrl() {
|
|
|
38
40
|
const toneLogoUrl = (0, ThemeContext_1.useResourceUrl)(`resource:logo-${activeThemeTone}`) || logoUrlByTone[activeThemeTone];
|
|
39
41
|
return toneLogoUrl || baseLogoUrl;
|
|
40
42
|
}
|
|
41
|
-
const AppHeader = ({ children, profileMenu, style = constants_1.EMPTY_OBJECT, logoContent, className, canRestrictContentWidth, navPanelVisible = true, toggleDrawer, showLogo, hasRegisteredNavPanel, title, titleContent, }) => {
|
|
43
|
+
const AppHeader = ({ children, profileMenu, style = constants_1.EMPTY_OBJECT, logoContent, className, canRestrictContentWidth, navPanelVisible = true, toggleDrawer, showLogo, hasRegisteredNavPanel, title, titleContent, registerSubNavPanelSlot, }) => {
|
|
42
44
|
const { mediaSize } = (0, AppContext_1.useAppContext)();
|
|
43
45
|
const logoUrl = useLogoUrl();
|
|
46
|
+
const subNavPanelSlot = (0, react_1.useRef)(null);
|
|
44
47
|
const safeLogoTitle = mediaSize.sizeIndex < 2 ? null : !titleContent && title ? ((0, jsx_runtime_1.jsx)(NavLinkNative_1.NavLink, { to: "/", displayActive: false, style: { paddingLeft: 0 }, children: title })) : (titleContent);
|
|
48
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
49
|
+
registerSubNavPanelSlot === null || registerSubNavPanelSlot === void 0 ? void 0 : registerSubNavPanelSlot(subNavPanelSlot.current);
|
|
50
|
+
}, []);
|
|
45
51
|
return ((0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(AppHeader_module_scss_1.default.header, className), style: style, children: (0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(AppHeader_module_scss_1.default.headerInner, {
|
|
46
52
|
[AppHeader_module_scss_1.default.full]: !canRestrictContentWidth,
|
|
47
53
|
}), children: [!navPanelVisible && hasRegisteredNavPanel && ((0, jsx_runtime_1.jsx)(ButtonNative_1.Button, { onClick: toggleDrawer, icon: (0, jsx_runtime_1.jsx)(IconNative_1.Icon, { name: "hamburger" }), variant: "ghost", style: { color: "inherit", flexShrink: 0 } })), (0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.logoAndTitle, children: (showLogo || !navPanelVisible) &&
|
|
48
|
-
(logoContent ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.customLogoContainer, children: logoContent }), safeLogoTitle] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!logoUrl && ((0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.logoContainer, children: (0, jsx_runtime_1.jsx)(NavLinkNative_1.NavLink, { to: "/", displayActive: false, style: { padding: 0, height: "100%" }, children: (0, jsx_runtime_1.jsx)(LogoNative_1.Logo, {}) }) })), safeLogoTitle] }))) }), (0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.childrenWrapper, children: children }), profileMenu && (0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.rightItems, children: profileMenu })] }) }));
|
|
54
|
+
(logoContent ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.customLogoContainer, children: logoContent }), safeLogoTitle] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [!!logoUrl && ((0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.logoContainer, children: (0, jsx_runtime_1.jsx)(NavLinkNative_1.NavLink, { to: "/", displayActive: false, style: { padding: 0, height: "100%" }, children: (0, jsx_runtime_1.jsx)(LogoNative_1.Logo, {}) }) })), safeLogoTitle] }))) }), (0, jsx_runtime_1.jsx)("div", { ref: subNavPanelSlot, className: AppHeader_module_scss_1.default.subNavPanelSlot }), (0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.childrenWrapper, children: children }), profileMenu && (0, jsx_runtime_1.jsx)("div", { className: AppHeader_module_scss_1.default.rightItems, children: profileMenu })] }) }));
|
|
49
55
|
};
|
|
50
56
|
exports.AppHeader = AppHeader;
|
|
51
57
|
function AppContextAwareAppHeader({ children, logoContent, profileMenu, style, className, title, titleContent, showLogo = true, renderChild, }) {
|
|
52
58
|
const appLayoutContext = (0, AppLayoutContext_1.useAppLayoutContext)();
|
|
53
|
-
const { navPanelVisible, toggleDrawer, layout, hasRegisteredNavPanel, navPanelDef, logoContentDef, } = appLayoutContext || {};
|
|
59
|
+
const { navPanelVisible, toggleDrawer, layout, hasRegisteredNavPanel, navPanelDef, logoContentDef, registerSubNavPanelSlot, } = appLayoutContext || {};
|
|
54
60
|
// console.log("APP LAYOUT CONTEXT", appLayoutContext);
|
|
55
61
|
const displayLogo = layout !== "vertical" && layout !== "vertical-sticky" && showLogo;
|
|
56
62
|
const canRestrictContentWidth = layout !== "vertical-full-header";
|
|
57
|
-
return ((0, jsx_runtime_1.jsxs)(exports.AppHeader, { hasRegisteredNavPanel: hasRegisteredNavPanel, navPanelVisible: navPanelVisible, toggleDrawer: toggleDrawer, canRestrictContentWidth: canRestrictContentWidth, showLogo: displayLogo, logoContent: logoContent || renderChild(logoContentDef), profileMenu: profileMenu, style: style, className: className, title: title, titleContent: titleContent, children: [(layout === null || layout === void 0 ? void 0 : layout.startsWith("condensed")) && navPanelVisible && ((0, jsx_runtime_1.jsx)("div", { style: { minWidth: 0 }, children: renderChild(navPanelDef) })), children] }));
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)(exports.AppHeader, { hasRegisteredNavPanel: hasRegisteredNavPanel, navPanelVisible: navPanelVisible, toggleDrawer: toggleDrawer, canRestrictContentWidth: canRestrictContentWidth, showLogo: displayLogo, logoContent: logoContent || renderChild(logoContentDef), profileMenu: profileMenu, style: style, className: className, title: title, titleContent: titleContent, registerSubNavPanelSlot: registerSubNavPanelSlot, children: [(layout === null || layout === void 0 ? void 0 : layout.startsWith("condensed")) && navPanelVisible && ((0, jsx_runtime_1.jsx)("div", { style: { minWidth: 0 }, children: renderChild(navPanelDef) })), children] }));
|
|
58
64
|
}
|
|
@@ -9,9 +9,9 @@ const AutoComplete_module_scss_1 = __importDefault(require("../../components/Aut
|
|
|
9
9
|
const ComponentDefs_1 = require("../../abstractions/ComponentDefs");
|
|
10
10
|
const renderers_1 = require("../../components-core/renderers");
|
|
11
11
|
const themeVars_1 = require("../../components-core/theming/themeVars");
|
|
12
|
-
const container_helpers_1 = require("
|
|
13
|
-
const metadata_helpers_1 = require("
|
|
14
|
-
const AutoCompleteNative_1 = require("
|
|
12
|
+
const container_helpers_1 = require("../container-helpers");
|
|
13
|
+
const metadata_helpers_1 = require("../metadata-helpers");
|
|
14
|
+
const AutoCompleteNative_1 = require("./AutoCompleteNative");
|
|
15
15
|
const COMP = "AutoComplete";
|
|
16
16
|
exports.AutoCompleteMd = (0, ComponentDefs_1.createMetadata)({
|
|
17
17
|
description: "This component is a dropdown with a list of options. According to the " +
|
|
@@ -53,26 +53,20 @@ exports.AutoCompleteMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
53
53
|
[`backgroundColor-menu-${COMP}`]: "$backgroundColor-primary",
|
|
54
54
|
[`boxShadow-menu-${COMP}`]: "$boxShadow-md",
|
|
55
55
|
[`borderRadius-menu-${COMP}`]: "$borderRadius",
|
|
56
|
+
[`borderWidth-menu-${COMP}`]: "1px",
|
|
57
|
+
[`borderColor-menu-${COMP}`]: "$borderColor",
|
|
56
58
|
[`backgroundColor-item-${COMP}`]: "$backgroundColor-dropdown-item",
|
|
57
59
|
[`backgroundColor-item-${COMP}--hover`]: "$backgroundColor-dropdown-item--active",
|
|
58
60
|
[`backgroundColor-item-${COMP}--active`]: "$backgroundColor-dropdown-item--active",
|
|
59
61
|
[`minHeight-Input`]: "39px",
|
|
60
|
-
[`backgroundColor
|
|
61
|
-
[`fontSize
|
|
62
|
-
[`paddingHorizontal
|
|
63
|
-
[`paddingVertical
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
[`textColor-badge-${COMP}`]: "$color-surface-50",
|
|
69
|
-
},
|
|
70
|
-
dark: {
|
|
71
|
-
[`backgroundColor-badge${COMP}--hover`]: "$color-primary-600",
|
|
72
|
-
[`backgroundColor-badge${COMP}--active`]: "$color-primary-500",
|
|
73
|
-
[`textColor-badge-${COMP}`]: "$color-surface-50",
|
|
74
|
-
[`textColor-item-${COMP}--disabled`]: "$color-surface-800",
|
|
75
|
-
},
|
|
62
|
+
[`backgroundColor-${COMP}-badge`]: "$color-primary-500",
|
|
63
|
+
[`fontSize-${COMP}-badge`]: "$fontSize-small",
|
|
64
|
+
[`paddingHorizontal-${COMP}-badge`]: "$space-1",
|
|
65
|
+
[`paddingVertical-${COMP}-badge`]: "$space-1",
|
|
66
|
+
[`backgroundColor-${COMP}-badge--hover`]: "$color-primary-400",
|
|
67
|
+
[`backgroundColor-${COMP}-badge--active`]: "$color-primary-500",
|
|
68
|
+
[`textColor-item-${COMP}--disabled`]: "$color-surface-200",
|
|
69
|
+
[`textColor-${COMP}-badge`]: "$const-color-surface-50",
|
|
76
70
|
},
|
|
77
71
|
});
|
|
78
72
|
exports.autoCompleteComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AutoCompleteMd, ({ node, state, updateState, extractValue, renderChild, lookupEventHandler, layoutCss, registerComponentApi, }) => {
|
|
@@ -10,6 +10,8 @@ exports.AutoCompleteContext = (0, react_1.createContext)({
|
|
|
10
10
|
optionRenderer: (option) => (0, jsx_runtime_1.jsx)("div", { children: option.label }),
|
|
11
11
|
inputValue: "",
|
|
12
12
|
options: new Set(),
|
|
13
|
+
open: false,
|
|
14
|
+
setOpen: (open) => { },
|
|
13
15
|
});
|
|
14
16
|
function useAutoComplete() {
|
|
15
17
|
return (0, react_1.useContext)(exports.AutoCompleteContext);
|
|
@@ -150,8 +150,10 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete({ id, initi
|
|
|
150
150
|
optionRenderer,
|
|
151
151
|
options,
|
|
152
152
|
inputValue,
|
|
153
|
+
open,
|
|
154
|
+
setOpen,
|
|
153
155
|
};
|
|
154
|
-
}, [inputValue, multi, optionRenderer, options, toggleOption, value]);
|
|
156
|
+
}, [inputValue, multi, optionRenderer, options, toggleOption, value, open, setOpen]);
|
|
155
157
|
return ((0, jsx_runtime_1.jsx)(AutoCompleteContext_1.AutoCompleteContext.Provider, { value: autoCompleteContextValue, children: (0, jsx_runtime_1.jsx)(OptionTypeProvider_1.default, { Component: SelectNative_1.HiddenOption, children: (0, jsx_runtime_1.jsxs)(OptionContext_1.OptionContext.Provider, { value: optionContextValue, children: [children, (0, jsx_runtime_1.jsx)(ItemWithLabel_1.ItemWithLabel, { ref: forwardedRef, labelPosition: labelPosition, label: label, labelWidth: labelWidth, labelBreak: labelBreak, required: required, enabled: enabled, onFocus: onFocus, onBlur: onBlur, style: style, children: (0, jsx_runtime_1.jsx)(react_popover_1.Popover, { open: open, children: (0, jsx_runtime_1.jsxs)(cmdk_1.Command, { ref: dropdownRef, className: AutoComplete_module_scss_1.default.command, filter: (value, search, keywords) => {
|
|
156
158
|
const extendedValue = value + " " + keywords.join(" ");
|
|
157
159
|
if (extendedValue.toLowerCase().includes(search.toLowerCase()))
|
|
@@ -199,7 +201,7 @@ exports.AutoComplete = (0, react_1.forwardRef)(function AutoComplete({ id, initi
|
|
|
199
201
|
}, style: { height: dropdownHeight }, children: [(0, jsx_runtime_1.jsx)(cmdk_1.CommandEmpty, { children: emptyListNode }), (0, jsx_runtime_1.jsx)(CreatableItem, {}), (0, jsx_runtime_1.jsx)(cmdk_1.CommandGroup, { children: Array.from(options).map(({ value, label, enabled, keywords, labelText }) => ((0, jsx_runtime_1.jsx)(AutoCompleteOption, { value: value, label: label, enabled: enabled, keywords: keywords, labelText: labelText }, value))) })] }) }) }))] }) }) })] }) }) }));
|
|
200
202
|
});
|
|
201
203
|
function CreatableItem() {
|
|
202
|
-
const { value, options, inputValue, onChange } = (0, AutoCompleteContext_1.useAutoComplete)();
|
|
204
|
+
const { value, options, inputValue, onChange, setOpen } = (0, AutoCompleteContext_1.useAutoComplete)();
|
|
203
205
|
const { onOptionAdd } = (0, OptionContext_1.useOption)();
|
|
204
206
|
if (isOptionsExist(options, [{ value: inputValue, label: inputValue }]) ||
|
|
205
207
|
(Array.isArray(value) && (value === null || value === void 0 ? void 0 : value.find((s) => s === inputValue))) ||
|
|
@@ -213,6 +215,7 @@ function CreatableItem() {
|
|
|
213
215
|
const newOption = { value, label: value, enabled: true, labelText: value };
|
|
214
216
|
onOptionAdd(newOption);
|
|
215
217
|
onChange(value);
|
|
218
|
+
setOpen(false);
|
|
216
219
|
}, children: `Create "${inputValue}"` }));
|
|
217
220
|
// For normal creatable
|
|
218
221
|
if (inputValue.length > 0) {
|
|
@@ -222,12 +225,13 @@ function CreatableItem() {
|
|
|
222
225
|
}
|
|
223
226
|
function AutoCompleteOption({ value, label, enabled = true, keywords }) {
|
|
224
227
|
const id = (0, react_1.useId)();
|
|
225
|
-
const { value: selectedValue, onChange, optionRenderer, multi } = (0, AutoCompleteContext_1.useAutoComplete)();
|
|
228
|
+
const { value: selectedValue, onChange, optionRenderer, multi, setOpen } = (0, AutoCompleteContext_1.useAutoComplete)();
|
|
226
229
|
const selected = multi ? selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.includes(value) : selectedValue === value;
|
|
227
230
|
return ((0, jsx_runtime_1.jsxs)(cmdk_1.CommandItem, { id: id, disabled: !enabled, value: `${value}`, className: AutoComplete_module_scss_1.default.autoCompleteOption, onMouseDown: (e) => {
|
|
228
231
|
e.preventDefault();
|
|
229
232
|
e.stopPropagation();
|
|
230
233
|
}, onSelect: () => {
|
|
231
234
|
onChange(value);
|
|
235
|
+
setOpen(false);
|
|
232
236
|
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: [optionRenderer({ label, value }), selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] }, id));
|
|
233
237
|
}
|
|
@@ -39,15 +39,8 @@ exports.AvatarMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
39
39
|
[`boxShadow-${COMP}`]: "inset 0 0 0 1px rgba(4,32,69,0.1)",
|
|
40
40
|
[`textColor-${COMP}`]: "$textColor-secondary",
|
|
41
41
|
[`fontWeight-${COMP}`]: "$fontWeight-bold",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
[`backgroundColor-${COMP}`]: "$color-surface-100",
|
|
45
|
-
},
|
|
46
|
-
dark: {
|
|
47
|
-
[`border-${COMP}`]: "0px solid $color-surface-700",
|
|
48
|
-
[`backgroundColor-${COMP}`]: "$color-surface-800",
|
|
49
|
-
[`borderColor-${COMP}`]: "$color-surface-700",
|
|
50
|
-
},
|
|
42
|
+
[`border-${COMP}`]: "0px solid $color-surface-400A80",
|
|
43
|
+
[`backgroundColor-${COMP}`]: "$color-surface-100",
|
|
51
44
|
},
|
|
52
45
|
});
|
|
53
46
|
exports.avatarComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.AvatarMd, ({ node, extractValue, lookupEventHandler, layoutCss, extractResourceUrl }) => {
|
|
@@ -49,14 +49,8 @@ exports.BadgeMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
49
49
|
[`borderRadius-${COMP}`]: "4px",
|
|
50
50
|
[`fontSize-${COMP}`]: "0.8em",
|
|
51
51
|
[`fontSize-${COMP}-pill`]: "0.8em",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
[`textColor-${COMP}`]: "white",
|
|
55
|
-
},
|
|
56
|
-
dark: {
|
|
57
|
-
[`backgroundColor-${COMP}`]: "rgba($color-secondary-500-rgb, .6)",
|
|
58
|
-
[`textColor-${COMP}`]: "$color-surface-50",
|
|
59
|
-
},
|
|
52
|
+
[`backgroundColor-${COMP}`]: "rgba($color-secondary-500-rgb, .6)",
|
|
53
|
+
[`textColor-${COMP}`]: "$const-color-surface-0",
|
|
60
54
|
},
|
|
61
55
|
});
|
|
62
56
|
exports.badgeComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP, exports.BadgeMd, ({ node, extractValue, renderChild, layoutCss }) => {
|