powell-react 0.0.32 → 0.0.34
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/dist/esm/_virtual/jsx-runtime.js +8 -0
- package/dist/esm/_virtual/jsx-runtime.js.map +1 -0
- package/dist/esm/_virtual/react-jsx-runtime.development.js +8 -0
- package/dist/esm/_virtual/react-jsx-runtime.development.js.map +1 -0
- package/dist/esm/_virtual/react-jsx-runtime.production.min.js +8 -0
- package/dist/esm/_virtual/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/{index.es.js → esm/node_modules/react/cjs/react-jsx-runtime.development.js} +11 -523
- package/dist/esm/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
- package/dist/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +29 -0
- package/dist/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/esm/node_modules/react/jsx-runtime.js +18 -0
- package/dist/esm/node_modules/react/jsx-runtime.js.map +1 -0
- package/dist/esm/powell/api/PowellProvider.js +144 -0
- package/dist/esm/powell/api/PowellProvider.js.map +1 -0
- package/dist/esm/powell/api/configService.js +10 -0
- package/dist/esm/powell/api/configService.js.map +1 -0
- package/dist/esm/powell/api/overlayEmitter.js +26 -0
- package/dist/esm/powell/api/overlayEmitter.js.map +1 -0
- package/dist/esm/powell/api/powellDefaults.js +18 -0
- package/dist/esm/powell/api/powellDefaults.js.map +1 -0
- package/dist/esm/powell/components/Button/Button.js +167 -0
- package/dist/esm/powell/components/Button/Button.js.map +1 -0
- package/dist/esm/powell/components/FormContainer/FormContainer.js +120 -0
- package/dist/esm/powell/components/FormContainer/FormContainer.js.map +1 -0
- package/dist/esm/powell/components/FormContainer/FormContext.js +16 -0
- package/dist/esm/powell/components/FormContainer/FormContext.js.map +1 -0
- package/dist/esm/powell/components/Toast/Toast.js +123 -0
- package/dist/esm/powell/components/Toast/Toast.js.map +1 -0
- package/dist/esm/powell/hooks/useApplyConfig.js +55 -0
- package/dist/esm/powell/hooks/useApplyConfig.js.map +1 -0
- package/dist/esm/powell/hooks/useFormContext.js +128 -0
- package/dist/esm/powell/hooks/useFormContext.js.map +1 -0
- package/dist/esm/powell/hooks/usePowellConfig.js +201 -0
- package/dist/esm/powell/hooks/usePowellConfig.js.map +1 -0
- package/dist/esm/powell/index.js +771 -0
- package/dist/esm/powell/index.js.map +1 -0
- package/dist/esm/powell/utils/globalState.js +63 -0
- package/dist/esm/powell/utils/globalState.js.map +1 -0
- package/package.json +5 -2
- package/dist/index.cjs.js +0 -2495
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es.js.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"jsx-runtime.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
@@ -1,134 +1,9 @@
|
|
1
|
-
|
2
|
-
import { Formik, Form, FormikContext, useFormikContext } from 'formik';
|
3
|
-
export { ErrorMessage as $ErrorMessage, FastField as $FastField, Field as $Field, FieldArray as $FieldArray, Form as $Form, Formik as $Formik, FormikConsumer as $FormikConsumer, FormikContext as $FormikContext, FormikProvider as $FormikProvider, connect as $connect, getActiveElement as $getActiveElement, getIn as $getIn, insert as $insert, isEmptyArray as $isEmptyArray, isEmptyChildren as $isEmptyChildren, isFunction as $isFunction, isInputEvent as $isInputEvent, isInteger as $isInteger, isNaN as $isNaN, isObject as $isObject, isPromise as $isPromise, isString as $isString, move as $move, prepareDataForValidation as $prepareDataForValidation, replace as $replace, setIn as $setIn, setNestedObjectValues as $setNestedObjectValues, swap as $swap, useField as $useField, useFormik as $useFormik, useFormikContext as $useFormikContext, validateYupSchema as $validateYupSchema, withFormik as $withFormik, yupToFormErrors as $yupToFormErrors } from 'formik';
|
4
|
-
import * as yup from 'yup';
|
5
|
-
export { yup as $Yup };
|
6
|
-
export { AutoComplete as $AutoComplete } from 'primereact/autocomplete';
|
7
|
-
export { Calendar as $Calendar } from 'primereact/calendar';
|
8
|
-
export { CascadeSelect as $CascadeSelect } from 'primereact/cascadeselect';
|
9
|
-
export { Checkbox as $Checkbox } from 'primereact/checkbox';
|
10
|
-
export { Chips as $Chips } from 'primereact/chips';
|
11
|
-
export { ColorPicker as $ColorPicker } from 'primereact/colorpicker';
|
12
|
-
export { Dropdown as $Dropdown } from 'primereact/dropdown';
|
13
|
-
export { Editor as $Editor } from 'primereact/editor';
|
14
|
-
export { FloatLabel as $FloatLabel } from 'primereact/floatlabel';
|
15
|
-
export { InputIcon as $InputIcon } from 'primereact/inputicon';
|
16
|
-
export { IconField as $IconField } from 'primereact/iconfield';
|
17
|
-
export { InputMask as $InputMask } from 'primereact/inputmask';
|
18
|
-
export { InputSwitch as $InputSwitch } from 'primereact/inputswitch';
|
19
|
-
export { InputNumber as $InputNumber } from 'primereact/inputnumber';
|
20
|
-
export { InputOtp as $InputOtp } from 'primereact/inputotp';
|
21
|
-
export { InputText as $InputText } from 'primereact/inputtext';
|
22
|
-
export { InputTextarea as $InputTextarea } from 'primereact/inputtextarea';
|
23
|
-
export { Knob as $Knob } from 'primereact/knob';
|
24
|
-
export { ListBox as $ListBox } from 'primereact/listbox';
|
25
|
-
export { Mention as $Mention } from 'primereact/mention';
|
26
|
-
export { MultiSelect as $MultiSelect } from 'primereact/multiselect';
|
27
|
-
export { MultiStateCheckbox as $MultiStateCheckbox } from 'primereact/multistatecheckbox';
|
28
|
-
export { Password as $Password } from 'primereact/password';
|
29
|
-
export { RadioButton as $RadioButton } from 'primereact/radiobutton';
|
30
|
-
export { Rating as $Rating } from 'primereact/rating';
|
31
|
-
export { SelectButton as $SelectButton } from 'primereact/selectbutton';
|
32
|
-
export { Slider as $Slider } from 'primereact/slider';
|
33
|
-
export { TreeSelect as $TreeSelect } from 'primereact/treeselect';
|
34
|
-
export { TriStateCheckbox as $TriStateCheckbox } from 'primereact/tristatecheckbox';
|
35
|
-
export { ToggleButton as $ToggleButton } from 'primereact/togglebutton';
|
36
|
-
import { Button as Button$1 } from 'primereact/button';
|
37
|
-
export { Button as $Button } from 'primereact/button';
|
38
|
-
export { SpeedDial as $SpeedDial } from 'primereact/speeddial';
|
39
|
-
export { SplitButton as $SplitButton } from 'primereact/splitbutton';
|
40
|
-
export { DataTable as $DataTable } from 'primereact/datatable';
|
41
|
-
export { DataView as $DataView, DataViewLayoutOptions as $DataViewLayoutOptions } from 'primereact/dataview';
|
42
|
-
export { DataScroller as $DataScroller } from 'primereact/datascroller';
|
43
|
-
export { OrderList as $OrderList } from 'primereact/orderlist';
|
44
|
-
export { OrganizationChart as $OrganizationChart } from 'primereact/organizationchart';
|
45
|
-
export { Paginator as $Paginator } from 'primereact/paginator';
|
46
|
-
export { PickList as $PickList } from 'primereact/picklist';
|
47
|
-
export { Tree as $Tree } from 'primereact/tree';
|
48
|
-
export { TreeTable as $TreeTable } from 'primereact/treetable';
|
49
|
-
export { Timeline as $Timeline } from 'primereact/timeline';
|
50
|
-
export { VirtualScroller as $VirtualScroller } from 'primereact/virtualscroller';
|
51
|
-
export { Accordion as $Accordion, AccordionTab as $AccordionTab } from 'primereact/accordion';
|
52
|
-
export { Card as $Card } from 'primereact/card';
|
53
|
-
export { DeferredContent as $DeferredContent } from 'primereact/deferredcontent';
|
54
|
-
export { Divider as $Divider } from 'primereact/divider';
|
55
|
-
export { Fieldset as $Fieldset } from 'primereact/fieldset';
|
56
|
-
export { Panel as $Panel } from 'primereact/panel';
|
57
|
-
export { ScrollPanel as $ScrollPanel } from 'primereact/scrollpanel';
|
58
|
-
export { Splitter as $Splitter, SplitterPanel as $SplitterPanel } from 'primereact/splitter';
|
59
|
-
export { Stepper as $Stepper } from 'primereact/stepper';
|
60
|
-
export { TabPanel as $TabPanel, TabView as $TabView } from 'primereact/tabview';
|
61
|
-
export { Toolbar as $Toolbar } from 'primereact/toolbar';
|
62
|
-
import { ConfirmDialog } from 'primereact/confirmdialog';
|
63
|
-
export { ConfirmDialog as $ConfirmDialog, confirmDialog as $confirmDialog } from 'primereact/confirmdialog';
|
64
|
-
import { ConfirmPopup } from 'primereact/confirmpopup';
|
65
|
-
export { ConfirmPopup as $ConfirmPopup, confirmPopup as $confirmPopup } from 'primereact/confirmpopup';
|
66
|
-
export { Dialog as $Dialog } from 'primereact/dialog';
|
67
|
-
export { OverlayPanel as $OverlayPanel } from 'primereact/overlaypanel';
|
68
|
-
export { Sidebar as $Sidebar } from 'primereact/sidebar';
|
69
|
-
export { Tooltip as $Tooltip } from 'primereact/tooltip';
|
70
|
-
export { FileUpload as $FileUpload } from 'primereact/fileupload';
|
71
|
-
export { BreadCrumb as $BreadCrumb } from 'primereact/breadcrumb';
|
72
|
-
export { ContextMenu as $ContextMenu } from 'primereact/contextmenu';
|
73
|
-
export { Dock as $Dock } from 'primereact/dock';
|
74
|
-
export { MegaMenu as $MegaMenu } from 'primereact/megamenu';
|
75
|
-
export { Menu as $Menu } from 'primereact/menu';
|
76
|
-
export { Menubar as $Menubar } from 'primereact/menubar';
|
77
|
-
export { PanelMenu as $PanelMenu } from 'primereact/panelmenu';
|
78
|
-
export { Steps as $Steps } from 'primereact/steps';
|
79
|
-
export { TabMenu as $TabMenu } from 'primereact/tabmenu';
|
80
|
-
export { TieredMenu as $TieredMenu } from 'primereact/tieredmenu';
|
81
|
-
export { Message as $Message } from 'primereact/message';
|
82
|
-
export { Messages as $Messages } from 'primereact/messages';
|
83
|
-
import { Toast as Toast$1 } from 'primereact/toast';
|
84
|
-
export { Toast as $Toast } from 'primereact/toast';
|
85
|
-
export { Carousel as $Carousel } from 'primereact/carousel';
|
86
|
-
export { Galleria as $Galleria } from 'primereact/galleria';
|
87
|
-
export { Image as $Image } from 'primereact/image';
|
88
|
-
export { Avatar as $Avatar } from 'primereact/avatar';
|
89
|
-
export { Badge as $Badge } from 'primereact/badge';
|
90
|
-
export { BlockUI as $BlockUI } from 'primereact/blockui';
|
91
|
-
export { Chip as $Chip } from 'primereact/chip';
|
92
|
-
export { Inplace as $Inplace, InplaceContent as $InplaceContent, InplaceDisplay as $InplaceDisplay } from 'primereact/inplace';
|
93
|
-
export { MeterGroup as $MeterGroup } from 'primereact/metergroup';
|
94
|
-
export { ScrollTop as $ScrollTop } from 'primereact/scrolltop';
|
95
|
-
export { Skeleton as $Skeleton } from 'primereact/skeleton';
|
96
|
-
export { ProgressBar as $ProgressBar } from 'primereact/progressbar';
|
97
|
-
export { ProgressSpinner as $ProgressSpinner } from 'primereact/progressspinner';
|
98
|
-
export { Ripple as $Ripple } from 'primereact/ripple';
|
99
|
-
export { StyleClass as $StyleClass } from 'primereact/styleclass';
|
100
|
-
export { Tag as $Tag } from 'primereact/tag';
|
101
|
-
export { Terminal as $Terminal } from 'primereact/terminal';
|
102
|
-
import { PrimeReactContext, PrimeReactProvider } from 'primereact/api';
|
103
|
-
export { FilterMatchMode as $FilterMatchMode, FilterOperator as $FilterOperator, FilterService as $FilterService, MessageSeverity as $MessageSeverity, PrimeIcons as $PrimeIcons, PrimeReactContext as $PrimeReactContext, PrimeReactProvider as $PrimeReactProvider, addLocale as $addLocale, ariaLabel as $ariaLabel, locale as $locale, localeOption as $localeOption, localeOptions as $localeOptions, updateLocaleOption as $updateLocaleOption, updateLocaleOptions as $updateLocaleOptions } from 'primereact/api';
|
104
|
-
import { classNames } from 'primereact/utils';
|
105
|
-
export { DomHandler as $DomHandler, EventBus as $EventBus, IconUtils as $IconUtils, ObjectUtils as $ObjectUtils, UniqueComponentId as $UniqueComponentId, ZIndexUtils as $ZIndexUtils, classNames as $classNames, mask as $mask, mergeProps as $mergeProps } from 'primereact/utils';
|
106
|
-
|
107
|
-
var jsxRuntime = {exports: {}};
|
108
|
-
|
109
|
-
var reactJsxRuntime_production_min = {};
|
1
|
+
'use strict';
|
110
2
|
|
111
|
-
|
112
|
-
* @license React
|
113
|
-
* react-jsx-runtime.production.min.js
|
114
|
-
*
|
115
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
116
|
-
*
|
117
|
-
* This source code is licensed under the MIT license found in the
|
118
|
-
* LICENSE file in the root directory of this source tree.
|
119
|
-
*/
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
120
4
|
|
121
|
-
|
122
|
-
|
123
|
-
function requireReactJsxRuntime_production_min () {
|
124
|
-
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
125
|
-
hasRequiredReactJsxRuntime_production_min = 1;
|
126
|
-
var f=require$$0,k=Symbol.for("react.element"),l=Symbol.for("react.fragment"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:true,ref:true,__self:true,__source:true};
|
127
|
-
function q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=""+g);void 0!==a.key&&(e=""+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a) void 0===d[b]&&(d[b]=a[b]);return {$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}reactJsxRuntime_production_min.Fragment=l;reactJsxRuntime_production_min.jsx=q;reactJsxRuntime_production_min.jsxs=q;
|
128
|
-
return reactJsxRuntime_production_min;
|
129
|
-
}
|
130
|
-
|
131
|
-
var reactJsxRuntime_development = {};
|
5
|
+
const reactJsxRuntime_development = require('../../../_virtual/react-jsx-runtime.development.js');
|
6
|
+
const require$$0 = require('react');
|
132
7
|
|
133
8
|
/**
|
134
9
|
* @license React
|
@@ -143,7 +18,7 @@ var reactJsxRuntime_development = {};
|
|
143
18
|
var hasRequiredReactJsxRuntime_development;
|
144
19
|
|
145
20
|
function requireReactJsxRuntime_development () {
|
146
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
21
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development.__exports;
|
147
22
|
hasRequiredReactJsxRuntime_development = 1;
|
148
23
|
|
149
24
|
if (process.env.NODE_ENV !== "production") {
|
@@ -1443,400 +1318,13 @@ function requireReactJsxRuntime_development () {
|
|
1443
1318
|
|
1444
1319
|
var jsxs = jsxWithValidationStatic ;
|
1445
1320
|
|
1446
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
1447
|
-
reactJsxRuntime_development.jsx = jsx;
|
1448
|
-
reactJsxRuntime_development.jsxs = jsxs;
|
1321
|
+
reactJsxRuntime_development.__exports.Fragment = REACT_FRAGMENT_TYPE;
|
1322
|
+
reactJsxRuntime_development.__exports.jsx = jsx;
|
1323
|
+
reactJsxRuntime_development.__exports.jsxs = jsxs;
|
1449
1324
|
})();
|
1450
1325
|
}
|
1451
|
-
return reactJsxRuntime_development;
|
1452
|
-
}
|
1453
|
-
|
1454
|
-
if (process.env.NODE_ENV === 'production') {
|
1455
|
-
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
1456
|
-
} else {
|
1457
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
1458
|
-
}
|
1459
|
-
|
1460
|
-
var jsxRuntimeExports = jsxRuntime.exports;
|
1461
|
-
|
1462
|
-
const useIsomorphicLayoutEffect = typeof window !== "undefined" || typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
1463
|
-
const equ = (a, b) => a === b;
|
1464
|
-
const FR = {};
|
1465
|
-
function useComparator(v, c = equ) {
|
1466
|
-
const f = useRef(FR);
|
1467
|
-
let nv = f.current;
|
1468
|
-
useIsomorphicLayoutEffect(() => {
|
1469
|
-
f.current = nv;
|
1470
|
-
});
|
1471
|
-
if (f.current === FR || !c(v, f.current)) {
|
1472
|
-
nv = v;
|
1473
|
-
}
|
1474
|
-
return nv;
|
1475
|
-
}
|
1476
|
-
function globalState(initialValue, options) {
|
1477
|
-
let sb = [];
|
1478
|
-
let v = initialValue;
|
1479
|
-
function set(newValue, callback) {
|
1480
|
-
const pv = v;
|
1481
|
-
v = newValue instanceof Function ? newValue(v) : newValue;
|
1482
|
-
setTimeout(() => {
|
1483
|
-
sb.forEach((c) => c(v, pv));
|
1484
|
-
callback?.(v, pv);
|
1485
|
-
options?.onSet?.(v, pv);
|
1486
|
-
});
|
1487
|
-
}
|
1488
|
-
function subscribe(subscriber) {
|
1489
|
-
sb.push(subscriber);
|
1490
|
-
return () => {
|
1491
|
-
sb = sb.filter((f) => f !== subscriber);
|
1492
|
-
};
|
1493
|
-
}
|
1494
|
-
function useSubscription(subscriber) {
|
1495
|
-
useIsomorphicLayoutEffect(() => subscribe(subscriber), [subscriber]);
|
1496
|
-
}
|
1497
|
-
function use() {
|
1498
|
-
const [l, s] = useState(v);
|
1499
|
-
useSubscription(s);
|
1500
|
-
return [l, set];
|
1501
|
-
}
|
1502
|
-
function useSelector(selector, comparator = equ) {
|
1503
|
-
const [rv] = use();
|
1504
|
-
return useComparator(selector(rv), comparator);
|
1505
|
-
}
|
1506
|
-
return {
|
1507
|
-
use,
|
1508
|
-
useSelector,
|
1509
|
-
useValue: () => use()[0],
|
1510
|
-
get: () => v,
|
1511
|
-
set,
|
1512
|
-
reset: () => set(initialValue),
|
1513
|
-
subscribe
|
1514
|
-
};
|
1515
|
-
}
|
1516
|
-
|
1517
|
-
const configService = globalState({});
|
1518
|
-
|
1519
|
-
const powellDefaults = {
|
1520
|
-
theme: "lara-light-cyan",
|
1521
|
-
rtl: false,
|
1522
|
-
showRequiredStar: true,
|
1523
|
-
ripple: true,
|
1524
|
-
inputSize: "medium",
|
1525
|
-
inputStyle: "outlined",
|
1526
|
-
labelPosition: "top",
|
1527
|
-
fixLabelPosition: "side",
|
1528
|
-
injectDirectionToRoot: false
|
1529
|
-
};
|
1530
|
-
|
1531
|
-
class OverlayEmitter {
|
1532
|
-
listeners = {};
|
1533
|
-
on(event, listener) {
|
1534
|
-
if (!this.listeners[event]) {
|
1535
|
-
this.listeners[event] = [];
|
1536
|
-
}
|
1537
|
-
this.listeners[event].push(listener);
|
1538
|
-
}
|
1539
|
-
emit(event, data) {
|
1540
|
-
if (this.listeners[event]) {
|
1541
|
-
this.listeners[event].forEach((listener) => listener(data));
|
1542
|
-
}
|
1543
|
-
}
|
1544
|
-
off(event, listener) {
|
1545
|
-
if (!this.listeners[event]) return;
|
1546
|
-
this.listeners[event] = this.listeners[event].filter((l) => l !== listener);
|
1547
|
-
}
|
1548
|
-
}
|
1549
|
-
const overlayEmitter = new OverlayEmitter();
|
1550
|
-
|
1551
|
-
const Toast = (prop) => {
|
1552
|
-
const toast = useRef(null);
|
1553
|
-
const isRendered = useRef(false);
|
1554
|
-
useEffect(() => {
|
1555
|
-
if (isRendered.current) {
|
1556
|
-
return;
|
1557
|
-
}
|
1558
|
-
isRendered.current = true;
|
1559
|
-
overlayEmitter.on("toast", (options) => {
|
1560
|
-
toast.current?.show(options);
|
1561
|
-
});
|
1562
|
-
}, []);
|
1563
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Toast$1, { ...prop, ref: toast });
|
1564
|
-
};
|
1565
|
-
|
1566
|
-
const usePowellConfig = () => {
|
1567
|
-
const [powellConfig, setPowellConfig] = configService.use();
|
1568
|
-
const {
|
1569
|
-
setPt,
|
1570
|
-
setFilterMatchModeOptions,
|
1571
|
-
setLocale,
|
1572
|
-
setNonce,
|
1573
|
-
setHideOverlaysOnDocumentScrolling,
|
1574
|
-
setRipple,
|
1575
|
-
setCssTransition,
|
1576
|
-
setStyleContainer,
|
1577
|
-
setInputStyle,
|
1578
|
-
setNullSortOrder,
|
1579
|
-
setZIndex,
|
1580
|
-
setAutoZIndex,
|
1581
|
-
setAppendTo,
|
1582
|
-
changeTheme,
|
1583
|
-
...restPrimeConfig
|
1584
|
-
} = useContext(PrimeReactContext);
|
1585
|
-
const configAction = {
|
1586
|
-
pt: setPt,
|
1587
|
-
filterMatchModeOptions: setFilterMatchModeOptions,
|
1588
|
-
locale: setLocale,
|
1589
|
-
nonce: setNonce,
|
1590
|
-
hideOverlaysOnDocumentScrolling: setHideOverlaysOnDocumentScrolling,
|
1591
|
-
ripple: setRipple,
|
1592
|
-
cssTransition: setCssTransition,
|
1593
|
-
styleContainer: setStyleContainer,
|
1594
|
-
inputStyle: setInputStyle,
|
1595
|
-
nullSortOrder: setNullSortOrder,
|
1596
|
-
zIndex: setZIndex,
|
1597
|
-
autoZIndex: setAutoZIndex,
|
1598
|
-
appendTo: setAppendTo,
|
1599
|
-
theme: (v) => changeTheme?.(powellConfig.theme, v.theme, "powell-theme-link")
|
1600
|
-
};
|
1601
|
-
const updateConfig = (c) => {
|
1602
|
-
for (const key in c) {
|
1603
|
-
if (key in configAction) {
|
1604
|
-
configAction[key]?.(c);
|
1605
|
-
}
|
1606
|
-
applyConfigToDom({ ...c, injectDirectionToRoot: powellConfig.injectDirectionToRoot });
|
1607
|
-
setPowellConfig((prev) => ({ ...prev, ...c }));
|
1608
|
-
}
|
1609
|
-
};
|
1610
|
-
return [{ ...powellConfig, ...restPrimeConfig }, updateConfig];
|
1611
|
-
};
|
1612
|
-
const applyConfigToDom = (config) => {
|
1613
|
-
handleBodyClasses(config);
|
1614
|
-
if ("rtl" in config && config.injectDirectionToRoot) {
|
1615
|
-
document.documentElement.setAttribute("dir", config.rtl ? "rtl" : "ltr");
|
1616
|
-
} else {
|
1617
|
-
document.documentElement.removeAttribute("dir");
|
1618
|
-
}
|
1619
|
-
};
|
1620
|
-
const kebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
1621
|
-
const handleBodyClasses = (config) => {
|
1622
|
-
const specialBodyClassRules = {
|
1623
|
-
ripple: [
|
1624
|
-
{
|
1625
|
-
condition: (v) => v === false,
|
1626
|
-
className: "p-ripple-disabled"
|
1627
|
-
}
|
1628
|
-
],
|
1629
|
-
inputStyle: [
|
1630
|
-
{
|
1631
|
-
condition: (v) => v === "filled",
|
1632
|
-
className: "p-input-filled"
|
1633
|
-
}
|
1634
|
-
]
|
1635
|
-
};
|
1636
|
-
for (const key in config) {
|
1637
|
-
const value = config[key];
|
1638
|
-
if (value === void 0) continue;
|
1639
|
-
const rules = specialBodyClassRules[key];
|
1640
|
-
if (rules && rules.length) {
|
1641
|
-
for (const rule of rules) {
|
1642
|
-
const shouldApply = rule.condition(value);
|
1643
|
-
document.body.classList.toggle(rule.className, shouldApply);
|
1644
|
-
}
|
1645
|
-
} else {
|
1646
|
-
const prefix = `powell-${kebabCase(key)}-`;
|
1647
|
-
document.body.classList.forEach((cls) => {
|
1648
|
-
if (cls.startsWith(prefix)) {
|
1649
|
-
document.body.classList.remove(cls);
|
1650
|
-
}
|
1651
|
-
});
|
1652
|
-
const finalValue = typeof value === "boolean" ? value ? "enabled" : "disabled" : value;
|
1653
|
-
document.body.classList.add(`${prefix}${finalValue}`);
|
1654
|
-
}
|
1655
|
-
}
|
1656
|
-
};
|
1657
|
-
|
1658
|
-
const splitProps = (props, groups) => {
|
1659
|
-
const result = {};
|
1660
|
-
const rest = {};
|
1661
|
-
const assigned = {};
|
1662
|
-
const restEligible = {};
|
1663
|
-
for (const groupName in groups) {
|
1664
|
-
for (const descriptor of groups[groupName]) {
|
1665
|
-
const key = typeof descriptor === "string" ? descriptor : descriptor.key;
|
1666
|
-
const alias = typeof descriptor === "string" ? void 0 : descriptor.alias;
|
1667
|
-
const defaultValue = typeof descriptor === "string" ? void 0 : descriptor.defaultValue;
|
1668
|
-
const keepInRest = typeof descriptor === "string" ? false : descriptor.keepInRest ?? false;
|
1669
|
-
if (!result[groupName]) {
|
1670
|
-
result[groupName] = {};
|
1671
|
-
}
|
1672
|
-
const value = key in props ? props[key] : typeof defaultValue === "function" ? defaultValue() : defaultValue;
|
1673
|
-
result[groupName][alias ?? key] = value;
|
1674
|
-
assigned[key] = true;
|
1675
|
-
if (keepInRest) {
|
1676
|
-
restEligible[key] = true;
|
1677
|
-
}
|
1678
|
-
}
|
1679
|
-
}
|
1680
|
-
for (const key in props) {
|
1681
|
-
const typedKey = key;
|
1682
|
-
if (!assigned[typedKey] || restEligible[typedKey]) {
|
1683
|
-
rest[typedKey] = props[typedKey];
|
1684
|
-
}
|
1685
|
-
}
|
1686
|
-
result.rest = rest;
|
1687
|
-
return result;
|
1688
|
-
};
|
1689
|
-
const useApplyConfig = (props, options) => {
|
1690
|
-
const [config] = usePowellConfig();
|
1691
|
-
const { sizable = true, isFixLabel = false, groups = {} } = options;
|
1692
|
-
const result = {
|
1693
|
-
...props,
|
1694
|
-
rtl: props.rtl ?? config.rtl,
|
1695
|
-
showRequiredStar: props.showRequiredStar ?? config.showRequiredStar,
|
1696
|
-
labelPosition: props.labelPosition ?? (isFixLabel ? config.fixLabelPosition : config.labelPosition),
|
1697
|
-
..."variant" in props ? { variant: props.variant ?? config.inputStyle } : {}
|
1698
|
-
};
|
1699
|
-
if (sizable) {
|
1700
|
-
result.inputSize = props.inputSize ?? config.inputSize;
|
1701
|
-
}
|
1702
|
-
return splitProps(result, groups);
|
1703
|
-
};
|
1704
|
-
|
1705
|
-
const FormContent = (props) => {
|
1706
|
-
const { children, onInit } = props;
|
1707
|
-
const formikContext = useSafeFormikContext();
|
1708
|
-
const initialized = useRef(false);
|
1709
|
-
useEffect(() => {
|
1710
|
-
if (!initialized.current) {
|
1711
|
-
onInit?.(formikContext);
|
1712
|
-
initialized.current = true;
|
1713
|
-
}
|
1714
|
-
}, [formikContext, onInit]);
|
1715
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children });
|
1716
|
-
};
|
1717
|
-
forwardRef((props, ref) => {
|
1718
|
-
const { children, onInit, className, ...rest } = props;
|
1719
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Formik, { ...rest, children: (context) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormProvider, { ...rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Form, { ref, className, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FormContent, { onInit, children: typeof children === "function" ? children(context) : children }) }) }) });
|
1720
|
-
});
|
1721
|
-
|
1722
|
-
const FormContext = createContext(void 0);
|
1723
|
-
const FormProvider = (props) => {
|
1724
|
-
const { children, ...rest } = props;
|
1725
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(FormContext.Provider, { value: rest, children: /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children }) });
|
1726
|
-
};
|
1727
|
-
|
1728
|
-
const useFormContext = () => {
|
1729
|
-
const context = useContext(FormContext);
|
1730
|
-
const formikContext = useSafeFormikContext();
|
1731
|
-
if (!context || !formikContext) {
|
1732
|
-
return null;
|
1733
|
-
}
|
1734
|
-
return { ...context, ...formikContext };
|
1735
|
-
};
|
1736
|
-
function useSafeFormikContext() {
|
1737
|
-
const context = useContext(FormikContext);
|
1738
|
-
try {
|
1739
|
-
if (context) {
|
1740
|
-
return useFormikContext();
|
1741
|
-
}
|
1742
|
-
return void 0;
|
1743
|
-
} catch {
|
1744
|
-
return void 0;
|
1745
|
-
}
|
1326
|
+
return reactJsxRuntime_development.__exports;
|
1746
1327
|
}
|
1747
1328
|
|
1748
|
-
|
1749
|
-
|
1750
|
-
const linkEl = document.createElement("link");
|
1751
|
-
linkEl.rel = "stylesheet";
|
1752
|
-
linkEl.type = "text/css";
|
1753
|
-
linkEl.id = "powell-theme-link";
|
1754
|
-
headEl.appendChild(linkEl);
|
1755
|
-
return linkEl;
|
1756
|
-
};
|
1757
|
-
const applyTheme = (theme) => {
|
1758
|
-
let themeEl = document.getElementById("powell-theme-link");
|
1759
|
-
if (!themeEl) {
|
1760
|
-
themeEl = createThemeLink();
|
1761
|
-
}
|
1762
|
-
themeEl.setAttribute("href", `/themes/${theme}.css`);
|
1763
|
-
};
|
1764
|
-
const PowellProvider = (props) => {
|
1765
|
-
const { children, config } = props;
|
1766
|
-
const defaultConfig = {
|
1767
|
-
...powellDefaults,
|
1768
|
-
...config
|
1769
|
-
};
|
1770
|
-
configService.set(defaultConfig);
|
1771
|
-
applyConfigToDom(defaultConfig);
|
1772
|
-
applyTheme(defaultConfig.theme);
|
1773
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs(PrimeReactProvider, { value: defaultConfig, children: [
|
1774
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Toast, {}),
|
1775
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ConfirmDialog, {}),
|
1776
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(ConfirmPopup, {}),
|
1777
|
-
children
|
1778
|
-
] });
|
1779
|
-
};
|
1780
|
-
|
1781
|
-
const Button = (props) => {
|
1782
|
-
const {
|
1783
|
-
async,
|
1784
|
-
onClickAsync,
|
1785
|
-
onClick,
|
1786
|
-
nextLabel,
|
1787
|
-
nextIcon,
|
1788
|
-
nextRaised,
|
1789
|
-
nextSeverity,
|
1790
|
-
nextAppearance,
|
1791
|
-
state = "default",
|
1792
|
-
onStateChange,
|
1793
|
-
type = "button",
|
1794
|
-
...rest
|
1795
|
-
} = props;
|
1796
|
-
const [_state, _setState] = useState(state);
|
1797
|
-
const getButtonTempProps = (newState) => {
|
1798
|
-
return {
|
1799
|
-
label: newState === "default" ? rest.label : nextLabel ?? rest.label,
|
1800
|
-
icon: newState === "default" ? rest.icon : nextIcon ?? rest.icon,
|
1801
|
-
appearance: newState === "default" ? rest.appearance : nextAppearance ?? rest.appearance,
|
1802
|
-
raised: newState === "default" ? rest.raised : nextRaised ?? rest.raised,
|
1803
|
-
severity: newState === "default" ? rest.severity : nextSeverity ?? rest.severity
|
1804
|
-
};
|
1805
|
-
};
|
1806
|
-
const tempProps = useRef(getButtonTempProps(state));
|
1807
|
-
const handleClick = (event) => {
|
1808
|
-
if (async) {
|
1809
|
-
onClickAsync?.({ event, loadingCallback: removeLoading });
|
1810
|
-
_setState("loading");
|
1811
|
-
onStateChange?.("loading");
|
1812
|
-
} else {
|
1813
|
-
onClick?.(event);
|
1814
|
-
}
|
1815
|
-
};
|
1816
|
-
const removeLoading = (toggleState) => {
|
1817
|
-
const newState = toggleState ? "next" : "default";
|
1818
|
-
tempProps.current = getButtonTempProps(newState);
|
1819
|
-
_setState(newState);
|
1820
|
-
onStateChange?.(newState);
|
1821
|
-
};
|
1822
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
1823
|
-
Button$1,
|
1824
|
-
{
|
1825
|
-
type,
|
1826
|
-
...rest,
|
1827
|
-
onClick: handleClick,
|
1828
|
-
label: async ? tempProps.current.label : rest.label,
|
1829
|
-
icon: async ? tempProps.current.icon : rest.icon,
|
1830
|
-
severity: async ? tempProps.current.severity : rest.severity,
|
1831
|
-
raised: async ? tempProps.current.raised : rest.raised,
|
1832
|
-
text: async ? tempProps.current.appearance === "text" : rest.appearance === "text",
|
1833
|
-
outlined: async ? tempProps.current.appearance === "outlined" : rest.appearance === "outlined",
|
1834
|
-
link: async ? tempProps.current.appearance === "link" : rest.appearance === "link",
|
1835
|
-
loading: _state === "loading",
|
1836
|
-
className: classNames(rest.className, `state-${_state}`)
|
1837
|
-
}
|
1838
|
-
);
|
1839
|
-
};
|
1840
|
-
|
1841
|
-
export { Button, PowellProvider, applyConfigToDom, configService, globalState, powellDefaults, useApplyConfig, useFormContext, usePowellConfig, useSafeFormikContext };
|
1842
|
-
//# sourceMappingURL=index.es.js.map
|
1329
|
+
exports.__require = requireReactJsxRuntime_development;
|
1330
|
+
//# sourceMappingURL=react-jsx-runtime.development.js.map
|