mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
固定 prettier 版本,并重新格式化文件 (#1273)
This commit is contained in:
parent
bc5b6e38b6
commit
50080bebce
@ -1,219 +1,219 @@
|
||||
export default {
|
||||
$schema: "https://houtai.baidu.com/v2/schemas/page.json#",
|
||||
title: "增删改查示例",
|
||||
remark: "bla bla bla",
|
||||
$schema: 'https://houtai.baidu.com/v2/schemas/page.json#',
|
||||
title: '增删改查示例',
|
||||
remark: 'bla bla bla',
|
||||
body: {
|
||||
type: "crud",
|
||||
api: "/api/sample",
|
||||
type: 'crud',
|
||||
api: '/api/sample',
|
||||
// api: "/api/mock2/crud/table?waitSeconds=100000",
|
||||
mode: "cards",
|
||||
mode: 'cards',
|
||||
defaultParams: {
|
||||
perPage: 12
|
||||
},
|
||||
// fixAlignment: true,
|
||||
// masonryLayout: true,
|
||||
filter: {
|
||||
title: "条件搜索",
|
||||
submitText: "",
|
||||
title: '条件搜索',
|
||||
submitText: '',
|
||||
controls: [
|
||||
{
|
||||
type: "text",
|
||||
name: "keywords",
|
||||
placeholder: "通过关键字搜索",
|
||||
type: 'text',
|
||||
name: 'keywords',
|
||||
placeholder: '通过关键字搜索',
|
||||
addOn: {
|
||||
label: "搜索",
|
||||
type: "submit"
|
||||
label: '搜索',
|
||||
type: 'submit'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "plain",
|
||||
text: "这只是个示例, 目前搜索对查询结果无效."
|
||||
type: 'plain',
|
||||
text: '这只是个示例, 目前搜索对查询结果无效.'
|
||||
}
|
||||
]
|
||||
},
|
||||
bulkActions: [
|
||||
{
|
||||
label: "批量删除",
|
||||
actionType: "ajax",
|
||||
api: "delete:/api/sample/${ids|raw}",
|
||||
confirmText: "确定要批量删除?"
|
||||
label: '批量删除',
|
||||
actionType: 'ajax',
|
||||
api: 'delete:/api/sample/${ids|raw}',
|
||||
confirmText: '确定要批量删除?'
|
||||
},
|
||||
{
|
||||
label: "批量修改",
|
||||
actionType: "dialog",
|
||||
label: '批量修改',
|
||||
actionType: 'dialog',
|
||||
dialog: {
|
||||
title: "批量编辑",
|
||||
name: "sample-bulk-edit",
|
||||
title: '批量编辑',
|
||||
name: 'sample-bulk-edit',
|
||||
body: {
|
||||
type: "form",
|
||||
api: "/api/sample/bulkUpdate2",
|
||||
type: 'form',
|
||||
api: '/api/sample/bulkUpdate2',
|
||||
controls: [
|
||||
{
|
||||
type: "hidden",
|
||||
name: "ids"
|
||||
type: 'hidden',
|
||||
name: 'ids'
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
name: "engine",
|
||||
label: "Engine"
|
||||
type: 'text',
|
||||
name: 'engine',
|
||||
label: 'Engine'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
quickSaveApi: "/api/sample/bulkUpdate",
|
||||
quickSaveItemApi: "/api/sample/$id",
|
||||
quickSaveApi: '/api/sample/bulkUpdate',
|
||||
quickSaveItemApi: '/api/sample/$id',
|
||||
draggable: true,
|
||||
card: {
|
||||
header: {
|
||||
title: "$engine",
|
||||
subTitle: "$platform",
|
||||
subTitlePlaceholder: "暂无说明",
|
||||
title: '$engine',
|
||||
subTitle: '$platform',
|
||||
subTitlePlaceholder: '暂无说明',
|
||||
avatar:
|
||||
'<%= data.avatar || "https://internal-amis-res.cdn.bcebos.com/images/2019-12/1575350573496/4873dbfaf6a5.png" %>',
|
||||
avatarClassName: "pull-left thumb b-3x m-r"
|
||||
avatarClassName: 'pull-left thumb b-3x m-r'
|
||||
},
|
||||
actions: [
|
||||
{
|
||||
type: "button",
|
||||
label: "查看",
|
||||
actionType: "dialog",
|
||||
type: 'button',
|
||||
label: '查看',
|
||||
actionType: 'dialog',
|
||||
dialog: {
|
||||
title: "查看",
|
||||
title: '查看',
|
||||
body: {
|
||||
type: "form",
|
||||
type: 'form',
|
||||
controls: [
|
||||
{
|
||||
type: "static",
|
||||
name: "engine",
|
||||
label: "Engine"
|
||||
type: 'static',
|
||||
name: 'engine',
|
||||
label: 'Engine'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "static",
|
||||
name: "browser",
|
||||
label: "Browser"
|
||||
type: 'static',
|
||||
name: 'browser',
|
||||
label: 'Browser'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "static",
|
||||
name: "platform",
|
||||
label: "Platform(s)"
|
||||
type: 'static',
|
||||
name: 'platform',
|
||||
label: 'Platform(s)'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "static",
|
||||
name: "version",
|
||||
label: "Engine version"
|
||||
type: 'static',
|
||||
name: 'version',
|
||||
label: 'Engine version'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "static",
|
||||
name: "grade",
|
||||
label: "CSS grade"
|
||||
type: 'static',
|
||||
name: 'grade',
|
||||
label: 'CSS grade'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "html",
|
||||
type: 'html',
|
||||
html:
|
||||
"<p>添加其他 <span>Html 片段</span> 需要支持变量替换(todo).</p>"
|
||||
'<p>添加其他 <span>Html 片段</span> 需要支持变量替换(todo).</p>'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
label: "编辑",
|
||||
actionType: "dialog",
|
||||
type: 'button',
|
||||
label: '编辑',
|
||||
actionType: 'dialog',
|
||||
dialog: {
|
||||
title: "编辑",
|
||||
title: '编辑',
|
||||
body: {
|
||||
type: "form",
|
||||
name: "sample-edit-form",
|
||||
api: "/api/sample/$id",
|
||||
type: 'form',
|
||||
name: 'sample-edit-form',
|
||||
api: '/api/sample/$id',
|
||||
controls: [
|
||||
{
|
||||
type: "text",
|
||||
name: "engine",
|
||||
label: "Engine",
|
||||
type: 'text',
|
||||
name: 'engine',
|
||||
label: 'Engine',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
name: "browser",
|
||||
label: "Browser",
|
||||
type: 'text',
|
||||
name: 'browser',
|
||||
label: 'Browser',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
name: "platform",
|
||||
label: "Platform(s)",
|
||||
type: 'text',
|
||||
name: 'platform',
|
||||
label: 'Platform(s)',
|
||||
required: true
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
name: "version",
|
||||
label: "Engine version"
|
||||
type: 'text',
|
||||
name: 'version',
|
||||
label: 'Engine version'
|
||||
},
|
||||
{
|
||||
type: "divider"
|
||||
type: 'divider'
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
name: "grade",
|
||||
label: "CSS grade"
|
||||
type: 'text',
|
||||
name: 'grade',
|
||||
label: 'CSS grade'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
label: "删除",
|
||||
actionType: "ajax",
|
||||
confirmText: "您确认要删除?",
|
||||
api: "delete:/api/sample/$id"
|
||||
type: 'button',
|
||||
label: '删除',
|
||||
actionType: 'ajax',
|
||||
confirmText: '您确认要删除?',
|
||||
api: 'delete:/api/sample/$id'
|
||||
}
|
||||
],
|
||||
body: [
|
||||
{
|
||||
name: "engine",
|
||||
label: "engine",
|
||||
name: 'engine',
|
||||
label: 'engine',
|
||||
sortable: true,
|
||||
quickEdit: true
|
||||
},
|
||||
{
|
||||
name: "browser",
|
||||
label: "Browser"
|
||||
name: 'browser',
|
||||
label: 'Browser'
|
||||
},
|
||||
{
|
||||
name: "platform",
|
||||
label: "Platform"
|
||||
name: 'platform',
|
||||
label: 'Platform'
|
||||
},
|
||||
{
|
||||
name: "version",
|
||||
label: "version"
|
||||
name: 'version',
|
||||
label: 'version'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
export default {
|
||||
type: "page",
|
||||
title: "轮播图",
|
||||
type: 'page',
|
||||
title: '轮播图',
|
||||
data: {
|
||||
carousel0: [
|
||||
"https://hiphotos.baidu.com/fex/%70%69%63/item/bd3eb13533fa828b13b24500f31f4134960a5a44.jpg",
|
||||
"https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png",
|
||||
"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
||||
'https://hiphotos.baidu.com/fex/%70%69%63/item/bd3eb13533fa828b13b24500f31f4134960a5a44.jpg',
|
||||
'https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png',
|
||||
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg'
|
||||
],
|
||||
carousel1: [
|
||||
{
|
||||
@ -14,29 +14,29 @@ export default {
|
||||
},
|
||||
{
|
||||
image:
|
||||
"https://hiphotos.baidu.com/fex/%70%69%63/item/bd3eb13533fa828b13b24500f31f4134960a5a44.jpg"
|
||||
'https://hiphotos.baidu.com/fex/%70%69%63/item/bd3eb13533fa828b13b24500f31f4134960a5a44.jpg'
|
||||
},
|
||||
{
|
||||
image:
|
||||
"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
||||
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg'
|
||||
}
|
||||
]
|
||||
},
|
||||
body: [
|
||||
{
|
||||
type: "grid",
|
||||
type: 'grid',
|
||||
columns: [
|
||||
{
|
||||
type: "panel",
|
||||
title: "直接页面配置",
|
||||
type: 'panel',
|
||||
title: '直接页面配置',
|
||||
body: {
|
||||
type: "carousel",
|
||||
controlsTheme: "light",
|
||||
height: "300",
|
||||
type: 'carousel',
|
||||
controlsTheme: 'light',
|
||||
height: '300',
|
||||
options: [
|
||||
{
|
||||
image:
|
||||
"https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png"
|
||||
'https://internal-amis-res.cdn.bcebos.com/images/2019-12/1577157239810/da6376bf988c.png'
|
||||
},
|
||||
{
|
||||
html:
|
||||
@ -44,21 +44,21 @@ export default {
|
||||
},
|
||||
{
|
||||
image:
|
||||
"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg"
|
||||
'https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3893101144,2877209892&fm=23&gp=0.jpg'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "panel",
|
||||
title: "使用itemSchema配置",
|
||||
type: 'panel',
|
||||
title: '使用itemSchema配置',
|
||||
body: {
|
||||
type: "carousel",
|
||||
name: "carousel0",
|
||||
controlsTheme: "dark",
|
||||
height: "300",
|
||||
type: 'carousel',
|
||||
name: 'carousel0',
|
||||
controlsTheme: 'dark',
|
||||
height: '300',
|
||||
itemSchema: {
|
||||
type: "tpl",
|
||||
type: 'tpl',
|
||||
tpl:
|
||||
'<div style="height: 100%; background-image: url(<%=data.item%>); background-position: center center; background-size: cover;"></div>'
|
||||
}
|
||||
@ -67,20 +67,20 @@ export default {
|
||||
]
|
||||
},
|
||||
{
|
||||
type: "grid",
|
||||
type: 'grid',
|
||||
columns: [
|
||||
{
|
||||
type: "form",
|
||||
title: "表单内展示",
|
||||
type: 'form',
|
||||
title: '表单内展示',
|
||||
sm: 6,
|
||||
controls: [
|
||||
{
|
||||
type: "carousel",
|
||||
controlsTheme: "dark",
|
||||
name: "carousel1",
|
||||
label: "carousel",
|
||||
animation: "slide",
|
||||
height: "300"
|
||||
type: 'carousel',
|
||||
controlsTheme: 'dark',
|
||||
name: 'carousel1',
|
||||
label: 'carousel',
|
||||
animation: 'slide',
|
||||
height: '300'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -582,8 +582,8 @@ export default {
|
||||
name: 'year-month',
|
||||
inline: true,
|
||||
label: '年月',
|
||||
"value": "-1month",
|
||||
"inputFormat": "YYYY-MM"
|
||||
value: '-1month',
|
||||
inputFormat: 'YYYY-MM'
|
||||
},
|
||||
{
|
||||
type: 'divider'
|
||||
@ -593,8 +593,8 @@ export default {
|
||||
name: 'month',
|
||||
inline: true,
|
||||
label: '月份',
|
||||
"value": "-1month",
|
||||
"inputFormat": "MM"
|
||||
value: '-1month',
|
||||
inputFormat: 'MM'
|
||||
},
|
||||
{
|
||||
type: 'divider'
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@ if (!Element.prototype.matches) {
|
||||
}
|
||||
|
||||
if (!Element.prototype.closest) {
|
||||
Element.prototype.closest = function(s) {
|
||||
Element.prototype.closest = function (s) {
|
||||
var el = this;
|
||||
if (!document.documentElement.contains(el)) {
|
||||
return null;
|
||||
|
193
fis-conf.js
193
fis-conf.js
@ -113,24 +113,23 @@ fis.match('/docs/**.md', {
|
||||
parser: [
|
||||
parserMarkdown,
|
||||
function (contents, file) {
|
||||
return contents.replace(/\bhref=\\('|")(.+?)\\\1/g, function (
|
||||
_,
|
||||
quota,
|
||||
link
|
||||
) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
return contents.replace(
|
||||
/\bhref=\\('|")(.+?)\\\1/g,
|
||||
function (_, quota, link) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path.resolve(path.dirname(file.subpath), parts[0]);
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path.resolve(path.dirname(file.subpath), parts[0]);
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
return _;
|
||||
}
|
||||
|
||||
return _;
|
||||
});
|
||||
);
|
||||
}
|
||||
],
|
||||
isMod: true
|
||||
@ -216,26 +215,25 @@ fis.media('dev').match('_*.scss', {
|
||||
parser: [
|
||||
parserCodeMarkdown,
|
||||
function (contents, file) {
|
||||
return contents.replace(/\bhref=\\('|")(.+?)\\\1/g, function (
|
||||
_,
|
||||
quota,
|
||||
link
|
||||
) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
return contents.replace(
|
||||
/\bhref=\\('|")(.+?)\\\1/g,
|
||||
function (_, quota, link) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path
|
||||
.resolve(path.dirname(file.subpath), parts[0])
|
||||
.replace(/^\/docs/, '');
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path
|
||||
.resolve(path.dirname(file.subpath), parts[0])
|
||||
.replace(/^\/docs/, '');
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
return _;
|
||||
}
|
||||
|
||||
return _;
|
||||
});
|
||||
);
|
||||
}
|
||||
],
|
||||
release: '$0',
|
||||
@ -285,20 +283,19 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
}),
|
||||
function (contents) {
|
||||
return contents
|
||||
.replace(/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g, function (
|
||||
_,
|
||||
quote,
|
||||
value
|
||||
) {
|
||||
let str = quote + value + quote;
|
||||
return (
|
||||
'(function(){try {return __uri(' +
|
||||
str +
|
||||
')} catch(e) {return ' +
|
||||
str +
|
||||
'}})()'
|
||||
);
|
||||
})
|
||||
.replace(
|
||||
/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g,
|
||||
function (_, quote, value) {
|
||||
let str = quote + value + quote;
|
||||
return (
|
||||
'(function(){try {return __uri(' +
|
||||
str +
|
||||
')} catch(e) {return ' +
|
||||
str +
|
||||
'}})()'
|
||||
);
|
||||
}
|
||||
)
|
||||
.replace(
|
||||
/return\s+(tslib_\d+)\.__importStar\(require\(('|")(.*?)\2\)\);/g,
|
||||
function (_, tslib, quto, value) {
|
||||
@ -580,24 +577,25 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
parser: [
|
||||
parserMarkdown,
|
||||
function (contents, file) {
|
||||
return contents.replace(/\bhref=\\('|")(.+?)\\\1/g, function (
|
||||
_,
|
||||
quota,
|
||||
link
|
||||
) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
return contents.replace(
|
||||
/\bhref=\\('|")(.+?)\\\1/g,
|
||||
function (_, quota, link) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path.resolve(path.dirname(file.subpath), parts[0]);
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path.resolve(path.dirname(file.subpath), parts[0]);
|
||||
}
|
||||
|
||||
return (
|
||||
'href=\\' + quota + '/amis' + parts.join('#') + '\\' + quota
|
||||
);
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + '/amis' + parts.join('#') + '\\' + quota;
|
||||
return _;
|
||||
}
|
||||
|
||||
return _;
|
||||
});
|
||||
);
|
||||
}
|
||||
]
|
||||
});
|
||||
@ -606,26 +604,25 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
parser: [
|
||||
parserCodeMarkdown,
|
||||
function (contents, file) {
|
||||
return contents.replace(/\bhref=\\('|")(.+?)\\\1/g, function (
|
||||
_,
|
||||
quota,
|
||||
link
|
||||
) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
return contents.replace(
|
||||
/\bhref=\\('|")(.+?)\\\1/g,
|
||||
function (_, quota, link) {
|
||||
if (/\.md($|#)/.test(link) && !/^https?\:/.test(link)) {
|
||||
let parts = link.split('#');
|
||||
parts[0] = parts[0].replace('.md', '');
|
||||
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path
|
||||
.resolve(path.dirname(file.subpath), parts[0])
|
||||
.replace(/^\/docs/, '/amis');
|
||||
if (parts[0][0] !== '/') {
|
||||
parts[0] = path
|
||||
.resolve(path.dirname(file.subpath), parts[0])
|
||||
.replace(/^\/docs/, '/amis');
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
}
|
||||
|
||||
return 'href=\\' + quota + parts.join('#') + '\\' + quota;
|
||||
return _;
|
||||
}
|
||||
|
||||
return _;
|
||||
});
|
||||
);
|
||||
}
|
||||
],
|
||||
isMod: true,
|
||||
@ -757,18 +754,17 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
DocCSS.getContent(),
|
||||
ExampleJs.getContent()
|
||||
].join('\n');
|
||||
source.replace(/\bpath\b\s*\:\s*('|")(.*?)\1/g, function (
|
||||
_,
|
||||
qutoa,
|
||||
path
|
||||
) {
|
||||
if (path === '*') {
|
||||
return;
|
||||
}
|
||||
source.replace(
|
||||
/\bpath\b\s*\:\s*('|")(.*?)\1/g,
|
||||
function (_, qutoa, path) {
|
||||
if (path === '*') {
|
||||
return;
|
||||
}
|
||||
|
||||
pages.push(path.replace(/^\//, ''));
|
||||
return _;
|
||||
});
|
||||
pages.push(path.replace(/^\//, ''));
|
||||
return _;
|
||||
}
|
||||
);
|
||||
|
||||
const contents = indexHtml.getContent();
|
||||
pages.forEach(function (path) {
|
||||
@ -825,20 +821,19 @@ if (fis.project.currentMedia() === 'publish') {
|
||||
|
||||
function (contents) {
|
||||
return contents
|
||||
.replace(/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g, function (
|
||||
_,
|
||||
quote,
|
||||
value
|
||||
) {
|
||||
let str = quote + value + quote;
|
||||
return (
|
||||
'(function(){try {return __uri(' +
|
||||
str +
|
||||
')} catch(e) {return ' +
|
||||
str +
|
||||
'}})()'
|
||||
);
|
||||
})
|
||||
.replace(
|
||||
/(?:\w+\.)?\b__uri\s*\(\s*('|")(.*?)\1\s*\)/g,
|
||||
function (_, quote, value) {
|
||||
let str = quote + value + quote;
|
||||
return (
|
||||
'(function(){try {return __uri(' +
|
||||
str +
|
||||
')} catch(e) {return ' +
|
||||
str +
|
||||
'}})()'
|
||||
);
|
||||
}
|
||||
)
|
||||
.replace(
|
||||
/return\s+(tslib_\d+)\.__importStar\(require\(('|")(.*?)\2\)\);/g,
|
||||
function (_, tslib, quto, value) {
|
||||
|
@ -154,7 +154,7 @@
|
||||
"postcss": "^8.2.1",
|
||||
"postcss-cli": "^8.3.1",
|
||||
"postcss-custom-properties": "^10.0.0",
|
||||
"prettier": "^2.0.5",
|
||||
"prettier": "2.2.1",
|
||||
"prismjs": "^1.20.0",
|
||||
"react-frame-component": "^2.0.0",
|
||||
"react-router": "3.2.0",
|
||||
|
@ -41,7 +41,7 @@ export default class SizeAndPositionManager {
|
||||
updateConfig({
|
||||
itemCount,
|
||||
itemSizeGetter,
|
||||
estimatedItemSize,
|
||||
estimatedItemSize
|
||||
}: Partial<Options>) {
|
||||
if (itemCount != null) {
|
||||
this.itemCount = itemCount;
|
||||
@ -67,7 +67,7 @@ export default class SizeAndPositionManager {
|
||||
getSizeAndPositionForIndex(index: number) {
|
||||
if (index < 0 || index >= this.itemCount) {
|
||||
throw Error(
|
||||
`Requested index ${index} is outside of range 0..${this.itemCount}`,
|
||||
`Requested index ${index} is outside of range 0..${this.itemCount}`
|
||||
);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ export default class SizeAndPositionManager {
|
||||
|
||||
this.itemSizeAndPositionData[i] = {
|
||||
offset,
|
||||
size,
|
||||
size
|
||||
};
|
||||
|
||||
offset += size;
|
||||
@ -129,7 +129,7 @@ export default class SizeAndPositionManager {
|
||||
align = ALIGNMENT.START,
|
||||
containerSize,
|
||||
currentOffset,
|
||||
targetIndex,
|
||||
targetIndex
|
||||
}: {
|
||||
align: ALIGNMENT | undefined;
|
||||
containerSize: number;
|
||||
@ -168,7 +168,7 @@ export default class SizeAndPositionManager {
|
||||
getVisibleRange({
|
||||
containerSize,
|
||||
offset,
|
||||
overscanCount,
|
||||
overscanCount
|
||||
}: {
|
||||
containerSize: number;
|
||||
offset: number;
|
||||
@ -204,7 +204,7 @@ export default class SizeAndPositionManager {
|
||||
|
||||
return {
|
||||
start,
|
||||
stop,
|
||||
stop
|
||||
};
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ export default class SizeAndPositionManager {
|
||||
return this.binarySearch({
|
||||
high: lastMeasuredIndex,
|
||||
low: 0,
|
||||
offset,
|
||||
offset
|
||||
});
|
||||
} else {
|
||||
// If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
|
||||
@ -248,7 +248,7 @@ export default class SizeAndPositionManager {
|
||||
// The overall complexity for this approach is O(log n).
|
||||
return this.exponentialSearch({
|
||||
index: lastMeasuredIndex,
|
||||
offset,
|
||||
offset
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -256,7 +256,7 @@ export default class SizeAndPositionManager {
|
||||
private binarySearch({
|
||||
low,
|
||||
high,
|
||||
offset,
|
||||
offset
|
||||
}: {
|
||||
low: number;
|
||||
high: number;
|
||||
@ -299,7 +299,7 @@ export default class SizeAndPositionManager {
|
||||
return this.binarySearch({
|
||||
high: Math.min(index, this.itemCount - 1),
|
||||
low: Math.floor(index / 2),
|
||||
offset,
|
||||
offset
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -2,40 +2,40 @@ export enum ALIGNMENT {
|
||||
AUTO = 'auto',
|
||||
START = 'start',
|
||||
CENTER = 'center',
|
||||
END = 'end',
|
||||
END = 'end'
|
||||
}
|
||||
|
||||
export enum DIRECTION {
|
||||
HORIZONTAL = 'horizontal',
|
||||
VERTICAL = 'vertical',
|
||||
VERTICAL = 'vertical'
|
||||
}
|
||||
|
||||
export enum SCROLL_CHANGE_REASON {
|
||||
OBSERVED = 'observed',
|
||||
REQUESTED = 'requested',
|
||||
REQUESTED = 'requested'
|
||||
}
|
||||
|
||||
export const scrollProp = {
|
||||
[DIRECTION.VERTICAL]: 'scrollTop',
|
||||
[DIRECTION.HORIZONTAL]: 'scrollLeft',
|
||||
[DIRECTION.HORIZONTAL]: 'scrollLeft'
|
||||
};
|
||||
|
||||
export const sizeProp = {
|
||||
[DIRECTION.VERTICAL]: 'height',
|
||||
[DIRECTION.HORIZONTAL]: 'width',
|
||||
[DIRECTION.HORIZONTAL]: 'width'
|
||||
};
|
||||
|
||||
export const positionProp = {
|
||||
[DIRECTION.VERTICAL]: 'top',
|
||||
[DIRECTION.HORIZONTAL]: 'left',
|
||||
[DIRECTION.HORIZONTAL]: 'left'
|
||||
};
|
||||
|
||||
export const marginProp = {
|
||||
[DIRECTION.VERTICAL]: 'marginTop',
|
||||
[DIRECTION.HORIZONTAL]: 'marginLeft',
|
||||
[DIRECTION.HORIZONTAL]: 'marginLeft'
|
||||
};
|
||||
|
||||
export const oppositeMarginProp = {
|
||||
[DIRECTION.VERTICAL]: 'marginBottom',
|
||||
[DIRECTION.HORIZONTAL]: 'marginRight',
|
||||
[DIRECTION.HORIZONTAL]: 'marginRight'
|
||||
};
|
||||
|
@ -8,10 +8,7 @@ import type {TooltipObject, Trigger} from '../components/TooltipWrapper';
|
||||
import {isVisible, noop} from '../utils/helper';
|
||||
import {filter} from '../utils/tpl';
|
||||
import {Icon} from '../components/icons';
|
||||
import {
|
||||
BaseSchema,
|
||||
SchemaClassName
|
||||
} from '../Schema';
|
||||
import {BaseSchema, SchemaClassName} from '../Schema';
|
||||
import {ActionSchema} from './Action';
|
||||
import {DividerSchema} from './Divider';
|
||||
|
||||
@ -111,9 +108,7 @@ export default class DropDownButton extends React.Component<
|
||||
|
||||
static defaultProps: Pick<
|
||||
DropDownButtonProps,
|
||||
| 'placement'
|
||||
| 'tooltipTrigger'
|
||||
| 'tooltipRootClose'
|
||||
'placement' | 'tooltipTrigger' | 'tooltipRootClose'
|
||||
> = {
|
||||
placement: 'top',
|
||||
tooltipTrigger: ['hover', 'focus'],
|
||||
|
@ -35,9 +35,7 @@ export interface ConditionBuilderProps
|
||||
extends FormControlProps,
|
||||
ConditionBuilderControlSchema {}
|
||||
|
||||
export default class ConditionBuilderControl extends React.PureComponent<
|
||||
ConditionBuilderProps
|
||||
> {
|
||||
export default class ConditionBuilderControl extends React.PureComponent<ConditionBuilderProps> {
|
||||
render() {
|
||||
const {className, classnames: cx, ...rest} = this.props;
|
||||
|
||||
|
@ -274,26 +274,26 @@ export const availableLanguages = [
|
||||
'yaml'
|
||||
];
|
||||
|
||||
export const EditorControls: Array<typeof EditorControl> = availableLanguages.map(
|
||||
(lang: string) => {
|
||||
@FormItem({
|
||||
type: `${lang}-editor`,
|
||||
sizeMutable: false
|
||||
})
|
||||
class EditorControlRenderer extends EditorControl {
|
||||
static lang = lang;
|
||||
static displayName = `${lang[0].toUpperCase()}${lang.substring(
|
||||
1
|
||||
)}EditorControlRenderer`;
|
||||
static defaultProps = {
|
||||
...EditorControl.defaultProps,
|
||||
language: lang
|
||||
};
|
||||
}
|
||||
|
||||
return EditorControlRenderer;
|
||||
export const EditorControls: Array<
|
||||
typeof EditorControl
|
||||
> = availableLanguages.map((lang: string) => {
|
||||
@FormItem({
|
||||
type: `${lang}-editor`,
|
||||
sizeMutable: false
|
||||
})
|
||||
class EditorControlRenderer extends EditorControl {
|
||||
static lang = lang;
|
||||
static displayName = `${lang[0].toUpperCase()}${lang.substring(
|
||||
1
|
||||
)}EditorControlRenderer`;
|
||||
static defaultProps = {
|
||||
...EditorControl.defaultProps,
|
||||
language: lang
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
return EditorControlRenderer;
|
||||
});
|
||||
|
||||
@FormItem({
|
||||
type: 'js-editor',
|
||||
|
@ -370,7 +370,7 @@ export default class ImageControl extends React.Component<
|
||||
|
||||
this.state = {
|
||||
...this.state,
|
||||
files: this.files = files,
|
||||
files: (this.files = files),
|
||||
crop: this.buildCrop(props)
|
||||
};
|
||||
|
||||
@ -436,7 +436,7 @@ export default class ImageControl extends React.Component<
|
||||
}
|
||||
|
||||
this.setState({
|
||||
files: this.files = files
|
||||
files: (this.files = files)
|
||||
});
|
||||
}
|
||||
|
||||
@ -522,14 +522,14 @@ export default class ImageControl extends React.Component<
|
||||
{
|
||||
uploading: true,
|
||||
locked: true,
|
||||
files: this.files = this.files.map(file => {
|
||||
files: (this.files = this.files.map(file => {
|
||||
if (retry && file.state === 'error') {
|
||||
file.state = 'pending';
|
||||
file.progress = 0;
|
||||
}
|
||||
|
||||
return file;
|
||||
})
|
||||
}))
|
||||
},
|
||||
this.tick
|
||||
);
|
||||
@ -564,7 +564,7 @@ export default class ImageControl extends React.Component<
|
||||
file.state = 'uploading';
|
||||
this.setState(
|
||||
{
|
||||
files: this.files = this.files.concat()
|
||||
files: (this.files = this.files.concat())
|
||||
},
|
||||
() =>
|
||||
this.sendFile(
|
||||
@ -590,7 +590,7 @@ export default class ImageControl extends React.Component<
|
||||
|
||||
return this.setState(
|
||||
{
|
||||
files: this.files = files,
|
||||
files: (this.files = files),
|
||||
error: error
|
||||
},
|
||||
this.tick
|
||||
@ -608,7 +608,7 @@ export default class ImageControl extends React.Component<
|
||||
this.current = null;
|
||||
this.setState(
|
||||
{
|
||||
files: this.files = files
|
||||
files: (this.files = files)
|
||||
},
|
||||
() => {
|
||||
const sendTo =
|
||||
@ -633,7 +633,7 @@ export default class ImageControl extends React.Component<
|
||||
// file 是个非 File 对象,先不copy了直接改。
|
||||
file.progress = progress;
|
||||
this.setState({
|
||||
files: this.files = files
|
||||
files: (this.files = files)
|
||||
});
|
||||
}
|
||||
)
|
||||
@ -667,7 +667,7 @@ export default class ImageControl extends React.Component<
|
||||
|
||||
this.setState(
|
||||
{
|
||||
files: this.files = files
|
||||
files: (this.files = files)
|
||||
},
|
||||
this.onChange
|
||||
);
|
||||
@ -877,7 +877,7 @@ export default class ImageControl extends React.Component<
|
||||
this.setState(
|
||||
{
|
||||
error: undefined,
|
||||
files: this.files = currentFiles.concat(inputFiles),
|
||||
files: (this.files = currentFiles.concat(inputFiles)),
|
||||
locked: true
|
||||
},
|
||||
() => {
|
||||
@ -1053,7 +1053,7 @@ export default class ImageControl extends React.Component<
|
||||
this.unmounted ||
|
||||
this.setState(
|
||||
{
|
||||
files: this.files = files
|
||||
files: (this.files = files)
|
||||
},
|
||||
!needUploading ? this.onChange : undefined
|
||||
);
|
||||
|
@ -50,9 +50,7 @@ export interface TabsTransferProps
|
||||
@OptionsControl({
|
||||
type: 'tabs-transfer'
|
||||
})
|
||||
export class TabsTransferRenderer extends BaseTransferRenderer<
|
||||
TabsTransferProps
|
||||
> {
|
||||
export class TabsTransferRenderer extends BaseTransferRenderer<TabsTransferProps> {
|
||||
render() {
|
||||
const {
|
||||
className,
|
||||
|
Loading…
Reference in New Issue
Block a user