vue-intl 6.2.9 → 6.2.10
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/BUILD +70 -0
- package/CHANGELOG.md +387 -0
- package/LICENSE.md +0 -0
- package/README.md +0 -0
- package/index.ts +41 -0
- package/injection-key.ts +1 -0
- package/package.json +4 -3
- package/plugin.ts +43 -0
- package/provider.ts +17 -0
- package/tests/index.test.ts +116 -0
- package/tsconfig.json +6 -0
- package/index.d.ts +0 -9
- package/index.d.ts.map +0 -1
- package/index.js +0 -25
- package/injection-key.d.ts +0 -2
- package/injection-key.d.ts.map +0 -1
- package/injection-key.js +0 -4
- package/plugin.d.ts +0 -17
- package/plugin.d.ts.map +0 -1
- package/plugin.js +0 -24
- package/provider.d.ts +0 -4
- package/provider.d.ts.map +0 -1
- package/provider.js +0 -17
package/BUILD
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
load("@aspect_rules_js//npm/private:npm_package.bzl", "npm_package")
|
|
2
|
+
load("@npm//:defs.bzl", "npm_link_all_packages")
|
|
3
|
+
load("//tools:index.bzl", "check_format", "package_json_test", "ts_compile_node")
|
|
4
|
+
load("//tools:jest.bzl", "jest_test")
|
|
5
|
+
|
|
6
|
+
npm_link_all_packages(name = "node_modules")
|
|
7
|
+
|
|
8
|
+
PACKAGE_NAME = "vue-intl"
|
|
9
|
+
|
|
10
|
+
npm_package(
|
|
11
|
+
name = PACKAGE_NAME,
|
|
12
|
+
srcs = [
|
|
13
|
+
"LICENSE.md",
|
|
14
|
+
"README.md",
|
|
15
|
+
"package.json",
|
|
16
|
+
":dist",
|
|
17
|
+
],
|
|
18
|
+
visibility = ["//visibility:public"],
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
SRCS = glob([
|
|
22
|
+
"*.ts",
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
SRC_DEPS = [
|
|
26
|
+
"//:node_modules/vue",
|
|
27
|
+
"//:node_modules/@vue/runtime-core",
|
|
28
|
+
"//:node_modules/@babel/types",
|
|
29
|
+
":node_modules/@formatjs/intl",
|
|
30
|
+
":node_modules/@formatjs/icu-messageformat-parser",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
ts_compile_node(
|
|
34
|
+
name = "dist",
|
|
35
|
+
srcs = SRCS,
|
|
36
|
+
package = PACKAGE_NAME,
|
|
37
|
+
deps = SRC_DEPS,
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
jest_test(
|
|
41
|
+
name = "unit",
|
|
42
|
+
srcs = SRCS + ["tests/index.test.ts"] + glob([
|
|
43
|
+
"tests/__snapshots__/*.snap",
|
|
44
|
+
]),
|
|
45
|
+
additional_args = [
|
|
46
|
+
"--env",
|
|
47
|
+
"jsdom",
|
|
48
|
+
],
|
|
49
|
+
deps = SRC_DEPS + [
|
|
50
|
+
"//:node_modules/@vue/test-utils",
|
|
51
|
+
],
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
check_format(
|
|
55
|
+
name = "prettier",
|
|
56
|
+
srcs = glob(
|
|
57
|
+
[
|
|
58
|
+
"**/*",
|
|
59
|
+
],
|
|
60
|
+
exclude = [
|
|
61
|
+
"CHANGELOG.md",
|
|
62
|
+
"tests/__snapshots__/*",
|
|
63
|
+
],
|
|
64
|
+
),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
package_json_test(
|
|
68
|
+
name = "package_json_test",
|
|
69
|
+
deps = SRC_DEPS,
|
|
70
|
+
)
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [6.2.10](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.9...vue-intl@6.2.10) (2022-08-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package vue-intl
|
|
9
|
+
|
|
10
|
+
## [6.2.9](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.8...vue-intl@6.2.9) (2022-07-11)
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **vue-intl:** type augmentation for global properties ([#3703](https://github.com/formatjs/formatjs/issues/3703)) ([50cb9f2](https://github.com/formatjs/formatjs/commit/50cb9f2da90fe989fe65516c3846dd91482d9d66))
|
|
15
|
+
|
|
16
|
+
## [6.2.8](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.7...vue-intl@6.2.8) (2022-07-04)
|
|
17
|
+
|
|
18
|
+
**Note:** Version bump only for package vue-intl
|
|
19
|
+
|
|
20
|
+
## [6.2.7](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.6...vue-intl@6.2.7) (2022-06-06)
|
|
21
|
+
|
|
22
|
+
**Note:** Version bump only for package vue-intl
|
|
23
|
+
|
|
24
|
+
## [6.2.6](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.5...vue-intl@6.2.6) (2022-05-24)
|
|
25
|
+
|
|
26
|
+
**Note:** Version bump only for package vue-intl
|
|
27
|
+
|
|
28
|
+
## [6.2.5](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.4...vue-intl@6.2.5) (2022-05-23)
|
|
29
|
+
|
|
30
|
+
**Note:** Version bump only for package vue-intl
|
|
31
|
+
|
|
32
|
+
## [6.2.4](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.3...vue-intl@6.2.4) (2022-05-19)
|
|
33
|
+
|
|
34
|
+
**Note:** Version bump only for package vue-intl
|
|
35
|
+
|
|
36
|
+
## [6.2.3](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.2...vue-intl@6.2.3) (2022-05-19)
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* **react-intl:** fix type issue with react18, fix [#3550](https://github.com/formatjs/formatjs/issues/3550) ([2567b93](https://github.com/formatjs/formatjs/commit/2567b932c5d18b097a43842563046c20ce0c49f1))
|
|
41
|
+
|
|
42
|
+
## [6.2.2](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.1...vue-intl@6.2.2) (2022-04-27)
|
|
43
|
+
|
|
44
|
+
**Note:** Version bump only for package vue-intl
|
|
45
|
+
|
|
46
|
+
## [6.2.1](https://github.com/formatjs/formatjs/compare/vue-intl@6.2.0...vue-intl@6.2.1) (2022-04-17)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package vue-intl
|
|
49
|
+
|
|
50
|
+
# [6.2.0](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.6...vue-intl@6.2.0) (2022-03-26)
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* **vue-intl:** add $formatList, fix [#3488](https://github.com/formatjs/formatjs/issues/3488) ([af31543](https://github.com/formatjs/formatjs/commit/af31543bfe3d1e73f036fc6380f40d75193402b8))
|
|
55
|
+
|
|
56
|
+
## [6.1.6](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.5...vue-intl@6.1.6) (2022-03-13)
|
|
57
|
+
|
|
58
|
+
**Note:** Version bump only for package vue-intl
|
|
59
|
+
|
|
60
|
+
## [6.1.5](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.4...vue-intl@6.1.5) (2022-02-06)
|
|
61
|
+
|
|
62
|
+
**Note:** Version bump only for package vue-intl
|
|
63
|
+
|
|
64
|
+
## [6.1.4](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.3...vue-intl@6.1.4) (2022-02-06)
|
|
65
|
+
|
|
66
|
+
**Note:** Version bump only for package vue-intl
|
|
67
|
+
|
|
68
|
+
## [6.1.3](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.2...vue-intl@6.1.3) (2022-01-24)
|
|
69
|
+
|
|
70
|
+
**Note:** Version bump only for package vue-intl
|
|
71
|
+
|
|
72
|
+
## [6.1.2](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.1...vue-intl@6.1.2) (2022-01-14)
|
|
73
|
+
|
|
74
|
+
**Note:** Version bump only for package vue-intl
|
|
75
|
+
|
|
76
|
+
## [6.1.1](https://github.com/formatjs/formatjs/compare/vue-intl@6.1.0...vue-intl@6.1.1) (2022-01-09)
|
|
77
|
+
|
|
78
|
+
**Note:** Version bump only for package vue-intl
|
|
79
|
+
|
|
80
|
+
# [6.1.0](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.20...vue-intl@6.1.0) (2022-01-03)
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
* **vue-intl:** use vue/compiler-src instead of separate @vue/compiler-sfc ([3192667](https://github.com/formatjs/formatjs/commit/31926670e79e8d125e6c34909d4063fdb3e849a6))
|
|
85
|
+
|
|
86
|
+
## [6.0.20](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.19...vue-intl@6.0.20) (2022-01-03)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package vue-intl
|
|
89
|
+
|
|
90
|
+
## [6.0.19](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.18...vue-intl@6.0.19) (2021-12-20)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package vue-intl
|
|
93
|
+
|
|
94
|
+
## [6.0.18](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.17...vue-intl@6.0.18) (2021-12-01)
|
|
95
|
+
|
|
96
|
+
**Note:** Version bump only for package vue-intl
|
|
97
|
+
|
|
98
|
+
## [6.0.17](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.16...vue-intl@6.0.17) (2021-11-23)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package vue-intl
|
|
101
|
+
|
|
102
|
+
## [6.0.16](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.15...vue-intl@6.0.16) (2021-11-14)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package vue-intl
|
|
105
|
+
|
|
106
|
+
## [6.0.15](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.14...vue-intl@6.0.15) (2021-11-09)
|
|
107
|
+
|
|
108
|
+
**Note:** Version bump only for package vue-intl
|
|
109
|
+
|
|
110
|
+
## [6.0.14](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.13...vue-intl@6.0.14) (2021-10-22)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package vue-intl
|
|
113
|
+
|
|
114
|
+
## [6.0.13](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.12...vue-intl@6.0.13) (2021-10-17)
|
|
115
|
+
|
|
116
|
+
**Note:** Version bump only for package vue-intl
|
|
117
|
+
|
|
118
|
+
## [6.0.12](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.11...vue-intl@6.0.12) (2021-09-27)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package vue-intl
|
|
121
|
+
|
|
122
|
+
## [6.0.11](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.10...vue-intl@6.0.11) (2021-08-21)
|
|
123
|
+
|
|
124
|
+
**Note:** Version bump only for package vue-intl
|
|
125
|
+
|
|
126
|
+
## [6.0.10](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.9...vue-intl@6.0.10) (2021-08-15)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package vue-intl
|
|
129
|
+
|
|
130
|
+
## [6.0.9](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.8...vue-intl@6.0.9) (2021-08-06)
|
|
131
|
+
|
|
132
|
+
**Note:** Version bump only for package vue-intl
|
|
133
|
+
|
|
134
|
+
## [6.0.8](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.7...vue-intl@6.0.8) (2021-07-24)
|
|
135
|
+
|
|
136
|
+
**Note:** Version bump only for package vue-intl
|
|
137
|
+
|
|
138
|
+
## [6.0.7](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.6...vue-intl@6.0.7) (2021-07-23)
|
|
139
|
+
|
|
140
|
+
**Note:** Version bump only for package vue-intl
|
|
141
|
+
|
|
142
|
+
## [6.0.6](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.5...vue-intl@6.0.6) (2021-06-26)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package vue-intl
|
|
145
|
+
|
|
146
|
+
## [6.0.5](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.4...vue-intl@6.0.5) (2021-06-21)
|
|
147
|
+
|
|
148
|
+
**Note:** Version bump only for package vue-intl
|
|
149
|
+
|
|
150
|
+
## [6.0.4](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.3...vue-intl@6.0.4) (2021-06-09)
|
|
151
|
+
|
|
152
|
+
**Note:** Version bump only for package vue-intl
|
|
153
|
+
|
|
154
|
+
## [6.0.3](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.2...vue-intl@6.0.3) (2021-06-05)
|
|
155
|
+
|
|
156
|
+
**Note:** Version bump only for package vue-intl
|
|
157
|
+
|
|
158
|
+
## [6.0.2](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.1...vue-intl@6.0.2) (2021-06-05)
|
|
159
|
+
|
|
160
|
+
**Note:** Version bump only for package vue-intl
|
|
161
|
+
|
|
162
|
+
## [6.0.1](https://github.com/formatjs/formatjs/compare/vue-intl@6.0.0...vue-intl@6.0.1) (2021-06-04)
|
|
163
|
+
|
|
164
|
+
**Note:** Version bump only for package vue-intl
|
|
165
|
+
|
|
166
|
+
# [6.0.0](https://github.com/formatjs/formatjs/compare/vue-intl@5.0.2...vue-intl@6.0.0) (2021-06-01)
|
|
167
|
+
|
|
168
|
+
### Features
|
|
169
|
+
|
|
170
|
+
* **vue-intl:** use the same injection key for composition function and plugin ([#2931](https://github.com/formatjs/formatjs/issues/2931)) ([0eb9dc6](https://github.com/formatjs/formatjs/commit/0eb9dc6c60e9256db9b1bd1f00dafb000c087ac0))
|
|
171
|
+
|
|
172
|
+
### BREAKING CHANGES
|
|
173
|
+
|
|
174
|
+
* **vue-intl:** The injection key is now a symbol and must be imported from `vue-intl` under `intlKey`
|
|
175
|
+
|
|
176
|
+
## [5.0.2](https://github.com/formatjs/formatjs/compare/vue-intl@5.0.1...vue-intl@5.0.2) (2021-05-23)
|
|
177
|
+
|
|
178
|
+
**Note:** Version bump only for package vue-intl
|
|
179
|
+
|
|
180
|
+
## [5.0.1](https://github.com/formatjs/formatjs/compare/vue-intl@5.0.0...vue-intl@5.0.1) (2021-05-20)
|
|
181
|
+
|
|
182
|
+
**Note:** Version bump only for package vue-intl
|
|
183
|
+
|
|
184
|
+
# [5.0.0](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.7...vue-intl@5.0.0) (2021-05-17)
|
|
185
|
+
|
|
186
|
+
### Features
|
|
187
|
+
|
|
188
|
+
* **vue-intl:** follow Vue.js 3 plugin conventions ([#2891](https://github.com/formatjs/formatjs/issues/2891)) ([f6be174](https://github.com/formatjs/formatjs/commit/f6be1744713dd83db1042bcb8a7db2b69d1ccf74)), closes [#2889](https://github.com/formatjs/formatjs/issues/2889)
|
|
189
|
+
|
|
190
|
+
### BREAKING CHANGES
|
|
191
|
+
|
|
192
|
+
* **vue-intl:** This removes default export from the plugin and expose `createIntl` instead to follow vue3 plugin conventions
|
|
193
|
+
|
|
194
|
+
## [4.2.7](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.6...vue-intl@4.2.7) (2021-05-14)
|
|
195
|
+
|
|
196
|
+
**Note:** Version bump only for package vue-intl
|
|
197
|
+
|
|
198
|
+
## [4.2.6](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.5...vue-intl@4.2.6) (2021-05-10)
|
|
199
|
+
|
|
200
|
+
**Note:** Version bump only for package vue-intl
|
|
201
|
+
|
|
202
|
+
## [4.2.5](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.4...vue-intl@4.2.5) (2021-05-02)
|
|
203
|
+
|
|
204
|
+
**Note:** Version bump only for package vue-intl
|
|
205
|
+
|
|
206
|
+
## [4.2.4](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.3...vue-intl@4.2.4) (2021-05-02)
|
|
207
|
+
|
|
208
|
+
**Note:** Version bump only for package vue-intl
|
|
209
|
+
|
|
210
|
+
## [4.2.3](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.2...vue-intl@4.2.3) (2021-04-26)
|
|
211
|
+
|
|
212
|
+
**Note:** Version bump only for package vue-intl
|
|
213
|
+
|
|
214
|
+
## [4.2.2](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.1...vue-intl@4.2.2) (2021-04-26)
|
|
215
|
+
|
|
216
|
+
**Note:** Version bump only for package vue-intl
|
|
217
|
+
|
|
218
|
+
## [4.2.1](https://github.com/formatjs/formatjs/compare/vue-intl@4.2.0...vue-intl@4.2.1) (2021-04-26)
|
|
219
|
+
|
|
220
|
+
**Note:** Version bump only for package vue-intl
|
|
221
|
+
|
|
222
|
+
# [4.2.0](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.27...vue-intl@4.2.0) (2021-04-21)
|
|
223
|
+
|
|
224
|
+
### Features
|
|
225
|
+
|
|
226
|
+
* **vue-intl:** rename OptionalIntlConfig to IntlConfig and IntlConfig to ResolvedIntlConfig ([f2fe20e](https://github.com/formatjs/formatjs/commit/f2fe20e150a4f01d0447babe21319862be9a63f4))
|
|
227
|
+
|
|
228
|
+
## [4.1.27](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.26...vue-intl@4.1.27) (2021-04-12)
|
|
229
|
+
|
|
230
|
+
### Bug Fixes
|
|
231
|
+
|
|
232
|
+
* **vue-intl:** export the same stuff as react-intl ([9123574](https://github.com/formatjs/formatjs/commit/9123574129641eef69795147a265c9c291d87da5))
|
|
233
|
+
|
|
234
|
+
## [4.1.26](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.25...vue-intl@4.1.26) (2021-04-04)
|
|
235
|
+
|
|
236
|
+
**Note:** Version bump only for package vue-intl
|
|
237
|
+
|
|
238
|
+
## [4.1.25](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.24...vue-intl@4.1.25) (2021-04-03)
|
|
239
|
+
|
|
240
|
+
**Note:** Version bump only for package vue-intl
|
|
241
|
+
|
|
242
|
+
## [4.1.24](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.23...vue-intl@4.1.24) (2021-03-30)
|
|
243
|
+
|
|
244
|
+
**Note:** Version bump only for package vue-intl
|
|
245
|
+
|
|
246
|
+
## [4.1.23](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.22...vue-intl@4.1.23) (2021-03-30)
|
|
247
|
+
|
|
248
|
+
**Note:** Version bump only for package vue-intl
|
|
249
|
+
|
|
250
|
+
## [4.1.22](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.21...vue-intl@4.1.22) (2021-03-28)
|
|
251
|
+
|
|
252
|
+
**Note:** Version bump only for package vue-intl
|
|
253
|
+
|
|
254
|
+
## [4.1.21](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.20...vue-intl@4.1.21) (2021-03-28)
|
|
255
|
+
|
|
256
|
+
**Note:** Version bump only for package vue-intl
|
|
257
|
+
|
|
258
|
+
## [4.1.20](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.19...vue-intl@4.1.20) (2021-03-27)
|
|
259
|
+
|
|
260
|
+
**Note:** Version bump only for package vue-intl
|
|
261
|
+
|
|
262
|
+
## [4.1.19](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.18...vue-intl@4.1.19) (2021-03-27)
|
|
263
|
+
|
|
264
|
+
**Note:** Version bump only for package vue-intl
|
|
265
|
+
|
|
266
|
+
## [4.1.18](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.17...vue-intl@4.1.18) (2021-03-26)
|
|
267
|
+
|
|
268
|
+
**Note:** Version bump only for package vue-intl
|
|
269
|
+
|
|
270
|
+
## [4.1.17](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.16...vue-intl@4.1.17) (2021-03-17)
|
|
271
|
+
|
|
272
|
+
**Note:** Version bump only for package vue-intl
|
|
273
|
+
|
|
274
|
+
## [4.1.16](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.15...vue-intl@4.1.16) (2021-03-15)
|
|
275
|
+
|
|
276
|
+
**Note:** Version bump only for package vue-intl
|
|
277
|
+
|
|
278
|
+
## [4.1.15](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.14...vue-intl@4.1.15) (2021-03-01)
|
|
279
|
+
|
|
280
|
+
**Note:** Version bump only for package vue-intl
|
|
281
|
+
|
|
282
|
+
## [4.1.14](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.13...vue-intl@4.1.14) (2021-02-25)
|
|
283
|
+
|
|
284
|
+
**Note:** Version bump only for package vue-intl
|
|
285
|
+
|
|
286
|
+
## [4.1.13](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.12...vue-intl@4.1.13) (2021-02-25)
|
|
287
|
+
|
|
288
|
+
**Note:** Version bump only for package vue-intl
|
|
289
|
+
|
|
290
|
+
## [4.1.12](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.11...vue-intl@4.1.12) (2021-02-22)
|
|
291
|
+
|
|
292
|
+
**Note:** Version bump only for package vue-intl
|
|
293
|
+
|
|
294
|
+
## [4.1.11](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.10...vue-intl@4.1.11) (2021-02-21)
|
|
295
|
+
|
|
296
|
+
**Note:** Version bump only for package vue-intl
|
|
297
|
+
|
|
298
|
+
## [4.1.10](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.9...vue-intl@4.1.10) (2021-02-13)
|
|
299
|
+
|
|
300
|
+
**Note:** Version bump only for package vue-intl
|
|
301
|
+
|
|
302
|
+
## [4.1.9](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.8...vue-intl@4.1.9) (2021-02-09)
|
|
303
|
+
|
|
304
|
+
**Note:** Version bump only for package vue-intl
|
|
305
|
+
|
|
306
|
+
## [4.1.8](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.6...vue-intl@4.1.8) (2021-02-02)
|
|
307
|
+
|
|
308
|
+
**Note:** Version bump only for package vue-intl
|
|
309
|
+
|
|
310
|
+
## [4.1.7](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.6...vue-intl@4.1.7) (2021-01-29)
|
|
311
|
+
|
|
312
|
+
**Note:** Version bump only for package vue-intl
|
|
313
|
+
|
|
314
|
+
## [4.1.6](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.5...vue-intl@4.1.6) (2021-01-27)
|
|
315
|
+
|
|
316
|
+
**Note:** Version bump only for package vue-intl
|
|
317
|
+
|
|
318
|
+
## [4.1.5](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.4...vue-intl@4.1.5) (2021-01-26)
|
|
319
|
+
|
|
320
|
+
**Note:** Version bump only for package vue-intl
|
|
321
|
+
|
|
322
|
+
## [4.1.4](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.3...vue-intl@4.1.4) (2021-01-25)
|
|
323
|
+
|
|
324
|
+
**Note:** Version bump only for package vue-intl
|
|
325
|
+
|
|
326
|
+
## [4.1.3](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.2...vue-intl@4.1.3) (2021-01-13)
|
|
327
|
+
|
|
328
|
+
**Note:** Version bump only for package vue-intl
|
|
329
|
+
|
|
330
|
+
## [4.1.2](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.1...vue-intl@4.1.2) (2021-01-12)
|
|
331
|
+
|
|
332
|
+
**Note:** Version bump only for package vue-intl
|
|
333
|
+
|
|
334
|
+
## [4.1.1](https://github.com/formatjs/formatjs/compare/vue-intl@4.1.0...vue-intl@4.1.1) (2021-01-08)
|
|
335
|
+
|
|
336
|
+
### Bug Fixes
|
|
337
|
+
|
|
338
|
+
* **vue-intl:** update docs and homepage ([fa28f4b](https://github.com/formatjs/formatjs/commit/fa28f4b5d4b772d48307e8bacde1983fd35c57dd))
|
|
339
|
+
|
|
340
|
+
# 4.1.0 (2021-01-08)
|
|
341
|
+
|
|
342
|
+
### Bug Fixes
|
|
343
|
+
|
|
344
|
+
* **@formatjs/vue-intl:** fix package description ([38387be](https://github.com/formatjs/formatjs/commit/38387bec7fbd0fcc17b09203affb440606ad4610))
|
|
345
|
+
* **@formatjs/vue-intl:** fix README link ([42a861b](https://github.com/formatjs/formatjs/commit/42a861b0c240067c9b3aab2f96d904b8417498af))
|
|
346
|
+
|
|
347
|
+
### Features
|
|
348
|
+
|
|
349
|
+
* **@formatjs/vue-intl:** initial commit ([b38177a](https://github.com/formatjs/formatjs/commit/b38177abc079c886d107be0edd71bce9774100e0))
|
|
350
|
+
* **@formatjs/vue-intl:** support Vue composition API, part of [#2464](https://github.com/formatjs/formatjs/issues/2464) ([8845ad7](https://github.com/formatjs/formatjs/commit/8845ad7ae3916f51915614f6f7f2e7ec54e8e2fd))
|
|
351
|
+
* **vue-intl:** rename package to vue-intl, bump version to 4.0.0 for continuation ([b922fde](https://github.com/formatjs/formatjs/commit/b922fde3c9c650a707afd7cb0430df6307fbc4d7)), closes [learningequality/vue-intl#28](https://github.com/learningequality/vue-intl/issues/28)
|
|
352
|
+
|
|
353
|
+
## [0.3.4](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.3.3...@formatjs/vue-intl@0.3.4) (2021-01-06)
|
|
354
|
+
|
|
355
|
+
**Note:** Version bump only for package @formatjs/vue-intl
|
|
356
|
+
|
|
357
|
+
## [0.3.3](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.3.2...@formatjs/vue-intl@0.3.3) (2021-01-05)
|
|
358
|
+
|
|
359
|
+
**Note:** Version bump only for package @formatjs/vue-intl
|
|
360
|
+
|
|
361
|
+
## [0.3.2](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.3.1...@formatjs/vue-intl@0.3.2) (2021-01-04)
|
|
362
|
+
|
|
363
|
+
### Bug Fixes
|
|
364
|
+
|
|
365
|
+
* **@formatjs/vue-intl:** fix package description ([38387be](https://github.com/formatjs/formatjs/commit/38387bec7fbd0fcc17b09203affb440606ad4610))
|
|
366
|
+
|
|
367
|
+
## [0.3.1](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.3.0...@formatjs/vue-intl@0.3.1) (2021-01-04)
|
|
368
|
+
|
|
369
|
+
**Note:** Version bump only for package @formatjs/vue-intl
|
|
370
|
+
|
|
371
|
+
# [0.3.0](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.2.1...@formatjs/vue-intl@0.3.0) (2021-01-02)
|
|
372
|
+
|
|
373
|
+
### Features
|
|
374
|
+
|
|
375
|
+
* **@formatjs/vue-intl:** support Vue composition API, part of [#2464](https://github.com/formatjs/formatjs/issues/2464) ([8845ad7](https://github.com/formatjs/formatjs/commit/8845ad7ae3916f51915614f6f7f2e7ec54e8e2fd))
|
|
376
|
+
|
|
377
|
+
## [0.2.1](https://github.com/formatjs/formatjs/compare/@formatjs/vue-intl@0.2.0...@formatjs/vue-intl@0.2.1) (2021-01-01)
|
|
378
|
+
|
|
379
|
+
### Bug Fixes
|
|
380
|
+
|
|
381
|
+
* **@formatjs/vue-intl:** fix README link ([42a861b](https://github.com/formatjs/formatjs/commit/42a861b0c240067c9b3aab2f96d904b8417498af))
|
|
382
|
+
|
|
383
|
+
# 0.2.0 (2021-01-01)
|
|
384
|
+
|
|
385
|
+
### Features
|
|
386
|
+
|
|
387
|
+
* **@formatjs/vue-intl:** initial commit ([b38177a](https://github.com/formatjs/formatjs/commit/b38177abc079c886d107be0edd71bce9774100e0))
|
package/LICENSE.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/index.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {MessageDescriptor} from '@formatjs/intl'
|
|
2
|
+
export * from './plugin'
|
|
3
|
+
export * from './provider'
|
|
4
|
+
export {intlKey} from './injection-key'
|
|
5
|
+
export {
|
|
6
|
+
IntlShape,
|
|
7
|
+
IntlConfig,
|
|
8
|
+
ResolvedIntlConfig,
|
|
9
|
+
createIntlCache,
|
|
10
|
+
MessageDescriptor,
|
|
11
|
+
IntlCache,
|
|
12
|
+
Formatters,
|
|
13
|
+
IntlFormatters,
|
|
14
|
+
FormatDisplayNameOptions,
|
|
15
|
+
FormatListOptions,
|
|
16
|
+
FormatPluralOptions,
|
|
17
|
+
FormatRelativeTimeOptions,
|
|
18
|
+
FormatNumberOptions,
|
|
19
|
+
FormatDateOptions,
|
|
20
|
+
CustomFormatConfig,
|
|
21
|
+
CustomFormats,
|
|
22
|
+
UnsupportedFormatterError,
|
|
23
|
+
InvalidConfigError,
|
|
24
|
+
MissingDataError,
|
|
25
|
+
MessageFormatError,
|
|
26
|
+
MissingTranslationError,
|
|
27
|
+
IntlErrorCode,
|
|
28
|
+
IntlError,
|
|
29
|
+
} from '@formatjs/intl'
|
|
30
|
+
export function defineMessages<
|
|
31
|
+
K extends keyof any,
|
|
32
|
+
T = MessageDescriptor,
|
|
33
|
+
U extends Record<K, T> = Record<K, T>
|
|
34
|
+
>(msgs: U): U {
|
|
35
|
+
return msgs
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function defineMessage<T>(msg: T): T {
|
|
39
|
+
return msg
|
|
40
|
+
}
|
|
41
|
+
export type {MessageFormatElement} from '@formatjs/icu-messageformat-parser'
|
package/injection-key.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const intlKey = Symbol()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intl",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.10",
|
|
4
4
|
"description": "formatjs intl binding for vue",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
"author": "Long Ho <holevietlong@gmail.com>",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/types": "^7.12.11",
|
|
21
|
-
"@formatjs/
|
|
21
|
+
"@formatjs/icu-messageformat-parser": "2.1.5",
|
|
22
|
+
"@formatjs/intl": "2.3.2",
|
|
22
23
|
"tslib": "2.4.0"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"vue": "^3.2.23"
|
|
26
27
|
},
|
|
27
28
|
"license": "ISC"
|
|
28
|
-
}
|
|
29
|
+
}
|
package/plugin.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createIntl as _createIntl,
|
|
3
|
+
IntlConfig,
|
|
4
|
+
IntlFormatters,
|
|
5
|
+
IntlShape,
|
|
6
|
+
} from '@formatjs/intl'
|
|
7
|
+
import Vue from 'vue'
|
|
8
|
+
import {intlKey} from './injection-key'
|
|
9
|
+
|
|
10
|
+
declare module '@vue/runtime-core' {
|
|
11
|
+
interface ComponentCustomProperties {
|
|
12
|
+
$intl: IntlShape
|
|
13
|
+
$formatMessage: IntlFormatters['formatMessage']
|
|
14
|
+
$formatDate: IntlFormatters['formatDate']
|
|
15
|
+
$formatTime: IntlFormatters['formatTime']
|
|
16
|
+
$formatDateTimeRange: IntlFormatters['formatDateTimeRange']
|
|
17
|
+
$formatRelativeTime: IntlFormatters['formatRelativeTime']
|
|
18
|
+
$formatDisplayName: IntlFormatters['formatDisplayName']
|
|
19
|
+
$formatNumber: IntlFormatters['formatNumber']
|
|
20
|
+
$formatList: IntlFormatters['formatList']
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const createIntl = (options: IntlConfig): Vue.Plugin => ({
|
|
25
|
+
install(app) {
|
|
26
|
+
if (!options) {
|
|
27
|
+
throw new Error('Missing `options` for vue-intl plugin')
|
|
28
|
+
}
|
|
29
|
+
const intl = _createIntl(options)
|
|
30
|
+
|
|
31
|
+
app.config.globalProperties.$intl = intl
|
|
32
|
+
app.config.globalProperties.$formatMessage = intl.formatMessage
|
|
33
|
+
app.config.globalProperties.$formatDate = intl.formatDate
|
|
34
|
+
app.config.globalProperties.$formatTime = intl.formatTime
|
|
35
|
+
app.config.globalProperties.$formatDateTimeRange = intl.formatDateTimeRange
|
|
36
|
+
app.config.globalProperties.$formatRelativeTime = intl.formatRelativeTime
|
|
37
|
+
app.config.globalProperties.$formatDisplayName = intl.formatDisplayName
|
|
38
|
+
app.config.globalProperties.$formatNumber = intl.formatNumber
|
|
39
|
+
app.config.globalProperties.$formatList = intl.formatList
|
|
40
|
+
|
|
41
|
+
app.provide(intlKey, intl)
|
|
42
|
+
},
|
|
43
|
+
})
|
package/provider.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {IntlShape} from '@formatjs/intl'
|
|
2
|
+
import {inject, provide} from 'vue'
|
|
3
|
+
import {intlKey} from './injection-key'
|
|
4
|
+
|
|
5
|
+
export function provideIntl(intl: IntlShape<string>) {
|
|
6
|
+
provide(intlKey, intl)
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function useIntl() {
|
|
10
|
+
const intl = inject<IntlShape<string>>(intlKey)
|
|
11
|
+
if (!intl) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`An intl object was not injected. Install the plugin or use provideIntl.`
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
return intl
|
|
17
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import {defineComponent, h} from 'vue'
|
|
2
|
+
import {createIntl, intlKey, provideIntl, useIntl} from '../index'
|
|
3
|
+
import {mount} from '@vue/test-utils'
|
|
4
|
+
import {createIntl as rawCreateIntl} from '@formatjs/intl'
|
|
5
|
+
|
|
6
|
+
const Translations = defineComponent({
|
|
7
|
+
template: `
|
|
8
|
+
<div>
|
|
9
|
+
<h2>
|
|
10
|
+
{{
|
|
11
|
+
$formatMessage({
|
|
12
|
+
id: 'foo',
|
|
13
|
+
defaultMessage: 'Hello',
|
|
14
|
+
})
|
|
15
|
+
}}
|
|
16
|
+
</h2>
|
|
17
|
+
<p>
|
|
18
|
+
{{
|
|
19
|
+
$formatNumber(123, {
|
|
20
|
+
style: 'currency',
|
|
21
|
+
currency: 'EUR',
|
|
22
|
+
})
|
|
23
|
+
}}
|
|
24
|
+
</p>
|
|
25
|
+
</div>
|
|
26
|
+
`,
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
const Descendant = {
|
|
30
|
+
setup() {
|
|
31
|
+
const intl = useIntl()
|
|
32
|
+
return () =>
|
|
33
|
+
h(
|
|
34
|
+
'p',
|
|
35
|
+
{},
|
|
36
|
+
intl.formatMessage({
|
|
37
|
+
id: 'foo',
|
|
38
|
+
defaultMessage: 'Hello',
|
|
39
|
+
})
|
|
40
|
+
)
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const Ancestor = {
|
|
45
|
+
setup() {
|
|
46
|
+
provideIntl(
|
|
47
|
+
rawCreateIntl({
|
|
48
|
+
locale: 'en',
|
|
49
|
+
defaultLocale: 'en',
|
|
50
|
+
messages: {
|
|
51
|
+
foo: 'Composed',
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
)
|
|
55
|
+
},
|
|
56
|
+
render() {
|
|
57
|
+
return h(Descendant)
|
|
58
|
+
},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const Injected = defineComponent({
|
|
62
|
+
inject: {intl: intlKey},
|
|
63
|
+
render() {
|
|
64
|
+
return h(
|
|
65
|
+
'p',
|
|
66
|
+
{},
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
this.intl.formatMessage({
|
|
69
|
+
id: 'foo',
|
|
70
|
+
defaultMessage: 'Hello',
|
|
71
|
+
})
|
|
72
|
+
)
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
test('basic', function () {
|
|
77
|
+
const wrapper = mount(Translations, {
|
|
78
|
+
global: {
|
|
79
|
+
plugins: [
|
|
80
|
+
createIntl({
|
|
81
|
+
locale: 'en',
|
|
82
|
+
defaultLocale: 'en',
|
|
83
|
+
messages: {
|
|
84
|
+
foo: 'Foo',
|
|
85
|
+
},
|
|
86
|
+
}),
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
expect(wrapper.text()).toBe('Foo€123.00')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
test('injected', function () {
|
|
95
|
+
const wrapper = mount(Injected, {
|
|
96
|
+
global: {
|
|
97
|
+
plugins: [
|
|
98
|
+
createIntl({
|
|
99
|
+
locale: 'en',
|
|
100
|
+
defaultLocale: 'en',
|
|
101
|
+
messages: {
|
|
102
|
+
foo: 'Injected',
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
expect(wrapper.text()).toBe('Injected')
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
test('composition', function () {
|
|
113
|
+
const wrapper = mount(Ancestor)
|
|
114
|
+
|
|
115
|
+
expect(wrapper.text()).toBe('Composed')
|
|
116
|
+
})
|
package/tsconfig.json
ADDED
package/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MessageDescriptor } from '@formatjs/intl';
|
|
2
|
-
export * from './plugin';
|
|
3
|
-
export * from './provider';
|
|
4
|
-
export { intlKey } from './injection-key';
|
|
5
|
-
export { IntlShape, IntlConfig, ResolvedIntlConfig, createIntlCache, MessageDescriptor, IntlCache, Formatters, IntlFormatters, FormatDisplayNameOptions, FormatListOptions, FormatPluralOptions, FormatRelativeTimeOptions, FormatNumberOptions, FormatDateOptions, CustomFormatConfig, CustomFormats, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode, IntlError, } from '@formatjs/intl';
|
|
6
|
-
export declare function defineMessages<K extends keyof any, T = MessageDescriptor, U extends Record<K, T> = Record<K, T>>(msgs: U): U;
|
|
7
|
-
export declare function defineMessage<T>(msg: T): T;
|
|
8
|
-
export type { MessageFormatElement } from '@formatjs/icu-messageformat-parser';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/vue-intl/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAA;AAChD,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,iBAAiB,CAAA;AACvC,OAAO,EACL,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,SAAS,GACV,MAAM,gBAAgB,CAAA;AACvB,wBAAgB,cAAc,CAC5B,CAAC,SAAS,MAAM,GAAG,EACnB,CAAC,GAAG,iBAAiB,EACrB,CAAC,SAAS,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACrC,IAAI,EAAE,CAAC,GAAG,CAAC,CAEZ;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAE1C;AACD,YAAY,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA"}
|
package/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineMessage = exports.defineMessages = exports.IntlError = exports.IntlErrorCode = exports.MissingTranslationError = exports.MessageFormatError = exports.MissingDataError = exports.InvalidConfigError = exports.UnsupportedFormatterError = exports.createIntlCache = exports.intlKey = void 0;
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
(0, tslib_1.__exportStar)(require("./plugin"), exports);
|
|
6
|
-
(0, tslib_1.__exportStar)(require("./provider"), exports);
|
|
7
|
-
var injection_key_1 = require("./injection-key");
|
|
8
|
-
Object.defineProperty(exports, "intlKey", { enumerable: true, get: function () { return injection_key_1.intlKey; } });
|
|
9
|
-
var intl_1 = require("@formatjs/intl");
|
|
10
|
-
Object.defineProperty(exports, "createIntlCache", { enumerable: true, get: function () { return intl_1.createIntlCache; } });
|
|
11
|
-
Object.defineProperty(exports, "UnsupportedFormatterError", { enumerable: true, get: function () { return intl_1.UnsupportedFormatterError; } });
|
|
12
|
-
Object.defineProperty(exports, "InvalidConfigError", { enumerable: true, get: function () { return intl_1.InvalidConfigError; } });
|
|
13
|
-
Object.defineProperty(exports, "MissingDataError", { enumerable: true, get: function () { return intl_1.MissingDataError; } });
|
|
14
|
-
Object.defineProperty(exports, "MessageFormatError", { enumerable: true, get: function () { return intl_1.MessageFormatError; } });
|
|
15
|
-
Object.defineProperty(exports, "MissingTranslationError", { enumerable: true, get: function () { return intl_1.MissingTranslationError; } });
|
|
16
|
-
Object.defineProperty(exports, "IntlErrorCode", { enumerable: true, get: function () { return intl_1.IntlErrorCode; } });
|
|
17
|
-
Object.defineProperty(exports, "IntlError", { enumerable: true, get: function () { return intl_1.IntlError; } });
|
|
18
|
-
function defineMessages(msgs) {
|
|
19
|
-
return msgs;
|
|
20
|
-
}
|
|
21
|
-
exports.defineMessages = defineMessages;
|
|
22
|
-
function defineMessage(msg) {
|
|
23
|
-
return msg;
|
|
24
|
-
}
|
|
25
|
-
exports.defineMessage = defineMessage;
|
package/injection-key.d.ts
DELETED
package/injection-key.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"injection-key.d.ts","sourceRoot":"","sources":["../../../../../packages/vue-intl/injection-key.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,eAAW,CAAA"}
|
package/injection-key.js
DELETED
package/plugin.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IntlConfig, IntlFormatters, IntlShape } from '@formatjs/intl';
|
|
2
|
-
import Vue from 'vue';
|
|
3
|
-
declare module '@vue/runtime-core' {
|
|
4
|
-
interface ComponentCustomProperties {
|
|
5
|
-
$intl: IntlShape;
|
|
6
|
-
$formatMessage: IntlFormatters['formatMessage'];
|
|
7
|
-
$formatDate: IntlFormatters['formatDate'];
|
|
8
|
-
$formatTime: IntlFormatters['formatTime'];
|
|
9
|
-
$formatDateTimeRange: IntlFormatters['formatDateTimeRange'];
|
|
10
|
-
$formatRelativeTime: IntlFormatters['formatRelativeTime'];
|
|
11
|
-
$formatDisplayName: IntlFormatters['formatDisplayName'];
|
|
12
|
-
$formatNumber: IntlFormatters['formatNumber'];
|
|
13
|
-
$formatList: IntlFormatters['formatList'];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export declare const createIntl: (options: IntlConfig) => Vue.Plugin;
|
|
17
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/vue-intl/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,cAAc,EACd,SAAS,EACV,MAAM,gBAAgB,CAAA;AACvB,OAAO,GAAG,MAAM,KAAK,CAAA;AAGrB,OAAO,QAAQ,mBAAmB,CAAC;IACjC,UAAU,yBAAyB;QACjC,KAAK,EAAE,SAAS,CAAA;QAChB,cAAc,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;QAC/C,WAAW,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;QACzC,WAAW,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;QACzC,oBAAoB,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAA;QAC3D,mBAAmB,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAA;QACzD,kBAAkB,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAAA;QACvD,aAAa,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;QAC7C,WAAW,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;KAC1C;CACF;AAED,eAAO,MAAM,UAAU,YAAa,UAAU,KAAG,UAmB/C,CAAA"}
|
package/plugin.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createIntl = void 0;
|
|
4
|
-
var intl_1 = require("@formatjs/intl");
|
|
5
|
-
var injection_key_1 = require("./injection-key");
|
|
6
|
-
var createIntl = function (options) { return ({
|
|
7
|
-
install: function (app) {
|
|
8
|
-
if (!options) {
|
|
9
|
-
throw new Error('Missing `options` for vue-intl plugin');
|
|
10
|
-
}
|
|
11
|
-
var intl = (0, intl_1.createIntl)(options);
|
|
12
|
-
app.config.globalProperties.$intl = intl;
|
|
13
|
-
app.config.globalProperties.$formatMessage = intl.formatMessage;
|
|
14
|
-
app.config.globalProperties.$formatDate = intl.formatDate;
|
|
15
|
-
app.config.globalProperties.$formatTime = intl.formatTime;
|
|
16
|
-
app.config.globalProperties.$formatDateTimeRange = intl.formatDateTimeRange;
|
|
17
|
-
app.config.globalProperties.$formatRelativeTime = intl.formatRelativeTime;
|
|
18
|
-
app.config.globalProperties.$formatDisplayName = intl.formatDisplayName;
|
|
19
|
-
app.config.globalProperties.$formatNumber = intl.formatNumber;
|
|
20
|
-
app.config.globalProperties.$formatList = intl.formatList;
|
|
21
|
-
app.provide(injection_key_1.intlKey, intl);
|
|
22
|
-
},
|
|
23
|
-
}); };
|
|
24
|
-
exports.createIntl = createIntl;
|
package/provider.d.ts
DELETED
package/provider.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../../../packages/vue-intl/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAA;AAIxC,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,QAElD;AAED,wBAAgB,OAAO,sBAQtB"}
|
package/provider.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useIntl = exports.provideIntl = void 0;
|
|
4
|
-
var vue_1 = require("vue");
|
|
5
|
-
var injection_key_1 = require("./injection-key");
|
|
6
|
-
function provideIntl(intl) {
|
|
7
|
-
(0, vue_1.provide)(injection_key_1.intlKey, intl);
|
|
8
|
-
}
|
|
9
|
-
exports.provideIntl = provideIntl;
|
|
10
|
-
function useIntl() {
|
|
11
|
-
var intl = (0, vue_1.inject)(injection_key_1.intlKey);
|
|
12
|
-
if (!intl) {
|
|
13
|
-
throw new Error("An intl object was not injected. Install the plugin or use provideIntl.");
|
|
14
|
-
}
|
|
15
|
-
return intl;
|
|
16
|
-
}
|
|
17
|
-
exports.useIntl = useIntl;
|