@pisell/materials 1.0.134 → 1.0.136

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.
@@ -93,6 +93,11 @@ const AlertMeta: ComponentMetadata = {
93
93
  template:
94
94
  "onChange(event,${extParams}){\n// 关闭时触发的回调函数\nconsole.log('onChange');}",
95
95
  },
96
+ {
97
+ name: "onClick",
98
+ template:
99
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
100
+ },
96
101
  ],
97
102
  },
98
103
  component: {},
@@ -77,6 +77,11 @@ export default {
77
77
  template:
78
78
  "onError(${extParams}){\n// 图片加载失败的事件\nconsole.log('onError');}",
79
79
  },
80
+ {
81
+ name: "onClick",
82
+ template:
83
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
84
+ },
80
85
  ],
81
86
  },
82
87
  },
@@ -110,6 +110,13 @@ export default {
110
110
  },
111
111
  supports: {
112
112
  style: true,
113
+ events: [
114
+ {
115
+ name: "onClick",
116
+ template:
117
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
118
+ },
119
+ ],
113
120
  },
114
121
  },
115
122
  };
@@ -24,6 +24,13 @@ const DivMeta: ComponentMetadata = {
24
24
  configure: {
25
25
  supports: {
26
26
  style: true,
27
+ events: [
28
+ {
29
+ name: "onClick",
30
+ template:
31
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
32
+ },
33
+ ],
27
34
  },
28
35
  component: {
29
36
  isContainer: true,
@@ -1,4 +1,4 @@
1
- import snippets from './snippets';
1
+ import snippets from "./snippets";
2
2
 
3
3
  function clamp(value, min, max) {
4
4
  return Math.max(min, Math.min(max, value));
@@ -6,8 +6,8 @@ function clamp(value, min, max) {
6
6
 
7
7
  export default {
8
8
  snippets,
9
- componentName: 'Col',
10
- title: '栅格-列',
9
+ componentName: "Col",
10
+ title: "栅格-列",
11
11
  docUrl: "",
12
12
  screenshot: "",
13
13
  devMode: "proCode",
@@ -21,11 +21,11 @@ export default {
21
21
  },
22
22
  props: [
23
23
  {
24
- name: 'span',
25
- title: { label: '占位格数', tip: '栅格占位格数' },
26
- propType: 'number',
24
+ name: "span",
25
+ title: { label: "占位格数", tip: "栅格占位格数" },
26
+ propType: "number",
27
27
  setter: {
28
- componentName: 'NumberSetter',
28
+ componentName: "NumberSetter",
29
29
  props: {
30
30
  min: 0,
31
31
  max: 24,
@@ -33,16 +33,16 @@ export default {
33
33
  },
34
34
  },
35
35
  {
36
- name: 'order',
37
- title: { label: '栅格顺序', tip: '栅格顺序' },
38
- propType: 'number',
36
+ name: "order",
37
+ title: { label: "栅格顺序", tip: "栅格顺序" },
38
+ propType: "number",
39
39
  },
40
40
  {
41
- name: 'pull',
42
- title: { label: '右侧偏移', tip: '栅格往右移动格数' },
43
- propType: 'number',
41
+ name: "pull",
42
+ title: { label: "右侧偏移", tip: "栅格往右移动格数" },
43
+ propType: "number",
44
44
  setter: {
45
- componentName: 'NumberSetter',
45
+ componentName: "NumberSetter",
46
46
  props: {
47
47
  min: 0,
48
48
  max: 24,
@@ -50,11 +50,11 @@ export default {
50
50
  },
51
51
  },
52
52
  {
53
- name: 'push',
54
- title: { label: '左侧偏移', tip: '栅格往左移动格数' },
55
- propType: 'number',
53
+ name: "push",
54
+ title: { label: "左侧偏移", tip: "栅格往左移动格数" },
55
+ propType: "number",
56
56
  setter: {
57
- componentName: 'NumberSetter',
57
+ componentName: "NumberSetter",
58
58
  props: {
59
59
  min: 0,
60
60
  max: 24,
@@ -62,20 +62,29 @@ export default {
62
62
  },
63
63
  },
64
64
  {
65
- name: 'flex',
66
- title: { label: 'flex 布局属性', tip: 'flex 布局属性' },
67
- propType: 'string',
65
+ name: "flex",
66
+ title: { label: "flex 布局属性", tip: "flex 布局属性" },
67
+ propType: "string",
68
68
  setter: {
69
- componentName: 'StringSetter',
69
+ componentName: "StringSetter",
70
70
  },
71
- }
71
+ },
72
72
  ],
73
73
  configure: {
74
- component: { isContainer: true, nestingRule: { parentWhitelist: ['Row'] } },
75
- supports: { style: true },
74
+ component: { isContainer: true, nestingRule: { parentWhitelist: ["Row"] } },
75
+ supports: {
76
+ style: true,
77
+ events: [
78
+ {
79
+ name: "onClick",
80
+ template:
81
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
82
+ },
83
+ ],
84
+ },
76
85
  advanced: {
77
86
  getResizingHandlers: () => {
78
- return ['e'];
87
+ return ["e"];
79
88
  },
80
89
  callbacks: {
81
90
  onResizeStart: (e, currentNode) => {
@@ -86,7 +95,7 @@ export default {
86
95
  currentNode.parentRect = parentNode.getBoundingClientRect();
87
96
  }
88
97
  }
89
- currentNode.beforeSpan = currentNode.getPropValue('span') || 24;
98
+ currentNode.beforeSpan = currentNode.getPropValue("span") || 24;
90
99
  currentNode.startRect = currentNode.getRect();
91
100
  },
92
101
  onResize: (e, currentNode) => {
@@ -100,23 +109,29 @@ export default {
100
109
  }
101
110
  width = clamp(width, 0, currentNode.parentRect.width);
102
111
  const allowMoveX = Math.round(width - startWidth); // 实际被允许的x轴移动
103
- currentNode.moveColumn = Math.round(allowMoveX / (currentNode.parentRect.width / 24)); // 计算移动距离所占的列
112
+ currentNode.moveColumn = Math.round(
113
+ allowMoveX / (currentNode.parentRect.width / 24)
114
+ ); // 计算移动距离所占的列
104
115
  if (allowMoveX > 0) {
105
116
  currentNode.moveColumn++;
106
117
  } else {
107
118
  currentNode.moveColumn--;
108
119
  }
109
- currentNode.targetColumn = clamp(currentNode.beforeSpan + currentNode.moveColumn, 1, 24);
120
+ currentNode.targetColumn = clamp(
121
+ currentNode.beforeSpan + currentNode.moveColumn,
122
+ 1,
123
+ 24
124
+ );
110
125
  // currentNode.setPropValue('span', currentNode.targetColumn);
111
126
  const dom = currentNode.getDOMNode();
112
127
  dom.style.width = `${Math.round(width)}px`;
113
- dom.style.flex = 'none';
114
- dom.style.maxWidth = '100%';
128
+ dom.style.flex = "none";
129
+ dom.style.maxWidth = "100%";
115
130
  },
116
131
  onResizeEnd: (e, currentNode) => {
117
- currentNode.getDOMNode().style.cssText = '';
132
+ currentNode.getDOMNode().style.cssText = "";
118
133
  currentNode.targetColumn = clamp(currentNode.targetColumn, 1, 24);
119
- currentNode.setPropValue('span', currentNode.targetColumn);
134
+ currentNode.setPropValue("span", currentNode.targetColumn);
120
135
  },
121
136
  },
122
137
  },
@@ -1,10 +1,10 @@
1
- import snippets from './snippets';
1
+ import snippets from "./snippets";
2
2
 
3
3
  export default {
4
4
  snippets,
5
- componentName: 'Image',
6
- title: '图片',
7
- category: '数据展示',
5
+ componentName: "Image",
6
+ title: "图片",
7
+ category: "数据展示",
8
8
  docUrl: "",
9
9
  screenshot: "",
10
10
  devMode: "proCode",
@@ -18,37 +18,48 @@ export default {
18
18
  },
19
19
  props: [
20
20
  {
21
- name: 'src',
22
- title: { label: '图片地址', tip: '图片地址' },
23
- propType: { type: 'string', isRequired: true },
21
+ name: "src",
22
+ title: { label: "图片地址", tip: "图片地址" },
23
+ propType: { type: "string", isRequired: true },
24
24
  },
25
25
  {
26
- name: 'alt',
27
- title: { label: '替换文本', tip: '替换文本' },
28
- propType: 'string',
29
- setter: 'PisellI18nSetter',
26
+ name: "alt",
27
+ title: { label: "替换文本", tip: "替换文本" },
28
+ propType: "string",
29
+ setter: "PisellI18nSetter",
30
30
  },
31
31
  {
32
- name: 'preview',
33
- title: { label: '支持预览', tip: '支持预览' },
32
+ name: "preview",
33
+ title: { label: "支持预览", tip: "支持预览" },
34
34
  defaultValue: true,
35
- propType: 'bool',
35
+ propType: "bool",
36
36
  },
37
37
  {
38
- name: 'fallback',
39
- title: { label: '失败地址', tip: '加载失败容错地址' },
40
- propType: 'string',
38
+ name: "fallback",
39
+ title: { label: "失败地址", tip: "加载失败容错地址" },
40
+ propType: "string",
41
41
  },
42
42
  {
43
- name: 'width',
44
- title: { label: '宽度', tip: '宽度' },
45
- propType: 'number',
43
+ name: "width",
44
+ title: { label: "宽度", tip: "宽度" },
45
+ propType: "number",
46
46
  },
47
47
  {
48
- name: 'height',
49
- title: { label: '高度', tip: '高度' },
50
- propType: 'number',
48
+ name: "height",
49
+ title: { label: "高度", tip: "高度" },
50
+ propType: "number",
51
51
  },
52
52
  ],
53
- configure: { supports: { style: true } },
53
+ configure: {
54
+ supports: {
55
+ style: true,
56
+ events: [
57
+ {
58
+ name: "onClick",
59
+ template:
60
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
61
+ },
62
+ ],
63
+ },
64
+ },
54
65
  };
@@ -49,7 +49,14 @@ export default {
49
49
  ],
50
50
  configure: {
51
51
  supports: {
52
- style: true
52
+ style: true,
53
+ events: [
54
+ {
55
+ name: "onClick",
56
+ template:
57
+ "onListItemClick(event,${extParams}){\n// 点击列表项时的回调\nconsole.log('onListItemClick', event);}",
58
+ },
59
+ ],
53
60
  },
54
61
  component: {
55
62
  isContainer: true,
@@ -139,6 +139,11 @@ export default {
139
139
  name: 'onRefresh',
140
140
  template: "onRefresh(event,${extParams}){\n// 刷新\nconsole.log('onClose',event);}",
141
141
  },
142
+ {
143
+ name: "onClick",
144
+ template:
145
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
146
+ },
142
147
  ],
143
148
  },
144
149
  },
@@ -64,6 +64,11 @@ export default {
64
64
  name: 'onClose',
65
65
  template: "onClose(event,${extParams}){\n// 关闭时的回调\nconsole.log('onClose',event);}",
66
66
  },
67
+ {
68
+ name: "onClick",
69
+ template:
70
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
71
+ },
67
72
  ],
68
73
  },
69
74
  },
@@ -192,5 +192,17 @@ export default {
192
192
  },
193
193
  },
194
194
  ],
195
- configure: { supports: { style: true, events: ["onChange"] } },
195
+ configure: {
196
+ supports: {
197
+ style: true,
198
+ events: [
199
+ "onChange",
200
+ {
201
+ name: "onClick",
202
+ template:
203
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
204
+ },
205
+ ],
206
+ },
207
+ },
196
208
  };
@@ -164,6 +164,11 @@ export default {
164
164
  supports: {
165
165
  style: true,
166
166
  events: [
167
+ {
168
+ name: "onClick",
169
+ template:
170
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
171
+ },
167
172
  {
168
173
  name: 'copyable.onCopy',
169
174
  template: "onCopy(${extParams}){\n// 拷贝成功的回调函数\nconsole.log('onCopy');}",
@@ -1,10 +1,10 @@
1
- import snippets from './snippets';
1
+ import snippets from "./snippets";
2
2
 
3
3
  export default {
4
4
  snippets,
5
- componentName: 'Typography.Title',
6
- title: '标题',
7
- category: '基础',
5
+ componentName: "Typography.Title",
6
+ title: "标题",
7
+ category: "基础",
8
8
  docUrl: "",
9
9
  screenshot: "",
10
10
  devMode: "proCode",
@@ -18,48 +18,48 @@ export default {
18
18
  },
19
19
  props: [
20
20
  {
21
- name: 'children',
22
- title: { label: '内容', tip: '内容' },
21
+ name: "children",
22
+ title: { label: "内容", tip: "内容" },
23
23
  setter: {
24
- componentName: 'PisellI18nSetter',
24
+ componentName: "PisellI18nSetter",
25
25
  },
26
- defaultValue: '',
26
+ defaultValue: "",
27
27
  supportVariable: true,
28
28
  },
29
29
  {
30
- name: 'level',
31
- title: { label: '重要程度', tip: '重要程度(1-5)' },
32
- propType: 'number',
30
+ name: "level",
31
+ title: { label: "重要程度", tip: "重要程度(1-5)" },
32
+ propType: "number",
33
33
  defaultValue: 1,
34
34
  },
35
35
  {
36
- name: 'code',
37
- title: { label: '添加代码样式', tip: '添加代码样式' },
38
- propType: 'bool',
36
+ name: "code",
37
+ title: { label: "添加代码样式", tip: "添加代码样式" },
38
+ propType: "bool",
39
39
  defaultValue: false,
40
40
  },
41
41
  {
42
- name: 'copyable',
43
- title: { label: '是否可拷贝', tip: '是否可拷贝' },
44
- propType: 'bool',
42
+ name: "copyable",
43
+ title: { label: "是否可拷贝", tip: "是否可拷贝" },
44
+ propType: "bool",
45
45
  defaultValue: false,
46
46
  },
47
47
  {
48
- name: 'delete',
49
- title: { label: '添加删除线样式', tip: '添加删除线样式' },
50
- propType: 'bool',
48
+ name: "delete",
49
+ title: { label: "添加删除线样式", tip: "添加删除线样式" },
50
+ propType: "bool",
51
51
  defaultValue: false,
52
52
  },
53
53
  {
54
- name: 'disabled',
55
- title: { label: '是否禁用', tip: '是否为禁用状态' },
56
- propType: 'bool',
54
+ name: "disabled",
55
+ title: { label: "是否禁用", tip: "是否为禁用状态" },
56
+ propType: "bool",
57
57
  defaultValue: false,
58
58
  },
59
59
  {
60
- name: 'editable',
61
- title: { label: '是否可编辑', tip: '是否可编辑' },
62
- propType: 'bool',
60
+ name: "editable",
61
+ title: { label: "是否可编辑", tip: "是否可编辑" },
62
+ propType: "bool",
63
63
  defaultValue: false,
64
64
  },
65
65
  {
@@ -134,61 +134,72 @@ export default {
134
134
  },
135
135
  },
136
136
  {
137
- name: 'mark',
138
- title: { label: '添加标记样式', tip: '添加标记样式' },
139
- propType: 'bool',
137
+ name: "mark",
138
+ title: { label: "添加标记样式", tip: "添加标记样式" },
139
+ propType: "bool",
140
140
  defaultValue: false,
141
141
  },
142
142
  {
143
- name: 'keyboard',
144
- title: { label: '添加键盘样式', tip: '添加键盘样式' },
145
- propType: 'bool',
143
+ name: "keyboard",
144
+ title: { label: "添加键盘样式", tip: "添加键盘样式" },
145
+ propType: "bool",
146
146
  defaultValue: false,
147
147
  },
148
148
  {
149
- name: 'underline',
150
- title: { label: '添加下划线样式', tip: '添加下划线样式' },
151
- propType: 'bool',
149
+ name: "underline",
150
+ title: { label: "添加下划线样式", tip: "添加下划线样式" },
151
+ propType: "bool",
152
152
  defaultValue: false,
153
153
  },
154
154
  {
155
- name: 'strong',
156
- title: { label: '是否加粗', tip: '是否加粗' },
157
- propType: 'bool',
155
+ name: "strong",
156
+ title: { label: "是否加粗", tip: "是否加粗" },
157
+ propType: "bool",
158
158
  defaultValue: false,
159
159
  },
160
160
  {
161
- name: 'type',
162
- title: { label: '文本类型', tip: '文本类型' },
163
- propType: { type: 'oneOf', value: ['secondary', 'warning', 'danger'] },
161
+ name: "type",
162
+ title: { label: "文本类型", tip: "文本类型" },
163
+ propType: { type: "oneOf", value: ["secondary", "warning", "danger"] },
164
164
  setter: {
165
- componentName: 'SelectSetter',
165
+ componentName: "SelectSetter",
166
166
  props: {
167
167
  options: [
168
168
  {
169
- title: '默认',
170
- value: 'default',
169
+ title: "默认",
170
+ value: "default",
171
171
  },
172
172
  {
173
- title: '弱提示',
174
- value: 'secondary',
173
+ title: "弱提示",
174
+ value: "secondary",
175
175
  },
176
176
  {
177
- title: '成功',
178
- value: 'success',
177
+ title: "成功",
178
+ value: "success",
179
179
  },
180
180
  {
181
- title: '警告',
182
- value: 'warning',
181
+ title: "警告",
182
+ value: "warning",
183
183
  },
184
184
  {
185
- title: '错误',
186
- value: 'danger',
185
+ title: "错误",
186
+ value: "danger",
187
187
  },
188
188
  ],
189
189
  },
190
190
  },
191
191
  },
192
192
  ],
193
- configure: { supports: { style: true } },
193
+ configure: {
194
+ supports: {
195
+ style: true,
196
+ events: [
197
+ {
198
+ name: "onClick",
199
+ template:
200
+ "onClick(event,${extParams}){\n// 点击时的回调\nconsole.log('onClick', event);}",
201
+ },
202
+ ],
203
+ },
204
+ },
194
205
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "1.0.134",
3
+ "version": "1.0.136",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -55,8 +55,8 @@
55
55
  "@dnd-kit/utilities": "^3.2.1",
56
56
  "ahooks": "^3.7.6",
57
57
  "react-infinite-scroll-component": "^6.1.0",
58
- "@pisell/icon": "0.0.8",
59
58
  "@pisell/utils": "1.0.18",
59
+ "@pisell/icon": "0.0.8",
60
60
  "@pisell/date-picker": "1.0.51"
61
61
  },
62
62
  "peerDependencies": {