@mythpe/quasar-ui-qui 0.1.77 → 0.1.79
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.1.
|
|
3
|
+
"version": "0.1.79",
|
|
4
4
|
"description": "MyTh Quasar UI Kit App Extension",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "MyTh Ahmed Faiz",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"main": "src/index.common.js",
|
|
15
15
|
"types": "types.d.ts",
|
|
16
16
|
"scripts": {
|
|
17
|
-
"lint": "eslint
|
|
18
|
-
"lint:fix": "eslint --fix
|
|
17
|
+
"lint": "eslint ./src --ext .js,.ts,.vue ./",
|
|
18
|
+
"lint:fix": "eslint --fix --ext .js,.ts,.vue ./src",
|
|
19
19
|
"dev": "cd ../dev && yarn dev && cd ..",
|
|
20
20
|
"dev:umd": "yarn build && node build/script.open-umd.js",
|
|
21
21
|
"dev:ssr": "cd ../dev && yarn 'dev:ssr' && cd ..",
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
"axios": "^1.9.0",
|
|
34
34
|
"ckeditor5": "^45.0.0",
|
|
35
35
|
"lodash": "4.17.21",
|
|
36
|
-
"@types/lodash": "4.14.191",
|
|
37
36
|
"lodash-inflection": "^1.5.0",
|
|
38
37
|
"qs": "^6.14.0",
|
|
39
38
|
"typed.js": "^2.1.0",
|
|
@@ -51,43 +50,42 @@
|
|
|
51
50
|
"@intlify/unplugin-vue-i18n": "^4.0.0",
|
|
52
51
|
"@originjs/vite-plugin-commonjs": "^1.0.3",
|
|
53
52
|
"@quasar/app-vite": "^2.2.0",
|
|
54
|
-
"@quasar/app-webpack": "^
|
|
53
|
+
"@quasar/app-webpack": "^3.15.1",
|
|
55
54
|
"@quasar/cli": "^2.5.0",
|
|
56
55
|
"@quasar/extras": "^1.16.17",
|
|
57
56
|
"@rollup/plugin-buble": "^1.0.3",
|
|
58
57
|
"@rollup/plugin-json": "^6.1.0",
|
|
59
|
-
"@rollup/plugin-node-resolve": "^
|
|
60
|
-
"@rollup/plugin-replace": "^6.0.
|
|
61
|
-
"@types/express": "
|
|
62
|
-
"@types/
|
|
63
|
-
"@
|
|
64
|
-
"@typescript-eslint/
|
|
65
|
-
"@
|
|
66
|
-
"autoprefixer": "^10.4.
|
|
67
|
-
"chalk": "^5.
|
|
68
|
-
"core-js": "^3.
|
|
58
|
+
"@rollup/plugin-node-resolve": "^15.3.0",
|
|
59
|
+
"@rollup/plugin-replace": "^6.0.1",
|
|
60
|
+
"@types/express": "^5.0.0",
|
|
61
|
+
"@types/lodash": "^4.17.13",
|
|
62
|
+
"@types/node": "^22.10.1",
|
|
63
|
+
"@typescript-eslint/eslint-plugin": "^7.16.0",
|
|
64
|
+
"@typescript-eslint/parser": "^7.16.0",
|
|
65
|
+
"autoprefixer": "^10.4.20",
|
|
66
|
+
"chalk": "^5.3.0",
|
|
67
|
+
"core-js": "^3.39.0",
|
|
69
68
|
"cssnano": "^7.0.6",
|
|
70
|
-
"eslint": "^
|
|
71
|
-
"eslint-config-standard": "^17.
|
|
72
|
-
"eslint-plugin-import": "^2.
|
|
73
|
-
"eslint-plugin-n": "^
|
|
74
|
-
"eslint-plugin-promise": "^
|
|
75
|
-
"eslint-plugin-vue": "^9.
|
|
76
|
-
"fs-extra": "^11.
|
|
69
|
+
"eslint": "^8.57.0",
|
|
70
|
+
"eslint-config-standard": "^17.0.0",
|
|
71
|
+
"eslint-plugin-import": "^2.19.1",
|
|
72
|
+
"eslint-plugin-n": "^15.0.0",
|
|
73
|
+
"eslint-plugin-promise": "^6.0.0",
|
|
74
|
+
"eslint-plugin-vue": "^9.0.0",
|
|
75
|
+
"fs-extra": "^11.2.0",
|
|
76
|
+
"open": "^10.1.0",
|
|
77
|
+
"postcss": "^8.4.49",
|
|
78
|
+
"quasar": "^2.17.0",
|
|
77
79
|
"globals": "^15.12.0",
|
|
78
80
|
"laravel-echo": "^2.0.2",
|
|
79
|
-
"open": "^10.1.2",
|
|
80
|
-
"postcss": "^8.5.3",
|
|
81
81
|
"pusher-js": "^8.4.0",
|
|
82
|
-
"quasar": "^2.18.1",
|
|
83
82
|
"rimraf": "^6.0.1",
|
|
84
|
-
"rollup": "^4.
|
|
83
|
+
"rollup": "^4.27.4",
|
|
85
84
|
"rtlcss": "^4.3.0",
|
|
86
85
|
"sass": "^1.87.0",
|
|
87
86
|
"typescript": "~5.5.3",
|
|
88
87
|
"uglify-js": "^3.19.3",
|
|
89
|
-
"vite-plugin-checker": "^0.
|
|
90
|
-
"vite-plugin-commonjs": "^0.10.4",
|
|
88
|
+
"vite-plugin-checker": "^0.8.0",
|
|
91
89
|
"vue": "^3.5.13",
|
|
92
90
|
"vue-router": "^4.5.1",
|
|
93
91
|
"vue-tsc": "^2.0.29",
|
|
@@ -15,7 +15,7 @@ import type { InvalidSubmissionHandler, SubmissionHandler } from 'vee-validate'
|
|
|
15
15
|
import { useForm } from 'vee-validate'
|
|
16
16
|
import { computed, onMounted, ref, toValue, watch } from 'vue'
|
|
17
17
|
import { is as quasarHelpers, QCardSection, QTable, useQuasar } from 'quasar'
|
|
18
|
-
import
|
|
18
|
+
import { isArray } from 'lodash'
|
|
19
19
|
import { useDtHelpers, useMyth } from '../../composable'
|
|
20
20
|
import { useI18n } from 'vue-i18n'
|
|
21
21
|
|
|
@@ -1065,10 +1065,10 @@ defineExpose({
|
|
|
1065
1065
|
}}</span>
|
|
1066
1066
|
<span v-else-if="typeof filterValue === 'string'">: {{ filterValue }}</span>
|
|
1067
1067
|
<span
|
|
1068
|
-
v-else-if="
|
|
1068
|
+
v-else-if="isArray(filterValue) && !quasarHelpers.object(filterValue[0])"
|
|
1069
1069
|
>: {{ filterValue.join(', ') }}</span>
|
|
1070
1070
|
<span
|
|
1071
|
-
v-else-if="
|
|
1071
|
+
v-else-if="isArray(filterValue) && quasarHelpers.object(filterValue[0])"
|
|
1072
1072
|
>: {{ filterValue.map(e => e.label).join(', ') }}</span>
|
|
1073
1073
|
<span
|
|
1074
1074
|
v-else-if="quasarHelpers.object(filterValue) && filterValue.label"
|
|
@@ -18,7 +18,7 @@ import type {
|
|
|
18
18
|
import { useI18n } from 'vue-i18n'
|
|
19
19
|
import { useMyth } from './useMyth'
|
|
20
20
|
import { useQuasar } from 'quasar'
|
|
21
|
-
import
|
|
21
|
+
import { isArray, isObject, isFunction, isPlainObject } from 'lodash'
|
|
22
22
|
import { useRoute, useRouter } from 'vue-router'
|
|
23
23
|
import type { AxiosRequestConfig } from 'axios'
|
|
24
24
|
import { useResetForm, useSetFormValues } from 'vee-validate'
|
|
@@ -244,15 +244,15 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
244
244
|
v = params.split(',')
|
|
245
245
|
}
|
|
246
246
|
|
|
247
|
-
if (
|
|
247
|
+
if (isArray(params)) {
|
|
248
248
|
v = [...params]
|
|
249
|
-
} else if (
|
|
249
|
+
} else if (isObject(params) && typeof params !== 'function') {
|
|
250
250
|
let e
|
|
251
251
|
for (const k in params) {
|
|
252
252
|
e = params[k]
|
|
253
253
|
v.push(`${k}=${e}`)
|
|
254
254
|
}
|
|
255
|
-
} else if (
|
|
255
|
+
} else if (isFunction(params)) {
|
|
256
256
|
const f = params()
|
|
257
257
|
v = typeof f === 'string' ? f.split(',') : f
|
|
258
258
|
}
|
|
@@ -277,7 +277,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
277
277
|
if (Object.keys(filterForm.value).length > 0) {
|
|
278
278
|
const TempFilter = { ...filterForm.value } as any
|
|
279
279
|
for (const fKey in TempFilter) {
|
|
280
|
-
if (
|
|
280
|
+
if (isArray(TempFilter[fKey])) {
|
|
281
281
|
TempFilter[fKey] = TempFilter[fKey].map((elm: any) => {
|
|
282
282
|
if (elm.id) {
|
|
283
283
|
return elm.id
|
|
@@ -286,7 +286,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
286
286
|
}
|
|
287
287
|
return elm
|
|
288
288
|
})
|
|
289
|
-
} else if (
|
|
289
|
+
} else if (isPlainObject(TempFilter[fKey])) {
|
|
290
290
|
if (TempFilter[fKey].id) {
|
|
291
291
|
TempFilter[fKey] = TempFilter[fKey].id
|
|
292
292
|
} else if (TempFilter[fKey].value) {
|
|
@@ -338,6 +338,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
338
338
|
sortBy: opts?.pagination?.sortBy || undefined,
|
|
339
339
|
descending: opts?.pagination?.descending || undefined
|
|
340
340
|
}
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
341
342
|
_meta && (meta.value = _meta)
|
|
342
343
|
if (props.endReach) {
|
|
343
344
|
getRows.value = [...getRows.value, ...(_data || [])]
|
|
@@ -390,6 +391,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
390
391
|
getMythApiServicesSchema().export(data, config)
|
|
391
392
|
.then(async (response) => {
|
|
392
393
|
const { _message } = response || {}
|
|
394
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
393
395
|
_message && (alertSuccess(_message))
|
|
394
396
|
try {
|
|
395
397
|
await downloadFromResponse(response)
|
|
@@ -428,6 +430,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
428
430
|
init[k] = attrs && k in attrs ? attrs[k] : defaultItem.value[k]
|
|
429
431
|
}
|
|
430
432
|
resetDialogForm({ values: init || {} }, { force: !0 })
|
|
433
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
431
434
|
attrs && setValues(attrs, !1)
|
|
432
435
|
}
|
|
433
436
|
const openFilterDialog = () => {
|
|
@@ -501,7 +504,7 @@ export const useDtHelpers = (options: MaybeRefOrGetter<MDatatableProps>) => {
|
|
|
501
504
|
})
|
|
502
505
|
.catch((e: any) => {
|
|
503
506
|
const message = e?._message || e?.message
|
|
504
|
-
message
|
|
507
|
+
if (message) alertError(message)
|
|
505
508
|
})
|
|
506
509
|
.finally(() => (loading.value = !1))
|
|
507
510
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Github: https://github.com/mythpe
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { camelCase, filter, isString, pascalCase, pluralize, singularize, snakeCase, startsWith, uniq, uniqBy } from 'lodash'
|
|
10
10
|
import { useI18n } from 'vue-i18n'
|
|
11
11
|
import type { RouteLocationNormalizedLoaded } from 'vue-router'
|
|
12
12
|
import { useRoute } from 'vue-router'
|
|
@@ -52,22 +52,22 @@ export const useMyth = () => {
|
|
|
52
52
|
const s = routeName.split('.')
|
|
53
53
|
lastRouteName = s[s.length - 2] ?? lastRouteName
|
|
54
54
|
}
|
|
55
|
-
const
|
|
56
|
-
const singular = Str.pascalCase(
|
|
55
|
+
const __pluralize = Str.pascalCase(pluralize(lastRouteName))
|
|
56
|
+
const singular = Str.pascalCase(singularize(lastRouteName))
|
|
57
57
|
|
|
58
|
-
const keys =
|
|
58
|
+
const keys = filter(uniq([
|
|
59
59
|
`routes.${routeName}`,
|
|
60
60
|
`routes.${routePath}`,
|
|
61
61
|
`${lastRouteName}Page.title`,
|
|
62
|
-
`${
|
|
63
|
-
`choice.${
|
|
62
|
+
`${camelCase(lastRouteName)}Page.title`,
|
|
63
|
+
`choice.${__pluralize}`,
|
|
64
64
|
`choice.${singular}`,
|
|
65
65
|
`replace.${lastRouteName}_details`,
|
|
66
66
|
`replace.${lastRouteName}`,
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
__pluralize,
|
|
68
|
+
snakeCase(__pluralize),
|
|
69
69
|
singular,
|
|
70
|
-
|
|
70
|
+
snakeCase(singular)
|
|
71
71
|
]))
|
|
72
72
|
// console.log(keys)
|
|
73
73
|
let str: string | null = null
|
|
@@ -77,17 +77,17 @@ export const useMyth = () => {
|
|
|
77
77
|
if (!(k = keys[f])) {
|
|
78
78
|
continue
|
|
79
79
|
}
|
|
80
|
-
if (te && te(k) &&
|
|
81
|
-
if (
|
|
80
|
+
if (te && te(k) && isString(t(k))) {
|
|
81
|
+
if (startsWith(k, 'choice.')) {
|
|
82
82
|
const s = k.split('.')
|
|
83
83
|
const n = routeName.split('.')
|
|
84
84
|
if (s.length === 2 && n.length > 1) {
|
|
85
85
|
const model = n[n.length - 2]
|
|
86
|
-
const pluralizeModel =
|
|
86
|
+
const pluralizeModel = pluralize(pascalCase(model))
|
|
87
87
|
const _modelChoiceKey = `choice.${pluralizeModel}`
|
|
88
88
|
if (te(_modelChoiceKey)) {
|
|
89
89
|
const l = t(_modelChoiceKey, number as any)
|
|
90
|
-
const rep =
|
|
90
|
+
const rep = singularize(n[n.length - 1]).toLocaleLowerCase()
|
|
91
91
|
const e = `replace.${rep}`
|
|
92
92
|
str = te(e) ? t(e, { name: l }) : null
|
|
93
93
|
} else {
|
|
@@ -101,7 +101,7 @@ export const useMyth = () => {
|
|
|
101
101
|
} else {
|
|
102
102
|
const parents: string[] = routeName.split('.')
|
|
103
103
|
if (parents.length > 1) {
|
|
104
|
-
const e = `choice.${Str.pascalCase(
|
|
104
|
+
const e = `choice.${Str.pascalCase(pluralize(parents[parents.length - 2]))}`
|
|
105
105
|
if (te(e)) {
|
|
106
106
|
str = t(k, { name: t(e, '1') })
|
|
107
107
|
} else {
|
|
@@ -165,11 +165,11 @@ export const useMyth = () => {
|
|
|
165
165
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
166
166
|
// @ts-ignore
|
|
167
167
|
item.label = t(k)
|
|
168
|
-
} else if (te((k = `attributes.${
|
|
168
|
+
} else if (te((k = `attributes.${snakeCase(item.label)}`))) {
|
|
169
169
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
170
170
|
// @ts-ignore
|
|
171
171
|
item.label = t(k)
|
|
172
|
-
} else if (te((k = `attributes.${
|
|
172
|
+
} else if (te((k = `attributes.${camelCase(item.label)}`))) {
|
|
173
173
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
174
174
|
// @ts-ignore
|
|
175
175
|
item.label = t(k)
|
|
@@ -177,7 +177,7 @@ export const useMyth = () => {
|
|
|
177
177
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
178
178
|
// @ts-ignore
|
|
179
179
|
item.label = t(k)
|
|
180
|
-
} else if (te((k = `choice.${
|
|
180
|
+
} else if (te((k = `choice.${pluralize(Str.pascalCase(item.label))}`))) {
|
|
181
181
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
182
182
|
// @ts-ignore
|
|
183
183
|
item.label = t(k, 2)
|
|
@@ -215,7 +215,7 @@ export const useMyth = () => {
|
|
|
215
215
|
}
|
|
216
216
|
result.push(item)
|
|
217
217
|
})
|
|
218
|
-
return
|
|
218
|
+
return uniqBy(result, (e: MDtColumn) => e.name)
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* Copy text
|
package/src/utils/Helpers.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import type { AxiosInstance, AxiosRequestConfig } from 'axios'
|
|
10
10
|
import type { ConfigType, DownloadFromResponse, DownloadFromResponseCode, HelpersStubSchema, ParamsType, UrlType } from '../types'
|
|
11
|
-
import
|
|
11
|
+
import { find, isArray, isPlainObject } from 'lodash'
|
|
12
12
|
import { colors, openURL, scroll, setCssVar } from 'quasar'
|
|
13
13
|
import { nextTick } from 'vue'
|
|
14
14
|
|
|
@@ -46,7 +46,7 @@ export const Helpers = {
|
|
|
46
46
|
value = values[key]
|
|
47
47
|
if (value !== null && value !== undefined && typeof value === 'object') {
|
|
48
48
|
const k = name ? name + '[' + key + ']' : key
|
|
49
|
-
if (
|
|
49
|
+
if (isArray(value) && value.length < 1) {
|
|
50
50
|
formData.append(`${key}`, '')
|
|
51
51
|
} else {
|
|
52
52
|
this.appendArray(formData, value, k)
|
|
@@ -91,6 +91,7 @@ export const Helpers = {
|
|
|
91
91
|
async store (data?: ParamsType, config?: AxiosRequestConfig) {
|
|
92
92
|
const u = makeUrl()
|
|
93
93
|
const formData = new FormData()
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
94
95
|
data && Helpers.appendArray(formData, data)
|
|
95
96
|
return axios().post(u, formData, config)
|
|
96
97
|
},
|
|
@@ -106,12 +107,14 @@ export const Helpers = {
|
|
|
106
107
|
const u = makeUrl(id)
|
|
107
108
|
const formData = new FormData()
|
|
108
109
|
formData.append('_method', 'put')
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
109
111
|
data && Helpers.appendArray(formData, data)
|
|
110
112
|
return axios().post(u, formData, config)
|
|
111
113
|
},
|
|
112
114
|
async clone (id: UrlType, data?: ParamsType, config?: AxiosRequestConfig) {
|
|
113
115
|
const u = makeUrl(`${id}/Clone`)
|
|
114
116
|
const formData = new FormData()
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
115
118
|
data && Helpers.appendArray(formData, data)
|
|
116
119
|
return axios().post(u, formData, config)
|
|
117
120
|
},
|
|
@@ -143,7 +146,7 @@ export const Helpers = {
|
|
|
143
146
|
parent?: UrlType
|
|
144
147
|
): string => ((parent ?? '') + (parent && group ? '/' : '')) + (group ?? '') + ((group && segments ? '/' : '') + (segments ?? '')),
|
|
145
148
|
findBy (search: any, value: any, column: string | number = 'id') {
|
|
146
|
-
return
|
|
149
|
+
return find(search, (e: any) => isPlainObject(e) ? e[column] === value : e === value)
|
|
147
150
|
},
|
|
148
151
|
// queryStringify: (v: never) => new URLSearchParams(qs.stringify(v, {
|
|
149
152
|
// arrayFormat: 'indices'
|
package/src/utils/Str.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Github: https://github.com/mythpe
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { camelCase, flow, mixin, pascalCase, pluralize, singularize, upperFirst } from 'lodash'
|
|
10
10
|
|
|
11
11
|
export const Str = {
|
|
12
12
|
/**
|
|
@@ -73,16 +73,16 @@ export const Str = {
|
|
|
73
73
|
// return mobile && ((mobile.length === 10 && (c1 === '05' || parseInt(c1) === 5)) || (mobile.length === 9 && c2 === 5))
|
|
74
74
|
},
|
|
75
75
|
pascalCase (string?: string): string {
|
|
76
|
-
if (!
|
|
77
|
-
|
|
76
|
+
if (!pascalCase) {
|
|
77
|
+
mixin({ pascalCase: flow(camelCase, upperFirst) })
|
|
78
78
|
}
|
|
79
|
-
return
|
|
79
|
+
return pascalCase(string)
|
|
80
80
|
},
|
|
81
81
|
pluralize (string?: string): string {
|
|
82
|
-
return
|
|
82
|
+
return pluralize?.(string)
|
|
83
83
|
},
|
|
84
84
|
singular (string?: string): string {
|
|
85
|
-
return
|
|
85
|
+
return singularize(string)
|
|
86
86
|
},
|
|
87
87
|
flipChoice (data: Record<any, any>) {
|
|
88
88
|
const f: Record<any, any> = {}
|
package/src/utils/vee-rules.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Github: https://github.com/mythpe
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import { isNumber } from 'lodash'
|
|
10
10
|
import { patterns } from 'quasar'
|
|
11
11
|
|
|
12
12
|
const { testPattern } = patterns
|
|
@@ -16,7 +16,7 @@ export const veeRules = {
|
|
|
16
16
|
if (v === undefined || v === null) {
|
|
17
17
|
return !0
|
|
18
18
|
}
|
|
19
|
-
return
|
|
19
|
+
return isNumber(parseInt(v)) && !isNaN(parseInt(v)) &&
|
|
20
20
|
v?.toString().split('.')?.length <= 2 &&
|
|
21
21
|
(/(\d)+/g.test(v) && !/[a-zA-Z]/.test(v))
|
|
22
22
|
},
|