@startinblox/core 0.19.21-beta.1 → 0.19.21

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.
@@ -1526,6 +1526,32 @@ const compare = {
1526
1526
  return ret;
1527
1527
  }
1528
1528
  };
1529
+ function generalComparator(a, b, order = "asc") {
1530
+ let comparison = 0;
1531
+ if (typeof a === "boolean" && typeof b === "boolean") {
1532
+ comparison = a === b ? 0 : a ? 1 : -1;
1533
+ } else if (!isNaN(a) && !isNaN(b)) {
1534
+ comparison = Number(a) - Number(b);
1535
+ } else if (Array.isArray(a) && Array.isArray(b)) {
1536
+ comparison = a.length - b.length;
1537
+ } else if (!isNaN(Date.parse(a)) && !isNaN(Date.parse(b))) {
1538
+ const dateA = new Date(a);
1539
+ const dateB = new Date(a);
1540
+ comparison = dateA.getTime() - dateB.getTime();
1541
+ } else if (typeof a === "object" && typeof b === "object") {
1542
+ const aKeys = Object.keys(a);
1543
+ const bKeys = Object.keys(b);
1544
+ comparison = aKeys.length - bKeys.length;
1545
+ } else if (a == null || b == null) {
1546
+ comparison = a == null ? b == null ? 0 : -1 : b == null ? 1 : 0;
1547
+ } else {
1548
+ comparison = a.toString().localeCompare(b.toString());
1549
+ }
1550
+ if (order === "desc") {
1551
+ comparison = comparison * -1;
1552
+ }
1553
+ return comparison;
1554
+ }
1529
1555
  function transformArrayToContainer(resource) {
1530
1556
  const newValue = { ...resource };
1531
1557
  for (let predicate of Object.keys(newValue)) {
@@ -1631,6 +1657,7 @@ const helpers = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
1631
1657
  evalTemplateString,
1632
1658
  findClosingBracketMatchIndex,
1633
1659
  fuzzyCompare,
1660
+ generalComparator,
1634
1661
  importCSS,
1635
1662
  importInlineCSS,
1636
1663
  importJS,
@@ -1649,14 +1676,15 @@ export {
1649
1676
  defineComponent as d,
1650
1677
  evalTemplateString as e,
1651
1678
  fuzzyCompare as f,
1652
- importCSS as g,
1679
+ generalComparator as g,
1653
1680
  helpers as h,
1654
1681
  importInlineCSS as i,
1655
- importJS as j,
1656
- domIsReady as k,
1682
+ importCSS as j,
1683
+ importJS as k,
1657
1684
  loadScript as l,
1658
- asyncQuerySelector as m,
1659
- asyncQuerySelectorAll as n,
1685
+ domIsReady as m,
1686
+ asyncQuerySelector as n,
1687
+ asyncQuerySelectorAll as o,
1660
1688
  parseFieldsString as p,
1661
1689
  setDeepProperty as s,
1662
1690
  transformArrayToContainer as t,
package/dist/helpers.js CHANGED
@@ -1,18 +1,19 @@
1
- import { A, m, n, c, A as A2, d, k, e, a, f, g, i, j, l, p, s, b, t, u } from "./helpers-4tVqSOBU.js";
1
+ import { A, n, o, c, A as A2, d, m, e, a, f, g, j, i, k, l, p, s, b, t, u } from "./helpers-Fl7SPUjU.js";
2
2
  export {
3
3
  A as AsyncIterableBuilder,
4
- m as asyncQuerySelector,
5
- n as asyncQuerySelectorAll,
4
+ n as asyncQuerySelector,
5
+ o as asyncQuerySelectorAll,
6
6
  c as compare,
7
7
  A2 as default,
8
8
  d as defineComponent,
9
- k as domIsReady,
9
+ m as domIsReady,
10
10
  e as evalTemplateString,
11
11
  a as findClosingBracketMatchIndex,
12
12
  f as fuzzyCompare,
13
- g as importCSS,
13
+ g as generalComparator,
14
+ j as importCSS,
14
15
  i as importInlineCSS,
15
- j as importJS,
16
+ k as importJS,
16
17
  l as loadScript,
17
18
  p as parseFieldsString,
18
19
  s as setDeepProperty,
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { d as defineComponent, u as uniqID, i as importInlineCSS, f as fuzzyCompare, p as parseFieldsString, a as findClosingBracketMatchIndex, c as compare, e as evalTemplateString, s as setDeepProperty, t as transformArrayToContainer } from "./helpers-4tVqSOBU.js";
2
- import { h } from "./helpers-4tVqSOBU.js";
1
+ import { d as defineComponent, u as uniqID, i as importInlineCSS, f as fuzzyCompare, p as parseFieldsString, a as findClosingBracketMatchIndex, c as compare, e as evalTemplateString, g as generalComparator, s as setDeepProperty, t as transformArrayToContainer } from "./helpers-Fl7SPUjU.js";
2
+ import { h } from "./helpers-Fl7SPUjU.js";
3
3
  import PubSub$1 from "https://cdn.skypack.dev/pubsub-js";
4
4
  import L from "https://cdn.skypack.dev/leaflet";
5
5
  import "https://cdn.skypack.dev/leaflet.markercluster";
@@ -14085,11 +14085,6 @@ const formTemplates = {
14085
14085
  name=${ifDefined(attributes.name)}
14086
14086
  value=${value || ""}
14087
14087
  >
14088
- <a
14089
- href=${value || ""}
14090
- ?hidden=${value === ""}
14091
- >${value !== "" ? decodeURI(value.split("/").pop()) : ""}</a>
14092
-
14093
14088
  <input
14094
14089
  type="file"
14095
14090
  id=${ifDefined(attributes.id)}
@@ -52179,6 +52174,14 @@ const GrouperMixin = {
52179
52174
  groupClass: {
52180
52175
  type: String,
52181
52176
  default: ""
52177
+ },
52178
+ orderGroupAsc: {
52179
+ type: Boolean,
52180
+ default: null
52181
+ },
52182
+ orderGroupDesc: {
52183
+ type: Boolean,
52184
+ default: null
52182
52185
  }
52183
52186
  },
52184
52187
  attached() {
@@ -52196,7 +52199,14 @@ const GrouperMixin = {
52196
52199
  groups[valueGroup] = { resources: [] };
52197
52200
  groups[valueGroup].resources.push(resource);
52198
52201
  }
52199
- const parents = Object.keys(groups).map((g2) => ({ group: g2, parent: this.renderGroup(g2, div2) }));
52202
+ let sortedKeys = Object.keys(groups);
52203
+ if (this.orderGroupAsc !== null || this.orderGroupDesc !== null) {
52204
+ const order2 = this.orderGroupDesc !== null ? "desc" : "asc";
52205
+ sortedKeys = Object.keys(groups).sort((a, b) => {
52206
+ return generalComparator(a, b, order2);
52207
+ });
52208
+ }
52209
+ const parents = sortedKeys.map((g2) => ({ group: g2, parent: this.renderGroup(g2, div2) }));
52200
52210
  for (let { group, parent } of parents) {
52201
52211
  if (nextProcessor)
52202
52212
  await nextProcessor(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "0.19.21-beta.1",
3
+ "version": "0.19.21",
4
4
  "description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",