@fewangsit/wangsvue-gsts 1.0.0-alpha.15 → 1.0.0-alpha.17

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,5 @@
1
- import { ClassComponent } from '../ts-helpers';
1
+ import { ClassComponent } from '../.././components/ts-helpers';
2
+
2
3
 
3
4
  export interface BadgeComponentConfigs {
4
5
  /**
@@ -25,7 +26,15 @@ export interface BadgeProps extends BadgeComponentConfigs {
25
26
  /**
26
27
  * Sets the severity level for styling purposes. This prop might be omitted if getSeverity is provided.
27
28
  */
28
- severity?: 'success' | 'info' | 'danger' | 'warning' | 'dark' | 'primary';
29
+ severity?:
30
+ | 'success'
31
+ | 'info'
32
+ | 'danger'
33
+ | 'warning'
34
+ | 'dark'
35
+ | 'primary'
36
+ | 'fixed-primary'
37
+ | 'supply-primary';
29
38
  /**
30
39
  * Specifies the format for text truncation rules based on the usage context.
31
40
  */
@@ -1,10 +1,18 @@
1
1
  import { Slot } from 'vue';
2
- import { BadgeProps } from '../../components/badge/Badge.vue.d';
3
- import { ClassComponent, HintedString } from '../ts-helpers.d';
2
+ import { BadgeProps } from '../.././components/badge/Badge.vue.d';
3
+ import { ClassComponent, HintedString } from '../.././components/ts-helpers';
4
+
4
5
 
5
6
  export type ObjectBadge = {
6
7
  text: string;
7
- severity: 'success' | 'danger' | 'warning' | 'dark' | 'primary';
8
+ severity:
9
+ | 'success'
10
+ | 'danger'
11
+ | 'warning'
12
+ | 'dark'
13
+ | 'primary'
14
+ | 'fixed-primary'
15
+ | 'supply-primary';
8
16
  };
9
17
 
10
18
  export interface BadgeGroupProps
@@ -19,7 +27,14 @@ export interface BadgeGroupProps
19
27
  * @default undefined
20
28
  */
21
29
  textMoreSeverity?: HintedString<
22
- 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast'
30
+ | 'secondary'
31
+ | 'info'
32
+ | 'success'
33
+ | 'warning'
34
+ | 'danger'
35
+ | 'contrast'
36
+ | 'fixed-primary'
37
+ | 'supply-primary'
23
38
  >;
24
39
  /**
25
40
  * The text shown on the more button
@@ -1,8 +1,9 @@
1
1
  import { ButtonHTMLAttributes, VNode } from 'vue';
2
- import { WangsIcons } from '../icon/Icon.vue.d';
3
2
  import { TooltipOptions } from 'primevue/tooltip';
4
- import { GlobalComponentConstructor } from '../ts-helpers.d';
5
- import { ClassComponent, HintedString } from '../ts-helpers';
3
+ import { GlobalComponentConstructor } from '../.././components/ts-helpers.d';
4
+ import { ClassComponent, HintedString } from '../.././components/ts-helpers';
5
+ import { WangsIcons } from '../.././components/icon/Icon.vue.d';
6
+
6
7
 
7
8
  /**
8
9
  * Defines valid properties in Button component.
@@ -55,7 +56,14 @@ export interface ButtonProps extends /* @vue-ignore */ ButtonHTMLAttributes {
55
56
  */
56
57
  badgeSeverity?:
57
58
  | HintedString<
58
- 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'contrast'
59
+ | 'secondary'
60
+ | 'info'
61
+ | 'success'
62
+ | 'warning'
63
+ | 'danger'
64
+ | 'contrast'
65
+ | 'fixed-primary'
66
+ | 'supply-primary'
59
67
  >
60
68
  | null
61
69
  | undefined;
@@ -1,6 +1,8 @@
1
+ import { WangsIcons } from '../.././components/icon/Icon.vue.d';
2
+ import { ClassComponent } from '../.././components/ts-helpers';
3
+ import { GlobalComponentConstructor } from '../.././components/ts-helpers.d';
1
4
  import { Slot } from 'vue';
2
- import { WangsIcons } from '../icon/Icon.vue.d';
3
- import { ClassComponent, GlobalComponentConstructor } from '../ts-helpers';
5
+
4
6
 
5
7
  type ConfirmDialogSeverity = 'success' | 'danger';
6
8
 
@@ -37,7 +39,10 @@ export interface DialogConfirmProps {
37
39
  *
38
40
  * @default undefined - to fallback to props.severity
39
41
  */
40
- confirmButtonSeverity?: ConfirmDialogSeverity;
42
+ confirmButtonSeverity?:
43
+ | ConfirmDialogSeverity
44
+ | 'fixed-primary'
45
+ | 'supply-primary';
41
46
  /**
42
47
  * The boolean modelValue to show dialog.
43
48
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-gsts",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.17",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Global Settings Tagsamurai VueJS Component Library",
6
6
  "type": "module",
@@ -1,114 +1,3 @@
1
- import { WangsIcons } from '../components/icon/Icon.vue.d';
2
- export type ToastSeverity = 'success' | 'error' | 'info';
3
- export interface ToastParams {
4
- /**
5
- * The main message to display in the toast. Will be formatted based on template message.
6
- */
7
- message: string;
8
- /**
9
- * Indicates whether the message is customized and does not follow the default message template.
10
- * If true, custom formatting will be applied.
11
- */
12
- customMessage?: boolean;
13
- /**
14
- * The severity level of the toast message.
15
- * Can be 'success', 'error', or 'info'.
16
- */
17
- severity?: ToastSeverity;
18
- /**
19
- * The icon to display in the toast.
20
- */
21
- icon?: WangsIcons;
22
- /**
23
- * The custom CSS class to apply to the icon.
24
- */
25
- iconClass?: any;
26
- /**
27
- * The error object from a catch statement, used to provide additional details for error toasts.
28
- * Accepts any type of error object.
29
- */
30
- error?: unknown;
31
- /**
32
- * The duration for which the toast will be displayed, in milliseconds.
33
- * Set to 0 to show the message infinitely.
34
- *
35
- * @default 3000 - 3 seconds
36
- */
37
- life?: number;
38
- /**
39
- * The name of the message group to which this toast belongs.
40
- */
41
- group?: string;
42
- /**
43
- * Unique identifier of the toast message.
44
- */
45
- messageId?: string;
46
- }
47
- export interface ToastMethod {
48
- add(params: ToastParams): void;
49
- /**
50
- * Clears the messages that belongs to the group.
51
- * @param {string} group - Name of the message group.
52
- */
53
- removeGroup(group: string): void;
54
- removeAllGroups(): void;
55
- }
56
- /**
57
- * Configuration options for the `useToast` hook.
58
- */
59
- export interface UseToastConfig {
60
- /**
61
- * Default message templates for each severity level.
62
- * Keys represent the severity, and values are the template strings.
63
- *
64
- * @example
65
- * {
66
- * success: 'Success, {message}',
67
- * error: 'Error, {message} {additionalMessage}',
68
- * info: 'Info, {message} {additionalMessage}',
69
- * }
70
- */
71
- template?: Record<string, string>;
72
- /**
73
- * Icons for each severity level.
74
- * Keys represent the severity, and values are the corresponding icon identifiers.
75
- *
76
- * @example
77
- * {
78
- * success: 'emotion-happy-fill',
79
- * error: 'emotion-unhappy-fill',
80
- * }
81
- */
82
- icons?: Record<string, WangsIcons>;
83
- }
84
- /**
85
- * Hook to create and manage toast notifications.
86
- *
87
- * @param {UseToastConfig} config - Configuration object for the toast notifications.
88
- * Refer to {@link UseToastConfig} for the structure and details of this object.
89
- *
90
- * @returns {ToastMethod} A method to trigger toast notifications.
91
- * The method accepts {@link ToastParams} to customize individual notifications.
92
- *
93
- * @example
94
- * const toast = useToast({
95
- * template: {
96
- * success: 'Success, {message}',
97
- * error: 'Error, {message} {additionalMessage}',
98
- * info: 'Info, {message} {additionalMessage}',
99
- * },
100
- * icons: {
101
- * success: 'emotion-happy-fill',
102
- * error: 'emotion-unhappy-fill',
103
- * }
104
- * });
105
- *
106
- * // Overiding the default config with ToastParams
107
- * toast.add({
108
- * message: 'Operation completed successfully!',
109
- * customMessage: true,
110
- * icon: 'custom-success-icon',
111
- * });
112
- */
113
- declare const useToast: ({ icons, template }?: UseToastConfig) => ToastMethod;
1
+ import { ToastMethod } from '.././utils';
2
+ declare const useToast: () => ToastMethod;
114
3
  export default useToast;