lupine.components 1.1.4 → 1.1.5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.components",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
@@ -14,12 +14,12 @@ class BackActionHelper {
14
14
  const nodes = document.querySelectorAll('[data-back-action^="bb-"]');
15
15
  const buttons = Array.from(nodes)
16
16
  .map((el) => {
17
- const match = el.getAttribute('data-back-action')?.match(/bb-(\d+)/);
18
- return match ? { el, num: parseInt(match[1], 10) } : null;
17
+ const act = el.getAttribute('data-back-action') || '';
18
+ return { el, ind: act.substring(3) };
19
19
  })
20
20
  .filter(Boolean)
21
- .sort((a, b) => b!.num - a!.num)
22
- .map((item) => item!.el);
21
+ .sort((a, b) => b.ind.localeCompare(a.ind)) // desc
22
+ .map((item) => item.el);
23
23
  return buttons;
24
24
  }
25
25