@viasat/beam-web-components 2.73.0 → 2.75.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 (117) hide show
  1. package/Accordion/Accordion.js +3 -3
  2. package/Accordion/AccordionGroup.js +3 -3
  3. package/Accordion/index.js +1 -1
  4. package/Alert/Alert.js +5 -5
  5. package/Avatar/Avatar.js +2 -2
  6. package/Avatar/AvatarGroup.js +2 -2
  7. package/Avatar/index.js +1 -1
  8. package/Badge/Badge.js +2 -2
  9. package/BadgeDot/BadgeDot.js +2 -2
  10. package/Box/Box.js +2 -2
  11. package/Breadcrumbs/Breadcrumbs.js +3 -3
  12. package/Breadcrumbs/BreadcrumbsItem.js +3 -3
  13. package/Breadcrumbs/index.js +1 -1
  14. package/Button/Button.js +2 -2
  15. package/CloseButton/CloseButton.js +2 -2
  16. package/Divider/Divider.js +2 -2
  17. package/EmptyState/EmptyState.js +2 -2
  18. package/HelperText/HelperText.js +3 -3
  19. package/HelperText/index.js +1 -1
  20. package/Icon/Icon.js +2 -2
  21. package/InputChoiceGroup/InputChoiceGroup.js +2 -2
  22. package/Label/Label.js +2 -2
  23. package/Link/Link.js +2 -2
  24. package/List/List.js +2 -2
  25. package/List/ListItem.js +2 -2
  26. package/ProgressBar/ProgressBar.js +2 -2
  27. package/SegmentedControl/SegmentedControl.js +2 -2
  28. package/SegmentedControl/SegmentedControlItem.js +10 -10
  29. package/SegmentedControl/SegmentedControlList.js +2 -2
  30. package/SegmentedControl/SegmentedControlPanel.js +2 -2
  31. package/Spinner/Spinner.js +2 -2
  32. package/Text/Text.js +2 -2
  33. package/TextArea/TextArea.js +5 -5
  34. package/TextField/TextField.js +6 -6
  35. package/Tooltip/Tooltip.js +9 -9
  36. package/chunks/{Accordion.fbo-T2zU.js → Accordion.BF2pHMSP.js} +4 -4
  37. package/chunks/{Avatar.DkegKDfD.js → Avatar.kVWwOxWe.js} +2 -2
  38. package/chunks/{BreadcrumbsItem.kovG2GHz.js → BreadcrumbsItem.BmqxxC44.js} +2 -2
  39. package/chunks/{HelperText.Cc_6DlKP.js → HelperText.3YJvB8x0.js} +5 -5
  40. package/chunks/{register-custom-element.D_kw6JXe.js → classNames.BQclmCHG.js} +29 -34
  41. package/chunks/register-custom-element.DHGKOhmA.js +17 -0
  42. package/custom-elements.json +1428 -1428
  43. package/local/Accordion/Accordion.js +4 -4
  44. package/local/Accordion/AccordionGroup.js +4 -4
  45. package/local/Accordion/index.js +1 -1
  46. package/local/Alert/Alert.js +11 -11
  47. package/local/Avatar/Avatar.js +3 -3
  48. package/local/Avatar/AvatarGroup.js +3 -3
  49. package/local/Avatar/index.js +1 -1
  50. package/local/Badge/Badge.js +2 -2
  51. package/local/BadgeDot/BadgeDot.js +2 -2
  52. package/local/Box/Box.js +2 -2
  53. package/local/Breadcrumbs/Breadcrumbs.js +3 -3
  54. package/local/Breadcrumbs/BreadcrumbsItem.js +3 -3
  55. package/local/Breadcrumbs/index.js +1 -1
  56. package/local/Button/Button.js +3 -3
  57. package/local/CloseButton/CloseButton.js +2 -2
  58. package/local/Divider/Divider.js +7 -7
  59. package/local/EmptyState/EmptyState.js +2 -2
  60. package/local/HelperText/HelperText.js +3 -3
  61. package/local/HelperText/index.js +1 -1
  62. package/local/Icon/Icon.js +2 -2
  63. package/local/InputChoiceGroup/InputChoiceGroup.js +3 -3
  64. package/local/Label/Label.js +2 -2
  65. package/local/Link/Link.js +2 -2
  66. package/local/List/List.js +3 -3
  67. package/local/List/ListItem.js +3 -3
  68. package/local/ProgressBar/ProgressBar.js +2 -2
  69. package/local/SegmentedControl/SegmentedControl.js +3 -3
  70. package/local/SegmentedControl/SegmentedControlItem.js +7 -7
  71. package/local/SegmentedControl/SegmentedControlList.js +2 -2
  72. package/local/SegmentedControl/SegmentedControlPanel.js +2 -2
  73. package/local/Spinner/Spinner.js +2 -2
  74. package/local/Text/Text.js +2 -2
  75. package/local/TextArea/TextArea.js +9 -9
  76. package/local/TextField/TextField.js +7 -7
  77. package/local/Tooltip/Tooltip.js +8 -8
  78. package/local/chunks/{Accordion.QupR4x7N.js → Accordion.DM6Nkgnh.js} +9 -9
  79. package/local/chunks/{Avatar.D0_A6fGG.js → Avatar.BT61pkbV.js} +2 -2
  80. package/local/chunks/{BreadcrumbsItem.Ds7TtgQn.js → BreadcrumbsItem.CsPbcOZ5.js} +2 -2
  81. package/local/chunks/classNames.CARKFDmR.js +106 -0
  82. package/local/chunks/{index.BoeGm2HZ.js → index.CUGawMXL.js} +8 -8
  83. package/local/chunks/register-custom-element.vod7zfGv.js +51 -0
  84. package/local/chunks/{state.Dr3yBpId.js → state.CqiuSzAl.js} +1 -1
  85. package/local/wip/Checkbox/Checkbox.js +2 -2
  86. package/local/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +1 -1
  87. package/local/wip/FileUpload/FileUpload.Button.js +2 -2
  88. package/local/wip/FileUpload/FileUpload.Dropzone.js +3 -3
  89. package/local/wip/FileUpload/FileUpload.List.Item.js +3 -3
  90. package/local/wip/FileUpload/FileUpload.List.js +2 -2
  91. package/local/wip/FileUpload/FileUpload.js +8 -8
  92. package/local/wip/Form/Form.decorator.js +3 -3
  93. package/local/wip/Form/Form.js +183 -161
  94. package/local/wip/NativeSelect/NativeSelect.js +10 -10
  95. package/local/wip/RadioButton/RadioButton.js +2 -2
  96. package/local/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +1 -1
  97. package/local/wip/Switch/Switch.js +2 -2
  98. package/local/wip/Switch/SwitchGroup/SwitchGroup.js +1 -1
  99. package/package.json +6 -6
  100. package/vscode.html-custom-data.json +226 -226
  101. package/wip/Checkbox/Checkbox.js +2 -2
  102. package/wip/Checkbox/CheckboxGroup/CheckboxGroup.js +1 -1
  103. package/wip/FileUpload/FileUpload.Button.js +2 -2
  104. package/wip/FileUpload/FileUpload.Dropzone.js +2 -2
  105. package/wip/FileUpload/FileUpload.List.Item.js +3 -3
  106. package/wip/FileUpload/FileUpload.List.js +2 -2
  107. package/wip/FileUpload/FileUpload.js +12 -12
  108. package/wip/Form/Form.decorator.js +1 -1
  109. package/wip/Form/Form.js +184 -162
  110. package/wip/NativeSelect/NativeSelect.js +9 -9
  111. package/wip/RadioButton/RadioButton.js +2 -2
  112. package/wip/RadioButton/RadioButtonGroup/RadioButtonGroup.js +1 -1
  113. package/wip/Switch/Switch.js +5 -5
  114. package/wip/Switch/SwitchGroup/SwitchGroup.js +1 -1
  115. package/chunks/classNames.m6VYRyOu.js +0 -18
  116. package/local/chunks/classNames.Ciobzb4w.js +0 -30
  117. package/local/chunks/register-custom-element.AOEv8hcs.js +0 -133
@@ -5,10 +5,10 @@ import { createRef as u, ref as g } from "lit/directives/ref.js";
5
5
  import { unsafeSVG as b } from "lit/directives/unsafe-svg.js";
6
6
  import E from "clsx";
7
7
  import { U as _ } from "../../chunks/Upload.B9YEyp7b.js";
8
- import { g as R } from "../../chunks/classNames.m6VYRyOu.js";
8
+ import { g as R } from "../../chunks/classNames.BQclmCHG.js";
9
9
  import { t as S } from "../../chunks/constants.ZIKMMCJH.js";
10
10
  import { f as I } from "../../chunks/fileUpload.module.WyOEuxoP.js";
11
- import { c as U } from "../../chunks/register-custom-element.D_kw6JXe.js";
11
+ import { c as U } from "../../chunks/register-custom-element.DHGKOhmA.js";
12
12
  import { stateLayerStyles as w, stateLayerClassName as P } from "../../StateLayer/StateLayer.js";
13
13
  import { fileUploadContext as k } from "./FileUploadContext.js";
14
14
  import "../../Icon/Icon.js";
@@ -4,12 +4,12 @@ import { property as p } from "lit/decorators.js";
4
4
  import { createRef as _, ref as C } from "lit/directives/ref.js";
5
5
  import { unsafeSVG as y } from "lit/directives/unsafe-svg.js";
6
6
  import M from "clsx";
7
- import { C as R, E as W } from "../../chunks/HelperText.Cc_6DlKP.js";
8
- import { g as D } from "../../chunks/classNames.m6VYRyOu.js";
7
+ import { C as R, E as W } from "../../chunks/HelperText.3YJvB8x0.js";
8
+ import { g as D } from "../../chunks/classNames.BQclmCHG.js";
9
9
  import { t as H, p as U } from "../../chunks/constants.ZIKMMCJH.js";
10
10
  import { f as O } from "../../chunks/fileUpload.module.WyOEuxoP.js";
11
11
  import { a as V, c as k } from "../../chunks/tokens.CTW8Tt94.js";
12
- import { c as A } from "../../chunks/register-custom-element.D_kw6JXe.js";
12
+ import { c as A } from "../../chunks/register-custom-element.DHGKOhmA.js";
13
13
  import { fileUploadListContext as G } from "./FileUploadListContext.js";
14
14
  import "../../Icon/Icon.js";
15
15
  import "../../Tooltip/Tooltip.js";
@@ -2,10 +2,10 @@ import { provide as c, consume as u } from "@lit/context";
2
2
  import { unsafeCSS as x, LitElement as C, html as m } from "lit";
3
3
  import { property as n } from "lit/decorators.js";
4
4
  import v from "clsx";
5
- import { g as b } from "../../chunks/classNames.m6VYRyOu.js";
5
+ import { g as b } from "../../chunks/classNames.BQclmCHG.js";
6
6
  import { t as g } from "../../chunks/constants.ZIKMMCJH.js";
7
7
  import { f as y } from "../../chunks/fileUpload.module.WyOEuxoP.js";
8
- import { c as _ } from "../../chunks/register-custom-element.D_kw6JXe.js";
8
+ import { c as _ } from "../../chunks/register-custom-element.DHGKOhmA.js";
9
9
  import { fileUploadContext as S } from "./FileUploadContext.js";
10
10
  import { fileUploadListContext as $ } from "./FileUploadListContext.js";
11
11
  import "./FileUpload.List.Item.js";
@@ -4,15 +4,15 @@ import { property as c, queryAssignedElements as N, state as P } from "lit/decor
4
4
  import { createRef as Q } from "lit/directives/ref.js";
5
5
  import X from "clsx";
6
6
  import { t as Y } from "../../chunks/constants.ZIKMMCJH.js";
7
- import { g as Z } from "../../chunks/classNames.m6VYRyOu.js";
8
- import { p as ee, e as q, d as z, c as te } from "../../chunks/register-custom-element.D_kw6JXe.js";
9
- import { f as ie } from "../../chunks/fileUpload.module.WyOEuxoP.js";
10
- import { d as re } from "../../chunks/tokens.CTW8Tt94.js";
11
- import { r as se } from "../../chunks/delegate.baxDQosr.js";
7
+ import { p as Z, a as q, g as ee, d as z } from "../../chunks/classNames.BQclmCHG.js";
8
+ import { f as te } from "../../chunks/fileUpload.module.WyOEuxoP.js";
9
+ import { d as ie } from "../../chunks/tokens.CTW8Tt94.js";
10
+ import { r as re } from "../../chunks/delegate.baxDQosr.js";
11
+ import { c as se } from "../../chunks/register-custom-element.DHGKOhmA.js";
12
12
  import { bmFormContext as oe, bmFormInitials as H } from "../Form/Form.context.js";
13
13
  import { FormField as ae } from "../Form/Form.decorator.js";
14
14
  import { fileUploadContext as le } from "./FileUploadContext.js";
15
- import "../../chunks/HelperText.Cc_6DlKP.js";
15
+ import "../../chunks/HelperText.3YJvB8x0.js";
16
16
  import "./FileUpload.Dropzone.js";
17
17
  import "./FileUpload.List.js";
18
18
  var ne = function(e, t) {
@@ -219,7 +219,7 @@ var be = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, j = (e) =>
219
219
  (p = e[n]) && (s = (r ? p(t, i, s) : p(s)) || s);
220
220
  return r && s && be(t, i, s), s;
221
221
  }, we = (e, t, i) => t.has(e) || j("Cannot " + i), o = (e, t, i) => (we(e, t, "read from private field"), i ? i.call(e) : t.get(e)), h = (e, t, i) => t.has(e) ? j("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, i), u, L, A, S, T, W, E, _, I, F, M, R, D, B, U, O;
222
- const { baseClassNamePrefix: Se, classModifierPrefix: g, subElementClassPrefix: w } = Z("file-upload");
222
+ const { baseClassNamePrefix: Se, classModifierPrefix: g, subElementClassPrefix: w } = ee("file-upload");
223
223
  class _e extends CustomEvent {
224
224
  constructor(t, i, r) {
225
225
  super("bm-selected", {
@@ -304,7 +304,7 @@ let a = class extends ae {
304
304
  ctxError: !!this.error,
305
305
  ctxDisabled: o(this, u).call(this)
306
306
  };
307
- const e = this.fluid ? "100%" : this.width ?? re;
307
+ const e = this.fluid ? "100%" : this.width ?? ie;
308
308
  o(this, _).replace(`:host { width: ${e}; }`);
309
309
  }
310
310
  firstUpdated() {
@@ -320,7 +320,7 @@ let a = class extends ae {
320
320
  }
321
321
  updated(e) {
322
322
  const [t] = this._textFieldLabel, [i] = this._textFieldHelperText, { decorate: r } = q(t), { decorate: s } = q(i);
323
- ee(e, ["formContext"]) && this.ctxValueChanged(this.formContext, this.pickerRef) && o(this, F).call(this), s({ disabled: o(this, u).call(this) }), r({
323
+ Z(e, ["formContext"]) && this.ctxValueChanged(this.formContext, this.pickerRef) && o(this, F).call(this), s({ disabled: o(this, u).call(this) }), r({
324
324
  disabled: o(this, u).call(this),
325
325
  required: o(this, A).call(this) && !this.hideRequiredMarker
326
326
  });
@@ -374,8 +374,8 @@ D = /* @__PURE__ */ new WeakMap();
374
374
  B = /* @__PURE__ */ new WeakMap();
375
375
  U = /* @__PURE__ */ new WeakMap();
376
376
  O = /* @__PURE__ */ new WeakMap();
377
- a.styles = J(ie);
378
- se(a);
377
+ a.styles = J(te);
378
+ re(a);
379
379
  l([
380
380
  c({ type: String })
381
381
  ], a.prototype, "accept", 2);
@@ -443,7 +443,7 @@ l([
443
443
  P()
444
444
  ], a.prototype, "_hasFilesListSlot", 2);
445
445
  a = l([
446
- te("bm-file-upload")
446
+ se("bm-file-upload")
447
447
  ], a);
448
448
  export {
449
449
  a as BmFileUpload,
@@ -10,7 +10,7 @@ import { createRef as I } from "lit/directives/ref.js";
10
10
  import { b as S } from "../../chunks/tokens.CTW8Tt94.js";
11
11
  import { bmFormInitials as p, bmFormContext as R } from "./Form.context.js";
12
12
  import { createId as b } from "./Form.utils.js";
13
- import "../../chunks/HelperText.Cc_6DlKP.js";
13
+ import "../../chunks/HelperText.3YJvB8x0.js";
14
14
  var w = Object.defineProperty, l = (e, s, t, i) => {
15
15
  for (var r = void 0, a = e.length - 1, n; a >= 0; a--)
16
16
  (n = e[a]) && (r = n(s, t, r) || r);
package/wip/Form/Form.js CHANGED
@@ -1,14 +1,36 @@
1
- import { provide as z } from "@lit/context";
2
- import { LitElement as L, html as $ } from "lit";
3
- import { property as d, state as W } from "lit/decorators.js";
4
- import { createRef as N, ref as D } from "lit/directives/ref.js";
5
- import { b as S, t as H, c as K } from "../../chunks/register-custom-element.D_kw6JXe.js";
6
- import { bmFormContext as q, bmFormInitials as G } from "./Form.context.js";
7
- const P = async (t, e) => (await Promise.all(
8
- e.map(
1
+ import { provide as V } from "@lit/context";
2
+ import { LitElement as $, html as D } from "lit";
3
+ import { property as d, state as L } from "lit/decorators.js";
4
+ import { createRef as N, ref as H } from "lit/directives/ref.js";
5
+ import { c as K } from "../../chunks/register-custom-element.DHGKOhmA.js";
6
+ import { bmFormContext as T, bmFormInitials as q } from "./Form.context.js";
7
+ const G = 100, P = (e, t, r = G) => {
8
+ const o = /* @__PURE__ */ new Map();
9
+ return Object.assign((...n) => {
10
+ const a = e(...n);
11
+ if (o.has(a)) {
12
+ const c = o.get(a);
13
+ return o.delete(a), o.set(a, c), c;
14
+ }
15
+ const i = t(...n);
16
+ return o.set(a, i), o.size > r && o.delete(o.keys().next().value), i;
17
+ }, { clear: () => o.clear() });
18
+ }, W = (e, t, r) => e * 1e4 + t * 100 + r, S = (e) => W(e.getFullYear(), e.getMonth() + 1, e.getDate());
19
+ P(
20
+ (e) => e,
21
+ (e) => {
22
+ try {
23
+ return new Intl.Locale(e).toString();
24
+ } catch {
25
+ return e.toLowerCase();
26
+ }
27
+ }
28
+ );
29
+ const R = async (e, t) => (await Promise.all(
30
+ t.map(
9
31
  async (o) => {
10
32
  const { validator: s } = o;
11
- return s(t);
33
+ return s(e);
12
34
  }
13
35
  )
14
36
  )).reduce(
@@ -17,31 +39,31 @@ const P = async (t, e) => (await Promise.all(
17
39
  return n ? [...o, a] : o;
18
40
  },
19
41
  []
20
- ), F = (t) => {
21
- const { type: e, checked: r } = t, o = e === "checkbox";
42
+ ), F = (e) => {
43
+ const { type: t, checked: r } = e, o = t === "checkbox";
22
44
  if (o)
23
45
  return {
24
46
  isCheckBoxGroup: o,
25
- selectedBoxes: r ? [t] : []
47
+ selectedBoxes: r ? [e] : []
26
48
  };
27
- const s = Array.from(t), n = s.every((h) => {
28
- const { type: p } = h;
49
+ const s = Array.from(e), n = s.every((c) => {
50
+ const { type: p } = c;
29
51
  return p === "checkbox";
30
52
  }), a = !!s.length && n;
31
53
  if (!a) return { isCheckBoxGroup: a, selectedBoxes: [] };
32
- const l = s.filter(
33
- ({ checked: h }) => h
54
+ const i = s.filter(
55
+ ({ checked: c }) => c
34
56
  );
35
- return { isCheckBoxGroup: a, selectedBoxes: l };
36
- }, E = (t) => {
37
- const { type: e, multiple: r, options: o } = t, s = e === "select-multiple" && r;
57
+ return { isCheckBoxGroup: a, selectedBoxes: i };
58
+ }, E = (e) => {
59
+ const { type: t, multiple: r, options: o } = e, s = t === "select-multiple" && r;
38
60
  if (!s) return { isMultiSelect: s, selectedOptions: [] };
39
61
  const n = [].filter.call(
40
62
  o,
41
63
  ({ selected: a }) => a
42
64
  );
43
65
  return { isMultiSelect: s, selectedOptions: n };
44
- }, R = new RegExp(
66
+ }, j = new RegExp(
45
67
  [
46
68
  "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:",
47
69
  "\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:",
@@ -55,130 +77,130 @@ const P = async (t, e) => (await Promise.all(
55
77
  "[-\b\v\f-!-ZS-]|\\\\[-",
56
78
  " \v\f-])+)\\])"
57
79
  ].join("")
58
- ), T = (t) => ({
80
+ ), I = (e) => ({
59
81
  name: "min",
60
- validator: (e) => {
61
- const { value: r, message: o } = t, { value: s } = e;
82
+ validator: (t) => {
83
+ const { value: r, message: o } = e, { value: s } = t;
62
84
  return { error: !!s && Number(s) < r, message: o };
63
85
  }
64
- }), j = (t) => ({
86
+ }), A = (e) => ({
65
87
  name: "max",
66
- validator: (e) => {
67
- const { value: r, message: o } = t, { value: s } = e;
88
+ validator: (t) => {
89
+ const { value: r, message: o } = e, { value: s } = t;
68
90
  return { error: !!s && Number(s) > r, message: o };
69
91
  }
70
- }), A = (t) => ({
92
+ }), U = (e) => ({
71
93
  name: "email",
72
- validator: (e) => {
73
- const { message: r } = t || {}, { value: o } = e;
74
- return { error: !!o && !R.test(o), message: r };
94
+ validator: (t) => {
95
+ const { message: r } = e || {}, { value: o } = t;
96
+ return { error: !!o && !j.test(o), message: r };
75
97
  }
76
- }), U = (t) => ({
98
+ }), Y = (e) => ({
77
99
  name: "pattern",
78
- validator: (e) => {
79
- const { pattern: r, message: o } = t, { value: s } = e;
100
+ validator: (t) => {
101
+ const { pattern: r, message: o } = e, { value: s } = t;
80
102
  return { error: !!s && !s.match(r), message: o };
81
103
  }
82
- }), I = (t) => ({
104
+ }), Z = (e) => ({
83
105
  name: "required",
84
- validator: (e) => {
85
- const { message: r } = t || {}, { value: o } = e, {
106
+ validator: (t) => {
107
+ const { message: r } = e || {}, { value: o } = t, {
86
108
  isCheckBoxGroup: s,
87
109
  selectedBoxes: { length: n }
88
- } = F(e);
110
+ } = F(t);
89
111
  if (s) return { error: !n, message: r };
90
112
  const {
91
113
  isMultiSelect: a,
92
- selectedOptions: { length: l }
93
- } = E(e);
94
- return a ? { error: !l, message: r } : { error: !o, message: r };
114
+ selectedOptions: { length: i }
115
+ } = E(t);
116
+ return a ? { error: !i, message: r } : { error: !o, message: r };
95
117
  }
96
- }), Z = (t) => ({
118
+ }), J = (e) => ({
97
119
  name: "minLength",
98
- validator: (e) => {
99
- const { length: r, message: o } = t, { value: s } = e, n = !!s && s.length < r, {
120
+ validator: (t) => {
121
+ const { length: r, message: o } = e, { value: s } = t, n = !!s && s.length < r, {
100
122
  isCheckBoxGroup: a,
101
- selectedBoxes: { length: l }
102
- } = F(e);
123
+ selectedBoxes: { length: i }
124
+ } = F(t);
103
125
  if (a)
104
- return { error: !!l && l < r, message: o };
126
+ return { error: !!i && i < r, message: o };
105
127
  const {
106
- isMultiSelect: h,
128
+ isMultiSelect: c,
107
129
  selectedOptions: { length: p }
108
- } = E(e);
109
- return h ? { error: !!p && p < r, message: o } : { error: n, message: o };
130
+ } = E(t);
131
+ return c ? { error: !!p && p < r, message: o } : { error: n, message: o };
110
132
  }
111
- }), J = (t) => ({
133
+ }), Q = (e) => ({
112
134
  name: "maxLength",
113
- validator: (e) => {
114
- const { length: r, message: o } = t, { value: s } = e, n = !!s && s.length > r, {
135
+ validator: (t) => {
136
+ const { length: r, message: o } = e, { value: s } = t, n = !!s && s.length > r, {
115
137
  isCheckBoxGroup: a,
116
- selectedBoxes: { length: l }
117
- } = F(e);
138
+ selectedBoxes: { length: i }
139
+ } = F(t);
118
140
  if (a)
119
- return { error: !!l && l > r, message: o };
141
+ return { error: !!i && i > r, message: o };
120
142
  const {
121
- isMultiSelect: h,
143
+ isMultiSelect: c,
122
144
  selectedOptions: { length: p }
123
- } = E(e);
124
- return h ? { error: !!p && p > r, message: o } : { error: n, message: o };
145
+ } = E(t);
146
+ return c ? { error: !!p && p > r, message: o } : { error: n, message: o };
125
147
  }
126
- }), Q = (t) => ({
148
+ }), X = (e) => ({
127
149
  name: "define",
128
- validator: (e) => t(e)
129
- }), X = (t) => {
130
- const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
131
- return e ? H(Number(e[1]), Number(e[2]), Number(e[3])) : null;
132
- }, Y = (t) => ({
150
+ validator: (t) => e(t)
151
+ }), ee = (e) => {
152
+ const t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
153
+ return t ? W(Number(t[1]), Number(t[2]), Number(t[3])) : null;
154
+ }, te = (e) => ({
133
155
  name: "dateRange",
134
- validator: (e) => {
135
- const { min: r, max: o, message: s } = t, { value: n } = e, a = n ? X(n) : null;
156
+ validator: (t) => {
157
+ const { min: r, max: o, message: s } = e, { value: n } = t, a = n ? ee(n) : null;
136
158
  if (a === null) return { error: !1, message: s };
137
- const l = r && !Number.isNaN(r.getTime()) ? S(r) : null, h = o && !Number.isNaN(o.getTime()) ? S(o) : null;
138
- return l !== null && h !== null && l > h ? { error: !1, message: s } : { error: l !== null && a < l || h !== null && a > h, message: s };
159
+ const i = r && !Number.isNaN(r.getTime()) ? S(r) : null, c = o && !Number.isNaN(o.getTime()) ? S(o) : null;
160
+ return i !== null && c !== null && i > c ? { error: !1, message: s } : { error: i !== null && a < i || c !== null && a > c, message: s };
139
161
  }
140
- }), ce = {
141
- min: T,
142
- max: j,
143
- email: A,
144
- define: Q,
145
- pattern: U,
146
- required: I,
147
- minLength: Z,
148
- maxLength: J,
149
- dateRange: Y
162
+ }), ue = {
163
+ min: I,
164
+ max: A,
165
+ email: U,
166
+ define: X,
167
+ pattern: Y,
168
+ required: Z,
169
+ minLength: J,
170
+ maxLength: Q,
171
+ dateRange: te
150
172
  };
151
- var ee = Object.defineProperty, te = Object.getOwnPropertyDescriptor, V = (t) => {
152
- throw TypeError(t);
153
- }, u = (t, e, r, o) => {
154
- for (var s = o > 1 ? void 0 : o ? te(e, r) : e, n = t.length - 1, a; n >= 0; n--)
155
- (a = t[n]) && (s = (o ? a(e, r, s) : a(s)) || s);
156
- return o && s && ee(e, r, s), s;
157
- }, re = (t, e, r) => e.has(t) || V("Cannot " + r), i = (t, e, r) => (re(t, e, "read from private field"), r ? r.call(t) : e.get(t)), m = (t, e, r) => e.has(t) ? V("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), y, M, g, w, f, _, v, b, k, B, C, O;
158
- let c = class extends L {
173
+ var re = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, z = (e) => {
174
+ throw TypeError(e);
175
+ }, m = (e, t, r, o) => {
176
+ for (var s = o > 1 ? void 0 : o ? oe(t, r) : t, n = e.length - 1, a; n >= 0; n--)
177
+ (a = e[n]) && (s = (o ? a(t, r, s) : a(s)) || s);
178
+ return o && s && re(t, r, s), s;
179
+ }, se = (e, t, r) => t.has(e) || z("Cannot " + r), l = (e, t, r) => (se(e, t, "read from private field"), r ? r.call(e) : t.get(e)), u = (e, t, r) => t.has(e) ? z("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), y, x, g, w, f, _, v, k, b, B, C, O;
180
+ let h = class extends $ {
159
181
  constructor() {
160
- super(...arguments), this.validationMode = "onBlur", this.initialValues = {}, this.required = !1, this.disabled = !1, this.readOnly = !1, this.formMeta = {}, this.formRef = N(), this._actionFired = !1, m(this, y, () => !!this._actionFired), this.formContext = G, m(this, M, (t) => {
161
- const { field: e } = t, { name: r } = e;
162
- r && (this.formMeta = { ...this.formMeta, [r]: t });
163
- }), m(this, g, (t) => {
164
- const { validators: e, errorSetter: r } = this.formMeta[t] || {};
165
- e != null && e.length && r([]);
166
- }), m(this, w, () => {
167
- Object.keys(this.formMeta).forEach((t) => {
168
- const { initializer: e } = this.formMeta[t];
169
- e(), i(this, g).call(this, t);
182
+ super(...arguments), this.validationMode = "onBlur", this.initialValues = {}, this.required = !1, this.disabled = !1, this.readOnly = !1, this.formMeta = {}, this.formRef = N(), this._actionFired = !1, u(this, y, () => !!this._actionFired), this.formContext = q, u(this, x, (e) => {
183
+ const { field: t } = e, { name: r } = t;
184
+ r && (this.formMeta = { ...this.formMeta, [r]: e });
185
+ }), u(this, g, (e) => {
186
+ const { validators: t, errorSetter: r } = this.formMeta[e] || {};
187
+ t != null && t.length && r([]);
188
+ }), u(this, w, () => {
189
+ Object.keys(this.formMeta).forEach((e) => {
190
+ const { initializer: t } = this.formMeta[e];
191
+ t(), l(this, g).call(this, e);
170
192
  });
171
- }), m(this, f, async (t) => {
172
- const { field: e, validators: r, errorSetter: o } = this.formMeta[t] || {}, { disabled: s } = e || {};
193
+ }), u(this, f, async (e) => {
194
+ const { field: t, validators: r, errorSetter: o } = this.formMeta[e] || {}, { disabled: s } = t || {};
173
195
  if (!(r != null && r.length) || s) return [];
174
- const n = await P(e, r);
196
+ const n = await R(t, r);
175
197
  return o(n), n;
176
- }), m(this, _, async () => await Promise.all(
198
+ }), u(this, _, async () => await Promise.all(
177
199
  Object.keys(this.formMeta).map(
178
- async (t) => await i(this, f).call(this, t)
200
+ async (e) => await l(this, f).call(this, e)
179
201
  )
180
- )), m(this, v, async () => {
181
- (await i(this, _).call(this)).some((r) => !!r.length) || this.dispatchEvent(
202
+ )), u(this, v, async () => {
203
+ (await l(this, _).call(this)).some((r) => !!r.length) || this.dispatchEvent(
182
204
  new CustomEvent("submit", {
183
205
  bubbles: !0,
184
206
  composed: !0,
@@ -190,55 +212,55 @@ let c = class extends L {
190
212
  }, {})
191
213
  })
192
214
  );
193
- }), m(this, b, async ({ target: t }) => {
194
- if (i(this, y).call(this)) {
195
- this._actionFired = !i(this, y).call(this);
215
+ }), u(this, k, async ({ target: e }) => {
216
+ if (l(this, y).call(this)) {
217
+ this._actionFired = !l(this, y).call(this);
196
218
  return;
197
219
  }
198
- const { name: e } = t;
199
- this.validationMode === "onBlur" && await i(this, f).call(this, e);
200
- }), m(this, k, async ({ target: t }) => {
201
- const { name: e } = t;
202
- this.validationMode === "onChange" ? await i(this, f).call(this, e) : i(this, g).call(this, e);
203
- }), m(this, B, async ({ target: t }) => {
204
- const { type: e } = t;
205
- switch (e) {
220
+ const { name: t } = e;
221
+ this.validationMode === "onBlur" && await l(this, f).call(this, t);
222
+ }), u(this, b, async ({ target: e }) => {
223
+ const { name: t } = e;
224
+ this.validationMode === "onChange" ? await l(this, f).call(this, t) : l(this, g).call(this, t);
225
+ }), u(this, B, async ({ target: e }) => {
226
+ const { type: t } = e;
227
+ switch (t) {
206
228
  case "reset":
207
- return i(this, w).call(this);
229
+ return l(this, w).call(this);
208
230
  case "submit":
209
- return i(this, v).call(this);
231
+ return l(this, v).call(this);
210
232
  }
211
- }), m(this, C, async (t) => {
212
- const { target: e, key: r } = t, { name: o } = e;
213
- r === "Enter" && this.formMeta[o] && await i(this, v).call(this);
214
- }), m(this, O, (t) => {
215
- const e = t.target, { name: r } = document.activeElement || {}, o = e.closest("[type=reset]") || e.closest("[type=submit]");
233
+ }), u(this, C, async (e) => {
234
+ const { target: t, key: r } = e, { name: o } = t;
235
+ r === "Enter" && this.formMeta[o] && await l(this, v).call(this);
236
+ }), u(this, O, (e) => {
237
+ const t = e.target, { name: r } = document.activeElement || {}, o = t.closest("[type=reset]") || t.closest("[type=submit]");
216
238
  this.formMeta[r] && (this._actionFired = !!o);
217
239
  });
218
240
  }
219
- willUpdate(t) {
220
- Object.keys(this.formContext).some((o) => t.has(o)) && (this.formContext = {
241
+ willUpdate(e) {
242
+ Object.keys(this.formContext).some((o) => e.has(o)) && (this.formContext = {
221
243
  required: this.required,
222
244
  readOnly: this.readOnly,
223
245
  disabled: this.disabled,
224
246
  initialValues: this.initialValues,
225
- registerField: i(this, M),
226
- formBlurHandler: i(this, b),
227
- formChangeHandler: i(this, k)
247
+ registerField: l(this, x),
248
+ formBlurHandler: l(this, k),
249
+ formChangeHandler: l(this, b)
228
250
  });
229
251
  }
230
252
  render() {
231
- return $`
253
+ return D`
232
254
  <form
233
255
  novalidate
234
- ${D(this.formRef)}
256
+ ${H(this.formRef)}
235
257
  action="${this.action}"
236
258
  method="${this.method}"
237
259
  target="${this.target}"
238
260
  enctype="${this.enctype}"
239
- @click="${i(this, B)}"
240
- @keydown="${i(this, C)}"
241
- @mousedown="${i(this, O)}"
261
+ @click="${l(this, B)}"
262
+ @keydown="${l(this, C)}"
263
+ @mousedown="${l(this, O)}"
242
264
  >
243
265
  <slot></slot>
244
266
  </form>
@@ -246,55 +268,55 @@ let c = class extends L {
246
268
  }
247
269
  };
248
270
  y = /* @__PURE__ */ new WeakMap();
249
- M = /* @__PURE__ */ new WeakMap();
271
+ x = /* @__PURE__ */ new WeakMap();
250
272
  g = /* @__PURE__ */ new WeakMap();
251
273
  w = /* @__PURE__ */ new WeakMap();
252
274
  f = /* @__PURE__ */ new WeakMap();
253
275
  _ = /* @__PURE__ */ new WeakMap();
254
276
  v = /* @__PURE__ */ new WeakMap();
255
- b = /* @__PURE__ */ new WeakMap();
256
277
  k = /* @__PURE__ */ new WeakMap();
278
+ b = /* @__PURE__ */ new WeakMap();
257
279
  B = /* @__PURE__ */ new WeakMap();
258
280
  C = /* @__PURE__ */ new WeakMap();
259
281
  O = /* @__PURE__ */ new WeakMap();
260
- u([
282
+ m([
261
283
  d({ type: String })
262
- ], c.prototype, "validationMode", 2);
263
- u([
284
+ ], h.prototype, "validationMode", 2);
285
+ m([
264
286
  d({ type: Object })
265
- ], c.prototype, "initialValues", 2);
266
- u([
287
+ ], h.prototype, "initialValues", 2);
288
+ m([
267
289
  d({ type: Boolean })
268
- ], c.prototype, "required", 2);
269
- u([
290
+ ], h.prototype, "required", 2);
291
+ m([
270
292
  d({ type: Boolean })
271
- ], c.prototype, "disabled", 2);
272
- u([
293
+ ], h.prototype, "disabled", 2);
294
+ m([
273
295
  d({ type: Boolean })
274
- ], c.prototype, "readOnly", 2);
275
- u([
296
+ ], h.prototype, "readOnly", 2);
297
+ m([
276
298
  d({ type: String })
277
- ], c.prototype, "action", 2);
278
- u([
299
+ ], h.prototype, "action", 2);
300
+ m([
279
301
  d({ type: String })
280
- ], c.prototype, "method", 2);
281
- u([
302
+ ], h.prototype, "method", 2);
303
+ m([
282
304
  d({ type: String })
283
- ], c.prototype, "target", 2);
284
- u([
305
+ ], h.prototype, "target", 2);
306
+ m([
285
307
  d({ type: String })
286
- ], c.prototype, "enctype", 2);
287
- u([
288
- W()
289
- ], c.prototype, "_actionFired", 2);
290
- u([
291
- z({ context: q }),
292
- W()
293
- ], c.prototype, "formContext", 2);
294
- c = u([
308
+ ], h.prototype, "enctype", 2);
309
+ m([
310
+ L()
311
+ ], h.prototype, "_actionFired", 2);
312
+ m([
313
+ V({ context: T }),
314
+ L()
315
+ ], h.prototype, "formContext", 2);
316
+ h = m([
295
317
  K("bm-form")
296
- ], c);
318
+ ], h);
297
319
  export {
298
- c as BmForm,
299
- ce as validators
320
+ h as BmForm,
321
+ ue as validators
300
322
  };