aq-fe-framework 0.1.380 → 0.1.383

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.
@@ -3,12 +3,12 @@ import {
3
3
  MyFlexColumn,
4
4
  MyFlexRow
5
5
  } from "./chunk-GEYCGM75.mjs";
6
- import {
7
- const_object_colors
8
- } from "./chunk-7ORPZMGL.mjs";
9
6
  import {
10
7
  enum_daysOfWeek
11
8
  } from "./chunk-K6S7R6LU.mjs";
9
+ import {
10
+ const_object_colors
11
+ } from "./chunk-7ORPZMGL.mjs";
12
12
  import {
13
13
  baseAxios_default,
14
14
  useMyReactMutation,
@@ -610,33 +610,46 @@ function MySelect(_a) {
610
610
  }
611
611
 
612
612
  // src/core/input/MySelectAPI.tsx
613
+ import { useEffect as useEffect3, useMemo as useMemo2 } from "react";
613
614
  import { jsx as jsx11 } from "react/jsx-runtime";
614
615
  function MySelectFromAPI(_a) {
615
616
  var _b = _a, {
616
- endPoint = ""
617
+ endPoint = "",
618
+ value,
619
+ onChange
617
620
  } = _b, rest = __objRest(_b, [
618
- "endPoint"
621
+ "endPoint",
622
+ "value",
623
+ "onChange"
619
624
  ]);
620
- var _a2, _b2;
621
625
  const query = useMyReactQuery({
622
626
  queryKey: [endPoint],
623
627
  axiosFn: () => {
624
628
  return baseAxios_default.get(endPoint);
625
629
  }
626
630
  });
631
+ const options = useMemo2(() => {
632
+ var _a2, _b2;
633
+ return (_b2 = (_a2 = query.data) == null ? void 0 : _a2.map((item) => {
634
+ var _a3;
635
+ return {
636
+ value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
637
+ label: item.name
638
+ };
639
+ })) != null ? _b2 : [];
640
+ }, [query.data]);
641
+ useEffect3(() => {
642
+ const firstOption = options[0];
643
+ onChange == null ? void 0 : onChange(firstOption.value, firstOption);
644
+ }, []);
627
645
  return /* @__PURE__ */ jsx11(
628
646
  MySelect,
629
647
  __spreadValues({
630
648
  isLoading: query.isLoading,
631
649
  isError: query.isError,
632
- defaultValue: (_a2 = query.data[0].id) == null ? void 0 : _a2.toString(),
633
- data: (_b2 = query.data) == null ? void 0 : _b2.map((item) => {
634
- var _a3;
635
- return {
636
- value: (_a3 = item.id) == null ? void 0 : _a3.toString(),
637
- label: item.name
638
- };
639
- })
650
+ data: options,
651
+ value,
652
+ onChange
640
653
  }, rest)
641
654
  );
642
655
  }
@@ -106,7 +106,7 @@ declare function MySelect({ label, data, isLoading, isError, ...rest }: MySelect
106
106
  interface MySelectFromAPIProps extends Omit<MySelectProps, "isLoading" | "isError"> {
107
107
  endPoint?: string;
108
108
  }
109
- declare function MySelectFromAPI({ endPoint, ...rest }: MySelectFromAPIProps): react_jsx_runtime.JSX.Element;
109
+ declare function MySelectFromAPI({ endPoint, value, onChange, ...rest }: MySelectFromAPIProps): react_jsx_runtime.JSX.Element;
110
110
 
111
111
  interface CoreTextInputProps extends TextInputProps {
112
112
  label?: string;
@@ -13,10 +13,10 @@ import {
13
13
  MyStatsCard,
14
14
  MyTextInput,
15
15
  MyWeeklySessionSchedulerPicker
16
- } from "../chunk-5XMZGAQH.mjs";
16
+ } from "../chunk-NOP6TRFO.mjs";
17
17
  import "../chunk-GEYCGM75.mjs";
18
- import "../chunk-7ORPZMGL.mjs";
19
18
  import "../chunk-K6S7R6LU.mjs";
19
+ import "../chunk-7ORPZMGL.mjs";
20
20
  import "../chunk-E3O2BCYD.mjs";
21
21
  import "../chunk-7ZCOFATU.mjs";
22
22
  import "../chunk-FWCSY2DS.mjs";
@@ -38,26 +38,26 @@ import {
38
38
  createGenericStore
39
39
  } from "../chunk-Y3YGC5IH.mjs";
40
40
  import "../chunk-5U2JSHSJ.mjs";
41
+ import {
42
+ enum_emailConfigModule
43
+ } from "../chunk-VH4ZAD6M.mjs";
41
44
  import {
42
45
  MyButton as MyButton2,
43
46
  MyDataTableSelectOne,
44
47
  MyTextInput as MyTextInput2
45
- } from "../chunk-5XMZGAQH.mjs";
48
+ } from "../chunk-NOP6TRFO.mjs";
46
49
  import {
47
50
  MyDataTable,
48
51
  MyFlexColumn,
49
52
  MyFlexRow
50
53
  } from "../chunk-GEYCGM75.mjs";
54
+ import "../chunk-K6S7R6LU.mjs";
51
55
  import {
52
56
  const_object_documentTypes
53
57
  } from "../chunk-BZMQOGL6.mjs";
54
58
  import {
55
59
  const_object_colors
56
60
  } from "../chunk-7ORPZMGL.mjs";
57
- import {
58
- enum_emailConfigModule
59
- } from "../chunk-VH4ZAD6M.mjs";
60
- import "../chunk-K6S7R6LU.mjs";
61
61
  import {
62
62
  baseAxios_default,
63
63
  createBaseApi,
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "types": "./dist/columns/index.d.mts"
43
43
  }
44
44
  },
45
- "version": "0.1.380",
45
+ "version": "0.1.383",
46
46
  "private": false,
47
47
  "files": [
48
48
  "dist"