qc-ui-lit 0.0.8 → 0.2.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.
@@ -8,7 +8,7 @@ function a(e, t, n, r) {
8
8
  return i > 3 && a && Object.defineProperty(t, n, a), a;
9
9
  }
10
10
  //#endregion
11
- //#region src/tools/loadAMap/loadAMap.ts
11
+ //#region src/tools/loadAMap/index.ts
12
12
  var o, s = {
13
13
  version: "2.0",
14
14
  key: "94af010abe03a5b2a2f98e6739a11d0c",
@@ -0,0 +1,133 @@
1
+ import { r as e } from "../AMap/AMap.js";
2
+ import { LitElement as t, css as n, html as r } from "lit";
3
+ import { customElement as i, property as a } from "lit/decorators.js";
4
+ import { classMap as o } from "lit/directives/class-map.js";
5
+ //#region src/components/Button/qc-button.ts
6
+ var s = class extends t {
7
+ constructor(...e) {
8
+ super(...e), this.type = "default", this.size = "default", this.disabled = !1, this.loading = !1, this.animation = !0;
9
+ }
10
+ get _classes() {
11
+ return {
12
+ "qc-button": !0,
13
+ "qc-button-disabled": this.disabled,
14
+ "qc-button-animation": this.animation,
15
+ "qc-button-loading": this.loading,
16
+ [`qc-button-size-${this.size}`]: this.size !== "default",
17
+ [`qc-button-type-${this.type}`]: this.type !== "default"
18
+ };
19
+ }
20
+ handleClick(e) {
21
+ e.stopPropagation(), this.disabled || this.dispatchEvent(new CustomEvent("click", e));
22
+ }
23
+ firstUpdated() {}
24
+ render() {
25
+ return r`
26
+ <button type="button" class="${o(this._classes)}" ?disabled=${this.disabled} @click=${this.handleClick}>
27
+ <slot></slot>
28
+ </button>
29
+ `;
30
+ }
31
+ static {
32
+ this.styles = n`
33
+ :host {
34
+ display: inline-block;
35
+ }
36
+ .qc-button {
37
+ outline: none;
38
+ cursor: pointer;
39
+ border-radius: var(--qc-radius-default);
40
+ padding: var(--qc-btn-default-padding);
41
+ transition: var(--qc-transition);
42
+ background-color: var(--qc-primary-color);
43
+ border: 1px solid var(--qc-primary-color);
44
+ line-height: var(--qc-line-height);
45
+ font-size: var(--qc-font-size-default);
46
+ color: var(--qc-primary-color-text);
47
+ vertical-align: middle;
48
+ user-select: none;
49
+ }
50
+ .qc-button:active {
51
+ filter: drop-shadow(0px 0px 4px var(--qc-primary-color));
52
+ }
53
+
54
+ .qc-button-animation:hover {
55
+ transform: scale(1.1);
56
+ }
57
+
58
+ .qc-button-animation:active {
59
+ transform: scale(0.9);
60
+ }
61
+ .qc-button-type-secondary {
62
+ background-color: var(--qc-secondary-color);
63
+ border-color: var(--qc-primary-color);
64
+ color: var(--qc-primary-color);
65
+ }
66
+ .qc-button-type-secondary:active {
67
+ filter: drop-shadow(0px 0px 4px var(--qc-primary-color));
68
+ }
69
+
70
+ .qc-button-type-danger {
71
+ background-color: var(--qc-danger-color);
72
+ border-color: var(--qc-danger-color);
73
+ }
74
+ .qc-button-type-danger:active {
75
+ filter: drop-shadow(0px 0px 4px var(--qc-danger-color));
76
+ }
77
+ .qc-button-type-success {
78
+ background-color: var(--qc-success-color);
79
+ border-color: var(--qc-success-color);
80
+ }
81
+ .qc-button-type-success:active {
82
+ filter: drop-shadow(0px 0px 4px var(--qc-success-color));
83
+ }
84
+
85
+ .qc-button-size-small {
86
+ padding: var(--qc-btn-small-padding);
87
+ font-size: var(--qc-font-size-small);
88
+ }
89
+
90
+ .qc-button-size-large {
91
+ padding: var(--qc-btn-large-padding);
92
+ font-size: var(--qc-font-size-large);
93
+ }
94
+ .qc-button-loading {
95
+ cursor: wait;
96
+ opacity: 0.65;
97
+ }
98
+ .qc-button-loading:hover {
99
+ transform: scale(1);
100
+ }
101
+
102
+ .qc-button-disabled {
103
+ opacity: 0.65;
104
+ cursor: not-allowed;
105
+ position: relative;
106
+ overflow: hidden;
107
+ }
108
+ .qc-button-disabled::after {
109
+ content: '';
110
+ display: block;
111
+ background-color: rgba(0, 0, 0, 0.4);
112
+ width: 100%;
113
+ height: 100%;
114
+ position: absolute;
115
+ top: 0;
116
+ left: 0;
117
+ }
118
+
119
+ .qc-button-disabled:hover {
120
+ transform: scale(1);
121
+ }
122
+ `;
123
+ }
124
+ };
125
+ e([a({
126
+ type: String,
127
+ reflect: !0
128
+ })], s.prototype, "type", void 0), e([a({
129
+ type: String,
130
+ reflect: !0
131
+ })], s.prototype, "size", void 0), e([a({ type: Boolean })], s.prototype, "disabled", void 0), e([a({ type: Boolean })], s.prototype, "loading", void 0), e([a({ type: Boolean })], s.prototype, "animation", void 0), s = e([i("qc-button")], s);
132
+ //#endregion
133
+ export { s as t };
@@ -0,0 +1,18 @@
1
+ import { LitElement } from 'lit';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'qc-button': QCButton;
5
+ }
6
+ }
7
+ export declare class QCButton extends LitElement {
8
+ type: string;
9
+ size: string;
10
+ disabled: boolean;
11
+ loading: boolean;
12
+ animation: boolean;
13
+ private get _classes();
14
+ private handleClick;
15
+ firstUpdated(): void;
16
+ protected render(): import("lit-html").TemplateResult<1>;
17
+ static styles: import("lit").CSSResult;
18
+ }