@feedmepos/mf-hrm-portal 2.1.1-dev → 2.1.1-dev.3
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/dist/ApprovalCodeList-BH5sgVMU.js +638 -0
- package/dist/AuditLogList-Q4L5Te8O.js +1145 -0
- package/dist/CollapsibleWrapper.vue_vue_type_script_setup_true_lang-BLJlmPVa.js +58 -0
- package/dist/EmployeeList-GtKmJZbf.js +899 -0
- package/dist/GrantUserList-CnLjOi5_.js +468 -0
- package/dist/Main-Cn7Dawg4.js +120 -0
- package/dist/{Main-mTxcltDY.js → Main-DLlpEU3j.js} +11 -9
- package/dist/{Main-BLRr_ORG.js → Main-cskEZ3k_.js} +1033 -1035
- package/dist/PermissionSetList-C2fK2pTz.js +357 -0
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-CMh0DL1_.js +3458 -0
- package/dist/{PortalUserSearcher.vue_vue_type_style_index_0_scoped_79737e32_lang-Czo3FLbc.js → PortalUserSearcher.vue_vue_type_style_index_0_scoped_a439fdd8_lang-BJp9hEfv.js} +1 -2
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js +38 -0
- package/dist/RoleList-CcuT1ERb.js +567 -0
- package/dist/TeamMemberList-Dfs2iNdC.js +1131 -0
- package/dist/{TimesheetList-D21j4zLV.js → TimesheetList-B1H_6zfP.js} +136 -141
- package/dist/{TimesheetList.vue_vue_type_style_index_0_scoped_2c7a177a_lang-CRmmIfTk.js → TimesheetList.vue_vue_type_style_index_0_scoped_91afda4e_lang-DeTpbaRk.js} +14 -13
- package/dist/{app-CX-St7pv.js → app-DX-PG6wx.js} +2725 -5281
- package/dist/app.js +1 -1
- package/dist/approval-code-Q4666xp5.js +58 -0
- package/dist/{dayjs.min-MDoe5X-P.js → dayjs.min-BJrHE7oz.js} +1 -1
- package/dist/{employee-B2cdx2t4.js → employee-BJcqtqLM.js} +27 -26
- package/dist/grant-user-CQZaTzVt.js +67 -0
- package/dist/{TableEmptyState.vue_vue_type_script_setup_true_lang-Ci_MVqGK.js → index.vue_vue_type_script_setup_true_lang-BVVwfd7B.js} +19 -50
- package/dist/iteration-Cfaqt-0s.js +7682 -0
- package/dist/{lodash-DZAGPZLQ.js → lodash-ClKqCmlZ.js} +1 -1
- package/dist/restaurant-YOVMuuFY.js +1876 -0
- package/dist/role-CR_-nBDY.js +82 -0
- package/dist/rule-BB-3S-2R.js +996 -0
- package/dist/src/api/approval-code/index.d.ts +7 -0
- package/dist/src/api/audit-log/index.d.ts +0 -6
- package/dist/src/components/CheckboxInput.vue.d.ts +1 -1
- package/dist/src/components/button/ResponsiveFabButton.vue.d.ts +1 -7
- package/dist/src/components/table/TableEmptyState.vue.d.ts +15 -7
- package/dist/src/composables/useBasePermission.d.ts +1 -2
- package/dist/src/helpers/permission-set.d.ts +4 -8
- package/dist/src/helpers/rule.d.ts +1 -2
- package/dist/src/router/shared.d.ts +3 -1
- package/dist/src/stores/approval-code.d.ts +140 -0
- package/dist/src/stores/permission-set.d.ts +3 -12
- package/dist/src/types/approval-code.d.ts +99 -0
- package/dist/src/types/audit-log.d.ts +1 -1
- package/dist/src/views/approval-code/ApprovalCodeList.vue.d.ts +26 -0
- package/dist/src/views/approval-code/components/ApprovalCodeForm.vue.d.ts +17 -0
- package/dist/src/views/approval-code/locales/index.d.ts +320 -0
- package/dist/src/views/audit-log/locales/index.d.ts +0 -296
- package/dist/src/views/hr/employee/EmployeeList.vue.d.ts +0 -1
- package/dist/src/views/pos-access/locales/index.d.ts +48 -0
- package/dist/src/views/team/components/BasePermission.vue.d.ts +0 -13
- package/dist/src/views/team/locales/index.d.ts +0 -72
- package/dist/style.css +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/useAppStore-DNTlIeMv.js +93 -0
- package/dist/useDebounce-CWb5QR9G.js +28 -0
- package/dist/{useLoading-qgSjOzRD.js → useLoading-BH02lYns.js} +1 -1
- package/dist/{useReportPermissions-CIhkjN3B.js → useReportPermissions-ybHA26cJ.js} +3 -3
- package/package.json +2 -2
- package/dist/AuditLogList-Cvp-5_0y.js +0 -1608
- package/dist/ConditionFormHost.vue_vue_type_script_setup_true_lang-Cb8-YaiH.js +0 -387
- package/dist/EmployeeList-DgrD3Hjm.js +0 -884
- package/dist/Main-G3am-0Xi.js +0 -577
- package/dist/PermissionSetList-OzyfE-Yg.js +0 -392
- package/dist/PortalPermissionEditor.vue_vue_type_script_setup_true_lang-Ca2NnAAF.js +0 -4121
- package/dist/ResponsiveFabButton.vue_vue_type_script_setup_true_lang-QrqYEy8i.js +0 -42
- package/dist/RoleList-DOZ5RJ6A.js +0 -684
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-B4PxNMwq.js +0 -16
- package/dist/TeamMemberList-CAqLUyQK.js +0 -1186
- package/dist/iteration-B38iapI_.js +0 -9556
- package/dist/rule-DftQBR76.js +0 -1057
- package/dist/src/composables/useConditionDraft.d.ts +0 -40
- package/dist/src/composables/useCoverConditionOverride.d.ts +0 -61
- package/dist/src/helpers/business-timezone.d.ts +0 -22
- package/dist/src/helpers/filter.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.d.ts +0 -15
- package/dist/src/helpers/permission-reconcile.test.d.ts +0 -1
- package/dist/src/views/audit-log/event-line.d.ts +0 -13
- package/dist/src/views/audit-log/snapshot-diff.d.ts +0 -11
- package/dist/src/views/team/condition-builders/ConditionFormHost.vue.d.ts +0 -22
- package/dist/src/views/team/condition-builders/ConditionFormRenderer.vue.d.ts +0 -23
- package/dist/src/views/team/condition-builders/component-map.d.ts +0 -4
- package/dist/src/views/team/condition-builders/condition-form-dedupe.d.ts +0 -23
- package/dist/useAppStore-BBsP5C3E.js +0 -169
- package/dist/useDebounce-B8ZPVS5C.js +0 -15
- /package/dist/src/views/{grant → pos-access}/Main.vue.d.ts +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { type Ref } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Local draft state for condition editing — tracks form field edits and
|
|
4
|
-
* inherit/custom mode changes for each builder, keyed by `${subject}::${builderKey}`.
|
|
5
|
-
*
|
|
6
|
-
* Drafts remain local until explicitly committed via `applyDrafts`. Closing
|
|
7
|
-
* a popover/menu without applying discards uncommitted changes.
|
|
8
|
-
*/
|
|
9
|
-
export interface DraftKey {
|
|
10
|
-
subject: string;
|
|
11
|
-
builderKey: string;
|
|
12
|
-
}
|
|
13
|
-
export interface ConditionDraft {
|
|
14
|
-
/** The local draft form value for this builder. */
|
|
15
|
-
formValue: unknown;
|
|
16
|
-
/** Local draft inherit/custom mode for builders under a cover subject. */
|
|
17
|
-
inheritMode?: 'inherit' | 'custom';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Creates a composable to manage local draft state for condition editing.
|
|
21
|
-
*
|
|
22
|
-
* @param committedSource - Ref to the committed state (e.g., modelValue, reportExtraConditions)
|
|
23
|
-
* used to detect external changes and reset drafts accordingly
|
|
24
|
-
*/
|
|
25
|
-
export declare function useConditionDraft<T>(committedSource?: Ref<T>): {
|
|
26
|
-
drafts: Ref<Map<string, {
|
|
27
|
-
formValue: unknown;
|
|
28
|
-
inheritMode?: "inherit" | "custom" | undefined;
|
|
29
|
-
}> & Omit<Map<string, ConditionDraft>, keyof Map<any, any>>, Map<string, ConditionDraft> | (Map<string, {
|
|
30
|
-
formValue: unknown;
|
|
31
|
-
inheritMode?: "inherit" | "custom" | undefined;
|
|
32
|
-
}> & Omit<Map<string, ConditionDraft>, keyof Map<any, any>>)>;
|
|
33
|
-
setDraft: (key: DraftKey, draft: ConditionDraft) => void;
|
|
34
|
-
getDraft: (key: DraftKey) => ConditionDraft | undefined;
|
|
35
|
-
hasDraftsForSubject: (subject: string) => boolean;
|
|
36
|
-
getDraftsForSubject: (subject: string) => Map<string, ConditionDraft>;
|
|
37
|
-
clearDraftsForSubject: (subject: string) => void;
|
|
38
|
-
clearAllDrafts: () => void;
|
|
39
|
-
clearDraft: (key: DraftKey) => void;
|
|
40
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { type Ref, type ComputedRef } from 'vue';
|
|
2
|
-
import type { FdoPermissionRule } from '@feedmepos/core/entity';
|
|
3
|
-
import { type IFdtoPortalPermissionsWithVisibilityCondition } from '@feedmepos/hrm-permission';
|
|
4
|
-
import { type ConditionBuilder, type ConditionSummary } from '@feedmepos/hrm-permission/condition-builder';
|
|
5
|
-
/**
|
|
6
|
-
* Generic "category cover" machinery for the portal permission editor: any
|
|
7
|
-
* subject whose permission-definition category declares a cover (see
|
|
8
|
-
* `getCoverSubjectFor`) can have its condition-builder settings either
|
|
9
|
-
* inherit the cover subject's condition or hold a custom override — and the
|
|
10
|
-
* cover subject itself can push its condition down onto every individual
|
|
11
|
-
* override in the category.
|
|
12
|
-
*
|
|
13
|
-
* Zero knowledge of any specific subject, category, or builder lives here —
|
|
14
|
-
* everything is driven by the `defs` list (permission definitions carrying
|
|
15
|
-
* `category`/`isCategoryCover`) and the `ConditionBuilder` contract
|
|
16
|
-
* (`ownedFields`, `appliesToActions`, `summarizeForm`).
|
|
17
|
-
*/
|
|
18
|
-
/** The minimum shape the editor's per-row entry needs to expose for cover/inherit resolution. */
|
|
19
|
-
export interface CoverConditionEntry {
|
|
20
|
-
/** Index of this subject's raw rule in the model, or null when no direct rule exists yet. */
|
|
21
|
-
index: number | null;
|
|
22
|
-
subject: string;
|
|
23
|
-
label: string;
|
|
24
|
-
actions: readonly string[];
|
|
25
|
-
}
|
|
26
|
-
/** Resolution handles passed to `onOverridesConflict` — the caller (UI) decides which to invoke. */
|
|
27
|
-
export interface CoverOverrideResolution {
|
|
28
|
-
/** Strip this builder's fragment from every covered override rule (dropping a rule once it carries no more conditions and its actions are covered). */
|
|
29
|
-
override: () => void;
|
|
30
|
-
/** Leave every covered override rule untouched. */
|
|
31
|
-
keep: () => void;
|
|
32
|
-
}
|
|
33
|
-
export interface UpdateBuilderConditionOptions {
|
|
34
|
-
/** Create a direct rule even if the resulting condition is empty (used when explicitly switching to "custom"). */
|
|
35
|
-
forceCreateRule?: boolean;
|
|
36
|
-
afterCommit?: () => void;
|
|
37
|
-
/**
|
|
38
|
-
* Invoked instead of auto-resolving when this write touches a cover
|
|
39
|
-
* subject's row and other subjects in the same category hold a
|
|
40
|
-
* conditioned override on this builder. Omit only for callers that don't
|
|
41
|
-
* need a confirmation step — the write then defaults to keeping the
|
|
42
|
-
* overrides untouched (the non-destructive choice).
|
|
43
|
-
*/
|
|
44
|
-
onOverridesConflict?: (resolution: CoverOverrideResolution) => void;
|
|
45
|
-
}
|
|
46
|
-
export interface BuilderConditionDraft {
|
|
47
|
-
builder: ConditionBuilder;
|
|
48
|
-
form: unknown;
|
|
49
|
-
mode: 'inherit' | 'custom';
|
|
50
|
-
}
|
|
51
|
-
export declare function useCoverConditionOverride(rules: Ref<FdoPermissionRule[]>, defs: ComputedRef<IFdtoPortalPermissionsWithVisibilityCondition[]>, updateRules: (next: FdoPermissionRule[]) => void): {
|
|
52
|
-
getCoverSubject: (subject: string) => string | undefined;
|
|
53
|
-
coverLabel: (subject: string) => string | undefined;
|
|
54
|
-
shouldShowInheritToggle: (entry: CoverConditionEntry, builder: ConditionBuilder) => boolean;
|
|
55
|
-
inheritMode: (entry: CoverConditionEntry, builder: ConditionBuilder) => "inherit" | "custom";
|
|
56
|
-
setInheritMode: (entry: CoverConditionEntry, builder: ConditionBuilder, mode: "inherit" | "custom") => void;
|
|
57
|
-
inheritedSummary: (entry: CoverConditionEntry, builder: ConditionBuilder, timeZone: string) => ConditionSummary | undefined;
|
|
58
|
-
getEffectiveActions: (subject: string) => readonly string[];
|
|
59
|
-
updateBuilderCondition: (entry: CoverConditionEntry, builder: ConditionBuilder, form: unknown, options?: UpdateBuilderConditionOptions) => void;
|
|
60
|
-
applyConditionDrafts: (entry: CoverConditionEntry, updates: BuilderConditionDraft[], options?: UpdateBuilderConditionOptions) => void;
|
|
61
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Business timezone resolution — a pure mapping from country code to IANA
|
|
3
|
-
* timezone, used as a fallback when a business has no explicit timezone
|
|
4
|
-
* configured. Kept independent of any store so it's testable in isolation;
|
|
5
|
-
* callers resolve the business/country from their own store and pass the
|
|
6
|
-
* plain values in.
|
|
7
|
-
*/
|
|
8
|
-
/** IANA timezone for a country code; falls back to the runtime's local zone for unknown/missing codes. */
|
|
9
|
-
export declare function getCountryTimezone(country?: string): string;
|
|
10
|
-
/** Minimal shape a business needs for timezone resolution. */
|
|
11
|
-
export interface BusinessTimezoneSource {
|
|
12
|
-
timezone?: string;
|
|
13
|
-
timeZone?: string;
|
|
14
|
-
country?: string;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Resolve the effective IANA timezone for a business: an explicit business
|
|
18
|
-
* timezone field wins (`timezone`, then legacy `timeZone`), otherwise falls
|
|
19
|
-
* back to the country's default timezone (business's own country first, then
|
|
20
|
-
* `fallbackCountry`).
|
|
21
|
-
*/
|
|
22
|
-
export declare function resolveBusinessTimezone(business: BusinessTimezoneSource | undefined, fallbackCountry?: string): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sentinel value used in multi-select list filters (assigned role, restaurant, etc.) to
|
|
3
|
-
* represent "this field is empty/unassigned for the record". Must match the backend's
|
|
4
|
-
* `UNASSIGNED_FILTER_VALUE` in src/common/helpers/filter.ts.
|
|
5
|
-
*
|
|
6
|
-
* When sending a filter that includes this value to the backend, it must be the first element
|
|
7
|
-
* of the array -- the backend only checks index 0 to detect it (cheap even for filters with
|
|
8
|
-
* large option sets), it does not scan the whole list.
|
|
9
|
-
*/
|
|
10
|
-
export declare const UNASSIGNED_FILTER_VALUE = "__unassigned__";
|
|
11
|
-
/**
|
|
12
|
-
* Reorders a multi-select filter's selected values so the "unassigned" sentinel (if present)
|
|
13
|
-
* is always first, matching what the backend's `splitUnassignedFilter` expects.
|
|
14
|
-
*/
|
|
15
|
-
export declare function withUnassignedFirst(values?: string[]): string[] | undefined;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FdoPermissionRule } from '@feedmepos/core/entity';
|
|
2
|
-
import type { IFdtoPortalPermissionsWithVisibilityCondition } from '@feedmepos/hrm-permission';
|
|
3
|
-
/**
|
|
4
|
-
* Reconcile a BasePermission update (which works with the expanded view) back to the raw modelValue.
|
|
5
|
-
*
|
|
6
|
-
* - Subject removed that was directly in raw → remove it
|
|
7
|
-
* - Subject removed that was system-expanded (not in raw) → add inverted rule to block re-expansion
|
|
8
|
-
* - Subject removed that was stored directly AND still reachable via expansion from remaining
|
|
9
|
-
* rules (e.g. previously materialized by an earlier save) → remove direct rule AND add inverted,
|
|
10
|
-
* otherwise materializeSystemPermissionSetOverrides re-injects it during save
|
|
11
|
-
* - Subject added that had an inverted rule → remove the inverted rule (expansion re-enables it)
|
|
12
|
-
* - Subject added that is genuinely new → add it to raw
|
|
13
|
-
* - Subject unchanged but actions changed → update actions in raw (multi-action permissions)
|
|
14
|
-
*/
|
|
15
|
-
export declare function reconcileBasePermissionUpdate(prevExpandedRules: FdoPermissionRule[], newExpandedRules: FdoPermissionRule[], rawRules: FdoPermissionRule[], findPermissionDef: (subject: string) => IFdtoPortalPermissionsWithVisibilityCondition | undefined): FdoPermissionRule[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface EventLineSource {
|
|
2
|
-
eventKey?: string;
|
|
3
|
-
params?: Record<string, string | number>;
|
|
4
|
-
operationLabel?: string;
|
|
5
|
-
}
|
|
6
|
-
type Translate = (key: string, params?: Record<string, unknown>) => string;
|
|
7
|
-
export declare function splitEventKey(key: string): {
|
|
8
|
-
entity: string;
|
|
9
|
-
verb: string;
|
|
10
|
-
} | null;
|
|
11
|
-
export declare function humanizeSegment(segment: string): string;
|
|
12
|
-
export declare function renderEventLine(t: Translate, source: EventLineSource): string;
|
|
13
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type SnapshotDiffType = 'added' | 'removed' | 'changed';
|
|
2
|
-
export interface SnapshotDiffRow {
|
|
3
|
-
/** e.g. "name", "permissions[business::unitCostHistory]", "roles[0].roleId" */
|
|
4
|
-
path: string;
|
|
5
|
-
type: SnapshotDiffType;
|
|
6
|
-
/** null = value absent on the before side (render as em dash by caller) */
|
|
7
|
-
before: string | null;
|
|
8
|
-
/** null = value absent on the after side */
|
|
9
|
-
after: string | null;
|
|
10
|
-
}
|
|
11
|
-
export declare function computeSnapshotDiff(before: unknown, after: unknown): SnapshotDiffRow[];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ConditionBuilder } from '@feedmepos/hrm-permission/condition-builder';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
builder: ConditionBuilder;
|
|
4
|
-
modelValue: unknown;
|
|
5
|
-
disable?: boolean;
|
|
6
|
-
optionProviders?: Record<string, Array<{
|
|
7
|
-
value: string;
|
|
8
|
-
label: string;
|
|
9
|
-
}>>;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
-
"update:modelValue": (value: unknown) => any;
|
|
13
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
-
"onUpdate:modelValue"?: ((value: unknown) => any) | undefined;
|
|
15
|
-
}>, {
|
|
16
|
-
optionProviders: Record<string, Array<{
|
|
17
|
-
value: string;
|
|
18
|
-
label: string;
|
|
19
|
-
}>>;
|
|
20
|
-
disable: boolean;
|
|
21
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
-
export default _default;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ConditionFormConfig, ConditionFormState } from '@feedmepos/hrm-permission/condition-builder';
|
|
2
|
-
type __VLS_Props = {
|
|
3
|
-
config: ConditionFormConfig;
|
|
4
|
-
modelValue: ConditionFormState;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
/** name → option list, for fields whose options use `{ provider }`. */
|
|
7
|
-
optionProviders?: Record<string, Array<{
|
|
8
|
-
value: string;
|
|
9
|
-
label: string;
|
|
10
|
-
}>>;
|
|
11
|
-
};
|
|
12
|
-
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
"update:modelValue": (value: ConditionFormState) => any;
|
|
14
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((value: ConditionFormState) => any) | undefined;
|
|
16
|
-
}>, {
|
|
17
|
-
disabled: boolean;
|
|
18
|
-
optionProviders: Record<string, Array<{
|
|
19
|
-
value: string;
|
|
20
|
-
label: string;
|
|
21
|
-
}>>;
|
|
22
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
-
export default _default;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type Component } from 'vue';
|
|
2
|
-
/** Resolve a form component key to a cached async component, or undefined when no
|
|
3
|
-
* component is registered for that key (the host then renders nothing). */
|
|
4
|
-
export declare function resolveBuilderComponent(key: string): Component | undefined;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ConditionFormState } from '@feedmepos/hrm-permission/condition-builder';
|
|
2
|
-
/**
|
|
3
|
-
* Pure decision extracted from `ConditionFormRenderer.vue`'s `setField`, so
|
|
4
|
-
* it can be unit-tested without mounting the component (this repo's vitest
|
|
5
|
-
* setup has no `@vue/test-utils` / jsdom-environment component-mounting
|
|
6
|
-
* infrastructure yet — see the composable spec's notes on jsdom gaps).
|
|
7
|
-
*
|
|
8
|
-
* Some `FmRadio` / `FmCheckbox` fields (ui-library) fire their change
|
|
9
|
-
* handler twice per click — the click handler lives on a `<label>` wrapping
|
|
10
|
-
* the native input, so one click fires the handler once directly and once
|
|
11
|
-
* via the browser's synthetic click bubbling back through the label — which
|
|
12
|
-
* would otherwise make `setField` emit `update:modelValue` twice with an
|
|
13
|
-
* identical value. Comparing the freshly-computed next state against the
|
|
14
|
-
* last emitted (or last committed) state collapses that into a single
|
|
15
|
-
* emission, while still emitting for any genuinely new value.
|
|
16
|
-
*
|
|
17
|
-
* Uses lodash `isEqual` (already this app's idiom for comparing plain
|
|
18
|
-
* records — see `AddMemberForm.vue`, `PermissionSetForm.vue`, `RoleForm.vue`)
|
|
19
|
-
* rather than a `JSON.stringify` comparison, since these flat
|
|
20
|
-
* `{ key: value }` form records can hold arrays (multiselect) and key order
|
|
21
|
-
* is not guaranteed to be stable across the spread in `setField`.
|
|
22
|
-
*/
|
|
23
|
-
export declare function shouldEmitConditionFormUpdate(next: ConditionFormState, lastEmitted: ConditionFormState): boolean;
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { defineStore as x, storeToRefs as U } from "pinia";
|
|
2
|
-
import { ref as R } from "vue";
|
|
3
|
-
import { useCoreStore as D, baseClientInstance as v } from "@feedmepos/mf-common";
|
|
4
|
-
import { g as c, b as g, u as Q, s as f } from "./iteration-B38iapI_.js";
|
|
5
|
-
const y = {
|
|
6
|
-
async readRoles() {
|
|
7
|
-
return c(await g().get("/pos-roles"));
|
|
8
|
-
},
|
|
9
|
-
async createRole(e) {
|
|
10
|
-
return c(await g().post("/pos-roles", e));
|
|
11
|
-
},
|
|
12
|
-
async updateRole(e, t) {
|
|
13
|
-
return c(await g().put(`/pos-roles/${e}`, t));
|
|
14
|
-
},
|
|
15
|
-
async deleteRole(e) {
|
|
16
|
-
return c(
|
|
17
|
-
await g().put(`/pos-roles/${e._id}`, {
|
|
18
|
-
restaurantIds: [],
|
|
19
|
-
role: e
|
|
20
|
-
})
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
async function m(e) {
|
|
25
|
-
const { restaurants: t } = Q(), s = e.reduce((n, r) => {
|
|
26
|
-
var p;
|
|
27
|
-
const l = n.findIndex((o) => o._id === r._id), d = {
|
|
28
|
-
id: r.restaurantId,
|
|
29
|
-
name: ((p = t.value.find((o) => o._id === r.restaurantId)) == null ? void 0 : p.profile.name) || ""
|
|
30
|
-
};
|
|
31
|
-
return l < 0 ? n.push({
|
|
32
|
-
...r,
|
|
33
|
-
restaurants: [d]
|
|
34
|
-
}) : n[l].restaurants.some((o) => o.id === r.restaurantId) || (n[l].restaurants = f([...n[l].restaurants, d], { selector: "name" })), n;
|
|
35
|
-
}, []);
|
|
36
|
-
return f(s, { selector: "name" });
|
|
37
|
-
}
|
|
38
|
-
const A = x("role", () => {
|
|
39
|
-
const { currentBusiness: e } = D(), t = Q(), s = R([]), n = R(!1), r = R(null);
|
|
40
|
-
async function l() {
|
|
41
|
-
var i;
|
|
42
|
-
const u = ((i = e.value) == null ? void 0 : i._id) ?? null;
|
|
43
|
-
if (r.value !== u)
|
|
44
|
-
try {
|
|
45
|
-
n.value = !0, await t.readRestaurants();
|
|
46
|
-
const w = await y.readRoles();
|
|
47
|
-
s.value = await m(w), r.value = u;
|
|
48
|
-
} finally {
|
|
49
|
-
n.value = !1;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
async function d(u) {
|
|
53
|
-
const i = await y.createRole(u);
|
|
54
|
-
s.value = await m(i);
|
|
55
|
-
}
|
|
56
|
-
async function p(u, i) {
|
|
57
|
-
const w = await y.updateRole(u, i);
|
|
58
|
-
s.value = await m(w);
|
|
59
|
-
}
|
|
60
|
-
async function o(u) {
|
|
61
|
-
const i = await y.deleteRole(u);
|
|
62
|
-
s.value = await m(i);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
roles: s,
|
|
66
|
-
isLoading: n,
|
|
67
|
-
readRoles: l,
|
|
68
|
-
createRole: d,
|
|
69
|
-
updateRole: p,
|
|
70
|
-
deleteRole: o
|
|
71
|
-
};
|
|
72
|
-
}), E = () => {
|
|
73
|
-
const e = A();
|
|
74
|
-
return {
|
|
75
|
-
...e,
|
|
76
|
-
...U(e)
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
var a = [];
|
|
80
|
-
for (var S = 0; S < 256; ++S)
|
|
81
|
-
a.push((S + 256).toString(16).slice(1));
|
|
82
|
-
function _(e, t = 0) {
|
|
83
|
-
return (a[e[t + 0]] + a[e[t + 1]] + a[e[t + 2]] + a[e[t + 3]] + "-" + a[e[t + 4]] + a[e[t + 5]] + "-" + a[e[t + 6]] + a[e[t + 7]] + "-" + a[e[t + 8]] + a[e[t + 9]] + "-" + a[e[t + 10]] + a[e[t + 11]] + a[e[t + 12]] + a[e[t + 13]] + a[e[t + 14]] + a[e[t + 15]]).toLowerCase();
|
|
84
|
-
}
|
|
85
|
-
var b, L = new Uint8Array(16);
|
|
86
|
-
function C() {
|
|
87
|
-
if (!b && (b = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !b))
|
|
88
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
89
|
-
return b(L);
|
|
90
|
-
}
|
|
91
|
-
var V = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
92
|
-
const h = {
|
|
93
|
-
randomUUID: V
|
|
94
|
-
};
|
|
95
|
-
function P(e, t, s) {
|
|
96
|
-
if (h.randomUUID && !e)
|
|
97
|
-
return h.randomUUID();
|
|
98
|
-
e = e || {};
|
|
99
|
-
var n = e.random || (e.rng || C)();
|
|
100
|
-
return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, _(n);
|
|
101
|
-
}
|
|
102
|
-
const I = {
|
|
103
|
-
async read() {
|
|
104
|
-
return c(await v("/").get("/public-setting"));
|
|
105
|
-
},
|
|
106
|
-
async update(e) {
|
|
107
|
-
return c(await v("/").put("/public-setting", e));
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
function B() {
|
|
111
|
-
return {
|
|
112
|
-
loadingQueue: [],
|
|
113
|
-
publicSetting: {
|
|
114
|
-
delivery: {
|
|
115
|
-
feedMe: {
|
|
116
|
-
areas: [],
|
|
117
|
-
enable: !1,
|
|
118
|
-
maxDistance: 0
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
sms: {
|
|
122
|
-
firebase: !1
|
|
123
|
-
},
|
|
124
|
-
assets: {
|
|
125
|
-
groups: []
|
|
126
|
-
},
|
|
127
|
-
aiSettings: {
|
|
128
|
-
remy: { enable: !1 }
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
const H = x("portal-app-store", {
|
|
134
|
-
state: () => B(),
|
|
135
|
-
actions: {
|
|
136
|
-
addLoadingQueues(e) {
|
|
137
|
-
this.loadingQueue = [...this.loadingQueue, ...e];
|
|
138
|
-
},
|
|
139
|
-
clearLoadingQueue() {
|
|
140
|
-
this.loadingQueue = [];
|
|
141
|
-
},
|
|
142
|
-
resolveQueues(e) {
|
|
143
|
-
this.loadingQueue = this.loadingQueue.filter((t) => !e.includes(t.id));
|
|
144
|
-
},
|
|
145
|
-
async promise(e, t = !0) {
|
|
146
|
-
const s = P();
|
|
147
|
-
try {
|
|
148
|
-
const n = [{ id: s, isGlobal: t }];
|
|
149
|
-
return this.addLoadingQueues(n), await e();
|
|
150
|
-
} finally {
|
|
151
|
-
this.resolveQueues([s]);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
async getPublicSetting() {
|
|
155
|
-
return this.publicSetting = await I.read(), this.publicSetting;
|
|
156
|
-
},
|
|
157
|
-
async updatePublicSetting(e) {
|
|
158
|
-
return this.publicSetting = await I.update({
|
|
159
|
-
...this.publicSetting,
|
|
160
|
-
...e
|
|
161
|
-
}), this.publicSetting;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
export {
|
|
166
|
-
H as a,
|
|
167
|
-
E as u,
|
|
168
|
-
P as v
|
|
169
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { watch as s } from "vue";
|
|
2
|
-
function m(o, e, c = 300) {
|
|
3
|
-
let t;
|
|
4
|
-
const i = s(o, (r) => {
|
|
5
|
-
t && clearTimeout(t), t = setTimeout(() => {
|
|
6
|
-
e(r);
|
|
7
|
-
}, c);
|
|
8
|
-
});
|
|
9
|
-
return () => {
|
|
10
|
-
i(), t && (clearTimeout(t), t = void 0);
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
m as u
|
|
15
|
-
};
|
|
File without changes
|