@oslokommune/punkt-elements 19.17.1 → 19.18.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 +5 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/textarea/index.d.ts +1 -0
- package/dist/components/textarea/textarea.d.ts +17 -1
- package/dist/pkt-index.cjs +1 -1
- package/dist/pkt-index.js +25 -25
- package/dist/pkt-textarea.cjs +1 -1
- package/dist/pkt-textarea.js +1 -1
- package/dist/shared-types/index.d.ts +2 -0
- package/dist/shared-types/textarea.d.ts +67 -0
- package/dist/{textarea-BiCZBjOe.cjs → textarea-CjtqjgpN.cjs} +4 -4
- package/dist/{textarea-BZCUHjEj.js → textarea-eRNStC90.js} +21 -9
- package/package.json +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/textarea/textarea.ts +34 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ og skriver commits ca etter [Conventional Commits](https://conventionalcommits.o
|
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
## [19.18.0](https://github.com/oslokommune/punkt/compare/19.17.1...19.18.0) (2026-10-20)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
8
13
|
## [19.17.1](https://github.com/oslokommune/punkt/compare/19.17.0...19.17.1) (2026-10-20)
|
|
9
14
|
|
|
10
15
|
### Bug Fixes
|
|
@@ -33,6 +33,7 @@ export { PktRadioButton as PktRadiobutton } from './radiobutton';
|
|
|
33
33
|
export { PktTag } from './tag';
|
|
34
34
|
export { PktTabs, PktTabItem } from './tabs';
|
|
35
35
|
export { PktTextarea } from './textarea';
|
|
36
|
+
export type { IPktTextarea } from './textarea';
|
|
36
37
|
export { PktTextinput } from './textinput';
|
|
37
38
|
export { PktSelect } from './select';
|
|
38
39
|
export { PktSearchInput } from './searchinput';
|
|
@@ -2,8 +2,24 @@ import { PropertyValues } from 'lit';
|
|
|
2
2
|
import { Ref } from 'lit/directives/ref.js';
|
|
3
3
|
import { PktInputElement } from '../../base-elements/input-element';
|
|
4
4
|
import { ElementProps } from '../../types/typeUtils';
|
|
5
|
+
import { Booleanish, IPktTextareaBase } from '../../shared-types';
|
|
5
6
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows' | 'cols'>;
|
|
6
|
-
export
|
|
7
|
+
export interface IPktTextarea extends Omit<IPktTextareaBase, 'form' | 'label' | 'placeholder' | 'rows' | 'cols' | 'minLength' | 'maxLength' | 'readOnly' | 'autoComplete' | 'ariaDescribedby' | 'ariaLabelledby' | 'helptextDropdownButton' | 'useWrapper'> {
|
|
8
|
+
label?: string | null;
|
|
9
|
+
placeholder?: string | null;
|
|
10
|
+
rows?: number | null;
|
|
11
|
+
cols?: number | null;
|
|
12
|
+
minlength?: number | null;
|
|
13
|
+
maxlength?: number | null;
|
|
14
|
+
readonly?: boolean;
|
|
15
|
+
autocomplete?: string;
|
|
16
|
+
ariaDescribedby?: string | null;
|
|
17
|
+
ariaLabelledby?: string | null;
|
|
18
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
19
|
+
helptextDropdownButton?: string | null;
|
|
20
|
+
useWrapper?: Booleanish;
|
|
21
|
+
}
|
|
22
|
+
export declare class PktTextarea extends PktInputElement<Props> implements IPktTextarea {
|
|
7
23
|
inputRef: Ref<HTMLTextAreaElement>;
|
|
8
24
|
value: string;
|
|
9
25
|
autocomplete: string;
|
package/dist/pkt-index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-C6WTyJFE.cjs"),t=require("./consent-BwH89xk_.cjs"),n=require("./alert-BRZDpVMt.cjs"),r=require("./header-CvER8wo6.cjs"),i=require("./card-COseC8ZL.cjs"),a=require("./checkbox-DkFswqr-.cjs"),o=require("./radiobutton-DgkML7sd.cjs"),s=require("./icon-jPhyZD1z.cjs"),c=require("./accordion-Cx-Gh3hc.cjs"),l=require("./input-wrapper-4PTk8aX3.cjs"),u=require("./messagebox-CiOQUt0C.cjs"),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./element-C6WTyJFE.cjs"),t=require("./consent-BwH89xk_.cjs"),n=require("./alert-BRZDpVMt.cjs"),r=require("./header-CvER8wo6.cjs"),i=require("./card-COseC8ZL.cjs"),a=require("./checkbox-DkFswqr-.cjs"),o=require("./radiobutton-DgkML7sd.cjs"),s=require("./icon-jPhyZD1z.cjs"),c=require("./accordion-Cx-Gh3hc.cjs"),l=require("./input-wrapper-4PTk8aX3.cjs"),u=require("./textarea-CjtqjgpN.cjs"),d=require("./messagebox-CiOQUt0C.cjs"),f=require("./calendar-CFTrX0C5.cjs"),p=require("./combobox-CaWnlvTX.cjs"),m=require("./button-Ca_V13cQ.cjs"),h=require("./backlink-CsFeerTH.cjs"),g=require("./breadcrumbs-D03id_ha.cjs"),_=require("./tag-6IPe9bwQ.cjs"),v=require("./helptext-p0nwJsyf.cjs"),y=require("./checkbox-group-lcxR3cYR.cjs"),b=require("./fileupload-Cb1c7ul0.cjs"),x=require("./modal-DGiq84MG.cjs"),S=require("./progressbar-CnX4fFfR.cjs"),C=require("./datepicker-Da8SfyVG.cjs"),w=require("./footer-Cl_Da5Iq.cjs"),T=require("./link-Dj6SbcaD.cjs"),E=require("./textinput-BZPGcxZV.cjs"),D=require("./searchinput-Mdc9Ihld.cjs"),O=require("./header-menu-D-wOwG1V.cjs"),k=require("./heading-D4Kkb6-N.cjs"),A=require("./linkcard-BoQIfci8.cjs"),j=require("./loader-BRYL5kTN.cjs"),M=require("./radio-group-XCYKqoLD.cjs"),N=require("./tabs-B63J6MXb.cjs"),P=require("./select-D8TC1msV.cjs"),F=require("./timepicker-C0d92R8u.cjs");exports.PktAccordion=c.r,exports.PktAccordionItem=c.n,exports.PktAlert=n.n,exports.PktBackLink=h.n,exports.PktBreadcrumbs=g.t,exports.PktButton=m.n,exports.PktCalendar=f.n,exports.PktCard=i.n,exports.PktCheckbox=a.n,exports.PktCheckboxGroup=y.n,exports.PktCombobox=p.n,exports.PktConsent=t.n,exports.PktDateTags=C.a,exports.PktDatepicker=C.t,Object.defineProperty(exports,"PktFileUpload",{enumerable:!0,get:function(){return b.n}}),exports.PktFooter=w.n,exports.PktFooterSimple=w.t,exports.PktHeader=r.t,exports.PktHeaderGlobal=r.n,exports.PktHeaderMenu=O.n,exports.PktHeaderService=r.r,exports.PktHeaderUserMenu=r.i,exports.PktHeading=k.n,exports.PktHelptext=v.n,exports.PktIcon=s.n,exports.PktInputWrapper=l.n,exports.PktLink=T.n,exports.PktLinkCard=A.n,exports.PktLoader=j.n,exports.PktMessagebox=d.n,exports.PktModal=x.n,exports.PktProgressbar=S.n,exports.PktRadioButton=o.n,exports.PktRadiobutton=o.n,exports.PktRadioGroup=M.n,exports.PktSearchInput=D.n,exports.PktSelect=P.n,exports.PktTabItem=N.n,exports.PktTabs=N.r,exports.PktTag=_.n,exports.PktTextarea=u.n,exports.PktTextinput=E.n,exports.PktTimepicker=F.t,exports.getPktStrings=e.r,exports.pktStringsNb=e.s,exports.resetPktStrings=e.i,exports.setPktStrings=e.a,exports.subscribePktStrings=e.o;
|
package/dist/pkt-index.js
CHANGED
|
@@ -8,30 +8,30 @@ import { n as p } from "./radiobutton-PYQKVnNQ.js";
|
|
|
8
8
|
import { n as m } from "./icon-CLMJYuTL.js";
|
|
9
9
|
import { n as h, r as g } from "./accordion-B0zAUNUV.js";
|
|
10
10
|
import { n as _ } from "./input-wrapper-BSjQc4Vx.js";
|
|
11
|
-
import { n as v } from "./
|
|
12
|
-
import { n as y } from "./
|
|
13
|
-
import { n as b } from "./
|
|
14
|
-
import { n as x } from "./
|
|
15
|
-
import { n as S } from "./
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { n as T } from "./
|
|
19
|
-
import { n as E } from "./
|
|
20
|
-
import { n as D } from "./
|
|
21
|
-
import { n as O } from "./
|
|
22
|
-
import { n as k } from "./
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { n as P } from "./
|
|
26
|
-
import { n as F } from "./
|
|
27
|
-
import { n as I } from "./
|
|
28
|
-
import { n as L } from "./
|
|
29
|
-
import { n as R } from "./
|
|
30
|
-
import { n as z } from "./
|
|
31
|
-
import { n as B } from "./
|
|
32
|
-
import { n as V } from "./
|
|
33
|
-
import { n as H
|
|
34
|
-
import { n as W } from "./
|
|
11
|
+
import { n as v } from "./textarea-eRNStC90.js";
|
|
12
|
+
import { n as y } from "./messagebox-Dr-k3pnZ.js";
|
|
13
|
+
import { n as b } from "./calendar-BQCjUQvP.js";
|
|
14
|
+
import { n as x } from "./combobox-iXYiaWbN.js";
|
|
15
|
+
import { n as S } from "./button-ChdHZYBF.js";
|
|
16
|
+
import { n as C } from "./backlink-D8Rv46lA.js";
|
|
17
|
+
import { t as w } from "./breadcrumbs-ybOBe_op.js";
|
|
18
|
+
import { n as T } from "./tag-BPvGZcKf.js";
|
|
19
|
+
import { n as E } from "./helptext-DN0jjgVu.js";
|
|
20
|
+
import { n as D } from "./checkbox-group-1ghi5uHp.js";
|
|
21
|
+
import { n as O } from "./fileupload-BNAQ9tNR.js";
|
|
22
|
+
import { n as k } from "./modal-DbzEnZNF.js";
|
|
23
|
+
import { n as A } from "./progressbar-t0zgEke0.js";
|
|
24
|
+
import { a as j, t as M } from "./datepicker-DTcow1ih.js";
|
|
25
|
+
import { n as N, t as P } from "./footer-BOwcLSsz.js";
|
|
26
|
+
import { n as F } from "./link-39EvU2ng.js";
|
|
27
|
+
import { n as I } from "./textinput-D_oEaI41.js";
|
|
28
|
+
import { n as L } from "./searchinput-BzYifHBf.js";
|
|
29
|
+
import { n as R } from "./header-menu-CsL4DZE2.js";
|
|
30
|
+
import { n as z } from "./heading-DhTyaJms.js";
|
|
31
|
+
import { n as B } from "./linkcard-K9vvKg1u.js";
|
|
32
|
+
import { n as V } from "./loader-MoI2VRFr.js";
|
|
33
|
+
import { n as H } from "./radio-group-DJikniZi.js";
|
|
34
|
+
import { n as U, r as W } from "./tabs-DDakCTkY.js";
|
|
35
35
|
import { n as G } from "./select-CorofYxz.js";
|
|
36
36
|
import { t as K } from "./timepicker-JBOeZg-7.js";
|
|
37
|
-
export { g as PktAccordion, h as PktAccordionItem, o as PktAlert,
|
|
37
|
+
export { g as PktAccordion, h as PktAccordionItem, o as PktAlert, C as PktBackLink, w as PktBreadcrumbs, S as PktButton, b as PktCalendar, d as PktCard, f as PktCheckbox, D as PktCheckboxGroup, x as PktCombobox, a as PktConsent, j as PktDateTags, M as PktDatepicker, O as PktFileUpload, N as PktFooter, P as PktFooterSimple, u as PktHeader, c as PktHeaderGlobal, R as PktHeaderMenu, l as PktHeaderService, s as PktHeaderUserMenu, z as PktHeading, E as PktHelptext, m as PktIcon, _ as PktInputWrapper, F as PktLink, B as PktLinkCard, V as PktLoader, y as PktMessagebox, k as PktModal, A as PktProgressbar, p as PktRadioButton, p as PktRadiobutton, H as PktRadioGroup, L as PktSearchInput, G as PktSelect, U as PktTabItem, W as PktTabs, T as PktTag, v as PktTextarea, I as PktTextinput, K as PktTimepicker, r as getPktStrings, i as pktStringsNb, t as resetPktStrings, e as setPktStrings, n as subscribePktStrings };
|
package/dist/pkt-textarea.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./textarea-CjtqjgpN.cjs");exports.PktTextarea=e.n,exports.default=e.t;
|
package/dist/pkt-textarea.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PktTextarea, t as default } from "./textarea-
|
|
1
|
+
export { n as PktTextarea, t as default } from "./textarea-eRNStC90.js";
|
|
@@ -39,6 +39,8 @@ export type { IRenderLink, TRenderLink } from './render-link';
|
|
|
39
39
|
export type { IPktStringsProps } from '../shared-strings';
|
|
40
40
|
export type { IHelptextProps, ITagOptionalRequiredProps, IFormFieldLabelProps, IFormFieldErrorProps, IFormFieldCommonProps, TFormFieldCommonSpecKeys, } from './form-field';
|
|
41
41
|
export { COUNTER_POSITIONS, INPUT_WRAPPER_DEFAULTS } from './input-wrapper';
|
|
42
|
+
export { TEXTAREA_DEFAULTS } from './textarea';
|
|
43
|
+
export type { IPktTextareaBase, ITextareaSpecProps } from './textarea';
|
|
42
44
|
export type { TPktCounterPosition, IPktInputWrapperBase, IInputWrapperSpecProps, } from './input-wrapper';
|
|
43
45
|
export type { TTagSkin } from './skin';
|
|
44
46
|
export { MESSAGEBOX_SKINS, MESSAGEBOX_DEFAULTS } from './messagebox';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* textarea.ts
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for pkt-textarea.
|
|
5
|
+
* Used by React, Elements, and typed component specs.
|
|
6
|
+
*/
|
|
7
|
+
import type { IFormFieldCommonProps } from './form-field';
|
|
8
|
+
import type { TPktInputSize } from './size';
|
|
9
|
+
/**
|
|
10
|
+
* Textarea props shared by React, Elements, and typed component specs.
|
|
11
|
+
*
|
|
12
|
+
* @remarks Keys follow the React prop names. Elements uses lowercase properties instead:
|
|
13
|
+
* `autocomplete`, `minlength`, `maxlength` and `readonly`.
|
|
14
|
+
*
|
|
15
|
+
* React requires `id` and `label`, and widens `helptext`, `helptextDropdown` and
|
|
16
|
+
* `errorMessage` to `ReactNode`. Elements widens `label`, `placeholder`, `rows`, `cols`,
|
|
17
|
+
* `ariaDescribedby`, `ariaLabelledby` and `helptextDropdownButton` to `| null` (Lit uses
|
|
18
|
+
* `null` for an unset attribute), `useWrapper` to `Booleanish`, and omits `form`, which is
|
|
19
|
+
* a getter returning the associated `HTMLFormElement`, not the form id.
|
|
20
|
+
*
|
|
21
|
+
* `counter` and `hasFieldset` are tri-state: `null` means the component derives the value.
|
|
22
|
+
*/
|
|
23
|
+
export interface IPktTextareaBase extends IFormFieldCommonProps<'forms' | 'validation'> {
|
|
24
|
+
id?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
form?: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
placeholder?: string;
|
|
29
|
+
rows?: number;
|
|
30
|
+
cols?: number;
|
|
31
|
+
minLength?: number;
|
|
32
|
+
maxLength?: number;
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
autoComplete?: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
ariaDescribedby?: string;
|
|
37
|
+
ariaLabelledby?: string;
|
|
38
|
+
inline?: boolean;
|
|
39
|
+
fullwidth?: boolean;
|
|
40
|
+
useWrapper?: boolean;
|
|
41
|
+
counter?: boolean | null;
|
|
42
|
+
counterMaxLength?: number;
|
|
43
|
+
inputSize?: TPktInputSize;
|
|
44
|
+
hasFieldset?: boolean | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Documented Textarea props (subset of `IPktTextareaBase`).
|
|
48
|
+
* Used for typed component specs in documentation.
|
|
49
|
+
*/
|
|
50
|
+
export type ITextareaSpecProps = Pick<IPktTextareaBase, 'label' | 'name' | 'form' | 'placeholder' | 'helptext' | 'helptextDropdown' | 'helptextDropdownButton' | 'rows' | 'cols' | 'minLength' | 'maxLength' | 'readOnly' | 'value' | 'autoComplete' | 'ariaLabelledby' | 'ariaDescribedby' | 'required' | 'requiredTag' | 'requiredText' | 'optionalTag' | 'optionalText' | 'tagText' | 'hasError' | 'errorMessage' | 'disabled' | 'inline' | 'fullwidth' | 'useWrapper' | 'id' | 'counter' | 'counterMaxLength' | 'inputSize' | 'hasFieldset'>;
|
|
51
|
+
/**
|
|
52
|
+
* Default values for pkt-textarea. Single source of truth for both frameworks.
|
|
53
|
+
* `counter` and `hasFieldset` are intentionally absent — `null` lets the component derive them.
|
|
54
|
+
*/
|
|
55
|
+
export declare const TEXTAREA_DEFAULTS: {
|
|
56
|
+
readonly autoComplete: 'off';
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly readOnly: false;
|
|
59
|
+
readonly requiredTag: false;
|
|
60
|
+
readonly optionalTag: false;
|
|
61
|
+
readonly hasError: false;
|
|
62
|
+
readonly disabled: false;
|
|
63
|
+
readonly inline: false;
|
|
64
|
+
readonly fullwidth: false;
|
|
65
|
+
readonly useWrapper: true;
|
|
66
|
+
readonly inputSize: 'medium';
|
|
67
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./input-wrapper-4PTk8aX3.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs"),s=require("./input-element-BOi7rBbw.cjs");var c=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),
|
|
1
|
+
const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),n=require("./directive-helpers-Bv70GjQh.cjs"),r=require("./element-with-slot-DkyaNnm0.cjs");require("./icon-jPhyZD1z.cjs");const i=require("./input-wrapper-4PTk8aX3.cjs"),a=require("./if-defined-CiML3MTM.cjs"),o=require("./ref-CB7e9nMY.cjs"),s=require("./input-element-BOi7rBbw.cjs");var c={autoComplete:`off`,required:!1,readOnly:!1,requiredTag:!1,optionalTag:!1,hasError:!1,disabled:!1,inline:!1,fullwidth:!1,useWrapper:!0,inputSize:`medium`},l=e.f(class extends e.p{constructor(t){if(super(t),t.type!==e.m.PROPERTY&&t.type!==e.m.ATTRIBUTE&&t.type!==e.m.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!n.i(t))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(t,[r]){if(r===e.g||r===e.h)return r;let i=t.element,a=t.name;if(t.type===e.m.PROPERTY){if(r===i[a])return e.g}else if(t.type===e.m.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(a))return e.g}else if(t.type===e.m.ATTRIBUTE&&i.getAttribute(a)===r+``)return e.g;return n.r(t),r}}),u=class extends s.t{constructor(...e){super(...e),this.inputRef=o.t(),this.value=``,this.autocomplete=c.autoComplete,this.rows=null,this.cols=null,this.counterCurrent=0}attributeChangedCallback(e,t,n){e===`value`&&this.value!==t&&(this.counterCurrent=n?n.length:0),super.attributeChangedCallback(e,t,n)}willUpdate(e){super.willUpdate(e),e.has(`value`)&&(this.counterCurrent=this.value?.length||0),e.has(`id`)&&!this.name&&this.id&&(this.name=this.id)}updated(e){super.updated(e),this.classList.add(`pkt-textinput`,`pkt-textarea`),e.has(`value`)&&this.valueChanged(this.value,e.get(`value`))}render(){let n=this.effectiveCounter(this.counterMaxLength>0),s=t.t({"pkt-input":!0,[`pkt-input--${this.inputSize}`]:!0,"pkt-input--fullwidth":this.fullwidth,"pkt-input--counter-error":n&&this.counterMaxLength>0&&this.value.length>this.counterMaxLength}),c=this.ariaLabelledby||`${this.id}-input-label`;return e._`<pkt-input-wrapper
|
|
2
2
|
${r.n(this,[`helptext`])}
|
|
3
3
|
.strings=${this.strings}
|
|
4
4
|
label=${this.label}
|
|
@@ -30,12 +30,12 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
30
30
|
id=${this.id+`-input`}
|
|
31
31
|
name=${(this.name||this.id)+`-input`}
|
|
32
32
|
placeholder=${a.t(this.placeholder)}
|
|
33
|
-
.value=${
|
|
33
|
+
.value=${l(this.value)}
|
|
34
34
|
minlength=${a.t(this.minlength)}
|
|
35
35
|
maxlength=${a.t(this.maxlength)}
|
|
36
36
|
?readonly=${this.readonly}
|
|
37
37
|
autocomplete=${this.autocomplete}
|
|
38
|
-
aria-labelledby=${
|
|
38
|
+
aria-labelledby=${c}
|
|
39
39
|
aria-invalid=${this.hasError}
|
|
40
40
|
aria-errormessage=${a.t(this.hasError?`${this.id}-input-error`:void 0)}
|
|
41
41
|
aria-describedby=${a.t(i.r({id:this.id+`-input`,hasHelptext:!!this.helptext||this.hasSlotContent(`helptext`),hasCounter:n,ariaDescribedby:this.ariaDescribedby}))}
|
|
@@ -47,4 +47,4 @@ const e=require("./element-C6WTyJFE.cjs"),t=require("./class-map-Bh6toDeV.cjs"),
|
|
|
47
47
|
@focus=${e=>{this.onFocus(),e.stopImmediatePropagation()}}
|
|
48
48
|
@blur=${e=>{this.value=e.target.value,this.onBlur(),e.stopImmediatePropagation()}}
|
|
49
49
|
></textarea>
|
|
50
|
-
</pkt-input-wrapper>`}};e.n([e.u({type:String,reflect:!0})],
|
|
50
|
+
</pkt-input-wrapper>`}};e.n([e.u({type:String,reflect:!0})],u.prototype,`value`,void 0),e.n([e.u({type:String})],u.prototype,`autocomplete`,void 0),e.n([e.u({type:Number})],u.prototype,`rows`,void 0),e.n([e.u({type:Number})],u.prototype,`cols`,void 0),e.n([e.l()],u.prototype,`counterCurrent`,void 0);try{e.d(`pkt-textarea`)(u)}catch{console.warn(`Forsøker å definere <pkt-textarea>, men den er allerede definert`)}var d=u;Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -7,8 +7,20 @@ import { r as m } from "./input-wrapper-BSjQc4Vx.js";
|
|
|
7
7
|
import { t as h } from "./if-defined-D18nY_K_.js";
|
|
8
8
|
import { n as g, t as _ } from "./ref-D4OwQYdf.js";
|
|
9
9
|
import { t as v } from "./input-element-0yYtRu0p.js";
|
|
10
|
-
//#region ../../
|
|
11
|
-
var y =
|
|
10
|
+
//#region ../../shared-types/textarea.ts
|
|
11
|
+
var y = {
|
|
12
|
+
autoComplete: "off",
|
|
13
|
+
required: !1,
|
|
14
|
+
readOnly: !1,
|
|
15
|
+
requiredTag: !1,
|
|
16
|
+
optionalTag: !1,
|
|
17
|
+
hasError: !1,
|
|
18
|
+
disabled: !1,
|
|
19
|
+
inline: !1,
|
|
20
|
+
fullwidth: !1,
|
|
21
|
+
useWrapper: !0,
|
|
22
|
+
inputSize: "medium"
|
|
23
|
+
}, b = n(class extends c {
|
|
12
24
|
constructor(e) {
|
|
13
25
|
if (super(e), e.type !== o.PROPERTY && e.type !== o.ATTRIBUTE && e.type !== o.BOOLEAN_ATTRIBUTE) throw Error("The `live` directive is not allowed on child or event bindings");
|
|
14
26
|
if (!d(e)) throw Error("`live` bindings can only contain a single expression");
|
|
@@ -26,9 +38,9 @@ var y = n(class extends c {
|
|
|
26
38
|
} else if (e.type === o.ATTRIBUTE && n.getAttribute(a) === t + "") return r;
|
|
27
39
|
return f(e), t;
|
|
28
40
|
}
|
|
29
|
-
}),
|
|
41
|
+
}), x = class extends v {
|
|
30
42
|
constructor(...e) {
|
|
31
|
-
super(...e), this.inputRef = _(), this.value = "", this.autocomplete =
|
|
43
|
+
super(...e), this.inputRef = _(), this.value = "", this.autocomplete = y.autoComplete, this.rows = null, this.cols = null, this.counterCurrent = 0;
|
|
32
44
|
}
|
|
33
45
|
attributeChangedCallback(e, t, n) {
|
|
34
46
|
e === "value" && this.value !== t && (this.counterCurrent = n ? n.length : 0), super.attributeChangedCallback(e, t, n);
|
|
@@ -78,7 +90,7 @@ var y = n(class extends c {
|
|
|
78
90
|
id=${this.id + "-input"}
|
|
79
91
|
name=${(this.name || this.id) + "-input"}
|
|
80
92
|
placeholder=${h(this.placeholder)}
|
|
81
|
-
.value=${
|
|
93
|
+
.value=${b(this.value)}
|
|
82
94
|
minlength=${h(this.minlength)}
|
|
83
95
|
maxlength=${h(this.maxlength)}
|
|
84
96
|
?readonly=${this.readonly}
|
|
@@ -114,14 +126,14 @@ var y = n(class extends c {
|
|
|
114
126
|
s([l({
|
|
115
127
|
type: String,
|
|
116
128
|
reflect: !0
|
|
117
|
-
})],
|
|
129
|
+
})], x.prototype, "value", void 0), s([l({ type: String })], x.prototype, "autocomplete", void 0), s([l({ type: Number })], x.prototype, "rows", void 0), s([l({ type: Number })], x.prototype, "cols", void 0), s([a()], x.prototype, "counterCurrent", void 0);
|
|
118
130
|
try {
|
|
119
|
-
t("pkt-textarea")(
|
|
131
|
+
t("pkt-textarea")(x);
|
|
120
132
|
} catch {
|
|
121
133
|
console.warn("Forsøker å definere <pkt-textarea>, men den er allerede definert");
|
|
122
134
|
}
|
|
123
135
|
//#endregion
|
|
124
136
|
//#region src/components/textarea/index.ts
|
|
125
|
-
var
|
|
137
|
+
var S = x;
|
|
126
138
|
//#endregion
|
|
127
|
-
export {
|
|
139
|
+
export { x as n, S as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oslokommune/punkt-elements",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.18.0",
|
|
4
4
|
"description": "Komponentbiblioteket til Punkt, designsystem for Oslo kommune",
|
|
5
5
|
"homepage": "https://punkt.oslo.kommune.no",
|
|
6
6
|
"author": "Team Designsystem, Oslo kommune",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"engines": {
|
|
85
85
|
"node": "^22.19.0 || ^24.0.0 || ^26.0.0"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "6b3cae25111200ae8f8f3673e13c8b6379337ecf"
|
|
88
88
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -40,6 +40,7 @@ export { PktRadioButton as PktRadiobutton } from '@/components/radiobutton'
|
|
|
40
40
|
export { PktTag } from '@/components/tag'
|
|
41
41
|
export { PktTabs, PktTabItem } from '@/components/tabs'
|
|
42
42
|
export { PktTextarea } from '@/components/textarea'
|
|
43
|
+
export type { IPktTextarea } from '@/components/textarea'
|
|
43
44
|
export { PktTextinput } from '@/components/textinput'
|
|
44
45
|
export { PktSelect } from '@/components/select'
|
|
45
46
|
export { PktSearchInput } from '@/components/searchinput'
|
|
@@ -11,14 +11,46 @@ import '@/components/input-wrapper'
|
|
|
11
11
|
import '@/components/icon'
|
|
12
12
|
import { ElementProps } from '@/types/typeUtils'
|
|
13
13
|
import { describedByIds } from 'shared-utils/forms/described-by'
|
|
14
|
+
import { TEXTAREA_DEFAULTS, type Booleanish, type IPktTextareaBase } from 'shared-types'
|
|
14
15
|
|
|
15
16
|
type Props = ElementProps<PktTextarea, 'autocomplete' | 'rows' | 'cols'>
|
|
16
17
|
|
|
17
|
-
export
|
|
18
|
+
export interface IPktTextarea extends Omit<
|
|
19
|
+
IPktTextareaBase,
|
|
20
|
+
| 'form'
|
|
21
|
+
| 'label'
|
|
22
|
+
| 'placeholder'
|
|
23
|
+
| 'rows'
|
|
24
|
+
| 'cols'
|
|
25
|
+
| 'minLength'
|
|
26
|
+
| 'maxLength'
|
|
27
|
+
| 'readOnly'
|
|
28
|
+
| 'autoComplete'
|
|
29
|
+
| 'ariaDescribedby'
|
|
30
|
+
| 'ariaLabelledby'
|
|
31
|
+
| 'helptextDropdownButton'
|
|
32
|
+
| 'useWrapper'
|
|
33
|
+
> {
|
|
34
|
+
label?: string | null
|
|
35
|
+
placeholder?: string | null
|
|
36
|
+
rows?: number | null
|
|
37
|
+
cols?: number | null
|
|
38
|
+
minlength?: number | null
|
|
39
|
+
maxlength?: number | null
|
|
40
|
+
readonly?: boolean
|
|
41
|
+
autocomplete?: string
|
|
42
|
+
ariaDescribedby?: string | null
|
|
43
|
+
ariaLabelledby?: string | null
|
|
44
|
+
/** @deprecated Bruk `strings={{ forms: { readMore: '…' } }}` eller `setPktStrings()`. */
|
|
45
|
+
helptextDropdownButton?: string | null
|
|
46
|
+
useWrapper?: Booleanish
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class PktTextarea extends PktInputElement<Props> implements IPktTextarea {
|
|
18
50
|
inputRef: Ref<HTMLTextAreaElement> = createRef()
|
|
19
51
|
|
|
20
52
|
@property({ type: String, reflect: true }) value: string = ''
|
|
21
|
-
@property({ type: String }) autocomplete: string =
|
|
53
|
+
@property({ type: String }) autocomplete: string = TEXTAREA_DEFAULTS.autoComplete
|
|
22
54
|
@property({ type: Number }) rows: number | null = null
|
|
23
55
|
@property({ type: Number }) cols: number | null = null
|
|
24
56
|
|