@mythpe/quasar-ui-qui 0.2.8 → 0.2.10
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/components/form/MInput.vue +24 -4
- package/src/components/form/MPicker.vue +14 -2
- package/src/components/index.ts +1 -1
- package/src/components/{util/sar → sar}/MSarCol.vue +4 -4
- package/src/components/sar/MSarIcon.vue +39 -0
- package/src/components/{util → sar}/index.ts +4 -2
- package/src/index.sass +1 -0
- package/src/plugin/defineAsyncComponents.ts +3 -2
- package/src/style/typography.sass +28 -0
- package/src/types/components.d.ts +11 -11
- package/src/components/util/sar/MSarSvg.vue +0 -50
- package/src/components/util/sar/index.ts +0 -14
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
setup
|
|
12
12
|
>
|
|
13
13
|
import { useField } from 'vee-validate'
|
|
14
|
-
import { reactive, toValue, useTemplateRef } from 'vue'
|
|
14
|
+
import { computed, reactive, toValue, useTemplateRef } from 'vue'
|
|
15
15
|
import { QField, QInput, type QInputSlots } from 'quasar'
|
|
16
16
|
import { useBindInput, useMyth } from '../../composable'
|
|
17
17
|
import type { MInputProps as Props } from '../../types'
|
|
@@ -80,7 +80,7 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
80
80
|
appendIconProps: undefined
|
|
81
81
|
})
|
|
82
82
|
defineModel<Props['modelValue']>({ required: !1, default: undefined })
|
|
83
|
-
const { __, props: pluginOptions } = useMyth()
|
|
83
|
+
const { __, props: pluginOptions, formatMoney } = useMyth()
|
|
84
84
|
const helper = useBindInput<Props>(() => props, 'input')
|
|
85
85
|
const { theme, hasTopLabel, getLabel, getPlaceholder, getAutocompleteAttribute, inputRules } = helper
|
|
86
86
|
const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
|
|
@@ -95,6 +95,22 @@ const listeners = {
|
|
|
95
95
|
}
|
|
96
96
|
const input = useTemplateRef<InstanceType<typeof QInput> | InstanceType<typeof QField>>('input')
|
|
97
97
|
const scopes = reactive(inputScope)
|
|
98
|
+
const sarValue = computed<string | null>(() => {
|
|
99
|
+
if (!props.sar) {
|
|
100
|
+
return null
|
|
101
|
+
}
|
|
102
|
+
let v = formatMoney('')
|
|
103
|
+
|
|
104
|
+
if (props.viewModeValue?.toString?.()?.length > 0) {
|
|
105
|
+
v = props.viewModeValue
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (value.value?.toString?.()?.length) {
|
|
109
|
+
v = value.value
|
|
110
|
+
}
|
|
111
|
+
console.log(v)
|
|
112
|
+
return v || null
|
|
113
|
+
})
|
|
98
114
|
defineExpose<typeof scopes & { input: typeof input }>({ input, ...scopes })
|
|
99
115
|
defineOptions({
|
|
100
116
|
name: 'MInput',
|
|
@@ -181,7 +197,7 @@ defineOptions({
|
|
|
181
197
|
v-else-if="sar && !viewMode"
|
|
182
198
|
#append
|
|
183
199
|
>
|
|
184
|
-
<
|
|
200
|
+
<MSarIcon />
|
|
185
201
|
</template>
|
|
186
202
|
<template
|
|
187
203
|
v-if="viewMode"
|
|
@@ -190,7 +206,11 @@ defineOptions({
|
|
|
190
206
|
<slot name="control">
|
|
191
207
|
<MInputFieldControl>
|
|
192
208
|
<template v-if="sar">
|
|
193
|
-
<
|
|
209
|
+
<div class="row items-start q-gu tter-sm">
|
|
210
|
+
<span v-text="sarValue" />
|
|
211
|
+
<MSarIcon />
|
|
212
|
+
</div>
|
|
213
|
+
<!--<MSarCol :text="!!viewModeValue?.toString?.()?.length ? viewModeValue : ( !!value?.toString?.()?.length ? value : undefined )" />-->
|
|
194
214
|
</template>
|
|
195
215
|
<template v-else>
|
|
196
216
|
{{ viewModeValue ?? value }}
|
|
@@ -50,6 +50,8 @@ interface P {
|
|
|
50
50
|
fieldOptions?: Props['fieldOptions'];
|
|
51
51
|
locale?: Props['locale'];
|
|
52
52
|
noDefaultLocale?: boolean;
|
|
53
|
+
prependIcon?: Props['prependIcon'];
|
|
54
|
+
prependIconProps?: Props['prependIconProps'];
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
type ModelType = Props['modelValue']
|
|
@@ -82,7 +84,9 @@ const props = withDefaults(defineProps<P>(), {
|
|
|
82
84
|
disable: undefined,
|
|
83
85
|
fieldOptions: undefined,
|
|
84
86
|
locale: undefined,
|
|
85
|
-
noDefaultLocale: !1
|
|
87
|
+
noDefaultLocale: !1,
|
|
88
|
+
prependIcon: undefined,
|
|
89
|
+
prependIconProps: undefined
|
|
86
90
|
})
|
|
87
91
|
|
|
88
92
|
defineModel<ModelType>({ required: !1, default: undefined })
|
|
@@ -243,6 +247,15 @@ defineOptions({
|
|
|
243
247
|
</template>
|
|
244
248
|
</slot>
|
|
245
249
|
</template>
|
|
250
|
+
<template
|
|
251
|
+
v-if="!!prependIcon"
|
|
252
|
+
#prepend
|
|
253
|
+
>
|
|
254
|
+
<q-icon
|
|
255
|
+
:name="prependIcon"
|
|
256
|
+
v-bind="prependIconProps"
|
|
257
|
+
/>
|
|
258
|
+
</template>
|
|
246
259
|
<template #append>
|
|
247
260
|
<q-btn
|
|
248
261
|
v-if="!disable && !readonly && !viewMode"
|
|
@@ -328,7 +341,6 @@ defineOptions({
|
|
|
328
341
|
</q-popup-proxy>
|
|
329
342
|
</q-btn>
|
|
330
343
|
</template>
|
|
331
|
-
|
|
332
344
|
<template
|
|
333
345
|
v-for="(_,slot) in $slots as Readonly<QFieldSlots>"
|
|
334
346
|
:key="slot"
|
package/src/components/index.ts
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
|
-
import MSarSvg from './MSarSvg.vue'
|
|
10
|
+
// import MSarSvg from './MSarSvg.vue'
|
|
11
11
|
import { useI18n } from 'vue-i18n'
|
|
12
12
|
import { computed } from 'vue'
|
|
13
|
-
import { useMyth } from '
|
|
13
|
+
import { useMyth } from '../../composable'
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
text?: any;
|
|
@@ -29,7 +29,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
const getSize = computed<number>(() => parseInt(props.size?.toString?.() || '0') || 0)
|
|
32
|
-
const getIconSize = computed<number>(() => parseInt(props.iconSize?.toString?.() || '0') || 0)
|
|
32
|
+
// const getIconSize = computed<number>(() => parseInt(props.iconSize?.toString?.() || '0') || 0)
|
|
33
33
|
const { te } = useI18n({ useScope: 'global' })
|
|
34
34
|
const { __, formatMoney } = useMyth()
|
|
35
35
|
const getText = computed<string | undefined>(() => {
|
|
@@ -70,7 +70,7 @@ defineOptions({
|
|
|
70
70
|
v-text="getText"
|
|
71
71
|
/>
|
|
72
72
|
</slot>
|
|
73
|
-
|
|
73
|
+
<!--<MSarSvg :size="getIconSize" />-->
|
|
74
74
|
</MRow>
|
|
75
75
|
</div>
|
|
76
76
|
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
+
- Email: mythpe@gmail.com
|
|
4
|
+
- Mobile: +966590470092
|
|
5
|
+
- Website: https://www.4myth.com
|
|
6
|
+
- Github: https://github.com/mythpe
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import type { QIconProps } from 'quasar'
|
|
11
|
+
import { computed } from 'vue'
|
|
12
|
+
|
|
13
|
+
type Props = QIconProps
|
|
14
|
+
const noDefault = defineModel<boolean>('noDefault', { required: !1, default: !1 })
|
|
15
|
+
const props = defineProps<Props>()
|
|
16
|
+
const getSize = computed<Props['size']>(() => noDefault.value ? props.size : props.size || '100%')
|
|
17
|
+
defineOptions({
|
|
18
|
+
name: 'MSarIcon',
|
|
19
|
+
inheritAttrs: !1
|
|
20
|
+
})
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<q-icon v-bind="{...$props,...$attrs,size: getSize}">
|
|
25
|
+
<slot name="default">
|
|
26
|
+
<svg
|
|
27
|
+
viewBox="0 0 1124.14 1256.39"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
>
|
|
30
|
+
<path
|
|
31
|
+
d="M699.62,1113.02h0c-20.06,44.48-33.32,92.75-38.4,143.37l424.51-90.24c20.06-44.47,33.31-92.75,38.4-143.37l-424.51,90.24Z"
|
|
32
|
+
/>
|
|
33
|
+
<path
|
|
34
|
+
d="M1085.73,895.8c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.33v-135.2l292.27-62.11c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.27V66.13c-50.67,28.45-95.67,66.32-132.25,110.99v403.35l-132.25,28.11V0c-50.67,28.44-95.67,66.32-132.25,110.99v525.69l-295.91,62.88c-20.06,44.47-33.33,92.75-38.42,143.37l334.33-71.05v170.26l-358.3,76.14c-20.06,44.47-33.32,92.75-38.4,143.37l375.04-79.7c30.53-6.35,56.77-24.4,73.83-49.24l68.78-101.97v-.02c7.14-10.55,11.3-23.27,11.3-36.97v-149.98l132.25-28.11v270.4l424.53-90.28Z"
|
|
35
|
+
/>
|
|
36
|
+
</svg>
|
|
37
|
+
</slot>
|
|
38
|
+
</q-icon>
|
|
39
|
+
</template>
|
package/src/index.sass
CHANGED
|
@@ -59,6 +59,7 @@ export const defineAsyncComponents = function (app: App) {
|
|
|
59
59
|
app.component('MDtContextmenuItems', defineAsyncComponent(() => import('../components/datatable/MDtContextmenuItems.vue')))
|
|
60
60
|
|
|
61
61
|
// Utils.
|
|
62
|
-
app.component('MSarCol', defineAsyncComponent(() => import('../components/util/sar/MSarSvg.vue')))
|
|
63
|
-
app.component('MSarSvg', defineAsyncComponent(() => import('../components/util/sar/MSarSvg.vue')))
|
|
62
|
+
// app.component('MSarCol', defineAsyncComponent(() => import('../components/util/sar/MSarSvg.vue')))
|
|
63
|
+
// app.component('MSarSvg', defineAsyncComponent(() => import('../components/util/sar/MSarSvg.vue')))
|
|
64
|
+
app.component('MSarIcon', defineAsyncComponent(() => import('../components/sar/MSarIcon.vue')))
|
|
64
65
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[dir="rtl"]
|
|
2
|
+
body
|
|
3
|
+
text-rendering: optimizeLegibility
|
|
4
|
+
font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "lnum"
|
|
5
|
+
-webkit-font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "lnum"
|
|
6
|
+
-moz-font-feature-settings: "kern=1"
|
|
7
|
+
font-optical-sizing: auto
|
|
8
|
+
font-style: normal
|
|
9
|
+
|
|
10
|
+
body
|
|
11
|
+
-webkit-font-smoothing: antialiased
|
|
12
|
+
-moz-osx-font-smoothing: grayscale
|
|
13
|
+
|
|
14
|
+
$text-decorations: ("underline": underline, "no-underline": none, "overline": overline, "line-through": line-through, "none": none) !default
|
|
15
|
+
@each $name, $value in $text-decorations
|
|
16
|
+
.text-#{$name}
|
|
17
|
+
text-decoration: $value !important
|
|
18
|
+
|
|
19
|
+
@if $name == "underline"
|
|
20
|
+
text-underline-offset: 0.2em
|
|
21
|
+
text-decoration-thickness: 1px
|
|
22
|
+
|
|
23
|
+
$text-underline-styles: ("solid": solid, "double": double, "dotted": dotted, "dashed": dashed, "wavy": wavy) !default
|
|
24
|
+
|
|
25
|
+
@each $style-name, $style-value in $text-underline-styles
|
|
26
|
+
.text-underline-#{$style-name}
|
|
27
|
+
text-decoration-line: underline !important
|
|
28
|
+
text-decoration-style: $style-value !important
|
|
@@ -17,7 +17,8 @@ import type {
|
|
|
17
17
|
QEditorSlots,
|
|
18
18
|
QFieldSlots,
|
|
19
19
|
QFileProps,
|
|
20
|
-
QFileSlots,
|
|
20
|
+
QFileSlots,
|
|
21
|
+
QIconProps,
|
|
21
22
|
QInputProps,
|
|
22
23
|
QInputSlots,
|
|
23
24
|
QItemProps,
|
|
@@ -44,7 +45,6 @@ import type { MTransitionProps, MTransitionsSlots } from './api/MTransition'
|
|
|
44
45
|
import type { MAxiosProps, MAxiosSlots } from './api/MAxios'
|
|
45
46
|
import type { MSelectProps, MSelectSlots } from './api/MSelect'
|
|
46
47
|
import type { MSignaturePadProps, MSignaturePadSlots } from './api/MSignaturePad'
|
|
47
|
-
import Parials from '../components/parials'
|
|
48
48
|
|
|
49
49
|
export type MBtnProps = QBtnProps & {
|
|
50
50
|
ariaLabel?: boolean | string | null | undefined;
|
|
@@ -437,6 +437,8 @@ export interface MPickerProps extends BaseInputsProps, Omit<QDateProps, 'modelVa
|
|
|
437
437
|
* Only work for 'date' type.
|
|
438
438
|
*/
|
|
439
439
|
noDefaultLocale?: boolean;
|
|
440
|
+
prependIcon?: string;
|
|
441
|
+
prependIconProps?: Partial<QIconProps>;
|
|
440
442
|
}
|
|
441
443
|
|
|
442
444
|
export type MPickerSlots = MInputSlots
|
|
@@ -981,9 +983,11 @@ export type MCkeditorProps = Omit<BaseInputsProps, 'hint' | 'topLabel' | 'placeh
|
|
|
981
983
|
}
|
|
982
984
|
export type MCkeditorSlots = BaseInputsSlots
|
|
983
985
|
|
|
984
|
-
export type
|
|
985
|
-
|
|
986
|
-
|
|
986
|
+
export type MSarIconProps = Omit<QIconProps, 'name'> & Record<string, any>;
|
|
987
|
+
|
|
988
|
+
export interface MSarIconSlots {
|
|
989
|
+
default: () => VNode[]
|
|
990
|
+
}
|
|
987
991
|
|
|
988
992
|
export type MSarColProps = {
|
|
989
993
|
size?: string | number;
|
|
@@ -997,10 +1001,6 @@ export interface MSarColSlots {
|
|
|
997
1001
|
default: () => VNode[]
|
|
998
1002
|
}
|
|
999
1003
|
|
|
1000
|
-
export interface MSarSvgSlots {
|
|
1001
|
-
default: () => VNode[]
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
1004
|
declare module '@vue/runtime-core' {
|
|
1005
1005
|
interface GlobalComponents {
|
|
1006
1006
|
// Form.
|
|
@@ -1059,7 +1059,7 @@ declare module '@vue/runtime-core' {
|
|
|
1059
1059
|
MDtContextmenuItems: GlobalComponentConstructor<MDtContextmenuItemsProps, MDtContextmenuItemsSlots>;
|
|
1060
1060
|
|
|
1061
1061
|
// Utils.
|
|
1062
|
-
MSarCol: GlobalComponentConstructor<MSarColProps, MSarColSlots>;
|
|
1063
|
-
|
|
1062
|
+
// MSarCol: GlobalComponentConstructor<MSarColProps, MSarColSlots>;
|
|
1063
|
+
MSarIcon: GlobalComponentConstructor<MSarIconProps, MSarIconSlots>;
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
- MyTh Ahmed Faiz Copyright © 2016-2025 All rights reserved.
|
|
3
|
-
- Email: mythpe@gmail.com
|
|
4
|
-
- Mobile: +966590470092
|
|
5
|
-
- Website: https://www.4myth.com
|
|
6
|
-
- Github: https://github.com/mythpe
|
|
7
|
-
-->
|
|
8
|
-
|
|
9
|
-
<script lang="ts" setup>
|
|
10
|
-
import { computed } from 'vue'
|
|
11
|
-
|
|
12
|
-
type Props = {
|
|
13
|
-
size?: string | number;
|
|
14
|
-
}
|
|
15
|
-
const props = withDefaults(defineProps<Props>(), {
|
|
16
|
-
size: 15
|
|
17
|
-
})
|
|
18
|
-
const getSize = computed<number>(() => parseInt(props.size?.toString?.() || '0') || 0)
|
|
19
|
-
|
|
20
|
-
defineOptions({
|
|
21
|
-
name: 'MSarSvg',
|
|
22
|
-
inheritAttrs: !1
|
|
23
|
-
})
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<template>
|
|
27
|
-
<div
|
|
28
|
-
class="flex m--sar-svg"
|
|
29
|
-
v-bind="$attrs"
|
|
30
|
-
>
|
|
31
|
-
<slot />
|
|
32
|
-
<svg
|
|
33
|
-
:height="`${getSize}px`"
|
|
34
|
-
viewBox="0 0 1124.14 1256.39"
|
|
35
|
-
width="100%"
|
|
36
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
-
>
|
|
38
|
-
<path
|
|
39
|
-
:fill="$q.dark.isActive ? '#FFF' : '#231f20'"
|
|
40
|
-
class="cls-1"
|
|
41
|
-
d="M699.62,1113.02h0c-20.06,44.48-33.32,92.75-38.4,143.37l424.51-90.24c20.06-44.47,33.31-92.75,38.4-143.37l-424.51,90.24Z"
|
|
42
|
-
/>
|
|
43
|
-
<path
|
|
44
|
-
:fill="$q.dark.isActive ? '#FFF' : '#231f20'"
|
|
45
|
-
class="cls-1"
|
|
46
|
-
d="M1085.73,895.8c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.33v-135.2l292.27-62.11c20.06-44.47,33.32-92.75,38.4-143.37l-330.68,70.27V66.13c-50.67,28.45-95.67,66.32-132.25,110.99v403.35l-132.25,28.11V0c-50.67,28.44-95.67,66.32-132.25,110.99v525.69l-295.91,62.88c-20.06,44.47-33.33,92.75-38.42,143.37l334.33-71.05v170.26l-358.3,76.14c-20.06,44.47-33.32,92.75-38.4,143.37l375.04-79.7c30.53-6.35,56.77-24.4,73.83-49.24l68.78-101.97v-.02c7.14-10.55,11.3-23.27,11.3-36.97v-149.98l132.25-28.11v270.4l424.53-90.28Z"
|
|
47
|
-
/>
|
|
48
|
-
</svg>
|
|
49
|
-
</div>
|
|
50
|
-
</template>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved.
|
|
3
|
-
* Email: mythpe@gmail.com
|
|
4
|
-
* Mobile: +966590470092
|
|
5
|
-
* Website: https://www.4myth.com
|
|
6
|
-
* Github: https://github.com/mythpe
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import MSarCol from './MSarCol.vue'
|
|
10
|
-
import MSarSvg from './MSarSvg.vue'
|
|
11
|
-
|
|
12
|
-
export { MSarCol, MSarSvg }
|
|
13
|
-
|
|
14
|
-
export default {}
|