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

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,1522 +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
- var __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {
16
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
17
- if (ar || !(i in from)) {
18
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
19
- ar[i] = from[i];
20
- }
21
- }
22
- return to.concat(ar || Array.prototype.slice.call(from));
23
- };
24
- Object.defineProperty(exports, "__esModule", {
25
- value: true
26
- });
27
- exports.MultiSelectVue2 = exports.MultiSelect = void 0;
28
- // @ts-ignore
29
- var Vue = require("vue");
30
- var allVue = Vue;
31
- var gh = allVue.h;
32
- var isV3 = allVue.version && allVue.version[0] === '3';
33
- var ref = allVue.ref;
34
- var inject = allVue.inject;
35
- var kendo_vue_common_1 = require("@progress/kendo-vue-common");
36
- var sizeMap = kendo_vue_common_1.kendoThemeMaps.sizeMap,
37
- roundedMap = kendo_vue_common_1.kendoThemeMaps.roundedMap;
38
- var ListContainer_1 = require("../common/ListContainer");
39
- var List_1 = require("../common/List");
40
- var TagList_1 = require("./TagList");
41
- var SearchBar_1 = require("../common/SearchBar");
42
- var DropDownBase_1 = require("../common/DropDownBase");
43
- var GroupStickyHeader_1 = require("../common/GroupStickyHeader");
44
- var ClearButton_1 = require("../common/ClearButton");
45
- var settings_1 = require("./../common/settings");
46
- var utils_1 = require("../common/utils");
47
- var kendo_svg_icons_1 = require("@progress/kendo-svg-icons");
48
- var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
49
- var constants_1 = require("../common/constants");
50
- var kendo_vue_layout_1 = require("@progress/kendo-vue-layout");
51
- var ListFilter_1 = require("../common/ListFilter");
52
- var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
53
- var main_1 = require("./../messages/main");
54
- var VALIDATION_MESSAGE = 'Please enter a valid value!';
55
- var preventDefault = function preventDefault(event) {
56
- return event.preventDefault();
57
- };
58
- var matchTags = function matchTags(tag1, tag2, key) {
59
- if (!!tag1 !== !!tag2 || tag1.text !== tag2.text) {
60
- return false;
61
- }
62
- return tag1 === tag2 || (0, utils_1.matchDataCollections)(tag1.data, tag2.data, key);
63
- };
64
- var isCustom = function isCustom(type) {
65
- return type === FocusedItemType.CustomItem;
66
- };
67
- var FocusedItemType;
68
- (function (FocusedItemType) {
69
- FocusedItemType[FocusedItemType["None"] = 0] = "None";
70
- FocusedItemType[FocusedItemType["ListItem"] = 1] = "ListItem";
71
- FocusedItemType[FocusedItemType["CustomItem"] = 2] = "CustomItem";
72
- })(FocusedItemType || (FocusedItemType = {}));
73
- /**
74
- * @hidden
75
- */
76
- var MultiSelectVue2 = {
77
- name: 'KendoMultiSelect',
78
- // @ts-ignore
79
- emits: {
80
- 'changemodel': null,
81
- 'update:modelValue': null,
82
- 'filterchange': null,
83
- change: null,
84
- pagechange: null,
85
- focus: null,
86
- blur: null,
87
- open: null,
88
- close: null,
89
- scroll: null
90
- },
91
- model: {
92
- event: 'changemodel'
93
- },
94
- props: {
95
- autoClose: {
96
- type: Boolean,
97
- default: true
98
- },
99
- removeTagIcon: String,
100
- allowCustom: Boolean,
101
- modelValue: Array,
102
- opened: {
103
- type: Boolean,
104
- default: undefined
105
- },
106
- disabled: Boolean,
107
- dir: String,
108
- tabIndex: {
109
- type: Number,
110
- default: 0
111
- },
112
- accessKey: String,
113
- dataItems: Array,
114
- textField: String,
115
- label: String,
116
- loading: Boolean,
117
- name: String,
118
- value: Array,
119
- defaultValue: Array,
120
- valueField: String,
121
- valuePrimitive: Boolean,
122
- dataItemKey: String,
123
- placeholder: String,
124
- tags: Array,
125
- required: {
126
- type: Boolean,
127
- default: false
128
- },
129
- valid: {
130
- type: Boolean,
131
- default: undefined
132
- },
133
- validate: {
134
- type: Boolean
135
- },
136
- validationMessage: {
137
- type: String,
138
- default: undefined
139
- },
140
- validityStyles: {
141
- type: Boolean,
142
- default: true
143
- },
144
- tagRender: [String, Function, Object],
145
- id: String,
146
- popupSettings: {
147
- type: Object,
148
- default: function _default() {
149
- return {
150
- animate: true,
151
- height: '200px',
152
- anchor: ''
153
- };
154
- }
155
- },
156
- itemRender: [String, Function, Object],
157
- groupHeaderItemRender: [String, Function, Object],
158
- groupStickyHeaderItemRender: [String, Function, Object],
159
- listNoDataRender: [String, Function, Object],
160
- focusedItemIndex: Function,
161
- virtual: {
162
- type: Object,
163
- default: undefined
164
- },
165
- header: [String, Function, Object],
166
- footer: [String, Function, Object],
167
- filterable: Boolean,
168
- filter: {
169
- type: String,
170
- default: undefined
171
- },
172
- ariaLabel: {
173
- type: String,
174
- default: undefined
175
- },
176
- ariaLabelledBy: String,
177
- ariaDescribedBy: String,
178
- rounded: {
179
- type: String,
180
- default: 'medium',
181
- validator: function validator(value) {
182
- return ['small', 'medium', 'large', 'full'].includes(value);
183
- }
184
- },
185
- tagsRounded: {
186
- type: String,
187
- default: 'medium',
188
- validator: function validator(value) {
189
- return ['small', 'medium', 'large', 'full'].includes(value);
190
- }
191
- },
192
- fillMode: {
193
- type: String,
194
- default: 'solid',
195
- validator: function validator(value) {
196
- return ['solid', 'flat', 'outline'].includes(value);
197
- }
198
- },
199
- size: {
200
- type: String,
201
- default: 'medium',
202
- validator: function validator(value) {
203
- return ['small', 'medium', 'large'].includes(value);
204
- }
205
- },
206
- groupField: {
207
- type: String
208
- },
209
- adaptive: {
210
- type: Boolean,
211
- default: undefined
212
- },
213
- adaptiveTitle: {
214
- type: String,
215
- default: undefined
216
- }
217
- },
218
- // @ts-ignore
219
- setup: !isV3 ? undefined : function () {
220
- var v3 = !!isV3;
221
- var inputRef = ref(null);
222
- var kendoAnchorRef = ref(null);
223
- var kendoLocalizationService = inject('kendoLocalizationService', {});
224
- return {
225
- v3: v3,
226
- inputRef: inputRef,
227
- kendoAnchorRef: kendoAnchorRef,
228
- kendoLocalizationService: kendoLocalizationService
229
- };
230
- },
231
- computed: {
232
- spanClassNames: {
233
- get: function get() {
234
- var isValid = !this.hasMounted || !this.$props.validityStyles || this.validity().valid;
235
- var editorValue = this.currentText || (0, utils_1.getItemValue)(this.computedValue()[0], this.$props.textField);
236
- return {
237
- 'k-floating-label-container': true,
238
- 'k-focus': this.currentFocused,
239
- 'k-empty': !(editorValue && editorValue !== 0),
240
- 'k-invalid': !isValid && isValid !== undefined,
241
- 'k-rtl': this.$props.dir === 'rtl'
242
- };
243
- }
244
- },
245
- isOpen: {
246
- get: function get() {
247
- return this.$props.opened !== undefined ? this.$props.opened : this.currentOpened;
248
- }
249
- },
250
- animationStyles: {
251
- get: function get() {
252
- return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? {
253
- top: 0,
254
- width: '100%',
255
- height: '100%'
256
- } : undefined;
257
- }
258
- },
259
- classNameAdaptive: {
260
- get: function get() {
261
- return this.windowWidth <= constants_1.MOBILE_SMALL_DEVICE ? 'k-adaptive-actionsheet k-actionsheet-fullscreen' : 'k-adaptive-actionsheet k-actionsheet-bottom';
262
- }
263
- },
264
- adaptiveState: {
265
- get: function get() {
266
- return this.windowWidth <= constants_1.MOBILE_MEDIUM_DEVICE && this.$props.adaptive;
267
- }
268
- }
269
- },
270
- created: function created() {
271
- this.observer = null;
272
- this.valuesItemsDuringOnChange = null;
273
- this._tags = [];
274
- this._skipFocusEvent = false;
275
- this.scrollToFocused = false;
276
- this.base = new DropDownBase_1.default(this);
277
- this.anchor = (0, kendo_vue_common_1.guid)();
278
- this.inputId = (0, kendo_vue_common_1.guid)();
279
- },
280
- inject: {
281
- kendoLocalizationService: {
282
- default: null
283
- }
284
- },
285
- data: function data() {
286
- return {
287
- hasMounted: false,
288
- currentText: '',
289
- currentValue: '',
290
- currentFocused: false,
291
- currentOpened: false,
292
- currentFocusedIndex: undefined,
293
- currentFocusedTag: undefined,
294
- searchState: {
295
- word: '',
296
- last: ''
297
- },
298
- suggested: '',
299
- activedescendant: settings_1.ActiveDescendant.PopupList,
300
- group: undefined,
301
- isScrolling: false,
302
- itemHeight: 0,
303
- windowWidth: 0,
304
- popupWidth: undefined,
305
- initialAdaptiveRenderingValues: undefined
306
- };
307
- },
308
- watch: {
309
- currentOpened: function currentOpened(_, oldValue) {
310
- this.prevCurrentOpened = oldValue;
311
- },
312
- opened: function opened(_, oldValue) {
313
- this.prevOpened = oldValue;
314
- },
315
- virtual: function virtual(newValue, oldValue) {
316
- if (newValue && oldValue && newValue.total !== oldValue.total) {
317
- this.virtualTotalHasChanged = true;
318
- }
319
- },
320
- isOpen: function isOpen(newValue) {
321
- var _this = this;
322
- if (newValue) {
323
- this.initialAdaptiveRenderingValues = this.base.component.currentValue;
324
- } else {
325
- this.initialAdaptiveRenderingValues = undefined;
326
- }
327
- setTimeout(function () {
328
- var listItem = document.querySelector('.k-list-item');
329
- _this.itemHeight = _this.base.getListItemHeight(listItem);
330
- }, 100);
331
- }
332
- },
333
- updated: function updated() {
334
- var _a;
335
- var _b = this.$props,
336
- virtual = _b.virtual,
337
- _c = _b.groupField,
338
- groupField = _c === void 0 ? '' : _c,
339
- _d = _b.dataItems,
340
- dataItems = _d === void 0 ? [] : _d;
341
- var skip = virtual ? virtual.skip : 0;
342
- var opened = this.isOpen;
343
- var prevOpened = this.prevOpened !== undefined ? this.prevOpened : this.prevCurrentOpened;
344
- var opening = !prevOpened && opened;
345
- var closing = prevOpened && !opened;
346
- var popupSettings = Object.assign({}, {
347
- animate: true,
348
- height: '200px'
349
- }, this.$props.popupSettings);
350
- var list = this.$refs.list;
351
- var scrollElement = this.$refs.scrollElement;
352
- if (list) {
353
- // @ts-ignore
354
- this.base.vs.list = list.list;
355
- // @ts-ignore
356
- this.base.list = list.list;
357
- }
358
- if (scrollElement) {
359
- this.base.vs.scrollElement = scrollElement;
360
- }
361
- if (list && dataItems.length) {
362
- // @ts-ignore
363
- this.base.vs.scrollerRef(list.$el);
364
- }
365
- if (!popupSettings.animate && closing) {
366
- this.onPopupClosed();
367
- }
368
- if (!this.isScrolling) {
369
- if (virtual && this.virtualTotalHasChanged) {
370
- this.base.vs.calcScrollElementHeight();
371
- this.base.vs.reset();
372
- this.virtualTotalHasChanged = false;
373
- } else {
374
- var _e = this.getFocusedState(),
375
- focusedItem = _e.focusedItem,
376
- focusedIndex = _e.focusedIndex;
377
- if (groupField !== '') {
378
- focusedIndex = (_a = this.base.getGroupedDataModernMode(dataItems, groupField)) === null || _a === void 0 ? void 0 : _a.indexOf(focusedItem);
379
- }
380
- if (opening && virtual) {
381
- this.base.scrollToVirtualItem(virtual, focusedIndex - skip);
382
- this.prevCurrentOpened = true;
383
- } else if (opening && !virtual) {
384
- // Resets the sticky header group value for scenarios with open/close of component's popup
385
- if (dataItems && dataItems.length !== 0) {
386
- this.base.resetGroupStickyHeader(dataItems[0][groupField], this);
387
- }
388
- this.base.scrollToItem(focusedIndex);
389
- this.prevCurrentOpened = true;
390
- } else if (opened && prevOpened && focusedItem) {
391
- this.base.scrollToItem(focusedIndex - skip);
392
- }
393
- }
394
- }
395
- this.scrollToFocused = false;
396
- this.searchBarRef();
397
- this.setValidity();
398
- },
399
- mounted: function mounted() {
400
- this.observer = kendo_vue_common_1.canUseDOM && new ResizeObserver(this.calculateMedia);
401
- if ((document === null || document === void 0 ? void 0 : document.body) && this.observer) {
402
- this.observer.observe(document.body);
403
- }
404
- this.hasMounted = true;
405
- // @ts-ignore
406
- this.input = this.v3 ? this.inputRef.input : this.$refs.input.input;
407
- this.base.wrapper = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
408
- this.element = (0, kendo_vue_common_1.getRef)(this, 'kendoAnchor', this.anchor);
409
- this.base.didMount();
410
- this.searchBarRef();
411
- this.setValidity();
412
- },
413
- destroyed: !!isV3 ? undefined : function () {
414
- if (this.observer) {
415
- this.observer.disconnect();
416
- }
417
- },
418
- methods: {
419
- clearFilter: function clearFilter(state) {
420
- if (this.currentText) {
421
- state.data.currentText = '';
422
- }
423
- this.base.filterChanged('', state);
424
- },
425
- computedValue: function computedValue() {
426
- var result = [];
427
- if (this.valuesItemsDuringOnChange) {
428
- result.push.apply(result, this.valuesItemsDuringOnChange);
429
- } else if (this.$props.value) {
430
- result.push.apply(result, this.$props.value);
431
- } else if (this.$props.modelValue !== undefined) {
432
- result.push.apply(result, this.$props.modelValue);
433
- } else if (this.currentValue) {
434
- result.push.apply(result, this.currentValue);
435
- } else if (this.$props.defaultValue) {
436
- result.push.apply(result, this.$props.defaultValue);
437
- }
438
- return this.valuePrimitive ? this.findByFieldValue(this.valueField, result) || result : result;
439
- },
440
- findByFieldValue: function findByFieldValue(field, result) {
441
- var _this = this;
442
- var newResult = result.map(function (currentValue) {
443
- var index = _this.dataItems.findIndex(function (i) {
444
- return (0, utils_1.getItemValue)(i, field) === currentValue;
445
- });
446
- return _this.dataItems[index] || currentValue;
447
- });
448
- return newResult;
449
- },
450
- primitiveValue: function primitiveValue() {
451
- var _this = this;
452
- var computed = this.computedValue();
453
- var value = computed.map(function (v) {
454
- return (0, utils_1.getItemValue)(v, _this.valueField);
455
- });
456
- return this.valuePrimitive ? value : computed;
457
- },
458
- validity: function validity() {
459
- var customError = this.$props.validationMessage !== undefined;
460
- var value = this.computedValue();
461
- var isValid = !this.$props.required || value !== null && value.length > 0 && value !== undefined;
462
- var valid = this.$props.valid !== undefined ? this.$props.valid : isValid;
463
- return {
464
- customError: customError,
465
- valid: valid,
466
- valueMissing: value === null
467
- };
468
- },
469
- handleItemSelect: function handleItemSelect(index, state) {
470
- var _a = this.$props,
471
- _b = _a.dataItems,
472
- dataItems = _b === void 0 ? [] : _b,
473
- dataItemKey = _a.dataItemKey,
474
- virtual = _a.virtual;
475
- var value = this.computedValue();
476
- var skip = virtual ? virtual.skip : 0;
477
- var dataItem = dataItems[index - skip];
478
- var indexInValue = value.findIndex(function (i) {
479
- return (0, utils_1.areSame)(i, dataItem, dataItemKey);
480
- });
481
- var newItems = [];
482
- if (indexInValue !== -1) {
483
- // item is already selected
484
- newItems = value;
485
- newItems.splice(indexInValue, 1);
486
- } else {
487
- newItems = __spreadArray(__spreadArray([], value, true), [dataItem], false);
488
- }
489
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
490
- if (text && !this.adaptiveState) {
491
- this.clearFilter(state);
492
- }
493
- if (this.currentFocusedIndex !== undefined) {
494
- state.data.currentFocusedIndex = undefined;
495
- }
496
- this.triggerOnChange(newItems, state);
497
- this.base.triggerPageChangeCornerItems(dataItem, state);
498
- },
499
- onTagDelete: function onTagDelete(itemsToRemove, event) {
500
- var opened = this.isOpen;
501
- var state = this.base.initState();
502
- state.event = event;
503
- if (opened) {
504
- this.base.togglePopup(state);
505
- }
506
- if (!this.currentFocused) {
507
- state.data.currentFocused = true;
508
- }
509
- var selected = this.computedValue();
510
- (0, utils_1.removeDataItems)(selected, itemsToRemove, this.$props.dataItemKey);
511
- this.triggerOnChange(selected, state);
512
- this.applyState(state);
513
- },
514
- onNavigate: function onNavigate(state, keyCode) {
515
- var _a = this.$props,
516
- allowCustom = _a.allowCustom,
517
- _b = _a.dataItems,
518
- dataItems = _b === void 0 ? [] : _b;
519
- var opened = this.isOpen;
520
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
521
- var _c = this.getFocusedState(),
522
- focusedType = _c.focusedType,
523
- focusedIndex = _c.focusedIndex;
524
- var customItem = allowCustom && text;
525
- var customItemFocused = isCustom(focusedType);
526
- var base = this.base;
527
- var vs = base.vs;
528
- if (opened && keyCode === kendo_vue_common_1.Keys.up && customItemFocused) {
529
- if (this.currentFocusedIndex !== undefined) {
530
- state.data.currentFocusedIndex = undefined;
531
- }
532
- } else {
533
- var newFocused = base.navigation.navigate({
534
- keyCode: keyCode,
535
- current: focusedIndex,
536
- max: (vs.enabled ? vs.total : dataItems.length) - 1,
537
- min: customItem ? -1 : 0
538
- });
539
- if (newFocused !== undefined) {
540
- this.itemFocus(newFocused, state);
541
- this.scrollToFocused = true;
542
- }
543
- }
544
- this.applyState(state);
545
- },
546
- itemFocus: function itemFocus(index, state) {
547
- var _a = this.$props,
548
- _b = _a.dataItems,
549
- dataItems = _b === void 0 ? [] : _b,
550
- allowCustom = _a.allowCustom,
551
- virtual = _a.virtual;
552
- var skip = virtual ? virtual.skip : 0;
553
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
554
- var focusedIndex = this.getFocusedState().focusedIndex;
555
- var customItem = allowCustom && text;
556
- var nextFocusedItem = dataItems[index - skip];
557
- if (nextFocusedItem && focusedIndex !== index) {
558
- if (this.currentFocusedIndex !== index) {
559
- state.data.currentFocusedIndex = index;
560
- state.data.activedescendant = settings_1.ActiveDescendant.PopupList;
561
- }
562
- } else if (customItem && index === -1) {
563
- if (this.currentFocusedIndex !== undefined) {
564
- state.data.currentFocusedIndex = undefined;
565
- }
566
- }
567
- this.base.triggerPageChangeCornerItems(nextFocusedItem, state);
568
- },
569
- searchBarRef: function searchBarRef() {
570
- var _this = this;
571
- if (this.input && this.currentFocused) {
572
- setTimeout(function () {
573
- return _this.input.focus();
574
- }, 0);
575
- }
576
- },
577
- onChangeHandler: function onChangeHandler(event) {
578
- var state = this.base.initState();
579
- var value = event && (event.currentTarget && event.currentTarget.value || event.value);
580
- var opened = this.isOpen;
581
- state.event = event;
582
- if (this.$props.filter === undefined) {
583
- state.data.currentText = value;
584
- }
585
- state.data.currentFocusedIndex = undefined;
586
- if (!opened) {
587
- this.base.togglePopup(state);
588
- }
589
- this.base.filterChanged(value, state);
590
- // Resets the value of the StickyHeader when filtering the data or just entering symbols in the input
591
- if (this.$props.filterable) {
592
- state.data.group = undefined;
593
- }
594
- this.applyState(state);
595
- },
596
- clearButtonClick: function clearButtonClick(event) {
597
- var opened = this.isOpen;
598
- var state = this.base.initState();
599
- state.event = event;
600
- event.stopPropagation();
601
- if (this.computedValue().length > 0) {
602
- this.triggerOnChange([], state);
603
- }
604
- if (this.currentFocusedIndex !== undefined) {
605
- state.data.currentFocusedIndex = undefined;
606
- }
607
- if (opened) {
608
- this.base.togglePopup(state);
609
- }
610
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
611
- if ((0, utils_1.isPresent)(text) && text !== '') {
612
- this.base.filterChanged('', state);
613
- }
614
- if (this.currentText) {
615
- state.data.currentText = '';
616
- }
617
- this.applyState(state);
618
- },
619
- onInputKeyDown: function onInputKeyDown(event) {
620
- var _this = this;
621
- if (this.isScrolling) {
622
- this.isScrolling = false;
623
- }
624
- var keyCode = event.keyCode;
625
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
626
- var opened = this.isOpen;
627
- var focusedItem = this.getFocusedState().focusedItem;
628
- var state = this.base.initState();
629
- state.event = event;
630
- if (!text && this.computedValue().length > 0 && (keyCode === kendo_vue_common_1.Keys.left || keyCode === kendo_vue_common_1.Keys.right || keyCode === kendo_vue_common_1.Keys.home || keyCode === kendo_vue_common_1.Keys.end || keyCode === kendo_vue_common_1.Keys.delete || keyCode === kendo_vue_common_1.Keys.backspace)) {
631
- return this.onTagsNavigate(event, state);
632
- }
633
- var togglePopup = function togglePopup() {
634
- event.preventDefault();
635
- _this.base.togglePopup(state);
636
- _this.applyState(state);
637
- };
638
- if (opened) {
639
- if (event.altKey && keyCode === kendo_vue_common_1.Keys.up) {
640
- togglePopup();
641
- } else if (keyCode === kendo_vue_common_1.Keys.up || keyCode === kendo_vue_common_1.Keys.down) {
642
- event.preventDefault();
643
- this.onNavigate(state, keyCode);
644
- } else if (keyCode === kendo_vue_common_1.Keys.enter) {
645
- event.preventDefault();
646
- if (this.$props.allowCustom && text && focusedItem === null) {
647
- this.customItemSelect(event);
648
- } else {
649
- this.selectFocusedItem(event);
650
- }
651
- } else if (keyCode === kendo_vue_common_1.Keys.esc) {
652
- if (this.adaptiveState) {
653
- this.handleWrapperClick(event); // Handle the closing on "Esc" key press in adaptive mode
654
- }
655
-
656
- togglePopup();
657
- }
658
- } else if (event.altKey && keyCode === kendo_vue_common_1.Keys.down) {
659
- togglePopup();
660
- }
661
- },
662
- onTagsNavigate: function onTagsNavigate(event, state) {
663
- var keyCode = event.keyCode;
664
- var focusedTag = this.currentFocusedTag;
665
- var tags = this._tags;
666
- var itemsKey = this.$props.dataItemKey;
667
- var focusedIndex = focusedTag ? tags.findIndex(function (t) {
668
- return matchTags(t, focusedTag, itemsKey);
669
- }) : -1;
670
- var newFocusedTag = undefined;
671
- var hasFocused = focusedIndex !== -1;
672
- if (keyCode === kendo_vue_common_1.Keys.left) {
673
- if (hasFocused) {
674
- focusedIndex = Math.max(0, focusedIndex - 1);
675
- } else {
676
- focusedIndex = tags.length - 1;
677
- }
678
- newFocusedTag = tags[focusedIndex];
679
- } else if (keyCode === kendo_vue_common_1.Keys.right) {
680
- if (focusedIndex === tags.length - 1) {
681
- newFocusedTag = undefined;
682
- } else if (hasFocused) {
683
- focusedIndex = Math.min(tags.length - 1, focusedIndex + 1);
684
- newFocusedTag = tags[focusedIndex];
685
- }
686
- } else if (keyCode === kendo_vue_common_1.Keys.home) {
687
- newFocusedTag = tags[0];
688
- } else if (keyCode === kendo_vue_common_1.Keys.end) {
689
- newFocusedTag = tags[tags.length - 1];
690
- } else if (keyCode === kendo_vue_common_1.Keys.delete) {
691
- if (hasFocused) {
692
- var items = this.computedValue();
693
- (0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
694
- this.triggerOnChange(items, state);
695
- }
696
- } else if (keyCode === kendo_vue_common_1.Keys.backspace) {
697
- var items = this.computedValue();
698
- if (hasFocused) {
699
- (0, utils_1.removeDataItems)(items, tags[focusedIndex].data, itemsKey);
700
- this.triggerOnChange(items, state);
701
- } else if (!hasFocused && tags.length) {
702
- var removed = tags.pop();
703
- (0, utils_1.removeDataItems)(items, removed.data, itemsKey);
704
- this.triggerOnChange(items, state);
705
- }
706
- }
707
- if (newFocusedTag !== focusedTag) {
708
- state.data.currentFocusedTag = newFocusedTag;
709
- state.data.activedescendant = settings_1.ActiveDescendant.TagsList;
710
- }
711
- this.applyState(state);
712
- },
713
- triggerOnChange: function triggerOnChange(items, state) {
714
- if (this.$props.value === undefined) {
715
- state.data.currentValue = __spreadArray([], items, true);
716
- }
717
- this.valuesItemsDuringOnChange = [];
718
- this.setItems(items, this.valuesItemsDuringOnChange);
719
- state.events.push({
720
- type: 'change'
721
- });
722
- },
723
- selectFocusedItem: function selectFocusedItem(event) {
724
- var _a = this.$props,
725
- _b = _a.dataItems,
726
- dataItems = _b === void 0 ? [] : _b,
727
- virtual = _a.virtual;
728
- var focusedIndex = this.getFocusedState().focusedIndex;
729
- var skip = virtual ? virtual.skip : 0;
730
- if (dataItems[focusedIndex - skip] !== undefined) {
731
- this.handleItemClick(focusedIndex, event);
732
- }
733
- },
734
- setItems: function setItems(srcItems, destItems) {
735
- destItems.length = 0;
736
- destItems.push.apply(destItems, srcItems);
737
- },
738
- getFocusedState: function getFocusedState() {
739
- var focusedIndex = this.currentFocusedIndex;
740
- var text = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
741
- var _a = this.$props,
742
- allowCustom = _a.allowCustom,
743
- _b = _a.dataItems,
744
- dataItems = _b === void 0 ? [] : _b,
745
- dataItemKey = _a.dataItemKey,
746
- virtual = _a.virtual,
747
- textField = _a.textField,
748
- _c = _a.focusedItemIndex,
749
- focusedItemIndex = _c === void 0 ? utils_1.itemIndexStartsWith : _c;
750
- var skip = virtual && virtual.skip || 0;
751
- var focusedInd;
752
- if (focusedIndex !== undefined) {
753
- return {
754
- focusedIndex: focusedIndex,
755
- focusedItem: dataItems[focusedIndex - skip],
756
- focusedType: FocusedItemType.ListItem
757
- };
758
- }
759
- var selected = this.computedValue();
760
- if (allowCustom && text) {
761
- return {
762
- focusedItem: null,
763
- focusedIndex: -1,
764
- focusedType: FocusedItemType.CustomItem
765
- };
766
- } else if (text) {
767
- focusedInd = focusedItemIndex(dataItems, text, textField);
768
- return {
769
- focusedItem: dataItems[focusedInd],
770
- focusedIndex: focusedInd + skip,
771
- focusedType: FocusedItemType.ListItem
772
- };
773
- } else if (selected.length) {
774
- var last_1 = selected[selected.length - 1];
775
- focusedInd = dataItems.findIndex(function (i) {
776
- return (0, utils_1.areSame)(i, last_1, dataItemKey);
777
- });
778
- if (dataItems[focusedInd] !== undefined) {
779
- return {
780
- focusedIndex: focusedInd + skip,
781
- focusedItem: dataItems[focusedInd],
782
- focusedType: FocusedItemType.ListItem
783
- };
784
- }
785
- return {
786
- focusedType: FocusedItemType.None,
787
- focusedIndex: -1
788
- };
789
- }
790
- return skip === 0 ? {
791
- focusedItem: dataItems[0],
792
- focusedIndex: 0,
793
- focusedType: FocusedItemType.ListItem
794
- } : {
795
- focusedType: FocusedItemType.None,
796
- focusedIndex: -1
797
- };
798
- },
799
- customItemSelect: function customItemSelect(event) {
800
- var _a;
801
- var itemText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
802
- var textField = this.$props.textField;
803
- if (!itemText) {
804
- return;
805
- }
806
- var state = this.base.initState();
807
- state.event = event;
808
- var item = textField ? (_a = {}, _a[textField] = itemText, _a) : itemText;
809
- if (this.currentText !== undefined) {
810
- state.data.currentText = '';
811
- }
812
- state.data.currentFocusedIndex = undefined;
813
- this.base.filterChanged('', state);
814
- var newItems = __spreadArray(__spreadArray([], this.computedValue(), true), [item], false);
815
- this.triggerOnChange(newItems, state);
816
- this.base.togglePopup(state);
817
- this.applyState(state);
818
- },
819
- handleWrapperClick: function handleWrapperClick(event) {
820
- var opened = this.isOpen;
821
- var input = this.input;
822
- if (!opened && input) {
823
- this.focusElement(input);
824
- }
825
- var state = this.base.initState();
826
- state.event = event;
827
- if (!this.currentFocused) {
828
- state.events.push({
829
- type: 'focus'
830
- });
831
- state.data.currentFocused = true;
832
- }
833
- this.clearFilter(state);
834
- this.base.togglePopup(state);
835
- this.applyState(state);
836
- },
837
- onCancel: function onCancel(event) {
838
- var state = this.base.initState();
839
- state.event = event;
840
- event.stopPropagation();
841
- var opened = this.isOpen;
842
- if (state.focusedIndex !== undefined) {
843
- state.data.focusedIndex = undefined;
844
- }
845
- if (opened) {
846
- this.base.togglePopup(state);
847
- }
848
- state.events.push({
849
- type: 'onCancel'
850
- });
851
- this.clearFilter(state);
852
- this.triggerOnChange(__spreadArray([], this.initialAdaptiveRenderingValues, true), state);
853
- this.base.triggerPageChangeCornerItems(__spreadArray([], this.initialAdaptiveRenderingValues, true), state);
854
- this.applyState(state);
855
- },
856
- handleItemClick: function handleItemClick(index, event) {
857
- var state = this.base.initState();
858
- state.event = event;
859
- this.handleItemSelect(index, state);
860
- if (this.$props.autoClose && !this.adaptiveState) {
861
- this.base.togglePopup(state);
862
- }
863
- this.applyState(state);
864
- },
865
- handleBlur: function handleBlur(event) {
866
- if (!this.currentFocused || this._skipFocusEvent) {
867
- return;
868
- }
869
- var opened = this.isOpen;
870
- var state = this.base.initState();
871
- var _a = this.$props,
872
- allowCustom = _a.allowCustom,
873
- filterable = _a.filterable;
874
- state.event = event;
875
- state.data.currentFocused = false;
876
- state.events.push({
877
- type: 'blur'
878
- });
879
- if (opened && !this.adaptiveState) {
880
- if (this.currentOpened) {
881
- state.data.currentOpened = false;
882
- }
883
- state.events.push({
884
- type: 'close'
885
- });
886
- }
887
- if (!allowCustom && !filterable && this.currentText) {
888
- state.data.currentText = '';
889
- }
890
- this.applyState(state);
891
- },
892
- handleFocus: function handleFocus(event) {
893
- if (this._skipFocusEvent) {
894
- return;
895
- }
896
- this.base.handleFocus(event);
897
- },
898
- onPopupOpened: function onPopupOpened() {
899
- if (this.input && this.currentFocused) {
900
- this.focusElement(this.input);
901
- }
902
- },
903
- onPopupClosed: function onPopupClosed() {
904
- var _this = this;
905
- if (this.currentFocused) {
906
- setTimeout(function () {
907
- if (_this.currentFocused) {
908
- _this.focusElement(_this.input);
909
- }
910
- }, 0);
911
- }
912
- },
913
- focusElement: function focusElement(element) {
914
- var _this = this;
915
- this._skipFocusEvent = true;
916
- element.focus();
917
- setTimeout(function () {
918
- return _this._skipFocusEvent = false;
919
- }, 30);
920
- },
921
- applyState: function applyState(state) {
922
- this.base.applyState(state);
923
- this.valuesItemsDuringOnChange = null;
924
- },
925
- setValidity: function setValidity() {
926
- if (this.input && this.input.setCustomValidity) {
927
- this.input.setCustomValidity(this.validity().valid ? '' : this.$props.validationMessage || VALIDATION_MESSAGE);
928
- }
929
- },
930
- focus: function focus() {
931
- if (this.input) {
932
- this.input.focus();
933
- }
934
- },
935
- calculateMedia: function calculateMedia(entries) {
936
- for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
937
- var entry = entries_1[_i];
938
- this.windowWidth = entry.target.clientWidth;
939
- }
940
- },
941
- repositionPopup: function repositionPopup() {
942
- this.base.repositionPopup();
943
- },
944
- onScroll: function onScroll(event) {
945
- this.isScrolling = true;
946
- var _a = this.base,
947
- vs = _a.vs,
948
- list = _a.list;
949
- vs.scrollHandler(event);
950
- var state = this.base.initState();
951
- var groupField = this.$props.groupField;
952
- var _b = this.$props.dataItems,
953
- dataItems = _b === void 0 ? [] : _b;
954
- var group;
955
- if (!groupField || !dataItems.length) {
956
- return;
957
- }
958
- var itemHeight = this.itemHeight = this.itemHeight || (vs.enabled ? vs.itemHeight : list ? list.children[0].offsetHeight : 0);
959
- var target = event.target;
960
- var scrollTop = target.scrollTop - vs.skip * itemHeight;
961
- if (groupField) {
962
- dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
963
- dataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
964
- group = dataItems[0][groupField];
965
- }
966
- for (var i = 1; i < dataItems.length; i++) {
967
- if (itemHeight * i > scrollTop) {
968
- break;
969
- }
970
- if (dataItems[i] && dataItems[i][groupField]) {
971
- group = dataItems[i][groupField];
972
- }
973
- }
974
- if (group !== this.group) {
975
- state.data.group = group;
976
- this.applyState(state);
977
- }
978
- }
979
- },
980
- render: function render(createElement) {
981
- var _this = this;
982
- var h = gh || createElement;
983
- var _a = this.$props,
984
- style = _a.style,
985
- label = _a.label,
986
- dir = _a.dir,
987
- disabled = _a.disabled,
988
- tags = _a.tags,
989
- textField = _a.textField,
990
- dataItemKey = _a.dataItemKey,
991
- virtual = _a.virtual,
992
- loading = _a.loading,
993
- size = _a.size,
994
- fillMode = _a.fillMode,
995
- rounded = _a.rounded,
996
- tagsRounded = _a.tagsRounded,
997
- removeTagIcon = _a.removeTagIcon,
998
- adaptiveTitle = _a.adaptiveTitle,
999
- header = _a.header,
1000
- footer = _a.footer,
1001
- groupStickyHeaderItemRender = _a.groupStickyHeaderItemRender,
1002
- _b = _a.dataItems,
1003
- dataItems = _b === void 0 ? [] : _b;
1004
- var focused = this.currentFocused;
1005
- var popupSettings = Object.assign({}, {
1006
- animate: true,
1007
- height: '200px'
1008
- }, this.$props.popupSettings);
1009
- var focusedTag = this.currentFocusedTag;
1010
- var value = this.computedValue();
1011
- var searchText = (this.$props.filter !== undefined ? this.$props.filter : this.currentText) || '';
1012
- var clearButton = !loading && (!!searchText || value.length > 0);
1013
- var vs = this.base.vs;
1014
- var id = this.$props.id || this.inputId;
1015
- var tagRender = kendo_vue_common_1.templateRendering.call(this, this.$props.tagRender, kendo_vue_common_1.getListeners.call(this));
1016
- var opened = this.isOpen;
1017
- var renderAdaptive = this.adaptiveState;
1018
- var localization = (0, kendo_vue_intl_1.provideLocalizationService)(this);
1019
- if (this.group === undefined && this.$props.groupField !== undefined) {
1020
- this.group = (0, utils_1.getItemValue)(this.$props.dataItems[0], this.$props.groupField);
1021
- }
1022
- vs.enabled = virtual !== undefined;
1023
- if (virtual !== undefined) {
1024
- vs.skip = virtual.skip;
1025
- vs.total = virtual.total;
1026
- vs.pageSize = virtual.pageSize;
1027
- }
1028
- var tagsToRender = [];
1029
- if (!this.initialAdaptiveRenderingValues) {
1030
- if (tags === undefined) {
1031
- this.computedValue().forEach(function (item) {
1032
- tagsToRender.push({
1033
- text: (0, utils_1.getItemValue)(item, textField),
1034
- data: [item]
1035
- });
1036
- });
1037
- } else {
1038
- tagsToRender.push.apply(tagsToRender, tags);
1039
- }
1040
- } else {
1041
- var valuesBeforeAdaptiveRendering = __spreadArray([], this.initialAdaptiveRenderingValues, true);
1042
- valuesBeforeAdaptiveRendering.forEach(function (item) {
1043
- tagsToRender.push({
1044
- text: (0, utils_1.getItemValue)(item, textField),
1045
- data: [item]
1046
- });
1047
- });
1048
- }
1049
- if (tagsToRender.length > 0) {
1050
- this.setItems(tagsToRender, this._tags);
1051
- }
1052
- var isValid = !this.$props.validityStyles || this.validity().valid;
1053
- var renderSearchBar = function renderSearchBar(searchId) {
1054
- var _this = this;
1055
- var activedescendant = this.activedescendant;
1056
- var placeholder = this.$props.placeholder;
1057
- var focusedIndex = this.getFocusedState().focusedIndex;
1058
- var placeholderToShow = tagsToRender.length === 0 || value.length === 0 && !searchText ? placeholder : undefined;
1059
- var ariaActivedescendant = activedescendant === settings_1.ActiveDescendant.TagsList && focusedTag !== undefined ? "tag-".concat(this.base.guid, "-").concat(focusedTag.text.replace(/\s+/g, '-')) : "option-".concat(this.base.guid, "-").concat(focusedIndex);
1060
- return (
1061
- // @ts-ignore function children
1062
- h(SearchBar_1.SearchBar, {
1063
- id: searchId,
1064
- attrs: this.v3 ? undefined : {
1065
- id: searchId,
1066
- size: Math.max((placeholderToShow || '').length, searchText.length, 1),
1067
- tabIndex: this.$props.tabIndex,
1068
- accessKey: this.$props.accessKey,
1069
- placeholder: placeholderToShow,
1070
- value: !renderAdaptive ? searchText : '',
1071
- disabled: disabled,
1072
- expanded: opened,
1073
- owns: this.base.listBoxId,
1074
- activedescendant: ariaActivedescendant,
1075
- "aria-describedBy": "tagslist-".concat(this.base.guid).concat(this.$props.ariaDescribedBy ? ' ' + this.$props.ariaDescribedBy : ''),
1076
- "aria-labelledBy": this.$props.ariaLabelledBy,
1077
- "aria-label": this.$props.ariaLabel
1078
- },
1079
- size: Math.max((placeholderToShow || '').length, searchText.length, 1),
1080
- tabIndex: this.$props.tabIndex,
1081
- accessKey: this.$props.accessKey,
1082
- placeholder: placeholderToShow,
1083
- value: !renderAdaptive ? searchText : '',
1084
- onChange: this.onChangeHandler,
1085
- on: this.v3 ? undefined : {
1086
- "change": this.onChangeHandler,
1087
- "blur": this.handleBlur,
1088
- "keydown": this.onInputKeyDown
1089
- },
1090
- onBlur: this.handleBlur,
1091
- onKeydown: this.onInputKeyDown,
1092
- ref: this.v3 ? function (el) {
1093
- _this.inputRef = el;
1094
- } : 'input',
1095
- disabled: disabled,
1096
- expanded: opened,
1097
- owns: this.base.listBoxId,
1098
- activedescendant: ariaActivedescendant,
1099
- "aria-describedBy": "tagslist-".concat(this.base.guid).concat(this.$props.ariaDescribedBy ? ' ' + this.$props.ariaDescribedBy : ''),
1100
- "aria-labelledBy": this.$props.ariaLabelledBy,
1101
- "aria-label": this.$props.ariaLabel
1102
- })
1103
- );
1104
- };
1105
- var renderList = function renderList() {
1106
- var _this2 = this;
1107
- var groupField = this.$props.groupField;
1108
- var itemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.itemRender, kendo_vue_common_1.getListeners.call(this));
1109
- var groupHeaderItemRender = kendo_vue_common_1.templateRendering.call(this, this.$props.groupHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
1110
- var listNoDataRender = kendo_vue_common_1.templateRendering.call(this, this.$props.listNoDataRender, kendo_vue_common_1.getListeners.call(this));
1111
- var skip = virtual ? virtual.skip : 0;
1112
- var focusedIndex = this.getFocusedState().focusedIndex;
1113
- var translate = "translateY(".concat(vs.translate, "px)");
1114
- var listDataItems = dataItems;
1115
- if (groupField) {
1116
- listDataItems = this.base.getGroupedDataModernMode(dataItems, groupField);
1117
- }
1118
- return (
1119
- // @ts-ignore function children
1120
- h(List_1.List, {
1121
- id: this.base.listBoxId,
1122
- attrs: this.v3 ? undefined : {
1123
- id: this.base.listBoxId,
1124
- show: opened,
1125
- dataItems: listDataItems.slice(),
1126
- focusedIndex: focusedIndex,
1127
- value: this.computedValue(),
1128
- textField: textField,
1129
- valueField: dataItemKey,
1130
- optionsGuid: this.base.guid,
1131
- wrapperStyle: {
1132
- maxHeight: !renderAdaptive ? popupSettings.height : undefined
1133
- },
1134
- wrapperCssClass: 'k-list-content',
1135
- listStyle: vs.enabled ? {
1136
- transform: translate
1137
- } : undefined,
1138
- skip: skip,
1139
- itemRender: itemRender,
1140
- groupHeaderItemRender: groupHeaderItemRender,
1141
- noDataRender: listNoDataRender,
1142
- groupField: groupField
1143
- },
1144
- show: opened,
1145
- dataItems: listDataItems.slice(),
1146
- focusedIndex: focusedIndex,
1147
- value: this.computedValue(),
1148
- textField: textField,
1149
- valueField: dataItemKey,
1150
- optionsGuid: this.base.guid,
1151
- ref: 'list',
1152
- wrapperStyle: {
1153
- maxHeight: !renderAdaptive ? popupSettings.height : undefined
1154
- },
1155
- wrapperCssClass: 'k-list-content',
1156
- listStyle: vs.enabled ? {
1157
- transform: translate
1158
- } : undefined,
1159
- key: "listKey",
1160
- skip: skip,
1161
- onListclick: this.handleItemClick,
1162
- on: this.v3 ? undefined : {
1163
- "listclick": this.handleItemClick,
1164
- "scroll": this.onScroll
1165
- },
1166
- itemRender: itemRender,
1167
- groupHeaderItemRender: groupHeaderItemRender,
1168
- noDataRender: listNoDataRender,
1169
- groupField: groupField,
1170
- onScroll: this.onScroll
1171
- }, this.v3 ? function () {
1172
- return [renderScrollElement.call(_this2)];
1173
- } : [renderScrollElement.call(_this2)])
1174
- );
1175
- };
1176
- var renderScrollElement = function renderScrollElement() {
1177
- return vs.enabled && h("div", {
1178
- ref: 'scrollElement',
1179
- key: 'scrollElementKey'
1180
- });
1181
- };
1182
- var renderListContainer = function renderListContainer() {
1183
- var _this3 = this;
1184
- var _a;
1185
- var base = this.base;
1186
- var allowCustom = this.$props.allowCustom;
1187
- var groupStickyHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, this.$props.groupStickyHeaderItemRender, kendo_vue_common_1.getListeners.call(this));
1188
- var headerListContainer = base.getTemplateDef.call(this, header);
1189
- var footerListContainer = base.getTemplateDef.call(this, footer);
1190
- var currentText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
1191
- var focusedType = this.getFocusedState().focusedType;
1192
- var customItem = allowCustom && currentText && h("div", {
1193
- "class": "k-list",
1194
- key: "customitem",
1195
- onClick: this.customItemSelect,
1196
- on: this.v3 ? undefined : {
1197
- "click": this.customItemSelect
1198
- }
1199
- }, [h("div", {
1200
- "class": (0, kendo_vue_common_1.classNames)('k-item k-custom-item', {
1201
- 'k-focus': isCustom(focusedType)
1202
- })
1203
- }, [currentText, h(kendo_vue_common_1.Icon, {
1204
- name: "plus",
1205
- attrs: this.v3 ? undefined : {
1206
- name: "plus",
1207
- icon: kendo_svg_icons_1.plusIcon
1208
- },
1209
- icon: kendo_svg_icons_1.plusIcon,
1210
- style: {
1211
- float: 'right'
1212
- }
1213
- })])]);
1214
- if (this.group === undefined && this.$props.groupField !== undefined) {
1215
- this.group = (0, utils_1.getItemValue)(dataItems[0], this.$props.groupField);
1216
- }
1217
- return (
1218
- // @ts-ignore function children
1219
- h(ListContainer_1.ListContainer, {
1220
- ref: 'container',
1221
- onMousedown: preventDefault,
1222
- on: this.v3 ? undefined : {
1223
- "mousedown": preventDefault,
1224
- "blur": this.handleBlur
1225
- },
1226
- dir: dir !== undefined ? dir : base.dirCalculated,
1227
- attrs: this.v3 ? undefined : {
1228
- dir: dir !== undefined ? dir : base.dirCalculated,
1229
- width: this.popupWidth,
1230
- popupSettings: __assign(__assign({}, popupSettings), {
1231
- anchor: this.anchor,
1232
- show: opened,
1233
- onOpen: this.onPopupOpened,
1234
- onClose: this.onPopupClosed,
1235
- 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)),
1236
- className: (0, kendo_vue_common_1.classNames)('k-list-container', popupSettings.className)
1237
- }),
1238
- itemsCount: dataItems.length
1239
- },
1240
- onBlur: this.handleBlur,
1241
- width: this.popupWidth,
1242
- popupSettings: __assign(__assign({}, popupSettings), {
1243
- anchor: this.anchor,
1244
- show: opened,
1245
- onOpen: this.onPopupOpened,
1246
- onClose: this.onPopupClosed,
1247
- 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)),
1248
- className: (0, kendo_vue_common_1.classNames)('k-list-container', popupSettings.className)
1249
- }),
1250
- itemsCount: dataItems.length
1251
- }, this.v3 ? function () {
1252
- return [headerListContainer && h("div", {
1253
- "class": "k-list-header"
1254
- }, [headerListContainer]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
1255
- group: _this3.group,
1256
- attrs: _this3.v3 ? undefined : {
1257
- group: _this3.group,
1258
- render: groupStickyHeaderTemplate
1259
- },
1260
- render: groupStickyHeaderTemplate
1261
- }), renderList.call(_this3), footerListContainer && h("div", {
1262
- "class": "k-list-footer"
1263
- }, [footerListContainer]), virtual && header];
1264
- } : [headerListContainer && h("div", {
1265
- "class": "k-list-header"
1266
- }, [headerListContainer]), customItem, _this3.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
1267
- group: _this3.group,
1268
- attrs: _this3.v3 ? undefined : {
1269
- group: _this3.group,
1270
- render: groupStickyHeaderTemplate
1271
- },
1272
- render: groupStickyHeaderTemplate
1273
- }), renderList.call(_this3), footerListContainer && h("div", {
1274
- "class": "k-list-footer"
1275
- }, [footerListContainer]), virtual && header])
1276
- );
1277
- };
1278
- var renderListFilter = function renderListFilter() {
1279
- var filterText = this.$props.filter !== undefined ? this.$props.filter : this.currentText;
1280
- return this.$props.filterable &&
1281
- // @ts-ignore
1282
- h(ListFilter_1.ListFilter, {
1283
- value: filterText,
1284
- attrs: this.v3 ? undefined : {
1285
- value: filterText,
1286
- size: size,
1287
- rounded: rounded,
1288
- fillMode: fillMode
1289
- },
1290
- ref: 'filterInput',
1291
- onChange: this.onChangeHandler,
1292
- on: this.v3 ? undefined : {
1293
- "change": this.onChangeHandler,
1294
- "keydown": this.onInputKeyDown
1295
- },
1296
- onKeydown: this.onInputKeyDown,
1297
- size: size,
1298
- rounded: rounded,
1299
- fillMode: fillMode
1300
- });
1301
- };
1302
- var adaptiveActionSheetHeaderTemplateDef = function adaptiveActionSheetHeaderTemplateDef() {
1303
- return [h("div", {
1304
- "class": "k-actionsheet-titlebar-group k-hbox"
1305
- }, [h("div", {
1306
- "class": "k-actionsheet-title"
1307
- }, [h("div", {
1308
- "class": "k-text-center"
1309
- }, [adaptiveTitle]), h("div", {
1310
- "class": "k-actionsheet-subtitle k-text-center"
1311
- })]), h("div", {
1312
- "class": "k-actionsheet-actions"
1313
- }, [h(kendo_vue_buttons_1.Button, {
1314
- tabindex: 5,
1315
- attrs: this.v3 ? undefined : {
1316
- tabindex: 5,
1317
- "aria-label": "Cancel",
1318
- "aria-disabled": "false",
1319
- type: "button",
1320
- fillMode: "flat",
1321
- icon: "x",
1322
- svgIcon: kendo_svg_icons_1.xIcon
1323
- },
1324
- "aria-label": "Cancel",
1325
- "aria-disabled": "false",
1326
- type: "button",
1327
- fillMode: "flat",
1328
- onClick: _this.onCancel,
1329
- on: this.v3 ? undefined : {
1330
- "click": _this.onCancel
1331
- },
1332
- icon: "x",
1333
- svgIcon: kendo_svg_icons_1.xIcon
1334
- })])]), h("div", {
1335
- "class": "k-actionsheet-titlebar-group k-actionsheet-filter"
1336
- }, [renderListFilter.call(_this)])];
1337
- };
1338
- var adaptiveActionSheetHeaderTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetHeaderTemplateDef, kendo_vue_common_1.getListeners.call(this));
1339
- var adaptiveActionSheetFooterTemplateDef = function adaptiveActionSheetFooterTemplateDef() {
1340
- var cancelText = localization.toLanguageString(main_1.adaptiveModeFooterCancel, main_1.messages[main_1.adaptiveModeFooterCancel]);
1341
- var applyText = localization.toLanguageString(main_1.adaptiveModeFooterApply, main_1.messages[main_1.adaptiveModeFooterApply]);
1342
- return [h(kendo_vue_buttons_1.Button, {
1343
- size: "large",
1344
- attrs: this.v3 ? undefined : {
1345
- size: "large",
1346
- "aria-label": cancelText,
1347
- "aria-disabled": "false",
1348
- type: "button"
1349
- },
1350
- "aria-label": cancelText,
1351
- "aria-disabled": "false",
1352
- type: "button",
1353
- onClick: _this.onCancel,
1354
- on: this.v3 ? undefined : {
1355
- "click": _this.onCancel
1356
- }
1357
- }, [cancelText]), h(kendo_vue_buttons_1.Button, {
1358
- themeColor: "primary",
1359
- attrs: this.v3 ? undefined : {
1360
- themeColor: "primary",
1361
- size: "large",
1362
- "aria-label": applyText,
1363
- "aria-disabled": "false",
1364
- type: "button"
1365
- },
1366
- size: "large",
1367
- "aria-label": applyText,
1368
- "aria-disabled": "false",
1369
- type: "button",
1370
- onClick: _this.handleWrapperClick,
1371
- on: this.v3 ? undefined : {
1372
- "click": _this.handleWrapperClick
1373
- }
1374
- }, [applyText])];
1375
- };
1376
- var adaptiveActionSheetFooterTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetFooterTemplateDef, kendo_vue_common_1.getListeners.call(this));
1377
- var adaptiveActionSheetContentTemplateDef = function adaptiveActionSheetContentTemplateDef() {
1378
- var _a;
1379
- var headerToRender = _this.base.getTemplateDef.call(_this, header, h);
1380
- var footerToRender = _this.base.getTemplateDef.call(_this, footer, h);
1381
- var groupStickyHeaderTemplate = kendo_vue_common_1.templateRendering.call(_this, groupStickyHeaderItemRender, kendo_vue_common_1.getListeners.call(_this));
1382
- return h("div", {
1383
- "class": "k-list-container"
1384
- }, [headerToRender && h("div", {
1385
- "class": "k-list-header"
1386
- }, [headerToRender]), h("div", {
1387
- "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))
1388
- }, [_this.group && dataItems.length !== 0 && h(GroupStickyHeader_1.GroupStickyHeader, {
1389
- group: _this.group,
1390
- attrs: this.v3 ? undefined : {
1391
- group: _this.group,
1392
- render: groupStickyHeaderTemplate
1393
- },
1394
- render: groupStickyHeaderTemplate
1395
- }), renderList.call(_this), footerToRender && h("div", {
1396
- className: "k-list-footer",
1397
- attrs: this.v3 ? undefined : {
1398
- className: "k-list-footer"
1399
- }
1400
- }, [footerToRender])])]);
1401
- };
1402
- var adaptiveActionSheetContentTemplate = kendo_vue_common_1.templateRendering.call(this, adaptiveActionSheetContentTemplateDef, kendo_vue_common_1.getListeners.call(this));
1403
- var renderAdaptiveListContainer = function renderAdaptiveListContainer() {
1404
- return h(kendo_vue_layout_1.ActionSheet, {
1405
- expand: opened,
1406
- attrs: this.v3 ? undefined : {
1407
- expand: opened,
1408
- animation: true,
1409
- animationStyles: this.animationStyles,
1410
- className: this.classNameAdaptive,
1411
- contentClassName: '!k-overflow-hidden',
1412
- footerClassName: 'k-actions k-actions-stretched',
1413
- header: adaptiveActionSheetHeaderTemplate,
1414
- content: adaptiveActionSheetContentTemplate,
1415
- footer: adaptiveActionSheetFooterTemplate,
1416
- navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
1417
- },
1418
- animation: true,
1419
- animationStyles: this.animationStyles,
1420
- className: this.classNameAdaptive,
1421
- contentClassName: '!k-overflow-hidden',
1422
- footerClassName: 'k-actions k-actions-stretched',
1423
- header: adaptiveActionSheetHeaderTemplate,
1424
- content: adaptiveActionSheetContentTemplate,
1425
- footer: adaptiveActionSheetFooterTemplate,
1426
- onClose: this.onCancel,
1427
- on: this.v3 ? undefined : {
1428
- "close": this.onCancel
1429
- },
1430
- navigatableElements: ['input.k-input-inner', '.k-actionsheet-actions > button']
1431
- });
1432
- };
1433
- var multiSelectDefault = function multiSelectDefault() {
1434
- var _this4 = this;
1435
- var _a;
1436
- return h("span", {
1437
- ref: (0, kendo_vue_common_1.setRef)(this, 'kendoAnchor', this.anchor),
1438
- "class": (0, kendo_vue_common_1.classNames)('k-multiselect', 'k-input', (_a = {}, _a["k-input-".concat(sizeMap[size] || size)] = size, _a["k-rounded-".concat(roundedMap[rounded] || rounded)] = rounded, _a["k-input-".concat(fillMode)] = fillMode, _a['k-focus'] = focused && !disabled, _a['k-disabled'] = disabled, _a['k-invalid'] = !isValid, _a['k-loading'] = loading, _a['k-required'] = this.required, _a)),
1439
- style: !label ? style : __assign(__assign({}, style), {
1440
- width: undefined
1441
- }),
1442
- dir: dir,
1443
- attrs: this.v3 ? undefined : {
1444
- dir: dir
1445
- },
1446
- onFocusin: this.handleFocus,
1447
- on: this.v3 ? undefined : {
1448
- "focusin": this.handleFocus,
1449
- "click": this.handleWrapperClick,
1450
- "mousedown": utils_1.preventDefaultNonInputs
1451
- },
1452
- onClick: this.handleWrapperClick,
1453
- onMousedown: utils_1.preventDefaultNonInputs
1454
- }, [
1455
- // @ts-ignore function children
1456
- h(TagList_1.TagList, {
1457
- removeTagIcon: removeTagIcon,
1458
- attrs: this.v3 ? undefined : {
1459
- removeTagIcon: removeTagIcon,
1460
- tagsRounded: tagsRounded,
1461
- size: size,
1462
- fillMode: fillMode,
1463
- tagRender: tagRender,
1464
- dataItems: tagsToRender,
1465
- guid: this.base.guid,
1466
- focused: focusedTag ? tagsToRender.find(function (t) {
1467
- return matchTags(t, focusedTag, dataItemKey);
1468
- }) : undefined
1469
- },
1470
- tagsRounded: tagsRounded,
1471
- size: size,
1472
- fillMode: fillMode,
1473
- tagRender: tagRender,
1474
- onTagdelete: this.onTagDelete,
1475
- on: this.v3 ? undefined : {
1476
- "tagdelete": this.onTagDelete
1477
- },
1478
- dataItems: tagsToRender,
1479
- guid: this.base.guid,
1480
- focused: focusedTag ? tagsToRender.find(function (t) {
1481
- return matchTags(t, focusedTag, dataItemKey);
1482
- }) : undefined
1483
- }, this.v3 ? function () {
1484
- return [renderSearchBar.call(_this4, id)];
1485
- } : [renderSearchBar.call(_this4, id)]), tagsToRender.length > 0 && clearButton &&
1486
- // @ts-ignore function children
1487
- h(ClearButton_1.ClearButton, {
1488
- onClearclick: this.clearButtonClick,
1489
- on: this.v3 ? undefined : {
1490
- "clearclick": this.clearButtonClick
1491
- }
1492
- }), h("span", {
1493
- "class": loading ? 'k-input-loading-icon k-icon k-i-loading' : undefined
1494
- }), !renderAdaptive && renderListContainer.call(this)]);
1495
- };
1496
- // The following one combines the default rendering of the MultiSelect and the Adaptive rendering.
1497
- // This is needed because of Vue 2 specifics
1498
- var multiselect = [isV3 ? h(multiSelectDefault.call(this), __assign({}, this.$attrs)) : multiSelectDefault.call(this), renderAdaptive && renderAdaptiveListContainer.call(this)];
1499
- var multiselectToRender = isV3 ? multiselect : renderAdaptive ? h("div", [multiselect]) : multiSelectDefault.call(this);
1500
- return label ? h("span", {
1501
- "class": this.spanClassNames,
1502
- dir: this.$props.dir,
1503
- attrs: this.v3 ? undefined : {
1504
- dir: this.$props.dir
1505
- }
1506
- }, [multiselectToRender, this.$props.label ? id ? h("label", {
1507
- "for": id,
1508
- attrs: this.v3 ? undefined : {
1509
- "for": id
1510
- },
1511
- "class": "k-floating-label"
1512
- }, [this.$props.label]) : h("span", {
1513
- "class": "k-label"
1514
- }, [this.$props.label]) : null]) : multiselectToRender;
1515
- }
1516
- };
1517
- exports.MultiSelectVue2 = MultiSelectVue2;
1518
- /**
1519
- * @hidden
1520
- */
1521
- var MultiSelect = MultiSelectVue2;
1522
- exports.MultiSelect = MultiSelect;