@archbase/components 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/types.d.ts +65 -0
- package/dist/archbase-components-3.0.0.tgz +0 -0
- package/dist/buttons/ActionsDemo.d.ts +2 -0
- package/dist/buttons/ArchbaseActionButtons.d.ts +61 -0
- package/dist/buttons/index.d.ts +2 -0
- package/dist/charts/ArchbaseTimeline.d.ts +24 -0
- package/dist/charts/index.d.ts +3 -0
- package/dist/charts/vis-timeline/ArchbaseVisTimeline.d.ts +9 -0
- package/dist/charts/vis-timeline/ArchbaseVisTimeline.types.d.ts +284 -0
- package/dist/charts/vis-timeline/index.d.ts +9 -0
- package/dist/charts/vis-timeline/utils/timelineOptions.d.ts +68 -0
- package/dist/datagrid/components/index.d.ts +6 -0
- package/dist/datagrid/components/pagination/grid-pagination.d.ts +7 -0
- package/dist/datagrid/components/render/archbase-data-grid-item-renderer.d.ts +10 -0
- package/dist/datagrid/components/toolbar/global-search-input.d.ts +16 -0
- package/dist/datagrid/components/toolbar/grid-toolbar.d.ts +19 -0
- package/dist/datagrid/hooks/index.d.ts +3 -0
- package/dist/datagrid/hooks/use-grid-data-stable-rendering.d.ts +15 -0
- package/dist/datagrid/hooks/use-grid-data.d.ts +32 -0
- package/dist/datagrid/hooks/use-grid-details-panel.d.ts +51 -0
- package/dist/datagrid/index.d.ts +6 -0
- package/dist/datagrid/main/archbase-data-grid-column.d.ts +26 -0
- package/dist/datagrid/main/archbase-data-grid-formatters.d.ts +57 -0
- package/dist/datagrid/main/archbase-data-grid-pagination.d.ts +8 -0
- package/dist/datagrid/main/archbase-data-grid-toolbar.d.ts +7 -0
- package/dist/datagrid/main/archbase-data-grid-types.d.ts +252 -0
- package/dist/datagrid/main/archbase-data-grid-utils.d.ts +45 -0
- package/dist/datagrid/main/archbase-data-grid.d.ts +9 -0
- package/dist/datagrid/main/archbase-detail-panel-component.d.ts +52 -0
- package/dist/datagrid/main/archbase-expand-button.d.ts +22 -0
- package/dist/datagrid/main/archbase-grid-popover.d.ts +37 -0
- package/dist/datagrid/main/grid-row-actions.d.ts +15 -0
- package/dist/datagrid/main/index.d.ts +21 -0
- package/dist/datagrid/modals/export-data.d.ts +13 -0
- package/dist/datagrid/modals/export-modal.d.ts +9 -0
- package/dist/datagrid/modals/index.d.ts +6 -0
- package/dist/datagrid/modals/print-data.d.ts +16 -0
- package/dist/datagrid/modals/print-modal.d.ts +9 -0
- package/dist/datagrid/types/grid-props.d.ts +48 -0
- package/dist/datagrid/types/index.d.ts +1 -0
- package/dist/datagrid/utils/formatter.d.ts +39 -0
- package/dist/datagrid/utils/index.d.ts +1 -0
- package/dist/debug/index.d.ts +4 -0
- package/dist/debug/jsonpathpicker/ArchbaseJsonPathPicker.d.ts +37 -0
- package/dist/debug/jsonpathpicker/index.d.ts +1 -0
- package/dist/debug/jsonview/ArchbaseJsonViewDataRenderer.d.ts +34 -0
- package/dist/debug/jsonview/ArchbaseJsonViewDataTypeDetection.d.ts +8 -0
- package/dist/debug/jsonview/index.d.ts +11 -0
- package/dist/debug/objectinspector/ArchbaseDebugInspector.d.ts +23 -0
- package/dist/debug/objectinspector/ArchbaseFloatingWindow.d.ts +24 -0
- package/dist/debug/objectinspector/ArchbaseObjectInspector.d.ts +6 -0
- package/dist/debug/objectinspector/index.d.ts +3 -0
- package/dist/display/index.d.ts +4 -0
- package/dist/editors/ArchbaseAsyncMultiSelect.d.ts +112 -0
- package/dist/editors/ArchbaseAsyncSelect.context.d.ts +8 -0
- package/dist/editors/ArchbaseAsyncSelect.d.ts +102 -0
- package/dist/editors/ArchbaseAvatarEdit.d.ts +49 -0
- package/dist/editors/ArchbaseCheckbox.d.ts +45 -0
- package/dist/editors/ArchbaseChip.d.ts +43 -0
- package/dist/editors/ArchbaseChipGroup.d.ts +42 -0
- package/dist/editors/ArchbaseChipItem.d.ts +18 -0
- package/dist/editors/ArchbaseColorPicker.d.ts +3 -0
- package/dist/editors/ArchbaseCountdownProgress.d.ts +5 -0
- package/dist/editors/ArchbaseCronExpressionEdit.d.ts +16 -0
- package/dist/editors/ArchbaseCronExpressionEditor.d.ts +8 -0
- package/dist/editors/ArchbaseDatePicker.d.ts +2 -0
- package/dist/editors/ArchbaseDatePickerEdit.d.ts +85 -0
- package/dist/editors/ArchbaseDatePickerRange.d.ts +47 -0
- package/dist/editors/ArchbaseDateTimePickerEdit.d.ts +43 -0
- package/dist/editors/ArchbaseDateTimePickerRange.d.ts +58 -0
- package/dist/editors/ArchbaseEdit.d.ts +56 -0
- package/dist/editors/ArchbaseEdit.example.d.ts +8 -0
- package/dist/editors/ArchbaseFileAttachment.d.ts +17 -0
- package/dist/editors/ArchbaseImageEdit.d.ts +50 -0
- package/dist/editors/ArchbaseJsonEdit.d.ts +49 -0
- package/dist/editors/ArchbaseKeyValueEditor.d.ts +22 -0
- package/dist/editors/ArchbaseLookupEdit.d.ts +57 -0
- package/dist/editors/ArchbaseLookupNumber.d.ts +69 -0
- package/dist/editors/ArchbaseLookupSelect.d.ts +9 -0
- package/dist/editors/ArchbaseMarkdownEdit.d.ts +52 -0
- package/dist/editors/ArchbaseMaskEdit.d.ts +79 -0
- package/dist/editors/ArchbaseNumberEdit.d.ts +51 -0
- package/dist/editors/ArchbaseNumberInput.d.ts +2 -0
- package/dist/editors/ArchbaseOperationHoursEditor.d.ts +8 -0
- package/dist/editors/ArchbasePasswordEdit.d.ts +44 -0
- package/dist/editors/ArchbasePasswordInput.d.ts +2 -0
- package/dist/editors/ArchbaseRadio.d.ts +2 -0
- package/dist/editors/ArchbaseRadioGroup.d.ts +45 -0
- package/dist/editors/ArchbaseRadioItem.d.ts +12 -0
- package/dist/editors/ArchbaseRating.d.ts +52 -0
- package/dist/editors/ArchbaseRichTextEdit.d.ts +80 -0
- package/dist/editors/ArchbaseSelect.context.d.ts +8 -0
- package/dist/editors/ArchbaseSelect.d.ts +107 -0
- package/dist/editors/ArchbaseSelectItem.d.ts +15 -0
- package/dist/editors/ArchbaseSwitch.d.ts +53 -0
- package/dist/editors/ArchbaseTextArea.d.ts +47 -0
- package/dist/editors/ArchbaseTimeEdit.d.ts +52 -0
- package/dist/editors/ArchbaseTimeRangeSelector.d.ts +40 -0
- package/dist/editors/ArchbaseTreeSelect.d.ts +65 -0
- package/dist/editors/index.d.ts +81 -0
- package/dist/feedback/index.d.ts +4 -0
- package/dist/filters/ArchbaseCompositeFilters.d.ts +23 -0
- package/dist/filters/ArchbaseCompositeFilters.types.d.ts +303 -0
- package/dist/filters/ArchbaseCompositeFilters.utils.d.ts +69 -0
- package/dist/filters/components/FilterPill.d.ts +5 -0
- package/dist/filters/hooks/index.d.ts +4 -0
- package/dist/filters/hooks/useArchbaseFilterHistory.d.ts +24 -0
- package/dist/filters/hooks/useArchbaseFilterPresets.d.ts +23 -0
- package/dist/filters/hooks/useArchbaseFilters.d.ts +32 -0
- package/dist/filters/hooks/useArchbaseQuickFilters.d.ts +26 -0
- package/dist/filters/index.d.ts +8 -0
- package/dist/forms/index.d.ts +3 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/useArchbaseContainerDimensions.d.ts +4 -0
- package/dist/hooks/useArchbaseElementSizeArea.d.ts +6 -0
- package/dist/hooks/useArchbaseListContext.d.ts +2 -0
- package/dist/hooks/useArchbaseNavigateParams.d.ts +3 -0
- package/dist/hooks/useArchbaseVisible.d.ts +2 -0
- package/dist/image/ArchbaseImage.d.ts +33 -0
- package/dist/image/ArchbaseMicrosoftAvatar.d.ts +7 -0
- package/dist/image/editor/components/BasicFilters/BasicFilter.d.ts +9 -0
- package/dist/image/editor/components/CropprWrapper/ArchbaseCropperWrapper.d.ts +12 -0
- package/dist/image/editor/components/EditImage/ArchbaseEditImage.d.ts +11 -0
- package/dist/image/editor/components/Input/Input.d.ts +9 -0
- package/dist/image/editor/components/Tab/Tab.d.ts +23 -0
- package/dist/image/editor/functions/croppr/box.d.ts +95 -0
- package/dist/image/editor/functions/croppr/core.d.ts +121 -0
- package/dist/image/editor/functions/croppr/croppr.d.ts +68 -0
- package/dist/image/editor/functions/croppr/handle.d.ts +23 -0
- package/dist/image/editor/functions/croppr/index.d.ts +2 -0
- package/dist/image/editor/functions/croppr/touch.d.ts +10 -0
- package/dist/image/editor/functions/image-processing.d.ts +11 -0
- package/dist/image/editor/index.d.ts +12 -0
- package/dist/image/editor/models/index.models.d.ts +45 -0
- package/dist/image/index.d.ts +7 -0
- package/dist/image/languages.d.ts +299 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +18368 -0
- package/dist/jsonschema/ArchbaseJsonSchemaEditor.types.d.ts +131 -0
- package/dist/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.context.d.ts +7 -0
- package/dist/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.d.ts +9 -0
- package/dist/jsonschema/JsonSchemaEditor/advanced-boolean/index.d.ts +2 -0
- package/dist/jsonschema/JsonSchemaEditor/advanced-number/index.d.ts +2 -0
- package/dist/jsonschema/JsonSchemaEditor/advanced-string/index.d.ts +2 -0
- package/dist/jsonschema/JsonSchemaEditor/drop-plus/index.d.ts +10 -0
- package/dist/jsonschema/JsonSchemaEditor/index.d.ts +2 -0
- package/dist/jsonschema/JsonSchemaEditor/schema-advanced/index.d.ts +6 -0
- package/dist/jsonschema/JsonSchemaEditor/schema-array/index.d.ts +8 -0
- package/dist/jsonschema/JsonSchemaEditor/schema-item/index.d.ts +11 -0
- package/dist/jsonschema/JsonSchemaEditor/schema-object/index.d.ts +7 -0
- package/dist/jsonschema/JsonSchemaEditor/schema-root/index.d.ts +8 -0
- package/dist/jsonschema/JsonSchemaEditor/utils.d.ts +25 -0
- package/dist/jsonschema/JsonSchemaEditor/whoops.d.ts +2 -0
- package/dist/jsonschema/index.d.ts +2 -0
- package/dist/list/ArchbaseList.context.d.ts +27 -0
- package/dist/list/ArchbaseList.d.ts +104 -0
- package/dist/list/ArchbaseListItem.d.ts +59 -0
- package/dist/list/index.d.ts +8 -0
- package/dist/list/treeview/ArchbaseTreeView.d.ts +44 -0
- package/dist/list/treeview/ArchbaseTreeView.types.d.ts +40 -0
- package/dist/list/treeview/ArchbaseTreeViewItem.d.ts +19 -0
- package/dist/list/treeview/index.d.ts +5 -0
- package/dist/list-view/ArchbaseListViewTable.d.ts +111 -0
- package/dist/list-view/index.d.ts +2 -0
- package/dist/markdown/ArchbaseMarkdown.d.ts +23 -0
- package/dist/markdown/ArchbaseMarkdown.types.d.ts +181 -0
- package/dist/markdown/components/CodeBlock.d.ts +23 -0
- package/dist/markdown/components/LinkRenderer.d.ts +16 -0
- package/dist/markdown/index.d.ts +11 -0
- package/dist/masonry/ArchbaseMasonry.context.d.ts +21 -0
- package/dist/masonry/ArchbaseMasonry.d.ts +35 -0
- package/dist/masonry/index.d.ts +5 -0
- package/dist/navigation/index.d.ts +3 -0
- package/dist/notification/ArchbaseAlert.d.ts +22 -0
- package/dist/notification/ArchbaseDialog.d.ts +16 -0
- package/dist/notification/ArchbaseNotifications.d.ts +5 -0
- package/dist/notification/index.d.ts +4 -0
- package/dist/onboarding/ArchbaseOnboardingTour.d.ts +99 -0
- package/dist/onboarding/index.d.ts +2 -0
- package/dist/printer/ArchbaseThermalPrinter.d.ts +27 -0
- package/dist/printer/ArchbaseThermalPrinter.types.d.ts +199 -0
- package/dist/printer/index.d.ts +9 -0
- package/dist/printer/utils/escpos.d.ts +127 -0
- package/dist/spreadsheet/ArchbaseSpreadsheetImport.d.ts +4 -0
- package/dist/spreadsheet/ArchbaseSpreadsheetImport.types.d.ts +65 -0
- package/dist/spreadsheet/index.d.ts +2 -0
- package/dist/theme-editor/ArchbaseThemeEditor.d.ts +17 -0
- package/dist/theme-editor/ArchbaseThemeEditor.types.d.ts +187 -0
- package/dist/theme-editor/index.d.ts +9 -0
- package/dist/theme-editor/utils/themeExport.d.ts +198 -0
- package/dist/themes/ArchbaseThemeEditor.d.ts +49 -0
- package/dist/types/index.d.ts +106 -0
- package/dist/video/ArchbaseVideoPlayer.d.ts +18 -0
- package/dist/video/ArchbaseVideoPlayer.types.d.ts +200 -0
- package/dist/video/hooks/useVideoPlayer.d.ts +58 -0
- package/dist/video/index.d.ts +10 -0
- package/dist/viewers/ArchbasePDFViewer.annotations.d.ts +20 -0
- package/dist/viewers/ArchbasePDFViewer.d.ts +2 -0
- package/dist/viewers/ArchbasePDFViewer.toolbar.d.ts +20 -0
- package/dist/viewers/ArchbasePDFViewer.types.d.ts +68 -0
- package/dist/viewers/file-preview/ArchbaseFilePreviewer.d.ts +19 -0
- package/dist/viewers/file-preview/ArchbaseFilePreviewer.types.d.ts +153 -0
- package/dist/viewers/file-preview/index.d.ts +13 -0
- package/dist/viewers/file-preview/utils/fileTypeDetector.d.ts +33 -0
- package/dist/viewers/index.d.ts +5 -0
- package/package.json +154 -0
- package/src/admin/types.ts +73 -0
- package/src/arco.css +6 -0
- package/src/buttons/ActionsDemo.tsx +107 -0
- package/src/buttons/ArchbaseActionButtons.d.ts.map +1 -0
- package/src/buttons/ArchbaseActionButtons.tsx +387 -0
- package/src/buttons/index.d.ts.map +1 -0
- package/src/buttons/index.ts +7 -0
- package/src/charts/ArchbaseTimeline.d.ts.map +1 -0
- package/src/charts/ArchbaseTimeline.tsx +332 -0
- package/src/charts/index.d.ts.map +1 -0
- package/src/charts/index.ts +5 -0
- package/src/charts/vis-timeline/ArchbaseVisTimeline.tsx +401 -0
- package/src/charts/vis-timeline/ArchbaseVisTimeline.types.ts +294 -0
- package/src/charts/vis-timeline/index.ts +36 -0
- package/src/charts/vis-timeline/utils/timelineOptions.ts +213 -0
- package/src/datagrid/components/index.d.ts.map +1 -0
- package/src/datagrid/components/index.tsx +14 -0
- package/src/datagrid/components/pagination/grid-pagination.d.ts.map +1 -0
- package/src/datagrid/components/pagination/grid-pagination.tsx +150 -0
- package/src/datagrid/components/render/archbase-data-grid-item-renderer.tsx +26 -0
- package/src/datagrid/components/toolbar/global-search-input.d.ts.map +1 -0
- package/src/datagrid/components/toolbar/global-search-input.tsx +118 -0
- package/src/datagrid/components/toolbar/grid-toolbar.d.ts.map +1 -0
- package/src/datagrid/components/toolbar/grid-toolbar.tsx +106 -0
- package/src/datagrid/hooks/index.d.ts.map +1 -0
- package/src/datagrid/hooks/index.tsx +18 -0
- package/src/datagrid/hooks/use-grid-data-stable-rendering.d.ts.map +1 -0
- package/src/datagrid/hooks/use-grid-data-stable-rendering.ts +168 -0
- package/src/datagrid/hooks/use-grid-data.d.ts.map +1 -0
- package/src/datagrid/hooks/use-grid-data.tsx +598 -0
- package/src/datagrid/hooks/use-grid-details-panel.d.ts.map +1 -0
- package/src/datagrid/hooks/use-grid-details-panel.ts +316 -0
- package/src/datagrid/index.d.ts.map +1 -0
- package/src/datagrid/index.tsx +12 -0
- package/src/datagrid/main/archbase-data-grid-column.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-column.ts +46 -0
- package/src/datagrid/main/archbase-data-grid-formatters.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-formatters.tsx +384 -0
- package/src/datagrid/main/archbase-data-grid-pagination.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-pagination.tsx +63 -0
- package/src/datagrid/main/archbase-data-grid-toolbar.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-toolbar.tsx +160 -0
- package/src/datagrid/main/archbase-data-grid-types.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-types.tsx +327 -0
- package/src/datagrid/main/archbase-data-grid-utils.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid-utils.ts +494 -0
- package/src/datagrid/main/archbase-data-grid.d.ts.map +1 -0
- package/src/datagrid/main/archbase-data-grid.tsx +1462 -0
- package/src/datagrid/main/archbase-detail-panel-component.d.ts.map +1 -0
- package/src/datagrid/main/archbase-detail-panel-component.tsx +186 -0
- package/src/datagrid/main/archbase-expand-button.d.ts.map +1 -0
- package/src/datagrid/main/archbase-expand-button.tsx +83 -0
- package/src/datagrid/main/archbase-grid-popover.d.ts.map +1 -0
- package/src/datagrid/main/archbase-grid-popover.tsx +188 -0
- package/src/datagrid/main/grid-row-actions.d.ts.map +1 -0
- package/src/datagrid/main/grid-row-actions.tsx +97 -0
- package/src/datagrid/main/index.d.ts.map +1 -0
- package/src/datagrid/main/index.tsx +75 -0
- package/src/datagrid/modals/export-data.d.ts.map +1 -0
- package/src/datagrid/modals/export-data.tsx +183 -0
- package/src/datagrid/modals/export-modal.d.ts.map +1 -0
- package/src/datagrid/modals/export-modal.tsx +168 -0
- package/src/datagrid/modals/index.d.ts.map +1 -0
- package/src/datagrid/modals/index.tsx +6 -0
- package/src/datagrid/modals/print-data.d.ts.map +1 -0
- package/src/datagrid/modals/print-data.tsx +267 -0
- package/src/datagrid/modals/print-modal.d.ts.map +1 -0
- package/src/datagrid/modals/print-modal.tsx +200 -0
- package/src/datagrid/types/grid-props.d.ts.map +1 -0
- package/src/datagrid/types/grid-props.tsx +53 -0
- package/src/datagrid/types/index.d.ts.map +1 -0
- package/src/datagrid/types/index.tsx +1 -0
- package/src/datagrid/utils/formatter.d.ts.map +1 -0
- package/src/datagrid/utils/formatter.tsx +308 -0
- package/src/datagrid/utils/index.d.ts.map +1 -0
- package/src/datagrid/utils/index.tsx +1 -0
- package/src/debug/index.d.ts.map +1 -0
- package/src/debug/index.ts +4 -0
- package/src/debug/jsonpathpicker/ArchbaseJsonPathPicker.css +46 -0
- package/src/debug/jsonpathpicker/ArchbaseJsonPathPicker.d.ts.map +1 -0
- package/src/debug/jsonpathpicker/ArchbaseJsonPathPicker.tsx +341 -0
- package/src/debug/jsonpathpicker/index.d.ts.map +1 -0
- package/src/debug/jsonpathpicker/index.ts +1 -0
- package/src/debug/jsonview/.eslintrc +5 -0
- package/src/debug/jsonview/ArchbaseJsonViewDataRenderer.d.ts.map +1 -0
- package/src/debug/jsonview/ArchbaseJsonViewDataRenderer.tsx +206 -0
- package/src/debug/jsonview/ArchbaseJsonViewDataTypeDetection.d.ts.map +1 -0
- package/src/debug/jsonview/ArchbaseJsonViewDataTypeDetection.ts +31 -0
- package/src/debug/jsonview/index.d.ts.map +1 -0
- package/src/debug/jsonview/index.tsx +60 -0
- package/src/debug/jsonview/styles.module.css +118 -0
- package/src/debug/jsonview/styles.module.css.d.ts +4 -0
- package/src/debug/objectinspector/ArchbaseDebugInspector.d.ts.map +1 -0
- package/src/debug/objectinspector/ArchbaseDebugInspector.tsx +79 -0
- package/src/debug/objectinspector/ArchbaseFloatingWindow.css +70 -0
- package/src/debug/objectinspector/ArchbaseFloatingWindow.d.ts.map +1 -0
- package/src/debug/objectinspector/ArchbaseFloatingWindow.tsx +266 -0
- package/src/debug/objectinspector/ArchbaseObjectInspector.d.ts.map +1 -0
- package/src/debug/objectinspector/ArchbaseObjectInspector.tsx +21 -0
- package/src/debug/objectinspector/index.d.ts.map +1 -0
- package/src/debug/objectinspector/index.ts +3 -0
- package/src/display/index.d.ts.map +1 -0
- package/src/display/index.ts +5 -0
- package/src/editors/ArchbaseAsyncMultiSelect.d.ts.map +1 -0
- package/src/editors/ArchbaseAsyncMultiSelect.tsx +667 -0
- package/src/editors/ArchbaseAsyncSelect.context.d.ts.map +1 -0
- package/src/editors/ArchbaseAsyncSelect.context.ts +9 -0
- package/src/editors/ArchbaseAsyncSelect.d.ts.map +1 -0
- package/src/editors/ArchbaseAsyncSelect.tsx +581 -0
- package/src/editors/ArchbaseAvatarEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseAvatarEdit.tsx +625 -0
- package/src/editors/ArchbaseCheckbox.d.ts.map +1 -0
- package/src/editors/ArchbaseCheckbox.tsx +250 -0
- package/src/editors/ArchbaseChip.d.ts.map +1 -0
- package/src/editors/ArchbaseChip.tsx +233 -0
- package/src/editors/ArchbaseChipGroup.d.ts.map +1 -0
- package/src/editors/ArchbaseChipGroup.tsx +282 -0
- package/src/editors/ArchbaseChipItem.d.ts.map +1 -0
- package/src/editors/ArchbaseChipItem.tsx +21 -0
- package/src/editors/ArchbaseColorPicker.d.ts.map +1 -0
- package/src/editors/ArchbaseColorPicker.tsx +7 -0
- package/src/editors/ArchbaseCountdownProgress.d.ts.map +1 -0
- package/src/editors/ArchbaseCountdownProgress.tsx +57 -0
- package/src/editors/ArchbaseCronExpressionEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseCronExpressionEdit.tsx +86 -0
- package/src/editors/ArchbaseCronExpressionEditor.d.ts.map +1 -0
- package/src/editors/ArchbaseCronExpressionEditor.tsx +133 -0
- package/src/editors/ArchbaseDatePicker.tsx +3 -0
- package/src/editors/ArchbaseDatePickerEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseDatePickerEdit.tsx +785 -0
- package/src/editors/ArchbaseDatePickerRange.d.ts.map +1 -0
- package/src/editors/ArchbaseDatePickerRange.tsx +142 -0
- package/src/editors/ArchbaseDateTimePickerEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseDateTimePickerEdit.tsx +259 -0
- package/src/editors/ArchbaseDateTimePickerRange.d.ts.map +1 -0
- package/src/editors/ArchbaseDateTimePickerRange.tsx +220 -0
- package/src/editors/ArchbaseEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseEdit.example.tsx +240 -0
- package/src/editors/ArchbaseEdit.tsx +325 -0
- package/src/editors/ArchbaseFileAttachment.d.ts.map +1 -0
- package/src/editors/ArchbaseFileAttachment.tsx +259 -0
- package/src/editors/ArchbaseImageEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseImageEdit.tsx +255 -0
- package/src/editors/ArchbaseJsonEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseJsonEdit.tsx +257 -0
- package/src/editors/ArchbaseKeyValueEditor.d.ts.map +1 -0
- package/src/editors/ArchbaseKeyValueEditor.tsx +180 -0
- package/src/editors/ArchbaseLookupEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseLookupEdit.tsx +368 -0
- package/src/editors/ArchbaseLookupNumber.d.ts.map +1 -0
- package/src/editors/ArchbaseLookupNumber.tsx +390 -0
- package/src/editors/ArchbaseLookupSelect.d.ts.map +1 -0
- package/src/editors/ArchbaseLookupSelect.tsx +225 -0
- package/src/editors/ArchbaseMarkdownEdit.tsx +367 -0
- package/src/editors/ArchbaseMaskEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseMaskEdit.tsx +346 -0
- package/src/editors/ArchbaseNumberEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseNumberEdit.tsx +626 -0
- package/src/editors/ArchbaseNumberInput.tsx +3 -0
- package/src/editors/ArchbaseOperationHoursEditor.d.ts.map +1 -0
- package/src/editors/ArchbaseOperationHoursEditor.tsx +206 -0
- package/src/editors/ArchbasePasswordEdit.d.ts.map +1 -0
- package/src/editors/ArchbasePasswordEdit.tsx +265 -0
- package/src/editors/ArchbasePasswordInput.tsx +3 -0
- package/src/editors/ArchbaseRadio.tsx +3 -0
- package/src/editors/ArchbaseRadioGroup.d.ts.map +1 -0
- package/src/editors/ArchbaseRadioGroup.tsx +293 -0
- package/src/editors/ArchbaseRadioItem.d.ts.map +1 -0
- package/src/editors/ArchbaseRadioItem.tsx +14 -0
- package/src/editors/ArchbaseRating.d.ts.map +1 -0
- package/src/editors/ArchbaseRating.tsx +236 -0
- package/src/editors/ArchbaseRichTextEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseRichTextEdit.tsx +435 -0
- package/src/editors/ArchbaseSelect.context.d.ts.map +1 -0
- package/src/editors/ArchbaseSelect.context.ts +9 -0
- package/src/editors/ArchbaseSelect.d.ts.map +1 -0
- package/src/editors/ArchbaseSelect.tsx +550 -0
- package/src/editors/ArchbaseSelectItem.d.ts.map +1 -0
- package/src/editors/ArchbaseSelectItem.tsx +18 -0
- package/src/editors/ArchbaseSwitch.d.ts.map +1 -0
- package/src/editors/ArchbaseSwitch.tsx +266 -0
- package/src/editors/ArchbaseTextArea.d.ts.map +1 -0
- package/src/editors/ArchbaseTextArea.tsx +263 -0
- package/src/editors/ArchbaseTimeEdit.d.ts.map +1 -0
- package/src/editors/ArchbaseTimeEdit.tsx +319 -0
- package/src/editors/ArchbaseTimeRangeSelector.d.ts.map +1 -0
- package/src/editors/ArchbaseTimeRangeSelector.tsx +397 -0
- package/src/editors/ArchbaseTreeSelect.d.ts.map +1 -0
- package/src/editors/ArchbaseTreeSelect.tsx +434 -0
- package/src/editors/index.d.ts.map +1 -0
- package/src/editors/index.tsx +121 -0
- package/src/editors/intro.mdx +4 -0
- package/src/feedback/index.d.ts.map +1 -0
- package/src/feedback/index.ts +5 -0
- package/src/filters/ArchbaseCompositeFilters.tsx +696 -0
- package/src/filters/ArchbaseCompositeFilters.types.ts +402 -0
- package/src/filters/ArchbaseCompositeFilters.utils.ts +378 -0
- package/src/filters/components/FilterPill.tsx +100 -0
- package/src/filters/hooks/index.ts +4 -0
- package/src/filters/hooks/useArchbaseFilterHistory.ts +111 -0
- package/src/filters/hooks/useArchbaseFilterPresets.ts +157 -0
- package/src/filters/hooks/useArchbaseFilters.ts +279 -0
- package/src/filters/hooks/useArchbaseQuickFilters.ts +80 -0
- package/src/filters/index.ts +55 -0
- package/src/forms/index.d.ts.map +1 -0
- package/src/forms/index.ts +4 -0
- package/src/hooks/index.d.ts.map +1 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/useArchbaseContainerDimensions.d.ts.map +1 -0
- package/src/hooks/useArchbaseContainerDimensions.ts +28 -0
- package/src/hooks/useArchbaseElementSizeArea.d.ts.map +1 -0
- package/src/hooks/useArchbaseElementSizeArea.ts +39 -0
- package/src/hooks/useArchbaseListContext.d.ts.map +1 -0
- package/src/hooks/useArchbaseListContext.ts +10 -0
- package/src/hooks/useArchbaseNavigateParams.d.ts.map +1 -0
- package/src/hooks/useArchbaseNavigateParams.ts +17 -0
- package/src/hooks/useArchbaseVisible.d.ts.map +1 -0
- package/src/hooks/useArchbaseVisible.ts +35 -0
- package/src/image/.placeholder +0 -0
- package/src/image/ArchbaseImage.d.ts.map +1 -0
- package/src/image/ArchbaseImage.tsx +56 -0
- package/src/image/ArchbaseMicrosoftAvatar.d.ts.map +1 -0
- package/src/image/ArchbaseMicrosoftAvatar.tsx +50 -0
- package/src/image/editor/components/BasicFilters/BasicFilter.d.ts.map +1 -0
- package/src/image/editor/components/BasicFilters/BasicFilter.tsx +179 -0
- package/src/image/editor/components/CropprWrapper/ArchbaseCropper.scss +73 -0
- package/src/image/editor/components/CropprWrapper/ArchbaseCropperWrapper.d.ts.map +1 -0
- package/src/image/editor/components/CropprWrapper/ArchbaseCropperWrapper.tsx +50 -0
- package/src/image/editor/components/EditImage/ArchbaseEditImage.d.ts.map +1 -0
- package/src/image/editor/components/EditImage/ArchbaseEditImage.scss +221 -0
- package/src/image/editor/components/EditImage/ArchbaseEditImage.tsx +469 -0
- package/src/image/editor/components/Input/Input.d.ts.map +1 -0
- package/src/image/editor/components/Input/Input.tsx +70 -0
- package/src/image/editor/components/Tab/Tab.d.ts.map +1 -0
- package/src/image/editor/components/Tab/Tab.tsx +150 -0
- package/src/image/editor/components/Tab/TabsStyles.scss +72 -0
- package/src/image/editor/functions/croppr/box.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/box.ts +272 -0
- package/src/image/editor/functions/croppr/core.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/core.ts +820 -0
- package/src/image/editor/functions/croppr/croppr.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/croppr.ts +136 -0
- package/src/image/editor/functions/croppr/handle.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/handle.ts +75 -0
- package/src/image/editor/functions/croppr/index.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/index.ts +4 -0
- package/src/image/editor/functions/croppr/touch.d.ts.map +1 -0
- package/src/image/editor/functions/croppr/touch.ts +41 -0
- package/src/image/editor/functions/image-processing.d.ts.map +1 -0
- package/src/image/editor/functions/image-processing.ts +202 -0
- package/src/image/editor/image_editor_styles.scss +284 -0
- package/src/image/editor/index.d.ts.map +1 -0
- package/src/image/editor/index.tsx +437 -0
- package/src/image/editor/models/index.models.d.ts.map +1 -0
- package/src/image/editor/models/index.models.ts +48 -0
- package/src/image/index.d.ts.map +1 -0
- package/src/image/index.ts +7 -0
- package/src/image/intro.mdx +4 -0
- package/src/image/languages.d.ts.map +1 -0
- package/src/image/languages.ts +302 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.ts +50 -0
- package/src/jsonschema/ArchbaseJsonSchemaEditor.types.d.ts.map +1 -0
- package/src/jsonschema/ArchbaseJsonSchemaEditor.types.ts +171 -0
- package/src/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.context.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.context.tsx +8 -0
- package/src/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/ArchbaseJsonSchemaEditor.tsx +99 -0
- package/src/jsonschema/JsonSchemaEditor/JsonSchemaEditor.scss +19 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-boolean/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-boolean/index.tsx +33 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-number/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-number/index.tsx +119 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-string/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/advanced-string/index.tsx +146 -0
- package/src/jsonschema/JsonSchemaEditor/drop-plus/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/drop-plus/index.tsx +80 -0
- package/src/jsonschema/JsonSchemaEditor/index.ts +2 -0
- package/src/jsonschema/JsonSchemaEditor/schema-advanced/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/schema-advanced/index.tsx +32 -0
- package/src/jsonschema/JsonSchemaEditor/schema-array/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/schema-array/index.tsx +164 -0
- package/src/jsonschema/JsonSchemaEditor/schema-item/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/schema-item/index.tsx +213 -0
- package/src/jsonschema/JsonSchemaEditor/schema-object/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/schema-object/index.tsx +68 -0
- package/src/jsonschema/JsonSchemaEditor/schema-root/index.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/schema-root/index.tsx +103 -0
- package/src/jsonschema/JsonSchemaEditor/utils.d.ts.map +1 -0
- package/src/jsonschema/JsonSchemaEditor/utils.ts +195 -0
- package/src/jsonschema/JsonSchemaEditor/whoops.tsx +79 -0
- package/src/jsonschema/index.d.ts.map +1 -0
- package/src/jsonschema/index.ts +2 -0
- package/src/list/ArchbaseList.context.d.ts.map +1 -0
- package/src/list/ArchbaseList.context.ts +28 -0
- package/src/list/ArchbaseList.d.ts.map +1 -0
- package/src/list/ArchbaseList.tsx +533 -0
- package/src/list/ArchbaseListItem.d.ts.map +1 -0
- package/src/list/ArchbaseListItem.tsx +161 -0
- package/src/list/index.d.ts.map +1 -0
- package/src/list/index.ts +9 -0
- package/src/list/treeview/ArchbaseTreeView.d.ts.map +1 -0
- package/src/list/treeview/ArchbaseTreeView.module.css +66 -0
- package/src/list/treeview/ArchbaseTreeView.tsx +657 -0
- package/src/list/treeview/ArchbaseTreeView.types.d.ts.map +1 -0
- package/src/list/treeview/ArchbaseTreeView.types.tsx +42 -0
- package/src/list/treeview/ArchbaseTreeViewItem.d.ts.map +1 -0
- package/src/list/treeview/ArchbaseTreeViewItem.tsx +210 -0
- package/src/list/treeview/index.d.ts.map +1 -0
- package/src/list/treeview/index.ts +5 -0
- package/src/list-view/ArchbaseListViewTable.tsx +150 -0
- package/src/list-view/index.ts +2 -0
- package/src/markdown/ArchbaseMarkdown.tsx +463 -0
- package/src/markdown/ArchbaseMarkdown.types.ts +213 -0
- package/src/markdown/components/CodeBlock.tsx +197 -0
- package/src/markdown/components/LinkRenderer.tsx +98 -0
- package/src/markdown/index.ts +29 -0
- package/src/masonry/ArchbaseMasonry.context.d.ts.map +1 -0
- package/src/masonry/ArchbaseMasonry.context.ts +24 -0
- package/src/masonry/ArchbaseMasonry.d.ts.map +1 -0
- package/src/masonry/ArchbaseMasonry.tsx +156 -0
- package/src/masonry/index.d.ts.map +1 -0
- package/src/masonry/index.ts +5 -0
- package/src/navigation/index.d.ts.map +1 -0
- package/src/navigation/index.ts +4 -0
- package/src/notification/ArchbaseAlert.d.ts.map +1 -0
- package/src/notification/ArchbaseAlert.tsx +77 -0
- package/src/notification/ArchbaseDialog.d.ts.map +1 -0
- package/src/notification/ArchbaseDialog.tsx +212 -0
- package/src/notification/ArchbaseNotifications.d.ts.map +1 -0
- package/src/notification/ArchbaseNotifications.tsx +64 -0
- package/src/notification/index.d.ts.map +1 -0
- package/src/notification/index.ts +4 -0
- package/src/notification/intro.mdx +4 -0
- package/src/onboarding/ArchbaseOnboardingTour.tsx +147 -0
- package/src/onboarding/index.ts +2 -0
- package/src/printer/ArchbaseThermalPrinter.tsx +465 -0
- package/src/printer/ArchbaseThermalPrinter.types.ts +221 -0
- package/src/printer/index.ts +54 -0
- package/src/printer/utils/escpos.ts +531 -0
- package/src/spreadsheet/ArchbaseSpreadsheetImport.tsx +223 -0
- package/src/spreadsheet/ArchbaseSpreadsheetImport.types.ts +66 -0
- package/src/spreadsheet/index.ts +10 -0
- package/src/theme-editor/ArchbaseThemeEditor.tsx +728 -0
- package/src/theme-editor/ArchbaseThemeEditor.types.ts +207 -0
- package/src/theme-editor/index.ts +45 -0
- package/src/theme-editor/utils/themeExport.ts +351 -0
- package/src/themes/.placeholder +0 -0
- package/src/themes/ArchbaseThemeEditor.d.ts.map +1 -0
- package/src/themes/ArchbaseThemeEditor.tsx +110 -0
- package/src/treeviews.scss +80 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.ts +115 -0
- package/src/video/ArchbaseVideoPlayer.tsx +706 -0
- package/src/video/ArchbaseVideoPlayer.types.ts +221 -0
- package/src/video/hooks/useVideoPlayer.ts +362 -0
- package/src/video/index.ts +28 -0
- package/src/viewers/ArchbasePDFViewer.annotations.tsx +423 -0
- package/src/viewers/ArchbasePDFViewer.toolbar.tsx +218 -0
- package/src/viewers/ArchbasePDFViewer.tsx +317 -0
- package/src/viewers/ArchbasePDFViewer.types.ts +85 -0
- package/src/viewers/file-preview/ArchbaseFilePreviewer.tsx +756 -0
- package/src/viewers/file-preview/ArchbaseFilePreviewer.types.ts +186 -0
- package/src/viewers/file-preview/index.ts +43 -0
- package/src/viewers/file-preview/utils/fileTypeDetector.ts +317 -0
- package/src/viewers/index.ts +17 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArchbaseVisTimeline - Timeline Component (vis-timeline wrapper)
|
|
3
|
+
*
|
|
4
|
+
* Timeline visual avançada baseada em vis-timeline
|
|
5
|
+
* Suporta grupos, ranges, zoom, pan, e muito mais.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Main component
|
|
9
|
+
export { ArchbaseVisTimeline } from './ArchbaseVisTimeline';
|
|
10
|
+
|
|
11
|
+
// Types
|
|
12
|
+
export type {
|
|
13
|
+
ArchbaseVisTimelineProps,
|
|
14
|
+
TimelineItem,
|
|
15
|
+
TimelineGroup,
|
|
16
|
+
TimelineItemType,
|
|
17
|
+
TimelineEvents,
|
|
18
|
+
TimelineOptions,
|
|
19
|
+
TimelineZoomOptions,
|
|
20
|
+
TimelineMoveOptions,
|
|
21
|
+
TimelineOrientation,
|
|
22
|
+
TimelineLayout,
|
|
23
|
+
TimelineDateFormatOptions,
|
|
24
|
+
} from './ArchbaseVisTimeline.types';
|
|
25
|
+
|
|
26
|
+
// Utils
|
|
27
|
+
export {
|
|
28
|
+
DEFAULT_TIMELINE_OPTIONS,
|
|
29
|
+
mergeTimelineOptions,
|
|
30
|
+
normalizeTimelineItems,
|
|
31
|
+
normalizeTimelineGroups,
|
|
32
|
+
normalizeDate,
|
|
33
|
+
normalizeRange,
|
|
34
|
+
formatTimelineDate,
|
|
35
|
+
formatDuration,
|
|
36
|
+
} from './utils/timelineOptions';
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { TimelineOptions, TimelineOrientation, TimelineLayout } from '../ArchbaseVisTimeline.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Opções padrão para a timeline
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_TIMELINE_OPTIONS: Partial<TimelineOptions> = {
|
|
7
|
+
height: '100%',
|
|
8
|
+
width: '100%',
|
|
9
|
+
minHeight: 200,
|
|
10
|
+
orientation: 'bottom',
|
|
11
|
+
autoResize: true,
|
|
12
|
+
showCurrentTime: true,
|
|
13
|
+
showTooltips: true,
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
zoomable: true,
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
moveable: true,
|
|
18
|
+
selectable: true,
|
|
19
|
+
multiselect: true,
|
|
20
|
+
editable: false,
|
|
21
|
+
stack: true,
|
|
22
|
+
locale: 'pt-BR',
|
|
23
|
+
format: {
|
|
24
|
+
minorLabels: {
|
|
25
|
+
millisecond: 'SSS',
|
|
26
|
+
second: 's',
|
|
27
|
+
minute: 'HH:mm',
|
|
28
|
+
hour: 'HH:mm',
|
|
29
|
+
weekday: 'ddd D',
|
|
30
|
+
day: 'D',
|
|
31
|
+
month: 'MMM',
|
|
32
|
+
year: 'YYYY',
|
|
33
|
+
},
|
|
34
|
+
majorLabels: {
|
|
35
|
+
millisecond: 'HH:mm:ss',
|
|
36
|
+
second: 'D MMMM HH:mm',
|
|
37
|
+
minute: 'ddd D MMMM',
|
|
38
|
+
hour: 'ddd D MMMM',
|
|
39
|
+
weekday: 'MMMM YYYY',
|
|
40
|
+
day: 'MMMM YYYY',
|
|
41
|
+
month: 'YYYY',
|
|
42
|
+
year: '',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Opções por orientação
|
|
49
|
+
*/
|
|
50
|
+
export const ORIENTATION_OPTIONS: Record<TimelineOrientation, Partial<TimelineOptions>> = {
|
|
51
|
+
bottom: { orientation: 'bottom' },
|
|
52
|
+
top: { orientation: 'top' },
|
|
53
|
+
none: { orientation: 'none' },
|
|
54
|
+
both: { orientation: 'both' },
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Opções por layout
|
|
59
|
+
*/
|
|
60
|
+
export const LAYOUT_OPTIONS: Record<TimelineLayout, Partial<TimelineOptions>> = {
|
|
61
|
+
box: { layout: 'box' },
|
|
62
|
+
list: { layout: 'list' },
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Merge opções customizadas com padrão
|
|
67
|
+
*/
|
|
68
|
+
export function mergeTimelineOptions(
|
|
69
|
+
custom?: Partial<TimelineOptions>
|
|
70
|
+
): TimelineOptions {
|
|
71
|
+
return {
|
|
72
|
+
...DEFAULT_TIMELINE_OPTIONS,
|
|
73
|
+
...custom,
|
|
74
|
+
format: {
|
|
75
|
+
...DEFAULT_TIMELINE_OPTIONS.format,
|
|
76
|
+
...(custom?.format || {}),
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Converte itens para formato vis-timeline
|
|
83
|
+
*/
|
|
84
|
+
export function normalizeTimelineItems<T extends Record<string, any>>(
|
|
85
|
+
items: T[]
|
|
86
|
+
): Array<T & { start: Date; end?: Date; content: string; type?: string }> {
|
|
87
|
+
return items.map((item) => ({
|
|
88
|
+
...item,
|
|
89
|
+
start: normalizeDate(item.start),
|
|
90
|
+
end: item.end ? normalizeDate(item.end) : undefined,
|
|
91
|
+
content: typeof item.content === 'string' ? item.content : String(item.content),
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Converte grupos para formato vis-timeline
|
|
97
|
+
*/
|
|
98
|
+
export function normalizeTimelineGroups<T extends Record<string, any>>(
|
|
99
|
+
groups: T[]
|
|
100
|
+
): Array<T & { content: string }> {
|
|
101
|
+
return groups.map((group) => ({
|
|
102
|
+
...group,
|
|
103
|
+
content: typeof group.content === 'string' ? group.content : String(group.content),
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Normaliza data para objeto Date
|
|
109
|
+
*/
|
|
110
|
+
export function normalizeDate(date: Date | string | number): Date {
|
|
111
|
+
if (date instanceof Date) {
|
|
112
|
+
return date;
|
|
113
|
+
}
|
|
114
|
+
if (typeof date === 'string') {
|
|
115
|
+
return new Date(date);
|
|
116
|
+
}
|
|
117
|
+
if (typeof date === 'number') {
|
|
118
|
+
return new Date(date);
|
|
119
|
+
}
|
|
120
|
+
return new Date();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Converte range para array de datas
|
|
125
|
+
*/
|
|
126
|
+
export function normalizeRange(
|
|
127
|
+
range?: [Date | string | number, Date | string | number]
|
|
128
|
+
): [Date, Date] | undefined {
|
|
129
|
+
if (!range) return undefined;
|
|
130
|
+
return [normalizeDate(range[0]), normalizeDate(range[1])];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Gera opções de cores para timeline
|
|
135
|
+
*/
|
|
136
|
+
export function generateColorOptions(
|
|
137
|
+
itemColor?: string,
|
|
138
|
+
groupColor?: string,
|
|
139
|
+
backgroundColor?: string
|
|
140
|
+
): Partial<TimelineOptions> {
|
|
141
|
+
const options: any = {};
|
|
142
|
+
|
|
143
|
+
if (backgroundColor) {
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
options.backgroundColor = backgroundColor;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (itemColor) {
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
options.locale = {
|
|
151
|
+
current: 'Agora',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return options;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Mapeia tipos de itens para tipos vis-timeline
|
|
160
|
+
*/
|
|
161
|
+
export const ITEM_TYPE_MAP = {
|
|
162
|
+
box: 'box',
|
|
163
|
+
point: 'point',
|
|
164
|
+
range: 'range',
|
|
165
|
+
background: 'background',
|
|
166
|
+
} as const;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Calcula margem apropriada baseado no tipo de item
|
|
170
|
+
*/
|
|
171
|
+
export function calculateItemMargin(type: string = 'box'): { horizontal: number; vertical: number } {
|
|
172
|
+
const margins: Record<string, { horizontal: number; vertical: number }> = {
|
|
173
|
+
background: { horizontal: 0, vertical: 0 },
|
|
174
|
+
box: { horizontal: 10, vertical: 5 },
|
|
175
|
+
point: { horizontal: 10, vertical: 5 },
|
|
176
|
+
range: { horizontal: 10, vertical: 5 },
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
return margins[type] || margins.box;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Formata data para exibição
|
|
184
|
+
*/
|
|
185
|
+
export function formatTimelineDate(date: Date, format: 'short' | 'long' = 'short'): string {
|
|
186
|
+
const options: Intl.DateTimeFormatOptions =
|
|
187
|
+
format === 'short'
|
|
188
|
+
? { day: '2-digit', month: '2-digit', year: 'numeric' }
|
|
189
|
+
: { day: 'numeric', month: 'long', year: 'numeric', hour: '2-digit', minute: '2-digit' };
|
|
190
|
+
|
|
191
|
+
return date.toLocaleDateString('pt-BR', options);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Calcula duração entre duas datas em formato legível
|
|
196
|
+
*/
|
|
197
|
+
export function formatDuration(start: Date, end: Date): string {
|
|
198
|
+
const diffMs = end.getTime() - start.getTime();
|
|
199
|
+
const diffSecs = Math.floor(diffMs / 1000);
|
|
200
|
+
const diffMins = Math.floor(diffSecs / 60);
|
|
201
|
+
const diffHours = Math.floor(diffMins / 60);
|
|
202
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
203
|
+
|
|
204
|
+
if (diffSecs < 60) {
|
|
205
|
+
return `${diffSecs}s`;
|
|
206
|
+
} else if (diffMins < 60) {
|
|
207
|
+
return `${diffMins}m`;
|
|
208
|
+
} else if (diffHours < 24) {
|
|
209
|
+
return `${diffHours}h`;
|
|
210
|
+
} else {
|
|
211
|
+
return `${diffDays}d`;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGhE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGzE,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Toolbar components
|
|
2
|
+
export { default as GlobalSearchInput } from './toolbar/global-search-input';
|
|
3
|
+
export { default as GridToolbar } from './toolbar/grid-toolbar';
|
|
4
|
+
|
|
5
|
+
// Pagination components
|
|
6
|
+
export { default as GridPagination } from './pagination/grid-pagination';
|
|
7
|
+
|
|
8
|
+
export { ArchbaseItemRender} from "./render/archbase-data-grid-item-renderer";
|
|
9
|
+
export type {ArchbaseItemRenderProps, ArchbaseItemRenderType } from "./render/archbase-data-grid-item-renderer.tsx";
|
|
10
|
+
|
|
11
|
+
// Re-export types
|
|
12
|
+
export * from '../types';
|
|
13
|
+
|
|
14
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-pagination.d.ts","sourceRoot":"","sources":["grid-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAyIpD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Group, Select, Text, ActionIcon, Pagination, Box } from '@mantine/core';
|
|
3
|
+
import { useArchbaseTranslation } from '@archbase/core';
|
|
4
|
+
import { IconChevronLeft, IconChevronRight } from '@tabler/icons-react';
|
|
5
|
+
import { PaginationProps } from '../../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Componente de paginação para o grid
|
|
9
|
+
*/
|
|
10
|
+
export const GridPagination: React.FC<PaginationProps> = ({
|
|
11
|
+
currentPage,
|
|
12
|
+
pageSize,
|
|
13
|
+
totalRecords,
|
|
14
|
+
pageSizeOptions = [10, 20, 30, 50, 100],
|
|
15
|
+
onPageChange,
|
|
16
|
+
onPageSizeChange,
|
|
17
|
+
showPageSizeSelector = true,
|
|
18
|
+
showNavigationButtons = true,
|
|
19
|
+
showRecordInfo = true,
|
|
20
|
+
labels
|
|
21
|
+
}) => {
|
|
22
|
+
const { t } = useArchbaseTranslation();
|
|
23
|
+
const tString = (key: string) => String(t(key));
|
|
24
|
+
|
|
25
|
+
// Garantir que os valores sejam números válidos
|
|
26
|
+
const safePageSize = isNaN(pageSize) || pageSize <= 0 ? 10 : pageSize;
|
|
27
|
+
const safeTotalRecords = isNaN(totalRecords) || totalRecords < 0 ? 0 : totalRecords;
|
|
28
|
+
const safeCurrentPage = isNaN(currentPage) || currentPage <= 0 ? 1 : currentPage;
|
|
29
|
+
|
|
30
|
+
// Calcular total de páginas com proteção contra divisão por zero
|
|
31
|
+
const totalPages = (() => {
|
|
32
|
+
// Se pageSize for zero ou inválido, retorna 1
|
|
33
|
+
if (safePageSize <= 0) return 1;
|
|
34
|
+
|
|
35
|
+
// Calcula o número de páginas
|
|
36
|
+
const calculatedPages = Math.ceil(safeTotalRecords / safePageSize);
|
|
37
|
+
|
|
38
|
+
// Verifica se o resultado é um número finito
|
|
39
|
+
if (!Number.isFinite(calculatedPages) || calculatedPages <= 0) {
|
|
40
|
+
return 1; // Se não for finito ou for menor que 1, retorna 1
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return calculatedPages;
|
|
44
|
+
})();
|
|
45
|
+
|
|
46
|
+
// Validar página atual
|
|
47
|
+
const validatedCurrentPage = Math.max(1, Math.min(safeCurrentPage, totalPages));
|
|
48
|
+
|
|
49
|
+
// Calcular range de registros exibidos com proteção contra valores inválidos
|
|
50
|
+
const recordRange = (() => {
|
|
51
|
+
if (safeTotalRecords === 0) {
|
|
52
|
+
return { start: 0, end: 0 };
|
|
53
|
+
}
|
|
54
|
+
const start = Math.min((validatedCurrentPage - 1) * safePageSize + 1, safeTotalRecords);
|
|
55
|
+
const end = Math.min(validatedCurrentPage * safePageSize, safeTotalRecords);
|
|
56
|
+
return { start, end };
|
|
57
|
+
})();
|
|
58
|
+
|
|
59
|
+
// Handler para mudança de página
|
|
60
|
+
const handlePageChange = (newPage: number) => {
|
|
61
|
+
if (newPage !== validatedCurrentPage) {
|
|
62
|
+
onPageChange(newPage);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Handler para mudança do tamanho da página
|
|
67
|
+
const handlePageSizeChange = (value: string | null) => {
|
|
68
|
+
if (!value) return;
|
|
69
|
+
const newSize = parseInt(value, 10);
|
|
70
|
+
if (!isNaN(newSize) && newSize > 0 && newSize !== safePageSize) {
|
|
71
|
+
onPageSizeChange(newSize);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Group className="archbase-data-grid-pagination" gap="lg" justify="space-between">
|
|
77
|
+
{/* Informações sobre registros */}
|
|
78
|
+
{showRecordInfo && (
|
|
79
|
+
<Text size="sm" color="dimmed">
|
|
80
|
+
{safeTotalRecords === 0 ? (
|
|
81
|
+
tString('archbase:Nenhum registro')
|
|
82
|
+
) : (
|
|
83
|
+
`${recordRange.start}-${recordRange.end} ${labels.of || tString('archbase:de')} ${safeTotalRecords} ${labels.totalRecords || tString('archbase:registros')}`
|
|
84
|
+
)}
|
|
85
|
+
</Text>
|
|
86
|
+
)}
|
|
87
|
+
|
|
88
|
+
<Group gap="md">
|
|
89
|
+
{/* Seletor de tamanho de página */}
|
|
90
|
+
{showPageSizeSelector && (
|
|
91
|
+
<Group gap="xs">
|
|
92
|
+
<Text size="sm" color="dimmed">{labels.pageSize || tString('archbase:Registros por página')}:</Text>
|
|
93
|
+
<Select
|
|
94
|
+
size="xs"
|
|
95
|
+
value={safePageSize.toString()}
|
|
96
|
+
onChange={handlePageSizeChange}
|
|
97
|
+
data={pageSizeOptions.map(size => ({
|
|
98
|
+
value: size.toString(),
|
|
99
|
+
label: size.toString()
|
|
100
|
+
}))}
|
|
101
|
+
styles={{
|
|
102
|
+
input: {
|
|
103
|
+
width: '70px'
|
|
104
|
+
}
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
</Group>
|
|
108
|
+
)}
|
|
109
|
+
|
|
110
|
+
{/* Navegação de páginas */}
|
|
111
|
+
{showNavigationButtons && totalPages > 0 && (
|
|
112
|
+
<Group gap={4}>
|
|
113
|
+
<ActionIcon
|
|
114
|
+
size="sm"
|
|
115
|
+
variant="subtle"
|
|
116
|
+
disabled={validatedCurrentPage === 1}
|
|
117
|
+
onClick={() => handlePageChange(validatedCurrentPage - 1)}
|
|
118
|
+
>
|
|
119
|
+
<IconChevronLeft size={16} />
|
|
120
|
+
</ActionIcon>
|
|
121
|
+
|
|
122
|
+
<Box style={{ width: 'auto', minWidth: '150px', textAlign: 'center' }}>
|
|
123
|
+
<Pagination
|
|
124
|
+
value={validatedCurrentPage}
|
|
125
|
+
onChange={handlePageChange}
|
|
126
|
+
total={isFinite(totalPages) ? totalPages : 1}
|
|
127
|
+
size="sm"
|
|
128
|
+
radius="xs"
|
|
129
|
+
withControls={false}
|
|
130
|
+
siblings={1}
|
|
131
|
+
boundaries={1}
|
|
132
|
+
/>
|
|
133
|
+
</Box>
|
|
134
|
+
|
|
135
|
+
<ActionIcon
|
|
136
|
+
size="sm"
|
|
137
|
+
variant="subtle"
|
|
138
|
+
disabled={validatedCurrentPage === totalPages}
|
|
139
|
+
onClick={() => handlePageChange(validatedCurrentPage + 1)}
|
|
140
|
+
>
|
|
141
|
+
<IconChevronRight size={16} />
|
|
142
|
+
</ActionIcon>
|
|
143
|
+
</Group>
|
|
144
|
+
)}
|
|
145
|
+
</Group>
|
|
146
|
+
</Group>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default GridPagination;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Badge, Box } from '@mantine/core';
|
|
2
|
+
import { t } from 'i18next';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
export type ArchbaseItemRenderType = {
|
|
6
|
+
value: any;
|
|
7
|
+
label: string;
|
|
8
|
+
color: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export interface ArchbaseItemRenderProps {
|
|
12
|
+
currentValue: string | undefined;
|
|
13
|
+
values: ArchbaseItemRenderType[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function ArchbaseItemRender({ currentValue, values }: ArchbaseItemRenderProps) {
|
|
17
|
+
const index = values.findIndex((item) => item.value.toString() === currentValue);
|
|
18
|
+
if (index !== -1) {
|
|
19
|
+
return (
|
|
20
|
+
<Box>
|
|
21
|
+
<Badge color={values[index].color}>{t(values[index].label)}</Badge>
|
|
22
|
+
</Box>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-search-input.d.ts","sourceRoot":"","sources":["global-search-input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAOzC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA4E9D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { TextInput, ActionIcon, useMantineColorScheme } from '@mantine/core';
|
|
3
|
+
import { IconSearch, IconX } from '@tabler/icons-react';
|
|
4
|
+
import { useArchbaseTranslation } from '@archbase/core';
|
|
5
|
+
import { useDebouncedValue } from '@mantine/hooks';
|
|
6
|
+
import { useArchbaseTheme } from '@archbase/core';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Props para o componente de pesquisa global
|
|
10
|
+
*/
|
|
11
|
+
export interface GlobalSearchInputProps {
|
|
12
|
+
value: string;
|
|
13
|
+
onChange: (value: string) => void;
|
|
14
|
+
onClear: () => void;
|
|
15
|
+
debounceTime?: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Componente para barra de pesquisa global integrado com Mantine
|
|
20
|
+
* Usa debounce para evitar chamadas excessivas durante a digitação
|
|
21
|
+
*/
|
|
22
|
+
export const GlobalSearchInput: React.FC<GlobalSearchInputProps> = ({
|
|
23
|
+
value,
|
|
24
|
+
onChange,
|
|
25
|
+
onClear,
|
|
26
|
+
debounceTime = 500 // Valor padrão de debounce (300ms)
|
|
27
|
+
}) => {
|
|
28
|
+
const { t } = useArchbaseTranslation();
|
|
29
|
+
const tString = (key: string) => String(t(key));
|
|
30
|
+
const theme = useArchbaseTheme();
|
|
31
|
+
const scheme = useMantineColorScheme();
|
|
32
|
+
|
|
33
|
+
// Estado interno para o input
|
|
34
|
+
const [inputValue, setInputValue] = React.useState(value);
|
|
35
|
+
|
|
36
|
+
// Flag para indicar que o clear foi chamado intencionalmente
|
|
37
|
+
// Isso evita que o debounce restaure o valor antigo após o clear
|
|
38
|
+
const clearIntentionalRef = React.useRef(false);
|
|
39
|
+
|
|
40
|
+
// Aplicar debounce ao valor digitado
|
|
41
|
+
const [debouncedValue] = useDebouncedValue(inputValue, debounceTime);
|
|
42
|
+
|
|
43
|
+
// Atualizar o valor interno quando o valor externo muda
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
setInputValue(value);
|
|
46
|
+
}, [value]);
|
|
47
|
+
|
|
48
|
+
// Propagar o valor com debounce para o callback
|
|
49
|
+
React.useEffect(() => {
|
|
50
|
+
// Se o clear foi intencional e o inputValue está vazio, não fazer nada
|
|
51
|
+
// Isso evita que o debounce com valor antigo sobrescreva o clear
|
|
52
|
+
if (clearIntentionalRef.current && inputValue === '') {
|
|
53
|
+
// Se o debouncedValue também está vazio, resetar a flag
|
|
54
|
+
if (debouncedValue === '') {
|
|
55
|
+
clearIntentionalRef.current = false;
|
|
56
|
+
}
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (debouncedValue !== value) {
|
|
61
|
+
onChange(debouncedValue);
|
|
62
|
+
}
|
|
63
|
+
}, [debouncedValue, onChange, value, inputValue]);
|
|
64
|
+
|
|
65
|
+
// Manipular mudança no input
|
|
66
|
+
const handleInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
67
|
+
clearIntentionalRef.current = false; // Reset flag ao digitar
|
|
68
|
+
setInputValue(event.currentTarget.value);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Manipular limpar input
|
|
72
|
+
const handleClear = () => {
|
|
73
|
+
console.log('[GlobalSearchInput] handleClear chamado');
|
|
74
|
+
clearIntentionalRef.current = true; // Marcar que o clear foi intencional
|
|
75
|
+
setInputValue('');
|
|
76
|
+
onClear();
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
// Renderizar botão de limpar quando houver texto
|
|
80
|
+
const rightSection = inputValue ? (
|
|
81
|
+
<ActionIcon
|
|
82
|
+
onClick={handleClear}
|
|
83
|
+
variant="transparent"
|
|
84
|
+
color="gray"
|
|
85
|
+
aria-label="Limpar busca"
|
|
86
|
+
>
|
|
87
|
+
<IconX size={16} />
|
|
88
|
+
</ActionIcon>
|
|
89
|
+
) : null;
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<TextInput
|
|
93
|
+
placeholder={tString('Buscar...')}
|
|
94
|
+
value={inputValue}
|
|
95
|
+
onChange={handleInputChange}
|
|
96
|
+
leftSection={<IconSearch size={16} color={theme.colors.gray[6]} />}
|
|
97
|
+
rightSection={rightSection}
|
|
98
|
+
styles={(theme) => ({
|
|
99
|
+
root: {
|
|
100
|
+
width: '300px',
|
|
101
|
+
},
|
|
102
|
+
input: {
|
|
103
|
+
'&:focus': {
|
|
104
|
+
borderColor: theme.colors[theme.primaryColor][6],
|
|
105
|
+
},
|
|
106
|
+
'&::placeholder': {
|
|
107
|
+
color: scheme.colorScheme === 'dark' ? theme.colors.gray[5] : theme.colors.gray[6],
|
|
108
|
+
},
|
|
109
|
+
backgroundColor: scheme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.white,
|
|
110
|
+
color: scheme.colorScheme === 'dark' ? theme.colors.gray[2] : theme.colors.dark[9],
|
|
111
|
+
},
|
|
112
|
+
})}
|
|
113
|
+
size="sm"
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default GlobalSearchInput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-toolbar.d.ts","sourceRoot":"","sources":["grid-toolbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAOxC,UAAU,gBAAgB;IACxB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,uBAAuB,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAChD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC/C,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA+ElD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Group, ActionIcon, Tooltip, Menu } from '@mantine/core';
|
|
3
|
+
import { IconRefresh, IconDownload, IconPrinter, IconSearch } from '@tabler/icons-react';
|
|
4
|
+
import { useArchbaseTranslation } from '@archbase/core';
|
|
5
|
+
import { useArchbaseTheme } from '@archbase/core';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
interface GridToolbarProps {
|
|
9
|
+
onRefresh: () => void;
|
|
10
|
+
onExport: () => void;
|
|
11
|
+
onPrint: () => void;
|
|
12
|
+
globalFilterValue: string;
|
|
13
|
+
onGlobalFilterChange: (value: string) => void;
|
|
14
|
+
renderAdditionalActions?: () => React.ReactNode;
|
|
15
|
+
enableGlobalFilter?: boolean;
|
|
16
|
+
allowExportData?: boolean;
|
|
17
|
+
allowPrintData?: boolean;
|
|
18
|
+
toolbarAlignment?: 'left' | 'right' | 'center';
|
|
19
|
+
toolbarLeftContent?: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Componente para a barra de ferramentas do grid
|
|
24
|
+
*/
|
|
25
|
+
export const GridToolbar: React.FC<GridToolbarProps> = ({
|
|
26
|
+
onRefresh,
|
|
27
|
+
onExport,
|
|
28
|
+
onPrint,
|
|
29
|
+
globalFilterValue,
|
|
30
|
+
onGlobalFilterChange,
|
|
31
|
+
renderAdditionalActions,
|
|
32
|
+
enableGlobalFilter = true,
|
|
33
|
+
allowExportData = true,
|
|
34
|
+
allowPrintData = true,
|
|
35
|
+
toolbarAlignment = 'right', // Mantido como 'right' por padrão
|
|
36
|
+
toolbarLeftContent
|
|
37
|
+
}) => {
|
|
38
|
+
const { t } = useArchbaseTranslation();
|
|
39
|
+
const theme = useArchbaseTheme();
|
|
40
|
+
const [showExportMenu, setShowExportMenu] = useState(false);
|
|
41
|
+
|
|
42
|
+
// Limpar o filtro global
|
|
43
|
+
const handleClearGlobalFilter = () => {
|
|
44
|
+
onGlobalFilterChange('');
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Botões de ação
|
|
48
|
+
const renderActionButtons = () => (
|
|
49
|
+
<Group gap="2">
|
|
50
|
+
<Tooltip label={`${t('Atualizar')}`}>
|
|
51
|
+
<ActionIcon
|
|
52
|
+
size="lg"
|
|
53
|
+
onClick={onRefresh}
|
|
54
|
+
color={theme.primaryColor}
|
|
55
|
+
variant="filled"
|
|
56
|
+
>
|
|
57
|
+
<IconRefresh size={20} />
|
|
58
|
+
</ActionIcon>
|
|
59
|
+
</Tooltip>
|
|
60
|
+
|
|
61
|
+
{allowExportData && (
|
|
62
|
+
<Menu opened={showExportMenu} onChange={setShowExportMenu}>
|
|
63
|
+
<Menu.Target>
|
|
64
|
+
<Tooltip label={`${t('Exportar')}`}>
|
|
65
|
+
<ActionIcon
|
|
66
|
+
size="lg"
|
|
67
|
+
color={theme.primaryColor}
|
|
68
|
+
variant="filled"
|
|
69
|
+
>
|
|
70
|
+
<IconDownload size={20} />
|
|
71
|
+
</ActionIcon>
|
|
72
|
+
</Tooltip>
|
|
73
|
+
</Menu.Target>
|
|
74
|
+
<Menu.Dropdown>
|
|
75
|
+
<Menu.Item onClick={onExport}>{`${t('Exportar')}`}</Menu.Item>
|
|
76
|
+
</Menu.Dropdown>
|
|
77
|
+
</Menu>
|
|
78
|
+
)}
|
|
79
|
+
|
|
80
|
+
{allowPrintData && (
|
|
81
|
+
<Tooltip label={`${t('Imprimir')}`}>
|
|
82
|
+
<ActionIcon
|
|
83
|
+
size="lg"
|
|
84
|
+
onClick={onPrint}
|
|
85
|
+
color={theme.primaryColor}
|
|
86
|
+
variant="filled"
|
|
87
|
+
>
|
|
88
|
+
<IconPrinter size={20} />
|
|
89
|
+
</ActionIcon>
|
|
90
|
+
</Tooltip>
|
|
91
|
+
)}
|
|
92
|
+
</Group>
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<Group gap="md">
|
|
97
|
+
{/* Renderizamos os botões independentemente do alinhamento */}
|
|
98
|
+
{renderActionButtons()}
|
|
99
|
+
|
|
100
|
+
{/* Ações customizadas */}
|
|
101
|
+
{renderAdditionalActions && renderAdditionalActions()}
|
|
102
|
+
</Group>
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export default GridToolbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AACA,OAAO,EACH,eAAe,EACf,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,WAAW,EACX,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,kCAAkC,EACnC,MAAM,kCAAkC,CAAC"}
|