@eintrek/erp-shell 0.1.74 → 0.1.76
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/README.md +50 -0
- package/dist/chunks/{guide-runtime-YS2nUhwS.cjs → format-BVoVc7Yk.cjs} +1012 -71
- package/dist/chunks/format-BVoVc7Yk.cjs.map +1 -0
- package/dist/chunks/{guide-runtime-Dl8V1iy9.esm.js → format-BWUKNKxg.esm.js} +1004 -73
- package/dist/chunks/format-BWUKNKxg.esm.js.map +1 -0
- package/dist/guide/core.d.ts +4 -2
- package/dist/guide/format.d.ts +26 -0
- package/dist/guide/guide-store.d.ts +52 -4
- package/dist/guide/guide-ui.d.ts +16 -2
- package/dist/guide/machine.d.ts +86 -10
- package/dist/guide/pages.d.ts +52 -1
- package/dist/guide/progress-sync.d.ts +3 -2
- package/dist/guide/progress.d.ts +8 -4
- package/dist/guide/section-button.d.ts +12 -0
- package/dist/guide/types.d.ts +100 -0
- package/dist/guide-core.cjs +34 -24
- package/dist/guide-core.cjs.map +1 -1
- package/dist/guide-core.esm.js +1 -1
- package/dist/help/help-button.d.ts +5 -2
- package/dist/index.cjs +53 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.esm.js +15 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/guide-runtime-Dl8V1iy9.esm.js.map +0 -1
- package/dist/chunks/guide-runtime-YS2nUhwS.cjs.map +0 -1
package/dist/guide-core.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var format = require('./chunks/format-BVoVc7Yk.cjs');
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('react');
|
|
7
7
|
require('react-dom');
|
|
@@ -9,27 +9,37 @@ require('@floating-ui/dom');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.GUIDE_API_EVENT =
|
|
13
|
-
exports.GUIDE_EVENT_PREFIX =
|
|
14
|
-
exports.GUIDE_LAYER_ATTRIBUTE =
|
|
15
|
-
exports.GuideProgressConflict =
|
|
16
|
-
exports.GuideRuntime =
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
22
|
-
exports.
|
|
23
|
-
exports.
|
|
24
|
-
exports.
|
|
25
|
-
exports.
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
32
|
-
exports.
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
12
|
+
exports.GUIDE_API_EVENT = format.API_EVENT;
|
|
13
|
+
exports.GUIDE_EVENT_PREFIX = format.GUIDE_EVENT_PREFIX;
|
|
14
|
+
exports.GUIDE_LAYER_ATTRIBUTE = format.GUIDE_LAYER_ATTRIBUTE;
|
|
15
|
+
exports.GuideProgressConflict = format.GuideProgressConflict;
|
|
16
|
+
exports.GuideRuntime = format.GuideRuntime;
|
|
17
|
+
exports.SectionGuideButton = format.SectionGuideButton;
|
|
18
|
+
exports.THAI_MONTHS_SHORT = format.THAI_MONTHS_SHORT;
|
|
19
|
+
exports.apiCallDetail = format.apiCallDetail;
|
|
20
|
+
exports.emitGuideEvent = format.emitGuideEvent;
|
|
21
|
+
exports.fillRoute = format.fillRoute;
|
|
22
|
+
exports.formatBaht = format.formatBaht;
|
|
23
|
+
exports.guideAnchor = format.guideAnchor;
|
|
24
|
+
exports.guideMenuItems = format.guideMenuItems;
|
|
25
|
+
exports.guideMenuShown = format.guideMenuShown;
|
|
26
|
+
exports.loadGuides = format.loadGuides;
|
|
27
|
+
exports.matchApiPath = format.matchApiPath;
|
|
28
|
+
exports.matchRoute = format.matchRoute;
|
|
29
|
+
exports.openFlow = format.openFlow;
|
|
30
|
+
exports.openFlowsPanel = format.openFlowsPanel;
|
|
31
|
+
exports.openGuidePanel = format.openGuidePanel;
|
|
32
|
+
exports.openPageGuide = format.openPageGuide;
|
|
33
|
+
exports.openPagesPanel = format.openPagesPanel;
|
|
34
|
+
exports.openSectionGuide = format.openSectionGuide;
|
|
35
|
+
exports.reportApiCall = format.reportApiCall;
|
|
36
|
+
exports.reportApiEvent = format.reportApiEvent;
|
|
37
|
+
exports.setSectionGuideValues = format.setSectionGuideValues;
|
|
38
|
+
exports.storeGuides = format.storeGuides;
|
|
39
|
+
exports.thaiMonth = format.thaiMonth;
|
|
40
|
+
exports.thaiMonthYear = format.thaiMonthYear;
|
|
41
|
+
exports.useGuideEntry = format.useGuideEntry;
|
|
42
|
+
exports.usePageGuideEntry = format.usePageGuideEntry;
|
|
43
|
+
exports.usePageGuides = format.usePageGuides;
|
|
44
|
+
exports.useSectionGuideValues = format.useSectionGuideValues;
|
|
35
45
|
//# sourceMappingURL=guide-core.cjs.map
|
package/dist/guide-core.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"guide-core.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/guide-core.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, d as GuideRuntime, e as apiCallDetail, f as emitGuideEvent, g as fillRoute, h as
|
|
2
|
+
export { A as GUIDE_API_EVENT, G as GUIDE_EVENT_PREFIX, a as GUIDE_LAYER_ATTRIBUTE, c as GuideProgressConflict, d as GuideRuntime, S as SectionGuideButton, T as THAI_MONTHS_SHORT, e as apiCallDetail, f as emitGuideEvent, g as fillRoute, h as formatBaht, i as guideAnchor, j as guideMenuItems, k as guideMenuShown, l as loadGuides, m as matchApiPath, n as matchRoute, o as openFlow, p as openFlowsPanel, q as openGuidePanel, r as openPageGuide, s as openPagesPanel, t as openSectionGuide, u as reportApiCall, v as reportApiEvent, w as setSectionGuideValues, x as storeGuides, y as thaiMonth, z as thaiMonthYear, B as useGuideEntry, C as usePageGuideEntry, D as usePageGuides, E as useSectionGuideValues } from './chunks/format-BWUKNKxg.esm.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-dom';
|
|
@@ -6,8 +6,11 @@ export interface HelpButtonProps {
|
|
|
6
6
|
* --header-* variables of the workspace chrome, white on the brand chrome).
|
|
7
7
|
*
|
|
8
8
|
* When this user has something to open here, it opens a small menu:
|
|
9
|
-
* "คู่มือหน้านี้" (this page's guide), "
|
|
10
|
-
*
|
|
9
|
+
* "คู่มือหน้านี้" (this page's guide), "อธิบายส่วนนี้ · <title>" for each
|
|
10
|
+
* section guide on screen, "พาทำ · <title>" for each flow starting here,
|
|
11
|
+
* "ไกด์เริ่มต้น n/N" (the quest
|
|
12
|
+
* panel), "คู่มือทุกหน้า" (the panel's page guides), "พาทำงาน" (the panel's
|
|
13
|
+
* flows) and "ติดต่อทีมช่วยเหลือ"
|
|
11
14
|
* (the help dialog), each only when it has something. Otherwise one press
|
|
12
15
|
* opens the help dialog, as before.
|
|
13
16
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -14,7 +14,7 @@ var Link = require('next/link');
|
|
|
14
14
|
var reactDom = require('react-dom');
|
|
15
15
|
var nextThemes = require('next-themes');
|
|
16
16
|
var axios = require('axios');
|
|
17
|
-
var
|
|
17
|
+
var format = require('./chunks/format-BVoVc7Yk.cjs');
|
|
18
18
|
var reactQueryDevtools = require('@tanstack/react-query-devtools');
|
|
19
19
|
require('@floating-ui/dom');
|
|
20
20
|
|
|
@@ -1680,7 +1680,7 @@ instance.interceptors.response.use(response => {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
// The guided tour advances on saves that succeeded (method, path, status
|
|
1682
1682
|
// and the record's id only; never the body).
|
|
1683
|
-
|
|
1683
|
+
format.reportApiEvent(response);
|
|
1684
1684
|
return response;
|
|
1685
1685
|
}, async (error) => {
|
|
1686
1686
|
const originalRequest = error.config;
|
|
@@ -1697,7 +1697,7 @@ instance.interceptors.response.use(response => {
|
|
|
1697
1697
|
return instance(originalRequest);
|
|
1698
1698
|
}
|
|
1699
1699
|
await redirectToLogout();
|
|
1700
|
-
|
|
1700
|
+
format.reportApiEvent(error);
|
|
1701
1701
|
return Promise.reject(toApiError(error));
|
|
1702
1702
|
}
|
|
1703
1703
|
// The server refuses every organisation-scoped call when the account has
|
|
@@ -1713,7 +1713,7 @@ instance.interceptors.response.use(response => {
|
|
|
1713
1713
|
if (listed !== undefined)
|
|
1714
1714
|
return listed;
|
|
1715
1715
|
// A refused save keeps the tour's step and shows the server's message.
|
|
1716
|
-
|
|
1716
|
+
format.reportApiEvent(error);
|
|
1717
1717
|
return Promise.reject(toApiError(error));
|
|
1718
1718
|
});
|
|
1719
1719
|
|
|
@@ -1740,7 +1740,7 @@ function platformApiBase(app) {
|
|
|
1740
1740
|
* This package's version, attached to help messages so the back office can
|
|
1741
1741
|
* tell which shell a report came from. Keep in step with package.json.
|
|
1742
1742
|
*/
|
|
1743
|
-
const SHELL_VERSION = "0.1.
|
|
1743
|
+
const SHELL_VERSION = "0.1.76";
|
|
1744
1744
|
|
|
1745
1745
|
const HELP_APP_LABEL = {
|
|
1746
1746
|
platform: "แพลตฟอร์ม",
|
|
@@ -2412,11 +2412,11 @@ function NavMain({ items, orgCode, closeOnNavigation = false, approvalCounts, ch
|
|
|
2412
2412
|
// A one-line row: a link, lit on its own page only. No open
|
|
2413
2413
|
// state, no title tooltip.
|
|
2414
2414
|
return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [groupHeading, jsxRuntime.jsx(SidebarMenuItem, { children: jsxRuntime.jsx(SidebarMenuButton, { asChild: true, isActive: isItemActive, className: workspaceButton, children: jsxRuntime.jsxs(Link, { href: itemUrl, prefetch: false, className: "flex items-center w-full min-w-0 flex-1 " +
|
|
2415
|
-
(workspace ? "gap-3" : "gap-2"), onClick: handleNavLinkClick, "aria-current": isItemActive ? "page" : undefined, ...
|
|
2415
|
+
(workspace ? "gap-3" : "gap-2"), onClick: handleNavLinkClick, "aria-current": isItemActive ? "page" : undefined, ...format.guideAnchor(`nav.${item.id}`), children: [icon, jsxRuntime.jsx("span", { id: item.id, className: "flex-1 truncate", children: item.titleTh }), badge] }) }) })] }, item.id));
|
|
2416
2416
|
}
|
|
2417
2417
|
// A group: its header opens and shuts it (the chevron says which).
|
|
2418
2418
|
// An open group is not the current page — only a row in it is.
|
|
2419
|
-
return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [groupHeading, jsxRuntime.jsx(erpTheme.Collapsible, { asChild: true, open: openIds.has(item.id), onOpenChange: isOpen => setItemOpen(item.id, isOpen), className: "group/collapsible", children: jsxRuntime.jsxs(SidebarMenuItem, { children: [jsxRuntime.jsx(erpTheme.CollapsibleTrigger, { asChild: true, children: jsxRuntime.jsxs(SidebarMenuButton, { isActive: isItemActive, className: workspaceButton, ...
|
|
2419
|
+
return (jsxRuntime.jsxs(React__namespace.Fragment, { children: [groupHeading, jsxRuntime.jsx(erpTheme.Collapsible, { asChild: true, open: openIds.has(item.id), onOpenChange: isOpen => setItemOpen(item.id, isOpen), className: "group/collapsible", children: jsxRuntime.jsxs(SidebarMenuItem, { children: [jsxRuntime.jsx(erpTheme.CollapsibleTrigger, { asChild: true, children: jsxRuntime.jsxs(SidebarMenuButton, { isActive: isItemActive, className: workspaceButton, ...format.guideAnchor(`nav.${item.id}`), children: [icon, jsxRuntime.jsx("span", { id: item.id, className: "flex-1 truncate text-left", children: item.titleTh }), jsxRuntime.jsx(lucideReact.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })] }) }), item.subModules && (jsxRuntime.jsx(erpTheme.CollapsibleContent, { children: jsxRuntime.jsx(SidebarMenuSub, { className: workspace
|
|
2420
2420
|
? "mx-0 mt-1 mb-3 ml-[21px] gap-0.5 border-l border-sidebar-border pl-2.5 [&_a]:h-auto [&_a]:gap-[11px] [&_a]:px-3 [&_a]:py-2 [&_a]:text-xs [&_svg]:!size-[17px]"
|
|
2421
2421
|
: undefined, children: item.subModules.map((subItem, subIndex) => {
|
|
2422
2422
|
const subItemUrl = buildUrlWithCode(code, subItem.url);
|
|
@@ -2429,7 +2429,7 @@ function NavMain({ items, orgCode, closeOnNavigation = false, approvalCounts, ch
|
|
|
2429
2429
|
subItem.subPages &&
|
|
2430
2430
|
subItem.subPages.length > 0) {
|
|
2431
2431
|
return (jsxRuntime.jsx(erpTheme.Collapsible, { asChild: true, defaultOpen: isSubItemActive || openSub === subIndex, className: "group/sub-collapsible", children: jsxRuntime.jsxs(SidebarMenuSubItem, { children: [jsxRuntime.jsx(erpTheme.CollapsibleTrigger, { asChild: true, children: jsxRuntime.jsxs(SidebarMenuSubButton, { className: "w-full", isActive: isSubItemActive &&
|
|
2432
|
-
activeSubPage === null, ...
|
|
2432
|
+
activeSubPage === null, ...format.guideAnchor(`nav.${subItem.id}`), children: [SubIcon && (jsxRuntime.jsx(SubIcon, { className: "sidebar-submodule-icon flex-shrink-0" })), jsxRuntime.jsx("span", { className: "flex-1 truncate", children: subItem.titleTh }), jsxRuntime.jsx(lucideReact.ChevronDown, { className: "ml-auto size-4 transition-transform duration-200 group-data-[state=open]/sub-collapsible:rotate-180" })] }) }), jsxRuntime.jsx(erpTheme.CollapsibleContent, { children: jsxRuntime.jsx(SidebarMenuSub, { className: "ml-4", children: subItem.subPages.map((subPage, subPageIndex) => {
|
|
2433
2433
|
const subPageUrl = buildUrlWithCode(code, subPage.url);
|
|
2434
2434
|
const isSubPageActive = isSubItemActive &&
|
|
2435
2435
|
activeSubPage === subPageIndex;
|
|
@@ -2437,7 +2437,7 @@ function NavMain({ items, orgCode, closeOnNavigation = false, approvalCounts, ch
|
|
|
2437
2437
|
return (jsxRuntime.jsx(SidebarMenuSubItem, { children: jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, className: "font-thai w-full text-sm" +
|
|
2438
2438
|
(isSubPageActive
|
|
2439
2439
|
? " font-medium"
|
|
2440
|
-
: ""), isActive: isSubPageActive, children: jsxRuntime.jsxs(Link, { href: subPageUrl, prefetch: false, className: "w-full flex items-center", ...
|
|
2440
|
+
: ""), isActive: isSubPageActive, children: jsxRuntime.jsxs(Link, { href: subPageUrl, prefetch: false, className: "w-full flex items-center", ...format.guideAnchor(`nav.${subPage.id}`), onClick: handleNavLinkClick, "aria-current": isSubPageActive
|
|
2441
2441
|
? "page"
|
|
2442
2442
|
: undefined, children: [SubPageIcon && (jsxRuntime.jsx(SubPageIcon, { className: "sidebar-subpage-icon flex-shrink-0" })), jsxRuntime.jsx("span", { className: "flex-1 truncate", children: subPage.titleTh })] }) }) }, subPage.id));
|
|
2443
2443
|
}) }) })] }) }, subItem.id));
|
|
@@ -2445,7 +2445,7 @@ function NavMain({ items, orgCode, closeOnNavigation = false, approvalCounts, ch
|
|
|
2445
2445
|
return (jsxRuntime.jsx(SidebarMenuSubItem, { children: jsxRuntime.jsx(SidebarMenuSubButton, { asChild: true, className: "w-full" +
|
|
2446
2446
|
(workspace && isSubItemActive
|
|
2447
2447
|
? " font-semibold"
|
|
2448
|
-
: ""), isActive: isSubItemActive, children: jsxRuntime.jsxs(Link, { href: subItemUrl, prefetch: false, className: "w-full flex items-center", ...
|
|
2448
|
+
: ""), isActive: isSubItemActive, children: jsxRuntime.jsxs(Link, { href: subItemUrl, prefetch: false, className: "w-full flex items-center", ...format.guideAnchor(`nav.${subItem.id}`), onClick: handleNavLinkClick, "aria-current": isSubItemActive ? "page" : undefined, children: [SubIcon && (jsxRuntime.jsx(SubIcon, { className: "sidebar-submodule-icon flex-shrink-0" })), jsxRuntime.jsx("span", { className: "flex-1 truncate", children: subItem.titleTh }), approvalCount > 0 && (jsxRuntime.jsx(erpTheme.Badge, { variant: "destructive", className: "ml-auto h-5 min-w-5 px-1.5 text-xs font-medium tabular-nums", children: approvalCount > 99
|
|
2449
2449
|
? "99+"
|
|
2450
2450
|
: approvalCount }))] }) }) }, subItem.id));
|
|
2451
2451
|
}) }) }))] }) })] }, item.id));
|
|
@@ -2573,17 +2573,20 @@ const BUTTON_CLASS = "grid size-[34px] shrink-0 place-items-center rounded-lg te
|
|
|
2573
2573
|
* --header-* variables of the workspace chrome, white on the brand chrome).
|
|
2574
2574
|
*
|
|
2575
2575
|
* When this user has something to open here, it opens a small menu:
|
|
2576
|
-
* "คู่มือหน้านี้" (this page's guide), "
|
|
2577
|
-
*
|
|
2576
|
+
* "คู่มือหน้านี้" (this page's guide), "อธิบายส่วนนี้ · <title>" for each
|
|
2577
|
+
* section guide on screen, "พาทำ · <title>" for each flow starting here,
|
|
2578
|
+
* "ไกด์เริ่มต้น n/N" (the quest
|
|
2579
|
+
* panel), "คู่มือทุกหน้า" (the panel's page guides), "พาทำงาน" (the panel's
|
|
2580
|
+
* flows) and "ติดต่อทีมช่วยเหลือ"
|
|
2578
2581
|
* (the help dialog), each only when it has something. Otherwise one press
|
|
2579
2582
|
* opens the help dialog, as before.
|
|
2580
2583
|
*/
|
|
2581
2584
|
function HelpButton({ className }) {
|
|
2582
|
-
const guide =
|
|
2583
|
-
const pages =
|
|
2585
|
+
const guide = format.useGuideEntry();
|
|
2586
|
+
const pages = format.usePageGuides();
|
|
2584
2587
|
const toGuide = React.useRef(false);
|
|
2585
2588
|
const cls = BUTTON_CLASS + (className ? ` ${className}` : "");
|
|
2586
|
-
const items =
|
|
2589
|
+
const items = format.guideMenuItems(guide, pages);
|
|
2587
2590
|
// The tour takes focus (a step, the panel); the button must not take it back.
|
|
2588
2591
|
const toTour = (open) => () => {
|
|
2589
2592
|
toGuide.current = true;
|
|
@@ -2598,7 +2601,11 @@ function HelpButton({ className }) {
|
|
|
2598
2601
|
e.preventDefault();
|
|
2599
2602
|
toGuide.current = false;
|
|
2600
2603
|
}
|
|
2601
|
-
}, children: [items.includes("page") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(
|
|
2604
|
+
}, children: [items.includes("page") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openPageGuide), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.BookOpen, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E2B\u0E19\u0E49\u0E32\u0E19\u0E35\u0E49" })] })) : null, items.includes("sections")
|
|
2605
|
+
? (pages.sections ?? []).map(sec => (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(() => format.openSectionGuide(sec.key)), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Info, { className: "size-4" }), jsxRuntime.jsxs("span", { className: "flex-1", children: ["\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22\u0E2A\u0E48\u0E27\u0E19\u0E19\u0E35\u0E49 \u00B7 ", sec.title] })] }, sec.key)))
|
|
2606
|
+
: null, items.includes("flowsHere")
|
|
2607
|
+
? (pages.flows ?? []).map(f => (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(() => format.openFlow(f.key)), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Route, { className: "size-4" }), jsxRuntime.jsxs("span", { className: "flex-1", children: ["\u0E1E\u0E32\u0E17\u0E33 \u00B7 ", f.title] })] }, f.key)))
|
|
2608
|
+
: null, items.includes("missions") && guide ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openGuidePanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Flag, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E44\u0E01\u0E14\u0E4C\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19" }), jsxRuntime.jsxs("span", { className: "text-xs font-semibold text-primary tabular-nums", children: [guide.done, "/", guide.total] })] })) : null, items.includes("pages") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openPagesPanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Library, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E04\u0E39\u0E48\u0E21\u0E37\u0E2D\u0E17\u0E38\u0E01\u0E2B\u0E19\u0E49\u0E32" })] })) : null, items.includes("flows") ? (jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: toTour(format.openFlowsPanel), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.Route, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E1E\u0E32\u0E17\u0E33\u0E07\u0E32\u0E19" })] })) : null, jsxRuntime.jsxs(erpTheme.DropdownMenuItem, { onSelect: () => setTimeout(openHelp, 0), className: "gap-2.5", children: [jsxRuntime.jsx(lucideReact.MessageCircle, { className: "size-4" }), jsxRuntime.jsx("span", { className: "flex-1", children: "\u0E15\u0E34\u0E14\u0E15\u0E48\u0E2D\u0E17\u0E35\u0E21\u0E0A\u0E48\u0E27\u0E22\u0E40\u0E2B\u0E25\u0E37\u0E2D" })] })] })] }));
|
|
2602
2609
|
}
|
|
2603
2610
|
|
|
2604
2611
|
const hasPaginationShape = (payload) => {
|
|
@@ -3609,7 +3616,7 @@ function platformGuideProgress(organizationId) {
|
|
|
3609
3616
|
|
|
3610
3617
|
function GuideHost(props) {
|
|
3611
3618
|
// The boundary covers the adapters too (useSidebar throws without its provider).
|
|
3612
|
-
return (jsxRuntime.jsx(
|
|
3619
|
+
return (jsxRuntime.jsx(format.GuideErrorBoundary, { children: jsxRuntime.jsx(React.Suspense, { fallback: null, children: jsxRuntime.jsx(GuideHostInner, { ...props }) }) }));
|
|
3613
3620
|
}
|
|
3614
3621
|
let fallbackClient = null;
|
|
3615
3622
|
function useShellQueryClient() {
|
|
@@ -3660,7 +3667,7 @@ function GuideHostInner({ config, organizationId, code }) {
|
|
|
3660
3667
|
}, [client, organizationId, suite.app, suite.key, suite.version]);
|
|
3661
3668
|
const routing = React.useMemo(() => ({ pathname, search, navigate: (href) => router.push(href) }), [pathname, search, router]);
|
|
3662
3669
|
const menu = React.useMemo(() => ({ open: sidebarOpen }), [sidebarOpen]);
|
|
3663
|
-
return (jsxRuntime.jsx(
|
|
3670
|
+
return (jsxRuntime.jsx(format.GuideRuntime, { config: config, organizationId: organizationId, code: code, routing: routing, progress: progress, isBusy: isBusy, menu: menu, hidden: employeeBlocked }));
|
|
3664
3671
|
}
|
|
3665
3672
|
|
|
3666
3673
|
/**
|
|
@@ -3869,7 +3876,7 @@ function AppLayoutShell({ children, sidebar, loadingComponent, breadcrumb, permi
|
|
|
3869
3876
|
// As in the design: the mark, then a menu button, and the
|
|
3870
3877
|
// organisation on the right — no trail, no title, so the
|
|
3871
3878
|
// organisation's name has the room it needs on a phone.
|
|
3872
|
-
jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [mobileBrand ? (jsxRuntime.jsx("div", { className: "shrink-0", children: mobileBrand })) : null, jsxRuntime.jsx("button", { type: "button", onClick: () => setOpen(!open), "aria-label": open ? "ปิดเมนู" : "เปิดเมนู", ...
|
|
3879
|
+
jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [mobileBrand ? (jsxRuntime.jsx("div", { className: "shrink-0", children: mobileBrand })) : null, jsxRuntime.jsx("button", { type: "button", onClick: () => setOpen(!open), "aria-label": open ? "ปิดเมนู" : "เปิดเมนู", ...format.guideAnchor("shell.menu-toggle"), className: "grid size-[34px] shrink-0 place-items-center rounded-lg text-[var(--header-fg-muted)] transition-colors hover:bg-[var(--header-hover)] hover:text-[var(--header-fg)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--header-fg-muted)]", children: jsxRuntime.jsx(lucideReact.LayoutGrid, { className: "size-5", strokeWidth: 1.65 }) })] })) : (jsxRuntime.jsx(SidebarTrigger, { className: "shrink-0 text-[var(--header-fg-muted)] hover:bg-[var(--header-hover)] hover:text-[var(--header-fg)] [&_svg]:!text-current" })), jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center gap-0.5", children: [jsxRuntime.jsx("div", { className: "hidden min-w-0 sm:block", children: trail }), jsxRuntime.jsx("div", { id: "header-title", className: "min-w-0 max-sm:hidden" })] }), headerEnd || showHelp ? (jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-3 sm:gap-5", children: [headerEnd, showHelp ? jsxRuntime.jsx(HelpButton, {}) : null] })) : null] })] })) : (jsxRuntime.jsxs("div", { className: "sticky top-0 z-30 shrink-0 w-full", children: [jsxRuntime.jsx(HeaderBackground, {}), jsxRuntime.jsxs("header", { className: "relative shrink-0 gap-2 py-4 h-auto min-h-[123.5px] w-full z-10", children: [jsxRuntime.jsxs("div", { className: "flex w-full items-center gap-2 px-3 sm:px-4 lg:px-6", children: [jsxRuntime.jsx(SidebarTrigger, { className: "shrink-0 text-white hover:bg-white/10" }), jsxRuntime.jsx("div", { className: "flex-1 min-w-0", children: trail }), headerEnd || showHelp ? (jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-3", children: [headerEnd, showHelp ? jsxRuntime.jsx(HelpButton, {}) : null] })) : null] }), jsxRuntime.jsx("div", { id: "header-title" })] })] })), jsxRuntime.jsx(React.Suspense, { fallback: jsxRuntime.jsx("div", { className: "relative z-10 min-h-[calc(100vh-8rem)]", children: jsxRuntime.jsx("div", { className: "flex h-full items-center justify-center", children: jsxRuntime.jsxs("div", { className: "space-y-4 text-center", children: [jsxRuntime.jsx("div", { className: "mx-auto h-8 w-8 animate-spin rounded-full border-b-2 border-primary" }), jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14..." })] }) }) }), children: jsxRuntime.jsx("div", { className: workspace
|
|
3873
3880
|
? "relative z-10 px-[18px] pt-[26px] pb-4 sm:px-6 lg:px-10 lg:pt-[38px]"
|
|
3874
3881
|
: cx("relative z-10 pr-6", needsLeftGutter && "pl-6"), children: refusePage
|
|
3875
3882
|
? (notMemberComponent ?? (jsxRuntime.jsx(AccessDenied, { title: "\u0E44\u0E21\u0E48\u0E21\u0E35\u0E2A\u0E34\u0E17\u0E18\u0E34\u0E4C\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E2D\u0E07\u0E04\u0E4C\u0E01\u0E23\u0E19\u0E35\u0E49", message: `บัญชีนี้ไม่ได้เป็นสมาชิกขององค์กร ${code}`, homeHref: selectOrganizationUrl, homeLabel: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2D\u0E07\u0E04\u0E4C\u0E01\u0E23" })))
|
|
@@ -4442,23 +4449,33 @@ Object.defineProperty(exports, "isAxiosError", {
|
|
|
4442
4449
|
enumerable: true,
|
|
4443
4450
|
get: function () { return axios.isAxiosError; }
|
|
4444
4451
|
});
|
|
4445
|
-
exports.GUIDE_API_EVENT =
|
|
4446
|
-
exports.GUIDE_EVENT_PREFIX =
|
|
4447
|
-
exports.GUIDE_LAYER_ATTRIBUTE =
|
|
4448
|
-
exports.GuideProgressConflict =
|
|
4449
|
-
exports.GuideRuntime =
|
|
4450
|
-
exports.
|
|
4451
|
-
exports.
|
|
4452
|
-
exports.
|
|
4453
|
-
exports.
|
|
4454
|
-
exports.
|
|
4455
|
-
exports.
|
|
4456
|
-
exports.
|
|
4457
|
-
exports.
|
|
4458
|
-
exports.
|
|
4459
|
-
exports.
|
|
4460
|
-
exports.
|
|
4461
|
-
exports.
|
|
4452
|
+
exports.GUIDE_API_EVENT = format.API_EVENT;
|
|
4453
|
+
exports.GUIDE_EVENT_PREFIX = format.GUIDE_EVENT_PREFIX;
|
|
4454
|
+
exports.GUIDE_LAYER_ATTRIBUTE = format.GUIDE_LAYER_ATTRIBUTE;
|
|
4455
|
+
exports.GuideProgressConflict = format.GuideProgressConflict;
|
|
4456
|
+
exports.GuideRuntime = format.GuideRuntime;
|
|
4457
|
+
exports.SectionGuideButton = format.SectionGuideButton;
|
|
4458
|
+
exports.THAI_MONTHS_SHORT = format.THAI_MONTHS_SHORT;
|
|
4459
|
+
exports.emitGuideEvent = format.emitGuideEvent;
|
|
4460
|
+
exports.formatBaht = format.formatBaht;
|
|
4461
|
+
exports.guideAnchor = format.guideAnchor;
|
|
4462
|
+
exports.guideMenuItems = format.guideMenuItems;
|
|
4463
|
+
exports.guideMenuShown = format.guideMenuShown;
|
|
4464
|
+
exports.openFlow = format.openFlow;
|
|
4465
|
+
exports.openFlowsPanel = format.openFlowsPanel;
|
|
4466
|
+
exports.openGuidePanel = format.openGuidePanel;
|
|
4467
|
+
exports.openPageGuide = format.openPageGuide;
|
|
4468
|
+
exports.openPagesPanel = format.openPagesPanel;
|
|
4469
|
+
exports.openSectionGuide = format.openSectionGuide;
|
|
4470
|
+
exports.reportApiCall = format.reportApiCall;
|
|
4471
|
+
exports.reportApiEvent = format.reportApiEvent;
|
|
4472
|
+
exports.setSectionGuideValues = format.setSectionGuideValues;
|
|
4473
|
+
exports.thaiMonth = format.thaiMonth;
|
|
4474
|
+
exports.thaiMonthYear = format.thaiMonthYear;
|
|
4475
|
+
exports.useGuideEntry = format.useGuideEntry;
|
|
4476
|
+
exports.usePageGuideEntry = format.usePageGuideEntry;
|
|
4477
|
+
exports.usePageGuides = format.usePageGuides;
|
|
4478
|
+
exports.useSectionGuideValues = format.useSectionGuideValues;
|
|
4462
4479
|
exports.AccessDenied = AccessDenied;
|
|
4463
4480
|
exports.ApiError = ApiError;
|
|
4464
4481
|
exports.AppBreadcrumb = AppBreadcrumb;
|