@serendie/ui 2.1.3 → 2.2.0

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 (122) hide show
  1. package/dist/client.js +79 -74
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Avatar/Avatar.d.ts +1 -1
  4. package/dist/components/Banner/Banner.d.ts +1 -1
  5. package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
  6. package/dist/components/Button/Button.d.ts +2 -2
  7. package/dist/components/Button/Button.js +22 -21
  8. package/dist/components/DatePicker/DatePicker.d.ts +13 -0
  9. package/dist/components/DatePicker/DatePicker.js +203 -0
  10. package/dist/components/DatePicker/index.d.ts +2 -0
  11. package/dist/components/DatePicker/index.js +6 -0
  12. package/dist/components/DatePicker/parseDate.d.ts +1 -0
  13. package/dist/components/DatePicker/styles.d.ts +1 -0
  14. package/dist/components/DatePicker/styles.js +224 -0
  15. package/dist/components/IconButton/IconButton.d.ts +3 -3
  16. package/dist/components/List/ListItem.d.ts +1 -1
  17. package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
  18. package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
  19. package/dist/components/Pagination/Pagination.d.ts +1 -1
  20. package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
  21. package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
  22. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
  23. package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
  24. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
  25. package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
  26. package/dist/components/ProgressIndicator/index.d.ts +4 -1
  27. package/dist/components/ProgressIndicator/index.js +3 -2
  28. package/dist/components/ProgressIndicator/util.d.ts +1 -0
  29. package/dist/components/ProgressIndicator/util.js +13 -0
  30. package/dist/components/Search/Search.d.ts +1 -1
  31. package/dist/components/Select/Select.d.ts +1 -1
  32. package/dist/components/Switch/Switch.d.ts +1 -1
  33. package/dist/components/Tabs/Tabs.d.ts +1 -1
  34. package/dist/components/TextField/TextField.js +59 -156
  35. package/dist/components/Toast/Toast.d.ts +1 -1
  36. package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
  37. package/dist/index.d.ts +1 -0
  38. package/dist/index.js +80 -75
  39. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
  40. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
  41. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
  42. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
  43. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
  44. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
  45. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
  46. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
  47. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
  48. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
  49. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
  50. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
  51. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
  52. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
  53. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
  54. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
  55. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
  56. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
  57. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
  58. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
  59. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
  60. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
  61. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
  62. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
  63. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
  64. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
  65. package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
  66. package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
  67. package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
  68. package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
  70. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
  71. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
  72. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
  73. package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
  74. package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
  75. package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
  76. package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
  77. package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
  78. package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
  79. package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
  80. package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
  81. package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
  82. package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  83. package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
  84. package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
  85. package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
  86. package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
  87. package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
  88. package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
  89. package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
  90. package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
  91. package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
  92. package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
  93. package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
  94. package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
  95. package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
  96. package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
  97. package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
  98. package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
  99. package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
  100. package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
  101. package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
  102. package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
  103. package/dist/preset.d.ts +11 -1
  104. package/dist/recipes/index.d.ts +3 -2
  105. package/dist/recipes/index.js +5 -2
  106. package/dist/recipes/textFieldRecipe.d.ts +6 -0
  107. package/dist/recipes/textFieldRecipe.js +107 -0
  108. package/dist/styled-system/css/cva.js +43 -38
  109. package/dist/styled-system/recipes/create-recipe.js +37 -0
  110. package/dist/styled-system/recipes/text-field-recipe.js +61 -0
  111. package/dist/styles.css +1 -1
  112. package/dist/tokens/keyframes/index.d.ts +8 -0
  113. package/dist/tokens/keyframes/index.js +6 -2
  114. package/package.json +3 -3
  115. package/styled-system/recipes/create-recipe.js +82 -0
  116. package/styled-system/recipes/index.d.ts +2 -0
  117. package/styled-system/recipes/index.js +1 -0
  118. package/styled-system/recipes/text-field-recipe.d.ts +28 -0
  119. package/styled-system/recipes/text-field-recipe.js +72 -0
  120. package/styled-system/types/prop-type.d.ts +1 -1
  121. package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
  122. package/dist/node_modules/proxy-compare/dist/index.js +0 -7
@@ -1,28 +1,42 @@
1
- import { isEqual as O, isObject as d, hasProp as p } from "../../utils/dist/index.js";
2
- var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[h] = t, r = (n, h, t) => v(n, typeof h != "symbol" ? h + "" : h, t), c = {
1
+ import { isEqual as O, isObject as p, hasProp as g } from "../../utils/dist/index.js";
2
+ var b = Object.defineProperty, M = (n, u, t) => u in n ? b(n, u, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[u] = t, r = (n, u, t) => M(n, typeof u != "symbol" ? u + "" : u, t), d = {
3
3
  itemToValue(n) {
4
- return typeof n == "string" ? n : d(n) && p(n, "value") ? n.value : "";
4
+ return typeof n == "string" ? n : p(n) && g(n, "value") ? n.value : "";
5
5
  },
6
6
  itemToString(n) {
7
- return typeof n == "string" ? n : d(n) && p(n, "label") ? n.label : c.itemToValue(n);
7
+ return typeof n == "string" ? n : p(n) && g(n, "label") ? n.label : d.itemToValue(n);
8
8
  },
9
9
  isItemDisabled(n) {
10
- return d(n) && p(n, "disabled") ? !!n.disabled : !1;
10
+ return p(n) && g(n, "disabled") ? !!n.disabled : !1;
11
11
  }
12
- }, w = class x {
13
- constructor(h) {
14
- this.options = h, r(this, "items"), r(this, "copy", (t) => new x({ ...this.options, items: t ?? [...this.items] })), r(this, "isEqual", (t) => O(this.items, t.items)), r(this, "setItems", (t) => this.copy(t)), r(this, "getValues", (t = this.items) => Array.from(t).map((e) => this.getItemValue(e)).filter(Boolean)), r(this, "find", (t) => {
12
+ }, w = class I {
13
+ constructor(u) {
14
+ this.options = u, r(this, "items"), r(this, "indexMap", null), r(this, "copy", (t) => new I({ ...this.options, items: t ?? [...this.items] })), r(this, "isEqual", (t) => O(this.items, t.items)), r(this, "setItems", (t) => this.copy(t)), r(this, "getValues", (t = this.items) => {
15
+ const e = [];
16
+ for (const i of t) {
17
+ const s = this.getItemValue(i);
18
+ s != null && e.push(s);
19
+ }
20
+ return e;
21
+ }), r(this, "find", (t) => {
15
22
  if (t == null) return null;
16
23
  const e = this.indexOf(t);
17
- return e != null ? this.at(e) : null;
18
- }), r(this, "findMany", (t) => Array.from(t).map((e) => this.find(e)).filter((e) => e != null)), r(this, "at", (t) => {
24
+ return e !== -1 ? this.at(e) : null;
25
+ }), r(this, "findMany", (t) => {
26
+ const e = [];
27
+ for (const i of t) {
28
+ const s = this.find(i);
29
+ s != null && e.push(s);
30
+ }
31
+ return e;
32
+ }), r(this, "at", (t) => {
19
33
  if (!this.options.groupBy && !this.options.groupSort)
20
34
  return this.items[t] ?? null;
21
35
  let e = 0;
22
36
  const i = this.group();
23
37
  for (const [, s] of i)
24
- for (const u of s) {
25
- if (e === t) return u;
38
+ for (const h of s) {
39
+ if (e === t) return h;
26
40
  e++;
27
41
  }
28
42
  return null;
@@ -31,29 +45,36 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
31
45
  return (i ?? 0) - (s ?? 0);
32
46
  }), r(this, "sort", (t) => [...t].sort(this.sortFn.bind(this))), r(this, "getItemValue", (t) => {
33
47
  var e, i;
34
- return t == null ? null : ((i = (e = this.options).itemToValue) == null ? void 0 : i.call(e, t)) ?? c.itemToValue(t);
48
+ return t == null ? null : ((i = (e = this.options).itemToValue) == null ? void 0 : i.call(e, t)) ?? d.itemToValue(t);
35
49
  }), r(this, "getItemDisabled", (t) => {
36
50
  var e, i;
37
- return t == null ? !1 : ((i = (e = this.options).isItemDisabled) == null ? void 0 : i.call(e, t)) ?? c.isItemDisabled(t);
51
+ return t == null ? !1 : ((i = (e = this.options).isItemDisabled) == null ? void 0 : i.call(e, t)) ?? d.isItemDisabled(t);
38
52
  }), r(this, "stringifyItem", (t) => {
39
53
  var e, i;
40
- return t == null ? null : ((i = (e = this.options).itemToString) == null ? void 0 : i.call(e, t)) ?? c.itemToString(t);
41
- }), r(this, "stringify", (t) => t == null ? null : this.stringifyItem(this.find(t))), r(this, "stringifyItems", (t, e = ", ") => Array.from(t).map((i) => this.stringifyItem(i)).filter(Boolean).join(e)), r(this, "stringifyMany", (t, e) => this.stringifyItems(this.findMany(t), e)), r(this, "has", (t) => this.indexOf(t) !== -1), r(this, "hasItem", (t) => t == null ? !1 : this.has(this.getItemValue(t))), r(this, "group", () => {
54
+ return t == null ? null : ((i = (e = this.options).itemToString) == null ? void 0 : i.call(e, t)) ?? d.itemToString(t);
55
+ }), r(this, "stringify", (t) => t == null ? null : this.stringifyItem(this.find(t))), r(this, "stringifyItems", (t, e = ", ") => {
56
+ const i = [];
57
+ for (const s of t) {
58
+ const h = this.stringifyItem(s);
59
+ h != null && i.push(h);
60
+ }
61
+ return i.join(e);
62
+ }), r(this, "stringifyMany", (t, e) => this.stringifyItems(this.findMany(t), e)), r(this, "has", (t) => this.indexOf(t) !== -1), r(this, "hasItem", (t) => t == null ? !1 : this.has(this.getItemValue(t))), r(this, "group", () => {
42
63
  const { groupBy: t, groupSort: e } = this.options;
43
64
  if (!t) return [["", [...this.items]]];
44
65
  const i = /* @__PURE__ */ new Map();
45
- this.items.forEach((u, l) => {
46
- const o = t(u, l);
47
- i.has(o) || i.set(o, []), i.get(o).push(u);
66
+ this.items.forEach((h, l) => {
67
+ const o = t(h, l);
68
+ i.has(o) || i.set(o, []), i.get(o).push(h);
48
69
  });
49
70
  let s = Array.from(i.entries());
50
- return e && s.sort(([u], [l]) => {
51
- if (typeof e == "function") return e(u, l);
71
+ return e && s.sort(([h], [l]) => {
72
+ if (typeof e == "function") return e(h, l);
52
73
  if (Array.isArray(e)) {
53
- const o = e.indexOf(u), f = e.indexOf(l);
54
- return o === -1 ? 1 : f === -1 ? -1 : o - f;
74
+ const o = e.indexOf(h), a = e.indexOf(l);
75
+ return o === -1 ? 1 : a === -1 ? -1 : o - a;
55
76
  }
56
- return e === "asc" ? u.localeCompare(l) : e === "desc" ? l.localeCompare(u) : 0;
77
+ return e === "asc" ? h.localeCompare(l) : e === "desc" ? l.localeCompare(h) : 0;
57
78
  }), s;
58
79
  }), r(this, "getNextValue", (t, e = 1, i = !1) => {
59
80
  let s = this.indexOf(t);
@@ -68,46 +89,56 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
68
89
  }), r(this, "indexOf", (t) => {
69
90
  if (t == null) return -1;
70
91
  if (!this.options.groupBy && !this.options.groupSort)
71
- return this.items.findIndex((s) => this.getItemValue(s) === t);
72
- let e = 0;
73
- const i = this.group();
74
- for (const [, s] of i)
75
- for (const u of s) {
76
- if (this.getItemValue(u) === t) return e;
77
- e++;
78
- }
79
- return -1;
92
+ return this.items.findIndex((e) => this.getItemValue(e) === t);
93
+ if (!this.indexMap) {
94
+ this.indexMap = /* @__PURE__ */ new Map();
95
+ let e = 0;
96
+ const i = this.group();
97
+ for (const [, s] of i)
98
+ for (const h of s) {
99
+ const l = this.getItemValue(h);
100
+ l != null && this.indexMap.set(l, e), e++;
101
+ }
102
+ }
103
+ return this.indexMap.get(t) ?? -1;
80
104
  }), r(this, "getByText", (t, e) => {
81
- let i = e != null ? A(this.items, this.indexOf(e)) : this.items;
82
- return t.length === 1 && (i = i.filter((u) => this.getItemValue(u) !== e)), i.find((u) => B(this.stringifyItem(u), t));
105
+ const i = e != null ? this.indexOf(e) : -1, s = t.length === 1;
106
+ for (let h = 0; h < this.items.length; h++) {
107
+ const l = this.items[(i + h + 1) % this.items.length];
108
+ if (!(s && this.getItemValue(l) === e) && !this.getItemDisabled(l) && S(this.stringifyItem(l), t))
109
+ return l;
110
+ }
83
111
  }), r(this, "search", (t, e) => {
84
- const { state: i, currentValue: s, timeout: u = 350 } = e, l = i.keysSoFar + t, f = l.length > 1 && Array.from(l).every((m) => m === l[0]) ? l[0] : l, V = this.getByText(f, s), b = this.getItemValue(V);
112
+ const { state: i, currentValue: s, timeout: h = 350 } = e, l = i.keysSoFar + t, a = l.length > 1 && Array.from(l).every((m) => m === l[0]) ? l[0] : l, V = this.getByText(a, s), v = this.getItemValue(V);
85
113
  function y() {
86
114
  clearTimeout(i.timer), i.timer = -1;
87
115
  }
88
- function I(m) {
116
+ function x(m) {
89
117
  i.keysSoFar = m, y(), m !== "" && (i.timer = +setTimeout(() => {
90
- I(""), y();
91
- }, u));
118
+ x(""), y();
119
+ }, h));
92
120
  }
93
- return I(l), b;
121
+ return x(l), v;
94
122
  }), r(this, "update", (t, e) => {
95
- let i = this.items.findIndex((s) => this.getItemValue(s) === t);
123
+ let i = this.indexOf(t);
96
124
  return i === -1 ? this : this.copy([...this.items.slice(0, i), e, ...this.items.slice(i + 1)]);
97
- }), r(this, "insert", (t, ...e) => this.copy(a(this.items, t, ...e))), r(this, "insertBefore", (t, ...e) => {
125
+ }), r(this, "upsert", (t, e, i = "append") => {
126
+ let s = this.indexOf(t);
127
+ return s === -1 ? (i === "append" ? this.append : this.prepend)(e) : this.copy([...this.items.slice(0, s), e, ...this.items.slice(s + 1)]);
128
+ }), r(this, "insert", (t, ...e) => this.copy(f(this.items, t, ...e))), r(this, "insertBefore", (t, ...e) => {
98
129
  let i = this.indexOf(t);
99
130
  if (i === -1)
100
131
  if (this.items.length === 0) i = 0;
101
132
  else return this;
102
- return this.copy(a(this.items, i, ...e));
133
+ return this.copy(f(this.items, i, ...e));
103
134
  }), r(this, "insertAfter", (t, ...e) => {
104
135
  let i = this.indexOf(t);
105
136
  if (i === -1)
106
137
  if (this.items.length === 0) i = 0;
107
138
  else return this;
108
- return this.copy(a(this.items, i + 1, ...e));
109
- }), r(this, "prepend", (...t) => this.copy(a(this.items, 0, ...t))), r(this, "append", (...t) => this.copy(a(this.items, this.items.length, ...t))), r(this, "filter", (t) => {
110
- const e = this.items.filter((i, s) => t(this.stringifyItem(i), s));
139
+ return this.copy(f(this.items, i + 1, ...e));
140
+ }), r(this, "prepend", (...t) => this.copy(f(this.items, 0, ...t))), r(this, "append", (...t) => this.copy(f(this.items, this.items.length, ...t))), r(this, "filter", (t) => {
141
+ const e = this.items.filter((i, s) => t(this.stringifyItem(i), s, i));
111
142
  return this.copy(e);
112
143
  }), r(this, "remove", (...t) => {
113
144
  const e = t.map(
@@ -121,18 +152,18 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
121
152
  );
122
153
  }), r(this, "move", (t, e) => {
123
154
  const i = this.indexOf(t);
124
- return i === -1 ? this : this.copy(g(this.items, [i], e));
155
+ return i === -1 ? this : this.copy(c(this.items, [i], e));
125
156
  }), r(this, "moveBefore", (t, ...e) => {
126
- let i = this.items.findIndex((u) => this.getItemValue(u) === t);
157
+ let i = this.items.findIndex((h) => this.getItemValue(h) === t);
127
158
  if (i === -1) return this;
128
- let s = e.map((u) => this.items.findIndex((l) => this.getItemValue(l) === u)).sort((u, l) => u - l);
129
- return this.copy(g(this.items, s, i));
159
+ let s = e.map((h) => this.items.findIndex((l) => this.getItemValue(l) === h)).sort((h, l) => h - l);
160
+ return this.copy(c(this.items, s, i));
130
161
  }), r(this, "moveAfter", (t, ...e) => {
131
- let i = this.items.findIndex((u) => this.getItemValue(u) === t);
162
+ let i = this.items.findIndex((h) => this.getItemValue(h) === t);
132
163
  if (i === -1) return this;
133
- let s = e.map((u) => this.items.findIndex((l) => this.getItemValue(l) === u)).sort((u, l) => u - l);
134
- return this.copy(g(this.items, s, i + 1));
135
- }), r(this, "reorder", (t, e) => this.copy(g(this.items, [t], e))), r(this, "compareValue", (t, e) => {
164
+ let s = e.map((h) => this.items.findIndex((l) => this.getItemValue(l) === h)).sort((h, l) => h - l);
165
+ return this.copy(c(this.items, s, i + 1));
166
+ }), r(this, "reorder", (t, e) => this.copy(c(this.items, [t], e))), r(this, "compareValue", (t, e) => {
136
167
  const i = this.indexOf(t), s = this.indexOf(e);
137
168
  return i < s ? -1 : i > s ? 1 : 0;
138
169
  }), r(this, "range", (t, e) => {
@@ -145,7 +176,7 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
145
176
  }), r(this, "getValueRange", (t, e) => t && e ? this.compareValue(t, e) <= 0 ? this.range(t, e) : this.range(e, t) : []), r(this, "toString", () => {
146
177
  let t = "";
147
178
  for (const e of this.items) {
148
- const i = this.getItemValue(e), s = this.stringifyItem(e), u = this.getItemDisabled(e), l = [i, s, u].filter(Boolean).join(":");
179
+ const i = this.getItemValue(e), s = this.stringifyItem(e), h = this.getItemDisabled(e), l = [i, s, h].filter(Boolean).join(":");
149
180
  t += l + ",";
150
181
  }
151
182
  return t;
@@ -153,7 +184,7 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
153
184
  size: this.size,
154
185
  first: this.firstValue,
155
186
  last: this.lastValue
156
- })), this.items = [...h.items];
187
+ })), this.items = [...u.items];
157
188
  }
158
189
  /**
159
190
  * Returns the number of items in the collection
@@ -165,31 +196,31 @@ var S = Object.defineProperty, v = (n, h, t) => h in n ? S(n, h, { enumerable: !
165
196
  * Returns the first value in the collection
166
197
  */
167
198
  get firstValue() {
168
- let h = 0;
169
- for (; this.getItemDisabled(this.at(h)); ) h++;
170
- return this.getItemValue(this.at(h));
199
+ let u = 0;
200
+ for (; this.getItemDisabled(this.at(u)); ) u++;
201
+ return this.getItemValue(this.at(u));
171
202
  }
172
203
  /**
173
204
  * Returns the last value in the collection
174
205
  */
175
206
  get lastValue() {
176
- let h = this.size - 1;
177
- for (; this.getItemDisabled(this.at(h)); ) h--;
178
- return this.getItemValue(this.at(h));
207
+ let u = this.size - 1;
208
+ for (; this.getItemDisabled(this.at(u)); ) u--;
209
+ return this.getItemValue(this.at(u));
179
210
  }
180
211
  *[Symbol.iterator]() {
181
212
  yield* this.items;
182
213
  }
183
- }, B = (n, h) => !!(n != null && n.toLowerCase().startsWith(h.toLowerCase())), A = (n, h) => n.map((t, e) => n[(Math.max(h, 0) + e) % n.length]);
184
- function a(n, h, ...t) {
185
- return [...n.slice(0, h), ...t, ...n.slice(h)];
214
+ }, S = (n, u) => !!(n != null && n.toLowerCase().startsWith(u.toLowerCase()));
215
+ function f(n, u, ...t) {
216
+ return [...n.slice(0, u), ...t, ...n.slice(u)];
186
217
  }
187
- function g(n, h, t) {
188
- h = [...h].sort((i, s) => i - s);
189
- const e = h.map((i) => n[i]);
190
- for (let i = h.length - 1; i >= 0; i--)
191
- n = [...n.slice(0, h[i]), ...n.slice(h[i] + 1)];
192
- return t = Math.max(0, t - h.filter((i) => i < t).length), [...n.slice(0, t), ...e, ...n.slice(t)];
218
+ function c(n, u, t) {
219
+ u = [...u].sort((i, s) => i - s);
220
+ const e = u.map((i) => n[i]);
221
+ for (let i = u.length - 1; i >= 0; i--)
222
+ n = [...n.slice(0, u[i]), ...n.slice(u[i] + 1)];
223
+ return t = Math.max(0, t - u.filter((i) => i < t).length), [...n.slice(0, t), ...e, ...n.slice(t)];
193
224
  }
194
225
  export {
195
226
  w as ListCollection