xmlui 0.10.26 → 0.11.2
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/lib/{index-DHXWMb-6.mjs → index-DyhCY6Ga.js} +263 -643
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-TxnkId6_.mjs → initMock-DN7MXrdn.js} +1 -1
- package/dist/lib/{language-server-web-worker.mjs → language-server-web-worker.js} +1 -1
- package/dist/lib/{language-server.mjs → language-server.js} +1 -1
- package/dist/lib/{metadata-utils-DXUdlyja.mjs → metadata-utils-D27cn-XB.js} +1 -1
- package/dist/lib/{server-common-CtpN0Z4h.mjs → server-common-2DaoOOL5.js} +625 -616
- package/dist/lib/testing.d.ts +2011 -0
- package/dist/lib/testing.js +2386 -0
- package/dist/lib/vite-xmlui-plugin/index.js +13968 -0
- package/dist/lib/vite-xmlui-plugin/package.json +3 -0
- package/dist/lib/xmlui-parser-BZZ430Wm.js +523 -0
- package/dist/lib/xmlui-parser.d.ts +2 -1
- package/dist/lib/{xmlui-parser.mjs → xmlui-parser.js} +2 -2
- package/dist/lib/{xmlui-serializer-uCYa8_tZ.mjs → xmlui-serializer-D9D2mQ8m.js} +1 -1
- package/dist/lib/xmlui.d.ts +1 -0
- package/dist/lib/{xmlui.mjs → xmlui.js} +24 -23
- package/dist/metadata/{collectedComponentMetadata-BgHIc2Iu.mjs → collectedComponentMetadata-BNSnCrzh.js} +698 -567
- package/dist/metadata/{initMock-B3UDa-rw.mjs → initMock-CVnDRyRf.js} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/{xmlui-metadata.mjs → xmlui-metadata.js} +1 -1
- package/dist/metadata/xmlui-metadata.umd.cjs +207 -0
- package/dist/scripts/bin/bootstrap.cjs +4 -0
- package/dist/scripts/bin/index.js +85 -13
- package/dist/scripts/package.json +31 -24
- package/dist/scripts/src/components/App/App.spec.js +27 -15
- package/dist/scripts/src/components/Avatar/Avatar.spec.js +0 -29
- package/dist/scripts/src/components/Button/Button.spec.js +0 -29
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +2 -0
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +2 -2
- package/dist/scripts/src/components/Charts/Tooltip/TooltipContent.spec.js +8 -6
- package/dist/scripts/src/components/Form/Form.js +19 -0
- package/dist/scripts/src/components/Form/Form.spec.js +444 -0
- package/dist/scripts/src/components/Form/FormNative.js +46 -15
- package/dist/scripts/src/components/Form/formActions.js +3 -2
- package/dist/scripts/src/components/FormItem/FormItem.js +10 -2
- package/dist/scripts/src/components/FormItem/FormItem.spec.js +159 -0
- package/dist/scripts/src/components/FormItem/FormItemNative.js +6 -5
- package/dist/scripts/src/components/Heading/Heading.spec.js +34 -47
- package/dist/scripts/src/components/Queue/Queue.js +1 -16
- package/dist/scripts/src/components/Queue/QueueNative.js +60 -2
- package/dist/scripts/src/components/TableOfContents/TableOfContents.js +7 -5
- package/dist/scripts/src/components-core/appContext/misc-utils.js +2 -1
- package/dist/scripts/src/components-core/devtools/InspectorDialog.js +2 -2
- package/dist/scripts/src/components-core/script-runner/eval-tree-async.js +2 -0
- package/dist/scripts/src/components-core/utils/base64-utils.js +2 -0
- package/dist/scripts/src/components-core/utils/misc.js +44 -0
- package/dist/scripts/src/language-server/server-common.js +2 -2
- package/dist/scripts/src/language-server/{xmlui-metadata-generated.mjs → xmlui-metadata-generated.js} +625 -615
- package/dist/scripts/src/testing/drivers/index.js +9 -0
- package/dist/scripts/src/testing/index.js +69 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +32 -16
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +46 -39
- package/dist/metadata/xmlui-metadata.umd.js +0 -207
- package/dist/scripts/bin/bootstrap.js +0 -11
- /package/dist/lib/{apiInterceptorWorker-QiltRtq1.mjs → apiInterceptorWorker-QiltRtq1.js} +0 -0
- /package/dist/lib/{syntax-monaco.mjs → syntax-monaco.js} +0 -0
- /package/dist/lib/{syntax-textmate.mjs → syntax-textmate.js} +0 -0
- /package/dist/lib/{transform-Tooy42EB.mjs → transform-Tooy42EB.js} +0 -0
- /package/dist/metadata/{apiInterceptorWorker-Dql7QGw2.mjs → apiInterceptorWorker-Dql7QGw2.js} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -16,15 +15,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
15
|
const build_1 = require("./build");
|
|
17
16
|
const start_1 = require("./start");
|
|
18
17
|
const preview_1 = require("./preview");
|
|
19
|
-
const yargs_1 = require("yargs");
|
|
18
|
+
const yargs_1 = __importDefault(require("yargs/yargs"));
|
|
19
|
+
const helpers_1 = require("yargs/helpers");
|
|
20
20
|
const adm_zip_1 = __importDefault(require("adm-zip"));
|
|
21
21
|
const build_lib_1 = require("./build-lib");
|
|
22
22
|
process.on("unhandledRejection", (err) => {
|
|
23
23
|
throw err;
|
|
24
24
|
});
|
|
25
|
-
const args = process.argv.slice(2);
|
|
26
|
-
const scriptIndex = args.findIndex((x) => x === "build" || x === "eject" || x === "start" || x === "test");
|
|
27
|
-
const script = scriptIndex === -1 ? args[0] : args[scriptIndex];
|
|
28
25
|
function zipDirectory(sourceDir_1) {
|
|
29
26
|
return __awaiter(this, arguments, void 0, function* (sourceDir, outPath = sourceDir) {
|
|
30
27
|
const zip = new adm_zip_1.default();
|
|
@@ -34,7 +31,7 @@ function zipDirectory(sourceDir_1) {
|
|
|
34
31
|
});
|
|
35
32
|
}
|
|
36
33
|
function zipDist(_a) {
|
|
37
|
-
return __awaiter(this, arguments, void 0, function* ({ target = "ui.zip", source = "dist" }) {
|
|
34
|
+
return __awaiter(this, arguments, void 0, function* ({ target = "ui.zip", source = "dist", }) {
|
|
38
35
|
yield zipDirectory(`${process.cwd()}/${source}`, `${process.cwd()}/${target}`);
|
|
39
36
|
});
|
|
40
37
|
}
|
|
@@ -56,9 +53,83 @@ function getStringArg(arg, defaultValue) {
|
|
|
56
53
|
}
|
|
57
54
|
return dedupeArg(arg);
|
|
58
55
|
}
|
|
59
|
-
|
|
56
|
+
const argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
|
|
57
|
+
.command("build", "Build the project", (yargs) => {
|
|
58
|
+
return yargs
|
|
59
|
+
.option("flatDist", {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description: "Create flat distribution",
|
|
62
|
+
})
|
|
63
|
+
.option("prod", {
|
|
64
|
+
type: "boolean",
|
|
65
|
+
description: "Production build",
|
|
66
|
+
})
|
|
67
|
+
.option("buildMode", {
|
|
68
|
+
type: "string",
|
|
69
|
+
description: "Build mode",
|
|
70
|
+
})
|
|
71
|
+
.option("withMock", {
|
|
72
|
+
type: "boolean",
|
|
73
|
+
description: "Include mock data",
|
|
74
|
+
})
|
|
75
|
+
.option("withHostingMetaFiles", {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
description: "Include hosting meta files",
|
|
78
|
+
})
|
|
79
|
+
.option("withRelativeRoot", {
|
|
80
|
+
type: "boolean",
|
|
81
|
+
description: "Use relative root",
|
|
82
|
+
});
|
|
83
|
+
})
|
|
84
|
+
.command("build-lib", "Build library", (yargs) => {
|
|
85
|
+
return yargs
|
|
86
|
+
.option("watch", {
|
|
87
|
+
type: "boolean",
|
|
88
|
+
description: "Watch mode",
|
|
89
|
+
})
|
|
90
|
+
.option("mode", {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Build mode",
|
|
93
|
+
});
|
|
94
|
+
})
|
|
95
|
+
.command("start", "Start development server", (yargs) => {
|
|
96
|
+
return yargs
|
|
97
|
+
.option("port", {
|
|
98
|
+
type: "number",
|
|
99
|
+
description: "Port number",
|
|
100
|
+
})
|
|
101
|
+
.option("withMock", {
|
|
102
|
+
type: "boolean",
|
|
103
|
+
description: "Include mock data",
|
|
104
|
+
})
|
|
105
|
+
.option("proxy", {
|
|
106
|
+
type: "string",
|
|
107
|
+
description: "Proxy target",
|
|
108
|
+
});
|
|
109
|
+
})
|
|
110
|
+
.command("preview", "Preview build", (yargs) => {
|
|
111
|
+
return yargs.option("proxy", {
|
|
112
|
+
type: "string",
|
|
113
|
+
description: "Proxy target",
|
|
114
|
+
});
|
|
115
|
+
})
|
|
116
|
+
.command("zip-dist", "Zip distribution", (yargs) => {
|
|
117
|
+
return yargs
|
|
118
|
+
.option("target", {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "Target zip file",
|
|
121
|
+
})
|
|
122
|
+
.option("source", {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "Source directory",
|
|
125
|
+
});
|
|
126
|
+
})
|
|
127
|
+
.help()
|
|
128
|
+
.parseSync();
|
|
129
|
+
const command = argv._[0];
|
|
130
|
+
switch (command) {
|
|
60
131
|
case "build": {
|
|
61
|
-
const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } =
|
|
132
|
+
const { flatDist, prod, buildMode, withMock, withHostingMetaFiles, withRelativeRoot } = argv;
|
|
62
133
|
(0, build_1.build)({
|
|
63
134
|
buildMode: getStringArg(buildMode, prod ? "CONFIG_ONLY" : undefined),
|
|
64
135
|
withMock: getBoolArg(withMock, prod ? false : undefined),
|
|
@@ -69,27 +140,28 @@ switch (script) {
|
|
|
69
140
|
break;
|
|
70
141
|
}
|
|
71
142
|
case "build-lib": {
|
|
72
|
-
const { watch, mode } =
|
|
143
|
+
const { watch, mode } = argv;
|
|
73
144
|
(0, build_lib_1.buildLib)({ watchMode: getBoolArg(watch, false), mode: getStringArg(mode, "") });
|
|
74
145
|
break;
|
|
75
146
|
}
|
|
76
147
|
case "start": {
|
|
77
|
-
const { port, withMock, proxy } =
|
|
148
|
+
const { port, withMock, proxy } = argv;
|
|
78
149
|
(0, start_1.start)({ port, withMock: getBoolArg(withMock), proxy });
|
|
79
150
|
break;
|
|
80
151
|
}
|
|
81
152
|
case "preview": {
|
|
82
|
-
const { proxy } =
|
|
153
|
+
const { proxy } = argv;
|
|
83
154
|
(0, preview_1.preview)({ proxy });
|
|
84
155
|
break;
|
|
85
156
|
}
|
|
86
157
|
case "zip-dist": {
|
|
87
|
-
const { target, source } =
|
|
158
|
+
const { target, source } = argv;
|
|
88
159
|
zipDist({ target, source });
|
|
89
160
|
break;
|
|
90
161
|
}
|
|
91
162
|
default: {
|
|
92
|
-
console.log('Unknown
|
|
163
|
+
console.log('Unknown command "' + command + '".');
|
|
93
164
|
console.log("Perhaps you need to update xmlui?");
|
|
165
|
+
process.exit(1);
|
|
94
166
|
}
|
|
95
167
|
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmlui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"sideEffects": false,
|
|
5
|
+
"type": "module",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"start-test-bed": "cd src/testing/infrastructure && xmlui start",
|
|
7
8
|
"build:xmlui-test-bed": "cd src/testing/infrastructure && xmlui build --build-mode=INLINE_ALL --withHostingMetaFiles --withMock",
|
|
8
9
|
"build:bin": "tsc -p tsconfig.bin.json",
|
|
9
|
-
"build:xmlui": "vite build --mode lib",
|
|
10
|
+
"build:xmlui": "vite build --mode lib && ncc build bin/vite-xmlui-plugin.ts -o dist/lib/vite-xmlui-plugin",
|
|
10
11
|
"build:xmlui-standalone": "vite build --mode standalone",
|
|
11
12
|
"build:xmlui-metadata": "vite build --mode metadata",
|
|
12
13
|
"test:unit": "vitest run",
|
|
13
|
-
"test:e2e
|
|
14
|
-
"test:e2e-smoke": "playwright test --project smoke",
|
|
15
|
-
"test:e2e-ui": "playwright test --ui",
|
|
14
|
+
"test:e2e": "playwright test",
|
|
16
15
|
"test:e2e-summary": "node scripts/e2e-test-summary.js",
|
|
17
16
|
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
|
|
18
17
|
"prepublishOnly": "clean-package",
|
|
@@ -22,7 +21,7 @@
|
|
|
22
21
|
"generate-all-docs": "npm run build:xmlui-metadata && npm run generate-docs && npm run generate-docs-summaries",
|
|
23
22
|
"export-themes": "npm run build:xmlui-metadata && node scripts/generate-docs/create-theme-files.mjs",
|
|
24
23
|
"generate-docs-with-refresh": "npm run build:xmlui-metadata && npm run generate-docs && npm run generate-docs-summaries",
|
|
25
|
-
"gen:langserver-metadata": "node scripts/get-langserver-metadata.
|
|
24
|
+
"gen:langserver-metadata": "node scripts/get-langserver-metadata.js > src/language-server/xmlui-metadata-generated.js"
|
|
26
25
|
},
|
|
27
26
|
"dependencies": {
|
|
28
27
|
"@eslint-community/regexpp": "4.10.0",
|
|
@@ -100,7 +99,6 @@
|
|
|
100
99
|
"remark-gfm": "^4.0.1",
|
|
101
100
|
"sass": "1.55.0",
|
|
102
101
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
103
|
-
"ts-node": "10.9.1",
|
|
104
102
|
"turndown": "^7.2.0",
|
|
105
103
|
"unist-util-visit": "^5.0.0",
|
|
106
104
|
"use-context-selector": "1.4.1",
|
|
@@ -109,13 +107,13 @@
|
|
|
109
107
|
"vite-plugin-svgr": "4.2.0",
|
|
110
108
|
"vscode-languageserver": "^9.0.1",
|
|
111
109
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
112
|
-
"yargs": "17.7.2"
|
|
110
|
+
"yargs": "17.7.2",
|
|
111
|
+
"tsx": "4.20.6"
|
|
113
112
|
},
|
|
114
113
|
"devDependencies": {
|
|
115
114
|
"@babel/core": "7.19.6",
|
|
116
115
|
"@babel/preset-env": "7.19.4",
|
|
117
116
|
"@babel/preset-typescript": "7.18.6",
|
|
118
|
-
"@playwright/test": "1.53.0",
|
|
119
117
|
"@remix-run/dev": "2.12.1",
|
|
120
118
|
"@remix-run/node": "2.12.1",
|
|
121
119
|
"@remix-run/serve": "2.12.1",
|
|
@@ -140,6 +138,7 @@
|
|
|
140
138
|
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
141
139
|
"eslint-plugin-react": "^7.37.4",
|
|
142
140
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
141
|
+
"ncc": "^0.3.6",
|
|
143
142
|
"prettier": "^3.3.3",
|
|
144
143
|
"rimraf": "6.0.1",
|
|
145
144
|
"rollup-plugin-copy": "^3.5.0",
|
|
@@ -170,27 +169,27 @@
|
|
|
170
169
|
"clean-package": {
|
|
171
170
|
"replace": {
|
|
172
171
|
"bin": {
|
|
173
|
-
"xmlui": "dist/scripts/bin/bootstrap.
|
|
172
|
+
"xmlui": "dist/scripts/bin/bootstrap.cjs"
|
|
174
173
|
},
|
|
175
174
|
"main": "./dist/standalone/xmlui-standalone.umd.js",
|
|
176
|
-
"module": "./dist/lib/xmlui.
|
|
175
|
+
"module": "./dist/lib/xmlui.js",
|
|
177
176
|
"types": "./dist/lib/xmlui.d.ts",
|
|
178
177
|
"exports": {
|
|
179
178
|
".": {
|
|
180
|
-
"import": "./dist/lib/xmlui.
|
|
179
|
+
"import": "./dist/lib/xmlui.js",
|
|
181
180
|
"require": "./dist/standalone/xmlui-standalone.umd.js"
|
|
182
181
|
},
|
|
183
182
|
"./language-server": {
|
|
184
|
-
"import": "./dist/lib/language-server.
|
|
185
|
-
"require": "./dist/lib/language-server.
|
|
183
|
+
"import": "./dist/lib/language-server.js",
|
|
184
|
+
"require": "./dist/lib/language-server.js"
|
|
186
185
|
},
|
|
187
186
|
"./language-server-web-worker": {
|
|
188
|
-
"import": "./dist/lib/language-server-web-worker.
|
|
189
|
-
"require": "./dist/lib/language-server-web-worker.
|
|
187
|
+
"import": "./dist/lib/language-server-web-worker.js",
|
|
188
|
+
"require": "./dist/lib/language-server-web-worker.js"
|
|
190
189
|
},
|
|
191
190
|
"./parser": {
|
|
192
|
-
"import": "./dist/lib/xmlui-parser.
|
|
193
|
-
"require": "./dist/lib/xmlui-parser.
|
|
191
|
+
"import": "./dist/lib/xmlui-parser.js",
|
|
192
|
+
"require": "./dist/lib/xmlui-parser.js"
|
|
194
193
|
},
|
|
195
194
|
"./*.css": {
|
|
196
195
|
"import": "./dist/lib/*.css",
|
|
@@ -205,16 +204,20 @@
|
|
|
205
204
|
"require": "./dist/lib/scss/components-core/theming/_themes.scss"
|
|
206
205
|
},
|
|
207
206
|
"./vite-xmlui-plugin": {
|
|
208
|
-
"import": "./dist/
|
|
209
|
-
"require": "./dist/
|
|
207
|
+
"import": "./dist/lib/vite-xmlui-plugin/index.js",
|
|
208
|
+
"require": "./dist/lib/vite-xmlui-plugin/index.js"
|
|
210
209
|
},
|
|
211
210
|
"./syntax/monaco": {
|
|
212
|
-
"import": "./dist/lib/syntax-monaco.
|
|
213
|
-
"require": "./dist/lib/syntax-monaco.
|
|
211
|
+
"import": "./dist/lib/syntax-monaco.js",
|
|
212
|
+
"require": "./dist/lib/syntax-monaco.js"
|
|
214
213
|
},
|
|
215
214
|
"./syntax/textmate": {
|
|
216
|
-
"import": "./dist/lib/syntax-textmate.
|
|
217
|
-
"require": "./dist/lib/syntax-textmate.
|
|
215
|
+
"import": "./dist/lib/syntax-textmate.js",
|
|
216
|
+
"require": "./dist/lib/syntax-textmate.js"
|
|
217
|
+
},
|
|
218
|
+
"./testing": {
|
|
219
|
+
"import": "./dist/lib/testing.js",
|
|
220
|
+
"require": "./dist/lib/testing.js"
|
|
218
221
|
}
|
|
219
222
|
}
|
|
220
223
|
}
|
|
@@ -255,6 +258,10 @@
|
|
|
255
258
|
"./syntax/textmate": {
|
|
256
259
|
"import": "./src/syntax/textMate/index.ts",
|
|
257
260
|
"require": "./src/syntax/textMate/index.ts"
|
|
261
|
+
},
|
|
262
|
+
"./testing": {
|
|
263
|
+
"import": "./src/testing/index.ts",
|
|
264
|
+
"require": "./src/testing/index.ts"
|
|
258
265
|
}
|
|
259
266
|
},
|
|
260
267
|
"browserslist": {
|
|
@@ -18,21 +18,33 @@ fixtures_1.test.describe("Basic Functionality", () => {
|
|
|
18
18
|
yield initTestBed(`<App name="Test App" testId="app"/>`);
|
|
19
19
|
yield (0, fixtures_1.expect)(page.getByTestId("app")).toBeVisible();
|
|
20
20
|
}));
|
|
21
|
-
(0, fixtures_1.test)("renders with
|
|
22
|
-
yield initTestBed(`<App layout="horizontal"
|
|
23
|
-
yield (0, fixtures_1.expect)(page.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
yield initTestBed(`<App layout="
|
|
27
|
-
yield (0, fixtures_1.expect)(page.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
yield initTestBed(`<App layout="
|
|
31
|
-
yield (0, fixtures_1.expect)(page.
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
yield initTestBed(`<App layout="
|
|
35
|
-
yield (0, fixtures_1.expect)(page.
|
|
21
|
+
(0, fixtures_1.test)("renders with horizontal layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
22
|
+
yield initTestBed(`<App layout="horizontal">test text</App>`);
|
|
23
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
24
|
+
}));
|
|
25
|
+
(0, fixtures_1.test)("renders with horizontal-sticky layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
26
|
+
yield initTestBed(`<App layout="horizontal-sticky">test text</App>`);
|
|
27
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
28
|
+
}));
|
|
29
|
+
(0, fixtures_1.test)("renders with condensed layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
30
|
+
yield initTestBed(`<App layout="condensed">test text</App>`);
|
|
31
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
32
|
+
}));
|
|
33
|
+
(0, fixtures_1.test)("renders with condensed-sticky layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
34
|
+
yield initTestBed(`<App layout="condensed-sticky">test text</App>`);
|
|
35
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
36
|
+
}));
|
|
37
|
+
(0, fixtures_1.test)("renders with vertical layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
38
|
+
yield initTestBed(`<App layout="vertical">test text</App>`);
|
|
39
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
40
|
+
}));
|
|
41
|
+
(0, fixtures_1.test)("renders with vertical-sticky layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
42
|
+
yield initTestBed(`<App layout="vertical-sticky">test text</App>`);
|
|
43
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
44
|
+
}));
|
|
45
|
+
(0, fixtures_1.test)("renders with vertical-full-header layout", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
46
|
+
yield initTestBed(`<App layout="vertical-full-header">test text</App>`);
|
|
47
|
+
yield (0, fixtures_1.expect)(page.getByText("test text")).toBeVisible();
|
|
36
48
|
}));
|
|
37
49
|
(0, fixtures_1.test)("handles layout prop changes correctly", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed, createButtonDriver, }) {
|
|
38
50
|
yield initTestBed(`
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const component_test_helpers_1 = require("../../testing/component-test-helpers");
|
|
13
13
|
const fixtures_1 = require("../../testing/fixtures");
|
|
14
14
|
const abstractions_1 = require("../abstractions");
|
|
15
|
-
const AvatarNative_1 = require("./AvatarNative");
|
|
16
15
|
fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
|
|
17
16
|
(0, fixtures_1.test)("No initials without name", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver }) {
|
|
18
17
|
yield initTestBed(`<Avatar />`);
|
|
@@ -103,34 +102,6 @@ fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
|
|
|
103
102
|
(0, fixtures_1.expect)(widthSm).toBeLessThan(widthMd);
|
|
104
103
|
(0, fixtures_1.expect)(widthMd).toBeLessThan(widthLg);
|
|
105
104
|
}));
|
|
106
|
-
(0, fixtures_1.test)(`invalid size falls back to default ${AvatarNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
|
|
107
|
-
yield initTestBed(`
|
|
108
|
-
<Fragment>
|
|
109
|
-
<Avatar testId="reference" name="Lynn Gilbert" size="${AvatarNative_1.defaultProps.size}" />
|
|
110
|
-
<Avatar testId="invalid" name="Invalid Size" size="invalid"/>
|
|
111
|
-
</Fragment>
|
|
112
|
-
`);
|
|
113
|
-
const driverReference = yield createAvatarDriver("reference");
|
|
114
|
-
const driverInvalid = yield createAvatarDriver("invalid");
|
|
115
|
-
const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(driverReference.component);
|
|
116
|
-
const { width: widthInvalid, height: heightInvalid } = yield (0, component_test_helpers_1.getBounds)(driverInvalid.component);
|
|
117
|
-
yield (0, fixtures_1.expect)(driverInvalid.component).toBeVisible();
|
|
118
|
-
(0, fixtures_1.expect)(widthInvalid).toBe(widthRef);
|
|
119
|
-
(0, fixtures_1.expect)(heightInvalid).toBe(heightRef);
|
|
120
|
-
}));
|
|
121
|
-
(0, fixtures_1.test)(`no size prop defaults to ${AvatarNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
|
|
122
|
-
yield initTestBed(`<Fragment>
|
|
123
|
-
<Avatar testId="reference" name="Lynn Gilbert" size="${AvatarNative_1.defaultProps.size}" />
|
|
124
|
-
<Avatar testId="default" name="Default Size" />
|
|
125
|
-
</Fragment>`);
|
|
126
|
-
const driverReference = yield createAvatarDriver("reference");
|
|
127
|
-
const driverDefault = yield createAvatarDriver("default");
|
|
128
|
-
const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(driverReference.component);
|
|
129
|
-
const { width: widthDefault, height: heightDefault } = yield (0, component_test_helpers_1.getBounds)(driverDefault.component);
|
|
130
|
-
yield (0, fixtures_1.expect)(driverDefault.component).toBeVisible();
|
|
131
|
-
(0, fixtures_1.expect)(widthDefault).toBe(widthRef);
|
|
132
|
-
(0, fixtures_1.expect)(heightDefault).toBe(heightRef);
|
|
133
|
-
}));
|
|
134
105
|
(0, fixtures_1.test)("size property affects font size for initials", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createAvatarDriver, }) {
|
|
135
106
|
// Test that different sizes have appropriately scaled font sizes
|
|
136
107
|
// Test xs size font scaling
|
|
@@ -13,7 +13,6 @@ const component_test_helpers_1 = require("../../testing/component-test-helpers")
|
|
|
13
13
|
const fixtures_1 = require("../../testing/fixtures");
|
|
14
14
|
const abstractions_1 = require("../../components/abstractions");
|
|
15
15
|
const abstractions_2 = require("../abstractions");
|
|
16
|
-
const ButtonNative_1 = require("./ButtonNative");
|
|
17
16
|
// --- Smoke
|
|
18
17
|
fixtures_1.test.describe("smoke tests", { tag: "@smoke" }, () => {
|
|
19
18
|
(0, fixtures_1.test)("component renders", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createButtonDriver }) {
|
|
@@ -380,34 +379,6 @@ abstractions_1.buttonTypeValues.forEach((type) => {
|
|
|
380
379
|
(0, fixtures_1.expect)(heightSm).toBeLessThanOrEqual(heightMd);
|
|
381
380
|
(0, fixtures_1.expect)(heightMd).toBeLessThanOrEqual(heightLg);
|
|
382
381
|
}));
|
|
383
|
-
(0, fixtures_1.test)(`invalid size falls back to default ${ButtonNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
384
|
-
yield initTestBed(`
|
|
385
|
-
<Fragment>
|
|
386
|
-
<Button testId="reference" size="${ButtonNative_1.defaultProps.size}" />
|
|
387
|
-
<Button testId="invalid" size="invalid"/>
|
|
388
|
-
</Fragment>
|
|
389
|
-
`);
|
|
390
|
-
const reference = page.getByTestId("reference");
|
|
391
|
-
const invalid = page.getByTestId("invalid");
|
|
392
|
-
const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(reference);
|
|
393
|
-
const { width: widthInvalid, height: heightInvalid } = yield (0, component_test_helpers_1.getBounds)(invalid);
|
|
394
|
-
yield (0, fixtures_1.expect)(invalid).toBeVisible();
|
|
395
|
-
(0, fixtures_1.expect)(widthInvalid).toBe(widthRef);
|
|
396
|
-
(0, fixtures_1.expect)(heightInvalid).toBe(heightRef);
|
|
397
|
-
}));
|
|
398
|
-
(0, fixtures_1.test)(`no size prop defaults to ${ButtonNative_1.defaultProps.size}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
399
|
-
yield initTestBed(`<Fragment>
|
|
400
|
-
<Button testId="reference" size="${ButtonNative_1.defaultProps.size}" />
|
|
401
|
-
<Button testId="default" />
|
|
402
|
-
</Fragment>`);
|
|
403
|
-
const reference = page.getByTestId("reference");
|
|
404
|
-
const defaultButton = page.getByTestId("default");
|
|
405
|
-
const { width: widthRef, height: heightRef } = yield (0, component_test_helpers_1.getBounds)(reference);
|
|
406
|
-
const { width: widthDefault, height: heightDefault } = yield (0, component_test_helpers_1.getBounds)(defaultButton);
|
|
407
|
-
yield (0, fixtures_1.expect)(defaultButton).toBeVisible();
|
|
408
|
-
(0, fixtures_1.expect)(widthDefault).toBe(widthRef);
|
|
409
|
-
(0, fixtures_1.expect)(heightDefault).toBe(heightRef);
|
|
410
|
-
}));
|
|
411
382
|
(0, fixtures_1.test)("testState initializes to default value", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed }) {
|
|
412
383
|
const getState = (yield initTestBed(`<Fragment />`)).testStateDriver.testState;
|
|
413
384
|
yield fixtures_1.expect.poll(getState).toEqual(null);
|
|
@@ -260,6 +260,7 @@ function BarChart({ data = [], layout = exports.defaultProps.layout, nameKey, st
|
|
|
260
260
|
height: miniMode || hideX ? 0 : xAxisHeight,
|
|
261
261
|
tick: miniMode || hideTickX ? false : { fill: "currentColor", fontSize },
|
|
262
262
|
tickFormatter: miniMode || hideTickX ? undefined : tickFormatterX,
|
|
263
|
+
domain: [0, (dataMax) => dataMax * 1.05],
|
|
263
264
|
}
|
|
264
265
|
: {
|
|
265
266
|
type: "category",
|
|
@@ -292,6 +293,7 @@ function BarChart({ data = [], layout = exports.defaultProps.layout, nameKey, st
|
|
|
292
293
|
tickCount: yTickCount,
|
|
293
294
|
tickFormatter: miniMode || hideTickY ? undefined : tickFormatterY,
|
|
294
295
|
width: miniMode || hideY ? 0 : yAxisWidth,
|
|
296
|
+
domain: [0, (dataMax) => dataMax * 1.1],
|
|
295
297
|
};
|
|
296
298
|
return ((0, jsx_runtime_1.jsxs)(ChartProvider_1.default, { value: chartContextValue, children: [children, (0, jsx_runtime_1.jsx)("div", { ref: labelsRef, style: { position: "absolute", visibility: "hidden", height: 0, overflow: "hidden" }, children: validData
|
|
297
299
|
.map((d) => d[nameKey])
|
|
@@ -123,7 +123,7 @@ exports.LineChart = (0, react_1.forwardRef)(function LineChart({ data, dataKeys
|
|
|
123
123
|
payloadArray.push({
|
|
124
124
|
label: dataKey,
|
|
125
125
|
value: originalPayload[dataKey],
|
|
126
|
-
color: colorValues[index] || colorValues[0]
|
|
126
|
+
color: colorValues[index] || colorValues[0],
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
});
|
|
@@ -181,7 +181,7 @@ exports.LineChart = (0, react_1.forwardRef)(function LineChart({ data, dataKeys
|
|
|
181
181
|
? safeData
|
|
182
182
|
.map((d) => d === null || d === void 0 ? void 0 : d[nameKey])
|
|
183
183
|
.map((label, idx) => ((0, jsx_runtime_1.jsx)("span", { style: { fontSize: 12, whiteSpace: "nowrap" }, children: label }, idx)))
|
|
184
|
-
: null }), (0, jsx_runtime_1.jsx)("div", { ref: forwardedRef, className: (0, classnames_1.default)(className, LineChart_module_scss_1.default.wrapper), style: Object.assign({ flexGrow: 1 }, style), children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { ref: containerRef, width: "100%", height: "100%", minWidth: 60, minHeight: 30, debounce: 100, children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, { accessibilityLayer: true, data: data, margin: miniMode ? { left: 0, right: 0, top: 0, bottom: 0 } : chartMargin, children: [(0, jsx_runtime_1.jsx)(recharts_1.XAxis, { interval: interval, tickLine: false, dataKey: nameKey, angle: tickAngle, textAnchor: tickAnchor, tick: miniMode ? false : !hideTickX && { fill: "currentColor", fontSize }, tickFormatter: miniMode ? undefined : tickFormatterX, height: miniMode || hideX ? 0 : xAxisHeight, hide: miniMode || hideX }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { hide: miniMode || hideY, tickLine: false, tickFormatter: miniMode ? undefined : tickFormatterY, tick: miniMode ? false : !hideTickY && { fill: "currentColor", fontSize } }), !miniMode && !hideTooltip && (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { content: safeTooltipRenderer }), dataKeys.map((dataKey, i) => ((0, jsx_runtime_1.jsx)(recharts_1.Line, { type: "monotone", dataKey: dataKey, name: dataKey, stroke: colorValues[i], strokeWidth: strokeWidth, dot: false }, dataKey))), showLegend && ((0, jsx_runtime_1.jsx)(recharts_1.Legend, { wrapperStyle: {
|
|
184
|
+
: null }), (0, jsx_runtime_1.jsx)("div", { ref: forwardedRef, className: (0, classnames_1.default)(className, LineChart_module_scss_1.default.wrapper), style: Object.assign({ flexGrow: 1 }, style), children: (0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { ref: containerRef, width: "100%", height: "100%", minWidth: 60, minHeight: 30, debounce: 100, children: (0, jsx_runtime_1.jsxs)(recharts_1.LineChart, { accessibilityLayer: true, data: data, margin: miniMode ? { left: 0, right: 0, top: 0, bottom: 0 } : chartMargin, children: [(0, jsx_runtime_1.jsx)(recharts_1.XAxis, { interval: interval, tickLine: false, dataKey: nameKey, angle: tickAngle, textAnchor: tickAnchor, tick: miniMode ? false : !hideTickX && { fill: "currentColor", fontSize }, tickFormatter: miniMode ? undefined : tickFormatterX, height: miniMode || hideX ? 0 : xAxisHeight, hide: miniMode || hideX }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { hide: miniMode || hideY, tickLine: false, tickFormatter: miniMode ? undefined : tickFormatterY, tick: miniMode ? false : !hideTickY && { fill: "currentColor", fontSize }, domain: [(dataMin) => dataMin * 0.95, (dataMax) => dataMax * 1.05] }), !miniMode && !hideTooltip && (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { content: safeTooltipRenderer }), dataKeys.map((dataKey, i) => ((0, jsx_runtime_1.jsx)(recharts_1.Line, { type: "monotone", dataKey: dataKey, name: dataKey, stroke: colorValues[i], strokeWidth: strokeWidth, dot: false }, dataKey))), showLegend && ((0, jsx_runtime_1.jsx)(recharts_1.Legend, { wrapperStyle: {
|
|
185
185
|
bottom: 0,
|
|
186
186
|
left: 0,
|
|
187
187
|
right: 0,
|
|
@@ -266,10 +266,10 @@ fixtures_1.test.describe("Basic Functionality", () => {
|
|
|
266
266
|
const indicator = page.locator(tooltipIndicatorSelector);
|
|
267
267
|
yield (0, fixtures_1.expect)(indicator).toBeVisible();
|
|
268
268
|
// Indicator should have background color
|
|
269
|
-
const backgroundColor = yield indicator.evaluate(el => window.getComputedStyle(el).backgroundColor);
|
|
269
|
+
const backgroundColor = yield indicator.evaluate((el) => window.getComputedStyle(el).backgroundColor);
|
|
270
270
|
(0, fixtures_1.expect)(backgroundColor).not.toBe("rgba(0, 0, 0, 0)"); // Not transparent
|
|
271
271
|
}));
|
|
272
|
-
(0, fixtures_1.test)("applies consistent styling across different chart types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
272
|
+
(0, fixtures_1.test)("applies consistent styling across different chart types", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
273
273
|
// Test in LineChart context
|
|
274
274
|
yield initTestBed(`
|
|
275
275
|
<LineChart
|
|
@@ -281,9 +281,11 @@ fixtures_1.test.describe("Basic Functionality", () => {
|
|
|
281
281
|
/>
|
|
282
282
|
`);
|
|
283
283
|
yield page.waitForSelector(chartRoot, { timeout: 10000 });
|
|
284
|
-
// Hover over
|
|
285
|
-
const
|
|
286
|
-
yield
|
|
284
|
+
// Hover over chart area to trigger tooltip (Recharts tooltip activates on chart area, not just line)
|
|
285
|
+
const chartSvg = page.locator(".recharts-surface").first();
|
|
286
|
+
yield chartSvg.hover({ position: { x: 200, y: 200 } });
|
|
287
|
+
// Wait for tooltip to appear
|
|
288
|
+
yield page.waitForTimeout(500);
|
|
287
289
|
yield (0, fixtures_1.expect)(page.locator(tooltipContentSelector)).toBeVisible();
|
|
288
290
|
// Should have consistent styling
|
|
289
291
|
const indicator = page.locator(tooltipIndicatorSelector);
|
|
@@ -337,7 +339,7 @@ fixtures_1.test.describe("Accessibility", () => {
|
|
|
337
339
|
yield (0, fixtures_1.expect)(valueText).toHaveCSS("font-size", /\d+px/);
|
|
338
340
|
// Should have proper contrast (background vs text)
|
|
339
341
|
const tooltipContainer = page.locator(tooltipContentSelector);
|
|
340
|
-
const backgroundColor = yield tooltipContainer.evaluate(el => window.getComputedStyle(el).backgroundColor);
|
|
342
|
+
const backgroundColor = yield tooltipContainer.evaluate((el) => window.getComputedStyle(el).backgroundColor);
|
|
341
343
|
(0, fixtures_1.expect)(backgroundColor).not.toBe("transparent");
|
|
342
344
|
}));
|
|
343
345
|
(0, fixtures_1.test)("tooltip appears on keyboard navigation", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
@@ -78,6 +78,17 @@ exports.FormMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
78
78
|
type: "boolean",
|
|
79
79
|
defaultValue: FormNative_1.defaultProps.hideButtonRowUntilDirty,
|
|
80
80
|
},
|
|
81
|
+
hideButtonRow: {
|
|
82
|
+
description: `This property hides the button row entirely when set to true.`,
|
|
83
|
+
type: "boolean",
|
|
84
|
+
defaultValue: FormNative_1.defaultProps.hideButtonRow,
|
|
85
|
+
},
|
|
86
|
+
enableSubmit: {
|
|
87
|
+
description: `This property controls whether the submit button is enabled. When set to false, ` +
|
|
88
|
+
`the submit button is disabled and the form cannot be submitted.`,
|
|
89
|
+
type: "boolean",
|
|
90
|
+
defaultValue: FormNative_1.defaultProps.enableSubmit,
|
|
91
|
+
},
|
|
81
92
|
submitUrl: (0, metadata_helpers_1.d)(`URL to submit the form data.`),
|
|
82
93
|
submitMethod: {
|
|
83
94
|
description: "This property sets the HTTP method to use when submitting the form data. If not " +
|
|
@@ -117,6 +128,14 @@ exports.FormMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
117
128
|
data: "An object containing the form data to update.",
|
|
118
129
|
},
|
|
119
130
|
},
|
|
131
|
+
validate: {
|
|
132
|
+
description: "This method triggers validation on all form fields without submitting the form. " +
|
|
133
|
+
"It displays validation errors and returns the validation result along with the cleaned form data. " +
|
|
134
|
+
"This is useful for implementing custom submit buttons or performing operations that require " +
|
|
135
|
+
"validated data without actually submitting the form.",
|
|
136
|
+
signature: "validate(): Promise<{ isValid: boolean, data: Record<string, any>, errors: ValidationResult[], warnings: ValidationResult[], validationResults: Record<string, ValidationResult> }>",
|
|
137
|
+
returns: "A promise that resolves to an object containing validation status, cleaned data, and detailed validation results.",
|
|
138
|
+
},
|
|
120
139
|
},
|
|
121
140
|
themeVars: (0, themeVars_1.parseScssVar)(Form_module_scss_1.default.themeVars),
|
|
122
141
|
defaultThemeVars: {
|