e468201d3de3c5c086227fd0a2e55ac2131346879c8f88945dd97d55e9da9a3e8befb0cc6eb4b415a59bb284f445e37771ae51a9d755e3ed39993d35866e63 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. import { placements } from '@popperjs/core';
  2. import { CircleClose, ArrowDown } from '@element-plus/icons-vue';
  3. import { defaultProps } from '../../select-v2/src/useProps.mjs';
  4. import { scrollbarEmits } from '../../scrollbar/src/scrollbar.mjs';
  5. import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
  6. import { useSizeProp } from '../../../hooks/use-size/index.mjs';
  7. import { useTooltipContentProps } from '../../tooltip/src/content.mjs';
  8. import { iconPropType } from '../../../utils/vue/icon.mjs';
  9. import { tagProps } from '../../tag/src/tag.mjs';
  10. import { useEmptyValuesProps } from '../../../hooks/use-empty-values/index.mjs';
  11. import { useAriaProps } from '../../../hooks/use-aria/index.mjs';
  12. import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '../../../constants/event.mjs';
  13. const selectProps = buildProps({
  14. name: String,
  15. id: String,
  16. modelValue: {
  17. type: definePropType([
  18. Array,
  19. String,
  20. Number,
  21. Boolean,
  22. Object
  23. ]),
  24. default: void 0
  25. },
  26. autocomplete: {
  27. type: String,
  28. default: "off"
  29. },
  30. automaticDropdown: Boolean,
  31. size: useSizeProp,
  32. effect: {
  33. type: definePropType(String),
  34. default: "light"
  35. },
  36. disabled: Boolean,
  37. clearable: Boolean,
  38. filterable: Boolean,
  39. allowCreate: Boolean,
  40. loading: Boolean,
  41. popperClass: {
  42. type: String,
  43. default: ""
  44. },
  45. popperStyle: {
  46. type: definePropType([String, Object])
  47. },
  48. popperOptions: {
  49. type: definePropType(Object),
  50. default: () => ({})
  51. },
  52. remote: Boolean,
  53. loadingText: String,
  54. noMatchText: String,
  55. noDataText: String,
  56. remoteMethod: {
  57. type: definePropType(Function)
  58. },
  59. filterMethod: {
  60. type: definePropType(Function)
  61. },
  62. multiple: Boolean,
  63. multipleLimit: {
  64. type: Number,
  65. default: 0
  66. },
  67. placeholder: {
  68. type: String
  69. },
  70. defaultFirstOption: Boolean,
  71. reserveKeyword: {
  72. type: Boolean,
  73. default: true
  74. },
  75. valueKey: {
  76. type: String,
  77. default: "value"
  78. },
  79. collapseTags: Boolean,
  80. collapseTagsTooltip: Boolean,
  81. maxCollapseTags: {
  82. type: Number,
  83. default: 1
  84. },
  85. teleported: useTooltipContentProps.teleported,
  86. persistent: {
  87. type: Boolean,
  88. default: true
  89. },
  90. clearIcon: {
  91. type: iconPropType,
  92. default: CircleClose
  93. },
  94. fitInputWidth: Boolean,
  95. suffixIcon: {
  96. type: iconPropType,
  97. default: ArrowDown
  98. },
  99. tagType: { ...tagProps.type, default: "info" },
  100. tagEffect: { ...tagProps.effect, default: "light" },
  101. validateEvent: {
  102. type: Boolean,
  103. default: true
  104. },
  105. remoteShowSuffix: Boolean,
  106. showArrow: {
  107. type: Boolean,
  108. default: true
  109. },
  110. offset: {
  111. type: Number,
  112. default: 12
  113. },
  114. placement: {
  115. type: definePropType(String),
  116. values: placements,
  117. default: "bottom-start"
  118. },
  119. fallbackPlacements: {
  120. type: definePropType(Array),
  121. default: ["bottom-start", "top-start", "right", "left"]
  122. },
  123. tabindex: {
  124. type: [String, Number],
  125. default: 0
  126. },
  127. appendTo: useTooltipContentProps.appendTo,
  128. options: {
  129. type: definePropType(Array)
  130. },
  131. props: {
  132. type: definePropType(Object),
  133. default: () => defaultProps
  134. },
  135. ...useEmptyValuesProps,
  136. ...useAriaProps(["ariaLabel"])
  137. });
  138. const selectEmits = {
  139. [UPDATE_MODEL_EVENT]: (val) => true,
  140. [CHANGE_EVENT]: (val) => true,
  141. "popup-scroll": scrollbarEmits.scroll,
  142. "remove-tag": (val) => true,
  143. "visible-change": (visible) => true,
  144. focus: (evt) => evt instanceof FocusEvent,
  145. blur: (evt) => evt instanceof FocusEvent,
  146. clear: () => true
  147. };
  148. export { selectEmits, selectProps };
  149. //# sourceMappingURL=select.mjs.map