@gusto/embedded-react-sdk 0.11.0-rc.1 → 0.11.1
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/CHANGELOG.md +7 -0
- package/dist/components/Common/DataView/DataView.js +20 -20
- package/dist/components/Common/DataView/DataView.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxes.js +19 -40
- package/dist/components/Company/StateTaxes/StateTaxes.js.map +1 -1
- package/dist/components/Company/StateTaxes/StateTaxesComponents.d.ts +6 -8
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js +15 -16
- package/dist/components/Company/StateTaxes/StateTaxesComponents.js.map +1 -1
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.d.ts +5 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js +48 -0
- package/dist/components/Company/StateTaxes/stateTaxesStateMachine.js.map +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js +1 -0
- package/dist/components/Contractor/PaymentMethod/BankAccountForm.js.map +1 -1
- package/dist/components/Contractor/Profile/ContractorProfileForm.js +10 -8
- package/dist/components/Contractor/Profile/ContractorProfileForm.js.map +1 -1
- package/dist/components/Employee/Compensation/Edit.js +18 -17
- package/dist/components/Employee/Compensation/Edit.js.map +1 -1
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js +1 -0
- package/dist/components/Employee/Deductions/IncludeDeductionsForm.js.map +1 -1
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js +4 -3
- package/dist/components/Employee/PaymentMethod/BankAccountEdit.js.map +1 -1
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js +51 -49
- package/dist/components/Employee/Profile/PersonalDetailsInputs.js.map +1 -1
- package/dist/components/Employee/Profile/Profile.js +1 -1
- package/dist/components/Employee/Profile/Profile.js.map +1 -1
- package/dist/components/Employee/Taxes/FederalForm.js +5 -4
- package/dist/components/Employee/Taxes/FederalForm.js.map +1 -1
- package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js +34 -23
- package/dist/hooks/useContainerBreakpoints/useContainerBreakpoints.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/Company/StateTaxes/stateTaxesReducer.d.ts +0 -20
- package/dist/components/Company/StateTaxes/stateTaxesReducer.js +0 -40
- package/dist/components/Company/StateTaxes/stateTaxesReducer.js.map +0 -1
- package/dist/hooks/useDebounce/useDebounce.js +0 -19
- package/dist/hooks/useDebounce/useDebounce.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.1
|
|
4
|
+
|
|
5
|
+
- Fix updating onboarding status for employee when self onboarding
|
|
6
|
+
- Fix eliminate flashing empty fields in compensation component
|
|
7
|
+
- Fix mark fields as required to match server validation
|
|
8
|
+
- Chore - Add github action to be utilized for readme deploy
|
|
9
|
+
|
|
3
10
|
## 0.11.0
|
|
4
11
|
|
|
5
12
|
- Update peer dependencies to support React 18
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as f, useMemo as
|
|
3
|
-
import { PaginationControl as
|
|
4
|
-
import
|
|
5
|
-
import { DataTable as
|
|
6
|
-
import { DataCards as
|
|
7
|
-
import { useContainerBreakpoints as
|
|
8
|
-
const
|
|
1
|
+
import { jsxs as l, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as f, useMemo as p } from "react";
|
|
3
|
+
import { PaginationControl as d } from "../PaginationControl/PaginationControl.js";
|
|
4
|
+
import u from "./DataView.module.scss.js";
|
|
5
|
+
import { DataTable as C } from "./DataTable/DataTable.js";
|
|
6
|
+
import { DataCards as D } from "./DataCards/DataCards.js";
|
|
7
|
+
import { useContainerBreakpoints as b } from "../../../hooks/useContainerBreakpoints/useContainerBreakpoints.js";
|
|
8
|
+
const M = ({
|
|
9
9
|
pagination: t,
|
|
10
|
-
breakAt:
|
|
11
|
-
...
|
|
10
|
+
breakAt: s = "small",
|
|
11
|
+
...a
|
|
12
12
|
}) => {
|
|
13
|
-
const
|
|
14
|
-
ref:
|
|
15
|
-
}).includes(
|
|
16
|
-
return /* @__PURE__ */
|
|
13
|
+
const e = f(null), o = b({
|
|
14
|
+
ref: e
|
|
15
|
+
}), i = o.length > 0, r = !o.includes(s), m = p(() => r ? D : C, [r]);
|
|
16
|
+
return /* @__PURE__ */ l(
|
|
17
17
|
"div",
|
|
18
18
|
{
|
|
19
19
|
"data-testid": "data-view",
|
|
20
|
-
className:
|
|
21
|
-
ref: (
|
|
22
|
-
|
|
20
|
+
className: u.dataViewContainer,
|
|
21
|
+
ref: (c) => {
|
|
22
|
+
e.current = c;
|
|
23
23
|
},
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
t && /* @__PURE__ */
|
|
25
|
+
i && /* @__PURE__ */ n(m, { ...a }),
|
|
26
|
+
t && /* @__PURE__ */ n(d, { ...t })
|
|
27
27
|
]
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
M as DataView
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=DataView.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataView.js","sources":["../../../../src/components/Common/DataView/DataView.tsx"],"sourcesContent":["import { useMemo, useRef } from 'react'\nimport { PaginationControl } from '../PaginationControl/PaginationControl'\nimport styles from './DataView.module.scss'\nimport { DataTable } from './DataTable/DataTable'\nimport type { useDataViewPropReturn } from './useDataView'\nimport { DataCards } from './DataCards/DataCards'\nimport type { BreakpointKey } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\nexport type DataViewProps<T> = {\n columns: useDataViewPropReturn<T>['columns']\n data: T[]\n pagination?: useDataViewPropReturn<T>['pagination']\n label: string\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n breakAt?: BreakpointKey\n}\n\nexport const DataView = <T,>({\n pagination,\n breakAt = 'small',\n ...dataViewProps\n}: DataViewProps<T>) => {\n const containerRef = useRef<HTMLElement | null>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n\n const isMobile = !breakpoints.includes(breakAt)\n\n const Component = useMemo(() => {\n return isMobile ? DataCards : DataTable\n }, [isMobile])\n\n return (\n <div\n data-testid=\"data-view\"\n className={styles.dataViewContainer}\n ref={ref => {\n containerRef.current = ref\n }}\n >\n <Component {...dataViewProps}
|
|
1
|
+
{"version":3,"file":"DataView.js","sources":["../../../../src/components/Common/DataView/DataView.tsx"],"sourcesContent":["import { useMemo, useRef } from 'react'\nimport { PaginationControl } from '../PaginationControl/PaginationControl'\nimport styles from './DataView.module.scss'\nimport { DataTable } from './DataTable/DataTable'\nimport type { useDataViewPropReturn } from './useDataView'\nimport { DataCards } from './DataCards/DataCards'\nimport type { BreakpointKey } from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\nimport useContainerBreakpoints from '@/hooks/useContainerBreakpoints/useContainerBreakpoints'\n\nexport type DataViewProps<T> = {\n columns: useDataViewPropReturn<T>['columns']\n data: T[]\n pagination?: useDataViewPropReturn<T>['pagination']\n label: string\n itemMenu?: useDataViewPropReturn<T>['itemMenu']\n onSelect?: useDataViewPropReturn<T>['onSelect']\n breakAt?: BreakpointKey\n}\n\nexport const DataView = <T,>({\n pagination,\n breakAt = 'small',\n ...dataViewProps\n}: DataViewProps<T>) => {\n const containerRef = useRef<HTMLElement | null>(null)\n const breakpoints = useContainerBreakpoints({\n ref: containerRef,\n })\n\n // Wait for breakpoints to be detected before rendering\n const isBreakpointsDetected = breakpoints.length > 0\n const isMobile = !breakpoints.includes(breakAt)\n\n const Component = useMemo(() => {\n return isMobile ? DataCards : DataTable\n }, [isMobile])\n\n return (\n <div\n data-testid=\"data-view\"\n className={styles.dataViewContainer}\n ref={ref => {\n containerRef.current = ref\n }}\n >\n {isBreakpointsDetected && <Component {...dataViewProps} />}\n {pagination && <PaginationControl {...pagination} />}\n </div>\n )\n}\n"],"names":["DataView","pagination","breakAt","dataViewProps","containerRef","useRef","breakpoints","useContainerBreakpoints","isBreakpointsDetected","isMobile","Component","useMemo","DataCards","DataTable","jsxs","styles","ref","jsx","PaginationControl"],"mappings":";;;;;;;AAmBO,MAAMA,IAAW,CAAK;AAAA,EAC3B,YAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,GAAGC;AACL,MAAwB;AAChB,QAAAC,IAAeC,EAA2B,IAAI,GAC9CC,IAAcC,EAAwB;AAAA,IAC1C,KAAKH;AAAA,EAAA,CACN,GAGKI,IAAwBF,EAAY,SAAS,GAC7CG,IAAW,CAACH,EAAY,SAASJ,CAAO,GAExCQ,IAAYC,EAAQ,MACjBF,IAAWG,IAAYC,GAC7B,CAACJ,CAAQ,CAAC;AAGX,SAAA,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,eAAY;AAAA,MACZ,WAAWC,EAAO;AAAA,MAClB,KAAK,CAAOC,MAAA;AACV,QAAAZ,EAAa,UAAUY;AAAA,MACzB;AAAA,MAEC,UAAA;AAAA,QAAyBR,KAAA,gBAAAS,EAACP,GAAW,EAAA,GAAGP,EAAe,CAAA;AAAA,QACvDF,KAAc,gBAAAgB,EAACC,GAAmB,EAAA,GAAGjB,EAAY,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EACpD;AAEJ;"}
|
|
@@ -1,44 +1,23 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { StateTaxesListContextual as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
break;
|
|
20
|
-
case e.COMPANY_STATE_TAX_DONE:
|
|
21
|
-
a({ type: t });
|
|
22
|
-
break;
|
|
23
|
-
case e.CANCEL:
|
|
24
|
-
a({ type: t });
|
|
25
|
-
break;
|
|
26
|
-
default:
|
|
27
|
-
s(t, o);
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
s(t, o);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
switch (r.state) {
|
|
34
|
-
case "editStateTaxes":
|
|
35
|
-
return /* @__PURE__ */ i(A, { ...c });
|
|
36
|
-
case "viewStateTaxes":
|
|
37
|
-
default:
|
|
38
|
-
return /* @__PURE__ */ i(u, { ...c });
|
|
39
|
-
}
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { createMachine as n } from "robot3";
|
|
3
|
+
import { stateTaxesStateMachine as i } from "./stateTaxesStateMachine.js";
|
|
4
|
+
import { StateTaxesListContextual as s } from "./StateTaxesComponents.js";
|
|
5
|
+
import { Flow as p } from "../../Flow/Flow.js";
|
|
6
|
+
import { useComponentDictionary as x } from "../../../i18n/I18n.js";
|
|
7
|
+
function C({ companyId: t, onEvent: e, dictionary: o }) {
|
|
8
|
+
x("Company.StateTaxes", o);
|
|
9
|
+
const a = n(
|
|
10
|
+
"viewStateTaxes",
|
|
11
|
+
i,
|
|
12
|
+
(m) => ({
|
|
13
|
+
...m,
|
|
14
|
+
component: s,
|
|
15
|
+
companyId: t
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ r(p, { machine: a, onEvent: e });
|
|
40
19
|
}
|
|
41
20
|
export {
|
|
42
|
-
|
|
21
|
+
C as StateTaxes
|
|
43
22
|
};
|
|
44
23
|
//# sourceMappingURL=StateTaxes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"StateTaxes.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxes.tsx"],"sourcesContent":["import { createMachine } from 'robot3'\nimport { stateTaxesStateMachine } from './stateTaxesStateMachine'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesListContextual } from './StateTaxesComponents'\nimport { Flow } from '@/components/Flow/Flow'\nimport type { BaseComponentInterface } from '@/components/Base'\nimport { useComponentDictionary } from '@/i18n/I18n'\n\nexport interface StateTaxesProps extends BaseComponentInterface<'Company.StateTaxes'> {\n companyId: string\n}\n\nexport function StateTaxes({ companyId, onEvent, dictionary }: StateTaxesProps) {\n useComponentDictionary('Company.StateTaxes', dictionary)\n const manageStateTaxes = createMachine(\n 'viewStateTaxes',\n stateTaxesStateMachine,\n (initialContext: StateTaxesContextInterface) => ({\n ...initialContext,\n component: StateTaxesListContextual,\n companyId,\n }),\n )\n return <Flow machine={manageStateTaxes} onEvent={onEvent} />\n}\n"],"names":["StateTaxes","companyId","onEvent","dictionary","useComponentDictionary","manageStateTaxes","createMachine","stateTaxesStateMachine","initialContext","StateTaxesListContextual","jsx","Flow"],"mappings":";;;;;;AAYO,SAASA,EAAW,EAAE,WAAAC,GAAW,SAAAC,GAAS,YAAAC,KAA+B;AAC9E,EAAAC,EAAuB,sBAAsBD,CAAU;AACvD,QAAME,IAAmBC;AAAA,IACvB;AAAA,IACAC;AAAA,IACA,CAACC,OAAgD;AAAA,MAC/C,GAAGA;AAAA,MACH,WAAWC;AAAA,MACX,WAAAR;AAAA,IACF;AAAA,EACF;AACA,SAAQ,gBAAAS,EAAAC,GAAA,EAAK,SAASN,GAAkB,SAAAH,EAAkB,CAAA;AAC5D;"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { EventType } from '../../../shared/constants';
|
|
4
|
-
export interface StateTaxesContextInterface {
|
|
1
|
+
import { FlowContextInterface } from '../../Flow/useFlow';
|
|
2
|
+
export interface StateTaxesContextInterface extends FlowContextInterface {
|
|
5
3
|
companyId: string;
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
state?: string;
|
|
5
|
+
component: React.ComponentType | null;
|
|
8
6
|
}
|
|
9
|
-
export declare function StateTaxesListContextual(
|
|
10
|
-
export declare function StateTaxesFormContextual(
|
|
7
|
+
export declare function StateTaxesListContextual(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function StateTaxesFormContextual(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { StateTaxesList as m } from "./StateTaxesList/StateTaxesList.js";
|
|
3
|
-
import { StateTaxesForm as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { StateTaxesForm as s } from "./StateTaxesForm/StateTaxesForm.js";
|
|
4
|
+
import { useFlow as r } from "../../Flow/useFlow.js";
|
|
5
|
+
import { ensureRequired as e } from "../../../helpers/ensureRequired.js";
|
|
6
|
+
function f() {
|
|
7
|
+
const { companyId: t, onEvent: o } = r();
|
|
8
|
+
return /* @__PURE__ */ n(m, { onEvent: o, companyId: e(t) });
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
companyId: t,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}) {
|
|
13
|
-
return /* @__PURE__ */ r(
|
|
14
|
-
n,
|
|
10
|
+
function d() {
|
|
11
|
+
const { companyId: t, state: o, onEvent: a } = r();
|
|
12
|
+
return /* @__PURE__ */ n(
|
|
13
|
+
s,
|
|
15
14
|
{
|
|
16
|
-
companyId:
|
|
17
|
-
state: o
|
|
15
|
+
companyId: e(t),
|
|
16
|
+
state: e(o),
|
|
18
17
|
onEvent: a
|
|
19
18
|
}
|
|
20
19
|
);
|
|
21
20
|
}
|
|
22
21
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
d as StateTaxesFormContextual,
|
|
23
|
+
f as StateTaxesListContextual
|
|
25
24
|
};
|
|
26
25
|
//# sourceMappingURL=StateTaxesComponents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateTaxesComponents.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxesComponents.tsx"],"sourcesContent":["import { StateTaxesList } from './StateTaxesList/StateTaxesList'\nimport { StateTaxesForm } from './StateTaxesForm/StateTaxesForm'\nimport
|
|
1
|
+
{"version":3,"file":"StateTaxesComponents.js","sources":["../../../../src/components/Company/StateTaxes/StateTaxesComponents.tsx"],"sourcesContent":["import { StateTaxesList } from './StateTaxesList/StateTaxesList'\nimport { StateTaxesForm } from './StateTaxesForm/StateTaxesForm'\nimport { useFlow, type FlowContextInterface } from '@/components/Flow/useFlow'\nimport { ensureRequired } from '@/helpers/ensureRequired'\n\nexport interface StateTaxesContextInterface extends FlowContextInterface {\n companyId: string\n state?: string\n component: React.ComponentType | null\n}\n\nexport function StateTaxesListContextual() {\n const { companyId, onEvent } = useFlow<StateTaxesContextInterface>()\n return <StateTaxesList onEvent={onEvent} companyId={ensureRequired(companyId)} />\n}\n\nexport function StateTaxesFormContextual() {\n const { companyId, state, onEvent } = useFlow<StateTaxesContextInterface>()\n return (\n <StateTaxesForm\n companyId={ensureRequired(companyId)}\n state={ensureRequired(state)}\n onEvent={onEvent}\n />\n )\n}\n"],"names":["StateTaxesListContextual","companyId","onEvent","useFlow","StateTaxesList","ensureRequired","StateTaxesFormContextual","state","jsx","StateTaxesForm"],"mappings":";;;;;AAWO,SAASA,IAA2B;AACzC,QAAM,EAAE,WAAAC,GAAW,SAAAC,EAAQ,IAAIC,EAAoC;AACnE,2BAAQC,GAAe,EAAA,SAAAF,GAAkB,WAAWG,EAAeJ,CAAS,GAAG;AACjF;AAEO,SAASK,IAA2B;AACzC,QAAM,EAAE,WAAAL,GAAW,OAAAM,GAAO,SAAAL,EAAA,IAAYC,EAAoC;AAExE,SAAA,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWJ,EAAeJ,CAAS;AAAA,MACnC,OAAOI,EAAeE,CAAK;AAAA,MAC3B,SAAAL;AAAA,IAAA;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const stateTaxesStateMachine: {
|
|
2
|
+
viewStateTaxes: import('robot3').MachineState<"company/stateTaxes/done" | "company/stateTaxes/edit">;
|
|
3
|
+
editStateTaxes: import('robot3').MachineState<"company/stateTaxes/updated" | "CANCEL">;
|
|
4
|
+
done: import('robot3').MachineState<string>;
|
|
5
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { state as o, transition as e, reduce as T } from "robot3";
|
|
2
|
+
import { StateTaxesListContextual as n, StateTaxesFormContextual as i } from "./StateTaxesComponents.js";
|
|
3
|
+
import { componentEvents as a } from "../../../shared/constants.js";
|
|
4
|
+
const S = {
|
|
5
|
+
viewStateTaxes: o(
|
|
6
|
+
e(
|
|
7
|
+
a.COMPANY_STATE_TAX_EDIT,
|
|
8
|
+
"editStateTaxes",
|
|
9
|
+
T(
|
|
10
|
+
(t, s) => ({
|
|
11
|
+
...t,
|
|
12
|
+
component: i,
|
|
13
|
+
state: s.payload.state
|
|
14
|
+
})
|
|
15
|
+
)
|
|
16
|
+
),
|
|
17
|
+
e(a.COMPANY_STATE_TAX_DONE, "done")
|
|
18
|
+
),
|
|
19
|
+
editStateTaxes: o(
|
|
20
|
+
e(
|
|
21
|
+
a.COMPANY_STATE_TAX_UPDATED,
|
|
22
|
+
"viewStateTaxes",
|
|
23
|
+
T(
|
|
24
|
+
(t, s) => ({
|
|
25
|
+
...t,
|
|
26
|
+
component: n,
|
|
27
|
+
state: void 0
|
|
28
|
+
})
|
|
29
|
+
)
|
|
30
|
+
),
|
|
31
|
+
e(
|
|
32
|
+
a.CANCEL,
|
|
33
|
+
"viewStateTaxes",
|
|
34
|
+
T(
|
|
35
|
+
(t) => ({
|
|
36
|
+
...t,
|
|
37
|
+
component: n,
|
|
38
|
+
state: void 0
|
|
39
|
+
})
|
|
40
|
+
)
|
|
41
|
+
)
|
|
42
|
+
),
|
|
43
|
+
done: o()
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
S as stateTaxesStateMachine
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=stateTaxesStateMachine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateTaxesStateMachine.js","sources":["../../../../src/components/Company/StateTaxes/stateTaxesStateMachine.tsx"],"sourcesContent":["import { reduce, state, state as final, transition } from 'robot3'\nimport type { ComponentType } from 'react'\nimport type { StateTaxesContextInterface } from './StateTaxesComponents'\nimport { StateTaxesFormContextual, StateTaxesListContextual } from './StateTaxesComponents'\nimport { componentEvents } from '@/shared/constants'\nimport type { MachineEventType } from '@/types/Helpers'\n\ntype EventPayloads = {\n [componentEvents.COMPANY_STATE_TAX_UPDATED]: undefined\n [componentEvents.COMPANY_STATE_TAX_EDIT]: { state: string }\n}\n\nexport const stateTaxesStateMachine = {\n viewStateTaxes: state(\n transition(\n componentEvents.COMPANY_STATE_TAX_EDIT,\n 'editStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_EDIT>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesFormContextual as ComponentType,\n state: ev.payload.state,\n }),\n ),\n ),\n transition(componentEvents.COMPANY_STATE_TAX_DONE, 'done'),\n ),\n editStateTaxes: state(\n transition(\n componentEvents.COMPANY_STATE_TAX_UPDATED,\n 'viewStateTaxes',\n reduce(\n (\n ctx: StateTaxesContextInterface,\n ev: MachineEventType<EventPayloads, typeof componentEvents.COMPANY_STATE_TAX_UPDATED>,\n ): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n transition(\n componentEvents.CANCEL,\n 'viewStateTaxes',\n reduce(\n (ctx: StateTaxesContextInterface): StateTaxesContextInterface => ({\n ...ctx,\n component: StateTaxesListContextual as ComponentType,\n state: undefined,\n }),\n ),\n ),\n ),\n done: final(),\n}\n"],"names":["stateTaxesStateMachine","state","transition","componentEvents","reduce","ctx","ev","StateTaxesFormContextual","StateTaxesListContextual","final"],"mappings":";;;AAYO,MAAMA,IAAyB;AAAA,EACpC,gBAAgBC;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWE;AAAA,UACX,OAAOD,EAAG,QAAQ;AAAA,QACpB;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAJ,EAAWC,EAAgB,wBAAwB,MAAM;AAAA,EAC3D;AAAA,EACA,gBAAgBF;AAAA,IACdC;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CACEC,GACAC,OACgC;AAAA,UAChC,GAAGD;AAAA,UACH,WAAWG;AAAA,UACX,OAAO;AAAA,QACT;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAN;AAAA,MACEC,EAAgB;AAAA,MAChB;AAAA,MACAC;AAAA,QACE,CAACC,OAAiE;AAAA,UAChE,GAAGA;AAAA,UACH,WAAWG;AAAA,UACX,OAAO;AAAA,QACT;AAAA,MAAA;AAAA,IACF;AAAA,EAEJ;AAAA,EACA,MAAMC,EAAM;AACd;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BankAccountForm.js","sources":["../../../../src/components/Contractor/PaymentMethod/BankAccountForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { BankAccountFormProps } from './types'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\n\nexport function BankAccountForm({ bankAccount }: BankAccountFormProps) {\n const { t } = useTranslation('Contractor.PaymentMethod', { keyPrefix: 'bankAccountForm' })\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","bankAccount","t","useTranslation","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;AAIgB,SAAAA,EAAgB,EAAE,aAAAC,KAAqC;AAC/D,QAAA,EAAE,GAAAC,MAAMC,EAAe,4BAA4B,EAAE,WAAW,mBAAmB;AAEzF,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOL,EAAE,WAAW;AAAA,QACpB,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,oBAAoB;AAAA,QAC7B,YAAU;AAAA,QACV,aAAaA,EAAE,0BAA0B;AAAA,QACzC,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC7C;AAAA,IAEA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,oBAAoB;AAAA,QAC7B,cAAcA,EAAE,2BAA2B;AAAA,QAC3C,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAON,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAE;AAAA,UACrD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAE;AAAA,QAAA;AAAA,MACrD;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"BankAccountForm.js","sources":["../../../../src/components/Contractor/PaymentMethod/BankAccountForm.tsx"],"sourcesContent":["import { useTranslation } from 'react-i18next'\nimport type { BankAccountFormProps } from './types'\nimport { RadioGroupField, TextInputField } from '@/components/Common'\n\nexport function BankAccountForm({ bankAccount }: BankAccountFormProps) {\n const { t } = useTranslation('Contractor.PaymentMethod', { keyPrefix: 'bankAccountForm' })\n\n return (\n <>\n <TextInputField\n name=\"name\"\n isRequired\n label={t('nameLabel')}\n errorMessage={t('validations.accountName')}\n />\n\n <TextInputField\n name=\"routingNumber\"\n label={t('routingNumberLabel')}\n isRequired\n description={t('routingNumberDescription')}\n errorMessage={t('validations.routingNumber')}\n />\n\n <TextInputField\n name=\"accountNumber\"\n label={t('accountNumberLabel')}\n errorMessage={t('validations.accountNumber')}\n isRequired\n />\n\n <RadioGroupField\n name=\"accountType\"\n isRequired\n label={t('accountTypeLabel')}\n options={[\n { value: 'Checking', label: t('accountTypeChecking') },\n { value: 'Savings', label: t('accountTypeSavings') },\n ]}\n />\n </>\n )\n}\n"],"names":["BankAccountForm","bankAccount","t","useTranslation","jsxs","Fragment","jsx","TextInputField","RadioGroupField"],"mappings":";;;;AAIgB,SAAAA,EAAgB,EAAE,aAAAC,KAAqC;AAC/D,QAAA,EAAE,GAAAC,MAAMC,EAAe,4BAA4B,EAAE,WAAW,mBAAmB;AAEzF,SAEI,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAOL,EAAE,WAAW;AAAA,QACpB,cAAcA,EAAE,yBAAyB;AAAA,MAAA;AAAA,IAC3C;AAAA,IAEA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,oBAAoB;AAAA,QAC7B,YAAU;AAAA,QACV,aAAaA,EAAE,0BAA0B;AAAA,QACzC,cAAcA,EAAE,2BAA2B;AAAA,MAAA;AAAA,IAC7C;AAAA,IAEA,gBAAAI;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,OAAOL,EAAE,oBAAoB;AAAA,QAC7B,cAAcA,EAAE,2BAA2B;AAAA,QAC3C,YAAU;AAAA,MAAA;AAAA,IACZ;AAAA,IAEA,gBAAAI;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,YAAU;AAAA,QACV,OAAON,EAAE,kBAAkB;AAAA,QAC3B,SAAS;AAAA,UACP,EAAE,OAAO,YAAY,OAAOA,EAAE,qBAAqB,EAAE;AAAA,UACrD,EAAE,OAAO,WAAW,OAAOA,EAAE,oBAAoB,EAAE;AAAA,QAAA;AAAA,MACrD;AAAA,IAAA;AAAA,EACF,GACF;AAEJ;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as i, jsxs as r, Fragment as s } from "react/jsx-runtime";
|
|
2
2
|
import { FormProvider as R } from "react-hook-form";
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { useComponentContext as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { Form as
|
|
3
|
+
import { useTranslation as q } from "react-i18next";
|
|
4
|
+
import { useComponentContext as F } from "../../../contexts/ComponentAdapter/useComponentContext.js";
|
|
5
|
+
import { useI18n as N } from "../../../i18n/I18n.js";
|
|
6
|
+
import { Form as T } from "../../Common/Form/Form.js";
|
|
7
7
|
import { Grid as a } from "../../Common/Grid/Grid.js";
|
|
8
8
|
import { Flex as x } from "../../Common/Flex/Flex.js";
|
|
9
9
|
import { normalizeSSN as v } from "../../../helpers/ssn.js";
|
|
@@ -27,10 +27,10 @@ function U({
|
|
|
27
27
|
isEditing: o,
|
|
28
28
|
className: y
|
|
29
29
|
}) {
|
|
30
|
-
const l =
|
|
31
|
-
|
|
32
|
-
const { t: e } =
|
|
33
|
-
return /* @__PURE__ */ i("section", { className: y, children: /* @__PURE__ */ i(R, { ...d, children: /* @__PURE__ */ r(
|
|
30
|
+
const l = F();
|
|
31
|
+
N("Contractor.Profile");
|
|
32
|
+
const { t: e } = q("Contractor.Profile");
|
|
33
|
+
return /* @__PURE__ */ i("section", { className: y, children: /* @__PURE__ */ i(R, { ...d, children: /* @__PURE__ */ r(T, { onSubmit: u, children: [
|
|
34
34
|
/* @__PURE__ */ r(a, { gridTemplateColumns: "1fr", gap: 24, className: "mb-8", children: [
|
|
35
35
|
/* @__PURE__ */ r("header", { children: [
|
|
36
36
|
/* @__PURE__ */ i(l.Heading, { as: "h2", children: e("title") }),
|
|
@@ -59,6 +59,7 @@ function U({
|
|
|
59
59
|
m,
|
|
60
60
|
{
|
|
61
61
|
name: "contractorType",
|
|
62
|
+
isRequired: !0,
|
|
62
63
|
label: e("fields.contractorType.label"),
|
|
63
64
|
options: C
|
|
64
65
|
}
|
|
@@ -104,6 +105,7 @@ function U({
|
|
|
104
105
|
m,
|
|
105
106
|
{
|
|
106
107
|
name: "wageType",
|
|
108
|
+
isRequired: !0,
|
|
107
109
|
label: e("fields.wageType.label"),
|
|
108
110
|
options: g
|
|
109
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContractorProfileForm.js","sources":["../../../../src/components/Contractor/Profile/ContractorProfileForm.tsx"],"sourcesContent":["import { FormProvider } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { useContractorProfile } from './useContractorProfile'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Flex } from '@/components/Common/Flex'\nimport { TextInputField } from '@/components/Common/Fields/TextInputField'\nimport { NumberInputField } from '@/components/Common/Fields/NumberInputField'\nimport { RadioGroupField } from '@/components/Common/Fields/RadioGroupField'\nimport { SwitchField } from '@/components/Common/Fields/SwitchField'\nimport { DatePickerField } from '@/components/Common/Fields/DatePickerField'\nimport { normalizeSSN } from '@/helpers/ssn'\nimport { normalizeEin } from '@/helpers/federalEin'\n\n// Pure presentation component - takes all data as props\nexport type ContractorProfileFormProps = ReturnType<typeof useContractorProfile> & {\n className?: string\n}\n\nexport function ContractorProfileForm({\n formMethods,\n handleSubmit,\n formState,\n handleCancel,\n shouldShowEmailField,\n shouldShowBusinessFields,\n shouldShowIndividualFields,\n shouldShowHourlyRate,\n contractorTypeOptions,\n wageTypeOptions,\n isEditing,\n className,\n}: ContractorProfileFormProps) {\n const Components = useComponentContext()\n useI18n('Contractor.Profile')\n const { t } = useTranslation('Contractor.Profile')\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit}>\n <Grid gridTemplateColumns=\"1fr\" gap={24} className=\"mb-8\">\n <header>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>{t('subtitle')}</Components.Text>\n </header>\n\n {/* Invite Contractor Card */}\n <Components.Card>\n <Grid gap={16}>\n {/* Invite Contractor Toggle */}\n <SwitchField\n name=\"inviteContractor\"\n label={t('fields.inviteContractor.label')}\n description={t('fields.inviteContractor.description')}\n />\n\n {/* Email Field - shown when inviting contractor */}\n {shouldShowEmailField && (\n <TextInputField\n name=\"email\"\n label={t('fields.email.label')}\n isRequired\n type=\"email\"\n />\n )}\n </Grid>\n </Components.Card>\n\n {/* Contractor Type */}\n <RadioGroupField\n name=\"contractorType\"\n label={t('fields.contractorType.label')}\n options={contractorTypeOptions}\n />\n\n {/* Individual Contractor Fields */}\n {shouldShowIndividualFields && (\n <>\n <Grid gridTemplateColumns={{ base: '1fr', medium: '1fr 1fr' }} gap={16}>\n <TextInputField name=\"firstName\" label={t('fields.firstName.label')} isRequired />\n <TextInputField name=\"middleInitial\" label={t('fields.middleInitial.label')} />\n </Grid>\n <TextInputField name=\"lastName\" label={t('fields.lastName.label')} isRequired />\n <TextInputField\n name=\"ssn\"\n label={t('fields.ssn.label')}\n placeholder={t('fields.ssn.placeholder')}\n transform={normalizeSSN}\n isRequired\n />\n </>\n )}\n\n {/* Business Contractor Fields */}\n {shouldShowBusinessFields && (\n <>\n <TextInputField\n name=\"businessName\"\n label={t('fields.businessName.label')}\n isRequired\n />\n <TextInputField\n name=\"ein\"\n label={t('fields.ein.label')}\n placeholder={t('fields.ein.placeholder')}\n transform={normalizeEin}\n isRequired\n />\n </>\n )}\n\n {/* Wage Type */}\n <RadioGroupField\n name=\"wageType\"\n label={t('fields.wageType.label')}\n options={wageTypeOptions}\n />\n\n {/* Hourly Rate - shown for hourly contractors */}\n {shouldShowHourlyRate && (\n <NumberInputField\n name=\"hourlyRate\"\n label={t('fields.hourlyRate.label')}\n min={0}\n isRequired\n format=\"currency\"\n />\n )}\n\n {/* Start Date */}\n <DatePickerField\n name=\"startDate\"\n label={t('fields.startDate.label')}\n description={t('fields.startDate.description')}\n isRequired\n />\n </Grid>\n\n {/* Actions */}\n <Flex gap={12} justifyContent=\"flex-end\">\n <Components.Button type=\"button\" variant=\"secondary\" onClick={handleCancel}>\n {t('buttons.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" variant=\"primary\" isDisabled={formState.isSubmitting}>\n {formState.isSubmitting\n ? isEditing\n ? t('buttons.updating')\n : t('buttons.creating')\n : isEditing\n ? t('buttons.update')\n : t('buttons.create')}\n </Components.Button>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["ContractorProfileForm","formMethods","handleSubmit","formState","handleCancel","shouldShowEmailField","shouldShowBusinessFields","shouldShowIndividualFields","shouldShowHourlyRate","contractorTypeOptions","wageTypeOptions","isEditing","className","Components","useComponentContext","useI18n","t","useTranslation","jsx","FormProvider","jsxs","Form","Grid","SwitchField","TextInputField","RadioGroupField","Fragment","normalizeSSN","normalizeEin","NumberInputField","DatePickerField","Flex"],"mappings":";;;;;;;;;;;;;;;AAqBO,SAASA,EAAsB;AAAA,EACpC,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,4BAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,GAA+B;AAC7B,QAAMC,IAAaC,EAAoB;AACvC,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAG/C,SAAA,gBAAAC,EAAC,WAAQ,EAAA,WAAAN,GACP,UAAC,gBAAAM,EAAAC,GAAA,EAAc,GAAGlB,GAChB,UAAA,gBAAAmB,EAACC,GAAK,EAAA,UAAUnB,GACd,UAAA;AAAA,IAAA,gBAAAkB,EAACE,KAAK,qBAAoB,OAAM,KAAK,IAAI,WAAU,QACjD,UAAA;AAAA,MAAA,gBAAAF,EAAC,UACC,EAAA,UAAA;AAAA,QAAA,gBAAAF,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAG,EAAE,OAAO,GAAE;AAAA,0BACvCH,EAAW,MAAX,EAAiB,UAAAG,EAAE,UAAU,EAAE,CAAA;AAAA,MAAA,GAClC;AAAA,wBAGCH,EAAW,MAAX,EACC,UAAC,gBAAAO,EAAAE,GAAA,EAAK,KAAK,IAET,UAAA;AAAA,QAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,OAAOP,EAAE,+BAA+B;AAAA,YACxC,aAAaA,EAAE,qCAAqC;AAAA,UAAA;AAAA,QACtD;AAAA,QAGCX,KACC,gBAAAa;AAAA,UAACM;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,OAAOR,EAAE,oBA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AA;AAAA,QAAA;AAAA,MACZ,GACF;AAAA,MAIF,gBAAAV;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOT,EAAE,uBAAuB;AAAA,UAChC,SAASN;AAAA,QAAA;AAAA,MACX;AAAA,MAGCF,KACC,gBAAAU;AAAA,QAACW;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOb,EAAE,yBAAyB;AAAA,UAClC,KAAK;AAAA,UACL,YAAU;AAAA,UACV,QAAO;AAAA,QAAA;AAAA,MACT;AAAA,MAIF,gBAAAE;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOd,EAAE,wBAAwB;AAAA,UACjC,aAAaA,EAAE,8BAA8B;AAAA,UAC7C,YAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GACF;AAAA,IAGC,gBAAAI,EAAAW,GAAA,EAAK,KAAK,IAAI,gBAAe,YAC5B,UAAA;AAAA,MAAC,gBAAAb,EAAAL,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,aAAY,SAAST,GAC3D,UAAEY,EAAA,gBAAgB,EACrB,CAAA;AAAA,MACA,gBAAAE,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,WAAU,YAAYV,EAAU,cACtE,UAAUA,EAAA,eAELa,EADFL,IACI,qBACA,kBADkB,IAGpBK,EADFL,IACI,mBACA,gBADgB,EAE1B,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"ContractorProfileForm.js","sources":["../../../../src/components/Contractor/Profile/ContractorProfileForm.tsx"],"sourcesContent":["import { FormProvider } from 'react-hook-form'\nimport { useTranslation } from 'react-i18next'\nimport type { useContractorProfile } from './useContractorProfile'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { useI18n } from '@/i18n'\nimport { Form } from '@/components/Common/Form'\nimport { Grid } from '@/components/Common/Grid/Grid'\nimport { Flex } from '@/components/Common/Flex'\nimport { TextInputField } from '@/components/Common/Fields/TextInputField'\nimport { NumberInputField } from '@/components/Common/Fields/NumberInputField'\nimport { RadioGroupField } from '@/components/Common/Fields/RadioGroupField'\nimport { SwitchField } from '@/components/Common/Fields/SwitchField'\nimport { DatePickerField } from '@/components/Common/Fields/DatePickerField'\nimport { normalizeSSN } from '@/helpers/ssn'\nimport { normalizeEin } from '@/helpers/federalEin'\n\n// Pure presentation component - takes all data as props\nexport type ContractorProfileFormProps = ReturnType<typeof useContractorProfile> & {\n className?: string\n}\n\nexport function ContractorProfileForm({\n formMethods,\n handleSubmit,\n formState,\n handleCancel,\n shouldShowEmailField,\n shouldShowBusinessFields,\n shouldShowIndividualFields,\n shouldShowHourlyRate,\n contractorTypeOptions,\n wageTypeOptions,\n isEditing,\n className,\n}: ContractorProfileFormProps) {\n const Components = useComponentContext()\n useI18n('Contractor.Profile')\n const { t } = useTranslation('Contractor.Profile')\n\n return (\n <section className={className}>\n <FormProvider {...formMethods}>\n <Form onSubmit={handleSubmit}>\n <Grid gridTemplateColumns=\"1fr\" gap={24} className=\"mb-8\">\n <header>\n <Components.Heading as=\"h2\">{t('title')}</Components.Heading>\n <Components.Text>{t('subtitle')}</Components.Text>\n </header>\n\n {/* Invite Contractor Card */}\n <Components.Card>\n <Grid gap={16}>\n {/* Invite Contractor Toggle */}\n <SwitchField\n name=\"inviteContractor\"\n label={t('fields.inviteContractor.label')}\n description={t('fields.inviteContractor.description')}\n />\n\n {/* Email Field - shown when inviting contractor */}\n {shouldShowEmailField && (\n <TextInputField\n name=\"email\"\n label={t('fields.email.label')}\n isRequired\n type=\"email\"\n />\n )}\n </Grid>\n </Components.Card>\n\n {/* Contractor Type */}\n <RadioGroupField\n name=\"contractorType\"\n isRequired\n label={t('fields.contractorType.label')}\n options={contractorTypeOptions}\n />\n\n {/* Individual Contractor Fields */}\n {shouldShowIndividualFields && (\n <>\n <Grid gridTemplateColumns={{ base: '1fr', medium: '1fr 1fr' }} gap={16}>\n <TextInputField name=\"firstName\" label={t('fields.firstName.label')} isRequired />\n <TextInputField name=\"middleInitial\" label={t('fields.middleInitial.label')} />\n </Grid>\n <TextInputField name=\"lastName\" label={t('fields.lastName.label')} isRequired />\n <TextInputField\n name=\"ssn\"\n label={t('fields.ssn.label')}\n placeholder={t('fields.ssn.placeholder')}\n transform={normalizeSSN}\n isRequired\n />\n </>\n )}\n\n {/* Business Contractor Fields */}\n {shouldShowBusinessFields && (\n <>\n <TextInputField\n name=\"businessName\"\n label={t('fields.businessName.label')}\n isRequired\n />\n <TextInputField\n name=\"ein\"\n label={t('fields.ein.label')}\n placeholder={t('fields.ein.placeholder')}\n transform={normalizeEin}\n isRequired\n />\n </>\n )}\n\n {/* Wage Type */}\n <RadioGroupField\n name=\"wageType\"\n isRequired\n label={t('fields.wageType.label')}\n options={wageTypeOptions}\n />\n\n {/* Hourly Rate - shown for hourly contractors */}\n {shouldShowHourlyRate && (\n <NumberInputField\n name=\"hourlyRate\"\n label={t('fields.hourlyRate.label')}\n min={0}\n isRequired\n format=\"currency\"\n />\n )}\n\n {/* Start Date */}\n <DatePickerField\n name=\"startDate\"\n label={t('fields.startDate.label')}\n description={t('fields.startDate.description')}\n isRequired\n />\n </Grid>\n\n {/* Actions */}\n <Flex gap={12} justifyContent=\"flex-end\">\n <Components.Button type=\"button\" variant=\"secondary\" onClick={handleCancel}>\n {t('buttons.cancel')}\n </Components.Button>\n <Components.Button type=\"submit\" variant=\"primary\" isDisabled={formState.isSubmitting}>\n {formState.isSubmitting\n ? isEditing\n ? t('buttons.updating')\n : t('buttons.creating')\n : isEditing\n ? t('buttons.update')\n : t('buttons.create')}\n </Components.Button>\n </Flex>\n </Form>\n </FormProvider>\n </section>\n )\n}\n"],"names":["ContractorProfileForm","formMethods","handleSubmit","formState","handleCancel","shouldShowEmailField","shouldShowBusinessFields","shouldShowIndividualFields","shouldShowHourlyRate","contractorTypeOptions","wageTypeOptions","isEditing","className","Components","useComponentContext","useI18n","t","useTranslation","jsx","FormProvider","jsxs","Form","Grid","SwitchField","TextInputField","RadioGroupField","Fragment","normalizeSSN","normalizeEin","NumberInputField","DatePickerField","Flex"],"mappings":";;;;;;;;;;;;;;;AAqBO,SAASA,EAAsB;AAAA,EACpC,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,cAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,0BAAAC;AAAA,EACA,4BAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,uBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,GAA+B;AAC7B,QAAMC,IAAaC,EAAoB;AACvC,EAAAC,EAAQ,oBAAoB;AAC5B,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,oBAAoB;AAG/C,SAAA,gBAAAC,EAAC,WAAQ,EAAA,WAAAN,GACP,UAAC,gBAAAM,EAAAC,GAAA,EAAc,GAAGlB,GAChB,UAAA,gBAAAmB,EAACC,GAAK,EAAA,UAAUnB,GACd,UAAA;AAAA,IAAA,gBAAAkB,EAACE,KAAK,qBAAoB,OAAM,KAAK,IAAI,WAAU,QACjD,UAAA;AAAA,MAAA,gBAAAF,EAAC,UACC,EAAA,UAAA;AAAA,QAAA,gBAAAF,EAACL,EAAW,SAAX,EAAmB,IAAG,MAAM,UAAAG,EAAE,OAAO,GAAE;AAAA,0BACvCH,EAAW,MAAX,EAAiB,UAAAG,EAAE,UAAU,EAAE,CAAA;AAAA,MAAA,GAClC;AAAA,wBAGCH,EAAW,MAAX,EACC,UAAC,gBAAAO,EAAAE,GAAA,EAAK,KAAK,IAET,UAAA;AAAA,QAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,OAAOP,EAAE,+BAA+B;AAAA,YACxC,aAAaA,EAAE,qCAAqC;AAAA,UAAA;AAAA,QACtD;AAAA,QAGCX,KACC,gBAA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,kBAAkB;AAAA,YAC3B,aAAaA,EAAE,wBAAwB;AAAA,YACvC,WAAWY;AAAA,YACX,YAAU;AAAA,UAAA;AAAA,QAAA;AAAA,MACZ,GACF;AAAA,MAIF,gBAAAV;AAAA,QAACO;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,YAAU;AAAA,UACV,OAAOT,EAAE,uBAAuB;AAAA,UAChC,SAASN;AAAA,QAAA;AAAA,MACX;AAAA,MAGCF,KACC,gBAAAU;AAAA,QAACW;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOb,EAAE,yBAAyB;AAAA,UAClC,KAAK;AAAA,UACL,YAAU;AAAA,UACV,QAAO;AAAA,QAAA;AAAA,MACT;AAAA,MAIF,gBAAAE;AAAA,QAACY;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,OAAOd,EAAE,wBAAwB;AAAA,UACjC,aAAaA,EAAE,8BAA8B;AAAA,UAC7C,YAAU;AAAA,QAAA;AAAA,MAAA;AAAA,IACZ,GACF;AAAA,IAGC,gBAAAI,EAAAW,GAAA,EAAK,KAAK,IAAI,gBAAe,YAC5B,UAAA;AAAA,MAAC,gBAAAb,EAAAL,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,aAAY,SAAST,GAC3D,UAAEY,EAAA,gBAAgB,EACrB,CAAA;AAAA,MACA,gBAAAE,EAACL,EAAW,QAAX,EAAkB,MAAK,UAAS,SAAQ,WAAU,YAAYV,EAAU,cACtE,UAAUA,EAAA,eAELa,EADFL,IACI,qBACA,kBADkB,IAGpBK,EADFL,IACI,mBACA,gBADgB,EAE1B,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,EACF,CAAA,EACF,CAAA,GACF;AAEJ;"}
|
|
@@ -11,26 +11,26 @@ import { TextInputField as B } from "../../Common/Fields/TextInputField/TextInpu
|
|
|
11
11
|
import { SelectField as b } from "../../Common/Fields/SelectField/SelectField.js";
|
|
12
12
|
import { NumberInputField as J } from "../../Common/Fields/NumberInputField/NumberInputField.js";
|
|
13
13
|
import { SwitchField as K } from "../../Common/Fields/SwitchField/SwitchField.js";
|
|
14
|
-
import { RadioGroupField as
|
|
15
|
-
import { ComboBoxField as
|
|
14
|
+
import { RadioGroupField as q } from "../../Common/Fields/RadioGroupField/RadioGroupField.js";
|
|
15
|
+
import { ComboBoxField as H } from "../../Common/Fields/ComboBoxField/ComboBoxField.js";
|
|
16
16
|
const me = () => {
|
|
17
17
|
const { t: e } = P("Employee.Compensation"), l = x("currency"), m = j(), S = F(
|
|
18
|
-
() => X.map(({ code:
|
|
18
|
+
() => X.map(({ code: o, description: D }) => ({ value: o, label: D })),
|
|
19
19
|
[]
|
|
20
20
|
), {
|
|
21
21
|
control: f,
|
|
22
22
|
register: h,
|
|
23
23
|
setValue: s,
|
|
24
24
|
formState: { errors: C, defaultValues: p }
|
|
25
|
-
} = k(),
|
|
25
|
+
} = k(), i = M({ control: f, name: "flsaStatus" }), _ = M({ control: f, name: "stateWcCovered" }), { currentJob: y, mode: n, minimumWages: E, handleFlsaChange: T, state: W, showTwoPercentStakeholder: v } = R();
|
|
26
26
|
if (U(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
27
|
+
i === a.OWNER ? s("paymentUnit", "Paycheck") : i === a.COMMISSION_ONLY_NONEXEMPT || i === a.COMMISSION_ONLY_EXEMPT ? (s("paymentUnit", "Year"), s("rate", 0)) : p?.paymentUnit && s("paymentUnit", p.paymentUnit);
|
|
28
|
+
}, [i, s, p?.paymentUnit]), !(n === "ADD_INITIAL_JOB" || n === "ADD_ADDITIONAL_JOB" || n === "EDIT_INITIAL_JOB" || n === "EDIT_ADDITIONAL_JOB"))
|
|
29
29
|
return;
|
|
30
30
|
const L = Object.keys(a).map(
|
|
31
|
-
(
|
|
32
|
-
value: a[
|
|
33
|
-
label: e(`flsaStatusLabels.${a[
|
|
31
|
+
(o) => ({
|
|
32
|
+
value: a[o],
|
|
33
|
+
label: e(`flsaStatusLabels.${a[o]}`)
|
|
34
34
|
})
|
|
35
35
|
), g = [
|
|
36
36
|
{ value: r.HOUR, label: e("paymentUnitOptions.Hour") },
|
|
@@ -38,7 +38,7 @@ const me = () => {
|
|
|
38
38
|
{ value: r.MONTH, label: e("paymentUnitOptions.Month") },
|
|
39
39
|
{ value: r.YEAR, label: e("paymentUnitOptions.Year") },
|
|
40
40
|
{ value: r.PAYCHECK, label: e("paymentUnitOptions.Paycheck") }
|
|
41
|
-
], c =
|
|
41
|
+
], c = i !== a.NONEXEMPT || y?.primary || n === "ADD_INITIAL_JOB", A = i === a.NONEXEMPT && E.length > 0;
|
|
42
42
|
let u = e("validations.rate");
|
|
43
43
|
return C.rate?.message === Y ? u = e("validations.nonZeroRate") : C.rate?.message === w && (u = e("validations.rateExemptThreshold", {
|
|
44
44
|
limit: l(N)
|
|
@@ -84,7 +84,7 @@ const me = () => {
|
|
|
84
84
|
min: 0,
|
|
85
85
|
errorMessage: u,
|
|
86
86
|
isRequired: !0,
|
|
87
|
-
isDisabled:
|
|
87
|
+
isDisabled: i === a.COMMISSION_ONLY_NONEXEMPT || i === a.COMMISSION_ONLY_EXEMPT
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
90
|
A && /* @__PURE__ */ d(O, { children: [
|
|
@@ -102,9 +102,9 @@ const me = () => {
|
|
|
102
102
|
name: "minimumWageId",
|
|
103
103
|
label: e("minimumWageLabel"),
|
|
104
104
|
description: e("minimumWageDescription"),
|
|
105
|
-
options: E.map((
|
|
106
|
-
value:
|
|
107
|
-
label: `${l(Number(
|
|
105
|
+
options: E.map((o) => ({
|
|
106
|
+
value: o.uuid,
|
|
107
|
+
label: `${l(Number(o.wage))} - ${o.authority}: ${o.notes ?? ""}`
|
|
108
108
|
})),
|
|
109
109
|
errorMessage: e("validations.minimumWage")
|
|
110
110
|
}
|
|
@@ -118,13 +118,14 @@ const me = () => {
|
|
|
118
118
|
description: e("paymentUnitDescription"),
|
|
119
119
|
options: g,
|
|
120
120
|
errorMessage: e("validations.paymentUnit"),
|
|
121
|
-
|
|
121
|
+
isRequired: !0,
|
|
122
|
+
isDisabled: i === a.OWNER || i === a.COMMISSION_ONLY_NONEXEMPT || i === a.COMMISSION_ONLY_EXEMPT
|
|
122
123
|
}
|
|
123
124
|
),
|
|
124
125
|
v && /* @__PURE__ */ t(m.Checkbox, { label: e("twoPercentStakeholderLabel"), name: "twoPercentShareholder" }),
|
|
125
126
|
W === "WA" && /* @__PURE__ */ d(O, { children: [
|
|
126
127
|
/* @__PURE__ */ t(
|
|
127
|
-
|
|
128
|
+
q,
|
|
128
129
|
{
|
|
129
130
|
name: "stateWcCovered",
|
|
130
131
|
label: e("stateWcCoveredLabel"),
|
|
@@ -152,7 +153,7 @@ const me = () => {
|
|
|
152
153
|
}
|
|
153
154
|
),
|
|
154
155
|
_ && /* @__PURE__ */ t(
|
|
155
|
-
|
|
156
|
+
H,
|
|
156
157
|
{
|
|
157
158
|
name: "stateWcClassCode",
|
|
158
159
|
label: e("stateWcClassCodeLabel"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Edit.js","sources":["../../../../src/components/Employee/Compensation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () => WA_RISK_CLASS_CODES.map(({ code, description }) => ({ value: code, label: description })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationCTA\"\n components={{ classificationCta: <Components.Link /> }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <Components.Checkbox label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","RadioGroupField","ComboBoxField"],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAMA,KAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAASC,EAAmB,UAAU,GACtCC,IAAaC,EAAoB,GAEjCC,IAAqBC;AAAA,IACzB,MAAMC,EAAoB,IAAI,CAAC,EAAE,MAAAC,GAAM,aAAAC,EAAY,OAAO,EAAE,OAAOD,GAAM,OAAOC,EAAc,EAAA;AAAA,IAC9F,CAAA;AAAA,EACF,GAEM;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,GAAQ,eAAAC,EAAc;AAAA,MACjCC,EAAmC,GAEjCC,IAAoBC,EAAS,EAAE,SAAAP,GAAS,MAAM,cAAc,GAC5DQ,IAAwBD,EAAS,EAAE,SAAAP,GAAS,MAAM,kBAAkB,GACpE,EAAE,YAAAS,GAAY,MAAAC,GAAM,cAAAC,GAAc,kBAAAC,GAAkB,OAAAC,GAAO,2BAAAC,MAC/DC,EAAgB;AAiBlB,MAdAC,EAAU,MAAM;AACV,IAAAV,MAAsBW,EAAW,QACnCf,EAAS,eAAe,UAAU,IAElCI,MAAsBW,EAAW,6BACjCX,MAAsBW,EAAW,0BAEjCf,EAAS,eAAe,MAAM,GAC9BA,EAAS,QAAQ,CAAC,KACTE,GAAe,eACfF,EAAA,eAAeE,EAAc,WAAW;AAAA,KAElD,CAACE,GAAmBJ,GAAUE,GAAe,WAAW,CAAC,GAG1D,EACEM,MAAS,qBACTA,MAAS,wBACTA,MAAS,sBACTA,MAAS;AAGX;AAEF,QAAMQ,IAAyB,OAAO,KAAKD,CAAU,EAAqC;AAAA,IACxF,CAAQE,OAAA;AAAA,MACN,OAAOF,EAAWE,CAAG;AAAA,MACrB,O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ation/Edit.tsx"],"sourcesContent":["import { useEffect, useMemo } from 'react'\nimport { useFormContext, useWatch } from 'react-hook-form'\nimport { Trans, useTranslation } from 'react-i18next'\nimport {\n type CompensationInputs,\n useCompensation,\n rateMinimumError,\n rateExemptThresholdError,\n} from './useCompensation'\nimport { FLSA_OVERTIME_SALARY_LIMIT, FlsaStatus, PAY_PERIODS } from '@/shared/constants'\nimport useNumberFormatter from '@/components/Common/hooks/useNumberFormatter'\nimport {\n NumberInputField,\n SelectField,\n TextInputField,\n SwitchField,\n RadioGroupField,\n ComboBoxField,\n} from '@/components/Common'\nimport { useComponentContext } from '@/contexts/ComponentAdapter/useComponentContext'\nimport { WA_RISK_CLASS_CODES } from '@/models/WA_RISK_CODES'\n\nexport interface SelectCategory {\n id: string\n name: string\n}\n\nexport const Edit = () => {\n const { t } = useTranslation('Employee.Compensation')\n const format = useNumberFormatter('currency')\n const Components = useComponentContext()\n\n const stateWcRiskOptions = useMemo(\n () => WA_RISK_CLASS_CODES.map(({ code, description }) => ({ value: code, label: description })),\n [],\n )\n\n const {\n control,\n register,\n setValue,\n formState: { errors, defaultValues },\n } = useFormContext<CompensationInputs>()\n\n const watchedFlsaStatus = useWatch({ control, name: 'flsaStatus' })\n const watchedStateWcCovered = useWatch({ control, name: 'stateWcCovered' })\n const { currentJob, mode, minimumWages, handleFlsaChange, state, showTwoPercentStakeholder } =\n useCompensation()\n\n /**Correctly set payment unit selected option and rate based on flsa status, falling back to default */\n useEffect(() => {\n if (watchedFlsaStatus === FlsaStatus.OWNER) {\n setValue('paymentUnit', 'Paycheck')\n } else if (\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n ) {\n setValue('paymentUnit', 'Year')\n setValue('rate', 0)\n } else if (defaultValues?.paymentUnit) {\n setValue('paymentUnit', defaultValues.paymentUnit)\n }\n }, [watchedFlsaStatus, setValue, defaultValues?.paymentUnit])\n\n if (\n !(\n mode === 'ADD_INITIAL_JOB' ||\n mode === 'ADD_ADDITIONAL_JOB' ||\n mode === 'EDIT_INITIAL_JOB' ||\n mode === 'EDIT_ADDITIONAL_JOB'\n )\n )\n return\n\n const classificationOptions = (Object.keys(FlsaStatus) as Array<keyof typeof FlsaStatus>).map(\n key => ({\n value: FlsaStatus[key],\n label: t(`flsaStatusLabels.${FlsaStatus[key]}`),\n }),\n )\n\n const paymentUnitOptions = [\n { value: PAY_PERIODS.HOUR, label: t('paymentUnitOptions.Hour') },\n { value: PAY_PERIODS.WEEK, label: t('paymentUnitOptions.Week') },\n { value: PAY_PERIODS.MONTH, label: t('paymentUnitOptions.Month') },\n { value: PAY_PERIODS.YEAR, label: t('paymentUnitOptions.Year') },\n { value: PAY_PERIODS.PAYCHECK, label: t('paymentUnitOptions.Paycheck') },\n ]\n\n const isFlsaSelectionEnabled =\n watchedFlsaStatus !== FlsaStatus.NONEXEMPT || currentJob?.primary || mode === 'ADD_INITIAL_JOB'\n\n const isAdjustMinimumWageEnabled =\n watchedFlsaStatus === FlsaStatus.NONEXEMPT && minimumWages.length > 0\n\n let rateErrorMessage = t('validations.rate')\n if (errors.rate?.message === rateMinimumError) {\n rateErrorMessage = t('validations.nonZeroRate')\n } else if (errors.rate?.message === rateExemptThresholdError) {\n rateErrorMessage = t('validations.rateExemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })\n }\n\n return (\n <>\n <TextInputField\n name=\"jobTitle\"\n label={t('jobTitle')}\n isRequired\n errorMessage={t('validations.title')}\n />\n {/* hiding flsa selection for secondary jobs */}\n {!isFlsaSelectionEnabled && <input type=\"hidden\" {...register('flsaStatus')} />}\n {isFlsaSelectionEnabled && (\n <SelectField\n name=\"flsaStatus\"\n label={t('employeeClassification')}\n description={\n <Trans\n t={t}\n i18nKey=\"classificationCTA\"\n components={{ classificationCta: <Components.Link /> }}\n />\n }\n errorMessage={t('validations.exemptThreshold', {\n limit: format(FLSA_OVERTIME_SALARY_LIMIT),\n })}\n options={classificationOptions}\n isRequired\n isDisabled={!isFlsaSelectionEnabled}\n onChange={handleFlsaChange}\n />\n )}\n <NumberInputField\n name=\"rate\"\n label={t('amount')}\n format=\"currency\"\n min={0}\n errorMessage={rateErrorMessage}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {isAdjustMinimumWageEnabled && (\n <>\n <SwitchField\n name=\"adjustForMinimumWage\"\n label={t('adjustForMinimumWage')}\n description={t('adjustForMinimumWageDescription')}\n />\n <SelectField\n name=\"minimumWageId\"\n label={t('minimumWageLabel')}\n description={t('minimumWageDescription')}\n options={minimumWages.map(wage => ({\n value: wage.uuid,\n label: `${format(Number(wage.wage))} - ${wage.authority}: ${wage.notes ?? ''}`,\n }))}\n errorMessage={t('validations.minimumWage')}\n />\n </>\n )}\n <SelectField\n name=\"paymentUnit\"\n label={t('paymentUnitLabel')}\n description={t('paymentUnitDescription')}\n options={paymentUnitOptions}\n errorMessage={t('validations.paymentUnit')}\n isRequired\n isDisabled={\n watchedFlsaStatus === FlsaStatus.OWNER ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_NONEXEMPT ||\n watchedFlsaStatus === FlsaStatus.COMMISSION_ONLY_EXEMPT\n }\n />\n {showTwoPercentStakeholder && (\n <Components.Checkbox label={t('twoPercentStakeholderLabel')} name=\"twoPercentShareholder\" />\n )}\n {state === 'WA' && (\n <>\n <RadioGroupField\n name=\"stateWcCovered\"\n label={t('stateWcCoveredLabel')}\n description={\n <Trans\n t={t}\n i18nKey=\"stateWcCoveredDescription\"\n components={{\n wcLink: (\n <Components.Link\n href=\"https://www.lni.wa.gov/insurance/rates-risk-classes/risk-classes-for-workers-compensation/risk-class-lookup#/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n />\n ),\n }}\n />\n }\n options={[\n { label: t('stateWcCoveredOptions.yes'), value: true },\n { label: t('stateWcCoveredOptions.no'), value: false },\n ]}\n />\n {watchedStateWcCovered && (\n <ComboBoxField\n name=\"stateWcClassCode\"\n label={t('stateWcClassCodeLabel')}\n options={stateWcRiskOptions}\n errorMessage={t('validations.stateWcClassCode')}\n placeholder={t('stateWcClassCodeLabel')}\n />\n )}\n </>\n )}\n </>\n )\n}\n"],"names":["Edit","t","useTranslation","format","useNumberFormatter","Components","useComponentContext","stateWcRiskOptions","useMemo","WA_RISK_CLASS_CODES","code","description","control","register","setValue","errors","defaultValues","useFormContext","watchedFlsaStatus","useWatch","watchedStateWcCovered","currentJob","mode","minimumWages","handleFlsaChange","state","showTwoPercentStakeholder","useCompensation","useEffect","FlsaStatus","classificationOptions","key","paymentUnitOptions","PAY_PERIODS","isFlsaSelectionEnabled","isAdjustMinimumWageEnabled","rateErrorMessage","rateMinimumError","rateExemptThresholdError","FLSA_OVERTIME_SALARY_LIMIT","jsxs","Fragment","jsx","TextInputField","SelectField","Trans","NumberInputField","SwitchField","wage","RadioGroupField","ComboBoxField"],"mappings":";;;;;;;;;;;;;;;AA2BO,MAAMA,KAAO,MAAM;AACxB,QAAM,EAAE,GAAAC,EAAA,IAAMC,EAAe,uBAAuB,GAC9CC,IAASC,EAAmB,UAAU,GACtCC,IAAaC,EAAoB,GAEjCC,IAAqBC;AAAA,IACzB,MAAMC,EAAoB,IAAI,CAAC,EAAE,MAAAC,GAAM,aAAAC,EAAY,OAAO,EAAE,OAAOD,GAAM,OAAOC,EAAc,EAAA;AAAA,IAC9F,CAAA;AAAA,EACF,GAEM;AAAA,IACJ,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,WAAW,EAAE,QAAAC,GAAQ,eAAAC,EAAc;AAAA,MACjCC,EAAmC,GAEjCC,IAAoBC,EAAS,EAAE,SAAAP,GAAS,MAAM,cAAc,GAC5DQ,IAAwBD,EAAS,EAAE,SAAAP,GAAS,MAAM,kBAAkB,GACpE,EAAE,YAA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