@fkui/vue 6.33.0 → 6.34.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.
@@ -0,0 +1,127 @@
1
+ // src/selectors/FPaginator.selectors.ts
2
+ function FPaginatorSelectors(selector = ".paginator") {
3
+ return Object.freeze({
4
+ /**
5
+ * The base selector for the component.
6
+ *
7
+ * This is the same selector that the consumer provided.
8
+ *
9
+ * @public
10
+ * @since v6.34.0
11
+ * @returns The root selector for the component.
12
+ */
13
+ get selector() {
14
+ return selector;
15
+ },
16
+ /**
17
+ * Get the button for the current page.
18
+ *
19
+ * @public
20
+ * @since v6.34.0
21
+ * @returns A selector for the currently active page button.
22
+ */
23
+ currentPageButton() {
24
+ return `${selector} .paginator__page--active`;
25
+ },
26
+ /**
27
+ * Get the button for the first page.
28
+ *
29
+ * @public
30
+ * @since v6.34.0
31
+ * @returns A selector for the button that navigates to the first
32
+ * page.
33
+ */
34
+ firstPageButton() {
35
+ return `${selector} [data-page~="first"]`;
36
+ },
37
+ /**
38
+ * Get the button for the last page.
39
+ *
40
+ * @public
41
+ * @since v6.34.0
42
+ * @returns A selector for the button that navigates to the last
43
+ * page.
44
+ */
45
+ lastPageButton() {
46
+ return `${selector} [data-page~="last"]`;
47
+ },
48
+ /**
49
+ * Get the button for navigating to the next page.
50
+ *
51
+ * @public
52
+ * @since v6.34.0
53
+ * @returns A selector for the button that navigates to the next
54
+ * page.
55
+ */
56
+ nextPageButton() {
57
+ return `${selector} .paginator__next`;
58
+ },
59
+ /**
60
+ * Get the button for a specific page by displayed text.
61
+ *
62
+ * This returns the button that displays the given text.
63
+ *
64
+ * @public
65
+ * @since v6.34.0
66
+ * @param text - The text displayed on the requested button. If a
67
+ * numeric value is provided, it is converted to a string.
68
+ * @returns A selector for the specified page button.
69
+ */
70
+ pageButtonByText(text) {
71
+ return `${selector} > [data-page~="${text}"]`;
72
+ },
73
+ /**
74
+ * Get the button for a specific page by index.
75
+ *
76
+ * The index starts at zero for the first button. A negative index
77
+ * selects buttons from the end, e.g. `-1` selects the last button.
78
+ *
79
+ * @public
80
+ * @since v6.34.0
81
+ * @param index - The zero-based page index, or a negative index to
82
+ * select from the end (e.g. `-1` selects the last button).
83
+ * @returns A selector for the specified page button.
84
+ */
85
+ pageButtonByIndex(index) {
86
+ return `${selector} > [data-index~="${index}"]`;
87
+ },
88
+ /**
89
+ * Get the buttons for all pages shown.
90
+ *
91
+ * @public
92
+ * @since v6.34.0
93
+ * @returns A selector for all displayed page buttons.
94
+ */
95
+ pageButtons() {
96
+ return `${selector} .paginator__page`;
97
+ },
98
+ /**
99
+ * Get the page counter element.
100
+ *
101
+ * The counter replaces the page buttons in compact mode on mobile
102
+ * devices.
103
+ *
104
+ * @public
105
+ * @since v6.34.0
106
+ * @returns A selector for the page counter element.
107
+ */
108
+ pageCounter() {
109
+ return `${selector} .paginator__page-counter`;
110
+ },
111
+ /**
112
+ * Get the button for navigating to the previous page.
113
+ *
114
+ * @public
115
+ * @since v6.34.0
116
+ * @returns A selector for the button that navigates to the previous
117
+ * page.
118
+ */
119
+ previousPageButton() {
120
+ return `${selector} .paginator__previous`;
121
+ }
122
+ });
123
+ }
124
+ export {
125
+ FPaginatorSelectors
126
+ };
127
+ //# sourceMappingURL=selectors.esm.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/selectors/FPaginator.selectors.ts"],
4
+ "sourcesContent": ["/**\n * Selectors for `FPaginator`.\n *\n * @public\n * @since v6.34.0\n * @param selector - The root selector of the FPaginator component.\n * @returns An object with selector methods for the FPaginator component.\n */\nexport function FPaginatorSelectors(selector: string = \".paginator\") {\n return Object.freeze({\n /**\n * The base selector for the component.\n *\n * This is the same selector that the consumer provided.\n *\n * @public\n * @since v6.34.0\n * @returns The root selector for the component.\n */\n get selector(): string {\n return selector;\n },\n\n /**\n * Get the button for the current page.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the currently active page button.\n */\n currentPageButton(this: void): string {\n return `${selector} .paginator__page--active`;\n },\n\n /**\n * Get the button for the first page.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the button that navigates to the first\n * page.\n */\n firstPageButton(this: void): string {\n return `${selector} [data-page~=\"first\"]`;\n },\n\n /**\n * Get the button for the last page.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the button that navigates to the last\n * page.\n */\n lastPageButton(this: void): string {\n return `${selector} [data-page~=\"last\"]`;\n },\n\n /**\n * Get the button for navigating to the next page.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the button that navigates to the next\n * page.\n */\n nextPageButton(this: void): string {\n return `${selector} .paginator__next`;\n },\n\n /**\n * Get the button for a specific page by displayed text.\n *\n * This returns the button that displays the given text.\n *\n * @public\n * @since v6.34.0\n * @param text - The text displayed on the requested button. If a\n * numeric value is provided, it is converted to a string.\n * @returns A selector for the specified page button.\n */\n pageButtonByText(this: void, text: number | string): string {\n return `${selector} > [data-page~=\"${text}\"]`;\n },\n\n /**\n * Get the button for a specific page by index.\n *\n * The index starts at zero for the first button. A negative index\n * selects buttons from the end, e.g. `-1` selects the last button.\n *\n * @public\n * @since v6.34.0\n * @param index - The zero-based page index, or a negative index to\n * select from the end (e.g. `-1` selects the last button).\n * @returns A selector for the specified page button.\n */\n pageButtonByIndex(this: void, index: number | string): string {\n return `${selector} > [data-index~=\"${index}\"]`;\n },\n\n /**\n * Get the buttons for all pages shown.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for all displayed page buttons.\n */\n pageButtons(this: void): string {\n return `${selector} .paginator__page`;\n },\n\n /**\n * Get the page counter element.\n *\n * The counter replaces the page buttons in compact mode on mobile\n * devices.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the page counter element.\n */\n pageCounter(this: void): string {\n return `${selector} .paginator__page-counter`;\n },\n\n /**\n * Get the button for navigating to the previous page.\n *\n * @public\n * @since v6.34.0\n * @returns A selector for the button that navigates to the previous\n * page.\n */\n previousPageButton(this: void): string {\n return `${selector} .pa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AA,IACtB;AAAA,EACJ,CAAC;AACL;",
6
+ "names": []
7
+ }
@@ -821,11 +821,12 @@ export declare class FPageHeaderPageobject implements BasePageObject {
821
821
  * @public
822
822
  */
823
823
  export declare class FPaginatorPageObject implements BasePageObject {
824
- selector: string;
824
+ private _selectors;
825
825
  /**
826
826
  * @param selector - The root of the FPaginator component
827
827
  */
828
- constructor(selector: string);
828
+ constructor(selector?: string);
829
+ get selector(): string;
829
830
  /**
830
831
  * Get the root element.
831
832
  *
@@ -2852,9 +2852,20 @@ disabled: {
2852
2852
  type: BooleanConstructor;
2853
2853
  required: false;
2854
2854
  };
2855
+ /**
2856
+ * Button size, can be one of:
2857
+ * - `small`
2858
+ * - `medium`
2859
+ * - `large`
2860
+ */
2861
+ size: {
2862
+ type: PropType<"small" | "medium" | "large">;
2863
+ default: string;
2864
+ validator(value: string): boolean;
2865
+ };
2855
2866
  }>, {}, {}, {
2856
2867
  attrs(): Record<string, unknown>;
2857
- labelClass(): string;
2868
+ labelClass(): string[];
2858
2869
  labelId(): string;
2859
2870
  ariaDisabled(): string | undefined;
2860
2871
  }, {
@@ -2877,9 +2888,21 @@ disabled: {
2877
2888
  type: BooleanConstructor;
2878
2889
  required: false;
2879
2890
  };
2891
+ /**
2892
+ * Button size, can be one of:
2893
+ * - `small`
2894
+ * - `medium`
2895
+ * - `large`
2896
+ */
2897
+ size: {
2898
+ type: PropType<"small" | "medium" | "large">;
2899
+ default: string;
2900
+ validator(value: string): boolean;
2901
+ };
2880
2902
  }>> & Readonly<{
2881
2903
  onChange?: ((...args: any[]) => any) | undefined;
2882
2904
  }>, {
2905
+ size: "small" | "medium" | "large";
2883
2906
  disabled: boolean;
2884
2907
  id: string;
2885
2908
  }, {}, {
@@ -17479,6 +17502,16 @@ export declare function findElementFromVueRef(ref: unknown): Element | undefined
17479
17502
  */
17480
17503
  export declare function findHTMLElementFromVueRef(ref: unknown): HTMLElement | undefined;
17481
17504
 
17505
+ /**
17506
+ * Get an identifier previously set by a call to `setItemIdentifier()` or `undefined`
17507
+ * if no identifier was set.
17508
+ *
17509
+ * @public
17510
+ * @since v6.34.0
17511
+ * @param item - An item to get identifier from.
17512
+ */
17513
+ export declare function findItemIdentifier(item: unknown): ItemIdentifier | undefined;
17514
+
17482
17515
  /**
17483
17516
  * Finds and returns the parent component of given Vue component that matches given name.
17484
17517
  *
@@ -18023,8 +18056,23 @@ export declare function getInputElement(vm: {
18023
18056
  $el: Element;
18024
18057
  }): ValidatableHTMLElement;
18025
18058
 
18026
- /** @public */
18027
- export declare function getInternalKey<T>(): keyof T;
18059
+ /**
18060
+ * Get an identifier previously set by a call to `setItemIdentifier()` or throws an error
18061
+ * if no identifier was set.
18062
+ *
18063
+ * @public
18064
+ * @since v6.34.0
18065
+ * @param item - An item to get key from.
18066
+ */
18067
+ export declare function getItemIdentifier(item: unknown): ItemIdentifier;
18068
+
18069
+ /**
18070
+ * Do not use. This only exists for backwards compatibility.
18071
+ *
18072
+ * @public
18073
+ * @deprecated Use `getInternalKey(item)` instead.
18074
+ */
18075
+ export declare function getLegacyInternalKey<T>(): keyof T;
18028
18076
 
18029
18077
  /**
18030
18078
  * Gets and returns the parent component of given Vue component that matches given name.
@@ -18172,6 +18220,14 @@ export declare const ISkipLink: typeof __VLS_export_78;
18172
18220
  */
18173
18221
  export declare function itemEquals<T extends object, K extends keyof T>(item1: T | undefined, item2: T | undefined, compareAttribute: K): boolean;
18174
18222
 
18223
+ /**
18224
+ * Represents an item identifier used with `{get,set}ItemIdentifier()`.
18225
+ *
18226
+ * @public
18227
+ * @since v6.34.0
18228
+ */
18229
+ export declare type ItemIdentifier = string | number | symbol;
18230
+
18175
18231
  /**
18176
18232
  * @public
18177
18233
  */
@@ -18554,18 +18610,31 @@ export declare interface RenderSlotOptions {
18554
18610
  export declare function renderSlotText(render: Slot | undefined, props?: Record<string, unknown>, options?: Partial<RenderSlotOptions>): string | undefined;
18555
18611
 
18556
18612
  /**
18557
- * Recursively assigns internal keys to items (and optionally to nested item arrays).
18613
+ * Set or generate an identifier for given item. The identifier should be unique
18614
+ * within your set of data.
18615
+ *
18616
+ * If an identifier already exists it will *not* be overwritten.
18617
+ *
18618
+ * @public
18619
+ * @since v6.34.0
18620
+ * @param item - An item to set the identifier on.
18621
+ * @param value - Specific identifier to use instead of generated one.
18622
+ */
18623
+ export declare function setItemIdentifier(item: unknown, value?: ItemIdentifier): void;
18624
+
18625
+ /**
18626
+ * Recursively assigns identifiers to items (and optionally to nested items).
18558
18627
  *
18559
18628
  * @public
18560
18629
  * @param items - The array of items to process. Items are mutated in place.
18561
- * @param keyAttribute - Optional property key on each item whose value should be used as the internal key. If omitted, an internal key is generated.
18630
+ * @param attribute - Optional property on each item whose value should be used as the identifier. If omitted, an identifier is generated.
18562
18631
  * @param expandableAttribute - Optional property key on each item whose value is expected to be an array of nested items to process recursively.
18563
18632
  *
18564
- * @throws Error If an item is missing or has an invalid value for `key` when `key` is provided.
18565
- * @throws Error If a duplicate `key` value is encountered when `key` is provided.
18566
- * @returns The same `items` array (with items mutated to include internal keys).
18633
+ * @throws Error If an item is missing or has an invalid value for `attribute` when `attribute` is provided.
18634
+ * @throws Error If a duplicate `attribute` value is encountered when `attribute` is provided.
18635
+ * @returns The same `items` array (with items mutated to include identifiers).
18567
18636
  */
18568
- export declare function setInternalKeys<T>(items: T[], keyAttribute?: keyof T, expandableAttribute?: keyof T, seenValues?: Set<unknown>): T[];
18637
+ export declare function setItemIdentifiers<T>(items: T[], attribute?: keyof T, expandableAttribute?: keyof T): T[];
18569
18638
 
18570
18639
  /**
18571
18640
  * @public
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Selectors for `FPaginator`.
3
+ *
4
+ * @public
5
+ * @since v6.34.0
6
+ * @param selector - The root selector of the FPaginator component.
7
+ * @returns An object with selector methods for the FPaginator component.
8
+ */
9
+ export declare function FPaginatorSelectors(selector?: string): Readonly<{
10
+ /**
11
+ * The base selector for the component.
12
+ *
13
+ * This is the same selector that the consumer provided.
14
+ *
15
+ * @public
16
+ * @since v6.34.0
17
+ * @returns The root selector for the component.
18
+ */
19
+ readonly selector: string;
20
+ /**
21
+ * Get the button for the current page.
22
+ *
23
+ * @public
24
+ * @since v6.34.0
25
+ * @returns A selector for the currently active page button.
26
+ */
27
+ currentPageButton(this: void): string;
28
+ /**
29
+ * Get the button for the first page.
30
+ *
31
+ * @public
32
+ * @since v6.34.0
33
+ * @returns A selector for the button that navigates to the first
34
+ * page.
35
+ */
36
+ firstPageButton(this: void): string;
37
+ /**
38
+ * Get the button for the last page.
39
+ *
40
+ * @public
41
+ * @since v6.34.0
42
+ * @returns A selector for the button that navigates to the last
43
+ * page.
44
+ */
45
+ lastPageButton(this: void): string;
46
+ /**
47
+ * Get the button for navigating to the next page.
48
+ *
49
+ * @public
50
+ * @since v6.34.0
51
+ * @returns A selector for the button that navigates to the next
52
+ * page.
53
+ */
54
+ nextPageButton(this: void): string;
55
+ /**
56
+ * Get the button for a specific page by displayed text.
57
+ *
58
+ * This returns the button that displays the given text.
59
+ *
60
+ * @public
61
+ * @since v6.34.0
62
+ * @param text - The text displayed on the requested button. If a
63
+ * numeric value is provided, it is converted to a string.
64
+ * @returns A selector for the specified page button.
65
+ */
66
+ pageButtonByText(this: void, text: number | string): string;
67
+ /**
68
+ * Get the button for a specific page by index.
69
+ *
70
+ * The index starts at zero for the first button. A negative index
71
+ * selects buttons from the end, e.g. `-1` selects the last button.
72
+ *
73
+ * @public
74
+ * @since v6.34.0
75
+ * @param index - The zero-based page index, or a negative index to
76
+ * select from the end (e.g. `-1` selects the last button).
77
+ * @returns A selector for the specified page button.
78
+ */
79
+ pageButtonByIndex(this: void, index: number | string): string;
80
+ /**
81
+ * Get the buttons for all pages shown.
82
+ *
83
+ * @public
84
+ * @since v6.34.0
85
+ * @returns A selector for all displayed page buttons.
86
+ */
87
+ pageButtons(this: void): string;
88
+ /**
89
+ * Get the page counter element.
90
+ *
91
+ * The counter replaces the page buttons in compact mode on mobile
92
+ * devices.
93
+ *
94
+ * @public
95
+ * @since v6.34.0
96
+ * @returns A selector for the page counter element.
97
+ */
98
+ pageCounter(this: void): string;
99
+ /**
100
+ * Get the button for navigating to the previous page.
101
+ *
102
+ * @public
103
+ * @since v6.34.0
104
+ * @returns A selector for the button that navigates to the previous
105
+ * page.
106
+ */
107
+ previousPageButton(this: void): string;
108
+ }>;
109
+
110
+ export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/vue",
3
- "version": "6.33.0",
3
+ "version": "6.34.0",
4
4
  "description": "Vue implementation of FKUI components",
5
5
  "keywords": [
6
6
  "fkui",
@@ -27,6 +27,11 @@
27
27
  "require": "./dist/cjs/cypress.cjs.js",
28
28
  "import": "./dist/esm/cypress.esm.js"
29
29
  },
30
+ "./selectors": {
31
+ "types": "./dist/types/selectors.d.ts",
32
+ "require": "./dist/cjs/selectors.cjs.js",
33
+ "import": "./dist/esm/selectors.esm.js"
34
+ },
30
35
  "./htmlvalidate": "./htmlvalidate/index.cjs",
31
36
  "./htmlvalidate/cypress": "./htmlvalidate/cypress.js",
32
37
  "./package.json": "./package.json",
@@ -45,10 +50,11 @@
45
50
  ],
46
51
  "scripts": {
47
52
  "prebuild": "run-s clean",
48
- "build": "run-s build:lib build:pageobjects build:dts build:api",
53
+ "build": "run-s build:lib build:pageobjects build:dts build:api build:test-bundles",
49
54
  "build:api": "fk-api-extractor --patch-augmentations --patch-declare-var-vls api-extractor.*.json",
50
55
  "build:dts": "vue-tsc -b",
51
56
  "build:lib": "fk-build-vue-lib",
57
+ "build:test-bundles": "node build-test-bundles.mjs",
52
58
  "build:pageobjects": "node build-pageobjects.mjs",
53
59
  "clean": "rimraf -g .jest-cache *.tsbuildinfo coverage dist public temp test-results",
54
60
  "prepack": "release-prepack --bundle --retain-scripts",
@@ -60,9 +66,9 @@
60
66
  "unit:watch": "jest --watch"
61
67
  },
62
68
  "peerDependencies": {
63
- "@fkui/date": "^6.33.0",
64
- "@fkui/design": "^6.33.0",
65
- "@fkui/logic": "^6.33.0",
69
+ "@fkui/date": "^6.34.0",
70
+ "@fkui/design": "^6.34.0",
71
+ "@fkui/logic": "^6.34.0",
66
72
  "fk-icons": "^4.30.1",
67
73
  "html-validate": ">= 7.9.0",
68
74
  "vue": "^3.5.0"
@@ -79,5 +85,5 @@
79
85
  "node": ">= 20",
80
86
  "npm": ">= 7"
81
87
  },
82
- "gitHead": "aefd7e006c712b409aae7893129f1cd3aa8d04cb"
88
+ "gitHead": "30c8ade65e70621c7d4d6c98aca6a1252f2ade5b"
83
89
  }