clickgo 5.12.0 → 5.12.1

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.
@@ -678,6 +678,14 @@ export interface IStepClickedEvent {
678
678
  'label': string;
679
679
  };
680
680
  }
681
+ export interface IFabricLayerchangeEvent {
682
+ 'detail': {
683
+ /** --- 图层变更前的 name 属性值 --- */
684
+ 'prev': string;
685
+ /** --- 图层变更后的 name 属性值 --- */
686
+ 'next': string;
687
+ };
688
+ }
681
689
  export interface IObjviewerLine {
682
690
  /** -- 可自定义线段的名称 --- */
683
691
  'name'?: string;
@@ -1891,7 +1891,7 @@ ECharts 配置选项。
1891
1891
  ## fabric
1892
1892
  ---
1893
1893
 
1894
- 封装了 fabric.js 画布,可以对画布上元素进行拖拽、旋转、缩放。
1894
+ 封装了 fabric.js 画布,可以对画布上元素进行拖拽、旋转、缩放,并支持仿 PS 的图层选择模式。
1895
1895
 
1896
1896
  ### 参数
1897
1897
 
@@ -1899,7 +1899,31 @@ ECharts 配置选项。
1899
1899
 
1900
1900
  `boolean` | `string`
1901
1901
 
1902
- 禁用画布交互
1902
+ 禁用画布交互。
1903
+
1904
+ #### autoLayer
1905
+
1906
+ `boolean` | `string`
1907
+
1908
+ 是否允许点击画布对象自动切换激活图层,默认为 `true`。关闭后只有通过 `layer` 属性手动指定的对象才能响应鼠标事件,其他对象完全穿透。
1909
+
1910
+ #### transform
1911
+
1912
+ `boolean` | `string`
1913
+
1914
+ 是否显示控制点(自由变换句柄,即缩放/旋转手柄),默认为 `true`。关闭后激活对象仍可拖动,但不能通过控制点进行缩放和旋转。
1915
+
1916
+ #### layer
1917
+
1918
+ `string`
1919
+
1920
+ 双向绑定当前激活图层的标识,值为 fabric 对象的 `name` 属性值,无选中时为空字符串。`autoLayer` 为 `false` 时可通过此属性从外部手动切换激活图层。
1921
+
1922
+ #### selector
1923
+
1924
+ `boolean` | `string`
1925
+
1926
+ 是否显示框选矩形(拖拽空白区域来多选对象的虚线选框),默认为 `true`。
1903
1927
 
1904
1928
  ### 事件
1905
1929
 
@@ -1907,7 +1931,13 @@ ECharts 配置选项。
1907
1931
 
1908
1932
  `(canvas: fabric.Canvas) => void`
1909
1933
 
1910
- 加载成功并初始化 fabric js canvas 对象后触发,利用此抛出对象可执行原生的所有绘图和操作方法。
1934
+ 加载成功并初始化 fabric.js Canvas 对象后触发,可通过此对象调用所有原生 API。
1935
+
1936
+ #### layerchange
1937
+
1938
+ `(event: { detail: { prev: string; next: string } }) => void`
1939
+
1940
+ 激活图层变更时触发(仅 `autoLayer` 为 `true` 时)。`event.detail.prev` 为变更前的图层 name,`event.detail.next` 为变更后的图层 name,取消选中时为空字符串。多选状态下 `event.detail.next` 同样为空字符串。
1911
1941
 
1912
1942
  ### 方法
1913
1943
 
@@ -1924,7 +1954,17 @@ ECharts 配置选项。
1924
1954
  ## 示例
1925
1955
 
1926
1956
  ```xml
1927
- <fabric @init="init"></fabric>
1957
+ <!-- 默认:自动切换图层 + 显示控制点 -->
1958
+ <fabric v-model:layer="activeLayer" @init="init" @layerchange="onLayerChange"></fabric>
1959
+
1960
+ <!-- 仿 PS 普通模式:自动切换图层,但不显示控制点(只能拖动) -->
1961
+ <fabric :transform="false" v-model:layer="activeLayer" @init="init" @layerchange="onLayerChange"></fabric>
1962
+
1963
+ <!-- 手动指定图层(外部面板切换),显示控制点 -->
1964
+ <fabric :auto-layer="false" :layer="activeLayer" @init="init"></fabric>
1965
+
1966
+ <!-- 关闭框选矩形 -->
1967
+ <fabric :selector="false" @init="init"></fabric>
1928
1968
  ```
1929
1969
 
1930
1970
 
@@ -9751,6 +9791,7 @@ lib/control/index.md
9751
9791
  - [IDatepanelChangedEvent](interfaces/IDatepanelChangedEvent.md)
9752
9792
  - [IDatepanelRangeEvent](interfaces/IDatepanelRangeEvent.md)
9753
9793
  - [IDatepanelSelectedEvent](interfaces/IDatepanelSelectedEvent.md)
9794
+ - [IFabricLayerchangeEvent](interfaces/IFabricLayerchangeEvent.md)
9754
9795
  - [IFormCloseEvent](interfaces/IFormCloseEvent.md)
9755
9796
  - [IFormMaxEvent](interfaces/IFormMaxEvent.md)
9756
9797
  - [IFormMinEvent](interfaces/IFormMinEvent.md)
@@ -10582,6 +10623,39 @@ Defined in: [lib/control.ts:981](https://github.com/maiyun/clickgo/blob/master/d
10582
10623
 
10583
10624
  > **year**: `number`
10584
10625
 
10626
+ lib/control/interfaces/IFabricLayerchangeEvent.md
10627
+ ---
10628
+
10629
+ [**Documents for clickgo**](../../../index.md)
10630
+
10631
+ ***
10632
+
10633
+ [Documents for clickgo](../../../index.md) / [lib/control](../index.md) / IFabricLayerchangeEvent
10634
+
10635
+ # Interface: IFabricLayerchangeEvent
10636
+
10637
+ Defined in: [lib/control.ts:1487](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1487)
10638
+
10639
+ ## Properties
10640
+
10641
+ ### detail
10642
+
10643
+ > **detail**: `object`
10644
+
10645
+ Defined in: [lib/control.ts:1488](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1488)
10646
+
10647
+ #### next
10648
+
10649
+ > **next**: `string`
10650
+
10651
+ 图层变更后的 name 属性值
10652
+
10653
+ #### prev
10654
+
10655
+ > **prev**: `string`
10656
+
10657
+ 图层变更前的 name 属性值
10658
+
10585
10659
  lib/control/interfaces/IFormCloseEvent.md
10586
10660
  ---
10587
10661
 
@@ -11937,7 +12011,7 @@ lib/control/interfaces/IObjviewerLine.md
11937
12011
 
11938
12012
  # Interface: IObjviewerLine
11939
12013
 
11940
- Defined in: [lib/control.ts:1487](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1487)
12014
+ Defined in: [lib/control.ts:1498](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1498)
11941
12015
 
11942
12016
  ## Properties
11943
12017
 
@@ -11945,7 +12019,7 @@ Defined in: [lib/control.ts:1487](https://github.com/maiyun/clickgo/blob/master/
11945
12019
 
11946
12020
  > **end**: [`IObjviewerLineObj`](IObjviewerLineObj.md)
11947
12021
 
11948
- Defined in: [lib/control.ts:1491](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1491)
12022
+ Defined in: [lib/control.ts:1502](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1502)
11949
12023
 
11950
12024
  ***
11951
12025
 
@@ -11953,7 +12027,7 @@ Defined in: [lib/control.ts:1491](https://github.com/maiyun/clickgo/blob/master/
11953
12027
 
11954
12028
  > `optional` **hue**: `string`
11955
12029
 
11956
- Defined in: [lib/control.ts:1493](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1493)
12030
+ Defined in: [lib/control.ts:1504](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1504)
11957
12031
 
11958
12032
  默认 255
11959
12033
 
@@ -11963,7 +12037,7 @@ Defined in: [lib/control.ts:1493](https://github.com/maiyun/clickgo/blob/master/
11963
12037
 
11964
12038
  > `optional` **name**: `string`
11965
12039
 
11966
- Defined in: [lib/control.ts:1489](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1489)
12040
+ Defined in: [lib/control.ts:1500](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1500)
11967
12041
 
11968
12042
  -- 可自定义线段的名称
11969
12043
 
@@ -11973,7 +12047,7 @@ Defined in: [lib/control.ts:1489](https://github.com/maiyun/clickgo/blob/master/
11973
12047
 
11974
12048
  > `optional` **path**: `string`
11975
12049
 
11976
- Defined in: [lib/control.ts:1494](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1494)
12050
+ Defined in: [lib/control.ts:1505](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1505)
11977
12051
 
11978
12052
  ***
11979
12053
 
@@ -11981,7 +12055,7 @@ Defined in: [lib/control.ts:1494](https://github.com/maiyun/clickgo/blob/master/
11981
12055
 
11982
12056
  > **start**: [`IObjviewerLineObj`](IObjviewerLineObj.md)
11983
12057
 
11984
- Defined in: [lib/control.ts:1490](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1490)
12058
+ Defined in: [lib/control.ts:1501](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1501)
11985
12059
 
11986
12060
  ***
11987
12061
 
@@ -11989,7 +12063,7 @@ Defined in: [lib/control.ts:1490](https://github.com/maiyun/clickgo/blob/master/
11989
12063
 
11990
12064
  > `optional` **stroke**: `"down"` \| `"solid"` \| `"dashed"` \| `"up"`
11991
12065
 
11992
- Defined in: [lib/control.ts:1496](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1496)
12066
+ Defined in: [lib/control.ts:1507](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1507)
11993
12067
 
11994
12068
  默认 solid
11995
12069
 
@@ -12004,7 +12078,7 @@ lib/control/interfaces/IObjviewerLineObj.md
12004
12078
 
12005
12079
  # Interface: IObjviewerLineObj
12006
12080
 
12007
- Defined in: [lib/control.ts:1499](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1499)
12081
+ Defined in: [lib/control.ts:1510](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1510)
12008
12082
 
12009
12083
  ## Properties
12010
12084
 
@@ -12012,7 +12086,7 @@ Defined in: [lib/control.ts:1499](https://github.com/maiyun/clickgo/blob/master/
12012
12086
 
12013
12087
  > **obj**: `HTMLElement` \| [`AbstractControl`](../classes/AbstractControl.md)
12014
12088
 
12015
- Defined in: [lib/control.ts:1500](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1500)
12089
+ Defined in: [lib/control.ts:1511](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1511)
12016
12090
 
12017
12091
  ***
12018
12092
 
@@ -12020,7 +12094,7 @@ Defined in: [lib/control.ts:1500](https://github.com/maiyun/clickgo/blob/master/
12020
12094
 
12021
12095
  > **pos**: `"b"` \| `"tr"` \| `"lt"` \| `"t"` \| `"r"` \| `"rb"` \| `"bl"` \| `"l"`
12022
12096
 
12023
- Defined in: [lib/control.ts:1501](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1501)
12097
+ Defined in: [lib/control.ts:1512](https://github.com/maiyun/clickgo/blob/master/dist/lib/control.ts#L1512)
12024
12098
 
12025
12099
  lib/control/interfaces/IPaletteChangedEvent.md
12026
12100
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clickgo",
3
- "version": "5.12.0",
3
+ "version": "5.12.1",
4
4
  "description": "Background interface, software interface, mobile phone APP interface operation library.",
5
5
  "type": "module",
6
6
  "keywords": [