tntd 3.0.27 → 3.0.28-beta.1
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/es/index.js +1 -0
- package/es/index.js.map +1 -1
- package/es/query-form/Field/Checkbox.js +1 -1
- package/es/query-form/Field/Checkbox.js.map +1 -1
- package/es/query-form/Field/Composition/FieldPopover.js +304 -0
- package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/es/{query-form-backup → query-form}/Field/Composition/FieldPopover.less +3 -3
- package/es/query-form/Field/Composition/Select.js +122 -0
- package/es/query-form/Field/Composition/Select.js.map +1 -0
- package/es/query-form/Field/Composition/ValueTag.js +124 -0
- package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/es/query-form/Field/Composition/index.js +233 -0
- package/es/query-form/Field/Composition/index.js.map +1 -0
- package/{lib/query-form-backup → es/query-form}/Field/Composition/index.less +9 -3
- package/es/query-form/Field/Composition/utils.js +154 -0
- package/es/query-form/Field/Composition/utils.js.map +1 -0
- package/es/query-form/Field/SelectInput.js +22 -4
- package/es/query-form/Field/SelectInput.js.map +1 -1
- package/es/query-form/Field/fieldsMap.js +2 -2
- package/es/query-form/Field/fieldsMap.js.map +1 -1
- package/es/query-form/Field/index.js +1 -0
- package/es/query-form/Field/index.js.map +1 -1
- package/es/query-form/index.js +170 -335
- package/es/query-form/index.js.map +1 -1
- package/es/query-form/index.less +26 -60
- package/es/{query-form-backup → query-form-v2}/index.less +60 -17
- package/es/query-list-scene/List.js +14 -2
- package/es/query-list-scene/List.js.map +1 -1
- package/es/query-list-scene/QueryForm.js +36 -11
- package/es/query-list-scene/QueryForm.js.map +1 -1
- package/es/query-list-scene/index.js +2 -1
- package/es/query-list-scene/index.js.map +1 -1
- package/es/scroll-bar/Bar.js +56 -0
- package/es/scroll-bar/Bar.js.map +1 -0
- package/es/scroll-bar/Context.js +6 -0
- package/es/scroll-bar/Context.js.map +1 -0
- package/es/scroll-bar/ScrollBar.js +86 -0
- package/es/scroll-bar/ScrollBar.js.map +1 -0
- package/es/scroll-bar/Thumb.js +105 -0
- package/es/scroll-bar/Thumb.js.map +1 -0
- package/es/scroll-bar/index.js +3 -0
- package/es/scroll-bar/index.js.map +1 -0
- package/es/scroll-bar/scrollBar.less +59 -0
- package/es/scroll-bar/util.js +31 -0
- package/es/scroll-bar/util.js.map +1 -0
- package/es/table/resizableTable/index.less +18 -0
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js +1 -1
- package/es/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/es/tntd-select/index.js.map +1 -1
- package/es/tntd-virtual-tree-select/index.less +13 -0
- package/es/utils/index.js +0 -1
- package/es/utils/index.js.map +1 -1
- package/lib/_util/context.js +1 -1
- package/lib/_util/defaultRenderEmpty.js +1 -1
- package/lib/_util/hooks/useFlexGapSupport.js +4 -4
- package/lib/_util/hooks/useForceUpdate.js +4 -4
- package/lib/_util/responsiveObserve.js +1 -1
- package/lib/_util/styleChecker.js +1 -1
- package/lib/actions/index.js +1 -1
- package/lib/alert/alert.js +2 -2
- package/lib/alert/index.js +1 -1
- package/lib/array-input/index.js +9 -9
- package/lib/button/button.js +2 -2
- package/lib/cascader/cascader.js +1 -1
- package/lib/check-card/group.js +8 -8
- package/lib/check-card/index.js +6 -6
- package/lib/checkbox/checkbox-group.js +1 -1
- package/lib/checkbox/checkbox.js +1 -1
- package/lib/color-picker/ColorPicker.js +6 -6
- package/lib/color-picker/index.js +1 -1
- package/lib/columns/index.js +1 -1
- package/lib/config-provider/config-provider.js +1 -1
- package/lib/date-picker/DatePicker.js +1 -1
- package/lib/descriptions/descriptions.js +5 -5
- package/lib/development-login/LoginModal.js +6 -6
- package/lib/development-login/index.js +4 -4
- package/lib/drawer/drawer.js +2 -2
- package/lib/ellipsis/Svg/CopySVG.js +1 -1
- package/lib/ellipsis/Svg/TickSVG.js +1 -1
- package/lib/ellipsis/index.js +5 -5
- package/lib/empty/empty.js +2 -2
- package/lib/empty/empty.stories.js +2 -2
- package/lib/exception/exception.js +1 -1
- package/lib/form/form.js +2 -2
- package/lib/grid-v4/col.js +2 -2
- package/lib/grid-v4/hooks/useBreakpoint.js +1 -1
- package/lib/grid-v4/index.js +1 -1
- package/lib/grid-v4/row.js +6 -6
- package/lib/handle/index.js +1 -1
- package/lib/handle-icon/index.js +11 -11
- package/lib/icon/IconFont.js +1 -1
- package/lib/icon/components/Icon.js +9 -9
- package/lib/icon/components/index.js +1 -1
- package/lib/icon/components/utils.js +3 -3
- package/lib/icon/index.js +7 -7
- package/lib/icon/twoTonePrimaryColor.js +1 -1
- package/lib/icon/utils.js +1 -1
- package/lib/img/Contain.js +1 -1
- package/lib/img/Cover.js +5 -5
- package/lib/img/index.js +5 -5
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -1
- package/lib/index.js.map +1 -1
- package/lib/input/input.js +2 -2
- package/lib/input-number/inputNumber.js +1 -1
- package/lib/label/index.js +2 -2
- package/lib/loading-button/index.js +5 -5
- package/lib/locale/default.js +1 -1
- package/lib/locale/en_US.js +1 -1
- package/lib/locale/zh_CN.js +1 -1
- package/lib/modal/modal.js +1 -1
- package/lib/notification/assets/index.js +1 -1
- package/lib/notification/index.js +1 -1
- package/lib/notification/notification.js +1 -1
- package/lib/page/Box.js +1 -1
- package/lib/page/index.js +7 -7
- package/lib/page-container/index.js +1 -1
- package/lib/page-loading/index.js +1 -1
- package/lib/popconfirm/popconfirm.js +1 -1
- package/lib/popover/popover.js +1 -1
- package/lib/preview-text/index.js +7 -7
- package/lib/progress/progress.js +2 -2
- package/lib/query-form/Field/Checkbox.js +2 -2
- package/lib/query-form/Field/Checkbox.js.map +1 -1
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/FieldPopover.js +338 -0
- package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
- package/lib/{query-form-backup → query-form}/Field/Composition/FieldPopover.less +3 -3
- package/lib/query-form/Field/Composition/Select.d.ts +4 -0
- package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/Select.js +146 -0
- package/lib/query-form/Field/Composition/Select.js.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts +12 -0
- package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/ValueTag.js +153 -0
- package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
- package/lib/query-form/Field/Composition/index.d.ts +12 -0
- package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/index.js +277 -0
- package/lib/query-form/Field/Composition/index.js.map +1 -0
- package/{es/query-form-backup → lib/query-form}/Field/Composition/index.less +9 -3
- package/lib/query-form/Field/Composition/utils.d.ts +22 -0
- package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
- package/lib/query-form/Field/Composition/utils.js +168 -0
- package/lib/query-form/Field/Composition/utils.js.map +1 -0
- package/lib/query-form/Field/Select.js +6 -6
- package/lib/query-form/Field/SelectInput.d.ts.map +1 -1
- package/lib/query-form/Field/SelectInput.js +21 -9
- package/lib/query-form/Field/SelectInput.js.map +1 -1
- package/lib/query-form/Field/fieldsMap.d.ts +6 -3
- package/lib/query-form/Field/fieldsMap.js +3 -3
- package/lib/query-form/Field/fieldsMap.js.map +1 -1
- package/lib/query-form/Field/index.d.ts.map +1 -1
- package/lib/query-form/Field/index.js +11 -10
- package/lib/query-form/Field/index.js.map +1 -1
- package/lib/query-form/createActions.js +1 -1
- package/lib/query-form/index.d.ts +19 -27
- package/lib/query-form/index.d.ts.map +1 -1
- package/lib/query-form/index.js +191 -361
- package/lib/query-form/index.js.map +1 -1
- package/lib/query-form/index.less +26 -60
- package/lib/query-form/useForm.js +1 -1
- package/lib/{query-form-backup → query-form-v2}/index.less +60 -17
- package/lib/query-list-scene/List.d.ts.map +1 -1
- package/lib/query-list-scene/List.js +28 -15
- package/lib/query-list-scene/List.js.map +1 -1
- package/lib/query-list-scene/QueryForm.d.ts +5 -3
- package/lib/query-list-scene/QueryForm.d.ts.map +1 -1
- package/lib/query-list-scene/QueryForm.js +47 -21
- package/lib/query-list-scene/QueryForm.js.map +1 -1
- package/lib/query-list-scene/QueryListScene.js +10 -10
- package/lib/query-list-scene/Title.js +1 -1
- package/lib/query-list-scene/Toolbar.js +2 -2
- package/lib/query-list-scene/createActions.js +1 -1
- package/lib/query-list-scene/index.d.ts.map +1 -1
- package/lib/query-list-scene/index.js +3 -2
- package/lib/query-list-scene/index.js.map +1 -1
- package/lib/query-list-scene/useActions.js +1 -1
- package/lib/radio/radio-group.js +1 -1
- package/lib/radio/radio.js +1 -1
- package/lib/render-empty/render-empty.js +1 -1
- package/lib/scroll-bar/Bar.d.ts +4 -0
- package/lib/scroll-bar/Bar.d.ts.map +1 -0
- package/lib/scroll-bar/Bar.js +91 -0
- package/lib/scroll-bar/Bar.js.map +1 -0
- package/lib/scroll-bar/Context.d.ts +7 -0
- package/lib/scroll-bar/Context.d.ts.map +1 -0
- package/lib/scroll-bar/Context.js +13 -0
- package/lib/scroll-bar/Context.js.map +1 -0
- package/lib/scroll-bar/ScrollBar.d.ts +4 -0
- package/lib/scroll-bar/ScrollBar.d.ts.map +1 -0
- package/lib/scroll-bar/ScrollBar.js +97 -0
- package/lib/scroll-bar/ScrollBar.js.map +1 -0
- package/lib/scroll-bar/Thumb.d.ts +3 -0
- package/lib/scroll-bar/Thumb.d.ts.map +1 -0
- package/lib/scroll-bar/Thumb.js +125 -0
- package/lib/scroll-bar/Thumb.js.map +1 -0
- package/lib/scroll-bar/index.d.ts +3 -0
- package/lib/scroll-bar/index.d.ts.map +1 -0
- package/lib/scroll-bar/index.js +10 -0
- package/lib/scroll-bar/index.js.map +1 -0
- package/lib/scroll-bar/scrollBar.less +59 -0
- package/lib/scroll-bar/util.d.ts +40 -0
- package/lib/scroll-bar/util.d.ts.map +1 -0
- package/lib/scroll-bar/util.js +39 -0
- package/lib/scroll-bar/util.js.map +1 -0
- package/lib/segmented/index.js +2 -2
- package/lib/select/select.js +2 -2
- package/lib/spin/spin.js +1 -1
- package/lib/steps/steps.js +2 -2
- package/lib/svg-components/index.js +1 -1
- package/lib/table/hooks/use-column-setting.js +4 -4
- package/lib/table/hooks/use-expand-fixed.js +6 -6
- package/lib/table/resizableTable/index.js +6 -6
- package/lib/table/resizableTable/index.less +18 -0
- package/lib/table/table-hoc.js +1 -1
- package/lib/table/table.js +9 -9
- package/lib/table/table.stories.js +2 -2
- package/lib/table/total-shower.js +1 -1
- package/lib/table/utils.js +1 -1
- package/lib/table-container/index.js +1 -1
- package/lib/tabs/tabs.js +2 -2
- package/lib/tabs-container/index.js +1 -1
- package/lib/tag/tag.js +2 -2
- package/lib/time-picker/TimePicker.js +1 -1
- package/lib/time-picker/index.js +1 -1
- package/lib/title/index.js +1 -1
- package/lib/tntd-action/Action.js +9 -9
- package/lib/tntd-action/index.js +8 -8
- package/lib/tntd-cascader/AntdCascader/component/context.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/defaultRenderEmpty.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +1 -1
- package/lib/tntd-cascader/AntdCascader/component/useCompactItemContext.js +2 -2
- package/lib/tntd-cascader/AntdCascader/config/utils.js +2 -2
- package/lib/tntd-cascader/AntdCascader/index.js +7 -7
- package/lib/tntd-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/Cascader.js +8 -8
- package/lib/tntd-cascader/rc-cascader/OptionList/Checkbox.js +2 -2
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js +8 -8
- package/lib/tntd-cascader/rc-cascader/OptionList/Column.js.map +1 -1
- package/lib/tntd-cascader/rc-cascader/OptionList/index.js +9 -9
- package/lib/tntd-cascader/rc-cascader/OptionList/useActive.js +5 -5
- package/lib/tntd-cascader/rc-cascader/OptionList/useKeyboard.js +8 -8
- package/lib/tntd-cascader/rc-cascader/hooks/useDisplayValues.js +5 -5
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchConfig.js +1 -1
- package/lib/tntd-cascader/rc-cascader/hooks/useSearchOptions.js +6 -6
- package/lib/tntd-cascader/rc-cascader/index.js +1 -1
- package/lib/tntd-cascader/rc-cascader/utils/warningPropsUtil.js +4 -4
- package/lib/tntd-form/ErrorList.js +7 -7
- package/lib/tntd-form/Form.js +6 -6
- package/lib/tntd-form/FormItem/ItemHolder.js +6 -6
- package/lib/tntd-form/FormItem/index.js +8 -8
- package/lib/tntd-form/FormItemInput.js +1 -1
- package/lib/tntd-form/FormItemLabel.js +2 -2
- package/lib/tntd-form/FormList.js +1 -1
- package/lib/tntd-form/context.js +1 -1
- package/lib/tntd-form/hooks/useDebounce.js +4 -4
- package/lib/tntd-form/hooks/useForm.js +5 -5
- package/lib/tntd-form/hooks/useFormItemStatus.js +1 -1
- package/lib/tntd-form/hooks/useFrameState.js +5 -5
- package/lib/tntd-form/index.js +1 -1
- package/lib/tntd-icon/index.js +1 -1
- package/lib/tntd-layout/AppList.js +6 -6
- package/lib/tntd-layout/Application.js +6 -6
- package/lib/tntd-layout/Avatar.js +2 -2
- package/lib/tntd-layout/CompatibleLanguage.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Avatar.js +2 -2
- package/lib/tntd-layout/EnterpriseLayout/Language.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/Theme.js +6 -6
- package/lib/tntd-layout/EnterpriseLayout/index.js +1 -1
- package/lib/tntd-layout/GlobalNavigation/NavigationPopup.js +6 -6
- package/lib/tntd-layout/GlobalNavigation/index.js +9 -9
- package/lib/tntd-layout/Header.js +2 -2
- package/lib/tntd-layout/HeaderActions.js +2 -2
- package/lib/tntd-layout/HeaderNavs.js +6 -6
- package/lib/tntd-layout/HeaderTabs.js +7 -7
- package/lib/tntd-layout/Iconfont.js +1 -1
- package/lib/tntd-layout/Language.js +6 -6
- package/lib/tntd-layout/Layout.js +6 -6
- package/lib/tntd-layout/Logo.js +2 -2
- package/lib/tntd-layout/OrgAppList.js +6 -6
- package/lib/tntd-layout/SideMenu.js +6 -6
- package/lib/tntd-layout/Theme.js +6 -6
- package/lib/tntd-layout/createActions.js +1 -1
- package/lib/tntd-layout/images/index.js +1 -1
- package/lib/tntd-layout/index.js +1 -1
- package/lib/tntd-layout/paaslayout/CompactSideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/Header.js +2 -2
- package/lib/tntd-layout/paaslayout/Logo.js +2 -2
- package/lib/tntd-layout/paaslayout/SideMenu.js +6 -6
- package/lib/tntd-layout/paaslayout/index.js +6 -6
- package/lib/tntd-layout/storage.js +1 -1
- package/lib/tntd-modal/index.js +6 -6
- package/lib/tntd-rc-select/_util/PurePanel.js +5 -5
- package/lib/tntd-rc-select/_util/context.js +1 -1
- package/lib/tntd-rc-select/_util/defaultRenderEmpty.js +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +1 -1
- package/lib/tntd-rc-select/_util/useCompactItemContext.js +2 -2
- package/lib/tntd-rc-select/index.js +2 -2
- package/lib/tntd-reference/AHref/index.js +1 -1
- package/lib/tntd-reference/ReferenceBatchCheck/index.js +1 -1
- package/lib/tntd-reference/ReferenceBatchDrawer/index.js +5 -5
- package/lib/tntd-reference/ReferenceCheck/index.js +1 -1
- package/lib/tntd-reference/ReferenceDrawer/index.js +5 -5
- package/lib/tntd-reference/ReferenceInfo/index.js +1 -1
- package/lib/tntd-reference/index.js +1 -1
- package/lib/tntd-second-page/index.js +1 -1
- package/lib/tntd-select/DropDownWrap.js +8 -8
- package/lib/tntd-select/index.d.ts.map +1 -1
- package/lib/tntd-select/index.js +9 -10
- package/lib/tntd-select/index.js.map +1 -1
- package/lib/tntd-virtual-tree/index.js +8 -8
- package/lib/tntd-virtual-tree/utils.js +28 -28
- package/lib/tntd-virtual-tree-select/index.js +10 -10
- package/lib/tntd-virtual-tree-select/index.less +13 -0
- package/lib/tntd-virtual-tree-select/utils.js +9 -9
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/upload/index.js +1 -1
- package/lib/upload/svg/UploadSVG.js +1 -1
- package/lib/utils/checkAuth.js +4 -4
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/index.js +9 -21
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/lang.js +3 -3
- package/lib/water-mark/index.js +5 -5
- package/package.json +2 -1
package/lib/utils/index.js
CHANGED
|
@@ -38,18 +38,6 @@ Object.keys(_findMenuInfoByPath).forEach(function (key) {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
var _simpleTemplate = require("./simple-template");
|
|
42
|
-
Object.keys(_simpleTemplate).forEach(function (key) {
|
|
43
|
-
if (key === "default" || key === "__esModule") return;
|
|
44
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
45
|
-
if (key in exports && exports[key] === _simpleTemplate[key]) return;
|
|
46
|
-
Object.defineProperty(exports, key, {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function get() {
|
|
49
|
-
return _simpleTemplate[key];
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
41
|
var _lang = require("./lang");
|
|
54
42
|
Object.keys(_lang).forEach(function (key) {
|
|
55
43
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -63,12 +51,12 @@ Object.keys(_lang).forEach(function (key) {
|
|
|
63
51
|
});
|
|
64
52
|
});
|
|
65
53
|
var _prevLocale = require("../prev-locale");
|
|
66
|
-
function _toConsumableArray(
|
|
54
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
67
55
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
68
|
-
function _unsupportedIterableToArray(
|
|
69
|
-
function _iterableToArray(
|
|
70
|
-
function _arrayWithoutHoles(
|
|
71
|
-
function _arrayLikeToArray(
|
|
56
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
57
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
58
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
59
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
72
60
|
var isGroupMenu = exports.isGroupMenu = function isGroupMenu(menu) {
|
|
73
61
|
return (menu === null || menu === void 0 ? void 0 : menu.children) && !(menu === null || menu === void 0 ? void 0 : menu.path);
|
|
74
62
|
};
|
|
@@ -78,7 +66,7 @@ var getSelectedMenuInfo = exports.getSelectedMenuInfo = function getSelectedMenu
|
|
|
78
66
|
var menu;
|
|
79
67
|
var parentMenus = [];
|
|
80
68
|
if (selectedKey) {
|
|
81
|
-
|
|
69
|
+
traverseTree(menus, function (node, pnode, pnodes) {
|
|
82
70
|
if (!isGroupMenu(node) && node.code === selectedKey) {
|
|
83
71
|
subMenu = node;
|
|
84
72
|
menu = pnode;
|
|
@@ -88,7 +76,7 @@ var getSelectedMenuInfo = exports.getSelectedMenuInfo = function getSelectedMenu
|
|
|
88
76
|
});
|
|
89
77
|
} else {
|
|
90
78
|
// 默认找到第一个菜单项
|
|
91
|
-
|
|
79
|
+
traverseTree(menus, function (node, pnode, pnodes) {
|
|
92
80
|
if (!isGroupMenu(node)) {
|
|
93
81
|
subMenu = node;
|
|
94
82
|
menu = pnode;
|
|
@@ -121,7 +109,7 @@ var isNewTabMenu = exports.isNewTabMenu = function isNewTabMenu(menu) {
|
|
|
121
109
|
var openInNewTab = exports.openInNewTab = function openInNewTab(path) {
|
|
122
110
|
window.open(path, '_blank');
|
|
123
111
|
};
|
|
124
|
-
var
|
|
112
|
+
var traverseTree = exports.traverseTree = function traverseTree(treeData, callback, pnode) {
|
|
125
113
|
var pnodes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
126
114
|
;
|
|
127
115
|
(treeData || []).every(function (node, index) {
|
|
@@ -133,7 +121,7 @@ var _traverseTree = exports.traverseTree = function traverseTree(treeData, callb
|
|
|
133
121
|
}
|
|
134
122
|
// 回调函数返回false则终止遍历
|
|
135
123
|
if (result !== false) {
|
|
136
|
-
node &&
|
|
124
|
+
node && traverseTree(node.children || [], callback, node, [node].concat(_toConsumableArray(pnodes)));
|
|
137
125
|
}
|
|
138
126
|
return result !== false;
|
|
139
127
|
});
|
package/lib/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,uDAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,8CAA2B;AAC3B,uDAAoC;AACpC,yCAAsB;AACtB,gDAA4C;AAErC,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,KAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAA,CAAA;AAArD,QAAA,WAAW,eAA0C;AAE3D,MAAM,mBAAmB,GAAG,CAAC,WAAW,EAAE,KAAK,GAAG,EAAE,EAAE,EAAE;IAC7D,IAAI,OAAO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CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAtBY,QAAA,YAAY,gBAsBxB;AAEM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,EAAE;IAC/C,IAAI,MAAM,CAAA;IAEV,IAAI;QACF,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACzB;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAA;QACtC,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAA;KAC9D;IAED,OAAO,MAAM,IAAI,UAAU,CAAA;AAC7B,CAAC,CAAA;AAXY,QAAA,aAAa,iBAWzB;AAED;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE;IAC9D,MAAM,IAAI,GAAG,IAAA,yBAAW,GAAE,CAAA;IAC1B,IACE,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC;QACnC,OAAO,GAAG,KAAK,QAAQ;QACvB,IAAI,KAAK,IAAI;QACb,CAAC,UAAU,EACX;QACA,OAAO,GAAG,CAAA;KACX;IAED,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACjE,CAAC,CAAA;AAZY,QAAA,qBAAqB,yBAYjC","sourcesContent":["export * from './checkAuth'\nexport * from './findMenuInfoByPath'\nexport * from './lang'\nimport { getLanguage } from '../prev-locale'\n\nexport const isGroupMenu = (menu) => menu?.children && !menu?.path\n\nexport const getSelectedMenuInfo = (selectedKey, menus = []) => {\n let subMenu\n let menu\n let parentMenus = []\n\n if (selectedKey) {\n traverseTree(menus, (node, pnode, pnodes) => {\n if (!isGroupMenu(node) && node.code === selectedKey) {\n subMenu = node\n menu = pnode\n parentMenus = pnodes\n return false\n }\n })\n } else {\n // 默认找到第一个菜单项\n traverseTree(menus, (node, pnode, pnodes) => {\n if (!isGroupMenu(node)) {\n subMenu = node\n menu = pnode\n parentMenus = pnodes\n return false\n }\n })\n }\n\n return {\n subMenu,\n menu,\n parentMenus,\n }\n}\n\nexport const hasLevel3 = (menus) => {\n return menus?.some((menu) => menu?.children?.some((item) => item?.children?.length))\n}\n\nexport const isNewTabMenu = (menu) => {\n const { target, path } = menu || {}\n\n return target === '_blank' || (/^http/i.test(path) && /blankType=newTarget/.test(path))\n}\n\nexport const openInNewTab = (path) => {\n window.open(path, '_blank')\n}\n\nexport const traverseTree = (treeData, callback, pnode, pnodes = []) => {\n ;(treeData || []).every((node, index) => {\n let result\n\n if (callback) {\n result = callback(\n node,\n pnode,\n pnodes?.length ? pnodes : [pnode].filter((item) => !!item),\n index\n )\n }\n\n // 回调函数返回false则终止遍历\n if (result !== false) {\n node && traverseTree(node.children || [], callback, node, [node, ...pnodes])\n }\n\n return result !== false\n })\n\n return treeData\n}\n\nexport const safeParseJSON = (str, defaultObj) => {\n let result\n\n try {\n result = JSON.parse(str)\n } catch (err) {\n console.warn('json parse error:', err)\n result = typeof defaultObj === 'undefined' ? str : defaultObj\n }\n\n return result || defaultObj\n}\n\n/**\n * 将placeholder 英文状态下的首字母大写\n * @param {*} str\n * @returns\n */\nexport const capitalizeFirstLetter = (str, capitalize = true) => {\n const lang = getLanguage()\n if (\n [null, undefined, ''].includes(str) ||\n typeof str !== 'string' ||\n lang !== 'en' ||\n !capitalize\n ) {\n return str\n }\n\n return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase()\n}\n"]}
|
package/lib/utils/lang.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.titleHandle = exports.titleCaseUpper = exports.prepositions = exports.doUpperTitle = exports.articles = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _prevLocale = require("../prev-locale");
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
10
10
|
var prepositions = exports.prepositions = ['about', 'above', 'across', 'after', 'against', 'along', 'among', 'around', 'as', 'at', 'before', 'behind', 'below', 'beneath', 'beside', 'between', 'beyond', 'by', 'down', 'during', 'except', 'for', 'from', 'in', 'inside', 'into', 'like', 'near', 'of', 'off', 'on', 'onto', 'out', 'outside', 'over', 'past', 'round', 'since', 'through', 'throughout', 'to', 'toward', 'under', 'underneath', 'until', 'up', 'upon', 'with', 'within', 'without', 'or'];
|
|
11
11
|
var articles = exports.articles = ['the', 'a', 'an'];
|
|
12
12
|
var titleHandle = exports.titleHandle = function titleHandle(str) {
|
|
@@ -50,7 +50,7 @@ var titleCaseUpper = exports.titleCaseUpper = function titleCaseUpper(str) {
|
|
|
50
50
|
}
|
|
51
51
|
return str;
|
|
52
52
|
};
|
|
53
|
-
var
|
|
53
|
+
var doUpperTitle = exports.doUpperTitle = function doUpperTitle(label) {
|
|
54
54
|
var upperCaseIgnore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
55
55
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
56
56
|
if ((0, _prevLocale.getLanguage)() === 'cn') {
|
|
@@ -67,7 +67,7 @@ var _doUpperTitle = exports.doUpperTitle = function doUpperTitle(label) {
|
|
|
67
67
|
return Object.assign(Object.assign({}, label), {
|
|
68
68
|
props: Object.assign(Object.assign({}, label.props), {
|
|
69
69
|
children: (_d = (_c = label === null || label === void 0 ? void 0 : label.props) === null || _c === void 0 ? void 0 : _c.children) === null || _d === void 0 ? void 0 : _d.map(function (subLabel) {
|
|
70
|
-
return
|
|
70
|
+
return doUpperTitle(subLabel, upperCaseIgnore);
|
|
71
71
|
})
|
|
72
72
|
})
|
|
73
73
|
});
|
package/lib/water-mark/index.js
CHANGED
|
@@ -9,13 +9,13 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
11
11
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function _slicedToArray(
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
14
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
17
17
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
-
function _arrayWithHoles(
|
|
18
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
19
19
|
/**
|
|
20
20
|
* 返回当前显示设备的物理像素分辨率与CSS像素分辨率之比
|
|
21
21
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tntd",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.28-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "heft start --storybook",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"react": "~16.14.0",
|
|
63
63
|
"react-dom": "~16.14.0",
|
|
64
64
|
"jest": "~28.1.0",
|
|
65
|
+
"eslint-plugin-react": "^7.*.*",
|
|
65
66
|
"eslint-plugin-react-hooks": "~4.3.0",
|
|
66
67
|
"eslint": "~8.11.0",
|
|
67
68
|
"eslint-plugin-import": "~2.25.4",
|