vap1 0.4.5 → 0.5.0
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/base.json +30 -0
- package/basetype.d.ts +4 -1
- package/cems/admin/AsyncSelect.d.ts +45 -0
- package/cems/admin/AsyncSelect.js +2 -0
- package/cems/admin/CardTable.d.ts +207 -0
- package/cems/admin/CardTable.js +2 -0
- package/cems/admin/EasyuiTree.d.ts +131 -0
- package/cems/admin/EasyuiTree.js +2 -0
- package/cems/admin/utils.d.ts +5 -0
- package/cems/admin/utils.js +3 -0
- package/cems/admin/validator.d.ts +137 -0
- package/cems/admin/validator.js +2 -0
- package/cems/assets/CUpload.d.ts +23 -0
- package/cems/assets/CUpload.js +2 -0
- package/cems/assets/Charts.d.ts +37 -0
- package/cems/assets/Charts.js +2 -0
- package/cems/assets/DInfo.d.ts +38 -0
- package/cems/assets/DInfo.js +2 -0
- package/cems/assets/DModal.d.ts +84 -0
- package/cems/assets/DModal.js +2 -0
- package/cems/assets/DTable.d.ts +128 -0
- package/cems/assets/DTable.js +2 -0
- package/cems/assets/DivWidth.d.ts +14 -0
- package/cems/assets/DivWidth.js +2 -0
- package/cems/assets/Patch.d.ts +9 -0
- package/cems/assets/Patch.js +2 -0
- package/cems/assets/Sensitive.d.ts +33 -0
- package/cems/assets/Sensitive.js +2 -0
- package/cems/assets/types.d.ts +200 -0
- package/cems/assets/types.js +2 -0
- package/cems/assets/utils.d.ts +61 -0
- package/cems/assets/utils.js +2 -0
- package/cems/define.d.ts +9 -0
- package/cems/define.js +18 -0
- package/cems/index.d.ts +228 -0
- package/cems/index.js +81 -0
- package/cems/policy/CForm.d.ts +133 -0
- package/cems/policy/CForm.js +2 -0
- package/cems/policy/DApiTable.d.ts +78 -0
- package/cems/policy/DApiTable.js +2 -0
- package/cems/policy/DButton.d.ts +17 -0
- package/cems/policy/DButton.js +2 -0
- package/cems/policy/DCheckbox.d.ts +50 -0
- package/cems/policy/DCheckbox.js +2 -0
- package/cems/policy/DCheckboxGroup.d.ts +34 -0
- package/cems/policy/DCheckboxGroup.js +2 -0
- package/cems/policy/DCol.d.ts +33 -0
- package/cems/policy/DCol.js +2 -0
- package/cems/policy/DColorPicker.d.ts +9 -0
- package/cems/policy/DColorPicker.js +2 -0
- package/cems/policy/DDatePicker.d.ts +41 -0
- package/cems/policy/DDatePicker.js +2 -0
- package/cems/policy/DDiv.d.ts +65 -0
- package/cems/policy/DDiv.js +2 -0
- package/cems/policy/DDrawer.d.ts +6 -0
- package/cems/policy/DDrawer.js +2 -0
- package/cems/policy/DDynamicSelect.d.ts +50 -0
- package/cems/policy/DDynamicSelect.js +2 -0
- package/cems/policy/DDynamicTreeSelect.d.ts +45 -0
- package/cems/policy/DDynamicTreeSelect.js +2 -0
- package/cems/policy/DForm.d.ts +248 -0
- package/cems/policy/DForm.js +2 -0
- package/cems/policy/DIcon.d.ts +33 -0
- package/cems/policy/DIcon.js +2 -0
- package/cems/policy/DInput.d.ts +41 -0
- package/cems/policy/DInput.js +2 -0
- package/cems/policy/DLabel.d.ts +17 -0
- package/cems/policy/DLabel.js +2 -0
- package/cems/policy/DPTable.d.ts +86 -0
- package/cems/policy/DPTable.js +2 -0
- package/cems/policy/DRadio.d.ts +34 -0
- package/cems/policy/DRadio.js +2 -0
- package/cems/policy/DSCTable.d.ts +33 -0
- package/cems/policy/DSCTable.js +2 -0
- package/cems/policy/DSelect.d.ts +42 -0
- package/cems/policy/DSelect.js +2 -0
- package/cems/policy/DSlider.d.ts +21 -0
- package/cems/policy/DSlider.js +2 -0
- package/cems/policy/DSwitch.d.ts +21 -0
- package/cems/policy/DSwitch.js +2 -0
- package/cems/policy/DTab.d.ts +30 -0
- package/cems/policy/DTab.js +2 -0
- package/cems/policy/DTimePicker.d.ts +37 -0
- package/cems/policy/DTimePicker.js +2 -0
- package/cems/policy/DTree.d.ts +98 -0
- package/cems/policy/DTree.js +2 -0
- package/cems/policy/DUpload.d.ts +33 -0
- package/cems/policy/DUpload.js +2 -0
- package/cems/policy/types.d.ts +200 -0
- package/cems/policy/types.js +2 -0
- package/cems/policy/utils.d.ts +13 -0
- package/cems/policy/utils.js +2 -0
- package/components/Box/Box.d.ts +43 -7
- package/components/Box/Box.js +67 -17
- package/components/Box/SelectBar.d.ts +1 -1
- package/components/Box/SelectBar.js +19 -9
- package/components/Lists/BaseList.d.ts +5 -0
- package/components/Lists/BaseList.js +111 -0
- package/components/Lists/Fields/IconRender.d.ts +53 -0
- package/components/Lists/Fields/IconRender.js +174 -0
- package/components/Lists/Fields/ItemRender.d.ts +2 -0
- package/components/Lists/Fields/ItemRender.js +127 -0
- package/components/Lists/Fields/_utils.d.ts +3 -0
- package/components/Lists/Fields/_utils.js +80 -0
- package/components/Lists/Fields/index.d.ts +3 -0
- package/components/Lists/Fields/index.js +47 -0
- package/components/Lists/Grid/grid.d.ts +7 -0
- package/components/Lists/Grid/grid.js +18 -0
- package/components/Lists/Grid/index.d.ts +3 -0
- package/components/Lists/Grid/index.js +50 -0
- package/components/Lists/Row/index.d.ts +3 -0
- package/components/Lists/Row/index.js +14 -0
- package/components/Lists/SList.js +17 -7
- package/components/Lists/Timeline/index.d.ts +3 -0
- package/components/Lists/Timeline/index.js +117 -0
- package/components/Lists/VList.d.ts +3 -0
- package/components/Lists/VList.js +92 -0
- package/components/Lists/components/LayoutSwitcher.d.ts +13 -0
- package/components/Lists/components/LayoutSwitcher.js +121 -0
- package/components/Lists/components/SearchTool.d.ts +13 -0
- package/components/Lists/components/SearchTool.js +34 -0
- package/components/Lists/index.d.ts +129 -0
- package/components/Lists/index.js +2 -0
- package/components/SearchTool/SearchBand/BandInput.d.ts +3 -0
- package/components/SearchTool/SearchBand/BandInput.js +54 -0
- package/components/SearchTool/SearchBand/BandTag.d.ts +7 -0
- package/components/SearchTool/SearchBand/BandTag.js +82 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandAction.js +23 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandFix.js +72 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.d.ts +3 -0
- package/components/SearchTool/SearchBand/_SearchBandTag.js +75 -0
- package/components/SearchTool/SearchBand/_register.d.ts +47 -0
- package/components/SearchTool/SearchBand/_register.js +15 -0
- package/components/SearchTool/SearchBand/hooks.d.ts +12 -0
- package/components/SearchTool/SearchBand/hooks.js +181 -0
- package/components/SearchTool/SearchBand/index.d.ts +3 -0
- package/components/SearchTool/SearchBand/index.js +66 -0
- package/components/SearchTool/SearchBand/type.d.ts +71 -0
- package/components/SearchTool/SearchBand/type.js +3 -0
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.d.ts +2 -2
- package/components/{SearchBar → SearchTool/SearchBar}/ActionButtons.js +22 -12
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByField.js +21 -11
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/ByKeyword.js +20 -10
- package/components/{SearchBar → SearchTool/SearchBar}/SearchField.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.js +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.d.ts +1 -1
- package/components/{SearchBar → SearchTool/SearchBar}/_register.js +3 -3
- package/components/SearchTool/SearchBar/index.d.ts +7 -0
- package/components/{SearchBar → SearchTool/SearchBar}/index.js +1 -1
- package/components/{SearchBar/index.d.ts → SearchTool/SearchBar/type.d.ts} +68 -67
- package/components/SearchTool/SearchBar/type.js +35 -0
- package/components/SearchTool/index.d.ts +5 -0
- package/components/SearchTool/index.js +7 -0
- package/components/Tables/ApiTable.d.ts +5 -7
- package/components/Tables/ApiTable.js +17 -7
- package/components/Tables/ApiTableModal.d.ts +5 -7
- package/components/Tables/ApiTableModal.js +17 -7
- package/components/Tables/Components/ActionBar.d.ts +8 -11
- package/components/Tables/Components/ActionBar.js +74 -41
- package/components/Tables/Components/Actions.d.ts +3 -1
- package/components/Tables/Components/Actions.js +40 -3
- package/components/Tables/Components/index.d.ts +3 -1
- package/components/Tables/Components/useTableContext.d.ts +16 -0
- package/components/Tables/Components/useTableContext.js +116 -0
- package/components/Tables/STable.js +17 -7
- package/components/Tables/TopTable.js +17 -7
- package/components/Tables/Util.d.ts +2 -2
- package/components/Tables/Util.js +0 -1
- package/components/Tables/VTable.d.ts +9 -9
- package/components/Tables/VTable.js +119 -172
- package/components/Tables/VTableBack.d.ts +0 -0
- package/components/Tables/VTableBack.js +269 -0
- package/components/Tables/index.d.ts +11 -22
- package/components/TreeSelect/BaseTreeSelect.js +17 -7
- package/components/TreeSelect/DTreeSelect.js +19 -9
- package/components/TreeSelect/FTreeSelect.js +2 -2
- package/components/TreeSelect/STreeSelect.js +1 -1
- package/components/Trees/ActionTree.d.ts +3 -5
- package/components/Trees/ActionTree.js +19 -9
- package/components/Trees/BaseTree.js +17 -7
- package/components/Trees/COTree/COButton.js +17 -7
- package/components/Trees/COTree/COSelect.js +17 -7
- package/components/Trees/COTree/COTree.js +19 -9
- package/components/Trees/DTree.d.ts +0 -7
- package/components/Trees/DTree.js +19 -9
- package/components/Trees/FTree.js +19 -9
- package/components/Trees/STree.js +17 -7
- package/components/UForm/FormWrapper.js +17 -7
- package/components/UForm/UDescriptions.d.ts +2 -3
- package/components/UForm/UDescriptions.js +17 -7
- package/components/UForm/UForm.d.ts +1 -1
- package/components/UForm/UForm.js +24 -11
- package/components/UForm/UFormModal.js +19 -9
- package/components/UForm/_FieldType.d.ts +1 -1
- package/components/UForm/_FieldType.js +4 -0
- package/components/UForm/_input.d.ts +5 -1
- package/components/UForm/_input.js +25 -8
- package/components/Upload/UploadImage.js +17 -7
- package/components/Upload/UploadModal.js +19 -9
- package/components/Upload/useUpload.js +2 -2
- package/components/_adapt/Alert.js +17 -7
- package/components/_adapt/Col.d.ts +1 -1
- package/components/_adapt/ColorPicker.js +17 -7
- package/components/_adapt/Drawer.js +17 -7
- package/components/_adapt/Dropdown.js +17 -7
- package/components/_adapt/FloatButton.js +17 -7
- package/components/_adapt/Input.js +17 -7
- package/components/_adapt/InputNumber.js +17 -7
- package/components/_adapt/Layout.js +17 -7
- package/components/_adapt/Menu.js +17 -7
- package/components/_adapt/Modal.js +17 -7
- package/components/_adapt/Popconfirm.js +17 -7
- package/components/_adapt/Popover.js +17 -7
- package/components/_adapt/Progress.js +17 -7
- package/components/_adapt/Select.js +17 -7
- package/components/_adapt/Table.js +17 -7
- package/components/_adapt/Tabs.js +17 -7
- package/components/_adapt/Tag.js +17 -7
- package/components/_adapt/TreeSelect.js +17 -7
- package/components/_adapt/todo/Image.d.ts +0 -1
- package/components/_adapt/todo/Segmented.d.ts +0 -1
- package/components/_common/AutoComplete.js +35 -12
- package/components/_common/CountUp.js +17 -7
- package/components/_common/DateRange.d.ts +5 -2
- package/components/_common/DateRange.js +43 -40
- package/components/_common/HighLight.d.ts +1 -1
- package/components/_common/HighLight.js +26 -24
- package/components/_common/Loading.js +17 -7
- package/components/_common/MonthRange.js +17 -7
- package/components/_common/PromiseLabel.js +2 -2
- package/components/_common/UTitle.d.ts +1 -1
- package/components/_common/UTitle.js +18 -8
- package/components/_common/Upagination.d.ts +1 -0
- package/components/_common/Upagination.js +5 -1
- package/components/_i18n.d.ts +1 -102
- package/components/index.d.ts +2 -2
- package/components/index.js +5 -1
- package/deps/JsonView.js +17 -7
- package/deps/app-audit/LookUp.js +19 -9
- package/deps/app-data/Const.d.ts +68 -3
- package/deps/app-data/Const.js +47 -3
- package/deps/app-data/TimeConst.d.ts +0 -0
- package/deps/app-data/TimeConst.js +58 -0
- package/deps/app-data/useSource.d.ts +22 -0
- package/deps/app-data/useSource.js +253 -162
- package/deps/echarts.d.ts +3 -0
- package/deps/echarts.js +20 -10
- package/deps/editor/Article.js +17 -7
- package/deps/editor/Editor.js +17 -7
- package/deps/editor/EditorModal.js +17 -7
- package/deps/editor/support/buttons/ImageButton.js +17 -7
- package/deps/editor/tools/Button.js +0 -2
- package/deps/editor/tools/_TxtButton.js +17 -7
- package/deps/vapc/_basic.d.ts +1 -0
- package/deps/vapc/_basic.js +15 -0
- package/deps/vapc/index.d.ts +10 -0
- package/deps/vapc/index.js +70 -0
- package/hooks/useAjaxAction.js +2 -2
- package/hooks/useAjaxQuery.js +2 -2
- package/hooks/useApiBase.js +2 -2
- package/hooks/useApiGlobal.js +1 -1
- package/hooks/useArray.js +2 -2
- package/hooks/useDefault.d.ts +0 -1
- package/hooks/useDoLoad.d.ts +1 -1
- package/hooks/useError.d.ts +1 -1
- package/hooks/useMemoPromise.js +2 -2
- package/index.d.ts +2 -1
- package/index.js +1 -1
- package/login/Base65.d.ts +7 -1
- package/login/Base65.js +49 -22
- package/login/Password.d.ts +8 -5
- package/login/Password.js +68 -102
- package/package.json +1 -1
- package/screen/Page.js +17 -7
- package/screen/vapc-schema/dark.d.ts +1 -0
- package/screen/vapc-schema/dark.js +50 -0
- package/screen/vapc-schema/insight.d.ts +1 -0
- package/screen/vapc-schema/insight.js +49 -0
- package/uform/FormEditor.js +17 -7
- package/uform/FormViewer.js +17 -7
- package/uform/hooks/useEditor.d.ts +0 -1
- package/uform/hooks/useForm.d.ts +0 -1
- package/uform/inputs/index.d.ts +0 -1
- package/uform/panel/Editor/_GroupDefault.js +17 -7
- package/uform/panel/Editor/_GroupStep.js +17 -7
- package/uform/panel/Editor/_GroupTab.js +17 -7
- package/uform/panel/Editor/index.js +17 -7
- package/uform/panel/Items/Fields.js +17 -7
- package/uform/panel/Items/InputSelector.js +17 -7
- package/uform/panel/Items/Inputs.js +17 -7
- package/uform/panel/Items/index.d.ts +1 -1
- package/uform/panel/Propreties/CanvasProperties.js +17 -7
- package/uform/panel/Propreties/Component/FieldPlugin.js +17 -7
- package/uform/panel/Propreties/Component/LinkAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/LinkSyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/Links.js +17 -7
- package/uform/panel/Propreties/Component/OptionTable.js +17 -7
- package/uform/panel/Propreties/Component/RegexpModal.js +17 -7
- package/uform/panel/Propreties/Component/Validate.js +17 -7
- package/uform/panel/Propreties/Component/ValidateAsyncFunction.js +17 -7
- package/uform/panel/Propreties/Component/ValidateSyncFunction.js +17 -7
- package/uform/panel/Propreties/FieldOptions.js +17 -7
- package/uform/panel/Propreties/FieldProperties.js +17 -7
- package/uform/panel/Propreties/_ItemAdvance.js +17 -7
- package/uform/panel/Propreties/_ItemBase.js +17 -7
- package/uform/panel/Propreties/_ItemLink.js +17 -7
- package/uform/panel/Propreties/_ItemValidate.js +17 -7
- package/uform/schema.d.ts +1 -1
- package/uform/utils/Convert.js +2 -2
- package/utils/Ajax.d.ts +3 -0
- package/utils/Ajax.js +22 -16
- package/utils/CacheUtil.d.ts +1 -1
- package/utils/Const.js +17 -7
- package/utils/Format.d.ts +138 -14
- package/utils/Format.js +132 -23
- package/utils/Global.d.ts +46 -2
- package/utils/Global.js +24 -2
- package/utils/PageUtil.d.ts +111 -23
- package/utils/PageUtil.js +163 -28
- package/utils/Renders/ApiGetRender.js +25 -12
- package/utils/Renders/ApiPostRender.js +3 -3
- package/utils/Renders/CondictionRender.js +17 -7
- package/utils/Renders/DateRender.js +20 -2
- package/utils/Renders/ListRender.js +1 -1
- package/utils/Renders/NumberRender.js +24 -5
- package/utils/Renders/StringRender.js +81 -11
- package/utils/Renders/_define.d.ts +8 -7
- package/utils/Renders/_define.js +76 -17
- package/utils/StringUtil.d.ts +292 -62
- package/utils/StringUtil.js +310 -63
- package/utils/TreeUtil.js +14 -12
- package/utils/VAP.d.ts +26 -1
- package/utils/VAP.js +57 -1
- package/utils/_AjaxUtil.d.ts +1 -0
- package/utils/_AjaxUtil.js +70 -3
- package/utils/_Support.d.ts +2 -2
- package/utils/_Support.js +4 -2
- package/utils/crontab/_en.d.ts +2 -0
- package/utils/crontab/_en.js +178 -0
- package/utils/crontab/_global.d.ts +11 -0
- package/utils/crontab/_global.js +23 -0
- package/utils/crontab/_zh_CN.d.ts +2 -0
- package/utils/crontab/_zh_CN.js +180 -0
- package/utils/crontab/_zh_TW.d.ts +2 -0
- package/utils/crontab/_zh_TW.js +170 -0
- package/utils/crontab/crontabParser.d.ts +1 -0
- package/utils/crontab/crontabParser.js +251 -0
- package/utils/crontab/crontabRender.d.ts +23 -0
- package/utils/crontab/crontabRender.js +502 -0
- package/utils/crontab/index.d.ts +3 -0
- package/utils/crontab/index.js +9 -0
- package/utils/crontab/type.d.ts +79 -0
- package/utils/crontab/type.js +2 -0
- package/utils/crontab/utils.d.ts +20 -0
- package/utils/crontab/utils.js +122 -0
- package/utils/i18n.d.ts +13 -2
- package/utils/i18n.js +13 -2
- package/utils/index.d.ts +4 -0
- package/utils/index.js +19 -9
- package/utils/py.js +2 -0
- package/components/SearchBar/_FieldType.d.ts +0 -8
- package/components/SearchBar/_FieldType.js +0 -51
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchField.js +0 -0
- /package/components/{SearchBar → SearchTool/SearchBar}/SearchTags.d.ts +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.containsAny = exports.format = exports.validate = void 0;
|
|
4
|
+
var _global_1 = require("./_global");
|
|
5
|
+
function assert(value, message) {
|
|
6
|
+
if (!value) {
|
|
7
|
+
throw new Error(message);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
// export default class RangeValidator {
|
|
11
|
+
var secondRange = function (parse) {
|
|
12
|
+
var parsed = parse.split(',');
|
|
13
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
14
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
15
|
+
var second = parseInt(parsed[i], 10);
|
|
16
|
+
assert(second >= 0 && second <= 59, '秒钟范围只是是 0 - 59');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var minuteRange = function (parse) {
|
|
21
|
+
var parsed = parse.split(',');
|
|
22
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
23
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
24
|
+
var minute = parseInt(parsed[i], 10);
|
|
25
|
+
assert(minute >= 0 && minute <= 59, '分钟范围只是是 0 - 59');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var hourRange = function (parse) {
|
|
30
|
+
var parsed = parse.split(',');
|
|
31
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
32
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
33
|
+
var hour = parseInt(parsed[i], 10);
|
|
34
|
+
assert(hour >= 0 && hour <= 23, '小时范围只是是 0 - 23');
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var dayOfMonthRange = function (parse) {
|
|
39
|
+
var parsed = parse.split(',');
|
|
40
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
41
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
42
|
+
var dayOfMonth = parseInt(parsed[i], 10);
|
|
43
|
+
assert(dayOfMonth >= 1 && dayOfMonth <= 31, '日期范围只是是 1 - 31');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
var monthRange = function (parse, monthStartIndexZero) {
|
|
48
|
+
var parsed = parse.split(',');
|
|
49
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
50
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
51
|
+
var month = parseInt(parsed[i], 10);
|
|
52
|
+
assert(month >= 1 && month <= 12, monthStartIndexZero ? '月份范围只是是 0 - 11' : '月份范围只是是 1 - 12');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var dayOfWeekRange = function (parse, dayOfWeekStartIndexZero) {
|
|
57
|
+
var parsed = parse.split(',');
|
|
58
|
+
for (var i = 0; i < parsed.length; i++) {
|
|
59
|
+
if (!isNaN(parseInt(parsed[i], 10))) {
|
|
60
|
+
var dayOfWeek = parseInt(parsed[i], 10);
|
|
61
|
+
assert(dayOfWeek >= 0 && dayOfWeek <= 6, dayOfWeekStartIndexZero ? '星期范围只是是 0 - 6' : '星期范围只是是 1 - 7');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var assertNoInvalidCharacters = function (partDescription, expression) {
|
|
66
|
+
// No characters other than 'L' or 'W' should remain after normalization
|
|
67
|
+
var invalidChars = expression.match(/[A-KM-VX-Z]+/gi);
|
|
68
|
+
if (invalidChars && invalidChars.length) {
|
|
69
|
+
throw new Error("".concat(partDescription, " \u90E8\u5206\u4E0D\u80FD\u5305\u62EC\u5B57\u7B26: '").concat(invalidChars.toString(), "'"));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
var validateRange = function (parsed) {
|
|
73
|
+
secondRange(parsed[0]);
|
|
74
|
+
minuteRange(parsed[1]);
|
|
75
|
+
hourRange(parsed[2]);
|
|
76
|
+
dayOfMonthRange(parsed[3]);
|
|
77
|
+
monthRange(parsed[4], _global_1.monthStartIndexZero);
|
|
78
|
+
dayOfWeekRange(parsed[5], _global_1.dayOfWeekStartIndexZero);
|
|
79
|
+
};
|
|
80
|
+
var validate = function (parsed) {
|
|
81
|
+
assertNoInvalidCharacters("DOW", parsed[5]);
|
|
82
|
+
assertNoInvalidCharacters("DOM", parsed[3]);
|
|
83
|
+
validateRange(parsed);
|
|
84
|
+
};
|
|
85
|
+
exports.validate = validate;
|
|
86
|
+
/**
|
|
87
|
+
* Takes a string with '%s' placeholders and replaces them with provided values.
|
|
88
|
+
* Works like sprintf in C or string.Format in C#.
|
|
89
|
+
* @static
|
|
90
|
+
* @param {string} template - The string template with enclosed %s replacements
|
|
91
|
+
* @param {...string[]} values - The ordered replacement text
|
|
92
|
+
* @returns {string}
|
|
93
|
+
*/
|
|
94
|
+
var format = function (template) {
|
|
95
|
+
var values = [];
|
|
96
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
97
|
+
values[_i - 1] = arguments[_i];
|
|
98
|
+
}
|
|
99
|
+
return template.replace(/%s/g, function (substring) {
|
|
100
|
+
var args = [];
|
|
101
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
102
|
+
args[_i - 1] = arguments[_i];
|
|
103
|
+
}
|
|
104
|
+
return values.shift();
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
exports.format = format;
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* Given a string and an array of search strings, determines if the string
|
|
111
|
+
* contains any value from the array.
|
|
112
|
+
* @static
|
|
113
|
+
* @param {string} text - The string to search
|
|
114
|
+
* @param {string[]} searchStrings - The array of values to search for
|
|
115
|
+
* @returns {boolean}
|
|
116
|
+
*/
|
|
117
|
+
var containsAny = function (text, searchStrings) {
|
|
118
|
+
return searchStrings.some(function (c) {
|
|
119
|
+
return text.indexOf(c) > -1;
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
exports.containsAny = containsAny;
|
package/utils/i18n.d.ts
CHANGED
|
@@ -29,9 +29,12 @@ type LanguageItem = Record<string, LanguageValue>;
|
|
|
29
29
|
*/
|
|
30
30
|
export declare const supportLang: (key: string, deflang?: Language) => Language | null;
|
|
31
31
|
export declare const setGlobalLang: (lang: Language) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 注册中文语料
|
|
34
|
+
*/
|
|
32
35
|
export declare const registerCN: <T>(namespace: string, resource: T) => Record<keyof T, string>;
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* 注册语言资源
|
|
35
38
|
*/
|
|
36
39
|
export declare const register: <T extends LanguageItem>(lang: Language, namespace: string, resource: Partial<T>) => void;
|
|
37
40
|
/**
|
|
@@ -51,10 +54,18 @@ export declare const hasKey: (key: string) => boolean;
|
|
|
51
54
|
*
|
|
52
55
|
*/
|
|
53
56
|
export declare const txt: (key: string, ...param: string[]) => string;
|
|
57
|
+
/**
|
|
58
|
+
* 通过 i18n key ,获取 React Node 结点
|
|
59
|
+
* 如有参数,从 {0} 开始
|
|
60
|
+
*
|
|
61
|
+
* 说明,param 也可以当 default 使用,传第一个参数
|
|
62
|
+
* 例如 i18n.node('THIS_KEY_IS_NOT_EXIST','不存在时的默认取值') // 不存在时的默认取值
|
|
63
|
+
*/
|
|
54
64
|
export declare const node: (key: string, ...param: any[]) => ReactNode;
|
|
55
65
|
/**
|
|
56
66
|
* 获取 antd 下的资源文件,需要传 antd 下的路径
|
|
57
67
|
* 如 i18n.ant('Text.copied')
|
|
58
|
-
*
|
|
68
|
+
* 说明: 请参考 antd/locale 相关,1.5/2.0 会有差异
|
|
69
|
+
* * */
|
|
59
70
|
export declare const ant: (key_path: string) => string;
|
|
60
71
|
export declare const getText: (ik?: string, title?: string, defIk?: string) => string;
|
package/utils/i18n.js
CHANGED
|
@@ -96,6 +96,9 @@ var formatString = function (text, param) {
|
|
|
96
96
|
}
|
|
97
97
|
return str;
|
|
98
98
|
};
|
|
99
|
+
/**
|
|
100
|
+
* 注册中文语料
|
|
101
|
+
*/
|
|
99
102
|
var registerCN = function (namespace, resource) {
|
|
100
103
|
var map = LanguageMap.get(_Support_1.Language.ZH_CN);
|
|
101
104
|
var U = {};
|
|
@@ -108,7 +111,7 @@ var registerCN = function (namespace, resource) {
|
|
|
108
111
|
};
|
|
109
112
|
exports.registerCN = registerCN;
|
|
110
113
|
/**
|
|
111
|
-
*
|
|
114
|
+
* 注册语言资源
|
|
112
115
|
*/
|
|
113
116
|
var register = function (lang, namespace, resource) {
|
|
114
117
|
var language = (0, exports.supportLang)(lang);
|
|
@@ -165,6 +168,13 @@ var txt = function (key) {
|
|
|
165
168
|
return '';
|
|
166
169
|
};
|
|
167
170
|
exports.txt = txt;
|
|
171
|
+
/**
|
|
172
|
+
* 通过 i18n key ,获取 React Node 结点
|
|
173
|
+
* 如有参数,从 {0} 开始
|
|
174
|
+
*
|
|
175
|
+
* 说明,param 也可以当 default 使用,传第一个参数
|
|
176
|
+
* 例如 i18n.node('THIS_KEY_IS_NOT_EXIST','不存在时的默认取值') // 不存在时的默认取值
|
|
177
|
+
*/
|
|
168
178
|
var node = function (key) {
|
|
169
179
|
var param = [];
|
|
170
180
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
@@ -196,7 +206,8 @@ var ANTD_KEY = new Map([
|
|
|
196
206
|
/**
|
|
197
207
|
* 获取 antd 下的资源文件,需要传 antd 下的路径
|
|
198
208
|
* 如 i18n.ant('Text.copied')
|
|
199
|
-
*
|
|
209
|
+
* 说明: 请参考 antd/locale 相关,1.5/2.0 会有差异
|
|
210
|
+
* * */
|
|
200
211
|
var ant = function (key_path) {
|
|
201
212
|
var locale = lodash_1.default.get((0, _Support_1.getGlobal)(), ANTD_KEY.get(Global_1.CONFIG.APP.LANG));
|
|
202
213
|
if (locale === undefined)
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __read = (this && this.__read) || function (o, n) {
|
|
26
36
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
27
37
|
if (!m) return o;
|
|
@@ -51,7 +61,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
51
61
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
62
|
};
|
|
53
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.renderRoot = exports.
|
|
64
|
+
exports.renderRoot = exports.VAP = exports.Const = exports.Renders = exports.GLOBAL = exports.i18n = exports.Ajax = exports.Format = exports.TipUtil = exports.CacheUtil = exports.EventUtil = exports.ArrayUtil = exports.PageUtil = exports.TreeUtil = exports.StringUtil = void 0;
|
|
65
|
+
exports.registerRoute = registerRoute;
|
|
55
66
|
var lodash_1 = __importDefault(require("lodash"));
|
|
56
67
|
// 全局 UTILS 定义
|
|
57
68
|
exports.StringUtil = __importStar(require("./StringUtil"));
|
|
@@ -81,7 +92,6 @@ function registerRoute() {
|
|
|
81
92
|
}
|
|
82
93
|
setTimeout(function () { return registerRoute.apply(void 0, __spreadArray([], __read(args), false)); }, 100);
|
|
83
94
|
}
|
|
84
|
-
exports.registerRoute = registerRoute;
|
|
85
95
|
var react_dom_1 = require("react-dom");
|
|
86
96
|
var renderRoot = function (node, domId) {
|
|
87
97
|
if (domId === void 0) { domId = 'root'; }
|
package/utils/py.js
CHANGED
|
@@ -8,6 +8,8 @@ var Global_1 = require("./Global");
|
|
|
8
8
|
var lodash_1 = __importDefault(require("lodash"));
|
|
9
9
|
// 创建反向索引
|
|
10
10
|
var createIndex = function (txt) {
|
|
11
|
+
if (txt == null || txt.length == 0)
|
|
12
|
+
return [];
|
|
11
13
|
var index = [];
|
|
12
14
|
for (var i = 0, _i = txt.length; i < _i; i++) {
|
|
13
15
|
var char = txt[i];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
| 类型 | 说明 |
|
|
4
|
-
| --- | --- |
|
|
5
|
-
| text ||
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare const _FieldType: readonly ["text", "number", "select", "multi-select", "radio", "radio-button", "checkbox", "switch", "date", "daterange", "daterange-single", "datetime", "datetimerange", "datetimerange-single", "month", "monthrange", "stree-select", "dtree-select", "ftree-select", "multi-stree-select", "multi-dtree-select", "multi-ftree-select", "autocomplete"];
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._FieldType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
| 类型 | 说明 |
|
|
7
|
-
| --- | --- |
|
|
8
|
-
| text ||
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
exports._FieldType = [
|
|
12
|
-
'text',
|
|
13
|
-
'number',
|
|
14
|
-
'select',
|
|
15
|
-
'multi-select',
|
|
16
|
-
'radio',
|
|
17
|
-
'radio-button',
|
|
18
|
-
'checkbox',
|
|
19
|
-
'switch',
|
|
20
|
-
'date',
|
|
21
|
-
'daterange',
|
|
22
|
-
'daterange-single',
|
|
23
|
-
'datetime',
|
|
24
|
-
'datetimerange',
|
|
25
|
-
'datetimerange-single',
|
|
26
|
-
'month',
|
|
27
|
-
'monthrange',
|
|
28
|
-
'stree-select',
|
|
29
|
-
'dtree-select',
|
|
30
|
-
'ftree-select',
|
|
31
|
-
'multi-stree-select',
|
|
32
|
-
'multi-dtree-select',
|
|
33
|
-
'multi-ftree-select',
|
|
34
|
-
'autocomplete',
|
|
35
|
-
];
|
|
36
|
-
// * text 文本输入(默认)
|
|
37
|
-
// * number 文本输入(数字)
|
|
38
|
-
// * autocomplete 文本输入(自动完成)
|
|
39
|
-
// * select 普通选择器
|
|
40
|
-
// * multiselect 多项选择器
|
|
41
|
-
// * dictselect 字典选择器(必须指定字典ID)
|
|
42
|
-
// * treeselect 静态树选择器(暂不支持动态树)
|
|
43
|
-
// * inputselect 输入框,但有辅助选项
|
|
44
|
-
// * radio 单选框(强㓡使用外置Label)
|
|
45
|
-
// * checkbox 复选框(强制使用外围Label)
|
|
46
|
-
// * datetime 时间(如 2010-06-25 12:00:00)
|
|
47
|
-
// * date 日期 (如 2010-06-25)
|
|
48
|
-
// * month 月份 (如 2010-06-01) 返回选择月份的首日
|
|
49
|
-
// * timerange 时间区间
|
|
50
|
-
// * daterange 日期区间
|
|
51
|
-
// *
|
|
File without changes
|
|
File without changes
|