@progress/kendo-vue-dropdowns 5.3.0-dev.202410141143 → 5.3.0-develop.2

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 (273) hide show
  1. package/AutoComplete/AutoComplete.js +8 -0
  2. package/AutoComplete/AutoComplete.mjs +526 -0
  3. package/ComboBox/ComboBox.js +8 -0
  4. package/ComboBox/ComboBox.mjs +776 -0
  5. package/DropDownList/DropDownList.js +8 -0
  6. package/DropDownList/DropDownList.mjs +781 -0
  7. package/DropDownTree/DropDownTree.js +8 -0
  8. package/DropDownTree/DropDownTree.mjs +709 -0
  9. package/DropDownTree/ListNoData.js +8 -0
  10. package/DropDownTree/ListNoData.mjs +21 -0
  11. package/MultiSelect/MultiSelect.js +8 -0
  12. package/MultiSelect/MultiSelect.mjs +872 -0
  13. package/MultiSelect/TagList.js +8 -0
  14. package/MultiSelect/TagList.mjs +119 -0
  15. package/MultiSelectTree/MultiSelectTree.js +8 -0
  16. package/MultiSelectTree/MultiSelectTree.mjs +759 -0
  17. package/MultiSelectTree/utils.js +8 -0
  18. package/MultiSelectTree/utils.mjs +73 -0
  19. package/README.md +28 -43
  20. package/common/ClearButton.js +8 -0
  21. package/common/ClearButton.mjs +54 -0
  22. package/common/DropDownBase.js +8 -0
  23. package/common/DropDownBase.mjs +193 -0
  24. package/common/GroupStickyHeader.js +8 -0
  25. package/common/GroupStickyHeader.mjs +38 -0
  26. package/common/List.js +8 -0
  27. package/common/List.mjs +139 -0
  28. package/common/ListContainer.js +8 -0
  29. package/common/ListContainer.mjs +103 -0
  30. package/common/ListDefaultItem.js +8 -0
  31. package/common/ListDefaultItem.mjs +47 -0
  32. package/common/ListFilter.js +8 -0
  33. package/common/ListFilter.mjs +147 -0
  34. package/common/ListGroupItem.js +8 -0
  35. package/common/ListGroupItem.mjs +46 -0
  36. package/common/ListItem.js +8 -0
  37. package/common/ListItem.mjs +73 -0
  38. package/common/Navigation.js +8 -0
  39. package/common/Navigation.mjs +28 -0
  40. package/common/SearchBar.js +8 -0
  41. package/common/SearchBar.mjs +129 -0
  42. package/common/VirtualScroll.js +8 -0
  43. package/common/VirtualScroll.mjs +95 -0
  44. package/common/constants.js +8 -0
  45. package/common/constants.mjs +12 -0
  46. package/common/settings.js +8 -0
  47. package/common/settings.mjs +11 -0
  48. package/common/utils.js +8 -0
  49. package/common/utils.mjs +104 -0
  50. package/dist/cdn/js/kendo-vue-dropdowns.js +8 -1
  51. package/index.d.mts +4037 -0
  52. package/index.d.ts +4037 -0
  53. package/index.js +8 -0
  54. package/index.mjs +25 -0
  55. package/messages/main.js +8 -0
  56. package/messages/main.mjs +26 -0
  57. package/package-metadata.js +8 -0
  58. package/package-metadata.mjs +18 -0
  59. package/package.json +24 -58
  60. package/dist/es/AutoComplete/AutoComplete.d.ts +0 -107
  61. package/dist/es/AutoComplete/AutoComplete.js +0 -825
  62. package/dist/es/AutoComplete/AutoCompleteProps.d.ts +0 -234
  63. package/dist/es/AutoComplete/AutoCompleteProps.js +0 -2
  64. package/dist/es/ComboBox/ComboBox.d.ts +0 -99
  65. package/dist/es/ComboBox/ComboBox.js +0 -1315
  66. package/dist/es/ComboBox/ComboBoxProps.d.ts +0 -277
  67. package/dist/es/ComboBox/ComboBoxProps.js +0 -2
  68. package/dist/es/DropDownList/DropDownList.d.ts +0 -103
  69. package/dist/es/DropDownList/DropDownList.js +0 -1314
  70. package/dist/es/DropDownList/DropDownListProps.d.ts +0 -307
  71. package/dist/es/DropDownList/DropDownListProps.js +0 -2
  72. package/dist/es/DropDownTree/DropDownTree.d.ts +0 -49
  73. package/dist/es/DropDownTree/DropDownTree.js +0 -1090
  74. package/dist/es/DropDownTree/DropDownTreeProps.d.ts +0 -301
  75. package/dist/es/DropDownTree/DropDownTreeProps.js +0 -2
  76. package/dist/es/DropDownTree/ListNoData.d.ts +0 -42
  77. package/dist/es/DropDownTree/ListNoData.js +0 -32
  78. package/dist/es/MultiSelect/MultiSelect.d.ts +0 -115
  79. package/dist/es/MultiSelect/MultiSelect.js +0 -1515
  80. package/dist/es/MultiSelect/MultiSelectProps.d.ts +0 -290
  81. package/dist/es/MultiSelect/MultiSelectProps.js +0 -2
  82. package/dist/es/MultiSelect/TagList.d.ts +0 -54
  83. package/dist/es/MultiSelect/TagList.js +0 -176
  84. package/dist/es/MultiSelectTree/MultiSelectTree.d.ts +0 -48
  85. package/dist/es/MultiSelectTree/MultiSelectTree.js +0 -1220
  86. package/dist/es/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -322
  87. package/dist/es/MultiSelectTree/MultiSelectTreeProps.js +0 -2
  88. package/dist/es/MultiSelectTree/utils.d.ts +0 -17
  89. package/dist/es/MultiSelectTree/utils.js +0 -109
  90. package/dist/es/additionalTypes.ts +0 -21
  91. package/dist/es/common/ClearButton.d.ts +0 -21
  92. package/dist/es/common/ClearButton.js +0 -73
  93. package/dist/es/common/DropDownBase.d.ts +0 -95
  94. package/dist/es/common/DropDownBase.js +0 -298
  95. package/dist/es/common/GroupStickyHeader.d.ts +0 -32
  96. package/dist/es/common/GroupStickyHeader.js +0 -60
  97. package/dist/es/common/List.d.ts +0 -60
  98. package/dist/es/common/List.js +0 -201
  99. package/dist/es/common/ListContainer.d.ts +0 -40
  100. package/dist/es/common/ListContainer.js +0 -161
  101. package/dist/es/common/ListDefaultItem.d.ts +0 -29
  102. package/dist/es/common/ListDefaultItem.js +0 -60
  103. package/dist/es/common/ListFilter.d.ts +0 -49
  104. package/dist/es/common/ListFilter.js +0 -175
  105. package/dist/es/common/ListGroupItem.d.ts +0 -41
  106. package/dist/es/common/ListGroupItem.js +0 -71
  107. package/dist/es/common/ListItem.d.ts +0 -71
  108. package/dist/es/common/ListItem.js +0 -101
  109. package/dist/es/common/Navigation.d.ts +0 -12
  110. package/dist/es/common/Navigation.js +0 -34
  111. package/dist/es/common/SearchBar.d.ts +0 -66
  112. package/dist/es/common/SearchBar.js +0 -177
  113. package/dist/es/common/VirtualScroll.d.ts +0 -42
  114. package/dist/es/common/VirtualScroll.js +0 -163
  115. package/dist/es/common/constants.d.ts +0 -4
  116. package/dist/es/common/constants.js +0 -4
  117. package/dist/es/common/events.d.ts +0 -63
  118. package/dist/es/common/events.js +0 -1
  119. package/dist/es/common/filterDescriptor.d.ts +0 -41
  120. package/dist/es/common/filterDescriptor.js +0 -2
  121. package/dist/es/common/settings.d.ts +0 -107
  122. package/dist/es/common/settings.js +0 -8
  123. package/dist/es/common/utils.d.ts +0 -70
  124. package/dist/es/common/utils.js +0 -202
  125. package/dist/es/main.d.ts +0 -18
  126. package/dist/es/main.js +0 -10
  127. package/dist/es/messages/main.d.ts +0 -40
  128. package/dist/es/messages/main.js +0 -41
  129. package/dist/es/package-metadata.d.ts +0 -5
  130. package/dist/es/package-metadata.js +0 -11
  131. package/dist/esm/AutoComplete/AutoComplete.d.ts +0 -107
  132. package/dist/esm/AutoComplete/AutoComplete.js +0 -825
  133. package/dist/esm/AutoComplete/AutoCompleteProps.d.ts +0 -234
  134. package/dist/esm/AutoComplete/AutoCompleteProps.js +0 -2
  135. package/dist/esm/ComboBox/ComboBox.d.ts +0 -99
  136. package/dist/esm/ComboBox/ComboBox.js +0 -1315
  137. package/dist/esm/ComboBox/ComboBoxProps.d.ts +0 -277
  138. package/dist/esm/ComboBox/ComboBoxProps.js +0 -2
  139. package/dist/esm/DropDownList/DropDownList.d.ts +0 -103
  140. package/dist/esm/DropDownList/DropDownList.js +0 -1314
  141. package/dist/esm/DropDownList/DropDownListProps.d.ts +0 -307
  142. package/dist/esm/DropDownList/DropDownListProps.js +0 -2
  143. package/dist/esm/DropDownTree/DropDownTree.d.ts +0 -49
  144. package/dist/esm/DropDownTree/DropDownTree.js +0 -1090
  145. package/dist/esm/DropDownTree/DropDownTreeProps.d.ts +0 -301
  146. package/dist/esm/DropDownTree/DropDownTreeProps.js +0 -2
  147. package/dist/esm/DropDownTree/ListNoData.d.ts +0 -42
  148. package/dist/esm/DropDownTree/ListNoData.js +0 -32
  149. package/dist/esm/MultiSelect/MultiSelect.d.ts +0 -115
  150. package/dist/esm/MultiSelect/MultiSelect.js +0 -1515
  151. package/dist/esm/MultiSelect/MultiSelectProps.d.ts +0 -290
  152. package/dist/esm/MultiSelect/MultiSelectProps.js +0 -2
  153. package/dist/esm/MultiSelect/TagList.d.ts +0 -54
  154. package/dist/esm/MultiSelect/TagList.js +0 -176
  155. package/dist/esm/MultiSelectTree/MultiSelectTree.d.ts +0 -48
  156. package/dist/esm/MultiSelectTree/MultiSelectTree.js +0 -1220
  157. package/dist/esm/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -322
  158. package/dist/esm/MultiSelectTree/MultiSelectTreeProps.js +0 -2
  159. package/dist/esm/MultiSelectTree/utils.d.ts +0 -17
  160. package/dist/esm/MultiSelectTree/utils.js +0 -109
  161. package/dist/esm/additionalTypes.ts +0 -21
  162. package/dist/esm/common/ClearButton.d.ts +0 -21
  163. package/dist/esm/common/ClearButton.js +0 -73
  164. package/dist/esm/common/DropDownBase.d.ts +0 -95
  165. package/dist/esm/common/DropDownBase.js +0 -298
  166. package/dist/esm/common/GroupStickyHeader.d.ts +0 -32
  167. package/dist/esm/common/GroupStickyHeader.js +0 -60
  168. package/dist/esm/common/List.d.ts +0 -60
  169. package/dist/esm/common/List.js +0 -201
  170. package/dist/esm/common/ListContainer.d.ts +0 -40
  171. package/dist/esm/common/ListContainer.js +0 -161
  172. package/dist/esm/common/ListDefaultItem.d.ts +0 -29
  173. package/dist/esm/common/ListDefaultItem.js +0 -60
  174. package/dist/esm/common/ListFilter.d.ts +0 -49
  175. package/dist/esm/common/ListFilter.js +0 -175
  176. package/dist/esm/common/ListGroupItem.d.ts +0 -41
  177. package/dist/esm/common/ListGroupItem.js +0 -71
  178. package/dist/esm/common/ListItem.d.ts +0 -71
  179. package/dist/esm/common/ListItem.js +0 -101
  180. package/dist/esm/common/Navigation.d.ts +0 -12
  181. package/dist/esm/common/Navigation.js +0 -34
  182. package/dist/esm/common/SearchBar.d.ts +0 -66
  183. package/dist/esm/common/SearchBar.js +0 -177
  184. package/dist/esm/common/VirtualScroll.d.ts +0 -42
  185. package/dist/esm/common/VirtualScroll.js +0 -163
  186. package/dist/esm/common/constants.d.ts +0 -4
  187. package/dist/esm/common/constants.js +0 -4
  188. package/dist/esm/common/events.d.ts +0 -63
  189. package/dist/esm/common/events.js +0 -1
  190. package/dist/esm/common/filterDescriptor.d.ts +0 -41
  191. package/dist/esm/common/filterDescriptor.js +0 -2
  192. package/dist/esm/common/settings.d.ts +0 -107
  193. package/dist/esm/common/settings.js +0 -8
  194. package/dist/esm/common/utils.d.ts +0 -70
  195. package/dist/esm/common/utils.js +0 -202
  196. package/dist/esm/main.d.ts +0 -18
  197. package/dist/esm/main.js +0 -10
  198. package/dist/esm/messages/main.d.ts +0 -40
  199. package/dist/esm/messages/main.js +0 -41
  200. package/dist/esm/package-metadata.d.ts +0 -5
  201. package/dist/esm/package-metadata.js +0 -11
  202. package/dist/esm/package.json +0 -3
  203. package/dist/npm/AutoComplete/AutoComplete.d.ts +0 -107
  204. package/dist/npm/AutoComplete/AutoComplete.js +0 -832
  205. package/dist/npm/AutoComplete/AutoCompleteProps.d.ts +0 -234
  206. package/dist/npm/AutoComplete/AutoCompleteProps.js +0 -3
  207. package/dist/npm/ComboBox/ComboBox.d.ts +0 -99
  208. package/dist/npm/ComboBox/ComboBox.js +0 -1322
  209. package/dist/npm/ComboBox/ComboBoxProps.d.ts +0 -277
  210. package/dist/npm/ComboBox/ComboBoxProps.js +0 -3
  211. package/dist/npm/DropDownList/DropDownList.d.ts +0 -103
  212. package/dist/npm/DropDownList/DropDownList.js +0 -1321
  213. package/dist/npm/DropDownList/DropDownListProps.d.ts +0 -307
  214. package/dist/npm/DropDownList/DropDownListProps.js +0 -3
  215. package/dist/npm/DropDownTree/DropDownTree.d.ts +0 -49
  216. package/dist/npm/DropDownTree/DropDownTree.js +0 -1095
  217. package/dist/npm/DropDownTree/DropDownTreeProps.d.ts +0 -301
  218. package/dist/npm/DropDownTree/DropDownTreeProps.js +0 -3
  219. package/dist/npm/DropDownTree/ListNoData.d.ts +0 -42
  220. package/dist/npm/DropDownTree/ListNoData.js +0 -39
  221. package/dist/npm/MultiSelect/MultiSelect.d.ts +0 -115
  222. package/dist/npm/MultiSelect/MultiSelect.js +0 -1522
  223. package/dist/npm/MultiSelect/MultiSelectProps.d.ts +0 -290
  224. package/dist/npm/MultiSelect/MultiSelectProps.js +0 -3
  225. package/dist/npm/MultiSelect/TagList.d.ts +0 -54
  226. package/dist/npm/MultiSelect/TagList.js +0 -183
  227. package/dist/npm/MultiSelectTree/MultiSelectTree.d.ts +0 -48
  228. package/dist/npm/MultiSelectTree/MultiSelectTree.js +0 -1227
  229. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.d.ts +0 -322
  230. package/dist/npm/MultiSelectTree/MultiSelectTreeProps.js +0 -3
  231. package/dist/npm/MultiSelectTree/utils.d.ts +0 -17
  232. package/dist/npm/MultiSelectTree/utils.js +0 -114
  233. package/dist/npm/additionalTypes.ts +0 -21
  234. package/dist/npm/common/ClearButton.d.ts +0 -21
  235. package/dist/npm/common/ClearButton.js +0 -80
  236. package/dist/npm/common/DropDownBase.d.ts +0 -95
  237. package/dist/npm/common/DropDownBase.js +0 -303
  238. package/dist/npm/common/GroupStickyHeader.d.ts +0 -32
  239. package/dist/npm/common/GroupStickyHeader.js +0 -67
  240. package/dist/npm/common/List.d.ts +0 -60
  241. package/dist/npm/common/List.js +0 -208
  242. package/dist/npm/common/ListContainer.d.ts +0 -40
  243. package/dist/npm/common/ListContainer.js +0 -168
  244. package/dist/npm/common/ListDefaultItem.d.ts +0 -29
  245. package/dist/npm/common/ListDefaultItem.js +0 -67
  246. package/dist/npm/common/ListFilter.d.ts +0 -49
  247. package/dist/npm/common/ListFilter.js +0 -182
  248. package/dist/npm/common/ListGroupItem.d.ts +0 -41
  249. package/dist/npm/common/ListGroupItem.js +0 -78
  250. package/dist/npm/common/ListItem.d.ts +0 -71
  251. package/dist/npm/common/ListItem.js +0 -108
  252. package/dist/npm/common/Navigation.d.ts +0 -12
  253. package/dist/npm/common/Navigation.js +0 -37
  254. package/dist/npm/common/SearchBar.d.ts +0 -66
  255. package/dist/npm/common/SearchBar.js +0 -184
  256. package/dist/npm/common/VirtualScroll.d.ts +0 -42
  257. package/dist/npm/common/VirtualScroll.js +0 -168
  258. package/dist/npm/common/constants.d.ts +0 -4
  259. package/dist/npm/common/constants.js +0 -10
  260. package/dist/npm/common/events.d.ts +0 -63
  261. package/dist/npm/common/events.js +0 -2
  262. package/dist/npm/common/filterDescriptor.d.ts +0 -41
  263. package/dist/npm/common/filterDescriptor.js +0 -3
  264. package/dist/npm/common/settings.d.ts +0 -107
  265. package/dist/npm/common/settings.js +0 -11
  266. package/dist/npm/common/utils.d.ts +0 -70
  267. package/dist/npm/common/utils.js +0 -221
  268. package/dist/npm/main.d.ts +0 -18
  269. package/dist/npm/main.js +0 -36
  270. package/dist/npm/messages/main.d.ts +0 -40
  271. package/dist/npm/messages/main.js +0 -44
  272. package/dist/npm/package-metadata.d.ts +0 -5
  273. package/dist/npm/package-metadata.js +0 -14
@@ -1,1321 +0,0 @@
1
- "use strict";
2
-
3
- var __assign = undefined && undefined.__assign || function () {
4
- __assign = Object.assign || function (t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) {
8
- if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
9
- }
10
- }
11
- return t;
12
- };
13
- return __assign.apply(this, arguments);
14
- };
15
- Object.defineProperty(exports, "__esModule", {
16
- value: true
17
- });
18
- exports.DropDownListVue2 = exports.DropDownList = void 0;
19
- // @ts-ignore
20
- var Vue = require("vue");
21
- var allVue = Vue;
22
- var gh = allVue.h;
23
- var isV3 = allVue.version && allVue.version[0] === '3';
24
- var ref = allVue.ref;
25
- var kendo_vue_common_1 = require("@progress/kendo-vue-common");
26
- var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
27
- var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap,
28
- roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
29
- var ListContainer_1 = require("../common/ListContainer");
30
- var ListFilter_1 = require("../common/ListFilter");
31
- var ListDefaultItem_1 = require("../common/ListDefaultItem");
32
- var List_1 = require("../common/List");
33
- var DropDownBase_1 = require("../common/DropDownBase");
34
- var GroupStickyHeader_1 = require("../common/GroupStickyHeader");
35
- var main_1 = require("../messages/main");
36
- var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
37
- var constants_1 = require("../common/constants");
38
- var kendo_vue_layout_1 = require("@progress/kendo-vue-layout");
39
- var utils_1 = require("../common/utils");
40
- var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
41
- var VALIDATION_MESSAGE = 'Please select a value from the list!';
42
- /**
43
- * @hidden
44
- */
45
- var DropDownListVue2 = {
46
- name: 'KendoDropDownList',
47
- model: {
48
- event: 'changemodel'
49
- },
50
- props: {
51
- id: String,
52
- title: String,
53
- dataItemKey: {
54
- type: [Object, String]
55
- },
56
- defaultValue: {
57
- type: [String, Object, Number, Boolean],
58
- default: undefined
59
- },
60
- name: String,
61
- modelValue: {
62
- type: [String, Object, Number, Boolean],
63
- default: undefined
64
- },
65
- value: {
66
- type: [String, Object, Number, Boolean],
67
- default: undefined
68
- },
69
- label: {
70
- type: String
71
- },
72
- required: {
73
- type: Boolean,
74
- default: false
75
- },
76
- leftRightKeysNavigation: {
77
- type: Boolean,
78
- default: true
79
- },
80
- valid: {
81
- type: Boolean,
82
- default: undefined
83
- },
84
- validate: {
85
- type: Boolean
86
- },
87
- validationMessage: {
88
- type: String,
89
- default: undefined
90
- },
91
- validityStyles: {
92
- type: Boolean,
93
- default: true
94
- },
95
- delay: {
96
- type: Number,
97
- default: 500
98
- },
99
- ignoreCase: {
100
- type: Boolean,
101
- default: true
102
- },
103
- icon: String,
104
- svgIcon: Object,
105
- iconClassName: String,
106
- defaultItem: [Object, String],
107
- valueRender: [String, Function, Object],
108
- valueMap: Function,
109
- opened: {
110
- type: Boolean,
111
- default: undefined
112
- },
113
- disabled: Boolean,
114
- dir: {
115
- type: String,
116
- default: undefined
117
- },
118
- tabIndex: {
119
- type: Number,
120
- default: 0
121
- },
122
- accessKey: String,
123
- dataItems: Array,
124
- textField: String,
125
- valueField: String,
126
- valuePrimitive: Boolean,
127
- className: String,
128
- loading: Boolean,
129
- popupSettings: {
130
- type: Object,
131
- default: function _default() {
132
- return {
133
- animate: true,
134
- height: '200px',
135
- anchor: ''
136
- };
137
- }
138
- },
139
- itemRender: [String, Function, Object],
140
- groupHeaderItemRender: [String, Function, Object],
141
- groupStickyHeaderItemRender: [String, Function, Object],
142
- listNoDataRender: [String, Function, Object],
143
- focusedItemIndex: Function,
144
- header: [String, Function, Object],
145
- footer: [String, Function, Object],
146
- filterable: Boolean,
147
- filter: {
148
- type: String,
149
- default: undefined
150
- },
151
- virtual: {
152
- type: Object,
153
- default: undefined
154
- },
155
- ariaLabelledBy: String,
156
- ariaLabel: String,
157
- ariaDescribedBy: String,
158
- rounded: {
159
- type: String,
160
- default: 'medium',
161
- validator: function validator(value) {
162
- return ['small', 'medium', 'large', 'full'].includes(value);
163
- }
164
- },
165
- fillMode: {
166
- type: String,
167
- default: 'solid',
168
- validator: function validator(value) {
169
- return ['solid', 'flat', 'outline'].includes(value);
170
- }
171
- },
172
- size: {
173
- type: String,
174
- default: 'medium',
175
- validator: function validator(value) {
176
- return ['small', 'medium', 'large'].includes(value);
177
- }
178
- },
179
- groupField: {
180
- type: String
181
- },
182
- adaptive: {
183
- type: Boolean,
184
- default: undefined
185
- },
186
- adaptiveTitle: {
187
- type: String,
188
- default: undefined
189
- }
190
- },
191
- inject: {
192
- kendoLocalizationService: {
193
- default: null
194
- }
195
- },
196
- data: function data() {
197
- return {
198
- hasMounted: false,
199
- currentText: '',
200
- currentValue: '',
201
- currentFocused: false,
202
- currentOpened: false,
203
- searchState: {
204
- word: '',
205
- last: ''
206
- },
207
- _skipFocusEvent: false,
208
- valueDuringOnChange: {},
209
- _navigated: false,
210
- group: undefined,
211
- isScrolling: false,
212
- itemHeight: 0,
213
- state: undefined,
214
- popupWidth: undefined,
215
- windowWidth: 0
216
- };
217
- },
218
- watch: {
219
- currentOpened: function currentOpened(_, oldValue) {
220
- // @ts-ignore
221
- this.prevCurrentOpened = oldValue;
222
- },
223
- opened: function opened(_, oldValue) {
224
- // @ts-ignore
225
- this.prevOpened = oldValue;
226
- },
227
- virtual: function virtual(newValue, oldValue) {
228
- if (newValue && oldValue && newValue.total !== oldValue.total) {
229
- this.virtualTotalHasChanged = true;
230
- }
231
- this.virtualHasChanged = true;
232
- },
233
- isOpen: function isOpen() {
234
- var _this = this;
235
- setTimeout(function () {
236
- var listItem = document.querySelector('.k-list-item');
237
- _this.itemHeight = _this.base.getListItemHeight(listItem);
238
- }, 100);
239
- }
240
- },
241
- created: function created() {
242
- this.observer = null;
243
- this.valueDuringOnChange = undefined;
244
- this.currentText = undefined;
245
- this.currentValue = undefined;
246
- this.prevCurrentValue = this.computedValue();
247
- this.currentFocused = undefined;
248
- this.currentOpened = undefined;
249
- this.base = new DropDownBase_1.default(this);
250
- this.anchor = (0, kendo_vue_common_1.guid)();
251
- this.inputId = (0, kendo_vue_common_1.guid)();
252
- },
253
- // @ts-ignore
254
- setup: !isV3 ? undefined : function () {
255
- var v3 = !!isV3;
256
- var selectRef = ref(null);
257
- var baseWrapperRef = ref(null);
258
- var kendoAnchorRef = ref(null);
259
- return {
260
- v3: v3,
261
- selectRef: selectRef,
262
- baseWrapperRef: baseWrapperRef,
263
- kendoAnchorRef: kendoAnchorRef
264
- };
265
- },
266
- mounted: function mounted() {
267
- this.observer = kendo_vue_common_1.canUseDOM && new ResizeObserver(this.calculateMedia);
268
- if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
269
- this.observer.observe(document.body);
270
- }
271
- this.hasMounted = true;
272
- this.select = (0, kendo_vue_common_1.getRef)(this, 'select');
273
- this.base.wrapper = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
274
- this.base.didMount();
275
- this.setValidity();
276
- },
277
- destroyed: !!isV3 ? undefined : function () {
278
- if (this.observer) {
279
- this.observer.disconnect();
280
- }
281
- },
282
- updated: function updated() {
283
- var _a;
284
- var _b = this.$props,
285
- _c = _b.dataItems,
286
- dataItems = _c === void 0 ? [] : _c,
287
- dataItemKey = _b.dataItemKey,
288
- virtual = _b.virtual,
289
- groupField = _b.groupField,
290
- textField = _b.textField;
291
- var opened = this.isOpen;
292
- var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
293
- var opening = !prevOpened && opened;
294
- var closing = prevOpened && !opened;
295
- var list = this.$refs.list;
296
- var filterInput = this.$refs.filterInput;
297
- var scrollElement = this.$refs.scrollElement;
298
- var scroller = this.$refs.scroller;
299
- if (list) {
300
- // @ts-ignore
301
- this.base.vs.list = list.list;
302
- // @ts-ignore
303
- this.base.list = list.list;
304
- }
305
- if (scrollElement) {
306
- this.base.vs.scrollElement = scrollElement;
307
- }
308
- if (filterInput) {
309
- this.filterInput = filterInput;
310
- }
311
- if (list && dataItems.length) {
312
- // @ts-ignore
313
- this.base.vs.scrollerRef(list.$el);
314
- }
315
- if (!this.$props.popupSettings.animate) {
316
- if (opening) {
317
- this.onPopupOpened();
318
- } else if (closing) {
319
- // this.onPopupClosed();
320
- }
321
- }
322
- // @ts-ignore
323
- if (virtual && this.virtualTotalHasChanged) {
324
- this.base.vs.calcScrollElementHeight();
325
- this.base.vs.reset();
326
- // @ts-ignore
327
- this.virtualTotalHasChanged = false;
328
- } else {
329
- var selectedItem_1 = this.computedValue();
330
- var prevSelectedItem = this.prevCurrentValue;
331
- var selectedItemIndex = dataItems.findIndex(function (i) {
332
- return (0, utils_1.areSame)(i, selectedItem_1, dataItemKey);
333
- });
334
- // Needed to calculate the proper item index when in grouping mode
335
- if (groupField) {
336
- selectedItemIndex = (_a = this.base.getGroupedDataModernMode(dataItems, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(selectedItem_1);
337
- }
338
- var selectedItemChanged = !(0, utils_1.areSame)(prevSelectedItem, selectedItem_1, dataItemKey);
339
- if (opening && virtual) {
340
- this.base.scrollToVirtualItem(virtual, selectedItemIndex);
341
- this.prevCurrentOpened = true;
342
- } else if (opening && !virtual) {
343
- // Resets the sticky header group value for scenarios with open/close of component's popup
344
- if (dataItems && dataItems.length !== 0) {
345
- this.base.resetGroupStickyHeader(dataItems[0][groupField], this);
346
- }
347
- this.base.scrollToItem(selectedItemIndex);
348
- this.prevCurrentOpened = true;
349
- } else if (opened && prevOpened && selectedItem_1 && selectedItemChanged && !this._navigated) {
350
- this.base.scrollToItem(selectedItemIndex);
351
- } else if (opened && prevOpened && this._navigated) {
352
- if (this._navigated && virtual && virtual.skip === 0) {
353
- this.base.vs.reset();
354
- } else if (this._navigated && virtual && virtual.skip === virtual.total - virtual.pageSize) {
355
- this.base.vs.scrollToEnd();
356
- }
357
- }
358
- }
359
- this._navigated = false;
360
- this.prevCurrentValue = this.computedValue();
361
- this.setValidity();
362
- },
363
- computed: {
364
- index: {
365
- get: function get() {
366
- var _a = this.$props,
367
- _b = _a.dataItems,
368
- dataItems = _b === void 0 ? [] : _b,
369
- dataItemKey = _a.dataItemKey;
370
- var value = this.computedValue();
371
- // TO DO: deprecate it!
372
- return dataItems.findIndex(function (i) {
373
- return (0, utils_1.areSame)(i, value, dataItemKey);
374
- });
375
- }
376
- },
377
- spanClassNames: {
378
- get: function get() {
379
- var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
380
- return {
381
- 'k-floating-label-container': true,
382
- 'k-focus': this.currentFocused,
383
- 'k-empty': !this.computedValue(),
384
- 'k-invalid': !isValid && isValid !== undefined,
385
- 'k-rtl': this.$props.dir === 'rtl'
386
- };
387
- }
388
- },
389
- dropDownListId: {
390
- get: function get() {
391
- return "value-".concat(this.base.guid).concat(this.$props.ariaDescribedBy ? ' ' + this.$props.ariaDescribedBy : '');
392
- }
393
- },
394
- isOpen: {
395
- get: function get() {
396
- return this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
397
- }
398
- },
399
- animationStyles: {
400
- get: function get() {
401
- return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? {
402
- top: 0,
403
- width: '100%',
404
- height: '100%'
405
- } : undefined;
406
- }
407
- },
408
- classNameAdaptive: {
409
- get: function get() {
410
- return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
411
- }
412
- },
413
- adaptiveState: {
414
- get: function get() {
415
- return this.windowWidth <= constants_1.MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
416
- }
417
- }
418
- },
419
- methods: {
420
- focus: function focus() {
421
- if (this.base.wrapper) {
422
- this.base.wrapper.focus();
423
- }
424
- },
425
- computedValue: function computedValue() {
426
- var value;
427
- if (this.valueDuringOnChange !== undefined) {
428
- value = this.valueDuringOnChange;
429
- } else if (this.$props.value !== undefined) {
430
- value = this.$props.value;
431
- } else if (this.$props.modelValue !== undefined) {
432
- value = this.$props.modelValue;
433
- } else if (this.currentValue !== undefined) {
434
- value = this.currentValue;
435
- } else if (this.$props.defaultValue !== undefined) {
436
- value = this.$props.defaultValue;
437
- }
438
- if (!(0, utils_1.isPresent)(value) && this.$props.defaultItem !== undefined) {
439
- value = this.$props.defaultItem;
440
- }
441
- return this.valuePrimitive ? this.findByFieldValue(this.valueField, value) || value : value;
442
- },
443
- findByFieldValue: function findByFieldValue(field, value) {
444
- var index = this.dataItems.findIndex(function (i) {
445
- return (0, utils_1.getItemValue)(i, field) === value;
446
- });
447
- return this.dataItems[index];
448
- },
449
- primitiveValue: function primitiveValue() {
450
- var value = this.computedValue();
451
- return this.valuePrimitive ? (0, utils_1.getItemValue)(value, this.valueField) : value;
452
- },
453
- validity: function validity() {
454
- var customError = this.$props.validationMessage !== undefined;
455
- var isValid = !this.$props.required || this.computedValue() !== null && this.computedValue() !== '' && this.computedValue() !== undefined;
456
- var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
457
- return {
458
- customError: customError,
459
- valid: valid,
460
- valueMissing: this.computedValue() === null
461
- };
462
- },
463
- handleItemSelect: function handleItemSelect(index, state) {
464
- var _a = this.$props,
465
- _b = _a.dataItems,
466
- dataItems = _b === void 0 ? [] : _b,
467
- virtual = _a.virtual,
468
- dataItemKey = _a.dataItemKey,
469
- defaultItem = _a.defaultItem;
470
- var skip = virtual ? virtual.skip : 0;
471
- var item = index === -1 && defaultItem !== undefined ? defaultItem : dataItems[index - skip];
472
- var newSelected = !(0, utils_1.areSame)(item, this.computedValue(), dataItemKey);
473
- this.triggerOnChange(item, state);
474
- if (newSelected) {
475
- this.base.triggerPageChangeCornerItems(item, state);
476
- }
477
- },
478
- onNavigate: function onNavigate(state, keyCode) {
479
- var _a = this.$props,
480
- _b = _a.dataItems,
481
- dataItems = _b === void 0 ? [] : _b,
482
- defaultItem = _a.defaultItem,
483
- dataItemKey = _a.dataItemKey,
484
- _c = _a.virtual,
485
- virtual = _c === void 0 ? {
486
- skip: 0,
487
- total: 0,
488
- pageSize: 0
489
- } : _c;
490
- var vs = this.base.vs;
491
- var value = this.computedValue();
492
- var index = dataItems.findIndex(function (i) {
493
- return (0, utils_1.areSame)(i, value, dataItemKey);
494
- });
495
- var newIndex = this.base.navigation.navigate({
496
- current: virtual.skip + index,
497
- max: (vs.enabled ? virtual.total : dataItems.length) - 1,
498
- min: defaultItem !== undefined ? -1 : 0,
499
- keyCode: keyCode
500
- });
501
- if (newIndex !== undefined) {
502
- this.handleItemSelect(newIndex, state);
503
- }
504
- this.applyState(state);
505
- },
506
- search: function search(event) {
507
- var _this = this;
508
- clearTimeout(this.typingTimeout);
509
- if (!this.$props.filterable) {
510
- this.typingTimeout = setTimeout(function () {
511
- return _this.searchState.word = '';
512
- }, this.$props.delay);
513
- this.selectNext(event);
514
- }
515
- },
516
- selectNext: function selectNext(event) {
517
- var _this = this;
518
- var _a = this.$props,
519
- _b = _a.dataItems,
520
- dataItems = _b === void 0 ? [] : _b,
521
- dataItemKey = _a.dataItemKey;
522
- var mappedData = dataItems.map(function (item, idx) {
523
- return {
524
- item: item,
525
- itemIndex: idx
526
- };
527
- });
528
- var word = this.searchState.word;
529
- var last = this.searchState.last;
530
- var isInLoop = (0, utils_1.sameCharsOnly)(word, last);
531
- var dataLength = mappedData.length;
532
- var startIndex = Math.max(0, dataItems.findIndex(function (i) {
533
- return (0, utils_1.areSame)(i, _this.computedValue(), dataItemKey);
534
- }));
535
- var defaultItem;
536
- if (this.$props.defaultItem) {
537
- defaultItem = {
538
- item: this.$props.defaultItem,
539
- itemIndex: -1
540
- };
541
- dataLength += 1;
542
- startIndex += 1;
543
- }
544
- startIndex += isInLoop ? 1 : 0;
545
- mappedData = (0, utils_1.shuffleData)(mappedData, startIndex, defaultItem);
546
- var text,
547
- loopMatch,
548
- nextMatch,
549
- index = 0;
550
- var _c = this.$props,
551
- textField = _c.textField,
552
- ignoreCase = _c.ignoreCase;
553
- for (; index < dataLength; index++) {
554
- text = (0, utils_1.getItemValue)(mappedData[index].item, textField);
555
- loopMatch = isInLoop && (0, utils_1.matchText)(text, last, ignoreCase);
556
- nextMatch = (0, utils_1.matchText)(text, word, ignoreCase);
557
- if (loopMatch || nextMatch) {
558
- index = mappedData[index].itemIndex;
559
- break;
560
- }
561
- }
562
- if (index !== dataLength) {
563
- var state = this.base.initState();
564
- state.event = event;
565
- this.handleItemSelect(index, state);
566
- this.applyState(state);
567
- this.valueDuringOnChange = undefined;
568
- }
569
- },
570
- handleKeyDown: function handleKeyDown(event) {
571
- if (this.isScrolling) {
572
- this.isScrolling = false;
573
- }
574
- var _a = this.$props,
575
- _b = _a.dataItems,
576
- dataItems = _b === void 0 ? [] : _b,
577
- leftRightKeysNavigation = _a.leftRightKeysNavigation,
578
- filterable = _a.filterable,
579
- disabled = _a.disabled,
580
- _c = _a.virtual,
581
- virtual = _c === void 0 ? {
582
- skip: 0,
583
- total: 0,
584
- pageSize: 0
585
- } : _c;
586
- var opened = this.isOpen;
587
- var keyCode = event.keyCode;
588
- var homeOrEndKeys = keyCode === kendo_vue_common_1.Keys.home || keyCode === kendo_vue_common_1.Keys.end;
589
- var upOrDownKeys = keyCode === kendo_vue_common_1.Keys.up || keyCode === kendo_vue_common_1.Keys.down;
590
- var shouldOpen = !opened && (event.altKey && keyCode === kendo_vue_common_1.Keys.down || keyCode === kendo_vue_common_1.Keys.enter || keyCode === kendo_vue_common_1.Keys.space);
591
- var shouldClose = opened && (event.altKey && keyCode === kendo_vue_common_1.Keys.up || keyCode === kendo_vue_common_1.Keys.esc);
592
- var leftOrRightKeys = leftRightKeysNavigation && (keyCode === kendo_vue_common_1.Keys.left || keyCode === kendo_vue_common_1.Keys.right);
593
- var shouldNavigate = upOrDownKeys || !filterable && (leftOrRightKeys || homeOrEndKeys);
594
- var state = this.base.initState();
595
- state.event = event;
596
- if (disabled) {
597
- return;
598
- } else if (homeOrEndKeys && this.base.vs.enabled) {
599
- if (keyCode === kendo_vue_common_1.Keys.home) {
600
- if (virtual.skip !== 0) {
601
- this.base.triggerOnPageChange(state, 0, virtual.pageSize);
602
- this._navigated = true;
603
- } else {
604
- this.triggerOnChange(dataItems[0], state);
605
- }
606
- } else {
607
- if (virtual.skip < virtual.total - virtual.pageSize) {
608
- this.base.triggerOnPageChange(state, virtual.total - virtual.pageSize, virtual.pageSize);
609
- this._navigated = true;
610
- } else {
611
- this.triggerOnChange(dataItems[dataItems.length - 1], state);
612
- }
613
- }
614
- } else if (opened && keyCode === kendo_vue_common_1.Keys.enter) {
615
- var focusedIndex = this.focusedIndex();
616
- if (focusedIndex !== undefined) {
617
- this.handleItemSelect(focusedIndex, state);
618
- }
619
- this.base.togglePopup(state);
620
- event.preventDefault();
621
- } else if (shouldOpen || shouldClose) {
622
- if (this.adaptiveState) {
623
- this.handleWrapperClick(event); // Handle the closing on "Esc" key press in adaptive mode
624
- }
625
-
626
- this.base.togglePopup(state);
627
- event.preventDefault();
628
- } else if (shouldNavigate) {
629
- this.onNavigate(state, keyCode);
630
- event.preventDefault();
631
- }
632
- this.applyState(state);
633
- },
634
- handleItemClick: function handleItemClick(index, event) {
635
- this.base.handleItemClick(index, event);
636
- this.valueDuringOnChange = undefined;
637
- },
638
- handleFocus: function handleFocus(event) {
639
- if (this._skipFocusEvent) {
640
- return;
641
- }
642
- this.base.handleFocus(event);
643
- },
644
- handleBlur: function handleBlur(event) {
645
- if (this._skipFocusEvent || !this.currentFocused) {
646
- return;
647
- }
648
- var opened = this.isOpen;
649
- var state = this.base.initState();
650
- state.event = event;
651
- state.data.currentFocused = false;
652
- state.events.push({
653
- type: 'blur'
654
- });
655
- if (opened && !this.adaptiveState) {
656
- this.base.togglePopup(state);
657
- }
658
- this.applyState(state);
659
- },
660
- handleDefaultItemClick: function handleDefaultItemClick(event) {
661
- var state = this.base.initState();
662
- state.event = event;
663
- this.base.togglePopup(state);
664
- this.triggerOnChange(this.$props.defaultItem, state);
665
- this.applyState(state);
666
- },
667
- handleWrapperClick: function handleWrapperClick(event) {
668
- var state = this.base.initState();
669
- state.event = event;
670
- if (!this.currentFocused) {
671
- // @ts-ignore
672
- state.data.currentFocused = true;
673
- }
674
- this.base.togglePopup(state);
675
- this.applyState(state);
676
- },
677
- handleKeyPress: function handleKeyPress(event) {
678
- if (this.$props.filterable || event.keyCode === kendo_vue_common_1.Keys.enter) {
679
- return;
680
- }
681
- var character = String.fromCharCode(event.charCode || event.keyCode);
682
- if (this.$props.ignoreCase) {
683
- character = character.toLowerCase();
684
- }
685
- if (character === ' ') {
686
- event.preventDefault();
687
- }
688
- this.searchState = {
689
- word: this.searchState.word + character,
690
- last: this.searchState.last + character
691
- };
692
- this.search(event);
693
- },
694
- handleListFilterChange: function handleListFilterChange(event) {
695
- var state = this.base.initState();
696
- state.event = event;
697
- if (this.$props.filter === undefined) {
698
- // @ts-ignore
699
- state.data.currentText = event.target.value;
700
- }
701
- this.base.filterChanged(event.target.value, state);
702
- // Used to reset the value of the StickyHeader when filtering the data
703
- state.data.group = undefined;
704
- this.applyState(state);
705
- },
706
- onPopupOpened: function onPopupOpened() {
707
- if (this.filterInput) {
708
- this.focusElement(this.filterInput.input);
709
- }
710
- },
711
- onPopupClosed: function onPopupClosed() {
712
- var _this = this;
713
- if (this.currentFocused) {
714
- setTimeout(function () {
715
- if (_this.currentFocused && _this.base.wrapper) {
716
- _this.focusElement(_this.base.wrapper);
717
- }
718
- });
719
- }
720
- },
721
- focusedIndex: function focusedIndex() {
722
- var filterText = (0, utils_1.isPresent)(this.$props.filter) ? this.$props.filter : this.currentText;
723
- var _a = this.$props,
724
- _b = _a.dataItems,
725
- dataItems = _b === void 0 ? [] : _b,
726
- _c = _a.virtual,
727
- virtual = _c === void 0 ? {
728
- skip: 0
729
- } : _c,
730
- dataItemKey = _a.dataItemKey,
731
- textField = _a.textField,
732
- focusedItemIndex = _a.focusedItemIndex;
733
- var value = this.computedValue();
734
- var selectedIndex = dataItems.findIndex(function (i) {
735
- return (0, utils_1.areSame)(i, value, dataItemKey);
736
- });
737
- var hasSelected = !(selectedIndex < 0 && !this.$props.defaultItem);
738
- if (!hasSelected && filterText && virtual.skip === 0) {
739
- return focusedItemIndex ? focusedItemIndex(dataItems, filterText, textField) : dataItems.indexOf((0, utils_1.getFocusedItem)(dataItems, filterText, textField));
740
- } else {
741
- return !hasSelected && virtual.skip === 0 ? 0 : undefined;
742
- }
743
- },
744
- focusElement: function focusElement(element) {
745
- var _this = this;
746
- this._skipFocusEvent = true;
747
- element.focus();
748
- setTimeout(function () {
749
- return _this._skipFocusEvent = false;
750
- }, 30);
751
- },
752
- setValidity: function setValidity() {
753
- if (this.select && this.select.setCustomValidity) {
754
- this.select.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
755
- }
756
- },
757
- triggerOnChange: function triggerOnChange(item, state) {
758
- if ((0, utils_1.areSame)(this.computedValue(), item, this.$props.dataItemKey)) {
759
- return;
760
- }
761
- if (this.$props.value === undefined) {
762
- this.currentValue = item;
763
- }
764
- this.valueDuringOnChange = item;
765
- state.events.push({
766
- type: 'change'
767
- });
768
- },
769
- applyState: function applyState(state) {
770
- this.base.applyState(state);
771
- this.valueDuringOnChange = undefined;
772
- },
773
- calculateMedia: function calculateMedia(entries) {
774
- for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
775
- var entry = entries_1[_i];
776
- this.windowWidth = entry.target.clientWidth;
777
- }
778
- },
779
- repositionPopup: function repositionPopup() {
780
- this.base.repositionPopup();
781
- },
782
- onScroll: function onScroll(event) {
783
- this.isScrolling = true;
784
- var _a = this.base,
785
- vs = _a.vs,
786
- list = _a.list;
787
- vs.scrollHandler(event);
788
- var state = this.base.initState();
789
- var groupField = this.$props.groupField;
790
- var _b = this.$props.dataItems,
791
- dataItems = _b === void 0 ? [] : _b;
792
- var group;
793
- if (!groupField || !dataItems.length) {
794
- return;
795
- }
796
- var itemHeight = this.itemHeight = this.itemHeight || (vs.enabled ? vs.itemHeight : list ? list.children[0].offsetHeight : 0);
797
- var target = event.target;
798
- var scrollTop = target.scrollTop - vs.skip * itemHeight;
799
- if (groupField) {
800
- dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
801
- group = dataItems[0][groupField];
802
- }
803
- for (var i = 1; i < dataItems.length; i++) {
804
- if (itemHeight * i > scrollTop) {
805
- break;
806
- }
807
- if (dataItems[i] && dataItems[i][groupField]) {
808
- group = dataItems[i][groupField];
809
- }
810
- }
811
- if (group !== this.group) {
812
- state.data.group = group;
813
- this.applyState(state);
814
- }
815
- }
816
- },
817
- render: function render(createElement) {
818
- var _this = this;
819
- var h = gh || createElement;
820
- var _a = this.$props,
821
- style = _a.style,
822
- className = _a.className,
823
- label = _a.label,
824
- dir = _a.dir,
825
- _b = _a.virtual,
826
- virtual = _b === void 0 ? {
827
- skip: 0
828
- } : _b,
829
- size = _a.size,
830
- rounded = _a.rounded,
831
- fillMode = _a.fillMode,
832
- dataItemKey = _a.dataItemKey,
833
- _c = _a.dataItems,
834
- dataItems = _c === void 0 ? [] : _c,
835
- disabled = _a.disabled,
836
- tabIndex = _a.tabIndex,
837
- loading = _a.loading,
838
- icon = _a.icon,
839
- svgIcon = _a.svgIcon,
840
- iconClassName = _a.iconClassName,
841
- adaptiveTitle = _a.adaptiveTitle,
842
- header = _a.header,
843
- footer = _a.footer,
844
- groupStickyHeaderItemRender = _a.groupStickyHeaderItemRender;
845
- var opened = this.isOpen;
846
- var text = (0, utils_1.getItemValue)(this.computedValue(), this.$props.textField);
847
- var isValid = !this.$props.validityStyles || this.validity().valid;
848
- var base = this.base;
849
- var vs = base.vs;
850
- var id = this.$props.id || this.inputId;
851
- vs.enabled = this.$props.virtual !== undefined;
852
- var popupSettings = Object.assign({}, {
853
- animate: true,
854
- height: '200px'
855
- }, this.$props.popupSettings);
856
- var ariaLabelSelectButton = (0, kendo_vue_intl_1.provideLocalizationService)(this).toLanguageString(main_1.selectButton, main_1.messages[main_1.selectButton]);
857
- var renderAdaptive = this.adaptiveState;
858
- if (this.group === undefined && this.$props.groupField !== undefined) {
859
- this.group = (0, utils_1.getItemValue)(this.$props.dataItems[0], this.$props.groupField);
860
- }
861
- var valueRender = kendo_vue_common_1.templateRendering.call(this, this.$props.valueRender, kendo_vue_common_1.getListeners.call(this));
862
- var focused = this.currentFocused;
863
- var value = this.primitiveValue();
864
- var selectedIndex = dataItems.findIndex(function (i) {
865
- return (0, utils_1.areSame)(i, value, dataItemKey);
866
- });
867
- var valueDefaultRendering = h("span", {
868
- "class": "k-input-inner",
869
- id: this.dropDownListId,
870
- attrs: this.v3 ? undefined : {
871
- id: this.dropDownListId
872
- }
873
- }, [h("span", {
874
- "class": "k-input-value-text"
875
- }, [text])]);
876
- var valueElement = kendo_vue_common_1.getTemplate.call(this, {
877
- h: h,
878
- template: valueRender,
879
- defaultRendering: valueDefaultRendering,
880
- additionalProps: __assign({
881
- value: this.computedValue()
882
- }, this.$data)
883
- });
884
- var dummySelect = function dummySelect(cvalue) {
885
- /* Dummy component to support forms */
886
- return h("select", {
887
- name: this.$props.name,
888
- attrs: this.v3 ? undefined : {
889
- name: this.$props.name,
890
- id: id,
891
- tabindex: -1,
892
- "aria-hidden": true,
893
- title: this.$props.label
894
- },
895
- id: id,
896
- ref: (0, kendo_vue_common_1.setRef)(this, 'select'),
897
- tabindex: -1,
898
- "aria-hidden": true,
899
- title: this.$props.label,
900
- style: {
901
- opacity: 0,
902
- width: 1,
903
- border: 0,
904
- zIndex: -1,
905
- position: 'absolute',
906
- left: '50%'
907
- }
908
- }, [h("option", {
909
- value: this.v3 ? this.$props.valueMap ? this.$props.valueMap.call(undefined, cvalue) : cvalue : null,
910
- domProps: this.v3 ? undefined : {
911
- "value": this.$props.valueMap ? this.$props.valueMap.call(undefined, cvalue) : cvalue
912
- }
913
- })]);
914
- };
915
- var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
916
- return [h("div", {
917
- "class": "k-actionsheet-titlebar-group k-hbox"
918
- }, [h("div", {
919
- "class": "k-actionsheet-title"
920
- }, [h("div", {
921
- "class": "k-text-center"
922
- }, [adaptiveTitle]), h("div", {
923
- "class": "k-actionsheet-subtitle k-text-center"
924
- })]), h("div", {
925
- "class": "k-actionsheet-actions"
926
- }, [h(kendo_vue_buttons_1.Button, {
927
- tabindex: 5,
928
- attrs: this.v3 ? undefined : {
929
- tabindex: 5,
930
- "aria-label": "Cancel",
931
- "aria-disabled": "false",
932
- type: "button",
933
- fillMode: "flat",
934
- icon: "x",
935
- svgIcon: kendo_svg_icons_1.xIcon
936
- },
937
- "aria-label": "Cancel",
938
- "aria-disabled": "false",
939
- type: "button",
940
- fillMode: "flat",
941
- onClick: _this.handleWrapperClick,
942
- on: this.v3 ? undefined : {
943
- "click": _this.handleWrapperClick
944
- },
945
- icon: "x",
946
- svgIcon: kendo_svg_icons_1.xIcon
947
- })])]), h("div", {
948
- "class": "k-actionsheet-titlebar-group k-actionsheet-filter"
949
- }, [renderListFilter.call(_this)])];
950
- };
951
- var adaptiveActionSheetHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, kendo_vue_common_1.getListeners.call(this));
952
- var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
953
- var _a;
954
- var headerToRender = base.getTemplateDef.call(_this, header, h);
955
- var footerToRender = base.getTemplateDef.call(_this, footer, h);
956
- var groupStickyHeaderTemplate = kendo_vue_common_1.templateRendering.call(_this, groupStickyHeaderItemRender, kendo_vue_common_1.getListeners.call(_this));
957
- return h("div", {
958
- "class": "k-list-container"
959
- }, [headerToRender && h("div", {
960
- "class": "k-list-header"
961
- }, [headerToRender]), h("div", {
962
- "class": (0, kendo_vue_common_1.classNames)('k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = !renderAdaptive ? size : false, _a['k-list-lg'] = renderAdaptive ? true : false, _a['k-virtual-list'] = vs.enabled, _a))
963
- }, [renderDefaultItem.call(_this), _this.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
964
- group: _this.group,
965
- attrs: this.v3 ? undefined : {
966
- group: _this.group,
967
- render: groupStickyHeaderTemplate
968
- },
969
- render: groupStickyHeaderTemplate
970
- }), renderList.call(_this), footerToRender && h("div", {
971
- className: "k-list-footer",
972
- attrs: this.v3 ? undefined : {
973
- className: "k-list-footer"
974
- }
975
- }, [footerToRender])])]);
976
- };
977
- var adaptiveActionSheetContentTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetContentTemplateDef, kendo_vue_common_1.getListeners.call(this));
978
- var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
979
- return h(kendo_vue_layout_1.ActionSheet, {
980
- expand: opened,
981
- attrs: this.v3 ? undefined : {
982
- expand: opened,
983
- animation: true,
984
- animationStyles: this.animationStyles,
985
- className: this.classNameAdaptive,
986
- contentClassName: '!k-overflow-hidden',
987
- header: adaptiveActionSheetHeaderTemplate,
988
- content: adaptiveActionSheetContentTemplate,
989
- navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
990
- },
991
- animation: true,
992
- animationStyles: this.animationStyles,
993
- className: this.classNameAdaptive,
994
- contentClassName: '!k-overflow-hidden',
995
- header: adaptiveActionSheetHeaderTemplate,
996
- content: adaptiveActionSheetContentTemplate,
997
- onClose: this.handleWrapperClick,
998
- on: this.v3 ? undefined : {
999
- "close": this.handleWrapperClick
1000
- },
1001
- navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
1002
- });
1003
- };
1004
- var renderDefaultItem = function renderDefaultItem() {
1005
- var _a = this.$props,
1006
- textField = _a.textField,
1007
- defaultItem = _a.defaultItem;
1008
- return defaultItem !== undefined &&
1009
- // @ts-ignore
1010
- h(ListDefaultItem_1.ListDefaultItem, {
1011
- defaultItem: defaultItem,
1012
- attrs: this.v3 ? undefined : {
1013
- defaultItem: defaultItem,
1014
- textField: textField,
1015
- selected: (0, utils_1.areSame)(this.computedValue(), defaultItem, dataItemKey)
1016
- },
1017
- textField: textField,
1018
- selected: (0, utils_1.areSame)(this.computedValue(), defaultItem, dataItemKey),
1019
- key: "defaultitemkey",
1020
- onDefaultitemclick: this.handleDefaultItemClick,
1021
- on: this.v3 ? undefined : {
1022
- "defaultitemclick": this.handleDefaultItemClick
1023
- }
1024
- });
1025
- };
1026
- var renderList = function renderList() {
1027
- var _this2 = this;
1028
- var _a = this.$props,
1029
- textField = _a.textField,
1030
- groupField = _a.groupField;
1031
- var dataItemsToRender = this.$props.dataItems || [];
1032
- var itemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.itemRender, kendo_vue_common_1.getListeners.call(this));
1033
- var groupHeaderItemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.groupHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
1034
- var listNoDataRender = kendo_vue_common_1.templateRendering.call(this, this.$props.listNoDataRender, kendo_vue_common_1.getListeners.call(this));
1035
- var skip = virtual.skip;
1036
- var translate = "translateY(".concat(vs.translate, "px)");
1037
- if (groupField) {
1038
- dataItemsToRender = this.base.getGroupedDataModernMode(dataItemsToRender, groupField);
1039
- }
1040
- return (
1041
- // @ts-ignore function children
1042
- h(List_1.List, {
1043
- id: this.base.listBoxId,
1044
- attrs: this.v3 ? undefined : {
1045
- id: this.base.listBoxId,
1046
- show: opened,
1047
- dataItems: dataItemsToRender.slice(),
1048
- focusedIndex: this.focusedIndex(),
1049
- value: this.computedValue(),
1050
- textField: textField,
1051
- valueField: dataItemKey,
1052
- optionsGuid: this.base.guid,
1053
- wrapperStyle: {
1054
- maxHeight: popupSettings.height
1055
- },
1056
- wrapperCssClass: 'k-list-content',
1057
- listStyle: vs.enabled ? {
1058
- transform: translate
1059
- } : undefined,
1060
- skip: skip,
1061
- itemRender: itemRender,
1062
- groupHeaderItemRender: groupHeaderItemRender,
1063
- noDataRender: listNoDataRender,
1064
- groupField: groupField
1065
- },
1066
- show: opened,
1067
- dataItems: dataItemsToRender.slice(),
1068
- focusedIndex: this.focusedIndex(),
1069
- value: this.computedValue(),
1070
- textField: textField,
1071
- valueField: dataItemKey,
1072
- optionsGuid: this.base.guid,
1073
- ref: 'list',
1074
- wrapperStyle: {
1075
- maxHeight: popupSettings.height
1076
- },
1077
- wrapperCssClass: 'k-list-content',
1078
- listStyle: vs.enabled ? {
1079
- transform: translate
1080
- } : undefined,
1081
- key: "listkey",
1082
- skip: skip,
1083
- onListclick: this.handleItemClick,
1084
- on: this.v3 ? undefined : {
1085
- "listclick": this.handleItemClick,
1086
- "scroll": this.onScroll
1087
- },
1088
- itemRender: itemRender,
1089
- groupHeaderItemRender: groupHeaderItemRender,
1090
- noDataRender: listNoDataRender,
1091
- groupField: groupField,
1092
- onScroll: this.onScroll
1093
- }, this.v3 ? function () {
1094
- return [renderScrollElement.call(_this2)];
1095
- } : [renderScrollElement.call(_this2)])
1096
- );
1097
- };
1098
- var renderListFilter = function renderListFilter() {
1099
- var filterText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
1100
- return this.$props.filterable &&
1101
- // @ts-ignore
1102
- h(ListFilter_1.ListFilter, {
1103
- value: filterText,
1104
- attrs: this.v3 ? undefined : {
1105
- value: filterText,
1106
- size: this.$props.size,
1107
- rounded: this.$props.rounded,
1108
- fillMode: this.$props.fillMode,
1109
- ariaControlsId: this.base.listBoxId,
1110
- ariaActivedescendantId: "option-".concat(this.base.guid, "-").concat(this.focusedIndex())
1111
- },
1112
- ref: 'filterInput',
1113
- onChange: this.handleListFilterChange,
1114
- on: this.v3 ? undefined : {
1115
- "change": this.handleListFilterChange,
1116
- "keydown": this.handleKeyDown
1117
- },
1118
- onKeydown: this.handleKeyDown,
1119
- size: this.$props.size,
1120
- rounded: this.$props.rounded,
1121
- fillMode: this.$props.fillMode,
1122
- ariaControlsId: this.base.listBoxId,
1123
- ariaActivedescendantId: "option-".concat(this.base.guid, "-").concat(this.focusedIndex())
1124
- });
1125
- };
1126
- var renderScrollElement = function renderScrollElement() {
1127
- return vs.enabled && h("div", {
1128
- ref: 'scrollElement',
1129
- key: 'scrollElementKey'
1130
- });
1131
- };
1132
- var renderListContainer = function renderListContainer() {
1133
- var _this3 = this;
1134
- var _a;
1135
- var groupStickyHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.groupStickyHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
1136
- var headerListContainer = base.getTemplateDef.call(this, header);
1137
- var footerListContainer = base.getTemplateDef.call(this, footer);
1138
- return (
1139
- // @ts-ignore function children
1140
- h(ListContainer_1.ListContainer, {
1141
- ref: 'container',
1142
- onMousedown: utils_1.preventDefaultNonInputs,
1143
- on: this.v3 ? undefined : {
1144
- "mousedown": utils_1.preventDefaultNonInputs,
1145
- "open": this.onPopupOpened,
1146
- "close": this.onPopupClosed,
1147
- "blur": this.handleBlur
1148
- },
1149
- dir: dir !== undefined ? dir : base.dirCalculated,
1150
- attrs: this.v3 ? undefined : {
1151
- dir: dir !== undefined ? dir : base.dirCalculated,
1152
- width: this.popupWidth
1153
- // @ts-ignore
1154
- ,
1155
- popupSettings: __assign(__assign({}, popupSettings), {
1156
- popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
1157
- className: (0, kendo_vue_common_1.classNames)('k-list-container', popupSettings.className),
1158
- anchor: this.anchor,
1159
- show: opened
1160
- })
1161
- },
1162
- width: this.popupWidth,
1163
- popupSettings: __assign(__assign({}, popupSettings), {
1164
- popupClass: (0, kendo_vue_common_1.classNames)(popupSettings.popupClass, 'k-list', (_a = {}, _a["k-list-".concat(sizeMap[size] || size)] = size, _a['k-virtual-list'] = this.base.vs.enabled, _a)),
1165
- className: (0, kendo_vue_common_1.classNames)('k-list-container', popupSettings.className),
1166
- anchor: this.anchor,
1167
- show: opened
1168
- }),
1169
- onOpen: this.onPopupOpened,
1170
- onClose: this.onPopupClosed,
1171
- onBlur: this.handleBlur
1172
- }, this.v3 ? function () {
1173
- return [renderListFilter.call(_this3), renderDefaultItem.call(_this3), _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
1174
- group: _this3.group,
1175
- attrs: _this3.v3 ? undefined : {
1176
- group: _this3.group,
1177
- render: groupStickyHeaderTemplate
1178
- },
1179
- render: groupStickyHeaderTemplate
1180
- }), headerListContainer && h("div", {
1181
- "class": "k-list-header"
1182
- }, [headerListContainer]), renderList.call(_this3), footerListContainer && h("div", {
1183
- "class": "k-list-footer"
1184
- }, [footerListContainer])];
1185
- } : [renderListFilter.call(_this3), renderDefaultItem.call(_this3), _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
1186
- group: _this3.group,
1187
- attrs: _this3.v3 ? undefined : {
1188
- group: _this3.group,
1189
- render: groupStickyHeaderTemplate
1190
- },
1191
- render: groupStickyHeaderTemplate
1192
- }), headerListContainer && h("div", {
1193
- "class": "k-list-header"
1194
- }, [headerListContainer]), renderList.call(_this3), footerListContainer && h("div", {
1195
- "class": "k-list-footer"
1196
- }, [footerListContainer])])
1197
- );
1198
- };
1199
- if (this.$props.virtual !== undefined) {
1200
- base.vs.skip = virtual.skip;
1201
- // @ts-ignore
1202
- base.vs.total = virtual.total;
1203
- // @ts-ignore
1204
- base.vs.pageSize = virtual.pageSize;
1205
- }
1206
- var dropdownlistDefault = function dropdownlistDefault() {
1207
- var _a;
1208
- return h("span", {
1209
- ref: (0, kendo_vue_common_1.setRef)(this, 'kendoAnchor', this.anchor),
1210
- "class": (0, kendo_vue_common_1.classNames)('k-dropdownlist k-picker', className, (_a = {}, _a["k-picker-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-picker-".concat(fillMode)] = fillMode, _a['k-focus'] = focused, _a['k-disabled'] = disabled, _a['k-invalid'] = !isValid, _a['k-loading'] = loading, _a['k-required'] = this.required, _a)),
1211
- style: !label ? style : __assign(__assign({}, style), {
1212
- width: undefined
1213
- }),
1214
- dir: dir,
1215
- attrs: this.v3 ? undefined : {
1216
- dir: dir,
1217
- tabindex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled),
1218
- accesskey: this.$props.accessKey,
1219
- role: 'combobox',
1220
- "aria-disabled": disabled || undefined,
1221
- "aria-haspopup": true,
1222
- "aria-expanded": opened || false,
1223
- "aria-owns": this.base.listBoxId,
1224
- "aria-activedescendant": opened ? 'option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0)) : undefined,
1225
- "aria-label": this.$props.ariaLabel || this.$props.label,
1226
- "aria-labelledby": this.$props.ariaLabelledBy,
1227
- "aria-describedBy": this.dropDownListId,
1228
- title: this.$props.title
1229
- },
1230
- onMousedown: opened ? utils_1.preventDefaultNonInputs : kendo_vue_common_1.noop,
1231
- on: this.v3 ? undefined : {
1232
- "mousedown": opened ? utils_1.preventDefaultNonInputs : kendo_vue_common_1.noop,
1233
- "focusin": this.handleFocus,
1234
- "focusout": this.handleBlur,
1235
- "keydown": this.handleKeyDown,
1236
- "keypress": this.handleKeyPress,
1237
- "click": disabled ? kendo_vue_common_1.noop : this.handleWrapperClick
1238
- },
1239
- onFocusin: this.handleFocus,
1240
- onFocusout: this.handleBlur,
1241
- tabindex: (0, kendo_vue_common_1.getTabIndex)(tabIndex, disabled),
1242
- accesskey: this.$props.accessKey,
1243
- onKeydown: this.handleKeyDown,
1244
- onKeypress: this.handleKeyPress,
1245
- role: 'combobox',
1246
- onClick: disabled ? kendo_vue_common_1.noop : this.handleWrapperClick,
1247
- "aria-disabled": disabled || undefined,
1248
- "aria-haspopup": true,
1249
- "aria-expanded": opened || false,
1250
- "aria-owns": this.base.listBoxId,
1251
- "aria-activedescendant": opened ? 'option-' + this.base.guid + '-' + (selectedIndex + (virtual ? virtual.skip : 0)) : undefined,
1252
- "aria-label": this.$props.ariaLabel || this.$props.label,
1253
- "aria-labelledby": this.$props.ariaLabelledBy,
1254
- "aria-describedBy": this.dropDownListId,
1255
- title: this.$props.title
1256
- }, [valueElement, loading && h(kendo_vue_common_1.Icon, {
1257
- name: 'loading',
1258
- attrs: this.v3 ? undefined : {
1259
- name: 'loading'
1260
- },
1261
- "class": "k-input-loading-icon",
1262
- key: "loading"
1263
- }),
1264
- // @ts-ignore
1265
- h(kendo_vue_buttons_1.Button, {
1266
- type: "button",
1267
- attrs: this.v3 ? undefined : {
1268
- type: "button",
1269
- tabIndex: -1,
1270
- size: size,
1271
- fillMode: fillMode,
1272
- rounded: null,
1273
- ariaLabel: ariaLabelSelectButton,
1274
- icon: icon || 'caret-alt-down',
1275
- svgIcon: svgIcon || kendo_svg_icons_1.caretAltDownIcon,
1276
- iconClass: iconClassName
1277
- },
1278
- tabIndex: -1,
1279
- size: size,
1280
- fillMode: fillMode,
1281
- rounded: null,
1282
- ariaLabel: ariaLabelSelectButton,
1283
- "class": 'k-input-button',
1284
- icon: icon || 'caret-alt-down',
1285
- svgIcon: svgIcon || kendo_svg_icons_1.caretAltDownIcon,
1286
- iconClass: iconClassName
1287
- }), dummySelect.call(this, value), !renderAdaptive && renderListContainer.call(this)]);
1288
- };
1289
- // The following one combines the default rendering of the DropDownList and the Adaptive rendering.
1290
- // This is needed because of Vue 2 specifics
1291
- var dropdownlist = [isV3 ? h(dropdownlistDefault.call(this), __assign({}, this.$attrs)) : dropdownlistDefault.call(this), renderAdaptive && renderAdaptiveListContainer.call(this)];
1292
- var dropdownlistToRender = isV3 ? dropdownlist : renderAdaptive ? h("div", [dropdownlist]) : dropdownlistDefault.call(this);
1293
- return label ? h("span", {
1294
- "class": this.spanClassNames,
1295
- onFocusin: this.handleFocus,
1296
- on: this.v3 ? undefined : {
1297
- "focusin": this.handleFocus,
1298
- "focusout": this.handleBlur
1299
- },
1300
- onFocusout: this.handleBlur,
1301
- dir: this.$props.dir,
1302
- attrs: this.v3 ? undefined : {
1303
- dir: this.$props.dir
1304
- }
1305
- }, [dropdownlistToRender, this.$props.label ? id ? h("label", {
1306
- "for": id,
1307
- attrs: this.v3 ? undefined : {
1308
- "for": id
1309
- },
1310
- "class": "k-floating-label"
1311
- }, [this.$props.label]) : h("span", {
1312
- "class": "k-label"
1313
- }, [this.$props.label]) : null]) : dropdownlistToRender;
1314
- }
1315
- };
1316
- exports.DropDownListVue2 = DropDownListVue2;
1317
- /**
1318
- * @hidden
1319
- */
1320
- var DropDownList = DropDownListVue2;
1321
- exports.DropDownList = DropDownList;