@tuya-sat/microapp-kit 0.0.0-stage → 0.1.26-alpha.0
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/AUDIT.md +43 -0
- package/CHANGELOG.md +45 -0
- package/MAINTAINING.md +143 -0
- package/README.md +53 -2
- package/START-HERE.md +40 -0
- package/bootstrap/build-install-page.mjs +44 -0
- package/bootstrap/install-node.ps1 +80 -0
- package/bootstrap/install-node.sh +94 -0
- package/bootstrap/install.md.in +29 -0
- package/bundle.json +852 -0
- package/cli.mjs +3 -0
- package/package.json +64 -4
- package/resources/contracts/project-permissions.json +596 -0
- package/resources/contracts/standard-api.catalog.json +5 -0
- package/resources/examples/group-display.mjs +23 -0
- package/resources/preview/README.md +104 -0
- package/resources/preview/agent-open.mjs +1221 -0
- package/resources/preview/application-icon.mjs +27 -0
- package/resources/preview/authorization-panel.js +243 -0
- package/resources/preview/authorization-routes.mjs +634 -0
- package/resources/preview/authorization.mjs +353 -0
- package/resources/preview/backend-entry.mjs +22 -0
- package/resources/preview/backend-process.mjs +26 -0
- package/resources/preview/bridge.js +50 -0
- package/resources/preview/control.mjs +48 -0
- package/resources/preview/device-fixtures.mjs +38 -0
- package/resources/preview/fixtures/context.json +10 -0
- package/resources/preview/fixtures/device-catalog.json +363 -0
- package/resources/preview/host-contract.mjs +104 -0
- package/resources/preview/host.js +841 -0
- package/resources/preview/local-dev-provider.mjs +27 -0
- package/resources/preview/menu-icons.json +82 -0
- package/resources/preview/mock-store.mjs +1147 -0
- package/resources/preview/run.mjs +131 -0
- package/resources/preview/server.mjs +476 -0
- package/resources/preview/theme-tokens.mjs +49 -0
- package/resources/preview/themes.json +1036 -0
- package/resources/resource-manifest.json +210 -0
- package/resources/scripts/backend-build-context.mjs +101 -0
- package/resources/scripts/backend-runtime.mjs +68 -0
- package/resources/scripts/build-backend-image.sh +23 -0
- package/resources/scripts/build-safety.mjs +18 -0
- package/resources/scripts/build.mjs +138 -0
- package/resources/scripts/command-invocation.mjs +10 -0
- package/resources/scripts/diagnostics.mjs +34 -0
- package/resources/scripts/init-project.mjs +62 -0
- package/resources/scripts/package-release.mjs +80 -0
- package/resources/scripts/prepare-locales.mjs +77 -0
- package/resources/scripts/project-identity.mjs +21 -0
- package/resources/scripts/registry-client.mjs +189 -0
- package/resources/scripts/resource-files.mjs +22 -0
- package/resources/scripts/scaffold.mjs +31 -0
- package/resources/scripts/test-backend-image.mjs +162 -0
- package/resources/scripts/update-preview-themes.mjs +26 -0
- package/resources/scripts/update-resource-manifest.mjs +9 -0
- package/resources/scripts/validate-resources.mjs +9 -0
- package/resources/template/_gitignore +5 -0
- package/resources/template/backend/.dockerignore +7 -0
- package/resources/template/backend/.node-version +1 -0
- package/resources/template/backend/Dockerfile +62 -0
- package/resources/template/backend/deploy/README.md +105 -0
- package/resources/template/backend/deploy/data/README.md +3 -0
- package/resources/template/backend/deploy/manifest.json +4 -0
- package/resources/template/backend/deploy/tasks/README.md +3 -0
- package/resources/template/backend/migrations/README.md +5 -0
- package/resources/template/backend/next-env.d.ts +6 -0
- package/resources/template/backend/next.config.ts +19 -0
- package/resources/template/backend/operations.json +4 -0
- package/resources/template/backend/package.json +35 -0
- package/resources/template/backend/pnpm-lock.yaml +775 -0
- package/resources/template/backend/preview-contract.json +4 -0
- package/resources/template/backend/public/.keep +0 -0
- package/resources/template/backend/scripts/check-runtime.mjs +12 -0
- package/resources/template/backend/scripts/dev-deploy-prepare.mjs +362 -0
- package/resources/template/backend/scripts/dev-diagnose-database.mjs +199 -0
- package/resources/template/backend/scripts/dev-start-backend.sh +30 -0
- package/resources/template/backend/src/app/[[...path]]/route.ts +11 -0
- package/resources/template/backend/src/app/api/[...path]/route.ts +11 -0
- package/resources/template/backend/src/app/api/health/route.ts +16 -0
- package/resources/template/backend/src/app/api/preview/context/route.ts +36 -0
- package/resources/template/backend/src/instrumentation.ts +10 -0
- package/resources/template/backend/src/lib/api-response.mjs +119 -0
- package/resources/template/backend/src/lib/business-logger.mjs +29 -0
- package/resources/template/backend/src/lib/database-errors.mjs +15 -0
- package/resources/template/backend/src/lib/dev-authorization.mjs +84 -0
- package/resources/template/backend/src/lib/dev-context.mjs +58 -0
- package/resources/template/backend/src/lib/gateway-ingress.mjs +79 -0
- package/resources/template/backend/src/lib/gateway-nonce-store.mjs +31 -0
- package/resources/template/backend/src/lib/gateway-verification.mjs +197 -0
- package/resources/template/backend/src/lib/request-observability.mjs +93 -0
- package/resources/template/backend/src/lib/standard-api.ts +28 -0
- package/resources/template/backend/src/microapp-identity.json +1 -0
- package/resources/template/backend/src/proxy.ts +40 -0
- package/resources/template/backend/tests/api-response.test.mjs +77 -0
- package/resources/template/backend/tests/database-diagnostics.test.mjs +198 -0
- package/resources/template/backend/tests/deployment-connection.test.mjs +100 -0
- package/resources/template/backend/tests/deployment-postgres.test.mjs +109 -0
- package/resources/template/backend/tests/deployment.test.mjs +196 -0
- package/resources/template/backend/tests/dev-authorization.test.mjs +88 -0
- package/resources/template/backend/tests/dev-context.test.mjs +35 -0
- package/resources/template/backend/tests/gateway-verification.test.mjs +287 -0
- package/resources/template/backend/tests/request-observability.test.mjs +125 -0
- package/resources/template/backend/tests/routes.test.mjs +253 -0
- package/resources/template/backend/tests/startup.test.mjs +147 -0
- package/resources/template/backend/tsconfig.json +34 -0
- package/resources/template/micro-app/.editorconfig +15 -0
- package/resources/template/micro-app/.eslintrc +15 -0
- package/resources/template/micro-app/.prettierignore +4 -0
- package/resources/template/micro-app/.prettierrc +6 -0
- package/resources/template/micro-app/_gitignore +6 -0
- package/resources/template/micro-app/_locales/en.json +5 -0
- package/resources/template/micro-app/_locales/zh-CN.json +5 -0
- package/resources/template/micro-app/antd.less.overwrite.js +4 -0
- package/resources/template/micro-app/babel.config.json +3 -0
- package/resources/template/micro-app/manifest.json +46 -0
- package/resources/template/micro-app/micro.config.js +4 -0
- package/resources/template/micro-app/mock/index.json +4 -0
- package/resources/template/micro-app/package.json +61 -0
- package/resources/template/micro-app/public/favicon.ico +0 -0
- package/resources/template/micro-app/public/index.ejs +13 -0
- package/resources/template/micro-app/src/App.less +0 -0
- package/resources/template/micro-app/src/App.tsx +99 -0
- package/resources/template/micro-app/src/api/api-request.mjs +85 -0
- package/resources/template/micro-app/src/api/custom-api-headers.mjs +55 -0
- package/resources/template/micro-app/src/api/custom-api.ts +10 -0
- package/resources/template/micro-app/src/api/errors.mjs +108 -0
- package/resources/template/micro-app/src/api/index.ts +34 -0
- package/resources/template/micro-app/src/api/presentation.mjs +33 -0
- package/resources/template/micro-app/src/api/req.ts +9 -0
- package/resources/template/micro-app/src/api/request-url.mjs +20 -0
- package/resources/template/micro-app/src/api/res.ts +9 -0
- package/resources/template/micro-app/src/api/submission-errors.mjs +84 -0
- package/resources/template/micro-app/src/components/CapsuleFilters/index.module.less +121 -0
- package/resources/template/micro-app/src/components/CapsuleFilters/index.tsx +100 -0
- package/resources/template/micro-app/src/components/MicroAppUI/DataTable.tsx +48 -0
- package/resources/template/micro-app/src/components/MicroAppUI/EllipsisText.tsx +25 -0
- package/resources/template/micro-app/src/components/MicroAppUI/Layouts.tsx +54 -0
- package/resources/template/micro-app/src/components/MicroAppUI/ModalForm.tsx +230 -0
- package/resources/template/micro-app/src/components/MicroAppUI/StatusBadge.tsx +19 -0
- package/resources/template/micro-app/src/components/MicroAppUI/index.module.less +99 -0
- package/resources/template/micro-app/src/components/MicroAppUI/index.ts +13 -0
- package/resources/template/micro-app/src/index.css +16 -0
- package/resources/template/micro-app/src/index.tsx +66 -0
- package/resources/template/micro-app/src/interfaces.ts +545 -0
- package/resources/template/micro-app/src/lang/en.ts +1 -0
- package/resources/template/micro-app/src/lang/index.ts +31 -0
- package/resources/template/micro-app/src/lang/zh.ts +1 -0
- package/resources/template/micro-app/src/language-codes.mjs +32 -0
- package/resources/template/micro-app/src/language-policy.ts +6 -0
- package/resources/template/micro-app/src/microapp-identity.json +1 -0
- package/resources/template/micro-app/src/pages/index.module.less +3 -0
- package/resources/template/micro-app/src/pages/index.tsx +6 -0
- package/resources/template/micro-app/src/public-path.js +4 -0
- package/resources/template/micro-app/src/utils/antdLang.ts +244 -0
- package/resources/template/micro-app/tests/template.test.cjs +15 -0
- package/resources/template/micro-app/tsconfig.extend.json +8 -0
- package/resources/template/micro-app/tsconfig.json +24 -0
- package/resources/template/micro-app/typings.d.ts +19 -0
- package/resources/template/micro-app/yarn.lock +7491 -0
- package/resources/tests/agent-open-catalog.test.mjs +43 -0
- package/resources/tests/agent-open-preview.test.mjs +878 -0
- package/resources/tests/api-request.test.mjs +121 -0
- package/resources/tests/api-response.test.mjs +2 -0
- package/resources/tests/application-icon-build.test.mjs +34 -0
- package/resources/tests/authorization-proxy.test.mjs +202 -0
- package/resources/tests/authorization.test.mjs +462 -0
- package/resources/tests/backend-context.test.mjs +33 -0
- package/resources/tests/backend-preview.test.mjs +67 -0
- package/resources/tests/backend-request-logging.test.mjs +2 -0
- package/resources/tests/backend-runtime.test.mjs +96 -0
- package/resources/tests/browser-authorization-smoke.mjs +111 -0
- package/resources/tests/browser-design-smoke.mjs +107 -0
- package/resources/tests/browser-language-compat-smoke.mjs +48 -0
- package/resources/tests/browser-preview-smoke.mjs +148 -0
- package/resources/tests/browser-standard-ui-smoke.mjs +331 -0
- package/resources/tests/build-safety.test.mjs +69 -0
- package/resources/tests/business-build.test.mjs +86 -0
- package/resources/tests/command-invocation.test.mjs +35 -0
- package/resources/tests/custom-api-headers.test.mjs +96 -0
- package/resources/tests/custom-route.test.mjs +63 -0
- package/resources/tests/custom-script-policy.test.mjs +34 -0
- package/resources/tests/database-errors.test.mjs +81 -0
- package/resources/tests/deployment-package.test.mjs +45 -0
- package/resources/tests/dockerfile-logging.test.mjs +31 -0
- package/resources/tests/fixtures/capsule-page.tsx +46 -0
- package/resources/tests/fixtures/standard-ui-page.tsx +222 -0
- package/resources/tests/group-display.test.mjs +28 -0
- package/resources/tests/host-contract.test.mjs +84 -0
- package/resources/tests/image-test.test.mjs +110 -0
- package/resources/tests/initialization.test.mjs +98 -0
- package/resources/tests/language-selection.test.mjs +188 -0
- package/resources/tests/locale-keys.test.mjs +88 -0
- package/resources/tests/preview-control.test.mjs +56 -0
- package/resources/tests/preview-icon.test.mjs +117 -0
- package/resources/tests/preview-state.test.mjs +183 -0
- package/resources/tests/preview-theme.test.mjs +17 -0
- package/resources/tests/real-preview-smoke.mjs +34 -0
- package/resources/tests/registry-client.test.mjs +272 -0
- package/resources/tests/request-errors.test.mjs +51 -0
- package/resources/tests/request-method-contract.test.mjs +65 -0
- package/resources/tests/resources.test.mjs +31 -0
- package/resources/tests/saas-presentation.test.mjs +41 -0
- package/resources/tests/sandbox-scripts.test.mjs +144 -0
- package/resources/tests/space-permission-guidance.test.mjs +78 -0
- package/resources/tests/standard-api-preview.test.mjs +55 -0
- package/resources/tests/submission-errors.test.mjs +118 -0
- package/resources/tests/version-description-package.test.mjs +60 -0
- package/resources/ui/component-sources.json +36 -0
- package/runtime/assemble.mjs +66 -0
- package/runtime/auth/hidden-input.mjs +45 -0
- package/runtime/auth/macos-credentials.js +41 -0
- package/runtime/auth/manager.mjs +145 -0
- package/runtime/auth/session.mjs +153 -0
- package/runtime/auth/state.mjs +107 -0
- package/runtime/auth/store.mjs +130 -0
- package/runtime/auth/windows-credentials.ps1 +73 -0
- package/runtime/auth/wizard.mjs +224 -0
- package/runtime/cli.mjs +474 -0
- package/runtime/dev-database.mjs +155 -0
- package/runtime/dev-provider.mjs +41 -0
- package/runtime/errors.mjs +205 -0
- package/runtime/install-receipt.mjs +68 -0
- package/runtime/installation.mjs +92 -0
- package/runtime/integrity.mjs +110 -0
- package/runtime/launcher.mjs +104 -0
- package/runtime/pack-npm.mjs +76 -0
- package/runtime/package-cache.mjs +52 -0
- package/runtime/package-identity.mjs +22 -0
- package/runtime/preview.mjs +157 -0
- package/runtime/project-identity.mjs +57 -0
- package/runtime/publication.mjs +372 -0
- package/runtime/release-content.mjs +159 -0
- package/runtime/release-index.mjs +91 -0
- package/runtime/setup.mjs +223 -0
- package/runtime/tests/agent-entry.test.mjs +79 -0
- package/runtime/tests/auth-wizard.test.mjs +241 -0
- package/runtime/tests/auth.test.mjs +367 -0
- package/runtime/tests/consistency-workflow.test.mjs +84 -0
- package/runtime/tests/dev-provider.test.mjs +27 -0
- package/runtime/tests/diagnostics.test.mjs +66 -0
- package/runtime/tests/helpers/tar-fixture.mjs +25 -0
- package/runtime/tests/install-page.test.mjs +41 -0
- package/runtime/tests/install.test.mjs +432 -0
- package/runtime/tests/node-bootstrap.test.mjs +104 -0
- package/runtime/tests/npm-distribution.test.mjs +98 -0
- package/runtime/tests/package-cache.test.mjs +108 -0
- package/runtime/tests/package-migration.test.mjs +208 -0
- package/runtime/tests/preview-hosts.test.mjs +66 -0
- package/runtime/tests/preview.test.mjs +304 -0
- package/runtime/tests/project-identity.test.mjs +67 -0
- package/runtime/tests/publication.test.mjs +436 -0
- package/runtime/tests/release-recovery.test.mjs +417 -0
- package/runtime/tests/repository-source.test.mjs +38 -0
- package/runtime/tests/skill-set-update.test.mjs +169 -0
- package/runtime/tests/standalone.test.mjs +46 -0
- package/runtime/tests/update-check.test.mjs +165 -0
- package/runtime/tests/update.test.mjs +292 -0
- package/runtime/tests/workspace.test.mjs +156 -0
- package/runtime/update-check.mjs +160 -0
- package/runtime/update-state.mjs +83 -0
- package/runtime/update.mjs +292 -0
- package/runtime/workspace-migration.mjs +109 -0
- package/runtime/workspace.mjs +101 -0
- package/schemas/toolchain.schema.json +13 -0
- package/setup.mjs +3 -0
- package/skills/micro-app-backend-development/SKILL.md +64 -0
- package/skills/micro-app-backend-development/references/backend-security-workflow.md +77 -0
- package/skills/micro-app-backend-development/references/business-build-helpers.md +11 -0
- package/skills/micro-app-backend-development/references/business-logging.md +56 -0
- package/skills/micro-app-backend-development/references/database-constraints.md +81 -0
- package/skills/micro-app-backend-development/references/database-write-errors.md +29 -0
- package/skills/micro-app-backend-development/references/deployment-bundle.md +65 -0
- package/skills/micro-app-backend-development/references/dev-preview-context.md +23 -0
- package/skills/micro-app-backend-development/references/gateway-verification.md +43 -0
- package/skills/micro-app-backend-development/references/implementation.md +49 -0
- package/skills/micro-app-backend-development/references/local-database-preview.md +100 -0
- package/skills/micro-app-backend-development/references/production-authorization-readiness.md +60 -0
- package/skills/micro-app-backend-development/references/project-data-permissions.md +43 -0
- package/skills/micro-app-backend-development/references/runtime-resources-and-deployment.md +76 -0
- package/skills/micro-app-backend-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-backend-development/tests/behavior-scenarios.md +62 -0
- package/skills/micro-app-cloud-integration/SKILL.md +92 -0
- package/skills/micro-app-cloud-integration/references/api-catalog.json +1315 -0
- package/skills/micro-app-cloud-integration/references/api-catalog.md +59 -0
- package/skills/micro-app-cloud-integration/references/api-device-control.md +67 -0
- package/skills/micro-app-cloud-integration/references/api-device.md +179 -0
- package/skills/micro-app-cloud-integration/references/api-group-ota.md +145 -0
- package/skills/micro-app-cloud-integration/references/api-linkage.md +3 -0
- package/skills/micro-app-cloud-integration/references/api-models.md +584 -0
- package/skills/micro-app-cloud-integration/references/api-project.md +121 -0
- package/skills/micro-app-cloud-integration/references/api-space-home.md +244 -0
- package/skills/micro-app-cloud-integration/references/backend-authorization.md +95 -0
- package/skills/micro-app-cloud-integration/references/calling-conventions.md +118 -0
- package/skills/micro-app-cloud-integration/references/preview-agent-open.md +46 -0
- package/skills/micro-app-cloud-integration/references/server-to-server-integration.md +13 -0
- package/skills/micro-app-cloud-integration/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-cloud-integration/tests/behavior-scenarios.md +20 -0
- package/skills/micro-app-design/SKILL.md +99 -0
- package/skills/micro-app-design/agents/openai.yaml +6 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/README.md +22 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCapsuleSearch.html +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaCardGrid.html +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaIcon.html +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaPageTitle.html +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components/TuyaTopNavigation.html +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/components.schema.md +154 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.html +588 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/dashboard.md +99 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.html +477 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/examples/table-page.md +77 -0
- package/skills/micro-app-design/assets/tuya-design-system/assets/templates/base.html +878 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/accessibility/accessibility.md +39 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/TuyaCapsuleSearch.html +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/arrow-down.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/calendar.svg +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/checkbox-check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/clear.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/icons/capsule-filter/search.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/examples/preview.html +3705 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/capsule-search/spec.md +78 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/TuyaCardGrid.html +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/assets/placeholder.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/examples/preview.html +711 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/card-grid/spec.md +93 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/cascader/spec.md +75 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/checkbox/spec.md +72 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/date-picker/spec.md +81 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/dropdown/spec.md +99 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/examples/TuyaIcon.html +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/icon/spec.md +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/input/spec.md +84 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/modal/spec.md +178 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/examples/TuyaPageTitle.html +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/page-title/spec.md +67 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/pagination/spec.md +94 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/radio/spec.md +80 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/search-input/spec.md +101 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/select/spec.md +96 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/slider/spec.md +66 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/switch/spec.md +86 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/table/spec.md +116 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/time-picker/spec.md +75 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tooltip/spec.md +70 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/examples/TuyaTopNavigation.html +55 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/top-navigation/spec.md +60 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/icons/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/examples/preview.html +974 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/tree/spec.md +118 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/components/upload/spec.md +86 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/demo-index.md +43 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/design-system.md +116 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/color.md +165 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/elevation.md +21 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/icon.md +78 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/layout.md +103 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/radius.md +22 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/spacing.md +29 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/foundation/typography.md +43 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/behavior.md +30 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/feedback.md +23 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/interaction/state.md +28 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/motion/motion.md +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/dashboard.md +34 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/data-page.md +30 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/form-page.md +36 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/patterns/monitoring.md +25 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/quality-checklist.md +71 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/registry.yaml +232 -0
- package/skills/micro-app-design/assets/tuya-design-system/latest/tokens.yaml +187 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/README.md +26 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states/README.md +13 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/403.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/404.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277/500.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//344/272/213/344/273/266/345/274/202/345/270/270.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/220/234/347/264/242/346/227/240/347/273/223/346/236/234.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/344/275/215/347/275/256/344/277/241/346/201/257.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/210/277/345/261/213.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/225/260/346/215/256.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/346/266/210/346/201/257.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/347/275/221/347/273/234.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/350/256/276/345/244/207.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//346/272/220/347/250/277//346/232/202/346/227/240/351/241/271/347/233/256.html +58 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203.md +159 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/403.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/404.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/500.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/empty.css +106 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/empty.js +49 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210/index.html +69 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//344/272/213/344/273/266/345/274/202/345/270/270.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//345/233/276/347/211/207/345/212/240/350/275/275/345/244/261/350/264/245.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/220/234/347/264/242/346/227/240/347/273/223/346/236/234.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/344/275/215/347/275/256/344/277/241/346/201/257.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/210/277/345/261/213.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/225/260/346/215/256.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/346/266/210/346/201/257.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/347/275/221/347/273/234.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/350/256/276/345/244/207.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/empty-states//350/247/204/350/214/203/347/211/210//346/232/202/346/227/240/351/241/271/347/233/256.html +31 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/README.md +23 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/arrow-down.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/calendar.svg +5 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/check.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/clear.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/search.svg +4 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/arrow-down-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/check-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/clear-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/capsule-filter/sources/search-ref.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/Excel.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/HD.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PM.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/PPT.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/README.md +14 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/VOC.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/app/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/catalog.md +377 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/folder-closed.svg +3 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/license/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/nps/351/207/217/350/241/250 /346/224/266/350/227/217.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/sos.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product/word.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/200/346/260/247/345/214/226/347/242/263-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/200/346/260/247/345/214/226/347/242/263.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/270/212/344/274/240.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/214/346/260/247/345/214/226/347/242/263.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/221/347/253/257 /344/270/213/350/275/275.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/256/345/272/246 /345/244/252/351/230/263 /346/227/245/351/227/264.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/344/275/223/344/274/240/346/204/237/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/203/217@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/345/221/230/345/244/207/344/273/275@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/346/260/221/345/270/201@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/350/204/270/350/257/206/345/210/253/346/210/220/345/212/237@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/272/272/350/241/214/351/227/250/347/246/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/230/346/203/240/345/210/270@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//344/274/232/345/221/230@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/201/234/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/205/347/224/265/346/241/251@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/245/344/276/265/345/221/212/350/255/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/205/250/347/220/203 /345/234/260/347/220/203 @2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/260/347/256/261.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/206/267/346/260/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/210/267/346/274/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/212/240/346/262/271/347/253/231@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/220/210/347/211/251.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/214/226/345/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/240/346/257/224/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/256/227.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/215/267/345/260/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/216/237/345/255/220 /347/211/251/347/220/206 /346/227/213/350/275/254.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/221/345/215/241@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/217/260/345/274/217/347/224/265/350/204/221 /346/230/276/347/244/272/345/231/250 /345/261/217/345/271/225.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/212/347/201/257.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/220/271/351/243/216/346/234/272 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/212/350/255/246/344/270/255/345/277/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/221/274/345/220/270/347/216/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/225/206/345/272/227@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/226/234/346/254/242@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/233/276/347/211/207-/346/255/243/345/270/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/250/347/272/277/346/234/215/345/212/241/345/217/260@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/345/233/276@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/234/260/351/223/201@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240 DNA.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/237/272/345/233/240.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/240/206/345/217/240/346/237/261/347/212/266.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/243/260/345/205/211/346/212/245/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/232/347/275/221/351/241/265 web /345/244/232/347/252/227/345/217/243.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/244/247/350/204/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/256/236/346/227/266/346/246/202/350/247/210 /351/245/274/345/233/276.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/256/244/345/244/226/346/270/251/345/272/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/257/271/346/216/245 /344/272/244/346/215/242.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/255/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/260/272/345/257/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/267/264/345/243/253@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/345/261/200.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/270/203/351/230/262/346/217/220/351/206/222.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212 /347/235/241/347/234/240.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/212.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/272/224/347/224/250/351/205/215/347/275/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/205/263 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 Bug@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 Code@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 js /344/273/243/347/240/201@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 /344/273/243/347/240/201@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/345/217/221 /344/273/243/347/240/201 /347/275/221/351/241/265 /344/273/243/347/240/201@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/274/200/351/227/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/275/225/345/203/217.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/252/347/216/257.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/276/256/346/263/242/347/202/211 /347/203/244/347/256/261 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207 /345/277/203/347/224/265/345/233/276.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/216/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/347/224/265/345/233/276 /346/201/222/346/265/201/346/263/204/351/234/262/344/270/212/345/221/212.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//345/277/203/350/267/263/346/243/200/346/265/213.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/235/350/200/203 /350/201/224/346/203/263.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/200/245/346/225/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/210/277/351/227/264@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/213/350/241/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/211/223/345/215/260/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/225/345/275/261/344/273/252 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/230/347/272/277/351/235/242/347/247/257/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/212/245/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/205/346/236/266/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/213/215/347/205/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/214/207/347/272/271@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/216/210/346/235/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/221/204/345/203/217/345/244/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/257/344/273/230@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/224/266/350/227/217/346/266/210/346/201/257.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/221/346/212/244/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/243/347/202/271/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256 /345/210/206/346/236/220 /345/276/252/347/216/257.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256 /351/245/274/345/233/276.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/260/346/215/256/346/272/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/264/344/275/223/346/246/202/345/206/265-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/225/264/344/275/223/346/246/202/345/206/265.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/344/273/266/345/244/271/346/211/223/345/274/200.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/345/255/227.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 amr.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 ara.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 bmp.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 csv.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 doc.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 gif.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 jpeg.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 jpg.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 json.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 md.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 mp3.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 mp4.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 pdf.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 png.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 ppt.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 psd.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 svg.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 txt.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 wav.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 xls.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/207/346/241/243 /346/226/207/344/273/266 /346/240/274/345/274/217 zip.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/255/347/272/277 /346/226/255/347/275/221/351/207/215/350/257/225 /350/204/211/345/206/262.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/271/346/241/210/347/256/241/347/220/206@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/226/275/345/267/245/345/221/230/347/256/241/347/220/206@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/240/344/272/272/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/227/245/346/234/237@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/346/210/277/351/227/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/347/233/221/346/216/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/231/272/350/203/275/351/227/250/347/246/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/233/262/347/272/277/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/211/345/256/263-/346/214/245/345/217/221/346/200/247/346/234/211/346/234/272/347/211/251.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/215/345/212/241/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/254/345/234/260/350/247/206/351/242/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/234/272/345/231/250/344/272/272 /344/272/272/345/267/245/346/231/272/350/203/275 .svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/237/261/347/212/266/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/346/270/205.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/207/347/255/276 /346/240/207/350/256/260@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250 /347/216/257/345/242/203.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/221/346/234/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/240/241/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/242/257/346/216/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/250/241/346/235/277.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/224/346/263/241/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/344/276/265/344/274/240/346/204/237.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/346/265/270/345/221/212/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/347/224/265/347/256/241/347/220/206_/345/211/257/346/234/254.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/260/264/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/202/346/225/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/241/346/237/223.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/261/275/350/275/246 /350/277/220/350/276/223 @2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/262/231/345/217/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/264/227/350/241/243/346/234/272 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/265/213/350/257/225 /347/247/222/350/241/250@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/265/264/346/261/240 /346/265/264/347/274/270 .svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/266/210/346/201/257@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/267/273/345/212/240/351/241/271/347/233/256-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/267/273/345/212/240/351/241/271/347/233/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246/350/277/207/344/275/216.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/251/345/272/246/350/277/207/351/253/230.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/270/270/346/210/217/344/274/221/351/227/262/345/250/261/344/271/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/271/277/345/272/246/350/277/207/344/275/216.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//346/271/277/345/272/246/350/277/207/351/253/230.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/347/201/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/253/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/255/347/201/253/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/201/257.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/237/351/233/276/345/221/212/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/203/255/346/260/264/345/243/266 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/205/247/345/272/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/207/203/346/260/224_/345/211/257/346/234/254.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/212/266/346/200/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203 /346/240/221/345/217/266.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203 /346/240/221/346/234/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203/347/233/221/346/265/213-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/242/203/347/233/221/346/265/213.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/216/257/345/275/242/345/233/276.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/347/203/267/345/274/202/345/270/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/262/351/206/233.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/345/212/250/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/345/255/220/345/233/264/346/240/217 /346/241/206/351/200/211.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/346/272/220 /347/224/265/347/223/266.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/247/206 /347/233/264/346/222/255 .svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/350/264/271.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/222/273.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/243/216/346/211/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/265/351/245/255/351/224/205 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/224/273/346/235/277.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/221/346/265/213.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/233/270/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/235/241/347/234/240.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/244/276/345/214/272/346/231/272/350/203/275-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/244/276/345/214/272/346/231/272/350/203/275.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/246/273/347/272/277.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/247/237/350/265/201/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/247/257/345/210/206/350/277/220/350/220/245@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/346/260/224/345/207/200/345/214/226/345/231/250 /345/256/266/347/224/265 /347/224/265/345/231/250.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/350/260/203.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/251/272/351/227/264@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/252/227/345/270/230.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/254/224/350/256/260/346/234/254/347/224/265/350/204/221-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/254/224/350/256/260/346/234/254/347/224/265/350/204/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205 /345/200/222/350/256/260/346/227/266@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/255/211/345/276/205@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/272/242/347/273/277/347/201/257@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/273/204/347/273/207/347/256/241/347/220/206@2x-2.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/273/204/347/273/207/347/256/241/347/220/206@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/274/226/350/276/221@2x.png +0 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/275/221/351/241/265.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//347/276/216/345/205/203@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/201/344/272/272 /350/200/201/345/271/264/344/272/272@2x.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/200/263/346/234/272.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/203/275/345/212/233.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/207/252/350/241/214/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/202/350/203/275.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/212/257/347/211/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/345/216/213/345/274/202/345/270/270.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/241/200/346/260/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/204/350/214/203.md +264 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/345/233/276/346/250/241/345/274/217.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221AI.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/247/206/351/242/221SD.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/242/345/215/225.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-3.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-4.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207-5.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/344/272/244/344/273/230-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/344/272/244/344/273/230.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/220/347/273/264.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/220/350/241/214/347/233/221/346/265/213.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/345/244/207/350/277/236/346/216/245.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/256/276/347/275/256/350/260/203/350/257/225.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/257/273/345/215/241/345/231/250 /344/277/241/345/217/267.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/246/345/217/267@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/247/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/255/347/211/251/350/275/246@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/264/255/347/211/251/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/265/204/344/272/247/344/270/255/345/277/203@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang-2.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/267/257/351/232/234lu zhang.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/246/350/241/214@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/254/344/272/244/346/235/203/351/231/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/244/205.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/256/346/270/241@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/275/277/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/220/350/220/245/347/256/241/347/220/206.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/220/350/276/223/350/275/246@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//350/277/233/345/272/246/346/235/241.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/200/232/346/226/255/345/231/250.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/201/245/346/216/247.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/223/201/351/224/271.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/224/256/347/233/230.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/347/243/201/345/221/212/350/255/246.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/250/351/224/201.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/227/256/345/217/267@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/230/266/346/242/257@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/252/350/212/261 /344/270/213/351/233/252 .svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/252/350/212/261 /345/210/266/345/206/267.svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/233/267/350/276/276 /346/211/253/346/217/217 /345/217/221/347/216/260 .svg" +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/235/231/350/204/211/346/263/250/345/260/204.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/237/263/345/223/215.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/241/271/347/233/256.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x-2.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/243/236/346/234/272@2x.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/251/254/346/241/266.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/345/210/206/345/255/220.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/253/230/346/270/205.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/resources/icons/product//351/274/240/346/240/207.svg +1 -0
- package/skills/micro-app-design/assets/tuya-design-system/source.json +18 -0
- package/skills/micro-app-design/references/action-outcomes.md +7 -0
- package/skills/micro-app-design/references/adaptive-card-grid.md +25 -0
- package/skills/micro-app-design/references/capsule-fallback.md +36 -0
- package/skills/micro-app-design/references/component-boundaries.md +48 -0
- package/skills/micro-app-design/references/component-catalog.md +69 -0
- package/skills/micro-app-design/references/design-system.md +34 -0
- package/skills/micro-app-design/references/empty-and-error-states.md +27 -0
- package/skills/micro-app-design/references/icons.md +33 -0
- package/skills/micro-app-design/references/implementation-guidance.md +39 -0
- package/skills/micro-app-design/references/modal.md +27 -0
- package/skills/micro-app-design/references/page-patterns.md +55 -0
- package/skills/micro-app-design/references/quality-checklist.md +57 -0
- package/skills/micro-app-design/references/requirements-and-permission-states.md +19 -0
- package/skills/micro-app-design/references/source-and-scope.md +40 -0
- package/skills/micro-app-design/references/tokens.md +23 -0
- package/skills/micro-app-design/references/visual-acceptance.md +51 -0
- package/skills/micro-app-design/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-design/scripts/visual-audit.mjs +197 -0
- package/skills/micro-app-design/tests/behavior-scenarios.md +154 -0
- package/skills/micro-app-design/tests/validate-design-skill.mjs +35 -0
- package/skills/micro-app-design/tests/validate-design-system.mjs +51 -0
- package/skills/micro-app-development/SKILL.md +132 -0
- package/skills/micro-app-development/agents/openai.yaml +6 -0
- package/skills/micro-app-development/references/agent-workflow.md +111 -0
- package/skills/micro-app-development/references/application-icons.md +50 -0
- package/skills/micro-app-development/references/data-change-safety.md +47 -0
- package/skills/micro-app-development/references/delivery-checklist.md +129 -0
- package/skills/micro-app-development/references/design-workflow.md +77 -0
- package/skills/micro-app-development/references/developer-credentials.md +97 -0
- package/skills/micro-app-development/references/development-guide.md +213 -0
- package/skills/micro-app-development/references/environment-progress.md +47 -0
- package/skills/micro-app-development/references/joint-acceptance.md +105 -0
- package/skills/micro-app-development/references/local-development.md +40 -0
- package/skills/micro-app-development/references/manifest-v1.2.md +129 -0
- package/skills/micro-app-development/references/npm-registry.md +48 -0
- package/skills/micro-app-development/references/platform-operations.md +48 -0
- package/skills/micro-app-development/references/project-workflow.md +36 -0
- package/skills/micro-app-development/references/publication-intent.md +34 -0
- package/skills/micro-app-development/references/publication-recovery.md +67 -0
- package/skills/micro-app-development/references/requirement-intake.md +122 -0
- package/skills/micro-app-development/references/runtime-requirements.md +23 -0
- package/skills/micro-app-development/references/space-permission-boundaries.md +46 -0
- package/skills/micro-app-development/references/tool-update.md +60 -0
- package/skills/micro-app-development/references/toolchain-access.md +33 -0
- package/skills/micro-app-development/references/user-journey.md +65 -0
- package/skills/micro-app-development/references/workspace-environments.md +39 -0
- package/skills/micro-app-development/scripts/application-icon.mjs +108 -0
- package/skills/micro-app-development/scripts/install-app-icon.mjs +48 -0
- package/skills/micro-app-development/scripts/install-menu-icon.mjs +27 -0
- package/skills/micro-app-development/scripts/language-policy.mjs +83 -0
- package/skills/micro-app-development/scripts/languages.json +372 -0
- package/skills/micro-app-development/scripts/locale-keys.mjs +26 -0
- package/skills/micro-app-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-development/scripts/project-code.mjs +13 -0
- package/skills/micro-app-development/scripts/review-backend-logging.mjs +27 -0
- package/skills/micro-app-development/scripts/review-production-authorization.mjs +37 -0
- package/skills/micro-app-development/scripts/validate-micro-app-project.mjs +442 -0
- package/skills/micro-app-development/tests/application-icons.test.mjs +131 -0
- package/skills/micro-app-development/tests/backend-logging-review.test.mjs +24 -0
- package/skills/micro-app-development/tests/behavior-scenarios.md +177 -0
- package/skills/micro-app-development/tests/data-change-safety-scenarios.md +25 -0
- package/skills/micro-app-development/tests/design-workflow-scenarios.md +40 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/en.json +6 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/_locales/zh-CN.json +6 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/manifest.json +59 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/micro.config.js +5 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/mock/index.json +11 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/package.json +4 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/index.tsx +5 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/en.ts +1 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/lang/zh.ts +1 -0
- package/skills/micro-app-development/tests/fixtures/valid-v6/src/public-path.js +3 -0
- package/skills/micro-app-development/tests/production-authorization-review.test.mjs +72 -0
- package/skills/micro-app-development/tests/six-skill-routing-scenarios.md +60 -0
- package/skills/micro-app-development/tests/user-journey-scenarios.md +19 -0
- package/skills/micro-app-development/tests/validate-micro-app-project.test.mjs +428 -0
- package/skills/micro-app-frontend-development/SKILL.md +86 -0
- package/skills/micro-app-frontend-development/agents/openai.yaml +6 -0
- package/skills/micro-app-frontend-development/references/api-and-permissions.md +86 -0
- package/skills/micro-app-frontend-development/references/custom-api-requests.md +52 -0
- package/skills/micro-app-frontend-development/references/debugging.md +36 -0
- package/skills/micro-app-frontend-development/references/i18n-and-theme.md +54 -0
- package/skills/micro-app-frontend-development/references/interaction-completion.md +61 -0
- package/skills/micro-app-frontend-development/references/micro-frontend-runtime.md +33 -0
- package/skills/micro-app-frontend-development/references/routing-and-context.md +96 -0
- package/skills/micro-app-frontend-development/references/saas-failure-and-display.md +45 -0
- package/skills/micro-app-frontend-development/references/standard-api-requests.md +30 -0
- package/skills/micro-app-frontend-development/references/submission-errors.md +51 -0
- package/skills/micro-app-frontend-development/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-frontend-development/tests/behavior-scenarios.md +36 -0
- package/skills/micro-app-solution-design/SKILL.md +69 -0
- package/skills/micro-app-solution-design/agents/openai.yaml +6 -0
- package/skills/micro-app-solution-design/scripts/microapp-kit.mjs +117 -0
- package/skills/micro-app-solution-design/tests/behavior-scenarios.md +12 -0
|
@@ -0,0 +1,3705 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>TuyaCapsuleSearch · 胶囊筛选组件预览</title>
|
|
7
|
+
<link href="https://cdn.jsdelivr.net/npm/remixicon@4.9.0/fonts/remixicon.css" rel="stylesheet" />
|
|
8
|
+
<style>
|
|
9
|
+
:root {
|
|
10
|
+
--color-primary: #165DFF;
|
|
11
|
+
--color-primary-bg: #E8F3FF;
|
|
12
|
+
--color-primary-bg-hover: rgba(22, 93, 255, 0.16);
|
|
13
|
+
--color-primary-border: rgba(22, 93, 255, 0.35);
|
|
14
|
+
--color-primary-text: #165DFF;
|
|
15
|
+
--color-text: #1D2129;
|
|
16
|
+
--color-text-secondary: #4E5969;
|
|
17
|
+
--color-text-tertiary: #86909C;
|
|
18
|
+
--color-text-quaternary: #C9CDD4;
|
|
19
|
+
--color-bg-base: #FFFFFF;
|
|
20
|
+
--color-bg-container: #FFFFFF;
|
|
21
|
+
--color-bg-layout: #F2F3F5;
|
|
22
|
+
--color-bg-spotlight: #FAFAFA;
|
|
23
|
+
--color-fill-tertiary: #F2F3F5;
|
|
24
|
+
--color-border-secondary: #E9EAEC;
|
|
25
|
+
--color-logo-text: #FFFFFF;
|
|
26
|
+
--color-warning: #FF7D00;
|
|
27
|
+
--font-cn: "PingFang SC", "Microsoft YaHei", sans-serif;
|
|
28
|
+
--space-xxs: 4px;
|
|
29
|
+
--space-xs: 8px;
|
|
30
|
+
--space-sm: 12px;
|
|
31
|
+
--space-md: 16px;
|
|
32
|
+
--space-lg: 20px;
|
|
33
|
+
--space-xl: 24px;
|
|
34
|
+
--space-2xl: 32px;
|
|
35
|
+
--space-3xl: 48px;
|
|
36
|
+
--radius-sm: 4px;
|
|
37
|
+
--radius-md: 6px;
|
|
38
|
+
--radius-lg: 8px;
|
|
39
|
+
--radius-full: 999px;
|
|
40
|
+
--shadow-box: 0 4px 10px 0 rgba(0, 0, 0, 0.1);
|
|
41
|
+
--shadow-box-secondary: 0 8px 20px 0 rgba(0, 0, 0, 0.1);
|
|
42
|
+
/* Ant Design 5 Tooltip(Tuya 魔改)— colorBgSpotlight / colorTextLightSolid */
|
|
43
|
+
--tooltip-bg: rgba(0, 0, 0, 0.85);
|
|
44
|
+
--tooltip-color: var(--color-logo-text);
|
|
45
|
+
--tooltip-radius: var(--radius-lg);
|
|
46
|
+
--tooltip-shadow: var(--shadow-box-secondary);
|
|
47
|
+
--tooltip-padding-block: 6px;
|
|
48
|
+
--tooltip-padding-inline: var(--space-xs);
|
|
49
|
+
--tooltip-max-width: 250px;
|
|
50
|
+
--tooltip-z-index: 1070;
|
|
51
|
+
--tooltip-gap: var(--space-xxs); /* 4px from field border to arrow tip */
|
|
52
|
+
--tooltip-arrow-size: 8px;
|
|
53
|
+
--capsule-field-height: 32px;
|
|
54
|
+
--capsule-field-divider-height: 12px;
|
|
55
|
+
--capsule-label-min: 68px;
|
|
56
|
+
--capsule-label-max: 112px;
|
|
57
|
+
--capsule-label-max-lg: 160px;
|
|
58
|
+
--capsule-value-min: 68px;
|
|
59
|
+
--capsule-value-max: 168px;
|
|
60
|
+
--capsule-value-max-lg: 240px;
|
|
61
|
+
--capsule-field-max-default: 280px;
|
|
62
|
+
--capsule-field-max-large: 400px;
|
|
63
|
+
--capsule-field-bg: var(--color-bg-container);
|
|
64
|
+
--capsule-field-border: var(--color-text-quaternary);
|
|
65
|
+
--capsule-field-border-hover: var(--color-primary);
|
|
66
|
+
--capsule-field-border-active: var(--color-primary);
|
|
67
|
+
--capsule-field-border-filled: var(--color-primary);
|
|
68
|
+
--capsule-field-label-color: var(--color-text);
|
|
69
|
+
--capsule-field-placeholder-color: var(--color-text-quaternary);
|
|
70
|
+
--capsule-field-value-color: var(--color-primary-text);
|
|
71
|
+
--capsule-field-divider-color: var(--color-text-quaternary);
|
|
72
|
+
--capsule-field-icon-color: var(--color-text-quaternary);
|
|
73
|
+
--capsule-field-clear-hover-bg: var(--color-bg-spotlight);
|
|
74
|
+
--capsule-field-focus-ring: 0 0 0 2px var(--color-primary-bg-hover);
|
|
75
|
+
--capsule-popover-bg: var(--color-bg-container);
|
|
76
|
+
--capsule-popover-radius: var(--radius-lg);
|
|
77
|
+
--capsule-popover-shadow: var(--shadow-box);
|
|
78
|
+
--capsule-popover-width: 200px;
|
|
79
|
+
--capsule-popover-list-max-width: 500px;
|
|
80
|
+
--capsule-popover-date-width: 280px;
|
|
81
|
+
--capsule-popover-range-width: 560px;
|
|
82
|
+
--capsule-popover-option-selected-bg: var(--color-primary-bg);
|
|
83
|
+
--capsule-popover-option-selected-color: var(--color-primary-text);
|
|
84
|
+
--capsule-popover-range-fill: var(--color-primary-bg);
|
|
85
|
+
--tree-row-height: 32px;
|
|
86
|
+
--tree-indent-size: 24px;
|
|
87
|
+
--tree-control-size: 24px;
|
|
88
|
+
--checkbox-size: 14px;
|
|
89
|
+
--checkbox-border: var(--color-text-quaternary);
|
|
90
|
+
--checkbox-focus-ring: 0 0 0 2px var(--color-primary-bg-hover);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
* { box-sizing: border-box; }
|
|
94
|
+
|
|
95
|
+
body {
|
|
96
|
+
margin: 0;
|
|
97
|
+
min-width: 320px;
|
|
98
|
+
color: var(--color-text);
|
|
99
|
+
background: var(--color-bg-base);
|
|
100
|
+
font: 14px/22px var(--font-cn);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.page-header {
|
|
104
|
+
padding: var(--space-lg) var(--space-xl);
|
|
105
|
+
border-bottom: 1px solid var(--color-border-secondary);
|
|
106
|
+
background: var(--color-bg-container);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.page-header h1 { margin: 0 0 var(--space-xxs); font-size: 20px; line-height: 28px; font-weight: 500; }
|
|
110
|
+
.page-header p { margin: 0; color: var(--color-text-secondary); font-size: 13px; }
|
|
111
|
+
.page-header code { padding: 0 4px; border-radius: var(--radius-sm); background: var(--color-bg-layout); font-size: 12px; }
|
|
112
|
+
|
|
113
|
+
.page-main {
|
|
114
|
+
max-width: 1440px;
|
|
115
|
+
margin: 0 auto;
|
|
116
|
+
padding: 0 var(--space-xl);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.section { margin: var(--space-xl) 0; }
|
|
120
|
+
.section-title { margin: 0 0 var(--space-md); font-size: 16px; line-height: 24px; font-weight: 500; }
|
|
121
|
+
.section-desc {
|
|
122
|
+
margin: calc(-1 * var(--space-xs)) 0 var(--space-md);
|
|
123
|
+
color: var(--color-text-tertiary);
|
|
124
|
+
font-size: 13px;
|
|
125
|
+
line-height: 22px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.panel {
|
|
129
|
+
border: 1px solid var(--color-border-secondary);
|
|
130
|
+
border-radius: var(--radius-lg);
|
|
131
|
+
background: var(--color-bg-container);
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.panel-head {
|
|
136
|
+
padding: var(--space-sm) var(--space-md);
|
|
137
|
+
border-bottom: 1px solid var(--color-border-secondary);
|
|
138
|
+
color: var(--color-text-secondary);
|
|
139
|
+
background: var(--color-bg-layout);
|
|
140
|
+
font-size: 12px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.panel-body { padding: var(--space-xl); }
|
|
144
|
+
|
|
145
|
+
.toolbar {
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: space-between;
|
|
148
|
+
align-items: flex-start;
|
|
149
|
+
gap: var(--space-3xl);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.button-group, .capsule-search, .filter-fields, .search-actions {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
gap: var(--space-xs);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.filter-panel { display: flex; justify-content: flex-end; flex: 1; min-width: 0; }
|
|
159
|
+
.capsule-search { justify-content: flex-end; gap: var(--space-md); flex-wrap: wrap; min-width: 0; }
|
|
160
|
+
.filter-fields { flex-wrap: wrap; contain: layout style; }
|
|
161
|
+
|
|
162
|
+
.btn {
|
|
163
|
+
height: 32px;
|
|
164
|
+
border-radius: var(--radius-full);
|
|
165
|
+
border: 1px solid var(--color-border-secondary);
|
|
166
|
+
padding: 0 var(--space-md);
|
|
167
|
+
background: var(--color-bg-container);
|
|
168
|
+
color: var(--color-text);
|
|
169
|
+
font: 14px/22px var(--font-cn);
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.btn.primary { border-color: var(--color-primary); color: var(--color-logo-text); background: var(--color-primary); }
|
|
174
|
+
.btn-rect { border-radius: var(--radius-md); }
|
|
175
|
+
|
|
176
|
+
/* Toolbar action buttons · Tuya SaaS */
|
|
177
|
+
.button-group .btn {
|
|
178
|
+
display: inline-flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
justify-content: center;
|
|
181
|
+
gap: var(--space-xxs);
|
|
182
|
+
cursor: pointer;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.button-group .btn.primary.btn-rect {
|
|
186
|
+
border: none;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.button-group .btn.btn-filled {
|
|
190
|
+
border: none;
|
|
191
|
+
background: var(--color-fill-tertiary);
|
|
192
|
+
color: var(--color-text);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.button-group .btn.btn-filled:hover {
|
|
196
|
+
background: var(--color-bg-spotlight);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.button-group .btn .tuya-icon {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
width: 16px;
|
|
204
|
+
height: 16px;
|
|
205
|
+
font-size: 16px;
|
|
206
|
+
line-height: 1;
|
|
207
|
+
color: inherit;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* ── Capsule field ── */
|
|
211
|
+
.filter-field {
|
|
212
|
+
position: relative;
|
|
213
|
+
display: inline-flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
width: auto;
|
|
216
|
+
height: var(--capsule-field-height);
|
|
217
|
+
border: 1px solid var(--capsule-field-border);
|
|
218
|
+
border-radius: var(--radius-full);
|
|
219
|
+
background: var(--capsule-field-bg);
|
|
220
|
+
flex-shrink: 0;
|
|
221
|
+
user-select: none;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.filter-field:not([data-width-mode="time"]):not(.filter-field-date-range) {
|
|
226
|
+
max-width: var(--capsule-field-max-default);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.filter-field[data-size="large"] {
|
|
230
|
+
max-width: var(--capsule-field-max-large);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.filter-field[data-width-mode="time"],
|
|
234
|
+
.filter-field.filter-field-date-range {
|
|
235
|
+
max-width: none;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.filter-label-wrap {
|
|
239
|
+
position: relative;
|
|
240
|
+
flex: 0 1 auto;
|
|
241
|
+
width: max-content;
|
|
242
|
+
min-width: var(--capsule-label-min);
|
|
243
|
+
max-width: var(--capsule-label-max);
|
|
244
|
+
cursor: default;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.filter-label-wrap.is-truncated {
|
|
248
|
+
cursor: help;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.filter-label-wrap--select {
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
max-width: none;
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.filter-label-wrap--select .filter-label {
|
|
259
|
+
padding-right: 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.filter-label-wrap--select .filter-label-arrow {
|
|
263
|
+
flex-shrink: 0;
|
|
264
|
+
width: 16px;
|
|
265
|
+
height: 16px;
|
|
266
|
+
display: inline-flex;
|
|
267
|
+
align-items: center;
|
|
268
|
+
justify-content: center;
|
|
269
|
+
margin-right: var(--space-xs);
|
|
270
|
+
color: var(--color-text-tertiary);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.filter-label-wrap--select.is-open .filter-label-arrow {
|
|
274
|
+
transform: rotate(180deg);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.filter-field[data-size="large"] .filter-label-wrap {
|
|
278
|
+
max-width: var(--capsule-label-max-lg);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.filter-field[data-width-mode="time"] .filter-label-wrap,
|
|
282
|
+
.filter-field.filter-field-date-range .filter-label-wrap {
|
|
283
|
+
max-width: var(--capsule-label-max);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.filter-label {
|
|
287
|
+
display: block;
|
|
288
|
+
box-sizing: border-box;
|
|
289
|
+
width: max-content;
|
|
290
|
+
max-width: 100%;
|
|
291
|
+
height: 22px;
|
|
292
|
+
padding: 0 var(--space-xs) 0 var(--space-sm);
|
|
293
|
+
color: var(--capsule-field-label-color);
|
|
294
|
+
line-height: 22px;
|
|
295
|
+
white-space: nowrap;
|
|
296
|
+
overflow: hidden;
|
|
297
|
+
text-overflow: ellipsis;
|
|
298
|
+
pointer-events: auto;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* Ant Design 5 Tooltip · Tuya SaaS 魔改(截断标签 hover) */
|
|
302
|
+
.tuya-antd-tooltip {
|
|
303
|
+
position: fixed;
|
|
304
|
+
z-index: var(--tooltip-z-index);
|
|
305
|
+
left: 0;
|
|
306
|
+
top: 0;
|
|
307
|
+
max-width: var(--tooltip-max-width);
|
|
308
|
+
box-sizing: border-box;
|
|
309
|
+
visibility: hidden;
|
|
310
|
+
opacity: 0;
|
|
311
|
+
pointer-events: none;
|
|
312
|
+
/* -100% lifts body above anchor; arrow + 4px gap from field border */
|
|
313
|
+
transform: translate(-50%, calc(-100% - var(--tooltip-arrow-size) - var(--tooltip-gap)));
|
|
314
|
+
transition: opacity 0.15s ease;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.tuya-antd-tooltip.is-open {
|
|
318
|
+
visibility: visible;
|
|
319
|
+
opacity: 1;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.tuya-antd-tooltip .ant-tooltip-content {
|
|
323
|
+
position: relative;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.tuya-antd-tooltip .ant-tooltip-inner {
|
|
327
|
+
min-width: 32px;
|
|
328
|
+
min-height: 32px;
|
|
329
|
+
padding: var(--tooltip-padding-block) var(--tooltip-padding-inline);
|
|
330
|
+
color: var(--tooltip-color);
|
|
331
|
+
text-align: start;
|
|
332
|
+
text-decoration: none;
|
|
333
|
+
word-wrap: break-word;
|
|
334
|
+
background: var(--tooltip-bg);
|
|
335
|
+
border-radius: var(--tooltip-radius);
|
|
336
|
+
box-shadow: var(--tooltip-shadow);
|
|
337
|
+
font: 14px/22px var(--font-cn);
|
|
338
|
+
box-sizing: border-box;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.tuya-antd-tooltip .ant-tooltip-arrow {
|
|
342
|
+
position: absolute;
|
|
343
|
+
left: 50%;
|
|
344
|
+
bottom: 0;
|
|
345
|
+
width: 16px;
|
|
346
|
+
height: var(--tooltip-arrow-size);
|
|
347
|
+
transform: translate(-50%, 100%);
|
|
348
|
+
overflow: hidden;
|
|
349
|
+
pointer-events: none;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.tuya-antd-tooltip .ant-tooltip-arrow::before {
|
|
353
|
+
content: "";
|
|
354
|
+
position: absolute;
|
|
355
|
+
left: 50%;
|
|
356
|
+
top: -4px;
|
|
357
|
+
width: 8px;
|
|
358
|
+
height: 8px;
|
|
359
|
+
background: var(--tooltip-bg);
|
|
360
|
+
transform: translateX(-50%) rotate(45deg);
|
|
361
|
+
border-radius: 1px;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* Value area: grow with content after fill; empty uses placeholder min */
|
|
365
|
+
.filter-body {
|
|
366
|
+
display: inline-flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
flex: 0 1 auto;
|
|
369
|
+
width: max-content;
|
|
370
|
+
max-width: var(--capsule-value-max);
|
|
371
|
+
min-width: 0;
|
|
372
|
+
overflow: hidden;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.filter-field[data-state="default"] .filter-body,
|
|
376
|
+
.filter-field[data-state="hover"] .filter-body,
|
|
377
|
+
.filter-field[data-state="active"] .filter-body {
|
|
378
|
+
min-width: var(--capsule-value-min);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Select / date: value hugs text; 4px to trail (no dead space before icon) */
|
|
382
|
+
.filter-field:has(.filter-trail)[data-state="default"] .filter-body,
|
|
383
|
+
.filter-field:has(.filter-trail)[data-state="hover"] .filter-body,
|
|
384
|
+
.filter-field:has(.filter-trail)[data-state="active"] .filter-body {
|
|
385
|
+
min-width: 0;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.filter-field[data-state="filled"] .filter-body,
|
|
389
|
+
.filter-field[data-state="filled-hover"] .filter-body,
|
|
390
|
+
.filter-field[data-state="filled-active"] .filter-body {
|
|
391
|
+
min-width: 0;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.filter-field[data-size="large"] .filter-body {
|
|
395
|
+
max-width: var(--capsule-value-max-lg);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.filter-field[data-width-mode="time"] .filter-body,
|
|
399
|
+
.filter-field.filter-field-date-range .filter-body {
|
|
400
|
+
width: max-content;
|
|
401
|
+
max-width: none;
|
|
402
|
+
min-width: 0;
|
|
403
|
+
flex-shrink: 0;
|
|
404
|
+
overflow: visible;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.filter-field[data-width-mode="time"][data-state="default"] .filter-body,
|
|
408
|
+
.filter-field.filter-field-date-range[data-state="default"] .filter-body {
|
|
409
|
+
min-width: 0;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.filter-field-input,
|
|
413
|
+
.filter-field-select,
|
|
414
|
+
.filter-field-date {
|
|
415
|
+
/* width from adaptive tokens */
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.filter-field.is-live { cursor: pointer; }
|
|
419
|
+
.filter-field.is-live.filter-field-input { cursor: text; }
|
|
420
|
+
.filter-field.is-live[data-field-type="select-search"][data-state="active"],
|
|
421
|
+
.filter-field.is-live[data-field-type="select-search"][data-state="filled-active"] {
|
|
422
|
+
cursor: text;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.filter-field.is-live[data-state="default"]:hover,
|
|
426
|
+
.filter-field.is-live[data-state="filled"]:hover {
|
|
427
|
+
border-color: var(--capsule-field-border-hover);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.filter-field.is-live[data-state="active"],
|
|
431
|
+
.filter-field.is-live[data-state="filled-active"] {
|
|
432
|
+
border-color: var(--capsule-field-border-active);
|
|
433
|
+
box-shadow: var(--capsule-field-focus-ring);
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.filter-field.is-live[data-state="filled"],
|
|
437
|
+
.filter-field.is-live[data-state="filled-active"] {
|
|
438
|
+
border-color: var(--capsule-field-border-filled);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.filter-field[data-state="hover"],
|
|
442
|
+
.filter-field[data-state="filled-hover"] { border-color: var(--capsule-field-border-hover); }
|
|
443
|
+
.filter-field[data-state="active"],
|
|
444
|
+
.filter-field[data-state="filled-active"] {
|
|
445
|
+
border-color: var(--capsule-field-border-active);
|
|
446
|
+
box-shadow: var(--capsule-field-focus-ring);
|
|
447
|
+
}
|
|
448
|
+
.filter-field[data-state="filled"],
|
|
449
|
+
.filter-field[data-state="filled-hover"],
|
|
450
|
+
.filter-field[data-state="filled-active"] { border-color: var(--capsule-field-border-filled); }
|
|
451
|
+
|
|
452
|
+
.filter-divider {
|
|
453
|
+
flex: 0 0 1px;
|
|
454
|
+
width: 1px;
|
|
455
|
+
height: var(--capsule-field-divider-height);
|
|
456
|
+
background: var(--capsule-field-divider-color);
|
|
457
|
+
pointer-events: none;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.filter-value {
|
|
461
|
+
display: inline-flex;
|
|
462
|
+
align-items: center;
|
|
463
|
+
flex: 0 1 auto;
|
|
464
|
+
width: max-content;
|
|
465
|
+
max-width: 100%;
|
|
466
|
+
min-width: 0;
|
|
467
|
+
height: 22px;
|
|
468
|
+
padding-left: var(--space-xs);
|
|
469
|
+
color: var(--capsule-field-placeholder-color);
|
|
470
|
+
white-space: nowrap;
|
|
471
|
+
overflow: hidden;
|
|
472
|
+
text-overflow: ellipsis;
|
|
473
|
+
pointer-events: none;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
.filter-field[data-width-mode="time"] .filter-value,
|
|
477
|
+
.filter-field.filter-field-date-range .filter-value {
|
|
478
|
+
flex: 0 0 auto;
|
|
479
|
+
overflow: visible;
|
|
480
|
+
text-overflow: clip;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.filter-value.is-value,
|
|
484
|
+
.filter-field[data-state="filled"] .filter-value,
|
|
485
|
+
.filter-field[data-state="filled-hover"] .filter-value,
|
|
486
|
+
.filter-field[data-state="filled-active"] .filter-value {
|
|
487
|
+
color: var(--capsule-field-value-color);
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.filter-input-native {
|
|
491
|
+
flex: 0 1 auto;
|
|
492
|
+
width: max-content;
|
|
493
|
+
min-width: var(--capsule-value-min);
|
|
494
|
+
max-width: 100%;
|
|
495
|
+
height: 22px;
|
|
496
|
+
margin: 0;
|
|
497
|
+
padding: 0 var(--space-xs);
|
|
498
|
+
border: 0;
|
|
499
|
+
outline: none;
|
|
500
|
+
background: transparent;
|
|
501
|
+
color: var(--color-text);
|
|
502
|
+
font: 14px/22px var(--font-cn);
|
|
503
|
+
cursor: text;
|
|
504
|
+
field-sizing: content;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.filter-input-native::placeholder { color: var(--capsule-field-placeholder-color); }
|
|
508
|
+
|
|
509
|
+
.filter-icon, .filter-separator {
|
|
510
|
+
display: inline-flex;
|
|
511
|
+
align-items: center;
|
|
512
|
+
justify-content: center;
|
|
513
|
+
flex: 0 0 auto;
|
|
514
|
+
color: var(--capsule-field-icon-color);
|
|
515
|
+
font-size: 14px;
|
|
516
|
+
line-height: 1;
|
|
517
|
+
pointer-events: none;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.filter-icon { width: 24px; height: 24px; }
|
|
521
|
+
.filter-separator { width: 16px; }
|
|
522
|
+
|
|
523
|
+
.capsule-icon {
|
|
524
|
+
display: block;
|
|
525
|
+
width: 16px;
|
|
526
|
+
height: 16px;
|
|
527
|
+
flex: 0 0 auto;
|
|
528
|
+
object-fit: contain;
|
|
529
|
+
pointer-events: none;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.filter-trail .filter-icon .capsule-icon {
|
|
533
|
+
width: 14px;
|
|
534
|
+
height: 14px;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.capsule-popover-list li .capsule-icon.check,
|
|
538
|
+
.capsule-popover-list li .check {
|
|
539
|
+
width: 14px;
|
|
540
|
+
height: 14px;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
.capsule-popover-search .capsule-icon {
|
|
544
|
+
width: 14px;
|
|
545
|
+
height: 14px;
|
|
546
|
+
flex-shrink: 0;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/* Trailing slot: arrow/calendar visible; clear overlays on hover only */
|
|
550
|
+
.filter-trail {
|
|
551
|
+
position: relative;
|
|
552
|
+
display: inline-flex;
|
|
553
|
+
align-items: center;
|
|
554
|
+
justify-content: center;
|
|
555
|
+
flex: 0 0 24px;
|
|
556
|
+
width: 24px;
|
|
557
|
+
height: 24px;
|
|
558
|
+
margin-left: var(--space-xxs); /* 4px between value and icon */
|
|
559
|
+
margin-right: var(--space-xxs);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
.filter-trail .filter-icon {
|
|
563
|
+
width: 24px;
|
|
564
|
+
height: 24px;
|
|
565
|
+
transition: opacity 0.12s ease, visibility 0.12s ease;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
.filter-clear {
|
|
569
|
+
display: inline-flex;
|
|
570
|
+
align-items: center;
|
|
571
|
+
justify-content: center;
|
|
572
|
+
box-sizing: border-box;
|
|
573
|
+
flex: 0 0 16px;
|
|
574
|
+
width: 16px;
|
|
575
|
+
height: 16px;
|
|
576
|
+
min-width: 16px;
|
|
577
|
+
min-height: 16px;
|
|
578
|
+
max-width: 16px;
|
|
579
|
+
max-height: 16px;
|
|
580
|
+
border: 0;
|
|
581
|
+
border-radius: var(--radius-full);
|
|
582
|
+
background: transparent;
|
|
583
|
+
padding: 0;
|
|
584
|
+
margin: 0;
|
|
585
|
+
cursor: pointer;
|
|
586
|
+
z-index: 1;
|
|
587
|
+
line-height: 0;
|
|
588
|
+
overflow: hidden;
|
|
589
|
+
font-size: 0;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
.filter-clear .capsule-icon,
|
|
593
|
+
.filter-clear img,
|
|
594
|
+
.filter-clear i {
|
|
595
|
+
display: block;
|
|
596
|
+
box-sizing: border-box;
|
|
597
|
+
width: 16px;
|
|
598
|
+
height: 16px;
|
|
599
|
+
min-width: 16px;
|
|
600
|
+
min-height: 16px;
|
|
601
|
+
max-width: 16px;
|
|
602
|
+
max-height: 16px;
|
|
603
|
+
font-size: 16px;
|
|
604
|
+
line-height: 16px;
|
|
605
|
+
object-fit: contain;
|
|
606
|
+
pointer-events: none;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
/* Trail slot is 24×24; clear stays 16×16 centered — do not inherit trail sizing */
|
|
610
|
+
.filter-trail .filter-clear,
|
|
611
|
+
.filter-trail .filter-clear .capsule-icon,
|
|
612
|
+
.filter-trail .filter-clear img {
|
|
613
|
+
width: 16px;
|
|
614
|
+
height: 16px;
|
|
615
|
+
min-width: 16px;
|
|
616
|
+
min-height: 16px;
|
|
617
|
+
max-width: 16px;
|
|
618
|
+
max-height: 16px;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.filter-clear:hover { opacity: 0.85; }
|
|
622
|
+
|
|
623
|
+
/* Select / date / cascader: clear hidden until hover; covers trailing icon */
|
|
624
|
+
.filter-trail .filter-clear {
|
|
625
|
+
position: absolute;
|
|
626
|
+
left: 50%;
|
|
627
|
+
top: 50%;
|
|
628
|
+
transform: translate(-50%, -50%);
|
|
629
|
+
margin: 0;
|
|
630
|
+
opacity: 0;
|
|
631
|
+
pointer-events: none;
|
|
632
|
+
transition: opacity 0.12s ease;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.filter-field:hover .filter-trail .filter-clear,
|
|
636
|
+
.filter-field[data-state="filled-hover"] .filter-trail .filter-clear {
|
|
637
|
+
opacity: 1;
|
|
638
|
+
pointer-events: auto;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/* Only hide arrow when clear is present (filled) and hovering */
|
|
642
|
+
.filter-field:hover .filter-trail:has(.filter-clear) .filter-icon,
|
|
643
|
+
.filter-field[data-state="filled-hover"] .filter-trail .filter-icon {
|
|
644
|
+
opacity: 0;
|
|
645
|
+
visibility: hidden;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/* Keep arrow when dropdown is open (active), even on hover — except select-search trail */
|
|
649
|
+
.filter-field[data-state="active"] .filter-trail .filter-clear,
|
|
650
|
+
.filter-field[data-state="filled-active"] .filter-trail .filter-clear {
|
|
651
|
+
opacity: 0;
|
|
652
|
+
pointer-events: none;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.filter-field[data-state="active"] .filter-trail:not(.filter-trail-select-search) .filter-icon,
|
|
656
|
+
.filter-field[data-state="filled-active"] .filter-trail:not(.filter-trail-select-search) .filter-icon,
|
|
657
|
+
.filter-field[data-state="default"]:hover .filter-trail:not(.filter-trail-select-search) .filter-icon,
|
|
658
|
+
.filter-field[data-state="hover"] .filter-trail:not(.filter-trail-select-search) .filter-icon,
|
|
659
|
+
.filter-field[data-state="active"]:hover .filter-trail:not(.filter-trail-select-search) .filter-icon {
|
|
660
|
+
opacity: 1;
|
|
661
|
+
visibility: visible;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
/* select-search: arrow at rest; search replaces arrow on hover / active (never both) */
|
|
665
|
+
.filter-trail-select-search .filter-icon-search {
|
|
666
|
+
position: absolute;
|
|
667
|
+
left: 50%;
|
|
668
|
+
top: 50%;
|
|
669
|
+
transform: translate(-50%, -50%);
|
|
670
|
+
opacity: 0;
|
|
671
|
+
visibility: hidden;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
.filter-field[data-field-type="select-search"]:is(
|
|
675
|
+
:hover,
|
|
676
|
+
[data-state="hover"],
|
|
677
|
+
[data-state="active"],
|
|
678
|
+
[data-state="filled-active"]
|
|
679
|
+
) .filter-trail-select-search .filter-icon-arrow {
|
|
680
|
+
opacity: 0;
|
|
681
|
+
visibility: hidden;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.filter-field[data-field-type="select-search"]:is(
|
|
685
|
+
:hover,
|
|
686
|
+
[data-state="hover"],
|
|
687
|
+
[data-state="active"],
|
|
688
|
+
[data-state="filled-active"]
|
|
689
|
+
) .filter-trail-select-search .filter-icon-search {
|
|
690
|
+
opacity: 1;
|
|
691
|
+
visibility: visible;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.filter-field[data-field-type="select-search"]:hover .filter-trail-select-search:has(.filter-clear) .filter-icon-search {
|
|
695
|
+
opacity: 0;
|
|
696
|
+
visibility: hidden;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/* Input filled: clear occupies same 24px trail slot (no arrow); always visible */
|
|
700
|
+
.filter-field[data-field-type="input"] .filter-trail-clear-only .filter-clear {
|
|
701
|
+
opacity: 1;
|
|
702
|
+
pointer-events: auto;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.filter-tags { display: inline-flex; align-items: center; gap: var(--space-xxs); padding-right: var(--space-xxs); }
|
|
706
|
+
.filter-tag {
|
|
707
|
+
display: inline-flex;
|
|
708
|
+
align-items: center;
|
|
709
|
+
height: 22px;
|
|
710
|
+
padding: 0 var(--space-xs);
|
|
711
|
+
border-radius: var(--radius-sm);
|
|
712
|
+
background: var(--color-primary-bg);
|
|
713
|
+
color: var(--color-primary-text);
|
|
714
|
+
font-size: 12px;
|
|
715
|
+
line-height: 20px;
|
|
716
|
+
white-space: nowrap;
|
|
717
|
+
}
|
|
718
|
+
.filter-tag-more { color: var(--color-primary-text); font-size: 12px; white-space: nowrap; }
|
|
719
|
+
|
|
720
|
+
/* ── Live popover portal ── */
|
|
721
|
+
.popover-portal {
|
|
722
|
+
position: fixed;
|
|
723
|
+
z-index: 1000;
|
|
724
|
+
display: none;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.popover-portal.is-open { display: block; }
|
|
728
|
+
|
|
729
|
+
.capsule-popover {
|
|
730
|
+
width: var(--capsule-popover-width, 200px);
|
|
731
|
+
border-radius: var(--capsule-popover-radius);
|
|
732
|
+
background: var(--capsule-popover-bg);
|
|
733
|
+
box-shadow: var(--capsule-popover-shadow);
|
|
734
|
+
overflow: hidden;
|
|
735
|
+
text-align: left;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
.capsule-popover.is-date {
|
|
739
|
+
width: var(--capsule-popover-date-width, 280px);
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.capsule-popover.is-date-range {
|
|
743
|
+
width: var(--capsule-popover-range-width, 560px);
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
.capsule-popover.is-fit-content {
|
|
747
|
+
width: max-content;
|
|
748
|
+
max-width: var(--capsule-popover-list-max-width, 500px);
|
|
749
|
+
box-sizing: border-box;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.capsule-popover.is-fit-content .capsule-popover-list {
|
|
753
|
+
min-width: 100%;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.capsule-popover.is-fit-content .capsule-popover-list li {
|
|
757
|
+
gap: var(--space-sm);
|
|
758
|
+
white-space: nowrap;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.capsule-popover.xwide { width: var(--capsule-popover-range-width, 560px); }
|
|
762
|
+
|
|
763
|
+
.capsule-popover-search {
|
|
764
|
+
display: flex;
|
|
765
|
+
align-items: center;
|
|
766
|
+
gap: var(--space-xs);
|
|
767
|
+
height: 32px;
|
|
768
|
+
margin: var(--space-xs);
|
|
769
|
+
padding: 0 var(--space-sm);
|
|
770
|
+
border-radius: var(--radius-md);
|
|
771
|
+
background: var(--color-fill-tertiary);
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.capsule-popover-search input {
|
|
775
|
+
flex: 1;
|
|
776
|
+
min-width: 0;
|
|
777
|
+
border: 0;
|
|
778
|
+
outline: none;
|
|
779
|
+
background: transparent;
|
|
780
|
+
color: var(--color-text);
|
|
781
|
+
font: 13px/20px var(--font-cn);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.capsule-popover-search input::placeholder { color: var(--color-text-quaternary); }
|
|
785
|
+
|
|
786
|
+
.capsule-popover-list { margin: 0; padding: var(--space-xxs) 0; list-style: none; max-height: 220px; overflow-y: auto; }
|
|
787
|
+
|
|
788
|
+
.capsule-popover-list li {
|
|
789
|
+
display: flex;
|
|
790
|
+
align-items: center;
|
|
791
|
+
justify-content: space-between;
|
|
792
|
+
height: 32px;
|
|
793
|
+
padding: 0 var(--space-md);
|
|
794
|
+
color: var(--color-text);
|
|
795
|
+
font-size: 14px;
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
.capsule-popover-list li:hover { background: var(--color-bg-spotlight); }
|
|
800
|
+
.capsule-popover-list li.is-selected {
|
|
801
|
+
background: var(--capsule-popover-option-selected-bg);
|
|
802
|
+
color: var(--capsule-popover-option-selected-color);
|
|
803
|
+
}
|
|
804
|
+
.capsule-popover-list li .check { color: var(--color-primary); font-size: 14px; }
|
|
805
|
+
.capsule-popover-list li.is-hidden { display: none; }
|
|
806
|
+
|
|
807
|
+
.capsule-popover-list li.capsule-popover-empty {
|
|
808
|
+
justify-content: flex-start;
|
|
809
|
+
color: var(--color-text-tertiary);
|
|
810
|
+
cursor: default;
|
|
811
|
+
pointer-events: none;
|
|
812
|
+
user-select: none;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.capsule-popover-list li.capsule-popover-empty:hover {
|
|
816
|
+
background: transparent;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
/* multi-select tree mode: TuyaAntdTree selection-only composition */
|
|
820
|
+
.capsule-popover.is-tree-multi {
|
|
821
|
+
width: max-content;
|
|
822
|
+
max-width: var(--capsule-popover-list-max-width);
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.tree-multi-viewport {
|
|
826
|
+
min-width: 224px;
|
|
827
|
+
max-height: 320px;
|
|
828
|
+
padding: var(--space-xxs) 0;
|
|
829
|
+
overflow: auto;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.tree-multi {
|
|
833
|
+
width: max-content;
|
|
834
|
+
min-width: 100%;
|
|
835
|
+
color: var(--color-text-secondary);
|
|
836
|
+
user-select: none;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
.tree-multi-node {
|
|
840
|
+
--tree-line-color: var(--color-border-secondary);
|
|
841
|
+
display: flex;
|
|
842
|
+
align-items: stretch;
|
|
843
|
+
width: 100%;
|
|
844
|
+
min-height: var(--tree-row-height);
|
|
845
|
+
line-height: var(--tree-row-height);
|
|
846
|
+
outline: none;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.tree-multi-indent {
|
|
850
|
+
align-self: stretch;
|
|
851
|
+
white-space: nowrap;
|
|
852
|
+
pointer-events: none;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.tree-multi-indent-unit {
|
|
856
|
+
position: relative;
|
|
857
|
+
display: inline-block;
|
|
858
|
+
width: var(--tree-indent-size);
|
|
859
|
+
height: 100%;
|
|
860
|
+
min-height: var(--tree-row-height);
|
|
861
|
+
vertical-align: top;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
.tree-multi-indent-unit::before {
|
|
865
|
+
content: "";
|
|
866
|
+
position: absolute;
|
|
867
|
+
top: 0;
|
|
868
|
+
bottom: -1px;
|
|
869
|
+
left: calc(var(--tree-indent-size) / 2 - 0.5px);
|
|
870
|
+
border-left: 1px solid var(--tree-line-color);
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.tree-multi-indent-unit.is-end::before { display: none; }
|
|
874
|
+
|
|
875
|
+
.tree-multi-switcher,
|
|
876
|
+
.tree-multi-checkbox {
|
|
877
|
+
display: inline-flex;
|
|
878
|
+
align-items: center;
|
|
879
|
+
justify-content: center;
|
|
880
|
+
flex: 0 0 var(--tree-control-size);
|
|
881
|
+
width: var(--tree-control-size);
|
|
882
|
+
min-height: var(--tree-row-height);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
.tree-multi-switcher {
|
|
886
|
+
position: relative;
|
|
887
|
+
border: 0;
|
|
888
|
+
padding: 0;
|
|
889
|
+
color: var(--color-text-secondary);
|
|
890
|
+
background: transparent;
|
|
891
|
+
cursor: pointer;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
.tree-multi-switcher.is-leaf {
|
|
895
|
+
cursor: default;
|
|
896
|
+
pointer-events: none;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.tree-multi-arrow {
|
|
900
|
+
width: 16px;
|
|
901
|
+
height: 16px;
|
|
902
|
+
transform: rotate(-90deg);
|
|
903
|
+
transition: transform 0.2s ease;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.tree-multi-node.is-expanded > .tree-multi-switcher .tree-multi-arrow {
|
|
907
|
+
transform: rotate(0);
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
.tree-multi-checkbox {
|
|
911
|
+
position: relative;
|
|
912
|
+
cursor: pointer;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.tree-multi-checkbox input {
|
|
916
|
+
position: relative;
|
|
917
|
+
width: var(--checkbox-size);
|
|
918
|
+
height: var(--checkbox-size);
|
|
919
|
+
margin: 0;
|
|
920
|
+
border: 2px solid var(--checkbox-border);
|
|
921
|
+
border-radius: var(--radius-sm);
|
|
922
|
+
outline: 0;
|
|
923
|
+
background: var(--color-bg-container);
|
|
924
|
+
appearance: none;
|
|
925
|
+
-webkit-appearance: none;
|
|
926
|
+
cursor: pointer;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
.tree-multi-checkbox input:hover,
|
|
930
|
+
.tree-multi-checkbox input:focus-visible {
|
|
931
|
+
border-color: var(--color-primary);
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
.tree-multi-checkbox input:focus-visible {
|
|
935
|
+
box-shadow: var(--checkbox-focus-ring);
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
.tree-multi-checkbox input:checked {
|
|
939
|
+
border-color: var(--color-primary);
|
|
940
|
+
background: var(--color-primary);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.tree-multi-checkbox input:disabled {
|
|
944
|
+
border-color: var(--color-border-secondary);
|
|
945
|
+
background: var(--color-fill-tertiary);
|
|
946
|
+
cursor: not-allowed;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
.tree-multi-check-icon {
|
|
950
|
+
position: absolute;
|
|
951
|
+
left: 50%;
|
|
952
|
+
top: 50%;
|
|
953
|
+
display: none;
|
|
954
|
+
width: 9px;
|
|
955
|
+
height: 7px;
|
|
956
|
+
transform: translate(-50%, -50%);
|
|
957
|
+
pointer-events: none;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.tree-multi-checkbox input:checked + .tree-multi-check-icon { display: block; }
|
|
961
|
+
|
|
962
|
+
.tree-multi-indeterminate {
|
|
963
|
+
position: absolute;
|
|
964
|
+
left: 50%;
|
|
965
|
+
top: 50%;
|
|
966
|
+
display: none;
|
|
967
|
+
width: 6px;
|
|
968
|
+
height: 6px;
|
|
969
|
+
border-radius: 1px;
|
|
970
|
+
background: var(--color-primary);
|
|
971
|
+
transform: translate(-50%, -50%);
|
|
972
|
+
pointer-events: none;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
.tree-multi-checkbox input:indeterminate {
|
|
976
|
+
border-color: var(--color-primary);
|
|
977
|
+
background: var(--color-bg-container);
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
.tree-multi-checkbox input:indeterminate ~ .tree-multi-indeterminate { display: block; }
|
|
981
|
+
|
|
982
|
+
.tree-multi-content {
|
|
983
|
+
display: inline-flex;
|
|
984
|
+
align-items: center;
|
|
985
|
+
flex: 1 1 auto;
|
|
986
|
+
min-width: 0;
|
|
987
|
+
min-height: var(--tree-row-height);
|
|
988
|
+
padding: 0 var(--space-xs);
|
|
989
|
+
border: 0;
|
|
990
|
+
border-radius: var(--radius-lg);
|
|
991
|
+
color: var(--color-text-secondary);
|
|
992
|
+
background: transparent;
|
|
993
|
+
font: inherit;
|
|
994
|
+
text-align: left;
|
|
995
|
+
white-space: nowrap;
|
|
996
|
+
cursor: pointer;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.tree-multi-content:hover { background: var(--color-bg-spotlight); }
|
|
1000
|
+
|
|
1001
|
+
.tree-multi-node:focus-visible > .tree-multi-content {
|
|
1002
|
+
outline: 2px solid var(--color-primary-border);
|
|
1003
|
+
outline-offset: -2px;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.tree-multi-node.is-disabled > .tree-multi-switcher,
|
|
1007
|
+
.tree-multi-node.is-disabled > .tree-multi-content {
|
|
1008
|
+
color: var(--color-text-quaternary);
|
|
1009
|
+
cursor: not-allowed;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
.cal-head {
|
|
1013
|
+
display: flex;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
justify-content: space-between;
|
|
1016
|
+
padding: var(--space-sm) var(--space-md);
|
|
1017
|
+
color: var(--color-text);
|
|
1018
|
+
font-size: 14px;
|
|
1019
|
+
line-height: 22px;
|
|
1020
|
+
font-weight: 500;
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
.cal-head button {
|
|
1024
|
+
border: 0;
|
|
1025
|
+
background: transparent;
|
|
1026
|
+
color: var(--color-text-secondary);
|
|
1027
|
+
cursor: pointer;
|
|
1028
|
+
padding: 4px;
|
|
1029
|
+
font-size: 14px;
|
|
1030
|
+
line-height: 1;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.cal-grid {
|
|
1034
|
+
display: grid;
|
|
1035
|
+
grid-template-columns: repeat(7, 1fr);
|
|
1036
|
+
gap: 2px;
|
|
1037
|
+
padding: 0 var(--space-sm) var(--space-sm);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
.cal-grid span {
|
|
1041
|
+
display: flex;
|
|
1042
|
+
align-items: center;
|
|
1043
|
+
justify-content: center;
|
|
1044
|
+
height: 28px;
|
|
1045
|
+
border-radius: var(--radius-full);
|
|
1046
|
+
color: var(--color-text-secondary);
|
|
1047
|
+
font-size: 14px;
|
|
1048
|
+
line-height: 22px;
|
|
1049
|
+
cursor: pointer;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
.cal-grid span.is-empty { cursor: default; }
|
|
1053
|
+
.cal-grid .wk {
|
|
1054
|
+
color: var(--color-text-quaternary);
|
|
1055
|
+
font-size: 14px;
|
|
1056
|
+
line-height: 22px;
|
|
1057
|
+
cursor: default;
|
|
1058
|
+
}
|
|
1059
|
+
.cal-grid span.is-disabled {
|
|
1060
|
+
color: var(--color-text-quaternary);
|
|
1061
|
+
cursor: not-allowed;
|
|
1062
|
+
opacity: 0.45;
|
|
1063
|
+
}
|
|
1064
|
+
.cal-grid span.is-disabled:hover {
|
|
1065
|
+
background: transparent;
|
|
1066
|
+
}
|
|
1067
|
+
.cal-grid span:not(.wk):not(.is-empty):not(.is-disabled):hover {
|
|
1068
|
+
background: var(--color-bg-spotlight);
|
|
1069
|
+
}
|
|
1070
|
+
.cal-grid .today {
|
|
1071
|
+
border: 1px solid var(--color-primary);
|
|
1072
|
+
color: var(--color-primary);
|
|
1073
|
+
}
|
|
1074
|
+
.cal-grid .today:hover:not(.picked) {
|
|
1075
|
+
background: var(--color-primary-bg);
|
|
1076
|
+
color: var(--color-primary);
|
|
1077
|
+
}
|
|
1078
|
+
/* Selected must beat generic hover (higher specificity) */
|
|
1079
|
+
.cal-grid .picked,
|
|
1080
|
+
.cal-grid .picked:hover,
|
|
1081
|
+
.cal-grid span.picked:not(.wk):not(.is-empty):hover {
|
|
1082
|
+
background: var(--color-primary);
|
|
1083
|
+
color: var(--color-logo-text);
|
|
1084
|
+
border-color: var(--color-primary);
|
|
1085
|
+
}
|
|
1086
|
+
.cal-grid .in-range { background: var(--capsule-popover-range-fill); border-radius: 0; }
|
|
1087
|
+
.cal-grid .in-range:hover { background: var(--capsule-popover-range-fill); }
|
|
1088
|
+
/* Selecting end date: preview between start and hover — colorPrimaryBg */
|
|
1089
|
+
.cal-grid .in-range-hover {
|
|
1090
|
+
background: var(--color-primary-bg); /* #E8F3FF */
|
|
1091
|
+
border-radius: 0;
|
|
1092
|
+
}
|
|
1093
|
+
.cal-grid .in-range-hover:hover {
|
|
1094
|
+
background: var(--color-primary-bg);
|
|
1095
|
+
}
|
|
1096
|
+
.cal-grid .range-start,
|
|
1097
|
+
.cal-grid .range-start:hover,
|
|
1098
|
+
.cal-grid .range-end,
|
|
1099
|
+
.cal-grid .range-end:hover {
|
|
1100
|
+
background: var(--color-primary);
|
|
1101
|
+
color: var(--color-logo-text);
|
|
1102
|
+
}
|
|
1103
|
+
.cal-grid .range-start { border-radius: var(--radius-full) 0 0 var(--radius-full); }
|
|
1104
|
+
.cal-grid .range-end { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
|
|
1105
|
+
|
|
1106
|
+
.cal-foot {
|
|
1107
|
+
padding: var(--space-xs) var(--space-md) var(--space-sm);
|
|
1108
|
+
border-top: 1px solid var(--color-border-secondary);
|
|
1109
|
+
color: var(--color-primary-text);
|
|
1110
|
+
font-size: 14px;
|
|
1111
|
+
line-height: 22px;
|
|
1112
|
+
text-align: center;
|
|
1113
|
+
cursor: pointer;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.cal-foot:hover { background: var(--color-bg-spotlight); }
|
|
1117
|
+
|
|
1118
|
+
.range-picker {
|
|
1119
|
+
display: flex;
|
|
1120
|
+
align-items: stretch;
|
|
1121
|
+
}
|
|
1122
|
+
.range-picker .cal-side {
|
|
1123
|
+
flex: 1 1 0;
|
|
1124
|
+
min-width: 0;
|
|
1125
|
+
width: 280px;
|
|
1126
|
+
}
|
|
1127
|
+
.range-picker .cal-side + .cal-side {
|
|
1128
|
+
border-left: 1px solid var(--color-border-secondary);
|
|
1129
|
+
}
|
|
1130
|
+
.cal-head.is-range-left,
|
|
1131
|
+
.cal-head.is-range-right {
|
|
1132
|
+
justify-content: space-between;
|
|
1133
|
+
}
|
|
1134
|
+
.cal-head .cal-head-spacer {
|
|
1135
|
+
width: 28px;
|
|
1136
|
+
flex: 0 0 28px;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
/* Cascader menus (Ant Design Cascader layout) */
|
|
1140
|
+
.capsule-popover.is-cascader {
|
|
1141
|
+
width: auto;
|
|
1142
|
+
max-width: none;
|
|
1143
|
+
display: inline-flex;
|
|
1144
|
+
overflow: hidden;
|
|
1145
|
+
}
|
|
1146
|
+
.cascader-menus {
|
|
1147
|
+
display: flex;
|
|
1148
|
+
align-items: stretch;
|
|
1149
|
+
flex-direction: row;
|
|
1150
|
+
}
|
|
1151
|
+
.cascader-menu {
|
|
1152
|
+
margin: 0;
|
|
1153
|
+
padding: var(--space-xxs) 0;
|
|
1154
|
+
list-style: none;
|
|
1155
|
+
min-width: 128px;
|
|
1156
|
+
max-height: 220px;
|
|
1157
|
+
overflow-x: hidden;
|
|
1158
|
+
overflow-y: auto;
|
|
1159
|
+
border-right: 1px solid var(--color-border-secondary);
|
|
1160
|
+
}
|
|
1161
|
+
.cascader-menu:last-child {
|
|
1162
|
+
border-right: 0;
|
|
1163
|
+
}
|
|
1164
|
+
.cascader-menu-item {
|
|
1165
|
+
display: flex;
|
|
1166
|
+
align-items: center;
|
|
1167
|
+
justify-content: space-between;
|
|
1168
|
+
gap: var(--space-xs);
|
|
1169
|
+
height: 32px;
|
|
1170
|
+
padding: 0 var(--space-md);
|
|
1171
|
+
color: var(--color-text);
|
|
1172
|
+
font-size: 14px;
|
|
1173
|
+
line-height: 22px;
|
|
1174
|
+
white-space: nowrap;
|
|
1175
|
+
cursor: pointer;
|
|
1176
|
+
}
|
|
1177
|
+
.cascader-menu-item:hover {
|
|
1178
|
+
background: var(--color-bg-spotlight);
|
|
1179
|
+
}
|
|
1180
|
+
.cascader-menu-item.is-active,
|
|
1181
|
+
.cascader-menu-item.is-selected {
|
|
1182
|
+
background: var(--capsule-popover-option-selected-bg);
|
|
1183
|
+
color: var(--capsule-popover-option-selected-color);
|
|
1184
|
+
}
|
|
1185
|
+
.cascader-menu-item .cascader-item-expand {
|
|
1186
|
+
flex: 0 0 14px;
|
|
1187
|
+
width: 14px;
|
|
1188
|
+
height: 14px;
|
|
1189
|
+
color: var(--color-text-quaternary);
|
|
1190
|
+
}
|
|
1191
|
+
.cascader-menu-item.is-active .cascader-item-expand,
|
|
1192
|
+
.cascader-menu-item.is-selected .cascader-item-expand {
|
|
1193
|
+
color: var(--color-primary);
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
/* Date / time field values match calendar popover body size */
|
|
1197
|
+
.filter-field-date .filter-value,
|
|
1198
|
+
.filter-field-date-range .filter-value,
|
|
1199
|
+
.filter-field[data-width-mode="time"] .filter-value {
|
|
1200
|
+
font-size: 14px;
|
|
1201
|
+
line-height: 22px;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
.live-result {
|
|
1205
|
+
margin-top: var(--space-xl);
|
|
1206
|
+
padding: var(--space-md);
|
|
1207
|
+
border: 1px solid var(--color-border-secondary);
|
|
1208
|
+
border-radius: var(--radius-lg);
|
|
1209
|
+
background: var(--color-bg-layout);
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
.live-result h3 { margin: 0 0 var(--space-sm); font-size: 14px; font-weight: 500; }
|
|
1213
|
+
.live-result pre {
|
|
1214
|
+
margin: 0;
|
|
1215
|
+
padding: var(--space-sm);
|
|
1216
|
+
border-radius: var(--radius-md);
|
|
1217
|
+
background: var(--color-bg-container);
|
|
1218
|
+
color: var(--color-text-secondary);
|
|
1219
|
+
font-size: 12px;
|
|
1220
|
+
line-height: 20px;
|
|
1221
|
+
overflow-x: auto;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
.tuya-antd-alert.ant-alert {
|
|
1225
|
+
display: flex;
|
|
1226
|
+
align-items: flex-start;
|
|
1227
|
+
gap: var(--space-xs);
|
|
1228
|
+
padding: var(--space-xs) var(--space-sm);
|
|
1229
|
+
border: 1px solid var(--color-primary-border);
|
|
1230
|
+
border-radius: var(--radius-lg);
|
|
1231
|
+
background: var(--color-primary-bg);
|
|
1232
|
+
font: 14px/22px var(--font-cn);
|
|
1233
|
+
color: var(--color-text);
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
.tuya-antd-alert .ant-alert-icon {
|
|
1237
|
+
flex-shrink: 0;
|
|
1238
|
+
display: inline-flex;
|
|
1239
|
+
align-items: center;
|
|
1240
|
+
height: 22px;
|
|
1241
|
+
color: var(--color-primary);
|
|
1242
|
+
font-size: 16px;
|
|
1243
|
+
line-height: 1;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
.tuya-antd-alert .ant-alert-content {
|
|
1247
|
+
flex: 1;
|
|
1248
|
+
min-width: 0;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.tuya-antd-alert .ant-alert-message {
|
|
1252
|
+
color: var(--color-text-secondary);
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
.live-hint {
|
|
1256
|
+
margin: 0 0 var(--space-xl);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
.mock-table {
|
|
1260
|
+
margin-top: var(--space-md);
|
|
1261
|
+
border: 1px solid var(--color-border-secondary);
|
|
1262
|
+
border-radius: var(--radius-lg);
|
|
1263
|
+
overflow: hidden;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
.mock-table table { width: 100%; border-collapse: collapse; }
|
|
1267
|
+
.mock-table th, .mock-table td {
|
|
1268
|
+
height: 40px;
|
|
1269
|
+
padding: 0 var(--space-md);
|
|
1270
|
+
border-bottom: 1px solid var(--color-border-secondary);
|
|
1271
|
+
text-align: left;
|
|
1272
|
+
font-size: 13px;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
.mock-table th { background: var(--color-bg-layout); color: var(--color-text-secondary); font-weight: 500; }
|
|
1276
|
+
|
|
1277
|
+
/* ── §2 Page context scenarios ── */
|
|
1278
|
+
.panel-body--context-scenarios {
|
|
1279
|
+
padding: 0;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
.context-scenarios {
|
|
1283
|
+
display: flex;
|
|
1284
|
+
flex-direction: column;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
.context-scenario {
|
|
1288
|
+
display: flex;
|
|
1289
|
+
flex-direction: column;
|
|
1290
|
+
align-items: stretch;
|
|
1291
|
+
gap: var(--space-sm);
|
|
1292
|
+
padding: var(--space-xl);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
.context-scenario + .context-scenario {
|
|
1296
|
+
border-top: 1px solid var(--color-border-secondary);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
.context-scenario-label {
|
|
1300
|
+
color: var(--color-warning);
|
|
1301
|
+
font-size: 13px;
|
|
1302
|
+
line-height: 22px;
|
|
1303
|
+
white-space: nowrap;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
.context-scenario-desc {
|
|
1307
|
+
margin-top: calc(-1 * var(--space-xxs));
|
|
1308
|
+
color: var(--color-text-tertiary);
|
|
1309
|
+
font-size: 12px;
|
|
1310
|
+
line-height: 20px;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.context-scenario-head {
|
|
1314
|
+
display: flex;
|
|
1315
|
+
flex-direction: column;
|
|
1316
|
+
gap: var(--space-xxs);
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
.context-scenario-demo {
|
|
1320
|
+
width: 100%;
|
|
1321
|
+
min-width: 0;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.context-scenario-demo--stack {
|
|
1325
|
+
display: flex;
|
|
1326
|
+
flex-direction: column;
|
|
1327
|
+
gap: var(--space-md);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
.toolbar--multiline,
|
|
1331
|
+
.toolbar--expand-wrap {
|
|
1332
|
+
flex-direction: column;
|
|
1333
|
+
gap: var(--space-md);
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
.toolbar--multiline {
|
|
1337
|
+
align-items: stretch;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.toolbar--expand-wrap {
|
|
1341
|
+
align-items: flex-start;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
.toolbar--multiline .filter-panel {
|
|
1345
|
+
flex: none;
|
|
1346
|
+
width: 100%;
|
|
1347
|
+
justify-content: flex-start;
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
.toolbar--expand-wrap .filter-panel {
|
|
1351
|
+
flex: none;
|
|
1352
|
+
width: auto;
|
|
1353
|
+
max-width: 100%;
|
|
1354
|
+
justify-content: flex-start;
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
.toolbar--multiline .capsule-search,
|
|
1358
|
+
.toolbar--expand-wrap .capsule-search {
|
|
1359
|
+
display: flex;
|
|
1360
|
+
flex-wrap: wrap;
|
|
1361
|
+
align-items: center;
|
|
1362
|
+
justify-content: flex-start;
|
|
1363
|
+
gap: var(--space-xs);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
.toolbar--multiline .filter-fields,
|
|
1367
|
+
.toolbar--expand-wrap .filter-fields {
|
|
1368
|
+
display: contents;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
.toolbar--multiline .search-actions,
|
|
1372
|
+
.toolbar--expand-wrap .search-actions {
|
|
1373
|
+
flex-shrink: 0;
|
|
1374
|
+
margin-left: calc(var(--space-md) - var(--space-xs));
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
.toolbar--no-actions:not(.toolbar--multiline) .capsule-search {
|
|
1378
|
+
justify-content: flex-end;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.toolbar--no-buttons {
|
|
1382
|
+
justify-content: flex-start;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.toolbar--no-buttons .filter-panel {
|
|
1386
|
+
flex: none;
|
|
1387
|
+
width: 100%;
|
|
1388
|
+
justify-content: flex-start;
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
.toolbar--no-buttons .capsule-search {
|
|
1392
|
+
justify-content: flex-start;
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
/* Filters on top · actions below · extra icon tools on the right */
|
|
1396
|
+
.toolbar--filters-top {
|
|
1397
|
+
flex-direction: column;
|
|
1398
|
+
align-items: stretch;
|
|
1399
|
+
gap: var(--space-md);
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.toolbar--filters-top .filter-panel {
|
|
1403
|
+
flex: none;
|
|
1404
|
+
width: 100%;
|
|
1405
|
+
justify-content: flex-start;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
.toolbar--filters-top .capsule-search {
|
|
1409
|
+
justify-content: flex-start;
|
|
1410
|
+
flex-wrap: wrap;
|
|
1411
|
+
gap: var(--space-xs);
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.toolbar--filters-top .filter-fields {
|
|
1415
|
+
display: contents;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
.toolbar--filters-top .search-actions {
|
|
1419
|
+
flex-shrink: 0;
|
|
1420
|
+
margin-left: calc(var(--space-md) - var(--space-xs));
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
.toolbar-action-row {
|
|
1424
|
+
display: flex;
|
|
1425
|
+
align-items: center;
|
|
1426
|
+
justify-content: space-between;
|
|
1427
|
+
gap: var(--space-md);
|
|
1428
|
+
width: 100%;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
.toolbar-extra-actions {
|
|
1432
|
+
display: inline-flex;
|
|
1433
|
+
align-items: center;
|
|
1434
|
+
gap: var(--space-xs);
|
|
1435
|
+
flex-shrink: 0;
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
.toolbar-extra-actions .btn-icon {
|
|
1439
|
+
display: inline-flex;
|
|
1440
|
+
align-items: center;
|
|
1441
|
+
justify-content: center;
|
|
1442
|
+
width: 32px;
|
|
1443
|
+
height: 32px;
|
|
1444
|
+
padding: 0;
|
|
1445
|
+
border: 1px solid var(--color-border-secondary);
|
|
1446
|
+
border-radius: var(--radius-md);
|
|
1447
|
+
background: var(--color-bg-container);
|
|
1448
|
+
color: var(--color-text-secondary);
|
|
1449
|
+
cursor: pointer;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
.toolbar-extra-actions .btn-icon:hover {
|
|
1453
|
+
color: var(--color-primary-text);
|
|
1454
|
+
border-color: var(--color-primary-border);
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
.toolbar-extra-actions .btn-icon.is-active {
|
|
1458
|
+
color: var(--color-primary-text);
|
|
1459
|
+
border-color: var(--color-primary);
|
|
1460
|
+
background: var(--color-primary-bg);
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
.toolbar-extra-actions .btn-icon .tuya-icon {
|
|
1464
|
+
font-size: 16px;
|
|
1465
|
+
line-height: 1;
|
|
1466
|
+
}
|
|
1467
|
+
|
|
1468
|
+
.toolbar-extra-actions .btn-icon-divider {
|
|
1469
|
+
width: 1px;
|
|
1470
|
+
height: 16px;
|
|
1471
|
+
background: var(--color-border-secondary);
|
|
1472
|
+
margin: 0 var(--space-xxs);
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
.filter-expand-link {
|
|
1476
|
+
display: inline-flex;
|
|
1477
|
+
align-items: center;
|
|
1478
|
+
gap: var(--space-xxs);
|
|
1479
|
+
height: 32px;
|
|
1480
|
+
padding: 0 var(--space-xs);
|
|
1481
|
+
border: none;
|
|
1482
|
+
background: transparent;
|
|
1483
|
+
color: var(--color-primary-text);
|
|
1484
|
+
font: 14px/22px var(--font-cn);
|
|
1485
|
+
cursor: pointer;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
.filter-expand-link:hover {
|
|
1489
|
+
color: var(--color-primary);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
.filter-expand-link .filter-expand-icon {
|
|
1493
|
+
display: inline-flex;
|
|
1494
|
+
align-items: center;
|
|
1495
|
+
justify-content: center;
|
|
1496
|
+
width: 16px;
|
|
1497
|
+
height: 16px;
|
|
1498
|
+
transition: transform 0.2s ease;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.filter-expand-link[aria-expanded="true"] .filter-expand-icon {
|
|
1502
|
+
transform: rotate(180deg);
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
.filter-field-extra[hidden] {
|
|
1506
|
+
display: none !important;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.size-rules-grid {
|
|
1510
|
+
display: grid;
|
|
1511
|
+
grid-template-columns: 1fr 1fr;
|
|
1512
|
+
gap: var(--space-xl);
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
.size-rule-item {
|
|
1516
|
+
display: flex;
|
|
1517
|
+
flex-direction: column;
|
|
1518
|
+
align-items: flex-start;
|
|
1519
|
+
gap: var(--space-sm);
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
.size-rule-head {
|
|
1523
|
+
display: flex;
|
|
1524
|
+
flex-direction: column;
|
|
1525
|
+
gap: var(--space-xxs);
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
.size-rule-caption {
|
|
1529
|
+
color: var(--color-text);
|
|
1530
|
+
font-size: 14px;
|
|
1531
|
+
font-weight: 500;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
.size-rule-meta {
|
|
1535
|
+
color: var(--color-text-tertiary);
|
|
1536
|
+
font-size: 12px;
|
|
1537
|
+
line-height: 20px;
|
|
1538
|
+
}
|
|
1539
|
+
</style>
|
|
1540
|
+
</head>
|
|
1541
|
+
<body>
|
|
1542
|
+
<header class="page-header">
|
|
1543
|
+
<h1>TuyaCapsuleSearch · 胶囊筛选组件预览</h1>
|
|
1544
|
+
<p>
|
|
1545
|
+
组件包含3部分:1.可实操 ;2.布局场景枚举 ;3.尺寸规则。Token:<code>tokens.md</code> 文档规范:<code>组件规范.md</code>
|
|
1546
|
+
</p>
|
|
1547
|
+
</header>
|
|
1548
|
+
<main class="page-main">
|
|
1549
|
+
<!-- §1 可实操 -->
|
|
1550
|
+
<section class="section" data-od-id="capsule-live-demo">
|
|
1551
|
+
<h2 class="section-title">1. 可实操组件</h2>
|
|
1552
|
+
<div class="panel">
|
|
1553
|
+
<div class="panel-head">字段类型包含:输入、标题可选输入、选择、可搜索选择、多选(平铺 / 树结构)、日期、日期范围、级联选择</div>
|
|
1554
|
+
<div class="panel-body">
|
|
1555
|
+
<div
|
|
1556
|
+
class="tuya-antd-alert ant-alert ant-alert-info live-hint"
|
|
1557
|
+
data-component="TuyaAntdAlert"
|
|
1558
|
+
role="alert"
|
|
1559
|
+
>
|
|
1560
|
+
<span class="ant-alert-icon" aria-hidden="true">
|
|
1561
|
+
<i class="ri-information-line tuya-icon" data-component="TuyaIcon" data-icon="info"></i>
|
|
1562
|
+
</span>
|
|
1563
|
+
<div class="ant-alert-content">
|
|
1564
|
+
<div class="ant-alert-message">
|
|
1565
|
+
<strong>操作提示:</strong>
|
|
1566
|
+
设备名称 — 点击输入;
|
|
1567
|
+
标题可选输入 — 标题下拉切换「设备名称 / 设备ID / PID / 设备SN」(默认设备名称),右侧输入关键词;
|
|
1568
|
+
通信协议 — 带搜索单选,无匹配时浮层提示「暂无搜索结果」;
|
|
1569
|
+
空间类型 — 平铺多选,展开后可连续点选;
|
|
1570
|
+
设备分组 — 树结构多选,支持展开、级联勾选与半选;
|
|
1571
|
+
创建日期 — 单日历;
|
|
1572
|
+
日期范围 — 双月 RangePicker、仅日期、选终点时区间 hover 预览(主色浅底);
|
|
1573
|
+
级联选择 — 多列 Cascader。
|
|
1574
|
+
日期默认全部可选;禁用由业务 disabledDate 决定。
|
|
1575
|
+
查询后在下方查看筛选参数与模拟结果。
|
|
1576
|
+
</div>
|
|
1577
|
+
</div>
|
|
1578
|
+
</div>
|
|
1579
|
+
|
|
1580
|
+
<section class="toolbar" id="live-toolbar" data-component="TuyaCapsuleSearch">
|
|
1581
|
+
<div class="button-group">
|
|
1582
|
+
<button class="btn primary btn-rect" type="button"><i class="ri-add-line tuya-icon" data-component="TuyaIcon" data-icon="add" aria-hidden="true"></i>新增</button>
|
|
1583
|
+
<button class="btn btn-rect btn-filled" type="button">批量导入</button>
|
|
1584
|
+
<button class="btn btn-rect btn-filled" type="button">批量编辑</button>
|
|
1585
|
+
</div>
|
|
1586
|
+
<div class="filter-panel">
|
|
1587
|
+
<div class="capsule-search" role="search" aria-label="设备筛选">
|
|
1588
|
+
<div class="filter-fields" id="live-fields"></div>
|
|
1589
|
+
<div class="search-actions">
|
|
1590
|
+
<button class="btn primary" type="button" id="live-query">查询</button>
|
|
1591
|
+
<button class="btn" type="button" id="live-reset">重置</button>
|
|
1592
|
+
</div>
|
|
1593
|
+
</div>
|
|
1594
|
+
</div>
|
|
1595
|
+
</section>
|
|
1596
|
+
|
|
1597
|
+
<div class="live-result" id="live-result" hidden>
|
|
1598
|
+
<h3>查询参数</h3>
|
|
1599
|
+
<pre id="live-result-json"></pre>
|
|
1600
|
+
<div class="mock-table">
|
|
1601
|
+
<table>
|
|
1602
|
+
<thead><tr><th>设备名称</th><th>协议</th><th>空间</th><th>状态</th></tr></thead>
|
|
1603
|
+
<tbody id="live-result-rows"></tbody>
|
|
1604
|
+
</table>
|
|
1605
|
+
</div>
|
|
1606
|
+
</div>
|
|
1607
|
+
</div>
|
|
1608
|
+
</div>
|
|
1609
|
+
</section>
|
|
1610
|
+
|
|
1611
|
+
<div class="popover-portal" id="popover-portal" aria-hidden="true"></div>
|
|
1612
|
+
<!-- Ant Design 5 Tooltip(Tuya 魔改)· 标签截断全文 -->
|
|
1613
|
+
<div
|
|
1614
|
+
class="tuya-antd-tooltip ant-tooltip ant-tooltip-placement-top"
|
|
1615
|
+
id="label-tip-portal"
|
|
1616
|
+
data-component="TuyaAntdTooltip"
|
|
1617
|
+
role="tooltip"
|
|
1618
|
+
aria-hidden="true"
|
|
1619
|
+
>
|
|
1620
|
+
<div class="ant-tooltip-content">
|
|
1621
|
+
<div class="ant-tooltip-arrow"></div>
|
|
1622
|
+
<div class="ant-tooltip-inner" id="label-tip-inner"></div>
|
|
1623
|
+
</div>
|
|
1624
|
+
</div>
|
|
1625
|
+
|
|
1626
|
+
<!-- §2 布局场景枚举 -->
|
|
1627
|
+
<section class="section" data-od-id="capsule-preview-context">
|
|
1628
|
+
<h2 class="section-title">2. 布局场景枚举</h2>
|
|
1629
|
+
<p class="section-desc">以下场景仅作布局参考,可按业务筛选数量与交互自行组合,不必强制套用。</p>
|
|
1630
|
+
<div class="panel">
|
|
1631
|
+
<div class="panel-head">按按钮与筛选项组合,枚举常见页面布局样式</div>
|
|
1632
|
+
<div class="panel-body panel-body--context-scenarios">
|
|
1633
|
+
<div class="context-scenarios" id="context-scenarios" aria-label="胶囊筛选页面上下文场景"></div>
|
|
1634
|
+
</div>
|
|
1635
|
+
</div>
|
|
1636
|
+
</section>
|
|
1637
|
+
|
|
1638
|
+
<!-- §3 尺寸规则 -->
|
|
1639
|
+
<section class="section" data-od-id="capsule-size-rules">
|
|
1640
|
+
<h2 class="section-title">3. 尺寸规则</h2>
|
|
1641
|
+
<div class="panel">
|
|
1642
|
+
<div class="panel-head">筛选项标题与内容尺寸自适应限制规则</div>
|
|
1643
|
+
<div class="panel-body size-rules-grid" id="size-rules-grid"></div>
|
|
1644
|
+
</div>
|
|
1645
|
+
</section>
|
|
1646
|
+
</main>
|
|
1647
|
+
|
|
1648
|
+
<script>
|
|
1649
|
+
/* ═══════════════════════════════════════
|
|
1650
|
+
§1 Live CapsuleSearch Component (交互)
|
|
1651
|
+
═══════════════════════════════════════ */
|
|
1652
|
+
/* Capsule filter icons — icons/capsule-filter/ (library) or skill mirror */
|
|
1653
|
+
const ICON_BASE = 'icons/capsule-filter';
|
|
1654
|
+
const ICON = {
|
|
1655
|
+
clear: ICON_BASE + '/clear.svg',
|
|
1656
|
+
arrowDown: ICON_BASE + '/arrow-down.svg',
|
|
1657
|
+
check: ICON_BASE + '/check.svg',
|
|
1658
|
+
search: ICON_BASE + '/search.svg',
|
|
1659
|
+
calendar: ICON_BASE + '/calendar.svg'
|
|
1660
|
+
};
|
|
1661
|
+
const CHECKBOX_CHECK_ICON = 'icons/capsule-filter/checkbox-check.svg';
|
|
1662
|
+
|
|
1663
|
+
function iconImg(src, extraClass) {
|
|
1664
|
+
return '<img class="capsule-icon' + (extraClass ? ' ' + extraClass : '') + '" src="' + src + '" alt="" width="16" height="16" draggable="false" />';
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
function clearBtnHtml(attrs) {
|
|
1668
|
+
return '<button class="filter-clear" type="button" aria-label="清除"' + (attrs || '') + '>' +
|
|
1669
|
+
iconImg(ICON.clear) + '</button>';
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
const MOCK_DEVICES = [
|
|
1673
|
+
{ id: 'dev-001', name: '客厅温湿度传感器', pid: 'pid_th01', sn: 'SN10001', protocol: 'MQTT', spaces: ['客厅'], status: '在线' },
|
|
1674
|
+
{ id: 'dev-002', name: '卧室智能灯', pid: 'pid_light2', sn: 'SN10002', protocol: 'Zigbee', spaces: ['卧室'], status: '在线' },
|
|
1675
|
+
{ id: 'dev-003', name: '厨房烟雾报警', pid: 'pid_smoke3', sn: 'SN10003', protocol: 'CoAP', spaces: ['厨房'], status: '离线' },
|
|
1676
|
+
{ id: 'dev-004', name: '车库门磁', pid: 'pid_door4', sn: 'SN10004', protocol: 'MQTT', spaces: ['车库'], status: '在线' },
|
|
1677
|
+
{ id: 'dev-005', name: '阳台摄像头', pid: 'pid_cam5', sn: 'SN10005', protocol: 'HTTP', spaces: ['阳台'], status: '在线' }
|
|
1678
|
+
];
|
|
1679
|
+
|
|
1680
|
+
/** Ant Design Cascader options (demo) */
|
|
1681
|
+
const CASCADER_OPTIONS = [
|
|
1682
|
+
{
|
|
1683
|
+
value: 'zhejiang',
|
|
1684
|
+
label: 'Zhejiang',
|
|
1685
|
+
children: [
|
|
1686
|
+
{
|
|
1687
|
+
value: 'hangzhou',
|
|
1688
|
+
label: 'Hangzhou',
|
|
1689
|
+
children: [
|
|
1690
|
+
{ value: 'xihu', label: 'West Lake' }
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
]
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
value: 'jiangsu',
|
|
1697
|
+
label: 'Jiangsu',
|
|
1698
|
+
children: [
|
|
1699
|
+
{
|
|
1700
|
+
value: 'nanjing',
|
|
1701
|
+
label: 'Nanjing',
|
|
1702
|
+
children: [
|
|
1703
|
+
{ value: 'zhonghuamen', label: 'Zhong Hua Men' }
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
]
|
|
1707
|
+
}
|
|
1708
|
+
];
|
|
1709
|
+
|
|
1710
|
+
const TREE_MULTI_DATA = [
|
|
1711
|
+
{
|
|
1712
|
+
key: 'home',
|
|
1713
|
+
title: '家庭空间',
|
|
1714
|
+
children: [
|
|
1715
|
+
{
|
|
1716
|
+
key: 'home-public',
|
|
1717
|
+
title: '公共区域',
|
|
1718
|
+
children: [
|
|
1719
|
+
{ key: 'living-room', title: '客厅' },
|
|
1720
|
+
{ key: 'kitchen', title: '厨房' },
|
|
1721
|
+
{ key: 'balcony', title: '阳台' }
|
|
1722
|
+
]
|
|
1723
|
+
},
|
|
1724
|
+
{
|
|
1725
|
+
key: 'home-private',
|
|
1726
|
+
title: '私密区域',
|
|
1727
|
+
children: [
|
|
1728
|
+
{ key: 'master-bedroom', title: '主卧' },
|
|
1729
|
+
{ key: 'second-bedroom', title: '次卧' }
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
]
|
|
1733
|
+
},
|
|
1734
|
+
{
|
|
1735
|
+
key: 'office',
|
|
1736
|
+
title: '办公空间',
|
|
1737
|
+
children: [
|
|
1738
|
+
{ key: 'meeting-room', title: '会议室' },
|
|
1739
|
+
{ key: 'server-room', title: '机房', disabled: true }
|
|
1740
|
+
]
|
|
1741
|
+
}
|
|
1742
|
+
];
|
|
1743
|
+
|
|
1744
|
+
function findCascaderNodes(options, values) {
|
|
1745
|
+
const nodes = [];
|
|
1746
|
+
let level = options;
|
|
1747
|
+
for (let i = 0; i < values.length; i++) {
|
|
1748
|
+
const node = (level || []).find((n) => n.value === values[i]);
|
|
1749
|
+
if (!node) {
|
|
1750
|
+
break;
|
|
1751
|
+
}
|
|
1752
|
+
nodes.push(node);
|
|
1753
|
+
level = node.children;
|
|
1754
|
+
}
|
|
1755
|
+
return nodes;
|
|
1756
|
+
}
|
|
1757
|
+
|
|
1758
|
+
function cascaderDisplayText(values, options) {
|
|
1759
|
+
if (!values || !values.length) {
|
|
1760
|
+
return '';
|
|
1761
|
+
}
|
|
1762
|
+
return findCascaderNodes(options || CASCADER_OPTIONS, values).map((n) => n.label).join(' / ');
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
function createFieldByType(type, label) {
|
|
1766
|
+
const width = {
|
|
1767
|
+
input: 'filter-field-input',
|
|
1768
|
+
'input-key-select': 'filter-field-input',
|
|
1769
|
+
select: 'filter-field-select',
|
|
1770
|
+
'select-search': 'filter-field-select',
|
|
1771
|
+
'multi-select': 'filter-field-select',
|
|
1772
|
+
date: 'filter-field-date',
|
|
1773
|
+
'date-range': 'filter-field-date-range',
|
|
1774
|
+
cascader: 'filter-field-select'
|
|
1775
|
+
};
|
|
1776
|
+
const base = { type: type, label: label, widthClass: width[type] || 'filter-field-select' };
|
|
1777
|
+
if (type === 'input') {
|
|
1778
|
+
return Object.assign(base, { placeholder: '请输入', value: '' });
|
|
1779
|
+
}
|
|
1780
|
+
if (type === 'input-key-select') {
|
|
1781
|
+
return Object.assign(base, {
|
|
1782
|
+
placeholder: '请输入',
|
|
1783
|
+
value: '',
|
|
1784
|
+
labelKey: label,
|
|
1785
|
+
labelOptions: ['设备名称', '设备ID', 'PID', '设备SN']
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
if (type === 'select' || type === 'select-search') {
|
|
1789
|
+
return Object.assign(base, {
|
|
1790
|
+
placeholder: '请选择', value: '',
|
|
1791
|
+
options: ['MQTT', 'CoAP', 'HTTP', 'Modbus', 'Zigbee']
|
|
1792
|
+
});
|
|
1793
|
+
}
|
|
1794
|
+
if (type === 'multi-select') {
|
|
1795
|
+
return Object.assign(base, {
|
|
1796
|
+
placeholder: '请选择', value: [],
|
|
1797
|
+
selectionMode: 'list',
|
|
1798
|
+
options: ['客厅', '卧室', '厨房', '卫生间', '阳台', '车库']
|
|
1799
|
+
});
|
|
1800
|
+
}
|
|
1801
|
+
if (type === 'date') {
|
|
1802
|
+
return Object.assign(base, { placeholder: '请选择', value: '' });
|
|
1803
|
+
}
|
|
1804
|
+
if (type === 'date-range') {
|
|
1805
|
+
return Object.assign(base, { placeholder: ['开始日期', '结束日期'], value: [null, null] });
|
|
1806
|
+
}
|
|
1807
|
+
if (type === 'cascader') {
|
|
1808
|
+
return Object.assign(base, {
|
|
1809
|
+
placeholder: '请选择',
|
|
1810
|
+
value: [],
|
|
1811
|
+
options: CASCADER_OPTIONS
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
return Object.assign(base, { placeholder: '请选择', value: '' });
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
const LIVE_IDS = ['name', 'search-key', 'protocol', 'space', 'group', 'date', 'range', 'cascader'];
|
|
1818
|
+
const SIZE_IDS = ['size-empty', 'size-long', 'size-short', 'size-large', 'size-range'];
|
|
1819
|
+
|
|
1820
|
+
const liveState = {
|
|
1821
|
+
openId: null,
|
|
1822
|
+
openMode: null,
|
|
1823
|
+
rangePickStep: 0,
|
|
1824
|
+
rangeHover: null,
|
|
1825
|
+
calYear: 2026,
|
|
1826
|
+
calMonth: 7,
|
|
1827
|
+
cascaderActivePath: [],
|
|
1828
|
+
treeExpandedKeys: new Set(['home', 'home-public', 'home-private', 'office']),
|
|
1829
|
+
treeFocusedKey: 'home',
|
|
1830
|
+
selectSearchQuery: '',
|
|
1831
|
+
fields: Object.assign(
|
|
1832
|
+
{
|
|
1833
|
+
name: createFieldByType('input', '设备名称'),
|
|
1834
|
+
'search-key': createFieldByType('input-key-select', '设备名称'),
|
|
1835
|
+
protocol: createFieldByType('select-search', '通信协议'),
|
|
1836
|
+
space: createFieldByType('multi-select', '空间类型'),
|
|
1837
|
+
group: Object.assign(createFieldByType('multi-select', '设备分组'), {
|
|
1838
|
+
selectionMode: 'tree',
|
|
1839
|
+
treeData: TREE_MULTI_DATA
|
|
1840
|
+
}),
|
|
1841
|
+
date: createFieldByType('date', '创建日期'),
|
|
1842
|
+
range: createFieldByType('date-range', '日期范围'),
|
|
1843
|
+
cascader: createFieldByType('cascader', '级联选择')
|
|
1844
|
+
},
|
|
1845
|
+
{
|
|
1846
|
+
'size-empty': createFieldByType('input', '设备名称'),
|
|
1847
|
+
'size-long': Object.assign(createFieldByType('input', '设备名称设备名称全部文案'), {
|
|
1848
|
+
value: '华策中心地下停车场B2层东侧入口'
|
|
1849
|
+
}),
|
|
1850
|
+
'size-short': Object.assign(createFieldByType('select', '通信协议'), { value: 'MQTT' }),
|
|
1851
|
+
'size-large': Object.assign(createFieldByType('input', '设备名称设备名称设备名称设备名称'), {
|
|
1852
|
+
value: '华策中心地下停车场B2层东侧入口超长设备名称展示',
|
|
1853
|
+
size: 'large'
|
|
1854
|
+
}),
|
|
1855
|
+
'size-range': Object.assign(createFieldByType('date-range', '日期范围'), {
|
|
1856
|
+
value: [new Date(2026, 7, 1), new Date(2026, 7, 11)]
|
|
1857
|
+
})
|
|
1858
|
+
}
|
|
1859
|
+
)
|
|
1860
|
+
};
|
|
1861
|
+
|
|
1862
|
+
function fieldHasValue(f) {
|
|
1863
|
+
if (f.type === 'input' || f.type === 'input-key-select' || f.type === 'date' || f.type === 'select' || f.type === 'select-search') {
|
|
1864
|
+
return Boolean(f.value);
|
|
1865
|
+
}
|
|
1866
|
+
if (f.type === 'multi-select') return f.value.length > 0;
|
|
1867
|
+
if (f.type === 'date-range') return f.value[0] || f.value[1];
|
|
1868
|
+
if (f.type === 'cascader') return Array.isArray(f.value) && f.value.length > 0;
|
|
1869
|
+
return false;
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
function resolveState(id) {
|
|
1873
|
+
const f = liveState.fields[id];
|
|
1874
|
+
const has = fieldHasValue(f);
|
|
1875
|
+
const open = liveState.openId === id;
|
|
1876
|
+
if (open) {
|
|
1877
|
+
return has ? 'filled-active' : 'active';
|
|
1878
|
+
}
|
|
1879
|
+
return has ? 'filled' : 'default';
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
function escapeAttr(str) {
|
|
1883
|
+
return String(str || '').replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<');
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
function fmtDate(d) {
|
|
1887
|
+
if (!d) return '';
|
|
1888
|
+
const y = d.getFullYear();
|
|
1889
|
+
const m = String(d.getMonth() + 1).padStart(2, '0');
|
|
1890
|
+
const day = String(d.getDate()).padStart(2, '0');
|
|
1891
|
+
return y + '-' + m + '-' + day;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
function readCssPx(name, fallback) {
|
|
1895
|
+
const raw = getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
1896
|
+
const n = parseFloat(raw);
|
|
1897
|
+
return Number.isFinite(n) ? n : fallback;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
function labelWrap(text) {
|
|
1901
|
+
return '<span class="filter-label-wrap"><span class="filter-label">' + escapeAttr(text) + '</span></span>';
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
function labelWrapSelectable(text, id, open) {
|
|
1905
|
+
return '<span class="filter-label-wrap filter-label-wrap--select' + (open ? ' is-open' : '') +
|
|
1906
|
+
'" data-label-select-id="' + id + '" role="button" tabindex="0" aria-expanded="' + (open ? 'true' : 'false') +
|
|
1907
|
+
'" aria-haspopup="listbox"><span class="filter-label">' + escapeAttr(text) +
|
|
1908
|
+
'</span><span class="filter-label-arrow filter-icon" aria-hidden="true">' + iconImg(ICON.arrowDown) + '</span></span>';
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
function bodyWrap(inner) {
|
|
1912
|
+
return '<span class="filter-body">' + inner + '</span>';
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
function fieldSizeAttrs(f) {
|
|
1916
|
+
return f.size === 'large' ? ' data-size="large"' : ' data-size="default"';
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
function hideLabelTip() {
|
|
1920
|
+
const portal = document.getElementById('label-tip-portal');
|
|
1921
|
+
const inner = document.getElementById('label-tip-inner');
|
|
1922
|
+
if (!portal) {
|
|
1923
|
+
return;
|
|
1924
|
+
}
|
|
1925
|
+
portal.classList.remove('is-open');
|
|
1926
|
+
if (inner) {
|
|
1927
|
+
inner.textContent = '';
|
|
1928
|
+
}
|
|
1929
|
+
portal.setAttribute('aria-hidden', 'true');
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
function showLabelTip(wrap) {
|
|
1933
|
+
const portal = document.getElementById('label-tip-portal');
|
|
1934
|
+
const inner = document.getElementById('label-tip-inner');
|
|
1935
|
+
const full = wrap && wrap.dataset.fullLabel;
|
|
1936
|
+
if (!portal || !inner || !full) {
|
|
1937
|
+
return;
|
|
1938
|
+
}
|
|
1939
|
+
const field = wrap.closest('.filter-field') || wrap;
|
|
1940
|
+
const fieldRect = field.getBoundingClientRect();
|
|
1941
|
+
const wrapRect = wrap.getBoundingClientRect();
|
|
1942
|
+
inner.textContent = full;
|
|
1943
|
+
/* Horizontal: label center; vertical: field top border + 4px gap (via CSS transform) */
|
|
1944
|
+
portal.style.left = (wrapRect.left + wrapRect.width / 2) + 'px';
|
|
1945
|
+
portal.style.top = fieldRect.top + 'px';
|
|
1946
|
+
portal.classList.add('is-open');
|
|
1947
|
+
portal.setAttribute('aria-hidden', 'false');
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
function initLabelTooltips(root) {
|
|
1951
|
+
hideLabelTip();
|
|
1952
|
+
(root || document).querySelectorAll('.filter-label-wrap').forEach((wrap) => {
|
|
1953
|
+
if (wrap.classList.contains('filter-label-wrap--select')) {
|
|
1954
|
+
return;
|
|
1955
|
+
}
|
|
1956
|
+
const label = wrap.querySelector('.filter-label');
|
|
1957
|
+
if (!label) {
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
const truncated = label.scrollWidth > label.clientWidth + 1;
|
|
1961
|
+
wrap.classList.toggle('is-truncated', truncated);
|
|
1962
|
+
const full = label.textContent.trim();
|
|
1963
|
+
if (truncated) {
|
|
1964
|
+
wrap.dataset.fullLabel = full;
|
|
1965
|
+
label.setAttribute('aria-label', full);
|
|
1966
|
+
} else {
|
|
1967
|
+
delete wrap.dataset.fullLabel;
|
|
1968
|
+
label.removeAttribute('aria-label');
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
document.addEventListener('mouseover', (e) => {
|
|
1974
|
+
const wrap = e.target.closest('.filter-label-wrap.is-truncated');
|
|
1975
|
+
if (!wrap) {
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
if (e.relatedTarget && wrap.contains(e.relatedTarget)) {
|
|
1979
|
+
return;
|
|
1980
|
+
}
|
|
1981
|
+
showLabelTip(wrap);
|
|
1982
|
+
});
|
|
1983
|
+
|
|
1984
|
+
document.addEventListener('mouseout', (e) => {
|
|
1985
|
+
const wrap = e.target.closest('.filter-label-wrap.is-truncated');
|
|
1986
|
+
if (!wrap) {
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
if (e.relatedTarget && wrap.contains(e.relatedTarget)) {
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1992
|
+
hideLabelTip();
|
|
1993
|
+
});
|
|
1994
|
+
|
|
1995
|
+
window.addEventListener('scroll', hideLabelTip, true);
|
|
1996
|
+
window.addEventListener('resize', () => {
|
|
1997
|
+
hideLabelTip();
|
|
1998
|
+
initLabelTooltips(document);
|
|
1999
|
+
});
|
|
2000
|
+
|
|
2001
|
+
/** Measure text width for content-driven capsule value area */
|
|
2002
|
+
function measureTextWidth(text, font) {
|
|
2003
|
+
const canvas = measureTextWidth._c || (measureTextWidth._c = document.createElement('canvas'));
|
|
2004
|
+
const ctx = canvas.getContext('2d');
|
|
2005
|
+
ctx.font = font || '14px "PingFang SC", "Microsoft YaHei", sans-serif';
|
|
2006
|
+
return Math.ceil(ctx.measureText(text || '').width);
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* After input / while typing: grow value area with content, clamp to size max.
|
|
2011
|
+
* Empty keeps placeholder min; filled/time uses content width.
|
|
2012
|
+
*/
|
|
2013
|
+
function syncInputBodyWidth(input) {
|
|
2014
|
+
if (!input) {
|
|
2015
|
+
return;
|
|
2016
|
+
}
|
|
2017
|
+
const field = input.closest('.filter-field');
|
|
2018
|
+
const body = field && field.querySelector('.filter-body');
|
|
2019
|
+
if (!field || !body) {
|
|
2020
|
+
return;
|
|
2021
|
+
}
|
|
2022
|
+
if (field.getAttribute('data-width-mode') === 'time') {
|
|
2023
|
+
body.style.width = '';
|
|
2024
|
+
input.style.width = '';
|
|
2025
|
+
return;
|
|
2026
|
+
}
|
|
2027
|
+
const isLarge = field.getAttribute('data-size') === 'large';
|
|
2028
|
+
const max = isLarge
|
|
2029
|
+
? readCssPx('--capsule-value-max-lg', 240)
|
|
2030
|
+
: readCssPx('--capsule-value-max', 168);
|
|
2031
|
+
const min = readCssPx('--capsule-value-min', 68);
|
|
2032
|
+
const sample = input.value || input.placeholder || '';
|
|
2033
|
+
const pad = readCssPx('--space-md', 16);
|
|
2034
|
+
const raw = measureTextWidth(sample) + pad;
|
|
2035
|
+
const w = Math.min(max, Math.max(min, raw));
|
|
2036
|
+
body.style.width = w + 'px';
|
|
2037
|
+
body.style.maxWidth = max + 'px';
|
|
2038
|
+
input.style.width = Math.max(0, w - readCssPx('--space-xs', 8)) + 'px';
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
function renderMultiTags(values, field) {
|
|
2042
|
+
if (!values.length) return '';
|
|
2043
|
+
const labels = field && field.selectionMode === 'tree'
|
|
2044
|
+
? values.map((key) => findTreeNode(field.treeData, key)?.title || key)
|
|
2045
|
+
: values;
|
|
2046
|
+
const visible = labels.slice(0, 2);
|
|
2047
|
+
const rest = labels.length - visible.length;
|
|
2048
|
+
let html = visible.map(v => '<span class="filter-tag">' + escapeAttr(v) + '</span>').join('');
|
|
2049
|
+
if (rest > 0) html += '<span class="filter-tag-more">+' + rest + '...</span>';
|
|
2050
|
+
return html;
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
function trailSlot(iconKey, clearId) {
|
|
2054
|
+
const src = iconKey === 'calendar' ? ICON.calendar : ICON.arrowDown;
|
|
2055
|
+
const clear = clearId
|
|
2056
|
+
? clearBtnHtml(' data-clear="' + clearId + '"')
|
|
2057
|
+
: '';
|
|
2058
|
+
return '<span class="filter-trail"><span class="filter-icon">' + iconImg(src) + '</span>' + clear + '</span>';
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
function trailSlotSelectSearch(clearId) {
|
|
2062
|
+
const clear = clearId
|
|
2063
|
+
? clearBtnHtml(' data-clear="' + clearId + '"')
|
|
2064
|
+
: '';
|
|
2065
|
+
return '<span class="filter-trail filter-trail-select-search">' +
|
|
2066
|
+
'<span class="filter-icon filter-icon-arrow" aria-hidden="true">' + iconImg(ICON.arrowDown) + '</span>' +
|
|
2067
|
+
'<span class="filter-icon filter-icon-search" aria-hidden="true">' + iconImg(ICON.search) + '</span>' +
|
|
2068
|
+
clear +
|
|
2069
|
+
'</span>';
|
|
2070
|
+
}
|
|
2071
|
+
|
|
2072
|
+
function renderLiveField(id) {
|
|
2073
|
+
const f = liveState.fields[id];
|
|
2074
|
+
const state = resolveState(id);
|
|
2075
|
+
const has = fieldHasValue(f);
|
|
2076
|
+
const open = liveState.openId === id;
|
|
2077
|
+
let inner = '';
|
|
2078
|
+
|
|
2079
|
+
if (f.type === 'input') {
|
|
2080
|
+
if (open) {
|
|
2081
|
+
inner = bodyWrap('<input class="filter-input-native" type="text" data-input-id="' + id + '" placeholder="' + escapeAttr(f.placeholder) + '" value="' + escapeAttr(f.value) + '" autocomplete="off" spellcheck="false" />');
|
|
2082
|
+
} else if (has) {
|
|
2083
|
+
inner = bodyWrap('<span class="filter-value is-value">' + escapeAttr(f.value) + '</span>') +
|
|
2084
|
+
'<span class="filter-trail filter-trail-clear-only">' +
|
|
2085
|
+
clearBtnHtml(' data-clear="' + id + '"') +
|
|
2086
|
+
'</span>';
|
|
2087
|
+
} else {
|
|
2088
|
+
inner = bodyWrap('<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2089
|
+
}
|
|
2090
|
+
} else if (f.type === 'input-key-select') {
|
|
2091
|
+
const inputOpen = open && liveState.openMode === 'input';
|
|
2092
|
+
if (inputOpen) {
|
|
2093
|
+
inner = bodyWrap('<input class="filter-input-native" type="text" data-input-id="' + id + '" placeholder="' + escapeAttr(f.placeholder) + '" value="' + escapeAttr(f.value) + '" autocomplete="off" spellcheck="false" />');
|
|
2094
|
+
} else if (has) {
|
|
2095
|
+
inner = bodyWrap('<span class="filter-value is-value">' + escapeAttr(f.value) + '</span>') +
|
|
2096
|
+
'<span class="filter-trail filter-trail-clear-only">' +
|
|
2097
|
+
clearBtnHtml(' data-clear="' + id + '"') +
|
|
2098
|
+
'</span>';
|
|
2099
|
+
} else {
|
|
2100
|
+
inner = bodyWrap('<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2101
|
+
}
|
|
2102
|
+
} else if (f.type === 'select-search') {
|
|
2103
|
+
if (open) {
|
|
2104
|
+
inner = bodyWrap(
|
|
2105
|
+
'<input class="filter-input-native" type="text" data-select-search-id="' + id +
|
|
2106
|
+
'" placeholder="搜索" value="' + escapeAttr(liveState.selectSearchQuery || '') +
|
|
2107
|
+
'" autocomplete="off" spellcheck="false" />'
|
|
2108
|
+
);
|
|
2109
|
+
inner += trailSlotSelectSearch(null);
|
|
2110
|
+
} else {
|
|
2111
|
+
inner = bodyWrap(has
|
|
2112
|
+
? '<span class="filter-value is-value">' + escapeAttr(f.value) + '</span>'
|
|
2113
|
+
: '<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2114
|
+
inner += trailSlotSelectSearch(has ? id : null);
|
|
2115
|
+
}
|
|
2116
|
+
} else if (f.type === 'select') {
|
|
2117
|
+
inner = bodyWrap(has
|
|
2118
|
+
? '<span class="filter-value is-value">' + escapeAttr(f.value) + '</span>'
|
|
2119
|
+
: '<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2120
|
+
inner += trailSlot('arrow', has ? id : null);
|
|
2121
|
+
} else if (f.type === 'cascader') {
|
|
2122
|
+
const text = cascaderDisplayText(f.value, f.options);
|
|
2123
|
+
inner = bodyWrap(has
|
|
2124
|
+
? '<span class="filter-value is-value">' + escapeAttr(text) + '</span>'
|
|
2125
|
+
: '<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2126
|
+
inner += trailSlot('arrow', has ? id : null);
|
|
2127
|
+
} else if (f.type === 'multi-select') {
|
|
2128
|
+
if (has) {
|
|
2129
|
+
inner = bodyWrap('<span class="filter-value is-value filter-tags">' + renderMultiTags(f.value, f) + '</span>');
|
|
2130
|
+
} else {
|
|
2131
|
+
inner = bodyWrap('<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2132
|
+
}
|
|
2133
|
+
inner += trailSlot('arrow', has ? id : null);
|
|
2134
|
+
} else if (f.type === 'date') {
|
|
2135
|
+
inner = bodyWrap(has
|
|
2136
|
+
? '<span class="filter-value is-value">' + escapeAttr(f.value) + '</span>'
|
|
2137
|
+
: '<span class="filter-value">' + escapeAttr(f.placeholder) + '</span>');
|
|
2138
|
+
inner += trailSlot('calendar', has ? id : null);
|
|
2139
|
+
} else if (f.type === 'date-range') {
|
|
2140
|
+
const [s, e] = f.value;
|
|
2141
|
+
if (has) {
|
|
2142
|
+
inner = bodyWrap(
|
|
2143
|
+
'<span class="filter-value is-value">' + (s ? fmtDate(s) : escapeAttr(f.placeholder[0])) + '</span>' +
|
|
2144
|
+
'<i class="ri-subtract-line filter-separator"></i>' +
|
|
2145
|
+
'<span class="filter-value is-value">' + (e ? fmtDate(e) : escapeAttr(f.placeholder[1])) + '</span>'
|
|
2146
|
+
);
|
|
2147
|
+
} else {
|
|
2148
|
+
inner = bodyWrap(
|
|
2149
|
+
'<span class="filter-value">' + escapeAttr(f.placeholder[0]) + '</span>' +
|
|
2150
|
+
'<i class="ri-subtract-line filter-separator"></i>' +
|
|
2151
|
+
'<span class="filter-value">' + escapeAttr(f.placeholder[1]) + '</span>'
|
|
2152
|
+
);
|
|
2153
|
+
}
|
|
2154
|
+
inner += trailSlot('calendar', has ? id : null);
|
|
2155
|
+
}
|
|
2156
|
+
|
|
2157
|
+
const labelPart = f.type === 'input-key-select'
|
|
2158
|
+
? labelWrapSelectable(f.labelKey, id, open && liveState.openMode === 'label') + '<span class="filter-divider" aria-hidden="true"></span>'
|
|
2159
|
+
: labelWrap(f.label) + '<span class="filter-divider" aria-hidden="true"></span>';
|
|
2160
|
+
|
|
2161
|
+
const skipFieldButton = f.type === 'input' ||
|
|
2162
|
+
(f.type === 'input-key-select' && open && liveState.openMode === 'input') ||
|
|
2163
|
+
(f.type === 'select-search' && open);
|
|
2164
|
+
|
|
2165
|
+
return '<span class="filter-field is-live ' + f.widthClass + '" data-field-type="' + f.type + '"' +
|
|
2166
|
+
(f.type === 'multi-select' ? ' data-selection-mode="' + escapeAttr(f.selectionMode || 'list') + '"' : '') +
|
|
2167
|
+
' data-field-id="' + id + '" data-state="' + state + '"' + fieldSizeAttrs(f) +
|
|
2168
|
+
(skipFieldButton ? '' : ' tabindex="0" role="button"') +
|
|
2169
|
+
' aria-expanded="' + (open ? 'true' : 'false') + '">' +
|
|
2170
|
+
labelPart + inner + '</span>';
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
function focusInput(id) {
|
|
2174
|
+
const input = document.querySelector('[data-input-id="' + id + '"]');
|
|
2175
|
+
if (!input) {
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
input.focus();
|
|
2179
|
+
const len = input.value.length;
|
|
2180
|
+
if (typeof input.setSelectionRange === 'function') {
|
|
2181
|
+
input.setSelectionRange(len, len);
|
|
2182
|
+
}
|
|
2183
|
+
syncInputBodyWidth(input);
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
function focusSelectSearch(id) {
|
|
2187
|
+
const input = document.querySelector('[data-select-search-id="' + id + '"]');
|
|
2188
|
+
if (!input) {
|
|
2189
|
+
return;
|
|
2190
|
+
}
|
|
2191
|
+
input.focus();
|
|
2192
|
+
const len = input.value.length;
|
|
2193
|
+
if (typeof input.setSelectionRange === 'function') {
|
|
2194
|
+
input.setSelectionRange(len, len);
|
|
2195
|
+
}
|
|
2196
|
+
syncInputBodyWidth(input);
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
function renderSizeRulesGrid() {
|
|
2200
|
+
const grid = document.getElementById('size-rules-grid');
|
|
2201
|
+
if (!grid) {
|
|
2202
|
+
return;
|
|
2203
|
+
}
|
|
2204
|
+
const items = [
|
|
2205
|
+
{ id: 'size-empty', caption: '常态 · 自适应', meta: '空态:标签自然宽 · 值区占位约 68px' },
|
|
2206
|
+
{ id: 'size-long', caption: '填入后 · 标题与内容同时适配', meta: '选择/输入后伸展 · 标签≤112(超长省略,hover 看全文)· 值≤168' },
|
|
2207
|
+
{ id: 'size-short', caption: '填入后 · 短内容(不拉满上限)', meta: '短值按内容宽;hover 才出现清除覆盖箭头' },
|
|
2208
|
+
{ id: 'size-large', caption: '填入后 · 大 · 最大宽度', meta: 'data-size=large · 标签≤160(超长省略,hover 看全文)· 值≤240' },
|
|
2209
|
+
{ id: 'size-range', caption: '选完后 · 特殊 · 日期范围(仅日期)', meta: '双月 RangePicker · 仅 YYYY-MM-DD · 无时分秒' }
|
|
2210
|
+
];
|
|
2211
|
+
grid.innerHTML = items.map((it) =>
|
|
2212
|
+
'<div class="size-rule-item">' +
|
|
2213
|
+
'<div class="size-rule-head">' +
|
|
2214
|
+
'<div class="size-rule-caption">' + it.caption + '</div>' +
|
|
2215
|
+
'<div class="size-rule-meta">' + it.meta + '</div>' +
|
|
2216
|
+
'</div>' +
|
|
2217
|
+
renderLiveField(it.id) +
|
|
2218
|
+
'</div>'
|
|
2219
|
+
).join('');
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
/* ── §2 Static page-context scenarios ── */
|
|
2223
|
+
function staticFieldInput(label, placeholder, isExtra) {
|
|
2224
|
+
const extraCls = isExtra ? ' filter-field-extra' : '';
|
|
2225
|
+
const hiddenAttr = isExtra ? ' hidden' : '';
|
|
2226
|
+
return '<span class="filter-field filter-field-input' + extraCls + '" data-field-type="input" data-state="default" data-size="default"' + hiddenAttr + '>' +
|
|
2227
|
+
labelWrap(label) + '<span class="filter-divider" aria-hidden="true"></span>' +
|
|
2228
|
+
bodyWrap('<span class="filter-value">' + escapeAttr(placeholder) + '</span>') +
|
|
2229
|
+
'</span>';
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
function staticFieldSelect(label, placeholder, isExtra) {
|
|
2233
|
+
const extraCls = isExtra ? ' filter-field-extra' : '';
|
|
2234
|
+
const hiddenAttr = isExtra ? ' hidden' : '';
|
|
2235
|
+
return '<span class="filter-field filter-field-select' + extraCls + '" data-field-type="select" data-state="default" data-size="default"' + hiddenAttr + '>' +
|
|
2236
|
+
labelWrap(label) + '<span class="filter-divider" aria-hidden="true"></span>' +
|
|
2237
|
+
bodyWrap('<span class="filter-value">' + escapeAttr(placeholder) + '</span>') +
|
|
2238
|
+
'<span class="filter-trail"><span class="filter-icon">' + iconImg(ICON.arrowDown) + '</span></span>' +
|
|
2239
|
+
'</span>';
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
function staticFieldDateRange(label, startPh, endPh, isExtra) {
|
|
2243
|
+
const extraCls = isExtra ? ' filter-field-extra' : '';
|
|
2244
|
+
const hiddenAttr = isExtra ? ' hidden' : '';
|
|
2245
|
+
return '<span class="filter-field filter-field-date-range' + extraCls + '" data-field-type="date-range" data-state="default" data-size="default"' + hiddenAttr + '>' +
|
|
2246
|
+
labelWrap(label) + '<span class="filter-divider" aria-hidden="true"></span>' +
|
|
2247
|
+
bodyWrap(
|
|
2248
|
+
'<span class="filter-value">' + escapeAttr(startPh) + '</span>' +
|
|
2249
|
+
'<i class="ri-subtract-line filter-separator"></i>' +
|
|
2250
|
+
'<span class="filter-value">' + escapeAttr(endPh) + '</span>'
|
|
2251
|
+
) +
|
|
2252
|
+
'<span class="filter-trail"><span class="filter-icon">' + iconImg(ICON.calendar) + '</span></span>' +
|
|
2253
|
+
'</span>';
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
function staticButtonGroup() {
|
|
2257
|
+
return '<div class="button-group">' +
|
|
2258
|
+
'<button class="btn primary btn-rect" type="button" tabindex="-1">' +
|
|
2259
|
+
'<i class="ri-add-line tuya-icon" data-component="TuyaIcon" data-icon="add" aria-hidden="true"></i>新增' +
|
|
2260
|
+
'</button>' +
|
|
2261
|
+
'<button class="btn btn-rect btn-filled" type="button" tabindex="-1">批量导入</button>' +
|
|
2262
|
+
'<button class="btn btn-rect btn-filled" type="button" tabindex="-1">批量编辑</button>' +
|
|
2263
|
+
'</div>';
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
function staticExtraActions() {
|
|
2267
|
+
return '<div class="toolbar-extra-actions" role="group" aria-label="辅助操作">' +
|
|
2268
|
+
'<button class="btn-icon is-active" type="button" tabindex="-1" title="列表视图" aria-label="列表视图">' +
|
|
2269
|
+
'<i class="ri-list-unordered tuya-icon" data-component="TuyaIcon" data-icon="list" aria-hidden="true"></i>' +
|
|
2270
|
+
'</button>' +
|
|
2271
|
+
'<button class="btn-icon" type="button" tabindex="-1" title="卡片视图" aria-label="卡片视图">' +
|
|
2272
|
+
'<i class="ri-layout-grid-line tuya-icon" data-component="TuyaIcon" data-icon="grid" aria-hidden="true"></i>' +
|
|
2273
|
+
'</button>' +
|
|
2274
|
+
'<span class="btn-icon-divider" aria-hidden="true"></span>' +
|
|
2275
|
+
'<button class="btn-icon" type="button" tabindex="-1" title="设置" aria-label="设置">' +
|
|
2276
|
+
'<i class="ri-settings-3-line tuya-icon" data-component="TuyaIcon" data-icon="settings" aria-hidden="true"></i>' +
|
|
2277
|
+
'</button>' +
|
|
2278
|
+
'<button class="btn-icon" type="button" tabindex="-1" title="排序" aria-label="排序">' +
|
|
2279
|
+
'<i class="ri-sort-desc tuya-icon" data-component="TuyaIcon" data-icon="sort" aria-hidden="true"></i>' +
|
|
2280
|
+
'</button>' +
|
|
2281
|
+
'<button class="btn-icon" type="button" tabindex="-1" title="下载" aria-label="下载">' +
|
|
2282
|
+
'<i class="ri-download-2-line tuya-icon" data-component="TuyaIcon" data-icon="download" aria-hidden="true"></i>' +
|
|
2283
|
+
'</button>' +
|
|
2284
|
+
'</div>';
|
|
2285
|
+
}
|
|
2286
|
+
|
|
2287
|
+
function staticSearchActions(opts) {
|
|
2288
|
+
const showActions = !opts || opts.showActions !== false;
|
|
2289
|
+
const showExpand = opts && opts.showExpand;
|
|
2290
|
+
let html = '<div class="search-actions">';
|
|
2291
|
+
if (showActions) {
|
|
2292
|
+
html += '<button class="btn primary" type="button" tabindex="-1">查询</button>' +
|
|
2293
|
+
'<button class="btn" type="button" tabindex="-1">重置</button>';
|
|
2294
|
+
}
|
|
2295
|
+
if (showExpand) {
|
|
2296
|
+
html += '<button class="filter-expand-link" type="button" aria-expanded="false">' +
|
|
2297
|
+
'<span class="filter-expand-text">展开</span>' +
|
|
2298
|
+
'<span class="filter-expand-icon">' + iconImg(ICON.arrowDown) + '</span></button>';
|
|
2299
|
+
}
|
|
2300
|
+
html += '</div>';
|
|
2301
|
+
return html;
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
function staticCoreFields() {
|
|
2305
|
+
return staticFieldInput('设备名称', '请输入') +
|
|
2306
|
+
staticFieldSelect('空间类型', '请选择') +
|
|
2307
|
+
staticFieldDateRange('创建日期', '开始日期', '结束日期') +
|
|
2308
|
+
staticFieldSelect('级联选择', '请选择');
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
function staticExpandExtraFields() {
|
|
2312
|
+
return staticFieldSelect('通信协议', '请选择', true) +
|
|
2313
|
+
staticFieldInput('设备编号', '请输入', true);
|
|
2314
|
+
}
|
|
2315
|
+
|
|
2316
|
+
function staticWrapFields() {
|
|
2317
|
+
let html = '';
|
|
2318
|
+
html += staticFieldInput('设备名称', '请输入');
|
|
2319
|
+
html += staticFieldDateRange('创建日期', '开始日期', '结束日期');
|
|
2320
|
+
html += staticFieldSelect('空间类型', '请选择');
|
|
2321
|
+
html += staticFieldSelect('级联选择', '请选择');
|
|
2322
|
+
let i;
|
|
2323
|
+
for (i = 0; i < 4; i++) {
|
|
2324
|
+
html += staticFieldInput('设备名称', '请输入');
|
|
2325
|
+
}
|
|
2326
|
+
for (i = 0; i < 2; i++) {
|
|
2327
|
+
html += staticFieldInput('设备名称', '请输入');
|
|
2328
|
+
}
|
|
2329
|
+
html += staticFieldSelect('空间类型', '请选择');
|
|
2330
|
+
html += staticFieldDateRange('创建日期', '开始日期', '结束日期');
|
|
2331
|
+
return html;
|
|
2332
|
+
}
|
|
2333
|
+
|
|
2334
|
+
function staticToolbarHtml(config) {
|
|
2335
|
+
const cfg = Object.assign({
|
|
2336
|
+
buttons: true,
|
|
2337
|
+
fields: staticCoreFields(),
|
|
2338
|
+
actions: true,
|
|
2339
|
+
expand: false,
|
|
2340
|
+
multiline: false,
|
|
2341
|
+
filtersTop: false,
|
|
2342
|
+
extraActions: false,
|
|
2343
|
+
noActionsClass: false
|
|
2344
|
+
}, config || {});
|
|
2345
|
+
let toolbarClass = 'toolbar';
|
|
2346
|
+
if (cfg.multiline) {
|
|
2347
|
+
toolbarClass += ' toolbar--multiline';
|
|
2348
|
+
}
|
|
2349
|
+
if (cfg.filtersTop) {
|
|
2350
|
+
toolbarClass += ' toolbar--filters-top';
|
|
2351
|
+
}
|
|
2352
|
+
if (!cfg.buttons) {
|
|
2353
|
+
toolbarClass += ' toolbar--no-buttons';
|
|
2354
|
+
}
|
|
2355
|
+
if (!cfg.actions && !cfg.expand) {
|
|
2356
|
+
toolbarClass += ' toolbar--no-actions';
|
|
2357
|
+
}
|
|
2358
|
+
let html = '<section class="' + toolbarClass + '" data-component="TuyaCapsuleSearch">';
|
|
2359
|
+
const filterBlock =
|
|
2360
|
+
'<div class="filter-panel"><div class="capsule-search" role="presentation">' +
|
|
2361
|
+
'<div class="filter-fields">' + cfg.fields + (cfg.expand ? staticExpandExtraFields() : '') + '</div>' +
|
|
2362
|
+
((cfg.actions || cfg.expand)
|
|
2363
|
+
? staticSearchActions({ showActions: cfg.actions, showExpand: cfg.expand })
|
|
2364
|
+
: '') +
|
|
2365
|
+
'</div></div>';
|
|
2366
|
+
|
|
2367
|
+
if (cfg.filtersTop) {
|
|
2368
|
+
html += filterBlock;
|
|
2369
|
+
if (cfg.buttons || cfg.extraActions) {
|
|
2370
|
+
html += '<div class="toolbar-action-row">';
|
|
2371
|
+
if (cfg.buttons) {
|
|
2372
|
+
html += staticButtonGroup();
|
|
2373
|
+
} else {
|
|
2374
|
+
html += '<div class="button-group"></div>';
|
|
2375
|
+
}
|
|
2376
|
+
if (cfg.extraActions) {
|
|
2377
|
+
html += staticExtraActions();
|
|
2378
|
+
}
|
|
2379
|
+
html += '</div>';
|
|
2380
|
+
}
|
|
2381
|
+
} else {
|
|
2382
|
+
if (cfg.buttons) {
|
|
2383
|
+
html += staticButtonGroup();
|
|
2384
|
+
}
|
|
2385
|
+
html += filterBlock;
|
|
2386
|
+
}
|
|
2387
|
+
html += '</section>';
|
|
2388
|
+
return html;
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
function renderContextScenario(label, demoHtml, desc) {
|
|
2392
|
+
const head = desc
|
|
2393
|
+
? '<div class="context-scenario-head">' +
|
|
2394
|
+
'<div class="context-scenario-label">' + label + '</div>' +
|
|
2395
|
+
'<div class="context-scenario-desc">' + desc + '</div>' +
|
|
2396
|
+
'</div>'
|
|
2397
|
+
: '<div class="context-scenario-label">' + label + '</div>';
|
|
2398
|
+
return '<div class="context-scenario">' +
|
|
2399
|
+
head +
|
|
2400
|
+
'<div class="context-scenario-demo">' + demoHtml + '</div>' +
|
|
2401
|
+
'</div>';
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
function renderContextScenarios() {
|
|
2405
|
+
const root = document.getElementById('context-scenarios');
|
|
2406
|
+
if (!root) {
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
const scenarios = [
|
|
2410
|
+
{
|
|
2411
|
+
label: '标准',
|
|
2412
|
+
desc: '默认样式,适用于筛选项数量较少的场景',
|
|
2413
|
+
html: staticToolbarHtml({ buttons: true, fields: staticCoreFields(), actions: true })
|
|
2414
|
+
},
|
|
2415
|
+
{
|
|
2416
|
+
label: '上筛选下操作',
|
|
2417
|
+
desc: '筛选项在上、主操作在下;右侧可放视图切换、设置、排序、下载等辅助操作',
|
|
2418
|
+
html: staticToolbarHtml({
|
|
2419
|
+
buttons: true,
|
|
2420
|
+
fields: staticCoreFields(),
|
|
2421
|
+
actions: true,
|
|
2422
|
+
filtersTop: true,
|
|
2423
|
+
extraActions: true
|
|
2424
|
+
})
|
|
2425
|
+
},
|
|
2426
|
+
{
|
|
2427
|
+
label: '更多',
|
|
2428
|
+
desc: '当筛选项较多,可以将非高频筛选收到更多内,点击更多展开全部',
|
|
2429
|
+
html: staticToolbarHtml({ buttons: true, fields: staticCoreFields(), actions: true, expand: true })
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
label: '折行',
|
|
2433
|
+
desc: '当筛选项较多,但想默认将全部筛选都展示,使用此组件样式,默认展示全部筛选项,无更多按钮',
|
|
2434
|
+
html: staticToolbarHtml({ buttons: true, fields: staticWrapFields(), actions: true, multiline: true })
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
label: '无搜索按钮',
|
|
2438
|
+
desc: '筛选项实时搜索,无查询和重置按钮',
|
|
2439
|
+
html: staticToolbarHtml({ buttons: true, fields: staticCoreFields(), actions: false })
|
|
2440
|
+
},
|
|
2441
|
+
{
|
|
2442
|
+
label: '无搜索按钮-折行',
|
|
2443
|
+
desc: '同折行逻辑,但无查询和重置按钮',
|
|
2444
|
+
html: staticToolbarHtml({ buttons: true, fields: staticWrapFields(), actions: false, multiline: true })
|
|
2445
|
+
},
|
|
2446
|
+
{
|
|
2447
|
+
label: '无新增按钮',
|
|
2448
|
+
desc: '无新增以及其他按钮时,筛选项居左展示',
|
|
2449
|
+
html: '<div class="context-scenario-demo--stack">' +
|
|
2450
|
+
staticToolbarHtml({ buttons: false, fields: staticCoreFields(), actions: true }) +
|
|
2451
|
+
staticToolbarHtml({ buttons: false, fields: staticCoreFields(), actions: true, expand: true }) +
|
|
2452
|
+
'</div>'
|
|
2453
|
+
}
|
|
2454
|
+
];
|
|
2455
|
+
root.innerHTML = scenarios.map((s) => renderContextScenario(s.label, s.html, s.desc)).join('');
|
|
2456
|
+
bindContextExpandEvents();
|
|
2457
|
+
syncContextToolbarsWrap();
|
|
2458
|
+
}
|
|
2459
|
+
|
|
2460
|
+
/* Re-measure every static scenario toolbar that has a button group (标准 / 上筛选下操作等),
|
|
2461
|
+
so filters sink below the buttons when the container is too narrow — same rule as 折行/更多. */
|
|
2462
|
+
function syncContextToolbarsWrap() {
|
|
2463
|
+
const root = document.getElementById('context-scenarios');
|
|
2464
|
+
if (!root) {
|
|
2465
|
+
return;
|
|
2466
|
+
}
|
|
2467
|
+
root.querySelectorAll('.toolbar').forEach((toolbar) => {
|
|
2468
|
+
if (toolbar.classList.contains('toolbar--multiline') ||
|
|
2469
|
+
toolbar.classList.contains('toolbar--filters-top')) {
|
|
2470
|
+
return; /* these lay themselves out; no button/filter fit measurement needed */
|
|
2471
|
+
}
|
|
2472
|
+
const expandBtn = toolbar.querySelector('.filter-expand-link');
|
|
2473
|
+
if (expandBtn) {
|
|
2474
|
+
syncToolbarExpandWrap(toolbar); /* 更多: only wrap while expanded */
|
|
2475
|
+
} else {
|
|
2476
|
+
syncToolbarWrap(toolbar); /* 标准 / 无搜索按钮 等 */
|
|
2477
|
+
}
|
|
2478
|
+
});
|
|
2479
|
+
}
|
|
2480
|
+
|
|
2481
|
+
function syncToolbarWrap(toolbar) {
|
|
2482
|
+
if (!toolbar || !toolbar.querySelector('.button-group')) {
|
|
2483
|
+
return;
|
|
2484
|
+
}
|
|
2485
|
+
|
|
2486
|
+
toolbar.classList.remove('toolbar--expand-wrap');
|
|
2487
|
+
|
|
2488
|
+
const runMeasure = () => {
|
|
2489
|
+
const buttonGroup = toolbar.querySelector('.button-group');
|
|
2490
|
+
const filterPanel = toolbar.querySelector('.filter-panel');
|
|
2491
|
+
const capsuleSearch = toolbar.querySelector('.capsule-search');
|
|
2492
|
+
const filterFields = capsuleSearch ? capsuleSearch.querySelector('.filter-fields') : null;
|
|
2493
|
+
if (!buttonGroup || !filterPanel || !capsuleSearch) {
|
|
2494
|
+
return;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
/* Already wrapping inside the right column → move whole filter block below buttons */
|
|
2498
|
+
const rowH = readCssPx('--capsule-field-height', 32);
|
|
2499
|
+
if (capsuleSearch.scrollHeight > rowH + 1 || filterPanel.scrollHeight > rowH + 1) {
|
|
2500
|
+
toolbar.classList.add('toolbar--expand-wrap');
|
|
2501
|
+
return;
|
|
2502
|
+
}
|
|
2503
|
+
|
|
2504
|
+
const savedPanel = {
|
|
2505
|
+
flex: filterPanel.style.flex,
|
|
2506
|
+
width: filterPanel.style.width,
|
|
2507
|
+
minWidth: filterPanel.style.minWidth,
|
|
2508
|
+
maxWidth: filterPanel.style.maxWidth
|
|
2509
|
+
};
|
|
2510
|
+
const savedSearch = {
|
|
2511
|
+
flexWrap: capsuleSearch.style.flexWrap,
|
|
2512
|
+
width: capsuleSearch.style.width
|
|
2513
|
+
};
|
|
2514
|
+
const savedFields = filterFields ? {
|
|
2515
|
+
display: filterFields.style.display,
|
|
2516
|
+
flexWrap: filterFields.style.flexWrap,
|
|
2517
|
+
width: filterFields.style.width
|
|
2518
|
+
} : null;
|
|
2519
|
+
|
|
2520
|
+
filterPanel.style.flex = 'none';
|
|
2521
|
+
filterPanel.style.width = 'max-content';
|
|
2522
|
+
filterPanel.style.minWidth = 'max-content';
|
|
2523
|
+
filterPanel.style.maxWidth = 'none';
|
|
2524
|
+
capsuleSearch.style.flexWrap = 'nowrap';
|
|
2525
|
+
capsuleSearch.style.width = 'max-content';
|
|
2526
|
+
if (filterFields) {
|
|
2527
|
+
filterFields.style.display = 'flex';
|
|
2528
|
+
filterFields.style.flexWrap = 'nowrap';
|
|
2529
|
+
filterFields.style.width = 'max-content';
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
const toolbarGap = parseFloat(getComputedStyle(toolbar).gap) || 0;
|
|
2533
|
+
const needed = buttonGroup.offsetWidth + toolbarGap + filterPanel.offsetWidth;
|
|
2534
|
+
|
|
2535
|
+
filterPanel.style.flex = savedPanel.flex;
|
|
2536
|
+
filterPanel.style.width = savedPanel.width;
|
|
2537
|
+
filterPanel.style.minWidth = savedPanel.minWidth;
|
|
2538
|
+
filterPanel.style.maxWidth = savedPanel.maxWidth;
|
|
2539
|
+
capsuleSearch.style.flexWrap = savedSearch.flexWrap;
|
|
2540
|
+
capsuleSearch.style.width = savedSearch.width;
|
|
2541
|
+
if (filterFields && savedFields) {
|
|
2542
|
+
filterFields.style.display = savedFields.display;
|
|
2543
|
+
filterFields.style.flexWrap = savedFields.flexWrap;
|
|
2544
|
+
filterFields.style.width = savedFields.width;
|
|
2545
|
+
}
|
|
2546
|
+
|
|
2547
|
+
if (needed > toolbar.clientWidth + 1) {
|
|
2548
|
+
toolbar.classList.add('toolbar--expand-wrap');
|
|
2549
|
+
}
|
|
2550
|
+
};
|
|
2551
|
+
|
|
2552
|
+
requestAnimationFrame(() => {
|
|
2553
|
+
requestAnimationFrame(runMeasure);
|
|
2554
|
+
});
|
|
2555
|
+
}
|
|
2556
|
+
|
|
2557
|
+
function syncToolbarExpandWrap(toolbar) {
|
|
2558
|
+
if (!toolbar || !toolbar.querySelector('.button-group')) {
|
|
2559
|
+
return;
|
|
2560
|
+
}
|
|
2561
|
+
/* Same adaptive rule as 标准/折行, regardless of expanded state:
|
|
2562
|
+
measure whether the currently visible fields + buttons fit on one row; if not,
|
|
2563
|
+
sink the whole filter block below the buttons. When collapsed the extra fields
|
|
2564
|
+
are hidden, so this only sinks if even the core fields overflow. */
|
|
2565
|
+
syncToolbarWrap(toolbar);
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
function bindContextExpandEvents() {
|
|
2569
|
+
const root = document.getElementById('context-scenarios');
|
|
2570
|
+
if (!root) {
|
|
2571
|
+
return;
|
|
2572
|
+
}
|
|
2573
|
+
root.querySelectorAll('.filter-expand-link').forEach((btn) => {
|
|
2574
|
+
btn.addEventListener('click', () => {
|
|
2575
|
+
const toolbar = btn.closest('.toolbar');
|
|
2576
|
+
if (!toolbar) {
|
|
2577
|
+
return;
|
|
2578
|
+
}
|
|
2579
|
+
const expanded = btn.getAttribute('aria-expanded') === 'true';
|
|
2580
|
+
const next = !expanded;
|
|
2581
|
+
toolbar.querySelectorAll('.filter-field-extra').forEach((field) => {
|
|
2582
|
+
if (next) {
|
|
2583
|
+
field.removeAttribute('hidden');
|
|
2584
|
+
} else {
|
|
2585
|
+
field.setAttribute('hidden', '');
|
|
2586
|
+
}
|
|
2587
|
+
});
|
|
2588
|
+
btn.setAttribute('aria-expanded', next ? 'true' : 'false');
|
|
2589
|
+
const textEl = btn.querySelector('.filter-expand-text');
|
|
2590
|
+
if (textEl) {
|
|
2591
|
+
textEl.textContent = next ? '收起' : '展开';
|
|
2592
|
+
}
|
|
2593
|
+
syncToolbarExpandWrap(toolbar);
|
|
2594
|
+
});
|
|
2595
|
+
});
|
|
2596
|
+
if (!window.__contextExpandWrapResizeBound) {
|
|
2597
|
+
window.__contextExpandWrapResizeBound = true;
|
|
2598
|
+
let expandWrapTimer = null;
|
|
2599
|
+
window.addEventListener('resize', () => {
|
|
2600
|
+
clearTimeout(expandWrapTimer);
|
|
2601
|
+
expandWrapTimer = setTimeout(() => {
|
|
2602
|
+
root.querySelectorAll('.toolbar .filter-expand-link').forEach((btn) => {
|
|
2603
|
+
syncToolbarExpandWrap(btn.closest('.toolbar'));
|
|
2604
|
+
});
|
|
2605
|
+
}, 100);
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
function renderLiveFields(options) {
|
|
2611
|
+
const opts = options || {};
|
|
2612
|
+
const liveEl = document.getElementById('live-fields');
|
|
2613
|
+
if (liveEl) {
|
|
2614
|
+
liveEl.innerHTML = LIVE_IDS.map(renderLiveField).join('');
|
|
2615
|
+
}
|
|
2616
|
+
if (!opts.skipSizeGrid) {
|
|
2617
|
+
renderSizeRulesGrid();
|
|
2618
|
+
}
|
|
2619
|
+
if (!opts.deferPopover) {
|
|
2620
|
+
repositionPopoverIfOpen();
|
|
2621
|
+
}
|
|
2622
|
+
const f = liveState.openId ? liveState.fields[liveState.openId] : null;
|
|
2623
|
+
if (f && (f.type === 'input' || (f.type === 'input-key-select' && liveState.openMode === 'input'))) {
|
|
2624
|
+
focusInput(liveState.openId);
|
|
2625
|
+
} else if (f && f.type === 'select-search') {
|
|
2626
|
+
focusSelectSearch(liveState.openId);
|
|
2627
|
+
}
|
|
2628
|
+
if (!opts.skipToolbarWrap) {
|
|
2629
|
+
requestAnimationFrame(() => {
|
|
2630
|
+
initLabelTooltips(document);
|
|
2631
|
+
syncToolbarWrap(document.getElementById('live-toolbar'));
|
|
2632
|
+
});
|
|
2633
|
+
} else {
|
|
2634
|
+
requestAnimationFrame(() => {
|
|
2635
|
+
initLabelTooltips(document);
|
|
2636
|
+
});
|
|
2637
|
+
}
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
function repositionPopoverIfOpen() {
|
|
2641
|
+
const portal = document.getElementById('popover-portal');
|
|
2642
|
+
if (!liveState.openId || !portal.querySelector('.capsule-popover')) {
|
|
2643
|
+
return;
|
|
2644
|
+
}
|
|
2645
|
+
positionPopover();
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
function refreshLiveFieldPopover(options) {
|
|
2649
|
+
renderLiveFields(Object.assign({ deferPopover: true, skipSizeGrid: true, skipToolbarWrap: true }, options || {}));
|
|
2650
|
+
renderPopover();
|
|
2651
|
+
}
|
|
2652
|
+
|
|
2653
|
+
function resetFieldValue(f) {
|
|
2654
|
+
if (f.type === 'multi-select' || f.type === 'cascader') {
|
|
2655
|
+
f.value = [];
|
|
2656
|
+
} else if (f.type === 'date-range') {
|
|
2657
|
+
f.value = [null, null];
|
|
2658
|
+
} else {
|
|
2659
|
+
f.value = '';
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
|
|
2663
|
+
function activateInput(id) {
|
|
2664
|
+
liveState.openId = id;
|
|
2665
|
+
liveState.openMode = 'input';
|
|
2666
|
+
const portal = document.getElementById('popover-portal');
|
|
2667
|
+
portal.classList.remove('is-open');
|
|
2668
|
+
portal.innerHTML = '';
|
|
2669
|
+
renderLiveFields({ deferPopover: true, skipSizeGrid: true, skipToolbarWrap: true });
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
function toggleLabelSelect(id) {
|
|
2673
|
+
if (liveState.openId === id && liveState.openMode === 'label') {
|
|
2674
|
+
closePopover();
|
|
2675
|
+
return;
|
|
2676
|
+
}
|
|
2677
|
+
liveState.openId = id;
|
|
2678
|
+
liveState.openMode = 'label';
|
|
2679
|
+
refreshLiveFieldPopover();
|
|
2680
|
+
}
|
|
2681
|
+
|
|
2682
|
+
function bindLiveFieldEvents() {
|
|
2683
|
+
const liveEl = document.getElementById('live-fields');
|
|
2684
|
+
if (!liveEl || liveEl.dataset.liveBound === '1') {
|
|
2685
|
+
return;
|
|
2686
|
+
}
|
|
2687
|
+
liveEl.dataset.liveBound = '1';
|
|
2688
|
+
|
|
2689
|
+
liveEl.addEventListener('click', (e) => {
|
|
2690
|
+
const clearBtn = e.target.closest('[data-clear]');
|
|
2691
|
+
if (clearBtn) {
|
|
2692
|
+
e.stopPropagation();
|
|
2693
|
+
clearField(clearBtn.dataset.clear);
|
|
2694
|
+
return;
|
|
2695
|
+
}
|
|
2696
|
+
if (e.target.closest('[data-label-select-id]')) {
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
if (e.target.closest('[data-input-id]') || e.target.closest('[data-select-search-id]')) {
|
|
2700
|
+
return;
|
|
2701
|
+
}
|
|
2702
|
+
const field = e.target.closest('.filter-field.is-live');
|
|
2703
|
+
if (!field) {
|
|
2704
|
+
return;
|
|
2705
|
+
}
|
|
2706
|
+
const id = field.dataset.fieldId;
|
|
2707
|
+
const f = liveState.fields[id];
|
|
2708
|
+
if (!f) {
|
|
2709
|
+
return;
|
|
2710
|
+
}
|
|
2711
|
+
e.stopPropagation();
|
|
2712
|
+
if (f.type === 'input' || f.type === 'input-key-select') {
|
|
2713
|
+
activateInput(id);
|
|
2714
|
+
return;
|
|
2715
|
+
}
|
|
2716
|
+
toggleField(id);
|
|
2717
|
+
});
|
|
2718
|
+
|
|
2719
|
+
liveEl.addEventListener('keydown', (e) => {
|
|
2720
|
+
const field = e.target.closest('.filter-field.is-live');
|
|
2721
|
+
if (!field) {
|
|
2722
|
+
return;
|
|
2723
|
+
}
|
|
2724
|
+
const id = field.dataset.fieldId;
|
|
2725
|
+
const f = liveState.fields[id];
|
|
2726
|
+
if (!f || (f.type !== 'input' && f.type !== 'input-key-select')) {
|
|
2727
|
+
return;
|
|
2728
|
+
}
|
|
2729
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2730
|
+
e.preventDefault();
|
|
2731
|
+
activateInput(id);
|
|
2732
|
+
}
|
|
2733
|
+
});
|
|
2734
|
+
|
|
2735
|
+
liveEl.addEventListener('click', (e) => {
|
|
2736
|
+
const labelSelect = e.target.closest('[data-label-select-id]');
|
|
2737
|
+
if (!labelSelect) {
|
|
2738
|
+
return;
|
|
2739
|
+
}
|
|
2740
|
+
e.stopPropagation();
|
|
2741
|
+
toggleLabelSelect(labelSelect.dataset.labelSelectId);
|
|
2742
|
+
}, true);
|
|
2743
|
+
|
|
2744
|
+
liveEl.addEventListener('keydown', (e) => {
|
|
2745
|
+
const labelSelect = e.target.closest('[data-label-select-id]');
|
|
2746
|
+
if (!labelSelect) {
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
2750
|
+
e.preventDefault();
|
|
2751
|
+
e.stopPropagation();
|
|
2752
|
+
toggleLabelSelect(labelSelect.dataset.labelSelectId);
|
|
2753
|
+
}
|
|
2754
|
+
});
|
|
2755
|
+
|
|
2756
|
+
liveEl.addEventListener('input', (e) => {
|
|
2757
|
+
const input = e.target;
|
|
2758
|
+
if (input.dataset.inputId) {
|
|
2759
|
+
liveState.fields[input.dataset.inputId].value = input.value;
|
|
2760
|
+
syncInputBodyWidth(input);
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
if (input.dataset.selectSearchId) {
|
|
2764
|
+
liveState.selectSearchQuery = input.value;
|
|
2765
|
+
syncInputBodyWidth(input);
|
|
2766
|
+
filterSelectSearchOptions(input.value);
|
|
2767
|
+
}
|
|
2768
|
+
});
|
|
2769
|
+
|
|
2770
|
+
liveEl.addEventListener('keydown', (e) => {
|
|
2771
|
+
const input = e.target;
|
|
2772
|
+
if (input.dataset.inputId) {
|
|
2773
|
+
e.stopPropagation();
|
|
2774
|
+
if (e.key === 'Enter' || e.key === 'Escape') {
|
|
2775
|
+
e.preventDefault();
|
|
2776
|
+
closePopover();
|
|
2777
|
+
}
|
|
2778
|
+
return;
|
|
2779
|
+
}
|
|
2780
|
+
if (input.dataset.selectSearchId && e.key === 'Escape') {
|
|
2781
|
+
e.stopPropagation();
|
|
2782
|
+
e.preventDefault();
|
|
2783
|
+
closePopover();
|
|
2784
|
+
}
|
|
2785
|
+
}, true);
|
|
2786
|
+
|
|
2787
|
+
liveEl.addEventListener('focusout', (e) => {
|
|
2788
|
+
const input = e.target;
|
|
2789
|
+
if (!input.dataset || !input.dataset.inputId) {
|
|
2790
|
+
return;
|
|
2791
|
+
}
|
|
2792
|
+
window.setTimeout(() => {
|
|
2793
|
+
if (liveState.openId !== input.dataset.inputId) {
|
|
2794
|
+
return;
|
|
2795
|
+
}
|
|
2796
|
+
closePopover();
|
|
2797
|
+
}, 0);
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2800
|
+
|
|
2801
|
+
function syncSelectSearchEmptyState(portal, query) {
|
|
2802
|
+
const emptyEl = portal.querySelector('[data-search-empty]');
|
|
2803
|
+
if (!emptyEl) {
|
|
2804
|
+
return;
|
|
2805
|
+
}
|
|
2806
|
+
const q = String(query || '').trim();
|
|
2807
|
+
const visible = portal.querySelectorAll('[data-opt]:not(.is-hidden)').length;
|
|
2808
|
+
emptyEl.classList.toggle('is-hidden', !(q && visible === 0));
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
function filterSelectSearchOptions(query) {
|
|
2812
|
+
const portal = document.getElementById('popover-portal');
|
|
2813
|
+
const q = String(query || '').trim().toLowerCase();
|
|
2814
|
+
portal.querySelectorAll('[data-opt]').forEach((li) => {
|
|
2815
|
+
const match = !q || li.dataset.opt.toLowerCase().includes(q);
|
|
2816
|
+
li.classList.toggle('is-hidden', !match);
|
|
2817
|
+
});
|
|
2818
|
+
syncSelectSearchEmptyState(portal, query);
|
|
2819
|
+
if (liveState.openId) {
|
|
2820
|
+
positionPopover();
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
function toggleField(id) {
|
|
2825
|
+
const f = liveState.fields[id];
|
|
2826
|
+
if (f.type === 'input' || f.type === 'input-key-select') {
|
|
2827
|
+
activateInput(id);
|
|
2828
|
+
return;
|
|
2829
|
+
}
|
|
2830
|
+
if (liveState.openId === id) {
|
|
2831
|
+
closePopover();
|
|
2832
|
+
return;
|
|
2833
|
+
}
|
|
2834
|
+
liveState.openId = id;
|
|
2835
|
+
liveState.openMode = null;
|
|
2836
|
+
liveState.rangePickStep = 0;
|
|
2837
|
+
liveState.rangeHover = null;
|
|
2838
|
+
liveState.selectSearchQuery = '';
|
|
2839
|
+
liveState.cascaderActivePath = (f.type === 'cascader' && f.value && f.value.length)
|
|
2840
|
+
? f.value.slice()
|
|
2841
|
+
: [];
|
|
2842
|
+
refreshLiveFieldPopover();
|
|
2843
|
+
}
|
|
2844
|
+
|
|
2845
|
+
function closePopover() {
|
|
2846
|
+
liveState.openId = null;
|
|
2847
|
+
liveState.openMode = null;
|
|
2848
|
+
liveState.rangePickStep = 0;
|
|
2849
|
+
liveState.rangeHover = null;
|
|
2850
|
+
liveState.selectSearchQuery = '';
|
|
2851
|
+
liveState.cascaderActivePath = [];
|
|
2852
|
+
document.getElementById('popover-portal').classList.remove('is-open');
|
|
2853
|
+
document.getElementById('popover-portal').innerHTML = '';
|
|
2854
|
+
renderLiveFields({ deferPopover: true, skipSizeGrid: true, skipToolbarWrap: true });
|
|
2855
|
+
}
|
|
2856
|
+
|
|
2857
|
+
function clearField(id) {
|
|
2858
|
+
const f = liveState.fields[id];
|
|
2859
|
+
if (!f) {
|
|
2860
|
+
return;
|
|
2861
|
+
}
|
|
2862
|
+
if (f.type === 'multi-select' || f.type === 'cascader') {
|
|
2863
|
+
f.value = [];
|
|
2864
|
+
} else if (f.type === 'date-range') {
|
|
2865
|
+
f.value = [null, null];
|
|
2866
|
+
} else {
|
|
2867
|
+
f.value = '';
|
|
2868
|
+
}
|
|
2869
|
+
if (liveState.openId === id) {
|
|
2870
|
+
closePopover();
|
|
2871
|
+
} else {
|
|
2872
|
+
renderLiveFields({ deferPopover: true, skipSizeGrid: true });
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
function positionPopover() {
|
|
2877
|
+
const portal = document.getElementById('popover-portal');
|
|
2878
|
+
const id = liveState.openId;
|
|
2879
|
+
if (!id) {
|
|
2880
|
+
return;
|
|
2881
|
+
}
|
|
2882
|
+
const f = liveState.fields[id];
|
|
2883
|
+
if (f.type === 'input' || (f.type === 'input-key-select' && liveState.openMode === 'input')) {
|
|
2884
|
+
portal.classList.remove('is-open');
|
|
2885
|
+
return;
|
|
2886
|
+
}
|
|
2887
|
+
const field = document.querySelector('[data-field-id="' + id + '"]');
|
|
2888
|
+
if (!field) {
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
const anchor = (f.type === 'input-key-select' && liveState.openMode === 'label')
|
|
2893
|
+
? field.querySelector('.filter-label-wrap--select') || field
|
|
2894
|
+
: field;
|
|
2895
|
+
|
|
2896
|
+
const GAP = 4;
|
|
2897
|
+
const EDGE = 8;
|
|
2898
|
+
const rect = anchor.getBoundingClientRect();
|
|
2899
|
+
const vw = window.innerWidth;
|
|
2900
|
+
const vh = window.innerHeight;
|
|
2901
|
+
|
|
2902
|
+
const wasOpen = portal.classList.contains('is-open');
|
|
2903
|
+
portal.classList.add('is-open');
|
|
2904
|
+
if (!wasOpen) {
|
|
2905
|
+
portal.style.visibility = 'hidden';
|
|
2906
|
+
portal.style.pointerEvents = 'none';
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
const popEl = portal.querySelector('.capsule-popover') || portal;
|
|
2910
|
+
if (popEl.classList.contains('is-fit-content')) {
|
|
2911
|
+
popEl.style.minWidth = Math.round(rect.width) + 'px';
|
|
2912
|
+
popEl.style.maxWidth = readCssPx('--capsule-popover-list-max-width', 500) + 'px';
|
|
2913
|
+
} else {
|
|
2914
|
+
popEl.style.minWidth = '';
|
|
2915
|
+
popEl.style.maxWidth = '';
|
|
2916
|
+
}
|
|
2917
|
+
const popW = popEl.offsetWidth || Math.round(rect.width) || 200;
|
|
2918
|
+
const popH = popEl.offsetHeight || 120;
|
|
2919
|
+
|
|
2920
|
+
const spaceBelow = vh - rect.bottom - GAP - EDGE;
|
|
2921
|
+
const spaceAbove = rect.top - GAP - EDGE;
|
|
2922
|
+
const spaceRight = vw - rect.right - GAP - EDGE;
|
|
2923
|
+
const spaceLeft = rect.left - GAP - EDGE;
|
|
2924
|
+
const fieldMidX = rect.left + rect.width / 2;
|
|
2925
|
+
const viewMidX = vw / 2;
|
|
2926
|
+
/* Tree-multi panel: prefer left-aligned to the trigger; only switch alignment when it overflows.
|
|
2927
|
+
Other popovers keep the legacy "panel to the left when field on right" behavior. */
|
|
2928
|
+
const isTreeMulti = !!(popEl.classList && popEl.classList.contains('is-tree-multi'));
|
|
2929
|
+
const canAlignLeft = rect.left + popW <= vw - EDGE; /* left-aligned panel fits within viewport */
|
|
2930
|
+
const preferPanelLeft = isTreeMulti
|
|
2931
|
+
? !canAlignLeft /* left-align by default; flip to right-align only when it can't fit */
|
|
2932
|
+
: fieldMidX >= viewMidX; /* field on right → panel to the left */
|
|
2933
|
+
|
|
2934
|
+
const canBelow = spaceBelow >= popH;
|
|
2935
|
+
const canAbove = spaceAbove >= popH;
|
|
2936
|
+
const canRight = spaceRight >= popW;
|
|
2937
|
+
const canLeft = spaceLeft >= popW;
|
|
2938
|
+
|
|
2939
|
+
let placement;
|
|
2940
|
+
if (canBelow) {
|
|
2941
|
+
placement = 'bottom';
|
|
2942
|
+
} else if (canAbove) {
|
|
2943
|
+
placement = 'top';
|
|
2944
|
+
} else if (preferPanelLeft && canLeft) {
|
|
2945
|
+
placement = 'left';
|
|
2946
|
+
} else if (!preferPanelLeft && canRight) {
|
|
2947
|
+
placement = 'right';
|
|
2948
|
+
} else if (canLeft) {
|
|
2949
|
+
placement = 'left';
|
|
2950
|
+
} else if (canRight) {
|
|
2951
|
+
placement = 'right';
|
|
2952
|
+
} else {
|
|
2953
|
+
placement = spaceBelow >= spaceAbove ? 'bottom' : 'top';
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
let left;
|
|
2957
|
+
let top;
|
|
2958
|
+
if (placement === 'bottom') {
|
|
2959
|
+
top = rect.bottom + GAP;
|
|
2960
|
+
left = preferPanelLeft ? rect.right - popW : rect.left;
|
|
2961
|
+
} else if (placement === 'top') {
|
|
2962
|
+
top = rect.top - popH - GAP;
|
|
2963
|
+
left = preferPanelLeft ? rect.right - popW : rect.left;
|
|
2964
|
+
} else if (placement === 'left') {
|
|
2965
|
+
left = rect.left - popW - GAP;
|
|
2966
|
+
top = rect.top;
|
|
2967
|
+
} else {
|
|
2968
|
+
left = rect.right + GAP;
|
|
2969
|
+
top = rect.top;
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
left = Math.min(Math.max(EDGE, left), Math.max(EDGE, vw - popW - EDGE));
|
|
2973
|
+
top = Math.min(Math.max(EDGE, top), Math.max(EDGE, vh - popH - EDGE));
|
|
2974
|
+
|
|
2975
|
+
portal.style.left = Math.round(left) + 'px';
|
|
2976
|
+
portal.style.top = Math.round(top) + 'px';
|
|
2977
|
+
portal.dataset.placement = placement;
|
|
2978
|
+
portal.style.visibility = '';
|
|
2979
|
+
portal.style.pointerEvents = '';
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
/**
|
|
2983
|
+
* Ant Design DatePicker / RangePicker 结构(双月区间),仅日期、无 showTime。
|
|
2984
|
+
* disabledDate:默认全部可选;业务按需传入限制(示例保留钩子,默认 false)。
|
|
2985
|
+
*/
|
|
2986
|
+
function startOfDay(d) {
|
|
2987
|
+
const x = new Date(d);
|
|
2988
|
+
x.setHours(0, 0, 0, 0);
|
|
2989
|
+
return x;
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
function endOfDay(d) {
|
|
2993
|
+
const x = new Date(d);
|
|
2994
|
+
x.setHours(23, 59, 59, 999);
|
|
2995
|
+
return x;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
/** @param {Date} current @returns {boolean} — override per business; default all selectable */
|
|
2999
|
+
function disabledDate(current) {
|
|
3000
|
+
return false;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
function shiftMonth(year, month, delta) {
|
|
3004
|
+
const d = new Date(year, month + delta, 1);
|
|
3005
|
+
return { year: d.getFullYear(), month: d.getMonth() };
|
|
3006
|
+
}
|
|
3007
|
+
|
|
3008
|
+
function dayTimeFromSpan(span) {
|
|
3009
|
+
return startOfDay(new Date(Number(span.dataset.y), Number(span.dataset.m), Number(span.dataset.day))).getTime();
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
function clearRangeHoverPreview(portal) {
|
|
3013
|
+
portal.querySelectorAll('.in-range-hover').forEach((el) => {
|
|
3014
|
+
el.classList.remove('in-range-hover');
|
|
3015
|
+
});
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
function applyRangeHoverPreview(portal, startDate, hoverDate) {
|
|
3019
|
+
clearRangeHoverPreview(portal);
|
|
3020
|
+
if (!startDate || !hoverDate) {
|
|
3021
|
+
return;
|
|
3022
|
+
}
|
|
3023
|
+
let a = startOfDay(startDate).getTime();
|
|
3024
|
+
let b = startOfDay(hoverDate).getTime();
|
|
3025
|
+
if (a === b) {
|
|
3026
|
+
return;
|
|
3027
|
+
}
|
|
3028
|
+
if (a > b) {
|
|
3029
|
+
const tmp = a;
|
|
3030
|
+
a = b;
|
|
3031
|
+
b = tmp;
|
|
3032
|
+
}
|
|
3033
|
+
portal.querySelectorAll('[data-day]').forEach((span) => {
|
|
3034
|
+
if (span.classList.contains('range-start') || span.classList.contains('range-end') || span.classList.contains('is-disabled')) {
|
|
3035
|
+
return;
|
|
3036
|
+
}
|
|
3037
|
+
const t = dayTimeFromSpan(span);
|
|
3038
|
+
if (t > a && t < b) {
|
|
3039
|
+
span.classList.add('in-range-hover');
|
|
3040
|
+
}
|
|
3041
|
+
});
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
function buildCalendarMonth(year, month, fieldId, mode, headVariant) {
|
|
3045
|
+
const f = liveState.fields[fieldId];
|
|
3046
|
+
const first = new Date(year, month, 1);
|
|
3047
|
+
const startDay = first.getDay();
|
|
3048
|
+
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
3049
|
+
const today = startOfDay(new Date());
|
|
3050
|
+
const hover = liveState.rangeHover ? startOfDay(liveState.rangeHover) : null;
|
|
3051
|
+
const pickingEnd = mode === 'range' && liveState.rangePickStep === 1 && f.value[0] && !f.value[1];
|
|
3052
|
+
|
|
3053
|
+
let cells = ['日','一','二','三','四','五','六'].map(d => '<span class="wk">' + d + '</span>').join('');
|
|
3054
|
+
for (let i = 0; i < startDay; i++) {
|
|
3055
|
+
cells += '<span class="is-empty"></span>';
|
|
3056
|
+
}
|
|
3057
|
+
for (let d = 1; d <= daysInMonth; d++) {
|
|
3058
|
+
const date = startOfDay(new Date(year, month, d));
|
|
3059
|
+
const classes = [];
|
|
3060
|
+
const disabled = disabledDate(date);
|
|
3061
|
+
if (disabled) {
|
|
3062
|
+
classes.push('is-disabled');
|
|
3063
|
+
}
|
|
3064
|
+
if (date.getTime() === today.getTime()) {
|
|
3065
|
+
classes.push('today');
|
|
3066
|
+
}
|
|
3067
|
+
if (mode === 'single' && f.value === fmtDate(date)) {
|
|
3068
|
+
classes.push('picked');
|
|
3069
|
+
}
|
|
3070
|
+
if (mode === 'range') {
|
|
3071
|
+
const [s, e] = f.value;
|
|
3072
|
+
const t = date.getTime();
|
|
3073
|
+
if (s && t === startOfDay(s).getTime()) {
|
|
3074
|
+
classes.push('range-start');
|
|
3075
|
+
} else if (e && t === startOfDay(e).getTime()) {
|
|
3076
|
+
classes.push('range-end');
|
|
3077
|
+
} else if (s && e && t > startOfDay(s).getTime() && t < startOfDay(e).getTime()) {
|
|
3078
|
+
classes.push('in-range');
|
|
3079
|
+
} else if (pickingEnd && hover && s) {
|
|
3080
|
+
let a = startOfDay(s).getTime();
|
|
3081
|
+
let b = hover.getTime();
|
|
3082
|
+
if (a > b) {
|
|
3083
|
+
const tmp = a;
|
|
3084
|
+
a = b;
|
|
3085
|
+
b = tmp;
|
|
3086
|
+
}
|
|
3087
|
+
if (t > a && t < b) {
|
|
3088
|
+
classes.push('in-range-hover');
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
const attrs = disabled
|
|
3093
|
+
? ' class="' + classes.join(' ') + '"'
|
|
3094
|
+
: ' class="' + classes.join(' ') + '" data-day="' + d + '" data-y="' + year + '" data-m="' + month + '"';
|
|
3095
|
+
cells += '<span' + attrs + '>' + d + '</span>';
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
let head;
|
|
3099
|
+
if (headVariant === 'single') {
|
|
3100
|
+
head = '<div class="cal-head">' +
|
|
3101
|
+
'<button type="button" data-cal-nav="-1" aria-label="上一月"><i class="ri-arrow-left-s-line"></i></button>' +
|
|
3102
|
+
'<span>' + year + '年 ' + (month + 1) + '月</span>' +
|
|
3103
|
+
'<button type="button" data-cal-nav="1" aria-label="下一月"><i class="ri-arrow-right-s-line"></i></button></div>';
|
|
3104
|
+
} else if (headVariant === 'range-left') {
|
|
3105
|
+
head = '<div class="cal-head is-range-left">' +
|
|
3106
|
+
'<button type="button" data-cal-nav="-1" aria-label="上一月"><i class="ri-arrow-left-s-line"></i></button>' +
|
|
3107
|
+
'<span>' + year + '年 ' + (month + 1) + '月</span>' +
|
|
3108
|
+
'<span class="cal-head-spacer" aria-hidden="true"></span></div>';
|
|
3109
|
+
} else {
|
|
3110
|
+
head = '<div class="cal-head is-range-right">' +
|
|
3111
|
+
'<span class="cal-head-spacer" aria-hidden="true"></span>' +
|
|
3112
|
+
'<span>' + year + '年 ' + (month + 1) + '月</span>' +
|
|
3113
|
+
'<button type="button" data-cal-nav="1" aria-label="下一月"><i class="ri-arrow-right-s-line"></i></button></div>';
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
const foot = mode === 'single' ? '<div class="cal-foot" data-today="1">今天</div>' : '';
|
|
3117
|
+
return head + '<div class="cal-grid">' + cells + '</div>' + foot;
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
function buildCalendar(single, fieldId) {
|
|
3121
|
+
if (single) {
|
|
3122
|
+
return buildCalendarMonth(liveState.calYear, liveState.calMonth, fieldId, 'single', 'single');
|
|
3123
|
+
}
|
|
3124
|
+
const left = { year: liveState.calYear, month: liveState.calMonth };
|
|
3125
|
+
const right = shiftMonth(left.year, left.month, 1);
|
|
3126
|
+
return buildCalendarMonth(left.year, left.month, fieldId, 'range', 'range-left') +
|
|
3127
|
+
'<!--SPLIT-->' +
|
|
3128
|
+
buildCalendarMonth(right.year, right.month, fieldId, 'range', 'range-right');
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
function renderPopover() {
|
|
3132
|
+
const portal = document.getElementById('popover-portal');
|
|
3133
|
+
const id = liveState.openId;
|
|
3134
|
+
if (!id) { portal.innerHTML = ''; return; }
|
|
3135
|
+
const f = liveState.fields[id];
|
|
3136
|
+
let html = '';
|
|
3137
|
+
|
|
3138
|
+
if (f.type === 'select' || f.type === 'select-search') {
|
|
3139
|
+
const q = (f.type === 'select-search' ? liveState.selectSearchQuery : '').trim().toLowerCase();
|
|
3140
|
+
const visibleCount = f.type === 'select-search' && q
|
|
3141
|
+
? f.options.filter((opt) => opt.toLowerCase().includes(q)).length
|
|
3142
|
+
: f.options.length;
|
|
3143
|
+
const items = f.options.map((opt) => {
|
|
3144
|
+
const hidden = q && !opt.toLowerCase().includes(q);
|
|
3145
|
+
return '<li data-opt="' + opt + '" class="' +
|
|
3146
|
+
(f.value === opt ? 'is-selected' : '') +
|
|
3147
|
+
(hidden ? ' is-hidden' : '') + '">' + opt +
|
|
3148
|
+
(f.value === opt ? iconImg(ICON.check, 'check') : '') + '</li>';
|
|
3149
|
+
}).join('');
|
|
3150
|
+
const emptyRow = f.type === 'select-search'
|
|
3151
|
+
? '<li class="capsule-popover-empty' +
|
|
3152
|
+
(q && visibleCount === 0 ? '' : ' is-hidden') +
|
|
3153
|
+
'" data-search-empty role="presentation">暂无搜索结果</li>'
|
|
3154
|
+
: '';
|
|
3155
|
+
html = '<div class="capsule-popover is-fit-content"><ul class="capsule-popover-list">' + items + emptyRow + '</ul></div>';
|
|
3156
|
+
} else if (f.type === 'input-key-select' && liveState.openMode === 'label') {
|
|
3157
|
+
const items = f.labelOptions.map((opt) => {
|
|
3158
|
+
return '<li data-label-key="' + escapeAttr(opt) + '" class="' +
|
|
3159
|
+
(f.labelKey === opt ? 'is-selected' : '') + '" role="option">' +
|
|
3160
|
+
escapeAttr(opt) + (f.labelKey === opt ? iconImg(ICON.check, 'check') : '') + '</li>';
|
|
3161
|
+
}).join('');
|
|
3162
|
+
html = '<div class="capsule-popover is-fit-content"><ul class="capsule-popover-list" role="listbox">' + items + '</ul></div>';
|
|
3163
|
+
} else if (f.type === 'multi-select') {
|
|
3164
|
+
if (f.selectionMode === 'tree') {
|
|
3165
|
+
html = buildTreeMultiPopover(f);
|
|
3166
|
+
} else {
|
|
3167
|
+
const items = f.options.map(opt => {
|
|
3168
|
+
const sel = f.value.includes(opt);
|
|
3169
|
+
return '<li data-multi="' + opt + '" class="' + (sel ? 'is-selected' : '') + '">' + opt +
|
|
3170
|
+
(sel ? iconImg(ICON.check, 'check') : '') + '</li>';
|
|
3171
|
+
}).join('');
|
|
3172
|
+
html = '<div class="capsule-popover is-fit-content"><ul class="capsule-popover-list">' + items + '</ul></div>';
|
|
3173
|
+
}
|
|
3174
|
+
} else if (f.type === 'date') {
|
|
3175
|
+
html = '<div class="capsule-popover is-date">' + buildCalendar(true, id) + '</div>';
|
|
3176
|
+
} else if (f.type === 'date-range') {
|
|
3177
|
+
const parts = buildCalendar(false, id).split('<!--SPLIT-->');
|
|
3178
|
+
html = '<div class="capsule-popover is-date-range"><div class="range-picker">' +
|
|
3179
|
+
'<div class="cal-side">' + parts[0] + '</div>' +
|
|
3180
|
+
'<div class="cal-side">' + parts[1] + '</div>' +
|
|
3181
|
+
'</div></div>';
|
|
3182
|
+
} else if (f.type === 'cascader') {
|
|
3183
|
+
html = buildCascaderPopover(f);
|
|
3184
|
+
}
|
|
3185
|
+
|
|
3186
|
+
portal.innerHTML = html;
|
|
3187
|
+
syncTreeMultiCheckboxes(portal, f);
|
|
3188
|
+
positionPopover();
|
|
3189
|
+
bindPopoverEvents();
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
function walkTree(nodes, callback, parent, depth) {
|
|
3193
|
+
(nodes || []).forEach((node) => {
|
|
3194
|
+
callback(node, parent || null, depth || 1);
|
|
3195
|
+
walkTree(node.children, callback, node, (depth || 1) + 1);
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
function validateTreeMultiDepth(nodes, depth) {
|
|
3200
|
+
(nodes || []).forEach((node) => {
|
|
3201
|
+
if (depth > 10) throw new RangeError('TuyaAntdTree supports a maximum of 10 levels.');
|
|
3202
|
+
validateTreeMultiDepth(node.children, depth + 1);
|
|
3203
|
+
});
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
function findTreeNode(nodes, key) {
|
|
3207
|
+
let result = null;
|
|
3208
|
+
walkTree(nodes, (node) => {
|
|
3209
|
+
if (node.key === key) result = node;
|
|
3210
|
+
});
|
|
3211
|
+
return result;
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
function treeParentOf(nodes, key) {
|
|
3215
|
+
let result = null;
|
|
3216
|
+
walkTree(nodes, (node, parent) => {
|
|
3217
|
+
if (node.key === key) result = parent;
|
|
3218
|
+
});
|
|
3219
|
+
return result;
|
|
3220
|
+
}
|
|
3221
|
+
|
|
3222
|
+
function enabledLeafKeys(node) {
|
|
3223
|
+
if (!node || node.disabled) return [];
|
|
3224
|
+
if (!node.children || !node.children.length) return [node.key];
|
|
3225
|
+
return node.children.flatMap(enabledLeafKeys);
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
function treeCheckState(node, checkedKeys) {
|
|
3229
|
+
const leafKeys = enabledLeafKeys(node);
|
|
3230
|
+
const checkedCount = leafKeys.filter((key) => checkedKeys.includes(key)).length;
|
|
3231
|
+
return {
|
|
3232
|
+
checked: leafKeys.length > 0 && checkedCount === leafKeys.length,
|
|
3233
|
+
mixed: checkedCount > 0 && checkedCount < leafKeys.length
|
|
3234
|
+
};
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
function visibleTreeItems(nodes, expandedKeys, depth, ends, output) {
|
|
3238
|
+
(nodes || []).forEach((node, index) => {
|
|
3239
|
+
const item = {
|
|
3240
|
+
node: node,
|
|
3241
|
+
depth: depth,
|
|
3242
|
+
ends: ends.slice(),
|
|
3243
|
+
first: index === 0,
|
|
3244
|
+
last: index === nodes.length - 1
|
|
3245
|
+
};
|
|
3246
|
+
output.push(item);
|
|
3247
|
+
if (node.children && node.children.length && expandedKeys.has(node.key)) {
|
|
3248
|
+
visibleTreeItems(node.children, expandedKeys, depth + 1, ends.concat(item.last), output);
|
|
3249
|
+
}
|
|
3250
|
+
});
|
|
3251
|
+
return output;
|
|
3252
|
+
}
|
|
3253
|
+
|
|
3254
|
+
function buildTreeMultiPopover(f) {
|
|
3255
|
+
validateTreeMultiDepth(f.treeData || [], 1);
|
|
3256
|
+
const items = visibleTreeItems(f.treeData || [], liveState.treeExpandedKeys, 0, [], []);
|
|
3257
|
+
const rows = items.map((item) => {
|
|
3258
|
+
const node = item.node;
|
|
3259
|
+
const branch = !!(node.children && node.children.length);
|
|
3260
|
+
const state = treeCheckState(node, f.value);
|
|
3261
|
+
const indent = item.ends.map((isEnd) =>
|
|
3262
|
+
'<span class="tree-multi-indent-unit' + (isEnd ? ' is-end' : '') + '"></span>'
|
|
3263
|
+
).join('');
|
|
3264
|
+
const switcher = branch
|
|
3265
|
+
? '<button class="tree-multi-switcher" type="button" tabindex="-1" data-tree-toggle="' +
|
|
3266
|
+
escapeAttr(node.key) + '" aria-label="' +
|
|
3267
|
+
(liveState.treeExpandedKeys.has(node.key) ? '收起' : '展开') + escapeAttr(node.title) + '">' +
|
|
3268
|
+
'<span class="tree-multi-arrow">' + iconImg(ICON.arrowDown) + '</span></button>'
|
|
3269
|
+
: '<span class="tree-multi-switcher is-leaf" aria-hidden="true"></span>';
|
|
3270
|
+
return '<div class="tree-multi-node' +
|
|
3271
|
+
(liveState.treeExpandedKeys.has(node.key) ? ' is-expanded' : '') +
|
|
3272
|
+
(node.disabled ? ' is-disabled' : '') +
|
|
3273
|
+
'" role="treeitem" data-tree-key="' + escapeAttr(node.key) + '" aria-level="' + (item.depth + 1) + '"' +
|
|
3274
|
+
(branch ? ' aria-expanded="' + (liveState.treeExpandedKeys.has(node.key) ? 'true' : 'false') + '"' : '') +
|
|
3275
|
+
(node.disabled ? ' aria-disabled="true"' : '') +
|
|
3276
|
+
' tabindex="' + (liveState.treeFocusedKey === node.key ? '0' : '-1') + '">' +
|
|
3277
|
+
'<span class="tree-multi-indent" aria-hidden="true">' + indent + '</span>' +
|
|
3278
|
+
switcher +
|
|
3279
|
+
'<label class="tree-multi-checkbox" data-component="TuyaAntdCheckbox">' +
|
|
3280
|
+
'<input type="checkbox" tabindex="-1" data-tree-check="' + escapeAttr(node.key) + '"' +
|
|
3281
|
+
(state.checked ? ' checked' : '') + (node.disabled ? ' disabled' : '') +
|
|
3282
|
+
' aria-label="选择' + escapeAttr(node.title) + '"' +
|
|
3283
|
+
(state.mixed ? ' aria-checked="mixed"' : '') + ' />' +
|
|
3284
|
+
'<img class="tree-multi-check-icon" src="' + CHECKBOX_CHECK_ICON + '" alt="" aria-hidden="true" />' +
|
|
3285
|
+
'<span class="tree-multi-indeterminate" aria-hidden="true"></span>' +
|
|
3286
|
+
'</label>' +
|
|
3287
|
+
'<button class="tree-multi-content" type="button" tabindex="-1" data-tree-content="' +
|
|
3288
|
+
escapeAttr(node.key) + '">' + escapeAttr(node.title) + '</button></div>';
|
|
3289
|
+
}).join('');
|
|
3290
|
+
return '<div class="capsule-popover is-tree-multi is-fit-content">' +
|
|
3291
|
+
'<div class="tree-multi-viewport"><div class="tree-multi" role="tree" data-component="TuyaAntdTree">' +
|
|
3292
|
+
rows + '</div></div></div>';
|
|
3293
|
+
}
|
|
3294
|
+
|
|
3295
|
+
function syncTreeMultiCheckboxes(portal, f) {
|
|
3296
|
+
if (!f || f.type !== 'multi-select' || f.selectionMode !== 'tree') return;
|
|
3297
|
+
portal.querySelectorAll('[data-tree-check]').forEach((checkbox) => {
|
|
3298
|
+
const node = findTreeNode(f.treeData, checkbox.dataset.treeCheck);
|
|
3299
|
+
const state = treeCheckState(node, f.value);
|
|
3300
|
+
checkbox.indeterminate = state.mixed;
|
|
3301
|
+
if (state.mixed) checkbox.setAttribute('aria-checked', 'mixed');
|
|
3302
|
+
});
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
function toggleTreeMultiCheck(f, key) {
|
|
3306
|
+
const node = findTreeNode(f.treeData, key);
|
|
3307
|
+
if (!node || node.disabled) return;
|
|
3308
|
+
const leafKeys = enabledLeafKeys(node);
|
|
3309
|
+
const shouldCheck = !treeCheckState(node, f.value).checked;
|
|
3310
|
+
const next = new Set(f.value);
|
|
3311
|
+
leafKeys.forEach((leafKey) => {
|
|
3312
|
+
if (shouldCheck) next.add(leafKey);
|
|
3313
|
+
else next.delete(leafKey);
|
|
3314
|
+
});
|
|
3315
|
+
f.value = [];
|
|
3316
|
+
walkTree(f.treeData, (treeNode) => {
|
|
3317
|
+
if ((!treeNode.children || !treeNode.children.length) && next.has(treeNode.key)) {
|
|
3318
|
+
f.value.push(treeNode.key);
|
|
3319
|
+
}
|
|
3320
|
+
});
|
|
3321
|
+
}
|
|
3322
|
+
|
|
3323
|
+
function toggleTreeExpanded(key) {
|
|
3324
|
+
if (liveState.treeExpandedKeys.has(key)) liveState.treeExpandedKeys.delete(key);
|
|
3325
|
+
else liveState.treeExpandedKeys.add(key);
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
function focusTreeMultiNode(key) {
|
|
3329
|
+
liveState.treeFocusedKey = key;
|
|
3330
|
+
renderPopover();
|
|
3331
|
+
document.querySelector('[data-tree-key="' + CSS.escape(String(key)) + '"]')?.focus({ preventScroll: true });
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
function buildCascaderPopover(f) {
|
|
3335
|
+
const options = f.options || CASCADER_OPTIONS;
|
|
3336
|
+
const active = liveState.cascaderActivePath || [];
|
|
3337
|
+
const selected = f.value || [];
|
|
3338
|
+
const columns = [];
|
|
3339
|
+
let levelOpts = options;
|
|
3340
|
+
columns.push(levelOpts);
|
|
3341
|
+
for (let i = 0; i < active.length; i++) {
|
|
3342
|
+
const node = (levelOpts || []).find((n) => n.value === active[i]);
|
|
3343
|
+
if (!node || !node.children || !node.children.length) {
|
|
3344
|
+
break;
|
|
3345
|
+
}
|
|
3346
|
+
levelOpts = node.children;
|
|
3347
|
+
columns.push(levelOpts);
|
|
3348
|
+
}
|
|
3349
|
+
const menus = columns.map((opts, colIndex) => {
|
|
3350
|
+
const items = opts.map((opt) => {
|
|
3351
|
+
const hasChildren = opt.children && opt.children.length > 0;
|
|
3352
|
+
const isActive = active[colIndex] === opt.value;
|
|
3353
|
+
const isLeafSelected = !hasChildren &&
|
|
3354
|
+
selected.length === colIndex + 1 &&
|
|
3355
|
+
selected[colIndex] === opt.value;
|
|
3356
|
+
let trailing = '';
|
|
3357
|
+
if (hasChildren) {
|
|
3358
|
+
trailing = '<span class="cascader-item-expand" style="transform:rotate(-90deg);display:inline-flex">' +
|
|
3359
|
+
iconImg(ICON.arrowDown) + '</span>';
|
|
3360
|
+
} else if (isLeafSelected) {
|
|
3361
|
+
trailing = iconImg(ICON.check, 'check');
|
|
3362
|
+
}
|
|
3363
|
+
return '<li class="cascader-menu-item' +
|
|
3364
|
+
(isActive ? ' is-active' : '') +
|
|
3365
|
+
(selected[colIndex] === opt.value ? ' is-selected' : '') +
|
|
3366
|
+
'" data-cascader-col="' + colIndex + '" data-cascader-value="' + escapeAttr(opt.value) + '"' +
|
|
3367
|
+
(hasChildren ? ' data-cascader-branch="1"' : ' data-cascader-leaf="1"') + '>' +
|
|
3368
|
+
'<span>' + escapeAttr(opt.label) + '</span>' + trailing + '</li>';
|
|
3369
|
+
}).join('');
|
|
3370
|
+
return '<ul class="cascader-menu">' + items + '</ul>';
|
|
3371
|
+
}).join('');
|
|
3372
|
+
return '<div class="capsule-popover is-cascader"><div class="cascader-menus">' + menus + '</div></div>';
|
|
3373
|
+
}
|
|
3374
|
+
|
|
3375
|
+
function bindPopoverEvents() {
|
|
3376
|
+
const portal = document.getElementById('popover-portal');
|
|
3377
|
+
const id = liveState.openId;
|
|
3378
|
+
const f = liveState.fields[id];
|
|
3379
|
+
|
|
3380
|
+
portal.querySelectorAll('[data-opt]').forEach(li => {
|
|
3381
|
+
li.addEventListener('click', () => {
|
|
3382
|
+
f.value = li.dataset.opt;
|
|
3383
|
+
closePopover();
|
|
3384
|
+
});
|
|
3385
|
+
});
|
|
3386
|
+
|
|
3387
|
+
portal.querySelectorAll('[data-label-key]').forEach((li) => {
|
|
3388
|
+
li.addEventListener('click', () => {
|
|
3389
|
+
f.labelKey = li.dataset.labelKey;
|
|
3390
|
+
f.label = li.dataset.labelKey;
|
|
3391
|
+
closePopover();
|
|
3392
|
+
});
|
|
3393
|
+
});
|
|
3394
|
+
|
|
3395
|
+
portal.querySelectorAll('[data-multi]').forEach(li => {
|
|
3396
|
+
li.addEventListener('click', (e) => {
|
|
3397
|
+
e.preventDefault();
|
|
3398
|
+
e.stopPropagation();
|
|
3399
|
+
const v = li.dataset.multi;
|
|
3400
|
+
const idx = f.value.indexOf(v);
|
|
3401
|
+
if (idx >= 0) {
|
|
3402
|
+
f.value.splice(idx, 1);
|
|
3403
|
+
} else {
|
|
3404
|
+
f.value.push(v);
|
|
3405
|
+
}
|
|
3406
|
+
// Keep panel open for continuous multi-pick; refresh tags + checklist only
|
|
3407
|
+
refreshLiveFieldPopover();
|
|
3408
|
+
});
|
|
3409
|
+
});
|
|
3410
|
+
|
|
3411
|
+
portal.querySelectorAll('[data-tree-toggle]').forEach((button) => {
|
|
3412
|
+
button.addEventListener('click', (e) => {
|
|
3413
|
+
e.stopPropagation();
|
|
3414
|
+
liveState.treeFocusedKey = button.dataset.treeToggle;
|
|
3415
|
+
toggleTreeExpanded(button.dataset.treeToggle);
|
|
3416
|
+
focusTreeMultiNode(button.dataset.treeToggle);
|
|
3417
|
+
});
|
|
3418
|
+
});
|
|
3419
|
+
|
|
3420
|
+
portal.querySelectorAll('[data-tree-check]').forEach((checkbox) => {
|
|
3421
|
+
checkbox.addEventListener('change', (e) => {
|
|
3422
|
+
e.stopPropagation();
|
|
3423
|
+
liveState.treeFocusedKey = checkbox.dataset.treeCheck;
|
|
3424
|
+
toggleTreeMultiCheck(f, checkbox.dataset.treeCheck);
|
|
3425
|
+
refreshLiveFieldPopover();
|
|
3426
|
+
requestAnimationFrame(() => {
|
|
3427
|
+
document.querySelector('[data-tree-key="' + CSS.escape(String(liveState.treeFocusedKey)) + '"]')
|
|
3428
|
+
?.focus({ preventScroll: true });
|
|
3429
|
+
});
|
|
3430
|
+
});
|
|
3431
|
+
});
|
|
3432
|
+
|
|
3433
|
+
portal.querySelectorAll('[data-tree-content]').forEach((button) => {
|
|
3434
|
+
button.addEventListener('click', (e) => {
|
|
3435
|
+
e.stopPropagation();
|
|
3436
|
+
const key = button.dataset.treeContent;
|
|
3437
|
+
const node = findTreeNode(f.treeData, key);
|
|
3438
|
+
if (!node || node.disabled) return;
|
|
3439
|
+
liveState.treeFocusedKey = key;
|
|
3440
|
+
if (node.children && node.children.length) toggleTreeExpanded(key);
|
|
3441
|
+
focusTreeMultiNode(key);
|
|
3442
|
+
});
|
|
3443
|
+
});
|
|
3444
|
+
|
|
3445
|
+
portal.querySelectorAll('[data-tree-key]').forEach((item) => {
|
|
3446
|
+
item.addEventListener('focus', () => {
|
|
3447
|
+
liveState.treeFocusedKey = item.dataset.treeKey;
|
|
3448
|
+
});
|
|
3449
|
+
item.addEventListener('keydown', (e) => {
|
|
3450
|
+
const key = item.dataset.treeKey;
|
|
3451
|
+
const node = findTreeNode(f.treeData, key);
|
|
3452
|
+
if (!node || node.disabled) return;
|
|
3453
|
+
const visible = visibleTreeItems(f.treeData || [], liveState.treeExpandedKeys, 0, [], [])
|
|
3454
|
+
.filter((entry) => !entry.node.disabled);
|
|
3455
|
+
const index = visible.findIndex((entry) => entry.node.key === key);
|
|
3456
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {
|
|
3457
|
+
e.preventDefault();
|
|
3458
|
+
const nextIndex = Math.max(0, Math.min(visible.length - 1, index + (e.key === 'ArrowDown' ? 1 : -1)));
|
|
3459
|
+
focusTreeMultiNode(visible[nextIndex].node.key);
|
|
3460
|
+
} else if (e.key === 'ArrowRight') {
|
|
3461
|
+
e.preventDefault();
|
|
3462
|
+
if (node.children && node.children.length && !liveState.treeExpandedKeys.has(key)) {
|
|
3463
|
+
toggleTreeExpanded(key);
|
|
3464
|
+
focusTreeMultiNode(key);
|
|
3465
|
+
} else if (node.children && node.children.length) {
|
|
3466
|
+
focusTreeMultiNode(node.children.find((child) => !child.disabled)?.key || key);
|
|
3467
|
+
}
|
|
3468
|
+
} else if (e.key === 'ArrowLeft') {
|
|
3469
|
+
e.preventDefault();
|
|
3470
|
+
if (liveState.treeExpandedKeys.has(key)) {
|
|
3471
|
+
toggleTreeExpanded(key);
|
|
3472
|
+
focusTreeMultiNode(key);
|
|
3473
|
+
} else {
|
|
3474
|
+
const parent = treeParentOf(f.treeData, key);
|
|
3475
|
+
if (parent) focusTreeMultiNode(parent.key);
|
|
3476
|
+
}
|
|
3477
|
+
} else if (e.key === ' ') {
|
|
3478
|
+
e.preventDefault();
|
|
3479
|
+
toggleTreeMultiCheck(f, key);
|
|
3480
|
+
refreshLiveFieldPopover();
|
|
3481
|
+
} else if (e.key === 'Enter') {
|
|
3482
|
+
e.preventDefault();
|
|
3483
|
+
if (node.children && node.children.length) toggleTreeExpanded(key);
|
|
3484
|
+
focusTreeMultiNode(key);
|
|
3485
|
+
}
|
|
3486
|
+
});
|
|
3487
|
+
});
|
|
3488
|
+
|
|
3489
|
+
portal.querySelectorAll('[data-cal-nav]').forEach(btn => {
|
|
3490
|
+
btn.addEventListener('click', () => {
|
|
3491
|
+
const delta = Number(btn.dataset.calNav);
|
|
3492
|
+
liveState.calMonth += delta;
|
|
3493
|
+
if (liveState.calMonth > 11) { liveState.calMonth = 0; liveState.calYear++; }
|
|
3494
|
+
if (liveState.calMonth < 0) { liveState.calMonth = 11; liveState.calYear--; }
|
|
3495
|
+
renderPopover();
|
|
3496
|
+
});
|
|
3497
|
+
});
|
|
3498
|
+
|
|
3499
|
+
portal.querySelectorAll('[data-day]').forEach(span => {
|
|
3500
|
+
span.addEventListener('mouseenter', () => {
|
|
3501
|
+
if (f.type !== 'date-range' || liveState.rangePickStep !== 1 || !f.value[0] || f.value[1]) {
|
|
3502
|
+
return;
|
|
3503
|
+
}
|
|
3504
|
+
const date = startOfDay(new Date(Number(span.dataset.y), Number(span.dataset.m), Number(span.dataset.day)));
|
|
3505
|
+
liveState.rangeHover = date;
|
|
3506
|
+
applyRangeHoverPreview(portal, f.value[0], date);
|
|
3507
|
+
});
|
|
3508
|
+
span.addEventListener('click', () => {
|
|
3509
|
+
const y = Number(span.dataset.y);
|
|
3510
|
+
const m = Number(span.dataset.m);
|
|
3511
|
+
const d = Number(span.dataset.day);
|
|
3512
|
+
const date = startOfDay(new Date(y, m, d));
|
|
3513
|
+
if (disabledDate(date)) {
|
|
3514
|
+
return;
|
|
3515
|
+
}
|
|
3516
|
+
if (f.type === 'date') {
|
|
3517
|
+
f.value = fmtDate(date);
|
|
3518
|
+
closePopover();
|
|
3519
|
+
} else if (f.type === 'date-range') {
|
|
3520
|
+
if (liveState.rangePickStep === 0 || !f.value[0] || f.value[1]) {
|
|
3521
|
+
f.value = [date, null];
|
|
3522
|
+
liveState.rangePickStep = 1;
|
|
3523
|
+
liveState.rangeHover = null;
|
|
3524
|
+
refreshLiveFieldPopover();
|
|
3525
|
+
} else {
|
|
3526
|
+
let s = startOfDay(f.value[0]);
|
|
3527
|
+
if (date.getTime() < s.getTime()) {
|
|
3528
|
+
f.value = [date, s];
|
|
3529
|
+
} else {
|
|
3530
|
+
f.value = [s, date];
|
|
3531
|
+
}
|
|
3532
|
+
liveState.rangePickStep = 0;
|
|
3533
|
+
liveState.rangeHover = null;
|
|
3534
|
+
closePopover();
|
|
3535
|
+
}
|
|
3536
|
+
}
|
|
3537
|
+
});
|
|
3538
|
+
});
|
|
3539
|
+
|
|
3540
|
+
if (f.type === 'date-range') {
|
|
3541
|
+
portal.querySelector('.capsule-popover')?.addEventListener('mouseleave', () => {
|
|
3542
|
+
liveState.rangeHover = null;
|
|
3543
|
+
clearRangeHoverPreview(portal);
|
|
3544
|
+
});
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
portal.querySelector('[data-today]')?.addEventListener('click', () => {
|
|
3548
|
+
const today = startOfDay(new Date());
|
|
3549
|
+
if (disabledDate(today)) {
|
|
3550
|
+
return;
|
|
3551
|
+
}
|
|
3552
|
+
f.value = fmtDate(today);
|
|
3553
|
+
closePopover();
|
|
3554
|
+
});
|
|
3555
|
+
|
|
3556
|
+
portal.querySelectorAll('[data-cascader-value]').forEach((li) => {
|
|
3557
|
+
li.addEventListener('click', (e) => {
|
|
3558
|
+
e.stopPropagation();
|
|
3559
|
+
const col = Number(li.dataset.cascaderCol);
|
|
3560
|
+
const val = li.dataset.cascaderValue;
|
|
3561
|
+
const next = (liveState.cascaderActivePath || []).slice(0, col);
|
|
3562
|
+
next[col] = val;
|
|
3563
|
+
liveState.cascaderActivePath = next;
|
|
3564
|
+
if (li.hasAttribute('data-cascader-leaf')) {
|
|
3565
|
+
f.value = next.slice();
|
|
3566
|
+
closePopover();
|
|
3567
|
+
return;
|
|
3568
|
+
}
|
|
3569
|
+
renderPopover();
|
|
3570
|
+
});
|
|
3571
|
+
});
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
document.getElementById('live-query').addEventListener('click', () => {
|
|
3575
|
+
const params = {};
|
|
3576
|
+
LIVE_IDS.forEach((key) => {
|
|
3577
|
+
const f = liveState.fields[key];
|
|
3578
|
+
if (f.type === 'date-range') {
|
|
3579
|
+
params[key] = { start: f.value[0] ? fmtDate(f.value[0]) : null, end: f.value[1] ? fmtDate(f.value[1]) : null };
|
|
3580
|
+
} else if (f.type === 'input-key-select') {
|
|
3581
|
+
params[key] = { key: f.labelKey, value: f.value };
|
|
3582
|
+
} else if (f.type === 'cascader') {
|
|
3583
|
+
params[key] = {
|
|
3584
|
+
value: f.value.slice(),
|
|
3585
|
+
label: cascaderDisplayText(f.value, f.options) || null
|
|
3586
|
+
};
|
|
3587
|
+
} else {
|
|
3588
|
+
params[key] = f.value;
|
|
3589
|
+
}
|
|
3590
|
+
});
|
|
3591
|
+
|
|
3592
|
+
let rows = MOCK_DEVICES.slice();
|
|
3593
|
+
const name = liveState.fields.name.value.trim();
|
|
3594
|
+
if (name) {
|
|
3595
|
+
rows = rows.filter((r) => r.name.includes(name));
|
|
3596
|
+
}
|
|
3597
|
+
const searchKeyField = liveState.fields['search-key'];
|
|
3598
|
+
const searchQ = searchKeyField.value.trim();
|
|
3599
|
+
if (searchQ) {
|
|
3600
|
+
const keyMap = {
|
|
3601
|
+
'设备名称': 'name',
|
|
3602
|
+
'设备ID': 'id',
|
|
3603
|
+
'PID': 'pid',
|
|
3604
|
+
'设备SN': 'sn'
|
|
3605
|
+
};
|
|
3606
|
+
const prop = keyMap[searchKeyField.labelKey] || 'name';
|
|
3607
|
+
rows = rows.filter((r) => String(r[prop] || '').includes(searchQ));
|
|
3608
|
+
}
|
|
3609
|
+
const proto = liveState.fields.protocol.value;
|
|
3610
|
+
if (proto) rows = rows.filter(r => r.protocol === proto);
|
|
3611
|
+
const spaces = liveState.fields.space.value;
|
|
3612
|
+
if (spaces.length) rows = rows.filter(r => spaces.some(s => r.spaces.includes(s)));
|
|
3613
|
+
|
|
3614
|
+
document.getElementById('live-result').hidden = false;
|
|
3615
|
+
document.getElementById('live-result-json').textContent = JSON.stringify(params, null, 2);
|
|
3616
|
+
document.getElementById('live-result-rows').innerHTML = rows.length
|
|
3617
|
+
? rows.map(r => '<tr><td>' + r.name + '</td><td>' + r.protocol + '</td><td>' + r.spaces.join('、') + '</td><td>' + r.status + '</td></tr>').join('')
|
|
3618
|
+
: '<tr><td colspan="4" style="color:var(--color-text-tertiary);text-align:center">无匹配设备</td></tr>';
|
|
3619
|
+
});
|
|
3620
|
+
|
|
3621
|
+
document.getElementById('live-reset').addEventListener('click', () => {
|
|
3622
|
+
LIVE_IDS.forEach((id) => {
|
|
3623
|
+
resetFieldValue(liveState.fields[id]);
|
|
3624
|
+
});
|
|
3625
|
+
if (liveState.openId && LIVE_IDS.indexOf(liveState.openId) >= 0) {
|
|
3626
|
+
liveState.openId = null;
|
|
3627
|
+
liveState.openMode = null;
|
|
3628
|
+
liveState.cascaderActivePath = [];
|
|
3629
|
+
document.getElementById('popover-portal').classList.remove('is-open');
|
|
3630
|
+
document.getElementById('popover-portal').innerHTML = '';
|
|
3631
|
+
}
|
|
3632
|
+
document.getElementById('live-result').hidden = true;
|
|
3633
|
+
renderLiveFields();
|
|
3634
|
+
});
|
|
3635
|
+
|
|
3636
|
+
document.addEventListener('click', (e) => {
|
|
3637
|
+
if (!liveState.openId) {
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
const f = liveState.fields[liveState.openId];
|
|
3641
|
+
if (f.type === 'input' || (f.type === 'input-key-select' && liveState.openMode === 'input')) {
|
|
3642
|
+
if (e.target.closest('[data-field-id="' + liveState.openId + '"]') || e.target.closest('[data-input-id]')) {
|
|
3643
|
+
return;
|
|
3644
|
+
}
|
|
3645
|
+
closePopover();
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
// Multi-select stays open until Esc / outside / field toggle; option clicks stopPropagation
|
|
3649
|
+
if (e.target.closest('#popover-portal')) {
|
|
3650
|
+
return;
|
|
3651
|
+
}
|
|
3652
|
+
if (e.target.closest('.filter-field.is-live[data-field-id="' + liveState.openId + '"]')) {
|
|
3653
|
+
return;
|
|
3654
|
+
}
|
|
3655
|
+
if (e.target.closest('.filter-field.is-live')) {
|
|
3656
|
+
return;
|
|
3657
|
+
}
|
|
3658
|
+
closePopover();
|
|
3659
|
+
});
|
|
3660
|
+
|
|
3661
|
+
document.addEventListener('mousedown', (e) => {
|
|
3662
|
+
if (!liveState.openId) {
|
|
3663
|
+
return;
|
|
3664
|
+
}
|
|
3665
|
+
if (e.target.closest('#popover-portal') || e.target.closest('.filter-field.is-live')) {
|
|
3666
|
+
return;
|
|
3667
|
+
}
|
|
3668
|
+
// Close on outside mousedown so multi-select re-renders can't race with click bubble
|
|
3669
|
+
const f = liveState.fields[liveState.openId];
|
|
3670
|
+
if (f && (f.type === 'input' || (f.type === 'input-key-select' && liveState.openMode === 'input'))) {
|
|
3671
|
+
return;
|
|
3672
|
+
}
|
|
3673
|
+
closePopover();
|
|
3674
|
+
});
|
|
3675
|
+
|
|
3676
|
+
// Keep multi-select option clicks from bubbling to document after DOM refresh
|
|
3677
|
+
document.getElementById('popover-portal').addEventListener('mousedown', (e) => e.stopPropagation());
|
|
3678
|
+
document.getElementById('popover-portal').addEventListener('click', (e) => e.stopPropagation());
|
|
3679
|
+
|
|
3680
|
+
document.addEventListener('keydown', (e) => {
|
|
3681
|
+
if (e.key === 'Escape' && liveState.openId) closePopover();
|
|
3682
|
+
});
|
|
3683
|
+
|
|
3684
|
+
window.addEventListener('scroll', () => { if (liveState.openId) positionPopover(); }, true);
|
|
3685
|
+
window.addEventListener('resize', () => { if (liveState.openId) positionPopover(); });
|
|
3686
|
+
|
|
3687
|
+
if (!window.__liveToolbarWrapResizeBound) {
|
|
3688
|
+
window.__liveToolbarWrapResizeBound = true;
|
|
3689
|
+
let liveWrapTimer = null;
|
|
3690
|
+
window.addEventListener('resize', () => {
|
|
3691
|
+
clearTimeout(liveWrapTimer);
|
|
3692
|
+
liveWrapTimer = setTimeout(() => {
|
|
3693
|
+
syncToolbarWrap(document.getElementById('live-toolbar'));
|
|
3694
|
+
syncContextToolbarsWrap();
|
|
3695
|
+
}, 100);
|
|
3696
|
+
});
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
renderContextScenarios();
|
|
3700
|
+
bindLiveFieldEvents();
|
|
3701
|
+
renderLiveFields();
|
|
3702
|
+
|
|
3703
|
+
</script>
|
|
3704
|
+
</body>
|
|
3705
|
+
</html>
|