godown 3.5.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/godown+lit.iife.js +2 -2
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +2 -2
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +2 -2
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +4 -4
- package/build/godown.js +4 -4
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +4 -4
- package/build/godown.umd.js.map +1 -1
- package/components/badge.js +1 -1
- package/components/badge.js.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/package.json +6 -18
- package/src/components/button.ts +2 -3
- package/src/components/details.ts +1 -1
- package/src/components/dialog.ts +4 -6
- package/src/core/super-input.ts +3 -4
- package/src/core/super-openable.ts +0 -4
- package/tsconfig.json +33 -0
- package/web-types.json +1 -1
- package/dev/alert.d.ts +0 -9
- package/dev/alert.d.ts.map +0 -1
- package/dev/alert.js +0 -5
- package/dev/alert.js.map +0 -1
- package/dev/avatar.d.ts +0 -9
- package/dev/avatar.d.ts.map +0 -1
- package/dev/avatar.js +0 -5
- package/dev/avatar.js.map +0 -1
- package/dev/badge.d.ts +0 -9
- package/dev/badge.d.ts.map +0 -1
- package/dev/badge.js +0 -5
- package/dev/badge.js.map +0 -1
- package/dev/breath.d.ts +0 -9
- package/dev/breath.d.ts.map +0 -1
- package/dev/breath.js +0 -5
- package/dev/breath.js.map +0 -1
- package/dev/button.d.ts +0 -9
- package/dev/button.d.ts.map +0 -1
- package/dev/button.js +0 -5
- package/dev/button.js.map +0 -1
- package/dev/card.d.ts +0 -9
- package/dev/card.d.ts.map +0 -1
- package/dev/card.js +0 -5
- package/dev/card.js.map +0 -1
- package/dev/carousel.d.ts +0 -9
- package/dev/carousel.d.ts.map +0 -1
- package/dev/carousel.js +0 -5
- package/dev/carousel.js.map +0 -1
- package/dev/components/alert.d.ts +0 -55
- package/dev/components/alert.d.ts.map +0 -1
- package/dev/components/alert.js +0 -236
- package/dev/components/alert.js.map +0 -1
- package/dev/components/avatar.d.ts +0 -33
- package/dev/components/avatar.d.ts.map +0 -1
- package/dev/components/avatar.js +0 -119
- package/dev/components/avatar.js.map +0 -1
- package/dev/components/badge.d.ts +0 -31
- package/dev/components/badge.d.ts.map +0 -1
- package/dev/components/badge.js +0 -122
- package/dev/components/badge.js.map +0 -1
- package/dev/components/breath.d.ts +0 -36
- package/dev/components/breath.d.ts.map +0 -1
- package/dev/components/breath.js +0 -135
- package/dev/components/breath.js.map +0 -1
- package/dev/components/button.d.ts +0 -60
- package/dev/components/button.d.ts.map +0 -1
- package/dev/components/button.js +0 -288
- package/dev/components/button.js.map +0 -1
- package/dev/components/card.d.ts +0 -27
- package/dev/components/card.d.ts.map +0 -1
- package/dev/components/card.js +0 -87
- package/dev/components/card.js.map +0 -1
- package/dev/components/carousel.d.ts +0 -39
- package/dev/components/carousel.d.ts.map +0 -1
- package/dev/components/carousel.js +0 -184
- package/dev/components/carousel.js.map +0 -1
- package/dev/components/details.d.ts +0 -24
- package/dev/components/details.d.ts.map +0 -1
- package/dev/components/details.js +0 -124
- package/dev/components/details.js.map +0 -1
- package/dev/components/dialog.d.ts +0 -43
- package/dev/components/dialog.d.ts.map +0 -1
- package/dev/components/dialog.js +0 -154
- package/dev/components/dialog.js.map +0 -1
- package/dev/components/divider.d.ts +0 -17
- package/dev/components/divider.d.ts.map +0 -1
- package/dev/components/divider.js +0 -64
- package/dev/components/divider.js.map +0 -1
- package/dev/components/dragbox.d.ts +0 -42
- package/dev/components/dragbox.d.ts.map +0 -1
- package/dev/components/dragbox.js +0 -126
- package/dev/components/dragbox.js.map +0 -1
- package/dev/components/flex.d.ts +0 -34
- package/dev/components/flex.d.ts.map +0 -1
- package/dev/components/flex.js +0 -73
- package/dev/components/flex.js.map +0 -1
- package/dev/components/form.d.ts +0 -24
- package/dev/components/form.d.ts.map +0 -1
- package/dev/components/form.js +0 -76
- package/dev/components/form.js.map +0 -1
- package/dev/components/grid.d.ts +0 -38
- package/dev/components/grid.d.ts.map +0 -1
- package/dev/components/grid.js +0 -67
- package/dev/components/grid.js.map +0 -1
- package/dev/components/heading.d.ts +0 -31
- package/dev/components/heading.d.ts.map +0 -1
- package/dev/components/heading.js +0 -127
- package/dev/components/heading.js.map +0 -1
- package/dev/components/input.d.ts +0 -23
- package/dev/components/input.d.ts.map +0 -1
- package/dev/components/input.js +0 -99
- package/dev/components/input.js.map +0 -1
- package/dev/components/layout.d.ts +0 -28
- package/dev/components/layout.d.ts.map +0 -1
- package/dev/components/layout.js +0 -96
- package/dev/components/layout.js.map +0 -1
- package/dev/components/link.d.ts +0 -54
- package/dev/components/link.d.ts.map +0 -1
- package/dev/components/link.js +0 -110
- package/dev/components/link.js.map +0 -1
- package/dev/components/progress.d.ts +0 -16
- package/dev/components/progress.d.ts.map +0 -1
- package/dev/components/progress.js +0 -101
- package/dev/components/progress.js.map +0 -1
- package/dev/components/range.d.ts +0 -122
- package/dev/components/range.d.ts.map +0 -1
- package/dev/components/range.js +0 -391
- package/dev/components/range.js.map +0 -1
- package/dev/components/rotate.d.ts +0 -30
- package/dev/components/rotate.d.ts.map +0 -1
- package/dev/components/rotate.js +0 -93
- package/dev/components/rotate.js.map +0 -1
- package/dev/components/router.d.ts +0 -116
- package/dev/components/router.d.ts.map +0 -1
- package/dev/components/router.js +0 -240
- package/dev/components/router.js.map +0 -1
- package/dev/components/select.d.ts +0 -53
- package/dev/components/select.d.ts.map +0 -1
- package/dev/components/select.js +0 -269
- package/dev/components/select.js.map +0 -1
- package/dev/components/skeleton.d.ts +0 -28
- package/dev/components/skeleton.d.ts.map +0 -1
- package/dev/components/skeleton.js +0 -122
- package/dev/components/skeleton.js.map +0 -1
- package/dev/components/split.d.ts +0 -56
- package/dev/components/split.d.ts.map +0 -1
- package/dev/components/split.js +0 -220
- package/dev/components/split.js.map +0 -1
- package/dev/components/switch.d.ts +0 -32
- package/dev/components/switch.d.ts.map +0 -1
- package/dev/components/switch.js +0 -147
- package/dev/components/switch.js.map +0 -1
- package/dev/components/text.d.ts +0 -21
- package/dev/components/text.d.ts.map +0 -1
- package/dev/components/text.js +0 -96
- package/dev/components/text.js.map +0 -1
- package/dev/components/time.d.ts +0 -36
- package/dev/components/time.d.ts.map +0 -1
- package/dev/components/time.js +0 -75
- package/dev/components/time.js.map +0 -1
- package/dev/components/tooltip.d.ts +0 -51
- package/dev/components/tooltip.d.ts.map +0 -1
- package/dev/components/tooltip.js +0 -140
- package/dev/components/tooltip.js.map +0 -1
- package/dev/components/typewriter.d.ts +0 -49
- package/dev/components/typewriter.d.ts.map +0 -1
- package/dev/components/typewriter.js +0 -149
- package/dev/components/typewriter.js.map +0 -1
- package/dev/core/direction.d.ts +0 -27
- package/dev/core/direction.d.ts.map +0 -1
- package/dev/core/direction.js +0 -56
- package/dev/core/direction.js.map +0 -1
- package/dev/core/global-style.d.ts +0 -20
- package/dev/core/global-style.d.ts.map +0 -1
- package/dev/core/global-style.js +0 -82
- package/dev/core/global-style.js.map +0 -1
- package/dev/core/outline.d.ts +0 -20
- package/dev/core/outline.d.ts.map +0 -1
- package/dev/core/outline.js +0 -44
- package/dev/core/outline.js.map +0 -1
- package/dev/core/super-anchor.d.ts +0 -18
- package/dev/core/super-anchor.d.ts.map +0 -1
- package/dev/core/super-anchor.js +0 -60
- package/dev/core/super-anchor.js.map +0 -1
- package/dev/core/super-input.d.ts +0 -43
- package/dev/core/super-input.d.ts.map +0 -1
- package/dev/core/super-input.js +0 -203
- package/dev/core/super-input.js.map +0 -1
- package/dev/core/super-openable.d.ts +0 -16
- package/dev/core/super-openable.d.ts.map +0 -1
- package/dev/core/super-openable.js +0 -36
- package/dev/core/super-openable.js.map +0 -1
- package/dev/details.d.ts +0 -9
- package/dev/details.d.ts.map +0 -1
- package/dev/details.js +0 -5
- package/dev/details.js.map +0 -1
- package/dev/dialog.d.ts +0 -9
- package/dev/dialog.d.ts.map +0 -1
- package/dev/dialog.js +0 -5
- package/dev/dialog.js.map +0 -1
- package/dev/divider.d.ts +0 -9
- package/dev/divider.d.ts.map +0 -1
- package/dev/divider.js +0 -5
- package/dev/divider.js.map +0 -1
- package/dev/dragbox.d.ts +0 -9
- package/dev/dragbox.d.ts.map +0 -1
- package/dev/dragbox.js +0 -5
- package/dev/dragbox.js.map +0 -1
- package/dev/flex.d.ts +0 -9
- package/dev/flex.d.ts.map +0 -1
- package/dev/flex.js +0 -5
- package/dev/flex.js.map +0 -1
- package/dev/form.d.ts +0 -9
- package/dev/form.d.ts.map +0 -1
- package/dev/form.js +0 -5
- package/dev/form.js.map +0 -1
- package/dev/grid.d.ts +0 -9
- package/dev/grid.d.ts.map +0 -1
- package/dev/grid.js +0 -5
- package/dev/grid.js.map +0 -1
- package/dev/heading.d.ts +0 -9
- package/dev/heading.d.ts.map +0 -1
- package/dev/heading.js +0 -5
- package/dev/heading.js.map +0 -1
- package/dev/index.d.ts +0 -31
- package/dev/index.d.ts.map +0 -1
- package/dev/index.js +0 -31
- package/dev/index.js.map +0 -1
- package/dev/input.d.ts +0 -9
- package/dev/input.d.ts.map +0 -1
- package/dev/input.js +0 -5
- package/dev/input.js.map +0 -1
- package/dev/layout.d.ts +0 -9
- package/dev/layout.d.ts.map +0 -1
- package/dev/layout.js +0 -5
- package/dev/layout.js.map +0 -1
- package/dev/link.d.ts +0 -9
- package/dev/link.d.ts.map +0 -1
- package/dev/link.js +0 -5
- package/dev/link.js.map +0 -1
- package/dev/progress.d.ts +0 -9
- package/dev/progress.d.ts.map +0 -1
- package/dev/progress.js +0 -5
- package/dev/progress.js.map +0 -1
- package/dev/range.d.ts +0 -9
- package/dev/range.d.ts.map +0 -1
- package/dev/range.js +0 -5
- package/dev/range.js.map +0 -1
- package/dev/rotate.d.ts +0 -9
- package/dev/rotate.d.ts.map +0 -1
- package/dev/rotate.js +0 -5
- package/dev/rotate.js.map +0 -1
- package/dev/router.d.ts +0 -9
- package/dev/router.d.ts.map +0 -1
- package/dev/router.js +0 -5
- package/dev/router.js.map +0 -1
- package/dev/select.d.ts +0 -9
- package/dev/select.d.ts.map +0 -1
- package/dev/select.js +0 -5
- package/dev/select.js.map +0 -1
- package/dev/skeleton.d.ts +0 -9
- package/dev/skeleton.d.ts.map +0 -1
- package/dev/skeleton.js +0 -5
- package/dev/skeleton.js.map +0 -1
- package/dev/split.d.ts +0 -9
- package/dev/split.d.ts.map +0 -1
- package/dev/split.js +0 -5
- package/dev/split.js.map +0 -1
- package/dev/switch.d.ts +0 -9
- package/dev/switch.d.ts.map +0 -1
- package/dev/switch.js +0 -5
- package/dev/switch.js.map +0 -1
- package/dev/text.d.ts +0 -9
- package/dev/text.d.ts.map +0 -1
- package/dev/text.js +0 -5
- package/dev/text.js.map +0 -1
- package/dev/time.d.ts +0 -9
- package/dev/time.d.ts.map +0 -1
- package/dev/time.js +0 -5
- package/dev/time.js.map +0 -1
- package/dev/tooltip.d.ts +0 -9
- package/dev/tooltip.d.ts.map +0 -1
- package/dev/tooltip.js +0 -5
- package/dev/tooltip.js.map +0 -1
- package/dev/typewriter.d.ts +0 -9
- package/dev/typewriter.d.ts.map +0 -1
- package/dev/typewriter.js +0 -5
- package/dev/typewriter.js.map +0 -1
package/dev/components/dialog.js
DELETED
@@ -1,154 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property } from "lit/decorators.js";
|
5
|
-
import { scopePrefix } from "../core/global-style.js";
|
6
|
-
import { SuperOpenable } from "../core/super-openable.js";
|
7
|
-
import { directionInsetAlign, } from "../core/direction.js";
|
8
|
-
const protoName = "dialog";
|
9
|
-
const cssScope = scopePrefix(protoName);
|
10
|
-
/**
|
11
|
-
* {@linkcode Dialog} similar to `<dialog>`.
|
12
|
-
*
|
13
|
-
* Like dialog, it listens for submit events and closes itself when the target method is "dialog".
|
14
|
-
*
|
15
|
-
* It listens for the keydown event and also closes itself when the {@linkcode key} contained in the key is pressed.
|
16
|
-
*
|
17
|
-
* @fires change - Fires when the open changes.
|
18
|
-
* @category feedback
|
19
|
-
*/
|
20
|
-
let Dialog = class Dialog extends SuperOpenable {
|
21
|
-
constructor() {
|
22
|
-
super(...arguments);
|
23
|
-
/**
|
24
|
-
* Indicates whether the dialog should be displayed as a modal.
|
25
|
-
*/
|
26
|
-
this.modal = false;
|
27
|
-
/**
|
28
|
-
* The keys will close the dialog when pressed.
|
29
|
-
*/
|
30
|
-
this.key = "Escape";
|
31
|
-
/**
|
32
|
-
* Indicates whether the modal has been invoked.
|
33
|
-
*/
|
34
|
-
this.__modalInvoke = false;
|
35
|
-
}
|
36
|
-
render() {
|
37
|
-
return html `
|
38
|
-
<div
|
39
|
-
part="root"
|
40
|
-
${attr(this.observedRecord)}
|
41
|
-
>
|
42
|
-
<div part="modal"></div>
|
43
|
-
<div
|
44
|
-
part="container"
|
45
|
-
direction-inset-align
|
46
|
-
>
|
47
|
-
${htmlSlot()}
|
48
|
-
</div>
|
49
|
-
</div>
|
50
|
-
`;
|
51
|
-
}
|
52
|
-
showModal() {
|
53
|
-
if (!this.modal) {
|
54
|
-
this.modal = true;
|
55
|
-
this.__modalInvoke = true;
|
56
|
-
}
|
57
|
-
this.show();
|
58
|
-
}
|
59
|
-
updated(changedProperties) {
|
60
|
-
if (changedProperties.has("open")) {
|
61
|
-
if (this.open) {
|
62
|
-
this.__submitEvent = this.events.add(this, "submit", this._handelSubmit);
|
63
|
-
if (this.key) {
|
64
|
-
this.__keydownEvent = this.events.add(document, "keydown", this._handleKeydown.bind(this));
|
65
|
-
}
|
66
|
-
}
|
67
|
-
else {
|
68
|
-
this.events.remove(this, "submit", this.__submitEvent);
|
69
|
-
this.events.remove(document, "keydown", this.__keydownEvent);
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
73
|
-
_handleKeydown(e) {
|
74
|
-
const keys = this.key.split(/[\s,]/);
|
75
|
-
if (keys.includes(e.key) || keys.includes(e.code)) {
|
76
|
-
e.preventDefault();
|
77
|
-
this.close();
|
78
|
-
}
|
79
|
-
}
|
80
|
-
_handelSubmit(e) {
|
81
|
-
if (e.target.method === "dialog") {
|
82
|
-
e.preventDefault();
|
83
|
-
this.close();
|
84
|
-
}
|
85
|
-
}
|
86
|
-
close() {
|
87
|
-
if (this.__modalInvoke) {
|
88
|
-
this.modal = false;
|
89
|
-
this.__modalInvoke = false;
|
90
|
-
}
|
91
|
-
this.open = false;
|
92
|
-
}
|
93
|
-
};
|
94
|
-
__decorate([
|
95
|
-
property()
|
96
|
-
], Dialog.prototype, "direction", void 0);
|
97
|
-
__decorate([
|
98
|
-
property({ type: Boolean, reflect: true })
|
99
|
-
], Dialog.prototype, "modal", void 0);
|
100
|
-
__decorate([
|
101
|
-
property()
|
102
|
-
], Dialog.prototype, "key", void 0);
|
103
|
-
Dialog = __decorate([
|
104
|
-
godown(protoName),
|
105
|
-
styles(directionInsetAlign, css `
|
106
|
-
:host {
|
107
|
-
${cssScope}--background: none;
|
108
|
-
${cssScope}--background-modal: black;
|
109
|
-
${cssScope}--opacity-modal: 0.2;
|
110
|
-
background: var(${cssScope}--background);
|
111
|
-
pointer-events: none;
|
112
|
-
visibility: hidden;
|
113
|
-
position: fixed;
|
114
|
-
z-index: 1;
|
115
|
-
inset: 0;
|
116
|
-
}
|
117
|
-
|
118
|
-
:host([open]) {
|
119
|
-
visibility: visible;
|
120
|
-
}
|
121
|
-
|
122
|
-
:host([open][modal]) [part="modal"] {
|
123
|
-
pointer-events: all;
|
124
|
-
visibility: visible;
|
125
|
-
opacity: var(${cssScope}--opacity-modal);
|
126
|
-
}
|
127
|
-
|
128
|
-
[part="modal"] {
|
129
|
-
visibility: hidden;
|
130
|
-
opacity: 0;
|
131
|
-
width: 100%;
|
132
|
-
height: 100%;
|
133
|
-
position: absolute;
|
134
|
-
background: var(${cssScope}--background-modal);
|
135
|
-
}
|
136
|
-
|
137
|
-
[part="root"] {
|
138
|
-
width: 100%;
|
139
|
-
height: 100%;
|
140
|
-
display: flex;
|
141
|
-
position: relative;
|
142
|
-
align-items: center;
|
143
|
-
justify-content: center;
|
144
|
-
}
|
145
|
-
|
146
|
-
[part="container"] {
|
147
|
-
pointer-events: all;
|
148
|
-
position: absolute;
|
149
|
-
}
|
150
|
-
`)
|
151
|
-
], Dialog);
|
152
|
-
export default Dialog;
|
153
|
-
export { Dialog };
|
154
|
-
//# sourceMappingURL=dialog.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAA4C,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAIL,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;;;;;;GASG;AAmDH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,aAAa;IAAlC;;QAOE;;WAEG;QAEH,UAAK,GAAG,KAAK,CAAC;QAEd;;WAEG;QAEH,QAAG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
*
|
6
|
-
* @category layout
|
7
|
-
*/
|
8
|
-
declare class Divider extends GlobalStyle {
|
9
|
-
/**
|
10
|
-
* Whether to display the divider vertically.
|
11
|
-
*/
|
12
|
-
vertical: boolean;
|
13
|
-
protected render(): TemplateResult<1>;
|
14
|
-
}
|
15
|
-
export default Divider;
|
16
|
-
export { Divider };
|
17
|
-
//# sourceMappingURL=divider.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"divider.d.ts","sourceRoot":"","sources":["../../src/components/divider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAiB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAIrE;;;;GAIG;AACH,cA4BM,OAAQ,SAAQ,WAAW;IAC/B;;OAEG;IAEH,QAAQ,UAAS;IAEjB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAQtC;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,64 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property } from "lit/decorators.js";
|
5
|
-
import { cssGlobalVars, GlobalStyle } from "../core/global-style.js";
|
6
|
-
const protoName = "divider";
|
7
|
-
/**
|
8
|
-
* {@linkcode Divider} similar to `<hr>`.
|
9
|
-
*
|
10
|
-
* @category layout
|
11
|
-
*/
|
12
|
-
let Divider = class Divider extends GlobalStyle {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
/**
|
16
|
-
* Whether to display the divider vertically.
|
17
|
-
*/
|
18
|
-
this.vertical = false;
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
return html `
|
22
|
-
<div
|
23
|
-
part="root"
|
24
|
-
${attr(this.observedRecord)}
|
25
|
-
></div>
|
26
|
-
`;
|
27
|
-
}
|
28
|
-
};
|
29
|
-
__decorate([
|
30
|
-
property({ type: Boolean, reflect: true })
|
31
|
-
], Divider.prototype, "vertical", void 0);
|
32
|
-
Divider = __decorate([
|
33
|
-
godown(protoName),
|
34
|
-
styles(css `
|
35
|
-
:host {
|
36
|
-
width: 100%;
|
37
|
-
height: 0.05em;
|
38
|
-
margin: auto;
|
39
|
-
display: block;
|
40
|
-
background: currentColor;
|
41
|
-
color: var(${cssGlobalVars.passive});
|
42
|
-
}
|
43
|
-
|
44
|
-
:host([vertical]) {
|
45
|
-
width: 0.05em;
|
46
|
-
height: max(1em, 100%);
|
47
|
-
}
|
48
|
-
|
49
|
-
:host([contents]) [part="root"] {
|
50
|
-
width: 100%;
|
51
|
-
height: 0.05em;
|
52
|
-
margin: auto;
|
53
|
-
display: block;
|
54
|
-
background: currentColor;
|
55
|
-
}
|
56
|
-
|
57
|
-
[part="root"] {
|
58
|
-
display: contents;
|
59
|
-
}
|
60
|
-
`)
|
61
|
-
], Divider);
|
62
|
-
export default Divider;
|
63
|
-
export { Divider };
|
64
|
-
//# sourceMappingURL=divider.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"divider.js","sourceRoot":"","sources":["../../src/components/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;GAIG;AA6BH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QACE;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;IAUnB,CAAC;IARW,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;;KAE9B,CAAC;IACJ,CAAC;CACF,CAAA;AAVC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCAC1B;AALb,OAAO;IA5BZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;;;iBAOM,aAAa,CAAC,OAAO;;;;;;;;;;;;;;;;;;;CAmBrC,CAAC;GACI,OAAO,CAeZ;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import { type EventListenerFunc } from "@godown/element";
|
2
|
-
import { type TemplateResult } from "lit";
|
3
|
-
import { GlobalStyle } from "../core/global-style.js";
|
4
|
-
/**
|
5
|
-
* {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
|
6
|
-
*
|
7
|
-
* @category wrapper
|
8
|
-
*/
|
9
|
-
declare class Dragbox extends GlobalStyle {
|
10
|
-
/**
|
11
|
-
* Width of (`this.offsetParent` or `document.body`).
|
12
|
-
*/
|
13
|
-
get offsetsWidth(): number;
|
14
|
-
/**
|
15
|
-
* Height of (`this.offsetParent` or `document.body`).
|
16
|
-
*/
|
17
|
-
get offsetsHeight(): number;
|
18
|
-
private __drag;
|
19
|
-
private __t;
|
20
|
-
private __l;
|
21
|
-
private __cx;
|
22
|
-
private __cy;
|
23
|
-
/**
|
24
|
-
* Position x.
|
25
|
-
*/
|
26
|
-
x: string;
|
27
|
-
/**
|
28
|
-
* Position y.
|
29
|
-
*/
|
30
|
-
y: string;
|
31
|
-
protected render(): TemplateResult<1>;
|
32
|
-
protected firstUpdated(): void;
|
33
|
-
protected _handleDragStart(e: MouseEvent): void;
|
34
|
-
protected _handleMouseMove: EventListenerFunc;
|
35
|
-
protected _handleMouseLeave: EventListenerFunc;
|
36
|
-
protected _handleDragEnd(): void;
|
37
|
-
protected _handleDrag(e: MouseEvent): void;
|
38
|
-
reset(): void;
|
39
|
-
}
|
40
|
-
export default Dragbox;
|
41
|
-
export { Dragbox };
|
42
|
-
//# sourceMappingURL=dragbox.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dragbox.d.ts","sourceRoot":"","sources":["../../src/components/dragbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAkC,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;GAIG;AACH,cAYM,OAAQ,SAAQ,WAAW;IAC/B;;OAEG;IACH,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAI,aAAa,IAAI,MAAM,CAE1B;IAED,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IAErB;;OAEG;IAEH,CAAC,SAAU;IAEX;;OAEG;IAEH,CAAC,SAAU;IAEX,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAarC,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAU/C,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAC9C,SAAS,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE/C,SAAS,CAAC,cAAc,IAAI,IAAI;IAMhC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAuB1C,KAAK,IAAI,IAAI;CAWd;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
@@ -1,126 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property } from "lit/decorators.js";
|
5
|
-
import { GlobalStyle } from "../core/global-style.js";
|
6
|
-
const protoName = "dragbox";
|
7
|
-
/**
|
8
|
-
* {@linkcode Dragbox} does not extend beyond the range of {@linkcode Dragbox.offsetsWidth} and {@linkcode Dragbox.offsetsHeight}.
|
9
|
-
*
|
10
|
-
* @category wrapper
|
11
|
-
*/
|
12
|
-
let Dragbox = class Dragbox extends GlobalStyle {
|
13
|
-
constructor() {
|
14
|
-
super(...arguments);
|
15
|
-
this.__drag = false;
|
16
|
-
/**
|
17
|
-
* Position x.
|
18
|
-
*/
|
19
|
-
this.x = "auto";
|
20
|
-
/**
|
21
|
-
* Position y.
|
22
|
-
*/
|
23
|
-
this.y = "auto";
|
24
|
-
}
|
25
|
-
/**
|
26
|
-
* Width of (`this.offsetParent` or `document.body`).
|
27
|
-
*/
|
28
|
-
get offsetsWidth() {
|
29
|
-
return this.offsetParent?.clientWidth ?? document.body.offsetWidth;
|
30
|
-
}
|
31
|
-
/**
|
32
|
-
* Height of (`this.offsetParent` or `document.body`).
|
33
|
-
*/
|
34
|
-
get offsetsHeight() {
|
35
|
-
return this.offsetParent?.clientHeight ?? document.body.offsetHeight;
|
36
|
-
}
|
37
|
-
render() {
|
38
|
-
return html `
|
39
|
-
<div
|
40
|
-
part="root"
|
41
|
-
${attr(this.observedRecord)}
|
42
|
-
@mousedown="${this._handleDragStart}"
|
43
|
-
@mouseup="${this._handleDragEnd}"
|
44
|
-
>
|
45
|
-
${htmlSlot()}
|
46
|
-
</div>
|
47
|
-
`;
|
48
|
-
}
|
49
|
-
firstUpdated() {
|
50
|
-
this.reset();
|
51
|
-
}
|
52
|
-
_handleDragStart(e) {
|
53
|
-
this.__cx = e.clientX;
|
54
|
-
this.__cy = e.clientY;
|
55
|
-
this.__t = this.offsetTop;
|
56
|
-
this.__l = this.offsetLeft;
|
57
|
-
this.__drag = true;
|
58
|
-
this._handleMouseMove = this.events.add(document, "mousemove", this._handleDrag.bind(this));
|
59
|
-
this._handleMouseLeave = this.events.add(document, "mouseleave", this._handleDragEnd.bind(this));
|
60
|
-
}
|
61
|
-
_handleDragEnd() {
|
62
|
-
this.__drag = false;
|
63
|
-
this.events.remove(document, "mousemove", this._handleMouseMove);
|
64
|
-
this.events.remove(document, "mouseleave", this._handleMouseLeave);
|
65
|
-
}
|
66
|
-
_handleDrag(e) {
|
67
|
-
if (!this.__drag) {
|
68
|
-
return;
|
69
|
-
}
|
70
|
-
const nl = e.clientX - (this.__cx - this.__l);
|
71
|
-
const nt = e.clientY - (this.__cy - this.__t);
|
72
|
-
const { style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight } = this;
|
73
|
-
if (nl < 0) {
|
74
|
-
style.left = "0";
|
75
|
-
}
|
76
|
-
else if (nl < offsetsWidth - offsetWidth) {
|
77
|
-
style.left = `${nl}px`;
|
78
|
-
}
|
79
|
-
else {
|
80
|
-
style.left = `${offsetsWidth - offsetWidth}"px"`;
|
81
|
-
}
|
82
|
-
if (nt < 0) {
|
83
|
-
style.top = "0";
|
84
|
-
}
|
85
|
-
else if (nt < offsetsHeight - offsetHeight) {
|
86
|
-
style.top = `${nt}px`;
|
87
|
-
}
|
88
|
-
else {
|
89
|
-
style.top = `${offsetsHeight - offsetHeight}px`;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
reset() {
|
93
|
-
const { x, y, style, offsetsWidth, offsetsHeight, offsetWidth, offsetHeight, offsetLeft, offsetTop } = this;
|
94
|
-
style.left = x || "0";
|
95
|
-
style.top = y || "0";
|
96
|
-
if (offsetLeft > offsetsWidth - offsetWidth) {
|
97
|
-
style.left = `${offsetsWidth - offsetWidth}px`;
|
98
|
-
}
|
99
|
-
if (offsetTop > offsetsHeight - offsetHeight) {
|
100
|
-
style.top = `${offsetsHeight - offsetHeight}px`;
|
101
|
-
}
|
102
|
-
}
|
103
|
-
};
|
104
|
-
__decorate([
|
105
|
-
property()
|
106
|
-
], Dragbox.prototype, "x", void 0);
|
107
|
-
__decorate([
|
108
|
-
property()
|
109
|
-
], Dragbox.prototype, "y", void 0);
|
110
|
-
Dragbox = __decorate([
|
111
|
-
godown(protoName),
|
112
|
-
styles(css `
|
113
|
-
:host {
|
114
|
-
position: absolute;
|
115
|
-
display: block;
|
116
|
-
}
|
117
|
-
|
118
|
-
:host(:active) {
|
119
|
-
-webkit-user-select: none;
|
120
|
-
user-select: none;
|
121
|
-
}
|
122
|
-
`)
|
123
|
-
], Dragbox);
|
124
|
-
export default Dragbox;
|
125
|
-
export { Dragbox };
|
126
|
-
//# sourceMappingURL=dragbox.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"dragbox.js","sourceRoot":"","sources":["../../src/components/dragbox.ts"],"names":[],"mappings":";AAAA,OAAO,EAA0B,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,SAAS,CAAC;AAE5B;;;;GAIG;AAaH,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,WAAW;IAAjC;;QAeU,WAAM,GAAG,KAAK,CAAC;QAMvB;;WAEG;QAEH,MAAC,GAAG,MAAM,CAAC;QAEX;;WAEG;QAEH,MAAC,GAAG,MAAM,CAAC;IAwEb,CAAC;IAtGC;;OAEG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,YAAY,EAAE,WAAW,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC;IACrE,CAAC;IAED;;OAEG;IACH,IA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AK,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,CAAC;QACrB,IAAI,UAAU,GAAG,YAAY,GAAG,WAAW,EAAE,CAAC;YAC5C,KAAK,CAAC,IAAI,GAAG,GAAG,YAAY,GAAG,WAAW,IAAI,CAAC;QACjD,CAAC;QACD,IAAI,SAAS,GAAG,aAAa,GAAG,YAAY,EAAE,CAAC;YAC7C,KAAK,CAAC,GAAG,GAAG,GAAG,aAAa,GAAG,YAAY,IAAI,CAAC;QAClD,CAAC;IACH,CAAC;CACF,CAAA;AA9EC;IADC,QAAQ,EAAE;kCACA;AAMX;IADC,QAAQ,EAAE;kCACA;AA/BP,OAAO;IAZZ,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;CAUV,CAAC;GACI,OAAO,CAuGZ;AAED,eAAe,OAAO,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dev/components/flex.d.ts
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { GlobalStyle } from "../core/global-style.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Flex} provides flex layout.
|
5
|
-
*
|
6
|
-
* @slot - Flex items.
|
7
|
-
* @category layout
|
8
|
-
*/
|
9
|
-
declare class Flex extends GlobalStyle {
|
10
|
-
/**
|
11
|
-
* CSS property `flex-flow` (`flex-direction flex-wrap`).
|
12
|
-
*/
|
13
|
-
flexFlow: string;
|
14
|
-
/**
|
15
|
-
* CSS property `gap`.
|
16
|
-
*/
|
17
|
-
gap: string;
|
18
|
-
/**
|
19
|
-
* CSS property `justify-content`.
|
20
|
-
*/
|
21
|
-
content: string;
|
22
|
-
/**
|
23
|
-
* CSS property `align-items`.
|
24
|
-
*/
|
25
|
-
items: string;
|
26
|
-
/**
|
27
|
-
* If true, set flex-direction to "column".
|
28
|
-
*/
|
29
|
-
vertical: boolean;
|
30
|
-
protected render(): TemplateResult<1>;
|
31
|
-
}
|
32
|
-
export default Flex;
|
33
|
-
export { Flex };
|
34
|
-
//# sourceMappingURL=flex.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"flex.d.ts","sourceRoot":"","sources":["../../src/components/flex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAWM,IAAK,SAAQ,WAAW;IAC5B;;OAEG;IAEH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IAEH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IAEH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,QAAQ,UAAS;IAEjB,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAuBtC;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dev/components/flex.js
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, godown, htmlSlot, htmlStyle, joinRules, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property } from "lit/decorators.js";
|
5
|
-
import { GlobalStyle } from "../core/global-style.js";
|
6
|
-
const protoName = "flex";
|
7
|
-
/**
|
8
|
-
* {@linkcode Flex} provides flex layout.
|
9
|
-
*
|
10
|
-
* @slot - Flex items.
|
11
|
-
* @category layout
|
12
|
-
*/
|
13
|
-
let Flex = class Flex extends GlobalStyle {
|
14
|
-
constructor() {
|
15
|
-
super(...arguments);
|
16
|
-
/**
|
17
|
-
* If true, set flex-direction to "column".
|
18
|
-
*/
|
19
|
-
this.vertical = false;
|
20
|
-
}
|
21
|
-
render() {
|
22
|
-
return html `
|
23
|
-
<div
|
24
|
-
part="root"
|
25
|
-
${attr(this.observedRecord)}
|
26
|
-
>
|
27
|
-
${[
|
28
|
-
htmlSlot(),
|
29
|
-
htmlStyle(joinRules({
|
30
|
-
":host": {
|
31
|
-
gap: this.gap,
|
32
|
-
"flex-flow": this.flexFlow,
|
33
|
-
"flex-direction": this.vertical && "column",
|
34
|
-
"align-items": this.items,
|
35
|
-
"justify-content": this.content,
|
36
|
-
},
|
37
|
-
})),
|
38
|
-
]}
|
39
|
-
</div>
|
40
|
-
`;
|
41
|
-
}
|
42
|
-
};
|
43
|
-
__decorate([
|
44
|
-
property({ attribute: "flex-flow" })
|
45
|
-
], Flex.prototype, "flexFlow", void 0);
|
46
|
-
__decorate([
|
47
|
-
property()
|
48
|
-
], Flex.prototype, "gap", void 0);
|
49
|
-
__decorate([
|
50
|
-
property()
|
51
|
-
], Flex.prototype, "content", void 0);
|
52
|
-
__decorate([
|
53
|
-
property()
|
54
|
-
], Flex.prototype, "items", void 0);
|
55
|
-
__decorate([
|
56
|
-
property({ type: Boolean })
|
57
|
-
], Flex.prototype, "vertical", void 0);
|
58
|
-
Flex = __decorate([
|
59
|
-
godown(protoName),
|
60
|
-
styles(css `
|
61
|
-
:host,
|
62
|
-
:host([contents]) [part="root"] {
|
63
|
-
display: flex;
|
64
|
-
}
|
65
|
-
|
66
|
-
[part="root"] {
|
67
|
-
display: contents;
|
68
|
-
}
|
69
|
-
`)
|
70
|
-
], Flex);
|
71
|
-
export default Flex;
|
72
|
-
export { Flex };
|
73
|
-
//# sourceMappingURL=flex.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"flex.js","sourceRoot":"","sources":["../../src/components/flex.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;GAKG;AAYH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW;IAA9B;;QAyBE;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;IAyBnB,CAAC;IAvBW,MAAM;QACd,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;;UAEzB;YACA,QAAQ,EAAE;YACV,SAAS,CACP,SAAS,CAAC;gBACR,OAAO,EAAE;oBACP,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,WAAW,EAAE,IAAI,CAAC,QAAQ;oBAC1B,gBAAgB,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ;oBAC3C,aAAa,EAAE,IAAI,CAAC,KAAK;oBACzB,iBAAiB,EAAE,IAAI,CAAC,OAAO;iBAChC;aACF,CAAC,CACH;SACF;;KAEJ,CAAC;IACJ,CAAC;CACF,CAAA;AAjDC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;sCACpB;AAMjB;IADC,QAAQ,EAAE;iCACC;AAMZ;IADC,QAAQ,EAAE;qCACK;AAMhB;IADC,QAAQ,EAAE;mCACG;AAMd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;sCACX;AA7Bb,IAAI;IAXT,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;;;;;CASV,CAAC;GACI,IAAI,CAsDT;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dev/components/form.d.ts
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { GlobalStyle } from "../core/global-style.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Form} Gets child element key-value object,
|
5
|
-
* which will be nested if the child element is the same as this element.
|
6
|
-
*
|
7
|
-
* @category form
|
8
|
-
*/
|
9
|
-
declare class Form<T = object> extends GlobalStyle {
|
10
|
-
name: string;
|
11
|
-
get value(): T;
|
12
|
-
nameValue: () => [string, T];
|
13
|
-
protected render(): TemplateResult<1>;
|
14
|
-
reset(): void;
|
15
|
-
namevalue(): [string, T];
|
16
|
-
static buildValue(elements: (Element & {
|
17
|
-
name?: string;
|
18
|
-
value?: unknown;
|
19
|
-
namevalue?: () => [string, unknown];
|
20
|
-
})[]): Record<string, any>;
|
21
|
-
}
|
22
|
-
export default Form;
|
23
|
-
export { Form };
|
24
|
-
//# sourceMappingURL=form.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/components/form.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAO,MAAM,KAAK,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD;;;;;GAKG;AACH,cAMM,IAAI,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW;IAExC,IAAI,SAAM;IAEV,IAAI,KAAK,IAAI,CAAC,CAEb;IAED,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAkB;IAE9C,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAIrC,KAAK,IAAI,IAAI;IAWb,SAAS,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IAIxB,MAAM,CAAC,UAAU,CACf,QAAQ,EAAE,CAAC,OAAO,GAAG;QACnB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACrC,CAAC,EAAE,GACH,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;CAoBvB;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dev/components/form.js
DELETED
@@ -1,76 +0,0 @@
|
|
1
|
-
var Form_1;
|
2
|
-
import { __decorate } from "tslib";
|
3
|
-
import { godown, htmlSlot, styles } from "@godown/element";
|
4
|
-
import { css } from "lit";
|
5
|
-
import { property } from "lit/decorators.js";
|
6
|
-
import { GlobalStyle } from "../core/global-style.js";
|
7
|
-
const protoName = "form";
|
8
|
-
/**
|
9
|
-
* {@linkcode Form} Gets child element key-value object,
|
10
|
-
* which will be nested if the child element is the same as this element.
|
11
|
-
*
|
12
|
-
* @category form
|
13
|
-
*/
|
14
|
-
let Form = Form_1 = class Form extends GlobalStyle {
|
15
|
-
constructor() {
|
16
|
-
super(...arguments);
|
17
|
-
this.name = "";
|
18
|
-
this.nameValue = this.namevalue;
|
19
|
-
}
|
20
|
-
get value() {
|
21
|
-
return Form_1.buildValue(this._slot.assignedElements());
|
22
|
-
}
|
23
|
-
render() {
|
24
|
-
return htmlSlot();
|
25
|
-
}
|
26
|
-
reset() {
|
27
|
-
this.deepQuerySelectorAll("*").forEach((el) => {
|
28
|
-
if (el.tagName === this.tagName) {
|
29
|
-
return;
|
30
|
-
}
|
31
|
-
if (el.reset) {
|
32
|
-
el.reset();
|
33
|
-
}
|
34
|
-
});
|
35
|
-
}
|
36
|
-
namevalue() {
|
37
|
-
return [this.name, this.value];
|
38
|
-
}
|
39
|
-
static buildValue(elements) {
|
40
|
-
const result = {};
|
41
|
-
for (const el of elements) {
|
42
|
-
if (el.tagName === "FORM") {
|
43
|
-
Object.assign(result, Object.fromEntries(new FormData(el).entries()));
|
44
|
-
}
|
45
|
-
else if (el.namevalue) {
|
46
|
-
const [name, value] = el.namevalue();
|
47
|
-
if (name) {
|
48
|
-
result[name] = value;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
else if (el.name && el.value !== undefined) {
|
52
|
-
result[el.name] = el.value;
|
53
|
-
}
|
54
|
-
else if (el.shadowRoot) {
|
55
|
-
for (const slot of el.shadowRoot.querySelectorAll("slot")) {
|
56
|
-
Object.assign(result, this.buildValue(slot.assignedElements()));
|
57
|
-
}
|
58
|
-
}
|
59
|
-
}
|
60
|
-
return result;
|
61
|
-
}
|
62
|
-
};
|
63
|
-
__decorate([
|
64
|
-
property()
|
65
|
-
], Form.prototype, "name", void 0);
|
66
|
-
Form = Form_1 = __decorate([
|
67
|
-
godown(protoName),
|
68
|
-
styles(css `
|
69
|
-
:host {
|
70
|
-
display: block;
|
71
|
-
}
|
72
|
-
`)
|
73
|
-
], Form);
|
74
|
-
export default Form;
|
75
|
-
export { Form };
|
76
|
-
//# sourceMappingURL=form.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"form.js","sourceRoot":"","sources":["../../src/components/form.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAuB,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB;;;;;GAKG;AAOH,IAAM,IAAI,YAAV,MAAM,IAAiB,SAAQ,WAAW;IAA1C;;QAEE,SAAI,GAAG,EAAE,CAAC;QAMV,cAAS,GAAsB,IAAI,CAAC,SAAS,CAAC;IA+ChD,CAAC;IAnDC,IAAI,KAAK;QACP,OAAO,MAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAM,CAAC;IAC7D,CAAC;IAIS,MAAM;QACd,OAAO,QAAQ,EAAE,CAAC;IACpB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,oBAAoB,CAAuC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE;YAClF,IAAI,EAA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