@skf-design-system/ui-components 1.0.2-beta.2 → 1.0.2-beta.4
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 +7 -1
- package/dist/components/accordion/accordion-item.component.js +49 -38
- package/dist/components/accordion/accordion.component.d.ts +1 -1
- package/dist/components/accordion/accordion.component.js +10 -10
- package/dist/components/alert/alert.component.d.ts +5 -1
- package/dist/components/alert/alert.component.js +57 -54
- package/dist/components/alert/alert.styles.js +51 -47
- package/dist/components/breadcrumb/breadcrumb-item.component.js +24 -25
- package/dist/components/breadcrumb/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +16 -15
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +5 -2
- package/dist/components/breadcrumb/breadcrumb.component.js +51 -46
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.styles.js +13 -10
- package/dist/components/button/button.component.js +39 -39
- package/dist/components/button/button.styles.js +2 -1
- package/dist/components/card/card.component.d.ts +5 -0
- package/dist/components/card/card.component.js +46 -24
- package/dist/components/card/card.styles.js +31 -14
- package/dist/components/{date-picker/datepicker.calendar.component.d.ts → datepicker/datepicker-calendar.component.d.ts} +4 -1
- package/dist/components/{date-picker/datepicker.calendar.component.js → datepicker/datepicker-calendar.component.js} +7 -7
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/{date-picker/datepicker.component.d.ts → datepicker/datepicker-popup.component.d.ts} +5 -20
- package/dist/components/{date-picker/datepicker.component.js → datepicker/datepicker-popup.component.js} +12 -12
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/{date-picker/datepicker.helpers.d.ts → datepicker/datepicker-popup.helpers.d.ts} +3 -3
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/{date-picker/datepicker.styles.js → datepicker/datepicker-popup.styles.js} +3 -3
- package/dist/components/{date-picker-input/datepicker-input.component.d.ts → datepicker/datepicker.component.d.ts} +17 -12
- package/dist/components/{date-picker-input/datepicker-input.component.js → datepicker/datepicker.component.js} +110 -97
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/dialog/dialog.component.js +1 -1
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/drawer/drawer.d.ts +2 -2
- package/dist/components/header/header.d.ts +2 -2
- package/dist/components/heading/heading.component.d.ts +5 -1
- package/dist/components/heading/heading.component.js +54 -27
- package/dist/components/heading/heading.styles.js +34 -36
- package/dist/components/icon/icon.component.d.ts +4 -0
- package/dist/components/icon/icon.component.js +52 -43
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.js +26 -26
- package/dist/components/logo/logo.component.d.ts +4 -1
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.d.ts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +2 -2
- package/dist/components/nav/nav.d.ts +2 -2
- package/dist/components/popover/popover.component.js +1 -1
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +8 -6
- package/dist/components/segmented-button/segmented-button-item.d.ts +2 -2
- package/dist/components/segmented-button/segmented-button.d.ts +2 -2
- package/dist/components/select/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option.component.d.ts +2 -2
- package/dist/components/select/select-option.component.js +9 -9
- package/dist/components/select/select.component.d.ts +2 -2
- package/dist/components/select/select.component.js +3 -4
- package/dist/components/select/select.controllers.js +11 -14
- package/dist/components/stepper/stepper-item.component.js +47 -47
- package/dist/components/stepper/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +35 -36
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +7 -2
- package/dist/components/tag/tag.component.js +69 -65
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +233 -126
- package/dist/index.d.ts +6 -5
- package/dist/index.js +96 -93
- package/dist/internal/base-classes/popover/popover.base.js +1 -1
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/styles/component.styles.js +37 -36
- package/dist/styles/{global-without-fonts.css → global-alt.css} +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +86 -44
- package/dist/types/vue/index.d.ts +86 -44
- package/dist/vscode.html-custom-data.json +103 -17
- package/dist/web-types.json +208 -55
- package/package.json +14 -20
- package/dist/components/accordion/accordion-item.test.d.ts +0 -1
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/date-picker/datepicker.d.ts +0 -10
- package/dist/components/date-picker/datepicker.helpers.js +0 -76
- package/dist/components/date-picker/datepicker.js +0 -8
- package/dist/components/date-picker-input/datepicker-input.d.ts +0 -8
- package/dist/components/date-picker-input/datepicker-input.js +0 -6
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/internal/playwright/index.d.ts +0 -1
- /package/dist/components/{date-picker/datepicker.calendar.styles.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{date-picker/datepicker.calendar.styles.js → datepicker/datepicker-calendar.styles.js} +0 -0
- /package/dist/components/{date-picker/datepicker.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.d.ts → datepicker/datepicker.helpers.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.helpers.js → datepicker/datepicker.helpers.js} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.d.ts → datepicker/datepicker.styles.d.ts} +0 -0
- /package/dist/components/{date-picker-input/datepicker-input.styles.js → datepicker/datepicker.styles.js} +0 -0
- /package/dist/components/select/{select.stories.icons.d.ts → stories/select.stories.icons.d.ts} +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.component.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.d.ts +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → tabs/tabs.styles.d.ts} +0 -0
@@ -1,60 +1,65 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import "lit";
|
4
|
-
import { property as p, state as _, queryAssignedElements as d } from "lit/decorators.js";
|
5
|
-
import { classMap as y } from "lit/directives/class-map.js";
|
6
|
-
import { ifDefined as u } from "lit/directives/if-defined.js";
|
7
|
-
import { literal as h, html as b } from "lit/static-html.js";
|
8
|
-
import { styles as g } from "./breadcrumb.styles.js";
|
9
|
-
var v = Object.defineProperty, r = (a, t, i, n) => {
|
10
|
-
for (var s = void 0, l = a.length - 1, m; l >= 0; l--)
|
11
|
-
(m = a[l]) && (s = m(t, i, s) || s);
|
12
|
-
return s && v(t, i, s), s;
|
1
|
+
var f = (t) => {
|
2
|
+
throw TypeError(t);
|
13
3
|
};
|
14
|
-
|
4
|
+
var g = (t, s, e) => s.has(t) || f("Cannot " + e);
|
5
|
+
var p = (t, s, e) => (g(t, s, "read from private field"), e ? e.call(t) : s.get(t)), _ = (t, s, e) => s.has(t) ? f("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), y = (t, s, e, i) => (g(t, s, "write to private field"), i ? i.call(t, e) : s.set(t, e), e);
|
6
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as C } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as D } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as v } from "../../styles/component.styles.js";
|
10
|
+
import "lit";
|
11
|
+
import { property as u, state as S, queryAssignedElements as O } from "lit/decorators.js";
|
12
|
+
import { html as P } from "lit/static-html.js";
|
13
|
+
import { styles as b } from "./breadcrumb.styles.js";
|
14
|
+
var w = Object.defineProperty, E = Object.getOwnPropertyDescriptor, n = (t, s, e, i) => {
|
15
|
+
for (var r = i > 1 ? void 0 : i ? E(s, e) : s, h = t.length - 1, m; h >= 0; h--)
|
16
|
+
(m = t[h]) && (r = (i ? m(s, e, r) : m(r)) || r);
|
17
|
+
return i && r && w(s, e, r), r;
|
18
|
+
}, a, l;
|
19
|
+
const c = class c extends d {
|
15
20
|
constructor() {
|
16
|
-
super(...arguments)
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
+
super(...arguments);
|
22
|
+
_(this, a);
|
23
|
+
_(this, l);
|
24
|
+
y(this, a, this.attachInternals()), y(this, l, p(this, a).states), this.label = "Breadcrumb", this.small = !1, this._isDynamic = !1, this._handleSlotChange = () => {
|
25
|
+
this._items.forEach((e, i) => {
|
26
|
+
this._isDynamic = this._isDynamic || !!e.href, this.role = this._isDynamic ? "navigation" : null;
|
27
|
+
const r = i === this._items.length - 1;
|
28
|
+
this._isDynamic && r && (e._isCurrent = !0);
|
21
29
|
});
|
22
30
|
};
|
23
31
|
}
|
24
32
|
firstUpdated() {
|
25
33
|
this._handleSlotChange();
|
26
34
|
}
|
35
|
+
_handleStateChange() {
|
36
|
+
C(p(this, l), "small").set(this.small);
|
37
|
+
}
|
27
38
|
render() {
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
class=${y({
|
33
|
-
breadcrumb: !0,
|
34
|
-
"breadcrumb--small": this.size === "sm"
|
35
|
-
})}
|
36
|
-
>
|
37
|
-
<ol class="breadcrumb__list">
|
38
|
-
<slot @slotchange=${this._handleSlotChange}></slot>
|
39
|
-
</ol>
|
40
|
-
</{tag}>
|
39
|
+
return P`
|
40
|
+
<ol id="root">
|
41
|
+
<slot @slotchange=${this._handleSlotChange}></slot>
|
42
|
+
</ol>
|
41
43
|
`;
|
42
44
|
}
|
43
45
|
};
|
44
|
-
|
45
|
-
let
|
46
|
-
|
47
|
-
|
48
|
-
],
|
49
|
-
|
50
|
-
|
51
|
-
],
|
52
|
-
|
53
|
-
|
54
|
-
],
|
55
|
-
|
56
|
-
|
57
|
-
],
|
46
|
+
a = new WeakMap(), l = new WeakMap(), c.styles = [v, b];
|
47
|
+
let o = c;
|
48
|
+
n([
|
49
|
+
u({ type: String })
|
50
|
+
], o.prototype, "label", 2);
|
51
|
+
n([
|
52
|
+
u({ type: Boolean })
|
53
|
+
], o.prototype, "small", 2);
|
54
|
+
n([
|
55
|
+
S()
|
56
|
+
], o.prototype, "_isDynamic", 2);
|
57
|
+
n([
|
58
|
+
O()
|
59
|
+
], o.prototype, "_items", 2);
|
60
|
+
n([
|
61
|
+
D("small")
|
62
|
+
], o.prototype, "_handleStateChange", 1);
|
58
63
|
export {
|
59
|
-
|
64
|
+
o as SkfBreadcrumb
|
60
65
|
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfBreadcrumb } from './breadcrumb.component';
|
2
|
-
export * from './breadcrumb.component';
|
1
|
+
import { SkfBreadcrumb } from './breadcrumb.component.js';
|
2
|
+
export * from './breadcrumb.component.js';
|
3
3
|
export default SkfBreadcrumb;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|
@@ -1,19 +1,22 @@
|
|
1
1
|
import { css as t } from "lit";
|
2
2
|
const s = t`
|
3
|
-
/* stylelint-disable selector-class-pattern */
|
4
3
|
@layer components {
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
@layer base {
|
5
|
+
:host {
|
6
|
+
contain: layout;
|
7
|
+
}
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
#root {
|
10
|
+
align-items: center;
|
11
|
+
display: flex;
|
12
|
+
}
|
12
13
|
}
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
15
|
+
@layer mods {
|
16
|
+
:host(:state(small)) #root {
|
17
|
+
font-size: var(--skf-font-size-75);
|
18
|
+
font-weight: var(--skf-font-weight-medium);
|
19
|
+
}
|
17
20
|
}
|
18
21
|
}
|
19
22
|
`;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
var u = (i) => {
|
2
2
|
throw TypeError(i);
|
3
3
|
};
|
4
|
-
var _ = (i,
|
5
|
-
var p = (i,
|
4
|
+
var _ = (i, e, t) => e.has(i) || u("Cannot " + t);
|
5
|
+
var p = (i, e, t) => (_(i, e, "read from private field"), t ? t.call(i) : e.get(i)), v = (i, e, t) => e.has(i) ? u("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t), $ = (i, e, t, a) => (_(i, e, "write to private field"), a ? a.call(i, t) : e.set(i, t), t);
|
6
6
|
import "../icon/icon.js";
|
7
7
|
import "../loader/loader.js";
|
8
8
|
import { SkfElement as O } from "../../internal/components/skf-element.js";
|
@@ -13,10 +13,10 @@ import { property as r, state as P, query as m } from "lit/decorators.js";
|
|
13
13
|
import { classMap as L } from "lit/directives/class-map.js";
|
14
14
|
import { ifDefined as g } from "lit/directives/if-defined.js";
|
15
15
|
import { styles as C } from "./button.styles.js";
|
16
|
-
var F = Object.defineProperty,
|
17
|
-
for (var n = a > 1 ? void 0 : a ?
|
18
|
-
(d = i[h]) && (n = (a ? d(
|
19
|
-
return a && n && F(
|
16
|
+
var F = Object.defineProperty, q = Object.getOwnPropertyDescriptor, s = (i, e, t, a) => {
|
17
|
+
for (var n = a > 1 ? void 0 : a ? q(e, t) : e, h = i.length - 1, d; h >= 0; h--)
|
18
|
+
(d = i[h]) && (n = (a ? d(e, t, n) : d(n)) || n);
|
19
|
+
return a && n && F(e, t, n), n;
|
20
20
|
}, l;
|
21
21
|
const c = class c extends O {
|
22
22
|
constructor() {
|
@@ -34,7 +34,7 @@ const c = class c extends O {
|
|
34
34
|
}, this._resetForm = () => {
|
35
35
|
var t;
|
36
36
|
(t = p(this, l).form) == null || t.reset();
|
37
|
-
}, this._renderIcon = () => y`<skf-icon
|
37
|
+
}, this._renderIcon = () => y`<skf-icon data-color="custom" name=${g(this.icon)}></skf-icon>`, $(this, l, this.attachInternals());
|
38
38
|
}
|
39
39
|
firstUpdated(t) {
|
40
40
|
if (t.has("loading") && this.loading) {
|
@@ -91,52 +91,52 @@ const c = class c extends O {
|
|
91
91
|
}
|
92
92
|
};
|
93
93
|
l = new WeakMap(), c.styles = [w, C], c.formAssociated = !0, c.shadowRootOptions = { ...z.shadowRootOptions, delegatesFocus: !0 };
|
94
|
-
let
|
95
|
-
|
94
|
+
let o = c;
|
95
|
+
s([
|
96
96
|
r({ type: Boolean })
|
97
|
-
],
|
98
|
-
|
97
|
+
], o.prototype, "destructive", 2);
|
98
|
+
s([
|
99
99
|
r({ type: Boolean })
|
100
|
-
],
|
101
|
-
|
100
|
+
], o.prototype, "disabled", 2);
|
101
|
+
s([
|
102
102
|
r()
|
103
|
-
],
|
104
|
-
|
103
|
+
], o.prototype, "icon", 2);
|
104
|
+
s([
|
105
105
|
r({ type: Boolean, attribute: "icon-only" })
|
106
|
-
],
|
107
|
-
|
106
|
+
], o.prototype, "iconOnly", 2);
|
107
|
+
s([
|
108
108
|
r({ attribute: "icon-position" })
|
109
|
-
],
|
110
|
-
|
109
|
+
], o.prototype, "iconPosition", 2);
|
110
|
+
s([
|
111
111
|
r({ type: Boolean, reflect: !0 })
|
112
|
-
],
|
113
|
-
|
112
|
+
], o.prototype, "loading", 2);
|
113
|
+
s([
|
114
114
|
r({ type: Boolean, attribute: "no-validate" })
|
115
|
-
],
|
116
|
-
|
115
|
+
], o.prototype, "noValidate", 2);
|
116
|
+
s([
|
117
117
|
r({ reflect: !0 })
|
118
|
-
],
|
119
|
-
|
118
|
+
], o.prototype, "size", 2);
|
119
|
+
s([
|
120
120
|
r()
|
121
|
-
],
|
122
|
-
|
121
|
+
], o.prototype, "type", 2);
|
122
|
+
s([
|
123
123
|
r({ reflect: !0 })
|
124
|
-
],
|
125
|
-
|
124
|
+
], o.prototype, "variant", 2);
|
125
|
+
s([
|
126
126
|
P()
|
127
|
-
],
|
128
|
-
|
127
|
+
], o.prototype, "_loaderVisible", 2);
|
128
|
+
s([
|
129
129
|
m("skf-loader")
|
130
|
-
],
|
131
|
-
|
130
|
+
], o.prototype, "$loader", 2);
|
131
|
+
s([
|
132
132
|
m("#body")
|
133
|
-
],
|
134
|
-
|
133
|
+
], o.prototype, "$body", 2);
|
134
|
+
s([
|
135
135
|
m("button")
|
136
|
-
],
|
137
|
-
|
136
|
+
], o.prototype, "$button", 2);
|
137
|
+
s([
|
138
138
|
V("loading", { afterUpdate: !0 })
|
139
|
-
],
|
139
|
+
], o.prototype, "_handleLoadingChange", 1);
|
140
140
|
export {
|
141
|
-
|
141
|
+
o as SkfButton
|
142
142
|
};
|
@@ -7,9 +7,12 @@ import { type CSSResultGroup } from 'lit';
|
|
7
7
|
*
|
8
8
|
* @slot - The card's main content
|
9
9
|
*
|
10
|
+
* @cssproperty --mod-card-bg-color - Ability to set a custom background color
|
11
|
+
*
|
10
12
|
* @tagname skf-card
|
11
13
|
*/
|
12
14
|
export declare class SkfCard extends SkfElement {
|
15
|
+
#private;
|
13
16
|
static styles: CSSResultGroup;
|
14
17
|
/** If true, removes border */
|
15
18
|
noBorder: boolean;
|
@@ -17,5 +20,7 @@ export declare class SkfCard extends SkfElement {
|
|
17
20
|
noPadding: boolean;
|
18
21
|
/** If true, the Card fills the parent element height */
|
19
22
|
stretch: boolean;
|
23
|
+
/** @internal */
|
24
|
+
_handleStateChange(property: string, _prev: unknown, next: unknown): void;
|
20
25
|
render(): import("lit").TemplateResult<1>;
|
21
26
|
}
|
@@ -1,32 +1,54 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
import { html as d } from "lit";
|
4
|
-
import { property as o } from "lit/decorators.js";
|
5
|
-
import { styles as u } from "./card.styles.js";
|
6
|
-
var c = Object.defineProperty, s = (p, l, i, y) => {
|
7
|
-
for (var t = void 0, r = p.length - 1, a; r >= 0; r--)
|
8
|
-
(a = p[r]) && (t = a(l, i, t) || t);
|
9
|
-
return t && c(l, i, t), t;
|
1
|
+
var g = (t) => {
|
2
|
+
throw TypeError(t);
|
10
3
|
};
|
11
|
-
|
4
|
+
var u = (t, e, o) => e.has(t) || g("Cannot " + o);
|
5
|
+
var m = (t, e, o) => (u(t, e, "read from private field"), o ? o.call(t) : e.get(t)), d = (t, e, o) => e.has(t) ? g("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, o), c = (t, e, o, s) => (u(t, e, "write to private field"), s ? s.call(t, o) : e.set(t, o), o);
|
6
|
+
import { SkfElement as b } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as v } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as P } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as B } from "../../styles/component.styles.js";
|
10
|
+
import { html as O } from "lit";
|
11
|
+
import { property as f } from "lit/decorators.js";
|
12
|
+
import { styles as j } from "./card.styles.js";
|
13
|
+
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, i = (t, e, o, s) => {
|
14
|
+
for (var r = s > 1 ? void 0 : s ? x(e, o) : e, h = t.length - 1, l; h >= 0; h--)
|
15
|
+
(l = t[h]) && (r = (s ? l(e, o, r) : l(r)) || r);
|
16
|
+
return s && r && w(e, o, r), r;
|
17
|
+
};
|
18
|
+
const _ = {
|
19
|
+
noBorder: "no-border",
|
20
|
+
noPadding: "no-padding",
|
21
|
+
stretch: "stretch"
|
22
|
+
};
|
23
|
+
var p, a;
|
24
|
+
const y = class y extends b {
|
12
25
|
constructor() {
|
13
|
-
super(...arguments)
|
26
|
+
super(...arguments);
|
27
|
+
d(this, p);
|
28
|
+
d(this, a);
|
29
|
+
c(this, p, this.attachInternals()), c(this, a, m(this, p).states), this.noBorder = !1, this.noPadding = !1, this.stretch = !1;
|
30
|
+
}
|
31
|
+
_handleStateChange(o, s, r) {
|
32
|
+
v(m(this, a), _[o]).set(r);
|
14
33
|
}
|
15
34
|
render() {
|
16
|
-
return
|
35
|
+
return O`<slot id="root"></slot>`;
|
17
36
|
}
|
18
37
|
};
|
19
|
-
|
20
|
-
let
|
21
|
-
|
22
|
-
|
23
|
-
],
|
24
|
-
|
25
|
-
|
26
|
-
],
|
27
|
-
|
28
|
-
|
29
|
-
],
|
38
|
+
p = new WeakMap(), a = new WeakMap(), y.styles = [B, j];
|
39
|
+
let n = y;
|
40
|
+
i([
|
41
|
+
f({ type: Boolean, attribute: "no-border" })
|
42
|
+
], n.prototype, "noBorder", 2);
|
43
|
+
i([
|
44
|
+
f({ type: Boolean, attribute: "no-padding" })
|
45
|
+
], n.prototype, "noPadding", 2);
|
46
|
+
i([
|
47
|
+
f({ type: Boolean })
|
48
|
+
], n.prototype, "stretch", 2);
|
49
|
+
i([
|
50
|
+
P(Object.keys(_))
|
51
|
+
], n.prototype, "_handleStateChange", 1);
|
30
52
|
export {
|
31
|
-
|
53
|
+
n as SkfCard
|
32
54
|
};
|
@@ -1,33 +1,50 @@
|
|
1
1
|
import { css as r } from "lit";
|
2
|
-
const
|
2
|
+
const a = r`
|
3
3
|
@layer components {
|
4
4
|
@layer base {
|
5
5
|
:host {
|
6
|
-
background-color: var(--skf-bg-color-neutral-1);
|
7
|
-
border: var(--skf-border-width-sm) solid
|
8
|
-
var(--_skf-card-border-color, var(--skf-border-color-tertiary));
|
9
|
-
border-radius: var(--skf-border-radius-sm);
|
10
|
-
box-shadow: var(--skf-shadow-md);
|
11
6
|
contain: layout;
|
12
|
-
|
7
|
+
}
|
8
|
+
|
9
|
+
#root {
|
10
|
+
--_skf-card-bg-color: var(--mod-card-bg-color, var(--skf-bg-color-neutral-1));
|
11
|
+
--_skf-card-border-color: var(--skf-border-color-tertiary);
|
12
|
+
--_skf-card-padding: var(--skf-spacing-100);
|
13
|
+
--_skf-card-shadow: var(--skf-shadow-md);
|
14
|
+
|
15
|
+
background-color: var(--_skf-card-bg-color);
|
16
|
+
border: var(--skf-border-width-sm) solid var(--_skf-card-border-color);
|
17
|
+
border-radius: var(--skf-border-radius-sm);
|
18
|
+
box-shadow: var(--_skf-card-shadow);
|
19
|
+
display: block;
|
20
|
+
padding: var(--_skf-card-padding);
|
13
21
|
}
|
14
22
|
}
|
15
23
|
|
16
24
|
@layer mods {
|
17
|
-
:host(
|
18
|
-
|
25
|
+
:host(:state(no-border)) {
|
26
|
+
#root {
|
27
|
+
--_skf-card-border-color: transparent;
|
28
|
+
--_skf-card-shadow: none;
|
29
|
+
}
|
19
30
|
}
|
20
31
|
|
21
|
-
:host(
|
22
|
-
|
32
|
+
:host(:state(no-padding)) {
|
33
|
+
#root {
|
34
|
+
--_skf-card-padding: 0;
|
35
|
+
}
|
23
36
|
}
|
24
37
|
|
25
|
-
:host(
|
26
|
-
|
38
|
+
:host(:state(stretch)) {
|
39
|
+
block-size: 100%;
|
40
|
+
|
41
|
+
#root {
|
42
|
+
block-size: inherit;
|
43
|
+
}
|
27
44
|
}
|
28
45
|
}
|
29
46
|
}
|
30
47
|
`;
|
31
48
|
export {
|
32
|
-
|
49
|
+
a as styles
|
33
50
|
};
|
@@ -6,7 +6,10 @@ interface DateParts {
|
|
6
6
|
month?: number;
|
7
7
|
day?: number;
|
8
8
|
}
|
9
|
-
|
9
|
+
/**
|
10
|
+
* @tagname skf-datepicker-calendar
|
11
|
+
*/
|
12
|
+
export declare class SkfDatepickerCalendar extends SkfElement {
|
10
13
|
static styles: CSSResultGroup;
|
11
14
|
/** @internal */
|
12
15
|
_secondCalendarOffset: number;
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import { dateFormatter as y } from "../date-picker-input/datepicker-input.helpers.js";
|
2
|
-
import { compareDates as $ } from "./datepicker.helpers.js";
|
3
1
|
import { SkfElement as O } from "../../internal/components/skf-element.js";
|
4
2
|
import { watch as R } from "../../internal/helpers/watch.js";
|
5
3
|
import { Temporal as m } from "@js-temporal/polyfill";
|
@@ -7,11 +5,13 @@ import { componentStyles as C } from "../../styles/component.styles.js";
|
|
7
5
|
import { html as p } from "lit";
|
8
6
|
import { property as g, state as M } from "lit/decorators.js";
|
9
7
|
import { repeat as w } from "lit/directives/repeat.js";
|
10
|
-
import { styles as F } from "./datepicker
|
11
|
-
|
12
|
-
|
8
|
+
import { styles as F } from "./datepicker-calendar.styles.js";
|
9
|
+
import { compareDates as $ } from "./datepicker-popup.helpers.js";
|
10
|
+
import { dateFormatter as y } from "./datepicker.helpers.js";
|
11
|
+
var P = Object.defineProperty, A = Object.getOwnPropertyDescriptor, d = (D, t, e, a) => {
|
12
|
+
for (var s = a > 1 ? void 0 : a ? A(t, e) : t, i = D.length - 1, h; i >= 0; i--)
|
13
13
|
(h = D[i]) && (s = (a ? h(t, e, s) : h(s)) || s);
|
14
|
-
return a && s &&
|
14
|
+
return a && s && P(t, e, s), s;
|
15
15
|
};
|
16
16
|
const E = class E extends O {
|
17
17
|
constructor() {
|
@@ -411,5 +411,5 @@ d([
|
|
411
411
|
R("date")
|
412
412
|
], o.prototype, "handleDateChange", 1);
|
413
413
|
export {
|
414
|
-
o as
|
414
|
+
o as SkfDatepickerCalendar
|
415
415
|
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { SkfDatepickerCalendar } from './datepicker-calendar.component.js';
|
2
|
+
export * from './datepicker-calendar.component.js';
|
3
|
+
export default SkfDatepickerCalendar;
|
4
|
+
declare global {
|
5
|
+
interface HTMLElementTagNameMap {
|
6
|
+
'skf-datepicker-calendar': SkfDatepickerCalendar;
|
7
|
+
}
|
8
|
+
}
|
@@ -1,27 +1,12 @@
|
|
1
|
-
import '../button/button';
|
1
|
+
import '../button/button.js';
|
2
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
3
3
|
import { type CSSResultGroup } from 'lit';
|
4
|
-
import './datepicker';
|
5
|
-
export interface
|
4
|
+
import './datepicker-calendar.js';
|
5
|
+
export interface SkfDatepickerPopupDateRange {
|
6
6
|
start: Date | null;
|
7
7
|
end: Date | null;
|
8
8
|
}
|
9
|
-
|
10
|
-
* A date picker component that allows users to select a date or a range of dates.
|
11
|
-
*
|
12
|
-
* @element skf-datepicker
|
13
|
-
* @fires selected-date-changed - When a date is selected
|
14
|
-
* @fires selected-date-range-changed - When a range of dates is selected
|
15
|
-
*
|
16
|
-
* @prop {string} date - The date to display in the date picker
|
17
|
-
* @prop {boolean} range - If true, the date picker will allow the selection of a range of dates
|
18
|
-
* @prop {string} locale - The locale to use for formatting the date
|
19
|
-
*
|
20
|
-
* @slot - Default hint content placed inside the date picker
|
21
|
-
*
|
22
|
-
* @cssprop --max-width - The maximum width of the date picker
|
23
|
-
*/
|
24
|
-
export declare class SkfDatePicker extends SkfElement {
|
9
|
+
export declare class SkfDatepickerPopup extends SkfElement {
|
25
10
|
static styles: CSSResultGroup;
|
26
11
|
locale: string;
|
27
12
|
date: string;
|
@@ -40,7 +25,7 @@ export declare class SkfDatePicker extends SkfElement {
|
|
40
25
|
* Latest selectable date. (yyyy-mm-dd format)
|
41
26
|
*/
|
42
27
|
selectableTo?: string;
|
43
|
-
selectedDateRange:
|
28
|
+
selectedDateRange: SkfDatepickerPopupDateRange;
|
44
29
|
/** @internal */
|
45
30
|
private _date?;
|
46
31
|
/** @internal */
|
@@ -1,19 +1,19 @@
|
|
1
1
|
import "../button/button.js";
|
2
|
-
import {
|
3
|
-
import { SkfElement as R } from "../../internal/components/skf-element.js";
|
2
|
+
import { SkfElement as v } from "../../internal/components/skf-element.js";
|
4
3
|
import { watch as p } from "../../internal/helpers/watch.js";
|
5
|
-
import { componentStyles as
|
4
|
+
import { componentStyles as R } from "../../styles/component.styles.js";
|
6
5
|
import { html as D } from "lit";
|
7
6
|
import { property as o, state as m } from "lit/decorators.js";
|
8
|
-
import "./datepicker.js";
|
9
|
-
import { getDateParts as g, assertISODate as
|
10
|
-
import { styles as
|
7
|
+
import "./datepicker-calendar.js";
|
8
|
+
import { getDateParts as g, assertISODate as S, earliestDate as $, latestDate as T, compareDates as c, doAnimate as b } from "./datepicker-popup.helpers.js";
|
9
|
+
import { styles as C } from "./datepicker-popup.styles.js";
|
10
|
+
import { dateFormatter as l, is as k } from "./datepicker.helpers.js";
|
11
11
|
var F = Object.defineProperty, E = Object.getOwnPropertyDescriptor, n = (w, e, t, a) => {
|
12
12
|
for (var s = a > 1 ? void 0 : a ? E(e, t) : e, r = w.length - 1, d; r >= 0; r--)
|
13
13
|
(d = w[r]) && (s = (a ? d(e, t, s) : d(s)) || s);
|
14
14
|
return a && s && F(e, t, s), s;
|
15
15
|
};
|
16
|
-
const y = class y extends
|
16
|
+
const y = class y extends v {
|
17
17
|
constructor() {
|
18
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
19
|
start: null,
|
@@ -96,8 +96,8 @@ const y = class y extends R {
|
|
96
96
|
this.style.setProperty("--max-width", this.range ? "43em" : "21em");
|
97
97
|
}
|
98
98
|
_handleDateChange() {
|
99
|
-
console.log("%cdate changed", "color:red", this.date), this.date = this.date &&
|
100
|
-
|
99
|
+
console.log("%cdate changed", "color:red", this.date), this.date = this.date && S(this.date) ? this.date : l(/* @__PURE__ */ new Date()), this.date = $(
|
100
|
+
T(this.date, this.selectableFrom ?? this.date),
|
101
101
|
this.selectableTo ?? this.date
|
102
102
|
), this._date = new Date(this.date), this._datePlusOneMonth = new Date(this._date.getFullYear(), this._date.getMonth() + 1, 1);
|
103
103
|
}
|
@@ -113,7 +113,7 @@ const y = class y extends R {
|
|
113
113
|
gotoDate(e) {
|
114
114
|
if (e instanceof Date)
|
115
115
|
this.date = l(e);
|
116
|
-
else if (
|
116
|
+
else if (k(e).dateISO())
|
117
117
|
this.date = e;
|
118
118
|
else
|
119
119
|
throw new Error("Invalid date format");
|
@@ -209,7 +209,7 @@ const y = class y extends R {
|
|
209
209
|
)) : Promise.resolve();
|
210
210
|
}
|
211
211
|
};
|
212
|
-
y.styles = [
|
212
|
+
y.styles = [R, C];
|
213
213
|
let i = y;
|
214
214
|
n([
|
215
215
|
o({ reflect: !0 })
|
@@ -257,5 +257,5 @@ n([
|
|
257
257
|
p("selectedDate")
|
258
258
|
], i.prototype, "_handleSelectedDateChange", 1);
|
259
259
|
export {
|
260
|
-
i as
|
260
|
+
i as SkfDatepickerPopup
|
261
261
|
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { SkfDatepickerPopup } from './datepicker-popup.component.js';
|
2
|
+
export * from './datepicker-popup.component.js';
|
3
|
+
export default SkfDatepickerPopup;
|
4
|
+
declare global {
|
5
|
+
interface HTMLElementTagNameMap {
|
6
|
+
'skf-datepicker-popup': SkfDatepickerPopup;
|
7
|
+
}
|
8
|
+
}
|
@@ -22,12 +22,12 @@ export declare function getDateParts(date?: undefined | string | Date | Temporal
|
|
22
22
|
*/
|
23
23
|
export declare function compareDates(dateOne: Temporal.PlainDate | string, dateTwo: Temporal.PlainDate | string, granularity?: 'days' | 'months' | 'years'): 0 | 1 | -1;
|
24
24
|
/**
|
25
|
-
* @param dateOne - first date to compare as string
|
26
|
-
* @param dateTwo - second date to compare as string
|
25
|
+
* @param dateOne - first date to compare as string (accepts Date and Temporal.PlainDate too)
|
26
|
+
* @param dateTwo - second date to compare as string (accepts Date and Temporal.PlainDate too)
|
27
27
|
* @param unit - the unit to compare the dates by [days, months, years]
|
28
28
|
* @returns the difference between the two dates in the specified unit
|
29
29
|
*/
|
30
|
-
export declare function timeBetween(dateOne: Temporal.PlainDate | string, dateTwo: Temporal.PlainDate | string, unit?: 'days' | 'months' | 'years'): number;
|
30
|
+
export declare function timeBetween(dateOne: Temporal.PlainDate | Date | string, dateTwo: Temporal.PlainDate | Date | string, unit?: 'days' | 'months' | 'years'): number;
|
31
31
|
/**
|
32
32
|
* @param dates - a list of dates to compare
|
33
33
|
* @returns - the earliest date of the list
|