context.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { computed, inject, provide } from 'vue';
  2. export var GlobalFormContextKey = Symbol('GlobalFormContextKey');
  3. export var useProvideGlobalForm = function useProvideGlobalForm(state) {
  4. provide(GlobalFormContextKey, state);
  5. };
  6. export var useInjectGlobalForm = function useInjectGlobalForm() {
  7. return inject(GlobalFormContextKey, {
  8. validateMessages: computed(function () {
  9. return undefined;
  10. })
  11. });
  12. };
  13. export var GlobalConfigContextKey = Symbol('GlobalConfigContextKey');
  14. export var configProviderProps = function configProviderProps() {
  15. return {
  16. getTargetContainer: {
  17. type: Function
  18. },
  19. getPopupContainer: {
  20. type: Function
  21. },
  22. prefixCls: String,
  23. getPrefixCls: {
  24. type: Function
  25. },
  26. renderEmpty: {
  27. type: Function
  28. },
  29. transformCellText: {
  30. type: Function
  31. },
  32. csp: {
  33. type: Object,
  34. default: undefined
  35. },
  36. input: {
  37. type: Object
  38. },
  39. autoInsertSpaceInButton: {
  40. type: Boolean,
  41. default: undefined
  42. },
  43. locale: {
  44. type: Object,
  45. default: undefined
  46. },
  47. pageHeader: {
  48. type: Object
  49. },
  50. componentSize: {
  51. type: String
  52. },
  53. direction: {
  54. type: String
  55. },
  56. space: {
  57. type: Object
  58. },
  59. virtual: {
  60. type: Boolean,
  61. default: undefined
  62. },
  63. dropdownMatchSelectWidth: {
  64. type: [Number, Boolean],
  65. default: true
  66. },
  67. form: {
  68. type: Object,
  69. default: undefined
  70. },
  71. // internal use
  72. notUpdateGlobalConfig: Boolean
  73. };
  74. };