@oslokommune/punkt-elements 16.8.2 → 16.9.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.
- package/CHANGELOG.md +34 -0
- package/dist/accordion.d.ts +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/backlink.d.ts +1 -1
- package/dist/base-elements/element-with-slot.d.ts +21 -0
- package/dist/base-elements/element.d.ts +32 -0
- package/dist/base-elements/input-element.d.ts +173 -0
- package/dist/base-elements/options-input-element.d.ts +73 -0
- package/dist/breadcrumbs.d.ts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/combobox.d.ts +1 -1
- package/dist/components/accordion/accordion.d.ts +20 -0
- package/dist/components/accordion/accordion.test.d.ts +0 -0
- package/dist/components/accordion/accordionitem.d.ts +32 -0
- package/dist/components/accordion/index.d.ts +5 -0
- package/dist/components/alert/alert.d.ts +30 -0
- package/dist/components/alert/alert.test.d.ts +13 -0
- package/dist/components/alert/index.d.ts +3 -0
- package/dist/components/backlink/backlink.d.ts +14 -0
- package/dist/components/backlink/backlink.test.d.ts +10 -0
- package/dist/components/backlink/index.d.ts +4 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/dist/components/breadcrumbs/breadcrumbs.test.d.ts +0 -0
- package/dist/components/breadcrumbs/index.d.ts +2 -0
- package/dist/components/button/button.d.ts +53 -0
- package/dist/components/button/button.test.d.ts +22 -0
- package/dist/components/button/index.d.ts +4 -0
- package/dist/components/calendar/calendar.accessibility.test.d.ts +16 -0
- package/dist/components/calendar/calendar.constraints.test.d.ts +0 -0
- package/dist/components/calendar/calendar.core.test.d.ts +0 -0
- package/dist/components/calendar/calendar.d.ts +97 -0
- package/dist/components/calendar/calendar.interaction.test.d.ts +0 -0
- package/dist/components/calendar/calendar.selection.test.d.ts +0 -0
- package/dist/components/calendar/index.d.ts +3 -0
- package/dist/components/card/card.d.ts +64 -0
- package/dist/components/card/card.test.d.ts +22 -0
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/checkbox/checkbox.d.ts +32 -0
- package/dist/components/checkbox/checkbox.test.d.ts +24 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/combobox/combobox-base.d.ts +74 -0
- package/dist/components/combobox/combobox-handlers.d.ts +28 -0
- package/dist/components/combobox/combobox-types.d.ts +5 -0
- package/dist/components/combobox/combobox-utils.d.ts +41 -0
- package/dist/components/combobox/combobox-value.d.ts +17 -0
- package/dist/components/combobox/combobox.accessibility.test.d.ts +0 -0
- package/dist/components/combobox/combobox.core.test.d.ts +0 -0
- package/dist/components/combobox/combobox.d.ts +61 -0
- package/dist/components/combobox/combobox.interaction.test.d.ts +0 -0
- package/dist/components/combobox/combobox.selection.test.d.ts +0 -0
- package/dist/components/combobox/index.d.ts +4 -0
- package/dist/components/consent/consent.d.ts +46 -0
- package/dist/components/consent/consent.test.d.ts +16 -0
- package/dist/components/consent/index.d.ts +4 -0
- package/dist/components/consent/strings.d.ts +85 -0
- package/dist/components/datepicker/date-tags.d.ts +20 -0
- package/dist/components/datepicker/date-tags.test.d.ts +12 -0
- package/dist/components/datepicker/datepicker-base.d.ts +39 -0
- package/dist/components/datepicker/datepicker-multiple.d.ts +10 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +34 -0
- package/dist/components/datepicker/datepicker-popup.test.d.ts +4 -0
- package/dist/components/datepicker/datepicker-range.d.ts +12 -0
- package/dist/components/datepicker/datepicker-single.d.ts +8 -0
- package/dist/components/datepicker/datepicker-types.d.ts +6 -0
- package/dist/components/datepicker/datepicker-utils.d.ts +77 -0
- package/dist/components/datepicker/datepicker-utils.test.d.ts +1 -0
- package/dist/components/datepicker/datepicker.accessibility.test.d.ts +0 -0
- package/dist/components/datepicker/datepicker.core.test.d.ts +0 -0
- package/dist/components/datepicker/datepicker.d.ts +83 -0
- package/dist/components/datepicker/datepicker.input.test.d.ts +0 -0
- package/dist/components/datepicker/datepicker.selection.test.d.ts +0 -0
- package/dist/components/datepicker/datepicker.validation.test.d.ts +0 -0
- package/dist/components/datepicker/index.d.ts +6 -0
- package/dist/components/header/header-service.d.ts +86 -0
- package/dist/components/header/header-service.test.d.ts +18 -0
- package/dist/components/header/header-user-menu.d.ts +29 -0
- package/dist/components/header/header-utils.d.ts +6 -0
- package/dist/components/header/header.d.ts +52 -0
- package/dist/components/header/index.d.ts +5 -0
- package/dist/components/header/types.d.ts +59 -0
- package/dist/components/heading/heading.d.ts +28 -0
- package/dist/components/heading/heading.test.d.ts +0 -0
- package/dist/components/heading/index.d.ts +4 -0
- package/dist/components/helptext/helptext.d.ts +9 -0
- package/dist/components/helptext/helptext.test.d.ts +0 -0
- package/dist/components/helptext/index.d.ts +3 -0
- package/dist/components/icon/icon.d.ts +22 -0
- package/dist/components/icon/icon.test.d.ts +10 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/index.d.ts +45 -0
- package/dist/components/input-wrapper/index.d.ts +3 -0
- package/dist/components/input-wrapper/input-wrapper.d.ts +39 -0
- package/dist/components/input-wrapper/input-wrapper.test.d.ts +31 -0
- package/dist/components/link/index.d.ts +3 -0
- package/dist/components/link/link.d.ts +12 -0
- package/dist/components/link/link.test.d.ts +15 -0
- package/dist/components/linkcard/index.d.ts +4 -0
- package/dist/components/linkcard/linkcard.d.ts +19 -0
- package/dist/components/linkcard/linkcard.test.d.ts +9 -0
- package/dist/components/listbox/index.d.ts +4 -0
- package/dist/components/listbox/listbox.d.ts +64 -0
- package/dist/components/listbox/listbox.interaction.test.d.ts +10 -0
- package/dist/components/listbox/listbox.test.d.ts +10 -0
- package/dist/components/loader/index.d.ts +4 -0
- package/dist/components/loader/loader.d.ts +53 -0
- package/dist/components/loader/loader.test.d.ts +8 -0
- package/dist/components/messagebox/index.d.ts +4 -0
- package/dist/components/messagebox/messagebox.d.ts +21 -0
- package/dist/components/messagebox/messagebox.test.d.ts +8 -0
- package/dist/components/modal/index.d.ts +3 -0
- package/dist/components/modal/modal.d.ts +41 -0
- package/dist/components/progressbar/index.d.ts +4 -0
- package/dist/components/progressbar/progressbar.d.ts +49 -0
- package/dist/components/progressbar/progressbar.test.d.ts +8 -0
- package/dist/components/radiobutton/index.d.ts +3 -0
- package/dist/components/radiobutton/radiobutton.d.ts +24 -0
- package/dist/components/radiobutton/radiobutton.test.d.ts +28 -0
- package/dist/components/select/index.d.ts +4 -0
- package/dist/components/select/select.d.ts +48 -0
- package/dist/components/select/select.test.d.ts +21 -0
- package/dist/components/tabs/index.d.ts +5 -0
- package/dist/components/tabs/tabitem.d.ts +33 -0
- package/dist/components/tabs/tabs-context.d.ts +21 -0
- package/dist/components/tabs/tabs.d.ts +23 -0
- package/dist/components/tabs/tabs.test.d.ts +0 -0
- package/dist/components/tag/index.d.ts +4 -0
- package/dist/components/tag/tag.d.ts +44 -0
- package/dist/components/tag/tag.test.d.ts +8 -0
- package/dist/components/textarea/index.d.ts +3 -0
- package/dist/components/textarea/textarea.d.ts +16 -0
- package/dist/components/textarea/textarea.test.d.ts +27 -0
- package/dist/components/textinput/index.d.ts +3 -0
- package/dist/components/textinput/textinput.d.ts +21 -0
- package/dist/components/textinput/textinput.test.d.ts +32 -0
- package/dist/components/timepicker/index.d.ts +2 -0
- package/dist/components/timepicker/timepicker.d.ts +94 -0
- package/dist/components/timepicker/timepicker.test.d.ts +22 -0
- package/dist/consent.d.ts +1 -1
- package/dist/controllers/pkt-options-controller.d.ts +21 -0
- package/dist/controllers/pkt-slot-utils.d.ts +3 -0
- package/dist/datepicker.d.ts +1 -1
- package/dist/directives/slot-content.d.ts +128 -0
- package/dist/directives/slot-content.test.d.ts +0 -0
- package/dist/docs/backlink.d.ts +4 -0
- package/dist/docs/components/accordion.d.ts +5 -0
- package/dist/docs/components/alert.d.ts +7 -0
- package/dist/docs/components/backlink.d.ts +4 -0
- package/dist/docs/components/breadcrumbs.d.ts +8 -0
- package/dist/docs/components/button.d.ts +11 -0
- package/dist/docs/components/calendar.d.ts +4 -0
- package/dist/docs/components/card.d.ts +27 -0
- package/dist/docs/components/checkbox.d.ts +8 -0
- package/dist/docs/components/combobox.d.ts +11 -0
- package/dist/docs/components/comboboxdemo.d.ts +4 -0
- package/dist/docs/components/consent.d.ts +4 -0
- package/dist/docs/components/datepicker.d.ts +4 -0
- package/dist/docs/components/datepickermultiple.d.ts +4 -0
- package/dist/docs/components/form.d.ts +9 -0
- package/dist/docs/components/header-full.d.ts +23 -0
- package/dist/docs/components/header.d.ts +18 -0
- package/dist/docs/components/heading.d.ts +12 -0
- package/dist/docs/components/icon.d.ts +4 -0
- package/dist/docs/components/input-wrapper.d.ts +4 -0
- package/dist/docs/components/link.d.ts +4 -0
- package/dist/docs/components/linkcard.d.ts +4 -0
- package/dist/docs/components/loader.d.ts +4 -0
- package/dist/docs/components/messagebox.d.ts +4 -0
- package/dist/docs/components/modal.d.ts +14 -0
- package/dist/docs/components/progressbar.d.ts +9 -0
- package/dist/docs/components/radiobutton.d.ts +12 -0
- package/dist/docs/components/select.d.ts +10 -0
- package/dist/docs/components/slots.d.ts +35 -0
- package/dist/docs/components/tabs.d.ts +31 -0
- package/dist/docs/components/tag.d.ts +4 -0
- package/dist/docs/components/textarea.d.ts +4 -0
- package/dist/docs/components/textinput.d.ts +4 -0
- package/dist/docs/components/timepicker.d.ts +4 -0
- package/dist/docs/header.d.ts +14 -0
- package/dist/docs/punkt-docs.d.ts +12 -0
- package/dist/header.d.ts +1 -1
- package/dist/heading.d.ts +1 -1
- package/dist/helpers/converters.d.ts +9 -0
- package/dist/helptext.d.ts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/index.d.ts +2 -1971
- package/dist/input-wrapper.d.ts +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/linkcard.d.ts +1 -1
- package/dist/listbox.d.ts +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/messagebox.d.ts +1 -1
- package/dist/modal.d.ts +1 -1
- package/dist/progressbar.d.ts +1 -1
- package/dist/radiobutton.d.ts +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/shared-types/aria.d.ts +65 -0
- package/dist/shared-types/booleanish.d.ts +13 -0
- package/dist/shared-types/calendar.d.ts +41 -0
- package/dist/shared-types/combobox.d.ts +34 -0
- package/dist/shared-types/datepicker.d.ts +46 -0
- package/dist/shared-types/form.d.ts +16 -0
- package/dist/shared-types/header.d.ts +88 -0
- package/dist/shared-types/heading.d.ts +9 -0
- package/dist/shared-types/index.d.ts +17 -0
- package/dist/shared-types/layout.d.ts +26 -0
- package/dist/shared-types/progressbar.d.ts +5 -0
- package/dist/shared-types/size.d.ts +18 -0
- package/dist/shared-types/skin.d.ts +24 -0
- package/dist/shared-types/timepicker.d.ts +20 -0
- package/dist/shared-utils/calendar/calendar-grid.d.ts +16 -0
- package/dist/shared-utils/calendar/date-validation.d.ts +22 -0
- package/dist/shared-utils/calendar/index.d.ts +10 -0
- package/dist/shared-utils/calendar/keyboard-navigation.d.ts +16 -0
- package/dist/shared-utils/calendar/selection-manager.d.ts +30 -0
- package/dist/shared-utils/combobox/index.d.ts +10 -0
- package/dist/shared-utils/combobox/input-utils.d.ts +38 -0
- package/dist/shared-utils/combobox/keyboard-navigation.d.ts +39 -0
- package/dist/shared-utils/combobox/option-utils.d.ts +50 -0
- package/dist/shared-utils/combobox/selection-manager.d.ts +71 -0
- package/dist/shared-utils/combobox/typeahead.d.ts +24 -0
- package/dist/shared-utils/date-utils.d.ts +138 -0
- package/dist/shared-utils/datepicker-utils.d.ts +73 -0
- package/dist/shared-utils/device-utils.d.ts +10 -0
- package/dist/shared-utils/timepicker/index.d.ts +6 -0
- package/dist/shared-utils/timepicker/options.d.ts +19 -0
- package/dist/shared-utils/timepicker/stepper.d.ts +20 -0
- package/dist/shared-utils/timepicker/time-utils.d.ts +19 -0
- package/dist/shared-utils/utils.d.ts +16 -0
- package/dist/shared-utils/value-utils.d.ts +17 -0
- package/dist/tabs.d.ts +1 -1
- package/dist/tag.d.ts +1 -1
- package/dist/tests/component-registry.d.ts +64 -0
- package/dist/tests/test-framework.d.ts +29 -0
- package/dist/textarea.d.ts +1 -1
- package/dist/textinput.d.ts +1 -1
- package/dist/timepicker.d.ts +1 -1
- package/dist/translations/no.json.d.ts +93 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/size.d.ts +1 -0
- package/dist/types/typeUtils.d.ts +6 -0
- package/dist/utils/classutils.d.ts +12 -0
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PktElement } from '../../base-elements/element';
|
|
2
|
+
type TYear = `${number}${number}${number}${number}`;
|
|
3
|
+
type TMonth = `${number}${number}`;
|
|
4
|
+
type TDay = `${number}${number}`;
|
|
5
|
+
export type TISODate = `${TYear}-${TMonth}-${TDay}`;
|
|
6
|
+
/**
|
|
7
|
+
* OBS! `dateformat` er standard formatteringsstreng for visning av datoer.
|
|
8
|
+
* Denne brukes for å sette "menneskeleselig" format på datoene i tags.
|
|
9
|
+
*
|
|
10
|
+
* Følger denne unicode-standarden:
|
|
11
|
+
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
|
|
12
|
+
*/
|
|
13
|
+
export declare class PktDateTags extends PktElement {
|
|
14
|
+
dates: TISODate[];
|
|
15
|
+
dateformat: string;
|
|
16
|
+
className: string;
|
|
17
|
+
idBase: string;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
import { PktDateTags } from './date-tags';
|
|
3
|
+
export interface IDateTagsTest extends BaseTestConfig {
|
|
4
|
+
dates?: string[];
|
|
5
|
+
idBase?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
dateformat?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const createDateTagsTest: (config?: IDateTagsTest) => Promise<{
|
|
10
|
+
container: HTMLElement;
|
|
11
|
+
dateTags: PktDateTags;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
3
|
+
import { PktElement } from '../../base-elements/element';
|
|
4
|
+
import { IDatepickerStrings } from './datepicker-types';
|
|
5
|
+
/**
|
|
6
|
+
* Abstract base class for datepicker input components
|
|
7
|
+
*
|
|
8
|
+
* Consolidates shared properties, methods, and event dispatchers
|
|
9
|
+
* used by all three datepicker input types (single, multiple, range).
|
|
10
|
+
*
|
|
11
|
+
* Subclasses must implement:
|
|
12
|
+
* - `strings` property with component-specific defaults
|
|
13
|
+
* - `render()` method with component-specific template
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class PktDatepickerBase extends PktElement {
|
|
16
|
+
inputType: string;
|
|
17
|
+
id: string;
|
|
18
|
+
min?: string;
|
|
19
|
+
max?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
readonly: boolean;
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
inputClasses: Record<string, boolean>;
|
|
24
|
+
internals?: ElementInternals;
|
|
25
|
+
abstract strings: IDatepickerStrings;
|
|
26
|
+
inputRef: Ref<HTMLInputElement>;
|
|
27
|
+
btnRef: Ref<HTMLButtonElement>;
|
|
28
|
+
get inputElement(): HTMLInputElement | undefined;
|
|
29
|
+
get buttonElement(): HTMLButtonElement | undefined;
|
|
30
|
+
get isInputReadonly(): boolean;
|
|
31
|
+
protected dispatchToggleCalendar(e: Event): void;
|
|
32
|
+
protected dispatchInput(e: Event): void;
|
|
33
|
+
protected dispatchFocus(): void;
|
|
34
|
+
protected dispatchBlur(e: FocusEvent): void;
|
|
35
|
+
protected dispatchChange(e: Event): void;
|
|
36
|
+
protected renderCalendarButton(): TemplateResult;
|
|
37
|
+
createRenderRoot(): this;
|
|
38
|
+
abstract render(): TemplateResult;
|
|
39
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PktDatepickerBase } from './datepicker-base';
|
|
2
|
+
import { IDatepickerStrings } from './datepicker-types';
|
|
3
|
+
export declare class PktDatepickerMultiple extends PktDatepickerBase {
|
|
4
|
+
value: string[];
|
|
5
|
+
maxlength?: number;
|
|
6
|
+
strings: IDatepickerStrings;
|
|
7
|
+
get isInputDisabled(): boolean;
|
|
8
|
+
private dispatchAddToSelected;
|
|
9
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { PktElement } from '../../base-elements/element';
|
|
3
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
4
|
+
export declare class PktDatepickerPopup extends PktElement {
|
|
5
|
+
open: boolean;
|
|
6
|
+
multiple: boolean;
|
|
7
|
+
range: boolean;
|
|
8
|
+
weeknumbers: boolean;
|
|
9
|
+
withcontrols: boolean;
|
|
10
|
+
maxMultiple: number | null;
|
|
11
|
+
selected: string[];
|
|
12
|
+
earliest: string | null;
|
|
13
|
+
latest: string | null;
|
|
14
|
+
excludedates: string[];
|
|
15
|
+
excludeweekdays: string[];
|
|
16
|
+
currentmonth: string | null;
|
|
17
|
+
today: string | null;
|
|
18
|
+
private _hasBeenOpened;
|
|
19
|
+
popupRef: Ref<HTMLElement>;
|
|
20
|
+
calendarRef: Ref<HTMLElement>;
|
|
21
|
+
firstUpdated(): void;
|
|
22
|
+
updated(changedProperties: PropertyValues): void;
|
|
23
|
+
disconnectedCallback(): void;
|
|
24
|
+
handleDocumentClick: (e: MouseEvent) => void;
|
|
25
|
+
handleDocumentKeydown: (e: KeyboardEvent) => void;
|
|
26
|
+
show(): void;
|
|
27
|
+
hide(): void;
|
|
28
|
+
toggle(): void;
|
|
29
|
+
contains(node: Node | null): boolean;
|
|
30
|
+
focusOnCurrentDate(): void;
|
|
31
|
+
addToSelected(e: Event, min?: string | null, max?: string | null): void;
|
|
32
|
+
handleDateSelect(date: Date): Promise<void> | undefined;
|
|
33
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
2
|
+
import { PktDatepickerBase } from './datepicker-base';
|
|
3
|
+
import { IDatepickerStrings } from './datepicker-types';
|
|
4
|
+
export declare class PktDatepickerRange extends PktDatepickerBase {
|
|
5
|
+
value: string[];
|
|
6
|
+
label: string;
|
|
7
|
+
showRangeLabels: boolean;
|
|
8
|
+
strings: IDatepickerStrings;
|
|
9
|
+
inputRefTo: Ref<HTMLInputElement>;
|
|
10
|
+
get inputElementTo(): HTMLInputElement | undefined;
|
|
11
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PktDatepickerBase } from './datepicker-base';
|
|
2
|
+
import { IDatepickerStrings } from './datepicker-types';
|
|
3
|
+
export declare class PktDatepickerSingle extends PktDatepickerBase {
|
|
4
|
+
value: string;
|
|
5
|
+
strings: IDatepickerStrings;
|
|
6
|
+
private dispatchManageValidity;
|
|
7
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the datepicker component family.
|
|
3
|
+
* Re-exports from shared-types for backward compatibility.
|
|
4
|
+
*/
|
|
5
|
+
export type { IDatepickerStrings } from '../../shared-types/datepicker';
|
|
6
|
+
export { defaultSingleStrings, defaultRangeStrings } from '../../shared-types/datepicker';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
2
|
+
import { PktCalendar } from '../calendar/calendar';
|
|
3
|
+
/**
|
|
4
|
+
* Utility functions for PktDatepicker component
|
|
5
|
+
*
|
|
6
|
+
* This module provides helper functions organized by concern.
|
|
7
|
+
* Framework-agnostic functions are delegated to shared-utils/datepicker-utils.
|
|
8
|
+
* Lit-specific functions (using Ref, ElementInternals, PktCalendar) stay here.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Value parsing and validation utilities
|
|
12
|
+
* Delegates to shared-utils/datepicker-utils
|
|
13
|
+
*/
|
|
14
|
+
export declare const valueUtils: {
|
|
15
|
+
validateRangeOrder: (values: string[]) => boolean;
|
|
16
|
+
sortDates: (dates: string[]) => string[];
|
|
17
|
+
filterSelectableDates: (dates: string[], min?: string | null, max?: string | null, excludedDates?: string[], excludedWeekdays?: string[]) => string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Input type detection utilities
|
|
21
|
+
* Delegates to shared-utils/datepicker-utils
|
|
22
|
+
*/
|
|
23
|
+
export declare const inputTypeUtils: {
|
|
24
|
+
getInputType: () => string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Form and validation utilities (Lit-specific — uses ElementInternals)
|
|
28
|
+
*/
|
|
29
|
+
export declare const formUtils: {
|
|
30
|
+
submitForm(element: HTMLElement): void;
|
|
31
|
+
submitFormOrFallback(internals: any, fallbackAction: () => void): void;
|
|
32
|
+
validateDateInput(input: HTMLInputElement, internals: any, min?: string | null, max?: string | null, strings?: any): void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Calendar interaction utilities
|
|
36
|
+
* handleCalendarPosition delegates to shared-utils (with Lit ref unwrapping).
|
|
37
|
+
* addToSelected stays Lit-specific (uses Ref<PktCalendar>).
|
|
38
|
+
*/
|
|
39
|
+
export declare const calendarUtils: {
|
|
40
|
+
addToSelected(event: Event | KeyboardEvent, calendarRef: Ref<PktCalendar>, min?: string | null, max?: string | null): void;
|
|
41
|
+
handleCalendarPosition(popupRef: Ref<HTMLDivElement>, inputRef: Ref<HTMLInputElement>, hasCounter?: boolean): void;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Event handling utilities (Lit-specific — uses Lit Ref types)
|
|
45
|
+
*/
|
|
46
|
+
export declare const eventUtils: {
|
|
47
|
+
createDocumentClickListener(inputRef: Ref<HTMLInputElement>, inputRefTo: Ref<HTMLInputElement> | null, btnRef: Ref<HTMLButtonElement>, getCalendarOpen: () => boolean, onBlur: () => void, hideCalendar: () => void): (e: MouseEvent) => void;
|
|
48
|
+
createDocumentKeydownListener(getCalendarOpen: () => boolean, hideCalendar: () => void): (e: KeyboardEvent) => void;
|
|
49
|
+
handleFocusOut(event: FocusEvent, element: HTMLElement, onBlur: () => void, hideCalendar: () => void): void;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* CSS class utilities
|
|
53
|
+
* Delegates to shared-utils/datepicker-utils
|
|
54
|
+
*/
|
|
55
|
+
export declare const cssUtils: {
|
|
56
|
+
getInputClasses: (fullwidth: boolean, showRangeLabels: boolean, multiple: boolean, range: boolean, readonly?: boolean, inputType?: string) => Record<string, boolean>;
|
|
57
|
+
getButtonClasses: () => Record<string, boolean>;
|
|
58
|
+
getRangeLabelClasses: (showRangeLabels: boolean) => Record<string, boolean>;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Date value processing utilities
|
|
62
|
+
* processDateSelection delegates to shared-utils.
|
|
63
|
+
* updateInputValues and processRangeBlur stay Lit-specific (use Lit Ref).
|
|
64
|
+
*/
|
|
65
|
+
export declare const dateProcessingUtils: {
|
|
66
|
+
processDateSelection: (detail: string | string[], multiple: boolean, range: boolean) => string;
|
|
67
|
+
updateInputValues(inputRef: Ref<HTMLInputElement>, inputRefTo: Ref<HTMLInputElement> | null, values: string[], range: boolean, multiple: boolean, manageValidity: (input: HTMLInputElement) => void): void;
|
|
68
|
+
processRangeBlur(event: Event, values: string[], calendarRef: Ref<PktCalendar>, clearInputValue: () => void, manageValidity: (input: HTMLInputElement) => void): void;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Keyboard navigation utilities
|
|
72
|
+
* Delegates to shared-utils/datepicker-utils
|
|
73
|
+
*/
|
|
74
|
+
export declare const keyboardUtils: {
|
|
75
|
+
handleInputKeydown: (event: KeyboardEvent, toggleCalendar: (e: Event) => void, submitForm?: () => void, focusNextInput?: () => void, blurInput?: () => void, commaHandler?: (e: KeyboardEvent) => void) => void;
|
|
76
|
+
handleButtonKeydown: (event: KeyboardEvent, toggleCalendar: (e: Event) => void) => void;
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { PktCalendar } from '../calendar/calendar';
|
|
3
|
+
import { PktInputElement } from '../../base-elements/input-element';
|
|
4
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
5
|
+
import { PktDatepickerPopup } from './datepicker-popup';
|
|
6
|
+
import { PktDatepickerSingle } from './datepicker-single';
|
|
7
|
+
import { PktDatepickerRange } from './datepicker-range';
|
|
8
|
+
import { PktDatepickerMultiple } from './datepicker-multiple';
|
|
9
|
+
import { ElementProps } from '../../types/typeUtils';
|
|
10
|
+
type Props = ElementProps<PktDatepicker, 'label' | 'dateformat' | 'multiple' | 'maxlength' | 'range' | 'showRangeLabels' | 'min' | 'max' | 'weeknumbers' | 'withcontrols' | 'excludedates' | 'excludeweekdays' | 'currentmonth' | 'calendarOpen' | 'timezone'>;
|
|
11
|
+
export declare class PktDatepicker extends PktInputElement<Props> {
|
|
12
|
+
/**
|
|
13
|
+
* Element attributes and properties
|
|
14
|
+
*/
|
|
15
|
+
private _valueProperty;
|
|
16
|
+
private _valueProcessing;
|
|
17
|
+
datepickerPopupRef: Ref<PktDatepickerPopup>;
|
|
18
|
+
get value(): string;
|
|
19
|
+
set value(newValue: string | string[]);
|
|
20
|
+
_value: string[];
|
|
21
|
+
label: string;
|
|
22
|
+
dateformat: string;
|
|
23
|
+
multiple: boolean;
|
|
24
|
+
maxlength: number | null;
|
|
25
|
+
range: boolean;
|
|
26
|
+
showRangeLabels: boolean;
|
|
27
|
+
min: string | null;
|
|
28
|
+
max: string | null;
|
|
29
|
+
weeknumbers: boolean;
|
|
30
|
+
withcontrols: boolean;
|
|
31
|
+
excludedates: string[];
|
|
32
|
+
excludeweekdays: string[];
|
|
33
|
+
currentmonth: string | null;
|
|
34
|
+
today: string | null;
|
|
35
|
+
calendarOpen: boolean;
|
|
36
|
+
timezone: string;
|
|
37
|
+
inputClasses: {};
|
|
38
|
+
/**
|
|
39
|
+
* Computed properties
|
|
40
|
+
*/
|
|
41
|
+
get inputType(): string;
|
|
42
|
+
/**
|
|
43
|
+
* Housekeeping / lifecycle methods
|
|
44
|
+
*/
|
|
45
|
+
connectedCallback(): void;
|
|
46
|
+
disconnectedCallback(): void;
|
|
47
|
+
onInput(): void;
|
|
48
|
+
valueChanged(newValue: string | null, oldValue: string | null): void;
|
|
49
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
50
|
+
updated(changedProperties: PropertyValues): void;
|
|
51
|
+
/**
|
|
52
|
+
* Element references
|
|
53
|
+
*/
|
|
54
|
+
get inputRef(): Ref<HTMLInputElement>;
|
|
55
|
+
get inputRefTo(): Ref<HTMLInputElement>;
|
|
56
|
+
calRef: Ref<PktCalendar>;
|
|
57
|
+
popupRef: Ref<HTMLDivElement>;
|
|
58
|
+
singleInputRef: Ref<PktDatepickerSingle>;
|
|
59
|
+
rangeInputRef: Ref<PktDatepickerRange>;
|
|
60
|
+
multipleInputRef: Ref<PktDatepickerMultiple>;
|
|
61
|
+
get currentInputElement(): HTMLInputElement | undefined;
|
|
62
|
+
get currentInputElementTo(): HTMLInputElement | undefined;
|
|
63
|
+
get currentButtonElement(): HTMLButtonElement | undefined;
|
|
64
|
+
get btnRef(): Ref<HTMLButtonElement>;
|
|
65
|
+
/**
|
|
66
|
+
* Rendering
|
|
67
|
+
*/
|
|
68
|
+
renderInput(): import('lit-html').TemplateResult<1>;
|
|
69
|
+
renderRangeInput(): import('lit-html').TemplateResult<1>;
|
|
70
|
+
renderMultipleInput(): import('lit-html').TemplateResult<1>;
|
|
71
|
+
renderCalendar(): import('lit-html').TemplateResult<1>;
|
|
72
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
73
|
+
/**
|
|
74
|
+
* Handlers
|
|
75
|
+
*/
|
|
76
|
+
handleCalendarPosition(): void;
|
|
77
|
+
addToSelected: (e: Event | KeyboardEvent) => void;
|
|
78
|
+
showCalendar(): Promise<void>;
|
|
79
|
+
hideCalendar(): void;
|
|
80
|
+
toggleCalendar(e: Event): Promise<void>;
|
|
81
|
+
clearInputValue(): void;
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PktDatepicker } from './datepicker';
|
|
2
|
+
import { PktDatepickerSingle } from './datepicker-single';
|
|
3
|
+
import { PktDatepickerRange } from './datepicker-range';
|
|
4
|
+
import { PktDatepickerMultiple } from './datepicker-multiple';
|
|
5
|
+
export { PktDatepicker, PktDatepickerSingle, PktDatepickerRange, PktDatepickerMultiple };
|
|
6
|
+
export default PktDatepicker;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import { User, Representing, UserMenuItem, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior, TSlotMenuVariant, IPktHeader, Booleanish } from './types';
|
|
4
|
+
export declare class PktHeaderService extends PktElementWithSlot<IPktHeader> implements IPktHeader {
|
|
5
|
+
serviceName?: string;
|
|
6
|
+
serviceLink?: string;
|
|
7
|
+
logoLink?: string;
|
|
8
|
+
searchPlaceholder: string;
|
|
9
|
+
searchValue: string;
|
|
10
|
+
mobileBreakpoint: number;
|
|
11
|
+
tabletBreakpoint: number;
|
|
12
|
+
openedMenu: THeaderMenu;
|
|
13
|
+
logOutButtonPlacement: TLogOutButtonPlacement;
|
|
14
|
+
position: THeaderPosition;
|
|
15
|
+
scrollBehavior: THeaderScrollBehavior;
|
|
16
|
+
slotMenuVariant: TSlotMenuVariant;
|
|
17
|
+
slotMenuText: string;
|
|
18
|
+
hideLogo: Booleanish;
|
|
19
|
+
compact: Booleanish;
|
|
20
|
+
showSearch: Booleanish;
|
|
21
|
+
canChangeRepresentation: Booleanish;
|
|
22
|
+
hasLogOut: Booleanish;
|
|
23
|
+
user?: User;
|
|
24
|
+
userMenu?: UserMenuItem[];
|
|
25
|
+
representing?: Representing;
|
|
26
|
+
private isMobile;
|
|
27
|
+
private isTablet;
|
|
28
|
+
private openMenu;
|
|
29
|
+
private isHidden;
|
|
30
|
+
private componentWidth;
|
|
31
|
+
private alignSlotRight;
|
|
32
|
+
private alignSearchRight;
|
|
33
|
+
private headerRef;
|
|
34
|
+
private userContainerRef;
|
|
35
|
+
private slotContainerRef;
|
|
36
|
+
private searchContainerRef;
|
|
37
|
+
private slotContentRef;
|
|
38
|
+
private searchMenuRef;
|
|
39
|
+
private resizeObserver?;
|
|
40
|
+
private lastScrollPosition;
|
|
41
|
+
private savedScrollY;
|
|
42
|
+
private lastFocusedElement;
|
|
43
|
+
private shouldRestoreFocus;
|
|
44
|
+
connectedCallback(): void;
|
|
45
|
+
disconnectedCallback(): void;
|
|
46
|
+
firstUpdated(): void;
|
|
47
|
+
updated(changedProperties: PropertyValues): void;
|
|
48
|
+
private setupResizeObserver;
|
|
49
|
+
private updateIsMobile;
|
|
50
|
+
private updateIsTablet;
|
|
51
|
+
private updateScrollLock;
|
|
52
|
+
private lockScroll;
|
|
53
|
+
private unlockScroll;
|
|
54
|
+
private setupScrollListener;
|
|
55
|
+
private handleScroll;
|
|
56
|
+
private handleClickOutside;
|
|
57
|
+
private handleFocusOut;
|
|
58
|
+
private handleEscapeKey;
|
|
59
|
+
private restoreFocus;
|
|
60
|
+
private checkDropdownAlignment;
|
|
61
|
+
private handleMenuToggle;
|
|
62
|
+
private handleLogoClick;
|
|
63
|
+
private handleServiceClick;
|
|
64
|
+
private handleLogout;
|
|
65
|
+
private handleSearch;
|
|
66
|
+
private handleSearchChange;
|
|
67
|
+
private handleSearchInputChange;
|
|
68
|
+
private handleSearchKeyDown;
|
|
69
|
+
private get formattedLastLoggedIn();
|
|
70
|
+
private get isFixed();
|
|
71
|
+
private get shouldHideOnScroll();
|
|
72
|
+
private get showLogoutInHeader();
|
|
73
|
+
private get showLogoutInUserMenu();
|
|
74
|
+
private renderLogo;
|
|
75
|
+
private renderServiceName;
|
|
76
|
+
private renderSlotContainer;
|
|
77
|
+
private renderSearch;
|
|
78
|
+
private renderUserButton;
|
|
79
|
+
private renderHeader;
|
|
80
|
+
render(): TemplateResult<1>;
|
|
81
|
+
}
|
|
82
|
+
declare global {
|
|
83
|
+
interface HTMLElementTagNameMap {
|
|
84
|
+
'pkt-header-service': PktHeaderService;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
export interface HeaderServiceTestConfig extends BaseTestConfig {
|
|
3
|
+
'service-name'?: string;
|
|
4
|
+
'service-link'?: string;
|
|
5
|
+
'logo-link'?: string;
|
|
6
|
+
compact?: boolean;
|
|
7
|
+
'hide-logo'?: boolean;
|
|
8
|
+
position?: 'fixed' | 'relative';
|
|
9
|
+
'scroll-behavior'?: 'hide' | 'none';
|
|
10
|
+
'show-search'?: boolean;
|
|
11
|
+
'search-placeholder'?: string;
|
|
12
|
+
'search-value'?: string;
|
|
13
|
+
'log-out-button-placement'?: 'userMenu' | 'header' | 'both' | 'none';
|
|
14
|
+
'can-change-representation'?: boolean;
|
|
15
|
+
'opened-menu'?: 'none' | 'slot' | 'search' | 'user';
|
|
16
|
+
'mobile-breakpoint'?: number;
|
|
17
|
+
'tablet-breakpoint'?: number;
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PktElement } from '../../base-elements/element';
|
|
2
|
+
import { User, Representing, UserMenuItem, Booleanish } from './types';
|
|
3
|
+
export interface IPktHeaderUserMenu {
|
|
4
|
+
user: User;
|
|
5
|
+
formattedLastLoggedIn?: string;
|
|
6
|
+
representing?: Representing;
|
|
7
|
+
userMenu?: UserMenuItem[];
|
|
8
|
+
canChangeRepresentation?: Booleanish;
|
|
9
|
+
logoutOnClick?: Booleanish;
|
|
10
|
+
}
|
|
11
|
+
export declare class PktHeaderUserMenu extends PktElement<IPktHeaderUserMenu> implements IPktHeaderUserMenu {
|
|
12
|
+
user: User;
|
|
13
|
+
formattedLastLoggedIn?: string;
|
|
14
|
+
representing?: Representing;
|
|
15
|
+
userMenu?: UserMenuItem[];
|
|
16
|
+
canChangeRepresentation: Booleanish;
|
|
17
|
+
logoutOnClick: Booleanish;
|
|
18
|
+
private handleChangeRepresentation;
|
|
19
|
+
private handleLogout;
|
|
20
|
+
private handleMenuItemClick;
|
|
21
|
+
private renderLinkOrButton;
|
|
22
|
+
private renderLinkSection;
|
|
23
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'pkt-header-user-menu': PktHeaderUserMenu;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a Date or ISO string to a readable Norwegian date format
|
|
3
|
+
* @param date - Date object or ISO date string
|
|
4
|
+
* @returns Formatted date string like "22. januar 2026, 14:30"
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatLastLoggedIn: (date: Date | string | undefined) => string | undefined;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
|
+
import { PropertyValues } from 'lit';
|
|
3
|
+
import { User, Representing, UserMenuItem, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior, TSlotMenuVariant, IPktHeader, Booleanish } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* PktHeader - Main header component for Oslo kommune services
|
|
6
|
+
*
|
|
7
|
+
* This component provides a complete header solution with:
|
|
8
|
+
* - Logo and service name
|
|
9
|
+
* - User menu with login/logout functionality
|
|
10
|
+
* - Search functionality
|
|
11
|
+
* - Responsive mobile menu
|
|
12
|
+
* - Fixed positioning with scroll-to-hide
|
|
13
|
+
*
|
|
14
|
+
* TODO: Add `type` prop to switch between `service` and `global` header types
|
|
15
|
+
*/
|
|
16
|
+
export declare class PktHeader extends PktElementWithSlot<IPktHeader> implements IPktHeader {
|
|
17
|
+
serviceName?: string;
|
|
18
|
+
serviceLink?: string;
|
|
19
|
+
logoLink?: string;
|
|
20
|
+
searchPlaceholder: string;
|
|
21
|
+
searchValue: string;
|
|
22
|
+
mobileBreakpoint: number;
|
|
23
|
+
tabletBreakpoint: number;
|
|
24
|
+
openedMenu: THeaderMenu;
|
|
25
|
+
logOutButtonPlacement: TLogOutButtonPlacement;
|
|
26
|
+
position: THeaderPosition;
|
|
27
|
+
scrollBehavior: THeaderScrollBehavior;
|
|
28
|
+
slotMenuVariant: TSlotMenuVariant;
|
|
29
|
+
slotMenuText: string;
|
|
30
|
+
hideLogo: Booleanish;
|
|
31
|
+
compact: Booleanish;
|
|
32
|
+
showSearch: Booleanish;
|
|
33
|
+
canChangeRepresentation: Booleanish;
|
|
34
|
+
hasLogOut: Booleanish;
|
|
35
|
+
user?: User;
|
|
36
|
+
userMenu?: UserMenuItem[];
|
|
37
|
+
representing?: Representing;
|
|
38
|
+
userMenuFooter?: UserMenuItem[];
|
|
39
|
+
userOptions?: UserMenuItem[];
|
|
40
|
+
firstUpdated(changedProperties: PropertyValues): void;
|
|
41
|
+
private emitDeprecationWarnings;
|
|
42
|
+
/**
|
|
43
|
+
* Convert deprecated props to new props
|
|
44
|
+
*/
|
|
45
|
+
private get effectiveUserMenu();
|
|
46
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
47
|
+
}
|
|
48
|
+
declare global {
|
|
49
|
+
interface HTMLElementTagNameMap {
|
|
50
|
+
'pkt-header': PktHeader;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PktHeader } from './header';
|
|
2
|
+
export { PktHeaderService } from './header-service';
|
|
3
|
+
export { PktHeaderUserMenu } from './header-user-menu';
|
|
4
|
+
export type { User, Representing, UserMenuItem, TInternalMenuItem, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior, TSlotMenuVariant, IPktHeader, } from './types';
|
|
5
|
+
export { formatLastLoggedIn } from './header-utils';
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon';
|
|
2
|
+
import { booleanishConverter, Booleanish, User as SharedUser, Representing as SharedRepresenting, UserMenuItem as SharedUserMenuItem, TInternalMenuItem as SharedTInternalMenuItem, TSlotMenuVariant, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior } from '../../shared-types';
|
|
3
|
+
export type { Booleanish, TSlotMenuVariant, THeaderMenu, TLogOutButtonPlacement, THeaderPosition, THeaderScrollBehavior, };
|
|
4
|
+
export { booleanishConverter };
|
|
5
|
+
export type User = SharedUser;
|
|
6
|
+
export type Representing = SharedRepresenting;
|
|
7
|
+
export type UserMenuItem = SharedUserMenuItem<PktIconName>;
|
|
8
|
+
export type TInternalMenuItem = SharedTInternalMenuItem<PktIconName>;
|
|
9
|
+
/**
|
|
10
|
+
* Helper to convert UserMenuItem (with target) to internal format
|
|
11
|
+
*/
|
|
12
|
+
export declare const convertUserMenuItem: (item: UserMenuItem) => TInternalMenuItem;
|
|
13
|
+
/**
|
|
14
|
+
* Interface for the Header component props
|
|
15
|
+
*/
|
|
16
|
+
export interface IPktHeader {
|
|
17
|
+
/** Hide the Oslo logo */
|
|
18
|
+
hideLogo?: Booleanish;
|
|
19
|
+
/** Logo link URL */
|
|
20
|
+
logoLink?: string;
|
|
21
|
+
/** Service name displayed in the header */
|
|
22
|
+
serviceName?: string;
|
|
23
|
+
/** Service link URL */
|
|
24
|
+
serviceLink?: string;
|
|
25
|
+
/** Use compact header height */
|
|
26
|
+
compact?: Booleanish;
|
|
27
|
+
/** Header position. 'fixed' fixes to top of viewport, 'relative' follows document flow. Default: 'fixed' */
|
|
28
|
+
position?: THeaderPosition;
|
|
29
|
+
/** Scroll behavior. 'hide' hides header on scroll down, 'none' keeps it visible. Default: 'hide' */
|
|
30
|
+
scrollBehavior?: THeaderScrollBehavior;
|
|
31
|
+
/** User object for logged-in user */
|
|
32
|
+
user?: User;
|
|
33
|
+
/** User menu items */
|
|
34
|
+
userMenu?: UserMenuItem[];
|
|
35
|
+
/** Representation object */
|
|
36
|
+
representing?: Representing;
|
|
37
|
+
/** Allow user to change representation */
|
|
38
|
+
canChangeRepresentation?: Booleanish;
|
|
39
|
+
/** Logout button placement */
|
|
40
|
+
logOutButtonPlacement?: TLogOutButtonPlacement;
|
|
41
|
+
/** Whether there's a logout handler attached (required for logout button to show) */
|
|
42
|
+
hasLogOut?: Booleanish;
|
|
43
|
+
/** Show search field */
|
|
44
|
+
showSearch?: Booleanish;
|
|
45
|
+
/** Search field placeholder */
|
|
46
|
+
searchPlaceholder?: string;
|
|
47
|
+
/** Controlled search value */
|
|
48
|
+
searchValue?: string;
|
|
49
|
+
/** Custom breakpoint for responsive behavior in pixels. Default: 1024 */
|
|
50
|
+
mobileBreakpoint?: number;
|
|
51
|
+
/** Custom breakpoint for tablet responsive behavior in pixels. Default: 1280 */
|
|
52
|
+
tabletBreakpoint?: number;
|
|
53
|
+
/** Which menu is initially open */
|
|
54
|
+
openedMenu?: THeaderMenu;
|
|
55
|
+
/** Variant for the slot menu button. Default: 'icon-only' */
|
|
56
|
+
slotMenuVariant?: TSlotMenuVariant;
|
|
57
|
+
/** Text for the slot menu button. Default: 'Meny' */
|
|
58
|
+
slotMenuText?: string;
|
|
59
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PktShadowElement } from '../../base-elements/element';
|
|
2
|
+
import { PropertyValues } from 'lit';
|
|
3
|
+
import { THeadingLevel, THeadingSize, THeadingWeight } from '../../shared-types';
|
|
4
|
+
export type TPktHeadingLevel = THeadingLevel;
|
|
5
|
+
export type TPktHeadingSize = THeadingSize;
|
|
6
|
+
export type TPktHeadingWeight = THeadingWeight;
|
|
7
|
+
export interface IPktHeading {
|
|
8
|
+
size?: TPktHeadingSize;
|
|
9
|
+
level?: TPktHeadingLevel;
|
|
10
|
+
weight?: TPktHeadingWeight;
|
|
11
|
+
visuallyHidden?: boolean;
|
|
12
|
+
align?: 'start' | 'center' | 'end';
|
|
13
|
+
}
|
|
14
|
+
export declare class PktHeading extends PktShadowElement<IPktHeading> implements IPktHeading {
|
|
15
|
+
size: TPktHeadingSize | undefined;
|
|
16
|
+
level: TPktHeadingLevel;
|
|
17
|
+
weight: TPktHeadingWeight | undefined;
|
|
18
|
+
visuallyHidden: boolean;
|
|
19
|
+
align: 'start' | 'center' | 'end' | undefined;
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
22
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
23
|
+
private setLevel;
|
|
24
|
+
private get defaultSizeForLevel();
|
|
25
|
+
private get defaultWeightForLevel();
|
|
26
|
+
private updateHostClasses;
|
|
27
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
28
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
|
+
export declare class PktHelptext extends PktElementWithSlot {
|
|
3
|
+
forId: string;
|
|
4
|
+
helptext: string;
|
|
5
|
+
helptextDropdown: string;
|
|
6
|
+
helptextDropdownButton: string;
|
|
7
|
+
isHelpTextOpen: boolean;
|
|
8
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
9
|
+
}
|
|
File without changes
|