@fmsim/board 1.0.11 → 1.0.13
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/custom-elements.json
CHANGED
|
@@ -2,6 +2,69 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "stories/index.stories.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "Regular"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"kind": "variable",
|
|
15
|
+
"name": "CustomTitle"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"kind": "variable",
|
|
19
|
+
"name": "CustomCounter"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"kind": "variable",
|
|
23
|
+
"name": "SlottedContent"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"exports": [
|
|
27
|
+
{
|
|
28
|
+
"kind": "js",
|
|
29
|
+
"name": "default",
|
|
30
|
+
"declaration": {
|
|
31
|
+
"module": "stories/index.stories.ts"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"kind": "js",
|
|
36
|
+
"name": "Regular",
|
|
37
|
+
"declaration": {
|
|
38
|
+
"name": "Regular",
|
|
39
|
+
"module": "stories/index.stories.ts"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"kind": "js",
|
|
44
|
+
"name": "CustomTitle",
|
|
45
|
+
"declaration": {
|
|
46
|
+
"name": "CustomTitle",
|
|
47
|
+
"module": "stories/index.stories.ts"
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "js",
|
|
52
|
+
"name": "CustomCounter",
|
|
53
|
+
"declaration": {
|
|
54
|
+
"name": "CustomCounter",
|
|
55
|
+
"module": "stories/index.stories.ts"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"kind": "js",
|
|
60
|
+
"name": "SlottedContent",
|
|
61
|
+
"declaration": {
|
|
62
|
+
"name": "SlottedContent",
|
|
63
|
+
"module": "stories/index.stories.ts"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
},
|
|
5
68
|
{
|
|
6
69
|
"kind": "javascript-module",
|
|
7
70
|
"path": "src/index.ts",
|
|
@@ -1619,69 +1682,6 @@
|
|
|
1619
1682
|
"declarations": [],
|
|
1620
1683
|
"exports": []
|
|
1621
1684
|
},
|
|
1622
|
-
{
|
|
1623
|
-
"kind": "javascript-module",
|
|
1624
|
-
"path": "stories/index.stories.ts",
|
|
1625
|
-
"declarations": [
|
|
1626
|
-
{
|
|
1627
|
-
"kind": "variable",
|
|
1628
|
-
"name": "Regular"
|
|
1629
|
-
},
|
|
1630
|
-
{
|
|
1631
|
-
"kind": "variable",
|
|
1632
|
-
"name": "CustomTitle"
|
|
1633
|
-
},
|
|
1634
|
-
{
|
|
1635
|
-
"kind": "variable",
|
|
1636
|
-
"name": "CustomCounter"
|
|
1637
|
-
},
|
|
1638
|
-
{
|
|
1639
|
-
"kind": "variable",
|
|
1640
|
-
"name": "SlottedContent"
|
|
1641
|
-
}
|
|
1642
|
-
],
|
|
1643
|
-
"exports": [
|
|
1644
|
-
{
|
|
1645
|
-
"kind": "js",
|
|
1646
|
-
"name": "default",
|
|
1647
|
-
"declaration": {
|
|
1648
|
-
"module": "stories/index.stories.ts"
|
|
1649
|
-
}
|
|
1650
|
-
},
|
|
1651
|
-
{
|
|
1652
|
-
"kind": "js",
|
|
1653
|
-
"name": "Regular",
|
|
1654
|
-
"declaration": {
|
|
1655
|
-
"name": "Regular",
|
|
1656
|
-
"module": "stories/index.stories.ts"
|
|
1657
|
-
}
|
|
1658
|
-
},
|
|
1659
|
-
{
|
|
1660
|
-
"kind": "js",
|
|
1661
|
-
"name": "CustomTitle",
|
|
1662
|
-
"declaration": {
|
|
1663
|
-
"name": "CustomTitle",
|
|
1664
|
-
"module": "stories/index.stories.ts"
|
|
1665
|
-
}
|
|
1666
|
-
},
|
|
1667
|
-
{
|
|
1668
|
-
"kind": "js",
|
|
1669
|
-
"name": "CustomCounter",
|
|
1670
|
-
"declaration": {
|
|
1671
|
-
"name": "CustomCounter",
|
|
1672
|
-
"module": "stories/index.stories.ts"
|
|
1673
|
-
}
|
|
1674
|
-
},
|
|
1675
|
-
{
|
|
1676
|
-
"kind": "js",
|
|
1677
|
-
"name": "SlottedContent",
|
|
1678
|
-
"declaration": {
|
|
1679
|
-
"name": "SlottedContent",
|
|
1680
|
-
"module": "stories/index.stories.ts"
|
|
1681
|
-
}
|
|
1682
|
-
}
|
|
1683
|
-
]
|
|
1684
|
-
},
|
|
1685
1685
|
{
|
|
1686
1686
|
"kind": "javascript-module",
|
|
1687
1687
|
"path": "src/component/etc.ts",
|
|
@@ -2,6 +2,19 @@ import { EventMap } from '@hatiolab/things-scene';
|
|
|
2
2
|
function dispatchFetchLvModelDataByMouseEvent(type, event, target) {
|
|
3
3
|
var _a;
|
|
4
4
|
const parent = target.parentObject;
|
|
5
|
+
/*
|
|
6
|
+
@TODO Carrier holder 에 대한 처리를 여기에서 한다.
|
|
7
|
+
1. Carrier Holder 인가 ?
|
|
8
|
+
2. 현재 Carrier 를 홀딩하고 있는가 ?
|
|
9
|
+
3. Carrier Holder에게 offsetX, offsetY 의 오너가 누구인지 묻는다. (Carrier Holder인지, Carrier인지)
|
|
10
|
+
onCarrier(x, y)
|
|
11
|
+
4. Carrier 가 오너인 경우, Carrier 정보를 가져온다.
|
|
12
|
+
*/
|
|
13
|
+
if ('isPointOnCarrier' in target) {
|
|
14
|
+
if (target.isPointOnCarrier(event.offsetX, event.offsetY)) {
|
|
15
|
+
console.log('A carrier clicked..');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
5
18
|
if ((_a = target.model) === null || _a === void 0 ? void 0 : _a.id) {
|
|
6
19
|
window.dispatchEvent(new CustomEvent('fetchLvModelDataByMouseEvent', {
|
|
7
20
|
detail: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcs-mouse-event-handler.js","sourceRoot":"","sources":["../../../src/layers/mcs-mouse-event-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE5D,SAAS,oCAAoC,CAC3C,IAAoC,EACpC,KAAiB,EACjB,MAAgD;;IAEhD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAA;IAElC,IAAI,MAAA,MAAM,CAAC,KAAK,0CAAE,EAAE,EAAE,CAAC;QACrB,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,8BAA8B,EAAE;YAC9C,MAAM,EAAE;gBACN,KAAK,EAAE;oBACL,IAAI;oBACJ,KAAK;oBACL,KAAK,EAAE;wBACL,GAAG,MAAM,CAAC,KAAK;wBACf,cAAc,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAC,IAAI,CAAC;qBAClC;oBACD,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB;aACF;SACF,CAAC,CACH,CAAA;QAED,OAAO,MAAM,IAAI,MAAM,CAAA;IACzB,CAAC;SAAM,IAAI,MAAM,EAAE,CAAC;QAClB,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,8BAA8B,EAAE;YAC9C,MAAM,EAAE;gBACN,KAAK,EAAE;oBACL,IAAI;oBACJ,KAAK;oBACL,KAAK,EAAE,MAAM,CAAC,KAAK;oBACnB,IAAI,EAAE,MAAM,CAAC,IAAI;iBAClB;aACF;SACF,CAAC,CACH,CAAA;QAED,OAAO,MAAM,CAAA;IACf,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAiB,EAAE,IAAS;IAChD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAE1B,KAAK,CAAC,eAAe,EAAE,CAAA;IAEvB,oCAAoC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AAC9D,CAAC;AAED,SAAS,OAAO,CAAC,KAAiB,EAAE,IAAS;IAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAE1B,KAAK,CAAC,eAAe,EAAE,CAAA;IAEvB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,MAAM,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,oCAAoC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;YAE/E,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE,UAAU,IAAI,MAAM;aAC7B,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC,EAAE,GAAG,CAAC,CAAA;AACT,CAAC;AAED,SAAS,UAAU,CAAC,KAAiB,EAAE,IAAS;IAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAE1B,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,YAAY,GAAG,EAAE,CAAA;IAC1B,CAAC,EAAE,GAAG,CAAC,CAAA;IAEP,KAAK,CAAC,eAAe,EAAE,CAAA;IAEvB,MAAM,CAAC,YAAY,GAAG,UAAU,CAAA;IAEhC,oCAAoC,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AACjE,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE;IACrC,aAAa,EAAE;QACb,OAAO,EAAE;YACP,6CAA6C;YAC7C,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,UAAU;SACrB;KACF;CACF,CAAC,CAAA","sourcesContent":["import { Component, EventMap } from '@hatiolab/things-scene'\n\nfunction dispatchFetchLvModelDataByMouseEvent(\n type: 'hover' | 'click' | 'dblclick',\n event: MouseEvent,\n target: Component & { parentObject?: Component }\n): Component | undefined {\n const parent = target.parentObject\n\n if (target.model?.id) {\n window.dispatchEvent(\n new CustomEvent('fetchLvModelDataByMouseEvent', {\n detail: {\n value: {\n type,\n event,\n model: {\n ...target.state,\n parentObjectId: parent?.get('id')\n },\n data: target.data\n }\n }\n })\n )\n\n return parent || target\n } else if (parent) {\n window.dispatchEvent(\n new CustomEvent('fetchLvModelDataByMouseEvent', {\n detail: {\n value: {\n type,\n event,\n model: parent.state,\n data: parent.data\n }\n }\n })\n )\n\n return parent\n }\n}\n\nfunction onmouseenter(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n event.stopPropagation()\n\n dispatchFetchLvModelDataByMouseEvent('hover', event, target)\n}\n\nfunction onclick(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n event.stopPropagation()\n\n setTimeout(() => {\n if (target.currentEvent !== 'dblclick') {\n const realTarget = dispatchFetchLvModelDataByMouseEvent('click', event, target)\n\n window.dispatchEvent(\n new CustomEvent('clickComponent', {\n detail: realTarget || target\n })\n )\n }\n }, 300)\n}\n\nfunction ondblclick(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n setTimeout(() => {\n target.currentEvent = ''\n }, 500)\n\n event.stopPropagation()\n\n target.currentEvent = 'dblclick'\n\n dispatchFetchLvModelDataByMouseEvent('dblclick', event, target)\n}\n\nEventMap.register('mcs-event-handler', {\n 'model-layer': {\n '(all)': {\n // mouseenter: onmouseenter, /* 사용되지 않고 있음 */\n click: onclick,\n dblclick: ondblclick\n }\n }\n})\n"]}
|
|
1
|
+
{"version":3,"file":"mcs-mouse-event-handler.js","sourceRoot":"","sources":["../../../src/layers/mcs-mouse-event-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AAE5D,SAAS,oCAAoC,CAC3C,IAAoC,EACpC,KAAiB,EACjB,MAAgD;;IAEhD,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAA;IAElC;;;;;;;M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AAG,IAAI,CAAC,MAAM,CAAA;IAE1B,KAAK,CAAC,eAAe,EAAE,CAAA;IAEvB,UAAU,CAAC,GAAG,EAAE;QACd,IAAI,MAAM,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;YACvC,MAAM,UAAU,GAAG,oCAAoC,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;YAE/E,MAAM,CAAC,aAAa,CAClB,IAAI,WAAW,CAAC,gBAAgB,EAAE;gBAChC,MAAM,EAAE,UAAU,IAAI,MAAM;aAC7B,CAAC,CACH,CAAA;QACH,CAAC;IACH,CAAC,EAAE,GAAG,CAAC,CAAA;AACT,CAAC;AAED,SAAS,UAAU,CAAC,KAAiB,EAAE,IAAS;IAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;IAE1B,UAAU,CAAC,GAAG,EAAE;QACd,MAAM,CAAC,YAAY,GAAG,EAAE,CAAA;IAC1B,CAAC,EAAE,GAAG,CAAC,CAAA;IAEP,KAAK,CAAC,eAAe,EAAE,CAAA;IAEvB,MAAM,CAAC,YAAY,GAAG,UAAU,CAAA;IAEhC,oCAAoC,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AACjE,CAAC;AAED,QAAQ,CAAC,QAAQ,CAAC,mBAAmB,EAAE;IACrC,aAAa,EAAE;QACb,OAAO,EAAE;YACP,6CAA6C;YAC7C,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,UAAU;SACrB;KACF;CACF,CAAC,CAAA","sourcesContent":["import { Component, EventMap } from '@hatiolab/things-scene'\n\nfunction dispatchFetchLvModelDataByMouseEvent(\n type: 'hover' | 'click' | 'dblclick',\n event: MouseEvent,\n target: Component & { parentObject?: Component }\n): Component | undefined {\n const parent = target.parentObject\n\n /* \n @TODO Carrier holder 에 대한 처리를 여기에서 한다.\n 1. Carrier Holder 인가 ?\n 2. 현재 Carrier 를 홀딩하고 있는가 ?\n 3. Carrier Holder에게 offsetX, offsetY 의 오너가 누구인지 묻는다. (Carrier Holder인지, Carrier인지)\n onCarrier(x, y)\n 4. Carrier 가 오너인 경우, Carrier 정보를 가져온다.\n */\n\n if ('isPointOnCarrier' in target) {\n if ((target as any).isPointOnCarrier(event.offsetX, event.offsetY)) {\n console.log('A carrier clicked..')\n }\n }\n\n if (target.model?.id) {\n window.dispatchEvent(\n new CustomEvent('fetchLvModelDataByMouseEvent', {\n detail: {\n value: {\n type,\n event,\n model: {\n ...target.state,\n parentObjectId: parent?.get('id')\n },\n data: target.data\n }\n }\n })\n )\n\n return parent || target\n } else if (parent) {\n window.dispatchEvent(\n new CustomEvent('fetchLvModelDataByMouseEvent', {\n detail: {\n value: {\n type,\n event,\n model: parent.state,\n data: parent.data\n }\n }\n })\n )\n\n return parent\n }\n}\n\nfunction onmouseenter(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n event.stopPropagation()\n\n dispatchFetchLvModelDataByMouseEvent('hover', event, target)\n}\n\nfunction onclick(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n event.stopPropagation()\n\n setTimeout(() => {\n if (target.currentEvent !== 'dblclick') {\n const realTarget = dispatchFetchLvModelDataByMouseEvent('click', event, target)\n\n window.dispatchEvent(\n new CustomEvent('clickComponent', {\n detail: realTarget || target\n })\n )\n }\n }, 300)\n}\n\nfunction ondblclick(event: MouseEvent, hint: any) {\n const target = hint.origin\n\n setTimeout(() => {\n target.currentEvent = ''\n }, 500)\n\n event.stopPropagation()\n\n target.currentEvent = 'dblclick'\n\n dispatchFetchLvModelDataByMouseEvent('dblclick', event, target)\n}\n\nEventMap.register('mcs-event-handler', {\n 'model-layer': {\n '(all)': {\n // mouseenter: onmouseenter, /* 사용되지 않고 있음 */\n click: onclick,\n dblclick: ondblclick\n }\n }\n})\n"]}
|