sprintify-ui 0.8.29 → 0.8.30

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.
@@ -4,6 +4,7 @@ declare const _default: import("vue").DefineComponent<{}, {
4
4
  color: "info" | "success" | "danger" | "warning";
5
5
  title: string;
6
6
  message: string;
7
+ errorMessage: string | null | undefined;
7
8
  html: boolean;
8
9
  input: false | {
9
10
  label?: string | undefined;
@@ -13,6 +13,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
13
13
  default: string;
14
14
  type: StringConstructor;
15
15
  };
16
+ errorMessage: {
17
+ default: string;
18
+ type: PropType<string | null | undefined>;
19
+ };
16
20
  html: {
17
21
  default: boolean;
18
22
  type: BooleanConstructor;
@@ -45,6 +49,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
45
49
  default: string;
46
50
  type: StringConstructor;
47
51
  };
52
+ errorMessage: {
53
+ default: string;
54
+ type: PropType<string | null | undefined>;
55
+ };
48
56
  html: {
49
57
  default: boolean;
50
58
  type: BooleanConstructor;
@@ -67,6 +75,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
67
75
  }, {
68
76
  title: string;
69
77
  message: string;
78
+ errorMessage: string | null | undefined;
70
79
  html: boolean;
71
80
  input: boolean | InputConfigProps;
72
81
  confirmText: string;
@@ -120,6 +120,7 @@ export interface DialogOptions {
120
120
  color?: 'info' | 'success' | 'danger' | 'warning';
121
121
  title: string;
122
122
  message: string;
123
+ errorMessage?: string | null | undefined;
123
124
  html?: boolean;
124
125
  input?: InputConfigProps | false;
125
126
  confirmText?: string;
@@ -133,6 +134,7 @@ export interface Dialog {
133
134
  color: 'info' | 'success' | 'danger' | 'warning';
134
135
  title: string;
135
136
  message: string;
137
+ errorMessage: string | null | undefined;
136
138
  html: boolean;
137
139
  input: InputConfigProps | false;
138
140
  confirmText: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.8.29",
3
+ "version": "0.8.30",
4
4
  "scripts": {
5
5
  "build": "rimraf dist && vue-tsc && vite build",
6
6
  "build-fast": "rimraf dist && vite build",
@@ -46,6 +46,7 @@
46
46
  :color="dialog.color"
47
47
  :title="dialog.title"
48
48
  :message="dialog.message"
49
+ :error-message="dialog.errorMessage"
49
50
  :confirm-text="dialog.confirmText"
50
51
  :html="dialog.html"
51
52
  :input="dialog.input"
@@ -79,3 +79,17 @@ WithInput.args = {
79
79
  placeholder: 'Password',
80
80
  },
81
81
  };
82
+
83
+ export const ErrorMessage = Template.bind({});
84
+ ErrorMessage.args = {
85
+ color: 'danger',
86
+ title: 'Please confirm your password',
87
+ errorMessage: 'Invalid password',
88
+ input: {
89
+ label: 'Enter your password',
90
+ type: 'password',
91
+ size: 'sm',
92
+ required: true,
93
+ placeholder: 'Password',
94
+ },
95
+ };
@@ -83,6 +83,15 @@
83
83
  class="w-full"
84
84
  />
85
85
  </BaseField>
86
+
87
+ <BaseAlert
88
+ v-if="errorMessage"
89
+ class="mt-4"
90
+ color="danger"
91
+ bordered
92
+ >
93
+ {{ errorMessage }}
94
+ </BaseAlert>
86
95
  </slot>
87
96
  </div>
88
97
  </div>
@@ -116,6 +125,7 @@ import BaseButton from './BaseButton.vue';
116
125
  import BaseInput from './BaseInput.vue';
117
126
  import BaseField from './BaseField.vue';
118
127
  import BasePassword from './BasePassword.vue';
128
+ import BaseAlert from './BaseAlert.vue';
119
129
  import { InputConfigProps } from '@/types';
120
130
 
121
131
  const props = defineProps({
@@ -131,6 +141,10 @@ const props = defineProps({
131
141
  default: '',
132
142
  type: String,
133
143
  },
144
+ errorMessage: {
145
+ default: '',
146
+ type: [String, null, undefined] as PropType<string | null | undefined>,
147
+ },
134
148
  html: {
135
149
  default: false,
136
150
  type: Boolean,
@@ -17,6 +17,7 @@ export const useDialogsStore = defineStore('dialogs', {
17
17
  color: options.color ?? 'info',
18
18
  title: options.title,
19
19
  message: options.message,
20
+ errorMessage: options.errorMessage,
20
21
  html: options.html ?? false,
21
22
  confirmText: options.confirmText ?? t('sui.confirm'),
22
23
  cancelText: options.cancelText ?? t('sui.cancel'),
@@ -152,6 +152,7 @@ export interface DialogOptions {
152
152
  color?: 'info' | 'success' | 'danger' | 'warning';
153
153
  title: string;
154
154
  message: string;
155
+ errorMessage?: string | null | undefined;
155
156
  html?: boolean;
156
157
  input?: InputConfigProps | false;
157
158
  confirmText?: string;
@@ -166,6 +167,7 @@ export interface Dialog {
166
167
  color: 'info' | 'success' | 'danger' | 'warning';
167
168
  title: string;
168
169
  message: string;
170
+ errorMessage: string | null | undefined;
169
171
  html: boolean;
170
172
  input: InputConfigProps | false;
171
173
  confirmText: string;