@progressive-development/pd-forms 0.9.2 → 1.0.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/LICENSE +21 -2
- package/README.md +56 -62
- package/dist/base/pd-base-input-element.d.ts +10 -10
- package/dist/base/pd-base-input-element.d.ts.map +1 -1
- package/dist/base/pd-base-input-element.js +8 -1
- package/dist/base/pd-base-ui-input.d.ts +41 -16
- package/dist/base/pd-base-ui-input.d.ts.map +1 -1
- package/dist/base/pd-base-ui-input.js +25 -6
- package/dist/base/pd-base-ui.js +0 -18
- package/dist/generated/locales/be.d.ts +3 -0
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +3 -0
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +3 -0
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/locales/be.js +4 -1
- package/dist/locales/de.js +4 -1
- package/dist/locales/en.js +4 -1
- package/dist/pd-button/PdButton.d.ts +171 -37
- package/dist/pd-button/PdButton.d.ts.map +1 -1
- package/dist/pd-button/PdButton.js +502 -71
- package/dist/pd-button/pd-button.stories.d.ts +82 -10
- package/dist/pd-button/pd-button.stories.d.ts.map +1 -1
- package/dist/pd-button-group/PdButtonGroup.d.ts +25 -0
- package/dist/pd-button-group/PdButtonGroup.d.ts.map +1 -1
- package/dist/pd-button-group/PdButtonGroup.js +52 -27
- package/dist/pd-button-group/pd-button-group.stories.d.ts +42 -17
- package/dist/pd-button-group/pd-button-group.stories.d.ts.map +1 -1
- package/dist/pd-button-select-group/PdButtonSelectGroup.d.ts +17 -3
- package/dist/pd-button-select-group/PdButtonSelectGroup.d.ts.map +1 -1
- package/dist/pd-button-select-group/PdButtonSelectGroup.js +23 -19
- package/dist/pd-button-select-group/pd-button-select-group.stories.d.ts +43 -18
- package/dist/pd-button-select-group/pd-button-select-group.stories.d.ts.map +1 -1
- package/dist/pd-checkbox/PdCheckbox.d.ts +23 -2
- package/dist/pd-checkbox/PdCheckbox.d.ts.map +1 -1
- package/dist/pd-checkbox/PdCheckbox.js +85 -21
- package/dist/pd-checkbox/pd-checkbox.stories.d.ts +43 -27
- package/dist/pd-checkbox/pd-checkbox.stories.d.ts.map +1 -1
- package/dist/pd-form-container/PdFormContainer.d.ts +30 -9
- package/dist/pd-form-container/PdFormContainer.d.ts.map +1 -1
- package/dist/pd-form-container/PdFormContainer.js +59 -8
- package/dist/pd-form-container/pd-form-container.stories.d.ts +49 -0
- package/dist/pd-form-container/pd-form-container.stories.d.ts.map +1 -0
- package/dist/pd-form-field/PdFormField.d.ts +35 -0
- package/dist/pd-form-field/PdFormField.d.ts.map +1 -0
- package/dist/pd-form-field/PdFormField.js +38 -0
- package/dist/pd-form-field/pd-form-field.d.ts +3 -0
- package/dist/pd-form-field/pd-form-field.d.ts.map +1 -0
- package/dist/pd-form-field/pd-form-field.stories.d.ts +40 -0
- package/dist/pd-form-field/pd-form-field.stories.d.ts.map +1 -0
- package/dist/pd-form-field.d.ts +2 -0
- package/dist/pd-form-field.js +8 -0
- package/dist/pd-form-fieldset/PdFormFieldset.d.ts +144 -0
- package/dist/pd-form-fieldset/PdFormFieldset.d.ts.map +1 -0
- package/dist/pd-form-fieldset/PdFormFieldset.js +364 -0
- package/dist/pd-form-fieldset/index.d.ts +2 -0
- package/dist/pd-form-fieldset/index.d.ts.map +1 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.d.ts +3 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.d.ts.map +1 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.js +8 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.stories.d.ts +38 -0
- package/dist/pd-form-fieldset/pd-form-fieldset.stories.d.ts.map +1 -0
- package/dist/pd-form-row/PdFormRow.d.ts +35 -5
- package/dist/pd-form-row/PdFormRow.d.ts.map +1 -1
- package/dist/pd-form-row/PdFormRow.js +135 -69
- package/dist/pd-form-row/pd-form-row.stories.d.ts +41 -25
- package/dist/pd-form-row/pd-form-row.stories.d.ts.map +1 -1
- package/dist/pd-generic-form/PdGenericForm.d.ts +50 -0
- package/dist/pd-generic-form/PdGenericForm.d.ts.map +1 -0
- package/dist/pd-generic-form/PdGenericForm.js +334 -0
- package/dist/pd-generic-form/pd-generic-form.d.ts +3 -0
- package/dist/pd-generic-form/pd-generic-form.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.stories.d.ts +35 -0
- package/dist/pd-generic-form/pd-generic-form.stories.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.styles.d.ts +2 -0
- package/dist/pd-generic-form/pd-generic-form.styles.d.ts.map +1 -0
- package/dist/pd-generic-form/pd-generic-form.styles.js +110 -0
- package/dist/pd-generic-form/pd-generic-form.test.d.ts +1 -0
- package/dist/pd-generic-form/pd-generic-form.test.d.ts.map +1 -0
- package/dist/pd-generic-form.d.ts +2 -0
- package/dist/pd-generic-form.js +8 -0
- package/dist/pd-hover-box/PdHoverBox.d.ts +61 -11
- package/dist/pd-hover-box/PdHoverBox.d.ts.map +1 -1
- package/dist/pd-hover-box/PdHoverBox.js +130 -28
- package/dist/pd-hover-box/pd-hover-box.stories.d.ts +28 -5
- package/dist/pd-hover-box/pd-hover-box.stories.d.ts.map +1 -1
- package/dist/pd-input/PdComboboxInput.d.ts +20 -0
- package/dist/pd-input/PdComboboxInput.d.ts.map +1 -0
- package/dist/pd-input/PdComboboxInput.js +67 -0
- package/dist/pd-input/PdInput.d.ts +33 -15
- package/dist/pd-input/PdInput.d.ts.map +1 -1
- package/dist/pd-input/PdInput.js +49 -21
- package/dist/pd-input/pd-input.stories.d.ts +71 -35
- package/dist/pd-input/pd-input.stories.d.ts.map +1 -1
- package/dist/pd-input-area/PdInputArea.d.ts +19 -6
- package/dist/pd-input-area/PdInputArea.d.ts.map +1 -1
- package/dist/pd-input-area/PdInputArea.js +17 -15
- package/dist/pd-input-area/pd-input-area.stories.d.ts +65 -52
- package/dist/pd-input-area/pd-input-area.stories.d.ts.map +1 -1
- package/dist/pd-input-file/PdInputFile.d.ts +24 -0
- package/dist/pd-input-file/PdInputFile.d.ts.map +1 -1
- package/dist/pd-input-file/PdInputFile.js +53 -22
- package/dist/pd-input-file/pd-input-file.stories.d.ts +51 -47
- package/dist/pd-input-file/pd-input-file.stories.d.ts.map +1 -1
- package/dist/pd-input-time/PdInputTime.d.ts +21 -0
- package/dist/pd-input-time/PdInputTime.d.ts.map +1 -1
- package/dist/pd-input-time/PdInputTime.js +48 -22
- package/dist/pd-input-time/pd-input-time.stories.d.ts +94 -0
- package/dist/pd-input-time/pd-input-time.stories.d.ts.map +1 -0
- package/dist/pd-panel-button/PdPanelButton.d.ts +50 -34
- package/dist/pd-panel-button/PdPanelButton.d.ts.map +1 -1
- package/dist/pd-panel-button/PdPanelButton.js +149 -262
- package/dist/pd-panel-button/pd-panel-button.stories.d.ts +55 -25
- package/dist/pd-panel-button/pd-panel-button.stories.d.ts.map +1 -1
- package/dist/pd-radio-group/PdRadioGroup.d.ts +14 -0
- package/dist/pd-radio-group/PdRadioGroup.d.ts.map +1 -1
- package/dist/pd-radio-group/PdRadioGroup.js +48 -11
- package/dist/pd-radio-group/pd-radio-group.stories.d.ts +37 -7
- package/dist/pd-radio-group/pd-radio-group.stories.d.ts.map +1 -1
- package/dist/pd-range/PdRange.d.ts +22 -2
- package/dist/pd-range/PdRange.d.ts.map +1 -1
- package/dist/pd-range/PdRange.js +54 -43
- package/dist/pd-range/pd-range.stories.d.ts +49 -7
- package/dist/pd-range/pd-range.stories.d.ts.map +1 -1
- package/dist/pd-select/PdSelect.d.ts +16 -4
- package/dist/pd-select/PdSelect.d.ts.map +1 -1
- package/dist/pd-select/PdSelect.js +23 -21
- package/dist/pd-select/pd-select.stories.d.ts +56 -35
- package/dist/pd-select/pd-select.stories.d.ts.map +1 -1
- package/dist/pd-suggestion-box/PdSuggestionBox.d.ts +74 -0
- package/dist/pd-suggestion-box/PdSuggestionBox.d.ts.map +1 -0
- package/dist/pd-suggestion-box/PdSuggestionBox.js +277 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.d.ts +42 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.d.ts.map +1 -0
- package/dist/pd-suggestion-box/PdSuggestionPanel.js +227 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.d.ts +3 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.d.ts.map +1 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.stories.d.ts +79 -0
- package/dist/pd-suggestion-box/pd-suggestion-box.stories.d.ts.map +1 -0
- package/dist/pd-suggestion-box.d.ts +2 -0
- package/dist/pd-suggestion-box.js +8 -0
- package/dist/pd-utils/dist/position-helper.js +35 -0
- package/dist/stories/pd-forms-overview.stories.d.ts +48 -0
- package/dist/stories/pd-forms-overview.stories.d.ts.map +1 -0
- package/dist/stories/story-helpers.d.ts +10 -0
- package/dist/stories/story-helpers.d.ts.map +1 -0
- package/dist/styles/shared-input-field-styles.d.ts.map +1 -1
- package/dist/styles/shared-input-field-styles.js +13 -19
- package/dist/styles/shared-input-styles.d.ts.map +1 -1
- package/dist/styles/shared-input-styles.js +18 -14
- package/dist/types.d.ts +11 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -4
- package/dist/pd-form-container/form-container.stories.d.ts +0 -28
- package/dist/pd-form-container/form-container.stories.d.ts.map +0 -1
- package/dist/pd-form-container/form-container2.stories.d.ts +0 -8
- package/dist/pd-form-container/form-container2.stories.d.ts.map +0 -1
- package/dist/pd-form-container/form-container3.stories.d.ts +0 -11
- package/dist/pd-form-container/form-container3.stories.d.ts.map +0 -1
- package/dist/stories/01_index.stories.d.ts +0 -58
- package/dist/stories/01_index.stories.d.ts.map +0 -1
|
@@ -1,18 +1,31 @@
|
|
|
1
1
|
import { CSSResultGroup } from 'lit';
|
|
2
2
|
import { PdBaseInputElement } from '../base/pd-base-input-element.js';
|
|
3
3
|
/**
|
|
4
|
+
* Multiline textarea input component.
|
|
5
|
+
*
|
|
4
6
|
* @tagname pd-input-area
|
|
7
|
+
* @summary Multiline textarea with validation and form integration.
|
|
8
|
+
*
|
|
9
|
+
* @event validate-form - Fired when input value changes for validation.
|
|
10
|
+
* @event field-change - Fired when input value changes.
|
|
11
|
+
*
|
|
12
|
+
* @cssprop --pd-input-field-width - Textarea width. Default: `240px`.
|
|
13
|
+
* @cssprop --pd-input-field-height - Textarea height. Default: `2.2rem`.
|
|
14
|
+
* @cssprop --pd-input-field-padding - Textarea padding. Default: `0.25rem`.
|
|
15
|
+
* @cssprop --pd-input-field-bg-col - Background color. Default: `var(--pd-default-bg-col)`.
|
|
16
|
+
* @cssprop --pd-input-field-border - Border style. Default: `1px solid var(--pd-default-light-col)`.
|
|
17
|
+
* @cssprop --pd-input-field-border-bottom - Bottom border. Default: `2px solid var(--pd-default-col)`.
|
|
18
|
+
* @cssprop --pd-input-field-border-focus - Focus border. Default: `2px solid var(--pd-default-col)`.
|
|
19
|
+
* @cssprop --pd-input-field-border-col-hover - Hover border color. Default: `var(--pd-default-hover-col)`.
|
|
5
20
|
*/
|
|
6
21
|
export declare class PdInputArea extends PdBaseInputElement {
|
|
22
|
+
/** Number of visible text rows. Default: 2. */
|
|
7
23
|
rows: number;
|
|
24
|
+
/** Number of visible text columns. */
|
|
8
25
|
cols?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Minimum length constraint
|
|
11
|
-
*/
|
|
26
|
+
/** Minimum character length constraint. */
|
|
12
27
|
minlength?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Maximum length constraint
|
|
15
|
-
*/
|
|
28
|
+
/** Maximum character length constraint. Default: 500. */
|
|
16
29
|
maxlength?: number;
|
|
17
30
|
static styles: CSSResultGroup;
|
|
18
31
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdInputArea.d.ts","sourceRoot":"","sources":["../../src/pd-input-area/PdInputArea.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"PdInputArea.d.ts","sourceRoot":"","sources":["../../src/pd-input-area/PdInputArea.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAKhD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAItE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,+CAA+C;IAE/C,IAAI,SAAK;IAET,sCAAsC;IAEtC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,2CAA2C;IAE3C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IAEzD,SAAS,CAAC,EAAE,MAAM,CAAO;IAEzB,OAAgB,MAAM,EAAE,cAAc,CAQpC;;IAOO,iBAAiB,IAAI,IAAI;IAKlC,OAAO,CAAC,gBAAgB;IAsBf,MAAM;CAkChB"}
|
|
@@ -52,6 +52,7 @@ class PdInputArea extends PdBaseInputElement {
|
|
|
52
52
|
}
|
|
53
53
|
render() {
|
|
54
54
|
const inputAreaId = `${this.id}InputArea`;
|
|
55
|
+
const errorId = `${this.id}Error`;
|
|
55
56
|
return html`
|
|
56
57
|
${this._renderLabel(inputAreaId)}
|
|
57
58
|
<div
|
|
@@ -62,24 +63,25 @@ class PdInputArea extends PdBaseInputElement {
|
|
|
62
63
|
)}"
|
|
63
64
|
>
|
|
64
65
|
<textarea
|
|
65
|
-
id
|
|
66
|
-
name
|
|
67
|
-
autocomplete=${this.autoCompleteName ?? "off"}
|
|
66
|
+
id="${inputAreaId}"
|
|
67
|
+
name="${this.name || this.valueName}"
|
|
68
68
|
class="input-style ${this.gradient ? "gradient" : ""}"
|
|
69
|
-
rows
|
|
70
|
-
cols
|
|
71
|
-
placeholder
|
|
72
|
-
minlength
|
|
73
|
-
maxlength
|
|
74
|
-
?disabled
|
|
75
|
-
?readonly
|
|
76
|
-
.value
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@
|
|
69
|
+
rows="${this.rows}"
|
|
70
|
+
cols="${this.cols ?? ""}"
|
|
71
|
+
placeholder="${this.placeHolder}"
|
|
72
|
+
minlength="${this.minlength ?? ""}"
|
|
73
|
+
maxlength="${this.maxlength ?? ""}"
|
|
74
|
+
?disabled="${this.disabled}"
|
|
75
|
+
?readonly="${this.readonly}"
|
|
76
|
+
.value="${this.value}"
|
|
77
|
+
aria-invalid="${this._invalid}"
|
|
78
|
+
aria-describedby="${this._errorMsg ? errorId : ""}"
|
|
79
|
+
@keyup="${this._onKeyUp}"
|
|
80
|
+
@blur="${this._onBlur}"
|
|
81
|
+
@focus="${this._onFocus}"
|
|
80
82
|
></textarea>
|
|
81
83
|
</div>
|
|
82
|
-
${this._renderErrorMsg()}
|
|
84
|
+
${this._renderErrorMsg(errorId)}
|
|
83
85
|
`;
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -1,54 +1,67 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdFieldType, PdAutocomplete } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Arguments interface for pd-input-area stories.
|
|
5
|
+
* Maps to the component's public API.
|
|
6
|
+
*/
|
|
7
|
+
interface PdInputAreaArgs {
|
|
8
|
+
/** Label text displayed above the textarea */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Initial value of the textarea */
|
|
11
|
+
initValue: string;
|
|
12
|
+
/** Placeholder text shown when textarea is empty */
|
|
13
|
+
placeHolder: string;
|
|
14
|
+
/** Whether the textarea is disabled */
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
/** Whether the textarea is read-only */
|
|
17
|
+
readonly: boolean;
|
|
18
|
+
/** Whether the textarea is required */
|
|
19
|
+
required: boolean;
|
|
20
|
+
/** Number of visible text rows */
|
|
21
|
+
rows: number;
|
|
22
|
+
/** Number of visible text columns */
|
|
23
|
+
cols?: number;
|
|
24
|
+
/** Minimum character length */
|
|
25
|
+
minlength?: number;
|
|
26
|
+
/** Maximum character length */
|
|
27
|
+
maxlength?: number;
|
|
28
|
+
/** Field validation type */
|
|
29
|
+
fieldType: PdFieldType;
|
|
30
|
+
/** Helper text shown in tooltip */
|
|
31
|
+
helperTxt: string;
|
|
32
|
+
/** Character shown for required fields */
|
|
33
|
+
defaultRequiredChar: string;
|
|
34
|
+
/** Autocomplete attribute value */
|
|
35
|
+
autoCompleteName: PdAutocomplete;
|
|
36
|
+
/** Apply gradient styling */
|
|
37
|
+
gradient: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* ## pd-input-area
|
|
41
|
+
*
|
|
42
|
+
* A multi-line text input component (textarea) for forms with
|
|
43
|
+
* validation and configurable dimensions.
|
|
44
|
+
*
|
|
45
|
+
* ### Features
|
|
46
|
+
* - **Multi-line Input**: Configurable rows and columns
|
|
47
|
+
* - **States**: Supports disabled, readonly, and required modes
|
|
48
|
+
* - **Validation**: Min/max length constraints with built-in validation
|
|
49
|
+
* - **Field Types**: text, number, mail, vat, phone validation
|
|
50
|
+
* - **Form Integration**: Works with pd-form-container for validation
|
|
51
|
+
*/
|
|
52
|
+
declare const meta: Meta<PdInputAreaArgs>;
|
|
51
53
|
export default meta;
|
|
52
|
-
type Story = StoryObj
|
|
53
|
-
|
|
54
|
+
type Story = StoryObj<PdInputAreaArgs>;
|
|
55
|
+
/** Default textarea with minimal configuration. Interactive via Controls panel. */
|
|
56
|
+
export declare const Default: Story;
|
|
57
|
+
/** All textarea states for visual comparison. */
|
|
58
|
+
export declare const AllStates: Story;
|
|
59
|
+
/** Textarea with min/max character length validation. */
|
|
60
|
+
export declare const WithLengthConstraints: Story;
|
|
61
|
+
/** Different sizing options using rows attribute and CSS custom properties. */
|
|
62
|
+
export declare const Sizing: Story;
|
|
63
|
+
/** Textarea within a form container showing proper form integration. */
|
|
64
|
+
export declare const InFormContainer: Story;
|
|
65
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
66
|
+
export declare const CustomStyling: Story;
|
|
54
67
|
//# sourceMappingURL=pd-input-area.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-input-area.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input-area/pd-input-area.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-input-area.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input-area/pd-input-area.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,oBAAoB,CAAC;AAC5B,OAAO,+BAA+B,CAAC;AACvC,OAAO,2CAA2C,CAAC;AAMnD;;;GAGG;AACH,UAAU,eAAe;IACvB,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,SAAS,EAAE,WAAW,CAAC;IACvB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mCAAmC;IACnC,gBAAgB,EAAE,cAAc,CAAC;IACjC,6BAA6B;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAMD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CAsG/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAMvC,mFAAmF;AACnF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAMF,iDAAiD;AACjD,eAAO,MAAM,SAAS,EAAE,KAqFvB,CAAC;AAMF,yDAAyD;AACzD,eAAO,MAAM,qBAAqB,EAAE,KAgBnC,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,MAAM,EAAE,KAiEpB,CAAC;AAMF,wEAAwE;AACxE,eAAO,MAAM,eAAe,EAAE,KA+B7B,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KAoG3B,CAAC"}
|
|
@@ -1,17 +1,41 @@
|
|
|
1
1
|
import { CSSResultGroup } from 'lit';
|
|
2
2
|
import { PdBaseInputElement } from '../base/pd-base-input-element.js';
|
|
3
3
|
/**
|
|
4
|
+
* File upload input component.
|
|
5
|
+
*
|
|
4
6
|
* @tagname pd-input-file
|
|
7
|
+
* @summary File upload input with type filtering and form integration.
|
|
8
|
+
*
|
|
9
|
+
* @event input-icon-click - Fired when the input icon is clicked.
|
|
10
|
+
* @event validate-form - Fired when file selection changes for validation.
|
|
11
|
+
* @event field-change - Fired when file selection changes.
|
|
12
|
+
*
|
|
13
|
+
* @cssprop --pd-input-field-width - Input width. Default: `300px`.
|
|
14
|
+
* @cssprop --pd-input-field-height - Input height. Default: `2.2rem`.
|
|
15
|
+
* @cssprop --pd-input-field-bg-col - Background color. Default: `var(--pd-default-bg-col)`.
|
|
16
|
+
* @cssprop --pd-input-field-border - Border style. Default: `1px solid var(--pd-default-light-col)`.
|
|
17
|
+
* @cssprop --pd-input-field-border-bottom - Bottom border. Default: `2px solid var(--pd-default-col)`.
|
|
18
|
+
* @cssprop --pd-input-icon-size - Icon size. Default: `calc(var(--pd-input-field-height) * 0.9)`.
|
|
19
|
+
* @cssprop --pd-input-icon-color - Icon color. Default: `var(--pd-default-col)`.
|
|
5
20
|
*/
|
|
6
21
|
export declare class PdInputFile extends PdBaseInputElement {
|
|
22
|
+
/** Optional icon to display inside input. */
|
|
7
23
|
icon?: string;
|
|
24
|
+
/** If true, icon is clickable and keyboard accessible. */
|
|
25
|
+
clickableIcon: boolean;
|
|
26
|
+
/** Accessible label for clickable icon (required when clickableIcon is true). */
|
|
27
|
+
iconLabel: string;
|
|
28
|
+
/** Accepted file types (e.g., ".pdf,.doc"). */
|
|
8
29
|
accept?: string;
|
|
30
|
+
/** Maximum filename length. */
|
|
9
31
|
maxlength?: number;
|
|
10
32
|
static styles: CSSResultGroup;
|
|
11
33
|
constructor();
|
|
12
34
|
render(): import('lit').TemplateResult<1>;
|
|
13
35
|
private _iconClicked;
|
|
36
|
+
private _onIconKeyDown;
|
|
14
37
|
private _onChange;
|
|
38
|
+
/** Returns the selected files from the file input element. */
|
|
15
39
|
get files(): FileList | null | undefined;
|
|
16
40
|
reset(): void;
|
|
17
41
|
clear(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdInputFile.d.ts","sourceRoot":"","sources":["../../src/pd-input-file/PdInputFile.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"PdInputFile.d.ts","sourceRoot":"","sources":["../../src/pd-input-file/PdInputFile.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAIzD,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,6CAA6C;IAE7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0DAA0D;IAE1D,aAAa,UAAS;IAEtB,iFAAiF;IAEjF,SAAS,SAAM;IAEf,+CAA+C;IAE/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,+BAA+B;IAE/B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,OAAgB,MAAM,EAAE,cAAc,CAWpC;;IAOO,MAAM;IA+Cf,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,SAAS;IAKjB,8DAA8D;IAC9D,IAAI,KAAK,IAAI,QAAQ,GAAG,IAAI,GAAG,SAAS,CAEvC;IAEM,KAAK;IAKL,KAAK,IAAI,IAAI;CAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { css, html } from 'lit';
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import '@progressive-development/pd-icon/pd-icon';
|
|
@@ -15,6 +15,12 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
return result;
|
|
16
16
|
};
|
|
17
17
|
class PdInputFile extends PdBaseInputElement {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.clickableIcon = false;
|
|
21
|
+
this.iconLabel = "";
|
|
22
|
+
this._inputType = INPUT_TYPE_FILE;
|
|
23
|
+
}
|
|
18
24
|
static {
|
|
19
25
|
this.styles = [
|
|
20
26
|
PdBaseInputElement.styles,
|
|
@@ -22,15 +28,16 @@ class PdInputFile extends PdBaseInputElement {
|
|
|
22
28
|
* {
|
|
23
29
|
box-sizing: border-box;
|
|
24
30
|
}
|
|
31
|
+
|
|
32
|
+
:host {
|
|
33
|
+
--pd-input-field-width: 330px;
|
|
34
|
+
}
|
|
25
35
|
`
|
|
26
36
|
];
|
|
27
37
|
}
|
|
28
|
-
constructor() {
|
|
29
|
-
super();
|
|
30
|
-
this._inputType = INPUT_TYPE_FILE;
|
|
31
|
-
}
|
|
32
38
|
render() {
|
|
33
39
|
const inputId = `${this.id}Input`;
|
|
40
|
+
const errorId = `${this.id}Error`;
|
|
34
41
|
return html`
|
|
35
42
|
${this._renderLabel(inputId)}
|
|
36
43
|
<div
|
|
@@ -40,35 +47,53 @@ class PdInputFile extends PdBaseInputElement {
|
|
|
40
47
|
})
|
|
41
48
|
)}"
|
|
42
49
|
>
|
|
43
|
-
${this.icon ? html
|
|
44
|
-
icon
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
${this.icon ? html`
|
|
51
|
+
<pd-icon
|
|
52
|
+
icon="${this.icon}"
|
|
53
|
+
?activeIcon="${this.clickableIcon}"
|
|
54
|
+
class="infield-icon"
|
|
55
|
+
tabindex="${this.clickableIcon ? 0 : -1}"
|
|
56
|
+
role="${this.clickableIcon ? "button" : "img"}"
|
|
57
|
+
aria-label="${this.clickableIcon ? this.iconLabel : ""}"
|
|
58
|
+
aria-hidden="${!this.clickableIcon}"
|
|
59
|
+
@click="${this.clickableIcon ? this._iconClicked : null}"
|
|
60
|
+
@keydown="${this.clickableIcon ? this._onIconKeyDown : null}"
|
|
61
|
+
></pd-icon>
|
|
62
|
+
` : nothing}
|
|
49
63
|
<input
|
|
50
|
-
id
|
|
51
|
-
name
|
|
64
|
+
id="${inputId}"
|
|
65
|
+
name="${this.name || this.valueName || this.autoCompleteName}"
|
|
52
66
|
class="input-style ${this.gradient ? "gradient" : ""}"
|
|
53
67
|
type="file"
|
|
54
|
-
maxlength
|
|
55
|
-
accept
|
|
56
|
-
?disabled
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@
|
|
60
|
-
@
|
|
68
|
+
maxlength="${this.maxlength ?? ""}"
|
|
69
|
+
accept="${this.accept ?? ""}"
|
|
70
|
+
?disabled="${this.disabled}"
|
|
71
|
+
aria-invalid="${this._invalid}"
|
|
72
|
+
aria-describedby="${this._errorMsg ? errorId : ""}"
|
|
73
|
+
@keyup="${this._onKeyUp}"
|
|
74
|
+
@blur="${this._onBlur}"
|
|
75
|
+
@focus="${this._onFocus}"
|
|
76
|
+
@change="${this._onChange}"
|
|
61
77
|
/>
|
|
62
78
|
</div>
|
|
63
|
-
${this._renderErrorMsg()}
|
|
79
|
+
${this._renderErrorMsg(errorId)}
|
|
64
80
|
`;
|
|
65
81
|
}
|
|
66
82
|
_iconClicked() {
|
|
67
|
-
this.dispatchEvent(
|
|
83
|
+
this.dispatchEvent(
|
|
84
|
+
new CustomEvent("input-icon-click", { bubbles: true, composed: true })
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
_onIconKeyDown(event) {
|
|
88
|
+
if (event.key === " " || event.key === "Enter") {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
this._iconClicked();
|
|
91
|
+
}
|
|
68
92
|
}
|
|
69
93
|
_onChange(e) {
|
|
70
94
|
this._handleChangedValue(this._input.value, e, true);
|
|
71
95
|
}
|
|
96
|
+
/** Returns the selected files from the file input element. */
|
|
72
97
|
get files() {
|
|
73
98
|
return this._input?.files;
|
|
74
99
|
}
|
|
@@ -83,6 +108,12 @@ class PdInputFile extends PdBaseInputElement {
|
|
|
83
108
|
__decorateClass([
|
|
84
109
|
property({ type: String })
|
|
85
110
|
], PdInputFile.prototype, "icon");
|
|
111
|
+
__decorateClass([
|
|
112
|
+
property({ type: Boolean })
|
|
113
|
+
], PdInputFile.prototype, "clickableIcon");
|
|
114
|
+
__decorateClass([
|
|
115
|
+
property({ type: String })
|
|
116
|
+
], PdInputFile.prototype, "iconLabel");
|
|
86
117
|
__decorateClass([
|
|
87
118
|
property({ type: String })
|
|
88
119
|
], PdInputFile.prototype, "accept");
|
|
@@ -1,49 +1,53 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
control: "text";
|
|
40
|
-
};
|
|
41
|
-
fontSize: {
|
|
42
|
-
control: "text";
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
/**
|
|
3
|
+
* Story arguments interface for pd-input-file component.
|
|
4
|
+
* Maps to the component's public API.
|
|
5
|
+
*/
|
|
6
|
+
interface PdInputFileArgs {
|
|
7
|
+
/** Label text displayed above the file input */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Whether the file input is disabled */
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
/** Whether the file input is required */
|
|
12
|
+
required: boolean;
|
|
13
|
+
/** File types to accept (MIME types or extensions) */
|
|
14
|
+
accept: string;
|
|
15
|
+
/** Optional icon to display */
|
|
16
|
+
icon: string;
|
|
17
|
+
/** Maximum filename length */
|
|
18
|
+
maxlength?: number;
|
|
19
|
+
/** Helper text shown in tooltip */
|
|
20
|
+
helperTxt: string;
|
|
21
|
+
/** Character shown for required fields */
|
|
22
|
+
defaultRequiredChar: string;
|
|
23
|
+
/** Apply gradient styling */
|
|
24
|
+
gradient: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ## pd-input-file
|
|
28
|
+
*
|
|
29
|
+
* A file upload input component with file type filtering
|
|
30
|
+
* and form integration.
|
|
31
|
+
*
|
|
32
|
+
* ### Features
|
|
33
|
+
* - **File Type Filtering**: Restrict uploads via accept attribute (MIME types or extensions)
|
|
34
|
+
* - **States**: Supports disabled and required modes
|
|
35
|
+
* - **Icons**: Optional icon with clickable mode
|
|
36
|
+
* - **Form Integration**: Works with pd-form-container for validation
|
|
37
|
+
*/
|
|
38
|
+
declare const meta: Meta<PdInputFileArgs>;
|
|
46
39
|
export default meta;
|
|
47
|
-
type Story = StoryObj
|
|
48
|
-
|
|
40
|
+
type Story = StoryObj<PdInputFileArgs>;
|
|
41
|
+
/** Default file input with minimal configuration. Interactive via Controls panel. */
|
|
42
|
+
export declare const Default: Story;
|
|
43
|
+
/** All file input states at a glance for visual comparison. */
|
|
44
|
+
export declare const AllVariants: Story;
|
|
45
|
+
/** File input with icon variations. */
|
|
46
|
+
export declare const WithIcon: Story;
|
|
47
|
+
/** Different file type configurations using the accept attribute. */
|
|
48
|
+
export declare const FileTypeFiltering: Story;
|
|
49
|
+
/** File inputs within a form container showing proper form integration. */
|
|
50
|
+
export declare const InFormContainer: Story;
|
|
51
|
+
/** CSS Custom Properties -- Branded and Redesigned variants. */
|
|
52
|
+
export declare const CustomStyling: Story;
|
|
49
53
|
//# sourceMappingURL=pd-input-file.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-input-file.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input-file/pd-input-file.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-input-file.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input-file/pd-input-file.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAKrE,OAAO,oBAAoB,CAAC;AAC5B,OAAO,+BAA+B,CAAC;AACvC,OAAO,2CAA2C,CAAC;AAMnD;;;GAGG;AACH,UAAU,eAAe;IACvB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,yCAAyC;IACzC,QAAQ,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,6BAA6B;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAMD;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CAkG/B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAMvC,qFAAqF;AACrF,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,WAAW,EAAE,KAsDzB,CAAC;AAMF,uCAAuC;AACvC,eAAO,MAAM,QAAQ,EAAE,KAmDtB,CAAC;AAMF,qEAAqE;AACrE,eAAO,MAAM,iBAAiB,EAAE,KAyC/B,CAAC;AAMF,2EAA2E;AAC3E,eAAO,MAAM,eAAe,EAAE,KAsC7B,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,KAgG3B,CAAC"}
|
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import { CSSResultGroup } from 'lit';
|
|
2
2
|
import { PdBaseInputElement } from '../base/pd-base-input-element.js';
|
|
3
3
|
/**
|
|
4
|
+
* Time input component for selecting hours and minutes.
|
|
5
|
+
*
|
|
4
6
|
* @tagname pd-input-time
|
|
7
|
+
* @summary Time picker input with native browser support.
|
|
8
|
+
*
|
|
9
|
+
* @event input-icon-click - Fired when the input icon is clicked.
|
|
10
|
+
* @event validate-form - Fired when time value changes for validation.
|
|
11
|
+
* @event field-change - Fired when time value changes.
|
|
12
|
+
*
|
|
13
|
+
* @cssprop --pd-input-field-width - Input width. Default: `250px`.
|
|
14
|
+
* @cssprop --pd-input-field-height - Input height. Default: `2.2rem`.
|
|
15
|
+
* @cssprop --pd-input-field-bg-col - Background color. Default: `var(--pd-default-bg-col)`.
|
|
16
|
+
* @cssprop --pd-input-field-border - Border style. Default: `1px solid var(--pd-default-light-col)`.
|
|
17
|
+
* @cssprop --pd-input-field-border-bottom - Bottom border. Default: `2px solid var(--pd-default-col)`.
|
|
18
|
+
* @cssprop --pd-input-icon-size - Icon size. Default: `calc(var(--pd-input-field-height) * 0.9)`.
|
|
19
|
+
* @cssprop --pd-input-icon-color - Icon color. Default: `var(--pd-default-col)`.
|
|
5
20
|
*/
|
|
6
21
|
export declare class PdInputTime extends PdBaseInputElement {
|
|
22
|
+
/** Optional icon to display inside input. */
|
|
7
23
|
icon?: string;
|
|
24
|
+
/** If true, icon is clickable and keyboard accessible. */
|
|
25
|
+
clickableIcon: boolean;
|
|
26
|
+
/** Accessible label for clickable icon (required when clickableIcon is true). */
|
|
27
|
+
iconLabel: string;
|
|
8
28
|
static get styles(): CSSResultGroup;
|
|
9
29
|
constructor();
|
|
10
30
|
render(): import('lit').TemplateResult<1>;
|
|
11
31
|
private _onChange;
|
|
12
32
|
private _iconClicked;
|
|
33
|
+
private _onIconKeyDown;
|
|
13
34
|
}
|
|
14
35
|
//# sourceMappingURL=PdInputTime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdInputTime.d.ts","sourceRoot":"","sources":["../../src/pd-input-time/PdInputTime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"PdInputTime.d.ts","sourceRoot":"","sources":["../../src/pd-input-time/PdInputTime.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAIzD,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAGtE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,6CAA6C;IAE7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0DAA0D;IAE1D,aAAa,UAAS;IAEtB,iFAAiF;IAEjF,SAAS,SAAM;IAEf,WAAoB,MAAM,IAAI,cAAc,CAS3C;;IAOQ,MAAM;IA+Cf,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;CAMvB"}
|