@pepperi-addons/ngx-lib-react 0.0.5 → 0.5.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.
- package/README.md +48 -0
- package/elements/3rdpartylicenses.txt +28 -0
- package/elements/main.js +1 -1
- package/http-helpers.d.ts +49 -0
- package/http-helpers.js +164 -0
- package/index.d.ts +31 -14
- package/index.js +33 -14
- package/package.json +1 -3
- package/pep-address.d.ts +38 -0
- package/pep-address.js +71 -0
- package/pep-attachment.d.ts +24 -0
- package/pep-attachment.js +76 -0
- package/pep-bread-crumbs.d.ts +16 -0
- package/pep-bread-crumbs.js +35 -0
- package/pep-button.js +1 -1
- package/pep-carousel.d.ts +28 -0
- package/pep-carousel.js +80 -0
- package/pep-checkbox.d.ts +25 -0
- package/pep-checkbox.js +72 -0
- package/pep-chips.d.ts +6 -0
- package/pep-chips.js +13 -3
- package/pep-color-picker.d.ts +9 -0
- package/pep-color-picker.js +27 -0
- package/pep-color.d.ts +6 -0
- package/pep-color.js +15 -3
- package/pep-date.d.ts +25 -0
- package/pep-date.js +84 -7
- package/pep-dialog.d.ts +1 -2
- package/pep-dialog.js +15 -9
- package/pep-draggable-item.d.ts +23 -0
- package/pep-draggable-item.js +62 -0
- package/pep-files-uploader.js +1 -1
- package/pep-group-buttons.js +1 -1
- package/pep-icon.d.ts +8 -0
- package/pep-icon.js +18 -0
- package/pep-image.d.ts +32 -0
- package/pep-image.js +89 -0
- package/pep-images-filmstrip.d.ts +16 -0
- package/pep-images-filmstrip.js +40 -0
- package/pep-link.d.ts +9 -0
- package/pep-link.js +21 -3
- package/pep-menu.js +1 -1
- package/pep-page-layout.d.ts +11 -0
- package/pep-page-layout.js +19 -0
- package/pep-quantity-selector.js +1 -1
- package/pep-search.d.ts +27 -0
- package/pep-search.js +59 -0
- package/pep-select.d.ts +14 -0
- package/pep-select.js +56 -8
- package/pep-separator.d.ts +2 -0
- package/pep-separator.js +7 -3
- package/pep-skeleton-loader.d.ts +8 -0
- package/pep-skeleton-loader.js +30 -0
- package/pep-slider.js +1 -1
- package/pep-snack-bar.d.ts +7 -0
- package/pep-snack-bar.js +33 -0
- package/pep-textarea.d.ts +14 -0
- package/pep-textarea.js +36 -8
- package/pep-textbox.d.ts +15 -0
- package/pep-textbox.js +47 -2
- package/services.d.ts +15 -0
- package/services.js +27 -0
- package/types.d.ts +9 -0
- package/types.js +9 -0
- package/elements/register.auto.js +0 -1
- package/elements/register.js +0 -1
package/pep-image.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PepImageProps {
|
|
3
|
+
keyProp?: string;
|
|
4
|
+
srcLarge?: string;
|
|
5
|
+
src?: string;
|
|
6
|
+
options?: any[];
|
|
7
|
+
label?: string;
|
|
8
|
+
mandatory?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readonly?: boolean;
|
|
11
|
+
xAlignment?: 'start' | 'center' | 'end';
|
|
12
|
+
rowSpan?: number;
|
|
13
|
+
indicatorsField?: any;
|
|
14
|
+
menuField?: any;
|
|
15
|
+
hasCampaignField?: any;
|
|
16
|
+
visible?: boolean;
|
|
17
|
+
form?: any;
|
|
18
|
+
uid?: string;
|
|
19
|
+
showTitle?: boolean;
|
|
20
|
+
renderTitle?: boolean;
|
|
21
|
+
layoutType?: 'form' | 'table' | 'card';
|
|
22
|
+
isActive?: boolean;
|
|
23
|
+
sizeLimitMB?: number;
|
|
24
|
+
acceptImagesType?: string;
|
|
25
|
+
handleActions?: boolean;
|
|
26
|
+
hint?: string;
|
|
27
|
+
onChooseFile?: () => void;
|
|
28
|
+
onFileChange?: (event: any) => void;
|
|
29
|
+
onElementClick?: (event: any) => void;
|
|
30
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
export declare const PepImage: React.FC<PepImageProps>;
|
package/pep-image.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
export const PepImage = ({ keyProp, srcLarge, src, options, label, mandatory, disabled, readonly, xAlignment, rowSpan, indicatorsField, menuField, hasCampaignField, visible, form, uid, showTitle, renderTitle, layoutType, isActive, sizeLimitMB, acceptImagesType, handleActions, hint, onChooseFile, onFileChange, onElementClick, onValidationChange, }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Set properties
|
|
10
|
+
if (keyProp !== undefined)
|
|
11
|
+
element.key = keyProp;
|
|
12
|
+
if (srcLarge !== undefined)
|
|
13
|
+
element.srcLarge = srcLarge;
|
|
14
|
+
if (src !== undefined)
|
|
15
|
+
element.src = src;
|
|
16
|
+
if (options !== undefined)
|
|
17
|
+
element.options = options;
|
|
18
|
+
if (label !== undefined)
|
|
19
|
+
element.label = label;
|
|
20
|
+
if (mandatory !== undefined)
|
|
21
|
+
element.mandatory = mandatory;
|
|
22
|
+
if (disabled !== undefined)
|
|
23
|
+
element.disabled = disabled;
|
|
24
|
+
if (readonly !== undefined)
|
|
25
|
+
element.readonly = readonly;
|
|
26
|
+
if (xAlignment !== undefined)
|
|
27
|
+
element.xAlignment = xAlignment;
|
|
28
|
+
if (rowSpan !== undefined)
|
|
29
|
+
element.rowSpan = rowSpan;
|
|
30
|
+
if (indicatorsField !== undefined)
|
|
31
|
+
element.indicatorsField = indicatorsField;
|
|
32
|
+
if (menuField !== undefined)
|
|
33
|
+
element.menuField = menuField;
|
|
34
|
+
if (hasCampaignField !== undefined)
|
|
35
|
+
element.hasCampaignField = hasCampaignField;
|
|
36
|
+
if (visible !== undefined)
|
|
37
|
+
element.visible = visible;
|
|
38
|
+
if (form !== undefined)
|
|
39
|
+
element.form = form;
|
|
40
|
+
if (uid !== undefined)
|
|
41
|
+
element.uid = uid;
|
|
42
|
+
if (showTitle !== undefined)
|
|
43
|
+
element.showTitle = showTitle;
|
|
44
|
+
if (renderTitle !== undefined)
|
|
45
|
+
element.renderTitle = renderTitle;
|
|
46
|
+
if (layoutType !== undefined)
|
|
47
|
+
element.layoutType = layoutType;
|
|
48
|
+
if (isActive !== undefined)
|
|
49
|
+
element.isActive = isActive;
|
|
50
|
+
if (sizeLimitMB !== undefined)
|
|
51
|
+
element.sizeLimitMB = sizeLimitMB;
|
|
52
|
+
if (acceptImagesType !== undefined)
|
|
53
|
+
element.acceptImagesType = acceptImagesType;
|
|
54
|
+
if (handleActions !== undefined)
|
|
55
|
+
element.handleActions = handleActions;
|
|
56
|
+
if (hint !== undefined)
|
|
57
|
+
element.hint = hint;
|
|
58
|
+
}, [keyProp, srcLarge, src, options, label, mandatory, disabled, readonly, xAlignment, rowSpan, indicatorsField, menuField, hasCampaignField, visible, form, uid, showTitle, renderTitle, layoutType, isActive, sizeLimitMB, acceptImagesType, handleActions, hint]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const element = elementRef.current;
|
|
61
|
+
if (!element)
|
|
62
|
+
return;
|
|
63
|
+
// Event listeners
|
|
64
|
+
const handleChooseFile = () => onChooseFile === null || onChooseFile === void 0 ? void 0 : onChooseFile();
|
|
65
|
+
const handleFileChange = (e) => onFileChange === null || onFileChange === void 0 ? void 0 : onFileChange(e.detail);
|
|
66
|
+
const handleElementClick = (e) => onElementClick === null || onElementClick === void 0 ? void 0 : onElementClick(e.detail);
|
|
67
|
+
const handleValidationChange = (e) => onValidationChange === null || onValidationChange === void 0 ? void 0 : onValidationChange(e.detail);
|
|
68
|
+
if (onChooseFile)
|
|
69
|
+
element.addEventListener('chooseFile', handleChooseFile);
|
|
70
|
+
if (onFileChange)
|
|
71
|
+
element.addEventListener('fileChange', handleFileChange);
|
|
72
|
+
if (onElementClick)
|
|
73
|
+
element.addEventListener('elementClick', handleElementClick);
|
|
74
|
+
if (onValidationChange)
|
|
75
|
+
element.addEventListener('validationChange', handleValidationChange);
|
|
76
|
+
return () => {
|
|
77
|
+
if (onChooseFile)
|
|
78
|
+
element.removeEventListener('chooseFile', handleChooseFile);
|
|
79
|
+
if (onFileChange)
|
|
80
|
+
element.removeEventListener('fileChange', handleFileChange);
|
|
81
|
+
if (onElementClick)
|
|
82
|
+
element.removeEventListener('elementClick', handleElementClick);
|
|
83
|
+
if (onValidationChange)
|
|
84
|
+
element.removeEventListener('validationChange', handleValidationChange);
|
|
85
|
+
};
|
|
86
|
+
}, [onChooseFile, onFileChange, onElementClick, onValidationChange]);
|
|
87
|
+
return _jsx("pep-image-element", { ref: elementRef });
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=pep-image.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PepImagesFilmstripProps {
|
|
3
|
+
keyProp?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
xAlignment?: 'start' | 'center' | 'end';
|
|
7
|
+
rowSpan?: number;
|
|
8
|
+
form?: any;
|
|
9
|
+
uid?: string;
|
|
10
|
+
showTitle?: boolean;
|
|
11
|
+
renderTitle?: boolean;
|
|
12
|
+
layoutType?: 'form' | 'table' | 'card';
|
|
13
|
+
currIndex?: number;
|
|
14
|
+
showThumbnails?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const PepImagesFilmstrip: React.FC<PepImagesFilmstripProps>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
export const PepImagesFilmstrip = ({ keyProp, value, label, xAlignment, rowSpan, form, uid, showTitle, renderTitle, layoutType, currIndex, showThumbnails, }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Defer property setting to ensure Angular component initialization completes
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
if (keyProp !== undefined)
|
|
12
|
+
element.key = keyProp;
|
|
13
|
+
if (value !== undefined)
|
|
14
|
+
element.value = value;
|
|
15
|
+
if (label !== undefined)
|
|
16
|
+
element.label = label;
|
|
17
|
+
if (xAlignment !== undefined)
|
|
18
|
+
element.xAlignment = xAlignment;
|
|
19
|
+
if (rowSpan !== undefined)
|
|
20
|
+
element.rowSpan = rowSpan;
|
|
21
|
+
if (form !== undefined)
|
|
22
|
+
element.form = form;
|
|
23
|
+
if (uid !== undefined)
|
|
24
|
+
element.uid = uid;
|
|
25
|
+
if (showTitle !== undefined)
|
|
26
|
+
element.showTitle = showTitle;
|
|
27
|
+
if (renderTitle !== undefined)
|
|
28
|
+
element.renderTitle = renderTitle;
|
|
29
|
+
if (layoutType !== undefined)
|
|
30
|
+
element.layoutType = layoutType;
|
|
31
|
+
if (currIndex !== undefined)
|
|
32
|
+
element.currIndex = currIndex;
|
|
33
|
+
if (showThumbnails !== undefined)
|
|
34
|
+
element.showThumbnails = showThumbnails;
|
|
35
|
+
console.log('PepImagesFilmstrip properties set:', { value, label, showThumbnails, currIndex, showTitle, renderTitle });
|
|
36
|
+
}, 0);
|
|
37
|
+
}, [keyProp, value, label, xAlignment, rowSpan, form, uid, showTitle, renderTitle, layoutType, currIndex, showThumbnails]);
|
|
38
|
+
return _jsx("pep-images-filmstrip-element", { ref: elementRef });
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=pep-images-filmstrip.js.map
|
package/pep-link.d.ts
CHANGED
|
@@ -10,6 +10,15 @@ export interface PepLinkProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
10
10
|
maxFieldCharacters?: number;
|
|
11
11
|
textColor?: string;
|
|
12
12
|
rowSpan?: number;
|
|
13
|
+
xAlignment?: string;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
form?: any;
|
|
16
|
+
isActive?: boolean;
|
|
17
|
+
showTitle?: boolean;
|
|
18
|
+
renderTitle?: boolean;
|
|
19
|
+
renderError?: boolean;
|
|
20
|
+
renderSymbol?: boolean;
|
|
21
|
+
layoutType?: string;
|
|
13
22
|
onValueChange?: (value: string) => void;
|
|
14
23
|
onElementClick?: (e: any) => void;
|
|
15
24
|
onKeyup?: (e: any) => void;
|
package/pep-link.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
export const PepLink = ({ keyProp, value, label, placeholder, mandatory, disabled, readonly, maxFieldCharacters, textColor, rowSpan, onValueChange, onElementClick, onKeyup, onValidationChange, className, ...rest }) => {
|
|
3
|
+
export const PepLink = ({ keyProp, value, label, placeholder, mandatory, disabled, readonly, maxFieldCharacters, textColor, rowSpan, xAlignment, visible, form, isActive, showTitle, renderTitle, renderError, renderSymbol, layoutType, onValueChange, onElementClick, onKeyup, onValidationChange, className, ...rest }) => {
|
|
4
4
|
const ref = useRef(null);
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
const el = ref.current;
|
|
@@ -20,7 +20,25 @@ export const PepLink = ({ keyProp, value, label, placeholder, mandatory, disable
|
|
|
20
20
|
el.textColor = textColor;
|
|
21
21
|
if (typeof rowSpan !== 'undefined')
|
|
22
22
|
el.rowSpan = rowSpan;
|
|
23
|
-
|
|
23
|
+
if (typeof xAlignment !== 'undefined')
|
|
24
|
+
el.xAlignment = xAlignment;
|
|
25
|
+
if (typeof visible !== 'undefined')
|
|
26
|
+
el.visible = !!visible;
|
|
27
|
+
if (typeof form !== 'undefined')
|
|
28
|
+
el.form = form;
|
|
29
|
+
if (typeof isActive !== 'undefined')
|
|
30
|
+
el.isActive = !!isActive;
|
|
31
|
+
if (typeof showTitle !== 'undefined')
|
|
32
|
+
el.showTitle = !!showTitle;
|
|
33
|
+
if (typeof renderTitle !== 'undefined')
|
|
34
|
+
el.renderTitle = !!renderTitle;
|
|
35
|
+
if (typeof renderError !== 'undefined')
|
|
36
|
+
el.renderError = !!renderError;
|
|
37
|
+
if (typeof renderSymbol !== 'undefined')
|
|
38
|
+
el.renderSymbol = !!renderSymbol;
|
|
39
|
+
if (typeof layoutType !== 'undefined')
|
|
40
|
+
el.layoutType = layoutType;
|
|
41
|
+
}, [keyProp, mandatory, disabled, readonly, maxFieldCharacters, textColor, rowSpan, xAlignment, visible, form, isActive, showTitle, renderTitle, renderError, renderSymbol, layoutType]);
|
|
24
42
|
useEffect(() => {
|
|
25
43
|
const el = ref.current;
|
|
26
44
|
if (!el)
|
|
@@ -37,6 +55,6 @@ export const PepLink = ({ keyProp, value, label, placeholder, mandatory, disable
|
|
|
37
55
|
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
38
56
|
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
39
57
|
}, [onValueChange, onElementClick, onKeyup, onValidationChange]);
|
|
40
|
-
return (_jsx("pep-link", { ref: ref, className: className, value: value, label: label, placeholder: placeholder, ...rest }));
|
|
58
|
+
return (_jsx("pep-link-element", { ref: ref, className: className, value: value, label: label, placeholder: placeholder, ...rest }, keyProp));
|
|
41
59
|
};
|
|
42
60
|
//# sourceMappingURL=pep-link.js.map
|
package/pep-menu.js
CHANGED
|
@@ -45,6 +45,6 @@ export const PepMenu = ({ text, iconName, iconPosition, type, styleType, sizeTyp
|
|
|
45
45
|
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
46
46
|
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
47
47
|
}, [onStateChange, onMenuItemClick, onMenuClick]);
|
|
48
|
-
return (_jsx("pep-menu", { ref: ref, className: className, text: text, "icon-name": iconName, "icon-position": iconPosition, type: type, "style-type": styleType, "size-type": sizeType, "x-position": xPosition, ...rest }));
|
|
48
|
+
return (_jsx("pep-menu-element", { ref: ref, className: className, text: text, "icon-name": iconName, "icon-position": iconPosition, type: type, "style-type": styleType, "size-type": sizeType, "x-position": xPosition, ...rest }));
|
|
49
49
|
};
|
|
50
50
|
//# sourceMappingURL=pep-menu.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface PepPageLayoutProps {
|
|
3
|
+
addPadding?: boolean;
|
|
4
|
+
showShadow?: boolean;
|
|
5
|
+
headerArea?: React.ReactNode;
|
|
6
|
+
sideArea?: React.ReactNode;
|
|
7
|
+
topArea?: React.ReactNode;
|
|
8
|
+
mainArea?: React.ReactNode;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const PepPageLayout: React.FC<PepPageLayoutProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
export const PepPageLayout = ({ addPadding = false, showShadow = false, headerArea, sideArea, topArea, mainArea, children }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Use setTimeout to ensure the element is ready for property setting
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
if (addPadding !== undefined)
|
|
12
|
+
element.addPadding = addPadding;
|
|
13
|
+
if (showShadow !== undefined)
|
|
14
|
+
element.showShadow = showShadow;
|
|
15
|
+
}, 0);
|
|
16
|
+
}, [addPadding, showShadow]);
|
|
17
|
+
return (_jsxs("pep-page-layout-element", { ref: elementRef, children: [headerArea && _jsx("div", { "pep-header-area": "", children: headerArea }), sideArea && _jsx("div", { "pep-side-area": "", children: sideArea }), topArea && _jsx("div", { "pep-top-area": "", children: topArea }), mainArea && _jsx("div", { "pep-main-area": "", children: mainArea }), children] }));
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=pep-page-layout.js.map
|
package/pep-quantity-selector.js
CHANGED
|
@@ -55,6 +55,6 @@ export const PepQuantitySelector = ({ keyProp, value, label, type, mandatory, di
|
|
|
55
55
|
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
56
56
|
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
57
57
|
}, [onValueChange, onElementClick, onValidationChange]);
|
|
58
|
-
return (_jsx("pep-quantity-selector", { ref: ref, className: className, label: label, type: type, ...rest }));
|
|
58
|
+
return (_jsx("pep-quantity-selector-element", { ref: ref, className: className, label: label, type: type, ...rest }));
|
|
59
59
|
};
|
|
60
60
|
//# sourceMappingURL=pep-quantity-selector.js.map
|
package/pep-search.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PepSearchTriggerType = 'keydown' | 'click';
|
|
3
|
+
export declare type PepSearchShrinkType = 'small-screen' | 'always' | 'never';
|
|
4
|
+
export declare type PepSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
export interface PepSearchClickEvent {
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PepSearchAutocompleteChangeEvent {
|
|
9
|
+
value: string;
|
|
10
|
+
top: number;
|
|
11
|
+
}
|
|
12
|
+
export interface PepSearchStateChangeEvent {
|
|
13
|
+
state: 'open' | 'close';
|
|
14
|
+
}
|
|
15
|
+
export interface PepSearchProps {
|
|
16
|
+
triggerOn?: PepSearchTriggerType;
|
|
17
|
+
autoCompleteTop?: number;
|
|
18
|
+
autoCompleteValues?: any[];
|
|
19
|
+
shrink?: PepSearchShrinkType;
|
|
20
|
+
value?: string;
|
|
21
|
+
useAsWebComponent?: boolean;
|
|
22
|
+
sizeType?: PepSizeType;
|
|
23
|
+
onSearch?: (event: PepSearchClickEvent) => void;
|
|
24
|
+
onAutocompleteChange?: (event: PepSearchAutocompleteChangeEvent) => void;
|
|
25
|
+
onStateChange?: (event: PepSearchStateChangeEvent) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare const PepSearch: React.FC<PepSearchProps>;
|
package/pep-search.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
export const PepSearch = ({ triggerOn, autoCompleteTop, autoCompleteValues, shrink, value, useAsWebComponent, sizeType, onSearch, onAutocompleteChange, onStateChange, }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Defer property setting to ensure Angular component initialization completes
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
try {
|
|
12
|
+
if (element) {
|
|
13
|
+
if (triggerOn !== undefined)
|
|
14
|
+
element.triggerOn = triggerOn;
|
|
15
|
+
if (autoCompleteTop !== undefined)
|
|
16
|
+
element.autoCompleteTop = autoCompleteTop;
|
|
17
|
+
if (autoCompleteValues !== undefined)
|
|
18
|
+
element.autoCompleteValues = autoCompleteValues;
|
|
19
|
+
if (shrink !== undefined)
|
|
20
|
+
element.shrink = shrink;
|
|
21
|
+
if (value !== undefined)
|
|
22
|
+
element.value = value;
|
|
23
|
+
if (useAsWebComponent !== undefined)
|
|
24
|
+
element.useAsWebComponent = useAsWebComponent;
|
|
25
|
+
if (sizeType !== undefined)
|
|
26
|
+
element.sizeType = sizeType;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error('Error setting PepSearch properties:', error);
|
|
31
|
+
}
|
|
32
|
+
}, 100);
|
|
33
|
+
}, [triggerOn, autoCompleteTop, autoCompleteValues, shrink, value, useAsWebComponent, sizeType]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
const element = elementRef.current;
|
|
36
|
+
if (!element)
|
|
37
|
+
return;
|
|
38
|
+
// Event listeners
|
|
39
|
+
const handleSearch = (event) => {
|
|
40
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(event.detail);
|
|
41
|
+
};
|
|
42
|
+
const handleAutocompleteChange = (event) => {
|
|
43
|
+
onAutocompleteChange === null || onAutocompleteChange === void 0 ? void 0 : onAutocompleteChange(event.detail);
|
|
44
|
+
};
|
|
45
|
+
const handleStateChange = (event) => {
|
|
46
|
+
onStateChange === null || onStateChange === void 0 ? void 0 : onStateChange(event.detail);
|
|
47
|
+
};
|
|
48
|
+
element.addEventListener('search', handleSearch);
|
|
49
|
+
element.addEventListener('autocompleteChange', handleAutocompleteChange);
|
|
50
|
+
element.addEventListener('stateChange', handleStateChange);
|
|
51
|
+
return () => {
|
|
52
|
+
element.removeEventListener('search', handleSearch);
|
|
53
|
+
element.removeEventListener('autocompleteChange', handleAutocompleteChange);
|
|
54
|
+
element.removeEventListener('stateChange', handleStateChange);
|
|
55
|
+
};
|
|
56
|
+
}, [onSearch, onAutocompleteChange, onStateChange]);
|
|
57
|
+
return _jsx("pep-search-element", { ref: elementRef });
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=pep-search.js.map
|
package/pep-select.d.ts
CHANGED
|
@@ -14,6 +14,20 @@ export interface PepSelectProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
14
14
|
mandatory?: boolean;
|
|
15
15
|
options?: PepOption[];
|
|
16
16
|
addValueToOptionsIfNotExist?: boolean;
|
|
17
|
+
xAlignment?: string;
|
|
18
|
+
rowSpan?: number;
|
|
19
|
+
placeholderWhenDisabled?: string;
|
|
20
|
+
autoSortOptions?: boolean;
|
|
21
|
+
visible?: boolean;
|
|
22
|
+
emptyOption?: boolean;
|
|
23
|
+
form?: any;
|
|
24
|
+
layoutType?: string;
|
|
25
|
+
parentFieldKey?: string | null;
|
|
26
|
+
isActive?: boolean;
|
|
27
|
+
showTitle?: boolean;
|
|
28
|
+
renderTitle?: boolean;
|
|
29
|
+
typeaheadDebounceInterval?: number;
|
|
17
30
|
onValueChange?: (value: string) => void;
|
|
31
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
18
32
|
}
|
|
19
33
|
export declare const PepSelect: React.FC<PepSelectProps>;
|
package/pep-select.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
export const PepSelect = ({ keyProp, value, label, placeholder, type, disabled, readonly, mandatory, options, addValueToOptionsIfNotExist, onValueChange, ...rest }) => {
|
|
3
|
+
export const PepSelect = ({ keyProp, value, label, placeholder, type, disabled, readonly, mandatory, options, addValueToOptionsIfNotExist, xAlignment, rowSpan, placeholderWhenDisabled, autoSortOptions, visible, emptyOption, form, layoutType, parentFieldKey, isActive, showTitle, renderTitle, typeaheadDebounceInterval, onValueChange, onValidationChange, ...rest }) => {
|
|
4
4
|
const ref = useRef(null);
|
|
5
5
|
// Sync complex props via properties
|
|
6
6
|
useEffect(() => {
|
|
@@ -11,7 +11,49 @@ export const PepSelect = ({ keyProp, value, label, placeholder, type, disabled,
|
|
|
11
11
|
el.options = options;
|
|
12
12
|
if (typeof addValueToOptionsIfNotExist !== 'undefined')
|
|
13
13
|
el.addValueToOptionsIfNotExist = !!addValueToOptionsIfNotExist;
|
|
14
|
-
|
|
14
|
+
if (typeof xAlignment !== 'undefined')
|
|
15
|
+
el.xAlignment = xAlignment;
|
|
16
|
+
if (typeof rowSpan !== 'undefined')
|
|
17
|
+
el.rowSpan = rowSpan;
|
|
18
|
+
if (typeof placeholderWhenDisabled !== 'undefined')
|
|
19
|
+
el.placeholderWhenDisabled = placeholderWhenDisabled;
|
|
20
|
+
if (typeof autoSortOptions !== 'undefined')
|
|
21
|
+
el.autoSortOptions = !!autoSortOptions;
|
|
22
|
+
if (typeof visible !== 'undefined')
|
|
23
|
+
el.visible = !!visible;
|
|
24
|
+
if (typeof emptyOption !== 'undefined')
|
|
25
|
+
el.emptyOption = !!emptyOption;
|
|
26
|
+
if (typeof form !== 'undefined')
|
|
27
|
+
el.form = form;
|
|
28
|
+
if (typeof layoutType !== 'undefined')
|
|
29
|
+
el.layoutType = layoutType;
|
|
30
|
+
if (typeof parentFieldKey !== 'undefined')
|
|
31
|
+
el.parentFieldKey = parentFieldKey;
|
|
32
|
+
if (typeof isActive !== 'undefined')
|
|
33
|
+
el.isActive = !!isActive;
|
|
34
|
+
if (typeof showTitle !== 'undefined')
|
|
35
|
+
el.showTitle = !!showTitle;
|
|
36
|
+
if (typeof renderTitle !== 'undefined')
|
|
37
|
+
el.renderTitle = !!renderTitle;
|
|
38
|
+
if (typeof typeaheadDebounceInterval !== 'undefined')
|
|
39
|
+
el.typeaheadDebounceInterval = typeaheadDebounceInterval;
|
|
40
|
+
}, [
|
|
41
|
+
options,
|
|
42
|
+
addValueToOptionsIfNotExist,
|
|
43
|
+
xAlignment,
|
|
44
|
+
rowSpan,
|
|
45
|
+
placeholderWhenDisabled,
|
|
46
|
+
autoSortOptions,
|
|
47
|
+
visible,
|
|
48
|
+
emptyOption,
|
|
49
|
+
form,
|
|
50
|
+
layoutType,
|
|
51
|
+
parentFieldKey,
|
|
52
|
+
isActive,
|
|
53
|
+
showTitle,
|
|
54
|
+
renderTitle,
|
|
55
|
+
typeaheadDebounceInterval,
|
|
56
|
+
]);
|
|
15
57
|
// Sync booleans via properties to be safe
|
|
16
58
|
useEffect(() => {
|
|
17
59
|
const el = ref.current;
|
|
@@ -27,13 +69,19 @@ export const PepSelect = ({ keyProp, value, label, placeholder, type, disabled,
|
|
|
27
69
|
// Events
|
|
28
70
|
useEffect(() => {
|
|
29
71
|
const el = ref.current;
|
|
30
|
-
if (!el
|
|
72
|
+
if (!el)
|
|
31
73
|
return;
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
74
|
+
const handlers = [];
|
|
75
|
+
if (onValueChange) {
|
|
76
|
+
handlers.push(['valueChange', (e) => { var _a, _b; return onValueChange((_a = e.detail) !== null && _a !== void 0 ? _a : (_b = e.target) === null || _b === void 0 ? void 0 : _b.value); }]);
|
|
77
|
+
}
|
|
78
|
+
if (onValidationChange) {
|
|
79
|
+
handlers.push(['validationChange', (e) => { var _a, _b; return onValidationChange(!!((_a = e.detail) !== null && _a !== void 0 ? _a : (_b = e.target) === null || _b === void 0 ? void 0 : _b.value)); }]);
|
|
80
|
+
}
|
|
81
|
+
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
82
|
+
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
83
|
+
}, [onValueChange, onValidationChange]);
|
|
84
|
+
return (_jsx("pep-select-element", { ref: ref,
|
|
37
85
|
// attributes (strings)
|
|
38
86
|
value: value, label: label, placeholder: placeholder, type: type, ...rest }, keyProp));
|
|
39
87
|
};
|
package/pep-separator.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export interface PepSeparatorProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
4
4
|
label?: string;
|
|
5
5
|
xAlignment?: 'start' | 'center' | 'end' | string;
|
|
6
6
|
visible?: boolean;
|
|
7
|
+
form?: unknown;
|
|
8
|
+
layoutType?: 'form' | 'table' | 'card' | string;
|
|
7
9
|
}
|
|
8
10
|
export declare const PepSeparator: React.FC<PepSeparatorProps>;
|
package/pep-separator.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
export const PepSeparator = ({ keyProp, label, xAlignment, visible, className, ...rest }) => {
|
|
3
|
+
export const PepSeparator = ({ keyProp, label, xAlignment, visible, form, layoutType, className, ...rest }) => {
|
|
4
4
|
const ref = useRef(null);
|
|
5
5
|
useEffect(() => {
|
|
6
6
|
const el = ref.current;
|
|
@@ -12,7 +12,11 @@ export const PepSeparator = ({ keyProp, label, xAlignment, visible, className, .
|
|
|
12
12
|
el.xAlignment = xAlignment;
|
|
13
13
|
if (typeof visible !== 'undefined')
|
|
14
14
|
el.visible = !!visible;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
if (typeof form !== 'undefined')
|
|
16
|
+
el.form = form;
|
|
17
|
+
if (typeof layoutType !== 'undefined')
|
|
18
|
+
el.layoutType = layoutType;
|
|
19
|
+
}, [keyProp, xAlignment, visible, form, layoutType]);
|
|
20
|
+
return (_jsx("pep-separator-element", { ref: ref, className: className, label: label, ...rest }));
|
|
17
21
|
};
|
|
18
22
|
//# sourceMappingURL=pep-separator.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare type PepSkeletonSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'max';
|
|
3
|
+
export interface PepSkeletonLoaderProps {
|
|
4
|
+
rowHeightType?: PepSkeletonSizeType;
|
|
5
|
+
rowsNumber?: number;
|
|
6
|
+
lastRowOffset?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const PepSkeletonLoader: React.FC<PepSkeletonLoaderProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
export const PepSkeletonLoader = ({ rowHeightType = 'md', rowsNumber = 3, lastRowOffset = true, }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Wait for custom element to be fully upgraded
|
|
10
|
+
const setProperties = () => {
|
|
11
|
+
try {
|
|
12
|
+
if (element && element.rowHeightType !== undefined) {
|
|
13
|
+
element.rowHeightType = rowHeightType;
|
|
14
|
+
element.rowsNumber = rowsNumber;
|
|
15
|
+
element.lastRowOffset = lastRowOffset;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
// If not ready, try again
|
|
19
|
+
setTimeout(setProperties, 50);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
console.error('Error setting PepSkeletonLoader properties:', error);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
setTimeout(setProperties, 100);
|
|
27
|
+
}, [rowHeightType, rowsNumber, lastRowOffset]);
|
|
28
|
+
return _jsx("pep-skeleton-loader-element", { ref: elementRef });
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=pep-skeleton-loader.js.map
|
package/pep-slider.js
CHANGED
|
@@ -35,6 +35,6 @@ export const PepSlider = ({ label, disabled, hint, background, step, minValue, m
|
|
|
35
35
|
handlers.forEach(([n, h]) => el.addEventListener(n, h));
|
|
36
36
|
return () => handlers.forEach(([n, h]) => el.removeEventListener(n, h));
|
|
37
37
|
}, [onValueChange, onInputChange]);
|
|
38
|
-
return (_jsx("pep-slider", { ref: ref, className: className, label: label, ...rest }));
|
|
38
|
+
return (_jsx("pep-slider-element", { ref: ref, className: className, label: label, ...rest }));
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=pep-slider.js.map
|
package/pep-snack-bar.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from 'react';
|
|
3
|
+
export const PepSnackBar = ({ snackBarRef, title, onCloseClick, }) => {
|
|
4
|
+
const elementRef = useRef(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
const element = elementRef.current;
|
|
7
|
+
if (!element)
|
|
8
|
+
return;
|
|
9
|
+
// Defer property setting to ensure Angular component initialization completes
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
if (snackBarRef !== undefined)
|
|
12
|
+
element.snackBarRef = snackBarRef;
|
|
13
|
+
if (title !== undefined)
|
|
14
|
+
element.title = title;
|
|
15
|
+
console.log('PepSnackBar properties set:', { snackBarRef, title });
|
|
16
|
+
}, 0);
|
|
17
|
+
}, [snackBarRef, title]);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const element = elementRef.current;
|
|
20
|
+
if (!element)
|
|
21
|
+
return;
|
|
22
|
+
// Event listeners
|
|
23
|
+
const handleCloseClick = (event) => {
|
|
24
|
+
onCloseClick === null || onCloseClick === void 0 ? void 0 : onCloseClick();
|
|
25
|
+
};
|
|
26
|
+
element.addEventListener('closeClick', handleCloseClick);
|
|
27
|
+
return () => {
|
|
28
|
+
element.removeEventListener('closeClick', handleCloseClick);
|
|
29
|
+
};
|
|
30
|
+
}, [onCloseClick]);
|
|
31
|
+
return _jsx("pep-snack-bar-element", { ref: elementRef });
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=pep-snack-bar.js.map
|
package/pep-textarea.d.ts
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface PepTextareaProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
|
+
keyProp?: string;
|
|
3
4
|
value?: string;
|
|
4
5
|
label?: string;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
readonly?: boolean;
|
|
9
|
+
mandatory?: boolean;
|
|
10
|
+
maxFieldCharacters?: number;
|
|
11
|
+
textColor?: string;
|
|
12
|
+
xAlignment?: string;
|
|
13
|
+
rowSpan?: number;
|
|
14
|
+
visible?: boolean;
|
|
15
|
+
form?: any;
|
|
16
|
+
isActive?: boolean;
|
|
17
|
+
showTitle?: boolean;
|
|
18
|
+
renderTitle?: boolean;
|
|
19
|
+
layoutType?: string;
|
|
8
20
|
rows?: number;
|
|
9
21
|
onValueChange?: (value: any) => void;
|
|
22
|
+
onKeyup?: (e: any) => void;
|
|
23
|
+
onValidationChange?: (isValid: boolean) => void;
|
|
10
24
|
}
|
|
11
25
|
export declare const PepTextarea: React.FC<PepTextareaProps>;
|