ranui 0.1.8 → 0.1.9
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/dist/components/button/index.d.ts +33 -0
- package/dist/components/button/index.js +3 -2
- package/dist/components/icon/index.js +2 -2
- package/dist/components/image/index.js +1 -1
- package/dist/components/input/index.d.ts +183 -0
- package/dist/components/input/index.js +2 -1
- package/dist/components/message/index.js +1 -1
- package/dist/components/option/index.js +1 -1
- package/dist/components/player/index.d.ts +179 -490
- package/dist/components/player/index.js +6 -5
- package/dist/components/preview/index.js +4 -4
- package/dist/components/progress/index.js +2 -2
- package/dist/components/radar/index.js +2 -2
- package/dist/components/scratch/index.d.ts +19 -0
- package/dist/components/select/index.d.ts +5 -1
- package/dist/components/select/index.js +4 -4
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/tab/index.d.ts +5 -0
- package/dist/components/tab/index.js +2 -2
- package/dist/components/tabpane/index.d.ts +5 -0
- package/dist/components/tabpane/index.js +1 -1
- package/dist/{index-aea75a9f.js → index-01b17e26.js} +1 -1
- package/dist/{index-48653b79.js → index-0d5b9435.js} +1 -1
- package/dist/index-1048a998.js +447 -0
- package/dist/{index-f6d6982d.js → index-1b73beee.js} +65 -13
- package/dist/index-2d16a084.js +197 -0
- package/dist/{index-0e7229ea.js → index-3cf72afd.js} +8 -6
- package/dist/{index-a43b144f.js → index-4443363f.js} +1 -1
- package/dist/{index-a1a53af6.js → index-458debf7.js} +2 -2
- package/dist/{index-7f513a14.js → index-7216d6b0.js} +2 -2
- package/dist/index-73ce455b.js +264 -0
- package/dist/{index-d2d69b06.js → index-7913ec46.js} +27 -13
- package/dist/{index-5975bbc0.js → index-b7790662.js} +1 -1
- package/dist/{index-a216f328.js → index-c14450a9.js} +1 -1
- package/dist/{index-b90299ca.js → index-e03d23e7.js} +1 -1
- package/dist/{index-b2be6bef.js → index-e2e5d725.js} +1087 -1069
- package/dist/index.js +15 -15
- package/dist/style.css +1 -1
- package/dist/umd/components/button/index.d.ts +33 -0
- package/dist/umd/components/input/index.d.ts +183 -0
- package/dist/umd/components/player/index.d.ts +179 -490
- package/dist/umd/components/scratch/index.d.ts +19 -0
- package/dist/umd/components/select/index.d.ts +5 -1
- package/dist/umd/components/tab/index.d.ts +5 -0
- package/dist/umd/components/tabpane/index.d.ts +5 -0
- package/dist/umd/index.umd.cjs +6 -6
- package/dist/umd/style.css +1 -1
- package/package.json +5 -8
- package/dist/index-183517e7.js +0 -265
- package/dist/index-4d873a42.js +0 -195
- package/dist/index-ecaed5cc.js +0 -439
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { a } from "../../index-
|
|
3
|
-
import "../../index-
|
|
1
|
+
import "../../index-7913ec46.js";
|
|
2
|
+
import { R, a } from "../../index-e2e5d725.js";
|
|
3
|
+
import "../../index-1b73beee.js";
|
|
4
4
|
import "../../vendor-f71e6f68.js";
|
|
5
5
|
import "../../index-57492b9b.js";
|
|
6
6
|
import "../option/index.js";
|
|
7
|
-
import "../../index-
|
|
8
|
-
import "../../index-
|
|
7
|
+
import "../../index-7216d6b0.js";
|
|
8
|
+
import "../../index-1048a998.js";
|
|
9
9
|
export {
|
|
10
|
+
R as RanPlayer,
|
|
10
11
|
a as default
|
|
11
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a } from "../../index-
|
|
2
|
-
import "../../index-
|
|
3
|
-
import "../../index-
|
|
4
|
-
import "../../index-
|
|
1
|
+
import { a } from "../../index-73ce455b.js";
|
|
2
|
+
import "../../index-7913ec46.js";
|
|
3
|
+
import "../../index-7216d6b0.js";
|
|
4
|
+
import "../../index-0d5b9435.js";
|
|
5
5
|
import "../../vendor-f71e6f68.js";
|
|
6
6
|
export {
|
|
7
7
|
a as default
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../../index-
|
|
1
|
+
import "../../index-7913ec46.js";
|
|
2
2
|
import "../../index-57492b9b.js";
|
|
3
|
-
import { P, a } from "../../index-
|
|
3
|
+
import { P, a } from "../../index-4443363f.js";
|
|
4
4
|
import "../../vendor-f71e6f68.js";
|
|
5
5
|
export {
|
|
6
6
|
P as Progress,
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
declare class ScratchTicket extends HTMLElement {
|
|
2
|
+
scratchTicketContainer: HTMLDivElement;
|
|
3
|
+
scratchTicket: HTMLCanvasElement;
|
|
4
|
+
state: {
|
|
5
|
+
touchStart: boolean;
|
|
6
|
+
scratchArea: number;
|
|
7
|
+
};
|
|
8
|
+
scratchAward: HTMLDivElement;
|
|
9
|
+
static get observedAttributes(): string[];
|
|
10
|
+
constructor();
|
|
11
|
+
touchStartScratch: (e: TouchEvent) => void;
|
|
12
|
+
touchMoveScratch: (e: TouchEvent) => void;
|
|
13
|
+
touchEndScratch: () => void;
|
|
14
|
+
drawScratchTicket: () => void;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectCallback(): void;
|
|
17
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
18
|
+
}
|
|
19
|
+
export default ScratchTicket;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import type { Input } from '../input';
|
|
2
3
|
interface Option {
|
|
3
4
|
label: string | number;
|
|
4
5
|
value: string | number;
|
|
@@ -9,7 +10,7 @@ export declare class Select extends HTMLElement {
|
|
|
9
10
|
_shadowDom: ShadowRoot;
|
|
10
11
|
_select: HTMLDivElement;
|
|
11
12
|
_selection: HTMLDivElement;
|
|
12
|
-
_search:
|
|
13
|
+
_search: Input;
|
|
13
14
|
_icon: HTMLElement;
|
|
14
15
|
_selectDropdown?: HTMLDivElement;
|
|
15
16
|
_selectionDropdown?: HTMLDivElement;
|
|
@@ -21,6 +22,7 @@ export declare class Select extends HTMLElement {
|
|
|
21
22
|
_activeOption?: HTMLElement;
|
|
22
23
|
_text: HTMLSpanElement;
|
|
23
24
|
_selector: HTMLDivElement;
|
|
25
|
+
onSearch: any;
|
|
24
26
|
static get observedAttributes(): string[];
|
|
25
27
|
constructor();
|
|
26
28
|
get value(): string;
|
|
@@ -87,9 +89,11 @@ export declare class Select extends HTMLElement {
|
|
|
87
89
|
* @return {*}
|
|
88
90
|
*/
|
|
89
91
|
addOptionToSlot: () => void;
|
|
92
|
+
createSelectDropdownContent: (options?: Option[]) => void;
|
|
90
93
|
setDefaultValue: () => void;
|
|
91
94
|
changeSearch: (e: Event) => void;
|
|
92
95
|
setShowSearch: () => void;
|
|
96
|
+
removeShowSearch: () => void;
|
|
93
97
|
listenSlotChange: () => void;
|
|
94
98
|
removeListenSlotChange: () => void;
|
|
95
99
|
listenActionEvent: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { S, a } from "../../index-
|
|
2
|
-
import "../../index-
|
|
1
|
+
import { S, a } from "../../index-1b73beee.js";
|
|
2
|
+
import "../../index-7913ec46.js";
|
|
3
3
|
import "../../index-57492b9b.js";
|
|
4
4
|
import "../option/index.js";
|
|
5
|
-
import "../../index-
|
|
6
|
-
import "../../index-
|
|
5
|
+
import "../../index-7216d6b0.js";
|
|
6
|
+
import "../../index-1048a998.js";
|
|
7
7
|
import "../../vendor-f71e6f68.js";
|
|
8
8
|
export {
|
|
9
9
|
S as Select,
|
|
@@ -103,6 +103,11 @@ declare const _default: {
|
|
|
103
103
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
104
104
|
removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
105
105
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
106
|
+
mozRequestFullScreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
107
|
+
msRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
108
|
+
oRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
109
|
+
webkitRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
110
|
+
webkitEnterFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
106
111
|
readonly attributes: NamedNodeMap;
|
|
107
112
|
readonly classList: DOMTokenList;
|
|
108
113
|
className: string;
|
|
@@ -47,6 +47,11 @@ declare const _default: {
|
|
|
47
47
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
|
|
48
48
|
removeEventListener<K_1 extends keyof HTMLElementEventMap>(type: K_1, listener: (this: HTMLElement, ev: HTMLElementEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
|
|
49
49
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
|
|
50
|
+
mozRequestFullScreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
51
|
+
msRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
52
|
+
oRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
53
|
+
webkitRequestFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
54
|
+
webkitEnterFullscreen: (options?: FullscreenOptions | undefined) => Promise<void>;
|
|
50
55
|
readonly attributes: NamedNodeMap;
|
|
51
56
|
readonly classList: DOMTokenList;
|
|
52
57
|
className: string;
|
|
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
|
|
|
4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
const f7170ee498e0dd32cbdcb63fba8f75cc = "";
|
|
7
|
+
const f7170ee498e0dd32cbdcb63fba8f75cc = ".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}\n";
|
|
8
8
|
const failImage = `
|
|
9
9
|
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJ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4
4
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
|
-
const f7170ee498e0dd32cbdcb63fba8f75cc = ':host([type="toast"]){--ranui-message-background: rgba(0, 0, 0, .7);--ranui-message-color: #fff;--ranui-message-border-radius: 7px}.ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}.ran-message-notice-content{display:inline-block;padding:10px 16px;background:var(--ranui-message-background, #fff);border-radius:var(--ranui-message-border-radius, 8px);box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;pointer-events:all}.ran-message-notice-content-info{align-items:center;display:flex}.ran-message-notice-content-info span{margin:0;padding:0;color:var(--ranui-message-color, #000000d9);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ranui-message .message-in{animation-name:MessageMoveIn;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ranui-message .message-leave{animation-name:MessageMoveOut;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}\n';
|
|
7
|
+
const f7170ee498e0dd32cbdcb63fba8f75cc = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host([type="toast"]){--ranui-message-background: rgba(0, 0, 0, .7);--ranui-message-color: #fff;--ranui-message-border-radius: 7px}.ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}.ran-message-notice-content{display:inline-block;padding:10px 16px;background:var(--ranui-message-background, #fff);border-radius:var(--ranui-message-border-radius, 8px);box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;pointer-events:all}.ran-message-notice-content-info{align-items:center;display:flex}.ran-message-notice-content-info span{margin:0;padding:0;color:var(--ranui-message-color, #000000d9);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ranui-message .message-in{animation-name:MessageMoveIn;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ranui-message .message-leave{animation-name:MessageMoveOut;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}\n';
|
|
8
8
|
const index$1 = "";
|
|
9
9
|
const AnimationTime = 300;
|
|
10
10
|
const defaultDuration = 3e3;
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
import { i as isDisabled, f as falseList, c as createCustomError } from "./index-57492b9b.js";
|
|
8
|
+
const f7170ee498e0dd32cbdcb63fba8f75cc = '.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}.ran-input{position:relative;display:flex;width:calc(100% - 16px);height:calc(100% - 4px);min-width:0;padding:2px 8px;color:#000000d9;font-size:12px;line-height:1.5715;background-color:#fff;background-image:none;border-width:1px;border-style:solid;border-color:#d9d9d9;border-radius:2px;transition:all .3s}.ran-input:active{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff33;border-right-width:1px;outline:0}.ran-input:hover{border-color:#40a9ff;border-right-width:1px}.ran-input>.ran-input-content:hover~.ran-input-label{color:#40a9ff}.ran-input[value]>.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8);color:#00000040}.ran-input[status=error]{border-color:#ff4d4f}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:#ff4d4f}.ran-input[status=warning]{border-color:#ff7875}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:#ff7875}.ran-input[disabled]{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:#00000040;background-color:#f5f5f5}.ran-input[disabled]>.ran-input-label{color:#999;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed}.ran-input-content{writing-mode:horizontal-tb;text-rendering:auto;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0px;text-shadow:none;text-align:start;-webkit-rtl-ordering:logical;cursor:text;touch-action:manipulation;-webkit-appearance:none;text-overflow:ellipsis;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;border:none;width:100%;min-width:0;color:#000000d9;font-size:14px;line-height:1.48;background-color:#fff;background-image:none;transition:all .3s;outline:none}.ran-input-content:focus,.ran-input-content:hover{border:none;outline:0}.ran-input-content::placeholder{color:#999}.ran-input-content:placeholder-shown~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content:focus~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ran-input-label{pointer-events:none;position:absolute;font-size:14px;left:8px;transition:transform .3s,color .3s,background-color .3s,backdrop-filter .3s;transform-origin:left;padding:0 .2em;color:#999;background:#fff;opacity:.9}\n';
|
|
9
|
+
class Input extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
__publicField(this, "_input");
|
|
13
|
+
__publicField(this, "_label");
|
|
14
|
+
__publicField(this, "_inputContent");
|
|
15
|
+
__publicField(this, "_icon");
|
|
16
|
+
/**
|
|
17
|
+
* @description: 原生的input方法
|
|
18
|
+
* @param {Event} event
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "customInput", (event) => {
|
|
21
|
+
event.stopPropagation();
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
const { target, data = "" } = event;
|
|
24
|
+
this.value = (target == null ? void 0 : target.value) || data || "";
|
|
25
|
+
this.customChange();
|
|
26
|
+
this.dispatchEvent(
|
|
27
|
+
new CustomEvent("input", {
|
|
28
|
+
detail: {
|
|
29
|
+
value: this.value
|
|
30
|
+
}
|
|
31
|
+
})
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* @description: 增加change方法,同时兼容大小写的情况
|
|
36
|
+
*/
|
|
37
|
+
__publicField(this, "customChange", () => {
|
|
38
|
+
this.dispatchEvent(
|
|
39
|
+
new CustomEvent("change", {
|
|
40
|
+
detail: {
|
|
41
|
+
value: this.value
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
);
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* @description: 监听placeholder属性函数
|
|
48
|
+
* @param {string} name
|
|
49
|
+
* @param {string} value
|
|
50
|
+
*/
|
|
51
|
+
__publicField(this, "listenPlaceholder", (name, value) => {
|
|
52
|
+
if (name === "placeholder" && this._inputContent) {
|
|
53
|
+
if (value != null) {
|
|
54
|
+
this._inputContent.setAttribute("placeholder", value);
|
|
55
|
+
} else {
|
|
56
|
+
this._inputContent.removeAttribute("placeholder");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* @description: 监听label属性函数
|
|
62
|
+
* @param {string} name
|
|
63
|
+
* @param {string} value
|
|
64
|
+
*/
|
|
65
|
+
__publicField(this, "listenLabel", (name, value) => {
|
|
66
|
+
if (name === "label" && this._inputContent) {
|
|
67
|
+
if (value != null) {
|
|
68
|
+
if (this._label) {
|
|
69
|
+
this._label.innerHTML = value;
|
|
70
|
+
} else {
|
|
71
|
+
this._label = document.createElement("label");
|
|
72
|
+
this._label.innerHTML = value;
|
|
73
|
+
this._label.setAttribute("class", "ran-input-label");
|
|
74
|
+
this._label.setAttribute("part", "ran-input-label");
|
|
75
|
+
this._input.appendChild(this._label);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
this._input.removeAttribute("label");
|
|
79
|
+
if (this._label) {
|
|
80
|
+
this._input.removeChild(this._label);
|
|
81
|
+
this._label = void 0;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
/**
|
|
87
|
+
* @description: 监听type属性
|
|
88
|
+
* @param {string} name
|
|
89
|
+
* @param {string} value
|
|
90
|
+
*/
|
|
91
|
+
__publicField(this, "listenType", (name, value) => {
|
|
92
|
+
if (name === "type" && this._inputContent) {
|
|
93
|
+
if (value) {
|
|
94
|
+
this._inputContent.setAttribute("type", value);
|
|
95
|
+
} else {
|
|
96
|
+
this._inputContent.removeAttribute("type");
|
|
97
|
+
this._inputContent.removeAttribute("min");
|
|
98
|
+
this._inputContent.removeAttribute("max");
|
|
99
|
+
this._inputContent.removeAttribute("step");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
/**
|
|
104
|
+
* @description: 监听status属性
|
|
105
|
+
* @param {string} name
|
|
106
|
+
* @param {string} value
|
|
107
|
+
*/
|
|
108
|
+
__publicField(this, "listenStatus", (name, value) => {
|
|
109
|
+
if (name === "status" && this._input) {
|
|
110
|
+
if (value) {
|
|
111
|
+
this._input.setAttribute("status", value);
|
|
112
|
+
} else {
|
|
113
|
+
this._input.removeAttribute("status");
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* @description: 监听disabled属性
|
|
119
|
+
* @param {string} name
|
|
120
|
+
* @param {string} value
|
|
121
|
+
*/
|
|
122
|
+
__publicField(this, "listenDisabled", (name, value) => {
|
|
123
|
+
if (name === "disabled" && this._input) {
|
|
124
|
+
if (falseList.includes(value)) {
|
|
125
|
+
this._input.removeAttribute("disabled");
|
|
126
|
+
} else {
|
|
127
|
+
this._input.setAttribute("disabled", "");
|
|
128
|
+
this._inputContent.setAttribute("disabled", "");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* @description: 监听icon属性
|
|
134
|
+
* @param {string} name
|
|
135
|
+
* @param {string} value
|
|
136
|
+
*/
|
|
137
|
+
__publicField(this, "listenIcon", (name, value, oldValue) => {
|
|
138
|
+
if (name === "icon" && value && value !== oldValue) {
|
|
139
|
+
this.removeAttribute("label");
|
|
140
|
+
this.setAttribute("icon", value);
|
|
141
|
+
this.dealIcon();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* @description: 处理icon属性的问题
|
|
146
|
+
*/
|
|
147
|
+
__publicField(this, "dealIcon", () => {
|
|
148
|
+
if (!this._icon) {
|
|
149
|
+
this._icon = document.createElement("r-icon");
|
|
150
|
+
const { width, height } = this._inputContent.getBoundingClientRect();
|
|
151
|
+
const size = Math.min(width, height);
|
|
152
|
+
this._icon.setAttribute("size", `${size}`);
|
|
153
|
+
this._inputContent.insertAdjacentElement("beforebegin", this._icon);
|
|
154
|
+
}
|
|
155
|
+
this.icon && this._icon.setAttribute("name", this.icon);
|
|
156
|
+
});
|
|
157
|
+
/**
|
|
158
|
+
* @description: 聚合监听事件
|
|
159
|
+
* @param {string} name
|
|
160
|
+
* @param {string} oldValue
|
|
161
|
+
* @param {string} newValue
|
|
162
|
+
*/
|
|
163
|
+
__publicField(this, "listenEvent", (name, oldValue, newValue) => {
|
|
164
|
+
this.listenPlaceholder(name, newValue);
|
|
165
|
+
this.listenLabel(name, newValue);
|
|
166
|
+
this.listenStatus(name, newValue);
|
|
167
|
+
this.listenDisabled(name, newValue);
|
|
168
|
+
this.listenIcon(name, newValue, oldValue);
|
|
169
|
+
if (name === "value" && oldValue !== newValue) {
|
|
170
|
+
this._inputContent.value = newValue;
|
|
171
|
+
this._input.setAttribute("value", newValue);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const shadowRoot = this.attachShadow({ mode: "closed" });
|
|
175
|
+
const F7170EE498E0DD32CBDCB63FBA8F75CC = document.createElement("style");
|
|
176
|
+
F7170EE498E0DD32CBDCB63FBA8F75CC.textContent = f7170ee498e0dd32cbdcb63fba8f75cc;
|
|
177
|
+
shadowRoot.appendChild(F7170EE498E0DD32CBDCB63FBA8F75CC);
|
|
178
|
+
this._input = document.createElement("div");
|
|
179
|
+
this._input.setAttribute("class", "ran-input");
|
|
180
|
+
this._input.setAttribute("part", "ran-input");
|
|
181
|
+
this._inputContent = document.createElement("input");
|
|
182
|
+
this._inputContent.setAttribute("class", "ran-input-content");
|
|
183
|
+
this._inputContent.setAttribute("part", "ran-input-content");
|
|
184
|
+
this._input.appendChild(this._inputContent);
|
|
185
|
+
shadowRoot.appendChild(this._input);
|
|
186
|
+
}
|
|
187
|
+
static get observedAttributes() {
|
|
188
|
+
return [
|
|
189
|
+
"label",
|
|
190
|
+
"disabled",
|
|
191
|
+
"name",
|
|
192
|
+
"placeholder",
|
|
193
|
+
"type",
|
|
194
|
+
"icon",
|
|
195
|
+
"value",
|
|
196
|
+
"status"
|
|
197
|
+
];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* @description: 获取input的值
|
|
201
|
+
* @return {String}
|
|
202
|
+
*/
|
|
203
|
+
get value() {
|
|
204
|
+
return this.getAttribute("value");
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* @description: 设置input的值
|
|
208
|
+
* @param {String} value
|
|
209
|
+
*/
|
|
210
|
+
set value(value) {
|
|
211
|
+
if (!isDisabled(this) && value) {
|
|
212
|
+
this.setAttribute("value", value);
|
|
213
|
+
this._input.setAttribute("value", value);
|
|
214
|
+
} else {
|
|
215
|
+
this.removeAttribute("value");
|
|
216
|
+
this._input.removeAttribute("value");
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @description: 获取input的占位字符
|
|
221
|
+
* @return {String}
|
|
222
|
+
*/
|
|
223
|
+
get placeholder() {
|
|
224
|
+
return this.getAttribute("placeholder");
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* @description: 设置input的占位字符
|
|
228
|
+
* @param {String} value
|
|
229
|
+
*/
|
|
230
|
+
set placeholder(value) {
|
|
231
|
+
if (value) {
|
|
232
|
+
this.setAttribute("placeholder", value);
|
|
233
|
+
} else {
|
|
234
|
+
this.removeAttribute("placeholder");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* @description: input是否为必选
|
|
239
|
+
* @return {String}
|
|
240
|
+
*/
|
|
241
|
+
get required() {
|
|
242
|
+
return this.getAttribute("required");
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @description: 设置input是否为必选,除非设置成false,否则都是必填
|
|
246
|
+
* @param {*} value
|
|
247
|
+
*/
|
|
248
|
+
set required(value) {
|
|
249
|
+
if (!value || value === "false") {
|
|
250
|
+
this.removeAttribute("required");
|
|
251
|
+
} else {
|
|
252
|
+
this.setAttribute("required", "");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* @description: 获取input上disabled属性
|
|
257
|
+
* @return {String | null}
|
|
258
|
+
*/
|
|
259
|
+
get disabled() {
|
|
260
|
+
return isDisabled(this);
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* @description: 设置input的disabled属性
|
|
264
|
+
* @param {String} value
|
|
265
|
+
*/
|
|
266
|
+
set disabled(value) {
|
|
267
|
+
if (falseList.includes(value)) {
|
|
268
|
+
this.removeAttribute("disabled");
|
|
269
|
+
this._input.removeAttribute("disabled");
|
|
270
|
+
this._inputContent.removeAttribute("disabled");
|
|
271
|
+
} else {
|
|
272
|
+
this.setAttribute("disabled", "");
|
|
273
|
+
this._input.setAttribute("disabled", "");
|
|
274
|
+
this._inputContent.setAttribute("disabled", "");
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* @description: 获取类似于Metiral Design的输入体验。
|
|
279
|
+
*/
|
|
280
|
+
get label() {
|
|
281
|
+
return this.getAttribute("label") || "";
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* @description: 设置类似于Metiral Design的输入体验。
|
|
285
|
+
*/
|
|
286
|
+
set label(value) {
|
|
287
|
+
this.setAttribute("label", value);
|
|
288
|
+
}
|
|
289
|
+
/**
|
|
290
|
+
* @description: 获取input框的状态
|
|
291
|
+
*/
|
|
292
|
+
get status() {
|
|
293
|
+
return this.getAttribute("status") || "";
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* @description: 设置input框的状态
|
|
297
|
+
*/
|
|
298
|
+
set status(value) {
|
|
299
|
+
if (value) {
|
|
300
|
+
this.setAttribute("status", value);
|
|
301
|
+
this._input.setAttribute("status", value);
|
|
302
|
+
} else {
|
|
303
|
+
this.removeAttribute("status");
|
|
304
|
+
this._input.removeAttribute("status");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* @description: 与form组件联动时,收集的属性名
|
|
309
|
+
* @return {String}
|
|
310
|
+
*/
|
|
311
|
+
get name() {
|
|
312
|
+
return this.getAttribute("name") || "";
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @description: 设置name属性
|
|
316
|
+
* @param {string} value
|
|
317
|
+
*/
|
|
318
|
+
set name(value) {
|
|
319
|
+
this.setAttribute("name", value);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* @description: 当input类型为number类型时,可以获取min属性
|
|
323
|
+
* @return {String}
|
|
324
|
+
*/
|
|
325
|
+
get min() {
|
|
326
|
+
return this.getAttribute("min") || "";
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @description: 当input类型为number类型时,设置min属性
|
|
330
|
+
* @param {string} value
|
|
331
|
+
*/
|
|
332
|
+
set min(value) {
|
|
333
|
+
if (this.type === "number")
|
|
334
|
+
this.setAttribute("min", value);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* @description: 当input类型为number类型时,可以获取max属性
|
|
338
|
+
* @return {String}
|
|
339
|
+
*/
|
|
340
|
+
get max() {
|
|
341
|
+
return this.getAttribute("max") || "";
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* @description: 当input类型为number类型时,设置max属性
|
|
345
|
+
* @param {string} value
|
|
346
|
+
*/
|
|
347
|
+
set max(value) {
|
|
348
|
+
if (this.type === "number")
|
|
349
|
+
this.setAttribute("max", value);
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* @description: 当input类型为number类型时,可以获取step属性
|
|
353
|
+
* @return {String}
|
|
354
|
+
*/
|
|
355
|
+
get step() {
|
|
356
|
+
return this.getAttribute("step") || "";
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* @description: 当input类型为number类型时,设置step属性
|
|
360
|
+
* @param {string} value
|
|
361
|
+
*/
|
|
362
|
+
set step(value) {
|
|
363
|
+
if (this.type === "number")
|
|
364
|
+
this.setAttribute("step", value);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* @description: 获取一个icon
|
|
368
|
+
* @return {String}
|
|
369
|
+
*/
|
|
370
|
+
get icon() {
|
|
371
|
+
return this.getAttribute("icon");
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* @description: 设置icon来表示标识
|
|
375
|
+
* @param {string|null} value
|
|
376
|
+
*/
|
|
377
|
+
set icon(value) {
|
|
378
|
+
if (value) {
|
|
379
|
+
this.setAttribute("icon", value);
|
|
380
|
+
} else {
|
|
381
|
+
this.removeAttribute("icon");
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* @description: 获取input的类型
|
|
386
|
+
* @return {string|null}
|
|
387
|
+
*/
|
|
388
|
+
get type() {
|
|
389
|
+
return this.getAttribute("type");
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* @description: 设置input的类型
|
|
393
|
+
* @param {string|null} value
|
|
394
|
+
*/
|
|
395
|
+
set type(value) {
|
|
396
|
+
if (value) {
|
|
397
|
+
this.setAttribute("type", value);
|
|
398
|
+
} else {
|
|
399
|
+
this.removeAttribute("type");
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
connectedCallback() {
|
|
403
|
+
if (this.value) {
|
|
404
|
+
this._inputContent.value = this.value;
|
|
405
|
+
this._input.setAttribute("value", this.value);
|
|
406
|
+
}
|
|
407
|
+
if (this.status) {
|
|
408
|
+
this._input.setAttribute("status", this.status);
|
|
409
|
+
}
|
|
410
|
+
if (isDisabled(this)) {
|
|
411
|
+
this._input.setAttribute("disabled", "");
|
|
412
|
+
this._inputContent.setAttribute("disabled", "");
|
|
413
|
+
}
|
|
414
|
+
if (this.type) {
|
|
415
|
+
this._inputContent.setAttribute("type", this.type);
|
|
416
|
+
}
|
|
417
|
+
this._inputContent.addEventListener("input", this.customInput);
|
|
418
|
+
if (document.readyState === "complete") {
|
|
419
|
+
this.dealIcon();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
disconnectCallback() {
|
|
423
|
+
this._inputContent.removeEventListener("input", this.customInput);
|
|
424
|
+
}
|
|
425
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
426
|
+
this.listenEvent(name, oldValue, newValue);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function Custom() {
|
|
430
|
+
if (typeof window !== "undefined" && !customElements.get("r-input")) {
|
|
431
|
+
customElements.define("r-input", Input);
|
|
432
|
+
return Input;
|
|
433
|
+
} else {
|
|
434
|
+
return createCustomError("document is undefined or r-input is exist");
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
const index = Custom();
|
|
438
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
439
|
+
__proto__: null,
|
|
440
|
+
Input,
|
|
441
|
+
default: index
|
|
442
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
443
|
+
export {
|
|
444
|
+
Input as I,
|
|
445
|
+
index as a,
|
|
446
|
+
index$1 as i
|
|
447
|
+
};
|