@fkui/vue 6.0.0 → 6.1.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.
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.49.2"
8
+ "packageVersion": "7.50.0"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,31 +1,54 @@
1
- const { Rule } = require("html-validate");
1
+ const { Rule, DOMTokenList } = require("html-validate");
2
2
  const { getDocumentationUrl } = require("./common");
3
3
 
4
+ const deprecatedClasses = [
5
+ {
6
+ name: "navbar",
7
+ description:
8
+ "`.navbar` and related classes are deprecated and should be replaced with Vue components `FPageHeader` and `FNavigationMenu` or their HTML and style.",
9
+ url: "/components/page-layout/fpageheader.html",
10
+ },
11
+ {
12
+ name: "button--text",
13
+ description:
14
+ "`.button--text` class is deprecated and should be replaced with `button--discrete`",
15
+ url: "/components/button.html",
16
+ },
17
+ ];
18
+
4
19
  class ClassDeprecated extends Rule {
5
- documentation() {
20
+ documentation({ description, url }) {
6
21
  return {
7
- description:
8
- "The class button--text is deprecated and should be replaced with button--discrete",
9
- url: getDocumentationUrl("/components/button.html"),
22
+ description,
23
+ url: getDocumentationUrl(url),
10
24
  };
11
25
  }
12
26
 
13
27
  setup() {
14
- /* listen on dom ready event */
15
- this.on("dom:ready", (event) => {
16
- this.reportDeprecatedClass(event);
17
- });
18
- }
28
+ this.on("attr", (event) => {
29
+ const { key, value, valueLocation } = event;
30
+ const hasClassValue = key === "class" && typeof value === "string";
31
+ if (!hasClassValue) {
32
+ return;
33
+ }
19
34
 
20
- reportDeprecatedClass(event) {
21
- const buttons = event.document.querySelectorAll(".button--text");
35
+ const tokens = new DOMTokenList(event.value, valueLocation);
22
36
 
23
- for (const button of buttons) {
24
- this.report(
25
- button,
26
- "['button--text'] is deprecated, please use ['button--discrete'] instead",
27
- );
28
- }
37
+ for (const { item, location } of tokens.iterator()) {
38
+ for (const deprecatedClass of deprecatedClasses) {
39
+ if (deprecatedClass.name !== item) {
40
+ continue;
41
+ }
42
+
43
+ this.report({
44
+ node: event.target,
45
+ location,
46
+ message: "`.{{ name }}` class is deprecated.",
47
+ context: deprecatedClass,
48
+ });
49
+ }
50
+ }
51
+ });
29
52
  }
30
53
  }
31
54
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/vue",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "Vue implementation of FKUI components",
5
5
  "keywords": [
6
6
  "fkui",
@@ -59,9 +59,9 @@
59
59
  "unit:watch": "jest --watch"
60
60
  },
61
61
  "peerDependencies": {
62
- "@fkui/date": "^5.36.0",
63
- "@fkui/design": "^5.36.0",
64
- "@fkui/logic": "^5.36.0",
62
+ "@fkui/date": "^6.1.0",
63
+ "@fkui/design": "^6.1.0",
64
+ "@fkui/logic": "^6.1.0",
65
65
  "fk-icons": "^4.30.1",
66
66
  "html-validate": ">= 7.9.0",
67
67
  "vue": "^3.5.0"
@@ -78,5 +78,5 @@
78
78
  "node": ">= 20",
79
79
  "npm": ">= 7"
80
80
  },
81
- "gitHead": "490180f46c605ebe3e05fa183a2fa718adb896af"
81
+ "gitHead": "70fde379fb579f9a90ed58afef5d91e5b2d2bb0d"
82
82
  }