@frollo/frollo-web-ui 1.2.0 → 1.2.2

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.
Files changed (41) hide show
  1. package/cjs/index.js +696 -437
  2. package/esm/{add-to-unscopables-89bfb214.js → add-to-unscopables-44076600.js} +3 -3
  3. package/esm/{index-671cf43d.js → array-iteration-10670eca.js} +4 -146
  4. package/esm/{to-string-cf010dcc.js → classof-b2d09c70.js} +4 -13
  5. package/esm/{es.array.includes-46369dd6.js → es.array.includes-b402df81.js} +4 -4
  6. package/esm/{es.function.name-3a0ddf71.js → es.function.name-383fcdbc.js} +1 -1
  7. package/esm/{es.number.constructor-6891f9eb.js → es.number.constructor-6def8fd9.js} +3 -3
  8. package/esm/{function-name-fe849d51.js → function-name-0d296891.js} +1 -1
  9. package/esm/fw-animations.js +5 -4
  10. package/esm/{fw-button-969296c5.js → fw-button-fb8e3fe2.js} +1 -1
  11. package/esm/fw-button.js +6 -6
  12. package/esm/fw-card.js +1 -0
  13. package/esm/fw-checkbox.js +3 -3
  14. package/esm/fw-dropdown.js +284 -0
  15. package/esm/fw-form.js +1 -1
  16. package/esm/fw-input.js +7 -7
  17. package/esm/fw-modal.js +7 -7
  18. package/esm/fw-navigation-menu.js +6 -6
  19. package/esm/fw-progress-bar.js +5 -4
  20. package/esm/fw-table.js +7 -5
  21. package/esm/fw-tabs.js +149 -8
  22. package/esm/fw-tag.js +5 -5
  23. package/esm/index-16e7ac1e.js +454 -0
  24. package/esm/{index-daa646e2.js → index-26d82b11.js} +2 -2
  25. package/esm/{index-4362991c.js → index-ca8d7e19.js} +145 -573
  26. package/esm/index.js +40 -56
  27. package/esm/{is-forced-8a459969.js → is-forced-2369382d.js} +2 -2
  28. package/esm/{object-keys-4b8adc6c.js → object-keys-f9d76c12.js} +2 -2
  29. package/esm/to-string-2588bbbe.js +13 -0
  30. package/esm/{vee-validate.esm-b64acab1.js → vee-validate.esm-a17a23c3.js} +1 -1
  31. package/frollo-web-ui.esm.js +921 -649
  32. package/icons/icons.stories.ts +3 -3
  33. package/index.d.ts +131 -4
  34. package/package.json +1 -1
  35. package/types/components/fw-dropdown/fw-dropdown.vue.d.ts +113 -0
  36. package/types/components/fw-dropdown/index.d.ts +2 -0
  37. package/types/components/fw-dropdown/index.types.d.ts +12 -0
  38. package/types/components/fw-table/fw-table.vue.d.ts +1 -0
  39. package/types/components/fw-table/index.types.d.ts +2 -1
  40. package/types/components/index.d.ts +1 -0
  41. package/types/components/index.types.d.ts +1 -0
@@ -19,9 +19,9 @@ const Template = () => ({
19
19
  </div>`,
20
20
  setup() {
21
21
  const extractFilename = (path: string) => {
22
- const pathArray = path.split('/');
23
- const lastIndex = pathArray.length - 1;
24
- return pathArray[lastIndex].slice(0, -4);
22
+ const pathArray = path?.split('/');
23
+ const lastIndex = pathArray?.length - 1;
24
+ if (lastIndex) return pathArray[lastIndex].slice(0, -4);
25
25
  };
26
26
  return {
27
27
  icons,
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as vue from 'vue';
2
2
  import { PropType, Plugin } from 'vue';
3
+ import * as vee_validate from 'vee-validate';
3
4
  export { Form as FwForm } from 'vee-validate';
4
5
  import * as _vue_shared from '@vue/shared';
5
6
 
@@ -17,7 +18,7 @@ declare interface FwInputProps {
17
18
  tabindex?: string;
18
19
  }
19
20
 
20
- declare const _default$c: vue.DefineComponent<{
21
+ declare const _default$d: vue.DefineComponent<{
21
22
  /**
22
23
  * The input v-model
23
24
  */
@@ -168,7 +169,7 @@ declare const _default$c: vue.DefineComponent<{
168
169
  tabindex: string;
169
170
  }>;
170
171
 
171
- declare const _default$b: vue.DefineComponent<{
172
+ declare const _default$c: vue.DefineComponent<{
172
173
  /**
173
174
  * The name of the input field. Must be unique per form.
174
175
  */
@@ -222,6 +223,130 @@ declare const _default$b: vue.DefineComponent<{
222
223
  };
223
224
  }>>, {}>;
224
225
 
226
+ declare interface FwDropdownOption {
227
+ label: string;
228
+ value: string;
229
+ }
230
+ declare interface FwDropdownProps {
231
+ name: string;
232
+ label?: string;
233
+ rules?: string | Record<string, unknown> | (() => boolean);
234
+ options: FwDropdownOption[];
235
+ hint?: string;
236
+ placeholder?: string;
237
+ }
238
+
239
+ declare const _default$b: vue.DefineComponent<{
240
+ /**
241
+ * The select v-model
242
+ */
243
+ modelValue: {
244
+ type: StringConstructor;
245
+ };
246
+ /**
247
+ * The name of the input field. Must be unique per form.
248
+ */
249
+ name: {
250
+ type: StringConstructor;
251
+ required: true;
252
+ };
253
+ /**
254
+ * Label for the input. Also renders to an aria-label attribute
255
+ */
256
+ label: {
257
+ type: StringConstructor;
258
+ };
259
+ /**
260
+ * Validation rules. Accepts an object, string schema or validation function.
261
+ */
262
+ rules: {
263
+ type: PropType<string | Record<string, unknown> | (() => boolean) | undefined>;
264
+ };
265
+ /**
266
+ * An array of options for the dropdown menu.
267
+ */
268
+ options: {
269
+ type: PropType<FwDropdownOption[]>;
270
+ required: true;
271
+ };
272
+ /**
273
+ * The hint text shown below the input
274
+ */
275
+ hint: {
276
+ type: StringConstructor;
277
+ };
278
+ /**
279
+ * Custom placeholder text
280
+ */
281
+ placeholder: {
282
+ type: StringConstructor;
283
+ required: false;
284
+ default: string;
285
+ };
286
+ }, {
287
+ menuButtonClass: string;
288
+ menuClass: string;
289
+ menuItemClass: string;
290
+ menuItemActiveClass: (option: FwDropdownOption) => "bg-white" | "bg-none";
291
+ errors: vue.Ref<string[]>;
292
+ errorMessage: vue.Ref<string | undefined>;
293
+ meta: vee_validate.FieldMeta<unknown>;
294
+ fieldVal: vue.Ref<unknown>;
295
+ isOpen: vue.Ref<boolean>;
296
+ selectValue: vue.WritableComputedRef<string | undefined>;
297
+ selectOption: (option: FwDropdownOption) => void;
298
+ selectedOption: vue.Ref<FwDropdownOption | undefined>;
299
+ }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
300
+ /**
301
+ * The select v-model
302
+ */
303
+ modelValue: {
304
+ type: StringConstructor;
305
+ };
306
+ /**
307
+ * The name of the input field. Must be unique per form.
308
+ */
309
+ name: {
310
+ type: StringConstructor;
311
+ required: true;
312
+ };
313
+ /**
314
+ * Label for the input. Also renders to an aria-label attribute
315
+ */
316
+ label: {
317
+ type: StringConstructor;
318
+ };
319
+ /**
320
+ * Validation rules. Accepts an object, string schema or validation function.
321
+ */
322
+ rules: {
323
+ type: PropType<string | Record<string, unknown> | (() => boolean) | undefined>;
324
+ };
325
+ /**
326
+ * An array of options for the dropdown menu.
327
+ */
328
+ options: {
329
+ type: PropType<FwDropdownOption[]>;
330
+ required: true;
331
+ };
332
+ /**
333
+ * The hint text shown below the input
334
+ */
335
+ hint: {
336
+ type: StringConstructor;
337
+ };
338
+ /**
339
+ * Custom placeholder text
340
+ */
341
+ placeholder: {
342
+ type: StringConstructor;
343
+ required: false;
344
+ default: string;
345
+ };
346
+ }>>, {
347
+ placeholder: string;
348
+ }>;
349
+
225
350
  declare const _default$a: vue.DefineComponent<{
226
351
  /**
227
352
  * The header title of the card
@@ -823,10 +948,11 @@ declare const _default$3: vue.DefineComponent<{
823
948
  }>;
824
949
 
825
950
  declare type FwTableItem = Record<string, string | number>;
826
- declare type FwTableFormatFunction = (value: string | number) => string;
951
+ declare type FwTableFormatFunction = (value: string | number | object) => string;
827
952
  declare type FwTableItemOptions = Record<string, {
828
953
  formatter?: FwTableFormatFunction;
829
954
  isSortable?: boolean;
955
+ disabled?: boolean;
830
956
  }>;
831
957
  declare type FwTableSort = 'asc' | 'desc';
832
958
  declare interface FwTableProps {
@@ -853,6 +979,7 @@ declare const _default$2: vue.DefineComponent<{
853
979
  sortedIcon: (sortDir: string, column: string) => "text-body" | "text-grey-light";
854
980
  formattedText: (row: FwTableItem, column: string) => string | number;
855
981
  isColumnSortable: (column: string) => boolean | undefined;
982
+ isDisabled: (column: string) => boolean;
856
983
  }, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, Record<string, any>, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{
857
984
  items: {
858
985
  type: PropType<FwTableItem[]>;
@@ -957,4 +1084,4 @@ declare interface FwCheckboxProps {
957
1084
 
958
1085
  declare module '@frollo/frollo-web-ui/icons' { }
959
1086
 
960
- export { ButtonAnimation, ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonTypeAttribute, ButtonVariantName, _default$9 as FwButton, FwButtonProps, _default$a as FwCard, FwCardProps, _default$b as FwCheckbox, FwCheckboxProps, __default__$1 as FwEmailPulse, _default$c as FwInput, FwInputProps, FwInputType, _default$5 as FwModal, FwModalProps, _default$8 as FwNavigationMenu, _default$4 as FwProgressBar, __default__ as FwSuccessPulse, _default$6 as FwTab, _default$2 as FwTable, FwTableFormatFunction, _default$1 as FwTableHead, FwTableItem, FwTableItemOptions, FwTableProps, _default as FwTableRow, FwTableSort, _default$7 as FwTabs, _default$3 as FwTag, FwTagProps, ModalServiceProps, NavMenuItem, ProgressBarStep, TagDefinition, TagDefinitionList, TagSize, TagSizes, TagVariantName, install as default, modalService };
1087
+ export { ButtonAnimation, ButtonDefinition, ButtonDefinitionList, ButtonSize, ButtonSizes, ButtonTypeAttribute, ButtonVariantName, _default$9 as FwButton, FwButtonProps, _default$a as FwCard, FwCardProps, _default$c as FwCheckbox, FwCheckboxProps, _default$b as FwDropdown, FwDropdownOption, FwDropdownProps, __default__$1 as FwEmailPulse, _default$d as FwInput, FwInputProps, FwInputType, _default$5 as FwModal, FwModalProps, _default$8 as FwNavigationMenu, _default$4 as FwProgressBar, __default__ as FwSuccessPulse, _default$6 as FwTab, _default$2 as FwTable, FwTableFormatFunction, _default$1 as FwTableHead, FwTableItem, FwTableItemOptions, FwTableProps, _default as FwTableRow, FwTableSort, _default$7 as FwTabs, _default$3 as FwTag, FwTagProps, ModalServiceProps, NavMenuItem, ProgressBarStep, TagDefinition, TagDefinitionList, TagSize, TagSizes, TagVariantName, install as default, modalService };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frollo/frollo-web-ui",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Frollo's UI library for components, utilities and configs",
5
5
  "exports": {
6
6
  "./icons": "./icons/index.ts",
@@ -0,0 +1,113 @@
1
+ import { PropType } from 'vue';
2
+ import { FwDropdownOption } from './index.types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ /**
5
+ * The select v-model
6
+ */
7
+ modelValue: {
8
+ type: StringConstructor;
9
+ };
10
+ /**
11
+ * The name of the input field. Must be unique per form.
12
+ */
13
+ name: {
14
+ type: StringConstructor;
15
+ required: true;
16
+ };
17
+ /**
18
+ * Label for the input. Also renders to an aria-label attribute
19
+ */
20
+ label: {
21
+ type: StringConstructor;
22
+ };
23
+ /**
24
+ * Validation rules. Accepts an object, string schema or validation function.
25
+ */
26
+ rules: {
27
+ type: PropType<string | Record<string, unknown> | (() => boolean) | undefined>;
28
+ };
29
+ /**
30
+ * An array of options for the dropdown menu.
31
+ */
32
+ options: {
33
+ type: PropType<FwDropdownOption[]>;
34
+ required: true;
35
+ };
36
+ /**
37
+ * The hint text shown below the input
38
+ */
39
+ hint: {
40
+ type: StringConstructor;
41
+ };
42
+ /**
43
+ * Custom placeholder text
44
+ */
45
+ placeholder: {
46
+ type: StringConstructor;
47
+ required: false;
48
+ default: string;
49
+ };
50
+ }, {
51
+ menuButtonClass: string;
52
+ menuClass: string;
53
+ menuItemClass: string;
54
+ menuItemActiveClass: (option: FwDropdownOption) => "bg-white" | "bg-none";
55
+ errors: import("vue").Ref<string[]>;
56
+ errorMessage: import("vue").Ref<string | undefined>;
57
+ meta: import("vee-validate").FieldMeta<unknown>;
58
+ fieldVal: import("vue").Ref<unknown>;
59
+ isOpen: import("vue").Ref<boolean>;
60
+ selectValue: import("vue").WritableComputedRef<string | undefined>;
61
+ selectOption: (option: FwDropdownOption) => void;
62
+ selectedOption: import("vue").Ref<FwDropdownOption | undefined>;
63
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
64
+ /**
65
+ * The select v-model
66
+ */
67
+ modelValue: {
68
+ type: StringConstructor;
69
+ };
70
+ /**
71
+ * The name of the input field. Must be unique per form.
72
+ */
73
+ name: {
74
+ type: StringConstructor;
75
+ required: true;
76
+ };
77
+ /**
78
+ * Label for the input. Also renders to an aria-label attribute
79
+ */
80
+ label: {
81
+ type: StringConstructor;
82
+ };
83
+ /**
84
+ * Validation rules. Accepts an object, string schema or validation function.
85
+ */
86
+ rules: {
87
+ type: PropType<string | Record<string, unknown> | (() => boolean) | undefined>;
88
+ };
89
+ /**
90
+ * An array of options for the dropdown menu.
91
+ */
92
+ options: {
93
+ type: PropType<FwDropdownOption[]>;
94
+ required: true;
95
+ };
96
+ /**
97
+ * The hint text shown below the input
98
+ */
99
+ hint: {
100
+ type: StringConstructor;
101
+ };
102
+ /**
103
+ * Custom placeholder text
104
+ */
105
+ placeholder: {
106
+ type: StringConstructor;
107
+ required: false;
108
+ default: string;
109
+ };
110
+ }>>, {
111
+ placeholder: string;
112
+ }>;
113
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import FwDropdown from './fw-dropdown.vue';
2
+ export { FwDropdown };
@@ -0,0 +1,12 @@
1
+ export declare interface FwDropdownOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ export declare interface FwDropdownProps {
6
+ name: string;
7
+ label?: string;
8
+ rules?: string | Record<string, unknown> | (() => boolean);
9
+ options: FwDropdownOption[];
10
+ hint?: string;
11
+ placeholder?: string;
12
+ }
@@ -19,6 +19,7 @@ declare const _default: import("vue").DefineComponent<{
19
19
  sortedIcon: (sortDir: string, column: string) => "text-body" | "text-grey-light";
20
20
  formattedText: (row: FwTableItem, column: string) => string | number;
21
21
  isColumnSortable: (column: string) => boolean | undefined;
22
+ isDisabled: (column: string) => boolean;
22
23
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
24
  items: {
24
25
  type: PropType<FwTableItem[]>;
@@ -1,8 +1,9 @@
1
1
  export declare type FwTableItem = Record<string, string | number>;
2
- export declare type FwTableFormatFunction = (value: string | number) => string;
2
+ export declare type FwTableFormatFunction = (value: string | number | object) => string;
3
3
  export declare type FwTableItemOptions = Record<string, {
4
4
  formatter?: FwTableFormatFunction;
5
5
  isSortable?: boolean;
6
+ disabled?: boolean;
6
7
  }>;
7
8
  export declare type FwTableSort = 'asc' | 'desc';
8
9
  export declare interface FwTableProps {
@@ -1,6 +1,7 @@
1
1
  export * from './fw-form';
2
2
  export * from './fw-input';
3
3
  export * from './fw-checkbox';
4
+ export * from './fw-dropdown';
4
5
  export * from './fw-card';
5
6
  export * from './fw-button';
6
7
  export * from './fw-navigation-menu';
@@ -7,3 +7,4 @@ export * from '../components/fw-modal/index.types';
7
7
  export * from '../components/fw-progress-bar/index.types';
8
8
  export * from '../components/fw-tag/index.types';
9
9
  export * from '../components/fw-table/index.types';
10
+ export * from '../components/fw-dropdown/index.types';