smoothly 0.1.121 → 0.2.2
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/smoothly-accordion_51.cjs.entry.js +68 -52
- package/dist/cjs/smoothly.cjs.js +1 -1
- package/dist/collection/components/app/style.css +12 -12
- package/dist/collection/components/button/style.css +1 -2
- package/dist/collection/components/calendar/style.css +2 -3
- package/dist/collection/components/input/index.js +68 -8
- package/dist/collection/components/input-date/index.js +1 -1
- package/dist/collection/components/input-date/style.css +2 -3
- package/dist/collection/components/input-date-range/index.js +2 -2
- package/dist/collection/components/input-demo/index.js +2 -1
- package/dist/collection/components/item/style.css +2 -3
- package/dist/collection/components/select-demo/style.css +1 -1
- package/dist/collection/components/selector/style.css +0 -2
- package/dist/collection/components/tab/style.css +3 -4
- package/dist/collection/components/tab-switch/index.js +1 -0
- package/dist/collection/components/tab-switch/style.css +1 -1
- package/dist/collection/components/table/cell/style.css +3 -1
- package/dist/collection/components/table/demo/index.js +38 -32
- package/dist/collection/components/table/expandable/cell/index.js +8 -9
- package/dist/collection/components/table/expandable/cell/style.css +38 -1
- package/dist/collection/components/table/expandable/row/index.js +84 -21
- package/dist/collection/components/table/expandable/row/style.css +35 -4
- package/dist/collection/components/table/header/index.js +22 -2
- package/dist/collection/components/table/header/style.css +5 -3
- package/dist/collection/components/table/index.js +33 -1
- package/dist/collection/components/table/row/index.js +20 -84
- package/dist/collection/components/table/row/style.css +2 -8
- package/dist/collection/components/table/style.css +8 -3
- package/dist/custom-elements/index.js +74 -58
- package/dist/esm/loader.js +1 -1
- package/dist/esm/smoothly-accordion_51.entry.js +68 -52
- package/dist/esm/smoothly.js +1 -1
- package/dist/smoothly/p-9d6a20c4.entry.js +1 -0
- package/dist/smoothly/smoothly.esm.js +1 -1
- package/dist/types/components/input/index.d.ts +10 -3
- package/dist/types/components/table/expandable/cell/index.d.ts +2 -2
- package/dist/types/components/table/expandable/row/index.d.ts +9 -4
- package/dist/types/components/table/header/index.d.ts +1 -0
- package/dist/types/components/table/index.d.ts +3 -0
- package/dist/types/components/table/row/index.d.ts +3 -9
- package/dist/types/components.d.ts +14 -7
- package/package.json +2 -2
- package/dist/smoothly/p-f4529a2d.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, h, Host, Method, Prop, Watch } from "@stencil/core";
|
|
1
|
+
import { Component, Event, h, Host, Method, Prop, State, Watch } from "@stencil/core";
|
|
2
2
|
import { Language, Locale } from "isoly";
|
|
3
3
|
import { Action, get, StateEditor } from "tidily";
|
|
4
4
|
export class SmoothlyInput {
|
|
@@ -11,6 +11,7 @@ export class SmoothlyInput {
|
|
|
11
11
|
this.maxLength = Number.POSITIVE_INFINITY;
|
|
12
12
|
this.autocomplete = true;
|
|
13
13
|
this.disabled = false;
|
|
14
|
+
this.readonly = false;
|
|
14
15
|
}
|
|
15
16
|
get formatter() {
|
|
16
17
|
let result;
|
|
@@ -36,7 +37,7 @@ export class SmoothlyInput {
|
|
|
36
37
|
if (value != before) {
|
|
37
38
|
if (typeof value == "string")
|
|
38
39
|
value = value.trim();
|
|
39
|
-
this.
|
|
40
|
+
this.smoothlyInput.emit({ name: this.name, value });
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
onCurrency() {
|
|
@@ -86,8 +87,14 @@ export class SmoothlyInput {
|
|
|
86
87
|
const after = this.formatter.format(StateEditor.copy(this.formatter.unformat(StateEditor.copy(Object.assign({}, this.state)))));
|
|
87
88
|
this.updateBackend(after, this.inputElement);
|
|
88
89
|
}
|
|
89
|
-
onBlur(event) {
|
|
90
|
+
onBlur(event) {
|
|
91
|
+
this.smoothlyBlur.emit();
|
|
92
|
+
if (this.initialValue != this.value)
|
|
93
|
+
this.smoothlyChange.emit({ name: this.name, value: this.value });
|
|
94
|
+
this.initialValue = undefined;
|
|
95
|
+
}
|
|
90
96
|
onFocus(event) {
|
|
97
|
+
this.initialValue = this.value;
|
|
91
98
|
const after = this.formatter.format(StateEditor.copy(this.formatter.unformat(StateEditor.copy(Object.assign({}, this.state)))));
|
|
92
99
|
if (event.target)
|
|
93
100
|
this.updateBackend(after, event.target);
|
|
@@ -163,8 +170,10 @@ export class SmoothlyInput {
|
|
|
163
170
|
return value;
|
|
164
171
|
}
|
|
165
172
|
processKey(event, backend) {
|
|
166
|
-
|
|
167
|
-
|
|
173
|
+
if (!this.readonly) {
|
|
174
|
+
const after = Action.apply(this.formatter, this.state, event);
|
|
175
|
+
this.updateBackend(after, backend);
|
|
176
|
+
}
|
|
168
177
|
}
|
|
169
178
|
updateBackend(after, backend) {
|
|
170
179
|
if (after.value != backend.value)
|
|
@@ -181,7 +190,7 @@ export class SmoothlyInput {
|
|
|
181
190
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
182
191
|
return (h(Host, { class: { "has-value": ((_a = this.state) === null || _a === void 0 ? void 0 : _a.value) != undefined && ((_b = this.state) === null || _b === void 0 ? void 0 : _b.value) != "" }, onclick: () => { var _a; return (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.focus(); } },
|
|
183
192
|
h("div", null,
|
|
184
|
-
h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }),
|
|
193
|
+
h("input", { name: this.name, type: (_c = this.state) === null || _c === void 0 ? void 0 : _c.type, placeholder: this.placeholder, required: this.required, autocomplete: this.autocomplete ? (_d = this.state) === null || _d === void 0 ? void 0 : _d.autocomplete : "off", disabled: this.disabled, readOnly: this.readonly, pattern: ((_e = this.state) === null || _e === void 0 ? void 0 : _e.pattern) && ((_f = this.state) === null || _f === void 0 ? void 0 : _f.pattern.source), value: (_g = this.state) === null || _g === void 0 ? void 0 : _g.value, onInput: (e) => this.onInput(e), onFocus: e => this.onFocus(e), onClick: e => this.onClick(e), onBlur: e => this.onBlur(e), onKeyDown: e => this.onKeyDown(e), ref: (el) => (this.inputElement = el), onPaste: e => this.onPaste(e) }),
|
|
185
194
|
h("label", { htmlFor: this.name },
|
|
186
195
|
h("slot", null)),
|
|
187
196
|
h("smoothly-icon", { name: "alert-circle", color: "danger", fill: "clear", size: "small" }))));
|
|
@@ -391,6 +400,24 @@ export class SmoothlyInput {
|
|
|
391
400
|
"reflect": false,
|
|
392
401
|
"defaultValue": "false"
|
|
393
402
|
},
|
|
403
|
+
"readonly": {
|
|
404
|
+
"type": "boolean",
|
|
405
|
+
"mutable": true,
|
|
406
|
+
"complexType": {
|
|
407
|
+
"original": "boolean",
|
|
408
|
+
"resolved": "boolean",
|
|
409
|
+
"references": {}
|
|
410
|
+
},
|
|
411
|
+
"required": false,
|
|
412
|
+
"optional": false,
|
|
413
|
+
"docs": {
|
|
414
|
+
"tags": [],
|
|
415
|
+
"text": ""
|
|
416
|
+
},
|
|
417
|
+
"attribute": "readonly",
|
|
418
|
+
"reflect": false,
|
|
419
|
+
"defaultValue": "false"
|
|
420
|
+
},
|
|
394
421
|
"currency": {
|
|
395
422
|
"type": "string",
|
|
396
423
|
"mutable": false,
|
|
@@ -414,9 +441,42 @@ export class SmoothlyInput {
|
|
|
414
441
|
"reflect": true
|
|
415
442
|
}
|
|
416
443
|
}; }
|
|
444
|
+
static get states() { return {
|
|
445
|
+
"initialValue": {}
|
|
446
|
+
}; }
|
|
417
447
|
static get events() { return [{
|
|
418
|
-
"method": "
|
|
419
|
-
"name": "
|
|
448
|
+
"method": "smoothlyBlur",
|
|
449
|
+
"name": "smoothlyBlur",
|
|
450
|
+
"bubbles": true,
|
|
451
|
+
"cancelable": true,
|
|
452
|
+
"composed": true,
|
|
453
|
+
"docs": {
|
|
454
|
+
"tags": [],
|
|
455
|
+
"text": ""
|
|
456
|
+
},
|
|
457
|
+
"complexType": {
|
|
458
|
+
"original": "void",
|
|
459
|
+
"resolved": "void",
|
|
460
|
+
"references": {}
|
|
461
|
+
}
|
|
462
|
+
}, {
|
|
463
|
+
"method": "smoothlyChange",
|
|
464
|
+
"name": "smoothlyChange",
|
|
465
|
+
"bubbles": true,
|
|
466
|
+
"cancelable": true,
|
|
467
|
+
"composed": true,
|
|
468
|
+
"docs": {
|
|
469
|
+
"tags": [],
|
|
470
|
+
"text": ""
|
|
471
|
+
},
|
|
472
|
+
"complexType": {
|
|
473
|
+
"original": "{ name: string; value: any }",
|
|
474
|
+
"resolved": "{ name: string; value: any; }",
|
|
475
|
+
"references": {}
|
|
476
|
+
}
|
|
477
|
+
}, {
|
|
478
|
+
"method": "smoothlyInput",
|
|
479
|
+
"name": "smoothlyInput",
|
|
420
480
|
"bubbles": true,
|
|
421
481
|
"cancelable": true,
|
|
422
482
|
"composed": true,
|
|
@@ -11,7 +11,7 @@ export class InputDate {
|
|
|
11
11
|
render() {
|
|
12
12
|
var _a;
|
|
13
13
|
return [
|
|
14
|
-
h("smoothly-input", { onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value,
|
|
14
|
+
h("smoothly-input", { onClick: () => (this.open = !this.open), disabled: this.disabled, type: "date", value: this.value, onSmoothlyInput: e => (this.value = e.detail.value) },
|
|
15
15
|
h("slot", null)),
|
|
16
16
|
this.open && !this.disabled
|
|
17
17
|
? [
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
position: relative;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
4
|
nav {
|
|
6
5
|
position: absolute;
|
|
7
6
|
z-index: 10;
|
|
8
7
|
top: 3.5em;
|
|
9
8
|
background-color: rgb(var(--smoothly-default-shade));
|
|
10
9
|
max-width: 22em;
|
|
11
|
-
}
|
|
10
|
+
}
|
|
12
11
|
:host > div {
|
|
13
12
|
position: fixed;
|
|
14
13
|
top: 0px;
|
|
@@ -22,7 +21,7 @@ nav {
|
|
|
22
21
|
:host > nav > .arrow {
|
|
23
22
|
position: absolute;
|
|
24
23
|
z-index: 9;
|
|
25
|
-
transform: translate(2em,
|
|
24
|
+
transform: translate(2em, -0.55em) rotate(45deg);
|
|
26
25
|
width: 1em;
|
|
27
26
|
height: 1em;
|
|
28
27
|
background-color: rgb(var(--smoothly-default-shade));
|
|
@@ -23,9 +23,9 @@ export class InputDateRange {
|
|
|
23
23
|
var _a;
|
|
24
24
|
return [
|
|
25
25
|
h("section", { onClick: () => (this.open = !this.open) },
|
|
26
|
-
h("smoothly-input", { type: "date", value: this.start, showLabel: this.showLabel,
|
|
26
|
+
h("smoothly-input", { type: "date", value: this.start, showLabel: this.showLabel, onSmoothlyInput: e => (this.start = e.detail.value) }, "from"),
|
|
27
27
|
h("span", null, "\u2013"),
|
|
28
|
-
h("smoothly-input", { type: "date", showLabel: this.showLabel, value: this.end,
|
|
28
|
+
h("smoothly-input", { type: "date", showLabel: this.showLabel, value: this.end, onSmoothlyInput: e => (this.end = e.detail.value) }, "to")),
|
|
29
29
|
this.open ? h("div", { onClick: () => (this.open = false) }) : [],
|
|
30
30
|
this.open ? (h("nav", null,
|
|
31
31
|
h("div", { class: "arrow" }),
|
|
@@ -6,7 +6,8 @@ export class SmoothlyInputDemo {
|
|
|
6
6
|
h("header", null,
|
|
7
7
|
h("h5", null, "Address")),
|
|
8
8
|
h("main", null,
|
|
9
|
-
h("smoothly-input", { type: "text", name: "name" }, "
|
|
9
|
+
h("smoothly-input", { type: "text", name: "name", readonly: true, value: "Readonly", onSmoothlyBlur: () => console.log("smoothly blur") }, "Readonly"),
|
|
10
|
+
h("smoothly-input", { type: "text", name: "name", onSmoothlyChange: e => console.log("smoothly change event") }, "Name"),
|
|
10
11
|
h("smoothly-input", { type: "date", name: "date" }, "Date"),
|
|
11
12
|
h("smoothly-input", { type: "date-time", name: "date-time" }, "Date-Time"),
|
|
12
13
|
h("smoothly-input", { type: "divisor", name: "divisor" }, "Divisor"),
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
color: rgb(var(--smoothly-primary-contrast));
|
|
4
4
|
}
|
|
5
5
|
:host {
|
|
6
|
-
padding: .5em;
|
|
6
|
+
padding: 0.5em;
|
|
7
7
|
cursor: pointer;
|
|
8
8
|
background-color: rgb(var(--smoothly-default-shade));
|
|
9
9
|
color: rgb(var(--smoothly-default-contrast));
|
|
10
|
-
border: rgb(var(--smoothly-default-shade) solid 1px)
|
|
10
|
+
border: rgb(var(--smoothly-default-shade) solid 1px);
|
|
11
11
|
}
|
|
12
12
|
:host:hover {
|
|
13
13
|
background-color: rgb(var(--smoothly-primary-color));
|
|
14
14
|
color: rgb(var(--smoothly-primary-contrast));
|
|
15
15
|
}
|
|
16
|
-
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
}
|
|
7
7
|
label {
|
|
8
8
|
display: block;
|
|
9
|
-
|
|
9
|
+
padding: 1em;
|
|
10
10
|
background-color: rgb(var(--smoothly-default-shade));
|
|
11
11
|
border-top-left-radius: 0.3rem;
|
|
12
12
|
border-top-right-radius: 0.3rem;
|
|
13
13
|
width: 6.25rem;
|
|
14
|
-
|
|
15
14
|
}
|
|
16
15
|
div {
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
background-color: rgb(var(--smoothly-default-shade));
|
|
17
|
+
padding: 1em;
|
|
19
18
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Element, h, Host, Listen, State, Watch } from "@stencil/core";
|
|
2
2
|
export class SmoothlyTabSwitch {
|
|
3
3
|
openChanged(event) {
|
|
4
|
+
event.stopPropagation();
|
|
4
5
|
this.selectedElement = event.target;
|
|
5
6
|
this.selectedElement.open = true;
|
|
6
7
|
this.element.after(event.detail);
|
|
@@ -6,46 +6,52 @@ export class TableDemo {
|
|
|
6
6
|
h("smoothly-table-row", null,
|
|
7
7
|
h("smoothly-table-header", null, "Header A"),
|
|
8
8
|
h("smoothly-table-header", null, "Header B"),
|
|
9
|
-
h("smoothly-table-header", null, "Header C")
|
|
10
|
-
|
|
9
|
+
h("smoothly-table-header", null, "Header C"),
|
|
10
|
+
h("smoothly-table-header", null, "Header D"),
|
|
11
|
+
h("smoothly-table-header", null)),
|
|
12
|
+
h("smoothly-table-row", null,
|
|
11
13
|
h("smoothly-table-expandable-cell", null,
|
|
12
|
-
"
|
|
13
|
-
h("div", { slot: "detail" }, "
|
|
14
|
+
"normal row (exp.cell)",
|
|
15
|
+
h("div", { slot: "detail" }, "expandable cell 1 content")),
|
|
14
16
|
h("smoothly-table-expandable-cell", null,
|
|
15
|
-
|
|
16
|
-
h("div", { slot: "detail" }, "
|
|
17
|
+
"expandable cell",
|
|
18
|
+
h("div", { slot: "detail" }, "expandable cell 2 content")),
|
|
17
19
|
h("smoothly-table-expandable-cell", null,
|
|
18
|
-
|
|
19
|
-
h("div", { slot: "detail" }, "
|
|
20
|
-
h("smoothly-table-expandable-row", null,
|
|
20
|
+
"expandable cell",
|
|
21
|
+
h("div", { slot: "detail" }, "expandable cell 3 content")),
|
|
21
22
|
h("smoothly-table-expandable-cell", null,
|
|
22
|
-
"
|
|
23
|
-
h("div", { slot: "detail" }, "
|
|
23
|
+
"expandable cell",
|
|
24
|
+
h("div", { slot: "detail" }, "expandable cell 4 content"))),
|
|
25
|
+
h("smoothly-table-row", null,
|
|
26
|
+
h("smoothly-table-cell", null, "normal row (nor.cell)\""),
|
|
27
|
+
h("smoothly-table-cell", null, "normal cell"),
|
|
24
28
|
h("smoothly-table-expandable-cell", null,
|
|
25
|
-
|
|
26
|
-
h("div", { slot: "detail" }, "
|
|
29
|
+
"expandable cell",
|
|
30
|
+
h("div", { slot: "detail" }, "expandable cell details.")),
|
|
27
31
|
h("smoothly-table-expandable-cell", null,
|
|
28
|
-
|
|
29
|
-
h("div", { slot: "detail" }, "
|
|
32
|
+
"expandable cell",
|
|
33
|
+
h("div", { slot: "detail" }, "expandable cell details."))),
|
|
34
|
+
h("smoothly-table-expandable-row", null,
|
|
35
|
+
h("smoothly-table-cell", null, "expandable row (nor.cell)"),
|
|
36
|
+
h("smoothly-table-cell", null, "Normal cell"),
|
|
37
|
+
h("smoothly-table-cell", null, "normal cell"),
|
|
38
|
+
h("smoothly-table-cell", null, "Normal cell"),
|
|
39
|
+
h("div", { slot: "detail" }, "expandable row content"))),
|
|
30
40
|
h("smoothly-table", null,
|
|
31
41
|
h("smoothly-table-row", null,
|
|
32
|
-
h("smoothly-table-header", null, "Header
|
|
33
|
-
h("smoothly-table-header", null
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
h("
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
h("smoothly-display", { type: "price", value: 20, currency: "EUR" })),
|
|
46
|
-
h("smoothly-table-cell", null,
|
|
47
|
-
h("smoothly-display", { type: "price", value: 18, currency: "EUR" })),
|
|
48
|
-
h("div", { slot: "detail" }, "Cost details."))),
|
|
42
|
+
h("smoothly-table-header", null, "Header A"),
|
|
43
|
+
h("smoothly-table-header", null)),
|
|
44
|
+
h("smoothly-table-expandable-row", null,
|
|
45
|
+
"A Content",
|
|
46
|
+
h("div", { slot: "detail" },
|
|
47
|
+
h("smoothly-tab-switch", null,
|
|
48
|
+
h("smoothly-tab", { label: "1", open: true },
|
|
49
|
+
h("smoothly-table", null,
|
|
50
|
+
h("smoothly-table-row", null,
|
|
51
|
+
h("smoothly-table-header", null, "Header B"),
|
|
52
|
+
h("smoothly-table-header", null)),
|
|
53
|
+
h("smoothly-table-expandable-row", null,
|
|
54
|
+
h("smoothly-table-cell", null, "B Content")))))))),
|
|
49
55
|
];
|
|
50
56
|
}
|
|
51
57
|
static get is() { return "smoothly-table-demo"; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Element, Event, h, Host, Listen, Prop,
|
|
1
|
+
import { Component, Element, Event, h, Host, Listen, Prop, Watch } from "@stencil/core";
|
|
2
2
|
export class TableExpandableCell {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.align = "left";
|
|
@@ -14,7 +14,7 @@ export class TableExpandableCell {
|
|
|
14
14
|
this.open = !this.open;
|
|
15
15
|
}
|
|
16
16
|
componentDidLoad() {
|
|
17
|
-
this.
|
|
17
|
+
this.expansionLoad.emit();
|
|
18
18
|
}
|
|
19
19
|
componentDidRender() {
|
|
20
20
|
if (this.beginOpen) {
|
|
@@ -25,9 +25,11 @@ export class TableExpandableCell {
|
|
|
25
25
|
render() {
|
|
26
26
|
return (h(Host, { style: { textAlign: this.align } },
|
|
27
27
|
h("slot", null),
|
|
28
|
+
h("smoothly-icon", { name: "chevron-forward", size: "tiny" }),
|
|
28
29
|
h("tr", { ref: e => (this.expansionElement = e) },
|
|
29
|
-
h("td", { colSpan:
|
|
30
|
-
h("
|
|
30
|
+
h("td", { colSpan: 999, class: !this.open ? "hide" : "" },
|
|
31
|
+
h("div", { class: "slot-detail" },
|
|
32
|
+
h("slot", { name: "detail" }))))));
|
|
31
33
|
}
|
|
32
34
|
static get is() { return "smoothly-table-expandable-cell"; }
|
|
33
35
|
static get encapsulation() { return "scoped"; }
|
|
@@ -74,9 +76,6 @@ export class TableExpandableCell {
|
|
|
74
76
|
"reflect": true
|
|
75
77
|
}
|
|
76
78
|
}; }
|
|
77
|
-
static get states() { return {
|
|
78
|
-
"beginOpen": {}
|
|
79
|
-
}; }
|
|
80
79
|
static get events() { return [{
|
|
81
80
|
"method": "expansionOpen",
|
|
82
81
|
"name": "expansionOpen",
|
|
@@ -97,8 +96,8 @@ export class TableExpandableCell {
|
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}, {
|
|
100
|
-
"method": "
|
|
101
|
-
"name": "
|
|
99
|
+
"method": "expansionLoad",
|
|
100
|
+
"name": "expansionLoad",
|
|
102
101
|
"bubbles": true,
|
|
103
102
|
"cancelable": true,
|
|
104
103
|
"composed": true,
|
|
@@ -1,7 +1,44 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: table-cell;
|
|
3
|
-
|
|
3
|
+
vertical-align: middle;
|
|
4
|
+
line-height: 1.5em;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
padding: 0.2em 0 0.2em;
|
|
7
|
+
border-style: solid solid none solid;
|
|
8
|
+
border-width: 2px;
|
|
9
|
+
border-color: rgb(var(--smoothly-default-color));
|
|
4
10
|
}
|
|
5
11
|
.hide {
|
|
6
12
|
display: none;
|
|
7
13
|
}
|
|
14
|
+
:host[open] {
|
|
15
|
+
position: relative;
|
|
16
|
+
z-index: 3;
|
|
17
|
+
background-color: rgb(var(--smoothly-default-color));
|
|
18
|
+
border-style: solid solid none solid;
|
|
19
|
+
border-width: 2px;
|
|
20
|
+
border-color: rgb(var(--smoothly-dark-color));
|
|
21
|
+
}
|
|
22
|
+
.slot-detail {
|
|
23
|
+
position: relative;
|
|
24
|
+
background-color: rgb(var(--smoothly-default-color));
|
|
25
|
+
width: 104%;
|
|
26
|
+
left: -2%;
|
|
27
|
+
border-left-style: solid;
|
|
28
|
+
border-left-color: rgb(var(--smoothly-tertiary-color));
|
|
29
|
+
box-shadow: 0px 0px 5px 4px rgb(var(--smoothly-dark-color), 0.5);
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
padding: 0.5rem 2%;
|
|
32
|
+
}
|
|
33
|
+
:host smoothly-icon {
|
|
34
|
+
width: 0.6rem;
|
|
35
|
+
height: 1rem;
|
|
36
|
+
float: left;
|
|
37
|
+
padding-left: 0.2rem;
|
|
38
|
+
padding-right: 0.2rem;
|
|
39
|
+
padding-bottom: 0.5rem;
|
|
40
|
+
transition: transform 0.2s;
|
|
41
|
+
}
|
|
42
|
+
:host[open] smoothly-icon {
|
|
43
|
+
transform: rotate(90deg);
|
|
44
|
+
}
|
|
@@ -1,22 +1,30 @@
|
|
|
1
|
-
import { Component, Element, h, Host, Listen } from "@stencil/core";
|
|
1
|
+
import { Component, Element, Event, h, Host, Listen, Prop, Watch } from "@stencil/core";
|
|
2
2
|
export class TableExpandableRow {
|
|
3
3
|
constructor() {
|
|
4
|
-
this.
|
|
4
|
+
this.align = "left";
|
|
5
5
|
}
|
|
6
|
-
|
|
7
|
-
this.
|
|
6
|
+
openChanged(value) {
|
|
7
|
+
if (this.expansionElement)
|
|
8
|
+
this.element.after(this.expansionElement);
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
onClick(e) {
|
|
11
|
+
this.open = !this.open;
|
|
12
|
+
e.stopPropagation();
|
|
13
|
+
}
|
|
14
|
+
componentDidRender() {
|
|
15
|
+
this.expansionOpen.emit(this.expansionElement);
|
|
16
|
+
if (this.expansionElement && this.open)
|
|
17
|
+
this.element.after(this.expansionElement);
|
|
16
18
|
}
|
|
17
19
|
render() {
|
|
18
|
-
return (h(Host,
|
|
19
|
-
h("slot", null)
|
|
20
|
+
return (h(Host, { style: { textAlign: this.align } },
|
|
21
|
+
h("slot", null),
|
|
22
|
+
h("smoothly-table-cell", null,
|
|
23
|
+
h("smoothly-icon", { name: "chevron-forward", size: "tiny" })),
|
|
24
|
+
h("tr", { ref: e => (this.expansionElement = e) },
|
|
25
|
+
h("td", { colSpan: 999, class: !this.open ? "hide" : "" },
|
|
26
|
+
h("div", { class: "slot-detail" },
|
|
27
|
+
h("slot", { name: "detail" }))))));
|
|
20
28
|
}
|
|
21
29
|
static get is() { return "smoothly-table-expandable-row"; }
|
|
22
30
|
static get encapsulation() { return "scoped"; }
|
|
@@ -26,16 +34,71 @@ export class TableExpandableRow {
|
|
|
26
34
|
static get styleUrls() { return {
|
|
27
35
|
"$": ["style.css"]
|
|
28
36
|
}; }
|
|
37
|
+
static get properties() { return {
|
|
38
|
+
"align": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"mutable": false,
|
|
41
|
+
"complexType": {
|
|
42
|
+
"original": "\"left\" | \"center\" | \"right\"",
|
|
43
|
+
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
44
|
+
"references": {}
|
|
45
|
+
},
|
|
46
|
+
"required": false,
|
|
47
|
+
"optional": false,
|
|
48
|
+
"docs": {
|
|
49
|
+
"tags": [],
|
|
50
|
+
"text": ""
|
|
51
|
+
},
|
|
52
|
+
"attribute": "align",
|
|
53
|
+
"reflect": false,
|
|
54
|
+
"defaultValue": "\"left\""
|
|
55
|
+
},
|
|
56
|
+
"open": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"mutable": true,
|
|
59
|
+
"complexType": {
|
|
60
|
+
"original": "boolean",
|
|
61
|
+
"resolved": "boolean",
|
|
62
|
+
"references": {}
|
|
63
|
+
},
|
|
64
|
+
"required": false,
|
|
65
|
+
"optional": false,
|
|
66
|
+
"docs": {
|
|
67
|
+
"tags": [],
|
|
68
|
+
"text": ""
|
|
69
|
+
},
|
|
70
|
+
"attribute": "open",
|
|
71
|
+
"reflect": true
|
|
72
|
+
}
|
|
73
|
+
}; }
|
|
74
|
+
static get events() { return [{
|
|
75
|
+
"method": "expansionOpen",
|
|
76
|
+
"name": "expansionOpen",
|
|
77
|
+
"bubbles": true,
|
|
78
|
+
"cancelable": true,
|
|
79
|
+
"composed": true,
|
|
80
|
+
"docs": {
|
|
81
|
+
"tags": [],
|
|
82
|
+
"text": ""
|
|
83
|
+
},
|
|
84
|
+
"complexType": {
|
|
85
|
+
"original": "HTMLElement",
|
|
86
|
+
"resolved": "HTMLElement",
|
|
87
|
+
"references": {
|
|
88
|
+
"HTMLElement": {
|
|
89
|
+
"location": "global"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}]; }
|
|
29
94
|
static get elementRef() { return "element"; }
|
|
95
|
+
static get watchers() { return [{
|
|
96
|
+
"propName": "open",
|
|
97
|
+
"methodName": "openChanged"
|
|
98
|
+
}]; }
|
|
30
99
|
static get listeners() { return [{
|
|
31
|
-
"name": "
|
|
32
|
-
"method": "
|
|
33
|
-
"target": undefined,
|
|
34
|
-
"capture": false,
|
|
35
|
-
"passive": false
|
|
36
|
-
}, {
|
|
37
|
-
"name": "expansionOpen",
|
|
38
|
-
"method": "onDetailsLoaded",
|
|
100
|
+
"name": "click",
|
|
101
|
+
"method": "onClick",
|
|
39
102
|
"target": undefined,
|
|
40
103
|
"capture": false,
|
|
41
104
|
"passive": false
|
|
@@ -2,11 +2,42 @@
|
|
|
2
2
|
display: table-row;
|
|
3
3
|
border: 1px solid rgb(var(--smoothly-default-color));
|
|
4
4
|
cursor: pointer;
|
|
5
|
+
box-sizing: border-box;
|
|
5
6
|
}
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
.hide {
|
|
8
|
+
display: none;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
.slot-detail {
|
|
11
|
+
position: relative;
|
|
10
12
|
background-color: rgb(var(--smoothly-default-color));
|
|
13
|
+
width: 104%;
|
|
14
|
+
left: -2%;
|
|
15
|
+
border-left-style: solid;
|
|
16
|
+
border-left-color: rgb(var(--smoothly-tertiary-color));
|
|
17
|
+
box-shadow: 0px 0px 5px 2px rgb(var(--smoothly-dark-color), 0.5);
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
padding: 0.5rem 2%;
|
|
20
|
+
}
|
|
21
|
+
:host smoothly-icon {
|
|
22
|
+
width: 0.6rem;
|
|
23
|
+
height: 1rem;
|
|
24
|
+
float: left;
|
|
25
|
+
padding-left: 0.2rem;
|
|
26
|
+
padding-right: 0.2rem;
|
|
27
|
+
padding-bottom: 0.5rem;
|
|
28
|
+
transition: transform 0.2s;
|
|
29
|
+
}
|
|
30
|
+
:host[open] smoothly-icon {
|
|
31
|
+
transform: rotate(90deg);
|
|
32
|
+
}
|
|
33
|
+
:host[open] smoothly-table-cell {
|
|
34
|
+
padding-bottom: 0.5rem;
|
|
35
|
+
}
|
|
36
|
+
:host[open] {
|
|
37
|
+
position: relative;
|
|
38
|
+
z-index: 3;
|
|
39
|
+
background-color: rgb(var(--smoothly-default-color));
|
|
40
|
+
border-style: solid;
|
|
41
|
+
border-width: 5px;
|
|
42
|
+
box-shadow: inset 2px 0px 0px 0px rgb(var(--smoothly-dark-color)), inset 0px 2px 0px 0px rgb(var(--smoothly-dark-color)), inset -2px 0px 0px 0px rgb(var(--smoothly-dark-color)), inset 0px 0px 0px 2px rgb(var(--smoothly-default-color));
|
|
11
43
|
}
|
|
12
|
-
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Component, h } from "@stencil/core";
|
|
1
|
+
import { Component, h, Host, Prop } from "@stencil/core";
|
|
2
2
|
export class TableHeader {
|
|
3
3
|
render() {
|
|
4
|
-
return h(
|
|
4
|
+
return (h(Host, null,
|
|
5
|
+
h("slot", null)));
|
|
5
6
|
}
|
|
6
7
|
static get is() { return "smoothly-table-header"; }
|
|
7
8
|
static get encapsulation() { return "scoped"; }
|
|
@@ -11,4 +12,23 @@ export class TableHeader {
|
|
|
11
12
|
static get styleUrls() { return {
|
|
12
13
|
"$": ["style.css"]
|
|
13
14
|
}; }
|
|
15
|
+
static get properties() { return {
|
|
16
|
+
"name": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"mutable": false,
|
|
19
|
+
"complexType": {
|
|
20
|
+
"original": "string",
|
|
21
|
+
"resolved": "string",
|
|
22
|
+
"references": {}
|
|
23
|
+
},
|
|
24
|
+
"required": false,
|
|
25
|
+
"optional": false,
|
|
26
|
+
"docs": {
|
|
27
|
+
"tags": [],
|
|
28
|
+
"text": ""
|
|
29
|
+
},
|
|
30
|
+
"attribute": "name",
|
|
31
|
+
"reflect": false
|
|
32
|
+
}
|
|
33
|
+
}; }
|
|
14
34
|
}
|