@mythpe/quasar-ui-qui 0.4.98 → 0.4.100
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/boot/register.ts +1 -1
- package/src/components/datatable/MDatatable.vue +4 -2
- package/src/components/datatable/MDtSarColumn.vue +2 -0
- package/src/components/sar/MSarIcon.vue +3 -23
- package/src/components/sar/MSarString.vue +22 -20
- package/src/icons/config.ts +13 -0
- package/src/icons/index.ts +10 -0
- package/src/style/sar-font.sass +10 -4
- package/src/types/api/MSar.d.ts +4 -1
- package/src/types/m-datatable.d.ts +1 -0
- package/src/utils/vue-plugin.ts +16 -0
package/package.json
CHANGED
package/src/boot/register.ts
CHANGED
|
@@ -774,8 +774,9 @@ defineExpose({
|
|
|
774
774
|
:align="col.align as any"
|
|
775
775
|
:copy="computedCopyColumns.includes(col.name)"
|
|
776
776
|
:copy-value="col.copyValue && typeof col.copyValue === 'function' ? () => col.copyValue(itemProps.row) : itemProps.row[col.copyValue || col.field]"
|
|
777
|
-
:string="col.field.includes('_to_string') || col.field.includes('ToString')"
|
|
777
|
+
:string="col.field.includes('_to_string') || col.field.includes('ToString') || col.string === !0"
|
|
778
778
|
:value="col.value"
|
|
779
|
+
:digits="col.digits"
|
|
779
780
|
/>
|
|
780
781
|
</template>
|
|
781
782
|
<template v-else-if="computedDescColumns.indexOf(col.name) !== -1">
|
|
@@ -1485,8 +1486,9 @@ defineExpose({
|
|
|
1485
1486
|
:align="sarCellProps.col.align as any"
|
|
1486
1487
|
:copy="computedCopyColumns.includes(sarCellProps.col.name)"
|
|
1487
1488
|
:copy-value="sarCellProps.col.copyValue && typeof sarCellProps.col.copyValue === 'function' ? () => sarCellProps.col.copyValue(sarCellProps.row) : sarCellProps.row[sarCellProps.col.copyValue || sarCellProps.col.field]"
|
|
1488
|
-
:string="sarCellProps.col.field.includes('_to_string') || sarCellProps.col.field.includes('ToString')"
|
|
1489
|
+
:string="sarCellProps.col.field.includes('_to_string') || sarCellProps.col.field.includes('ToString') || sarCellProps.col.string === !0"
|
|
1489
1490
|
:value="sarCellProps.row[sarCellProps.col.field]"
|
|
1491
|
+
:digits="sarCellProps.col.digits"
|
|
1490
1492
|
/>
|
|
1491
1493
|
</q-td>
|
|
1492
1494
|
</template>
|
|
@@ -19,6 +19,7 @@ interface Props {
|
|
|
19
19
|
copyValue?: MDtSarColumnProps['copyValue'];
|
|
20
20
|
align?: MDtSarColumnProps['align'];
|
|
21
21
|
string?: boolean;
|
|
22
|
+
digits?: MDtSarColumnProps['digits'];
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const props = defineProps<Props>()
|
|
@@ -67,6 +68,7 @@ defineOptions({
|
|
|
67
68
|
</q-btn>
|
|
68
69
|
<MSarString
|
|
69
70
|
:string="string"
|
|
71
|
+
:digits="digits"
|
|
70
72
|
:text="val"
|
|
71
73
|
/>
|
|
72
74
|
<slot />
|
|
@@ -7,17 +7,9 @@
|
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
<script lang="ts" setup>
|
|
10
|
-
import type { QIconProps } from 'quasar'
|
|
11
|
-
import { computed } from 'vue'
|
|
12
10
|
|
|
13
|
-
type Props = QIconProps
|
|
14
|
-
const noDefault = defineModel<boolean>('noDefault', { required: !1, default: !1 })
|
|
15
|
-
const props = defineProps<Props>()
|
|
16
|
-
const getSize = computed<any>(() => ({
|
|
17
|
-
size: noDefault.value ? props.size : (props.size || '100%')
|
|
18
|
-
}))
|
|
19
11
|
defineOptions({
|
|
20
|
-
name: '
|
|
12
|
+
name: 'MSarIcon',
|
|
21
13
|
inheritAttrs: !1
|
|
22
14
|
})
|
|
23
15
|
</script>
|
|
@@ -25,20 +17,8 @@ defineOptions({
|
|
|
25
17
|
<template>
|
|
26
18
|
<q-icon
|
|
27
19
|
class="m-sar-icon"
|
|
28
|
-
v-bind="
|
|
20
|
+
v-bind="{...$attrs, name: 'myth-sar'}"
|
|
29
21
|
>
|
|
30
|
-
<slot
|
|
31
|
-
<svg
|
|
32
|
-
viewBox="0 0 1124.14 1256.39"
|
|
33
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
-
>
|
|
35
|
-
<path
|
|
36
|
-
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"
|
|
37
|
-
/>
|
|
38
|
-
<path
|
|
39
|
-
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"
|
|
40
|
-
/>
|
|
41
|
-
</svg>
|
|
42
|
-
</slot>
|
|
22
|
+
<slot />
|
|
43
23
|
</q-icon>
|
|
44
24
|
</template>
|
|
@@ -11,31 +11,36 @@ import { useI18n } from 'vue-i18n'
|
|
|
11
11
|
import { computed } from 'vue'
|
|
12
12
|
import { useMyth } from '../../composable'
|
|
13
13
|
import type { MSarStringProps } from '../../types'
|
|
14
|
-
import {
|
|
14
|
+
import { extend } from 'quasar'
|
|
15
15
|
|
|
16
16
|
interface Props {
|
|
17
|
+
tag?: MSarStringProps['tag'];
|
|
17
18
|
text?: MSarStringProps['text'];
|
|
18
19
|
string?: boolean;
|
|
20
|
+
format?: MSarStringProps['format'];
|
|
21
|
+
digits?: MSarStringProps['digits'];
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
const props = defineProps<Props>()
|
|
22
25
|
|
|
23
|
-
const $q = useQuasar()
|
|
24
26
|
const { te } = useI18n({ useScope: 'global' })
|
|
25
27
|
const { __, formatMoney } = useMyth()
|
|
26
28
|
const getText = computed<string | undefined>(() => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const text = props.text?.toString?.() || ''
|
|
30
|
+
const length = text.length
|
|
31
|
+
if (length < 1) {
|
|
32
|
+
return undefined
|
|
29
33
|
}
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
const
|
|
38
|
-
return
|
|
34
|
+
const suffix = '﷼'
|
|
35
|
+
const def = 2
|
|
36
|
+
const digits = props.digits !== undefined ? parseInt(props.digits?.toString?.() ?? `${def}`) ?? def : def
|
|
37
|
+
const opt = extend<Intl.NumberFormatOptions>(!0, {
|
|
38
|
+
minimumFractionDigits: digits ?? def,
|
|
39
|
+
maximumFractionDigits: digits ?? def
|
|
40
|
+
}, props.format)
|
|
41
|
+
const value = props.string ? (te(`labels.${text}`) ? __(`labels.${text}`) : (te(text) ? __(text) : `${text}`)) : text
|
|
42
|
+
return !isNaN(value) ? formatMoney(value, suffix, opt) : `${value} ${suffix}`.trim()
|
|
43
|
+
// return v !== null && v !== undefined ? (v?.toString?.() || v) : undefined
|
|
39
44
|
})
|
|
40
45
|
|
|
41
46
|
defineOptions({
|
|
@@ -45,12 +50,9 @@ defineOptions({
|
|
|
45
50
|
</script>
|
|
46
51
|
|
|
47
52
|
<template>
|
|
48
|
-
<
|
|
49
|
-
class="m-sar-
|
|
50
|
-
style="direction: rtl !important;"
|
|
53
|
+
<span
|
|
54
|
+
class="m-sar-string sar-icon"
|
|
51
55
|
v-bind="$attrs"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<span :class="['sar-icon',{'q-pl-xs': $q.lang.rtl, 'q-pr-xs': !$q.lang.rtl}]">{{ __('sr') }}</span>
|
|
55
|
-
</div>
|
|
56
|
+
v-text="getText"
|
|
57
|
+
/>
|
|
56
58
|
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* MyTh Ahmed Faiz Copyright © 2016-2026 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
|
+
export const iconSet = 'myth-'
|
|
10
|
+
export const icons = {
|
|
11
|
+
sar: '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&&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|0 0 1124.14 1256.39'
|
|
12
|
+
}
|
|
13
|
+
export default {}
|
package/src/style/sar-font.sass
CHANGED
|
@@ -8,14 +8,20 @@
|
|
|
8
8
|
|
|
9
9
|
@font-face
|
|
10
10
|
font-family: SarIcon
|
|
11
|
-
font-style: normal
|
|
12
|
-
font-weight: 400
|
|
13
11
|
src: url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SirEAAAC8AAAAYGNtYXACvfy0AAABHAAAAGRnYXNwAAAAEAAAAYAAAAAIZ2x5ZiMGBpkAAAGIAAACOGhlYWQteGbrAAADwAAAADZoaGVhCFsEYQA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pvMhs7HzkBjBEuG/63FwHwES4b/lMzGzsfOos+GzsfQQQVD1MHDwl6F91KAAEAAAABAAAQ/weNXw889QALBAAAAAAA5OARNwAAAADk4BE3AAD/wASZA8AAAAAIAAIAAAAAAAAAAQAAA8D/wAAABJkAAAAABJkAAQAAAAAAAAAAAAAAAAAAAAcEAAAAAAAAAAAAAAACAAAABAAAAASZAAADlAAAAAAAAAAKABQAHgAoAMQBHAABAAAABwByAAQAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABwAAAAEAAAAAAAIABwBgAAEAAAAAAAMABwA2AAEAAAAAAAQABwB1AAEAAAAAAAUACwAVAAEAAAAAAAYABwBLAAEAAAAAAAoAGgCKAAMAAQQJAAEADgAHAAMAAQQJAAIADgBnAAMAAQQJAAMADgA9AAMAAQQJAAQADgB8AAMAAQQJAAUAFgAgAAMAAQQJAAYADgBSAAMAAQQJAAoANACkUGF5VGFicwBQAGEAeQBUAGEAYgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwUGF5VGFicwBQAGEAeQBUAGEAYgBzUGF5VGFicwBQAGEAeQBUAGEAYgBzUmVndWxhcgBSAGUAZwB1AGwAYQByUGF5VGFicwBQAGEAeQBUAGEAYgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==") format("truetype")
|
|
14
|
-
font-display:
|
|
12
|
+
font-display: swap
|
|
13
|
+
unicode-range: U+FDFC
|
|
15
14
|
|
|
16
15
|
.sar-icon
|
|
17
|
-
font-family: SarIcon, sans-serif !important
|
|
18
16
|
font-style: normal !important
|
|
19
17
|
font-weight: 400 !important
|
|
20
18
|
font-variant: normal !important
|
|
21
19
|
text-transform: none !important
|
|
20
|
+
|
|
21
|
+
[dir="rtl"]
|
|
22
|
+
.sar-icon
|
|
23
|
+
font-family: SarIcon, var(--m-font-rtl, 'inherit'), 'Roboto', sans-serif
|
|
24
|
+
|
|
25
|
+
[dir="ltr"]
|
|
26
|
+
.sar-icon
|
|
27
|
+
font-family: SarIcon, var(--m-font-ltr, 'inherit'), 'Roboto', sans-serif
|
package/src/types/api/MSar.d.ts
CHANGED
|
@@ -9,15 +9,18 @@
|
|
|
9
9
|
import type { VNode } from 'vue'
|
|
10
10
|
import type { QIconProps } from 'quasar'
|
|
11
11
|
|
|
12
|
-
export type MSarIconProps = Omit<QIconProps, 'name'
|
|
12
|
+
export type MSarIconProps = Omit<QIconProps, 'name'>;
|
|
13
13
|
|
|
14
14
|
export interface MSarIconSlots {
|
|
15
15
|
default: () => VNode[]
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export type MSarStringProps = {
|
|
19
|
+
tag?: any;
|
|
19
20
|
text?: any;
|
|
20
21
|
string?: boolean;
|
|
22
|
+
format?: Intl.NumberFormatOptions;
|
|
23
|
+
digits?: number | string;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export interface MSarStringSlots {
|
package/src/utils/vue-plugin.ts
CHANGED
|
@@ -13,6 +13,8 @@ import { defineComponents } from '../plugin/defineComponents'
|
|
|
13
13
|
|
|
14
14
|
import { createMyth, extendOptions } from './createMyth'
|
|
15
15
|
import { MythKey } from './const'
|
|
16
|
+
import { icons, iconSet } from '../icons'
|
|
17
|
+
import { Str } from './Str'
|
|
16
18
|
|
|
17
19
|
function install (app: App, options: InstallOptions) {
|
|
18
20
|
const opts = extendOptions(options)
|
|
@@ -35,6 +37,20 @@ function install (app: App, options: InstallOptions) {
|
|
|
35
37
|
// for (const routesKey in routes) {
|
|
36
38
|
// console.log(routesKey)
|
|
37
39
|
// }
|
|
40
|
+
const otherIconMapFn = app.config.globalProperties.$q.iconMapFn
|
|
41
|
+
app.config.globalProperties.$q.iconMapFn = (iconName) => {
|
|
42
|
+
if (iconName.startsWith(iconSet)) {
|
|
43
|
+
const name = Str.camelCase(iconName.slice(iconSet.length))
|
|
44
|
+
if (Object.keys(icons).includes(name)) {
|
|
45
|
+
return {
|
|
46
|
+
icon: icons[name]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (typeof otherIconMapFn === 'function') {
|
|
51
|
+
return otherIconMapFn(iconName)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
export {
|