@trackunit/react-form-components 1.3.25 → 1.3.28

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/index.cjs.js CHANGED
@@ -1700,8 +1700,13 @@ exports.ScheduleVariant = void 0;
1700
1700
  const parseSchedule = (scheduleString) => {
1701
1701
  if (!scheduleString) {
1702
1702
  return {
1703
- variant: exports.ScheduleVariant.ALL_DAYS,
1704
- schedule: [],
1703
+ variant: exports.ScheduleVariant.CUSTOM,
1704
+ schedule: [1, 2, 3, 4, 5, 6, 7].map(day => ({
1705
+ day,
1706
+ range: { timeFrom: "", timeTo: "" },
1707
+ isAllDay: false,
1708
+ isActive: false,
1709
+ })),
1705
1710
  };
1706
1711
  }
1707
1712
  const schedule = scheduleString.split(",").map(daySchedule => {
@@ -1717,6 +1722,7 @@ const parseSchedule = (scheduleString) => {
1717
1722
  timeTo: timeTo,
1718
1723
  },
1719
1724
  isAllDay,
1725
+ isActive: Boolean(timeFrom) && Boolean(timeTo),
1720
1726
  };
1721
1727
  });
1722
1728
  const filteredSchedule = schedule
@@ -1725,6 +1731,7 @@ const parseSchedule = (scheduleString) => {
1725
1731
  day: daySchedule.day,
1726
1732
  range: daySchedule.range,
1727
1733
  isAllDay: daySchedule.isAllDay,
1734
+ isActive: daySchedule.isActive,
1728
1735
  }));
1729
1736
  let variant;
1730
1737
  switch (schedule.length) {
package/index.esm.js CHANGED
@@ -1681,8 +1681,13 @@ var ScheduleVariant;
1681
1681
  const parseSchedule = (scheduleString) => {
1682
1682
  if (!scheduleString) {
1683
1683
  return {
1684
- variant: ScheduleVariant.ALL_DAYS,
1685
- schedule: [],
1684
+ variant: ScheduleVariant.CUSTOM,
1685
+ schedule: [1, 2, 3, 4, 5, 6, 7].map(day => ({
1686
+ day,
1687
+ range: { timeFrom: "", timeTo: "" },
1688
+ isAllDay: false,
1689
+ isActive: false,
1690
+ })),
1686
1691
  };
1687
1692
  }
1688
1693
  const schedule = scheduleString.split(",").map(daySchedule => {
@@ -1698,6 +1703,7 @@ const parseSchedule = (scheduleString) => {
1698
1703
  timeTo: timeTo,
1699
1704
  },
1700
1705
  isAllDay,
1706
+ isActive: Boolean(timeFrom) && Boolean(timeTo),
1701
1707
  };
1702
1708
  });
1703
1709
  const filteredSchedule = schedule
@@ -1706,6 +1712,7 @@ const parseSchedule = (scheduleString) => {
1706
1712
  day: daySchedule.day,
1707
1713
  range: daySchedule.range,
1708
1714
  isAllDay: daySchedule.isAllDay,
1715
+ isActive: daySchedule.isActive,
1709
1716
  }));
1710
1717
  let variant;
1711
1718
  switch (schedule.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-form-components",
3
- "version": "1.3.25",
3
+ "version": "1.3.28",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -15,12 +15,12 @@
15
15
  "zod": "3.22.4",
16
16
  "react-hook-form": "7.53.1",
17
17
  "tailwind-merge": "^2.0.0",
18
- "@trackunit/css-class-variance-utilities": "1.3.21",
19
- "@trackunit/react-components": "1.4.21",
20
- "@trackunit/ui-icons": "1.3.21",
21
- "@trackunit/shared-utils": "1.5.21",
22
- "@trackunit/ui-design-tokens": "1.3.21",
23
- "@trackunit/i18n-library-translation": "1.3.22",
18
+ "@trackunit/css-class-variance-utilities": "1.3.23",
19
+ "@trackunit/react-components": "1.4.23",
20
+ "@trackunit/ui-icons": "1.3.23",
21
+ "@trackunit/shared-utils": "1.5.23",
22
+ "@trackunit/ui-design-tokens": "1.3.23",
23
+ "@trackunit/i18n-library-translation": "1.3.24",
24
24
  "string-ts": "^2.0.0",
25
25
  "react-select": "^5.8.0",
26
26
  "@testing-library/react": "15.0.6"
@@ -18,6 +18,7 @@ interface RawSchedule {
18
18
  day: number;
19
19
  range?: TimeRangeInput;
20
20
  isAllDay: boolean;
21
+ isActive: boolean;
21
22
  }
22
23
  export interface DaySchedule extends RawSchedule {
23
24
  range: TimeRangeInput;