ranui 0.1.0-alpha → 0.1.1-alpha.12
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/LICENSE +21 -0
- package/dist/_commonjs-dynamic-modules-2ceabb0b.js +12 -0
- package/dist/add-user-d07564bd.js +4 -0
- package/dist/book-2a5a596c.js +4 -0
- package/dist/check-circle-2c986969.js +4 -0
- package/dist/check-circle-fill-62eaa796.js +4 -0
- package/dist/close-circle-2afb6e94.js +4 -0
- package/dist/close-circle-fill-b6906239.js +4 -0
- package/dist/close-ee3ba1d1.js +4 -0
- package/dist/colz-746223ab.js +241 -0
- package/dist/components/button/index.d.ts +331 -1
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/input/index.d.ts +435 -1
- package/dist/components/message/index.d.ts +8 -0
- package/dist/components/preview/colz.d.ts +72 -0
- package/dist/components/preview/docx.d.ts +8 -0
- package/dist/components/preview/excel/excel.d.ts +11 -0
- package/dist/components/preview/excel/index.d.ts +1 -0
- package/dist/components/preview/excel/media.d.ts +37 -0
- package/dist/components/preview/index.d.ts +2 -0
- package/dist/components/preview/pdf.d.ts +1 -0
- package/dist/components/preview/pptx/index.d.ts +16 -0
- package/dist/components/preview/pptx/process_pptx.d.ts +23 -0
- package/dist/components/preview/pptx/t_xml.d.ts +1 -0
- package/dist/components/preview/pptx/worker.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/tabpane/index.d.ts +327 -0
- package/dist/components/tabs/index.d.ts +382 -1
- package/dist/components/video/index.d.ts +393 -0
- package/dist/docx-a71f9b36.js +2635 -0
- package/dist/eye-bd60afe1.js +4 -0
- package/dist/eye-close-bde3c1fc.js +4 -0
- package/dist/home-f824d8f4.js +4 -0
- package/dist/index-b14db636.js +23075 -0
- package/dist/index-d9a6fb36.js +1756 -0
- package/dist/index-eca1b437.js +85583 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +11 -676
- package/dist/index.umd.cjs +53 -2
- package/dist/info-circle-59333e1c.js +4 -0
- package/dist/info-circle-fill-3ab7660d.js +4 -0
- package/dist/jszip.min-97cf7c6a.js +2655 -0
- package/dist/loading-407d8249.js +4 -0
- package/dist/lock-6d20715b.js +4 -0
- package/dist/message-ee4fe153.js +4 -0
- package/dist/pdf-f6057747.js +112 -0
- package/dist/playwright.config.d.ts +11 -0
- package/dist/plugins/auto-import-file.d.ts +10 -0
- package/dist/plugins/load-style.d.ts +6 -0
- package/dist/plugins/load-svg.d.ts +9 -0
- package/dist/power-off-bbec6b5f.js +4 -0
- package/dist/preview-164a4944.js +4 -0
- package/dist/setting-735a1963.js +4 -0
- package/dist/style.css +1 -1
- package/dist/team-42573142.js +4 -0
- package/dist/tests/button.spec.d.ts +1 -0
- package/dist/unlock-ae33c6f7.js +4 -0
- package/dist/user-b7098183.js +4 -0
- package/dist/utils/index.d.ts +34 -4
- package/dist/vite.config.d.ts +2 -0
- package/dist/warning-circle-536d4749.js +4 -0
- package/dist/warning-circle-fill-e4be98bc.js +4 -0
- package/package.json +51 -17
- package/readme.md +71 -0
- package/.vitepress/config.ts +0 -26
- package/.vitepress/theme/index.ts +0 -9
- package/assets/image/failImage.ts +0 -4
- package/assets/svgs/check-circle.svg +0 -4
- package/assets/svgs/close-circle.svg +0 -4
- package/assets/svgs/eye-close.svg +0 -4
- package/assets/svgs/eye.svg +0 -4
- package/assets/svgs/info-circle.svg +0 -5
- package/assets/svgs/lock.svg +0 -4
- package/assets/svgs/unlock.svg +0 -4
- package/assets/svgs/user.svg +0 -3
- package/components/button/index.less +0 -95
- package/components/button/index.ts +0 -64
- package/components/form/index.ts +0 -36
- package/components/image/index.less +0 -0
- package/components/image/index.ts +0 -62
- package/components/input/index.less +0 -114
- package/components/input/index.ts +0 -367
- package/components/modal/index.less +0 -0
- package/components/modal/index.ts +0 -118
- package/components/tabPane/index.less +0 -0
- package/components/tabPane/index.ts +0 -71
- package/components/tabs/index.less +0 -47
- package/components/tabs/index.ts +0 -207
- package/dist/index.js.map +0 -1
- package/dist/index.umd.cjs.map +0 -1
- package/dist/typings.d.ts +0 -4
- package/docs/button/index.md +0 -25
- package/docs/image/index.md +0 -9
- package/docs/input/index.md +0 -146
- package/docs/tabs/index.md +0 -121
- package/index.html +0 -67
- package/index.md +0 -1
- package/index.ts +0 -6
- package/plugins/auto-import-file.ts +0 -59
- package/plugins/load-style.ts +0 -31
- package/tsconfig.json +0 -31
- package/typings.d.ts +0 -4
- package/utils/index.ts +0 -12
- package/vite.config.ts +0 -58
- /package/{components/form/index.less → dist/component.d.ts} +0 -0
- /package/dist/components/{tabPane → form}/index.d.ts +0 -0
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
font-weight: 400;
|
|
5
|
-
white-space: nowrap;
|
|
6
|
-
text-align: center;
|
|
7
|
-
background-image: none;
|
|
8
|
-
border: 1px solid transparent;
|
|
9
|
-
box-shadow: 0 2px #00000004;
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
12
|
-
-webkit-user-select: none;
|
|
13
|
-
-moz-user-select: none;
|
|
14
|
-
-ms-user-select: none;
|
|
15
|
-
user-select: none;
|
|
16
|
-
touch-action: manipulation;
|
|
17
|
-
line-height: 22px;
|
|
18
|
-
font-size: 14px;
|
|
19
|
-
border-radius: 2px;
|
|
20
|
-
color: #000000d9;
|
|
21
|
-
border-color: #d9d9d9;
|
|
22
|
-
background: #fff;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
pointer-events: auto;
|
|
25
|
-
&,
|
|
26
|
-
&(:active),
|
|
27
|
-
&(:focus) {
|
|
28
|
-
outline: 0;
|
|
29
|
-
}
|
|
30
|
-
&(:not([disabled]):hover) {
|
|
31
|
-
border-color: #1890ff;
|
|
32
|
-
color: #1890ff;
|
|
33
|
-
}
|
|
34
|
-
&([type="primary"]) {
|
|
35
|
-
border-color: #1890ff;
|
|
36
|
-
background-color: #1890ff;
|
|
37
|
-
color: #fff;
|
|
38
|
-
}
|
|
39
|
-
&([type="primary"]:not([disabled]))::after {
|
|
40
|
-
background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
|
|
41
|
-
}
|
|
42
|
-
&([type="primary"]:not([disabled]):hover) {
|
|
43
|
-
background-color: #40a9ff;
|
|
44
|
-
color: #fff;
|
|
45
|
-
}
|
|
46
|
-
&([type="warning"]) {
|
|
47
|
-
border-color: #ff4d4f;
|
|
48
|
-
background-color: #ff4d4f;
|
|
49
|
-
color: #fff;
|
|
50
|
-
}
|
|
51
|
-
&([type="warning"]:not([disabled]))::after {
|
|
52
|
-
background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
|
|
53
|
-
}
|
|
54
|
-
&([type="warning"]:not([disabled]):hover) {
|
|
55
|
-
border-color: #ff4d4f;
|
|
56
|
-
background-color: #ff4d4f;
|
|
57
|
-
color: #fff;
|
|
58
|
-
}
|
|
59
|
-
&([type="text"]) {
|
|
60
|
-
border: none;
|
|
61
|
-
}
|
|
62
|
-
&([disabled]) {
|
|
63
|
-
cursor: not-allowed;
|
|
64
|
-
pointer-events: all;
|
|
65
|
-
opacity: 0.6;
|
|
66
|
-
}
|
|
67
|
-
&(:not([disabled]):active)::after {
|
|
68
|
-
transform: translate(-50%, -50%) scale(0);
|
|
69
|
-
opacity: 0.3;
|
|
70
|
-
transition: 0s;
|
|
71
|
-
}
|
|
72
|
-
&(:active) .btn::before {
|
|
73
|
-
opacity: 0.2;
|
|
74
|
-
}
|
|
75
|
-
&(:not([disabled]))::after {
|
|
76
|
-
content: "";
|
|
77
|
-
display: block;
|
|
78
|
-
position: absolute;
|
|
79
|
-
width: 100%;
|
|
80
|
-
height: 100%;
|
|
81
|
-
left: var(--ran-x, 0);
|
|
82
|
-
top: var(--ran-y, 0);
|
|
83
|
-
pointer-events: none;
|
|
84
|
-
background-image: radial-gradient(circle, #1890ff 10%, transparent 10.01%);
|
|
85
|
-
background-repeat: no-repeat;
|
|
86
|
-
background-position: 50%;
|
|
87
|
-
transform: translate(-50%, -50%) scale(10);
|
|
88
|
-
opacity: 0;
|
|
89
|
-
transition: transform 0.3s, opacity 0.8s;
|
|
90
|
-
}
|
|
91
|
-
.slot {
|
|
92
|
-
display: block;
|
|
93
|
-
margin: 4px 15px;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { isDisabled } from '@/utils/index'
|
|
2
|
-
|
|
3
|
-
class CustomElement extends HTMLElement {
|
|
4
|
-
static get observedAttributes() {
|
|
5
|
-
return ["disabled", "type"];
|
|
6
|
-
}
|
|
7
|
-
_btn: HTMLDivElement;
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
const slot = document.createElement("slot");
|
|
11
|
-
this._btn = document.createElement("div");
|
|
12
|
-
this._btn.appendChild(slot);
|
|
13
|
-
slot.setAttribute("class", "slot");
|
|
14
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
15
|
-
shadowRoot.appendChild(this._btn);
|
|
16
|
-
}
|
|
17
|
-
get disabled() {
|
|
18
|
-
return isDisabled(this)
|
|
19
|
-
}
|
|
20
|
-
set disabled(value: boolean | string | undefined | null) {
|
|
21
|
-
if (!value || value === "false") {
|
|
22
|
-
this.removeAttribute("disabled");
|
|
23
|
-
} else {
|
|
24
|
-
this.setAttribute("disabled", '');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
mousedown = (event: MouseEvent) => {
|
|
28
|
-
if (!this.disabled || this.disabled === 'false') {
|
|
29
|
-
const { left, top } = this.getBoundingClientRect();
|
|
30
|
-
this.style.setProperty("--ran-x", event.clientX - left + "px");
|
|
31
|
-
this.style.setProperty("--ran-y", event.clientY - top + "px");
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
mouseLeave = () => {
|
|
35
|
-
this.style.removeProperty("--ran-x");
|
|
36
|
-
this.style.removeProperty("--ran-y");
|
|
37
|
-
};
|
|
38
|
-
connectedCallback() {
|
|
39
|
-
this._btn.addEventListener("mousedown", this.mousedown);
|
|
40
|
-
this._btn.addEventListener("mouseleave", this.mouseLeave);
|
|
41
|
-
}
|
|
42
|
-
disconnectCallback() {
|
|
43
|
-
this._btn.removeEventListener("mousedown", this.mousedown);
|
|
44
|
-
this._btn.removeEventListener("mouseleave", this.mouseLeave);
|
|
45
|
-
}
|
|
46
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string) {
|
|
47
|
-
if (name == "disabled" && this._btn) {
|
|
48
|
-
if (!newValue || newValue === "false") {
|
|
49
|
-
this._btn.setAttribute("disabled", '');
|
|
50
|
-
} else {
|
|
51
|
-
this._btn.removeAttribute("disabled");
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function Custom() {
|
|
59
|
-
if (!customElements.get("r-button")) {
|
|
60
|
-
customElements.define("r-button", CustomElement);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default Custom()
|
package/components/form/index.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
function Component() {
|
|
2
|
-
const template = document.createElement('template');
|
|
3
|
-
const slot = document.createElement('slot');
|
|
4
|
-
const form = document.createElement('form');
|
|
5
|
-
form.setAttribute('class', 'r-form');
|
|
6
|
-
slot.setAttribute('name', 'r-form_content');
|
|
7
|
-
form.appendChild(slot);
|
|
8
|
-
template.appendChild(form);
|
|
9
|
-
class CustomElement extends HTMLElement {
|
|
10
|
-
_form: HTMLFormElement;
|
|
11
|
-
constructor() {
|
|
12
|
-
super();
|
|
13
|
-
this._form = form.cloneNode(true) as HTMLFormElement
|
|
14
|
-
const shadowRoot = this.attachShadow({ mode: 'closed' });
|
|
15
|
-
const jsonData: Record<string, any> = {}
|
|
16
|
-
const formData = new FormData(this._form)
|
|
17
|
-
formData.forEach((value, key) => {
|
|
18
|
-
if (!jsonData[key]) {
|
|
19
|
-
jsonData[key] = formData.getAll(key).length > 1 ? formData.getAll(key) : formData.get(key);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
this._form.addEventListener("submit", () => {
|
|
23
|
-
this.value = JSON.stringify(jsonData)
|
|
24
|
-
});
|
|
25
|
-
shadowRoot.appendChild(this._form);
|
|
26
|
-
}
|
|
27
|
-
get value() {
|
|
28
|
-
return this.getAttribute("value");
|
|
29
|
-
}
|
|
30
|
-
set value(value) {
|
|
31
|
-
if (value !== null) this.setAttribute("value", value);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
window.customElements.define('r-form', CustomElement)
|
|
35
|
-
}
|
|
36
|
-
export default Component()
|
|
File without changes
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import failImage from "@/assets/image/failImage";
|
|
2
|
-
|
|
3
|
-
class CustomElement extends HTMLElement {
|
|
4
|
-
static get observedAttributes() {
|
|
5
|
-
return ["fallback"];
|
|
6
|
-
}
|
|
7
|
-
_image: HTMLImageElement | undefined;
|
|
8
|
-
_container: Element;
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
11
|
-
this._container = document.createElement("div");
|
|
12
|
-
this._container.setAttribute("class", "r-image");
|
|
13
|
-
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
14
|
-
shadowRoot.appendChild(this._container);
|
|
15
|
-
}
|
|
16
|
-
get fallback() {
|
|
17
|
-
return this.getAttribute("fallback");
|
|
18
|
-
}
|
|
19
|
-
set fallback(value) {
|
|
20
|
-
if (value) {
|
|
21
|
-
this.setAttribute("fallback", value);
|
|
22
|
-
} else {
|
|
23
|
-
this.removeAttribute("fallback");
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
listenFallback(name: string, value: string) {
|
|
28
|
-
if (name === "fallback" && this._image) {
|
|
29
|
-
if (value) {
|
|
30
|
-
this._image.setAttribute("fallback", value);
|
|
31
|
-
} else {
|
|
32
|
-
this._image.removeAttribute("fallback");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
connectedCallback() {
|
|
38
|
-
const src = this.getAttribute("src") || "";
|
|
39
|
-
this._image = new Image();
|
|
40
|
-
this._image.src = src;
|
|
41
|
-
this._image.addEventListener("error", () => {
|
|
42
|
-
if (this._image && this.fallback) {
|
|
43
|
-
this._image.src = this.fallback;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
this._image.addEventListener("load", () => {
|
|
47
|
-
if (this._image) {
|
|
48
|
-
this._container.appendChild(this._image);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
attributeChangedCallback(name: string, oldValue: string, newValue: string) {
|
|
53
|
-
this.listenFallback(name, newValue);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function Custom() {
|
|
57
|
-
if (!customElements.get("r-img")) {
|
|
58
|
-
customElements.define("r-img", CustomElement);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default Custom();
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
.input {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: inline-block;
|
|
4
|
-
width: 100%;
|
|
5
|
-
min-width: 0;
|
|
6
|
-
padding: 2px 8px;
|
|
7
|
-
color: #000000d9;
|
|
8
|
-
font-size: 12px;
|
|
9
|
-
line-height: 1.5715;
|
|
10
|
-
background-color: #fff;
|
|
11
|
-
background-image: none;
|
|
12
|
-
border: 1px solid #d9d9d9;
|
|
13
|
-
border-radius: 2px;
|
|
14
|
-
transition: all 0.3s;
|
|
15
|
-
&:active {
|
|
16
|
-
border-color: #40a9ff;
|
|
17
|
-
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
18
|
-
border-right-width: 1px;
|
|
19
|
-
outline: 0;
|
|
20
|
-
}
|
|
21
|
-
&:hover {
|
|
22
|
-
border-color: #40a9ff;
|
|
23
|
-
border-right-width: 1px;
|
|
24
|
-
}
|
|
25
|
-
& > .input-main:hover ~ .input-label {
|
|
26
|
-
color: #40a9ff;
|
|
27
|
-
}
|
|
28
|
-
&[value] > .input-label {
|
|
29
|
-
transform: translateY(calc(-50% - 0.43em)) scale(0.8);
|
|
30
|
-
color: #00000040;
|
|
31
|
-
}
|
|
32
|
-
&[disabled] {
|
|
33
|
-
color: #00000040;
|
|
34
|
-
background-color: #f5f5f5;
|
|
35
|
-
border-color: #d9d9d9;
|
|
36
|
-
box-shadow: none;
|
|
37
|
-
cursor: not-allowed;
|
|
38
|
-
opacity: 1;
|
|
39
|
-
& > .input-main {
|
|
40
|
-
color: #00000040;
|
|
41
|
-
background-color: #f5f5f5;
|
|
42
|
-
border-color: #d9d9d9;
|
|
43
|
-
box-shadow: none;
|
|
44
|
-
cursor: not-allowed;
|
|
45
|
-
opacity: 1;
|
|
46
|
-
}
|
|
47
|
-
& > .input-main:hover ~ .input-label {
|
|
48
|
-
color: #999;
|
|
49
|
-
}
|
|
50
|
-
& > .input-label {
|
|
51
|
-
color: #999;
|
|
52
|
-
border-color: #d9d9d9;
|
|
53
|
-
box-shadow: none;
|
|
54
|
-
cursor: not-allowed;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
&-main {
|
|
58
|
-
writing-mode: horizontal-tb;
|
|
59
|
-
text-rendering: auto;
|
|
60
|
-
letter-spacing: normal;
|
|
61
|
-
word-spacing: normal;
|
|
62
|
-
text-transform: none;
|
|
63
|
-
text-indent: 0px;
|
|
64
|
-
text-shadow: none;
|
|
65
|
-
text-align: start;
|
|
66
|
-
-webkit-rtl-ordering: logical;
|
|
67
|
-
cursor: text;
|
|
68
|
-
touch-action: manipulation;
|
|
69
|
-
-webkit-appearance: none;
|
|
70
|
-
text-overflow: ellipsis;
|
|
71
|
-
box-sizing: border-box;
|
|
72
|
-
margin: 0;
|
|
73
|
-
font-variant: tabular-nums;
|
|
74
|
-
list-style: none;
|
|
75
|
-
font-feature-settings: "tnum";
|
|
76
|
-
position: relative;
|
|
77
|
-
border: none;
|
|
78
|
-
width: 100%;
|
|
79
|
-
min-width: 0;
|
|
80
|
-
color: #000000d9;
|
|
81
|
-
font-size: 14px;
|
|
82
|
-
line-height: 1.5715;
|
|
83
|
-
background-color: #fff;
|
|
84
|
-
background-image: none;
|
|
85
|
-
transition: all 0.3s;
|
|
86
|
-
&:focus,
|
|
87
|
-
&:hover {
|
|
88
|
-
border: none;
|
|
89
|
-
outline: 0;
|
|
90
|
-
}
|
|
91
|
-
&::placeholder {
|
|
92
|
-
color: #999;
|
|
93
|
-
}
|
|
94
|
-
&:placeholder-shown ~ .input-label {
|
|
95
|
-
transform: translateY(calc(-50% - 0.43em)) scale(0.8);
|
|
96
|
-
}
|
|
97
|
-
&:focus ~ .input-label {
|
|
98
|
-
transform: translateY(calc(-50% - 0.43em)) scale(0.8);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
&-label {
|
|
102
|
-
pointer-events: none;
|
|
103
|
-
position: absolute;
|
|
104
|
-
font-size: 14px;
|
|
105
|
-
left: 8px;
|
|
106
|
-
transition: transform 0.3s, color 0.3s, background-color 0.3s;
|
|
107
|
-
transform-origin: left;
|
|
108
|
-
padding: 0 0.2em;
|
|
109
|
-
color: #999;
|
|
110
|
-
// background: #fff;
|
|
111
|
-
backdrop-filter: blur(10px);
|
|
112
|
-
opacity: 0.9;
|
|
113
|
-
}
|
|
114
|
-
}
|