@ketvietlab/ketsuite 0.1.25 → 0.1.29
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/cache.d.ts +23 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +71 -0
- package/dist/cache.js.map +1 -0
- package/dist/cli-watch.d.ts +4 -0
- package/dist/cli-watch.d.ts.map +1 -0
- package/dist/cli-watch.js +52 -0
- package/dist/cli-watch.js.map +1 -0
- package/dist/cli.js +45 -17
- package/dist/cli.js.map +1 -1
- package/dist/deployment.d.ts +11 -0
- package/dist/deployment.d.ts.map +1 -1
- package/dist/deployment.js +49 -39
- package/dist/deployment.js.map +1 -1
- package/dist/deployments/commerce.d.ts +4 -0
- package/dist/deployments/commerce.d.ts.map +1 -0
- package/dist/deployments/commerce.js +34 -0
- package/dist/deployments/commerce.js.map +1 -0
- package/dist/deployments/common.d.ts +54 -0
- package/dist/deployments/common.d.ts.map +1 -0
- package/dist/deployments/common.js +112 -0
- package/dist/deployments/common.js.map +1 -0
- package/dist/deployments/hospitality.d.ts +4 -0
- package/dist/deployments/hospitality.d.ts.map +1 -0
- package/dist/deployments/hospitality.js +103 -0
- package/dist/deployments/hospitality.js.map +1 -0
- package/dist/deployments/office.d.ts +4 -0
- package/dist/deployments/office.d.ts.map +1 -0
- package/dist/deployments/office.js +31 -0
- package/dist/deployments/office.js.map +1 -0
- package/dist/development.d.ts +16 -0
- package/dist/development.d.ts.map +1 -1
- package/dist/development.js +31 -0
- package/dist/development.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/account_backend/index.js +364 -871
- package/dist/modules/account_backend/index.js.map +1 -1
- package/dist/modules/account_backend/screens/accounts-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/accounts-list.js +5 -15
- package/dist/modules/account_backend/screens/accounts-list.js.map +1 -1
- package/dist/modules/account_backend/screens/customer-invoices-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/customer-invoices-list.js +5 -15
- package/dist/modules/account_backend/screens/customer-invoices-list.js.map +1 -1
- package/dist/modules/account_backend/screens/journal-entries-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/journal-entries-list.js +5 -15
- package/dist/modules/account_backend/screens/journal-entries-list.js.map +1 -1
- package/dist/modules/account_backend/screens/journals-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/journals-list.js +5 -15
- package/dist/modules/account_backend/screens/journals-list.js.map +1 -1
- package/dist/modules/account_backend/screens/opening-balances.d.ts +3 -1
- package/dist/modules/account_backend/screens/opening-balances.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/opening-balances.js +11 -5
- package/dist/modules/account_backend/screens/opening-balances.js.map +1 -1
- package/dist/modules/account_backend/screens/payment-terms-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/payment-terms-list.js +6 -17
- package/dist/modules/account_backend/screens/payment-terms-list.js.map +1 -1
- package/dist/modules/account_backend/screens/payments-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/payments-list.js +5 -15
- package/dist/modules/account_backend/screens/payments-list.js.map +1 -1
- package/dist/modules/account_backend/screens/period-closes.d.ts +3 -1
- package/dist/modules/account_backend/screens/period-closes.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/period-closes.js +40 -36
- package/dist/modules/account_backend/screens/period-closes.js.map +1 -1
- package/dist/modules/account_backend/screens/taxes-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/taxes-list.js +5 -15
- package/dist/modules/account_backend/screens/taxes-list.js.map +1 -1
- package/dist/modules/account_backend/screens/vendor-bills-list.d.ts.map +1 -1
- package/dist/modules/account_backend/screens/vendor-bills-list.js +5 -15
- package/dist/modules/account_backend/screens/vendor-bills-list.js.map +1 -1
- package/dist/modules/account_backend/search-functions.d.ts +4 -0
- package/dist/modules/account_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/account_backend/search-functions.js +5 -0
- package/dist/modules/account_backend/search-functions.js.map +1 -0
- package/dist/modules/account_backend/search.d.ts +774 -0
- package/dist/modules/account_backend/search.d.ts.map +1 -0
- package/dist/modules/account_backend/search.js +312 -0
- package/dist/modules/account_backend/search.js.map +1 -0
- package/dist/modules/address_backend/index.d.ts.map +1 -1
- package/dist/modules/address_backend/index.js +2 -0
- package/dist/modules/address_backend/index.js.map +1 -1
- package/dist/modules/address_backend/routes.d.ts.map +1 -1
- package/dist/modules/address_backend/routes.js +32 -7
- package/dist/modules/address_backend/routes.js.map +1 -1
- package/dist/modules/address_backend/screens/catalogs-list.d.ts +3 -1
- package/dist/modules/address_backend/screens/catalogs-list.d.ts.map +1 -1
- package/dist/modules/address_backend/screens/catalogs-list.js +15 -9
- package/dist/modules/address_backend/screens/catalogs-list.js.map +1 -1
- package/dist/modules/address_backend/screens/country-browser.d.ts.map +1 -1
- package/dist/modules/address_backend/screens/country-browser.js +7 -15
- package/dist/modules/address_backend/screens/country-browser.js.map +1 -1
- package/dist/modules/address_backend/search-functions.d.ts +4 -0
- package/dist/modules/address_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/address_backend/search-functions.js +7 -0
- package/dist/modules/address_backend/search-functions.js.map +1 -0
- package/dist/modules/address_backend/search.d.ts +38 -0
- package/dist/modules/address_backend/search.d.ts.map +1 -0
- package/dist/modules/address_backend/search.js +40 -0
- package/dist/modules/address_backend/search.js.map +1 -0
- package/dist/modules/backend/catalogue.d.ts.map +1 -1
- package/dist/modules/backend/catalogue.js +16 -13
- package/dist/modules/backend/catalogue.js.map +1 -1
- package/dist/modules/backend/collection-search.d.ts +16 -0
- package/dist/modules/backend/collection-search.d.ts.map +1 -0
- package/dist/modules/backend/collection-search.js +43 -0
- package/dist/modules/backend/collection-search.js.map +1 -0
- package/dist/modules/backend/design/HANDOFF.md +1 -1
- package/dist/modules/backend/design/auth.css +61 -0
- package/dist/modules/backend/design/brand/logo-dark.png +0 -0
- package/dist/modules/backend/design/brand/logo-light.png +0 -0
- package/dist/modules/backend/design/client/backend-shell.d.mts +2 -2
- package/dist/modules/backend/design/client/backend-shell.d.mts.map +1 -1
- package/dist/modules/backend/design/client/backend-shell.mjs +1 -1
- package/dist/modules/backend/design/client/backend-shell.mjs.map +4 -4
- package/dist/modules/backend/design/client/ket-table.d.mts +10 -0
- package/dist/modules/backend/design/client/ket-table.d.mts.map +1 -0
- package/dist/modules/backend/design/client/ket-table.mjs +2 -0
- package/dist/modules/backend/design/client/ket-table.mjs.map +7 -0
- package/dist/modules/backend/design/client/lightbox.d.mts +22 -0
- package/dist/modules/backend/design/client/lightbox.d.mts.map +1 -0
- package/dist/modules/backend/design/client/lightbox.mjs +2 -0
- package/dist/modules/backend/design/client/lightbox.mjs.map +7 -0
- package/dist/modules/backend/design/client/relation-select.d.mts +12 -3
- package/dist/modules/backend/design/client/relation-select.d.mts.map +1 -1
- package/dist/modules/backend/design/client/relation-select.mjs +1 -1
- package/dist/modules/backend/design/client/relation-select.mjs.map +4 -4
- package/dist/modules/backend/design/client/search-filter.d.mts +10 -0
- package/dist/modules/backend/design/client/search-filter.d.mts.map +1 -0
- package/dist/modules/backend/design/client/search-filter.mjs +2 -0
- package/dist/modules/backend/design/client/search-filter.mjs.map +7 -0
- package/dist/modules/backend/design/content.css +43 -5
- package/dist/modules/backend/design/forms.css +99 -229
- package/dist/modules/backend/design/foundation.css +0 -51
- package/dist/modules/backend/design/lists.css +79 -7
- package/dist/modules/backend/design/user-workflow.css +0 -20
- package/dist/modules/backend/global-search.d.ts +3 -0
- package/dist/modules/backend/global-search.d.ts.map +1 -0
- package/dist/modules/backend/global-search.js +82 -0
- package/dist/modules/backend/global-search.js.map +1 -0
- package/dist/modules/backend/index.d.ts +26 -0
- package/dist/modules/backend/index.d.ts.map +1 -1
- package/dist/modules/backend/index.js +23 -0
- package/dist/modules/backend/index.js.map +1 -1
- package/dist/modules/backend/islands.d.ts +44 -1
- package/dist/modules/backend/islands.d.ts.map +1 -1
- package/dist/modules/backend/islands.js +25 -1
- package/dist/modules/backend/islands.js.map +1 -1
- package/dist/modules/backend/joints.d.ts.map +1 -1
- package/dist/modules/backend/joints.js +12 -0
- package/dist/modules/backend/joints.js.map +1 -1
- package/dist/modules/backend/ket-table.d.ts +7 -0
- package/dist/modules/backend/ket-table.d.ts.map +1 -0
- package/dist/modules/backend/ket-table.js +2 -0
- package/dist/modules/backend/ket-table.js.map +1 -0
- package/dist/modules/backend/messages.d.ts.map +1 -1
- package/dist/modules/backend/messages.js +144 -0
- package/dist/modules/backend/messages.js.map +1 -1
- package/dist/modules/backend/paging.d.ts.map +1 -1
- package/dist/modules/backend/paging.js +2 -1
- package/dist/modules/backend/paging.js.map +1 -1
- package/dist/modules/backend/relation-select.d.ts +2 -2
- package/dist/modules/backend/relation-select.d.ts.map +1 -1
- package/dist/modules/backend/routes.d.ts.map +1 -1
- package/dist/modules/backend/routes.js +2 -0
- package/dist/modules/backend/routes.js.map +1 -1
- package/dist/modules/backend/row-list.d.ts +63 -0
- package/dist/modules/backend/row-list.d.ts.map +1 -0
- package/dist/modules/backend/row-list.js +252 -0
- package/dist/modules/backend/row-list.js.map +1 -0
- package/dist/modules/backend/screen.d.ts +3 -3
- package/dist/modules/backend/screen.d.ts.map +1 -1
- package/dist/modules/backend/screen.js +6 -7
- package/dist/modules/backend/screen.js.map +1 -1
- package/dist/modules/backend/search-filter-state.d.ts +42 -0
- package/dist/modules/backend/search-filter-state.d.ts.map +1 -0
- package/dist/modules/backend/search-filter-state.js +277 -0
- package/dist/modules/backend/search-filter-state.js.map +1 -0
- package/dist/modules/backend/search-filter.d.ts +77 -0
- package/dist/modules/backend/search-filter.d.ts.map +1 -0
- package/dist/modules/backend/search-filter.js +259 -0
- package/dist/modules/backend/search-filter.js.map +1 -0
- package/dist/modules/channel_api/core.d.ts +1 -0
- package/dist/modules/channel_api/core.d.ts.map +1 -1
- package/dist/modules/channel_api/core.js.map +1 -1
- package/dist/modules/channel_api/customer.d.ts.map +1 -1
- package/dist/modules/channel_api/customer.js +4 -5
- package/dist/modules/channel_api/customer.js.map +1 -1
- package/dist/modules/company_backend/index.d.ts.map +1 -1
- package/dist/modules/company_backend/index.js +2 -0
- package/dist/modules/company_backend/index.js.map +1 -1
- package/dist/modules/company_backend/routes.d.ts.map +1 -1
- package/dist/modules/company_backend/routes.js +33 -27
- package/dist/modules/company_backend/routes.js.map +1 -1
- package/dist/modules/company_backend/screens/companies-list.d.ts +3 -3
- package/dist/modules/company_backend/screens/companies-list.d.ts.map +1 -1
- package/dist/modules/company_backend/screens/companies-list.js +18 -18
- package/dist/modules/company_backend/screens/companies-list.js.map +1 -1
- package/dist/modules/company_backend/screens/hierarchy.d.ts.map +1 -1
- package/dist/modules/company_backend/screens/hierarchy.js +1 -2
- package/dist/modules/company_backend/screens/hierarchy.js.map +1 -1
- package/dist/modules/company_backend/search-functions.d.ts +4 -0
- package/dist/modules/company_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/company_backend/search-functions.js +7 -0
- package/dist/modules/company_backend/search-functions.js.map +1 -0
- package/dist/modules/company_backend/search.d.ts +24 -0
- package/dist/modules/company_backend/search.d.ts.map +1 -0
- package/dist/modules/company_backend/search.js +24 -0
- package/dist/modules/company_backend/search.js.map +1 -0
- package/dist/modules/crm/functions/activities.js +7 -10
- package/dist/modules/crm/functions/activities.js.map +1 -1
- package/dist/modules/crm/functions/case-modal-context.d.ts +3 -0
- package/dist/modules/crm/functions/case-modal-context.d.ts.map +1 -0
- package/dist/modules/crm/functions/case-modal-context.js +156 -0
- package/dist/modules/crm/functions/case-modal-context.js.map +1 -0
- package/dist/modules/crm/functions/cases.d.ts.map +1 -1
- package/dist/modules/crm/functions/cases.js +35 -2
- package/dist/modules/crm/functions/cases.js.map +1 -1
- package/dist/modules/crm/functions/configuration.js +1 -1
- package/dist/modules/crm/functions/configuration.js.map +1 -1
- package/dist/modules/crm/functions/gamification.d.ts.map +1 -1
- package/dist/modules/crm/functions/gamification.js +11 -7
- package/dist/modules/crm/functions/gamification.js.map +1 -1
- package/dist/modules/crm/functions/index.d.ts.map +1 -1
- package/dist/modules/crm/functions/index.js +4 -0
- package/dist/modules/crm/functions/index.js.map +1 -1
- package/dist/modules/crm/functions/reporting.d.ts +3 -0
- package/dist/modules/crm/functions/reporting.d.ts.map +1 -0
- package/dist/modules/crm/functions/reporting.js +140 -0
- package/dist/modules/crm/functions/reporting.js.map +1 -0
- package/dist/modules/crm/functions/shared.d.ts +1 -0
- package/dist/modules/crm/functions/shared.d.ts.map +1 -1
- package/dist/modules/crm/functions/shared.js +17 -9
- package/dist/modules/crm/functions/shared.js.map +1 -1
- package/dist/modules/crm/messages.d.ts +8 -1
- package/dist/modules/crm/messages.d.ts.map +1 -1
- package/dist/modules/crm/messages.js +14 -0
- package/dist/modules/crm/messages.js.map +1 -1
- package/dist/modules/crm/models.d.ts.map +1 -1
- package/dist/modules/crm/models.js +7 -0
- package/dist/modules/crm/models.js.map +1 -1
- package/dist/modules/crm/operations.d.ts +4 -1
- package/dist/modules/crm/operations.d.ts.map +1 -1
- package/dist/modules/crm/operations.js +39 -7
- package/dist/modules/crm/operations.js.map +1 -1
- package/dist/modules/crm/reporting.d.ts +115 -0
- package/dist/modules/crm/reporting.d.ts.map +1 -0
- package/dist/modules/crm/reporting.js +241 -0
- package/dist/modules/crm/reporting.js.map +1 -0
- package/dist/modules/crm_backend/client/crm-case-modal.d.mts +302 -0
- package/dist/modules/crm_backend/client/crm-case-modal.d.mts.map +1 -0
- package/dist/modules/crm_backend/client/crm-case-modal.mjs +2 -0
- package/dist/modules/crm_backend/client/crm-case-modal.mjs.map +7 -0
- package/dist/modules/crm_backend/client/crm-configuration-modal.d.mts +51 -51
- package/dist/modules/crm_backend/client/crm-configuration-modal.d.mts.map +1 -1
- package/dist/modules/crm_backend/client/crm-configuration-modal.mjs +1 -1
- package/dist/modules/crm_backend/client/crm-configuration-modal.mjs.map +4 -4
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs +1 -1
- package/dist/modules/crm_backend/client/crm-kanban-view.mjs.map +1 -1
- package/dist/modules/crm_backend/collection-rows.d.ts +6 -0
- package/dist/modules/crm_backend/collection-rows.d.ts.map +1 -0
- package/dist/modules/crm_backend/collection-rows.js +15 -0
- package/dist/modules/crm_backend/collection-rows.js.map +1 -0
- package/dist/modules/crm_backend/index.d.ts.map +1 -1
- package/dist/modules/crm_backend/index.js +2 -15
- package/dist/modules/crm_backend/index.js.map +1 -1
- package/dist/modules/crm_backend/islands.d.ts +1 -0
- package/dist/modules/crm_backend/islands.d.ts.map +1 -1
- package/dist/modules/crm_backend/islands.js +5 -0
- package/dist/modules/crm_backend/islands.js.map +1 -1
- package/dist/modules/crm_backend/messages.d.ts +34 -0
- package/dist/modules/crm_backend/messages.d.ts.map +1 -1
- package/dist/modules/crm_backend/messages.js +34 -0
- package/dist/modules/crm_backend/messages.js.map +1 -1
- package/dist/modules/crm_backend/modal/case-modal-view.d.ts +23 -0
- package/dist/modules/crm_backend/modal/case-modal-view.d.ts.map +1 -0
- package/dist/modules/crm_backend/modal/case-modal-view.js +640 -0
- package/dist/modules/crm_backend/modal/case-modal-view.js.map +1 -0
- package/dist/modules/crm_backend/routes.d.ts.map +1 -1
- package/dist/modules/crm_backend/routes.js +71 -15
- package/dist/modules/crm_backend/routes.js.map +1 -1
- package/dist/modules/crm_backend/screens/activity-planner.d.ts +1 -0
- package/dist/modules/crm_backend/screens/activity-planner.d.ts.map +1 -1
- package/dist/modules/crm_backend/screens/activity-planner.js +15 -11
- package/dist/modules/crm_backend/screens/activity-planner.js.map +1 -1
- package/dist/modules/crm_backend/screens/cases-list.d.ts +1 -0
- package/dist/modules/crm_backend/screens/cases-list.d.ts.map +1 -1
- package/dist/modules/crm_backend/screens/cases-list.js +17 -26
- package/dist/modules/crm_backend/screens/cases-list.js.map +1 -1
- package/dist/modules/crm_backend/screens/configuration.d.ts.map +1 -1
- package/dist/modules/crm_backend/screens/configuration.js +18 -16
- package/dist/modules/crm_backend/screens/configuration.js.map +1 -1
- package/dist/modules/crm_backend/screens/leaderboard.d.ts +2 -0
- package/dist/modules/crm_backend/screens/leaderboard.d.ts.map +1 -1
- package/dist/modules/crm_backend/screens/leaderboard.js +12 -18
- package/dist/modules/crm_backend/screens/leaderboard.js.map +1 -1
- package/dist/modules/flow/functions.d.ts.map +1 -1
- package/dist/modules/flow/functions.js +20 -39
- package/dist/modules/flow/functions.js.map +1 -1
- package/dist/modules/flow_backend/index.js +2 -1
- package/dist/modules/flow_backend/index.js.map +1 -1
- package/dist/modules/flow_backend/routes.d.ts.map +1 -1
- package/dist/modules/flow_backend/routes.js +181 -126
- package/dist/modules/flow_backend/routes.js.map +1 -1
- package/dist/modules/flow_backend/screens/all-epics.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/all-epics.js +37 -45
- package/dist/modules/flow_backend/screens/all-epics.js.map +1 -1
- package/dist/modules/flow_backend/screens/all-pages.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/all-pages.js +43 -51
- package/dist/modules/flow_backend/screens/all-pages.js.map +1 -1
- package/dist/modules/flow_backend/screens/issues.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/issues.js +68 -82
- package/dist/modules/flow_backend/screens/issues.js.map +1 -1
- package/dist/modules/flow_backend/screens/my-work.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/my-work.js +63 -69
- package/dist/modules/flow_backend/screens/my-work.js.map +1 -1
- package/dist/modules/flow_backend/screens/project-pages.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/project-pages.js +1 -2
- package/dist/modules/flow_backend/screens/project-pages.js.map +1 -1
- package/dist/modules/flow_backend/screens/projects-list.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/projects-list.js +41 -64
- package/dist/modules/flow_backend/screens/projects-list.js.map +1 -1
- package/dist/modules/flow_backend/screens/sprints.d.ts +3 -1
- package/dist/modules/flow_backend/screens/sprints.d.ts.map +1 -1
- package/dist/modules/flow_backend/screens/sprints.js +77 -73
- package/dist/modules/flow_backend/screens/sprints.js.map +1 -1
- package/dist/modules/flow_backend/search-functions.d.ts +13 -0
- package/dist/modules/flow_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/flow_backend/search-functions.js +40 -0
- package/dist/modules/flow_backend/search-functions.js.map +1 -0
- package/dist/modules/flow_backend/search.d.ts +48 -0
- package/dist/modules/flow_backend/search.d.ts.map +1 -0
- package/dist/modules/flow_backend/search.js +57 -0
- package/dist/modules/flow_backend/search.js.map +1 -0
- package/dist/modules/hospitality_billing/index.js +2 -1
- package/dist/modules/hospitality_billing/index.js.map +1 -1
- package/dist/modules/hospitality_billing/menus.js +2 -2
- package/dist/modules/hospitality_billing/menus.js.map +1 -1
- package/dist/modules/hospitality_billing/messages.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/messages.js +2 -0
- package/dist/modules/hospitality_billing/messages.js.map +1 -1
- package/dist/modules/hospitality_billing/routes.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/routes.js +39 -5
- package/dist/modules/hospitality_billing/routes.js.map +1 -1
- package/dist/modules/hospitality_billing/screens/billing.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/screens/billing.js +21 -17
- package/dist/modules/hospitality_billing/screens/billing.js.map +1 -1
- package/dist/modules/hospitality_billing/screens/charge-rules.d.ts +4 -2
- package/dist/modules/hospitality_billing/screens/charge-rules.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/screens/charge-rules.js +14 -9
- package/dist/modules/hospitality_billing/screens/charge-rules.js.map +1 -1
- package/dist/modules/hospitality_billing/screens/page-frame.d.ts +3 -1
- package/dist/modules/hospitality_billing/screens/page-frame.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/screens/page-frame.js +2 -4
- package/dist/modules/hospitality_billing/screens/page-frame.js.map +1 -1
- package/dist/modules/hospitality_billing/screens/shared.d.ts +4 -4
- package/dist/modules/hospitality_billing/screens/shared.d.ts.map +1 -1
- package/dist/modules/hospitality_billing/screens/shared.js +2 -2
- package/dist/modules/hospitality_billing/screens/shared.js.map +1 -1
- package/dist/modules/hospitality_billing/search-functions.d.ts +4 -0
- package/dist/modules/hospitality_billing/search-functions.d.ts.map +1 -0
- package/dist/modules/hospitality_billing/search-functions.js +16 -0
- package/dist/modules/hospitality_billing/search-functions.js.map +1 -0
- package/dist/modules/hospitality_billing/search.d.ts +66 -0
- package/dist/modules/hospitality_billing/search.d.ts.map +1 -0
- package/dist/modules/hospitality_billing/search.js +92 -0
- package/dist/modules/hospitality_billing/search.js.map +1 -0
- package/dist/modules/hospitality_core/content.d.ts.map +1 -1
- package/dist/modules/hospitality_core/content.js +3 -0
- package/dist/modules/hospitality_core/content.js.map +1 -1
- package/dist/modules/hospitality_core/housekeeping.d.ts.map +1 -1
- package/dist/modules/hospitality_core/housekeeping.js +13 -4
- package/dist/modules/hospitality_core/housekeeping.js.map +1 -1
- package/dist/modules/hospitality_core/index.d.ts.map +1 -1
- package/dist/modules/hospitality_core/index.js +2 -0
- package/dist/modules/hospitality_core/index.js.map +1 -1
- package/dist/modules/hospitality_core/menus.d.ts.map +1 -1
- package/dist/modules/hospitality_core/menus.js +27 -30
- package/dist/modules/hospitality_core/menus.js.map +1 -1
- package/dist/modules/hospitality_core/messages.d.ts.map +1 -1
- package/dist/modules/hospitality_core/messages.js +4 -0
- package/dist/modules/hospitality_core/messages.js.map +1 -1
- package/dist/modules/hospitality_core/routes.d.ts.map +1 -1
- package/dist/modules/hospitality_core/routes.js +135 -47
- package/dist/modules/hospitality_core/routes.js.map +1 -1
- package/dist/modules/hospitality_core/screens/amenities.d.ts +4 -2
- package/dist/modules/hospitality_core/screens/amenities.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/amenities.js +9 -5
- package/dist/modules/hospitality_core/screens/amenities.js.map +1 -1
- package/dist/modules/hospitality_core/screens/cleaning-tasks.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/cleaning-tasks.js +45 -30
- package/dist/modules/hospitality_core/screens/cleaning-tasks.js.map +1 -1
- package/dist/modules/hospitality_core/screens/folios.d.ts +4 -2
- package/dist/modules/hospitality_core/screens/folios.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/folios.js +10 -4
- package/dist/modules/hospitality_core/screens/folios.js.map +1 -1
- package/dist/modules/hospitality_core/screens/page-frame.d.ts +3 -1
- package/dist/modules/hospitality_core/screens/page-frame.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/page-frame.js +4 -7
- package/dist/modules/hospitality_core/screens/page-frame.js.map +1 -1
- package/dist/modules/hospitality_core/screens/policies.d.ts +4 -2
- package/dist/modules/hospitality_core/screens/policies.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/policies.js +9 -5
- package/dist/modules/hospitality_core/screens/policies.js.map +1 -1
- package/dist/modules/hospitality_core/screens/properties.d.ts +4 -2
- package/dist/modules/hospitality_core/screens/properties.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/properties.js +49 -42
- package/dist/modules/hospitality_core/screens/properties.js.map +1 -1
- package/dist/modules/hospitality_core/screens/rate-plans.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/rate-plans.js +19 -15
- package/dist/modules/hospitality_core/screens/rate-plans.js.map +1 -1
- package/dist/modules/hospitality_core/screens/reservations.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/reservations.js +26 -19
- package/dist/modules/hospitality_core/screens/reservations.js.map +1 -1
- package/dist/modules/hospitality_core/screens/room-types.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/room-types.js +23 -19
- package/dist/modules/hospitality_core/screens/room-types.js.map +1 -1
- package/dist/modules/hospitality_core/screens/rooms.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/rooms.js +26 -19
- package/dist/modules/hospitality_core/screens/rooms.js.map +1 -1
- package/dist/modules/hospitality_core/screens/shared.d.ts +4 -4
- package/dist/modules/hospitality_core/screens/shared.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/shared.js +2 -2
- package/dist/modules/hospitality_core/screens/shared.js.map +1 -1
- package/dist/modules/hospitality_core/screens/stays.d.ts +4 -2
- package/dist/modules/hospitality_core/screens/stays.d.ts.map +1 -1
- package/dist/modules/hospitality_core/screens/stays.js +10 -4
- package/dist/modules/hospitality_core/screens/stays.js.map +1 -1
- package/dist/modules/hospitality_core/search-functions.d.ts +10 -0
- package/dist/modules/hospitality_core/search-functions.d.ts.map +1 -0
- package/dist/modules/hospitality_core/search-functions.js +17 -0
- package/dist/modules/hospitality_core/search-functions.js.map +1 -0
- package/dist/modules/hospitality_core/search.d.ts +218 -0
- package/dist/modules/hospitality_core/search.d.ts.map +1 -0
- package/dist/modules/hospitality_core/search.js +201 -0
- package/dist/modules/hospitality_core/search.js.map +1 -0
- package/dist/modules/hr_backend/index.d.ts.map +1 -1
- package/dist/modules/hr_backend/index.js +2 -0
- package/dist/modules/hr_backend/index.js.map +1 -1
- package/dist/modules/hr_backend/routes.d.ts.map +1 -1
- package/dist/modules/hr_backend/routes.js +55 -71
- package/dist/modules/hr_backend/routes.js.map +1 -1
- package/dist/modules/hr_backend/screens/employees-list.d.ts +3 -1
- package/dist/modules/hr_backend/screens/employees-list.d.ts.map +1 -1
- package/dist/modules/hr_backend/screens/employees-list.js +14 -12
- package/dist/modules/hr_backend/screens/employees-list.js.map +1 -1
- package/dist/modules/hr_backend/screens/leaves-list.d.ts +3 -1
- package/dist/modules/hr_backend/screens/leaves-list.d.ts.map +1 -1
- package/dist/modules/hr_backend/screens/leaves-list.js +11 -10
- package/dist/modules/hr_backend/screens/leaves-list.js.map +1 -1
- package/dist/modules/hr_backend/search-functions.d.ts +4 -0
- package/dist/modules/hr_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/hr_backend/search-functions.js +8 -0
- package/dist/modules/hr_backend/search-functions.js.map +1 -0
- package/dist/modules/hr_backend/search.d.ts +73 -0
- package/dist/modules/hr_backend/search.d.ts.map +1 -0
- package/dist/modules/hr_backend/search.js +67 -0
- package/dist/modules/hr_backend/search.js.map +1 -0
- package/dist/modules/livedoc/islands.d.ts +1 -0
- package/dist/modules/livedoc/islands.d.ts.map +1 -1
- package/dist/modules/loyalty_backend/index.js +176 -215
- package/dist/modules/loyalty_backend/index.js.map +1 -1
- package/dist/modules/loyalty_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/loyalty_backend/screens/index.js +321 -326
- package/dist/modules/loyalty_backend/screens/index.js.map +1 -1
- package/dist/modules/loyalty_backend/screens/page-frame.d.ts +6 -3
- package/dist/modules/loyalty_backend/screens/page-frame.d.ts.map +1 -1
- package/dist/modules/loyalty_backend/screens/page-frame.js +3 -3
- package/dist/modules/loyalty_backend/screens/page-frame.js.map +1 -1
- package/dist/modules/loyalty_backend/search-functions.d.ts +4 -0
- package/dist/modules/loyalty_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/search-functions.js +11 -0
- package/dist/modules/loyalty_backend/search-functions.js.map +1 -0
- package/dist/modules/loyalty_backend/search.d.ts +33 -0
- package/dist/modules/loyalty_backend/search.d.ts.map +1 -0
- package/dist/modules/loyalty_backend/search.js +85 -0
- package/dist/modules/loyalty_backend/search.js.map +1 -0
- package/dist/modules/manufacturing_backend/index.d.ts.map +1 -1
- package/dist/modules/manufacturing_backend/index.js +14 -0
- package/dist/modules/manufacturing_backend/index.js.map +1 -1
- package/dist/modules/manufacturing_backend/routes.d.ts.map +1 -1
- package/dist/modules/manufacturing_backend/routes.js +74 -20
- package/dist/modules/manufacturing_backend/routes.js.map +1 -1
- package/dist/modules/manufacturing_backend/screens/boms-list.d.ts +3 -1
- package/dist/modules/manufacturing_backend/screens/boms-list.d.ts.map +1 -1
- package/dist/modules/manufacturing_backend/screens/boms-list.js +12 -11
- package/dist/modules/manufacturing_backend/screens/boms-list.js.map +1 -1
- package/dist/modules/manufacturing_backend/screens/orders-list.d.ts +3 -1
- package/dist/modules/manufacturing_backend/screens/orders-list.d.ts.map +1 -1
- package/dist/modules/manufacturing_backend/screens/orders-list.js +13 -12
- package/dist/modules/manufacturing_backend/screens/orders-list.js.map +1 -1
- package/dist/modules/manufacturing_backend/screens/work-centers-list.d.ts +3 -1
- package/dist/modules/manufacturing_backend/screens/work-centers-list.d.ts.map +1 -1
- package/dist/modules/manufacturing_backend/screens/work-centers-list.js +13 -12
- package/dist/modules/manufacturing_backend/screens/work-centers-list.js.map +1 -1
- package/dist/modules/manufacturing_backend/search-functions.d.ts +4 -0
- package/dist/modules/manufacturing_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/manufacturing_backend/search-functions.js +9 -0
- package/dist/modules/manufacturing_backend/search-functions.js.map +1 -0
- package/dist/modules/manufacturing_backend/search.d.ts +99 -0
- package/dist/modules/manufacturing_backend/search.d.ts.map +1 -0
- package/dist/modules/manufacturing_backend/search.js +75 -0
- package/dist/modules/manufacturing_backend/search.js.map +1 -0
- package/dist/modules/oauth_backend/index.d.ts.map +1 -1
- package/dist/modules/oauth_backend/index.js +2 -0
- package/dist/modules/oauth_backend/index.js.map +1 -1
- package/dist/modules/oauth_backend/routes.d.ts.map +1 -1
- package/dist/modules/oauth_backend/routes.js +33 -2
- package/dist/modules/oauth_backend/routes.js.map +1 -1
- package/dist/modules/oauth_backend/screens/index.d.ts +7 -3
- package/dist/modules/oauth_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/oauth_backend/screens/index.js +113 -103
- package/dist/modules/oauth_backend/screens/index.js.map +1 -1
- package/dist/modules/oauth_backend/search-functions.d.ts +4 -0
- package/dist/modules/oauth_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/oauth_backend/search-functions.js +8 -0
- package/dist/modules/oauth_backend/search-functions.js.map +1 -0
- package/dist/modules/oauth_backend/search.d.ts +68 -0
- package/dist/modules/oauth_backend/search.d.ts.map +1 -0
- package/dist/modules/oauth_backend/search.js +69 -0
- package/dist/modules/oauth_backend/search.js.map +1 -0
- package/dist/modules/partner/functions.d.ts.map +1 -1
- package/dist/modules/partner/functions.js +121 -23
- package/dist/modules/partner/functions.js.map +1 -1
- package/dist/modules/partner_backend/functions.d.ts +13 -0
- package/dist/modules/partner_backend/functions.d.ts.map +1 -0
- package/dist/modules/partner_backend/functions.js +56 -0
- package/dist/modules/partner_backend/functions.js.map +1 -0
- package/dist/modules/partner_backend/index.d.ts.map +1 -1
- package/dist/modules/partner_backend/index.js +28 -6
- package/dist/modules/partner_backend/index.js.map +1 -1
- package/dist/modules/partner_backend/routes.d.ts.map +1 -1
- package/dist/modules/partner_backend/routes.js +269 -86
- package/dist/modules/partner_backend/routes.js.map +1 -1
- package/dist/modules/partner_backend/screens/index.d.ts +1 -1
- package/dist/modules/partner_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/partner_backend/screens/list.d.ts +3 -4
- package/dist/modules/partner_backend/screens/list.d.ts.map +1 -1
- package/dist/modules/partner_backend/screens/list.js +13 -92
- package/dist/modules/partner_backend/screens/list.js.map +1 -1
- package/dist/modules/partner_backend/screens/types.d.ts +0 -11
- package/dist/modules/partner_backend/screens/types.d.ts.map +1 -1
- package/dist/modules/pos_backend/index.js +34 -9
- package/dist/modules/pos_backend/index.js.map +1 -1
- package/dist/modules/pos_backend/screens.d.ts +4 -2
- package/dist/modules/pos_backend/screens.d.ts.map +1 -1
- package/dist/modules/pos_backend/screens.js +105 -96
- package/dist/modules/pos_backend/screens.js.map +1 -1
- package/dist/modules/pos_backend/search-functions.d.ts +4 -0
- package/dist/modules/pos_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/pos_backend/search-functions.js +7 -0
- package/dist/modules/pos_backend/search-functions.js.map +1 -0
- package/dist/modules/pos_backend/search.d.ts +41 -0
- package/dist/modules/pos_backend/search.d.ts.map +1 -0
- package/dist/modules/pos_backend/search.js +33 -0
- package/dist/modules/pos_backend/search.js.map +1 -0
- package/dist/modules/pricing_backend/index.js +31 -2
- package/dist/modules/pricing_backend/index.js.map +1 -1
- package/dist/modules/pricing_backend/screens/pricelists-list.d.ts +3 -1
- package/dist/modules/pricing_backend/screens/pricelists-list.d.ts.map +1 -1
- package/dist/modules/pricing_backend/screens/pricelists-list.js +14 -12
- package/dist/modules/pricing_backend/screens/pricelists-list.js.map +1 -1
- package/dist/modules/pricing_backend/search-functions.d.ts +4 -0
- package/dist/modules/pricing_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/pricing_backend/search-functions.js +11 -0
- package/dist/modules/pricing_backend/search-functions.js.map +1 -0
- package/dist/modules/pricing_backend/search.d.ts +41 -0
- package/dist/modules/pricing_backend/search.d.ts.map +1 -0
- package/dist/modules/pricing_backend/search.js +34 -0
- package/dist/modules/pricing_backend/search.js.map +1 -0
- package/dist/modules/product/attribute-draft.d.ts +3 -0
- package/dist/modules/product/attribute-draft.d.ts.map +1 -0
- package/dist/modules/product/attribute-draft.js +126 -0
- package/dist/modules/product/attribute-draft.js.map +1 -0
- package/dist/modules/product/attribute-modal-context.d.ts +4 -0
- package/dist/modules/product/attribute-modal-context.d.ts.map +1 -0
- package/dist/modules/product/attribute-modal-context.js +57 -0
- package/dist/modules/product/attribute-modal-context.js.map +1 -0
- package/dist/modules/product/attribute-modal-labels.d.ts +3 -0
- package/dist/modules/product/attribute-modal-labels.d.ts.map +1 -0
- package/dist/modules/product/attribute-modal-labels.js +30 -0
- package/dist/modules/product/attribute-modal-labels.js.map +1 -0
- package/dist/modules/product/functions.d.ts.map +1 -1
- package/dist/modules/product/functions.js +7 -1
- package/dist/modules/product/functions.js.map +1 -1
- package/dist/modules/product/messages.d.ts.map +1 -1
- package/dist/modules/product/messages.js +24 -0
- package/dist/modules/product/messages.js.map +1 -1
- package/dist/modules/product/models.d.ts.map +1 -1
- package/dist/modules/product/models.js +14 -2
- package/dist/modules/product/models.js.map +1 -1
- package/dist/modules/product/product-modal-context.d.ts.map +1 -1
- package/dist/modules/product/product-modal-context.js +20 -30
- package/dist/modules/product/product-modal-context.js.map +1 -1
- package/dist/modules/product/record-images.d.ts +12 -0
- package/dist/modules/product/record-images.d.ts.map +1 -0
- package/dist/modules/product/record-images.js +37 -0
- package/dist/modules/product/record-images.js.map +1 -0
- package/dist/modules/product/search.d.ts +3 -0
- package/dist/modules/product/search.d.ts.map +1 -1
- package/dist/modules/product/search.js +4 -0
- package/dist/modules/product/search.js.map +1 -1
- package/dist/modules/product/variant-setup.d.ts +46 -0
- package/dist/modules/product/variant-setup.d.ts.map +1 -0
- package/dist/modules/product/variant-setup.js +444 -0
- package/dist/modules/product/variant-setup.js.map +1 -0
- package/dist/modules/product_backend/attribute-search-state.d.ts +22 -0
- package/dist/modules/product_backend/attribute-search-state.d.ts.map +1 -0
- package/dist/modules/product_backend/attribute-search-state.js +62 -0
- package/dist/modules/product_backend/attribute-search-state.js.map +1 -0
- package/dist/modules/product_backend/attributes-search.d.ts +10 -0
- package/dist/modules/product_backend/attributes-search.d.ts.map +1 -0
- package/dist/modules/product_backend/attributes-search.js +67 -0
- package/dist/modules/product_backend/attributes-search.js.map +1 -0
- package/dist/modules/product_backend/client/attribute-modal.d.mts +62 -0
- package/dist/modules/product_backend/client/attribute-modal.d.mts.map +1 -0
- package/dist/modules/product_backend/client/attribute-modal.mjs +2 -0
- package/dist/modules/product_backend/client/attribute-modal.mjs.map +7 -0
- package/dist/modules/product_backend/client/product-modal.d.mts +45 -44
- package/dist/modules/product_backend/client/product-modal.d.mts.map +1 -1
- package/dist/modules/product_backend/client/product-modal.mjs +1 -1
- package/dist/modules/product_backend/client/product-modal.mjs.map +4 -4
- package/dist/modules/product_backend/client/product.css +262 -0
- package/dist/modules/product_backend/client/variant-editor.d.mts +16 -0
- package/dist/modules/product_backend/client/variant-editor.d.mts.map +1 -0
- package/dist/modules/product_backend/client/variant-editor.mjs +2 -0
- package/dist/modules/product_backend/client/variant-editor.mjs.map +7 -0
- package/dist/modules/product_backend/functions.d.ts +3 -0
- package/dist/modules/product_backend/functions.d.ts.map +1 -0
- package/dist/modules/product_backend/functions.js +29 -0
- package/dist/modules/product_backend/functions.js.map +1 -0
- package/dist/modules/product_backend/index.d.ts.map +1 -1
- package/dist/modules/product_backend/index.js +227 -5
- package/dist/modules/product_backend/index.js.map +1 -1
- package/dist/modules/product_backend/islands.d.ts +20 -0
- package/dist/modules/product_backend/islands.d.ts.map +1 -1
- package/dist/modules/product_backend/islands.js +25 -0
- package/dist/modules/product_backend/islands.js.map +1 -1
- package/dist/modules/product_backend/menus.d.ts.map +1 -1
- package/dist/modules/product_backend/menus.js +4 -5
- package/dist/modules/product_backend/menus.js.map +1 -1
- package/dist/modules/product_backend/modal/attribute-modal-view.d.ts +25 -0
- package/dist/modules/product_backend/modal/attribute-modal-view.d.ts.map +1 -0
- package/dist/modules/product_backend/modal/attribute-modal-view.js +180 -0
- package/dist/modules/product_backend/modal/attribute-modal-view.js.map +1 -0
- package/dist/modules/product_backend/modal/product-modal-view.d.ts +25 -6
- package/dist/modules/product_backend/modal/product-modal-view.d.ts.map +1 -1
- package/dist/modules/product_backend/modal/product-modal-view.js +334 -251
- package/dist/modules/product_backend/modal/product-modal-view.js.map +1 -1
- package/dist/modules/product_backend/routes.d.ts.map +1 -1
- package/dist/modules/product_backend/routes.js +159 -200
- package/dist/modules/product_backend/routes.js.map +1 -1
- package/dist/modules/product_backend/screens/attributes.d.ts +18 -4
- package/dist/modules/product_backend/screens/attributes.d.ts.map +1 -1
- package/dist/modules/product_backend/screens/attributes.js +71 -63
- package/dist/modules/product_backend/screens/attributes.js.map +1 -1
- package/dist/modules/product_backend/screens/list.d.ts +13 -7
- package/dist/modules/product_backend/screens/list.d.ts.map +1 -1
- package/dist/modules/product_backend/screens/list.js +38 -57
- package/dist/modules/product_backend/screens/list.js.map +1 -1
- package/dist/modules/product_media/functions.d.ts.map +1 -1
- package/dist/modules/product_media/functions.js +2 -0
- package/dist/modules/product_media/functions.js.map +1 -1
- package/dist/modules/purchase_backend/index.js +116 -208
- package/dist/modules/purchase_backend/index.js.map +1 -1
- package/dist/modules/purchase_backend/screens/order-list-shared.js +2 -2
- package/dist/modules/purchase_backend/screens/order-list-shared.js.map +1 -1
- package/dist/modules/purchase_backend/screens/purchase-orders-list.d.ts.map +1 -1
- package/dist/modules/purchase_backend/screens/purchase-orders-list.js +11 -13
- package/dist/modules/purchase_backend/screens/purchase-orders-list.js.map +1 -1
- package/dist/modules/purchase_backend/screens/rfqs-list.d.ts.map +1 -1
- package/dist/modules/purchase_backend/screens/rfqs-list.js +10 -15
- package/dist/modules/purchase_backend/screens/rfqs-list.js.map +1 -1
- package/dist/modules/purchase_backend/screens/vendor-pricelists-list.d.ts.map +1 -1
- package/dist/modules/purchase_backend/screens/vendor-pricelists-list.js +11 -21
- package/dist/modules/purchase_backend/screens/vendor-pricelists-list.js.map +1 -1
- package/dist/modules/purchase_backend/search-functions.d.ts +4 -0
- package/dist/modules/purchase_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/purchase_backend/search-functions.js +9 -0
- package/dist/modules/purchase_backend/search-functions.js.map +1 -0
- package/dist/modules/purchase_backend/search.d.ts +128 -0
- package/dist/modules/purchase_backend/search.d.ts.map +1 -0
- package/dist/modules/purchase_backend/search.js +106 -0
- package/dist/modules/purchase_backend/search.js.map +1 -0
- package/dist/modules/sale_backend/index.js +83 -32
- package/dist/modules/sale_backend/index.js.map +1 -1
- package/dist/modules/sale_backend/order-collection.d.ts +7 -0
- package/dist/modules/sale_backend/order-collection.d.ts.map +1 -0
- package/dist/modules/sale_backend/order-collection.js +27 -0
- package/dist/modules/sale_backend/order-collection.js.map +1 -0
- package/dist/modules/sale_backend/screens/invoicing-policies-list.d.ts.map +1 -1
- package/dist/modules/sale_backend/screens/invoicing-policies-list.js +10 -14
- package/dist/modules/sale_backend/screens/invoicing-policies-list.js.map +1 -1
- package/dist/modules/sale_backend/screens/overview.js +2 -2
- package/dist/modules/sale_backend/screens/overview.js.map +1 -1
- package/dist/modules/sale_backend/screens/quotations-list.d.ts.map +1 -1
- package/dist/modules/sale_backend/screens/quotations-list.js +12 -23
- package/dist/modules/sale_backend/screens/quotations-list.js.map +1 -1
- package/dist/modules/sale_backend/screens/sales-orders-list.d.ts.map +1 -1
- package/dist/modules/sale_backend/screens/sales-orders-list.js +11 -20
- package/dist/modules/sale_backend/screens/sales-orders-list.js.map +1 -1
- package/dist/modules/sale_backend/search-functions.d.ts +4 -0
- package/dist/modules/sale_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/sale_backend/search-functions.js +9 -0
- package/dist/modules/sale_backend/search-functions.js.map +1 -0
- package/dist/modules/sale_backend/search.d.ts +146 -0
- package/dist/modules/sale_backend/search.d.ts.map +1 -0
- package/dist/modules/sale_backend/search.js +112 -0
- package/dist/modules/sale_backend/search.js.map +1 -0
- package/dist/modules/stock_backend/functions.d.ts +10 -0
- package/dist/modules/stock_backend/functions.d.ts.map +1 -0
- package/dist/modules/stock_backend/functions.js +19 -0
- package/dist/modules/stock_backend/functions.js.map +1 -0
- package/dist/modules/stock_backend/index.js +33 -10
- package/dist/modules/stock_backend/index.js.map +1 -1
- package/dist/modules/stock_backend/routes.d.ts.map +1 -1
- package/dist/modules/stock_backend/routes.js +168 -59
- package/dist/modules/stock_backend/routes.js.map +1 -1
- package/dist/modules/stock_backend/screens/locations-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/locations-list.js +11 -22
- package/dist/modules/stock_backend/screens/locations-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/lots-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/lots-list.js +11 -13
- package/dist/modules/stock_backend/screens/lots-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/picking-types-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/picking-types-list.js +11 -22
- package/dist/modules/stock_backend/screens/picking-types-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/replenishment-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/replenishment-list.js +11 -22
- package/dist/modules/stock_backend/screens/replenishment-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/stock-routes-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/stock-routes-list.js +12 -23
- package/dist/modules/stock_backend/screens/stock-routes-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/transfers-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/transfers-list.js +12 -23
- package/dist/modules/stock_backend/screens/transfers-list.js.map +1 -1
- package/dist/modules/stock_backend/screens/warehouses-list.d.ts.map +1 -1
- package/dist/modules/stock_backend/screens/warehouses-list.js +11 -22
- package/dist/modules/stock_backend/screens/warehouses-list.js.map +1 -1
- package/dist/modules/stock_backend/search.d.ts +257 -0
- package/dist/modules/stock_backend/search.d.ts.map +1 -0
- package/dist/modules/stock_backend/search.js +349 -0
- package/dist/modules/stock_backend/search.js.map +1 -0
- package/dist/modules/storage/functions.d.ts.map +1 -1
- package/dist/modules/storage/functions.js +28 -5
- package/dist/modules/storage/functions.js.map +1 -1
- package/dist/modules/storage/jobs.d.ts.map +1 -1
- package/dist/modules/storage/jobs.js +120 -2
- package/dist/modules/storage/jobs.js.map +1 -1
- package/dist/modules/storage/models.d.ts.map +1 -1
- package/dist/modules/storage/models.js +21 -0
- package/dist/modules/storage/models.js.map +1 -1
- package/dist/modules/storage/policy.d.ts +27 -0
- package/dist/modules/storage/policy.d.ts.map +1 -1
- package/dist/modules/storage/policy.js +14 -0
- package/dist/modules/storage/policy.js.map +1 -1
- package/dist/modules/storage/routes.d.ts +1 -0
- package/dist/modules/storage/routes.d.ts.map +1 -1
- package/dist/modules/storage/routes.js +36 -10
- package/dist/modules/storage/routes.js.map +1 -1
- package/dist/modules/user/access-denial.d.ts +3 -0
- package/dist/modules/user/access-denial.d.ts.map +1 -0
- package/dist/modules/user/access-denial.js +34 -0
- package/dist/modules/user/access-denial.js.map +1 -0
- package/dist/modules/user/access-policy.d.ts +16 -0
- package/dist/modules/user/access-policy.d.ts.map +1 -0
- package/dist/modules/user/access-policy.js +455 -0
- package/dist/modules/user/access-policy.js.map +1 -0
- package/dist/modules/user/access-surfaces.d.ts +26 -0
- package/dist/modules/user/access-surfaces.d.ts.map +1 -0
- package/dist/modules/user/access-surfaces.js +76 -0
- package/dist/modules/user/access-surfaces.js.map +1 -0
- package/dist/modules/user/authorization.d.ts +12 -1
- package/dist/modules/user/authorization.d.ts.map +1 -1
- package/dist/modules/user/authorization.js +342 -36
- package/dist/modules/user/authorization.js.map +1 -1
- package/dist/modules/user/functions.d.ts.map +1 -1
- package/dist/modules/user/functions.js +26 -3
- package/dist/modules/user/functions.js.map +1 -1
- package/dist/modules/user/index.d.ts.map +1 -1
- package/dist/modules/user/index.js +13 -1
- package/dist/modules/user/index.js.map +1 -1
- package/dist/modules/user/modal-labels.d.ts +3 -0
- package/dist/modules/user/modal-labels.d.ts.map +1 -0
- package/dist/modules/user/modal-labels.js +30 -0
- package/dist/modules/user/modal-labels.js.map +1 -0
- package/dist/modules/user/modal-messages.d.ts +4 -0
- package/dist/modules/user/modal-messages.d.ts.map +1 -0
- package/dist/modules/user/modal-messages.js +15 -0
- package/dist/modules/user/modal-messages.js.map +1 -0
- package/dist/modules/user/models.d.ts.map +1 -1
- package/dist/modules/user/models.js +48 -0
- package/dist/modules/user/models.js.map +1 -1
- package/dist/modules/user/permission-areas.d.ts +20 -0
- package/dist/modules/user/permission-areas.d.ts.map +1 -0
- package/dist/modules/user/permission-areas.js +89 -0
- package/dist/modules/user/permission-areas.js.map +1 -0
- package/dist/modules/user/policy-jobs.d.ts +4 -0
- package/dist/modules/user/policy-jobs.d.ts.map +1 -0
- package/dist/modules/user/policy-jobs.js +15 -0
- package/dist/modules/user/policy-jobs.js.map +1 -0
- package/dist/modules/user/role-modal-context.d.ts +3 -0
- package/dist/modules/user/role-modal-context.d.ts.map +1 -0
- package/dist/modules/user/role-modal-context.js +264 -0
- package/dist/modules/user/role-modal-context.js.map +1 -0
- package/dist/modules/user/roles.d.ts.map +1 -1
- package/dist/modules/user/roles.js +2 -0
- package/dist/modules/user/roles.js.map +1 -1
- package/dist/modules/user/user-modal-context.d.ts +5 -1
- package/dist/modules/user/user-modal-context.d.ts.map +1 -1
- package/dist/modules/user/user-modal-context.js +227 -31
- package/dist/modules/user/user-modal-context.js.map +1 -1
- package/dist/modules/user_backend/access-options.d.ts +25 -0
- package/dist/modules/user_backend/access-options.d.ts.map +1 -0
- package/dist/modules/user_backend/access-options.js +38 -0
- package/dist/modules/user_backend/access-options.js.map +1 -0
- package/dist/modules/user_backend/access-policy-routes.d.ts +3 -0
- package/dist/modules/user_backend/access-policy-routes.d.ts.map +1 -0
- package/dist/modules/user_backend/access-policy-routes.js +76 -0
- package/dist/modules/user_backend/access-policy-routes.js.map +1 -0
- package/dist/modules/user_backend/client/access-policy-modal.d.mts +123 -0
- package/dist/modules/user_backend/client/access-policy-modal.d.mts.map +1 -0
- package/dist/modules/user_backend/client/access-policy-modal.mjs +2 -0
- package/dist/modules/user_backend/client/access-policy-modal.mjs.map +7 -0
- package/dist/modules/user_backend/client/role-modal.d.mts +103 -0
- package/dist/modules/user_backend/client/role-modal.d.mts.map +1 -0
- package/dist/modules/user_backend/client/role-modal.mjs +2 -0
- package/dist/modules/user_backend/client/role-modal.mjs.map +7 -0
- package/dist/modules/user_backend/client/user-modal.d.mts +160 -7
- package/dist/modules/user_backend/client/user-modal.d.mts.map +1 -1
- package/dist/modules/user_backend/client/user-modal.mjs +1 -1
- package/dist/modules/user_backend/client/user-modal.mjs.map +4 -4
- package/dist/modules/user_backend/index.d.ts +2 -2
- package/dist/modules/user_backend/index.d.ts.map +1 -1
- package/dist/modules/user_backend/index.js +4 -2
- package/dist/modules/user_backend/index.js.map +1 -1
- package/dist/modules/user_backend/islands.d.ts +14 -1
- package/dist/modules/user_backend/islands.d.ts.map +1 -1
- package/dist/modules/user_backend/islands.js +11 -3
- package/dist/modules/user_backend/islands.js.map +1 -1
- package/dist/modules/user_backend/managed-role-routes.d.ts +3 -0
- package/dist/modules/user_backend/managed-role-routes.d.ts.map +1 -0
- package/dist/modules/user_backend/managed-role-routes.js +44 -0
- package/dist/modules/user_backend/managed-role-routes.js.map +1 -0
- package/dist/modules/user_backend/menus.d.ts.map +1 -1
- package/dist/modules/user_backend/menus.js +9 -7
- package/dist/modules/user_backend/menus.js.map +1 -1
- package/dist/modules/user_backend/messages.d.ts +510 -2
- package/dist/modules/user_backend/messages.d.ts.map +1 -1
- package/dist/modules/user_backend/messages.js +552 -44
- package/dist/modules/user_backend/messages.js.map +1 -1
- package/dist/modules/user_backend/modal/access-policy-modal-view.d.ts +43 -0
- package/dist/modules/user_backend/modal/access-policy-modal-view.d.ts.map +1 -0
- package/dist/modules/user_backend/modal/access-policy-modal-view.js +384 -0
- package/dist/modules/user_backend/modal/access-policy-modal-view.js.map +1 -0
- package/dist/modules/user_backend/modal/access-surfaces.d.ts +51 -0
- package/dist/modules/user_backend/modal/access-surfaces.d.ts.map +1 -0
- package/dist/modules/user_backend/modal/access-surfaces.js +138 -0
- package/dist/modules/user_backend/modal/access-surfaces.js.map +1 -0
- package/dist/modules/user_backend/modal/role-modal-view.d.ts +48 -0
- package/dist/modules/user_backend/modal/role-modal-view.d.ts.map +1 -0
- package/dist/modules/user_backend/modal/role-modal-view.js +488 -0
- package/dist/modules/user_backend/modal/role-modal-view.js.map +1 -0
- package/dist/modules/user_backend/modal/user-modal-view.d.ts +45 -0
- package/dist/modules/user_backend/modal/user-modal-view.d.ts.map +1 -1
- package/dist/modules/user_backend/modal/user-modal-view.js +1317 -71
- package/dist/modules/user_backend/modal/user-modal-view.js.map +1 -1
- package/dist/modules/user_backend/routes.d.ts.map +1 -1
- package/dist/modules/user_backend/routes.js +109 -571
- package/dist/modules/user_backend/routes.js.map +1 -1
- package/dist/modules/user_backend/screens/access-policies-list.d.ts +31 -0
- package/dist/modules/user_backend/screens/access-policies-list.d.ts.map +1 -0
- package/dist/modules/user_backend/screens/access-policies-list.js +54 -0
- package/dist/modules/user_backend/screens/access-policies-list.js.map +1 -0
- package/dist/modules/user_backend/screens/index.d.ts +1 -3
- package/dist/modules/user_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/user_backend/screens/index.js +2 -3
- package/dist/modules/user_backend/screens/index.js.map +1 -1
- package/dist/modules/user_backend/screens/roles-list.d.ts +9 -3
- package/dist/modules/user_backend/screens/roles-list.d.ts.map +1 -1
- package/dist/modules/user_backend/screens/roles-list.js +15 -23
- package/dist/modules/user_backend/screens/roles-list.js.map +1 -1
- package/dist/modules/user_backend/screens/users-list.d.ts +7 -5
- package/dist/modules/user_backend/screens/users-list.d.ts.map +1 -1
- package/dist/modules/user_backend/screens/users-list.js +29 -21
- package/dist/modules/user_backend/screens/users-list.js.map +1 -1
- package/dist/modules/user_backend/search-functions.d.ts +4 -0
- package/dist/modules/user_backend/search-functions.d.ts.map +1 -0
- package/dist/modules/user_backend/search-functions.js +13 -0
- package/dist/modules/user_backend/search-functions.js.map +1 -0
- package/dist/modules/user_backend/search.d.ts +128 -0
- package/dist/modules/user_backend/search.d.ts.map +1 -0
- package/dist/modules/user_backend/search.js +131 -0
- package/dist/modules/user_backend/search.js.map +1 -0
- package/dist/modules/website/cms.d.ts.map +1 -1
- package/dist/modules/website/cms.js +17 -7
- package/dist/modules/website/cms.js.map +1 -1
- package/dist/modules/website/customer.d.ts +61 -1
- package/dist/modules/website/customer.d.ts.map +1 -1
- package/dist/modules/website/customer.js +197 -15
- package/dist/modules/website/customer.js.map +1 -1
- package/dist/modules/website/index.d.ts.map +1 -1
- package/dist/modules/website/index.js +16 -2
- package/dist/modules/website/index.js.map +1 -1
- package/dist/modules/website/models.d.ts.map +1 -1
- package/dist/modules/website/models.js +15 -0
- package/dist/modules/website/models.js.map +1 -1
- package/dist/modules/website/publication.d.ts.map +1 -1
- package/dist/modules/website/publication.js +11 -5
- package/dist/modules/website/publication.js.map +1 -1
- package/dist/modules/website_backend/collection.d.ts +12 -0
- package/dist/modules/website_backend/collection.d.ts.map +1 -0
- package/dist/modules/website_backend/collection.js +17 -0
- package/dist/modules/website_backend/collection.js.map +1 -0
- package/dist/modules/website_backend/functions.d.ts +10 -0
- package/dist/modules/website_backend/functions.d.ts.map +1 -0
- package/dist/modules/website_backend/functions.js +37 -0
- package/dist/modules/website_backend/functions.js.map +1 -0
- package/dist/modules/website_backend/index.js +2 -0
- package/dist/modules/website_backend/index.js.map +1 -1
- package/dist/modules/website_backend/routes.d.ts.map +1 -1
- package/dist/modules/website_backend/routes.js +124 -29
- package/dist/modules/website_backend/routes.js.map +1 -1
- package/dist/modules/website_backend/screens/index.d.ts +4 -8
- package/dist/modules/website_backend/screens/index.d.ts.map +1 -1
- package/dist/modules/website_backend/screens/index.js +685 -666
- package/dist/modules/website_backend/screens/index.js.map +1 -1
- package/dist/modules/website_backend/screens/page-frame.d.ts +6 -3
- package/dist/modules/website_backend/screens/page-frame.d.ts.map +1 -1
- package/dist/modules/website_backend/screens/page-frame.js +3 -3
- package/dist/modules/website_backend/screens/page-frame.js.map +1 -1
- package/dist/modules/website_backend/search.d.ts +125 -0
- package/dist/modules/website_backend/search.d.ts.map +1 -0
- package/dist/modules/website_backend/search.js +135 -0
- package/dist/modules/website_backend/search.js.map +1 -0
- package/dist/permission-catalogue.d.ts.map +1 -1
- package/dist/permission-catalogue.js +178 -24
- package/dist/permission-catalogue.js.map +1 -1
- package/dist/phone.d.ts +32 -0
- package/dist/phone.d.ts.map +1 -0
- package/dist/phone.js +101 -0
- package/dist/phone.js.map +1 -0
- package/dist/role-templates.d.ts +79 -0
- package/dist/role-templates.d.ts.map +1 -0
- package/dist/role-templates.js +192 -0
- package/dist/role-templates.js.map +1 -0
- package/dist/scaffold/index.d.ts +1 -1
- package/dist/scaffold/index.d.ts.map +1 -1
- package/dist/scaffold/index.js +10 -5
- package/dist/scaffold/index.js.map +1 -1
- package/dist/scaffold/templates/README.md.tmpl +2 -1
- package/dist/scaffold/templates/ket.workspace.mjs.tmpl +4 -1
- package/dist/scaffold/templates/package.json.tmpl +2 -2
- package/dist/ui/actions.d.ts +2 -0
- package/dist/ui/actions.d.ts.map +1 -1
- package/dist/ui/actions.js +1 -1
- package/dist/ui/actions.js.map +1 -1
- package/dist/ui/chrome.d.ts +19 -6
- package/dist/ui/chrome.d.ts.map +1 -1
- package/dist/ui/chrome.js +12 -7
- package/dist/ui/chrome.js.map +1 -1
- package/dist/ui/client/bulk-selection.d.ts +7 -0
- package/dist/ui/client/bulk-selection.d.ts.map +1 -0
- package/dist/ui/client/bulk-selection.js +67 -0
- package/dist/ui/client/bulk-selection.js.map +1 -0
- package/dist/ui/client/ket-table-view.d.ts +3 -0
- package/dist/ui/client/ket-table-view.d.ts.map +1 -0
- package/dist/ui/client/ket-table-view.js +27 -0
- package/dist/ui/client/ket-table-view.js.map +1 -0
- package/dist/ui/client/live-doc-shell.d.ts +39 -1
- package/dist/ui/client/live-doc-shell.d.ts.map +1 -1
- package/dist/ui/client/live-doc-shell.js +41 -2
- package/dist/ui/client/live-doc-shell.js.map +1 -1
- package/dist/ui/client/live-doc-view.d.ts +29 -1
- package/dist/ui/client/live-doc-view.d.ts.map +1 -1
- package/dist/ui/client/live-doc-view.js +138 -4
- package/dist/ui/client/live-doc-view.js.map +1 -1
- package/dist/ui/client/live-doc.d.mts +8 -4
- package/dist/ui/client/live-doc.d.mts.map +1 -1
- package/dist/ui/client/live-doc.mjs +10 -10
- package/dist/ui/client/live-doc.mjs.map +3 -3
- package/dist/ui/client/record-modal-form.d.ts +34 -0
- package/dist/ui/client/record-modal-form.d.ts.map +1 -1
- package/dist/ui/client/record-modal-form.js +17 -1
- package/dist/ui/client/record-modal-form.js.map +1 -1
- package/dist/ui/client/record-modal.d.ts +56 -6
- package/dist/ui/client/record-modal.d.ts.map +1 -1
- package/dist/ui/client/record-modal.js +235 -39
- package/dist/ui/client/record-modal.js.map +1 -1
- package/dist/ui/client/search-filter-view.d.ts +2 -0
- package/dist/ui/client/search-filter-view.d.ts.map +1 -0
- package/dist/ui/client/search-filter-view.js +6 -0
- package/dist/ui/client/search-filter-view.js.map +1 -0
- package/dist/ui/client/table-selection-view.d.ts.map +1 -1
- package/dist/ui/client/table-selection-view.js +33 -16
- package/dist/ui/client/table-selection-view.js.map +1 -1
- package/dist/ui/client/user-modal-client.d.ts +6 -0
- package/dist/ui/client/user-modal-client.d.ts.map +1 -0
- package/dist/ui/client/user-modal-client.js +4 -0
- package/dist/ui/client/user-modal-client.js.map +1 -0
- package/dist/ui/client/user-workflow.d.ts.map +1 -1
- package/dist/ui/client/user-workflow.js +4 -3
- package/dist/ui/client/user-workflow.js.map +1 -1
- package/dist/ui/client/variant-attribute-create.d.ts +19 -0
- package/dist/ui/client/variant-attribute-create.d.ts.map +1 -0
- package/dist/ui/client/variant-attribute-create.js +177 -0
- package/dist/ui/client/variant-attribute-create.js.map +1 -0
- package/dist/ui/client/variant-editor-view.d.ts +72 -0
- package/dist/ui/client/variant-editor-view.d.ts.map +1 -0
- package/dist/ui/client/variant-editor-view.js +943 -0
- package/dist/ui/client/variant-editor-view.js.map +1 -0
- package/dist/ui/collection-state.d.ts +11 -0
- package/dist/ui/collection-state.d.ts.map +1 -0
- package/dist/ui/collection-state.js +45 -0
- package/dist/ui/collection-state.js.map +1 -0
- package/dist/ui/collection.d.ts +23 -0
- package/dist/ui/collection.d.ts.map +1 -0
- package/dist/ui/collection.js +118 -0
- package/dist/ui/collection.js.map +1 -0
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +1 -1
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/index.d.ts +3 -1
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +3 -1
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/layout.d.ts +6 -7
- package/dist/ui/layout.d.ts.map +1 -1
- package/dist/ui/layout.js +25 -10
- package/dist/ui/layout.js.map +1 -1
- package/dist/ui/list-page.d.ts +4 -2
- package/dist/ui/list-page.d.ts.map +1 -1
- package/dist/ui/list-page.js +29 -4
- package/dist/ui/list-page.js.map +1 -1
- package/dist/ui/nav.d.ts +2 -3
- package/dist/ui/nav.d.ts.map +1 -1
- package/dist/ui/nav.js +4 -8
- package/dist/ui/nav.js.map +1 -1
- package/dist/ui/navigation.d.ts +1 -0
- package/dist/ui/navigation.d.ts.map +1 -1
- package/dist/ui/navigation.js +3 -3
- package/dist/ui/navigation.js.map +1 -1
- package/dist/ui/table.d.ts +2 -0
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +24 -0
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/user-workflow.d.ts +2 -1
- package/dist/ui/user-workflow.d.ts.map +1 -1
- package/dist/ui/user-workflow.js +44 -29
- package/dist/ui/user-workflow.js.map +1 -1
- package/package.json +14 -4
- package/dist/modules/user_backend/access-routes.d.ts +0 -31
- package/dist/modules/user_backend/access-routes.d.ts.map +0 -1
- package/dist/modules/user_backend/access-routes.js +0 -447
- package/dist/modules/user_backend/access-routes.js.map +0 -1
- package/dist/modules/user_backend/screens/presets-form.d.ts +0 -16
- package/dist/modules/user_backend/screens/presets-form.d.ts.map +0 -1
- package/dist/modules/user_backend/screens/presets-form.js +0 -37
- package/dist/modules/user_backend/screens/presets-form.js.map +0 -1
- package/dist/modules/user_backend/screens/role-form.d.ts +0 -21
- package/dist/modules/user_backend/screens/role-form.d.ts.map +0 -1
- package/dist/modules/user_backend/screens/role-form.js +0 -93
- package/dist/modules/user_backend/screens/role-form.js.map +0 -1
- package/dist/modules/user_backend/screens/user-form.d.ts +0 -56
- package/dist/modules/user_backend/screens/user-form.d.ts.map +0 -1
- package/dist/modules/user_backend/screens/user-form.js +0 -202
- package/dist/modules/user_backend/screens/user-form.js.map +0 -1
- package/dist/ui/client/relation-select-view.d.ts +0 -77
- package/dist/ui/client/relation-select-view.d.ts.map +0 -1
- package/dist/ui/client/relation-select-view.js +0 -216
- package/dist/ui/client/relation-select-view.js.map +0 -1
|
@@ -0,0 +1,943 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@ketvietlab/ketjs-view/jsx-runtime";
|
|
2
|
+
// The attributes-and-variants editor, as an island inside the product template modal.
|
|
3
|
+
//
|
|
4
|
+
// One editable copy of the template's setup lives here — attribute lines with their
|
|
5
|
+
// values and price extras on top, variant rows below — and nothing reaches the
|
|
6
|
+
// server until "Save", which sends the whole copy to `product.saveVariantSetup` in
|
|
7
|
+
// one call. The record modal's own views are render-pure and re-read their context
|
|
8
|
+
// after every command; a setup that is half-edited across two dozen controls needs
|
|
9
|
+
// state that survives a keystroke, which is what an island is for.
|
|
10
|
+
//
|
|
11
|
+
// The tab reads as two steps: pick attributes and tick the values this product is
|
|
12
|
+
// sold in, then turn the missing combinations into variant rows and fill them in.
|
|
13
|
+
// Every control is a design-system one; the island listens once on its root and
|
|
14
|
+
// routes by control name (`values|…`, `extra|…`, `combo|…`, `field|…`) or by the
|
|
15
|
+
// `variantAction` button value, so no control needs its own handler.
|
|
16
|
+
//
|
|
17
|
+
// It lives in the kit because it writes markup (tools/ui-audit.ts); the product
|
|
18
|
+
// module only supplies the setup, the labels and whether the viewer may save.
|
|
19
|
+
import { each, effect, signal } from '@ketvietlab/ketjs-view';
|
|
20
|
+
import { Badge, Button, CheckboxGroup, createLightbox, createRelationSelectView, Disclosure, EmptyState, DropZone, Field, IconButton, LightboxThumb, MoneyField, Notice, Section, Select, TextField, } from '@ketvietlab/design-system';
|
|
21
|
+
import { icon } from '../icons.js';
|
|
22
|
+
import { callRecordFunction } from './record-modal.js';
|
|
23
|
+
import { createVariantAttributeForm } from './variant-attribute-create.js';
|
|
24
|
+
/** The name every action button shares; its value says which action and on what. */
|
|
25
|
+
const ACTION = 'variantAction';
|
|
26
|
+
const clone = (value) => JSON.parse(JSON.stringify(value));
|
|
27
|
+
const label = (labels, key, params = {}) => (labels[key] ?? key).replace(/\{(\w+)\}/g, (_, name) => String(params[name] ?? `{${name}}`));
|
|
28
|
+
/** The stored file at a rendition size; the original is served until the render job made it. */
|
|
29
|
+
const imageUrl = (attachmentId, size) => `/files/${encodeURIComponent(attachmentId)}?size=${size}`;
|
|
30
|
+
const IMAGE_TYPES = 'image/avif,image/gif,image/jpeg,image/png,image/webp';
|
|
31
|
+
const money = (amount) => (Number.isFinite(amount) ? amount.toLocaleString('vi-VN') : '—');
|
|
32
|
+
const decimal = (value) => {
|
|
33
|
+
const amount = Number(value);
|
|
34
|
+
return Number.isFinite(amount) ? amount : 0;
|
|
35
|
+
};
|
|
36
|
+
const isDecimal = (value) => /^-?\d+(\.\d+)?$/.test(value.trim());
|
|
37
|
+
const signed = (value) => {
|
|
38
|
+
if (!isDecimal(value))
|
|
39
|
+
return value.trim() || '?';
|
|
40
|
+
const amount = decimal(value);
|
|
41
|
+
return `${amount > 0 ? '+' : ''}${money(amount)}`;
|
|
42
|
+
};
|
|
43
|
+
/** How many combinations the "missing" notice names before summing up the rest. */
|
|
44
|
+
const PREVIEW = 3;
|
|
45
|
+
let rowSequence = 0;
|
|
46
|
+
const toRows = (variants) => variants.map((variant) => ({ ...variant, valueIds: { ...variant.valueIds }, key: variant.id, open: false }));
|
|
47
|
+
export function createVariantEditorView(props) {
|
|
48
|
+
const labels = props.labels;
|
|
49
|
+
const t = (key, params) => label(labels, key, params);
|
|
50
|
+
const editable = props.editable;
|
|
51
|
+
let saved = clone(props.setup);
|
|
52
|
+
const listPrice = signal(saved.listPrice);
|
|
53
|
+
const catalogue = signal(saved.catalogue);
|
|
54
|
+
const lines = signal(clone(saved.lines));
|
|
55
|
+
const rows = signal(toRows(saved.variants));
|
|
56
|
+
/** Attribute lines whose price-extra disclosure the user opened. */
|
|
57
|
+
const openExtras = signal([]);
|
|
58
|
+
const saving = signal(false);
|
|
59
|
+
const problem = signal(null);
|
|
60
|
+
const rowIssues = signal({});
|
|
61
|
+
const notice = signal(null);
|
|
62
|
+
const dirty = signal(false);
|
|
63
|
+
/** The row whose image is uploading or being removed, and the one a file is dragged over. */
|
|
64
|
+
const imageBusy = signal(null);
|
|
65
|
+
const dragOver = signal(null);
|
|
66
|
+
const viewer = createLightbox(props.lightboxLabels, props.id);
|
|
67
|
+
let host = null;
|
|
68
|
+
let disposed = false;
|
|
69
|
+
const touch = () => {
|
|
70
|
+
dirty.set(true);
|
|
71
|
+
notice.set(null);
|
|
72
|
+
};
|
|
73
|
+
const setLines = (next) => {
|
|
74
|
+
lines.set(next);
|
|
75
|
+
touch();
|
|
76
|
+
};
|
|
77
|
+
const setRows = (next) => {
|
|
78
|
+
rows.set(next);
|
|
79
|
+
touch();
|
|
80
|
+
};
|
|
81
|
+
const updateRow = (key, patch) => setRows(rows().map((row) => (row.key === key ? { ...row, ...patch } : row)));
|
|
82
|
+
const rowOf = (key) => rows().find((row) => row.key === key);
|
|
83
|
+
/** Moves focus once the render that follows a change has landed. */
|
|
84
|
+
const focusSoon = (selector, fallback) => {
|
|
85
|
+
setTimeout(() => {
|
|
86
|
+
if (disposed || !host)
|
|
87
|
+
return;
|
|
88
|
+
const target = host.querySelector(selector) ??
|
|
89
|
+
(fallback ? host.querySelector(fallback) : null);
|
|
90
|
+
target?.focus();
|
|
91
|
+
}, 0);
|
|
92
|
+
};
|
|
93
|
+
const pickerTrigger = `[id="${props.id}-attribute-picker"] button`;
|
|
94
|
+
const actionButton = (value) => `button[name="${ACTION}"][value="${value}"]`;
|
|
95
|
+
// ── Derived ──
|
|
96
|
+
const variantLines = () => lines().filter((line) => line.createVariant !== 'no_variant' && line.values.length > 0);
|
|
97
|
+
const combinationOf = (row) => {
|
|
98
|
+
const picked = [];
|
|
99
|
+
for (const line of variantLines()) {
|
|
100
|
+
const valueId = row.valueIds[line.attributeId];
|
|
101
|
+
if (!valueId || !line.values.some((value) => value.valueId === valueId))
|
|
102
|
+
return null;
|
|
103
|
+
picked.push(valueId);
|
|
104
|
+
}
|
|
105
|
+
return picked.join(',');
|
|
106
|
+
};
|
|
107
|
+
/** Rows sharing a combination, by row key → the other row's position (1-based). */
|
|
108
|
+
const duplicates = () => {
|
|
109
|
+
const seen = new Map();
|
|
110
|
+
const clash = new Map();
|
|
111
|
+
rows().forEach((row, index) => {
|
|
112
|
+
if (!row.active)
|
|
113
|
+
return;
|
|
114
|
+
const combination = combinationOf(row);
|
|
115
|
+
if (combination == null)
|
|
116
|
+
return;
|
|
117
|
+
const first = seen.get(combination);
|
|
118
|
+
if (first === undefined)
|
|
119
|
+
seen.set(combination, index);
|
|
120
|
+
else {
|
|
121
|
+
clash.set(row.key, first + 1);
|
|
122
|
+
clash.set(rows()[first].key, index + 1);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return clash;
|
|
126
|
+
};
|
|
127
|
+
const incomplete = () => new Set(rows()
|
|
128
|
+
.filter((row) => row.active && combinationOf(row) == null)
|
|
129
|
+
.map((row) => row.key));
|
|
130
|
+
const extraOf = (row) => variantLines().flatMap((line) => {
|
|
131
|
+
const value = line.values.find((entry) => entry.valueId === row.valueIds[line.attributeId]);
|
|
132
|
+
return value ? [{ line, value }] : [];
|
|
133
|
+
});
|
|
134
|
+
const priceOf = (row) => extraOf(row).reduce((total, { value }) => total + decimal(value.priceExtra), decimal(listPrice()));
|
|
135
|
+
const missingCombinations = () => {
|
|
136
|
+
const groups = variantLines();
|
|
137
|
+
if (!groups.length)
|
|
138
|
+
return [];
|
|
139
|
+
const all = groups.reduce((acc, line) => acc.flatMap((prefix) => line.values.map((value) => ({ ...prefix, [line.attributeId]: value.valueId }))), [{}]);
|
|
140
|
+
const taken = new Set(rows()
|
|
141
|
+
.filter((row) => row.active)
|
|
142
|
+
.map(combinationOf)
|
|
143
|
+
.filter((key) => key != null));
|
|
144
|
+
return all.filter((valueIds) => !taken.has(groups.map((line) => valueIds[line.attributeId]).join(',')));
|
|
145
|
+
};
|
|
146
|
+
/** A combination as it reads in a row title: "Đỏ / 50 ml", or what is still to choose. */
|
|
147
|
+
const combinationLabel = (valueIds) => variantLines().length
|
|
148
|
+
? variantLines()
|
|
149
|
+
.map((line) => line.values.find((value) => value.valueId === valueIds[line.attributeId])?.name ??
|
|
150
|
+
t('choose', { name: line.name }))
|
|
151
|
+
.join(' / ')
|
|
152
|
+
: t('defaultVariant');
|
|
153
|
+
const usageOf = (attributeId, valueId) => rows().filter((row) => row.active && row.valueIds[attributeId] === valueId).length;
|
|
154
|
+
const invalidExtras = () => lines().some((line) => line.values.some((value) => !isDecimal(value.priceExtra)));
|
|
155
|
+
const rowInvalid = (row) => !isDecimal(row.weight) || !isDecimal(row.volume);
|
|
156
|
+
const invalidRows = () => rows().some(rowInvalid);
|
|
157
|
+
const blocked = () => !editable ||
|
|
158
|
+
saving() ||
|
|
159
|
+
attributeForm.open() ||
|
|
160
|
+
!dirty() ||
|
|
161
|
+
duplicates().size > 0 ||
|
|
162
|
+
incomplete().size > 0 ||
|
|
163
|
+
invalidExtras() ||
|
|
164
|
+
invalidRows();
|
|
165
|
+
/** Every value the line could hold: the catalogue's, then any the line keeps that it no longer lists. */
|
|
166
|
+
const optionsOf = (line) => {
|
|
167
|
+
const listed = catalogue().find((entry) => entry.attributeId === line.attributeId)?.values ?? [];
|
|
168
|
+
return [
|
|
169
|
+
...listed,
|
|
170
|
+
...line.values.filter((value) => !listed.some((entry) => entry.valueId === value.valueId)),
|
|
171
|
+
];
|
|
172
|
+
};
|
|
173
|
+
const firstValueOf = (attributeId) => `input[name="values|${attributeId}[]"]`;
|
|
174
|
+
const attributeForm = createVariantAttributeForm({
|
|
175
|
+
id: props.id,
|
|
176
|
+
kind: props.kind,
|
|
177
|
+
enabled: editable && props.createAttribute === true,
|
|
178
|
+
launcher: false,
|
|
179
|
+
returnFocus: () => host?.querySelector(pickerTrigger)?.focus(),
|
|
180
|
+
disabled: saving,
|
|
181
|
+
t,
|
|
182
|
+
added: (attribute) => {
|
|
183
|
+
catalogue.set([...catalogue(), attribute]);
|
|
184
|
+
// Reset discards the template draft, not the newly saved shared attribute.
|
|
185
|
+
saved.catalogue = [...saved.catalogue, attribute];
|
|
186
|
+
setLines([
|
|
187
|
+
...lines(),
|
|
188
|
+
{
|
|
189
|
+
attributeId: attribute.attributeId,
|
|
190
|
+
name: attribute.name,
|
|
191
|
+
createVariant: attribute.createVariant,
|
|
192
|
+
displayType: 'select',
|
|
193
|
+
values: attribute.values.map((value) => ({ ...value, priceExtra: '0' })),
|
|
194
|
+
},
|
|
195
|
+
]);
|
|
196
|
+
// After the form hands focus back to the picker: the next step is this line's values.
|
|
197
|
+
focusSoon(firstValueOf(attribute.attributeId));
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
// ── Attribute actions ──
|
|
201
|
+
const addLine = (attributeId) => {
|
|
202
|
+
const attribute = catalogue().find((entry) => entry.attributeId === attributeId);
|
|
203
|
+
if (!attribute)
|
|
204
|
+
return;
|
|
205
|
+
setLines([
|
|
206
|
+
...lines(),
|
|
207
|
+
{
|
|
208
|
+
attributeId,
|
|
209
|
+
name: attribute.name,
|
|
210
|
+
createVariant: attribute.createVariant,
|
|
211
|
+
displayType: 'select',
|
|
212
|
+
values: [],
|
|
213
|
+
},
|
|
214
|
+
]);
|
|
215
|
+
focusSoon(firstValueOf(attributeId), pickerTrigger);
|
|
216
|
+
};
|
|
217
|
+
const attributePicker = createRelationSelectView({
|
|
218
|
+
id: `${props.id}-attribute-picker`,
|
|
219
|
+
config: {
|
|
220
|
+
name: 'addAttributeId',
|
|
221
|
+
ariaLabel: t('addAttribute'),
|
|
222
|
+
options: [],
|
|
223
|
+
labels: { ...props.relationLabels, choose: t('addAttribute'), create: t('createAttribute') },
|
|
224
|
+
},
|
|
225
|
+
}, {
|
|
226
|
+
options: () => catalogue()
|
|
227
|
+
.filter((attribute) => !lines().some((line) => line.attributeId === attribute.attributeId))
|
|
228
|
+
.map((attribute) => ({
|
|
229
|
+
value: attribute.attributeId,
|
|
230
|
+
label: attribute.name,
|
|
231
|
+
description: attribute.values.map((value) => value.name).join(' · '),
|
|
232
|
+
})),
|
|
233
|
+
disabled: () => !editable || saving() || attributeForm.open(),
|
|
234
|
+
resetAfterSelect: true,
|
|
235
|
+
onSelect: (option) => addLine(option.value),
|
|
236
|
+
...(editable && props.createAttribute
|
|
237
|
+
? { onCreate: (query) => attributeForm.start(query) }
|
|
238
|
+
: {}),
|
|
239
|
+
});
|
|
240
|
+
const removeLine = (attributeId) => {
|
|
241
|
+
setLines(lines().filter((line) => line.attributeId !== attributeId));
|
|
242
|
+
setRows(rows().map((row) => {
|
|
243
|
+
const valueIds = { ...row.valueIds };
|
|
244
|
+
delete valueIds[attributeId];
|
|
245
|
+
return { ...row, valueIds };
|
|
246
|
+
}));
|
|
247
|
+
openExtras.set(openExtras().filter((id) => id !== attributeId));
|
|
248
|
+
focusSoon(pickerTrigger);
|
|
249
|
+
};
|
|
250
|
+
/** Ticks values on a line, in the catalogue's order; a value ticked again gets its saved extra back. */
|
|
251
|
+
const selectValues = (attributeId, valueIds) => {
|
|
252
|
+
const line = lines().find((entry) => entry.attributeId === attributeId);
|
|
253
|
+
if (!line)
|
|
254
|
+
return;
|
|
255
|
+
const options = optionsOf(line);
|
|
256
|
+
const adding = valueIds.filter((valueId) => !line.values.some((value) => value.valueId === valueId));
|
|
257
|
+
if (!adding.length)
|
|
258
|
+
return;
|
|
259
|
+
const savedLine = saved.lines.find((entry) => entry.attributeId === attributeId);
|
|
260
|
+
const added = adding.flatMap((valueId) => {
|
|
261
|
+
const option = options.find((entry) => entry.valueId === valueId);
|
|
262
|
+
if (!option)
|
|
263
|
+
return [];
|
|
264
|
+
const priceExtra = savedLine?.values.find((value) => value.valueId === valueId)?.priceExtra ?? '0';
|
|
265
|
+
return [{ valueId, name: option.name, priceExtra }];
|
|
266
|
+
});
|
|
267
|
+
const order = (valueId) => options.findIndex((entry) => entry.valueId === valueId);
|
|
268
|
+
setLines(lines().map((entry) => entry.attributeId === attributeId
|
|
269
|
+
? {
|
|
270
|
+
...entry,
|
|
271
|
+
values: [...entry.values, ...added].sort((a, b) => order(a.valueId) - order(b.valueId)),
|
|
272
|
+
}
|
|
273
|
+
: entry));
|
|
274
|
+
};
|
|
275
|
+
const removeValue = (attributeId, valueId) => setLines(lines().map((line) => line.attributeId === attributeId
|
|
276
|
+
? { ...line, values: line.values.filter((value) => value.valueId !== valueId) }
|
|
277
|
+
: line));
|
|
278
|
+
const setExtra = (attributeId, valueId, priceExtra) => setLines(lines().map((line) => line.attributeId === attributeId
|
|
279
|
+
? {
|
|
280
|
+
...line,
|
|
281
|
+
values: line.values.map((value) => value.valueId === valueId ? { ...value, priceExtra } : value),
|
|
282
|
+
}
|
|
283
|
+
: line));
|
|
284
|
+
// ── Variant actions ──
|
|
285
|
+
const newRow = (valueIds, open) => ({
|
|
286
|
+
id: '',
|
|
287
|
+
key: `new-${++rowSequence}`,
|
|
288
|
+
valueIds,
|
|
289
|
+
defaultCode: null,
|
|
290
|
+
barcode: null,
|
|
291
|
+
weight: '0',
|
|
292
|
+
volume: '0',
|
|
293
|
+
active: true,
|
|
294
|
+
images: [],
|
|
295
|
+
open,
|
|
296
|
+
});
|
|
297
|
+
const addRow = () => {
|
|
298
|
+
const row = newRow({}, true);
|
|
299
|
+
setRows([...rows(), row]);
|
|
300
|
+
focusSoon(`[name^="combo|${row.key}|"], [name="field|${row.key}|defaultCode"]`);
|
|
301
|
+
};
|
|
302
|
+
const generate = () => {
|
|
303
|
+
const created = missingCombinations().map((ids) => newRow(ids, false));
|
|
304
|
+
if (!created.length)
|
|
305
|
+
return;
|
|
306
|
+
setRows([...rows(), ...created]);
|
|
307
|
+
focusSoon(actionButton(`toggleRow|${created[0].key}`));
|
|
308
|
+
};
|
|
309
|
+
const toggleRow = (key) => {
|
|
310
|
+
rows.set(rows().map((row) => (row.key === key ? { ...row, open: !row.open } : row)));
|
|
311
|
+
};
|
|
312
|
+
const removeRow = (key) => {
|
|
313
|
+
const row = rowOf(key);
|
|
314
|
+
if (!row)
|
|
315
|
+
return;
|
|
316
|
+
// An unsaved row simply goes away; a saved one is archived on save, since it
|
|
317
|
+
// may already be on documents this editor cannot see.
|
|
318
|
+
if (row.id) {
|
|
319
|
+
updateRow(key, { active: !row.active });
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
const index = rows().indexOf(row);
|
|
323
|
+
const next = rows()[index + 1] ?? rows()[index - 1];
|
|
324
|
+
setRows(rows().filter((entry) => entry.key !== key));
|
|
325
|
+
focusSoon(next ? actionButton(`toggleRow|${next.key}`) : actionButton('addRow'), actionButton('generate'));
|
|
326
|
+
};
|
|
327
|
+
const setAllActive = (active) => {
|
|
328
|
+
setRows(rows()
|
|
329
|
+
.filter((row) => row.id || active)
|
|
330
|
+
.map((row) => ({ ...row, active })));
|
|
331
|
+
focusSoon(actionButton(active ? 'archiveAll' : 'activateAll'), actionButton('addRow'));
|
|
332
|
+
};
|
|
333
|
+
// ── Images ──
|
|
334
|
+
// An image is not part of the setup Save sends: it is stored and linked the moment
|
|
335
|
+
// it is chosen, like the template's own main image, so it needs a saved variant.
|
|
336
|
+
/** Replace a row's images here and in the saved copy, so Reset does not bring the old ones back. */
|
|
337
|
+
const setImages = (row, images) => {
|
|
338
|
+
rows.set(rows().map((entry) => (entry.key === row.key ? { ...entry, images } : entry)));
|
|
339
|
+
saved = {
|
|
340
|
+
...saved,
|
|
341
|
+
variants: saved.variants.map((variant) => (variant.id === row.id ? { ...variant, images } : variant)),
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
const uploadImage = async (row, file) => {
|
|
345
|
+
const replacing = row.images.length > 0;
|
|
346
|
+
if (!row.id || !props.media.upload || (replacing && !props.media.remove))
|
|
347
|
+
return;
|
|
348
|
+
if (imageBusy() || !file.type.startsWith('image/'))
|
|
349
|
+
return;
|
|
350
|
+
imageBusy.set(row.key);
|
|
351
|
+
problem.set(null);
|
|
352
|
+
try {
|
|
353
|
+
const body = new FormData();
|
|
354
|
+
body.append('resModel', 'product.Product');
|
|
355
|
+
body.append('resId', row.id);
|
|
356
|
+
body.append('resField', 'media');
|
|
357
|
+
body.append('public', 'false');
|
|
358
|
+
body.append('file', file, file.name);
|
|
359
|
+
const response = await fetch('/files', { method: 'POST', credentials: 'same-origin', body });
|
|
360
|
+
const stored = (await response.json().catch(() => null));
|
|
361
|
+
if (!response.ok || typeof stored?.id !== 'string')
|
|
362
|
+
throw new Error(t('imageFailed'));
|
|
363
|
+
const attached = await callRecordFunction('product_media.attachMedia', {
|
|
364
|
+
id: stored.id,
|
|
365
|
+
attachmentId: stored.id,
|
|
366
|
+
productId: row.id,
|
|
367
|
+
alt: file.name,
|
|
368
|
+
primary: true,
|
|
369
|
+
});
|
|
370
|
+
if (!attached.ok)
|
|
371
|
+
throw new Error(attached.message ?? attached.issues[0]?.message ?? t('imageFailed'));
|
|
372
|
+
const previous = row.images.find((image) => image.primary);
|
|
373
|
+
if (previous)
|
|
374
|
+
await callRecordFunction('product_media.removeMedia', { id: previous.mediaId });
|
|
375
|
+
setImages(row, [
|
|
376
|
+
{ mediaId: stored.id, attachmentId: stored.id, alt: file.name, primary: true },
|
|
377
|
+
...row.images.filter((image) => image !== previous),
|
|
378
|
+
]);
|
|
379
|
+
document.dispatchEvent(new CustomEvent('ket:records-changed', { detail: { kind: props.kind, ids: [saved.templateId] } }));
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
problem.set(error instanceof Error ? error.message : t('imageFailed'));
|
|
383
|
+
}
|
|
384
|
+
finally {
|
|
385
|
+
imageBusy.set(null);
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
const removeImage = async (row) => {
|
|
389
|
+
const current = row.images[0];
|
|
390
|
+
if (!current || !props.media.remove || imageBusy())
|
|
391
|
+
return;
|
|
392
|
+
if (!globalThis.confirm(t('imageRemoveConfirm')))
|
|
393
|
+
return;
|
|
394
|
+
imageBusy.set(row.key);
|
|
395
|
+
problem.set(null);
|
|
396
|
+
const result = await callRecordFunction('product_media.removeMedia', { id: current.mediaId }).catch(() => null);
|
|
397
|
+
imageBusy.set(null);
|
|
398
|
+
if (!result?.ok) {
|
|
399
|
+
problem.set(result && !result.ok ? (result.message ?? t('saveFailed')) : t('saveFailed'));
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const rest = row.images.slice(1);
|
|
403
|
+
// The gallery promotes the next image to primary; mirror that here.
|
|
404
|
+
setImages(row, rest.map((image, index) => ({ ...image, primary: index === 0 })));
|
|
405
|
+
};
|
|
406
|
+
const openImages = (row, trigger) => viewer.open(row.images.map((image) => ({
|
|
407
|
+
src: imageUrl(image.attachmentId, 'large'),
|
|
408
|
+
thumbnail: imageUrl(image.attachmentId, 'thumb'),
|
|
409
|
+
alt: image.alt || t('image'),
|
|
410
|
+
caption: image.alt,
|
|
411
|
+
})), 0, trigger);
|
|
412
|
+
const reset = () => {
|
|
413
|
+
listPrice.set(saved.listPrice);
|
|
414
|
+
catalogue.set(saved.catalogue);
|
|
415
|
+
lines.set(clone(saved.lines));
|
|
416
|
+
rows.set(toRows(saved.variants));
|
|
417
|
+
rowIssues.set({});
|
|
418
|
+
problem.set(null);
|
|
419
|
+
dirty.set(false);
|
|
420
|
+
};
|
|
421
|
+
const save = async () => {
|
|
422
|
+
if (blocked())
|
|
423
|
+
return;
|
|
424
|
+
saving.set(true);
|
|
425
|
+
problem.set(null);
|
|
426
|
+
rowIssues.set({});
|
|
427
|
+
const snapshot = rows();
|
|
428
|
+
const result = await callRecordFunction(props.saveFunction, {
|
|
429
|
+
templateId: saved.templateId,
|
|
430
|
+
lines: lines().map((line) => ({
|
|
431
|
+
attributeId: line.attributeId,
|
|
432
|
+
values: line.values.map((value) => ({ valueId: value.valueId, priceExtra: value.priceExtra.trim() })),
|
|
433
|
+
})),
|
|
434
|
+
variants: snapshot.map((row) => ({
|
|
435
|
+
id: row.id || null,
|
|
436
|
+
valueIds: row.valueIds,
|
|
437
|
+
defaultCode: row.defaultCode,
|
|
438
|
+
barcode: row.barcode,
|
|
439
|
+
weight: row.weight,
|
|
440
|
+
volume: row.volume,
|
|
441
|
+
active: row.active,
|
|
442
|
+
})),
|
|
443
|
+
}).catch(() => null);
|
|
444
|
+
saving.set(false);
|
|
445
|
+
if (!result) {
|
|
446
|
+
problem.set(t('saveFailed'));
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (!result.ok) {
|
|
450
|
+
const byRow = {};
|
|
451
|
+
for (const issue of result.issues) {
|
|
452
|
+
const match = /^variants\.(\d+)(?:\.(\w+))?/.exec(issue.field ?? '');
|
|
453
|
+
const row = match ? snapshot[Number(match[1])] : undefined;
|
|
454
|
+
if (row)
|
|
455
|
+
byRow[row.key] = issue.message ?? issue.code;
|
|
456
|
+
}
|
|
457
|
+
rowIssues.set(byRow);
|
|
458
|
+
problem.set(result.message ?? result.issues[0]?.message ?? t('saveFailed'));
|
|
459
|
+
if (Object.keys(byRow).length)
|
|
460
|
+
rows.set(rows().map((row) => (byRow[row.key] ? { ...row, open: true } : row)));
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
const next = result.value.setup;
|
|
464
|
+
if (next)
|
|
465
|
+
saved = clone(next);
|
|
466
|
+
reset();
|
|
467
|
+
notice.set(t('saved', { created: result.value.created ?? 0, archived: result.value.archived ?? 0 }));
|
|
468
|
+
document.dispatchEvent(new CustomEvent('ket:records-changed', { detail: { kind: props.kind, ids: [saved.templateId] } }));
|
|
469
|
+
};
|
|
470
|
+
// ── Events ──
|
|
471
|
+
// Buttons: one name, the action in the value. Inputs: the name says what they edit.
|
|
472
|
+
const onClick = (event) => {
|
|
473
|
+
const button = event.target instanceof Element ? event.target.closest('button') : null;
|
|
474
|
+
if (!button || button.name !== ACTION || button.disabled || !editableAction(button.value))
|
|
475
|
+
return;
|
|
476
|
+
const [action, key = ''] = button.value.split('|');
|
|
477
|
+
if (action === 'toggleRow')
|
|
478
|
+
toggleRow(key);
|
|
479
|
+
else if (action === 'selectAll') {
|
|
480
|
+
const line = lines().find((entry) => entry.attributeId === key);
|
|
481
|
+
if (line)
|
|
482
|
+
selectValues(key, optionsOf(line).map((value) => value.valueId));
|
|
483
|
+
focusSoon(firstValueOf(key));
|
|
484
|
+
}
|
|
485
|
+
else if (action === 'removeLine')
|
|
486
|
+
removeLine(key);
|
|
487
|
+
else if (action === 'removeRow')
|
|
488
|
+
removeRow(key);
|
|
489
|
+
else if (action === 'generate')
|
|
490
|
+
generate();
|
|
491
|
+
else if (action === 'addRow')
|
|
492
|
+
addRow();
|
|
493
|
+
else if (action === 'activateAll')
|
|
494
|
+
setAllActive(true);
|
|
495
|
+
else if (action === 'archiveAll')
|
|
496
|
+
setAllActive(false);
|
|
497
|
+
else if (action === 'removeImage') {
|
|
498
|
+
const row = rowOf(key);
|
|
499
|
+
if (row)
|
|
500
|
+
void removeImage(row);
|
|
501
|
+
}
|
|
502
|
+
else if (action === 'reset') {
|
|
503
|
+
reset();
|
|
504
|
+
focusSoon(pickerTrigger);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
/** Opening and closing a row is reading, not editing; everything else needs the permission. */
|
|
508
|
+
const editableAction = (value) => value.startsWith('toggleRow|') || (editable && !saving());
|
|
509
|
+
const onChange = (event) => {
|
|
510
|
+
const control = event.target;
|
|
511
|
+
if (!editable || saving())
|
|
512
|
+
return;
|
|
513
|
+
if (control instanceof HTMLInputElement && control.type === 'checkbox') {
|
|
514
|
+
const match = /^values\|(.+)\[\]$/.exec(control.name);
|
|
515
|
+
if (!match)
|
|
516
|
+
return;
|
|
517
|
+
if (control.checked)
|
|
518
|
+
selectValues(match[1], [control.value]);
|
|
519
|
+
else
|
|
520
|
+
removeValue(match[1], control.value);
|
|
521
|
+
}
|
|
522
|
+
else if (control instanceof HTMLSelectElement) {
|
|
523
|
+
const [kind, key, attributeId] = control.name.split('|');
|
|
524
|
+
const row = kind === 'combo' && key ? rowOf(key) : undefined;
|
|
525
|
+
if (row && attributeId)
|
|
526
|
+
updateRow(row.key, { valueIds: { ...row.valueIds, [attributeId]: control.value } });
|
|
527
|
+
}
|
|
528
|
+
else if (control instanceof HTMLInputElement && control.type === 'file') {
|
|
529
|
+
const [kind, key] = control.name.split('|');
|
|
530
|
+
const row = kind === 'image' && key ? rowOf(key) : undefined;
|
|
531
|
+
const file = control.files?.[0];
|
|
532
|
+
control.value = '';
|
|
533
|
+
if (row && file)
|
|
534
|
+
void uploadImage(row, file);
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
const onInput = (event) => {
|
|
538
|
+
const control = event.target;
|
|
539
|
+
if (!editable || saving() || !(control instanceof HTMLInputElement))
|
|
540
|
+
return;
|
|
541
|
+
const [kind, key, name] = control.name.split('|');
|
|
542
|
+
if (!key || !name)
|
|
543
|
+
return;
|
|
544
|
+
if (kind === 'extra')
|
|
545
|
+
setExtra(key, name, control.value);
|
|
546
|
+
else if (kind === 'field' && ['defaultCode', 'barcode', 'weight', 'volume'].includes(name)) {
|
|
547
|
+
const decimalField = name === 'weight' || name === 'volume';
|
|
548
|
+
updateRow(key, { [name]: decimalField ? control.value : control.value || null });
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
/** The value a managed control should show, or undefined for controls this island does not own. */
|
|
552
|
+
const expectedValue = (name) => {
|
|
553
|
+
const [kind, key, name2] = name.split('|');
|
|
554
|
+
if (!key || !name2)
|
|
555
|
+
return undefined;
|
|
556
|
+
if (kind === 'extra')
|
|
557
|
+
return lines()
|
|
558
|
+
.find((line) => line.attributeId === key)
|
|
559
|
+
?.values.find((value) => value.valueId === name2)?.priceExtra;
|
|
560
|
+
const row = rowOf(key);
|
|
561
|
+
if (!row)
|
|
562
|
+
return undefined;
|
|
563
|
+
if (kind === 'combo')
|
|
564
|
+
return row.valueIds[name2] ?? '';
|
|
565
|
+
if (kind === 'field')
|
|
566
|
+
return String(row[name2] ?? '');
|
|
567
|
+
return undefined;
|
|
568
|
+
};
|
|
569
|
+
// The renderer writes attributes, which a control stops following once the user has
|
|
570
|
+
// touched it. After Reset, a failed save or an unticked value, bring the live state
|
|
571
|
+
// back in line with the draft — except the text the user is typing in right now.
|
|
572
|
+
const syncControls = () => {
|
|
573
|
+
if (!host)
|
|
574
|
+
return;
|
|
575
|
+
for (const input of host.querySelectorAll('input[type="checkbox"][name^="values|"]')) {
|
|
576
|
+
const attributeId = input.name.slice('values|'.length, -2);
|
|
577
|
+
const want = lines()
|
|
578
|
+
.find((line) => line.attributeId === attributeId)
|
|
579
|
+
?.values.some((value) => value.valueId === input.value) ?? false;
|
|
580
|
+
if (input.checked !== want)
|
|
581
|
+
input.checked = want;
|
|
582
|
+
}
|
|
583
|
+
for (const control of host.querySelectorAll('input[name^="extra|"], input[name^="field|"], select[name^="combo|"]')) {
|
|
584
|
+
if (control === document.activeElement && control instanceof HTMLInputElement)
|
|
585
|
+
continue;
|
|
586
|
+
const want = expectedValue(control.name);
|
|
587
|
+
if (want !== undefined && control.value !== want)
|
|
588
|
+
control.value = want;
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
// ── Views ──
|
|
592
|
+
const extrasView = (line) => {
|
|
593
|
+
const set = line.values.filter((value) => !isDecimal(value.priceExtra) || decimal(value.priceExtra) !== 0);
|
|
594
|
+
const invalid = line.values.some((value) => !isDecimal(value.priceExtra));
|
|
595
|
+
return (_jsx("div", { "data-ui": "variant-editor-extras", "data-attribute": line.attributeId, children: Disclosure({
|
|
596
|
+
summary: set.length
|
|
597
|
+
? t('priceExtrasSet', {
|
|
598
|
+
list: set.map((value) => `${value.name} ${signed(value.priceExtra)}`).join(', '),
|
|
599
|
+
})
|
|
600
|
+
: t('priceExtrasNone'),
|
|
601
|
+
open: invalid || openExtras().includes(line.attributeId),
|
|
602
|
+
body: (_jsx("div", { "data-ui": "variant-editor-extra-fields", children: each(line.values, (value) => value.valueId, (value) => MoneyField({
|
|
603
|
+
id: `${props.id}-extra-${line.attributeId}-${value.valueId}`,
|
|
604
|
+
name: `extra|${line.attributeId}|${value.valueId}`,
|
|
605
|
+
label: value.name,
|
|
606
|
+
value: value.priceExtra,
|
|
607
|
+
step: 'any',
|
|
608
|
+
disabled: !editable || saving(),
|
|
609
|
+
help: t('appliesTo', { count: usageOf(line.attributeId, value.valueId) }),
|
|
610
|
+
error: isDecimal(value.priceExtra) ? null : t('invalidNumber'),
|
|
611
|
+
})) })),
|
|
612
|
+
}) }));
|
|
613
|
+
};
|
|
614
|
+
const lineView = (line) => {
|
|
615
|
+
const options = optionsOf(line);
|
|
616
|
+
const shown = editable ? options : line.values;
|
|
617
|
+
const selected = new Set(line.values.map((value) => value.valueId));
|
|
618
|
+
const noVariant = line.createVariant === 'no_variant';
|
|
619
|
+
return (_jsxs("li", { "data-ui": "variant-editor-line", "data-empty": String(!line.values.length), children: [_jsxs("div", { "data-ui": "variant-editor-line-main", children: [CheckboxGroup({
|
|
620
|
+
id: `${props.id}-values-${line.attributeId}`,
|
|
621
|
+
name: `values|${line.attributeId}`,
|
|
622
|
+
label: line.name,
|
|
623
|
+
span: 'full',
|
|
624
|
+
disabled: !editable || saving(),
|
|
625
|
+
options: shown.map((value) => ({
|
|
626
|
+
value: value.valueId,
|
|
627
|
+
label: value.name,
|
|
628
|
+
checked: selected.has(value.valueId),
|
|
629
|
+
})),
|
|
630
|
+
help: noVariant
|
|
631
|
+
? t('noVariantHint')
|
|
632
|
+
: line.values.length
|
|
633
|
+
? t('valuesSelected', { count: line.values.length, total: options.length })
|
|
634
|
+
: t('valuesNone'),
|
|
635
|
+
}), _jsxs("div", { "data-ui": "variant-editor-line-actions", children: [noVariant ? Badge({ label: t('noVariant'), tone: 'neutral' }) : null, editable && selected.size < options.length
|
|
636
|
+
? Button({
|
|
637
|
+
name: ACTION,
|
|
638
|
+
value: `selectAll|${line.attributeId}`,
|
|
639
|
+
label: t('selectAll'),
|
|
640
|
+
variant: 'tertiary',
|
|
641
|
+
size: 'compact',
|
|
642
|
+
disabled: saving(),
|
|
643
|
+
})
|
|
644
|
+
: null, editable
|
|
645
|
+
? IconButton({
|
|
646
|
+
name: ACTION,
|
|
647
|
+
value: `removeLine|${line.attributeId}`,
|
|
648
|
+
label: t('removeAttributeNamed', { name: line.name }),
|
|
649
|
+
icon: icon('x'),
|
|
650
|
+
size: 'compact',
|
|
651
|
+
disabled: saving(),
|
|
652
|
+
})
|
|
653
|
+
: null] })] }), line.values.length ? extrasView(line) : null] }));
|
|
654
|
+
};
|
|
655
|
+
const attributesView = () => Section({
|
|
656
|
+
eyebrow: t('stepAttributes'),
|
|
657
|
+
title: t('attributesTitle'),
|
|
658
|
+
description: t('attributesHint'),
|
|
659
|
+
actions: editable ? (_jsx("div", { "data-ui": "variant-editor-picker", id: `${props.id}-attribute-picker`, children: attributePicker.view() })) : undefined,
|
|
660
|
+
body: (_jsxs("div", { "data-ui": "variant-editor-body", children: [lines().length ? (_jsx("ul", { "data-ui": "variant-editor-lines", children: each(lines(), (line) => line.attributeId, (line) => lineView(line)) })) : (EmptyState({
|
|
661
|
+
title: t('attributesEmpty'),
|
|
662
|
+
message: editable ? t('attributesEmptyHint') : '',
|
|
663
|
+
})), attributeForm.view()] })),
|
|
664
|
+
});
|
|
665
|
+
const rowThumb = (row, size) => {
|
|
666
|
+
const image = row.images[0];
|
|
667
|
+
return image ? (LightboxThumb({
|
|
668
|
+
item: {
|
|
669
|
+
src: imageUrl(image.attachmentId, 'large'),
|
|
670
|
+
thumbnail: imageUrl(image.attachmentId, 'thumb'),
|
|
671
|
+
alt: image.alt || t('image'),
|
|
672
|
+
},
|
|
673
|
+
labels: props.lightboxLabels,
|
|
674
|
+
size,
|
|
675
|
+
onOpen: (trigger) => openImages(row, trigger),
|
|
676
|
+
})) : (_jsx("span", { "data-ui": "lightbox-empty", "data-size": size, children: size === 'small' ? '' : t('image') }));
|
|
677
|
+
};
|
|
678
|
+
const imageBlock = (row, bodyId) => {
|
|
679
|
+
// Replacing attaches then removes, so a row that already has an image needs both.
|
|
680
|
+
const canUpload = editable && props.media.upload && (!row.images.length || props.media.remove);
|
|
681
|
+
const busy = imageBusy() === row.key;
|
|
682
|
+
return (_jsxs("div", { role: "group", "aria-label": t('image'), "data-ui": "variant-editor-image", "data-drag": String(dragOver() === row.key), "data-busy": String(busy), onDragOver: (event) => {
|
|
683
|
+
if (!canUpload || !row.id)
|
|
684
|
+
return;
|
|
685
|
+
event.preventDefault();
|
|
686
|
+
dragOver.set(row.key);
|
|
687
|
+
}, onDragLeave: (event) => {
|
|
688
|
+
const related = event.relatedTarget;
|
|
689
|
+
if (related instanceof Node && event.currentTarget.contains(related))
|
|
690
|
+
return;
|
|
691
|
+
dragOver.set(null);
|
|
692
|
+
}, onDrop: (event) => {
|
|
693
|
+
if (!canUpload || !row.id)
|
|
694
|
+
return;
|
|
695
|
+
event.preventDefault();
|
|
696
|
+
dragOver.set(null);
|
|
697
|
+
const file = event.dataTransfer?.files?.[0];
|
|
698
|
+
if (file)
|
|
699
|
+
void uploadImage(row, file);
|
|
700
|
+
}, children: [rowThumb(row, 'large'), _jsxs("div", { "data-ui": "variant-editor-image-actions", children: [canUpload && row.id
|
|
701
|
+
? DropZone({
|
|
702
|
+
id: `${bodyId}-image`,
|
|
703
|
+
name: `image|${row.key}`,
|
|
704
|
+
label: row.images.length ? t('replaceImage') : t('uploadImage'),
|
|
705
|
+
accept: IMAGE_TYPES,
|
|
706
|
+
disabled: busy || saving(),
|
|
707
|
+
status: t('dropImage'),
|
|
708
|
+
span: 'full',
|
|
709
|
+
})
|
|
710
|
+
: null, canUpload && !row.id ? _jsx("small", { "data-ui": "variant-editor-hint", children: t('imageSaveFirst') }) : null, editable && props.media.remove && row.images.length
|
|
711
|
+
? Button({
|
|
712
|
+
name: ACTION,
|
|
713
|
+
value: `removeImage|${row.key}`,
|
|
714
|
+
label: t('removeImage'),
|
|
715
|
+
variant: 'tertiary',
|
|
716
|
+
size: 'compact',
|
|
717
|
+
disabled: busy || saving(),
|
|
718
|
+
})
|
|
719
|
+
: null] })] }));
|
|
720
|
+
};
|
|
721
|
+
const rowField = (row, bodyId, field) => {
|
|
722
|
+
const value = String(row[field] ?? '');
|
|
723
|
+
const common = {
|
|
724
|
+
id: `${bodyId}-${field}`,
|
|
725
|
+
name: `field|${row.key}|${field}`,
|
|
726
|
+
label: t(field),
|
|
727
|
+
value,
|
|
728
|
+
disabled: !editable || saving(),
|
|
729
|
+
};
|
|
730
|
+
return field === 'weight' || field === 'volume'
|
|
731
|
+
? Field({
|
|
732
|
+
...common,
|
|
733
|
+
type: 'decimal',
|
|
734
|
+
step: 'any',
|
|
735
|
+
error: isDecimal(value) ? null : t('invalidNumber'),
|
|
736
|
+
})
|
|
737
|
+
: TextField(common);
|
|
738
|
+
};
|
|
739
|
+
const rowStatus = (row, clash, open) => {
|
|
740
|
+
if (!row.active)
|
|
741
|
+
return Badge({ label: t('archived'), tone: 'neutral' });
|
|
742
|
+
if (clash.has(row.key))
|
|
743
|
+
return Badge({ label: t('duplicate', { row: clash.get(row.key) }), tone: 'danger' });
|
|
744
|
+
if (rowInvalid(row))
|
|
745
|
+
return Badge({ label: t('rowInvalid'), tone: 'danger' });
|
|
746
|
+
if (open.has(row.key))
|
|
747
|
+
return Badge({ label: t('incomplete'), tone: 'warning' });
|
|
748
|
+
if (!row.id)
|
|
749
|
+
return Badge({ label: t('new'), tone: 'info' });
|
|
750
|
+
return null;
|
|
751
|
+
};
|
|
752
|
+
const rowView = (row, index, clash, open) => {
|
|
753
|
+
const bodyId = `${props.id}-row-${row.key}`;
|
|
754
|
+
// Every row repeats the same short action labels; the combination names them.
|
|
755
|
+
const titleId = `${bodyId}-title`;
|
|
756
|
+
const breakdown = extraOf(row).filter(({ value }) => decimal(value.priceExtra) !== 0);
|
|
757
|
+
const issue = rowIssues()[row.key];
|
|
758
|
+
return (_jsxs("article", { "data-ui": "variant-editor-row", role: "listitem", "data-active": String(row.active), "data-open": String(row.open), "data-invalid": String(clash.has(row.key) || Boolean(issue) || rowInvalid(row)), children: [_jsxs("div", { "data-ui": "variant-editor-row-head", children: [_jsx("span", { "data-ui": "variant-editor-row-number", children: `#${index + 1}` }), rowThumb(row, 'small'), _jsxs("div", { "data-ui": "variant-editor-row-title", children: [_jsx("strong", { id: titleId, "data-incomplete": String(open.has(row.key)), children: combinationLabel(row.valueIds) }), row.defaultCode ? _jsx("small", { children: row.defaultCode }) : null] }), _jsxs("div", { "data-ui": "variant-editor-row-meta", children: [rowStatus(row, clash, open), _jsx("span", { "data-ui": "variant-editor-row-price", children: money(priceOf(row)) })] }), _jsxs("div", { "data-ui": "variant-editor-row-actions", children: [Button({
|
|
759
|
+
name: ACTION,
|
|
760
|
+
value: `toggleRow|${row.key}`,
|
|
761
|
+
label: row.open ? t('collapse') : editable ? t('edit') : t('details'),
|
|
762
|
+
variant: 'tertiary',
|
|
763
|
+
size: 'compact',
|
|
764
|
+
expanded: row.open,
|
|
765
|
+
controls: row.open ? bodyId : null,
|
|
766
|
+
describedBy: titleId,
|
|
767
|
+
}), editable
|
|
768
|
+
? Button({
|
|
769
|
+
name: ACTION,
|
|
770
|
+
value: `removeRow|${row.key}`,
|
|
771
|
+
label: !row.id ? t('remove') : row.active ? t('archive') : t('restore'),
|
|
772
|
+
variant: 'tertiary',
|
|
773
|
+
size: 'compact',
|
|
774
|
+
disabled: saving(),
|
|
775
|
+
describedBy: titleId,
|
|
776
|
+
})
|
|
777
|
+
: null] })] }), issue ? _jsx("p", { "data-ui": "variant-editor-row-issue", children: issue }) : null, row.open ? (_jsxs("div", { "data-ui": "variant-editor-row-body", id: bodyId, children: [imageBlock(row, bodyId), _jsxs("div", { "data-ui": "variant-editor-fields", children: [each(variantLines(), (line) => line.attributeId, (line) => Select({
|
|
778
|
+
id: `${bodyId}-${line.attributeId}`,
|
|
779
|
+
name: `combo|${row.key}|${line.attributeId}`,
|
|
780
|
+
label: line.name,
|
|
781
|
+
value: row.valueIds[line.attributeId] ?? '',
|
|
782
|
+
disabled: !editable || !row.active || saving(),
|
|
783
|
+
options: [
|
|
784
|
+
{ value: '', label: t('choose', { name: line.name }) },
|
|
785
|
+
...line.values.map((value) => ({ value: value.valueId, label: value.name })),
|
|
786
|
+
],
|
|
787
|
+
})), rowField(row, bodyId, 'defaultCode'), rowField(row, bodyId, 'barcode'), rowField(row, bodyId, 'weight'), rowField(row, bodyId, 'volume')] }), _jsxs("p", { "data-ui": "variant-editor-breakdown", children: [[
|
|
788
|
+
`${t('listPrice')} ${money(decimal(listPrice()))}`,
|
|
789
|
+
...breakdown.map(({ line, value }) => `${line.name} ${value.name} +${money(decimal(value.priceExtra))}`),
|
|
790
|
+
].join(' · '), ` = ${money(priceOf(row))}`] })] })) : null] }));
|
|
791
|
+
};
|
|
792
|
+
const missingView = (missing) => {
|
|
793
|
+
const names = missing.slice(0, PREVIEW).map(combinationLabel);
|
|
794
|
+
const rest = missing.length - names.length;
|
|
795
|
+
return Notice({
|
|
796
|
+
tone: 'info',
|
|
797
|
+
title: t('missing', { count: missing.length }),
|
|
798
|
+
message: rest > 0 ? `${names.join(', ')} ${t('missingMore', { count: rest })}` : names.join(', '),
|
|
799
|
+
actions: Button({
|
|
800
|
+
name: ACTION,
|
|
801
|
+
value: 'generate',
|
|
802
|
+
label: t('generate', { count: missing.length }),
|
|
803
|
+
variant: 'primary',
|
|
804
|
+
size: 'compact',
|
|
805
|
+
leading: icon('plus'),
|
|
806
|
+
disabled: saving(),
|
|
807
|
+
}),
|
|
808
|
+
});
|
|
809
|
+
};
|
|
810
|
+
const variantsView = () => {
|
|
811
|
+
const clash = duplicates();
|
|
812
|
+
const open = incomplete();
|
|
813
|
+
const missing = editable ? missingCombinations() : [];
|
|
814
|
+
const activeCount = rows().filter((row) => row.active).length;
|
|
815
|
+
const toolbar = editable && (variantLines().length > 0 || rows().length > 0);
|
|
816
|
+
return Section({
|
|
817
|
+
eyebrow: t('stepVariants'),
|
|
818
|
+
title: t('variantsTitle'),
|
|
819
|
+
description: rows().length ? t('variantsCount', { active: activeCount, total: rows().length }) : null,
|
|
820
|
+
actions: toolbar ? (_jsxs("div", { "data-ui": "variant-editor-toolbar", children: [Button({
|
|
821
|
+
name: ACTION,
|
|
822
|
+
value: 'addRow',
|
|
823
|
+
label: t('addVariant'),
|
|
824
|
+
variant: 'secondary',
|
|
825
|
+
size: 'compact',
|
|
826
|
+
leading: icon('plus'),
|
|
827
|
+
disabled: saving(),
|
|
828
|
+
}), rows().some((row) => row.id && !row.active)
|
|
829
|
+
? Button({
|
|
830
|
+
name: ACTION,
|
|
831
|
+
value: 'activateAll',
|
|
832
|
+
label: t('activateAll'),
|
|
833
|
+
variant: 'tertiary',
|
|
834
|
+
size: 'compact',
|
|
835
|
+
disabled: saving(),
|
|
836
|
+
})
|
|
837
|
+
: null, activeCount
|
|
838
|
+
? Button({
|
|
839
|
+
name: ACTION,
|
|
840
|
+
value: 'archiveAll',
|
|
841
|
+
label: t('archiveAll'),
|
|
842
|
+
variant: 'tertiary',
|
|
843
|
+
size: 'compact',
|
|
844
|
+
disabled: saving(),
|
|
845
|
+
})
|
|
846
|
+
: null] })) : undefined,
|
|
847
|
+
body: (_jsxs("div", { "data-ui": "variant-editor-body", children: [missing.length ? missingView(missing) : null, rows().length ? (_jsx("div", { "data-ui": "variant-editor-rows", role: "list", children: each(rows(), (row) => row.key, (row) => rowView(row, rows().indexOf(row), clash, open)) })) : missing.length ? null : (EmptyState({
|
|
848
|
+
title: t('variantsEmpty'),
|
|
849
|
+
message: variantLines().length ? t('variantsEmptyHint') : t('variantsNeedAttributes'),
|
|
850
|
+
}))] })),
|
|
851
|
+
});
|
|
852
|
+
};
|
|
853
|
+
const footerView = () => {
|
|
854
|
+
const clash = duplicates().size;
|
|
855
|
+
const archiving = rows().filter((row) => row.id && !row.active && saved.variants.find((v) => v.id === row.id)?.active).length;
|
|
856
|
+
const creating = rows().filter((row) => !row.id && row.active).length;
|
|
857
|
+
const parts = [
|
|
858
|
+
creating ? t('summaryCreate', { count: creating }) : '',
|
|
859
|
+
archiving ? t('summaryArchive', { count: archiving }) : '',
|
|
860
|
+
].filter(Boolean);
|
|
861
|
+
const invalid = invalidExtras() || invalidRows();
|
|
862
|
+
return (_jsxs("footer", { "data-ui": "variant-editor-footer", children: [_jsx("p", { "data-ui": "variant-editor-summary", "data-tone": clash || invalid ? 'danger' : 'neutral', "aria-live": "polite", children: saving()
|
|
863
|
+
? t('saving')
|
|
864
|
+
: clash
|
|
865
|
+
? t('summaryDuplicate')
|
|
866
|
+
: invalid
|
|
867
|
+
? t('summaryInvalid')
|
|
868
|
+
: (notice() ?? (dirty() ? parts.join(' · ') || t('summaryChanged') : '')) }), editable
|
|
869
|
+
? Button({
|
|
870
|
+
name: ACTION,
|
|
871
|
+
value: 'reset',
|
|
872
|
+
label: t('reset'),
|
|
873
|
+
variant: 'secondary',
|
|
874
|
+
size: 'compact',
|
|
875
|
+
disabled: !dirty() || saving(),
|
|
876
|
+
})
|
|
877
|
+
: null] }));
|
|
878
|
+
};
|
|
879
|
+
// Save lives in the modal footer, outside this island: it submits this empty form,
|
|
880
|
+
// and the island keeps that button's disabled and busy state in step with its own.
|
|
881
|
+
const saveForm = variantEditorSaveForm(props.id);
|
|
882
|
+
const saveButton = () => document.querySelector(`button[form="${saveForm}"]`);
|
|
883
|
+
return {
|
|
884
|
+
view: () => (_jsxs("div", { "data-ui": "variant-editor", id: props.id, "aria-busy": saving() ? 'true' : null, onClick: onClick, onChange: onChange, onInput: onInput, children: [editable ? null : Notice({ title: t('readOnly'), message: '' }), problem() ? Notice({ title: t('saveFailed'), message: problem() ?? '', tone: 'danger' }) : null, attributesView(), variantsView(), footerView(), _jsx("form", { id: saveForm, "data-record-dirty": dirty() ? 'true' : null, hidden: true }), viewer.layer()] })),
|
|
885
|
+
mount: ({ root, lifetime }) => {
|
|
886
|
+
host = root;
|
|
887
|
+
lifetime.addEventListener('abort', () => {
|
|
888
|
+
disposed = true;
|
|
889
|
+
host = null;
|
|
890
|
+
});
|
|
891
|
+
attributeForm.attach(host, lifetime);
|
|
892
|
+
const pickerRoot = host.querySelector(`[id="${props.id}-attribute-picker"]`);
|
|
893
|
+
if (pickerRoot)
|
|
894
|
+
attributePicker.mount?.({ root: pickerRoot, lifetime });
|
|
895
|
+
lifetime.addEventListener('abort', () => attributePicker.dispose?.());
|
|
896
|
+
viewer.attach(lifetime);
|
|
897
|
+
// A price-extra disclosure stays as the user left it across renders.
|
|
898
|
+
host.addEventListener('toggle', (event) => {
|
|
899
|
+
const details = event.target;
|
|
900
|
+
if (!(details instanceof HTMLDetailsElement))
|
|
901
|
+
return;
|
|
902
|
+
const attributeId = details.closest('[data-ui="variant-editor-extras"]')?.dataset
|
|
903
|
+
.attribute;
|
|
904
|
+
if (!attributeId)
|
|
905
|
+
return;
|
|
906
|
+
const others = openExtras().filter((id) => id !== attributeId);
|
|
907
|
+
openExtras.set(details.open ? [...others, attributeId] : others);
|
|
908
|
+
}, { signal: lifetime, capture: true });
|
|
909
|
+
// Capture phase, so the record modal's own submit handler never sees this form.
|
|
910
|
+
document.addEventListener('submit', (event) => {
|
|
911
|
+
if (!(event.target instanceof HTMLFormElement) || event.target.id !== saveForm)
|
|
912
|
+
return;
|
|
913
|
+
event.preventDefault();
|
|
914
|
+
event.stopImmediatePropagation();
|
|
915
|
+
if (!blocked())
|
|
916
|
+
void save();
|
|
917
|
+
}, { signal: lifetime, capture: true });
|
|
918
|
+
const stopSave = effect(() => {
|
|
919
|
+
const button = saveButton();
|
|
920
|
+
if (!button)
|
|
921
|
+
return;
|
|
922
|
+
button.disabled = blocked();
|
|
923
|
+
if (saving())
|
|
924
|
+
button.setAttribute('aria-busy', 'true');
|
|
925
|
+
else
|
|
926
|
+
button.removeAttribute('aria-busy');
|
|
927
|
+
});
|
|
928
|
+
const stopSync = effect(() => {
|
|
929
|
+
lines();
|
|
930
|
+
rows();
|
|
931
|
+
queueMicrotask(syncControls);
|
|
932
|
+
});
|
|
933
|
+
lifetime.addEventListener('abort', () => {
|
|
934
|
+
stopSave();
|
|
935
|
+
stopSync();
|
|
936
|
+
});
|
|
937
|
+
},
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
/** The id of the form a Save button outside the island submits to save this editor. */
|
|
941
|
+
export const variantEditorSaveForm = (id) => `${id}-save`;
|
|
942
|
+
export const variantEditor = (props) => createVariantEditorView(props);
|
|
943
|
+
//# sourceMappingURL=variant-editor-view.js.map
|