@cal.macconnachie/web-components 2.6.10 → 2.6.12

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/index.d.ts CHANGED
@@ -206,6 +206,7 @@ export declare class BaseDrawer extends BaseElement {
206
206
  size: 'sm' | 'md' | 'lg' | 'full';
207
207
  detents: number[];
208
208
  persistOnOverlayClick: boolean;
209
+ defaultDetent: string;
209
210
  private isClosing;
210
211
  private isVisible;
211
212
  private isDragging;
package/dist/index.js CHANGED
@@ -530,7 +530,7 @@ function y(r) {
530
530
  return u({ ...r, state: !0, attribute: !1 });
531
531
  }
532
532
  const Rs = (r, e, t) => (t.configurable = !0, t.enumerable = !0, Reflect.decorate && typeof e != "object" && Object.defineProperty(r, e, t), t);
533
- function V(r, e) {
533
+ function Y(r, e) {
534
534
  return (t, i, s) => {
535
535
  const o = (a) => a.renderRoot?.querySelector(r) ?? null;
536
536
  return Rs(t, i, { get() {
@@ -1012,7 +1012,7 @@ class A extends M {
1012
1012
  async checkExistingSession() {
1013
1013
  try {
1014
1014
  const { user: e } = await this.getApiService().checkSession();
1015
- e && this.handleAuthSuccess(e);
1015
+ e ? this.handleAuthSuccess(e) : this.dispatchEvent(new CustomEvent("no-session"));
1016
1016
  } catch {
1017
1017
  try {
1018
1018
  window.__authRefreshPromise || (window.__authRefreshPromise = (async () => {
@@ -1025,6 +1025,7 @@ class A extends M {
1025
1025
  const { user: t } = await this.getApiService().checkSession();
1026
1026
  t && this.handleAuthSuccess(t);
1027
1027
  } catch {
1028
+ this.dispatchEvent(new CustomEvent("no-session"));
1028
1029
  }
1029
1030
  }
1030
1031
  }
@@ -2152,7 +2153,7 @@ E([
2152
2153
  y()
2153
2154
  ], A.prototype, "signupOtpDigits");
2154
2155
  E([
2155
- V("#email-input")
2156
+ Y("#email-input")
2156
2157
  ], A.prototype, "emailInput");
2157
2158
  const S = qt(class extends Ht {
2158
2159
  constructor(r) {
@@ -3788,10 +3789,10 @@ I([
3788
3789
  y()
3789
3790
  ], P.prototype, "alignRight");
3790
3791
  I([
3791
- V(".date-display")
3792
+ Y(".date-display")
3792
3793
  ], P.prototype, "dateDisplay");
3793
3794
  I([
3794
- V(".calendar-container")
3795
+ Y(".calendar-container")
3795
3796
  ], P.prototype, "calendarContainer");
3796
3797
  var Qs = Object.defineProperty, U = (r, e, t, i) => {
3797
3798
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
@@ -4302,12 +4303,12 @@ U([
4302
4303
  y()
4303
4304
  ], L.prototype, "alignRight");
4304
4305
  U([
4305
- V(".time-display")
4306
+ Y(".time-display")
4306
4307
  ], L.prototype, "timeDisplay");
4307
4308
  U([
4308
- V(".time-container")
4309
+ Y(".time-container")
4309
4310
  ], L.prototype, "timeContainer");
4310
- var ei = Object.defineProperty, F = (r, e, t, i) => {
4311
+ var ei = Object.defineProperty, j = (r, e, t, i) => {
4311
4312
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
4312
4313
  (a = r[o]) && (s = a(e, t, s) || s);
4313
4314
  return s && ei(e, t, s), s;
@@ -4555,66 +4556,66 @@ class q extends M {
4555
4556
  `;
4556
4557
  }
4557
4558
  }
4558
- F([
4559
+ j([
4559
4560
  u({ type: String })
4560
4561
  ], q.prototype, "value");
4561
- F([
4562
+ j([
4562
4563
  u({ type: String })
4563
4564
  ], q.prototype, "label");
4564
- F([
4565
+ j([
4565
4566
  u({ type: String })
4566
4567
  ], q.prototype, "placeholder");
4567
- F([
4568
+ j([
4568
4569
  u({ type: Boolean, reflect: !0 })
4569
4570
  ], q.prototype, "required");
4570
- F([
4571
+ j([
4571
4572
  u({ type: Boolean, reflect: !0 })
4572
4573
  ], q.prototype, "disabled");
4573
- F([
4574
+ j([
4574
4575
  u({ type: String })
4575
4576
  ], q.prototype, "error");
4576
- F([
4577
+ j([
4577
4578
  u({ type: String })
4578
4579
  ], q.prototype, "hint");
4579
- F([
4580
+ j([
4580
4581
  u({ type: String })
4581
4582
  ], q.prototype, "size");
4582
- F([
4583
+ j([
4583
4584
  u({ type: String })
4584
4585
  ], q.prototype, "minDate");
4585
- F([
4586
+ j([
4586
4587
  u({ type: String })
4587
4588
  ], q.prototype, "maxDate");
4588
- F([
4589
+ j([
4589
4590
  u({ type: String })
4590
4591
  ], q.prototype, "format");
4591
- F([
4592
+ j([
4592
4593
  y()
4593
4594
  ], q.prototype, "dateValue");
4594
- F([
4595
+ j([
4595
4596
  y()
4596
4597
  ], q.prototype, "timeValue");
4597
- F([
4598
+ j([
4598
4599
  y()
4599
4600
  ], q.prototype, "isFocused");
4600
- F([
4601
- V("base-date-picker")
4601
+ j([
4602
+ Y("base-date-picker")
4602
4603
  ], q.prototype, "datePicker");
4603
- F([
4604
- V("base-time-picker")
4604
+ j([
4605
+ Y("base-time-picker")
4605
4606
  ], q.prototype, "timePicker");
4606
- var ri = Object.defineProperty, Y = (r, e, t, i) => {
4607
+ var ri = Object.defineProperty, V = (r, e, t, i) => {
4607
4608
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
4608
4609
  (a = r[o]) && (s = a(e, t, s) || s);
4609
4610
  return s && ri(e, t, s), s;
4610
4611
  };
4611
4612
  const si = () => R({
4612
4613
  name: "base-drawer",
4613
- element: j
4614
+ element: H
4614
4615
  });
4615
- class j extends M {
4616
+ class H extends M {
4616
4617
  constructor() {
4617
- super(...arguments), this.open = !1, this.size = "sm", this.detents = [0, 85], this.persistOnOverlayClick = !1, this.isClosing = !1, this.isVisible = !1, this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.currentDetentIndex = 0, this.dragCommitted = !1, this.transitionDuration = 300, this.boundKeyHandler = (e) => {
4618
+ super(...arguments), this.open = !1, this.size = "sm", this.detents = [0, 85], this.persistOnOverlayClick = !1, this.defaultDetent = "", this.isClosing = !1, this.isVisible = !1, this.isDragging = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.lastDragEndTime = 0, this.currentDetentIndex = 0, this.dragCommitted = !1, this.transitionDuration = 300, this.boundKeyHandler = (e) => {
4618
4619
  e.key === "Escape" && this.isVisible && this.isClosable() && this.handleClose();
4619
4620
  }, this.handleClose = () => {
4620
4621
  this.isClosing || !this.isVisible || (this.cleanupInlineStyles(), this.isDragging = !1, this.dragCommitted = !1, this.dragStartY = 0, this.dragCurrentY = 0, this.dragStartTime = 0, this.isClosing = !0, setTimeout(() => {
@@ -4720,7 +4721,11 @@ class j extends M {
4720
4721
  if (this.open) {
4721
4722
  this.isVisible = !0;
4722
4723
  const e = this.getActiveDetents();
4723
- this.currentDetentIndex = this.isClosable() ? Math.max(0, e.length - 1) : 0;
4724
+ if (this.defaultDetent) {
4725
+ const t = e.indexOf(Number(this.defaultDetent));
4726
+ this.currentDetentIndex = t !== -1 ? t : this.isClosable() ? Math.max(0, e.length - 1) : 0;
4727
+ } else
4728
+ this.currentDetentIndex = this.isClosable() ? Math.max(0, e.length - 1) : 0;
4724
4729
  }
4725
4730
  }
4726
4731
  updated(e) {
@@ -4728,7 +4733,12 @@ class j extends M {
4728
4733
  if (this.open) {
4729
4734
  this.isVisible = !0;
4730
4735
  const t = this.getActiveDetents();
4731
- this.currentDetentIndex = this.isClosable() ? Math.max(0, t.length - 1) : 0, this.lockBodyScroll();
4736
+ if (this.defaultDetent) {
4737
+ const i = t.indexOf(Number(this.defaultDetent));
4738
+ this.currentDetentIndex = i !== -1 ? i : this.isClosable() ? Math.max(0, t.length - 1) : 0;
4739
+ } else
4740
+ this.currentDetentIndex = this.isClosable() ? Math.max(0, t.length - 1) : 0;
4741
+ this.lockBodyScroll();
4732
4742
  } else this.isVisible && this.handleClose();
4733
4743
  e.has("isVisible") && (this.isVisible ? (this.lockBodyScroll(), this.cleanupInlineStyles()) : (this.unlockBodyScroll(), this.resetState()));
4734
4744
  }
@@ -4763,7 +4773,12 @@ class j extends M {
4763
4773
  openDrawer() {
4764
4774
  this.open = !0, this.isVisible = !0;
4765
4775
  const e = this.getActiveDetents();
4766
- this.currentDetentIndex = this.isClosable() ? Math.max(0, e.length - 1) : 0, this.dispatchEvent(
4776
+ if (this.defaultDetent) {
4777
+ const t = e.indexOf(Number(this.defaultDetent));
4778
+ this.currentDetentIndex = t !== -1 ? t : this.isClosable() ? Math.max(0, e.length - 1) : 0;
4779
+ } else
4780
+ this.currentDetentIndex = this.isClosable() ? Math.max(0, e.length - 1) : 0;
4781
+ this.dispatchEvent(
4767
4782
  new CustomEvent("drawer-open", {
4768
4783
  bubbles: !0,
4769
4784
  composed: !0
@@ -5019,13 +5034,13 @@ class j extends M {
5019
5034
  }`;
5020
5035
  }
5021
5036
  }
5022
- Y([
5037
+ V([
5023
5038
  u({ type: Boolean, reflect: !0 })
5024
- ], j.prototype, "open");
5025
- Y([
5039
+ ], H.prototype, "open");
5040
+ V([
5026
5041
  u({ type: String, attribute: "size" })
5027
- ], j.prototype, "size");
5028
- Y([
5042
+ ], H.prototype, "size");
5043
+ V([
5029
5044
  u({
5030
5045
  type: Array,
5031
5046
  converter: {
@@ -5039,43 +5054,46 @@ Y([
5039
5054
  }
5040
5055
  }
5041
5056
  })
5042
- ], j.prototype, "detents");
5043
- Y([
5057
+ ], H.prototype, "detents");
5058
+ V([
5044
5059
  u({ type: Boolean, attribute: "persist-on-overlay-click" })
5045
- ], j.prototype, "persistOnOverlayClick");
5046
- Y([
5060
+ ], H.prototype, "persistOnOverlayClick");
5061
+ V([
5062
+ u({ type: String, attribute: "default-detent" })
5063
+ ], H.prototype, "defaultDetent");
5064
+ V([
5047
5065
  y()
5048
- ], j.prototype, "isClosing");
5049
- Y([
5066
+ ], H.prototype, "isClosing");
5067
+ V([
5050
5068
  y()
5051
- ], j.prototype, "isVisible");
5052
- Y([
5069
+ ], H.prototype, "isVisible");
5070
+ V([
5053
5071
  y()
5054
- ], j.prototype, "isDragging");
5055
- Y([
5072
+ ], H.prototype, "isDragging");
5073
+ V([
5056
5074
  y()
5057
- ], j.prototype, "dragStartY");
5058
- Y([
5075
+ ], H.prototype, "dragStartY");
5076
+ V([
5059
5077
  y()
5060
- ], j.prototype, "dragCurrentY");
5061
- Y([
5078
+ ], H.prototype, "dragCurrentY");
5079
+ V([
5062
5080
  y()
5063
- ], j.prototype, "dragStartTime");
5064
- Y([
5081
+ ], H.prototype, "dragStartTime");
5082
+ V([
5065
5083
  y()
5066
- ], j.prototype, "lastDragEndTime");
5067
- Y([
5084
+ ], H.prototype, "lastDragEndTime");
5085
+ V([
5068
5086
  y()
5069
- ], j.prototype, "currentDetentIndex");
5070
- Y([
5087
+ ], H.prototype, "currentDetentIndex");
5088
+ V([
5071
5089
  y()
5072
- ], j.prototype, "dragCommitted");
5073
- Y([
5074
- V(".modal-container")
5075
- ], j.prototype, "modalContainer");
5076
- Y([
5077
- V(".drawer-content")
5078
- ], j.prototype, "drawerContent");
5090
+ ], H.prototype, "dragCommitted");
5091
+ V([
5092
+ Y(".modal-container")
5093
+ ], H.prototype, "modalContainer");
5094
+ V([
5095
+ Y(".drawer-content")
5096
+ ], H.prototype, "drawerContent");
5079
5097
  const ii = `<?xml version="1.0" encoding="UTF-8"?>
5080
5098
  <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 90 90">
5081
5099
  <defs>
@@ -5727,7 +5745,7 @@ re([
5727
5745
  u({ type: String })
5728
5746
  ], G.prototype, "size");
5729
5747
  re([
5730
- V("input")
5748
+ Y("input")
5731
5749
  ], G.prototype, "inputElement");
5732
5750
  var Oi = Object.defineProperty, Se = (r, e, t, i) => {
5733
5751
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
@@ -7290,13 +7308,13 @@ O([
7290
7308
  y()
7291
7309
  ], D.prototype, "selectedValuesSet");
7292
7310
  O([
7293
- V(".select-input")
7311
+ Y(".select-input")
7294
7312
  ], D.prototype, "selectInput");
7295
7313
  O([
7296
- V(".select-display")
7314
+ Y(".select-display")
7297
7315
  ], D.prototype, "selectDisplay");
7298
7316
  O([
7299
- V(".dropdown-options")
7317
+ Y(".dropdown-options")
7300
7318
  ], D.prototype, "dropdownElement");
7301
7319
  var Li = Object.defineProperty, We = (r, e, t, i) => {
7302
7320
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
@@ -8078,7 +8096,7 @@ le([
8078
8096
  y()
8079
8097
  ], ae.prototype, "isMobile");
8080
8098
  le([
8081
- V(".tabs-nav")
8099
+ Y(".tabs-nav")
8082
8100
  ], ae.prototype, "tabsNav");
8083
8101
  var qi = Object.defineProperty, te = (r, e, t, i) => {
8084
8102
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
@@ -8380,7 +8398,7 @@ te([
8380
8398
  u({ type: String })
8381
8399
  ], X.prototype, "resize");
8382
8400
  te([
8383
- V("textarea")
8401
+ Y("textarea")
8384
8402
  ], X.prototype, "textareaElement");
8385
8403
  var Fi = Object.defineProperty, Ke = (r, e, t, i) => {
8386
8404
  for (var s = void 0, o = r.length - 1, a; o >= 0; o--)
@@ -9823,14 +9841,14 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", jo
9823
9841
  hasStandardBrowserWebWorkerEnv: Fo,
9824
9842
  navigator: Pt,
9825
9843
  origin: jo
9826
- }, Symbol.toStringTag, { value: "Module" })), H = {
9844
+ }, Symbol.toStringTag, { value: "Module" })), F = {
9827
9845
  ...Vo,
9828
9846
  ...qo
9829
9847
  };
9830
9848
  function Yo(r, e) {
9831
- return wt(r, new H.classes.URLSearchParams(), {
9849
+ return wt(r, new F.classes.URLSearchParams(), {
9832
9850
  visitor: function(t, i, s, o) {
9833
- return H.isNode && d.isBuffer(t) ? (this.append(i, t.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
9851
+ return F.isNode && d.isBuffer(t) ? (this.append(i, t.toString("base64")), !1) : o.defaultVisitor.apply(this, arguments);
9834
9852
  },
9835
9853
  ...e
9836
9854
  });
@@ -9925,8 +9943,8 @@ const tt = {
9925
9943
  maxContentLength: -1,
9926
9944
  maxBodyLength: -1,
9927
9945
  env: {
9928
- FormData: H.classes.FormData,
9929
- Blob: H.classes.Blob
9946
+ FormData: F.classes.FormData,
9947
+ Blob: F.classes.Blob
9930
9948
  },
9931
9949
  validateStatus: function(e) {
9932
9950
  return e >= 200 && e < 300;
@@ -10226,10 +10244,10 @@ const ut = (r, e, t = 3) => {
10226
10244
  total: r,
10227
10245
  loaded: i
10228
10246
  }), e[1]];
10229
- }, yr = (r) => (...e) => d.asap(() => r(...e)), oa = H.hasStandardBrowserEnv ? /* @__PURE__ */ ((r, e) => (t) => (t = new URL(t, H.origin), r.protocol === t.protocol && r.host === t.host && (e || r.port === t.port)))(
10230
- new URL(H.origin),
10231
- H.navigator && /(msie|trident)/i.test(H.navigator.userAgent)
10232
- ) : () => !0, aa = H.hasStandardBrowserEnv ? (
10247
+ }, yr = (r) => (...e) => d.asap(() => r(...e)), oa = F.hasStandardBrowserEnv ? /* @__PURE__ */ ((r, e) => (t) => (t = new URL(t, F.origin), r.protocol === t.protocol && r.host === t.host && (e || r.port === t.port)))(
10248
+ new URL(F.origin),
10249
+ F.navigator && /(msie|trident)/i.test(F.navigator.userAgent)
10250
+ ) : () => !0, aa = F.hasStandardBrowserEnv ? (
10233
10251
  // Standard browser envs support document.cookie
10234
10252
  {
10235
10253
  write(r, e, t, i, s, o, a) {
@@ -10340,7 +10358,7 @@ const rs = (r) => {
10340
10358
  "Authorization",
10341
10359
  "Basic " + btoa((n.username || "") + ":" + (n.password ? unescape(encodeURIComponent(n.password)) : ""))
10342
10360
  ), d.isFormData(t)) {
10343
- if (H.hasStandardBrowserEnv || H.hasStandardBrowserWebWorkerEnv)
10361
+ if (F.hasStandardBrowserEnv || F.hasStandardBrowserWebWorkerEnv)
10344
10362
  a.setContentType(void 0);
10345
10363
  else if (d.isFunction(t.getHeaders)) {
10346
10364
  const l = t.getHeaders(), h = ["content-type", "content-length"];
@@ -10349,7 +10367,7 @@ const rs = (r) => {
10349
10367
  });
10350
10368
  }
10351
10369
  }
10352
- if (H.hasStandardBrowserEnv && (i && d.isFunction(i) && (i = i(e)), i || i !== !1 && oa(e.url))) {
10370
+ if (F.hasStandardBrowserEnv && (i && d.isFunction(i) && (i = i(e)), i || i !== !1 && oa(e.url))) {
10353
10371
  const l = s && o && aa.read(o);
10354
10372
  l && a.set(s, l);
10355
10373
  }
@@ -10406,7 +10424,7 @@ const rs = (r) => {
10406
10424
  m && (i(!C || C.type ? new Le(null, r, m) : C), m.abort(), m = null);
10407
10425
  }, s.cancelToken && s.cancelToken.subscribe(c), s.signal && (s.signal.aborted ? c() : s.signal.addEventListener("abort", c)));
10408
10426
  const _ = ra(s.url);
10409
- if (_ && H.protocols.indexOf(_) === -1) {
10427
+ if (_ && F.protocols.indexOf(_) === -1) {
10410
10428
  i(new $("Unsupported protocol " + _ + ":", $.ERR_BAD_REQUEST, r));
10411
10429
  return;
10412
10430
  }
@@ -10513,7 +10531,7 @@ const rs = (r) => {
10513
10531
  return !1;
10514
10532
  const n = s && at(kr), l = s && (typeof Sr == "function" ? /* @__PURE__ */ ((g) => (v) => g.encode(v))(new Sr()) : async (g) => new Uint8Array(await new t(g).arrayBuffer())), h = o && n && _r(() => {
10515
10533
  let g = !1;
10516
- const v = new t(H.origin, {
10534
+ const v = new t(F.origin, {
10517
10535
  body: new kr(),
10518
10536
  method: "POST",
10519
10537
  get duplex() {
@@ -10538,7 +10556,7 @@ const rs = (r) => {
10538
10556
  if (d.isBlob(g))
10539
10557
  return g.size;
10540
10558
  if (d.isSpecCompliantForm(g))
10541
- return (await new t(H.origin, {
10559
+ return (await new t(F.origin, {
10542
10560
  method: "POST",
10543
10561
  body: g
10544
10562
  }).arrayBuffer()).byteLength;
@@ -11195,7 +11213,7 @@ export {
11195
11213
  De as BaseCard,
11196
11214
  P as BaseDatePicker,
11197
11215
  q as BaseDateTimePicker,
11198
- j as BaseDrawer,
11216
+ H as BaseDrawer,
11199
11217
  Oe as BaseIcon,
11200
11218
  G as BaseInput,
11201
11219
  ue as BaseList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cal.macconnachie/web-components",
3
- "version": "2.6.10",
3
+ "version": "2.6.12",
4
4
  "description": "Web components hosted on a CDN",
5
5
  "keywords": [
6
6
  "web-components",