@m3ui-vue/m3ui-vue 0.8.6 → 0.8.8
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/README.md +4 -0
- package/dist/{MMenuItem-BmPLAyv5.js → MMenuItem-5xojJYAL.js} +2 -2
- package/dist/{MMenuItem-BmPLAyv5.js.map → MMenuItem-5xojJYAL.js.map} +1 -1
- package/dist/chart.js +5 -1
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/components/MBottomSheet.vue.d.ts +3 -3
- package/dist/components/MListDetail.vue.d.ts +31 -0
- package/dist/components/MNavigationRail.vue.d.ts +6 -3
- package/dist/components/MNavigationSuite.vue.d.ts +46 -0
- package/dist/components/MShortNavigationBar.vue.d.ts +6 -1
- package/dist/components/MSideSheet.vue.d.ts +4 -4
- package/dist/components/MSupportingPane.vue.d.ts +34 -0
- package/dist/components/MTransferList.vue.d.ts +55 -34
- package/dist/components/MWindow.vue.d.ts +39 -1
- package/dist/components/_MTransferPane.vue.d.ts +10 -3
- package/dist/composables/_useItemLink.d.ts +30 -0
- package/dist/composables/_useSheetMotion.d.ts +7 -0
- package/dist/composables/useLocale.d.ts +7 -0
- package/dist/composables/useWindowSizeClass.d.ts +19 -0
- package/dist/index.d.ts +6 -0
- package/dist/locales/index.js +56 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +2399 -1899
- package/dist/m3ui.js.map +1 -1
- package/dist/rich-text-editor.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/{useLocale-4afAzuuP.js → useLocale-D3ZWZ8jY.js} +9 -2
- package/dist/useLocale-D3ZWZ8jY.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MChart.test.ts +28 -0
- package/src/__tests__/MPagination.test.ts +37 -0
- package/src/__tests__/MPullToRefresh.test.ts +39 -0
- package/src/__tests__/MShortNavigationBar.test.ts +25 -0
- package/src/__tests__/MTransferList.test.ts +73 -0
- package/src/__tests__/MWindow.test.ts +258 -0
- package/src/__tests__/adaptiveLayouts.test.ts +191 -0
- package/src/__tests__/sheets.test.ts +76 -0
- package/src/components/MBottomSheet.vue +11 -57
- package/src/components/MChart.vue +2 -1
- package/src/components/MListDetail.vue +103 -0
- package/src/components/MNavigationRail.vue +18 -10
- package/src/components/MNavigationSuite.vue +89 -0
- package/src/components/MPagination.vue +8 -5
- package/src/components/MPullToRefresh.vue +13 -1
- package/src/components/MShortNavigationBar.vue +37 -17
- package/src/components/MSideSheet.vue +11 -56
- package/src/components/MSupportingPane.vue +70 -0
- package/src/components/MTransferList.vue +43 -9
- package/src/components/MWindow.vue +507 -108
- package/src/components/_MTransferPane.vue +113 -35
- package/src/composables/_useItemLink.ts +19 -0
- package/src/composables/_useSheetMotion.ts +181 -0
- package/src/composables/useLocale.ts +17 -0
- package/src/composables/useWindowSizeClass.ts +93 -0
- package/src/index.ts +6 -0
- package/src/locales/de.ts +8 -0
- package/src/locales/es.ts +8 -0
- package/src/locales/fr.ts +8 -0
- package/src/locales/ja.ts +8 -0
- package/src/locales/ko.ts +8 -0
- package/src/locales/pt.ts +8 -0
- package/src/locales/zh.ts +8 -0
- package/dist/useLocale-4afAzuuP.js.map +0 -1
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { computed, ref } from 'vue'
|
|
3
|
-
import MIconButton from './MIconButton.vue'
|
|
4
|
-
import MTransferPane from './_MTransferPane.vue'
|
|
5
|
-
import { useLocale } from '../composables/useLocale'
|
|
6
|
-
|
|
7
|
-
const locale = useLocale()
|
|
8
|
-
|
|
1
|
+
<script lang="ts">
|
|
9
2
|
export interface TransferItem {
|
|
10
3
|
value: string | number
|
|
11
4
|
label: string
|
|
@@ -13,12 +6,21 @@ export interface TransferItem {
|
|
|
13
6
|
/** Optional second line under the label (an email, a role, a short description). */
|
|
14
7
|
description?: string
|
|
15
8
|
}
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts" generic="T extends TransferItem = TransferItem">
|
|
12
|
+
import { computed, ref } from 'vue'
|
|
13
|
+
import MIconButton from './MIconButton.vue'
|
|
14
|
+
import MTransferPane from './_MTransferPane.vue'
|
|
15
|
+
import { useLocale } from '../composables/useLocale'
|
|
16
|
+
|
|
17
|
+
const locale = useLocale()
|
|
16
18
|
|
|
17
19
|
type Value = string | number
|
|
18
20
|
|
|
19
21
|
const props = withDefaults(defineProps<{
|
|
20
22
|
modelValue: Value[]
|
|
21
|
-
items:
|
|
23
|
+
items: T[]
|
|
22
24
|
sourceTitle?: string
|
|
23
25
|
targetTitle?: string
|
|
24
26
|
filterable?: boolean
|
|
@@ -30,11 +32,39 @@ const props = withDefaults(defineProps<{
|
|
|
30
32
|
moveAllLeftLabel?: string
|
|
31
33
|
/** Height of each list's scroll area (any CSS length). */
|
|
32
34
|
listHeight?: string
|
|
35
|
+
/**
|
|
36
|
+
* Fully custom rows: the `#item` slot draws the whole row (no checkbox, padding, min height
|
|
37
|
+
* or background). The row stays clickable, focusable (Space checks it, Enter moves it) and
|
|
38
|
+
* animated; use the slot's `checked` to style the checked state.
|
|
39
|
+
*/
|
|
40
|
+
bare?: boolean
|
|
33
41
|
}>(), {
|
|
34
42
|
filterable: false,
|
|
35
43
|
listHeight: '280px',
|
|
44
|
+
bare: false,
|
|
36
45
|
})
|
|
37
46
|
|
|
47
|
+
defineSlots<{
|
|
48
|
+
/**
|
|
49
|
+
* Custom row content. Without `bare` it replaces the icon and text, keeping the checkbox,
|
|
50
|
+
* highlight and hover. Buttons, links, fields and `[data-transfer-action]` elements inside
|
|
51
|
+
* keep their own clicks instead of checking the row.
|
|
52
|
+
*/
|
|
53
|
+
item?: (props: {
|
|
54
|
+
/** Your item, with any extra fields it carries. */
|
|
55
|
+
item: T
|
|
56
|
+
checked: boolean
|
|
57
|
+
/** Which pane the row is in. */
|
|
58
|
+
side: 'source' | 'target'
|
|
59
|
+
/** Check or uncheck the row. */
|
|
60
|
+
toggle: () => void
|
|
61
|
+
/** Send just this row to the other pane. */
|
|
62
|
+
move: () => void
|
|
63
|
+
}) => unknown
|
|
64
|
+
'source-empty'?: () => unknown
|
|
65
|
+
'target-empty'?: () => unknown
|
|
66
|
+
}>()
|
|
67
|
+
|
|
38
68
|
const emit = defineEmits<{ 'update:modelValue': [Value[]] }>()
|
|
39
69
|
|
|
40
70
|
const checkedSource = ref<Set<Value>>(new Set())
|
|
@@ -131,11 +161,13 @@ function activateTarget(value: Value) {
|
|
|
131
161
|
enter-from="end"
|
|
132
162
|
:select-all-label="locale.selectAll"
|
|
133
163
|
:clear-search-label="locale.clearSearch"
|
|
164
|
+
:bare="bare"
|
|
134
165
|
@toggle="toggleSource"
|
|
135
166
|
@toggle-all="toggleAllSource"
|
|
136
167
|
@activate="activateSource"
|
|
137
168
|
@update:search="sourceSearch = $event"
|
|
138
169
|
>
|
|
170
|
+
<template v-if="$slots.item" #item="row"><slot name="item" v-bind="row" :item="row.item as T" side="source" /></template>
|
|
139
171
|
<template v-if="$slots['source-empty']" #empty><slot name="source-empty" /></template>
|
|
140
172
|
</MTransferPane>
|
|
141
173
|
|
|
@@ -187,11 +219,13 @@ function activateTarget(value: Value) {
|
|
|
187
219
|
enter-from="start"
|
|
188
220
|
:select-all-label="locale.selectAll"
|
|
189
221
|
:clear-search-label="locale.clearSearch"
|
|
222
|
+
:bare="bare"
|
|
190
223
|
@toggle="toggleTarget"
|
|
191
224
|
@toggle-all="toggleAllTarget"
|
|
192
225
|
@activate="activateTarget"
|
|
193
226
|
@update:search="targetSearch = $event"
|
|
194
227
|
>
|
|
228
|
+
<template v-if="$slots.item" #item="row"><slot name="item" v-bind="row" :item="row.item as T" side="target" /></template>
|
|
195
229
|
<template v-if="$slots['target-empty']" #empty><slot name="target-empty" /></template>
|
|
196
230
|
</MTransferPane>
|
|
197
231
|
</div>
|