@moneko/core 2.0.0-beta.8 → 2.0.1-8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/common.js +1 -1
- package/build/coverage.js +1 -1
- package/build/done.d.ts +8 -0
- package/build/done.js +1 -0
- package/build/envFlags.d.ts +2 -4
- package/build/envFlags.js +1 -1
- package/build/has-pkg.js +1 -1
- package/build/html-plugin-option.d.ts +2 -2
- package/build/html-plugin-option.js +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.js +1 -0
- package/build/minify.d.ts +1 -1
- package/build/modifyVars.js +1 -1
- package/build/module-federation.d.ts +1 -1
- package/build/module-federation.js +1 -1
- package/build/module.config.js +1 -1
- package/build/process-env.d.ts +3 -1
- package/build/process-env.js +1 -1
- package/build/resolver-sync.js +1 -1
- package/build/seo.d.ts +1 -0
- package/build/seo.js +1 -0
- package/build/swcrc.js +1 -1
- package/build/tsloader.config.js +1 -1
- package/build/utils.d.ts +9 -6
- package/build/utils.js +1 -1
- package/build/webpack.common.d.ts +1 -0
- package/build/webpack.common.js +1 -1
- package/build/webpack.dev.js +1 -1
- package/build/webpack.prod.js +1 -1
- package/lib/components/app-router.d.ts +8 -0
- package/lib/components/app-router.js +2 -0
- package/lib/components/app-router.js.map +1 -0
- package/lib/components/{fallback-comp/index.js → fallback-comp.js} +1 -1
- package/lib/components/fallback-comp.js.map +1 -0
- package/lib/components/{fallback/index.js → fallback.js} +2 -2
- package/lib/components/fallback.js.map +1 -0
- package/lib/components/{layout-menu/index.d.ts → layout-menu.d.ts} +1 -2
- package/lib/components/layout-menu.js +2 -0
- package/lib/components/layout-menu.js.map +1 -0
- package/lib/index.d.ts +15 -15
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/localizable.d.ts +53 -0
- package/lib/localizable.js +2 -0
- package/lib/localizable.js.map +1 -0
- package/lib/menu.d.ts +115 -0
- package/lib/menu.js +2 -0
- package/lib/menu.js.map +1 -0
- package/lib/packages/back-stage/app.d.ts +2 -4
- package/lib/packages/back-stage/app.js +1 -1
- package/lib/packages/back-stage/app.js.map +1 -1
- package/lib/packages/back-stage/bootstrap.d.ts +1 -1
- package/lib/packages/back-stage/bootstrap.js +1 -1
- package/lib/packages/back-stage/bootstrap.js.map +1 -1
- package/lib/packages/back-stage/index.d.ts +1 -2
- package/lib/packages/back-stage/index.js +1 -1
- package/lib/packages/back-stage/index.js.map +1 -1
- package/lib/packages/back-stage/layout.d.ts +5 -0
- package/lib/packages/back-stage/layout.js +2 -0
- package/lib/packages/back-stage/layout.js.map +1 -0
- package/lib/packages/library/app.js +1 -1
- package/lib/packages/library/app.js.map +1 -1
- package/lib/packages/library/bootstrap.d.ts +1 -1
- package/lib/packages/library/bootstrap.js +1 -1
- package/lib/packages/library/bootstrap.js.map +1 -1
- package/lib/packages/library/index.d.ts +1 -2
- package/lib/packages/library/index.js +1 -1
- package/lib/packages/library/index.js.map +1 -1
- package/lib/packages/mobile/app.js +1 -1
- package/lib/packages/mobile/app.js.map +1 -1
- package/lib/packages/mobile/index.d.ts +1 -3
- package/lib/packages/mobile/index.js +1 -1
- package/lib/packages/mobile/index.js.map +1 -1
- package/lib/packages/single-spa/app.d.ts +6 -5
- package/lib/packages/single-spa/app.js +1 -1
- package/lib/packages/single-spa/app.js.map +1 -1
- package/lib/packages/single-spa/bootstrap.d.ts +0 -1
- package/lib/packages/single-spa/bootstrap.js +1 -1
- package/lib/packages/single-spa/bootstrap.js.map +1 -1
- package/lib/packages/single-spa/index.d.ts +1 -2
- package/lib/packages/single-spa/index.js +1 -1
- package/lib/packages/single-spa/index.js.map +1 -1
- package/lib/packages/site/app.js +1 -1
- package/lib/packages/site/app.js.map +1 -1
- package/lib/packages/site/bootstrap.d.ts +1 -1
- package/lib/packages/site/bootstrap.js +1 -1
- package/lib/packages/site/bootstrap.js.map +1 -1
- package/lib/packages/site/index.d.ts +1 -2
- package/lib/packages/site/index.js +1 -1
- package/lib/packages/site/index.js.map +1 -1
- package/lib/prefix/react-router-dom.js +1 -1
- package/lib/prefix/react-router-dom.js.map +1 -1
- package/lib/react-router-dom/link.d.ts +9 -0
- package/lib/react-router-dom/link.js +2 -0
- package/lib/react-router-dom/link.js.map +1 -0
- package/lib/{hooks/navgate.d.ts → react-router-dom/use-navgate.d.ts} +1 -1
- package/lib/{hooks/navgate.js → react-router-dom/use-navgate.js} +1 -1
- package/lib/react-router-dom/use-navgate.js.map +1 -0
- package/lib/router/index.d.ts +36 -7
- package/lib/router/index.js +1 -1
- package/lib/router/index.js.map +1 -1
- package/lib/sso/index.d.ts +23 -0
- package/lib/sso/index.js +2 -0
- package/lib/sso/index.js.map +1 -0
- package/lib/styles/normalize.css +111 -34
- package/lib/styles/variables.css +35 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/package.json +28 -32
- package/typings/global.d.ts +179 -67
- package/build/has-antd.d.ts +0 -2
- package/build/has-antd.js +0 -1
- package/lib/components/app-router/index.d.ts +0 -8
- package/lib/components/app-router/index.js +0 -2
- package/lib/components/app-router/index.js.map +0 -1
- package/lib/components/fallback/index.js.map +0 -1
- package/lib/components/fallback-comp/index.js.map +0 -1
- package/lib/components/layout-menu/index.global.less +0 -40
- package/lib/components/layout-menu/index.js +0 -2
- package/lib/components/layout-menu/index.js.map +0 -1
- package/lib/components/readme/index.d.ts +0 -3
- package/lib/components/readme/index.js +0 -2
- package/lib/components/readme/index.js.map +0 -1
- package/lib/components/readme/index.less +0 -4
- package/lib/hooks/navgate.js.map +0 -1
- package/lib/packages/back-stage/antd.global.less +0 -67
- package/lib/packages/back-stage/layout/index.d.ts +0 -3
- package/lib/packages/back-stage/layout/index.js +0 -2
- package/lib/packages/back-stage/layout/index.js.map +0 -1
- package/lib/packages/back-stage/layout/index.less +0 -91
- package/lib/packages/back-stage/models/app-program.d.ts +0 -24
- package/lib/packages/back-stage/models/app-program.js +0 -2
- package/lib/packages/back-stage/models/app-program.js.map +0 -1
- package/lib/prefix/i18n-hooks.d.ts +0 -1
- package/lib/prefix/i18n-hooks.js +0 -2
- package/lib/prefix/i18n-hooks.js.map +0 -1
- package/lib/prefix/mini-idc.d.ts +0 -1
- package/lib/prefix/mini-idc.js +0 -2
- package/lib/prefix/mini-idc.js.map +0 -1
- package/lib/styles/animation.less +0 -58
- package/lib/styles/ant.variables.global.less +0 -231
- package/lib/styles/eval/bezierEasing.less +0 -106
- package/lib/styles/eval/colorPalette.less +0 -73
- package/lib/styles/eval/tinyColor.less +0 -1181
- package/lib/styles/index.global.less +0 -136
- package/lib/styles/vars.less +0 -98
- package/lib/utils/color-palette.d.ts +0 -2
- package/lib/utils/color-palette.js +0 -2
- package/lib/utils/color-palette.js.map +0 -1
- package/lib/utils/env.d.ts +0 -0
- package/lib/utils/env.js +0 -2
- package/lib/utils/env.js.map +0 -1
- package/lib/utils/fontloader.d.ts +0 -1
- package/lib/utils/fontloader.js +0 -2
- package/lib/utils/fontloader.js.map +0 -1
- package/lib/utils/lazy-import.d.ts +0 -22
- package/lib/utils/lazy-import.js +0 -2
- package/lib/utils/lazy-import.js.map +0 -1
- package/lib/utils/theme.d.ts +0 -13
- package/lib/utils/theme.js +0 -2
- package/lib/utils/theme.js.map +0 -1
- /package/lib/components/{fallback-comp/index.d.ts → fallback-comp.d.ts} +0 -0
- /package/lib/components/{fallback/index.d.ts → fallback.d.ts} +0 -0
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
.tabs {
|
|
2
|
-
margin: 16px 16px 0 !important;
|
|
3
|
-
overflow: initial !important;
|
|
4
|
-
|
|
5
|
-
> :global(.@{ant-prefix}-tabs-nav) {
|
|
6
|
-
margin-bottom: 0 !important;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.layout {
|
|
11
|
-
width: 100% !important;
|
|
12
|
-
min-height: 100vh !important;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.sider,
|
|
16
|
-
.section {
|
|
17
|
-
max-height: 100vh;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.layout-content {
|
|
21
|
-
display: flex;
|
|
22
|
-
flex-direction: column;
|
|
23
|
-
margin: 0 16px;
|
|
24
|
-
overflow-y: auto;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.content {
|
|
28
|
-
flex: 1;
|
|
29
|
-
padding: 24px;
|
|
30
|
-
background: var(--component-card-bg, #fff);
|
|
31
|
-
box-shadow: var(--box-shadow-lite);
|
|
32
|
-
transition-timing-function: @transition-timing-function;
|
|
33
|
-
transition-duration: @transition-duration;
|
|
34
|
-
transition-property: background-color, box-shadow;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.logo {
|
|
38
|
-
position: sticky;
|
|
39
|
-
top: 0;
|
|
40
|
-
z-index: 1;
|
|
41
|
-
height: 68px;
|
|
42
|
-
padding: 14px;
|
|
43
|
-
overflow: hidden;
|
|
44
|
-
color: #de4553;
|
|
45
|
-
text-align: center;
|
|
46
|
-
background-color: var(--sider-logo-bg, #fff) !important;
|
|
47
|
-
border-color: var(--sider-logo-bg, #fff);
|
|
48
|
-
border-right: 16px solid var(--sider-logo-bg, #fff);
|
|
49
|
-
border-bottom: 1px solid var(--border-color);
|
|
50
|
-
border-bottom-color: var(--border-color);
|
|
51
|
-
border-left: 16px solid var(--sider-logo-bg, #fff);
|
|
52
|
-
cursor: pointer;
|
|
53
|
-
transition: border-color @transition-duration @transition-timing-function,
|
|
54
|
-
background-color @transition-duration @transition-timing-function;
|
|
55
|
-
user-select: none;
|
|
56
|
-
|
|
57
|
-
> svg {
|
|
58
|
-
height: 32px;
|
|
59
|
-
opacity: 0;
|
|
60
|
-
transition: opacity @transition-duration @transition-timing-function;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&::before {
|
|
64
|
-
position: absolute;
|
|
65
|
-
top: 0;
|
|
66
|
-
bottom: 0;
|
|
67
|
-
left: 0;
|
|
68
|
-
display: block;
|
|
69
|
-
width: 22px;
|
|
70
|
-
height: 32px;
|
|
71
|
-
margin: auto;
|
|
72
|
-
background: url('@{favicon}') no-repeat center center / contain;
|
|
73
|
-
opacity: 1;
|
|
74
|
-
transition: opacity @transition-duration @transition-timing-function;
|
|
75
|
-
content: '';
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
:global(.@{ant-prefix}-layout-sider) {
|
|
80
|
-
&:not(:global(.@{ant-prefix}-layout-sider-collapsed)) {
|
|
81
|
-
.logo {
|
|
82
|
-
> svg {
|
|
83
|
-
opacity: 1;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&::before {
|
|
87
|
-
opacity: 0;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ModelType } from 'mini-idc';
|
|
2
|
-
import type { RouterProps } from '../../../router';
|
|
3
|
-
export interface ItemTypes extends RouterProps {
|
|
4
|
-
key: string;
|
|
5
|
-
path?: string;
|
|
6
|
-
type?: string;
|
|
7
|
-
label?: string | null;
|
|
8
|
-
children?: ItemTypes[];
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
}
|
|
11
|
-
export interface AppProgramModelType {
|
|
12
|
-
menu: ItemTypes[];
|
|
13
|
-
menuKV: Record<string, ItemTypes>;
|
|
14
|
-
activeKey?: string;
|
|
15
|
-
tabs: TabProps[];
|
|
16
|
-
}
|
|
17
|
-
export interface TabProps extends RouterProps {
|
|
18
|
-
key: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
path?: string;
|
|
21
|
-
closable?: boolean;
|
|
22
|
-
}
|
|
23
|
-
declare const model: ModelType<AppProgramModelType>;
|
|
24
|
-
export default model;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==="function"){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable}))}ownKeys.forEach(function(key){_defineProperty(target,key,source[key])})}return target}function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);if(enumerableOnly){symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})}keys.push.apply(keys,symbols)}return keys}function _objectSpreadProps(target,source){source=source!=null?source:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(target,Object.getOwnPropertyDescriptors(source))}else{ownKeys(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _objectWithoutProperties(source,excluded){if(source==null)return{};var target=_objectWithoutPropertiesLoose(source,excluded);var key,i;if(Object.getOwnPropertySymbols){var sourceSymbolKeys=Object.getOwnPropertySymbols(source);for(i=0;i<sourceSymbolKeys.length;i++){key=sourceSymbolKeys[i];if(excluded.indexOf(key)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i<sourceKeys.length;i++){key=sourceKeys[i];if(excluded.indexOf(key)>=0)continue;target[key]=source[key]}return target}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var __generator=this&&this.__generator||function(thisArg,body){var f,y,t,g,_={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]};return g={next:verb(0),"throw":verb(1),"return":verb(2)},typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}};import{isEqual,isFunction}from"@moneko/common";import{shallowEqual}from"mini-idc";var getItems=function(arr){return arr.map(function(item){var children=item.children,args=_objectWithoutProperties(item,["children"]);var _item=_objectSpreadProps(_objectSpread({},args),{label:args.i18n});if(Array.isArray(children)&&children.length){Object.assign(_item,{children:getItems(children)})}return _item})};var getMenuKV=function(arr,obj){arr.forEach(function(item){var children=item.children,args=_objectWithoutProperties(item,["children"]);Object.assign(obj,_defineProperty({},item.key,args));if(Array.isArray(children)&&children.length){getMenuKV(children,obj)}})};var model={namespace:"appProgram",state:{menu:[],menuKV:{},tabs:[],activeKey:"home"},reducers:{setMenu:function(state,param){var _param_payload=param.payload,payload=_param_payload===void 0?[]:_param_payload;var items=getItems(payload),im={};getMenuKV(items,im);return _objectSpreadProps(_objectSpread({},state),{menu:items,menuKV:im})},setTabs:function(state,action){return _objectSpreadProps(_objectSpread({},state),{tabs:action.payload})},addTab:function(state,param){var payload=param.payload;var tabs=state.tabs,menuKV=state.menuKV;var current=menuKV[payload.key];if(current&&!tabs.find(function(item){return item.key===payload.key})){var ntabs=_toConsumableArray(tabs).concat([_objectSpread(_objectSpreadProps(_objectSpread({},current),{i18n:current.i18n||"route-".concat(current.key)}),payload)]);if(!isEqual(ntabs,tabs)){return _objectSpreadProps(_objectSpread({},state),{tabs:ntabs})}}return state},setActiveKey:function(state,action){return _objectSpreadProps(_objectSpread({},state),{activeKey:action.payload})}},effects:{openTab:function openTab(param,param1){var payload,put,key,_payload_dynamicTitle,dynamicTitle;return __generator(this,function(_state){switch(_state.label){case 0:payload=param.payload,put=param1.put;key=payload.key,_payload_dynamicTitle=payload.dynamicTitle,dynamicTitle=_payload_dynamicTitle===void 0?"":_payload_dynamicTitle;return[4,put({type:"appProgram/addTab",payload:{key:key,dynamicTitle:dynamicTitle}})];case 1:_state.sent();return[4,put({type:"appProgram/setActiveKey",payload:key})];case 2:_state.sent();return[2]}})},closeTab:function closeTab(param,param1){var payload,put,select,key,_payload_type,type,callback,_ref,tabs,activeKey,nActiveKey,closeTabs,nextTab,isCloseSelf,idx,nTabs;return __generator(this,function(_state){switch(_state.label){case 0:payload=param.payload,put=param1.put,select=param1.select;key=payload.key,_payload_type=payload.type,type=_payload_type===void 0?"self":_payload_type,callback=payload.callback;if(!key)return[2];return[4,select(function(store){return store.appProgram},shallowEqual)];case 1:_ref=_state.sent(),tabs=_ref.tabs,activeKey=_ref.activeKey;nActiveKey=activeKey;closeTabs=[];nextTab=null;isCloseSelf=type==="self";idx=tabs.findIndex(function(t){return t.key===key});nTabs=tabs.filter(function(item,i){var notClose=item.closable===false;if(!notClose){notClose=({left:i>=idx,right:i<=idx,other:i===idx,self:key!==item.key})[type]}if(isCloseSelf){if(!notClose){if(key===nActiveKey&&isCloseSelf){var adx=i?i-1:i+1;if(tabs[adx]){nActiveKey=tabs[adx].key;nextTab=tabs[adx]}}}}else if(notClose&&item.key===key&&nActiveKey!==key){nActiveKey=key;nextTab=tabs[i]}if(!notClose){closeTabs.push(item)}return notClose});if(isFunction(callback)){payload.callback(closeTabs,nextTab)}return[4,put({type:"appProgram/setTabs",payload:nTabs})];case 2:_state.sent();return[4,put({type:"appProgram/setActiveKey",payload:nActiveKey})];case 3:_state.sent();return[2]}})}}};export default model;
|
|
2
|
-
//# sourceMappingURL=app-program.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/packages/back-stage/models/app-program.ts"],"sourcesContent":["import { isEqual, isFunction } from '@moneko/common';\nimport { ModelActionType, ModelEffectMap, ModelType, shallowEqual } from 'mini-idc';\nimport type { RouterProps } from '../../../router';\n\nexport interface ItemTypes extends RouterProps {\n key: string;\n path?: string;\n type?: string;\n label?: string | null;\n children?: ItemTypes[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [key: string]: any;\n}\n\nconst getItems = (arr: ItemTypes[]): ItemTypes[] => {\n return arr.map((item) => {\n const { children, ...args } = item;\n const _item = { ...args, label: args.i18n };\n\n if (Array.isArray(children) && children.length) {\n Object.assign(_item, {\n children: getItems(children),\n });\n }\n return _item;\n });\n};\nconst getMenuKV = (arr: ItemTypes[], obj: Record<string, ItemTypes>): void => {\n arr.forEach((item) => {\n const { children, ...args } = item;\n\n Object.assign(obj, {\n [item.key]: args,\n });\n if (Array.isArray(children) && children.length) {\n getMenuKV(children, obj);\n }\n });\n};\n\nexport interface AppProgramModelType {\n menu: ItemTypes[];\n menuKV: Record<string, ItemTypes>;\n activeKey?: string;\n tabs: TabProps[];\n}\nexport interface TabProps extends RouterProps {\n key: string;\n url?: string;\n path?: string;\n closable?: boolean;\n}\ntype RemoveTabType = 'left' | 'right' | 'other' | 'self';\n\nconst model: ModelType<AppProgramModelType> = {\n namespace: 'appProgram',\n state: {\n menu: [],\n menuKV: {},\n tabs: [],\n activeKey: 'home',\n },\n reducers: {\n setMenu: (state, { payload = [] }) => {\n const items = getItems(payload),\n im: Record<string, ItemTypes> = {};\n\n getMenuKV(items, im);\n return {\n ...state,\n menu: items,\n menuKV: im,\n };\n },\n setTabs: (state, action) => {\n return {\n ...state,\n tabs: action.payload,\n };\n },\n addTab: (state, { payload }) => {\n const { tabs, menuKV } = state;\n const current = menuKV[payload.key];\n\n if (current && !tabs.find((item: TabProps) => item.key === payload.key)) {\n const ntabs = [\n ...tabs,\n {\n ...current,\n i18n: current.i18n || `route-${current.key}`,\n ...payload,\n },\n ];\n\n if (!isEqual(ntabs, tabs)) {\n return {\n ...state,\n tabs: ntabs,\n };\n }\n }\n\n return state;\n },\n setActiveKey: (state, action) => {\n return {\n ...state,\n activeKey: action.payload,\n };\n },\n },\n effects: {\n *openTab(\n { payload }: Partial<ModelActionType>,\n { put }: ModelEffectMap\n ): Generator<unknown, void, TabProps[]> {\n const { key, dynamicTitle = '' } = payload;\n\n yield put({\n type: 'appProgram/addTab',\n payload: {\n key,\n dynamicTitle,\n },\n });\n yield put({\n type: 'appProgram/setActiveKey',\n payload: key,\n });\n },\n *closeTab(\n { payload }: Partial<ModelActionType>,\n { put, select }: ModelEffectMap\n ): Generator<unknown, void, AppProgramModelType> {\n const { key, type = 'self', callback } = payload;\n\n if (!key) return;\n\n const { tabs, activeKey } = yield select((store: AppStore) => store.appProgram, shallowEqual);\n\n let nActiveKey = activeKey;\n const closeTabs: TabProps[] = [];\n let nextTab: TabProps | null = null;\n // 关闭当前tab\n const isCloseSelf = type === 'self';\n const idx = tabs.findIndex((t) => t.key === key);\n const nTabs = tabs.filter((item, i) => {\n let notClose = item.closable === false;\n\n if (!notClose) {\n notClose = {\n left: i >= idx,\n right: i <= idx,\n other: i === idx,\n self: key !== item.key,\n }[type as RemoveTabType];\n }\n\n if (isCloseSelf) {\n if (!notClose) {\n if (key === nActiveKey && isCloseSelf) {\n const adx: number | null = i ? i - 1 : i + 1;\n\n if (tabs[adx]) {\n nActiveKey = tabs[adx].key;\n nextTab = tabs[adx];\n }\n }\n }\n } else if (notClose && item.key === key && nActiveKey !== key) {\n nActiveKey = key;\n nextTab = tabs[i];\n }\n if (!notClose) {\n closeTabs.push(item);\n }\n return notClose;\n });\n\n if (isFunction(callback)) {\n payload.callback(closeTabs, nextTab);\n }\n\n yield put({\n type: 'appProgram/setTabs',\n payload: nTabs,\n });\n yield put({\n type: 'appProgram/setActiveKey',\n payload: nActiveKey,\n });\n },\n },\n};\n\nexport default model;\n"],"names":["isEqual","isFunction","shallowEqual","getItems","arr","map","item","children","args","_item","label","i18n","Array","isArray","length","Object","assign","getMenuKV","obj","forEach","key","model","namespace","state","menu","menuKV","tabs","activeKey","reducers","setMenu","payload","items","im","setTabs","action","addTab","current","find","ntabs","setActiveKey","effects","openTab","put","dynamicTitle","type","closeTab","select","callback","nActiveKey","closeTabs","nextTab","isCloseSelf","idx","nTabs","store","appProgram","findIndex","t","filter","i","notClose","closable","left","right","other","self","adx","push"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'i18n-hooks';
|
package/lib/prefix/i18n-hooks.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/prefix/i18n-hooks.js"],"sourcesContent":["module.exports = hasLocales ? require('i18n-hooks') : {};\n"],"names":["module","exports","hasLocales","require"],"mappings":"AAAAA,OAAOC,OAAO,CAAGC,WAAaC,QAAQ,cAAgB,CAAC,CAAC"}
|
package/lib/prefix/mini-idc.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from 'mini-idc';
|
package/lib/prefix/mini-idc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/prefix/mini-idc.js"],"sourcesContent":["module.exports = hasModels ? require('mini-idc') : {};\n"],"names":["module","exports","hasModels","require"],"mappings":"AAAAA,OAAOC,OAAO,CAAGC,UAAYC,QAAQ,YAAc,CAAC,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
@keyframes route-in {
|
|
2
|
-
from {
|
|
3
|
-
transform: translate3d(0, 1rem, 0);
|
|
4
|
-
opacity: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
to {
|
|
8
|
-
transform: translate3d(0, 0, 0);
|
|
9
|
-
opacity: 1;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@keyframes route-out {
|
|
14
|
-
from {
|
|
15
|
-
transform: translate3d(0, 0, 0);
|
|
16
|
-
opacity: 1;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
to {
|
|
20
|
-
z-index: -1;
|
|
21
|
-
transform: translate3d(0, 1rem, 0);
|
|
22
|
-
opacity: 0;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@keyframes fade-in {
|
|
27
|
-
from {
|
|
28
|
-
opacity: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
to {
|
|
32
|
-
opacity: 1;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@keyframes fade-out {
|
|
37
|
-
from {
|
|
38
|
-
opacity: 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
to {
|
|
42
|
-
opacity: 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@keyframes avatar-in {
|
|
47
|
-
0% {
|
|
48
|
-
transform: scale(30);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
20% {
|
|
52
|
-
transform: scale(30);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
100% {
|
|
56
|
-
transform: scale(1);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
.@{ant-prefix}-input-affix-wrapper-focused,
|
|
2
|
-
.@{ant-prefix}-input-affix-wrapper:focus,
|
|
3
|
-
.@{ant-prefix}-input-focused,
|
|
4
|
-
.@{ant-prefix}-input:focus,
|
|
5
|
-
.@{ant-prefix}-input-number-focused,
|
|
6
|
-
.@{ant-prefix}-input-number:focus,
|
|
7
|
-
.@{ant-prefix}-picker-focused,
|
|
8
|
-
.@{ant-prefix}-pagination-options-quick-jumper input-focused,
|
|
9
|
-
.@{ant-prefix}-pagination-options-quick-jumper input:focus,
|
|
10
|
-
.@{ant-prefix}-select-focused:not(.@{ant-prefix}-select-disabled).@{ant-prefix}-select:not(.@{ant-prefix}-select-customize-input)
|
|
11
|
-
.@{ant-prefix}-select-selector {
|
|
12
|
-
border-color: var(--primary-color-hover) !important;
|
|
13
|
-
box-shadow: @input-outline-offset @outline-blur-size @outline-width var(--primary-color-outline) !important;
|
|
14
|
-
}
|
|
15
|
-
.@{ant-prefix}-upload.@{ant-prefix}-upload-drag:not(.@{ant-prefix}-upload-disabled):hover {
|
|
16
|
-
border-color: var(--primary-color-hover) !important;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.@{ant-prefix}-tree {
|
|
20
|
-
&.@{ant-prefix}-tree-block-node &-list-holder-inner &-treenode.dragging:after {
|
|
21
|
-
border-color: var(--primary-color, @primary-color) !important;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&-drop-indicator {
|
|
25
|
-
background-color: var(--primary-color, @primary-color) !important;
|
|
26
|
-
|
|
27
|
-
&::after {
|
|
28
|
-
border: 2px solid var(--primary-color, @primary-color) !important;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// picker
|
|
34
|
-
.@{ant-prefix}-picker-cell-in-view {
|
|
35
|
-
&.@{ant-prefix}-picker-cell-today .@{ant-prefix}-picker-cell-inner:before {
|
|
36
|
-
border-color: var(--primary-color) !important;
|
|
37
|
-
}
|
|
38
|
-
&.@{ant-prefix}-picker-cell-range-end,
|
|
39
|
-
&.@{ant-prefix}-picker-cell-range-start,
|
|
40
|
-
&.@{ant-prefix}-picker-cell-selected {
|
|
41
|
-
.@{ant-prefix}-picker-cell-inner {
|
|
42
|
-
background: var(--primary-color) !important;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.@{ant-prefix}-picker-header-view button:hover {
|
|
48
|
-
color: var(--primary-color) !important;
|
|
49
|
-
}
|
|
50
|
-
.@{ant-prefix}-pagination {
|
|
51
|
-
&-next:hover,
|
|
52
|
-
&-prev:hover {
|
|
53
|
-
.@{ant-prefix}-pagination-item-link {
|
|
54
|
-
border-color: var(--primary-color) !important;
|
|
55
|
-
color: var(--primary-color) !important;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&-item-active,
|
|
60
|
-
&-item:hover {
|
|
61
|
-
border-color: var(--primary-color) !important;
|
|
62
|
-
|
|
63
|
-
a {
|
|
64
|
-
color: @pagination-item-active-color !important;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.@{ant-prefix}-transfer-list-content-item-checked,
|
|
70
|
-
.@{ant-prefix}-picker-time-panel-column
|
|
71
|
-
> li.@{ant-prefix}-picker-time-panel-cell-selected
|
|
72
|
-
.@{ant-prefix}-picker-time-panel-cell-inner {
|
|
73
|
-
background: var(--primary-1) !important;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.@{ant-prefix}-tag-processing {
|
|
77
|
-
color: var(--primary-color, @primary-color) !important;
|
|
78
|
-
background: var(--primary-color-deprecated-bg) !important;
|
|
79
|
-
border-color: var(--primary-color-deprecated-border) !important;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.@{ant-prefix}-tag-danger {
|
|
83
|
-
color: var(--error-color, @error-color) !important;
|
|
84
|
-
background: var(--error-color-deprecated-bg) !important;
|
|
85
|
-
border-color: var(--error-color-deprecated-border) !important;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
.@{ant-prefix}-typography.@{ant-prefix}-typography-success {
|
|
90
|
-
color: var(--success-color) !important;
|
|
91
|
-
|
|
92
|
-
&:hover {
|
|
93
|
-
color: var(--success-color-hover) !important;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
&:active,
|
|
97
|
-
&:focus {
|
|
98
|
-
color: var(--success-color-active) !important;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
.@{ant-prefix}-typography.@{ant-prefix}-typography-danger {
|
|
104
|
-
color: var(--error-color) !important;
|
|
105
|
-
|
|
106
|
-
&:hover {
|
|
107
|
-
color: var(--error-color-hover) !important;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&:active,
|
|
111
|
-
&:focus {
|
|
112
|
-
color: var(--error-color-active) !important;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.@{ant-prefix}-typography.@{ant-prefix}-typography-warning {
|
|
117
|
-
color: var(--warning-color) !important;
|
|
118
|
-
|
|
119
|
-
&:hover {
|
|
120
|
-
color: var(--warning-color-hover) !important;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&:active,
|
|
124
|
-
&:focus {
|
|
125
|
-
color: var(--warning-color-active) !important;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// btn
|
|
130
|
-
.@{ant-prefix}-btn {
|
|
131
|
-
&:hover,
|
|
132
|
-
&:focus {
|
|
133
|
-
color: var(--primary-color-hover) !important;
|
|
134
|
-
border-color: var(--primary-color-hover) !important;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
&:active {
|
|
138
|
-
color: var(--primary-color-active) !important;
|
|
139
|
-
border-color: var(--primary-color-active) !important;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
&[disabled] {
|
|
143
|
-
&,
|
|
144
|
-
&:active,
|
|
145
|
-
&:focus,
|
|
146
|
-
&:hover {
|
|
147
|
-
color: var(--disabled-color) !important;
|
|
148
|
-
border-color: @border-color-base !important;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&-primary {
|
|
153
|
-
color: #fff !important;
|
|
154
|
-
background: @btn-primary-bg !important;
|
|
155
|
-
border-color: @btn-primary-bg !important;
|
|
156
|
-
|
|
157
|
-
&:hover,
|
|
158
|
-
&:focus {
|
|
159
|
-
color: #fff !important;
|
|
160
|
-
background: var(--primary-color-hover) !important;
|
|
161
|
-
border-color: var(--primary-color-hover) !important;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
&:active {
|
|
165
|
-
color: #fff !important;
|
|
166
|
-
background: var(--primary-color-active) !important;
|
|
167
|
-
border-color: var(--primary-color-active) !important;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
&[disabled] {
|
|
171
|
-
&,
|
|
172
|
-
&:active,
|
|
173
|
-
&:focus,
|
|
174
|
-
&:hover {
|
|
175
|
-
color: var(--disabled-color) !important;
|
|
176
|
-
background: @disabled-bg !important;
|
|
177
|
-
border-color: @border-color-base !important;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
&-link {
|
|
183
|
-
border-color: transparent !important;
|
|
184
|
-
|
|
185
|
-
&:hover,
|
|
186
|
-
&:focus {
|
|
187
|
-
border-color: transparent !important;
|
|
188
|
-
color: var(--primary-color-hover) !important;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
&:active {
|
|
192
|
-
border-color: transparent !important;
|
|
193
|
-
color: var(--primary-color-active) !important;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
&-dangerous {
|
|
198
|
-
background: #fff;
|
|
199
|
-
border-color: var(--error-color);
|
|
200
|
-
color: var(--error-color);
|
|
201
|
-
|
|
202
|
-
&:hover,
|
|
203
|
-
&:focus {
|
|
204
|
-
color: var(--error-color-hover) !important;
|
|
205
|
-
border-color: var(--error-color-hover) !important;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
&:active {
|
|
209
|
-
color: var(--error-color-active) !important;
|
|
210
|
-
border-color: var(--error-color-active) !important;
|
|
211
|
-
}
|
|
212
|
-
&.@{ant-prefix}-btn-primary {
|
|
213
|
-
color: #fff;
|
|
214
|
-
background: var(--error-color) !important;
|
|
215
|
-
border-color: var(--error-color) !important;
|
|
216
|
-
|
|
217
|
-
&:hover,
|
|
218
|
-
&:focus {
|
|
219
|
-
color: #fff !important;
|
|
220
|
-
background: var(--error-color-hover) !important;
|
|
221
|
-
border-color: var(--error-color-hover) !important;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
&:active {
|
|
225
|
-
color: #fff !important;
|
|
226
|
-
background: var(--error-color-active) !important;
|
|
227
|
-
border-color: var(--error-color-active) !important;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
.bezierEasingMixin() {
|
|
2
|
-
@functions: ~`(function() {
|
|
3
|
-
var NEWTON_ITERATIONS = 4;
|
|
4
|
-
var NEWTON_MIN_SLOPE = 0.001;
|
|
5
|
-
var SUBDIVISION_PRECISION = 0.0000001;
|
|
6
|
-
var SUBDIVISION_MAX_ITERATIONS = 10;
|
|
7
|
-
|
|
8
|
-
var kSplineTableSize = 11;
|
|
9
|
-
var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
|
|
10
|
-
|
|
11
|
-
var float32ArraySupported = typeof Float32Array === 'function';
|
|
12
|
-
|
|
13
|
-
function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; }
|
|
14
|
-
function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; }
|
|
15
|
-
function C (aA1) { return 3.0 * aA1; }
|
|
16
|
-
|
|
17
|
-
// Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2.
|
|
18
|
-
function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; }
|
|
19
|
-
|
|
20
|
-
// Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2.
|
|
21
|
-
function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); }
|
|
22
|
-
|
|
23
|
-
function binarySubdivide (aX, aA, aB, mX1, mX2) {
|
|
24
|
-
var currentX, currentT, i = 0;
|
|
25
|
-
do {
|
|
26
|
-
currentT = aA + (aB - aA) / 2.0;
|
|
27
|
-
currentX = calcBezier(currentT, mX1, mX2) - aX;
|
|
28
|
-
if (currentX > 0.0) {
|
|
29
|
-
aB = currentT;
|
|
30
|
-
} else {
|
|
31
|
-
aA = currentT;
|
|
32
|
-
}
|
|
33
|
-
} while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
|
|
34
|
-
return currentT;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) {
|
|
38
|
-
for (var i = 0; i < NEWTON_ITERATIONS; ++i) {
|
|
39
|
-
var currentSlope = getSlope(aGuessT, mX1, mX2);
|
|
40
|
-
if (currentSlope === 0.0) {
|
|
41
|
-
return aGuessT;
|
|
42
|
-
}
|
|
43
|
-
var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
|
|
44
|
-
aGuessT -= currentX / currentSlope;
|
|
45
|
-
}
|
|
46
|
-
return aGuessT;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var BezierEasing = function (mX1, mY1, mX2, mY2) {
|
|
50
|
-
if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) {
|
|
51
|
-
throw new Error('bezier x values must be in [0, 1] range');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Precompute samples table
|
|
55
|
-
var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
|
|
56
|
-
if (mX1 !== mY1 || mX2 !== mY2) {
|
|
57
|
-
for (var i = 0; i < kSplineTableSize; ++i) {
|
|
58
|
-
sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function getTForX (aX) {
|
|
63
|
-
var intervalStart = 0.0;
|
|
64
|
-
var currentSample = 1;
|
|
65
|
-
var lastSample = kSplineTableSize - 1;
|
|
66
|
-
|
|
67
|
-
for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
|
|
68
|
-
intervalStart += kSampleStepSize;
|
|
69
|
-
}
|
|
70
|
-
--currentSample;
|
|
71
|
-
|
|
72
|
-
// Interpolate to provide an initial guess for t
|
|
73
|
-
var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
|
|
74
|
-
var guessForT = intervalStart + dist * kSampleStepSize;
|
|
75
|
-
|
|
76
|
-
var initialSlope = getSlope(guessForT, mX1, mX2);
|
|
77
|
-
if (initialSlope >= NEWTON_MIN_SLOPE) {
|
|
78
|
-
return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
|
|
79
|
-
} else if (initialSlope === 0.0) {
|
|
80
|
-
return guessForT;
|
|
81
|
-
} else {
|
|
82
|
-
return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return function BezierEasing (x) {
|
|
87
|
-
if (mX1 === mY1 && mX2 === mY2) {
|
|
88
|
-
return x; // linear
|
|
89
|
-
}
|
|
90
|
-
// Because JavaScript number are imprecise, we should guarantee the extremes are right.
|
|
91
|
-
if (x === 0) {
|
|
92
|
-
return 0;
|
|
93
|
-
}
|
|
94
|
-
if (x === 1) {
|
|
95
|
-
return 1;
|
|
96
|
-
}
|
|
97
|
-
return calcBezier(getTForX(x), mY1, mY2);
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18);
|
|
102
|
-
return '';
|
|
103
|
-
})()`;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.bezierEasingMixin();
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
@import "./bezierEasing.less";
|
|
2
|
-
@import "./tinyColor.less";
|
|
3
|
-
|
|
4
|
-
.colorPaletteMixin() {
|
|
5
|
-
@functions: ~`(function() {
|
|
6
|
-
var hueStep = 2;
|
|
7
|
-
var saturationStep = 0.16;
|
|
8
|
-
var saturationStep2 = 0.05;
|
|
9
|
-
var brightnessStep1 = 0.05;
|
|
10
|
-
var brightnessStep2 = 0.15;
|
|
11
|
-
var lightColorCount = 5;
|
|
12
|
-
var darkColorCount = 4;
|
|
13
|
-
|
|
14
|
-
var getHue = function(hsv, i, isLight) {
|
|
15
|
-
var hue;
|
|
16
|
-
if (hsv.h >= 60 && hsv.h <= 240) {
|
|
17
|
-
hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i;
|
|
18
|
-
} else {
|
|
19
|
-
hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i;
|
|
20
|
-
}
|
|
21
|
-
if (hue < 0) {
|
|
22
|
-
hue += 360;
|
|
23
|
-
} else if (hue >= 360) {
|
|
24
|
-
hue -= 360;
|
|
25
|
-
}
|
|
26
|
-
return Math.round(hue);
|
|
27
|
-
};
|
|
28
|
-
var getSaturation = function(hsv, i, isLight) {
|
|
29
|
-
var saturation;
|
|
30
|
-
if (isLight) {
|
|
31
|
-
saturation = hsv.s - saturationStep * i;
|
|
32
|
-
} else if (i === darkColorCount) {
|
|
33
|
-
saturation = hsv.s + saturationStep;
|
|
34
|
-
} else {
|
|
35
|
-
saturation = hsv.s + saturationStep2 * i;
|
|
36
|
-
}
|
|
37
|
-
if (saturation > 1) {
|
|
38
|
-
saturation = 1;
|
|
39
|
-
}
|
|
40
|
-
if (isLight && i === lightColorCount && saturation > 0.1) {
|
|
41
|
-
saturation = 0.1;
|
|
42
|
-
}
|
|
43
|
-
if (saturation < 0.06) {
|
|
44
|
-
saturation = 0.06;
|
|
45
|
-
}
|
|
46
|
-
return Number(saturation.toFixed(2));
|
|
47
|
-
};
|
|
48
|
-
var getValue = function(hsv, i, isLight) {
|
|
49
|
-
var value;
|
|
50
|
-
if (isLight) {
|
|
51
|
-
value = hsv.v + brightnessStep1 * i;
|
|
52
|
-
}else{
|
|
53
|
-
value = hsv.v - brightnessStep2 * i
|
|
54
|
-
}
|
|
55
|
-
if (value > 1) {
|
|
56
|
-
value = 1;
|
|
57
|
-
}
|
|
58
|
-
return Number(value.toFixed(2))
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
this.colorpalette = function(color, index) {
|
|
62
|
-
var isLight = index <= 6;
|
|
63
|
-
var hsv = tinycolor(color).toHsv();
|
|
64
|
-
var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1;
|
|
65
|
-
return tinycolor({
|
|
66
|
-
h: getHue(hsv, i, isLight),
|
|
67
|
-
s: getSaturation(hsv, i, isLight),
|
|
68
|
-
v: getValue(hsv, i, isLight),
|
|
69
|
-
}).toHexString();
|
|
70
|
-
};
|
|
71
|
-
})()`;
|
|
72
|
-
}
|
|
73
|
-
.colorPaletteMixin();
|