@feedmepos/mf-hrm-portal 2.3.2-dev.8 → 2.3.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 (114) hide show
  1. package/dist/{ApprovalCodeList-DIYhVMGW.js → ApprovalCodeList-C9r8CGNH.js} +15 -14
  2. package/dist/{AuditLogList-DIc3Jgpr.js → AuditLogList-Cu-KcQKa.js} +152 -147
  3. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-BQ-uIsTN.js +438 -0
  4. package/dist/EmployeeList-BaFqZnFM.js +776 -0
  5. package/dist/FormItem.vue_vue_type_script_setup_true_lang-Be1OU1_r.js +45 -0
  6. package/dist/FormSection.vue_vue_type_script_setup_true_lang-DknXTYiK.js +49 -0
  7. package/dist/{GrantUserList-8zmzFk9z.js → GrantUserList-Bjhx60M7.js} +16 -15
  8. package/dist/Main-CJQpjOgY.js +96 -0
  9. package/dist/{Main-DYzFd_qa.js → Main-DHiTgiDR.js} +5 -5
  10. package/dist/{Main-gRu17-N6.js → Main-LpfQqR_u.js} +999 -1005
  11. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-CqG0v0Sz.js +243 -0
  12. package/dist/{PermissionSetList-CL42jQY4.js → PermissionSetList-C0OZ_dvE.js} +76 -76
  13. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-T7dkd5Uv.js +4167 -0
  14. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-EwU7gHP7.js +35 -0
  15. package/dist/RoleList-DpyW5XLs.js +740 -0
  16. package/dist/{ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-B9NMhw9Z.js → ScheduleAddPositionModal.vue_vue_type_script_setup_true_lang-CqP-Dn1X.js} +1 -1
  17. package/dist/{ScheduleGeneralPage-751cEUwS.js → ScheduleGeneralPage-BNHi5jGf.js} +2 -2
  18. package/dist/{ScheduleModal.vue_vue_type_script_setup_true_lang-CBDNfiIM.js → ScheduleModal.vue_vue_type_script_setup_true_lang-B609MZoP.js} +186 -187
  19. package/dist/{SchedulePage-C-NcbGIl.js → SchedulePage-CrP5_m3p.js} +13 -13
  20. package/dist/{SchedulePositionPage-Ba0iiSRg.js → SchedulePositionPage-ei_NKAUw.js} +3 -3
  21. package/dist/{SelectFilter-Dpsq165k.js → SelectFilter-CEYQ-ViE.js} +1 -1
  22. package/dist/TeamMemberList-rPiKKu2b.js +1154 -0
  23. package/dist/TimesheetList-B1L4WkNh.js +402 -0
  24. package/dist/TimesheetList.vue_vue_type_style_index_0_scoped_63294af2_lang-By6YR-k2.js +58 -0
  25. package/dist/{app-DXkKrcRn.js → app-BzlH-2cN.js} +4015 -7756
  26. package/dist/app.js +3 -3
  27. package/dist/{approval-code-D2pGW-sI.js → approval-code-CWq2ce3u.js} +1 -1
  28. package/dist/{dayjs.min-BAz84JAQ.js → dayjs.min-D6T4JzVv.js} +21 -21
  29. package/dist/employee-Bw7kRokg.js +209 -0
  30. package/dist/{grant-user-B95RDjkR.js → grant-user-q_mkj3Vh.js} +1 -1
  31. package/dist/{index-TrBkLxJe.js → iteration-Dz0e08VH.js} +726 -698
  32. package/dist/{lodash-DXRsZpTB.js → lodash-DGG_-VgI.js} +1 -1
  33. package/dist/restaurant-DJBQY9N5.js +2688 -0
  34. package/dist/role-CiRbkZSm.js +92 -0
  35. package/dist/rule-DMgkHpva.js +783 -0
  36. package/dist/src/api/employee/index.d.ts +2 -1
  37. package/dist/src/api/timesheet/index.d.ts +1 -1
  38. package/dist/src/components/CollapsibleWrapper.vue.d.ts +3 -11
  39. package/dist/src/helpers/permission-set.d.ts +102 -1
  40. package/dist/src/helpers/rule.d.ts +2 -2
  41. package/dist/src/helpers/string.d.ts +1 -10
  42. package/dist/src/router/shared.d.ts +1 -3
  43. package/dist/src/stores/employee.d.ts +7 -1
  44. package/dist/src/stores/restaurant.d.ts +8 -68
  45. package/dist/src/stores/team.d.ts +0 -30
  46. package/dist/src/stores/timesheet.d.ts +51 -66
  47. package/dist/src/types/team.d.ts +1 -17
  48. package/dist/src/types/timesheet.d.ts +0 -3
  49. package/dist/src/views/audit-log/constants.d.ts +1 -1
  50. package/dist/src/views/audit-log/locales/index.d.ts +16 -12
  51. package/dist/src/views/hr/locales/index.d.ts +0 -20
  52. package/dist/src/views/hr/role/RoleForm.vue.d.ts +2 -29
  53. package/dist/src/views/scheduling/composables/useScheduleOnboardingAvailability.d.ts +1 -1
  54. package/dist/src/views/scheduling/composables/useScheduleOnboardingWizard.d.ts +1 -1
  55. package/dist/src/views/scheduling/composables/useScheduleShiftDraft.d.ts +1 -1
  56. package/dist/src/views/scheduling/composables/useScheduleShiftPopover.d.ts +1 -1
  57. package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -11
  58. package/dist/src/views/team/components/ConditionPermission.vue.d.ts +0 -11
  59. package/dist/src/views/team/components/PortalPermissionEditor.vue.d.ts +0 -21
  60. package/dist/src/views/team/components/PosRolePermission.vue.d.ts +0 -11
  61. package/dist/src/views/team/locales/index.d.ts +0 -716
  62. package/dist/src/views/team/member/AddMemberForm.vue.d.ts +3 -48
  63. package/dist/src/views/team/{components/MemberStatusBadge.vue.d.ts → member/MemberInfo.vue.d.ts} +2 -2
  64. package/dist/src/views/team/member/TeamMemberList.vue.d.ts +0 -1
  65. package/dist/string-VNuQNweN.js +15 -0
  66. package/dist/style.css +1 -1
  67. package/dist/tsconfig.app.tsbuildinfo +1 -1
  68. package/dist/{useAppStore-7O0GMkXY.js → useAppStore-TRX-PQD4.js} +1 -1
  69. package/dist/{useLoading-BZXydjer.js → useLoading-W3YSF8OB.js} +1 -1
  70. package/dist/{useReportPermissions-Cn3ntCJ9.js → useReportPermissions-CCkCAaGO.js} +3 -3
  71. package/package.json +3 -3
  72. package/dist/ConditionBuilderForm.vue_vue_type_script_setup_true_lang-4YsF7lXu.js +0 -459
  73. package/dist/EmployeeList-iVg4pI9Y.js +0 -896
  74. package/dist/FormSection.vue_vue_type_script_setup_true_lang-C9AE0EHw.js +0 -90
  75. package/dist/Main-ClJox3pV.js +0 -101
  76. package/dist/MyPosProfile-ARRrolbz.js +0 -290
  77. package/dist/PasscodePinField.vue_vue_type_script_setup_true_lang-TXPEqa46.js +0 -126
  78. package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-DkA0XbZw.js +0 -4208
  79. package/dist/PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js +0 -1831
  80. package/dist/RoleForm.vue_vue_type_script_setup_true_lang-B3N3hTcU.js +0 -547
  81. package/dist/RoleList-F9ZORhgE.js +0 -265
  82. package/dist/TeamMemberList-DZ0aRbxg.js +0 -2087
  83. package/dist/TimesheetList-DO5T__dL.js +0 -437
  84. package/dist/employee-yYhuhc9L.js +0 -172
  85. package/dist/iteration-CcXrOMQe.js +0 -30
  86. package/dist/member-grant-ByAQ1Qja.js +0 -54
  87. package/dist/restaurant-COSpCpTQ.js +0 -52
  88. package/dist/role-ZmCd2yG4.js +0 -98
  89. package/dist/rule-Bty9eoI3.js +0 -843
  90. package/dist/src/api/my-pos-profile/index.d.ts +0 -3
  91. package/dist/src/api/sso-provider/index.d.ts +0 -5
  92. package/dist/src/api/staff-invite/index.d.ts +0 -16
  93. package/dist/src/components/form/SegmentedTabs.vue.d.ts +0 -23
  94. package/dist/src/composables/useMenuAccess.d.ts +0 -56
  95. package/dist/src/composables/useSsoProviders.d.ts +0 -19
  96. package/dist/src/composables/useStaffInviteProviders.d.ts +0 -8
  97. package/dist/src/helpers/member-grant.d.ts +0 -36
  98. package/dist/src/helpers/my-pos-profile.d.ts +0 -37
  99. package/dist/src/helpers/pos-assignment-rows.d.ts +0 -28
  100. package/dist/src/helpers/staff-invite.d.ts +0 -54
  101. package/dist/src/router/menu-access-guard.d.ts +0 -17
  102. package/dist/src/types/my-pos-profile.d.ts +0 -24
  103. package/dist/src/types/sso-provider.d.ts +0 -10
  104. package/dist/src/types/staff-invite.d.ts +0 -100
  105. package/dist/src/views/my-pos-profile/MyPosProfile.vue.d.ts +0 -2
  106. package/dist/src/views/my-pos-profile/components/PasscodeChangedDialog.vue.d.ts +0 -4
  107. package/dist/src/views/my-pos-profile/locales/index.d.ts +0 -196
  108. package/dist/src/views/team/components/MemberGrantFields.vue.d.ts +0 -51
  109. package/dist/src/views/team/components/PosAssignmentRows.vue.d.ts +0 -44
  110. package/dist/src/views/team/member/ExistingMemberNotice.vue.d.ts +0 -11
  111. package/dist/src/views/team/member/MemberDetailsCard.vue.d.ts +0 -35
  112. package/dist/src/views/team/member/MemberHeaderCard.vue.d.ts +0 -19
  113. package/dist/string-DZQ1uNjn.js +0 -22
  114. package/dist/timesheet-CFD6XPiG.js +0 -76
@@ -1,90 +0,0 @@
1
- import { createElementBlock as s, openBlock as o, createElementVNode as n, ref as y, computed as h, defineComponent as d, renderSlot as r, createCommentVNode as i, toDisplayString as a, normalizeClass as m, createVNode as _, withCtx as b } from "vue";
2
- import { a as x } from "./app-DXkKrcRn.js";
3
- const $ = {};
4
- function k(e, t) {
5
- return o(), s("div", null, [...t[0] || (t[0] = [
6
- n("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
7
- ])]);
8
- }
9
- const E = /* @__PURE__ */ x($, [["render", k]]), H = (e) => {
10
- const t = y("");
11
- function l(c) {
12
- return `${c}`.trim().toLowerCase();
13
- }
14
- const u = h(() => l(t.value));
15
- function f(c) {
16
- return u.value ? c.some((p) => l(p).includes(u.value)) : !0;
17
- }
18
- return { searchKey: t, filter: f };
19
- }, v = { class: "space-y-8" }, w = { class: "flex items-center justify-between" }, C = { class: "space-y-8" }, S = { class: "fm-typo-en-body-lg-600" }, g = {
20
- key: 0,
21
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
22
- }, K = /* @__PURE__ */ d({
23
- __name: "FormItem",
24
- props: {
25
- label: {},
26
- description: {}
27
- },
28
- setup(e) {
29
- return (t, l) => (o(), s("div", v, [
30
- n("div", w, [
31
- n("div", C, [
32
- n("p", S, a(e.label), 1),
33
- e.description ? (o(), s("p", g, a(e.description), 1)) : i("", !0)
34
- ]),
35
- r(t.$slots, "append")
36
- ]),
37
- r(t.$slots, "default")
38
- ]));
39
- }
40
- }), B = /* @__PURE__ */ d({
41
- __name: "FormColumn",
42
- props: {
43
- shrinkable: { type: Boolean }
44
- },
45
- setup(e) {
46
- return (t, l) => (o(), s("div", {
47
- class: m(["flex-1 flex flex-col space-y-24", { "min-h-0": e.shrinkable }])
48
- }, [
49
- r(t.$slots, "default")
50
- ], 2));
51
- }
52
- }), V = {
53
- key: 0,
54
- class: "flex flex-row justify-between items-center"
55
- }, F = { class: "space-y-4" }, N = { class: "fm-typo-en-title-sm-600" }, T = {
56
- key: 0,
57
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
58
- }, D = /* @__PURE__ */ d({
59
- __name: "FormSection",
60
- props: {
61
- title: {},
62
- subTitle: {},
63
- shrinkable: { type: Boolean }
64
- },
65
- setup(e) {
66
- return (t, l) => (o(), s("div", {
67
- class: m(["flex flex-col space-y-16", { "min-h-0": e.shrinkable }])
68
- }, [
69
- e.title ? (o(), s("div", V, [
70
- n("div", F, [
71
- n("p", N, a(e.title), 1),
72
- e.subTitle ? (o(), s("p", T, a(e.subTitle), 1)) : i("", !0)
73
- ]),
74
- r(t.$slots, "append-title")
75
- ])) : i("", !0),
76
- _(B, { shrinkable: e.shrinkable }, {
77
- default: b(() => [
78
- r(t.$slots, "default")
79
- ]),
80
- _: 3
81
- }, 8, ["shrinkable"])
82
- ], 2));
83
- }
84
- });
85
- export {
86
- E as H,
87
- D as _,
88
- K as a,
89
- H as u
90
- };
@@ -1,101 +0,0 @@
1
- import { defineComponent as M, ref as R, computed as i, watch as g, resolveComponent as c, createBlock as p, openBlock as d, withCtx as u, createElementVNode as A, createVNode as v, resolveDynamicComponent as h, createCommentVNode as k, createTextVNode as N, toDisplayString as w } from "vue";
2
- import { useRouter as x, useRoute as F } from "vue-router";
3
- import { useI18n as I, useCoreStore as O } from "@feedmepos/mf-common";
4
- import { _ as $ } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js";
5
- import { _ as q } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
6
- import { u as D } from "./PortalUserSearcher.vue_vue_type_style_index_0_scoped_827dfd60_lang-CA87qQ4b.js";
7
- import { u as P } from "./restaurant-COSpCpTQ.js";
8
- import "@feedmepos/ui-library";
9
- import "./rule-Bty9eoI3.js";
10
- import "./lodash-DXRsZpTB.js";
11
- import "./index-TrBkLxJe.js";
12
- import "./useAppStore-7O0GMkXY.js";
13
- import { R as B } from "./app-DXkKrcRn.js";
14
- import "./member-grant-ByAQ1Qja.js";
15
- import "./role-ZmCd2yG4.js";
16
- /* empty css */
17
- import "./useReportPermissions-Cn3ntCJ9.js";
18
- const U = { class: "space-y-24" }, se = /* @__PURE__ */ M({
19
- __name: "Main",
20
- setup(j) {
21
- const { t: o } = I(), b = x(), S = F(), T = O(), { readRestaurants: V } = P(), { loadProviders: L } = D(), f = R(), _ = R(), s = {
22
- member: B.TEAM_MEMBER,
23
- role: B.TEAM_ROLE
24
- }, a = i({
25
- get: () => Object.keys(s).find((e) => s[e] === S.name) ?? "member",
26
- set: (e) => {
27
- b.push({
28
- name: s[e],
29
- query: b.currentRoute.value.query
30
- });
31
- }
32
- });
33
- V(), g(T.currentBusiness, () => L(), { immediate: !0 });
34
- const r = i(() => l.value.find((e) => e.value === a.value) || l.value[0]), l = i(() => [
35
- {
36
- label: o("team.title"),
37
- subTitle: o("team.subtitle"),
38
- value: "member",
39
- createButtonLabel: o("team.actions.addMember"),
40
- createButtonAction: () => {
41
- var e;
42
- (e = f.value) == null || e.create();
43
- }
44
- },
45
- {
46
- label: o("permissionSet.title"),
47
- value: "role",
48
- createButtonLabel: o("permissionSet.createButtonLabel"),
49
- createButtonAction: () => {
50
- var e;
51
- (e = _.value) == null || e.create();
52
- }
53
- }
54
- ]);
55
- return (e, n) => {
56
- const y = c("FmSpacer"), C = c("FmTabs"), E = c("RouterView");
57
- return d(), p(q, {
58
- heading: r.value.label
59
- }, {
60
- "sub-heading": u(() => [
61
- N(w(r.value.subTitle), 1)
62
- ]),
63
- "append-heading": u(() => {
64
- var t;
65
- return [
66
- v(y),
67
- (t = r.value) != null && t.createButtonLabel ? (d(), p($, {
68
- key: 0,
69
- icon: "add",
70
- label: r.value.createButtonLabel,
71
- onClick: n[0] || (n[0] = (m) => r.value.createButtonAction())
72
- }, null, 8, ["label"])) : k("", !0)
73
- ];
74
- }),
75
- default: u(() => [
76
- A("div", U, [
77
- v(C, {
78
- modelValue: a.value,
79
- "onUpdate:modelValue": n[1] || (n[1] = (t) => a.value = t),
80
- items: l.value
81
- }, null, 8, ["modelValue", "items"]),
82
- v(E, null, {
83
- default: u(({ Component: t }) => [
84
- (d(), p(h(t), {
85
- ref: (m) => {
86
- a.value === "member" && (f.value = m), a.value === "role" && (_.value = m);
87
- }
88
- }, null, 512))
89
- ]),
90
- _: 1
91
- })
92
- ])
93
- ]),
94
- _: 1
95
- }, 8, ["heading"]);
96
- };
97
- }
98
- });
99
- export {
100
- se as default
101
- };
@@ -1,290 +0,0 @@
1
- import { defineComponent as j, ref as u, computed as v, resolveComponent as h, createBlock as $, openBlock as a, withCtx as F, createElementVNode as t, createElementBlock as l, Fragment as E, renderList as L, toDisplayString as c, unref as s, createVNode as r, onUnmounted as Q, watch as X, createCommentVNode as Y, h as U } from "vue";
2
- import { useI18n as R, useCoreStore as Z, FeedMeAuth as ee } from "@feedmepos/mf-common";
3
- import { useSnackbar as oe, useDialog as te, useBreakpoints as se, components as ae, SnackbarPosition as le } from "@feedmepos/ui-library";
4
- import { _ as ne } from "./PageLayout.vue_vue_type_script_setup_true_lang-HKK4cbW8.js";
5
- import { t as re, f as ce, c as ie, r as de, i as V, d as me, p as ue, o as pe } from "./app-DXkKrcRn.js";
6
- import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js";
7
- const ye = { class: "flex w-full flex-col items-center gap-8 pt-[4px]" }, _e = { class: "fm-typo-en-title-sm-600 text-center" }, ge = { class: "py-[4px]" }, ve = {
8
- class: "flex items-center justify-center gap-4 rounded-[12px] bg-fm-color-neutral-gray-100 px-16 py-[20px]",
9
- "data-testid": "new-passcode"
10
- }, he = { class: "fm-typo-en-body-md-400 pt-16 text-center text-fm-color-typo-primary" }, Pe = /* @__PURE__ */ j({
11
- __name: "PasscodeChangedDialog",
12
- setup(T, { expose: e }) {
13
- const { t: P } = R(), y = u(!1), x = u(""), b = v(() => x.value.split("")), A = (_) => {
14
- x.value = _, y.value = !0;
15
- }, i = () => {
16
- y.value = !1, x.value = "";
17
- };
18
- return e({ open: A }), (_, n) => {
19
- const g = h("FmIcon"), p = h("FmButton"), S = h("FmDialog");
20
- return a(), $(S, {
21
- modelValue: y.value,
22
- "onUpdate:modelValue": [
23
- n[0] || (n[0] = (d) => y.value = d),
24
- n[1] || (n[1] = (d) => !d && i())
25
- ],
26
- "min-width": 360,
27
- "max-width": 460,
28
- "close-button": !1,
29
- "dismiss-away": !1
30
- }, {
31
- "dialog-header": F(() => [
32
- t("div", ye, [
33
- r(g, {
34
- name: "check_circle",
35
- size: "xl",
36
- outline: "",
37
- color: "typo-success"
38
- }),
39
- t("p", _e, c(s(P)("myPosProfile.changed.title")), 1)
40
- ])
41
- ]),
42
- "dialog-footer": F(() => [
43
- r(p, {
44
- class: "w-full",
45
- variant: "primary",
46
- label: s(P)("myPosProfile.changed.done"),
47
- onClick: i
48
- }, null, 8, ["label"])
49
- ]),
50
- default: F(() => [
51
- t("div", ge, [
52
- t("div", ve, [
53
- (a(!0), l(E, null, L(b.value, (d, C) => (a(), l("span", {
54
- key: C,
55
- class: "flex h-[56px] w-[52px] items-center justify-center text-[48px] font-bold leading-[56px] text-fm-color-typo-primary"
56
- }, c(d), 1))), 128))
57
- ]),
58
- t("p", he, c(s(P)("myPosProfile.changed.message")), 1)
59
- ])
60
- ]),
61
- _: 1
62
- }, 8, ["modelValue"]);
63
- };
64
- }
65
- }), xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, be = {
66
- key: 1,
67
- class: "flex flex-1 items-center justify-center"
68
- }, we = {
69
- key: 2,
70
- class: "space-y-24"
71
- }, ke = {
72
- key: 0,
73
- role: "alert",
74
- "data-testid": "pos-user-shared",
75
- class: "flex items-center gap-[10px] rounded-[12px] bg-fm-color-system-warning-100 px-16 py-[14px]"
76
- }, Fe = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, Se = { class: "space-y-12" }, Ae = { class: "fm-typo-en-body-lg-600" }, Ce = { class: "flex items-center gap-24 rounded-[12px] border border-fm-color-neutral-gray-100 p-24 xs:flex-wrap" }, De = { class: "flex h-48 w-48 shrink-0 items-center justify-center rounded-[12px] bg-fm-color-neutral-gray-100" }, Be = { class: "min-w-0 flex-1" }, Ue = { class: "flex items-center gap-8" }, $e = ["aria-label"], Ee = {
77
- key: 0,
78
- class: "h-[14px] w-[14px] rounded-full bg-fm-color-typo-primary"
79
- }, Ie = {
80
- key: 1,
81
- class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary"
82
- }, Me = {
83
- key: 0,
84
- class: "fm-typo-en-body-md-400 pt-[6px] text-fm-color-typo-secondary"
85
- }, ze = { class: "flex flex-wrap items-center gap-[10px] rounded-[12px] bg-fm-color-neutral-gray-100 px-16 py-[14px]" }, Ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, je = 4, He = /* @__PURE__ */ j({
86
- __name: "MyPosProfile",
87
- setup(T) {
88
- const { t: e, locale: P } = R(), y = Z(), x = oe(), b = te(), { breakpoints: A } = se(), i = u(null), _ = u(!0), n = u(!1), g = u(!1), p = u(!1), S = u(), d = u(Date.now()), C = setInterval(() => d.value = Date.now(), 3e4);
89
- Q(() => clearInterval(C));
90
- const w = v(() => {
91
- var o;
92
- return ((o = i.value) == null ? void 0 : o.profile) ?? null;
93
- }), N = v(() => w.value ? re(w.value) : []), I = v(
94
- () => {
95
- var o;
96
- return ce(
97
- ((o = w.value) == null ? void 0 : o.passcodeUpdatedAt) ?? null,
98
- e,
99
- String(P.value),
100
- d.value
101
- );
102
- }
103
- ), k = v(() => {
104
- var o;
105
- return n.value ? (o = w.value) == null ? void 0 : o.passcode : null;
106
- }), O = v(
107
- () => k.value ? k.value.split("") : Array.from({ length: je }, () => null)
108
- ), G = [
109
- {
110
- id: "name",
111
- header: () => e("myPosProfile.table.columns.name"),
112
- enableSorting: !1,
113
- cell: (o) => {
114
- const f = o.row.original.name;
115
- return f ? U("div", { class: "flex items-center gap-8" }, [
116
- U(ae.FmAvatar, { name: f, size: "sm", class: "shrink-0" }),
117
- U("span", { class: "truncate" }, f)
118
- ]) : "";
119
- }
120
- },
121
- {
122
- id: "contact",
123
- header: () => e("myPosProfile.table.columns.contact"),
124
- enableSorting: !1,
125
- cell: (o) => o.row.original.contact ?? ""
126
- },
127
- {
128
- id: "restaurant",
129
- header: () => e("myPosProfile.table.columns.restaurant"),
130
- enableSorting: !1,
131
- cell: (o) => o.row.original.restaurant
132
- },
133
- {
134
- id: "role",
135
- header: () => e("myPosProfile.table.columns.role"),
136
- enableSorting: !1,
137
- cell: (o) => o.row.original.role
138
- }
139
- ];
140
- function D(o) {
141
- x.open({ type: "error", title: o, position: le.BOTTOM });
142
- }
143
- async function H() {
144
- _.value = !0, p.value = !1, n.value = !1;
145
- try {
146
- i.value = await de();
147
- } catch (o) {
148
- i.value = null, V(o) ? p.value = !0 : D(e("myPosProfile.loadFailed"));
149
- } finally {
150
- _.value = !1;
151
- }
152
- }
153
- X(
154
- y.currentBusiness,
155
- (o) => {
156
- o && H();
157
- },
158
- { immediate: !0 }
159
- );
160
- function K() {
161
- n.value = !n.value;
162
- }
163
- function W() {
164
- b.open({
165
- title: e("myPosProfile.change.title"),
166
- message: e("myPosProfile.change.message"),
167
- minWidth: A.value.lg ? 598 : 0,
168
- primaryActions: {
169
- text: e("common.confirm"),
170
- close: !1,
171
- isLoading: g
172
- },
173
- secondaryActions: { text: e("common.cancel"), close: !0 }
174
- }).onPrimary(async () => {
175
- var o, f;
176
- if (!g.value) {
177
- g.value = !0;
178
- try {
179
- const { passcode: m, passcodeUpdatedAt: B } = await me();
180
- n.value = !1, (o = i.value) != null && o.profile && (i.value.profile.passcode = m, i.value.profile.passcodeUpdatedAt = B), d.value = Date.now(), b.close(), (f = S.value) == null || f.open(m);
181
- } catch (m) {
182
- b.close(), V(m) ? p.value = !0 : D(e(ue(m)));
183
- } finally {
184
- g.value = !1;
185
- }
186
- }
187
- });
188
- }
189
- function q() {
190
- pe(ee) || D(e("myPosProfile.manageAccount.failed"));
191
- }
192
- return (o, f) => {
193
- const m = h("FmIcon"), B = h("FmTable"), M = h("FmButton");
194
- return a(), $(ne, {
195
- heading: s(e)("myPosProfile.title")
196
- }, {
197
- "sub-heading": F(() => [
198
- t("p", xe, c(s(e)("myPosProfile.subtitle")), 1)
199
- ]),
200
- default: F(() => [
201
- _.value ? (a(), $(ie, { key: 0 })) : !w.value && !p.value ? (a(), l("div", be, [
202
- r(s(fe), {
203
- title: s(e)("myPosProfile.noPosUser.title"),
204
- subtitle: s(e)("myPosProfile.noPosUser.description")
205
- }, null, 8, ["title", "subtitle"])
206
- ])) : (a(), l("div", we, [
207
- p.value ? (a(), l("div", ke, [
208
- r(m, {
209
- name: "warning",
210
- size: "sm",
211
- outline: "",
212
- color: "typo-warning"
213
- }),
214
- t("span", Fe, c(s(e)("myPosProfile.shared.message")), 1)
215
- ])) : (a(), l(E, { key: 1 }, [
216
- r(B, {
217
- "column-defs": G,
218
- "row-data": N.value,
219
- "page-size": 100,
220
- "hide-footer": ""
221
- }, null, 8, ["row-data"]),
222
- t("section", Se, [
223
- t("p", Ae, c(s(e)("myPosProfile.passcode.title")), 1),
224
- t("div", Ce, [
225
- t("div", De, [
226
- r(m, {
227
- name: "lock",
228
- outline: ""
229
- })
230
- ]),
231
- t("div", Be, [
232
- t("div", Ue, [
233
- t("div", {
234
- class: "flex h-24 items-center gap-[10px]",
235
- "data-testid": "passcode",
236
- "aria-label": k.value ? void 0 : s(e)("myPosProfile.passcode.title")
237
- }, [
238
- (a(!0), l(E, null, L(O.value, (z, J) => (a(), l("span", {
239
- key: J,
240
- class: "flex w-[20px] items-center justify-center"
241
- }, [
242
- z === null ? (a(), l("span", Ee)) : (a(), l("span", Ie, c(z), 1))
243
- ]))), 128))
244
- ], 8, $e),
245
- r(M, {
246
- variant: "tertiary",
247
- "prepend-icon": k.value ? "visibility_off" : "visibility",
248
- "aria-label": k.value ? s(e)("myPosProfile.passcode.hide") : s(e)("myPosProfile.passcode.show"),
249
- onClick: K
250
- }, null, 8, ["prepend-icon", "aria-label"])
251
- ]),
252
- I.value ? (a(), l("p", Me, c(I.value), 1)) : Y("", !0)
253
- ]),
254
- r(M, {
255
- variant: "secondary",
256
- size: "md",
257
- label: s(e)("myPosProfile.passcode.change"),
258
- onClick: W
259
- }, null, 8, ["label"])
260
- ])
261
- ])
262
- ], 64)),
263
- t("div", ze, [
264
- r(m, {
265
- name: "info",
266
- size: "sm",
267
- outline: "",
268
- color: "typo-secondary"
269
- }),
270
- t("span", Ve, c(s(e)("myPosProfile.manageAccount.message")), 1),
271
- t("button", {
272
- type: "button",
273
- class: "fm-typo-en-body-md-600 text-fm-color-system-info-300",
274
- onClick: q
275
- }, c(s(e)("myPosProfile.manageAccount.link")), 1)
276
- ])
277
- ])),
278
- r(Pe, {
279
- ref_key: "changedDialogRef",
280
- ref: S
281
- }, null, 512)
282
- ]),
283
- _: 1
284
- }, 8, ["heading"]);
285
- };
286
- }
287
- });
288
- export {
289
- He as default
290
- };
@@ -1,126 +0,0 @@
1
- import { defineComponent as c, createElementBlock as s, openBlock as m, normalizeStyle as b, resolveComponent as u, Fragment as p, createVNode as r, createCommentVNode as g, toDisplayString as y, createElementVNode as v } from "vue";
2
- const B = /* @__PURE__ */ c({
3
- __name: "Skeleton",
4
- props: {
5
- width: { default: "160px" }
6
- },
7
- setup(t) {
8
- return (l, n) => (m(), s("div", {
9
- class: "h-16 animate-pulse rounded bg-fm-color-neutral-gray-200",
10
- style: b({ width: t.width })
11
- }, null, 4));
12
- }
13
- });
14
- function f(t) {
15
- return t.map((l) => l.restaurantId).filter(Boolean);
16
- }
17
- function x(t, l, n) {
18
- const o = f(l);
19
- return t.filter((e) => e.managable || e._id === n).map((e) => ({
20
- label: `${e.profile.code ? `${e.profile.code} - ` : ""}${e.profile.name}`,
21
- value: e._id,
22
- disabled: o.includes(e._id) && e._id !== n
23
- }));
24
- }
25
- function k(t, l, n, o) {
26
- return l ? t.filter((e) => e.restaurants.some((a) => a.id == l)).map((e) => ({
27
- label: e.name,
28
- value: e._id,
29
- disabled: !o.isRoleUsable(e, l) && e._id !== n
30
- })) : [];
31
- }
32
- function V(t, l, n, o) {
33
- var a, i;
34
- const e = k(t, l, n, o);
35
- return ((a = e.find((d) => d.value === n && !d.disabled)) == null ? void 0 : a.value) ?? ((i = e.find((d) => !d.disabled)) == null ? void 0 : i.value) ?? "";
36
- }
37
- function C(t, l) {
38
- const n = f(l), o = t.some(
39
- (a) => a.managable && !n.includes(a._id)
40
- ), e = l.every((a) => a.restaurantId && a.roleId);
41
- return o && e;
42
- }
43
- function R(t, l, n, o) {
44
- var a;
45
- const e = ((a = t[l]) == null ? void 0 : a.restaurantId) ?? "";
46
- return o.isRestaurantLocked(e) ? t : t.length === 1 ? [n()] : t.filter((i, d) => d !== l);
47
- }
48
- const F = {
49
- key: 0,
50
- class: "fm-typo-body-sm-400 text-fm-color-typo-secondary"
51
- }, I = /* @__PURE__ */ c({
52
- __name: "PasscodeGenerateButton",
53
- props: {
54
- label: {},
55
- hint: {},
56
- disabled: { type: Boolean, default: !1 },
57
- loading: { type: Boolean, default: !1 }
58
- },
59
- emits: ["click"],
60
- setup(t) {
61
- return (l, n) => {
62
- const o = u("FmButton");
63
- return m(), s(p, null, [
64
- r(o, {
65
- variant: "secondary",
66
- "text-color": "primary",
67
- "border-color": "primary",
68
- label: t.label,
69
- size: "md",
70
- loading: t.loading,
71
- disabled: t.disabled,
72
- onClick: n[0] || (n[0] = (e) => l.$emit("click"))
73
- }, null, 8, ["label", "loading", "disabled"]),
74
- t.disabled ? (m(), s("div", F, y(t.hint), 1)) : g("", !0)
75
- ], 64);
76
- };
77
- }
78
- }), _ = { class: "flex items-center gap-8" }, $ = ["aria-label"], P = /* @__PURE__ */ c({
79
- __name: "PasscodePinField",
80
- props: {
81
- modelValue: {},
82
- masked: { type: Boolean },
83
- length: { default: 4 },
84
- toggleLabel: {}
85
- },
86
- emits: ["update:modelValue", "update:masked", "complete"],
87
- setup(t, { emit: l }) {
88
- const n = l;
89
- return (o, e) => {
90
- const a = u("FmPinField"), i = u("FmIcon");
91
- return m(), s("div", _, [
92
- r(a, {
93
- "model-value": t.modelValue,
94
- length: t.length,
95
- masked: t.masked,
96
- "onUpdate:modelValue": e[0] || (e[0] = (d) => n("update:modelValue", d)),
97
- onComplete: e[1] || (e[1] = (d) => n("complete", d)),
98
- onFocus: e[2] || (e[2] = (d) => n("update:masked", !1))
99
- }, null, 8, ["model-value", "length", "masked"]),
100
- v("button", {
101
- type: "button",
102
- class: "flex items-center justify-center rounded-full p-4 hover:bg-fm-color-neutral-gray-100",
103
- "aria-label": t.toggleLabel,
104
- onClick: e[3] || (e[3] = (d) => n("update:masked", !t.masked))
105
- }, [
106
- r(i, {
107
- name: t.masked ? "visibility" : "visibility_off",
108
- size: "md",
109
- class: "text-fm-color-neutral-gray-300"
110
- }, null, 8, ["name"])
111
- ], 8, $)
112
- ]);
113
- };
114
- }
115
- });
116
- export {
117
- P as _,
118
- k as a,
119
- x as b,
120
- C as c,
121
- I as d,
122
- B as e,
123
- V as p,
124
- R as r,
125
- f as s
126
- };