xmlui 0.7.20 → 0.7.21
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-D3L7dpSV.mjs → apiInterceptorWorker-LRHkKnha.mjs} +1 -1
- package/dist/{grammar.tmLanguage-69iP6c5d.mjs → grammar.tmLanguage-DNepe_jP.mjs} +1 -1
- package/dist/index-5NLXyjX0.mjs +31055 -0
- package/dist/index.css +1 -1
- package/dist/scripts/bin/build-lib.js +1 -1
- package/dist/scripts/bin/index.js +2 -2
- package/dist/scripts/bin/start.js +23 -6
- package/dist/scripts/bin/viteConfig.js +1 -0
- package/dist/scripts/package.json +2 -1
- package/dist/scripts/src/abstractions/ExtensionDefs.js +2 -0
- package/dist/scripts/src/components/ComponentProvider.js +171 -148
- package/dist/scripts/src/components/FormItem/FormItemNative.js +1 -1
- package/dist/scripts/src/components/HtmlTags/HtmlTags.js +33 -0
- package/dist/scripts/src/components/RawHtml/RawHtml.js +39 -0
- package/dist/scripts/src/components/RawHtml/RawHtmlNative.js +13 -0
- package/dist/scripts/src/components/Theme/ThemeNative.js +1 -1
- package/dist/scripts/src/components-core/LoaderComponent.js +1 -1
- package/dist/scripts/src/components-core/RestApiProxy.js +1 -1
- package/dist/scripts/src/components-core/StandaloneApp.js +19 -19
- package/dist/scripts/src/components-core/{StandaloneComponentManager.js → StandaloneExtensionManager.js} +6 -13
- package/dist/scripts/src/components-core/action/APICall.js +1 -1
- package/dist/scripts/src/components-core/loader/PageableLoader.js +4 -4
- package/dist/scripts/src/components-core/{AppRoot.js → rendering/AppContent.js} +60 -145
- package/dist/scripts/src/components-core/rendering/AppRoot.js +55 -0
- package/dist/scripts/src/components-core/rendering/AppWrapper.js +44 -0
- package/dist/scripts/src/components-core/{ComponentBed.js → rendering/ComponentAdapter.js} +8 -8
- package/dist/scripts/src/components-core/rendering/ComponentWrapper.js +147 -0
- package/dist/scripts/src/components-core/rendering/Container.js +576 -0
- package/dist/scripts/src/components-core/rendering/ContainerWrapper.js +82 -0
- package/dist/scripts/src/components-core/{ErrorBoundary.js → rendering/ErrorBoundary.js} +9 -3
- package/dist/scripts/src/components-core/rendering/StateContainer.js +331 -0
- package/dist/scripts/src/components-core/{container → rendering}/buildProxy.js +11 -7
- package/dist/scripts/src/components-core/{container → rendering}/collectFnVarDeps.js +2 -2
- package/dist/scripts/src/components-core/{container → rendering}/reducer.js +3 -0
- package/dist/scripts/src/components-core/rendering/renderChild.js +81 -0
- package/dist/scripts/src/index.js +3 -6
- package/dist/scripts/src/parsers/xmlui-parser/transform.js +193 -164
- package/dist/scripts/src/syntax/grammar.tmLanguage.json +1 -1
- package/dist/style.css +1 -1
- package/dist/xmlui-metadata.mjs +4216 -4232
- package/dist/xmlui-metadata.umd.js +16 -16
- package/dist/xmlui-standalone.umd.js +262 -290
- package/dist/xmlui.d.ts +36 -61
- package/dist/xmlui.mjs +1 -1
- package/package.json +2 -1
- package/dist/index-BYjaMGrD.mjs +0 -76804
- package/dist/scripts/src/components/BarChart/BarChart.js +0 -49
- package/dist/scripts/src/components/BarChart/BarChartNative.js +0 -176
- package/dist/scripts/src/components/Map/Map.js +0 -75
- package/dist/scripts/src/components/Map/world_countries.json +0 -45307
- package/dist/scripts/src/components/PieChart/PieChart.js +0 -45
- package/dist/scripts/src/components/PieChart/PieChartNative.js +0 -165
- package/dist/scripts/src/components/chart-color-schemes.js +0 -43
- package/dist/scripts/src/components-core/container/Container.js +0 -1186
- package/dist/scripts/src/components-core/container/ContainerComponentDef.js +0 -15
- /package/dist/scripts/src/components-core/{InvalidComponent.js → rendering/InvalidComponent.js} +0 -0
- /package/dist/scripts/src/components-core/{UnknownComponent.js → rendering/UnknownComponent.js} +0 -0
- /package/dist/scripts/src/components-core/{container → rendering}/valueExtractor.js +0 -0
|
@@ -51,7 +51,7 @@ const buildLib = (_a) => __awaiter(void 0, [_a], void 0, function* ({ watchMode
|
|
|
51
51
|
output: {
|
|
52
52
|
footer: (chunk) => {
|
|
53
53
|
if (chunk.name === "index" && chunk.fileName === umdFileName) {
|
|
54
|
-
return `if(typeof window.xmlui !== "undefined"){window.xmlui.standalone.
|
|
54
|
+
return `if(typeof window.xmlui !== "undefined"){window.xmlui.standalone.registerExtension(window['${env.npm_package_name}']);}`;
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
globals: {
|
|
@@ -75,8 +75,8 @@ switch (script) {
|
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
case "start": {
|
|
78
|
-
const { port, withMock, withLegacyParser } = yargs_1.argv;
|
|
79
|
-
(0, start_1.start)({ port, withMock: getBoolArg(withMock), withLegacyParser: getBoolArg(withLegacyParser) });
|
|
78
|
+
const { port, withMock, withLegacyParser, proxy } = yargs_1.argv;
|
|
79
|
+
(0, start_1.start)({ port, withMock: getBoolArg(withMock), withLegacyParser: getBoolArg(withLegacyParser), proxy });
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
82
|
case "preview": {
|
|
@@ -12,19 +12,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.start = void 0;
|
|
13
13
|
const vite_1 = require("vite");
|
|
14
14
|
const viteConfig_1 = require("./viteConfig");
|
|
15
|
-
const start = (_a) => __awaiter(void 0, [_a], void 0, function* ({ port, withMock = true, withLegacyParser = false }) {
|
|
15
|
+
const start = (_a) => __awaiter(void 0, [_a], void 0, function* ({ port, withMock = true, withLegacyParser = false, proxy, }) {
|
|
16
16
|
console.log("Starting with options:", {
|
|
17
17
|
withMock,
|
|
18
|
-
withLegacyParser
|
|
18
|
+
withLegacyParser,
|
|
19
|
+
withProxy: proxy,
|
|
19
20
|
});
|
|
21
|
+
let proxyDef;
|
|
22
|
+
if (proxy) {
|
|
23
|
+
const splitProxy = proxy.split("->");
|
|
24
|
+
if (splitProxy.length !== 2) {
|
|
25
|
+
console.error("Invalid proxy definition. Example: /api->http://localhost:3000");
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
proxyDef = {
|
|
29
|
+
[splitProxy[0]]: {
|
|
30
|
+
target: splitProxy[1],
|
|
31
|
+
changeOrigin: true,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
20
36
|
try {
|
|
21
37
|
const server = yield (0, vite_1.createServer)(Object.assign(Object.assign({}, (0, viteConfig_1.getViteConfig)({ withLegacyParser })), { server: {
|
|
22
38
|
port,
|
|
39
|
+
proxy: proxyDef,
|
|
23
40
|
}, define: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
"process.env.VITE_BUILD_MODE": JSON.stringify("ALL"),
|
|
42
|
+
"process.env.VITE_DEV_MODE": true,
|
|
43
|
+
"process.env.VITE_STANDALONE": process.env.VITE_STANDALONE,
|
|
44
|
+
"process.env.VITE_MOCK_ENABLED": withMock,
|
|
28
45
|
"process.env.VITE_INCLUDE_ALL_COMPONENTS": JSON.stringify("true"),
|
|
29
46
|
"process.env.VITE_LEGACY_PARSER": withLegacyParser,
|
|
30
47
|
} }));
|
|
@@ -52,6 +52,7 @@ function getViteConfig({ flatDist = false, withRelativeRoot = false, flatDistUiP
|
|
|
52
52
|
"@core": path.resolve(__dirname, "../src/core"),
|
|
53
53
|
"@components-core": path.resolve(__dirname, "../src/components-core"),
|
|
54
54
|
"@components": path.resolve(__dirname, "../src/components"),
|
|
55
|
+
"@parsers": path.resolve(__dirname, "../src/parsers"),
|
|
55
56
|
},
|
|
56
57
|
},
|
|
57
58
|
base: withRelativeRoot ? "" : undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmlui",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.21",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start-test-bed": "cd src/testing/infrastructure && xmlui start",
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"react-textarea-autosize": "8.5.3",
|
|
92
92
|
"react-virtualized-auto-sizer": "1.0.24",
|
|
93
93
|
"react-window": "1.8.10",
|
|
94
|
+
"recharts": "^2.15.1",
|
|
94
95
|
"sass": "1.55.0",
|
|
95
96
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
96
97
|
"shiki": "^1.14.1",
|
|
@@ -77,9 +77,6 @@ const MockLoaderRenderer_1 = require("@components-core/loader/MockLoaderRenderer
|
|
|
77
77
|
const DataLoader_1 = require("@components-core/loader/DataLoader");
|
|
78
78
|
const DatePicker_1 = require("@components/DatePicker/DatePicker");
|
|
79
79
|
const Redirect_1 = require("@components/Redirect/Redirect");
|
|
80
|
-
const PieChart_1 = require("@components/PieChart/PieChart");
|
|
81
|
-
const BarChart_1 = require("@components/BarChart/BarChart");
|
|
82
|
-
const Map_1 = require("@components/Map/Map");
|
|
83
80
|
const Tabs_1 = require("@components/Tabs/Tabs");
|
|
84
81
|
const Bookmark_1 = require("@components/Bookmark/Bookmark");
|
|
85
82
|
const AppState_1 = require("@components/AppState/AppState");
|
|
@@ -108,6 +105,8 @@ const APICall_2 = require("@components/APICall/APICall");
|
|
|
108
105
|
const Option_1 = require("@components/Option/Option");
|
|
109
106
|
const AutoComplete_1 = require("@components/AutoComplete/AutoComplete");
|
|
110
107
|
const Backdrop_1 = require("./Backdrop/Backdrop");
|
|
108
|
+
const RawHtml_1 = require("./RawHtml/RawHtml");
|
|
109
|
+
const HtmlTags_1 = require("./HtmlTags/HtmlTags");
|
|
111
110
|
/**
|
|
112
111
|
* The framework has a specialized component concept, the "property holder
|
|
113
112
|
* component." These components only hold property values but do not render
|
|
@@ -133,12 +132,12 @@ class ComponentRegistry {
|
|
|
133
132
|
* `contributes` argument with information about accompanying (app-specific)
|
|
134
133
|
* components that come with a particular app using the registry.
|
|
135
134
|
* @param contributes Information about the components that come with the app
|
|
136
|
-
* @param
|
|
135
|
+
* @param extensionManager Optional manager object that receives a notification
|
|
137
136
|
* about component registrations
|
|
138
137
|
*/
|
|
139
|
-
constructor(contributes = {},
|
|
140
|
-
var _a, _b, _c
|
|
141
|
-
this.
|
|
138
|
+
constructor(contributes = {}, extensionManager) {
|
|
139
|
+
var _a, _b, _c;
|
|
140
|
+
this.extensionManager = extensionManager;
|
|
142
141
|
// --- The pool of available components
|
|
143
142
|
this.pool = new Map();
|
|
144
143
|
// --- The pool of available theme variable names
|
|
@@ -149,10 +148,39 @@ class ComponentRegistry {
|
|
|
149
148
|
this.actionFns = new Map();
|
|
150
149
|
// --- The pool of available loader renderers
|
|
151
150
|
this.loaders = new Map();
|
|
151
|
+
this.extensionRegistered = (extension) => {
|
|
152
|
+
extension.components.forEach((c) => {
|
|
153
|
+
if ("type" in c) {
|
|
154
|
+
//we handle just the js components for now
|
|
155
|
+
this.registerComponentRenderer(c, extension.namespace);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
this.registerCoreComponent = (component) => {
|
|
160
|
+
const coreNamespaces = ["#xmlui-core-ns", ""];
|
|
161
|
+
if ("compoundComponentDef" in component) {
|
|
162
|
+
this.registerCompoundComponentRenderer(component, ...coreNamespaces);
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
this.registerComponentRenderer(component, ...coreNamespaces);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
this.registerAppComponent = (component) => {
|
|
169
|
+
const appNamespaces = ["#app-ns", ""];
|
|
170
|
+
if ("compoundComponentDef" in component) {
|
|
171
|
+
this.registerCompoundComponentRenderer(component, ...appNamespaces);
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this.registerComponentRenderer(component, ...appNamespaces);
|
|
175
|
+
}
|
|
176
|
+
};
|
|
152
177
|
// --- Registers a renderable component using its renderer function
|
|
153
178
|
// --- and metadata
|
|
154
|
-
this.registerComponentRenderer = ({ type, renderer, metadata,
|
|
155
|
-
|
|
179
|
+
this.registerComponentRenderer = ({ type, renderer, metadata }, ...namespaces) => {
|
|
180
|
+
const component = { renderer, descriptor: metadata };
|
|
181
|
+
namespaces.forEach((ns) => {
|
|
182
|
+
this.pool.set((ns ? (ns + ".") : "") + type, component);
|
|
183
|
+
});
|
|
156
184
|
if (metadata === null || metadata === void 0 ? void 0 : metadata.themeVars) {
|
|
157
185
|
Object.keys(metadata.themeVars).forEach((key) => this.themeVars.add(key));
|
|
158
186
|
}
|
|
@@ -160,229 +188,227 @@ class ComponentRegistry {
|
|
|
160
188
|
(0, lodash_es_1.merge)(this.defaultThemeVars, metadata === null || metadata === void 0 ? void 0 : metadata.defaultThemeVars);
|
|
161
189
|
}
|
|
162
190
|
};
|
|
163
|
-
this.
|
|
191
|
+
this.extensionManager = extensionManager;
|
|
192
|
+
// we register these first, so that core components with the same name can override them (without namespace)
|
|
193
|
+
(_a = contributes.components) === null || _a === void 0 ? void 0 : _a.forEach((renderer) => {
|
|
194
|
+
this.registerAppComponent(renderer);
|
|
195
|
+
});
|
|
196
|
+
(_b = contributes.compoundComponents) === null || _b === void 0 ? void 0 : _b.forEach((def) => {
|
|
197
|
+
this.registerAppComponent({ compoundComponentDef: def });
|
|
198
|
+
});
|
|
164
199
|
if (process.env.VITE_USED_COMPONENTS_Stack !== "false") {
|
|
165
|
-
this.
|
|
166
|
-
this.
|
|
167
|
-
this.
|
|
168
|
-
this.
|
|
169
|
-
this.
|
|
170
|
-
}
|
|
171
|
-
this.
|
|
172
|
-
this.
|
|
173
|
-
this.
|
|
174
|
-
this.
|
|
200
|
+
this.registerCoreComponent(Stack_1.stackComponentRenderer);
|
|
201
|
+
this.registerCoreComponent(Stack_1.vStackComponentRenderer);
|
|
202
|
+
this.registerCoreComponent(Stack_1.hStackComponentRenderer);
|
|
203
|
+
this.registerCoreComponent(Stack_1.cvStackComponentRenderer);
|
|
204
|
+
this.registerCoreComponent(Stack_1.chStackComponentRenderer);
|
|
205
|
+
}
|
|
206
|
+
this.registerCoreComponent(Slot_1.SlotHolder);
|
|
207
|
+
this.registerCoreComponent(dataSourcePropHolder);
|
|
208
|
+
this.registerCoreComponent(textNodePropHolder);
|
|
209
|
+
this.registerCoreComponent(textNodeCDataPropHolder);
|
|
175
210
|
if (process.env.VITE_USED_COMPONENTS_SpaceFiller !== "false") {
|
|
176
|
-
this.
|
|
211
|
+
this.registerCoreComponent(SpaceFiller_1.spaceFillerComponentRenderer);
|
|
177
212
|
}
|
|
178
213
|
if (process.env.VITE_USED_COMPONENTS_Textarea !== "false") {
|
|
179
|
-
this.
|
|
214
|
+
this.registerCoreComponent(TextArea_1.textAreaComponentRenderer);
|
|
180
215
|
}
|
|
181
216
|
if (process.env.VITE_USED_COMPONENTS_AppHeader !== "false") {
|
|
182
|
-
this.
|
|
217
|
+
this.registerCoreComponent(AppHeader_1.appHeaderComponentRenderer);
|
|
183
218
|
}
|
|
184
219
|
if (process.env.VITE_USED_COMPONENTS_Footer !== "false") {
|
|
185
|
-
this.
|
|
220
|
+
this.registerCoreComponent(Footer_1.footerRenderer);
|
|
186
221
|
}
|
|
187
222
|
if (process.env.VITE_USED_COMPONENTS_Logo !== "false") {
|
|
188
|
-
this.
|
|
223
|
+
this.registerCoreComponent(Logo_1.logoComponentRenderer);
|
|
189
224
|
}
|
|
190
225
|
if (process.env.VITE_USED_COMPONENTS_NavLink !== "false") {
|
|
191
|
-
this.
|
|
226
|
+
this.registerCoreComponent(NavLink_1.navLinkComponentRenderer);
|
|
192
227
|
}
|
|
193
228
|
if (process.env.VITE_USED_COMPONENTS_NavGroup !== "false") {
|
|
194
|
-
this.
|
|
229
|
+
this.registerCoreComponent(NavGroup_1.navGroupComponentRenderer);
|
|
195
230
|
}
|
|
196
231
|
if (process.env.VITE_USED_COMPONENTS_Link !== "false") {
|
|
197
|
-
this.
|
|
232
|
+
this.registerCoreComponent(Link_1.localLinkComponentRenderer);
|
|
198
233
|
}
|
|
199
234
|
if (process.env.VITE_USED_COMPONENTS_Form !== "false") {
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
235
|
+
this.registerCoreComponent(Form_1.formComponentRenderer);
|
|
236
|
+
this.registerCoreComponent(FormItem_1.formItemComponentRenderer);
|
|
202
237
|
}
|
|
203
238
|
if (process.env.VITE_USED_COMPONENTS_Tree !== "false") {
|
|
204
|
-
this.
|
|
239
|
+
this.registerCoreComponent(TreeComponent_1.treeComponentRenderer);
|
|
205
240
|
}
|
|
206
241
|
if (process.env.VITE_USED_COMPONENTS_Button !== "false") {
|
|
207
|
-
this.
|
|
242
|
+
this.registerCoreComponent(Button_1.buttonComponentRenderer);
|
|
208
243
|
}
|
|
209
244
|
if (process.env.VITE_USED_COMPONENTS_Checkbox !== "false") {
|
|
210
|
-
this.
|
|
245
|
+
this.registerCoreComponent(Checkbox_1.checkboxComponentRenderer);
|
|
211
246
|
}
|
|
212
247
|
if (process.env.VITE_USED_COMPONENTS_Switch !== "false") {
|
|
213
|
-
this.
|
|
248
|
+
this.registerCoreComponent(Switch_1.switchComponentRenderer);
|
|
214
249
|
}
|
|
215
250
|
if (process.env.VITE_USED_COMPONENTS_Heading !== "false") {
|
|
216
|
-
this.
|
|
217
|
-
this.
|
|
218
|
-
this.
|
|
219
|
-
this.
|
|
220
|
-
this.
|
|
221
|
-
this.
|
|
222
|
-
this.
|
|
251
|
+
this.registerCoreComponent(Heading_1.headingComponentRenderer);
|
|
252
|
+
this.registerCoreComponent(Heading_1.h1ComponentRenderer);
|
|
253
|
+
this.registerCoreComponent(Heading_1.h2ComponentRenderer);
|
|
254
|
+
this.registerCoreComponent(Heading_1.h3ComponentRenderer);
|
|
255
|
+
this.registerCoreComponent(Heading_1.h4ComponentRenderer);
|
|
256
|
+
this.registerCoreComponent(Heading_1.h5ComponentRenderer);
|
|
257
|
+
this.registerCoreComponent(Heading_1.h6ComponentRenderer);
|
|
223
258
|
}
|
|
224
259
|
if (process.env.VITE_USED_COMPONENTS_Text !== "false") {
|
|
225
|
-
this.
|
|
260
|
+
this.registerCoreComponent(Text_1.textComponentRenderer);
|
|
226
261
|
}
|
|
227
262
|
if (process.env.VITE_USED_COMPONENTS_Fragment !== "false") {
|
|
228
|
-
this.
|
|
263
|
+
this.registerCoreComponent(Fragment_1.fragmentComponentRenderer);
|
|
229
264
|
}
|
|
230
265
|
if (process.env.VITE_USED_COMPONENTS_Table !== "false") {
|
|
231
|
-
this.
|
|
232
|
-
this.
|
|
266
|
+
this.registerCoreComponent(Table_1.tableComponentRenderer);
|
|
267
|
+
this.registerCoreComponent(Column_1.columnComponentRenderer);
|
|
233
268
|
}
|
|
234
269
|
if (process.env.VITE_USED_COMPONENTS_List !== "false") {
|
|
235
|
-
this.
|
|
270
|
+
this.registerCoreComponent(List_1.dynamicHeightListComponentRenderer);
|
|
236
271
|
}
|
|
237
272
|
if (process.env.VITE_USED_COMPONENTS_App !== "false") {
|
|
238
|
-
this.
|
|
273
|
+
this.registerCoreComponent(App_1.appRenderer);
|
|
239
274
|
}
|
|
240
275
|
if (process.env.VITE_USED_COMPONENTS_NavPanel !== "false") {
|
|
241
|
-
this.
|
|
276
|
+
this.registerCoreComponent(NavPanel_1.navPanelRenderer);
|
|
242
277
|
}
|
|
243
278
|
if (process.env.VITE_USED_COMPONENTS_Pages !== "false") {
|
|
244
|
-
this.
|
|
245
|
-
this.
|
|
279
|
+
this.registerCoreComponent(Pages_1.pagesRenderer);
|
|
280
|
+
this.registerCoreComponent(Pages_1.pageRenderer);
|
|
246
281
|
}
|
|
247
282
|
if (process.env.VITE_USED_COMPONENTS_Redirect !== "false") {
|
|
248
|
-
this.
|
|
283
|
+
this.registerCoreComponent(Redirect_1.redirectRenderer);
|
|
249
284
|
}
|
|
250
285
|
if (process.env.VITE_USED_COMPONENTS_StickyBox !== "false") {
|
|
251
|
-
this.
|
|
286
|
+
this.registerCoreComponent(StickyBox_1.stickyBoxComponentRenderer);
|
|
252
287
|
}
|
|
253
288
|
if (process.env.VITE_USED_COMPONENTS_Badge !== "false") {
|
|
254
|
-
this.
|
|
289
|
+
this.registerCoreComponent(Badge_1.badgeComponentRenderer);
|
|
255
290
|
}
|
|
256
291
|
if (process.env.VITE_USED_COMPONENTS_Avatar !== "false") {
|
|
257
|
-
this.
|
|
292
|
+
this.registerCoreComponent(Avatar_1.avatarComponentRenderer);
|
|
258
293
|
}
|
|
259
294
|
if (process.env.VITE_USED_COMPONENTS_ContentSeparator !== "false") {
|
|
260
|
-
this.
|
|
295
|
+
this.registerCoreComponent(ContentSeparator_1.contentSeparatorComponentRenderer);
|
|
261
296
|
}
|
|
262
297
|
if (process.env.VITE_USED_COMPONENTS_Card !== "false") {
|
|
263
|
-
this.
|
|
298
|
+
this.registerCoreComponent(Card_1.cardComponentRenderer);
|
|
264
299
|
}
|
|
265
300
|
if (process.env.VITE_USED_COMPONENTS_FlowLayout !== "false") {
|
|
266
|
-
this.
|
|
301
|
+
this.registerCoreComponent(FlowLayout_1.flowLayoutComponentRenderer);
|
|
267
302
|
}
|
|
268
303
|
if (process.env.VITE_USED_COMPONENTS_ModalDialog !== "false") {
|
|
269
|
-
this.
|
|
304
|
+
this.registerCoreComponent(ModalDialog_1.modalViewComponentRenderer);
|
|
270
305
|
}
|
|
271
306
|
if (process.env.VITE_USED_COMPONENTS_NoResult !== "false") {
|
|
272
|
-
this.
|
|
307
|
+
this.registerCoreComponent(NoResult_1.noResultComponentRenderer);
|
|
273
308
|
}
|
|
274
309
|
if (process.env.VITE_USED_COMPONENTS_Option !== "false") {
|
|
275
|
-
this.
|
|
310
|
+
this.registerCoreComponent(Option_1.optionComponentRenderer);
|
|
276
311
|
}
|
|
277
312
|
if (process.env.VITE_USED_COMPONENTS_TabItem !== "false") {
|
|
278
|
-
this.
|
|
313
|
+
this.registerCoreComponent(TabItem_1.tabItemComponentRenderer);
|
|
279
314
|
}
|
|
280
315
|
if (process.env.VITE_USED_COMPONENTS_AccordionItem !== "false") {
|
|
281
|
-
this.
|
|
316
|
+
this.registerCoreComponent(AccordionItem_1.accordionItemComponentRenderer);
|
|
282
317
|
}
|
|
283
318
|
if (process.env.VITE_USED_COMPONENTS_CarouselItem !== "false") {
|
|
284
|
-
this.
|
|
319
|
+
this.registerCoreComponent(CarouselItem_1.carouselItemComponentRenderer);
|
|
285
320
|
}
|
|
286
321
|
if (process.env.VITE_USED_COMPONENTS_FileUploadDropZone !== "false") {
|
|
287
|
-
this.
|
|
322
|
+
this.registerCoreComponent(FileUploadDropZone_1.fileUploadDropZoneComponentRenderer);
|
|
288
323
|
}
|
|
289
324
|
if (process.env.VITE_USED_COMPONENTS_Icon !== "false") {
|
|
290
|
-
this.
|
|
325
|
+
this.registerCoreComponent(Icon_1.iconComponentRenderer);
|
|
291
326
|
}
|
|
292
327
|
if (process.env.VITE_USED_COMPONENTS_Items !== "false") {
|
|
293
|
-
this.
|
|
328
|
+
this.registerCoreComponent(Items_1.itemsComponentRenderer);
|
|
294
329
|
}
|
|
295
330
|
if (process.env.VITE_USED_COMPONENTS_SelectionStore !== "false") {
|
|
296
|
-
this.
|
|
331
|
+
this.registerCoreComponent(SelectionStore_1.selectionStoreComponentRenderer);
|
|
297
332
|
}
|
|
298
333
|
if (process.env.VITE_USED_COMPONENTS_Image !== "false") {
|
|
299
|
-
this.
|
|
334
|
+
this.registerCoreComponent(Image_1.imageComponentRenderer);
|
|
300
335
|
}
|
|
301
336
|
if (process.env.VITE_USER_COMPONENTS_XmluiCodeHightlighter !== "false") {
|
|
302
|
-
this.
|
|
337
|
+
this.registerCoreComponent(XmluiCodeHighlighter_1.codeComponentRenderer);
|
|
303
338
|
}
|
|
304
339
|
if (process.env.VITE_USER_COMPONENTS_Markdown !== "false") {
|
|
305
|
-
this.
|
|
340
|
+
this.registerCoreComponent(Markdown_1.markdownComponentRenderer);
|
|
306
341
|
}
|
|
307
342
|
if (process.env.VITE_INCLUDE_REST_COMPONENTS !== "false") {
|
|
308
343
|
//TODO, if it proves to be a working solution, make these components skippable, too
|
|
309
|
-
this.
|
|
310
|
-
this.
|
|
311
|
-
this.
|
|
312
|
-
this.
|
|
313
|
-
this.
|
|
314
|
-
this.
|
|
315
|
-
this.
|
|
316
|
-
this.
|
|
317
|
-
this.
|
|
318
|
-
this.
|
|
319
|
-
this.
|
|
320
|
-
this.
|
|
321
|
-
this.
|
|
322
|
-
this.
|
|
323
|
-
this.
|
|
324
|
-
this.
|
|
325
|
-
this.
|
|
326
|
-
this.
|
|
327
|
-
this.
|
|
328
|
-
this.
|
|
329
|
-
this.
|
|
330
|
-
this.
|
|
331
|
-
this.
|
|
332
|
-
this.
|
|
333
|
-
this.
|
|
334
|
-
this.
|
|
335
|
-
this.
|
|
336
|
-
this.
|
|
337
|
-
this.
|
|
338
|
-
this.
|
|
339
|
-
this.
|
|
340
|
-
this.
|
|
341
|
-
}
|
|
342
|
-
this.
|
|
343
|
-
this.
|
|
344
|
-
this.
|
|
344
|
+
this.registerCoreComponent(PageMetaTitle_1.pageMetaTitleComponentRenderer);
|
|
345
|
+
this.registerCoreComponent(ProgressBar_1.progressBarComponentRenderer);
|
|
346
|
+
this.registerCoreComponent(Splitter_1.splitterComponentRenderer);
|
|
347
|
+
this.registerCoreComponent(Splitter_1.vSplitterComponentRenderer);
|
|
348
|
+
this.registerCoreComponent(Splitter_1.hSplitterComponentRenderer);
|
|
349
|
+
this.registerCoreComponent(Queue_1.queueComponentRenderer);
|
|
350
|
+
this.registerCoreComponent(PositionedContainer_1.positionedContainerComponentRenderer);
|
|
351
|
+
this.registerCoreComponent(ChangeListener_1.changeListenerComponentRenderer);
|
|
352
|
+
this.registerCoreComponent(RealTimeAdapter_1.realTimeAdapterComponentRenderer);
|
|
353
|
+
this.registerCoreComponent(TextBox_1.textBoxComponentRenderer);
|
|
354
|
+
this.registerCoreComponent(TextBox_1.passwordInputComponentRenderer);
|
|
355
|
+
this.registerCoreComponent(EmojiSelector_1.emojiSelectorRenderer);
|
|
356
|
+
this.registerCoreComponent(NumberBox_1.numberBoxComponentRenderer);
|
|
357
|
+
this.registerCoreComponent(HoverCard_1.hoverCardComponentRenderer);
|
|
358
|
+
this.registerCoreComponent(RadioGroup_1.radioGroupRenderer);
|
|
359
|
+
this.registerCoreComponent(FileInput_1.fileInputRenderer);
|
|
360
|
+
this.registerCoreComponent(DatePicker_1.datePickerComponentRenderer);
|
|
361
|
+
this.registerCoreComponent(Spinner_1.spinnerComponentRenderer);
|
|
362
|
+
this.registerCoreComponent(Select_1.selectComponentRenderer);
|
|
363
|
+
this.registerCoreComponent(AutoComplete_1.autoCompleteComponentRenderer);
|
|
364
|
+
this.registerCoreComponent(DropdownMenu_1.dropdownMenuComponentRenderer);
|
|
365
|
+
this.registerCoreComponent(ThemeChanger_1.themeChangerButtonComponentRenderer);
|
|
366
|
+
this.registerCoreComponent(ToneChangerButton_1.toneChangerButtonComponentRenderer);
|
|
367
|
+
this.registerCoreComponent(FormSection_1.formSectionRenderer);
|
|
368
|
+
this.registerCoreComponent(DropdownMenu_1.dropdownMenuComponentRenderer);
|
|
369
|
+
this.registerCoreComponent(DropdownMenu_1.menuItemRenderer);
|
|
370
|
+
this.registerCoreComponent(DropdownMenu_1.subMenuItemRenderer);
|
|
371
|
+
this.registerCoreComponent(DropdownMenu_1.menuSeparatorRenderer);
|
|
372
|
+
this.registerCoreComponent(Tabs_1.tabsComponentRenderer);
|
|
373
|
+
this.registerCoreComponent(Bookmark_1.bookmarkComponentRenderer);
|
|
374
|
+
this.registerCoreComponent(TableOfContents_1.tableOfContentsRenderer);
|
|
375
|
+
this.registerCoreComponent(Breakout_1.breakoutComponentRenderer);
|
|
376
|
+
}
|
|
377
|
+
this.registerCoreComponent(Theme_1.themeComponentRenderer);
|
|
378
|
+
this.registerCoreComponent(AppState_1.appStateComponentRenderer);
|
|
379
|
+
this.registerCoreComponent(APICall_2.apiCallRenderer);
|
|
345
380
|
// --- Added after tabler-clone review
|
|
346
|
-
this.
|
|
347
|
-
this.
|
|
348
|
-
this.
|
|
349
|
-
this.
|
|
350
|
-
this.
|
|
351
|
-
this.
|
|
381
|
+
this.registerCoreComponent(PageHeader_1.pageHeaderRenderer);
|
|
382
|
+
this.registerCoreComponent(TrendLabel_1.trendLabelRenderer);
|
|
383
|
+
this.registerCoreComponent(IconInfoCard_1.iconInfoCardRenderer);
|
|
384
|
+
this.registerCoreComponent(TableHeader_1.tableHeaderRenderer);
|
|
385
|
+
this.registerCoreComponent(Toolbar_1.toolbarRenderer);
|
|
386
|
+
this.registerCoreComponent(ToolbarButton_1.toolbarButtonRenderer);
|
|
352
387
|
// --- New Bootstrap-inspired components
|
|
353
|
-
this.
|
|
354
|
-
this.
|
|
355
|
-
this.
|
|
356
|
-
this.
|
|
357
|
-
this.
|
|
358
|
-
this.
|
|
359
|
-
this.
|
|
360
|
-
this.
|
|
388
|
+
this.registerCoreComponent(Carousel_1.carouselComponentRenderer);
|
|
389
|
+
this.registerCoreComponent(Accordion_1.accordionComponentRenderer);
|
|
390
|
+
this.registerCoreComponent(Alert_1.alertComponentRenderer);
|
|
391
|
+
this.registerCoreComponent(OffCanvas_1.offCanvasComponentRenderer);
|
|
392
|
+
this.registerCoreComponent(Range_1.rangeComponentRenderer);
|
|
393
|
+
this.registerCoreComponent(Slider_1.sliderComponentRenderer);
|
|
394
|
+
this.registerCoreComponent(ButtonGroup_1.buttonGroupComponentRenderer);
|
|
395
|
+
this.registerCoreComponent(Backdrop_1.backdropComponentRenderer);
|
|
396
|
+
this.registerCoreComponent(RawHtml_1.rawHtmlComponentRenderer);
|
|
397
|
+
this.registerCoreComponent(HtmlTags_1.htmlBTagRenderer);
|
|
398
|
+
this.registerCoreComponent(HtmlTags_1.htmlEMTagRenderer);
|
|
361
399
|
if (process.env.VITE_USED_COMPONENTS_Chart !== "false") {
|
|
362
|
-
this.
|
|
363
|
-
this.registerComponentRenderer(PieChart_1.pieChartComponentRenderer);
|
|
364
|
-
this.registerComponentRenderer(BarChart_1.barChartComponentRenderer);
|
|
365
|
-
this.registerComponentRenderer(Map_1.mapComponentRenderer);
|
|
400
|
+
this.registerCoreComponent(Chart_1.chartRenderer);
|
|
366
401
|
}
|
|
367
|
-
(_a = contributes.components) === null || _a === void 0 ? void 0 : _a.forEach((renderer) => {
|
|
368
|
-
this.registerComponentRenderer(renderer);
|
|
369
|
-
});
|
|
370
|
-
(_b = contributes.compoundComponents) === null || _b === void 0 ? void 0 : _b.forEach((def) => {
|
|
371
|
-
this.registerCompoundComponentRenderer({ compoundComponentDef: def });
|
|
372
|
-
});
|
|
373
402
|
this.registerActionFn(APICall_1.apiAction);
|
|
374
403
|
this.registerActionFn(FileDownloadAction_1.downloadAction);
|
|
375
404
|
this.registerActionFn(FileUploadAction_1.uploadAction);
|
|
376
405
|
this.registerActionFn(NavigateAction_1.navigateAction);
|
|
377
406
|
this.registerActionFn(TimedAction_1.timedAction);
|
|
378
|
-
(_c = contributes.actions) === null || _c === void 0 ? void 0 : _c.forEach((actionRenderer) => {
|
|
379
|
-
this.registerActionFn(actionRenderer);
|
|
380
|
-
});
|
|
381
407
|
this.registerLoaderRenderer(ApiLoader_1.apiLoaderRenderer);
|
|
382
408
|
this.registerLoaderRenderer(ExternalDataLoader_1.externalDataLoaderRenderer);
|
|
383
409
|
this.registerLoaderRenderer(MockLoaderRenderer_1.mockLoaderRenderer);
|
|
384
410
|
this.registerLoaderRenderer(DataLoader_1.dataLoaderRenderer);
|
|
385
|
-
(
|
|
411
|
+
(_c = this.extensionManager) === null || _c === void 0 ? void 0 : _c.subscribeToRegistrations(this.extensionRegistered);
|
|
386
412
|
}
|
|
387
413
|
/**
|
|
388
414
|
* All theme variables used by the registered components.
|
|
@@ -447,19 +473,16 @@ class ComponentRegistry {
|
|
|
447
473
|
this.actionFns.get(componentName) !== undefined);
|
|
448
474
|
}
|
|
449
475
|
// --- Registers a compound component using its definition and metadata
|
|
450
|
-
registerCompoundComponentRenderer({ compoundComponentDef, metadata, }) {
|
|
451
|
-
|
|
476
|
+
registerCompoundComponentRenderer({ compoundComponentDef, metadata, }, ...namespaces) {
|
|
477
|
+
const component = {
|
|
478
|
+
type: compoundComponentDef.name,
|
|
452
479
|
renderer: (rendererContext) => {
|
|
453
480
|
return ((0, jsx_runtime_1.jsx)(CompoundComponent_1.CompoundComponent, Object.assign({ api: compoundComponentDef.api, scriptCollected: compoundComponentDef.scriptCollected, compound: compoundComponentDef.component }, rendererContext)));
|
|
454
481
|
},
|
|
455
482
|
isCompoundComponent: true,
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
}
|
|
460
|
-
if (metadata === null || metadata === void 0 ? void 0 : metadata.defaultThemeVars) {
|
|
461
|
-
(0, lodash_es_1.merge)(this.defaultThemeVars, metadata === null || metadata === void 0 ? void 0 : metadata.defaultThemeVars);
|
|
462
|
-
}
|
|
483
|
+
metadata
|
|
484
|
+
};
|
|
485
|
+
this.registerComponentRenderer(component, ...namespaces);
|
|
463
486
|
}
|
|
464
487
|
// --- Registers an action function using its definition
|
|
465
488
|
registerActionFn({ actionName: functionName, actionFn }) {
|
|
@@ -476,7 +499,7 @@ class ComponentRegistry {
|
|
|
476
499
|
*/
|
|
477
500
|
destroy() {
|
|
478
501
|
var _a;
|
|
479
|
-
(_a = this.
|
|
502
|
+
(_a = this.extensionManager) === null || _a === void 0 ? void 0 : _a.unSubscribeFromRegistrations(this.extensionRegistered);
|
|
480
503
|
}
|
|
481
504
|
}
|
|
482
505
|
exports.ComponentRegistry = ComponentRegistry;
|
|
@@ -485,15 +508,15 @@ exports.ComponentRegistry = ComponentRegistry;
|
|
|
485
508
|
* component registry. The component ensures that child components are not
|
|
486
509
|
* rendered before the component registry is initialized.
|
|
487
510
|
*/
|
|
488
|
-
function ComponentProvider({ children, contributes,
|
|
489
|
-
const [componentRegistry, setComponentRegistry] = (0, react_1.useState)(() => new ComponentRegistry(contributes,
|
|
511
|
+
function ComponentProvider({ children, contributes, extensionManager, }) {
|
|
512
|
+
const [componentRegistry, setComponentRegistry] = (0, react_1.useState)(() => new ComponentRegistry(contributes, extensionManager));
|
|
490
513
|
// --- Make sure the component registry is updated when the contributes or
|
|
491
514
|
// --- component manager changes (e.g., due to HMR).
|
|
492
515
|
(0, react_1.useEffect)(() => {
|
|
493
516
|
setComponentRegistry((prev) => {
|
|
494
517
|
prev.destroy();
|
|
495
|
-
return new ComponentRegistry(contributes,
|
|
518
|
+
return new ComponentRegistry(contributes, extensionManager);
|
|
496
519
|
});
|
|
497
|
-
}, [
|
|
520
|
+
}, [extensionManager, contributes]);
|
|
498
521
|
return ((0, jsx_runtime_1.jsx)(ComponentRegistryContext_1.ComponentRegistryContext.Provider, { value: componentRegistry, children: children }));
|
|
499
522
|
}
|
|
@@ -31,7 +31,7 @@ const misc_1 = require("@components-core/utils/misc");
|
|
|
31
31
|
const ItemWithLabel_1 = require("./ItemWithLabel");
|
|
32
32
|
const DatePickerNative_1 = require("@components/DatePicker/DatePickerNative");
|
|
33
33
|
const FormNative_1 = require("@components/Form/FormNative");
|
|
34
|
-
const valueExtractor_1 = require("@components-core/
|
|
34
|
+
const valueExtractor_1 = require("@components-core/rendering/valueExtractor");
|
|
35
35
|
const AutoCompleteNative_1 = require("@components/AutoComplete/AutoCompleteNative");
|
|
36
36
|
const DEFAULT_LABEL_POSITIONS = {
|
|
37
37
|
checkbox: "end",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.htmlCodeTagRenderer = exports.HtmlCodeMd = exports.htmlEMTagRenderer = exports.HtmlEMMd = exports.htmlBTagRenderer = exports.HtmlBMd = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ComponentDefs_1 = require("@abstractions/ComponentDefs");
|
|
6
|
+
const renderers_1 = require("@components-core/renderers");
|
|
7
|
+
exports.HtmlBMd = (0, ComponentDefs_1.createMetadata)({
|
|
8
|
+
status: "experimental",
|
|
9
|
+
description: "This component renders an HTML \`b\` tag.",
|
|
10
|
+
props: {},
|
|
11
|
+
events: {}
|
|
12
|
+
});
|
|
13
|
+
exports.htmlBTagRenderer = (0, renderers_1.createComponentRenderer)("b", exports.HtmlBMd, ({ node, renderChild }) => {
|
|
14
|
+
return (0, jsx_runtime_1.jsx)("b", { children: renderChild(node.children) });
|
|
15
|
+
});
|
|
16
|
+
exports.HtmlEMMd = (0, ComponentDefs_1.createMetadata)({
|
|
17
|
+
status: "experimental",
|
|
18
|
+
description: "This component renders an HTML \`em\` tag.",
|
|
19
|
+
props: {},
|
|
20
|
+
events: {}
|
|
21
|
+
});
|
|
22
|
+
exports.htmlEMTagRenderer = (0, renderers_1.createComponentRenderer)("EM", exports.HtmlEMMd, ({ node, renderChild }) => {
|
|
23
|
+
return (0, jsx_runtime_1.jsx)("em", { children: renderChild(node.children) });
|
|
24
|
+
});
|
|
25
|
+
exports.HtmlCodeMd = (0, ComponentDefs_1.createMetadata)({
|
|
26
|
+
status: "experimental",
|
|
27
|
+
description: "This component renders an HTML \`code\` tag.",
|
|
28
|
+
props: {},
|
|
29
|
+
events: {}
|
|
30
|
+
});
|
|
31
|
+
exports.htmlCodeTagRenderer = (0, renderers_1.createComponentRenderer)("CODE", exports.HtmlCodeMd, ({ node, renderChild }) => {
|
|
32
|
+
return (0, jsx_runtime_1.jsx)("code", { children: renderChild(node.children) });
|
|
33
|
+
});
|