@gusto/embedded-react-sdk 0.46.0 → 0.46.2

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.
Files changed (152) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/dist/components/Common/DataView/DataCards/DataCards.d.ts +2 -1
  3. package/dist/components/Common/DataView/DataCards/DataCards.js +14 -13
  4. package/dist/components/Common/DataView/DataCards/DataCards.js.map +1 -1
  5. package/dist/components/Common/DataView/DataTable/DataTable.d.ts +2 -1
  6. package/dist/components/Common/DataView/DataTable/DataTable.js +51 -50
  7. package/dist/components/Common/DataView/DataTable/DataTable.js.map +1 -1
  8. package/dist/components/Common/DataView/DataView.d.ts +1 -0
  9. package/dist/components/Common/DataView/DataView.js.map +1 -1
  10. package/dist/components/Common/DataView/useDataView.d.ts +8 -1
  11. package/dist/components/Common/DataView/useDataView.js +20 -17
  12. package/dist/components/Common/DataView/useDataView.js.map +1 -1
  13. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.d.ts +9 -0
  14. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js +76 -0
  15. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.js.map +1 -0
  16. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js +8 -0
  17. package/dist/components/Employee/Compensation/management/AddAnotherJob/AddAnotherJob.module.scss.js.map +1 -0
  18. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js +57 -202
  19. package/dist/components/Employee/Compensation/management/EditCompensation/EditCompensation.js.map +1 -1
  20. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.d.ts +25 -0
  21. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js +81 -0
  22. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.js.map +1 -0
  23. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js +8 -0
  24. package/dist/components/Employee/Compensation/management/EditPendingCompensation/EditPendingCompensation.module.scss.js.map +1 -0
  25. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.d.ts +18 -0
  26. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js +171 -0
  27. package/dist/components/Employee/Compensation/management/ManagementCompensationFormBody.js.map +1 -0
  28. package/dist/components/Employee/Compensation/management/index.d.ts +3 -0
  29. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.d.ts +6 -1
  30. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js +67 -209
  31. package/dist/components/Employee/Compensation/onboarding/EditCompensation/EditCompensation.js.map +1 -1
  32. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.d.ts +18 -0
  33. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js +169 -0
  34. package/dist/components/Employee/Compensation/shared/AddCompensationFormBody.js.map +1 -0
  35. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.d.ts +16 -0
  36. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js +36 -30
  37. package/dist/components/Employee/Compensation/shared/useCompensationForm/compensationSchema.js.map +1 -1
  38. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.d.ts +1 -1
  39. package/dist/components/Employee/Compensation/shared/useCompensationForm/fields.js.map +1 -1
  40. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js +213 -191
  41. package/dist/components/Employee/Compensation/shared/useCompensationForm/useCompensationForm.js.map +1 -1
  42. package/dist/components/Employee/Dashboard/Dashboard.js +65 -53
  43. package/dist/components/Employee/Dashboard/Dashboard.js.map +1 -1
  44. package/dist/components/Employee/Dashboard/DashboardComponents.d.ts +3 -3
  45. package/dist/components/Employee/Dashboard/DashboardComponents.js +138 -101
  46. package/dist/components/Employee/Dashboard/DashboardComponents.js.map +1 -1
  47. package/dist/components/Employee/Dashboard/JobAndPayView.js +340 -320
  48. package/dist/components/Employee/Dashboard/JobAndPayView.js.map +1 -1
  49. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js +5 -3
  50. package/dist/components/Employee/Dashboard/JobAndPayView.module.scss.js.map +1 -1
  51. package/dist/components/Employee/Dashboard/dashboardStateMachine.js +147 -148
  52. package/dist/components/Employee/Dashboard/dashboardStateMachine.js.map +1 -1
  53. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.d.ts +6 -0
  54. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js +13 -12
  55. package/dist/components/Employee/Dashboard/getPendingCompensationChanges.js.map +1 -1
  56. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.d.ts +2 -2
  57. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js +34 -35
  58. package/dist/components/Employee/Dashboard/hooks/useEmployeeCompensation.js.map +1 -1
  59. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js +37 -40
  60. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeList.js.map +1 -1
  61. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.d.ts +1 -2
  62. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js +64 -71
  63. package/dist/components/Employee/EmployeeList/management/ManagementEmployeeListView.js.map +1 -1
  64. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.d.ts +2 -0
  65. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js +25 -0
  66. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlow.js.map +1 -0
  67. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.d.ts +13 -0
  68. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js +37 -0
  69. package/dist/components/Employee/EmployeeListFlow/EmployeeListFlowComponents.js.map +1 -0
  70. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.d.ts +6 -0
  71. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js +69 -0
  72. package/dist/components/Employee/EmployeeListFlow/employeeListStateMachine.js.map +1 -0
  73. package/dist/components/Employee/EmployeeListFlow/index.d.ts +3 -0
  74. package/dist/components/Employee/HomeAddress/management/HomeAddress.js +15 -12
  75. package/dist/components/Employee/HomeAddress/management/HomeAddress.js.map +1 -1
  76. package/dist/components/Employee/HomeAddress/management/HomeAddressView.d.ts +2 -1
  77. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js +86 -83
  78. package/dist/components/Employee/HomeAddress/management/HomeAddressView.js.map +1 -1
  79. package/dist/components/Employee/WorkAddress/management/WorkAddress.js +14 -11
  80. package/dist/components/Employee/WorkAddress/management/WorkAddress.js.map +1 -1
  81. package/dist/components/Employee/WorkAddress/management/WorkAddressView.d.ts +2 -1
  82. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js +92 -89
  83. package/dist/components/Employee/WorkAddress/management/WorkAddressView.js.map +1 -1
  84. package/dist/components/Employee/exports/employeeManagement.d.ts +2 -0
  85. package/dist/components/Employee/exports/employeeManagement.js +18 -16
  86. package/dist/components/Employee/exports/employeeManagement.js.map +1 -1
  87. package/dist/components/Employee/index.d.ts +2 -0
  88. package/dist/components/Employee/index.js +32 -30
  89. package/dist/components/Employee/index.js.map +1 -1
  90. package/dist/components/Flow/FlowHeader.js +34 -31
  91. package/dist/components/Flow/FlowHeader.js.map +1 -1
  92. package/dist/components/Flow/useFlow.d.ts +12 -0
  93. package/dist/components/Flow/useFlow.js.map +1 -1
  94. package/dist/components/TimeOff/PolicyList/PolicyList.js +92 -69
  95. package/dist/components/TimeOff/PolicyList/PolicyList.js.map +1 -1
  96. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js +23 -23
  97. package/dist/components/TimeOff/PolicyList/PolicyListPresentation.js.map +1 -1
  98. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.d.ts +1 -1
  99. package/dist/components/TimeOff/TimeOffFlow/TimeOffFlowComponents.js.map +1 -1
  100. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js +73 -56
  101. package/dist/components/TimeOff/TimeOffFlow/timeOffStateMachine.js.map +1 -1
  102. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js +58 -58
  103. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationForm.js.map +1 -1
  104. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.d.ts +1 -1
  105. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js +91 -87
  106. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.js.map +1 -1
  107. package/dist/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormTypes.d.ts +2 -0
  108. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js +91 -124
  109. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesHoliday.js.map +1 -1
  110. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.d.ts +1 -1
  111. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js +72 -87
  112. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentation.js.map +1 -1
  113. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesPresentationTypes.d.ts +1 -6
  114. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js +160 -220
  115. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/SelectEmployeesTimeOff.js.map +1 -1
  116. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.d.ts +7 -3
  117. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js +77 -54
  118. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.js.map +1 -1
  119. package/dist/components/TimeOff/TimeOffManagement/SelectEmployees/useSelectEmployeesData.test.d.ts +1 -0
  120. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js +12 -11
  121. package/dist/components/TimeOff/TimeOffPolicyDetail/EditEmployeeBalanceModal.js.map +1 -1
  122. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js +177 -147
  123. package/dist/components/TimeOff/TimeOffPolicyDetail/TimeOffPolicyDetail.js.map +1 -1
  124. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.d.ts +1 -1
  125. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js +38 -36
  126. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTable.js.map +1 -1
  127. package/dist/components/TimeOff/shared/EmployeeTable/EmployeeTableTypes.d.ts +2 -0
  128. package/dist/i18n/en/Company.TimeOff.SelectEmployees.json.js +10 -10
  129. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js +17 -15
  130. package/dist/i18n/en/Company.TimeOff.TimeOffPolicies.json.js.map +1 -1
  131. package/dist/i18n/en/Company.TimeOff.TimeOffPolicyDetails.json.js +9 -9
  132. package/dist/i18n/en/Employee.Compensation.json.js +64 -56
  133. package/dist/i18n/en/Employee.Compensation.json.js.map +1 -1
  134. package/dist/i18n/en/Employee.Dashboard.json.js +26 -24
  135. package/dist/i18n/en/Employee.Dashboard.json.js.map +1 -1
  136. package/dist/i18n/en/Employee.HomeAddress.Management.json.js +12 -10
  137. package/dist/i18n/en/Employee.HomeAddress.Management.json.js.map +1 -1
  138. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js +32 -30
  139. package/dist/i18n/en/Employee.ManagementEmployeeList.json.js.map +1 -1
  140. package/dist/i18n/en/Employee.WorkAddress.Management.json.js +16 -14
  141. package/dist/i18n/en/Employee.WorkAddress.Management.json.js.map +1 -1
  142. package/dist/i18n/en/common.json.d.ts +14 -0
  143. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js +33 -32
  144. package/dist/partner-hook-utils/form/fields/DatePickerHookField.js.map +1 -1
  145. package/dist/partner-hook-utils/types.d.ts +4 -0
  146. package/dist/shared/constants.d.ts +2 -0
  147. package/dist/shared/constants.js +13 -12
  148. package/dist/shared/constants.js.map +1 -1
  149. package/dist/style.css +1 -1
  150. package/dist/types/i18next.d.ts +26 -12
  151. package/docs/reference/endpoint-inventory.json +24 -8
  152. package/package.json +1 -1
@@ -1,63 +1,64 @@
1
- import { jsx as a, jsxs as r, Fragment as h } from "react/jsx-runtime";
2
- import { useId as z, useMemo as s, useEffect as L, useCallback as J } from "react";
3
- import { useForm as K, useWatch as m, FormProvider as Q } from "react-hook-form";
4
- import { useTranslation as X } from "react-i18next";
1
+ import { jsx as a, jsxs as t, Fragment as v } from "react/jsx-runtime";
2
+ import { useId as J, useMemo as c, useEffect as O, useCallback as K } from "react";
3
+ import { useForm as Q, useWatch as u, FormProvider as X } from "react-hook-form";
4
+ import { useTranslation as Z } from "react-i18next";
5
5
  import o from "./PolicyConfigurationForm.module.scss.js";
6
- import { Flex as u } from "../../../Common/Flex/Flex.js";
6
+ import { Flex as d } from "../../../Common/Flex/Flex.js";
7
7
  import "classnames";
8
8
  import "../../../../shared/constants.js";
9
- import { ActionsLayout as Z } from "../../../Common/ActionsLayout/ActionsLayout.js";
10
- import { Form as $ } from "../../../Common/Form/Form.js";
11
- import { useComponentContext as ee } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
- import { useLocale as ae } from "../../../../contexts/LocaleProvider/useLocale.js";
13
- import { useI18n as ie } from "../../../../i18n/I18n.js";
14
- import { getDaysInMonth as T } from "../../../../helpers/dateFormatting.js";
9
+ import { ActionsLayout as $ } from "../../../Common/ActionsLayout/ActionsLayout.js";
10
+ import { Form as ee } from "../../../Common/Form/Form.js";
11
+ import { useComponentContext as ae } from "../../../../contexts/ComponentAdapter/useComponentContext.js";
12
+ import { useLocale as ie } from "../../../../contexts/LocaleProvider/useLocale.js";
13
+ import { useI18n as le } from "../../../../i18n/I18n.js";
14
+ import { getDaysInMonth as C } from "../../../../helpers/dateFormatting.js";
15
15
  import { TextInputField as te } from "../../../Common/Fields/TextInputField/TextInputField.js";
16
- import { RadioGroupField as b } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
17
- import { NumberInputField as f } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
18
- import { CheckboxField as C } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
19
- import { SelectField as H } from "../../../Common/Fields/SelectField/SelectField.js";
20
- function Re({
21
- onContinue: O,
22
- onCancel: P,
23
- defaultValues: I,
24
- editingPolicyName: v,
25
- isPending: M = !1
16
+ import { RadioGroupField as M } from "../../../Common/Fields/RadioGroupField/RadioGroupField.js";
17
+ import { NumberInputField as _ } from "../../../Common/Fields/NumberInputField/NumberInputField.js";
18
+ import { CheckboxField as P } from "../../../Common/Fields/CheckboxField/CheckboxField.js";
19
+ import { SelectField as I } from "../../../Common/Fields/SelectField/SelectField.js";
20
+ function Le({
21
+ onContinue: N,
22
+ onCancel: w,
23
+ defaultValues: q,
24
+ editingPolicyName: g,
25
+ isPending: x = !1,
26
+ lockedAccrualCategory: y
26
27
  }) {
27
- ie("Company.TimeOff.CreateTimeOffPolicy");
28
- const { t: e } = X("Company.TimeOff.CreateTimeOffPolicy"), { Heading: N, Text: A, Button: _ } = ee(), { locale: g } = ae(), R = z(), q = s(() => {
29
- const t = new Intl.DateTimeFormat(g, { month: "long" });
30
- return Array.from({ length: 12 }, (d, n) => ({
31
- value: n + 1,
32
- label: t.format(new Date(2024, n))
28
+ le("Company.TimeOff.CreateTimeOffPolicy");
29
+ const { t: e } = Z("Company.TimeOff.CreateTimeOffPolicy"), { Heading: A, Text: D, Button: L } = ae(), { locale: R } = ie(), F = J(), S = c(() => {
30
+ const i = new Intl.DateTimeFormat(R, { month: "long" });
31
+ return Array.from({ length: 12 }, (r, s) => ({
32
+ value: s + 1,
33
+ label: i.format(new Date(2024, s))
33
34
  }));
34
- }, [g]), y = K({
35
+ }, [R]), h = Q({
35
36
  defaultValues: {
36
37
  name: "",
37
38
  resetMonth: 1,
38
39
  resetDay: 1,
39
- ...I
40
+ ...q
40
41
  }
41
- }), { control: c, setValue: i, getValues: x } = y, w = m({ control: c, name: "name" }), l = m({ control: c, name: "accrualMethod" }), S = m({ control: c, name: "resetDateType" }), p = m({ control: c, name: "resetMonth" }), U = !w.trim() || !l, E = s(() => {
42
- const t = T(p ?? 1);
43
- return Array.from({ length: t }, (d, n) => ({
44
- value: n + 1,
45
- label: String(n + 1)
42
+ }), { control: p, setValue: l, getValues: T } = h, U = u({ control: p, name: "name" }), n = u({ control: p, name: "accrualMethod" }), E = u({ control: p, name: "resetDateType" }), m = u({ control: p, name: "resetMonth" }), Y = !U.trim() || !n, V = c(() => {
43
+ const i = C(m ?? 1);
44
+ return Array.from({ length: i }, (r, s) => ({
45
+ value: s + 1,
46
+ label: String(s + 1)
46
47
  }));
47
- }, [p]);
48
- L(() => {
49
- const t = T(p ?? 1), d = x("resetDay");
50
- d != null && d > t && i("resetDay", t);
51
- }, [p, x, i]), L(() => {
52
- l !== "per_hour_paid" && (i("accrualRateUnit", void 0), i("includeOvertime", void 0), i("allPaidHours", void 0)), l !== "per_calendar_year" && i("accrualMethodFixed", void 0), l !== "per_hour_paid" && l !== "per_calendar_year" && (i("resetDateType", void 0), i("resetMonth", 1), i("resetDay", 1), i("accrualRate", void 0));
53
- }, [l, i]);
54
- const k = J(
55
- (t) => {
56
- t === "per_anniversary_year" && (i("resetMonth", 1), i("resetDay", 1));
48
+ }, [m]);
49
+ O(() => {
50
+ const i = C(m ?? 1), r = T("resetDay");
51
+ r != null && r > i && l("resetDay", i);
52
+ }, [m, T, l]), O(() => {
53
+ n !== "unlimited" && (n !== "per_hour_paid" && (l("accrualRateUnit", void 0), l("includeOvertime", void 0), l("allPaidHours", void 0)), n !== "per_calendar_year" && l("accrualMethodFixed", void 0));
54
+ }, [n, l]);
55
+ const W = K(
56
+ (i) => {
57
+ i === "per_anniversary_year" && (l("resetMonth", 1), l("resetDay", 1));
57
58
  },
58
- [i]
59
- ), Y = s(
60
- () => [
59
+ [l]
60
+ ), b = c(() => {
61
+ const i = [
61
62
  {
62
63
  value: "per_hour_paid",
63
64
  label: e("policyDetails.perHourPaidLabel"),
@@ -73,9 +74,9 @@ function Re({
73
74
  label: e("policyDetails.unlimitedLabel"),
74
75
  description: e("policyDetails.unlimitedHint")
75
76
  }
76
- ],
77
- [e]
78
- ), V = s(
77
+ ];
78
+ return y === "unlimited" ? i.filter((r) => r.value === "unlimited") : y === "accrual_based" ? i.filter((r) => r.value !== "unlimited") : i;
79
+ }, [e, y]), j = c(
79
80
  () => [
80
81
  {
81
82
  value: "per_pay_period",
@@ -89,7 +90,7 @@ function Re({
89
90
  }
90
91
  ],
91
92
  [e]
92
- ), W = s(
93
+ ), k = c(
93
94
  () => [
94
95
  {
95
96
  value: "per_anniversary_year",
@@ -101,12 +102,12 @@ function Re({
101
102
  }
102
103
  ],
103
104
  [e]
104
- ), j = (t) => {
105
- O(t);
106
- }, D = l === "per_hour_paid", F = l === "per_calendar_year", B = D || F, G = S === "per_calendar_year";
107
- return /* @__PURE__ */ a(Q, { ...y, children: /* @__PURE__ */ a($, { "aria-labelledby": R, onSubmit: y.handleSubmit(j), children: /* @__PURE__ */ r(u, { flexDirection: "column", gap: 32, children: [
108
- /* @__PURE__ */ a(N, { as: "h2", id: R, children: v ? e("policyDetails.editTitle", { name: v }) : e("policyDetails.createTitle") }),
109
- /* @__PURE__ */ r(u, { flexDirection: "column", gap: 20, children: [
105
+ ), B = (i) => {
106
+ N(i);
107
+ }, f = n === "per_hour_paid", H = n === "per_calendar_year", G = f || H, z = E === "per_calendar_year";
108
+ return /* @__PURE__ */ a(X, { ...h, children: /* @__PURE__ */ a(ee, { "aria-labelledby": F, onSubmit: h.handleSubmit(B), children: /* @__PURE__ */ t(d, { flexDirection: "column", gap: 32, children: [
109
+ /* @__PURE__ */ a(A, { as: "h2", id: F, children: g ? e("policyDetails.editTitle", { name: g }) : e("policyDetails.createTitle") }),
110
+ /* @__PURE__ */ t(d, { flexDirection: "column", gap: 20, children: [
110
111
  /* @__PURE__ */ a(
111
112
  te,
112
113
  {
@@ -116,21 +117,24 @@ function Re({
116
117
  errorMessage: e("policyDetails.validations.policyName")
117
118
  }
118
119
  ),
119
- /* @__PURE__ */ a(
120
- b,
120
+ b.length === 1 ? /* @__PURE__ */ t(d, { flexDirection: "column", gap: 4, children: [
121
+ /* @__PURE__ */ a(D, { weight: "medium", children: e("policyDetails.accrualMethodLabel") }),
122
+ /* @__PURE__ */ a(D, { children: b[0].label })
123
+ ] }) : /* @__PURE__ */ a(
124
+ M,
121
125
  {
122
126
  name: "accrualMethod",
123
127
  label: e("policyDetails.accrualMethodLabel"),
124
128
  description: e("policyDetails.accrualMethodHint"),
125
- options: Y,
129
+ options: b,
126
130
  isRequired: !0,
127
131
  errorMessage: e("policyDetails.validations.accrualMethod")
128
132
  }
129
133
  ),
130
- D && /* @__PURE__ */ r(h, { children: [
134
+ f && /* @__PURE__ */ t(v, { children: [
131
135
  /* @__PURE__ */ a("hr", { className: o.divider }),
132
136
  /* @__PURE__ */ a(
133
- f,
137
+ _,
134
138
  {
135
139
  className: o.narrowInput,
136
140
  name: "accrualRate",
@@ -142,7 +146,7 @@ function Re({
142
146
  }
143
147
  ),
144
148
  /* @__PURE__ */ a(
145
- f,
149
+ _,
146
150
  {
147
151
  className: o.narrowInput,
148
152
  name: "accrualRateUnit",
@@ -153,22 +157,22 @@ function Re({
153
157
  min: 1
154
158
  }
155
159
  ),
156
- /* @__PURE__ */ r(u, { flexDirection: "column", gap: 8, children: [
157
- /* @__PURE__ */ a(A, { children: e("policyDetails.additionalOptionsLabel") }),
160
+ /* @__PURE__ */ t(d, { flexDirection: "column", gap: 8, children: [
161
+ /* @__PURE__ */ a(D, { children: e("policyDetails.additionalOptionsLabel") }),
158
162
  /* @__PURE__ */ a(
159
- C,
163
+ P,
160
164
  {
161
165
  name: "includeOvertime",
162
166
  label: e("policyDetails.includeOvertimeLabel")
163
167
  }
164
168
  ),
165
- /* @__PURE__ */ a(C, { name: "allPaidHours", label: e("policyDetails.allPaidHoursLabel") })
169
+ /* @__PURE__ */ a(P, { name: "allPaidHours", label: e("policyDetails.allPaidHoursLabel") })
166
170
  ] })
167
171
  ] }),
168
- F && /* @__PURE__ */ r(h, { children: [
172
+ H && /* @__PURE__ */ t(v, { children: [
169
173
  /* @__PURE__ */ a("hr", { className: o.divider }),
170
174
  /* @__PURE__ */ a(
171
- f,
175
+ _,
172
176
  {
173
177
  className: o.narrowInput,
174
178
  name: "accrualRate",
@@ -181,61 +185,61 @@ function Re({
181
185
  }
182
186
  ),
183
187
  /* @__PURE__ */ a(
184
- b,
188
+ M,
185
189
  {
186
190
  name: "accrualMethodFixed",
187
191
  label: e("policyDetails.accrualMethodFixed"),
188
192
  description: e("policyDetails.accrualMethodFixedHint"),
189
- options: V,
193
+ options: j,
190
194
  isRequired: !0,
191
195
  errorMessage: e("policyDetails.validations.accrualMethodFixed")
192
196
  }
193
197
  )
194
198
  ] }),
195
- B && /* @__PURE__ */ r(h, { children: [
199
+ G && /* @__PURE__ */ t(v, { children: [
196
200
  /* @__PURE__ */ a("hr", { className: o.divider }),
197
201
  /* @__PURE__ */ a(
198
- b,
202
+ M,
199
203
  {
200
204
  name: "resetDateType",
201
205
  label: e("policyDetails.policyResetDateType"),
202
206
  description: e("policyDetails.policyResetDateTypeHint"),
203
- options: W,
204
- isRequired: !D,
207
+ options: k,
208
+ isRequired: !f,
205
209
  errorMessage: e("policyDetails.validations.resetDateType"),
206
- onChange: k
210
+ onChange: W
207
211
  }
208
212
  ),
209
- G && /* @__PURE__ */ r(u, { gap: 8, children: [
213
+ z && /* @__PURE__ */ t(d, { gap: 8, children: [
210
214
  /* @__PURE__ */ a(
211
- H,
215
+ I,
212
216
  {
213
217
  className: o.dateSelect,
214
218
  name: "resetMonth",
215
219
  label: e("policyDetails.monthLabel"),
216
- options: q
220
+ options: S
217
221
  }
218
222
  ),
219
223
  /* @__PURE__ */ a(
220
- H,
224
+ I,
221
225
  {
222
226
  className: o.dateSelect,
223
227
  name: "resetDay",
224
228
  label: e("policyDetails.dayLabel"),
225
- options: E
229
+ options: V
226
230
  }
227
231
  )
228
232
  ] })
229
233
  ] }),
230
- /* @__PURE__ */ r(Z, { children: [
231
- /* @__PURE__ */ a(_, { variant: "secondary", onClick: P, isDisabled: M, children: e("cancelCta") }),
234
+ /* @__PURE__ */ t($, { children: [
235
+ /* @__PURE__ */ a(L, { variant: "secondary", onClick: w, isDisabled: x, children: e("cancelCta") }),
232
236
  /* @__PURE__ */ a(
233
- _,
237
+ L,
234
238
  {
235
239
  variant: "primary",
236
240
  type: "submit",
237
- isLoading: M,
238
- isDisabled: U,
241
+ isLoading: x,
242
+ isDisabled: Y,
239
243
  children: e("continueCta")
240
244
  }
241
245
  )
@@ -244,6 +248,6 @@ function Re({
244
248
  ] }) }) });
245
249
  }
246
250
  export {
247
- Re as PolicyConfigurationFormPresentation
251
+ Le as PolicyConfigurationFormPresentation
248
252
  };
249
253
  //# sourceMappingURL=PolicyConfigurationFormPresentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PolicyConfigurationFormPresentation.js","sources":["../../../../../src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type {\n AccrualMethod,\n AccrualMethodFixed,\n PolicyConfigurationFormData,\n PolicyConfigurationFormPresentationProps,\n ResetDateType,\n} from './PolicyConfigurationFormTypes'\nimport styles from './PolicyConfigurationForm.module.scss'\nimport {\n Flex,\n ActionsLayout,\n RadioGroupField,\n NumberInputField,\n CheckboxField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useI18n } from '@/i18n'\nimport { getDaysInMonth } from '@/helpers/dateFormatting'\n\nexport function PolicyConfigurationFormPresentation({\n onContinue,\n onCancel,\n defaultValues,\n editingPolicyName,\n isPending = false,\n}: PolicyConfigurationFormPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Text, Button } = useComponentContext()\n const { locale } = useLocale()\n const headingId = useId()\n\n const monthOptions = useMemo(() => {\n const formatter = new Intl.DateTimeFormat(locale, { month: 'long' })\n return Array.from({ length: 12 }, (_, i) => ({\n value: i + 1,\n label: formatter.format(new Date(2024, i)),\n }))\n }, [locale])\n\n const formMethods = useForm<PolicyConfigurationFormData>({\n defaultValues: {\n name: '',\n resetMonth: 1,\n resetDay: 1,\n ...defaultValues,\n },\n })\n\n const { control, setValue, getValues } = formMethods\n const name = useWatch({ control, name: 'name' })\n const accrualMethod = useWatch({ control, name: 'accrualMethod' })\n const resetDateType = useWatch({ control, name: 'resetDateType' })\n const resetMonth = useWatch({ control, name: 'resetMonth' })\n const isContinueDisabled = !name.trim() || !accrualMethod\n\n const dayOptions = useMemo(() => {\n const days = getDaysInMonth(resetMonth ?? 1)\n return Array.from({ length: days }, (_, i) => ({\n value: i + 1,\n label: String(i + 1),\n }))\n }, [resetMonth])\n\n useEffect(() => {\n const maxDay = getDaysInMonth(resetMonth ?? 1)\n const currentDay = getValues('resetDay')\n if (currentDay != null && currentDay > maxDay) {\n setValue('resetDay', maxDay)\n }\n }, [resetMonth, getValues, setValue])\n\n useEffect(() => {\n if (accrualMethod !== 'per_hour_paid') {\n setValue('accrualRateUnit', undefined)\n setValue('includeOvertime', undefined)\n setValue('allPaidHours', undefined)\n }\n if (accrualMethod !== 'per_calendar_year') {\n setValue('accrualMethodFixed', undefined)\n }\n if (accrualMethod !== 'per_hour_paid' && accrualMethod !== 'per_calendar_year') {\n setValue('resetDateType', undefined)\n setValue('resetMonth', 1)\n setValue('resetDay', 1)\n setValue('accrualRate', undefined)\n }\n }, [accrualMethod, setValue])\n\n const handleResetDateTypeChange = useCallback(\n (value: ResetDateType) => {\n if (value === 'per_anniversary_year') {\n setValue('resetMonth', 1)\n setValue('resetDay', 1)\n }\n },\n [setValue],\n )\n\n const accrualMethodOptions = useMemo(\n () => [\n {\n value: 'per_hour_paid' as AccrualMethod,\n label: t('policyDetails.perHourPaidLabel'),\n description: t('policyDetails.perHourPaidHint'),\n },\n {\n value: 'per_calendar_year' as AccrualMethod,\n label: t('policyDetails.perYearLabel'),\n description: t('policyDetails.perYearHint'),\n },\n {\n value: 'unlimited' as AccrualMethod,\n label: t('policyDetails.unlimitedLabel'),\n description: t('policyDetails.unlimitedHint'),\n },\n ],\n [t],\n )\n\n const accrualMethodFixedOptions = useMemo(\n () => [\n {\n value: 'per_pay_period' as AccrualMethodFixed,\n label: t('policyDetails.perPayPeriodLabel'),\n description: t('policyDetails.perPayPeriodHint'),\n },\n {\n value: 'all_at_once' as AccrualMethodFixed,\n label: t('policyDetails.allAtOnceLabel'),\n description: t('policyDetails.allAtOnceHint'),\n },\n ],\n [t],\n )\n\n const resetDateTypeOptions = useMemo(\n () => [\n {\n value: 'per_anniversary_year' as ResetDateType,\n label: t('policyDetails.perAnniversaryYearLabel'),\n },\n {\n value: 'per_calendar_year' as ResetDateType,\n label: t('policyDetails.perCalendarYearLabel'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyConfigurationFormData) => {\n onContinue(data)\n }\n\n const isHourlyMethod = accrualMethod === 'per_hour_paid'\n const isFixedMethod = accrualMethod === 'per_calendar_year'\n const showResetDate = isHourlyMethod || isFixedMethod\n const showCustomDateFields = resetDateType === 'per_calendar_year'\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {editingPolicyName\n ? t('policyDetails.editTitle', { name: editingPolicyName })\n : t('policyDetails.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField\n name=\"name\"\n label={t('policyDetails.policyNameLabel')}\n isRequired\n errorMessage={t('policyDetails.validations.policyName')}\n />\n\n <RadioGroupField<AccrualMethod>\n name=\"accrualMethod\"\n label={t('policyDetails.accrualMethodLabel')}\n description={t('policyDetails.accrualMethodHint')}\n options={accrualMethodOptions}\n isRequired\n errorMessage={t('policyDetails.validations.accrualMethod')}\n />\n\n {isHourlyMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.employeesWillAccrueLabel')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRate')}\n min={0}\n />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRateUnit\"\n label={t('policyDetails.forEveryLabel')}\n adornmentEnd={t('policyDetails.hoursWorkedUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRateUnit')}\n min={1}\n />\n\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{t('policyDetails.additionalOptionsLabel')}</Text>\n <CheckboxField\n name=\"includeOvertime\"\n label={t('policyDetails.includeOvertimeLabel')}\n />\n <CheckboxField name=\"allPaidHours\" label={t('policyDetails.allPaidHoursLabel')} />\n </Flex>\n </>\n )}\n\n {isFixedMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.fixedAccrualRateLabel')}\n description={t('policyDetails.fixedAccrualRateHint')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRate')}\n min={0}\n />\n\n <RadioGroupField<AccrualMethodFixed>\n name=\"accrualMethodFixed\"\n label={t('policyDetails.accrualMethodFixed')}\n description={t('policyDetails.accrualMethodFixedHint')}\n options={accrualMethodFixedOptions}\n isRequired\n errorMessage={t('policyDetails.validations.accrualMethodFixed')}\n />\n </>\n )}\n\n {showResetDate && (\n <>\n <hr className={styles.divider} />\n\n <RadioGroupField<ResetDateType>\n name=\"resetDateType\"\n label={t('policyDetails.policyResetDateType')}\n description={t('policyDetails.policyResetDateTypeHint')}\n options={resetDateTypeOptions}\n isRequired={!isHourlyMethod}\n errorMessage={t('policyDetails.validations.resetDateType')}\n onChange={handleResetDateTypeChange}\n />\n\n {showCustomDateFields && (\n <Flex gap={8}>\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetMonth\"\n label={t('policyDetails.monthLabel')}\n options={monthOptions}\n />\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetDay\"\n label={t('policyDetails.dayLabel')}\n options={dayOptions}\n />\n </Flex>\n )}\n </>\n )}\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n isLoading={isPending}\n isDisabled={isContinueDisabled}\n >\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyConfigurationFormPresentation","onContinue","onCancel","defaultValues","editingPolicyName","isPending","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","locale","useLocale","headingId","useId","monthOptions","useMemo","formatter","_","i","formMethods","useForm","control","setValue","getValues","name","useWatch","accrualMethod","resetDateType","resetMonth","isContinueDisabled","dayOptions","days","getDaysInMonth","useEffect","maxDay","currentDay","handleResetDateTypeChange","useCallback","value","accrualMethodOptions","accrualMethodFixedOptions","resetDateTypeOptions","handleSubmit","data","isHourlyMethod","isFixedMethod","showResetDate","showCustomDateFields","FormProvider","jsx","HtmlForm","jsxs","Flex","TextInputField","RadioGroupField","Fragment","styles","NumberInputField","CheckboxField","SelectField","ActionsLayout"],"mappings":";;;;;;;;;;;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AAK;AAAA,cACL,OAAOpD,EAAE,0BAA0B;AAAA,cACnC,SAASU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEX,gBAAAmC;AAAA,YAACU;AAAA,YAAA;AAAA,cACC,WAAWH,EAAO;AAAA,cAClB,MAAK;AAAA,cACL,OAAOpD,EAAE,wBAAwB;AAAA,cACjC,SAAS0B;AAAA,YAAA;AAAA,UAAA;AAAA,QACX,EAAA,CACF;AAAA,MAAA,GAEJ;AAAA,wBAGD8B,GAAA,EACC,UAAA;AAAA,QAAA,gBAAAX,EAACzC,GAAA,EAAO,SAAQ,aAAY,SAAST,GAAU,YAAYG,GACxD,UAAAE,EAAE,WAAW,EAAA,CAChB;AAAA,QACA,gBAAA6C;AAAA,UAACzC;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,WAAWN;AAAA,YACX,YAAY2B;AAAA,YAEX,YAAE,aAAa;AAAA,UAAA;AAAA,QAAA;AAAA,MAClB,EAAA,CACF;AAAA,IAAA,EAAA,CACF;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ;"}
1
+ {"version":3,"file":"PolicyConfigurationFormPresentation.js","sources":["../../../../../src/components/TimeOff/TimeOffManagement/PolicyConfigurationForm/PolicyConfigurationFormPresentation.tsx"],"sourcesContent":["import { useCallback, useEffect, useId, useMemo } from 'react'\nimport { FormProvider, useForm, useWatch } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type {\n AccrualMethod,\n AccrualMethodFixed,\n PolicyConfigurationFormData,\n PolicyConfigurationFormPresentationProps,\n ResetDateType,\n} from './PolicyConfigurationFormTypes'\nimport styles from './PolicyConfigurationForm.module.scss'\nimport {\n Flex,\n ActionsLayout,\n RadioGroupField,\n NumberInputField,\n CheckboxField,\n SelectField,\n TextInputField,\n} from '@/components/Common'\nimport { Form as HtmlForm } from '@/components/Common/Form'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useLocale } from '@/contexts/LocaleProvider/useLocale'\nimport { useI18n } from '@/i18n'\nimport { getDaysInMonth } from '@/helpers/dateFormatting'\n\nexport function PolicyConfigurationFormPresentation({\n onContinue,\n onCancel,\n defaultValues,\n editingPolicyName,\n isPending = false,\n lockedAccrualCategory,\n}: PolicyConfigurationFormPresentationProps) {\n useI18n('Company.TimeOff.CreateTimeOffPolicy')\n const { t } = useTranslation('Company.TimeOff.CreateTimeOffPolicy')\n const { Heading, Text, Button } = useComponentContext()\n const { locale } = useLocale()\n const headingId = useId()\n\n const monthOptions = useMemo(() => {\n const formatter = new Intl.DateTimeFormat(locale, { month: 'long' })\n return Array.from({ length: 12 }, (_, i) => ({\n value: i + 1,\n label: formatter.format(new Date(2024, i)),\n }))\n }, [locale])\n\n const formMethods = useForm<PolicyConfigurationFormData>({\n defaultValues: {\n name: '',\n resetMonth: 1,\n resetDay: 1,\n ...defaultValues,\n },\n })\n\n const { control, setValue, getValues } = formMethods\n const name = useWatch({ control, name: 'name' })\n const accrualMethod = useWatch({ control, name: 'accrualMethod' })\n const resetDateType = useWatch({ control, name: 'resetDateType' })\n const resetMonth = useWatch({ control, name: 'resetMonth' })\n const isContinueDisabled = !name.trim() || !accrualMethod\n\n const dayOptions = useMemo(() => {\n const days = getDaysInMonth(resetMonth ?? 1)\n return Array.from({ length: days }, (_, i) => ({\n value: i + 1,\n label: String(i + 1),\n }))\n }, [resetMonth])\n\n useEffect(() => {\n const maxDay = getDaysInMonth(resetMonth ?? 1)\n const currentDay = getValues('resetDay')\n if (currentDay != null && currentDay > maxDay) {\n setValue('resetDay', maxDay)\n }\n }, [resetMonth, getValues, setValue])\n\n useEffect(() => {\n if (accrualMethod === 'unlimited') {\n return\n }\n if (accrualMethod !== 'per_hour_paid') {\n setValue('accrualRateUnit', undefined)\n setValue('includeOvertime', undefined)\n setValue('allPaidHours', undefined)\n }\n if (accrualMethod !== 'per_calendar_year') {\n setValue('accrualMethodFixed', undefined)\n }\n }, [accrualMethod, setValue])\n\n const handleResetDateTypeChange = useCallback(\n (value: ResetDateType) => {\n if (value === 'per_anniversary_year') {\n setValue('resetMonth', 1)\n setValue('resetDay', 1)\n }\n },\n [setValue],\n )\n\n const accrualMethodOptions = useMemo(() => {\n const allOptions = [\n {\n value: 'per_hour_paid' as AccrualMethod,\n label: t('policyDetails.perHourPaidLabel'),\n description: t('policyDetails.perHourPaidHint'),\n },\n {\n value: 'per_calendar_year' as AccrualMethod,\n label: t('policyDetails.perYearLabel'),\n description: t('policyDetails.perYearHint'),\n },\n {\n value: 'unlimited' as AccrualMethod,\n label: t('policyDetails.unlimitedLabel'),\n description: t('policyDetails.unlimitedHint'),\n },\n ]\n if (lockedAccrualCategory === 'unlimited') {\n return allOptions.filter(option => option.value === 'unlimited')\n }\n if (lockedAccrualCategory === 'accrual_based') {\n return allOptions.filter(option => option.value !== 'unlimited')\n }\n return allOptions\n }, [t, lockedAccrualCategory])\n\n const accrualMethodFixedOptions = useMemo(\n () => [\n {\n value: 'per_pay_period' as AccrualMethodFixed,\n label: t('policyDetails.perPayPeriodLabel'),\n description: t('policyDetails.perPayPeriodHint'),\n },\n {\n value: 'all_at_once' as AccrualMethodFixed,\n label: t('policyDetails.allAtOnceLabel'),\n description: t('policyDetails.allAtOnceHint'),\n },\n ],\n [t],\n )\n\n const resetDateTypeOptions = useMemo(\n () => [\n {\n value: 'per_anniversary_year' as ResetDateType,\n label: t('policyDetails.perAnniversaryYearLabel'),\n },\n {\n value: 'per_calendar_year' as ResetDateType,\n label: t('policyDetails.perCalendarYearLabel'),\n },\n ],\n [t],\n )\n\n const handleSubmit = (data: PolicyConfigurationFormData) => {\n onContinue(data)\n }\n\n const isHourlyMethod = accrualMethod === 'per_hour_paid'\n const isFixedMethod = accrualMethod === 'per_calendar_year'\n const showResetDate = isHourlyMethod || isFixedMethod\n const showCustomDateFields = resetDateType === 'per_calendar_year'\n\n return (\n <FormProvider {...formMethods}>\n <HtmlForm aria-labelledby={headingId} onSubmit={formMethods.handleSubmit(handleSubmit)}>\n <Flex flexDirection=\"column\" gap={32}>\n <Heading as=\"h2\" id={headingId}>\n {editingPolicyName\n ? t('policyDetails.editTitle', { name: editingPolicyName })\n : t('policyDetails.createTitle')}\n </Heading>\n\n <Flex flexDirection=\"column\" gap={20}>\n <TextInputField\n name=\"name\"\n label={t('policyDetails.policyNameLabel')}\n isRequired\n errorMessage={t('policyDetails.validations.policyName')}\n />\n\n {accrualMethodOptions.length === 1 ? (\n <Flex flexDirection=\"column\" gap={4}>\n <Text weight=\"medium\">{t('policyDetails.accrualMethodLabel')}</Text>\n <Text>{accrualMethodOptions[0]!.label}</Text>\n </Flex>\n ) : (\n <RadioGroupField<AccrualMethod>\n name=\"accrualMethod\"\n label={t('policyDetails.accrualMethodLabel')}\n description={t('policyDetails.accrualMethodHint')}\n options={accrualMethodOptions}\n isRequired\n errorMessage={t('policyDetails.validations.accrualMethod')}\n />\n )}\n\n {isHourlyMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.employeesWillAccrueLabel')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRate')}\n min={0}\n />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRateUnit\"\n label={t('policyDetails.forEveryLabel')}\n adornmentEnd={t('policyDetails.hoursWorkedUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRateUnit')}\n min={1}\n />\n\n <Flex flexDirection=\"column\" gap={8}>\n <Text>{t('policyDetails.additionalOptionsLabel')}</Text>\n <CheckboxField\n name=\"includeOvertime\"\n label={t('policyDetails.includeOvertimeLabel')}\n />\n <CheckboxField name=\"allPaidHours\" label={t('policyDetails.allPaidHoursLabel')} />\n </Flex>\n </>\n )}\n\n {isFixedMethod && (\n <>\n <hr className={styles.divider} />\n\n <NumberInputField\n className={styles.narrowInput}\n name=\"accrualRate\"\n label={t('policyDetails.fixedAccrualRateLabel')}\n description={t('policyDetails.fixedAccrualRateHint')}\n adornmentEnd={t('policyDetails.hoursUnit')}\n isRequired\n errorMessage={t('policyDetails.validations.accrualRate')}\n min={0}\n />\n\n <RadioGroupField<AccrualMethodFixed>\n name=\"accrualMethodFixed\"\n label={t('policyDetails.accrualMethodFixed')}\n description={t('policyDetails.accrualMethodFixedHint')}\n options={accrualMethodFixedOptions}\n isRequired\n errorMessage={t('policyDetails.validations.accrualMethodFixed')}\n />\n </>\n )}\n\n {showResetDate && (\n <>\n <hr className={styles.divider} />\n\n <RadioGroupField<ResetDateType>\n name=\"resetDateType\"\n label={t('policyDetails.policyResetDateType')}\n description={t('policyDetails.policyResetDateTypeHint')}\n options={resetDateTypeOptions}\n isRequired={!isHourlyMethod}\n errorMessage={t('policyDetails.validations.resetDateType')}\n onChange={handleResetDateTypeChange}\n />\n\n {showCustomDateFields && (\n <Flex gap={8}>\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetMonth\"\n label={t('policyDetails.monthLabel')}\n options={monthOptions}\n />\n <SelectField<number>\n className={styles.dateSelect}\n name=\"resetDay\"\n label={t('policyDetails.dayLabel')}\n options={dayOptions}\n />\n </Flex>\n )}\n </>\n )}\n\n <ActionsLayout>\n <Button variant=\"secondary\" onClick={onCancel} isDisabled={isPending}>\n {t('cancelCta')}\n </Button>\n <Button\n variant=\"primary\"\n type=\"submit\"\n isLoading={isPending}\n isDisabled={isContinueDisabled}\n >\n {t('continueCta')}\n </Button>\n </ActionsLayout>\n </Flex>\n </Flex>\n </HtmlForm>\n </FormProvider>\n )\n}\n"],"names":["PolicyConfigurationFormPresentation","onContinue","onCancel","defaultValues","editingPolicyName","isPending","lockedAccrualCategory","useI18n","t","useTranslation","Heading","Text","Button","useComponentContext","locale","useLocale","headingId","useId","monthOptions","useMemo","formatter","_","i","formMethods","useForm","control","setValue","getValues","name","useWatch","accrualMethod","resetDateType","resetMonth","isContinueDisabled","dayOptions","days","getDaysInMonth","useEffect","maxDay","currentDay","handleResetDateTypeChange","useCallback","value","accrualMethodOptions","allOptions","option","accrualMethodFixedOptions","resetDateTypeOptions","handleSubmit","data","isHourlyMethod","isFixedMethod","showResetDate","showCustomDateFields","FormProvider","jsx","HtmlForm","jsxs","Flex","TextInputField","RadioGroupField","Fragment","styles","NumberInputField","CheckboxField","SelectField","ActionsLayout"],"mappings":";;;;;;;;;;;;;;;;;;;AA0BO,SAASA,GAAoC;AAAA,EAClD,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,uBAAAC;AACF,GAA6C;AAC3C,EAAAC,GAAQ,qCAAqC;AAC7C,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,qCAAqC,GAC5D,EAAE,SAAAC,GAAS,MAAAC,GAAM,QAAAC,EAAA,IAAWC,GAAA,GAC5B,EAAE,QAAAC,EAAA,IAAWC,GAAA,GACbC,IAAYC,EAAA,GAEZC,IAAeC,EAAQ,MAAM;AACjC,UAAMC,IAAY,IAAI,KAAK,eAAeN,GAAQ,EAAE,OAAO,QAAQ;AACnE,WAAO,MAAM,KAAK,EAAE,QAAQ,MAAM,CAACO,GAAGC,OAAO;AAAA,MAC3C,OAAOA,IAAI;AAAA,MACX,OAAOF,EAAU,OAAO,IAAI,KAAK,MAAME,CAAC,CAAC;AAAA,IAAA,EACzC;AAAA,EACJ,GAAG,CAACR,CAAM,CAAC,GAELS,IAAcC,EAAqC;AAAA,IACvD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,GAAGrB;AAAA,IAAA;AAAA,EACL,CACD,GAEK,EAAE,SAAAsB,GAAS,UAAAC,GAAU,WAAAC,EAAA,IAAcJ,GACnCK,IAAOC,EAAS,EAAE,SAAAJ,GAAS,MAAM,QAAQ,GACzCK,IAAgBD,EAAS,EAAE,SAAAJ,GAAS,MAAM,iBAAiB,GAC3DM,IAAgBF,EAAS,EAAE,SAAAJ,GAAS,MA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AEJ;"}
@@ -13,10 +13,12 @@ export interface PolicyConfigurationFormData {
13
13
  resetMonth?: number;
14
14
  resetDay?: number;
15
15
  }
16
+ export type LockedAccrualCategory = 'unlimited' | 'accrual_based';
16
17
  export interface PolicyConfigurationFormPresentationProps {
17
18
  onContinue: (data: PolicyConfigurationFormData) => void;
18
19
  onCancel: () => void;
19
20
  defaultValues?: Partial<PolicyConfigurationFormData>;
20
21
  editingPolicyName?: string;
21
22
  isPending?: boolean;
23
+ lockedAccrualCategory?: LockedAccrualCategory;
22
24
  }