@mythpe/quasar-ui-qui 0.0.99 → 0.1.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.
- package/package.json +1 -1
- package/src/composable/useMyth.ts +11 -19
package/package.json
CHANGED
|
@@ -223,26 +223,18 @@ export const useMyth = () => {
|
|
|
223
223
|
* Copy text
|
|
224
224
|
* @param text
|
|
225
225
|
*/
|
|
226
|
-
const copyText = async (text: string | any) => copyToClipboard(text)
|
|
226
|
+
const copyText = async (text: string | any) => copyToClipboard(text).then(() => alertSuccess(__('messages.text_copied')))
|
|
227
227
|
|
|
228
|
-
const quasarNotifyOptions = (opts: QNotifyCreateOptions | string): QNotifyCreateOptions => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
const
|
|
238
|
-
return q.notify(quasarNotifyOptions(opts))
|
|
239
|
-
}
|
|
240
|
-
const alertSuccess = (message: string) => {
|
|
241
|
-
return alertMessage({ type: 'positive', message })
|
|
242
|
-
}
|
|
243
|
-
const alertError = (message: string) => {
|
|
244
|
-
return alertMessage({ type: 'negative', message })
|
|
245
|
-
}
|
|
228
|
+
const quasarNotifyOptions = (opts: QNotifyCreateOptions | string): QNotifyCreateOptions => ({
|
|
229
|
+
badgeColor: 'primary',
|
|
230
|
+
progress: !0,
|
|
231
|
+
...pluginOptions.value.notify as any,
|
|
232
|
+
message: typeof opts === 'string' ? __(opts) : __(opts.message),
|
|
233
|
+
...(typeof opts !== 'string' ? opts : {})
|
|
234
|
+
})
|
|
235
|
+
const alertMessage = (opts: Vue3MAlertMessageOptions): Vue3MAlertMessage => q.notify(quasarNotifyOptions(opts))
|
|
236
|
+
const alertSuccess = (message: string) => alertMessage({ type: 'positive', message })
|
|
237
|
+
const alertError = (message: string) => alertMessage({ type: 'negative', message })
|
|
246
238
|
const confirmMessage = (message?: string, title?: string, opts?: Partial<QDialogOptions> & Partial<QDialogProps>): Vue3MConfirmMessage => {
|
|
247
239
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
248
240
|
// @ts-ignore
|