@f-ewald/components 1.28.0 → 1.30.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 +4 -0
- package/custom-elements.json +1817 -84
- package/dist/countdown-timer.d.ts +31 -0
- package/dist/countdown-timer.d.ts.map +1 -0
- package/dist/countdown-timer.js +74 -0
- package/dist/countdown-timer.js.map +1 -0
- package/dist/cron-schedule.d.ts +55 -0
- package/dist/cron-schedule.d.ts.map +1 -0
- package/dist/cron-schedule.js +768 -0
- package/dist/cron-schedule.js.map +1 -0
- package/dist/fullscreen-button.d.ts +43 -0
- package/dist/fullscreen-button.d.ts.map +1 -0
- package/dist/fullscreen-button.js +172 -0
- package/dist/fullscreen-button.js.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/scroll-dots.d.ts +54 -0
- package/dist/scroll-dots.d.ts.map +1 -0
- package/dist/scroll-dots.js +178 -0
- package/dist/scroll-dots.js.map +1 -0
- package/dist/timeline-container.d.ts +21 -5
- package/dist/timeline-container.d.ts.map +1 -1
- package/dist/timeline-container.js +35 -7
- package/dist/timeline-container.js.map +1 -1
- package/dist/timeline-entry.d.ts +32 -0
- package/dist/timeline-entry.d.ts.map +1 -1
- package/dist/timeline-entry.js +130 -3
- package/dist/timeline-entry.js.map +1 -1
- package/dist/utils/cron.d.ts +83 -0
- package/dist/utils/cron.d.ts.map +1 -0
- package/dist/utils/cron.js +409 -0
- package/dist/utils/cron.js.map +1 -0
- package/docs/countdown-timer.md +40 -0
- package/docs/cron-schedule.md +82 -0
- package/docs/fullscreen-button.md +70 -0
- package/docs/scroll-dots.md +65 -0
- package/docs/timeline-container.md +30 -6
- package/docs/timeline-entry.md +18 -0
- package/llms.txt +171 -8
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
import { type DurationFormat } from "./utils/duration.js";
|
|
3
|
+
/**
|
|
4
|
+
* Per-second ticking count-down timer, e.g. a live "Retrying in 3 seconds"
|
|
5
|
+
* indicator while waiting to retry a failed request. Renders nothing while
|
|
6
|
+
* `until` is unset or unparseable. Remaining time is clamped to zero — it
|
|
7
|
+
* never goes negative once the target instant has passed.
|
|
8
|
+
*
|
|
9
|
+
* @element countdown-timer
|
|
10
|
+
*/
|
|
11
|
+
export declare class CountdownTimer extends LitElement {
|
|
12
|
+
/** ISO-8601 target instant; remaining time is measured until here. */
|
|
13
|
+
until: string | null;
|
|
14
|
+
/** `"seconds"` -> "1 second", "12 seconds"; `"compact"` -> "12s", "3m 12s", "1h 03m 12s". */
|
|
15
|
+
format: DurationFormat;
|
|
16
|
+
/** Text rendered before the formatted value. */
|
|
17
|
+
prefix: string;
|
|
18
|
+
/** Text rendered after the formatted value. */
|
|
19
|
+
suffix: string;
|
|
20
|
+
private _now;
|
|
21
|
+
private _timer;
|
|
22
|
+
connectedCallback(): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
"countdown-timer": CountdownTimer;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=countdown-timer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countdown-timer.d.ts","sourceRoot":"","sources":["../src/countdown-timer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1E;;;;;;;GAOG;AACH,qBACa,cAAe,SAAQ,UAAU;IAC5C,sEAAsE;IAC1D,KAAK,EAAE,MAAM,GAAG,IAAI,CAAQ;IACxC,6FAA6F;IACjF,MAAM,EAAE,cAAc,CAAa;IAC/C,gDAAgD;IAC3B,MAAM,SAAM;IACjC,+CAA+C;IACnC,MAAM,SAAM;IAEf,OAAO,CAAC,IAAI,CAAc;IAEnC,OAAO,CAAC,MAAM,CAA+C;IAEpD,iBAAiB,SAKzB;IAEQ,oBAAoB,SAI5B;IAEQ,MAAM,yCAMd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,iBAAiB,EAAE,cAAc,CAAC;KACnC;CACF"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, html } from "lit";
|
|
8
|
+
import { customElement, property, state } from "lit/decorators.js";
|
|
9
|
+
import { formatDuration } from "./utils/duration.js";
|
|
10
|
+
const TICK_INTERVAL_MS = 1000;
|
|
11
|
+
/**
|
|
12
|
+
* Per-second ticking count-down timer, e.g. a live "Retrying in 3 seconds"
|
|
13
|
+
* indicator while waiting to retry a failed request. Renders nothing while
|
|
14
|
+
* `until` is unset or unparseable. Remaining time is clamped to zero — it
|
|
15
|
+
* never goes negative once the target instant has passed.
|
|
16
|
+
*
|
|
17
|
+
* @element countdown-timer
|
|
18
|
+
*/
|
|
19
|
+
let CountdownTimer = class CountdownTimer extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
/** ISO-8601 target instant; remaining time is measured until here. */
|
|
23
|
+
this.until = null;
|
|
24
|
+
/** `"seconds"` -> "1 second", "12 seconds"; `"compact"` -> "12s", "3m 12s", "1h 03m 12s". */
|
|
25
|
+
this.format = "seconds";
|
|
26
|
+
/** Text rendered before the formatted value. */
|
|
27
|
+
this.prefix = "";
|
|
28
|
+
/** Text rendered after the formatted value. */
|
|
29
|
+
this.suffix = "";
|
|
30
|
+
this._now = Date.now();
|
|
31
|
+
this._timer = null;
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
super.connectedCallback();
|
|
35
|
+
this._timer = setInterval(() => {
|
|
36
|
+
this._now = Date.now();
|
|
37
|
+
}, TICK_INTERVAL_MS);
|
|
38
|
+
}
|
|
39
|
+
disconnectedCallback() {
|
|
40
|
+
super.disconnectedCallback();
|
|
41
|
+
if (this._timer != null)
|
|
42
|
+
clearInterval(this._timer);
|
|
43
|
+
this._timer = null;
|
|
44
|
+
}
|
|
45
|
+
render() {
|
|
46
|
+
if (!this.until)
|
|
47
|
+
return html ``;
|
|
48
|
+
const target = Date.parse(this.until);
|
|
49
|
+
if (Number.isNaN(target))
|
|
50
|
+
return html ``;
|
|
51
|
+
const remaining = Math.max(0, target - this._now);
|
|
52
|
+
return html `${this.prefix}${formatDuration(remaining, this.format)}${this.suffix}`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
__decorate([
|
|
56
|
+
property()
|
|
57
|
+
], CountdownTimer.prototype, "until", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
property()
|
|
60
|
+
], CountdownTimer.prototype, "format", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
property()
|
|
63
|
+
], CountdownTimer.prototype, "prefix", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
property()
|
|
66
|
+
], CountdownTimer.prototype, "suffix", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
state()
|
|
69
|
+
], CountdownTimer.prototype, "_now", void 0);
|
|
70
|
+
CountdownTimer = __decorate([
|
|
71
|
+
customElement("countdown-timer")
|
|
72
|
+
], CountdownTimer);
|
|
73
|
+
export { CountdownTimer };
|
|
74
|
+
//# sourceMappingURL=countdown-timer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countdown-timer.js","sourceRoot":"","sources":["../src/countdown-timer.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAE1E,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAE9B;;;;;;;GAOG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,UAAU;IAAvC;;QACL,sEAAsE;QAC1D,UAAK,GAAkB,IAAI,CAAC;QACxC,6FAA6F;QACjF,WAAM,GAAmB,SAAS,CAAC;QAC/C,gDAAgD;QAC3B,WAAM,GAAG,EAAE,CAAC;QACjC,+CAA+C;QACnC,WAAM,GAAG,EAAE,CAAC;QAEP,SAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE3B,WAAM,GAA0C,IAAI,CAAC;IAsB/D,CAAC;IApBU,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;YAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACzB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACvB,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI;YAAE,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACrB,CAAC;IAEQ,MAAM;QACb,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAA,EAAE,CAAC;QACxC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,OAAO,IAAI,CAAA,GAAG,IAAI,CAAC,MAAM,GAAG,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACrF,CAAC;CACF,CAAA;AAhCa;IAAX,QAAQ,EAAE;6CAA6B;AAE5B;IAAX,QAAQ,EAAE;8CAAoC;AAE1B;IAApB,QAAQ,EAAE;8CAAsB;AAErB;IAAX,QAAQ,EAAE;8CAAa;AAEP;IAAhB,KAAK,EAAE;4CAA2B;AAVxB,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAkC1B","sourcesContent":["import { LitElement, html } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { formatDuration, type DurationFormat } from \"./utils/duration.js\";\n\nconst TICK_INTERVAL_MS = 1000;\n\n/**\n * Per-second ticking count-down timer, e.g. a live \"Retrying in 3 seconds\"\n * indicator while waiting to retry a failed request. Renders nothing while\n * `until` is unset or unparseable. Remaining time is clamped to zero — it\n * never goes negative once the target instant has passed.\n *\n * @element countdown-timer\n */\n@customElement(\"countdown-timer\")\nexport class CountdownTimer extends LitElement {\n /** ISO-8601 target instant; remaining time is measured until here. */\n @property() until: string | null = null;\n /** `\"seconds\"` -> \"1 second\", \"12 seconds\"; `\"compact\"` -> \"12s\", \"3m 12s\", \"1h 03m 12s\". */\n @property() format: DurationFormat = \"seconds\";\n /** Text rendered before the formatted value. */\n @property() override prefix = \"\";\n /** Text rendered after the formatted value. */\n @property() suffix = \"\";\n\n @state() private _now = Date.now();\n\n private _timer: ReturnType<typeof setInterval> | null = null;\n\n override connectedCallback() {\n super.connectedCallback();\n this._timer = setInterval(() => {\n this._now = Date.now();\n }, TICK_INTERVAL_MS);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n if (this._timer != null) clearInterval(this._timer);\n this._timer = null;\n }\n\n override render() {\n if (!this.until) return html``;\n const target = Date.parse(this.until);\n if (Number.isNaN(target)) return html``;\n const remaining = Math.max(0, target - this._now);\n return html`${this.prefix}${formatDuration(remaining, this.format)}${this.suffix}`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"countdown-timer\": CountdownTimer;\n }\n}\n"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues, type TemplateResult } from "lit";
|
|
2
|
+
import "./button-group.js";
|
|
3
|
+
import "./form-select.js";
|
|
4
|
+
import "./icon-button.js";
|
|
5
|
+
import "./ui-button.js";
|
|
6
|
+
import "./ui-checkbox.js";
|
|
7
|
+
/**
|
|
8
|
+
* Repeat-schedule picker that reads and writes a standard 5-field cron
|
|
9
|
+
* expression. The collapsed trigger shows a compact English description of
|
|
10
|
+
* the current schedule ("Every hour", "10:17 every Monday"); clicking it
|
|
11
|
+
* opens an anchored panel with the schedule form.
|
|
12
|
+
*
|
|
13
|
+
* The panel offers frequency presets (every N minutes, hourly, daily, weekly,
|
|
14
|
+
* monthly, yearly) plus an `Advanced` mode that edits each cron field as a
|
|
15
|
+
* list of terms, so any valid expression — including compound fields that mix
|
|
16
|
+
* ranges, steps, and single values — is reachable. Edits apply immediately:
|
|
17
|
+
* each change updates `value` and fires `change`; closing the panel only
|
|
18
|
+
* dismisses it.
|
|
19
|
+
*
|
|
20
|
+
* An unparseable `value` (e.g. `@reboot`, which has no five-field form) is
|
|
21
|
+
* preserved verbatim and shown as-is on the trigger; the panel then starts
|
|
22
|
+
* from the default hourly schedule.
|
|
23
|
+
*
|
|
24
|
+
* The host is `display: block` with a full-width trigger, matching the other
|
|
25
|
+
* value-entry fields. To shrink an instance to its content, constrain the
|
|
26
|
+
* host: `cron-schedule { display: inline-block; }`.
|
|
27
|
+
*
|
|
28
|
+
* @element cron-schedule
|
|
29
|
+
* @fires change - Fired with `{ value: string }` whenever the expression changes.
|
|
30
|
+
*/
|
|
31
|
+
export declare class CronSchedule extends LitElement {
|
|
32
|
+
#private;
|
|
33
|
+
static styles: import("lit").CSSResult[];
|
|
34
|
+
/** The cron expression, e.g. `"0 * * * *"`. */
|
|
35
|
+
value: string;
|
|
36
|
+
/** Accessible label for the trigger. */
|
|
37
|
+
label: string;
|
|
38
|
+
/** Whether the picker is disabled. */
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
/** Whether the schedule panel is open. */
|
|
41
|
+
open: boolean;
|
|
42
|
+
private _mode;
|
|
43
|
+
/** The compact English description of the current expression. */
|
|
44
|
+
get description(): string;
|
|
45
|
+
disconnectedCallback(): void;
|
|
46
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
47
|
+
protected updated(changed: PropertyValues): void;
|
|
48
|
+
render(): TemplateResult<1>;
|
|
49
|
+
}
|
|
50
|
+
declare global {
|
|
51
|
+
interface HTMLElementTagNameMap {
|
|
52
|
+
"cron-schedule": CronSchedule;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=cron-schedule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cron-schedule.d.ts","sourceRoot":"","sources":["../src/cron-schedule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AA4B/F,OAAO,mBAAmB,CAAC;AAC3B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,gBAAgB,CAAC;AACxB,OAAO,kBAAkB,CAAC;AA4C1B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBACa,YAAa,SAAQ,UAAU;;IAC1C,OAAgB,MAAM,4BAoOpB;IAEF,+CAA+C;IACnC,KAAK,SAAsB;IACvC,wCAAwC;IAC5B,KAAK,SAAM;IACvB,sCAAsC;IACT,QAAQ,UAAS;IAC9C,0CAA0C;IACE,IAAI,UAAS;IAEhD,OAAO,CAAC,KAAK,CAA2B;IAKjD,iEAAiE;IACjE,IAAI,WAAW,IAAI,MAAM,CAExB;IAEQ,oBAAoB,IAAI,IAAI,CAIpC;IAED,UAAmB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAK3D;IAED,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAexD;IAwbQ,MAAM,sBAkBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,YAAY,CAAC;KAC/B;CACF"}
|