@erxes/ui 4.0.0-v2.2 → 4.0.0-v2.20
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/AGENTS.md +63 -0
- package/CATALOG.md +276 -0
- package/README.md +20 -0
- package/dist/components/accordion.d.ts +1 -0
- package/dist/components/accordion.js +1 -0
- package/dist/components/alert-dialog.d.ts +4 -0
- package/dist/components/alert-dialog.js +4 -0
- package/dist/components/alert.d.ts +1 -0
- package/dist/components/alert.js +1 -0
- package/dist/components/avatar.d.ts +2 -0
- package/dist/components/avatar.js +1 -0
- package/dist/components/background-gradient-animation.d.ts +4 -1
- package/dist/components/background-gradient-animation.js +4 -1
- package/dist/components/badge.d.ts +3 -0
- package/dist/components/badge.js +2 -0
- package/dist/components/breadcrumb.d.ts +1 -0
- package/dist/components/breadcrumb.js +1 -0
- package/dist/components/button.d.ts +6 -1
- package/dist/components/button.js +5 -1
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +4 -0
- package/dist/components/card.d.ts +1 -0
- package/dist/components/card.js +1 -0
- package/dist/components/chart-config.d.ts +4 -1
- package/dist/components/charts.d.ts +8 -1
- package/dist/components/charts.js +16 -6
- package/dist/components/checkbox.d.ts +1 -0
- package/dist/components/checkbox.js +1 -0
- package/dist/components/choicebox-group.d.ts +1 -0
- package/dist/components/choicebox-group.js +1 -0
- package/dist/components/collapsible.d.ts +1 -0
- package/dist/components/collapsible.js +1 -0
- package/dist/components/color-picker.d.ts +1 -0
- package/dist/components/color-picker.js +15 -8
- package/dist/components/combobox.d.ts +6 -1
- package/dist/components/combobox.js +13 -2
- package/dist/components/command-bar.d.ts +4 -0
- package/dist/components/command-bar.js +7 -0
- package/dist/components/command.d.ts +4 -0
- package/dist/components/command.js +4 -0
- package/dist/components/context-menu.d.ts +1 -0
- package/dist/components/context-menu.js +1 -0
- package/dist/components/copy-text.d.ts +1 -0
- package/dist/components/copy-text.js +1 -0
- package/dist/components/date-picker-value.d.ts +5 -9
- package/dist/components/date-picker-value.js +15 -34
- package/dist/components/date-picker.d.ts +4 -4
- package/dist/components/date-picker.js +9 -7
- package/dist/components/date-text-input.d.ts +2 -4
- package/dist/components/date-text-input.js +11 -9
- package/dist/components/dialog.d.ts +9 -2
- package/dist/components/dialog.js +24 -11
- package/dist/components/drag-handle.d.ts +1 -0
- package/dist/components/drag-handle.js +1 -0
- package/dist/components/dropdown-menu.d.ts +1 -0
- package/dist/components/dropdown-menu.js +1 -0
- package/dist/components/empty.d.ts +6 -1
- package/dist/components/empty.js +25 -2
- package/dist/components/field-control.d.ts +16 -0
- package/dist/components/field-control.js +19 -0
- package/dist/components/form-layout.d.ts +21 -0
- package/dist/components/form-layout.js +57 -0
- package/dist/components/form.d.ts +14 -3
- package/dist/components/form.js +24 -8
- package/dist/components/hover-card.d.ts +1 -0
- package/dist/components/hover-card.js +1 -0
- package/dist/components/icon-tip.d.ts +7 -0
- package/dist/components/icon-tip.js +16 -0
- package/dist/components/info-card.d.ts +4 -0
- package/dist/components/info-card.js +4 -0
- package/dist/components/input-group.d.ts +5 -4
- package/dist/components/input-group.js +6 -5
- package/dist/components/input.d.ts +2 -1
- package/dist/components/input.js +10 -4
- package/dist/components/kbd.d.ts +2 -1
- package/dist/components/kbd.js +2 -1
- package/dist/components/label.d.ts +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/multiselect.d.ts +1 -0
- package/dist/components/multiselect.js +7 -3
- package/dist/components/on-demand.d.ts +15 -2
- package/dist/components/on-demand.js +21 -1
- package/dist/components/popover.d.ts +4 -0
- package/dist/components/popover.js +21 -13
- package/dist/components/radio-group.d.ts +1 -0
- package/dist/components/radio-group.js +1 -0
- package/dist/components/scroll-area.d.ts +1 -0
- package/dist/components/scroll-area.js +1 -0
- package/dist/components/select.d.ts +5 -1
- package/dist/components/select.js +21 -10
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.js +4 -0
- package/dist/components/sheet.d.ts +9 -2
- package/dist/components/sheet.js +23 -10
- package/dist/components/sidebar/panel.js +1 -1
- package/dist/components/sidebar.d.ts +1 -0
- package/dist/components/sidebar.js +1 -0
- package/dist/components/skeleton.d.ts +1 -0
- package/dist/components/skeleton.js +1 -0
- package/dist/components/spinner.d.ts +1 -0
- package/dist/components/spinner.js +1 -0
- package/dist/components/string-array.js +1 -0
- package/dist/components/switch.d.ts +1 -0
- package/dist/components/switch.js +1 -0
- package/dist/components/table.d.ts +4 -0
- package/dist/components/table.js +4 -0
- package/dist/components/tabs.d.ts +8 -1
- package/dist/components/tabs.js +8 -1
- package/dist/components/text-overflow.d.ts +4 -1
- package/dist/components/text-overflow.js +4 -1
- package/dist/components/textarea.d.ts +1 -0
- package/dist/components/textarea.js +5 -1
- package/dist/components/toaster.d.ts +4 -1
- package/dist/components/toaster.js +5 -2
- package/dist/components/toggle-group.d.ts +5 -0
- package/dist/components/toggle-group.js +19 -11
- package/dist/components/toggle.d.ts +1 -0
- package/dist/components/toggle.js +1 -0
- package/dist/components/tooltip.d.ts +4 -0
- package/dist/components/tooltip.js +4 -0
- package/dist/components/upload.d.ts +4 -0
- package/dist/components/upload.js +20 -11
- package/dist/federation.d.ts +4 -0
- package/dist/federation.js +7 -1
- package/dist/hooks/use-focus-first-field.d.ts +8 -0
- package/dist/hooks/use-focus-first-field.js +15 -0
- package/dist/hooks/use-item-keys.d.ts +11 -0
- package/dist/hooks/use-item-keys.js +24 -0
- package/dist/hooks/use-page-hotkey.d.ts +14 -0
- package/dist/hooks/use-page-hotkey.js +24 -0
- package/dist/hooks/use-toast.d.ts +5 -0
- package/dist/hooks/use-toast.js +5 -0
- package/dist/index.d.ts +34 -7
- package/dist/index.js +32 -4
- package/dist/lib/format.d.ts +60 -0
- package/dist/lib/format.js +86 -0
- package/dist/lib/money.d.ts +13 -0
- package/dist/lib/money.js +21 -0
- package/dist/lib/render-in-dom.d.ts +6 -0
- package/dist/lib/render-in-dom.js +26 -0
- package/dist/lib/stored.d.ts +13 -0
- package/dist/lib/stored.js +41 -0
- package/dist/lib/text.d.ts +11 -0
- package/dist/lib/text.js +18 -0
- package/dist/modules/attachments/use-carousel.js +5 -10
- package/dist/modules/blocks/components/BlockEditor.js +2 -2
- package/dist/modules/blocks/components/Editor.d.ts +1 -1
- package/dist/modules/blocks/components/Editor.js +5 -2
- package/dist/modules/blocks/hooks/useBarcodeSizeForm.d.ts +1 -1
- package/dist/modules/blocks/hooks/useBlockEditor.d.ts +3 -0
- package/dist/modules/blocks/hooks/useBlockEditor.js +21 -2
- package/dist/modules/blocks/types/TextEditor.d.ts +3 -1
- package/dist/modules/blocks/utils/parseBlocks.d.ts +1 -1
- package/dist/modules/blocks/utils/parseBlocks.js +1 -1
- package/dist/modules/conditions/ConditionsEditor.d.ts +13 -0
- package/dist/modules/conditions/ConditionsEditor.js +171 -0
- package/dist/modules/conditions/DateEditors.d.ts +8 -0
- package/dist/modules/conditions/DateEditors.js +188 -0
- package/dist/modules/conditions/FieldPicker.d.ts +17 -0
- package/dist/modules/conditions/FieldPicker.js +99 -0
- package/dist/modules/conditions/LazyConditionsEditor.d.ts +10 -0
- package/dist/modules/conditions/LazyConditionsEditor.js +11 -0
- package/dist/modules/conditions/RuleParts.d.ts +30 -0
- package/dist/modules/conditions/RuleParts.js +78 -0
- package/dist/modules/conditions/RuleRow.d.ts +27 -0
- package/dist/modules/conditions/RuleRow.js +156 -0
- package/dist/modules/conditions/TypedInput.d.ts +13 -0
- package/dist/modules/conditions/TypedInput.js +36 -0
- package/dist/modules/conditions/ValueEditor.d.ts +18 -0
- package/dist/modules/conditions/ValueEditor.js +169 -0
- package/dist/modules/conditions/conditions.d.ts +77 -0
- package/dist/modules/conditions/conditions.js +69 -0
- package/dist/modules/conditions/fieldIcons.d.ts +6 -0
- package/dist/modules/conditions/fieldIcons.js +21 -0
- package/dist/modules/conditions/fieldOptions.d.ts +15 -0
- package/dist/modules/conditions/fieldOptions.js +38 -0
- package/dist/modules/conditions/filterRule.d.ts +45 -0
- package/dist/modules/conditions/filterRule.js +171 -0
- package/dist/modules/conditions/filterText.d.ts +16 -0
- package/dist/modules/conditions/filterText.js +156 -0
- package/dist/modules/display/components/EmailDisplay.d.ts +4 -0
- package/dist/modules/display/components/EmailDisplay.js +6 -3
- package/dist/modules/display/components/PhoneDisplay.d.ts +4 -0
- package/dist/modules/display/components/PhoneDisplay.js +4 -0
- package/dist/modules/display/components/RelativeDateDisplay.d.ts +7 -5
- package/dist/modules/display/components/RelativeDateDisplay.js +10 -8
- package/dist/modules/display/components/SexDisplay.d.ts +1 -0
- package/dist/modules/display/components/SexDisplay.js +1 -0
- package/dist/modules/filter/components/Filter.d.ts +4 -0
- package/dist/modules/filter/components/Filter.js +4 -0
- package/dist/modules/filter/components/FilterBar.js +8 -7
- package/dist/modules/filter/components/FilterDialog.js +4 -5
- package/dist/modules/filter/components/FilterPopover.js +1 -1
- package/dist/modules/filter/components/FilterProvider.d.ts +1 -2
- package/dist/modules/filter/components/FilterProvider.js +22 -16
- package/dist/modules/filter/hooks/useFilterContext.d.ts +1 -0
- package/dist/modules/filter/hooks/useFilterContext.js +1 -0
- package/dist/modules/filter/types/filter.d.ts +0 -1
- package/dist/modules/hotkey/components/PopoverScoped.d.ts +5 -0
- package/dist/modules/hotkey/components/PopoverScoped.js +5 -0
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.d.ts +1 -0
- package/dist/modules/hotkey/hooks/usePreviousHotkeyScope.js +1 -0
- package/dist/modules/hotkey/hooks/useScopedHotkeys.d.ts +5 -1
- package/dist/modules/hotkey/hooks/useScopedHotkeys.js +5 -1
- package/dist/modules/icons/components/IconComponent.d.ts +4 -0
- package/dist/modules/icons/components/IconComponent.js +4 -0
- package/dist/modules/icons/components/IconPicker.d.ts +4 -0
- package/dist/modules/icons/components/IconPicker.js +7 -5
- package/dist/modules/icons/providers/IconsProvider.d.ts +1 -0
- package/dist/modules/icons/providers/IconsProvider.js +1 -0
- package/dist/modules/inputs/components/EmailField.d.ts +4 -1
- package/dist/modules/inputs/components/EmailField.js +4 -1
- package/dist/modules/inputs/components/FullNameField.d.ts +6 -0
- package/dist/modules/inputs/components/FullNameField.js +20 -8
- package/dist/modules/inputs/components/PhoneField.d.ts +4 -1
- package/dist/modules/inputs/components/PhoneField.js +4 -1
- package/dist/modules/inputs/components/SexField.d.ts +1 -0
- package/dist/modules/inputs/components/SexField.js +1 -0
- package/dist/modules/layout/components/AppLayout.d.ts +6 -6
- package/dist/modules/layout/components/AppLayout.js +12 -13
- package/dist/modules/layout/components/AppLayoutResizeHandle.d.ts +5 -12
- package/dist/modules/layout/components/AppLayoutResizeHandle.js +15 -18
- package/dist/modules/layout/components/Page.d.ts +5 -0
- package/dist/modules/layout/components/Page.js +5 -0
- package/dist/modules/layout/components/PageHeader.d.ts +4 -1
- package/dist/modules/layout/components/PageHeader.js +4 -1
- package/dist/modules/list/DisplayMenu.d.ts +37 -0
- package/dist/modules/list/DisplayMenu.js +92 -0
- package/dist/modules/list/ListFilter.d.ts +83 -0
- package/dist/modules/list/ListFilter.js +83 -0
- package/dist/modules/list/ViewBar.d.ts +47 -0
- package/dist/modules/list/ViewBar.js +65 -0
- package/dist/modules/list/filter/AddFilter.d.ts +10 -0
- package/dist/modules/list/filter/AddFilter.js +140 -0
- package/dist/modules/list/filter/AdvancedPopover.d.ts +8 -0
- package/dist/modules/list/filter/AdvancedPopover.js +103 -0
- package/dist/modules/list/filter/ListFilterBar.d.ts +6 -0
- package/dist/modules/list/filter/ListFilterBar.js +157 -0
- package/dist/modules/list/filter/RecordCount.d.ts +7 -0
- package/dist/modules/list/filter/RecordCount.js +22 -0
- package/dist/modules/list/filter/RuleChips.d.ts +12 -0
- package/dist/modules/list/filter/RuleChips.js +151 -0
- package/dist/modules/list/filter/SearchChip.d.ts +6 -0
- package/dist/modules/list/filter/SearchChip.js +69 -0
- package/dist/modules/list/filter/filterRules.d.ts +21 -0
- package/dist/modules/list/filter/filterRules.js +37 -0
- package/dist/modules/list/filter/listFilterContext.d.ts +36 -0
- package/dist/modules/list/filter/listFilterContext.js +18 -0
- package/dist/modules/list/filter/listFilterQuery.d.ts +20 -0
- package/dist/modules/list/filter/listFilterQuery.js +30 -0
- package/dist/modules/navigation-menu/components/NavigationMenu.d.ts +4 -3
- package/dist/modules/navigation-menu/components/NavigationMenu.js +7 -7
- package/dist/modules/pickers/EntityPicker.d.ts +7 -0
- package/dist/modules/pickers/EntityPicker.js +7 -0
- package/dist/modules/pickers/LookupPicker.d.ts +57 -0
- package/dist/modules/pickers/LookupPicker.js +115 -0
- package/dist/modules/pickers/SelectMember.d.ts +17 -2
- package/dist/modules/pickers/SelectMember.js +58 -4
- package/dist/modules/pickers/members.d.ts +3 -2
- package/dist/modules/pickers/members.js +1 -1
- package/dist/modules/record-field/components/NumberField.d.ts +5 -0
- package/dist/modules/record-field/components/NumberField.js +14 -7
- package/dist/modules/record-field/components/TextField.d.ts +4 -0
- package/dist/modules/record-field/components/TextField.js +10 -2
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.d.ts +5 -0
- package/dist/modules/record-field/meta-inputs/components/PhoneInput.js +5 -0
- package/dist/modules/record-list/RecordList.d.ts +19 -0
- package/dist/modules/record-list/RecordList.js +24 -0
- package/dist/modules/record-list/RecordListProvider.d.ts +30 -0
- package/dist/modules/record-list/RecordListProvider.js +57 -0
- package/dist/modules/record-list/RecordListRoot.d.ts +30 -0
- package/dist/modules/record-list/RecordListRoot.js +140 -0
- package/dist/modules/record-list/selection.d.ts +22 -0
- package/dist/modules/record-list/selection.js +54 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.d.ts +9 -0
- package/dist/modules/record-panel/PanelDescriptionEditor.js +39 -0
- package/dist/modules/record-panel/PanelDescriptionField.d.ts +13 -0
- package/dist/modules/record-panel/PanelDescriptionField.js +39 -0
- package/dist/modules/record-panel/PanelField.d.ts +17 -0
- package/dist/modules/record-panel/PanelField.js +47 -0
- package/dist/modules/record-panel/PanelForm.d.ts +30 -0
- package/dist/modules/record-panel/PanelForm.js +154 -0
- package/dist/modules/record-panel/PanelLabel.d.ts +10 -0
- package/dist/modules/record-panel/PanelLabel.js +55 -0
- package/dist/modules/record-panel/PanelSection.d.ts +12 -0
- package/dist/modules/record-panel/PanelSection.js +24 -0
- package/dist/modules/record-panel/panelExpansion.d.ts +10 -0
- package/dist/modules/record-panel/panelExpansion.js +7 -0
- package/dist/modules/record-panel/useSaveOnLeave.d.ts +14 -0
- package/dist/modules/record-panel/useSaveOnLeave.js +42 -0
- package/dist/modules/record-table/components/RecordTable.d.ts +6 -0
- package/dist/modules/record-table/components/RecordTable.js +6 -0
- package/dist/modules/record-table/components/RecordTableCell.d.ts +9 -0
- package/dist/modules/record-table/components/RecordTableCell.js +16 -2
- package/dist/modules/record-table/components/RecordTableCellInline.d.ts +5 -0
- package/dist/modules/record-table/components/RecordTableCellInline.js +8 -7
- package/dist/modules/record-table/components/RecordTableCursor.js +30 -28
- package/dist/modules/record-table/components/RecordTableHead.d.ts +7 -2
- package/dist/modules/record-table/components/RecordTableHead.js +73 -6
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +22 -1
- package/dist/modules/record-table/components/RecordTableProvider.js +24 -8
- package/dist/modules/record-table/hooks/useTablePreferences.d.ts +1 -1
- package/dist/modules/record-table/hooks/useTablePreferences.js +18 -31
- package/dist/modules/record-table/states/RecordTableCursorState.d.ts +21 -1
- package/dist/modules/record-table/states/RecordTableCursorState.js +21 -3
- package/dist/modules/record-table/types/RecordTableCursorTypes.d.ts +1 -0
- package/dist/modules/record-table/types/RecordTableCursorTypes.js +1 -0
- package/dist/modules/records/ContactLink.d.ts +13 -0
- package/dist/modules/records/ContactLink.js +49 -0
- package/dist/modules/records/ContactPicker.d.ts +36 -0
- package/dist/modules/records/ContactPicker.js +173 -0
- package/dist/modules/records/MemberLink.d.ts +12 -0
- package/dist/modules/records/MemberLink.js +25 -0
- package/dist/modules/records/RecordChip.d.ts +13 -0
- package/dist/modules/records/RecordChip.js +46 -0
- package/dist/modules/records/contacts.d.ts +53 -0
- package/dist/modules/records/contacts.js +10 -0
- package/dist/modules/records/openRecord.d.ts +94 -0
- package/dist/modules/records/openRecord.js +72 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/display.BlTmubjj.js +181 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/index.D0heQG4v.js +987 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/pathe.M-eThtNZ.zq3TM4NT.js +176 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/run.CjdgFZiW.js +1509 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/source-map.DakdQc29.js +687 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/tinyrainbow.Do8I1XRG.js +85 -0
- package/dist/node_modules/.pnpm/vitest@5.1.0_@opentelemetry_api@1.10.0_@types_node@26.6.6_@vitest_browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/task-utils.js +6 -0
- package/dist/state/sidebarPanelState.js +7 -2
- package/dist/state/themeState.d.ts +13 -2
- package/dist/state/themeState.js +18 -4
- package/dist/theme.css +3 -0
- package/dist/types/SexCode.d.ts +1 -0
- package/dist/types/SexCode.js +1 -0
- package/dist/types/UIConfig.d.ts +182 -86
- package/dist/types/UIConfig.js +14 -0
- package/dist/utils/IsUndefinedOrNull.d.ts +1 -0
- package/dist/utils/IsUndefinedOrNull.js +1 -0
- package/dist/utils/file-storage.d.ts +1 -0
- package/dist/utils/file-storage.js +1 -0
- package/dist/utils/format/formatPhoneNumber.d.ts +4 -0
- package/dist/utils/format/formatPhoneNumber.js +4 -0
- package/dist/utils/getPluginAssetsUrl.d.ts +5 -0
- package/dist/utils/getPluginAssetsUrl.js +5 -0
- package/dist/utils/host-component.d.ts +10 -0
- package/dist/utils/host-component.js +34 -0
- package/dist/utils/json.d.ts +3 -2
- package/dist/utils/json.js +3 -2
- package/dist/utils/plugin-runtime.d.ts +21 -17
- package/dist/utils/plugin-runtime.js +59 -12
- package/dist/utils/plugin-styles.d.ts +10 -3
- package/dist/utils/plugin-styles.js +44 -12
- package/dist/utils/record-timeline.d.ts +10 -9
- package/dist/utils/record-timeline.js +12 -17
- package/exports.txt +249 -0
- package/package.json +14 -3
- package/dist/constants/IntlLanguages.d.ts +0 -74
- package/dist/constants/IntlLanguages.js +0 -76
- package/dist/hooks/use-query-state.d.ts +0 -16
- package/dist/hooks/use-query-state.js +0 -122
- package/dist/modules/filter/hooks/useFilterQueryState.d.ts +0 -4
- package/dist/modules/filter/hooks/useFilterQueryState.js +0 -14
- package/dist/types/Theme.d.ts +0 -1
- package/dist/types/Theme.js +0 -0
- package/dist/utils/localization/formatDateISOStringToRelativeDate.d.ts +0 -2
- package/dist/utils/localization/formatDateISOStringToRelativeDate.js +0 -16
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/vitest@5.1.0_@opentelemetry+api@1.10.0_@types+node@26.6.6_@vitest+browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/chunks/tinyrainbow.Do8I1XRG.js
|
|
2
|
+
var d = (e) => String(e);
|
|
3
|
+
d.open = d.close = "";
|
|
4
|
+
var i = () => d;
|
|
5
|
+
var t = "\x1B[39m";
|
|
6
|
+
var o = "\x1B[49m";
|
|
7
|
+
var F = (e, r, a, n, l) => {
|
|
8
|
+
let m = "", g = 0;
|
|
9
|
+
do
|
|
10
|
+
m += e.substring(g, n) + a, g = n + l, n = e.indexOf(r, g);
|
|
11
|
+
while (~n);
|
|
12
|
+
return m + e.substring(g);
|
|
13
|
+
};
|
|
14
|
+
var u = (e, r, a = e, n = e.length) => {
|
|
15
|
+
let l = r.length, m = (g) => {
|
|
16
|
+
let s = g + "", x = s.indexOf(r, n);
|
|
17
|
+
return ~x ? e + F(s, r, a, x, l) + r : e + s + r;
|
|
18
|
+
};
|
|
19
|
+
return m.open = e, m.close = r, m;
|
|
20
|
+
};
|
|
21
|
+
var B = (e, r) => u(e, r, e, 5);
|
|
22
|
+
var c = (e) => {
|
|
23
|
+
let r = e.charCodeAt(0) === 35 ? e.slice(1) : e, a = parseInt(r, 16) || 0;
|
|
24
|
+
return r.length < 6 ? `${(a >> 8 & 15) * 17};${(a >> 4 & 15) * 17};${(a & 15) * 17}` : `${a >> 16 & 255};${a >> 8 & 255};${a & 255}`;
|
|
25
|
+
};
|
|
26
|
+
function y(e) {
|
|
27
|
+
let r = e ? u : i;
|
|
28
|
+
return {
|
|
29
|
+
isColorSupported: e,
|
|
30
|
+
reset: r("\x1B[0m", "\x1B[0m"),
|
|
31
|
+
bold: r("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
32
|
+
dim: r("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
33
|
+
italic: r("\x1B[3m", "\x1B[23m"),
|
|
34
|
+
underline: r("\x1B[4m", "\x1B[24m"),
|
|
35
|
+
inverse: r("\x1B[7m", "\x1B[27m"),
|
|
36
|
+
hidden: r("\x1B[8m", "\x1B[28m"),
|
|
37
|
+
strikethrough: r("\x1B[9m", "\x1B[29m"),
|
|
38
|
+
black: r("\x1B[30m", t),
|
|
39
|
+
red: r("\x1B[31m", t),
|
|
40
|
+
green: r("\x1B[32m", t),
|
|
41
|
+
yellow: r("\x1B[33m", t),
|
|
42
|
+
blue: r("\x1B[34m", t),
|
|
43
|
+
magenta: r("\x1B[35m", t),
|
|
44
|
+
cyan: r("\x1B[36m", t),
|
|
45
|
+
white: r("\x1B[37m", t),
|
|
46
|
+
gray: r("\x1B[90m", t),
|
|
47
|
+
bgBlack: r("\x1B[40m", o),
|
|
48
|
+
bgRed: r("\x1B[41m", o),
|
|
49
|
+
bgGreen: r("\x1B[42m", o),
|
|
50
|
+
bgYellow: r("\x1B[43m", o),
|
|
51
|
+
bgBlue: r("\x1B[44m", o),
|
|
52
|
+
bgMagenta: r("\x1B[45m", o),
|
|
53
|
+
bgCyan: r("\x1B[46m", o),
|
|
54
|
+
bgWhite: r("\x1B[47m", o),
|
|
55
|
+
blackBright: r("\x1B[90m", t),
|
|
56
|
+
redBright: r("\x1B[91m", t),
|
|
57
|
+
greenBright: r("\x1B[92m", t),
|
|
58
|
+
yellowBright: r("\x1B[93m", t),
|
|
59
|
+
blueBright: r("\x1B[94m", t),
|
|
60
|
+
magentaBright: r("\x1B[95m", t),
|
|
61
|
+
cyanBright: r("\x1B[96m", t),
|
|
62
|
+
whiteBright: r("\x1B[97m", t),
|
|
63
|
+
bgBlackBright: r("\x1B[100m", o),
|
|
64
|
+
bgRedBright: r("\x1B[101m", o),
|
|
65
|
+
bgGreenBright: r("\x1B[102m", o),
|
|
66
|
+
bgYellowBright: r("\x1B[103m", o),
|
|
67
|
+
bgBlueBright: r("\x1B[104m", o),
|
|
68
|
+
bgMagentaBright: r("\x1B[105m", o),
|
|
69
|
+
bgCyanBright: r("\x1B[106m", o),
|
|
70
|
+
bgWhiteBright: r("\x1B[107m", o),
|
|
71
|
+
rgb: e ? (n, l, m) => B(`\x1B[38;2;${n};${l};${m}m`, t) : i,
|
|
72
|
+
bgRgb: e ? (n, l, m) => B(`\x1B[48;2;${n};${l};${m}m`, o) : i,
|
|
73
|
+
hex: e ? (n) => B(`\x1B[38;2;${c(n)}m`, t) : i,
|
|
74
|
+
bgHex: e ? (n) => B(`\x1B[48;2;${c(n)}m`, o) : i
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function C() {
|
|
78
|
+
let e = typeof process != "undefined" ? process : void 0, r = (e == null ? void 0 : e.env) || {}, a = r.FORCE_TTY !== "false", n = (e == null ? void 0 : e.argv) || [];
|
|
79
|
+
return !("NO_COLOR" in r || n.includes("--no-color")) && ("FORCE_COLOR" in r || n.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || a && r.TERM !== "dumb" || "CI" in r) || typeof window != "undefined" && !!window.chrome;
|
|
80
|
+
}
|
|
81
|
+
function h({ force: e } = {}) {
|
|
82
|
+
return y(e || C());
|
|
83
|
+
}
|
|
84
|
+
var $ = h();
|
|
85
|
+
export { $ };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// ../../node_modules/.pnpm/vitest@5.1.0_@opentelemetry+api@1.10.0_@types+node@26.6.6_@vitest+browser-preview@5.1.0_d78d0f63d2a6b1c4a51a56547b330411/node_modules/vitest/dist/task-utils.js
|
|
2
|
+
/* @__NO_SIDE_EFFECTS__ */
|
|
3
|
+
function createTaskName(names, separator = " > ") {
|
|
4
|
+
return names.filter((name) => name !== void 0).join(separator);
|
|
5
|
+
}
|
|
6
|
+
export { createTaskName };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { stored } from "../lib/stored.js";
|
|
2
2
|
import { atom } from "jotai";
|
|
3
|
+
import { z } from "zod";
|
|
3
4
|
// src/state/sidebarPanelState.ts
|
|
4
|
-
const sidebarPanelOpenState =
|
|
5
|
+
const sidebarPanelOpenState = stored({
|
|
6
|
+
key: "erxes:ui:sidebar-open",
|
|
7
|
+
schema: z.boolean(),
|
|
8
|
+
initial: true
|
|
9
|
+
});
|
|
5
10
|
/** On a phone, the path the panel was opened on: it covers the page, so it closes when you leave. */
|
|
6
11
|
const sidebarPanelOpenedAtState = atom(null);
|
|
7
12
|
export { sidebarPanelOpenState, sidebarPanelOpenedAtState };
|
|
@@ -1,2 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The UI theme a member picks: `light`, `dark` or `system`. */
|
|
3
|
+
export declare const ThemeOption: z.ZodEnum<{
|
|
4
|
+
dark: "dark";
|
|
5
|
+
light: "light";
|
|
6
|
+
system: "system";
|
|
7
|
+
}>;
|
|
8
|
+
export type ThemeOption = z.infer<typeof ThemeOption>;
|
|
9
|
+
/**
|
|
10
|
+
* The member's theme choice as a jotai atom, kept in localStorage.
|
|
11
|
+
* web applies it to the page; `useAtom(themeState)` reads and sets it.
|
|
12
|
+
*/
|
|
13
|
+
export declare const themeState: import("jotai").WritableAtom<"dark" | "light" | "system", ["dark" | "light" | "system" | typeof import("jotai/utils").RESET | ((prev: "dark" | "light" | "system") => "dark" | "light" | "system" | typeof import("jotai/utils").RESET)], void>;
|
package/dist/state/themeState.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { stored } from "../lib/stored.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
/** The UI theme a member picks: `light`, `dark` or `system`. */
|
|
4
|
+
const ThemeOption = z.enum([
|
|
5
|
+
"light",
|
|
6
|
+
"dark",
|
|
7
|
+
"system"
|
|
8
|
+
]);
|
|
9
|
+
/**
|
|
10
|
+
* The member's theme choice as a jotai atom, kept in localStorage.
|
|
11
|
+
* web applies it to the page; `useAtom(themeState)` reads and sets it.
|
|
12
|
+
*/
|
|
13
|
+
const themeState = stored({
|
|
14
|
+
key: "erxes:ui:theme",
|
|
15
|
+
schema: ThemeOption,
|
|
16
|
+
initial: "system"
|
|
17
|
+
});
|
|
18
|
+
export { ThemeOption, themeState };
|
package/dist/theme.css
CHANGED
|
@@ -126,6 +126,9 @@
|
|
|
126
126
|
--grid-template-columns-field: 6.5rem minmax(0, 1fr);
|
|
127
127
|
/* A side column of 18 to 24rem beside the content. */
|
|
128
128
|
--grid-template-columns-aside: minmax(18rem, 24rem) minmax(0, 1fr);
|
|
129
|
+
/* A condition row: "Where", "And" or "Or", the field, the operator, the value, then remove. */
|
|
130
|
+
/* 5.5rem holds the And/Or picker in Mongolian ("Эсвэл"). */
|
|
131
|
+
--grid-template-columns-condition: 5.5rem minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
|
|
129
132
|
|
|
130
133
|
/* Panels and sidebars sliding open or shut. */
|
|
131
134
|
--ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
|
package/dist/types/SexCode.d.ts
CHANGED
package/dist/types/SexCode.js
CHANGED
package/dist/types/UIConfig.d.ts
CHANGED
|
@@ -1,35 +1,198 @@
|
|
|
1
|
+
import { TContactContentType } from "../modules/records/contacts.js";
|
|
2
|
+
import { RecordRef } from "../modules/records/openRecord.js";
|
|
1
3
|
import { Icon } from "@tabler/icons-react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { UseQueryOptions } from "@tanstack/react-query";
|
|
5
|
+
/** Every schematic the widget catalog can draw for a dashboard widget. */
|
|
6
|
+
export declare const DASHBOARD_WIDGET_PREVIEWS: readonly ['bar', 'line', 'area', 'pie', 'table', 'list', 'kpi', 'heatmap', 'progress'];
|
|
7
|
+
/** The schematic a dashboard widget shows in the widget catalog. */
|
|
8
|
+
export type TDashboardWidgetPreview = (typeof DASHBOARD_WIDGET_PREVIEWS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* A plugin's tile for core's home dashboard.
|
|
11
|
+
* It shows in the widget catalog, under the plugin's name, to members who may use the plugin.
|
|
12
|
+
* A member places it at most once.
|
|
13
|
+
*/
|
|
14
|
+
export type TDashboardWidget = {
|
|
15
|
+
/** Unique within the plugin, e.g. `open-tickets`: a saved tile names it. */
|
|
16
|
+
name: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
icon: React.ElementType;
|
|
20
|
+
/** The schematic the catalog draws; the icon when left out. */
|
|
21
|
+
preview?: TDashboardWidgetPreview;
|
|
22
|
+
/** Grid units on a 12-column grid when placed; 6 × 6 when left out. */
|
|
23
|
+
size?: {
|
|
24
|
+
w: number;
|
|
25
|
+
h: number;
|
|
12
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* The tile's body, under core's header with the title; it scrolls when taller than the tile.
|
|
29
|
+
* A `lazy` one loads when the tile first shows.
|
|
30
|
+
*/
|
|
31
|
+
component: React.ComponentType;
|
|
32
|
+
};
|
|
33
|
+
/** What a record section is given: the customer or company it shows on. */
|
|
34
|
+
export type TRecordSectionProps = {
|
|
35
|
+
contentType: TContactContentType;
|
|
36
|
+
contentId: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A plugin's section on a customer's or company's detail in core's panel.
|
|
40
|
+
* It sits under core's own sections, e.g. the customer's deals. One that crashes shows its
|
|
41
|
+
* error, not the panel's.
|
|
42
|
+
*/
|
|
43
|
+
export type TRecordSection = {
|
|
44
|
+
contentType: TContactContentType;
|
|
45
|
+
/** The section's heading. */
|
|
46
|
+
title: string;
|
|
47
|
+
icon: React.ElementType;
|
|
48
|
+
component: React.ComponentType<TRecordSectionProps>;
|
|
49
|
+
};
|
|
50
|
+
/** What each slot of a plugin record is given: the record. */
|
|
51
|
+
export type TRecordSlotProps = RecordRef;
|
|
52
|
+
/**
|
|
53
|
+
* The customers and companies a record is about.
|
|
54
|
+
* Its relation tabs list records of these.
|
|
55
|
+
*/
|
|
56
|
+
export type TRecordContacts = {
|
|
57
|
+
customerIds: string[];
|
|
58
|
+
companyIds: string[];
|
|
13
59
|
};
|
|
14
|
-
|
|
60
|
+
/** A plugin record type's own tab, after core's Detail or Activity tab. */
|
|
61
|
+
export type TRecordTab = {
|
|
15
62
|
value: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
63
|
+
label: string;
|
|
64
|
+
icon: Icon;
|
|
65
|
+
after?: 'detail' | 'activity';
|
|
66
|
+
component: React.ComponentType<TRecordSlotProps>;
|
|
20
67
|
};
|
|
21
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Props of a plugin record type's `New` slot, the draft form.
|
|
70
|
+
* The draft is saved as the record on Save.
|
|
71
|
+
*/
|
|
72
|
+
export type TRecordDraftProps = {
|
|
73
|
+
/** What its opener passed (`useOpenRecord().openNew(type, defaults)`), e.g. a stage. */
|
|
74
|
+
defaults: Record<string, unknown>;
|
|
75
|
+
/** Call with the saved record's id: the record takes the draft's place in the panel. */
|
|
76
|
+
onCreated: (id: string) => void;
|
|
77
|
+
/** Leaves the draft: back to the record it came from, else closes the panel. */
|
|
78
|
+
onCancel: () => void;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* A custom field's value: text, number, date, yes/no or options.
|
|
82
|
+
* A date is `YYYY-MM-DD`; several options are a list.
|
|
83
|
+
*/
|
|
84
|
+
export type TPropertyValue = string | number | boolean | string[];
|
|
85
|
+
/**
|
|
86
|
+
* Custom fields on a plugin record type, whose values the plugin keeps.
|
|
87
|
+
* Core keeps the fields of `type` (Settings › Properties, under the plugin) and draws the
|
|
88
|
+
* record's Properties tab; the plugin keeps each record's values by field id, checks a patch
|
|
89
|
+
* with core's `fields.check` and saves the values it answers.
|
|
90
|
+
*/
|
|
91
|
+
export type TRecordProperties = {
|
|
92
|
+
/** The record type the fields are defined on, `<plugin>.<type>`, e.g. `operation.task`. */
|
|
93
|
+
type: string;
|
|
94
|
+
/** The record's values by field id, as query options; core refetches them after a save. */
|
|
95
|
+
values: (contentId: string) => UseQueryOptions<Record<string, TPropertyValue>>;
|
|
96
|
+
/** Saves a patch of values by field id; `null` clears one. */
|
|
97
|
+
save: (contentId: string, patch: Record<string, TPropertyValue | null>) => Promise<unknown>;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* A record type a plugin shows in core's side panel. Core draws the panel as it draws a
|
|
101
|
+
* customer's: header with Back, expand and close, the tabs (Detail, the type's own `tabs`,
|
|
102
|
+
* Properties, every allowed plugin's relation tabs for it, Activity), resizing, the address
|
|
103
|
+
* `?panel=/detail/<contentType>/<id>`, drafts. The plugin fills the slots. Open one with
|
|
104
|
+
* `useOpenRecord().open({ contentType, contentId })`, a draft with `openNew(contentType)`.
|
|
105
|
+
*/
|
|
106
|
+
export type TPanelRecordType = {
|
|
107
|
+
/** `<plugin name>:<thing>`, e.g. `sales:deal`; it must start with the plugin's `name`. */
|
|
108
|
+
contentType: string;
|
|
109
|
+
/** What one is called, e.g. "Deal": a draft's header reads "New deal". */
|
|
110
|
+
title: string;
|
|
111
|
+
icon: React.ElementType;
|
|
112
|
+
/**
|
|
113
|
+
* The record's own page, where the panel's expand button leads: a route of the plugin's,
|
|
114
|
+
* under its `path`, that renders `<RecordPage contentType contentId />`.
|
|
115
|
+
*/
|
|
116
|
+
detailPath: (contentId: string) => string;
|
|
117
|
+
/** The header's title: the record's name, editable in place if the plugin wants. */
|
|
118
|
+
Title: React.ComponentType<TRecordSlotProps>;
|
|
119
|
+
/** The header's own actions (a "more" menu), before expand and close. */
|
|
120
|
+
Actions?: React.ComponentType<TRecordSlotProps>;
|
|
121
|
+
/** The Detail tab: `PanelSection`s of `PanelField` rows. */
|
|
122
|
+
Detail: React.ComponentType<TRecordSlotProps>;
|
|
123
|
+
tabs?: TRecordTab[];
|
|
124
|
+
/** A record not created yet; without it, the type has no drafts. */
|
|
125
|
+
New?: React.ComponentType<TRecordDraftProps>;
|
|
126
|
+
/**
|
|
127
|
+
* The record's customers and companies, as query options (often the record's own query with
|
|
128
|
+
* `select`). Without it, plugins' relation tabs don't show on this type.
|
|
129
|
+
*/
|
|
130
|
+
contacts?: (contentId: string) => UseQueryOptions<TRecordContacts, Error, TRecordContacts>;
|
|
131
|
+
/** A timeline type of the plugin's manifest (`timelines`): core's Activity tab shows it. */
|
|
132
|
+
activity?: string;
|
|
133
|
+
/** Custom fields: core adds a Properties tab and a settings page for them. */
|
|
134
|
+
properties?: TRecordProperties;
|
|
135
|
+
};
|
|
136
|
+
/** Props of a relation tab: the record it shows on, and its contacts. */
|
|
137
|
+
export type TRelationTabProps = TRecordSlotProps & TRecordContacts;
|
|
138
|
+
/**
|
|
139
|
+
* A plugin's tab on other records' panels, listing its own records.
|
|
140
|
+
* It lists the plugin's own records of the same customers and companies: a customer's deals.
|
|
141
|
+
* Shown on core's customers and companies (their contacts are themselves), and on the plugin
|
|
142
|
+
* record types `hosts` names that give `contacts` (a task's deals). A record clicked in it opens
|
|
143
|
+
* on top in the same panel (`useOpenRecord().open`), and Back returns.
|
|
144
|
+
*/
|
|
145
|
+
export type TRelationTab = {
|
|
146
|
+
/** Unique within the plugin, e.g. `deals`. */
|
|
147
|
+
name: string;
|
|
148
|
+
title: string;
|
|
149
|
+
icon: Icon;
|
|
150
|
+
/** Plugin record types it also shows on (`tasks:task`); customers and companies always. */
|
|
151
|
+
hosts?: string[];
|
|
152
|
+
component: React.ComponentType<TRelationTabProps>;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* A plugin's settings page, linked from core's settings sidebar.
|
|
156
|
+
* The page is a route of the plugin's own, under its `path`, e.g. `/frontline/settings/tags`.
|
|
157
|
+
*/
|
|
158
|
+
export type TPluginSettingsPage = {
|
|
159
|
+
/** The page's address, under the plugin's `path`. */
|
|
160
|
+
path: string;
|
|
161
|
+
label: string;
|
|
162
|
+
icon?: React.ElementType;
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* A plugin UI's `CONFIG`, exported from its `./config` remote.
|
|
166
|
+
* web reads `name`, `path`, `icon`, `modules`, `checkAccess`, `recordSections`, `recordTypes`,
|
|
167
|
+
* `relationTabs`, `settings`, `dashboardWidgets` and `floatingWidget`; its first module renders
|
|
168
|
+
* under `/<path>/*`. The other fields come from erxes 3.x and web ignores them.
|
|
169
|
+
*/
|
|
22
170
|
export type IUIConfig = {
|
|
23
171
|
name: string;
|
|
24
172
|
path: string;
|
|
25
173
|
icon?: React.ElementType;
|
|
174
|
+
/** The plugin's settings pages, in core's settings sidebar for members who may use the plugin. */
|
|
175
|
+
settings?: TPluginSettingsPage[];
|
|
176
|
+
/** Sections on core's customer and company detail, shown to members who may use the plugin. */
|
|
177
|
+
recordSections?: TRecordSection[];
|
|
178
|
+
/** The plugin's records core's side panel opens, for members who may use the plugin. */
|
|
179
|
+
recordTypes?: TPanelRecordType[];
|
|
180
|
+
/** Tabs on other records' panels listing the plugin's records of their contacts. */
|
|
181
|
+
relationTabs?: TRelationTab[];
|
|
182
|
+
/** Tiles in core's home dashboard catalog, for members who may use the plugin. */
|
|
183
|
+
dashboardWidgets?: TDashboardWidget[];
|
|
184
|
+
/**
|
|
185
|
+
* One component web mounts once beside the app shell, on every page, for members who may use
|
|
186
|
+
* the plugin, and keeps mounted across navigation (a softphone). It sits in the bottom-right
|
|
187
|
+
* corner above the page.
|
|
188
|
+
*/
|
|
189
|
+
floatingWidget?: React.ComponentType;
|
|
26
190
|
i18n?: boolean;
|
|
27
191
|
i18nNamespace?: string;
|
|
28
|
-
hasFloatingWidget?: boolean;
|
|
29
192
|
/**
|
|
30
193
|
* erxes platform versions this plugin is built for, as a semver range
|
|
31
|
-
* (e.g. `'~3.2'`, `'>=3.2.25 <3.4'`). Core warns
|
|
32
|
-
* plugin
|
|
194
|
+
* (e.g. `'~3.2'`, `'>=3.2.25 <3.4'`). Core warns, and still loads the
|
|
195
|
+
* plugin, when the running platform is outside the range.
|
|
33
196
|
*/
|
|
34
197
|
platform?: string;
|
|
35
198
|
navigationGroup?: {
|
|
@@ -47,79 +210,12 @@ export type IUIConfig = {
|
|
|
47
210
|
*/
|
|
48
211
|
subGroup?: () => React.ReactNode;
|
|
49
212
|
};
|
|
50
|
-
widgets?: {
|
|
51
|
-
relationWidgets?: {
|
|
52
|
-
name: string;
|
|
53
|
-
icon?: React.ElementType;
|
|
54
|
-
label?: string;
|
|
55
|
-
contentTypes?: string[];
|
|
56
|
-
}[];
|
|
57
|
-
relationSettingsWidgets?: {
|
|
58
|
-
name: string;
|
|
59
|
-
icon?: React.ElementType;
|
|
60
|
-
label?: string;
|
|
61
|
-
}[];
|
|
62
|
-
recordPickerWidgets?: {
|
|
63
|
-
name: string;
|
|
64
|
-
contentType: string;
|
|
65
|
-
}[];
|
|
66
|
-
recordPanels?: {
|
|
67
|
-
contentType: string;
|
|
68
|
-
properties?: boolean;
|
|
69
|
-
draftTitle?: boolean;
|
|
70
|
-
tabs?: {
|
|
71
|
-
value: string;
|
|
72
|
-
label: string;
|
|
73
|
-
labelKey?: string;
|
|
74
|
-
icon?: Icon;
|
|
75
|
-
after?: 'detail' | 'properties' | 'activity';
|
|
76
|
-
}[];
|
|
77
|
-
detailPath?: (recordId: string, pathname: string) => string;
|
|
78
|
-
}[];
|
|
79
|
-
contactWidgets?: {
|
|
80
|
-
name: string;
|
|
81
|
-
label?: string;
|
|
82
|
-
icon?: React.ElementType;
|
|
83
|
-
}[];
|
|
84
|
-
customerDetailWidgets?: {
|
|
85
|
-
name: string;
|
|
86
|
-
}[];
|
|
87
|
-
dashboardWidgets?: {
|
|
88
|
-
name: string;
|
|
89
|
-
label: string;
|
|
90
|
-
description?: string;
|
|
91
|
-
icon?: React.ElementType;
|
|
92
|
-
defaultSize: {
|
|
93
|
-
w: number;
|
|
94
|
-
h: number;
|
|
95
|
-
};
|
|
96
|
-
minSize?: {
|
|
97
|
-
w: number;
|
|
98
|
-
h: number;
|
|
99
|
-
};
|
|
100
|
-
maxSize?: {
|
|
101
|
-
w: number;
|
|
102
|
-
h: number;
|
|
103
|
-
};
|
|
104
|
-
configurable?: boolean;
|
|
105
|
-
singleton?: boolean;
|
|
106
|
-
preview?: TDashboardWidgetPreview;
|
|
107
|
-
}[];
|
|
108
|
-
formWidgets?: {
|
|
109
|
-
name: string;
|
|
110
|
-
contentType: string;
|
|
111
|
-
icon?: React.ElementType;
|
|
112
|
-
}[];
|
|
113
|
-
propertyInputs?: Record<string, React.ComponentType<TPropertyInputProps>>;
|
|
114
|
-
activityRows?: Record<string, React.ComponentType<TActivityRowProps>>;
|
|
115
|
-
};
|
|
116
213
|
modules?: {
|
|
117
214
|
name: string;
|
|
118
215
|
icon?: React.ElementType;
|
|
119
216
|
path: string;
|
|
120
217
|
hasAutomation?: boolean;
|
|
121
218
|
hasRelationWidget?: boolean;
|
|
122
|
-
hasFloatingWidget?: boolean;
|
|
123
219
|
hasSegmentConfigWidget?: boolean;
|
|
124
220
|
}[];
|
|
125
221
|
};
|
package/dist/types/UIConfig.js
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/types/UIConfig.ts
|
|
2
|
+
/** Every schematic the widget catalog can draw for a dashboard widget. */
|
|
3
|
+
const DASHBOARD_WIDGET_PREVIEWS = [
|
|
4
|
+
"bar",
|
|
5
|
+
"line",
|
|
6
|
+
"area",
|
|
7
|
+
"pie",
|
|
8
|
+
"table",
|
|
9
|
+
"list",
|
|
10
|
+
"kpi",
|
|
11
|
+
"heatmap",
|
|
12
|
+
"progress"
|
|
13
|
+
];
|
|
14
|
+
export { DASHBOARD_WIDGET_PREVIEWS };
|
|
@@ -12,6 +12,7 @@ export interface FileStorageAdapter {
|
|
|
12
12
|
/** Deletes a file by the address `upload` returned. */
|
|
13
13
|
remove?(address: string): Promise<void>;
|
|
14
14
|
}
|
|
15
|
+
/** Sets where uploads go; web calls it at startup and plugins don't. */
|
|
15
16
|
export declare const setFileStorage: (next: FileStorageAdapter | null) => void;
|
|
16
17
|
export declare const storeFile: (file: File, options?: Parameters<FileStorageAdapter['upload']>[1]) => Promise<string>;
|
|
17
18
|
export declare const removeStoredFile: (address: string) => Promise<void>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CountryCode } from "libphonenumber-js";
|
|
2
|
+
/**
|
|
3
|
+
* A phone number formatted as people write it, even half typed.
|
|
4
|
+
* `defaultCountry` decides how a number without a `+` code reads.
|
|
5
|
+
*/
|
|
2
6
|
export declare const formatPhoneNumber: ({ defaultCountry, value }: {
|
|
3
7
|
defaultCountry?: CountryCode;
|
|
4
8
|
value: string;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { AsYouType } from "libphonenumber-js";
|
|
2
2
|
// src/utils/format/formatPhoneNumber.ts
|
|
3
|
+
/**
|
|
4
|
+
* A phone number formatted as people write it, even half typed.
|
|
5
|
+
* `defaultCountry` decides how a number without a `+` code reads.
|
|
6
|
+
*/
|
|
3
7
|
const formatPhoneNumber = ({ defaultCountry, value }) => {
|
|
4
8
|
return new AsYouType({ defaultCountry }).input(value);
|
|
5
9
|
};
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A file's URL in a plugin UI's deployed `assets` folder.
|
|
3
|
+
* `getPluginAssetsUrl('hr', 'logo.svg')` resolves next to the `hr_ui` remote entry. For a plugin
|
|
4
|
+
* web hasn't registered, it returns `url` unchanged.
|
|
5
|
+
*/
|
|
1
6
|
export declare const getPluginAssetsUrl: (pluginName: string, url: string) => string;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { getInstance } from "@module-federation/enhanced/runtime";
|
|
2
2
|
// src/utils/getPluginAssetsUrl.ts
|
|
3
|
+
/**
|
|
4
|
+
* A file's URL in a plugin UI's deployed `assets` folder.
|
|
5
|
+
* `getPluginAssetsUrl('hr', 'logo.svg')` resolves next to the `hr_ui` remote entry. For a plugin
|
|
6
|
+
* web hasn't registered, it returns `url` unchanged.
|
|
7
|
+
*/
|
|
3
8
|
const getPluginAssetsUrl = (pluginName, url) => {
|
|
4
9
|
const remote = (getInstance()?.options.remotes)?.find((r) => r.name === `${pluginName}_ui`);
|
|
5
10
|
if (remote && "entry" in remote && typeof remote.entry === "string") return `${remote.entry.replace("remoteEntry.js", "assets")}/${url}`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentType } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A component the host app (web) provides at startup and plugin UIs render: core's timeline,
|
|
4
|
+
* a record's own page, a list's filter. erxes-ui is a Module Federation singleton, so every
|
|
5
|
+
* plugin gets the host's. Outside erxes nothing is registered and it renders nothing.
|
|
6
|
+
*/
|
|
7
|
+
export declare const hostComponent: <P extends object>() => {
|
|
8
|
+
set: (component: ComponentType<P> | null) => void;
|
|
9
|
+
Host: (props: P) => import("react").JSX.Element | null;
|
|
10
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense, useSyncExternalStore } from "react";
|
|
3
|
+
// src/utils/host-component.tsx
|
|
4
|
+
/**
|
|
5
|
+
* A component the host app (web) provides at startup and plugin UIs render: core's timeline,
|
|
6
|
+
* a record's own page, a list's filter. erxes-ui is a Module Federation singleton, so every
|
|
7
|
+
* plugin gets the host's. Outside erxes nothing is registered and it renders nothing.
|
|
8
|
+
*/
|
|
9
|
+
const hostComponent = () => {
|
|
10
|
+
let registered = null;
|
|
11
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
12
|
+
const subscribe = (listener) => {
|
|
13
|
+
listeners.add(listener);
|
|
14
|
+
return () => listeners.delete(listener);
|
|
15
|
+
};
|
|
16
|
+
const read = () => registered;
|
|
17
|
+
const set = (component) => {
|
|
18
|
+
registered = component;
|
|
19
|
+
listeners.forEach((listener) => listener());
|
|
20
|
+
};
|
|
21
|
+
const Host = (props) => {
|
|
22
|
+
const Component = useSyncExternalStore(subscribe, read, read);
|
|
23
|
+
if (!Component) return null;
|
|
24
|
+
return /* @__PURE__ */ jsx(Suspense, {
|
|
25
|
+
fallback: null,
|
|
26
|
+
children: /* @__PURE__ */ jsx(Component, { ...props })
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
set,
|
|
31
|
+
Host
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export { hostComponent };
|
package/dist/utils/json.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
/**
|
|
3
|
-
* A JSON string that decodes to `schema
|
|
4
|
-
* on text that isn't JSON the same way it fails on JSON
|
|
3
|
+
* A zod schema for a JSON string that decodes to `schema`.
|
|
4
|
+
* `jsonOf(schema).safeParse(text)` fails on text that isn't JSON the same way it fails on JSON
|
|
5
|
+
* of the wrong shape.
|
|
5
6
|
*/
|
|
6
7
|
export declare const jsonOf: <S extends z.ZodType>(schema: S) => z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, S>;
|
package/dist/utils/json.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
// src/utils/json.ts
|
|
3
3
|
/**
|
|
4
|
-
* A JSON string that decodes to `schema
|
|
5
|
-
* on text that isn't JSON the same way it fails on JSON
|
|
4
|
+
* A zod schema for a JSON string that decodes to `schema`.
|
|
5
|
+
* `jsonOf(schema).safeParse(text)` fails on text that isn't JSON the same way it fails on JSON
|
|
6
|
+
* of the wrong shape.
|
|
6
7
|
*/
|
|
7
8
|
const jsonOf = (schema) => z.string().transform((text, ctx) => {
|
|
8
9
|
try {
|