@m3ui-vue/m3ui-vue 0.2.0 → 0.2.2
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/{MMenuItem-CIDblhtb.js → MMenuItem-DpoEsH91.js} +195 -114
- package/dist/MMenuItem-DpoEsH91.js.map +1 -0
- package/dist/components/MAlert.vue.d.ts +1 -0
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendar.vue.d.ts +3 -0
- package/dist/components/MChip.vue.d.ts +3 -3
- package/dist/components/MCommandPalette.vue.d.ts +3 -2
- package/dist/components/MConfirmDialog.vue.d.ts +0 -2
- package/dist/components/MDataTable.vue.d.ts +8 -2
- package/dist/components/MDatePicker.vue.d.ts +2 -0
- package/dist/components/MDateRangePicker.vue.d.ts +5 -0
- package/dist/components/MDialog.vue.d.ts +1 -0
- package/dist/components/MFileUpload.vue.d.ts +15 -1
- package/dist/components/MInfiniteScroll.vue.d.ts +7 -5
- package/dist/components/MMultiSelect.vue.d.ts +13 -1
- package/dist/components/MRichTextEditor.vue.d.ts +28 -1
- package/dist/components/MScheduler.vue.d.ts +5 -0
- package/dist/components/MSnackbar.vue.d.ts +4 -1
- package/dist/components/MSpinner.vue.d.ts +1 -0
- package/dist/components/MSpotlightSearch.vue.d.ts +3 -2
- package/dist/components/MTable.vue.d.ts +2 -1
- package/dist/components/MTimePicker.vue.d.ts +1 -0
- package/dist/components/MTour.vue.d.ts +3 -0
- package/dist/components/MTransferList.vue.d.ts +19 -3
- package/dist/components/MTree.vue.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +74 -0
- package/dist/index.d.ts +2 -0
- package/dist/locales/de.d.ts +2 -0
- package/dist/locales/es.d.ts +2 -0
- package/dist/locales/fr.d.ts +2 -0
- package/dist/locales/index.d.ts +8 -0
- package/dist/locales/index.js +489 -0
- package/dist/locales/index.js.map +1 -0
- package/dist/locales/ja.d.ts +2 -0
- package/dist/locales/ko.d.ts +2 -0
- package/dist/locales/pt.d.ts +2 -0
- package/dist/locales/zh.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +2734 -2647
- package/dist/m3ui.js.map +1 -1
- package/dist/plugin.d.ts +3 -1
- package/dist/rich-text-editor.d.ts +1 -0
- package/dist/rich-text-editor.js +141 -113
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/palettes.css +660 -0
- package/dist/styles.css +1 -1
- package/package.json +11 -2
- package/src/__tests__/MAlert.test.ts +59 -0
- package/src/__tests__/MConfirmDialog.test.ts +51 -0
- package/src/__tests__/MDialog.test.ts +58 -0
- package/src/__tests__/MSpinner.test.ts +37 -0
- package/src/__tests__/localePresets.test.ts +45 -0
- package/src/__tests__/plugin.test.ts +27 -0
- package/src/__tests__/setup.ts +11 -0
- package/src/__tests__/useColorPalette.test.ts +71 -0
- package/src/__tests__/useLocale.test.ts +50 -0
- package/src/__tests__/useTheme.test.ts +61 -0
- package/src/components/MAlert.vue +5 -1
- package/src/components/MCalendar.vue +14 -5
- package/src/components/MCommandPalette.vue +11 -7
- package/src/components/MConfirmDialog.vue +6 -5
- package/src/components/MDataTable.vue +18 -9
- package/src/components/MDatePicker.vue +11 -4
- package/src/components/MDateRangePicker.vue +15 -5
- package/src/components/MDialog.vue +5 -1
- package/src/components/MFileUpload.vue +22 -10
- package/src/components/MInfiniteScroll.vue +14 -9
- package/src/components/MMultiSelect.vue +11 -7
- package/src/components/MRichTextEditor.vue +95 -34
- package/src/components/MScheduler.vue +12 -4
- package/src/components/MSnackbar.vue +8 -1
- package/src/components/MSpinner.vue +5 -1
- package/src/components/MSpotlightSearch.vue +11 -7
- package/src/components/MTable.vue +8 -4
- package/src/components/MTimePicker.vue +5 -1
- package/src/components/MTour.vue +12 -9
- package/src/components/MTransferList.vue +30 -15
- package/src/composables/useColorPalette.ts +30 -20
- package/src/composables/useLocale.ts +181 -0
- package/src/index.ts +2 -0
- package/src/locales/de.ts +93 -0
- package/src/locales/es.ts +93 -0
- package/src/locales/fr.ts +93 -0
- package/src/locales/index.ts +8 -0
- package/src/locales/ja.ts +93 -0
- package/src/locales/ko.ts +93 -0
- package/src/locales/pt.ts +93 -0
- package/src/locales/zh.ts +93 -0
- package/src/plugin.ts +7 -1
- package/src/rich-text-editor.ts +1 -0
- package/src/styles/palettes.css +660 -0
- package/dist/MMenuItem-CIDblhtb.js.map +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { M3Locale } from '../composables/useLocale'
|
|
2
|
+
|
|
3
|
+
export const koLocale: M3Locale = {
|
|
4
|
+
// Common
|
|
5
|
+
search: '검색...',
|
|
6
|
+
noResults: '결과 없음',
|
|
7
|
+
close: '닫기',
|
|
8
|
+
cancel: '취소',
|
|
9
|
+
confirm: '확인',
|
|
10
|
+
loading: '로딩 중',
|
|
11
|
+
|
|
12
|
+
// Navigation
|
|
13
|
+
previous: '이전',
|
|
14
|
+
next: '다음',
|
|
15
|
+
today: '오늘',
|
|
16
|
+
more: '더보기',
|
|
17
|
+
|
|
18
|
+
// Tables
|
|
19
|
+
selectedCount: '선택됨',
|
|
20
|
+
recordCount: '개 레코드',
|
|
21
|
+
expand: '펼치기',
|
|
22
|
+
columns: '열',
|
|
23
|
+
exportCsv: 'CSV 내보내기',
|
|
24
|
+
noGroup: '그룹 없음',
|
|
25
|
+
|
|
26
|
+
// Tour
|
|
27
|
+
finish: '완료',
|
|
28
|
+
|
|
29
|
+
// File upload
|
|
30
|
+
dropText: '여기에 파일을 놓거나',
|
|
31
|
+
selectText: '찾아보기',
|
|
32
|
+
maxSizePrefix: '최대',
|
|
33
|
+
remove: '삭제',
|
|
34
|
+
|
|
35
|
+
// Pickers
|
|
36
|
+
selectDate: '날짜 선택',
|
|
37
|
+
selectTime: '시간 선택',
|
|
38
|
+
selectRange: '범위 선택',
|
|
39
|
+
pickStart: '시작 선택',
|
|
40
|
+
pickEnd: '종료 선택',
|
|
41
|
+
previousMonth: '이전 달',
|
|
42
|
+
nextMonth: '다음 달',
|
|
43
|
+
|
|
44
|
+
// Scheduler
|
|
45
|
+
dayView: '일',
|
|
46
|
+
weekView: '주',
|
|
47
|
+
|
|
48
|
+
// Transfer list
|
|
49
|
+
available: '사용 가능',
|
|
50
|
+
selected: '선택됨',
|
|
51
|
+
noItems: '항목 없음',
|
|
52
|
+
moveAllRight: '모두 오른쪽으로 이동',
|
|
53
|
+
moveRight: '선택 항목 오른쪽으로 이동',
|
|
54
|
+
moveLeft: '선택 항목 왼쪽으로 이동',
|
|
55
|
+
moveAllLeft: '모두 왼쪽으로 이동',
|
|
56
|
+
|
|
57
|
+
// Command palette / Spotlight
|
|
58
|
+
searchCommand: '명령 검색...',
|
|
59
|
+
navigateHint: '탐색',
|
|
60
|
+
selectHint: '선택',
|
|
61
|
+
openHint: '열기',
|
|
62
|
+
closeHint: '닫기',
|
|
63
|
+
|
|
64
|
+
// Infinite scroll
|
|
65
|
+
loadingMore: '로딩 중...',
|
|
66
|
+
noMoreItems: '더 이상 항목이 없습니다',
|
|
67
|
+
|
|
68
|
+
// Rich text editor
|
|
69
|
+
bold: '굵게',
|
|
70
|
+
italic: '기울임꼴',
|
|
71
|
+
underline: '밑줄',
|
|
72
|
+
strikethrough: '취소선',
|
|
73
|
+
highlight: '강조',
|
|
74
|
+
bulletList: '글머리 기호 목록',
|
|
75
|
+
orderedList: '번호 매기기 목록',
|
|
76
|
+
blockquote: '인용',
|
|
77
|
+
code: '코드',
|
|
78
|
+
alignLeft: '왼쪽 정렬',
|
|
79
|
+
alignCenter: '가운데 정렬',
|
|
80
|
+
alignRight: '오른쪽 정렬',
|
|
81
|
+
undo: '실행 취소',
|
|
82
|
+
redo: '다시 실행',
|
|
83
|
+
link: '링크',
|
|
84
|
+
image: '이미지',
|
|
85
|
+
paragraph: '문단',
|
|
86
|
+
heading1: '제목 1',
|
|
87
|
+
heading2: '제목 2',
|
|
88
|
+
heading3: '제목 3',
|
|
89
|
+
insertLink: '링크 삽입',
|
|
90
|
+
insertImage: '이미지 삽입',
|
|
91
|
+
imageUrlLabel: '이미지 URL',
|
|
92
|
+
insert: '삽입',
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { M3Locale } from '../composables/useLocale'
|
|
2
|
+
|
|
3
|
+
export const ptLocale: M3Locale = {
|
|
4
|
+
// Common
|
|
5
|
+
search: 'Pesquisar...',
|
|
6
|
+
noResults: 'Sem resultados',
|
|
7
|
+
close: 'Fechar',
|
|
8
|
+
cancel: 'Cancelar',
|
|
9
|
+
confirm: 'Confirmar',
|
|
10
|
+
loading: 'Carregando',
|
|
11
|
+
|
|
12
|
+
// Navigation
|
|
13
|
+
previous: 'Anterior',
|
|
14
|
+
next: 'Próximo',
|
|
15
|
+
today: 'Hoje',
|
|
16
|
+
more: 'mais',
|
|
17
|
+
|
|
18
|
+
// Tables
|
|
19
|
+
selectedCount: 'selecionados',
|
|
20
|
+
recordCount: 'registro',
|
|
21
|
+
expand: 'Expandir',
|
|
22
|
+
columns: 'Colunas',
|
|
23
|
+
exportCsv: 'Exportar CSV',
|
|
24
|
+
noGroup: 'Sem grupo',
|
|
25
|
+
|
|
26
|
+
// Tour
|
|
27
|
+
finish: 'Finalizar',
|
|
28
|
+
|
|
29
|
+
// File upload
|
|
30
|
+
dropText: 'Arraste arquivos aqui ou',
|
|
31
|
+
selectText: 'procurar',
|
|
32
|
+
maxSizePrefix: 'Máx.',
|
|
33
|
+
remove: 'Remover',
|
|
34
|
+
|
|
35
|
+
// Pickers
|
|
36
|
+
selectDate: 'Selecionar data',
|
|
37
|
+
selectTime: 'Selecionar hora',
|
|
38
|
+
selectRange: 'Selecionar intervalo',
|
|
39
|
+
pickStart: 'Selecionar início',
|
|
40
|
+
pickEnd: 'Selecionar fim',
|
|
41
|
+
previousMonth: 'Mês anterior',
|
|
42
|
+
nextMonth: 'Próximo mês',
|
|
43
|
+
|
|
44
|
+
// Scheduler
|
|
45
|
+
dayView: 'Dia',
|
|
46
|
+
weekView: 'Semana',
|
|
47
|
+
|
|
48
|
+
// Transfer list
|
|
49
|
+
available: 'Disponíveis',
|
|
50
|
+
selected: 'Selecionados',
|
|
51
|
+
noItems: 'Sem itens',
|
|
52
|
+
moveAllRight: 'Mover todos para a direita',
|
|
53
|
+
moveRight: 'Mover selecionados para a direita',
|
|
54
|
+
moveLeft: 'Mover selecionados para a esquerda',
|
|
55
|
+
moveAllLeft: 'Mover todos para a esquerda',
|
|
56
|
+
|
|
57
|
+
// Command palette / Spotlight
|
|
58
|
+
searchCommand: 'Pesquisar comando...',
|
|
59
|
+
navigateHint: 'navegar',
|
|
60
|
+
selectHint: 'selecionar',
|
|
61
|
+
openHint: 'abrir',
|
|
62
|
+
closeHint: 'fechar',
|
|
63
|
+
|
|
64
|
+
// Infinite scroll
|
|
65
|
+
loadingMore: 'Carregando...',
|
|
66
|
+
noMoreItems: 'Não há mais itens',
|
|
67
|
+
|
|
68
|
+
// Rich text editor
|
|
69
|
+
bold: 'Negrito',
|
|
70
|
+
italic: 'Itálico',
|
|
71
|
+
underline: 'Sublinhado',
|
|
72
|
+
strikethrough: 'Tachado',
|
|
73
|
+
highlight: 'Realçar',
|
|
74
|
+
bulletList: 'Lista com marcadores',
|
|
75
|
+
orderedList: 'Lista ordenada',
|
|
76
|
+
blockquote: 'Citação',
|
|
77
|
+
code: 'Código',
|
|
78
|
+
alignLeft: 'Alinhar à esquerda',
|
|
79
|
+
alignCenter: 'Centralizar',
|
|
80
|
+
alignRight: 'Alinhar à direita',
|
|
81
|
+
undo: 'Desfazer',
|
|
82
|
+
redo: 'Refazer',
|
|
83
|
+
link: 'Link',
|
|
84
|
+
image: 'Imagem',
|
|
85
|
+
paragraph: 'Parágrafo',
|
|
86
|
+
heading1: 'Título 1',
|
|
87
|
+
heading2: 'Título 2',
|
|
88
|
+
heading3: 'Título 3',
|
|
89
|
+
insertLink: 'Inserir link',
|
|
90
|
+
insertImage: 'Inserir imagem',
|
|
91
|
+
imageUrlLabel: 'URL da imagem',
|
|
92
|
+
insert: 'Inserir',
|
|
93
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { M3Locale } from '../composables/useLocale'
|
|
2
|
+
|
|
3
|
+
export const zhLocale: M3Locale = {
|
|
4
|
+
// Common
|
|
5
|
+
search: '搜索...',
|
|
6
|
+
noResults: '无结果',
|
|
7
|
+
close: '关闭',
|
|
8
|
+
cancel: '取消',
|
|
9
|
+
confirm: '确认',
|
|
10
|
+
loading: '加载中',
|
|
11
|
+
|
|
12
|
+
// Navigation
|
|
13
|
+
previous: '上一个',
|
|
14
|
+
next: '下一个',
|
|
15
|
+
today: '今天',
|
|
16
|
+
more: '更多',
|
|
17
|
+
|
|
18
|
+
// Tables
|
|
19
|
+
selectedCount: '已选择',
|
|
20
|
+
recordCount: '条记录',
|
|
21
|
+
expand: '展开',
|
|
22
|
+
columns: '列',
|
|
23
|
+
exportCsv: '导出 CSV',
|
|
24
|
+
noGroup: '无分组',
|
|
25
|
+
|
|
26
|
+
// Tour
|
|
27
|
+
finish: '完成',
|
|
28
|
+
|
|
29
|
+
// File upload
|
|
30
|
+
dropText: '将文件拖放到此处或',
|
|
31
|
+
selectText: '浏览',
|
|
32
|
+
maxSizePrefix: '最大',
|
|
33
|
+
remove: '移除',
|
|
34
|
+
|
|
35
|
+
// Pickers
|
|
36
|
+
selectDate: '选择日期',
|
|
37
|
+
selectTime: '选择时间',
|
|
38
|
+
selectRange: '选择范围',
|
|
39
|
+
pickStart: '选择开始',
|
|
40
|
+
pickEnd: '选择结束',
|
|
41
|
+
previousMonth: '上个月',
|
|
42
|
+
nextMonth: '下个月',
|
|
43
|
+
|
|
44
|
+
// Scheduler
|
|
45
|
+
dayView: '日',
|
|
46
|
+
weekView: '周',
|
|
47
|
+
|
|
48
|
+
// Transfer list
|
|
49
|
+
available: '可用',
|
|
50
|
+
selected: '已选',
|
|
51
|
+
noItems: '无项目',
|
|
52
|
+
moveAllRight: '全部移至右侧',
|
|
53
|
+
moveRight: '将选中项移至右侧',
|
|
54
|
+
moveLeft: '将选中项移至左侧',
|
|
55
|
+
moveAllLeft: '全部移至左侧',
|
|
56
|
+
|
|
57
|
+
// Command palette / Spotlight
|
|
58
|
+
searchCommand: '搜索命令...',
|
|
59
|
+
navigateHint: '导航',
|
|
60
|
+
selectHint: '选择',
|
|
61
|
+
openHint: '打开',
|
|
62
|
+
closeHint: '关闭',
|
|
63
|
+
|
|
64
|
+
// Infinite scroll
|
|
65
|
+
loadingMore: '加载中...',
|
|
66
|
+
noMoreItems: '没有更多项目',
|
|
67
|
+
|
|
68
|
+
// Rich text editor
|
|
69
|
+
bold: '粗体',
|
|
70
|
+
italic: '斜体',
|
|
71
|
+
underline: '下划线',
|
|
72
|
+
strikethrough: '删除线',
|
|
73
|
+
highlight: '高亮',
|
|
74
|
+
bulletList: '无序列表',
|
|
75
|
+
orderedList: '有序列表',
|
|
76
|
+
blockquote: '引用',
|
|
77
|
+
code: '代码',
|
|
78
|
+
alignLeft: '左对齐',
|
|
79
|
+
alignCenter: '居中对齐',
|
|
80
|
+
alignRight: '右对齐',
|
|
81
|
+
undo: '撤销',
|
|
82
|
+
redo: '重做',
|
|
83
|
+
link: '链接',
|
|
84
|
+
image: '图片',
|
|
85
|
+
paragraph: '段落',
|
|
86
|
+
heading1: '标题 1',
|
|
87
|
+
heading2: '标题 2',
|
|
88
|
+
heading3: '标题 3',
|
|
89
|
+
insertLink: '插入链接',
|
|
90
|
+
insertImage: '插入图片',
|
|
91
|
+
imageUrlLabel: '图片 URL',
|
|
92
|
+
insert: '插入',
|
|
93
|
+
}
|
package/src/plugin.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { App } from 'vue'
|
|
2
2
|
import type { Palette } from './composables/useColorPalette'
|
|
3
|
+
import type { M3Locale } from './composables/useLocale'
|
|
4
|
+
import { M3_LOCALE_KEY } from './composables/useLocale'
|
|
3
5
|
|
|
4
6
|
export interface M3UIOptions {
|
|
5
7
|
palette?: string
|
|
6
8
|
customPalettes?: Palette[]
|
|
9
|
+
locale?: Partial<M3Locale>
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
export function createM3UI(options: M3UIOptions = {}) {
|
|
10
13
|
return {
|
|
11
|
-
install(
|
|
14
|
+
install(app: App) {
|
|
12
15
|
if (options.palette && options.palette !== 'purple') {
|
|
13
16
|
document.documentElement.setAttribute('data-palette', options.palette)
|
|
14
17
|
localStorage.setItem('m3-palette', options.palette)
|
|
15
18
|
}
|
|
19
|
+
if (options.locale) {
|
|
20
|
+
app.provide(M3_LOCALE_KEY, options.locale)
|
|
21
|
+
}
|
|
16
22
|
},
|
|
17
23
|
}
|
|
18
24
|
}
|
package/src/rich-text-editor.ts
CHANGED