@ketvietlab/ketsuite 0.1.3 → 0.1.5
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/cli.js +1 -1
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +3 -0
- package/dist/deployment.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/account_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/account_staff_channel/channel-routes.js +1 -12
- package/dist/modules/account_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/attendance/channel-routes.d.ts.map +1 -1
- package/dist/modules/attendance/channel-routes.js +1 -12
- package/dist/modules/attendance/channel-routes.js.map +1 -1
- package/dist/modules/backend/design/client/table-selection.d.mts +3 -3
- package/dist/modules/backend/design/client/table-selection.d.mts.map +1 -1
- package/dist/modules/backend/design/client/table-selection.mjs +1 -1
- package/dist/modules/backend/design/client/table-selection.mjs.map +3 -3
- package/dist/modules/backend/design/content.css +43 -0
- package/dist/modules/backend/design/forms.css +22 -0
- package/dist/modules/backend/design/responsive.css +0 -5
- package/dist/modules/backend/forms.d.ts +38 -1
- package/dist/modules/backend/forms.d.ts.map +1 -1
- package/dist/modules/backend/forms.js +29 -0
- package/dist/modules/backend/forms.js.map +1 -1
- package/dist/modules/backend/index.d.ts +3 -2
- package/dist/modules/backend/index.d.ts.map +1 -1
- package/dist/modules/backend/index.js +2 -2
- package/dist/modules/backend/index.js.map +1 -1
- package/dist/modules/backend/messages.d.ts.map +1 -1
- package/dist/modules/backend/messages.js +40 -2
- package/dist/modules/backend/messages.js.map +1 -1
- package/dist/modules/channel_api/core.d.ts +30 -0
- package/dist/modules/channel_api/core.d.ts.map +1 -1
- package/dist/modules/channel_api/core.js +28 -0
- package/dist/modules/channel_api/core.js.map +1 -1
- package/dist/modules/crm_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/crm_staff_channel/channel-routes.js +1 -12
- package/dist/modules/crm_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/flow/membership.d.ts.map +1 -1
- package/dist/modules/flow/membership.js +7 -1
- package/dist/modules/flow/membership.js.map +1 -1
- package/dist/modules/flow/operations.d.ts +10 -4
- package/dist/modules/flow/operations.d.ts.map +1 -1
- package/dist/modules/flow/operations.js +10 -4
- package/dist/modules/flow/operations.js.map +1 -1
- package/dist/modules/flow_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/flow_staff_channel/channel-routes.js +1 -20
- package/dist/modules/flow_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/hospitality_core/messages.d.ts.map +1 -1
- package/dist/modules/hospitality_core/messages.js +44 -0
- package/dist/modules/hospitality_core/messages.js.map +1 -1
- package/dist/modules/hospitality_core/night-audit.d.ts.map +1 -1
- package/dist/modules/hospitality_core/night-audit.js +7 -0
- package/dist/modules/hospitality_core/night-audit.js.map +1 -1
- package/dist/modules/hospitality_core/operations.d.ts.map +1 -1
- package/dist/modules/hospitality_core/operations.js +150 -40
- package/dist/modules/hospitality_core/operations.js.map +1 -1
- package/dist/modules/hospitality_core/routes.d.ts.map +1 -1
- package/dist/modules/hospitality_core/routes.js +24 -2
- package/dist/modules/hospitality_core/routes.js.map +1 -1
- package/dist/modules/hospitality_core/screens/check-out-prep.d.ts +46 -0
- package/dist/modules/hospitality_core/screens/check-out-prep.d.ts.map +1 -0
- package/dist/modules/hospitality_core/screens/check-out-prep.js +133 -0
- package/dist/modules/hospitality_core/screens/check-out-prep.js.map +1 -0
- package/dist/modules/hospitality_core/screens/folio-detail.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/folio-detail.js +2 -4
- package/dist/modules/hospitality_core/screens/folio-detail.js.map +1 -1
- package/dist/modules/hospitality_core/screens/index.d.ts +2 -0
- package/dist/modules/hospitality_core/screens/index.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/index.js +1 -0
- package/dist/modules/hospitality_core/screens/index.js.map +1 -1
- package/dist/modules/hospitality_core/screens/reservation-detail.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/reservation-detail.js +8 -1
- package/dist/modules/hospitality_core/screens/reservation-detail.js.map +1 -1
- package/dist/modules/hospitality_core/screens/shared.d.ts +12 -0
- package/dist/modules/hospitality_core/screens/shared.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/shared.js +25 -4
- package/dist/modules/hospitality_core/screens/shared.js.map +1 -1
- package/dist/modules/hospitality_core/services.d.ts +48 -0
- package/dist/modules/hospitality_core/services.d.ts.map +1 -1
- package/dist/modules/hospitality_core/services.js +70 -0
- package/dist/modules/hospitality_core/services.js.map +1 -1
- package/dist/modules/hospitality_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/hospitality_staff_channel/channel-routes.js +1 -12
- package/dist/modules/hospitality_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/inventory_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/inventory_staff_channel/channel-routes.js +1 -12
- package/dist/modules/inventory_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/purchase_staff_channel/order-routes.d.ts.map +1 -1
- package/dist/modules/purchase_staff_channel/order-routes.js +1 -12
- package/dist/modules/purchase_staff_channel/order-routes.js.map +1 -1
- package/dist/modules/quality_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/quality_staff_channel/channel-routes.js +1 -12
- package/dist/modules/quality_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/sale/functions.d.ts.map +1 -1
- package/dist/modules/sale/functions.js +27 -17
- package/dist/modules/sale/functions.js.map +1 -1
- package/dist/modules/sale_staff_channel/channel-routes.d.ts.map +1 -1
- package/dist/modules/sale_staff_channel/channel-routes.js +1 -12
- package/dist/modules/sale_staff_channel/channel-routes.js.map +1 -1
- package/dist/modules/sale_staff_channel/order-routes.d.ts.map +1 -1
- package/dist/modules/sale_staff_channel/order-routes.js +1 -12
- package/dist/modules/sale_staff_channel/order-routes.js.map +1 -1
- package/dist/modules/stock_staff_channel/operation-routes.d.ts.map +1 -1
- package/dist/modules/stock_staff_channel/operation-routes.js +1 -12
- package/dist/modules/stock_staff_channel/operation-routes.js.map +1 -1
- package/dist/modules/user_backend/messages.d.ts +4 -0
- package/dist/modules/user_backend/messages.d.ts.map +1 -1
- package/dist/modules/user_backend/messages.js +4 -0
- package/dist/modules/user_backend/messages.js.map +1 -1
- package/dist/modules/user_backend/routes.d.ts.map +1 -1
- package/dist/modules/user_backend/routes.js +28 -1
- package/dist/modules/user_backend/routes.js.map +1 -1
- package/dist/modules/user_backend/screens/user-form.d.ts +1 -0
- package/dist/modules/user_backend/screens/user-form.d.ts.map +1 -1
- package/dist/modules/user_backend/screens/user-form.js +28 -0
- package/dist/modules/user_backend/screens/user-form.js.map +1 -1
- package/dist/modules/website/cms.d.ts.map +1 -1
- package/dist/modules/website/cms.js +283 -6
- package/dist/modules/website/cms.js.map +1 -1
- package/dist/modules/website/index.d.ts.map +1 -1
- package/dist/modules/website/index.js +12 -0
- package/dist/modules/website/index.js.map +1 -1
- package/dist/modules/website/media-usage.d.ts +38 -0
- package/dist/modules/website/media-usage.d.ts.map +1 -0
- package/dist/modules/website/media-usage.js +87 -0
- package/dist/modules/website/media-usage.js.map +1 -0
- package/dist/modules/website/paths.js +1 -1
- package/dist/modules/website/paths.js.map +1 -1
- package/dist/modules/website/sections.d.ts.map +1 -1
- package/dist/modules/website/sections.js +12 -1
- package/dist/modules/website/sections.js.map +1 -1
- package/dist/modules/website_backend/index.js +138 -0
- package/dist/modules/website_backend/index.js.map +1 -1
- package/dist/modules/website_backend/menus.d.ts.map +1 -1
- package/dist/modules/website_backend/menus.js +11 -0
- package/dist/modules/website_backend/menus.js.map +1 -1
- package/dist/modules/website_backend/routes.d.ts.map +1 -1
- package/dist/modules/website_backend/routes.js +414 -31
- package/dist/modules/website_backend/routes.js.map +1 -1
- package/dist/modules/website_backend/screens/index.d.ts +98 -6
- package/dist/modules/website_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/website_backend/screens/index.js +600 -154
- package/dist/modules/website_backend/screens/index.js.map +1 -1
- package/dist/modules/website_backend/screens/page-frame.d.ts +3 -1
- package/dist/modules/website_backend/screens/page-frame.d.ts.map +1 -1
- package/dist/modules/website_backend/screens/page-frame.js +1 -1
- package/dist/modules/website_backend/screens/page-frame.js.map +1 -1
- package/dist/modules/website_menu/functions.d.ts.map +1 -1
- package/dist/modules/website_menu/functions.js +51 -0
- package/dist/modules/website_menu/functions.js.map +1 -1
- package/dist/modules/website_menu/index.js +2 -0
- package/dist/modules/website_menu/index.js.map +1 -1
- package/dist/modules/website_search/functions.d.ts.map +1 -1
- package/dist/modules/website_search/functions.js +10 -120
- package/dist/modules/website_search/functions.js.map +1 -1
- package/dist/modules/website_search/index.js +2 -0
- package/dist/modules/website_search/index.js.map +1 -1
- package/dist/modules/website_search/jobs.d.ts +3 -0
- package/dist/modules/website_search/jobs.d.ts.map +1 -0
- package/dist/modules/website_search/jobs.js +101 -0
- package/dist/modules/website_search/jobs.js.map +1 -0
- package/dist/modules/website_search/rebuild.d.ts +33 -0
- package/dist/modules/website_search/rebuild.d.ts.map +1 -0
- package/dist/modules/website_search/rebuild.js +125 -0
- package/dist/modules/website_search/rebuild.js.map +1 -0
- package/dist/permission-catalogue.d.ts.map +1 -1
- package/dist/permission-catalogue.js +14 -1
- package/dist/permission-catalogue.js.map +1 -1
- package/dist/scaffold/index.js +1 -1
- package/dist/ui/chrome.d.ts +8 -0
- package/dist/ui/chrome.d.ts.map +1 -1
- package/dist/ui/chrome.js +9 -1
- package/dist/ui/chrome.js.map +1 -1
- package/dist/ui/client/table-selection-view.d.ts.map +1 -1
- package/dist/ui/client/table-selection-view.js +67 -5
- package/dist/ui/client/table-selection-view.js.map +1 -1
- package/dist/ui/form.d.ts +2 -0
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +1 -0
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/index.d.ts +2 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +2 -2
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/state.d.ts +20 -1
- package/dist/ui/state.d.ts.map +1 -1
- package/dist/ui/state.js +17 -0
- package/dist/ui/state.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../ui/client/table-selection-view.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { IslandController, IslandProps } from '@ketvietlab/ketjs-view'\n\nconst tableSelectionMarker = Symbol.for('ket.backend.table-selection')\nconst dropdownDismissMarker = Symbol.for('ket.backend.dropdown-dismiss')\nconst globalFilterMarker = Symbol.for('ket.backend.global-filter')\nconst routeModalMarker = Symbol.for('ket.backend.route-modal')\nconst dismissibleDropdown = [\n '[data-ui=\"search-menu\"]',\n '[data-ui=\"col-config\"]',\n '[data-ui=\"bulk-actions\"]',\n '[data-ui=\"viewer\"]',\n '[data-ui=\"record-more\"]',\n].join(', ')\n\ntype KetBrowserGlobals = typeof globalThis & {\n [key: symbol]: unknown\n __ketNavigation?: { navigate?: (href: string) => unknown }\n confirm: (message?: string) => boolean\n}\n\nconst browserGlobals = globalThis as KetBrowserGlobals\nconst eventElement = (event: Event): Element | null => (event.target instanceof Element ? event.target : null)\n\nconst updateSelection = (table: Element): void => {\n const rows = [...table.querySelectorAll<HTMLInputElement>('[data-ui=\"row-select\"]:not(:disabled)')]\n const checked = rows.filter((input) => input.checked).length\n const all = table.querySelector<HTMLInputElement>('[data-ui=\"select-all\"]')\n if (all) {\n all.checked = rows.length > 0 && checked === rows.length\n all.indeterminate = checked > 0 && checked < rows.length\n }\n if (!checked) {\n const shell = table.closest('[data-ui=\"shell\"]')\n for (const menu of shell?.querySelectorAll<HTMLDetailsElement>('[data-ui=\"bulk-actions\"][open]') ?? [])\n menu.removeAttribute('open')\n }\n}\n\nconst installTableSelection = (): void => {\n if (browserGlobals[tableSelectionMarker]) return\n browserGlobals[tableSelectionMarker] = true\n\n document.addEventListener('change', (event) => {\n const target = eventElement(event)\n if (!(target instanceof HTMLInputElement)) return\n if (!target.matches('[data-ui=\"select-all\"], [data-ui=\"row-select\"]')) return\n const table = target.closest('[data-ui=\"table\"]')\n if (!table) return\n if (target.matches('[data-ui=\"select-all\"]'))\n for (const input of table.querySelectorAll<HTMLInputElement>('[data-ui=\"row-select\"]:not(:disabled)'))\n input.checked = target.checked\n updateSelection(table)\n })\n\n document.addEventListener('click', (event) => {\n if (\n event.defaultPrevented ||\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n )\n return\n const target = eventElement(event)\n if (\n target?.closest('a, button, input, select, textarea, label, summary, details, [data-ui=\"select-cell\"]')\n )\n return\n const row = target?.closest<HTMLElement>('[data-ui=\"row\"][data-row-href]')\n const href = row?.getAttribute('data-row-href')\n if (!href) return\n event.preventDefault()\n if (browserGlobals.__ketNavigation?.navigate) void browserGlobals.__ketNavigation.navigate(href)\n else browserGlobals.location.assign(href)\n })\n}\n\nconst openDropdowns = (): HTMLDetailsElement[] => [\n ...document.querySelectorAll<HTMLDetailsElement>(`${dismissibleDropdown}[open]`),\n]\n\nconst installDropdownDismiss = (): void => {\n if (browserGlobals[dropdownDismissMarker]) return\n browserGlobals[dropdownDismissMarker] = true\n\n document.addEventListener('click', (event) => {\n const current = eventElement(event)?.closest(dismissibleDropdown)\n for (const dropdown of openDropdowns()) {\n if (dropdown !== current && !dropdown.contains(current ?? null)) dropdown.removeAttribute('open')\n }\n })\n\n document.addEventListener('keydown', (event) => {\n if (event.key !== 'Escape') return\n const dropdowns = openDropdowns()\n if (!dropdowns.length) return\n const focused = document.activeElement?.closest<HTMLDetailsElement>(dismissibleDropdown)\n const current = focused?.open ? focused : dropdowns.at(-1)\n current?.removeAttribute('open')\n current?.querySelector<HTMLElement>('summary')?.focus()\n event.preventDefault()\n })\n}\n\nconst installGlobalFilter = (): void => {\n if (browserGlobals[globalFilterMarker]) return\n browserGlobals[globalFilterMarker] = true\n\n document.addEventListener('click', (event) => {\n const trigger = eventElement(event)?.closest<HTMLElement>('[data-ui=\"chrome-search-toggle\"]')\n const controls = trigger?.getAttribute('aria-controls')\n if (!trigger || !controls) return\n const dialog = document.getElementById(controls)\n if (!(dialog instanceof HTMLDialogElement) || dialog.open) return\n dialog.showModal()\n trigger.setAttribute('aria-expanded', 'true')\n requestAnimationFrame(() =>\n dialog\n .querySelector<HTMLElement>('[data-presentation=\"modal\"] [data-ui=\"chrome-search-input\"]')\n ?.focus(),\n )\n })\n\n document.addEventListener(\n 'cancel',\n (event) => {\n if (!eventElement(event)?.matches('[data-ui=\"chrome-search-modal\"]')) return\n event.preventDefault()\n },\n true,\n )\n\n document.addEventListener(\n 'close',\n (event) => {\n const dialog = eventElement(event)\n if (!(dialog instanceof HTMLDialogElement)) return\n if (!dialog.matches('[data-ui=\"chrome-search-modal\"]')) return\n const trigger = document.querySelector<HTMLElement>(\n `[data-ui=\"chrome-search-toggle\"][aria-controls=\"${CSS.escape(dialog.id)}\"]`,\n )\n trigger?.setAttribute('aria-expanded', 'false')\n trigger?.focus()\n },\n true,\n )\n}\n\nconst focusable = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ')\n\nconst activeRouteModal = (): HTMLElement | null =>\n document.querySelector<HTMLElement>('[data-ui=\"modal-layer\"][data-route-modal=\"true\"]')\n\nconst modalFocusables = (modal: HTMLElement): HTMLElement[] =>\n [...modal.querySelectorAll<HTMLElement>(focusable)].filter(\n (item) =>\n !item.hidden &&\n item.getAttribute('aria-hidden') !== 'true' &&\n !item.matches('[data-ui=\"modal-backdrop\"]'),\n )\n\nconst navigateTo = (href: string): void => {\n if (browserGlobals.__ketNavigation?.navigate) void browserGlobals.__ketNavigation.navigate(href)\n else browserGlobals.location.assign(href)\n}\n\nconst eventStartedInNestedModal = (event: KeyboardEvent, routeModal: HTMLElement): boolean =>\n event\n .composedPath()\n .some(\n (target) =>\n target instanceof HTMLElement &&\n target !== routeModal &&\n target.matches('[data-ui=\"modal-layer\"][data-presentation=\"dialog\"]'),\n )\n\n/**\n * Whether anything in the modal has been typed into since the server rendered it.\n *\n * Comparing each control against its own default is what makes this work without\n * any bookkeeping: the page is server-rendered, so the default *is* the state the\n * reader was given. A modal with no form \u2014 a reader, an inspector \u2014 has nothing\n * to compare and is never dirty, so the guard costs those screens nothing.\n */\nconst modalHasDraft = (modal: HTMLElement): boolean => {\n for (const field of modal.querySelectorAll<HTMLInputElement>('input:not([type=\"hidden\"])')) {\n if (field.disabled) continue\n if (field.type === 'checkbox' || field.type === 'radio') {\n if (field.checked !== field.defaultChecked) return true\n } else if (field.value !== field.defaultValue) return true\n }\n for (const area of modal.querySelectorAll<HTMLTextAreaElement>('textarea'))\n if (!area.disabled && area.value !== area.defaultValue) return true\n for (const select of modal.querySelectorAll<HTMLSelectElement>('select')) {\n if (select.disabled) continue\n for (const option of select.options) if (option.selected !== option.defaultSelected) return true\n }\n return false\n}\n\n/**\n * The guard, and what it is not.\n *\n * Closing a modal is a link, and a link still works with scripting off \u2014 that is\n * the point of building it as one. So this catches the stray backdrop click and\n * the reflexive Escape; it is not a lock, and nothing here should be read as one.\n * The wording comes from the server because this file cannot translate.\n */\nconst mayLeaveModal = (modal: HTMLElement): boolean => {\n if (!modalHasDraft(modal)) return true\n const message = modal.getAttribute('data-unsaved-prompt')\n // No prompt declared means the screen did not ask to be guarded.\n if (!message) return true\n return browserGlobals.confirm(message)\n}\n\n/** Progressive keyboard behavior for URL-owned create/edit workspaces. */\nconst installRouteModal = (): void => {\n if (browserGlobals[routeModalMarker]) return\n browserGlobals[routeModalMarker] = true\n const focused = new WeakSet<HTMLElement>()\n const focusModal = (): void => {\n const modal = activeRouteModal()\n if (!modal || focused.has(modal)) return\n focused.add(modal)\n requestAnimationFrame(() => {\n const sheet = modal.querySelector<HTMLElement>('[data-ui=\"modal-sheet\"]')\n const target = modalFocusables(modal).find((item) => !item.matches('[data-ui=\"modal-close\"]'))\n ;(target ?? sheet)?.focus()\n })\n }\n focusModal()\n new MutationObserver(focusModal).observe(document.body, { childList: true, subtree: true })\n\n // The backdrop and the X are ordinary links, so the guard has to run before\n // the navigation layer sees the click rather than inside it.\n document.addEventListener(\n 'click',\n (event) => {\n const modal = activeRouteModal()\n if (!modal) return\n const leaving = event\n .composedPath()\n .find(\n (target) =>\n target instanceof HTMLElement &&\n target.matches('[data-ui=\"modal-close\"], [data-ui=\"modal-backdrop\"]'),\n )\n if (!leaving || !modal.contains(leaving as HTMLElement)) return\n if (!mayLeaveModal(modal)) {\n event.preventDefault()\n event.stopPropagation()\n }\n },\n true,\n )\n\n document.addEventListener('keydown', (event) => {\n const modal = activeRouteModal()\n if (!modal) return\n // Relation-select removes its dialog synchronously on Escape. The event's\n // composed path is stable even after that DOM subtree disappears, so the\n // route layer must use it instead of querying the now-removed target.\n if (eventStartedInNestedModal(event, modal)) return\n if (event.key === 'Escape') {\n const close = modal.querySelector<HTMLAnchorElement>('[data-ui=\"modal-close\"]')\n if (!close) return\n event.preventDefault()\n if (!mayLeaveModal(modal)) return\n navigateTo(close.getAttribute('href') ?? close.href)\n return\n }\n if (event.key !== 'Tab') return\n const items = modalFocusables(modal)\n if (!items.length) return\n const first = items[0]\n const last = items.at(-1)!\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault()\n first.focus()\n }\n })\n}\n\nexport const createTableSelectionView = (): IslandController => ({\n view: () => <span data-ui=\"table-selection-runtime\" hidden />,\n})\n\nexport const tableSelection = (_props: IslandProps): IslandController => {\n installTableSelection()\n installDropdownDismiss()\n installGlobalFilter()\n installRouteModal()\n return createTableSelectionView()\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
6
|
-
"names": ["jsx", "tableSelectionMarker", "dropdownDismissMarker", "globalFilterMarker", "routeModalMarker", "dismissibleDropdown", "browserGlobals", "eventElement", "event", "updateSelection", "table", "rows", "checked", "input", "all", "shell", "menu", "installTableSelection", "target", "href", "openDropdowns", "installDropdownDismiss", "current", "dropdown", "dropdowns", "focused", "installGlobalFilter", "trigger", "controls", "dialog", "focusable", "activeRouteModal", "modalFocusables", "modal", "item", "navigateTo", "eventStartedInNestedModal", "routeModal", "modalHasDraft", "field", "area", "select", "option", "mayLeaveModal", "message", "installRouteModal", "focusModal", "sheet", "leaving", "
|
|
4
|
+
"sourcesContent": ["import type { IslandController, IslandProps } from '@ketvietlab/ketjs-view'\n\nconst tableSelectionMarker = Symbol.for('ket.backend.table-selection')\nconst dropdownDismissMarker = Symbol.for('ket.backend.dropdown-dismiss')\nconst globalFilterMarker = Symbol.for('ket.backend.global-filter')\nconst routeModalMarker = Symbol.for('ket.backend.route-modal')\nconst liveRegionMarker = Symbol.for('ket.backend.live-region')\nconst dismissibleDropdown = [\n '[data-ui=\"search-menu\"]',\n '[data-ui=\"col-config\"]',\n '[data-ui=\"bulk-actions\"]',\n '[data-ui=\"viewer\"]',\n '[data-ui=\"record-more\"]',\n].join(', ')\n\ntype KetBrowserGlobals = typeof globalThis & {\n [key: symbol]: unknown\n __ketNavigation?: { navigate?: (href: string) => unknown }\n confirm: (message?: string) => boolean\n}\n\nconst browserGlobals = globalThis as KetBrowserGlobals\nconst eventElement = (event: Event): Element | null => (event.target instanceof Element ? event.target : null)\n\nconst updateSelection = (table: Element): void => {\n const rows = [...table.querySelectorAll<HTMLInputElement>('[data-ui=\"row-select\"]:not(:disabled)')]\n const checked = rows.filter((input) => input.checked).length\n const all = table.querySelector<HTMLInputElement>('[data-ui=\"select-all\"]')\n if (all) {\n all.checked = rows.length > 0 && checked === rows.length\n all.indeterminate = checked > 0 && checked < rows.length\n }\n if (!checked) {\n const shell = table.closest('[data-ui=\"shell\"]')\n for (const menu of shell?.querySelectorAll<HTMLDetailsElement>('[data-ui=\"bulk-actions\"][open]') ?? [])\n menu.removeAttribute('open')\n }\n}\n\nconst installTableSelection = (): void => {\n if (browserGlobals[tableSelectionMarker]) return\n browserGlobals[tableSelectionMarker] = true\n\n document.addEventListener('change', (event) => {\n const target = eventElement(event)\n if (!(target instanceof HTMLInputElement)) return\n if (!target.matches('[data-ui=\"select-all\"], [data-ui=\"row-select\"]')) return\n const table = target.closest('[data-ui=\"table\"]')\n if (!table) return\n if (target.matches('[data-ui=\"select-all\"]'))\n for (const input of table.querySelectorAll<HTMLInputElement>('[data-ui=\"row-select\"]:not(:disabled)'))\n input.checked = target.checked\n updateSelection(table)\n })\n\n document.addEventListener('click', (event) => {\n if (\n event.defaultPrevented ||\n event.button !== 0 ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey\n )\n return\n const target = eventElement(event)\n if (\n target?.closest('a, button, input, select, textarea, label, summary, details, [data-ui=\"select-cell\"]')\n )\n return\n const row = target?.closest<HTMLElement>('[data-ui=\"row\"][data-row-href]')\n const href = row?.getAttribute('data-row-href')\n if (!href) return\n event.preventDefault()\n if (browserGlobals.__ketNavigation?.navigate) void browserGlobals.__ketNavigation.navigate(href)\n else browserGlobals.location.assign(href)\n })\n}\n\nconst openDropdowns = (): HTMLDetailsElement[] => [\n ...document.querySelectorAll<HTMLDetailsElement>(`${dismissibleDropdown}[open]`),\n]\n\nconst installDropdownDismiss = (): void => {\n if (browserGlobals[dropdownDismissMarker]) return\n browserGlobals[dropdownDismissMarker] = true\n\n document.addEventListener('click', (event) => {\n const current = eventElement(event)?.closest(dismissibleDropdown)\n for (const dropdown of openDropdowns()) {\n if (dropdown !== current && !dropdown.contains(current ?? null)) dropdown.removeAttribute('open')\n }\n })\n\n document.addEventListener('keydown', (event) => {\n if (event.key !== 'Escape') return\n const dropdowns = openDropdowns()\n if (!dropdowns.length) return\n const focused = document.activeElement?.closest<HTMLDetailsElement>(dismissibleDropdown)\n const current = focused?.open ? focused : dropdowns.at(-1)\n current?.removeAttribute('open')\n current?.querySelector<HTMLElement>('summary')?.focus()\n event.preventDefault()\n })\n}\n\nconst installGlobalFilter = (): void => {\n if (browserGlobals[globalFilterMarker]) return\n browserGlobals[globalFilterMarker] = true\n\n document.addEventListener('click', (event) => {\n const trigger = eventElement(event)?.closest<HTMLElement>('[data-ui=\"chrome-search-toggle\"]')\n const controls = trigger?.getAttribute('aria-controls')\n if (!trigger || !controls) return\n const dialog = document.getElementById(controls)\n if (!(dialog instanceof HTMLDialogElement) || dialog.open) return\n dialog.showModal()\n trigger.setAttribute('aria-expanded', 'true')\n requestAnimationFrame(() =>\n dialog\n .querySelector<HTMLElement>('[data-presentation=\"modal\"] [data-ui=\"chrome-search-input\"]')\n ?.focus(),\n )\n })\n\n document.addEventListener(\n 'cancel',\n (event) => {\n if (!eventElement(event)?.matches('[data-ui=\"chrome-search-modal\"]')) return\n event.preventDefault()\n },\n true,\n )\n\n document.addEventListener(\n 'close',\n (event) => {\n const dialog = eventElement(event)\n if (!(dialog instanceof HTMLDialogElement)) return\n if (!dialog.matches('[data-ui=\"chrome-search-modal\"]')) return\n const trigger = document.querySelector<HTMLElement>(\n `[data-ui=\"chrome-search-toggle\"][aria-controls=\"${CSS.escape(dialog.id)}\"]`,\n )\n trigger?.setAttribute('aria-expanded', 'false')\n trigger?.focus()\n },\n true,\n )\n}\n\nconst focusable = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(', ')\n\nconst activeRouteModal = (): HTMLElement | null =>\n document.querySelector<HTMLElement>('[data-ui=\"modal-layer\"][data-route-modal=\"true\"]')\n\nconst modalFocusables = (modal: HTMLElement): HTMLElement[] =>\n [...modal.querySelectorAll<HTMLElement>(focusable)].filter(\n (item) =>\n !item.hidden &&\n item.getAttribute('aria-hidden') !== 'true' &&\n !item.matches('[data-ui=\"modal-backdrop\"]'),\n )\n\nconst navigateTo = (href: string): void => {\n if (browserGlobals.__ketNavigation?.navigate) void browserGlobals.__ketNavigation.navigate(href)\n else browserGlobals.location.assign(href)\n}\n\nconst eventStartedInNestedModal = (event: KeyboardEvent, routeModal: HTMLElement): boolean =>\n event\n .composedPath()\n .some(\n (target) =>\n target instanceof HTMLElement &&\n target !== routeModal &&\n target.matches('[data-ui=\"modal-layer\"][data-presentation=\"dialog\"]'),\n )\n\n/**\n * Whether anything in the modal has been typed into since the server rendered it.\n *\n * Comparing each control against its own default is what makes this work without\n * any bookkeeping: the page is server-rendered, so the default *is* the state the\n * reader was given. A modal with no form \u2014 a reader, an inspector \u2014 has nothing\n * to compare and is never dirty, so the guard costs those screens nothing.\n */\nconst modalHasDraft = (modal: HTMLElement): boolean => {\n for (const field of modal.querySelectorAll<HTMLInputElement>('input:not([type=\"hidden\"])')) {\n if (field.disabled) continue\n if (field.type === 'checkbox' || field.type === 'radio') {\n if (field.checked !== field.defaultChecked) return true\n } else if (field.value !== field.defaultValue) return true\n }\n for (const area of modal.querySelectorAll<HTMLTextAreaElement>('textarea'))\n if (!area.disabled && area.value !== area.defaultValue) return true\n for (const select of modal.querySelectorAll<HTMLSelectElement>('select')) {\n if (select.disabled) continue\n for (const option of select.options) if (option.selected !== option.defaultSelected) return true\n }\n return false\n}\n\n/**\n * The guard, and what it is not.\n *\n * Leaving a modal is a link, and a link still works with scripting off \u2014 that is\n * the point of building it as one. So this catches the stray backdrop click, the\n * reflexive Escape and the tab clicked without thinking about the note already\n * typed; it is not a lock, and nothing here should be read as one. The wording\n * comes from the server because this file cannot translate.\n */\nconst mayLeaveModal = (modal: HTMLElement): boolean => {\n if (!modalHasDraft(modal)) return true\n const message = modal.getAttribute('data-unsaved-prompt')\n // No prompt declared means the screen did not ask to be guarded.\n if (!message) return true\n return browserGlobals.confirm(message)\n}\n\n/** Progressive keyboard behavior for URL-owned create/edit workspaces. */\n/**\n * Hear when the thing a screen is waiting for actually changed.\n *\n * The screens this replaces reloaded the whole document on a timer, which threw\n * away scroll, focus and anything typed, on a schedule unrelated to when the\n * work finished. Here the server says so, and the page asks for the fragment it\n * already knows how to swap \u2014 so the reader keeps their place.\n *\n * The connection belongs to the element. A fragment swap replaces it, and the\n * observer opens the new one and closes the old; a screen with nothing to wait\n * for renders no element and opens nothing.\n */\nconst installLiveRegion = (): void => {\n if (browserGlobals[liveRegionMarker]) return\n browserGlobals[liveRegionMarker] = true\n if (typeof EventSource !== 'function') return\n\n let watched: Element | null = null\n let source: EventSource | null = null\n const close = () => {\n source?.close()\n source = null\n watched = null\n }\n\n const sync = (): void => {\n const region = document.querySelector('[data-ui=\"live-region\"][data-stream]')\n if (region === watched) return\n close()\n const id = region instanceof HTMLElement ? (region.dataset.stream ?? '') : ''\n if (!id) return\n watched = region\n source = new EventSource(`/_ket/stream/${encodeURIComponent(id)}`)\n // What the chunk says is the deployment's business. That something was said\n // is the whole signal: the screen is server-rendered, so the way to find out\n // what changed is to ask for it.\n const refresh = () => navigateTo(location.href)\n source.onmessage = refresh\n source.addEventListener('done', () => {\n close()\n refresh()\n })\n // EventSource reconnects on its own, and a stream that has ended answers 404\n // rather than reopening. Leaving the error alone would retry that forever.\n source.onerror = () => {\n if (source?.readyState === EventSource.CLOSED) close()\n }\n }\n\n sync()\n new MutationObserver(sync).observe(document.body, { childList: true, subtree: true })\n addEventListener('pagehide', close)\n}\n\nconst installRouteModal = (): void => {\n if (browserGlobals[routeModalMarker]) return\n browserGlobals[routeModalMarker] = true\n const focused = new WeakSet<HTMLElement>()\n const focusModal = (): void => {\n const modal = activeRouteModal()\n if (!modal || focused.has(modal)) return\n focused.add(modal)\n requestAnimationFrame(() => {\n const sheet = modal.querySelector<HTMLElement>('[data-ui=\"modal-sheet\"]')\n const target = modalFocusables(modal).find((item) => !item.matches('[data-ui=\"modal-close\"]'))\n ;(target ?? sheet)?.focus()\n })\n }\n focusModal()\n new MutationObserver(focusModal).observe(document.body, { childList: true, subtree: true })\n\n // The backdrop and the X are ordinary links, so the guard has to run before\n // the navigation layer sees the click rather than inside it.\n document.addEventListener(\n 'click',\n (event) => {\n const modal = activeRouteModal()\n if (!modal) return\n // A tab inside a modal is a third way out of it. It looks like a control\n // that stays on the screen, which is exactly why losing a half-written\n // note to one went unnoticed: the reader never meant to leave. It is a\n // link like the other two, and it leaves the same way.\n const leaving = event\n .composedPath()\n .find(\n (target) =>\n target instanceof HTMLElement &&\n target.matches('[data-ui=\"modal-close\"], [data-ui=\"modal-backdrop\"], a[data-ui=\"tab\"]'),\n )\n if (!leaving || !modal.contains(leaving as HTMLElement)) return\n if (!mayLeaveModal(modal)) {\n event.preventDefault()\n event.stopPropagation()\n }\n },\n true,\n )\n\n document.addEventListener('keydown', (event) => {\n const modal = activeRouteModal()\n if (!modal) return\n // Relation-select removes its dialog synchronously on Escape. The event's\n // composed path is stable even after that DOM subtree disappears, so the\n // route layer must use it instead of querying the now-removed target.\n if (eventStartedInNestedModal(event, modal)) return\n if (event.key === 'Escape') {\n const close = modal.querySelector<HTMLAnchorElement>('[data-ui=\"modal-close\"]')\n if (!close) return\n event.preventDefault()\n if (!mayLeaveModal(modal)) return\n navigateTo(close.getAttribute('href') ?? close.href)\n return\n }\n if (event.key !== 'Tab') return\n const items = modalFocusables(modal)\n if (!items.length) return\n const first = items[0]\n const last = items.at(-1)!\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault()\n last.focus()\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault()\n first.focus()\n }\n })\n}\n\nexport const createTableSelectionView = (): IslandController => ({\n view: () => <span data-ui=\"table-selection-runtime\" hidden />,\n})\n\nexport const tableSelection = (_props: IslandProps): IslandController => {\n installTableSelection()\n installDropdownDismiss()\n installGlobalFilter()\n installRouteModal()\n installLiveRegion()\n return createTableSelectionView()\n}\n"],
|
|
5
|
+
"mappings": ";AAoWc,cAAAA,MAAA,4BAlWd,IAAMC,EAAuB,OAAO,IAAI,6BAA6B,EAC/DC,EAA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M,IAAI,EACnD,MACF,CACA,GAAIxC,EAAM,MAAQ,MAAO,OACzB,IAAMiD,EAAQzB,EAAgBC,CAAK,EACnC,GAAI,CAACwB,EAAM,OAAQ,OACnB,IAAMC,EAAQD,EAAM,CAAC,EACfE,EAAOF,EAAM,GAAG,EAAE,EACpBjD,EAAM,UAAY,SAAS,gBAAkBkD,GAC/ClD,EAAM,eAAe,EACrBmD,EAAK,MAAM,GACF,CAACnD,EAAM,UAAY,SAAS,gBAAkBmD,IACvDnD,EAAM,eAAe,EACrBkD,EAAM,MAAM,EAEhB,CAAC,CACH,EAEaE,EAA2B,KAAyB,CAC/D,KAAM,IAAM7D,EAAC,QAAK,UAAQ,0BAA0B,OAAM,GAAC,CAC7D,GAEa8D,EAAkBC,IAC7B7C,EAAsB,EACtBI,EAAuB,EACvBK,EAAoB,EACpB2B,EAAkB,EAClBR,EAAkB,EACXe,EAAyB",
|
|
6
|
+
"names": ["jsx", "tableSelectionMarker", "dropdownDismissMarker", "globalFilterMarker", "routeModalMarker", "liveRegionMarker", "dismissibleDropdown", "browserGlobals", "eventElement", "event", "updateSelection", "table", "rows", "checked", "input", "all", "shell", "menu", "installTableSelection", "target", "href", "openDropdowns", "installDropdownDismiss", "current", "dropdown", "dropdowns", "focused", "installGlobalFilter", "trigger", "controls", "dialog", "focusable", "activeRouteModal", "modalFocusables", "modal", "item", "navigateTo", "eventStartedInNestedModal", "routeModal", "modalHasDraft", "field", "area", "select", "option", "mayLeaveModal", "message", "installLiveRegion", "watched", "source", "close", "sync", "region", "id", "refresh", "installRouteModal", "focusModal", "sheet", "leaving", "items", "first", "last", "createTableSelectionView", "tableSelection", "_props"]
|
|
7
7
|
}
|
|
@@ -545,6 +545,26 @@
|
|
|
545
545
|
font-size: 0.8125rem;
|
|
546
546
|
font-weight: 600;
|
|
547
547
|
}
|
|
548
|
+
/* A line that says work is still going on. It reads as status rather than as
|
|
549
|
+
content, and it stays put — the whole point is that the page underneath it
|
|
550
|
+
is no longer being thrown away and rebuilt. */
|
|
551
|
+
[data-ui="live-region"] {
|
|
552
|
+
display: flex;
|
|
553
|
+
align-items: center;
|
|
554
|
+
gap: var(--admin-gap-xs);
|
|
555
|
+
margin: 0;
|
|
556
|
+
color: var(--admin-ink-secondary);
|
|
557
|
+
font-size: 0.8125rem;
|
|
558
|
+
font-weight: 600;
|
|
559
|
+
}
|
|
560
|
+
[data-ui="live-region"]::before {
|
|
561
|
+
inline-size: 0.5rem;
|
|
562
|
+
block-size: 0.5rem;
|
|
563
|
+
flex: 0 0 auto;
|
|
564
|
+
border-radius: 50%;
|
|
565
|
+
background: var(--admin-accent);
|
|
566
|
+
content: "";
|
|
567
|
+
}
|
|
548
568
|
[data-ui="skeleton"] {
|
|
549
569
|
display: grid;
|
|
550
570
|
gap: var(--admin-gap-sm);
|
|
@@ -706,15 +726,38 @@
|
|
|
706
726
|
[data-ui="sidebar-header"] {
|
|
707
727
|
padding: 0;
|
|
708
728
|
}
|
|
729
|
+
/* The grid above reserves `minmax(8rem, 1fr)` for this. It was reserving that
|
|
730
|
+
column for an element `responsive.css` had hidden, so the row carried a
|
|
731
|
+
gap where the only other way out of a screen should have been. */
|
|
709
732
|
[data-ui="sidebar-search"] {
|
|
733
|
+
display: flex;
|
|
710
734
|
margin: 0;
|
|
711
735
|
}
|
|
736
|
+
/* The one definition of the mobile menu strip. `responsive.css` used to hide
|
|
737
|
+
it at this same breakpoint, in this same layer, at this same specificity —
|
|
738
|
+
so which rule won was decided by the order of the `styles` array and
|
|
739
|
+
nothing else. Swapping two lines in that array made the mobile menu
|
|
740
|
+
disappear entirely. */
|
|
712
741
|
[data-ui="sidebar-nav"] {
|
|
713
742
|
display: block;
|
|
714
743
|
grid-column: 1 / -1;
|
|
715
744
|
padding: 0;
|
|
716
745
|
overflow-x: auto;
|
|
717
746
|
overflow-y: hidden;
|
|
747
|
+
/* The desktop sidebar hides its scrollbar because it scrolls vertically
|
|
748
|
+
in a tall column where the cut edge is obvious. Lying on its side this
|
|
749
|
+
strip hides most of itself — two thirds of it on a phone — and without
|
|
750
|
+
a scrollbar there is nothing at all to say the rest exists. */
|
|
751
|
+
scrollbar-width: thin;
|
|
752
|
+
overscroll-behavior-inline: contain;
|
|
753
|
+
/* A second, quieter signal for the platforms that draw the scrollbar only
|
|
754
|
+
while it moves: the strip fades where it continues. */
|
|
755
|
+
mask-image: linear-gradient(to right, #000 calc(100% - 1.5rem), transparent);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
[data-ui="sidebar-nav"]::-webkit-scrollbar {
|
|
759
|
+
display: block;
|
|
760
|
+
block-size: 0.25rem;
|
|
718
761
|
}
|
|
719
762
|
[data-ui="sidebar-section-label"],
|
|
720
763
|
[data-ui="app-list"],
|
|
@@ -376,6 +376,28 @@
|
|
|
376
376
|
overflow: hidden;
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
/*
|
|
380
|
+
* A dialog that asked to be large is a workbench, not a form.
|
|
381
|
+
*
|
|
382
|
+
* Two things were wrong with it. `data-size` had no say at all, because
|
|
383
|
+
* `[data-presentation="dialog"] [data-ui="modal-sheet"]` matches with one
|
|
384
|
+
* more attribute than `[data-ui="modal-sheet"][data-size="large"]`, so every
|
|
385
|
+
* screen that asked for both got the width of a form. And the sheet was
|
|
386
|
+
* sized to its content, so a workbench with tabs was a different dialog on
|
|
387
|
+
* each tab — growing, shrinking and shifting under the cursor on every
|
|
388
|
+
* switch, which is the one thing a row of tabs exists to promise it will not
|
|
389
|
+
* do.
|
|
390
|
+
*
|
|
391
|
+
* It takes a fixed frame now. The height is the tall one a workbench wants
|
|
392
|
+
* until the screen cannot give it, and then it is the screen less a margin,
|
|
393
|
+
* so the dialog never runs off the top and bottom. The body scrolls inside
|
|
394
|
+
* it, which the sheet's own grid rows were already written for.
|
|
395
|
+
*/
|
|
396
|
+
[data-ui="modal-layer"][data-presentation="dialog"] [data-ui="modal-sheet"][data-size="large"] {
|
|
397
|
+
inline-size: min(1200px, 100%);
|
|
398
|
+
block-size: min(1000px, calc(100dvh - 100px));
|
|
399
|
+
}
|
|
400
|
+
|
|
379
401
|
/* URL-addressable modal workspace. The backdrop is a real close link and
|
|
380
402
|
the sheet owns its scroll, so the document never grows horizontally. */
|
|
381
403
|
[data-ui="modal-layer"] {
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
import type { Route } from '@ketvietlab/ketjs';
|
|
1
|
+
import type { Route, Translator } from '@ketvietlab/ketjs';
|
|
2
|
+
import type { FormSchema, FormValues } from '@ketvietlab/ketjs-view';
|
|
2
3
|
type Req = Parameters<Route>[1];
|
|
3
4
|
export declare const readForm: (req: Req) => Promise<Record<string, string>>;
|
|
4
5
|
export declare const seeOther: (path: string) => import("@ketvietlab/ketjs").RouteResult;
|
|
5
6
|
export declare const errorsOf: (result: unknown) => string[];
|
|
7
|
+
/**
|
|
8
|
+
* What a route holds after a submit it turned down.
|
|
9
|
+
*
|
|
10
|
+
* Three things have to agree, and until now every route that tried wrote all
|
|
11
|
+
* three out by hand: the dialog stays open, what was typed comes back, and each
|
|
12
|
+
* complaint lands on the control that caused it. The usual `errors.length` test
|
|
13
|
+
* gets the first one wrong the moment every complaint is a field mark, because
|
|
14
|
+
* then there is no form-level sentence to count.
|
|
15
|
+
*
|
|
16
|
+
* The words come from `backend.validation.*`. A schema names a message key for
|
|
17
|
+
* each code it can raise, so the sentences belong to whoever ships the codes,
|
|
18
|
+
* not to each module that adopts a schema.
|
|
19
|
+
*/
|
|
20
|
+
export type FormRefusal = {
|
|
21
|
+
/**
|
|
22
|
+
* Check a submit against its shape rules. Returns the normalized values when
|
|
23
|
+
* they pass and null when they do not, keeping the marks for the render.
|
|
24
|
+
*
|
|
25
|
+
* Not every submit is an edit. A row's own archive or restore control posts
|
|
26
|
+
* its identity and nothing else, so it has no form to satisfy — do not put it
|
|
27
|
+
* through here, or it is refused for fields it never carried.
|
|
28
|
+
*
|
|
29
|
+
* Refusals accumulate, so a screen holding more than one form does not lose
|
|
30
|
+
* the first one's marks to the second one passing.
|
|
31
|
+
*/
|
|
32
|
+
check<TValues extends FormValues>(schema: FormSchema<TValues>, form: Readonly<FormValues>): TValues | null;
|
|
33
|
+
/** Record a refusal the shape rules did not raise — a command that said no. */
|
|
34
|
+
add(sentences: readonly string[]): void;
|
|
35
|
+
/** Whether this submit was turned down, by a form-level sentence or a field mark. */
|
|
36
|
+
refused(): boolean;
|
|
37
|
+
/** The complaint about one control, as a sentence, or null when it is fine. */
|
|
38
|
+
error(field: string): string | null;
|
|
39
|
+
/** The complaints that concern the whole form rather than one of its controls. */
|
|
40
|
+
sentences(): string[];
|
|
41
|
+
};
|
|
42
|
+
export declare const formRefusal: (t: Translator) => FormRefusal;
|
|
6
43
|
export {};
|
|
7
44
|
//# sourceMappingURL=forms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/forms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/forms.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAmB,MAAM,wBAAwB,CAAA;AAErF,KAAK,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAE/B,eAAO,MAAM,QAAQ,QAAe,GAAG,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAavE,CAAA;AAED,eAAO,MAAM,QAAQ,SAAU,MAAM,4CAA+D,CAAA;AAEpG,eAAO,MAAM,QAAQ,WAAY,OAAO,KAAG,MAAM,EAGhD,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,OAAO,SAAS,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,IAAI,CAAA;IAC1G,+EAA+E;IAC/E,GAAG,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAA;IACvC,qFAAqF;IACrF,OAAO,IAAI,OAAO,CAAA;IAClB,+EAA+E;IAC/E,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IACnC,kFAAkF;IAClF,SAAS,IAAI,MAAM,EAAE,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,WAAW,MAAO,UAAU,KAAG,WA0B3C,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { text, withHeaders } from '@ketvietlab/ketjs';
|
|
2
|
+
import { validateForm } from '@ketvietlab/ketjs-view';
|
|
2
3
|
export const readForm = async (req) => {
|
|
3
4
|
const chunks = [];
|
|
4
5
|
for await (const chunk of req)
|
|
@@ -22,4 +23,32 @@ export const errorsOf = (result) => {
|
|
|
22
23
|
const errors = result?.errors ?? [];
|
|
23
24
|
return errors.map((error) => `${error.field ? `${error.field}: ` : ''}${error.message ?? 'invalid value'}`);
|
|
24
25
|
};
|
|
26
|
+
export const formRefusal = (t) => {
|
|
27
|
+
let issues = [];
|
|
28
|
+
let said = [];
|
|
29
|
+
// An unknown key would render as itself, which is worse on screen than the
|
|
30
|
+
// code: at least the code is something to search for.
|
|
31
|
+
const say = (issue) => {
|
|
32
|
+
const key = `backend.${issue.messageKey}`;
|
|
33
|
+
return t.resolves(key) ? t(key, issue.params) : issue.code;
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
check(schema, form) {
|
|
37
|
+
const checked = validateForm(schema, form);
|
|
38
|
+
if (checked.valid)
|
|
39
|
+
return checked.values;
|
|
40
|
+
issues = checked.issues;
|
|
41
|
+
return null;
|
|
42
|
+
},
|
|
43
|
+
add(sentences) {
|
|
44
|
+
said = [...said, ...sentences];
|
|
45
|
+
},
|
|
46
|
+
refused: () => issues.length > 0 || said.length > 0,
|
|
47
|
+
error: (field) => {
|
|
48
|
+
const held = issues.find((issue) => issue.field === field);
|
|
49
|
+
return held ? say(held) : null;
|
|
50
|
+
},
|
|
51
|
+
sentences: () => [...issues.filter((issue) => issue.field === null).map(say), ...said],
|
|
52
|
+
};
|
|
53
|
+
};
|
|
25
54
|
//# sourceMappingURL=forms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAMrD,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,EAAE,GAAQ,EAAmC,EAAE;IAC1E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG;QAAE,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAA;IAC3D,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAClD,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAA;IACnB,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAA;IACtD,IAAI,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC;QAAE,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,eAA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, ScreenOptions } from './screen.ts';
|
|
18
18
|
export { relationControl, relationLabels } from './relation-select.ts';
|
|
19
19
|
export type { RelationEditorField, RelationManager, RelationOption, RelationSelectConfig, RelationSelectLabels, } from './relation-select.ts';
|
|
20
|
-
export { readForm, seeOther } from './forms.ts';
|
|
20
|
+
export { formRefusal, readForm, seeOther } from './forms.ts';
|
|
21
|
+
export type { FormRefusal } from './forms.ts';
|
|
21
22
|
/**
|
|
22
23
|
* The kit, re-exported.
|
|
23
24
|
*
|
|
@@ -26,6 +27,6 @@ export { readForm, seeOther } from './forms.ts';
|
|
|
26
27
|
* working and so `import backend, { badge } from '@ketvietlab/ketsuite/backend'` still reads
|
|
27
28
|
* naturally on a backend screen.
|
|
28
29
|
*/
|
|
29
|
-
export { backendPage, shell, formatDateTime, formatMoney, Framed, ListScreen, RecordScreen, WorkspaceScreen, listChrome, timeframeFilter, topbarSearch, emptyState, errorState, dataTable, visibleColumns, badge, avatar, thumbnail, person, initials, icon, hasIcon, definitionList, progressBar, gantt, chart, barChart, delta, changeOf, axisCeiling, code, qrCode, inline, button, linkButton, iconButton, actionGroup, tag, countBadge, notice, loadingState, loginScreen, stack, columns, section, surface, cardGrid, contentCard, metric, docTree, kanbanCard, kanbanGrid, deadline, recordList, recordWorkspace, recordToggle, readonlyField, readonlyTextarea, recordFieldGrid, recordRail, recordHeaderActions, breadcrumbs, pageContext, tabs, mediaPanel, attachmentPanel, modalForm, modalSheet, recordForm, formCluster, recordActions, datePicker, scheduleBoard, HOOKS, OWNERS, mailContractCases, activityContractCases, calendarContractCases, } from '../../ui/index.ts';
|
|
30
|
+
export { backendPage, shell, formatDateTime, formatMoney, Framed, ListScreen, RecordScreen, WorkspaceScreen, listChrome, timeframeFilter, topbarSearch, emptyState, liveRegion, errorState, dataTable, visibleColumns, badge, avatar, thumbnail, person, initials, icon, hasIcon, definitionList, progressBar, gantt, chart, barChart, delta, changeOf, axisCeiling, code, qrCode, inline, button, linkButton, iconButton, actionGroup, tag, countBadge, notice, loadingState, loginScreen, stack, columns, section, surface, cardGrid, contentCard, metric, docTree, kanbanCard, kanbanGrid, deadline, recordList, recordWorkspace, recordToggle, readonlyField, readonlyTextarea, recordFieldGrid, recordRail, recordHeaderActions, breadcrumbs, pageContext, tabs, mediaPanel, attachmentPanel, modalForm, modalSheet, recordForm, formCluster, recordActions, datePicker, scheduleBoard, HOOKS, OWNERS, mailContractCases, activityContractCases, calendarContractCases, } from '../../ui/index.ts';
|
|
30
31
|
export type { Cell, ChartBar, ChartKey, Column, DataTable, TableGroup, Tone, Frame, Extras, Facet, ListChrome, Pager, ViewKind, SearchMenu, SearchMenuItem, TailMenu, Indicator, Viewer, ActionVariant, ActionSize, ButtonSpec, LinkButtonSpec, NoticeTone, Breadcrumb, Tab, MediaItem, MediaLabels, RecordFormOptions, MediaPanelProps, FormField, FormOption, DatePickerField, DatePickerOptions, ScheduleDay, ScheduleEvent, ScheduleRow, ScheduleTone, RecordSummaryItem, RecordWorkspaceSlots, RecordRailFact, RecordRailSwitch, RecordRailActivity, } from '../../ui/index.ts';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/index.ts"],"names":[],"mappings":";;AAwDA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC;;;;GAIG;AACH,OAAO,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACtE,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/index.ts"],"names":[],"mappings":";;AAwDA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACxD,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC;;;;GAIG;AACH,OAAO,EACL,SAA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AAe,EACf,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,WAAW,EACX,IAAI,EACJ,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,KAAK,EACL,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EACV,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,UAAU,EACV,IAAI,EACJ,KAAK,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,KAAK,EACL,QAAQ,EACR,UAAU,EACV,cAAc,EACd,QAAQ,EACR,SAAS,EACT,MAAM,EACN,aAAa,EACb,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,UAAU,EACV,GAAG,EACH,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,mBAAmB,CAAA"}
|
|
@@ -65,7 +65,7 @@ export { routes } from './routes.js';
|
|
|
65
65
|
*/
|
|
66
66
|
export { adminPage, choices, frameOf, inLocale, localeQuery, localized, optional, resultErrors, screen, selectionLabel, selectionOptions, timezoneOf, viewerOf, } from './screen.js';
|
|
67
67
|
export { relationControl, relationLabels } from './relation-select.js';
|
|
68
|
-
export { readForm, seeOther } from './forms.js';
|
|
68
|
+
export { formRefusal, readForm, seeOther } from './forms.js';
|
|
69
69
|
/**
|
|
70
70
|
* The kit, re-exported.
|
|
71
71
|
*
|
|
@@ -74,5 +74,5 @@ export { readForm, seeOther } from './forms.js';
|
|
|
74
74
|
* working and so `import backend, { badge } from '@ketvietlab/ketsuite/backend'` still reads
|
|
75
75
|
* naturally on a backend screen.
|
|
76
76
|
*/
|
|
77
|
-
export { backendPage, shell, formatDateTime, formatMoney, Framed, ListScreen, RecordScreen, WorkspaceScreen, listChrome, timeframeFilter, topbarSearch, emptyState, errorState, dataTable, visibleColumns, badge, avatar, thumbnail, person, initials, icon, hasIcon, definitionList, progressBar, gantt, chart, barChart, delta, changeOf, axisCeiling, code, qrCode, inline, button, linkButton, iconButton, actionGroup, tag, countBadge, notice, loadingState, loginScreen, stack, columns, section, surface, cardGrid, contentCard, metric, docTree, kanbanCard, kanbanGrid, deadline, recordList, recordWorkspace, recordToggle, readonlyField, readonlyTextarea, recordFieldGrid, recordRail, recordHeaderActions, breadcrumbs, pageContext, tabs, mediaPanel, attachmentPanel, modalForm, modalSheet, recordForm, formCluster, recordActions, datePicker, scheduleBoard, HOOKS, OWNERS, mailContractCases, activityContractCases, calendarContractCases, } from '../../ui/index.js';
|
|
77
|
+
export { backendPage, shell, formatDateTime, formatMoney, Framed, ListScreen, RecordScreen, WorkspaceScreen, listChrome, timeframeFilter, topbarSearch, emptyState, liveRegion, errorState, dataTable, visibleColumns, badge, avatar, thumbnail, person, initials, icon, hasIcon, definitionList, progressBar, gantt, chart, barChart, delta, changeOf, axisCeiling, code, qrCode, inline, button, linkButton, iconButton, actionGroup, tag, countBadge, notice, loadingState, loginScreen, stack, columns, section, surface, cardGrid, contentCard, metric, docTree, kanbanCard, kanbanGrid, deadline, recordList, recordWorkspace, recordToggle, readonlyField, readonlyTextarea, recordFieldGrid, recordRail, recordHeaderActions, breadcrumbs, pageContext, tabs, mediaPanel, attachmentPanel, modalForm, modalSheet, recordForm, formCluster, recordActions, datePicker, scheduleBoard, HOOKS, OWNERS, mailContractCases, activityContractCases, calendarContractCases, } from '../../ui/index.js';
|
|
78
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/index.ts"],"names":[],"mappings":"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,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC7F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC;;;;GAIG;AACH,OAAO,EACL,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,QAAQ,GACT,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAQtE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/index.ts"],"names":[],"mappings":"AAAA,kBAAkB;AAClB,EAAE;AACF,8EAA8E;AAC9E,kFAAkF;AAClF,iFAAiF;AACjF,8EAA8E;AAC9E,wFAAwF;AACxF,EAAE;AACF,kFAAkF;AAClF,iCAAiC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AA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 -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/backend/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAEhD;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAmO5D,CAAA"}
|
|
@@ -13,6 +13,17 @@ export const messages = {
|
|
|
13
13
|
'app.summary': 'Màn hình quản trị và cấu hình hệ thống.',
|
|
14
14
|
'app.category': 'Hệ thống',
|
|
15
15
|
'nav.sections': 'Phân hệ',
|
|
16
|
+
// Headings a deployment can group its menu under. They live here because the
|
|
17
|
+
// shell owns the sidebar and a group can hold entries from several modules —
|
|
18
|
+
// there is no one module whose words they could be. A deployment names them
|
|
19
|
+
// fully (`backend.menu.customers`), which is the form the menu builder falls
|
|
20
|
+
// back to when a group's label is not a key of the module it lands under.
|
|
21
|
+
'menu.customers': 'Khách hàng',
|
|
22
|
+
'menu.care': 'Chăm sóc',
|
|
23
|
+
'menu.selling': 'Bán hàng',
|
|
24
|
+
'menu.stock': 'Kho và sản phẩm',
|
|
25
|
+
'menu.books': 'Kế toán',
|
|
26
|
+
'menu.setup': 'Thiết lập',
|
|
16
27
|
'nav.search': 'Tìm phân hệ, menu…',
|
|
17
28
|
'nav.noMatch': 'Không có phân hệ hoặc menu nào khớp.',
|
|
18
29
|
// What a person reads when the answer is no. The code stays on the page —
|
|
@@ -52,7 +63,19 @@ export const messages = {
|
|
|
52
63
|
'chrome.breadcrumb': 'Đường dẫn',
|
|
53
64
|
'chrome.removeFilter': 'Bỏ bộ lọc',
|
|
54
65
|
'chrome.previous': 'Trang trước',
|
|
55
|
-
'modal.unsaved': '
|
|
66
|
+
'modal.unsaved': 'Rời khỏi đây sẽ mất phần bạn đang nhập. Vẫn tiếp tục?',
|
|
67
|
+
// The nine complaints a form schema can raise, in the words a person reads.
|
|
68
|
+
// The validator names the key; these are the sentences behind them, kept in
|
|
69
|
+
// one place so a module that adopts a schema does not carry its own copy.
|
|
70
|
+
'validation.required': 'Trường này là bắt buộc.',
|
|
71
|
+
'validation.type': 'Giá trị không đúng định dạng.',
|
|
72
|
+
'validation.min': 'Giá trị phải từ {min} trở lên.',
|
|
73
|
+
'validation.max': 'Giá trị phải từ {max} trở xuống.',
|
|
74
|
+
'validation.minLength': 'Cần ít nhất {min} ký tự.',
|
|
75
|
+
'validation.maxLength': 'Chỉ được tối đa {max} ký tự.',
|
|
76
|
+
'validation.oneOf': 'Giá trị không nằm trong danh sách cho phép.',
|
|
77
|
+
'validation.pattern': 'Giá trị không đúng khuôn dạng.',
|
|
78
|
+
'validation.unknown': 'Trường này không thuộc biểu mẫu.',
|
|
56
79
|
'chrome.next': 'Trang sau',
|
|
57
80
|
'chrome.views': 'Kiểu xem',
|
|
58
81
|
'chrome.view.list': 'Danh sách',
|
|
@@ -96,6 +119,12 @@ export const messages = {
|
|
|
96
119
|
'app.summary': 'Manage system administration and configuration.',
|
|
97
120
|
'app.category': 'System',
|
|
98
121
|
'nav.sections': 'Modules',
|
|
122
|
+
'menu.customers': 'Customers',
|
|
123
|
+
'menu.care': 'Care',
|
|
124
|
+
'menu.selling': 'Selling',
|
|
125
|
+
'menu.stock': 'Stock and products',
|
|
126
|
+
'menu.books': 'Accounting',
|
|
127
|
+
'menu.setup': 'Setup',
|
|
99
128
|
'error.forbidden.title': 'You do not have access to this screen',
|
|
100
129
|
'error.forbidden.message': 'Your account has not been granted this screen. If this is work you need to do, ask an administrator to grant it.',
|
|
101
130
|
'error.missing.title': 'This screen does not exist',
|
|
@@ -132,7 +161,16 @@ export const messages = {
|
|
|
132
161
|
'chrome.breadcrumb': 'Breadcrumb',
|
|
133
162
|
'chrome.removeFilter': 'Remove filter',
|
|
134
163
|
'chrome.previous': 'Previous page',
|
|
135
|
-
'modal.unsaved': '
|
|
164
|
+
'modal.unsaved': 'Leaving loses what you have typed. Continue?',
|
|
165
|
+
'validation.required': 'This field is required.',
|
|
166
|
+
'validation.type': 'That is not the right kind of value.',
|
|
167
|
+
'validation.min': 'Enter {min} or more.',
|
|
168
|
+
'validation.max': 'Enter {max} or less.',
|
|
169
|
+
'validation.minLength': 'Enter at least {min} characters.',
|
|
170
|
+
'validation.maxLength': 'Enter at most {max} characters.',
|
|
171
|
+
'validation.oneOf': 'That is not one of the accepted values.',
|
|
172
|
+
'validation.pattern': 'That is not the expected format.',
|
|
173
|
+
'validation.unknown': 'This field does not belong to the form.',
|
|
136
174
|
'chrome.next': 'Next page',
|
|
137
175
|
'chrome.views': 'Views',
|
|
138
176
|
'chrome.view.list': 'List',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/messages.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4C;IAC/D,EAAE,EAAE;QACF,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,UAAU;QACvB,aAAa,EAAE,yCAAyC;QACxD,cAAc,EAAE,UAAU;QAE1B,cAAc,EAAE,SAAS;QACzB,YAAY,EAAE,oBAAoB;QAClC,aAAa,EAAE,sCAAsC;QACrD,0EAA0E;QAC1E,0EAA0E;QAC1E,2DAA2D;QAC3D,uBAAuB,EAAE,oCAAoC;QAC7D,yBAAyB,EACvB,gIAAgI;QAClI,qBAAqB,EAAE,6BAA6B;QACpD,uBAAuB,EACrB,uFAAuF;QACzF,oBAAoB,EAAE,4BAA4B;QAClD,sBAAsB,EACpB,sGAAsG;QACxG,YAAY,EAAE,oBAAoB;QAClC,WAAW,EAAE,OAAO;QACpB,KAAK,EAAE,UAAU;QACjB,aAAa,EAAE,gBAAgB;QAC/B,oBAAoB,EAAE,eAAe;QAErC,eAAe,EAAE,UAAU;QAC3B,UAAU,EAAE,IAAI;QAEhB,aAAa,EAAE,IAAI;QAEnB,iBAAiB,EAAE,kBAAkB;QACrC,iBAAiB,EAAE,WAAW;QAC9B,eAAe,EAAE,WAAW;QAC5B,oBAAoB,EAAE,sBAAsB;QAC5C,kBAAkB,EAAE,mBAAmB;QACvC,oBAAoB,EAAE,uBAAuB;QAC7C,gBAAgB,EAAE,MAAM;QACxB,iBAAiB,EAAE,MAAM;QACzB,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,KAAK;QACtB,eAAe,EAAE,KAAK;QACtB,iBAAiB,EAAE,KAAK;QACxB,iBAAiB,EAAE,SAAS;QAC5B,wBAAwB,EAAE,kBAAkB;QAC5C,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,SAAS;QAC3B,iBAAiB,EAAE,SAAS;QAE5B,mBAAmB,EAAE,WAAW;QAChC,qBAAqB,EAAE,WAAW;QAClC,iBAAiB,EAAE,aAAa;QAChC,eAAe,EAAE,+
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../../../../../packages/ketsuite/src/modules/backend/messages.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4C;IAC/D,EAAE,EAAE;QACF,OAAO,EAAE,WAAW;QACpB,WAAW,EAAE,UAAU;QACvB,aAAa,EAAE,yCAAyC;QACxD,cAAc,EAAE,UAAU;QAE1B,cAAc,EAAE,SAAS;QAEzB,6EAA6E;QAC7E,6EAA6E;QAC7E,4EAA4E;QAC5E,6EAA6E;QAC7E,0EAA0E;QAC1E,gBA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C3B,iBAAiB,EAAE,WAAW;QAC9B,aAAa,EAAE,OAAO;QACtB,qBAAqB,EAAE,eAAe;QACtC,kBAAkB,EAAE,wCAAwC;QAC5D,aAAa,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,eAAe,EAAE;KAC/D;CACF,CAAA"}
|
|
@@ -219,6 +219,36 @@ export declare const channelError: (ctx: ServeContext, url: URL, req: Req, code:
|
|
|
219
219
|
fieldErrors?: ChannelError['fieldErrors'];
|
|
220
220
|
details?: Record<string, unknown>;
|
|
221
221
|
}) => ChannelError;
|
|
222
|
+
/**
|
|
223
|
+
* What a channel route answers with instead of doing the work.
|
|
224
|
+
*
|
|
225
|
+
* Named because eleven route files were each spelling it out as
|
|
226
|
+
* `ReturnType<typeof domainFailure>` or leaving it inferred, which made the
|
|
227
|
+
* one helper below impossible to share without every caller agreeing on a type
|
|
228
|
+
* none of them had written down.
|
|
229
|
+
*/
|
|
230
|
+
export type ChannelRefusal = {
|
|
231
|
+
status: number;
|
|
232
|
+
error: ChannelError;
|
|
233
|
+
};
|
|
234
|
+
/**
|
|
235
|
+
* The replay key a mutating channel route needs, or the refusal to send back.
|
|
236
|
+
*
|
|
237
|
+
* `const key = idempotencyKey(ctx, url, req); if (typeof key !== 'string') return key`
|
|
238
|
+
*
|
|
239
|
+
* Every staff channel takes it from the same header with the same bounds and
|
|
240
|
+
* refuses with the same code, and until now every one of them carried its own
|
|
241
|
+
* copy of these ten lines — eleven files across ten modules, identical in
|
|
242
|
+
* behaviour and drifting only in shape. One of them is where a difference
|
|
243
|
+
* would have hidden, and nothing would have caught it: a channel that quietly
|
|
244
|
+
* accepted a six-character key, or answered 422 where the others answer 400,
|
|
245
|
+
* looks exactly like a channel that does not.
|
|
246
|
+
*
|
|
247
|
+
* The bounds are the domain's, not this module's: a key under eight characters
|
|
248
|
+
* is refused by `commandKey` downstream anyway, so accepting one here would
|
|
249
|
+
* only move the refusal somewhere the caller cannot act on.
|
|
250
|
+
*/
|
|
251
|
+
export declare const idempotencyKey: (ctx: ServeContext, url: URL, req: Req) => string | ChannelRefusal;
|
|
222
252
|
export declare const sha256: (value: string) => string;
|
|
223
253
|
export declare const hostOf: (req: Req) => string;
|
|
224
254
|
/** No Origin is a non-browser caller; a browser sends one on every request that could forge. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../packages/ketsuite/src/modules/channel_api/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,KAAK,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAA;AAE1B,eAAO,MAAM,mBAAmB,UAAU,CAAA;AAC1C,eAAO,MAAM,gBAAgB,YAAI,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,CAAU,CAAA;AACpF,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC9D,MAAM,MAAM,2BAA2B,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE7D,eAAO,MAAM,aAAa,YAAa,cAAc,KAAG,MAA+B,CAAA;AAEvF,KAAK,GAAG,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAC/B,KAAK,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAElC;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB,QAAQ,GACR,UAAU,GACV,UAAU;AACZ,6EAA6E;GAC3E,mBAAmB;AACrB,6EAA6E;GAC3E,UAAU,CAAA;AAEd,eAAO,MAAM,QAAQ,SAAU,WAAW,KAAG,OAA4B,CAAA;AACzE,eAAO,MAAM,OAAO,SAAU,WAAW,KAAG,OAAqD,CAAA;AAEjG,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IAC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AC,MAAM,EAAE,UAAU,CAuLrB,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,cAAe,KAAK,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAa1F,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -153,6 +153,34 @@ export const channelError = (ctx, url, req, code, options = {}) => {
|
|
|
153
153
|
details: options.details ?? {},
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* The replay key a mutating channel route needs, or the refusal to send back.
|
|
158
|
+
*
|
|
159
|
+
* `const key = idempotencyKey(ctx, url, req); if (typeof key !== 'string') return key`
|
|
160
|
+
*
|
|
161
|
+
* Every staff channel takes it from the same header with the same bounds and
|
|
162
|
+
* refuses with the same code, and until now every one of them carried its own
|
|
163
|
+
* copy of these ten lines — eleven files across ten modules, identical in
|
|
164
|
+
* behaviour and drifting only in shape. One of them is where a difference
|
|
165
|
+
* would have hidden, and nothing would have caught it: a channel that quietly
|
|
166
|
+
* accepted a six-character key, or answered 422 where the others answer 400,
|
|
167
|
+
* looks exactly like a channel that does not.
|
|
168
|
+
*
|
|
169
|
+
* The bounds are the domain's, not this module's: a key under eight characters
|
|
170
|
+
* is refused by `commandKey` downstream anyway, so accepting one here would
|
|
171
|
+
* only move the refusal somewhere the caller cannot act on.
|
|
172
|
+
*/
|
|
173
|
+
export const idempotencyKey = (ctx, url, req) => {
|
|
174
|
+
const key = String(req.headers['idempotency-key'] ?? '').trim();
|
|
175
|
+
if (key.length >= 8 && key.length <= 200)
|
|
176
|
+
return key;
|
|
177
|
+
return {
|
|
178
|
+
status: 400,
|
|
179
|
+
error: channelError(ctx, url, req, 'channel_api.idempotencyRequired', {
|
|
180
|
+
messageKey: 'channel_api.error.idempotencyRequired',
|
|
181
|
+
}),
|
|
182
|
+
};
|
|
183
|
+
};
|
|
156
184
|
export const sha256 = (value) => createHash('sha256').update(value).digest('hex');
|
|
157
185
|
export const hostOf = (req) => String(req.headers.host ?? '')
|
|
158
186
|
.trim()
|