aq-fe-framework 0.1.330 → 0.1.332

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.
@@ -362,9 +362,33 @@ function MyLabelValueRow({
362
362
  ] }));
363
363
  }
364
364
 
365
+ // src/core/dataDisplay/MyStatsCartd.tsx
366
+ import { Box, Card, ThemeIcon } from "@mantine/core";
367
+ import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
368
+ function MyStatsCard({
369
+ title,
370
+ value,
371
+ subtitle,
372
+ icon,
373
+ color,
374
+ themeIconProps
375
+ }) {
376
+ return /* @__PURE__ */ jsxs4(Card, { children: [
377
+ /* @__PURE__ */ jsx7("div", { className: `absolute inset-0 bg-gradient-to-br ${color} opacity-5` }),
378
+ /* @__PURE__ */ jsx7(Box, { className: "p-6", children: /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between", children: [
379
+ /* @__PURE__ */ jsxs4("div", { children: [
380
+ /* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-muted-foreground", children: title }),
381
+ /* @__PURE__ */ jsx7("p", { className: "text-3xl font-bold", children: value }),
382
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground mt-1", children: subtitle })
383
+ ] }),
384
+ /* @__PURE__ */ jsx7(ThemeIcon, __spreadProps(__spreadValues({ size: "xl", radius: "xl" }, themeIconProps), { children: icon }))
385
+ ] }) })
386
+ ] });
387
+ }
388
+
365
389
  // src/core/input/MyDayOfWeekPicker.tsx
366
390
  import { Badge, Group as Group2 } from "@mantine/core";
367
- import { jsx as jsx7 } from "react/jsx-runtime";
391
+ import { jsx as jsx8 } from "react/jsx-runtime";
368
392
  var days = Object.entries(enum_daysOfWeek).filter(([key]) => isNaN(Number(key))).map(([label, value]) => ({ label, value }));
369
393
  function MyDayOfWeekPicker({ value = [], onChange }) {
370
394
  const toggle = (val) => {
@@ -372,7 +396,7 @@ function MyDayOfWeekPicker({ value = [], onChange }) {
372
396
  const newValue = value.includes(val) ? value.filter((v) => v !== val) : [...value, val].sort((a, b) => a - b);
373
397
  onChange(newValue);
374
398
  };
375
- return /* @__PURE__ */ jsx7(MyFlexRow, { align: "center", children: /* @__PURE__ */ jsx7(Group2, { gap: "xs", children: days.map((d) => /* @__PURE__ */ jsx7(
399
+ return /* @__PURE__ */ jsx8(MyFlexRow, { align: "center", children: /* @__PURE__ */ jsx8(Group2, { gap: "xs", children: days.map((d) => /* @__PURE__ */ jsx8(
376
400
  Badge,
377
401
  {
378
402
  variant: value.includes(d.value) ? "filled" : "outline",
@@ -389,10 +413,10 @@ function MyDayOfWeekPicker({ value = [], onChange }) {
389
413
 
390
414
  // src/core/input/MyTextInput.tsx
391
415
  import { TextInput } from "@mantine/core";
392
- import { jsx as jsx8 } from "react/jsx-runtime";
416
+ import { jsx as jsx9 } from "react/jsx-runtime";
393
417
  function MyTextInput(_a) {
394
418
  var _b = _a, { label, isPhoneNumber } = _b, rest = __objRest(_b, ["label", "isPhoneNumber"]);
395
- return /* @__PURE__ */ jsx8(
419
+ return /* @__PURE__ */ jsx9(
396
420
  TextInput,
397
421
  __spreadValues({
398
422
  onKeyDown: (e) => {
@@ -433,7 +457,7 @@ import {
433
457
  } from "@mantine/core";
434
458
  import { IconPlus as IconPlus4, IconTrash as IconTrash3 } from "@tabler/icons-react";
435
459
  import { useState as useState2 } from "react";
436
- import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
460
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
437
461
  function MyWeeklySessionSchedulerPicker({
438
462
  value = [],
439
463
  onChange
@@ -464,8 +488,8 @@ function MyWeeklySessionSchedulerPicker({
464
488
  return acc;
465
489
  }, {});
466
490
  const getLabel = (day) => enum_daysOfWeek[day] || `Day ${day}`;
467
- return /* @__PURE__ */ jsx9(Paper, { w: "100%", p: "md", children: /* @__PURE__ */ jsxs4(MyFlexColumn, { children: [
468
- /* @__PURE__ */ jsx9(Center, { children: /* @__PURE__ */ jsx9(
491
+ return /* @__PURE__ */ jsx10(Paper, { w: "100%", p: "md", children: /* @__PURE__ */ jsxs5(MyFlexColumn, { children: [
492
+ /* @__PURE__ */ jsx10(Center, { children: /* @__PURE__ */ jsx10(
469
493
  MyDayOfWeekPicker,
470
494
  {
471
495
  value: selectedDays,
@@ -475,41 +499,41 @@ function MyWeeklySessionSchedulerPicker({
475
499
  }
476
500
  }
477
501
  ) }),
478
- /* @__PURE__ */ jsx9(Divider, { my: "xs" }),
479
- /* @__PURE__ */ jsx9(Center, { children: /* @__PURE__ */ jsx9(ScrollArea.Autosize, { h: "40vh", children: /* @__PURE__ */ jsx9(MyFlexColumn, { w: { base: "100%", sm: "70%" }, children: selectedDays.map((dayOfWeek) => {
502
+ /* @__PURE__ */ jsx10(Divider, { my: "xs" }),
503
+ /* @__PURE__ */ jsx10(Center, { children: /* @__PURE__ */ jsx10(ScrollArea.Autosize, { h: "40vh", children: /* @__PURE__ */ jsx10(MyFlexColumn, { w: { base: "100%", sm: "70%" }, children: selectedDays.map((dayOfWeek) => {
480
504
  var _a;
481
- return /* @__PURE__ */ jsxs4(
505
+ return /* @__PURE__ */ jsxs5(
482
506
  Paper,
483
507
  {
484
508
  w: "100%",
485
509
  p: "md",
486
510
  bg: const_object_colors.mantineBackgroundBlueLight,
487
511
  children: [
488
- /* @__PURE__ */ jsxs4(Group3, { gap: "apart", children: [
489
- /* @__PURE__ */ jsx9(Text3, { w: "70px", fw: 500, children: getLabel(dayOfWeek) }),
490
- /* @__PURE__ */ jsx9(
512
+ /* @__PURE__ */ jsxs5(Group3, { gap: "apart", children: [
513
+ /* @__PURE__ */ jsx10(Text3, { w: "70px", fw: 500, children: getLabel(dayOfWeek) }),
514
+ /* @__PURE__ */ jsx10(
491
515
  Button5,
492
516
  {
493
517
  color: "teal.5",
494
- leftSection: /* @__PURE__ */ jsx9(IconPlus4, { size: 14 }),
518
+ leftSection: /* @__PURE__ */ jsx10(IconPlus4, { size: 14 }),
495
519
  onClick: () => handleAddSession(dayOfWeek),
496
520
  children: "Th\xEAm bu\u1ED5i"
497
521
  }
498
522
  )
499
523
  ] }),
500
- /* @__PURE__ */ jsx9(Divider, { my: "sm" }),
524
+ /* @__PURE__ */ jsx10(Divider, { my: "sm" }),
501
525
  (_a = grouped[dayOfWeek]) == null ? void 0 : _a.map((item, indexInDay) => {
502
526
  const globalIndex = value.findIndex(
503
527
  (v) => v === item
504
528
  );
505
- return /* @__PURE__ */ jsxs4(
529
+ return /* @__PURE__ */ jsxs5(
506
530
  Group3,
507
531
  {
508
532
  mt: "xs",
509
533
  gap: "xs",
510
534
  align: "flex-end",
511
535
  children: [
512
- /* @__PURE__ */ jsx9(
536
+ /* @__PURE__ */ jsx10(
513
537
  NumberInput,
514
538
  {
515
539
  label: "Ti\u1EBFt b\u1EAFt \u0111\u1EA7u",
@@ -521,7 +545,7 @@ function MyWeeklySessionSchedulerPicker({
521
545
  )
522
546
  }
523
547
  ),
524
- /* @__PURE__ */ jsx9(
548
+ /* @__PURE__ */ jsx10(
525
549
  NumberInput,
526
550
  {
527
551
  label: "S\u1ED1 ti\u1EBFt",
@@ -533,7 +557,7 @@ function MyWeeklySessionSchedulerPicker({
533
557
  )
534
558
  }
535
559
  ),
536
- /* @__PURE__ */ jsx9(
560
+ /* @__PURE__ */ jsx10(
537
561
  NumberInput,
538
562
  {
539
563
  label: "S\u1ED1 ph\xFAt ",
@@ -542,13 +566,13 @@ function MyWeeklySessionSchedulerPicker({
542
566
  value: item.durationMinutes
543
567
  }
544
568
  ),
545
- /* @__PURE__ */ jsx9(
569
+ /* @__PURE__ */ jsx10(
546
570
  Button5,
547
571
  {
548
572
  variant: "light",
549
573
  color: "red",
550
574
  onClick: () => handleRemove(globalIndex),
551
- leftSection: /* @__PURE__ */ jsx9(IconTrash3, { size: 14 }),
575
+ leftSection: /* @__PURE__ */ jsx10(IconTrash3, { size: 14 }),
552
576
  children: "X\xF3a bu\u1ED5i"
553
577
  }
554
578
  )
@@ -565,6 +589,14 @@ function MyWeeklySessionSchedulerPicker({
565
589
  ] }) });
566
590
  }
567
591
 
592
+ // src/core/layout/MyFlexColumn.tsx
593
+ import { Flex } from "@mantine/core";
594
+ import { jsx as jsx11 } from "react/jsx-runtime";
595
+ function MyFlexColumn2(_a) {
596
+ var _b = _a, { children } = _b, rest = __objRest(_b, ["children"]);
597
+ return /* @__PURE__ */ jsx11(Flex, __spreadProps(__spreadValues({ direction: "column", gap: "md" }, rest), { children }));
598
+ }
599
+
568
600
  export {
569
601
  MyActionIcon,
570
602
  MyButton,
@@ -572,7 +604,9 @@ export {
572
604
  MyButtonModal,
573
605
  MyDataTableSelectOne,
574
606
  MyLabelValueRow,
607
+ MyStatsCard,
575
608
  MyDayOfWeekPicker,
576
609
  MyTextInput,
577
- MyWeeklySessionSchedulerPicker
610
+ MyWeeklySessionSchedulerPicker,
611
+ MyFlexColumn2 as MyFlexColumn
578
612
  };
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { t as type_action } from '../types-B5rmBuXz.mjs';
3
- import { ActionIconProps, ButtonProps, ModalProps, TextProps, GroupProps, TextInputProps } from '@mantine/core';
3
+ import { ActionIconProps, ButtonProps, ModalProps, TextProps, GroupProps, ThemeIconProps, TextInputProps, FlexProps } from '@mantine/core';
4
4
  import { ReactNode } from 'react';
5
5
  import { M as MyApiResponse } from '../createBaseApi-2GYRG_xt.mjs';
6
6
  import { AxiosResponse } from 'axios';
@@ -62,6 +62,15 @@ interface LabelValueRowProps {
62
62
  }
63
63
  declare function MyLabelValueRow({ label, value, labelProps, valueProps, groupProps }: LabelValueRowProps): react_jsx_runtime.JSX.Element;
64
64
 
65
+ declare function MyStatsCard({ title, value, subtitle, icon, color, themeIconProps }: {
66
+ title: string;
67
+ value: number;
68
+ subtitle: string;
69
+ icon: ReactNode;
70
+ color: string;
71
+ themeIconProps?: ThemeIconProps;
72
+ }): react_jsx_runtime.JSX.Element;
73
+
65
74
  interface CoreDayOfWeekPickerProps {
66
75
  value?: number[];
67
76
  onChange?: (val: number[]) => void;
@@ -87,4 +96,9 @@ interface WeeklySessionSchedulerProps {
87
96
  }
88
97
  declare function MyWeeklySessionSchedulerPicker({ value, onChange, }: WeeklySessionSchedulerProps): react_jsx_runtime.JSX.Element;
89
98
 
90
- export { type IWeeklySession, MyActionIcon, MyButton, MyButtonCreateUpdate, MyButtonModal, MyDataTableSelectOne, MyDayOfWeekPicker, MyLabelValueRow, MyTextInput, MyWeeklySessionSchedulerPicker, type WeeklySessionSchedulerProps };
99
+ interface IMyFlexColumn extends FlexProps {
100
+ children?: ReactNode;
101
+ }
102
+ declare function MyFlexColumn({ children, ...rest }: IMyFlexColumn): react_jsx_runtime.JSX.Element;
103
+
104
+ export { type IWeeklySession, MyActionIcon, MyButton, MyButtonCreateUpdate, MyButtonModal, MyDataTableSelectOne, MyDayOfWeekPicker, MyFlexColumn, MyLabelValueRow, MyStatsCard, MyTextInput, MyWeeklySessionSchedulerPicker, type WeeklySessionSchedulerProps };
@@ -5,10 +5,12 @@ import {
5
5
  MyButtonModal,
6
6
  MyDataTableSelectOne,
7
7
  MyDayOfWeekPicker,
8
+ MyFlexColumn,
8
9
  MyLabelValueRow,
10
+ MyStatsCard,
9
11
  MyTextInput,
10
12
  MyWeeklySessionSchedulerPicker
11
- } from "../chunk-WEZ3M7EQ.mjs";
13
+ } from "../chunk-WXLN7SEF.mjs";
12
14
  import "../chunk-GEYCGM75.mjs";
13
15
  import "../chunk-NWBLJ3W3.mjs";
14
16
  import "../chunk-K6S7R6LU.mjs";
@@ -22,7 +24,9 @@ export {
22
24
  MyButtonModal,
23
25
  MyDataTableSelectOne,
24
26
  MyDayOfWeekPicker,
27
+ MyFlexColumn,
25
28
  MyLabelValueRow,
29
+ MyStatsCard,
26
30
  MyTextInput,
27
31
  MyWeeklySessionSchedulerPicker
28
32
  };
@@ -11,6 +11,9 @@ import {
11
11
  import {
12
12
  U0DateToDDMMYYYString
13
13
  } from "../chunk-I2XIN2R3.mjs";
14
+ import {
15
+ const_object_documentTypes
16
+ } from "../chunk-BZMQOGL6.mjs";
14
17
  import {
15
18
  F_authenticate_Logout,
16
19
  MyActionIconDelete,
@@ -38,14 +41,11 @@ import {
38
41
  createGenericStore
39
42
  } from "../chunk-Y3YGC5IH.mjs";
40
43
  import "../chunk-5U2JSHSJ.mjs";
41
- import {
42
- const_object_documentTypes
43
- } from "../chunk-BZMQOGL6.mjs";
44
44
  import {
45
45
  MyButton as MyButton2,
46
46
  MyDataTableSelectOne,
47
47
  MyTextInput as MyTextInput2
48
- } from "../chunk-WEZ3M7EQ.mjs";
48
+ } from "../chunk-WXLN7SEF.mjs";
49
49
  import {
50
50
  MyDataTable,
51
51
  MyFlexColumn,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.330",
45
+ "version": "0.1.332",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"