context.js 2.0 KB

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