element-ps 1.0.14 → 1.0.17

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 (202) hide show
  1. package/dist/index.full.js +154 -137
  2. package/dist/index.full.min.js +4 -4
  3. package/dist/index.full.min.js.map +1 -1
  4. package/dist/index.full.min.mjs +4 -4
  5. package/dist/index.full.min.mjs.map +1 -1
  6. package/dist/index.full.mjs +153 -138
  7. package/es/components/descriptions/index.d.ts +14 -2
  8. package/es/components/descriptions/src/description-item.d.ts +7 -1
  9. package/es/components/descriptions/src/descriptions.type.d.ts +1 -0
  10. package/es/components/input-number/index.d.ts +2 -0
  11. package/es/components/input-number/src/input-number.vue.d.ts +2 -0
  12. package/es/components/rate/index.d.ts +75 -246
  13. package/es/components/rate/src/rate.d.ts +26 -0
  14. package/es/components/rate/src/rate.vue.d.ts +108 -0
  15. package/es/components/select-v2/index.d.ts +6 -6
  16. package/es/components/select-v2/src/defaults.d.ts +1 -1
  17. package/es/components/select-v2/src/select.vue.d.ts +3 -3
  18. package/es/index.mjs +9 -8
  19. package/es/index.mjs.map +1 -1
  20. package/es/packages/components/alert/index.mjs +2 -2
  21. package/es/packages/components/alert/src/alert.mjs +5 -34
  22. package/es/packages/components/alert/src/alert.mjs.map +1 -1
  23. package/es/packages/components/alert/src/alert.vue_vue&type=script&lang.mjs +1 -1
  24. package/es/packages/components/alert/src/alert2.mjs +34 -5
  25. package/es/packages/components/alert/src/alert2.mjs.map +1 -1
  26. package/es/packages/components/badge/index.mjs +2 -2
  27. package/es/packages/components/badge/src/badge.mjs +5 -20
  28. package/es/packages/components/badge/src/badge.mjs.map +1 -1
  29. package/es/packages/components/badge/src/badge.vue_vue&type=script&lang.mjs +1 -1
  30. package/es/packages/components/badge/src/badge2.mjs +20 -5
  31. package/es/packages/components/badge/src/badge2.mjs.map +1 -1
  32. package/es/packages/components/card/index.mjs +2 -2
  33. package/es/packages/components/card/src/card.mjs +17 -5
  34. package/es/packages/components/card/src/card.mjs.map +1 -1
  35. package/es/packages/components/card/src/card.vue_vue&type=script&lang.mjs +1 -1
  36. package/es/packages/components/card/src/card2.mjs +5 -17
  37. package/es/packages/components/card/src/card2.mjs.map +1 -1
  38. package/es/packages/components/cascader/src/index.vue_vue&type=script&lang.mjs.map +1 -1
  39. package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs +8 -6
  40. package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs.map +1 -1
  41. package/es/packages/components/descriptions/src/description-item.mjs +3 -0
  42. package/es/packages/components/descriptions/src/description-item.mjs.map +1 -1
  43. package/es/packages/components/descriptions/src/descriptions-cell.mjs +2 -1
  44. package/es/packages/components/descriptions/src/descriptions-cell.mjs.map +1 -1
  45. package/es/packages/components/divider/index.mjs +2 -2
  46. package/es/packages/components/divider/src/divider.mjs +15 -5
  47. package/es/packages/components/divider/src/divider.mjs.map +1 -1
  48. package/es/packages/components/divider/src/divider.vue_vue&type=script&lang.mjs +1 -1
  49. package/es/packages/components/divider/src/divider2.mjs +5 -15
  50. package/es/packages/components/divider/src/divider2.mjs.map +1 -1
  51. package/es/packages/components/image/index.mjs +2 -2
  52. package/es/packages/components/image/src/image.mjs +44 -5
  53. package/es/packages/components/image/src/image.mjs.map +1 -1
  54. package/es/packages/components/image/src/image.vue_vue&type=script&lang.mjs +1 -1
  55. package/es/packages/components/image/src/image2.mjs +5 -44
  56. package/es/packages/components/image/src/image2.mjs.map +1 -1
  57. package/es/packages/components/index.mjs +9 -8
  58. package/es/packages/components/index.mjs.map +1 -1
  59. package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs +4 -2
  60. package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs.map +1 -1
  61. package/es/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.mjs.map +1 -1
  62. package/es/packages/components/menu/index.mjs +4 -4
  63. package/es/packages/components/menu/src/menu-item-group.mjs +4 -5
  64. package/es/packages/components/menu/src/menu-item-group.mjs.map +1 -1
  65. package/es/packages/components/menu/src/menu-item-group.vue_vue&type=script&lang.mjs +1 -1
  66. package/es/packages/components/menu/src/menu-item-group2.mjs +5 -4
  67. package/es/packages/components/menu/src/menu-item-group2.mjs.map +1 -1
  68. package/es/packages/components/menu/src/menu-item.mjs +18 -5
  69. package/es/packages/components/menu/src/menu-item.mjs.map +1 -1
  70. package/es/packages/components/menu/src/menu-item.vue_vue&type=script&lang.mjs +1 -1
  71. package/es/packages/components/menu/src/menu-item2.mjs +5 -18
  72. package/es/packages/components/menu/src/menu-item2.mjs.map +1 -1
  73. package/es/packages/components/rate/index.mjs +6 -8
  74. package/es/packages/components/rate/index.mjs.map +1 -1
  75. package/es/packages/components/rate/src/rate.mjs +87 -0
  76. package/es/packages/components/rate/src/rate.mjs.map +1 -0
  77. package/es/packages/components/rate/src/{index.vue_vue&type=script&lang.mjs → rate.vue_vue&type=script&lang.mjs} +19 -88
  78. package/es/packages/components/rate/src/rate.vue_vue&type=script&lang.mjs.map +1 -0
  79. package/es/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.mjs → rate.vue_vue&type=template&id=38c42df6&lang.mjs} +1 -1
  80. package/es/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.mjs.map +1 -0
  81. package/es/packages/components/rate/src/rate2.mjs +7 -0
  82. package/es/packages/components/rate/src/rate2.mjs.map +1 -0
  83. package/es/packages/components/select-v2/src/defaults.mjs +1 -1
  84. package/es/packages/components/select-v2/src/defaults.mjs.map +1 -1
  85. package/es/packages/components/select-v2/src/select.vue_vue&type=script&lang.mjs.map +1 -1
  86. package/es/packages/components/select-v2/src/select.vue_vue&type=template&id=13e598a4&lang.mjs +4 -4
  87. package/es/packages/components/select-v2/src/select.vue_vue&type=template&id=13e598a4&lang.mjs.map +1 -1
  88. package/es/packages/components/select-v2/src/useSelect.mjs +8 -8
  89. package/es/packages/components/select-v2/src/useSelect.mjs.map +1 -1
  90. package/es/packages/components/tag/index.mjs +2 -2
  91. package/es/packages/components/tag/src/tag.mjs +5 -26
  92. package/es/packages/components/tag/src/tag.mjs.map +1 -1
  93. package/es/packages/components/tag/src/tag.vue_vue&type=script&lang.mjs +1 -1
  94. package/es/packages/components/tag/src/tag2.mjs +26 -5
  95. package/es/packages/components/tag/src/tag2.mjs.map +1 -1
  96. package/es/version.d.ts +1 -1
  97. package/es/version.mjs +1 -1
  98. package/es/version.mjs.map +1 -1
  99. package/lib/components/descriptions/index.d.ts +14 -2
  100. package/lib/components/descriptions/src/description-item.d.ts +7 -1
  101. package/lib/components/descriptions/src/descriptions.type.d.ts +1 -0
  102. package/lib/components/input-number/index.d.ts +2 -0
  103. package/lib/components/input-number/src/input-number.vue.d.ts +2 -0
  104. package/lib/components/rate/index.d.ts +75 -246
  105. package/lib/components/rate/src/rate.d.ts +26 -0
  106. package/lib/components/rate/src/rate.vue.d.ts +108 -0
  107. package/lib/components/select-v2/index.d.ts +6 -6
  108. package/lib/components/select-v2/src/defaults.d.ts +1 -1
  109. package/lib/components/select-v2/src/select.vue.d.ts +3 -3
  110. package/lib/index.js +11 -8
  111. package/lib/index.js.map +1 -1
  112. package/lib/packages/components/alert/index.js +2 -2
  113. package/lib/packages/components/alert/src/alert.js +5 -33
  114. package/lib/packages/components/alert/src/alert.js.map +1 -1
  115. package/lib/packages/components/alert/src/alert.vue_vue&type=script&lang.js +1 -1
  116. package/lib/packages/components/alert/src/alert2.js +33 -5
  117. package/lib/packages/components/alert/src/alert2.js.map +1 -1
  118. package/lib/packages/components/badge/index.js +2 -2
  119. package/lib/packages/components/badge/src/badge.js +5 -19
  120. package/lib/packages/components/badge/src/badge.js.map +1 -1
  121. package/lib/packages/components/badge/src/badge.vue_vue&type=script&lang.js +1 -1
  122. package/lib/packages/components/badge/src/badge2.js +19 -5
  123. package/lib/packages/components/badge/src/badge2.js.map +1 -1
  124. package/lib/packages/components/card/index.js +2 -2
  125. package/lib/packages/components/card/src/card.js +16 -5
  126. package/lib/packages/components/card/src/card.js.map +1 -1
  127. package/lib/packages/components/card/src/card.vue_vue&type=script&lang.js +1 -1
  128. package/lib/packages/components/card/src/card2.js +5 -16
  129. package/lib/packages/components/card/src/card2.js.map +1 -1
  130. package/lib/packages/components/cascader/src/index.vue_vue&type=script&lang.js.map +1 -1
  131. package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js +8 -6
  132. package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js.map +1 -1
  133. package/lib/packages/components/descriptions/src/description-item.js +3 -0
  134. package/lib/packages/components/descriptions/src/description-item.js.map +1 -1
  135. package/lib/packages/components/descriptions/src/descriptions-cell.js +2 -1
  136. package/lib/packages/components/descriptions/src/descriptions-cell.js.map +1 -1
  137. package/lib/packages/components/divider/index.js +2 -2
  138. package/lib/packages/components/divider/src/divider.js +14 -5
  139. package/lib/packages/components/divider/src/divider.js.map +1 -1
  140. package/lib/packages/components/divider/src/divider.vue_vue&type=script&lang.js +1 -1
  141. package/lib/packages/components/divider/src/divider2.js +5 -14
  142. package/lib/packages/components/divider/src/divider2.js.map +1 -1
  143. package/lib/packages/components/image/index.js +2 -2
  144. package/lib/packages/components/image/src/image.js +44 -5
  145. package/lib/packages/components/image/src/image.js.map +1 -1
  146. package/lib/packages/components/image/src/image.vue_vue&type=script&lang.js +1 -1
  147. package/lib/packages/components/image/src/image2.js +5 -44
  148. package/lib/packages/components/image/src/image2.js.map +1 -1
  149. package/lib/packages/components/index.js +11 -8
  150. package/lib/packages/components/index.js.map +1 -1
  151. package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js +4 -2
  152. package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js.map +1 -1
  153. package/lib/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.js.map +1 -1
  154. package/lib/packages/components/menu/index.js +4 -4
  155. package/lib/packages/components/menu/src/menu-item-group.js +4 -6
  156. package/lib/packages/components/menu/src/menu-item-group.js.map +1 -1
  157. package/lib/packages/components/menu/src/menu-item-group.vue_vue&type=script&lang.js +1 -1
  158. package/lib/packages/components/menu/src/menu-item-group2.js +6 -4
  159. package/lib/packages/components/menu/src/menu-item-group2.js.map +1 -1
  160. package/lib/packages/components/menu/src/menu-item.js +18 -5
  161. package/lib/packages/components/menu/src/menu-item.js.map +1 -1
  162. package/lib/packages/components/menu/src/menu-item.vue_vue&type=script&lang.js +1 -1
  163. package/lib/packages/components/menu/src/menu-item2.js +5 -18
  164. package/lib/packages/components/menu/src/menu-item2.js.map +1 -1
  165. package/lib/packages/components/rate/index.js +8 -8
  166. package/lib/packages/components/rate/index.js.map +1 -1
  167. package/lib/packages/components/rate/src/rate.js +92 -0
  168. package/lib/packages/components/rate/src/rate.js.map +1 -0
  169. package/lib/packages/components/rate/src/{index.vue_vue&type=script&lang.js → rate.vue_vue&type=script&lang.js} +19 -88
  170. package/lib/packages/components/rate/src/rate.vue_vue&type=script&lang.js.map +1 -0
  171. package/lib/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.js → rate.vue_vue&type=template&id=38c42df6&lang.js} +1 -1
  172. package/lib/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.js.map +1 -0
  173. package/lib/packages/components/rate/src/rate2.js +12 -0
  174. package/lib/packages/components/rate/src/rate2.js.map +1 -0
  175. package/lib/packages/components/select-v2/src/defaults.js +1 -1
  176. package/lib/packages/components/select-v2/src/defaults.js.map +1 -1
  177. package/lib/packages/components/select-v2/src/select.vue_vue&type=script&lang.js.map +1 -1
  178. package/lib/packages/components/select-v2/src/select.vue_vue&type=template&id=13e598a4&lang.js +4 -4
  179. package/lib/packages/components/select-v2/src/select.vue_vue&type=template&id=13e598a4&lang.js.map +1 -1
  180. package/lib/packages/components/select-v2/src/useSelect.js +8 -8
  181. package/lib/packages/components/select-v2/src/useSelect.js.map +1 -1
  182. package/lib/packages/components/tag/index.js +2 -2
  183. package/lib/packages/components/tag/src/tag.js +5 -25
  184. package/lib/packages/components/tag/src/tag.js.map +1 -1
  185. package/lib/packages/components/tag/src/tag.vue_vue&type=script&lang.js +1 -1
  186. package/lib/packages/components/tag/src/tag2.js +25 -5
  187. package/lib/packages/components/tag/src/tag2.js.map +1 -1
  188. package/lib/version.d.ts +1 -1
  189. package/lib/version.js +1 -1
  190. package/lib/version.js.map +1 -1
  191. package/package.json +1 -1
  192. package/web-types.json +1 -1
  193. package/es/components/rate/src/index.vue.d.ts +0 -141
  194. package/es/packages/components/rate/src/index.mjs +0 -7
  195. package/es/packages/components/rate/src/index.mjs.map +0 -1
  196. package/es/packages/components/rate/src/index.vue_vue&type=script&lang.mjs.map +0 -1
  197. package/es/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.mjs.map +0 -1
  198. package/lib/components/rate/src/index.vue.d.ts +0 -141
  199. package/lib/packages/components/rate/src/index.js +0 -12
  200. package/lib/packages/components/rate/src/index.js.map +0 -1
  201. package/lib/packages/components/rate/src/index.vue_vue&type=script&lang.js.map +0 -1
  202. package/lib/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.js.map +0 -1
@@ -0,0 +1,87 @@
1
+ import { StarFilled, Star } from '@element-plus/icons';
2
+ import { UPDATE_MODEL_EVENT } from '../../../utils/constants.mjs';
3
+ import { buildProps, definePropType, mutable } from '../../../utils/props.mjs';
4
+
5
+ const rateProps = buildProps({
6
+ modelValue: {
7
+ type: Number,
8
+ default: 0
9
+ },
10
+ lowThreshold: {
11
+ type: Number,
12
+ default: 2
13
+ },
14
+ highThreshold: {
15
+ type: Number,
16
+ default: 4
17
+ },
18
+ max: {
19
+ type: Number,
20
+ default: 5
21
+ },
22
+ colors: {
23
+ type: definePropType([Array, Object]),
24
+ default: () => mutable(["#F7BA2A", "#F7BA2A", "#F7BA2A"])
25
+ },
26
+ voidColor: {
27
+ type: String,
28
+ default: "#C6D1DE"
29
+ },
30
+ disabledVoidColor: {
31
+ type: String,
32
+ default: "#EFF2F7"
33
+ },
34
+ icons: {
35
+ type: definePropType([Array, Object]),
36
+ default: () => [StarFilled, StarFilled, StarFilled]
37
+ },
38
+ voidIcon: {
39
+ type: definePropType([String, Object]),
40
+ default: () => Star
41
+ },
42
+ disabledvoidIcon: {
43
+ type: definePropType([String, Object]),
44
+ default: () => StarFilled
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: false
49
+ },
50
+ allowHalf: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ showText: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ showScore: {
59
+ type: Boolean,
60
+ default: false
61
+ },
62
+ textColor: {
63
+ type: String,
64
+ default: "#1f2d3d"
65
+ },
66
+ texts: {
67
+ type: definePropType([Array]),
68
+ default: () => mutable([
69
+ "Extremely bad",
70
+ "Disappointed",
71
+ "Fair",
72
+ "Satisfied",
73
+ "Surprise"
74
+ ])
75
+ },
76
+ scoreTemplate: {
77
+ type: String,
78
+ default: "{value}"
79
+ }
80
+ });
81
+ const rateEmits = {
82
+ change: (value) => typeof value === "number",
83
+ [UPDATE_MODEL_EVENT]: (value) => typeof value === "number"
84
+ };
85
+
86
+ export { rateEmits, rateProps };
87
+ //# sourceMappingURL=rate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate.mjs","sources":["../../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons'\nimport { UPDATE_MODEL_EVENT } from '@element-ps/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-ps/utils/props'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>([Array]),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n"],"names":[],"mappings":";;;;MAKa,YAAY,WAAW;AAAA,EAClC,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAM,eAAkD,CAAC,OAAO;AAAA,IAChE,SAAS,MAAM,QAAQ,CAAC,WAAW,WAAW;AAAA;AAAA,EAEhD,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM,eAEJ,CAAC,OAAO;AAAA,IACV,SAAS,MAAM,CAAC,YAAY,YAAY;AAAA;AAAA,EAE1C,UAAU;AAAA,IACR,MAAM,eAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS,MAAM;AAAA;AAAA,EAEjB,kBAAkB;AAAA,IAChB,MAAM,eAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS,MAAM;AAAA;AAAA,EAEjB,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAM,eAAyB,CAAC;AAAA,IAChC,SAAS,MACP,QAAQ;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA,EAGN,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;MAMA,YAAY;AAAA,EACvB,QAAQ,CAAC,UAAkB,OAAO,UAAU;AAAA,GAC3C,qBAAqB,CAAC,UAAkB,OAAO,UAAU;AAAA;;;;"}
@@ -3,90 +3,32 @@ import { isObject, isArray } from '@vue/shared';
3
3
  import '../../../tokens/index.mjs';
4
4
  import { PsIcon } from '../../icon/index.mjs';
5
5
  import { StarFilled, Star } from '@element-plus/icons';
6
+ import { rateProps } from './rate.mjs';
6
7
  import { elFormKey } from '../../../tokens/form.mjs';
7
8
 
9
+ function getValueFromMap(value, map) {
10
+ const isExcludedObject = (val) => isObject(val);
11
+ const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
12
+ const val = map[key];
13
+ const excluded = isExcludedObject(val) ? val.excluded : false;
14
+ return excluded ? value < key : value <= key;
15
+ }).sort((a, b) => a - b);
16
+ const matchedValue = map[matchedKeys[0]];
17
+ return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
18
+ }
8
19
  var script = defineComponent({
9
20
  name: "PsRate",
10
- components: { PsIcon, StarFilled, Star },
11
- props: {
12
- modelValue: {
13
- type: Number,
14
- default: 0
15
- },
16
- lowThreshold: {
17
- type: Number,
18
- default: 2
19
- },
20
- highThreshold: {
21
- type: Number,
22
- default: 4
23
- },
24
- max: {
25
- type: Number,
26
- default: 5
27
- },
28
- colors: {
29
- type: [Array, Object],
30
- default: () => ["#F7BA2A", "#F7BA2A", "#F7BA2A"]
31
- },
32
- voidColor: {
33
- type: String,
34
- default: "#C6D1DE"
35
- },
36
- disabledVoidColor: {
37
- type: String,
38
- default: "#EFF2F7"
39
- },
40
- icons: {
41
- type: [Array, Object],
42
- default: () => [StarFilled, StarFilled, StarFilled]
43
- },
44
- voidIcon: {
45
- type: [String, Object],
46
- default: Star
47
- },
48
- disabledvoidIcon: {
49
- type: [String, Object],
50
- default: StarFilled
51
- },
52
- disabled: {
53
- type: Boolean,
54
- default: false
55
- },
56
- allowHalf: {
57
- type: Boolean,
58
- default: false
59
- },
60
- showText: {
61
- type: Boolean,
62
- default: false
63
- },
64
- showScore: {
65
- type: Boolean,
66
- default: false
67
- },
68
- textColor: {
69
- type: String,
70
- default: "#1f2d3d"
71
- },
72
- texts: {
73
- type: Array,
74
- default: () => [
75
- "Extremely bad",
76
- "Disappointed",
77
- "Fair",
78
- "Satisfied",
79
- "Surprise"
80
- ]
81
- },
82
- scoreTemplate: {
83
- type: String,
84
- default: "{value}"
85
- }
21
+ components: {
22
+ PsIcon,
23
+ StarFilled,
24
+ Star
86
25
  },
26
+ props: rateProps,
87
27
  setup(props) {
88
28
  const elForm = inject(elFormKey, {});
89
29
  const currentValue = ref(props.modelValue);
30
+ const hoverIndex = ref(-1);
31
+ const pointerAtLeftHalf = ref(true);
90
32
  const rateDisabled = computed(() => props.disabled || elForm.disabled);
91
33
  const text = computed(() => {
92
34
  let result = "";
@@ -97,15 +39,6 @@ var script = defineComponent({
97
39
  }
98
40
  return result;
99
41
  });
100
- function getValueFromMap(value, map) {
101
- const matchedKeys = Object.keys(map).filter((key) => {
102
- const val = map[key];
103
- const excluded = isObject(val) ? val.excluded : false;
104
- return excluded ? value < key : value <= key;
105
- }).sort((a, b) => a - b);
106
- const matchedValue = map[matchedKeys[0]];
107
- return isObject(matchedValue) ? matchedValue.value || matchedValue : matchedValue || "";
108
- }
109
42
  const valueDecimal = computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
110
43
  const colorMap = computed(() => isArray(props.colors) ? {
111
44
  [props.lowThreshold]: props.colors[0],
@@ -143,7 +76,6 @@ var script = defineComponent({
143
76
  result.fill(voidComponent.value, threshold, props.max);
144
77
  return result;
145
78
  });
146
- const pointerAtLeftHalf = ref(true);
147
79
  function showDecimalIcon(item) {
148
80
  const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
149
81
  const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
@@ -155,7 +87,6 @@ var script = defineComponent({
155
87
  color: item <= currentValue.value ? activeColor.value : voidColor
156
88
  };
157
89
  }
158
- const hoverIndex = ref(-1);
159
90
  return {
160
91
  hoverIndex,
161
92
  currentValue,
@@ -171,4 +102,4 @@ var script = defineComponent({
171
102
  });
172
103
 
173
104
  export { script as default };
174
- //# sourceMappingURL=index.vue_vue&type=script&lang.mjs.map
105
+ //# sourceMappingURL=rate.vue_vue&type=script&lang.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n class=\"el-rate\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n >\n <ps-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <ps-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </ps-icon>\n </ps-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-ps/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'PsRate',\n components: {\n PsIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n setup(props) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n\n showDecimalIcon,\n getIconStyle,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;AAiDA,yBACE,OACA,KACA;AACA,QAAM,mBAAmB,CACvB,QACyD,SAAS;AAEpE,QAAM,cAAc,OAAO,KAAK,KAC7B,IAAI,CAAC,QAAQ,CAAC,KACd,OAAO,CAAC,QAAQ;AACf,UAAM,MAAM,IAAI;AAChB,UAAM,WAAW,iBAAiB,OAAO,IAAI,WAAW;AACxD,WAAO,WAAW,QAAQ,MAAM,SAAS;AAAA,KAE1C,KAAK,CAAC,GAAG,MAAM,IAAI;AACtB,QAAM,eAAe,IAAI,YAAY;AACrC,SAAQ,iBAAiB,iBAAiB,aAAa,SAAU;AAAA;AAGnE,aAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA;AAAA,EAEF,OAAO;AAAA,EACP,MAAM,OAAO;AACX,UAAM,SAAS,OAAO,WAAW;AAEjC,UAAM,eAAe,IAAI,MAAM;AAC/B,UAAM,aAAa,IAAI;AACvB,UAAM,oBAAoB,IAAI;AAE9B,UAAM,eAAe,SAAS,MAAM,MAAM,YAAY,OAAO;AAC7D,UAAM,OAAO,SAAS,MAAM;AAC1B,UAAI,SAAS;AACb,UAAI,MAAM,WAAW;AACnB,iBAAS,MAAM,cAAc,QAC3B,mBACA,aAAa,QAAQ,GAAG,MAAM,eAAe,GAAG,aAAa;AAAA,iBAEtD,MAAM,UAAU;AACzB,iBAAS,MAAM,MAAM,KAAK,KAAK,aAAa,SAAS;AAAA;AAEvD,aAAO;AAAA;AAET,UAAM,eAAe,SACnB,MAAM,MAAM,aAAa,MAAM,KAAK,MAAM,MAAM,cAAc;AAEhE,UAAM,WAAW,SAAS,MACxB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AAO,oBAAoB;AAAA;AAG7B,0BAAsB,MAAc;AAClC,YAAM,YAAY,aAAa,QAC3B,MAAM,oBACN,MAAM;AACV,aAAO;AAAA,QACL,OAAO,QAAQ,aAAa,QAAQ,YAAY,QAAQ;AAAA;AAAA;AAI5D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
@@ -48,4 +48,4 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
48
48
  }
49
49
 
50
50
  export { render };
51
- //# sourceMappingURL=index.vue_vue&type=template&id=55b4fa7d&lang.mjs.map
51
+ //# sourceMappingURL=rate.vue_vue&type=template&id=38c42df6&lang.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate.vue_vue&type=template&id=38c42df6&lang.mjs","sources":["../../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n class=\"el-rate\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n >\n <ps-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <ps-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </ps-icon>\n </ps-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-ps/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'PsRate',\n components: {\n PsIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n setup(props) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n\n showDecimalIcon,\n getIconStyle,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_createBlock"],"mappings":";;;;;sBACEA;IACE,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,iBAAe;IACf,kBAAgB;IACjB,iBAAc;AAAA,IACb,iBAAe;IAChB,UAAS;AAAA;sBAETA,8CACwB,WAAd,MAAM;0BADhBA;QAEG;AAAA,QACD,OAAM;AAAA,QACL,gCAAiB;;QAElBC;UACG,iCAAiB,oBAAe,SAC3B;AAAA,UACL,sBAAO,kBAAa;AAAA;2BAErB;0BAAAC,oCAAgB,oBAAe;YAEvB,qBAAgB,sBADxBA;;cAEG,sBAAO;cACR,OAAM;AAAA;+BAEN;8BAAAA,oCAAgB;;;;;;;;;IAKd,iBAAY,+BADpBF;;MAEE,OAAM;AAAA,MACL,+BAAgB;uBAEd;;;;;;"}
@@ -0,0 +1,7 @@
1
+ import script from './rate.vue_vue&type=script&lang.mjs';
2
+ export { default } from './rate.vue_vue&type=script&lang.mjs';
3
+ import { render } from './rate.vue_vue&type=template&id=38c42df6&lang.mjs';
4
+
5
+ script.render = render;
6
+ script.__file = "packages/components/rate/src/rate.vue";
7
+ //# sourceMappingURL=rate2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rate2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -34,7 +34,7 @@ const SelectProps = {
34
34
  loading: Boolean,
35
35
  loadingText: String,
36
36
  label: String,
37
- modelValue: [Array, String, Number, Boolean, Object],
37
+ _modelValue: [Array, String, Number, Boolean, Object],
38
38
  multiple: Boolean,
39
39
  multipleLimit: {
40
40
  type: Number,
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.mjs","sources":["../../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose } from '@element-plus/icons'\n\nimport type { PropType, Component } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { OptionType } from './select.types'\nimport type { Options } from '@element-ps/components/popper'\n\nexport const SelectProps = {\n allowCreate: Boolean,\n autocomplete: {\n type: String as PropType<'none' | 'both' | 'list' | 'inline'>,\n default: 'none',\n },\n automaticDropdown: Boolean,\n clearable: Boolean,\n clearIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: CircleClose,\n },\n collapseTags: Boolean,\n defaultFirstOption: Boolean,\n disabled: Boolean,\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n filterable: Boolean,\n filterMethod: Function,\n height: {\n type: Number,\n default: 170, // 5 items by default\n },\n itemHeight: {\n type: Number,\n default: 34,\n },\n id: String,\n loading: Boolean,\n loadingText: String,\n label: String,\n modelValue: [Array, String, Number, Boolean, Object] as PropType<\n any[] | string | number | boolean | Record<string, any> | any\n >,\n multiple: Boolean,\n multipleLimit: {\n type: Number,\n default: 0,\n },\n name: String,\n noDataText: String,\n noMatchText: String,\n remoteMethod: Function,\n reserveKeyword: Boolean,\n options: {\n type: Array as PropType<OptionType[]>,\n required: true,\n },\n placeholder: {\n type: String,\n },\n popperAppendToBody: {\n type: Boolean,\n default: true,\n },\n popperClass: {\n type: String,\n default: '',\n },\n popperOptions: {\n type: Object as PropType<Partial<Options>>,\n default: () => ({} as Partial<Options>),\n },\n remote: Boolean,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n valueKey: {\n type: String,\n default: 'value',\n },\n}\n\nexport const OptionProps = {\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: Object,\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n}\n"],"names":[],"mappings":";;;MAQa,cAAc;AAAA,EACzB,aAAa;AAAA,EACb,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,WAAW;AAAA,IACT,MAAM,CAAC,QAAQ;AAAA,IACf,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,uBAAuB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,OAAO;AAAA,EACP,YAAY,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,EAG7C,UAAU;AAAA,EACV,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,SAAS;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,aAAa;AAAA,IACX,MAAM;AAAA;AAAA,EAER,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAO;AAAA,EAElB,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA;AAAA,EAEb,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;MAIA,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA;;;;"}
1
+ {"version":3,"file":"defaults.mjs","sources":["../../../../../../../packages/components/select-v2/src/defaults.ts"],"sourcesContent":["import { isValidComponentSize } from '@element-ps/utils/validators'\nimport { CircleClose } from '@element-plus/icons'\n\nimport type { PropType, Component } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { OptionType } from './select.types'\nimport type { Options } from '@element-ps/components/popper'\n\nexport const SelectProps = {\n allowCreate: Boolean,\n autocomplete: {\n type: String as PropType<'none' | 'both' | 'list' | 'inline'>,\n default: 'none',\n },\n automaticDropdown: Boolean,\n clearable: Boolean,\n clearIcon: {\n type: [String, Object] as PropType<string | Component>,\n default: CircleClose,\n },\n collapseTags: Boolean,\n defaultFirstOption: Boolean,\n disabled: Boolean,\n estimatedOptionHeight: {\n type: Number,\n default: undefined,\n },\n filterable: Boolean,\n filterMethod: Function,\n height: {\n type: Number,\n default: 170, // 5 items by default\n },\n itemHeight: {\n type: Number,\n default: 34,\n },\n id: String,\n loading: Boolean,\n loadingText: String,\n label: String,\n _modelValue: [Array, String, Number, Boolean, Object] as PropType<\n any[] | string | number | boolean | Record<string, any> | any\n >,\n multiple: Boolean,\n multipleLimit: {\n type: Number,\n default: 0,\n },\n name: String,\n noDataText: String,\n noMatchText: String,\n remoteMethod: Function,\n reserveKeyword: Boolean,\n options: {\n type: Array as PropType<OptionType[]>,\n required: true,\n },\n placeholder: {\n type: String,\n },\n popperAppendToBody: {\n type: Boolean,\n default: true,\n },\n popperClass: {\n type: String,\n default: '',\n },\n popperOptions: {\n type: Object as PropType<Partial<Options>>,\n default: () => ({} as Partial<Options>),\n },\n remote: Boolean,\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n valueKey: {\n type: String,\n default: 'value',\n },\n}\n\nexport const OptionProps = {\n data: Array,\n disabled: Boolean,\n hovering: Boolean,\n item: Object,\n index: Number,\n style: Object,\n selected: Boolean,\n created: Boolean,\n}\n"],"names":[],"mappings":";;;MAQa,cAAc;AAAA,EACzB,aAAa;AAAA,EACb,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,WAAW;AAAA,IACT,MAAM,CAAC,QAAQ;AAAA,IACf,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,UAAU;AAAA,EACV,uBAAuB;AAAA,IACrB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,aAAa;AAAA,EACb,OAAO;AAAA,EACP,aAAa,CAAC,OAAO,QAAQ,QAAQ,SAAS;AAAA,EAG9C,UAAU;AAAA,EACV,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,EACN,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,SAAS;AAAA,IACP,MAAM;AAAA,IACN,UAAU;AAAA;AAAA,EAEZ,aAAa;AAAA,IACX,MAAM;AAAA;AAAA,EAER,oBAAoB;AAAA,IAClB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAO;AAAA,EAElB,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,WAAW;AAAA;AAAA,EAEb,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;MAIA,cAAc;AAAA,EACzB,MAAM;AAAA,EACN,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS;AAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"select.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/select-v2/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n :class=\"[selectSize ? 'el-select-v2--' + selectSize : '']\"\n class=\"el-select-v2\"\n >\n <div\n ref=\"selectionRef\"\n class=\"el-select-v2__wrapper\"\n :class=\"{\n 'is-focused': states.isComposing,\n 'is-hovering': states.comboBoxHovering,\n 'is-filterable': filterable,\n 'is-disabled': disabled,\n }\"\n >\n <div v-if=\"$slots.prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div v-if=\"multiple\" class=\"el-select-v2__selection\">\n <template v-if=\"collapseTags && modelValue.length > 0\">\n <div class=\"el-select-v2__selected-item\">\n <ps-tag\n :closable=\"!selectDisabled && !states.cachedOptions[0]?.disable\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ states.cachedOptions[0].label }}</span\n >\n </ps-tag>\n <ps-tag\n v-if=\"modelValue.length > 1\"\n :closable=\"false\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >+ {{ modelValue.length - 1 }}</span\n >\n </ps-tag>\n </div>\n </template>\n\n <template v-else>\n <div\n v-for=\"(selected, idx) in states.cachedOptions\"\n :key=\"idx\"\n class=\"el-select-v2__selected-item\"\n >\n <ps-tag\n :key=\"getValueKey(selected)\"\n :closable=\"!selectDisabled && !selected.disabled\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ getLabel(selected) }}</span\n >\n </ps-tag>\n </div>\n </template>\n <div\n class=\"el-select-v2__selected-item el-select-v2__input-wrapper\"\n :style=\"inputWrapperStyle\"\n >\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :autocomplete=\"autocomplete\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-labelledby=\"label\"\n class=\"el-select-v2__combobox-input\"\n :class=\"[selectSize ? `is-${selectSize}` : '']\"\n :disabled=\"disabled\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n >\n </span>\n </div>\n </div>\n <template v-else>\n <div class=\"el-select-v2__selected-item el-select-v2__input-wrapper\">\n <input\n :id=\"id\"\n ref=\"inputRef\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n :aria-labelledby=\"label\"\n :aria-expanded=\"expanded\"\n autocapitalize=\"off\"\n :autocomplete=\"autocomplete\"\n class=\"el-select-v2__combobox-input\"\n :disabled=\"disabled\"\n :name=\"name\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n </div>\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__selected-item el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n ></span>\n </template>\n <span\n v-if=\"shouldShowPlaceholder\"\n :class=\"{\n 'el-select-v2__placeholder': true,\n 'is-transparent':\n states.isComposing ||\n (placeholder && multiple ? modelValue.length === 0 : !modelValue),\n }\"\n >{{ currentPlaceholder }}</span\n >\n <span class=\"el-select-v2__suffix\">\n <ps-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"['el-select-v2__caret', 'el-input__icon', iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </ps-icon>\n <ps-icon\n v-if=\"showClearBtn && clearIcon\"\n class=\"el-select-v2__caret el-input__icon\"\n >\n <component :is=\"clearIcon\" />\n </ps-icon>\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, provide, toRefs, reactive } from 'vue'\nimport PsTag from '@element-ps/components/tag'\nimport useSelect from './useSelect'\nimport { selectV2InjectionKey } from './token'\nimport { SelectProps } from './defaults'\nimport PsIcon from '@element-ps/components/icon'\n\nexport default defineComponent({\n name: 'PsSelectV2',\n components: {\n PsTag,\n PsIcon\n },\n props: SelectProps,\n setup(props, { emit }) {\n const API = useSelect(props, emit)\n // TODO, remove the any cast to align the actual API.\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n }),\n } as any)\n\n return API\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAgLA,aAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AAAA,EAEF,OAAO;AAAA,EACP,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,MAAM,UAAU,OAAO;AAE7B,YAAQ,sBAAsB;AAAA,MAC5B,OAAO,SAAS;AAAA,WACX,OAAO;AAAA;AAAA;AAId,WAAO;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"select.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/select-v2/src/select.vue"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n :class=\"[selectSize ? 'el-select-v2--' + selectSize : '']\"\n class=\"el-select-v2\"\n >\n <div\n ref=\"selectionRef\"\n class=\"el-select-v2__wrapper\"\n :class=\"{\n 'is-focused': states.isComposing,\n 'is-hovering': states.comboBoxHovering,\n 'is-filterable': filterable,\n 'is-disabled': disabled,\n }\"\n >\n <div v-if=\"$slots.prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div v-if=\"multiple\" class=\"el-select-v2__selection\">\n <template v-if=\"collapseTags && _modelValue.length > 0\">\n <div class=\"el-select-v2__selected-item\">\n <ps-tag\n :closable=\"!selectDisabled && !states.cachedOptions[0]?.disable\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ states.cachedOptions[0].label }}</span\n >\n </ps-tag>\n <ps-tag\n v-if=\"_modelValue.length > 1\"\n :closable=\"false\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >+ {{ _modelValue.length - 1 }}</span\n >\n </ps-tag>\n </div>\n </template>\n\n <template v-else>\n <div\n v-for=\"(selected, idx) in states.cachedOptions\"\n :key=\"idx\"\n class=\"el-select-v2__selected-item\"\n >\n <ps-tag\n :key=\"getValueKey(selected)\"\n :closable=\"!selectDisabled && !selected.disabled\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ getLabel(selected) }}</span\n >\n </ps-tag>\n </div>\n </template>\n <div\n class=\"el-select-v2__selected-item el-select-v2__input-wrapper\"\n :style=\"inputWrapperStyle\"\n >\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :autocomplete=\"autocomplete\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-labelledby=\"label\"\n class=\"el-select-v2__combobox-input\"\n :class=\"[selectSize ? `is-${selectSize}` : '']\"\n :disabled=\"disabled\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n >\n </span>\n </div>\n </div>\n <template v-else>\n <div class=\"el-select-v2__selected-item el-select-v2__input-wrapper\">\n <input\n :id=\"id\"\n ref=\"inputRef\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n :aria-labelledby=\"label\"\n :aria-expanded=\"expanded\"\n autocapitalize=\"off\"\n :autocomplete=\"autocomplete\"\n class=\"el-select-v2__combobox-input\"\n :disabled=\"disabled\"\n :name=\"name\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n </div>\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__selected-item el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n ></span>\n </template>\n <span\n v-if=\"shouldShowPlaceholder\"\n :class=\"{\n 'el-select-v2__placeholder': true,\n 'is-transparent':\n states.isComposing ||\n (placeholder && multiple ? _modelValue.length === 0 : !_modelValue),\n }\"\n >{{ currentPlaceholder }}</span\n >\n <span class=\"el-select-v2__suffix\">\n <ps-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"['el-select-v2__caret', 'el-input__icon', iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </ps-icon>\n <ps-icon\n v-if=\"showClearBtn && clearIcon\"\n class=\"el-select-v2__caret el-input__icon\"\n >\n <component :is=\"clearIcon\" />\n </ps-icon>\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, provide, toRefs, reactive } from 'vue'\nimport PsTag from '@element-ps/components/tag'\nimport useSelect from './useSelect'\nimport { selectV2InjectionKey } from './token'\nimport { SelectProps } from './defaults'\nimport PsIcon from '@element-ps/components/icon'\n\nexport default defineComponent({\n name: 'PsSelectV2',\n components: {\n PsTag,\n PsIcon\n },\n props: SelectProps,\n setup(props, { emit }) {\n const API = useSelect(props, emit)\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n }),\n } as any)\n\n return API\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAgLA,aAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA,IACA;AAAA;AAAA,EAEF,OAAO;AAAA,EACP,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,MAAM,UAAU,OAAO;AAC7B,YAAQ,sBAAsB;AAAA,MAC5B,OAAO,SAAS;AAAA,WACX,OAAO;AAAA;AAAA;AAId,WAAO;AAAA;AAAA;;;;"}
@@ -36,7 +36,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
36
36
  renderSlot(_ctx.$slots, "prefix")
37
37
  ])) : createCommentVNode("v-if", true),
38
38
  _ctx.multiple ? (openBlock(), createElementBlock("div", _hoisted_2, [
39
- _ctx.collapseTags && _ctx.modelValue.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
39
+ _ctx.collapseTags && _ctx._modelValue.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3, [
40
40
  createVNode(_component_ps_tag, {
41
41
  closable: !_ctx.selectDisabled && !((_a = _ctx.states.cachedOptions[0]) == null ? void 0 : _a.disable),
42
42
  size: _ctx.collapseTagSize,
@@ -53,7 +53,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
53
53
  ]),
54
54
  _: 1
55
55
  }, 8, ["closable", "size"]),
56
- _ctx.modelValue.length > 1 ? (openBlock(), createBlock(_component_ps_tag, {
56
+ _ctx._modelValue.length > 1 ? (openBlock(), createBlock(_component_ps_tag, {
57
57
  key: 0,
58
58
  closable: false,
59
59
  size: _ctx.collapseTagSize,
@@ -66,7 +66,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
66
66
  style: normalizeStyle({
67
67
  maxWidth: `${_ctx.tagMaxWidth}px`
68
68
  })
69
- }, "+ " + toDisplayString(_ctx.modelValue.length - 1), 5)
69
+ }, "+ " + toDisplayString(_ctx._modelValue.length - 1), 5)
70
70
  ]),
71
71
  _: 1
72
72
  }, 8, ["size"])) : createCommentVNode("v-if", true)
@@ -157,7 +157,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
157
157
  key: 3,
158
158
  class: normalizeClass({
159
159
  "el-select-v2__placeholder": true,
160
- "is-transparent": _ctx.states.isComposing || (_ctx.placeholder && _ctx.multiple ? _ctx.modelValue.length === 0 : !_ctx.modelValue)
160
+ "is-transparent": _ctx.states.isComposing || (_ctx.placeholder && _ctx.multiple ? _ctx._modelValue.length === 0 : !_ctx._modelValue)
161
161
  })
162
162
  }, toDisplayString(_ctx.currentPlaceholder), 3)) : createCommentVNode("v-if", true),
163
163
  createElementVNode("span", _hoisted_9, [
@@ -1 +1 @@
1
- {"version":3,"file":"select.vue_vue&type=template&id=13e598a4&lang.mjs","sources":["../../../../../../../packages/components/select-v2/src/select.vue?vue&type=template&id=13e598a4&lang.js"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n :class=\"[selectSize ? 'el-select-v2--' + selectSize : '']\"\n class=\"el-select-v2\"\n >\n <div\n ref=\"selectionRef\"\n class=\"el-select-v2__wrapper\"\n :class=\"{\n 'is-focused': states.isComposing,\n 'is-hovering': states.comboBoxHovering,\n 'is-filterable': filterable,\n 'is-disabled': disabled,\n }\"\n >\n <div v-if=\"$slots.prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div v-if=\"multiple\" class=\"el-select-v2__selection\">\n <template v-if=\"collapseTags && modelValue.length > 0\">\n <div class=\"el-select-v2__selected-item\">\n <ps-tag\n :closable=\"!selectDisabled && !states.cachedOptions[0]?.disable\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ states.cachedOptions[0].label }}</span\n >\n </ps-tag>\n <ps-tag\n v-if=\"modelValue.length > 1\"\n :closable=\"false\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >+ {{ modelValue.length - 1 }}</span\n >\n </ps-tag>\n </div>\n </template>\n\n <template v-else>\n <div\n v-for=\"(selected, idx) in states.cachedOptions\"\n :key=\"idx\"\n class=\"el-select-v2__selected-item\"\n >\n <ps-tag\n :key=\"getValueKey(selected)\"\n :closable=\"!selectDisabled && !selected.disabled\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ getLabel(selected) }}</span\n >\n </ps-tag>\n </div>\n </template>\n <div\n class=\"el-select-v2__selected-item el-select-v2__input-wrapper\"\n :style=\"inputWrapperStyle\"\n >\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :autocomplete=\"autocomplete\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-labelledby=\"label\"\n class=\"el-select-v2__combobox-input\"\n :class=\"[selectSize ? `is-${selectSize}` : '']\"\n :disabled=\"disabled\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n >\n </span>\n </div>\n </div>\n <template v-else>\n <div class=\"el-select-v2__selected-item el-select-v2__input-wrapper\">\n <input\n :id=\"id\"\n ref=\"inputRef\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n :aria-labelledby=\"label\"\n :aria-expanded=\"expanded\"\n autocapitalize=\"off\"\n :autocomplete=\"autocomplete\"\n class=\"el-select-v2__combobox-input\"\n :disabled=\"disabled\"\n :name=\"name\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n </div>\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__selected-item el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n ></span>\n </template>\n <span\n v-if=\"shouldShowPlaceholder\"\n :class=\"{\n 'el-select-v2__placeholder': true,\n 'is-transparent':\n states.isComposing ||\n (placeholder && multiple ? modelValue.length === 0 : !modelValue),\n }\"\n >{{ currentPlaceholder }}</span\n >\n <span class=\"el-select-v2__suffix\">\n <ps-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"['el-select-v2__caret', 'el-input__icon', iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </ps-icon>\n <ps-icon\n v-if=\"showClearBtn && clearIcon\"\n class=\"el-select-v2__caret el-input__icon\"\n >\n <component :is=\"clearIcon\" />\n </ps-icon>\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, provide, toRefs, reactive } from 'vue'\nimport PsTag from '@element-ps/components/tag'\nimport useSelect from './useSelect'\nimport { selectV2InjectionKey } from './token'\nimport { SelectProps } from './defaults'\nimport PsIcon from '@element-ps/components/icon'\n\nexport default defineComponent({\n name: 'PsSelectV2',\n components: {\n PsTag,\n PsIcon\n },\n props: SelectProps,\n setup(props, { emit }) {\n const API = useSelect(props, emit)\n // TODO, remove the any cast to align the actual API.\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n }),\n } as any)\n\n return API\n },\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","_renderSlot","_createVNode","_createBlock","_toDisplayString"],"mappings":";;;;;EAmB2B,OAAM;AAAA;;;EAElB,OAAM;AAAA;;;qBA0FR,OAAM;;;qBAsCP,OAAM;;;;;sBApJhBA;IACE,KAAI;AAAA,IACH,wBAAQ,qCAAgC,uBACnC;AAAA;IAENC;MACE,KAAI;AAAA,MACJ,uBAAM;;;;;;;MAQK,YAAO,uBAAlBD;QACEE;;MAES,8BAAXF,0BAAA;QACkB,qBAAgB,gBAAW,2BACzCA,0BAAA;UACEG;YACG,WAAW,2CAA0B,qBAAP,mBAAyB;AAAA,YACvD,MAAM;YACP,MAAK;AAAA,YACL,uBAAA;AAAA;6BAEA;cAAAF;gBACE,OAAM;AAAA,gBACL;;;iCAGG,YAAO,iBAAiB;;;;UAIxB,gBAAW,2BADnBG;;YAEG,UAAU;AAAA,YACV,MAAM;YACP,MAAK;AAAA,YACL,uBAAA;AAAA;6BAEA;cAAAH;gBAC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;0BAAAA,oCAAgB;;;;;;;;;;;"}
1
+ {"version":3,"file":"select.vue_vue&type=template&id=13e598a4&lang.mjs","sources":["../../../../../../../packages/components/select-v2/src/select.vue?vue&type=template&id=13e598a4&lang.js"],"sourcesContent":["<template>\n <div\n ref=\"selectRef\"\n :class=\"[selectSize ? 'el-select-v2--' + selectSize : '']\"\n class=\"el-select-v2\"\n >\n <div\n ref=\"selectionRef\"\n class=\"el-select-v2__wrapper\"\n :class=\"{\n 'is-focused': states.isComposing,\n 'is-hovering': states.comboBoxHovering,\n 'is-filterable': filterable,\n 'is-disabled': disabled,\n }\"\n >\n <div v-if=\"$slots.prefix\">\n <slot name=\"prefix\"></slot>\n </div>\n <div v-if=\"multiple\" class=\"el-select-v2__selection\">\n <template v-if=\"collapseTags && _modelValue.length > 0\">\n <div class=\"el-select-v2__selected-item\">\n <ps-tag\n :closable=\"!selectDisabled && !states.cachedOptions[0]?.disable\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ states.cachedOptions[0].label }}</span\n >\n </ps-tag>\n <ps-tag\n v-if=\"_modelValue.length > 1\"\n :closable=\"false\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >+ {{ _modelValue.length - 1 }}</span\n >\n </ps-tag>\n </div>\n </template>\n\n <template v-else>\n <div\n v-for=\"(selected, idx) in states.cachedOptions\"\n :key=\"idx\"\n class=\"el-select-v2__selected-item\"\n >\n <ps-tag\n :key=\"getValueKey(selected)\"\n :closable=\"!selectDisabled && !selected.disabled\"\n :size=\"collapseTagSize\"\n type=\"info\"\n disable-transitions\n >\n <span\n class=\"el-select-v2__tags-text\"\n :style=\"{\n maxWidth: `${tagMaxWidth}px`,\n }\"\n >{{ getLabel(selected) }}</span\n >\n </ps-tag>\n </div>\n </template>\n <div\n class=\"el-select-v2__selected-item el-select-v2__input-wrapper\"\n :style=\"inputWrapperStyle\"\n >\n <input\n :id=\"id\"\n ref=\"inputRef\"\n :autocomplete=\"autocomplete\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n autocapitalize=\"off\"\n :aria-expanded=\"expanded\"\n :aria-labelledby=\"label\"\n class=\"el-select-v2__combobox-input\"\n :class=\"[selectSize ? `is-${selectSize}` : '']\"\n :disabled=\"disabled\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :name=\"name\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n >\n </span>\n </div>\n </div>\n <template v-else>\n <div class=\"el-select-v2__selected-item el-select-v2__input-wrapper\">\n <input\n :id=\"id\"\n ref=\"inputRef\"\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n :aria-labelledby=\"label\"\n :aria-expanded=\"expanded\"\n autocapitalize=\"off\"\n :autocomplete=\"autocomplete\"\n class=\"el-select-v2__combobox-input\"\n :disabled=\"disabled\"\n :name=\"name\"\n role=\"combobox\"\n :readonly=\"!filterable\"\n spellcheck=\"false\"\n type=\"text\"\n :unselectable=\"expanded ? 'on' : undefined\"\n />\n </div>\n <span\n v-if=\"filterable\"\n ref=\"calculatorRef\"\n aria-hidden=\"true\"\n class=\"el-select-v2__selected-item el-select-v2__input-calculator\"\n v-text=\"states.displayInputValue\"\n ></span>\n </template>\n <span\n v-if=\"shouldShowPlaceholder\"\n :class=\"{\n 'el-select-v2__placeholder': true,\n 'is-transparent':\n states.isComposing ||\n (placeholder && multiple ? _modelValue.length === 0 : !_modelValue),\n }\"\n >{{ currentPlaceholder }}</span\n >\n <span class=\"el-select-v2__suffix\">\n <ps-icon\n v-if=\"iconComponent\"\n v-show=\"!showClearBtn\"\n :class=\"['el-select-v2__caret', 'el-input__icon', iconReverse]\"\n >\n <component :is=\"iconComponent\" />\n </ps-icon>\n <ps-icon\n v-if=\"showClearBtn && clearIcon\"\n class=\"el-select-v2__caret el-input__icon\"\n >\n <component :is=\"clearIcon\" />\n </ps-icon>\n </span>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, provide, toRefs, reactive } from 'vue'\nimport PsTag from '@element-ps/components/tag'\nimport useSelect from './useSelect'\nimport { selectV2InjectionKey } from './token'\nimport { SelectProps } from './defaults'\nimport PsIcon from '@element-ps/components/icon'\n\nexport default defineComponent({\n name: 'PsSelectV2',\n components: {\n PsTag,\n PsIcon\n },\n props: SelectProps,\n setup(props, { emit }) {\n const API = useSelect(props, emit)\n provide(selectV2InjectionKey, {\n props: reactive({\n ...toRefs(props),\n }),\n } as any)\n\n return API\n },\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","_renderSlot","_createVNode","_createBlock","_toDisplayString"],"mappings":";;;;;EAmB2B,OAAM;AAAA;;;EAElB,OAAM;AAAA;;;qBA0FR,OAAM;;;qBAsCP,OAAM;;;;;sBApJhBA;IACE,KAAI;AAAA,IACH,wBAAQ,qCAAgC,uBACnC;AAAA;IAENC;MACE,KAAI;AAAA,MACJ,uBAAM;;;;;;;MAQK,YAAO,uBAAlBD;QACEE;;MAES,8BAAXF,0BAAA;QACkB,qBAAgB,iBAAY,2BAC1CA,0BAAA;UACEG;YACG,WAAW,2CAA0B,qBAAP,mBAAyB;AAAA,YACvD,MAAM;YACP,MAAK;AAAA,YACL,uBAAA;AAAA;6BAEA;cAAAF;gBACE,OAAM;AAAA,gBACL;;;iCAGG,YAAO,iBAAiB;;;;UAIxB,iBAAY,2BADpBG;;YAEG,UAAU;AAAA,YACV,MAAM;YACP,MAAK;AAAA,YACL,uBAAA;AAAA;6BAEA;cAAAH;gBACE,OAAM;AAAA,gBACL;;;iBAGA,uBAAK,iBAAY;;;;gCAOx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useSelect = (props) => {
51
51
  const expanded = ref(false);
52
52
  const selectDisabled = computed(() => props.disabled || elForm.disabled);
53
53
  const showClearBtn = computed(() => {
54
- const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : props.modelValue !== void 0 && props.modelValue !== null && props.modelValue !== "";
54
+ const hasValue = props.multiple ? Array.isArray(props._modelValue) && props._modelValue.length > 0 : props._modelValue !== void 0 && props._modelValue !== null && props._modelValue !== "";
55
55
  const criteria = props.clearable && !selectDisabled.value && states.comboBoxHovering && hasValue;
56
56
  return criteria;
57
57
  });
@@ -98,8 +98,8 @@ const useSelect = (props) => {
98
98
  };
99
99
  });
100
100
  const shouldShowPlaceholder = computed(() => {
101
- if (isArray(props.modelValue)) {
102
- return props.modelValue.length === 0 && !states.displayInputValue;
101
+ if (isArray(props._modelValue)) {
102
+ return props._modelValue.length === 0 && !states.displayInputValue;
103
103
  }
104
104
  return props.filterable ? states.displayInputValue.length === 0 : true;
105
105
  });
@@ -109,10 +109,10 @@ const useSelect = (props) => {
109
109
  });
110
110
  const initStates = () => {
111
111
  if (props.multiple) {
112
- if (props.modelValue.length > 0) {
112
+ if (props._modelValue.length > 0) {
113
113
  let initHovering = false;
114
114
  states.cachedOptions.length = 0;
115
- props.modelValue.map((selected) => {
115
+ props._modelValue.map((selected) => {
116
116
  const itemIndex = filteredOptions.value.findIndex((option) => option.value === selected);
117
117
  if (~itemIndex) {
118
118
  states.cachedOptions.push(filteredOptions.value[itemIndex]);
@@ -123,13 +123,13 @@ const useSelect = (props) => {
123
123
  states.cachedOptions = [];
124
124
  }
125
125
  } else {
126
- if (props.modelValue) {
126
+ if (props._modelValue) {
127
127
  const options = filteredOptions.value;
128
- const selectedItemIndex = options.findIndex((o) => o.value === props.modelValue);
128
+ const selectedItemIndex = options.findIndex((o) => o.value === props._modelValue);
129
129
  if (~selectedItemIndex) {
130
130
  states.selectedLabel = options[selectedItemIndex].label;
131
131
  } else {
132
- states.selectedLabel = `${props.modelValue}`;
132
+ states.selectedLabel = `${props._modelValue}`;
133
133
  }
134
134
  } else {
135
135
  states.selectedLabel = "";
@@ -1 +1 @@
1
- {"version":3,"file":"useSelect.mjs","sources":["../../../../../../../packages/components/select-v2/src/useSelect.ts"],"sourcesContent":["import { computed, ref, reactive, inject, onMounted } from 'vue'\nimport { isArray } from '@vue/shared'\nimport { ArrowUp } from '@element-plus/icons'\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { flattenOptions } from './util'\nimport type { SelectProps } from './defaults'\nimport type { ExtractPropTypes, CSSProperties } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type { OptionType, Option } from './select.types'\n\nconst DEFAULT_INPUT_PLACEHOLDER = ''\nconst MINIMUM_INPUT_WIDTH = 11\nconst TAG_BASE_WIDTH = {\n small: 42,\n mini: 33,\n}\n\nconst useSelect = (props: ExtractPropTypes<typeof SelectProps>) => {\n // inject\n const { t } = useLocaleInject()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n const $ELEMENT = useGlobalConfig()\n\n const states = reactive({\n inputValue: DEFAULT_INPUT_PLACEHOLDER,\n displayInputValue: DEFAULT_INPUT_PLACEHOLDER,\n calculatedWidth: 0,\n cachedPlaceholder: '',\n cachedOptions: [] as Option[],\n createdOptions: [] as Option[],\n createdLabel: '',\n createdSelected: false,\n currentPlaceholder: '',\n hoveringIndex: -1,\n comboBoxHovering: false,\n isOnComposition: false,\n isSilentBlur: false,\n isComposing: false,\n inputLength: 20,\n selectWidth: 200,\n initialInputHeight: 0,\n previousQuery: null,\n previousValue: '',\n query: '',\n selectedLabel: '',\n softFocus: false,\n tagInMultiLine: false,\n })\n\n // DOM & Component refs\n const inputRef = ref(null) // el-input ref\n const selectRef = ref(null)\n const selectionRef = ref(null) // tags ref\n const calculatorRef = ref<HTMLElement>(null as any as HTMLElement)\n\n // the controller of the expanded popup\n const expanded = ref(false)\n\n const selectDisabled = computed(() => props.disabled || elForm.disabled)\n\n const showClearBtn = computed(() => {\n const hasValue = props.multiple\n ? Array.isArray(props.modelValue) && props.modelValue.length > 0\n : props.modelValue !== undefined &&\n props.modelValue !== null &&\n props.modelValue !== ''\n\n const criteria =\n props.clearable &&\n !selectDisabled.value &&\n states.comboBoxHovering &&\n hasValue\n return criteria\n })\n\n const iconComponent = computed(() =>\n props.remote && props.filterable ? '' : ArrowUp\n )\n\n const iconReverse = computed(() =>\n iconComponent.value && expanded.value ? 'is-reverse' : ''\n )\n\n const filteredOptions = computed(() => {\n const isValidOption = (o: Option): boolean => {\n // fill the conditions here.\n const query = states.inputValue\n // when query was given, we should test on the label see whether the label contains the given query\n const containsQueryString = query ? o.label.includes(query) : true\n return containsQueryString\n }\n if (props.loading) {\n return []\n }\n return flattenOptions(\n (props.options as OptionType[])\n .concat(states.createdOptions)\n .map((v) => {\n if (isArray(v.options)) {\n const filtered = v.options.filter(isValidOption)\n if (filtered.length > 0) {\n return {\n ...v,\n options: filtered,\n }\n }\n } else {\n if (props.remote || isValidOption(v as Option)) {\n return v\n }\n }\n return null\n })\n .filter((v) => v !== null) as any\n )\n })\n\n const selectSize = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n\n const collapseTagSize = computed(() =>\n ['small', 'mini'].indexOf(selectSize.value) > -1 ? 'mini' : 'small'\n )\n\n const tagMaxWidth = computed(() => {\n const select = selectionRef.value\n const size = collapseTagSize.value\n const paddingLeft = select\n ? parseInt(getComputedStyle(select).paddingLeft)\n : 0\n const paddingRight = select\n ? parseInt(getComputedStyle(select).paddingRight)\n : 0\n return (\n states.selectWidth - paddingRight - paddingLeft - TAG_BASE_WIDTH[size]\n )\n })\n\n const inputWrapperStyle = computed(() => {\n return {\n width: `${\n states.calculatedWidth === 0\n ? MINIMUM_INPUT_WIDTH\n : Math.ceil(states.calculatedWidth) + MINIMUM_INPUT_WIDTH\n }px`,\n } as CSSProperties\n })\n\n const shouldShowPlaceholder = computed(() => {\n if (isArray(props.modelValue)) {\n return props.modelValue.length === 0 && !states.displayInputValue\n }\n\n // when it's not multiple mode, we only determine this flag based on filterable and expanded\n // when filterable flag is true, which means we have input box on the screen\n return props.filterable ? states.displayInputValue.length === 0 : true\n })\n\n const currentPlaceholder = computed(() => {\n const _placeholder = props.placeholder || t('el.select.placeholder')\n return props.multiple ? _placeholder : states.selectedLabel || _placeholder\n })\n\n const initStates = () => {\n if (props.multiple) {\n if ((props.modelValue as Array<any>).length > 0) {\n let initHovering = false\n states.cachedOptions.length = 0\n ;(props.modelValue as Array<any>).map((selected) => {\n const itemIndex = filteredOptions.value.findIndex(\n (option) => (option as any).value === selected\n )\n if (~itemIndex) {\n states.cachedOptions.push(\n filteredOptions.value[itemIndex] as Option\n )\n initHovering = true\n }\n })\n } else {\n states.cachedOptions = []\n }\n } else {\n if (props.modelValue) {\n const options = filteredOptions.value\n const selectedItemIndex = options.findIndex(\n (o) => (o as any).value === props.modelValue\n )\n if (~selectedItemIndex) {\n states.selectedLabel = (options[selectedItemIndex] as any).label\n } else {\n states.selectedLabel = `${props.modelValue}`\n }\n } else {\n states.selectedLabel = ''\n }\n }\n }\n\n onMounted(() => {\n initStates()\n })\n\n return {\n // data exports\n collapseTagSize,\n currentPlaceholder,\n expanded,\n iconComponent,\n iconReverse,\n inputWrapperStyle,\n // readonly,\n shouldShowPlaceholder,\n selectDisabled,\n selectSize,\n showClearBtn,\n states,\n tagMaxWidth,\n\n // refs items exports\n calculatorRef,\n inputRef,\n selectRef,\n selectionRef,\n }\n}\n\nexport default useSelect\n"],"names":[],"mappings":";;;;;;;;;;AAYA,MAAM,4BAA4B;AAClC,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,MAAM;AAAA;MAGF,YAAY,CAAC,UAAgD;AAEjE,QAAM,EAAE,MAAM;AACd,QAAM,SAAS,OAAO,WAAW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ClB,UAAK,MAAM,WAA0B,SAAS,GAAG;AAC/C,YAAI,eAAe;AACnB,eAAO,cAAc,SAAS;AAC7B,QAAC,MAAM,WAA0B,IAAI,CAAC,aAAa;AAClD,gBAAM,YAAY,gBAAgB,MAAM,UACtC,CAAC,WAAY,OAAe,UAAU;AAExC,cAAI,CAAC,WAAW;AACd,mBAAO,cAAc,KACnB,gBAAgB,MAAM;AAExB,2BAAe;AAAA;AAAA;AAAA,aAGd;AACL,eAAO,gBAAgB;AAAA;AAAA,WAEpB;AACL,UAAI,MAAM,YAAY;AACpB,cAAM,UAAU,gBAAgB;AAChC,cAAM,oBAAoB,QAAQ,UAChC,CAAC,MAAO,EAAU,UAAU,MAAM;AAEpC,YAAI,CAAC,mBAAmB;AACtB,iBAAO,gBAAiB,QAAQ,mBAA2B;AAAA,eACtD;AACL,iBAAO,gBAAgB,GAAG,MAAM;AAAA;AAAA,aAE7B;AACL,eAAO,gBAAgB;AAAA;AAAA;AAAA;AAK7B,YAAU,MAAM;AACd;AAAA;AAGF,SAAO;AAAA,IAEL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"useSelect.mjs","sources":["../../../../../../../packages/components/select-v2/src/useSelect.ts"],"sourcesContent":["import { computed, ref, reactive, inject, onMounted } from 'vue'\nimport { isArray } from '@vue/shared'\nimport { ArrowUp } from '@element-plus/icons'\nimport { elFormKey, elFormItemKey } from '@element-ps/tokens'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { useGlobalConfig } from '@element-ps/utils/util'\nimport { flattenOptions } from './util'\nimport type { SelectProps } from './defaults'\nimport type { ExtractPropTypes, CSSProperties } from 'vue'\nimport type { ElFormContext, ElFormItemContext } from '@element-ps/tokens'\nimport type { OptionType, Option } from './select.types'\n\nconst DEFAULT_INPUT_PLACEHOLDER = ''\nconst MINIMUM_INPUT_WIDTH = 11\nconst TAG_BASE_WIDTH = {\n small: 42,\n mini: 33,\n}\n\nconst useSelect = (props: ExtractPropTypes<typeof SelectProps>) => {\n // inject\n const { t } = useLocaleInject()\n const elForm = inject(elFormKey, {} as ElFormContext)\n const elFormItem = inject(elFormItemKey, {} as ElFormItemContext)\n const $ELEMENT = useGlobalConfig()\n\n const states = reactive({\n inputValue: DEFAULT_INPUT_PLACEHOLDER,\n displayInputValue: DEFAULT_INPUT_PLACEHOLDER,\n calculatedWidth: 0,\n cachedPlaceholder: '',\n cachedOptions: [] as Option[],\n createdOptions: [] as Option[],\n createdLabel: '',\n createdSelected: false,\n currentPlaceholder: '',\n hoveringIndex: -1,\n comboBoxHovering: false,\n isOnComposition: false,\n isSilentBlur: false,\n isComposing: false,\n inputLength: 20,\n selectWidth: 200,\n initialInputHeight: 0,\n previousQuery: null,\n previousValue: '',\n query: '',\n selectedLabel: '',\n softFocus: false,\n tagInMultiLine: false,\n })\n\n // DOM & Component refs\n const inputRef = ref(null) // el-input ref\n const selectRef = ref(null)\n const selectionRef = ref(null) // tags ref\n const calculatorRef = ref<HTMLElement>(null as any as HTMLElement)\n\n // the controller of the expanded popup\n const expanded = ref(false)\n\n const selectDisabled = computed(() => props.disabled || elForm.disabled)\n\n const showClearBtn = computed(() => {\n const hasValue = props.multiple\n ? Array.isArray(props._modelValue) && props._modelValue.length > 0\n : props._modelValue !== undefined &&\n props._modelValue !== null &&\n props._modelValue !== ''\n\n const criteria =\n props.clearable &&\n !selectDisabled.value &&\n states.comboBoxHovering &&\n hasValue\n return criteria\n })\n\n const iconComponent = computed(() =>\n props.remote && props.filterable ? '' : ArrowUp\n )\n\n const iconReverse = computed(() =>\n iconComponent.value && expanded.value ? 'is-reverse' : ''\n )\n\n const filteredOptions = computed(() => {\n const isValidOption = (o: Option): boolean => {\n // fill the conditions here.\n const query = states.inputValue\n // when query was given, we should test on the label see whether the label contains the given query\n const containsQueryString = query ? o.label.includes(query) : true\n return containsQueryString\n }\n if (props.loading) {\n return []\n }\n return flattenOptions(\n (props.options as OptionType[])\n .concat(states.createdOptions)\n .map((v) => {\n if (isArray(v.options)) {\n const filtered = v.options.filter(isValidOption)\n if (filtered.length > 0) {\n return {\n ...v,\n options: filtered,\n }\n }\n } else {\n if (props.remote || isValidOption(v as Option)) {\n return v\n }\n }\n return null\n })\n .filter((v) => v !== null) as any\n )\n })\n\n const selectSize = computed(\n () => props.size || elFormItem.size || $ELEMENT.size\n )\n\n const collapseTagSize = computed(() =>\n ['small', 'mini'].indexOf(selectSize.value) > -1 ? 'mini' : 'small'\n )\n\n const tagMaxWidth = computed(() => {\n const select = selectionRef.value\n const size = collapseTagSize.value\n const paddingLeft = select\n ? parseInt(getComputedStyle(select).paddingLeft)\n : 0\n const paddingRight = select\n ? parseInt(getComputedStyle(select).paddingRight)\n : 0\n return (\n states.selectWidth - paddingRight - paddingLeft - TAG_BASE_WIDTH[size]\n )\n })\n\n const inputWrapperStyle = computed(() => {\n return {\n width: `${\n states.calculatedWidth === 0\n ? MINIMUM_INPUT_WIDTH\n : Math.ceil(states.calculatedWidth) + MINIMUM_INPUT_WIDTH\n }px`,\n } as CSSProperties\n })\n\n const shouldShowPlaceholder = computed(() => {\n if (isArray(props._modelValue)) {\n return props._modelValue.length === 0 && !states.displayInputValue\n }\n\n // when it's not multiple mode, we only determine this flag based on filterable and expanded\n // when filterable flag is true, which means we have input box on the screen\n return props.filterable ? states.displayInputValue.length === 0 : true\n })\n\n const currentPlaceholder = computed(() => {\n const _placeholder = props.placeholder || t('el.select.placeholder')\n return props.multiple ? _placeholder : states.selectedLabel || _placeholder\n })\n\n const initStates = () => {\n if (props.multiple) {\n if ((props._modelValue as Array<any>).length > 0) {\n let initHovering = false\n states.cachedOptions.length = 0\n ;(props._modelValue as Array<any>).map((selected) => {\n const itemIndex = filteredOptions.value.findIndex(\n (option) => (option as any).value === selected\n )\n if (~itemIndex) {\n states.cachedOptions.push(\n filteredOptions.value[itemIndex] as Option\n )\n initHovering = true\n }\n })\n } else {\n states.cachedOptions = []\n }\n } else {\n if (props._modelValue) {\n const options = filteredOptions.value\n const selectedItemIndex = options.findIndex(\n (o) => (o as any).value === props._modelValue\n )\n if (~selectedItemIndex) {\n states.selectedLabel = (options[selectedItemIndex] as any).label\n } else {\n states.selectedLabel = `${props._modelValue}`\n }\n } else {\n states.selectedLabel = ''\n }\n }\n }\n\n onMounted(() => {\n initStates()\n })\n\n return {\n // data exports\n collapseTagSize,\n currentPlaceholder,\n expanded,\n iconComponent,\n iconReverse,\n inputWrapperStyle,\n // readonly,\n shouldShowPlaceholder,\n selectDisabled,\n selectSize,\n showClearBtn,\n states,\n tagMaxWidth,\n\n // refs items exports\n calculatorRef,\n inputRef,\n selectRef,\n selectionRef,\n }\n}\n\nexport default useSelect\n"],"names":[],"mappings":";;;;;;;;;;AAYA,MAAM,4BAA4B;AAClC,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AAAA,EACrB,OAAO;AAAA,EACP,MAAM;AAAA;MAGF,YAAY,CAAC,UAAgD;AAEjE,QAAM,EAAE,MAAM;AACd,QAAM,SAAS,OAAO,WAAW;AACjC,QAAM,aAAa,OAAO,eAAe;AACzC,QAAM,WAAW;AAEjB,QAAM,SAAS,SAAS;AAAA,IACtB,YAAY;AAAA,IACZ,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,eAAe;AAAA,IACf,gBAAgB;AAAA,IAChB,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,oBAAoB;AAAA,IACpB,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,iBAAiB;AAAA,IACjB,cAAc;AAAA,IACd,aAAa;AAAA,IACb,aAAa;AAAA,IACb,aAAa;AAAA,IACb,oBAAoB;AAAA,IACpB,eAAe;AAAA,IACf,eAAe;AAAA,IACf,OAAO;AAAA,IACP,eAAe;AAAA,IACf,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AACtB,iBAAO,gBAAiB,QAAQ,mBAA2B;AAAA,eACtD;AACL,iBAAO,gBAAgB,GAAG,MAAM;AAAA;AAAA,aAE7B;AACL,eAAO,gBAAgB;AAAA;AAAA;AAAA;AAK7B,YAAU,MAAM;AACd;AAAA;AAGF,SAAO;AAAA,IAEL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAGA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { withInstall } from '../../utils/with-install.mjs';
2
- import './src/tag2.mjs';
3
- export { tagProps } from './src/tag.mjs';
2
+ import './src/tag.mjs';
3
+ export { tagProps } from './src/tag2.mjs';
4
4
  import script from './src/tag.vue_vue&type=script&lang.mjs';
5
5
 
6
6
  const PsTag = withInstall(script);
@@ -1,28 +1,7 @@
1
- import { buildProps } from '../../../utils/props.mjs';
1
+ import script from './tag.vue_vue&type=script&lang.mjs';
2
+ export { default } from './tag.vue_vue&type=script&lang.mjs';
3
+ import { render } from './tag.vue_vue&type=template&id=525996c5&lang.mjs';
2
4
 
3
- const tagProps = buildProps({
4
- closable: Boolean,
5
- type: {
6
- type: String,
7
- values: ["success", "info", "warning", "danger", ""],
8
- default: ""
9
- },
10
- hit: Boolean,
11
- disableTransitions: Boolean,
12
- color: {
13
- type: String,
14
- default: ""
15
- },
16
- size: {
17
- type: String,
18
- values: ["large", "medium", "small", "mini"]
19
- },
20
- effect: {
21
- type: String,
22
- values: ["dark", "light", "plain"],
23
- default: "light"
24
- }
25
- });
26
-
27
- export { tagProps };
5
+ script.render = render;
6
+ script.__file = "packages/components/tag/src/tag.vue";
28
7
  //# sourceMappingURL=tag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag.mjs","sources":["../../../../../../../packages/components/tag/src/tag.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const tagProps = buildProps({\n closable: Boolean,\n type: {\n type: String,\n values: ['success', 'info', 'warning', 'danger', ''],\n default: '',\n },\n hit: Boolean,\n disableTransitions: Boolean,\n color: {\n type: String,\n default: '',\n },\n size: {\n type: String,\n values: ['large', 'medium', 'small', 'mini'],\n },\n effect: {\n type: String,\n values: ['dark', 'light', 'plain'],\n default: 'light',\n },\n} as const)\nexport type TagProps = ExtractPropTypes<typeof tagProps>\n"],"names":[],"mappings":";;MAIa,WAAW,WAAW;AAAA,EACjC,UAAU;AAAA,EACV,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,WAAW,QAAQ,WAAW,UAAU;AAAA,IACjD,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,EACL,oBAAoB;AAAA,EACpB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,SAAS,UAAU,SAAS;AAAA;AAAA,EAEvC,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,CAAC,QAAQ,SAAS;AAAA,IAC1B,SAAS;AAAA;AAAA;;;;"}
1
+ {"version":3,"file":"tag.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -2,7 +2,7 @@ import { defineComponent, computed } from 'vue';
2
2
  import { PsIcon } from '../../icon/index.mjs';
3
3
  import { useGlobalConfig } from '../../../utils/util.mjs';
4
4
  import { Close } from '@element-plus/icons';
5
- import { tagProps } from './tag.mjs';
5
+ import { tagProps } from './tag2.mjs';
6
6
 
7
7
  var script = defineComponent({
8
8
  name: "PsTag",