cosmic-components
Advanced tools
Comparing version 0.0.1-alpha.33 to 0.0.1-alpha.34
@@ -69,3 +69,6 @@ /** | ||
function Col() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
// 标识 Grid 的 Col 组件,便于子组件获取 | ||
_this.isGridCol = true; | ||
return _this; | ||
} | ||
@@ -72,0 +75,0 @@ Col.prototype.initData = function () { |
@@ -69,3 +69,6 @@ /** | ||
function Row() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
// 标识 Grid 的 Row 组件,便于子组件获取 | ||
_this.isGridRow = true; | ||
return _this; | ||
} | ||
@@ -72,0 +75,0 @@ Row.prototype.initData = function () { |
{ | ||
"name": "cosmic-components", | ||
"version": "0.0.1-alpha.33", | ||
"version": "0.0.1-alpha.34", | ||
"main": "./dist/index.js", | ||
@@ -35,7 +35,6 @@ "module": "./src/index.ts", | ||
"scripts": { | ||
"build": "npm run clean && tsc", | ||
"build": "npm run clean && tsc --project ./tsconfig.build.json", | ||
"test": "jest", | ||
"clean": "rimraf dist types" | ||
}, | ||
"readme": "# Cosmic Design Components\n\n一个基于 San 开发的 UI 组件库\n\n## Feature\n- 完全开放的组件样式定制能力\n- 支持多端:移动端、PC端\n- 全面拥抱 TypeScript\n\n## 开发\n\n## 组件开发\n\n- 组件代码目录:`./packages/components`\n- 开发参考`Grid`/`Button`组件\n\n## 组件预览\n\n- 本地预览环境目录:`./site`\n- 预览命令:`npm run dev`\n- [多端预览适配及实现方案](https://ku.baidu-int.com/knowledge/HFVrC7hq1Q/pKzJfZczuc/4XDGXMEGfs/0RPSCLiIOZdmEw) \n\n## 组件单元测试\n使用 [san-test-utils](https://ecomfe.github.io/san-test-utils/index.html) 进行单元测试\n\n## 提交代码\n请使用`npm run commit`,不要使用`git commit`\n" | ||
} | ||
} |
@@ -46,3 +46,3 @@ /** | ||
initData(): BaseData { | ||
initData(): BaseData & {actionSuffix?: string, shouldBatch?: boolean} { | ||
return { | ||
@@ -49,0 +49,0 @@ nativeAttributes: {}, |
@@ -5,2 +5,3 @@ import {BaseProps} from '../Base/interface'; | ||
export interface ButtonProps extends BaseProps { | ||
// @ts-ignore | ||
size?: Size; | ||
@@ -7,0 +8,0 @@ disabled?: boolean; |
@@ -85,2 +85,5 @@ /** | ||
// 标识 Grid 的 Col 组件,便于子组件获取 | ||
isGridCol = true; | ||
initData(): ColData { | ||
@@ -87,0 +90,0 @@ return { |
@@ -114,2 +114,5 @@ /** | ||
// 标识 Grid 的 Row 组件,便于子组件获取 | ||
isGridRow = true; | ||
initData(): RowData { | ||
@@ -116,0 +119,0 @@ return { |
@@ -1,23 +0,38 @@ | ||
// import Base from '../base'; | ||
// import {talos} from '@baidu/talos-san-native'; | ||
/** | ||
* @file Talos Link | ||
* @author liuchaofan | ||
*/ | ||
// export default class Link extends Base { | ||
// static template = ` | ||
// <div | ||
// class="{{styles.link}}" | ||
// s-bind="nativeAttributes" | ||
// on-click="click" | ||
// > | ||
// <slot></slot> | ||
// </div> | ||
// `; | ||
// click(e: Event) { | ||
// this.onClick(e); | ||
// if (!this.data.get('preventDefault')) { | ||
// const params = this.data.get('params'); | ||
// talos.callNative('RNSearchBoxCommand', 'invoke', params.schema); | ||
// } | ||
// } | ||
// } | ||
import Base from '@src/Link/base'; | ||
import {talos} from '@baidu/talos-san-native'; | ||
export default class Link extends Base { | ||
static template = ` | ||
<div | ||
class="{{styles.link}}" | ||
s-bind="nativeAttributes" | ||
on-click="click" | ||
> | ||
<rich-text s-if="hasText" class="{{newStyles.content}}"> | ||
<slot name="text"></slot> | ||
</rich-text> | ||
<slot name="content"></slot> | ||
</div> | ||
`; | ||
click(e: Event) { | ||
this.onClick(e); | ||
if (!this.data.get('preventDefault')) { | ||
const params = this.data.get('params'); | ||
talos.callNative('RNSearchBoxCommand', 'invoke', params.schema); | ||
} | ||
} | ||
initData() { | ||
return Object.assign({}, super.initData(), { | ||
hasText: !!(this as any).sourceSlots.named.text | ||
}); | ||
} | ||
} | ||
@@ -15,3 +15,6 @@ /** | ||
store?: Store; | ||
initData(): BaseData; | ||
initData(): BaseData & { | ||
actionSuffix?: string; | ||
shouldBatch?: boolean; | ||
}; | ||
/** | ||
@@ -18,0 +21,0 @@ * 使用 san 消息机制派发事件 |
@@ -16,3 +16,4 @@ /** | ||
}; | ||
isGridCol: boolean; | ||
initData(): ColData; | ||
} |
@@ -15,3 +15,4 @@ /** | ||
}; | ||
isGridRow: boolean; | ||
initData(): RowData; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
547525
365
9835