-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 80ae5b4
Showing
668 changed files
with
170,965 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* /Components/GeneralFtl.razor.rz.scp.css */ | ||
.calculator-general-root-mobile[b-m1mg4bpcrb] { | ||
display: none; | ||
} | ||
|
||
@media screen and (max-width: 420px) { | ||
.calculator-general-root-default[b-m1mg4bpcrb] { | ||
display: none; | ||
} | ||
|
||
.calculator-general-root-mobile[b-m1mg4bpcrb] { | ||
display: block; | ||
} | ||
} | ||
/* /Components/GeneralFtlComponents/GeneralFtlAdvanced.razor.rz.scp.css */ | ||
/* /Components/GeneralFtlComponents/GeneralFtlGeneral.razor.rz.scp.css */ | ||
/* /Components/GeneralFtlComponents/GeneralFtlSettings.razor.rz.scp.css */ | ||
/* /Pages/Index.razor.rz.scp.css */ | ||
|
||
/* /Shared/MainLayout.razor.rz.scp.css */ | ||
.page[b-ob7wcsdkcb] { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.main[b-ob7wcsdkcb] { | ||
flex: 1; | ||
} | ||
|
||
.sidebar[b-ob7wcsdkcb] { | ||
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); | ||
} | ||
|
||
.top-row[b-ob7wcsdkcb] { | ||
background-color: #f7f7f7; | ||
border-bottom: 1px solid #d6d5d5; | ||
justify-content: flex-end; | ||
height: 3.5rem; | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.top-row[b-ob7wcsdkcb] a, .top-row .btn-link[b-ob7wcsdkcb] { | ||
white-space: nowrap; | ||
margin-left: 1.5rem; | ||
} | ||
|
||
.top-row a:first-child[b-ob7wcsdkcb] { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
@media (max-width: 640.98px) { | ||
.top-row:not(.auth)[b-ob7wcsdkcb] { | ||
display: none; | ||
} | ||
|
||
.top-row.auth[b-ob7wcsdkcb] { | ||
justify-content: space-between; | ||
} | ||
|
||
.top-row a[b-ob7wcsdkcb], .top-row .btn-link[b-ob7wcsdkcb] { | ||
margin-left: 0; | ||
} | ||
} | ||
|
||
@media (min-width: 641px) { | ||
.page[b-ob7wcsdkcb] { | ||
flex-direction: row; | ||
} | ||
|
||
.sidebar[b-ob7wcsdkcb] { | ||
width: 250px; | ||
height: 100vh; | ||
position: sticky; | ||
top: 0; | ||
} | ||
|
||
.top-row[b-ob7wcsdkcb] { | ||
position: sticky; | ||
top: 0; | ||
z-index: 1; | ||
} | ||
|
||
.main > div[b-ob7wcsdkcb] { | ||
padding-left: 2rem !important; | ||
padding-right: 1.5rem !important; | ||
} | ||
} | ||
/* /Shared/SharedHeader.razor.rz.scp.css */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export function beforeWebStart() { | ||
loadScriptAndStyle(); | ||
} | ||
|
||
export function beforeStart(options, extensions) { | ||
loadScriptAndStyle(); | ||
} | ||
|
||
function loadScriptAndStyle() { | ||
const interopJS = "_content/AntDesign.Charts/ant-design-charts-blazor.js"; | ||
const cdnJS = "https://unpkg.com/@antv/[email protected]/dist/g2plot.min.js"; | ||
const localJS = "_content/AntDesign.Charts/g2plot.min.js"; | ||
const cdnFlag = document.querySelector('[use-ant-design-charts-cdn]'); | ||
|
||
if (!document.querySelector(`[src="${interopJS}"]`)) { | ||
const chartJS = cdnFlag ? cdnJS : localJS; | ||
const chartScript = document.createElement('script'); | ||
chartScript.setAttribute('src', chartJS); | ||
|
||
const jsMark = document.querySelector("script"); | ||
if (jsMark) { | ||
jsMark.before(chartScript); | ||
} | ||
else { | ||
document.body.appendChild(chartScript); | ||
} | ||
|
||
const interopScript = document.createElement('script'); | ||
interopScript.setAttribute('src', interopJS); | ||
chartScript.after(interopScript); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
// This file is to show how a library package may provide JavaScript interop features | ||
// wrapped in a .NET API | ||
|
||
window.AntDesignCharts = { | ||
interop: { | ||
create: (type, domRef, domId, chartRef, csConfig, others, jsonConfig, jsConfig) => { | ||
domRef.innerHTML = ''; | ||
|
||
let config = {} | ||
|
||
removeNullItem(csConfig); | ||
deepObjectMerge(config, csConfig); | ||
|
||
removeNullItem(others); | ||
deepObjectMerge(config, others); | ||
|
||
if (jsonConfig != undefined) { | ||
let jsonConfigObj = JSON.parse(jsonConfig); | ||
removeNullItem(jsonConfigObj); | ||
deepObjectMerge(config, jsonConfigObj); | ||
} | ||
|
||
if (jsConfig != undefined) { | ||
let jsConfigObj = eval("(" + jsConfig + ")"); | ||
removeNullItem(jsConfigObj); | ||
deepObjectMerge(config, jsConfigObj); | ||
} | ||
|
||
try { | ||
const plot = new G2Plot[type](domRef, config); | ||
|
||
plot.on('afterrender', (e) => { | ||
chartRef.invokeMethodAsync('AfterChartRender') | ||
}); | ||
|
||
plot.on('beforedestroy', (e) => { | ||
chartRef.dispose(); | ||
}); | ||
|
||
plot.render(); | ||
window.AntDesignCharts.chartsContainer[domId] = plot; | ||
console.log("create:" + domId) | ||
console.log("type:" + type); | ||
console.log("config:" + JSON.stringify(config, null, 2)); | ||
} catch (err) { | ||
console.error(err, config); | ||
} | ||
}, | ||
destroy(domId) { | ||
//console.log("destroy:" + domId); | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].destroy(); | ||
delete window.AntDesignCharts.chartsContainer[domId]; | ||
}, | ||
render(domId) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].render(); | ||
}, | ||
repaint(domId) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].repaint(); | ||
}, | ||
updateConfig(domId, config, others, all) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
removeNullItem(config) | ||
deepObjectMerge(config, others) | ||
window.AntDesignCharts.chartsContainer[domId].updateConfig(config, all); | ||
window.AntDesignCharts.chartsContainer[domId].render(); | ||
}, | ||
changeData(domId, data, all) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].changeData(data, all); | ||
}, | ||
setActive(domId, condition, style) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].setActive(condition, style); | ||
}, | ||
setSelected(domId, condition, style) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].setSelected(condition, style); | ||
}, | ||
setDisable(domId, condition, style) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].setDisable(condition, style); | ||
}, | ||
setDefault(domId, condition, style) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
window.AntDesignCharts.chartsContainer[domId].setDefault(condition, style); | ||
}, | ||
|
||
setEvent(domId, event, dotnetHelper, func) { | ||
if (window.AntDesignCharts.chartsContainer[domId] == undefined) return; | ||
|
||
console.log("setEvent"); | ||
window.AntDesignCharts.chartsContainer[domId].on(event, ev => { | ||
let e = {}; | ||
for (let attr in ev) { | ||
if (typeof ev[attr] !== "function" && typeof ev[attr] !== "object") { | ||
e[attr] = ev[attr]; | ||
} | ||
} | ||
dotnetHelper.invokeMethodAsync(func, e); | ||
}) | ||
}, | ||
|
||
getEvalJson(jsCode) { | ||
let jsObj = eval("(" + jsCode + ")"); | ||
return JSON.stringify(jsObj); | ||
} | ||
}, | ||
chartsContainer: {} | ||
} | ||
|
||
|
||
//清除没有赋值的项 | ||
function isEmptyObj(o) { | ||
for (let attr in o) return !1; | ||
return !0 | ||
} | ||
|
||
function processArray(arr) { | ||
for (let i = arr.length - 1; i >= 0; i--) { | ||
if (arr[i] === null || arr[i] === undefined) arr.splice(i, 1); | ||
else if (typeof arr[i] == 'object') removeNullItem(arr[i], arr, i); | ||
} | ||
return arr.length == 0 | ||
} | ||
|
||
function proccessObject(o) { | ||
for (let attr in o) { | ||
if (o[attr] === null || o[attr] === undefined) delete o[attr]; | ||
else if (typeof o[attr] == 'object') { | ||
removeNullItem(o[attr]); | ||
if (isEmptyObj(o[attr]) && attr!="data") delete o[attr]; | ||
} | ||
} | ||
} | ||
|
||
function removeNullItem(o, arr, i) { | ||
let s = ({}).toString.call(o); | ||
if (s == '[object Array]') { | ||
if (processArray(o) === true) { //o也是数组,并且删除完子项,从所属数组中删除 | ||
if (arr) arr.splice(i, 1); | ||
} | ||
} else if (s == '[object Object]') { | ||
proccessObject(o); | ||
if (arr && isEmptyObj(o)) arr.splice(i, 1); | ||
} | ||
} | ||
|
||
// 深度合并对象 | ||
function deepObjectMerge(source, target) { | ||
for (var key in target) { | ||
if (source[key] && source[key].toString() === "[object Object]") { | ||
deepObjectMerge(source[key], target[key]) | ||
} else { | ||
source[key] = target[key] | ||
} | ||
} | ||
return source; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var beforeStartCalled = false; | ||
var afterStartedCalled = false; | ||
|
||
export function beforeWebStart() { | ||
loadScriptAndStyle(); | ||
} | ||
|
||
export function beforeStart(options, extensions) { | ||
loadScriptAndStyle(); | ||
} | ||
|
||
function loadScriptAndStyle() { | ||
if (beforeStartCalled) { | ||
return; | ||
} | ||
|
||
beforeStartCalled = true; | ||
|
||
if (!document.querySelector('[src$="_content/AntDesign/js/ant-design-blazor.js"]') && !document.querySelector('[no-antblazor-js]')) { | ||
var customScript = document.createElement('script'); | ||
customScript.setAttribute('src', '_content/AntDesign/js/ant-design-blazor.js'); | ||
const jsmark = document.querySelector('[antblazor-js]') || document.querySelector('script'); | ||
|
||
if (jsmark) { | ||
jsmark.before(customScript); | ||
} else { | ||
document.body.appendChild(customScript); | ||
} | ||
} | ||
|
||
if (!document.querySelector('[href*="_content/AntDesign/css/ant-design-blazor"]') && !document.querySelector('[no-antblazor-css]')) { | ||
var customStyle = document.createElement('link'); | ||
customStyle.setAttribute('href', `_content/AntDesign/css/ant-design-blazor.css`); | ||
customStyle.setAttribute('rel', 'stylesheet'); | ||
|
||
const cssMark = document.querySelector('[antblazor-css]') || document.querySelector('link'); | ||
if (cssMark) { | ||
cssMark.before(customStyle); | ||
} else { | ||
document.head.appendChild(customStyle); | ||
} | ||
} | ||
} |
Oops, something went wrong.