@progressive-development/pd-forms 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"pd-base-ui-input.d.ts","sourceRoot":"","sources":["../src/pd-base-ui-input.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAa,cAAc,EAAE,MAAM,KAAK,CAAC;AAGhD,OAAO,0CAA0C,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxC,OAAO,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,eAAe,IAAI,CAAC;AAWjC,8BAAsB,aAAc,SAAQ,QAAQ;IAClD;;;OAGG;IAEH;;;OAGG;IAEH;;;OAGG;IAGH,QAAQ,UAAS;IAGjB,QAAQ,UAAS;IAGjB,QAAQ,UAAS;IAGjB,QAAQ,UAAS;IAGjB,WAAW,SAAM;IAGjB,SAAS,SAAM;IAGf,SAAS,SAAM;IAGf,mBAAmB,SAAO;IAG1B,YAAY,SAAM;IAGlB,KAAK,SAAM;IAGX,KAAK,SAAM;IAGX,SAAS,CAAC,SAAS,SAAM;IAGzB,SAAS,CAAC,UAAU,SAAM;IAE1B,OAAgB,MAAM,EAAE,cAAc,CAmBpC;IAEF,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,M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IAGlB,KAAK,SAAM;IAGX,KAAK,SAAM;IAGX,SAAS,CAAC,SAAS,SAAM;IAGzB,SAAS,CAAC,UAAU,SAAM;IAE1B,OAAgB,MAAM,EAAE,cAAc,CAmBpC;IAEF,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAEvB;IAEM,KAAK,IAAI,IAAI;IAKb,KAAK,IAAI,IAAI;IAKpB,SAAS,CAAC,sBAAsB,IAAI,IAAI;IAaxC,SAAS,CAAC,mBAAmB,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,WAAW,UAAQ,EACnB,eAAe,UAAQ,GACtB,IAAI;IA+CP,SAAS,CAAC,eAAe;IAUzB,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM;CAwBlE"}
@@ -0,0 +1,242 @@
1
+ import { css, html } from "lit";
2
+ import { property, state, customElement } from "lit/decorators.js";
3
+ import "@progressive-development/pd-icon/pd-icon";
4
+ import { PdBaseUI } from "./pd-base-ui.js";
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __decorateClass = (decorators, target, key, kind) => {
8
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
9
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
10
+ if (decorator = decorators[i])
11
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12
+ if (kind && result) __defProp(target, key, result);
13
+ return result;
14
+ };
15
+ let PdIconPanelButton = class extends PdBaseUI {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.buttonText = "Ok";
19
+ this.panelButton = false;
20
+ this._panelOpen = false;
21
+ this._closePanel = () => {
22
+ this._panelOpen = false;
23
+ };
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ window.addEventListener("close-button-panel-event", this._closePanel);
28
+ }
29
+ disconnectedCallback() {
30
+ window.removeEventListener("close-button-panel-event", this._closePanel);
31
+ super.disconnectedCallback();
32
+ }
33
+ // ${this._daySyncDisabled ? "element-hint" : ""} => for div class
34
+ render() {
35
+ return html`
36
+ <div
37
+ class="icon-button-style"
38
+ role="button"
39
+ tabindex="0"
40
+ @click="${this._buttonClicked}"
41
+ @keydown="${this._onKeyDown}"
42
+ >
43
+ ${this.pdButtonIcon ? html`
44
+ <pd-icon
45
+ class="icon action-icon-color"
46
+ icon="${this.pdButtonIcon}"
47
+ activeIcon
48
+ ></pd-icon>
49
+ ` : ""}
50
+ <span>${this.buttonText}</span>
51
+ </div>
52
+
53
+ <div class="panel ${this._panelOpen ? "open" : ""}">
54
+ <button class="close-button" @click="${this._togglePanel}">
55
+ &times;
56
+ </button>
57
+ <div class="panel-content">
58
+ <slot></slot>
59
+ </div>
60
+ </div>
61
+ `;
62
+ }
63
+ _onKeyDown(event) {
64
+ if (event.key === "Enter" || event.key === " ") {
65
+ event.preventDefault();
66
+ this._buttonClicked();
67
+ }
68
+ }
69
+ _buttonClicked() {
70
+ if (this.panelButton) {
71
+ this._togglePanel();
72
+ } else {
73
+ this.dispatchEvent(
74
+ new CustomEvent("button-clicked", {
75
+ detail: this.value
76
+ })
77
+ );
78
+ }
79
+ }
80
+ _togglePanel() {
81
+ this._panelOpen = !this._panelOpen;
82
+ this.dispatchEvent(
83
+ new CustomEvent("panel-button-toggled", {
84
+ detail: { open: this._panelOpen }
85
+ })
86
+ );
87
+ }
88
+ };
89
+ PdIconPanelButton.styles = [
90
+ css`
91
+ :host {
92
+ display: inline-block; /* Verhindert, dass :host die volle Breite bekommt */
93
+ position: relative;
94
+ width: var(--pd-icon-button-width, auto);
95
+ }
96
+
97
+ :host([disabled]) {
98
+ pointer-events: none;
99
+ }
100
+
101
+ .icon-button-style {
102
+ z-index: 6;
103
+ background: #58a linear-gradient(hsla(0, 0%, 100%, 0.2), transparent);
104
+ background-color: var(--pd-icon-button-bgcol, #0c6fc5);
105
+ padding: 0.3em 0.8em;
106
+ border: 1px solid var(--pd-icon-button-bordercol, rgba(0, 0, 0, 0.5));
107
+ border-radius: var(--pd-icon-button-border-radius, 0.2em);
108
+ transition: background-color 0.3s ease;
109
+ --pd-icon-size: 20px;
110
+ color: var(--pd-icon-button-txtcol, white);
111
+ text-shadow: 0 - 0.05em 0.05em rgba(0, 0, 0, 0.5);
112
+ font-size: var(--pd-icon-button-font-size, 125%);
113
+ line-height: var(--pd-icon-button-line-height, 1.5);
114
+ height: var(--pd-icon-button-height, auto);
115
+ display: flex;
116
+ align-items: center;
117
+ justify-content: center;
118
+ text-align: center;
119
+ }
120
+
121
+ :host(:not([disabled])) .icon-button-style:hover {
122
+ background-color: var(--pd-icon-button-bgcol-hover, #fdae03f3);
123
+ cursor: pointer;
124
+ }
125
+
126
+ :host([disabled]) .icon-button-style {
127
+ background: linear-gradient(
128
+ to bottom,
129
+ #e0e0e0,
130
+ #c4c4c4
131
+ ); /* Matte, deaktivierte Optik */
132
+ color: #696868; /* Text weniger dominant */
133
+ border-color: #b0b0b0; /* Weniger Kontrast */
134
+ cursor: not-allowed;
135
+ opacity: 0.6; /* Leichter "inaktiv"-Effekt */
136
+ text-shadow: none; /* Kein 3D-Effekt */
137
+ }
138
+
139
+ :host(:not([disabled])[primary]) .icon-button-style {
140
+ background-color: var(--pd-icon-button-primary-bgcol, #044176);
141
+ color: var(--pd-icon-button-primary-txtcol, white);
142
+ }
143
+
144
+ :host(:not([disabled])[primary]) .icon-button-style:hover {
145
+ background-color: var(--pd-icon-button-primary-bgcol-hover, #fdae03f3);
146
+ cursor: pointer;
147
+ }
148
+
149
+ .panel {
150
+ position: absolute;
151
+ width: max-content; /* Verhindert volle Breite */
152
+ min-width: 120%; /* Panel wird etwas breiter als der Button */
153
+ max-width: 300px; /* Optional: Maximale Breite */
154
+ transform: scaleY(0);
155
+ background: var(--pd-panel-bg, white);
156
+ border-radius: 5px;
157
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
158
+ transition:
159
+ transform 0.2s ease-out,
160
+ opacity 0.2s ease-out;
161
+ opacity: 0;
162
+ z-index: 5;
163
+ }
164
+
165
+ .panel.open {
166
+ transform: scaleY(1);
167
+ opacity: 1;
168
+ }
169
+
170
+ .panel-content {
171
+ padding: 1rem;
172
+ min-height: 50px;
173
+ }
174
+
175
+ .close-button {
176
+ position: absolute;
177
+ top: 5px;
178
+ right: 5px;
179
+ background: transparent;
180
+ border: none;
181
+ color: #555;
182
+ font-size: 1.2rem;
183
+ cursor: pointer;
184
+ padding: 5px;
185
+ line-height: 1;
186
+ transition: color 0.2s ease-in-out;
187
+ }
188
+
189
+ .close-button:hover {
190
+ color: black;
191
+ }
192
+
193
+ /* Standard (nach unten öffnend, linksbündig) */
194
+ :host(:not([right]):not([up])) .panel {
195
+ left: 0; /* Panel beginnt exakt unter dem Button */
196
+ top: 100%; /* Panel öffnet sich nach unten */
197
+ transform-origin: top; /* Wächst nach unten */
198
+ }
199
+
200
+ /* Standard (nach unten öffnend, rechtsbündig) */
201
+ :host([right]:not([up])) .panel {
202
+ right: 0; /* Panel beginnt rechtsbündig am Button */
203
+ top: 100%;
204
+ transform-origin: top right;
205
+ }
206
+
207
+ /* Panel öffnet sich nach OBEN (links ausgerichtet) */
208
+ :host(:not([right])[up]) .panel {
209
+ left: 0;
210
+ bottom: 100%; /* Panel öffnet sich nach oben */
211
+ transform-origin: bottom;
212
+ }
213
+
214
+ /* Panel öffnet sich nach OBEN (rechts ausgerichtet) */
215
+ :host([right][up]) .panel {
216
+ right: 0;
217
+ bottom: 100%; /* Panel öffnet sich nach oben */
218
+ transform-origin: bottom right;
219
+ }
220
+ `
221
+ ];
222
+ __decorateClass([
223
+ property({ type: String })
224
+ ], PdIconPanelButton.prototype, "pdButtonIcon", 2);
225
+ __decorateClass([
226
+ property({ type: String })
227
+ ], PdIconPanelButton.prototype, "buttonText", 2);
228
+ __decorateClass([
229
+ property({ type: String })
230
+ ], PdIconPanelButton.prototype, "value", 2);
231
+ __decorateClass([
232
+ property({ type: Boolean })
233
+ ], PdIconPanelButton.prototype, "panelButton", 2);
234
+ __decorateClass([
235
+ state()
236
+ ], PdIconPanelButton.prototype, "_panelOpen", 2);
237
+ PdIconPanelButton = __decorateClass([
238
+ customElement("pd-icon-panel-button")
239
+ ], PdIconPanelButton);
240
+ export {
241
+ PdIconPanelButton
242
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progressive-development/pd-forms",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Webcomponent pd-forms for rendering form input elements.",
5
5
  "author": "PD Progressive Development",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -10,6 +10,7 @@
10
10
  "exports": {
11
11
  ".": "./dist/index.js",
12
12
  "./pd-button": "./dist/pd-button.js",
13
+ "./pd-icon-panel-button": "./dist/pd-icon-panel-button.js",
13
14
  "./pd-checkbox": "./dist/pd-checkbox.js",
14
15
  "./pd-form-container": "./dist/pd-form-container.js",
15
16
  "./pd-form-row": "./dist/pd-form-row.js",