@fkui/vue 6.5.0 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/cypress.cjs.js +165 -7
- package/dist/cjs/cypress.cjs.js.map +3 -3
- package/dist/cjs/index.cjs.js +5034 -4332
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/esm/cypress.esm.js +165 -7
- package/dist/esm/cypress.esm.js.map +3 -3
- package/dist/esm/index.esm.js +5040 -4338
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/types/cypress.d.ts +109 -2
- package/dist/types/index.d.ts +315 -166
- package/dist/types/tsdoc-metadata.json +1 -1
- package/htmlvalidate/configs/recommended.js +2 -0
- package/htmlvalidate/elements/components.js +65 -1
- package/htmlvalidate/rules/classdeprecated.rule.js +42 -10
- package/htmlvalidate/rules/finteractivetable-checkbox-description.rule.js +73 -0
- package/htmlvalidate/rules/index.js +3 -0
- package/package.json +5 -5
|
@@ -11,8 +11,10 @@ module.exports = {
|
|
|
11
11
|
"fkui/class-deprecated": "error",
|
|
12
12
|
"fkui/prefer-ficon": "error",
|
|
13
13
|
"fkui/required-max-length": "error",
|
|
14
|
+
"fkui/finteractivetable-checkbox-description": "error",
|
|
14
15
|
"fkui/ftextfield-formatter-validation": "error",
|
|
15
16
|
"fkui/no-template-modal": "error",
|
|
16
17
|
"fkui/ftablecolumn-name": "error",
|
|
18
|
+
"vue/prefer-slot-shorthand": "off",
|
|
17
19
|
},
|
|
18
20
|
};
|
|
@@ -186,6 +186,24 @@ module.exports = defineMetadata({
|
|
|
186
186
|
inherit: "f-text-field#tooltip",
|
|
187
187
|
},
|
|
188
188
|
|
|
189
|
+
"f-details-panel": {
|
|
190
|
+
flow: true,
|
|
191
|
+
attributes: {
|
|
192
|
+
name: {
|
|
193
|
+
required: true,
|
|
194
|
+
enum: ["/.+/"],
|
|
195
|
+
},
|
|
196
|
+
exclude: {
|
|
197
|
+
enum: ["/.+/"],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
slots: ["default", "icon"],
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
"f-details-panel#icon": {
|
|
204
|
+
permittedContent: ["f-icon"],
|
|
205
|
+
},
|
|
206
|
+
|
|
189
207
|
"f-calendar": {
|
|
190
208
|
flow: true,
|
|
191
209
|
slots: ["default"],
|
|
@@ -430,6 +448,31 @@ module.exports = defineMetadata({
|
|
|
430
448
|
inherit: "f-label#description",
|
|
431
449
|
},
|
|
432
450
|
|
|
451
|
+
"f-minimizable-panel": {
|
|
452
|
+
flow: true,
|
|
453
|
+
attributes: {
|
|
454
|
+
context: {
|
|
455
|
+
enum: ["/.+/"],
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
slots: ["default", "icon"],
|
|
459
|
+
},
|
|
460
|
+
|
|
461
|
+
"ce-minimizable-panel": {
|
|
462
|
+
flow: true,
|
|
463
|
+
attributes: {
|
|
464
|
+
context: {
|
|
465
|
+
enum: ["/.+/"],
|
|
466
|
+
},
|
|
467
|
+
openPrefix: {
|
|
468
|
+
enum: ["/.+/"],
|
|
469
|
+
},
|
|
470
|
+
closePrefix: {
|
|
471
|
+
enum: ["/.+/"],
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
|
|
433
476
|
"f-page-layout": {
|
|
434
477
|
flow: true,
|
|
435
478
|
attributes: {
|
|
@@ -465,6 +508,10 @@ module.exports = defineMetadata({
|
|
|
465
508
|
},
|
|
466
509
|
},
|
|
467
510
|
|
|
511
|
+
"f-fixed-pane": {
|
|
512
|
+
flow: true,
|
|
513
|
+
},
|
|
514
|
+
|
|
468
515
|
"f-sort-filter-dataset": {
|
|
469
516
|
flow: true,
|
|
470
517
|
interactive: true,
|
|
@@ -499,6 +546,23 @@ module.exports = defineMetadata({
|
|
|
499
546
|
inherit: "f-label#description",
|
|
500
547
|
},
|
|
501
548
|
|
|
549
|
+
"f-table-button": {
|
|
550
|
+
flow: false,
|
|
551
|
+
interactive: true,
|
|
552
|
+
attributes: {
|
|
553
|
+
icon: {
|
|
554
|
+
enum: ["/.+/"],
|
|
555
|
+
},
|
|
556
|
+
label: {
|
|
557
|
+
boolean: true,
|
|
558
|
+
},
|
|
559
|
+
},
|
|
560
|
+
textContent: "accessible",
|
|
561
|
+
permittedContent: ["span", "template"],
|
|
562
|
+
permittedDescendants: [{ exclude: ["@interactive"] }],
|
|
563
|
+
requiredAncestors: ["f-table-column"],
|
|
564
|
+
},
|
|
565
|
+
|
|
502
566
|
"f-table-column": {
|
|
503
567
|
flow: false,
|
|
504
568
|
attributes: {
|
|
@@ -508,7 +572,7 @@ module.exports = defineMetadata({
|
|
|
508
572
|
type: ["text", "date", "numeric", "action"],
|
|
509
573
|
},
|
|
510
574
|
requiredAttributes: ["title"],
|
|
511
|
-
permittedContent: ["@phrasing", "button", "f-badge"],
|
|
575
|
+
permittedContent: ["@phrasing", "button", "f-badge", "f-table-button"],
|
|
512
576
|
},
|
|
513
577
|
|
|
514
578
|
"f-tooltip": {
|
|
@@ -1,25 +1,55 @@
|
|
|
1
1
|
const { Rule, DOMTokenList } = require("html-validate");
|
|
2
2
|
const { getDocumentationUrl } = require("./common");
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import("html-validate").RuleDocumentation} RuleDocumentation
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @typedef {Object} Entry
|
|
10
|
+
* @property {string} name
|
|
11
|
+
* @property {string} [replacement]
|
|
12
|
+
* @property {string} [additionalMessage]
|
|
13
|
+
* @property {string} url
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** @type {Entry[]} */
|
|
4
17
|
const deprecatedClasses = [
|
|
5
18
|
{
|
|
6
19
|
name: "navbar",
|
|
7
|
-
|
|
8
|
-
"
|
|
20
|
+
additionalMessage:
|
|
21
|
+
"It should be replaced with the Vue components `FPageHeader` and `FNavigationMenu`.",
|
|
9
22
|
url: "/components/page-layout/fpageheader.html",
|
|
10
23
|
},
|
|
11
24
|
{
|
|
12
25
|
name: "button--text",
|
|
13
|
-
|
|
14
|
-
|
|
26
|
+
replacement: "button--tertiary",
|
|
27
|
+
url: "/components/button.html",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "button--discrete",
|
|
31
|
+
replacement: "button--tertiary",
|
|
15
32
|
url: "/components/button.html",
|
|
16
33
|
},
|
|
17
34
|
];
|
|
18
35
|
|
|
36
|
+
/**
|
|
37
|
+
* @extends {Rule<Entry, void>}
|
|
38
|
+
*/
|
|
19
39
|
class ClassDeprecated extends Rule {
|
|
20
|
-
|
|
40
|
+
/**
|
|
41
|
+
* @param {Entry} context
|
|
42
|
+
* @returns {RuleDocumentation}
|
|
43
|
+
*/
|
|
44
|
+
documentation(context) {
|
|
45
|
+
const { url, replacement, additionalMessage } = context;
|
|
46
|
+
const message = replacement
|
|
47
|
+
? `Class \`${context.name}\` is deprecated and should be replaced with \`${replacement}\``
|
|
48
|
+
: `Class \`${context.name}\` is deprecated.`;
|
|
21
49
|
return {
|
|
22
|
-
description
|
|
50
|
+
description: additionalMessage
|
|
51
|
+
? `${message}\n\n${additionalMessage}`
|
|
52
|
+
: message,
|
|
23
53
|
url: getDocumentationUrl(url),
|
|
24
54
|
};
|
|
25
55
|
}
|
|
@@ -35,16 +65,18 @@ class ClassDeprecated extends Rule {
|
|
|
35
65
|
const tokens = new DOMTokenList(event.value, valueLocation);
|
|
36
66
|
|
|
37
67
|
for (const { item, location } of tokens.iterator()) {
|
|
38
|
-
for (const
|
|
39
|
-
if (
|
|
68
|
+
for (const entry of deprecatedClasses) {
|
|
69
|
+
if (entry.name !== item) {
|
|
40
70
|
continue;
|
|
41
71
|
}
|
|
42
72
|
|
|
43
73
|
this.report({
|
|
44
74
|
node: event.target,
|
|
45
75
|
location,
|
|
46
|
-
message:
|
|
47
|
-
|
|
76
|
+
message: entry.replacement
|
|
77
|
+
? `class "{{ name }}" is deprecated and replaced with "{{ replacement }}"`
|
|
78
|
+
: `class "{{ name }}" is deprecated`,
|
|
79
|
+
context: entry,
|
|
48
80
|
});
|
|
49
81
|
}
|
|
50
82
|
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const {
|
|
2
|
+
Rule,
|
|
3
|
+
classifyNodeText,
|
|
4
|
+
TextClassification,
|
|
5
|
+
} = require("html-validate/node");
|
|
6
|
+
const { getDocumentationUrl } = require("./common");
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {import("html-validate").ElementReadyEvent} event
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
function isRelevant(event) {
|
|
13
|
+
return event.target.is("f-interactive-table");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {import("html-validate").HtmlElement} element
|
|
18
|
+
* @returns {string[]}
|
|
19
|
+
*/
|
|
20
|
+
function getSlots(element) {
|
|
21
|
+
return Object.fromEntries(
|
|
22
|
+
element.childElements
|
|
23
|
+
.filter((it) => it.is("template"))
|
|
24
|
+
.map((it) => {
|
|
25
|
+
const key = it.attributes.find((jt) =>
|
|
26
|
+
jt.key.startsWith("#"),
|
|
27
|
+
)?.key;
|
|
28
|
+
return [key, it];
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class FInteractiveTableCheckboxDescription extends Rule {
|
|
34
|
+
documentation() {
|
|
35
|
+
return {
|
|
36
|
+
description:
|
|
37
|
+
"`#checkbox-description` slot must implemented and non-empty when `selectable` is enabled",
|
|
38
|
+
url: getDocumentationUrl("/components/table-and-list/table.html"),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
setup() {
|
|
43
|
+
this.on("element:ready", isRelevant, (event) => {
|
|
44
|
+
const { target } = event;
|
|
45
|
+
const selectable = target.getAttribute("selectable");
|
|
46
|
+
if (!selectable) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const slots = getSlots(target);
|
|
50
|
+
const checkboxDescription = slots["#checkbox-description"];
|
|
51
|
+
if (!checkboxDescription) {
|
|
52
|
+
this.report({
|
|
53
|
+
node: target,
|
|
54
|
+
location: selectable.keyLocation,
|
|
55
|
+
message:
|
|
56
|
+
"#checkbox-description slot must be implemented when selectable is enabled",
|
|
57
|
+
});
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const textContent = classifyNodeText(checkboxDescription);
|
|
61
|
+
if (textContent === TextClassification.EMPTY_TEXT) {
|
|
62
|
+
this.report({
|
|
63
|
+
node: checkboxDescription,
|
|
64
|
+
location: checkboxDescription.location,
|
|
65
|
+
message:
|
|
66
|
+
"#checkbox-description cannot be empty when selectable is enabled",
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
module.exports = FInteractiveTableCheckboxDescription;
|
|
@@ -4,6 +4,7 @@ const PreferFIcon = require("./prefer-ficon.rule");
|
|
|
4
4
|
const requiredmaxlength = require("./requiredmaxlength.rule");
|
|
5
5
|
const ftextfieldFormatterValidation = require("./ftextfieldFormatterValidation.rule");
|
|
6
6
|
const NoTemplateModal = require("./no-template-modal.rule");
|
|
7
|
+
const FInteractiveTableCheckboxDescription = require("./finteractivetable-checkbox-description.rule");
|
|
7
8
|
const FTableColumnName = require("./ftablecolumn-name.rule");
|
|
8
9
|
|
|
9
10
|
module.exports = {
|
|
@@ -11,6 +12,8 @@ module.exports = {
|
|
|
11
12
|
"fkui/class-deprecated": classdeprecated,
|
|
12
13
|
"fkui/prefer-ficon": PreferFIcon,
|
|
13
14
|
"fkui/required-max-length": requiredmaxlength,
|
|
15
|
+
"fkui/finteractivetable-checkbox-description":
|
|
16
|
+
FInteractiveTableCheckboxDescription,
|
|
14
17
|
"fkui/ftextfield-formatter-validation": ftextfieldFormatterValidation,
|
|
15
18
|
"fkui/no-template-modal": NoTemplateModal,
|
|
16
19
|
"fkui/ftablecolumn-name": FTableColumnName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fkui/vue",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.7.0",
|
|
4
4
|
"description": "Vue implementation of FKUI components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fkui",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"unit:watch": "jest --watch"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@fkui/date": "^6.
|
|
64
|
-
"@fkui/design": "^6.
|
|
65
|
-
"@fkui/logic": "^6.
|
|
63
|
+
"@fkui/date": "^6.7.0",
|
|
64
|
+
"@fkui/design": "^6.7.0",
|
|
65
|
+
"@fkui/logic": "^6.7.0",
|
|
66
66
|
"fk-icons": "^4.30.1",
|
|
67
67
|
"html-validate": ">= 7.9.0",
|
|
68
68
|
"vue": "^3.5.0"
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"node": ">= 20",
|
|
80
80
|
"npm": ">= 7"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "eab8f6660158999d279372b664a88f541eaf8063"
|
|
83
83
|
}
|