inviton-powerduck 0.0.310 → 0.0.312
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,43 +1,43 @@
|
|
|
1
|
-
import TemporalUtils from './temporal-utils';
|
|
2
|
-
|
|
3
|
-
export default class ObjectPostProcessor {
|
|
4
|
-
/**
|
|
5
|
-
* Post-process JS object to auto-load some common framework types
|
|
6
|
-
*
|
|
7
|
-
* @param jsObj
|
|
8
|
-
* @param jsonAdapter
|
|
9
|
-
*/
|
|
10
|
-
static postProcessJsObject<T>(jsObj: T, jsonAdapter?: any): T {
|
|
11
|
-
const recIterate = function (obj) {
|
|
12
|
-
for (const key in obj) {
|
|
13
|
-
const keyVal = obj[key];
|
|
14
|
-
if (jsonAdapter != null) {
|
|
15
|
-
jsonAdapter(
|
|
16
|
-
keyVal,
|
|
17
|
-
key,
|
|
18
|
-
obj,
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (Array.isArray(keyVal)) {
|
|
23
|
-
keyVal.forEach((arrItem) => {
|
|
24
|
-
recIterate(arrItem);
|
|
25
|
-
});
|
|
26
|
-
} else if (keyVal != null && typeof keyVal === 'object') {
|
|
27
|
-
recIterate(keyVal);
|
|
28
|
-
} else {
|
|
29
|
-
if (keyVal != null && keyVal.indexOf && TemporalUtils.isSerializedDate(keyVal)) {
|
|
30
|
-
try {
|
|
31
|
-
obj[key] = TemporalUtils.fromString(keyVal);
|
|
32
|
-
} catch (e) {
|
|
33
|
-
obj[key] = keyVal;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
recIterate(jsObj);
|
|
41
|
-
return jsObj;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
import TemporalUtils from './temporal-utils';
|
|
2
|
+
|
|
3
|
+
export default class ObjectPostProcessor {
|
|
4
|
+
/**
|
|
5
|
+
* Post-process JS object to auto-load some common framework types
|
|
6
|
+
*
|
|
7
|
+
* @param jsObj
|
|
8
|
+
* @param jsonAdapter
|
|
9
|
+
*/
|
|
10
|
+
static postProcessJsObject<T>(jsObj: T, jsonAdapter?: any): T {
|
|
11
|
+
const recIterate = function (obj) {
|
|
12
|
+
for (const key in obj) {
|
|
13
|
+
const keyVal = obj[key];
|
|
14
|
+
if (jsonAdapter != null) {
|
|
15
|
+
jsonAdapter(
|
|
16
|
+
keyVal,
|
|
17
|
+
key,
|
|
18
|
+
obj,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (Array.isArray(keyVal)) {
|
|
23
|
+
keyVal.forEach((arrItem) => {
|
|
24
|
+
recIterate(arrItem);
|
|
25
|
+
});
|
|
26
|
+
} else if (keyVal != null && typeof keyVal === 'object') {
|
|
27
|
+
recIterate(keyVal);
|
|
28
|
+
} else {
|
|
29
|
+
if (keyVal != null && keyVal.indexOf && TemporalUtils.isSerializedDate(keyVal)) {
|
|
30
|
+
try {
|
|
31
|
+
obj[key] = TemporalUtils.fromString(keyVal);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
obj[key] = keyVal;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
recIterate(jsObj);
|
|
41
|
+
return jsObj;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
|
|
733
733
|
.drpn-mvs-table .day {
|
|
734
734
|
height: 38px;
|
|
735
|
-
width:
|
|
735
|
+
width: 38px;
|
|
736
736
|
max-width: 38px;
|
|
737
737
|
margin: 0 auto;
|
|
738
738
|
font-size: 13px;
|
|
@@ -740,6 +740,11 @@
|
|
|
740
740
|
color: #393562;
|
|
741
741
|
cursor: pointer;
|
|
742
742
|
line-height: 38px;
|
|
743
|
+
display: inline-flex;
|
|
744
|
+
align-items: center;
|
|
745
|
+
justify-content: center;
|
|
746
|
+
border-radius: 50%;
|
|
747
|
+
box-sizing: border-box;
|
|
743
748
|
}
|
|
744
749
|
|
|
745
750
|
.drpn-mvs-table .day.lastMonth,
|
|
@@ -769,3 +774,41 @@
|
|
|
769
774
|
padding: 10px 14px;
|
|
770
775
|
background: #fff;
|
|
771
776
|
}
|
|
777
|
+
|
|
778
|
+
/* ── Currency info footer row ────────────────────────────────────────── */
|
|
779
|
+
|
|
780
|
+
.drpn-footer-info {
|
|
781
|
+
display: flex;
|
|
782
|
+
align-items: center;
|
|
783
|
+
gap: 8px;
|
|
784
|
+
padding-top: 10px;
|
|
785
|
+
margin-top: 10px;
|
|
786
|
+
border-top: 1px solid #eff1f8;
|
|
787
|
+
font-size: 14px;
|
|
788
|
+
font-weight: 400;
|
|
789
|
+
line-height: 20px;
|
|
790
|
+
color: #4b5565;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.drpn-footer-info-icon {
|
|
794
|
+
display: inline-flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
justify-content: center;
|
|
797
|
+
width: 16px;
|
|
798
|
+
height: 16px;
|
|
799
|
+
flex-shrink: 0;
|
|
800
|
+
font-size: 16px;
|
|
801
|
+
color: #4b5565;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
.drpn-footer-info-text {
|
|
805
|
+
display: inline-flex;
|
|
806
|
+
align-items: center;
|
|
807
|
+
gap: 4px;
|
|
808
|
+
flex-wrap: nowrap;
|
|
809
|
+
white-space: nowrap;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
.drpn-footer-info-text strong {
|
|
813
|
+
font-weight: 700;
|
|
814
|
+
}
|
|
@@ -99,6 +99,12 @@ interface DaterangePickerArgs extends FormItemWrapperArgs {
|
|
|
99
99
|
* the next field in a multi-step form.
|
|
100
100
|
*/
|
|
101
101
|
confirmedByEnter?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Optional footer info row rendered below the calendar months (and time row
|
|
104
|
+
* if enabled). Displayed as `(i) <text>` with a top-border separator.
|
|
105
|
+
* Intended for currency disclaimers, e.g. "Ceny zobrazené v mene EUR".
|
|
106
|
+
*/
|
|
107
|
+
footerInfo?: VNode | string;
|
|
102
108
|
}
|
|
103
109
|
|
|
104
110
|
// ── Translations ───────────────────────────────────────────────────────────
|
|
@@ -416,6 +422,7 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
|
|
|
416
422
|
@Prop() confirmText?: string;
|
|
417
423
|
@Prop() cancelText?: string;
|
|
418
424
|
@Prop() confirmedByEnter?: () => void;
|
|
425
|
+
@Prop() footerInfo?: VNode | string;
|
|
419
426
|
|
|
420
427
|
// State
|
|
421
428
|
_startDate: Temporal.PlainDateTime = null;
|
|
@@ -2027,6 +2034,19 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
|
|
|
2027
2034
|
return null;
|
|
2028
2035
|
}
|
|
2029
2036
|
|
|
2037
|
+
private renderFooterInfo(): VNode {
|
|
2038
|
+
if (!this.footerInfo) {
|
|
2039
|
+
return null;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
return (
|
|
2043
|
+
<div class="drpn-footer-info">
|
|
2044
|
+
<i class="gp gp-info-circle drpn-footer-info-icon" />
|
|
2045
|
+
<span class="drpn-footer-info-text">{this.footerInfo}</span>
|
|
2046
|
+
</div>
|
|
2047
|
+
);
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2030
2050
|
private confirmClicked() {
|
|
2031
2051
|
this.raiseChanged();
|
|
2032
2052
|
this.close();
|
|
@@ -2217,6 +2237,7 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
|
|
|
2217
2237
|
)}
|
|
2218
2238
|
{this.renderTooltip(renderCtx)}
|
|
2219
2239
|
{this.renderFooter(false)}
|
|
2240
|
+
{this.renderFooterInfo()}
|
|
2220
2241
|
</div>
|
|
2221
2242
|
);
|
|
2222
2243
|
}
|
|
@@ -2271,6 +2292,7 @@ class DaterangePickerComponent extends TsxComponent<DaterangePickerArgs> impleme
|
|
|
2271
2292
|
{months}
|
|
2272
2293
|
</div>
|
|
2273
2294
|
{this.renderFooter(true)}
|
|
2295
|
+
{this.renderFooterInfo()}
|
|
2274
2296
|
</div>
|
|
2275
2297
|
);
|
|
2276
2298
|
}
|
|
@@ -28,6 +28,16 @@ interface TextBoxArgs extends Omit<FormItemWrapperArgs, 'errorId'> {
|
|
|
28
28
|
export const enum TextBoxTextType {
|
|
29
29
|
Text = 'text',
|
|
30
30
|
Password = 'password',
|
|
31
|
+
/**
|
|
32
|
+
* Same DOM rendering as Password (type="password" — characters hidden), but
|
|
33
|
+
* sets autocomplete="new-password" by default. Use for password fields that
|
|
34
|
+
* should NOT trigger the browser's login-form heuristic — admin config fields
|
|
35
|
+
* for third-party integration credentials, "set new password" forms, etc.
|
|
36
|
+
*
|
|
37
|
+
* The login form intentionally uses Password (with explicit autoCompleteText
|
|
38
|
+
* "current-password") so the browser still autofills saved credentials.
|
|
39
|
+
*/
|
|
40
|
+
PasswordNew = 'password-new',
|
|
31
41
|
Url = 'url',
|
|
32
42
|
Email = 'email',
|
|
33
43
|
Time = 'time',
|
|
@@ -98,6 +108,14 @@ class TextBoxComponent extends TsxComponent<TextBoxArgs> implements TextBoxArgs
|
|
|
98
108
|
return 'text';
|
|
99
109
|
}
|
|
100
110
|
|
|
111
|
+
if (this.textType === TextBoxTextType.PasswordNew && this.isPasswordVisible) {
|
|
112
|
+
return 'text';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (this.textType === TextBoxTextType.PasswordNew) {
|
|
116
|
+
return 'password';
|
|
117
|
+
}
|
|
118
|
+
|
|
101
119
|
return this.textType || 'text';
|
|
102
120
|
}
|
|
103
121
|
|
|
@@ -106,7 +124,7 @@ class TextBoxComponent extends TsxComponent<TextBoxArgs> implements TextBoxArgs
|
|
|
106
124
|
}
|
|
107
125
|
|
|
108
126
|
get computedAppendIcon(): string {
|
|
109
|
-
if (this.textType === TextBoxTextType.Password && !this.hidePasswordToggle) {
|
|
127
|
+
if ((this.textType === TextBoxTextType.Password || this.textType === TextBoxTextType.PasswordNew) && !this.hidePasswordToggle) {
|
|
110
128
|
return this.isPasswordVisible ? 'fa fa-eye-slash' : 'fa fa-eye';
|
|
111
129
|
}
|
|
112
130
|
|
|
@@ -114,7 +132,7 @@ class TextBoxComponent extends TsxComponent<TextBoxArgs> implements TextBoxArgs
|
|
|
114
132
|
}
|
|
115
133
|
|
|
116
134
|
get computedAppendIconClicked(): (() => void) {
|
|
117
|
-
if (this.textType === TextBoxTextType.Password && !this.hidePasswordToggle) {
|
|
135
|
+
if ((this.textType === TextBoxTextType.Password || this.textType === TextBoxTextType.PasswordNew) && !this.hidePasswordToggle) {
|
|
118
136
|
return () => this.togglePasswordVisibility();
|
|
119
137
|
}
|
|
120
138
|
|
|
@@ -134,6 +152,10 @@ class TextBoxComponent extends TsxComponent<TextBoxArgs> implements TextBoxArgs
|
|
|
134
152
|
}
|
|
135
153
|
}
|
|
136
154
|
|
|
155
|
+
if (this.textType === TextBoxTextType.PasswordNew) {
|
|
156
|
+
return 'new-password';
|
|
157
|
+
}
|
|
158
|
+
|
|
137
159
|
return null;
|
|
138
160
|
}
|
|
139
161
|
|