bt-core-app 1.4.1 → 1.4.3
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/dist/bt-core-app.js +4079 -28248
- package/dist/index.d.ts +0 -4
- package/package.json +8 -2
- package/dist/components/BT-Btn.vue.d.ts +0 -41
- package/dist/components/BT-Col.vue.d.ts +0 -49
- package/dist/components/BT-Field-Checkbox.vue.d.ts +0 -56
- package/dist/components/BT-Field-Date.vue.d.ts +0 -64
- package/dist/components/BT-Field-Entity.vue.d.ts +0 -46
- package/dist/components/BT-Field-Select.vue.d.ts +0 -54
- package/dist/components/BT-Field-String.vue.d.ts +0 -53
- package/dist/components/BT-Field-Switch.vue.d.ts +0 -51
- package/dist/components/BT-Field-Tags.vue.d.ts +0 -51
- package/dist/components/BT-Field-Textarea.vue.d.ts +0 -52
- package/dist/components/BT-Field-Trigger.vue.d.ts +0 -79
- package/dist/components/BT-Header-Option.vue.d.ts +0 -18
- package/dist/components/BT-Json.vue.d.ts +0 -8
- package/dist/components/BT-Nav-Menu-Item.vue.d.ts +0 -36
- package/dist/components/BT-Nav-Sidebar.vue.d.ts +0 -25
- package/dist/components/BT-Select-List-Box.vue.d.ts +0 -108
- package/dist/components/BT-Select.vue.d.ts +0 -53
- package/dist/components/BT-Snack.vue.d.ts +0 -33
- package/dist/components/BT-Span.vue.d.ts +0 -17
- package/dist/components/Dialog-Confirm.vue.d.ts +0 -38
- package/dist/components/Dialog-Select-Date.vue.d.ts +0 -36
- package/dist/components/Dialog-Select.vue.d.ts +0 -48
- package/dist/components/Dialog-Text.vue.d.ts +0 -33
- package/dist/main.d.ts +0 -0
- package/dist/style.css +0 -1
- package/dist/useApi.d.ts +0 -0
- package/src/assets/vue.svg +0 -1
- package/src/components/BT-Btn.vue +0 -41
- package/src/components/BT-Col.vue +0 -36
- package/src/components/BT-Field-Checkbox.vue +0 -70
- package/src/components/BT-Field-Date.vue +0 -108
- package/src/components/BT-Field-Entity.vue +0 -48
- package/src/components/BT-Field-Select.vue +0 -67
- package/src/components/BT-Field-String.vue +0 -78
- package/src/components/BT-Field-Switch.vue +0 -68
- package/src/components/BT-Field-Tags.vue +0 -66
- package/src/components/BT-Field-Textarea.vue +0 -67
- package/src/components/BT-Field-Trigger.vue +0 -315
- package/src/components/BT-Header-Option.vue +0 -39
- package/src/components/BT-Json.vue +0 -67
- package/src/components/BT-Nav-Menu-Item.vue +0 -61
- package/src/components/BT-Nav-Sidebar.vue +0 -79
- package/src/components/BT-Select-List-Box.vue +0 -258
- package/src/components/BT-Select.vue +0 -46
- package/src/components/BT-Snack.vue +0 -31
- package/src/components/BT-Span.vue +0 -21
- package/src/components/Dialog-Confirm.vue +0 -47
- package/src/components/Dialog-Select-Date.vue +0 -89
- package/src/components/Dialog-Select.vue +0 -140
- package/src/components/Dialog-Text.vue +0 -59
- package/src/composables/actions-tracker.ts +0 -99
- package/src/composables/actions.ts +0 -354
- package/src/composables/api.ts +0 -479
- package/src/composables/auth.ts +0 -452
- package/src/composables/cosmetics.ts +0 -177
- package/src/composables/csv.ts +0 -198
- package/src/composables/dates.ts +0 -86
- package/src/composables/demo.ts +0 -33
- package/src/composables/dialogs.ts +0 -115
- package/src/composables/document-meta.ts +0 -44
- package/src/composables/draggable.ts +0 -189
- package/src/composables/filters.ts +0 -264
- package/src/composables/forage.ts +0 -49
- package/src/composables/helpers.ts +0 -647
- package/src/composables/id.ts +0 -20
- package/src/composables/list.ts +0 -604
- package/src/composables/navigation.ts +0 -222
- package/src/composables/presets.ts +0 -28
- package/src/composables/pwa.ts +0 -97
- package/src/composables/resizable.ts +0 -382
- package/src/composables/rules.ts +0 -40
- package/src/composables/stores.ts +0 -818
- package/src/composables/track.ts +0 -55
- package/src/composables/urls.ts +0 -66
- package/src/core.ts +0 -121
- package/src/index.ts +0 -48
- package/src/main.ts +0 -6
- package/src/types.ts +0 -17
- package/src/useApi.ts +0 -68
- package/src/vite-env.d.ts +0 -1
- package/test/api.test.ts +0 -84
- package/test/auth.test.ts +0 -74
- package/test/forage.test.ts +0 -31
- package/test/helpers.test.ts +0 -231
- package/test/navigation.test.ts +0 -99
- package/test/stores-last-update.test.ts +0 -138
- package/test/stores-session.test.ts +0 -118
- package/test/track.test.ts +0 -29
- package/test/urls.test.ts +0 -42
- package/test/utils.ts +0 -15
- package/tsconfig.json +0 -28
- package/tsconfig.node.json +0 -11
- package/vite.config.ts +0 -45
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<bt-select
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:readonly="!cIsEditing"
|
|
10
|
-
:fieldVariant="cIsEditing ? editVariant : variant"
|
|
11
|
-
v-model="value" />
|
|
12
|
-
</v-col>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script setup lang="ts">
|
|
16
|
-
import { computed, inject, ref } from 'vue'
|
|
17
|
-
|
|
18
|
-
defineOptions({
|
|
19
|
-
inheritAttrs: false
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
interface FieldProps {
|
|
23
|
-
cols?: string | boolean
|
|
24
|
-
// density?: BladeDensity
|
|
25
|
-
horizontal?: boolean
|
|
26
|
-
isEditing?: boolean
|
|
27
|
-
isMobile?: boolean
|
|
28
|
-
// label?: string
|
|
29
|
-
lg?: string | boolean
|
|
30
|
-
md?: string | boolean
|
|
31
|
-
modelValue?: any
|
|
32
|
-
rules?: any
|
|
33
|
-
sm?: string | boolean
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
37
|
-
isEditing: undefined,
|
|
38
|
-
cols: '12',
|
|
39
|
-
lg: false,
|
|
40
|
-
md: false,
|
|
41
|
-
sm: '6'
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
const emit = defineEmits(['update:modelValue', 'select'])
|
|
45
|
-
|
|
46
|
-
const value = computed({
|
|
47
|
-
get() {
|
|
48
|
-
return props.modelValue
|
|
49
|
-
},
|
|
50
|
-
set(value) {
|
|
51
|
-
emit('update:modelValue', value)
|
|
52
|
-
emit('select', value)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
57
|
-
|
|
58
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
59
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
60
|
-
const variant = inject('fieldVariant', 'underlined')
|
|
61
|
-
const editVariant = inject('fieldEditVariant', 'outlined')
|
|
62
|
-
|
|
63
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
64
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
65
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
66
|
-
|
|
67
|
-
</script>
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<v-text-field
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:hide-details="!rules"
|
|
10
|
-
:prefix="useCurrency ? '$' : undefined"
|
|
11
|
-
:readonly="!cIsEditing"
|
|
12
|
-
:rules="rules"
|
|
13
|
-
:variant="cIsEditing ? editVariant : variant"
|
|
14
|
-
v-model="value" />
|
|
15
|
-
</v-col>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
// import { type BladeDensity } from '../types'
|
|
20
|
-
import { computed, inject, ref } from 'vue'
|
|
21
|
-
// import { useFilters } from '@/composables/filters'
|
|
22
|
-
|
|
23
|
-
defineOptions({
|
|
24
|
-
inheritAttrs: false
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
interface FieldProps {
|
|
28
|
-
cols?: string | boolean
|
|
29
|
-
horizontal?: boolean
|
|
30
|
-
isEditing?: boolean
|
|
31
|
-
isMobile?: boolean
|
|
32
|
-
lg?: string | boolean
|
|
33
|
-
md?: string | boolean
|
|
34
|
-
modelValue: any
|
|
35
|
-
rules?: any
|
|
36
|
-
sm?: string | boolean
|
|
37
|
-
useCurrency?: boolean
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
41
|
-
isEditing: undefined,
|
|
42
|
-
cols: '12',
|
|
43
|
-
lg: false,
|
|
44
|
-
md: false,
|
|
45
|
-
sm: '6'
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const emit = defineEmits(['update:modelValue'])
|
|
49
|
-
|
|
50
|
-
const value = computed({
|
|
51
|
-
get() {
|
|
52
|
-
return props.modelValue
|
|
53
|
-
},
|
|
54
|
-
set(value) {
|
|
55
|
-
emit('update:modelValue', value)
|
|
56
|
-
}
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
60
|
-
|
|
61
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
62
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
63
|
-
const variant = inject('fieldVariant', 'underlined')
|
|
64
|
-
const editVariant = inject('fieldEditVariant', 'outlined')
|
|
65
|
-
|
|
66
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
67
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
68
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
69
|
-
// const str: Ref<any> = ref(undefined)
|
|
70
|
-
|
|
71
|
-
// watch(props.modelValue, (v) => { str.value = v })
|
|
72
|
-
|
|
73
|
-
// function update(v: any) {
|
|
74
|
-
// emit('update:modelValue', v)
|
|
75
|
-
// emit('change', v)
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
</script>
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<v-list-item>
|
|
8
|
-
<v-list-item-subtitle>{{ label }}</v-list-item-subtitle>
|
|
9
|
-
<v-list-item-title>{{ modelValue }}</v-list-item-title>
|
|
10
|
-
<template #append>
|
|
11
|
-
<v-switch
|
|
12
|
-
v-bind="$attrs"
|
|
13
|
-
:readonly="!cIsEditing"
|
|
14
|
-
:variant="cIsEditing ? editVariant : variant"
|
|
15
|
-
v-model="value" />
|
|
16
|
-
</template>
|
|
17
|
-
</v-list-item>
|
|
18
|
-
</v-col>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<script setup lang="ts">
|
|
22
|
-
import { computed, inject, ref } from 'vue'
|
|
23
|
-
|
|
24
|
-
defineOptions({
|
|
25
|
-
inheritAttrs: false
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
interface FieldProps {
|
|
29
|
-
cols?: string | boolean
|
|
30
|
-
isEditing?: boolean
|
|
31
|
-
isMobile?: boolean
|
|
32
|
-
label?: string
|
|
33
|
-
lg?: string | boolean
|
|
34
|
-
md?: string | boolean
|
|
35
|
-
modelValue: any
|
|
36
|
-
sm?: string | boolean
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
40
|
-
isEditing: undefined,
|
|
41
|
-
cols: '12',
|
|
42
|
-
lg: false,
|
|
43
|
-
md: false,
|
|
44
|
-
sm: '6'
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
const emit = defineEmits(['update:modelValue'])
|
|
48
|
-
|
|
49
|
-
const value = computed({
|
|
50
|
-
get() {
|
|
51
|
-
return props.modelValue
|
|
52
|
-
},
|
|
53
|
-
set(value) {
|
|
54
|
-
emit('update:modelValue', value)
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
59
|
-
|
|
60
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
61
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
62
|
-
const variant = inject('fieldVariant', 'underlined')
|
|
63
|
-
const editVariant = inject('fieldEditVariant', 'outlined')
|
|
64
|
-
|
|
65
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
66
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
67
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
68
|
-
</script>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<v-combobox
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
chips
|
|
10
|
-
:closableChips="cIsEditing"
|
|
11
|
-
multiple
|
|
12
|
-
:readonly="!cIsEditing"
|
|
13
|
-
:variant="cIsEditing ? editVariant : variant"
|
|
14
|
-
v-model="value" />
|
|
15
|
-
</v-col>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script setup lang="ts">
|
|
19
|
-
import { computed, inject, ref } from 'vue'
|
|
20
|
-
import { isLengthyArray } from '../composables/helpers'
|
|
21
|
-
|
|
22
|
-
defineOptions({
|
|
23
|
-
inheritAttrs: false
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
interface FieldProps {
|
|
27
|
-
cols?: string | boolean
|
|
28
|
-
isEditing?: boolean
|
|
29
|
-
isMobile?: boolean
|
|
30
|
-
lg?: string | boolean
|
|
31
|
-
md?: string | boolean
|
|
32
|
-
modelValue: string | undefined
|
|
33
|
-
rules?: any
|
|
34
|
-
sm?: string | boolean
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
38
|
-
isEditing: undefined,
|
|
39
|
-
cols: '12',
|
|
40
|
-
lg: false,
|
|
41
|
-
md: false,
|
|
42
|
-
sm: '6'
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
const emit = defineEmits(['update:modelValue'])
|
|
46
|
-
|
|
47
|
-
const value = computed({
|
|
48
|
-
get() {
|
|
49
|
-
return props.modelValue?.split(',')
|
|
50
|
-
},
|
|
51
|
-
set(value) {
|
|
52
|
-
emit('update:modelValue', isLengthyArray(value) ? value!.toString() : null)
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
57
|
-
|
|
58
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
59
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
60
|
-
const variant = inject('fieldVariant', 'underlined')
|
|
61
|
-
const editVariant = inject('fieldEditVariant', 'outlined')
|
|
62
|
-
|
|
63
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
64
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
65
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
66
|
-
</script>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<v-textarea
|
|
8
|
-
v-bind="$attrs"
|
|
9
|
-
:readonly="!cIsEditing"
|
|
10
|
-
:rules="rules"
|
|
11
|
-
:variant="cIsEditing ? editVariant : variant"
|
|
12
|
-
v-model="value" />
|
|
13
|
-
</v-col>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup lang="ts">
|
|
17
|
-
// import { type BladeDensity } from '@/composables/blade'
|
|
18
|
-
import { computed, inject, ref } from 'vue'
|
|
19
|
-
|
|
20
|
-
defineOptions({
|
|
21
|
-
inheritAttrs: false
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
interface FieldProps {
|
|
25
|
-
cols?: string | boolean
|
|
26
|
-
horizontal?: boolean
|
|
27
|
-
isEditing?: boolean
|
|
28
|
-
isMobile?: boolean
|
|
29
|
-
// label: any
|
|
30
|
-
lg?: string | boolean
|
|
31
|
-
md?: string | boolean
|
|
32
|
-
// mode?: 'view' | 'edit' | 'new'
|
|
33
|
-
modelValue: any
|
|
34
|
-
rules?: any
|
|
35
|
-
sm?: string | boolean
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
39
|
-
isEditing: undefined,
|
|
40
|
-
cols: '12',
|
|
41
|
-
lg: false,
|
|
42
|
-
md: false,
|
|
43
|
-
sm: '6'
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
const emit = defineEmits(['update:modelValue'])
|
|
47
|
-
|
|
48
|
-
const value = computed({
|
|
49
|
-
get() {
|
|
50
|
-
return props.modelValue
|
|
51
|
-
},
|
|
52
|
-
set(value) {
|
|
53
|
-
emit('update:modelValue', value)
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
58
|
-
|
|
59
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
60
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
61
|
-
const variant = inject('fieldVariant', 'underlined')
|
|
62
|
-
const editVariant = inject('fieldEditVariant', 'outlined')
|
|
63
|
-
|
|
64
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
65
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
66
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
67
|
-
</script>
|
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-col
|
|
3
|
-
:lg="mLg"
|
|
4
|
-
:md="mMd"
|
|
5
|
-
:sm="mSm"
|
|
6
|
-
:cols="cols">
|
|
7
|
-
<v-list-item>
|
|
8
|
-
<v-list-item-subtitle>{{ label }}</v-list-item-subtitle>
|
|
9
|
-
<v-list-item-title>
|
|
10
|
-
<v-row dense>
|
|
11
|
-
<span v-if="useAutomation || useAutomationDaily || useAutomationLarge" class="mx-1">{{ automation }}</span>
|
|
12
|
-
<span v-if="useGuide || useGuideList" class="mx-1">{{ guide }}</span>
|
|
13
|
-
<span v-if="useTrigger || useScheduledTrigger || useTriggerList" class="mx-1">{{ trigger }}</span>
|
|
14
|
-
<span v-if="useCustom || useCustomList" class="mx-1">{{ custom }}</span>
|
|
15
|
-
</v-row>
|
|
16
|
-
|
|
17
|
-
</v-list-item-title>
|
|
18
|
-
<template #append>
|
|
19
|
-
<v-row dense>
|
|
20
|
-
<v-col>
|
|
21
|
-
<v-menu v-if="useAutomation || useAutomationDaily || useAutomationLarge">
|
|
22
|
-
<template #activator="{ props }">
|
|
23
|
-
<v-btn v-bind="props" :disabled="!cIsEditing" :size="mSize" append-icon="mdi-menu-down" title="Automation">{{ automation ?? 'select' }}</v-btn>
|
|
24
|
-
</template>
|
|
25
|
-
<v-list
|
|
26
|
-
:items="automationOptions"
|
|
27
|
-
item-title="text"
|
|
28
|
-
return-object
|
|
29
|
-
select-strategy="single-independent"
|
|
30
|
-
v-model:selected="automationValue" />
|
|
31
|
-
</v-menu>
|
|
32
|
-
</v-col>
|
|
33
|
-
|
|
34
|
-
<v-col>
|
|
35
|
-
<v-menu v-if="useGuideList">
|
|
36
|
-
<template #activator="{ props }">
|
|
37
|
-
<v-btn v-bind="props" :disabled="!cIsEditing" :size="mSize" append-icon="mdi-menu-down" title="Guide">{{ guide ?? 'select' }}</v-btn>
|
|
38
|
-
</template>
|
|
39
|
-
<v-list
|
|
40
|
-
:items="guideOptions"
|
|
41
|
-
item-title="text"
|
|
42
|
-
return-object
|
|
43
|
-
select-strategy="single-independent"
|
|
44
|
-
v-model:selected="guideListValue" />
|
|
45
|
-
</v-menu>
|
|
46
|
-
</v-col>
|
|
47
|
-
|
|
48
|
-
<v-col>
|
|
49
|
-
<v-btn-toggle
|
|
50
|
-
v-if="useGuide"
|
|
51
|
-
v-bind="$attrs"
|
|
52
|
-
v-model="guideValue"
|
|
53
|
-
color="primary"
|
|
54
|
-
:disabled="!cIsEditing"
|
|
55
|
-
title="Guide">
|
|
56
|
-
<v-btn v-for="(opt, ind) in guideOptions"
|
|
57
|
-
:key="ind"
|
|
58
|
-
:icon="opt.icon"
|
|
59
|
-
:size="mSize"
|
|
60
|
-
:text="opt.text" />
|
|
61
|
-
</v-btn-toggle>
|
|
62
|
-
</v-col>
|
|
63
|
-
|
|
64
|
-
<v-col>
|
|
65
|
-
<v-menu v-if="useTriggerList">
|
|
66
|
-
<template #activator="{ props }">
|
|
67
|
-
<v-btn v-bind="props" :disabled="!cIsEditing" append-icon="mdi-menu-down" title="Trigger">{{ trigger ?? 'select' }}</v-btn>
|
|
68
|
-
</template>
|
|
69
|
-
<v-list
|
|
70
|
-
:items="triggerOptions"
|
|
71
|
-
item-title="text"
|
|
72
|
-
return-object
|
|
73
|
-
select-strategy="single-independent"
|
|
74
|
-
v-model:selected="triggerListValue" />
|
|
75
|
-
</v-menu>
|
|
76
|
-
</v-col>
|
|
77
|
-
|
|
78
|
-
<v-col>
|
|
79
|
-
<v-btn-toggle
|
|
80
|
-
v-if="useTrigger"
|
|
81
|
-
v-bind="$attrs"
|
|
82
|
-
v-model="triggerValue"
|
|
83
|
-
color="primary"
|
|
84
|
-
:disabled="!cIsEditing"
|
|
85
|
-
title="Trigger">
|
|
86
|
-
<v-btn v-for="(opt, ind) in triggerOptions"
|
|
87
|
-
:key="ind"
|
|
88
|
-
:icon="opt.icon"
|
|
89
|
-
:size="mSize"
|
|
90
|
-
:text="opt.text" />
|
|
91
|
-
</v-btn-toggle>
|
|
92
|
-
</v-col>
|
|
93
|
-
|
|
94
|
-
<v-col>
|
|
95
|
-
<v-menu v-if="useCustomList">
|
|
96
|
-
<template #activator="{ props }">
|
|
97
|
-
<v-btn v-bind="props" :disabled="!cIsEditing" append-icon="mdi-menu-down">{{ custom ?? 'select' }}</v-btn>
|
|
98
|
-
</template>
|
|
99
|
-
<v-list
|
|
100
|
-
:items="customOptions"
|
|
101
|
-
item-title="text"
|
|
102
|
-
return-object
|
|
103
|
-
select-strategy="single-independent"
|
|
104
|
-
v-model:selected="customListValue" />
|
|
105
|
-
</v-menu>
|
|
106
|
-
</v-col>
|
|
107
|
-
|
|
108
|
-
<v-col>
|
|
109
|
-
<v-btn-toggle
|
|
110
|
-
v-if="useCustom"
|
|
111
|
-
v-bind="$attrs"
|
|
112
|
-
v-model="customValue"
|
|
113
|
-
color="primary"
|
|
114
|
-
:disabled="!cIsEditing">
|
|
115
|
-
<v-btn v-for="(opt, ind) in customOptions"
|
|
116
|
-
:key="ind"
|
|
117
|
-
:icon="opt.icon"
|
|
118
|
-
:size="mSize"
|
|
119
|
-
:text="opt.text" />
|
|
120
|
-
</v-btn-toggle>
|
|
121
|
-
</v-col>
|
|
122
|
-
</v-row>
|
|
123
|
-
</template>
|
|
124
|
-
</v-list-item>
|
|
125
|
-
</v-col>
|
|
126
|
-
</template>
|
|
127
|
-
|
|
128
|
-
<script setup lang="ts">
|
|
129
|
-
import { type BladeDensity } from '../types'
|
|
130
|
-
import { computed, inject, ref, type Ref } from 'vue'
|
|
131
|
-
|
|
132
|
-
defineOptions({
|
|
133
|
-
inheritAttrs: false
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
interface Option {
|
|
137
|
-
text?: string
|
|
138
|
-
value?: string
|
|
139
|
-
icon?: string
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
interface FieldProps {
|
|
143
|
-
automation?: any
|
|
144
|
-
cols?: string | boolean
|
|
145
|
-
custom?: any
|
|
146
|
-
density?: BladeDensity
|
|
147
|
-
guide?: any
|
|
148
|
-
isEditing?: boolean
|
|
149
|
-
isMobile?: boolean
|
|
150
|
-
label: any
|
|
151
|
-
lg?: string | boolean
|
|
152
|
-
md?: string | boolean
|
|
153
|
-
sm?: string | boolean
|
|
154
|
-
options?: Option[]
|
|
155
|
-
trigger?: any
|
|
156
|
-
useAutomation?: boolean
|
|
157
|
-
useAutomationDaily?: boolean
|
|
158
|
-
useAutomationLarge?: boolean
|
|
159
|
-
useCustom?: boolean
|
|
160
|
-
useCustomList?: boolean
|
|
161
|
-
useGuide?: boolean
|
|
162
|
-
useGuideList?: boolean
|
|
163
|
-
useScheduledTrigger?: boolean
|
|
164
|
-
useTrigger?: boolean
|
|
165
|
-
useTriggerList?: boolean
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
const props = withDefaults(defineProps<FieldProps>(), {
|
|
169
|
-
isEditing: undefined,
|
|
170
|
-
cols: '12',
|
|
171
|
-
lg: false,
|
|
172
|
-
md: false,
|
|
173
|
-
sm: '6'
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
const mSize = inject('size', () => ref('small'), true)
|
|
177
|
-
|
|
178
|
-
const emit = defineEmits(['update:automation', 'update:custom', 'update:guide', 'update:trigger'])
|
|
179
|
-
let automationOptions: Ref<Option[]> = ref([])
|
|
180
|
-
let customOptions: Ref<Option[]> = ref(props.options ?? [])
|
|
181
|
-
let guideOptions: Ref<Option[]> = ref([])
|
|
182
|
-
let triggerOptions: Ref<Option[]> = ref([])
|
|
183
|
-
|
|
184
|
-
if (props.useScheduledTrigger) {
|
|
185
|
-
triggerOptions.value = [
|
|
186
|
-
{ text: 'Manual', value: 'Manual', icon: 'mdi-account' },
|
|
187
|
-
{ text: 'Auto', value: 'Auto', icon: 'mdi-robot' },
|
|
188
|
-
{ text: 'Scheduled', value: 'Scheduled', icon: 'mdi-calendar' }
|
|
189
|
-
]
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (props.useTrigger) {
|
|
193
|
-
triggerOptions.value = [
|
|
194
|
-
{ text: 'Manual', value: 'Manual', icon: 'mdi-account' },
|
|
195
|
-
{ text: 'Auto', value: 'Auto', icon: 'mdi-robot' },
|
|
196
|
-
]
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
if (props.useGuide) {
|
|
200
|
-
guideOptions.value = [
|
|
201
|
-
{ text: 'Global', value: 'Settings', icon: 'mdi-earth' },
|
|
202
|
-
{ text: 'Individual', value: 'Agreements', icon: 'mdi-account-circle-outline' }
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (props.useAutomation) {
|
|
207
|
-
automationOptions.value = [
|
|
208
|
-
{ text: 'Off', value: 'Off' },
|
|
209
|
-
{ text: 'Hourly', value: 'Hourly' },
|
|
210
|
-
{ text: '3 Hourly', value: 'EveryThreeHours' },
|
|
211
|
-
{ text: '12 Hourly', value: 'EveryTwelveHours' },
|
|
212
|
-
{ text: 'Daily', value: 'Daily' },
|
|
213
|
-
{ text: 'Weekly', value: 'Weekly' }
|
|
214
|
-
]
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
if (props.useAutomationDaily) {
|
|
218
|
-
automationOptions.value = [
|
|
219
|
-
{ text: 'Off', value: 'Off' },
|
|
220
|
-
{ text: 'Daily', value: 'Daily' }
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
if (props.useAutomationLarge) {
|
|
225
|
-
automationOptions.value = [
|
|
226
|
-
{ text: 'Off', value: 'Off' },
|
|
227
|
-
{ text: 'Daily', value: 'Daily' },
|
|
228
|
-
{ text: 'Weekly', value: 'Weekly' },
|
|
229
|
-
{ text: 'Monthly', value: 'Monthly' },
|
|
230
|
-
{ text: 'Yearly', value: 'Yearly' }
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
const automationValue = computed({
|
|
235
|
-
get() {
|
|
236
|
-
const v = props.automation != null ? automationOptions.value.find((x: any) => (x.value ?? x.text) == props.automation) : []
|
|
237
|
-
return v ? [v] : []
|
|
238
|
-
},
|
|
239
|
-
set(value) {
|
|
240
|
-
const v = (value?.length > 0 ? value[0] : undefined) as Option | undefined
|
|
241
|
-
emit('update:automation', v?.value ?? v?.text ?? null)
|
|
242
|
-
}
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
const customListValue = computed({
|
|
246
|
-
get() {
|
|
247
|
-
return props.custom != null ? customOptions.value.filter((x: any) => (x.value ?? x.text) == props.automation) : []
|
|
248
|
-
// const v = props.custom != null ? customOptions.value.find((x: any) => (x.value ?? x.text) == props.automation) : []
|
|
249
|
-
// return v ? [v] : []
|
|
250
|
-
},
|
|
251
|
-
set(value) {
|
|
252
|
-
const v = (value?.length > 0 ? value[0] : undefined) as Option | undefined
|
|
253
|
-
emit('update:custom', v?.value ?? v?.text ?? null)
|
|
254
|
-
}
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
const customValue = computed({
|
|
258
|
-
get() {
|
|
259
|
-
return props.custom != null ? customOptions.value.findIndex((x: any) => (x.value ?? x.text) == props.custom) : null
|
|
260
|
-
},
|
|
261
|
-
set(value) {
|
|
262
|
-
emit('update:custom', (value == null || value < 0) ? null : (customOptions.value[value].value ?? customOptions.value[value].text))
|
|
263
|
-
}
|
|
264
|
-
})
|
|
265
|
-
|
|
266
|
-
const guideListValue = computed({
|
|
267
|
-
get() {
|
|
268
|
-
const v = props.guide != null ? guideOptions.value.find((x: any) => (x.value ?? x.text) == props.guide) : []
|
|
269
|
-
return v ? [v] : []
|
|
270
|
-
},
|
|
271
|
-
set(value) {
|
|
272
|
-
const v = (value?.length > 0 ? value[0] : undefined) as Option | undefined
|
|
273
|
-
emit('update:guide', v?.value ?? v?.text ?? null)
|
|
274
|
-
}
|
|
275
|
-
})
|
|
276
|
-
|
|
277
|
-
const guideValue = computed({
|
|
278
|
-
get() {
|
|
279
|
-
return props.guide != null ? guideOptions.value.findIndex((x: any) => (x.value ?? x.text) == props.guide) : null
|
|
280
|
-
},
|
|
281
|
-
set(value) {
|
|
282
|
-
emit('update:guide', (value == null || value < 0) ? null : (guideOptions.value[value].value ?? guideOptions.value[value].text))
|
|
283
|
-
}
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
const triggerListValue = computed({
|
|
287
|
-
get() {
|
|
288
|
-
const v = props.trigger != null ? triggerOptions.value.find((x: any) => (x.value ?? x.text) == props.trigger) : []
|
|
289
|
-
return v ? [v] : []
|
|
290
|
-
},
|
|
291
|
-
set(value) {
|
|
292
|
-
const v = (value?.length > 0 ? value[0] : undefined) as Option | undefined
|
|
293
|
-
emit('update:trigger', v?.value ?? v?.text ?? null)
|
|
294
|
-
}
|
|
295
|
-
})
|
|
296
|
-
|
|
297
|
-
const triggerValue = computed({
|
|
298
|
-
get() {
|
|
299
|
-
return props.trigger != null ? triggerOptions.value.findIndex((x: any) => (x.value ?? x.text) == props.trigger) : null
|
|
300
|
-
},
|
|
301
|
-
set(value) {
|
|
302
|
-
emit('update:trigger', (value == null || value < 0) ? null : (triggerOptions.value[value].value ?? triggerOptions.value[value].text))
|
|
303
|
-
}
|
|
304
|
-
})
|
|
305
|
-
|
|
306
|
-
const mIsEditing = inject('isEditing', () => ref(false), true)
|
|
307
|
-
|
|
308
|
-
const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
|
|
309
|
-
const mIsMobile = inject('isMobile', () => ref(false), true)
|
|
310
|
-
|
|
311
|
-
const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
|
|
312
|
-
const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
|
|
313
|
-
const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
|
|
314
|
-
|
|
315
|
-
</script>
|