@d-mok/quasar-app-extension-quasar-axe 2.0.15 → 2.0.18
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/templates/src/boot/axe/components/QxBtnIcon.vue +11 -0
- package/src/templates/src/boot/axe/components/QxBtnToggle.vue +42 -0
- package/src/templates/src/boot/axe/components/QxRadio.vue +42 -0
- package/src/templates/src/boot/axe/components/QxText.vue +37 -0
- package/src/templates/src/utils/index.ts +3 -0
- package/src/templates/src/utils/puppets/table.ts +10 -2
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-btn-toggle
|
|
3
|
+
v-model="selected"
|
|
4
|
+
:options="opts"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { computed } from '@vue/reactivity'
|
|
11
|
+
import { useVModel } from '@vueuse/core'
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(
|
|
14
|
+
defineProps<{
|
|
15
|
+
modelValue: any
|
|
16
|
+
options: any[]
|
|
17
|
+
optionLabel?: string | ((_: any) => string)
|
|
18
|
+
}>(),
|
|
19
|
+
{}
|
|
20
|
+
)
|
|
21
|
+
const emits = defineEmits(['update:modelValue'])
|
|
22
|
+
|
|
23
|
+
const selected = useVModel(props, 'modelValue', emits)
|
|
24
|
+
|
|
25
|
+
function getLabelFunc(labeler?: string | ((_: any) => string)) {
|
|
26
|
+
if (typeof labeler === 'string') {
|
|
27
|
+
return ($: any) => String($[labeler])
|
|
28
|
+
}
|
|
29
|
+
if (typeof labeler === 'function') {
|
|
30
|
+
return labeler
|
|
31
|
+
}
|
|
32
|
+
return ($: any) => String($)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let opts = computed(() => {
|
|
36
|
+
let f = getLabelFunc(props.optionLabel)
|
|
37
|
+
return props.options.map($ => {
|
|
38
|
+
let str = f($)
|
|
39
|
+
return { label: str, value: str }
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-option-group
|
|
3
|
+
v-model="selected"
|
|
4
|
+
:options="opts"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts" setup>
|
|
10
|
+
import { computed } from '@vue/reactivity'
|
|
11
|
+
import { useVModel } from '@vueuse/core'
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(
|
|
14
|
+
defineProps<{
|
|
15
|
+
modelValue: any
|
|
16
|
+
options: any[]
|
|
17
|
+
optionLabel?: string | ((_: any) => string)
|
|
18
|
+
}>(),
|
|
19
|
+
{}
|
|
20
|
+
)
|
|
21
|
+
const emits = defineEmits(['update:modelValue'])
|
|
22
|
+
|
|
23
|
+
const selected = useVModel(props, 'modelValue', emits)
|
|
24
|
+
|
|
25
|
+
function getLabelFunc(labeler?: string | ((_: any) => string)) {
|
|
26
|
+
if (typeof labeler === 'string') {
|
|
27
|
+
return ($: any) => String($[labeler])
|
|
28
|
+
}
|
|
29
|
+
if (typeof labeler === 'function') {
|
|
30
|
+
return labeler
|
|
31
|
+
}
|
|
32
|
+
return ($: any) => String($)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let opts = computed(() => {
|
|
36
|
+
let f = getLabelFunc(props.optionLabel)
|
|
37
|
+
return props.options.map($ => {
|
|
38
|
+
let str = f($)
|
|
39
|
+
return { label: str, value: str }
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
</script>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
:class="{
|
|
5
|
+
'text-caption': caption,
|
|
6
|
+
'text-subtitle1': subtitle1,
|
|
7
|
+
'text-subtitle2': subtitle2,
|
|
8
|
+
'text-body1': body1,
|
|
9
|
+
'text-body2': body2,
|
|
10
|
+
'text-h6': h6,
|
|
11
|
+
'text-h5': h5,
|
|
12
|
+
'text-h4': h4,
|
|
13
|
+
'text-weight-bold': bold,
|
|
14
|
+
'text-weight-bolder': bolder,
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<slot></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts" setup>
|
|
22
|
+
const props = withDefaults(
|
|
23
|
+
defineProps<{
|
|
24
|
+
bold?: boolean
|
|
25
|
+
bolder?: boolean
|
|
26
|
+
caption?: boolean
|
|
27
|
+
subtitle1?: boolean
|
|
28
|
+
subtitle2?: boolean
|
|
29
|
+
body1?: boolean
|
|
30
|
+
body2?: boolean
|
|
31
|
+
h6?: boolean
|
|
32
|
+
h5?: boolean
|
|
33
|
+
h4?: boolean
|
|
34
|
+
}>(),
|
|
35
|
+
{}
|
|
36
|
+
)
|
|
37
|
+
</script>
|
|
@@ -63,9 +63,17 @@ export function TABLE<
|
|
|
63
63
|
this.order(...ordering)
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
/** Get an item by `criteria`. If not found,
|
|
66
|
+
/** Get an item by `criteria`. If not found, throw error. */
|
|
67
67
|
got(criteria: Criteria<T>): T {
|
|
68
|
-
|
|
68
|
+
let obj = this.get(criteria)
|
|
69
|
+
if (obj === undefined) {
|
|
70
|
+
throw (
|
|
71
|
+
EntityClass.name +
|
|
72
|
+
' has no element matching ' +
|
|
73
|
+
JSON.stringify(criteria)
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
return obj
|
|
69
77
|
}
|
|
70
78
|
|
|
71
79
|
/** make reactive */
|