Dashboard sipadu mbip
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

bind.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*!
  2. Copyright (c) 2017 Jed Watson.
  3. Licensed under the MIT License (MIT), see
  4. http://jedwatson.github.io/classnames
  5. */
  6. /* global define */
  7. (function () {
  8. 'use strict';
  9. var hasOwn = {}.hasOwnProperty;
  10. function classNames () {
  11. var classes = [];
  12. for (var i = 0; i < arguments.length; i++) {
  13. var arg = arguments[i];
  14. if (!arg) continue;
  15. var argType = typeof arg;
  16. if (argType === 'string' || argType === 'number') {
  17. classes.push(this && this[arg] || arg);
  18. } else if (Array.isArray(arg)) {
  19. classes.push(classNames.apply(this, arg));
  20. } else if (argType === 'object') {
  21. for (var key in arg) {
  22. if (hasOwn.call(arg, key) && arg[key]) {
  23. classes.push(this && this[key] || key);
  24. }
  25. }
  26. }
  27. }
  28. return classes.join(' ');
  29. }
  30. if (typeof module !== 'undefined' && module.exports) {
  31. classNames.default = classNames;
  32. module.exports = classNames;
  33. } else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
  34. // register as 'classnames', consistent with npm package name
  35. define('classnames', [], function () {
  36. return classNames;
  37. });
  38. } else {
  39. window.classNames = classNames;
  40. }
  41. }());