@fkui/vue 6.38.0 → 6.39.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.
@@ -44,7 +44,6 @@ import { Slots } from 'vue';
44
44
  import { StackHandle } from '@fkui/logic';
45
45
  import { TranslateFunction } from '@fkui/logic';
46
46
  import { UnwrapRef } from 'vue';
47
- import { UnwrapRefSimple } from '@vue/reactivity';
48
47
  import { ValidatableHTMLElement } from '@fkui/logic';
49
48
  import { ValidationConfigUpdateDetail } from '@fkui/logic';
50
49
  import { ValidatorConfigs } from '@fkui/logic';
@@ -326,7 +325,9 @@ declare const __VLS_base_3: DefineComponent<ExtractPropTypes< {
326
325
  * Element to focus on when card is invalid. Set when using validation.
327
326
  */
328
327
  focusRef: {
329
- type: PropType<HTMLElement | null>;
328
+ type: PropType<HTMLElement | {
329
+ $el: HTMLElement;
330
+ } | null>;
330
331
  required: false;
331
332
  default: null;
332
333
  };
@@ -343,7 +344,9 @@ default: () => string;
343
344
  * Element to focus on when card is invalid. Set when using validation.
344
345
  */
345
346
  focusRef: {
346
- type: PropType<HTMLElement | null>;
347
+ type: PropType<HTMLElement | {
348
+ $el: HTMLElement;
349
+ } | null>;
347
350
  required: false;
348
351
  default: null;
349
352
  };
@@ -357,7 +360,9 @@ default: () => string;
357
360
  };
358
361
  }>> & Readonly<{}>, {
359
362
  id: string;
360
- focusRef: HTMLElement | null;
363
+ focusRef: HTMLElement | {
364
+ $el: HTMLElement;
365
+ } | null;
361
366
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
362
367
 
363
368
  declare const __VLS_base_4: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -5029,12 +5034,12 @@ FValidationForm: DefineComponent<ExtractPropTypes< {
5029
5034
  beforeSubmit: {
5030
5035
  type: PropType<FValidationFormCallback>;
5031
5036
  required: false;
5032
- default(): () => undefined;
5037
+ default(): () => void;
5033
5038
  };
5034
5039
  beforeValidation: {
5035
5040
  type: PropType<FValidationFormCallback>;
5036
5041
  required: false;
5037
- default(): () => undefined;
5042
+ default(): () => void;
5038
5043
  };
5039
5044
  id: {
5040
5045
  type: StringConstructor;
@@ -5070,12 +5075,12 @@ onSubmit(event: Event): Promise<void>;
5070
5075
  beforeSubmit: {
5071
5076
  type: PropType<FValidationFormCallback>;
5072
5077
  required: false;
5073
- default(): () => undefined;
5078
+ default(): () => void;
5074
5079
  };
5075
5080
  beforeValidation: {
5076
5081
  type: PropType<FValidationFormCallback>;
5077
5082
  required: false;
5078
- default(): () => undefined;
5083
+ default(): () => void;
5079
5084
  };
5080
5085
  id: {
5081
5086
  type: StringConstructor;
@@ -6367,12 +6372,12 @@ declare const __VLS_export_40: <T extends FPageLayoutType>(__VLS_props: NonNulla
6367
6372
  __ctx?: Awaited<typeof __VLS_setup>;
6368
6373
  };
6369
6374
 
6370
- declare const __VLS_export_41: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_7<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6375
+ declare const __VLS_export_41: <T, TArray extends Dataset<T> | T[] = Dataset<T> | T[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_7<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6371
6376
  props: PublicProps & __VLS_PrettifyLocal_7<{
6372
6377
  /**
6373
6378
  * The items to be used. The items will be used in the given array order.
6374
6379
  */
6375
- items?: T[];
6380
+ items?: TArray extends Dataset<infer U> ? Dataset<U> : TArray;
6376
6381
  /**
6377
6382
  * The number of items per page (at most).
6378
6383
  */
@@ -6389,7 +6394,7 @@ declare const __VLS_export_41: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS
6389
6394
  * @param firstItemIndex - The index of the first item on the page.
6390
6395
  * @param lastItemIndex - The index of the last item on the page.
6391
6396
  */
6392
- fetchData?(firstItemIndex: number, lastItemIndex: number): T[] | Promise<T[]>;
6397
+ fetchData?(firstItemIndex: number, lastItemIndex: number): (TArray extends Dataset<infer U> ? Dataset<U> : TArray) | Promise<TArray extends Dataset<infer U> ? Dataset<U> : TArray>;
6393
6398
  }> & (typeof globalThis extends {
6394
6399
  __VLS_PROPS_FALLBACK: infer P;
6395
6400
  } ? P : {});
@@ -6397,7 +6402,7 @@ declare const __VLS_export_41: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS
6397
6402
  attrs: any;
6398
6403
  slots: {
6399
6404
  default?: (props: {
6400
- items: T[] | UnwrapRefSimple<T>[];
6405
+ items: TArray extends Dataset<infer U> ? Dataset<U> : TArray;
6401
6406
  numberOfItems: number;
6402
6407
  currentPage: number;
6403
6408
  firstItemIndex: number;
@@ -6848,9 +6853,9 @@ rotate: string;
6848
6853
  }, {}, string, ComponentProvideOptions, true, {}, any>;
6849
6854
  }, {}, string, ComponentProvideOptions, true, {}, any>;
6850
6855
 
6851
- declare const __VLS_export_47: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_8<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6852
- props: PublicProps & __VLS_PrettifyLocal_8<FSortFilterDatasetProps<T> & {
6853
- onDatasetSorted?: ((items: T[]) => any) | undefined;
6856
+ declare const __VLS_export_47: <T, TArray extends Dataset<T> | T[] = Dataset<T> | T[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal_8<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
6857
+ props: PublicProps & __VLS_PrettifyLocal_8<FSortFilterDatasetProps<TArray extends Dataset<infer U> ? Dataset<U> : TArray> & {
6858
+ onDatasetSorted?: ((items: TArray extends Dataset<infer U> ? Dataset<U> : TArray) => any) | undefined;
6854
6859
  onUsedSortAttributes?: ((sortAttribute: SortOrder) => any) | undefined;
6855
6860
  }> & (typeof globalThis extends {
6856
6861
  __VLS_PROPS_FALLBACK: infer P;
@@ -6863,10 +6868,10 @@ declare const __VLS_export_47: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS
6863
6868
  }) => any;
6864
6869
  } & {
6865
6870
  default?: (props: {
6866
- sortFilterResult: T[];
6871
+ sortFilterResult: TArray extends Dataset<infer U> ? Dataset<U> : TArray;
6867
6872
  }) => any;
6868
6873
  };
6869
- emit: ((evt: "datasetSorted", items: T[]) => void) & ((evt: "usedSortAttributes", sortAttribute: SortOrder) => void);
6874
+ emit: ((evt: "datasetSorted", items: TArray extends Dataset<infer U> ? Dataset<U> : TArray) => void) & ((evt: "usedSortAttributes", sortAttribute: SortOrder) => void);
6870
6875
  }>) => VNode & {
6871
6876
  __ctx?: Awaited<typeof __VLS_setup>;
6872
6877
  };
@@ -14627,7 +14632,7 @@ declare const __VLS_export_67: DefineComponent<ExtractPropTypes< {
14627
14632
  beforeSubmit: {
14628
14633
  type: PropType<FValidationFormCallback>;
14629
14634
  required: false;
14630
- default(): () => undefined;
14635
+ default(): typeof noop;
14631
14636
  };
14632
14637
  /**
14633
14638
  * If given, this function is called before the form data is validated and the `submit` event is emitted.
@@ -14635,7 +14640,7 @@ default(): () => undefined;
14635
14640
  beforeValidation: {
14636
14641
  type: PropType<FValidationFormCallback>;
14637
14642
  required: false;
14638
- default(): () => undefined;
14643
+ default(): typeof noop;
14639
14644
  };
14640
14645
  /**
14641
14646
  * The id for the form id attribute.
@@ -14697,7 +14702,7 @@ onSubmit(event: Event): Promise<void>;
14697
14702
  beforeSubmit: {
14698
14703
  type: PropType<FValidationFormCallback>;
14699
14704
  required: false;
14700
- default(): () => undefined;
14705
+ default(): typeof noop;
14701
14706
  };
14702
14707
  /**
14703
14708
  * If given, this function is called before the form data is validated and the `submit` event is emitted.
@@ -14705,7 +14710,7 @@ default(): () => undefined;
14705
14710
  beforeValidation: {
14706
14711
  type: PropType<FValidationFormCallback>;
14707
14712
  required: false;
14708
- default(): () => undefined;
14713
+ default(): typeof noop;
14709
14714
  };
14710
14715
  /**
14711
14716
  * The id for the form id attribute.
@@ -15354,12 +15359,12 @@ FValidationForm: DefineComponent<ExtractPropTypes< {
15354
15359
  beforeSubmit: {
15355
15360
  type: PropType<FValidationFormCallback>;
15356
15361
  required: false;
15357
- default(): () => undefined;
15362
+ default(): () => void;
15358
15363
  };
15359
15364
  beforeValidation: {
15360
15365
  type: PropType<FValidationFormCallback>;
15361
15366
  required: false;
15362
- default(): () => undefined;
15367
+ default(): () => void;
15363
15368
  };
15364
15369
  id: {
15365
15370
  type: StringConstructor;
@@ -15395,12 +15400,12 @@ onSubmit(event: Event): Promise<void>;
15395
15400
  beforeSubmit: {
15396
15401
  type: PropType<FValidationFormCallback>;
15397
15402
  required: false;
15398
- default(): () => undefined;
15403
+ default(): () => void;
15399
15404
  };
15400
15405
  beforeValidation: {
15401
15406
  type: PropType<FValidationFormCallback>;
15402
15407
  required: false;
15403
- default(): () => undefined;
15408
+ default(): () => void;
15404
15409
  };
15405
15410
  id: {
15406
15411
  type: StringConstructor;
@@ -17565,6 +17570,22 @@ export declare interface ContextMenuTextItem {
17565
17570
  iconLibrary?: string;
17566
17571
  }
17567
17572
 
17573
+ /**
17574
+ * Dataset contains row metadata for components such as `FSortFilterDataset`
17575
+ * and `FTable`.
17576
+ *
17577
+ * Use `useDatasetRef()` to create a new dataset.
17578
+ *
17579
+ * @public
17580
+ * @since v6.39.0
17581
+ */
17582
+ export declare type Dataset<T> = T[] & {
17583
+ readonly [datasetSymbol]: true;
17584
+ /* Excluded from this release type: __type */
17585
+ };
17586
+
17587
+ declare const datasetSymbol: unique symbol;
17588
+
17568
17589
  declare const _default: typeof __VLS_export_67;
17569
17590
  export { _default as FValidationForm }
17570
17591
  export { _default as IValidationForm }
@@ -18170,11 +18191,11 @@ export declare interface FSortFilterDatasetInterface<TKeys = PropertyKey> {
18170
18191
  */
18171
18192
  export declare type FSortFilterDatasetMountCallback<TKeys = PropertyKey> = (columnNames: TKeys[]) => void;
18172
18193
 
18173
- declare interface FSortFilterDatasetProps<T> {
18194
+ declare interface FSortFilterDatasetProps<TArray> {
18174
18195
  /**
18175
18196
  * The data that you wish to sort or filter.
18176
18197
  */
18177
- data: T[];
18198
+ data: TArray;
18178
18199
  /**
18179
18200
  * All the attributes you want to enable sorting for and the corresponding name to display in the dropdown.
18180
18201
  * Structured as `{attributeName: "Name for dropdown", secondAttributeName: "Name for dropdown"}`
@@ -18795,6 +18816,8 @@ export declare interface NavigationMenuItem {
18795
18816
  target?: string;
18796
18817
  }
18797
18818
 
18819
+ declare function noop(): void;
18820
+
18798
18821
  /**
18799
18822
  * Opens a modal using the given component.
18800
18823
  *
@@ -19140,6 +19163,14 @@ export declare function useCombobox(inputRef: Readonly<ShallowRef<HTMLInputEleme
19140
19163
  closeDropdown: () => void;
19141
19164
  };
19142
19165
 
19166
+ /**
19167
+ * Creates a dataset as a Vue ref.
19168
+ *
19169
+ * @public
19170
+ * @since v6.39.0
19171
+ */
19172
+ export declare function useDatasetRef<T>(initial?: T[]): Ref<Dataset<T>>;
19173
+
19143
19174
  /**
19144
19175
  * @public
19145
19176
  */
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.3"
8
+ "packageVersion": "7.57.6"
9
9
  }
10
10
  ]
11
11
  }
@@ -11,7 +11,7 @@ const { getDocumentationUrl } = require("./common");
11
11
  * @property {Location} location Attribute location (key)
12
12
  */
13
13
 
14
- const matchVValidation = /^v-validation($|[.])/;
14
+ const matchVValidation = /^v-validation($|\.)/;
15
15
  const validatorsWithFormatters = [
16
16
  "bankAccountNumber",
17
17
  "bankgiro",
@@ -16,7 +16,7 @@ const formatters = [
16
16
  "plusgiro",
17
17
  "postalCode",
18
18
  ];
19
- const allowedTags = ["input", "f-text-field"];
19
+ const allowedTags = new Set(["input", "f-text-field"]);
20
20
 
21
21
  class RequiredMaxLength extends Rule {
22
22
  documentation() {
@@ -36,12 +36,12 @@ class RequiredMaxLength extends Rule {
36
36
  const tagName = target.tagName;
37
37
  const valueOfType = target.getAttributeValue("type");
38
38
 
39
- if (!allowedTags.includes(tagName)) {
39
+ if (!allowedTags.has(tagName)) {
40
40
  return;
41
41
  }
42
42
 
43
- for (let i = 0; i < elementAttrs.length; i++) {
44
- attributeKeys.push(elementAttrs[i].key);
43
+ for (const elementAttr of elementAttrs) {
44
+ attributeKeys.push(elementAttr.key);
45
45
  }
46
46
  const validation = attributeKeys.find((attr) =>
47
47
  attr.includes("v-validation"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/vue",
3
- "version": "6.38.0",
3
+ "version": "6.39.0",
4
4
  "description": "Vue implementation of FKUI components",
5
5
  "keywords": [
6
6
  "fkui",
@@ -66,9 +66,9 @@
66
66
  "unit:watch": "jest --watch"
67
67
  },
68
68
  "peerDependencies": {
69
- "@fkui/date": "^6.38.0",
70
- "@fkui/design": "^6.38.0",
71
- "@fkui/logic": "^6.38.0",
69
+ "@fkui/date": "^6.39.0",
70
+ "@fkui/design": "^6.39.0",
71
+ "@fkui/logic": "^6.39.0",
72
72
  "fk-icons": "^4.30.1",
73
73
  "html-validate": ">= 7.9.0",
74
74
  "vue": "^3.5.0"
@@ -85,5 +85,5 @@
85
85
  "node": ">= 20",
86
86
  "npm": ">= 7"
87
87
  },
88
- "gitHead": "ea8e50d8567159581a628106e93ac0e7c1d43a1b"
88
+ "gitHead": "dcb4ae0482dae1d80806b45900c8b80771de7372"
89
89
  }