@progressive-development/pd-forms 0.9.1 → 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.d.ts.map +1 -1
- package/dist/base/pd-base-ui.js +1 -20
- 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 -265
- 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 +12 -5
- 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,5 +1,6 @@
|
|
|
1
|
-
import { css, html } from 'lit';
|
|
2
|
-
import { state } from 'lit/decorators.js';
|
|
1
|
+
import { css, nothing, html } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { calculateFloatingPosition } from '../pd-utils/dist/position-helper.js';
|
|
3
4
|
import { PdBaseUI } from '../base/pd-base-ui.js';
|
|
4
5
|
|
|
5
6
|
var __defProp = Object.defineProperty;
|
|
@@ -11,11 +12,22 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
11
12
|
if (result) __defProp(target, key, result);
|
|
12
13
|
return result;
|
|
13
14
|
};
|
|
15
|
+
let hoverBoxIdCounter = 0;
|
|
14
16
|
class PdHoverBox extends PdBaseUI {
|
|
15
17
|
constructor() {
|
|
16
18
|
super(...arguments);
|
|
19
|
+
this.triggerLabel = "Show info";
|
|
17
20
|
this._visible = false;
|
|
18
|
-
this.
|
|
21
|
+
this._posTop = 0;
|
|
22
|
+
this._posLeft = 0;
|
|
23
|
+
/** @ignore - Unique ID for aria-controls */
|
|
24
|
+
this._infoId = `pd-hover-box-${++hoverBoxIdCounter}`;
|
|
25
|
+
/** @ignore - Bound method for click-outside listener */
|
|
26
|
+
this._boundHandleClickOutside = this._handleClickOutside.bind(this);
|
|
27
|
+
/** @ignore - Bound method for keyboard listener */
|
|
28
|
+
this._boundHandleKeyDown = this._handleKeyDown.bind(this);
|
|
29
|
+
/** @ignore - Bound method for scroll listener */
|
|
30
|
+
this._boundHandleScroll = this._handleScroll.bind(this);
|
|
19
31
|
}
|
|
20
32
|
static {
|
|
21
33
|
this.styles = [
|
|
@@ -30,17 +42,17 @@ class PdHoverBox extends PdBaseUI {
|
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
.info-view {
|
|
33
|
-
position:
|
|
34
|
-
z-index:
|
|
45
|
+
position: fixed;
|
|
46
|
+
z-index: 9999;
|
|
35
47
|
background-color: var(
|
|
36
48
|
--pd-hover-box-bg-col,
|
|
37
49
|
var(--pd-default-dark-col)
|
|
38
50
|
);
|
|
39
51
|
border: 1px solid var(--pd-hover-box-border-col, var(--pd-default-col));
|
|
40
52
|
text-align: center;
|
|
41
|
-
padding:
|
|
42
|
-
width: 240px;
|
|
43
|
-
color: var(--pd-hover-box-font-col,
|
|
53
|
+
padding: var(--pd-spacing-sm);
|
|
54
|
+
width: var(--pd-hover-box-width, 240px);
|
|
55
|
+
color: var(--pd-hover-box-font-col, var(--pd-default-bg-col));
|
|
44
56
|
font-size: var(--pd-hover-box-font-size, 0.8em);
|
|
45
57
|
transition: opacity 0.2s ease-in;
|
|
46
58
|
}
|
|
@@ -55,14 +67,22 @@ class PdHoverBox extends PdBaseUI {
|
|
|
55
67
|
opacity: 0;
|
|
56
68
|
}
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
/* Trigger styles */
|
|
71
|
+
.trigger {
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-content: center;
|
|
75
|
+
cursor: pointer;
|
|
61
76
|
}
|
|
62
77
|
|
|
63
|
-
.
|
|
64
|
-
|
|
65
|
-
|
|
78
|
+
.trigger:focus {
|
|
79
|
+
outline: none;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.trigger:focus-visible {
|
|
83
|
+
outline: 2px solid var(--pd-focus-ring-col);
|
|
84
|
+
outline-offset: 2px;
|
|
85
|
+
border-radius: var(--pd-radius-sm, 2px);
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
@media (max-width: 640px) {
|
|
@@ -76,14 +96,25 @@ class PdHoverBox extends PdBaseUI {
|
|
|
76
96
|
render() {
|
|
77
97
|
return html`
|
|
78
98
|
<div class="hover-box">
|
|
79
|
-
<div
|
|
99
|
+
<div
|
|
100
|
+
class="trigger"
|
|
101
|
+
tabindex="0"
|
|
102
|
+
role="button"
|
|
103
|
+
@click="${this._toggleInfo}"
|
|
104
|
+
@keydown="${this._onTriggerKeyDown}"
|
|
105
|
+
aria-expanded="${this._visible}"
|
|
106
|
+
aria-controls="${this._infoId}"
|
|
107
|
+
aria-label="${this.triggerLabel || nothing}"
|
|
108
|
+
>
|
|
80
109
|
<slot name="normal-view"></slot>
|
|
81
110
|
</div>
|
|
82
111
|
|
|
83
112
|
<div
|
|
84
|
-
id="
|
|
85
|
-
|
|
86
|
-
|
|
113
|
+
id="${this._infoId}"
|
|
114
|
+
role="tooltip"
|
|
115
|
+
aria-hidden="${!this._visible}"
|
|
116
|
+
class="info-view ${this._visible ? "visible" : "hidden"}"
|
|
117
|
+
style="top: ${this._posTop}px; left: ${this._posLeft}px;"
|
|
87
118
|
>
|
|
88
119
|
<slot name="info-view"></slot>
|
|
89
120
|
</div>
|
|
@@ -91,29 +122,100 @@ class PdHoverBox extends PdBaseUI {
|
|
|
91
122
|
`;
|
|
92
123
|
}
|
|
93
124
|
/**
|
|
94
|
-
*
|
|
125
|
+
* Calculates fixed position based on trigger location and available space.
|
|
126
|
+
* Uses viewport-relative coordinates for position: fixed.
|
|
127
|
+
*/
|
|
128
|
+
_calculatePosition() {
|
|
129
|
+
const triggerEl = this.shadowRoot?.querySelector(".trigger");
|
|
130
|
+
if (!triggerEl) return;
|
|
131
|
+
const infoEl = this.shadowRoot?.getElementById(this._infoId);
|
|
132
|
+
const pos = calculateFloatingPosition({
|
|
133
|
+
anchor: triggerEl.getBoundingClientRect(),
|
|
134
|
+
floating: {
|
|
135
|
+
width: infoEl?.offsetWidth || 240,
|
|
136
|
+
height: infoEl?.offsetHeight || 100
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
this._posTop = pos.top;
|
|
140
|
+
this._posLeft = pos.left;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Opens the info box and registers close listeners.
|
|
144
|
+
* Uses fixed positioning to escape overflow containers.
|
|
95
145
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
if (!modal) return;
|
|
99
|
-
const rect = modal.getBoundingClientRect();
|
|
100
|
-
const fitsBelow = modal.offsetHeight + rect.top + rect.height <= window.innerHeight;
|
|
101
|
-
this._toBottom = fitsBelow;
|
|
146
|
+
_openInfo() {
|
|
147
|
+
this._calculatePosition();
|
|
102
148
|
this._visible = true;
|
|
103
|
-
|
|
149
|
+
document.addEventListener("click", this._boundHandleClickOutside);
|
|
150
|
+
document.addEventListener("keydown", this._boundHandleKeyDown);
|
|
151
|
+
window.addEventListener("scroll", this._boundHandleScroll, true);
|
|
104
152
|
}
|
|
105
153
|
/**
|
|
106
|
-
*
|
|
154
|
+
* Closes the info box and removes close listeners.
|
|
107
155
|
*/
|
|
108
156
|
_closeInfo() {
|
|
109
157
|
this._visible = false;
|
|
158
|
+
document.removeEventListener("click", this._boundHandleClickOutside);
|
|
159
|
+
document.removeEventListener("keydown", this._boundHandleKeyDown);
|
|
160
|
+
window.removeEventListener("scroll", this._boundHandleScroll, true);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Toggles the info box visibility.
|
|
164
|
+
*/
|
|
165
|
+
_toggleInfo(e) {
|
|
166
|
+
e.stopPropagation();
|
|
167
|
+
if (this._visible) {
|
|
168
|
+
this._closeInfo();
|
|
169
|
+
} else {
|
|
170
|
+
this._openInfo();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Handles keyboard events on the trigger.
|
|
175
|
+
*/
|
|
176
|
+
_onTriggerKeyDown(e) {
|
|
177
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
this._toggleInfo(e);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Handles Escape key to close.
|
|
184
|
+
*/
|
|
185
|
+
_handleKeyDown(e) {
|
|
186
|
+
if (e.key === "Escape") {
|
|
187
|
+
this._closeInfo();
|
|
188
|
+
const trigger = this.shadowRoot?.querySelector(".trigger");
|
|
189
|
+
trigger?.focus();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Handles clicks outside to close.
|
|
194
|
+
*/
|
|
195
|
+
_handleClickOutside(e) {
|
|
196
|
+
const path = e.composedPath();
|
|
197
|
+
if (!path.includes(this)) {
|
|
198
|
+
this._closeInfo();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Handles scroll to close (fixed position doesn't follow scroll).
|
|
203
|
+
*/
|
|
204
|
+
_handleScroll() {
|
|
205
|
+
this._closeInfo();
|
|
110
206
|
}
|
|
111
207
|
}
|
|
208
|
+
__decorateClass([
|
|
209
|
+
property({ type: String, attribute: "trigger-label" })
|
|
210
|
+
], PdHoverBox.prototype, "triggerLabel");
|
|
112
211
|
__decorateClass([
|
|
113
212
|
state()
|
|
114
213
|
], PdHoverBox.prototype, "_visible");
|
|
115
214
|
__decorateClass([
|
|
116
215
|
state()
|
|
117
|
-
], PdHoverBox.prototype, "
|
|
216
|
+
], PdHoverBox.prototype, "_posTop");
|
|
217
|
+
__decorateClass([
|
|
218
|
+
state()
|
|
219
|
+
], PdHoverBox.prototype, "_posLeft");
|
|
118
220
|
|
|
119
221
|
export { PdHoverBox };
|
|
@@ -1,8 +1,31 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/web-components';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
/**
|
|
3
|
+
* ## pd-hover-box
|
|
4
|
+
*
|
|
5
|
+
* A floating container component for displaying contextual information
|
|
6
|
+
* in a tooltip-like popup that appears on click.
|
|
7
|
+
*
|
|
8
|
+
* ### Features
|
|
9
|
+
* - Click-to-Show: Shows info box when trigger is clicked
|
|
10
|
+
* - Auto-Positioning: Automatically positions above or below based on viewport
|
|
11
|
+
* - Slot-Based Content: Uses named slots for trigger and info content
|
|
12
|
+
* - Click-to-Dismiss: Info box closes when clicked outside or Escape pressed
|
|
13
|
+
*/
|
|
14
|
+
declare const meta: Meta;
|
|
5
15
|
export default meta;
|
|
6
16
|
type Story = StoryObj;
|
|
7
|
-
|
|
17
|
+
/** Default hover box with question mark trigger. Click the "?" to show the info box. */
|
|
18
|
+
export declare const Default: Story;
|
|
19
|
+
/** Hover box with structured long-form content. */
|
|
20
|
+
export declare const WithLongContent: Story;
|
|
21
|
+
/** All trigger style variations in one view. */
|
|
22
|
+
export declare const TriggerStyles: Story;
|
|
23
|
+
/** Hover box next to a form field label -- common real-world pattern. */
|
|
24
|
+
export declare const WithFormField: Story;
|
|
25
|
+
/** Hover box in a table header for column info. */
|
|
26
|
+
export declare const InTableHeader: Story;
|
|
27
|
+
/** Demonstrates auto-positioning: above (default) and below (when no space above). */
|
|
28
|
+
export declare const AutoPositioning: Story;
|
|
29
|
+
/** CSS Custom Properties -- Branded and Redesigned variants. */
|
|
30
|
+
export declare const CustomStyling: Story;
|
|
8
31
|
//# sourceMappingURL=pd-hover-box.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-hover-box.stories.d.ts","sourceRoot":"","sources":["../../src/pd-hover-box/pd-hover-box.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-hover-box.stories.d.ts","sourceRoot":"","sources":["../../src/pd-hover-box/pd-hover-box.stories.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,mBAAmB,CAAC;AAM3B;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,IAAI,EAAE,IAuDX,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AAMtB,wFAAwF;AACxF,eAAO,MAAM,OAAO,EAAE,KA2BrB,CAAC;AAMF,mDAAmD;AACnD,eAAO,MAAM,eAAe,EAAE,KAmC7B,CAAC;AAMF,gDAAgD;AAChD,eAAO,MAAM,aAAa,EAAE,KA4D3B,CAAC;AAMF,yEAAyE;AACzE,eAAO,MAAM,aAAa,EAAE,KA2C3B,CAAC;AAMF,mDAAmD;AACnD,eAAO,MAAM,aAAa,EAAE,KAwF3B,CAAC;AAMF,sFAAsF;AACtF,eAAO,MAAM,eAAe,EAAE,KAgE7B,CAAC;AAMF,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,KAsF3B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit';
|
|
2
|
+
import { PdInput } from './PdInput.js';
|
|
3
|
+
/**
|
|
4
|
+
* Internal input component with combobox ARIA support.
|
|
5
|
+
* Extends PdInput to add role="combobox" and related ARIA attributes.
|
|
6
|
+
*
|
|
7
|
+
* @internal Not exported - for use by PdSuggestionBox only.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PdComboboxInput extends PdInput {
|
|
10
|
+
/** ID of the element controlled by this combobox. */
|
|
11
|
+
ariaControls?: string;
|
|
12
|
+
/** Type of autocomplete behavior ("list", "both", "inline", "none"). */
|
|
13
|
+
ariaAutocomplete?: string;
|
|
14
|
+
/** ID of the currently active descendant in the listbox. */
|
|
15
|
+
ariaActivedescendant?: string;
|
|
16
|
+
/** Whether the combobox popup is expanded. */
|
|
17
|
+
expanded: boolean;
|
|
18
|
+
protected _renderInputField(inputId: string, errorId: string): TemplateResult;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=PdComboboxInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PdComboboxInput.d.ts","sourceRoot":"","sources":["../../src/pd-input/PdComboboxInput.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIhD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;GAKG;AACH,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,qDAAqD;IAErD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,wEAAwE;IAExE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,4DAA4D;IAE5D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,8CAA8C;IAE9C,QAAQ,UAAS;cAEE,iBAAiB,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,cAAc;CAkClB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
4
|
+
import { PdInput } from './PdInput.js';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = void 0 ;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (decorator(target, key, result) ) || result;
|
|
12
|
+
if (result) __defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
class PdComboboxInput extends PdInput {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.expanded = false;
|
|
19
|
+
}
|
|
20
|
+
_renderInputField(inputId, errorId) {
|
|
21
|
+
return html`
|
|
22
|
+
<input
|
|
23
|
+
id="${inputId}"
|
|
24
|
+
name="${this.name || this.valueName || this.autoCompleteName}"
|
|
25
|
+
autocomplete="${this.autoCompleteName ?? "off"}"
|
|
26
|
+
class="input-style ${this.gradient ? "gradient" : ""}"
|
|
27
|
+
type="${this.secret ? "password" : "text"}"
|
|
28
|
+
placeholder="${this.placeHolder}"
|
|
29
|
+
.value="${this._value}"
|
|
30
|
+
minlength="${this.minlength ?? ""}"
|
|
31
|
+
maxlength="${this.maxlength ?? ""}"
|
|
32
|
+
?readonly="${this.readonly}"
|
|
33
|
+
?disabled="${this.disabled}"
|
|
34
|
+
role="combobox"
|
|
35
|
+
aria-expanded="${this.expanded ? "true" : "false"}"
|
|
36
|
+
aria-controls="${ifDefined(this.ariaControls)}"
|
|
37
|
+
aria-autocomplete="${ifDefined(
|
|
38
|
+
this.ariaAutocomplete
|
|
39
|
+
)}"
|
|
40
|
+
aria-activedescendant="${ifDefined(this.ariaActivedescendant)}"
|
|
41
|
+
aria-invalid="${this._invalid}"
|
|
42
|
+
aria-describedby="${this._errorMsg ? errorId : ""}"
|
|
43
|
+
@keyup="${this._onKeyUp}"
|
|
44
|
+
@blur="${this._onBlur}"
|
|
45
|
+
@focus="${this._onFocus}"
|
|
46
|
+
/>
|
|
47
|
+
`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
__decorateClass([
|
|
51
|
+
property({ type: String })
|
|
52
|
+
], PdComboboxInput.prototype, "ariaControls");
|
|
53
|
+
__decorateClass([
|
|
54
|
+
property({ type: String })
|
|
55
|
+
], PdComboboxInput.prototype, "ariaAutocomplete");
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ type: String })
|
|
58
|
+
], PdComboboxInput.prototype, "ariaActivedescendant");
|
|
59
|
+
__decorateClass([
|
|
60
|
+
property({ type: Boolean })
|
|
61
|
+
], PdComboboxInput.prototype, "expanded");
|
|
62
|
+
const tag = "pd-combobox-input";
|
|
63
|
+
if (!customElements.get(tag)) {
|
|
64
|
+
customElements.define(tag, PdComboboxInput);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { PdComboboxInput };
|
|
@@ -1,35 +1,53 @@
|
|
|
1
1
|
import { TemplateResult, CSSResultGroup } from 'lit';
|
|
2
2
|
import { PdBaseInputElement } from '../base/pd-base-input-element.js';
|
|
3
3
|
/**
|
|
4
|
+
* Text input component for forms.
|
|
5
|
+
*
|
|
4
6
|
* @tagname pd-input
|
|
7
|
+
* @summary Text input with validation, icons, and form integration.
|
|
8
|
+
*
|
|
9
|
+
* @event input-icon-click - Fired when the input icon is clicked.
|
|
10
|
+
* @event validate-form - Fired when input value changes for validation.
|
|
11
|
+
* @event field-change - Fired when input 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-padding - Input padding. Default: `0.25rem`.
|
|
16
|
+
* @cssprop --pd-input-field-bg-col - Background color. Default: `var(--pd-default-bg-col)`.
|
|
17
|
+
* @cssprop --pd-input-field-border - Border style. Default: `1px solid var(--pd-default-light-col)`.
|
|
18
|
+
* @cssprop --pd-input-field-border-bottom - Bottom border. Default: `2px solid var(--pd-default-col)`.
|
|
19
|
+
* @cssprop --pd-input-field-border-focus - Focus border. Default: `2px solid var(--pd-default-col)`.
|
|
20
|
+
* @cssprop --pd-input-field-border-col-hover - Hover border color. Default: `var(--pd-default-hover-col)`.
|
|
21
|
+
* @cssprop --pd-input-field-bg-col-disabled - Disabled background. Default: `#e9e9e9`.
|
|
22
|
+
* @cssprop --pd-input-field-border-bottom-disabled - Disabled bottom border. Default: `2px solid var(--pd-default-disabled-col)`.
|
|
23
|
+
* @cssprop --pd-input-placeholder-color - Placeholder text color. Default: `#474747e4`.
|
|
24
|
+
* @cssprop --pd-input-icon-size - Icon size when using icon attribute. Default: `calc(var(--pd-input-field-height) * 0.9)`.
|
|
25
|
+
* @cssprop --pd-input-icon-color - Icon color. Default: `var(--pd-default-col)`.
|
|
5
26
|
*/
|
|
6
27
|
export declare class PdInput extends PdBaseInputElement {
|
|
7
|
-
/**
|
|
8
|
-
* Optional icon to display inside input
|
|
9
|
-
*/
|
|
28
|
+
/** Optional icon to display inside input. */
|
|
10
29
|
icon: string;
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
30
|
+
/** If true, icon is clickable and keyboard accessible. */
|
|
31
|
+
clickableIcon: boolean;
|
|
32
|
+
/** Accessible label for clickable icon (required when clickableIcon is true). */
|
|
33
|
+
iconLabel: string;
|
|
34
|
+
/** If true, uses input type password. */
|
|
14
35
|
secret: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Minimum length constraint
|
|
17
|
-
*/
|
|
36
|
+
/** Minimum character length constraint. */
|
|
18
37
|
minlength?: number;
|
|
19
|
-
/**
|
|
20
|
-
* Maximum length constraint
|
|
21
|
-
*/
|
|
38
|
+
/** Maximum character length constraint. Default: 500. */
|
|
22
39
|
maxlength?: number;
|
|
23
|
-
/**
|
|
24
|
-
* If true, restricts input to numbers only (legacy, use type="number" langfristig)
|
|
25
|
-
*/
|
|
40
|
+
/** Restricts input to numbers only (remove other chars during typing). */
|
|
26
41
|
onlyNumbers: boolean;
|
|
27
42
|
static styles: CSSResultGroup;
|
|
28
43
|
constructor();
|
|
29
44
|
connectedCallback(): void;
|
|
30
45
|
private _setupValidators;
|
|
31
46
|
render(): TemplateResult;
|
|
47
|
+
/** Renders the input field. Override in subclasses to add additional attributes. */
|
|
48
|
+
protected _renderInputField(inputId: string, errorId: string): TemplateResult;
|
|
32
49
|
protected _onKeyUp(e: KeyboardEvent): void;
|
|
33
50
|
private _iconClicked;
|
|
51
|
+
private _onIconKeyDown;
|
|
34
52
|
}
|
|
35
53
|
//# sourceMappingURL=PdInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdInput.d.ts","sourceRoot":"","sources":["../../src/pd-input/PdInput.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"PdInput.d.ts","sourceRoot":"","sources":["../../src/pd-input/PdInput.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,EAAa,KAAK,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAKrE,OAAO,0CAA0C,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAKtE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,OAAQ,SAAQ,kBAAkB;IAC7C,6CAA6C;IAE7C,IAAI,SAAM;IAEV,0DAA0D;IAE1D,aAAa,UAAS;IAEtB,iFAAiF;IAEjF,SAAS,SAAM;IAEf,yCAAyC;IAEzC,MAAM,UAAS;IAEf,2CAA2C;IAE3C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IAEzD,SAAS,CAAC,EAAE,MAAM,CAAO;IAEzB,0EAA0E;IAE1E,WAAW,UAAS;IAEpB,OAAgB,MAAM,EAAE,cAAc,CAOpC;;IAOO,iBAAiB,IAAI,IAAI;IAMlC,OAAO,CAAC,gBAAgB;IAsBf,MAAM,IAAI,cAAc;IAiCjC,oFAAoF;IACpF,SAAS,CAAC,iBAAiB,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,cAAc;cAuBE,QAAQ,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI;IAWnD,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,cAAc;CAMvB"}
|
package/dist/pd-input/PdInput.js
CHANGED
|
@@ -15,11 +15,13 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
15
15
|
if (result) __defProp(target, key, result);
|
|
16
16
|
return result;
|
|
17
17
|
};
|
|
18
|
-
const onlyContainsNumbers = (
|
|
18
|
+
const onlyContainsNumbers = (strVar) => /^\d+$/.test(strVar);
|
|
19
19
|
class PdInput extends PdBaseInputElement {
|
|
20
20
|
constructor() {
|
|
21
21
|
super();
|
|
22
22
|
this.icon = "";
|
|
23
|
+
this.clickableIcon = false;
|
|
24
|
+
this.iconLabel = "";
|
|
23
25
|
this.secret = false;
|
|
24
26
|
this.maxlength = 500;
|
|
25
27
|
this.onlyNumbers = false;
|
|
@@ -55,6 +57,7 @@ class PdInput extends PdBaseInputElement {
|
|
|
55
57
|
}
|
|
56
58
|
render() {
|
|
57
59
|
const inputId = `${this.id}Input`;
|
|
60
|
+
const errorId = `${this.id}Error`;
|
|
58
61
|
return html`
|
|
59
62
|
${this._renderLabel(inputId)}
|
|
60
63
|
<div
|
|
@@ -66,30 +69,43 @@ class PdInput extends PdBaseInputElement {
|
|
|
66
69
|
>
|
|
67
70
|
${this.icon ? html`
|
|
68
71
|
<pd-icon
|
|
69
|
-
icon
|
|
70
|
-
activeIcon
|
|
71
|
-
@click=${this._iconClicked}
|
|
72
|
+
icon="${this.icon}"
|
|
73
|
+
?activeIcon="${this.clickableIcon}"
|
|
72
74
|
class="infield-icon"
|
|
75
|
+
tabindex="${this.clickableIcon ? 0 : -1}"
|
|
76
|
+
role="${this.clickableIcon ? "button" : "img"}"
|
|
77
|
+
aria-label="${this.clickableIcon ? this.iconLabel : ""}"
|
|
78
|
+
aria-hidden="${!this.clickableIcon}"
|
|
79
|
+
@click="${this.clickableIcon ? this._iconClicked : null}"
|
|
80
|
+
@keydown="${this.clickableIcon ? this._onIconKeyDown : null}"
|
|
73
81
|
></pd-icon>
|
|
74
82
|
` : ""}
|
|
75
|
-
|
|
76
|
-
id=${inputId}
|
|
77
|
-
name=${this.name || this.valueName || this.autoCompleteName}
|
|
78
|
-
autocomplete=${this.autoCompleteName ?? "off"}
|
|
79
|
-
class="input-style ${this.gradient ? "gradient" : ""}"
|
|
80
|
-
type=${this.secret ? "password" : "text"}
|
|
81
|
-
placeholder=${this.placeHolder}
|
|
82
|
-
.value=${this._value}
|
|
83
|
-
minlength=${this.minlength ?? ""}
|
|
84
|
-
maxlength=${this.maxlength ?? ""}
|
|
85
|
-
?readonly=${this.readonly}
|
|
86
|
-
?disabled=${this.disabled}
|
|
87
|
-
@keyup=${this._onKeyUp}
|
|
88
|
-
@blur=${this._onBlur}
|
|
89
|
-
@focus=${this._onFocus}
|
|
90
|
-
/>
|
|
83
|
+
${this._renderInputField(inputId, errorId)}
|
|
91
84
|
</div>
|
|
92
|
-
${this._renderErrorMsg()}
|
|
85
|
+
${this._renderErrorMsg(errorId)}
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
/** Renders the input field. Override in subclasses to add additional attributes. */
|
|
89
|
+
_renderInputField(inputId, errorId) {
|
|
90
|
+
return html`
|
|
91
|
+
<input
|
|
92
|
+
id="${inputId}"
|
|
93
|
+
name="${this.name || this.valueName || this.autoCompleteName}"
|
|
94
|
+
autocomplete="${this.autoCompleteName ?? "off"}"
|
|
95
|
+
class="input-style ${this.gradient ? "gradient" : ""}"
|
|
96
|
+
type="${this.secret ? "password" : "text"}"
|
|
97
|
+
placeholder="${this.placeHolder}"
|
|
98
|
+
.value="${this._value}"
|
|
99
|
+
minlength="${this.minlength ?? ""}"
|
|
100
|
+
maxlength="${this.maxlength ?? ""}"
|
|
101
|
+
?readonly="${this.readonly}"
|
|
102
|
+
?disabled="${this.disabled}"
|
|
103
|
+
aria-invalid="${this._invalid}"
|
|
104
|
+
aria-describedby="${this._errorMsg ? errorId : ""}"
|
|
105
|
+
@keyup="${this._onKeyUp}"
|
|
106
|
+
@blur="${this._onBlur}"
|
|
107
|
+
@focus="${this._onFocus}"
|
|
108
|
+
/>
|
|
93
109
|
`;
|
|
94
110
|
}
|
|
95
111
|
_onKeyUp(e) {
|
|
@@ -103,10 +119,22 @@ class PdInput extends PdBaseInputElement {
|
|
|
103
119
|
new CustomEvent("input-icon-click", { bubbles: true, composed: true })
|
|
104
120
|
);
|
|
105
121
|
}
|
|
122
|
+
_onIconKeyDown(event) {
|
|
123
|
+
if (event.key === " " || event.key === "Enter") {
|
|
124
|
+
event.preventDefault();
|
|
125
|
+
this._iconClicked();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
106
128
|
}
|
|
107
129
|
__decorateClass([
|
|
108
130
|
property({ type: String })
|
|
109
131
|
], PdInput.prototype, "icon");
|
|
132
|
+
__decorateClass([
|
|
133
|
+
property({ type: Boolean })
|
|
134
|
+
], PdInput.prototype, "clickableIcon");
|
|
135
|
+
__decorateClass([
|
|
136
|
+
property({ type: String })
|
|
137
|
+
], PdInput.prototype, "iconLabel");
|
|
110
138
|
__decorateClass([
|
|
111
139
|
property({ type: Boolean })
|
|
112
140
|
], PdInput.prototype, "secret");
|
|
@@ -1,37 +1,73 @@
|
|
|
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
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdFieldType, PdAutocomplete } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-input component.
|
|
5
|
+
* Maps to the component's public API.
|
|
6
|
+
*/
|
|
7
|
+
interface PdInputArgs {
|
|
8
|
+
/** Label text displayed above the input */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Initial value of the input */
|
|
11
|
+
initValue: string;
|
|
12
|
+
/** Placeholder text shown when input is empty */
|
|
13
|
+
placeHolder: string;
|
|
14
|
+
/** Whether the input is disabled */
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
/** Whether the input is read-only */
|
|
17
|
+
readonly: boolean;
|
|
18
|
+
/** Whether the input is required */
|
|
19
|
+
required: boolean;
|
|
20
|
+
/** Whether to mask input as password */
|
|
21
|
+
secret: boolean;
|
|
22
|
+
/** Optional icon to display (use pdIcons constants) */
|
|
23
|
+
icon: string;
|
|
24
|
+
/** Whether the icon is clickable */
|
|
25
|
+
clickableIcon: boolean;
|
|
26
|
+
/** Accessible label for clickable icon */
|
|
27
|
+
iconLabel: string;
|
|
28
|
+
/** Minimum character length */
|
|
29
|
+
minlength?: number;
|
|
30
|
+
/** Maximum character length */
|
|
31
|
+
maxlength?: number;
|
|
32
|
+
/** Restrict input to numbers only (legacy - prefer fieldType="number") */
|
|
33
|
+
onlyNumbers: boolean;
|
|
34
|
+
/** Field validation type */
|
|
35
|
+
fieldType: PdFieldType;
|
|
36
|
+
/** Helper text shown in tooltip */
|
|
37
|
+
helperTxt: string;
|
|
38
|
+
/** Character shown for required fields */
|
|
39
|
+
defaultRequiredChar: string;
|
|
40
|
+
/** Autocomplete attribute value */
|
|
41
|
+
autoCompleteName: PdAutocomplete;
|
|
42
|
+
/** Apply gradient styling */
|
|
43
|
+
gradient: boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* ## pd-input
|
|
47
|
+
*
|
|
48
|
+
* A versatile text input component for forms with validation,
|
|
49
|
+
* icons, and multiple field types.
|
|
50
|
+
*
|
|
51
|
+
* ### Features
|
|
52
|
+
* - **Field Types**: text, number, mail, vat, phone validation
|
|
53
|
+
* - **States**: Supports disabled, readonly, required, and password (secret) modes
|
|
54
|
+
* - **Icons**: Optional left or right icon positioning, decorative or clickable
|
|
55
|
+
* - **Validation**: Built-in validation for email, phone, VAT formats
|
|
56
|
+
* - **Form Integration**: Works with pd-form-container for validation
|
|
57
|
+
*/
|
|
58
|
+
declare const meta: Meta<PdInputArgs>;
|
|
34
59
|
export default meta;
|
|
35
|
-
type Story = StoryObj
|
|
36
|
-
|
|
60
|
+
type Story = StoryObj<PdInputArgs>;
|
|
61
|
+
/** Default input with minimal configuration. Interactive via Controls panel. */
|
|
62
|
+
export declare const Default: Story;
|
|
63
|
+
/** All input states and variants at a glance. */
|
|
64
|
+
export declare const AllVariants: Story;
|
|
65
|
+
/** Decorative vs clickable icon usage patterns. */
|
|
66
|
+
export declare const IconVariants: Story;
|
|
67
|
+
/** Validation field types: email, number, onlyNumbers. */
|
|
68
|
+
export declare const FieldTypes: Story;
|
|
69
|
+
/** Input within a form container showing proper form layout and validation. */
|
|
70
|
+
export declare const InFormContainer: Story;
|
|
71
|
+
/** CSS Custom Properties — Branded and Redesigned variants. */
|
|
72
|
+
export declare const CustomStyling: Story;
|
|
37
73
|
//# sourceMappingURL=pd-input.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-input.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input/pd-input.stories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pd-input.stories.d.ts","sourceRoot":"","sources":["../../src/pd-input/pd-input.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAKrE,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,eAAe,CAAC;AACvB,OAAO,+BAA+B,CAAC;AACvC,OAAO,2CAA2C,CAAC;AAMnD;;;GAGG;AACH,UAAU,WAAW;IACnB,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,qCAAqC;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,oCAAoC;IACpC,QAAQ,EAAE,OAAO,CAAC;IAClB,wCAAwC;IACxC,MAAM,EAAE,OAAO,CAAC;IAChB,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,aAAa,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,WAAW,EAAE,OAAO,CAAC;IACrB,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,WAAW,CAiI3B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAMnC,gFAAgF;AAChF,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC;AAMF,iDAAiD;AACjD,eAAO,MAAM,WAAW,EAAE,KAsEzB,CAAC;AAMF,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAAE,KAqE1B,CAAC;AAMF,0DAA0D;AAC1D,eAAO,MAAM,UAAU,EAAE,KA8ExB,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,KAsC7B,CAAC;AAMF,+DAA+D;AAC/D,eAAO,MAAM,aAAa,EAAE,KA4H3B,CAAC"}
|