@pepperi-addons/ngx-composite-lib-react 0.0.1 → 0.0.3
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/components/PepGroupButtonsSettings.d.ts +14 -0
- package/components/PepGroupButtonsSettings.js +19 -0
- package/components/PepGroupButtonsSettingsReact.d.ts +14 -0
- package/components/PepGroupButtonsSettingsReact.js +63 -0
- package/elements/3rdpartylicenses.txt +641 -0
- package/elements/971.js +1 -0
- package/elements/index.html +10 -0
- package/elements/main.js +1 -0
- package/elements/polyfills.js +1 -0
- package/elements/register.auto.js +1 -0
- package/elements/register.js +1 -0
- package/elements/register.polyfills.js +1 -0
- package/elements/register.runtime.js +1 -0
- package/elements/runtime.js +1 -0
- package/elements/styles.css +1 -0
- package/index.d.ts +19 -0
- package/index.js +20 -0
- package/package.json +12 -7
- package/pep-color-settings.d.ts +4 -0
- package/pep-color-settings.js +3 -0
- package/pep-data-view-builder.d.ts +4 -0
- package/pep-data-view-builder.js +3 -0
- package/pep-field-container.d.ts +4 -0
- package/pep-field-container.js +3 -0
- package/pep-file-status-panel.d.ts +4 -0
- package/pep-file-status-panel.js +3 -0
- package/pep-flow-picker-button.d.ts +4 -0
- package/pep-flow-picker-button.js +3 -0
- package/pep-generic-form.d.ts +4 -0
- package/pep-generic-form.js +3 -0
- package/pep-generic-list.d.ts +4 -0
- package/pep-generic-list.js +3 -0
- package/pep-group-buttons-settings-react.d.ts +14 -0
- package/pep-group-buttons-settings-react.js +62 -0
- package/pep-group-buttons-settings.d.ts +4 -0
- package/pep-group-buttons-settings.js +3 -0
- package/pep-icon-picker.d.ts +4 -0
- package/pep-icon-picker.js +3 -0
- package/pep-layout-builder-editor.d.ts +4 -0
- package/pep-layout-builder-editor.js +3 -0
- package/pep-layout-builder.d.ts +4 -0
- package/pep-layout-builder.js +3 -0
- package/pep-layout.d.ts +4 -0
- package/pep-layout.js +3 -0
- package/pep-manage-parameters.d.ts +4 -0
- package/pep-manage-parameters.js +3 -0
- package/pep-mapping-parameters.d.ts +4 -0
- package/pep-mapping-parameters.js +3 -0
- package/pep-padding-settings.d.ts +4 -0
- package/pep-padding-settings.js +3 -0
- package/pep-rich-text.d.ts +4 -0
- package/pep-rich-text.js +3 -0
- package/pep-shadow-settings.d.ts +4 -0
- package/pep-shadow-settings.js +3 -0
- package/pep-show-if-badge.d.ts +4 -0
- package/pep-show-if-badge.js +3 -0
- package/utils/create-wrapper.d.ts +7 -0
- package/utils/create-wrapper.js +46 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
export interface PepGroupButtonsSettingsProps {
|
|
3
|
+
pepResetConfigurationField?: string;
|
|
4
|
+
hideReset?: boolean;
|
|
5
|
+
resetHostEvents?: (evt: any) => void;
|
|
6
|
+
groupType: 'sizes' | 'custom' | 'vertical-align' | 'left-right-arrows' | 'horizontal-align' | 'font-weight' | 'width-sizes' | 'boolean';
|
|
7
|
+
subHeader?: string;
|
|
8
|
+
btnKey?: string;
|
|
9
|
+
useNone?: boolean;
|
|
10
|
+
excludeKeys?: string[];
|
|
11
|
+
btnsArray?: any[];
|
|
12
|
+
onBtnKeyChange?: (e: any) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function PepGroupButtonsSettings(props: PepGroupButtonsSettingsProps): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
// Runtime import; types are shimed locally to avoid adding a build-time dependency
|
|
4
|
+
// Consumers must have '@pepperi-addons/ngx-lib-react' installed (peerDependency)
|
|
5
|
+
import { PepGroupButtons } from '@pepperi-addons/ngx-lib-react';
|
|
6
|
+
export function PepGroupButtonsSettings(props) {
|
|
7
|
+
const { pepResetConfigurationField, hideReset, resetHostEvents, groupType, subHeader, btnKey, useNone, excludeKeys, btnsArray, onBtnKeyChange, } = props;
|
|
8
|
+
const onReset = React.useCallback(() => {
|
|
9
|
+
if (pepResetConfigurationField && typeof resetHostEvents === 'function') {
|
|
10
|
+
resetHostEvents({
|
|
11
|
+
action: 'set-configuration-field',
|
|
12
|
+
key: pepResetConfigurationField,
|
|
13
|
+
value: undefined,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}, [pepResetConfigurationField, resetHostEvents]);
|
|
17
|
+
return (_jsxs("div", { children: [subHeader ? _jsx("div", { className: "pep-subheader", children: subHeader }) : null, _jsx(PepGroupButtons, { ...{ groupType, btnKey, useNone, excludeKeys, btnsArray }, onBtnKeyChange: onBtnKeyChange }), !hideReset ? (_jsx("button", { type: "button", onClick: onReset, children: "Reset" })) : null] }));
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=PepGroupButtonsSettings.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" resolution-mode="require"/>
|
|
2
|
+
export interface PepGroupButtonsSettingsReactProps {
|
|
3
|
+
pepResetConfigurationField?: string;
|
|
4
|
+
hideReset?: boolean;
|
|
5
|
+
resetHostEvents?: (evt: any) => void;
|
|
6
|
+
groupType: 'sizes' | 'custom' | 'vertical-align' | 'left-right-arrows' | 'horizontal-align' | 'font-weight' | 'width-sizes' | 'boolean';
|
|
7
|
+
subHeader?: string;
|
|
8
|
+
btnKey?: string;
|
|
9
|
+
useNone?: boolean;
|
|
10
|
+
excludeKeys?: string[];
|
|
11
|
+
btnsArray?: any[];
|
|
12
|
+
onBtnKeyChange?: (e: any) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function PepGroupButtonsSettingsReact(props: PepGroupButtonsSettingsReactProps): JSX.Element;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { PepGroupButtons } from '@pepperi-addons/ngx-lib-react';
|
|
4
|
+
export function PepGroupButtonsSettingsReact(props) {
|
|
5
|
+
const { pepResetConfigurationField, hideReset, resetHostEvents, groupType, subHeader, btnKey, useNone, excludeKeys, btnsArray, onBtnKeyChange, } = props;
|
|
6
|
+
const onReset = React.useCallback(() => {
|
|
7
|
+
if (pepResetConfigurationField && typeof resetHostEvents === 'function') {
|
|
8
|
+
resetHostEvents({
|
|
9
|
+
action: 'set-configuration-field',
|
|
10
|
+
key: pepResetConfigurationField,
|
|
11
|
+
value: undefined,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}, [pepResetConfigurationField, resetHostEvents]);
|
|
15
|
+
// Build items for the base group-buttons element so the shim can render real visuals
|
|
16
|
+
const computedItems = React.useMemo(() => {
|
|
17
|
+
const arr = [];
|
|
18
|
+
switch (groupType) {
|
|
19
|
+
case 'custom':
|
|
20
|
+
(btnsArray || []).forEach((b) => {
|
|
21
|
+
if (!b)
|
|
22
|
+
return;
|
|
23
|
+
if (typeof b === 'string')
|
|
24
|
+
arr.push({ key: b, value: b });
|
|
25
|
+
else
|
|
26
|
+
arr.push(b);
|
|
27
|
+
});
|
|
28
|
+
break;
|
|
29
|
+
case 'sizes':
|
|
30
|
+
arr.push({ key: 'xs', value: 'XS' }, { key: 'sm', value: 'SM' }, { key: 'md', value: 'MD' }, { key: 'lg', value: 'LG' }, { key: 'xl', value: 'XL' }, { key: '2xl', value: '2XL' });
|
|
31
|
+
break;
|
|
32
|
+
case 'vertical-align':
|
|
33
|
+
arr.push({ key: 'start', value: 'Top' }, { key: 'middle', value: 'Middle' }, { key: 'end', value: 'Bottom' });
|
|
34
|
+
break;
|
|
35
|
+
case 'left-right-arrows':
|
|
36
|
+
arr.push({ key: 'left', iconName: 'arrow_left_alt' }, { key: 'right', iconName: 'arrow_right_alt' });
|
|
37
|
+
break;
|
|
38
|
+
case 'horizontal-align':
|
|
39
|
+
arr.push({ key: 'left', iconName: 'text_align_right' }, { key: 'center', iconName: 'text_align_center' }, { key: 'right', iconName: 'text_align_left' });
|
|
40
|
+
break;
|
|
41
|
+
case 'font-weight':
|
|
42
|
+
arr.push({ key: 'regular', value: 'Regular' }, { key: 'bold', value: 'Bold' }, { key: 'bolder', value: 'Bolder' });
|
|
43
|
+
break;
|
|
44
|
+
case 'width-sizes':
|
|
45
|
+
arr.push({ key: 'narrow', value: 'Narrow' }, { key: 'regular', value: 'Regular' }, { key: 'wide', value: 'Wide' });
|
|
46
|
+
break;
|
|
47
|
+
case 'boolean':
|
|
48
|
+
arr.push({ key: 'true', value: 'True' }, { key: 'false', value: 'False' });
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
let filtered = Array.isArray(excludeKeys) && excludeKeys.length
|
|
54
|
+
? arr.filter((i) => !excludeKeys.includes(i.key))
|
|
55
|
+
: arr;
|
|
56
|
+
if (useNone) {
|
|
57
|
+
filtered = [{ key: 'none', value: 'None' }, ...filtered];
|
|
58
|
+
}
|
|
59
|
+
return filtered;
|
|
60
|
+
}, [groupType, btnsArray, excludeKeys, useNone]);
|
|
61
|
+
return (_jsxs("div", { children: [subHeader ? _jsx("div", { className: "pep-subheader", children: subHeader }) : null, _jsx(PepGroupButtons, { ...{ groupType: 'custom', btnsArray: computedItems, btnKey }, onBtnKeyChange: onBtnKeyChange }), !hideReset ? (_jsx("button", { type: "button", onClick: onReset, children: "Reset" })) : null] }));
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=PepGroupButtonsSettingsReact.js.map
|