xmlui 0.11.2 → 0.11.4
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-DyhCY6Ga.js → index-Cq0EMm3L.js} +390 -347
- package/dist/lib/index.css +1 -1
- package/dist/lib/{initMock-DN7MXrdn.js → initMock-DCigV4Zh.js} +1 -1
- package/dist/lib/language-server-web-worker.js +1 -1
- package/dist/lib/language-server.js +1 -1
- package/dist/lib/{metadata-utils-D27cn-XB.js → metadata-utils-BiolWMg9.js} +5 -6
- package/dist/lib/{server-common-2DaoOOL5.js → server-common-DyCHOk-z.js} +206 -90
- package/dist/lib/testing.js +1 -1
- package/dist/lib/{transform-Tooy42EB.js → transform-DHf9tQF7.js} +15 -1
- package/dist/lib/vite-xmlui-plugin/index.js +19 -2
- package/dist/lib/{xmlui-parser-BZZ430Wm.js → xmlui-parser-CHN3mADy.js} +1 -1
- package/dist/lib/xmlui-parser.d.ts +2 -0
- package/dist/lib/xmlui-parser.js +2 -2
- package/dist/lib/{xmlui-serializer-D9D2mQ8m.js → xmlui-serializer-CYNSHAlP.js} +1 -1
- package/dist/lib/xmlui.d.ts +2 -1
- package/dist/lib/xmlui.js +3 -3
- package/dist/metadata/{collectedComponentMetadata-BNSnCrzh.js → collectedComponentMetadata-CLaDZhmc.js} +401 -343
- package/dist/metadata/{initMock-CVnDRyRf.js → initMock-Buqah4JF.js} +1 -1
- package/dist/metadata/style.css +1 -1
- package/dist/metadata/xmlui-metadata.js +1 -1
- package/dist/metadata/xmlui-metadata.umd.cjs +3 -3
- package/dist/scripts/package.json +1 -1
- package/dist/scripts/src/components/AutoComplete/AutoComplete.spec.js +113 -0
- package/dist/scripts/src/components/Charts/BarChart/BarChartNative.js +10 -4
- package/dist/scripts/src/components/Charts/LabelList/LabelList.js +2 -2
- package/dist/scripts/src/components/Charts/LabelList/LabelListNative.js +2 -2
- package/dist/scripts/src/components/Charts/LineChart/LineChartNative.js +1 -1
- package/dist/scripts/src/components/Checkbox/Checkbox.js +6 -6
- package/dist/scripts/src/components/Checkbox/Checkbox.spec.js +30 -99
- package/dist/scripts/src/components/ColorPicker/ColorPicker.spec.js +57 -14
- package/dist/scripts/src/components/DateInput/DateInput.spec.js +88 -17
- package/dist/scripts/src/components/DatePicker/DatePicker.spec.js +9 -9
- package/dist/scripts/src/components/NumberBox/NumberBox.spec.js +111 -86
- package/dist/scripts/src/components/RadioGroup/RadioGroup.js +6 -6
- package/dist/scripts/src/components/RadioGroup/RadioGroup.spec.js +30 -28
- package/dist/scripts/src/components/RadioGroup/RadioItemNative.js +1 -1
- package/dist/scripts/src/components/Select/Select.js +1 -1
- package/dist/scripts/src/components/Select/Select.spec.js +92 -0
- package/dist/scripts/src/components/Slider/Slider.js +5 -5
- package/dist/scripts/src/components/Slider/Slider.spec.js +63 -29
- package/dist/scripts/src/components/Splitter/Splitter.js +53 -3
- package/dist/scripts/src/components/Splitter/Splitter.spec.js +313 -0
- package/dist/scripts/src/components/Splitter/SplitterNative.js +48 -22
- package/dist/scripts/src/components/Splitter/utils.js +7 -2
- package/dist/scripts/src/components/Switch/Switch.js +6 -6
- package/dist/scripts/src/components/Switch/Switch.spec.js +44 -46
- package/dist/scripts/src/components/Text/Text.js +17 -16
- package/dist/scripts/src/components/Text/Text.spec.js +284 -0
- package/dist/scripts/src/components/TextArea/TextArea.spec.js +94 -2
- package/dist/scripts/src/components/TextBox/TextBox.js +5 -3
- package/dist/scripts/src/components/TextBox/TextBox.spec.js +92 -59
- package/dist/scripts/src/components/TimeInput/TimeInput.spec.js +101 -25
- package/dist/scripts/src/components-core/behaviors/CoreBehaviors.js +5 -4
- package/dist/scripts/src/language-server/services/common/syntax-node-utilities.js +23 -31
- package/dist/scripts/src/language-server/services/format.js +223 -84
- package/dist/scripts/src/parsers/xmlui-parser/parser.js +3 -2
- package/dist/scripts/src/parsers/xmlui-parser/syntax-node.js +16 -0
- package/dist/standalone/xmlui-standalone.es.d.ts +4 -2
- package/dist/standalone/xmlui-standalone.umd.js +36 -36
- package/package.json +1 -1
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const component_test_helpers_1 = require("../../testing/component-test-helpers");
|
|
12
13
|
const fixtures_1 = require("../../testing/fixtures");
|
|
13
14
|
// =============================================================================
|
|
14
15
|
// BASIC FUNCTIONALITY TESTS
|
|
@@ -431,3 +432,115 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
431
432
|
const { width } = yield input.boundingBox();
|
|
432
433
|
(0, fixtures_1.expect)(width).toBe(200);
|
|
433
434
|
}));
|
|
435
|
+
// =============================================================================
|
|
436
|
+
// THEME VARIABLE TESTS
|
|
437
|
+
// =============================================================================
|
|
438
|
+
fixtures_1.test.describe("Theme Variables", () => {
|
|
439
|
+
[
|
|
440
|
+
{ value: "--default", prop: "" },
|
|
441
|
+
{ value: "--warning", prop: 'validationStatus="warning"' },
|
|
442
|
+
{ value: "--error", prop: 'validationStatus="error"' },
|
|
443
|
+
{ value: "--success", prop: 'validationStatus="valid"' },
|
|
444
|
+
].forEach((variant) => {
|
|
445
|
+
(0, fixtures_1.test)(`applies correct borderRadius ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
446
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
447
|
+
testThemeVars: { [`borderRadius-AutoComplete${variant.value}`]: "12px" },
|
|
448
|
+
});
|
|
449
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-radius", "12px");
|
|
450
|
+
}));
|
|
451
|
+
(0, fixtures_1.test)(`applies correct borderColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
452
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
453
|
+
testThemeVars: { [`borderColor-AutoComplete${variant.value}`]: "rgb(255, 0, 0)" },
|
|
454
|
+
});
|
|
455
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(255, 0, 0)");
|
|
456
|
+
}));
|
|
457
|
+
(0, fixtures_1.test)(`applies correct borderWidth ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
458
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
459
|
+
testThemeVars: { [`borderWidth-AutoComplete${variant.value}`]: "1px" },
|
|
460
|
+
});
|
|
461
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-width", "1px");
|
|
462
|
+
}));
|
|
463
|
+
(0, fixtures_1.test)(`applies correct borderStyle ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
464
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
465
|
+
testThemeVars: { [`borderStyle-AutoComplete${variant.value}`]: "dashed" },
|
|
466
|
+
});
|
|
467
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-style", "dashed");
|
|
468
|
+
}));
|
|
469
|
+
(0, fixtures_1.test)(`applies correct fontSize ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
470
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
471
|
+
testThemeVars: { [`fontSize-AutoComplete${variant.value}`]: "14px" },
|
|
472
|
+
});
|
|
473
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("font-size", "14px");
|
|
474
|
+
}));
|
|
475
|
+
(0, fixtures_1.test)(`applies correct backgroundColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
476
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
477
|
+
testThemeVars: { [`backgroundColor-AutoComplete${variant.value}`]: "rgb(240, 240, 240)" },
|
|
478
|
+
});
|
|
479
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("background-color", "rgb(240, 240, 240)");
|
|
480
|
+
}));
|
|
481
|
+
(0, fixtures_1.test)(`applies correct boxShadow ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
482
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
483
|
+
testThemeVars: {
|
|
484
|
+
[`boxShadow-AutoComplete${variant.value}`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
485
|
+
},
|
|
486
|
+
});
|
|
487
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
488
|
+
}));
|
|
489
|
+
(0, fixtures_1.test)(`applies correct textColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
490
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
491
|
+
testThemeVars: { [`textColor-AutoComplete${variant.value}`]: "rgb(0, 0, 0)" },
|
|
492
|
+
});
|
|
493
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("color", "rgb(0, 0, 0)");
|
|
494
|
+
}));
|
|
495
|
+
(0, fixtures_1.test)(`applies correct borderColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
496
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
497
|
+
testThemeVars: { [`borderColor-AutoComplete${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
498
|
+
});
|
|
499
|
+
yield page.getByTestId("test").hover();
|
|
500
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(0, 0, 0)");
|
|
501
|
+
}));
|
|
502
|
+
(0, fixtures_1.test)(`applies correct backgroundColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
503
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
504
|
+
testThemeVars: { [`backgroundColor-AutoComplete${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
505
|
+
});
|
|
506
|
+
yield page.getByTestId("test").hover();
|
|
507
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("background-color", "rgb(0, 0, 0)");
|
|
508
|
+
}));
|
|
509
|
+
(0, fixtures_1.test)(`applies correct boxShadow on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
510
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
511
|
+
testThemeVars: {
|
|
512
|
+
[`boxShadow-AutoComplete${variant.value}--hover`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
513
|
+
},
|
|
514
|
+
});
|
|
515
|
+
yield page.getByTestId("test").hover();
|
|
516
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
517
|
+
}));
|
|
518
|
+
(0, fixtures_1.test)(`applies correct textColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
519
|
+
yield initTestBed(`<AutoComplete testId="test" ${variant.prop} />`, {
|
|
520
|
+
testThemeVars: { [`textColor-AutoComplete${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
521
|
+
});
|
|
522
|
+
yield page.getByTestId("test").hover();
|
|
523
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("color", "rgb(0, 0, 0)");
|
|
524
|
+
}));
|
|
525
|
+
});
|
|
526
|
+
(0, fixtures_1.test)("applies correct textColor to placeholder", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
527
|
+
yield initTestBed(`<AutoComplete testId="test" placeholder="Search..." />`, {
|
|
528
|
+
testThemeVars: { "textColor-placeholder-AutoComplete": "rgb(0, 0, 0)" },
|
|
529
|
+
});
|
|
530
|
+
const placeholderColor = yield page.evaluate(() => {
|
|
531
|
+
const input = document.querySelector("input");
|
|
532
|
+
return window.getComputedStyle(input, "::placeholder").color;
|
|
533
|
+
});
|
|
534
|
+
(0, fixtures_1.expect)(placeholderColor).toBe("rgb(0, 0, 0)");
|
|
535
|
+
}));
|
|
536
|
+
fixtures_1.test.fixme("applies correct fontSize to placeholder", component_test_helpers_1.SKIP_REASON.UNSURE("Does AutoComplete applies the correct css for the placeholder?"), (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
537
|
+
yield initTestBed(`<AutoComplete testId="test" placeholder="Search..." />`, {
|
|
538
|
+
testThemeVars: { "fontSize-placeholder-AutoComplete--default": "20px" },
|
|
539
|
+
});
|
|
540
|
+
const placeholderFontSize = yield page.evaluate(() => {
|
|
541
|
+
const input = document.querySelector("input");
|
|
542
|
+
return window.getComputedStyle(input, "::placeholder").fontSize;
|
|
543
|
+
});
|
|
544
|
+
(0, fixtures_1.expect)(placeholderFontSize).toBe("20px");
|
|
545
|
+
}));
|
|
546
|
+
});
|
|
@@ -119,7 +119,7 @@ function BarChart({ data = [], layout = exports.defaultProps.layout, nameKey, st
|
|
|
119
119
|
payloadArray.push({
|
|
120
120
|
label: dataKey,
|
|
121
121
|
value: originalPayload[dataKey],
|
|
122
|
-
color: colorValues[index] || colorValues[0]
|
|
122
|
+
color: colorValues[index] || colorValues[0],
|
|
123
123
|
});
|
|
124
124
|
}
|
|
125
125
|
});
|
|
@@ -247,7 +247,7 @@ function BarChart({ data = [], layout = exports.defaultProps.layout, nameKey, st
|
|
|
247
247
|
const customTooltipRenderer = (0, react_1.useCallback)((props) => {
|
|
248
248
|
const tooltipContent = safeTooltipRenderer(props);
|
|
249
249
|
return ((0, jsx_runtime_1.jsx)("div", { ref: (el) => {
|
|
250
|
-
if (el
|
|
250
|
+
if (el) {
|
|
251
251
|
setTooltipElement(el);
|
|
252
252
|
}
|
|
253
253
|
}, children: tooltipContent }));
|
|
@@ -260,7 +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
|
+
domain: [0, (dataMax) => Math.ceil((dataMax * 1.05) / 10) * 10],
|
|
264
264
|
}
|
|
265
265
|
: {
|
|
266
266
|
type: "category",
|
|
@@ -293,7 +293,13 @@ function BarChart({ data = [], layout = exports.defaultProps.layout, nameKey, st
|
|
|
293
293
|
tickCount: yTickCount,
|
|
294
294
|
tickFormatter: miniMode || hideTickY ? undefined : tickFormatterY,
|
|
295
295
|
width: miniMode || hideY ? 0 : yAxisWidth,
|
|
296
|
-
domain: [
|
|
296
|
+
domain: [
|
|
297
|
+
0,
|
|
298
|
+
(dataMax) => {
|
|
299
|
+
const roundedMax = Math.ceil((dataMax * 1.05) / 10) * 10;
|
|
300
|
+
return roundedMax;
|
|
301
|
+
},
|
|
302
|
+
],
|
|
297
303
|
};
|
|
298
304
|
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
|
|
299
305
|
.map((d) => d[nameKey])
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.labelListComponentRenderer = exports.LabelListMd = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const LabelList_module_scss_1 = __importDefault(require("./LabelList.module.scss"));
|
|
9
9
|
const LabelListNative_1 = require("./LabelListNative");
|
|
10
10
|
const abstractions_1 = require("../utils/abstractions");
|
|
11
11
|
const themeVars_1 = require("../../../components-core/theming/themeVars");
|
|
@@ -30,7 +30,7 @@ exports.LabelListMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
30
30
|
defaultValue: LabelListNative_1.defaultProps.position,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
|
-
themeVars: (0, themeVars_1.parseScssVar)(
|
|
33
|
+
themeVars: (0, themeVars_1.parseScssVar)(LabelList_module_scss_1.default.themeVars),
|
|
34
34
|
defaultThemeVars: {
|
|
35
35
|
"textColor-LabelList": "$textColor-primary",
|
|
36
36
|
},
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LabelList = exports.defaultProps = void 0;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const
|
|
8
|
+
const LabelList_module_scss_1 = __importDefault(require("./LabelList.module.scss"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
10
|
const recharts_1 = require("recharts");
|
|
11
11
|
const ChartProvider_1 = require("../utils/ChartProvider");
|
|
@@ -16,7 +16,7 @@ exports.defaultProps = {
|
|
|
16
16
|
const LabelList = ({ position = exports.defaultProps.position, nameKey: key, style, className }) => {
|
|
17
17
|
const { nameKey } = (0, ChartProvider_1.useChart)();
|
|
18
18
|
const { setLabelList } = (0, ChartProvider_1.useLabelList)();
|
|
19
|
-
const content = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)(recharts_1.LabelList, { position: position, className: (0, classnames_1.default)(
|
|
19
|
+
const content = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)(recharts_1.LabelList, { position: position, className: (0, classnames_1.default)(LabelList_module_scss_1.default.labelList, className), dataKey: key || nameKey, stroke: "none", style: style }, "labelList")), [key, nameKey, position, style, className]);
|
|
20
20
|
(0, react_1.useEffect)(() => {
|
|
21
21
|
setLabelList(content);
|
|
22
22
|
}, [content, setLabelList]);
|
|
@@ -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 }, domain: [
|
|
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: [0, (dataMax) => Math.ceil((dataMax * 1.05) / 10) * 10] }), !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,
|
|
@@ -61,12 +61,12 @@ exports.CheckboxMd = (0, metadata_helpers_1.createMetadata)({
|
|
|
61
61
|
themeVars: (0, themeVars_1.parseScssVar)(Toggle_module_scss_1.default.themeVars),
|
|
62
62
|
limitThemeVarsToComponent: true,
|
|
63
63
|
defaultThemeVars: {
|
|
64
|
-
[`borderColor-checked-${COMP}
|
|
65
|
-
[`backgroundColor-checked-${COMP}
|
|
66
|
-
[`borderColor-checked-${COMP}
|
|
67
|
-
[`backgroundColor-checked-${COMP}
|
|
68
|
-
[`borderColor-checked-${COMP}
|
|
69
|
-
[`backgroundColor-checked-${COMP}
|
|
64
|
+
[`borderColor-checked-${COMP}--error`]: `$borderColor-${COMP}--error`,
|
|
65
|
+
[`backgroundColor-checked-${COMP}--error`]: `$borderColor-${COMP}--error`,
|
|
66
|
+
[`borderColor-checked-${COMP}--warning`]: `$borderColor-${COMP}--warning`,
|
|
67
|
+
[`backgroundColor-checked-${COMP}--warning`]: `$borderColor-${COMP}--warning`,
|
|
68
|
+
[`borderColor-checked-${COMP}--success`]: `$borderColor-${COMP}--success`,
|
|
69
|
+
[`backgroundColor-checked-${COMP}--success`]: `$borderColor-${COMP}--success`,
|
|
70
70
|
[`backgroundColor-indicator-${COMP}`]: "$backgroundColor-primary",
|
|
71
71
|
[`borderColor-checked-${COMP}`]: "$color-primary-500",
|
|
72
72
|
[`backgroundColor-checked-${COMP}`]: "$color-primary-500",
|
|
@@ -811,60 +811,6 @@ fixtures_1.test.describe("Theme Vars", () => {
|
|
|
811
811
|
});
|
|
812
812
|
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("background-color", EXPECTED_COLOR);
|
|
813
813
|
}));
|
|
814
|
-
(0, fixtures_1.test)("valid borderColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
815
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
816
|
-
yield initTestBed(`<Checkbox validationStatus="valid" />`, {
|
|
817
|
-
testThemeVars: {
|
|
818
|
-
"borderColor-Checkbox-success": EXPECTED_COLOR,
|
|
819
|
-
},
|
|
820
|
-
});
|
|
821
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("border-color", EXPECTED_COLOR);
|
|
822
|
-
}));
|
|
823
|
-
(0, fixtures_1.test)("valid backgroundColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
824
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
825
|
-
yield initTestBed(`<Checkbox validationStatus="valid" />`, {
|
|
826
|
-
testThemeVars: {
|
|
827
|
-
"backgroundColor-Checkbox-success": EXPECTED_COLOR,
|
|
828
|
-
},
|
|
829
|
-
});
|
|
830
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("background-color", EXPECTED_COLOR);
|
|
831
|
-
}));
|
|
832
|
-
(0, fixtures_1.test)("warning borderColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
833
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
834
|
-
yield initTestBed(`<Checkbox validationStatus="warning" />`, {
|
|
835
|
-
testThemeVars: {
|
|
836
|
-
"borderColor-Checkbox-warning": EXPECTED_COLOR,
|
|
837
|
-
},
|
|
838
|
-
});
|
|
839
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("border-color", EXPECTED_COLOR);
|
|
840
|
-
}));
|
|
841
|
-
(0, fixtures_1.test)("warning backgroundColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
842
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
843
|
-
yield initTestBed(`<Checkbox validationStatus="warning" />`, {
|
|
844
|
-
testThemeVars: {
|
|
845
|
-
"backgroundColor-Checkbox-warning": EXPECTED_COLOR,
|
|
846
|
-
},
|
|
847
|
-
});
|
|
848
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("background-color", EXPECTED_COLOR);
|
|
849
|
-
}));
|
|
850
|
-
(0, fixtures_1.test)("error borderColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
851
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
852
|
-
yield initTestBed(`<Checkbox validationStatus="error" />`, {
|
|
853
|
-
testThemeVars: {
|
|
854
|
-
"borderColor-Checkbox-error": EXPECTED_COLOR,
|
|
855
|
-
},
|
|
856
|
-
});
|
|
857
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("border-color", EXPECTED_COLOR);
|
|
858
|
-
}));
|
|
859
|
-
(0, fixtures_1.test)("error backgroundColor", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
860
|
-
const EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
861
|
-
yield initTestBed(`<Checkbox validationStatus="error" />`, {
|
|
862
|
-
testThemeVars: {
|
|
863
|
-
"backgroundColor-Checkbox-error": EXPECTED_COLOR,
|
|
864
|
-
},
|
|
865
|
-
});
|
|
866
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("background-color", EXPECTED_COLOR);
|
|
867
|
-
}));
|
|
868
814
|
(0, fixtures_1.test)("borderRadius", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
869
815
|
const CUSTOM_BORDER_RADIUS = "10px";
|
|
870
816
|
yield initTestBed(`<Checkbox />`, {
|
|
@@ -919,51 +865,36 @@ fixtures_1.test.describe("Theme Vars", () => {
|
|
|
919
865
|
// VALIDATION STATUS TESTS
|
|
920
866
|
// =============================================================================
|
|
921
867
|
fixtures_1.test.describe("Validation", () => {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
yield initTestBed(`<Checkbox
|
|
949
|
-
testThemeVars: {
|
|
950
|
-
[`backgroundColor-Checkbox-success`]: EXPECTED_COLOR,
|
|
951
|
-
[`borderColor-Checkbox-success`]: EXPECTED_COLOR,
|
|
952
|
-
},
|
|
953
|
-
});
|
|
954
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("background-color", EXPECTED_COLOR);
|
|
955
|
-
yield (0, fixtures_1.expect)(page.getByRole("checkbox")).toHaveCSS("border-color", EXPECTED_COLOR);
|
|
956
|
-
}));
|
|
957
|
-
(0, fixtures_1.test)("handles invalid validationStatus gracefully", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
958
|
-
const validationLevel = "invalid";
|
|
959
|
-
const NOT_EXPECTED_COLOR = "rgb(255, 0, 0)";
|
|
960
|
-
yield initTestBed(`<Checkbox validationStatus="${validationLevel}" />`, {
|
|
961
|
-
testThemeVars: {
|
|
962
|
-
[`backgroundColor-Checkbox-${validationLevel}`]: NOT_EXPECTED_COLOR,
|
|
963
|
-
[`borderColor-Checkbox-${validationLevel}`]: NOT_EXPECTED_COLOR,
|
|
964
|
-
},
|
|
868
|
+
[
|
|
869
|
+
{ value: "--default", prop: "" },
|
|
870
|
+
{ value: "--warning", prop: 'validationStatus="warning"' },
|
|
871
|
+
{ value: "--error", prop: 'validationStatus="error"' },
|
|
872
|
+
{ value: "--success", prop: 'validationStatus="valid"' },
|
|
873
|
+
].forEach((variant) => {
|
|
874
|
+
(0, fixtures_1.test)(`applies correct borderRadius ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
875
|
+
yield initTestBed(`<Checkbox testId="test" ${variant.prop} />`, {
|
|
876
|
+
testThemeVars: { [`borderRadius-Checkbox${variant.value}`]: "12px" },
|
|
877
|
+
});
|
|
878
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-radius", "12px");
|
|
879
|
+
}));
|
|
880
|
+
(0, fixtures_1.test)(`applies correct borderColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
881
|
+
yield initTestBed(`<Checkbox testId="test" ${variant.prop} />`, {
|
|
882
|
+
testThemeVars: { [`borderColor-Checkbox${variant.value}`]: "rgb(255, 0, 0)" },
|
|
883
|
+
});
|
|
884
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(255, 0, 0)");
|
|
885
|
+
}));
|
|
886
|
+
(0, fixtures_1.test)(`applies correct backgroundColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
887
|
+
yield initTestBed(`<Checkbox testId="test" ${variant.prop} />`, {
|
|
888
|
+
testThemeVars: { [`backgroundColor-Checkbox${variant.value}`]: "rgb(240, 240, 240)" },
|
|
889
|
+
});
|
|
890
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("background-color", "rgb(240, 240, 240)");
|
|
891
|
+
}));
|
|
892
|
+
});
|
|
893
|
+
(0, fixtures_1.test)(`applies correct borderColor on hover`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
894
|
+
yield initTestBed(`<Checkbox testId="test" />`, {
|
|
895
|
+
testThemeVars: { [`borderColor-Checkbox--default--hover`]: "rgb(0, 0, 0)" },
|
|
965
896
|
});
|
|
966
|
-
yield
|
|
967
|
-
yield (0, fixtures_1.expect)(page.
|
|
897
|
+
yield page.getByTestId("test").hover();
|
|
898
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(0, 0, 0)");
|
|
968
899
|
}));
|
|
969
900
|
});
|
|
@@ -100,20 +100,63 @@ const fixtures_1 = require("../../testing/fixtures");
|
|
|
100
100
|
// =============================================================================
|
|
101
101
|
// VISUAL STATE TESTS
|
|
102
102
|
// =============================================================================
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}))
|
|
103
|
+
fixtures_1.test.describe("Validation", () => {
|
|
104
|
+
[
|
|
105
|
+
{ value: "--default", prop: "" },
|
|
106
|
+
{ value: "--warning", prop: 'validationStatus="warning"' },
|
|
107
|
+
{ value: "--error", prop: 'validationStatus="error"' },
|
|
108
|
+
{ value: "--success", prop: 'validationStatus="valid"' },
|
|
109
|
+
].forEach((variant) => {
|
|
110
|
+
(0, fixtures_1.test)(`applies correct borderRadius ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
111
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
112
|
+
testThemeVars: { [`borderRadius-ColorPicker${variant.value}`]: "12px" },
|
|
113
|
+
});
|
|
114
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-radius", "12px");
|
|
115
|
+
}));
|
|
116
|
+
(0, fixtures_1.test)(`applies correct borderColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
117
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
118
|
+
testThemeVars: { [`borderColor-ColorPicker${variant.value}`]: "rgb(255, 0, 0)" },
|
|
119
|
+
});
|
|
120
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(255, 0, 0)");
|
|
121
|
+
}));
|
|
122
|
+
(0, fixtures_1.test)(`applies correct borderWidth ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
123
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
124
|
+
testThemeVars: { [`borderWidth-ColorPicker${variant.value}`]: "1px" },
|
|
125
|
+
});
|
|
126
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-width", "1px");
|
|
127
|
+
}));
|
|
128
|
+
(0, fixtures_1.test)(`applies correct borderStyle ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
129
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
130
|
+
testThemeVars: { [`borderStyle-ColorPicker${variant.value}`]: "dashed" },
|
|
131
|
+
});
|
|
132
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-style", "dashed");
|
|
133
|
+
}));
|
|
134
|
+
(0, fixtures_1.test)(`applies correct boxShadow ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
135
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
136
|
+
testThemeVars: {
|
|
137
|
+
[`boxShadow-ColorPicker${variant.value}`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
141
|
+
}));
|
|
142
|
+
(0, fixtures_1.test)(`applies correct borderColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
143
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
144
|
+
testThemeVars: { [`borderColor-ColorPicker${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
145
|
+
});
|
|
146
|
+
yield page.getByTestId("test").hover();
|
|
147
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(0, 0, 0)");
|
|
148
|
+
}));
|
|
149
|
+
(0, fixtures_1.test)(`applies correct boxShadow on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
150
|
+
yield initTestBed(`<ColorPicker testId="test" ${variant.prop} />`, {
|
|
151
|
+
testThemeVars: {
|
|
152
|
+
[`boxShadow-ColorPicker${variant.value}--hover`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
yield page.getByTestId("test").hover();
|
|
156
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
157
|
+
}));
|
|
158
|
+
});
|
|
159
|
+
});
|
|
117
160
|
(0, fixtures_1.test)("component applies backgroundColor-ColorPicker theme variable", (_a) => __awaiter(void 0, [_a], void 0, function* ({ page, initTestBed }) {
|
|
118
161
|
yield initTestBed(`<ColorPicker />`, {
|
|
119
162
|
testThemeVars: {
|
|
@@ -279,23 +279,94 @@ fixtures_1.test.describe("initialValue property", () => {
|
|
|
279
279
|
yield (0, fixtures_1.expect)(driver.dayInput).toHaveValue("30");
|
|
280
280
|
}));
|
|
281
281
|
});
|
|
282
|
-
fixtures_1.test.describe("
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
282
|
+
fixtures_1.test.describe("Validation", () => {
|
|
283
|
+
[
|
|
284
|
+
{ value: "--default", prop: "" },
|
|
285
|
+
{ value: "--warning", prop: 'validationStatus="warning"' },
|
|
286
|
+
{ value: "--error", prop: 'validationStatus="error"' },
|
|
287
|
+
{ value: "--success", prop: 'validationStatus="valid"' },
|
|
288
|
+
].forEach((variant) => {
|
|
289
|
+
(0, fixtures_1.test)(`applies correct borderRadius ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
290
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
291
|
+
testThemeVars: { [`borderRadius-DateInput${variant.value}`]: "12px" },
|
|
292
|
+
});
|
|
293
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-radius", "12px");
|
|
294
|
+
}));
|
|
295
|
+
(0, fixtures_1.test)(`applies correct borderColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
296
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
297
|
+
testThemeVars: { [`borderColor-DateInput${variant.value}`]: "rgb(255, 0, 0)" },
|
|
298
|
+
});
|
|
299
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(255, 0, 0)");
|
|
300
|
+
}));
|
|
301
|
+
(0, fixtures_1.test)(`applies correct borderWidth ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
302
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
303
|
+
testThemeVars: { [`borderWidth-DateInput${variant.value}`]: "1px" },
|
|
304
|
+
});
|
|
305
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-width", "1px");
|
|
306
|
+
}));
|
|
307
|
+
(0, fixtures_1.test)(`applies correct borderStyle ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
308
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
309
|
+
testThemeVars: { [`borderStyle-DateInput${variant.value}`]: "dashed" },
|
|
310
|
+
});
|
|
311
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-style", "dashed");
|
|
312
|
+
}));
|
|
313
|
+
(0, fixtures_1.test)(`applies correct fontSize ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
314
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
315
|
+
testThemeVars: { [`fontSize-DateInput${variant.value}`]: "14px" },
|
|
316
|
+
});
|
|
317
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("font-size", "14px");
|
|
318
|
+
}));
|
|
319
|
+
(0, fixtures_1.test)(`applies correct backgroundColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
320
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
321
|
+
testThemeVars: { [`backgroundColor-DateInput${variant.value}`]: "rgb(240, 240, 240)" },
|
|
322
|
+
});
|
|
323
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("background-color", "rgb(240, 240, 240)");
|
|
324
|
+
}));
|
|
325
|
+
(0, fixtures_1.test)(`applies correct boxShadow ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
326
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
327
|
+
testThemeVars: {
|
|
328
|
+
[`boxShadow-DateInput${variant.value}`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
332
|
+
}));
|
|
333
|
+
(0, fixtures_1.test)(`applies correct textColor ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
334
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
335
|
+
testThemeVars: { [`textColor-DateInput${variant.value}`]: "rgb(0, 0, 0)" },
|
|
336
|
+
});
|
|
337
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("color", "rgb(0, 0, 0)");
|
|
338
|
+
}));
|
|
339
|
+
(0, fixtures_1.test)(`applies correct borderColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
340
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
341
|
+
testThemeVars: { [`borderColor-DateInput${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
342
|
+
});
|
|
343
|
+
yield page.getByTestId("test").hover();
|
|
344
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("border-color", "rgb(0, 0, 0)");
|
|
345
|
+
}));
|
|
346
|
+
(0, fixtures_1.test)(`applies correct backgroundColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page, }) {
|
|
347
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
348
|
+
testThemeVars: { [`backgroundColor-DateInput${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
349
|
+
});
|
|
350
|
+
yield page.getByTestId("test").hover();
|
|
351
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("background-color", "rgb(0, 0, 0)");
|
|
352
|
+
}));
|
|
353
|
+
(0, fixtures_1.test)(`applies correct boxShadow on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
354
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
355
|
+
testThemeVars: {
|
|
356
|
+
[`boxShadow-DateInput${variant.value}--hover`]: "0 2px 8px rgba(0, 0, 0, 0.1)",
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
yield page.getByTestId("test").hover();
|
|
360
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("box-shadow", "rgba(0, 0, 0, 0.1) 0px 2px 8px 0px");
|
|
361
|
+
}));
|
|
362
|
+
(0, fixtures_1.test)(`applies correct textColor on hover ${variant.value}`, (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, page }) {
|
|
363
|
+
yield initTestBed(`<DateInput testId="test" ${variant.prop} />`, {
|
|
364
|
+
testThemeVars: { [`textColor-DateInput${variant.value}--hover`]: "rgb(0, 0, 0)" },
|
|
365
|
+
});
|
|
366
|
+
yield page.getByTestId("test").hover();
|
|
367
|
+
yield (0, fixtures_1.expect)(page.getByTestId("test")).toHaveCSS("color", "rgb(0, 0, 0)");
|
|
368
|
+
}));
|
|
369
|
+
});
|
|
299
370
|
});
|
|
300
371
|
fixtures_1.test.describe("autoFocus property", () => {
|
|
301
372
|
(0, fixtures_1.test)("focuses component when autoFocus is true", (_a) => __awaiter(void 0, [_a], void 0, function* ({ initTestBed, createDateInputDriver, }) {
|