@vunk/form 1.1.28 → 1.1.30

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.
@@ -1,4 +1,4 @@
1
- import { openBlock, createElementBlock, createElementVNode, defineComponent, resolveComponent, createBlock, withCtx, createVNode, createCommentVNode, provide, renderSlot, shallowRef, computed, ref, watch, onMounted, nextTick, mergeProps, toHandlers, withDirectives, vShow } from 'vue';
1
+ import { openBlock, createElementBlock, createElementVNode, defineComponent, resolveComponent, createBlock, withCtx, createVNode, createCommentVNode, provide, renderSlot, ref, shallowRef, computed, watch, onMounted, nextTick, mergeProps, toHandlers, withDirectives, vShow } from 'vue';
2
2
  import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
3
3
  import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
4
4
  import { ElButton, ElIcon, ElButtonGroup, ElUpload, ElMessage } from 'element-plus';
@@ -128,7 +128,9 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
128
128
  bindPropsFactory(props);
129
129
  const emits = __spreadProps(__spreadValues({}, _VkfInputCtx.emits), {
130
130
  "update:modelValue": (e) => e,
131
- "update:flying": null
131
+ "update:flying": null,
132
+ "appendFly": null,
133
+ appendEdit: null
132
134
  });
133
135
  onEmitsFactory(emits);
134
136
 
@@ -335,8 +337,8 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
335
337
  }, 8, ["on-change", "disabled", "onClick"])) : createCommentVNode("v-if", true),
336
338
  _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
337
339
  key: 1,
338
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit")),
339
- disabled: _ctx.disabled
340
+ disabled: _ctx.disabled,
341
+ onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
340
342
  }, {
341
343
  default: withCtx(() => [
342
344
  createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
@@ -374,7 +376,8 @@ const _sfc_main$1 = defineComponent({
374
376
  },
375
377
  props: {
376
378
  view: {
377
- type: Object
379
+ type: Object,
380
+ default: void 0
378
381
  }
379
382
  },
380
383
  setup(props) {
@@ -1341,14 +1344,15 @@ var _sfc_main = defineComponent({
1341
1344
  DocumentChecked: document_checked_default,
1342
1345
  VaGraphicsLayer
1343
1346
  },
1344
- emits,
1345
1347
  props,
1348
+ emits,
1346
1349
  setup(props2, {
1347
1350
  emit
1348
1351
  }) {
1349
1352
  const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
1350
1353
  const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
1351
1354
  const readonly = useComputedReadonly(props2);
1355
+ const sketchIf = ref(!props2.view);
1352
1356
  const sketchRef = shallowRef();
1353
1357
  const shetchPanel = computed(() => {
1354
1358
  var _a;
@@ -1381,7 +1385,6 @@ var _sfc_main = defineComponent({
1381
1385
  if (sketchValueUpdating.value)
1382
1386
  return;
1383
1387
  uSketchValue();
1384
- console.log("watch", v, ov);
1385
1388
  if (!(ov == null ? void 0 : ov.features.length)) {
1386
1389
  fly();
1387
1390
  }
@@ -1414,14 +1417,23 @@ var _sfc_main = defineComponent({
1414
1417
  type: "success"
1415
1418
  });
1416
1419
  dialogShow.value = false;
1420
+ if (props2.view) {
1421
+ sketchIf.value = false;
1422
+ }
1417
1423
  };
1418
1424
  const append = () => createVNode(AppendVue, {
1419
- "dialog": props2.dialogEdit,
1425
+ "dialog": !readonly.value && props2.dialogEdit,
1420
1426
  "upload": !readonly.value,
1421
1427
  "disabled": props2.disabled,
1422
1428
  "onUpload": onUpload,
1423
1429
  "onEdit": onEdit,
1424
- "onFly": fly
1430
+ "onFly": () => {
1431
+ if (!props2.showMap && !props2.view) {
1432
+ dialogShow.value = true;
1433
+ }
1434
+ emit("appendFly");
1435
+ fly();
1436
+ }
1425
1437
  }, null);
1426
1438
  async function onUpload(e) {
1427
1439
  if (!e.raw)
@@ -1433,7 +1445,12 @@ var _sfc_main = defineComponent({
1433
1445
  }).then(fly);
1434
1446
  }
1435
1447
  function onEdit() {
1436
- dialogShow.value = true;
1448
+ if (!props2.view) {
1449
+ dialogShow.value = true;
1450
+ } else {
1451
+ sketchIf.value = true;
1452
+ }
1453
+ emit("appendEdit");
1437
1454
  }
1438
1455
  function u() {
1439
1456
  sketchValueUpdating.value = true;
@@ -1471,7 +1488,6 @@ var _sfc_main = defineComponent({
1471
1488
  });
1472
1489
  async function fly() {
1473
1490
  const view = await viewDef.promise;
1474
- console.log("fly", view);
1475
1491
  if (!view)
1476
1492
  return;
1477
1493
  emit("update:flying", true);
@@ -1498,15 +1514,16 @@ var _sfc_main = defineComponent({
1498
1514
  mapTo,
1499
1515
  doSave,
1500
1516
  readonly,
1501
- layerLoad
1517
+ layerLoad,
1518
+ sketchIf
1502
1519
  };
1503
1520
  }
1504
1521
  });
1505
1522
 
1506
1523
  const _hoisted_1 = { class: "vkf-form-item" };
1507
1524
  const _hoisted_2 = {
1508
- class: "vkf-esri-input-geojson__map",
1509
- ref: "normalMapRef"
1525
+ ref: "normalMapRef",
1526
+ class: "vkf-esri-input-geojson__map"
1510
1527
  };
1511
1528
  const _hoisted_3 = {
1512
1529
  ref: "dialogMapRef",
@@ -1526,17 +1543,17 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1526
1543
  return (openBlock(), createElementBlock("div", _hoisted_1, [
1527
1544
  createVNode(_component_VkfInput, mergeProps({
1528
1545
  readonly: true,
1529
- modelValue: JSON.stringify(_ctx.modelValue)
1530
- }, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
1531
- inputSlots: {
1546
+ "model-value": JSON.stringify(_ctx.modelValue)
1547
+ }, _ctx.inputBindProps, {
1548
+ "input-slots": {
1532
1549
  append: _ctx.append
1533
1550
  }
1534
- }), null, 16 /* FULL_PROPS */, ["modelValue", "inputSlots"]),
1551
+ }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"]),
1535
1552
  createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
1536
1553
  default: withCtx(() => [
1537
1554
  createVNode(_component_ViewerVue, { view: _ctx.view }, {
1538
1555
  default: withCtx(() => [
1539
- (_ctx.readonly)
1556
+ (_ctx.readonly || !_ctx.sketchIf)
1540
1557
  ? (openBlock(), createBlock(_component_VaGraphicsLayer, {
1541
1558
  key: 0,
1542
1559
  graphics: _ctx.sketchValue,
@@ -1544,12 +1561,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1544
1561
  }, null, 8 /* PROPS */, ["graphics", "onLoad"]))
1545
1562
  : (openBlock(), createBlock(_component_VaSketch, {
1546
1563
  key: 1,
1547
- viewModelActiveFillSymbol: _ctx.viewModelActiveFillSymbol,
1548
- viewModelActiveLineSymbol: _ctx.viewModelActiveLineSymbol,
1549
- viewModelActivePointSymbol: _ctx.viewModelActivePointSymbol,
1564
+ "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1565
+ "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1566
+ "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1550
1567
  multiple: _ctx.multiple,
1551
- availableCreatureTools: _ctx.availableCreatureTools,
1552
- modelValue: _ctx.sketchValue,
1568
+ "available-creature-tools": _ctx.availableCreatureTools,
1569
+ "model-value": _ctx.sketchValue,
1553
1570
  "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1554
1571
  onLoad: _ctx.sketchLoad
1555
1572
  }, {
@@ -1575,7 +1592,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1575
1592
  : createCommentVNode("v-if", true)
1576
1593
  ]),
1577
1594
  _: 1 /* STABLE */
1578
- }, 8 /* PROPS */, ["viewModelActiveFillSymbol", "viewModelActiveLineSymbol", "viewModelActivePointSymbol", "multiple", "availableCreatureTools", "modelValue", "onUpdate:modelValue", "onLoad"]))
1595
+ }, 8 /* PROPS */, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "onUpdate:modelValue", "onLoad"]))
1579
1596
  ]),
1580
1597
  _: 1 /* STABLE */
1581
1598
  }, 8 /* PROPS */, ["view"])
@@ -1590,12 +1607,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1590
1607
  "onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((_ctx.dialogShow) = $event)),
1591
1608
  title: _ctx.dialogEditTitle,
1592
1609
  fullscreen: _ctx.dialogEditFullscreen,
1593
- modalClass: "vkf-esri-input-geojson-dialog",
1594
- appendToBody: true,
1610
+ "modal-class": "vkf-esri-input-geojson-dialog",
1611
+ "append-to-body": true,
1612
+ "close-on-click-modal": false,
1613
+ draggable: true,
1595
1614
  onOpen: _ctx.dialogOnOpen,
1596
- onClose: _ctx.dialogOnClose,
1597
- closeOnClickModal: false,
1598
- draggable: true
1615
+ onClose: _ctx.dialogOnClose
1599
1616
  }, {
1600
1617
  default: withCtx(() => [
1601
1618
  createElementVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */)
@@ -193,6 +193,11 @@ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObj
193
193
  export declare const emits: {
194
194
  'update:modelValue': (e: FeatureCollection) => FeatureCollection<Geometry, import("geojson").GeoJsonProperties>;
195
195
  'update:flying': null;
196
+ /**
197
+ * 点击地图定位按钮
198
+ */
199
+ appendFly: null;
200
+ appendEdit: null;
196
201
  input: (value: string) => boolean;
197
202
  change: (value: string) => boolean;
198
203
  focus: (evt: FocusEvent) => boolean;
@@ -205,9 +210,11 @@ export declare const emits: {
205
210
  compositionupdate: (evt: CompositionEvent) => boolean;
206
211
  compositionend: (evt: CompositionEvent) => boolean;
207
212
  };
208
- export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("update:modelValue" | "input" | "change" | "focus" | "blur" | "clear" | "mouseleave" | "mouseenter" | "keydown" | "compositionstart" | "compositionupdate" | "compositionend" | "update:flying")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"update:modelValue", KE> | Exclude<"input", KE> | Exclude<"change", KE> | Exclude<"focus", KE> | Exclude<"blur", KE> | Exclude<"clear", KE> | Exclude<"mouseleave", KE> | Exclude<"mouseenter", KE> | Exclude<"keydown", KE> | Exclude<"compositionstart", KE> | Exclude<"compositionupdate", KE> | Exclude<"compositionend", KE> | Exclude<"update:flying", KE> : "update:modelValue" | "input" | "change" | "focus" | "blur" | "clear" | "mouseleave" | "mouseenter" | "keydown" | "compositionstart" | "compositionupdate" | "compositionend" | "update:flying"]: {
213
+ export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("update:modelValue" | "input" | "change" | "focus" | "blur" | "clear" | "mouseleave" | "mouseenter" | "keydown" | "compositionstart" | "compositionupdate" | "compositionend" | "update:flying" | "appendFly" | "appendEdit")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"update:modelValue", KE> | Exclude<"input", KE> | Exclude<"change", KE> | Exclude<"focus", KE> | Exclude<"blur", KE> | Exclude<"clear", KE> | Exclude<"mouseleave", KE> | Exclude<"mouseenter", KE> | Exclude<"keydown", KE> | Exclude<"compositionstart", KE> | Exclude<"compositionupdate", KE> | Exclude<"compositionend", KE> | Exclude<"update:flying", KE> | Exclude<"appendFly", KE> | Exclude<"appendEdit", KE> : "update:modelValue" | "input" | "change" | "focus" | "blur" | "clear" | "mouseleave" | "mouseenter" | "keydown" | "compositionstart" | "compositionupdate" | "compositionend" | "update:flying" | "appendFly" | "appendEdit"]: {
209
214
  'update:modelValue': (...e: import("@vunk/core").RestParameters<T2>) => void;
210
215
  'update:flying': (...e: import("@vunk/core").RestParameters<T2>) => void;
216
+ appendFly: (...e: import("@vunk/core").RestParameters<T2>) => void;
217
+ appendEdit: (...e: import("@vunk/core").RestParameters<T2>) => void;
211
218
  input: (...e: import("@vunk/core").RestParameters<T2>) => void;
212
219
  change: (...e: import("@vunk/core").RestParameters<T2>) => void;
213
220
  focus: (...e: import("@vunk/core").RestParameters<T2>) => void;
@@ -113,7 +113,9 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
113
113
  const createBindProps = bindPropsFactory(props);
114
114
  const emits = __spreadProps(__spreadValues({}, _VkfInputCtx.emits), {
115
115
  "update:modelValue": (e) => e,
116
- "update:flying": null
116
+ "update:flying": null,
117
+ "appendFly": null,
118
+ appendEdit: null
117
119
  });
118
120
  const createOnEmits = onEmitsFactory(emits);
119
121
 
@@ -258,9 +258,12 @@ declare const _default: import("vue").DefineComponent<{
258
258
  doSave: () => void;
259
259
  readonly: import("vue").ComputedRef<boolean>;
260
260
  layerLoad: __VaGraphicsLayer.OnLoad;
261
+ sketchIf: Ref<boolean>;
261
262
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
262
263
  'update:modelValue': (e: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>) => import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
263
264
  'update:flying': null;
265
+ appendFly: null;
266
+ appendEdit: null;
264
267
  input: (value: string) => boolean;
265
268
  change: (value: string) => boolean;
266
269
  focus: (evt: FocusEvent) => boolean;
@@ -473,6 +476,8 @@ declare const _default: import("vue").DefineComponent<{
473
476
  onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
474
477
  onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
475
478
  "onUpdate:flying"?: ((...args: any[]) => any) | undefined;
479
+ onAppendFly?: ((...args: any[]) => any) | undefined;
480
+ onAppendEdit?: ((...args: any[]) => any) | undefined;
476
481
  }, {
477
482
  required: import("element-plus/es/utils").EpPropMergeType<BooleanConstructor, unknown, unknown>;
478
483
  type: string;
@@ -3,10 +3,14 @@ import MapView from '@arcgis/core/views/MapView';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  view: {
5
5
  type: PropType<MapView>;
6
+ default: undefined;
6
7
  };
7
8
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
9
  view: {
9
10
  type: PropType<MapView>;
11
+ default: undefined;
10
12
  };
11
- }>>, {}>;
13
+ }>>, {
14
+ view: MapView;
15
+ }>;
12
16
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.28",
3
+ "version": "1.1.30",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {