web3dlink 2.1.5 → 2.1.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/dist/web3dlink.js CHANGED
@@ -2298,6 +2298,9 @@ var validator$7 = {
2298
2298
  return this.commandManager.sendWithDefault(i, n);
2299
2299
  }
2300
2300
  }, hasValue$1 = (e) => e != null;
2301
+ function assertMaxNotLessThanMin(e, t, n, r, i) {
2302
+ hasValue$1(t) && hasValue$1(n) && t < n && e.push(`[${r}]不能小于[${i}]`);
2303
+ }
2301
2304
  function create$1(e) {
2302
2305
  let t = [], n = { ...e };
2303
2306
  return t.push(...validateRequiredNumber({
@@ -2338,7 +2341,7 @@ function create$1(e) {
2338
2341
  field: "maxTerrain",
2339
2342
  value: e.maxTerrain,
2340
2343
  required: !0
2341
- })), hasValue$1(e.xMin) && hasValue$1(e.xMax) && e.xMax <= e.xMin && t.push("[xMax]必须大于[xMin]"), hasValue$1(e.yMin) && hasValue$1(e.yMax) && e.yMax <= e.yMin && t.push("[yMax]必须大于[yMin]"), hasValue$1(e.minTerrain) && hasValue$1(e.maxTerrain) && e.maxTerrain <= e.minTerrain && t.push("[maxTerrain]必须大于[minTerrain]"), t.push(...validateRequiredString({
2344
+ })), assertMaxNotLessThanMin(t, e.xMax, e.xMin, "xMax", "xMin"), assertMaxNotLessThanMin(t, e.yMax, e.yMin, "yMax", "yMin"), assertMaxNotLessThanMin(t, e.maxTerrain, e.minTerrain, "maxTerrain", "minTerrain"), t.push(...validateRequiredString({
2342
2345
  normalized: n,
2343
2346
  field: "mapUrl",
2344
2347
  value: e.mapUrl
@@ -2383,7 +2386,7 @@ function waterFlow(e) {
2383
2386
  field: "maxV",
2384
2387
  value: e.maxV,
2385
2388
  required: !0
2386
- })), hasValue$1(e.minWater) && hasValue$1(e.maxWater) && e.maxWater <= e.minWater && t.push("[maxWater]必须大于[minWater]"), hasValue$1(e.minU) && hasValue$1(e.maxU) && e.maxU <= e.minU && t.push("[maxU]必须大于[minU]"), hasValue$1(e.minV) && hasValue$1(e.maxV) && e.maxV <= e.minV && t.push("[maxV]必须大于[minV]"), t.push(...validateRequiredString({
2389
+ })), assertMaxNotLessThanMin(t, e.maxWater, e.minWater, "maxWater", "minWater"), assertMaxNotLessThanMin(t, e.maxU, e.minU, "maxU", "minU"), assertMaxNotLessThanMin(t, e.maxV, e.minV, "maxV", "minV"), t.push(...validateRequiredString({
2387
2390
  normalized: n,
2388
2391
  field: "waterFlowUrl",
2389
2392
  value: e.waterFlowUrl
@@ -2408,7 +2411,7 @@ function waterDepth(e) {
2408
2411
  field: "maxWater",
2409
2412
  value: e.maxWater,
2410
2413
  required: !0
2411
- })), hasValue$1(e.minWater) && hasValue$1(e.maxWater) && e.maxWater <= e.minWater && t.push("[maxWater]必须大于[minWater]"), e.rangeList === void 0 || e.rangeList === null ? t.push("[rangeList]为必填项") : Array.isArray(e.rangeList) ? e.rangeList.length === 0 ? t.push("[rangeList]不能为空数组") : e.rangeList.forEach((e, n) => {
2414
+ })), assertMaxNotLessThanMin(t, e.maxWater, e.minWater, "maxWater", "minWater"), e.rangeList === void 0 || e.rangeList === null ? t.push("[rangeList]为必填项") : Array.isArray(e.rangeList) ? e.rangeList.length === 0 ? t.push("[rangeList]不能为空数组") : e.rangeList.forEach((e, n) => {
2412
2415
  if (typeof e != "object" || !e) {
2413
2416
  t.push(`[rangeList[${n}]]必须是对象类型`);
2414
2417
  return;
@@ -2436,6 +2439,31 @@ function waterDepth(e) {
2436
2439
  normalized: n
2437
2440
  };
2438
2441
  }
2442
+ function sediment(e) {
2443
+ let t = [], n = { ...e };
2444
+ return t.push(...validateRequiredString({
2445
+ normalized: n,
2446
+ field: "key",
2447
+ value: e.key
2448
+ })), t.push(...validateRequiredString({
2449
+ normalized: n,
2450
+ field: "sedimentTexUrl",
2451
+ value: e.sedimentTexUrl
2452
+ })), t.push(...validateRequiredNumber({
2453
+ normalized: n,
2454
+ field: "minWater",
2455
+ value: e.minWater,
2456
+ required: !0
2457
+ })), t.push(...validateRequiredNumber({
2458
+ normalized: n,
2459
+ field: "maxWater",
2460
+ value: e.maxWater,
2461
+ required: !0
2462
+ })), assertMaxNotLessThanMin(t, e.maxWater, e.minWater, "maxWater", "minWater"), {
2463
+ errors: t,
2464
+ normalized: n
2465
+ };
2466
+ }
2439
2467
  function close$1(e) {
2440
2468
  let t = [], n = { ...e };
2441
2469
  return t.push(...validateRequiredString({
@@ -2453,6 +2481,7 @@ var validator$6 = {
2453
2481
  create: create$1,
2454
2482
  waterFlow,
2455
2483
  waterDepth,
2484
+ sediment,
2456
2485
  close: close$1
2457
2486
  }, HydrodynamicForceApi = class {
2458
2487
  constructor(e) {
@@ -3140,6 +3169,28 @@ function getInfo(e = {}) {
3140
3169
  normalized: n
3141
3170
  };
3142
3171
  }
3172
+ function getFieldRange(e = {}) {
3173
+ let t = [], n = { ...e };
3174
+ return t.push(...validateRequiredString({
3175
+ normalized: n,
3176
+ field: "id",
3177
+ value: e.id
3178
+ })), t.push(...validateRequiredString({
3179
+ normalized: n,
3180
+ field: "fieldName",
3181
+ value: e.fieldName
3182
+ })), t.push(...validateOptionalArray({
3183
+ normalized: n,
3184
+ field: "indexList",
3185
+ value: e.indexList,
3186
+ defaultValue: []
3187
+ })), Array.isArray(n.indexList) && (n.indexList.forEach((e, n) => {
3188
+ Number.isFinite(Number(e)) || t.push(`[indexList[${n}]]必须是数字`);
3189
+ }), n.indexList = n.indexList.map(Number)), {
3190
+ errors: t,
3191
+ normalized: n
3192
+ };
3193
+ }
3143
3194
  function create(e = {}) {
3144
3195
  let t = [], n = { ...e };
3145
3196
  return t.push(...validateRequiredString({
@@ -3350,6 +3401,7 @@ function offMouseClick(e = {}) {
3350
3401
  //#region ../api/vtk/vtkApi.js
3351
3402
  var validator = {
3352
3403
  getInfo,
3404
+ getFieldRange,
3353
3405
  create,
3354
3406
  close,
3355
3407
  allClose,