@base-framework/ui 1.0.221 → 1.0.223

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.es.js CHANGED
@@ -5,7 +5,7 @@ import { V as w, a as R } from "./veil-D4dRxILB.js";
5
5
  import { Icons as E } from "./icons.es.js";
6
6
  import { A as O, B as V, C as j, t as q, E as z, v as J, w as _, x as K, D as Q, j as X, k as Y, H as Z, G as $, s as aa, c as ea, a as sa, b as oa, I as ta, i as ra, g as na, e as la, h as ia, F as pa, d as ua, f as ma, u as da, M as ca, l as ga, N as Ca, P as Ta, p as ba, q as Da, S as Ia, n as Sa, o as Ba, T as Pa, y as Fa, z as Ma, m as ka, r as Na } from "./empty-state-2O1fITpG.js";
7
7
  import { A as va, b as xa, C as ya, D as ha, a as Wa, F as Ha, M as La, P as Aa, c as wa, g as Ra, p as Ua } from "./calendar-Bn55oWBo.js";
8
- import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, R as Za, S as $a, n as ae, o as ee, t as se, s as oe, q as te, r as re, T as ne, l as le, U as ie, W as pe, f as ue, h as me, i as de, c as ce, d as ge, b as Ce, e as Te, a as be, g as De } from "./signature-panel-Hz9yFndG.js";
8
+ import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, R as Za, S as $a, n as ae, o as ee, t as se, s as oe, q as te, r as re, T as ne, l as le, U as ie, W as pe, f as ue, h as me, i as de, c as ce, d as ge, b as Ce, e as Te, a as be, g as De } from "./signature-panel-Casw0xrl.js";
9
9
  import { B as Se, I as Be, M as Pe, d as Fe, e as Me, g as ke, N as Ne, b as fe, a as ve, f as xe, P as ye, c as he, S as We, T as He } from "./mobile-nav-wrapper-Dj67Pb8l.js";
10
10
  import { B as Ae, a as we, C as Re, F as Ue, b as Ee, c as Ge, M as Oe, P as Ve, S as je } from "./sidebar-menu-page-BVryQj2Z.js";
11
11
  import { A as ze, F as Je, M as _e, a as Ke, T as Qe } from "./aside-template-McEj_Gxc.js";
@@ -1,4 +1,4 @@
1
- import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, R as v, S as D, n as N, o as k, t as C, s as c, q as T, r as M, T as m, l as y, U as B, W, f as h, h as S, i as H, c as P, d as I, b as f, e as x, a as L, g as O } from "./signature-panel-Hz9yFndG.js";
1
+ import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as g, O as p, P as u, R as v, S as D, n as N, o as k, t as C, s as c, q as T, r as M, T as m, l as y, U as B, W, f as h, h as S, i as H, c as P, d as I, b as f, e as x, a as L, g as O } from "./signature-panel-Casw0xrl.js";
2
2
  import { b as U, C as G, D as R, a as j, F as q, M as w, c as z, p as A } from "./calendar-Bn55oWBo.js";
3
3
  import { B as J, I as K, M as Q, d as V, e as X, g as Y, N as Z, b as _, a as $, f as aa, P as ea, c as sa, S as ta, T as oa } from "./mobile-nav-wrapper-Dj67Pb8l.js";
4
4
  export {
@@ -324,7 +324,9 @@ const j = ({ label: e, click: t }) => g(
324
324
  class: `flex items-center justify-center h-9 w-9 p-0 text-sm font-medium rounded-md transition-colors ${c}`,
325
325
  variant: u,
326
326
  disabled: s,
327
- click: () => !s && l()
327
+ click: () => {
328
+ s || l();
329
+ }
328
330
  },
329
331
  e.toString()
330
332
  );
@@ -432,8 +434,11 @@ class ke extends m {
432
434
  current: {
433
435
  date: t.getDate(),
434
436
  month: a,
435
- year: n
436
- }
437
+ year: n,
438
+ start: this.startDate,
439
+ end: this.endDate
440
+ },
441
+ selecting: "start"
437
442
  });
438
443
  }
439
444
  /**
@@ -448,15 +453,12 @@ class ke extends m {
448
453
  /**
449
454
  * Initialize component state.
450
455
  *
451
- * @returns {{view:string,selecting:string,start:string|null,end:string|null}}
456
+ * @returns {{view:string}}
452
457
  */
453
458
  setupStates() {
454
459
  return {
455
- view: "calendar",
460
+ view: "calendar"
456
461
  // 'calendar', 'months', or 'years'
457
- selecting: "start",
458
- start: this.startDate,
459
- end: this.endDate
460
462
  };
461
463
  }
462
464
  /**
@@ -466,7 +468,7 @@ class ke extends m {
466
468
  * @returns {void}
467
469
  */
468
470
  handleClick(t) {
469
- this.state.selecting === "start" ? (this.state.start = t, this.state.end = null, this.state.selecting = "end") : (this.state.start && t < this.state.start ? (this.state.end = this.state.start, this.state.start = t) : this.state.end = t, this.state.selecting = "start", typeof this.onRangeSelect == "function" && this.onRangeSelect(this.state.start, this.state.end));
471
+ this.data.selecting === "start" ? (this.data.current.start = t, this.data.current.end = null, this.data.selecting = "end") : (this.data.current.start && t < this.data.current.start ? (this.data.current.end = this.data.current.start, this.data.current.start = t) : this.data.current.end = t, this.data.selecting = "start", typeof this.onRangeSelect == "function" && this.onRangeSelect(this.data.current.start, this.data.current.end));
470
472
  }
471
473
  /**
472
474
  * Update current month/year in data.
@@ -484,11 +486,11 @@ class ke extends m {
484
486
  * @returns {object}
485
487
  */
486
488
  render() {
487
- const { today: t, current: s } = this.data, { start: a, end: n, selecting: i } = this.state, l = new Date(s.year, s.month, 1).getDay(), u = new Date(s.year, s.month + 1, 0).getDate(), c = [];
489
+ const { today: t, current: s, selecting: a } = this.data, { start: n, end: i } = s, l = new Date(s.year, s.month, 1).getDay(), u = new Date(s.year, s.month + 1, 0).getDate(), c = [];
488
490
  for (let h = 0; h < l; h++)
489
491
  c.push(null);
490
492
  for (let h = 1; h <= u; h++) {
491
- const r = st(s.year, s.month, h), d = new Date(s.year, s.month, h), p = new Date(t.year, t.month, t.date), y = d < p, L = this.blockPriorDates && y, T = a === r, B = n === r, X = a && n && r > a && r < n;
493
+ const r = st(s.year, s.month, h), d = new Date(s.year, s.month, h), p = new Date(t.year, t.month, t.date), y = d < p, L = this.blockPriorDates && y, T = n === r, B = i === r, X = n && i && r > n && r < i;
492
494
  c.push({
493
495
  day: h,
494
496
  iso: r,
@@ -496,16 +498,16 @@ class ke extends m {
496
498
  isStart: T,
497
499
  isEnd: B,
498
500
  isBetween: X,
499
- click: () => this.handleClick(r)
501
+ click: this.handleClick.bind(this, r)
500
502
  });
501
503
  }
502
504
  return o({ class: "range-calendar bg-background border border-border rounded-lg shadow-md p-4 w-full max-w-sm" }, [
503
505
  Tt({
504
- start: a,
505
- end: n,
506
- selecting: i,
507
- onSelectStart: () => this.state.selecting = "start",
508
- onSelectEnd: () => this.state.selecting = "end"
506
+ start: n,
507
+ end: i,
508
+ selecting: a,
509
+ onSelectStart: () => this.data.selecting = "start",
510
+ onSelectEnd: () => this.data.selecting = "end"
509
511
  }),
510
512
  q("view", (h) => {
511
513
  switch (h) {
@@ -42,13 +42,10 @@ export class RangeCalendar extends Component {
42
42
  /**
43
43
  * Initialize component state.
44
44
  *
45
- * @returns {{view:string,selecting:string,start:string|null,end:string|null}}
45
+ * @returns {{view:string}}
46
46
  */
47
47
  setupStates(): {
48
48
  view: string;
49
- selecting: string;
50
- start: string | null;
51
- end: string | null;
52
49
  };
53
50
  /**
54
51
  * Handle a date cell click.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.221",
3
+ "version": "1.0.223",
4
4
  "description": "This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.",
5
5
  "main": "./dist/index.es.js",
6
6
  "scripts": {