@oslokommune/punkt-elements 16.9.0 → 16.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -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 +43 -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-CBEWrAi2.cjs +35 -0
- package/dist/{modal-C_wtsh9m.js → modal-pPp8nia6.js} +5 -5
- package/dist/modal.d.ts +1 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +1 -1
- package/dist/pkt-modal.cjs +1 -1
- package/dist/pkt-modal.js +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
- package/src/components/modal/modal.ts +7 -6
- package/dist/modal-DS_wUOIv.cjs +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [16.10.0](https://github.com/oslokommune/punkt/compare/16.9.1...16.10.0) (2026-04-22)
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
Ingen
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
* Legger til støtte for "fit-content" som størrelse på modal (#3433).
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
Ingen
|
|
19
|
+
|
|
20
|
+
### Chores
|
|
21
|
+
Ingen
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [16.9.1](https://github.com/oslokommune/punkt/compare/16.9.0...16.9.1) (2026-04-22)
|
|
27
|
+
|
|
28
|
+
### ⚠ BREAKING CHANGES
|
|
29
|
+
Ingen
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
Ingen
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
Ingen
|
|
36
|
+
|
|
37
|
+
### Chores
|
|
38
|
+
Ingen
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
|
|
8
43
|
## [16.9.0](https://github.com/oslokommune/punkt/compare/16.8.3...16.9.0) (2026-04-21)
|
|
9
44
|
|
|
10
45
|
### ⚠ BREAKING CHANGES
|
package/dist/accordion.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/alert.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/backlink.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PktElement } from './element';
|
|
2
|
+
/**
|
|
3
|
+
* Base class for Punkt light DOM elements that use the slotContent directive.
|
|
4
|
+
* Extends PktElement with slot content collection and distribution.
|
|
5
|
+
*
|
|
6
|
+
* Use this instead of PktElement when the component's template uses slotContent().
|
|
7
|
+
* @extends PktElement
|
|
8
|
+
*/
|
|
9
|
+
export declare class PktElementWithSlot<T = {}> extends PktElement<T> {
|
|
10
|
+
/**
|
|
11
|
+
* Pre-collect children before Lit's first render clears them.
|
|
12
|
+
* This ensures slotContent() has access to the original children.
|
|
13
|
+
*/
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a slot has content distributed to it via the slotContent directive.
|
|
17
|
+
*
|
|
18
|
+
* @param slotName - Name of the slot. Omit for the default slot.
|
|
19
|
+
*/
|
|
20
|
+
hasSlotContent(slotName?: string): boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { ElementProps } from '../types/typeUtils';
|
|
3
|
+
type Props = ElementProps<PktElement, 'strings' | 'role'>;
|
|
4
|
+
/**
|
|
5
|
+
* Base class for Punkt shadow DOM elements
|
|
6
|
+
* @extends LitElement
|
|
7
|
+
*/
|
|
8
|
+
export declare class PktShadowElement<T = {}> extends LitElement {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
strings: any;
|
|
11
|
+
role: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Here to support prop typing in Vue
|
|
14
|
+
*/
|
|
15
|
+
$props: T & Props;
|
|
16
|
+
/**
|
|
17
|
+
* Add support for Hot Module Reloading in dev mode
|
|
18
|
+
*/
|
|
19
|
+
hotReplacedCallback(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Base class for Punkt light DOM elements
|
|
23
|
+
* This class extends PktShadowElement but renders in light DOM instead of shadow DOM
|
|
24
|
+
* @extends PktShadowElement
|
|
25
|
+
*/
|
|
26
|
+
export declare class PktElement<T = {}> extends PktShadowElement<T> {
|
|
27
|
+
/**
|
|
28
|
+
* Make sure the component renders in light DOM instead of shadow DOM
|
|
29
|
+
*/
|
|
30
|
+
createRenderRoot(): this;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { Booleanish } from '../shared-types';
|
|
3
|
+
import { ElementProps } from '../types/typeUtils';
|
|
4
|
+
import { PktOptionsSlotController } from '../controllers/pkt-options-controller';
|
|
5
|
+
import { PktElementWithSlot } from './element-with-slot';
|
|
6
|
+
/**
|
|
7
|
+
* Base interface for input options used in select, combobox, etc.
|
|
8
|
+
*/
|
|
9
|
+
export interface PktInputOption {
|
|
10
|
+
value: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
selected?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type Props = ElementProps<PktInputElement, 'defaultValue' | 'disabled' | 'readonly' | 'required' | 'max' | 'maxlength' | 'min' | 'minlength' | 'ariaDescribedBy' | 'ariaLabelledby' | 'name' | 'pattern' | 'placeholder' | 'id' | 'counter' | 'hasError' | 'hasFieldset' | 'inline' | 'optionalTag' | 'requiredTag' | 'skipForwardTestid' | 'useWrapper' | 'fullwidth' | 'counterMaxLength' | 'errorMessage' | 'helptext' | 'helptextDropdown' | 'helptextDropdownButton' | 'label' | 'optionalText' | 'requiredText' | 'dataTestid'>;
|
|
17
|
+
/**
|
|
18
|
+
* Base class for all Punkt input elements
|
|
19
|
+
* @extends PktElementWithSlot
|
|
20
|
+
*/
|
|
21
|
+
export declare class PktInputElement<T = {}, TOption extends PktInputOption = PktInputOption> extends PktElementWithSlot<Props & T> {
|
|
22
|
+
static get formAssociated(): boolean;
|
|
23
|
+
internals: any;
|
|
24
|
+
form: HTMLFormElement | null;
|
|
25
|
+
checked?: boolean | string | null;
|
|
26
|
+
defaultChecked?: boolean;
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
range?: boolean;
|
|
29
|
+
type?: string;
|
|
30
|
+
optionsController?: PktOptionsSlotController;
|
|
31
|
+
_options?: TOption[];
|
|
32
|
+
defaultValue: string | string[] | null;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
readonly: boolean;
|
|
35
|
+
required: boolean;
|
|
36
|
+
max: string | number | null;
|
|
37
|
+
maxlength: number | null;
|
|
38
|
+
min: string | number | null;
|
|
39
|
+
minlength: number | null;
|
|
40
|
+
step: number | null;
|
|
41
|
+
ariaDescribedBy: string | null;
|
|
42
|
+
ariaLabelledby: string | null;
|
|
43
|
+
name: string;
|
|
44
|
+
pattern: string | null;
|
|
45
|
+
placeholder: string | null;
|
|
46
|
+
id: string;
|
|
47
|
+
counter: boolean;
|
|
48
|
+
hasError: boolean;
|
|
49
|
+
inline: boolean;
|
|
50
|
+
hasFieldset: boolean;
|
|
51
|
+
optionalTag: boolean;
|
|
52
|
+
requiredTag: boolean;
|
|
53
|
+
skipForwardTestid: boolean;
|
|
54
|
+
useWrapper: Booleanish;
|
|
55
|
+
fullwidth: boolean;
|
|
56
|
+
counterMaxLength: number;
|
|
57
|
+
errorMessage: string;
|
|
58
|
+
helptext: string;
|
|
59
|
+
helptextDropdown: string;
|
|
60
|
+
helptextDropdownButton: string | null;
|
|
61
|
+
label: string | null;
|
|
62
|
+
optionalText: string;
|
|
63
|
+
requiredText: string;
|
|
64
|
+
tagText: string | null;
|
|
65
|
+
dataTestid: string;
|
|
66
|
+
touched: boolean;
|
|
67
|
+
constructor();
|
|
68
|
+
/**
|
|
69
|
+
* Manages form validation state based on input validity
|
|
70
|
+
* Called automatically by onChange, but can be called manually if needed
|
|
71
|
+
*
|
|
72
|
+
* @param input - The input element to validate (optional)
|
|
73
|
+
* @protected
|
|
74
|
+
*/
|
|
75
|
+
protected manageValidity(input?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement): void;
|
|
76
|
+
/**
|
|
77
|
+
* Updates the form value for this input
|
|
78
|
+
* Handles both single values and arrays (for multi-select)
|
|
79
|
+
*
|
|
80
|
+
* @param value - The value(s) to set in the form
|
|
81
|
+
* @protected
|
|
82
|
+
*/
|
|
83
|
+
protected setFormValue(value: string | string[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* Coordinates radio button group by unchecking other radios with the same name
|
|
86
|
+
* Only affects radio inputs within the same form
|
|
87
|
+
*
|
|
88
|
+
* @protected
|
|
89
|
+
*/
|
|
90
|
+
protected coordinateRadioGroup(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Updates checked state and form value for checkbox and radio inputs
|
|
93
|
+
* Triggers this when you want to set the value of the radio or checkbox input to the form
|
|
94
|
+
* Do not use valueChanged or onChange for radios and checkboxes!
|
|
95
|
+
*
|
|
96
|
+
* @param value - The checked state (string 'true'/'false', or boolean)
|
|
97
|
+
* @protected
|
|
98
|
+
*/
|
|
99
|
+
protected valueChecked(value: string | boolean | null): void;
|
|
100
|
+
/**
|
|
101
|
+
* Called when value changes (text inputs, select, etc.)
|
|
102
|
+
* Subclasses can override to add custom value transformation logic
|
|
103
|
+
*
|
|
104
|
+
* @param value - The new value
|
|
105
|
+
* @param _old - The previous value
|
|
106
|
+
* @protected
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* protected valueChanged(value: string, old: string): void {
|
|
110
|
+
* const transformed = this.transformValue(value)
|
|
111
|
+
* super.valueChanged(transformed, old)
|
|
112
|
+
* }
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
protected valueChanged(value: string | string[] | null, _old: string | string[] | null): void;
|
|
116
|
+
/**
|
|
117
|
+
* Dispatches change and value-change events
|
|
118
|
+
*
|
|
119
|
+
* @param value - The value to include in the event detail
|
|
120
|
+
* @protected
|
|
121
|
+
*/
|
|
122
|
+
protected dispatchChangeEvents(value: unknown): void;
|
|
123
|
+
/**
|
|
124
|
+
* When input goes from content to no content
|
|
125
|
+
* @protected
|
|
126
|
+
*/
|
|
127
|
+
protected clearInputValue(): void;
|
|
128
|
+
/**
|
|
129
|
+
* When user enters the input, dispatch focus event
|
|
130
|
+
* @protected
|
|
131
|
+
*/
|
|
132
|
+
protected onFocus(): void;
|
|
133
|
+
/**
|
|
134
|
+
* When user leaves the input, dispatch blur event
|
|
135
|
+
* @protected
|
|
136
|
+
*/
|
|
137
|
+
protected onBlur(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Trigger this when user types in the input
|
|
140
|
+
* @protected
|
|
141
|
+
*/
|
|
142
|
+
protected onInput(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Normalizes value format based on multiple/range settings
|
|
145
|
+
*
|
|
146
|
+
* @param value - The value to normalize
|
|
147
|
+
* @returns Normalized value (array if multiple/range, string otherwise)
|
|
148
|
+
* @private
|
|
149
|
+
*/
|
|
150
|
+
private normalizeValue;
|
|
151
|
+
/**
|
|
152
|
+
* Validates the input element(s)
|
|
153
|
+
* @private
|
|
154
|
+
*/
|
|
155
|
+
private validate;
|
|
156
|
+
/**
|
|
157
|
+
* Trigger this when you want to set the value of the input out to the form
|
|
158
|
+
* Handles value normalization, form updates, validation, and event dispatching
|
|
159
|
+
*
|
|
160
|
+
* @param value - The value to set
|
|
161
|
+
* @protected
|
|
162
|
+
*/
|
|
163
|
+
protected onChange(value: string | string[]): void;
|
|
164
|
+
/**
|
|
165
|
+
* Called when the form is reset
|
|
166
|
+
* Resets the input to its default state
|
|
167
|
+
* @protected
|
|
168
|
+
*/
|
|
169
|
+
protected formResetCallback(): void;
|
|
170
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
171
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
172
|
+
}
|
|
173
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { PktInputElement, PktInputOption } from './input-element';
|
|
2
|
+
import { PktOptionsSlotController } from '../controllers/pkt-options-controller';
|
|
3
|
+
import { ElementProps } from '../types/typeUtils';
|
|
4
|
+
export type { PktInputOption } from './input-element';
|
|
5
|
+
type Props = ElementProps<PktOptionsInputElement, 'options'>;
|
|
6
|
+
/**
|
|
7
|
+
* Base class for input elements that have options (select, combobox, etc.)
|
|
8
|
+
* Provides common functionality for managing options from props or slots
|
|
9
|
+
* @extends PktInputElement
|
|
10
|
+
*/
|
|
11
|
+
export declare abstract class PktOptionsInputElement<T = {}, TOption extends PktInputOption = PktInputOption> extends PktInputElement<Props & T, TOption> {
|
|
12
|
+
/**
|
|
13
|
+
* Options passed as a prop
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
protected _optionsProp: TOption[];
|
|
17
|
+
/**
|
|
18
|
+
* Internal state for parsed options
|
|
19
|
+
* @protected
|
|
20
|
+
*/
|
|
21
|
+
_options: TOption[];
|
|
22
|
+
/**
|
|
23
|
+
* Controller for managing options from slots
|
|
24
|
+
*/
|
|
25
|
+
optionsController: PktOptionsSlotController;
|
|
26
|
+
/**
|
|
27
|
+
* Public getter for options that includes selected state
|
|
28
|
+
* Override this in subclasses to customize the selected state logic
|
|
29
|
+
*/
|
|
30
|
+
get options(): TOption[];
|
|
31
|
+
/**
|
|
32
|
+
* Public setter for options
|
|
33
|
+
*/
|
|
34
|
+
set options(value: TOption[]);
|
|
35
|
+
/**
|
|
36
|
+
* Determines if an option is selected
|
|
37
|
+
* Subclasses should override this to implement their selection logic
|
|
38
|
+
*
|
|
39
|
+
* @param option - The option to check
|
|
40
|
+
* @returns True if the option is selected
|
|
41
|
+
* @protected
|
|
42
|
+
*/
|
|
43
|
+
protected isOptionSelected(option: TOption): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Finds an option by its value
|
|
46
|
+
*
|
|
47
|
+
* @param value - The value to search for
|
|
48
|
+
* @returns The option if found, undefined otherwise
|
|
49
|
+
* @protected
|
|
50
|
+
*/
|
|
51
|
+
protected findOptionByValue(value: string): TOption | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Gets all currently selected options
|
|
54
|
+
*
|
|
55
|
+
* @returns Array of selected options
|
|
56
|
+
* @protected
|
|
57
|
+
*/
|
|
58
|
+
protected getSelectedOptions(): TOption[];
|
|
59
|
+
/**
|
|
60
|
+
* Parses options from either props or slot controller
|
|
61
|
+
* Call this in connectedCallback to initialize options
|
|
62
|
+
*
|
|
63
|
+
* @protected
|
|
64
|
+
*/
|
|
65
|
+
protected parseOptions(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Re-parse options when the component updates
|
|
68
|
+
* This ensures options stay in sync when they change dynamically
|
|
69
|
+
*
|
|
70
|
+
* @protected
|
|
71
|
+
*/
|
|
72
|
+
protected willUpdate(_changedProperties: Map<PropertyKey, unknown>): void;
|
|
73
|
+
}
|
package/dist/breadcrumbs.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/button.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/calendar.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/card.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
package/dist/combobox.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { TAccordionSkin } from '../../shared-types';
|
|
3
|
+
export type TPktAccordionSkin = TAccordionSkin;
|
|
4
|
+
export interface IPktAccordion {
|
|
5
|
+
compact?: boolean;
|
|
6
|
+
skin?: TPktAccordionSkin;
|
|
7
|
+
ariaLabelledBy?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class PktAccordion extends LitElement implements IPktAccordion {
|
|
11
|
+
ariaLabelledBy: string;
|
|
12
|
+
compact: boolean;
|
|
13
|
+
skin: TPktAccordionSkin;
|
|
14
|
+
name: string;
|
|
15
|
+
updated(changedProperties: Map<string, any>): void;
|
|
16
|
+
private updateAccordionItemNames;
|
|
17
|
+
firstUpdated(): void;
|
|
18
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
19
|
+
}
|
|
20
|
+
export default PktAccordion;
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
|
+
import { PropertyValues } from 'lit';
|
|
3
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
4
|
+
import { TPktAccordionSkin } from './accordion';
|
|
5
|
+
/**
|
|
6
|
+
* @param toggleProps
|
|
7
|
+
*
|
|
8
|
+
* @description Send in an "isOpen" boolean and "onToggleClick" function
|
|
9
|
+
* to override the automatic toggling
|
|
10
|
+
*/
|
|
11
|
+
export interface IPktAccordionItem {
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
skin?: TPktAccordionSkin;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
isOpen?: boolean;
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare class PktAccordionItem extends PktElementWithSlot implements IPktAccordionItem {
|
|
21
|
+
defaultOpen: boolean;
|
|
22
|
+
title: string;
|
|
23
|
+
skin: TPktAccordionSkin | undefined;
|
|
24
|
+
compact: boolean;
|
|
25
|
+
isOpen: boolean;
|
|
26
|
+
name: string | undefined;
|
|
27
|
+
accordionItemRef: Ref<HTMLDivElement>;
|
|
28
|
+
constructor();
|
|
29
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
30
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
31
|
+
}
|
|
32
|
+
export default PktAccordionItem;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as PktAccordion, IPktAccordion, TPktAccordionSkin } from './accordion';
|
|
2
|
+
import { default as PktAccordionItem, IPktAccordionItem } from './accordionitem';
|
|
3
|
+
export { PktAccordion, PktAccordionItem };
|
|
4
|
+
export type { IPktAccordion, IPktAccordionItem, TPktAccordionSkin };
|
|
5
|
+
export default PktAccordion;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PropertyValues } from 'lit';
|
|
2
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
3
|
+
import { TAriaLive, TAlertSkin } from '../../shared-types';
|
|
4
|
+
export type { TAlertSkin };
|
|
5
|
+
export interface IPktAlert {
|
|
6
|
+
skin?: TAlertSkin;
|
|
7
|
+
closeAlert?: boolean;
|
|
8
|
+
title?: string;
|
|
9
|
+
date?: string | null;
|
|
10
|
+
ariaLive?: TAriaLive | null;
|
|
11
|
+
compact?: boolean;
|
|
12
|
+
role?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class PktAlert extends PktElementWithSlot implements IPktAlert {
|
|
15
|
+
constructor();
|
|
16
|
+
compact: boolean;
|
|
17
|
+
title: string;
|
|
18
|
+
skin: TAlertSkin;
|
|
19
|
+
ariaLive: TAriaLive;
|
|
20
|
+
ariaLiveAttr: TAriaLive | null;
|
|
21
|
+
closeAlert: boolean;
|
|
22
|
+
date: string | null;
|
|
23
|
+
role: string;
|
|
24
|
+
_isClosed: boolean;
|
|
25
|
+
connectedCallback(): void;
|
|
26
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
27
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
28
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
29
|
+
private close;
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
export interface AlertTestConfig extends BaseTestConfig {
|
|
3
|
+
skin?: string;
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
date?: string;
|
|
7
|
+
closeAlert?: boolean;
|
|
8
|
+
ariaLive?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const createAlertTest: (config?: AlertTestConfig) => Promise<{
|
|
11
|
+
container: HTMLElement;
|
|
12
|
+
alert: import('./alert').PktAlert;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PktElement } from '../../base-elements/element';
|
|
2
|
+
export interface IPktBackLink {
|
|
3
|
+
href?: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class PktBackLink extends PktElement<IPktBackLink> implements IPktBackLink {
|
|
8
|
+
href: string;
|
|
9
|
+
text: string;
|
|
10
|
+
ariaLabel: string;
|
|
11
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
12
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
13
|
+
}
|
|
14
|
+
export default PktBackLink;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
export interface BacklinkTestConfig extends BaseTestConfig {
|
|
3
|
+
href?: string;
|
|
4
|
+
text?: string;
|
|
5
|
+
ariaLabel?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const createBacklinkTest: (config?: BacklinkTestConfig) => Promise<{
|
|
8
|
+
container: HTMLElement;
|
|
9
|
+
backlink: import('./backlink').PktBackLink;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { nothing } from 'lit';
|
|
2
|
+
import { PktElement } from '../../base-elements/element';
|
|
3
|
+
export interface IBreadcrumbItem {
|
|
4
|
+
text: string;
|
|
5
|
+
href: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IPktBreadcrumbs {
|
|
8
|
+
breadcrumbs: IBreadcrumbItem[];
|
|
9
|
+
}
|
|
10
|
+
export declare class PktBreadcrumbs extends PktElement implements IPktBreadcrumbs {
|
|
11
|
+
breadcrumbs: IBreadcrumbItem[];
|
|
12
|
+
private handleLinkClick;
|
|
13
|
+
render(): typeof nothing | import('lit-html').TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
export default PktBreadcrumbs;
|
|
File without changes
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { PktElementWithSlot } from '../../base-elements/element-with-slot';
|
|
2
|
+
import { PktIconName } from '@oslokommune/punkt-assets/dist/icons/icon';
|
|
3
|
+
import { Booleanish, THTMLButtonType } from '../../shared-types';
|
|
4
|
+
import { PropertyValues } from 'lit';
|
|
5
|
+
export type TPktButtonMode = 'light' | 'dark';
|
|
6
|
+
export type TPktButtonSize = 'small' | 'medium' | 'large';
|
|
7
|
+
export type TPktButtonColor = 'blue' | 'blue-outline' | 'green' | 'green-outline' | 'green-dark' | 'green-dark-outline' | 'beige-light' | 'beige-dark-outline' | 'yellow' | 'yellow-outline' | 'red' | 'red-outline';
|
|
8
|
+
export type TPktButtonSkin = 'primary' | 'secondary' | 'tertiary';
|
|
9
|
+
export type TPktButtonVariant = 'label-only' | 'icon-left' | 'icon-right' | 'icon-only' | 'icons-right-and-left';
|
|
10
|
+
export type TPktButtonState = 'normal' | 'focus' | 'hover' | 'active';
|
|
11
|
+
export type TPktButtonType = THTMLButtonType;
|
|
12
|
+
export interface IPktButton {
|
|
13
|
+
iconName?: PktIconName;
|
|
14
|
+
secondIconName?: PktIconName;
|
|
15
|
+
iconPath?: string;
|
|
16
|
+
secondIconPath?: string;
|
|
17
|
+
mode?: TPktButtonMode;
|
|
18
|
+
size?: TPktButtonSize;
|
|
19
|
+
fullWidth?: Booleanish;
|
|
20
|
+
fullWidthOnMobile?: Booleanish;
|
|
21
|
+
color?: TPktButtonColor;
|
|
22
|
+
skin?: TPktButtonSkin;
|
|
23
|
+
variant?: TPktButtonVariant;
|
|
24
|
+
state?: TPktButtonState;
|
|
25
|
+
type?: TPktButtonType;
|
|
26
|
+
isLoading?: Booleanish;
|
|
27
|
+
disabled?: Booleanish;
|
|
28
|
+
loadingAnimationPath?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class PktButton extends PktElementWithSlot<IPktButton> implements IPktButton {
|
|
31
|
+
iconName: string;
|
|
32
|
+
secondIconName: string;
|
|
33
|
+
iconPath: string | undefined;
|
|
34
|
+
secondIconPath: string | undefined;
|
|
35
|
+
mode?: TPktButtonMode;
|
|
36
|
+
size: TPktButtonSize;
|
|
37
|
+
fullWidth: Booleanish;
|
|
38
|
+
fullWidthOnMobile: Booleanish;
|
|
39
|
+
color?: TPktButtonColor;
|
|
40
|
+
skin: TPktButtonSkin;
|
|
41
|
+
variant: TPktButtonVariant;
|
|
42
|
+
state?: TPktButtonState;
|
|
43
|
+
type: TPktButtonType;
|
|
44
|
+
form: string | undefined;
|
|
45
|
+
isLoading: Booleanish;
|
|
46
|
+
disabled: Booleanish;
|
|
47
|
+
loadingAnimationPath: string | undefined;
|
|
48
|
+
connectedCallback(): void;
|
|
49
|
+
attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
|
|
50
|
+
protected firstUpdated(_changedProperties: PropertyValues): void;
|
|
51
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
52
|
+
}
|
|
53
|
+
export default PktButton;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
export interface ButtonTestConfig extends BaseTestConfig {
|
|
3
|
+
size?: string;
|
|
4
|
+
skin?: string;
|
|
5
|
+
variant?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
iconName?: string;
|
|
11
|
+
iconNameSecond?: string;
|
|
12
|
+
iconPath?: string;
|
|
13
|
+
secondIconPath?: string;
|
|
14
|
+
iconPosition?: string;
|
|
15
|
+
mode?: string;
|
|
16
|
+
form?: string;
|
|
17
|
+
content?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const createButtonTest: (config?: ButtonTestConfig) => Promise<{
|
|
20
|
+
container: HTMLElement;
|
|
21
|
+
button: import('./button').PktButton;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseTestConfig } from '../../tests/test-framework';
|
|
2
|
+
export interface CalendarTestConfig extends BaseTestConfig {
|
|
3
|
+
withcontrols?: boolean;
|
|
4
|
+
weeknumbers?: boolean;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
range?: boolean;
|
|
7
|
+
earliest?: string;
|
|
8
|
+
latest?: string;
|
|
9
|
+
currentmonth?: string;
|
|
10
|
+
excludedates?: string;
|
|
11
|
+
excludeweekdays?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const createCalendarTest: (config?: CalendarTestConfig) => Promise<{
|
|
14
|
+
container: HTMLElement;
|
|
15
|
+
calendar: import('./calendar').PktCalendar;
|
|
16
|
+
}>;
|
|
File without changes
|
|
File without changes
|