lupine.components 1.1.39 → 1.1.41
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/package.json
CHANGED
|
@@ -270,7 +270,7 @@ export class ActionSheetMessage {
|
|
|
270
270
|
confirmButtonText,
|
|
271
271
|
handleConfirmClicked,
|
|
272
272
|
cancelButtonText = '',
|
|
273
|
-
closeWhenClickMessage =
|
|
273
|
+
closeWhenClickMessage = false,
|
|
274
274
|
}: ActionSheetMessageProps): Promise<ActionSheetCloseProps> {
|
|
275
275
|
const handleClose = await ActionSheet.show({
|
|
276
276
|
title,
|
|
@@ -146,6 +146,8 @@ export class FloatWindow {
|
|
|
146
146
|
padding: '15px',
|
|
147
147
|
maxHeight: contentMaxHeight ? `min(${contentMaxHeight}, calc(100% - 100px))` : 'calc(100% - 100px)',
|
|
148
148
|
overflowY: contentOverflowY,
|
|
149
|
+
boxSizing: 'border-box',
|
|
150
|
+
width: '100%',
|
|
149
151
|
},
|
|
150
152
|
'.fwin-bottom': {
|
|
151
153
|
display: 'flex',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RefProps, VNode } from 'lupine.web';
|
|
2
2
|
|
|
3
|
-
export type HtmlVarValueProps = string | VNode<any> | (() => Promise<VNode<any>>);
|
|
3
|
+
export type HtmlVarValueProps = string | null | undefined | VNode<any> | (() => Promise<VNode<any>>);
|
|
4
4
|
export type HtmlVarResult = { value: HtmlVarValueProps; ref: RefProps; node: VNode<any> };
|
|
5
5
|
export class HtmlVar implements HtmlVarResult {
|
|
6
|
-
private _value:
|
|
6
|
+
private _value: string | VNode<any> | (() => Promise<VNode<any>>);
|
|
7
7
|
private _dirty = false;
|
|
8
8
|
private _ref: RefProps;
|
|
9
9
|
private resolve!: () => void;
|
|
@@ -54,7 +54,7 @@ export class HtmlVar implements HtmlVarResult {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
set value(value: HtmlVarValueProps) {
|
|
57
|
-
this._value = value;
|
|
57
|
+
this._value = value || '';
|
|
58
58
|
if (this._dirty) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
package/src/lib/encode-html.ts
CHANGED
|
@@ -6,8 +6,9 @@ const htmlEscapes: Record<string, string> = {
|
|
|
6
6
|
'"': '"',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export const encodeHtml = (str:
|
|
10
|
-
|
|
9
|
+
export const encodeHtml = (str: any): string => {
|
|
10
|
+
if (str === null || str === undefined) return '';
|
|
11
|
+
return String(str).replace(/[&<>'"]/g, (tag) => htmlEscapes[tag]);
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
const htmlUnescapes: Record<string, string> = {
|
|
@@ -19,5 +20,6 @@ const htmlUnescapes: Record<string, string> = {
|
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const decodeHtml = (str: string): string => {
|
|
22
|
-
|
|
23
|
+
if (str === null || str === undefined) return '';
|
|
24
|
+
return String(str).replace(/&(?:amp|lt|gt|quot|#39);/g, (tag) => htmlUnescapes[tag]);
|
|
23
25
|
};
|