diff --git a/ShadowEditor.Web/src/editor2/component/BasicComponent.jsx b/ShadowEditor.Web/src/editor2/component/BasicComponent.jsx
index 0aab04f5..a33b6e47 100644
--- a/ShadowEditor.Web/src/editor2/component/BasicComponent.jsx
+++ b/ShadowEditor.Web/src/editor2/component/BasicComponent.jsx
@@ -1,3 +1,5 @@
+import { PropertyGrid, PropertyGroup, TextProperty } from '../../third_party';
+
/**
* 基本信息组件
* @author tengge / https://github.com/tengge1
@@ -8,7 +10,9 @@ class BasicComponent extends React.Component {
}
render() {
- return
;
+ return
+
+ ;
}
}
diff --git a/ShadowEditor.Web/src/editor2/sidebar/PropertyPanel.jsx b/ShadowEditor.Web/src/editor2/sidebar/PropertyPanel.jsx
index 244e3496..44d89a09 100644
--- a/ShadowEditor.Web/src/editor2/sidebar/PropertyPanel.jsx
+++ b/ShadowEditor.Web/src/editor2/sidebar/PropertyPanel.jsx
@@ -1,5 +1,6 @@
import './css/PropertyPanel.css';
import { classNames, PropTypes, PropertyGrid } from '../../third_party';
+import BasicComponent from '../component/BasicComponent.jsx';
/**
* 属性面板
@@ -8,65 +9,12 @@ import { classNames, PropTypes, PropertyGrid } from '../../third_party';
class PropertyPanel extends React.Component {
constructor(props) {
super(props);
-
- this.data = [{
- name: 'General',
- expand: true,
- children: [{
- type: 'text',
- name: 'name',
- label: 'Name',
- value: 'Box',
- }, {
- type: 'label',
- name: 'type',
- label: 'Type',
- value: 'Box',
- }, {
- type: 'checkbox',
- name: 'visible',
- label: 'Visible',
- value: true,
- }]
- }, {
- name: 'Transform',
- expand: false,
- children: [{
- type: 'number',
- name: 'translateX',
- label: 'TranslateX',
- value: 0,
- }, {
- type: 'number',
- name: 'translateY',
- label: 'TranslateY',
- value: 0,
- }, {
- type: 'number',
- name: 'translateZ',
- label: 'TranslateZ',
- value: 0,
- }, {
- type: 'number',
- name: 'rotateX',
- label: 'RotateX',
- value: 0,
- }, {
- type: 'number',
- name: 'rotateY',
- label: 'RotateY',
- value: 0,
- }, {
- type: 'number',
- name: 'rotateZ',
- label: 'RotateZ',
- value: 0,
- }]
- }];
}
render() {
- return ;
+ return
+
+ ;
}
}
diff --git a/ShadowEditor.Web/src/ui/index.js b/ShadowEditor.Web/src/ui/index.js
index c015d6b4..0dcdc667 100644
--- a/ShadowEditor.Web/src/ui/index.js
+++ b/ShadowEditor.Web/src/ui/index.js
@@ -54,6 +54,9 @@ export { default as Panel } from './panel/Panel.jsx';
// property
export { default as PropertyGrid } from './property/PropertyGrid.jsx';
+export { default as PropertyGroup } from './property/PropertyGroup.jsx';
+export { default as DisplayProperty } from './property/DisplayProperty.jsx';
+export { default as TextProperty } from './property/TextProperty.jsx';
// svg
export { default as SVG } from './svg/SVG.jsx';
diff --git a/ShadowEditor.Web/src/ui/property/DisplayProperty.jsx b/ShadowEditor.Web/src/ui/property/DisplayProperty.jsx
new file mode 100644
index 00000000..92195e7e
--- /dev/null
+++ b/ShadowEditor.Web/src/ui/property/DisplayProperty.jsx
@@ -0,0 +1,60 @@
+import './css/DisplayProperty.css';
+import classNames from 'classnames/bind';
+import PropTypes from 'prop-types';
+
+/**
+ * 文本属性
+ * @author tengge / https://github.com/tengge1
+ */
+class DisplayProperty extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+
+ };
+ }
+
+ handleCollapse() {
+
+ }
+
+ render() {
+ const { className, style, data } = this.props;
+
+ return
+ {data.map((group, i) => {
+ return
+
+
+ {group.children.map((item, j) => {
+ return
+
{item.label}
+
{item.value}
+
;
+ })}
+
+
;
+ })}
+
;
+ }
+}
+
+DisplayProperty.propTypes = {
+ className: PropTypes.string,
+ style: PropTypes.object,
+ data: PropTypes.array,
+};
+
+DisplayProperty.defaultProps = {
+ className: null,
+ style: null,
+ data: [],
+};
+
+export default DisplayProperty;
\ No newline at end of file
diff --git a/ShadowEditor.Web/src/ui/property/css/DisplayProperty.css b/ShadowEditor.Web/src/ui/property/css/DisplayProperty.css
new file mode 100644
index 00000000..e69de29b