@vunk/form 1.1.30 → 1.1.32

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;
@@ -1,5 +1,6 @@
1
1
  import VkfEsriInputGeojson from './src/index.vue.d';
2
2
  export * as __VkfEsriInputGeojson from './src/types';
3
+ export * as _VkfEsriInputGeojsonCtx from './src/ctx';
3
4
  export * from './src/const';
4
5
  export { VkfEsriInputGeojson, };
5
6
  export default VkfEsriInputGeojson;
@@ -125,14 +125,22 @@ const props = __spreadProps(__spreadValues({}, _VkfInputCtx.props), {
125
125
  default: false
126
126
  }
127
127
  });
128
- bindPropsFactory(props);
128
+ const createBindProps = bindPropsFactory(props);
129
129
  const emits = __spreadProps(__spreadValues({}, _VkfInputCtx.emits), {
130
130
  "update:modelValue": (e) => e,
131
131
  "update:flying": null,
132
132
  "appendFly": null,
133
133
  appendEdit: null
134
134
  });
135
- onEmitsFactory(emits);
135
+ const createOnEmits = onEmitsFactory(emits);
136
+
137
+ var ctx = /*#__PURE__*/Object.freeze({
138
+ __proto__: null,
139
+ props: props,
140
+ createBindProps: createBindProps,
141
+ emits: emits,
142
+ createOnEmits: createOnEmits
143
+ });
136
144
 
137
145
  /*! Element Plus Icons Vue v2.1.0 */
138
146
 
@@ -1360,15 +1368,18 @@ var _sfc_main = defineComponent({
1360
1368
  return container == null ? void 0 : container.querySelector(".esri-sketch__panel");
1361
1369
  });
1362
1370
  const viewDef = new Deferred();
1371
+ const layerRef = shallowRef();
1363
1372
  const sketchLoad = async (e) => {
1364
1373
  await e.sketch.when();
1365
1374
  sketchRef.value = e.sketch;
1366
1375
  viewDef.resolve(sketchRef.value.view);
1367
1376
  };
1368
1377
  const layerLoad = async ({
1369
- view
1378
+ view,
1379
+ layer
1370
1380
  }) => {
1371
1381
  viewDef.resolve(view);
1382
+ layerRef.value = layer;
1372
1383
  };
1373
1384
  const availableCreatureTools = computed(() => {
1374
1385
  if (Array.isArray(props2.editTypes)) {
@@ -1404,6 +1415,9 @@ var _sfc_main = defineComponent({
1404
1415
  mapTo.value = normalMapRef.value;
1405
1416
  });
1406
1417
  const dialogShow = ref(false);
1418
+ const setDialogShow = (v) => {
1419
+ dialogShow.value = v;
1420
+ };
1407
1421
  const dialogOnOpen = async () => {
1408
1422
  mapTo.value = dialogMapRef.value;
1409
1423
  };
@@ -1507,6 +1521,7 @@ var _sfc_main = defineComponent({
1507
1521
  sketchLoad,
1508
1522
  shetchPanel,
1509
1523
  dialogShow,
1524
+ setDialogShow,
1510
1525
  normalMapRef,
1511
1526
  dialogMapRef,
1512
1527
  dialogOnOpen,
@@ -1515,7 +1530,9 @@ var _sfc_main = defineComponent({
1515
1530
  doSave,
1516
1531
  readonly,
1517
1532
  layerLoad,
1518
- sketchIf
1533
+ sketchIf,
1534
+ fly,
1535
+ layerRef
1519
1536
  };
1520
1537
  }
1521
1538
  });
@@ -1532,67 +1549,79 @@ const _hoisted_3 = {
1532
1549
 
1533
1550
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1534
1551
  const _component_VkfInput = resolveComponent("VkfInput");
1535
- const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1536
1552
  const _component_DocumentChecked = resolveComponent("DocumentChecked");
1537
1553
  const _component_ElIcon = resolveComponent("ElIcon");
1538
1554
  const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
1539
1555
  const _component_VaSketch = resolveComponent("VaSketch");
1556
+ const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
1540
1557
  const _component_ViewerVue = resolveComponent("ViewerVue");
1541
1558
  const _component_ElDialog = resolveComponent("ElDialog");
1542
1559
 
1543
1560
  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": {
1561
+ renderSlot(_ctx.$slots, "custom", {
1562
+ modelValue: _ctx.modelValue,
1563
+ fly: _ctx.fly,
1564
+ setDialogShow: _ctx.setDialogShow,
1565
+ layer: _ctx.layerRef,
1566
+ showMap: _ctx.showMap
1567
+ }, () => [
1568
+ createVNode(_component_VkfInput, mergeProps({
1569
+ readonly: true,
1570
+ "model-value": JSON.stringify(_ctx.modelValue)
1571
+ }, _ctx.inputBindProps, {
1572
+ "input-slots": {
1549
1573
  append: _ctx.append
1550
1574
  }
1551
- }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"]),
1575
+ }, toHandlers(_ctx.inputOnEmits)), null, 16 /* FULL_PROPS */, ["model-value", "input-slots"])
1576
+ ]),
1552
1577
  createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
1553
1578
  default: withCtx(() => [
1554
1579
  createVNode(_component_ViewerVue, { view: _ctx.view }, {
1555
1580
  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
1581
+ createVNode(_component_VaGraphicsLayer, {
1582
+ graphics: _ctx.sketchValue,
1583
+ onLoad: _ctx.layerLoad
1584
+ }, {
1585
+ default: withCtx(() => [
1586
+ (!(_ctx.readonly || !_ctx.sketchIf))
1587
+ ? (openBlock(), createBlock(_component_VaSketch, {
1588
+ key: 0,
1589
+ "view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
1590
+ "view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
1591
+ "view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
1592
+ multiple: _ctx.multiple,
1593
+ "available-creature-tools": _ctx.availableCreatureTools,
1594
+ "model-value": _ctx.sketchValue,
1595
+ "onUpdate:modelValue": _ctx.handleUpdateSketchValue,
1596
+ onLoad: _ctx.sketchLoad
1597
+ }, {
1598
+ default: withCtx(() => [
1599
+ (!_ctx.skipSave && _ctx.shetchPanel)
1600
+ ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
1601
+ key: 0,
1602
+ to: _ctx.shetchPanel
1583
1603
  }, {
1584
1604
  default: withCtx(() => [
1585
- createVNode(_component_DocumentChecked)
1605
+ createVNode(_component_ElIcon, {
1606
+ class: "esri-sketch-ui-save esri-widget--button",
1607
+ onClick: _ctx.doSave
1608
+ }, {
1609
+ default: withCtx(() => [
1610
+ createVNode(_component_DocumentChecked)
1611
+ ]),
1612
+ _: 1 /* STABLE */
1613
+ }, 8 /* PROPS */, ["onClick"])
1586
1614
  ]),
1587
1615
  _: 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"]))
1616
+ }, 8 /* PROPS */, ["to"]))
1617
+ : createCommentVNode("v-if", true)
1618
+ ]),
1619
+ _: 1 /* STABLE */
1620
+ }, 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"]))
1621
+ : createCommentVNode("v-if", true)
1622
+ ]),
1623
+ _: 1 /* STABLE */
1624
+ }, 8 /* PROPS */, ["graphics", "onLoad"])
1596
1625
  ]),
1597
1626
  _: 1 /* STABLE */
1598
1627
  }, 8 /* PROPS */, ["view"])
@@ -1631,4 +1660,4 @@ VkfEsriInputGeojson.install = (app) => {
1631
1660
  app.component(VkfEsriInputGeojson.name, VkfEsriInputGeojson);
1632
1661
  };
1633
1662
 
1634
- export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, VkfEsriInputGeojson, types as __VkfEsriInputGeojson, VkfEsriInputGeojson as default };
1663
+ export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, VkfEsriInputGeojson as default };
@@ -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.32",
4
4
  "description": "",
5
5
  "main": "index.esm.js",
6
6
  "scripts": {