@pnkx-lib/ui 1.9.359 → 1.9.361
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/style.css +1 -1
- package/es/assets/ui-9w5HHtWe.css +823 -0
- package/es/chunks/{AntdIcon-DSoxq9aC.js → AntdIcon-gUuMvf83.js} +1 -1
- package/es/chunks/{CloseOutlined-D4eYNdNo.js → CloseOutlined-D9hb-IcI.js} +1 -1
- package/es/chunks/{DownOutlined-DifOcKuo.js → DownOutlined-CkHKgaSi.js} +1 -1
- package/es/chunks/{InboxOutlined-DNCJCjk3.js → InboxOutlined-Kgn4qaDi.js} +1 -1
- package/es/chunks/_commonjsHelpers-D5KtpA0t.js +32 -0
- package/es/chunks/{get-C880miVG.js → get-DPccfEM4.js} +1 -1
- package/es/chunks/{index-mzHK7Za8.js → index-D7kJLZIi.js} +1 -1
- package/es/chunks/{layout-DoBNb9xg.js → layout-C0dbwkpb.js} +2 -2
- package/es/fields/CascaderField.js +1 -1
- package/es/fields/Checkbox.js +1 -1
- package/es/fields/DatePicker.js +3 -3
- package/es/fields/DateRangePicker.js +1 -1
- package/es/fields/Input.js +1 -1
- package/es/fields/Radio.js +1 -1
- package/es/fields/Select.js +3 -3
- package/es/fields/SliderRanger.js +1 -1
- package/es/fields/SliderSingle.js +1 -1
- package/es/fields/Switch.js +1 -1
- package/es/fields/Textarea.js +1 -1
- package/es/fields/TimePicker.js +1 -1
- package/es/fields/TimeRangePicker.js +1 -1
- package/es/fields/TinyMCE.js +16 -71
- package/es/fields/Upload.js +2 -2
- package/es/index.js +1 -0
- package/es/ui/BreadcrumbHeading.js +1 -1
- package/es/ui/ExportFile.js +1 -1
- package/es/ui/Heading.js +1 -1
- package/es/ui/ImportFile.js +2 -2
- package/es/ui/Layout.js +1 -1
- package/es/ui/SearchFilterForm.js +1 -1
- package/es/ui/Sidebar.js +3 -3
- package/es/ui/UploadComponent.js +6 -2
- package/es/ui/UploadMultiple.js +10 -66
- package/es/ui/ViewPdf.js +29162 -0
- package/es/ui/index.js +1 -0
- package/package.json +4 -1
- package/types/components/ui/UploadComponent.d.ts +1 -0
- package/types/components/ui/UploadMultiple.d.ts +2 -1
- package/types/components/ui/ViewPdf.d.ts +5 -0
- package/types/components/ui/index.d.ts +1 -0
- package/types/ui/ViewPdf.d.ts +2 -0
- package/es/assets/ui-Jiyqh2vu.css +0 -820
- package/es/chunks/_commonjsHelpers-BFTU3MAI.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as _unsupportedIterableToArray, b as _defineProperty, _ as _typeof } from './defineProperty-CTLrw71t.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { createContext, useContext, useEffect } from 'react';
|
|
4
|
-
import { c as className } from './index-
|
|
4
|
+
import { c as className } from './index-D7kJLZIi.js';
|
|
5
5
|
|
|
6
6
|
var IconContext = /*#__PURE__*/createContext({});
|
|
7
7
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function getAugmentedNamespace(n) {
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
|
|
9
|
+
var f = n.default;
|
|
10
|
+
if (typeof f == "function") {
|
|
11
|
+
var a = function a () {
|
|
12
|
+
if (this instanceof a) {
|
|
13
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
14
|
+
}
|
|
15
|
+
return f.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
a.prototype = f.prototype;
|
|
18
|
+
} else a = {};
|
|
19
|
+
Object.defineProperty(a, '__esModule', {value: true});
|
|
20
|
+
Object.keys(n).forEach(function (k) {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
22
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return n[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
return a;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { getAugmentedNamespace as a, commonjsGlobal as c, getDefaultExportFromCjs as g };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { _ as _typeof, c as _arrayLikeToArray, a as _unsupportedIterableToArray, b as _defineProperty } from './defineProperty-CTLrw71t.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useContext, createContext, useState, useEffect, useRef } from 'react';
|
|
4
|
-
import { c as className } from './index-
|
|
4
|
+
import { c as className } from './index-D7kJLZIi.js';
|
|
5
5
|
import { _ as _createClass, a as _classCallCheck, b as _inherits, c as _createSuper, d as _assertThisInitialized } from './createSuper-C90IQ42g.js';
|
|
6
|
-
import { I as Icon, _ as _extends, w as warningOnce, a as _slicedToArray, b as warning$1, c as canUseDom, d as _objectSpread2, u as updateCSS, r as removeCSS, e as _arrayWithHoles, f as _nonIterableRest, g as resetWarned$1, F as FastColor, h as generate, p as presetPrimaryColors, i as presetPalettes, j as _objectWithoutProperties, k as IconContext } from './AntdIcon-
|
|
6
|
+
import { I as Icon, _ as _extends, w as warningOnce, a as _slicedToArray, b as warning$1, c as canUseDom, d as _objectSpread2, u as updateCSS, r as removeCSS, e as _arrayWithHoles, f as _nonIterableRest, g as resetWarned$1, F as FastColor, h as generate, p as presetPrimaryColors, i as presetPalettes, j as _objectWithoutProperties, k as IconContext } from './AntdIcon-gUuMvf83.js';
|
|
7
7
|
|
|
8
8
|
// This icon file is generated automatically.
|
|
9
9
|
var BarsOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, "name": "bars", "theme": "outlined" };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Cascader as Cascader$1 } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/Checkbox.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Checkbox as Checkbox$1 } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/DatePicker.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { createElement, Component, createRef, useRef } from 'react';
|
|
4
|
-
import { c as className } from '../chunks/index-
|
|
4
|
+
import { c as className } from '../chunks/index-D7kJLZIi.js';
|
|
5
5
|
import { _ as _typeof, a as _unsupportedIterableToArray, b as _defineProperty } from '../chunks/defineProperty-CTLrw71t.js';
|
|
6
6
|
import { b as _inherits, c as _createSuper, a as _classCallCheck, d as _assertThisInitialized$1, _ as _createClass } from '../chunks/createSuper-C90IQ42g.js';
|
|
7
7
|
import * as ReactDOM from 'react-dom';
|
|
8
8
|
import ReactDOM__default, { findDOMNode } from 'react-dom';
|
|
9
|
-
import { g as getDefaultExportFromCjs } from '../chunks/_commonjsHelpers-
|
|
10
|
-
import { g as get } from '../chunks/get-
|
|
9
|
+
import { g as getDefaultExportFromCjs } from '../chunks/_commonjsHelpers-D5KtpA0t.js';
|
|
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
13
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { DatePicker } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/Input.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import React__default, { useRef, useState, useEffect, useLayoutEffect, useMemo, forwardRef, useCallback } from 'react';
|
|
3
3
|
import { Input as Input$1 } from 'antd';
|
|
4
|
-
import { g as get } from '../chunks/get-
|
|
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
7
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/Radio.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Radio } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
|
package/es/fields/Select.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Select as Select$1 } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
7
|
-
import { R as RefIcon } from '../chunks/CloseOutlined-
|
|
8
|
-
import { R as RefIcon$1 } from '../chunks/DownOutlined-
|
|
7
|
+
import { R as RefIcon } from '../chunks/CloseOutlined-D9hb-IcI.js';
|
|
8
|
+
import { R as RefIcon$1 } from '../chunks/DownOutlined-CkHKgaSi.js';
|
|
9
9
|
import { useRef } from 'react';
|
|
10
10
|
import { M as MAX_TAG_TEXT_LENGTH, a as MAX_TAG_COUNT } from '../chunks/common-BcURBmQ-.js';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { InputNumber, Slider } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Slider } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/Switch.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Switch as Switch$1 } from 'antd';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
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
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
package/es/fields/Textarea.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { g as get } from '../chunks/get-
|
|
3
|
+
import { g as get } from '../chunks/get-DPccfEM4.js';
|
|
4
4
|
import { Input } from 'antd';
|
|
5
5
|
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
6
6
|
import { Label } from '../ui/Label.js';
|
package/es/fields/TimePicker.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { TimePicker as TimePicker$1 } from 'antd';
|
|
3
3
|
import { Label } from '../ui/Label.js';
|
|
4
4
|
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
5
|
-
import { g as get } from '../chunks/get-
|
|
5
|
+
import { g as get } from '../chunks/get-DPccfEM4.js';
|
|
6
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
7
7
|
|
|
8
8
|
const TimePicker = (props) => {
|
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { TimePicker } from 'antd';
|
|
3
3
|
import { Label } from '../ui/Label.js';
|
|
4
4
|
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
5
|
-
import { g as get } from '../chunks/get-
|
|
5
|
+
import { g as get } from '../chunks/get-DPccfEM4.js';
|
|
6
6
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
7
7
|
|
|
8
8
|
const { RangePicker } = TimePicker;
|
package/es/fields/TinyMCE.js
CHANGED
|
@@ -1282,7 +1282,7 @@ var eventPropTypes = {
|
|
|
1282
1282
|
onScriptsLoad: propTypesExports.func,
|
|
1283
1283
|
onScriptsLoadError: propTypesExports.func,
|
|
1284
1284
|
};
|
|
1285
|
-
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,
|
|
1285
|
+
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([
|
|
1286
1286
|
propTypesExports.string,
|
|
1287
1287
|
propTypesExports.arrayOf(propTypesExports.string),
|
|
1288
1288
|
propTypesExports.arrayOf(propTypesExports.shape({
|
|
@@ -1296,50 +1296,6 @@ var EditorPropTypes = __assign$2({ apiKey: propTypesExports.string, licenseKey:
|
|
|
1296
1296
|
delay: propTypesExports.number
|
|
1297
1297
|
}) }, eventPropTypes);
|
|
1298
1298
|
|
|
1299
|
-
var getTinymce = function (view) {
|
|
1300
|
-
var global = view;
|
|
1301
|
-
return global && global.tinymce ? global.tinymce : null;
|
|
1302
|
-
};
|
|
1303
|
-
|
|
1304
|
-
const toInt = (str) => parseInt(str, 10);
|
|
1305
|
-
const cmp = (a, b) => {
|
|
1306
|
-
const delta = a - b;
|
|
1307
|
-
if (delta === 0) {
|
|
1308
|
-
return 0 /* Comparison.EQ */;
|
|
1309
|
-
}
|
|
1310
|
-
return delta > 0 ? 1 /* Comparison.GT */ : -1 /* Comparison.LT */;
|
|
1311
|
-
};
|
|
1312
|
-
const nu = (major, minor, patch) => ({ major, minor, patch });
|
|
1313
|
-
const parse = (versionString) => {
|
|
1314
|
-
const parts = /([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(versionString);
|
|
1315
|
-
return parts ? nu(toInt(parts[1]), toInt(parts[2]), toInt(parts[3])) : nu(0, 0, 0);
|
|
1316
|
-
};
|
|
1317
|
-
const compare = (version1, version2) => {
|
|
1318
|
-
const cmp1 = cmp(version1.major, version2.major);
|
|
1319
|
-
if (cmp1 !== 0 /* Comparison.EQ */) {
|
|
1320
|
-
return cmp1;
|
|
1321
|
-
}
|
|
1322
|
-
const cmp2 = cmp(version1.minor, version2.minor);
|
|
1323
|
-
if (cmp2 !== 0 /* Comparison.EQ */) {
|
|
1324
|
-
return cmp2;
|
|
1325
|
-
}
|
|
1326
|
-
const cmp3 = cmp(version1.patch, version2.patch);
|
|
1327
|
-
if (cmp3 !== 0 /* Comparison.EQ */) {
|
|
1328
|
-
return cmp3;
|
|
1329
|
-
}
|
|
1330
|
-
return 0 /* Comparison.EQ */;
|
|
1331
|
-
};
|
|
1332
|
-
|
|
1333
|
-
// Creates a semver string out of tinymce major and minor properties this also handles
|
|
1334
|
-
// the pre semver case with 3.x versions of tinymce having a extra dot 1.2.3.4 we simply
|
|
1335
|
-
// ignore the extra dot and normalize that to proper semver
|
|
1336
|
-
const createSemVer = (tinymce) => {
|
|
1337
|
-
const semver = [tinymce.majorVersion, tinymce.minorVersion].join('.');
|
|
1338
|
-
return semver.split('.').slice(0, 3).join('.');
|
|
1339
|
-
};
|
|
1340
|
-
const getVersion = (tinymce) => parse(createSemVer(tinymce));
|
|
1341
|
-
const isLessThan = (tinymce, version) => !tinymce ? false : compare(getVersion(tinymce), parse(version)) === -1 /* Semver.Comparison.LT */;
|
|
1342
|
-
|
|
1343
1299
|
var isFunction = function (x) { return typeof x === 'function'; };
|
|
1344
1300
|
var isEventProp = function (name) { return name in eventPropTypes; };
|
|
1345
1301
|
var eventAttrToEventName = function (attrName) { return attrName.substr(2); };
|
|
@@ -1409,17 +1365,6 @@ var setMode = function (editor, mode) {
|
|
|
1409
1365
|
}
|
|
1410
1366
|
}
|
|
1411
1367
|
};
|
|
1412
|
-
var getTinymceOrError = function (view) {
|
|
1413
|
-
var tinymce = getTinymce(view);
|
|
1414
|
-
if (!tinymce) {
|
|
1415
|
-
throw new Error('tinymce should have been loaded into global scope');
|
|
1416
|
-
}
|
|
1417
|
-
return tinymce;
|
|
1418
|
-
};
|
|
1419
|
-
var isDisabledOptionSupported = function (view) {
|
|
1420
|
-
var tinymce = getTinymceOrError(view);
|
|
1421
|
-
return !isLessThan(tinymce, '7.6.0');
|
|
1422
|
-
};
|
|
1423
1368
|
|
|
1424
1369
|
var __assign$1 = (undefined && undefined.__assign) || function () {
|
|
1425
1370
|
__assign$1 = Object.assign || function(t) {
|
|
@@ -1564,6 +1509,11 @@ var createScriptLoader = function () {
|
|
|
1564
1509
|
};
|
|
1565
1510
|
var ScriptLoader = createScriptLoader();
|
|
1566
1511
|
|
|
1512
|
+
var getTinymce = function (view) {
|
|
1513
|
+
var global = view;
|
|
1514
|
+
return global && global.tinymce ? global.tinymce : null;
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1567
1517
|
var __extends = (undefined && undefined.__extends) || (function () {
|
|
1568
1518
|
var extendStatics = function (d, b) {
|
|
1569
1519
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -1684,10 +1634,11 @@ var Editor = /** @class */ (function (_super) {
|
|
|
1684
1634
|
}
|
|
1685
1635
|
return;
|
|
1686
1636
|
}
|
|
1687
|
-
var tinymce =
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1637
|
+
var tinymce = getTinymce(_this.view);
|
|
1638
|
+
if (!tinymce) {
|
|
1639
|
+
throw new Error('tinymce should have been loaded into global scope');
|
|
1640
|
+
}
|
|
1641
|
+
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) {
|
|
1691
1642
|
_this.editor = editor;
|
|
1692
1643
|
_this.bindHandlers({});
|
|
1693
1644
|
// When running in inline mode the editor gets the initial value
|
|
@@ -1705,7 +1656,7 @@ var Editor = /** @class */ (function (_super) {
|
|
|
1705
1656
|
_this.props.init.setup(editor);
|
|
1706
1657
|
}
|
|
1707
1658
|
}, init_instance_callback: function (editor) {
|
|
1708
|
-
var _a;
|
|
1659
|
+
var _a, _b;
|
|
1709
1660
|
// check for changes that happened since tinymce.init() was called
|
|
1710
1661
|
var initialValue = _this.getInitialValue();
|
|
1711
1662
|
_this.currentContent = (_a = _this.currentContent) !== null && _a !== void 0 ? _a : editor.getContent();
|
|
@@ -1717,6 +1668,8 @@ var Editor = /** @class */ (function (_super) {
|
|
|
1717
1668
|
editor.undoManager.add();
|
|
1718
1669
|
editor.setDirty(false);
|
|
1719
1670
|
}
|
|
1671
|
+
var disabled = (_b = _this.props.disabled) !== null && _b !== void 0 ? _b : false;
|
|
1672
|
+
setMode(_this.editor, disabled ? 'readonly' : 'design');
|
|
1720
1673
|
// ensure existing init_instance_callback is called
|
|
1721
1674
|
if (_this.props.init && isFunction(_this.props.init.init_instance_callback)) {
|
|
1722
1675
|
_this.props.init.init_instance_callback(editor);
|
|
@@ -1794,17 +1747,9 @@ var Editor = /** @class */ (function (_super) {
|
|
|
1794
1747
|
}
|
|
1795
1748
|
});
|
|
1796
1749
|
}
|
|
1797
|
-
if (this.props.readonly !== prevProps.readonly) {
|
|
1798
|
-
var readonly = (_b = this.props.readonly) !== null && _b !== void 0 ? _b : false;
|
|
1799
|
-
setMode(this.editor, readonly ? 'readonly' : 'design');
|
|
1800
|
-
}
|
|
1801
1750
|
if (this.props.disabled !== prevProps.disabled) {
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
}
|
|
1805
|
-
else {
|
|
1806
|
-
setMode(this.editor, this.props.disabled ? 'readonly' : 'design');
|
|
1807
|
-
}
|
|
1751
|
+
var disabled = (_b = this.props.disabled) !== null && _b !== void 0 ? _b : false;
|
|
1752
|
+
setMode(this.editor, disabled ? 'readonly' : 'design');
|
|
1808
1753
|
}
|
|
1809
1754
|
}
|
|
1810
1755
|
}
|
package/es/fields/Upload.js
CHANGED
|
@@ -2,10 +2,10 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { Upload, Image } from 'antd';
|
|
5
|
-
import { g as get } from '../chunks/get-
|
|
5
|
+
import { g as get } from '../chunks/get-DPccfEM4.js';
|
|
6
6
|
import { ErrorMessage } from '../ui/ErrorMessage.js';
|
|
7
7
|
import { Label } from '../ui/Label.js';
|
|
8
|
-
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-
|
|
8
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-gUuMvf83.js';
|
|
9
9
|
|
|
10
10
|
// This icon file is generated automatically.
|
|
11
11
|
var PlusOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z" } }, { "tag": "path", "attrs": { "d": "M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z" } }] }, "name": "plus", "theme": "outlined" };
|
package/es/index.js
CHANGED
|
@@ -62,6 +62,7 @@ export { ImportFile } from './ui/ImportFile.js';
|
|
|
62
62
|
export { ExportFile } from './ui/ExportFile.js';
|
|
63
63
|
export { UploadComponent } from './ui/UploadComponent.js';
|
|
64
64
|
export { useAppMessage } from './ui/Message.js';
|
|
65
|
+
export { ViewPdf } from './ui/ViewPdf.js';
|
|
65
66
|
export { Input } from './fields/Input.js';
|
|
66
67
|
export { PnkxField } from './fields/PnkxField.js';
|
|
67
68
|
export { Select } from './fields/Select.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { c as className } from '../chunks/index-
|
|
2
|
+
import { c as className } from '../chunks/index-D7kJLZIi.js';
|
|
3
3
|
import { Breadcrumb } from './Breadcrumb.js';
|
|
4
4
|
import { u as useBreadcrumb } from '../chunks/useBreadcrumb-DWfSfaDb.js';
|
|
5
5
|
|
package/es/ui/ExportFile.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Spin } from './Spin.js';
|
|
3
|
-
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-
|
|
3
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-gUuMvf83.js';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { PnkxField } from '../fields/PnkxField.js';
|
|
6
6
|
import { RadioGroup } from '../fields/Radio.js';
|
package/es/ui/Heading.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { c as className } from '../chunks/index-
|
|
2
|
+
import { c as className } from '../chunks/index-D7kJLZIi.js';
|
|
3
3
|
import { WrapperBreadcrumb } from './WrapperBreadcrumb.js';
|
|
4
4
|
|
|
5
5
|
const Heading = (props) => {
|
package/es/ui/ImportFile.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Upload } from 'antd';
|
|
3
|
-
import { R as RefIcon$2 } from '../chunks/InboxOutlined-
|
|
4
|
-
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-
|
|
3
|
+
import { R as RefIcon$2 } from '../chunks/InboxOutlined-Kgn4qaDi.js';
|
|
4
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-gUuMvf83.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
// This icon file is generated automatically.
|
package/es/ui/Layout.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { S as SiderContext, a as Sider, C as Content, F as Footer, H as Header, L as Layout$1 } from '../chunks/layout-
|
|
2
|
+
import { S as SiderContext, a as Sider, C as Content, F as Footer, H as Header, L as Layout$1 } from '../chunks/layout-C0dbwkpb.js';
|
|
3
3
|
|
|
4
4
|
const LayoutComponent = ({
|
|
5
5
|
layoutClassName,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { u as useForm } from '../chunks/index.esm-o4O8pXMN.js';
|
|
3
3
|
import { Button } from './Button.js';
|
|
4
|
-
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-
|
|
4
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-gUuMvf83.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
|
|
7
7
|
// This icon file is generated automatically.
|
package/es/ui/Sidebar.js
CHANGED
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
4
4
|
import { useNavigate, useLocation } from 'react-router';
|
|
5
5
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
6
|
-
import { H as Header } from '../chunks/layout-
|
|
6
|
+
import { H as Header } from '../chunks/layout-C0dbwkpb.js';
|
|
7
7
|
import { AutoComplete, Divider, Dropdown, Flex } from 'antd';
|
|
8
8
|
import { Input } from '../fields/Input.js';
|
|
9
|
-
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-
|
|
10
|
-
import { R as RefIcon$1 } from '../chunks/DownOutlined-
|
|
9
|
+
import { I as Icon, _ as _extends } from '../chunks/AntdIcon-gUuMvf83.js';
|
|
10
|
+
import { R as RefIcon$1 } from '../chunks/DownOutlined-CkHKgaSi.js';
|
|
11
11
|
|
|
12
12
|
// This icon file is generated automatically.
|
|
13
13
|
var UpOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z" } }] }, "name": "up", "theme": "outlined" };
|
package/es/ui/UploadComponent.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Upload, Image, Tooltip } from 'antd';
|
|
|
3
3
|
import { Spin } from './Spin.js';
|
|
4
4
|
import { t as twMerge } from '../chunks/bundle-mjs-BBFHkixS.js';
|
|
5
5
|
import { Label } from './Label.js';
|
|
6
|
-
import { R as RefIcon } from '../chunks/CloseOutlined-
|
|
6
|
+
import { R as RefIcon } from '../chunks/CloseOutlined-D9hb-IcI.js';
|
|
7
7
|
|
|
8
8
|
const logoUpload = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUgAAADwCAYAAABi+v2fAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAvgSURBVHgB7d1db1VVGsDx1RdqEeLo4IxekDiJF3PpxXz/j8CFFyZDIglEsIgg1aFAAT3Tp4ctLXbR9pz9stbav1/SdDKKPUr5d++z9/Psjb39xSIB8L7FZgLgTAIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZAgmQIZAAGQIJkCGQABkCCZAhkAAZ24lZ29w4+iY4+jH50ZWUto4+X9la/n8bG8u/vlik9OaP5edXb95+/J5gFgRypna2llH8eOddDM8Sfy2iefxr3n63RCxfvk7p4HAZT2iVQM5MhPH67rvYrSKieXVn+RFHlL++SOl3oaRBG3v7cTxA6+K0+dpHy48hx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3PpU2yjg0Ct7vx8uQ1Alwqk0UGgdrE4Z//5xf7eCwfS6CDQiriR/CIbgM4NZFyEiTgaHQRacdHlFpvn/kM8khVo0EUimQ2k0UGgdectt9jM/iI3gAMz0EXyrHu6N8/8m8URmJGue+9H8lQg43T61j1xBOaneyT1SX8GMm6ePKugAHOx/+L0BqDjUUOjgwBLcdfO9tGh49f/PPp870lauAEc4J3YALS9lRb/B9liYwc2k2vmAAAAAElFTkSuQmCC";
|
|
9
9
|
|
|
@@ -21,6 +21,7 @@ const UploadComponent = ({
|
|
|
21
21
|
description = "Ảnh có kích thước 400x400 px và dung lượng ảnh < 1 mb",
|
|
22
22
|
customRequest,
|
|
23
23
|
setImageUpload,
|
|
24
|
+
clickIconRemove,
|
|
24
25
|
...restProps
|
|
25
26
|
}) => {
|
|
26
27
|
const imageUrl = typeof field?.value === "string" ? field.value : field?.value instanceof File ? URL.createObjectURL(field.value) : null;
|
|
@@ -65,7 +66,10 @@ const UploadComponent = ({
|
|
|
65
66
|
"button",
|
|
66
67
|
{
|
|
67
68
|
type: "button",
|
|
68
|
-
onClick:
|
|
69
|
+
onClick: () => {
|
|
70
|
+
handleRemoveImage();
|
|
71
|
+
clickIconRemove?.();
|
|
72
|
+
},
|
|
69
73
|
className: "absolute top-1 right-1 w-6 h-6 flex items-center justify-center bg-white cursor-pointer bg-opacity-80 rounded-full hover:bg-opacity-100 transition",
|
|
70
74
|
children: /* @__PURE__ */ jsx(RefIcon, { className: "text-black text-[12px]" })
|
|
71
75
|
}
|
package/es/ui/UploadMultiple.js
CHANGED
|
@@ -1,75 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { C as Controller } from '../chunks/index.esm-o4O8pXMN.js';
|
|
5
|
-
import { R as RefIcon } from '../chunks/InboxOutlined-DNCJCjk3.js';
|
|
2
|
+
import { Spin, Upload } from 'antd';
|
|
3
|
+
import { R as RefIcon } from '../chunks/InboxOutlined-Kgn4qaDi.js';
|
|
6
4
|
|
|
7
5
|
const { Dragger } = Upload;
|
|
8
6
|
const UploadMultiple = ({
|
|
9
|
-
name,
|
|
10
|
-
control,
|
|
11
7
|
title,
|
|
12
|
-
content
|
|
8
|
+
content,
|
|
9
|
+
isLoading,
|
|
10
|
+
...props
|
|
13
11
|
}) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
fileList: value,
|
|
20
|
-
customRequest: async ({ file, onSuccess, onError }) => {
|
|
21
|
-
const formData = new FormData();
|
|
22
|
-
formData.append("file", file);
|
|
23
|
-
formData.append("upload_preset", "ml_default");
|
|
24
|
-
setIsLoading(true);
|
|
25
|
-
try {
|
|
26
|
-
const res = await fetch(
|
|
27
|
-
"https://api.cloudinary.com/v1_1/dhtrzmzd3/image/upload",
|
|
28
|
-
{
|
|
29
|
-
method: "POST",
|
|
30
|
-
body: formData
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
const data = await res.json();
|
|
34
|
-
const newFile = {
|
|
35
|
-
uid: data.asset_id || Date.now().toString(),
|
|
36
|
-
name: data.original_filename,
|
|
37
|
-
url: data.secure_url
|
|
38
|
-
};
|
|
39
|
-
onChange([...value || [], newFile]);
|
|
40
|
-
onSuccess?.(data, new XMLHttpRequest());
|
|
41
|
-
message.success("Tải ảnh lên thành công.");
|
|
42
|
-
} catch (err) {
|
|
43
|
-
onError?.(err);
|
|
44
|
-
message.error("Tải ảnh lên thất bại.");
|
|
45
|
-
} finally {
|
|
46
|
-
setIsLoading(false);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
onPreview: (file) => {
|
|
50
|
-
window.open(file.url, "_blank");
|
|
51
|
-
},
|
|
52
|
-
onRemove: (file) => {
|
|
53
|
-
const newList = (value || []).filter((item) => item.uid !== file.uid);
|
|
54
|
-
onChange(newList);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return /* @__PURE__ */ jsx(
|
|
58
|
-
Controller,
|
|
59
|
-
{
|
|
60
|
-
name,
|
|
61
|
-
control,
|
|
62
|
-
render: ({ field }) => {
|
|
63
|
-
const { value, onChange } = field;
|
|
64
|
-
const props = createUploadProps(value || [], onChange);
|
|
65
|
-
return /* @__PURE__ */ jsx(Spin, { spinning: isLoading, tip: "Đang tải", children: /* @__PURE__ */ jsxs(Dragger, { ...props, children: [
|
|
66
|
-
/* @__PURE__ */ jsx("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ jsx(RefIcon, {}) }),
|
|
67
|
-
/* @__PURE__ */ jsx("p", { className: "ant-upload-text", children: title }),
|
|
68
|
-
/* @__PURE__ */ jsx("p", { className: "ant-upload-hint", children: content })
|
|
69
|
-
] }) });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
);
|
|
12
|
+
return /* @__PURE__ */ jsx(Spin, { spinning: isLoading, tip: "Đang tải", children: /* @__PURE__ */ jsxs(Dragger, { ...props, children: [
|
|
13
|
+
/* @__PURE__ */ jsx("p", { className: "ant-upload-drag-icon", children: /* @__PURE__ */ jsx(RefIcon, {}) }),
|
|
14
|
+
/* @__PURE__ */ jsx("p", { className: "ant-upload-text", children: title }),
|
|
15
|
+
/* @__PURE__ */ jsx("p", { className: "ant-upload-hint", children: content })
|
|
16
|
+
] }) });
|
|
73
17
|
};
|
|
74
18
|
|
|
75
19
|
export { UploadMultiple };
|