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.
Files changed (96) hide show
  1. package/dist/bt-core-app.js +4079 -28248
  2. package/dist/index.d.ts +0 -4
  3. package/package.json +8 -2
  4. package/dist/components/BT-Btn.vue.d.ts +0 -41
  5. package/dist/components/BT-Col.vue.d.ts +0 -49
  6. package/dist/components/BT-Field-Checkbox.vue.d.ts +0 -56
  7. package/dist/components/BT-Field-Date.vue.d.ts +0 -64
  8. package/dist/components/BT-Field-Entity.vue.d.ts +0 -46
  9. package/dist/components/BT-Field-Select.vue.d.ts +0 -54
  10. package/dist/components/BT-Field-String.vue.d.ts +0 -53
  11. package/dist/components/BT-Field-Switch.vue.d.ts +0 -51
  12. package/dist/components/BT-Field-Tags.vue.d.ts +0 -51
  13. package/dist/components/BT-Field-Textarea.vue.d.ts +0 -52
  14. package/dist/components/BT-Field-Trigger.vue.d.ts +0 -79
  15. package/dist/components/BT-Header-Option.vue.d.ts +0 -18
  16. package/dist/components/BT-Json.vue.d.ts +0 -8
  17. package/dist/components/BT-Nav-Menu-Item.vue.d.ts +0 -36
  18. package/dist/components/BT-Nav-Sidebar.vue.d.ts +0 -25
  19. package/dist/components/BT-Select-List-Box.vue.d.ts +0 -108
  20. package/dist/components/BT-Select.vue.d.ts +0 -53
  21. package/dist/components/BT-Snack.vue.d.ts +0 -33
  22. package/dist/components/BT-Span.vue.d.ts +0 -17
  23. package/dist/components/Dialog-Confirm.vue.d.ts +0 -38
  24. package/dist/components/Dialog-Select-Date.vue.d.ts +0 -36
  25. package/dist/components/Dialog-Select.vue.d.ts +0 -48
  26. package/dist/components/Dialog-Text.vue.d.ts +0 -33
  27. package/dist/main.d.ts +0 -0
  28. package/dist/style.css +0 -1
  29. package/dist/useApi.d.ts +0 -0
  30. package/src/assets/vue.svg +0 -1
  31. package/src/components/BT-Btn.vue +0 -41
  32. package/src/components/BT-Col.vue +0 -36
  33. package/src/components/BT-Field-Checkbox.vue +0 -70
  34. package/src/components/BT-Field-Date.vue +0 -108
  35. package/src/components/BT-Field-Entity.vue +0 -48
  36. package/src/components/BT-Field-Select.vue +0 -67
  37. package/src/components/BT-Field-String.vue +0 -78
  38. package/src/components/BT-Field-Switch.vue +0 -68
  39. package/src/components/BT-Field-Tags.vue +0 -66
  40. package/src/components/BT-Field-Textarea.vue +0 -67
  41. package/src/components/BT-Field-Trigger.vue +0 -315
  42. package/src/components/BT-Header-Option.vue +0 -39
  43. package/src/components/BT-Json.vue +0 -67
  44. package/src/components/BT-Nav-Menu-Item.vue +0 -61
  45. package/src/components/BT-Nav-Sidebar.vue +0 -79
  46. package/src/components/BT-Select-List-Box.vue +0 -258
  47. package/src/components/BT-Select.vue +0 -46
  48. package/src/components/BT-Snack.vue +0 -31
  49. package/src/components/BT-Span.vue +0 -21
  50. package/src/components/Dialog-Confirm.vue +0 -47
  51. package/src/components/Dialog-Select-Date.vue +0 -89
  52. package/src/components/Dialog-Select.vue +0 -140
  53. package/src/components/Dialog-Text.vue +0 -59
  54. package/src/composables/actions-tracker.ts +0 -99
  55. package/src/composables/actions.ts +0 -354
  56. package/src/composables/api.ts +0 -479
  57. package/src/composables/auth.ts +0 -452
  58. package/src/composables/cosmetics.ts +0 -177
  59. package/src/composables/csv.ts +0 -198
  60. package/src/composables/dates.ts +0 -86
  61. package/src/composables/demo.ts +0 -33
  62. package/src/composables/dialogs.ts +0 -115
  63. package/src/composables/document-meta.ts +0 -44
  64. package/src/composables/draggable.ts +0 -189
  65. package/src/composables/filters.ts +0 -264
  66. package/src/composables/forage.ts +0 -49
  67. package/src/composables/helpers.ts +0 -647
  68. package/src/composables/id.ts +0 -20
  69. package/src/composables/list.ts +0 -604
  70. package/src/composables/navigation.ts +0 -222
  71. package/src/composables/presets.ts +0 -28
  72. package/src/composables/pwa.ts +0 -97
  73. package/src/composables/resizable.ts +0 -382
  74. package/src/composables/rules.ts +0 -40
  75. package/src/composables/stores.ts +0 -818
  76. package/src/composables/track.ts +0 -55
  77. package/src/composables/urls.ts +0 -66
  78. package/src/core.ts +0 -121
  79. package/src/index.ts +0 -48
  80. package/src/main.ts +0 -6
  81. package/src/types.ts +0 -17
  82. package/src/useApi.ts +0 -68
  83. package/src/vite-env.d.ts +0 -1
  84. package/test/api.test.ts +0 -84
  85. package/test/auth.test.ts +0 -74
  86. package/test/forage.test.ts +0 -31
  87. package/test/helpers.test.ts +0 -231
  88. package/test/navigation.test.ts +0 -99
  89. package/test/stores-last-update.test.ts +0 -138
  90. package/test/stores-session.test.ts +0 -118
  91. package/test/track.test.ts +0 -29
  92. package/test/urls.test.ts +0 -42
  93. package/test/utils.ts +0 -15
  94. package/tsconfig.json +0 -28
  95. package/tsconfig.node.json +0 -11
  96. package/vite.config.ts +0 -45
@@ -1,39 +0,0 @@
1
- <template>
2
- <v-slide-x-transition group>
3
- <span v-if="option.prefix != null">{{ option.prefix }}</span>
4
- <span v-if="option.bool != null">
5
- <v-icon v-if="nestedValue(data, option.value) === true" :size="size">mdi-check</v-icon>
6
- </span>
7
- <bt-entity
8
- v-else-if="option.nav != null && (option.itemText != null || option.textFilter != null)"
9
- inline
10
- :itemText="option.itemText"
11
- :itemId="nestedValue(data, option.value)"
12
- :nav="option.nav"
13
- :single="option.single"
14
- :textFilter="option.textFilter" />
15
- <span v-else>{{ displayText(data) }}</span>
16
- </v-slide-x-transition>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import { type TableColumn } from '../composables/list'
21
- import { nestedValue } from '../composables/helpers'
22
- import { useFilters } from '../composables/filters'
23
- import { computed } from 'vue';
24
-
25
- interface Props {
26
- data: any
27
- option: TableColumn
28
- size?: string | number
29
- }
30
-
31
- const props = defineProps<Props>()
32
- const filters = useFilters()
33
- const displayText = computed(() => (item: any) => {
34
- let v = nestedValue(item, props.option.value)
35
- v = props.option.textFunction != null ? props.option.textFunction(v) : v
36
- return props.option.textFilter != null ? filters.findFilter(props.option.textFilter)(v) : v
37
- })
38
-
39
- </script>
@@ -1,67 +0,0 @@
1
- <template>
2
- <v-card max-height="350" class="overflow-y-auto">
3
- <v-card-text>
4
- <div v-for="(j, ind) in display" :key="ind">
5
- <pre v-html="syntaxHighlight(j)"></pre>
6
- </div>
7
- </v-card-text>
8
- </v-card>
9
- </template>
10
-
11
- <script setup lang="ts">
12
- import { computed } from 'vue'
13
-
14
- const props = defineProps(['value'])
15
-
16
- const display = computed(() => {
17
- if (props.value == null) {
18
- return []
19
- }
20
-
21
- if (Array.isArray(props.value))
22
- return props.value
23
-
24
- return [props.value]
25
- })
26
-
27
- function syntaxHighlight(json: any) {
28
- if (typeof json != 'string') {
29
- json = JSON.stringify(json, undefined, 2); //Object.keys(json).sort(), 2);
30
- }
31
- json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
32
-
33
- const e = json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match: any) {
34
- var cls = 'number';
35
- if (/^"/.test(match)) {
36
- if (/:$/.test(match)) {
37
- cls = 'key';
38
- } else {
39
- cls = 'string';
40
- }
41
- } else if (/true|false/.test(match)) {
42
- cls = 'boolean';
43
- } else if (/null/.test(match)) {
44
- cls = 'null';
45
- }
46
- return '<span class="' + cls + '">' + match + '</span>';
47
- });
48
-
49
- return e
50
- }
51
-
52
- </script>
53
-
54
- <style>
55
- pre {
56
- outline: 1px solid #ccc;
57
- padding: 5px;
58
- margin: 5px; }
59
-
60
- pre .string {
61
- color: green;
62
- }
63
- pre .number { color: darkorange; }
64
- pre .boolean { color: rgb(191, 255, 0); }
65
- pre .null { color: magenta; }
66
- pre .key { color: rgb(141, 141, 141); }
67
- </style>
@@ -1,61 +0,0 @@
1
- <template>
2
- <v-list-group v-if="doShowItem && relevantChildren.length > 0"
3
- color="accent"
4
- :subGroup="isSubGroup"
5
- fluid>
6
- <template #activator="{ props }">
7
- <v-list-item v-bind="props"
8
- :prepend-icon="item.icon"
9
- :title="item.displayName" />
10
- </template>
11
- <BT-Nav-Menu-Item
12
- v-for="child in relevantChildren"
13
- :key="child.name"
14
- isSubGroup
15
- :item="child" />
16
- </v-list-group>
17
- <v-list-item v-else-if="doShowItem"
18
- color="accent"
19
- :prepend-icon="item.icon"
20
- nav
21
- :title="item.displayName ?? item.name"
22
- :to="{ name: item.name }">
23
- </v-list-item>
24
- <v-divider v-else-if="item.isDivider" />
25
- <div v-else>test</div>
26
- </template>
27
-
28
- <script setup lang="ts">
29
- import BTNavMenuItem from './BT-Nav-Menu-Item.vue'
30
- import { computed } from 'vue'
31
- import { useAuth } from '../composables/auth'
32
- import { isLengthyArray } from '../composables/helpers'
33
- import { type NavigationItem } from '../composables/navigation'
34
- // import { VListItem, VListGroup, VDivider } from 'vuetify/components'
35
-
36
- interface ItemProps {
37
- allowedSubscriptionCodes?: string[],
38
- isSubGroup?: boolean,
39
- item?: any
40
- }
41
-
42
- const props = withDefaults(defineProps<ItemProps>(), {
43
- allowedSubscriptionCodes: () => [],
44
- isSubGroup: false,
45
- item: null
46
- })
47
-
48
- const { doShowByNav } = useAuth()
49
-
50
- const relevantChildren = computed(() => {
51
- const l = props.item.children?.filter((x: NavigationItem) => x.isInNavMenu !== false) ?? []
52
- if (!isLengthyArray(props.allowedSubscriptionCodes)) {
53
- return l
54
- }
55
-
56
- return l.filter((navItem: NavigationItem) => !isLengthyArray(navItem.subFilters) || props.allowedSubscriptionCodes.some(code => navItem.subFilters?.some(sFilter => sFilter == code)))
57
- })
58
-
59
- const doShowItem = computed(() => doShowByNav(props.item, true))
60
-
61
- </script>
@@ -1,79 +0,0 @@
1
- <template>
2
- <v-navigation-drawer
3
- v-if="isLoggedIn"
4
- disabled-resize-watcher
5
- expand-on-hover
6
- :rail="!state.drawerStick"
7
- permanent
8
- v-model="state.drawer">
9
- <slot>
10
- <v-list class="pt-1">
11
- <v-list-item nav :title="title">
12
- <template #prepend>
13
- <v-avatar size="36">
14
- <v-img :src="iconSrc" />
15
- </v-avatar>
16
- </template>
17
- <template #append>
18
- <v-row class="mr-1">
19
- <v-btn
20
- @click="toggleDrawerStick"
21
- flat
22
- icon
23
- size="small"
24
- title="Pin/Unpin Menu">
25
- <v-icon>{{ state.drawerStick ? 'mdi-pin-off' : 'mdi-pin' }}</v-icon>
26
- </v-btn>
27
- </v-row>
28
- </template>
29
- </v-list-item>
30
- <slot name="top-list">
31
-
32
- </slot>
33
- </v-list>
34
-
35
- <slot name="middle-list">
36
- <v-list nav>
37
- <BT-Nav-Menu-Item
38
- v-for="(item, index) in navItems"
39
- :key="index"
40
- :item="item" />
41
- </v-list>
42
- </slot>
43
- </slot>
44
- <template #append>
45
- <slot name="bottom-list">
46
- <v-list v-if="isLoggedIn" class="ma-0 pa-0">
47
- <v-list-item
48
- class="bg-primary"
49
- prepend-icon="mdi-logout"
50
- title="Logout"
51
- @click="() => logout()" />
52
- </v-list>
53
- </slot>
54
- </template>
55
- </v-navigation-drawer>
56
- </template>
57
-
58
- <script setup lang="ts">
59
- import BTNavMenuItem from './BT-Nav-Menu-Item.vue'
60
- import { useCosmetics } from '../composables/cosmetics'
61
- import { useNavigation } from '../composables/navigation'
62
- import { useAuth } from '../composables/auth'
63
- import { computed } from 'vue'
64
- // import { VListItem, VList, VNavigationDrawer, VAvatar, VImg, VRow, VBtn } from 'vuetify/components'
65
-
66
- interface SidebarProps {
67
- // greeting?: string
68
- iconSrc?: string
69
- title?: string
70
- }
71
-
72
- defineProps<SidebarProps>()
73
- const { state, toggleDrawerStick } = useCosmetics()
74
- const { isLoggedIn, logout } = useAuth()
75
- const navigation = useNavigation()
76
-
77
- const navItems = computed(() => navigation.navigationItems.filter(x => x.isInNavMenu !== false && navigation.backgroundName.value == x.background));
78
-
79
- </script>
@@ -1,258 +0,0 @@
1
- <template>
2
- <v-col
3
- :class="colClass"
4
- :lg="mLg"
5
- :md="mMd"
6
- :sm="mSm"
7
- :cols="cols">
8
- <v-list-item v-if="!alwaysOpen && mIsSelecting" @click="mIsSelecting = false"
9
- :subtitle="label">
10
- <template #append>
11
- <v-row class="ma-0 pa-0">
12
- <slot name="actions" />
13
- <v-icon>mdi-chevron-up</v-icon>
14
- <slot name="actionsRight" />
15
- <v-menu
16
- v-if="showSettings"
17
- offset-y
18
- :close-on-content-click="false">
19
- <template v-slot:activator="{ props }">
20
- <v-btn
21
- icon="mdi-cog"
22
- :size="mSize"
23
- title="Settings"
24
- v-bind="props" />
25
- </template>
26
- <v-list>
27
- <slot name="settings" />
28
- </v-list>
29
- </v-menu>
30
- </v-row>
31
- </template>
32
- </v-list-item>
33
- <v-slide-y-transition hide-on-leave group>
34
- <v-text-field
35
- v-if="(alwaysOpen || mIsSelecting) && showSearch !== false && isLengthyArray(searchProps)"
36
- @click:prepend-inner="ui.searchString.value = undefined"
37
- hide-details
38
- key="1"
39
- placeholder="Search"
40
- :prepend-inner-icon="ui.searchString.value != null ? 'mdi-close' : undefined"
41
- v-model="ui.searchString.value">
42
- <template #append-inner>
43
- <v-btn
44
- v-if="canRefresh"
45
- @click="ui.refresh({ deepRefresh: true })"
46
- icon="mdi-refresh"
47
- :size="mSize"
48
- variant="text" />
49
- </template>
50
-
51
- </v-text-field>
52
- <v-virtual-scroll
53
- v-if="(alwaysOpen || mIsSelecting) && useVirtualScroller"
54
- :height="height"
55
- :items="ui.filteredItems.value"
56
- key="2">
57
- <template #default="{ item }">
58
- <slot name="item" v-bind:item="item" v-bind:selectItem="selectItem(item)" :active="isActive(item)">
59
- <v-list-item @click="selectItem(item)" :active="isActive(item)" color="primary">
60
- <slot v-bind:item="item">
61
- <v-list-item-title v-if="itemText != null || textFilter != null || textFunction != null">
62
- {{ displayTitle(item) }}
63
- </v-list-item-title>
64
- <v-list-item-subtitle v-if="itemSubtext != null || subtextFilter != null || subtextFunction != null">
65
- {{ displaySubtitle(item) }}
66
- </v-list-item-subtitle>
67
- </slot>
68
-
69
- </v-list-item>
70
- </slot>
71
- </template>
72
- </v-virtual-scroll>
73
- <v-list
74
- v-else-if="alwaysOpen || mIsSelecting"
75
- :bg-color="transparent ? 'transparent' : undefined"
76
- :height="height"
77
- key="3">
78
- <v-list-item
79
- v-if="canSelectNone"
80
- key="-1"
81
- density="compact"
82
- @click="selectItem(null)"
83
- subtitle="(Select None)" />
84
-
85
- <template v-for="(fItem, fInd) in ui.filteredItems.value">
86
- <slot name="item" :items="fItem" :index="fInd" :size="mSize">
87
- <v-list-item
88
- :active="isActive(fItem)"
89
- :key="fInd"
90
- :value="fItem"
91
- @click="selectItem(fItem)">
92
- <slot :item="fItem" :index="fInd" :size="mSize">
93
- <v-list-item-title v-if="itemText != null || textFilter != null || textFunction != null">
94
- {{ displayTitle(fItem) }}
95
- </v-list-item-title>
96
- <v-list-item-subtitle v-if="itemSubtext != null || subtextFilter != null || subtextFunction != null">
97
- {{ displaySubtitle(fItem) }}
98
- </v-list-item-subtitle>
99
- </slot>
100
- </v-list-item>
101
- </slot>
102
- </template>
103
- </v-list>
104
- <slot v-else name="selected" :item="selectedItem" :open="openList">
105
- <v-list-item
106
- @click="openList"
107
- key="4"
108
- :title="label"
109
- :subtitle="displayTitle(selectedItem) ?? placeholder">
110
- <template #append>
111
- <v-row no-gutters>
112
- <slot name="actions" />
113
- <v-icon>mdi-chevron-down</v-icon>
114
- <slot name="actionsRight" />
115
- <v-menu
116
- v-if="showSettings"
117
- offset-y
118
- :close-on-content-click="false">
119
- <template v-slot:activator="{ props }">
120
- <v-btn
121
- icon
122
- v-bind="props"
123
- :size="mSize"
124
- title="Settings" />
125
- </template>
126
- <v-list>
127
- <slot name="settings" />
128
- </v-list>
129
- </v-menu>
130
- </v-row>
131
- </template>
132
- </v-list-item>
133
- </slot>
134
-
135
- </v-slide-y-transition>
136
-
137
- <v-overlay
138
- v-model="ui.isLoading.value"
139
- class="align-center justify-center text-center"
140
- contained
141
- persistent>
142
- <v-progress-circular indeterminate />
143
- <p>{{ ui.loadingMsg.value }}</p>
144
- </v-overlay>
145
- </v-col>
146
-
147
- </template>
148
-
149
- <script setup lang="ts">
150
- import { type ListProps, useList } from '../composables/list'
151
- import { computed, inject, ref } from 'vue'
152
- import { useFilters } from '../composables/filters'
153
- import { isLengthyArray, nestedValue } from '../composables/helpers'
154
-
155
- defineOptions({
156
- inheritAttrs: false
157
- })
158
-
159
- interface SelectProps extends ListProps {
160
- alwaysOpen?: boolean
161
- canRefresh?: boolean
162
- canSearch?: boolean
163
- canSelectNone?: boolean
164
- colClass?: string
165
- cols?: string | boolean
166
- height?: string
167
- isMobile?: boolean
168
- isEditing?: boolean
169
- isSelecting?: boolean
170
- items?: [],
171
- itemSubtext?: string
172
- itemText?: string
173
- itemValue?: string //inherited
174
- label?: string
175
- lg?: string | boolean
176
- modelValue?: any
177
- md?: string | boolean
178
- nav?: string
179
- placeholder?: string
180
- showSettings?: boolean
181
- sm?: string | boolean
182
- subtextFilter?: string
183
- subtextFunction?: Function
184
- textFilter?: string
185
- textFunction?: Function
186
- transparent?: boolean
187
- useVirtualScroller?: boolean
188
- }
189
-
190
- const emit = defineEmits(['update:modelValue', 'change'])
191
-
192
- const props = withDefaults(defineProps<SelectProps>(), {
193
- canRefresh: true,
194
- height: '400',
195
- isEditing: undefined,
196
- sortOrder: 'Ascending',
197
- cols: '12',
198
- lg: false,
199
- md: false,
200
- sm: '6'
201
- })
202
-
203
- const mIsSelecting = ref(props.alwaysOpen ?? props.isSelecting ?? false)
204
- const mSize = inject('size', () => ref('small'), true)
205
- const mIsEditing = inject('isEditing', () => ref(false), true)
206
- const cIsEditing = computed(() => props.isEditing ?? mIsEditing.value)
207
-
208
- const ui = useList(props, undefined, {
209
- useBladeSrc: false,
210
- useRouteSrc: false
211
- })
212
-
213
- const filters = useFilters()
214
-
215
- const displaySubtitle = computed(() => (item: any) => {
216
- let v = props.subtextFunction != null ? props.subtextFunction(item) : item
217
- v = props.itemSubtext != null ? nestedValue(v, props.itemSubtext) : v
218
- return props.subtextFilter != null ? filters.findFilter(props.subtextFilter)(v) : v
219
- })
220
-
221
- const displayTitle = computed(() => (item: any) => {
222
- let v = props.textFunction != null ? props.textFunction(item) : item
223
- v = props.itemText != null ? nestedValue(v, props.itemText) : v
224
- return props.textFilter != null ? filters.findFilter(props.textFilter)(v) : v
225
- })
226
-
227
- const isActive = computed(() => (item: any) => {
228
- return (props.itemValue ? item[props.itemValue] : item) == props.modelValue
229
- })
230
-
231
- function openList() {
232
- if (cIsEditing.value)
233
- mIsSelecting.value = true
234
- }
235
-
236
- function selectItem(item: any) {
237
- mIsSelecting.value = false
238
-
239
- if (item != null || props.canSelectNone) {
240
- let v = item
241
-
242
- if (item != null && props.itemValue != null)
243
- v = item[props.itemValue]
244
-
245
- emit('update:modelValue', v)
246
- emit('change', v)
247
- }
248
- }
249
-
250
- const selectedItem = computed(() => {
251
- return props.modelValue != null ? ui.asyncItems.value.find((x: any) => (x.id == props.modelValue)) : null
252
- })
253
-
254
- const mIsMobile = inject('isMobile', () => ref(false), true)
255
- const mLg = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.lg)
256
- const mMd = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.md)
257
- const mSm = computed(() => (props.isMobile ?? mIsMobile.value) ? false : props.sm)
258
- </script>
@@ -1,46 +0,0 @@
1
- <template>
2
- <v-select
3
- :append-icon="canRefresh ? 'mdi-refresh' : undefined"
4
- :clearable="canSelectNone"
5
- @click:append-icon="ui.refresh({ deepRefresh: true })"
6
- hide-details
7
- :items="ui.filteredItems.value"
8
- :item-title="itemText"
9
- :item-value="itemValue"
10
- :variant="fieldVariant" />
11
- </template>
12
-
13
- <script setup lang="ts">
14
- import { type ListProps, type ListEvents, useList } from '../composables/list';
15
- import { type FieldVariant } from '../types'
16
-
17
- interface SelectEvents extends ListEvents {
18
-
19
- }
20
-
21
- interface SelectProps extends ListProps {
22
- additionalUrl?: string
23
- canRefresh?: boolean
24
- canSelectNone?: boolean
25
- fieldVariant?: FieldVariant
26
- items?: [],
27
- itemText?: string
28
- itemValue?: string //inherited
29
- multiple?: boolean
30
- nav?: string
31
- onFilter?: Function
32
- textFilter?: string
33
- }
34
-
35
- const emit = defineEmits<SelectEvents>()
36
-
37
- const props = withDefaults(defineProps<SelectProps>(), {
38
- sortOrder: 'Ascending'
39
- })
40
-
41
- const ui = useList(props, emit, {
42
- useBladeSrc: false,
43
- useRouteSrc: false
44
- })
45
-
46
- </script>
@@ -1,31 +0,0 @@
1
- <template>
2
- <v-snackbar
3
- v-model="showSnack"
4
- :timeout="cTimeout">
5
- {{ modelValue }}
6
- </v-snackbar>
7
- </template>
8
-
9
- <script setup lang="ts">
10
- import { computed, ref, watch } from 'vue';
11
-
12
-
13
- interface SnackProps {
14
- isTimed?: boolean
15
- modelValue?: string
16
- timeout?: string,
17
-
18
- }
19
-
20
- const props = withDefaults(defineProps<SnackProps>(), {
21
- isTimed: true,
22
- timeout: '5000'
23
- })
24
-
25
- const cTimeout = computed(() => { return props.isTimed ? props.timeout : -1 })
26
- const showSnack = ref(false)
27
- watch(() => props.modelValue, () => {
28
- showSnack.value = true
29
- })
30
-
31
- </script>
@@ -1,21 +0,0 @@
1
- <template>
2
- <span>{{ prefix }}{{ displayText }}{{ suffix }}</span>
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import { useFilters } from '../composables/filters'
7
- import { computed } from 'vue'
8
-
9
- interface Props {
10
- filter: string
11
- prefix?: string
12
- suffix?: string
13
- value: any
14
- }
15
-
16
- const props = defineProps<Props>()
17
- const { findFilter } = useFilters()
18
- const displayText = computed(() => {
19
- return props.filter ? findFilter(props.filter)(props.value) : props.value
20
- })
21
- </script>
@@ -1,47 +0,0 @@
1
- <template>
2
- <v-dialog v-model="show">
3
- <div>
4
- <v-card :max-width="maxWidth ?? '400'" :min-width="minWidth" :title="title" class="mx-auto">
5
- <v-card-text>
6
- <div class="text-h6">{{ msg }}</div>
7
- </v-card-text>
8
- <v-card-actions>
9
- <v-btn @click="cancel">{{ cancelText ?? 'No' }}</v-btn>
10
- <v-btn @click="confirm">{{ confirmText ?? 'Yes' }}</v-btn>
11
- </v-card-actions>
12
- </v-card>
13
- </div>
14
- </v-dialog>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- import { onMounted } from 'vue';
19
- import { type ConfirmDialogProps } from '../composables/dialogs'
20
-
21
- const props = withDefaults(defineProps<ConfirmDialogProps>(), {
22
- cancelValue: false,
23
- confirmValue: true,
24
- startIncludeDetails: false
25
- })
26
-
27
- // const props = defineProps(['cancelText', 'confirmText', 'msg', 'minWidth', 'title'])
28
-
29
- const emit = defineEmits(['confirm', 'cancel'])
30
-
31
- let show = false
32
-
33
- function cancel() {
34
- show = false
35
- emit('cancel', props.cancelValue)
36
- }
37
-
38
- function confirm() {
39
- show = false
40
- emit('confirm', props.confirmValue)
41
- }
42
-
43
- onMounted(() => {
44
- show = true
45
- })
46
-
47
- </script>