formSelects-v3.js 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. 'use strict';
  2. var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
  3. /**
  4. * name: formSelects
  5. * 基于Layui Select多选
  6. * version: 3.0.9.0607
  7. * https://faysunshine.com/layui/template/formSelects-v3/formSelects-v3.js
  8. */
  9. (function (layui, window, factory) {
  10. if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object') {
  11. // 支持 CommonJS
  12. module.exports = factory();
  13. } else if (typeof define === 'function' && define.amd) {
  14. // 支持 AMD
  15. define(factory);
  16. } else if (window.layui && layui.define) {
  17. //layui加载
  18. layui.define(['jquery', 'form'], function (exports) {
  19. exports('formSelects', factory());
  20. });
  21. } else {
  22. window.formSelects = factory();
  23. }
  24. })(layui, window, function () {
  25. //针对IE的一些处理
  26. if (window.Map == undefined) {
  27. var _Map = function _Map() {
  28. this.value = {};
  29. };
  30. _Map.prototype.set = function (key, val) {
  31. this.value[key] = val;
  32. };
  33. _Map.prototype.get = function (key) {
  34. return this.value[key];
  35. };
  36. _Map.prototype.has = function (key) {
  37. return this.value.hasOwnProperty(key);
  38. };
  39. _Map.prototype.delete = function (key) {
  40. delete this.value[key];
  41. };
  42. window.Map = _Map;
  43. }
  44. var $ = layui.jquery || $,
  45. form = layui.form,
  46. select3 = {
  47. value: function value(name) {
  48. var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'all';
  49. var vals = arguments[2];
  50. if (Array.isArray(type)) {
  51. vals = type;
  52. type = 'all';
  53. }
  54. if (name && vals && Array.isArray(vals)) {
  55. var options = commons.data.confs.get(name);
  56. if (options) {
  57. var dl = commons.methods.getDiv(options).find('dl');
  58. if (!options.repeat) {
  59. var map = {},
  60. newVals = [];
  61. vals.forEach(function (val) {
  62. if (!map[val]) {
  63. newVals.push(val);
  64. map[val] = 1;
  65. }
  66. });
  67. vals = newVals;
  68. }
  69. var on = options.on;
  70. options.on = null;
  71. commons.methods.removeAll(options);
  72. options.delete = false;
  73. vals.forEach(function (val) {
  74. dl.find('dd:not(.layui-disabled)[lay-value=\'' + val + '\']').click();
  75. });
  76. options.on = on;
  77. }
  78. return;
  79. }
  80. var arr = commons.data.values.get(name);
  81. if (!arr) {
  82. return vals;
  83. }
  84. if (type == 'val') {
  85. return arr.map(function (val) {
  86. return val.val;
  87. });
  88. }
  89. if (type == 'valStr') {
  90. return arr.map(function (val) {
  91. return val.val;
  92. }).join(',');
  93. }
  94. if (type == 'name') {
  95. return arr.map(function (val) {
  96. return val.name;
  97. });
  98. }
  99. if (type == 'nameStr') {
  100. return arr.map(function (val) {
  101. return val.name;
  102. }).join(',');
  103. }
  104. return arr;
  105. },
  106. render: function render(options) {
  107. if (options) {
  108. if (commons.data.confs.get(options.name)) {
  109. options = commons.methods.cloneOptions(options, commons.data.confs.get(options.name));
  110. commons.methods.init(options);
  111. } else {
  112. var dom = commons.methods.getDom(options, true);
  113. if (dom.length) {
  114. var hisOptions = commons.methods.cloneOptions(commons.methods.getOptions(dom), commons.data.DEFAULT_OPTIONS);
  115. options = commons.methods.cloneOptions(options, hisOptions);
  116. commons.methods.init(options);
  117. }
  118. }
  119. } else {
  120. commons.methods.autoInit();
  121. }
  122. },
  123. delete: function _delete(name, abs) {
  124. if (name && commons.data.confs.get(name)) {
  125. var dom = commons.methods.getDom({
  126. name: name
  127. });
  128. if (dom.parent().hasClass(commons.data.pclass)) {
  129. if (abs) {
  130. dom.removeAttr(commons.data.name);
  131. }
  132. dom.removeAttr('style');
  133. dom.parent()[0].outerHTML = dom[0].outerHTML;
  134. }
  135. commons.data.confs.delete(name);
  136. for (var item in commons.data.temps) {
  137. commons.data.temps[item].delete(name);
  138. }
  139. commons.data.values.delete(name);
  140. }
  141. },
  142. style: function style(name, colors) {
  143. if (name) {
  144. if (!colors) {
  145. commons.methods.loadCss(name, null);
  146. } else if (Array.isArray(colors)) {
  147. commons.methods.loadCss(name, colors);
  148. } else {
  149. var arr = [colors.labelBgColor, colors.labelColor, colors.labelIconBgColor, colors.labelIconColor, colors.labelLabelBorderColor, colors.thisBgColor, colors.thisColor];
  150. commons.methods.loadCss(name, arr);
  151. }
  152. }
  153. }
  154. },
  155. commons = {
  156. data: {
  157. name: 'xm-select',
  158. pclass: 'xm-select-parent',
  159. vclass: 'xm-select-validate',
  160. DEFAULT_OPTIONS: {
  161. name: null, //xm-select="xxx"
  162. type: 1, //显示模式, 1:layui-this, 2:checkbox, 3:icon
  163. icon: {
  164. class: 'layui-icon-ok',
  165. text: ''
  166. },
  167. max: null,
  168. maxTips: null,
  169. init: null, //初始化的选择值,
  170. on: null, //select值发生变化
  171. data: null
  172. },
  173. DEFAULT_RENDER: {
  174. arr: null,
  175. name: 'name',
  176. val: 'val',
  177. selected: 'selected',
  178. disabled: 'disabled'
  179. },
  180. confs: new Map(),
  181. temps: {
  182. dom: new Map(),
  183. div: new Map()
  184. },
  185. resize: new Map(),
  186. values: new Map(),
  187. times: new Map()
  188. },
  189. methods: {
  190. init: function init(options, clone) {
  191. if (!clone) {
  192. options = commons.methods.cloneOptions(options);
  193. }
  194. //原始dom添加一个filter
  195. var _ref = ['xm-' + options.name, commons.methods.getDom(options, true)],
  196. filter = _ref[0],
  197. dom = _ref[1];
  198. if (dom.next().hasClass('layui-form-select')) {
  199. dom.next().remove();
  200. }
  201. if (options.data && options.data.arr) {
  202. var os = $.extend({}, commons.data.DEFAULT_RENDER, options.data);
  203. var html = '<option value=""></option>';
  204. for (var i in os.arr) {
  205. var db = os.arr[i];
  206. if (db.arr && Array.isArray(db.arr)) {
  207. html += '<optgroup label="' + db.name + '">';
  208. for (var j in db.arr) {
  209. var gdb = db.arr[j];
  210. html += '<option value="' + gdb[os.val] + '" ' + (gdb[os.selected] ? 'selected="selected"' : '') + ' ' + (gdb[os.disabled] ? 'disabled="disabled"' : '') + '>' + gdb[os.name] + '</option>';
  211. }
  212. html += '</optgroup>';
  213. } else {
  214. html += '<option value="' + db[os.val] + '" ' + (db[os.selected] ? 'selected="selected"' : '') + ' ' + (db[os.disabled] ? 'disabled="disabled"' : '') + '>' + db[os.name] + '</option>';
  215. }
  216. }
  217. dom.html(html);
  218. }
  219. //判断dom中是否包含了空的option, 如果不包含, 添加
  220. if (!dom.find('option[value=""]').length) {
  221. $('<option value=""></option>').insertBefore(dom.find('option:first'));
  222. }
  223. if (dom.parent().hasClass(commons.data.pclass)) {
  224. dom.parent().attr('lay-filter', filter).addClass('layui-form');
  225. } else {
  226. dom.wrap('<div class="layui-form ' + commons.data.pclass + '" lay-filter="' + filter + '"></div>');
  227. }
  228. dom.attr('lay-filter', filter);
  229. options.type ? dom.attr('xm-select-type', options.type) : dom.removeAttr('xm-select-type');
  230. options.max ? dom.attr('xm-select-max', options.max) : dom.removeAttr('xm-select-max');
  231. commons.methods.formRender('select', filter, true);
  232. //1.去掉layui的原始渲染
  233. commons.methods.getDom(options).next().addClass(commons.data.vclass);
  234. //2.
  235. commons.data.confs.set(options.name, options);
  236. for (var item in commons.data.temps) {
  237. commons.data.temps[item].delete(options.name);
  238. }
  239. commons.data.values.delete(options.name);
  240. //3.渲染input
  241. commons.methods.overrideInput(options);
  242. commons.methods.typeInit(options, filter);
  243. //4.初始化init
  244. var vals = commons.methods.getInitVal(options);
  245. vals.forEach(function (val) {
  246. commons.methods.valHandler(options, val, true);
  247. });
  248. commons.methods.showPlaceholder(options);
  249. commons.methods.retop(options);
  250. commons.methods.removeDefaultClass(options);
  251. commons.methods.on(options, filter);
  252. },
  253. addLabel: function addLabel(options, vals) {
  254. var ipt = commons.methods.getIpt(options);
  255. ipt.find('.xm-select-empty').remove();
  256. vals.forEach(function (val) {
  257. var tips = 'fsw="' + options.name + '"';
  258. var _ref2 = [$('<span ' + tips + ' value=\'' + val.val + '\'><font ' + tips + '>' + val.name + '</font></span>'), $('<i ' + tips + ' class="layui-icon">&#x1006;</i>')],
  259. $label = _ref2[0],
  260. $close = _ref2[1];
  261. $label.append($close);
  262. ipt.append($label);
  263. });
  264. },
  265. delLabel: function delLabel(options, vals) {
  266. var ipt = commons.methods.getIpt(options);
  267. vals.forEach(function (val) {
  268. ipt.find('span[value=\'' + val.val + '\']:first').remove();
  269. });
  270. },
  271. showPlaceholder: function showPlaceholder(options) {
  272. var vals = commons.methods.getValues(options);
  273. if (!vals.length) {
  274. var _ref3 = ['fsw="' + options.name + '"', commons.methods.getIpt(options)],
  275. tips = _ref3[0],
  276. ipt = _ref3[1];
  277. if (!ipt.find('.xm-select-empty').length) {
  278. var _tips = options.tips ? options.tips : ipt.prev().attr('placeholder');
  279. var cls = 'fsw="' + options.name + '"';
  280. var span = $('<span ' + cls + ' class="xm-select-empty">' + _tips + '</span>');
  281. ipt.append(span);
  282. }
  283. }
  284. },
  285. valHandler: function valHandler(options, val, isAdd, isShow) {
  286. var vals = commons.methods.getValues(options);
  287. var dd = commons.methods.getDiv(options).find('dl dd[lay-value=\'' + val.val + '\']');
  288. if (isAdd) {
  289. if (!options.max || options.max && vals.length < options.max) {
  290. vals.push(val);
  291. commons.methods.addLabel(options, [val]);
  292. commons.methods.typeHandler(options, dd, isAdd);
  293. } else {
  294. commons.methods.maxTips(options, val);
  295. commons.methods.typeHandler(options, dd, false);
  296. }
  297. } else {
  298. if (!dd.hasClass('layui-disabled')) {
  299. commons.methods.remove(vals, val);
  300. commons.methods.delLabel(options, [val]);
  301. if (commons.methods.indexOf(vals, val) == -1) {
  302. commons.methods.typeHandler(options, dd, isAdd);
  303. }
  304. }
  305. }
  306. commons.methods.retop(options);
  307. },
  308. typeInit: function typeInit(options, filter) {
  309. var div = commons.methods.getDiv(options);
  310. if (options.type == 2) {
  311. //checkbox
  312. div.find('dl dd:not(.layui-select-tips)').each(function (index, target) {
  313. var $target = $(target);
  314. var text = $target.text();
  315. var dis = $target.hasClass('layui-disabled') ? 'disabled' : '';
  316. $target.text('');
  317. $target.append('\n\t\t\t\t\t\t\t\t<span lay-filter="' + filter + '">\n\t\t\t\t\t\t\t\t\t<input type="checkbox" title="' + text + '" lay-skin="primary" ' + dis + '> \t\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t');
  318. });
  319. form.render('checkbox', filter);
  320. div.find('dl dd .layui-form-checkbox').css('margin-top', '1px');
  321. } else {
  322. div.find('dl dd:not(.layui-select-tips)').each(function (index, target) {
  323. $(target).css({
  324. margin: '1px 0'
  325. });
  326. });
  327. }
  328. },
  329. typeHandler: function typeHandler(options, dd, isAdd) {
  330. if (options.type == 3) {
  331. //对勾
  332. if (isAdd) {
  333. var span = $('\n\t\t\t\t\t\t\t\t<span><i class="layui-icon ' + options.icon.class + '">' + options.icon.text + '</i></span>\t\n\t\t\t\t\t\t\t');
  334. dd.append(span);
  335. } else {
  336. dd.find('span').remove();
  337. }
  338. } else if (options.type == 2) {
  339. //checkbox
  340. if (isAdd) {
  341. dd.find('.layui-form-checkbox').addClass('layui-form-checked');
  342. } else {
  343. dd.find('.layui-form-checkbox').removeClass('layui-form-checked');
  344. }
  345. }
  346. isAdd ? dd.addClass(commons.data.name + '-this') : dd.removeClass(commons.data.name + '-this');
  347. dd.removeClass('layui-this');
  348. commons.methods.showPlaceholder(options);
  349. },
  350. on: function on(options, filter) {
  351. form.on('select(' + filter + ')', function (data) {
  352. if (options.radio) {
  353. commons.methods.getDiv(options).find('dl').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none');
  354. var selected = void 0,
  355. val = void 0;
  356. if (data.value) {
  357. val = {
  358. name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(),
  359. val: data.value
  360. };
  361. selected = commons.methods.indexOf(commons.methods.getValues(options), val) == -1;
  362. if (selected) {
  363. var hisVal = select3.value(options.name)[0];
  364. if (hisVal) {
  365. commons.methods.valHandler(options, hisVal, false, false);
  366. commons.methods.setValues(options, []);
  367. }
  368. }
  369. commons.methods.valHandler(options, val, selected, false);
  370. } else {
  371. selected = false;
  372. val = select3.value(options.name)[0];
  373. if (val) {
  374. commons.methods.valHandler(options, val, selected, false);
  375. commons.methods.setValues(options, []);
  376. }
  377. }
  378. if (val && options.on && options.on instanceof Function) {
  379. options.on(data, select3.value(options.name), val, selected);
  380. }
  381. return;
  382. }
  383. if (commons.methods.getDiv(options).hasClass('layui-form-selectup') || commons.methods.getDiv(options).find('dl').css('top').indexOf('-') == 0) {
  384. setTimeout(function () {
  385. commons.methods.getDiv(options).addClass('layui-form-selectup');
  386. }, 50);
  387. }
  388. if (options.repeat) {
  389. if (data.value) {
  390. var ipt = commons.methods.getIpt(options);
  391. if (options.delete) {
  392. var arr = select3.value(options.name);
  393. var _val = arr[commons.methods.indexOf(arr, data.value)];
  394. if (_val) {
  395. commons.methods.valHandler(options, _val, false);
  396. ipt.parent().next().find('dd[lay-value=\'' + data.value + '\'] .layui-form-checkbox > i').html('&#xe605;');
  397. if (options.on && options.on instanceof Function) {
  398. options.on(data, select3.value(options.name), _val, false);
  399. }
  400. }
  401. options.delete = false;
  402. return;
  403. } else {
  404. var vals = commons.methods.getValues(options);
  405. var _val2 = {
  406. name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(),
  407. val: data.value
  408. };
  409. commons.methods.valHandler(options, _val2, true);
  410. if (options.on && options.on instanceof Function) {
  411. options.on(data, select3.value(options.name), _val2, true);
  412. }
  413. }
  414. setTimeout(function () {
  415. commons.methods.getDiv(options).addClass('layui-form-selected').find('dl dd.layui-this').removeClass('layui-this');
  416. }, 3);
  417. return;
  418. }
  419. }
  420. if (data.value) {
  421. var _val3 = {
  422. name: commons.methods.getDom(options).find('option[value=\'' + data.value + '\']').text(),
  423. val: data.value
  424. };
  425. var _selected = commons.methods.indexOf(commons.methods.getValues(options), _val3) == -1;
  426. commons.methods.valHandler(options, _val3, _selected, true);
  427. if (options.on && options.on instanceof Function) {
  428. options.on(data, select3.value(options.name), _val3, _selected);
  429. }
  430. setTimeout(function () {
  431. commons.methods.getDiv(options).addClass('layui-form-selected').find('dl dd.layui-this').removeClass('layui-this');
  432. }, 3);
  433. } else {
  434. if (commons.methods.getDom(options).attr('xm-select-search') == undefined) {
  435. commons.methods.removeAll(options);
  436. setTimeout(function () {
  437. commons.methods.getDiv(options).addClass('layui-form-selected');
  438. }, 3);
  439. }
  440. }
  441. });
  442. },
  443. maxTips: function maxTips(options, val) {
  444. if (options.maxTips && options.maxTips instanceof Function) {
  445. options.maxTips(select3.value(options.name), val, options.max);
  446. return;
  447. }
  448. var ipt = commons.methods.getIpt(options);
  449. if (ipt.parents('.layui-form-item[pane]').length) {
  450. ipt = ipt.parents('.layui-form-item[pane]');
  451. }
  452. ipt.css('border-color', 'red');
  453. setTimeout(function () {
  454. ipt.css('border-color', '#e6e6e6');
  455. }, 300);
  456. },
  457. indexOf: function indexOf(arr, val) {
  458. for (var i = 0; i < arr.length; i++) {
  459. if (arr[i].val == val || arr[i].val == (val ? val.val : val) || arr[i] == val || JSON.stringify(arr[i]) == JSON.stringify(val)) {
  460. return i;
  461. }
  462. }
  463. return -1;
  464. },
  465. remove: function remove(arr, val) {
  466. var index = commons.methods.indexOf(arr, val ? val.val : val);
  467. if (index > -1) {
  468. arr.splice(index, 1);
  469. return true;
  470. }
  471. return false;
  472. },
  473. removeAll: function removeAll(options) {
  474. var div = commons.methods.getDiv(options);
  475. var vals = div.find('.xm-select > span');
  476. vals.each(function (index, item) {
  477. options.delete = true;
  478. div.find('dl dd.xm-select-this:not(.layui-disabled)[lay-value=\'' + item.getAttribute('value') + '\']').click();
  479. });
  480. return vals.length;
  481. },
  482. removeDefaultClass: function removeDefaultClass(options) {
  483. var _ref4 = [commons.methods.getDom(options), commons.methods.getDiv(options)],
  484. dom = _ref4[0],
  485. div = _ref4[1];
  486. div.find('dl').addClass('xm-select-hidn');
  487. div.find('dl dd.layui-this').removeClass('layui-this');
  488. div.find('dl').append('<dt style="display:none;">x<dt/>');
  489. var text = options.radio ? '请选择' : '清空已选择' + (options.max ? '. \u5F53\u524D\u914D\u7F6E: \u6700\u591A\u9009\u62E9 ' + options.max + ' \u4E2A' : '');
  490. var html = '<span>' + text + '</span>';
  491. var that = div.find('dl dd.layui-select-tips');
  492. if (dom.attr('xm-select-search') != undefined) {
  493. var icon = '&#xe640;';
  494. html = '<input class="layui-input xm-select-input-search" placeholder="\u5173\u952E\u5B57\u641C\u7D22"><span><i title="' + text + '" xm-select-clear="' + options.name + '" class="layui-icon">' + icon + '</i></span>';
  495. that.addClass('xm-select-dd-search');
  496. that.off('click');
  497. }
  498. commons.methods.handlerDataTable(dom, '38px');
  499. that.html(html);
  500. },
  501. handlerDataTable: function handlerDataTable(dom, height) {
  502. if (dom.length == undefined) {
  503. dom = $(dom);
  504. }
  505. if (dom.parents('div.layui-table-cell').length) {
  506. var index = dom.parents('tr').attr('data-index');
  507. dom.parents('.layui-table-box').find('tbody tr[data-index=\'' + index + '\'] div.layui-table-cell').css({
  508. height: height,
  509. lineHeight: height,
  510. overflow: 'unset'
  511. });
  512. }
  513. },
  514. overrideInput: function overrideInput(options) {
  515. var _ref5 = [commons.methods.getDiv(options), commons.methods.getDom(options)],
  516. _div = _ref5[0],
  517. _dom = _ref5[1];
  518. var _ref6 = [_div.find('.layui-select-title input:first'), $('<div class="layui-input ' + commons.data.name + '"></div>')],
  519. $input = _ref6[0],
  520. $orinput = _ref6[1];
  521. $orinput.insertAfter($input);
  522. if ($input.parents('.layui-form-pane').length && $input.parents('.layui-form-item[pane]').length) {
  523. $orinput.css('border', 'none');
  524. }
  525. if (options.height) {
  526. $orinput.addClass('.xm-select-height').css('height', options.height);
  527. }
  528. if (_dom.attr('disabled') != undefined) {
  529. $orinput.append($('<div style="\n\t\t\t\t\t\t\t width: 100%;\n\t\t\t\t\t\t\t height: 100%;\n\t\t\t\t\t\t\t display: block;\n\t\t\t\t\t\t\t position: absolute;\n\t\t\t\t\t\t\t left: 0;\n\t\t\t\t\t\t\t top: 0;\n\t\t\t\t\t\t\t"></div>').addClass('layui-disabled'));
  530. }
  531. },
  532. retop: function retop(options) {
  533. var div = commons.methods.getIpt(options);
  534. if (div.length) {
  535. var dl = div.parent('.layui-select-title').next();
  536. var up = dl.parent().hasClass('layui-form-selectup') || dl.css('top').indexOf('-') == 0;
  537. var time = commons.data.times.get(options.name);
  538. if (time) {
  539. if (Date.now() - time.time < 100 || options.delete) {
  540. up = time.up;
  541. options.delete = false;
  542. } else {
  543. time.up = up;
  544. }
  545. time.time = Date.now();
  546. } else {
  547. commons.data.times.set(options.name, {
  548. time: Date.now(),
  549. up: up
  550. });
  551. }
  552. if (up) {
  553. div.parent('.layui-select-title').next().css({
  554. top: 'auto',
  555. bottom: div[0].offsetTop + div.height() + 14 + 'px'
  556. });
  557. } else {
  558. div.parent('.layui-select-title').next().css({
  559. top: div[0].offsetTop + div.height() + 14 + 'px',
  560. bottom: 'auto'
  561. });
  562. }
  563. }
  564. },
  565. getElementTop: function getElementTop(element) {
  566. var actualTop = element.offsetTop;
  567. var current = element.offsetParent;
  568. while (current !== null) {
  569. actualTop += current.offsetTop;
  570. current = current.offsetParent;
  571. }
  572. return actualTop;
  573. },
  574. getDom: function getDom(options, isNew) {
  575. var _ref7 = [commons.data.temps.dom, options.name],
  576. _dom = _ref7[0],
  577. _name = _ref7[1];
  578. if (isNew) {
  579. _dom.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']'));
  580. }
  581. if (!_dom.has(_name)) {
  582. _dom.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']'));
  583. }
  584. return _dom.get(_name);
  585. },
  586. getDiv: function getDiv(options) {
  587. var _ref8 = [commons.data.temps.div, options.name],
  588. _div = _ref8[0],
  589. _name = _ref8[1];
  590. if (!_div.has(_name)) {
  591. _div.set(_name, $('select[' + commons.data.name + '=\'' + _name + '\']').next());
  592. }
  593. return _div.get(_name);
  594. },
  595. getIpt: function getIpt(options) {
  596. return commons.methods.getDiv(options).find('div .' + commons.data.name);
  597. },
  598. getInitVal: function getInitVal(options) {
  599. var _dom = commons.methods.getDom(options);
  600. var vals = options.init ? options.init : _dom.find('option[selected]').map(function (index, target) {
  601. return $(target).attr('value');
  602. }).toArray();
  603. var result = void 0;
  604. if (options.radio) {
  605. var one = vals.map(function (val) {
  606. var opt = _dom.find('option[value=\'' + val + '\']');
  607. return {
  608. name: opt.attr('disabled') != undefined ? null : opt.text(),
  609. val: val + ""
  610. };
  611. }).filter(function (val) {
  612. return val.name && val.val;
  613. })[0];
  614. result = one ? [one] : [];
  615. } else {
  616. result = vals.map(function (val) {
  617. return {
  618. name: _dom.find('option[value=\'' + val + '\']').text(),
  619. val: val + ""
  620. };
  621. }).filter(function (val) {
  622. return val.name && val.val;
  623. });
  624. }
  625. return result;
  626. },
  627. getValues: function getValues(options) {
  628. var _ref9 = [commons.data.values, options.name],
  629. _arr = _ref9[0],
  630. _name = _ref9[1];
  631. if (!_arr.has(_name)) {
  632. _arr.set(_name, []);
  633. }
  634. return _arr.get(_name);
  635. },
  636. setValues: function setValues(options, vals) {
  637. var _ref10 = [commons.data.values, options.name],
  638. _arr = _ref10[0],
  639. _name = _ref10[1];
  640. _arr.set(_name, vals);
  641. },
  642. getOptions: function getOptions(sel) {
  643. return {
  644. name: sel.attr('' + commons.data.name),
  645. type: sel.attr(commons.data.name + '-type'),
  646. max: sel.attr(commons.data.name + '-max'),
  647. icon: sel.attr(commons.data.name + '-icon'),
  648. tips: sel.attr(commons.data.name + '-placeholder'),
  649. height: sel.attr(commons.data.name + '-height'),
  650. radio: sel.attr(commons.data.name + '-radio') != undefined,
  651. repeat: sel.attr(commons.data.name + '-repeat') != undefined
  652. };
  653. },
  654. cloneOptions: function cloneOptions(options, hisOptions) {
  655. if (!hisOptions) {
  656. hisOptions = commons.data.DEFAULT_OPTIONS;
  657. }
  658. if (options.icon && typeof options.icon == 'string') {
  659. var icon = options.icon;
  660. if (icon.indexOf('layui') == 0) {
  661. options.icon = {
  662. class: icon,
  663. text: ''
  664. };
  665. } else {
  666. options.icon = {
  667. class: '',
  668. text: icon
  669. };
  670. }
  671. } else {
  672. var v = layui.v.split('.');
  673. if (v[0] < 2 || v[1] <= 2) {
  674. options.icon = {
  675. class: '',
  676. text: hisOptions.icon.text
  677. };
  678. } else {
  679. options.icon = {
  680. class: hisOptions.icon.class,
  681. text: ''
  682. };
  683. }
  684. }
  685. return $.extend({}, hisOptions, options);
  686. },
  687. autoInit: function autoInit(repeat) {
  688. $('select[' + commons.data.name + ']').each(function (index, target) {
  689. var sel = $(target);
  690. sel.css('display', 'none');
  691. var options = commons.methods.getOptions(sel);
  692. if (!repeat) {
  693. var hisOptions = commons.data.confs.get(options.name);
  694. options.init = select3.value(options.name, 'val');
  695. commons.methods.init(commons.methods.cloneOptions(options, hisOptions), true);
  696. } else {
  697. commons.methods.init(options);
  698. }
  699. });
  700. },
  701. listenCloseHandler: function listenCloseHandler(e, that, block) {
  702. if (block.length) {
  703. var _ref11 = [block.find('.layui-form-select'), block.find('dl')],
  704. div = _ref11[0],
  705. dl = _ref11[1];
  706. var name = block.find('select').attr('xm-select');
  707. if (that.hasClass('layui-disabled')) {
  708. return;
  709. }
  710. if (that.attr('xm-select-clear') != undefined) {
  711. if (that.is('i')) {
  712. var options = commons.data.confs.get($(e.target).attr('xm-select-clear'));
  713. if (options) {
  714. var length = commons.methods.removeAll(options);
  715. if (options.radio && length) {
  716. return;
  717. }
  718. }
  719. div.addClass('layui-form-selected');
  720. dl.find('.xm-select-input-search').focus();
  721. return;
  722. }
  723. }
  724. if (that.hasClass('xm-select-dd-search') || that.hasClass('xm-select-input-search')) {
  725. div.addClass('layui-form-selected');
  726. dl.find('.xm-select-input-search').focus();
  727. return;
  728. }
  729. $('.xm-select-parent > select:not([xm-select=\'' + name + '\']) + div > dl').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none');
  730. if (that.attr('fsw') != undefined) {
  731. if (that.is('i')) {
  732. var _ref12 = [$(e.target).parents('.layui-form-select').prev(), $(e.target).parent()],
  733. sel = _ref12[0],
  734. span = _ref12[1];
  735. var val = {
  736. name: span.find('font').text(),
  737. val: span.attr('value')
  738. };
  739. var _options = commons.methods.getOptions(sel);
  740. _options = commons.data.confs.get(_options.name);
  741. _options.delete = true;
  742. commons.methods.getDiv(_options).find('dl dd[lay-value=\'' + val.val + '\']').click();
  743. setTimeout(function () {
  744. if (dl.hasClass('xm-select-show')) {
  745. div.addClass('layui-form-selected');
  746. dl.find('.xm-select-input-search').focus();
  747. } else {
  748. div.removeClass('layui-form-selected');
  749. }
  750. }, 3);
  751. return;
  752. }
  753. }
  754. if (block.find('select').attr('xm-select-radio') != undefined) {
  755. setTimeout(function () {
  756. if (dl.hasClass('xm-select-show')) {
  757. div.removeClass('layui-form-selected');
  758. dl.removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none');
  759. } else {
  760. div.addClass('layui-form-selected');
  761. dl.removeClass('xm-select-hidn').addClass('xm-select-show').css('display', 'block');
  762. dl.find('.xm-select-input-search').focus();
  763. }
  764. }, 3);
  765. return;
  766. }
  767. if (dl.hasClass('xm-select-show')) {
  768. if (that.hasClass('xm-select') || that.hasClass('xm-select-empty')) {
  769. dl.removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none');
  770. div.removeClass('layui-form-selected');
  771. } else {
  772. div.addClass('layui-form-selected');
  773. dl.find('.xm-select-input-search').focus();
  774. }
  775. return;
  776. }
  777. dl.removeClass('xm-select-hidn').addClass('xm-select-show').css('display', 'block');
  778. div.addClass('layui-form-selected');
  779. dl.find('.xm-select-input-search').focus();
  780. } else {
  781. $('.xm-select-parent > .layui-form-select > dl.xm-select-show').removeClass('xm-select-show').addClass('xm-select-hidn').css('display', 'none');
  782. }
  783. },
  784. listenClose: function listenClose() {
  785. $(document).on('click', function (e) {
  786. var that = $(e.target);
  787. var block = that.parents('.xm-select-parent');
  788. setTimeout(function () {
  789. commons.methods.listenCloseHandler(e, that, block);
  790. commons.methods.retop({ name: block.find('select[xm-select]').attr('xm-select') });
  791. $('.xm-select-parent input.xm-select-input-search').each(function (index, item) {
  792. var that = $(item);
  793. if (that.parents('dl').hasClass('xm-select-hidn')) {
  794. that.val('');
  795. that.parents('dl').find('.layui-hide').removeClass('layui-hide');
  796. that.parents('dl').find('p').remove();
  797. }
  798. });
  799. }, 10);
  800. });
  801. $(document).on({
  802. 'input propertychange': function inputPropertychange(e) {
  803. var that = $(e.target);
  804. var dl = that.parents('dl');
  805. that.parents('dl').find('p').remove();
  806. dl.find('.layui-hide').removeClass('layui-hide');
  807. dl.find('dd:not(.layui-select-tips):not(:contains(\'' + that.val() + '\'))').addClass('layui-hide');
  808. if (!dl.find('dd:not(.layui-select-tips):not(.layui-hide)').length) {
  809. dl.append('<p class="xm-select-search-empty">\u65E0\u5339\u914D\u9879</p>');
  810. }
  811. dl.find('dt').each(function (index, item) {
  812. if (!$(item).nextUntil('dt', ':not(.layui-hide)').length) {
  813. $(item).addClass('layui-hide');
  814. }
  815. });
  816. }
  817. }, '.xm-select-parent input.xm-select-input-search');
  818. },
  819. formRender: null,
  820. rewriteRender: function rewriteRender() {
  821. commons.methods.formRender = form.render;
  822. form.render = function (type, filter, repeat) {
  823. commons.methods.formRender(type, filter);
  824. if (filter) {
  825. var sel = $('[lay-filter=' + filter + ']').find('select[' + commons.data.name + ']');
  826. if (sel.length) {
  827. if (repeat) {
  828. commons.methods.init(commons.methods.getOptions(sel));
  829. }
  830. }
  831. return;
  832. }
  833. commons.methods.autoInit(repeat);
  834. };
  835. },
  836. loadCss: function loadCss(skin, cs) {
  837. if (skin) {
  838. if (skin == 'default') {
  839. return;
  840. }
  841. var sn = void 0;
  842. if ($('style[skin]').length) {
  843. sn = $('style[skin]');
  844. } else {
  845. sn = $('<style ' + skin + ' type="text/css"></style>');
  846. }
  847. var df = styles.colors[skin] ? styles.colors[skin] : styles.colors.default;
  848. var colors = $.extend([], df, cs);
  849. sn.html(styles.cssColor(skin, colors[0], colors[1], colors[2], colors[3], colors[4], colors[5], colors[6]));
  850. sn.insertAfter($('head style:last'));
  851. } else {
  852. $('<style ' + commons.data.name + ' type="text/css">' + styles.css() + '</style>').insertBefore($('head *:first'));
  853. var html = '';
  854. for (var name in styles.colors) {
  855. var _colors = styles.colors[name];
  856. if (_colors) {
  857. _colors = $.extend([], styles.colors.default, _colors);
  858. html += '<style ' + name + ' type="text/css">' + styles.cssColor(name, _colors[0], _colors[1], _colors[2], _colors[3], _colors[4], _colors[5], _colors[6]) + '</style>';
  859. }
  860. }
  861. if (html) {
  862. $(html).insertAfter($('head style[' + commons.data.name + ']'));
  863. }
  864. }
  865. },
  866. loadLastStyle: function loadLastStyle() {
  867. $('head').append('<style>' + styles.renderCss() + '</style>');
  868. },
  869. resize: function resize(selector, fun) {
  870. var id = commons.data.resize.get(selector);
  871. if (id != undefined) {
  872. clearInterval(id);
  873. }
  874. if (fun && fun instanceof Function) {
  875. var hisize = new Map();
  876. id = setInterval(function (e) {
  877. $(selector).each(function (index, item) {
  878. var thisize = [item.clientHeight, item.clientWidth];
  879. if (hisize.get(item)) {
  880. var his = hisize.get(item);
  881. if (his[0] != thisize[0] || his[1] != thisize[1]) {
  882. fun(item);
  883. }
  884. }
  885. hisize.set(item, thisize);
  886. });
  887. }, 250);
  888. commons.data.resize.set(selector, id);
  889. }
  890. },
  891. run: function run() {
  892. commons.methods.rewriteRender();
  893. commons.methods.listenClose();
  894. commons.methods.loadCss();
  895. commons.methods.loadLastStyle();
  896. commons.methods.autoInit();
  897. commons.methods.resize('.xm-select:not(.xm-select-height)', function (dom) {
  898. commons.methods.handlerDataTable(dom, dom.clientHeight + 'px');
  899. });
  900. }
  901. }
  902. },
  903. styles = {
  904. colors: { //name, spanBgColor, spanColor, iBgColor, iColor, borderColor, tBgColor, tColor
  905. default: ['#F0F2F5', '#909399', '#C0C4CC', '#FFFFFF', '#F0F2F5', '#5FB878', '#FFFFFF'],
  906. primary: ['#009688', '#FFFFFF', '#009688', '#FFFFFF', '#009688', '#009688', '#FFFFFF'],
  907. normal: ['#1E9FFF', '#FFFFFF', '#1E9FFF', '#FFFFFF', '#1E9FFF', '#1E9FFF', '#FFFFFF'],
  908. warm: ['#FFB800', '#FFFFFF', '#FFB800', '#FFFFFF', '#FFB800', '#FFB800', '#FFFFFF'],
  909. danger: ['#FF5722', '#FFFFFF', '#FF5722', '#FFFFFF', '#FF5722', '#FF5722', '#FFFFFF']
  910. },
  911. css: function css() {
  912. return '\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > input{display: none!important;}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select{\n\t\t\t\t\t\tline-height: normal;\n\t\t\t\t\t\theight: auto;\n\t\t\t\t\t\tpadding: 4px 10px;\n\t\t\t\t\t\toverflow: hidden;\n\t\t\t\t\t\tmin-height: 38px;\n\t\t\t\t\t\tleft: 0px;\n\t\t\t\t\t\tz-index: 99;\n\t\t\t\t\t\tposition: relative;\n\t\t\t\t\t\tbackground: none;\n\t\t\t\t\t\tpadding-right: 20px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tpadding: 2px 5px;\n\t\t\t\t\t\tbackground: #f0f2f5;\n\t\t\t\t\t\tborder-radius: 2px;\n\t\t\t\t\t\tcolor: #909399;\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t\tline-height: 18px;\n\t\t\t\t\t\theight: 18px;\n\t\t\t\t\t\tmargin: 2px 5px 2px 0px;\n\t\t\t\t\t\tfloat: left;\n\t\t\t\t\t\tcursor: initial;\n\t\t\t\t\t\tuser-select: none;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i{\n\t\t\t\t\t\tbackground-color: #c0c4cc;\n\t\t\t\t\t\tcolor: #ffffff;\n\t\t\t\t\t\tmargin-left: 8px;\n\t\t\t\t\t\tborder-radius: 20px;\n\t\t\t\t\t\tfont-size: 12px;\n\t\t\t\t\t\tcursor: initial;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i:hover{\n\t\t\t\t\t\tbackground-color: #909399;\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span.xm-select-empty{\n\t\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\t\theight: 28px;\n\t\t\t\t\t\tline-height: 28px;\n\t\t\t\t\t\tcolor: #999999\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search{\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t\tpadding-bottom: 5px;\n\t\t\t\t\t\tmargin-right: 30px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > input{\n\t\t\t\t\t\tcursor: text;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t right: 8px;\n\t\t\t\t\t top: 5px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span > i{\n\t\t\t\t\t\tfont-size: 22px;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl dd.xm-select-dd-search > span > i:hover{\n\t\t\t\t\t\tcolor: red;\n\t\t\t\t\t\topacity:.8;\n\t\t\t\t\t\tfilter:alpha(opacity=80);\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select] + div dl p.xm-select-search-empty{\n\t\t\t\t\t\tmargin: 10px 0;\n\t\t\t\t\t text-align: center;\n\t\t\t\t\t color: #999;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'1\'] + div dl dd.xm-select-this,select[xm-select]:not([xm-select-type]) + div dl dd.xm-select-this{\n\t\t\t\t\t\tbackground-color: #5FB878;\n\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'1\'] + div dl dd.layui-disabled,select[xm-select]:not([xm-select-type]) + div dl dd.layui-disabled{\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.layui-disabled i{\n\t\t\t\t\t\tborder-color: #C2C2C2;\n\t\t\t\t\t\tcolor: #FFFFFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.xm-select-this.layui-disabled i{\n\t\t\t\t\t\tbackground-color: #D2D2D2;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'2\'] + div dl dd.xm-select-this:not(.layui-disabled) i{\n\t\t\t\t\t\tbackground-color: #5FB878;\n\t\t\t\t\t\tborder-color: #5FB878;\n\t\t\t\t\t\tcolor: #FFF;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tcolor: #5FB878;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this i{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t';
  913. },
  914. cssColor: function cssColor(name, spanBgColor, spanColor, iBgColor, iColor, borderColor, tBgColor, tColor) {
  915. return '\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tbackground: ' + spanBgColor + ';\n\t\t\t\t\t\tcolor: ' + spanColor + ';\n\t\t\t\t\t\tborder: 1px solid ' + borderColor + '\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i{\n\t\t\t\t\t\tbackground: ' + iBgColor + ';\n\t\t\t\t\t\tcolor: ' + iColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty) i:hover{\n\t\t\t\t\t\topacity:.8;\n\t\t\t\t\t\tfilter:alpha(opacity=80);\n\t\t\t\t\t\tcursor: pointer;\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'1\'] + div dl dd.xm-select-this:not(.layui-disabled),select[xm-select][xm-select-skin=\'' + name + '\']:not([xm-select-type]) + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tbackground-color: ' + tBgColor + ';\n\t\t\t\t\t\tcolor: ' + tColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'2\'] + div dl dd.xm-select-this:not(.layui-disabled) i{\n\t\t\t\t\t\tbackground-color: ' + tBgColor + ';\n\t\t\t\t\t\tborder-color: ' + tBgColor + ';\n\t\t\t\t\t\tcolor: ' + tColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-skin=\'' + name + '\'][xm-select-type=\'3\'] + div dl dd.xm-select-this:not(.layui-disabled){\n\t\t\t\t\t\tcolor: ' + tBgColor + ';\n\t\t\t\t\t}\n\t\t\t\t\tselect[xm-select][xm-select-type=\'3\'] + div dl dd.xm-select-this i{\n\t\t\t\t\t\tposition: absolute;\n\t\t\t\t\t\tright: 10px;\n\t\t\t\t\t}\n\t\t\t\t';
  916. },
  917. renderCss: function renderCss() {
  918. return '\n\t\t\t\t\tselect[xm-select] + div .layui-select-title > div.xm-select > span:not(.xm-select-empty){\n\t\t\t\t\t\tbox-sizing: content-box;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-select dl dd.layui-this{\n\t\t\t\t\t background-color: inherit;\n\t\t\t\t\t color: inherit;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-select dl dd.layui-this.layui-select-tips {\n\t\t\t\t\t\tbackground-color: #FFFFFF;\n\t\t\t\t\t color: #999999;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-parent .layui-form-selected dl {\n\t\t\t\t\t display: none;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-show:{\n\t\t\t\t\t\tdisplay: block;\n\t\t\t\t\t}\n\t\t\t\t\t.xm-select-hidn:{\n\t\t\t\t\t\tdisplay: none;\n\t\t\t\t\t}\n\t\t\t\t';
  919. }
  920. };
  921. commons.methods.run();
  922. return select3;
  923. });