@mythpe/quasar-ui-qui 0.2.9 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mythpe/quasar-ui-qui",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -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
- <MSarCol />
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
- <MSarCol :text="!!viewModeValue?.toString?.()?.length ? viewModeValue : ( !!value?.toString?.()?.length ? value : undefined )" />
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 }}
@@ -11,8 +11,8 @@ export * from './form'
11
11
  export * from './grid'
12
12
  export * from './modal'
13
13
  export * from './parials'
14
+ export * from './sar'
14
15
  export * from './typography'
15
16
  export * from './transition'
16
- export * from './util'
17
17
 
18
18
  export default {}
@@ -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 '../../../composable'
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
- <MSarSvg :size="getIconSize" />
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>
@@ -6,6 +6,8 @@
6
6
  * Github: https://github.com/mythpe
7
7
  */
8
8
 
9
- export * from './sar'
10
- export {}
9
+ import MSarIcon from './MSarIcon.vue'
10
+
11
+ export { MSarIcon }
12
+
11
13
  export default {}
package/src/index.sass CHANGED
@@ -15,3 +15,4 @@
15
15
  @import './style/m-select'
16
16
  @import './style/print'
17
17
  @import './style/transition'
18
+ @import './style/typography'
@@ -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, QIconProps,
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;
@@ -983,9 +983,11 @@ export type MCkeditorProps = Omit<BaseInputsProps, 'hint' | 'topLabel' | 'placeh
983
983
  }
984
984
  export type MCkeditorSlots = BaseInputsSlots
985
985
 
986
- export type MSarSvgProps = {
987
- size?: string | number;
988
- } & Record<string, any>;
986
+ export type MSarIconProps = Omit<QIconProps, 'name'> & Record<string, any>;
987
+
988
+ export interface MSarIconSlots {
989
+ default: () => VNode[]
990
+ }
989
991
 
990
992
  export type MSarColProps = {
991
993
  size?: string | number;
@@ -999,10 +1001,6 @@ export interface MSarColSlots {
999
1001
  default: () => VNode[]
1000
1002
  }
1001
1003
 
1002
- export interface MSarSvgSlots {
1003
- default: () => VNode[]
1004
- }
1005
-
1006
1004
  declare module '@vue/runtime-core' {
1007
1005
  interface GlobalComponents {
1008
1006
  // Form.
@@ -1061,7 +1059,7 @@ declare module '@vue/runtime-core' {
1061
1059
  MDtContextmenuItems: GlobalComponentConstructor<MDtContextmenuItemsProps, MDtContextmenuItemsSlots>;
1062
1060
 
1063
1061
  // Utils.
1064
- MSarCol: GlobalComponentConstructor<MSarColProps, MSarColSlots>;
1065
- MSarSvg: GlobalComponentConstructor<MSarSvgProps, MSarSvgSlots>;
1062
+ // MSarCol: GlobalComponentConstructor<MSarColProps, MSarColSlots>;
1063
+ MSarIcon: GlobalComponentConstructor<MSarIconProps, MSarIconSlots>;
1066
1064
  }
1067
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 {}