0afcdc670237df79ad64c3b064385e641ba9373cd27d8122196dc8b3c4912d554f73d5ec65051d29260f5f68566ef8a4a502415e89c4282ed60f03ba8f0fba 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var helper = require('./helper.js');
  4. var runtime = require('../../../utils/vue/props/runtime.js');
  5. var input = require('../../input/src/input.js');
  6. var shared = require('@vue/shared');
  7. var event = require('../../../constants/event.js');
  8. const mentionProps = runtime.buildProps({
  9. ...input.inputProps,
  10. options: {
  11. type: runtime.definePropType(Array),
  12. default: () => []
  13. },
  14. prefix: {
  15. type: runtime.definePropType([String, Array]),
  16. default: "@",
  17. validator: (val) => {
  18. if (shared.isString(val))
  19. return val.length === 1;
  20. return val.every((v) => shared.isString(v) && v.length === 1);
  21. }
  22. },
  23. split: {
  24. type: String,
  25. default: " ",
  26. validator: (val) => val.length === 1
  27. },
  28. filterOption: {
  29. type: runtime.definePropType([Boolean, Function]),
  30. default: () => helper.filterOption,
  31. validator: (val) => {
  32. if (val === false)
  33. return true;
  34. return shared.isFunction(val);
  35. }
  36. },
  37. placement: {
  38. type: runtime.definePropType(String),
  39. default: "bottom"
  40. },
  41. showArrow: Boolean,
  42. offset: {
  43. type: Number,
  44. default: 0
  45. },
  46. whole: Boolean,
  47. checkIsWhole: {
  48. type: runtime.definePropType(Function)
  49. },
  50. modelValue: String,
  51. loading: Boolean,
  52. popperClass: {
  53. type: String,
  54. default: ""
  55. },
  56. popperOptions: {
  57. type: runtime.definePropType(Object),
  58. default: () => ({})
  59. },
  60. props: {
  61. type: runtime.definePropType(Object),
  62. default: () => mentionDefaultProps
  63. }
  64. });
  65. const mentionEmits = {
  66. [event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
  67. "whole-remove": (pattern, prefix) => shared.isString(pattern) && shared.isString(prefix),
  68. input: (value) => shared.isString(value),
  69. search: (pattern, prefix) => shared.isString(pattern) && shared.isString(prefix),
  70. select: (option, prefix) => shared.isObject(option) && shared.isString(prefix),
  71. focus: (evt) => evt instanceof FocusEvent,
  72. blur: (evt) => evt instanceof FocusEvent
  73. };
  74. const mentionDefaultProps = {
  75. value: "value",
  76. label: "label",
  77. disabled: "disabled"
  78. };
  79. exports.mentionDefaultProps = mentionDefaultProps;
  80. exports.mentionEmits = mentionEmits;
  81. exports.mentionProps = mentionProps;
  82. //# sourceMappingURL=mention.js.map