@midas-ds/components 16.5.1 → 16.5.3
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/CHANGELOG.md +20 -0
- package/assets/DateField.css +1 -1
- package/assets/DateRangePicker.css +1 -1
- package/assets/Select.css +1 -1
- package/assets/Select2.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/default.css +1 -1
- package/chunks/DateField-CuNWL_ao.js +91 -0
- package/chunks/{DateRangePicker-DQB5TrfF.js → DateRangePicker-jqrHTmLu.js} +45 -45
- package/chunks/{SearchField-C493CTGJ.js → SearchField-Cd05nl-B.js} +1 -1
- package/chunks/{Select-D9db38XE.js → Select-Bc7Qj5UC.js} +63 -63
- package/chunks/{Select-CaSZY6w_.js → Select-CRUskZeu.js} +127 -127
- package/chunks/{TextArea-kEpt5DKm.js → TextArea-VkipFRQc.js} +1 -1
- package/chunks/TextField.module-B3n8v1vH.js +13 -0
- package/date-field/index.js +1 -1
- package/date-picker/index.js +1 -1
- package/index.js +6 -6
- package/legacy-select/index.js +1 -1
- package/package.json +2 -2
- package/search-field/index.js +1 -1
- package/select/index.js +1 -1
- package/textfield/index.js +1 -1
- package/chunks/DateField-CodiOrfY.js +0 -91
- package/chunks/TextField.module-DZslrEPC.js +0 -13
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
2
|
-
import { SelectStateContext as
|
|
3
|
-
import { FocusScope as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as V } from "react/jsx-runtime";
|
|
2
|
+
import { SelectStateContext as u, SelectValue as h, Button as _, TagList as A, Select as C } from "react-aria-components";
|
|
3
|
+
import { FocusScope as x } from "@react-aria/focus";
|
|
4
4
|
import { a as N, L as b } from "./Label-xWKvOuML.js";
|
|
5
5
|
import { a as y, c as T } from "./clsx-AexbMWKp.js";
|
|
6
6
|
import { T as B } from "./Text-TWzJxnto.js";
|
|
7
7
|
import { F as g } from "./FieldError-Bra5aRT3.js";
|
|
8
|
-
import
|
|
8
|
+
import p, { useContext as f } from "react";
|
|
9
9
|
import { C as M } from "./Checkbox-BTAfwDxU.js";
|
|
10
|
-
import { u as
|
|
10
|
+
import { u as d } from "./useLocalizedStringFormatter-BHvsRxDk.js";
|
|
11
11
|
import { useFocusManager as F } from "react-aria";
|
|
12
12
|
import { X as L } from "./x-BXShoIAM.js";
|
|
13
13
|
import { L as I } from "./ListBox-D5BBeZWL.js";
|
|
14
14
|
import { P as G } from "./Popover-BcEtFiU1.js";
|
|
15
15
|
import { a as j, T as k } from "./Tag-CZrQBEgv.js";
|
|
16
16
|
import { C as R } from "./chevron-down-DgT-uSF9.js";
|
|
17
|
-
import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, w = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" },
|
|
17
|
+
import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, w = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, m = {
|
|
18
18
|
en: $,
|
|
19
19
|
sv: w
|
|
20
|
-
}, P = "
|
|
20
|
+
}, P = "_select_1us8o_1", z = "_triggerContainer_1us8o_7", E = "_trigger_1us8o_7", K = "_medium_1us8o_29", D = "_selectValue_1us8o_72", W = "_placeholder_1us8o_78", X = "_multiSelectValue_1us8o_88", q = "_selectValueTag_1us8o_112", H = "_clearButton_1us8o_126", J = "_truncate_1us8o_138", O = "_popover_1us8o_175", Q = "_selectAll_1us8o_201", U = "_tagGroup_1us8o_264", s = {
|
|
21
21
|
select: P,
|
|
22
22
|
triggerContainer: z,
|
|
23
23
|
trigger: E,
|
|
@@ -32,35 +32,35 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
|
|
|
32
32
|
selectAll: Q,
|
|
33
33
|
tagGroup: U
|
|
34
34
|
}, Y = () => {
|
|
35
|
-
const t =
|
|
35
|
+
const t = p.useContext(u), o = d(m), c = () => t?.setValue(
|
|
36
36
|
t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
|
|
37
37
|
);
|
|
38
38
|
return /* @__PURE__ */ e(
|
|
39
39
|
M,
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
41
|
+
className: s.selectAll,
|
|
42
42
|
isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
|
|
43
43
|
isSelected: t?.selectionManager.isSelectAll,
|
|
44
|
-
onChange:
|
|
45
|
-
children:
|
|
44
|
+
onChange: c,
|
|
45
|
+
children: o.format("selectAll")
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
}, Z = ({
|
|
49
49
|
isDisabled: t
|
|
50
50
|
}) => {
|
|
51
|
-
const
|
|
51
|
+
const o = d(m), c = (l, r) => l.length === 1 ? r : `${l.length} ${o.format("selected")}`;
|
|
52
52
|
return /* @__PURE__ */ e(
|
|
53
|
-
|
|
53
|
+
h,
|
|
54
54
|
{
|
|
55
|
-
className:
|
|
55
|
+
className: s.multiSelectValue,
|
|
56
56
|
"data-disabled": t || void 0,
|
|
57
|
-
children: ({ isPlaceholder: l, selectedItems:
|
|
57
|
+
children: ({ isPlaceholder: l, selectedItems: r, selectedText: a }) => l ? /* @__PURE__ */ e(V, {}) : /* @__PURE__ */ i(
|
|
58
58
|
"div",
|
|
59
59
|
{
|
|
60
|
-
className:
|
|
60
|
+
className: s.selectValueTag,
|
|
61
61
|
"data-disabled": t || void 0,
|
|
62
62
|
children: [
|
|
63
|
-
/* @__PURE__ */ e("span", { className:
|
|
63
|
+
/* @__PURE__ */ e("span", { className: s.truncate, children: c(r, a) }),
|
|
64
64
|
/* @__PURE__ */ e(ee, { isDisabled: t })
|
|
65
65
|
]
|
|
66
66
|
}
|
|
@@ -70,15 +70,15 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
|
|
|
70
70
|
}, ee = ({
|
|
71
71
|
isDisabled: t
|
|
72
72
|
}) => {
|
|
73
|
-
const
|
|
74
|
-
l?.focusFirst(),
|
|
73
|
+
const o = p.useContext(u), c = d(m), l = F(), r = () => {
|
|
74
|
+
l?.focusFirst(), o?.setValue(null);
|
|
75
75
|
};
|
|
76
76
|
return /* @__PURE__ */ e(
|
|
77
|
-
|
|
77
|
+
_,
|
|
78
78
|
{
|
|
79
|
-
"aria-label":
|
|
80
|
-
className:
|
|
81
|
-
onPress:
|
|
79
|
+
"aria-label": c.format("clearAll"),
|
|
80
|
+
className: s.clearButton,
|
|
81
|
+
onPress: r,
|
|
82
82
|
slot: null,
|
|
83
83
|
isDisabled: t,
|
|
84
84
|
children: /* @__PURE__ */ e(
|
|
@@ -92,54 +92,54 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
|
|
|
92
92
|
);
|
|
93
93
|
}, te = ({
|
|
94
94
|
showTags: t,
|
|
95
|
-
isDisabled:
|
|
95
|
+
isDisabled: o
|
|
96
96
|
}) => {
|
|
97
|
-
const
|
|
98
|
-
l?.selectionManager.toggleSelection(Array.from(
|
|
97
|
+
const c = d(m), l = f(u), r = (a) => {
|
|
98
|
+
l?.selectionManager.toggleSelection(Array.from(a)[0]);
|
|
99
99
|
};
|
|
100
100
|
return !l?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
|
|
101
101
|
j,
|
|
102
102
|
{
|
|
103
|
-
"aria-label":
|
|
104
|
-
className:
|
|
105
|
-
onRemove:
|
|
103
|
+
"aria-label": c.format("selectedItems"),
|
|
104
|
+
className: s.tagGroup,
|
|
105
|
+
onRemove: r,
|
|
106
106
|
selectionBehavior: "toggle",
|
|
107
|
-
children: /* @__PURE__ */ e(
|
|
107
|
+
children: /* @__PURE__ */ e(A, { items: l.selectedItems, children: (a) => /* @__PURE__ */ e(
|
|
108
108
|
k,
|
|
109
109
|
{
|
|
110
110
|
dismissable: !0,
|
|
111
|
-
id:
|
|
112
|
-
isDisabled:
|
|
113
|
-
textValue:
|
|
114
|
-
children:
|
|
111
|
+
id: a.key,
|
|
112
|
+
isDisabled: o,
|
|
113
|
+
textValue: a.textValue,
|
|
114
|
+
children: a.textValue
|
|
115
115
|
},
|
|
116
|
-
|
|
116
|
+
a.key
|
|
117
117
|
) })
|
|
118
118
|
}
|
|
119
119
|
);
|
|
120
120
|
}, le = ({
|
|
121
121
|
isDisabled: t,
|
|
122
|
-
selectionMode:
|
|
123
|
-
size:
|
|
122
|
+
selectionMode: o,
|
|
123
|
+
size: c
|
|
124
124
|
}) => {
|
|
125
|
-
const l =
|
|
125
|
+
const l = f(u);
|
|
126
126
|
return /* @__PURE__ */ i(
|
|
127
|
-
|
|
127
|
+
_,
|
|
128
128
|
{
|
|
129
129
|
className: y(
|
|
130
130
|
{
|
|
131
|
-
[
|
|
131
|
+
[s.medium]: c === "medium"
|
|
132
132
|
},
|
|
133
|
-
|
|
133
|
+
s.trigger
|
|
134
134
|
),
|
|
135
135
|
"data-invalid": !!l?.displayValidation.isInvalid || void 0,
|
|
136
136
|
children: [
|
|
137
137
|
/* @__PURE__ */ e(
|
|
138
|
-
|
|
138
|
+
h,
|
|
139
139
|
{
|
|
140
|
-
className:
|
|
140
|
+
className: s.selectValue,
|
|
141
141
|
"data-disabled": t || void 0,
|
|
142
|
-
children: ({ selectedText:
|
|
142
|
+
children: ({ selectedText: r, defaultChildren: a }) => /* @__PURE__ */ e("div", { className: s.placeholder, children: /* @__PURE__ */ e("span", { className: s.truncate, children: o === "multiple" && r ? null : r || a }) })
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
145
|
/* @__PURE__ */ e(
|
|
@@ -154,36 +154,36 @@ import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Sel
|
|
|
154
154
|
}
|
|
155
155
|
);
|
|
156
156
|
};
|
|
157
|
-
function
|
|
157
|
+
function ve({
|
|
158
158
|
children: t,
|
|
159
|
-
description:
|
|
160
|
-
errorMessage:
|
|
159
|
+
description: o,
|
|
160
|
+
errorMessage: c,
|
|
161
161
|
errorPosition: l = "top",
|
|
162
|
-
items:
|
|
163
|
-
label:
|
|
164
|
-
popover:
|
|
165
|
-
size:
|
|
162
|
+
items: r,
|
|
163
|
+
label: a,
|
|
164
|
+
popover: S,
|
|
165
|
+
size: v = "large",
|
|
166
166
|
...n
|
|
167
167
|
}) {
|
|
168
|
-
return /* @__PURE__ */ e(
|
|
169
|
-
|
|
168
|
+
return /* @__PURE__ */ e(x, { children: /* @__PURE__ */ i(
|
|
169
|
+
C,
|
|
170
170
|
{
|
|
171
171
|
...n,
|
|
172
|
-
className: T(n.className,
|
|
172
|
+
className: T(n.className, s.select),
|
|
173
173
|
children: [
|
|
174
|
-
/* @__PURE__ */ e(N, { popover:
|
|
175
|
-
|
|
176
|
-
l === "top" && /* @__PURE__ */ e(g, { children:
|
|
174
|
+
/* @__PURE__ */ e(N, { popover: S, children: a && /* @__PURE__ */ e(b, { "data-disabled": n.isDisabled || void 0, children: a }) }),
|
|
175
|
+
o && /* @__PURE__ */ e(B, { slot: "description", children: o }),
|
|
176
|
+
l === "top" && /* @__PURE__ */ e(g, { children: c }),
|
|
177
177
|
/* @__PURE__ */ i(
|
|
178
178
|
"div",
|
|
179
179
|
{
|
|
180
|
-
className:
|
|
180
|
+
className: s.triggerContainer,
|
|
181
181
|
"data-disabled": n.isDisabled || void 0,
|
|
182
182
|
children: [
|
|
183
183
|
/* @__PURE__ */ e(
|
|
184
184
|
le,
|
|
185
185
|
{
|
|
186
|
-
size:
|
|
186
|
+
size: v,
|
|
187
187
|
...n
|
|
188
188
|
}
|
|
189
189
|
),
|
|
@@ -191,11 +191,11 @@ function xe({
|
|
|
191
191
|
]
|
|
192
192
|
}
|
|
193
193
|
),
|
|
194
|
-
l === "bottom" && /* @__PURE__ */ e(g, { children:
|
|
194
|
+
l === "bottom" && /* @__PURE__ */ e(g, { children: c }),
|
|
195
195
|
/* @__PURE__ */ i(
|
|
196
196
|
G,
|
|
197
197
|
{
|
|
198
|
-
className:
|
|
198
|
+
className: s.popover,
|
|
199
199
|
offset: 0,
|
|
200
200
|
hideArrow: !0,
|
|
201
201
|
children: [
|
|
@@ -204,7 +204,7 @@ function xe({
|
|
|
204
204
|
I,
|
|
205
205
|
{
|
|
206
206
|
escapeKeyBehavior: "none",
|
|
207
|
-
items:
|
|
207
|
+
items: r,
|
|
208
208
|
children: t
|
|
209
209
|
}
|
|
210
210
|
)
|
|
@@ -217,5 +217,5 @@ function xe({
|
|
|
217
217
|
) });
|
|
218
218
|
}
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
ve as S
|
|
221
221
|
};
|