@pnkx-lib/ui 1.8.3 → 1.8.6
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/assets/ui-TI_LyW6Y.css +1 -0
- package/dist/chunks/Switch-B9j33qoL.js +14880 -0
- package/dist/chunks/Tag-BhJhbXqW.js +4206 -0
- package/dist/chunks/createSuper-xZMa0AcQ.js +2769 -0
- package/dist/fields/index.js +11 -0
- package/dist/index.js +40 -0
- package/dist/style.css +1 -1
- package/dist/types/fields.d.ts +193 -0
- package/dist/types/index.d.ts +574 -0
- package/dist/types/ui.d.ts +387 -0
- package/dist/ui/index.js +31 -0
- package/dist/vite.svg +1 -0
- package/es/chunks/{ErrorBoundary-Ja4PIPaU.js → ErrorBoundary-C5g427OM.js} +11273 -6752
- package/es/chunks/{Checkbox-2LoiNtBe.js → Radio-C3c5Olf1.js} +3 -52
- package/es/chunks/{Switch-C3IZzn6L.js → Switch-BUaKQ4cU.js} +134 -65
- package/es/fields/index.js +2 -2
- package/es/index.js +3 -3
- package/es/ui/index.js +2 -2
- package/package.json +5 -1
- package/types/index.d.ts +6 -3
- package/types/ui.d.ts +6 -3
@@ -1,5 +1,5 @@
|
|
1
|
-
import { g as get, j as jsxRuntimeExports, L as Label, E as ErrorMessage, T as Typography } from './Switch-
|
2
|
-
import { Select as Select$1, Radio
|
1
|
+
import { g as get, j as jsxRuntimeExports, L as Label, E as ErrorMessage, T as Typography } from './Switch-BUaKQ4cU.js';
|
2
|
+
import { Select as Select$1, Radio } from 'antd';
|
3
3
|
|
4
4
|
const Select = (props) => {
|
5
5
|
//! State
|
@@ -100,53 +100,4 @@ const RadioGroup = (props) => {
|
|
100
100
|
] });
|
101
101
|
};
|
102
102
|
|
103
|
-
|
104
|
-
//! State
|
105
|
-
const {
|
106
|
-
field,
|
107
|
-
formState,
|
108
|
-
label,
|
109
|
-
afterOnChange,
|
110
|
-
customStyleContainer,
|
111
|
-
customStyleCheckbox,
|
112
|
-
...restProps
|
113
|
-
} = props;
|
114
|
-
const { name, value, onChange, onBlur } = field || {};
|
115
|
-
const { touchedFields, errors, isSubmitted } = formState || {};
|
116
|
-
const isTouched = get(touchedFields, name);
|
117
|
-
const errorMessage = get(errors, name)?.message;
|
118
|
-
//! Function
|
119
|
-
const handleChange = (e) => {
|
120
|
-
const checked = e.target.checked;
|
121
|
-
onChange?.(checked);
|
122
|
-
afterOnChange?.(checked);
|
123
|
-
};
|
124
|
-
const renderErrorMessage = () => {
|
125
|
-
if (!errorMessage) return null;
|
126
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
127
|
-
ErrorMessage,
|
128
|
-
{
|
129
|
-
errorMessage,
|
130
|
-
isTouched,
|
131
|
-
isSubmitted
|
132
|
-
}
|
133
|
-
);
|
134
|
-
};
|
135
|
-
//! Render
|
136
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
|
137
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
138
|
-
Checkbox,
|
139
|
-
{
|
140
|
-
onBlur,
|
141
|
-
checked: !!value,
|
142
|
-
onChange: handleChange,
|
143
|
-
className: customStyleCheckbox,
|
144
|
-
...restProps,
|
145
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: label })
|
146
|
-
}
|
147
|
-
),
|
148
|
-
renderErrorMessage()
|
149
|
-
] });
|
150
|
-
};
|
151
|
-
|
152
|
-
export { CheckboxField as C, RadioGroup as R, Select as S };
|
103
|
+
export { RadioGroup as R, Select as S };
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import React__default, { useRef, useState, useEffect, useLayoutEffect, useMemo, forwardRef, useCallback, createElement, Component, createRef, createContext, useContext } from 'react';
|
3
|
-
import { Typography as Typography$1, Input as Input$1, DatePicker, Upload, Image, Switch } from 'antd';
|
3
|
+
import { Typography as Typography$1, Input as Input$1, Checkbox, DatePicker, Upload, Image, Switch } from 'antd';
|
4
4
|
import { g as require_baseGetTag, h as requireIsObjectLike, k as requireIsArray, d as require_MapCache, o as require_Symbol, p as getDefaultExportFromCjs, q as commonjsGlobal, T as TINY_API } from './common-b3FKGF0Y.js';
|
5
5
|
import * as ReactDOM from 'react-dom';
|
6
6
|
import ReactDOM__default, { findDOMNode } from 'react-dom';
|
@@ -3495,6 +3495,48 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
3495
3495
|
return result;
|
3496
3496
|
};
|
3497
3497
|
|
3498
|
+
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
3499
|
+
|
3500
|
+
function deepEqual(object1, object2) {
|
3501
|
+
if (isPrimitive(object1) || isPrimitive(object2)) {
|
3502
|
+
return object1 === object2;
|
3503
|
+
}
|
3504
|
+
if (isDateObject(object1) && isDateObject(object2)) {
|
3505
|
+
return object1.getTime() === object2.getTime();
|
3506
|
+
}
|
3507
|
+
const keys1 = Object.keys(object1);
|
3508
|
+
const keys2 = Object.keys(object2);
|
3509
|
+
if (keys1.length !== keys2.length) {
|
3510
|
+
return false;
|
3511
|
+
}
|
3512
|
+
for (const key of keys1) {
|
3513
|
+
const val1 = object1[key];
|
3514
|
+
if (!keys2.includes(key)) {
|
3515
|
+
return false;
|
3516
|
+
}
|
3517
|
+
if (key !== 'ref') {
|
3518
|
+
const val2 = object2[key];
|
3519
|
+
if ((isDateObject(val1) && isDateObject(val2)) ||
|
3520
|
+
(isObject(val1) && isObject(val2)) ||
|
3521
|
+
(Array.isArray(val1) && Array.isArray(val2))
|
3522
|
+
? !deepEqual(val1, val2)
|
3523
|
+
: val1 !== val2) {
|
3524
|
+
return false;
|
3525
|
+
}
|
3526
|
+
}
|
3527
|
+
}
|
3528
|
+
return true;
|
3529
|
+
}
|
3530
|
+
|
3531
|
+
const useDeepEqualEffect = (effect, deps) => {
|
3532
|
+
const ref = useRef(deps);
|
3533
|
+
if (!deepEqual(deps, ref.current)) {
|
3534
|
+
ref.current = deps;
|
3535
|
+
}
|
3536
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
3537
|
+
useEffect(effect, ref.current);
|
3538
|
+
};
|
3539
|
+
|
3498
3540
|
/**
|
3499
3541
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
3500
3542
|
*
|
@@ -3539,10 +3581,8 @@ function useFormState(props) {
|
|
3539
3581
|
isValid: false,
|
3540
3582
|
errors: false,
|
3541
3583
|
});
|
3542
|
-
|
3543
|
-
|
3544
|
-
React__default.useEffect(() => control._subscribe({
|
3545
|
-
name: _name.current,
|
3584
|
+
useDeepEqualEffect(() => control._subscribe({
|
3585
|
+
name: name,
|
3546
3586
|
formState: _localProxyFormState.current,
|
3547
3587
|
exact,
|
3548
3588
|
callback: (formState) => {
|
@@ -3552,7 +3592,7 @@ function useFormState(props) {
|
|
3552
3592
|
...formState,
|
3553
3593
|
});
|
3554
3594
|
},
|
3555
|
-
}), [
|
3595
|
+
}), [name, disabled, exact]);
|
3556
3596
|
React__default.useEffect(() => {
|
3557
3597
|
_localProxyFormState.current.isValid && control._setValid(true);
|
3558
3598
|
}, [control]);
|
@@ -3592,19 +3632,16 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
3592
3632
|
function useWatch(props) {
|
3593
3633
|
const methods = useFormContext();
|
3594
3634
|
const { control = methods.control, name, defaultValue, disabled, exact, } = props || {};
|
3595
|
-
const
|
3596
|
-
|
3597
|
-
|
3598
|
-
React__default.useEffect(() => control._subscribe({
|
3599
|
-
name: _name.current,
|
3635
|
+
const [value, updateValue] = React__default.useState(control._getWatch(name, defaultValue));
|
3636
|
+
useDeepEqualEffect(() => control._subscribe({
|
3637
|
+
name: name,
|
3600
3638
|
formState: {
|
3601
3639
|
values: true,
|
3602
3640
|
},
|
3603
3641
|
exact,
|
3604
3642
|
callback: (formState) => !disabled &&
|
3605
|
-
updateValue(generateWatchOutput(
|
3606
|
-
}), [
|
3607
|
-
const [value, updateValue] = React__default.useState(control._getWatch(name, defaultValue));
|
3643
|
+
updateValue(generateWatchOutput(name, control._names, formState.values || control._formValues, false, defaultValue)),
|
3644
|
+
}), [name, defaultValue, disabled, exact]);
|
3608
3645
|
React__default.useEffect(() => control._removeUnmounted());
|
3609
3646
|
return value;
|
3610
3647
|
}
|
@@ -3839,39 +3876,6 @@ var createSubject = () => {
|
|
3839
3876
|
};
|
3840
3877
|
};
|
3841
3878
|
|
3842
|
-
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
3843
|
-
|
3844
|
-
function deepEqual(object1, object2) {
|
3845
|
-
if (isPrimitive(object1) || isPrimitive(object2)) {
|
3846
|
-
return object1 === object2;
|
3847
|
-
}
|
3848
|
-
if (isDateObject(object1) && isDateObject(object2)) {
|
3849
|
-
return object1.getTime() === object2.getTime();
|
3850
|
-
}
|
3851
|
-
const keys1 = Object.keys(object1);
|
3852
|
-
const keys2 = Object.keys(object2);
|
3853
|
-
if (keys1.length !== keys2.length) {
|
3854
|
-
return false;
|
3855
|
-
}
|
3856
|
-
for (const key of keys1) {
|
3857
|
-
const val1 = object1[key];
|
3858
|
-
if (!keys2.includes(key)) {
|
3859
|
-
return false;
|
3860
|
-
}
|
3861
|
-
if (key !== 'ref') {
|
3862
|
-
const val2 = object2[key];
|
3863
|
-
if ((isDateObject(val1) && isDateObject(val2)) ||
|
3864
|
-
(isObject(val1) && isObject(val2)) ||
|
3865
|
-
(Array.isArray(val1) && Array.isArray(val2))
|
3866
|
-
? !deepEqual(val1, val2)
|
3867
|
-
: val1 !== val2) {
|
3868
|
-
return false;
|
3869
|
-
}
|
3870
|
-
}
|
3871
|
-
}
|
3872
|
-
return true;
|
3873
|
-
}
|
3874
|
-
|
3875
3879
|
var isEmptyObject = (value) => isObject(value) && !Object.keys(value).length;
|
3876
3880
|
|
3877
3881
|
var isFileInput = (element) => element.type === 'file';
|
@@ -4420,6 +4424,7 @@ function createFormControl(props = {}) {
|
|
4420
4424
|
let _formState = {
|
4421
4425
|
submitCount: 0,
|
4422
4426
|
isDirty: false,
|
4427
|
+
isReady: false,
|
4423
4428
|
isLoading: isFunction$1(_options.defaultValues),
|
4424
4429
|
isValidating: false,
|
4425
4430
|
isSubmitted: false,
|
@@ -5439,6 +5444,7 @@ function createFormControl(props = {}) {
|
|
5439
5444
|
};
|
5440
5445
|
}
|
5441
5446
|
|
5447
|
+
const useIsomorphicLayoutEffect$1 = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
5442
5448
|
/**
|
5443
5449
|
* Custom hook to manage the entire form.
|
5444
5450
|
*
|
@@ -5485,6 +5491,7 @@ function useForm(props = {}) {
|
|
5485
5491
|
validatingFields: {},
|
5486
5492
|
errors: props.errors || {},
|
5487
5493
|
disabled: props.disabled || false,
|
5494
|
+
isReady: false,
|
5488
5495
|
defaultValues: isFunction$1(props.defaultValues)
|
5489
5496
|
? undefined
|
5490
5497
|
: props.defaultValues,
|
@@ -5502,12 +5509,36 @@ function useForm(props = {}) {
|
|
5502
5509
|
}
|
5503
5510
|
const control = _formControl.current.control;
|
5504
5511
|
control._options = props;
|
5505
|
-
|
5506
|
-
|
5507
|
-
|
5508
|
-
|
5509
|
-
|
5512
|
+
useIsomorphicLayoutEffect$1(() => {
|
5513
|
+
const sub = control._subscribe({
|
5514
|
+
formState: control._proxyFormState,
|
5515
|
+
callback: () => updateFormState({ ...control._formState }),
|
5516
|
+
reRenderRoot: true,
|
5517
|
+
});
|
5518
|
+
updateFormState((data) => ({
|
5519
|
+
...data,
|
5520
|
+
isReady: true,
|
5521
|
+
}));
|
5522
|
+
return sub;
|
5523
|
+
}, [control]);
|
5510
5524
|
React__default.useEffect(() => control._disableForm(props.disabled), [control, props.disabled]);
|
5525
|
+
React__default.useEffect(() => {
|
5526
|
+
if (props.mode) {
|
5527
|
+
control._options.mode = props.mode;
|
5528
|
+
}
|
5529
|
+
if (props.reValidateMode) {
|
5530
|
+
control._options.reValidateMode = props.reValidateMode;
|
5531
|
+
}
|
5532
|
+
if (props.errors && !isEmptyObject(props.errors)) {
|
5533
|
+
control._setErrors(props.errors);
|
5534
|
+
}
|
5535
|
+
}, [control, props.errors, props.mode, props.reValidateMode]);
|
5536
|
+
React__default.useEffect(() => {
|
5537
|
+
props.shouldUnregister &&
|
5538
|
+
control._subjects.state.next({
|
5539
|
+
values: control._getWatch(),
|
5540
|
+
});
|
5541
|
+
}, [control, props.shouldUnregister]);
|
5511
5542
|
React__default.useEffect(() => {
|
5512
5543
|
if (control._proxyFormState.isDirty) {
|
5513
5544
|
const isDirty = control._getDirty();
|
@@ -5527,12 +5558,7 @@ function useForm(props = {}) {
|
|
5527
5558
|
else {
|
5528
5559
|
control._resetDefaultValues();
|
5529
5560
|
}
|
5530
|
-
}, [props.values
|
5531
|
-
React__default.useEffect(() => {
|
5532
|
-
if (props.errors && !isEmptyObject(props.errors)) {
|
5533
|
-
control._setErrors(props.errors);
|
5534
|
-
}
|
5535
|
-
}, [props.errors, control]);
|
5561
|
+
}, [control, props.values]);
|
5536
5562
|
React__default.useEffect(() => {
|
5537
5563
|
if (!control._state.mount) {
|
5538
5564
|
control._setValid();
|
@@ -5544,12 +5570,6 @@ function useForm(props = {}) {
|
|
5544
5570
|
}
|
5545
5571
|
control._removeUnmounted();
|
5546
5572
|
});
|
5547
|
-
React__default.useEffect(() => {
|
5548
|
-
props.shouldUnregister &&
|
5549
|
-
control._subjects.state.next({
|
5550
|
-
values: control._getWatch(),
|
5551
|
-
});
|
5552
|
-
}, [props.shouldUnregister, control]);
|
5553
5573
|
_formControl.current.formState = getProxyFormState(formState, control);
|
5554
5574
|
return _formControl.current;
|
5555
5575
|
}
|
@@ -24779,6 +24799,55 @@ const Textarea = forwardRef(
|
|
24779
24799
|
);
|
24780
24800
|
React__default.memo(Textarea);
|
24781
24801
|
|
24802
|
+
const CheckboxField = (props) => {
|
24803
|
+
//! State
|
24804
|
+
const {
|
24805
|
+
field,
|
24806
|
+
formState,
|
24807
|
+
label,
|
24808
|
+
afterOnChange,
|
24809
|
+
customStyleContainer,
|
24810
|
+
customStyleCheckbox,
|
24811
|
+
...restProps
|
24812
|
+
} = props;
|
24813
|
+
const { name, value, onChange, onBlur } = field || {};
|
24814
|
+
const { touchedFields, errors, isSubmitted } = formState || {};
|
24815
|
+
const isTouched = get$1(touchedFields, name);
|
24816
|
+
const errorMessage = get$1(errors, name)?.message;
|
24817
|
+
//! Function
|
24818
|
+
const handleChange = (e) => {
|
24819
|
+
const checked = e.target.checked;
|
24820
|
+
onChange?.(checked);
|
24821
|
+
afterOnChange?.(checked);
|
24822
|
+
};
|
24823
|
+
const renderErrorMessage = () => {
|
24824
|
+
if (!errorMessage) return null;
|
24825
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
24826
|
+
ErrorMessage,
|
24827
|
+
{
|
24828
|
+
errorMessage,
|
24829
|
+
isTouched,
|
24830
|
+
isSubmitted
|
24831
|
+
}
|
24832
|
+
);
|
24833
|
+
};
|
24834
|
+
//! Render
|
24835
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: customStyleContainer, children: [
|
24836
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
24837
|
+
Checkbox,
|
24838
|
+
{
|
24839
|
+
onBlur,
|
24840
|
+
checked: !!value,
|
24841
|
+
onChange: handleChange,
|
24842
|
+
className: customStyleCheckbox,
|
24843
|
+
...restProps,
|
24844
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: label })
|
24845
|
+
}
|
24846
|
+
),
|
24847
|
+
renderErrorMessage()
|
24848
|
+
] });
|
24849
|
+
};
|
24850
|
+
|
24782
24851
|
function _typeof(o) {
|
24783
24852
|
"@babel/helpers - typeof";
|
24784
24853
|
|
@@ -39321,4 +39390,4 @@ const SwitchField = (props) => {
|
|
39321
39390
|
};
|
39322
39391
|
React__default.memo(SwitchField);
|
39323
39392
|
|
39324
|
-
export { _createSuper as A, _assertThisInitialized$1 as B,
|
39393
|
+
export { _createSuper as A, _assertThisInitialized$1 as B, CheckboxField as C, DatePickerField as D, ErrorMessage as E, FastColor as F, _objectWithoutProperties as G, IconContext as H, Input as I, Label as L, PnkxField as P, RangePickerField as R, Typography as T, _extends as _, TinyMCE as a, Icon as b, _typeof as c, classNames as d, _arrayLikeToArray as e, _unsupportedIterableToArray as f, get$1 as g, _createClass as h, _classCallCheck as i, jsxRuntimeExports as j, _defineProperty as k, _slicedToArray as l, warning$1 as m, canUseDom as n, _objectSpread2 as o, updateCSS as p, _arrayWithHoles as q, removeCSS as r, _nonIterableRest as s, resetWarned as t, useForm as u, generate$1 as v, warningOnce as w, presetPrimaryColors as x, presetPalettes as y, _inherits as z };
|
package/es/fields/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export { D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, a as TinyMCE } from '../chunks/Switch-
|
2
|
-
export {
|
1
|
+
export { C as CheckboxField, D as DatePickerField, I as Input, P as PnkxField, R as RangePickerField, a as TinyMCE } from '../chunks/Switch-BUaKQ4cU.js';
|
2
|
+
export { R as RadioGroup, S as Select } from '../chunks/Radio-C3c5Olf1.js';
|
package/es/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/ErrorBoundary-
|
2
|
-
export { D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TinyMCE, T as Typography } from './chunks/Switch-
|
3
|
-
export {
|
1
|
+
export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from './chunks/ErrorBoundary-C5g427OM.js';
|
2
|
+
export { C as CheckboxField, D as DatePickerField, E as ErrorMessage, I as Input, L as Label, P as PnkxField, R as RangePickerField, a as TinyMCE, T as Typography } from './chunks/Switch-BUaKQ4cU.js';
|
3
|
+
export { R as RadioGroup, S as Select } from './chunks/Radio-C3c5Olf1.js';
|
4
4
|
export { u as useToast } from './chunks/cloneDeep-BLYi2V0G.js';
|
5
5
|
export { u as useFiltersHandler, a as useMessage } from './chunks/useMessage-D_-VT5B4.js';
|
package/es/ui/index.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/ErrorBoundary-
|
2
|
-
export { E as ErrorMessage, L as Label, T as Typography } from '../chunks/Switch-
|
1
|
+
export { A as Alert, E as Anchor, G as Appfix, I as AutoComplete, e as Badge, g as Breadcrumb, U as BulkAction, B as Button, C as CascaderField, f as Col, V as ConfirmModal, d as Container, o as Divider, q as Drawer, D as Dropdown, N as Empty, X as ErrorBoundary, F as Flex, H as Heading, O as Image, L as Layout, j as Menu, M as Modal, k as Pagination, J as PnkxCollapse, K as PnkxColorPicker, r as Popconfirm, P as Popover, Q as QRCode, u as Rate, s as Result, R as Row, c as SearchFiltersForm, v as Segmented, m as Sidebar, S as Skeleton, h as Space, p as Spin, i as Splitter, w as Statistic, l as Steps, T as Table, b as Tabs, n as Tag, x as Timeline, a as Tooltip, y as Tour, z as Tree, W as Watermark, t as typeColorMap } from '../chunks/ErrorBoundary-C5g427OM.js';
|
2
|
+
export { E as ErrorMessage, L as Label, T as Typography } from '../chunks/Switch-BUaKQ4cU.js';
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pnkx-lib/ui",
|
3
3
|
"private": false,
|
4
|
-
"version": "1.8.
|
4
|
+
"version": "1.8.6",
|
5
5
|
"type": "module",
|
6
6
|
"main": "./es/index.js",
|
7
7
|
"module": "./es/index.js",
|
@@ -90,6 +90,10 @@
|
|
90
90
|
},
|
91
91
|
"dependencies": {
|
92
92
|
"@ant-design/icons": "^5.6.1",
|
93
|
+
"@dnd-kit/core": "^6.3.1",
|
94
|
+
"@dnd-kit/modifiers": "^9.0.0",
|
95
|
+
"@dnd-kit/sortable": "^10.0.0",
|
96
|
+
"@dnd-kit/utilities": "^3.2.2",
|
93
97
|
"@emotion/css": "^11.13.5",
|
94
98
|
"@headlessui/react": "^2.2.2",
|
95
99
|
"@heroicons/react": "^2.2.0",
|
package/types/index.d.ts
CHANGED
@@ -666,9 +666,9 @@ declare type TabItem = {
|
|
666
666
|
disabled?: boolean;
|
667
667
|
};
|
668
668
|
|
669
|
-
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, ...rest }: TableCommonProps<T>) => JSX.Element;
|
669
|
+
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, titleSettingTableModal, showSetting, setColumns, ...rest }: TableCommonProps<T>) => JSX.Element;
|
670
670
|
|
671
|
-
export declare type TableColumnsType<T> = TableColumnsType_2<T>;
|
671
|
+
export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
|
672
672
|
|
673
673
|
export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
|
674
674
|
editable?: boolean;
|
@@ -676,7 +676,7 @@ export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
|
|
676
676
|
|
677
677
|
export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
|
678
678
|
dataSource: T[];
|
679
|
-
columns: TableColumnsType<T
|
679
|
+
columns: TableColumnsType<T>;
|
680
680
|
loading?: boolean;
|
681
681
|
totalItems: number;
|
682
682
|
filters: any;
|
@@ -690,6 +690,9 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
690
690
|
className?: string;
|
691
691
|
editable?: boolean;
|
692
692
|
onSave?: (data: T) => void;
|
693
|
+
titleSettingTableModal?: string;
|
694
|
+
showSetting?: boolean;
|
695
|
+
setColumns?: (newColumns: TableColumnsType<T>) => void;
|
693
696
|
}
|
694
697
|
|
695
698
|
export declare const Tabs: default_3.FC<TabsProps>;
|
package/types/ui.d.ts
CHANGED
@@ -511,9 +511,9 @@ declare type TabItem = {
|
|
511
511
|
disabled?: boolean;
|
512
512
|
};
|
513
513
|
|
514
|
-
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, ...rest }: TableCommonProps<T>) => JSX.Element;
|
514
|
+
export declare const Table: <T extends RowCommon>({ dataSource, columns, loading, totalItems, filters, onChangePage, onChangePageSize, onSort, rowsSelected, onSelect, onRowClick, rowKey, className, editable, onSave, titleSettingTableModal, showSetting, setColumns, ...rest }: TableCommonProps<T>) => JSX.Element;
|
515
515
|
|
516
|
-
export declare type TableColumnsType<T> = TableColumnsType_2<T>;
|
516
|
+
export declare type TableColumnsType<T> = TableColumnsType_2<T> & TableColumnsTypeEditable<T>;
|
517
517
|
|
518
518
|
export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
|
519
519
|
editable?: boolean;
|
@@ -521,7 +521,7 @@ export declare type TableColumnsTypeEditable<T> = (ColumnTypes<T>[number] & {
|
|
521
521
|
|
522
522
|
export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "columns"> {
|
523
523
|
dataSource: T[];
|
524
|
-
columns: TableColumnsType<T
|
524
|
+
columns: TableColumnsType<T>;
|
525
525
|
loading?: boolean;
|
526
526
|
totalItems: number;
|
527
527
|
filters: any;
|
@@ -535,6 +535,9 @@ export declare interface TableCommonProps<T> extends Omit<TableProps<T>, "column
|
|
535
535
|
className?: string;
|
536
536
|
editable?: boolean;
|
537
537
|
onSave?: (data: T) => void;
|
538
|
+
titleSettingTableModal?: string;
|
539
|
+
showSetting?: boolean;
|
540
|
+
setColumns?: (newColumns: TableColumnsType<T>) => void;
|
538
541
|
}
|
539
542
|
|
540
543
|
export declare const Tabs: default_3.FC<TabsProps>;
|