@maltjoy/core-vue 3.17.2 → 3.18.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,96 @@
1
+ import { PropType } from 'vue';
2
+ import { Emitter } from 'mitt';
3
+ import { TJoySnackbarEvents, TJoySnackbarLevels } from './JoySnackbar.types';
4
+ declare const _default: import("vue").DefineComponent<{
5
+ level: {
6
+ type: PropType<TJoySnackbarLevels>;
7
+ default: string;
8
+ };
9
+ closable: {
10
+ type: BooleanConstructor;
11
+ default: boolean;
12
+ };
13
+ /** Default snackar display duration. Default to 5000ms */
14
+ duration: {
15
+ type: NumberConstructor;
16
+ default: number;
17
+ };
18
+ /** The title if you need to set one */
19
+ header: {
20
+ type: StringConstructor;
21
+ };
22
+ /** Main snackbar message. Mandatory */
23
+ message: {
24
+ type: StringConstructor;
25
+ required: true;
26
+ };
27
+ /** If you need to trigger an action from the generated snackbar, use this field to create a CTA.
28
+ *
29
+ * Use `bus.on('snackbar:action-click')` to catch the event.
30
+ */
31
+ actionText: {
32
+ type: StringConstructor;
33
+ };
34
+ frozen: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ /** You don't need to explicitely set the bus property as the snackbar service is already handling it. */
39
+ bus: {
40
+ type: PropType<Emitter<TJoySnackbarEvents>>;
41
+ };
42
+ /** @internal */
43
+ instanceNb: {
44
+ type: NumberConstructor;
45
+ };
46
+ }, {
47
+ isOpen: import("vue").Ref<boolean>;
48
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
49
+ level: {
50
+ type: PropType<TJoySnackbarLevels>;
51
+ default: string;
52
+ };
53
+ closable: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ /** Default snackar display duration. Default to 5000ms */
58
+ duration: {
59
+ type: NumberConstructor;
60
+ default: number;
61
+ };
62
+ /** The title if you need to set one */
63
+ header: {
64
+ type: StringConstructor;
65
+ };
66
+ /** Main snackbar message. Mandatory */
67
+ message: {
68
+ type: StringConstructor;
69
+ required: true;
70
+ };
71
+ /** If you need to trigger an action from the generated snackbar, use this field to create a CTA.
72
+ *
73
+ * Use `bus.on('snackbar:action-click')` to catch the event.
74
+ */
75
+ actionText: {
76
+ type: StringConstructor;
77
+ };
78
+ frozen: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
82
+ /** You don't need to explicitely set the bus property as the snackbar service is already handling it. */
83
+ bus: {
84
+ type: PropType<Emitter<TJoySnackbarEvents>>;
85
+ };
86
+ /** @internal */
87
+ instanceNb: {
88
+ type: NumberConstructor;
89
+ };
90
+ }>>, {
91
+ duration: number;
92
+ level: TJoySnackbarLevels;
93
+ closable: boolean;
94
+ frozen: boolean;
95
+ }, {}>;
96
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { App } from 'vue';
2
+ import { IJoynackbarServiceOptions, IJoynackbarServiceReturn } from './JoySnackbar.types';
3
+ export declare let snackbarMountedInstances: App<Element>[];
4
+ /**
5
+ * For testing purpose, it's called before test execution.
6
+ * @return {void}
7
+ */
8
+ export declare function resetCount(): void;
9
+ /**
10
+ *
11
+ * @param {Object} options - createAllSnackbarsContainer options
12
+ * @param {string } options.appendTo - where to injecte the snackbar shell
13
+ * @param {string } options.defaultMountSelector - where to injecte the snackbar shell
14
+ * @return {void}
15
+ */
16
+ export declare function createAllSnackbarsContainer(options?: {
17
+ appendTo: string;
18
+ defaultMountSelector: string;
19
+ }): void;
20
+ /**
21
+ * @param {Object} options - pushVJoySnackbar options. Props are mandatory.
22
+ * @param {Object} options.props - VJoySnackbar properties. props.message is mandatory.
23
+ * @returns {Object} - Returns snackbarEventBus and snackbarApp instance
24
+ */
25
+ export declare function pushVJoySnackbar(options: IJoynackbarServiceOptions): IJoynackbarServiceReturn;
@@ -0,0 +1 @@
1
+ export * from './VJoySnackbarService';
@@ -10,7 +10,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
10
10
  * Id of the tab, used for aria prop
11
11
  */
12
12
  tab: {
13
- type: StringConstructor;
13
+ type: (StringConstructor | NumberConstructor)[];
14
14
  required: true;
15
15
  };
16
16
  /**
@@ -41,7 +41,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
41
41
  * Id of the tab, used for aria prop
42
42
  */
43
43
  tab: {
44
- type: StringConstructor;
44
+ type: (StringConstructor | NumberConstructor)[];
45
45
  required: true;
46
46
  };
47
47
  /**
@@ -20,7 +20,6 @@ declare const _default: import("vue").DefineComponent<{
20
20
  /** Mandatory, especially if you deal with tags list and v-model */
21
21
  value: {
22
22
  type: StringConstructor;
23
- required: true;
24
23
  default: string;
25
24
  };
26
25
  draggable: {
@@ -61,7 +60,6 @@ declare const _default: import("vue").DefineComponent<{
61
60
  /** Mandatory, especially if you deal with tags list and v-model */
62
61
  value: {
63
62
  type: StringConstructor;
64
- required: true;
65
63
  default: string;
66
64
  };
67
65
  draggable: {
@@ -8,16 +8,26 @@ declare const _default: import("vue").DefineComponent<{
8
8
  modelValue: {
9
9
  type: PropType<TJoyTagsListModel>;
10
10
  };
11
+ /** Tags list. Array of objects containing at least a label. "value" is mandatory if dealing with removable or selectable tags */
11
12
  tags: {
12
13
  type: PropType<TJoyTagsList>;
13
14
  default(): never[];
14
- required: true;
15
15
  };
16
16
  /** You can either pass this property to make all generated tags removable, or pass the `removable: true` to each tag in "tags" prop. */
17
17
  removable: {
18
18
  type: BooleanConstructor;
19
19
  default: boolean;
20
20
  };
21
+ /** Make all VJoyTag selectable. Can be overriden by setting selectable: false in specific tags property entry. */
22
+ selectable: {
23
+ type: BooleanConstructor;
24
+ default: boolean;
25
+ };
26
+ /** Apply variant for all VJoyTag. Can be overriden by setting a variant property in specific tags entry. */
27
+ variant: {
28
+ type: PropType<"primary" | "secondary" | "important" | "inactive" | "pending" | "pricing">;
29
+ default: string;
30
+ };
21
31
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
32
  "update:modelValue": (tags: TJoyTagsListModel) => void;
23
33
  removeTag: (tagValue: string) => void;
@@ -29,21 +39,33 @@ declare const _default: import("vue").DefineComponent<{
29
39
  modelValue: {
30
40
  type: PropType<TJoyTagsListModel>;
31
41
  };
42
+ /** Tags list. Array of objects containing at least a label. "value" is mandatory if dealing with removable or selectable tags */
32
43
  tags: {
33
44
  type: PropType<TJoyTagsList>;
34
45
  default(): never[];
35
- required: true;
36
46
  };
37
47
  /** You can either pass this property to make all generated tags removable, or pass the `removable: true` to each tag in "tags" prop. */
38
48
  removable: {
39
49
  type: BooleanConstructor;
40
50
  default: boolean;
41
51
  };
52
+ /** Make all VJoyTag selectable. Can be overriden by setting selectable: false in specific tags property entry. */
53
+ selectable: {
54
+ type: BooleanConstructor;
55
+ default: boolean;
56
+ };
57
+ /** Apply variant for all VJoyTag. Can be overriden by setting a variant property in specific tags entry. */
58
+ variant: {
59
+ type: PropType<"primary" | "secondary" | "important" | "inactive" | "pending" | "pricing">;
60
+ default: string;
61
+ };
42
62
  }>> & {
43
63
  "onUpdate:modelValue"?: ((tags: TJoyTagsListModel) => any) | undefined;
44
64
  onRemoveTag?: ((tagValue: string) => any) | undefined;
45
65
  }, {
66
+ variant: "primary" | "secondary" | "important" | "inactive" | "pending" | "pricing";
46
67
  align: "left" | "right" | "center";
68
+ selectable: boolean;
47
69
  removable: boolean;
48
70
  tags: TJoyTagsList;
49
71
  }, {}>;
@@ -80,10 +80,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
80
80
  default: string;
81
81
  };
82
82
  }>>, {
83
+ wrap: "nowrap" | "wrap";
84
+ justify: "center" | "space-between" | "flex-start" | "flex-end";
83
85
  align: "center" | "flex-start" | "flex-end" | "stretch";
84
86
  direction: "row" | "column";
85
- justify: "center" | "space-between" | "flex-start" | "flex-end";
86
- wrap: "nowrap" | "wrap";
87
87
  itemStretch: boolean;
88
88
  noMargin: boolean;
89
89
  columnGap: "0" | "1" | "2" | "3" | "12" | "10" | "4" | "5" | "6" | "7" | "8" | "9" | "11";
@@ -4,6 +4,7 @@ export * from './JoyBadge/JoyBadge.types';
4
4
  export * from './JoyBadgeLevel/JoyBadgeLevel.types';
5
5
  export * from './JoyButton/JoyButton.types';
6
6
  export * from './JoyCompanyAvatar/JoyCompanyAvatar.types';
7
+ export * from './JoyDialog/JoyDialog.types';
7
8
  export * from './JoyDropdown/JoyDropdown.types';
8
9
  export * from './JoyDropdownList/JoyDropdownList.types';
9
10
  export * from './JoyFunnel/JoyFunnel.types';
@@ -23,6 +24,7 @@ export * from './JoyRadioGroup/JoyRadioGroup.types';
23
24
  export * from './JoyScreenLoader/VJoyScreenLoader.types';
24
25
  export * from './JoySelect/JoySelect.types';
25
26
  export * from './JoySeparator/JoySeparator.types';
27
+ export * from './JoySnackbar/JoySnackbar.types';
26
28
  export * from './JoySpinner/JoySpinner.types';
27
29
  export * from './JoyTag/JoyTag.types';
28
30
  export * from './JoyTagsList/JoyTagsList.types';
@@ -7,6 +7,8 @@ import VJoyButton from '@/components/JoyButton/VJoyButton.vue';
7
7
  import VJoyCheckbox from '@/components/JoyCheckbox/VJoyCheckbox.vue';
8
8
  import VJoyCompanyAvatar from '@/components/JoyCompanyAvatar/VJoyCompanyAvatar.vue';
9
9
  import VJoyCounter from '@/components/JoyCounter/VJoyCounter.vue';
10
+ import VJoyDialog from '@/components/JoyDialog/VJoyDialog.vue';
11
+ import VJoyDialogTrigger from '@/components/JoyDialogTrigger/VJoyDialogTrigger.vue';
10
12
  import VJoyDividerCta from '@/components/JoyDividerCta/VJoyDividerCta.vue';
11
13
  import VJoyDropdown from '@/components/JoyDropdown/VJoyDropdown.vue';
12
14
  import VJoyDropdownList from '@/components/JoyDropdownList/VJoyDropdownList.vue';
@@ -38,6 +40,7 @@ import VJoySelect from '@/components/JoySelect/VJoySelect.vue';
38
40
  import VJoySelectableItem from '@/components/JoySelectableItem/VJoySelectableItem.vue';
39
41
  import VJoySelectableItemGroup from '@/components/JoySelectableItemGroup/VJoySelectableItemGroup.vue';
40
42
  import VJoySeparator from '@/components/JoySeparator/VJoySeparator.vue';
43
+ import VJoySnackbar from '@/components/JoySnackbar/VJoySnackbar.vue';
41
44
  import VJoySpinner from '@/components/JoySpinner/VJoySpinner.vue';
42
45
  import VJoyStep from '@/components/JoyStep/VJoyStep.vue';
43
46
  import VJoyStepper from '@/components/JoyStepper/VJoyStepper.vue';
@@ -53,4 +56,4 @@ import VJoyToggle from '@/components/JoyToggle/VJoyToggle.vue';
53
56
  import VJoyTooltip from '@/components/JoyTooltip/VJoyTooltip.vue';
54
57
  import VJoyUserCard from '@/components/JoyUserCard/VJoyUserCard.vue';
55
58
  import VJoyWrapper from '@/components/JoyWrapper/VJoyWrapper.vue';
56
- export { VJoyAvailability, VJoyAvatar, VJoyAvatarsList, VJoyBadge, VJoyBadgeLevel, VJoyButton, VJoyCheckbox, VJoyCompanyAvatar, VJoyCounter, VJoyDividerCta, VJoyDropdown, VJoyDropdownList, VJoyFilterBar, VJoyFilterBarButton, VJoyFooter, VJoyFormError, VJoyFormFieldSkeleton, VJoyFunnel, VJoyHeader, VJoyHighlight, VJoyIcon, VJoyIndicator, VJoyIndicators, VJoyInput, VJoyLabel, VJoyLink, VJoyMenu, VJoyMultiCheckbox, VJoyPagination, VJoyPanel, VJoyPanelSection, VJoyProgressBar, VJoyRadio, VJoyRadioGroup, VJoyRatingStars, VJoyScreenLoader, VJoySelect, VJoySelectableItem, VJoySelectableItemGroup, VJoySeparator, VJoySpinner, VJoyStep, VJoyStepper, VJoyTab, VJoyTabs, VJoyTag, VJoyTagsList, VJoyTemplate, VJoyTemplateShape, VJoyText, VJoyTextarea, VJoyToggle, VJoyTooltip, VJoyUserCard, VJoyWrapper, };
59
+ export { VJoyAvailability, VJoyAvatar, VJoyAvatarsList, VJoyBadge, VJoyBadgeLevel, VJoyButton, VJoyCheckbox, VJoyCompanyAvatar, VJoyCounter, VJoyDialog, VJoyDialogTrigger, VJoyDividerCta, VJoyDropdown, VJoyDropdownList, VJoyFilterBar, VJoyFilterBarButton, VJoyFooter, VJoyFormError, VJoyFormFieldSkeleton, VJoyFunnel, VJoyHeader, VJoyHighlight, VJoyIcon, VJoyIndicator, VJoyIndicators, VJoyInput, VJoyLabel, VJoyLink, VJoyMenu, VJoyMultiCheckbox, VJoyPagination, VJoyPanel, VJoyPanelSection, VJoyProgressBar, VJoyRadio, VJoyRadioGroup, VJoyRatingStars, VJoyScreenLoader, VJoySelect, VJoySelectableItem, VJoySelectableItemGroup, VJoySeparator, VJoySnackbar, VJoySpinner, VJoyStep, VJoyStepper, VJoyTab, VJoyTabs, VJoyTag, VJoyTagsList, VJoyTemplate, VJoyTemplateShape, VJoyText, VJoyTextarea, VJoyToggle, VJoyTooltip, VJoyUserCard, VJoyWrapper, };
@@ -1,6 +1,9 @@
1
1
  import type { App } from 'vue';
2
2
  import '../style.scss';
3
- export * from './';
4
3
  export declare const JoyVuePlugin: {
5
- install: (app: App) => void;
4
+ install: (app: App, options?: {
5
+ env: 'client' | 'server';
6
+ }) => void;
6
7
  };
8
+ export * from './';
9
+ export * from './JoySnackbar';
@@ -0,0 +1,3 @@
1
+ import { Emitter } from 'mitt';
2
+ declare function createEventBus<T extends Record<string, unknown>>(): Emitter<T>;
3
+ export { createEventBus };
@@ -0,0 +1 @@
1
+ export * from './bus';
@@ -1,6 +1,15 @@
1
1
  import { TJoyIconsNames } from '@/components/JoyIcon/JoyIcon.types';
2
2
  import { Ref } from 'vue';
3
3
  import { LEVELS } from '../types';
4
+ /**
5
+ * Check if you are working on dev environment. Based on `getMode` util that returns import.meta.env.MODE,
6
+ */
7
+ export declare const isDevMode: boolean;
4
8
  export declare function iconLevel(level: (typeof LEVELS)[number]): TJoyIconsNames;
5
9
  export declare function focusOnFirstFocusableFormField(root: Ref): any;
6
10
  export declare const generateRandomId: (length?: number) => string;
11
+ /**
12
+ * @param {Boolean} prevent - If you want to prevent scrolling or enable it again. Used by dialog component
13
+ * @return {void}
14
+ */
15
+ export declare function preventBodyScroll(prevent: boolean): void;