@telefonica/mistica 14.41.0 → 14.42.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 (137) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/boxed.css-mistica.js +14 -5
  3. package/dist/boxed.css.d.ts +1 -0
  4. package/dist/boxed.d.ts +1 -0
  5. package/dist/boxed.js +11 -9
  6. package/dist/button-fixed-footer-layout.d.ts +1 -0
  7. package/dist/button-fixed-footer-layout.js +19 -14
  8. package/dist/button-layout.css-mistica.js +16 -13
  9. package/dist/button-layout.css.d.ts +1 -0
  10. package/dist/button-layout.js +15 -15
  11. package/dist/button.js +43 -35
  12. package/dist/carousel.d.ts +13 -0
  13. package/dist/carousel.js +325 -223
  14. package/dist/credit-card-expiration-field.js +30 -26
  15. package/dist/credit-card-number-field.css-mistica.js +7 -7
  16. package/dist/credit-card-number-field.js +59 -45
  17. package/dist/cvv-field.js +46 -41
  18. package/dist/date-field.css-mistica.js +14 -0
  19. package/dist/date-field.css.d.ts +1 -0
  20. package/dist/date-field.css.ts.vanilla.css-mistica.js +11 -0
  21. package/dist/date-field.js +41 -35
  22. package/dist/date-time-field.js +40 -34
  23. package/dist/date-time-picker.js +43 -45
  24. package/dist/decimal-field.js +26 -22
  25. package/dist/dialog-context.d.ts +24 -0
  26. package/dist/dialog-context.js +192 -0
  27. package/dist/dialog.css-mistica.js +15 -12
  28. package/dist/dialog.css.d.ts +1 -0
  29. package/dist/dialog.d.ts +14 -44
  30. package/dist/dialog.js +161 -245
  31. package/dist/double-field.css-mistica.js +3 -2
  32. package/dist/email-field.js +15 -11
  33. package/dist/feedback.css-mistica.js +18 -15
  34. package/dist/feedback.css.d.ts +5 -4
  35. package/dist/feedback.js +154 -147
  36. package/dist/fixed-footer-layout.css-mistica.js +1 -1
  37. package/dist/fixed-footer-layout.js +9 -8
  38. package/dist/iban-field.js +31 -27
  39. package/dist/icons/icon-amex.d.ts +1 -1
  40. package/dist/icons/icon-cvv-amex.d.ts +1 -1
  41. package/dist/icons/icon-cvv-visa-mc.d.ts +1 -1
  42. package/dist/icons/icon-mastercard.d.ts +1 -1
  43. package/dist/icons/icon-visa.d.ts +1 -1
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.js +16 -4
  46. package/dist/inline.css-mistica.js +9 -6
  47. package/dist/inline.css.d.ts +1 -1
  48. package/dist/inline.js +9 -9
  49. package/dist/integer-field.js +17 -13
  50. package/dist/loading-bar.css-mistica.js +4 -7
  51. package/dist/loading-bar.css.d.ts +0 -2
  52. package/dist/loading-bar.js +3 -6
  53. package/dist/month-field.js +39 -33
  54. package/dist/package-version.js +1 -1
  55. package/dist/password-field.js +46 -44
  56. package/dist/phone-number-field.js +50 -46
  57. package/dist/pin-field.css-mistica.js +12 -6
  58. package/dist/pin-field.css.d.ts +2 -0
  59. package/dist/pin-field.d.ts +3 -1
  60. package/dist/pin-field.js +129 -95
  61. package/dist/responsive-layout.css-mistica.js +10 -7
  62. package/dist/responsive-layout.css.d.ts +2 -1
  63. package/dist/responsive-layout.d.ts +1 -1
  64. package/dist/responsive-layout.js +20 -17
  65. package/dist/search-field.js +36 -35
  66. package/dist/select.css-mistica.js +16 -15
  67. package/dist/select.css.d.ts +1 -0
  68. package/dist/select.js +138 -143
  69. package/dist/text-field-base.css-mistica.js +45 -21
  70. package/dist/text-field-base.css.d.ts +30 -7
  71. package/dist/text-field-base.d.ts +11 -0
  72. package/dist/text-field-base.js +175 -140
  73. package/dist/text-field-components.css-mistica.js +13 -21
  74. package/dist/text-field-components.css.d.ts +0 -3
  75. package/dist/text-field-components.d.ts +3 -0
  76. package/dist/text-field-components.js +38 -35
  77. package/dist/text-field.js +26 -22
  78. package/dist/theme-context-provider.js +2 -2
  79. package/dist/utils/platform.js +8 -11
  80. package/dist-es/boxed.css-mistica.js +3 -2
  81. package/dist-es/boxed.js +17 -15
  82. package/dist-es/button-fixed-footer-layout.js +29 -24
  83. package/dist-es/button-layout.css-mistica.js +7 -7
  84. package/dist-es/button-layout.js +23 -23
  85. package/dist-es/button.js +65 -57
  86. package/dist-es/carousel.js +373 -280
  87. package/dist-es/credit-card-expiration-field.js +34 -30
  88. package/dist-es/credit-card-number-field.css-mistica.js +4 -4
  89. package/dist-es/credit-card-number-field.js +84 -70
  90. package/dist-es/cvv-field.js +68 -63
  91. package/dist-es/date-field.css-mistica.js +5 -0
  92. package/dist-es/date-field.css.ts.vanilla.css-mistica.js +2 -0
  93. package/dist-es/date-field.js +46 -40
  94. package/dist-es/date-time-field.js +47 -41
  95. package/dist-es/date-time-picker.js +55 -57
  96. package/dist-es/decimal-field.js +31 -27
  97. package/dist-es/dialog-context.js +125 -0
  98. package/dist-es/dialog.css-mistica.js +3 -3
  99. package/dist-es/dialog.js +192 -262
  100. package/dist-es/double-field.css-mistica.js +3 -2
  101. package/dist-es/email-field.js +16 -12
  102. package/dist-es/feedback.css-mistica.js +2 -2
  103. package/dist-es/feedback.js +191 -184
  104. package/dist-es/fixed-footer-layout.css-mistica.js +1 -1
  105. package/dist-es/fixed-footer-layout.js +21 -20
  106. package/dist-es/iban-field.js +42 -38
  107. package/dist-es/index.js +1778 -1778
  108. package/dist-es/inline.css-mistica.js +3 -3
  109. package/dist-es/inline.js +18 -18
  110. package/dist-es/integer-field.js +21 -17
  111. package/dist-es/loading-bar.css-mistica.js +2 -2
  112. package/dist-es/loading-bar.js +10 -13
  113. package/dist-es/month-field.js +47 -41
  114. package/dist-es/package-version.js +1 -1
  115. package/dist-es/password-field.js +54 -52
  116. package/dist-es/phone-number-field.js +53 -49
  117. package/dist-es/pin-field.css-mistica.js +2 -2
  118. package/dist-es/pin-field.js +145 -111
  119. package/dist-es/responsive-layout.css-mistica.js +3 -3
  120. package/dist-es/responsive-layout.js +27 -24
  121. package/dist-es/search-field.js +45 -44
  122. package/dist-es/select.css-mistica.js +8 -7
  123. package/dist-es/select.js +167 -172
  124. package/dist-es/style.css +1 -1
  125. package/dist-es/text-field-base.css-mistica.js +2 -2
  126. package/dist-es/text-field-base.js +189 -157
  127. package/dist-es/text-field-components.css-mistica.js +3 -2
  128. package/dist-es/text-field-components.js +52 -49
  129. package/dist-es/text-field.js +31 -27
  130. package/dist-es/theme-context-provider.js +1 -1
  131. package/dist-es/utils/platform.js +6 -6
  132. package/package.json +1 -1
  133. package/dist/password-field.css-mistica.js +0 -13
  134. package/dist/password-field.css.d.ts +0 -1
  135. package/dist-es/password-field.css-mistica.js +0 -4
  136. /package/dist/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
  137. /package/dist-es/{password-field.css.ts.vanilla.css-mistica.js → boxed.css.ts.vanilla.css-mistica.js} +0 -0
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return K;
9
+ return Y;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -19,6 +19,8 @@ const _iconcalendarregular = /*#__PURE__*/ _interop_require_default(require("./g
19
19
  const _time = require("./utils/time.js");
20
20
  const _hooks = require("./hooks.js");
21
21
  const _platform = require("./utils/platform.js");
22
+ const _datefieldcssmistica = require("./date-field.css-mistica.js");
23
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
22
24
  function _interop_require_default(obj) {
23
25
  return obj && obj.__esModule ? obj : {
24
26
  default: obj
@@ -144,8 +146,8 @@ function _object_without_properties_loose(source, excluded) {
144
146
  }
145
147
  return target;
146
148
  }
147
- const A = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "date-time-picker" */ "./date-time-picker.js")))), B = (_param)=>{
148
- var { disabled: l, error: g, helperText: D, name: y, optional: m, validate: s, onChange: F, onChangeValue: n, onBlur: R, value: S, defaultValue: h, min: o, max: i } = _param, d = _object_without_properties(_param, [
149
+ const E = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "date-time-picker" */ "./date-time-picker.js")))), L = (_param)=>{
150
+ var { disabled: D, error: F, helperText: g, name: S, optional: f, validate: s, onChange: R, onChangeValue: n, onBlur: k, value: y, defaultValue: I, min: i, max: o, dataAttributes: d } = _param, u = _object_without_properties(_param, [
149
151
  "disabled",
150
152
  "error",
151
153
  "helperText",
@@ -158,42 +160,46 @@ const A = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/
158
160
  "value",
159
161
  "defaultValue",
160
162
  "min",
161
- "max"
163
+ "max",
164
+ "dataAttributes"
162
165
  ]);
163
- const k = (e)=>e, I = _react.useMemo(()=>(0, _platform.isFirefox)() ? !1 : (0, _dom.isInputTypeSupported)("date"), []), { texts: T } = (0, _hooks.useTheme)(), f = (e)=>!(o && e && e < (0, _time.getLocalDateString)(o) || i && e && e > (0, _time.getLocalDateString)(i)), u = (0, _formcontext.useFieldProps)({
164
- name: y,
165
- value: S,
166
- defaultValue: h,
167
- processValue: k,
168
- helperText: D,
169
- optional: m,
170
- error: g,
171
- disabled: l,
172
- onBlur: R,
173
- validate: (e, c)=>f(e) ? s == null ? void 0 : s(e, c) : T.formDateOutOfRangeError,
174
- onChange: F,
175
- onChangeValue: (e, c)=>{
176
- f(e) && (n == null || n(e, c));
166
+ const T = (e)=>e, h = _react.useMemo(()=>(0, _platform.isFirefox)() ? !1 : (0, _dom.isInputTypeSupported)("date"), []), { texts: x } = (0, _hooks.useTheme)(), a = (e)=>!(i && e && e < (0, _time.getLocalDateString)(i) || o && e && e > (0, _time.getLocalDateString)(o)), p = (0, _formcontext.useFieldProps)({
167
+ name: S,
168
+ value: y,
169
+ defaultValue: I,
170
+ processValue: T,
171
+ helperText: g,
172
+ optional: f,
173
+ error: F,
174
+ disabled: D,
175
+ onBlur: k,
176
+ validate: (e, m)=>a(e) ? s == null ? void 0 : s(e, m) : x.formDateOutOfRangeError,
177
+ onChange: R,
178
+ onChangeValue: (e, m)=>{
179
+ a(e) && (n == null || n(e, m));
177
180
  }
178
- }), p = /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, d, u), {
179
- min: o ? (0, _time.getLocalDateString)(o) : void 0,
180
- max: i ? (0, _time.getLocalDateString)(i) : void 0,
181
+ }), l = /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, u, p), {
182
+ min: i ? (0, _time.getLocalDateString)(i) : void 0,
183
+ max: o ? (0, _time.getLocalDateString)(o) : void 0,
181
184
  type: "date",
182
185
  endIconOverlay: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
183
- style: {
184
- position: "absolute",
185
- top: 16,
186
- right: 16,
187
- pointerEvents: "none"
188
- },
189
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcalendarregular.default, {})
190
- })
186
+ className: _datefieldcssmistica.iconContainer,
187
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcalendarregular.default, {
188
+ size: _textfieldbasecssmistica.iconSize
189
+ })
190
+ }),
191
+ dataAttributes: _object_spread({
192
+ "component-name": "DateField"
193
+ }, d)
191
194
  }));
192
- return I || (0, _environment.isServerSide)() ? p : /* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Suspense, {
193
- fallback: p,
194
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(A, _object_spread_props(_object_spread({}, d, u), {
195
- optional: m,
196
- isValidDate: (e)=>f((0, _time.getLocalDateString)(e.toDate()))
195
+ return h || (0, _environment.isServerSide)() ? l : /* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Suspense, {
196
+ fallback: l,
197
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(E, _object_spread_props(_object_spread({}, u, p), {
198
+ optional: f,
199
+ isValidDate: (e)=>a((0, _time.getLocalDateString)(e.toDate())),
200
+ dataAttributes: _object_spread({
201
+ "component-name": "DateField"
202
+ }, d)
197
203
  }))
198
204
  });
199
- }, K = B;
205
+ }, Y = L;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return K;
9
+ return Y;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -19,6 +19,8 @@ const _time = require("./utils/time.js");
19
19
  const _iconcalendarregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-calendar-regular.js"));
20
20
  const _platform = require("./utils/platform.js");
21
21
  const _hooks = require("./hooks.js");
22
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
23
+ const _datefieldcssmistica = require("./date-field.css-mistica.js");
22
24
  function _interop_require_default(obj) {
23
25
  return obj && obj.__esModule ? obj : {
24
26
  default: obj
@@ -144,12 +146,12 @@ function _object_without_properties_loose(source, excluded) {
144
146
  }
145
147
  return target;
146
148
  }
147
- const j = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "date-time-picker" */ "./date-time-picker.js")))), z = (_param)=>{
148
- var { disabled: T, error: g, helperText: F, name: h, optional: f, validate: n, onChange: y, onChangeValue: a, onBlur: R, value: S, defaultValue: k, min: i, /**
149
+ const B = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require(/* webpackChunkName: "date-time-picker" */ "./date-time-picker.js")))), C = (_param)=>{
150
+ var { disabled: F, error: g, helperText: S, name: R, optional: f, validate: n, onChange: h, onChangeValue: m, onBlur: k, value: y, defaultValue: I, min: o, /**
149
151
  * When typing a datetime value into the input field (inside a test for example), some browsers like Chrome
150
152
  * force the year to have exactly 6 digits. In order to prevent this, in case max value was not provided we
151
153
  * set it so that it only accepts datetime values with years having up to 4 digits.
152
- */ max: s = /* @__PURE__ */ new Date("9999-12-31T23:59") } = _param, l = _object_without_properties(_param, [
154
+ */ max: s = /* @__PURE__ */ new Date("9999-12-31T23:59"), dataAttributes: l } = _param, u = _object_without_properties(_param, [
153
155
  "disabled",
154
156
  "error",
155
157
  "helperText",
@@ -162,46 +164,50 @@ const j = /*#__PURE__*/ _react.lazy(()=>Promise.resolve().then(()=>/*#__PURE__*/
162
164
  "value",
163
165
  "defaultValue",
164
166
  "min",
165
- "max"
167
+ "max",
168
+ "dataAttributes"
166
169
  ]);
167
- const u = _react.useMemo(()=>(0, _platform.isFirefox)() ? !1 : (0, _dom.isInputTypeSupported)("datetime-local"), []), d = (e)=>u ? e : e.replace(/\s/, "T"), { texts: v } = (0, _hooks.useTheme)(), c = (e)=>{
168
- const t = d(e);
169
- return !(i && t && t < (0, _time.getLocalDateTimeString)(i) || s && t && t > (0, _time.getLocalDateTimeString)(s));
170
- }, p = (0, _formcontext.useFieldProps)({
171
- name: h,
172
- value: S,
173
- defaultValue: k,
174
- processValue: d,
175
- helperText: F,
170
+ const d = _react.useMemo(()=>(0, _platform.isFirefox)() ? !1 : (0, _dom.isInputTypeSupported)("datetime-local"), []), p = (e)=>d ? e : e.replace(/\s/, "T"), { texts: v } = (0, _hooks.useTheme)(), a = (e)=>{
171
+ const t = p(e);
172
+ return !(o && t && t < (0, _time.getLocalDateTimeString)(o) || s && t && t > (0, _time.getLocalDateTimeString)(s));
173
+ }, D = (0, _formcontext.useFieldProps)({
174
+ name: R,
175
+ value: y,
176
+ defaultValue: I,
177
+ processValue: p,
178
+ helperText: S,
176
179
  optional: f,
177
180
  error: g,
178
- disabled: T,
179
- onBlur: R,
180
- validate: (e, t)=>c(e) ? n == null ? void 0 : n(e, t) : v.formDateOutOfRangeError,
181
- onChange: y,
181
+ disabled: F,
182
+ onBlur: k,
183
+ validate: (e, t)=>a(e) ? n == null ? void 0 : n(e, t) : v.formDateOutOfRangeError,
184
+ onChange: h,
182
185
  onChangeValue: (e, t)=>{
183
- c(e) && (a == null || a(e, t));
186
+ a(e) && (m == null || m(e, t));
184
187
  }
185
- }), D = /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, l, p), {
186
- min: i ? (0, _time.getLocalDateTimeString)(i) : void 0,
188
+ }), T = /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, u, D), {
189
+ min: o ? (0, _time.getLocalDateTimeString)(o) : void 0,
187
190
  max: s ? (0, _time.getLocalDateTimeString)(s) : void 0,
188
191
  type: "datetime-local",
189
192
  endIconOverlay: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
190
- style: {
191
- position: "absolute",
192
- top: 16,
193
- right: 16,
194
- pointerEvents: "none"
195
- },
196
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcalendarregular.default, {})
197
- })
193
+ className: _datefieldcssmistica.iconContainer,
194
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcalendarregular.default, {
195
+ size: _textfieldbasecssmistica.iconSize
196
+ })
197
+ }),
198
+ dataAttributes: _object_spread({
199
+ "component-name": "DateTimeField"
200
+ }, l)
198
201
  }));
199
- return u || (0, _environment.isServerSide)() ? D : /* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Suspense, {
200
- fallback: D,
201
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(j, _object_spread_props(_object_spread({}, l, p), {
202
+ return d || (0, _environment.isServerSide)() ? T : /* @__PURE__ */ (0, _jsxruntime.jsx)(_react.Suspense, {
203
+ fallback: T,
204
+ children: /* @__PURE__ */ (0, _jsxruntime.jsx)(B, _object_spread_props(_object_spread({}, u, D), {
202
205
  optional: f,
203
206
  withTime: !0,
204
- isValidDate: (e)=>c((0, _time.getLocalDateTimeString)(e.toDate()))
207
+ isValidDate: (e)=>a((0, _time.getLocalDateTimeString)(e.toDate())),
208
+ dataAttributes: _object_spread({
209
+ "component-name": "DateTimeField"
210
+ }, l)
205
211
  }))
206
212
  });
207
- }, K = z;
213
+ }, Y = C;
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  Object.defineProperty(exports, "default", {
7
7
  enumerable: true,
8
8
  get: function() {
9
- return ie;
9
+ return ae;
10
10
  }
11
11
  });
12
12
  const _jsxruntime = require("react/jsx-runtime");
@@ -16,7 +16,6 @@ const _iconcalendarregular = /*#__PURE__*/ _interop_require_default(require("./g
16
16
  const _reactdatetime = /*#__PURE__*/ _interop_require_default(require("react-datetime"));
17
17
  const _overlay = /*#__PURE__*/ _interop_require_default(require("./overlay.js"));
18
18
  const _textfieldcomponentscssmistica = require("./text-field-components.css-mistica.js");
19
- const _iconbutton = /*#__PURE__*/ _interop_require_default(require("./icon-button.js"));
20
19
  const _dom = require("./utils/dom.js");
21
20
  const _hooks = require("./hooks.js");
22
21
  const _iconcloseregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-close-regular.js"));
@@ -26,6 +25,7 @@ require("moment/locale/es");
26
25
  require("moment/locale/de");
27
26
  require("moment/locale/pt-br");
28
27
  require("moment/locale/en-gb");
28
+ const _textfieldbasecssmistica = require("./text-field-base.css-mistica.js");
29
29
  function _interop_require_default(obj) {
30
30
  return obj && obj.__esModule ? obj : {
31
31
  default: obj
@@ -151,7 +151,7 @@ function _object_without_properties_loose(source, excluded) {
151
151
  }
152
152
  return target;
153
153
  }
154
- const A = {
154
+ const O = {
155
155
  es: "es",
156
156
  // spanish
157
157
  ca: "es",
@@ -165,91 +165,89 @@ const A = {
165
165
  pt: "pt-br",
166
166
  // portuguese
167
167
  en: "en-gb"
168
- }, O = (a)=>{
168
+ }, q = (a)=>{
169
169
  const i = a.toLocaleLowerCase().split("-")[0];
170
- return A[i] || "en-gb";
171
- }, ie = (_param)=>{
172
- var { withTime: a, mode: i, isValidDate: h, optional: u } = _param, t = _object_without_properties(_param, [
170
+ return O[i] || "en-gb";
171
+ }, ae = (_param)=>{
172
+ var { withTime: a, mode: i, isValidDate: y, optional: m } = _param, o = _object_without_properties(_param, [
173
173
  "withTime",
174
174
  "mode",
175
175
  "isValidDate",
176
176
  "optional"
177
177
  ]);
178
- const [m, y] = _react.useState(!1), { texts: x, i18n: { locale: b } } = (0, _hooks.useTheme)(), n = _react.useRef(null), { height: k, ref: v } = (0, _hooks.useElementDimensions)(), l = (e)=>{
179
- t.disabled || y(e);
180
- }, C = ()=>{
178
+ const [u, x] = _react.useState(!1), { texts: b, i18n: { locale: k } } = (0, _hooks.useTheme)(), r = _react.useRef(null), { height: v, ref: C } = (0, _hooks.useElementDimensions)(), c = (e)=>{
179
+ o.disabled || x(e);
180
+ }, D = ()=>{
181
181
  var f;
182
- const { top: e = 0, bottom: o = 0, left: c = 0 } = ((f = n.current) == null ? void 0 : f.getBoundingClientRect()) || {}, M = 260 + o < window.innerHeight;
182
+ const { top: e = 0, bottom: t = 0, left: l = 0 } = ((f = r.current) == null ? void 0 : f.getBoundingClientRect()) || {}, P = 260 + t < window.innerHeight;
183
183
  return {
184
184
  width: _textfieldcomponentscssmistica.DEFAULT_WIDTH,
185
- top: M ? o : e - k,
186
- left: c,
185
+ top: P ? t : e - v,
186
+ left: l,
187
187
  position: "absolute",
188
188
  borderRadius: _skincontractcssmistica.vars.borderRadii.input,
189
189
  overflow: "hidden",
190
190
  boxShadow: "0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)"
191
191
  };
192
192
  }, s = ()=>{
193
- var o;
194
- const e = (o = n.current) == null ? void 0 : o.value;
193
+ var t;
194
+ const e = (t = r.current) == null ? void 0 : t.value;
195
195
  return e ? new Date(e) : void 0;
196
- }, D = (e)=>a ? e.format("yyyy-MM-DD HH:mm") : i === "year-month" ? e.format("yyyy-MM") : e.format("yyyy-MM-DD"), p = (e)=>{
197
- var c;
198
- const o = typeof e == "string" ? e : D(e);
199
- n.current && (n.current.focus(), (c = t.onChange) == null || c.call(t, (0, _dom.createChangeEvent)(n.current, o)));
200
- }, w = ()=>s() && u ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.default, {
201
- "aria-label": x.clearButton,
202
- size: 32,
203
- onPress: ()=>{
204
- p("");
205
- },
206
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcloseregular.default, {})
207
- }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconbutton.default, {
208
- disabled: t.disabled,
196
+ }, w = (e)=>a ? e.format("yyyy-MM-DD HH:mm") : i === "year-month" ? e.format("yyyy-MM") : e.format("yyyy-MM-DD"), p = (e)=>{
197
+ var l;
198
+ const t = typeof e == "string" ? e : w(e);
199
+ r.current && (r.current.focus(), (l = o.onChange) == null || l.call(o, (0, _dom.createChangeEvent)(r.current, t)));
200
+ }, M = ()=>s() && m ? /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.FieldEndIcon, {
201
+ Icon: _iconcloseregular.default,
202
+ "aria-label": b.clearButton,
203
+ className: _textfieldbasecssmistica.endIcon,
204
+ onPress: ()=>p("")
205
+ }) : /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.FieldEndIcon, {
206
+ Icon: _iconcalendarregular.default,
209
207
  "aria-label": "",
210
- size: 32,
211
- onPress: ()=>l(!m),
212
- children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconcalendarregular.default, {})
208
+ disabled: o.disabled,
209
+ className: _textfieldbasecssmistica.endIcon,
210
+ onPress: ()=>c(!u)
213
211
  });
214
212
  return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
215
213
  children: [
216
- /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, t), {
214
+ /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, o), {
217
215
  style: {
218
- cursor: "default"
216
+ cursor: "pointer"
219
217
  },
220
- required: !u,
218
+ required: !m,
221
219
  type: "text",
222
220
  autoComplete: "off",
223
221
  shrinkLabel: !!s(),
224
- endIcon: w(),
222
+ endIcon: M(),
225
223
  inputRef: (e)=>{
226
- var o;
227
- (o = t == null ? void 0 : t.inputRef) == null || o.call(t, e), n.current = e;
224
+ var t;
225
+ (t = o == null ? void 0 : o.inputRef) == null || t.call(o, e), r.current = e;
228
226
  },
229
227
  readOnly: !0,
230
- onKeyDown: ()=>l(!0),
228
+ onKeyDown: ()=>c(!0),
231
229
  onClick: ()=>{
232
- l(!0);
230
+ c(!0);
233
231
  }
234
232
  })),
235
- m && /* @__PURE__ */ (0, _jsxruntime.jsx)(_overlay.default, {
233
+ u && /* @__PURE__ */ (0, _jsxruntime.jsx)(_overlay.default, {
236
234
  onPress: (e)=>{
237
- (0, _dom.cancelEvent)(e), l(!1);
235
+ (0, _dom.cancelEvent)(e), c(!1);
238
236
  },
239
237
  disableScroll: !0,
240
238
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
241
- ref: v,
242
- style: C(),
239
+ ref: C,
240
+ style: D(),
243
241
  className: _datetimepickercssmistica.reactDatePicker,
244
242
  children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_reactdatetime.default, {
245
243
  initialViewMode: i === "year-month" ? "months" : void 0,
246
244
  dateFormat: i === "year-month" ? "YYYY-MM" : void 0,
247
245
  timeFormat: a ? "HH:mm" : !1,
248
246
  initialValue: s(),
249
- locale: O(b),
247
+ locale: q(k),
250
248
  input: !1,
251
249
  onChange: p,
252
- isValidDate: h
250
+ isValidDate: y
253
251
  })
254
252
  })
255
253
  })
@@ -14,7 +14,7 @@ _export(exports, {
14
14
  return E;
15
15
  },
16
16
  default: function() {
17
- return $;
17
+ return q;
18
18
  }
19
19
  });
20
20
  const _jsxruntime = require("react/jsx-runtime");
@@ -145,44 +145,44 @@ function _object_without_properties_loose(source, excluded) {
145
145
  }
146
146
  return target;
147
147
  }
148
- const j = (n)=>{
148
+ const A = (o)=>{
149
149
  try {
150
- return 1.1.toLocaleString(n.replace("_", "-"))[1];
150
+ return 1.1.toLocaleString(o.replace("_", "-"))[1];
151
151
  } catch (e) {
152
152
  return ".";
153
153
  }
154
- }, B = (n, r)=>{
155
- const s = String(n !== null && n !== void 0 ? n : "").replace(/[^.,\d]/g, ""), e = /[.,]/.exec(s), t = s.split(/[.,]/);
154
+ }, B = (o, r)=>{
155
+ const s = String(o !== null && o !== void 0 ? o : "").replace(/[^.,\d]/g, ""), e = /[.,]/.exec(s), t = s.split(/[.,]/);
156
156
  return t.length === 0 ? "" : e && r > 0 ? t.shift() + e[0] + t.join("").slice(0, r) : t[0];
157
157
  }, E = (_param)=>{
158
- var { inputRef: n, value: r, defaultValue: s, onChange: e, maxDecimals: t } = _param, c = _object_without_properties(_param, [
158
+ var { inputRef: o, value: r, defaultValue: s, onChange: e, maxDecimals: t } = _param, c = _object_without_properties(_param, [
159
159
  "inputRef",
160
160
  "value",
161
161
  "defaultValue",
162
162
  "onChange",
163
163
  "maxDecimals"
164
164
  ]);
165
- const { i18n: u } = (0, _hooks.useTheme)(), f = j(u.locale), m = (o)=>String(o !== null && o !== void 0 ? o : "").replace(/[.,]/g, f), [p, d] = _react.useState(s !== null && s !== void 0 ? s : ""), i = _react.useRef(null), l = typeof r < "u", g = l ? r : p, S = _react.useCallback((o)=>{
166
- l || d(o), i.current && (e == null || e((0, _dom.createChangeEvent)(i.current, o)));
165
+ const { i18n: u } = (0, _hooks.useTheme)(), f = A(u.locale), m = (n)=>String(n !== null && n !== void 0 ? n : "").replace(/[.,]/g, f), [p, d] = _react.useState(s !== null && s !== void 0 ? s : ""), i = _react.useRef(null), l = typeof r < "u", g = l ? r : p, h = _react.useCallback((n)=>{
166
+ l || d(n), i.current && (e == null || e((0, _dom.createChangeEvent)(i.current, n)));
167
167
  }, [
168
168
  l,
169
169
  e
170
- ]), h = (0, _rifm.useRifm)({
171
- format: (o)=>B(o, t),
170
+ ]), y = (0, _rifm.useRifm)({
171
+ format: (n)=>B(n, t),
172
172
  replace: m,
173
173
  value: g,
174
- onChange: S,
174
+ onChange: h,
175
175
  accept: /[\d.,]+/g
176
176
  });
177
177
  return /* @__PURE__ */ (0, _jsxruntime.jsx)("input", _object_spread_props(_object_spread({}, c), {
178
178
  type: "text",
179
179
  inputMode: "decimal",
180
- value: h.value,
181
- onChange: h.onChange,
182
- ref: (0, _common.combineRefs)(n, i)
180
+ value: y.value,
181
+ onChange: y.onChange,
182
+ ref: (0, _common.combineRefs)(o, i)
183
183
  }));
184
184
  }, L = (_param)=>{
185
- var { disabled: n, error: r, helperText: s, name: e, optional: t, validate: c, onChange: u, onChangeValue: f, onBlur: m, value: p, defaultValue: d, maxDecimals: i = 1 / 0 } = _param, l = _object_without_properties(_param, [
185
+ var { disabled: o, error: r, helperText: s, name: e, optional: t, validate: c, onChange: u, onChangeValue: f, onBlur: m, value: p, defaultValue: d, maxDecimals: i = 1 / 0, dataAttributes: l } = _param, g = _object_without_properties(_param, [
186
186
  "disabled",
187
187
  "error",
188
188
  "helperText",
@@ -194,9 +194,10 @@ const j = (n)=>{
194
194
  "onBlur",
195
195
  "value",
196
196
  "defaultValue",
197
- "maxDecimals"
197
+ "maxDecimals",
198
+ "dataAttributes"
198
199
  ]);
199
- const { texts: g } = (0, _hooks.useTheme)(), o = (0, _formcontext.useFieldProps)({
200
+ const { texts: h } = (0, _hooks.useTheme)(), D = (0, _formcontext.useFieldProps)({
200
201
  name: e,
201
202
  value: p,
202
203
  defaultValue: d,
@@ -204,16 +205,19 @@ const j = (n)=>{
204
205
  helperText: s,
205
206
  optional: t,
206
207
  error: r,
207
- disabled: n,
208
+ disabled: o,
208
209
  onBlur: m,
209
- validate: (a, V)=>a ? c == null ? void 0 : c(a, V) : t ? "" : g.formFieldErrorIsMandatory,
210
+ validate: (a, F)=>a ? c == null ? void 0 : c(a, F) : t ? "" : h.formFieldErrorIsMandatory,
210
211
  onChange: u,
211
212
  onChangeValue: f
212
213
  });
213
- return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, l, o), {
214
+ return /* @__PURE__ */ (0, _jsxruntime.jsx)(_textfieldbase.TextFieldBaseAutosuggest, _object_spread_props(_object_spread({}, g, D), {
214
215
  inputComponent: E,
215
216
  inputProps: {
216
217
  maxDecimals: i
217
- }
218
+ },
219
+ dataAttributes: _object_spread({
220
+ "component-name": "DecimalField"
221
+ }, l)
218
222
  }));
219
- }, $ = L;
223
+ }, q = L;
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import type { AlertProps, ConfirmProps, ExtendedDialogProps } from './dialog';
3
+ export declare const useDialog: () => {
4
+ alert: (params: AlertProps) => void;
5
+ confirm: (params: ConfirmProps) => void;
6
+ dialog: (params: ExtendedDialogProps) => void;
7
+ };
8
+ /**
9
+ * @deprecated Use useDialog to get this function
10
+ */
11
+ export declare const alert: (params: AlertProps) => void;
12
+ /**
13
+ * @deprecated Use useDialog to get this function
14
+ */
15
+ export declare const confirm: (params: ConfirmProps) => void;
16
+ /**
17
+ * @deprecated Use useDialog to get this function
18
+ */
19
+ export declare const dialog: (params: ExtendedDialogProps) => void;
20
+ type DialogRootProps = {
21
+ children?: React.ReactNode;
22
+ };
23
+ export declare const DialogRoot: ({ children }: DialogRootProps) => JSX.Element;
24
+ export {};