@mythpe/quasar-ui-qui 0.0.98 → 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
CHANGED
|
@@ -76,7 +76,7 @@ defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
|
76
76
|
const loading = defineModel<Props['loading']>('loading', { required: !1, default: !1 })
|
|
77
77
|
const options = defineModel<MOptionsOptionContext[]>('options', { required: !1, default: undefined })
|
|
78
78
|
const helper = useBindInput<P>(() => props, 'options')
|
|
79
|
-
const { getLabel, inputRules, getProp } = helper
|
|
79
|
+
const { getLabel, inputRules, getProp, theme } = helper
|
|
80
80
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
81
81
|
syncVModel: !0,
|
|
82
82
|
label: getLabel,
|
|
@@ -129,7 +129,7 @@ defineOptions({
|
|
|
129
129
|
/>
|
|
130
130
|
<slot name="top-label">
|
|
131
131
|
<MInputLabel
|
|
132
|
-
v-if="!!getLabel"
|
|
132
|
+
v-if="!!getLabel && (!viewMode || (theme.topLabel || getProp('topLabel')))"
|
|
133
133
|
:field="scopes"
|
|
134
134
|
>
|
|
135
135
|
<MHelpRow
|
|
@@ -178,12 +178,14 @@ defineOptions({
|
|
|
178
178
|
:hint="viewMode ? ( hint ? __(hint) : undefined ) : undefined"
|
|
179
179
|
:keep-color="!!errorMessage ? !0 : getProp('keepColor')"
|
|
180
180
|
:label="getLabel || undefined"
|
|
181
|
-
:model-value="value"
|
|
181
|
+
:model-value="viewMode ? (viewModeValue || value) : value"
|
|
182
182
|
:options="options"
|
|
183
183
|
:type="viewMode ? undefined : type"
|
|
184
184
|
v-bind="{
|
|
185
185
|
...$attrs,
|
|
186
|
-
...
|
|
186
|
+
...theme,
|
|
187
|
+
...( viewMode ? { ...pluginProps.field } : pluginProps.options as any ),
|
|
188
|
+
stackLabel: !0
|
|
187
189
|
}"
|
|
188
190
|
v-on="listeners"
|
|
189
191
|
>
|
|
@@ -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
|