@fkui/vue 6.3.1 → 6.5.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.
@@ -507,7 +507,7 @@ module.exports = defineMetadata({
507
507
  description: ["/.+/"],
508
508
  type: ["text", "date", "numeric", "action"],
509
509
  },
510
- requiredAttributes: ["name", "title"],
510
+ requiredAttributes: ["title"],
511
511
  permittedContent: ["@phrasing", "button", "f-badge"],
512
512
  },
513
513
 
@@ -930,7 +930,7 @@ module.exports = defineMetadata({
930
930
  "f-crud-dataset": {
931
931
  flow: true,
932
932
  interactive: true,
933
- slots: ["default", "add", "delete", "modify", "add-button"],
933
+ slots: ["default", "add", "delete", "modify", "add-button", "buttons"],
934
934
  requiredSlots: ["default"],
935
935
  attributes: {
936
936
  value: ["/.*/"],
@@ -0,0 +1,58 @@
1
+ const { Rule } = require("html-validate/node");
2
+ const { getDocumentationUrl } = require("./common");
3
+
4
+ class FTableColumnName extends Rule {
5
+ documentation() {
6
+ return {
7
+ description:
8
+ "`<f-sort-filter-dataset>` requires `name` attribute to be set for each `<f-table-column>` with a unique value.",
9
+ url: getDocumentationUrl(
10
+ "/components/table-and-list/fsortfilterdataset.html",
11
+ ),
12
+ };
13
+ }
14
+
15
+ setup() {
16
+ this.on("dom:ready", (event) => {
17
+ const sorters = event.document.querySelectorAll(
18
+ "f-sort-filter-dataset",
19
+ );
20
+
21
+ for (const sorter of sorters) {
22
+ this.validateSorterColumns(sorter);
23
+ }
24
+ });
25
+ }
26
+
27
+ validateSorterColumns(sorter) {
28
+ const columns = sorter.querySelectorAll("f-table-column");
29
+ const seenNames = new Set();
30
+
31
+ for (const column of columns) {
32
+ const hasName = column.hasAttribute("name");
33
+ if (!hasName) {
34
+ this.report(
35
+ column,
36
+ '<f-table-column> is missing required "name" attribute.',
37
+ );
38
+ continue;
39
+ }
40
+
41
+ const { value: name, valueLocation } = column.getAttribute("name");
42
+ if (name.length === 0) {
43
+ // Empty name attribute already handled by component rules.
44
+ continue;
45
+ }
46
+ if (seenNames.has(name)) {
47
+ this.report({
48
+ location: valueLocation,
49
+ message: `"${name}" is not unique.`,
50
+ });
51
+ }
52
+
53
+ seenNames.add(name);
54
+ }
55
+ }
56
+ }
57
+
58
+ module.exports = FTableColumnName;
@@ -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 FTableColumnName = require("./ftablecolumn-name.rule");
7
8
 
8
9
  module.exports = {
9
10
  "fkui/button-group": buttongroup,
@@ -12,4 +13,5 @@ module.exports = {
12
13
  "fkui/required-max-length": requiredmaxlength,
13
14
  "fkui/ftextfield-formatter-validation": ftextfieldFormatterValidation,
14
15
  "fkui/no-template-modal": NoTemplateModal,
16
+ "fkui/ftablecolumn-name": FTableColumnName,
15
17
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/vue",
3
- "version": "6.3.1",
3
+ "version": "6.5.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.3.1",
64
- "@fkui/design": "^6.3.1",
65
- "@fkui/logic": "^6.3.1",
63
+ "@fkui/date": "^6.5.0",
64
+ "@fkui/design": "^6.5.0",
65
+ "@fkui/logic": "^6.5.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": "bc7431b02d30435cc2a179f6e5e1ab205ca2f7f4"
82
+ "gitHead": "9ee7787552c9291983645d9fc4a6a19d9afff267"
83
83
  }