@skf-design-system/ui-components 1.0.1-beta.0 → 1.0.1-beta.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.
Files changed (67) hide show
  1. package/dist/components/accordion/accordion.component.js +3 -3
  2. package/dist/components/alert/alert.component.js +8 -8
  3. package/dist/components/button/button.component.d.ts +3 -3
  4. package/dist/components/button/button.component.js +59 -55
  5. package/dist/components/card/card.component.js +4 -4
  6. package/dist/components/checkbox/checkbox.component.d.ts +3 -1
  7. package/dist/components/checkbox/checkbox.component.js +69 -56
  8. package/dist/components/date-picker/datepicker.calendar.component.d.ts +72 -0
  9. package/dist/components/date-picker/datepicker.calendar.component.js +382 -0
  10. package/dist/components/date-picker/datepicker.calendar.styles.d.ts +1 -0
  11. package/dist/components/date-picker/datepicker.calendar.styles.js +192 -0
  12. package/dist/components/date-picker/datepicker.component.d.ts +74 -0
  13. package/dist/components/date-picker/datepicker.component.js +241 -0
  14. package/dist/components/date-picker/datepicker.d.ts +10 -0
  15. package/dist/components/date-picker/datepicker.helpers.d.ts +40 -0
  16. package/dist/components/date-picker/datepicker.helpers.js +69 -0
  17. package/dist/components/date-picker/datepicker.js +8 -0
  18. package/dist/components/date-picker/datepicker.styles.d.ts +1 -0
  19. package/dist/components/date-picker/datepicker.styles.js +99 -0
  20. package/dist/components/date-picker-input/datepicker-input.component.d.ts +107 -0
  21. package/dist/components/date-picker-input/datepicker-input.component.js +397 -0
  22. package/dist/components/date-picker-input/datepicker-input.d.ts +8 -0
  23. package/dist/components/date-picker-input/datepicker-input.helpers.d.ts +4 -0
  24. package/dist/components/date-picker-input/datepicker-input.helpers.js +29 -0
  25. package/dist/components/date-picker-input/datepicker-input.js +6 -0
  26. package/dist/components/date-picker-input/datepicker-input.styles.d.ts +1 -0
  27. package/dist/components/date-picker-input/datepicker-input.styles.js +22 -0
  28. package/dist/components/dialog/dialog.component.js +19 -19
  29. package/dist/components/divider/divider.component.js +12 -12
  30. package/dist/components/heading/heading.component.js +13 -13
  31. package/dist/components/icon/icon.component.js +19 -19
  32. package/dist/components/input/input.component.d.ts +1 -0
  33. package/dist/components/input/input.component.js +87 -80
  34. package/dist/components/link/link.component.js +28 -28
  35. package/dist/components/loader/loader.component.js +19 -19
  36. package/dist/components/logo/logo.component.js +6 -6
  37. package/dist/components/popover/popover.component.js +12 -12
  38. package/dist/components/progress/progress.component.js +7 -7
  39. package/dist/components/radio/radio.component.js +4 -4
  40. package/dist/components/select-option-group/select-option-group.component.js +9 -9
  41. package/dist/components/stepper/stepper.component.js +9 -9
  42. package/dist/components/stepper/stepper.helpers.js +5 -5
  43. package/dist/components/stepper-item/stepper-item.component.js +23 -23
  44. package/dist/components/tab/tab.component.js +4 -4
  45. package/dist/components/tab-panel/tab-panel.component.js +12 -12
  46. package/dist/components/tag/tag.component.js +9 -9
  47. package/dist/components/textarea/textarea.component.js +3 -3
  48. package/dist/components/toast/toast.component.js +13 -13
  49. package/dist/components/toast-wrapper/toast-wrapper.component.js +10 -10
  50. package/dist/components/tooltip/tooltip.component.js +2 -2
  51. package/dist/custom-elements.json +941 -161
  52. package/dist/index.d.ts +2 -0
  53. package/dist/index.js +72 -66
  54. package/dist/internal/components/hint/hint.component.js +13 -13
  55. package/dist/internal/controllers/popover.controller.d.ts +2 -1
  56. package/dist/internal/controllers/popover.controller.js +2 -2
  57. package/dist/internal/helpers/dateFormatter.d.ts +2 -0
  58. package/dist/internal/helpers/utilityTypes.d.ts +22 -0
  59. package/dist/react/index.d.ts +1 -0
  60. package/dist/react/index.js +1 -0
  61. package/dist/react/skf-datepicker/index.d.ts +12 -0
  62. package/dist/react/skf-datepicker/index.js +18 -0
  63. package/dist/types/jsx/custom-element-jsx.d.ts +45 -3
  64. package/dist/types/vue/index.d.ts +44 -1
  65. package/dist/vscode.html-custom-data.json +39 -1
  66. package/dist/web-types.json +107 -10
  67. package/package.json +3 -2
@@ -0,0 +1,241 @@
1
+ import "../button/button.js";
2
+ import { dateFormatter as c } from "../date-picker-input/datepicker-input.helpers.js";
3
+ import { SkfElement as $ } from "../../internal/components/skf-element.js";
4
+ import { watch as g } from "../../internal/helpers/watch.js";
5
+ import C from "../../styles/component.styles.js";
6
+ import { html as y } from "lit";
7
+ import { property as l, state as p } from "lit/decorators.js";
8
+ import "./datepicker.js";
9
+ import { getDateParts as h, earliestDate as S, latestDate as k, compareDates as M, doAnimate as f } from "./datepicker.helpers.js";
10
+ import { styles as T } from "./datepicker.styles.js";
11
+ var V = Object.defineProperty, F = Object.getOwnPropertyDescriptor, i = (u, e, s, t) => {
12
+ for (var a = t > 1 ? void 0 : t ? F(e, s) : e, d = u.length - 1, r; d >= 0; d--)
13
+ (r = u[d]) && (a = (t ? r(e, s, a) : r(a)) || a);
14
+ return t && a && V(e, s, a), a;
15
+ };
16
+ const m = class m extends $ {
17
+ constructor() {
18
+ super(...arguments), this.locale = "en-CA", this.date = (/* @__PURE__ */ new Date()).toLocaleDateString(this.locale), this.id = "", this.range = !1, this.selectedDate = void 0, this.selectedDateRange = {
19
+ start: null,
20
+ end: null
21
+ }, this._datePlusOneMonth = new Date(
22
+ new Date(this.date).getFullYear(),
23
+ new Date(this.date).getMonth() + 1,
24
+ 1
25
+ ), this._handleCalendarView = (e) => {
26
+ this._handleChangeCalendarView(e.detail);
27
+ }, this._handleSelectedDate = (e) => {
28
+ var s;
29
+ if (this.selectedDate = e.detail.date, console.log("selectedDate", this.selectedDate), this.range) {
30
+ const t = (s = this.shadowRoot) == null ? void 0 : s.querySelectorAll("datepicker-calendar"), a = this.selectedDateRange, d = a.start && this.selectedDate < a.start;
31
+ if ((a.start && a.end) ?? d)
32
+ this.selectedDateRange = {
33
+ start: this.selectedDate,
34
+ end: null
35
+ };
36
+ else {
37
+ const D = !!a.start ? { end: e.detail.date } : { start: e.detail.date };
38
+ this.selectedDateRange = {
39
+ ...a,
40
+ ...D
41
+ };
42
+ }
43
+ this._onRangeCompleteEmitEvent(), t != null && t.length && [...t].forEach((o) => {
44
+ o.selectedDateRange = this.selectedDateRange;
45
+ });
46
+ }
47
+ this.emit("skf-datepicker-selected", {
48
+ detail: { date: this.range ? this.selectedDateRange : this.selectedDate }
49
+ }), this.requestUpdate();
50
+ }, this._handleTodayClick = () => {
51
+ const { month: e, year: s } = h(), { month: t, year: a } = h(this.date);
52
+ if (t === e && a === s && (this.selectedDateRange.start || this.selectedDate)) {
53
+ this.date = c(this.selectedDateRange.start ?? this.selectedDate), this.emit("update-calendar-view", {
54
+ detail: this.date
55
+ });
56
+ return;
57
+ }
58
+ if (this.range) {
59
+ this.emit("update-calendar-view", {
60
+ detail: c(/* @__PURE__ */ new Date())
61
+ });
62
+ return;
63
+ }
64
+ this.date = c(/* @__PURE__ */ new Date());
65
+ };
66
+ }
67
+ connectedCallback() {
68
+ super.connectedCallback(), this.addEventListener("update-calendar-view", this._handleCalendarView), this.addEventListener("selected-date-changed", this._handleSelectedDate);
69
+ }
70
+ firstUpdated() {
71
+ (this.selectedDateRange.start ?? this.selectedDate) && this._onRangeCompleteEmitEvent();
72
+ }
73
+ clearSelection() {
74
+ this.selectedDateRange = {
75
+ start: null,
76
+ end: null
77
+ }, this.selectedDate = void 0;
78
+ }
79
+ /** @internal */
80
+ _onRangeCompleteEmitEvent() {
81
+ if (!this.selectedDateRange.start || !this.selectedDateRange.end) return;
82
+ const e = Math.abs(
83
+ this.selectedDateRange.end.getTime() - this.selectedDateRange.start.getTime()
84
+ ), s = Math.ceil(e / (1e3 * 60 * 60 * 24)) + 1;
85
+ this.emit("selected-date-range-changed", {
86
+ detail: {
87
+ ...this.selectedDateRange,
88
+ days: s,
89
+ id: this.id
90
+ }
91
+ });
92
+ }
93
+ _handleRangeChange() {
94
+ this.style.setProperty("--max-width", this.range ? "43em" : "21em");
95
+ }
96
+ _handleDateChange() {
97
+ console.log("%cdate changed", "color:red", this.date), this.date = this.date ? this.date : c(/* @__PURE__ */ new Date()), this.date = S(
98
+ k(this.date, this.selectableFrom ?? this.date),
99
+ this.selectableTo ?? this.date
100
+ ), this._date = new Date(this.date), this._datePlusOneMonth = new Date(this._date.getFullYear(), this._date.getMonth() + 1, 1);
101
+ }
102
+ _handleSelectedDateRangeChange() {
103
+ }
104
+ _handleSelectedDateChange() {
105
+ console.log("selected date changed", this.selectedDate);
106
+ }
107
+ render() {
108
+ return y`
109
+ <div class="calendar-container">
110
+ <skf-datepicker-calendar
111
+ .date=${this._date ?? /* @__PURE__ */ new Date()}
112
+ .eventid="${this.id}"
113
+ .range=${this.range}
114
+ .selectedDate=${this.selectedDate}
115
+ .selectedDateRange=${this.selectedDateRange}
116
+ .selectableFrom=${this.selectableFrom}
117
+ .selectableTo=${this.selectableTo}
118
+ .invalidDates=${this.invalidDates}
119
+ class="start"
120
+ id=${this.id}
121
+ locale="${this.locale}"
122
+ ></skf-datepicker-calendar>
123
+ <skf-datepicker-calendar
124
+ ?hidden=${!this.range}
125
+ .date=${this._datePlusOneMonth}
126
+ .eventid="${this.id}"
127
+ .range=${!0}
128
+ .selectedDate="${this.selectedDate}"
129
+ .selectedDateRange=${this.selectedDateRange}
130
+ .selectableFrom=${this.selectableFrom}
131
+ .selectableTo=${this.selectableTo}
132
+ .invalidDates=${this.invalidDates}
133
+ class="end"
134
+ id=${`${this.id}-range-end`}
135
+ locale="${this.locale}"
136
+ ></skf-datepicker-calendar>
137
+ </div>
138
+ ${this._renderTodayBtn()}
139
+ <slot></slot>
140
+ <div class="triangle"></div>
141
+ `;
142
+ }
143
+ /** @internal */
144
+ _renderTodayBtn() {
145
+ const { month: e, year: s } = h(), { month: t, year: a } = h(this.date), d = this.selectedDate ?? this.selectedDateRange.start, r = e === t && s === a;
146
+ let o = !1;
147
+ return (r && !d || d && e === d.getMonth() && s === d.getFullYear()) && (o = !0), y`
148
+ <div class="today">
149
+ <skf-button
150
+ @click=${this._handleTodayClick}
151
+ ?disabled=${o}
152
+ variant="tertiary"
153
+ size="sm"
154
+ >
155
+ ${D(this.date) && (this.selectedDate || this.selectedDateRange.start) && !o ? "Selected date" : "Today"}
156
+ </skf-button>
157
+ </div>
158
+ `;
159
+ function D(_) {
160
+ const { month: w, year: R } = h(), { month: v, year: b } = h(_);
161
+ return w === v && R === b;
162
+ }
163
+ }
164
+ /** @internal */
165
+ _handleChangeCalendarView(e) {
166
+ const s = M(this.date, e);
167
+ this._animateView(s, () => {
168
+ this.date = e;
169
+ }).then(() => {
170
+ }).catch((t) => {
171
+ console.error(t);
172
+ });
173
+ }
174
+ /** @internal */
175
+ async _animateView(e, s) {
176
+ if (!this.shadowRoot) return;
177
+ const t = [...this.shadowRoot.querySelectorAll("skf-datepicker-calendar")];
178
+ return t.length ? (await f(
179
+ t,
180
+ [{ opacity: 0, transform: `translateX(calc(16px * ${e.toString()}))` }],
181
+ { duration: 100, easing: "ease-in", fill: "backwards" }
182
+ ), s(), await f(
183
+ t,
184
+ [
185
+ { opacity: 0, transform: `translateX(${(-16 * e).toString()}px)` },
186
+ { opacity: 1, transform: "translateX(0)" }
187
+ ],
188
+ { duration: 100, easing: "ease-out", fill: "backwards" }
189
+ )) : Promise.resolve();
190
+ }
191
+ };
192
+ m.styles = [C, T];
193
+ let n = m;
194
+ i([
195
+ l({ reflect: !0 })
196
+ ], n.prototype, "locale", 2);
197
+ i([
198
+ l({ type: String, reflect: !0 })
199
+ ], n.prototype, "date", 2);
200
+ i([
201
+ l({ type: String })
202
+ ], n.prototype, "id", 2);
203
+ i([
204
+ l({ attribute: "invalid-dates" })
205
+ ], n.prototype, "invalidDates", 2);
206
+ i([
207
+ l({ type: Boolean })
208
+ ], n.prototype, "range", 2);
209
+ i([
210
+ p()
211
+ ], n.prototype, "selectedDate", 2);
212
+ i([
213
+ l({ attribute: "selectable-from" })
214
+ ], n.prototype, "selectableFrom", 2);
215
+ i([
216
+ l({ attribute: "selectable-to" })
217
+ ], n.prototype, "selectableTo", 2);
218
+ i([
219
+ p()
220
+ ], n.prototype, "selectedDateRange", 2);
221
+ i([
222
+ p()
223
+ ], n.prototype, "_date", 2);
224
+ i([
225
+ p()
226
+ ], n.prototype, "_datePlusOneMonth", 2);
227
+ i([
228
+ g("range")
229
+ ], n.prototype, "_handleRangeChange", 1);
230
+ i([
231
+ g("date")
232
+ ], n.prototype, "_handleDateChange", 1);
233
+ i([
234
+ g("selectedDateRange")
235
+ ], n.prototype, "_handleSelectedDateRangeChange", 1);
236
+ i([
237
+ g("selectedDate")
238
+ ], n.prototype, "_handleSelectedDateChange", 1);
239
+ export {
240
+ n as SkfDatePicker
241
+ };
@@ -0,0 +1,10 @@
1
+ import { SkfDatePickerCalendar } from './datepicker.calendar.component.js';
2
+ import { SkfDatePicker } from './datepicker.component.js';
3
+ export * from './datepicker.component.js';
4
+ export default SkfDatePicker;
5
+ declare global {
6
+ interface HTMLElementTagNameMap {
7
+ 'skf-datepicker': SkfDatePicker;
8
+ 'skf-datepicker-calendar': SkfDatePickerCalendar;
9
+ }
10
+ }
@@ -0,0 +1,40 @@
1
+ import { Temporal } from '@js-temporal/polyfill';
2
+ /**
3
+ * A nifty little waapi wrapper helper that
4
+ * mainly turns the onfinished callback to a promise.
5
+ * But also allows animations on multiple targets.
6
+ */
7
+ export declare function doAnimate(target: Element | Element[] | HTMLElement | HTMLElement[], keyframes: Keyframe | Keyframe[], options: KeyframeAnimationOptions): Promise<PromiseSettledResult<any>[]>;
8
+ /**
9
+ * @param date - optional date to get parts from, uses todays date if not provided
10
+ * @returns destructable object with year, month and day. NB: month is 0 based.
11
+ */
12
+ export declare function getDateParts(date?: undefined | string | Date | Temporal.PlainDate): {
13
+ year: number;
14
+ month: number;
15
+ day: number;
16
+ };
17
+ /**
18
+ * @param dateOne - first date to compare as string
19
+ * @param dateTwo - second date to compare as string
20
+ * @returns - 0 if the dates are the same, 1 if dateOne is after dateTwo, -1 if dateOne is before dateTwo
21
+ */
22
+ export declare function compareDates(dateOne: Temporal.PlainDate | string, dateTwo: Temporal.PlainDate | string): 0 | 1 | -1;
23
+ /**
24
+ * @param dateOne - first date to compare as string
25
+ * @param dateTwo - second date to compare as string
26
+ * @param unit - the unit to compare the dates by [days, months, years]
27
+ * @returns the difference between the two dates in the specified unit
28
+ */
29
+ export declare function timeBetween(dateOne: Temporal.PlainDate | string, dateTwo: Temporal.PlainDate | string, unit?: 'days' | 'months' | 'years'): number;
30
+ /**
31
+ * @param dates - a list of dates to compare
32
+ * @returns - the earliest date of the list
33
+ */
34
+ export declare function earliestDate(...dates: (string | Date)[]): string;
35
+ /**
36
+ * @param dates - a list of dates to compare
37
+ * @returns the latest date of the list
38
+ */
39
+ export declare function latestDate(...dates: (string | Date)[]): string;
40
+ export declare function assertISODate(date: string | Temporal.PlainDate | Date): string;
@@ -0,0 +1,69 @@
1
+ import { Temporal as s } from "@js-temporal/polyfill";
2
+ function h(t, n, e) {
3
+ const o = (r) => Array.isArray(r) ? r : [r], a = o(t);
4
+ n = o(n);
5
+ const f = [];
6
+ for (const r of a) {
7
+ const { promise: i, resolve: c, reject: D } = Promise.withResolvers(), l = r.animate(n, {
8
+ fill: "forwards",
9
+ duration: 300,
10
+ iterations: 1,
11
+ ...e
12
+ });
13
+ l.onfinish = () => c("finished"), l.oncancel = () => D("canceled"), f.push(i);
14
+ }
15
+ return Promise.allSettled(f);
16
+ }
17
+ function w(t = s.Now.plainDateISO()) {
18
+ return t ?? (t = s.Now.plainDateISO()), t instanceof Date && (t = s.PlainDate.from(t.toISOString())), typeof t == "string" && (t = s.PlainDate.from(u(t))), {
19
+ year: t.year,
20
+ month: t.month - 1,
21
+ // new Date is 0 based
22
+ day: t.day
23
+ };
24
+ }
25
+ function y(t, n) {
26
+ const e = m(t, n);
27
+ return o(e);
28
+ function o(a) {
29
+ return Math.max(-1, Math.min(a, 1));
30
+ }
31
+ }
32
+ function m(t, n, e = "days") {
33
+ return typeof t == "string" && (t = s.PlainDate.from(t)), typeof n == "string" && (n = s.PlainDate.from(n)), console.assert(
34
+ t instanceof s.PlainDate && n instanceof s.PlainDate,
35
+ `Invalid date was sent to helper function timeBetween(). Got ${JSON.stringify(t)} and ${JSON.stringify(n)} passed in`
36
+ ), t.since(n).total({ unit: e });
37
+ }
38
+ function p(...t) {
39
+ if (t.length === 0)
40
+ throw new Error("At least one date must be provided");
41
+ const n = (i) => i instanceof Date, e = t.map((i) => n(i) ? i : new Date(i));
42
+ if (e.length === 1)
43
+ return e[0].toISOString().split("T")[0];
44
+ const [o, ...a] = e, f = p(...a), r = new Date(f);
45
+ return o < r ? o.toISOString().split("T")[0] : r.toISOString().split("T")[0];
46
+ }
47
+ function S(...t) {
48
+ if (t.length === 0)
49
+ throw new Error("At least one date must be provided");
50
+ const n = (i) => i instanceof Date, e = t.map((i) => n(i) ? i : new Date(i));
51
+ if (e.length === 1)
52
+ return e[0].toISOString().split("T")[0];
53
+ const [o, ...a] = e, f = S(...a), r = new Date(f);
54
+ return o > r ? o.toISOString().split("T")[0] : r.toISOString().split("T")[0];
55
+ }
56
+ function u(t) {
57
+ if (t instanceof Date && (t = s.PlainDate.from(t.toISOString())), typeof t != "string" && (t = t.toString()), !/^\d{4}-\d{2}-\d{2}$/.test(t))
58
+ throw new Error(`Invalid date format. Got ${t} passed in.`);
59
+ return t;
60
+ }
61
+ export {
62
+ u as assertISODate,
63
+ y as compareDates,
64
+ h as doAnimate,
65
+ p as earliestDate,
66
+ w as getDateParts,
67
+ S as latestDate,
68
+ m as timeBetween
69
+ };
@@ -0,0 +1,8 @@
1
+ import { SkfDatePickerCalendar as e } from "./datepicker.calendar.component.js";
2
+ import { SkfDatePicker as r } from "./datepicker.component.js";
3
+ r.define("skf-datepicker");
4
+ e.define("skf-datepicker-calendar");
5
+ export {
6
+ r as SkfDatePicker,
7
+ r as default
8
+ };
@@ -0,0 +1 @@
1
+ export declare const styles: import("lit").CSSResult;
@@ -0,0 +1,99 @@
1
+ import { css as o } from "lit";
2
+ const e = o`
3
+ @layer components {
4
+ :host {
5
+ --black: #323232;
6
+ --call-to-action-color: #007bff;
7
+ --selected-bg: var(--call-to-action-color); /* hsl(218deg 87% 45%); */
8
+ --selected-fg: #fff;
9
+ --in-range-bg: #def;
10
+ --today: #eee;
11
+ --today-fg: var(--black);
12
+ --title-fg: var(--black);
13
+ --other-month-fg: #999;
14
+ --hover-bg: #def;
15
+ --border-color: #ddd;
16
+ --button-control-fg: #333;
17
+ --button-control-fg-hover: var(--call-to-action-color);
18
+ --weekday-fg: var(--black);
19
+ --calendar-padding: 16px;
20
+ --max-width: 21em;
21
+ --day-outline: transparent;
22
+
23
+ background-color: #fff;
24
+ border: solid 1px gray;
25
+ border-radius: 3px;
26
+ box-shadow: 0 0 10px rgba(0 0 0 / 30%);
27
+ box-sizing: border-box;
28
+ display: block;
29
+ font-family: Helvetica, sans-serif;
30
+ font-size: 0.7rem;
31
+ max-width: var(--max-width);
32
+ position: relative;
33
+ }
34
+
35
+ .triangle {
36
+ border: 10px solid transparent;
37
+ border-bottom-color: #fff;
38
+ border-top: 0;
39
+ display: block;
40
+ height: 0;
41
+ left: 50%;
42
+ margin-left: -10px;
43
+ position: absolute;
44
+ top: -10px;
45
+ width: 0;
46
+ }
47
+
48
+ :host([hidden]) {
49
+ display: none !important;
50
+ }
51
+
52
+ .calendar-container {
53
+ display: flex;
54
+ flex-direction: row;
55
+ gap: var(--calendar-padding);
56
+ justify-content: space-between;
57
+ overflow: hidden;
58
+ padding: var(--calendar-padding);
59
+ }
60
+
61
+ .today {
62
+ border-top: 1px solid var(--border-color);
63
+ margin-bottom: 0.5rem;
64
+ margin-top: -1rem;
65
+ padding-top: 0.5rem;
66
+ text-align: center;
67
+
68
+ button {
69
+ background-color: #333;
70
+ border-radius: 4px;
71
+ color: white;
72
+ padding-inline: 0.7em;
73
+ transition: background-color 0.2s;
74
+
75
+ &[disabled] {
76
+ opacity: 0.5;
77
+ pointer-events: none;
78
+ }
79
+
80
+ &:hover {
81
+ background-color: var(--call-to-action-color);
82
+ }
83
+
84
+ &:active {
85
+ background-color: lch(from var(--call-to-action-color) calc(l - 5) c h);
86
+ }
87
+
88
+ &:focus-visible {
89
+ border-radius: 0.2em;
90
+ outline: 2px solid #469;
91
+ outline-offset: 2px;
92
+ }
93
+ }
94
+ }
95
+ }
96
+ `;
97
+ export {
98
+ e as styles
99
+ };
@@ -0,0 +1,107 @@
1
+ import { FormBase } from '../../internal/components/formBase.js';
2
+ import { PopoverController } from '../../internal/controllers/popover.controller.js';
3
+ import type { FormFieldBaseProps } from '../../internal/types/formField.js';
4
+ import { type CSSResultGroup } from 'lit';
5
+ import '../date-picker/datepicker.js';
6
+ import type { SkfDatePicker, SkfDatePickerDateRange } from '../date-picker/datepicker.js';
7
+ export declare class SkfDatePickerInput extends FormBase {
8
+ /** @internal */
9
+ static styles: CSSResultGroup;
10
+ /** @inernal */
11
+ focusTomeoutId: ReturnType<typeof setTimeout> | undefined;
12
+ /** @internal */
13
+ private customError;
14
+ /** @internal */
15
+ popoverController: PopoverController;
16
+ /** If defined, forces component to invalid state until removed. Its value is used as hint text. */
17
+ set customInvalid(value: string | undefined);
18
+ get customInvalid(): string | undefined;
19
+ id: string;
20
+ /** If defined, sets the input's label. Alternatively, you can use the `label` attribute. */
21
+ label?: string;
22
+ /** If true, hides the label visually */
23
+ hideLabel?: boolean;
24
+ /** If defined, displays informational text below the field */
25
+ hint?: string;
26
+ /**
27
+ * A comma-separated list of dates (yyyy-mm-dd format) that are not selectable.
28
+ */
29
+ invalidDates?: string;
30
+ /** If defined, adds name to the input-element */
31
+ name?: string;
32
+ placeholder: string;
33
+ range: boolean;
34
+ /** If true, makes the element not mutable, meaning the user can not edit the control */
35
+ readonly?: boolean;
36
+ /** If defined, renders an alternative A11y text for the asterisk */
37
+ requiredLabel?: string;
38
+ /**
39
+ * Earliest selectable date. (yyyy-mm-dd format)
40
+ */
41
+ selectableFrom?: string;
42
+ /**
43
+ * Latest selectable date. (yyyy-mm-dd format)
44
+ */
45
+ selectableTo?: string;
46
+ /**
47
+ * If defined, displays provided severity state
48
+ * @type { "alert" | "success" | "info" | "warning" }
49
+ */
50
+ severity?: FormFieldBaseProps['severity'];
51
+ /** Sets validation start */
52
+ validateOn: 'input' | 'change' | 'submit';
53
+ /** The current value of the input field */
54
+ value?: string;
55
+ private _init_date?;
56
+ /** @internal */
57
+ /** true if the internal state is invalid */
58
+ invalid: boolean;
59
+ /** @internal */
60
+ selectedRangeDates: SkfDatePickerDateRange;
61
+ /** @internal */
62
+ private showClearbutton;
63
+ /** @internal */
64
+ $popover: HTMLElement;
65
+ /** @internal */
66
+ $anchor: HTMLDivElement;
67
+ /** @internal */
68
+ $input: HTMLInputElement;
69
+ /** @internal */
70
+ $input_range_end: HTMLInputElement;
71
+ /** @internal */
72
+ $datepicker: SkfDatePicker;
73
+ /** @internal */
74
+ _defaultSlot: Node[];
75
+ constructor();
76
+ connectedCallback(): void;
77
+ _handleSelectedDate: (e: CustomEvent<{
78
+ date: Date;
79
+ id: number;
80
+ }>) => void;
81
+ protected firstUpdated(): void;
82
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
83
+ private _handleDateSelected;
84
+ private _handleFocus;
85
+ /** @internal */
86
+ _handleBlur: (event: FocusEvent) => void;
87
+ /** @internal */
88
+ private _handleClose;
89
+ /** @internal */
90
+ private clearInput;
91
+ _handleValueChange(): void;
92
+ /**
93
+ * Clears the input field
94
+ */
95
+ clear: () => void;
96
+ /** @internal although called on input its only triggered once value is valid date */
97
+ _handleInput: (event: Event) => void;
98
+ /** @internal */
99
+ _toggleClearButton: (show?: boolean) => void;
100
+ /** @internal */
101
+ private _animatePopover;
102
+ /** @internal consider sharing this functionality with input */
103
+ validateInput(): void;
104
+ /** @internal */
105
+ reposition: () => Promise<void>;
106
+ render(): import("lit").TemplateResult<1>;
107
+ }