@maltjoy/core-vue 1.0.0-beta.4 → 1.0.0-beta.6

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.
@@ -1,4 +1,4 @@
1
- import { GENERIC_VARIANTS, SIZES } from '@/types';
1
+ import { GENERIC_VARIANTS, SIZES, POSITIONS } from '@/types';
2
2
  /** BUTTON VARIANTS/COLORS */
3
3
  declare const BUTTONS_SPECIFIC_VARIANTS: readonly ["main", "admin", "ghost"];
4
4
  export declare const BUTTON_VARIANTS: ((typeof GENERIC_VARIANTS)[number] | (typeof BUTTONS_SPECIFIC_VARIANTS)[number])[];
@@ -6,4 +6,5 @@ export type ButtonVariants = (typeof BUTTON_VARIANTS)[number];
6
6
  /** BUTTON SIZES */
7
7
  export type ButtonSizes = Exclude<(typeof SIZES)[number], 'xlarge'>;
8
8
  export declare const BUTTON_SIZES: ButtonSizes[];
9
+ export type ButtonIconPositions = (typeof POSITIONS)[number];
9
10
  export {};
@@ -11,6 +11,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
11
11
  };
12
12
  /** Name of the icon, placed before the text */
13
13
  icon: StringConstructor;
14
+ /** Left to the text or right */
15
+ iconPosition: {
16
+ type: PropType<"left" | "right">;
17
+ default: string;
18
+ };
14
19
  /** Change the component's state and display a JoySpinner. */
15
20
  loading: {
16
21
  type: BooleanConstructor;
@@ -39,6 +44,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
39
44
  };
40
45
  /** Name of the icon, placed before the text */
41
46
  icon: StringConstructor;
47
+ /** Left to the text or right */
48
+ iconPosition: {
49
+ type: PropType<"left" | "right">;
50
+ default: string;
51
+ };
42
52
  /** Change the component's state and display a JoySpinner. */
43
53
  loading: {
44
54
  type: BooleanConstructor;
@@ -59,6 +69,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
59
69
  }>>, {
60
70
  circle: boolean;
61
71
  variant: "main" | "ghost" | "secondary" | "primary" | "admin";
72
+ iconPosition: "left" | "right";
62
73
  loading: boolean;
63
74
  size: ButtonSizes;
64
75
  }>, {
@@ -97,11 +97,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
97
97
  onBlur?: (() => any) | undefined;
98
98
  "onUpdate:checked"?: ((value: boolean) => any) | undefined;
99
99
  }, {
100
+ value: string;
100
101
  checked: boolean;
101
102
  disabled: boolean;
102
103
  indeterminate: boolean;
103
104
  displayFocus: boolean;
104
- value: string;
105
105
  required: boolean;
106
106
  }>, {
107
107
  default: (_: {}) => any;
@@ -13,6 +13,7 @@ export interface Option {
13
13
  * @default false
14
14
  */
15
15
  checked?: boolean;
16
+ [k: string]: any;
16
17
  }
17
18
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
19
  /** DOM valid selector to give to Vue3 Teleport "to" property */
@@ -34,7 +35,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
34
35
  };
35
36
  /** Dropdown vertical position according to the trigger */
36
37
  direction: {
37
- type: PropType<"up" | "down">;
38
+ type: PropType<"down" | "up">;
38
39
  default: string;
39
40
  };
40
41
  /** Dropdown horizontal justify according to the trigger */
@@ -85,7 +86,11 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
85
86
  }, {
86
87
  showDropdownList: import("vue").Ref<boolean>;
87
88
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
88
- "update:modelValue": (value: string) => void;
89
+ "update:modelValue": (value: string | undefined) => void;
90
+ } & {
91
+ "dropdown:open": () => void;
92
+ } & {
93
+ "dropdown:hide": () => void;
89
94
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
95
  /** DOM valid selector to give to Vue3 Teleport "to" property */
91
96
  appendTo: {
@@ -106,7 +111,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
106
111
  };
107
112
  /** Dropdown vertical position according to the trigger */
108
113
  direction: {
109
- type: PropType<"up" | "down">;
114
+ type: PropType<"down" | "up">;
110
115
  default: string;
111
116
  };
112
117
  /** Dropdown horizontal justify according to the trigger */
@@ -155,7 +160,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
155
160
  default: string;
156
161
  };
157
162
  }>> & {
158
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
163
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
164
+ "onDropdown:open"?: (() => any) | undefined;
165
+ "onDropdown:hide"?: (() => any) | undefined;
159
166
  }, {
160
167
  size: DropdownListSizes;
161
168
  options: Option[];
@@ -165,7 +172,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
165
172
  appendTo: string | import("vue").RendererElement | null | undefined;
166
173
  disableTeleport: boolean;
167
174
  closeOnSelect: boolean;
168
- direction: "up" | "down";
175
+ direction: "down" | "up";
169
176
  justify: "left" | "right";
170
177
  dropdownGap: string;
171
178
  }>, {
@@ -13,8 +13,12 @@ export interface Option {
13
13
  * @default false
14
14
  */
15
15
  checked?: boolean;
16
+ [k: string]: any;
16
17
  }
17
18
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
19
+ /**
20
+ * In order to make it work with v-model, you need to pass for each option, a value or an ID.
21
+ */
18
22
  options: {
19
23
  type: PropType<Option[]>;
20
24
  validator(value: Array<Option>): boolean;
@@ -39,10 +43,13 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
39
43
  }, {
40
44
  isSelected: import("vue").ComputedRef<(option: Option) => boolean>;
41
45
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
42
- "update:modelValue": (value: string) => void;
46
+ "update:modelValue": (value: string | undefined) => void;
43
47
  } & {
44
48
  "close:dropdownList": () => void;
45
49
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
50
+ /**
51
+ * In order to make it work with v-model, you need to pass for each option, a value or an ID.
52
+ */
46
53
  options: {
47
54
  type: PropType<Option[]>;
48
55
  validator(value: Array<Option>): boolean;
@@ -65,7 +72,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
65
72
  default: string;
66
73
  };
67
74
  }>> & {
68
- "onUpdate:modelValue"?: ((value: string) => any) | undefined;
75
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
69
76
  "onClose:dropdownList"?: (() => any) | undefined;
70
77
  }, {
71
78
  size: DropdownListSizes;
@@ -57,8 +57,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
57
57
  }>> & {
58
58
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
59
59
  }, {
60
- disabled: boolean;
61
60
  value: string;
61
+ disabled: boolean;
62
62
  required: boolean;
63
63
  modelValue: boolean;
64
64
  invalid: boolean;