@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.
- package/dist/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
import { isEqual as O, isObject as
|
|
2
|
-
var
|
|
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 :
|
|
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 :
|
|
7
|
+
return typeof n == "string" ? n : p(n) && g(n, "label") ? n.label : d.itemToValue(n);
|
|
8
8
|
},
|
|
9
9
|
isItemDisabled(n) {
|
|
10
|
-
return
|
|
10
|
+
return p(n) && g(n, "disabled") ? !!n.disabled : !1;
|
|
11
11
|
}
|
|
12
|
-
}, w = class
|
|
13
|
-
constructor(
|
|
14
|
-
this.options =
|
|
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
|
|
18
|
-
}), r(this, "findMany", (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
|
|
25
|
-
if (e === t) return
|
|
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)) ??
|
|
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)) ??
|
|
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)) ??
|
|
41
|
-
}), r(this, "stringify", (t) => t == null ? null : this.stringifyItem(this.find(t))), r(this, "stringifyItems", (t, e = ", ") =>
|
|
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((
|
|
46
|
-
const o = t(
|
|
47
|
-
i.has(o) || i.set(o, []), i.get(o).push(
|
|
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(([
|
|
51
|
-
if (typeof e == "function") return e(
|
|
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(
|
|
54
|
-
return o === -1 ? 1 :
|
|
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" ?
|
|
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((
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
82
|
-
|
|
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:
|
|
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
|
|
116
|
+
function x(m) {
|
|
89
117
|
i.keysSoFar = m, y(), m !== "" && (i.timer = +setTimeout(() => {
|
|
90
|
-
|
|
91
|
-
},
|
|
118
|
+
x(""), y();
|
|
119
|
+
}, h));
|
|
92
120
|
}
|
|
93
|
-
return
|
|
121
|
+
return x(l), v;
|
|
94
122
|
}), r(this, "update", (t, e) => {
|
|
95
|
-
let i = this.
|
|
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, "
|
|
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(
|
|
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(
|
|
109
|
-
}), r(this, "prepend", (...t) => this.copy(
|
|
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(
|
|
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((
|
|
157
|
+
let i = this.items.findIndex((h) => this.getItemValue(h) === t);
|
|
127
158
|
if (i === -1) return this;
|
|
128
|
-
let s = e.map((
|
|
129
|
-
return this.copy(
|
|
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((
|
|
162
|
+
let i = this.items.findIndex((h) => this.getItemValue(h) === t);
|
|
132
163
|
if (i === -1) return this;
|
|
133
|
-
let s = e.map((
|
|
134
|
-
return this.copy(
|
|
135
|
-
}), r(this, "reorder", (t, e) => this.copy(
|
|
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),
|
|
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 = [...
|
|
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
|
|
169
|
-
for (; this.getItemDisabled(this.at(
|
|
170
|
-
return this.getItemValue(this.at(
|
|
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
|
|
177
|
-
for (; this.getItemDisabled(this.at(
|
|
178
|
-
return this.getItemValue(this.at(
|
|
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
|
-
},
|
|
184
|
-
function
|
|
185
|
-
return [...n.slice(0,
|
|
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
|
|
188
|
-
|
|
189
|
-
const e =
|
|
190
|
-
for (let i =
|
|
191
|
-
n = [...n.slice(0,
|
|
192
|
-
return t = Math.max(0, 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
|