@tplc/wot 1.0.10 → 1.0.12
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/CHANGELOG.md +4 -0
- package/components/wd-config-provider/wd-config-provider.vue +8 -8
- package/locale/index.ts +15 -3
- package/package.json +1 -1
- package/types/locale/index.d.ts +3 -0
- package/types/locale/lang/en-US.d.ts +134 -0
- /package/components/wd-input/{placeholder.css → placeholder.scss} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.12](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.11...v1.0.12) (2025-12-06)
|
|
6
|
+
|
|
7
|
+
### [1.0.11](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.10...v1.0.11) (2025-12-06)
|
|
8
|
+
|
|
5
9
|
### [1.0.10](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.9...v1.0.10) (2025-12-06)
|
|
6
10
|
|
|
7
11
|
### [1.0.9](https://gitlab888.30jia.com.cn/tourism-front/zero-code-pro/compare/v1.0.8...v1.0.9) (2025-12-06)
|
|
@@ -19,8 +19,8 @@ export default {
|
|
|
19
19
|
options: {
|
|
20
20
|
virtualHost: true,
|
|
21
21
|
addGlobalClass: true,
|
|
22
|
-
styleIsolation: 'shared'
|
|
23
|
-
}
|
|
22
|
+
styleIsolation: 'shared',
|
|
23
|
+
},
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
26
|
|
|
@@ -46,20 +46,20 @@ const kebabCase = (str: string): string => {
|
|
|
46
46
|
}
|
|
47
47
|
const colorRgb = (str: string) => {
|
|
48
48
|
if (!str) return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
let sColor = str.toLowerCase()
|
|
50
|
+
// 十六进制颜色值的正则表达式
|
|
51
|
+
const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
|
|
52
52
|
// 如果是16进制颜色
|
|
53
53
|
if (sColor && reg.test(sColor)) {
|
|
54
54
|
if (sColor.length === 4) {
|
|
55
|
-
|
|
55
|
+
let sColorNew = '#'
|
|
56
56
|
for (let i = 1; i < 4; i += 1) {
|
|
57
57
|
sColorNew += sColor.slice(i, i + 1).concat(sColor.slice(i, i + 1))
|
|
58
58
|
}
|
|
59
59
|
sColor = sColorNew
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
// 处理六位的颜色值
|
|
62
|
+
const sColorChange: number[] = []
|
|
63
63
|
for (let i = 1; i < 7; i += 2) {
|
|
64
64
|
sColorChange.push(parseInt('0x' + sColor.slice(i, i + 2)))
|
|
65
65
|
}
|
package/locale/index.ts
CHANGED
|
@@ -9,14 +9,22 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { reactive, ref } from 'vue'
|
|
11
11
|
import zhCN from './lang/zh-CN'
|
|
12
|
+
import enUs from './lang/en-US'
|
|
12
13
|
import { deepAssign } from '../components/common/util'
|
|
13
14
|
|
|
14
15
|
type Message = Record<string, any>
|
|
15
16
|
type Messages = Record<string, Message>
|
|
17
|
+
export const setLangStorage = (lang: string) => {
|
|
18
|
+
uni.setStorageSync('lang', lang)
|
|
19
|
+
}
|
|
20
|
+
export const getLangStorage = () => {
|
|
21
|
+
return uni.getStorageSync('lang') || 'zh-CN'
|
|
22
|
+
}
|
|
16
23
|
|
|
17
|
-
const lang = ref<string>(
|
|
24
|
+
const lang = ref<string>(getLangStorage())
|
|
18
25
|
const messages = reactive<Messages>({
|
|
19
|
-
'zh-CN': zhCN
|
|
26
|
+
'zh-CN': zhCN,
|
|
27
|
+
'en-US': enUs,
|
|
20
28
|
})
|
|
21
29
|
|
|
22
30
|
export const Locale = {
|
|
@@ -29,11 +37,15 @@ export const Locale = {
|
|
|
29
37
|
if (newMessage) {
|
|
30
38
|
this.add({ [newLang]: newMessage })
|
|
31
39
|
}
|
|
40
|
+
setLangStorage(newLang)
|
|
32
41
|
},
|
|
33
42
|
|
|
34
43
|
add(newMessages: Messages = {}) {
|
|
35
44
|
deepAssign(messages, newMessages)
|
|
36
|
-
}
|
|
45
|
+
},
|
|
46
|
+
getLang() {
|
|
47
|
+
return lang.value
|
|
48
|
+
},
|
|
37
49
|
}
|
|
38
50
|
|
|
39
51
|
export const useCurrentLang = () => lang
|
package/package.json
CHANGED
package/types/locale/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
type Message = Record<string, any>
|
|
2
2
|
type Messages = Record<string, Message>
|
|
3
|
+
export declare const setLangStorage: (lang: string) => void
|
|
4
|
+
export declare const getLangStorage: () => any
|
|
3
5
|
export declare const Locale: {
|
|
4
6
|
messages(): Message
|
|
5
7
|
use(newLang: string, newMessage?: Message): void
|
|
6
8
|
add(newMessages?: Messages): void
|
|
9
|
+
getLang(): string
|
|
7
10
|
}
|
|
8
11
|
export declare const useCurrentLang: () => import('vue').Ref<string>
|
|
9
12
|
export default Locale
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
calendar: {
|
|
3
|
+
placeholder: string
|
|
4
|
+
title: string
|
|
5
|
+
day: string
|
|
6
|
+
week: string
|
|
7
|
+
month: string
|
|
8
|
+
confirm: string
|
|
9
|
+
startTime: string
|
|
10
|
+
endTime: string
|
|
11
|
+
to: string
|
|
12
|
+
timeFormat: string
|
|
13
|
+
dateFormat: string
|
|
14
|
+
weekFormat: (year: number, week: number) => string
|
|
15
|
+
startWeek: string
|
|
16
|
+
endWeek: string
|
|
17
|
+
startMonth: string
|
|
18
|
+
endMonth: string
|
|
19
|
+
monthFormat: string
|
|
20
|
+
}
|
|
21
|
+
calendarView: {
|
|
22
|
+
startTime: string
|
|
23
|
+
endTime: string
|
|
24
|
+
weeks: {
|
|
25
|
+
sun: string
|
|
26
|
+
mon: string
|
|
27
|
+
tue: string
|
|
28
|
+
wed: string
|
|
29
|
+
thu: string
|
|
30
|
+
fri: string
|
|
31
|
+
sat: string
|
|
32
|
+
}
|
|
33
|
+
rangePrompt: (maxRange: number) => string
|
|
34
|
+
rangePromptWeek: (maxRange: number) => string
|
|
35
|
+
rangePromptMonth: (maxRange: number) => string
|
|
36
|
+
monthTitle: string
|
|
37
|
+
yearTitle: string
|
|
38
|
+
month: string
|
|
39
|
+
hour: (value: number) => string
|
|
40
|
+
minute: (value: number) => string
|
|
41
|
+
second: (value: number) => string
|
|
42
|
+
}
|
|
43
|
+
datetimePicker: {
|
|
44
|
+
start: string
|
|
45
|
+
end: string
|
|
46
|
+
to: string
|
|
47
|
+
placeholder: string
|
|
48
|
+
confirm: string
|
|
49
|
+
cancel: string
|
|
50
|
+
}
|
|
51
|
+
collapse: {
|
|
52
|
+
expand: string
|
|
53
|
+
retract: string
|
|
54
|
+
}
|
|
55
|
+
colPicker: {
|
|
56
|
+
title: string
|
|
57
|
+
placeholder: string
|
|
58
|
+
select: string
|
|
59
|
+
}
|
|
60
|
+
loadmore: {
|
|
61
|
+
loading: string
|
|
62
|
+
finished: string
|
|
63
|
+
error: string
|
|
64
|
+
retry: string
|
|
65
|
+
}
|
|
66
|
+
imgCropper: {
|
|
67
|
+
confirm: string
|
|
68
|
+
cancel: string
|
|
69
|
+
}
|
|
70
|
+
messageBox: {
|
|
71
|
+
inputPlaceholder: string
|
|
72
|
+
confirm: string
|
|
73
|
+
cancel: string
|
|
74
|
+
inputNoValidate: string
|
|
75
|
+
}
|
|
76
|
+
numberKeyboard: {
|
|
77
|
+
confirm: string
|
|
78
|
+
}
|
|
79
|
+
pagination: {
|
|
80
|
+
prev: string
|
|
81
|
+
next: string
|
|
82
|
+
page: (value: number) => string
|
|
83
|
+
total: (total: number) => string
|
|
84
|
+
size: (size: number) => string
|
|
85
|
+
}
|
|
86
|
+
picker: {
|
|
87
|
+
cancel: string
|
|
88
|
+
done: string
|
|
89
|
+
placeholder: string
|
|
90
|
+
}
|
|
91
|
+
search: {
|
|
92
|
+
search: string
|
|
93
|
+
cancel: string
|
|
94
|
+
}
|
|
95
|
+
steps: {
|
|
96
|
+
wait: string
|
|
97
|
+
finished: string
|
|
98
|
+
process: string
|
|
99
|
+
failed: string
|
|
100
|
+
}
|
|
101
|
+
tabs: {
|
|
102
|
+
all: string
|
|
103
|
+
}
|
|
104
|
+
upload: {
|
|
105
|
+
error: string
|
|
106
|
+
}
|
|
107
|
+
input: {
|
|
108
|
+
placeholder: string
|
|
109
|
+
}
|
|
110
|
+
selectPicker: {
|
|
111
|
+
title: string
|
|
112
|
+
placeholder: string
|
|
113
|
+
select: string
|
|
114
|
+
confirm: string
|
|
115
|
+
filterPlaceholder: string
|
|
116
|
+
}
|
|
117
|
+
tag: {
|
|
118
|
+
placeholder: string
|
|
119
|
+
add: string
|
|
120
|
+
}
|
|
121
|
+
textarea: {
|
|
122
|
+
placeholder: string
|
|
123
|
+
}
|
|
124
|
+
tableCol: {
|
|
125
|
+
indexLabel: string
|
|
126
|
+
}
|
|
127
|
+
signature: {
|
|
128
|
+
confirmText: string
|
|
129
|
+
clearText: string
|
|
130
|
+
revokeText: string
|
|
131
|
+
restoreText: string
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export default _default
|
|
File without changes
|