mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-23 12:08:32 +00:00
Deploying to gh-pages from @ 0791711b3e2327639d115704c94a97a07407e319 🚀
This commit is contained in:
parent
b8e18ce7bf
commit
20745826d1
86
NftFaucet.styles.css
Normal file
86
NftFaucet.styles.css
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
/* /Components/TextWithIcon.razor.rz.scp.css */
|
||||||
|
.space-item[b-fm17s4ncqy] {
|
||||||
|
align-items: center !important;
|
||||||
|
display: flex !important;
|
||||||
|
}
|
||||||
|
/* /Shared/MainLayout.razor.rz.scp.css */
|
||||||
|
.page[b-kzsihw5sgr] {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main[b-kzsihw5sgr] {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar[b-kzsihw5sgr] {
|
||||||
|
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row[b-kzsihw5sgr] {
|
||||||
|
background-color: #f7f7f7;
|
||||||
|
border-bottom: 1px solid #d6d5d5;
|
||||||
|
justify-content: flex-end;
|
||||||
|
height: 3.5rem;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row[b-kzsihw5sgr] a, .top-row .btn-link[b-kzsihw5sgr] {
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-left: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row a:first-child[b-kzsihw5sgr] {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640.98px) {
|
||||||
|
.top-row:not(.auth)[b-kzsihw5sgr] {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row.auth[b-kzsihw5sgr] {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row a[b-kzsihw5sgr], .top-row .btn-link[b-kzsihw5sgr] {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 641px) {
|
||||||
|
.page[b-kzsihw5sgr] {
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar[b-kzsihw5sgr] {
|
||||||
|
width: 250px;
|
||||||
|
height: 100vh;
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top-row[b-kzsihw5sgr] {
|
||||||
|
position: sticky;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.main > div[b-kzsihw5sgr] {
|
||||||
|
padding-left: 2rem !important;
|
||||||
|
padding-right: 1.5rem !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-nft-header[b-kzsihw5sgr] {
|
||||||
|
padding-top: 0 !important;
|
||||||
|
padding-left: 0 !important;
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.create-nft-header .ant-page-header-heading-title[b-kzsihw5sgr] {
|
||||||
|
color: red;
|
||||||
|
}
|
1
_content/AntDesign/css/ant-design-blazor.aliyun.css
Executable file
1
_content/AntDesign/css/ant-design-blazor.aliyun.css
Executable file
File diff suppressed because one or more lines are too long
1
_content/AntDesign/css/ant-design-blazor.compact.css
Executable file
1
_content/AntDesign/css/ant-design-blazor.compact.css
Executable file
File diff suppressed because one or more lines are too long
1
_content/AntDesign/css/ant-design-blazor.css
Executable file
1
_content/AntDesign/css/ant-design-blazor.css
Executable file
File diff suppressed because one or more lines are too long
1
_content/AntDesign/css/ant-design-blazor.dark.css
Executable file
1
_content/AntDesign/css/ant-design-blazor.dark.css
Executable file
File diff suppressed because one or more lines are too long
2
_content/AntDesign/js/ant-design-blazor.js
Executable file
2
_content/AntDesign/js/ant-design-blazor.js
Executable file
File diff suppressed because one or more lines are too long
1
_content/AntDesign/js/ant-design-blazor.js.map
Executable file
1
_content/AntDesign/js/ant-design-blazor.js.map
Executable file
File diff suppressed because one or more lines are too long
38
_content/AntDesign/js/split/ObservableApi/intersectionObserver.js
Executable file
38
_content/AntDesign/js/split/ObservableApi/intersectionObserver.js
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
import { infoHelper as domInfoHelper } from '../modules/dom/infoHelper';
|
||||||
|
export class intersectionObserver {
|
||||||
|
static create(key, invoker, isDotNetInvoker = true) {
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'IntersectionObserver'
|
||||||
|
let observer;
|
||||||
|
if (isDotNetInvoker) {
|
||||||
|
observer = new IntersectionObserver(mutations => intersectionObserver.observerCallback(mutations, invoker));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
observer = new IntersectionObserver(mutations => invoker(mutations));
|
||||||
|
}
|
||||||
|
intersectionObserver.intersectionObservers.set(key, observer);
|
||||||
|
}
|
||||||
|
static observe(key, element, options) {
|
||||||
|
const observer = intersectionObserver.intersectionObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
let domElement = domInfoHelper.get(element);
|
||||||
|
observer.observe(domElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static disconnect(key) {
|
||||||
|
const observer = this.intersectionObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static dispose(key) {
|
||||||
|
this.disconnect(key);
|
||||||
|
this.intersectionObservers.delete(key);
|
||||||
|
}
|
||||||
|
static observerCallback(mutations, invoker) {
|
||||||
|
//TODO: serialize a proper object (check resizeObserver.ts for sample)
|
||||||
|
const entriesJson = JSON.stringify(mutations);
|
||||||
|
invoker.invokeMethodAsync('Invoke', entriesJson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'IntersectionObserver'
|
||||||
|
intersectionObserver.intersectionObservers = new Map();
|
38
_content/AntDesign/js/split/ObservableApi/mutationObserver.js
Executable file
38
_content/AntDesign/js/split/ObservableApi/mutationObserver.js
Executable file
@ -0,0 +1,38 @@
|
|||||||
|
import { infoHelper as domInfoHelper } from '../modules/dom/infoHelper';
|
||||||
|
export class mutationObserver {
|
||||||
|
static create(key, invoker, isDotNetInvoker = true) {
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'MutationObserver'
|
||||||
|
let observer;
|
||||||
|
if (isDotNetInvoker) {
|
||||||
|
observer = new MutationObserver(mutations => mutationObserver.observerCallback(mutations, invoker));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
observer = new MutationObserver(mutations => invoker(mutations));
|
||||||
|
}
|
||||||
|
mutationObserver.mutationObservers.set(key, observer);
|
||||||
|
}
|
||||||
|
static observe(key, element, options) {
|
||||||
|
const observer = mutationObserver.mutationObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
let domElement = domInfoHelper.get(element);
|
||||||
|
observer.observe(domElement, options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static disconnect(key) {
|
||||||
|
const observer = this.mutationObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static dispose(key) {
|
||||||
|
this.disconnect(key);
|
||||||
|
this.mutationObservers.delete(key);
|
||||||
|
}
|
||||||
|
static observerCallback(mutations, invoker) {
|
||||||
|
//TODO: serialize a proper object (check resizeObserver.ts for sample)
|
||||||
|
const entriesJson = JSON.stringify(mutations);
|
||||||
|
invoker.invokeMethodAsync('Invoke', entriesJson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'MutationObserver'
|
||||||
|
mutationObserver.mutationObservers = new Map();
|
2
_content/AntDesign/js/split/ObservableApi/observableApi.js
Executable file
2
_content/AntDesign/js/split/ObservableApi/observableApi.js
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
export { resizeObserver as resize } from './resizeObserver';
|
||||||
|
export { mutationObserver } from './mutationObserver';
|
83
_content/AntDesign/js/split/ObservableApi/resizeObserver.js
Executable file
83
_content/AntDesign/js/split/ObservableApi/resizeObserver.js
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
import { infoHelper as domInfoHelper } from '../modules/dom/infoHelper';
|
||||||
|
class ResizeObserverEntry {
|
||||||
|
}
|
||||||
|
export class resizeObserver {
|
||||||
|
static isResizeObserverSupported() {
|
||||||
|
return "ResizeObserver" in window;
|
||||||
|
}
|
||||||
|
static create(key, invoker, isDotNetInvoker = true) {
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'ResizeObserver'
|
||||||
|
let observer;
|
||||||
|
if (isDotNetInvoker) {
|
||||||
|
observer = new ResizeObserver((entries, observer) => resizeObserver.observerCallBack(entries, observer, invoker));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
observer = new ResizeObserver((entries, observer) => invoker(entries, observer));
|
||||||
|
}
|
||||||
|
resizeObserver.resizeObservers.set(key, observer);
|
||||||
|
}
|
||||||
|
static observe(key, element) {
|
||||||
|
const observer = resizeObserver.resizeObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
let domElement = domInfoHelper.get(element);
|
||||||
|
observer.observe(domElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static disconnect(key) {
|
||||||
|
const observer = this.resizeObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
observer.disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static unobserve(key, element) {
|
||||||
|
const observer = this.resizeObservers.get(key);
|
||||||
|
if (observer) {
|
||||||
|
let domElement = domInfoHelper.get(element);
|
||||||
|
observer.unobserve(domElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static dispose(key) {
|
||||||
|
this.disconnect(key);
|
||||||
|
this.resizeObservers.delete(key);
|
||||||
|
}
|
||||||
|
static observerCallBack(entries, observer, invoker) {
|
||||||
|
if (invoker) {
|
||||||
|
const mappedEntries = new Array();
|
||||||
|
entries.forEach(entry => {
|
||||||
|
if (entry) {
|
||||||
|
const mEntry = new ResizeObserverEntry();
|
||||||
|
if (entry.borderBoxSize) {
|
||||||
|
mEntry.borderBoxSize = {
|
||||||
|
blockSize: entry.borderBoxSize.blockSize,
|
||||||
|
inlineSize: entry.borderBoxSize.inlineSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (entry.contentBoxSize) {
|
||||||
|
mEntry.contentBoxSize = {
|
||||||
|
blockSize: entry.contentBoxSize.blockSize,
|
||||||
|
inlineSize: entry.contentBoxSize.inlineSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
if (entry.contentRect) {
|
||||||
|
mEntry.contentRect = {
|
||||||
|
x: entry.contentRect.x,
|
||||||
|
y: entry.contentRect.y,
|
||||||
|
width: entry.contentRect.width,
|
||||||
|
height: entry.contentRect.height,
|
||||||
|
top: entry.contentRect.top,
|
||||||
|
right: entry.contentRect.right,
|
||||||
|
bottom: entry.contentRect.bottom,
|
||||||
|
left: entry.contentRect.left
|
||||||
|
};
|
||||||
|
}
|
||||||
|
mEntry.target = entry.target;
|
||||||
|
mappedEntries.push(mEntry);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const entriesJson = JSON.stringify(mappedEntries);
|
||||||
|
invoker.invokeMethodAsync('Invoke', entriesJson);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @ts-ignore: TS2304: Cannot find name 'ResizeObserver'
|
||||||
|
resizeObserver.resizeObservers = new Map();
|
10
_content/AntDesign/js/split/interop.js
Executable file
10
_content/AntDesign/js/split/interop.js
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
export { state } from './modules/stateProvider';
|
||||||
|
import * as observable_1 from './ObservableApi/observableApi';
|
||||||
|
export { observable_1 as observable };
|
||||||
|
export { domInfoHelper, domTypes, domManipulationHelper, eventHelper } from './modules/dom/exports';
|
||||||
|
export { styleHelper } from './modules/styleHelper';
|
||||||
|
export { backtopHelper, iconHelper, inputHelper, mentionsHelper, modalHelper, overlayHelper, tableHelper, uploadHelper } from './modules/components/export';
|
||||||
|
export { enableDraggable, disableDraggable, resetModalPosition } from "./modules/dom/dragHelper";
|
||||||
|
export function log(text) {
|
||||||
|
console.log(text);
|
||||||
|
}
|
12
_content/AntDesign/js/split/modules/components/backtopHelper.js
Executable file
12
_content/AntDesign/js/split/modules/components/backtopHelper.js
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
import { domInfoHelper, domManipulationHelper } from '../dom/exports';
|
||||||
|
export class backtopHelper {
|
||||||
|
static backTop(target) {
|
||||||
|
let dom = domInfoHelper.get(target);
|
||||||
|
if (dom) {
|
||||||
|
domManipulationHelper.slideTo(dom.scrollTop);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
domManipulationHelper.slideTo(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
_content/AntDesign/js/split/modules/components/export.js
Executable file
8
_content/AntDesign/js/split/modules/components/export.js
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
export { backtopHelper } from './backtopHelper';
|
||||||
|
export { overlayHelper } from './overlayHelper';
|
||||||
|
export { uploadHelper } from './uploadHelper';
|
||||||
|
export { mentionsHelper } from './mentionsHelper';
|
||||||
|
export { modalHelper } from './modalHelper';
|
||||||
|
export { inputHelper } from './inputHelper';
|
||||||
|
export { tableHelper } from './tableHelper';
|
||||||
|
export { iconHelper } from './iconHelper';
|
11
_content/AntDesign/js/split/modules/components/iconHelper.js
Executable file
11
_content/AntDesign/js/split/modules/components/iconHelper.js
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
export class iconHelper {
|
||||||
|
static createIconFromfontCN(scriptUrl) {
|
||||||
|
if (document.querySelector(`[data-namespace="${scriptUrl}"]`)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.setAttribute('src', scriptUrl);
|
||||||
|
script.setAttribute('data-namespace', scriptUrl);
|
||||||
|
document.body.appendChild(script);
|
||||||
|
}
|
||||||
|
}
|
95
_content/AntDesign/js/split/modules/components/inputHelper.js
Executable file
95
_content/AntDesign/js/split/modules/components/inputHelper.js
Executable file
@ -0,0 +1,95 @@
|
|||||||
|
import { domInfoHelper } from '../dom/exports';
|
||||||
|
import { state } from '../stateProvider';
|
||||||
|
import { resize } from '../../ObservableApi/observableApi';
|
||||||
|
export class inputHelper {
|
||||||
|
static getTextAreaInfo(element) {
|
||||||
|
var result = {};
|
||||||
|
var dom = domInfoHelper.get(element);
|
||||||
|
if (!dom)
|
||||||
|
return null;
|
||||||
|
result["scrollHeight"] = dom.scrollHeight || 0;
|
||||||
|
if (element.currentStyle) {
|
||||||
|
result["lineHeight"] = parseFloat(element.currentStyle["line-height"]);
|
||||||
|
result["paddingTop"] = parseFloat(element.currentStyle["padding-top"]);
|
||||||
|
result["paddingBottom"] = parseFloat(element.currentStyle["padding-bottom"]);
|
||||||
|
result["borderBottom"] = parseFloat(element.currentStyle["border-bottom"]);
|
||||||
|
result["borderTop"] = parseFloat(element.currentStyle["border-top"]);
|
||||||
|
}
|
||||||
|
else if (window.getComputedStyle) {
|
||||||
|
result["lineHeight"] = parseFloat(document.defaultView.getComputedStyle(element, null).getPropertyValue("line-height"));
|
||||||
|
result["paddingTop"] = parseFloat(document.defaultView.getComputedStyle(element, null).getPropertyValue("padding-top"));
|
||||||
|
result["paddingBottom"] = parseFloat(document.defaultView.getComputedStyle(element, null).getPropertyValue("padding-bottom"));
|
||||||
|
result["borderBottom"] = parseFloat(document.defaultView.getComputedStyle(element, null).getPropertyValue("border-bottom"));
|
||||||
|
result["borderTop"] = parseFloat(document.defaultView.getComputedStyle(element, null).getPropertyValue("border-top"));
|
||||||
|
}
|
||||||
|
//Firefox can return this as NaN, so it has to be handled here like that.
|
||||||
|
if (Object.is(NaN, result["borderTop"]))
|
||||||
|
result["borderTop"] = 1;
|
||||||
|
if (Object.is(NaN, result["borderBottom"]))
|
||||||
|
result["borderBottom"] = 1;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
static registerResizeTextArea(element, minRows, maxRows, objReference) {
|
||||||
|
if (!objReference) {
|
||||||
|
this.disposeResizeTextArea(element);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state.objReferenceDict[element.id] = objReference;
|
||||||
|
state.eventCallbackRegistry[element.id + "input"] = function () { inputHelper.resizeTextArea(element, minRows, maxRows); };
|
||||||
|
element.addEventListener("input", state.eventCallbackRegistry[element.id + "input"]);
|
||||||
|
resize.create(element.id + "-resize", () => {
|
||||||
|
inputHelper.resizeTextArea(element, minRows, maxRows);
|
||||||
|
}, false);
|
||||||
|
resize.observe(element.id + "-resize", element);
|
||||||
|
inputHelper.resizeTextArea(element, minRows, maxRows);
|
||||||
|
element.style.resize = 'none';
|
||||||
|
return this.getTextAreaInfo(element);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static disposeResizeTextArea(element) {
|
||||||
|
element.removeEventListener("input", state.eventCallbackRegistry[element.id + "input"]);
|
||||||
|
resize.unobserve(element.id + "-resize", element);
|
||||||
|
state.objReferenceDict[element.id] = null;
|
||||||
|
state.eventCallbackRegistry[element.id + "input"] = null;
|
||||||
|
}
|
||||||
|
static resizeTextArea(element, minRows, maxRows) {
|
||||||
|
let dims = this.getTextAreaInfo(element);
|
||||||
|
let rowHeight = dims["lineHeight"];
|
||||||
|
let offsetHeight = dims["paddingTop"] + dims["paddingBottom"] + dims["borderTop"] + dims["borderBottom"];
|
||||||
|
let oldHeight = parseFloat(element.style.height);
|
||||||
|
//use rows attribute to evaluate real scroll height
|
||||||
|
let oldRows = element.rows;
|
||||||
|
element.rows = minRows;
|
||||||
|
element.style.height = 'auto';
|
||||||
|
var rows = Math.trunc(element.scrollHeight / rowHeight);
|
||||||
|
element.rows = oldRows;
|
||||||
|
rows = Math.max(minRows, rows);
|
||||||
|
var newHeight = 0;
|
||||||
|
if (rows > maxRows) {
|
||||||
|
rows = maxRows;
|
||||||
|
newHeight = (rows * rowHeight + offsetHeight);
|
||||||
|
element.style.height = newHeight + "px";
|
||||||
|
element.style.overflowY = "visible";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
newHeight = rows * rowHeight + offsetHeight;
|
||||||
|
element.style.height = newHeight + "px";
|
||||||
|
element.style.overflowY = "hidden";
|
||||||
|
}
|
||||||
|
if (oldHeight !== newHeight) {
|
||||||
|
let textAreaObj = state.objReferenceDict[element.id];
|
||||||
|
textAreaObj.invokeMethodAsync("ChangeSizeAsyncJs", element.scrollWidth, newHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static setSelectionStart(element, position) {
|
||||||
|
if (position >= 0) {
|
||||||
|
let dom = domInfoHelper.get(element);
|
||||||
|
if (dom) {
|
||||||
|
if (position <= dom.value.length) {
|
||||||
|
dom.selectionStart = position;
|
||||||
|
dom.selectionEnd = position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
110
_content/AntDesign/js/split/modules/components/mentionsHelper.js
Executable file
110
_content/AntDesign/js/split/modules/components/mentionsHelper.js
Executable file
@ -0,0 +1,110 @@
|
|||||||
|
import { state } from "../stateProvider";
|
||||||
|
export class mentionsHelper {
|
||||||
|
static getCursorXY(element, objReference) {
|
||||||
|
state.objReferenceDict["mentions"] = objReference;
|
||||||
|
window.addEventListener("click", this.mentionsOnWindowClick);
|
||||||
|
const offset = this.getOffset(element);
|
||||||
|
return [offset.left, offset.top + offset.height + 14];
|
||||||
|
}
|
||||||
|
static getOffset(elem) {
|
||||||
|
return (new InputCaret(elem)).getOffset();
|
||||||
|
}
|
||||||
|
static mentionsOnWindowClick(e) {
|
||||||
|
let mentionsObj = state.objReferenceDict["mentions"];
|
||||||
|
if (mentionsObj) {
|
||||||
|
mentionsObj.invokeMethodAsync("CloseMentionsDropDown");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.removeEventListener("click", this.mentionsOnWindowClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class InputCaret {
|
||||||
|
constructor(inputor) {
|
||||||
|
this.getPos = function () {
|
||||||
|
return this.domInputor.selectionStart;
|
||||||
|
};
|
||||||
|
this.getPosition = function (pos) {
|
||||||
|
var domInputor, end_range, format, html, mirror, start_range;
|
||||||
|
domInputor = this.domInputor;
|
||||||
|
format = function (value) {
|
||||||
|
value = value.replace(/<|>|`|"|&/g, '?').replace(/\r\n|\r|\n/g, "<br/>");
|
||||||
|
if (/firefox/i.test(navigator.userAgent)) {
|
||||||
|
value = value.replace(/\s/g, ' ');
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
if (!pos) {
|
||||||
|
pos = this.getPos();
|
||||||
|
}
|
||||||
|
let inputorValue = domInputor.value;
|
||||||
|
start_range = inputorValue.slice(0, pos);
|
||||||
|
end_range = inputorValue.slice(pos);
|
||||||
|
html = "<span style='position: relative; display: inline;'>" + format(start_range) + "</span>";
|
||||||
|
html += "<span id='caret' style='position: relative; display: inline;'>|</span>";
|
||||||
|
html += "<span style='position: relative; display: inline;'>" + format(end_range) + "</span>";
|
||||||
|
mirror = new Mirror(domInputor);
|
||||||
|
return mirror.create(html).rect();
|
||||||
|
};
|
||||||
|
this.getOffset = function (pos = null) {
|
||||||
|
var offset, position, domInputor;
|
||||||
|
domInputor = this.domInputor;
|
||||||
|
var rect = domInputor.getBoundingClientRect();
|
||||||
|
offset = {
|
||||||
|
left: rect.left,
|
||||||
|
top: rect.top
|
||||||
|
};
|
||||||
|
position = this.getPosition(pos);
|
||||||
|
return offset = {
|
||||||
|
left: offset.left + position.left - domInputor.scrollLeft,
|
||||||
|
top: offset.top + position.top - domInputor.scrollTop,
|
||||||
|
height: position.height
|
||||||
|
};
|
||||||
|
};
|
||||||
|
this.domInputor = inputor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Mirror {
|
||||||
|
constructor(inputor) {
|
||||||
|
this.create = function (html) {
|
||||||
|
this.$mirror = document.createElement("div");
|
||||||
|
//TODO: hard coded reference, try to make it more relative
|
||||||
|
window.AntDesign.interop.styleHelper.css(this.$mirror, this.mirrorCss());
|
||||||
|
this.$mirror.innerHTML = html;
|
||||||
|
this.domInputor.parentElement.append(this.$mirror);
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
this.mirrorCss = function () {
|
||||||
|
var css, _this = this;
|
||||||
|
css = {
|
||||||
|
position: 'absolute',
|
||||||
|
left: -9999,
|
||||||
|
top: 0,
|
||||||
|
zIndex: -20000
|
||||||
|
};
|
||||||
|
this.css_attr.push('width');
|
||||||
|
this.css_attr.forEach((p) => {
|
||||||
|
return css[p] = _this.domInputor.style[p]; //_this.$inputor.css(p);
|
||||||
|
});
|
||||||
|
return css;
|
||||||
|
};
|
||||||
|
this.rect = function () {
|
||||||
|
var flag, pos, rect;
|
||||||
|
flag = this.$mirror.querySelector("#caret");
|
||||||
|
var oRect = flag.getBoundingClientRect();
|
||||||
|
pos = {
|
||||||
|
left: flag.offsetLeft,
|
||||||
|
top: flag.offsetTop
|
||||||
|
}; //$flag.position();
|
||||||
|
rect = {
|
||||||
|
left: pos.left,
|
||||||
|
top: pos.top,
|
||||||
|
height: oRect.height
|
||||||
|
};
|
||||||
|
this.$mirror.parentElement.removeChild(this.$mirror);
|
||||||
|
return rect;
|
||||||
|
};
|
||||||
|
this.domInputor = inputor;
|
||||||
|
this.css_attr = [];
|
||||||
|
}
|
||||||
|
}
|
27
_content/AntDesign/js/split/modules/components/modalHelper.js
Executable file
27
_content/AntDesign/js/split/modules/components/modalHelper.js
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
import { domInfoHelper } from '../dom/exports';
|
||||||
|
export class modalHelper {
|
||||||
|
static focusDialog(selector, count = 0) {
|
||||||
|
let ele = document.querySelector(selector);
|
||||||
|
if (ele) {
|
||||||
|
if (ele.hasAttribute("disabled")) {
|
||||||
|
let htmlElement = document.activeElement;
|
||||||
|
htmlElement === null || htmlElement === void 0 ? void 0 : htmlElement.blur();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setTimeout(() => {
|
||||||
|
ele.focus();
|
||||||
|
let curId = "#" + domInfoHelper.getActiveElement();
|
||||||
|
if (curId !== selector) {
|
||||||
|
if (count < 10) {
|
||||||
|
this.focusDialog(selector, count + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static destroyAllDialog() {
|
||||||
|
document.querySelectorAll('.ant-modal-root')
|
||||||
|
.forEach(e => document.body.removeChild(e.parentNode));
|
||||||
|
}
|
||||||
|
}
|
975
_content/AntDesign/js/split/modules/components/overlay.js
Executable file
975
_content/AntDesign/js/split/modules/components/overlay.js
Executable file
@ -0,0 +1,975 @@
|
|||||||
|
import { domInfoHelper } from '../dom/exports';
|
||||||
|
import { resize } from '../../ObservableApi/observableApi';
|
||||||
|
import { mutationObserver as mutation } from '../../ObservableApi/mutationObserver';
|
||||||
|
//Make sure the enum is identical as C# AntDesign.Placement enum
|
||||||
|
export var Placement;
|
||||||
|
(function (Placement) {
|
||||||
|
Placement[Placement["TopLeft"] = 0] = "TopLeft";
|
||||||
|
Placement[Placement["TopCenter"] = 1] = "TopCenter";
|
||||||
|
Placement[Placement["Top"] = 2] = "Top";
|
||||||
|
Placement[Placement["TopRight"] = 3] = "TopRight";
|
||||||
|
Placement[Placement["Left"] = 4] = "Left";
|
||||||
|
Placement[Placement["LeftTop"] = 5] = "LeftTop";
|
||||||
|
Placement[Placement["LeftBottom"] = 6] = "LeftBottom";
|
||||||
|
Placement[Placement["Right"] = 7] = "Right";
|
||||||
|
Placement[Placement["RightTop"] = 8] = "RightTop";
|
||||||
|
Placement[Placement["RightBottom"] = 9] = "RightBottom";
|
||||||
|
Placement[Placement["BottomLeft"] = 10] = "BottomLeft";
|
||||||
|
Placement[Placement["BottomCenter"] = 11] = "BottomCenter";
|
||||||
|
Placement[Placement["Bottom"] = 12] = "Bottom";
|
||||||
|
Placement[Placement["BottomRight"] = 13] = "BottomRight";
|
||||||
|
})(Placement || (Placement = {}));
|
||||||
|
//Make sure the enum is identical as C# AntDesign.TriggerBoundyAdjustMode enum
|
||||||
|
export var TriggerBoundyAdjustMode;
|
||||||
|
(function (TriggerBoundyAdjustMode) {
|
||||||
|
TriggerBoundyAdjustMode[TriggerBoundyAdjustMode["None"] = 0] = "None";
|
||||||
|
TriggerBoundyAdjustMode[TriggerBoundyAdjustMode["InView"] = 1] = "InView";
|
||||||
|
TriggerBoundyAdjustMode[TriggerBoundyAdjustMode["InScroll"] = 2] = "InScroll";
|
||||||
|
})(TriggerBoundyAdjustMode || (TriggerBoundyAdjustMode = {}));
|
||||||
|
export class Overlay {
|
||||||
|
constructor(blazorId, overlay, container, trigger, placement, triggerBoundyAdjustMode, triggerIsWrappedInDiv, triggerPrefixCls, overlayConstraints) {
|
||||||
|
this.duringInit = true;
|
||||||
|
this.triggerPosition = {};
|
||||||
|
this.isContainerOverBody = false;
|
||||||
|
this.lastStyleMutation = "";
|
||||||
|
this.blazorId = blazorId;
|
||||||
|
this.overlay = overlay;
|
||||||
|
//containerInfo & scrollbars have to be obtained here, because after
|
||||||
|
//removal of classes, the overlay goes to left: -9999 what causes artificial
|
||||||
|
//scrollbars and viewport dimensions are changing
|
||||||
|
this.containerInfo = domInfoHelper.getInfo(container);
|
||||||
|
this.container = container;
|
||||||
|
this.isContainerBody = container === document.body;
|
||||||
|
this.calculateScrollBarSizes();
|
||||||
|
if (!this.isContainerBody) {
|
||||||
|
this.isContainerOverBody = domInfoHelper.findAncestorWithZIndex(this.container) > 0;
|
||||||
|
}
|
||||||
|
this.overlay.style.cssText = this.overlay.style.cssText.replace("display: none;", "");
|
||||||
|
this.overlay.style.top = "0px"; //reset to prevent scrollbars if do not exist
|
||||||
|
this.removeHiddenClass();
|
||||||
|
//The trigger is actually wrapping div, which can have its own dimensions (coming from styles).
|
||||||
|
//So, first valid HTML element is picked and if there is none, the wrapping div is set as trigger.
|
||||||
|
//Triggers are always wrapped in div if the <ChildElement> instead of <Unbound> is used.
|
||||||
|
this.trigger = Overlay.getFirstValidChild(trigger, triggerIsWrappedInDiv);
|
||||||
|
this.triggerPrefixCls = triggerPrefixCls;
|
||||||
|
if (overlayConstraints.arrowPointAtCenter) {
|
||||||
|
this.placement = Overlay.arrowCenterPlacementMatch.get(placement);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.placement = placement;
|
||||||
|
}
|
||||||
|
this.initialPlacement = this.placement;
|
||||||
|
this.boundyAdjustMode = triggerBoundyAdjustMode;
|
||||||
|
this.overlayConstraints = overlayConstraints;
|
||||||
|
this.position = { zIndex: 0 };
|
||||||
|
this.selectedHorizontalPosition = Overlay.appliedStylePositionMap.get(this.placement).horizontal;
|
||||||
|
this.selectedVerticalPosition = Overlay.appliedStylePositionMap.get(this.placement).vertical;
|
||||||
|
this.verticalCalculation = Overlay.setVerticalCalculation(this.placement, this.selectedVerticalPosition);
|
||||||
|
this.horizontalCalculation = Overlay.setHorizontalCalculation(this.placement, this.selectedHorizontalPosition);
|
||||||
|
this.isTriggerFixed = domInfoHelper.isFixedPosition(this.trigger);
|
||||||
|
this.observe();
|
||||||
|
}
|
||||||
|
static getFirstValidChild(element, triggerIsWrappedInDiv) {
|
||||||
|
if (triggerIsWrappedInDiv) {
|
||||||
|
for (let i = 0; i < element.childNodes.length; i++) {
|
||||||
|
const childElement = element.childNodes[i];
|
||||||
|
if (childElement.innerHTML)
|
||||||
|
return childElement;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
static setVerticalCalculation(placement, position) {
|
||||||
|
if (position === "top") {
|
||||||
|
switch (placement) {
|
||||||
|
case Placement.LeftTop:
|
||||||
|
case Placement.RightTop:
|
||||||
|
return function (triggerTop, triggerHeight, container, trigger, overlayHeight, constraints) {
|
||||||
|
return {
|
||||||
|
top: triggerTop,
|
||||||
|
bottom: Overlay.reversePositionValue(triggerTop, container.scrollHeight, overlayHeight)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case Placement.BottomLeft:
|
||||||
|
case Placement.BottomCenter:
|
||||||
|
case Placement.Bottom:
|
||||||
|
case Placement.BottomRight:
|
||||||
|
return function (triggerTop, triggerHeight, container, trigger, overlayHeight, constraints) {
|
||||||
|
const position = {
|
||||||
|
top: triggerTop + triggerHeight + constraints.verticalOffset,
|
||||||
|
};
|
||||||
|
position.bottom = Overlay.reversePositionValue(position.top, container.scrollHeight, overlayHeight);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
case Placement.Left:
|
||||||
|
case Placement.Right:
|
||||||
|
return function (triggerTop, triggerHeight, container, trigger, overlayHeight, constraints) {
|
||||||
|
const position = {
|
||||||
|
top: triggerTop + (triggerHeight / 2) - (overlayHeight / 2)
|
||||||
|
};
|
||||||
|
position.bottom = Overlay.reversePositionValue(position.top, container.scrollHeight, overlayHeight);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (position === "bottom") {
|
||||||
|
switch (placement) {
|
||||||
|
case Placement.TopLeft:
|
||||||
|
case Placement.TopCenter:
|
||||||
|
case Placement.Top:
|
||||||
|
case Placement.TopRight:
|
||||||
|
return function (triggerBottom, triggerHeight, container, trigger, overlayHeight, constraints) {
|
||||||
|
const position = {
|
||||||
|
bottom: triggerBottom + triggerHeight + constraints.verticalOffset,
|
||||||
|
};
|
||||||
|
position.top = Overlay.reversePositionValue(position.bottom, container.scrollHeight, overlayHeight);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
case Placement.LeftBottom:
|
||||||
|
case Placement.RightBottom:
|
||||||
|
return function (triggerBottom, triggerHeight, container, trigger, overlayHeight, constraints) {
|
||||||
|
const position = {
|
||||||
|
bottom: triggerBottom,
|
||||||
|
top: Overlay.reversePositionValue(triggerBottom, container.scrollHeight, overlayHeight)
|
||||||
|
};
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//fallback - should not happen, but to avoid crashing scenarios, revert to BottomLeft
|
||||||
|
console.log("Error: setVerticalCalculation did not match, nothing selected!!! Fallback.", placement, position);
|
||||||
|
return Overlay.setVerticalCalculation(Placement.BottomLeft, "top");
|
||||||
|
}
|
||||||
|
static setHorizontalCalculation(placement, position) {
|
||||||
|
if (position === "left") {
|
||||||
|
switch (placement) {
|
||||||
|
case Placement.TopLeft:
|
||||||
|
case Placement.BottomLeft:
|
||||||
|
return function (triggerLeft, triggerWidth, container, trigger, overlayWidth, constraints) {
|
||||||
|
return {
|
||||||
|
left: triggerLeft,
|
||||||
|
right: Overlay.reversePositionValue(triggerLeft, container.scrollWidth, overlayWidth)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
case Placement.Right:
|
||||||
|
case Placement.RightTop:
|
||||||
|
case Placement.RightBottom:
|
||||||
|
return function (triggerLeft, triggerWidth, container, trigger, overlayWidth, constraints) {
|
||||||
|
const position = {
|
||||||
|
left: triggerLeft + triggerWidth + constraints.horizontalOffset
|
||||||
|
};
|
||||||
|
position.right = Overlay.reversePositionValue(position.left, container.scrollWidth, overlayWidth);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
case Placement.TopCenter:
|
||||||
|
case Placement.Top:
|
||||||
|
case Placement.BottomCenter:
|
||||||
|
case Placement.Bottom:
|
||||||
|
return function (triggerLeft, triggerWidth, container, trigger, overlayWidth, constraints) {
|
||||||
|
const position = {
|
||||||
|
left: triggerLeft + (triggerWidth / 2) - (overlayWidth / 2)
|
||||||
|
};
|
||||||
|
position.right = Overlay.reversePositionValue(position.left, container.scrollWidth, overlayWidth);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (position === "right") {
|
||||||
|
switch (placement) {
|
||||||
|
case Placement.TopRight:
|
||||||
|
case Placement.BottomRight:
|
||||||
|
return function (triggerRight, triggerWidth, container, trigger, overlayWidth, constraints) {
|
||||||
|
let position = {
|
||||||
|
right: triggerRight,
|
||||||
|
left: Overlay.reversePositionValue(triggerRight, container.scrollWidth, overlayWidth)
|
||||||
|
};
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
case Placement.Left:
|
||||||
|
case Placement.LeftTop:
|
||||||
|
case Placement.LeftBottom:
|
||||||
|
return function (triggerRight, triggerWidth, container, trigger, overlayWidth, constraints) {
|
||||||
|
const position = {
|
||||||
|
right: triggerRight + triggerWidth + constraints.horizontalOffset
|
||||||
|
};
|
||||||
|
position.left = Overlay.reversePositionValue(position.right, container.scrollWidth, overlayWidth);
|
||||||
|
return position;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//fallback - should not happen, but to avoid crashing scenarios, revert to BottomLeft
|
||||||
|
console.log("Error: setHorizontalCalculation did not match, nothing selected!!! Fallback.", placement, position);
|
||||||
|
return Overlay.setVerticalCalculation(Placement.BottomLeft, "top");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates reversed position. So for given left will return right,
|
||||||
|
* for top => bottom, etc.
|
||||||
|
* @param the value that needs to be reversed (left in scenario: left => right)
|
||||||
|
* @param for horizontal (left, right) container width & for vertical (top, bottom) container height
|
||||||
|
* @param for horizontal (left, right) overlay width & for vertical (top, bottom) overlay height
|
||||||
|
* @returns number
|
||||||
|
*/
|
||||||
|
static reversePositionValue(position, containerDimension, overlayDimension) {
|
||||||
|
return containerDimension - position - overlayDimension;
|
||||||
|
}
|
||||||
|
removeHiddenClass() {
|
||||||
|
let end = this.overlay.className.indexOf("-hidden");
|
||||||
|
let start = this.overlay.className.lastIndexOf(" ", end);
|
||||||
|
if (start >= 0) {
|
||||||
|
let className = this.overlay.className.substr(start + 1, end);
|
||||||
|
if (className !== "") {
|
||||||
|
this.overlay.classList.remove(className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calculateScrollBarSizes() {
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
this.scrollbarSize = {
|
||||||
|
horizontalHeight: window.innerHeight - document.documentElement.clientHeight,
|
||||||
|
verticalWidth: window.innerWidth - document.documentElement.clientWidth
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.scrollbarSize = {
|
||||||
|
horizontalHeight: this.container.offsetHeight - this.container.clientHeight,
|
||||||
|
verticalWidth: this.container.offsetWidth - this.container.clientWidth
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
observe() {
|
||||||
|
resize.create(`container-${this.blazorId}`, this.resizing.bind(this), false);
|
||||||
|
resize.observe(`container-${this.blazorId}`, this.container);
|
||||||
|
resize.observe(`container-${this.blazorId}`, this.trigger);
|
||||||
|
mutation.create(`trigger-${this.blazorId}`, this.mutating.bind(this), false);
|
||||||
|
mutation.observe(`trigger-${this.blazorId}`, this.trigger, {
|
||||||
|
attributes: true,
|
||||||
|
characterData: false,
|
||||||
|
childList: false,
|
||||||
|
subtree: false,
|
||||||
|
attributeOldValue: false,
|
||||||
|
characterDataOldValue: false
|
||||||
|
});
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
window.addEventListener("scroll", this.onScroll.bind(this));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.container.addEventListener("scroll", this.onScroll.bind(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onScroll() {
|
||||||
|
if (this.isTriggerFixed) {
|
||||||
|
if (this.lastScrollPosition !== window.pageYOffset) {
|
||||||
|
const diff = window.pageYOffset - this.lastScrollPosition; //positive -> down, negative -> up
|
||||||
|
this.position.top += diff;
|
||||||
|
this.position.bottom = Overlay.reversePositionValue(this.position.top, this.containerInfo.scrollHeight, this.overlayInfo.clientHeight);
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
this.sanitizedPosition.top = this.position.top;
|
||||||
|
this.overlay.style.top = this.sanitizedPosition.top + "px";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.sanitizedPosition.bottom = this.getAdjustedBottom();
|
||||||
|
this.overlay.style.bottom = this.sanitizedPosition.bottom + "px";
|
||||||
|
}
|
||||||
|
this.lastScrollPosition = window.pageYOffset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//Commented out code is a non-optimized calculation only if overlay stops fitting during scroll
|
||||||
|
//It misses active check for initialPlacement being different to current placement
|
||||||
|
// this.getKeyElementDimensions(false);
|
||||||
|
// this.containerBoundarySize = this.getContainerBoundarySize();
|
||||||
|
// if (!this.overlayFitsContainer("horizontal", this.position.left, this.position.right)
|
||||||
|
// || !this.overlayFitsContainer("vertical", this.position.top, this.position.bottom)) {
|
||||||
|
// this.calculatePosition(true, false, this.overlayPreset)
|
||||||
|
// }
|
||||||
|
this.calculatePosition(true, false, this.overlayPreset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resizing(entries, observer) {
|
||||||
|
//prevents from recalculation right on the spot during constructor run
|
||||||
|
if (this.duringInit) {
|
||||||
|
this.duringInit = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.calculatePosition(true, false, this.overlayPreset);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Mutation observer will fire whenever trigger style changes. This is first and foremost
|
||||||
|
* to monitor position/size changes, so overlay can adjust itself to the new position.
|
||||||
|
* @param mutations
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
mutating(mutations) {
|
||||||
|
if (this.duringInit) {
|
||||||
|
this.duringInit = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.lastStyleMutation !== this.trigger.style.cssText) {
|
||||||
|
this.lastStyleMutation = this.trigger.style.cssText;
|
||||||
|
this.calculatePosition(true, false, this.overlayPreset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dispose() {
|
||||||
|
resize.dispose(`container-${this.blazorId}`);
|
||||||
|
mutation.dispose(`trigger-${this.blazorId}`);
|
||||||
|
if (this.container.contains(this.overlay)) {
|
||||||
|
this.container.removeChild(this.overlay);
|
||||||
|
}
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
window.removeEventListener("scroll", this.onScroll);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.container.removeEventListener("scroll", this.onScroll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calculatePosition(applyLocation, firstTime = false, overlayPreset) {
|
||||||
|
//check if hidden, if yes, no need to recalculate (only if not first time)
|
||||||
|
if (!firstTime && !this.overlay.offsetParent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//trigger no longer visible, hide
|
||||||
|
if (!overlayPreset && !this.trigger.offsetParent) {
|
||||||
|
if (!this.overlay.classList.contains(this.triggerPrefixCls + "-hidden")) {
|
||||||
|
this.overlay.classList.add(this.triggerPrefixCls + "-hidden");
|
||||||
|
}
|
||||||
|
return this.position;
|
||||||
|
}
|
||||||
|
this.lastScrollPosition = window.pageYOffset;
|
||||||
|
this.recentPlacement = this.placement;
|
||||||
|
this.overlayPreset = overlayPreset;
|
||||||
|
this.getKeyElementDimensions(firstTime);
|
||||||
|
this.restoreInitialPlacement();
|
||||||
|
//add a very basic check - if overlay width exceeds container width, left defaults to 0
|
||||||
|
this.calculationsToPerform = this.getNominalPositions();
|
||||||
|
if (this.calculationsToPerform.size > 0) {
|
||||||
|
this.adjustToContainerBoundaries();
|
||||||
|
}
|
||||||
|
this.sanitizeCalculatedPositions();
|
||||||
|
//first positioning is applied by blazor - without it, a flicker is visible
|
||||||
|
if (applyLocation) {
|
||||||
|
this.applyLocation();
|
||||||
|
}
|
||||||
|
return this.sanitizedPosition;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* All variants of positions are stored during calculations, but only key positions are
|
||||||
|
* returned (so only left or right and only top or bottom).
|
||||||
|
* Also, bottom & right positions need to be recalculated, due to the fact that during
|
||||||
|
* calculations:
|
||||||
|
* - bottom is represented as a value counting from top
|
||||||
|
* - right is represented as a value counting from left
|
||||||
|
* Browsers use different reference for bottom & right.
|
||||||
|
*/
|
||||||
|
sanitizeCalculatedPositions() {
|
||||||
|
this.sanitizedPosition = Object.assign({}, this.position);
|
||||||
|
this.sanitizedPosition.zIndex = domInfoHelper.getMaxZIndex();
|
||||||
|
this.sanitizedPosition.placement = this.placement;
|
||||||
|
if (this.selectedHorizontalPosition === "left") {
|
||||||
|
this.sanitizedPosition.right = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.sanitizedPosition.left = null;
|
||||||
|
this.sanitizedPosition.right = this.getAdjustedRight();
|
||||||
|
}
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
this.sanitizedPosition.bottom = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.sanitizedPosition.top = null;
|
||||||
|
this.sanitizedPosition.bottom = this.getAdjustedBottom();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets first calculations of the overlay. For each direction, there is a single scenario
|
||||||
|
* when it is immediately known that no further calculation is needed:
|
||||||
|
* - for vertical direction - when overlay's height is larger than container vertical boundaries
|
||||||
|
* - for vertical direction - when overlay's width is larger than container horizontal boundaries
|
||||||
|
* These scenarios are ignored, when boundyAdjustMode === TriggerBoundyAdjustMode.None
|
||||||
|
* @returns collection containing directions that will be calculable (not final)
|
||||||
|
*/
|
||||||
|
getNominalPositions() {
|
||||||
|
this.containerBoundarySize = this.getContainerBoundarySize();
|
||||||
|
const height = this.containerBoundarySize.bottom - this.containerBoundarySize.top;
|
||||||
|
const width = this.containerBoundarySize.right - this.containerBoundarySize.left;
|
||||||
|
const directionsToCalculate = new Set();
|
||||||
|
if (this.boundyAdjustMode != TriggerBoundyAdjustMode.None && width < this.overlayInfo.clientWidth && this.isContainerBody) {
|
||||||
|
if (this.selectedHorizontalPosition === "left") {
|
||||||
|
this.position.left = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.position.right = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const horizontalPosition = this.getHorizontalPosition();
|
||||||
|
this.position.left = horizontalPosition.left;
|
||||||
|
this.position.right = horizontalPosition.right;
|
||||||
|
directionsToCalculate.add("horizontal");
|
||||||
|
}
|
||||||
|
//same for height exceeding container height - top defaults to 0
|
||||||
|
if (this.boundyAdjustMode != TriggerBoundyAdjustMode.None && height < this.overlayInfo.clientHeight && this.isContainerBody) {
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
this.position.top = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.position.bottom = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const verticalPosition = this.getVerticalPosition();
|
||||||
|
this.position.top = verticalPosition.top;
|
||||||
|
this.position.bottom = verticalPosition.bottom;
|
||||||
|
directionsToCalculate.add("vertical");
|
||||||
|
}
|
||||||
|
return directionsToCalculate;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Restore initial placement (and following connected variables & functions) on calculation.
|
||||||
|
* This never kicks in on first calculation. This is done because the overlay should always
|
||||||
|
* try to position itself to the initial placement. So on every recalculation initial settings
|
||||||
|
* (used during object creation) are reloaded.
|
||||||
|
*/
|
||||||
|
restoreInitialPlacement() {
|
||||||
|
if (this.placement !== this.initialPlacement) {
|
||||||
|
this.placement = this.initialPlacement;
|
||||||
|
this.selectedHorizontalPosition = Overlay.appliedStylePositionMap.get(this.placement).horizontal;
|
||||||
|
this.selectedVerticalPosition = Overlay.appliedStylePositionMap.get(this.placement).vertical;
|
||||||
|
this.verticalCalculation = Overlay.setVerticalCalculation(this.placement, this.selectedVerticalPosition);
|
||||||
|
this.horizontalCalculation = Overlay.setHorizontalCalculation(this.placement, this.selectedHorizontalPosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Very basic logging, useful during debugging.
|
||||||
|
* @param extraMessage
|
||||||
|
*/
|
||||||
|
/* istanbul ignore next */
|
||||||
|
logToConsole(extraMessage = "") {
|
||||||
|
console.log(extraMessage + " Overlay position:", this.position, "Input", {
|
||||||
|
blazorId: this.blazorId,
|
||||||
|
container: {
|
||||||
|
info: this.containerInfo,
|
||||||
|
parentInfo: {
|
||||||
|
clientHeight: this.container.parentElement.clientHeight,
|
||||||
|
clientWidth: this.container.parentElement.clientWidth,
|
||||||
|
scrollLeft: this.container.parentElement.scrollLeft,
|
||||||
|
scrollTop: this.container.parentElement.scrollTop
|
||||||
|
},
|
||||||
|
containerId: this.container.id,
|
||||||
|
containerBoundarySize: this.containerBoundarySize,
|
||||||
|
},
|
||||||
|
trigger: {
|
||||||
|
absoluteTop: this.triggerInfo.absoluteTop,
|
||||||
|
absoluteLeft: this.triggerInfo.absoluteLeft,
|
||||||
|
clientHeight: this.triggerInfo.clientHeight,
|
||||||
|
clientWidth: this.triggerInfo.clientWidth,
|
||||||
|
offsetHeight: this.triggerInfo.offsetHeight,
|
||||||
|
offsetWidth: this.triggerInfo.offsetWidth,
|
||||||
|
boundyAdjustMode: this.boundyAdjustMode,
|
||||||
|
//triggerType: this.triggerType,
|
||||||
|
triggerHtml: this.trigger.outerHTML,
|
||||||
|
triggerPrefixCls: this.triggerPrefixCls
|
||||||
|
},
|
||||||
|
overlay: {
|
||||||
|
clientHeight: this.overlayInfo.clientHeight,
|
||||||
|
clientWidth: this.overlayInfo.clientWidth,
|
||||||
|
offsetHeight: this.overlayInfo.offsetHeight,
|
||||||
|
offsetWidth: this.overlayInfo.offsetWidth,
|
||||||
|
class: this.overlay.className,
|
||||||
|
appliedCssPosition: {
|
||||||
|
overlay_style_top: this.overlay.style.top,
|
||||||
|
overlay_style_bottom: this.overlay.style.bottom,
|
||||||
|
overlay_style_left: this.overlay.style.left,
|
||||||
|
overlay_style_right: this.overlay.style.right
|
||||||
|
}
|
||||||
|
},
|
||||||
|
window: {
|
||||||
|
innerHeight: window.innerHeight,
|
||||||
|
innerWidth: window.innerWidth,
|
||||||
|
pageXOffset: window.pageXOffset,
|
||||||
|
pageYOffset: window.pageYOffset,
|
||||||
|
},
|
||||||
|
documentElement: {
|
||||||
|
clientHeight: document.documentElement.clientHeight,
|
||||||
|
clientWidth: document.documentElement.clientWidth,
|
||||||
|
containerIsBody: this.isContainerBody,
|
||||||
|
},
|
||||||
|
scrollbars: this.scrollbarSize,
|
||||||
|
overlayPreset: this.overlayPreset,
|
||||||
|
overlayConstraints: this.overlayConstraints,
|
||||||
|
position: this.position,
|
||||||
|
sanitizedPosition: this.sanitizedPosition,
|
||||||
|
placment: {
|
||||||
|
initialPlacement: this.initialPlacement,
|
||||||
|
recentPlacement: this.recentPlacement,
|
||||||
|
placement: this.placement,
|
||||||
|
selectedHorizontalPosition: this.selectedHorizontalPosition,
|
||||||
|
selectedVerticalPosition: this.selectedVerticalPosition
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Right in the class is calculated with assumption that it is just reversed Left.
|
||||||
|
* This works well for containers that are not body. When in body, then different Right
|
||||||
|
* calculation is executed. Example:
|
||||||
|
* In a document of width of 5000px, the first Left = 0 and the first Right = 0 as well
|
||||||
|
* (and respectively, max Left = 5000 and max Right = 5000). However, browsers are behaving
|
||||||
|
* differently. Left indeed is 0 until the document width (5000). Right however is different.
|
||||||
|
* Right = 0 means the point of original viewport most Right. So, if you viewport is 1000px
|
||||||
|
* wide, Right = 0 will mean same as Left = 1000. So to reach Left = 5000, Right has to
|
||||||
|
* be equal to -4000.
|
||||||
|
* @returns number - right position
|
||||||
|
*/
|
||||||
|
getAdjustedRight() {
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
return this.position.right - (this.containerInfo.scrollWidth - window.innerWidth)
|
||||||
|
- this.scrollbarSize.verticalWidth;
|
||||||
|
}
|
||||||
|
return this.position.right;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Bottom in the class is calculated with assumption that it is just reversed Top.
|
||||||
|
* This works well for containers that are not body. When in body, then different Bottom
|
||||||
|
* calculation is executed. Example:
|
||||||
|
* In a document of height of 5000px, the first Top = 0 and the first Bottom = 0 as well
|
||||||
|
* (and respectively, max Top = 5000 and max Bottom = 5000). However, browsers are behaving
|
||||||
|
* differently. Top indeed is 0 until the document height (5000). Bottom however is different.
|
||||||
|
* Bottom = 0 means the point of original viewport most bottom. So, if you viewport is 1000px
|
||||||
|
* in height, Bottom = 0 will mean same as Top = 1000. So to reach Top = 5000, Bottom has to
|
||||||
|
* be equal to -4000.
|
||||||
|
* @returns number - bottom position
|
||||||
|
*/
|
||||||
|
getAdjustedBottom() {
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
return this.position.bottom - (this.containerInfo.scrollHeight - window.innerHeight)
|
||||||
|
- this.scrollbarSize.horizontalHeight;
|
||||||
|
}
|
||||||
|
return this.position.bottom;
|
||||||
|
}
|
||||||
|
applyLocation() {
|
||||||
|
if (this.selectedHorizontalPosition === "left") {
|
||||||
|
this.overlay.style.left = this.sanitizedPosition.left + "px";
|
||||||
|
this.overlay.style.right = "unset";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.overlay.style.right = this.sanitizedPosition.right + "px";
|
||||||
|
this.overlay.style.left = "unset";
|
||||||
|
}
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
this.overlay.style.top = this.sanitizedPosition.top + "px";
|
||||||
|
this.overlay.style.bottom = "unset";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.overlay.style.bottom = this.sanitizedPosition.bottom + "px";
|
||||||
|
this.overlay.style.top = "unset";
|
||||||
|
}
|
||||||
|
this.applyPlacement();
|
||||||
|
}
|
||||||
|
applyPlacement() {
|
||||||
|
if (this.recentPlacement !== this.placement) {
|
||||||
|
let currentPlacement;
|
||||||
|
const stringMach = `${this.triggerPrefixCls}-placement-`;
|
||||||
|
const start = this.overlay.className.indexOf(stringMach);
|
||||||
|
const end = this.overlay.className.indexOf(" ", start + stringMach.length);
|
||||||
|
if (start >= 0) {
|
||||||
|
currentPlacement = this.overlay.className.substr(start, end - start);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
currentPlacement = Overlay.appliedStylePositionMap.get(this.initialPlacement).class;
|
||||||
|
}
|
||||||
|
let newPlacement = stringMach + Overlay.appliedStylePositionMap.get(this.placement).class;
|
||||||
|
this.overlay.classList.replace(currentPlacement, newPlacement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Loads all important dimensions of the key elements (container of the trigger, trigger & overlay)
|
||||||
|
* into domType.domInfo structures. This could be accessed directly, except absolute positions.
|
||||||
|
* Also simplifies mocking.
|
||||||
|
* @param firstTime - if this method is called first time, then no need to load information on
|
||||||
|
* container, as it was already loaded in the constructor. This is due to the fact that first time,
|
||||||
|
* when overlay is added it has default left set to -9999 which causes the scrollbars to
|
||||||
|
* appear (which will be gone by the time overlay becomes visible). Scrollbars change
|
||||||
|
* dimensions, so often calculations were incorrect.
|
||||||
|
*/
|
||||||
|
getKeyElementDimensions(firstTime) {
|
||||||
|
if (!firstTime) {
|
||||||
|
this.containerInfo = domInfoHelper.getInfo(this.container);
|
||||||
|
this.calculateScrollBarSizes();
|
||||||
|
}
|
||||||
|
this.triggerInfo = domInfoHelper.getInfo(this.trigger);
|
||||||
|
this.overlayInfo = domInfoHelper.getInfo(this.overlay);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates trigger top & bottom positions and trigger height and
|
||||||
|
* uses these to return nominal position values depending on placement and
|
||||||
|
* expected attachment point (top/bottom)
|
||||||
|
* @returns verticalPosition
|
||||||
|
*/
|
||||||
|
getVerticalPosition() {
|
||||||
|
let position;
|
||||||
|
//usually first offsetHeight is taken, as the measurement contains the borders
|
||||||
|
this.triggerPosition.height = this.triggerInfo.offsetHeight != 0 ? this.triggerInfo.offsetHeight
|
||||||
|
: this.triggerInfo.clientHeight;
|
||||||
|
if (this.overlayPreset) {
|
||||||
|
this.triggerPosition.top = this.triggerInfo.absoluteTop + this.overlayPreset.y;
|
||||||
|
this.triggerPosition.height = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.triggerPosition.top = this.containerInfo.scrollTop + this.triggerInfo.absoluteTop
|
||||||
|
- this.containerInfo.absoluteTop - this.containerInfo.clientTop;
|
||||||
|
}
|
||||||
|
this.triggerPosition.absoluteTop = this.triggerInfo.absoluteTop;
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
position = this.verticalCalculation(this.triggerPosition.top, this.triggerPosition.height, this.containerInfo, this.triggerInfo, this.overlayInfo.clientHeight, this.overlayConstraints);
|
||||||
|
}
|
||||||
|
else { //bottom
|
||||||
|
this.triggerPosition.bottom = this.containerInfo.scrollHeight - this.triggerPosition.top - this.triggerPosition.height;
|
||||||
|
position = this.verticalCalculation(this.triggerPosition.bottom, this.triggerPosition.height, this.containerInfo, this.triggerInfo, this.overlayInfo.clientHeight, this.overlayConstraints);
|
||||||
|
}
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Calculates trigger left & right positions and trigger width and
|
||||||
|
* uses these to return nominal position values depending on placement and
|
||||||
|
* expected attachment point (left/right)
|
||||||
|
* @returns verticalPosition
|
||||||
|
*/
|
||||||
|
getHorizontalPosition() {
|
||||||
|
let position;
|
||||||
|
//usually first offsetHeight is taken, as the measurement contains the borders
|
||||||
|
this.triggerPosition.width = this.triggerInfo.offsetWidth != 0 ? this.triggerInfo.offsetWidth : this.triggerInfo.clientWidth;
|
||||||
|
//let triggerLeft: number;
|
||||||
|
if (this.overlayPreset) {
|
||||||
|
this.triggerPosition.left = this.triggerInfo.absoluteLeft + this.overlayPreset.x;
|
||||||
|
this.triggerPosition.width = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.triggerPosition.left = this.containerInfo.scrollLeft + this.triggerInfo.absoluteLeft
|
||||||
|
- this.containerInfo.absoluteLeft - this.containerInfo.clientLeft;
|
||||||
|
}
|
||||||
|
this.triggerPosition.absoluteLeft = this.triggerInfo.absoluteLeft;
|
||||||
|
if (this.selectedHorizontalPosition === "left") {
|
||||||
|
position = this.horizontalCalculation(this.triggerPosition.left, this.triggerPosition.width, this.containerInfo, this.triggerInfo, this.overlayInfo.clientWidth, this.overlayConstraints);
|
||||||
|
}
|
||||||
|
else { //right
|
||||||
|
this.triggerPosition.right = this.containerInfo.scrollWidth - this.triggerPosition.left - this.triggerPosition.width;
|
||||||
|
position = this.horizontalCalculation(this.triggerPosition.right, this.triggerPosition.width, this.containerInfo, this.triggerInfo, this.overlayInfo.clientWidth, this.overlayConstraints);
|
||||||
|
}
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Responsible for calling logic that handles situation when calculated overlay position
|
||||||
|
* is causing overlay to be partially rendered invisible. The goal is to adjust placement
|
||||||
|
* in such a way, so the overlay is fully visible.
|
||||||
|
* @returns void
|
||||||
|
*/
|
||||||
|
adjustToContainerBoundaries() {
|
||||||
|
if (this.boundyAdjustMode === TriggerBoundyAdjustMode.None) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.calculationsToPerform.has("vertical")) {
|
||||||
|
this.adjustVerticalToContainerBoundaries();
|
||||||
|
}
|
||||||
|
if (this.calculationsToPerform.has("horizontal")) {
|
||||||
|
this.adjustHorizontalToContainerBoundaries();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setBodyBoundayrSize() {
|
||||||
|
const window = domInfoHelper.getWindow();
|
||||||
|
const scroll = domInfoHelper.getScroll();
|
||||||
|
this.bodyBoundarySize = {
|
||||||
|
top: scroll.y,
|
||||||
|
left: scroll.x,
|
||||||
|
right: window.innerWidth + scroll.x,
|
||||||
|
bottom: window.innerHeight + scroll.y
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Retrieves information on current logical viewport (visible area). For
|
||||||
|
* InView this means actual viewport area (what you see in the browser - either the
|
||||||
|
* body or the scrolled to area in a container) or for InScroll this means total
|
||||||
|
* area of the container (or body).
|
||||||
|
* @returns coordinates - absolute values measuring from top = 0 and left = 0 (first
|
||||||
|
* pixels of the container)
|
||||||
|
*/
|
||||||
|
getContainerBoundarySize() {
|
||||||
|
if (this.boundyAdjustMode === TriggerBoundyAdjustMode.InScroll) {
|
||||||
|
if (!this.isContainerBody) {
|
||||||
|
this.setBodyBoundayrSize();
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
left: 0,
|
||||||
|
right: this.containerInfo.scrollWidth,
|
||||||
|
top: 0,
|
||||||
|
bottom: this.containerInfo.scrollHeight
|
||||||
|
};
|
||||||
|
}
|
||||||
|
this.setBodyBoundayrSize();
|
||||||
|
if (this.isContainerBody) {
|
||||||
|
return this.bodyBoundarySize;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//special care is needed when evaluating viewport of the container
|
||||||
|
const parentIsInsignificant = this.container.parentElement.clientHeight === 0
|
||||||
|
|| this.container.parentElement.clientWidth === 0;
|
||||||
|
const verticalScrollBasedOnParent = !parentIsInsignificant
|
||||||
|
&& this.container.parentElement.clientHeight < this.containerInfo.clientHeight;
|
||||||
|
const horizontalScrollBasedOnParent = !parentIsInsignificant
|
||||||
|
&& this.container.parentElement.clientWidth < this.containerInfo.clientWidth;
|
||||||
|
let clientHeight;
|
||||||
|
let clientWidth;
|
||||||
|
let scrollTop;
|
||||||
|
let scrollLeft;
|
||||||
|
if (verticalScrollBasedOnParent) {
|
||||||
|
clientHeight = this.container.parentElement.clientHeight;
|
||||||
|
scrollTop = this.container.parentElement.scrollTop;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clientHeight = this.containerInfo.clientHeight;
|
||||||
|
scrollTop = this.containerInfo.scrollTop;
|
||||||
|
}
|
||||||
|
if (horizontalScrollBasedOnParent) {
|
||||||
|
clientWidth = this.container.parentElement.clientWidth;
|
||||||
|
clientWidth;
|
||||||
|
scrollLeft = this.container.parentElement.scrollLeft;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
clientWidth = this.containerInfo.clientWidth;
|
||||||
|
scrollLeft = this.containerInfo.scrollLeft;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
top: scrollTop,
|
||||||
|
bottom: scrollTop + clientHeight,
|
||||||
|
left: scrollLeft,
|
||||||
|
right: scrollLeft + clientWidth
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns how much height of the overlay is visible in current viewport
|
||||||
|
*/
|
||||||
|
getOverlayVisibleHeight(visibleIn) {
|
||||||
|
let boundary;
|
||||||
|
let top;
|
||||||
|
if (visibleIn === "container") {
|
||||||
|
boundary = this.containerBoundarySize;
|
||||||
|
top = this.triggerPosition.top;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
boundary = this.bodyBoundarySize;
|
||||||
|
top = this.triggerPosition.absoluteTop;
|
||||||
|
}
|
||||||
|
if (this.selectedVerticalPosition === "top") {
|
||||||
|
return boundary.bottom - (top + this.triggerPosition.height);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return top - boundary.top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns how much width of the overlay is visible in current viewport
|
||||||
|
*/
|
||||||
|
getOverlayVisibleWidth(visibleIn) {
|
||||||
|
let boundary;
|
||||||
|
let left;
|
||||||
|
if (visibleIn === "container") {
|
||||||
|
boundary = this.containerBoundarySize;
|
||||||
|
left = this.triggerPosition.left;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
boundary = this.bodyBoundarySize;
|
||||||
|
left = this.triggerPosition.absoluteLeft;
|
||||||
|
}
|
||||||
|
if (this.selectedHorizontalPosition === "left") {
|
||||||
|
return boundary.right - (left + this.triggerPosition.width);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return left - boundary.left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks if current position actually fits in the container and if not, then reverses
|
||||||
|
* the placement. Then calculates which already calculated placements has the largest horizontal
|
||||||
|
* area of the overlay visible and picks the calculation with largest area.
|
||||||
|
*/
|
||||||
|
adjustHorizontalToContainerBoundaries() {
|
||||||
|
if (!this.overlayFitsContainer("horizontal", this.position.left, this.position.right)) {
|
||||||
|
const positionCache = Object.assign({}, this.position);
|
||||||
|
const selectedPositionCache = this.selectedHorizontalPosition;
|
||||||
|
const placementCache = this.placement;
|
||||||
|
const horizontalCalculationCache = this.horizontalCalculation;
|
||||||
|
const visibleWidthBeforeAdjustment = this.getOverlayVisibleWidth("container");
|
||||||
|
let visibleWidthInBodyBeforeAdjustment;
|
||||||
|
if (this.isContainerOverBody) {
|
||||||
|
visibleWidthInBodyBeforeAdjustment = this.getOverlayVisibleWidth("body");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
visibleWidthInBodyBeforeAdjustment = visibleWidthBeforeAdjustment;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
this.getHorizontalAdjustment();
|
||||||
|
const visibleWidthAfterAdjustment = this.getOverlayVisibleWidth("container");
|
||||||
|
let visibleWidthInBodyAfterAdjustment;
|
||||||
|
if (this.isContainerOverBody) {
|
||||||
|
visibleWidthInBodyAfterAdjustment = this.getOverlayVisibleWidth("body");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
visibleWidthInBodyAfterAdjustment = visibleWidthAfterAdjustment;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (!(visibleWidthInBodyBeforeAdjustment < visibleWidthInBodyAfterAdjustment
|
||||||
|
&& visibleWidthInBodyAfterAdjustment > 0
|
||||||
|
&& visibleWidthInBodyAfterAdjustment - visibleWidthInBodyBeforeAdjustment >= 0)
|
||||||
|
||
|
||||||
|
!(visibleWidthBeforeAdjustment < visibleWidthAfterAdjustment && visibleWidthAfterAdjustment > 0)) {
|
||||||
|
this.position = positionCache;
|
||||||
|
this.selectedHorizontalPosition = selectedPositionCache;
|
||||||
|
this.placement = placementCache;
|
||||||
|
this.horizontalCalculation = horizontalCalculationCache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Checks if current position actually fits in the container and if not, then reverses
|
||||||
|
* the placement. Then calculates which already calculated placements has the largest vertical
|
||||||
|
* area of the overlay visible and picks the calculation with largest area.
|
||||||
|
*/
|
||||||
|
adjustVerticalToContainerBoundaries() {
|
||||||
|
if (!this.overlayFitsContainer("vertical", this.position.top, this.position.bottom)) {
|
||||||
|
const positionCache = Object.assign({}, this.position);
|
||||||
|
const selectedPositionCache = this.selectedVerticalPosition;
|
||||||
|
const placementCache = this.placement;
|
||||||
|
const verticalCalculationCache = this.verticalCalculation;
|
||||||
|
const visibleHeightBeforeAdjustment = this.getOverlayVisibleHeight("container");
|
||||||
|
let visibleHeightInBodyBeforeAdjustment;
|
||||||
|
if (this.isContainerOverBody) {
|
||||||
|
visibleHeightInBodyBeforeAdjustment = this.getOverlayVisibleHeight("body");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
visibleHeightInBodyBeforeAdjustment = visibleHeightBeforeAdjustment;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
this.getVerticalAdjustment();
|
||||||
|
const visibleHeightAfterAdjustment = this.getOverlayVisibleHeight("container");
|
||||||
|
let visibleHeightInBodyAfterAdjustment;
|
||||||
|
if (this.isContainerOverBody) {
|
||||||
|
visibleHeightInBodyAfterAdjustment = this.getOverlayVisibleHeight("body");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
visibleHeightInBodyAfterAdjustment = visibleHeightAfterAdjustment;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
if (!(visibleHeightInBodyBeforeAdjustment < visibleHeightInBodyAfterAdjustment
|
||||||
|
&& visibleHeightInBodyAfterAdjustment > 0
|
||||||
|
&& visibleHeightInBodyAfterAdjustment - visibleHeightInBodyBeforeAdjustment >= 0)
|
||||||
|
||
|
||||||
|
!(visibleHeightBeforeAdjustment < visibleHeightAfterAdjustment && visibleHeightAfterAdjustment > 0)) {
|
||||||
|
this.position = positionCache;
|
||||||
|
this.selectedVerticalPosition = selectedPositionCache;
|
||||||
|
this.placement = placementCache;
|
||||||
|
this.verticalCalculation = verticalCalculationCache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
overlayFitsContainer(type, start, end) {
|
||||||
|
if (type === "horizontal") {
|
||||||
|
const endExpressedAsLeft = start + this.overlayInfo.clientWidth;
|
||||||
|
return this.containerBoundarySize.left <= start
|
||||||
|
&& start <= this.containerBoundarySize.right //overlay left is between container left and right
|
||||||
|
&& this.containerBoundarySize.left <= endExpressedAsLeft
|
||||||
|
&& endExpressedAsLeft <= this.containerBoundarySize.right; //and overlay right is between container left and right
|
||||||
|
}
|
||||||
|
const endExpressedAsTop = start + this.overlayInfo.clientHeight;
|
||||||
|
return this.containerBoundarySize.top <= start
|
||||||
|
&& start <= this.containerBoundarySize.bottom //overlay top is between container top and bottom
|
||||||
|
&& this.containerBoundarySize.top <= endExpressedAsTop
|
||||||
|
&& endExpressedAsTop <= this.containerBoundarySize.bottom; //and overlay bottom is between container top and bottom
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Applies basic adjustment - switches verticaly placement (top -> bottom & bottom -> top)
|
||||||
|
* and recalculates based on the newly set placement
|
||||||
|
*/
|
||||||
|
getVerticalAdjustment() {
|
||||||
|
this.placement = Overlay.reverseVerticalPlacementMap.get(this.placement)(this.selectedVerticalPosition);
|
||||||
|
this.selectedVerticalPosition = Overlay.appliedStylePositionMap.get(this.placement).vertical;
|
||||||
|
this.verticalCalculation = Overlay.setVerticalCalculation(this.placement, this.selectedVerticalPosition);
|
||||||
|
const verticalPosition = this.getVerticalPosition();
|
||||||
|
this.position.top = verticalPosition.top;
|
||||||
|
this.position.bottom = verticalPosition.bottom;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Applies basic adjustment - switches horizontal placement (left -> right & right -> left)
|
||||||
|
* and recalculates based on the newly set placement
|
||||||
|
*/
|
||||||
|
getHorizontalAdjustment() {
|
||||||
|
this.placement = Overlay.reverseHorizontalPlacementMap.get(this.placement)(this.selectedHorizontalPosition);
|
||||||
|
this.selectedHorizontalPosition = Overlay.appliedStylePositionMap.get(this.placement).horizontal;
|
||||||
|
this.horizontalCalculation = Overlay.setHorizontalCalculation(this.placement, this.selectedHorizontalPosition);
|
||||||
|
const horizontalPosition = this.getHorizontalPosition();
|
||||||
|
this.position.left = horizontalPosition.left;
|
||||||
|
this.position.right = horizontalPosition.right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Overlay.appliedStylePositionMap = new Map([
|
||||||
|
[Placement.TopLeft, { horizontal: "left", vertical: "bottom", class: "topLeft" }],
|
||||||
|
[Placement.TopCenter, { horizontal: "left", vertical: "bottom", class: "topCenter" }],
|
||||||
|
[Placement.Top, { horizontal: "left", vertical: "bottom", class: "top" }],
|
||||||
|
[Placement.TopRight, { horizontal: "right", vertical: "bottom", class: "topRight" }],
|
||||||
|
[Placement.Left, { horizontal: "right", vertical: "top", class: "left" }],
|
||||||
|
[Placement.LeftTop, { horizontal: "right", vertical: "top", class: "leftTop" }],
|
||||||
|
[Placement.LeftBottom, { horizontal: "right", vertical: "bottom", class: "leftBottom" }],
|
||||||
|
[Placement.Right, { horizontal: "left", vertical: "top", class: "right" }],
|
||||||
|
[Placement.RightTop, { horizontal: "left", vertical: "top", class: "rightTop" }],
|
||||||
|
[Placement.RightBottom, { horizontal: "left", vertical: "bottom", class: "rightBottom" }],
|
||||||
|
[Placement.BottomLeft, { horizontal: "left", vertical: "top", class: "bottomLeft" }],
|
||||||
|
[Placement.BottomCenter, { horizontal: "left", vertical: "top", class: "bottomCenter" }],
|
||||||
|
[Placement.Bottom, { horizontal: "left", vertical: "top", class: "bottom" }],
|
||||||
|
[Placement.BottomRight, { horizontal: "right", vertical: "top", class: "bottomRight" }],
|
||||||
|
]);
|
||||||
|
Overlay.reverseVerticalPlacementMap = new Map([
|
||||||
|
[Placement.TopLeft, (position) => Placement.BottomLeft],
|
||||||
|
[Placement.TopCenter, (position) => Placement.BottomCenter],
|
||||||
|
[Placement.Top, (position) => Placement.Bottom],
|
||||||
|
[Placement.TopRight, (position) => Placement.BottomRight],
|
||||||
|
[Placement.Left, (position) => position === "top" ? Placement.LeftBottom : Placement.LeftTop],
|
||||||
|
[Placement.LeftTop, (position) => Placement.LeftBottom],
|
||||||
|
[Placement.LeftBottom, (position) => Placement.LeftTop],
|
||||||
|
[Placement.Right, (position) => position === "top" ? Placement.RightBottom : Placement.RightTop],
|
||||||
|
[Placement.RightTop, (position) => Placement.RightBottom],
|
||||||
|
[Placement.RightBottom, (position) => Placement.RightTop],
|
||||||
|
[Placement.BottomLeft, (position) => Placement.TopLeft],
|
||||||
|
[Placement.BottomCenter, (position) => Placement.TopCenter],
|
||||||
|
[Placement.Bottom, (position) => Placement.Top],
|
||||||
|
[Placement.BottomRight, (position) => Placement.TopRight]
|
||||||
|
]);
|
||||||
|
Overlay.reverseHorizontalPlacementMap = new Map([
|
||||||
|
[Placement.TopLeft, (position) => Placement.TopRight],
|
||||||
|
[Placement.TopCenter, (position) => position === "left" ? Placement.TopRight : Placement.TopLeft],
|
||||||
|
[Placement.Top, (position) => position === "left" ? Placement.TopRight : Placement.TopLeft],
|
||||||
|
[Placement.TopRight, (position) => Placement.TopLeft],
|
||||||
|
[Placement.Left, (position) => Placement.Right],
|
||||||
|
[Placement.LeftTop, (position) => Placement.RightTop],
|
||||||
|
[Placement.LeftBottom, (position) => Placement.RightBottom],
|
||||||
|
[Placement.Right, (position) => Placement.Left],
|
||||||
|
[Placement.RightTop, (position) => Placement.LeftBottom],
|
||||||
|
[Placement.RightBottom, (position) => Placement.LeftTop],
|
||||||
|
[Placement.BottomLeft, (position) => Placement.BottomRight],
|
||||||
|
[Placement.BottomCenter, (position) => position === "left" ? Placement.BottomRight : Placement.BottomLeft],
|
||||||
|
[Placement.Bottom, (position) => position === "left" ? Placement.BottomRight : Placement.BottomLeft],
|
||||||
|
[Placement.BottomRight, (position) => Placement.BottomLeft]
|
||||||
|
]);
|
||||||
|
Overlay.arrowCenterPlacementMatch = new Map([
|
||||||
|
[Placement.TopLeft, Placement.Top],
|
||||||
|
[Placement.TopCenter, Placement.TopCenter],
|
||||||
|
[Placement.Top, Placement.Top],
|
||||||
|
[Placement.TopRight, Placement.Top],
|
||||||
|
[Placement.Left, Placement.Left],
|
||||||
|
[Placement.LeftTop, Placement.Left],
|
||||||
|
[Placement.LeftBottom, Placement.Left],
|
||||||
|
[Placement.Right, Placement.Right],
|
||||||
|
[Placement.RightTop, Placement.Right],
|
||||||
|
[Placement.RightBottom, Placement.Right],
|
||||||
|
[Placement.BottomLeft, Placement.Bottom],
|
||||||
|
[Placement.BottomCenter, Placement.BottomCenter],
|
||||||
|
[Placement.Bottom, Placement.Bottom],
|
||||||
|
[Placement.BottomRight, Placement.Bottom]
|
||||||
|
]);
|
73
_content/AntDesign/js/split/modules/components/overlayHelper.js
Executable file
73
_content/AntDesign/js/split/modules/components/overlayHelper.js
Executable file
@ -0,0 +1,73 @@
|
|||||||
|
import { domInfoHelper, eventHelper, domManipulationHelper } from '../dom/exports';
|
||||||
|
import { Overlay } from './overlay';
|
||||||
|
import { state } from '../stateProvider';
|
||||||
|
export class overlayHelper {
|
||||||
|
static addOverlayToContainer(blazorId, overlaySelector, triggerSelector, placement, containerSelector, triggerBoundyAdjustMode, triggerIsWrappedInDiv, triggerPrefixCls, verticalOffset, horizontalOffset, arrowPointAtCenter, overlayTop, overlayLeft) {
|
||||||
|
const overlayElement = domInfoHelper.get(overlaySelector);
|
||||||
|
const containerElement = domInfoHelper.get(containerSelector);
|
||||||
|
const triggerElement = domInfoHelper.get(triggerSelector);
|
||||||
|
if (!domManipulationHelper.addElementTo(overlaySelector, containerElement)) {
|
||||||
|
console.log("Failed to add overlay. Details:", {
|
||||||
|
triggerPrefixCls: triggerPrefixCls,
|
||||||
|
overlaySelector: overlaySelector,
|
||||||
|
containerElement: containerElement
|
||||||
|
});
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
let overlayPresets;
|
||||||
|
if (overlayTop || overlayLeft) {
|
||||||
|
overlayPresets = { x: overlayLeft, y: overlayTop };
|
||||||
|
}
|
||||||
|
const overlayConstraints = {
|
||||||
|
verticalOffset: verticalOffset,
|
||||||
|
horizontalOffset: horizontalOffset,
|
||||||
|
arrowPointAtCenter: arrowPointAtCenter
|
||||||
|
};
|
||||||
|
const overlay = new Overlay(blazorId, overlayElement, containerElement, triggerElement, placement, triggerBoundyAdjustMode, triggerIsWrappedInDiv, triggerPrefixCls, overlayConstraints);
|
||||||
|
//register object in store, so it can be retrieved during update/dispose
|
||||||
|
this.overlayRegistry[blazorId] = overlay;
|
||||||
|
return overlay.calculatePosition(false, true, overlayPresets);
|
||||||
|
}
|
||||||
|
static updateOverlayPosition(blazorId, overlaySelector, triggerSelector, placement, containerSelector, triggerBoundyAdjustMode, triggerIsWrappedInDiv, triggerPrefixCls, verticalOffset, horizontalOffset, arrowPointAtCenter, overlayTop, overlayLeft) {
|
||||||
|
const overlay = this.overlayRegistry[blazorId];
|
||||||
|
if (overlay) {
|
||||||
|
let overlayPresets;
|
||||||
|
if (overlayTop || overlayLeft) {
|
||||||
|
overlayPresets = { x: overlayLeft, y: overlayTop };
|
||||||
|
}
|
||||||
|
return overlay.calculatePosition(false, false, overlayPresets);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//When page is slow, it may happen that rendering of an overlay may not happen, even if
|
||||||
|
//blazor thinks it did happen. In such a case, when overlay object is not found, just try
|
||||||
|
//to render it again.
|
||||||
|
return overlayHelper.addOverlayToContainer(blazorId, overlaySelector, triggerSelector, placement, containerSelector, triggerBoundyAdjustMode, triggerIsWrappedInDiv, triggerPrefixCls, verticalOffset, horizontalOffset, arrowPointAtCenter, overlayTop, overlayLeft);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static deleteOverlayFromContainer(blazorId) {
|
||||||
|
const overlay = this.overlayRegistry[blazorId];
|
||||||
|
if (overlay) {
|
||||||
|
overlay.dispose();
|
||||||
|
delete this.overlayRegistry[blazorId];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static addPreventEnterOnOverlayVisible(element, overlayElement) {
|
||||||
|
if (element && overlayElement) {
|
||||||
|
const dom = domInfoHelper.get(element);
|
||||||
|
if (dom) {
|
||||||
|
state.eventCallbackRegistry[element.id + "keydown:Enter"] = (e) => eventHelper.preventKeyOnCondition(e, "enter", () => overlayElement.offsetParent !== null);
|
||||||
|
dom.addEventListener("keydown", state.eventCallbackRegistry[element.id + "keydown:Enter"], false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static removePreventEnterOnOverlayVisible(element) {
|
||||||
|
if (element) {
|
||||||
|
const dom = domInfoHelper.get(element);
|
||||||
|
if (dom) {
|
||||||
|
dom.removeEventListener("keydown", state.eventCallbackRegistry[element.id + "keydown:Enter"]);
|
||||||
|
state.eventCallbackRegistry[element.id + "keydown:Enter"] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
overlayHelper.overlayRegistry = {};
|
46
_content/AntDesign/js/split/modules/components/tableHelper.js
Executable file
46
_content/AntDesign/js/split/modules/components/tableHelper.js
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
export class tableHelper {
|
||||||
|
static bindTableScroll(bodyRef, tableRef, headerRef, scrollX, scrollY) {
|
||||||
|
bodyRef.bindScroll = () => {
|
||||||
|
if (scrollX) {
|
||||||
|
tableHelper.SetScrollPositionClassName(bodyRef, tableRef);
|
||||||
|
}
|
||||||
|
if (scrollY) {
|
||||||
|
headerRef.scrollLeft = bodyRef.scrollLeft;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
bodyRef.bindScroll();
|
||||||
|
bodyRef.addEventListener('scroll', bodyRef.bindScroll);
|
||||||
|
window.addEventListener('resize', bodyRef.bindScroll);
|
||||||
|
}
|
||||||
|
static unbindTableScroll(bodyRef) {
|
||||||
|
if (bodyRef) {
|
||||||
|
bodyRef.removeEventListener('scroll', bodyRef.bindScroll);
|
||||||
|
window.removeEventListener('resize', bodyRef.bindScroll);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static SetScrollPositionClassName(bodyRef, tableRef) {
|
||||||
|
let scrollLeft = bodyRef.scrollLeft;
|
||||||
|
let scrollWidth = bodyRef.scrollWidth;
|
||||||
|
let clientWidth = bodyRef.clientWidth;
|
||||||
|
let pingLeft = false;
|
||||||
|
let pingRight = false;
|
||||||
|
if ((scrollWidth == clientWidth && scrollWidth != 0)) {
|
||||||
|
pingLeft = false;
|
||||||
|
pingRight = false;
|
||||||
|
}
|
||||||
|
else if (scrollLeft == 0) {
|
||||||
|
pingLeft = false;
|
||||||
|
pingRight = true;
|
||||||
|
}
|
||||||
|
else if (Math.abs(scrollWidth - (scrollLeft + clientWidth)) <= 1) {
|
||||||
|
pingRight = false;
|
||||||
|
pingLeft = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pingLeft = true;
|
||||||
|
pingRight = true;
|
||||||
|
}
|
||||||
|
pingLeft ? tableRef.classList.add("ant-table-ping-left") : tableRef.classList.remove("ant-table-ping-left");
|
||||||
|
pingRight ? tableRef.classList.add("ant-table-ping-right") : tableRef.classList.remove("ant-table-ping-right");
|
||||||
|
}
|
||||||
|
}
|
83
_content/AntDesign/js/split/modules/components/uploadHelper.js
Executable file
83
_content/AntDesign/js/split/modules/components/uploadHelper.js
Executable file
@ -0,0 +1,83 @@
|
|||||||
|
export class uploadHelper {
|
||||||
|
static addFileClickEventListener(btn) {
|
||||||
|
if (btn.addEventListener) {
|
||||||
|
btn.addEventListener("click", uploadHelper.fileClickEvent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static removeFileClickEventListener(btn) {
|
||||||
|
btn.removeEventListener("click", uploadHelper.fileClickEvent);
|
||||||
|
}
|
||||||
|
static fileClickEvent(e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
const fileId = e.currentTarget.attributes["data-fileid"].nodeValue;
|
||||||
|
const element = document.getElementById(fileId);
|
||||||
|
element.click();
|
||||||
|
}
|
||||||
|
static clearFile(element) {
|
||||||
|
element.setAttribute("type", "input");
|
||||||
|
element.value = '';
|
||||||
|
element.setAttribute("type", "file");
|
||||||
|
}
|
||||||
|
static getFileInfo(element) {
|
||||||
|
if (element.files && element.files.length > 0) {
|
||||||
|
let fileInfo = Array();
|
||||||
|
for (var i = 0; i < element.files.length; i++) {
|
||||||
|
let file = element.files[i];
|
||||||
|
const objectUrl = this.getObjectURL(file);
|
||||||
|
fileInfo.push({
|
||||||
|
fileName: file.name,
|
||||||
|
size: file.size,
|
||||||
|
objectURL: objectUrl,
|
||||||
|
type: file.type
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return fileInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static getObjectURL(file) {
|
||||||
|
var url = null;
|
||||||
|
if (window.URL != undefined) {
|
||||||
|
url = window.URL.createObjectURL(file);
|
||||||
|
}
|
||||||
|
else if (window.webkitURL != undefined) {
|
||||||
|
url = window.webkitURL.createObjectURL(file);
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
static uploadFile(element, index, data, headers, fileId, url, name, instance, percentMethod, successMethod, errorMethod, method) {
|
||||||
|
let formData = new FormData();
|
||||||
|
var file = element.files[index];
|
||||||
|
var size = file.size;
|
||||||
|
formData.append(name, file);
|
||||||
|
if (data != null) {
|
||||||
|
for (var key in data) {
|
||||||
|
formData.append(key, data[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const req = new XMLHttpRequest();
|
||||||
|
req.onreadystatechange = function () {
|
||||||
|
if (req.readyState === 4) {
|
||||||
|
// #1655 Any 2xx response code is okay
|
||||||
|
if (req.status < 200 || req.status > 299) {
|
||||||
|
instance.invokeMethodAsync(errorMethod, fileId, `{"status": ${req.status}}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
instance.invokeMethodAsync(successMethod, fileId, req.responseText);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
req.upload.onprogress = function (event) {
|
||||||
|
var percent = Math.floor(event.loaded / size * 100);
|
||||||
|
instance.invokeMethodAsync(percentMethod, fileId, percent);
|
||||||
|
};
|
||||||
|
req.onerror = function (e) {
|
||||||
|
instance.invokeMethodAsync(errorMethod, fileId, "error");
|
||||||
|
};
|
||||||
|
req.open(method, url, true);
|
||||||
|
if (headers != null) {
|
||||||
|
for (var header in headers) {
|
||||||
|
req.setRequestHeader(header, headers[header]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
req.send(formData);
|
||||||
|
}
|
||||||
|
}
|
177
_content/AntDesign/js/split/modules/dom/dragHelper.js
Executable file
177
_content/AntDesign/js/split/modules/dom/dragHelper.js
Executable file
@ -0,0 +1,177 @@
|
|||||||
|
const throttle = (fn, threshold = 160) => {
|
||||||
|
let timeout;
|
||||||
|
var start = +new Date;
|
||||||
|
return function (...args) {
|
||||||
|
let context = this, curTime = +new Date() - 0;
|
||||||
|
//总是干掉事件回调
|
||||||
|
window.clearTimeout(timeout);
|
||||||
|
if (curTime - start >= threshold) {
|
||||||
|
//只执行一部分方法,这些方法是在某个时间段内执行一次
|
||||||
|
fn.apply(context, args);
|
||||||
|
start = curTime;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//让方法在脱离事件后也能执行一次
|
||||||
|
timeout = window.setTimeout(() => {
|
||||||
|
//@ts-ignore
|
||||||
|
fn.apply(this, args);
|
||||||
|
}, threshold);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
const eventMap = new Map();
|
||||||
|
const defaultOptions = {
|
||||||
|
inViewport: true
|
||||||
|
};
|
||||||
|
class Dragger {
|
||||||
|
constructor(trigger, container, dragInViewport) {
|
||||||
|
this._trigger = null;
|
||||||
|
this._container = null;
|
||||||
|
this._options = null;
|
||||||
|
this._state = null;
|
||||||
|
this._isFirst = true;
|
||||||
|
this._style = null;
|
||||||
|
this.onMousedown = (e) => {
|
||||||
|
const state = this._state;
|
||||||
|
state.isInDrag = true;
|
||||||
|
state.mX = e.clientX;
|
||||||
|
state.mY = e.clientY;
|
||||||
|
this._container.style.position = "absolute";
|
||||||
|
const { left, top } = this.getContainerPos();
|
||||||
|
if (this._isFirst) {
|
||||||
|
state.domMaxY = document.documentElement.clientHeight
|
||||||
|
- this._container.offsetHeight - 1;
|
||||||
|
state.domMaxX = document.documentElement.clientWidth
|
||||||
|
- this._container.offsetWidth - 1;
|
||||||
|
state.domMaxY = state.domMaxY < 0 ? 0 : state.domMaxY;
|
||||||
|
state.domMaxX = state.domMaxX < 0 ? 0 : state.domMaxX;
|
||||||
|
this._container.style.left = left + 'px';
|
||||||
|
this._container.style.top = top + 'px';
|
||||||
|
if (!this._style) {
|
||||||
|
this._style = this._container.getAttribute("style");
|
||||||
|
}
|
||||||
|
this._isFirst = false;
|
||||||
|
}
|
||||||
|
state.domStartX = left;
|
||||||
|
state.domStartY = top;
|
||||||
|
};
|
||||||
|
this.onMouseup = (e) => {
|
||||||
|
const state = this._state;
|
||||||
|
state.isInDrag = false;
|
||||||
|
const { left, top } = this.getContainerPos();
|
||||||
|
state.domStartX = left;
|
||||||
|
state.domStartY = top;
|
||||||
|
};
|
||||||
|
this.onMousemove = throttle((e) => {
|
||||||
|
const state = this._state;
|
||||||
|
if (state.isInDrag) {
|
||||||
|
var nowX = e.clientX, nowY = e.clientY, disX = nowX - state.mX, disY = nowY - state.mY;
|
||||||
|
var newDomX = state.domStartX + disX;
|
||||||
|
var newDomY = state.domStartY + disY;
|
||||||
|
if (this._options.inViewport) {
|
||||||
|
if (newDomX < 0) {
|
||||||
|
newDomX = 0;
|
||||||
|
}
|
||||||
|
else if (newDomX > state.domMaxX) {
|
||||||
|
newDomX = state.domMaxX;
|
||||||
|
}
|
||||||
|
if (newDomY < 0) {
|
||||||
|
newDomY = 0;
|
||||||
|
}
|
||||||
|
else if (newDomY > state.domMaxY) {
|
||||||
|
newDomY = state.domMaxY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this._container.style.position = "absolute";
|
||||||
|
this._container.style.margin = "0";
|
||||||
|
this._container.style.paddingBottom = "0";
|
||||||
|
this._container.style.left = newDomX + "px";
|
||||||
|
this._container.style.top = newDomY + "px";
|
||||||
|
}
|
||||||
|
}, 10).bind(this);
|
||||||
|
this.onResize = throttle((e) => {
|
||||||
|
const state = this._state;
|
||||||
|
state.domMaxY = document.documentElement.clientHeight
|
||||||
|
- this._container.offsetHeight - 1;
|
||||||
|
state.domMaxX = document.documentElement.clientWidth
|
||||||
|
- this._container.offsetWidth - 1;
|
||||||
|
state.domMaxY = state.domMaxY < 0 ? 0 : state.domMaxY;
|
||||||
|
state.domMaxX = state.domMaxX < 0 ? 0 : state.domMaxX;
|
||||||
|
state.domStartY = parseInt(this._container.style.top);
|
||||||
|
state.domStartX = parseInt(this._container.style.left);
|
||||||
|
if (state.domStartY > state.domMaxY) {
|
||||||
|
if (state.domMaxY > 0) {
|
||||||
|
this._container.style.top = state.domMaxY + "px";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (state.domStartX > state.domMaxX) {
|
||||||
|
this._container.style.left = state.domMaxX + "px";
|
||||||
|
}
|
||||||
|
}, 10).bind(this);
|
||||||
|
this._trigger = trigger;
|
||||||
|
this._container = container;
|
||||||
|
this._options = Object.assign({}, defaultOptions, {
|
||||||
|
inViewport: dragInViewport
|
||||||
|
});
|
||||||
|
this._state = {
|
||||||
|
isInDrag: false,
|
||||||
|
mX: 0,
|
||||||
|
mY: 0,
|
||||||
|
domStartX: 0,
|
||||||
|
domStartY: 0,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
getContainerPos() {
|
||||||
|
const rect = this._container.getBoundingClientRect();
|
||||||
|
return {
|
||||||
|
left: rect.left,
|
||||||
|
top: rect.top
|
||||||
|
};
|
||||||
|
}
|
||||||
|
bindDrag() {
|
||||||
|
const trigger = this._trigger;
|
||||||
|
const options = this._options;
|
||||||
|
trigger.addEventListener("mousedown", this.onMousedown, false);
|
||||||
|
window.addEventListener("mouseup", this.onMouseup, false);
|
||||||
|
document.addEventListener("mousemove", this.onMousemove);
|
||||||
|
if (options.inViewport) {
|
||||||
|
window.addEventListener("resize", this.onResize, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unbindDrag() {
|
||||||
|
const trigger = this._trigger;
|
||||||
|
trigger.removeEventListener("mousedown", this.onMousedown, false);
|
||||||
|
window.removeEventListener("mouseup", this.onMouseup, false);
|
||||||
|
document.removeEventListener("mousemove", this.onMousemove);
|
||||||
|
if (this._options.inViewport) {
|
||||||
|
window.removeEventListener("resize", this.onResize, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resetContainerStyle() {
|
||||||
|
if (this._style !== null) {
|
||||||
|
this._isFirst = true;
|
||||||
|
this._container.setAttribute("style", this._style);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function enableDraggable(trigger, container, dragInViewport = true) {
|
||||||
|
let dragger = eventMap.get(trigger);
|
||||||
|
if (!dragger) {
|
||||||
|
dragger = new Dragger(trigger, container, dragInViewport);
|
||||||
|
eventMap.set(trigger, dragger);
|
||||||
|
}
|
||||||
|
dragger.bindDrag();
|
||||||
|
}
|
||||||
|
function disableDraggable(trigger) {
|
||||||
|
const dragger = eventMap.get(trigger);
|
||||||
|
if (dragger) {
|
||||||
|
dragger.unbindDrag();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function resetModalPosition(trigger) {
|
||||||
|
const dragger = eventMap.get(trigger);
|
||||||
|
if (dragger) {
|
||||||
|
dragger.resetContainerStyle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export { enableDraggable, disableDraggable, resetModalPosition };
|
98
_content/AntDesign/js/split/modules/dom/eventHelper.js
Executable file
98
_content/AntDesign/js/split/modules/dom/eventHelper.js
Executable file
@ -0,0 +1,98 @@
|
|||||||
|
import { domInfoHelper } from './exports';
|
||||||
|
import { state } from '../stateProvider';
|
||||||
|
export class eventHelper {
|
||||||
|
static triggerEvent(element, eventType, eventName) {
|
||||||
|
//TODO: replace with event constructors https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
|
||||||
|
//Not used
|
||||||
|
const evt = document.createEvent(eventType);
|
||||||
|
evt.initEvent(eventName);
|
||||||
|
return element.dispatchEvent(evt);
|
||||||
|
}
|
||||||
|
static addDomEventListener(element, eventName, preventDefault, invoker) {
|
||||||
|
const callback = args => {
|
||||||
|
const obj = {};
|
||||||
|
for (let k in args) {
|
||||||
|
if (k !== 'originalTarget') { //firefox occasionally raises Permission Denied when this property is being stringified
|
||||||
|
obj[k] = args[k];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const json = JSON.stringify(obj, (k, v) => {
|
||||||
|
if (v instanceof Node)
|
||||||
|
return 'Node';
|
||||||
|
if (v instanceof Window)
|
||||||
|
return 'Window';
|
||||||
|
return v;
|
||||||
|
}, ' ');
|
||||||
|
setTimeout(function () { invoker.invokeMethodAsync('Invoke', json); }, 0);
|
||||||
|
if (preventDefault === true) {
|
||||||
|
args.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (element === 'window') {
|
||||||
|
if (eventName === 'resize') {
|
||||||
|
window.addEventListener(eventName, this.debounce(() => callback({ innerWidth: window.innerWidth, innerHeight: window.innerHeight }), 200, false));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.addEventListener(eventName, callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const dom = domInfoHelper.get(element);
|
||||||
|
if (dom) {
|
||||||
|
dom.addEventListener(eventName, callback);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static addDomEventListenerToFirstChild(element, eventName, preventDefault, invoker) {
|
||||||
|
const dom = domInfoHelper.get(element);
|
||||||
|
if (dom && dom.firstElementChild) {
|
||||||
|
this.addDomEventListener(dom.firstElementChild, eventName, preventDefault, invoker);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static addPreventKeys(inputElement, keys) {
|
||||||
|
if (inputElement) {
|
||||||
|
const dom = domInfoHelper.get(inputElement);
|
||||||
|
keys = keys.map(function (x) { return x.toUpperCase(); });
|
||||||
|
state.eventCallbackRegistry[inputElement.id + "keydown"] = (e) => this.preventKeys(e, keys);
|
||||||
|
dom.addEventListener("keydown", state.eventCallbackRegistry[inputElement.id + "keydown"], false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static preventKeyOnCondition(e, key, check) {
|
||||||
|
if (e.key.toUpperCase() === key.toUpperCase() && check()) {
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static removePreventKeys(inputElement) {
|
||||||
|
if (inputElement) {
|
||||||
|
const dom = domInfoHelper.get(inputElement);
|
||||||
|
if (dom) {
|
||||||
|
dom.removeEventListener("keydown", state.eventCallbackRegistry[inputElement.id + "keydown"]);
|
||||||
|
state.eventCallbackRegistry[inputElement.id + "keydown"] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static debounce(func, wait, immediate) {
|
||||||
|
var timeout;
|
||||||
|
return () => {
|
||||||
|
const context = this, args = arguments;
|
||||||
|
const later = () => {
|
||||||
|
timeout = null;
|
||||||
|
if (!immediate)
|
||||||
|
func.apply(this, args);
|
||||||
|
};
|
||||||
|
const callNow = immediate && !timeout;
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = setTimeout(later, wait);
|
||||||
|
if (callNow)
|
||||||
|
func.apply(context, args);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
;
|
||||||
|
static preventKeys(e, keys) {
|
||||||
|
if (keys.indexOf(e.key.toUpperCase()) !== -1) {
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
5
_content/AntDesign/js/split/modules/dom/exports.js
Executable file
5
_content/AntDesign/js/split/modules/dom/exports.js
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
export { infoHelper as domInfoHelper } from './infoHelper';
|
||||||
|
export { manipulationHelper as domManipulationHelper } from './manipulationHelper';
|
||||||
|
export { eventHelper } from './eventHelper';
|
||||||
|
import * as domTypes_1 from './types';
|
||||||
|
export { domTypes_1 as domTypes };
|
137
_content/AntDesign/js/split/modules/dom/infoHelper.js
Executable file
137
_content/AntDesign/js/split/modules/dom/infoHelper.js
Executable file
@ -0,0 +1,137 @@
|
|||||||
|
export class infoHelper {
|
||||||
|
static getWindow() {
|
||||||
|
return {
|
||||||
|
innerWidth: window.innerWidth,
|
||||||
|
innerHeight: window.innerHeight
|
||||||
|
};
|
||||||
|
}
|
||||||
|
static get(element) {
|
||||||
|
if (!element) {
|
||||||
|
element = document.body;
|
||||||
|
}
|
||||||
|
else if (typeof element === 'string') {
|
||||||
|
if (element === 'document') {
|
||||||
|
return document;
|
||||||
|
}
|
||||||
|
element = document.querySelector(element);
|
||||||
|
}
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
static getInfo(element) {
|
||||||
|
let domElement = this.get(element);
|
||||||
|
if (!domElement) {
|
||||||
|
domElement = {};
|
||||||
|
}
|
||||||
|
const absolutePosition = this.getElementAbsolutePos(domElement);
|
||||||
|
const result = {
|
||||||
|
offsetTop: domElement.offsetTop || 0,
|
||||||
|
offsetLeft: domElement.offsetLeft || 0,
|
||||||
|
offsetWidth: domElement.offsetWidth || 0,
|
||||||
|
offsetHeight: domElement.offsetHeight || 0,
|
||||||
|
scrollHeight: domElement.scrollHeight || 0,
|
||||||
|
scrollWidth: domElement.scrollWidth || 0,
|
||||||
|
scrollLeft: domElement.scrollLeft || 0,
|
||||||
|
scrollTop: domElement.scrollTop || 0,
|
||||||
|
clientTop: domElement.clientTop || 0,
|
||||||
|
clientLeft: domElement.clientLeft || 0,
|
||||||
|
clientHeight: domElement.clientHeight || 0,
|
||||||
|
clientWidth: domElement.clientWidth || 0,
|
||||||
|
selectionStart: domElement.selectionStart || 0,
|
||||||
|
absoluteTop: Math.round(absolutePosition.y),
|
||||||
|
absoluteLeft: Math.round(absolutePosition.x)
|
||||||
|
};
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
static getElementAbsolutePos(element) {
|
||||||
|
const res = {
|
||||||
|
x: 0,
|
||||||
|
y: 0
|
||||||
|
};
|
||||||
|
if (element !== null) {
|
||||||
|
if (element.getBoundingClientRect) {
|
||||||
|
const viewportElement = document.documentElement;
|
||||||
|
const box = element.getBoundingClientRect();
|
||||||
|
const scrollLeft = viewportElement.scrollLeft;
|
||||||
|
const scrollTop = viewportElement.scrollTop;
|
||||||
|
res.x = box.left + scrollLeft;
|
||||||
|
res.y = box.top + scrollTop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
static getBoundingClientRect(element) {
|
||||||
|
const domElement = this.get(element);
|
||||||
|
if (domElement && domElement.getBoundingClientRect) {
|
||||||
|
const rect = domElement.getBoundingClientRect();
|
||||||
|
// Fixes #1468. This wrapping is necessary for old browsers. Remove this when one day we no longer support them.
|
||||||
|
return {
|
||||||
|
width: rect.width,
|
||||||
|
height: rect.height,
|
||||||
|
top: rect.top,
|
||||||
|
right: rect.right,
|
||||||
|
bottom: rect.bottom,
|
||||||
|
left: rect.left,
|
||||||
|
x: rect.x,
|
||||||
|
y: rect.y
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
static getFirstChildDomInfo(element) {
|
||||||
|
const domElement = this.get(element);
|
||||||
|
if (domElement) {
|
||||||
|
if (domElement.firstElementChild) {
|
||||||
|
return this.getInfo(domElement.firstElementChild);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return this.getInfo(domElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
static getActiveElement() {
|
||||||
|
const element = document.activeElement;
|
||||||
|
const id = element.getAttribute("id") || "";
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
static getScroll() {
|
||||||
|
return { x: window.pageXOffset, y: window.pageYOffset };
|
||||||
|
}
|
||||||
|
static hasFocus(selector) {
|
||||||
|
const dom = this.get(selector);
|
||||||
|
return (document.activeElement === dom);
|
||||||
|
}
|
||||||
|
static getInnerText(element) {
|
||||||
|
const dom = this.get(element);
|
||||||
|
if (dom)
|
||||||
|
return dom.innerText;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
static getMaxZIndex() {
|
||||||
|
return [...document.querySelectorAll("*")].reduce((r, e) => Math.max(r, +window.getComputedStyle(e).zIndex || 0), 0);
|
||||||
|
}
|
||||||
|
static isFixedPosition(element) {
|
||||||
|
let node = this.get(element);
|
||||||
|
while (node && node.nodeName.toLowerCase() !== 'body') {
|
||||||
|
if (window.getComputedStyle(node).getPropertyValue('position').toLowerCase() === 'fixed') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
node = node.parentNode;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
static findAncestorWithZIndex(element) {
|
||||||
|
let node = this.get(element);
|
||||||
|
let zIndexAsString;
|
||||||
|
let zIndex;
|
||||||
|
while (node && node.nodeName.toLowerCase() !== 'body') {
|
||||||
|
zIndexAsString = window.getComputedStyle(node).zIndex;
|
||||||
|
zIndex = Number.parseInt(zIndexAsString);
|
||||||
|
if (!Number.isNaN(zIndex)) {
|
||||||
|
return zIndex;
|
||||||
|
}
|
||||||
|
node = node.parentNode;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
232
_content/AntDesign/js/split/modules/dom/manipulationHelper.js
Executable file
232
_content/AntDesign/js/split/modules/dom/manipulationHelper.js
Executable file
@ -0,0 +1,232 @@
|
|||||||
|
import { domInfoHelper } from './exports';
|
||||||
|
import { styleHelper } from '../styleHelper';
|
||||||
|
import { state } from '../stateProvider';
|
||||||
|
import * as enums from '../enums';
|
||||||
|
let cachedScrollBarSize = undefined;
|
||||||
|
export class manipulationHelper {
|
||||||
|
static addElementToBody(element) {
|
||||||
|
document.body.appendChild(element);
|
||||||
|
}
|
||||||
|
static delElementFromBody(element) {
|
||||||
|
document.body.removeChild(element);
|
||||||
|
}
|
||||||
|
static addElementTo(addElement, elementSelector, prepend = false) {
|
||||||
|
let parent = domInfoHelper.get(elementSelector);
|
||||||
|
if (parent && addElement) {
|
||||||
|
if (parent instanceof Node && addElement instanceof Node) {
|
||||||
|
if (prepend)
|
||||||
|
parent.insertBefore(addElement, parent.firstChild);
|
||||||
|
else
|
||||||
|
parent.appendChild(addElement);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log("does not implement node", parent, addElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
static delElementFrom(delElement, elementSelector) {
|
||||||
|
let parent = domInfoHelper.get(elementSelector);
|
||||||
|
if (parent && delElement) {
|
||||||
|
parent.removeChild(delElement);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static setDomAttribute(element, attributes) {
|
||||||
|
let dom = domInfoHelper.get(element);
|
||||||
|
if (dom) {
|
||||||
|
for (let key in attributes) {
|
||||||
|
dom.setAttribute(key, attributes[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static copyElement(element) {
|
||||||
|
if (!this.copyElementAsRichText(element)) {
|
||||||
|
this.copy(element.innerText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static copyElementAsRichText(element) {
|
||||||
|
var selection = document.getSelection();
|
||||||
|
if (selection.rangeCount > 0) {
|
||||||
|
selection.removeAllRanges();
|
||||||
|
}
|
||||||
|
var range = document.createRange();
|
||||||
|
range.selectNode(element);
|
||||||
|
selection.addRange(range);
|
||||||
|
try {
|
||||||
|
var successful = document.execCommand('copy');
|
||||||
|
selection.removeAllRanges();
|
||||||
|
return successful;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
selection.removeAllRanges();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static copy(text) {
|
||||||
|
if (!navigator.clipboard) {
|
||||||
|
this.fallbackCopyTextToClipboard(text);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
navigator.clipboard.writeText(text).then(function () {
|
||||||
|
console.log('Async: Copying to clipboard was successful!');
|
||||||
|
}, function (err) {
|
||||||
|
console.error('Async: Could not copy text: ', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
static fallbackCopyTextToClipboard(text) {
|
||||||
|
var textArea = document.createElement("textarea");
|
||||||
|
textArea.value = text;
|
||||||
|
// Avoid scrolling to bottom
|
||||||
|
textArea.style.top = "0";
|
||||||
|
textArea.style.left = "0";
|
||||||
|
textArea.style.position = "fixed";
|
||||||
|
document.body.appendChild(textArea);
|
||||||
|
textArea.focus();
|
||||||
|
textArea.select();
|
||||||
|
try {
|
||||||
|
var successful = document.execCommand('copy');
|
||||||
|
var msg = successful ? 'successful' : 'unsuccessful';
|
||||||
|
console.log('Fallback: Copying text command was ' + msg);
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error('Fallback: Oops, unable to copy', err);
|
||||||
|
}
|
||||||
|
document.body.removeChild(textArea);
|
||||||
|
}
|
||||||
|
static focus(selector, noScroll = false, option = enums.FocusBehavior.FocusAtLast) {
|
||||||
|
let dom = domInfoHelper.get(selector);
|
||||||
|
if (!(dom instanceof HTMLElement))
|
||||||
|
throw new Error("Unable to focus on invalid element.");
|
||||||
|
dom.focus({
|
||||||
|
preventScroll: noScroll
|
||||||
|
});
|
||||||
|
if (dom instanceof HTMLInputElement || dom instanceof HTMLTextAreaElement) {
|
||||||
|
switch (option) {
|
||||||
|
case enums.FocusBehavior.FocusAndSelectAll:
|
||||||
|
dom.select();
|
||||||
|
break;
|
||||||
|
case enums.FocusBehavior.FocusAtFirst:
|
||||||
|
dom.setSelectionRange(0, 0);
|
||||||
|
break;
|
||||||
|
case enums.FocusBehavior.FocusAtLast:
|
||||||
|
dom.setSelectionRange(-1, -1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static blur(selector) {
|
||||||
|
let dom = domInfoHelper.get(selector);
|
||||||
|
if (dom) {
|
||||||
|
dom.blur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static scrollTo(selector, parentElement) {
|
||||||
|
const element = domInfoHelper.get(selector);
|
||||||
|
if (parentElement && element && element instanceof HTMLElement) {
|
||||||
|
parentElement.scrollTop = element.offsetTop;
|
||||||
|
}
|
||||||
|
else if (element && element instanceof HTMLElement) {
|
||||||
|
element.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'start' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static slideTo(targetPageY) {
|
||||||
|
const timer = setInterval(function () {
|
||||||
|
const currentY = document.documentElement.scrollTop || document.body.scrollTop;
|
||||||
|
const distance = targetPageY > currentY ? targetPageY - currentY : currentY - targetPageY;
|
||||||
|
const speed = Math.ceil(distance / 10);
|
||||||
|
if (currentY === targetPageY) {
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.scrollTo(0, targetPageY > currentY ? currentY + speed : currentY - speed);
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
//copied from https://www.telerik.com/forums/trigger-tab-key-when-enter-key-is-pressed
|
||||||
|
static invokeTabKey() {
|
||||||
|
var currInput = document.activeElement;
|
||||||
|
if (currInput.tagName.toLowerCase() == "input") {
|
||||||
|
var inputs = document.getElementsByTagName("input");
|
||||||
|
var currInput = document.activeElement;
|
||||||
|
for (var i = 0; i < inputs.length; i++) {
|
||||||
|
if (inputs[i] == currInput) {
|
||||||
|
var next = inputs[i + 1];
|
||||||
|
if (next && next.focus) {
|
||||||
|
next.focus();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static disableBodyScroll() {
|
||||||
|
let body = document.body;
|
||||||
|
const oldBodyCache = {};
|
||||||
|
["position", "width", "overflow"].forEach((key) => {
|
||||||
|
oldBodyCache[key] = body.style[key];
|
||||||
|
});
|
||||||
|
state.oldBodyCacheStack.push(oldBodyCache);
|
||||||
|
const scrollBarSize = this.getScrollBarSize();
|
||||||
|
styleHelper.css(body, {
|
||||||
|
"position": "relative",
|
||||||
|
"width": this.hasScrollbar() && scrollBarSize > 0 ? `calc(100% - ${scrollBarSize}px)` : null,
|
||||||
|
"overflow": "hidden"
|
||||||
|
});
|
||||||
|
styleHelper.addCls(document.body, "ant-scrolling-effect");
|
||||||
|
}
|
||||||
|
static enableBodyScroll() {
|
||||||
|
var _a, _b, _c;
|
||||||
|
let oldBodyCache = state.oldBodyCacheStack.length > 0 ? state.oldBodyCacheStack.pop() : {};
|
||||||
|
styleHelper.css(document.body, {
|
||||||
|
"position": (_a = oldBodyCache["position"]) !== null && _a !== void 0 ? _a : null,
|
||||||
|
"width": (_b = oldBodyCache["width"]) !== null && _b !== void 0 ? _b : null,
|
||||||
|
"overflow": (_c = oldBodyCache["overflow"]) !== null && _c !== void 0 ? _c : null
|
||||||
|
});
|
||||||
|
styleHelper.removeCls(document.body, "ant-scrolling-effect");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
manipulationHelper.hasScrollbar = () => {
|
||||||
|
let overflow = document.body.style.overflow;
|
||||||
|
if (overflow && overflow === "hidden")
|
||||||
|
return false;
|
||||||
|
return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight);
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* getScrollBarSize
|
||||||
|
* source https://github.com/react-component/util/blob/master/src/getScrollBarSize.tsx
|
||||||
|
*
|
||||||
|
* @param fresh force get scrollBar size and don't use cache
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
manipulationHelper.getScrollBarSize = (fresh = false) => {
|
||||||
|
if (typeof document === "undefined") {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (fresh || cachedScrollBarSize === undefined) {
|
||||||
|
const inner = document.createElement("div");
|
||||||
|
inner.style.width = "100%";
|
||||||
|
inner.style.height = "200px";
|
||||||
|
const outer = document.createElement("div");
|
||||||
|
const outerStyle = outer.style;
|
||||||
|
outerStyle.position = "absolute";
|
||||||
|
outerStyle.top = "0";
|
||||||
|
outerStyle.left = "0";
|
||||||
|
outerStyle.pointerEvents = "none";
|
||||||
|
outerStyle.visibility = "hidden";
|
||||||
|
outerStyle.width = "200px";
|
||||||
|
outerStyle.height = "150px";
|
||||||
|
outerStyle.overflow = "hidden";
|
||||||
|
outer.appendChild(inner);
|
||||||
|
document.body.appendChild(outer);
|
||||||
|
const widthContained = inner.offsetWidth;
|
||||||
|
outer.style.overflow = "scroll";
|
||||||
|
let widthScroll = inner.offsetWidth;
|
||||||
|
if (widthContained === widthScroll) {
|
||||||
|
widthScroll = outer.clientWidth;
|
||||||
|
}
|
||||||
|
document.body.removeChild(outer);
|
||||||
|
cachedScrollBarSize = widthContained - widthScroll;
|
||||||
|
}
|
||||||
|
return cachedScrollBarSize;
|
||||||
|
};
|
0
_content/AntDesign/js/split/modules/dom/types.js
Executable file
0
_content/AntDesign/js/split/modules/dom/types.js
Executable file
16
_content/AntDesign/js/split/modules/enums.js
Executable file
16
_content/AntDesign/js/split/modules/enums.js
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
export var FocusBehavior;
|
||||||
|
(function (FocusBehavior) {
|
||||||
|
/// <summary>
|
||||||
|
/// When focuses, cursor will move to the last character.
|
||||||
|
/// This is default behavior.
|
||||||
|
/// </summary>
|
||||||
|
FocusBehavior[FocusBehavior["FocusAtLast"] = 0] = "FocusAtLast";
|
||||||
|
/// <summary>
|
||||||
|
/// When focuses, cursor will move to the first character
|
||||||
|
/// </summary>
|
||||||
|
FocusBehavior[FocusBehavior["FocusAtFirst"] = 1] = "FocusAtFirst";
|
||||||
|
/// <summary>
|
||||||
|
/// When focuses, the content will be selected
|
||||||
|
/// </summary>
|
||||||
|
FocusBehavior[FocusBehavior["FocusAndSelectAll"] = 2] = "FocusAndSelectAll";
|
||||||
|
})(FocusBehavior || (FocusBehavior = {}));
|
23
_content/AntDesign/js/split/modules/stateProvider.js
Executable file
23
_content/AntDesign/js/split/modules/stateProvider.js
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
//Singleton
|
||||||
|
export class State {
|
||||||
|
constructor() {
|
||||||
|
//Stores references to dot net objects (components wrapped in DotNetObjectReference)
|
||||||
|
this.objReferenceDict = {};
|
||||||
|
//Stores callback for events based on a key. Needed when
|
||||||
|
//Event needs to be removed - the callback can be retrieved and
|
||||||
|
//used to remove the event in question
|
||||||
|
this.eventCallbackRegistry = {};
|
||||||
|
this.oldBodyCacheStack = [];
|
||||||
|
}
|
||||||
|
//All object references must later be disposed by JS code or by .NET code.
|
||||||
|
disposeObj(objReferenceName) {
|
||||||
|
delete this.objReferenceDict[objReferenceName];
|
||||||
|
}
|
||||||
|
static getInstance() {
|
||||||
|
if (!this.instance) {
|
||||||
|
this.instance = new State();
|
||||||
|
}
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export const state = State.getInstance();
|
71
_content/AntDesign/js/split/modules/styleHelper.js
Executable file
71
_content/AntDesign/js/split/modules/styleHelper.js
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
import { infoHelper as domInfoHelper } from './dom/infoHelper';
|
||||||
|
export class styleHelper {
|
||||||
|
static addCls(selector, className) {
|
||||||
|
let element = domInfoHelper.get(selector);
|
||||||
|
if (element) {
|
||||||
|
if (typeof className === "string") {
|
||||||
|
element.classList.add(className);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
element.classList.add(...className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static removeCls(selector, clsName) {
|
||||||
|
let element = domInfoHelper.get(selector);
|
||||||
|
if (element) {
|
||||||
|
if (typeof clsName === "string") {
|
||||||
|
element.classList.remove(clsName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
element.classList.remove(...clsName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static addClsToFirstChild(element, className) {
|
||||||
|
var domElement = domInfoHelper.get(element);
|
||||||
|
if (domElement && domElement.firstElementChild) {
|
||||||
|
domElement.firstElementChild.classList.add(className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static removeClsFromFirstChild(element, className) {
|
||||||
|
var domElement = domInfoHelper.get(element);
|
||||||
|
if (domElement && domElement.firstElementChild) {
|
||||||
|
domElement.firstElementChild.classList.remove(className);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static matchMedia(query) {
|
||||||
|
return window.matchMedia(query).matches;
|
||||||
|
}
|
||||||
|
static getStyle(element, styleProp) {
|
||||||
|
if (element.currentStyle)
|
||||||
|
return element.currentStyle[styleProp];
|
||||||
|
else if (window.getComputedStyle)
|
||||||
|
return document.defaultView.getComputedStyle(element, null).getPropertyValue(styleProp);
|
||||||
|
}
|
||||||
|
//Referenced in Caret, class Mirror
|
||||||
|
static css(element, name, value = null) {
|
||||||
|
if (typeof name === 'string') {
|
||||||
|
if (value === null) {
|
||||||
|
let style = name;
|
||||||
|
let cssAttributes = style.split(";");
|
||||||
|
for (let i = 0; i < cssAttributes.length; i++) {
|
||||||
|
let cssAttribute = cssAttributes[i];
|
||||||
|
if (!cssAttribute)
|
||||||
|
continue;
|
||||||
|
let attribute = cssAttribute.split(":");
|
||||||
|
element.style.setProperty(attribute[0], attribute[1]);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
element.style.setProperty(name, value);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (let key in name) {
|
||||||
|
if (name.hasOwnProperty(key)) {
|
||||||
|
element.style.setProperty(key, name[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/affix/style/entry.less
Executable file
1
_content/AntDesign/less/affix/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
6
_content/AntDesign/less/affix/style/index.less
Executable file
6
_content/AntDesign/less/affix/style/index.less
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
|
||||||
|
.@{ant-prefix}-affix {
|
||||||
|
position: fixed;
|
||||||
|
z-index: @zindex-affix;
|
||||||
|
}
|
1
_content/AntDesign/less/alert/style/entry.less
Executable file
1
_content/AntDesign/less/alert/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
152
_content/AntDesign/less/alert/style/index.less
Executable file
152
_content/AntDesign/less/alert/style/index.less
Executable file
@ -0,0 +1,152 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@alert-prefix-cls: ~'@{ant-prefix}-alert';
|
||||||
|
|
||||||
|
.@{alert-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 8px 15px;
|
||||||
|
word-wrap: break-word;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
margin-right: @margin-xs;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-description {
|
||||||
|
display: none;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: @font-size-base + 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-success {
|
||||||
|
background-color: @alert-success-bg-color;
|
||||||
|
border: @border-width-base @border-style-base @alert-success-border-color;
|
||||||
|
.@{alert-prefix-cls}-icon {
|
||||||
|
color: @alert-success-icon-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-info {
|
||||||
|
background-color: @alert-info-bg-color;
|
||||||
|
border: @border-width-base @border-style-base @alert-info-border-color;
|
||||||
|
.@{alert-prefix-cls}-icon {
|
||||||
|
color: @alert-info-icon-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-warning {
|
||||||
|
background-color: @alert-warning-bg-color;
|
||||||
|
border: @border-width-base @border-style-base @alert-warning-border-color;
|
||||||
|
.@{alert-prefix-cls}-icon {
|
||||||
|
color: @alert-warning-icon-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-error {
|
||||||
|
background-color: @alert-error-bg-color;
|
||||||
|
border: @border-width-base @border-style-base @alert-error-border-color;
|
||||||
|
|
||||||
|
.@{alert-prefix-cls}-icon {
|
||||||
|
color: @alert-error-icon-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{alert-prefix-cls}-description > pre {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-action {
|
||||||
|
margin-left: @margin-xs;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-close-icon {
|
||||||
|
margin-left: @margin-xs;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: @font-size-sm;
|
||||||
|
line-height: @font-size-sm;
|
||||||
|
background-color: transparent;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.@{iconfont-css-prefix}-close {
|
||||||
|
color: @alert-close-color;
|
||||||
|
transition: color 0.3s;
|
||||||
|
&:hover {
|
||||||
|
color: @alert-close-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-close-text {
|
||||||
|
color: @alert-close-color;
|
||||||
|
transition: color 0.3s;
|
||||||
|
&:hover {
|
||||||
|
color: @alert-close-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-description {
|
||||||
|
align-items: flex-start;
|
||||||
|
padding: @alert-with-description-padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-description&-no-icon {
|
||||||
|
padding: @alert-with-description-no-icon-padding-vertical 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-description &-icon {
|
||||||
|
margin-right: @alert-with-description-padding-vertical;
|
||||||
|
font-size: @alert-with-description-icon-size;
|
||||||
|
}
|
||||||
|
&-with-description &-message {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
color: @alert-message-color;
|
||||||
|
font-size: @font-size-lg;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-message {
|
||||||
|
color: @alert-message-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-description &-description {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&&-motion-leave {
|
||||||
|
overflow: hidden;
|
||||||
|
opacity: 1;
|
||||||
|
transition: max-height 0.3s @ease-in-out-circ, opacity 0.3s @ease-in-out-circ,
|
||||||
|
padding-top 0.3s @ease-in-out-circ, padding-bottom 0.3s @ease-in-out-circ,
|
||||||
|
margin-bottom 0.3s @ease-in-out-circ;
|
||||||
|
}
|
||||||
|
|
||||||
|
&&-motion-leave-active {
|
||||||
|
max-height: 0;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-banner {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
39
_content/AntDesign/less/alert/style/rtl.less
Executable file
39
_content/AntDesign/less/alert/style/rtl.less
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
.@{alert-prefix-cls} {
|
||||||
|
&&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&&-no-icon {
|
||||||
|
.@{alert-prefix-cls}-rtl& {
|
||||||
|
padding: @alert-no-icon-padding-vertical 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
.@{alert-prefix-cls}-rtl & {
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: @margin-xs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-action {
|
||||||
|
.@{alert-prefix-cls}-rtl & {
|
||||||
|
margin-right: @margin-xs;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-close-icon {
|
||||||
|
.@{alert-prefix-cls}-rtl & {
|
||||||
|
margin-right: @margin-xs;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-description &-icon {
|
||||||
|
.@{alert-prefix-cls}-rtl& {
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: @alert-with-description-padding-vertical;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/anchor/style/entry.less
Executable file
1
_content/AntDesign/less/anchor/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
84
_content/AntDesign/less/anchor/style/index.less
Executable file
84
_content/AntDesign/less/anchor/style/index.less
Executable file
@ -0,0 +1,84 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@anchor-border-width: 2px;
|
||||||
|
|
||||||
|
.@{ant-prefix}-anchor {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
padding-left: @anchor-border-width;
|
||||||
|
|
||||||
|
&-wrapper {
|
||||||
|
margin-left: -4px;
|
||||||
|
padding-left: 4px;
|
||||||
|
overflow: auto;
|
||||||
|
background-color: @anchor-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-ink {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
height: 100%;
|
||||||
|
&::before {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
width: @anchor-border-width;
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
background-color: @anchor-border-color;
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
&-ball {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
display: none;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
background-color: @component-background;
|
||||||
|
border: 2px solid @primary-color;
|
||||||
|
border-radius: 8px;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
transition: top 0.3s ease-in-out;
|
||||||
|
&.visible {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.fixed &-ink &-ink-ball {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link {
|
||||||
|
padding: @anchor-link-padding;
|
||||||
|
line-height: 1.143;
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
overflow: hidden;
|
||||||
|
color: @text-color;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&:only-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-active > &-title {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link &-link {
|
||||||
|
padding-top: 5px;
|
||||||
|
padding-bottom: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
35
_content/AntDesign/less/anchor/style/rtl.less
Executable file
35
_content/AntDesign/less/anchor/style/rtl.less
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
.@{ant-prefix}-anchor {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-wrapper {
|
||||||
|
.@{ant-prefix}-anchor-rtl& {
|
||||||
|
margin-right: -4px;
|
||||||
|
margin-left: 0;
|
||||||
|
padding-right: 4px;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-ink {
|
||||||
|
.@{ant-prefix}-anchor-rtl & {
|
||||||
|
right: 0;
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-ball {
|
||||||
|
.@{ant-prefix}-anchor-rtl & {
|
||||||
|
right: 50%;
|
||||||
|
left: 0;
|
||||||
|
transform: translateX(50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link {
|
||||||
|
.@{ant-prefix}-anchor-rtl & {
|
||||||
|
padding: @anchor-link-top @anchor-link-left @anchor-link-top 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
3
_content/AntDesign/less/ant-design-blazor.aliyun.less
Executable file
3
_content/AntDesign/less/ant-design-blazor.aliyun.less
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
@import "./style/aliyun.less";
|
||||||
|
@import "./style/entry.less";
|
||||||
|
@import "./components.less";
|
3
_content/AntDesign/less/ant-design-blazor.compact.less
Executable file
3
_content/AntDesign/less/ant-design-blazor.compact.less
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
@import "./style/compact.less";
|
||||||
|
@import "./style/entry.less";
|
||||||
|
@import "./components.less";
|
3
_content/AntDesign/less/ant-design-blazor.dark.less
Executable file
3
_content/AntDesign/less/ant-design-blazor.dark.less
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
@import "./style/dark.less";
|
||||||
|
@import "./style/entry.less";
|
||||||
|
@import "./components.less";
|
2
_content/AntDesign/less/ant-design-blazor.less
Executable file
2
_content/AntDesign/less/ant-design-blazor.less
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
@import "./style/entry.less";
|
||||||
|
@import "./components.less";
|
1
_content/AntDesign/less/auto-complete/style/entry.less
Executable file
1
_content/AntDesign/less/auto-complete/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
16
_content/AntDesign/less/auto-complete/style/index.less
Executable file
16
_content/AntDesign/less/auto-complete/style/index.less
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
@import '../../input/style/mixin';
|
||||||
|
|
||||||
|
@input-prefix-cls: ~'@{ant-prefix}-input';
|
||||||
|
@select-prefix-cls: ~'@{ant-prefix}-select';
|
||||||
|
@autocomplete-prefix-cls: ~'@{select-prefix-cls}-auto-complete';
|
||||||
|
|
||||||
|
.@{autocomplete-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
// https://github.com/ant-design/ant-design/issues/22302
|
||||||
|
.@{select-prefix-cls}-clear {
|
||||||
|
right: 13px;
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/avatar/style/entry.less
Executable file
1
_content/AntDesign/less/avatar/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
17
_content/AntDesign/less/avatar/style/group.less
Executable file
17
_content/AntDesign/less/avatar/style/group.less
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
.@{avatar-prefix-cls}-group {
|
||||||
|
display: inline-flex;
|
||||||
|
|
||||||
|
.@{avatar-prefix-cls} {
|
||||||
|
border: 1px solid @avatar-group-border-color;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-left: @avatar-group-overlapping;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-popover {
|
||||||
|
.@{ant-prefix}-avatar + .@{ant-prefix}-avatar {
|
||||||
|
margin-left: @avatar-group-space;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
70
_content/AntDesign/less/avatar/style/index.less
Executable file
70
_content/AntDesign/less/avatar/style/index.less
Executable file
@ -0,0 +1,70 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@avatar-prefix-cls: ~'@{ant-prefix}-avatar';
|
||||||
|
|
||||||
|
.@{avatar-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
color: @avatar-color;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: middle;
|
||||||
|
background: @avatar-bg;
|
||||||
|
|
||||||
|
&-image {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ant-prefix}-image-img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-size(@avatar-size-base, @avatar-font-size-base);
|
||||||
|
|
||||||
|
&-lg {
|
||||||
|
.avatar-size(@avatar-size-lg, @avatar-font-size-lg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-sm {
|
||||||
|
.avatar-size(@avatar-size-sm, @avatar-font-size-sm);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-square {
|
||||||
|
border-radius: @avatar-border-radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > img {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-size(@size, @font-size) {
|
||||||
|
width: @size;
|
||||||
|
height: @size;
|
||||||
|
line-height: @size;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
&-string {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform-origin: 0 center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{avatar-prefix-cls}-icon {
|
||||||
|
font-size: @font-size;
|
||||||
|
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './group';
|
||||||
|
@import './rtl';
|
15
_content/AntDesign/less/avatar/style/rtl.less
Executable file
15
_content/AntDesign/less/avatar/style/rtl.less
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
.@{avatar-prefix-cls}-group {
|
||||||
|
&-rtl {
|
||||||
|
.@{avatar-prefix-cls}:not(:first-child) {
|
||||||
|
margin-right: @avatar-group-overlapping;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-popover.@{ant-prefix}-popover-rtl {
|
||||||
|
.@{ant-prefix}-avatar + .@{ant-prefix}-avatar {
|
||||||
|
margin-right: @avatar-group-space;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/back-top/style/entry.less
Executable file
1
_content/AntDesign/less/back-top/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
49
_content/AntDesign/less/back-top/style/index.less
Executable file
49
_content/AntDesign/less/back-top/style/index.less
Executable file
@ -0,0 +1,49 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@backtop-prefix-cls: ~'@{ant-prefix}-back-top';
|
||||||
|
|
||||||
|
.@{backtop-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: fixed;
|
||||||
|
right: 100px;
|
||||||
|
bottom: 50px;
|
||||||
|
z-index: @zindex-back-top;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:empty {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-rtl {
|
||||||
|
right: auto;
|
||||||
|
left: 100px;
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
overflow: hidden;
|
||||||
|
color: @back-top-color;
|
||||||
|
text-align: center;
|
||||||
|
background-color: @back-top-bg;
|
||||||
|
border-radius: 20px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: @back-top-hover-bg;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './responsive';
|
11
_content/AntDesign/less/back-top/style/responsive.less
Executable file
11
_content/AntDesign/less/back-top/style/responsive.less
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
@media screen and (max-width: @screen-md) {
|
||||||
|
.@{backtop-prefix-cls} {
|
||||||
|
right: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: @screen-xs) {
|
||||||
|
.@{backtop-prefix-cls} {
|
||||||
|
right: 20px;
|
||||||
|
}
|
||||||
|
}
|
2
_content/AntDesign/less/badge/style/entry.less
Executable file
2
_content/AntDesign/less/badge/style/entry.less
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
@import './index.less';
|
||||||
|
@import './patch.less';
|
268
_content/AntDesign/less/badge/style/index.less
Executable file
268
_content/AntDesign/less/badge/style/index.less
Executable file
@ -0,0 +1,268 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@badge-prefix-cls: ~'@{ant-prefix}-badge';
|
||||||
|
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
|
||||||
|
|
||||||
|
.@{badge-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
&-count {
|
||||||
|
z-index: @zindex-badge;
|
||||||
|
min-width: @badge-height;
|
||||||
|
height: @badge-height;
|
||||||
|
padding: 0 6px;
|
||||||
|
color: @badge-text-color;
|
||||||
|
font-weight: @badge-font-weight;
|
||||||
|
font-size: @badge-font-size;
|
||||||
|
line-height: @badge-height;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
background: @badge-color;
|
||||||
|
border-radius: (@badge-height / 2);
|
||||||
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
||||||
|
a,
|
||||||
|
a:hover {
|
||||||
|
color: @badge-text-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-count-sm {
|
||||||
|
min-width: @badge-height-sm;
|
||||||
|
height: @badge-height-sm;
|
||||||
|
padding: 0;
|
||||||
|
font-size: @badge-font-size-sm;
|
||||||
|
line-height: @badge-height-sm;
|
||||||
|
border-radius: (@badge-height-sm / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-multiple-words {
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dot {
|
||||||
|
z-index: @zindex-badge;
|
||||||
|
width: @badge-dot-size;
|
||||||
|
min-width: @badge-dot-size;
|
||||||
|
height: @badge-dot-size;
|
||||||
|
background: @highlight-color;
|
||||||
|
border-radius: 100%;
|
||||||
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tricky way to resolve https://github.com/ant-design/ant-design/issues/30088
|
||||||
|
&-dot.@{number-prefix-cls} {
|
||||||
|
transition: background 1.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-count,
|
||||||
|
&-dot,
|
||||||
|
.@{number-prefix-cls}-custom-component {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
transform: translate(50%, -50%);
|
||||||
|
transform-origin: 100% 0%;
|
||||||
|
|
||||||
|
&.@{iconfont-css-prefix}-spin {
|
||||||
|
animation: antBadgeLoadingCircle 1s infinite linear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-status {
|
||||||
|
line-height: inherit;
|
||||||
|
vertical-align: baseline;
|
||||||
|
|
||||||
|
&-dot {
|
||||||
|
position: relative;
|
||||||
|
top: -1px;
|
||||||
|
display: inline-block;
|
||||||
|
width: @badge-status-size;
|
||||||
|
height: @badge-status-size;
|
||||||
|
vertical-align: middle;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
&-success {
|
||||||
|
background-color: @success-color;
|
||||||
|
}
|
||||||
|
&-processing {
|
||||||
|
position: relative;
|
||||||
|
background-color: @processing-color;
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid @processing-color;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: antStatusProcessing 1.2s infinite ease-in-out;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-default {
|
||||||
|
background-color: @normal-color;
|
||||||
|
}
|
||||||
|
&-error {
|
||||||
|
background-color: @error-color;
|
||||||
|
}
|
||||||
|
&-warning {
|
||||||
|
background-color: @warning-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
// mixin to iterate over colors and create CSS class for each one
|
||||||
|
.make-color-classes(@i: length(@preset-colors)) when (@i > 0) {
|
||||||
|
.make-color-classes(@i - 1);
|
||||||
|
@color: extract(@preset-colors, @i);
|
||||||
|
@darkColor: '@{color}-6';
|
||||||
|
&-@{color} {
|
||||||
|
background: @@darkColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.make-color-classes();
|
||||||
|
|
||||||
|
&-text {
|
||||||
|
margin-left: 8px;
|
||||||
|
color: @text-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-zoom-appear,
|
||||||
|
&-zoom-enter {
|
||||||
|
animation: antZoomBadgeIn @animation-duration-slow @ease-out-back;
|
||||||
|
animation-fill-mode: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-zoom-leave {
|
||||||
|
animation: antZoomBadgeOut @animation-duration-slow @ease-in-back;
|
||||||
|
animation-fill-mode: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-not-a-wrapper {
|
||||||
|
.@{badge-prefix-cls}-zoom-appear,
|
||||||
|
.@{badge-prefix-cls}-zoom-enter {
|
||||||
|
animation: antNoWrapperZoomBadgeIn @animation-duration-slow @ease-out-back;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{badge-prefix-cls}-zoom-leave {
|
||||||
|
animation: antNoWrapperZoomBadgeOut @animation-duration-slow @ease-in-back;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.@{badge-prefix-cls}-status) {
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{number-prefix-cls}-custom-component {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{number-prefix-cls}-custom-component,
|
||||||
|
.@{number-prefix-cls} {
|
||||||
|
position: relative;
|
||||||
|
top: auto;
|
||||||
|
display: block;
|
||||||
|
transform-origin: 50% 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{badge-prefix-cls}-count {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antStatusProcessing {
|
||||||
|
0% {
|
||||||
|
transform: scale(0.8);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(2.4);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safari will blink with transform when inner element has absolute style.
|
||||||
|
.safari-fix-motion() {
|
||||||
|
-webkit-transform-style: preserve-3d;
|
||||||
|
-webkit-backface-visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{number-prefix-cls} {
|
||||||
|
overflow: hidden;
|
||||||
|
&-only {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
height: @badge-height;
|
||||||
|
transition: all @animation-duration-slow @ease-in-out;
|
||||||
|
.safari-fix-motion;
|
||||||
|
|
||||||
|
> p.@{number-prefix-cls}-only-unit {
|
||||||
|
height: @badge-height;
|
||||||
|
margin: 0;
|
||||||
|
.safari-fix-motion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-symbol {
|
||||||
|
vertical-align: top;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antZoomBadgeIn {
|
||||||
|
0% {
|
||||||
|
transform: scale(0) translate(50%, -50%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1) translate(50%, -50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antZoomBadgeOut {
|
||||||
|
0% {
|
||||||
|
transform: scale(1) translate(50%, -50%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0) translate(50%, -50%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antNoWrapperZoomBadgeIn {
|
||||||
|
0% {
|
||||||
|
transform: scale(0);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antNoWrapperZoomBadgeOut {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antBadgeLoadingCircle {
|
||||||
|
0% {
|
||||||
|
transform-origin: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: translate(50%, -50%) rotate(360deg);
|
||||||
|
transform-origin: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './ribbon';
|
||||||
|
@import './rtl';
|
12
_content/AntDesign/less/badge/style/patch.less
Executable file
12
_content/AntDesign/less/badge/style/patch.less
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
@import './index.less';
|
||||||
|
|
||||||
|
.@{badge-prefix-cls} {
|
||||||
|
|
||||||
|
&-count:not(.@{badge-prefix-cls}-count-overflow) {
|
||||||
|
font-size: 0;
|
||||||
|
|
||||||
|
.@{number-prefix-cls}-only {
|
||||||
|
font-size: @badge-font-size;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
81
_content/AntDesign/less/badge/style/ribbon.less
Executable file
81
_content/AntDesign/less/badge/style/ribbon.less
Executable file
@ -0,0 +1,81 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@ribbon-prefix-cls: ~'@{ant-prefix}-ribbon';
|
||||||
|
@ribbon-wrapper-prefix-cls: ~'@{ant-prefix}-ribbon-wrapper';
|
||||||
|
|
||||||
|
.@{ribbon-wrapper-prefix-cls} {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ribbon-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
top: 8px;
|
||||||
|
height: 22px;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: @badge-text-color;
|
||||||
|
line-height: 22px;
|
||||||
|
white-space: nowrap;
|
||||||
|
background-color: @primary-color;
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
|
||||||
|
&-text {
|
||||||
|
color: @white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-corner {
|
||||||
|
position: absolute;
|
||||||
|
top: 100%;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
color: currentColor;
|
||||||
|
border: 4px solid;
|
||||||
|
transform: scaleY(0.75);
|
||||||
|
transform-origin: top;
|
||||||
|
// If not support IE 11, use filter: brightness(75%) instead
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
top: -4px;
|
||||||
|
left: -4px;
|
||||||
|
width: inherit;
|
||||||
|
height: inherit;
|
||||||
|
color: rgba(0, 0, 0, 0.25);
|
||||||
|
border: inherit;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// colors
|
||||||
|
// mixin to iterate over colors and create CSS class for each one
|
||||||
|
.make-color-classes(@i: length(@preset-colors)) when (@i > 0) {
|
||||||
|
.make-color-classes(@i - 1);
|
||||||
|
@color: extract(@preset-colors, @i);
|
||||||
|
@darkColor: '@{color}-6';
|
||||||
|
&-color-@{color} {
|
||||||
|
color: @@darkColor;
|
||||||
|
background: @@darkColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.make-color-classes();
|
||||||
|
|
||||||
|
// placement
|
||||||
|
&.@{ribbon-prefix-cls}-placement-end {
|
||||||
|
right: -8px;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
.@{ribbon-prefix-cls}-corner {
|
||||||
|
right: 0;
|
||||||
|
border-color: currentColor transparent transparent currentColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{ribbon-prefix-cls}-placement-start {
|
||||||
|
left: -8px;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
.@{ribbon-prefix-cls}-corner {
|
||||||
|
left: 0;
|
||||||
|
border-color: currentColor currentColor transparent transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
104
_content/AntDesign/less/badge/style/rtl.less
Executable file
104
_content/AntDesign/less/badge/style/rtl.less
Executable file
@ -0,0 +1,104 @@
|
|||||||
|
.@{badge-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-count,
|
||||||
|
&-dot,
|
||||||
|
.@{number-prefix-cls}-custom-component {
|
||||||
|
.@{badge-prefix-cls}-rtl & {
|
||||||
|
right: auto;
|
||||||
|
left: 0;
|
||||||
|
direction: ltr;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
transform-origin: 0% 0%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{badge-prefix-cls}-rtl& .@{number-prefix-cls}-custom-component {
|
||||||
|
right: auto;
|
||||||
|
left: 0;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
transform-origin: 0% 0%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-status {
|
||||||
|
&-text {
|
||||||
|
.@{badge-prefix-cls}-rtl & {
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-zoom-appear,
|
||||||
|
&-zoom-enter {
|
||||||
|
.@{badge-prefix-cls}-rtl & {
|
||||||
|
animation-name: antZoomBadgeInRtl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-zoom-leave {
|
||||||
|
.@{badge-prefix-cls}-rtl & {
|
||||||
|
animation-name: antZoomBadgeOutRtl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-not-a-wrapper {
|
||||||
|
.@{badge-prefix-cls}-count {
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ribbon-prefix-cls}-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
&.@{ribbon-prefix-cls}-placement-end {
|
||||||
|
right: unset;
|
||||||
|
left: -8px;
|
||||||
|
border-bottom-right-radius: @border-radius-sm;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
.@{ribbon-prefix-cls}-corner {
|
||||||
|
right: unset;
|
||||||
|
left: 0;
|
||||||
|
border-color: currentColor currentColor transparent transparent;
|
||||||
|
&::after {
|
||||||
|
border-color: currentColor currentColor transparent transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.@{ribbon-prefix-cls}-placement-start {
|
||||||
|
right: -8px;
|
||||||
|
left: unset;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: @border-radius-sm;
|
||||||
|
.@{ribbon-prefix-cls}-corner {
|
||||||
|
right: 0;
|
||||||
|
left: unset;
|
||||||
|
border-color: currentColor transparent transparent currentColor;
|
||||||
|
&::after {
|
||||||
|
border-color: currentColor transparent transparent currentColor;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antZoomBadgeInRtl {
|
||||||
|
0% {
|
||||||
|
transform: scale(0) translate(-50%, -50%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1) translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antZoomBadgeOutRtl {
|
||||||
|
0% {
|
||||||
|
transform: scale(1) translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(0) translate(-50%, -50%);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
2
_content/AntDesign/less/breadcrumb/style/entry.less
Executable file
2
_content/AntDesign/less/breadcrumb/style/entry.less
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
@import './index.less';
|
||||||
|
@import './patch.less';
|
54
_content/AntDesign/less/breadcrumb/style/index.less
Executable file
54
_content/AntDesign/less/breadcrumb/style/index.less
Executable file
@ -0,0 +1,54 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@breadcrumb-prefix-cls: ~'@{ant-prefix}-breadcrumb';
|
||||||
|
|
||||||
|
.@{breadcrumb-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
color: @breadcrumb-base-color;
|
||||||
|
font-size: @breadcrumb-font-size;
|
||||||
|
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
font-size: @breadcrumb-icon-font-size;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: @breadcrumb-link-color;
|
||||||
|
transition: color 0.3s;
|
||||||
|
&:hover {
|
||||||
|
color: @breadcrumb-link-color-hover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child {
|
||||||
|
color: @breadcrumb-last-item-color;
|
||||||
|
a {
|
||||||
|
color: @breadcrumb-last-item-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span:last-child &-separator {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-separator {
|
||||||
|
margin: @breadcrumb-separator-margin;
|
||||||
|
color: @breadcrumb-separator-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link {
|
||||||
|
> .@{iconfont-css-prefix} + span,
|
||||||
|
> .@{iconfont-css-prefix} + a {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-overlay-link {
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
15
_content/AntDesign/less/breadcrumb/style/patch.less
Executable file
15
_content/AntDesign/less/breadcrumb/style/patch.less
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
.@{breadcrumb-prefix-cls} {
|
||||||
|
&-link {
|
||||||
|
.@{iconfont-css-prefix} + span {
|
||||||
|
margin-left: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-blazor-breadcrumb-item:last-child {
|
||||||
|
color: rgba(0, 0, 0, 0.65);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-blazor-breadcrumb-item:last-child .ant-breadcrumb-separator {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
29
_content/AntDesign/less/breadcrumb/style/rtl.less
Executable file
29
_content/AntDesign/less/breadcrumb/style/rtl.less
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
.@{breadcrumb-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
.clearfix();
|
||||||
|
direction: rtl;
|
||||||
|
|
||||||
|
> span {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link {
|
||||||
|
> .@{iconfont-css-prefix} + span,
|
||||||
|
> .@{iconfont-css-prefix} + a {
|
||||||
|
.@{breadcrumb-prefix-cls}-rtl & {
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-overlay-link {
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
.@{breadcrumb-prefix-cls}-rtl & {
|
||||||
|
margin-right: 4px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/button/style/entry.less
Executable file
1
_content/AntDesign/less/button/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
264
_content/AntDesign/less/button/style/index.less
Executable file
264
_content/AntDesign/less/button/style/index.less
Executable file
@ -0,0 +1,264 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
@import './mixin';
|
||||||
|
|
||||||
|
@btn-prefix-cls: ~'@{ant-prefix}-btn';
|
||||||
|
|
||||||
|
// for compatible
|
||||||
|
@btn-ghost-color: @text-color;
|
||||||
|
@btn-ghost-bg: transparent;
|
||||||
|
@btn-ghost-border: @border-color-base;
|
||||||
|
|
||||||
|
// Button styles
|
||||||
|
// -----------------------------
|
||||||
|
.@{btn-prefix-cls} {
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/12978
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/20058
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/19972
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/18107
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/13214
|
||||||
|
// It is a render problem of chrome, which is only happened in the codesandbox demo
|
||||||
|
// 0.001px solution works and I don't why
|
||||||
|
line-height: @btn-line-height;
|
||||||
|
.btn();
|
||||||
|
.btn-default();
|
||||||
|
|
||||||
|
// Fix loading button animation
|
||||||
|
// https://github.com/ant-design/ant-design/issues/24323
|
||||||
|
> span {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-primary {
|
||||||
|
.btn-primary();
|
||||||
|
|
||||||
|
.@{btn-prefix-cls}-group &:not(:first-child):not(:last-child) {
|
||||||
|
border-right-color: @btn-group-border;
|
||||||
|
border-left-color: @btn-group-border;
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
border-color: @btn-default-border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{btn-prefix-cls}-group &:first-child {
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-right-color: @btn-group-border;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
border-right-color: @btn-default-border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{btn-prefix-cls}-group &:last-child:not(:first-child),
|
||||||
|
.@{btn-prefix-cls}-group & + & {
|
||||||
|
border-left-color: @btn-group-border;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
border-left-color: @btn-default-border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-ghost {
|
||||||
|
.btn-ghost();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dashed {
|
||||||
|
.btn-dashed();
|
||||||
|
}
|
||||||
|
|
||||||
|
// type="danger" will deprecated
|
||||||
|
// use danger instead
|
||||||
|
&-danger {
|
||||||
|
.btn-danger();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-link {
|
||||||
|
.btn-link();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-text {
|
||||||
|
.btn-text();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dangerous {
|
||||||
|
.btn-danger-default();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dangerous&-primary {
|
||||||
|
.btn-danger();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dangerous&-link {
|
||||||
|
.btn-danger-link();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-dangerous&-text {
|
||||||
|
.btn-danger-text();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon-only {
|
||||||
|
.btn-square(@btn-prefix-cls);
|
||||||
|
vertical-align: -3px;
|
||||||
|
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-round {
|
||||||
|
.btn-round(@btn-prefix-cls);
|
||||||
|
&.@{btn-prefix-cls}-icon-only {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-circle {
|
||||||
|
.btn-circle(@btn-prefix-cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: -@btn-border-width;
|
||||||
|
right: -@btn-border-width;
|
||||||
|
bottom: -@btn-border-width;
|
||||||
|
left: -@btn-border-width;
|
||||||
|
z-index: 1;
|
||||||
|
display: none;
|
||||||
|
background: @component-background;
|
||||||
|
border-radius: inherit;
|
||||||
|
opacity: 0.35;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
content: '';
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
transition: margin-left 0.3s @ease-in-out;
|
||||||
|
|
||||||
|
// Follow icon blur under windows. Change the render.
|
||||||
|
// https://github.com/ant-design/ant-design/issues/13924
|
||||||
|
&.@{iconfont-css-prefix}-plus,
|
||||||
|
&.@{iconfont-css-prefix}-minus {
|
||||||
|
> svg {
|
||||||
|
shape-rendering: optimizeSpeed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&&-loading {
|
||||||
|
position: relative;
|
||||||
|
&:not([disabled]) {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > &-loading-icon {
|
||||||
|
transition: all 0.3s @ease-in-out;
|
||||||
|
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
padding-right: @padding-xs;
|
||||||
|
animation: none;
|
||||||
|
// for smooth button padding transition
|
||||||
|
svg {
|
||||||
|
animation: loadingCircle 1s infinite linear;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:only-child {
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-group {
|
||||||
|
.btn-group(@btn-prefix-cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
// http://stackoverflow.com/a/21281554/3040605
|
||||||
|
&:focus > span,
|
||||||
|
&:active > span {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
// To ensure that a space will be placed between character and `Icon`.
|
||||||
|
> .@{iconfont-css-prefix} + span,
|
||||||
|
> span + .@{iconfont-css-prefix} {
|
||||||
|
margin-left: @margin-xs;
|
||||||
|
}
|
||||||
|
|
||||||
|
&&-background-ghost {
|
||||||
|
color: @btn-default-ghost-color;
|
||||||
|
border-color: @btn-default-ghost-border;
|
||||||
|
&,
|
||||||
|
&:hover,
|
||||||
|
&:active,
|
||||||
|
&:focus {
|
||||||
|
background: @btn-default-ghost-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-background-ghost&-primary {
|
||||||
|
.button-variant-ghost(@btn-primary-bg);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-background-ghost&-danger {
|
||||||
|
.button-variant-ghost(@btn-danger-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-background-ghost&-dangerous {
|
||||||
|
.button-variant-ghost(@btn-danger-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-background-ghost&-dangerous&-link {
|
||||||
|
.button-variant-ghost(@btn-danger-border, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-two-chinese-chars::first-letter {
|
||||||
|
letter-spacing: 0.34em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-two-chinese-chars > *:not(.@{iconfont-css-prefix}) {
|
||||||
|
margin-right: -0.34em;
|
||||||
|
letter-spacing: 0.34em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-block {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/ant-design/ant-design/issues/12681
|
||||||
|
// same method as Select
|
||||||
|
&:empty {
|
||||||
|
display: inline-block;
|
||||||
|
width: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
content: '\a0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
a.@{btn-prefix-cls} {
|
||||||
|
// Fixing https://github.com/ant-design/ant-design/issues/12978
|
||||||
|
// https://github.com/ant-design/ant-design/issues/29978
|
||||||
|
// It is a render problem of chrome, which is only happened in the codesandbox demo
|
||||||
|
// 0.1px for padding-top solution works and I don't why
|
||||||
|
padding-top: 0.01px !important;
|
||||||
|
line-height: @btn-height-base - 2px;
|
||||||
|
|
||||||
|
&-lg {
|
||||||
|
line-height: @btn-height-lg - 2px;
|
||||||
|
}
|
||||||
|
&-sm {
|
||||||
|
line-height: @btn-height-sm - 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
520
_content/AntDesign/less/button/style/mixin.less
Executable file
520
_content/AntDesign/less/button/style/mixin.less
Executable file
@ -0,0 +1,520 @@
|
|||||||
|
// mixins for button
|
||||||
|
// ------------------------
|
||||||
|
.button-size(@height; @padding-horizontal; @font-size; @border-radius) {
|
||||||
|
@padding-vertical: max(
|
||||||
|
(round(((@height - @font-size * @line-height-base) / 2) * 10) / 10) - @border-width-base,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
height: @height;
|
||||||
|
padding: @padding-vertical @padding-horizontal;
|
||||||
|
font-size: @font-size;
|
||||||
|
border-radius: @border-radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-disabled(@color: @btn-disable-color; @background: @btn-disable-bg; @border: @btn-disable-border) {
|
||||||
|
&[disabled] {
|
||||||
|
&,
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
|
.button-color(@color; @background; @border);
|
||||||
|
|
||||||
|
text-shadow: none;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-variant-primary(@color; @background) {
|
||||||
|
.button-color(@color; @background; @background);
|
||||||
|
|
||||||
|
text-shadow: @btn-text-shadow;
|
||||||
|
box-shadow: @btn-primary-shadow;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
@color; ~`colorPalette('@{background}', 7) `; ~`colorPalette('@{background}', 7) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
@color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
@color; ~`colorPalette('@{background}', 5) `; ~`colorPalette('@{background}', 5) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
@color; ~`colorPalette('@{background}', 7) `; ~`colorPalette('@{background}', 7) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-disabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-variant-other(@color; @background; @border) {
|
||||||
|
.button-color(@color; @background; @border);
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(@primary-5; @background; @primary-5);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{btn-primary-bg}', 5) `; @background;
|
||||||
|
~`colorPalette('@{btn-primary-bg}', 5) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(@primary-7; @background; @primary-7);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{btn-primary-bg}', 7) `; @background;
|
||||||
|
~`colorPalette('@{btn-primary-bg}', 7) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-disabled();
|
||||||
|
}
|
||||||
|
.button-variant-ghost(@color; @border: @color) {
|
||||||
|
.button-color(@color; null; @border);
|
||||||
|
text-shadow: none;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@border = transparent) {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{color}', 7) `; null; transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{color}', 5) `; null; transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& when not (@border = transparent) {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{color}', 7) `; null; ~`colorPalette('@{color}', 7) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{color}', 5) `; null; ~`colorPalette('@{color}', 5) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
& when (@border = transparent) {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{color}', 5) `; null; transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{color}', 7) `; null; transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& when not (@border = transparent) {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{color}', 5) `; null; ~`colorPalette('@{color}', 5) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{color}', 7) `; null; ~`colorPalette('@{color}', 7) `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-disabled();
|
||||||
|
}
|
||||||
|
.button-color(@color; @background; @border) {
|
||||||
|
color: @color;
|
||||||
|
border-color: @border; // a inside Button which only work in Chrome
|
||||||
|
& when not(@background = null) {
|
||||||
|
background: @background;
|
||||||
|
}
|
||||||
|
// http://stackoverflow.com/a/17253457
|
||||||
|
> a:only-child {
|
||||||
|
color: currentColor;
|
||||||
|
&::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
background: transparent;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-group-base(@btnClassName) {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
> .@{btnClassName},
|
||||||
|
> span > .@{btnClassName} {
|
||||||
|
position: relative;
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
&[disabled] {
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.@{btnClassName}-icon-only {
|
||||||
|
font-size: @font-size-base;
|
||||||
|
}
|
||||||
|
// size
|
||||||
|
&-lg > .@{btnClassName},
|
||||||
|
&-lg > span > .@{btnClassName} {
|
||||||
|
.button-size(@btn-height-lg; @btn-padding-horizontal-lg; @btn-font-size-lg; 0);
|
||||||
|
}
|
||||||
|
&-lg .@{btnClassName}.@{btnClassName}-icon-only {
|
||||||
|
.square(@btn-height-lg);
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
&-sm > .@{btnClassName},
|
||||||
|
&-sm > span > .@{btnClassName} {
|
||||||
|
.button-size(@btn-height-sm; @btn-padding-horizontal-sm; @font-size-base; 0);
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
font-size: @font-size-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-sm .@{btnClassName}.@{btnClassName}-icon-only {
|
||||||
|
.square(@btn-height-sm);
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Base styles of buttons
|
||||||
|
// --------------------------------------------------
|
||||||
|
.btn() {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: @btn-font-weight;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
background-image: none;
|
||||||
|
border: @btn-border-width @btn-border-style transparent;
|
||||||
|
box-shadow: @btn-shadow;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s @ease-in-out;
|
||||||
|
user-select: none;
|
||||||
|
touch-action: manipulation;
|
||||||
|
.button-size(
|
||||||
|
@btn-height-base; @btn-padding-horizontal-base; @font-size-base; @btn-border-radius-base
|
||||||
|
);
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
&,
|
||||||
|
&:active,
|
||||||
|
&:focus {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
&:not([disabled]):hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
&:not([disabled]):active {
|
||||||
|
outline: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
&[disabled] {
|
||||||
|
cursor: not-allowed;
|
||||||
|
> * {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-lg {
|
||||||
|
.button-size(
|
||||||
|
@btn-height-lg; @btn-padding-horizontal-lg; @btn-font-size-lg; @btn-border-radius-base
|
||||||
|
);
|
||||||
|
}
|
||||||
|
&-sm {
|
||||||
|
.button-size(
|
||||||
|
@btn-height-sm; @btn-padding-horizontal-sm; @btn-font-size-sm; @btn-border-radius-sm
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// primary button style
|
||||||
|
.btn-primary() {
|
||||||
|
.button-variant-primary(@btn-primary-color; @btn-primary-bg);
|
||||||
|
}
|
||||||
|
// default button style
|
||||||
|
.btn-default() {
|
||||||
|
.button-variant-other(@btn-default-color; @btn-default-bg; @btn-default-border);
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
|
text-decoration: none;
|
||||||
|
background: @btn-default-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ghost button style
|
||||||
|
.btn-ghost() {
|
||||||
|
.button-variant-other(@btn-ghost-color, @btn-ghost-bg, @btn-ghost-border);
|
||||||
|
}
|
||||||
|
// dashed button style
|
||||||
|
.btn-dashed() {
|
||||||
|
.button-variant-other(@btn-default-color, @btn-default-bg, @btn-default-border);
|
||||||
|
border-style: dashed;
|
||||||
|
}
|
||||||
|
// danger button style
|
||||||
|
.btn-danger() {
|
||||||
|
.button-variant-primary(@btn-danger-color, @btn-danger-bg);
|
||||||
|
}
|
||||||
|
// danger default button style
|
||||||
|
.btn-danger-default() {
|
||||||
|
.button-color(@error-color, @btn-default-bg, @error-color);
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7)
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5)
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{error-color}', 5) `; @btn-default-bg; ~`colorPalette('@{error-color}', 5)
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(
|
||||||
|
~`colorPalette('@{error-color}', 7) `; @btn-default-bg; ~`colorPalette('@{error-color}', 7)
|
||||||
|
`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-disabled();
|
||||||
|
}
|
||||||
|
// danger link button style
|
||||||
|
.btn-danger-link() {
|
||||||
|
.button-variant-other(@error-color, transparent, transparent);
|
||||||
|
box-shadow: none;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&:active {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 5) `; transparent; transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 7) `; transparent; transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-disabled(@disabled-color; transparent; transparent);
|
||||||
|
}
|
||||||
|
// link button style
|
||||||
|
.btn-link() {
|
||||||
|
.button-variant-other(@link-color, transparent, transparent);
|
||||||
|
box-shadow: none;
|
||||||
|
&:hover {
|
||||||
|
background: @btn-link-hover-bg;
|
||||||
|
}
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:active {
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
.button-disabled(@disabled-color; transparent; transparent);
|
||||||
|
}
|
||||||
|
// text button style
|
||||||
|
.btn-text() {
|
||||||
|
.button-variant-other(@text-color, transparent, transparent);
|
||||||
|
box-shadow: none;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
color: @text-color;
|
||||||
|
background: @btn-text-hover-bg;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
color: @text-color;
|
||||||
|
background: fadein(@btn-text-hover-bg, 1%);
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-disabled(@disabled-color; transparent; transparent);
|
||||||
|
}
|
||||||
|
.btn-danger-text() {
|
||||||
|
.button-variant-other(@error-color, transparent, transparent);
|
||||||
|
box-shadow: none;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 7) `; @btn-text-hover-bg; transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 5) `; @btn-text-hover-bg; transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
& when (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 5) `; fadein(@btn-text-hover-bg, 1%); transparent);
|
||||||
|
}
|
||||||
|
& when not (@theme = dark) {
|
||||||
|
.button-color(~`colorPalette('@{error-color}', 7) `; fadein(@btn-text-hover-bg, 1%); transparent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button-disabled(@disabled-color; transparent; transparent);
|
||||||
|
}
|
||||||
|
// round button
|
||||||
|
.btn-round(@btnClassName: btn) {
|
||||||
|
.button-size(@btn-circle-size; (@btn-circle-size / 2); @font-size-base; @btn-circle-size);
|
||||||
|
&.@{btnClassName}-lg {
|
||||||
|
.button-size(
|
||||||
|
@btn-circle-size-lg; (@btn-circle-size-lg / 2); @btn-font-size-lg; @btn-circle-size-lg
|
||||||
|
);
|
||||||
|
}
|
||||||
|
&.@{btnClassName}-sm {
|
||||||
|
.button-size(
|
||||||
|
@btn-circle-size-sm; (@btn-circle-size-sm / 2); @font-size-base; @btn-circle-size-sm
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// square button: the content only contains icon
|
||||||
|
.btn-square(@btnClassName: btn) {
|
||||||
|
.square(@btn-square-size);
|
||||||
|
.button-size(@btn-square-size; 0; @btn-square-only-icon-size; @btn-border-radius-base);
|
||||||
|
& > * {
|
||||||
|
font-size: @btn-square-only-icon-size;
|
||||||
|
}
|
||||||
|
&.@{btnClassName}-lg {
|
||||||
|
.square(@btn-square-size-lg);
|
||||||
|
.button-size(@btn-square-size-lg; 0; @btn-square-only-icon-size-lg; @btn-border-radius-base);
|
||||||
|
& > * {
|
||||||
|
font-size: @btn-square-only-icon-size-lg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.@{btnClassName}-sm {
|
||||||
|
.square(@btn-square-size-sm);
|
||||||
|
.button-size(@btn-square-size-sm; 0; @btn-square-only-icon-size-sm; @btn-border-radius-base);
|
||||||
|
& > * {
|
||||||
|
font-size: @btn-square-only-icon-size-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// circle button: the content only contains icon
|
||||||
|
.btn-circle(@btnClassName: btn) {
|
||||||
|
min-width: @btn-height-base;
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 50%;
|
||||||
|
&.@{btnClassName}-lg {
|
||||||
|
min-width: @btn-height-lg;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
&.@{btnClassName}-sm {
|
||||||
|
min-width: @btn-height-sm;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Horizontal button groups style
|
||||||
|
// --------------------------------------------------
|
||||||
|
.btn-group(@btnClassName: btn) {
|
||||||
|
.button-group-base(@btnClassName);
|
||||||
|
.@{btnClassName} + .@{btnClassName},
|
||||||
|
.@{btnClassName} + &,
|
||||||
|
span + .@{btnClassName},
|
||||||
|
.@{btnClassName} + span,
|
||||||
|
> span + span,
|
||||||
|
& + .@{btnClassName},
|
||||||
|
& + & {
|
||||||
|
margin-left: -1px;
|
||||||
|
}
|
||||||
|
.@{btnClassName}-primary + .@{btnClassName}:not(.@{btnClassName}-primary):not([disabled]) {
|
||||||
|
border-left-color: transparent;
|
||||||
|
}
|
||||||
|
.@{btnClassName} {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:first-child,
|
||||||
|
> span:first-child > .@{btnClassName} {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:only-child {
|
||||||
|
border-radius: @btn-border-radius-base;
|
||||||
|
}
|
||||||
|
> span:only-child > .@{btnClassName} {
|
||||||
|
border-radius: @btn-border-radius-base;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:first-child:not(:last-child),
|
||||||
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
||||||
|
border-top-left-radius: @btn-border-radius-base;
|
||||||
|
border-bottom-left-radius: @btn-border-radius-base;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:last-child:not(:first-child),
|
||||||
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
||||||
|
border-top-right-radius: @btn-border-radius-base;
|
||||||
|
border-bottom-right-radius: @btn-border-radius-base;
|
||||||
|
}
|
||||||
|
&-sm {
|
||||||
|
> .@{btnClassName}:only-child {
|
||||||
|
border-radius: @btn-border-radius-sm;
|
||||||
|
}
|
||||||
|
> span:only-child > .@{btnClassName} {
|
||||||
|
border-radius: @btn-border-radius-sm;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:first-child:not(:last-child),
|
||||||
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
||||||
|
border-top-left-radius: @btn-border-radius-sm;
|
||||||
|
border-bottom-left-radius: @btn-border-radius-sm;
|
||||||
|
}
|
||||||
|
> .@{btnClassName}:last-child:not(:first-child),
|
||||||
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
||||||
|
border-top-right-radius: @btn-border-radius-sm;
|
||||||
|
border-bottom-right-radius: @btn-border-radius-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& > & {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
& > &:not(:first-child):not(:last-child) > .@{btnClassName} {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
& > &:first-child:not(:last-child) {
|
||||||
|
> .@{btnClassName}:last-child {
|
||||||
|
padding-right: 8px;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
& > &:last-child:not(:first-child) > .@{btnClassName}:first-child {
|
||||||
|
padding-left: 8px;
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
108
_content/AntDesign/less/button/style/rtl.less
Executable file
108
_content/AntDesign/less/button/style/rtl.less
Executable file
@ -0,0 +1,108 @@
|
|||||||
|
.@{btn-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-primary {
|
||||||
|
.@{btn-prefix-cls}-group &:last-child:not(:first-child),
|
||||||
|
.@{btn-prefix-cls}-group & + & {
|
||||||
|
.@{btn-prefix-cls}-group-rtl& {
|
||||||
|
border-right-color: @btn-group-border;
|
||||||
|
border-left-color: @btn-default-border;
|
||||||
|
}
|
||||||
|
&[disabled] {
|
||||||
|
.@{btn-prefix-cls}-group-rtl& {
|
||||||
|
border-right-color: @btn-default-border;
|
||||||
|
border-left-color: @btn-group-border;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& > &-loading-icon {
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
.@{btn-prefix-cls}-rtl& {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: @margin-xs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:only-child {
|
||||||
|
.@{iconfont-css-prefix} {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{iconfont-css-prefix} + span,
|
||||||
|
> span + .@{iconfont-css-prefix} {
|
||||||
|
.@{btn-prefix-cls}-rtl& {
|
||||||
|
margin-right: 8px;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// mixin
|
||||||
|
.btn-group(@btnClassName: btn) {
|
||||||
|
.@{btnClassName} + .@{btnClassName},
|
||||||
|
.@{btnClassName} + &,
|
||||||
|
span + .@{btnClassName},
|
||||||
|
.@{btnClassName} + span,
|
||||||
|
> span + span,
|
||||||
|
& + .@{btnClassName},
|
||||||
|
& + & {
|
||||||
|
.@{btnClassName}-rtl&,
|
||||||
|
.@{btnClassName}-group-rtl& {
|
||||||
|
margin-right: -1px;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{btnClassName}-group-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{btnClassName}:first-child:not(:last-child),
|
||||||
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
||||||
|
.@{btnClassName}-group-rtl& {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: @btn-border-radius-base;
|
||||||
|
border-bottom-right-radius: @btn-border-radius-base;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{btnClassName}:last-child:not(:first-child),
|
||||||
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
||||||
|
.@{btnClassName}-group-rtl& {
|
||||||
|
border-top-left-radius: @btn-border-radius-base;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: @btn-border-radius-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-sm {
|
||||||
|
> .@{btnClassName}:first-child:not(:last-child),
|
||||||
|
> span:first-child:not(:last-child) > .@{btnClassName} {
|
||||||
|
.@{btnClassName}-group-rtl& {
|
||||||
|
border-top-left-radius: 0;
|
||||||
|
border-top-right-radius: @btn-border-radius-sm;
|
||||||
|
border-bottom-right-radius: @btn-border-radius-sm;
|
||||||
|
border-bottom-left-radius: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{btnClassName}:last-child:not(:first-child),
|
||||||
|
> span:last-child:not(:first-child) > .@{btnClassName} {
|
||||||
|
.@{btnClassName}-group-rtl& {
|
||||||
|
border-top-left-radius: @btn-border-radius-sm;
|
||||||
|
border-top-right-radius: 0;
|
||||||
|
border-bottom-right-radius: 0;
|
||||||
|
border-bottom-left-radius: @btn-border-radius-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/calendar/style/entry.less
Executable file
1
_content/AntDesign/less/calendar/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
192
_content/AntDesign/less/calendar/style/index.less
Executable file
192
_content/AntDesign/less/calendar/style/index.less
Executable file
@ -0,0 +1,192 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@calendar-prefix-cls: ~'@{ant-prefix}-picker-calendar';
|
||||||
|
@calendar-picker-prefix-cls: ~'@{ant-prefix}-picker';
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
background: @calendar-full-bg;
|
||||||
|
|
||||||
|
// ========================= Header =========================
|
||||||
|
&-header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: @padding-sm 0;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-select {
|
||||||
|
min-width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-select {
|
||||||
|
min-width: 70px;
|
||||||
|
margin-left: @padding-xs;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-mode-switch {
|
||||||
|
margin-left: @padding-xs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-panel {
|
||||||
|
background: @calendar-full-panel-bg;
|
||||||
|
border: 0;
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
border-radius: 0;
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-month-panel,
|
||||||
|
.@{calendar-picker-prefix-cls}-date-panel {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-body {
|
||||||
|
padding: @padding-xs 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-content {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================== Mini ==========================
|
||||||
|
&-mini {
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-calendar-header {
|
||||||
|
padding-right: @padding-xs;
|
||||||
|
padding-left: @padding-xs;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-panel {
|
||||||
|
border-radius: 0 0 @border-radius-base @border-radius-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-content {
|
||||||
|
height: 256px;
|
||||||
|
|
||||||
|
th {
|
||||||
|
height: auto;
|
||||||
|
padding: 0;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================== Full ==========================
|
||||||
|
&-full {
|
||||||
|
.@{calendar-picker-prefix-cls}-panel {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: right;
|
||||||
|
background: @calendar-full-bg;
|
||||||
|
border: 0;
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-body {
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
height: auto;
|
||||||
|
padding: 0 12px 5px 0;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cell
|
||||||
|
.@{calendar-picker-prefix-cls}-cell {
|
||||||
|
&::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.@{calendar-prefix-cls}-date {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-date-today::before {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-selected,
|
||||||
|
&-selected:hover {
|
||||||
|
.@{calendar-prefix-cls}-date,
|
||||||
|
.@{calendar-prefix-cls}-date-today {
|
||||||
|
background: @calendar-item-active-bg;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-date-value {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cell date
|
||||||
|
.@{calendar-prefix-cls}-date {
|
||||||
|
display: block;
|
||||||
|
width: auto;
|
||||||
|
height: auto;
|
||||||
|
margin: 0 (@padding-xs / 2);
|
||||||
|
padding: (@padding-xs / 2) @padding-xs 0;
|
||||||
|
border: 0;
|
||||||
|
border-top: 2px solid @border-color-split;
|
||||||
|
border-radius: 0;
|
||||||
|
transition: background 0.3s;
|
||||||
|
|
||||||
|
&-value {
|
||||||
|
line-height: 24px;
|
||||||
|
transition: color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
position: static;
|
||||||
|
width: auto;
|
||||||
|
height: 86px;
|
||||||
|
overflow-y: auto;
|
||||||
|
color: @text-color;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-today {
|
||||||
|
border-color: @primary-color;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-date-value {
|
||||||
|
color: @text-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: @screen-xs) {
|
||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
&-header {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-select {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-select {
|
||||||
|
width: ~'calc(50% - @{padding-xs})';
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-mode-switch {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: @padding-xs;
|
||||||
|
margin-left: 0;
|
||||||
|
|
||||||
|
> label {
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
46
_content/AntDesign/less/calendar/style/rtl.less
Executable file
46
_content/AntDesign/less/calendar/style/rtl.less
Executable file
@ -0,0 +1,46 @@
|
|||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-header {
|
||||||
|
.@{calendar-prefix-cls}-month-select {
|
||||||
|
.@{calendar-prefix-cls}-rtl & {
|
||||||
|
margin-right: @padding-xs;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-mode-switch {
|
||||||
|
.@{calendar-prefix-cls}-rtl & {
|
||||||
|
margin-right: @padding-xs;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========================== Full ==========================
|
||||||
|
&-full {
|
||||||
|
.@{calendar-picker-prefix-cls}-panel {
|
||||||
|
.@{calendar-prefix-cls}-rtl& {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-picker-prefix-cls}-body {
|
||||||
|
th {
|
||||||
|
.@{calendar-prefix-cls}-rtl& {
|
||||||
|
padding: 0 0 5px 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-date {
|
||||||
|
&-content {
|
||||||
|
.@{calendar-prefix-cls}-rtl& {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/card/style/entry.less
Executable file
1
_content/AntDesign/less/card/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
306
_content/AntDesign/less/card/style/index.less
Executable file
306
_content/AntDesign/less/card/style/index.less
Executable file
@ -0,0 +1,306 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@card-prefix-cls: ~'@{ant-prefix}-card';
|
||||||
|
@card-hoverable-hover-border: transparent;
|
||||||
|
@card-action-icon-size: 16px;
|
||||||
|
|
||||||
|
@gradient-min: fade(@card-skeleton-bg, 20%);
|
||||||
|
@gradient-max: fade(@card-skeleton-bg, 40%);
|
||||||
|
|
||||||
|
.@{card-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
background: @card-background;
|
||||||
|
border-radius: @card-radius;
|
||||||
|
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-hoverable {
|
||||||
|
cursor: pointer;
|
||||||
|
transition: box-shadow 0.3s, border-color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
border-color: @card-hoverable-hover-border;
|
||||||
|
box-shadow: @card-shadow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bordered {
|
||||||
|
border: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-head {
|
||||||
|
min-height: @card-head-height;
|
||||||
|
margin-bottom: -1px; // Fix card grid overflow bug: https://gw.alipayobjects.com/zos/rmsportal/XonYxBikwpgbqIQBeuhk.png
|
||||||
|
padding: 0 @card-padding-base;
|
||||||
|
color: @card-head-color;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: @card-head-font-size;
|
||||||
|
background: @card-head-background;
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
|
border-radius: @card-radius @card-radius 0 0;
|
||||||
|
.clearfix();
|
||||||
|
|
||||||
|
&-wrapper {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
display: inline-block;
|
||||||
|
flex: 1;
|
||||||
|
padding: @card-head-padding 0;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
> .@{ant-prefix}-typography,
|
||||||
|
> .@{ant-prefix}-typography-edit-content {
|
||||||
|
left: 0;
|
||||||
|
margin-top: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ant-prefix}-tabs {
|
||||||
|
clear: both;
|
||||||
|
margin-bottom: @card-head-tabs-margin-bottom;
|
||||||
|
color: @text-color;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
|
||||||
|
&-bar {
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-extra {
|
||||||
|
float: right;
|
||||||
|
// https://stackoverflow.com/a/22429853/3040605
|
||||||
|
margin-left: auto;
|
||||||
|
padding: @card-head-padding 0;
|
||||||
|
color: @card-head-extra-color;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
|
||||||
|
.@{card-prefix-cls}-rtl & {
|
||||||
|
margin-right: auto;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-body {
|
||||||
|
padding: @card-padding-base;
|
||||||
|
.clearfix();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-contain-grid:not(&-loading) &-body {
|
||||||
|
margin: -1px 0 0 -1px;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-grid {
|
||||||
|
float: left;
|
||||||
|
width: 33.33%;
|
||||||
|
padding: @card-padding-base;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: 1px 0 0 0 @border-color-split, 0 1px 0 0 @border-color-split,
|
||||||
|
1px 1px 0 0 @border-color-split, 1px 0 0 0 @border-color-split inset,
|
||||||
|
0 1px 0 0 @border-color-split inset;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
.@{card-prefix-cls}-rtl & {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-hoverable {
|
||||||
|
&:hover {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
box-shadow: @card-shadow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-contain-tabs > &-head &-head-title {
|
||||||
|
min-height: @card-head-height - @card-head-padding;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-contain-tabs > &-head &-extra {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bordered &-cover {
|
||||||
|
margin-top: -1px;
|
||||||
|
margin-right: -1px;
|
||||||
|
margin-left: -1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-cover {
|
||||||
|
> * {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: @card-radius @card-radius 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-actions {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
background: @card-actions-background;
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
.clearfix();
|
||||||
|
|
||||||
|
& > li {
|
||||||
|
float: left;
|
||||||
|
margin: @card-actions-li-margin;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.@{card-prefix-cls}-rtl & {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
> span {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
min-width: 32px;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
transition: color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:not(.@{ant-prefix}-btn),
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
line-height: 22px;
|
||||||
|
transition: color 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{iconfont-css-prefix} {
|
||||||
|
font-size: @card-action-icon-size;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(:last-child) {
|
||||||
|
border-right: @border-width-base @border-style-base @border-color-split;
|
||||||
|
|
||||||
|
.@{card-prefix-cls}-rtl & {
|
||||||
|
border-right: none;
|
||||||
|
border-left: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-type-inner &-head {
|
||||||
|
padding: 0 @card-padding-base;
|
||||||
|
background: @background-color-light;
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
padding: @card-inner-head-padding 0;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-type-inner &-body {
|
||||||
|
padding: 16px @card-padding-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-type-inner &-extra {
|
||||||
|
padding: @card-inner-head-padding + 1.5px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-meta {
|
||||||
|
margin: -4px 0;
|
||||||
|
.clearfix();
|
||||||
|
|
||||||
|
&-avatar {
|
||||||
|
float: left;
|
||||||
|
padding-right: 16px;
|
||||||
|
|
||||||
|
.@{card-prefix-cls}-rtl & {
|
||||||
|
float: right;
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 16px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-detail {
|
||||||
|
overflow: hidden;
|
||||||
|
> div:not(:last-child) {
|
||||||
|
margin-bottom: @margin-xs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
overflow: hidden;
|
||||||
|
color: @card-head-color;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: @font-size-lg;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-description {
|
||||||
|
color: @text-color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-loading {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-loading &-body {
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-loading-content {
|
||||||
|
p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-loading-block {
|
||||||
|
height: 14px;
|
||||||
|
margin: 4px 0;
|
||||||
|
background: linear-gradient(90deg, @gradient-min, @gradient-max, @gradient-min);
|
||||||
|
background-size: 600% 600%;
|
||||||
|
border-radius: @card-radius;
|
||||||
|
animation: card-loading 1.4s ease infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes card-loading {
|
||||||
|
0%,
|
||||||
|
100% {
|
||||||
|
background-position: 0 50%;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
background-position: 100% 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './size';
|
20
_content/AntDesign/less/card/style/size.less
Executable file
20
_content/AntDesign/less/card/style/size.less
Executable file
@ -0,0 +1,20 @@
|
|||||||
|
.@{card-prefix-cls}-small {
|
||||||
|
> .@{card-prefix-cls}-head {
|
||||||
|
min-height: @card-head-height-sm;
|
||||||
|
padding: 0 @card-padding-base-sm;
|
||||||
|
font-size: @card-head-font-size-sm;
|
||||||
|
|
||||||
|
> .@{card-prefix-cls}-head-wrapper {
|
||||||
|
> .@{card-prefix-cls}-head-title {
|
||||||
|
padding: @card-head-padding-sm 0;
|
||||||
|
}
|
||||||
|
> .@{card-prefix-cls}-extra {
|
||||||
|
padding: @card-head-padding-sm 0;
|
||||||
|
font-size: @card-head-font-size-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
> .@{card-prefix-cls}-body {
|
||||||
|
padding: @card-padding-base-sm;
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/carousel/style/entry.less
Executable file
1
_content/AntDesign/less/carousel/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
279
_content/AntDesign/less/carousel/style/index.less
Executable file
279
_content/AntDesign/less/carousel/style/index.less
Executable file
@ -0,0 +1,279 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@carousel-prefix-cls: ~'@{ant-prefix}-carousel';
|
||||||
|
|
||||||
|
.@{carousel-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
.slick-slider {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
box-sizing: border-box;
|
||||||
|
-ms-touch-action: pan-y;
|
||||||
|
touch-action: pan-y;
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-list {
|
||||||
|
position: relative;
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.dragging {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-slide {
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
// https://github.com/ant-design/ant-design/issues/23294
|
||||||
|
input.@{ant-prefix}-radio-input,
|
||||||
|
input.@{ant-prefix}-checkbox-input {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.slick-active {
|
||||||
|
pointer-events: auto;
|
||||||
|
|
||||||
|
input.@{ant-prefix}-radio-input,
|
||||||
|
input.@{ant-prefix}-checkbox-input {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// fix Carousel content height not match parent node
|
||||||
|
// when children is empty node
|
||||||
|
// https://github.com/ant-design/ant-design/issues/25878
|
||||||
|
> div > div {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-slider .slick-track,
|
||||||
|
.slick-slider .slick-list {
|
||||||
|
transform: translate3d(0, 0, 0);
|
||||||
|
touch-action: pan-y;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-track {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
display: table;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-loading & {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-slide {
|
||||||
|
display: none;
|
||||||
|
float: left;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 1px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.slick-loading img {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.dragging img {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-initialized .slick-slide {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-loading .slick-slide {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-vertical .slick-slide {
|
||||||
|
display: block;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.slick-arrow.slick-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Arrows
|
||||||
|
.slick-prev,
|
||||||
|
.slick-next {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
display: block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: -10px;
|
||||||
|
padding: 0;
|
||||||
|
color: transparent;
|
||||||
|
font-size: 0;
|
||||||
|
line-height: 0;
|
||||||
|
background: transparent;
|
||||||
|
border: 0;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
color: transparent;
|
||||||
|
background: transparent;
|
||||||
|
outline: none;
|
||||||
|
&::before {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.slick-disabled::before {
|
||||||
|
opacity: 0.25;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-prev {
|
||||||
|
left: -25px;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: '←';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-next {
|
||||||
|
right: -25px;
|
||||||
|
&::before {
|
||||||
|
content: '→';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dots
|
||||||
|
.slick-dots {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 15;
|
||||||
|
display: flex !important;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 15%;
|
||||||
|
margin-left: 15%;
|
||||||
|
padding-left: 0;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
&-bottom {
|
||||||
|
bottom: 12px;
|
||||||
|
}
|
||||||
|
&-top {
|
||||||
|
top: 12px;
|
||||||
|
bottom: auto;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
flex: 0 1 auto;
|
||||||
|
box-sizing: content-box;
|
||||||
|
width: @carousel-dot-width;
|
||||||
|
height: @carousel-dot-height;
|
||||||
|
margin: 0 2px;
|
||||||
|
margin-right: 3px;
|
||||||
|
margin-left: 3px;
|
||||||
|
padding: 0;
|
||||||
|
text-align: center;
|
||||||
|
text-indent: -999px;
|
||||||
|
vertical-align: top;
|
||||||
|
transition: all 0.5s;
|
||||||
|
button {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: @carousel-dot-height;
|
||||||
|
padding: 0;
|
||||||
|
color: transparent;
|
||||||
|
font-size: 0;
|
||||||
|
background: @component-background;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 1px;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0.3;
|
||||||
|
transition: all 0.5s;
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
opacity: 0.75;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.slick-active {
|
||||||
|
width: @carousel-dot-active-width;
|
||||||
|
& button {
|
||||||
|
background: @component-background;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ant-prefix}-carousel-vertical {
|
||||||
|
.slick-dots {
|
||||||
|
top: 50%;
|
||||||
|
bottom: auto;
|
||||||
|
flex-direction: column;
|
||||||
|
width: @carousel-dot-height;
|
||||||
|
height: auto;
|
||||||
|
margin: 0;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
|
||||||
|
&-left {
|
||||||
|
right: auto;
|
||||||
|
left: 12px;
|
||||||
|
}
|
||||||
|
&-right {
|
||||||
|
right: 12px;
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
width: @carousel-dot-height;
|
||||||
|
height: @carousel-dot-width;
|
||||||
|
margin: 4px 2px;
|
||||||
|
vertical-align: baseline;
|
||||||
|
button {
|
||||||
|
width: @carousel-dot-height;
|
||||||
|
height: @carousel-dot-width;
|
||||||
|
}
|
||||||
|
&.slick-active {
|
||||||
|
width: @carousel-dot-height;
|
||||||
|
height: @carousel-dot-active-width;
|
||||||
|
|
||||||
|
button {
|
||||||
|
width: @carousel-dot-height;
|
||||||
|
height: @carousel-dot-active-width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
52
_content/AntDesign/less/carousel/style/rtl.less
Executable file
52
_content/AntDesign/less/carousel/style/rtl.less
Executable file
@ -0,0 +1,52 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@carousel-prefix-cls: ~'@{ant-prefix}-carousel';
|
||||||
|
|
||||||
|
.@{carousel-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-track {
|
||||||
|
.@{carousel-prefix-cls}-rtl & {
|
||||||
|
right: 0;
|
||||||
|
left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-prev {
|
||||||
|
.@{carousel-prefix-cls}-rtl & {
|
||||||
|
right: -25px;
|
||||||
|
left: auto;
|
||||||
|
&::before {
|
||||||
|
content: '→';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.slick-next {
|
||||||
|
.@{carousel-prefix-cls}-rtl & {
|
||||||
|
right: auto;
|
||||||
|
left: -25px;
|
||||||
|
&::before {
|
||||||
|
content: '←';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dots
|
||||||
|
.slick-dots {
|
||||||
|
.@{carousel-prefix-cls}-rtl& {
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{ant-prefix}-carousel-vertical {
|
||||||
|
.slick-dots {
|
||||||
|
.@{carousel-prefix-cls}-rtl& {
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/cascader/style/entry.less
Executable file
1
_content/AntDesign/less/cascader/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
242
_content/AntDesign/less/cascader/style/index.less
Executable file
242
_content/AntDesign/less/cascader/style/index.less
Executable file
@ -0,0 +1,242 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
@import '../../input/style/mixin';
|
||||||
|
|
||||||
|
@cascader-prefix-cls: ~'@{ant-prefix}-cascader';
|
||||||
|
|
||||||
|
.@{cascader-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
&-input.@{ant-prefix}-input {
|
||||||
|
// Keep it static for https://github.com/ant-design/ant-design/issues/16738
|
||||||
|
position: static;
|
||||||
|
width: 100%;
|
||||||
|
// https://github.com/ant-design/ant-design/issues/17582
|
||||||
|
padding-right: 24px;
|
||||||
|
// Add important to fix https://github.com/ant-design/ant-design/issues/5078
|
||||||
|
// because input.less will compile after cascader.less
|
||||||
|
background-color: transparent !important;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-picker-show-search &-input.@{ant-prefix}-input {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-picker {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
background-color: @cascader-bg;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
outline: 0;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.3s;
|
||||||
|
|
||||||
|
&-with-value &-label {
|
||||||
|
color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled {
|
||||||
|
color: @disabled-color;
|
||||||
|
background: @input-disabled-bg;
|
||||||
|
cursor: not-allowed;
|
||||||
|
.@{cascader-prefix-cls}-input {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus .@{cascader-prefix-cls}-input {
|
||||||
|
.active();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless .@{cascader-prefix-cls}-input {
|
||||||
|
border-color: transparent !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-show-search&-focused {
|
||||||
|
color: @disabled-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-label {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 20px;
|
||||||
|
margin-top: -10px;
|
||||||
|
padding: 0 20px 0 @control-padding-horizontal;
|
||||||
|
overflow: hidden;
|
||||||
|
line-height: 20px;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-clear {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: @control-padding-horizontal;
|
||||||
|
z-index: 2;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
margin-top: -6px;
|
||||||
|
color: @disabled-color;
|
||||||
|
font-size: @font-size-sm;
|
||||||
|
line-height: 12px;
|
||||||
|
background: @component-background;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
transition: color 0.3s ease, opacity 0.15s ease;
|
||||||
|
&:hover {
|
||||||
|
color: @text-color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover &-clear {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// arrow
|
||||||
|
&-arrow {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: @control-padding-horizontal;
|
||||||
|
z-index: 1;
|
||||||
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
|
margin-top: -6px;
|
||||||
|
color: @disabled-color;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// https://github.com/ant-design/ant-design/pull/12407#issuecomment-424657810
|
||||||
|
&-picker-label:hover + &-input {
|
||||||
|
&:not(.@{cascader-prefix-cls}-picker-disabled &) {
|
||||||
|
.hover();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-picker-small &-picker-clear,
|
||||||
|
&-picker-small &-picker-arrow {
|
||||||
|
right: @control-padding-horizontal-sm;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-menus {
|
||||||
|
position: absolute;
|
||||||
|
z-index: @zindex-dropdown;
|
||||||
|
font-size: @cascader-dropdown-font-size;
|
||||||
|
white-space: nowrap;
|
||||||
|
background: @cascader-menu-bg;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
box-shadow: @box-shadow-base;
|
||||||
|
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
margin: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-empty,
|
||||||
|
&-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-bottomLeft,
|
||||||
|
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-bottomLeft {
|
||||||
|
animation-name: antSlideUpIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{ant-prefix}-slide-up-enter.@{ant-prefix}-slide-up-enter-active&-placement-topLeft,
|
||||||
|
&.@{ant-prefix}-slide-up-appear.@{ant-prefix}-slide-up-appear-active&-placement-topLeft {
|
||||||
|
animation-name: antSlideDownIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-bottomLeft {
|
||||||
|
animation-name: antSlideUpOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{ant-prefix}-slide-up-leave.@{ant-prefix}-slide-up-leave-active&-placement-topLeft {
|
||||||
|
animation-name: antSlideDownOut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-menu {
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 111px;
|
||||||
|
height: 180px;
|
||||||
|
margin: 0;
|
||||||
|
padding: @cascader-dropdown-edge-child-vertical-padding 0;
|
||||||
|
overflow: auto;
|
||||||
|
vertical-align: top;
|
||||||
|
list-style: none;
|
||||||
|
border-right: @border-width-base @border-style-base @cascader-menu-border-color-split;
|
||||||
|
-ms-overflow-style: -ms-autohiding-scrollbar; // https://github.com/ant-design/ant-design/issues/11857
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
border-radius: @border-radius-base 0 0 @border-radius-base;
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
margin-right: -1px;
|
||||||
|
border-right-color: transparent;
|
||||||
|
border-radius: 0 @border-radius-base @border-radius-base 0;
|
||||||
|
}
|
||||||
|
&:only-child {
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-menu-item {
|
||||||
|
padding: @cascader-dropdown-vertical-padding @control-padding-horizontal;
|
||||||
|
overflow: hidden;
|
||||||
|
line-height: @cascader-dropdown-line-height;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
}
|
||||||
|
&-disabled {
|
||||||
|
color: @disabled-color;
|
||||||
|
cursor: not-allowed;
|
||||||
|
&:hover {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.@{cascader-prefix-cls}-menu-empty & {
|
||||||
|
color: @disabled-color;
|
||||||
|
cursor: default;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
&-active:not(&-disabled) {
|
||||||
|
&,
|
||||||
|
&:hover {
|
||||||
|
font-weight: @select-item-selected-font-weight;
|
||||||
|
background-color: @cascader-item-selected-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-expand {
|
||||||
|
position: relative;
|
||||||
|
padding-right: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-expand &-expand-icon,
|
||||||
|
&-loading-icon {
|
||||||
|
position: absolute;
|
||||||
|
right: @control-padding-horizontal;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
font-size: 10px;
|
||||||
|
|
||||||
|
.@{cascader-prefix-cls}-menu-item-disabled& {
|
||||||
|
color: @disabled-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& &-keyword {
|
||||||
|
color: @highlight-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
95
_content/AntDesign/less/cascader/style/rtl.less
Executable file
95
_content/AntDesign/less/cascader/style/rtl.less
Executable file
@ -0,0 +1,95 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
@import '../../input/style/mixin';
|
||||||
|
|
||||||
|
@cascader-prefix-cls: ~'@{ant-prefix}-cascader';
|
||||||
|
@picker-rtl-cls: ~'@{cascader-prefix-cls}-picker-rtl';
|
||||||
|
@menu-rtl-cls: ~'@{cascader-prefix-cls}-menu-rtl';
|
||||||
|
|
||||||
|
.@{cascader-prefix-cls} {
|
||||||
|
&-input.@{ant-prefix}-input {
|
||||||
|
.@{picker-rtl-cls} & {
|
||||||
|
padding-right: @input-padding-horizontal-base;
|
||||||
|
padding-left: 24px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-picker {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-label {
|
||||||
|
.@{picker-rtl-cls} & {
|
||||||
|
padding: 0 @control-padding-horizontal 0 20px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-clear {
|
||||||
|
.@{picker-rtl-cls} & {
|
||||||
|
right: auto;
|
||||||
|
left: @control-padding-horizontal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-arrow {
|
||||||
|
.@{picker-rtl-cls} & {
|
||||||
|
right: auto;
|
||||||
|
left: @control-padding-horizontal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-picker-small &-picker-clear,
|
||||||
|
&-picker-small &-picker-arrow {
|
||||||
|
.@{picker-rtl-cls}& {
|
||||||
|
right: auto;
|
||||||
|
left: @control-padding-horizontal-sm;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-menu {
|
||||||
|
&-rtl & {
|
||||||
|
direction: rtl;
|
||||||
|
border-right: none;
|
||||||
|
border-left: @border-width-base @border-style-base @border-color-split;
|
||||||
|
&:first-child {
|
||||||
|
border-radius: 0 @border-radius-base @border-radius-base 0;
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: -1px;
|
||||||
|
border-left-color: transparent;
|
||||||
|
border-radius: @border-radius-base 0 0 @border-radius-base;
|
||||||
|
}
|
||||||
|
&:only-child {
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-menu-item {
|
||||||
|
&-expand {
|
||||||
|
.@{menu-rtl-cls} & {
|
||||||
|
padding-right: @control-padding-horizontal;
|
||||||
|
padding-left: 24px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-expand &-expand-icon,
|
||||||
|
&-loading-icon {
|
||||||
|
.@{menu-rtl-cls} & {
|
||||||
|
right: auto;
|
||||||
|
left: @control-padding-horizontal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-loading-icon {
|
||||||
|
.@{menu-rtl-cls} & {
|
||||||
|
transform: scaleY(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/checkbox/style/entry.less
Executable file
1
_content/AntDesign/less/checkbox/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
5
_content/AntDesign/less/checkbox/style/index.less
Executable file
5
_content/AntDesign/less/checkbox/style/index.less
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import './mixin';
|
||||||
|
|
||||||
|
.antCheckboxFn();
|
||||||
|
@import './rtl';
|
229
_content/AntDesign/less/checkbox/style/mixin.less
Executable file
229
_content/AntDesign/less/checkbox/style/mixin.less
Executable file
@ -0,0 +1,229 @@
|
|||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-checkbox') {
|
||||||
|
@checkbox-inner-prefix-cls: ~'@{checkbox-prefix-cls}-inner';
|
||||||
|
// 一般状态
|
||||||
|
.@{checkbox-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
top: 0.2em;
|
||||||
|
line-height: 1;
|
||||||
|
white-space: nowrap;
|
||||||
|
outline: none;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-wrapper:hover &-inner,
|
||||||
|
&:hover &-inner,
|
||||||
|
&-input:focus + &-inner {
|
||||||
|
border-color: @checkbox-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-checked::after {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid @checkbox-color;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
visibility: hidden;
|
||||||
|
animation: antCheckboxEffect 0.36s ease-in-out;
|
||||||
|
animation-fill-mode: backwards;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover::after,
|
||||||
|
.@{checkbox-prefix-cls}-wrapper:hover &::after {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
position: relative;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
display: block;
|
||||||
|
width: @checkbox-size;
|
||||||
|
height: @checkbox-size;
|
||||||
|
direction: ltr;
|
||||||
|
background-color: @checkbox-check-bg;
|
||||||
|
border: @checkbox-border-width @border-style-base @border-color-base;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
// Fix IE checked style
|
||||||
|
// https://github.com/ant-design/ant-design/issues/12597
|
||||||
|
border-collapse: separate;
|
||||||
|
transition: all 0.3s;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
@check-width: (@checkbox-size / 14) * 5px;
|
||||||
|
@check-height: (@checkbox-size / 14) * 8px;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
// https://github.com/ant-design/ant-design/pull/19452
|
||||||
|
// https://github.com/ant-design/ant-design/pull/31726
|
||||||
|
left: 21.5%;
|
||||||
|
display: table;
|
||||||
|
width: @check-width;
|
||||||
|
height: @check-height;
|
||||||
|
border: 2px solid @checkbox-check-color;
|
||||||
|
border-top: 0;
|
||||||
|
border-left: 0;
|
||||||
|
transform: rotate(45deg) scale(0) translate(-50%, -50%);
|
||||||
|
opacity: 0;
|
||||||
|
transition: all 0.1s @ease-in-back, opacity 0.1s;
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-input {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 1;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选中状态
|
||||||
|
.@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}::after {
|
||||||
|
position: absolute;
|
||||||
|
display: table;
|
||||||
|
border: 2px solid @checkbox-check-color;
|
||||||
|
border-top: 0;
|
||||||
|
border-left: 0;
|
||||||
|
transform: rotate(45deg) scale(1) translate(-50%, -50%);
|
||||||
|
opacity: 1;
|
||||||
|
transition: all 0.2s @ease-out-back 0.1s;
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-checked {
|
||||||
|
.@{checkbox-inner-prefix-cls} {
|
||||||
|
background-color: @checkbox-color;
|
||||||
|
border-color: @checkbox-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&.@{checkbox-prefix-cls}-checked {
|
||||||
|
.@{checkbox-inner-prefix-cls}::after {
|
||||||
|
border-color: @disabled-color;
|
||||||
|
animation-name: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-input {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-inner-prefix-cls} {
|
||||||
|
background-color: @input-disabled-bg;
|
||||||
|
border-color: @border-color-base !important;
|
||||||
|
&::after {
|
||||||
|
border-color: @input-disabled-bg;
|
||||||
|
border-collapse: separate;
|
||||||
|
animation-name: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& + span {
|
||||||
|
color: @disabled-color;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Not show highlight border of checkbox when disabled
|
||||||
|
&:hover::after,
|
||||||
|
.@{checkbox-prefix-cls}-wrapper:hover &::after {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-wrapper {
|
||||||
|
.reset-component();
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: baseline;
|
||||||
|
line-height: unset;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
display: inline-block;
|
||||||
|
width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
content: '\a0';
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{checkbox-prefix-cls}-wrapper-disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
& + & {
|
||||||
|
margin-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls} + span {
|
||||||
|
padding-right: 8px;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-group {
|
||||||
|
.reset-component();
|
||||||
|
display: inline-block;
|
||||||
|
|
||||||
|
&-item {
|
||||||
|
margin-right: @checkbox-group-item-margin-right;
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-item + &-item {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 半选状态
|
||||||
|
.@{checkbox-prefix-cls}-indeterminate {
|
||||||
|
.@{checkbox-inner-prefix-cls} {
|
||||||
|
background-color: @checkbox-check-bg;
|
||||||
|
border-color: @border-color-base;
|
||||||
|
}
|
||||||
|
.@{checkbox-inner-prefix-cls}::after {
|
||||||
|
@indeterminate-width: @checkbox-size - 8px;
|
||||||
|
@indeterminate-height: @checkbox-size - 8px;
|
||||||
|
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
width: @indeterminate-width;
|
||||||
|
height: @indeterminate-height;
|
||||||
|
background-color: @checkbox-color;
|
||||||
|
border: 0;
|
||||||
|
transform: translate(-50%, -50%) scale(1);
|
||||||
|
opacity: 1;
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{checkbox-prefix-cls}-disabled .@{checkbox-inner-prefix-cls}::after {
|
||||||
|
background-color: @disabled-color;
|
||||||
|
border-color: @disabled-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes antCheckboxEffect {
|
||||||
|
0% {
|
||||||
|
transform: scale(1);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: scale(1.6);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
26
_content/AntDesign/less/checkbox/style/rtl.less
Executable file
26
_content/AntDesign/less/checkbox/style/rtl.less
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
.antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-checkbox') {
|
||||||
|
.@{checkbox-prefix-cls}-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{checkbox-prefix-cls}-group {
|
||||||
|
&-item {
|
||||||
|
.@{checkbox-prefix-cls}-group-rtl & {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: @checkbox-group-item-margin-right;
|
||||||
|
}
|
||||||
|
&:last-child {
|
||||||
|
.@{checkbox-prefix-cls}-group-rtl & {
|
||||||
|
margin-left: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-item + &-item {
|
||||||
|
.@{checkbox-prefix-cls}-group-rtl & {
|
||||||
|
margin-left: @checkbox-group-item-margin-right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/collapse/style/entry.less
Executable file
1
_content/AntDesign/less/collapse/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
154
_content/AntDesign/less/collapse/style/index.less
Executable file
154
_content/AntDesign/less/collapse/style/index.less
Executable file
@ -0,0 +1,154 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@collapse-prefix-cls: ~'@{ant-prefix}-collapse';
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls} {
|
||||||
|
.reset-component();
|
||||||
|
|
||||||
|
background-color: @collapse-header-bg;
|
||||||
|
border: @border-width-base @border-style-base @border-color-base;
|
||||||
|
border-bottom: 0;
|
||||||
|
border-radius: @collapse-panel-border-radius;
|
||||||
|
|
||||||
|
& > &-item {
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-base;
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
&,
|
||||||
|
& > .@{collapse-prefix-cls}-header {
|
||||||
|
border-radius: 0 0 @collapse-panel-border-radius @collapse-panel-border-radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
> .@{collapse-prefix-cls}-header {
|
||||||
|
position: relative;
|
||||||
|
padding: @collapse-header-padding;
|
||||||
|
color: @heading-color;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s, visibility 0s;
|
||||||
|
.clearfix();
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-arrow {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 12px;
|
||||||
|
font-size: @font-size-sm;
|
||||||
|
vertical-align: -1px;
|
||||||
|
|
||||||
|
& svg {
|
||||||
|
transition: transform 0.24s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-extra {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-header-collapsible-only {
|
||||||
|
cursor: default;
|
||||||
|
.@{collapse-prefix-cls}-header-text {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{collapse-prefix-cls}-no-arrow {
|
||||||
|
> .@{collapse-prefix-cls}-header {
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expand Icon right
|
||||||
|
&-icon-position-right {
|
||||||
|
& > .@{collapse-prefix-cls}-item {
|
||||||
|
> .@{collapse-prefix-cls}-header {
|
||||||
|
padding: @collapse-header-padding;
|
||||||
|
padding-right: @collapse-header-padding-extra;
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-arrow {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: @padding-md;
|
||||||
|
left: auto;
|
||||||
|
margin: 0;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
color: @text-color;
|
||||||
|
background-color: @collapse-content-bg;
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-base;
|
||||||
|
|
||||||
|
& > &-box {
|
||||||
|
padding: @collapse-content-padding;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-item:last-child {
|
||||||
|
> .@{collapse-prefix-cls}-content {
|
||||||
|
border-radius: 0 0 @collapse-panel-border-radius @collapse-panel-border-radius;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless {
|
||||||
|
background-color: @collapse-header-bg;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless > &-item {
|
||||||
|
border-bottom: 1px solid @border-color-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless > &-item:last-child,
|
||||||
|
&-borderless > &-item:last-child &-header {
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless > &-item > &-content {
|
||||||
|
background-color: transparent;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-borderless > &-item > &-content > &-content-box {
|
||||||
|
padding-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-ghost {
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0;
|
||||||
|
> .@{collapse-prefix-cls}-item {
|
||||||
|
border-bottom: 0;
|
||||||
|
> .@{collapse-prefix-cls}-content {
|
||||||
|
background-color: transparent;
|
||||||
|
border-top: 0;
|
||||||
|
> .@{collapse-prefix-cls}-content-box {
|
||||||
|
padding-top: 12px;
|
||||||
|
padding-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
& &-item-disabled > &-header {
|
||||||
|
&,
|
||||||
|
& > .arrow {
|
||||||
|
color: @disabled-color;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
42
_content/AntDesign/less/collapse/style/rtl.less
Executable file
42
_content/AntDesign/less/collapse/style/rtl.less
Executable file
@ -0,0 +1,42 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@collapse-prefix-cls: ~'@{ant-prefix}-collapse';
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > &-item {
|
||||||
|
> .@{collapse-prefix-cls}-header {
|
||||||
|
.@{collapse-prefix-cls}-rtl & {
|
||||||
|
padding: @collapse-header-padding;
|
||||||
|
padding-right: @collapse-header-padding-extra;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-arrow {
|
||||||
|
& svg {
|
||||||
|
.@{collapse-prefix-cls}-rtl& {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{collapse-prefix-cls}-extra {
|
||||||
|
.@{collapse-prefix-cls}-rtl& {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{collapse-prefix-cls}-no-arrow {
|
||||||
|
> .@{collapse-prefix-cls}-header {
|
||||||
|
.@{collapse-prefix-cls}-rtl& {
|
||||||
|
padding-right: 12px;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/comment/style/entry.less
Executable file
1
_content/AntDesign/less/comment/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
101
_content/AntDesign/less/comment/style/index.less
Executable file
101
_content/AntDesign/less/comment/style/index.less
Executable file
@ -0,0 +1,101 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@comment-prefix-cls: ~'@{ant-prefix}-comment';
|
||||||
|
|
||||||
|
.@{comment-prefix-cls} {
|
||||||
|
position: relative;
|
||||||
|
background-color: @comment-bg;
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
display: flex;
|
||||||
|
padding: @comment-padding-base;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-avatar {
|
||||||
|
position: relative;
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: @margin-sm;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
position: relative;
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 1px;
|
||||||
|
font-size: @comment-font-size-base;
|
||||||
|
word-wrap: break-word;
|
||||||
|
|
||||||
|
&-author {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin-bottom: @margin-xss;
|
||||||
|
font-size: @comment-font-size-base;
|
||||||
|
& > a,
|
||||||
|
& > span {
|
||||||
|
padding-right: @padding-xs;
|
||||||
|
font-size: @comment-font-size-sm;
|
||||||
|
line-height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-name {
|
||||||
|
color: @comment-author-name-color;
|
||||||
|
font-size: @comment-font-size-base;
|
||||||
|
transition: color 0.3s;
|
||||||
|
> * {
|
||||||
|
color: @comment-author-name-color;
|
||||||
|
&:hover {
|
||||||
|
color: @comment-author-name-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-time {
|
||||||
|
color: @comment-author-time-color;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-detail p {
|
||||||
|
margin-bottom: @comment-content-detail-p-margin-bottom;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-actions {
|
||||||
|
margin-top: @comment-actions-margin-top;
|
||||||
|
margin-bottom: @comment-actions-margin-bottom;
|
||||||
|
padding-left: 0;
|
||||||
|
|
||||||
|
> li {
|
||||||
|
display: inline-block;
|
||||||
|
color: @comment-action-color;
|
||||||
|
> span {
|
||||||
|
margin-right: 10px;
|
||||||
|
color: @comment-action-color;
|
||||||
|
font-size: @comment-font-size-sm;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: color 0.3s;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @comment-action-hover-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-nested {
|
||||||
|
margin-left: @comment-nest-indent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@import './rtl';
|
50
_content/AntDesign/less/comment/style/rtl.less
Executable file
50
_content/AntDesign/less/comment/style/rtl.less
Executable file
@ -0,0 +1,50 @@
|
|||||||
|
@import '../../style/themes/index';
|
||||||
|
@import '../../style/mixins/index';
|
||||||
|
|
||||||
|
@comment-prefix-cls: ~'@{ant-prefix}-comment';
|
||||||
|
|
||||||
|
.@{comment-prefix-cls} {
|
||||||
|
&-rtl {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-avatar {
|
||||||
|
.@{comment-prefix-cls}-rtl & {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-content {
|
||||||
|
&-author {
|
||||||
|
& > a,
|
||||||
|
& > span {
|
||||||
|
.@{comment-prefix-cls}-rtl & {
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-actions {
|
||||||
|
.@{comment-prefix-cls}-rtl & {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
> li {
|
||||||
|
> span {
|
||||||
|
.@{comment-prefix-cls}-rtl & {
|
||||||
|
margin-right: 0;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-nested {
|
||||||
|
.@{comment-prefix-cls}-rtl & {
|
||||||
|
margin-right: @comment-nest-indent;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
62
_content/AntDesign/less/components.less
Executable file
62
_content/AntDesign/less/components.less
Executable file
@ -0,0 +1,62 @@
|
|||||||
|
@import "./icon/style/entry.less";
|
||||||
|
@import "./affix/style/entry.less";
|
||||||
|
@import "./alert/style/entry.less";
|
||||||
|
@import "./anchor/style/entry.less";
|
||||||
|
@import "./avatar/style/entry.less";
|
||||||
|
@import "./back-top/style/entry.less";
|
||||||
|
@import "./badge/style/entry.less";
|
||||||
|
@import "./breadcrumb/style/entry.less";
|
||||||
|
@import "./button/style/entry.less";
|
||||||
|
@import "./card/style/entry.less";
|
||||||
|
@import "./carousel/style/entry.less";
|
||||||
|
@import "./checkbox/style/entry.less";
|
||||||
|
@import "./collapse/style/entry.less";
|
||||||
|
@import "./comment/style/entry.less";
|
||||||
|
@import "./date-picker/style/entry.less";
|
||||||
|
@import "./descriptions/style/entry.less";
|
||||||
|
@import "./divider/style/entry.less";
|
||||||
|
@import "./drawer/style/entry.less";
|
||||||
|
@import "./dropdown/style/entry.less";
|
||||||
|
@import "./empty/style/entry.less";
|
||||||
|
@import "./grid/style/entry.less";
|
||||||
|
@import "./image/style/entry.less";
|
||||||
|
@import "./input/style/entry.less";
|
||||||
|
@import "./input-number/style/entry.less";
|
||||||
|
@import "./layout/style/entry.less";
|
||||||
|
@import "./form/style/entry.less";
|
||||||
|
@import "./list/style/entry.less";
|
||||||
|
@import "./menu/style/entry.less";
|
||||||
|
@import "./mentions/style/entry.less";
|
||||||
|
@import "./message/style/entry.less";
|
||||||
|
@import "./modal/style/entry.less";
|
||||||
|
@import "./notification/style/entry.less";
|
||||||
|
@import "./page-header/style/entry.less";
|
||||||
|
@import "./pagination/style/entry.less";
|
||||||
|
@import "./popconfirm/style/entry.less";
|
||||||
|
@import "./popover/style/entry.less";
|
||||||
|
@import "./progress/style/entry.less";
|
||||||
|
@import "./radio/style/entry.less";
|
||||||
|
@import "./rate/style/entry.less";
|
||||||
|
@import "./select/style/entry.less";
|
||||||
|
@import "./skeleton/style/entry.less";
|
||||||
|
@import "./slider/style/entry.less";
|
||||||
|
@import "./space/style/entry.less";
|
||||||
|
@import "./spin/style/entry.less";
|
||||||
|
@import "./statistic/style/entry.less";
|
||||||
|
@import "./steps/style/entry.less";
|
||||||
|
@import "./switch/style/entry.less";
|
||||||
|
@import "./table/style/entry.less";
|
||||||
|
@import "./tabs/style/entry.less";
|
||||||
|
@import "./tag/style/entry.less";
|
||||||
|
@import "./time-picker/style/entry.less";
|
||||||
|
@import "./timeline/style/entry.less";
|
||||||
|
@import "./tooltip/style/entry.less";
|
||||||
|
@import "./transfer/style/entry.less";
|
||||||
|
@import "./typography/style/entry.less";
|
||||||
|
@import "./upload/style/entry.less";
|
||||||
|
@import "./auto-complete/style/entry.less";
|
||||||
|
@import "./cascader/style/entry.less";
|
||||||
|
@import "./tree/style/entry.less";
|
||||||
|
@import "./tree-select/style/entry.less";
|
||||||
|
@import "./calendar/style/entry.less";
|
||||||
|
@import "./result/style/entry.less";
|
1
_content/AntDesign/less/config-provider/style/entry.less
Executable file
1
_content/AntDesign/less/config-provider/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
2
_content/AntDesign/less/config-provider/style/index.less
Executable file
2
_content/AntDesign/less/config-provider/style/index.less
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
// placeholder
|
||||||
|
@import '../../style/themes/index';
|
402
_content/AntDesign/less/date-picker/style/Calendar.less
Executable file
402
_content/AntDesign/less/date-picker/style/Calendar.less
Executable file
@ -0,0 +1,402 @@
|
|||||||
|
.calendarLeftArrow() {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
position: relative;
|
||||||
|
top: -1px;
|
||||||
|
display: inline-block;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
vertical-align: middle;
|
||||||
|
border: 0 solid #aaa;
|
||||||
|
border-width: 1.5px 0 0 1.5px;
|
||||||
|
border-radius: 1px;
|
||||||
|
transform: rotate(-45deg) scale(0.8);
|
||||||
|
transition: all 0.3s;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover::before,
|
||||||
|
&:hover::after {
|
||||||
|
border-color: @text-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendarLeftDoubleArrow() {
|
||||||
|
.calendarLeftArrow;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position: relative;
|
||||||
|
left: -3px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendarRightArrow() {
|
||||||
|
.calendarLeftArrow;
|
||||||
|
|
||||||
|
&::before,
|
||||||
|
&::after {
|
||||||
|
transform: rotate(135deg) scale(0.8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendarRightDoubleArrow() {
|
||||||
|
.calendarRightArrow;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
position: relative;
|
||||||
|
left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendarPanelHeader(@calendar-prefix-cls) {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
text-align: center;
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: @link-hover-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-century-select,
|
||||||
|
.@{calendar-prefix-cls}-decade-select,
|
||||||
|
.@{calendar-prefix-cls}-year-select,
|
||||||
|
.@{calendar-prefix-cls}-month-select {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 2px;
|
||||||
|
color: @heading-color;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-century-select-arrow,
|
||||||
|
.@{calendar-prefix-cls}-decade-select-arrow,
|
||||||
|
.@{calendar-prefix-cls}-year-select-arrow,
|
||||||
|
.@{calendar-prefix-cls}-month-select-arrow {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-prev-century-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-century-btn,
|
||||||
|
.@{calendar-prefix-cls}-prev-decade-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-decade-btn,
|
||||||
|
.@{calendar-prefix-cls}-prev-month-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-month-btn,
|
||||||
|
.@{calendar-prefix-cls}-prev-year-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-year-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 5px;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: Arial, 'Hiragino Sans GB', 'Microsoft Yahei', 'Microsoft Sans Serif', sans-serif;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-prev-century-btn,
|
||||||
|
.@{calendar-prefix-cls}-prev-decade-btn,
|
||||||
|
.@{calendar-prefix-cls}-prev-year-btn {
|
||||||
|
left: 7px;
|
||||||
|
.calendarLeftDoubleArrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-next-century-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-decade-btn,
|
||||||
|
.@{calendar-prefix-cls}-next-year-btn {
|
||||||
|
right: 7px;
|
||||||
|
.calendarRightDoubleArrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-prev-month-btn {
|
||||||
|
left: 29px;
|
||||||
|
.calendarLeftArrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-next-month-btn {
|
||||||
|
right: 29px;
|
||||||
|
.calendarRightArrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar-selected-cell() {
|
||||||
|
.@{calendar-prefix-cls}-date {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
border: @border-width-base @border-style-base transparent;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
position: relative;
|
||||||
|
width: 280px;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: @line-height-base;
|
||||||
|
text-align: left;
|
||||||
|
list-style: none;
|
||||||
|
background-color: @component-background;
|
||||||
|
background-clip: padding-box;
|
||||||
|
border: @border-width-base @border-style-base @border-color-inverse;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
outline: none;
|
||||||
|
box-shadow: @box-shadow-base;
|
||||||
|
|
||||||
|
&-input-wrap {
|
||||||
|
height: 34px;
|
||||||
|
padding: 6px @control-padding-horizontal - 2px;
|
||||||
|
border-bottom: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-input {
|
||||||
|
width: 100%;
|
||||||
|
height: 22px;
|
||||||
|
color: @input-color;
|
||||||
|
background: @input-bg;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
cursor: auto;
|
||||||
|
.placeholder;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-week-number {
|
||||||
|
width: 286px;
|
||||||
|
|
||||||
|
&-cell {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-header {
|
||||||
|
.calendarPanelHeader(@calendar-prefix-cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
&-body {
|
||||||
|
padding: 8px 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 100%;
|
||||||
|
background-color: transparent;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
table,
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
text-align: center;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-calendar-table {
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-column-header {
|
||||||
|
width: 33px;
|
||||||
|
padding: 6px 0;
|
||||||
|
line-height: 18px;
|
||||||
|
text-align: center;
|
||||||
|
.@{calendar-prefix-cls}-column-header-inner {
|
||||||
|
display: block;
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-week-number-header {
|
||||||
|
.@{calendar-prefix-cls}-column-header-inner {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-cell {
|
||||||
|
height: 30px;
|
||||||
|
padding: 3px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-date {
|
||||||
|
display: block;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
color: @text-color;
|
||||||
|
line-height: 22px;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
border: @border-width-base @border-style-base transparent;
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
|
||||||
|
&-panel {
|
||||||
|
position: relative;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:active {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-today &-date {
|
||||||
|
color: @primary-color;
|
||||||
|
font-weight: bold;
|
||||||
|
border-color: @primary-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-selected-day &-date {
|
||||||
|
background: @primary-2;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-last-month-cell &-date,
|
||||||
|
&-next-month-btn-day &-date {
|
||||||
|
&,
|
||||||
|
&:hover {
|
||||||
|
color: @disabled-color;
|
||||||
|
background: transparent;
|
||||||
|
border-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled-cell &-date {
|
||||||
|
position: relative;
|
||||||
|
width: auto;
|
||||||
|
color: @disabled-color;
|
||||||
|
background: @disabled-bg;
|
||||||
|
border: @border-width-base @border-style-base transparent;
|
||||||
|
border-radius: 0;
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @disabled-bg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled-cell&-selected-day &-date::before {
|
||||||
|
position: absolute;
|
||||||
|
top: -1px;
|
||||||
|
left: 5px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled-cell&-today &-date {
|
||||||
|
position: relative;
|
||||||
|
padding-right: 5px;
|
||||||
|
padding-left: 5px;
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: -1px;
|
||||||
|
left: 5px;
|
||||||
|
width: 24px;
|
||||||
|
height: 24px;
|
||||||
|
border: @border-width-base @border-style-base @disabled-color;
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled-cell-first-of-row &-date {
|
||||||
|
border-top-left-radius: 4px;
|
||||||
|
border-bottom-left-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-disabled-cell-last-of-row &-date {
|
||||||
|
border-top-right-radius: 4px;
|
||||||
|
border-bottom-right-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-footer {
|
||||||
|
padding: 0 12px;
|
||||||
|
line-height: 38px;
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
&:empty {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
&-btn {
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
&-extra {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-today-btn,
|
||||||
|
.@{calendar-prefix-cls}-clear-btn {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 0 0 8px;
|
||||||
|
text-align: center;
|
||||||
|
&-disabled {
|
||||||
|
color: @disabled-color;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
&:only-child {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-clear-btn {
|
||||||
|
position: absolute;
|
||||||
|
top: 7px;
|
||||||
|
right: 5px;
|
||||||
|
display: none;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
margin: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: center;
|
||||||
|
text-indent: -76px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-clear-btn::after {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
color: @disabled-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: 1;
|
||||||
|
text-indent: 43px;
|
||||||
|
transition: color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-clear-btn:hover::after {
|
||||||
|
color: @text-color-secondary;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-ok-btn {
|
||||||
|
.btn;
|
||||||
|
.btn-primary;
|
||||||
|
.button-size(@btn-height-sm; @btn-padding-sm; @font-size-base; @border-radius-base);
|
||||||
|
|
||||||
|
line-height: @btn-height-sm - 2px;
|
||||||
|
|
||||||
|
.button-disabled();
|
||||||
|
}
|
||||||
|
}
|
80
_content/AntDesign/less/date-picker/style/DecadePanel.less
Executable file
80
_content/AntDesign/less/date-picker/style/DecadePanel.less
Executable file
@ -0,0 +1,80 @@
|
|||||||
|
.@{calendar-prefix-cls}-decade-panel {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: @zindex-picker-panel;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background: @calendar-bg;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-header {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-footer {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
.@{calendar-prefix-cls}-footer-extra {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-table {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
table-layout: fixed;
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-cell {
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-decade {
|
||||||
|
display: inline-block;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 6px;
|
||||||
|
color: @text-color;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-selected-cell .@{calendar-prefix-cls}-decade-panel-decade {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-last-century-cell,
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-next-century-cell {
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-decade {
|
||||||
|
color: @disabled-color;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
86
_content/AntDesign/less/date-picker/style/MonthPanel.less
Executable file
86
_content/AntDesign/less/date-picker/style/MonthPanel.less
Executable file
@ -0,0 +1,86 @@
|
|||||||
|
.@{calendar-prefix-cls}-month-panel {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: @zindex-picker-panel;
|
||||||
|
background: @component-background;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
// TODO: this is a useless wrapper, and we need to remove it in rc-calendar
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-header {
|
||||||
|
.calendarPanelHeader(~'@{calendar-prefix-cls}-month-panel');
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-footer {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
.@{calendar-prefix-cls}-footer-extra {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-table {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
table-layout: fixed;
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-selected-cell .@{calendar-prefix-cls}-month-panel-month {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-cell {
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&-disabled .@{calendar-prefix-cls}-month-panel-month {
|
||||||
|
&,
|
||||||
|
&:hover {
|
||||||
|
color: @disabled-color;
|
||||||
|
background: @disabled-bg;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-month-panel-month {
|
||||||
|
display: inline-block;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: @text-color;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
11
_content/AntDesign/less/date-picker/style/MonthPicker.less
Executable file
11
_content/AntDesign/less/date-picker/style/MonthPicker.less
Executable file
@ -0,0 +1,11 @@
|
|||||||
|
.@{calendar-prefix-cls}-month {
|
||||||
|
.@{calendar-prefix-cls}-month-header-wrap {
|
||||||
|
position: relative;
|
||||||
|
height: 288px;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-month-panel,
|
||||||
|
.@{calendar-prefix-cls}-year-panel {
|
||||||
|
top: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
109
_content/AntDesign/less/date-picker/style/Picker.less
Executable file
109
_content/AntDesign/less/date-picker/style/Picker.less
Executable file
@ -0,0 +1,109 @@
|
|||||||
|
@import '../../button/style/mixin';
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-picker-container {
|
||||||
|
.reset-component;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
z-index: @zindex-picker;
|
||||||
|
font-family: @font-family;
|
||||||
|
|
||||||
|
&.slide-up-enter.slide-up-enter-active&-placement-topLeft,
|
||||||
|
&.slide-up-enter.slide-up-enter-active&-placement-topRight,
|
||||||
|
&.slide-up-appear.slide-up-appear-active&-placement-topLeft,
|
||||||
|
&.slide-up-appear.slide-up-appear-active&-placement-topRight {
|
||||||
|
animation-name: antSlideDownIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
|
||||||
|
&.slide-up-enter.slide-up-enter-active&-placement-bottomRight,
|
||||||
|
&.slide-up-appear.slide-up-appear-active&-placement-bottomLeft,
|
||||||
|
&.slide-up-appear.slide-up-appear-active&-placement-bottomRight {
|
||||||
|
animation-name: antSlideUpIn;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.slide-up-leave.slide-up-leave-active&-placement-topLeft,
|
||||||
|
&.slide-up-leave.slide-up-leave-active&-placement-topRight {
|
||||||
|
animation-name: antSlideDownOut;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.slide-up-leave.slide-up-leave-active&-placement-bottomLeft,
|
||||||
|
&.slide-up-leave.slide-up-leave-active&-placement-bottomRight {
|
||||||
|
animation-name: antSlideUpOut;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-picker {
|
||||||
|
.reset-component;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
outline: none;
|
||||||
|
cursor: text;
|
||||||
|
transition: opacity 0.3s;
|
||||||
|
|
||||||
|
&-input {
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
&.@{ant-prefix}-input {
|
||||||
|
line-height: @line-height-base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-input.@{ant-prefix}-input-sm {
|
||||||
|
padding-top: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover &-input:not(.@{ant-prefix}-input-disabled) {
|
||||||
|
border-color: @input-hover-border-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus &-input:not(.@{ant-prefix}-input-disabled) {
|
||||||
|
.active();
|
||||||
|
}
|
||||||
|
|
||||||
|
&-clear,
|
||||||
|
&-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
right: @control-padding-horizontal;
|
||||||
|
z-index: 1;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
margin-top: -7px;
|
||||||
|
font-size: @font-size-sm;
|
||||||
|
line-height: 14px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-clear {
|
||||||
|
z-index: 2;
|
||||||
|
color: @disabled-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
background: @input-bg;
|
||||||
|
cursor: pointer;
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
&:hover {
|
||||||
|
color: @text-color-secondary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover &-clear {
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-icon {
|
||||||
|
display: inline-block;
|
||||||
|
color: @disabled-color;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-small &-clear,
|
||||||
|
&-small &-icon {
|
||||||
|
right: @control-padding-horizontal-sm;
|
||||||
|
}
|
||||||
|
}
|
248
_content/AntDesign/less/date-picker/style/RangePicker.less
Executable file
248
_content/AntDesign/less/date-picker/style/RangePicker.less
Executable file
@ -0,0 +1,248 @@
|
|||||||
|
@input-box-height: 34px;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-range-picker-input {
|
||||||
|
width: 44%;
|
||||||
|
height: 99%;
|
||||||
|
text-align: center;
|
||||||
|
background-color: transparent;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
.placeholder();
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-range-picker-separator {
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 10px;
|
||||||
|
height: 100%;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-align: center;
|
||||||
|
vertical-align: top;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-range {
|
||||||
|
width: 552px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-date-panel {
|
||||||
|
&::after {
|
||||||
|
display: block;
|
||||||
|
clear: both;
|
||||||
|
height: 0;
|
||||||
|
visibility: hidden;
|
||||||
|
content: '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&-part {
|
||||||
|
position: relative;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-left {
|
||||||
|
float: left;
|
||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
&-time-picker-inner {
|
||||||
|
border-right: 1px solid @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-right {
|
||||||
|
float: right;
|
||||||
|
.@{calendar-prefix-cls} {
|
||||||
|
&-time-picker-inner {
|
||||||
|
border-left: 1px solid @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-middle {
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
z-index: 1;
|
||||||
|
height: @input-box-height;
|
||||||
|
margin: 1px 0 0 0;
|
||||||
|
padding: 0 200px 0 0;
|
||||||
|
color: @text-color-secondary;
|
||||||
|
line-height: @input-box-height;
|
||||||
|
text-align: center;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-right .@{calendar-prefix-cls}-date-input-wrap {
|
||||||
|
margin-left: -90px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{calendar-prefix-cls}-time &-middle {
|
||||||
|
padding: 0 10px 0 0;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-today
|
||||||
|
:not(.@{calendar-prefix-cls}-disabled-cell)
|
||||||
|
:not(.@{calendar-prefix-cls}-last-month-cell)
|
||||||
|
:not(.@{calendar-prefix-cls}-next-month-btn-day) {
|
||||||
|
.@{calendar-prefix-cls}-date {
|
||||||
|
color: @primary-color;
|
||||||
|
background: @primary-2;
|
||||||
|
border-color: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-selected-start-date,
|
||||||
|
.@{calendar-prefix-cls}-selected-end-date {
|
||||||
|
.calendar-selected-cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{calendar-prefix-cls}-time &-right .@{calendar-prefix-cls}-date-input-wrap {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-input-wrap {
|
||||||
|
position: relative;
|
||||||
|
height: @input-box-height;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-input,
|
||||||
|
.@{calendar-timepicker-prefix-cls}-input {
|
||||||
|
.input;
|
||||||
|
height: @input-height-sm;
|
||||||
|
padding-right: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
line-height: @input-height-sm;
|
||||||
|
border: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-timepicker-prefix-cls}-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{calendar-prefix-cls}-week-number {
|
||||||
|
width: 574px;
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-range-part {
|
||||||
|
width: 286px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel,
|
||||||
|
.@{calendar-prefix-cls}-month-panel,
|
||||||
|
.@{calendar-prefix-cls}-decade-panel {
|
||||||
|
top: @input-box-height;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-month-panel .@{calendar-prefix-cls}-year-panel {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-decade-panel-table,
|
||||||
|
.@{calendar-prefix-cls}-year-panel-table,
|
||||||
|
.@{calendar-prefix-cls}-month-panel-table {
|
||||||
|
height: 208px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-in-range-cell {
|
||||||
|
position: relative;
|
||||||
|
border-radius: 0;
|
||||||
|
> div {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 4px;
|
||||||
|
right: 0;
|
||||||
|
bottom: 4px;
|
||||||
|
left: 0;
|
||||||
|
display: block;
|
||||||
|
background: @item-active-bg;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-footer-extra {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
// `div` for selector specificity
|
||||||
|
div&-quick-selector {
|
||||||
|
text-align: left;
|
||||||
|
|
||||||
|
> a {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls},
|
||||||
|
.@{calendar-prefix-cls}-month-panel,
|
||||||
|
.@{calendar-prefix-cls}-year-panel,
|
||||||
|
.@{calendar-prefix-cls}-decade-panel {
|
||||||
|
&-header {
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
&-body {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.@{calendar-prefix-cls}-time {
|
||||||
|
.@{calendar-timepicker-prefix-cls} {
|
||||||
|
top: 68px;
|
||||||
|
z-index: 2; // cover .ant-calendar-range .ant-calendar-in-range-cell > div (z-index: 1)
|
||||||
|
width: 100%;
|
||||||
|
height: 207px;
|
||||||
|
&-panel {
|
||||||
|
height: 267px;
|
||||||
|
margin-top: -34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
height: 100%;
|
||||||
|
padding-top: 40px;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-combobox {
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
background-color: @component-background;
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
}
|
||||||
|
&-select {
|
||||||
|
height: 100%;
|
||||||
|
ul {
|
||||||
|
max-height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-footer .@{calendar-prefix-cls}-time-picker-btn {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-today-btn {
|
||||||
|
height: 22px;
|
||||||
|
margin: 8px 12px;
|
||||||
|
line-height: 22px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&-with-ranges.@{calendar-prefix-cls}-time .@{calendar-timepicker-prefix-cls} {
|
||||||
|
height: 233px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-range.@{calendar-prefix-cls}-show-time-picker {
|
||||||
|
.@{calendar-prefix-cls}-body {
|
||||||
|
border-top-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
151
_content/AntDesign/less/date-picker/style/TimePicker.less
Executable file
151
_content/AntDesign/less/date-picker/style/TimePicker.less
Executable file
@ -0,0 +1,151 @@
|
|||||||
|
.@{calendar-timepicker-prefix-cls} {
|
||||||
|
position: absolute;
|
||||||
|
top: 40px;
|
||||||
|
width: 100%;
|
||||||
|
background-color: @component-background;
|
||||||
|
|
||||||
|
&-panel {
|
||||||
|
position: absolute;
|
||||||
|
z-index: @zindex-picker;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-inner {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: left;
|
||||||
|
list-style: none;
|
||||||
|
background-color: @component-background;
|
||||||
|
background-clip: padding-box;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
&-combobox {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-column-1,
|
||||||
|
&-column-1 &-select {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
&-column-2 &-select {
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
&-column-3 &-select {
|
||||||
|
width: 33.33%;
|
||||||
|
}
|
||||||
|
&-column-4 &-select {
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-input-wrap {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-select {
|
||||||
|
position: relative; // Fix chrome weird render bug
|
||||||
|
float: left;
|
||||||
|
height: 226px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: @font-size-base;
|
||||||
|
border-right: @border-width-base @border-style-base @border-color-split;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
border-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
border-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 206px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
width: 100%;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
list-style: none;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all .3s;
|
||||||
|
user-select: none;
|
||||||
|
|
||||||
|
&:last-child::after {
|
||||||
|
display: block;
|
||||||
|
height: 202px;
|
||||||
|
content: '';
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus {
|
||||||
|
color: @primary-color;
|
||||||
|
font-weight: 600;
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
li&-option-selected {
|
||||||
|
font-weight: 600;
|
||||||
|
background: @time-picker-selected-bg;
|
||||||
|
}
|
||||||
|
|
||||||
|
li&-option-disabled {
|
||||||
|
color: @btn-disable-color;
|
||||||
|
&:hover {
|
||||||
|
background: transparent;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-time {
|
||||||
|
.@{calendar-prefix-cls}-day-select {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0 2px;
|
||||||
|
color: @heading-color;
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 34px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-footer {
|
||||||
|
position: relative;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
&-btn {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-today-btn {
|
||||||
|
float: left;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-time-picker-btn {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 8px;
|
||||||
|
|
||||||
|
&-disabled {
|
||||||
|
color: @disabled-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
_content/AntDesign/less/date-picker/style/WeekPicker.less
Executable file
21
_content/AntDesign/less/date-picker/style/WeekPicker.less
Executable file
@ -0,0 +1,21 @@
|
|||||||
|
.@{calendar-prefix-cls}-week-number {
|
||||||
|
&-cell {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-body tr {
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
&:hover {
|
||||||
|
background: @primary-1;
|
||||||
|
}
|
||||||
|
&.@{calendar-prefix-cls}-active-week {
|
||||||
|
font-weight: bold;
|
||||||
|
background: @primary-2;
|
||||||
|
}
|
||||||
|
.@{calendar-prefix-cls}-selected-day .@{calendar-prefix-cls}-date,
|
||||||
|
.@{calendar-prefix-cls}-selected-day:hover .@{calendar-prefix-cls}-date {
|
||||||
|
color: @text-color;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
85
_content/AntDesign/less/date-picker/style/YearPanel.less
Executable file
85
_content/AntDesign/less/date-picker/style/YearPanel.less
Executable file
@ -0,0 +1,85 @@
|
|||||||
|
.@{calendar-prefix-cls}-year-panel {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: @zindex-picker-panel;
|
||||||
|
background: @component-background;
|
||||||
|
border-radius: @border-radius-base;
|
||||||
|
outline: none;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
// TODO: this is a useless wrapper, and we need to remove it in rc-calendar
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-header {
|
||||||
|
.calendarPanelHeader(~'@{calendar-prefix-cls}-year-panel');
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-footer {
|
||||||
|
border-top: @border-width-base @border-style-base @border-color-split;
|
||||||
|
.@{calendar-prefix-cls}-footer-extra {
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-table {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
table-layout: fixed;
|
||||||
|
border-collapse: separate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-cell {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-year {
|
||||||
|
display: inline-block;
|
||||||
|
height: 24px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 8px;
|
||||||
|
color: @text-color;
|
||||||
|
line-height: 24px;
|
||||||
|
text-align: center;
|
||||||
|
background: transparent;
|
||||||
|
border-radius: @border-radius-sm;
|
||||||
|
transition: background 0.3s ease;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: @item-hover-bg;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-selected-cell .@{calendar-prefix-cls}-year-panel-year {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: @text-color-inverse;
|
||||||
|
background: @primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{calendar-prefix-cls}-year-panel-last-decade-cell,
|
||||||
|
.@{calendar-prefix-cls}-year-panel-next-decade-cell {
|
||||||
|
.@{calendar-prefix-cls}-year-panel-year {
|
||||||
|
color: @disabled-color;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
}
|
1
_content/AntDesign/less/date-picker/style/entry.less
Executable file
1
_content/AntDesign/less/date-picker/style/entry.less
Executable file
@ -0,0 +1 @@
|
|||||||
|
@import './index.less';
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user