@realtek/core-theme 0.0.232 → 0.0.233

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-lib/index.js CHANGED
@@ -253,11 +253,15 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
253
253
  className: `calendar-card${c ? ` ${c}` : ""}`,
254
254
  title: /* @__PURE__ */ Z("div", {
255
255
  className: "calendar-header-title",
256
- children: [/* @__PURE__ */ X(Ur, {}), /* @__PURE__ */ X(Wa, {
257
- level: 5,
258
- style: { margin: 0 },
259
- children: re
260
- })]
256
+ children: [
257
+ /* @__PURE__ */ X(Ur, {}),
258
+ /* @__PURE__ */ X(Wa, {
259
+ level: 5,
260
+ style: { margin: 0 },
261
+ children: re
262
+ }),
263
+ a
264
+ ]
261
265
  }),
262
266
  extra: /* @__PURE__ */ Z("div", {
263
267
  className: "calendar-nav",
@@ -266,29 +270,25 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
266
270
  alignItems: "center",
267
271
  gap: 6
268
272
  },
269
- children: [
270
- a,
271
- /* @__PURE__ */ X(q, {
272
- title: "Previous month",
273
- children: /* @__PURE__ */ X(z, {
274
- type: "text",
275
- icon: /* @__PURE__ */ X(Pi, {}),
276
- size: "small",
277
- onClick: M,
278
- disabled: m
279
- })
280
- }),
281
- /* @__PURE__ */ X(q, {
282
- title: "Next month",
283
- children: /* @__PURE__ */ X(z, {
284
- type: "text",
285
- icon: /* @__PURE__ */ X(ea, {}),
286
- size: "small",
287
- onClick: ee,
288
- disabled: h
289
- })
273
+ children: [/* @__PURE__ */ X(q, {
274
+ title: "Previous month",
275
+ children: /* @__PURE__ */ X(z, {
276
+ type: "text",
277
+ icon: /* @__PURE__ */ X(Pi, {}),
278
+ size: "small",
279
+ onClick: M,
280
+ disabled: m
290
281
  })
291
- ]
282
+ }), /* @__PURE__ */ X(q, {
283
+ title: "Next month",
284
+ children: /* @__PURE__ */ X(z, {
285
+ type: "text",
286
+ icon: /* @__PURE__ */ X(ea, {}),
287
+ size: "small",
288
+ onClick: ee,
289
+ disabled: h
290
+ })
291
+ })]
292
292
  }),
293
293
  children: /* @__PURE__ */ Z(Sr, {
294
294
  spinning: T,
@@ -378,7 +378,8 @@ function ro({ userIds: e = [], days: t = void 0, startDay: n = "Sun", renderDayC
378
378
  children: ne.map(({ label: e, color: t, icon: n }) => /* @__PURE__ */ Z("div", {
379
379
  className: "calendar-legend-item",
380
380
  children: [n ? /* @__PURE__ */ X("span", {
381
- className: "calendar-legend-icon",
381
+ className: "calendar-legend-badge",
382
+ style: { background: Xa(t) },
382
383
  children: n
383
384
  }) : /* @__PURE__ */ X("span", {
384
385
  className: "calendar-legend-dot",
@@ -15191,10 +15192,7 @@ function sy({ configKey: e = "timesheet", month: t, year: n }) {
15191
15192
  return t && n && La(`${n}-${t}-01`).isBefore(La().subtract(r.thresholdMonths, "month"), "month") ? /* @__PURE__ */ X(K, {
15192
15193
  color: r.pastColor,
15193
15194
  children: r.pastLabel
15194
- }) : /* @__PURE__ */ X(K, {
15195
- color: r.currentColor,
15196
- children: r.currentLabel
15197
- });
15195
+ }) : null;
15198
15196
  }
15199
15197
  var cy = {
15200
15198
  working: "timesheet-day-cell--working",
@@ -15402,16 +15400,17 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15402
15400
  let f = () => ({ validator(e, t) {
15403
15401
  let n = ly(t);
15404
15402
  return n < 0 ? Promise.reject(/* @__PURE__ */ Error("Standard Hours cannot be negative.")) : n > _y ? Promise.reject(/* @__PURE__ */ Error("Standard Hours cannot exceed 8 hours.")) : Promise.resolve();
15405
- } }), p = ({ getFieldValue: e }) => ({ validator(t, n) {
15406
- if (ly(n) < 0) return Promise.reject(/* @__PURE__ */ Error("Leave Hours cannot be negative."));
15407
- let r = ly(e("ST")), i = ly(e("Leave"));
15408
- return Math.abs(r + i - _y) <= yy ? Promise.resolve() : Promise.reject(/* @__PURE__ */ Error("Standard Hours and Leave Hours together must equal 8 hours."));
15409
- } }), m = ({ getFieldValue: e }) => ({ validator(t, n) {
15410
- let r = ly(n);
15411
- if (r < 0) return Promise.reject(/* @__PURE__ */ Error("Overtime cannot be negative."));
15412
- if (r === 0) return Promise.resolve();
15413
- let i = ly(e("ST"));
15414
- return i < _y ? Promise.reject(/* @__PURE__ */ Error("Overtime can only be entered after completing 8 standard working hours.")) : ly(e("Leave")) > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : i + r > s ? Promise.reject(/* @__PURE__ */ Error("Total working hours exceed the maximum allowed daily limit.")) : Promise.resolve();
15403
+ } }), p = ({ getFieldValue: e }) => ({ validator(n, r) {
15404
+ if (ly(r) < 0) return Promise.reject(/* @__PURE__ */ Error("Leave Hours cannot be negative."));
15405
+ if (t?.isWeekOff) return Promise.resolve();
15406
+ let i = ly(e("ST")), a = ly(e("Leave"));
15407
+ return Math.abs(i + a - _y) <= yy ? Promise.resolve() : Promise.reject(/* @__PURE__ */ Error("Standard Hours and Leave Hours together must equal 8 hours."));
15408
+ } }), m = ({ getFieldValue: e }) => ({ validator(n, r) {
15409
+ let i = ly(r);
15410
+ if (i < 0) return Promise.reject(/* @__PURE__ */ Error("Overtime cannot be negative."));
15411
+ if (i === 0) return Promise.resolve();
15412
+ let a = ly(e("ST"));
15413
+ return !t?.isWeekOff && a < _y ? Promise.reject(/* @__PURE__ */ Error("Overtime can only be entered after completing 8 standard working hours.")) : ly(e("Leave")) > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : a + i > s ? Promise.reject(/* @__PURE__ */ Error("Total working hours exceed the maximum allowed daily limit.")) : Promise.resolve();
15415
15414
  } }), h = ({ getFieldValue: e }) => ({ validator(t, n) {
15416
15415
  let r = ly(n), i = ly(e("OT"));
15417
15416
  return r > 0 && i > 0 ? Promise.reject(/* @__PURE__ */ Error("Overtime is not allowed when leave hours are recorded.")) : Promise.resolve();
@@ -15422,7 +15421,7 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15422
15421
  "Leave"
15423
15422
  ]).catch(() => {});
15424
15423
  }, _ = (e) => {
15425
- if ("ST" in e) {
15424
+ if ("ST" in e && !t?.isWeekOff) {
15426
15425
  let t = ly(e.ST), n = { Leave: by(_y - t, 0, _y) };
15427
15426
  t < _y && (n.OT = 0), c.setFieldsValue(n);
15428
15427
  }
@@ -15444,12 +15443,12 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15444
15443
  isWeekOff: !!t?.isWeekOff,
15445
15444
  notes: ""
15446
15445
  });
15447
- }, y = t?.isHoliday || t?.isWeekOff, b = t?.date ? La(t.date).format("MMM DD, YYYY") : "Log time", x = ly(l), S = ly(u), C = ly(d), w = x < _y, T = x + S, E = x + S + C;
15446
+ }, y = t?.isHoliday, b = !!t?.isWeekOff && !y, x = t?.date ? La(t.date).format("MMM DD, YYYY") : "Log time", S = ly(l), C = ly(u), w = ly(d), T = !b && S < _y, E = S + C, D = S + C + w;
15448
15447
  return /* @__PURE__ */ Z(mr, {
15449
15448
  title: /* @__PURE__ */ Z(W, { children: [
15450
15449
  /* @__PURE__ */ X(iy, {
15451
15450
  strong: !0,
15452
- children: b
15451
+ children: x
15453
15452
  }),
15454
15453
  t?.isHoliday && /* @__PURE__ */ X(K, {
15455
15454
  color: "purple",
@@ -15512,140 +15511,150 @@ function xy({ open: e, day: t, saving: n = !1, onCancel: r, onSubmit: i, onDelet
15512
15511
  }), y ? /* @__PURE__ */ X(Xn, {
15513
15512
  type: "info",
15514
15513
  showIcon: !0,
15515
- message: t?.isHoliday ? "Holiday — no manual log required." : "Week off — no log required."
15516
- }) : /* @__PURE__ */ Z(Y, { children: [/* @__PURE__ */ Z(V, {
15517
- form: c,
15518
- layout: "vertical",
15519
- className: "timesheet-log-form",
15520
- validateTrigger: ["onChange", "onBlur"],
15521
- onValuesChange: _,
15522
- children: [
15523
- /* @__PURE__ */ X(V.Item, {
15524
- name: "date",
15525
- label: "Date",
15526
- children: /* @__PURE__ */ X(ir, {
15527
- disabled: !0,
15528
- style: { width: "100%" }
15529
- })
15530
- }),
15531
- /* @__PURE__ */ X(V.Item, {
15532
- name: "ST",
15533
- label: /* @__PURE__ */ Z("span", {
15534
- style: {
15535
- color: "#1d4ed8",
15536
- fontWeight: 600
15537
- },
15538
- children: ["Standard ", /* @__PURE__ */ X("span", {
15539
- style: {
15540
- fontWeight: 400,
15541
- color: "#6b7280"
15542
- },
15543
- children: "hrs"
15544
- })]
15514
+ message: "Holiday — no manual log required."
15515
+ }) : /* @__PURE__ */ Z(Y, { children: [
15516
+ b && /* @__PURE__ */ X(Xn, {
15517
+ type: "info",
15518
+ showIcon: !0,
15519
+ message: "Weekend — logged as Overtime.",
15520
+ style: { marginBottom: 12 }
15521
+ }),
15522
+ /* @__PURE__ */ Z(V, {
15523
+ form: c,
15524
+ layout: "vertical",
15525
+ className: "timesheet-log-form",
15526
+ validateTrigger: ["onChange", "onBlur"],
15527
+ onValuesChange: _,
15528
+ children: [
15529
+ /* @__PURE__ */ X(V.Item, {
15530
+ name: "date",
15531
+ label: "Date",
15532
+ children: /* @__PURE__ */ X(ir, {
15533
+ disabled: !0,
15534
+ style: { width: "100%" }
15535
+ })
15545
15536
  }),
15546
- dependencies: ["Leave"],
15547
- rules: [f, p],
15548
- children: /* @__PURE__ */ X(ur, {
15549
- min: 0,
15550
- max: _y,
15551
- step: o,
15552
- style: { width: "100%" },
15553
- addonAfter: /* @__PURE__ */ X("span", {
15537
+ /* @__PURE__ */ X(V.Item, {
15538
+ name: "ST",
15539
+ label: /* @__PURE__ */ Z("span", {
15554
15540
  style: {
15555
15541
  color: "#1d4ed8",
15556
- fontWeight: 700
15542
+ fontWeight: 600
15557
15543
  },
15558
- children: "s"
15544
+ children: ["Standard ", /* @__PURE__ */ X("span", {
15545
+ style: {
15546
+ fontWeight: 400,
15547
+ color: "#6b7280"
15548
+ },
15549
+ children: "hrs"
15550
+ })]
15551
+ }),
15552
+ dependencies: ["Leave"],
15553
+ rules: [f, p],
15554
+ hidden: b,
15555
+ children: /* @__PURE__ */ X(ur, {
15556
+ min: 0,
15557
+ max: _y,
15558
+ step: o,
15559
+ style: { width: "100%" },
15560
+ addonAfter: /* @__PURE__ */ X("span", {
15561
+ style: {
15562
+ color: "#1d4ed8",
15563
+ fontWeight: 700
15564
+ },
15565
+ children: "s"
15566
+ })
15559
15567
  })
15560
- })
15561
- }),
15562
- /* @__PURE__ */ X(V.Item, {
15563
- name: "OT",
15564
- label: /* @__PURE__ */ Z("span", {
15565
- style: {
15566
- color: "#15803d",
15567
- fontWeight: 600
15568
- },
15569
- children: ["Overtime ", /* @__PURE__ */ X("span", {
15570
- style: {
15571
- fontWeight: 400,
15572
- color: "#6b7280"
15573
- },
15574
- children: "hrs"
15575
- })]
15576
15568
  }),
15577
- dependencies: ["ST", "Leave"],
15578
- rules: [m],
15579
- extra: w ? "Complete 8 standard hours to log overtime." : void 0,
15580
- children: /* @__PURE__ */ X(ur, {
15581
- min: 0,
15582
- max: s,
15583
- step: o,
15584
- style: { width: "100%" },
15585
- disabled: w,
15586
- addonAfter: /* @__PURE__ */ X("span", {
15569
+ /* @__PURE__ */ X(V.Item, {
15570
+ name: "OT",
15571
+ label: /* @__PURE__ */ Z("span", {
15587
15572
  style: {
15588
15573
  color: "#15803d",
15589
- fontWeight: 700
15574
+ fontWeight: 600
15590
15575
  },
15591
- children: "o"
15576
+ children: ["Overtime ", /* @__PURE__ */ X("span", {
15577
+ style: {
15578
+ fontWeight: 400,
15579
+ color: "#6b7280"
15580
+ },
15581
+ children: "hrs"
15582
+ })]
15583
+ }),
15584
+ dependencies: ["ST", "Leave"],
15585
+ rules: [m],
15586
+ extra: T ? "Complete 8 standard hours to log overtime." : void 0,
15587
+ children: /* @__PURE__ */ X(ur, {
15588
+ min: 0,
15589
+ max: s,
15590
+ step: o,
15591
+ style: { width: "100%" },
15592
+ disabled: T,
15593
+ addonAfter: /* @__PURE__ */ X("span", {
15594
+ style: {
15595
+ color: "#15803d",
15596
+ fontWeight: 700
15597
+ },
15598
+ children: "o"
15599
+ })
15592
15600
  })
15593
- })
15594
- }),
15595
- /* @__PURE__ */ X(V.Item, {
15596
- name: "Leave",
15597
- label: /* @__PURE__ */ Z("span", {
15598
- style: {
15599
- color: "#b45309",
15600
- fontWeight: 600
15601
- },
15602
- children: ["Leave ", /* @__PURE__ */ X("span", {
15603
- style: {
15604
- fontWeight: 400,
15605
- color: "#6b7280"
15606
- },
15607
- children: "hrs"
15608
- })]
15609
15601
  }),
15610
- dependencies: ["ST", "OT"],
15611
- rules: [p, h],
15612
- children: /* @__PURE__ */ X(ur, {
15613
- min: 0,
15614
- max: _y,
15615
- step: o,
15616
- style: { width: "100%" },
15617
- addonAfter: /* @__PURE__ */ X("span", {
15602
+ /* @__PURE__ */ X(V.Item, {
15603
+ name: "Leave",
15604
+ label: /* @__PURE__ */ Z("span", {
15618
15605
  style: {
15619
15606
  color: "#b45309",
15620
- fontWeight: 700
15607
+ fontWeight: 600
15621
15608
  },
15622
- children: "L"
15609
+ children: ["Leave ", /* @__PURE__ */ X("span", {
15610
+ style: {
15611
+ fontWeight: 400,
15612
+ color: "#6b7280"
15613
+ },
15614
+ children: "hrs"
15615
+ })]
15616
+ }),
15617
+ dependencies: ["ST", "OT"],
15618
+ rules: [p, h],
15619
+ children: /* @__PURE__ */ X(ur, {
15620
+ min: 0,
15621
+ max: _y,
15622
+ step: o,
15623
+ style: { width: "100%" },
15624
+ addonAfter: /* @__PURE__ */ X("span", {
15625
+ style: {
15626
+ color: "#b45309",
15627
+ fontWeight: 700
15628
+ },
15629
+ children: "L"
15630
+ })
15623
15631
  })
15624
15632
  })
15625
- })
15626
- ]
15627
- }), /* @__PURE__ */ Z("div", {
15628
- className: "timesheet-log-summary",
15629
- children: [/* @__PURE__ */ Z("div", {
15630
- className: "timesheet-log-summary__row",
15631
- children: [/* @__PURE__ */ X(iy, {
15632
- type: "secondary",
15633
- children: "Worked (Standard + Overtime)"
15634
- }), /* @__PURE__ */ X(iy, {
15635
- strong: !0,
15636
- children: uy(T)
15637
- })]
15638
- }), /* @__PURE__ */ Z("div", {
15639
- className: "timesheet-log-summary__row",
15640
- children: [/* @__PURE__ */ X(iy, {
15641
- type: "secondary",
15642
- children: "Day Total"
15643
- }), /* @__PURE__ */ X(iy, {
15644
- strong: !0,
15645
- children: uy(E)
15633
+ ]
15634
+ }),
15635
+ /* @__PURE__ */ Z("div", {
15636
+ className: "timesheet-log-summary",
15637
+ children: [/* @__PURE__ */ Z("div", {
15638
+ className: "timesheet-log-summary__row",
15639
+ children: [/* @__PURE__ */ X(iy, {
15640
+ type: "secondary",
15641
+ children: "Worked (Standard + Overtime)"
15642
+ }), /* @__PURE__ */ X(iy, {
15643
+ strong: !0,
15644
+ children: uy(E)
15645
+ })]
15646
+ }), /* @__PURE__ */ Z("div", {
15647
+ className: "timesheet-log-summary__row",
15648
+ children: [/* @__PURE__ */ X(iy, {
15649
+ type: "secondary",
15650
+ children: "Day Total"
15651
+ }), /* @__PURE__ */ X(iy, {
15652
+ strong: !0,
15653
+ children: uy(D)
15654
+ })]
15646
15655
  })]
15647
- })]
15648
- })] })]
15656
+ })
15657
+ ] })]
15649
15658
  });
15650
15659
  }
15651
15660
  function Sy({ count: e = 0, total: t = 0, hours: n = 8, loading: r = !1, onConfirm: i, onCancel: a, onSelectAll: o, onSelectNone: s }) {