@pnkx-lib/ui 1.9.532 → 1.9.533

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.
Files changed (38) hide show
  1. package/dist/style.css +2 -2
  2. package/es/chunks/{bundle-mjs-BBFHkixS.js → bundle-mjs-BME7zF0Z.js} +1 -1
  3. package/es/chunks/{index.esm-Ds4t-z37.js → index.esm-AaUjBMaK.js} +55 -90
  4. package/es/chunks/{toArray-7SKWyzWi.js → toArray-DACIS0E1.js} +42 -44
  5. package/es/constants/index.js +1 -0
  6. package/es/fields/CascaderField.js +1 -1
  7. package/es/fields/Checkbox.js +1 -1
  8. package/es/fields/DatePicker.js +1 -1
  9. package/es/fields/DateRangePicker.js +1 -1
  10. package/es/fields/Input.js +1 -1
  11. package/es/fields/InputRangePicker.js +1 -1
  12. package/es/fields/PnkxField.js +1 -1
  13. package/es/fields/Select.js +1 -1
  14. package/es/fields/SliderRanger.js +1 -1
  15. package/es/fields/SliderSingle.js +1 -1
  16. package/es/fields/Switch.js +1 -1
  17. package/es/fields/Textarea.js +1 -1
  18. package/es/fields/TimePicker.js +1 -1
  19. package/es/fields/TimeRangePicker.js +1 -1
  20. package/es/fields/TinyMCE.js +35 -16
  21. package/es/ui/Button.js +1 -1
  22. package/es/ui/Cascader.js +1 -1
  23. package/es/ui/CategoryStatus.js +1 -1
  24. package/es/ui/Container.js +1 -1
  25. package/es/ui/Descriptions.js +1 -1
  26. package/es/ui/GenericUploadModal.js +578 -540
  27. package/es/ui/Label.js +1 -1
  28. package/es/ui/Layout.js +31 -28
  29. package/es/ui/Modal.js +1 -1
  30. package/es/ui/SearchFilterForm.js +1 -1
  31. package/es/ui/SelectSingleTable.js +1 -1
  32. package/es/ui/SelectTable.js +1 -1
  33. package/es/ui/Sidebar/index.js +1 -1
  34. package/es/ui/UploadComponent.js +1 -1
  35. package/es/ui/UploadImage.js +1 -1
  36. package/es/ui/index.js +127 -26
  37. package/package.json +2 -2
  38. package/types/constants/table.d.ts +2 -1
@@ -3,7 +3,7 @@ import { Cascader as Cascader$1 } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const Cascader = (props) => {
9
9
  //! State
@@ -3,7 +3,7 @@ import { Checkbox as Checkbox$1 } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Typography } from '../ui/Typography.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const Checkbox = (props) => {
9
9
  //! State
@@ -10,7 +10,7 @@ import { g as getDefaultExportFromCjs } from '../chunks/_commonjsHelpers-D5KtpA0
10
10
  import { g as get } from '../chunks/get-DPccfEM4.js';
11
11
  import { ErrorMessage } from '../ui/ErrorMessage.js';
12
12
  import { Label } from '../ui/Label.js';
13
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
13
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
14
14
 
15
15
  const CalendarIcon = ({
16
16
  size = 24,
@@ -3,7 +3,7 @@ import { DatePicker } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
  import { w as wrapWithTooltip } from '../chunks/wapper-Bk3PQCcg.js';
8
8
 
9
9
  const { RangePicker: RangePickerPnkx } = DatePicker;
@@ -4,7 +4,7 @@ import { Input as Input$1 } from 'antd';
4
4
  import { g as get } from '../chunks/get-DPccfEM4.js';
5
5
  import { ErrorMessage } from '../ui/ErrorMessage.js';
6
6
  import { Label } from '../ui/Label.js';
7
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
7
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
8
8
  import { Tooltip } from '../ui/Tooltip.js';
9
9
 
10
10
  const AllowClearIcon = ({
@@ -4,7 +4,7 @@ import { InputNumber } from 'antd';
4
4
  import { g as get } from '../chunks/get-DPccfEM4.js';
5
5
  import { ErrorMessage } from '../ui/ErrorMessage.js';
6
6
  import { Label } from '../ui/Label.js';
7
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
7
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
8
8
  import { w as wrapWithTooltip } from '../chunks/wapper-Bk3PQCcg.js';
9
9
 
10
10
  const InputRangePicker = (props) => {
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { C as Controller } from '../chunks/index.esm-Ds4t-z37.js';
3
+ import { C as Controller } from '../chunks/index.esm-AaUjBMaK.js';
4
4
 
5
5
  class PnkxField extends React.PureComponent {
6
6
  render() {
@@ -3,7 +3,7 @@ import { Select as Select$1 } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
  import { R as RefIcon } from '../chunks/CloseOutlined-DdLJZQvZ.js';
8
8
  import { R as RefIcon$1 } from '../chunks/DownOutlined-Cl95zPIN.js';
9
9
  import { useRef } from 'react';
@@ -3,7 +3,7 @@ import { InputNumber, Slider } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const SliderRange = (props) => {
9
9
  //! State
@@ -3,7 +3,7 @@ import { Slider } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const SliderSingle = (props) => {
9
9
  //! State
@@ -3,7 +3,7 @@ import { Switch as Switch$1 } from 'antd';
3
3
  import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { Label } from '../ui/Label.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const Switch = (props) => {
9
9
  //! State
@@ -4,7 +4,7 @@ import { g as get } from '../chunks/get-DPccfEM4.js';
4
4
  import { Input, Tooltip } from 'antd';
5
5
  import { ErrorMessage } from '../ui/ErrorMessage.js';
6
6
  import { Label } from '../ui/Label.js';
7
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
7
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
8
8
 
9
9
  const { TextArea } = Input;
10
10
  const Textarea = forwardRef(
@@ -3,7 +3,7 @@ import { TimePicker as TimePicker$1 } from 'antd';
3
3
  import { Label } from '../ui/Label.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { g as get } from '../chunks/get-DPccfEM4.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const TimePicker = (props) => {
9
9
  const {
@@ -3,7 +3,7 @@ import { TimePicker } from 'antd';
3
3
  import { Label } from '../ui/Label.js';
4
4
  import { ErrorMessage } from '../ui/ErrorMessage.js';
5
5
  import { g as get } from '../chunks/get-DPccfEM4.js';
6
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
6
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
7
7
 
8
8
  const { RangePicker } = TimePicker;
9
9
  const TimeRangePicker = (props) => {
@@ -1281,7 +1281,7 @@ var eventPropTypes = {
1281
1281
  onScriptsLoad: propTypesExports.func,
1282
1282
  onScriptsLoadError: propTypesExports.func,
1283
1283
  };
1284
- var EditorPropTypes = __assign$2({ apiKey: propTypesExports.string, licenseKey: propTypesExports.string, id: propTypesExports.string, inline: propTypesExports.bool, init: propTypesExports.object, initialValue: propTypesExports.string, onEditorChange: propTypesExports.func, value: propTypesExports.string, tagName: propTypesExports.string, tabIndex: propTypesExports.number, cloudChannel: propTypesExports.string, plugins: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]), toolbar: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]), disabled: propTypesExports.bool, textareaName: propTypesExports.string, tinymceScriptSrc: propTypesExports.oneOfType([
1284
+ var EditorPropTypes = __assign$2({ apiKey: propTypesExports.string, licenseKey: propTypesExports.string, id: propTypesExports.string, inline: propTypesExports.bool, init: propTypesExports.object, initialValue: propTypesExports.string, onEditorChange: propTypesExports.func, value: propTypesExports.string, tagName: propTypesExports.string, tabIndex: propTypesExports.number, cloudChannel: propTypesExports.string, plugins: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]), toolbar: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.array]), disabled: propTypesExports.bool, readonly: propTypesExports.bool, textareaName: propTypesExports.string, tinymceScriptSrc: propTypesExports.oneOfType([
1285
1285
  propTypesExports.string,
1286
1286
  propTypesExports.arrayOf(propTypesExports.string),
1287
1287
  propTypesExports.arrayOf(propTypesExports.shape({
@@ -1295,6 +1295,11 @@ var EditorPropTypes = __assign$2({ apiKey: propTypesExports.string, licenseKey:
1295
1295
  delay: propTypesExports.number
1296
1296
  }) }, eventPropTypes);
1297
1297
 
1298
+ var getTinymce = function (view) {
1299
+ var global = view;
1300
+ return global && global.tinymce ? global.tinymce : null;
1301
+ };
1302
+
1298
1303
  var isFunction = function (x) { return typeof x === 'function'; };
1299
1304
  var isEventProp = function (name) { return name in eventPropTypes; };
1300
1305
  var eventAttrToEventName = function (attrName) { return attrName.substr(2); };
@@ -1364,6 +1369,14 @@ var setMode = function (editor, mode) {
1364
1369
  }
1365
1370
  }
1366
1371
  };
1372
+ var getTinymceOrError = function (view) {
1373
+ var tinymce = getTinymce(view);
1374
+ if (!tinymce) {
1375
+ throw new Error('tinymce should have been loaded into global scope');
1376
+ }
1377
+ return tinymce;
1378
+ };
1379
+ var isDisabledOptionSupported = function (editor) { return editor.options && editor.options.isRegistered('disabled'); };
1367
1380
 
1368
1381
  var __assign$1 = (undefined && undefined.__assign) || function () {
1369
1382
  __assign$1 = Object.assign || function(t) {
@@ -1508,11 +1521,6 @@ var createScriptLoader = function () {
1508
1521
  };
1509
1522
  var ScriptLoader = createScriptLoader();
1510
1523
 
1511
- var getTinymce = function (view) {
1512
- var global = view;
1513
- return global && global.tinymce ? global.tinymce : null;
1514
- };
1515
-
1516
1524
  var __extends = (undefined && undefined.__extends) || (function () {
1517
1525
  var extendStatics = function (d, b) {
1518
1526
  extendStatics = Object.setPrototypeOf ||
@@ -1633,11 +1641,8 @@ var Editor = /** @class */ (function (_super) {
1633
1641
  }
1634
1642
  return;
1635
1643
  }
1636
- var tinymce = getTinymce(_this.view);
1637
- if (!tinymce) {
1638
- throw new Error('tinymce should have been loaded into global scope');
1639
- }
1640
- var finalInit = __assign(__assign(__assign(__assign({}, _this.props.init), { selector: undefined, target: target, readonly: _this.props.disabled, inline: _this.inline, plugins: mergePlugins((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar }), (_this.props.licenseKey ? { license_key: _this.props.licenseKey } : {})), { setup: function (editor) {
1644
+ var tinymce = getTinymceOrError(_this.view);
1645
+ var finalInit = __assign(__assign(__assign(__assign({}, _this.props.init), { selector: undefined, target: target, disabled: _this.props.disabled, readonly: _this.props.readonly, inline: _this.inline, plugins: mergePlugins((_a = _this.props.init) === null || _a === void 0 ? void 0 : _a.plugins, _this.props.plugins), toolbar: (_b = _this.props.toolbar) !== null && _b !== void 0 ? _b : (_c = _this.props.init) === null || _c === void 0 ? void 0 : _c.toolbar }), (_this.props.licenseKey ? { license_key: _this.props.licenseKey } : {})), { setup: function (editor) {
1641
1646
  _this.editor = editor;
1642
1647
  _this.bindHandlers({});
1643
1648
  // When running in inline mode the editor gets the initial value
@@ -1654,8 +1659,16 @@ var Editor = /** @class */ (function (_super) {
1654
1659
  if (_this.props.init && isFunction(_this.props.init.setup)) {
1655
1660
  _this.props.init.setup(editor);
1656
1661
  }
1662
+ if (_this.props.disabled) {
1663
+ if (isDisabledOptionSupported(_this.editor)) {
1664
+ _this.editor.options.set('disabled', _this.props.disabled);
1665
+ }
1666
+ else {
1667
+ _this.editor.mode.set('readonly');
1668
+ }
1669
+ }
1657
1670
  }, init_instance_callback: function (editor) {
1658
- var _a, _b;
1671
+ var _a;
1659
1672
  // check for changes that happened since tinymce.init() was called
1660
1673
  var initialValue = _this.getInitialValue();
1661
1674
  _this.currentContent = (_a = _this.currentContent) !== null && _a !== void 0 ? _a : editor.getContent();
@@ -1667,8 +1680,6 @@ var Editor = /** @class */ (function (_super) {
1667
1680
  editor.undoManager.add();
1668
1681
  editor.setDirty(false);
1669
1682
  }
1670
- var disabled = (_b = _this.props.disabled) !== null && _b !== void 0 ? _b : false;
1671
- setMode(_this.editor, disabled ? 'readonly' : 'design');
1672
1683
  // ensure existing init_instance_callback is called
1673
1684
  if (_this.props.init && isFunction(_this.props.init.init_instance_callback)) {
1674
1685
  _this.props.init.init_instance_callback(editor);
@@ -1746,9 +1757,17 @@ var Editor = /** @class */ (function (_super) {
1746
1757
  }
1747
1758
  });
1748
1759
  }
1760
+ if (this.props.readonly !== prevProps.readonly) {
1761
+ var readonly = (_b = this.props.readonly) !== null && _b !== void 0 ? _b : false;
1762
+ setMode(this.editor, readonly ? 'readonly' : 'design');
1763
+ }
1749
1764
  if (this.props.disabled !== prevProps.disabled) {
1750
- var disabled = (_b = this.props.disabled) !== null && _b !== void 0 ? _b : false;
1751
- setMode(this.editor, disabled ? 'readonly' : 'design');
1765
+ if (isDisabledOptionSupported(this.editor)) {
1766
+ this.editor.options.set('disabled', this.props.disabled);
1767
+ }
1768
+ else {
1769
+ setMode(this.editor, this.props.disabled ? 'readonly' : 'design');
1770
+ }
1752
1771
  }
1753
1772
  }
1754
1773
  }
package/es/ui/Button.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Button as Button$1 } from 'antd';
3
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
4
4
 
5
5
  const Button = (props) => {
6
6
  const { onClick, ...restProps } = props;
package/es/ui/Cascader.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Cascader } from 'antd';
3
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
4
4
 
5
5
  const CascaderField = (props) => {
6
6
  const {
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
2
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
3
3
 
4
4
  var CATEGORY_LIST_ENUM = /* @__PURE__ */ ((CATEGORY_LIST_ENUM2) => {
5
5
  CATEGORY_LIST_ENUM2[CATEGORY_LIST_ENUM2["DRAFT"] = 0] = "DRAFT";
@@ -1,5 +1,5 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
2
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
3
3
 
4
4
  const Container = ({
5
5
  children,
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { Descriptions as Descriptions$1 } from 'antd';
3
- import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
3
+ import { t as twMerge } from '../chunks/bundle-mjs-BME7zF0Z.js';
4
4
 
5
5
  const Descriptions = (props) => {
6
6
  const { className } = props;