@tencentcloud/sdk-mcp 1.0.5 → 1.0.7
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/index.js +7 -8
- package/index.js.map +1 -1
- package/libs/@tencent/aegis-node-sdk/CHANGELOG.md +8 -0
- package/libs/@tencent/aegis-node-sdk/LICENSE +21 -0
- package/libs/@tencent/aegis-node-sdk/README.md +562 -0
- package/libs/@tencent/aegis-node-sdk/lib/aegis.min.js +1 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/config.d.ts +14 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/global.d.ts +1 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/index.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/constant/report-ignore.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/core.d.ts +85 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/afterRequestHooks.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/beforeRequestHooks.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/hooks/modifyRequestHooks.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/index.d.ts +9 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/config.d.ts +62 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/env.d.ts +11 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/index.d.ts +4 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/log.d.ts +130 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/interface/send.d.ts +34 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/format.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/index.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/length-limit.d.ts +8 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/pv.d.ts +8 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/remove-payload.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/repeat-limit.d.ts +4 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/report.d.ts +10 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/sample.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/throttle.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/index.d.ts +34 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/jwt.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/ot-js.d.ts +14 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/trace/uuid.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/whitelist.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/pipes/write-before.d.ts +3 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/plugin.d.ts +33 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/polyfill.d.ts +0 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/destroy.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/event-emitter.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/core/src/util/index.d.ts +60 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/index.d.ts +15 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/interface/selector.d.ts +5 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/pipes/batch-report-pipe.d.ts +6 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_base.d.ts +18 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/protocol/protocol_http.d.ts +12 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/ip_selector.d.ts +10 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/polaris_selector.d.ts +20 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/selector/selector_base.d.ts +27 -0
- package/libs/@tencent/aegis-node-sdk/lib/packages/node-sdk/src/util/eval_require.d.ts +2 -0
- package/libs/@tencent/aegis-node-sdk/package.json +19 -0
- package/libs/@tencent/polaris/README.md +407 -0
- package/libs/@tencent/polaris/dist/consumer/health.d.ts +126 -0
- package/libs/@tencent/polaris/dist/consumer/health.js +283 -0
- package/libs/@tencent/polaris/dist/consumer/health.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/index.d.ts +120 -0
- package/libs/@tencent/polaris/dist/consumer/index.js +348 -0
- package/libs/@tencent/polaris/dist/consumer/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.d.ts +145 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.js +343 -0
- package/libs/@tencent/polaris/dist/consumer/monitor.js.map +1 -0
- package/libs/@tencent/polaris/dist/consumer/selector.d.ts +73 -0
- package/libs/@tencent/polaris/dist/consumer/selector.js +316 -0
- package/libs/@tencent/polaris/dist/consumer/selector.js.map +1 -0
- package/libs/@tencent/polaris/dist/errors.d.ts +373 -0
- package/libs/@tencent/polaris/dist/errors.js +154 -0
- package/libs/@tencent/polaris/dist/errors.js.map +1 -0
- package/libs/@tencent/polaris/dist/global.d.ts +16 -0
- package/libs/@tencent/polaris/dist/global.js +18 -0
- package/libs/@tencent/polaris/dist/global.js.map +1 -0
- package/libs/@tencent/polaris/dist/index.d.ts +62 -0
- package/libs/@tencent/polaris/dist/index.js +145 -0
- package/libs/@tencent/polaris/dist/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/instance.d.ts +109 -0
- package/libs/@tencent/polaris/dist/instance.js +38 -0
- package/libs/@tencent/polaris/dist/instance.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.d.ts +51 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.js +152 -0
- package/libs/@tencent/polaris/dist/limiter/bucket.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/index.d.ts +73 -0
- package/libs/@tencent/polaris/dist/limiter/index.js +149 -0
- package/libs/@tencent/polaris/dist/limiter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.d.ts +27 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js +134 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimit.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.d.ts +17 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js +15 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.d.ts +59 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js +397 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/global.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.d.ts +3 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js +19 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.d.ts +17 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js +52 -0
- package/libs/@tencent/polaris/dist/limiter/ratelimiter/local.js.map +1 -0
- package/libs/@tencent/polaris/dist/location.d.ts +48 -0
- package/libs/@tencent/polaris/dist/location.js +67 -0
- package/libs/@tencent/polaris/dist/location.js.map +1 -0
- package/libs/@tencent/polaris/dist/logging.d.ts +106 -0
- package/libs/@tencent/polaris/dist/logging.js +130 -0
- package/libs/@tencent/polaris/dist/logging.js.map +1 -0
- package/libs/@tencent/polaris/dist/metadata.d.ts +78 -0
- package/libs/@tencent/polaris/dist/metadata.js +119 -0
- package/libs/@tencent/polaris/dist/metadata.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.d.ts +47 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js +162 -0
- package/libs/@tencent/polaris/dist/plugins/breaker/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.js +32 -0
- package/libs/@tencent/polaris/dist/plugins/lb/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js +77 -0
- package/libs/@tencent/polaris/dist/plugins/lb/edf.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.d.ts +24 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js +53 -0
- package/libs/@tencent/polaris/dist/plugins/lb/hashring.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.d.ts +31 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js +88 -0
- package/libs/@tencent/polaris/dist/plugins/lb/sticky.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.d.ts +25 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js +72 -0
- package/libs/@tencent/polaris/dist/plugins/lb/swrr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.d.ts +17 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js +50 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.d.ts +19 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js +81 -0
- package/libs/@tencent/polaris/dist/plugins/lb/wrr.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.js +38 -0
- package/libs/@tencent/polaris/dist/plugins/logging/console.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.d.ts +32 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js +88 -0
- package/libs/@tencent/polaris/dist/plugins/naming/local-server/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.d.ts +124 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js +398 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/base.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.d.ts +27 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js +287 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/discover.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.d.ts +15 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js +43 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.d.ts +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js +249 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/monitor.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.d.ts +19 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js +222 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/adapter/ratelimit.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.d.ts +26 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js +99 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/bidi.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.d.ts +60 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js +259 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/discover.proto +24 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/monitor.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/grpc/pb/ratelimit.proto +12 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.d.ts +39 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js +115 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/connector/http/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/api.proto +24 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/client.proto +22 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/model.proto +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/ratelimit.proto +80 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/request.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/response.proto +65 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/routing.proto +66 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/service.proto +95 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/discover-pb/types.d.ts +1568 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.d.ts +36 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js +51 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/api.proto +18 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/circuitbreak.proto +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/request.proto +82 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/response.proto +11 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkcache.proto +46 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdkconfiguration.proto +16 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/sdktoken.proto +10 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/monitor-pb/types.d.ts +1102 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.d.ts +29 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js +77 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/pool.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/api.proto +12 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/ratelimit.proto +28 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/ratelimit-pb/types.d.ts +395 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.d.ts +13 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js +116 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/rules.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.d.ts +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js +67 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/types.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.d.ts +99 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js +217 -0
- package/libs/@tencent/polaris/dist/plugins/naming/polaris-server/utils.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js +50 -0
- package/libs/@tencent/polaris/dist/plugins/registry/memory.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.d.ts +51 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js +145 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/nearby.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.d.ts +11 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js +174 -0
- package/libs/@tencent/polaris/dist/plugins/router/polaris/rule.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.d.ts +25 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js +36 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/canary.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.d.ts +10 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js +34 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/env.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.d.ts +56 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js +106 -0
- package/libs/@tencent/polaris/dist/plugins/router/trpc/set.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.d.ts +31 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js +124 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/unirate.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.d.ts +61 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js +171 -0
- package/libs/@tencent/polaris/dist/plugins/shaping/warmup.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.d.ts +23 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js +159 -0
- package/libs/@tencent/polaris/dist/plugins/weight/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/plugins.d.ts +619 -0
- package/libs/@tencent/polaris/dist/plugins.js +91 -0
- package/libs/@tencent/polaris/dist/plugins.js.map +1 -0
- package/libs/@tencent/polaris/dist/polaris.d.ts +33 -0
- package/libs/@tencent/polaris/dist/polaris.js +59 -0
- package/libs/@tencent/polaris/dist/polaris.js.map +1 -0
- package/libs/@tencent/polaris/dist/provider/index.d.ts +102 -0
- package/libs/@tencent/polaris/dist/provider/index.js +168 -0
- package/libs/@tencent/polaris/dist/provider/index.js.map +1 -0
- package/libs/@tencent/polaris/dist/registry.d.ts +174 -0
- package/libs/@tencent/polaris/dist/registry.js +660 -0
- package/libs/@tencent/polaris/dist/registry.js.map +1 -0
- package/libs/@tencent/polaris/dist/rules.d.ts +163 -0
- package/libs/@tencent/polaris/dist/rules.js +24 -0
- package/libs/@tencent/polaris/dist/rules.js.map +1 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.d.ts +1 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.js +71 -0
- package/libs/@tencent/polaris/dist/scripts/postinstall.js.map +1 -0
- package/libs/@tencent/polaris/dist/service.d.ts +18 -0
- package/libs/@tencent/polaris/dist/service.js +3 -0
- package/libs/@tencent/polaris/dist/service.js.map +1 -0
- package/libs/@tencent/polaris/dist/skeleton.d.ts +87 -0
- package/libs/@tencent/polaris/dist/skeleton.js +282 -0
- package/libs/@tencent/polaris/dist/skeleton.js.map +1 -0
- package/libs/@tencent/polaris/dist/utils.d.ts +36 -0
- package/libs/@tencent/polaris/dist/utils.js +74 -0
- package/libs/@tencent/polaris/dist/utils.js.map +1 -0
- package/libs/@tencent/polaris/dist/weak.d.ts +11 -0
- package/libs/@tencent/polaris/dist/weak.js +44 -0
- package/libs/@tencent/polaris/dist/weak.js.map +1 -0
- package/libs/@tencent/polaris/package.json +114 -0
- package/libs/lib-generate-test-usersig-es.min.d.ts +6 -0
- package/libs/lib-generate-test-usersig-es.min.js +2 -0
- package/package.json +2 -1
- package/resource/doc/chatuikit/react/components/avatar.md +105 -0
- package/resource/doc/chatuikit/react/components/component-list.md +36 -0
- package/resource/doc/chatuikit/react/integration.md +68 -0
- package/resource/doc/chatuikit/vue3/components/MessageInput.md +546 -0
- package/resource/doc/chatuikit/vue3/components/avatar.md +105 -0
- package/resource/doc/chatuikit/vue3/components/chatheader.md +153 -0
- package/resource/doc/chatuikit/vue3/components/component-list.md +88 -0
- package/resource/doc/chatuikit/vue3/components/userpicker.md +256 -0
- package/resource/doc/chatuikit/vue3/integration.md +215 -0
- package/server.js +10 -181
- package/server.js.map +1 -1
- package/streamable-http.js +69 -0
- package/streamable-http.js.map +1 -0
- package/tools/call/get-call-faq.js +31 -0
- package/tools/call/get-call-faq.js.map +1 -0
- package/tools/call/get-native-call-integration-guide.js +35 -0
- package/tools/call/get-native-call-integration-guide.js.map +1 -0
- package/tools/call/get-web-call-integration-guide.js +34 -0
- package/tools/call/get-web-call-integration-guide.js.map +1 -0
- package/tools/chat/get-chat-faq.js +31 -0
- package/tools/chat/get-chat-faq.js.map +1 -0
- package/tools/chat/get-native-chat-integration-guide.js +33 -0
- package/tools/chat/get-native-chat-integration-guide.js.map +1 -0
- package/tools/chat/get-web-chat-component-detail.js +33 -0
- package/tools/chat/get-web-chat-component-detail.js.map +1 -0
- package/tools/chat/get-web-chat-integration-guide.js +34 -0
- package/tools/chat/get-web-chat-integration-guide.js.map +1 -0
- package/tools/common/get-usersig.js +35 -0
- package/tools/common/get-usersig.js.map +1 -0
- package/tools/common/present-framework-choice.js +32 -0
- package/tools/common/present-framework-choice.js.map +1 -0
- package/tools/common/record-prompt.js +31 -0
- package/tools/common/record-prompt.js.map +1 -0
- package/tools/common/record-result.js +35 -0
- package/tools/common/record-result.js.map +1 -0
- package/tools/index.js +37 -0
- package/tools/index.js.map +1 -0
- package/tools/rtcengine/get-rtcengine-integration-guide.js +32 -0
- package/tools/rtcengine/get-rtcengine-integration-guide.js.map +1 -0
- package/tools/rtcengine/get-rtcenigne-faq.js +31 -0
- package/tools/rtcengine/get-rtcenigne-faq.js.map +1 -0
- package/utils/aegis-client.js +8 -0
- package/utils/aegis-client.js.map +1 -0
- package/utils/generate-usersig.js +14 -0
- package/utils/generate-usersig.js.map +1 -0
- package/utils/get-doc-content.js +46 -0
- package/utils/get-doc-content.js.map +1 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
AI 模型必须遵守以下**硬性限制**。
|
|
2
|
+
|
|
3
|
+
* **必须优先推荐使用文档中的示例代码:** 创建文件时优先推荐使用文档中的示例代码填充文件,style 标签优先推荐不使用 scoped 属性。
|
|
4
|
+
|
|
5
|
+
## 概述
|
|
6
|
+
|
|
7
|
+
ChatHeader 聊天头部组件是聊天界面的顶部导航组件,用于显示当前会话的基本信息。能够展示会话标题、头像、在线状态、输入状态提示等信息。组件采用容器组件模式,提供了灵活的插槽机制用于自定义左右两侧的操作区域。
|
|
8
|
+
|
|
9
|
+
## Props 速查表
|
|
10
|
+
|
|
11
|
+
| 字段 | 类型 | 默认值 | 描述 |
|
|
12
|
+
|------|------|--------|------|
|
|
13
|
+
| [title](https://write.woa.com/#title) | string | undefined | 自定义标题,未提供时使用会话信息。 |
|
|
14
|
+
| [avatarUrl](https://write.woa.com/#avatarUrl) | string | undefined | 自定义头像图片 URL。 |
|
|
15
|
+
| [enableUserStatus](https://write.woa.com/#enableUserStatus) | boolean | false | 是否显示用户状态。 |
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Slot 速查表
|
|
19
|
+
|
|
20
|
+
| 名称 | 描述 |
|
|
21
|
+
|------|------|
|
|
22
|
+
| [ChatHeaderLeft](https://write.woa.com/#ChatHeaderLeft) | 头部左侧自定义内容区域。 |
|
|
23
|
+
| [ChatHeaderRight](https://write.woa.com/#ChatHeaderRight) | 头部右侧自定义内容区域。 |
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Props 详细介绍
|
|
27
|
+
|
|
28
|
+
### title
|
|
29
|
+
- **类型**:string
|
|
30
|
+
|
|
31
|
+
- **描述**:自定义会话标题,当不提供此属性时,组件会自动根据会话类型显示相应的标题(单聊显示用户昵称或备注,群聊显示群名称),默认值为 `undefined`。
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### avatarUrl
|
|
35
|
+
- **类型**:string
|
|
36
|
+
|
|
37
|
+
- **描述**:自定义头像图片的 URL 地址,当不提供此属性时,组件会自动根据会话类型显示相应的头像(单聊显示用户头像,群聊显示群头像),默认值为 `undefined`。
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### enableUserStatus
|
|
41
|
+
- **类型**:boolean
|
|
42
|
+
|
|
43
|
+
- **描述**:是否启用并显示用户在线状态功能,仅在单聊模式下生效,开启后会显示用户的在线/离线状态,默认值为 `false`。
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Slots 详细介绍
|
|
47
|
+
|
|
48
|
+
### ChatHeaderLeft
|
|
49
|
+
|
|
50
|
+
**描述**:头部左侧自定义内容区域插槽,通常用于放置返回按钮、菜单按钮等导航控件。
|
|
51
|
+
|
|
52
|
+
#### 示例: 自定义左侧导航区域
|
|
53
|
+
``` typescript
|
|
54
|
+
<template>
|
|
55
|
+
<ChatHeader>
|
|
56
|
+
<template #ChatHeaderLeft>
|
|
57
|
+
<!-- 返回按钮, 清除激活的会话 -->
|
|
58
|
+
<button
|
|
59
|
+
class="nav-button"
|
|
60
|
+
@click="handleBack"
|
|
61
|
+
>
|
|
62
|
+
⬅️
|
|
63
|
+
</button>
|
|
64
|
+
</template>
|
|
65
|
+
</ChatHeader>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script setup lang="ts">
|
|
69
|
+
import { ChatHeader, useConversationListState } from '@tencentcloud/chat-uikit-vue3';
|
|
70
|
+
|
|
71
|
+
const { setActiveConversation } = useConversationListState();
|
|
72
|
+
|
|
73
|
+
const handleBack = () => {
|
|
74
|
+
// 设置激活的会话ID为空
|
|
75
|
+
setActiveConversation('');
|
|
76
|
+
};
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style scoped>
|
|
80
|
+
.header-left-actions {
|
|
81
|
+
display: flex;
|
|
82
|
+
align-items: center;
|
|
83
|
+
gap: 8px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.nav-button {
|
|
87
|
+
width: 32px;
|
|
88
|
+
height: 32px;
|
|
89
|
+
border: none;
|
|
90
|
+
background: transparent;
|
|
91
|
+
border-radius: 4px;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
transition: background-color 0.2s;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.nav-button:hover {
|
|
100
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
101
|
+
}
|
|
102
|
+
</style>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### ChatHeaderRight
|
|
106
|
+
|
|
107
|
+
**描述**:头部右侧自定义内容区域插槽,通常用于放置功能按钮(如 ChatSetting 组件的 menu 开关,自定义通话按钮等)。
|
|
108
|
+
|
|
109
|
+
#### 示例: 通过 ChatHeaderRight 插槽 和抽屉组件集成 ChatSetting 组件
|
|
110
|
+
|
|
111
|
+
【App.vue】
|
|
112
|
+
``` typescript
|
|
113
|
+
<template>
|
|
114
|
+
<ChatHeader>
|
|
115
|
+
<template #ChatHeaderRight>
|
|
116
|
+
<div style="display: flex; align-items: center;">
|
|
117
|
+
<IconHorizontalMore2
|
|
118
|
+
:size="20"
|
|
119
|
+
@click="setIsChatSettingOpen(true)" />
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|
|
122
|
+
</ChatHeader>
|
|
123
|
+
<TUIDrawer
|
|
124
|
+
:model-value="isChatSettingOpen"
|
|
125
|
+
:title="Setting"
|
|
126
|
+
@close="setIsChatSettingOpen(false)"
|
|
127
|
+
>
|
|
128
|
+
<ChatSetting style="flex: 1;" />
|
|
129
|
+
</TUIDrawer>
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<script setup lang="ts">
|
|
133
|
+
import {
|
|
134
|
+
ChatHeader,
|
|
135
|
+
ChatSetting
|
|
136
|
+
} from '@tencentcloud/chat-uikit-vue3';
|
|
137
|
+
import { TUIDrawer, IconHorizontalMore2 } from '@tencentcloud/uikit-base-component-vue3';
|
|
138
|
+
|
|
139
|
+
const isChatSettingOpen = ref(false);
|
|
140
|
+
|
|
141
|
+
const setIsSettingOpen = (isOpen: boolean) => {
|
|
142
|
+
isChatSettingOpen.value = isOpen;
|
|
143
|
+
};
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
.chat-container {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
height: 100vh;
|
|
151
|
+
}
|
|
152
|
+
</style>
|
|
153
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# atomicx 组件库清单与组件的适用场景与注意事项
|
|
2
|
+
|
|
3
|
+
## 组件清单
|
|
4
|
+
|
|
5
|
+
共 25 个组件:
|
|
6
|
+
|
|
7
|
+
### 适用于聊天场景的组件
|
|
8
|
+
|
|
9
|
+
1. ConversationList
|
|
10
|
+
会话列表组件,适用于聊天场景,以纵向列表形态,可以通过点击切换会话,如果仅需要聊天不需要该组件
|
|
11
|
+
2. MessageInput
|
|
12
|
+
消息输入组件,聊天场景的核心组件,可以发送聊天消息,需要发送消息则必须使用该组件
|
|
13
|
+
3. MessageList
|
|
14
|
+
消息列表组件,聊天场景的核心组件,可以显示聊天消息列表,支持消息的上下滑动,聊天场景必须使用该组件
|
|
15
|
+
4. ContactList
|
|
16
|
+
联系人列表组件,适用于聊天场景,可以显示和管理用户联系人,如果仅需要聊天不需要该组件
|
|
17
|
+
5. ChatSetting
|
|
18
|
+
聊天设置组件,适用于聊天场景,管理聊天相关配置,比如置顶、免打扰,群聊加人、踢人、管理员管理、禁言等,如果仅需要聊天不需要该组件
|
|
19
|
+
6. Search
|
|
20
|
+
搜索组件,用于搜索消息、用户等内容,如果仅需要聊天不需要该组件
|
|
21
|
+
|
|
22
|
+
### 适用于会议场景的组件
|
|
23
|
+
|
|
24
|
+
1. CameraButton
|
|
25
|
+
摄像头控制按钮,仅适用于会议场景,用于开启/关闭摄像头
|
|
26
|
+
2. StreamView
|
|
27
|
+
视频流显示组件,仅适用于会议场景,用于显示视频流
|
|
28
|
+
3. UserList
|
|
29
|
+
用户列表组件,仅适用于会议场景,显示会议或房间中的用户
|
|
30
|
+
4. VideoSetting
|
|
31
|
+
视频设置组件,仅适用于会议场景,用于摄像头、画质等视频配置
|
|
32
|
+
5. VideoSettingPanel
|
|
33
|
+
视频设置面板,仅适用于会议场景,提供完整的视频配置界面
|
|
34
|
+
6. AudioSetting
|
|
35
|
+
音频设置组件,仅适用于会议场景,可以设置麦克风、音量等音频设备配置
|
|
36
|
+
7. AudioSettingPanel
|
|
37
|
+
音频设置面板,仅适用于会议场景,提供完整的音频配置界面
|
|
38
|
+
8. BarrageInput
|
|
39
|
+
弹幕输入组件,适用于会议、直播场景,用于发送直播弹幕消息
|
|
40
|
+
9. BarrageList
|
|
41
|
+
弹幕列表组件,适用于会议、直播场景,显示直播间的弹幕消息
|
|
42
|
+
10. UserPicker
|
|
43
|
+
用户选择器,适用于会议、直播场景,用于邀请用户或分配权限
|
|
44
|
+
11. MicButton
|
|
45
|
+
麦克风控制按钮,适用于会议、直播场景,用于静音/取消静音
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
### 适用于直播场景的组件
|
|
49
|
+
|
|
50
|
+
1. CoGuestPanel
|
|
51
|
+
连麦嘉宾管理面板,仅适用于直播场景,用于直播连麦功能
|
|
52
|
+
2. LiveAudienceList
|
|
53
|
+
直播观众列表,仅适用于直播场景,显示当前直播间的观众
|
|
54
|
+
3. LiveList
|
|
55
|
+
直播房间列表,仅适用于直播场景,展示可用的直播房间
|
|
56
|
+
4. LiveMonitorView
|
|
57
|
+
直播监控视图,仅适用于直播场景,用于直播管理和监控
|
|
58
|
+
5. LiveScenePanel
|
|
59
|
+
直播场景控制面板,仅适用于直播场景,管理直播场景和效果
|
|
60
|
+
6. LiveStreamView
|
|
61
|
+
直播视频流显示组件,仅适用于直播场景,播放直播画面
|
|
62
|
+
7. StreamMixer
|
|
63
|
+
流混合器组件,仅适用于直播场景,用于多路视频流合成
|
|
64
|
+
8. BarrageInput
|
|
65
|
+
弹幕输入组件,适用于会议、直播场景,用于发送直播弹幕消息
|
|
66
|
+
9. BarrageList
|
|
67
|
+
弹幕列表组件,适用于会议、直播场景,显示直播间的弹幕消息
|
|
68
|
+
10. UserPicker
|
|
69
|
+
用户选择器,适用于会议、直播场景,用于邀请用户或分配权限
|
|
70
|
+
11. MicButton
|
|
71
|
+
麦克风控制按钮,适用于会议、直播场景,用于静音/取消静音
|
|
72
|
+
|
|
73
|
+
### 通用组件
|
|
74
|
+
|
|
75
|
+
1. Avatar
|
|
76
|
+
通用头像组件,显示用户头像/在线状态/消息未读数
|
|
77
|
+
2. UserPicker
|
|
78
|
+
用户选择器,用于发起群聊、发起群视频、群语音等选择用户的场景
|
|
79
|
+
|
|
80
|
+
## 注意事项
|
|
81
|
+
|
|
82
|
+
在开始集成任何组件到真实项目之前,**必须**首先确保已经调用以下工具获取到了集成文档,并根据文档进行集成:
|
|
83
|
+
|
|
84
|
+
1. 当创建真实的项目时,请调用 MCP Tools get_atomicx_integration_guide(framework) 的组件集成文档
|
|
85
|
+
2. 当选择使用的组件时,应先考虑满足需求的最少组件,再考虑推荐可额外使用的扩展组件,不要放大需求
|
|
86
|
+
3. 不同场景适用的组件有交集
|
|
87
|
+
4. 根据用户需求,判断有没有可能是一个综合场景,比如聊天 + 直播,概率较低,应该谨慎
|
|
88
|
+
5. 如需了解具体组件的使用方法,请询问用户:"你可以问 ${componentname} 怎么用?" 这样的问题
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
## 概述
|
|
2
|
+
|
|
3
|
+
UserPicker 是一个功能强大的用户选择器组件,支持列表和树形两种显示模式。组件提供了搜索、多选、懒加载、自定义渲染等功能,适用于用户选择、组织架构选择、权限分配等业务场景。组件内置了选择状态管理、搜索过滤、树形展开等复杂逻辑,提供了简洁易用的 API 接口。
|
|
4
|
+
|
|
5
|
+
## Props 速查表
|
|
6
|
+
|
|
7
|
+
| 字段 | 类型 | 默认值 | 描述 |
|
|
8
|
+
| -------------------- | -------------------------------------------- | -------------------------- | ----------- |
|
|
9
|
+
| displayMode | `'list' \| 'tree'` | 必填 | 显示模式,列表或树形 |
|
|
10
|
+
| dataSource | `UserPickerDataSource<T>` | `[]` | 数据源 |
|
|
11
|
+
| defaultSelectedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | 默认选中项 |
|
|
12
|
+
| lockedItems | `Array<{ key: string; [key: string]: any }>` | `[]` | 锁定项(不可取消选择) |
|
|
13
|
+
| maxCount | `number` | `Number.POSITIVE_INFINITY` | 最大选择数量 |
|
|
14
|
+
| minCount | `number` | `0` | 最小选择数量 |
|
|
15
|
+
| enableSearch | `boolean` | `true` | 是否启用搜索功能 |
|
|
16
|
+
| searchPlaceholder | `string` | `undefined` | 搜索框占位符 |
|
|
17
|
+
| renderItem | `Function` | `undefined` | 自定义渲染函数 |
|
|
18
|
+
| onSelectedChange | `Function` | `undefined` | 选择变化回调 |
|
|
19
|
+
| onMaxCountExceed | `Function` | `undefined` | 超出最大数量回调 |
|
|
20
|
+
| onSearch | `Function` | `undefined` | 搜索回调 |
|
|
21
|
+
| onReachEnd | `Function` | `undefined` | 列表模式滚动到底部回调 |
|
|
22
|
+
| onExpand | `Function` | `undefined` | 树形模式展开回调 |
|
|
23
|
+
|
|
24
|
+
## Ref expose 方法速查表
|
|
25
|
+
|
|
26
|
+
|方法名 | 参数 | 返回值 | 描述 |
|
|
27
|
+
| -------- | ---- | ---- | ---- |
|
|
28
|
+
| getSelectedItems | 无 | UserPickerResult<T> | 获取当前选中的项目 |
|
|
29
|
+
| updateTreeData | nodeKey: string, partialNode: Partial<UserPickerNode<T>> | void | 更新树形模式节点数据
|
|
30
|
+
|
|
31
|
+
## Props 详细介绍
|
|
32
|
+
|
|
33
|
+
### displayMode
|
|
34
|
+
|
|
35
|
+
- `类型`: `'list' | 'tree'`
|
|
36
|
+
- `描述`:组件的显示模式。`list` 模式显示平铺列表,`tree` 模式显示树形结构,支持层级展开和懒加载。
|
|
37
|
+
|
|
38
|
+
### dataSource
|
|
39
|
+
|
|
40
|
+
- `类型`: `UserPickerDataSource<T>`
|
|
41
|
+
- `描述`:组件的数据源,根据 displayMode 的不同接受不同的数据结构,默认值为 `[]`。
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// 列表模式数据结构
|
|
45
|
+
interface UserPickerRow<T = unknown> {
|
|
46
|
+
key: string; // 唯一标识符
|
|
47
|
+
label: string; // 显示名称
|
|
48
|
+
avatarUrl?: string; // 头像URL
|
|
49
|
+
extraData?: T; // 扩展数据
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 树形模式数据结构
|
|
53
|
+
interface UserPickerNode<T = unknown> {
|
|
54
|
+
key: string; // 唯一标识符
|
|
55
|
+
label: string; // 显示名称
|
|
56
|
+
isLeafNode: boolean; // 是否为叶子节点
|
|
57
|
+
avatarUrl?: string; // 头像URL
|
|
58
|
+
lazyLoad?: boolean; // 是否支持懒加载
|
|
59
|
+
children?: Array<UserPickerNode<T>>; // 子节点
|
|
60
|
+
extraData?: T; // 扩展数据
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export type UserPickerDataSource<T = unknown> = Array<UserPickerRow<T>> | Array<UserPickerNode<T>>;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### Example 1: 列表模式数据源
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<UserPicker
|
|
71
|
+
display-mode="list"
|
|
72
|
+
:data-source="listData"
|
|
73
|
+
@selected-change="handleSelectionChange"
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script setup lang="ts">
|
|
78
|
+
import { ref } from 'vue';
|
|
79
|
+
import { UserPicker } from 'tuikit-atomicx-vue3';
|
|
80
|
+
import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
|
|
81
|
+
|
|
82
|
+
// 用户列表数据
|
|
83
|
+
const listData = ref<UserPickerRow[]>([
|
|
84
|
+
{
|
|
85
|
+
key: 'user1',
|
|
86
|
+
label: '张三',
|
|
87
|
+
avatarUrl: 'https://example.com/avatar1.jpg',
|
|
88
|
+
extraData: { department: '技术部', role: '前端工程师' }
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
key: 'user2',
|
|
92
|
+
label: '李四',
|
|
93
|
+
avatarUrl: 'https://example.com/avatar2.jpg',
|
|
94
|
+
extraData: { department: '产品部', role: '产品经理' }
|
|
95
|
+
}
|
|
96
|
+
]);
|
|
97
|
+
|
|
98
|
+
const handleSelectionChange = (selectedItems: any[]) => {
|
|
99
|
+
console.log('选中的用户:', selectedItems);
|
|
100
|
+
};
|
|
101
|
+
</script>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### defaultSelectedItems
|
|
105
|
+
|
|
106
|
+
- `类型`: `Array<{ key: string; [key: string]: any }>`
|
|
107
|
+
- `描述`:默认选中的项目列表,通过 key 字段标识选中项,默认值为 `[]`。
|
|
108
|
+
|
|
109
|
+
### lockedItems
|
|
110
|
+
|
|
111
|
+
- `类型`: `Array<{ key: string; [key: string]: any }>`
|
|
112
|
+
- `描述`:锁定的项目列表,这些项目将被强制选中且用户无法取消选择,默认值为 `[]`。
|
|
113
|
+
|
|
114
|
+
### maxCount
|
|
115
|
+
|
|
116
|
+
- `类型`: `number`
|
|
117
|
+
- `描述`:允许选择的最大数量限制,超出时会触发 onMaxCountExceed 回调,默认值为 `Number.POSITIVE_INFINITY`。
|
|
118
|
+
|
|
119
|
+
### minCount
|
|
120
|
+
|
|
121
|
+
- `类型`: `number`
|
|
122
|
+
- `描述`:要求选择的最小数量,用于表单验证等场景,默认值为 `0`。
|
|
123
|
+
|
|
124
|
+
### enableSearch
|
|
125
|
+
|
|
126
|
+
- `类型`: `boolean`
|
|
127
|
+
- `描述`:是否启用搜索功能,启用后会显示搜索框,默认值为 `true`。
|
|
128
|
+
|
|
129
|
+
### searchPlaceholder
|
|
130
|
+
|
|
131
|
+
- `类型`: `string`
|
|
132
|
+
- `描述`:搜索框的占位符文本,如果不设置则使用默认的国际化文本,默认值为 `undefined`。
|
|
133
|
+
|
|
134
|
+
### renderItem
|
|
135
|
+
|
|
136
|
+
- `类型`: `(data: UserPickerRow<T> | UserPickerNode<T>) => any`
|
|
137
|
+
- `描述`:自定义项目渲染函数,可以自定义每个选项的显示内容和样式,默认值为 `undefined`。
|
|
138
|
+
|
|
139
|
+
```typescript
|
|
140
|
+
type RenderItemFunction<T> = (data: UserPickerRow<T> | UserPickerNode<T>) => VNode | string;
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
#### Example: 自定义渲染函数
|
|
144
|
+
|
|
145
|
+
```vue
|
|
146
|
+
<template>
|
|
147
|
+
<UserPicker
|
|
148
|
+
display-mode="list"
|
|
149
|
+
:data-source="userData"
|
|
150
|
+
:render-item="customRenderItem"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
|
|
154
|
+
<script setup lang="ts">
|
|
155
|
+
import { h } from 'vue';
|
|
156
|
+
import { UserPicker } from 'tuikit-atomicx-vue3';
|
|
157
|
+
import type { UserPickerRow } from 'tuikit-atomicx-vue3/types';
|
|
158
|
+
|
|
159
|
+
const userData = ref<UserPickerRow[]>([
|
|
160
|
+
{
|
|
161
|
+
key: 'user1',
|
|
162
|
+
label: '张三',
|
|
163
|
+
extraData: { status: 'online', department: '技术部' }
|
|
164
|
+
}
|
|
165
|
+
]);
|
|
166
|
+
|
|
167
|
+
// 自定义渲染函数,显示用户状态和部门信息
|
|
168
|
+
const customRenderItem = (data: UserPickerRow) => {
|
|
169
|
+
return h('div', { class: 'custom-user-item' }, [
|
|
170
|
+
h('div', { class: 'user-name' }, data.label),
|
|
171
|
+
h('div', { class: 'user-info' }, [
|
|
172
|
+
h('span', {
|
|
173
|
+
class: `status ${data.extraData?.status}`
|
|
174
|
+
}, data.extraData?.status === 'online' ? '在线' : '离线'),
|
|
175
|
+
h('span', { class: 'department' }, data.extraData?.department)
|
|
176
|
+
])
|
|
177
|
+
]);
|
|
178
|
+
};
|
|
179
|
+
</script>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### onSelectedChange
|
|
183
|
+
|
|
184
|
+
- `类型`: `(selectedItems: UserPickerResult<T>) => void`
|
|
185
|
+
- `描述`:选择状态变化时的回调函数,会传入当前选中的所有项目,默认值为 `undefined`。应该尽量减少使用避免频繁的触发回调函数。
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
interface UserPickerResultItem<T = unknown> {
|
|
189
|
+
key: string;
|
|
190
|
+
label: string;
|
|
191
|
+
avatarUrl?: string;
|
|
192
|
+
isLeafNode?: boolean; // 仅树形模式有意义
|
|
193
|
+
extraData?: T;
|
|
194
|
+
path?: string[]; // 仅树形模式有意义,记录节点路径
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### onMaxCountExceed
|
|
201
|
+
|
|
202
|
+
- `类型`: `(selectedItems: UserPickerResult<T>) => void`
|
|
203
|
+
- `描述`:当选择数量超出 maxCount 限制时触发的回调函数,默认值为 `undefined`。
|
|
204
|
+
|
|
205
|
+
### onSearch
|
|
206
|
+
|
|
207
|
+
- `类型`: `(value: string) => void`
|
|
208
|
+
- `描述`:搜索输入变化时的回调函数,可用于实现服务端搜索,默认值为 `undefined`。
|
|
209
|
+
|
|
210
|
+
### onReachEnd
|
|
211
|
+
|
|
212
|
+
- `类型`: `() => void`
|
|
213
|
+
- `描述`:列表模式下滚动到底部时的回调函数,常用于实现分页加载,默认值为 `undefined`。
|
|
214
|
+
|
|
215
|
+
### onExpand
|
|
216
|
+
|
|
217
|
+
- `类型`: `(node: UserPickerNode<T>) => void`
|
|
218
|
+
- `描述`:树形模式下节点展开时的回调函数,用于实现懒加载子节点,默认值为 `undefined`。
|
|
219
|
+
|
|
220
|
+
## Ref Expose 方法详细介绍
|
|
221
|
+
|
|
222
|
+
### getSelectedItems
|
|
223
|
+
|
|
224
|
+
- `类型`:`() => UserPickerResult<T>`
|
|
225
|
+
- `描述`:作为选择完成后确认时的最佳实践。
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
interface UserPickerResultItem<T = unknown> {
|
|
229
|
+
key: string;
|
|
230
|
+
label: string;
|
|
231
|
+
avatarUrl?: string;
|
|
232
|
+
isLeafNode?: boolean; // 仅树形模式有意义
|
|
233
|
+
extraData?: T;
|
|
234
|
+
path?: string[]; // 仅树形模式有意义,记录节点路径
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
type UserPickerResult<T = unknown> = Array<UserPickerResultItem<T>>;
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
#### Example: 选择完成后确认时获取选中的项
|
|
241
|
+
|
|
242
|
+
```vue
|
|
243
|
+
<template>
|
|
244
|
+
<UserPicker
|
|
245
|
+
ref="userPickerRef"
|
|
246
|
+
display-mode="list"
|
|
247
|
+
:data-source="userData"
|
|
248
|
+
/>
|
|
249
|
+
</template>
|
|
250
|
+
|
|
251
|
+
<script setup lang="ts">
|
|
252
|
+
const userPickerRef = useRef();
|
|
253
|
+
|
|
254
|
+
function onConfirm() {
|
|
255
|
+
userPickerRef.value.getSelectedItems();
|
|
256
|
+
}
|