@knockout-js/layout 0.1.1-beta.2 → 0.1.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/es2017/components/icons/index.d.ts +2 -0
- package/es2017/components/icons/index.js +20 -0
- package/es2017/components/icons/index.js.map +1 -1
- package/es2017/components/theme-switch/index.d.ts +0 -5
- package/es2017/components/theme-switch/index.js +15 -13
- package/es2017/components/theme-switch/index.js.map +1 -1
- package/esm/components/icons/index.d.ts +2 -0
- package/esm/components/icons/index.js +24 -0
- package/esm/components/icons/index.js.map +1 -1
- package/esm/components/theme-switch/index.d.ts +0 -5
- package/esm/components/theme-switch/index.js +15 -13
- package/esm/components/theme-switch/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { SVGProps } from "react";
|
|
2
2
|
export declare const OpenWin: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
3
|
+
export declare const Sun: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
4
|
+
export declare const Moon: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
@@ -15,5 +15,25 @@ export const OpenWin = (props)=>{
|
|
|
15
15
|
})
|
|
16
16
|
}));
|
|
17
17
|
};
|
|
18
|
+
export const Sun = (props)=>/*#__PURE__*/ _jsx("svg", _object_spread_props(_object_spread({
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
width: "24",
|
|
22
|
+
height: "24"
|
|
23
|
+
}, props), {
|
|
24
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
25
|
+
d: "M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"
|
|
26
|
+
})
|
|
27
|
+
}));
|
|
28
|
+
export const Moon = (props)=>/*#__PURE__*/ _jsx("svg", _object_spread_props(_object_spread({
|
|
29
|
+
viewBox: "0 0 24 24",
|
|
30
|
+
width: "28",
|
|
31
|
+
height: "28",
|
|
32
|
+
fill: "currentColor"
|
|
33
|
+
}, props), {
|
|
34
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
35
|
+
d: "M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"
|
|
36
|
+
})
|
|
37
|
+
}));
|
|
18
38
|
|
|
19
39
|
//# sourceMappingURL=D:\codeing\git\github\knockout-js\packages\layout\es2017\components\icons\index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\icons\\index.tsx"],"sourcesContent":["import { SVGProps } from \"react\"\r\n\r\nexport const OpenWin = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => {\r\n return <svg\r\n fill=\"currentColor\"\r\n viewBox=\"0 0 1024 1024\"\r\n p-id=\"19410\"\r\n width=\"12\"\r\n height=\"12\"\r\n {...props}\r\n >\r\n <path d=\"M398.506667 960H160q-39.765333 0-67.882667-28.117333-28.117333-28.117333-28.117333-67.882667V160q0-39.765333 28.117333-67.882667Q120.234667 64 160 64h704q39.765333 0 67.882667 28.117333 28.117333 28.117333 28.117333 67.882667v149.333333a32 32 0 0 1-32 32H128v522.666667q0 13.226667 9.386667 22.613333 9.386667 9.386667 22.613333 9.386667h238.506667a32 32 0 0 1 0 64zM128 160V277.333333h768V160q0-13.226667-9.386667-22.613333-9.386667-9.386667-22.613333-9.386667H160q-13.226667 0-22.613333 9.386667-9.386667 9.386667-9.386667 22.613333z m800.512 341.333333H672a32 32 0 0 0 0 64h178.773333l-340.053333 340.053334a32 32 0 0 0 45.226667 45.226666L896 610.602667v178.773333a32 32 0 0 0 64 0v-255.573333a31.914667 31.914667 0 0 0-31.488-32.426667z\" p-id=\"19411\"></path>\r\n </svg>\r\n}\r\n"],"names":["OpenWin","props","svg","fill","viewBox","p-id","width","height","path","d"],"mappings":";;;AAEA,OAAO,MAAMA,UAAU,CAACC,QAA6D;IACnF,qBAAO,KAACC;QACNC,MAAK;QACLC,SAAQ;QACRC,QAAK;QACLC,OAAM;QACNC,QAAO;OACHN;kBAEJ,cAAA,KAACO;YAAKC,GAAE;YAAwuBJ,QAAK;;;AAEzvB,EAAC"}
|
|
1
|
+
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\icons\\index.tsx"],"sourcesContent":["import { SVGProps } from \"react\"\r\n\r\nexport const OpenWin = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => {\r\n return <svg\r\n fill=\"currentColor\"\r\n viewBox=\"0 0 1024 1024\"\r\n p-id=\"19410\"\r\n width=\"12\"\r\n height=\"12\"\r\n {...props}\r\n >\r\n <path d=\"M398.506667 960H160q-39.765333 0-67.882667-28.117333-28.117333-28.117333-28.117333-67.882667V160q0-39.765333 28.117333-67.882667Q120.234667 64 160 64h704q39.765333 0 67.882667 28.117333 28.117333 28.117333 28.117333 67.882667v149.333333a32 32 0 0 1-32 32H128v522.666667q0 13.226667 9.386667 22.613333 9.386667 9.386667 22.613333 9.386667h238.506667a32 32 0 0 1 0 64zM128 160V277.333333h768V160q0-13.226667-9.386667-22.613333-9.386667-9.386667-22.613333-9.386667H160q-13.226667 0-22.613333 9.386667-9.386667 9.386667-9.386667 22.613333z m800.512 341.333333H672a32 32 0 0 0 0 64h178.773333l-340.053333 340.053334a32 32 0 0 0 45.226667 45.226666L896 610.602667v178.773333a32 32 0 0 0 64 0v-255.573333a31.914667 31.914667 0 0 0-31.488-32.426667z\" p-id=\"19411\"></path>\r\n </svg>\r\n}\r\n\r\nexport const Sun = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => <svg fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" {...props}>\r\n <path d=\"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z\"></path>\r\n</svg>\r\n\r\nexport const Moon = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => <svg viewBox=\"0 0 24 24\" width=\"28\" height=\"28\" fill=\"currentColor\" {...props}>\r\n <path d=\"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z\"></path>\r\n</svg>\r\n"],"names":["OpenWin","props","svg","fill","viewBox","p-id","width","height","path","d","Sun","Moon"],"mappings":";;;AAEA,OAAO,MAAMA,UAAU,CAACC,QAA6D;IACnF,qBAAO,KAACC;QACNC,MAAK;QACLC,SAAQ;QACRC,QAAK;QACLC,OAAM;QACNC,QAAO;OACHN;kBAEJ,cAAA,KAACO;YAAKC,GAAE;YAAwuBJ,QAAK;;;AAEzvB,EAAC;AAED,OAAO,MAAMK,MAAM,CAACT,sBAA6D,KAACC;QAAIC,MAAK;QAAeC,SAAQ;QAAYE,OAAM;QAAKC,QAAO;OAAUN;kBACxJ,cAAA,KAACO;YAAKC,GAAE;;QACJ;AAEN,OAAO,MAAME,OAAO,CAACV,sBAA6D,KAACC;QAAIE,SAAQ;QAAYE,OAAM;QAAKC,QAAO;QAAKJ,MAAK;OAAmBF;kBACxJ,cAAA,KAACO;YAAKC,GAAE;;QACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SwitchProps } from 'antd';
|
|
3
2
|
export interface ThemeSwitchLocale {
|
|
4
3
|
bright: string;
|
|
5
4
|
dark: string;
|
|
@@ -9,10 +8,6 @@ export interface ThemeSwitchProps {
|
|
|
9
8
|
* 值
|
|
10
9
|
*/
|
|
11
10
|
value: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* switch的设置
|
|
14
|
-
*/
|
|
15
|
-
switchProps?: SwitchProps;
|
|
16
11
|
/**
|
|
17
12
|
* 值变更事件 (value: boolean) => void;
|
|
18
13
|
*/
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
-
import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
|
|
3
1
|
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
2
|
import React from "react";
|
|
5
|
-
import {
|
|
6
|
-
import { useLocale } from "../locale/index";
|
|
3
|
+
import { Moon, Sun } from "../icons/index";
|
|
7
4
|
const ThemeSwitch = (props)=>{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onChange: (checked)=>{
|
|
15
|
-
props.onChange(checked);
|
|
5
|
+
return props.value ? /*#__PURE__*/ _jsx(Sun, {
|
|
6
|
+
style: {
|
|
7
|
+
color: 'rgba(0, 0, 0, 0.88)'
|
|
8
|
+
},
|
|
9
|
+
onClick: ()=>{
|
|
10
|
+
props.onChange(false);
|
|
16
11
|
}
|
|
17
|
-
})
|
|
12
|
+
}) : /*#__PURE__*/ _jsx(Moon, {
|
|
13
|
+
style: {
|
|
14
|
+
color: 'rgba(0, 0, 0, 0.88)'
|
|
15
|
+
},
|
|
16
|
+
onClick: ()=>{
|
|
17
|
+
props.onChange(true);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
18
20
|
};
|
|
19
21
|
export default ThemeSwitch;
|
|
20
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\theme-switch\\index.tsx"],"sourcesContent":["import React from 'react';\r\nimport {
|
|
1
|
+
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\theme-switch\\index.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Moon, Sun } from '../icons';\r\n\r\nexport interface ThemeSwitchLocale {\r\n bright: string;\r\n dark: string;\r\n}\r\n\r\nexport interface ThemeSwitchProps {\r\n /**\r\n * 值\r\n */\r\n value: boolean;\r\n /**\r\n * 值变更事件 (value: boolean) => void;\r\n */\r\n onChange: (value: boolean) => void;\r\n}\r\n\r\nconst ThemeSwitch: React.FC<ThemeSwitchProps> = (props: ThemeSwitchProps) => {\r\n return props.value ? <Sun style={{ color: 'rgba(0, 0, 0, 0.88)' }} onClick={() => {\r\n props.onChange(false)\r\n\r\n }} /> : <Moon style={{ color: 'rgba(0, 0, 0, 0.88)' }} onClick={() => {\r\n props.onChange(true)\r\n\r\n }} />\r\n};\r\n\r\nexport default ThemeSwitch;\r\n"],"names":["React","Moon","Sun","ThemeSwitch","props","value","style","color","onClick","onChange"],"mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,IAAI,EAAEC,GAAG,QAAQ,iBAAW;AAkBrC,MAAMC,cAA0C,CAACC,QAA4B;IAC3E,OAAOA,MAAMC,KAAK,iBAAG,KAACH;QAAII,OAAO;YAAEC,OAAO;QAAsB;QAAGC,SAAS,IAAM;YAChFJ,MAAMK,QAAQ,CAAC,KAAK;QAEtB;uBAAQ,KAACR;QAAKK,OAAO;YAAEC,OAAO;QAAsB;QAAGC,SAAS,IAAM;YACpEJ,MAAMK,QAAQ,CAAC,IAAI;QAErB;MAAK;AACP;AAEA,eAAeN,YAAY"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { SVGProps } from "react";
|
|
2
2
|
export declare const OpenWin: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
3
|
+
export declare const Sun: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
4
|
+
export declare const Moon: (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => JSX.Element;
|
|
@@ -15,5 +15,29 @@ export var OpenWin = function(props) {
|
|
|
15
15
|
})
|
|
16
16
|
}));
|
|
17
17
|
};
|
|
18
|
+
export var Sun = function(props) {
|
|
19
|
+
return /*#__PURE__*/ _jsx("svg", _object_spread_props(_object_spread({
|
|
20
|
+
fill: "currentColor",
|
|
21
|
+
viewBox: "0 0 24 24",
|
|
22
|
+
width: "24",
|
|
23
|
+
height: "24"
|
|
24
|
+
}, props), {
|
|
25
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
26
|
+
d: "M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"
|
|
27
|
+
})
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
export var Moon = function(props) {
|
|
31
|
+
return /*#__PURE__*/ _jsx("svg", _object_spread_props(_object_spread({
|
|
32
|
+
viewBox: "0 0 24 24",
|
|
33
|
+
width: "28",
|
|
34
|
+
height: "28",
|
|
35
|
+
fill: "currentColor"
|
|
36
|
+
}, props), {
|
|
37
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
38
|
+
d: "M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"
|
|
39
|
+
})
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
18
42
|
|
|
19
43
|
//# sourceMappingURL=D:\codeing\git\github\knockout-js\packages\layout\esm\components\icons\index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\icons\\index.tsx"],"sourcesContent":["import { SVGProps } from \"react\"\r\n\r\nexport const OpenWin = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => {\r\n return <svg\r\n fill=\"currentColor\"\r\n viewBox=\"0 0 1024 1024\"\r\n p-id=\"19410\"\r\n width=\"12\"\r\n height=\"12\"\r\n {...props}\r\n >\r\n <path d=\"M398.506667 960H160q-39.765333 0-67.882667-28.117333-28.117333-28.117333-28.117333-67.882667V160q0-39.765333 28.117333-67.882667Q120.234667 64 160 64h704q39.765333 0 67.882667 28.117333 28.117333 28.117333 28.117333 67.882667v149.333333a32 32 0 0 1-32 32H128v522.666667q0 13.226667 9.386667 22.613333 9.386667 9.386667 22.613333 9.386667h238.506667a32 32 0 0 1 0 64zM128 160V277.333333h768V160q0-13.226667-9.386667-22.613333-9.386667-9.386667-22.613333-9.386667H160q-13.226667 0-22.613333 9.386667-9.386667 9.386667-9.386667 22.613333z m800.512 341.333333H672a32 32 0 0 0 0 64h178.773333l-340.053333 340.053334a32 32 0 0 0 45.226667 45.226666L896 610.602667v178.773333a32 32 0 0 0 64 0v-255.573333a31.914667 31.914667 0 0 0-31.488-32.426667z\" p-id=\"19411\"></path>\r\n </svg>\r\n}\r\n"],"names":["OpenWin","props","svg","fill","viewBox","p-id","width","height","path","d"],"mappings":";;;AAEA,OAAO,IAAMA,UAAU,SAACC,OAA6D;IACnF,qBAAO,KAACC;QACNC,MAAK;QACLC,SAAQ;QACRC,QAAK;QACLC,OAAM;QACNC,QAAO;OACHN;kBAEJ,cAAA,KAACO;YAAKC,GAAE;YAAwuBJ,QAAK;;;AAEzvB,EAAC"}
|
|
1
|
+
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\icons\\index.tsx"],"sourcesContent":["import { SVGProps } from \"react\"\r\n\r\nexport const OpenWin = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => {\r\n return <svg\r\n fill=\"currentColor\"\r\n viewBox=\"0 0 1024 1024\"\r\n p-id=\"19410\"\r\n width=\"12\"\r\n height=\"12\"\r\n {...props}\r\n >\r\n <path d=\"M398.506667 960H160q-39.765333 0-67.882667-28.117333-28.117333-28.117333-28.117333-67.882667V160q0-39.765333 28.117333-67.882667Q120.234667 64 160 64h704q39.765333 0 67.882667 28.117333 28.117333 28.117333 28.117333 67.882667v149.333333a32 32 0 0 1-32 32H128v522.666667q0 13.226667 9.386667 22.613333 9.386667 9.386667 22.613333 9.386667h238.506667a32 32 0 0 1 0 64zM128 160V277.333333h768V160q0-13.226667-9.386667-22.613333-9.386667-9.386667-22.613333-9.386667H160q-13.226667 0-22.613333 9.386667-9.386667 9.386667-9.386667 22.613333z m800.512 341.333333H672a32 32 0 0 0 0 64h178.773333l-340.053333 340.053334a32 32 0 0 0 45.226667 45.226666L896 610.602667v178.773333a32 32 0 0 0 64 0v-255.573333a31.914667 31.914667 0 0 0-31.488-32.426667z\" p-id=\"19411\"></path>\r\n </svg>\r\n}\r\n\r\nexport const Sun = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => <svg fill=\"currentColor\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" {...props}>\r\n <path d=\"M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z\"></path>\r\n</svg>\r\n\r\nexport const Moon = (props: JSX.IntrinsicAttributes & SVGProps<SVGSVGElement>) => <svg viewBox=\"0 0 24 24\" width=\"28\" height=\"28\" fill=\"currentColor\" {...props}>\r\n <path d=\"M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z\"></path>\r\n</svg>\r\n"],"names":["OpenWin","props","svg","fill","viewBox","p-id","width","height","path","d","Sun","Moon"],"mappings":";;;AAEA,OAAO,IAAMA,UAAU,SAACC,OAA6D;IACnF,qBAAO,KAACC;QACNC,MAAK;QACLC,SAAQ;QACRC,QAAK;QACLC,OAAM;QACNC,QAAO;OACHN;kBAEJ,cAAA,KAACO;YAAKC,GAAE;YAAwuBJ,QAAK;;;AAEzvB,EAAC;AAED,OAAO,IAAMK,MAAM,SAACT;yBAA6D,KAACC;QAAIC,MAAK;QAAeC,SAAQ;QAAYE,OAAM;QAAKC,QAAO;OAAUN;kBACxJ,cAAA,KAACO;YAAKC,GAAE;;;EACJ;AAEN,OAAO,IAAME,OAAO,SAACV;yBAA6D,KAACC;QAAIE,SAAQ;QAAYE,OAAM;QAAKC,QAAO;QAAKJ,MAAK;OAAmBF;kBACxJ,cAAA,KAACO;YAAKC,GAAE;;;EACJ"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SwitchProps } from 'antd';
|
|
3
2
|
export interface ThemeSwitchLocale {
|
|
4
3
|
bright: string;
|
|
5
4
|
dark: string;
|
|
@@ -9,10 +8,6 @@ export interface ThemeSwitchProps {
|
|
|
9
8
|
* 值
|
|
10
9
|
*/
|
|
11
10
|
value: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* switch的设置
|
|
14
|
-
*/
|
|
15
|
-
switchProps?: SwitchProps;
|
|
16
11
|
/**
|
|
17
12
|
* 值变更事件 (value: boolean) => void;
|
|
18
13
|
*/
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import _object_spread from "@swc/helpers/src/_object_spread.mjs";
|
|
2
|
-
import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
|
|
3
1
|
import { jsx as _jsx } from "@ice/jsx-runtime/jsx-runtime";
|
|
4
2
|
import React from "react";
|
|
5
|
-
import {
|
|
6
|
-
import { useLocale } from "../locale/index";
|
|
3
|
+
import { Moon, Sun } from "../icons/index";
|
|
7
4
|
var ThemeSwitch = function(props) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onChange: function(checked) {
|
|
15
|
-
props.onChange(checked);
|
|
5
|
+
return props.value ? /*#__PURE__*/ _jsx(Sun, {
|
|
6
|
+
style: {
|
|
7
|
+
color: "rgba(0, 0, 0, 0.88)"
|
|
8
|
+
},
|
|
9
|
+
onClick: function() {
|
|
10
|
+
props.onChange(false);
|
|
16
11
|
}
|
|
17
|
-
})
|
|
12
|
+
}) : /*#__PURE__*/ _jsx(Moon, {
|
|
13
|
+
style: {
|
|
14
|
+
color: "rgba(0, 0, 0, 0.88)"
|
|
15
|
+
},
|
|
16
|
+
onClick: function() {
|
|
17
|
+
props.onChange(true);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
18
20
|
};
|
|
19
21
|
export default ThemeSwitch;
|
|
20
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\theme-switch\\index.tsx"],"sourcesContent":["import React from 'react';\r\nimport {
|
|
1
|
+
{"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\theme-switch\\index.tsx"],"sourcesContent":["import React from 'react';\r\nimport { Moon, Sun } from '../icons';\r\n\r\nexport interface ThemeSwitchLocale {\r\n bright: string;\r\n dark: string;\r\n}\r\n\r\nexport interface ThemeSwitchProps {\r\n /**\r\n * 值\r\n */\r\n value: boolean;\r\n /**\r\n * 值变更事件 (value: boolean) => void;\r\n */\r\n onChange: (value: boolean) => void;\r\n}\r\n\r\nconst ThemeSwitch: React.FC<ThemeSwitchProps> = (props: ThemeSwitchProps) => {\r\n return props.value ? <Sun style={{ color: 'rgba(0, 0, 0, 0.88)' }} onClick={() => {\r\n props.onChange(false)\r\n\r\n }} /> : <Moon style={{ color: 'rgba(0, 0, 0, 0.88)' }} onClick={() => {\r\n props.onChange(true)\r\n\r\n }} />\r\n};\r\n\r\nexport default ThemeSwitch;\r\n"],"names":["React","Moon","Sun","ThemeSwitch","props","value","style","color","onClick","onChange"],"mappings":";AAAA,OAAOA,WAAW,QAAQ;AAC1B,SAASC,IAAI,EAAEC,GAAG,QAAQ,iBAAW;AAkBrC,IAAMC,cAA0C,SAACC,OAA4B;IAC3E,OAAOA,MAAMC,KAAK,iBAAG,KAACH;QAAII,OAAO;YAAEC,OAAO;QAAsB;QAAGC,SAAS,WAAM;YAChFJ,MAAMK,QAAQ,CAAC,KAAK;QAEtB;uBAAQ,KAACR;QAAKK,OAAO;YAAEC,OAAO;QAAsB;QAAGC,SAAS,WAAM;YACpEJ,MAAMK,QAAQ,CAAC,IAAI;QAErB;MAAK;AACP;AAEA,eAAeN,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knockout-js/layout",
|
|
3
|
-
"version": "0.1.1
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "组件功能描述",
|
|
5
5
|
"files": [
|
|
6
6
|
"esm",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"dayjs": "^1.11.9",
|
|
51
51
|
"react-activation": "^0.12.4",
|
|
52
52
|
"react-draggable": "^4.4.5",
|
|
53
|
-
"@knockout-js/api": "^0.1.1
|
|
54
|
-
"@knockout-js/ice-urql": "^0.1.1
|
|
53
|
+
"@knockout-js/api": "^0.1.1",
|
|
54
|
+
"@knockout-js/ice-urql": "^0.1.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@ice/pkg": "^1.5.0",
|