@flatbiz/antd 4.2.35 → 4.2.37
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/esm/button-operate/index.js +1 -1
- package/esm/button-operate-6add2cbf.js +3 -0
- package/esm/button-operate-6add2cbf.js.map +1 -0
- package/esm/cascader-wrapper/index.js +1 -1
- package/esm/cascader-wrapper/index.js.map +1 -1
- package/esm/cascader-wrapper-7f1eed71.js +3 -0
- package/esm/cascader-wrapper-7f1eed71.js.map +1 -0
- package/esm/cell-render-03055c65.js +3 -0
- package/esm/cell-render-03055c65.js.map +1 -0
- package/esm/center-a4dfda6f.js +3 -0
- package/esm/center-a4dfda6f.js.map +1 -0
- package/esm/checkbox-wrapper/index.js +1 -1
- package/esm/checkbox-wrapper/index.js.map +1 -1
- package/esm/checkbox-wrapper-018a5c59.js +3 -0
- package/esm/checkbox-wrapper-018a5c59.js.map +1 -0
- package/esm/css-node-hover/index.js +1 -1
- package/esm/css-node-hover/index.js.map +1 -1
- package/esm/css-node-hover-ed7b9860.js +3 -0
- package/esm/css-node-hover-ed7b9860.js.map +1 -0
- package/esm/date-range-picker-wrapper-form-item/index.js +1 -1
- package/esm/date-range-picker-wrapper-form-item/index.js.map +1 -1
- package/esm/date-range-picker-wrapper-form-item-688cf465.js +3 -0
- package/esm/date-range-picker-wrapper-form-item-688cf465.js.map +1 -0
- package/esm/dialog-alert/index.js +1 -1
- package/esm/dialog-alert/index.js.map +1 -1
- package/esm/dialog-alert-0ca83448.js +3 -0
- package/esm/dialog-alert-0ca83448.js.map +1 -0
- package/esm/dialog-drawer/index.js +1 -1
- package/esm/dialog-drawer/index.js.map +1 -1
- package/esm/dialog-drawer-525a0bc3.js +3 -0
- package/esm/dialog-drawer-525a0bc3.js.map +1 -0
- package/esm/dialog-loading/index.js +1 -1
- package/esm/dialog-loading/index.js.map +1 -1
- package/esm/dialog-loading-16bd1baa.js +3 -0
- package/esm/dialog-loading-16bd1baa.js.map +1 -0
- package/esm/drawer-wrapper/index.js +1 -1
- package/esm/drawer-wrapper/index.js.map +1 -1
- package/esm/drawer-wrapper-9af2f178.js +3 -0
- package/esm/drawer-wrapper-9af2f178.js.map +1 -0
- package/esm/easy-table/index.js +1 -1
- package/esm/easy-table/index.js.map +1 -1
- package/esm/editable-field/index.js +1 -1
- package/esm/editable-field/index.js.map +1 -1
- package/esm/editable-field-7f30db8e.js +3 -0
- package/esm/editable-field-7f30db8e.js.map +1 -0
- package/esm/editable-field-provider/index.js +1 -1
- package/esm/editable-field-provider/index.js.map +1 -1
- package/esm/editable-field-provider-20963c3e.js +3 -0
- package/esm/editable-field-provider-20963c3e.js.map +1 -0
- package/esm/editable-table/index.js +1 -1
- package/esm/editable-table/index.js.map +1 -1
- package/esm/editable-table-6bd8df15.js +3 -0
- package/esm/editable-table-6bd8df15.js.map +1 -0
- package/esm/editor-wrapper/index.js +1 -1
- package/esm/editor-wrapper/index.js.map +1 -1
- package/esm/editor-wrapper-ff6e75b7.js +3 -0
- package/esm/editor-wrapper-ff6e75b7.js.map +1 -0
- package/esm/file-import/index.js +1 -1
- package/esm/file-import/index.js.map +1 -1
- package/esm/file-import-890a1df9.js +3 -0
- package/esm/file-import-890a1df9.js.map +1 -0
- package/esm/form-item-hidden/index.js +1 -1
- package/esm/form-item-hidden/index.js.map +1 -1
- package/esm/form-item-hidden-45541774.js +3 -0
- package/esm/form-item-hidden-45541774.js.map +1 -0
- package/esm/form-item-wrapper/index.js +1 -1
- package/esm/form-item-wrapper/index.js.map +1 -1
- package/esm/form-item-wrapper-dfe2ebd9.js +3 -0
- package/esm/form-item-wrapper-dfe2ebd9.js.map +1 -0
- package/esm/gap/index.js +1 -1
- package/esm/gap/index.js.map +1 -1
- package/esm/gap-284e1f59.js +3 -0
- package/esm/gap-284e1f59.js.map +1 -0
- package/esm/in-view-448ba714.js +3 -0
- package/esm/in-view-448ba714.js.map +1 -0
- package/esm/index.css +0 -0
- package/esm/index.js +80 -0
- package/esm/index.js.map +1 -0
- package/esm/label-value-layout/index.js +1 -1
- package/esm/label-value-layout/index.js.map +1 -1
- package/esm/label-value-layout-beb35b0d.js +3 -0
- package/esm/label-value-layout-beb35b0d.js.map +1 -0
- package/esm/modal-action/index.js +1 -1
- package/esm/modal-action/index.js.map +1 -1
- package/esm/modal-action-5c5ca8a7.js +3 -0
- package/esm/modal-action-5c5ca8a7.js.map +1 -0
- package/esm/modal-wrapper/index.js +1 -1
- package/esm/modal-wrapper/index.js.map +1 -1
- package/esm/modal-wrapper-ff8df98b.js +3 -0
- package/esm/modal-wrapper-ff8df98b.js.map +1 -0
- package/esm/page-fixed-footer/index.js +1 -1
- package/esm/page-fixed-footer/index.js.map +1 -1
- package/esm/page-fixed-footer-5fa10112.js +3 -0
- package/esm/page-fixed-footer-5fa10112.js.map +1 -0
- package/esm/page404/index.js +1 -1
- package/esm/page404/index.js.map +1 -1
- package/esm/page404-f087129a.js +3 -0
- package/esm/page404-f087129a.js.map +1 -0
- package/esm/permission/index.js +1 -1
- package/esm/permission/index.js.map +1 -1
- package/esm/permission-a1c99455.js +3 -0
- package/esm/permission-a1c99455.js.map +1 -0
- package/esm/radio-group-wrapper/index.js +1 -1
- package/esm/radio-group-wrapper/index.js.map +1 -1
- package/esm/radio-group-wrapper-b34746d1.js +3 -0
- package/esm/radio-group-wrapper-b34746d1.js.map +1 -0
- package/esm/relation-tree/index.js +1 -1
- package/esm/relation-tree/index.js.map +1 -1
- package/esm/relation-tree-7bec12bd.js +3 -0
- package/esm/relation-tree-7bec12bd.js.map +1 -0
- package/esm/rich-text-viewer/index.js +1 -1
- package/esm/rich-text-viewer/index.js.map +1 -1
- package/esm/rich-text-viewer-5cbe01e9.js +3 -0
- package/esm/rich-text-viewer-5cbe01e9.js.map +1 -0
- package/esm/roll-location-center/index.js +1 -1
- package/esm/roll-location-center/index.js.map +1 -1
- package/esm/roll-location-in-view/index.js +1 -1
- package/esm/roll-location-in-view/index.js.map +1 -1
- package/esm/rule-describe/index.js +1 -1
- package/esm/rule-describe/index.js.map +1 -1
- package/esm/rule-describe-b4a8e831.js +3 -0
- package/esm/rule-describe-b4a8e831.js.map +1 -0
- package/esm/selector-wrapper-search/index.js +1 -1
- package/esm/selector-wrapper-search/index.js.map +1 -1
- package/esm/selector-wrapper-search-aad145b5.js +3 -0
- package/esm/selector-wrapper-search-aad145b5.js.map +1 -0
- package/esm/selector-wrapper-simple/index.js +1 -1
- package/esm/selector-wrapper-simple/index.js.map +1 -1
- package/esm/selector-wrapper-simple-49384d37.js +3 -0
- package/esm/selector-wrapper-simple-49384d37.js.map +1 -0
- package/esm/simple-layout/index.css +1 -1
- package/esm/simple-layout/index.js +1 -1
- package/esm/simple-layout-08f90dab.js +3 -0
- package/esm/simple-layout-08f90dab.js.map +1 -0
- package/esm/sms-count-down/index.js +1 -1
- package/esm/sms-count-down/index.js.map +1 -1
- package/esm/sms-count-down-c2609386.js +3 -0
- package/esm/sms-count-down-c2609386.js.map +1 -0
- package/esm/switch-wrapper/index.js +1 -1
- package/esm/switch-wrapper/index.js.map +1 -1
- package/esm/switch-wrapper-f20b9a58.js +3 -0
- package/esm/switch-wrapper-f20b9a58.js.map +1 -0
- package/esm/table-cell-render/index.js +1 -1
- package/esm/table-cell-render/index.js.map +1 -1
- package/esm/table-title-tooltip/index.js +1 -1
- package/esm/table-title-tooltip/index.js.map +1 -1
- package/esm/tabs-wrapper/index.css +1 -1
- package/esm/tabs-wrapper/index.js +1 -1
- package/esm/tabs-wrapper/index.js.map +1 -1
- package/esm/tabs-wrapper-0a2da713.js +3 -0
- package/esm/tabs-wrapper-0a2da713.js.map +1 -0
- package/esm/tag-group/index.js +1 -1
- package/esm/tag-group/index.js.map +1 -1
- package/esm/tag-group-4fbcaa14.js +3 -0
- package/esm/tag-group-4fbcaa14.js.map +1 -0
- package/esm/tag-wrapper/index.js +1 -1
- package/esm/tag-wrapper/index.js.map +1 -1
- package/esm/tag-wrapper-6d8b505e.js +3 -0
- package/esm/tag-wrapper-6d8b505e.js.map +1 -0
- package/esm/time-picker-wrapper/index.js +1 -1
- package/esm/time-picker-wrapper/index.js.map +1 -1
- package/esm/time-picker-wrapper-f1d26d96.js +3 -0
- package/esm/time-picker-wrapper-f1d26d96.js.map +1 -0
- package/esm/time-range-picker-wrapper-form-item/index.js +1 -1
- package/esm/time-range-picker-wrapper-form-item/index.js.map +1 -1
- package/esm/time-range-picker-wrapper-form-item-9df6c0f4.js +3 -0
- package/esm/time-range-picker-wrapper-form-item-9df6c0f4.js.map +1 -0
- package/esm/title-render-2874a932.js +3 -0
- package/esm/title-render-2874a932.js.map +1 -0
- package/esm/tree-selector-wrapper/index.js +1 -1
- package/esm/tree-selector-wrapper/index.js.map +1 -1
- package/esm/tree-selector-wrapper-9cd9da23.js +3 -0
- package/esm/tree-selector-wrapper-9cd9da23.js.map +1 -0
- package/esm/tree-wrapper/index.css +1 -1
- package/esm/tree-wrapper/index.js +1 -1
- package/esm/tree-wrapper/index.js.map +1 -1
- package/esm/tree-wrapper-85aa72d7.js +3 -0
- package/esm/tree-wrapper-85aa72d7.js.map +1 -0
- package/index.d.ts +36 -0
- package/package.json +8 -8
- package/esm/button-operate-04d9185b.js +0 -3
- package/esm/button-operate-04d9185b.js.map +0 -1
- package/esm/simple-layout-1676e586.js +0 -3
- package/esm/simple-layout-1676e586.js.map +0 -1
package/esm/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import './button-operate/index.css';
|
|
3
|
+
import './button-wrapper/index.css';
|
|
4
|
+
import './config-provider-wrapper/index.css';
|
|
5
|
+
import './fba-hooks/index.css';
|
|
6
|
+
import './fba-utils/index.css';
|
|
7
|
+
import './dropdown-menu-wrapper/index.css';
|
|
8
|
+
import './cascader-wrapper/index.css';
|
|
9
|
+
import './request-status/index.css';
|
|
10
|
+
import './check-list/index.css';
|
|
11
|
+
import './checkbox-wrapper/index.css';
|
|
12
|
+
import './create-drawer-wrapper-model/index.css';
|
|
13
|
+
import './create-modal-wrapper-model/index.css';
|
|
14
|
+
import './css-node-hover/index.css';
|
|
15
|
+
import './date-picker-wrapper/index.css';
|
|
16
|
+
import './date-range-picker-wrapper/index.css';
|
|
17
|
+
import './date-range-picker-wrapper-form-item/index.css';
|
|
18
|
+
import './types/index.css';
|
|
19
|
+
import './dialog-alert/index.css';
|
|
20
|
+
import './dialog-confirm/index.css';
|
|
21
|
+
import './dialog-modal/index.css';
|
|
22
|
+
import './dialog-drawer/index.css';
|
|
23
|
+
import './dialog-loading/index.css';
|
|
24
|
+
import './drawer-wrapper/index.css';
|
|
25
|
+
import './dynamic-node/index.css';
|
|
26
|
+
import './easy-table/index.css';
|
|
27
|
+
import './form-grid/index.css';
|
|
28
|
+
import './simple-layout/index.css';
|
|
29
|
+
import './table-scrollbar/index.css';
|
|
30
|
+
import './editable-field/index.css';
|
|
31
|
+
import './icon-wrapper/index.css';
|
|
32
|
+
import './editable-field-provider/index.css';
|
|
33
|
+
import './editable-table/index.css';
|
|
34
|
+
import './selector-wrapper/index.css';
|
|
35
|
+
import './upload-wrapper/index.css';
|
|
36
|
+
import './input-wrapper/index.css';
|
|
37
|
+
import './input-text-area-wrapper/index.css';
|
|
38
|
+
import './editor-wrapper/index.css';
|
|
39
|
+
import './file-import/index.css';
|
|
40
|
+
import './flex-layout/index.css';
|
|
41
|
+
import './form-item-group/index.css';
|
|
42
|
+
import './form-item-hidden/index.css';
|
|
43
|
+
import './form-item-wrapper/index.css';
|
|
44
|
+
import './gap/index.css';
|
|
45
|
+
import './input-search-wrapper/index.css';
|
|
46
|
+
import './label-value-layout/index.css';
|
|
47
|
+
import './local-loading/index.css';
|
|
48
|
+
import './modal-action/index.css';
|
|
49
|
+
import './modal-wrapper/index.css';
|
|
50
|
+
import './page-fixed-footer/index.css';
|
|
51
|
+
import './page404/index.css';
|
|
52
|
+
import './permission/index.css';
|
|
53
|
+
import './pre-defined-class-name/index.css';
|
|
54
|
+
import './radio-group-wrapper/index.css';
|
|
55
|
+
import './relation-tree/index.css';
|
|
56
|
+
import './rich-text-editor/index.css';
|
|
57
|
+
import './rich-text-viewer/index.css';
|
|
58
|
+
import './roll-location-center/index.css';
|
|
59
|
+
import './roll-location-in-view/index.css';
|
|
60
|
+
import './rule-describe/index.css';
|
|
61
|
+
import './selector-wrapper-search/index.css';
|
|
62
|
+
import './selector-wrapper-simple/index.css';
|
|
63
|
+
import './sms-count-down/index.css';
|
|
64
|
+
import './styles/index.css';
|
|
65
|
+
import './switch-wrapper/index.css';
|
|
66
|
+
import './table-cell-render/index.css';
|
|
67
|
+
import './tag-list-select/index.css';
|
|
68
|
+
import './table-title-tooltip/index.css';
|
|
69
|
+
import './tabs-wrapper/index.css';
|
|
70
|
+
import './tag-group/index.css';
|
|
71
|
+
import './tag-wrapper/index.css';
|
|
72
|
+
import './time-picker-wrapper/index.css';
|
|
73
|
+
import './time-range-picker-wrapper/index.css';
|
|
74
|
+
import './time-range-picker-wrapper-form-item/index.css';
|
|
75
|
+
import './tree-selector-wrapper/index.css';
|
|
76
|
+
import './tree-wrapper/index.css';
|
|
77
|
+
import './index.css';
|
|
78
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
79
|
+
export{a as ButtonOperate,B as ButtonOperateItemContent}from"./button-operate-6add2cbf.js";export{B as ButtonWrapper}from"./button-wrapper-c63ea6fc.js";export{C as CascaderWrapper}from"./cascader-wrapper-7f1eed71.js";export{CheckList}from"./check-list/index.js";export{C as CheckboxWrapper}from"./checkbox-wrapper-018a5c59.js";export{C as ConfigProviderWrapper}from"./config-provider-wrapper-dfe8f592.js";export{createDrawerWrapperModel}from"./create-drawer-wrapper-model/index.js";export{createModalWrapperModel}from"./create-modal-wrapper-model/index.js";export{C as CssNodeHover}from"./css-node-hover-ed7b9860.js";export{D as DatePickerWrapper}from"./date-picker-wrapper-ba650858.js";export{D as DateRangePickerWrapper}from"./date-range-picker-wrapper-fb15c592.js";export{D as DateRangePickerWrapperFormItem}from"./date-range-picker-wrapper-form-item-688cf465.js";export{d as dialogAlert}from"./dialog-alert-0ca83448.js";export{d as dialogConfirm}from"./dialog-confirm-b289f5ed.js";export{d as dialogDrawer}from"./dialog-drawer-525a0bc3.js";export{d as dialogLoading}from"./dialog-loading-16bd1baa.js";export{d as dialogModal}from"./dialog-modal-225b0fe0.js";export{D as DrawerWrapper}from"./drawer-wrapper-9af2f178.js";export{D as DropdownMenuWrapper}from"./dropdown-menu-wrapper-2c4b6cad.js";export{d as dynamicNode}from"./dynamic-node-c7864af4.js";export{EasyTable}from"./easy-table/index.js";export{E as EditableField}from"./editable-field-7f30db8e.js";export{E as EditableFieldProvider}from"./editable-field-provider-20963c3e.js";export{E as EditableTable}from"./editable-table-6bd8df15.js";export{E as EditorWrapper}from"./editor-wrapper-ff6e75b7.js";export{fbaHooks}from"./fba-hooks/index.js";export{f as fbaUtils}from"./fba-utils-1e895394.js";export{F as FileImport}from"./file-import-890a1df9.js";export{F as FlexLayout}from"./flex-layout-8d2b668b.js";export{FormGrid}from"./form-grid/index.js";export{FormItemGroup}from"./form-item-group/index.js";export{F as FormItemHidden}from"./form-item-hidden-45541774.js";export{F as FormItemWrapper}from"./form-item-wrapper-dfe2ebd9.js";export{G as Gap}from"./gap-284e1f59.js";export{I as IconWrapper}from"./icon-wrapper-ed5fcacc.js";export{I as InputSearchWrapper}from"./input-search-wrapper-10d4a9b9.js";export{I as InputTextAreaWrapper}from"./input-text-area-wrapper-c958fba0.js";export{I as InputWrapper}from"./input-wrapper-b378eb5a.js";export{L as LabelValueLayout}from"./label-value-layout-beb35b0d.js";export{LocalLoading}from"./local-loading/index.js";export{M as ModalAction}from"./modal-action-5c5ca8a7.js";export{M as ModalWrapper}from"./modal-wrapper-ff8df98b.js";export{P as PageFixedFooter}from"./page-fixed-footer-5fa10112.js";export{P as Page404}from"./page404-f087129a.js";export{P as Permission}from"./permission-a1c99455.js";export{preDefinedClassName}from"./pre-defined-class-name/index.js";export{R as RadioGroupWrapper}from"./radio-group-wrapper-b34746d1.js";export{R as RelationTree}from"./relation-tree-7bec12bd.js";export{R as RequestStatus}from"./request-status-03fc60e2.js";export{R as RichTextEditor}from"./rich-text-editor-c8bac6d2.js";export{R as RichTextViewer}from"./rich-text-viewer-5cbe01e9.js";export{R as RollLocationCenter}from"./center-a4dfda6f.js";export{R as RollLocationInView}from"./in-view-448ba714.js";export{R as RuleDescribe}from"./rule-describe-b4a8e831.js";export{S as SelectorWrapper}from"./selector-wrapper-ece722f5.js";export{S as SelectorWrapperSearch}from"./selector-wrapper-search-aad145b5.js";export{S as SelectorWrapperSimple}from"./selector-wrapper-simple-49384d37.js";export{S as SimpleLayout}from"./simple-layout-08f90dab.js";export{S as SmsCountDown}from"./sms-count-down-c2609386.js";export{styles}from"./styles/index.js";export{S as SwitchWrapper}from"./switch-wrapper-f20b9a58.js";export{t as tableCellRender}from"./cell-render-03055c65.js";export{T as TableScrollbar}from"./table-scrollbar-66c1682c.js";export{T as TableTitleTooltip}from"./title-render-2874a932.js";export{T as TabsWrapper}from"./tabs-wrapper-0a2da713.js";export{T as TagGroup}from"./tag-group-4fbcaa14.js";export{T as TagListSelect}from"./tag-list-select-066f682f.js";export{T as TagWrapper}from"./tag-wrapper-6d8b505e.js";export{T as TimePickerWrapper}from"./time-picker-wrapper-f1d26d96.js";export{T as TimeRangePickerWrapper}from"./time-range-picker-wrapper-be9850b5.js";export{T as TimeRangePickerWrapperFormItem}from"./time-range-picker-wrapper-form-item-9df6c0f4.js";export{T as TreeSelectorWrapper}from"./tree-selector-wrapper-9cd9da23.js";export{T as TreeWrapper}from"./tree-wrapper-85aa72d7.js";export{U as UploadWrapper}from"./upload-wrapper-f20208d6.js";import"@ant-design/icons/es/icons/MoreOutlined";import"./_rollupPluginBabelHelpers-1f4d8910.js";import"@dimjs/lang/cjs/is-undefined";import"@dimjs/utils/cjs/class-names";import"@dimjs/lang/cjs/is-plain-object";import"@dimjs/lang/cjs/is-string";import"@dimjs/lang/cjs/is-promise";import"@wove/react/cjs/hooks";import"antd";import"react";import"react/jsx-runtime";import"@ant-design/icons/es/icons/LoadingOutlined";import"@flatbiz/utils";import"@ant-design/icons/es/icons/RedoOutlined";import"@dimjs/utils/cjs/extend";import"@dimjs/model";import"@dimjs/model-react";import"@wove/react/cjs/create-ctx";import"antd/es/locale/en_US";import"antd/es/locale/zh_CN";import"dayjs";import"dayjs/locale/en";import"dayjs/locale/zh-cn";import"dayjs/plugin/advancedFormat";import"dayjs/plugin/customParseFormat";import"dayjs/plugin/localeData";import"dayjs/plugin/utc";import"dayjs/plugin/weekday";import"dayjs/plugin/weekOfYear";import"dayjs/plugin/weekYear";import"./time-53b3f55f.js";import"@dimjs/lang/cjs/is-array";import"react-dom/client";import"./dom-4d04aa64.js";import"@ant-design/icons/es/icons/SaveOutlined";import"@ant-design/icons/es/icons/DownOutlined";import"@ant-design/icons/es/icons/UpOutlined";import"@ant-design/icons/es/icons/CloseOutlined";import"@ant-design/icons/es/icons/CheckOutlined";import"@dimjs/lang/cjs/is-number";import"@ant-design/icons/es/icons/EditOutlined";import"./context-25d0b686.js";import"@ant-design/icons/es/icons/PlusOutlined";import"@dimjs/lang/cjs/is-boolean";import"@ant-design/icons/es/icons/DeleteOutlined";import"@wove/react/cjs/editor";import"ahooks";import"./use-responsive-point-21b8c601.js";import"@dimjs/lang/cjs/is-deep-equal";import"@tinymce/tinymce-react";import"@ant-design/icons/es/icons/PlusCircleOutlined";import"@ant-design/icons/es/icons/FullscreenOutlined";import"@dimjs/utils/cjs/json";import"pubsub-js";import"@dimjs/lang/cjs/is-object";import"@dimjs/utils/cjs/get";import"@dimjs/lang/cjs/is-empty";import"@ant-design/icons/es/icons/QuestionCircleOutlined";import"dayjs/plugin/isSameOrAfter";import"dayjs/plugin/isSameOrBefore";import"@ant-design/icons/es/icons/CaretDownFilled";import"dequal";import"@dimjs/utils/cjs/tree";import"react-dom";
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
|
|
4
|
+
export{L as LabelValueLayout}from"../label-value-layout-beb35b0d.js";import"@dimjs/utils/cjs/class-names";import"antd";import"react";import"react/jsx-runtime";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{classNames as r}from"@dimjs/utils/cjs/class-names";import{Descriptions as e}from"antd";import{useMemo as a}from"react";import{jsx as l}from"react/jsx-runtime";var t=function t(n){var o={"--v-label-value-layout-lWidth":(n.labelWidth||120)+"px"};var i=r("v-label-value-layout",n.className);var s=a((function(){return n.options.filter((function(r){return!r.hidden}))}),[n.options]);return l(e,{column:n.column||1,bordered:n.bordered,size:"small",className:i,style:o,children:s.map((function(r,a){return l(e.Item,{label:r.label,span:r.span,children:r.value},a)}))})};export{t as L};
|
|
3
|
+
//# sourceMappingURL=label-value-layout-beb35b0d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-value-layout-beb35b0d.js","sources":["@flatbiz/antd/src/label-value-layout/label-value-layout.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { Descriptions } from 'antd';\nimport { CSSProperties, ReactElement, useMemo } from 'react';\nimport './style.less';\n\nexport type LabelValueLayoutProps = {\n options: {\n label: string | ReactElement;\n value?: string | number | ReactElement;\n span?: number;\n hidden?: boolean;\n }[];\n labelWidth?: number;\n // 一行占几组,默认1\n column?: number;\n bordered?: boolean;\n className?: string;\n};\n\n/**\n * options[].span 是 Description.Item 的数量。 span={2} 会占用两个 DescriptionItem 的宽度\n * options[].hidden 是否隐藏 Description.Item\n */\nexport const LabelValueLayout = (props: LabelValueLayoutProps) => {\n const style = { '--v-label-value-layout-lWidth': `${props.labelWidth || 120}px` } as CSSProperties;\n const className = classNames('v-label-value-layout', props.className);\n\n const options = useMemo(() => {\n return props.options.filter((item) => !item.hidden);\n }, [props.options]);\n return (\n <Descriptions\n column={props.column || 1}\n bordered={props.bordered}\n size=\"small\"\n className={className}\n style={style}\n >\n {options.map((item, index) => {\n return (\n <Descriptions.Item key={index} label={item.label} span={item.span}>\n {item.value}\n </Descriptions.Item>\n );\n })}\n </Descriptions>\n );\n};\n"],"names":["LabelValueLayout","props","style","labelWidth","className","_classNames","options","useMemo","filter","item","hidden","_jsx","Descriptions","column","bordered","size","children","map","index","Item","label","span","value"],"mappings":";0KAuBaA,EAAmB,SAAnBA,EAAoBC,GAC/B,IAAMC,EAAQ,CAAE,iCAAoCD,EAAME,YAAc,KAAG,MAC3E,IAAMC,EAAYC,EAAW,uBAAwBJ,EAAMG,WAE3D,IAAME,EAAUC,GAAQ,WACtB,OAAON,EAAMK,QAAQE,QAAO,SAACC,GAAI,OAAMA,EAAKC,SAC9C,GAAG,CAACT,EAAMK,UACV,OACEK,EAACC,EAAY,CACXC,OAAQZ,EAAMY,QAAU,EACxBC,SAAUb,EAAMa,SAChBC,KAAK,QACLX,UAAWA,EACXF,MAAOA,EAAMc,SAEZV,EAAQW,KAAI,SAACR,EAAMS,GAClB,OACEP,EAACC,EAAaO,KAAI,CAAaC,MAAOX,EAAKW,MAAOC,KAAMZ,EAAKY,KAAKL,SAC/DP,EAAKa,OADgBJ,OAOlC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
|
|
4
|
+
export{M as ModalAction}from"../modal-action-5c5ca8a7.js";import"../_rollupPluginBabelHelpers-1f4d8910.js";import"react";import"react/jsx-runtime";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{a as r}from"./_rollupPluginBabelHelpers-1f4d8910.js";import{useState as n,isValidElement as o,Fragment as e}from"react";import{jsxs as t,jsx as i}from"react/jsx-runtime";var l=function l(c){var u=c.action,a=c.children;var s=n(false),p=s[0],f=s[1];var v=function r(n){return new Promise((function(r,e){var t;if(o(u)){t=u.props.onClick;if(typeof t==="function"){return Promise.resolve(t==null?void 0:t(n)).then(function(r){try{return i.call(this)}catch(r){return e(r)}}.bind(this),e)}function i(){return l.call(this)}return i.call(this)}function l(){f(true);return r()}return l.call(this)}))};var h=function r(){f(false)};var m=o(a)?a:a({onClose:h,open:p});return t(e,{children:[o(u)?i(u.type,r({},u.props,{onClick:v})):u==null?void 0:u({onClick:v,onClose:h,open:p}),i(m.type,r({open:p,onClose:h,onCancel:h},m.props))]})};export{l as M};
|
|
3
|
+
//# sourceMappingURL=modal-action-5c5ca8a7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-action-5c5ca8a7.js","sources":["@flatbiz/antd/src/modal-action/modal-action.tsx"],"sourcesContent":["import { TAny } from '@flatbiz/utils';\nimport { Fragment, isValidElement, ReactElement, useState } from 'react';\n\ntype onClick = (e?: React.MouseEvent<HTMLElement>) => void;\nexport interface ModalActionProps {\n children: ReactElement | ((data: { onClose: () => void; open: boolean }) => ReactElement);\n action?:\n | (ReactElement & { onClick?: onClick })\n | ((data: { onClick: onClick; onClose: () => void; open: boolean }) => ReactElement);\n}\n\n/**\n * 弹框 触发器\n * ```\n * <ModalAction action={<Button type=\"primary\">打开</Button>}>\n * {({ onClose }) => (\n * <Modal onOk={onClose}>xxx</Modal>\n * )}\n * </ModalAction>\n * ```\n */\nexport const ModalAction = (props: ModalActionProps) => {\n const { action, children } = props;\n\n const [open, setOpen] = useState<boolean>(false);\n\n const handleOnClick = async (e: unknown) => {\n if (isValidElement(action)) {\n const { onClick } = action.props;\n if (typeof onClick === 'function') {\n await onClick?.(e);\n }\n }\n setOpen(true);\n };\n\n const onClose = () => {\n setOpen(false);\n };\n const childrenReactElement = isValidElement(children) ? children : (children as TAny)({ onClose, open });\n\n return (\n <Fragment>\n {isValidElement(action) ? (\n <action.type {...action.props} onClick={handleOnClick} />\n ) : (\n action?.({ onClick: handleOnClick, onClose, open })\n )}\n <childrenReactElement.type\n open={open}\n onClose={onClose}\n onCancel={onClose}\n {...childrenReactElement.props}\n />\n </Fragment>\n );\n};\n"],"names":["ModalAction","props","action","children","_useState","useState","open","setOpen","handleOnClick","e","Promise","$return","$error","_onClick","isValidElement","onClick","resolve","then","$await_3","$If_2","call","this","$boundEx","bind","$If_1","onClose","childrenReactElement","_jsxs","Fragment","_jsx","type","_extends","onCancel"],"mappings":";qLAqBaA,EAAc,SAAdA,EAAeC,GAC1B,IAAQC,EAAqBD,EAArBC,OAAQC,EAAaF,EAAbE,SAEhB,IAAAC,EAAwBC,EAAkB,OAAnCC,EAAIF,EAAA,GAAEG,EAAOH,EAAA,GAEpB,IAAMI,EAAgB,SAAhBA,EAAuBC,GAAP,OAAA,IAAAC,SAAA,SAAAC,EAAAC,GAAA,IAAAC,EACpB,GAAIC,EAAeZ,GAAS,CAClBa,EAAYb,EAAOD,MAAnBc,QACR,UAAWA,IAAY,WAAY,CACjC,OAAAL,QAAAM,QAAMD,GAAAA,UAAAA,EAAAA,EAAUN,IAAhBQ,KA9BR,SAAAC,GAAA,IAAI,OAAJC,EAAGC,KAAQC,KAAF,CAAC,MAAAC,GAAW,OAAOV,EAAAU,EAAM,CAAC,EAAhCC,KAAKF,MAAKT,EA+BP,CAAC,SAAAO,IAAA,OA/BPK,EAAGJ,KAAQC,KAAA,CAAA,OAAXF,EAAGC,KAAQC,KAgCP,CAAC,SAAAG,IACDjB,EAAQ,MAAM,OAAAI,GAAA,CAAA,OAjClBa,EAAGJ,KAAQC,KAAA,GAkCR,EAED,IAAMI,EAAU,SAAVA,IACJlB,EAAQ,QAEV,IAAMmB,EAAuBZ,EAAeX,GAAYA,EAAYA,EAAkB,CAAEsB,QAAAA,EAASnB,KAAAA,IAEjG,OACEqB,EAACC,EAAQ,CAAAzB,UACNW,EAAeZ,GACd2B,EAAC3B,EAAO4B,KAAIC,EAAK7B,GAAAA,EAAOD,MAAK,CAAEc,QAASP,KAExCN,GAAAA,UAAAA,EAAAA,EAAS,CAAEa,QAASP,EAAeiB,QAAAA,EAASnB,KAAAA,IAE9CuB,EAACH,EAAqBI,KAAIC,EAAA,CACxBzB,KAAMA,EACNmB,QAASA,EACTO,SAAUP,GACNC,EAAqBzB,UAIjC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './../fba-hooks/index.css';
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
|
-
|
|
5
|
+
export{M as ModalWrapper}from"../modal-wrapper-ff8df98b.js";import"@dimjs/utils/cjs/class-names";import"../_rollupPluginBabelHelpers-1f4d8910.js";import"antd";import"react";import"../fba-hooks/index.js";import"@dimjs/lang/cjs/is-array";import"@wove/react/cjs/hooks";import"../use-responsive-point-21b8c601.js";import"react/jsx-runtime";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{classNames as r}from"@dimjs/utils/cjs/class-names";import{_ as e,a as o}from"./_rollupPluginBabelHelpers-1f4d8910.js";import{Space as a,Button as n,Modal as i}from"antd";import{Fragment as l}from"react";import{fbaHooks as t}from"./fba-hooks/index.js";import{jsx as c,jsxs as d}from"react/jsx-runtime";var s=["loading","okText","cancelText","onCancel","onOk","hideOkBtn"];var p=function r(i){var t=i.loading,p=i.okText,m=p===void 0?"保存":p,h=i.cancelText,u=h===void 0?"取消":h,f=i.onCancel,v=i.onOk,k=i.hideOkBtn,N=e(i,s);return c(l,{children:d(a,{size:"middle",children:[c(n,o({},N.cancelButtonProps,{className:"cancel-btn",onClick:f,children:u})),k!=true&&c(n,o({type:"primary"},N.okButtonProps,{className:"ok-btn",onClick:v,loading:t,children:m}))]})})};var m=["pageLoading","className","width","children"];var h=function r(){return c("div",{className:"modal-wrapper-loader",children:d("div",{className:"loader-wrapper",children:[c("div",{className:"loader-inner"}),c("div",{className:"loader-text",children:"LOADING"})]})})};var u=function r(e){return d(l,{children:[c("div",{className:"modal-wrapper-content",children:e.children}),e.operationProps?c(f,{children:c(p,o({},e.operationProps))}):null]})};var f=function r(e){return c("div",{className:"modal-wrapper-footer",children:e.children})};var v=function a(n){var s=n.pageLoading,p=n.className,u=n.width,f=n.children,v=e(n,m);t.useEffectCustom((function(){if(n["operationProps"]){throw new Error("ModalWrapper组件升级,参数operationProps用法变更,请及时更新")}}),[]);return c(i,o({className:r("modal-wrapper",p),keyboard:false,destroyOnClose:true,forceRender:false},v,{width:u||600,footer:null,children:d(l,{children:[f,s&&c(h,{})]})}))};v.Content=u;v.Footer=f;export{v as M};
|
|
3
|
+
//# sourceMappingURL=modal-wrapper-ff8df98b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal-wrapper-ff8df98b.js","sources":["@flatbiz/antd/src/modal-wrapper/modal-operation.tsx","@flatbiz/antd/src/modal-wrapper/modal-wrapper.tsx"],"sourcesContent":["import { Button, ButtonProps, Space } from 'antd';\nimport { Fragment } from 'react';\n\nexport interface ModalOperationOldProps {\n loading?: boolean;\n okText?: string;\n cancelText?: string;\n onOk?: () => void;\n onCancel?: () => void;\n hideOkBtn?: boolean;\n okButtonProps?: Omit<ButtonProps, 'onClick' | 'loading' | 'className'>;\n cancelButtonProps?: Omit<ButtonProps, 'onClick' | 'loading' | 'className'>;\n}\n\nexport const ModalOperation = ({\n loading,\n okText = '保存',\n cancelText = '取消',\n onCancel,\n onOk,\n hideOkBtn,\n ...otherProps\n}: ModalOperationOldProps) => {\n return (\n <Fragment>\n <Space size=\"middle\">\n <Button {...otherProps.cancelButtonProps} className=\"cancel-btn\" onClick={onCancel}>\n {cancelText}\n </Button>\n {hideOkBtn != true && (\n <Button\n type=\"primary\"\n {...otherProps.okButtonProps}\n className=\"ok-btn\"\n onClick={onOk}\n loading={loading}\n >\n {okText}\n </Button>\n )}\n </Space>\n </Fragment>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { Modal, ModalProps } from 'antd';\nimport { FC, Fragment, ReactNode } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { ModalOperation, ModalOperationOldProps } from './modal-operation';\nimport './style.less';\n\ntype ModalWrapperStaticMethods = {\n Content: typeof ModalWrapperContent;\n Footer: typeof ModalWrapperFooter;\n};\n\nexport type ModalWrapperProps = {\n className?: string;\n // 整个modal页面级的spinning <Page loading />\n pageLoading?: boolean;\n} & Omit<\n ModalProps,\n | 'footer'\n | 'onOk'\n | 'okText'\n | 'cancelText'\n | 'okButtonProps'\n | 'cancelButtonProps'\n | 'okType'\n | 'confirmLoading'\n>;\n\nconst PageLoader = () => {\n return (\n <div className=\"modal-wrapper-loader\">\n <div className=\"loader-wrapper\">\n <div className=\"loader-inner\" />\n <div className=\"loader-text\">LOADING</div>\n </div>\n </div>\n );\n};\n\nconst ModalWrapperContent = (props: { operationProps?: ModalOperationOldProps; children?: ReactNode }) => {\n return (\n <Fragment>\n <div className=\"modal-wrapper-content\">{props.children}</div>\n {props.operationProps ? (\n <ModalWrapperFooter>\n <ModalOperation {...props.operationProps} />\n </ModalWrapperFooter>\n ) : null}\n </Fragment>\n );\n};\n\nconst ModalWrapperFooter = (props) => {\n return <div className=\"modal-wrapper-footer\">{props.children}</div>;\n};\n\n/**\n * 弹窗机制\n * @deprecated 已过期,后面版本会移除;请使用 dialogModal.open\n * ```\n * 1. 默认 destroyOnClose = true\n * 2. 默认 forceRender = false\n * 3. 如果设置 forceRender = true,会导致弹框中的接口提前调用\n *\n * 注意\n * 1. <Modal /> 默认关闭后状态不会自动清空, 如果希望每次打开都是新内容,请设置 destroyOnClose。\n * 2. <Modal /> 和 Form 一起配合使用时,设置 destroyOnClose 也不会在 Modal 关闭时销毁表单字段数据,需要设置 <Form preserve={false} />。\n *\n * ```\n */\nexport const ModalWrapper: FC<ModalWrapperProps> & ModalWrapperStaticMethods = (props) => {\n const { pageLoading, className, width, children, ...otherProps } = props;\n\n fbaHooks.useEffectCustom(() => {\n if (props['operationProps']) {\n throw new Error('ModalWrapper组件升级,参数operationProps用法变更,请及时更新');\n }\n }, []);\n\n return (\n <Modal\n className={classNames('modal-wrapper', className)}\n keyboard={false}\n destroyOnClose={true}\n forceRender={false}\n {...otherProps}\n width={width || 600}\n footer={null}\n >\n <Fragment>\n {children}\n {pageLoading && <PageLoader />}\n </Fragment>\n </Modal>\n );\n};\n\nModalWrapper.Content = ModalWrapperContent;\nModalWrapper.Footer = ModalWrapperFooter;\n"],"names":["ModalOperation","_ref","loading","_ref$okText","okText","_ref$cancelText","cancelText","onCancel","onOk","hideOkBtn","otherProps","_objectWithoutPropertiesLoose","_excluded","_jsx","Fragment","children","_jsxs","Space","size","Button","_extends","cancelButtonProps","className","onClick","type","okButtonProps","PageLoader","ModalWrapperContent","props","operationProps","ModalWrapperFooter","ModalWrapper","pageLoading","width","fbaHooks","useEffectCustom","Error","Modal","_classNames","keyboard","destroyOnClose","forceRender","footer","Content","Footer"],"mappings":";0XAcO,IAAMA,EAAiB,SAAjBA,EAAcC,GAQG,IAP5BC,EAAOD,EAAPC,QAA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iBAAgB,WACvB,GAAIP,EAAM,kBAAmB,CAC3B,MAAM,IAAIQ,MAAM,8CAClB,CACD,GAAE,IAEH,OACEvB,EAACwB,EAAKjB,EAAA,CACJE,UAAWgB,EAAW,gBAAiBhB,GACvCiB,SAAU,MACVC,eAAgB,KAChBC,YAAa,OACT/B,EAAU,CACduB,MAAOA,GAAS,IAChBS,OAAQ,KAAK3B,SAEbC,EAACF,EAAQ,CAAAC,SAAA,CACNA,EACAiB,GAAenB,EAACa,EAAa,CAAA,QAItC,EAEAK,EAAaY,QAAUhB,EACvBI,EAAaa,OAASd"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
|
|
4
|
+
export{P as PageFixedFooter}from"../page-fixed-footer-5fa10112.js";import"@dimjs/utils/cjs/class-names";import"react/jsx-runtime";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{classNames as e}from"@dimjs/utils/cjs/class-names";import{jsx as s}from"react/jsx-runtime";var r=function r(t){return s("div",{className:e("page-fixed-footer",t.className),style:t.style,children:t.children})};export{r as P};
|
|
3
|
+
//# sourceMappingURL=page-fixed-footer-5fa10112.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-fixed-footer-5fa10112.js","sources":["@flatbiz/antd/src/page-fixed-footer/page-fixed-footer.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { CSSProperties, ReactNode } from 'react';\nimport './style.less';\n\nexport type PageFixedFooterProps = {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode | ReactNode[];\n};\n\nexport const PageFixedFooter = (props: PageFixedFooterProps) => {\n return (\n <div className={classNames('page-fixed-footer', props.className)} style={props.style}>\n {props.children}\n </div>\n );\n};\n"],"names":["PageFixedFooter","props","_jsx","className","_classNames","style","children"],"mappings":";sGAUaA,EAAkB,SAAlBA,EAAmBC,GAC9B,OACEC,EAAA,MAAA,CAAKC,UAAWC,EAAW,oBAAqBH,EAAME,WAAYE,MAAOJ,EAAMI,MAAMC,SAClFL,EAAMK,UAGb"}
|
package/esm/page404/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
|
|
4
|
+
export{P as Page404}from"../page404-f087129a.js";import"antd";import"react/jsx-runtime";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/esm/page404/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page404-f087129a.js","sources":["@flatbiz/antd/src/page404/page404.tsx"],"sourcesContent":["import { Result } from 'antd';\n\nexport type Page404Props = {\n message?: string;\n};\n\nexport const Page404 = (props: Page404Props) => {\n return <Result status=\"404\" title=\"404\" subTitle={props.message} />;\n};\n"],"names":["Page404","props","_jsx","Result","status","title","subTitle","message"],"mappings":";0EAMaA,EAAU,SAAVA,EAAWC,GACtB,OAAOC,EAACC,EAAM,CAACC,OAAO,MAAMC,MAAM,MAAMC,SAAUL,EAAMM,SAC1D"}
|
package/esm/permission/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './../fba-utils/index.css';
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
|
-
|
|
5
|
+
export{P as Permission}from"../permission-a1c99455.js";import"react";import"../fba-utils-1e895394.js";import"@dimjs/lang/cjs/is-array";import"@flatbiz/utils";import"react/jsx-runtime";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{Fragment as r}from"react";import{f as e}from"./fba-utils-1e895394.js";import{jsx as i}from"react/jsx-runtime";var t=function t(n){var m=e.getPermissionList();if(!n.name||m.includes(n.name)){return i(r,{children:n.children})}return null};export{t as P};
|
|
3
|
+
//# sourceMappingURL=permission-a1c99455.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-a1c99455.js","sources":["@flatbiz/antd/src/permission/permission.tsx"],"sourcesContent":["import { Fragment, ReactNode } from 'react';\nimport { fbaUtils } from '../fba-utils';\n\nexport interface PermissionProps {\n name?: string;\n children?: ReactNode | ReactNode[];\n}\nexport const Permission = (props: PermissionProps) => {\n const permissionList = fbaUtils.getPermissionList();\n if (!props.name || permissionList.includes(props.name)) {\n return <Fragment>{props.children}</Fragment>;\n }\n return null;\n};\n"],"names":["Permission","props","permissionList","fbaUtils","getPermissionList","name","includes","_jsx","Fragment","children"],"mappings":";yHAOaA,EAAa,SAAbA,EAAcC,GACzB,IAAMC,EAAiBC,EAASC,oBAChC,IAAKH,EAAMI,MAAQH,EAAeI,SAASL,EAAMI,MAAO,CACtD,OAAOE,EAACC,EAAQ,CAAAC,SAAER,EAAMQ,UAC1B,CACA,OAAO,IACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
import './index.css';
|
|
3
3
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
4
|
-
|
|
4
|
+
export{R as RadioGroupWrapper}from"../radio-group-wrapper-b34746d1.js";import"@flatbiz/utils";import"antd";import"react/jsx-runtime";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import{valueIsEqual as n}from"@flatbiz/utils";import{Space as e,Radio as r}from"antd";import{jsx as t}from"react/jsx-runtime";var a=function a(i){var u=function n(e){return new Promise((function(n,r){var t;t=e.target.value;if(i.onPreChange){return Promise.resolve(i.onPreChange(t)).then(function(n){try{return a.call(this)}catch(n){return r(n)}}.bind(this),r)}function a(){i.onChange==null?void 0:i.onChange(t);return n()}return a.call(this)}))};var o=function e(r){if(!i.isCancel)return;var t=r.target.value;if(n(i.value,t)){i.onChange==null?void 0:i.onChange(undefined)}};return t(e,{size:5,wrap:true,children:i.options.map((function(n){return t(r,{value:n.value,onClick:o,checked:i.value===n.value,onChange:u,disabled:i.disabled||n.disabled,children:n.label},n.value)}))})};export{a as R};
|
|
3
|
+
//# sourceMappingURL=radio-group-wrapper-b34746d1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group-wrapper-b34746d1.js","sources":["@flatbiz/antd/src/radio-group-wrapper/radio-group-wrapper.tsx"],"sourcesContent":["import { valueIsEqual } from '@flatbiz/utils';\nimport { Radio, Space } from 'antd';\nimport { ReactElement } from 'react';\n\nexport type RadioGroupWrapperValue<T extends string | number> = T;\n\nexport type RadioGroupWrapperOptionItem = {\n label: string | ReactElement;\n value: string | number;\n disabled?: boolean;\n};\n\nexport type CustomRadioGroupProps = {\n value?: RadioGroupWrapperValue<string | number>;\n onChange?: (value?: RadioGroupWrapperValue<string | number>) => void;\n onPreChange?: (value?: RadioGroupWrapperValue<string | number>) => Promise<void>;\n options: RadioGroupWrapperOptionItem[];\n /** 是否可取消选中,默认:false */\n isCancel?: boolean;\n disabled?: boolean;\n};\n\n/**\n * RadioGroupWrapper 为了解决 RadioGroup 组件不能取消选中问题\n * @param props\n * @returns\n */\nexport const RadioGroupWrapper = (props: CustomRadioGroupProps) => {\n const onChange = async (event) => {\n const value = event.target.value;\n if (props.onPreChange) {\n await props.onPreChange(value);\n }\n props.onChange?.(value);\n };\n const onClick = (event) => {\n if (!props.isCancel) return;\n const value = event.target.value;\n if (valueIsEqual(props.value, value)) {\n props.onChange?.(undefined);\n }\n };\n return (\n <Space size={5} wrap={true}>\n {props.options.map((item) => {\n return (\n <Radio\n value={item.value}\n onClick={onClick}\n checked={props.value === item.value}\n key={item.value}\n onChange={onChange}\n disabled={props.disabled || item.disabled}\n >\n {item.label}\n </Radio>\n );\n })}\n </Space>\n );\n};\n"],"names":["RadioGroupWrapper","props","onChange","event","Promise","$return","$error","value","target","onPreChange","resolve","then","$await_2","$If_1","call","this","$boundEx","bind","onClick","isCancel","valueIsEqual","undefined","_jsx","Space","size","wrap","children","options","map","item","Radio","checked","disabled","label"],"mappings":";kIA2BaA,EAAoB,SAApBA,EAAqBC,GAChC,IAAMC,EAAW,SAAXA,EAAkBC,GAAP,OAAA,IAAAC,SAAA,SAAAC,EAAAC,GAAA,IACTC,EAAAA,EAAQJ,EAAMK,OAAOD,MAC3B,GAAIN,EAAMQ,YAAa,CACrB,OAAAL,QAAAM,QAAMT,EAAMQ,YAAYF,IAAxBI,KA/BN,SAAAC,GAAA,IAAI,OAAJC,EAAGC,KAAQC,KAAF,CAAC,MAAAC,GAAW,OAAOV,EAAAU,EAAM,CAAC,EAAhCC,KAAKF,MAAKT,EAgCT,CAAC,SAAAO,IACDZ,EAAMC,UAAND,UAAAA,EAAAA,EAAMC,SAAWK,GAAO,OAAAF,GAAA,CAAA,OAjC5BQ,EAAGC,KAAQC,KAAA,GAkCR,EACD,IAAMG,EAAU,SAAVA,EAAWf,GACf,IAAKF,EAAMkB,SAAU,OACrB,IAAMZ,EAAQJ,EAAMK,OAAOD,MAC3B,GAAIa,EAAanB,EAAMM,MAAOA,GAAQ,CACpCN,EAAMC,UAAND,UAAAA,EAAAA,EAAMC,SAAWmB,UACnB,GAEF,OACEC,EAACC,EAAK,CAACC,KAAM,EAAGC,KAAM,KAAKC,SACxBzB,EAAM0B,QAAQC,KAAI,SAACC,GAClB,OACEP,EAACQ,EAAK,CACJvB,MAAOsB,EAAKtB,MACZW,QAASA,EACTa,QAAS9B,EAAMM,QAAUsB,EAAKtB,MAE9BL,SAAUA,EACV8B,SAAU/B,EAAM+B,UAAYH,EAAKG,SAASN,SAEzCG,EAAKI,OAJDJ,EAAKtB,WAUtB"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import './../fba-hooks/index.css';
|
|
3
3
|
import './index.css';
|
|
4
4
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
5
|
-
|
|
5
|
+
export{R as RelationTree}from"../relation-tree-7bec12bd.js";import"@wove/react/cjs/hooks";import"../_rollupPluginBabelHelpers-1f4d8910.js";import"@dimjs/utils/cjs/class-names";import"antd";import"react";import"../fba-hooks/index.js";import"@dimjs/lang/cjs/is-array";import"../use-responsive-point-21b8c601.js";import"react/jsx-runtime";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["@flatbiz/antd/src/relation-tree/compts/relation.tsx","@flatbiz/antd/src/relation-tree/compts/relation-group-list.tsx","@flatbiz/antd/src/relation-tree/compts/relation-item.tsx","@flatbiz/antd/src/relation-tree/utils.ts","@flatbiz/antd/src/relation-tree/relation-tree.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { Tag } from 'antd';\nimport { CSSProperties } from 'react';\nimport { RelationProps } from '../type';\n\nexport const Relation = (props: RelationProps) => {\n const style = {\n '--relation-tagline-width': `${props.tagLineWidth || 40}px`,\n '--relation-group-indent-width': `${props.indentWidth || 80}px`,\n '--relation-tag-width': `${props.tagWidth || 26}px`,\n '--relation-line-color': `${props.lineColor || '#fda148'}`,\n } as CSSProperties;\n\n const className = classNames(\n 'relation-list',\n { 'relation-list-only-one': props.onlyOne, 'relation-list-only-no-main-one': props.onlyOne },\n props.className,\n );\n const { solt1, solt2 } = props;\n\n return (\n <div className={className} style={style}>\n {solt1 ? (\n <div className=\"relation-list-solt1\">\n <div className=\"relation-list-line\"></div>\n <div className=\"relation-list-label\">{props.label}</div>\n\n {props.tagName ? (\n <Tag\n className=\"relation-item-tag\"\n color={props.tagColor || '#fecd96'}\n onClick={props.onTagClick?.bind(null, props.tagName)}\n >\n {props.tagName}\n </Tag>\n ) : null}\n {solt1()}\n </div>\n ) : null}\n {solt2 ? <div className=\"relation-list-solt2\">{solt2()}</div> : null}\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { ReactElement } from 'react';\n\nexport type RelationGroupListProps = {\n children: ReactElement | ReactElement[] | null;\n className?: string;\n};\n\nexport const RelationGroupList = (props: RelationGroupListProps) => {\n return <div className={classNames('relation-group-list', props.className)}>{props.children}</div>;\n};\n","import { classNames } from '@dimjs/utils';\nimport { CSSProperties, ReactElement } from 'react';\n\nexport type RelationItemProps = {\n children: ReactElement | null | Array<ReactElement | null>;\n className?: string;\n style?: CSSProperties;\n isFirst?: boolean;\n isLast?: boolean;\n onlyOne?: boolean;\n};\n\nexport const RelationItem = (props: RelationItemProps) => {\n const className = classNames('relation-item', {\n 'relation-item-line': true,\n 'relation-item-first': props.isFirst,\n 'relation-item-last': props.isLast,\n 'relation-item-only-one': props.onlyOne,\n });\n\n return (\n <div className={className} style={props.style}>\n {props.children}\n </div>\n );\n};\n","import { TRelationTreeData } from './type';\n\nexport const deleteLoop = (data: TRelationTreeData, uid: string) => {\n if (data.uid === uid) {\n data['_delete'] = true;\n }\n data?.relationList?.forEach((item) => {\n if (item.uid === uid || item.customData?.uid === uid) {\n item['_delete'] = true;\n if (data.relationList.length === 1) {\n data['_delete'] = true;\n }\n }\n\n item.children?.forEach((innerItem) => {\n deleteLoop(innerItem, uid);\n });\n });\n};\n\nexport const filterSurplusData = (data: TRelationTreeData) => {\n data.relationList = data.relationList || [];\n data.relationList = data.relationList.filter((item) => !item['_delete']);\n\n data.relationList.forEach((item) => {\n item.children = item.children || [];\n item.children = item.children.filter((item) => !item['_delete']);\n\n item.children.forEach((innerItem) => {\n filterSurplusData(innerItem);\n });\n });\n\n data.relationList = data.relationList.filter((item) => {\n if (!item.customData && !item.children) {\n return false;\n }\n if (!item.customData && (!item.children || item.children.length === 0)) {\n return false;\n }\n return true;\n });\n};\n","import { classNames } from '@dimjs/utils';\nimport { TPlainObject } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { Empty, Form } from 'antd';\nimport { Fragment, ReactElement, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { Relation } from './compts/relation';\nimport { RelationGroupList } from './compts/relation-group-list';\nimport { RelationItem } from './compts/relation-item';\nimport './style.less';\n\nimport {\n RelationTreeProps,\n TRelationTreeCustomData,\n TRelationTreeData,\n TRelationTreeRelationItem,\n} from './type';\nimport { deleteLoop, filterSurplusData } from './utils';\n\ntype TRelationTreeLoop = {\n dataSource: TRelationTreeData;\n relationItemRender: (data: TRelationTreeCustomData, extraData?: TPlainObject) => ReactElement;\n className?: string;\n relationProps?: RelationTreeProps['relationProps'];\n onTagClick?: RelationTreeProps['onTagClick'];\n};\n\ntype RelationItemRenderProps = TRelationTreeLoop & {\n relationItem: TRelationTreeRelationItem;\n index: number;\n onlyOne?: boolean;\n};\n\nconst RelationItemRender = (props: RelationItemRenderProps) => {\n const relationItem = props.relationItem;\n const dataSource = props.dataSource;\n const index = props.index;\n\n if (relationItem.customData && relationItem.children && relationItem.children.length > 0) {\n return (\n <Fragment key={relationItem.uid}>\n <RelationItem\n isFirst={index === 0}\n isLast={index === dataSource.relationList.length - 1}\n onlyOne={props.onlyOne}\n >\n {props.relationItemRender(relationItem.customData, relationItem.extraData)}\n </RelationItem>\n <RelationGroupList>\n {relationItem.children?.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n className={props.className}\n />\n );\n })}\n </RelationGroupList>\n </Fragment>\n );\n }\n if (relationItem.children && relationItem.children.length > 0) {\n return (\n <div\n className={classNames('form-list-no-main-group', { 'form-list-no-main-group': index === 0 })}\n key={relationItem.uid}\n >\n {relationItem.children?.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n className={classNames('form-list-no-main', {\n 'form-list-no-main-first': index === 0,\n 'form-list-no-main-last': index === dataSource.relationList.length - 1,\n })}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n />\n );\n })}\n </div>\n );\n }\n if (relationItem.customData) {\n return (\n <RelationItem\n key={relationItem.uid}\n isFirst={index === 0}\n isLast={index === dataSource.relationList.length - 1}\n onlyOne={props.onlyOne}\n >\n <Form component={false}>\n {props.relationItemRender(relationItem.customData, relationItem.extraData)}\n </Form>\n </RelationItem>\n );\n }\n return null;\n};\n\nconst RelationTreeLoop = (props: TRelationTreeLoop) => {\n const dataSource = props.dataSource;\n const relationList = dataSource.relationList || [];\n\n const lastRelationItem = relationList[relationList.length - 1];\n const hasSolt2 =\n relationList.length > 0 &&\n lastRelationItem.customData &&\n lastRelationItem.children &&\n lastRelationItem.children.length > 0;\n const onlyOne = relationList.length == 1;\n // const onlyNoMainOne =\n // onlyOne && !relationList[0].customData && toArray(relationList[0].children).length === 1;\n return (\n <Relation\n {...props.relationProps}\n tagName={dataSource.tagName}\n key={dataSource.uid}\n onlyOne={onlyOne}\n label={dataSource.label}\n className={props.className}\n onTagClick={() => {\n props.onTagClick?.(dataSource.uid, dataSource.extraData);\n }}\n solt1={() => {\n return (\n <Fragment>\n {relationList.map((relationItem, index) => {\n const flat = hasSolt2 && index === relationList.length - 1;\n return (\n <RelationItemRender\n key={index}\n dataSource={props.dataSource}\n relationItemRender={props.relationItemRender}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n relationItem={\n flat\n ? {\n ...relationItem,\n children: undefined,\n }\n : relationItem\n }\n index={index}\n onlyOne={onlyOne}\n />\n );\n })}\n </Fragment>\n );\n }}\n solt2={() => {\n // 渲染最后一个relation item的children list数据\n if (hasSolt2 && lastRelationItem.children && lastRelationItem.children.length > 0) {\n return (\n <RelationGroupList key={lastRelationItem.uid}>\n {lastRelationItem.children.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n />\n );\n })}\n </RelationGroupList>\n );\n }\n return null;\n }}\n ></Relation>\n );\n};\n\nexport const RelationTree = (props: RelationTreeProps) => {\n const [dataSource, setDataSource] = useState<TRelationTreeData>();\n\n fbaHooks.useEffectCustom(() => {\n setDataSource(props.dataSource);\n }, [props.dataSource]);\n\n const onRelationItemContentChange = hooks.useCallbackRef((data: TRelationTreeCustomData, name, value) => {\n if (data) {\n data[name] = value;\n props.onChange?.({ ...dataSource } as TRelationTreeData);\n }\n });\n\n const getTargetRelationList = (relationTreeList: TRelationTreeData[], uid: string) => {\n for (let index = 0; index < relationTreeList.length; index++) {\n const relationTree = relationTreeList[index];\n for (let innerIndex = 0; innerIndex < relationTree.relationList.length; innerIndex++) {\n const element = relationTree.relationList[innerIndex];\n if (element.customData?.uid === uid) {\n return {\n relationTree,\n index: innerIndex,\n element: element,\n };\n } else if (element.children) {\n const result = getTargetRelationList(element.children, uid);\n if (result) {\n return result;\n }\n }\n }\n }\n return null;\n };\n\n const onAdd = hooks.useCallbackRef(\n (data: TRelationTreeCustomData, initialData: TRelationTreeRelationItem) => {\n if (!dataSource) return;\n const result = getTargetRelationList([dataSource], data.uid);\n if (result.relationTree?.relationList) {\n result.relationTree?.relationList.splice((result.index as number) + 1, 0, initialData);\n props.onChange?.(dataSource);\n }\n },\n );\n const addChildren = hooks.useCallbackRef(\n (data: TRelationTreeCustomData, initialData: TRelationTreeData) => {\n if (!dataSource) return;\n const result = getTargetRelationList([dataSource], data.uid);\n if (result.element) {\n result.element.children = (result.element.children || []).concat(initialData);\n props.onChange?.(dataSource);\n }\n },\n );\n\n const onRemove = hooks.useCallbackRef((uid: string) => {\n if (!dataSource) return;\n deleteLoop(dataSource, uid);\n if (dataSource['_delete']) {\n props.onChange?.(undefined);\n } else {\n filterSurplusData(dataSource);\n props.onChange?.(dataSource);\n }\n });\n\n if (!dataSource) return <Empty description=\"暂无数据\"></Empty>;\n\n return (\n <div className={classNames('relation-tree', props.className)}>\n <RelationTreeLoop\n dataSource={dataSource}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n relationItemRender={(data, extraData) => {\n return props.children(\n data,\n {\n add: onAdd,\n addChildren: addChildren,\n remove: onRemove,\n onChange: onRelationItemContentChange.bind(null, data),\n },\n extraData,\n );\n }}\n />\n </div>\n );\n};\n"],"names":["Relation","props","_props$onTagClick","style","tagLineWidth","indentWidth","tagWidth","lineColor","className","_classNames","onlyOne","solt1","solt2","_jsxs","children","_jsx","label","tagName","Tag","color","tagColor","onClick","onTagClick","bind","RelationGroupList","RelationItem","isFirst","isLast","deleteLoop","data","uid","_data$relationList","relationList","forEach","item","_item$customData","_item$children","customData","length","innerItem","filterSurplusData","filter","RelationItemRender","relationItem","dataSource","index","_relationItem$childre","Fragment","relationItemRender","extraData","map","RelationTreeLoop","relationProps","_relationItem$childre2","Form","component","lastRelationItem","hasSolt2","_createElement","_extends","key","flat","undefined","RelationTree","_useState","useState","setDataSource","fbaHooks","useEffectCustom","onRelationItemContentChange","_hooks","useCallbackRef","name","value","onChange","getTargetRelationList","relationTreeList","relationTree","innerIndex","_element$customData","element","result","onAdd","initialData","_result$relationTree","_result$relationTree2","splice","addChildren","concat","onRemove","Empty","description","add","remove"],"mappings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import{hooks as e}from"@wove/react/cjs/hooks";import{a as n}from"./_rollupPluginBabelHelpers-1f4d8910.js";import{classNames as i}from"@dimjs/utils/cjs/class-names";import{Tag as r,Empty as t,Form as l}from"antd";import{useState as a,createElement as o,Fragment as c}from"react";import{fbaHooks as d}from"./fba-hooks/index.js";import{jsxs as s,jsx as u}from"react/jsx-runtime";var m=function e(n){var t;var l={"--relation-tagline-width":(n.tagLineWidth||40)+"px","--relation-group-indent-width":(n.indentWidth||80)+"px","--relation-tag-width":(n.tagWidth||26)+"px","--relation-line-color":""+(n.lineColor||"#fda148")};var a=i("relation-list",{"relation-list-only-one":n.onlyOne,"relation-list-only-no-main-one":n.onlyOne},n.className);var o=n.solt1,c=n.solt2;return s("div",{className:a,style:l,children:[o?s("div",{className:"relation-list-solt1",children:[u("div",{className:"relation-list-line"}),u("div",{className:"relation-list-label",children:n.label}),n.tagName?u(r,{className:"relation-item-tag",color:n.tagColor||"#fecd96",onClick:(t=n.onTagClick)==null?void 0:t.bind(null,n.tagName),children:n.tagName}):null,o()]}):null,c?u("div",{className:"relation-list-solt2",children:c()}):null]})};var f=function e(n){return u("div",{className:i("relation-group-list",n.className),children:n.children})};var h=function e(n){var r=i("relation-item",{"relation-item-line":true,"relation-item-first":n.isFirst,"relation-item-last":n.isLast,"relation-item-only-one":n.onlyOne});return u("div",{className:r,style:n.style,children:n.children})};var v=function e(n,i){var r;if(n.uid===i){n["_delete"]=true}n==null?void 0:(r=n.relationList)==null?void 0:r.forEach((function(r){var t,l;if(r.uid===i||((t=r.customData)==null?void 0:t.uid)===i){r["_delete"]=true;if(n.relationList.length===1){n["_delete"]=true}}(l=r.children)==null?void 0:l.forEach((function(n){e(n,i)}))}))};var g=function e(n){n.relationList=n.relationList||[];n.relationList=n.relationList.filter((function(e){return!e["_delete"]}));n.relationList.forEach((function(n){n.children=n.children||[];n.children=n.children.filter((function(e){return!e["_delete"]}));n.children.forEach((function(n){e(n)}))}));n.relationList=n.relationList.filter((function(e){if(!e.customData&&!e.children){return false}if(!e.customData&&(!e.children||e.children.length===0)){return false}return true}))};var p=function e(n){var r=n.relationItem;var t=n.dataSource;var a=n.index;if(r.customData&&r.children&&r.children.length>0){var o;return s(c,{children:[u(h,{isFirst:a===0,isLast:a===t.relationList.length-1,onlyOne:n.onlyOne,children:n.relationItemRender(r.customData,r.extraData)}),u(f,{children:(o=r.children)==null?void 0:o.map((function(e){return u(C,{dataSource:e,relationItemRender:n.relationItemRender,relationProps:n.relationProps,onTagClick:n.onTagClick,className:n.className},e.uid)}))})]},r.uid)}if(r.children&&r.children.length>0){var d;return u("div",{className:i("form-list-no-main-group",{"form-list-no-main-group":a===0}),children:(d=r.children)==null?void 0:d.map((function(e){return u(C,{dataSource:e,relationItemRender:n.relationItemRender,className:i("form-list-no-main",{"form-list-no-main-first":a===0,"form-list-no-main-last":a===t.relationList.length-1}),relationProps:n.relationProps,onTagClick:n.onTagClick},e.uid)}))},r.uid)}if(r.customData){return u(h,{isFirst:a===0,isLast:a===t.relationList.length-1,onlyOne:n.onlyOne,children:u(l,{component:false,children:n.relationItemRender(r.customData,r.extraData)})},r.uid)}return null};var C=function e(i){var r=i.dataSource;var t=r.relationList||[];var l=t[t.length-1];var a=t.length>0&&l.customData&&l.children&&l.children.length>0;var d=t.length==1;return o(m,n({},i.relationProps,{tagName:r.tagName,key:r.uid,onlyOne:d,label:r.label,className:i.className,onTagClick:function e(){i.onTagClick==null?void 0:i.onTagClick(r.uid,r.extraData)},solt1:function e(){return u(c,{children:t.map((function(e,r){var l=a&&r===t.length-1;return u(p,{dataSource:i.dataSource,relationItemRender:i.relationItemRender,relationProps:i.relationProps,onTagClick:i.onTagClick,relationItem:l?n({},e,{children:undefined}):e,index:r,onlyOne:d},r)}))})},solt2:function n(){if(a&&l.children&&l.children.length>0){return u(f,{children:l.children.map((function(n){return u(e,{dataSource:n,relationItemRender:i.relationItemRender,relationProps:i.relationProps,onTagClick:i.onTagClick},n.uid)}))},l.uid)}return null}}))};var N=function r(l){var o=a(),c=o[0],s=o[1];d.useEffectCustom((function(){s(l.dataSource)}),[l.dataSource]);var m=e.useCallbackRef((function(e,i,r){if(e){e[i]=r;l.onChange==null?void 0:l.onChange(n({},c))}}));var f=function e(n,i){for(var r=0;r<n.length;r++){var t=n[r];for(var l=0;l<t.relationList.length;l++){var a;var o=t.relationList[l];if(((a=o.customData)==null?void 0:a.uid)===i){return{relationTree:t,index:l,element:o}}else if(o.children){var c=e(o.children,i);if(c){return c}}}}return null};var h=e.useCallbackRef((function(e,n){var i;if(!c)return;var r=f([c],e.uid);if((i=r.relationTree)!=null&&i.relationList){var t;(t=r.relationTree)==null?void 0:t.relationList.splice(r.index+1,0,n);l.onChange==null?void 0:l.onChange(c)}}));var p=e.useCallbackRef((function(e,n){if(!c)return;var i=f([c],e.uid);if(i.element){i.element.children=(i.element.children||[]).concat(n);l.onChange==null?void 0:l.onChange(c)}}));var N=e.useCallbackRef((function(e){if(!c)return;v(c,e);if(c["_delete"]){l.onChange==null?void 0:l.onChange(undefined)}else{g(c);l.onChange==null?void 0:l.onChange(c)}}));if(!c)return u(t,{description:"暂无数据"});return u("div",{className:i("relation-tree",l.className),children:u(C,{dataSource:c,relationProps:l.relationProps,onTagClick:l.onTagClick,relationItemRender:function e(n,i){return l.children(n,{add:h,addChildren:p,remove:N,onChange:m.bind(null,n)},i)}})})};export{N as R};
|
|
3
|
+
//# sourceMappingURL=relation-tree-7bec12bd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation-tree-7bec12bd.js","sources":["@flatbiz/antd/src/relation-tree/compts/relation.tsx","@flatbiz/antd/src/relation-tree/compts/relation-group-list.tsx","@flatbiz/antd/src/relation-tree/compts/relation-item.tsx","@flatbiz/antd/src/relation-tree/utils.ts","@flatbiz/antd/src/relation-tree/relation-tree.tsx"],"sourcesContent":["import { classNames } from '@dimjs/utils';\nimport { Tag } from 'antd';\nimport { CSSProperties } from 'react';\nimport { RelationProps } from '../type';\n\nexport const Relation = (props: RelationProps) => {\n const style = {\n '--relation-tagline-width': `${props.tagLineWidth || 40}px`,\n '--relation-group-indent-width': `${props.indentWidth || 80}px`,\n '--relation-tag-width': `${props.tagWidth || 26}px`,\n '--relation-line-color': `${props.lineColor || '#fda148'}`,\n } as CSSProperties;\n\n const className = classNames(\n 'relation-list',\n { 'relation-list-only-one': props.onlyOne, 'relation-list-only-no-main-one': props.onlyOne },\n props.className,\n );\n const { solt1, solt2 } = props;\n\n return (\n <div className={className} style={style}>\n {solt1 ? (\n <div className=\"relation-list-solt1\">\n <div className=\"relation-list-line\"></div>\n <div className=\"relation-list-label\">{props.label}</div>\n\n {props.tagName ? (\n <Tag\n className=\"relation-item-tag\"\n color={props.tagColor || '#fecd96'}\n onClick={props.onTagClick?.bind(null, props.tagName)}\n >\n {props.tagName}\n </Tag>\n ) : null}\n {solt1()}\n </div>\n ) : null}\n {solt2 ? <div className=\"relation-list-solt2\">{solt2()}</div> : null}\n </div>\n );\n};\n","import { classNames } from '@dimjs/utils';\nimport { ReactElement } from 'react';\n\nexport type RelationGroupListProps = {\n children: ReactElement | ReactElement[] | null;\n className?: string;\n};\n\nexport const RelationGroupList = (props: RelationGroupListProps) => {\n return <div className={classNames('relation-group-list', props.className)}>{props.children}</div>;\n};\n","import { classNames } from '@dimjs/utils';\nimport { CSSProperties, ReactElement } from 'react';\n\nexport type RelationItemProps = {\n children: ReactElement | null | Array<ReactElement | null>;\n className?: string;\n style?: CSSProperties;\n isFirst?: boolean;\n isLast?: boolean;\n onlyOne?: boolean;\n};\n\nexport const RelationItem = (props: RelationItemProps) => {\n const className = classNames('relation-item', {\n 'relation-item-line': true,\n 'relation-item-first': props.isFirst,\n 'relation-item-last': props.isLast,\n 'relation-item-only-one': props.onlyOne,\n });\n\n return (\n <div className={className} style={props.style}>\n {props.children}\n </div>\n );\n};\n","import { TRelationTreeData } from './type';\n\nexport const deleteLoop = (data: TRelationTreeData, uid: string) => {\n if (data.uid === uid) {\n data['_delete'] = true;\n }\n data?.relationList?.forEach((item) => {\n if (item.uid === uid || item.customData?.uid === uid) {\n item['_delete'] = true;\n if (data.relationList.length === 1) {\n data['_delete'] = true;\n }\n }\n\n item.children?.forEach((innerItem) => {\n deleteLoop(innerItem, uid);\n });\n });\n};\n\nexport const filterSurplusData = (data: TRelationTreeData) => {\n data.relationList = data.relationList || [];\n data.relationList = data.relationList.filter((item) => !item['_delete']);\n\n data.relationList.forEach((item) => {\n item.children = item.children || [];\n item.children = item.children.filter((item) => !item['_delete']);\n\n item.children.forEach((innerItem) => {\n filterSurplusData(innerItem);\n });\n });\n\n data.relationList = data.relationList.filter((item) => {\n if (!item.customData && !item.children) {\n return false;\n }\n if (!item.customData && (!item.children || item.children.length === 0)) {\n return false;\n }\n return true;\n });\n};\n","import { classNames } from '@dimjs/utils';\nimport { TPlainObject } from '@flatbiz/utils';\nimport { hooks } from '@wove/react';\nimport { Empty, Form } from 'antd';\nimport { Fragment, ReactElement, useState } from 'react';\nimport { fbaHooks } from '../fba-hooks';\nimport { Relation } from './compts/relation';\nimport { RelationGroupList } from './compts/relation-group-list';\nimport { RelationItem } from './compts/relation-item';\nimport './style.less';\n\nimport {\n RelationTreeProps,\n TRelationTreeCustomData,\n TRelationTreeData,\n TRelationTreeRelationItem,\n} from './type';\nimport { deleteLoop, filterSurplusData } from './utils';\n\ntype TRelationTreeLoop = {\n dataSource: TRelationTreeData;\n relationItemRender: (data: TRelationTreeCustomData, extraData?: TPlainObject) => ReactElement;\n className?: string;\n relationProps?: RelationTreeProps['relationProps'];\n onTagClick?: RelationTreeProps['onTagClick'];\n};\n\ntype RelationItemRenderProps = TRelationTreeLoop & {\n relationItem: TRelationTreeRelationItem;\n index: number;\n onlyOne?: boolean;\n};\n\nconst RelationItemRender = (props: RelationItemRenderProps) => {\n const relationItem = props.relationItem;\n const dataSource = props.dataSource;\n const index = props.index;\n\n if (relationItem.customData && relationItem.children && relationItem.children.length > 0) {\n return (\n <Fragment key={relationItem.uid}>\n <RelationItem\n isFirst={index === 0}\n isLast={index === dataSource.relationList.length - 1}\n onlyOne={props.onlyOne}\n >\n {props.relationItemRender(relationItem.customData, relationItem.extraData)}\n </RelationItem>\n <RelationGroupList>\n {relationItem.children?.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n className={props.className}\n />\n );\n })}\n </RelationGroupList>\n </Fragment>\n );\n }\n if (relationItem.children && relationItem.children.length > 0) {\n return (\n <div\n className={classNames('form-list-no-main-group', { 'form-list-no-main-group': index === 0 })}\n key={relationItem.uid}\n >\n {relationItem.children?.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n className={classNames('form-list-no-main', {\n 'form-list-no-main-first': index === 0,\n 'form-list-no-main-last': index === dataSource.relationList.length - 1,\n })}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n />\n );\n })}\n </div>\n );\n }\n if (relationItem.customData) {\n return (\n <RelationItem\n key={relationItem.uid}\n isFirst={index === 0}\n isLast={index === dataSource.relationList.length - 1}\n onlyOne={props.onlyOne}\n >\n <Form component={false}>\n {props.relationItemRender(relationItem.customData, relationItem.extraData)}\n </Form>\n </RelationItem>\n );\n }\n return null;\n};\n\nconst RelationTreeLoop = (props: TRelationTreeLoop) => {\n const dataSource = props.dataSource;\n const relationList = dataSource.relationList || [];\n\n const lastRelationItem = relationList[relationList.length - 1];\n const hasSolt2 =\n relationList.length > 0 &&\n lastRelationItem.customData &&\n lastRelationItem.children &&\n lastRelationItem.children.length > 0;\n const onlyOne = relationList.length == 1;\n // const onlyNoMainOne =\n // onlyOne && !relationList[0].customData && toArray(relationList[0].children).length === 1;\n return (\n <Relation\n {...props.relationProps}\n tagName={dataSource.tagName}\n key={dataSource.uid}\n onlyOne={onlyOne}\n label={dataSource.label}\n className={props.className}\n onTagClick={() => {\n props.onTagClick?.(dataSource.uid, dataSource.extraData);\n }}\n solt1={() => {\n return (\n <Fragment>\n {relationList.map((relationItem, index) => {\n const flat = hasSolt2 && index === relationList.length - 1;\n return (\n <RelationItemRender\n key={index}\n dataSource={props.dataSource}\n relationItemRender={props.relationItemRender}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n relationItem={\n flat\n ? {\n ...relationItem,\n children: undefined,\n }\n : relationItem\n }\n index={index}\n onlyOne={onlyOne}\n />\n );\n })}\n </Fragment>\n );\n }}\n solt2={() => {\n // 渲染最后一个relation item的children list数据\n if (hasSolt2 && lastRelationItem.children && lastRelationItem.children.length > 0) {\n return (\n <RelationGroupList key={lastRelationItem.uid}>\n {lastRelationItem.children.map((innerItem) => {\n return (\n <RelationTreeLoop\n dataSource={innerItem}\n relationItemRender={props.relationItemRender}\n key={innerItem.uid}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n />\n );\n })}\n </RelationGroupList>\n );\n }\n return null;\n }}\n ></Relation>\n );\n};\n\nexport const RelationTree = (props: RelationTreeProps) => {\n const [dataSource, setDataSource] = useState<TRelationTreeData>();\n\n fbaHooks.useEffectCustom(() => {\n setDataSource(props.dataSource);\n }, [props.dataSource]);\n\n const onRelationItemContentChange = hooks.useCallbackRef((data: TRelationTreeCustomData, name, value) => {\n if (data) {\n data[name] = value;\n props.onChange?.({ ...dataSource } as TRelationTreeData);\n }\n });\n\n const getTargetRelationList = (relationTreeList: TRelationTreeData[], uid: string) => {\n for (let index = 0; index < relationTreeList.length; index++) {\n const relationTree = relationTreeList[index];\n for (let innerIndex = 0; innerIndex < relationTree.relationList.length; innerIndex++) {\n const element = relationTree.relationList[innerIndex];\n if (element.customData?.uid === uid) {\n return {\n relationTree,\n index: innerIndex,\n element: element,\n };\n } else if (element.children) {\n const result = getTargetRelationList(element.children, uid);\n if (result) {\n return result;\n }\n }\n }\n }\n return null;\n };\n\n const onAdd = hooks.useCallbackRef(\n (data: TRelationTreeCustomData, initialData: TRelationTreeRelationItem) => {\n if (!dataSource) return;\n const result = getTargetRelationList([dataSource], data.uid);\n if (result.relationTree?.relationList) {\n result.relationTree?.relationList.splice((result.index as number) + 1, 0, initialData);\n props.onChange?.(dataSource);\n }\n },\n );\n const addChildren = hooks.useCallbackRef(\n (data: TRelationTreeCustomData, initialData: TRelationTreeData) => {\n if (!dataSource) return;\n const result = getTargetRelationList([dataSource], data.uid);\n if (result.element) {\n result.element.children = (result.element.children || []).concat(initialData);\n props.onChange?.(dataSource);\n }\n },\n );\n\n const onRemove = hooks.useCallbackRef((uid: string) => {\n if (!dataSource) return;\n deleteLoop(dataSource, uid);\n if (dataSource['_delete']) {\n props.onChange?.(undefined);\n } else {\n filterSurplusData(dataSource);\n props.onChange?.(dataSource);\n }\n });\n\n if (!dataSource) return <Empty description=\"暂无数据\"></Empty>;\n\n return (\n <div className={classNames('relation-tree', props.className)}>\n <RelationTreeLoop\n dataSource={dataSource}\n relationProps={props.relationProps}\n onTagClick={props.onTagClick}\n relationItemRender={(data, extraData) => {\n return props.children(\n data,\n {\n add: onAdd,\n addChildren: addChildren,\n remove: onRemove,\n onChange: onRelationItemContentChange.bind(null, data),\n },\n extraData,\n );\n }}\n />\n </div>\n );\n};\n"],"names":["Relation","props","_props$onTagClick","style","tagLineWidth","indentWidth","tagWidth","lineColor","className","_classNames","onlyOne","solt1","solt2","_jsxs","children","_jsx","label","tagName","Tag","color","tagColor","onClick","onTagClick","bind","RelationGroupList","RelationItem","isFirst","isLast","deleteLoop","data","uid","_data$relationList","relationList","forEach","item","_item$customData","_item$children","customData","length","innerItem","filterSurplusData","filter","RelationItemRender","relationItem","dataSource","index","_relationItem$childre","Fragment","relationItemRender","extraData","map","RelationTreeLoop","relationProps","_relationItem$childre2","Form","component","lastRelationItem","hasSolt2","_createElement","_extends","key","flat","undefined","RelationTree","_useState","useState","setDataSource","fbaHooks","useEffectCustom","onRelationItemContentChange","_hooks","useCallbackRef","name","value","onChange","getTargetRelationList","relationTreeList","relationTree","innerIndex","_element$customData","element","result","onAdd","initialData","_result$relationTree","_result$relationTree2","splice","addChildren","concat","onRemove","Empty","description","add","remove"],"mappings":";wXAKO,IAAMA,EAAW,SAAXA,EAAYC,GAAyB,IAAAC,EAChD,IAAMC,EAAQ,CACZ,4BAA+BF,EAAMG,cAAgB,IAAM,KAC3D,iCAAoCH,EAAMI,aAAe,IAAM,KAC/D,wBAA2BJ,EAAMK,UAAY,IAAM,KACnD,wBAA4BL,IAAAA,EAAMM,WAAa,YAGjD,IAAMC,EAAYC,EAChB,gBACA,CAAE,yBAA0BR,EAAMS,QAAS,iCAAkCT,EAAMS,SACnFT,EAAMO,WAER,IAAQG,EAAiBV,EAAjBU,MAAOC,EAAUX,EAAVW,MAEf,OACEC,EAAA,MAAA,CAAKL,UAAWA,EAAWL,MAAOA,EAAMW,SAAA,CACrCH,EACCE,EAAA,MAAA,CAAKL,UAAU,sBAAqBM,UAClCC,EAAA,MAAA,CAAKP,UAAU,uBACfO,EAAA,MAAA,CAAKP,UAAU,sBAAqBM,SAAEb,EAAMe,QAE3Cf,EAAMgB,QACLF,EAACG,EAAG,CACFV,UAAU,oBACVW,MAAOlB,EAAMmB,UAAY,UACzBC,SAAOnB,EAAED,EAAMqB,aAANpB,UAAAA,EAAAA,EAAkBqB,KAAK,KAAMtB,EAAMgB,SAASH,SAEpDb,EAAMgB,UAEP,KACHN,OAED,KACHC,EAAQG,EAAA,MAAA,CAAKP,UAAU,sBAAqBM,SAAEF,MAAiB,OAGtE,EClCO,IAAMY,EAAoB,SAApBA,EAAqBvB,GAChC,OAAOc,EAAA,MAAA,CAAKP,UAAWC,EAAW,sBAAuBR,EAAMO,WAAWM,SAAEb,EAAMa,UACpF,ECEO,IAAMW,EAAe,SAAfA,EAAgBxB,GAC3B,IAAMO,EAAYC,EAAW,gBAAiB,CAC5C,qBAAsB,KACtB,sBAAuBR,EAAMyB,QAC7B,qBAAsBzB,EAAM0B,OAC5B,yBAA0B1B,EAAMS,UAGlC,OACEK,EAAA,MAAA,CA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/index.css';
|
|
6
6
|
import './index.css';
|
|
7
7
|
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
8
|
-
|
|
8
|
+
export{R as RichTextViewer}from"../rich-text-viewer-5cbe01e9.js";import"@ant-design/icons/es/icons/FullscreenOutlined";import"@dimjs/utils/cjs/class-names";import"@wove/react/cjs/hooks";import"ahooks";import"react";import"../fba-hooks/index.js";import"../_rollupPluginBabelHelpers-1f4d8910.js";import"@dimjs/lang/cjs/is-array";import"../use-responsive-point-21b8c601.js";import"antd";import"../icon-wrapper-ed5fcacc.js";import"react/jsx-runtime";import"../rich-text-editor-c8bac6d2.js";import"@tinymce/tinymce-react";import"@ant-design/icons/es/icons/PlusCircleOutlined";import"../dynamic-node-c7864af4.js";import"react-dom/client";import"../dom-4d04aa64.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! @flatjs/forge MIT @flatbiz/antd */
|
|
2
|
+
import e from"@ant-design/icons/es/icons/FullscreenOutlined";import{classNames as r}from"@dimjs/utils/cjs/class-names";import{hooks as i}from"@wove/react/cjs/hooks";import{useKeyPress as o}from"ahooks";import{useState as s,useRef as t}from"react";import{fbaHooks as n}from"./fba-hooks/index.js";import{I as a}from"./icon-wrapper-ed5fcacc.js";import{R as l}from"./rich-text-editor-c8bac6d2.js";import{jsxs as c,jsx as u}from"react/jsx-runtime";var f=function f(m){var d=s(false),v=d[0],p=d[1];var b=t();o((function(){return true}),(function(e){if(e.type==="keyup"&&e.key==="Escape"&&v){p(false)}}),{events:["keydown","keyup"]});var k=i.useCallbackRef((function(){p(!v)}));var h=i.useCallbackRef((function(e,r){b.current=r;m.onInit==null?void 0:m.onInit(r)}));n.useEffectCustom((function(){var e;(e=b.current)==null?void 0:e.editorCommands.execCommand("mceAutoResize")}),[m.value]);return c("div",{className:r("fba-editor-viewer",{"fba-editor-viewer-fixed":v},m.className),style:m.style,children:[m.children,m.fullscreen&&m.value&&u("div",{className:"fba-editor-viewer-icon",children:u(a,{hoverTips:m.fullscreenIconTips,icon:u(e,{}),onClick:k})}),u(l,{value:'<div style="overflow: hidden">'+m.value+"</div>",onInit:h,imgPreview:true,disabled:true,init:{plugins:"autoresize",menubar:false,toolbar:"",statusbar:false}})]})};export{f as R};
|
|
3
|
+
//# sourceMappingURL=rich-text-viewer-5cbe01e9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rich-text-viewer-5cbe01e9.js","sources":["@flatbiz/antd/src/rich-text-viewer/rich-text-viewer.tsx"],"sourcesContent":["import { FullscreenOutlined } from '@ant-design/icons';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { useKeyPress } from 'ahooks';\nimport { CSSProperties, ReactElement, useRef, useState } from 'react';\nimport { Editor as TinyMCEEditor } from 'tinymce';\n\nimport { fbaHooks } from '../fba-hooks';\nimport { IconWrapper } from '../icon-wrapper';\nimport { RichTextEditor } from '../rich-text-editor';\nimport './style.less';\n\ntype RichTextViewerProps = {\n value: string;\n className?: string;\n style?: CSSProperties;\n fullscreen?: boolean;\n onInit?: (editor: TinyMCEEditor) => void;\n children?: ReactElement;\n fullscreenIconTips?: string;\n};\n\n/**\n * 预览 RichTextEditor 生成的富文本数据\n * ```\n * 1. 通过 onInit 属性可获取实例:editor\n * 2. 如果高度发生变更,可执行 editor.execCommand('mceAutoResize');\n *\n * ```\n * @param props\n * @returns\n */\nexport const RichTextViewer = (props: RichTextViewerProps) => {\n const [isFixed, setIsFixed] = useState(false);\n const editorRef = useRef<TinyMCEEditor>();\n\n useKeyPress(\n () => true,\n (event) => {\n if (event.type === 'keyup' && event.key === 'Escape' && isFixed) {\n setIsFixed(false);\n }\n },\n { events: ['keydown', 'keyup'] },\n );\n\n const onChangeFixed = hooks.useCallbackRef(() => {\n setIsFixed(!isFixed);\n });\n const onInit = hooks.useCallbackRef((_, editor: TinyMCEEditor) => {\n editorRef.current = editor;\n props.onInit?.(editor);\n });\n\n fbaHooks.useEffectCustom(() => {\n editorRef.current?.editorCommands.execCommand('mceAutoResize');\n }, [props.value]);\n\n return (\n <div\n className={classNames('fba-editor-viewer', { 'fba-editor-viewer-fixed': isFixed }, props.className)}\n style={props.style}\n >\n {props.children}\n {props.fullscreen && props.value && (\n <div className=\"fba-editor-viewer-icon\">\n <IconWrapper\n hoverTips={props.fullscreenIconTips}\n icon={<FullscreenOutlined />}\n onClick={onChangeFixed}\n />\n </div>\n )}\n <RichTextEditor\n value={`<div style=\"overflow: hidden\">${props.value}</div>`}\n onInit={onInit}\n imgPreview\n disabled\n init={{\n plugins: 'autoresize',\n menubar: false,\n toolbar: '',\n statusbar: false,\n }}\n />\n </div>\n );\n};\n"],"names":["RichTextViewer","props","_useState","useState","isFixed","setIsFixed","editorRef","useRef","useKeyPress","event","type","key","events","onChangeFixed","_hooks","useCallbackRef","onInit","_","editor","current","fbaHooks","useEffectCustom","_editorRef$current","editorCommands","execCommand","value","_jsxs","className","_classNames","style","children","fullscreen","_jsx","IconWrapper","hoverTips","fullscreenIconTips","icon","_FullscreenOutlined","onClick","RichTextEditor","imgPreview","disabled","init","plugins","menubar","toolbar","statusbar"],"mappings":";+bAgCaA,EAAiB,SAAjBA,EAAkBC,GAC7B,IAAAC,EAA8BC,EAAS,OAAhCC,EAAOF,EAAA,GAAEG,EAAUH,EAAA,GAC1B,IAAMI,EAAYC,IAElBC,GACE,WAAA,OAAM,IACN,IAAA,SAACC,GACC,GAAIA,EAAMC,OAAS,SAAWD,EAAME,MAAQ,UAAYP,EAAS,CAC/DC,EAAW,MACb,CACF,GACA,CAAEO,OAAQ,CAAC,UAAW,WAGxB,IAAMC,EAAgBC,EAAMC,gBAAe,WACzCV,GAAYD,EACd,IACA,IAAMY,EAASF,EAAMC,gBAAe,SAACE,EAAGC,GACtCZ,EAAUa,QAAUD,EACpBjB,EAAMe,QAANf,UAAAA,EAAAA,EAAMe,OAASE,EACjB,IAEAE,EAASC,iBAAgB,WAAM,IAAAC,GAC7BA,EAAAhB,EAAUa,UAAO,UAAA,EAAjBG,EAAmBC,eAAeC,YAAY,gBAChD,GAAG,CAACvB,EAAMwB,QAEV,OACEC,EAAA,MAAA,CACEC,UAAWC,EAAW,oBAAqB,CAAE,0BAA2BxB,GAAWH,EAAM0B,WACzFE,MAAO5B,EAAM4B,MAAMC,SAElB7B,CAAAA,EAAM6B,SACN7B,EAAM8B,YAAc9B,EAAMwB,OACzBO,EAAA,MAAA,CAAKL,UAAU,yBAAwBG,SACrCE,EAACC,EAAW,CACVC,UAAWjC,EAAMkC,mBACjBC,KAAMJ,EAAAK,EAAuB,IAC7BC,QAASzB,MAIfmB,EAACO,EAAc,CACbd,MAAwCxB,iCAAAA,EAAMwB,MAAc,SAC5DT,OAAQA,EACRwB,WAAU,KACVC,SAAQ,KACRC,KAAM,CACJC,QAAS,aACTC,QAAS,MACTC,QAAS,GACTC,UAAW,WAKrB"}
|