@harjs/react-ui 1.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/LICENSE +21 -0
- package/README.md +27 -0
- package/dist/assets/css/components/charts/gantt/styles.css +62 -0
- package/dist/assets/css/components/charts/pie/pie.css +90 -0
- package/dist/assets/css/components/data-display/calendar/styles.css +15 -0
- package/dist/assets/css/components/data-display/calendar/styles.week-view.css +144 -0
- package/dist/assets/css/components/data-display/card/statuses.css +377 -0
- package/dist/assets/css/components/data-display/card/styles.css +26 -0
- package/dist/assets/css/components/data-display/chip/chip.css +13 -0
- package/dist/assets/css/components/data-display/diagram/styles.css +125 -0
- package/dist/assets/css/components/data-display/divider/divider.css +8 -0
- package/dist/assets/css/components/data-display/dnd/animations.css +11 -0
- package/dist/assets/css/components/data-display/dnd/shadow.css +26 -0
- package/dist/assets/css/components/data-display/dnd/styles.css +72 -0
- package/dist/assets/css/components/data-display/grid-system/column/position.css +21 -0
- package/dist/assets/css/components/data-display/grid-system/column/styles.css +379 -0
- package/dist/assets/css/components/data-display/grid-system/row/styles.css +35 -0
- package/dist/assets/css/components/data-display/grid-system/styles.css +6 -0
- package/dist/assets/css/components/data-display/kanban-board/styles.css +371 -0
- package/dist/assets/css/components/data-display/paper/styles.css +49 -0
- package/dist/assets/css/components/data-display/syntax-highlighter/core/jsx.template.css +65 -0
- package/dist/assets/css/components/data-display/syntax-highlighter/syntax-highlighter.css +58 -0
- package/dist/assets/css/components/data-display/table/filter-popup.css +11 -0
- package/dist/assets/css/components/data-display/table/properties-popup.css +42 -0
- package/dist/assets/css/components/data-display/table/scroll.css +208 -0
- package/dist/assets/css/components/data-display/table/styles.css +867 -0
- package/dist/assets/css/components/data-display/tabs/tabs.css +245 -0
- package/dist/assets/css/components/data-display/typography/paragraph/align.css +13 -0
- package/dist/assets/css/components/data-display/typography/paragraph/color.css +51 -0
- package/dist/assets/css/components/data-display/typography/paragraph/core.css +6 -0
- package/dist/assets/css/components/data-display/typography/paragraph/size.css +13 -0
- package/dist/assets/css/components/data-display/typography/title/align.css +13 -0
- package/dist/assets/css/components/data-display/typography/title/color.css +0 -0
- package/dist/assets/css/components/data-display/typography/title/core.css +5 -0
- package/dist/assets/css/components/data-display/typography/title/size.css +41 -0
- package/dist/assets/css/components/data-display/typography/typography.css +11 -0
- package/dist/assets/css/components/feedback/alert/statuses.css +224 -0
- package/dist/assets/css/components/feedback/alert/styles.css +61 -0
- package/dist/assets/css/components/feedback/drawer/content.css +7 -0
- package/dist/assets/css/components/feedback/drawer/header.css +56 -0
- package/dist/assets/css/components/feedback/drawer/styles.css +85 -0
- package/dist/assets/css/components/feedback/loading/loading.css +54 -0
- package/dist/assets/css/components/feedback/modal/content.css +6 -0
- package/dist/assets/css/components/feedback/modal/footer.css +9 -0
- package/dist/assets/css/components/feedback/modal/header.css +56 -0
- package/dist/assets/css/components/feedback/modal/media-queries/medium.css +11 -0
- package/dist/assets/css/components/feedback/modal/media-queries/small.css +11 -0
- package/dist/assets/css/components/feedback/modal/media-queries/x-large.css +5 -0
- package/dist/assets/css/components/feedback/modal/styles.css +53 -0
- package/dist/assets/css/components/feedback/notification/notification.css +157 -0
- package/dist/assets/css/components/feedback/popover/styles.css +53 -0
- package/dist/assets/css/components/feedback/popup-confirm/styles.css +165 -0
- package/dist/assets/css/components/feedback/progress/animations.css +10 -0
- package/dist/assets/css/components/feedback/progress/progress.css +50 -0
- package/dist/assets/css/components/feedback/progress/statuses.css +188 -0
- package/dist/assets/css/components/feedback/tooltip/styles.css +60 -0
- package/dist/assets/css/components/form/button/core/icon.css +37 -0
- package/dist/assets/css/components/form/button/core/position.css +19 -0
- package/dist/assets/css/components/form/button/core/shape.css +13 -0
- package/dist/assets/css/components/form/button/core/size.css +14 -0
- package/dist/assets/css/components/form/button/styles.css +32 -0
- package/dist/assets/css/components/form/button-action/styles.css +24 -0
- package/dist/assets/css/components/form/button-group/styles.css +26 -0
- package/dist/assets/css/components/form/checkbox/checkbox.css +53 -0
- package/dist/assets/css/components/form/checkbox/core/border.css +252 -0
- package/dist/assets/css/components/form/date-picker/calendar/calendar.css +14 -0
- package/dist/assets/css/components/form/date-picker/calendar/content.css +62 -0
- package/dist/assets/css/components/form/date-picker/calendar/footer.css +10 -0
- package/dist/assets/css/components/form/date-picker/calendar/header.css +86 -0
- package/dist/assets/css/components/form/date-picker/clock/clock.css +14 -0
- package/dist/assets/css/components/form/date-picker/clock/content.css +48 -0
- package/dist/assets/css/components/form/date-picker/clock/footer.css +6 -0
- package/dist/assets/css/components/form/date-picker/clock/header.css +8 -0
- package/dist/assets/css/components/form/date-picker/date-picker.css +36 -0
- package/dist/assets/css/components/form/input/core/addon.css +11 -0
- package/dist/assets/css/components/form/input/core/border.css +114 -0
- package/dist/assets/css/components/form/input/core/button.css +34 -0
- package/dist/assets/css/components/form/input/core/icon.css +22 -0
- package/dist/assets/css/components/form/input/otp/styles.css +20 -0
- package/dist/assets/css/components/form/input/phone/styles.css +50 -0
- package/dist/assets/css/components/form/input/styles.css +120 -0
- package/dist/assets/css/components/form/radio/core/border.css +252 -0
- package/dist/assets/css/components/form/radio/radio.css +69 -0
- package/dist/assets/css/components/form/select/options.css +117 -0
- package/dist/assets/css/components/form/select/styles.css +184 -0
- package/dist/assets/css/components/form/switch/core/border.css +208 -0
- package/dist/assets/css/components/form/switch/styles.css +61 -0
- package/dist/assets/css/components/form/text-editor/styles.css +130 -0
- package/dist/assets/css/components/form/upload/dropzone.css +166 -0
- package/dist/assets/css/components/form/upload/list-and-gird.css +183 -0
- package/dist/assets/css/components/form/upload/styles.css +215 -0
- package/dist/assets/css/components/layout/layout.css +130 -0
- package/dist/assets/css/components/layout/media-queries/large.css +19 -0
- package/dist/assets/css/components/layout/media-queries/medium.css +19 -0
- package/dist/assets/css/components/layout/media-queries/small.css +19 -0
- package/dist/assets/css/components/layout/media-queries/x-large.css +19 -0
- package/dist/assets/css/components/layout/media-queries/x-small.css +3 -0
- package/dist/assets/css/components/layout/media-queries/xx-large.css +19 -0
- package/dist/assets/css/components/layout/media-queries/xxx-large.css +20 -0
- package/dist/assets/css/components/navigation/breadcrumb/styles.css +0 -0
- package/dist/assets/css/components/navigation/menu/core/open-or-close.css +12 -0
- package/dist/assets/css/components/navigation/menu/styles.css +163 -0
- package/dist/assets/css/components/navigation/menu/variant/horizontal.css +3 -0
- package/dist/assets/css/components/navigation/menu/variant/vertical.css +3 -0
- package/dist/assets/css/components/navigation/pagination/styles.css +169 -0
- package/dist/assets/css/components/navigation/steps/animation.css +8 -0
- package/dist/assets/css/components/navigation/steps/styles.css +146 -0
- package/dist/assets/css/core/animation.css +164 -0
- package/dist/assets/css/core/ar-core.css +192 -0
- package/dist/assets/css/core/color-palette.css +111 -0
- package/dist/assets/css/core/utils.css +16 -0
- package/dist/assets/css/core/variants/animation.css +164 -0
- package/dist/assets/css/core/variants/border.css +18 -0
- package/dist/assets/css/core/variants/borderless.css +362 -0
- package/dist/assets/css/core/variants/dashed.css +362 -0
- package/dist/assets/css/core/variants/filled.css +428 -0
- package/dist/assets/css/core/variants/outlined.css +439 -0
- package/dist/assets/css/core/variants/surface.css +252 -0
- package/dist/assets/fonts/JetBrainsMono-Bold.ttf +0 -0
- package/dist/assets/fonts/JetBrainsMono-Regular.ttf +0 -0
- package/dist/components/charts/gantt/IProps.d.ts +24 -0
- package/dist/components/charts/gantt/IProps.js +1 -0
- package/dist/components/charts/gantt/index.d.ts +5 -0
- package/dist/components/charts/gantt/index.js +308 -0
- package/dist/components/charts/index.d.ts +2 -0
- package/dist/components/charts/index.js +2 -0
- package/dist/components/charts/pie/IProps.d.ts +7 -0
- package/dist/components/charts/pie/IProps.js +1 -0
- package/dist/components/charts/pie/index.d.ts +5 -0
- package/dist/components/charts/pie/index.js +56 -0
- package/dist/components/data-display/calendar/Body.d.ts +23 -0
- package/dist/components/data-display/calendar/Body.js +14 -0
- package/dist/components/data-display/calendar/Header.d.ts +20 -0
- package/dist/components/data-display/calendar/Header.js +26 -0
- package/dist/components/data-display/calendar/IProps.d.ts +14 -0
- package/dist/components/data-display/calendar/IProps.js +1 -0
- package/dist/components/data-display/calendar/index.d.ts +8 -0
- package/dist/components/data-display/calendar/index.js +27 -0
- package/dist/components/data-display/calendar/views/Day.d.ts +3 -0
- package/dist/components/data-display/calendar/views/Day.js +5 -0
- package/dist/components/data-display/calendar/views/Month.d.ts +3 -0
- package/dist/components/data-display/calendar/views/Month.js +5 -0
- package/dist/components/data-display/calendar/views/Week.d.ts +19 -0
- package/dist/components/data-display/calendar/views/Week.js +173 -0
- package/dist/components/data-display/card/IProps.d.ts +10 -0
- package/dist/components/data-display/card/IProps.js +1 -0
- package/dist/components/data-display/card/index.d.ts +5 -0
- package/dist/components/data-display/card/index.js +14 -0
- package/dist/components/data-display/chip/IProps.d.ts +6 -0
- package/dist/components/data-display/chip/IProps.js +1 -0
- package/dist/components/data-display/chip/index.d.ts +5 -0
- package/dist/components/data-display/chip/index.js +17 -0
- package/dist/components/data-display/diagram/IProps.d.ts +6 -0
- package/dist/components/data-display/diagram/IProps.js +1 -0
- package/dist/components/data-display/diagram/index.d.ts +5 -0
- package/dist/components/data-display/diagram/index.js +298 -0
- package/dist/components/data-display/divider/IProps.d.ts +6 -0
- package/dist/components/data-display/divider/IProps.js +1 -0
- package/dist/components/data-display/divider/index.d.ts +5 -0
- package/dist/components/data-display/divider/index.js +5 -0
- package/dist/components/data-display/dnd/IProps.d.ts +12 -0
- package/dist/components/data-display/dnd/IProps.js +1 -0
- package/dist/components/data-display/dnd/index.d.ts +5 -0
- package/dist/components/data-display/dnd/index.js +125 -0
- package/dist/components/data-display/grid-system/box/Box.d.ts +6 -0
- package/dist/components/data-display/grid-system/box/Box.js +13 -0
- package/dist/components/data-display/grid-system/column/Column.d.ts +4 -0
- package/dist/components/data-display/grid-system/column/Column.js +21 -0
- package/dist/components/data-display/grid-system/column/IProps.d.ts +13 -0
- package/dist/components/data-display/grid-system/column/IProps.js +1 -0
- package/dist/components/data-display/grid-system/index.d.ts +10 -0
- package/dist/components/data-display/grid-system/index.js +11 -0
- package/dist/components/data-display/grid-system/row/IProps.d.ts +4 -0
- package/dist/components/data-display/grid-system/row/IProps.js +1 -0
- package/dist/components/data-display/grid-system/row/Row.d.ts +4 -0
- package/dist/components/data-display/grid-system/row/Row.js +6 -0
- package/dist/components/data-display/kanban-board/IProps.d.ts +31 -0
- package/dist/components/data-display/kanban-board/IProps.js +1 -0
- package/dist/components/data-display/kanban-board/filter/DateFilters.d.ts +25 -0
- package/dist/components/data-display/kanban-board/filter/DateFilters.js +55 -0
- package/dist/components/data-display/kanban-board/filter/SelectFilters.d.ts +27 -0
- package/dist/components/data-display/kanban-board/filter/SelectFilters.js +43 -0
- package/dist/components/data-display/kanban-board/filter/index.d.ts +36 -0
- package/dist/components/data-display/kanban-board/filter/index.js +47 -0
- package/dist/components/data-display/kanban-board/index.d.ts +5 -0
- package/dist/components/data-display/kanban-board/index.js +309 -0
- package/dist/components/data-display/paper/IProps.d.ts +6 -0
- package/dist/components/data-display/paper/IProps.js +1 -0
- package/dist/components/data-display/paper/index.d.ts +5 -0
- package/dist/components/data-display/paper/index.js +12 -0
- package/dist/components/data-display/syntax-highlighter/Import.d.ts +4 -0
- package/dist/components/data-display/syntax-highlighter/Import.js +5 -0
- package/dist/components/data-display/syntax-highlighter/classes/Compiler.d.ts +7 -0
- package/dist/components/data-display/syntax-highlighter/classes/Compiler.js +92 -0
- package/dist/components/data-display/syntax-highlighter/classes/Parser.d.ts +9 -0
- package/dist/components/data-display/syntax-highlighter/classes/Parser.js +99 -0
- package/dist/components/data-display/syntax-highlighter/index.d.ts +11 -0
- package/dist/components/data-display/syntax-highlighter/index.js +41 -0
- package/dist/components/data-display/table/FilterPopup.d.ts +20 -0
- package/dist/components/data-display/table/FilterPopup.js +54 -0
- package/dist/components/data-display/table/Helpers.d.ts +2 -0
- package/dist/components/data-display/table/Helpers.js +10 -0
- package/dist/components/data-display/table/IProps.d.ts +99 -0
- package/dist/components/data-display/table/IProps.js +1 -0
- package/dist/components/data-display/table/PropertiesPopup.d.ts +31 -0
- package/dist/components/data-display/table/PropertiesPopup.js +90 -0
- package/dist/components/data-display/table/THeadCell.d.ts +34 -0
- package/dist/components/data-display/table/THeadCell.js +67 -0
- package/dist/components/data-display/table/body/Editable.d.ts +12 -0
- package/dist/components/data-display/table/body/Editable.js +59 -0
- package/dist/components/data-display/table/body/TBody.d.ts +36 -0
- package/dist/components/data-display/table/body/TBody.js +184 -0
- package/dist/components/data-display/table/header/ActionButtons.d.ts +14 -0
- package/dist/components/data-display/table/header/ActionButtons.js +65 -0
- package/dist/components/data-display/table/header/Header.d.ts +15 -0
- package/dist/components/data-display/table/header/Header.js +10 -0
- package/dist/components/data-display/table/index.d.ts +7 -0
- package/dist/components/data-display/table/index.js +639 -0
- package/dist/components/data-display/tabs/IProps.d.ts +9 -0
- package/dist/components/data-display/tabs/IProps.js +1 -0
- package/dist/components/data-display/tabs/index.d.ts +5 -0
- package/dist/components/data-display/tabs/index.js +110 -0
- package/dist/components/data-display/tabs/skeleton.d.ts +4 -0
- package/dist/components/data-display/tabs/skeleton.js +14 -0
- package/dist/components/data-display/typography/index.d.ts +6 -0
- package/dist/components/data-display/typography/index.js +9 -0
- package/dist/components/data-display/typography/paragraph/IProps.d.ts +7 -0
- package/dist/components/data-display/typography/paragraph/IProps.js +1 -0
- package/dist/components/data-display/typography/paragraph/Paragraph.d.ts +4 -0
- package/dist/components/data-display/typography/paragraph/Paragraph.js +14 -0
- package/dist/components/data-display/typography/title/IProps.d.ts +7 -0
- package/dist/components/data-display/typography/title/IProps.js +1 -0
- package/dist/components/data-display/typography/title/Title.d.ts +4 -0
- package/dist/components/data-display/typography/title/Title.js +13 -0
- package/dist/components/feedback/alert/IProps.d.ts +11 -0
- package/dist/components/feedback/alert/IProps.js +1 -0
- package/dist/components/feedback/alert/index.d.ts +5 -0
- package/dist/components/feedback/alert/index.js +50 -0
- package/dist/components/feedback/drawer/IProps.d.ts +18 -0
- package/dist/components/feedback/drawer/IProps.js +1 -0
- package/dist/components/feedback/drawer/index.d.ts +5 -0
- package/dist/components/feedback/drawer/index.js +94 -0
- package/dist/components/feedback/loading/index.d.ts +4 -0
- package/dist/components/feedback/loading/index.js +7 -0
- package/dist/components/feedback/modal/IProps.d.ts +14 -0
- package/dist/components/feedback/modal/IProps.js +1 -0
- package/dist/components/feedback/modal/index.d.ts +5 -0
- package/dist/components/feedback/modal/index.js +91 -0
- package/dist/components/feedback/notification/IProps.d.ts +9 -0
- package/dist/components/feedback/notification/IProps.js +1 -0
- package/dist/components/feedback/notification/index.d.ts +5 -0
- package/dist/components/feedback/notification/index.js +96 -0
- package/dist/components/feedback/popover/IProps.d.ts +16 -0
- package/dist/components/feedback/popover/IProps.js +1 -0
- package/dist/components/feedback/popover/index.d.ts +5 -0
- package/dist/components/feedback/popover/index.js +91 -0
- package/dist/components/feedback/popup-confirm/IProps.d.ts +10 -0
- package/dist/components/feedback/popup-confirm/IProps.js +1 -0
- package/dist/components/feedback/popup-confirm/index.d.ts +5 -0
- package/dist/components/feedback/popup-confirm/index.js +98 -0
- package/dist/components/feedback/progress/IProps.d.ts +6 -0
- package/dist/components/feedback/progress/IProps.js +1 -0
- package/dist/components/feedback/progress/index.d.ts +5 -0
- package/dist/components/feedback/progress/index.js +26 -0
- package/dist/components/feedback/tooltip/IProps.d.ts +6 -0
- package/dist/components/feedback/tooltip/IProps.js +1 -0
- package/dist/components/feedback/tooltip/index.d.ts +5 -0
- package/dist/components/feedback/tooltip/index.js +129 -0
- package/dist/components/form/button/IProps.d.ts +10 -0
- package/dist/components/form/button/IProps.js +1 -0
- package/dist/components/form/button/index.d.ts +5 -0
- package/dist/components/form/button/index.js +41 -0
- package/dist/components/form/button-action/IProps.d.ts +8 -0
- package/dist/components/form/button-action/IProps.js +1 -0
- package/dist/components/form/button-action/index.d.ts +5 -0
- package/dist/components/form/button-action/index.js +68 -0
- package/dist/components/form/button-group/index.d.ts +7 -0
- package/dist/components/form/button-group/index.js +31 -0
- package/dist/components/form/checkbox/IProps.d.ts +5 -0
- package/dist/components/form/checkbox/IProps.js +1 -0
- package/dist/components/form/checkbox/index.d.ts +5 -0
- package/dist/components/form/checkbox/index.js +24 -0
- package/dist/components/form/date-picker/DATE.d.ts +12 -0
- package/dist/components/form/date-picker/DATE.js +27 -0
- package/dist/components/form/date-picker/Props.d.ts +10 -0
- package/dist/components/form/date-picker/Props.js +1 -0
- package/dist/components/form/date-picker/index.d.ts +5 -0
- package/dist/components/form/date-picker/index.js +365 -0
- package/dist/components/form/input/IProps.d.ts +12 -0
- package/dist/components/form/input/IProps.js +1 -0
- package/dist/components/form/input/decimal/Decimal.d.ts +4 -0
- package/dist/components/form/input/decimal/Decimal.js +54 -0
- package/dist/components/form/input/decimal/IProps.d.ts +8 -0
- package/dist/components/form/input/decimal/IProps.js +1 -0
- package/dist/components/form/input/formatted-decimal/FormattedDecimal.d.ts +4 -0
- package/dist/components/form/input/formatted-decimal/FormattedDecimal.js +73 -0
- package/dist/components/form/input/formatted-decimal/IProps.d.ts +12 -0
- package/dist/components/form/input/formatted-decimal/IProps.js +1 -0
- package/dist/components/form/input/index.d.ts +15 -0
- package/dist/components/form/input/index.js +152 -0
- package/dist/components/form/input/otp/IProps.d.ts +6 -0
- package/dist/components/form/input/otp/IProps.js +1 -0
- package/dist/components/form/input/otp/Otp.d.ts +7 -0
- package/dist/components/form/input/otp/Otp.js +122 -0
- package/dist/components/form/input/phone/IProps.d.ts +11 -0
- package/dist/components/form/input/phone/IProps.js +1 -0
- package/dist/components/form/input/phone/Phone.d.ts +4 -0
- package/dist/components/form/input/phone/Phone.js +41 -0
- package/dist/components/form/radio/IProps.d.ts +12 -0
- package/dist/components/form/radio/IProps.js +1 -0
- package/dist/components/form/radio/index.d.ts +5 -0
- package/dist/components/form/radio/index.js +38 -0
- package/dist/components/form/select/Props.d.ts +35 -0
- package/dist/components/form/select/Props.js +1 -0
- package/dist/components/form/select/index.d.ts +5 -0
- package/dist/components/form/select/index.js +312 -0
- package/dist/components/form/switch/IProps.d.ts +5 -0
- package/dist/components/form/switch/IProps.js +1 -0
- package/dist/components/form/switch/index.d.ts +5 -0
- package/dist/components/form/switch/index.js +36 -0
- package/dist/components/form/text-editor/IProps.d.ts +18 -0
- package/dist/components/form/text-editor/IProps.js +1 -0
- package/dist/components/form/text-editor/index.d.ts +5 -0
- package/dist/components/form/text-editor/index.js +300 -0
- package/dist/components/form/upload/Buttons.d.ts +8 -0
- package/dist/components/form/upload/Buttons.js +27 -0
- package/dist/components/form/upload/Dropzone.d.ts +10 -0
- package/dist/components/form/upload/Dropzone.js +55 -0
- package/dist/components/form/upload/List.d.ts +12 -0
- package/dist/components/form/upload/List.js +21 -0
- package/dist/components/form/upload/Props.d.ts +16 -0
- package/dist/components/form/upload/Props.js +1 -0
- package/dist/components/form/upload/index.d.ts +9 -0
- package/dist/components/form/upload/index.js +184 -0
- package/dist/components/icons/Compiler.d.ts +9 -0
- package/dist/components/icons/Compiler.js +156 -0
- package/dist/components/icons/index.d.ts +10 -0
- package/dist/components/icons/index.js +6 -0
- package/dist/components/layout/Footer.d.ts +3 -0
- package/dist/components/layout/Footer.js +8 -0
- package/dist/components/layout/Header.d.ts +4 -0
- package/dist/components/layout/Header.js +8 -0
- package/dist/components/layout/IProps.d.ts +20 -0
- package/dist/components/layout/IProps.js +1 -0
- package/dist/components/layout/LSider.d.ts +4 -0
- package/dist/components/layout/LSider.js +53 -0
- package/dist/components/layout/Main.d.ts +4 -0
- package/dist/components/layout/Main.js +4 -0
- package/dist/components/layout/RSider.d.ts +3 -0
- package/dist/components/layout/RSider.js +13 -0
- package/dist/components/layout/Section.d.ts +4 -0
- package/dist/components/layout/Section.js +10 -0
- package/dist/components/layout/index.d.ts +12 -0
- package/dist/components/layout/index.js +32 -0
- package/dist/components/navigation/breadcrumb/IProps.d.ts +3 -0
- package/dist/components/navigation/breadcrumb/IProps.js +1 -0
- package/dist/components/navigation/breadcrumb/index.d.ts +5 -0
- package/dist/components/navigation/breadcrumb/index.js +8 -0
- package/dist/components/navigation/menu/IProps.d.ts +14 -0
- package/dist/components/navigation/menu/IProps.js +1 -0
- package/dist/components/navigation/menu/index.d.ts +5 -0
- package/dist/components/navigation/menu/index.js +89 -0
- package/dist/components/navigation/pagination/IProps.d.ts +8 -0
- package/dist/components/navigation/pagination/IProps.js +1 -0
- package/dist/components/navigation/pagination/index.d.ts +5 -0
- package/dist/components/navigation/pagination/index.js +74 -0
- package/dist/components/navigation/steps/IProps.d.ts +16 -0
- package/dist/components/navigation/steps/IProps.js +1 -0
- package/dist/components/navigation/steps/index.d.ts +5 -0
- package/dist/components/navigation/steps/index.js +102 -0
- package/dist/libs/core/application/contexts/Config.d.ts +26 -0
- package/dist/libs/core/application/contexts/Config.js +20 -0
- package/dist/libs/core/application/contexts/Language.d.ts +7 -0
- package/dist/libs/core/application/contexts/Language.js +7 -0
- package/dist/libs/core/application/contexts/Loading.d.ts +11 -0
- package/dist/libs/core/application/contexts/Loading.js +13 -0
- package/dist/libs/core/application/contexts/Notification.d.ts +25 -0
- package/dist/libs/core/application/contexts/Notification.js +29 -0
- package/dist/libs/core/application/contexts/index.d.ts +5 -0
- package/dist/libs/core/application/contexts/index.js +5 -0
- package/dist/libs/core/application/hooks/index.d.ts +41 -0
- package/dist/libs/core/application/hooks/index.js +17 -0
- package/dist/libs/core/application/hooks/useNotification.d.ts +16 -0
- package/dist/libs/core/application/hooks/useNotification.js +23 -0
- package/dist/libs/core/application/hooks/useTranslation.d.ts +9 -0
- package/dist/libs/core/application/hooks/useTranslation.js +25 -0
- package/dist/libs/core/application/hooks/useValidation.d.ts +7 -0
- package/dist/libs/core/application/hooks/useValidation.js +151 -0
- package/dist/libs/core/application/locales/index.d.ts +4 -0
- package/dist/libs/core/application/locales/index.js +3 -0
- package/dist/libs/core/application/locales/kanban-board/IKanbanBoardLocale.d.ts +5 -0
- package/dist/libs/core/application/locales/kanban-board/IKanbanBoardLocale.js +1 -0
- package/dist/libs/core/application/locales/kanban-board/en.d.ts +3 -0
- package/dist/libs/core/application/locales/kanban-board/en.js +5 -0
- package/dist/libs/core/application/locales/kanban-board/tr.d.ts +3 -0
- package/dist/libs/core/application/locales/kanban-board/tr.js +5 -0
- package/dist/libs/core/application/locales/notification/INotificationLocale.d.ts +59 -0
- package/dist/libs/core/application/locales/notification/INotificationLocale.js +1 -0
- package/dist/libs/core/application/locales/notification/en.d.ts +3 -0
- package/dist/libs/core/application/locales/notification/en.js +85 -0
- package/dist/libs/core/application/locales/notification/tr.d.ts +3 -0
- package/dist/libs/core/application/locales/notification/tr.js +85 -0
- package/dist/libs/core/application/locales/table/ITableLocale.d.ts +18 -0
- package/dist/libs/core/application/locales/table/ITableLocale.js +1 -0
- package/dist/libs/core/application/locales/table/en.d.ts +3 -0
- package/dist/libs/core/application/locales/table/en.js +22 -0
- package/dist/libs/core/application/locales/table/tr.d.ts +3 -0
- package/dist/libs/core/application/locales/table/tr.js +22 -0
- package/dist/libs/infrastructure/shared/DATE.d.ts +74 -0
- package/dist/libs/infrastructure/shared/DATE.js +148 -0
- package/dist/libs/infrastructure/shared/Enums.d.ts +18 -0
- package/dist/libs/infrastructure/shared/Enums.js +21 -0
- package/dist/libs/infrastructure/shared/NUMBER.d.ts +8 -0
- package/dist/libs/infrastructure/shared/NUMBER.js +10 -0
- package/dist/libs/infrastructure/shared/PHONE.d.ts +8 -0
- package/dist/libs/infrastructure/shared/PHONE.js +126 -0
- package/dist/libs/infrastructure/shared/Utils.d.ts +20 -0
- package/dist/libs/infrastructure/shared/Utils.js +349 -0
- package/dist/libs/infrastructure/shared/_old_DATE.d.ts +28 -0
- package/dist/libs/infrastructure/shared/_old_DATE.js +68 -0
- package/dist/libs/infrastructure/types/IGlobalProps.d.ts +183 -0
- package/dist/libs/infrastructure/types/IGlobalProps.js +1 -0
- package/dist/libs/infrastructure/types/index.d.ts +155 -0
- package/dist/libs/infrastructure/types/index.js +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
const Week = function ({ trackedBy, data, renderItem, states, config }) {
|
|
4
|
+
// states
|
|
5
|
+
const [mouseCoordinate, setMouseCoordinate] = useState({
|
|
6
|
+
x: 0,
|
|
7
|
+
y: 0,
|
|
8
|
+
isRightHalf: false,
|
|
9
|
+
isBottomHalf: false,
|
|
10
|
+
});
|
|
11
|
+
const [activeTooltip, setActiveTooltip] = useState(null);
|
|
12
|
+
// variables
|
|
13
|
+
const startHour = 0;
|
|
14
|
+
const endHour = 24;
|
|
15
|
+
const hours = endHour - startHour;
|
|
16
|
+
// const cellHeight = 60;
|
|
17
|
+
// methods
|
|
18
|
+
const weekDays = useMemo(() => getWeekDays(states.currentDate.get, config?.weekStartsOn ?? 1), [states.currentDate.get, config?.weekStartsOn]);
|
|
19
|
+
// useEffects
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const handleMouseMove = (event) => {
|
|
22
|
+
setMouseCoordinate({
|
|
23
|
+
x: event.clientX,
|
|
24
|
+
y: event.clientY,
|
|
25
|
+
isRightHalf: event.clientX > window.innerWidth / 2,
|
|
26
|
+
isBottomHalf: event.clientY > window.innerHeight / 2,
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
30
|
+
return () => {
|
|
31
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
return (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement("div", { className: "ar-calendar-week-view" },
|
|
36
|
+
React.createElement("div", { className: "head" }, weekDays.map((day) => (React.createElement("div", { key: day.toISOString(), className: "item" },
|
|
37
|
+
React.createElement("span", { className: "day-name" }, day.toLocaleString(config?.locale ?? "tr", { weekday: "short" }).toUpperCase()),
|
|
38
|
+
React.createElement("span", { className: "date" }, day.getDate()))))),
|
|
39
|
+
React.createElement("div", { className: "body" },
|
|
40
|
+
React.createElement("div", { className: "clocks" }, Array.from({ length: hours }, (_, index) => (React.createElement("div", { key: index },
|
|
41
|
+
React.createElement("span", null,
|
|
42
|
+
String(startHour + index).padStart(2, "0"),
|
|
43
|
+
":00"))))),
|
|
44
|
+
React.createElement("div", { role: "grid", className: "grid" }, Array.from({ length: hours }).map((_, rowIndex) => (React.createElement("div", { key: rowIndex, className: "row" }, weekDays.map((_, colIndex) => (React.createElement("div", { key: colIndex, className: "cell" }))))))),
|
|
45
|
+
React.createElement("div", { className: "events-layer" }, weekDays.map((day, dayIndex) => {
|
|
46
|
+
const dayStart = new Date(day).setHours(0, 0, 0, 0);
|
|
47
|
+
const dayEnd = new Date(day).setHours(23, 59, 59, 999);
|
|
48
|
+
// 1. Bu güne ait etkinlikleri filtrele ve sırala.
|
|
49
|
+
const dayEvents = data
|
|
50
|
+
.filter((event) => {
|
|
51
|
+
return event.start.getTime() <= dayEnd && event.end.getTime() >= dayStart;
|
|
52
|
+
})
|
|
53
|
+
.sort((a, b) => a.start.getTime() - b.start.getTime());
|
|
54
|
+
// 2. Çakışmaları hesapla (Görsel yerleşim için kritik adım).
|
|
55
|
+
const positionedEvents = computeEventLayout(dayEvents, dayStart, dayEnd);
|
|
56
|
+
return positionedEvents.map(({ event, layout, originalIndex }) => {
|
|
57
|
+
const uniqueValue = event[trackedBy];
|
|
58
|
+
const eventColor = getColor(uniqueValue);
|
|
59
|
+
return (React.createElement("div", { key: `${originalIndex}-${dayIndex}`, onMouseEnter: () => setActiveTooltip({ content: renderItem(event, originalIndex), id: originalIndex }), onMouseLeave: () => setActiveTooltip(null), className: "event-box", style: {
|
|
60
|
+
backgroundColor: eventColor.bg,
|
|
61
|
+
position: "absolute",
|
|
62
|
+
top: `${layout.top}px`,
|
|
63
|
+
height: `${layout.height}px`,
|
|
64
|
+
// Dinamik genişlik ve sol mesafe hesaplama.
|
|
65
|
+
left: `calc(${(100 / 7) * dayIndex}% + ${(layout.column * (100 / 7)) / layout.totalColumns}%)`,
|
|
66
|
+
width: `${100 / 7 / layout.totalColumns}%`,
|
|
67
|
+
border: `1px solid ${eventColor.border}`,
|
|
68
|
+
borderRadius: "var(--border-radius-sm)",
|
|
69
|
+
zIndex: 10,
|
|
70
|
+
} }, layout.height > 20 && renderItem(event, originalIndex)));
|
|
71
|
+
});
|
|
72
|
+
})))),
|
|
73
|
+
activeTooltip &&
|
|
74
|
+
ReactDOM.createPortal(React.createElement("div", { className: "ar-calendar-tooltip", style: {
|
|
75
|
+
top: mouseCoordinate.y,
|
|
76
|
+
left: mouseCoordinate.x,
|
|
77
|
+
transform: `translate(${mouseCoordinate.isRightHalf ? "-110%" : "10%"}, ${mouseCoordinate.isBottomHalf ? "-110%" : "10%"})`,
|
|
78
|
+
} }, activeTooltip.content), document.body)));
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Etkinliklerin çakışma durumuna göre konumlarını hesaplayan yardımcı fonksiyon
|
|
82
|
+
*/
|
|
83
|
+
function computeEventLayout(events, dayStart, dayEnd) {
|
|
84
|
+
const cellHeight = 60;
|
|
85
|
+
const results = [];
|
|
86
|
+
// Gruplandırma (Aynı anda çakışan etkinlik kümeleri)
|
|
87
|
+
let clusters = [];
|
|
88
|
+
let lastEventEnd = 0;
|
|
89
|
+
events.forEach((event, idx) => {
|
|
90
|
+
const start = Math.max(event.start.getTime(), dayStart);
|
|
91
|
+
const end = Math.min(event.end.getTime(), dayEnd);
|
|
92
|
+
if (start >= lastEventEnd) {
|
|
93
|
+
clusters.push([]); // Yeni bir küme başlat
|
|
94
|
+
}
|
|
95
|
+
const lastCluster = clusters[clusters.length - 1];
|
|
96
|
+
lastCluster.push({ event, idx, start, end });
|
|
97
|
+
lastEventEnd = Math.max(lastEventEnd, end);
|
|
98
|
+
});
|
|
99
|
+
// Her küme içindeki kolonları hesapla
|
|
100
|
+
clusters.forEach((cluster) => {
|
|
101
|
+
const columns = [];
|
|
102
|
+
cluster.forEach((item) => {
|
|
103
|
+
let placed = false;
|
|
104
|
+
for (let i = 0; i < columns.length; i++) {
|
|
105
|
+
// Eğer bu kolondaki son etkinlikle çakışmıyorsa buraya koy
|
|
106
|
+
const lastInColumn = columns[i][columns[i].length - 1];
|
|
107
|
+
if (item.start >= lastInColumn.end) {
|
|
108
|
+
columns[i].push(item);
|
|
109
|
+
placed = true;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (!placed) {
|
|
114
|
+
columns.push([item]); // Yeni kolon aç
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
// Sonuçları formatla
|
|
118
|
+
cluster.forEach((item) => {
|
|
119
|
+
const colIndex = columns.findIndex((col) => col.includes(item));
|
|
120
|
+
const startMinutes = new Date(item.start).getHours() * 60 + new Date(item.start).getMinutes();
|
|
121
|
+
const duration = (item.end - item.start) / 60000;
|
|
122
|
+
results.push({
|
|
123
|
+
event: item.event,
|
|
124
|
+
originalIndex: item.idx,
|
|
125
|
+
layout: {
|
|
126
|
+
top: (startMinutes / 60) * cellHeight,
|
|
127
|
+
height: (duration / 60) * cellHeight,
|
|
128
|
+
column: colIndex,
|
|
129
|
+
totalColumns: columns.length,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
return results;
|
|
135
|
+
}
|
|
136
|
+
const getWeekRange = (date, weekStartsOn = 1) => {
|
|
137
|
+
const current = new Date(date);
|
|
138
|
+
const currentDay = current.getDay();
|
|
139
|
+
const diff = (currentDay - weekStartsOn + 7) % 7;
|
|
140
|
+
const start = new Date(current);
|
|
141
|
+
start.setDate(current.getDate() - diff);
|
|
142
|
+
start.setHours(0, 0, 0, 0);
|
|
143
|
+
const end = new Date(start);
|
|
144
|
+
end.setDate(start.getDate() + 6);
|
|
145
|
+
return { start, end };
|
|
146
|
+
};
|
|
147
|
+
const getWeekDays = (date, weekStartsOn = 1) => {
|
|
148
|
+
const { start } = getWeekRange(date, weekStartsOn);
|
|
149
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
150
|
+
const d = new Date(start);
|
|
151
|
+
d.setDate(start.getDate() + i);
|
|
152
|
+
return d;
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const getColor = (id) => {
|
|
156
|
+
const colors = [
|
|
157
|
+
{ bg: "#3174ad", border: "#2a6293" }, // Mavi
|
|
158
|
+
{ bg: "#4caf50", border: "#388e3c" }, // Yeşil
|
|
159
|
+
{ bg: "#ff9800", border: "#f57c00" }, // Turuncu
|
|
160
|
+
{ bg: "#9c27b0", border: "#7b1fa2" }, // Mor
|
|
161
|
+
{ bg: "#e91e63", border: "#c2185b" }, // Pembe
|
|
162
|
+
{ bg: "#00bcd4", border: "#0097a7" }, // Turkuaz
|
|
163
|
+
];
|
|
164
|
+
// Eğer id string ise karakter kodlarının toplamını alarak tutarlı bir index üretiriz
|
|
165
|
+
let hash = 0;
|
|
166
|
+
const identifier = String(id);
|
|
167
|
+
for (let i = 0; i < identifier.length; i++) {
|
|
168
|
+
hash = identifier.charCodeAt(i) + ((hash << 5) - hash);
|
|
169
|
+
}
|
|
170
|
+
const index = Math.abs(hash);
|
|
171
|
+
return colors[index % colors.length];
|
|
172
|
+
};
|
|
173
|
+
export default Week;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IChildrenProps, IStatusProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IChildrenProps, IVariantProps<{
|
|
3
|
+
component: "card";
|
|
4
|
+
}>, IStatusProps<{
|
|
5
|
+
component: "card";
|
|
6
|
+
}> {
|
|
7
|
+
title?: string;
|
|
8
|
+
actions?: React.JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../assets/css/components/data-display/card/styles.css";
|
|
3
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
4
|
+
const Card = ({ children, title, actions, variant = "filled", status }) => {
|
|
5
|
+
// variables
|
|
6
|
+
const _className = ["ar-card"];
|
|
7
|
+
_className.push(...Utils.GetClassName(variant, status, undefined, undefined, undefined, undefined, undefined));
|
|
8
|
+
return (React.createElement("div", { className: _className.map((c) => c).join(" ") },
|
|
9
|
+
title && (React.createElement("div", { className: "title" },
|
|
10
|
+
React.createElement("h4", null, title),
|
|
11
|
+
React.createElement("div", null, actions))),
|
|
12
|
+
React.createElement("div", { className: "content" }, children)));
|
|
13
|
+
};
|
|
14
|
+
export default Card;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IIconProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IIconProps {
|
|
3
|
+
text: string;
|
|
4
|
+
customColor?: string;
|
|
5
|
+
}
|
|
6
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import "../../../assets/css/components/data-display/chip/chip.css";
|
|
4
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
5
|
+
const Chip = ({ variant = "outlined", color = "light", customColor, border = { radius: "sm" }, text, icon, }) => {
|
|
6
|
+
let _chipClassName = ["ar-chip"];
|
|
7
|
+
_chipClassName.push(...Utils.GetClassName(variant, undefined, color, border, undefined, undefined, undefined));
|
|
8
|
+
return (React.createElement("div", { className: _chipClassName.map((c) => c).join(" "), ...(customColor && {
|
|
9
|
+
style: {
|
|
10
|
+
backgroundColor: customColor,
|
|
11
|
+
color: "var(--black)",
|
|
12
|
+
},
|
|
13
|
+
}) },
|
|
14
|
+
icon?.element && React.createElement("span", null, icon?.element),
|
|
15
|
+
React.createElement("span", null, text)));
|
|
16
|
+
};
|
|
17
|
+
export default Chip;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/data-display/diagram/styles.css";
|
|
4
|
+
import Grid from "../grid-system";
|
|
5
|
+
import Button from "../../form/button";
|
|
6
|
+
import Tooltip from "../../feedback/tooltip";
|
|
7
|
+
import { ARIcon } from "../../icons";
|
|
8
|
+
const { Box } = Grid;
|
|
9
|
+
const Diagram = ({ nodes, edges }) => {
|
|
10
|
+
// refs
|
|
11
|
+
const _arDiagram = useRef(null);
|
|
12
|
+
const _content = useRef(null);
|
|
13
|
+
const _arNodes = useRef({});
|
|
14
|
+
const _path = useRef(null);
|
|
15
|
+
// refs -> Start Position
|
|
16
|
+
const _dragStartMousePosition = useRef({ x: 0, y: 0 });
|
|
17
|
+
const _dragStartNodePosition = useRef({ x: 0, y: 0 });
|
|
18
|
+
// refs -> Zoom
|
|
19
|
+
const _zoomIntensity = 0.1;
|
|
20
|
+
const _maxScale = 4;
|
|
21
|
+
const _minScale = 0.1;
|
|
22
|
+
// states
|
|
23
|
+
const [_nodes, setNodes] = useState(nodes);
|
|
24
|
+
const [_edges, setEdges] = useState(edges);
|
|
25
|
+
const [trigger, setTrigger] = useState(false);
|
|
26
|
+
// states -> Pan
|
|
27
|
+
const [pan, setPan] = useState({ x: 0, y: 0 });
|
|
28
|
+
const [panning, setPanning] = useState(false);
|
|
29
|
+
const [startPan, setStartPan] = useState({ x: 0, y: 0 });
|
|
30
|
+
// states -> Zoom
|
|
31
|
+
const [scale, setScale] = useState(1);
|
|
32
|
+
// states -> Drag
|
|
33
|
+
const [draggedNode, setDraggedNode] = useState(null);
|
|
34
|
+
// states -> Drawing
|
|
35
|
+
const [drawingEdge, setDrawingEdge] = useState(null);
|
|
36
|
+
const [mousePos, setMousePos] = useState(null);
|
|
37
|
+
// methods
|
|
38
|
+
const getPortCenter = (id, port) => {
|
|
39
|
+
const node = _arNodes.current[`${id}_${port}`];
|
|
40
|
+
const diagram = _arDiagram.current;
|
|
41
|
+
if (!node || !diagram)
|
|
42
|
+
return null;
|
|
43
|
+
const diagramRect = diagram.getBoundingClientRect();
|
|
44
|
+
const nodeRect = node.getBoundingClientRect();
|
|
45
|
+
return {
|
|
46
|
+
x: (nodeRect.left - diagramRect.left + nodeRect.width / 2 - pan.x) / scale,
|
|
47
|
+
y: (nodeRect.top - diagramRect.top + nodeRect.height / 2 - pan.y) / scale,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const getClosestPort = (position, threshold = 20) => {
|
|
51
|
+
for (const key in _arNodes.current) {
|
|
52
|
+
const el = _arNodes.current[key];
|
|
53
|
+
if (!el)
|
|
54
|
+
continue;
|
|
55
|
+
const [idStr, port] = key.split("_");
|
|
56
|
+
const id = parseInt(idStr, 10);
|
|
57
|
+
const rect = el.getBoundingClientRect();
|
|
58
|
+
const diagramRect = _arDiagram.current.getBoundingClientRect();
|
|
59
|
+
const portCenter = {
|
|
60
|
+
x: (rect.left - diagramRect.left + rect.width / 2 - pan.x) / scale,
|
|
61
|
+
y: (rect.top - diagramRect.top + rect.height / 2 - pan.y) / scale,
|
|
62
|
+
};
|
|
63
|
+
const distance = Math.hypot(position.x - portCenter.x, position.y - portCenter.y);
|
|
64
|
+
if (distance <= threshold)
|
|
65
|
+
return { id, port: port };
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
const renderEdges = useMemo(() => {
|
|
70
|
+
return _edges.map((edge, index) => {
|
|
71
|
+
const from = getPortCenter(edge.from.id, edge.from.port);
|
|
72
|
+
const to = getPortCenter(edge.to.id, edge.to.port);
|
|
73
|
+
if (!from || !to)
|
|
74
|
+
return null;
|
|
75
|
+
const dx = to.x - from.x;
|
|
76
|
+
const dy = to.y - from.y;
|
|
77
|
+
const distance = Math.hypot(dx, dy);
|
|
78
|
+
const offset = Math.min(40, distance * 0.25); // maksimum sapma sınırı
|
|
79
|
+
// S biçimli kontrol noktaları
|
|
80
|
+
const controlPoint1 = {
|
|
81
|
+
x: from.x,
|
|
82
|
+
y: from.y + (dy < 0 ? -offset : offset),
|
|
83
|
+
};
|
|
84
|
+
const controlPoint2 = {
|
|
85
|
+
x: to.x,
|
|
86
|
+
y: to.y + (dy < 0 ? offset : -offset),
|
|
87
|
+
};
|
|
88
|
+
const pathData = `M${from.x} ${from.y} C${controlPoint1.x} ${controlPoint1.y}, ${controlPoint2.x} ${controlPoint2.y}, ${to.x} ${to.y}`;
|
|
89
|
+
return (React.createElement("svg", { key: index, className: "edge" },
|
|
90
|
+
React.createElement("path", { ref: _path, d: pathData, fill: "none", stroke: "var(--purple-500)", strokeWidth: 2, strokeDasharray: 10, strokeDashoffset: 10, strokeLinecap: "round" },
|
|
91
|
+
React.createElement("animate", { attributeName: "stroke-dashoffset", values: `${20 / scale};0`, dur: "1s", repeatCount: "indefinite" }))));
|
|
92
|
+
});
|
|
93
|
+
}, [_nodes, _edges, trigger]);
|
|
94
|
+
const onPanStart = (e) => {
|
|
95
|
+
// Node sürükleniyorsa pan başlatma.
|
|
96
|
+
if (draggedNode)
|
|
97
|
+
return;
|
|
98
|
+
setPanning(true);
|
|
99
|
+
setStartPan({ x: e.clientX - pan.x, y: e.clientY - pan.y });
|
|
100
|
+
};
|
|
101
|
+
const onPanMove = (e) => {
|
|
102
|
+
if (panning) {
|
|
103
|
+
setPan({ x: e.clientX - startPan.x, y: e.clientY - startPan.y });
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const onPanEnd = () => setPanning(false);
|
|
107
|
+
// methods -> Zoom
|
|
108
|
+
const handleWheel = (event) => {
|
|
109
|
+
const direction = event.deltaY > 0 ? -1 : 1;
|
|
110
|
+
let newScale = scale + direction * _zoomIntensity;
|
|
111
|
+
newScale = Math.max(_minScale, Math.min(_maxScale, newScale));
|
|
112
|
+
// Mouse'un container içindeki konumunu al.
|
|
113
|
+
const rect = _content.current.getBoundingClientRect();
|
|
114
|
+
const mouseX = event.clientX - rect.left;
|
|
115
|
+
const mouseY = event.clientY - rect.top;
|
|
116
|
+
// İçerik düzleminde mouse'un bulunduğu noktayı bul.
|
|
117
|
+
const zoomPointX = (mouseX - pan.x) / scale;
|
|
118
|
+
const zoomPointY = (mouseY - pan.y) / scale;
|
|
119
|
+
// Yeni pan değerini hesapla ki zoomPoint sabit kalsın.
|
|
120
|
+
const newPanX = mouseX - zoomPointX * newScale;
|
|
121
|
+
const newPanY = mouseY - zoomPointY * newScale;
|
|
122
|
+
setScale(newScale);
|
|
123
|
+
setPan({ x: newPanX, y: newPanY });
|
|
124
|
+
};
|
|
125
|
+
const handleZoom = (process) => {
|
|
126
|
+
let newScale = 0;
|
|
127
|
+
if (process === "increment")
|
|
128
|
+
newScale = Math.max(_minScale, Math.min(_maxScale, scale + _zoomIntensity));
|
|
129
|
+
if (process === "decrement")
|
|
130
|
+
newScale = Math.max(_minScale, Math.min(_maxScale, scale - _zoomIntensity));
|
|
131
|
+
if (_content.current && _content.current) {
|
|
132
|
+
const containerRect = _content.current.getBoundingClientRect();
|
|
133
|
+
// Ortadaki noktayı bul (container açısından)
|
|
134
|
+
const centerX = containerRect.width / 2;
|
|
135
|
+
const centerY = containerRect.height / 2;
|
|
136
|
+
// İçerik düzleminde bu noktaya karşılık gelen nokta
|
|
137
|
+
const zoomPointX = (centerX - pan.x) / scale;
|
|
138
|
+
const zoomPointY = (centerY - pan.y) / scale;
|
|
139
|
+
// Yeni pan hesapla ki center aynı yerde kalsın
|
|
140
|
+
const newPanX = centerX - zoomPointX * newScale;
|
|
141
|
+
const newPanY = centerY - zoomPointY * newScale;
|
|
142
|
+
setPan({ x: newPanX, y: newPanY });
|
|
143
|
+
setScale(newScale);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
// methods -> Node
|
|
147
|
+
const onNodeMouseDown = (event, id, node) => {
|
|
148
|
+
event.stopPropagation();
|
|
149
|
+
setDraggedNode(id);
|
|
150
|
+
_dragStartMousePosition.current = { x: event.clientX, y: event.clientY };
|
|
151
|
+
_dragStartNodePosition.current = { x: node.x, y: node.y };
|
|
152
|
+
};
|
|
153
|
+
const onMouseMove = (event) => {
|
|
154
|
+
if (drawingEdge) {
|
|
155
|
+
const rect = _arDiagram.current.getBoundingClientRect();
|
|
156
|
+
const x = (event.clientX - rect.left - pan.x) / scale;
|
|
157
|
+
const y = (event.clientY - rect.top - pan.y) / scale;
|
|
158
|
+
setMousePos({ x, y });
|
|
159
|
+
}
|
|
160
|
+
if (draggedNode) {
|
|
161
|
+
const deltaX = (event.clientX - _dragStartMousePosition.current.x) / scale;
|
|
162
|
+
const deltaY = (event.clientY - _dragStartMousePosition.current.y) / scale;
|
|
163
|
+
const newX = _dragStartNodePosition.current.x + deltaX;
|
|
164
|
+
const newY = _dragStartNodePosition.current.y + deltaY;
|
|
165
|
+
setNodes((prev) => prev.map((node) => (node.id === draggedNode ? { ...node, position: { x: newX, y: newY } } : node)));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const onMouseUp = () => {
|
|
169
|
+
if (drawingEdge && mousePos) {
|
|
170
|
+
const closest = getClosestPort(mousePos);
|
|
171
|
+
if (closest) {
|
|
172
|
+
// Yakın port varsa, oraya bağla
|
|
173
|
+
const newEdge = {
|
|
174
|
+
id: crypto.randomUUID(), // _edges[_edges.length - 1]?.id + 1 || 1,
|
|
175
|
+
from: { id: drawingEdge.id, port: drawingEdge.port },
|
|
176
|
+
to: { id: closest.id, port: closest.port },
|
|
177
|
+
};
|
|
178
|
+
// Aynı edge daha önce eklenmiş mi kontrol et
|
|
179
|
+
const isDuplicate = _edges.some((edge) => {
|
|
180
|
+
const samePair = (edge.from.id === newEdge.from.id && edge.to.id === newEdge.to.id) ||
|
|
181
|
+
(edge.from.id === newEdge.to.id && edge.to.id === newEdge.from.id);
|
|
182
|
+
return samePair;
|
|
183
|
+
});
|
|
184
|
+
if (!isDuplicate)
|
|
185
|
+
setEdges((prev) => [...prev, newEdge]);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
// Yakın port yoksa yeni node oluştur
|
|
189
|
+
const newNodeId = crypto.randomUUID(); // _nodes[_nodes.length - 1]?.id + 1 || 1;
|
|
190
|
+
const newNode = {
|
|
191
|
+
id: newNodeId,
|
|
192
|
+
position: mousePos,
|
|
193
|
+
data: React.createElement(React.Fragment, null),
|
|
194
|
+
};
|
|
195
|
+
const newPort = mousePos.y < drawingEdge.start.y ? "bottom" : "top";
|
|
196
|
+
const newEdge = {
|
|
197
|
+
id: crypto.randomUUID(), // _edges[_edges.length - 1]?.id + 1 || 1,
|
|
198
|
+
from: { id: drawingEdge.id, port: drawingEdge.port },
|
|
199
|
+
to: { id: newNodeId, port: newPort },
|
|
200
|
+
};
|
|
201
|
+
setNodes((prev) => [...prev, newNode]);
|
|
202
|
+
setEdges((prev) => [...prev, newEdge]);
|
|
203
|
+
}
|
|
204
|
+
setDrawingEdge(null);
|
|
205
|
+
setMousePos(null);
|
|
206
|
+
}
|
|
207
|
+
setDraggedNode(null);
|
|
208
|
+
setTrigger((prev) => !prev);
|
|
209
|
+
};
|
|
210
|
+
// useEffects
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
setEdges([...edges]);
|
|
213
|
+
}, []);
|
|
214
|
+
return (React.createElement("div", { ref: _arDiagram, className: "ar-diagram", onMouseDown: onPanStart, onMouseMove: (event) => {
|
|
215
|
+
onPanMove(event);
|
|
216
|
+
onMouseMove(event);
|
|
217
|
+
}, onMouseUp: () => {
|
|
218
|
+
onMouseUp();
|
|
219
|
+
onPanEnd();
|
|
220
|
+
} },
|
|
221
|
+
React.createElement("div", { ref: _content, className: "content", style: { backgroundPosition: `${pan.x}px ${pan.y}px` }, onWheel: handleWheel },
|
|
222
|
+
React.createElement("div", { className: "nodes-wrapper", style: {
|
|
223
|
+
transform: `translate(${pan.x}px, ${pan.y}px) scale(${scale})`,
|
|
224
|
+
} },
|
|
225
|
+
React.createElement("div", { className: "edges" },
|
|
226
|
+
renderEdges,
|
|
227
|
+
drawingEdge && mousePos && (React.createElement("svg", { className: "edge-temp" },
|
|
228
|
+
React.createElement("path", { ref: _path, d: `M${drawingEdge.start.x} ${drawingEdge.start.y} L${mousePos.x} ${mousePos.y}`, fill: "none", stroke: "var(--purple-500)", strokeWidth: 2, strokeDasharray: 10, strokeDashoffset: 10, strokeLinecap: "round" })))),
|
|
229
|
+
React.createElement("div", { className: "nodes" }, _nodes.map((node, index) => (React.createElement("div", { key: index, className: "node", style: {
|
|
230
|
+
left: node.position.x,
|
|
231
|
+
top: node.position.y,
|
|
232
|
+
}, onMouseDown: (event) => onNodeMouseDown(event, node.id, node.position) },
|
|
233
|
+
React.createElement("span", { ref: (el) => {
|
|
234
|
+
if (!el)
|
|
235
|
+
return;
|
|
236
|
+
_arNodes.current[`${node.id}_top`] = el;
|
|
237
|
+
}, className: "port top", onMouseDown: (event) => {
|
|
238
|
+
event.stopPropagation();
|
|
239
|
+
const port = "top";
|
|
240
|
+
const from = getPortCenter(node.id, port);
|
|
241
|
+
if (from) {
|
|
242
|
+
setDrawingEdge({
|
|
243
|
+
id: node.id,
|
|
244
|
+
port,
|
|
245
|
+
start: from,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
} }),
|
|
249
|
+
React.createElement("span", { ref: (el) => {
|
|
250
|
+
if (!el)
|
|
251
|
+
return;
|
|
252
|
+
_arNodes.current[`${node.id}_left`] = el;
|
|
253
|
+
}, className: "port left", onMouseDown: (event) => {
|
|
254
|
+
event.stopPropagation();
|
|
255
|
+
const from = getPortCenter(node.id, "left");
|
|
256
|
+
if (from) {
|
|
257
|
+
setDrawingEdge({ id: node.id, port: "left", start: from });
|
|
258
|
+
}
|
|
259
|
+
} }),
|
|
260
|
+
React.createElement("span", null, node.data),
|
|
261
|
+
React.createElement("span", { ref: (el) => {
|
|
262
|
+
if (!el)
|
|
263
|
+
return;
|
|
264
|
+
_arNodes.current[`${node.id}_right`] = el;
|
|
265
|
+
}, className: "port right", onMouseDown: (event) => {
|
|
266
|
+
event.stopPropagation();
|
|
267
|
+
const from = getPortCenter(node.id, "right");
|
|
268
|
+
if (from) {
|
|
269
|
+
setDrawingEdge({ id: node.id, port: "right", start: from });
|
|
270
|
+
}
|
|
271
|
+
} }),
|
|
272
|
+
React.createElement("span", { ref: (el) => {
|
|
273
|
+
if (!el)
|
|
274
|
+
return;
|
|
275
|
+
_arNodes.current[`${node.id}_bottom`] = el;
|
|
276
|
+
}, className: "port bottom", onMouseDown: (event) => {
|
|
277
|
+
event.stopPropagation();
|
|
278
|
+
const from = getPortCenter(node.id, "bottom");
|
|
279
|
+
if (from) {
|
|
280
|
+
setDrawingEdge({
|
|
281
|
+
id: node.id,
|
|
282
|
+
port: "bottom",
|
|
283
|
+
start: from,
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
} }))))))),
|
|
287
|
+
React.createElement("div", { className: "zoom-buttons", onMouseDown: (event) => event.stopPropagation() },
|
|
288
|
+
React.createElement(Box, null,
|
|
289
|
+
React.createElement(Tooltip, { text: "Zoom Out" },
|
|
290
|
+
React.createElement(Button, { variant: "borderless", color: "light", icon: { element: React.createElement(ARIcon, { icon: "Dash", fill: "currentColor" }) }, onClick: () => handleZoom("decrement") })),
|
|
291
|
+
React.createElement("div", { className: "zoom-percent" },
|
|
292
|
+
Math.round(scale * 100),
|
|
293
|
+
"%"),
|
|
294
|
+
React.createElement(Tooltip, { text: "Zoom In" },
|
|
295
|
+
React.createElement(Button, { variant: "borderless", color: "light", icon: { element: React.createElement(ARIcon, { icon: "Add", fill: "currentColor" }) }, onClick: () => handleZoom("increment") })))),
|
|
296
|
+
React.createElement("div", { style: { zIndex: 555 } }, JSON.stringify(drawingEdge))));
|
|
297
|
+
};
|
|
298
|
+
export default Diagram;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../assets/css/components/data-display/divider/divider.css";
|
|
3
|
+
const Divider = ({ config }) => React.createElement("hr", { className: "ar-divider", style: { margin: config?.margin } });
|
|
4
|
+
Divider.displayName = "Divider";
|
|
5
|
+
export default Divider;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface IProps<T> {
|
|
3
|
+
data: T[];
|
|
4
|
+
renderItem: (item: T, index: number) => React.JSX.Element;
|
|
5
|
+
columnKey?: string;
|
|
6
|
+
onChange?: (data: T[]) => void;
|
|
7
|
+
confing?: {
|
|
8
|
+
isMoveIcon?: boolean;
|
|
9
|
+
isInTable?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|