@element-plus/nightly 0.0.20220107 → 0.0.20220108

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 (192) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/dist/index.full.js +174 -173
  4. package/dist/index.full.min.js +8 -8
  5. package/dist/index.full.min.js.map +1 -1
  6. package/dist/index.full.min.mjs +8 -8
  7. package/dist/index.full.min.mjs.map +1 -1
  8. package/dist/index.full.mjs +172 -170
  9. package/es/components/cascader/index.d.ts +4 -0
  10. package/es/components/cascader/src/index.vue.d.ts +2 -0
  11. package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs +5 -4
  12. package/es/components/cascader-panel/src/index.vue_vue_type_script_lang.mjs.map +1 -1
  13. package/es/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.mjs.map +1 -1
  14. package/es/components/cascader-panel/src/menu.vue.d.ts +1 -0
  15. package/es/components/cascader-panel/src/menu.vue_vue_type_script_lang.mjs +6 -0
  16. package/es/components/cascader-panel/src/menu.vue_vue_type_script_lang.mjs.map +1 -1
  17. package/es/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.mjs +19 -2
  18. package/es/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.mjs.map +1 -1
  19. package/es/components/cascader-panel/src/types.d.ts +1 -0
  20. package/es/components/cascader-panel/src/types.mjs.map +1 -1
  21. package/es/components/checkbox/index.d.ts +6 -6
  22. package/es/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
  23. package/es/components/checkbox/src/checkbox.vue.d.ts +2 -2
  24. package/es/components/config-provider/index.d.ts +6 -2
  25. package/es/components/config-provider/index.mjs +1 -1
  26. package/es/components/config-provider/src/config-provider.d.ts +13 -5
  27. package/es/components/config-provider/src/config-provider.mjs +12 -5
  28. package/es/components/config-provider/src/config-provider.mjs.map +1 -1
  29. package/es/components/date-picker/index.d.ts +4 -4
  30. package/es/components/date-picker/src/date-picker-com/basic-cell-render.mjs +1 -1
  31. package/es/components/date-picker/src/date-picker-com/basic-cell-render.mjs.map +1 -1
  32. package/es/components/date-picker/src/date-picker.d.ts +2 -2
  33. package/es/components/form/index.d.ts +1 -0
  34. package/es/components/form/src/form.vue.d.ts +1 -0
  35. package/es/components/form/src/form.vue_vue_type_script_lang.mjs +14 -0
  36. package/es/components/form/src/form.vue_vue_type_script_lang.mjs.map +1 -1
  37. package/es/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.mjs +1 -4
  38. package/es/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.mjs.map +1 -1
  39. package/es/components/index.mjs +1 -1
  40. package/es/components/input/index.d.ts +1 -0
  41. package/es/components/input/src/input.vue.d.ts +1 -0
  42. package/es/components/input/src/input.vue_vue_type_script_lang.mjs +1 -0
  43. package/es/components/input/src/input.vue_vue_type_script_lang.mjs.map +1 -1
  44. package/es/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.mjs +1 -1
  45. package/es/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.mjs.map +1 -1
  46. package/es/components/input-number/index.d.ts +3 -1
  47. package/es/components/input-number/src/input-number.vue.d.ts +3 -1
  48. package/es/components/message/src/message-method.mjs +5 -1
  49. package/es/components/message/src/message-method.mjs.map +1 -1
  50. package/es/components/message/src/message.d.ts +3 -0
  51. package/es/components/message/src/message.mjs.map +1 -1
  52. package/es/components/message/src/message.vue.d.ts +2 -2
  53. package/es/components/notification/src/notification.vue.d.ts +4 -4
  54. package/es/components/popper/src/content.vue_vue_type_script_lang.mjs.map +1 -1
  55. package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs +1 -0
  56. package/es/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.mjs.map +1 -1
  57. package/es/components/radio/index.d.ts +6 -6
  58. package/es/components/radio/src/radio-button.vue.d.ts +2 -2
  59. package/es/components/radio/src/radio.vue.d.ts +2 -2
  60. package/es/components/select/index.d.ts +1 -1
  61. package/es/components/select/src/select.vue.d.ts +1 -1
  62. package/es/components/select-v2/index.d.ts +2 -2
  63. package/es/components/select-v2/src/select.vue.d.ts +1 -1
  64. package/es/components/switch/index.d.ts +2 -2
  65. package/es/components/switch/src/switch.vue.d.ts +2 -2
  66. package/es/components/tabs/index.d.ts +4 -4
  67. package/es/components/tabs/src/tab-pane.vue.d.ts +2 -2
  68. package/es/components/time-picker/index.d.ts +4 -4
  69. package/es/components/time-picker/src/common/picker.vue.d.ts +2 -2
  70. package/es/components/time-picker/src/time-picker.d.ts +2 -2
  71. package/es/components/transfer/src/transfer-panel.vue.d.ts +1 -2
  72. package/es/components/transfer/src/transfer-panel.vue_vue_type_script_lang.mjs +2 -13
  73. package/es/components/transfer/src/transfer-panel.vue_vue_type_script_lang.mjs.map +1 -1
  74. package/es/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.mjs +5 -18
  75. package/es/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.mjs.map +1 -1
  76. package/es/defaults.d.ts +3 -1
  77. package/es/hooks/index.mjs +1 -1
  78. package/es/hooks/use-global-config/index.d.ts +3 -1
  79. package/es/hooks/use-global-config/index.mjs +3 -2
  80. package/es/hooks/use-global-config/index.mjs.map +1 -1
  81. package/es/hooks/use-locale/index.d.ts +2 -253
  82. package/es/hooks/use-locale/index.mjs +9 -29
  83. package/es/hooks/use-locale/index.mjs.map +1 -1
  84. package/es/index.d.ts +4 -1
  85. package/es/index.mjs +3 -2
  86. package/es/index.mjs.map +1 -1
  87. package/es/version.d.ts +1 -1
  88. package/es/version.mjs +1 -1
  89. package/es/version.mjs.map +1 -1
  90. package/lib/components/cascader/index.d.ts +4 -0
  91. package/lib/components/cascader/src/index.vue.d.ts +2 -0
  92. package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js +5 -4
  93. package/lib/components/cascader-panel/src/index.vue_vue_type_script_lang.js.map +1 -1
  94. package/lib/components/cascader-panel/src/index.vue_vue_type_template_id_97c48f5c_lang.js.map +1 -1
  95. package/lib/components/cascader-panel/src/menu.vue.d.ts +1 -0
  96. package/lib/components/cascader-panel/src/menu.vue_vue_type_script_lang.js +10 -4
  97. package/lib/components/cascader-panel/src/menu.vue_vue_type_script_lang.js.map +1 -1
  98. package/lib/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.js +18 -1
  99. package/lib/components/cascader-panel/src/menu.vue_vue_type_template_id_9c79e4e2_lang.js.map +1 -1
  100. package/lib/components/cascader-panel/src/types.d.ts +1 -0
  101. package/lib/components/cascader-panel/src/types.js.map +1 -1
  102. package/lib/components/checkbox/index.d.ts +6 -6
  103. package/lib/components/checkbox/src/checkbox-button.vue.d.ts +2 -2
  104. package/lib/components/checkbox/src/checkbox.vue.d.ts +2 -2
  105. package/lib/components/config-provider/index.d.ts +6 -2
  106. package/lib/components/config-provider/index.js +1 -0
  107. package/lib/components/config-provider/index.js.map +1 -1
  108. package/lib/components/config-provider/src/config-provider.d.ts +13 -5
  109. package/lib/components/config-provider/src/config-provider.js +13 -5
  110. package/lib/components/config-provider/src/config-provider.js.map +1 -1
  111. package/lib/components/date-picker/index.d.ts +4 -4
  112. package/lib/components/date-picker/src/date-picker-com/basic-cell-render.js +1 -1
  113. package/lib/components/date-picker/src/date-picker-com/basic-cell-render.js.map +1 -1
  114. package/lib/components/date-picker/src/date-picker.d.ts +2 -2
  115. package/lib/components/form/index.d.ts +1 -0
  116. package/lib/components/form/src/form.vue.d.ts +1 -0
  117. package/lib/components/form/src/form.vue_vue_type_script_lang.js +14 -0
  118. package/lib/components/form/src/form.vue_vue_type_script_lang.js.map +1 -1
  119. package/lib/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.js +1 -4
  120. package/lib/components/form/src/form.vue_vue_type_template_id_602d6cf6_lang.js.map +1 -1
  121. package/lib/components/index.js +1 -0
  122. package/lib/components/index.js.map +1 -1
  123. package/lib/components/input/index.d.ts +1 -0
  124. package/lib/components/input/src/input.vue.d.ts +1 -0
  125. package/lib/components/input/src/input.vue_vue_type_script_lang.js +1 -0
  126. package/lib/components/input/src/input.vue_vue_type_script_lang.js.map +1 -1
  127. package/lib/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.js +1 -1
  128. package/lib/components/input/src/input.vue_vue_type_template_id_3290dcb6_lang.js.map +1 -1
  129. package/lib/components/input-number/index.d.ts +3 -1
  130. package/lib/components/input-number/src/input-number.vue.d.ts +3 -1
  131. package/lib/components/message/src/message-method.js +5 -1
  132. package/lib/components/message/src/message-method.js.map +1 -1
  133. package/lib/components/message/src/message.d.ts +3 -0
  134. package/lib/components/message/src/message.js.map +1 -1
  135. package/lib/components/message/src/message.vue.d.ts +2 -2
  136. package/lib/components/notification/src/notification.vue.d.ts +4 -4
  137. package/lib/components/popper/src/content.vue_vue_type_script_lang.js.map +1 -1
  138. package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js +1 -0
  139. package/lib/components/popper/src/content.vue_vue_type_template_id_611b76f0_lang.js.map +1 -1
  140. package/lib/components/radio/index.d.ts +6 -6
  141. package/lib/components/radio/src/radio-button.vue.d.ts +2 -2
  142. package/lib/components/radio/src/radio.vue.d.ts +2 -2
  143. package/lib/components/select/index.d.ts +1 -1
  144. package/lib/components/select/src/select.vue.d.ts +1 -1
  145. package/lib/components/select-v2/index.d.ts +2 -2
  146. package/lib/components/select-v2/src/select.vue.d.ts +1 -1
  147. package/lib/components/switch/index.d.ts +2 -2
  148. package/lib/components/switch/src/switch.vue.d.ts +2 -2
  149. package/lib/components/tabs/index.d.ts +4 -4
  150. package/lib/components/tabs/src/tab-pane.vue.d.ts +2 -2
  151. package/lib/components/time-picker/index.d.ts +4 -4
  152. package/lib/components/time-picker/src/common/picker.vue.d.ts +2 -2
  153. package/lib/components/time-picker/src/time-picker.d.ts +2 -2
  154. package/lib/components/transfer/src/transfer-panel.vue.d.ts +1 -2
  155. package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_lang.js +3 -14
  156. package/lib/components/transfer/src/transfer-panel.vue_vue_type_script_lang.js.map +1 -1
  157. package/lib/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.js +4 -17
  158. package/lib/components/transfer/src/transfer-panel.vue_vue_type_template_id_1a7d1f9c_lang.js.map +1 -1
  159. package/lib/defaults.d.ts +3 -1
  160. package/lib/hooks/index.js +1 -4
  161. package/lib/hooks/index.js.map +1 -1
  162. package/lib/hooks/use-global-config/index.d.ts +3 -1
  163. package/lib/hooks/use-global-config/index.js +3 -2
  164. package/lib/hooks/use-global-config/index.js.map +1 -1
  165. package/lib/hooks/use-locale/index.d.ts +2 -253
  166. package/lib/hooks/use-locale/index.js +8 -31
  167. package/lib/hooks/use-locale/index.js.map +1 -1
  168. package/lib/index.d.ts +4 -1
  169. package/lib/index.js +4 -4
  170. package/lib/index.js.map +1 -1
  171. package/lib/version.d.ts +1 -1
  172. package/lib/version.js +1 -1
  173. package/lib/version.js.map +1 -1
  174. package/package.json +2 -2
  175. package/tags.json +1 -1
  176. package/theme-chalk/el-cascader.css +1 -1
  177. package/theme-chalk/el-date-picker.css +1 -1
  178. package/theme-chalk/el-form.css +1 -1
  179. package/theme-chalk/el-pagination.css +1 -1
  180. package/theme-chalk/el-tag.css +1 -1
  181. package/theme-chalk/el-time-picker.css +1 -1
  182. package/theme-chalk/el-time-select.css +1 -1
  183. package/theme-chalk/el-transfer.css +1 -1
  184. package/theme-chalk/index.css +1 -1
  185. package/theme-chalk/src/cascader.scss +4 -0
  186. package/theme-chalk/src/common/var.scss +2 -2
  187. package/theme-chalk/src/date-picker/picker.scss +1 -0
  188. package/theme-chalk/src/form.scss +101 -24
  189. package/theme-chalk/src/pagination.scss +0 -3
  190. package/theme-chalk/src/tag.scss +3 -3
  191. package/theme-chalk/src/transfer.scss +27 -31
  192. package/web-types.json +1 -1
package/lib/defaults.d.ts CHANGED
@@ -1,14 +1,16 @@
1
1
  declare const _default: {
2
2
  version: string;
3
3
  install: (app: import("vue").App<any>, options?: {
4
+ readonly locale?: unknown;
4
5
  readonly size?: unknown;
5
6
  readonly button?: unknown;
7
+ readonly message?: unknown;
6
8
  readonly zIndex?: unknown;
7
- readonly locale?: unknown;
8
9
  } & {} & {
9
10
  button?: import("./components").ButtonConfigContext | undefined;
10
11
  size?: import("./utils/props").BuildPropType<StringConstructor, "small" | "default" | "large", unknown> | undefined;
11
12
  locale?: import("./locale").Language | undefined;
13
+ message?: import("./components").MessageConfigContext | undefined;
12
14
  zIndex?: number | undefined;
13
15
  }) => void;
14
16
  };
@@ -36,13 +36,10 @@ exports.useFocus = index$2.useFocus;
36
36
  exports.useFormItem = index$3.useFormItem;
37
37
  exports.provideGlobalConfig = index$4.provideGlobalConfig;
38
38
  exports.useGlobalConfig = index$4.useGlobalConfig;
39
+ exports.buildLocaleContext = index$5.buildLocaleContext;
39
40
  exports.buildTranslator = index$5.buildTranslator;
40
- exports.localeContextKey = index$5.localeContextKey;
41
- exports.localeProviderMaker = index$5.localeProviderMaker;
42
- exports.provideLocale = index$5.provideLocale;
43
41
  exports.translate = index$5.translate;
44
42
  exports.useLocale = index$5.useLocale;
45
- exports.useLocaleProps = index$5.useLocaleProps;
46
43
  exports.useLockscreen = index$6.useLockscreen;
47
44
  exports.useModal = index$7.useModal;
48
45
  exports.createModelToggleComposable = index$8.createModelToggleComposable;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,13 +4,15 @@ import type { ConfigProviderContext } from 'element-plus/es/tokens';
4
4
  export declare function useGlobalConfig<K extends keyof ConfigProviderContext>(key: K): Ref<ConfigProviderContext[K]>;
5
5
  export declare function useGlobalConfig(): Ref<ConfigProviderContext>;
6
6
  export declare const provideGlobalConfig: (config: MaybeRef<ConfigProviderContext>, app?: App<any> | undefined) => import("vue").ComputedRef<{
7
+ readonly locale?: unknown;
7
8
  readonly size?: unknown;
8
9
  readonly button?: unknown;
10
+ readonly message?: unknown;
9
11
  readonly zIndex?: unknown;
10
- readonly locale?: unknown;
11
12
  } & {} & {
12
13
  button?: import("../..").ButtonConfigContext | undefined;
13
14
  size?: import("../../utils/props").BuildPropType<StringConstructor, "small" | "default" | "large", unknown> | undefined;
14
15
  locale?: import("../../locale").Language | undefined;
16
+ message?: import("../..").MessageConfigContext | undefined;
15
17
  zIndex?: number | undefined;
16
18
  }> | undefined;
@@ -9,9 +9,9 @@ var error = require('../../utils/error.js');
9
9
  var configProvider = require('../../tokens/config-provider.js');
10
10
  var shared = require('@vue/shared');
11
11
 
12
- const fallback = vue.ref({});
12
+ const cache = vue.ref({});
13
13
  function useGlobalConfig(key) {
14
- const config = vue.inject(configProvider.configProviderContextKey, fallback);
14
+ const config = vue.inject(configProvider.configProviderContextKey, cache);
15
15
  if (key) {
16
16
  return shared.isObject(config.value) && shared.hasOwn(config.value, key) ? vue.computed(() => config.value[key]) : vue.ref(void 0);
17
17
  } else {
@@ -34,6 +34,7 @@ const provideGlobalConfig = (config, app) => {
34
34
  return util.merge(oldConfig.value, cfg);
35
35
  });
36
36
  provideFn(configProvider.configProviderContextKey, context);
37
+ cache.value = context.value;
37
38
  return context;
38
39
  };
39
40
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-global-config/index.ts"],"sourcesContent":["import { inject, ref, computed, unref, provide, getCurrentInstance } from 'vue'\nimport { configProviderContextKey } from '@element-plus/tokens'\nimport { hasOwn, isObject, merge } from '@element-plus/utils/util'\nimport { debugWarn } from '@element-plus/utils/error'\nimport type { MaybeRef } from '@vueuse/core'\nimport type { Ref, App } from 'vue'\nimport type { ConfigProviderContext } from '@element-plus/tokens'\n\nconst fallback = ref<ConfigProviderContext>({})\n\nexport function useGlobalConfig<K extends keyof ConfigProviderContext>(\n key: K\n): Ref<ConfigProviderContext[K]>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(key?: keyof ConfigProviderContext) {\n const config = inject(configProviderContextKey, fallback)\n if (key) {\n return isObject(config.value) && hasOwn(config.value, key)\n ? computed(() => config.value[key])\n : ref(undefined)\n } else {\n return config\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig) return cfg\n return merge(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n return context\n}\n"],"names":["ref","inject","configProviderContextKey","isObject","hasOwn","computed","getCurrentInstance","provide","debugWarn","unref","merge"],"mappings":";;;;;;;;;;;AAIA,MAAM,QAAQ,GAAGA,OAAG,CAAC,EAAE,CAAC,CAAC;AAClB,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,uCAAwB,EAAE,QAAQ,CAAC,CAAC;AAC5D,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAOC,eAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAIC,aAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAGC,YAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAGL,OAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACjH,GAAG,MAAM;AACT,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,CAAC;AACW,MAAC,mBAAmB,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK;AACpD,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,OAAO,GAAG,CAAC,CAACM,sBAAkB,EAAE,CAAC;AACzC,EAAE,MAAM,SAAS,GAAG,OAAO,GAAG,eAAe,EAAE,GAAG,KAAK,CAAC,CAAC;AACzD,EAAE,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,OAAO,GAAGC,WAAO,GAAG,KAAK,CAAC,CAAC;AACxG,EAAE,IAAI,CAAC,SAAS,EAAE;AAClB,IAAIC,eAAS,CAAC,qBAAqB,EAAE,wDAAwD,CAAC,CAAC;AAC/F,IAAI,OAAO;AACX,GAAG;AACH,EAAE,MAAM,OAAO,GAAGH,YAAQ,CAAC,MAAM;AACjC,IAAI,MAAM,GAAG,GAAGI,SAAK,CAAC,MAAM,CAAC,CAAC;AAC9B,IAAI,IAAI,CAAC,SAAS;AAClB,MAAM,OAAO,GAAG,CAAC;AACjB,IAAI,OAAOC,UAAK,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACvC,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,CAACR,uCAAwB,EAAE,OAAO,CAAC,CAAC;AAC/C,EAAE,OAAO,OAAO,CAAC;AACjB;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-global-config/index.ts"],"sourcesContent":["import { inject, ref, computed, unref, provide, getCurrentInstance } from 'vue'\nimport { configProviderContextKey } from '@element-plus/tokens'\nimport { hasOwn, isObject, merge } from '@element-plus/utils/util'\nimport { debugWarn } from '@element-plus/utils/error'\nimport type { MaybeRef } from '@vueuse/core'\nimport type { Ref, App } from 'vue'\nimport type { ConfigProviderContext } from '@element-plus/tokens'\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nconst cache = ref<ConfigProviderContext>({})\n\nexport function useGlobalConfig<K extends keyof ConfigProviderContext>(\n key: K\n): Ref<ConfigProviderContext[K]>\nexport function useGlobalConfig(): Ref<ConfigProviderContext>\nexport function useGlobalConfig(key?: keyof ConfigProviderContext) {\n const config = inject(configProviderContextKey, cache)\n if (key) {\n return isObject(config.value) && hasOwn(config.value, key)\n ? computed(() => config.value[key])\n : ref(undefined)\n } else {\n return config\n }\n}\n\nexport const provideGlobalConfig = (\n config: MaybeRef<ConfigProviderContext>,\n app?: App\n) => {\n const inSetup = !!getCurrentInstance()\n const oldConfig = inSetup ? useGlobalConfig() : undefined\n\n const provideFn = app?.provide ?? (inSetup ? provide : undefined)\n if (!provideFn) {\n debugWarn(\n 'provideGlobalConfig',\n 'provideGlobalConfig() can only be used inside setup().'\n )\n return\n }\n\n const context = computed(() => {\n const cfg = unref(config)\n if (!oldConfig) return cfg\n return merge(oldConfig.value, cfg)\n })\n provideFn(configProviderContextKey, context)\n cache.value = context.value\n return context\n}\n"],"names":["ref","inject","configProviderContextKey","isObject","hasOwn","computed","getCurrentInstance","provide","debugWarn","unref","merge"],"mappings":";;;;;;;;;;;AAIA,MAAM,KAAK,GAAGA,OAAG,CAAC,EAAE,CAAC,CAAC;AACf,SAAS,eAAe,CAAC,GAAG,EAAE;AACrC,EAAE,MAAM,MAAM,GAAGC,UAAM,CAACC,uCAAwB,EAAE,KAAK,CAAC,CAAC;AACzD,EAAE,IAAI,GAAG,EAAE;AACX,IAAI,OAAOC,eAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAIC,aAAM,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,GAAGC,YAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAGL,OAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACjH,GAAG,MAAM;AACT,IAAI,OAAO,MAAM,CAAC;AAClB,GAAG;AACH,CAAC;AACW,MAAC,mBAAmB,GAAG,CAAC,MAAM,EAAE,GAAG,KAAK;AACpD,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,MAAM,OAAO,GAAG,CAAC,CAACM,sBAAkB,EAAE,CAAC;AACzC,EAAE,MAAM,SAAS,GAAG,OAAO,GAAG,eAAe,EAAE,GAAG,KAAK,CAAC,CAAC;AACzD,EAAE,MAAM,SAAS,GAAG,CAAC,EAAE,GAAG,GAAG,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,OAAO,GAAGC,WAAO,GAAG,KAAK,CAAC,CAAC;AACxG,EAAE,IAAI,CAAC,SAAS,EAAE;AAClB,IAAIC,eAAS,CAAC,qBAAqB,EAAE,wDAAwD,CAAC,CAAC;AAC/F,IAAI,OAAO;AACX,GAAG;AACH,EAAE,MAAM,OAAO,GAAGH,YAAQ,CAAC,MAAM;AACjC,IAAI,MAAM,GAAG,GAAGI,SAAK,CAAC,MAAM,CAAC,CAAC;AAC9B,IAAI,IAAI,CAAC,SAAS;AAClB,MAAM,OAAO,GAAG,CAAC;AACjB,IAAI,OAAOC,UAAK,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACvC,GAAG,CAAC,CAAC;AACL,EAAE,SAAS,CAACR,uCAAwB,EAAE,OAAO,CAAC,CAAC;AAC/C,EAAE,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AAC9B,EAAE,OAAO,OAAO,CAAC;AACjB;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import type { MaybeRef } from '@vueuse/core';
2
- import type { InjectionKey, Ref } from 'vue';
2
+ import type { Ref } from 'vue';
3
3
  import type { Language } from 'element-plus/es/locale';
4
4
  export declare type TranslatorOption = Record<string, string | number>;
5
5
  export declare type Translator = (path: string, option?: TranslatorOption) => string;
@@ -8,258 +8,7 @@ export declare type LocaleContext = {
8
8
  lang: Ref<string>;
9
9
  t: Translator;
10
10
  };
11
- export declare const useLocaleProps: {
12
- locale: import("element-plus/es/utils/props").BuildPropReturn<import("element-plus/es/utils/props").PropWrapper<Language>, unknown, unknown, unknown, unknown>;
13
- };
14
- export declare const localeContextKey: InjectionKey<LocaleContext>;
15
- export declare const provideLocale: () => void;
16
11
  export declare const buildTranslator: (locale: MaybeRef<Language>) => Translator;
17
12
  export declare const translate: (path: string, option: undefined | TranslatorOption, locale: Language) => string;
18
- export declare const localeProviderMaker: (locale?: {
19
- name: string;
20
- el: {
21
- colorpicker: {
22
- confirm: string;
23
- clear: string;
24
- };
25
- datepicker: {
26
- now: string;
27
- today: string;
28
- cancel: string;
29
- clear: string;
30
- confirm: string;
31
- selectDate: string;
32
- selectTime: string;
33
- startDate: string;
34
- startTime: string;
35
- endDate: string;
36
- endTime: string;
37
- prevYear: string;
38
- nextYear: string;
39
- prevMonth: string;
40
- nextMonth: string;
41
- year: string;
42
- month1: string;
43
- month2: string;
44
- month3: string;
45
- month4: string;
46
- month5: string;
47
- month6: string;
48
- month7: string;
49
- month8: string;
50
- month9: string;
51
- month10: string;
52
- month11: string;
53
- month12: string;
54
- week: string;
55
- weeks: {
56
- sun: string;
57
- mon: string;
58
- tue: string;
59
- wed: string;
60
- thu: string;
61
- fri: string;
62
- sat: string;
63
- };
64
- months: {
65
- jan: string;
66
- feb: string;
67
- mar: string;
68
- apr: string;
69
- may: string;
70
- jun: string;
71
- jul: string;
72
- aug: string;
73
- sep: string;
74
- oct: string;
75
- nov: string;
76
- dec: string;
77
- };
78
- };
79
- select: {
80
- loading: string;
81
- noMatch: string;
82
- noData: string;
83
- placeholder: string;
84
- };
85
- cascader: {
86
- noMatch: string;
87
- loading: string;
88
- placeholder: string;
89
- noData: string;
90
- };
91
- pagination: {
92
- goto: string;
93
- pagesize: string;
94
- total: string;
95
- pageClassifier: string;
96
- deprecationWarning: string;
97
- };
98
- messagebox: {
99
- title: string;
100
- confirm: string;
101
- cancel: string;
102
- error: string;
103
- };
104
- upload: {
105
- deleteTip: string;
106
- delete: string;
107
- preview: string;
108
- continue: string;
109
- };
110
- table: {
111
- emptyText: string;
112
- confirmFilter: string;
113
- resetFilter: string;
114
- clearFilter: string;
115
- sumText: string;
116
- };
117
- tree: {
118
- emptyText: string;
119
- };
120
- transfer: {
121
- noMatch: string;
122
- noData: string;
123
- titles: string[];
124
- filterPlaceholder: string;
125
- noCheckedFormat: string;
126
- hasCheckedFormat: string;
127
- };
128
- image: {
129
- error: string;
130
- };
131
- pageHeader: {
132
- title: string;
133
- };
134
- popconfirm: {
135
- confirmButtonText: string;
136
- cancelButtonText: string;
137
- };
138
- };
139
- }) => {
140
- lang: Ref<string>;
141
- locale: Ref<{
142
- name: string;
143
- el: {
144
- colorpicker: {
145
- confirm: string;
146
- clear: string;
147
- };
148
- datepicker: {
149
- now: string;
150
- today: string;
151
- cancel: string;
152
- clear: string;
153
- confirm: string;
154
- selectDate: string;
155
- selectTime: string;
156
- startDate: string;
157
- startTime: string;
158
- endDate: string;
159
- endTime: string;
160
- prevYear: string;
161
- nextYear: string;
162
- prevMonth: string;
163
- nextMonth: string;
164
- year: string;
165
- month1: string;
166
- month2: string;
167
- month3: string;
168
- month4: string;
169
- month5: string;
170
- month6: string;
171
- month7: string;
172
- month8: string;
173
- month9: string;
174
- month10: string;
175
- month11: string;
176
- month12: string;
177
- week: string;
178
- weeks: {
179
- sun: string;
180
- mon: string;
181
- tue: string;
182
- wed: string;
183
- thu: string;
184
- fri: string;
185
- sat: string;
186
- };
187
- months: {
188
- jan: string;
189
- feb: string;
190
- mar: string;
191
- apr: string;
192
- may: string;
193
- jun: string;
194
- jul: string;
195
- aug: string;
196
- sep: string;
197
- oct: string;
198
- nov: string;
199
- dec: string;
200
- };
201
- };
202
- select: {
203
- loading: string;
204
- noMatch: string;
205
- noData: string;
206
- placeholder: string;
207
- };
208
- cascader: {
209
- noMatch: string;
210
- loading: string;
211
- placeholder: string;
212
- noData: string;
213
- };
214
- pagination: {
215
- goto: string;
216
- pagesize: string;
217
- total: string;
218
- pageClassifier: string;
219
- deprecationWarning: string;
220
- };
221
- messagebox: {
222
- title: string;
223
- confirm: string;
224
- cancel: string;
225
- error: string;
226
- };
227
- upload: {
228
- deleteTip: string;
229
- delete: string;
230
- preview: string;
231
- continue: string;
232
- };
233
- table: {
234
- emptyText: string;
235
- confirmFilter: string;
236
- resetFilter: string;
237
- clearFilter: string;
238
- sumText: string;
239
- };
240
- tree: {
241
- emptyText: string;
242
- };
243
- transfer: {
244
- noMatch: string;
245
- noData: string;
246
- titles: string[];
247
- filterPlaceholder: string;
248
- noCheckedFormat: string;
249
- hasCheckedFormat: string;
250
- };
251
- image: {
252
- error: string;
253
- };
254
- pageHeader: {
255
- title: string;
256
- };
257
- popconfirm: {
258
- confirmButtonText: string;
259
- cancelButtonText: string;
260
- };
261
- };
262
- }>;
263
- t: Translator;
264
- };
13
+ export declare const buildLocaleContext: (locale: MaybeRef<Language>) => LocaleContext;
265
14
  export declare const useLocale: () => LocaleContext;
@@ -5,56 +5,33 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var get = require('lodash/get');
7
7
  var en = require('../../locale/lang/en.js');
8
- var props = require('../../utils/props.js');
8
+ var index = require('../use-global-config/index.js');
9
9
 
10
10
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
11
 
12
12
  var get__default = /*#__PURE__*/_interopDefaultLegacy(get);
13
13
 
14
- const useLocaleProps = props.buildProps({
15
- locale: {
16
- type: props.definePropType(Object)
17
- }
18
- });
19
- const localeContextKey = Symbol("localeContextKey");
20
- let cache;
21
- const provideLocale = () => {
22
- const vm = vue.getCurrentInstance();
23
- const props = vm.props;
24
- const locale = vue.computed(() => props.locale || en["default"]);
25
- const lang = vue.computed(() => locale.value.name);
26
- const t = buildTranslator(locale);
27
- const provides = {
28
- locale,
29
- lang,
30
- t
31
- };
32
- cache = provides;
33
- vue.provide(localeContextKey, provides);
34
- };
35
14
  const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
36
15
  const translate = (path, option, locale) => get__default["default"](locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
37
16
  var _a;
38
17
  return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
39
18
  });
40
- const localeProviderMaker = (locale = en["default"]) => {
41
- const lang = vue.ref(locale.name);
42
- const localeRef = vue.ref(locale);
19
+ const buildLocaleContext = (locale) => {
20
+ const lang = vue.computed(() => vue.unref(locale).name);
21
+ const localeRef = vue.isRef(locale) ? locale : vue.ref(locale);
43
22
  return {
44
23
  lang,
45
24
  locale: localeRef,
46
- t: buildTranslator(localeRef)
25
+ t: buildTranslator(locale)
47
26
  };
48
27
  };
49
28
  const useLocale = () => {
50
- return vue.inject(localeContextKey, cache || localeProviderMaker(en["default"]));
29
+ const locale = index.useGlobalConfig("locale");
30
+ return buildLocaleContext(vue.computed(() => locale.value || en["default"]));
51
31
  };
52
32
 
33
+ exports.buildLocaleContext = buildLocaleContext;
53
34
  exports.buildTranslator = buildTranslator;
54
- exports.localeContextKey = localeContextKey;
55
- exports.localeProviderMaker = localeProviderMaker;
56
- exports.provideLocale = provideLocale;
57
35
  exports.translate = translate;
58
36
  exports.useLocale = useLocale;
59
- exports.useLocaleProps = useLocaleProps;
60
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-locale/index.ts"],"sourcesContent":["import { computed, getCurrentInstance, inject, provide, ref, unref } from 'vue'\nimport get from 'lodash/get'\nimport English from '@element-plus/locale/lang/en'\nimport { buildProps, definePropType } from '@element-plus/utils/props'\nimport type { MaybeRef } from '@vueuse/core'\nimport type { InjectionKey, Ref } from 'vue'\nimport type { Language } from '@element-plus/locale'\n\nexport type TranslatorOption = Record<string, string | number>\nexport type Translator = (path: string, option?: TranslatorOption) => string\nexport type LocaleContext = {\n locale: Ref<Language>\n lang: Ref<string>\n t: Translator\n}\n\nexport const useLocaleProps = buildProps({\n locale: {\n type: definePropType<Language>(Object),\n },\n})\n\nexport const localeContextKey: InjectionKey<LocaleContext> =\n Symbol('localeContextKey')\n\n// this is meant to fix global methods like `ElMessage(opts)`, this way we can inject current locale\n// into the component as default injection value.\n// refer to: https://github.com/element-plus/element-plus/issues/2610#issuecomment-887965266\nlet cache: LocaleContext\n\nexport const provideLocale = () => {\n const vm = getCurrentInstance()!\n const props = vm.props as {\n locale: Language\n }\n const locale = computed(() => props.locale || English)\n const lang = computed(() => locale.value.name)\n\n const t = buildTranslator(locale)\n const provides: LocaleContext = {\n locale,\n lang,\n t,\n }\n\n // this could be broken if someone tries to do following:\n\n /**\n * <config-provider :locale=\"lang1\">\n * <config-provider :locale=\"lang2\">\n * Something calls modal component.\n * </config-provider>\n * </config-provider>\n */\n cache = provides\n provide(localeContextKey, provides)\n}\n\nexport const buildTranslator =\n (locale: MaybeRef<Language>): Translator =>\n (path, option) =>\n translate(path, option, unref(locale))\n\nexport const translate = (\n path: string,\n option: undefined | TranslatorOption,\n locale: Language\n): string =>\n (get(locale, path, path) as string).replace(\n /\\{(\\w+)\\}/g,\n (_, key) => `${option?.[key] ?? `{${key}}`}`\n )\n\nexport const localeProviderMaker = (locale = English) => {\n const lang = ref(locale.name)\n const localeRef = ref(locale)\n return {\n lang,\n locale: localeRef,\n t: buildTranslator(localeRef),\n }\n}\n\nexport const useLocale = () => {\n return inject(localeContextKey, cache || localeProviderMaker(English))\n}\n"],"names":["buildProps","definePropType","getCurrentInstance","computed","English","provide","unref","get","ref","inject"],"mappings":";;;;;;;;;;;;;AAIY,MAAC,cAAc,GAAGA,gBAAU,CAAC;AACzC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,oBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,EAAE;AAC3D,IAAI,KAAK,CAAC;AACE,MAAC,aAAa,GAAG,MAAM;AACnC,EAAE,MAAM,EAAE,GAAGC,sBAAkB,EAAE,CAAC;AAClC,EAAE,MAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;AACzB,EAAE,MAAM,MAAM,GAAGC,YAAQ,CAAC,MAAM,KAAK,CAAC,MAAM,IAAIC,aAAO,CAAC,CAAC;AACzD,EAAE,MAAM,IAAI,GAAGD,YAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACjD,EAAE,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AACpC,EAAE,MAAM,QAAQ,GAAG;AACnB,IAAI,MAAM;AACV,IAAI,IAAI;AACR,IAAI,CAAC;AACL,GAAG,CAAC;AACJ,EAAE,KAAK,GAAG,QAAQ,CAAC;AACnB,EAAEE,WAAO,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAC;AACtC,EAAE;AACU,MAAC,eAAe,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,MAAM,EAAEC,SAAK,CAAC,MAAM,CAAC,EAAE;AACxF,MAAC,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAKC,uBAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK;AAC7G,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC,EAAE;AACS,MAAC,mBAAmB,GAAG,CAAC,MAAM,GAAGH,aAAO,KAAK;AACzD,EAAE,MAAM,IAAI,GAAGI,OAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAChC,EAAE,MAAM,SAAS,GAAGA,OAAG,CAAC,MAAM,CAAC,CAAC;AAChC,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC;AACjC,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,SAAS,GAAG,MAAM;AAC/B,EAAE,OAAOC,UAAM,CAAC,gBAAgB,EAAE,KAAK,IAAI,mBAAmB,CAACL,aAAO,CAAC,CAAC,CAAC;AACzE;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../packages/hooks/use-locale/index.ts"],"sourcesContent":["import { computed, ref, unref, isRef } from 'vue'\nimport get from 'lodash/get'\nimport English from '@element-plus/locale/lang/en'\nimport { useGlobalConfig } from '../use-global-config'\nimport type { MaybeRef } from '@vueuse/core'\nimport type { Ref } from 'vue'\nimport type { Language } from '@element-plus/locale'\n\nexport type TranslatorOption = Record<string, string | number>\nexport type Translator = (path: string, option?: TranslatorOption) => string\nexport type LocaleContext = {\n locale: Ref<Language>\n lang: Ref<string>\n t: Translator\n}\n\nexport const buildTranslator =\n (locale: MaybeRef<Language>): Translator =>\n (path, option) =>\n translate(path, option, unref(locale))\n\nexport const translate = (\n path: string,\n option: undefined | TranslatorOption,\n locale: Language\n): string =>\n (get(locale, path, path) as string).replace(\n /\\{(\\w+)\\}/g,\n (_, key) => `${option?.[key] ?? `{${key}}`}`\n )\n\nexport const buildLocaleContext = (\n locale: MaybeRef<Language>\n): LocaleContext => {\n const lang = computed(() => unref(locale).name)\n const localeRef = isRef(locale) ? locale : ref(locale)\n return {\n lang,\n locale: localeRef,\n t: buildTranslator(locale),\n }\n}\n\nexport const useLocale = () => {\n const locale = useGlobalConfig('locale')\n return buildLocaleContext(computed(() => locale.value || English))\n}\n"],"names":["unref","get","computed","isRef","ref","useGlobalConfig","English"],"mappings":";;;;;;;;;;;;;AAIY,MAAC,eAAe,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,MAAM,EAAEA,SAAK,CAAC,MAAM,CAAC,EAAE;AACxF,MAAC,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,KAAKC,uBAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK;AAC7G,EAAE,IAAI,EAAE,CAAC;AACT,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC,EAAE;AACS,MAAC,kBAAkB,GAAG,CAAC,MAAM,KAAK;AAC9C,EAAE,MAAM,IAAI,GAAGC,YAAQ,CAAC,MAAMF,SAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAClD,EAAE,MAAM,SAAS,GAAGG,SAAK,CAAC,MAAM,CAAC,GAAG,MAAM,GAAGC,OAAG,CAAC,MAAM,CAAC,CAAC;AACzD,EAAE,OAAO;AACT,IAAI,IAAI;AACR,IAAI,MAAM,EAAE,SAAS;AACrB,IAAI,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC;AAC9B,GAAG,CAAC;AACJ,EAAE;AACU,MAAC,SAAS,GAAG,MAAM;AAC/B,EAAE,MAAM,MAAM,GAAGC,qBAAe,CAAC,QAAQ,CAAC,CAAC;AAC3C,EAAE,OAAO,kBAAkB,CAACH,YAAQ,CAAC,MAAM,MAAM,CAAC,KAAK,IAAII,aAAO,CAAC,CAAC,CAAC;AACrE;;;;;;;"}
package/lib/index.d.ts CHANGED
@@ -3,16 +3,19 @@ export * from 'element-plus/es/components';
3
3
  export * from 'element-plus/es/directives';
4
4
  export * from 'element-plus/es/hooks';
5
5
  export * from 'element-plus/es/tokens';
6
+ export * from 'element-plus/es/utils/popup-manager';
6
7
  export { makeInstaller } from './make-installer';
7
8
  export declare const install: (app: import("vue").App<any>, options?: {
9
+ readonly locale?: unknown;
8
10
  readonly size?: unknown;
9
11
  readonly button?: unknown;
12
+ readonly message?: unknown;
10
13
  readonly zIndex?: unknown;
11
- readonly locale?: unknown;
12
14
  } & {} & {
13
15
  button?: import("element-plus/es/components").ButtonConfigContext | undefined;
14
16
  size?: import("./utils/props").BuildPropType<StringConstructor, "small" | "default" | "large", unknown> | undefined;
15
17
  locale?: import("./locale").Language | undefined;
18
+ message?: import("element-plus/es/components").MessageConfigContext | undefined;
16
19
  zIndex?: number | undefined;
17
20
  }) => void;
18
21
  export declare const version: string;
package/lib/index.js CHANGED
@@ -7,6 +7,7 @@ require('./components/index.js');
7
7
  require('./directives/index.js');
8
8
  require('./hooks/index.js');
9
9
  require('./tokens/index.js');
10
+ var popupManager = require('./utils/popup-manager.js');
10
11
  var makeInstaller = require('./make-installer.js');
11
12
  var affix = require('./components/affix/src/affix.js');
12
13
  var index = require('./components/affix/index.js');
@@ -194,6 +195,7 @@ const install = defaults["default"].install;
194
195
  const version = defaults["default"].version;
195
196
 
196
197
  exports["default"] = defaults["default"];
198
+ exports.PopupManager = popupManager.PopupManager;
197
199
  exports.makeInstaller = makeInstaller.makeInstaller;
198
200
  exports.affixEmits = affix.affixEmits;
199
201
  exports.affixProps = affix.affixProps;
@@ -246,6 +248,7 @@ exports.ElCollapseItem = index$g.ElCollapseItem;
246
248
  exports.ElCollapseTransition = index$h.ElCollapseTransition;
247
249
  exports.ElColorPicker = index$i.ElColorPicker;
248
250
  exports.configProviderProps = configProvider.configProviderProps;
251
+ exports.messageConfig = configProvider.messageConfig;
249
252
  exports.ElConfigProvider = index$j.ElConfigProvider;
250
253
  exports.ElAside = index$k.ElAside;
251
254
  exports.ElContainer = index$k.ElContainer;
@@ -438,13 +441,10 @@ exports.useFocus = index$1e.useFocus;
438
441
  exports.useFormItem = index$1f.useFormItem;
439
442
  exports.provideGlobalConfig = index$1g.provideGlobalConfig;
440
443
  exports.useGlobalConfig = index$1g.useGlobalConfig;
444
+ exports.buildLocaleContext = index$1h.buildLocaleContext;
441
445
  exports.buildTranslator = index$1h.buildTranslator;
442
- exports.localeContextKey = index$1h.localeContextKey;
443
- exports.localeProviderMaker = index$1h.localeProviderMaker;
444
- exports.provideLocale = index$1h.provideLocale;
445
446
  exports.translate = index$1h.translate;
446
447
  exports.useLocale = index$1h.useLocale;
447
- exports.useLocaleProps = index$1h.useLocaleProps;
448
448
  exports.useLockscreen = index$1i.useLockscreen;
449
449
  exports.useModal = index$1j.useModal;
450
450
  exports.createModelToggleComposable = index$1k.createModelToggleComposable;
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":["installer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMY,MAAC,OAAO,GAAGA,mBAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAGA,mBAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport * from '@element-plus/utils/popup-manager'\nexport { makeInstaller } from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n"],"names":["installer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOY,MAAC,OAAO,GAAGA,mBAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAGA,mBAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.20220107";
1
+ export declare const version = "0.0.20220108";
package/lib/version.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const version = "0.0.20220107";
5
+ const version = "0.0.20220108";
6
6
 
7
7
  exports.version = version;
8
8
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220107'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220108'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@element-plus/nightly",
3
- "version": "0.0.20220107",
3
+ "version": "0.0.20220108",
4
4
  "description": "A Component Library for Vue 3",
5
5
  "homepage": "https://element-plus.org/",
6
6
  "keywords": [
@@ -71,5 +71,5 @@
71
71
  "not ie 11",
72
72
  "not op_mini all"
73
73
  ],
74
- "gitHead": "d575eda5538d7fc334e745a2ead8000b3356e8ce"
74
+ "gitHead": "010c88b1159c4a2c84b36a6c2c55304b8cbf47c6"
75
75
  }