asma-ui-core 3.126.0 → 3.126.2

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.
@@ -2,145 +2,145 @@ import { fieldLabelAboveClass as R, fieldWidthStyle as le } from "../../../../co
2
2
  import { StyledInputField as oe } from "../../../../components/inputs/input-field/StyledInputField.js";
3
3
  import { getValue as b } from "../helpers.js";
4
4
  import { DatePickerButton as ie } from "./DatePickerButton.js";
5
- import { getTitleLabelling as de } from "../../../helpers/getTitleLabelling.js";
6
- import { DATE_INPUT_FONT_FAMILY as se } from "../../../../helpers/inputMask.js";
5
+ import { getTitleLabelling as se } from "../../../helpers/getTitleLabelling.js";
6
+ import { DATE_INPUT_FONT_FAMILY as de } from "../../../../helpers/inputMask.js";
7
7
  import { useDatePickerMask as ne } from "../hooks/useDatePickerMask.js";
8
- import { defaultDatePickerValidationMessages as ce, useDatePickerValidation as ue } from "../hooks/useDatePickerValidation.js";
8
+ import { defaultDatePickerValidationMessages as ce, useDatePickerValidation as me } from "../hooks/useDatePickerValidation.js";
9
9
  import { useEffect as A, useId as E, useRef as pe, useState as H } from "react";
10
- import { jsx as a, jsxs as T } from "react/jsx-runtime";
11
- import { isValid as me, parse as fe } from "date-fns";
12
- var ke = (Y) => {
13
- const { onClick: L, inputClassName: S, dateFormat: r, selected: e, error: _, helperText: j, errorText: q, onInputChange: C, hideCalendar: W, locale: l, disabledDays: s, label: h, title: v, inputAriaProps: z, readOnly: U, lockedReason: y, readOnlyReason: g, disallowPast: n, disallowFuture: c, validateOnCalendarClose: N, onValidatedOnce: P, hideDefaultHelperText: G, reserveHelperText: J, required: o, minDate: u, width: k = "s", ...p } = Y, i = !!U || !!y || !!g, M = !y && !!g, { validationError: K, handleValidation: m, errHelperText: Q, clearValidation: w } = ue(ce), { maskRef: X } = ne(), I = E(), V = E(), [t, B] = H(e ? b(e, r) : ""), D = pe(!1), [F, Z] = H({
10
+ import { jsx as r, jsxs as T } from "react/jsx-runtime";
11
+ import { isValid as ue, parse as fe } from "date-fns";
12
+ var Pe = (Y) => {
13
+ const { onClick: L, inputClassName: S, dateFormat: l, selected: e, error: _, helperText: j, errorText: q, onInputChange: C, hideCalendar: W, locale: o, disabledDays: d, label: h, title: x, inputAriaProps: z, readOnly: U, lockedReason: v, readOnlyReason: y, disallowPast: n, disallowFuture: c, validateOnCalendarClose: N, onValidatedOnce: w, hideDefaultHelperText: G, reserveHelperText: J, required: i, minDate: m, width: P = "s", ...p } = Y, a = !!U || !!v || !!y, k = !v && !!y, { validationError: K, handleValidation: u, errHelperText: Q, clearValidation: M } = me(ce), { maskRef: X } = ne(), I = E(), V = E(), [t, B] = H(e ? b(e, l) : ""), g = pe(!1), [F, Z] = H({
14
14
  selected: e,
15
- dateFormat: r
15
+ dateFormat: l
16
16
  });
17
- (e !== F.selected || r !== F.dateFormat) && (Z({
17
+ (e !== F.selected || l !== F.dateFormat) && (Z({
18
18
  selected: e,
19
- dateFormat: r
20
- }), B(e ? b(e, r) : ""));
21
- const $ = l?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", ee = G ? void 0 : $, O = !!(K || _), d = O ? q ?? Q : j ?? ee;
19
+ dateFormat: l
20
+ }), B(e ? b(e, l) : ""));
21
+ const $ = o?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", ee = G ? void 0 : $, O = !!(K || _), s = O ? q ?? Q : j ?? ee;
22
22
  A(() => {
23
23
  if (!e) {
24
- D.current || w(), D.current = !1;
24
+ g.current || M(), g.current = !1;
25
25
  return;
26
26
  }
27
- m({
28
- value: b(e, r),
29
- disabledDays: s,
30
- localeCode: l?.code,
27
+ u({
28
+ value: b(e, l),
29
+ disabledDays: d,
30
+ localeCode: o?.code,
31
31
  disallowPast: n,
32
32
  disallowFuture: c,
33
- required: o,
34
- minDate: u
33
+ required: i,
34
+ minDate: m
35
35
  });
36
36
  }, [
37
37
  e,
38
- r,
39
- s,
40
- l?.code,
38
+ l,
39
+ d,
40
+ o?.code,
41
41
  n,
42
42
  c,
43
- o,
44
- u,
43
+ i,
45
44
  m,
46
- w
45
+ u,
46
+ M
47
47
  ]);
48
- const te = /\d/.test(t), ae = (x) => {
49
- const f = x.target.value;
48
+ const ae = /\d/.test(t), te = (D) => {
49
+ const f = D.target.value;
50
50
  B(f.replace(/\D/g, "").length ? f : "");
51
51
  };
52
52
  A(() => {
53
- N && (m({
53
+ N && (u({
54
54
  value: t,
55
- disabledDays: s,
56
- localeCode: l?.code,
55
+ disabledDays: d,
56
+ localeCode: o?.code,
57
57
  disallowPast: n,
58
58
  disallowFuture: c,
59
- required: o,
60
- minDate: u
61
- }), P?.());
59
+ required: i,
60
+ minDate: m
61
+ }), w?.());
62
62
  }, [
63
63
  N,
64
64
  t,
65
- s,
66
- l?.code,
65
+ d,
66
+ o?.code,
67
67
  n,
68
68
  c,
69
- o,
70
- u,
71
- P,
72
- m
69
+ i,
70
+ m,
71
+ w,
72
+ u
73
73
  ]);
74
74
  const re = () => {
75
- const x = m({
75
+ const D = u({
76
76
  value: t,
77
- disabledDays: s,
78
- localeCode: l?.code,
77
+ disabledDays: d,
78
+ localeCode: o?.code,
79
79
  disallowPast: n,
80
80
  disallowFuture: c,
81
- required: o,
82
- minDate: u
81
+ required: i,
82
+ minDate: m
83
83
  });
84
84
  if (!t.replace(/\D/g, "").length) {
85
- D.current = !!e, C?.(void 0);
85
+ g.current = !!e, C?.(void 0);
86
86
  return;
87
87
  }
88
- if (x) return;
88
+ if (D) return;
89
89
  const f = fe(t, "dd/MM/yyyy", /* @__PURE__ */ new Date());
90
- C?.(me(f) ? f : void 0);
90
+ C?.(ue(f) ? f : void 0);
91
91
  };
92
92
  return /* @__PURE__ */ T("div", {
93
93
  className: "cursor-default",
94
- "data-field-width": k,
95
- style: le(k),
94
+ "data-field-width": P,
95
+ style: le(P),
96
96
  "data-helper-room-box": "",
97
97
  children: [
98
- v && /* @__PURE__ */ a("div", {
98
+ x && /* @__PURE__ */ r("div", {
99
99
  id: I,
100
100
  className: R({
101
101
  disabled: p.disabled,
102
- flush: M
102
+ flush: k
103
103
  }),
104
- children: v
104
+ children: x
105
105
  }),
106
- h && /* @__PURE__ */ a("div", {
106
+ h && /* @__PURE__ */ r("div", {
107
107
  className: R({
108
108
  disabled: p.disabled,
109
- flush: M
109
+ flush: k
110
110
  }),
111
111
  children: /* @__PURE__ */ T("label", {
112
112
  htmlFor: V,
113
- children: [h, o && /* @__PURE__ */ a("span", {
113
+ children: [h, i && /* @__PURE__ */ r("span", {
114
114
  "aria-hidden": "true",
115
115
  children: " *"
116
116
  })]
117
117
  })
118
118
  }),
119
119
  /* @__PURE__ */ T("div", {
120
- className: "flex items-start gap-1",
121
- children: [/* @__PURE__ */ a("div", {
122
- className: "min-w-0 flex-1",
123
- children: /* @__PURE__ */ a("div", {
120
+ className: "flex items-start gap-1 max-xs:flex-wrap max-xs:gap-y-1",
121
+ children: [/* @__PURE__ */ r("div", {
122
+ className: "min-w-0 flex-1 max-xs:min-w-min",
123
+ children: /* @__PURE__ */ r("div", {
124
124
  className: "relative",
125
- children: /* @__PURE__ */ a(oe, {
125
+ children: /* @__PURE__ */ r(oe, {
126
126
  ...p,
127
127
  id: V,
128
- readOnly: i,
129
- lockedReason: y,
130
- readOnlyReason: g,
128
+ readOnly: a,
129
+ lockedReason: v,
130
+ readOnlyReason: y,
131
131
  "data-testid": p.dataTest,
132
132
  autoComplete: "off",
133
- inputRef: i ? void 0 : X,
134
- placeholder: !i && !te ? " / / " : void 0,
133
+ inputRef: a ? void 0 : X,
134
+ placeholder: !a && !ae ? " / / " : void 0,
135
135
  size: "small",
136
- value: i ? t.replaceAll("/", ".") : t,
136
+ value: a ? t.replaceAll("/", ".") : t,
137
137
  className: S,
138
138
  error: O,
139
- onBlur: i ? void 0 : re,
140
- helperText: d == null || d === "" ? d : /* @__PURE__ */ a("span", {
139
+ onBlur: a ? void 0 : re,
140
+ helperText: s == null || s === "" ? s : /* @__PURE__ */ r("span", {
141
141
  className: "block truncate",
142
- title: typeof d == "string" ? d : void 0,
143
- children: d
142
+ title: typeof s == "string" ? s : void 0,
143
+ children: s
144
144
  }),
145
145
  reserveHelperText: J,
146
146
  slotProps: {
@@ -150,31 +150,32 @@ var ke = (Y) => {
150
150
  marginRight: 0
151
151
  } },
152
152
  htmlInput: {
153
- "aria-required": o ? !0 : void 0,
154
- ...de({
155
- title: v,
153
+ "aria-required": i ? !0 : void 0,
154
+ ...se({
155
+ title: x,
156
156
  titleId: I,
157
157
  label: h,
158
158
  inputAriaProps: z
159
159
  }),
160
- ...i ? {} : {
160
+ ...a ? {} : {
161
161
  inputMode: "numeric",
162
- style: { fontFamily: se }
162
+ style: { fontFamily: de }
163
163
  }
164
- }
164
+ },
165
+ input: a ? void 0 : { className: "max-xs:min-w-[calc(10ch+1rem)] max-xs:px-2" }
165
166
  },
166
- onChange: ae
167
+ onChange: te
167
168
  })
168
169
  })
169
- }), !W && !i && /* @__PURE__ */ a(ie, {
170
+ }), !W && !a && /* @__PURE__ */ r(ie, {
170
171
  onClick: L,
171
172
  disabled: !!p.disabled,
172
- localeCode: l?.code
173
+ localeCode: o?.code
173
174
  })]
174
175
  })
175
176
  ]
176
177
  });
177
178
  };
178
179
  export {
179
- ke as BaseDatePickerInput
180
+ Pe as BaseDatePickerInput
180
181
  };
@@ -2,8 +2,9 @@
2
2
  * The sort indicator slot of a sortable header (Figma "Header with sorting", the 20 × 28 `Sorting` frame).
3
3
  * It is decorative: `aria-sort` on the header cell carries the state. A sorted column always shows the
4
4
  * glyph in the primary colour; an unsorted one shows it, grey and pointing the way the next click will
5
- * sort, only while the header is hovered or keyboard-focused. The glyph is in the DOM either way, so the
6
- * slot never changes the layout.
5
+ * sort, only while the header is hovered or keyboard-focused. The glyph is in the DOM either way; the
6
+ * stylesheet gives the slot its 20px only while the column is sorted, hovered or keyboard-focused (UX, ASMA-8597,
7
+ * comments 94750 and 94751), and collapses it to nothing otherwise.
7
8
  */
8
9
  export declare function SortIndicator({ sorted, nextDirection, }: {
9
10
  sorted: false | 'asc' | 'desc';
@@ -1,62 +1,62 @@
1
- var e = "_tbody_w4q8k_125", _ = "_expanded_row_w4q8k_178", l = "_selected_w4q8k_203", t = "_shadowed_w4q8k_228", a = "_resizer_w4q8k_285", o = "_isResizing_w4q8k_305", r = {
2
- "asma-ui-table-styled-table": "_asma-ui-table-styled-table_w4q8k_1",
3
- "table-wrapper": "_table-wrapper_w4q8k_27",
4
- "table-shell": "_table-shell_w4q8k_34",
5
- "table-wrapper--no-rows": "_table-wrapper--no-rows_w4q8k_40",
6
- "table-wrapper--proxy": "_table-wrapper--proxy_w4q8k_43",
7
- "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_w4q8k_44",
8
- "table-wrapper-fetching": "_table-wrapper-fetching_w4q8k_54",
9
- "table-scroll": "_table-scroll_w4q8k_57",
10
- "table-x--fill-height": "_table-x--fill-height_w4q8k_66",
11
- "table-x": "_table-x_w4q8k_66",
12
- "table-content": "_table-content_w4q8k_81",
13
- "table-header--sticky": "_table-header--sticky_w4q8k_86",
14
- "table-hscroll": "_table-hscroll_w4q8k_91",
15
- "table-hscroll__content": "_table-hscroll__content_w4q8k_101",
16
- "no-rows-overlay-container": "_no-rows-overlay-container_w4q8k_104",
17
- "no-rows-overlay-content": "_no-rows-overlay-content_w4q8k_112",
18
- "styled-table": "_styled-table_w4q8k_116",
1
+ var e = "_tbody_zh7v2_125", _ = "_expanded_row_zh7v2_178", l = "_selected_zh7v2_203", t = "_shadowed_zh7v2_228", a = "_resizer_zh7v2_285", o = "_isResizing_zh7v2_305", r = {
2
+ "asma-ui-table-styled-table": "_asma-ui-table-styled-table_zh7v2_1",
3
+ "table-wrapper": "_table-wrapper_zh7v2_27",
4
+ "table-shell": "_table-shell_zh7v2_34",
5
+ "table-wrapper--no-rows": "_table-wrapper--no-rows_zh7v2_40",
6
+ "table-wrapper--proxy": "_table-wrapper--proxy_zh7v2_43",
7
+ "table-wrapper--proxy-bottom": "_table-wrapper--proxy-bottom_zh7v2_44",
8
+ "table-wrapper-fetching": "_table-wrapper-fetching_zh7v2_54",
9
+ "table-scroll": "_table-scroll_zh7v2_57",
10
+ "table-x--fill-height": "_table-x--fill-height_zh7v2_66",
11
+ "table-x": "_table-x_zh7v2_66",
12
+ "table-content": "_table-content_zh7v2_81",
13
+ "table-header--sticky": "_table-header--sticky_zh7v2_86",
14
+ "table-hscroll": "_table-hscroll_zh7v2_91",
15
+ "table-hscroll__content": "_table-hscroll__content_zh7v2_101",
16
+ "no-rows-overlay-container": "_no-rows-overlay-container_zh7v2_104",
17
+ "no-rows-overlay-content": "_no-rows-overlay-content_zh7v2_112",
18
+ "styled-table": "_styled-table_zh7v2_116",
19
19
  tbody: e,
20
- "loading-icon": "_loading-icon_w4q8k_130",
21
- "t-row": "_t-row_w4q8k_137",
22
- "t-cell": "_t-cell_w4q8k_137",
23
- "action-cell": "_action-cell_w4q8k_150",
24
- "fixed-cell": "_fixed-cell_w4q8k_154",
25
- "fixed-right-cell": "_fixed-right-cell_w4q8k_157",
20
+ "loading-icon": "_loading-icon_zh7v2_130",
21
+ "t-row": "_t-row_zh7v2_137",
22
+ "t-cell": "_t-cell_zh7v2_137",
23
+ "action-cell": "_action-cell_zh7v2_150",
24
+ "fixed-cell": "_fixed-cell_zh7v2_154",
25
+ "fixed-right-cell": "_fixed-right-cell_zh7v2_157",
26
26
  expanded_row: _,
27
- "data-cell": "_data-cell_w4q8k_190",
28
- "select-cell": "_select-cell_w4q8k_200",
27
+ "data-cell": "_data-cell_zh7v2_190",
28
+ "select-cell": "_select-cell_zh7v2_200",
29
29
  selected: l,
30
- "single-selection": "_single-selection_w4q8k_206",
31
- "action-cell--no-shadow": "_action-cell--no-shadow_w4q8k_224",
30
+ "single-selection": "_single-selection_zh7v2_206",
31
+ "action-cell--no-shadow": "_action-cell--no-shadow_zh7v2_224",
32
32
  shadowed: t,
33
- "shadowed-right": "_shadowed-right_w4q8k_264",
34
- "is-loading": "_is-loading_w4q8k_269",
35
- "action-cell-default-background": "_action-cell-default-background_w4q8k_272",
36
- "fixed-cell-default-background": "_fixed-cell-default-background_w4q8k_275",
37
- "fixed-right-cell-default-background": "_fixed-right-cell-default-background_w4q8k_278",
38
- "sortable-column": "_sortable-column_w4q8k_281",
33
+ "shadowed-right": "_shadowed-right_zh7v2_264",
34
+ "is-loading": "_is-loading_zh7v2_269",
35
+ "action-cell-default-background": "_action-cell-default-background_zh7v2_272",
36
+ "fixed-cell-default-background": "_fixed-cell-default-background_zh7v2_275",
37
+ "fixed-right-cell-default-background": "_fixed-right-cell-default-background_zh7v2_278",
38
+ "sortable-column": "_sortable-column_zh7v2_281",
39
39
  resizer: a,
40
40
  isResizing: o,
41
- "hide-table-header": "_hide-table-header_w4q8k_319",
42
- "show-table-header": "_show-table-header_w4q8k_323",
43
- "table-header": "_table-header_w4q8k_86",
44
- "has-resize-zone": "_has-resize-zone_w4q8k_366",
45
- "hide-header": "_hide-header_w4q8k_369",
46
- "t-cell__actions": "_t-cell__actions_w4q8k_372",
47
- "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_w4q8k_381",
48
- "t-cell__fixed": "_t-cell__fixed_w4q8k_386",
49
- "t-cell__fixed-right": "_t-cell__fixed-right_w4q8k_394",
50
- "sort-indicator": "_sort-indicator_w4q8k_402",
51
- "sort-glyph": "_sort-glyph_w4q8k_411",
52
- "sort-indicator--sorted": "_sort-indicator--sorted_w4q8k_415",
53
- "header-content": "_header-content_w4q8k_429",
54
- "table-footer--sticky": "_table-footer--sticky_w4q8k_473",
55
- "table-footer--inline": "_table-footer--inline_w4q8k_484",
56
- "table-bottom": "_table-bottom_w4q8k_495",
57
- "table-bottom--sticky": "_table-bottom--sticky_w4q8k_509",
58
- "cursor-not-allowed": "_cursor-not-allowed_w4q8k_513",
59
- "select-control": "_select-control_w4q8k_517"
41
+ "hide-table-header": "_hide-table-header_zh7v2_319",
42
+ "show-table-header": "_show-table-header_zh7v2_323",
43
+ "table-header": "_table-header_zh7v2_86",
44
+ "has-resize-zone": "_has-resize-zone_zh7v2_366",
45
+ "hide-header": "_hide-header_zh7v2_369",
46
+ "t-cell__actions": "_t-cell__actions_zh7v2_372",
47
+ "t-cell__actions--no-shadow": "_t-cell__actions--no-shadow_zh7v2_381",
48
+ "t-cell__fixed": "_t-cell__fixed_zh7v2_386",
49
+ "t-cell__fixed-right": "_t-cell__fixed-right_zh7v2_394",
50
+ "sort-indicator": "_sort-indicator_zh7v2_402",
51
+ "sort-glyph": "_sort-glyph_zh7v2_412",
52
+ "sort-indicator--sorted": "_sort-indicator--sorted_zh7v2_416",
53
+ "header-content": "_header-content_zh7v2_447",
54
+ "table-footer--sticky": "_table-footer--sticky_zh7v2_491",
55
+ "table-footer--inline": "_table-footer--inline_zh7v2_502",
56
+ "table-bottom": "_table-bottom_zh7v2_513",
57
+ "table-bottom--sticky": "_table-bottom--sticky_zh7v2_527",
58
+ "cursor-not-allowed": "_cursor-not-allowed_zh7v2_531",
59
+ "select-control": "_select-control_zh7v2_535"
60
60
  };
61
61
  export {
62
62
  r as default
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.126.0",
6
+ "version": "3.126.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",