reke-ui 0.1.2 → 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.
- package/README.md +21 -0
- package/cli/install-skills.mjs +169 -0
- package/custom-elements.json +405 -161
- package/dist/__type-checks__/no-lit-in-public-types.d.ts +2 -0
- package/dist/__type-checks__/no-lit-in-public-types.d.ts.map +1 -0
- package/dist/_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js +9 -0
- package/dist/components/reke-alert/reke-alert.d.ts.map +1 -1
- package/dist/components/reke-alert/reke-alert.js +32 -40
- package/dist/components/reke-alert/reke-alert.styles.js +7 -10
- package/dist/components/reke-badge/reke-badge.js +26 -40
- package/dist/components/reke-badge/reke-badge.styles.js +7 -10
- package/dist/components/reke-button/reke-button.d.ts.map +1 -1
- package/dist/components/reke-button/reke-button.js +41 -52
- package/dist/components/reke-button/reke-button.styles.js +7 -10
- package/dist/components/reke-card/reke-card.d.ts.map +1 -1
- package/dist/components/reke-card/reke-card.js +38 -58
- package/dist/components/reke-card/reke-card.styles.js +7 -10
- package/dist/components/reke-checkbox/reke-checkbox.js +40 -47
- package/dist/components/reke-checkbox/reke-checkbox.styles.d.ts.map +1 -1
- package/dist/components/reke-checkbox/reke-checkbox.styles.js +7 -9
- package/dist/components/reke-chip/reke-chip.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.js +42 -50
- package/dist/components/reke-chip/reke-chip.styles.d.ts.map +1 -1
- package/dist/components/reke-chip/reke-chip.styles.js +16 -13
- package/dist/components/reke-date-range/reke-date-range.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.js +240 -260
- package/dist/components/reke-date-range/reke-date-range.styles.d.ts.map +1 -1
- package/dist/components/reke-date-range/reke-date-range.styles.js +29 -16
- package/dist/components/reke-dialog/reke-dialog.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.js +52 -65
- package/dist/components/reke-dialog/reke-dialog.styles.d.ts.map +1 -1
- package/dist/components/reke-dialog/reke-dialog.styles.js +8 -10
- package/dist/components/reke-file-upload/reke-file-upload.d.ts.map +1 -1
- package/dist/components/reke-file-upload/reke-file-upload.js +62 -86
- package/dist/components/reke-file-upload/reke-file-upload.styles.js +7 -10
- package/dist/components/reke-input/reke-input.js +42 -61
- package/dist/components/reke-input/reke-input.styles.d.ts.map +1 -1
- package/dist/components/reke-input/reke-input.styles.js +8 -10
- package/dist/components/reke-select/reke-select.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.js +66 -89
- package/dist/components/reke-select/reke-select.styles.d.ts.map +1 -1
- package/dist/components/reke-select/reke-select.styles.js +9 -11
- package/dist/components/reke-table/reke-table.d.ts +134 -23
- package/dist/components/reke-table/reke-table.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.js +243 -143
- package/dist/components/reke-table/reke-table.styles.d.ts.map +1 -1
- package/dist/components/reke-table/reke-table.styles.js +67 -9
- package/dist/components/reke-textarea/reke-textarea.js +42 -61
- package/dist/components/reke-textarea/reke-textarea.styles.js +6 -9
- package/dist/components/reke-toast/reke-toast.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.js +50 -68
- package/dist/components/reke-toast/reke-toast.styles.d.ts.map +1 -1
- package/dist/components/reke-toast/reke-toast.styles.js +13 -12
- package/dist/components/reke-toggle/reke-toggle.js +36 -43
- package/dist/components/reke-toggle/reke-toggle.styles.js +7 -10
- package/dist/components/reke-tooltip/reke-tooltip.js +31 -47
- package/dist/components/reke-tooltip/reke-tooltip.styles.js +6 -9
- package/dist/index.d.ts +23 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -33
- package/dist/node_modules/lit/directives/ref.js +1 -0
- package/dist/node_modules/lit-html/async-directive.js +55 -0
- package/dist/node_modules/lit-html/directive-helpers.js +5 -0
- package/dist/node_modules/lit-html/directive.js +28 -0
- package/dist/node_modules/lit-html/directives/ref.js +30 -0
- package/dist/node_modules/lit-html/lit-html.js +234 -0
- package/dist/react-bridge/table.d.ts +58 -0
- package/dist/react-bridge/table.d.ts.map +1 -0
- package/dist/react-bridge/table.js +115 -0
- package/dist/react.d.ts +12 -26
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +110 -146
- package/dist/shared/base-element.js +13 -15
- package/dist/shared/tailwind-styles.js +6 -6
- package/dist/shared/tailwind.js +4 -0
- package/dist/tokens/reke-tokens.css +47 -0
- package/package.json +40 -20
- package/dist/shared/tailwind.css.js +0 -4
|
@@ -1,107 +1,220 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { styles as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { n } from "../../node_modules/lit-html/directives/ref.js";
|
|
4
|
+
import "../../node_modules/lit/directives/ref.js";
|
|
5
|
+
import { styles as r } from "./reke-table.styles.js";
|
|
6
|
+
import { html as i, nothing as a } from "lit";
|
|
7
|
+
import { customElement as o, property as s, state as c } from "lit/decorators.js";
|
|
8
|
+
import { classMap as l } from "lit/directives/class-map.js";
|
|
9
|
+
//#region src/components/reke-table/reke-table.ts
|
|
10
|
+
function u() {
|
|
11
|
+
try {
|
|
12
|
+
let e = {
|
|
13
|
+
BASE_URL: "/",
|
|
14
|
+
DEV: !1,
|
|
15
|
+
MODE: "production",
|
|
16
|
+
PROD: !0,
|
|
17
|
+
SSR: !1
|
|
18
|
+
};
|
|
19
|
+
if (e && typeof e.DEV == "boolean") return e.DEV;
|
|
20
|
+
if (e && typeof e.MODE == "string") return e.MODE !== "production";
|
|
21
|
+
} catch {}
|
|
22
|
+
try {
|
|
23
|
+
let e = globalThis.process;
|
|
24
|
+
if (e?.env?.NODE_ENV) return e.env.NODE_ENV === "development";
|
|
25
|
+
} catch {}
|
|
26
|
+
return !1;
|
|
27
|
+
}
|
|
28
|
+
var d = class extends e {
|
|
29
|
+
constructor(...e) {
|
|
30
|
+
super(...e), this.columns = [], this.rows = [], this.striped = !1, this.dense = !1, this.hoverable = !1, this.bordered = !1, this.borderless = !1, this.expandable = !1, this.expandOnRowClick = !1, this.sortKey = "", this.sortDirection = "asc", this.expandedRowElement = null, this.expandedRows = /* @__PURE__ */ new Set(), this._hostCache = /* @__PURE__ */ new Map(), this._cleanupMap = /* @__PURE__ */ new Map(), this._warnedDupKeys = /* @__PURE__ */ new Set(), this._warnedNumericTarget = !1, this._mountedKeys = /* @__PURE__ */ new Set(), this._keyToRow = /* @__PURE__ */ new Map(), this._refCallbacks = /* @__PURE__ */ new Map(), this._hasToolbar = !1, this._hasFooter = !1, this._warnedLegacyApi = !1;
|
|
31
|
+
}
|
|
32
|
+
static {
|
|
33
|
+
this.styles = r;
|
|
34
|
+
}
|
|
35
|
+
_resolveKey(e, t) {
|
|
36
|
+
return this.getRowKey ? this.getRowKey(e, t) : String(t);
|
|
37
|
+
}
|
|
38
|
+
handleHeaderClick(e) {
|
|
39
|
+
e.sortable !== !1 && (this.sortKey === e.key ? this.sortDirection = this.sortDirection === "asc" ? "desc" : "asc" : (this.sortKey = e.key, this.sortDirection = "asc"), this.emit("reke-sort", {
|
|
40
|
+
key: this.sortKey,
|
|
41
|
+
direction: this.sortDirection
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
handleRowClick(e, t) {
|
|
45
|
+
if (this.emit("reke-row-click", {
|
|
46
|
+
row: e,
|
|
47
|
+
index: t
|
|
48
|
+
}), this.expandOnRowClick) {
|
|
49
|
+
let n = this._resolveKey(e, t);
|
|
50
|
+
this.toggleExpand(n);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
_handleChevronClick(e, t) {
|
|
54
|
+
e.stopPropagation(), this.toggleExpand(t);
|
|
55
|
+
}
|
|
56
|
+
_handleChevronKeydown(e, t) {
|
|
57
|
+
(e.key === "Enter" || e.key === " " || e.key === "Spacebar") && (e.preventDefault(), e.stopPropagation(), this.toggleExpand(t));
|
|
58
|
+
}
|
|
59
|
+
toggleExpand(e) {
|
|
60
|
+
let t, n, r, i = typeof e == "number" && e === Math.trunc(e) && e >= 0 && e < this.rows.length;
|
|
61
|
+
i && this.getRowKey && !this._warnedNumericTarget && u() && (this._warnedNumericTarget = !0, console.warn("[reke-table] toggleExpand received a numeric target while `getRowKey` is set; in-range numeric targets are interpreted as row INDICES, not keys. Pass the resolved key to target by identity.")), i ? (n = e, r = this.rows[n], t = this._resolveKey(r, n)) : (t = e, n = this.rows.findIndex((e, n) => this._resolveKey(e, n) === t), r = n >= 0 ? this.rows[n] : void 0);
|
|
62
|
+
let a = new Set(this.expandedRows), o = !a.has(t);
|
|
63
|
+
o ? a.add(t) : (a.delete(t), this._safeCleanup(t), this._hostCache.delete(t), this._mountedKeys.delete(t), this._refCallbacks.delete(t)), this.expandedRows = a, this.emit("reke-row-expand", {
|
|
64
|
+
row: r,
|
|
65
|
+
index: n,
|
|
66
|
+
key: t,
|
|
67
|
+
expanded: o
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
isRowExpanded(e) {
|
|
71
|
+
return this.expandedRows.has(e);
|
|
72
|
+
}
|
|
73
|
+
_onToolbarSlotChange(e) {
|
|
74
|
+
let t = e.target;
|
|
75
|
+
this._hasToolbar = t.assignedNodes({ flatten: !0 }).length > 0;
|
|
76
|
+
}
|
|
77
|
+
_onFooterSlotChange(e) {
|
|
78
|
+
let t = e.target;
|
|
79
|
+
this._hasFooter = t.assignedNodes({ flatten: !0 }).length > 0;
|
|
80
|
+
}
|
|
81
|
+
_getOrCreateHost(e) {
|
|
82
|
+
let t = this._hostCache.get(e);
|
|
83
|
+
return t || (t = document.createElement("div"), t.style.cssText = "display: contents;", this._hostCache.set(e, t)), t;
|
|
84
|
+
}
|
|
85
|
+
_expandTdRef(e) {
|
|
86
|
+
let t = this._refCallbacks.get(e);
|
|
87
|
+
return t || (t = (t) => {
|
|
88
|
+
if (!t) return;
|
|
89
|
+
let n = t, r = this._getOrCreateHost(e);
|
|
90
|
+
r.parentElement !== n && n.appendChild(r);
|
|
91
|
+
}, this._refCallbacks.set(e, t)), t;
|
|
92
|
+
}
|
|
93
|
+
_renderRow(e, t, r) {
|
|
94
|
+
let o = this.expandedRows.has(r), s = `reke-table-expand-${String(r)}`, c = this.columns.length + +!!this.expandable;
|
|
95
|
+
return i`
|
|
48
96
|
<tr
|
|
49
97
|
part="row"
|
|
50
|
-
class="row ${
|
|
51
|
-
@click=${() => this.handleRowClick(
|
|
98
|
+
class="row ${t % 2 == 1 ? "row--even" : ""} ${o ? "row--expanded" : ""}"
|
|
99
|
+
@click=${() => this.handleRowClick(e, t)}
|
|
52
100
|
>
|
|
53
|
-
${this.
|
|
54
|
-
|
|
101
|
+
${this.expandable ? i`
|
|
102
|
+
<td
|
|
103
|
+
part="expand-toggle-cell"
|
|
104
|
+
class="expand-toggle-cell"
|
|
105
|
+
>
|
|
106
|
+
<button
|
|
107
|
+
type="button"
|
|
108
|
+
part="expand-toggle-button"
|
|
109
|
+
class="expand-toggle-button ${o ? "expand-toggle-button--expanded" : ""}"
|
|
110
|
+
aria-expanded=${o ? "true" : "false"}
|
|
111
|
+
aria-controls=${s}
|
|
112
|
+
aria-label=${o ? "Collapse row" : "Expand row"}
|
|
113
|
+
@click=${(e) => this._handleChevronClick(e, r)}
|
|
114
|
+
@keydown=${(e) => this._handleChevronKeydown(e, r)}
|
|
115
|
+
>
|
|
116
|
+
<span class="expand-toggle-chevron" aria-hidden="true">▶</span>
|
|
117
|
+
</button>
|
|
118
|
+
</td>
|
|
119
|
+
` : a}
|
|
120
|
+
${this.columns.map((n) => i`
|
|
55
121
|
<td
|
|
56
122
|
part="cell"
|
|
57
123
|
class="cell"
|
|
58
|
-
data-align=${
|
|
124
|
+
data-align=${n.align || "left"}
|
|
59
125
|
>
|
|
60
|
-
${
|
|
126
|
+
${n.render ? n.render(e[n.key], e, t) : e[n.key] ?? ""}
|
|
61
127
|
</td>
|
|
62
|
-
`
|
|
63
|
-
)}
|
|
128
|
+
`)}
|
|
64
129
|
</tr>
|
|
65
|
-
${
|
|
130
|
+
${this.expandedRowElement && o && this._keyToRow.get(r) === e ? i`
|
|
66
131
|
<tr part="expand-row" class="expand-row">
|
|
67
|
-
<td
|
|
68
|
-
|
|
69
|
-
|
|
132
|
+
<td
|
|
133
|
+
part="expand-content"
|
|
134
|
+
class="expand-content"
|
|
135
|
+
id=${s}
|
|
136
|
+
colspan=${c}
|
|
137
|
+
${n(this._expandTdRef(r))}
|
|
138
|
+
></td>
|
|
70
139
|
</tr>
|
|
71
|
-
` :
|
|
140
|
+
` : a}
|
|
72
141
|
`;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
142
|
+
}
|
|
143
|
+
willUpdate(e) {
|
|
144
|
+
let t = u();
|
|
145
|
+
t && this.expandedRowRender != null && !this._warnedLegacyApi && (this._warnedLegacyApi = !0, console.error("[reke-table] `expandedRowRender` was removed. Use `expandedRowElement(host, row, key) => Cleanup | void` instead."));
|
|
146
|
+
let n = /* @__PURE__ */ new Map();
|
|
147
|
+
for (let e = 0; e < this.rows.length; e += 1) {
|
|
148
|
+
let r = this.rows[e], i = this._resolveKey(r, e);
|
|
149
|
+
n.has(i) && t && !this._warnedDupKeys.has(i) && (this._warnedDupKeys.add(i), console.warn(`[reke-table] Duplicate getRowKey value detected: ${JSON.stringify(i)}. Last row with this key wins for expand bookkeeping.`)), n.set(i, r);
|
|
150
|
+
}
|
|
151
|
+
this._keyToRow = n;
|
|
152
|
+
}
|
|
153
|
+
updated(e) {
|
|
154
|
+
if (!this.expandedRowElement) {
|
|
155
|
+
this._runAllCleanupsAndClear();
|
|
156
|
+
for (let e of Array.from(this.expandedRows)) this._keyToRow.has(e) || this.expandedRows.delete(e);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
let t = /* @__PURE__ */ new Set([...this.expandedRows, ...this._hostCache.keys()]);
|
|
160
|
+
for (let e of t) {
|
|
161
|
+
let t = this._keyToRow.has(e), n = this.expandedRows.has(e);
|
|
162
|
+
t && n || (this._safeCleanup(e), this._hostCache.delete(e), this._mountedKeys.delete(e), this._refCallbacks.delete(e), t || this.expandedRows.delete(e));
|
|
163
|
+
}
|
|
164
|
+
for (let e of this.expandedRows) {
|
|
165
|
+
if (this._mountedKeys.has(e)) continue;
|
|
166
|
+
let t = this._keyToRow.get(e);
|
|
167
|
+
if (!t) continue;
|
|
168
|
+
let n = this._getOrCreateHost(e), r = this.expandedRowElement(n, t, e);
|
|
169
|
+
typeof r == "function" && this._cleanupMap.set(e, r), this._mountedKeys.add(e);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
_safeCleanup(e) {
|
|
173
|
+
let t = this._cleanupMap.get(e);
|
|
174
|
+
if (t) {
|
|
175
|
+
try {
|
|
176
|
+
t();
|
|
177
|
+
} catch {}
|
|
178
|
+
this._cleanupMap.delete(e);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
_runAllCleanupsAndClear() {
|
|
182
|
+
for (let e of this._cleanupMap.values()) try {
|
|
183
|
+
e();
|
|
184
|
+
} catch {}
|
|
185
|
+
this._cleanupMap.clear(), this._hostCache.clear(), this._mountedKeys.clear(), this._refCallbacks.clear();
|
|
186
|
+
}
|
|
187
|
+
disconnectedCallback() {
|
|
188
|
+
super.disconnectedCallback(), this._runAllCleanupsAndClear();
|
|
189
|
+
}
|
|
190
|
+
render() {
|
|
191
|
+
let e = {
|
|
192
|
+
table: !0,
|
|
193
|
+
"table--striped": this.striped,
|
|
194
|
+
"table--dense": this.dense,
|
|
195
|
+
"table--hoverable": this.hoverable,
|
|
196
|
+
"table--bordered": this.bordered
|
|
197
|
+
};
|
|
198
|
+
return i`
|
|
92
199
|
<div class="table-container">
|
|
93
|
-
${this._hasToolbar ?
|
|
200
|
+
${this._hasToolbar ? i`
|
|
94
201
|
<div part="toolbar" class="table-toolbar">
|
|
95
202
|
<slot name="toolbar" @slotchange=${this._onToolbarSlotChange}></slot>
|
|
96
203
|
</div>
|
|
97
|
-
` :
|
|
204
|
+
` : i`<slot name="toolbar" @slotchange=${this._onToolbarSlotChange} style="display:none"></slot>`}
|
|
98
205
|
|
|
99
206
|
<div class="table-wrapper">
|
|
100
|
-
<table part="table" class=${
|
|
207
|
+
<table part="table" class=${l(e)} role="table">
|
|
101
208
|
<thead part="header">
|
|
102
209
|
<tr>
|
|
103
|
-
${this.
|
|
104
|
-
|
|
210
|
+
${this.expandable ? i`
|
|
211
|
+
<th
|
|
212
|
+
part="expand-toggle-header-cell"
|
|
213
|
+
class="expand-toggle-header-cell"
|
|
214
|
+
aria-hidden="true"
|
|
215
|
+
></th>
|
|
216
|
+
` : a}
|
|
217
|
+
${this.columns.map((e) => i`
|
|
105
218
|
<th
|
|
106
219
|
part="header-cell"
|
|
107
220
|
class="header-cell ${this.sortKey === e.key ? "header-cell--sorted" : ""} ${e.sortable === !1 ? "header-cell--no-sort" : ""}"
|
|
@@ -111,81 +224,68 @@ let s = class extends f {
|
|
|
111
224
|
>
|
|
112
225
|
<span class="header-content">
|
|
113
226
|
${e.header}
|
|
114
|
-
${this.sortKey === e.key ?
|
|
227
|
+
${this.sortKey === e.key ? i`<span class="sort-indicator" aria-hidden="true">${this.sortDirection === "asc" ? "↑" : "↓"}</span>` : a}
|
|
115
228
|
</span>
|
|
116
229
|
</th>
|
|
117
|
-
`
|
|
118
|
-
)}
|
|
230
|
+
`)}
|
|
119
231
|
</tr>
|
|
120
232
|
</thead>
|
|
121
233
|
<tbody part="body">
|
|
122
|
-
${this.rows.map((e,
|
|
123
|
-
|
|
234
|
+
${this.rows.map((e, t) => {
|
|
235
|
+
let n = this._resolveKey(e, t);
|
|
236
|
+
return this._renderRow(e, t, n);
|
|
237
|
+
})}
|
|
238
|
+
${this.rows.length === 0 ? i`
|
|
124
239
|
<tr class="row row--empty">
|
|
125
|
-
<td
|
|
240
|
+
<td
|
|
241
|
+
class="cell cell--empty"
|
|
242
|
+
colspan=${this.columns.length + +!!this.expandable}
|
|
243
|
+
>
|
|
126
244
|
<slot name="empty">No data</slot>
|
|
127
245
|
</td>
|
|
128
246
|
</tr>
|
|
129
|
-
` :
|
|
247
|
+
` : a}
|
|
130
248
|
</tbody>
|
|
131
249
|
</table>
|
|
132
250
|
</div>
|
|
133
251
|
|
|
134
|
-
${this._hasFooter ?
|
|
252
|
+
${this._hasFooter ? i`
|
|
135
253
|
<div part="footer" class="table-footer">
|
|
136
254
|
<slot name="footer" @slotchange=${this._onFooterSlotChange}></slot>
|
|
137
255
|
</div>
|
|
138
|
-
` :
|
|
256
|
+
` : i`<slot name="footer" @slotchange=${this._onFooterSlotChange} style="display:none"></slot>`}
|
|
139
257
|
</div>
|
|
140
258
|
`;
|
|
141
|
-
|
|
142
|
-
};
|
|
143
|
-
s.styles = u;
|
|
144
|
-
a([
|
|
145
|
-
l({ attribute: !1 })
|
|
146
|
-
], s.prototype, "columns", 2);
|
|
147
|
-
a([
|
|
148
|
-
l({ attribute: !1 })
|
|
149
|
-
], s.prototype, "rows", 2);
|
|
150
|
-
a([
|
|
151
|
-
l({ type: Boolean, reflect: !0 })
|
|
152
|
-
], s.prototype, "striped", 2);
|
|
153
|
-
a([
|
|
154
|
-
l({ type: Boolean, reflect: !0 })
|
|
155
|
-
], s.prototype, "dense", 2);
|
|
156
|
-
a([
|
|
157
|
-
l({ type: Boolean, reflect: !0 })
|
|
158
|
-
], s.prototype, "hoverable", 2);
|
|
159
|
-
a([
|
|
160
|
-
l({ type: Boolean, reflect: !0 })
|
|
161
|
-
], s.prototype, "bordered", 2);
|
|
162
|
-
a([
|
|
163
|
-
l({ type: Boolean, reflect: !0 })
|
|
164
|
-
], s.prototype, "borderless", 2);
|
|
165
|
-
a([
|
|
166
|
-
l({ reflect: !0, attribute: "sort-key" })
|
|
167
|
-
], s.prototype, "sortKey", 2);
|
|
168
|
-
a([
|
|
169
|
-
l({ reflect: !0, attribute: "sort-direction" })
|
|
170
|
-
], s.prototype, "sortDirection", 2);
|
|
171
|
-
a([
|
|
172
|
-
l({ attribute: !1 })
|
|
173
|
-
], s.prototype, "expandedRowRender", 2);
|
|
174
|
-
a([
|
|
175
|
-
l({ attribute: !1 })
|
|
176
|
-
], s.prototype, "expandedRowElement", 2);
|
|
177
|
-
a([
|
|
178
|
-
l({ attribute: !1 })
|
|
179
|
-
], s.prototype, "expandedRows", 2);
|
|
180
|
-
a([
|
|
181
|
-
c()
|
|
182
|
-
], s.prototype, "_hasToolbar", 2);
|
|
183
|
-
a([
|
|
184
|
-
c()
|
|
185
|
-
], s.prototype, "_hasFooter", 2);
|
|
186
|
-
s = a([
|
|
187
|
-
b("reke-table")
|
|
188
|
-
], s);
|
|
189
|
-
export {
|
|
190
|
-
s as RekeTable
|
|
259
|
+
}
|
|
191
260
|
};
|
|
261
|
+
t([s({ attribute: !1 })], d.prototype, "columns", void 0), t([s({ attribute: !1 })], d.prototype, "rows", void 0), t([s({
|
|
262
|
+
type: Boolean,
|
|
263
|
+
reflect: !0
|
|
264
|
+
})], d.prototype, "striped", void 0), t([s({
|
|
265
|
+
type: Boolean,
|
|
266
|
+
reflect: !0
|
|
267
|
+
})], d.prototype, "dense", void 0), t([s({
|
|
268
|
+
type: Boolean,
|
|
269
|
+
reflect: !0
|
|
270
|
+
})], d.prototype, "hoverable", void 0), t([s({
|
|
271
|
+
type: Boolean,
|
|
272
|
+
reflect: !0
|
|
273
|
+
})], d.prototype, "bordered", void 0), t([s({
|
|
274
|
+
type: Boolean,
|
|
275
|
+
reflect: !0
|
|
276
|
+
})], d.prototype, "borderless", void 0), t([s({
|
|
277
|
+
type: Boolean,
|
|
278
|
+
reflect: !0
|
|
279
|
+
})], d.prototype, "expandable", void 0), t([s({
|
|
280
|
+
type: Boolean,
|
|
281
|
+
reflect: !0,
|
|
282
|
+
attribute: "expand-on-row-click"
|
|
283
|
+
})], d.prototype, "expandOnRowClick", void 0), t([s({
|
|
284
|
+
reflect: !0,
|
|
285
|
+
attribute: "sort-key"
|
|
286
|
+
})], d.prototype, "sortKey", void 0), t([s({
|
|
287
|
+
reflect: !0,
|
|
288
|
+
attribute: "sort-direction"
|
|
289
|
+
})], d.prototype, "sortDirection", void 0), t([s({ attribute: !1 })], d.prototype, "expandedRowElement", void 0), t([s({ attribute: !1 })], d.prototype, "getRowKey", void 0), t([s({ attribute: !1 })], d.prototype, "expandedRows", void 0), t([c()], d.prototype, "_hasToolbar", void 0), t([c()], d.prototype, "_hasFooter", void 0), d = t([o("reke-table")], d);
|
|
290
|
+
//#endregion
|
|
291
|
+
export { d as RekeTable };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reke-table.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"reke-table.styles.d.ts","sourceRoot":"","sources":["../../../src/components/reke-table/reke-table.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,2BAsQlB,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { tailwindStyles as e } from "../../shared/tailwind-styles.js";
|
|
2
|
-
import { css as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
r`
|
|
2
|
+
import { css as t } from "lit";
|
|
3
|
+
//#region src/components/reke-table/reke-table.styles.ts
|
|
4
|
+
var n = [e, t`
|
|
6
5
|
:host {
|
|
7
6
|
display: block;
|
|
8
7
|
}
|
|
@@ -145,6 +144,67 @@ const t = [
|
|
|
145
144
|
padding: 24px 16px;
|
|
146
145
|
}
|
|
147
146
|
|
|
147
|
+
/* === Expand toggle column (opt-in via expandable prop) === */
|
|
148
|
+
|
|
149
|
+
.expand-toggle-header-cell {
|
|
150
|
+
width: 40px;
|
|
151
|
+
padding: 12px 8px;
|
|
152
|
+
border-bottom: 1px solid var(--reke-color-border, #252525);
|
|
153
|
+
background: var(--reke-color-surface, #1A1A1A);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.expand-toggle-cell {
|
|
157
|
+
width: 40px;
|
|
158
|
+
padding: 8px 4px 8px 8px;
|
|
159
|
+
text-align: center;
|
|
160
|
+
vertical-align: middle;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.expand-toggle-button {
|
|
164
|
+
display: inline-flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
width: 24px;
|
|
168
|
+
height: 24px;
|
|
169
|
+
padding: 0;
|
|
170
|
+
background: transparent;
|
|
171
|
+
border: none;
|
|
172
|
+
border-radius: var(--reke-radius, 4px);
|
|
173
|
+
color: var(--reke-color-text-muted, #525252);
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
font: inherit;
|
|
176
|
+
line-height: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.expand-toggle-button:hover {
|
|
180
|
+
color: var(--reke-color-text, #E5E5E5);
|
|
181
|
+
background: color-mix(in srgb, var(--reke-color-surface, #1A1A1A) 75%, var(--reke-color-border, #252525));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.expand-toggle-button:focus-visible {
|
|
185
|
+
outline: 2px solid var(--reke-color-primary, #22C55E);
|
|
186
|
+
outline-offset: 2px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.expand-toggle-chevron {
|
|
190
|
+
display: inline-block;
|
|
191
|
+
font-size: 10px;
|
|
192
|
+
transition: transform 120ms ease;
|
|
193
|
+
transform: rotate(0deg);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.expand-toggle-button--expanded .expand-toggle-chevron {
|
|
197
|
+
transform: rotate(90deg);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.table--dense .expand-toggle-header-cell {
|
|
201
|
+
padding: 8px 6px;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.table--dense .expand-toggle-cell {
|
|
205
|
+
padding: 4px 4px 4px 6px;
|
|
206
|
+
}
|
|
207
|
+
|
|
148
208
|
/* === Expanded row === */
|
|
149
209
|
|
|
150
210
|
.expand-row {
|
|
@@ -200,8 +260,6 @@ const t = [
|
|
|
200
260
|
border: none;
|
|
201
261
|
border-radius: 0;
|
|
202
262
|
}
|
|
203
|
-
`
|
|
204
|
-
|
|
205
|
-
export {
|
|
206
|
-
t as styles
|
|
207
|
-
};
|
|
263
|
+
`];
|
|
264
|
+
//#endregion
|
|
265
|
+
export { n as styles };
|
|
@@ -1,73 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
${this.label ?
|
|
1
|
+
import { RekeElement as e } from "../../shared/base-element.js";
|
|
2
|
+
import { __decorate as t } from "../../_virtual/_@oxc-project_runtime@0.137.0/helpers/esm/decorate.js";
|
|
3
|
+
import { styles as n } from "./reke-textarea.styles.js";
|
|
4
|
+
import { html as r, nothing as i } from "lit";
|
|
5
|
+
import { customElement as a, property as o } from "lit/decorators.js";
|
|
6
|
+
import { classMap as s } from "lit/directives/class-map.js";
|
|
7
|
+
//#region src/components/reke-textarea/reke-textarea.ts
|
|
8
|
+
var c = class extends e {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.value = "", this.placeholder = "", this.rows = 4, this.size = "md", this.disabled = !1, this.error = !1, this.label = "";
|
|
11
|
+
}
|
|
12
|
+
static {
|
|
13
|
+
this.styles = n;
|
|
14
|
+
}
|
|
15
|
+
handleInput(e) {
|
|
16
|
+
let t = e.target;
|
|
17
|
+
this.value = t.value, this.emit("reke-input", { value: this.value });
|
|
18
|
+
}
|
|
19
|
+
handleChange() {
|
|
20
|
+
this.emit("reke-change", { value: this.value });
|
|
21
|
+
}
|
|
22
|
+
render() {
|
|
23
|
+
let e = {
|
|
24
|
+
textarea: !0,
|
|
25
|
+
[`textarea--${this.size}`]: !0,
|
|
26
|
+
"textarea--error": this.error
|
|
27
|
+
};
|
|
28
|
+
return r`
|
|
29
|
+
${this.label ? r`<label class="label">${this.label}</label>` : i}
|
|
30
30
|
<textarea
|
|
31
31
|
part="textarea"
|
|
32
|
-
class=${
|
|
32
|
+
class=${s(e)}
|
|
33
33
|
.value=${this.value}
|
|
34
|
-
placeholder=${this.placeholder ||
|
|
34
|
+
placeholder=${this.placeholder || i}
|
|
35
35
|
rows=${this.rows}
|
|
36
36
|
?disabled=${this.disabled}
|
|
37
37
|
aria-disabled=${this.disabled}
|
|
38
38
|
aria-invalid=${this.error}
|
|
39
|
-
aria-label=${this.label ||
|
|
39
|
+
aria-label=${this.label || i}
|
|
40
40
|
@input=${this.handleInput}
|
|
41
41
|
@change=${this.handleChange}
|
|
42
42
|
></textarea>
|
|
43
43
|
`;
|
|
44
|
-
|
|
45
|
-
};
|
|
46
|
-
e.styles = b;
|
|
47
|
-
t([
|
|
48
|
-
a()
|
|
49
|
-
], e.prototype, "value", 2);
|
|
50
|
-
t([
|
|
51
|
-
a()
|
|
52
|
-
], e.prototype, "placeholder", 2);
|
|
53
|
-
t([
|
|
54
|
-
a({ type: Number })
|
|
55
|
-
], e.prototype, "rows", 2);
|
|
56
|
-
t([
|
|
57
|
-
a({ reflect: !0 })
|
|
58
|
-
], e.prototype, "size", 2);
|
|
59
|
-
t([
|
|
60
|
-
a({ type: Boolean, reflect: !0 })
|
|
61
|
-
], e.prototype, "disabled", 2);
|
|
62
|
-
t([
|
|
63
|
-
a({ type: Boolean, reflect: !0 })
|
|
64
|
-
], e.prototype, "error", 2);
|
|
65
|
-
t([
|
|
66
|
-
a()
|
|
67
|
-
], e.prototype, "label", 2);
|
|
68
|
-
e = t([
|
|
69
|
-
d("reke-textarea")
|
|
70
|
-
], e);
|
|
71
|
-
export {
|
|
72
|
-
e as RekeTextarea
|
|
44
|
+
}
|
|
73
45
|
};
|
|
46
|
+
t([o()], c.prototype, "value", void 0), t([o()], c.prototype, "placeholder", void 0), t([o({ type: Number })], c.prototype, "rows", void 0), t([o({ reflect: !0 })], c.prototype, "size", void 0), t([o({
|
|
47
|
+
type: Boolean,
|
|
48
|
+
reflect: !0
|
|
49
|
+
})], c.prototype, "disabled", void 0), t([o({
|
|
50
|
+
type: Boolean,
|
|
51
|
+
reflect: !0
|
|
52
|
+
})], c.prototype, "error", void 0), t([o()], c.prototype, "label", void 0), c = t([a("reke-textarea")], c);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { c as RekeTextarea };
|