solely 0.2.9 → 0.4.0
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/README.md +109 -40
- package/dist/compiler/ir/buildIR.cjs +1 -1
- package/dist/compiler/ir/buildIR.js +1 -1
- package/dist/compiler/parser/parser.cjs +1 -1
- package/dist/compiler/parser/parser.js +1 -1
- package/dist/components/commands/drawer/index.cjs +1 -0
- package/dist/components/commands/drawer/index.d.ts +10 -0
- package/dist/components/commands/drawer/index.js +1 -0
- package/dist/components/commands/drawer/style.css.cjs +1 -0
- package/dist/components/commands/drawer/style.css.js +1 -0
- package/dist/components/commands/drawer/types.d.ts +48 -0
- package/dist/components/commands/index.cjs +1 -0
- package/dist/components/commands/index.d.ts +15 -0
- package/dist/components/commands/index.js +1 -0
- package/dist/components/commands/message/index.cjs +1 -0
- package/dist/components/commands/message/index.d.ts +20 -0
- package/dist/components/commands/message/index.js +1 -0
- package/dist/components/commands/message/style.css.cjs +1 -0
- package/dist/components/commands/message/style.css.js +1 -0
- package/dist/components/commands/message/types.d.ts +39 -0
- package/dist/components/commands/modal/index.cjs +1 -0
- package/dist/components/commands/modal/index.d.ts +20 -0
- package/dist/components/commands/modal/index.js +1 -0
- package/dist/components/commands/modal/style.css.cjs +1 -0
- package/dist/components/commands/modal/style.css.js +1 -0
- package/dist/components/commands/modal/types.d.ts +68 -0
- package/dist/components/commands/popconfirm/index.cjs +1 -0
- package/dist/components/commands/popconfirm/index.d.ts +14 -0
- package/dist/components/commands/popconfirm/index.js +1 -0
- package/dist/components/commands/popconfirm/style.css.cjs +1 -0
- package/dist/components/commands/popconfirm/style.css.js +1 -0
- package/dist/components/commands/popconfirm/types.d.ts +44 -0
- package/dist/components/commands/tooltip/index.cjs +1 -0
- package/dist/components/commands/tooltip/index.d.ts +14 -0
- package/dist/components/commands/tooltip/index.js +1 -0
- package/dist/components/commands/tooltip/style.css.cjs +1 -0
- package/dist/components/commands/tooltip/style.css.js +1 -0
- package/dist/components/commands/tooltip/types.d.ts +43 -0
- package/dist/components/commands/utils.cjs +1 -0
- package/dist/components/commands/utils.d.ts +40 -0
- package/dist/components/commands/utils.js +1 -0
- package/dist/components/elements/alert/index.cjs +1 -0
- package/dist/components/elements/alert/index.d.ts +28 -0
- package/dist/components/elements/alert/index.html.cjs +1 -0
- package/dist/components/elements/alert/index.html.js +1 -0
- package/dist/components/elements/alert/index.js +1 -0
- package/dist/components/elements/alert/style.css.cjs +1 -0
- package/dist/components/elements/alert/style.css.js +1 -0
- package/dist/components/elements/alert/types.d.ts +18 -0
- package/dist/components/elements/backtop/index.cjs +1 -0
- package/dist/components/elements/backtop/index.d.ts +33 -0
- package/dist/components/elements/backtop/index.html.cjs +1 -0
- package/dist/components/elements/backtop/index.html.js +1 -0
- package/dist/components/elements/backtop/index.js +1 -0
- package/dist/components/elements/backtop/style.css.cjs +1 -0
- package/dist/components/elements/backtop/style.css.js +1 -0
- package/dist/components/elements/backtop/types.d.ts +9 -0
- package/dist/components/elements/badge/index.cjs +1 -0
- package/dist/components/elements/badge/index.d.ts +34 -0
- package/dist/components/elements/badge/index.html.cjs +1 -0
- package/dist/components/elements/badge/index.html.js +1 -0
- package/dist/components/elements/badge/index.js +1 -0
- package/dist/components/elements/badge/style.css.cjs +1 -0
- package/dist/components/elements/badge/style.css.js +1 -0
- package/dist/components/elements/badge/types.d.ts +22 -0
- package/dist/components/elements/breadcrumb/index.cjs +1 -0
- package/dist/components/elements/breadcrumb/index.d.ts +14 -0
- package/dist/components/elements/breadcrumb/index.html.cjs +1 -0
- package/dist/components/elements/breadcrumb/index.html.js +1 -0
- package/dist/components/elements/breadcrumb/index.js +1 -0
- package/dist/components/elements/breadcrumb/style.css.cjs +1 -0
- package/dist/components/elements/breadcrumb/style.css.js +1 -0
- package/dist/components/elements/breadcrumb/types.d.ts +15 -0
- package/dist/components/elements/button/index.cjs +1 -0
- package/dist/components/elements/button/index.d.ts +56 -0
- package/dist/components/elements/button/index.html.cjs +1 -0
- package/dist/components/elements/button/index.html.js +1 -0
- package/dist/components/elements/button/index.js +1 -0
- package/dist/components/elements/button/style.css.cjs +1 -0
- package/dist/components/elements/button/style.css.js +1 -0
- package/dist/components/elements/button/types.d.ts +42 -0
- package/dist/components/elements/card/index.cjs +1 -0
- package/dist/components/elements/card/index.d.ts +26 -0
- package/dist/components/elements/card/index.html.cjs +1 -0
- package/dist/components/elements/card/index.html.js +1 -0
- package/dist/components/elements/card/index.js +1 -0
- package/dist/components/elements/card/style.css.cjs +1 -0
- package/dist/components/elements/card/style.css.js +1 -0
- package/dist/components/elements/card/types.d.ts +28 -0
- package/dist/components/elements/checkbox/index.cjs +1 -0
- package/dist/components/elements/checkbox/index.d.ts +62 -0
- package/dist/components/elements/checkbox/index.html.cjs +1 -0
- package/dist/components/elements/checkbox/index.html.js +1 -0
- package/dist/components/elements/checkbox/index.js +1 -0
- package/dist/components/elements/checkbox/style.css.cjs +1 -0
- package/dist/components/elements/checkbox/style.css.js +1 -0
- package/dist/components/elements/checkbox/types.d.ts +30 -0
- package/dist/components/elements/coordinate-input/index.cjs +1 -0
- package/dist/components/elements/coordinate-input/index.d.ts +155 -0
- package/dist/components/elements/coordinate-input/index.html.cjs +1 -0
- package/dist/components/elements/coordinate-input/index.html.js +1 -0
- package/dist/components/elements/coordinate-input/index.js +1 -0
- package/dist/components/elements/coordinate-input/style.css.cjs +1 -0
- package/dist/components/elements/coordinate-input/style.css.js +1 -0
- package/dist/components/elements/coordinate-input/types.d.ts +112 -0
- package/dist/components/elements/divider/index.cjs +1 -0
- package/dist/components/elements/divider/index.d.ts +13 -0
- package/dist/components/elements/divider/index.html.cjs +1 -0
- package/dist/components/elements/divider/index.html.js +1 -0
- package/dist/components/elements/divider/index.js +1 -0
- package/dist/components/elements/divider/style.css.cjs +1 -0
- package/dist/components/elements/divider/style.css.js +1 -0
- package/dist/components/elements/divider/types.d.ts +15 -0
- package/dist/components/elements/empty/index.cjs +1 -0
- package/dist/components/elements/empty/index.d.ts +10 -0
- package/dist/components/elements/empty/index.html.cjs +1 -0
- package/dist/components/elements/empty/index.html.js +1 -0
- package/dist/components/elements/empty/index.js +1 -0
- package/dist/components/elements/empty/style.css.cjs +1 -0
- package/dist/components/elements/empty/style.css.js +1 -0
- package/dist/components/elements/empty/types.d.ts +9 -0
- package/dist/components/elements/fab/index.cjs +1 -0
- package/dist/components/elements/fab/index.d.ts +50 -0
- package/dist/components/elements/fab/index.html.cjs +1 -0
- package/dist/components/elements/fab/index.html.js +1 -0
- package/dist/components/elements/fab/index.js +1 -0
- package/dist/components/elements/fab/style.css.cjs +1 -0
- package/dist/components/elements/fab/style.css.js +1 -0
- package/dist/components/elements/fab/types.d.ts +52 -0
- package/dist/components/elements/index.cjs +1 -0
- package/dist/components/elements/index.d.ts +57 -0
- package/dist/components/elements/index.js +1 -0
- package/dist/components/elements/input/index.cjs +1 -0
- package/dist/components/elements/input/index.d.ts +100 -0
- package/dist/components/elements/input/index.html.cjs +1 -0
- package/dist/components/elements/input/index.html.js +1 -0
- package/dist/components/elements/input/index.js +1 -0
- package/dist/components/elements/input/style.css.cjs +1 -0
- package/dist/components/elements/input/style.css.js +1 -0
- package/dist/components/elements/input/types.d.ts +66 -0
- package/dist/components/elements/pagination/index.cjs +1 -0
- package/dist/components/elements/pagination/index.d.ts +80 -0
- package/dist/components/elements/pagination/index.html.cjs +1 -0
- package/dist/components/elements/pagination/index.html.js +1 -0
- package/dist/components/elements/pagination/index.js +1 -0
- package/dist/components/elements/pagination/style.css.cjs +1 -0
- package/dist/components/elements/pagination/style.css.js +1 -0
- package/dist/components/elements/pagination/types.d.ts +28 -0
- package/dist/components/elements/progress/index.cjs +1 -0
- package/dist/components/elements/progress/index.d.ts +42 -0
- package/dist/components/elements/progress/index.html.cjs +1 -0
- package/dist/components/elements/progress/index.html.js +1 -0
- package/dist/components/elements/progress/index.js +1 -0
- package/dist/components/elements/progress/style.css.cjs +1 -0
- package/dist/components/elements/progress/style.css.js +1 -0
- package/dist/components/elements/progress/types.d.ts +21 -0
- package/dist/components/elements/radio/index.cjs +1 -0
- package/dist/components/elements/radio/index.d.ts +42 -0
- package/dist/components/elements/radio/index.html.cjs +1 -0
- package/dist/components/elements/radio/index.html.js +1 -0
- package/dist/components/elements/radio/index.js +1 -0
- package/dist/components/elements/radio/style.css.cjs +1 -0
- package/dist/components/elements/radio/style.css.js +1 -0
- package/dist/components/elements/radio/types.d.ts +29 -0
- package/dist/components/elements/rate/index.cjs +1 -0
- package/dist/components/elements/rate/index.d.ts +47 -0
- package/dist/components/elements/rate/index.html.cjs +1 -0
- package/dist/components/elements/rate/index.html.js +1 -0
- package/dist/components/elements/rate/index.js +1 -0
- package/dist/components/elements/rate/style.css.cjs +1 -0
- package/dist/components/elements/rate/style.css.js +1 -0
- package/dist/components/elements/rate/types.d.ts +19 -0
- package/dist/components/elements/select/index.cjs +1 -0
- package/dist/components/elements/select/index.d.ts +68 -0
- package/dist/components/elements/select/index.html.cjs +1 -0
- package/dist/components/elements/select/index.html.js +1 -0
- package/dist/components/elements/select/index.js +1 -0
- package/dist/components/elements/select/style.css.cjs +1 -0
- package/dist/components/elements/select/style.css.js +1 -0
- package/dist/components/elements/select/types.d.ts +30 -0
- package/dist/components/elements/skeleton/index.cjs +1 -0
- package/dist/components/elements/skeleton/index.d.ts +26 -0
- package/dist/components/elements/skeleton/index.html.cjs +1 -0
- package/dist/components/elements/skeleton/index.html.js +1 -0
- package/dist/components/elements/skeleton/index.js +1 -0
- package/dist/components/elements/skeleton/style.css.cjs +1 -0
- package/dist/components/elements/skeleton/style.css.js +1 -0
- package/dist/components/elements/skeleton/types.d.ts +23 -0
- package/dist/components/elements/slider/index.cjs +1 -0
- package/dist/components/elements/slider/index.d.ts +76 -0
- package/dist/components/elements/slider/index.html.cjs +1 -0
- package/dist/components/elements/slider/index.html.js +1 -0
- package/dist/components/elements/slider/index.js +1 -0
- package/dist/components/elements/slider/style.css.cjs +1 -0
- package/dist/components/elements/slider/style.css.js +1 -0
- package/dist/components/elements/slider/types.d.ts +25 -0
- package/dist/components/elements/steps/index.cjs +1 -0
- package/dist/components/elements/steps/index.d.ts +31 -0
- package/dist/components/elements/steps/index.html.cjs +1 -0
- package/dist/components/elements/steps/index.html.js +1 -0
- package/dist/components/elements/steps/index.js +1 -0
- package/dist/components/elements/steps/style.css.cjs +1 -0
- package/dist/components/elements/steps/style.css.js +1 -0
- package/dist/components/elements/steps/types.d.ts +18 -0
- package/dist/components/elements/switch/index.cjs +1 -0
- package/dist/components/elements/switch/index.d.ts +62 -0
- package/dist/components/elements/switch/index.html.cjs +1 -0
- package/dist/components/elements/switch/index.html.js +1 -0
- package/dist/components/elements/switch/index.js +1 -0
- package/dist/components/elements/switch/style.css.cjs +1 -0
- package/dist/components/elements/switch/style.css.js +1 -0
- package/dist/components/elements/switch/types.d.ts +28 -0
- package/dist/components/elements/table/index.cjs +1 -0
- package/dist/components/elements/table/index.d.ts +46 -0
- package/dist/components/elements/table/index.html.cjs +1 -0
- package/dist/components/elements/table/index.html.js +1 -0
- package/dist/components/elements/table/index.js +1 -0
- package/dist/components/elements/table/style.css.cjs +1 -0
- package/dist/components/elements/table/style.css.js +1 -0
- package/dist/components/elements/table/types.d.ts +38 -0
- package/dist/components/elements/tabs/index.cjs +1 -0
- package/dist/components/elements/tabs/index.d.ts +54 -0
- package/dist/components/elements/tabs/index.html.cjs +1 -0
- package/dist/components/elements/tabs/index.html.js +1 -0
- package/dist/components/elements/tabs/index.js +1 -0
- package/dist/components/elements/tabs/style.css.cjs +1 -0
- package/dist/components/elements/tabs/style.css.js +1 -0
- package/dist/components/elements/tabs/types.d.ts +30 -0
- package/dist/components/elements/tag/index.cjs +1 -0
- package/dist/components/elements/tag/index.d.ts +22 -0
- package/dist/components/elements/tag/index.html.cjs +1 -0
- package/dist/components/elements/tag/index.html.js +1 -0
- package/dist/components/elements/tag/index.js +1 -0
- package/dist/components/elements/tag/style.css.cjs +1 -0
- package/dist/components/elements/tag/style.css.js +1 -0
- package/dist/components/elements/tag/types.d.ts +21 -0
- package/dist/components/elements/timeline/index.cjs +1 -0
- package/dist/components/elements/timeline/index.d.ts +25 -0
- package/dist/components/elements/timeline/index.html.cjs +1 -0
- package/dist/components/elements/timeline/index.html.js +1 -0
- package/dist/components/elements/timeline/index.js +1 -0
- package/dist/components/elements/timeline/style.css.cjs +1 -0
- package/dist/components/elements/timeline/style.css.js +1 -0
- package/dist/components/elements/timeline/types.d.ts +23 -0
- package/dist/components/elements/tree/index.cjs +1 -0
- package/dist/components/elements/tree/index.d.ts +127 -0
- package/dist/components/elements/tree/index.html.cjs +1 -0
- package/dist/components/elements/tree/index.html.js +1 -0
- package/dist/components/elements/tree/index.js +1 -0
- package/dist/components/elements/tree/style.css.cjs +1 -0
- package/dist/components/elements/tree/style.css.js +1 -0
- package/dist/components/elements/tree/types.d.ts +47 -0
- package/dist/components/elements/upload/index.cjs +1 -0
- package/dist/components/elements/upload/index.d.ts +74 -0
- package/dist/components/elements/upload/index.html.cjs +1 -0
- package/dist/components/elements/upload/index.html.js +1 -0
- package/dist/components/elements/upload/index.js +1 -0
- package/dist/components/elements/upload/style.css.cjs +1 -0
- package/dist/components/elements/upload/style.css.js +1 -0
- package/dist/components/elements/upload/types.d.ts +48 -0
- package/dist/components/index.cjs +1 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.js +1 -0
- package/dist/components/theme/index.cjs +1 -0
- package/dist/components/theme/index.d.ts +45 -0
- package/dist/components/theme/index.js +1 -0
- package/dist/components/theme/variables.css +274 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +1 -1
- package/dist/plugins/solely-vite-plugin.cjs +1 -1
- package/dist/plugins/solely-vite-plugin.js +1 -1
- package/dist/router/core.cjs +1 -1
- package/dist/router/core.js +1 -1
- package/dist/router/router-link.cjs +1 -1
- package/dist/router/router-link.js +1 -1
- package/dist/router/router-view.cjs +1 -1
- package/dist/router/router-view.js +1 -1
- package/dist/runtime/component/base-element.cjs +1 -1
- package/dist/runtime/component/base-element.d.ts +1 -1
- package/dist/runtime/component/base-element.js +1 -1
- package/dist/runtime/component/decorators.cjs +1 -1
- package/dist/runtime/component/decorators.d.ts +9 -0
- package/dist/runtime/component/decorators.js +1 -1
- package/dist/runtime/index.cjs +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/reactivity/observe.cjs +1 -1
- package/dist/runtime/reactivity/observe.js +1 -1
- package/dist/runtime/renderer/html-decode.cjs +1 -1
- package/dist/runtime/renderer/html-decode.js +1 -1
- package/dist/runtime/renderer/renderIR.cjs +1 -1
- package/dist/runtime/renderer/renderIR.js +1 -1
- package/dist/shared/env.cjs +1 -1
- package/dist/shared/env.js +1 -1
- package/dist/shared/event-listeners.cjs +1 -1
- package/dist/shared/gen-function.cjs +1 -1
- package/dist/shared/gen-function.js +1 -1
- package/dist/shared/index.cjs +1 -1
- package/dist/shared/is-object.js +1 -1
- package/dist/shared/templateError.cjs +1 -1
- package/dist/shared/templateError.js +1 -1
- package/dist/shared/url.cjs +1 -1
- package/dist/shared/url.js +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/lifecycle.cjs +1 -1
- package/package.json +43 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FAB (Floating Action Button) 悬浮按钮类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* FAB 位置类型
|
|
6
|
+
*/
|
|
7
|
+
export type FabPosition = 'top-left' | 'top-center' | 'top-right' | 'left-center' | 'center' | 'right-center' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
8
|
+
/**
|
|
9
|
+
* FAB 尺寸类型
|
|
10
|
+
*/
|
|
11
|
+
export type FabSize = 'small' | 'medium' | 'large';
|
|
12
|
+
/**
|
|
13
|
+
* FAB 形状类型
|
|
14
|
+
*/
|
|
15
|
+
export type FabShape = 'circle' | 'square' | 'rounded';
|
|
16
|
+
/**
|
|
17
|
+
* FAB 组件属性接口
|
|
18
|
+
*/
|
|
19
|
+
export interface FabProps {
|
|
20
|
+
/** 按钮类型 */
|
|
21
|
+
type?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'default';
|
|
22
|
+
/** 按钮尺寸 */
|
|
23
|
+
size?: FabSize;
|
|
24
|
+
/** 按钮形状 */
|
|
25
|
+
shape?: FabShape;
|
|
26
|
+
/** 悬浮位置 */
|
|
27
|
+
position?: FabPosition;
|
|
28
|
+
/** 水平偏移距离(像素) */
|
|
29
|
+
offsetX?: number;
|
|
30
|
+
/** 垂直偏移距离(像素) */
|
|
31
|
+
offsetY?: number;
|
|
32
|
+
/** 是否禁用 */
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
/** 图标内容 */
|
|
35
|
+
icon?: string;
|
|
36
|
+
/** 是否可见 */
|
|
37
|
+
visible?: boolean;
|
|
38
|
+
/** 点击时是否隐藏 */
|
|
39
|
+
hideOnClick?: boolean;
|
|
40
|
+
/** 自定义 z-index */
|
|
41
|
+
zIndex?: number;
|
|
42
|
+
/** 是否在容器内使用(使用绝对定位代替 fixed) */
|
|
43
|
+
absolute?: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* FAB 组件 Refs 接口
|
|
47
|
+
*/
|
|
48
|
+
export interface FabRefs {
|
|
49
|
+
/** 按钮元素引用 */
|
|
50
|
+
buttonRef: HTMLButtonElement;
|
|
51
|
+
[key: string]: Element;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./button/index.cjs"),r=require("./input/index.cjs"),t=require("./fab/index.cjs"),l=require("./card/index.cjs"),o=require("./tag/index.cjs"),i=require("./badge/index.cjs"),n=require("./alert/index.cjs"),y=require("./switch/index.cjs"),d=require("./checkbox/index.cjs"),p=require("./radio/index.cjs"),b=require("./select/index.cjs"),c=require("./progress/index.cjs"),s=require("./divider/index.cjs"),a=require("./tabs/index.cjs"),u=require("./table/index.cjs"),S=require("./skeleton/index.cjs"),x=require("./empty/index.cjs"),j=require("./pagination/index.cjs"),g=require("./breadcrumb/index.cjs"),m=require("./steps/index.cjs"),P=require("./timeline/index.cjs"),f=require("./backtop/index.cjs"),O=require("./upload/index.cjs"),q=require("./rate/index.cjs"),T=require("./slider/index.cjs"),k=require("./tree/index.cjs"),B=require("./coordinate-input/index.cjs");Object.defineProperty(exports,"SolelyButton",{enumerable:!0,get:()=>e.SolelyButton}),Object.defineProperty(exports,"SolelyInput",{enumerable:!0,get:()=>r.SolelyInput}),Object.defineProperty(exports,"SolelyFab",{enumerable:!0,get:()=>t.SolelyFab}),Object.defineProperty(exports,"SolelyCard",{enumerable:!0,get:()=>l.SolelyCard}),Object.defineProperty(exports,"SolelyTag",{enumerable:!0,get:()=>o.SolelyTag}),Object.defineProperty(exports,"SolelyBadge",{enumerable:!0,get:()=>i.SolelyBadge}),Object.defineProperty(exports,"SolelyAlert",{enumerable:!0,get:()=>n.SolelyAlert}),Object.defineProperty(exports,"SolelySwitch",{enumerable:!0,get:()=>y.SolelySwitch}),Object.defineProperty(exports,"SolelyCheckbox",{enumerable:!0,get:()=>d.SolelyCheckbox}),Object.defineProperty(exports,"SolelyRadio",{enumerable:!0,get:()=>p.SolelyRadio}),Object.defineProperty(exports,"SolelySelect",{enumerable:!0,get:()=>b.SolelySelect}),Object.defineProperty(exports,"SolelyProgress",{enumerable:!0,get:()=>c.SolelyProgress}),Object.defineProperty(exports,"SolelyDivider",{enumerable:!0,get:()=>s.SolelyDivider}),Object.defineProperty(exports,"SolelyTabs",{enumerable:!0,get:()=>a.SolelyTabs}),Object.defineProperty(exports,"SolelyTable",{enumerable:!0,get:()=>u.SolelyTable}),Object.defineProperty(exports,"SolelySkeleton",{enumerable:!0,get:()=>S.SolelySkeleton}),Object.defineProperty(exports,"SolelyEmpty",{enumerable:!0,get:()=>x.SolelyEmpty}),Object.defineProperty(exports,"SolelyPagination",{enumerable:!0,get:()=>j.SolelyPagination}),Object.defineProperty(exports,"SolelyBreadcrumb",{enumerable:!0,get:()=>g.SolelyBreadcrumb}),Object.defineProperty(exports,"SolelySteps",{enumerable:!0,get:()=>m.SolelySteps}),Object.defineProperty(exports,"SolelyTimeline",{enumerable:!0,get:()=>P.SolelyTimeline}),Object.defineProperty(exports,"SolelyBackTop",{enumerable:!0,get:()=>f.SolelyBackTop}),Object.defineProperty(exports,"SolelyUpload",{enumerable:!0,get:()=>O.SolelyUpload}),Object.defineProperty(exports,"SolelyRate",{enumerable:!0,get:()=>q.SolelyRate}),Object.defineProperty(exports,"SolelySlider",{enumerable:!0,get:()=>T.SolelySlider}),Object.defineProperty(exports,"SolelyTree",{enumerable:!0,get:()=>k.SolelyTree}),Object.defineProperty(exports,"SolelyCoordinateInput",{enumerable:!0,get:()=>B.SolelyCoordinateInput});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Solely 组件库 - 自定义元素组件统一导出
|
|
3
|
+
*/
|
|
4
|
+
export { SolelyButton } from './button';
|
|
5
|
+
export { SolelyInput } from './input';
|
|
6
|
+
export { SolelyFab } from './fab';
|
|
7
|
+
export { SolelyCard } from './card';
|
|
8
|
+
export { SolelyTag } from './tag';
|
|
9
|
+
export { SolelyBadge } from './badge';
|
|
10
|
+
export { SolelyAlert } from './alert';
|
|
11
|
+
export { SolelySwitch } from './switch';
|
|
12
|
+
export { SolelyCheckbox } from './checkbox';
|
|
13
|
+
export { SolelyRadio } from './radio';
|
|
14
|
+
export { SolelySelect } from './select';
|
|
15
|
+
export { SolelyProgress } from './progress';
|
|
16
|
+
export { SolelyDivider } from './divider';
|
|
17
|
+
export { SolelyTabs } from './tabs';
|
|
18
|
+
export { SolelyTable } from './table';
|
|
19
|
+
export { SolelySkeleton } from './skeleton';
|
|
20
|
+
export { SolelyEmpty } from './empty';
|
|
21
|
+
export { SolelyPagination } from './pagination';
|
|
22
|
+
export { SolelyBreadcrumb } from './breadcrumb';
|
|
23
|
+
export { SolelySteps } from './steps';
|
|
24
|
+
export { SolelyTimeline } from './timeline';
|
|
25
|
+
export { SolelyBackTop } from './backtop';
|
|
26
|
+
export { SolelyUpload } from './upload';
|
|
27
|
+
export { SolelyRate } from './rate';
|
|
28
|
+
export { SolelySlider } from './slider';
|
|
29
|
+
export { SolelyTree } from './tree';
|
|
30
|
+
export { SolelyCoordinateInput } from './coordinate-input';
|
|
31
|
+
export type { ButtonProps, ButtonType, ButtonSize, ButtonShape } from './button/types';
|
|
32
|
+
export type { InputProps, InputType, InputSize } from './input/types';
|
|
33
|
+
export type { FabProps, FabPosition, FabSize, FabShape } from './fab/types';
|
|
34
|
+
export type { CardProps, CardSize } from './card/types';
|
|
35
|
+
export type { TagProps, TagType, TagSize } from './tag/types';
|
|
36
|
+
export type { BadgeProps, BadgeStatus } from './badge/types';
|
|
37
|
+
export type { AlertProps, AlertType } from './alert/types';
|
|
38
|
+
export type { SwitchProps, SwitchSize } from './switch/types';
|
|
39
|
+
export type { CheckboxProps, CheckboxSize, CheckboxType, CheckboxRefs } from './checkbox/types';
|
|
40
|
+
export type { RadioProps, RadioGroupProps } from './radio/types';
|
|
41
|
+
export type { SelectProps, SelectOption, SelectSize } from './select/types';
|
|
42
|
+
export type { ProgressProps, ProgressType, ProgressStatus } from './progress/types';
|
|
43
|
+
export type { DividerProps, DividerType, DividerOrientation } from './divider/types';
|
|
44
|
+
export type { TabsProps, TabsType, TabsPosition, TabsSize, TabItem } from './tabs/types';
|
|
45
|
+
export type { TableProps, TableSize, TableColumn } from './table/types';
|
|
46
|
+
export type { SkeletonProps, SkeletonAvatarShape, SkeletonElement } from './skeleton/types';
|
|
47
|
+
export type { EmptyProps } from './empty/types';
|
|
48
|
+
export type { PaginationProps, PaginationSize } from './pagination/types';
|
|
49
|
+
export type { BreadcrumbProps, BreadcrumbItem } from './breadcrumb/types';
|
|
50
|
+
export type { StepsProps, StepsDirection, StepsSize, StepItem, StepStatus } from './steps/types';
|
|
51
|
+
export type { TimelineProps, TimelineMode, TimelineItem, TimelineItemPosition } from './timeline/types';
|
|
52
|
+
export type { BackTopProps } from './backtop/types';
|
|
53
|
+
export type { UploadProps, UploadFile, UploadListType } from './upload/types';
|
|
54
|
+
export type { RateProps } from './rate/types';
|
|
55
|
+
export type { SliderProps } from './slider/types';
|
|
56
|
+
export type { TreeProps, TreeNode } from './tree/types';
|
|
57
|
+
export type { CoordinateInputProps, CoordinateType, DMS, Coordinate, DMSCoordinate } from './coordinate-input/types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{SolelyButton as r}from"./button/index.js";import{SolelyInput as i}from"./input/index.js";import{SolelyFab as o}from"./fab/index.js";import{SolelyCard as m}from"./card/index.js";import{SolelyTag as e}from"./tag/index.js";import{SolelyBadge as t}from"./badge/index.js";import{SolelyAlert as d}from"./alert/index.js";import{SolelySwitch as p}from"./switch/index.js";import{SolelyCheckbox as s}from"./checkbox/index.js";import{SolelyRadio as n}from"./radio/index.js";import{SolelySelect as x}from"./select/index.js";import{SolelyProgress as f}from"./progress/index.js";import{SolelyDivider as j}from"./divider/index.js";import{SolelyTabs as a}from"./tabs/index.js";import{SolelyTable as b}from"./table/index.js";import{SolelySkeleton as c}from"./skeleton/index.js";import{SolelyEmpty as l}from"./empty/index.js";import{SolelyPagination as u}from"./pagination/index.js";import{SolelyBreadcrumb as g}from"./breadcrumb/index.js";import{SolelySteps as k}from"./steps/index.js";import{SolelyTimeline as h}from"./timeline/index.js";import{SolelyBackTop as v}from"./backtop/index.js";import{SolelyUpload as w}from"./upload/index.js";import{SolelyRate as y}from"./rate/index.js";import{SolelySlider as q}from"./slider/index.js";import{SolelyTree as z}from"./tree/index.js";import{SolelyCoordinateInput as A}from"./coordinate-input/index.js";export{d as SolelyAlert,v as SolelyBackTop,t as SolelyBadge,g as SolelyBreadcrumb,r as SolelyButton,m as SolelyCard,s as SolelyCheckbox,A as SolelyCoordinateInput,j as SolelyDivider,l as SolelyEmpty,o as SolelyFab,i as SolelyInput,u as SolelyPagination,f as SolelyProgress,n as SolelyRadio,y as SolelyRate,x as SolelySelect,c as SolelySkeleton,q as SolelySlider,k as SolelySteps,p as SolelySwitch,b as SolelyTable,a as SolelyTabs,e as SolelyTag,h as SolelyTimeline,z as SolelyTree,w as SolelyUpload};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=Object.defineProperty;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./style.css.cjs"),a=require("./index.html.cjs"),s=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyInput=class extends s.default{constructor(){var t;super(...arguments),((t,a,s)=>{a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s})(this,"symbol"!=typeof(t="_filteredSuggestions")?t+"":t,[])}get filteredSuggestions(){return this._filteredSuggestions}mounted(){this.$data.autofocus&&this.focus()}getWrapperClasses(){const e={};return"small"===this.$data.size?e["form-control--sm"]=!0:"large"===this.$data.size&&(e["form-control--lg"]=!0),"error"===this.$data.status?e["is-error"]=!0:"warning"===this.$data.status?e["is-warning"]=!0:"success"===this.$data.status&&(e["is-success"]=!0),"textarea"===this.$data.type&&(e["form-control--textarea"]=!0),e["is-focused"]=!!this.$data.focused,e["is-disabled"]=!!this.$data.disabled,e["is-readonly"]=!!this.$data.readonly,e["form-control--block"]=!!this.$data.block,e}getCharCount(){var e;return(null==(e=this.$data.value)?void 0:e.length)||0}formatValue(e){switch(this.$data.format){case"phone":return e.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3").trim();case"bankcard":return e.replace(/(\d{4})(?=\d)/g,"$1 ").trim();case"idcard":return e.replace(/(\d{6})(\d{4})(\d{4})(\d{4})(\d{0,4})/,"$1 $2 $3 $4 $5").trim();default:return e}}unformatValue(e){return e.replace(/\s/g,"")}handleInput(e){const t=e.target;let a=t.value;if("none"!==this.$data.format&&"textarea"!==this.$data.type){const e=this.unformatValue(a),s=this.formatValue(e);s!==a&&(t.value=s,a=s)}this.$data.value=a,this.$data.suggestions&&this.$data.suggestions.length>0&&this.updateSuggestions(a)}handleFocus(e){this.$data.focused=!0,this.$data.selectall&&this.$data.value&&this.select()}handleBlur(e){this.$data.focused=!1}handleChange(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}handleKeydown(e){"Enter"===e.key&&"search"===this.$data.type&&this.emit("search",{value:this.$data.value})}handleClear(){this.$data.value="",this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.focus()}togglePassword(){this.$data.passwordVisible=!this.$data.passwordVisible}async handleCopy(){try{const e=this.unformatValue(this.$data.value);await navigator.clipboard.writeText(e),this.emit("copy",{value:e})}catch(e){this.emit("copy-error",{error:e})}}updateSuggestions(e){if(!e||!this.$data.suggestions)return this._filteredSuggestions=[],void this.refresh();this._filteredSuggestions=this.$data.suggestions.filter(t=>t.toLowerCase().includes(e.toLowerCase())),this.refresh()}selectSuggestion(e){this.$data.value=e,this._filteredSuggestions=[],this.refresh(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.focus(),this.$data.focused=!0}blur(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.blur(),this.$data.focused=!1}setValue(e){this.$data.value=e}getValue(){return this.unformatValue(this.$data.value)}get value(){return this.getValue()}set value(e){this.setValue(e)}select(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.select()}},exports.SolelyInput=((e,t)=>{for(var a,s=t,r=e.length-1;r>=0;r--)(a=e[r])&&(s=a(s)||s);return s})([r.CustomElement({tagName:"solely-input",template:a.default,styles:t.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"text"},{name:"size",type:"string",default:""},{name:"value",type:"string",default:""},{name:"placeholder",type:"string",default:""},{name:"disabled",type:"boolean",default:!1},{name:"readonly",type:"boolean",default:!1},{name:"required",type:"boolean",default:!1},{name:"maxlength",type:"number"},{name:"minlength",type:"number"},{name:"clearable",type:"boolean",default:!1},{name:"showpassword",type:"boolean",default:!1},{name:"passwordVisible",type:"boolean",default:!1},{name:"focused",type:"boolean",default:!1},{name:"prefix",type:"string",default:""},{name:"suffix",type:"string",default:""},{name:"status",type:"string",default:""},{name:"message",type:"string",default:""},{name:"showcount",type:"boolean",default:!1},{name:"rows",type:"number",default:3},{name:"autofocus",type:"boolean",default:!1},{name:"selectall",type:"boolean",default:!1},{name:"copyable",type:"boolean",default:!1},{name:"format",type:"string",default:"none"},{name:"suggestions",type:"array",default:[]},{name:"block",type:"boolean",default:!1}]})],exports.SolelyInput);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
import { InputProps, InputRefs } from './types';
|
|
3
|
+
declare class SolelyInput extends BaseElement<InputProps, InputRefs> {
|
|
4
|
+
/** 过滤后的搜索建议 */
|
|
5
|
+
private _filteredSuggestions;
|
|
6
|
+
/**
|
|
7
|
+
* 获取过滤后的搜索建议(供模板使用)
|
|
8
|
+
*/
|
|
9
|
+
get filteredSuggestions(): string[];
|
|
10
|
+
/**
|
|
11
|
+
* 组件挂载后
|
|
12
|
+
*/
|
|
13
|
+
mounted(): void;
|
|
14
|
+
/**
|
|
15
|
+
* 获取 wrapper class 对象
|
|
16
|
+
*/
|
|
17
|
+
getWrapperClasses(): Record<string, boolean>;
|
|
18
|
+
/**
|
|
19
|
+
* 获取当前字符数
|
|
20
|
+
*/
|
|
21
|
+
getCharCount(): number;
|
|
22
|
+
/**
|
|
23
|
+
* 格式化输入值
|
|
24
|
+
*/
|
|
25
|
+
formatValue(value: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* 反格式化(去除空格)
|
|
28
|
+
*/
|
|
29
|
+
unformatValue(value: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* 输入事件处理
|
|
32
|
+
*/
|
|
33
|
+
handleInput(event: InputEvent): void;
|
|
34
|
+
/**
|
|
35
|
+
* 聚焦事件处理
|
|
36
|
+
*/
|
|
37
|
+
handleFocus(_event: FocusEvent): void;
|
|
38
|
+
/**
|
|
39
|
+
* 失焦事件处理
|
|
40
|
+
*/
|
|
41
|
+
handleBlur(_event: FocusEvent): void;
|
|
42
|
+
/**
|
|
43
|
+
* 值改变事件处理(失焦或回车时触发)
|
|
44
|
+
*/
|
|
45
|
+
handleChange(_event: Event): void;
|
|
46
|
+
/**
|
|
47
|
+
* 键盘事件处理
|
|
48
|
+
*/
|
|
49
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
50
|
+
/**
|
|
51
|
+
* 清除输入
|
|
52
|
+
*/
|
|
53
|
+
handleClear(): void;
|
|
54
|
+
/**
|
|
55
|
+
* 切换密码显示
|
|
56
|
+
*/
|
|
57
|
+
togglePassword(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 复制内容
|
|
60
|
+
*/
|
|
61
|
+
handleCopy(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* 更新搜索建议
|
|
64
|
+
*/
|
|
65
|
+
updateSuggestions(value: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* 选择建议
|
|
68
|
+
*/
|
|
69
|
+
selectSuggestion(suggestion: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* 聚焦输入框
|
|
72
|
+
*/
|
|
73
|
+
focus(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 失焦输入框
|
|
76
|
+
*/
|
|
77
|
+
blur(): void;
|
|
78
|
+
/**
|
|
79
|
+
* 设置值
|
|
80
|
+
*/
|
|
81
|
+
setValue(value: string): void;
|
|
82
|
+
/**
|
|
83
|
+
* 获取值
|
|
84
|
+
*/
|
|
85
|
+
getValue(): string;
|
|
86
|
+
/**
|
|
87
|
+
* value 属性 getter
|
|
88
|
+
*/
|
|
89
|
+
get value(): string;
|
|
90
|
+
/**
|
|
91
|
+
* value 属性 setter
|
|
92
|
+
*/
|
|
93
|
+
set value(val: string);
|
|
94
|
+
/**
|
|
95
|
+
* 选择文本
|
|
96
|
+
*/
|
|
97
|
+
select(): void;
|
|
98
|
+
}
|
|
99
|
+
export default SolelyInput;
|
|
100
|
+
export { SolelyInput };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div\n class="form-control"\n :class="this.getWrapperClasses()"\n>\n <If test="$data.prefix">\n <span class="form-control__prefix">{{$data.prefix}}</span>\n </If>\n\n <If test="$data.type === \'textarea\'">\n <textarea\n class="form-control__input form-control__textarea"\n :value="$data.value"\n :placeholder="$data.placeholder"\n :disabled="$data.disabled"\n :readonly="$data.readonly"\n :maxlength="$data.maxlength"\n :minlength="$data.minlength"\n :rows="$data.rows"\n @input="this.handleInput(event)"\n @focus="this.handleFocus(event)"\n @blur="this.handleBlur(event)"\n @change="this.handleChange(event)"\n @keydown="this.handleKeydown(event)"\n ></textarea>\n </If>\n <Else>\n <input\n class="form-control__input"\n :type="$data.passwordVisible && $data.type === \'password\' ? \'text\' : $data.type"\n :value="$data.value"\n :placeholder="$data.placeholder"\n :disabled="$data.disabled"\n :readonly="$data.readonly"\n :maxlength="$data.maxlength"\n :minlength="$data.minlength"\n @input="this.handleInput(event)"\n @focus="this.handleFocus(event)"\n @blur="this.handleBlur(event)"\n @change="this.handleChange(event)"\n @keydown="this.handleKeydown(event)"\n />\n </Else>\n\n <If test="$data.clearable && $data.value && !$data.disabled">\n <span\n class="close-btn form-control__clear"\n @click="this.handleClear(event)"\n >×</span>\n </If>\n <ElseIf test="$data.type === \'password\' && $data.showpassword">\n <span\n class="form-control__password-toggle"\n @click="this.togglePassword(event)"\n >{{$data.passwordVisible ? \'🙈\' : \'👁\'}}</span>\n </ElseIf>\n <ElseIf test="$data.copyable && $data.value">\n <span\n class="form-control__copy"\n @click="this.handleCopy(event)"\n >📋</span>\n </ElseIf>\n <ElseIf test="$data.suffix">\n <span class="form-control__suffix">{{$data.suffix}}</span>\n </ElseIf>\n\n <If test="$data.suggestions && $data.suggestions.length > 0 && this.filteredSuggestions && this.filteredSuggestions.length > 0">\n <div class="dropdown">\n <For each="this.filteredSuggestions" item="suggestion">\n <div\n class="dropdown__item"\n @click="this.selectSuggestion(suggestion)"\n >{{suggestion}}</div>\n </For>\n </div>\n </If>\n</div>\n\n<If test="$data.showcount && $data.maxlength">\n <div class="form-control__count">\n <span class="form-control__count-current">{{this.getCharCount()}}</span>\n <span class="form-control__count-separator">/</span>\n <span class="form-control__count-max">{{$data.maxlength}}</span>\n </div>\n</If>\n\n<If test="$data.message">\n <div class="form-control__message form-control__message--{{$data.status || \'default\'}}">\n {{$data.message}}\n </div>\n</If>\n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n='<div\n class="form-control"\n :class="this.getWrapperClasses()"\n>\n <If test="$data.prefix">\n <span class="form-control__prefix">{{$data.prefix}}</span>\n </If>\n\n <If test="$data.type === \'textarea\'">\n <textarea\n class="form-control__input form-control__textarea"\n :value="$data.value"\n :placeholder="$data.placeholder"\n :disabled="$data.disabled"\n :readonly="$data.readonly"\n :maxlength="$data.maxlength"\n :minlength="$data.minlength"\n :rows="$data.rows"\n @input="this.handleInput(event)"\n @focus="this.handleFocus(event)"\n @blur="this.handleBlur(event)"\n @change="this.handleChange(event)"\n @keydown="this.handleKeydown(event)"\n ></textarea>\n </If>\n <Else>\n <input\n class="form-control__input"\n :type="$data.passwordVisible && $data.type === \'password\' ? \'text\' : $data.type"\n :value="$data.value"\n :placeholder="$data.placeholder"\n :disabled="$data.disabled"\n :readonly="$data.readonly"\n :maxlength="$data.maxlength"\n :minlength="$data.minlength"\n @input="this.handleInput(event)"\n @focus="this.handleFocus(event)"\n @blur="this.handleBlur(event)"\n @change="this.handleChange(event)"\n @keydown="this.handleKeydown(event)"\n />\n </Else>\n\n <If test="$data.clearable && $data.value && !$data.disabled">\n <span\n class="close-btn form-control__clear"\n @click="this.handleClear(event)"\n >×</span>\n </If>\n <ElseIf test="$data.type === \'password\' && $data.showpassword">\n <span\n class="form-control__password-toggle"\n @click="this.togglePassword(event)"\n >{{$data.passwordVisible ? \'🙈\' : \'👁\'}}</span>\n </ElseIf>\n <ElseIf test="$data.copyable && $data.value">\n <span\n class="form-control__copy"\n @click="this.handleCopy(event)"\n >📋</span>\n </ElseIf>\n <ElseIf test="$data.suffix">\n <span class="form-control__suffix">{{$data.suffix}}</span>\n </ElseIf>\n\n <If test="$data.suggestions && $data.suggestions.length > 0 && this.filteredSuggestions && this.filteredSuggestions.length > 0">\n <div class="dropdown">\n <For each="this.filteredSuggestions" item="suggestion">\n <div\n class="dropdown__item"\n @click="this.selectSuggestion(suggestion)"\n >{{suggestion}}</div>\n </For>\n </div>\n </If>\n</div>\n\n<If test="$data.showcount && $data.maxlength">\n <div class="form-control__count">\n <span class="form-control__count-current">{{this.getCharCount()}}</span>\n <span class="form-control__count-separator">/</span>\n <span class="form-control__count-max">{{$data.maxlength}}</span>\n </div>\n</If>\n\n<If test="$data.message">\n <div class="form-control__message form-control__message--{{$data.status || \'default\'}}">\n {{$data.message}}\n </div>\n</If>\n';export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty;import t from"./style.css.js";import a from"./index.html.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as o}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let r=class extends s{constructor(){var t;super(...arguments),((t,a,s)=>{a in t?e(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s})(this,"symbol"!=typeof(t="_filteredSuggestions")?t+"":t,[])}get filteredSuggestions(){return this._filteredSuggestions}mounted(){this.$data.autofocus&&this.focus()}getWrapperClasses(){const e={};return"small"===this.$data.size?e["form-control--sm"]=!0:"large"===this.$data.size&&(e["form-control--lg"]=!0),"error"===this.$data.status?e["is-error"]=!0:"warning"===this.$data.status?e["is-warning"]=!0:"success"===this.$data.status&&(e["is-success"]=!0),"textarea"===this.$data.type&&(e["form-control--textarea"]=!0),e["is-focused"]=!!this.$data.focused,e["is-disabled"]=!!this.$data.disabled,e["is-readonly"]=!!this.$data.readonly,e["form-control--block"]=!!this.$data.block,e}getCharCount(){var e;return(null==(e=this.$data.value)?void 0:e.length)||0}formatValue(e){switch(this.$data.format){case"phone":return e.replace(/(\d{3})(\d{4})(\d{4})/,"$1 $2 $3").trim();case"bankcard":return e.replace(/(\d{4})(?=\d)/g,"$1 ").trim();case"idcard":return e.replace(/(\d{6})(\d{4})(\d{4})(\d{4})(\d{0,4})/,"$1 $2 $3 $4 $5").trim();default:return e}}unformatValue(e){return e.replace(/\s/g,"")}handleInput(e){const t=e.target;let a=t.value;if("none"!==this.$data.format&&"textarea"!==this.$data.type){const e=this.unformatValue(a),s=this.formatValue(e);s!==a&&(t.value=s,a=s)}this.$data.value=a,this.$data.suggestions&&this.$data.suggestions.length>0&&this.updateSuggestions(a)}handleFocus(e){this.$data.focused=!0,this.$data.selectall&&this.$data.value&&this.select()}handleBlur(e){this.$data.focused=!1}handleChange(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}handleKeydown(e){"Enter"===e.key&&"search"===this.$data.type&&this.emit("search",{value:this.$data.value})}handleClear(){this.$data.value="",this.dispatchEvent(new Event("clear",{bubbles:!0,composed:!0})),this.focus()}togglePassword(){this.$data.passwordVisible=!this.$data.passwordVisible}async handleCopy(){try{const e=this.unformatValue(this.$data.value);await navigator.clipboard.writeText(e),this.emit("copy",{value:e})}catch(e){this.emit("copy-error",{error:e})}}updateSuggestions(e){if(!e||!this.$data.suggestions)return this._filteredSuggestions=[],void this.refresh();this._filteredSuggestions=this.$data.suggestions.filter(t=>t.toLowerCase().includes(e.toLowerCase())),this.refresh()}selectSuggestion(e){this.$data.value=e,this._filteredSuggestions=[],this.refresh(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.focus(),this.$data.focused=!0}blur(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.blur(),this.$data.focused=!1}setValue(e){this.$data.value=e}getValue(){return this.unformatValue(this.$data.value)}get value(){return this.getValue()}set value(e){this.setValue(e)}select(){var e;const t=null==(e=this.shadowRoot)?void 0:e.querySelector("input, textarea");null==t||t.select()}};r=((e,t)=>{for(var a,s=t,o=e.length-1;o>=0;o--)(a=e[o])&&(s=a(s)||s);return s})([o({tagName:"solely-input",template:a,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"text"},{name:"size",type:"string",default:""},{name:"value",type:"string",default:""},{name:"placeholder",type:"string",default:""},{name:"disabled",type:"boolean",default:!1},{name:"readonly",type:"boolean",default:!1},{name:"required",type:"boolean",default:!1},{name:"maxlength",type:"number"},{name:"minlength",type:"number"},{name:"clearable",type:"boolean",default:!1},{name:"showpassword",type:"boolean",default:!1},{name:"passwordVisible",type:"boolean",default:!1},{name:"focused",type:"boolean",default:!1},{name:"prefix",type:"string",default:""},{name:"suffix",type:"string",default:""},{name:"status",type:"string",default:""},{name:"message",type:"string",default:""},{name:"showcount",type:"boolean",default:!1},{name:"rows",type:"number",default:3},{name:"autofocus",type:"boolean",default:!1},{name:"selectall",type:"boolean",default:!1},{name:"copyable",type:"boolean",default:!1},{name:"format",type:"string",default:"none"},{name:"suggestions",type:"array",default:[]},{name:"block",type:"boolean",default:!1}]})],r);export{r as SolelyInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1;width:100%;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control__prefix,.form-control__suffix{display:inline-flex;align-items:center;color:var(--solely-text-tertiary);flex-shrink:0}.form-control__prefix{margin-right:var(--solely-spacing-xs)}.form-control__suffix{margin-left:var(--solely-spacing-xs)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:0 0 0 2px var(--solely-primary-light)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:0 0 0 2px var(--solely-error-light)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:0 0 0 2px var(--solely-warning-light)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:0 0 0 2px var(--solely-success-light)}.form-control__clear{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:16px}.form-control__password-toggle{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0;-webkit-user-select:none;user-select:none}.form-control__password-toggle:hover{color:var(--solely-text-secondary)}.form-control__copy{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:12px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0;-webkit-user-select:none;user-select:none}.form-control__copy:hover{color:var(--solely-text-secondary)}.form-control__count{display:flex;justify-content:flex-end;align-items:center;margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);color:var(--solely-text-tertiary);gap:2px}.form-control__count-current{color:var(--solely-text-secondary)}.form-control__count-separator,.form-control__count-max{color:var(--solely-text-tertiary)}.form-control__message{margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);line-height:var(--solely-line-height-md)}.form-control__message--error{color:var(--solely-error)}.form-control__message--warning{color:var(--solely-warning)}.form-control__message--success{color:var(--solely-success)}.form-control__message--default{color:var(--solely-text-tertiary)}.form-control--block{display:flex;width:100%}.dropdown{position:absolute;top:100%;left:0;right:0;margin-top:4px;padding:var(--solely-spacing-xs) 0;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown);max-height:200px;overflow-y:auto}.dropdown__item{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:background-color var(--solely-transition-duration)}.dropdown__item:hover{background-color:var(--solely-gray-3)}.close-btn{display:inline-flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0}";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="*,*:before,*:after{box-sizing:border-box}:host{display:inline-block}:host([block]){display:block;width:100%}:host([hidden]){display:none!important}.form-control{display:inline-flex;align-items:center;height:var(--solely-height-md);padding:0 var(--solely-spacing-md);position:relative;font-family:var(--solely-font-family);font-size:var(--solely-font-size-md);line-height:var(--solely-line-height-md);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);transition:all var(--solely-transition-duration) var(--solely-transition-timing);box-sizing:border-box}.form-control:hover:not(.is-disabled){border-color:var(--solely-primary-hover)}.form-control--sm{height:var(--solely-height-sm);padding:0 var(--solely-spacing-sm);font-size:var(--solely-font-size-sm)}.form-control--lg{height:var(--solely-height-lg);padding:0 var(--solely-spacing-lg);font-size:var(--solely-font-size-lg)}.form-control__input{flex:1;width:100%;height:100%;padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:var(--solely-text-primary);background:transparent;border:none;outline:none}.form-control__input::placeholder{color:var(--solely-text-tertiary)}.form-control__prefix,.form-control__suffix{display:inline-flex;align-items:center;color:var(--solely-text-tertiary);flex-shrink:0}.form-control__prefix{margin-right:var(--solely-spacing-xs)}.form-control__suffix{margin-left:var(--solely-spacing-xs)}.form-control--textarea{height:auto;min-height:var(--solely-height-xl);padding:var(--solely-spacing-sm) var(--solely-spacing-md);align-items:flex-start}.form-control__textarea{resize:vertical;min-height:var(--solely-height-lg);padding:var(--solely-spacing-xs) 0}.is-disabled{cursor:not-allowed;opacity:var(--solely-disabled-opacity)}.is-readonly{cursor:default}.is-focused{outline:none;box-shadow:0 0 0 2px var(--solely-primary-light)}.is-error{border-color:var(--solely-error)}.is-error.is-focused{box-shadow:0 0 0 2px var(--solely-error-light)}.is-warning{border-color:var(--solely-warning)}.is-warning.is-focused{box-shadow:0 0 0 2px var(--solely-warning-light)}.is-success{border-color:var(--solely-success)}.is-success.is-focused{box-shadow:0 0 0 2px var(--solely-success-light)}.form-control__clear{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:16px}.form-control__password-toggle{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:14px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0;-webkit-user-select:none;user-select:none}.form-control__password-toggle:hover{color:var(--solely-text-secondary)}.form-control__copy{width:20px;height:20px;margin-left:var(--solely-spacing-xs);font-size:12px;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0;-webkit-user-select:none;user-select:none}.form-control__copy:hover{color:var(--solely-text-secondary)}.form-control__count{display:flex;justify-content:flex-end;align-items:center;margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);color:var(--solely-text-tertiary);gap:2px}.form-control__count-current{color:var(--solely-text-secondary)}.form-control__count-separator,.form-control__count-max{color:var(--solely-text-tertiary)}.form-control__message{margin-top:var(--solely-spacing-xs);font-size:var(--solely-font-size-sm);line-height:var(--solely-line-height-md)}.form-control__message--error{color:var(--solely-error)}.form-control__message--warning{color:var(--solely-warning)}.form-control__message--success{color:var(--solely-success)}.form-control__message--default{color:var(--solely-text-tertiary)}.form-control--block{display:flex;width:100%}.dropdown{position:absolute;top:100%;left:0;right:0;margin-top:4px;padding:var(--solely-spacing-xs) 0;background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);box-shadow:var(--solely-shadow-md);z-index:var(--solely-z-index-dropdown);max-height:200px;overflow-y:auto}.dropdown__item{padding:var(--solely-spacing-sm) var(--solely-spacing-md);cursor:pointer;transition:background-color var(--solely-transition-duration)}.dropdown__item:hover{background-color:var(--solely-gray-3)}.close-btn{display:inline-flex;align-items:center;justify-content:center;color:var(--solely-text-tertiary);cursor:pointer;transition:color var(--solely-transition-duration);flex-shrink:0}";export{o as default};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
export type InputType = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'textarea';
|
|
5
|
+
export type InputSize = 'small' | 'medium' | 'large';
|
|
6
|
+
export type InputStatus = 'error' | 'warning' | 'success' | '';
|
|
7
|
+
export interface InputProps {
|
|
8
|
+
/** 输入框类型 */
|
|
9
|
+
type: InputType;
|
|
10
|
+
/** 输入框尺寸 */
|
|
11
|
+
size: InputSize;
|
|
12
|
+
/** 输入框值 */
|
|
13
|
+
value: string;
|
|
14
|
+
/** 占位符 */
|
|
15
|
+
placeholder: string;
|
|
16
|
+
/** 是否禁用 */
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
/** 是否只读 */
|
|
19
|
+
readonly: boolean;
|
|
20
|
+
/** 是否必填 */
|
|
21
|
+
required: boolean;
|
|
22
|
+
/** 最大长度 */
|
|
23
|
+
maxlength: number;
|
|
24
|
+
/** 最小长度 */
|
|
25
|
+
minlength: number;
|
|
26
|
+
/** 是否显示清除按钮 */
|
|
27
|
+
clearable: boolean;
|
|
28
|
+
/** 是否显示密码切换 */
|
|
29
|
+
showpassword: boolean;
|
|
30
|
+
/** 密码是否可见(内部状态) */
|
|
31
|
+
passwordVisible: boolean;
|
|
32
|
+
/** 是否聚焦 */
|
|
33
|
+
focused: boolean;
|
|
34
|
+
/** 前缀图标 */
|
|
35
|
+
prefix: string;
|
|
36
|
+
/** 后缀图标 */
|
|
37
|
+
suffix: string;
|
|
38
|
+
/** 状态 */
|
|
39
|
+
status: InputStatus;
|
|
40
|
+
/** 状态提示信息 */
|
|
41
|
+
message: string;
|
|
42
|
+
/** 是否显示字数统计 */
|
|
43
|
+
showcount: boolean;
|
|
44
|
+
/** 文本域行数 */
|
|
45
|
+
rows: number;
|
|
46
|
+
/** 是否自动聚焦 */
|
|
47
|
+
autofocus: boolean;
|
|
48
|
+
/** 聚焦时是否全选 */
|
|
49
|
+
selectall: boolean;
|
|
50
|
+
/** 是否显示复制按钮 */
|
|
51
|
+
copyable: boolean;
|
|
52
|
+
/** 输入格式化类型 */
|
|
53
|
+
format: 'none' | 'phone' | 'bankcard' | 'idcard';
|
|
54
|
+
/** 搜索建议数据源(设置后自动启用搜索建议) */
|
|
55
|
+
suggestions: string[];
|
|
56
|
+
/** 是否块级显示 */
|
|
57
|
+
block: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Input 组件 Refs 接口
|
|
61
|
+
*/
|
|
62
|
+
export interface InputRefs {
|
|
63
|
+
/** 输入框元素引用 */
|
|
64
|
+
inputRef: HTMLInputElement | HTMLTextAreaElement;
|
|
65
|
+
[key: string]: Element;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),a=require("../../../runtime/component/base-element.cjs"),s=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyPagination=class extends a.default{get current(){return this.$data.current}set current(e){this.$data.current=e,this.calculateVisiblePages(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get pageSize(){return this.$data.pageSize}set pageSize(e){this.$data.pageSize=e,this.calculateVisiblePages(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getPaginationClasses(){const e={};return"small"===this.$data.size?e["pagination--sm"]=!0:"large"===this.$data.size?e["pagination--lg"]=!0:e["pagination--md"]=!0,e["is-disabled"]=!!this.$data.disabled,e}getPrevClasses(){return{"pagination__item--disabled":(this.$data.current||1)<=1}}getNextClasses(){return{"pagination__item--disabled":(this.$data.current||1)>=this.totalPages}}getItemClasses(e){return{"pagination__item--active":e===this.$data.current}}mounted(){this.$data.jumperValue="",this.parsePageSizeOptions(),this.calculateVisiblePages()}parsePageSizeOptions(){try{this.$data.parsedPageSizeOptions=JSON.parse(this.$data.pageSizeOptions||"[10, 20, 50, 100]")}catch{this.$data.parsedPageSizeOptions=[10,20,50,100]}}get totalPages(){return Math.ceil((this.$data.total||0)/(this.$data.pageSize||10))}calculateVisiblePages(){const e=this.$data.current||1,t=this.totalPages,a=[];if(t<=7)for(let s=1;s<=t;s++)a.push(s);else e<=3?a.push(1,2,3,4,5,"...",t):e>=t-2?a.push(1,"...",t-4,t-3,t-2,t-1,t):a.push(1,"...",e-1,e,e+1,"...",t);this.$data.visiblePages=a}handlePageClick(e){this.$data.disabled||e===this.$data.current||(this.$data.current=e,this.calculateVisiblePages(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{current:e,pageSize:this.$data.pageSize}})))}handlePrev(){this.$data.disabled||this.$data.current<=1||this.handlePageClick(this.$data.current-1)}handleNext(){this.$data.disabled||this.$data.current>=this.totalPages||this.handlePageClick(this.$data.current+1)}handleSizeChange(e){if(this.$data.disabled)return;const t=e.target,a=parseInt(t.value,10);this.$data.pageSize=a,this.$data.current=1,this.calculateVisiblePages(),this.dispatchEvent(new CustomEvent("showSizeChange",{bubbles:!0,composed:!0,detail:{current:1,pageSize:a}}))}handleJumperKeydown(e){if("Enter"!==e.key)return;const t=e.target,a=parseInt(t.value,10);a>=1&&a<=this.totalPages&&this.handlePageClick(a),this.$data.jumperValue=""}handleJumperStep(e){if(this.$data.disabled)return;const t=this.$data.current+e;t>=1&&t<=this.totalPages&&(this.handlePageClick(t),this.$data.jumperValue=String(t))}setCurrent(e){this.$data.current=e,this.calculateVisiblePages()}getCurrent(){return this.$data.current}},exports.SolelyPagination=((e,t)=>{for(var a,s=t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([s.CustomElement({tagName:"solely-pagination",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"current",type:"number",default:1},{name:"total",type:"number",default:0},{name:"pageSize",type:"number",default:10},{name:"size",type:"string",default:"default"},{name:"simple",type:"boolean",default:!1},{name:"showQuickJumper",type:"boolean",default:!1},{name:"showSizeChanger",type:"boolean",default:!1},{name:"pageSizeOptions",type:"string",default:"[10, 20, 50, 100]"},{name:"disabled",type:"boolean",default:!1},{name:"showTotal",type:"boolean",default:!1}]})],exports.SolelyPagination);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
import { PaginationProps } from './types';
|
|
3
|
+
declare class SolelyPagination extends BaseElement<PaginationProps & {
|
|
4
|
+
visiblePages: (number | string)[];
|
|
5
|
+
parsedPageSizeOptions: number[];
|
|
6
|
+
}> {
|
|
7
|
+
/**
|
|
8
|
+
* 暴露 current 属性,使外部可通过 event.target.current 访问
|
|
9
|
+
*/
|
|
10
|
+
get current(): number;
|
|
11
|
+
set current(value: number);
|
|
12
|
+
/**
|
|
13
|
+
* 暴露 pageSize 属性
|
|
14
|
+
*/
|
|
15
|
+
get pageSize(): number;
|
|
16
|
+
set pageSize(value: number);
|
|
17
|
+
/**
|
|
18
|
+
* 获取 pagination class 对象
|
|
19
|
+
*/
|
|
20
|
+
getPaginationClasses(): Record<string, boolean>;
|
|
21
|
+
/**
|
|
22
|
+
* 获取 prev class 对象
|
|
23
|
+
*/
|
|
24
|
+
getPrevClasses(): Record<string, boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* 获取 next class 对象
|
|
27
|
+
*/
|
|
28
|
+
getNextClasses(): Record<string, boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* 获取 item class 对象
|
|
31
|
+
*/
|
|
32
|
+
getItemClasses(page: number | string): Record<string, boolean>;
|
|
33
|
+
mounted(): void;
|
|
34
|
+
/**
|
|
35
|
+
* 解析每页条数选项
|
|
36
|
+
*/
|
|
37
|
+
parsePageSizeOptions(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 计算总页数
|
|
40
|
+
*/
|
|
41
|
+
get totalPages(): number;
|
|
42
|
+
/**
|
|
43
|
+
* 计算可见页码
|
|
44
|
+
*/
|
|
45
|
+
calculateVisiblePages(): void;
|
|
46
|
+
/**
|
|
47
|
+
* 页码点击
|
|
48
|
+
*/
|
|
49
|
+
handlePageClick(page: number): void;
|
|
50
|
+
/**
|
|
51
|
+
* 上一页
|
|
52
|
+
*/
|
|
53
|
+
handlePrev(): void;
|
|
54
|
+
/**
|
|
55
|
+
* 下一页
|
|
56
|
+
*/
|
|
57
|
+
handleNext(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 每页条数改变
|
|
60
|
+
*/
|
|
61
|
+
handleSizeChange(event: Event): void;
|
|
62
|
+
/**
|
|
63
|
+
* 快速跳转
|
|
64
|
+
*/
|
|
65
|
+
handleJumperKeydown(event: KeyboardEvent): void;
|
|
66
|
+
/**
|
|
67
|
+
* 快速跳转步进
|
|
68
|
+
*/
|
|
69
|
+
handleJumperStep(step: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* 设置当前页
|
|
72
|
+
*/
|
|
73
|
+
setCurrent(current: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* 获取当前页
|
|
76
|
+
*/
|
|
77
|
+
getCurrent(): number;
|
|
78
|
+
}
|
|
79
|
+
export default SolelyPagination;
|
|
80
|
+
export { SolelyPagination };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="$data.visiblePages" item="page">\n <If test="page !== \'...\'">\n <span\n class="pagination__item"\n :class="this.getItemClasses(page)"\n @click="this.handlePageClick(page, event)"\n >\n {{page}}\n </span>\n </If>\n <If test="page === \'...\'">\n <span class="pagination__ellipsis">...</span>\n </If>\n </For>\n\n \x3c!-- 下一页 --\x3e\n <span\n class="pagination__next"\n :class="this.getNextClasses()"\n @click="this.handleNext(event)"\n >\n >\n </span>\n\n \x3c!-- 每页条数选择器 --\x3e\n <If test="$data.showSizeChanger">\n <span class="pagination__size-changer">\n <select @change="this.handleSizeChange(event)">\n <For each="$data.parsedPageSizeOptions" item="size">\n <option\n :value="size"\n :selected="size === $data.pageSize"\n >\n {{size}} 条/页\n </option>\n </For>\n </select>\n </span>\n </If>\n\n \x3c!-- 快速跳转 --\x3e\n <If test="$data.showQuickJumper">\n <span class="pagination__jumper">\n 跳至\n <span class="pagination__jumper-input-wrapper">\n <input\n type="number"\n min="1"\n :max="$data.totalPages"\n s-model="$data.jumperValue"\n @keydown="this.handleJumperKeydown(event)"\n />\n <span class="pagination__jumper-controls">\n <span class="pagination__jumper-up" @click="this.handleJumperStep(1)">▲</span>\n <span class="pagination__jumper-down" @click="this.handleJumperStep(-1)">▼</span>\n </span>\n </span>\n 页\n </span>\n </If>\n</div>\n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const n='<div\n class="pagination"\n :class="this.getPaginationClasses()"\n>\n \x3c!-- 总数 --\x3e\n <If test="$data.showTotal">\n <span class="pagination__total">\n 共 {{$data.total}} 条\n </span>\n </If>\n\n \x3c!-- 上一页 --\x3e\n <span\n class="pagination__prev"\n :class="this.getPrevClasses()"\n @click="this.handlePrev(event)"\n >\n <\n </span>\n\n \x3c!-- 页码 --\x3e\n <For each="$data.visiblePages" item="page">\n <If test="page !== \'...\'">\n <span\n class="pagination__item"\n :class="this.getItemClasses(page)"\n @click="this.handlePageClick(page, event)"\n >\n {{page}}\n </span>\n </If>\n <If test="page === \'...\'">\n <span class="pagination__ellipsis">...</span>\n </If>\n </For>\n\n \x3c!-- 下一页 --\x3e\n <span\n class="pagination__next"\n :class="this.getNextClasses()"\n @click="this.handleNext(event)"\n >\n >\n </span>\n\n \x3c!-- 每页条数选择器 --\x3e\n <If test="$data.showSizeChanger">\n <span class="pagination__size-changer">\n <select @change="this.handleSizeChange(event)">\n <For each="$data.parsedPageSizeOptions" item="size">\n <option\n :value="size"\n :selected="size === $data.pageSize"\n >\n {{size}} 条/页\n </option>\n </For>\n </select>\n </span>\n </If>\n\n \x3c!-- 快速跳转 --\x3e\n <If test="$data.showQuickJumper">\n <span class="pagination__jumper">\n 跳至\n <span class="pagination__jumper-input-wrapper">\n <input\n type="number"\n min="1"\n :max="$data.totalPages"\n s-model="$data.jumperValue"\n @keydown="this.handleJumperKeydown(event)"\n />\n <span class="pagination__jumper-controls">\n <span class="pagination__jumper-up" @click="this.handleJumperStep(1)">▲</span>\n <span class="pagination__jumper-down" @click="this.handleJumperStep(-1)">▼</span>\n </span>\n </span>\n 页\n </span>\n </If>\n</div>\n';export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./style.css.js";import t from"./index.html.js";import a from"../../../runtime/component/base-element.js";import{CustomElement as s}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let i=class extends a{get current(){return this.$data.current}set current(e){this.$data.current=e,this.calculateVisiblePages(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}get pageSize(){return this.$data.pageSize}set pageSize(e){this.$data.pageSize=e,this.calculateVisiblePages(),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}getPaginationClasses(){const e={};return"small"===this.$data.size?e["pagination--sm"]=!0:"large"===this.$data.size?e["pagination--lg"]=!0:e["pagination--md"]=!0,e["is-disabled"]=!!this.$data.disabled,e}getPrevClasses(){return{"pagination__item--disabled":(this.$data.current||1)<=1}}getNextClasses(){return{"pagination__item--disabled":(this.$data.current||1)>=this.totalPages}}getItemClasses(e){return{"pagination__item--active":e===this.$data.current}}mounted(){this.$data.jumperValue="",this.parsePageSizeOptions(),this.calculateVisiblePages()}parsePageSizeOptions(){try{this.$data.parsedPageSizeOptions=JSON.parse(this.$data.pageSizeOptions||"[10, 20, 50, 100]")}catch{this.$data.parsedPageSizeOptions=[10,20,50,100]}}get totalPages(){return Math.ceil((this.$data.total||0)/(this.$data.pageSize||10))}calculateVisiblePages(){const e=this.$data.current||1,t=this.totalPages,a=[];if(t<=7)for(let s=1;s<=t;s++)a.push(s);else e<=3?a.push(1,2,3,4,5,"...",t):e>=t-2?a.push(1,"...",t-4,t-3,t-2,t-1,t):a.push(1,"...",e-1,e,e+1,"...",t);this.$data.visiblePages=a}handlePageClick(e){this.$data.disabled||e===this.$data.current||(this.$data.current=e,this.calculateVisiblePages(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{current:e,pageSize:this.$data.pageSize}})))}handlePrev(){this.$data.disabled||this.$data.current<=1||this.handlePageClick(this.$data.current-1)}handleNext(){this.$data.disabled||this.$data.current>=this.totalPages||this.handlePageClick(this.$data.current+1)}handleSizeChange(e){if(this.$data.disabled)return;const t=e.target,a=parseInt(t.value,10);this.$data.pageSize=a,this.$data.current=1,this.calculateVisiblePages(),this.dispatchEvent(new CustomEvent("showSizeChange",{bubbles:!0,composed:!0,detail:{current:1,pageSize:a}}))}handleJumperKeydown(e){if("Enter"!==e.key)return;const t=e.target,a=parseInt(t.value,10);a>=1&&a<=this.totalPages&&this.handlePageClick(a),this.$data.jumperValue=""}handleJumperStep(e){if(this.$data.disabled)return;const t=this.$data.current+e;t>=1&&t<=this.totalPages&&(this.handlePageClick(t),this.$data.jumperValue=String(t))}setCurrent(e){this.$data.current=e,this.calculateVisiblePages()}getCurrent(){return this.$data.current}};i=((e,t)=>{for(var a,s=t,i=e.length-1;i>=0;i--)(a=e[i])&&(s=a(s)||s);return s})([s({tagName:"solely-pagination",template:t,styles:e,shadowDOM:{use:!0,mode:"open"},props:[{name:"current",type:"number",default:1},{name:"total",type:"number",default:0},{name:"pageSize",type:"number",default:10},{name:"size",type:"string",default:"default"},{name:"simple",type:"boolean",default:!1},{name:"showQuickJumper",type:"boolean",default:!1},{name:"showSizeChanger",type:"boolean",default:!1},{name:"pageSizeOptions",type:"string",default:"[10, 20, 50, 100]"},{name:"disabled",type:"boolean",default:!1},{name:"showTotal",type:"boolean",default:!1}]})],i);export{i as SolelyPagination};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default="*,*:before,*:after{box-sizing:border-box}:host{display:block}.pagination{display:flex;align-items:center;gap:var(--solely-spacing-xs);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md)}.pagination__item{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);padding:0 var(--solely-spacing-sm);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration);-webkit-user-select:none;user-select:none}.pagination__item:hover:not(.pagination__item--disabled):not(.pagination__item--active){color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__item--active{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__item--disabled{cursor:not-allowed;color:var(--solely-text-tertiary);background-color:var(--solely-gray-2)}.pagination__prev,.pagination__next{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);padding:0 var(--solely-spacing-sm);color:var(--solely-text-secondary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration);-webkit-user-select:none;user-select:none}.pagination__prev:hover:not(.pagination__item--disabled),.pagination__next:hover:not(.pagination__item--disabled){color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);color:var(--solely-text-tertiary);-webkit-user-select:none;user-select:none}.pagination__jumper{display:inline-flex;align-items:center;gap:var(--solely-spacing-xs);margin-left:var(--solely-spacing-md);color:var(--solely-text-secondary)}.pagination__jumper input::-webkit-inner-spin-button,.pagination__jumper input::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.pagination__jumper input[type=number]{-webkit-appearance:none;appearance:none;-moz-appearance:textfield}.pagination__jumper-input-wrapper{position:relative;display:inline-flex;align-items:center}.pagination__jumper-input-wrapper input{width:50px;height:var(--solely-height-md);padding:0 20px 0 var(--solely-spacing-sm);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);text-align:center;font-size:var(--solely-font-size-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);transition:all var(--solely-transition-duration)}.pagination__jumper-input-wrapper input:focus{outline:none;border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.pagination__jumper-controls{position:absolute;right:2px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;height:var(--solely-height-sm);width:16px}.pagination__jumper-up,.pagination__jumper-down{flex:1;display:flex;align-items:center;justify-content:center;font-size:8px;color:var(--solely-text-secondary);background-color:var(--solely-component-bg);cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1}.pagination__jumper-up:hover,.pagination__jumper-down:hover{color:var(--solely-primary);background-color:var(--solely-gray-2)}.pagination__jumper-up{border-radius:2px 2px 0 0}.pagination__jumper-down{border-radius:0 0 2px 2px}.pagination__size-changer{margin-left:var(--solely-spacing-md)}.pagination__size-changer select{height:var(--solely-height-md);padding:0 var(--solely-spacing-md) 0 var(--solely-spacing-sm);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);font-size:var(--solely-font-size-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);cursor:pointer;transition:all var(--solely-transition-duration)}.pagination__size-changer select:focus{outline:none;border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.pagination__size-changer option{color:var(--solely-text-primary);background-color:var(--solely-component-bg)}.pagination__total{margin-right:var(--solely-spacing-md);color:var(--solely-text-secondary)}.pagination--simple .pagination__item,.pagination--simple .pagination__prev,.pagination--simple .pagination__next{border:none;background:transparent}.pagination--simple .pagination__item--active{color:var(--solely-primary);background:transparent}.pagination--md .pagination__item,.pagination--md .pagination__prev,.pagination--md .pagination__next,.pagination--md .pagination__ellipsis{min-width:var(--solely-height-md);height:var(--solely-height-md);font-size:var(--solely-font-size-md)}.pagination--md .pagination__jumper input,.pagination--md .pagination__size-changer select{height:var(--solely-height-md);font-size:var(--solely-font-size-md)}.pagination--lg .pagination__item,.pagination--lg .pagination__prev,.pagination--lg .pagination__next,.pagination--lg .pagination__ellipsis{min-width:var(--solely-height-lg);height:var(--solely-height-lg);font-size:var(--solely-font-size-lg)}.pagination--lg .pagination__jumper input,.pagination--lg .pagination__size-changer select{height:var(--solely-height-lg);font-size:var(--solely-font-size-lg)}.pagination--sm .pagination__item,.pagination--sm .pagination__prev,.pagination--sm .pagination__next,.pagination--sm .pagination__ellipsis{min-width:var(--solely-height-sm);height:var(--solely-height-sm);font-size:var(--solely-font-size-sm)}.pagination--sm .pagination__jumper input,.pagination--sm .pagination__size-changer select{height:var(--solely-height-sm);font-size:var(--solely-font-size-sm)}.pagination.is-disabled{opacity:.6;pointer-events:none}";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i="*,*:before,*:after{box-sizing:border-box}:host{display:block}.pagination{display:flex;align-items:center;gap:var(--solely-spacing-xs);font-family:var(--solely-font-family);font-size:var(--solely-font-size-md)}.pagination__item{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);padding:0 var(--solely-spacing-sm);color:var(--solely-text-primary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration);-webkit-user-select:none;user-select:none}.pagination__item:hover:not(.pagination__item--disabled):not(.pagination__item--active){color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__item--active{color:var(--solely-white);background-color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__item--disabled{cursor:not-allowed;color:var(--solely-text-tertiary);background-color:var(--solely-gray-2)}.pagination__prev,.pagination__next{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);padding:0 var(--solely-spacing-sm);color:var(--solely-text-secondary);background-color:var(--solely-component-bg);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);cursor:pointer;transition:all var(--solely-transition-duration);-webkit-user-select:none;user-select:none}.pagination__prev:hover:not(.pagination__item--disabled),.pagination__next:hover:not(.pagination__item--disabled){color:var(--solely-primary);border-color:var(--solely-primary)}.pagination__ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:var(--solely-height-md);height:var(--solely-height-md);color:var(--solely-text-tertiary);-webkit-user-select:none;user-select:none}.pagination__jumper{display:inline-flex;align-items:center;gap:var(--solely-spacing-xs);margin-left:var(--solely-spacing-md);color:var(--solely-text-secondary)}.pagination__jumper input::-webkit-inner-spin-button,.pagination__jumper input::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;margin:0}.pagination__jumper input[type=number]{-webkit-appearance:none;appearance:none;-moz-appearance:textfield}.pagination__jumper-input-wrapper{position:relative;display:inline-flex;align-items:center}.pagination__jumper-input-wrapper input{width:50px;height:var(--solely-height-md);padding:0 20px 0 var(--solely-spacing-sm);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);text-align:center;font-size:var(--solely-font-size-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);transition:all var(--solely-transition-duration)}.pagination__jumper-input-wrapper input:focus{outline:none;border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.pagination__jumper-controls{position:absolute;right:2px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;height:var(--solely-height-sm);width:16px}.pagination__jumper-up,.pagination__jumper-down{flex:1;display:flex;align-items:center;justify-content:center;font-size:8px;color:var(--solely-text-secondary);background-color:var(--solely-component-bg);cursor:pointer;-webkit-user-select:none;user-select:none;line-height:1}.pagination__jumper-up:hover,.pagination__jumper-down:hover{color:var(--solely-primary);background-color:var(--solely-gray-2)}.pagination__jumper-up{border-radius:2px 2px 0 0}.pagination__jumper-down{border-radius:0 0 2px 2px}.pagination__size-changer{margin-left:var(--solely-spacing-md)}.pagination__size-changer select{height:var(--solely-height-md);padding:0 var(--solely-spacing-md) 0 var(--solely-spacing-sm);border:1px solid var(--solely-border-color);border-radius:var(--solely-border-radius-md);font-size:var(--solely-font-size-md);color:var(--solely-text-primary);background-color:var(--solely-component-bg);cursor:pointer;transition:all var(--solely-transition-duration)}.pagination__size-changer select:focus{outline:none;border-color:var(--solely-primary);box-shadow:0 0 0 2px var(--solely-primary-light)}.pagination__size-changer option{color:var(--solely-text-primary);background-color:var(--solely-component-bg)}.pagination__total{margin-right:var(--solely-spacing-md);color:var(--solely-text-secondary)}.pagination--simple .pagination__item,.pagination--simple .pagination__prev,.pagination--simple .pagination__next{border:none;background:transparent}.pagination--simple .pagination__item--active{color:var(--solely-primary);background:transparent}.pagination--md .pagination__item,.pagination--md .pagination__prev,.pagination--md .pagination__next,.pagination--md .pagination__ellipsis{min-width:var(--solely-height-md);height:var(--solely-height-md);font-size:var(--solely-font-size-md)}.pagination--md .pagination__jumper input,.pagination--md .pagination__size-changer select{height:var(--solely-height-md);font-size:var(--solely-font-size-md)}.pagination--lg .pagination__item,.pagination--lg .pagination__prev,.pagination--lg .pagination__next,.pagination--lg .pagination__ellipsis{min-width:var(--solely-height-lg);height:var(--solely-height-lg);font-size:var(--solely-font-size-lg)}.pagination--lg .pagination__jumper input,.pagination--lg .pagination__size-changer select{height:var(--solely-height-lg);font-size:var(--solely-font-size-lg)}.pagination--sm .pagination__item,.pagination--sm .pagination__prev,.pagination--sm .pagination__next,.pagination--sm .pagination__ellipsis{min-width:var(--solely-height-sm);height:var(--solely-height-sm);font-size:var(--solely-font-size-sm)}.pagination--sm .pagination__jumper input,.pagination--sm .pagination__size-changer select{height:var(--solely-height-sm);font-size:var(--solely-font-size-sm)}.pagination.is-disabled{opacity:.6;pointer-events:none}";export{i as default};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pagination 组件类型定义
|
|
3
|
+
*/
|
|
4
|
+
export type PaginationSize = 'small' | 'default' | 'large';
|
|
5
|
+
export interface PaginationProps {
|
|
6
|
+
/** 当前页码 */
|
|
7
|
+
current: number;
|
|
8
|
+
/** 数据总数 */
|
|
9
|
+
total: number;
|
|
10
|
+
/** 每页条数 */
|
|
11
|
+
pageSize: number;
|
|
12
|
+
/** 组件尺寸 */
|
|
13
|
+
size: PaginationSize;
|
|
14
|
+
/** 是否显示较少页面内容 */
|
|
15
|
+
simple: boolean;
|
|
16
|
+
/** 是否显示快速跳转 */
|
|
17
|
+
showQuickJumper: boolean;
|
|
18
|
+
/** 是否显示用于改变页数 */
|
|
19
|
+
showSizeChanger: boolean;
|
|
20
|
+
/** 指定每页可以显示多少条 */
|
|
21
|
+
pageSizeOptions: string;
|
|
22
|
+
/** 是否禁用 */
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
/** 是否显示总数据 */
|
|
25
|
+
showTotal: boolean;
|
|
26
|
+
/** 快速跳转输入值 */
|
|
27
|
+
jumperValue?: string;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./style.css.cjs"),t=require("./index.html.cjs"),s=require("../../../runtime/component/base-element.cjs"),r=require("../../../runtime/component/decorators.cjs");Object.getOwnPropertyDescriptor;exports.SolelyProgress=class extends s.default{getProgressClasses(){const e={};return this.$data.type&&(e[`progress--${this.$data.type}`]=!0),e}getInnerClasses(){const e={};return this.$data.status&&(e[`progress__inner--${this.$data.status}`]=!0),e}getCirclePathClasses(){const e={};return this.$data.status&&(e[`progress__circle-path--${this.$data.status}`]=!0),e}get clampedPercent(){return Math.max(0,Math.min(100,this.$data.percent||0))}get circleCircumference(){const e=((this.$data.width||120)-(this.$data.strokeWidth||6))/2;return 2*Math.PI*e}get circleOffset(){return this.circleCircumference*(1-this.clampedPercent/100)}getText(){return"success"===this.$data.status?"✓":"exception"===this.$data.status?"✕":`${Math.round(this.clampedPercent)}%`}setPercent(e){this.$data.percent=e}getPercent(){return this.clampedPercent}},exports.SolelyProgress=((e,t)=>{for(var s,r=t,a=e.length-1;a>=0;a--)(s=e[a])&&(r=s(r)||r);return r})([r.CustomElement({tagName:"solely-progress",template:t.default,styles:e.default,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"line"},{name:"percent",type:"number",default:0},{name:"status",type:"string",default:"normal"},{name:"showInfo",type:"boolean",default:!0},{name:"strokeWidth",type:"number",default:8},{name:"width",type:"number",default:120},{name:"format",type:"string",default:""}]})],exports.SolelyProgress);
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { BaseElement } from '../../../runtime/component';
|
|
2
|
+
import { ProgressProps } from './types';
|
|
3
|
+
declare class SolelyProgress extends BaseElement<ProgressProps> {
|
|
4
|
+
/**
|
|
5
|
+
* 获取 progress class 对象
|
|
6
|
+
*/
|
|
7
|
+
getProgressClasses(): Record<string, boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* 获取 inner class 对象
|
|
10
|
+
*/
|
|
11
|
+
getInnerClasses(): Record<string, boolean>;
|
|
12
|
+
/**
|
|
13
|
+
* 获取 circle path class 对象
|
|
14
|
+
*/
|
|
15
|
+
getCirclePathClasses(): Record<string, boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* 获取限制在 0-100 之间的百分比
|
|
18
|
+
*/
|
|
19
|
+
get clampedPercent(): number;
|
|
20
|
+
/**
|
|
21
|
+
* 获取圆形进度条的周长
|
|
22
|
+
*/
|
|
23
|
+
get circleCircumference(): number;
|
|
24
|
+
/**
|
|
25
|
+
* 获取圆形进度条的偏移量
|
|
26
|
+
*/
|
|
27
|
+
get circleOffset(): number;
|
|
28
|
+
/**
|
|
29
|
+
* 获取显示的文本
|
|
30
|
+
*/
|
|
31
|
+
getText(): string;
|
|
32
|
+
/**
|
|
33
|
+
* 设置进度
|
|
34
|
+
*/
|
|
35
|
+
setPercent(percent: number): void;
|
|
36
|
+
/**
|
|
37
|
+
* 获取进度
|
|
38
|
+
*/
|
|
39
|
+
getPercent(): number;
|
|
40
|
+
}
|
|
41
|
+
export default SolelyProgress;
|
|
42
|
+
export { SolelyProgress };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),exports.default='<div\n class="progress"\n :class="this.getProgressClasses()"\n>\n \x3c!-- 线性进度条 --\x3e\n <If test="$data.type === \'line\'">\n <div class="progress__outer" :style="\'height: \' + ($data.strokeWidth || 8) + \'px\'">\n <div\n class="progress__inner"\n :class="this.getInnerClasses()"\n :style="\'width: \' + this.clampedPercent + \'%\'"\n ></div>\n </div>\n <If test="$data.showInfo">\n <span class="progress__text">{{this.getText()}}</span>\n </If>\n </If>\n\n \x3c!-- 圆形进度条 --\x3e\n <If test="$data.type === \'circle\'">\n <svg\n class="progress__circle"\n :width="$data.width || 120"\n :height="$data.width || 120"\n :viewBox="\'0 0 \' + ($data.width || 120) + \' \' + ($data.width || 120)"\n >\n <circle\n class="progress__circle-track"\n :cx="($data.width || 120) / 2"\n :cy="($data.width || 120) / 2"\n :r="(($data.width || 120) - ($data.strokeWidth || 6)) / 2"\n :stroke-width="$data.strokeWidth || 6"\n />\n <circle\n class="progress__circle-path"\n :class="this.getCirclePathClasses()"\n :cx="($data.width || 120) / 2"\n :cy="($data.width || 120) / 2"\n :r="(($data.width || 120) - ($data.strokeWidth || 6)) / 2"\n :stroke-width="$data.strokeWidth || 6"\n :stroke-dasharray="this.circleCircumference"\n :stroke-dashoffset="this.circleOffset"\n />\n </svg>\n <If test="$data.showInfo">\n <span class="progress__circle-text">{{this.getText()}}</span>\n </If>\n </If>\n</div>\n';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t='<div\n class="progress"\n :class="this.getProgressClasses()"\n>\n \x3c!-- 线性进度条 --\x3e\n <If test="$data.type === \'line\'">\n <div class="progress__outer" :style="\'height: \' + ($data.strokeWidth || 8) + \'px\'">\n <div\n class="progress__inner"\n :class="this.getInnerClasses()"\n :style="\'width: \' + this.clampedPercent + \'%\'"\n ></div>\n </div>\n <If test="$data.showInfo">\n <span class="progress__text">{{this.getText()}}</span>\n </If>\n </If>\n\n \x3c!-- 圆形进度条 --\x3e\n <If test="$data.type === \'circle\'">\n <svg\n class="progress__circle"\n :width="$data.width || 120"\n :height="$data.width || 120"\n :viewBox="\'0 0 \' + ($data.width || 120) + \' \' + ($data.width || 120)"\n >\n <circle\n class="progress__circle-track"\n :cx="($data.width || 120) / 2"\n :cy="($data.width || 120) / 2"\n :r="(($data.width || 120) - ($data.strokeWidth || 6)) / 2"\n :stroke-width="$data.strokeWidth || 6"\n />\n <circle\n class="progress__circle-path"\n :class="this.getCirclePathClasses()"\n :cx="($data.width || 120) / 2"\n :cy="($data.width || 120) / 2"\n :r="(($data.width || 120) - ($data.strokeWidth || 6)) / 2"\n :stroke-width="$data.strokeWidth || 6"\n :stroke-dasharray="this.circleCircumference"\n :stroke-dashoffset="this.circleOffset"\n />\n </svg>\n <If test="$data.showInfo">\n <span class="progress__circle-text">{{this.getText()}}</span>\n </If>\n </If>\n</div>\n';export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./style.css.js";import e from"./index.html.js";import s from"../../../runtime/component/base-element.js";import{CustomElement as r}from"../../../runtime/component/decorators.js";Object.getOwnPropertyDescriptor;let a=class extends s{getProgressClasses(){const t={};return this.$data.type&&(t[`progress--${this.$data.type}`]=!0),t}getInnerClasses(){const t={};return this.$data.status&&(t[`progress__inner--${this.$data.status}`]=!0),t}getCirclePathClasses(){const t={};return this.$data.status&&(t[`progress__circle-path--${this.$data.status}`]=!0),t}get clampedPercent(){return Math.max(0,Math.min(100,this.$data.percent||0))}get circleCircumference(){const t=((this.$data.width||120)-(this.$data.strokeWidth||6))/2;return 2*Math.PI*t}get circleOffset(){return this.circleCircumference*(1-this.clampedPercent/100)}getText(){return"success"===this.$data.status?"✓":"exception"===this.$data.status?"✕":`${Math.round(this.clampedPercent)}%`}setPercent(t){this.$data.percent=t}getPercent(){return this.clampedPercent}};a=((t,e)=>{for(var s,r=e,a=t.length-1;a>=0;a--)(s=t[a])&&(r=s(r)||r);return r})([r({tagName:"solely-progress",template:e,styles:t,shadowDOM:{use:!0,mode:"open"},props:[{name:"type",type:"string",default:"line"},{name:"percent",type:"number",default:0},{name:"status",type:"string",default:"normal"},{name:"showInfo",type:"boolean",default:!0},{name:"strokeWidth",type:"number",default:8},{name:"width",type:"number",default:120},{name:"format",type:"string",default:""}]})],a);export{a as SolelyProgress};
|