@vunk/form 1.1.30 → 1.1.31

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,35 +1,37 @@
1
1
 
2
- .vkf-esri-input-geojson__map{
2
+ .vkf-esri-input-geojson__map {
3
3
  height: 350px;
4
4
  }
5
5
 
6
- .vkf-esri-input-geojson-dialog .el-dialog.is-fullscreen{
6
+ .vkf-esri-input-geojson-dialog .el-dialog.is-fullscreen {
7
7
  height: 100%;
8
8
  }
9
- .vkf-esri-input-geojson-dialog .el-dialog{
9
+
10
+ .vkf-esri-input-geojson-dialog .el-dialog {
10
11
  display: flex;
11
12
  flex-direction: column;
12
13
  min-height: 50%;
13
14
  }
14
- .vkf-esri-input-geojson-dialog .el-dialog__body{
15
+
16
+ .vkf-esri-input-geojson-dialog .el-dialog__body {
15
17
  display: flex;
16
18
  flex-direction: column;
17
19
  flex: 1;
18
20
  overflow: hidden;
19
21
  padding: 0;
20
22
  }
21
- .vkf-esri-input-geojson-dialog__map{
23
+
24
+ .vkf-esri-input-geojson-dialog__map {
22
25
  flex: 1;
23
26
  display: flex;
24
27
  flex-direction: column;
25
28
  overflow: hidden;
26
29
  }
27
30
 
28
- .vkf-esri-input-geojson-dialog__map > .va-map-view{
31
+ .vkf-esri-input-geojson-dialog__map>.va-map-view {
29
32
  flex: 1;
30
33
  }
31
34
 
32
-
33
35
  .el-button.vkf-esri-input-geojson__upload{
34
36
  border-color: transparent;
35
37
  background-color: transparent;
@@ -1360,15 +1360,18 @@ var _sfc_main = defineComponent({
1360
1360
  return container == null ? void 0 : container.querySelector(".esri-sketch__panel");
1361
1361
  });
1362
1362
  const viewDef = new Deferred();
1363
+ const layerRef = shallowRef();
1363
1364
  const sketchLoad = async (e) => {
1364
1365
  await e.sketch.when();
1365
1366
  sketchRef.value = e.sketch;
1366
1367
  viewDef.resolve(sketchRef.value.view);
1367
1368
  };
1368
1369
  const layerLoad = async ({
1369
- view
1370
+ view,
1371
+ layer
1370
1372
  }) => {
1371
1373
  viewDef.resolve(view);
1374
+ layerRef.value = layer;
1372
1375
  };
1373
1376
  const availableCreatureTools = computed(() => {
1374
1377
  if (Array.isArray(props2.editTypes)) {
@@ -1404,6 +1407,9 @@ var _sfc_main = defineComponent({
1404
1407
  mapTo.value = normalMapRef.value;
1405
1408
  });
1406
1409
  const dialogShow = ref(false);
1410
+ const setDialogShow = (v) => {
1411
+ dialogShow.value = v;
1412
+ };
1407
1413
  const dialogOnOpen = async () => {
1408
1414
  mapTo.value = dialogMapRef.value;
1409
1415
  };
@@ -1507,6 +1513,7 @@ var _sfc_main = defineComponent({
1507
1513
  sketchLoad,
1508
1514
  shetchPanel,
1509
1515
  dialogShow,
1516
+ setDialogShow,
1510
1517
  normalMapRef,
1511
1518
  dialogMapRef,
1512
1519
  dialogOnOpen,
@@ -1515,7 +1522,9 @@ var _sfc_main = defineComponent({
1515
1522
  doSave,
1516
1523
  readonly,
1517
1524
  layerLoad,
1518
- sketchIf
1525
+ sketchIf,
1526
+ fly,
1527
+ layerRef
1519
1528
  };
1520
1529
  }
1521
1530
  });
@@ -1532,67 +1541,79 @@ const _hoisted_3 = {
1532
1541
 
1533
1542
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1534
1543
  const _component_VkfInput = resolveComponent("VkfInput");
1535
- const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1536
1544
  const _component_DocumentChecked = resolveComponent("DocumentChecked");
1537
1545
  const _component_ElIcon = resolveComponent("ElIcon");
1538
1546
  const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
1539
1547
  const _component_VaSketch = resolveComponent("VaSketch");
1548
+ const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1540
1549
  const _component_ViewerVue = resolveComponent("ViewerVue");
1541
1550
  const _component_ElDialog = resolveComponent("ElDialog");
1542
1551
 
1543
1552
  return (openBlock(), createElementBlock("div", _hoisted_1, [
1544
- createVNode(_component_VkfInput, mergeProps({
1545
- readonly: true,
1546
- "model-value": JSON.stringify(_ctx.modelValue)
1547
- }, _ctx.inputBindProps, {
1548
- "input-slots": {
1553
+ renderSlot(_ctx.$slots, "custom", {
1554
+ modelValue: _ctx.modelValue,
1555
+ fly: _ctx.fly,
1556
+ setDialogShow: _ctx.setDialogShow,
1557
+ layer: _ctx.layerRef,
1558
+ showMap: _ctx.showMap
1559
+ }, () => [
1560
+ createVNode(_component_VkfInput, mergeProps({
1561
+ readonly: true,
1562
+ "model-value": JSON.stringify(_ctx.modelValue)
1563
+ }, _ctx.inputBindProps, {
1564
+ "input-slots": {
1549
1565
  append: _ctx.append
1550
1566
  }
1551
- }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"]),
1567
+ }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"])
1568
+ ]),
1552
1569
  createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
1553
1570
  default: withCtx(() => [
1554
1571
  createVNode(_component_ViewerVue, { view: _ctx.view }, {
1555
1572
  default: withCtx(() => [
1556
- (_ctx.readonly || !_ctx.sketchIf)
1557
- ? (openBlock(), createBlock(_component_VaGraphicsLayer, {
1558
- key: 0,
1559
- graphics: _ctx.sketchValue,
1560
- onLoad: _ctx.layerLoad
1561
- }, null, 8 /* PROPS */, ["graphics", "onLoad"]))
1562
- : (openBlock(), createBlock(_component_VaSketch, {
1563
- key: 1,
1564
- "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1565
- "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1566
- "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1567
- multiple: _ctx.multiple,
1568
- "available-creature-tools": _ctx.availableCreatureTools,
1569
- "model-value": _ctx.sketchValue,
1570
- "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1571
- onLoad: _ctx.sketchLoad
1572
- }, {
1573
- default: withCtx(() => [
1574
- (!_ctx.skipSave && _ctx.shetchPanel)
1575
- ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
1576
- key: 0,
1577
- to: _ctx.shetchPanel
1578
- }, {
1579
- default: withCtx(() => [
1580
- createVNode(_component_ElIcon, {
1581
- class: "esri-sketch-ui-save esri-widget--button",
1582
- onClick: _ctx.doSave
1573
+ createVNode(_component_VaGraphicsLayer, {
1574
+ graphics: _ctx.sketchValue,
1575
+ onLoad: _ctx.layerLoad
1576
+ }, {
1577
+ default: withCtx(() => [
1578
+ (!(_ctx.readonly || !_ctx.sketchIf))
1579
+ ? (openBlock(), createBlock(_component_VaSketch, {
1580
+ key: 0,
1581
+ "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1582
+ "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1583
+ "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1584
+ multiple: _ctx.multiple,
1585
+ "available-creature-tools": _ctx.availableCreatureTools,
1586
+ "model-value": _ctx.sketchValue,
1587
+ "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1588
+ onLoad: _ctx.sketchLoad
1589
+ }, {
1590
+ default: withCtx(() => [
1591
+ (!_ctx.skipSave && _ctx.shetchPanel)
1592
+ ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
1593
+ key: 0,
1594
+ to: _ctx.shetchPanel
1583
1595
  }, {
1584
1596
  default: withCtx(() => [
1585
- createVNode(_component_DocumentChecked)
1597
+ createVNode(_component_ElIcon, {
1598
+ class: "esri-sketch-ui-save esri-widget--button",
1599
+ onClick: _ctx.doSave
1600
+ }, {
1601
+ default: withCtx(() => [
1602
+ createVNode(_component_DocumentChecked)
1603
+ ]),
1604
+ _: 1 /* STABLE */
1605
+ }, 8 /* PROPS */, ["onClick"])
1586
1606
  ]),
1587
1607
  _: 1 /* STABLE */
1588
- }, 8 /* PROPS */, ["onClick"])
1589
- ]),
1590
- _: 1 /* STABLE */
1591
- }, 8 /* PROPS */, ["to"]))
1592
- : createCommentVNode("v-if", true)
1593
- ]),
1594
- _: 1 /* STABLE */
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"]))
1608
+ }, 8 /* PROPS */, ["to"]))
1609
+ : createCommentVNode("v-if", true)
1610
+ ]),
1611
+ _: 1 /* STABLE */
1612
+ }, 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"]))
1613
+ : createCommentVNode("v-if", true)
1614
+ ]),
1615
+ _: 1 /* STABLE */
1616
+ }, 8 /* PROPS */, ["graphics", "onLoad"])
1596
1617
  ]),
1597
1618
  _: 1 /* STABLE */
1598
1619
  }, 8 /* PROPS */, ["view"])
@@ -250,6 +250,7 @@ declare const _default: import("vue").DefineComponent<{
250
250
  sketchLoad: __VaSketch.OnLoad;
251
251
  shetchPanel: import("vue").ComputedRef<Element | null>;
252
252
  dialogShow: Ref<boolean>;
253
+ setDialogShow: (v: boolean) => void;
253
254
  normalMapRef: Ref<HTMLDivElement>;
254
255
  dialogMapRef: Ref<HTMLDivElement>;
255
256
  dialogOnOpen: () => Promise<void>;
@@ -259,6 +260,8 @@ declare const _default: import("vue").DefineComponent<{
259
260
  readonly: import("vue").ComputedRef<boolean>;
260
261
  layerLoad: __VaGraphicsLayer.OnLoad;
261
262
  sketchIf: Ref<boolean>;
263
+ fly: () => Promise<void>;
264
+ layerRef: Ref<__esri.GraphicsLayer>;
262
265
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
263
266
  'update:modelValue': (e: import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>) => import("geojson").FeatureCollection<import("geojson").Geometry, import("geojson").GeoJsonProperties>;
264
267
  'update:flying': null;
@@ -1,8 +1,10 @@
1
1
  import { __VaSketch } from '@vuesri/core';
2
- import { Media, VueComponentPropsType } from '@vunk/core';
2
+ import { AnyFunc, Media, VueComponentPropsType } from '@vunk/core';
3
3
  import { EDIT_TYPE } from './const';
4
4
  import type { VkfEsriInputGeojson } from '@vunk/form/components/esri-input-geojson';
5
5
  import { BasicSource } from '@vunk/form/shared';
6
+ import type { FeatureCollection } from 'geojson';
7
+ import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
6
8
  export interface EditTypeMedia extends Media {
7
9
  value: EDIT_TYPE;
8
10
  availableCreatureTools: __VaSketch.AvailableCreatureTool[];
@@ -11,3 +13,10 @@ export interface Source<P extends string = string> extends VueComponentPropsType
11
13
  prop?: P;
12
14
  templateType: 'VkfEsriInputGeojson';
13
15
  }
16
+ export interface CustomSlotProps {
17
+ setDialogShow: (show: boolean) => void;
18
+ fly: AnyFunc;
19
+ modelValue: FeatureCollection<any, any>;
20
+ layer: GraphicsLayer;
21
+ showMap: boolean;
22
+ }
package/index.css CHANGED
@@ -49,37 +49,39 @@
49
49
  }
50
50
 
51
51
 
52
- .vkf-esri-input-geojson__map{
52
+ .vkf-esri-input-geojson__map {
53
53
  height: 350px;
54
54
  }
55
55
 
56
- .vkf-esri-input-geojson-dialog .el-dialog.is-fullscreen{
56
+ .vkf-esri-input-geojson-dialog .el-dialog.is-fullscreen {
57
57
  height: 100%;
58
58
  }
59
- .vkf-esri-input-geojson-dialog .el-dialog{
59
+
60
+ .vkf-esri-input-geojson-dialog .el-dialog {
60
61
  display: flex;
61
62
  flex-direction: column;
62
63
  min-height: 50%;
63
64
  }
64
- .vkf-esri-input-geojson-dialog .el-dialog__body{
65
+
66
+ .vkf-esri-input-geojson-dialog .el-dialog__body {
65
67
  display: flex;
66
68
  flex-direction: column;
67
69
  flex: 1;
68
70
  overflow: hidden;
69
71
  padding: 0;
70
72
  }
71
- .vkf-esri-input-geojson-dialog__map{
73
+
74
+ .vkf-esri-input-geojson-dialog__map {
72
75
  flex: 1;
73
76
  display: flex;
74
77
  flex-direction: column;
75
78
  overflow: hidden;
76
79
  }
77
80
 
78
- .vkf-esri-input-geojson-dialog__map > .va-map-view{
81
+ .vkf-esri-input-geojson-dialog__map>.va-map-view {
79
82
  flex: 1;
80
83
  }
81
84
 
82
-
83
85
  .el-button.vkf-esri-input-geojson__upload{
84
86
  border-color: transparent;
85
87
  background-color: transparent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vunk/form",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {