@mythpe/quasar-ui-qui 0.0.28-dev → 0.0.28

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.0.28-dev",
3
+ "version": "0.0.28",
4
4
  "description": "MyTh Quasar UI Kit App Extension",
5
5
  "author": {
6
6
  "name": "MyTh Ahmed Faiz",
@@ -13,6 +13,8 @@
13
13
  "module": "src/index.esm.js",
14
14
  "main": "src/index.common.js",
15
15
  "scripts": {
16
+ "lint": "eslint ./src --ext .js,.ts,.vue ./",
17
+ "lint:fix": "eslint --fix --ext .js,.ts,.vue ./src",
16
18
  "dev": "cd ../dev && yarn dev && cd ..",
17
19
  "dev:umd": "yarn build && node build/script.open-umd.js",
18
20
  "dev:ssr": "cd ../dev && yarn 'dev:ssr' && cd ..",
@@ -29,6 +31,7 @@
29
31
  "@vee-validate/rules": "^4.14.0",
30
32
  "axios": "^1.7.8",
31
33
  "ckeditor5": "^43.3.1",
34
+ "color-name": "^2.0.0",
32
35
  "lodash": "^4.17.0",
33
36
  "lodash-inflection": "^1.5.0",
34
37
  "typed.js": "^2.1.0",
@@ -36,6 +39,7 @@
36
39
  "vue-i18n": "^10.0.0"
37
40
  },
38
41
  "devDependencies": {
42
+ "@quasar/app-vite": "^2.0.0-rc.1",
39
43
  "@quasar/app-webpack": "^3.13.0",
40
44
  "@quasar/extras": "^1.16.4",
41
45
  "@rollup/plugin-buble": "^0.21.3",
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -28,7 +28,7 @@ import type {
28
28
  import type { AxiosRequestConfig } from 'axios'
29
29
  import type { InvalidSubmissionHandler, SubmissionHandler } from 'vee-validate'
30
30
  import { useForm } from 'vee-validate'
31
- import { computed, defineEmits, nextTick, onMounted, reactive, ref, toRef, toValue, useSlots, watch } from 'vue'
31
+ import { computed, nextTick, onMounted, reactive, ref, toRef, toValue, useSlots, watch } from 'vue'
32
32
  import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
33
33
  import lodash from 'lodash'
34
34
  import { useRoute, useRouter } from 'vue-router'
@@ -12,7 +12,8 @@
12
12
  >
13
13
 
14
14
  import type { MDatatableDialogsOptions, MDatatableProps } from '../../types'
15
- import { computed, UnwrapRef } from 'vue'
15
+ import type { UnwrapRef } from 'vue'
16
+ import { computed } from 'vue'
16
17
  import { useMyth } from '../../composable'
17
18
 
18
19
  interface Props {
@@ -16,7 +16,8 @@ import type { MCkeditorProps as Props } from '../../types'
16
16
  import { computed, reactive, toValue, useTemplateRef } from 'vue'
17
17
  import { useBindInput, useMyth } from '../../composable'
18
18
 
19
- import type {
19
+ import type { EditorConfig } from 'ckeditor5'
20
+ import {
20
21
  Alignment,
21
22
  Autoformat,
22
23
  Base64UploadAdapter,
@@ -28,7 +29,6 @@ import type {
28
29
  CloudServices,
29
30
  Code,
30
31
  CodeBlock,
31
- EditorConfig,
32
32
  Essentials,
33
33
  FontBackgroundColor,
34
34
  FontColor,
@@ -133,8 +133,8 @@ const inputScope = useField<Props['modelValue']>(() => props.name, inputRules, {
133
133
  const { value, errorMessage, handleChange } = inputScope
134
134
 
135
135
  const isRtl = computed(() => props.lang === 'ar')
136
- const getConfig = computed<EditorConfig>(() => {
137
- const inpConfig = {
136
+ const getConfig = computed<any>(() => {
137
+ const inpConfig: EditorConfig = {
138
138
  language: {
139
139
  ui: props.lang as string,
140
140
  content: props.lang as string,
@@ -301,7 +301,7 @@ const getConfig = computed<EditorConfig>(() => {
301
301
  if (props.config) {
302
302
  return props.config(inpConfig as EditorConfig)
303
303
  }
304
- return inpConfig as EditorConfig
304
+ return inpConfig
305
305
  })
306
306
  const listeners = {
307
307
  'update:modelValue': (v: Props['modelValue']) => handleChange(v, !!errorMessage.value)
@@ -14,7 +14,7 @@ import type { MInputProps as Props, MInputSlots } from '../../types'
14
14
  import { reactive, toValue, useTemplateRef } from 'vue'
15
15
  import { useField } from 'vee-validate'
16
16
  import { useBindInput } from '../../composable'
17
- import { QField, QInput } from 'quasar'
17
+ import type { QField, QInput } from 'quasar'
18
18
 
19
19
  const props = withDefaults(defineProps<Props>(), {
20
20
  name: () => '',
@@ -14,7 +14,8 @@
14
14
  import { useFieldError, useFieldValue } from 'vee-validate'
15
15
  import type { MFieldProps as Props } from '../../types'
16
16
  import { useTemplateRef } from 'vue'
17
- import { QField, QFieldSlots } from 'quasar'
17
+ import type { QFieldSlots } from 'quasar'
18
+ import { QField } from 'quasar'
18
19
  import { useBindInput, useMyth } from '../../composable'
19
20
  import { myth } from '../../utils'
20
21
 
@@ -63,7 +64,7 @@ const { __ } = useMyth()
63
64
  const { props: options } = myth
64
65
  const modelValue = defineModel<Props['modelValue']>({ required: !1, default: undefined })
65
66
  const helper = useBindInput<P>(() => props, 'input')
66
- const { hasTopLabel, getLabel, getPlaceholder, inputRules, attrs } = helper
67
+ const { hasTopLabel, getLabel, getPlaceholder, inputRules } = helper
67
68
  const value = useFieldValue(() => props.name)
68
69
  const errorMessage = useFieldError(() => props.name)
69
70
  const input = useTemplateRef<InstanceType<typeof QField>>('input')
@@ -11,7 +11,8 @@
11
11
  setup
12
12
  >
13
13
 
14
- import { QField, QFile, QFileSlots } from 'quasar'
14
+ import type { QFileSlots } from 'quasar'
15
+ import { QField, QFile } from 'quasar'
15
16
  import { useBindInput, useMyth } from '../../composable'
16
17
  import { useField } from 'vee-validate'
17
18
  import { reactive, toValue, useTemplateRef } from 'vue'
@@ -123,7 +123,7 @@ const onUpdate = (value: string | number | null, index: number) => {
123
123
  }
124
124
  }
125
125
 
126
- const onKeyDown = (evt: KeyboardEvent, index: number) => {
126
+ const onKeyDown = (evt: KeyboardEvent/*, index: number */) => {
127
127
  if (props.numeric !== !1 && evt.key && evt.key.toString() !== '0' && !parseInt(evt.key) && evt.key?.length === 1) {
128
128
  evt.preventDefault()
129
129
  }
@@ -253,7 +253,7 @@ defineOptions({
253
253
  outlined
254
254
  style="width: 6ch"
255
255
  v-bind="{...pluginOptions.otp as any,...$attrs}"
256
- @keydown="onKeyDown($event, i - 1)"
256
+ @keydown="onKeyDown($event)"
257
257
  @keyup="onKeyUp($event, i - 1)"
258
258
  @paste.prevent="onPaste($event,i - 1)"
259
259
  @update:model-value="onUpdate($event, i - 1)"
@@ -14,7 +14,8 @@ import { computed, reactive, ref, toValue, useTemplateRef } from 'vue'
14
14
  import type { MPickerProps as Props } from '../../types'
15
15
  import { useBindInput, useMyth } from '../../composable'
16
16
  import { useField } from 'vee-validate'
17
- import { QDate, QField, QFieldSlots, QTime } from 'quasar'
17
+ import type { QFieldSlots } from 'quasar'
18
+ import { QDate, QField, QTime } from 'quasar'
18
19
  import { myth } from '../../utils'
19
20
 
20
21
  const defSeparator = ' - '
@@ -13,7 +13,8 @@
13
13
 
14
14
  import { computed, nextTick, reactive, ref } from 'vue'
15
15
  import type { MUploaderMediaItem, MUploaderProps as Props, MUploaderServiceType } from '../../types'
16
- import { QUploader, useQuasar } from 'quasar'
16
+ import type { QUploader } from 'quasar'
17
+ import { useQuasar } from 'quasar'
17
18
  import { useMyth } from '../../composable'
18
19
  import { useI18n } from 'vue-i18n'
19
20
 
@@ -1,10 +1,11 @@
1
- import { computed, MaybeRefOrGetter, ref, toValue } from 'vue'
1
+ import type { MaybeRefOrGetter } from 'vue'
2
+ import { computed, ref, toValue } from 'vue'
2
3
  import { useI18n } from 'vue-i18n'
3
4
  import { useMyth } from './useMyth'
4
5
  import { useSplitAttrs } from 'quasar'
5
6
  import { myth } from '../utils'
6
7
  import { camelCase, kebabCase, snakeCase, uniq } from 'lodash'
7
- import { PropsContext as UiOpt } from '../types/plugin-props-option'
8
+ import type { PropsContext as UiOpt } from '../types/plugin-props-option'
8
9
 
9
10
  type G = { name: string; [k: string]: any };
10
11
  type OptsContext = { choose?: boolean; };
@@ -1,4 +1,5 @@
1
- import { computed, MaybeRefOrGetter } from 'vue'
1
+ import type { MaybeRefOrGetter } from 'vue'
2
+ import { computed } from 'vue'
2
3
  import { useFieldError, useSetFieldError } from 'vee-validate'
3
4
 
4
5
  export const useError = (name: MaybeRefOrGetter<string>) => {
@@ -9,7 +9,8 @@
9
9
  import lodash from 'lodash'
10
10
  import { useI18n } from 'vue-i18n'
11
11
  import type { RouteLocationNormalizedLoaded } from 'vue-router'
12
- import { copyToClipboard, extend, QDialogOptions, QNotifyCreateOptions, useQuasar } from 'quasar'
12
+ import type { QDialogOptions, QNotifyCreateOptions } from 'quasar'
13
+ import { copyToClipboard, extend, useQuasar } from 'quasar'
13
14
  import { Helpers, myth, Str, veeRules } from '../utils'
14
15
  import type { MDtColumn, MDtHeadersParameter, ParseHeaderOptions, Vue3MAlertMessage, Vue3MAlertMessageOptions, Vue3MConfirmMessage } from '../types'
15
16
  import { computed } from 'vue'
@@ -1,4 +1,5 @@
1
- import { computed, MaybeRefOrGetter } from 'vue'
1
+ import type { MaybeRefOrGetter } from 'vue'
2
+ import { computed } from 'vue'
2
3
  import { useFieldValue, useSetFieldValue } from 'vee-validate'
3
4
 
4
5
  export const useValue = <T = any> (name: MaybeRefOrGetter<string>) => {
@@ -31,8 +31,8 @@ import type {
31
31
  QToggleProps,
32
32
  QUploaderProps,
33
33
  QUploaderSlots
34
+ , QDialogProps, QMenuProps, QPopupProxyProps, QTooltipProps
34
35
  } from 'quasar'
35
- import { QDialogProps, QMenuProps, QPopupProxyProps, QTooltipProps } from 'quasar'
36
36
  import type {
37
37
  ComputedRef,
38
38
  MaybeRefOrGetter,
@@ -48,8 +48,8 @@ import type { TypedOptions } from 'typed.js'
48
48
  import type { FieldContext, FieldOptions, FormContext, FormOptions, FormState } from 'vee-validate'
49
49
  import type { ThemeShadow, ThemeSize } from './theme'
50
50
  import type { AxiosRequestConfig } from 'axios'
51
- import { ApiInterface, HelpersStubSchema } from './api-helpers'
52
- import {
51
+ import type { ApiInterface, HelpersStubSchema } from './api-helpers'
52
+ import type {
53
53
  MDatatableProps,
54
54
  MDatatableSlots,
55
55
  MDtAvatarProps,
@@ -6,7 +6,7 @@
6
6
  * Github: https://github.com/mythpe
7
7
  */
8
8
 
9
- import { myth } from '../utils'
9
+ import type { myth } from '../utils'
10
10
 
11
11
  export type MythContext = typeof myth;
12
12
 
@@ -10,9 +10,9 @@ import type { AxiosResponse } from 'axios'
10
10
  import type { QAvatarProps, QAvatarSlots, QTableProps, QTableSlots } from 'quasar'
11
11
  import type { ComputedRef, MaybeRef, Ref, UnwrapNestedRefs, UnwrapRef, VNode } from 'vue'
12
12
  import type { RouteLocationRaw } from 'vue-router'
13
- import { GenericFormValues, MBtnProps, MBtnSlots, MFormSlots } from './components'
14
- import { StubSchema } from './api-helpers'
15
- import { ApiMetaInterface, Generic } from './m-helpers'
13
+ import type { GenericFormValues, MBtnProps, MBtnSlots, MFormSlots } from './components'
14
+ import type { StubSchema } from './api-helpers'
15
+ import type { ApiMetaInterface, Generic } from './m-helpers'
16
16
 
17
17
  export type MDtItem<T extends object = Record<keyof T, any>> = T & {
18
18
  id: string | number;
@@ -37,7 +37,7 @@ import type {
37
37
  QPageStickyProps,
38
38
  QPopupProxyProps
39
39
  } from 'quasar'
40
- import { MDatatableProps, MDtBtnProps } from './m-datatable'
40
+ import type { MDatatableProps, MDtBtnProps } from './m-datatable'
41
41
 
42
42
  export interface PropsContext {
43
43
  // Grid.
@@ -56,7 +56,7 @@ import {
56
56
  MDtContextmenuItems
57
57
  } from '../components'
58
58
 
59
- import { InstallOptions } from '../types/install-options'
59
+ import type { InstallOptions } from '../types'
60
60
 
61
61
  function install (app: App, options: InstallOptions = {}) {
62
62
  if (options.rounded !== undefined) {
@@ -93,6 +93,19 @@ function install (app: App, options: InstallOptions = {}) {
93
93
  myth.mAxios.value = options.mAxios
94
94
  }
95
95
 
96
+ // const importList = import.meta.glob('./components/**/*.vue')
97
+ // const startIndex = '/components/'.length
98
+ // const routes = Object.keys(importList).map(key => {
99
+ // return {
100
+ // path: key.substring(startIndex, key.length - 4),
101
+ // component: importList[key]
102
+ // }
103
+ // })
104
+ // console.log(routes)
105
+ // for (const routesKey in routes) {
106
+ // console.log(routesKey)
107
+ // }
108
+
96
109
  // Form.
97
110
  app.component('MAvatarViewer', MAvatarViewer)
98
111
  app.component('MAxios', MAxios)