@tabler/core 1.6.0 → 1.6.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 (115) hide show
  1. package/dist/css/tabler-flags.css +1 -1
  2. package/dist/css/tabler-flags.css.map +1 -1
  3. package/dist/css/tabler-flags.min.css +1 -1
  4. package/dist/css/tabler-flags.min.css.map +1 -1
  5. package/dist/css/tabler-flags.rtl.css +1 -1
  6. package/dist/css/tabler-flags.rtl.css.map +1 -1
  7. package/dist/css/tabler-flags.rtl.min.css +1 -1
  8. package/dist/css/tabler-flags.rtl.min.css.map +1 -1
  9. package/dist/css/tabler-marketing.css +1 -1
  10. package/dist/css/tabler-marketing.css.map +1 -1
  11. package/dist/css/tabler-marketing.min.css +1 -1
  12. package/dist/css/tabler-marketing.min.css.map +1 -1
  13. package/dist/css/tabler-marketing.rtl.css +1 -1
  14. package/dist/css/tabler-marketing.rtl.css.map +1 -1
  15. package/dist/css/tabler-marketing.rtl.min.css +1 -1
  16. package/dist/css/tabler-marketing.rtl.min.css.map +1 -1
  17. package/dist/css/tabler-payments.css +1 -1
  18. package/dist/css/tabler-payments.css.map +1 -1
  19. package/dist/css/tabler-payments.min.css +1 -1
  20. package/dist/css/tabler-payments.min.css.map +1 -1
  21. package/dist/css/tabler-payments.rtl.css +1 -1
  22. package/dist/css/tabler-payments.rtl.css.map +1 -1
  23. package/dist/css/tabler-payments.rtl.min.css +1 -1
  24. package/dist/css/tabler-payments.rtl.min.css.map +1 -1
  25. package/dist/css/tabler-props.css +1 -1
  26. package/dist/css/tabler-props.css.map +1 -1
  27. package/dist/css/tabler-props.min.css +1 -1
  28. package/dist/css/tabler-props.min.css.map +1 -1
  29. package/dist/css/tabler-props.rtl.css +1 -1
  30. package/dist/css/tabler-props.rtl.css.map +1 -1
  31. package/dist/css/tabler-props.rtl.min.css +1 -1
  32. package/dist/css/tabler-props.rtl.min.css.map +1 -1
  33. package/dist/css/tabler-socials.css +1 -1
  34. package/dist/css/tabler-socials.css.map +1 -1
  35. package/dist/css/tabler-socials.min.css +1 -1
  36. package/dist/css/tabler-socials.min.css.map +1 -1
  37. package/dist/css/tabler-socials.rtl.css +1 -1
  38. package/dist/css/tabler-socials.rtl.css.map +1 -1
  39. package/dist/css/tabler-socials.rtl.min.css +1 -1
  40. package/dist/css/tabler-socials.rtl.min.css.map +1 -1
  41. package/dist/css/tabler-themes.css +1 -1
  42. package/dist/css/tabler-themes.css.map +1 -1
  43. package/dist/css/tabler-themes.min.css +1 -1
  44. package/dist/css/tabler-themes.min.css.map +1 -1
  45. package/dist/css/tabler-themes.rtl.css +1 -1
  46. package/dist/css/tabler-themes.rtl.css.map +1 -1
  47. package/dist/css/tabler-themes.rtl.min.css +1 -1
  48. package/dist/css/tabler-themes.rtl.min.css.map +1 -1
  49. package/dist/css/tabler-vendors.css +1 -1
  50. package/dist/css/tabler-vendors.css.map +1 -1
  51. package/dist/css/tabler-vendors.min.css +1 -1
  52. package/dist/css/tabler-vendors.min.css.map +1 -1
  53. package/dist/css/tabler-vendors.rtl.css +1 -1
  54. package/dist/css/tabler-vendors.rtl.css.map +1 -1
  55. package/dist/css/tabler-vendors.rtl.min.css +1 -1
  56. package/dist/css/tabler-vendors.rtl.min.css.map +1 -1
  57. package/dist/css/tabler.css +12 -2
  58. package/dist/css/tabler.css.map +1 -1
  59. package/dist/css/tabler.min.css +2 -2
  60. package/dist/css/tabler.min.css.map +1 -1
  61. package/dist/css/tabler.rtl.css +12 -2
  62. package/dist/css/tabler.rtl.css.map +1 -1
  63. package/dist/css/tabler.rtl.min.css +2 -2
  64. package/dist/css/tabler.rtl.min.css.map +1 -1
  65. package/dist/js/tabler-theme.esm.js +21 -6
  66. package/dist/js/tabler-theme.esm.js.map +1 -1
  67. package/dist/js/tabler-theme.esm.min.js +2 -2
  68. package/dist/js/tabler-theme.esm.min.js.map +1 -1
  69. package/dist/js/tabler-theme.js +21 -6
  70. package/dist/js/tabler-theme.js.map +1 -1
  71. package/dist/js/tabler-theme.min.js +2 -2
  72. package/dist/js/tabler-theme.min.js.map +1 -1
  73. package/dist/js/tabler.esm.js +332 -131
  74. package/dist/js/tabler.esm.js.map +1 -1
  75. package/dist/js/tabler.esm.min.js +2 -2
  76. package/dist/js/tabler.esm.min.js.map +1 -1
  77. package/dist/js/tabler.js +332 -131
  78. package/dist/js/tabler.js.map +1 -1
  79. package/dist/js/tabler.min.js +2 -2
  80. package/dist/js/tabler.min.js.map +1 -1
  81. package/dist/libs/vanilla-calendar-pro/index.js +2 -2
  82. package/dist/types/src/clipboard.d.ts +3 -0
  83. package/dist/types/src/confetti.d.ts +2 -0
  84. package/dist/types/src/countup.d.ts +2 -0
  85. package/dist/types/src/datepicker.d.ts +24 -6
  86. package/dist/types/src/input-mask.d.ts +2 -1
  87. package/dist/types/src/otp-input.d.ts +6 -2
  88. package/dist/types/src/strength.d.ts +1 -0
  89. package/dist/types/src/switch-icon.d.ts +1 -0
  90. package/js/src/autosize.ts +8 -3
  91. package/js/src/bootstrap/base-component.ts +12 -2
  92. package/js/src/bootstrap/dom/manipulator.ts +1 -1
  93. package/js/src/bootstrap/dropdown.ts +3 -1
  94. package/js/src/bootstrap/util/index.ts +14 -1
  95. package/js/src/clipboard.ts +26 -2
  96. package/js/src/confetti.ts +42 -7
  97. package/js/src/countup.ts +30 -12
  98. package/js/src/datepicker.ts +147 -27
  99. package/js/src/dropdown.ts +12 -5
  100. package/js/src/global.d.ts +4 -2
  101. package/js/src/input-mask.ts +7 -7
  102. package/js/src/otp-input.ts +99 -12
  103. package/js/src/popover.ts +13 -7
  104. package/js/src/sidebar.ts +14 -6
  105. package/js/src/sortable.ts +5 -1
  106. package/js/src/sparkline.ts +15 -6
  107. package/js/src/strength.ts +17 -4
  108. package/js/src/switch-icon.ts +15 -0
  109. package/js/src/tab.ts +17 -7
  110. package/js/src/toast.ts +19 -11
  111. package/js/src/tooltip.ts +16 -7
  112. package/js/tabler-theme.ts +28 -4
  113. package/package.json +2 -2
  114. package/scss/layout/_navbar.scss +1 -2
  115. package/scss/ui/_cards.scss +14 -2
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
@@ -35,15 +35,30 @@ var themeDefaults = {
35
35
  */
36
36
  var params = new URLSearchParams(window.location.search);
37
37
  var prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
38
+ var VALUE_PATTERN = /^[a-z0-9-]{1,32}$/;
39
+ var storage = {
40
+ get(key) {
41
+ try {
42
+ return localStorage.getItem(key);
43
+ } catch (_unused) {
44
+ return null;
45
+ }
46
+ },
47
+ set(key, value) {
48
+ try {
49
+ localStorage.setItem(key, value);
50
+ } catch (_unused2) {}
51
+ }
52
+ };
38
53
  for (const key in themeDefaults) {
39
54
  const param = params.get(key);
40
55
  let selectedValue;
41
- if (!!param) {
42
- localStorage.setItem("tabler-" + key, param);
56
+ if (param && VALUE_PATTERN.test(param)) {
57
+ storage.set("tabler-" + key, param);
43
58
  selectedValue = param;
44
59
  } else {
45
60
  var _ref;
46
- const storedTheme = localStorage.getItem("tabler-" + key);
61
+ const storedTheme = storage.get("tabler-" + key);
47
62
  const serverValue = document.documentElement.getAttribute("data-bs-" + key);
48
63
  selectedValue = (_ref = storedTheme !== null && storedTheme !== void 0 ? storedTheme : serverValue) !== null && _ref !== void 0 ? _ref : themeDefaults[key];
49
64
  }
@@ -52,8 +67,8 @@ for (const key in themeDefaults) {
52
67
  else document.documentElement.removeAttribute("data-bs-" + key);
53
68
  }
54
69
  prefersDark.addEventListener("change", (event) => {
55
- var _localStorage$getItem;
56
- if (((_localStorage$getItem = localStorage.getItem("tabler-theme")) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : "auto") === "auto") {
70
+ var _storage$get;
71
+ if (((_storage$get = storage.get("tabler-theme")) !== null && _storage$get !== void 0 ? _storage$get : "auto") === "auto") {
57
72
  if (event.matches) document.documentElement.setAttribute("data-bs-theme", "dark");
58
73
  else document.documentElement.removeAttribute("data-bs-theme");
59
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tabler-theme.esm.js","names":[],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (!!param) {\n localStorage.setItem('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = localStorage.getItem('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((localStorage.getItem('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;AAOA,IAAa,gBAAgB;CAC3B,SAAS;CACT,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,UAAU;CACV,UAAU;CACV,mBAAmB;CACnB,gBAAgB;CAChB,gBAAgB;CAChB,mBAAmB;CACnB,WAAW;AACb;;;;;;;;ACbA,IAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAEzD,IAAM,cAAc,OAAO,WAAW,8BAA8B;AAEpE,KAAK,MAAM,OAAO,eAAe;CAC/B,MAAM,QAAQ,OAAO,IAAI,GAAG;CAC5B,IAAI;CAEJ,IAAI,CAAC,CAAC,OAAO;EACX,aAAa,QAAQ,YAAY,KAAK,KAAK;EAC3C,gBAAgB;CAClB,OAAO;;EAEL,MAAM,cAAc,aAAa,QAAQ,YAAY,GAAG;EACxD,MAAM,cAAc,SAAS,gBAAgB,aAAa,aAAa,GAAG;EAC1E,iBAAA,OAAgB,gBAAA,QAAA,gBAAA,KAAA,IAAA,cAAe,iBAAA,QAAA,SAAA,KAAA,IAAA,OAAe,cAAc;CAC9D;CAEA,IAAI,QAAQ,WAAW,kBAAkB,QACvC,gBAAgB,YAAY,UAAU,SAAS;CAGjD,IAAI,kBAAkB,cAAc,MAClC,SAAS,gBAAgB,aAAa,aAAa,KAAK,aAAa;MAErE,SAAS,gBAAgB,gBAAgB,aAAa,GAAG;AAE7D;AAEA,YAAY,iBAAiB,WAAW,UAAU;;CAEhD,MAAA,wBAAK,aAAa,QAAQ,cAAc,OAAA,QAAA,0BAAA,KAAA,IAAA,wBAAK,YAAY,QAAQ;EAC/D,IAAI,MAAM,SACR,SAAS,gBAAgB,aAAa,iBAAiB,MAAM;OAE7D,SAAS,gBAAgB,gBAAgB,eAAe;CAE5D;AACF,CAAC"}
1
+ {"version":3,"file":"tabler-theme.esm.js","names":[],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n// A setting value is a short token: it ends up as a `data-bs-*` attribute on\n// <html> and in localStorage, so anything else from the URL is ignored.\nconst VALUE_PATTERN = /^[a-z0-9-]{1,32}$/\n\n// Accessing localStorage throws when site data is blocked (Chrome \"block all\n// cookies\", Safari with storage disabled, partitioned third-party frames), so\n// every access is guarded and the switcher falls back to the page defaults.\nconst storage = {\n get(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch {\n return null\n }\n },\n set(key: string, value: string): void {\n try {\n localStorage.setItem(key, value)\n } catch {\n // ignore: the choice applies to this page only\n }\n },\n}\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (param && VALUE_PATTERN.test(param)) {\n storage.set('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = storage.get('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((storage.get('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;AAOA,IAAa,gBAAgB;CAC3B,SAAS;CACT,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,UAAU;CACV,UAAU;CACV,mBAAmB;CACnB,gBAAgB;CAChB,gBAAgB;CAChB,mBAAmB;CACnB,WAAW;AACb;;;;;;;;ACbA,IAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAEzD,IAAM,cAAc,OAAO,WAAW,8BAA8B;AAIpE,IAAM,gBAAgB;AAKtB,IAAM,UAAU;CACd,IAAI,KAA4B;EAC9B,IAAI;GACF,OAAO,aAAa,QAAQ,GAAG;EACjC,SAAA,SAAQ;GACN,OAAO;EACT;CACF;CACA,IAAI,KAAa,OAAqB;EACpC,IAAI;GACF,aAAa,QAAQ,KAAK,KAAK;EACjC,SAAA,UAAQ,CAER;CACF;AACF;AAEA,KAAK,MAAM,OAAO,eAAe;CAC/B,MAAM,QAAQ,OAAO,IAAI,GAAG;CAC5B,IAAI;CAEJ,IAAI,SAAS,cAAc,KAAK,KAAK,GAAG;EACtC,QAAQ,IAAI,YAAY,KAAK,KAAK;EAClC,gBAAgB;CAClB,OAAO;;EAEL,MAAM,cAAc,QAAQ,IAAI,YAAY,GAAG;EAC/C,MAAM,cAAc,SAAS,gBAAgB,aAAa,aAAa,GAAG;EAC1E,iBAAA,OAAgB,gBAAA,QAAA,gBAAA,KAAA,IAAA,cAAe,iBAAA,QAAA,SAAA,KAAA,IAAA,OAAe,cAAc;CAC9D;CAEA,IAAI,QAAQ,WAAW,kBAAkB,QACvC,gBAAgB,YAAY,UAAU,SAAS;CAGjD,IAAI,kBAAkB,cAAc,MAClC,SAAS,gBAAgB,aAAa,aAAa,KAAK,aAAa;MAErE,SAAS,gBAAgB,gBAAgB,aAAa,GAAG;AAE7D;AAEA,YAAY,iBAAiB,WAAW,UAAU;;CAEhD,MAAA,eAAK,QAAQ,IAAI,cAAc,OAAA,QAAA,iBAAA,KAAA,IAAA,eAAK,YAAY,QAAQ;EACtD,IAAI,MAAM,SACR,SAAS,gBAAgB,aAAa,iBAAiB,MAAM;OAE7D,SAAS,gBAAgB,gBAAgB,eAAe;CAE5D;AACF,CAAC"}
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
6
6
  */
7
- var e={theme:"auto","theme-base":"neutral","theme-font":"sans-serif","theme-primary":"blue","theme-radius":"1",layout:"default",navbar:"default","navbar-position":"horizontal","navbar-style":"default","navbar-theme":"default","offcanvas-style":"default",sidebar:"default"},t=new URLSearchParams(window.location.search),a=window.matchMedia("(prefers-color-scheme: dark)");for(const n in e){const r=t.get(n);let l;if(r)localStorage.setItem("tabler-"+n,r),l=r;else{var o;const t=localStorage.getItem("tabler-"+n),a=document.documentElement.getAttribute("data-bs-"+n);l=null!==(o=null!=t?t:a)&&void 0!==o?o:e[n]}"theme"===n&&"auto"===l&&(l=a.matches?"dark":"light"),l!==e[n]?document.documentElement.setAttribute("data-bs-"+n,l):document.documentElement.removeAttribute("data-bs-"+n)}a.addEventListener("change",e=>{var t;"auto"===(null!==(t=localStorage.getItem("tabler-theme"))&&void 0!==t?t:"auto")&&(e.matches?document.documentElement.setAttribute("data-bs-theme","dark"):document.documentElement.removeAttribute("data-bs-theme"))});
7
+ var e={theme:"auto","theme-base":"neutral","theme-font":"sans-serif","theme-primary":"blue","theme-radius":"1",layout:"default",navbar:"default","navbar-position":"horizontal","navbar-style":"default","navbar-theme":"default","offcanvas-style":"default",sidebar:"default"},t=new URLSearchParams(window.location.search),a=window.matchMedia("(prefers-color-scheme: dark)"),r=/^[a-z0-9-]{1,32}$/,n={get(e){try{return localStorage.getItem(e)}catch(e){return null}},set(e,t){try{localStorage.setItem(e,t)}catch(e){}}};for(const l in e){const m=t.get(l);let u;if(m&&r.test(m))n.set("tabler-"+l,m),u=m;else{var o;const t=n.get("tabler-"+l),a=document.documentElement.getAttribute("data-bs-"+l);u=null!==(o=null!=t?t:a)&&void 0!==o?o:e[l]}"theme"===l&&"auto"===u&&(u=a.matches?"dark":"light"),u!==e[l]?document.documentElement.setAttribute("data-bs-"+l,u):document.documentElement.removeAttribute("data-bs-"+l)}a.addEventListener("change",e=>{var t;"auto"===(null!==(t=n.get("tabler-theme"))&&void 0!==t?t:"auto")&&(e.matches?document.documentElement.setAttribute("data-bs-theme","dark"):document.documentElement.removeAttribute("data-bs-theme"))});
8
8
  //# sourceMappingURL=tabler-theme.esm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist/js/tabler-theme.esm.min.js.map","names":["themeDefaults","theme","layout","navbar","sidebar","params","URLSearchParams","window","location","search","prefersDark","matchMedia","key","param","get","selectedValue","localStorage","setItem","storedTheme","getItem","serverValue","document","documentElement","getAttribute","_ref","matches","setAttribute","removeAttribute","addEventListener","event","_localStorage$getItem"],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (!!param) {\n localStorage.setItem('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = localStorage.getItem('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((localStorage.getItem('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;AAOA,IAAaA,EAAgB,CAC3BC,MAAS,OACT,aAAc,UACd,aAAc,aACd,gBAAiB,OACjB,eAAgB,IAChBC,OAAU,UACVC,OAAU,UACV,kBAAmB,aACnB,eAAgB,UAChB,eAAgB,UAChB,kBAAmB,UACnBC,QAAW,WCZPC,EAAS,IAAIC,gBAAgBC,OAAOC,SAASC,QAE7CC,EAAcH,OAAOI,WAAW,gCAEtC,IAAK,MAAMC,KAAOZ,EAAe,CAC/B,MAAMa,EAAQR,EAAOS,IAAIF,GACzB,IAAIG,EAEJ,GAAMF,EACJG,aAAaC,QAAQ,UAAYL,EAAKC,GACtCE,EAAgBF,MACX,C,MAEL,MAAMK,EAAcF,aAAaG,QAAQ,UAAYP,GAC/CQ,EAAcC,SAASC,gBAAgBC,aAAa,WAAaX,GACvEG,EAA+B,QAA/BS,EAAgBN,UAAeE,SAAA,IAAAI,IAAexB,EAAcY,EAC9D,CAEY,UAARA,GAAqC,SAAlBG,IACrBA,EAAgBL,EAAYe,QAAU,OAAS,SAG7CV,IAAkBf,EAAcY,GAClCS,SAASC,gBAAgBI,aAAa,WAAad,EAAKG,GAExDM,SAASC,gBAAgBK,gBAAgB,WAAaf,EAE1D,CAEAF,EAAYkB,iBAAiB,SAAWC,I,MAEmB,UAAjB,QAAxCC,EAAKd,aAAaG,QAAQ,uBAAc,IAAAW,IAAK,UACvCD,EAAMJ,QACRJ,SAASC,gBAAgBI,aAAa,gBAAiB,QAEvDL,SAASC,gBAAgBK,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"dist/js/tabler-theme.esm.min.js.map","names":["themeDefaults","theme","layout","navbar","sidebar","params","URLSearchParams","window","location","search","prefersDark","matchMedia","VALUE_PATTERN","storage","get","key","localStorage","getItem","_unused","set","value","setItem","_unused2","param","selectedValue","test","storedTheme","serverValue","document","documentElement","getAttribute","_ref","matches","setAttribute","removeAttribute","addEventListener","event","_storage$get"],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n// A setting value is a short token: it ends up as a `data-bs-*` attribute on\n// <html> and in localStorage, so anything else from the URL is ignored.\nconst VALUE_PATTERN = /^[a-z0-9-]{1,32}$/\n\n// Accessing localStorage throws when site data is blocked (Chrome \"block all\n// cookies\", Safari with storage disabled, partitioned third-party frames), so\n// every access is guarded and the switcher falls back to the page defaults.\nconst storage = {\n get(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch {\n return null\n }\n },\n set(key: string, value: string): void {\n try {\n localStorage.setItem(key, value)\n } catch {\n // ignore: the choice applies to this page only\n }\n },\n}\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (param && VALUE_PATTERN.test(param)) {\n storage.set('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = storage.get('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((storage.get('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;AAOA,IAAaA,EAAgB,CAC3BC,MAAS,OACT,aAAc,UACd,aAAc,aACd,gBAAiB,OACjB,eAAgB,IAChBC,OAAU,UACVC,OAAU,UACV,kBAAmB,aACnB,eAAgB,UAChB,eAAgB,UAChB,kBAAmB,UACnBC,QAAW,WCZPC,EAAS,IAAIC,gBAAgBC,OAAOC,SAASC,QAE7CC,EAAcH,OAAOI,WAAW,gCAIhCC,EAAgB,oBAKhBC,EAAU,CACd,GAAAC,CAAIC,GACF,IACE,OAAOC,aAAaC,QAAQF,EAC9B,OAAAG,GACE,OAAO,IACT,CACF,EACA,GAAAC,CAAIJ,EAAaK,GACf,IACEJ,aAAaK,QAAQN,EAAKK,EAC5B,OAAAE,GAEA,CACF,GAGF,IAAK,MAAMP,KAAOf,EAAe,CAC/B,MAAMuB,EAAQlB,EAAOS,IAAIC,GACzB,IAAIS,EAEJ,GAAID,GAASX,EAAca,KAAKF,GAC9BV,EAAQM,IAAI,UAAYJ,EAAKQ,GAC7BC,EAAgBD,MACX,C,MAEL,MAAMG,EAAcb,EAAQC,IAAI,UAAYC,GACtCY,EAAcC,SAASC,gBAAgBC,aAAa,WAAaf,GACvES,EAA+B,QAA/BO,EAAgBL,UAAeC,SAAA,IAAAI,IAAe/B,EAAce,EAC9D,CAEY,UAARA,GAAqC,SAAlBS,IACrBA,EAAgBd,EAAYsB,QAAU,OAAS,SAG7CR,IAAkBxB,EAAce,GAClCa,SAASC,gBAAgBI,aAAa,WAAalB,EAAKS,GAExDI,SAASC,gBAAgBK,gBAAgB,WAAanB,EAE1D,CAEAL,EAAYyB,iBAAiB,SAAWC,I,MAEU,UAAjB,QAA/BC,EAAKxB,EAAQC,IAAI,uBAAc,IAAAuB,IAAK,UAC9BD,EAAMJ,QACRJ,SAASC,gBAAgBI,aAAa,gBAAiB,QAEvDL,SAASC,gBAAgBK,gBAAgB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
@@ -38,15 +38,30 @@
38
38
  */
39
39
  var params = new URLSearchParams(window.location.search);
40
40
  var prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
41
+ var VALUE_PATTERN = /^[a-z0-9-]{1,32}$/;
42
+ var storage = {
43
+ get(key) {
44
+ try {
45
+ return localStorage.getItem(key);
46
+ } catch (_unused) {
47
+ return null;
48
+ }
49
+ },
50
+ set(key, value) {
51
+ try {
52
+ localStorage.setItem(key, value);
53
+ } catch (_unused2) {}
54
+ }
55
+ };
41
56
  for (const key in themeDefaults) {
42
57
  const param = params.get(key);
43
58
  let selectedValue;
44
- if (!!param) {
45
- localStorage.setItem("tabler-" + key, param);
59
+ if (param && VALUE_PATTERN.test(param)) {
60
+ storage.set("tabler-" + key, param);
46
61
  selectedValue = param;
47
62
  } else {
48
63
  var _ref;
49
- const storedTheme = localStorage.getItem("tabler-" + key);
64
+ const storedTheme = storage.get("tabler-" + key);
50
65
  const serverValue = document.documentElement.getAttribute("data-bs-" + key);
51
66
  selectedValue = (_ref = storedTheme !== null && storedTheme !== void 0 ? storedTheme : serverValue) !== null && _ref !== void 0 ? _ref : themeDefaults[key];
52
67
  }
@@ -55,8 +70,8 @@
55
70
  else document.documentElement.removeAttribute("data-bs-" + key);
56
71
  }
57
72
  prefersDark.addEventListener("change", (event) => {
58
- var _localStorage$getItem;
59
- if (((_localStorage$getItem = localStorage.getItem("tabler-theme")) !== null && _localStorage$getItem !== void 0 ? _localStorage$getItem : "auto") === "auto") {
73
+ var _storage$get;
74
+ if (((_storage$get = storage.get("tabler-theme")) !== null && _storage$get !== void 0 ? _storage$get : "auto") === "auto") {
60
75
  if (event.matches) document.documentElement.setAttribute("data-bs-theme", "dark");
61
76
  else document.documentElement.removeAttribute("data-bs-theme");
62
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tabler-theme.js","names":[],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (!!param) {\n localStorage.setItem('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = localStorage.getItem('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((localStorage.getItem('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;CAOA,IAAa,gBAAgB;EAC3B,SAAS;EACT,cAAc;EACd,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,UAAU;EACV,UAAU;EACV,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,mBAAmB;EACnB,WAAW;CACb;;;;;;;;CCbA,IAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;CAEzD,IAAM,cAAc,OAAO,WAAW,8BAA8B;CAEpE,KAAK,MAAM,OAAO,eAAe;EAC/B,MAAM,QAAQ,OAAO,IAAI,GAAG;EAC5B,IAAI;EAEJ,IAAI,CAAC,CAAC,OAAO;GACX,aAAa,QAAQ,YAAY,KAAK,KAAK;GAC3C,gBAAgB;EAClB,OAAO;;GAEL,MAAM,cAAc,aAAa,QAAQ,YAAY,GAAG;GACxD,MAAM,cAAc,SAAS,gBAAgB,aAAa,aAAa,GAAG;GAC1E,iBAAA,OAAgB,gBAAA,QAAA,gBAAA,KAAA,IAAA,cAAe,iBAAA,QAAA,SAAA,KAAA,IAAA,OAAe,cAAc;EAC9D;EAEA,IAAI,QAAQ,WAAW,kBAAkB,QACvC,gBAAgB,YAAY,UAAU,SAAS;EAGjD,IAAI,kBAAkB,cAAc,MAClC,SAAS,gBAAgB,aAAa,aAAa,KAAK,aAAa;OAErE,SAAS,gBAAgB,gBAAgB,aAAa,GAAG;CAE7D;CAEA,YAAY,iBAAiB,WAAW,UAAU;;EAEhD,MAAA,wBAAK,aAAa,QAAQ,cAAc,OAAA,QAAA,0BAAA,KAAA,IAAA,wBAAK,YAAY,QAAQ;GAC/D,IAAI,MAAM,SACR,SAAS,gBAAgB,aAAa,iBAAiB,MAAM;QAE7D,SAAS,gBAAgB,gBAAgB,eAAe;EAE5D;CACF,CAAC"}
1
+ {"version":3,"file":"tabler-theme.js","names":[],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n// A setting value is a short token: it ends up as a `data-bs-*` attribute on\n// <html> and in localStorage, so anything else from the URL is ignored.\nconst VALUE_PATTERN = /^[a-z0-9-]{1,32}$/\n\n// Accessing localStorage throws when site data is blocked (Chrome \"block all\n// cookies\", Safari with storage disabled, partitioned third-party frames), so\n// every access is guarded and the switcher falls back to the page defaults.\nconst storage = {\n get(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch {\n return null\n }\n },\n set(key: string, value: string): void {\n try {\n localStorage.setItem(key, value)\n } catch {\n // ignore: the choice applies to this page only\n }\n },\n}\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (param && VALUE_PATTERN.test(param)) {\n storage.set('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = storage.get('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((storage.get('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;CAOA,IAAa,gBAAgB;EAC3B,SAAS;EACT,cAAc;EACd,cAAc;EACd,iBAAiB;EACjB,gBAAgB;EAChB,UAAU;EACV,UAAU;EACV,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,mBAAmB;EACnB,WAAW;CACb;;;;;;;;CCbA,IAAM,SAAS,IAAI,gBAAgB,OAAO,SAAS,MAAM;CAEzD,IAAM,cAAc,OAAO,WAAW,8BAA8B;CAIpE,IAAM,gBAAgB;CAKtB,IAAM,UAAU;EACd,IAAI,KAA4B;GAC9B,IAAI;IACF,OAAO,aAAa,QAAQ,GAAG;GACjC,SAAA,SAAQ;IACN,OAAO;GACT;EACF;EACA,IAAI,KAAa,OAAqB;GACpC,IAAI;IACF,aAAa,QAAQ,KAAK,KAAK;GACjC,SAAA,UAAQ,CAER;EACF;CACF;CAEA,KAAK,MAAM,OAAO,eAAe;EAC/B,MAAM,QAAQ,OAAO,IAAI,GAAG;EAC5B,IAAI;EAEJ,IAAI,SAAS,cAAc,KAAK,KAAK,GAAG;GACtC,QAAQ,IAAI,YAAY,KAAK,KAAK;GAClC,gBAAgB;EAClB,OAAO;;GAEL,MAAM,cAAc,QAAQ,IAAI,YAAY,GAAG;GAC/C,MAAM,cAAc,SAAS,gBAAgB,aAAa,aAAa,GAAG;GAC1E,iBAAA,OAAgB,gBAAA,QAAA,gBAAA,KAAA,IAAA,cAAe,iBAAA,QAAA,SAAA,KAAA,IAAA,OAAe,cAAc;EAC9D;EAEA,IAAI,QAAQ,WAAW,kBAAkB,QACvC,gBAAgB,YAAY,UAAU,SAAS;EAGjD,IAAI,kBAAkB,cAAc,MAClC,SAAS,gBAAgB,aAAa,aAAa,KAAK,aAAa;OAErE,SAAS,gBAAgB,gBAAgB,aAAa,GAAG;CAE7D;CAEA,YAAY,iBAAiB,WAAW,UAAU;;EAEhD,MAAA,eAAK,QAAQ,IAAI,cAAc,OAAA,QAAA,iBAAA,KAAA,IAAA,eAAK,YAAY,QAAQ;GACtD,IAAI,MAAM,SACR,SAAS,gBAAgB,aAAa,iBAAiB,MAAM;QAE7D,SAAS,gBAAgB,gBAAgB,eAAe;EAE5D;CACF,CAAC"}
@@ -1,8 +1,8 @@
1
1
  /*!
2
- * Tabler v1.6.0 (https://tabler.io)
2
+ * Tabler v1.6.1 (https://tabler.io)
3
3
  * Copyright 2018-2026 The Tabler Authors
4
4
  * Copyright 2018-2026 codecalm.net Paweł Kuna
5
5
  * Licensed under MIT (https://github.com/tabler/tabler/blob/master/LICENSE)
6
6
  */
7
- !function(e){"function"==typeof define&&define.amd?define([],e):e()}(function(){var e={theme:"auto","theme-base":"neutral","theme-font":"sans-serif","theme-primary":"blue","theme-radius":"1",layout:"default",navbar:"default","navbar-position":"horizontal","navbar-style":"default","navbar-theme":"default","offcanvas-style":"default",sidebar:"default"},t=new URLSearchParams(window.location.search),a=window.matchMedia("(prefers-color-scheme: dark)");for(const o in e){const r=t.get(o);let d;if(r)localStorage.setItem("tabler-"+o,r),d=r;else{var n;const t=localStorage.getItem("tabler-"+o),a=document.documentElement.getAttribute("data-bs-"+o);d=null!==(n=null!=t?t:a)&&void 0!==n?n:e[o]}"theme"===o&&"auto"===d&&(d=a.matches?"dark":"light"),d!==e[o]?document.documentElement.setAttribute("data-bs-"+o,d):document.documentElement.removeAttribute("data-bs-"+o)}a.addEventListener("change",e=>{var t;"auto"===(null!==(t=localStorage.getItem("tabler-theme"))&&void 0!==t?t:"auto")&&(e.matches?document.documentElement.setAttribute("data-bs-theme","dark"):document.documentElement.removeAttribute("data-bs-theme"))})});
7
+ !function(e){"function"==typeof define&&define.amd?define([],e):e()}(function(){var e={theme:"auto","theme-base":"neutral","theme-font":"sans-serif","theme-primary":"blue","theme-radius":"1",layout:"default",navbar:"default","navbar-position":"horizontal","navbar-style":"default","navbar-theme":"default","offcanvas-style":"default",sidebar:"default"},t=new URLSearchParams(window.location.search),a=window.matchMedia("(prefers-color-scheme: dark)"),n=/^[a-z0-9-]{1,32}$/,o={get(e){try{return localStorage.getItem(e)}catch(e){return null}},set(e,t){try{localStorage.setItem(e,t)}catch(e){}}};for(const u in e){const d=t.get(u);let l;if(d&&n.test(d))o.set("tabler-"+u,d),l=d;else{var r;const t=o.get("tabler-"+u),a=document.documentElement.getAttribute("data-bs-"+u);l=null!==(r=null!=t?t:a)&&void 0!==r?r:e[u]}"theme"===u&&"auto"===l&&(l=a.matches?"dark":"light"),l!==e[u]?document.documentElement.setAttribute("data-bs-"+u,l):document.documentElement.removeAttribute("data-bs-"+u)}a.addEventListener("change",e=>{var t;"auto"===(null!==(t=o.get("tabler-theme"))&&void 0!==t?t:"auto")&&(e.matches?document.documentElement.setAttribute("data-bs-theme","dark"):document.documentElement.removeAttribute("data-bs-theme"))})});
8
8
  //# sourceMappingURL=tabler-theme.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dist/js/tabler-theme.min.js.map","names":["themeDefaults","theme","layout","navbar","sidebar","params","URLSearchParams","window","location","search","prefersDark","matchMedia","key","param","get","selectedValue","localStorage","setItem","storedTheme","getItem","serverValue","document","documentElement","getAttribute","_ref","matches","setAttribute","removeAttribute","addEventListener","event","_localStorage$getItem"],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (!!param) {\n localStorage.setItem('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = localStorage.getItem('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((localStorage.getItem('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;gFAOA,IAAaA,EAAgB,CAC3BC,MAAS,OACT,aAAc,UACd,aAAc,aACd,gBAAiB,OACjB,eAAgB,IAChBC,OAAU,UACVC,OAAU,UACV,kBAAmB,aACnB,eAAgB,UAChB,eAAgB,UAChB,kBAAmB,UACnBC,QAAW,WCZPC,EAAS,IAAIC,gBAAgBC,OAAOC,SAASC,QAE7CC,EAAcH,OAAOI,WAAW,gCAEtC,IAAK,MAAMC,KAAOZ,EAAe,CAC/B,MAAMa,EAAQR,EAAOS,IAAIF,GACzB,IAAIG,EAEJ,GAAMF,EACJG,aAAaC,QAAQ,UAAYL,EAAKC,GACtCE,EAAgBF,MACX,C,MAEL,MAAMK,EAAcF,aAAaG,QAAQ,UAAYP,GAC/CQ,EAAcC,SAASC,gBAAgBC,aAAa,WAAaX,GACvEG,EAA+B,QAA/BS,EAAgBN,UAAeE,SAAA,IAAAI,IAAexB,EAAcY,EAC9D,CAEY,UAARA,GAAqC,SAAlBG,IACrBA,EAAgBL,EAAYe,QAAU,OAAS,SAG7CV,IAAkBf,EAAcY,GAClCS,SAASC,gBAAgBI,aAAa,WAAad,EAAKG,GAExDM,SAASC,gBAAgBK,gBAAgB,WAAaf,EAE1D,CAEAF,EAAYkB,iBAAiB,SAAWC,I,MAEmB,UAAjB,QAAxCC,EAAKd,aAAaG,QAAQ,uBAAc,IAAAW,IAAK,UACvCD,EAAMJ,QACRJ,SAASC,gBAAgBI,aAAa,gBAAiB,QAEvDL,SAASC,gBAAgBK,gBAAgB,mB","ignoreList":[]}
1
+ {"version":3,"file":"dist/js/tabler-theme.min.js.map","names":["themeDefaults","theme","layout","navbar","sidebar","params","URLSearchParams","window","location","search","prefersDark","matchMedia","VALUE_PATTERN","storage","get","key","localStorage","getItem","_unused","set","value","setItem","_unused2","param","selectedValue","test","storedTheme","serverValue","document","documentElement","getAttribute","_ref","matches","setAttribute","removeAttribute","addEventListener","event","_storage$get"],"sources":["../../js/src/theme-config.ts","../../js/tabler-theme.ts"],"sourcesContent":["/**\n * Every setting the theme switcher understands, with its default value. Each\n * key becomes a `data-bs-<key>` attribute on `<html>`, a `tabler-<key>`\n * localStorage entry and a `?<key>=` URL parameter, written only when the value\n * differs from the default. Adding a key here is all the JavaScript a new\n * setting needs; the switcher loops over this object.\n */\nexport const themeDefaults = {\n 'theme': 'auto',\n 'theme-base': 'neutral',\n 'theme-font': 'sans-serif',\n 'theme-primary': 'blue',\n 'theme-radius': '1',\n 'layout': 'default',\n 'navbar': 'default',\n 'navbar-position': 'horizontal',\n 'navbar-style': 'default',\n 'navbar-theme': 'default',\n 'offcanvas-style': 'default',\n 'sidebar': 'default',\n} as const\n\nexport type ThemeKey = keyof typeof themeDefaults\n","/**\n * demo-theme is specifically loaded right after the body and not deferred\n * to ensure we switch to the chosen dark/light theme as fast as possible.\n * This will prevent any flashes of the light theme (default) before switching.\n */\nimport { themeDefaults, type ThemeKey } from './src/theme-config'\n\nconst params = new URLSearchParams(window.location.search)\n\nconst prefersDark = window.matchMedia('(prefers-color-scheme: dark)')\n\n// A setting value is a short token: it ends up as a `data-bs-*` attribute on\n// <html> and in localStorage, so anything else from the URL is ignored.\nconst VALUE_PATTERN = /^[a-z0-9-]{1,32}$/\n\n// Accessing localStorage throws when site data is blocked (Chrome \"block all\n// cookies\", Safari with storage disabled, partitioned third-party frames), so\n// every access is guarded and the switcher falls back to the page defaults.\nconst storage = {\n get(key: string): string | null {\n try {\n return localStorage.getItem(key)\n } catch {\n return null\n }\n },\n set(key: string, value: string): void {\n try {\n localStorage.setItem(key, value)\n } catch {\n // ignore: the choice applies to this page only\n }\n },\n}\n\nfor (const key in themeDefaults) {\n const param = params.get(key)\n let selectedValue: string\n\n if (param && VALUE_PATTERN.test(param)) {\n storage.set('tabler-' + key, param)\n selectedValue = param\n } else {\n // A stored choice wins; otherwise a server-rendered attribute is the starting value.\n const storedTheme = storage.get('tabler-' + key)\n const serverValue = document.documentElement.getAttribute('data-bs-' + key)\n selectedValue = storedTheme ?? serverValue ?? themeDefaults[key as ThemeKey]\n }\n\n if (key === 'theme' && selectedValue === 'auto') {\n selectedValue = prefersDark.matches ? 'dark' : 'light'\n }\n\n if (selectedValue !== themeDefaults[key as ThemeKey]) {\n document.documentElement.setAttribute('data-bs-' + key, selectedValue)\n } else {\n document.documentElement.removeAttribute('data-bs-' + key)\n }\n}\n\nprefersDark.addEventListener('change', (event) => {\n // No stored choice means the default, which is auto.\n if ((storage.get('tabler-theme') ?? 'auto') === 'auto') {\n if (event.matches) {\n document.documentElement.setAttribute('data-bs-theme', 'dark')\n } else {\n document.documentElement.removeAttribute('data-bs-theme')\n }\n }\n})\n"],"mappings":";;;;;;gFAOA,IAAaA,EAAgB,CAC3BC,MAAS,OACT,aAAc,UACd,aAAc,aACd,gBAAiB,OACjB,eAAgB,IAChBC,OAAU,UACVC,OAAU,UACV,kBAAmB,aACnB,eAAgB,UAChB,eAAgB,UAChB,kBAAmB,UACnBC,QAAW,WCZPC,EAAS,IAAIC,gBAAgBC,OAAOC,SAASC,QAE7CC,EAAcH,OAAOI,WAAW,gCAIhCC,EAAgB,oBAKhBC,EAAU,CACd,GAAAC,CAAIC,GACF,IACE,OAAOC,aAAaC,QAAQF,EAC9B,OAAAG,GACE,OAAO,IACT,CACF,EACA,GAAAC,CAAIJ,EAAaK,GACf,IACEJ,aAAaK,QAAQN,EAAKK,EAC5B,OAAAE,GAEA,CACF,GAGF,IAAK,MAAMP,KAAOf,EAAe,CAC/B,MAAMuB,EAAQlB,EAAOS,IAAIC,GACzB,IAAIS,EAEJ,GAAID,GAASX,EAAca,KAAKF,GAC9BV,EAAQM,IAAI,UAAYJ,EAAKQ,GAC7BC,EAAgBD,MACX,C,MAEL,MAAMG,EAAcb,EAAQC,IAAI,UAAYC,GACtCY,EAAcC,SAASC,gBAAgBC,aAAa,WAAaf,GACvES,EAA+B,QAA/BO,EAAgBL,UAAeC,SAAA,IAAAI,IAAe/B,EAAce,EAC9D,CAEY,UAARA,GAAqC,SAAlBS,IACrBA,EAAgBd,EAAYsB,QAAU,OAAS,SAG7CR,IAAkBxB,EAAce,GAClCa,SAASC,gBAAgBI,aAAa,WAAalB,EAAKS,GAExDI,SAASC,gBAAgBK,gBAAgB,WAAanB,EAE1D,CAEAL,EAAYyB,iBAAiB,SAAWC,I,MAEU,UAAjB,QAA/BC,EAAKxB,EAAQC,IAAI,uBAAc,IAAAuB,IAAK,UAC9BD,EAAMJ,QACRJ,SAASC,gBAAgBI,aAAa,gBAAiB,QAEvDL,SAASC,gBAAgBK,gBAAgB,mB","ignoreList":[]}