@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,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useContext, useEffect, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/navigation/pagination/styles.css";
|
|
4
|
+
import { ConfigContext } from "../../../libs/core/application/contexts/Config";
|
|
5
|
+
import Select from "../../form/select";
|
|
6
|
+
const perPageOptions = [
|
|
7
|
+
{ value: 5, text: "5" },
|
|
8
|
+
{ value: 10, text: "10" },
|
|
9
|
+
{ value: 15, text: "15" },
|
|
10
|
+
{ value: 50, text: "50" },
|
|
11
|
+
{ value: 75, text: "75" },
|
|
12
|
+
{ value: 100, text: "100" },
|
|
13
|
+
];
|
|
14
|
+
const Pagination = ({ currentPage, totalRecords, perPage, onChange }) => {
|
|
15
|
+
// context
|
|
16
|
+
const { config } = useContext(ConfigContext);
|
|
17
|
+
// states
|
|
18
|
+
const [pages, setPages] = useState([]);
|
|
19
|
+
const [totalPageCount, setTotalPageCount] = useState(0);
|
|
20
|
+
const [selectedPerPage, setSelectedPerPage] = useState(perPageOptions.find((x) => x.value === 10));
|
|
21
|
+
// methods
|
|
22
|
+
const handlePageChange = (page, perPage) => onChange(page, perPage);
|
|
23
|
+
// useEffects
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (totalRecords === 0)
|
|
26
|
+
return;
|
|
27
|
+
const liItems = [];
|
|
28
|
+
const _totalPageCount = Math.ceil(totalRecords / (perPage ?? config.perPage));
|
|
29
|
+
setTotalPageCount(_totalPageCount);
|
|
30
|
+
// currentPage prop'unu kullanın
|
|
31
|
+
const activePage = currentPage || 1;
|
|
32
|
+
// Başlangıç ve bitiş aralığını hesapla.
|
|
33
|
+
const startPage = Math.max(1, activePage - 1);
|
|
34
|
+
const endPage = Math.min(_totalPageCount, activePage + 1);
|
|
35
|
+
// Sayfalama mantığı...
|
|
36
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
37
|
+
liItems.push(React.createElement("li", { key: i, className: i === activePage ? "selection-page" : "", onClick: () => handlePageChange(i, selectedPerPage?.value) }, i));
|
|
38
|
+
}
|
|
39
|
+
setPages(liItems);
|
|
40
|
+
}, [totalRecords, currentPage, perPage, config.perPage]);
|
|
41
|
+
return (React.createElement("div", { className: "ar-pagination" },
|
|
42
|
+
React.createElement(Select, { variant: "borderless", value: selectedPerPage, options: [...perPageOptions, { value: totalRecords, text: "Tümü" }], onChange: (option) => {
|
|
43
|
+
setSelectedPerPage(option);
|
|
44
|
+
handlePageChange(1, option?.value);
|
|
45
|
+
}, config: { clear: false }, style: { width: 65 }, readOnly: true }),
|
|
46
|
+
React.createElement("ul", null,
|
|
47
|
+
React.createElement("li", { className: currentPage === 1 ? "passive" : "", onClick: () => {
|
|
48
|
+
if (currentPage === 1)
|
|
49
|
+
return;
|
|
50
|
+
handlePageChange(1, selectedPerPage?.value);
|
|
51
|
+
} },
|
|
52
|
+
React.createElement("span", null, "«")),
|
|
53
|
+
React.createElement("li", { className: currentPage === 1 ? "passive" : "", onClick: () => {
|
|
54
|
+
if (currentPage === 1)
|
|
55
|
+
return;
|
|
56
|
+
handlePageChange(currentPage - 1, selectedPerPage?.value);
|
|
57
|
+
} },
|
|
58
|
+
React.createElement("span", null, "‹")),
|
|
59
|
+
pages,
|
|
60
|
+
React.createElement("li", { className: totalPageCount === currentPage ? "passive" : "", onClick: () => {
|
|
61
|
+
if (totalPageCount === currentPage)
|
|
62
|
+
return;
|
|
63
|
+
handlePageChange(currentPage + 1, selectedPerPage?.value);
|
|
64
|
+
} },
|
|
65
|
+
React.createElement("span", null, "›")),
|
|
66
|
+
React.createElement("li", { className: totalPageCount === currentPage ? "passive" : "", onClick: () => {
|
|
67
|
+
if (totalPageCount === currentPage)
|
|
68
|
+
return;
|
|
69
|
+
handlePageChange(totalPageCount, selectedPerPage?.value);
|
|
70
|
+
} },
|
|
71
|
+
React.createElement("span", null, "»")))));
|
|
72
|
+
};
|
|
73
|
+
Pagination.displayName = "Pagination";
|
|
74
|
+
export default Pagination;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StepProps, ValidationProps } from "../../../libs/infrastructure/types";
|
|
2
|
+
import { IChildrenProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
3
|
+
interface IProps<TData extends object> extends IChildrenProps {
|
|
4
|
+
name: string;
|
|
5
|
+
steps: StepProps[];
|
|
6
|
+
currentStep?: number;
|
|
7
|
+
onChange: (currentStep: number) => void;
|
|
8
|
+
validation?: {
|
|
9
|
+
data: TData;
|
|
10
|
+
rules: ValidationProps<TData>[];
|
|
11
|
+
};
|
|
12
|
+
config?: {
|
|
13
|
+
isAutomatic?: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import IProps from "./IProps";
|
|
3
|
+
import "../../../assets/css/components/navigation/steps/styles.css";
|
|
4
|
+
declare const Steps: <T extends object>({ children, name, steps, currentStep, onChange, validation, config, }: IProps<T>) => React.JSX.Element;
|
|
5
|
+
export default Steps;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/navigation/steps/styles.css";
|
|
4
|
+
import Typography from "../../data-display/typography";
|
|
5
|
+
import Button from "../../form/button";
|
|
6
|
+
import { useValidation } from "../../../libs/core/application/hooks";
|
|
7
|
+
const { Title } = Typography;
|
|
8
|
+
const Steps = function ({ children, name, steps = [], currentStep, onChange, validation, config, }) {
|
|
9
|
+
// states
|
|
10
|
+
const [_currentStep, setCurrentStep] = useState(0);
|
|
11
|
+
// hooks
|
|
12
|
+
const { errors, onSubmit, setSubmit } = useValidation(validation?.data, validation?.rules, _currentStep + 1);
|
|
13
|
+
// methods
|
|
14
|
+
const getStepIconStatus = (currentStep, index) => {
|
|
15
|
+
if (currentStep < index)
|
|
16
|
+
return "pending";
|
|
17
|
+
if (currentStep === index)
|
|
18
|
+
return "in-progress";
|
|
19
|
+
return "completed";
|
|
20
|
+
};
|
|
21
|
+
// useEffects
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
setCurrentStep(currentStep ?? 0);
|
|
24
|
+
}, [currentStep]);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
if (config?.isAutomatic)
|
|
27
|
+
return;
|
|
28
|
+
const key = `${window.location.pathname}::${name}`;
|
|
29
|
+
const stored = sessionStorage.getItem(key);
|
|
30
|
+
setCurrentStep(stored !== null ? Number(stored) : (currentStep ?? 0));
|
|
31
|
+
onChange?.(stored !== null ? Number(stored) : (currentStep ?? 0));
|
|
32
|
+
}, []);
|
|
33
|
+
return (React.createElement("div", { className: "ar-steps" },
|
|
34
|
+
React.createElement("div", { className: "steps" }, steps.length > 0 &&
|
|
35
|
+
steps.map((step, index) => {
|
|
36
|
+
let itemIcon = ["item-icon"];
|
|
37
|
+
itemIcon.push(getStepIconStatus(_currentStep, index));
|
|
38
|
+
return (React.createElement("div", { key: step.title || index, className: "item", onClick: () => {
|
|
39
|
+
if (config?.isAutomatic)
|
|
40
|
+
return;
|
|
41
|
+
if (validation) {
|
|
42
|
+
onSubmit((result) => {
|
|
43
|
+
if (!result)
|
|
44
|
+
return;
|
|
45
|
+
setCurrentStep(index);
|
|
46
|
+
onChange(index);
|
|
47
|
+
setSubmit(false);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
setCurrentStep(index);
|
|
52
|
+
onChange(index);
|
|
53
|
+
}
|
|
54
|
+
const key = `${window.location.pathname}::${name}`;
|
|
55
|
+
sessionStorage.setItem(key, String(index));
|
|
56
|
+
} },
|
|
57
|
+
React.createElement("div", { className: itemIcon.map((c) => c).join(" ") },
|
|
58
|
+
React.createElement("span", { className: getStepIconStatus(_currentStep, index) })),
|
|
59
|
+
React.createElement("div", { className: "item-informations" },
|
|
60
|
+
React.createElement("span", { className: "step" },
|
|
61
|
+
"STEP ",
|
|
62
|
+
index + 1),
|
|
63
|
+
React.createElement(Title, { Level: "h3" }, step.title))));
|
|
64
|
+
})),
|
|
65
|
+
React.createElement("div", { className: "content" },
|
|
66
|
+
steps.map((step, stepIndex) => {
|
|
67
|
+
return (React.createElement("div", { key: stepIndex }, React.Children.map(step.content, (child) => {
|
|
68
|
+
if (React.isValidElement(child) && stepIndex === _currentStep) {
|
|
69
|
+
return validation
|
|
70
|
+
? React.cloneElement(child, {
|
|
71
|
+
errors: errors,
|
|
72
|
+
})
|
|
73
|
+
: child;
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
})));
|
|
77
|
+
}),
|
|
78
|
+
!config?.isAutomatic && (React.createElement("div", { className: "buttons" },
|
|
79
|
+
_currentStep > 0 && (React.createElement(Button, { color: "blue", onClick: () => {
|
|
80
|
+
setCurrentStep((prev) => prev - 1);
|
|
81
|
+
onChange(_currentStep - 1);
|
|
82
|
+
} }, "Geri")),
|
|
83
|
+
children && children,
|
|
84
|
+
_currentStep < steps.length - 1 && (React.createElement(Button, { color: "blue", onClick: () => {
|
|
85
|
+
if (validation) {
|
|
86
|
+
onSubmit((result) => {
|
|
87
|
+
if (!result)
|
|
88
|
+
return;
|
|
89
|
+
setCurrentStep((prev) => prev + 1);
|
|
90
|
+
onChange(_currentStep + 1);
|
|
91
|
+
setSubmit(false);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
setCurrentStep((prev) => prev + 1);
|
|
96
|
+
onChange(_currentStep + 1);
|
|
97
|
+
}
|
|
98
|
+
const key = `${window.location.pathname}::${name}`;
|
|
99
|
+
sessionStorage.setItem(key, String(_currentStep + 1));
|
|
100
|
+
} }, "\u0130leri")))))));
|
|
101
|
+
};
|
|
102
|
+
export default Steps;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type ConfigOptions = {
|
|
3
|
+
layout: {
|
|
4
|
+
sider: {
|
|
5
|
+
left: {
|
|
6
|
+
element: React.ReactNode | null;
|
|
7
|
+
active: boolean;
|
|
8
|
+
};
|
|
9
|
+
right: {
|
|
10
|
+
element: React.ReactNode | null;
|
|
11
|
+
active: boolean;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
perPage: number;
|
|
16
|
+
};
|
|
17
|
+
type ConfigContextProps = {
|
|
18
|
+
config: ConfigOptions;
|
|
19
|
+
setConfig: React.Dispatch<React.SetStateAction<ConfigOptions>>;
|
|
20
|
+
};
|
|
21
|
+
type ConfigProviderProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
};
|
|
24
|
+
export declare const ConfigContext: React.Context<ConfigContextProps>;
|
|
25
|
+
declare const ConfigProvider: ({ children }: ConfigProviderProps) => React.JSX.Element;
|
|
26
|
+
export { ConfigProvider };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
const defaultOptions = {
|
|
4
|
+
layout: {
|
|
5
|
+
sider: {
|
|
6
|
+
left: { element: null, active: true },
|
|
7
|
+
right: { element: null, active: true },
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
perPage: 5,
|
|
11
|
+
};
|
|
12
|
+
export const ConfigContext = createContext({
|
|
13
|
+
config: defaultOptions,
|
|
14
|
+
setConfig: () => { },
|
|
15
|
+
});
|
|
16
|
+
const ConfigProvider = ({ children }) => {
|
|
17
|
+
const [config, setConfig] = useState(defaultOptions);
|
|
18
|
+
return React.createElement(ConfigContext.Provider, { value: { config, setConfig } }, children);
|
|
19
|
+
};
|
|
20
|
+
export { ConfigProvider };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const LanguageContext: React.Context<string | undefined>;
|
|
3
|
+
declare const LanguageProvider: ({ children, language }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
language: string | undefined;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
export { LanguageContext, LanguageProvider };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext } from "react";
|
|
3
|
+
const LanguageContext = createContext(undefined);
|
|
4
|
+
const LanguageProvider = ({ children, language }) => {
|
|
5
|
+
return React.createElement(LanguageContext.Provider, { value: language }, children);
|
|
6
|
+
};
|
|
7
|
+
export { LanguageContext, LanguageProvider };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type LoadingContextProps = {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
|
+
};
|
|
6
|
+
type LoadingProviderProps = {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
declare const LoadingContext: React.Context<LoadingContextProps>;
|
|
10
|
+
declare const LoadingProvider: ({ children }: LoadingProviderProps) => React.JSX.Element;
|
|
11
|
+
export { LoadingContext, LoadingProvider };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import Loading from "../../../../components/feedback/loading";
|
|
5
|
+
const LoadingContext = createContext({ isLoading: false, setIsLoading: () => { } });
|
|
6
|
+
const LoadingProvider = ({ children }) => {
|
|
7
|
+
// states
|
|
8
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
9
|
+
return (React.createElement(LoadingContext.Provider, { value: { isLoading, setIsLoading } },
|
|
10
|
+
children,
|
|
11
|
+
isLoading && ReactDOM.createPortal(React.createElement(Loading, null), document.body)));
|
|
12
|
+
};
|
|
13
|
+
export { LoadingContext, LoadingProvider };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import IButtonProps from "../../../../components/form/button/IProps";
|
|
3
|
+
export type Status = "success" | "warning" | "information" | "error";
|
|
4
|
+
export type Direction = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
5
|
+
type Props = {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
direction: Direction;
|
|
8
|
+
};
|
|
9
|
+
export type PopupButtonConfig = {
|
|
10
|
+
okay?: IButtonProps;
|
|
11
|
+
cancel?: IButtonProps;
|
|
12
|
+
};
|
|
13
|
+
type NotificationContextProps = {
|
|
14
|
+
setTitle: React.Dispatch<React.SetStateAction<string>>;
|
|
15
|
+
setMessage: React.Dispatch<React.SetStateAction<string>>;
|
|
16
|
+
setStatus: React.Dispatch<React.SetStateAction<Status | number>>;
|
|
17
|
+
setPopupStatus: React.Dispatch<React.SetStateAction<(Status | "save" | "delete") | number>>;
|
|
18
|
+
setTrigger: React.Dispatch<React.SetStateAction<boolean>>;
|
|
19
|
+
setIsPopupOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
20
|
+
setPopupButtons: React.Dispatch<React.SetStateAction<PopupButtonConfig | null>>;
|
|
21
|
+
setOnConfirm: React.Dispatch<React.SetStateAction<((confirm: boolean) => void) | null>>;
|
|
22
|
+
};
|
|
23
|
+
declare const NotificationContext: React.Context<Partial<NotificationContextProps>>;
|
|
24
|
+
declare const NotificationProvider: ({ children, direction }: Props) => React.JSX.Element;
|
|
25
|
+
export { NotificationContext, NotificationProvider };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
import Notification from "../../../../components/feedback/notification";
|
|
4
|
+
import PopupConfirm from "../../../../components/feedback/popup-confirm";
|
|
5
|
+
const NotificationContext = createContext({});
|
|
6
|
+
const NotificationProvider = ({ children, direction }) => {
|
|
7
|
+
const [title, setTitle] = useState("Example");
|
|
8
|
+
const [message, setMessage] = useState("Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.");
|
|
9
|
+
const [status, setStatus] = useState("success");
|
|
10
|
+
const [popupStatus, setPopupStatus] = useState("success");
|
|
11
|
+
const [trigger, setTrigger] = useState(false);
|
|
12
|
+
const [isPopupOpen, setIsPopupOpen] = useState(false);
|
|
13
|
+
const [popupButtons, setPopupButtons] = useState(null);
|
|
14
|
+
const [onConfirm, setOnConfirm] = useState(null);
|
|
15
|
+
return (React.createElement(NotificationContext.Provider, { value: {
|
|
16
|
+
setTitle,
|
|
17
|
+
setMessage,
|
|
18
|
+
setStatus,
|
|
19
|
+
setPopupStatus,
|
|
20
|
+
setTrigger,
|
|
21
|
+
setIsPopupOpen,
|
|
22
|
+
setPopupButtons,
|
|
23
|
+
setOnConfirm,
|
|
24
|
+
} },
|
|
25
|
+
children,
|
|
26
|
+
React.createElement(Notification, { title: title, message: message, status: status, direction: direction, trigger: trigger }),
|
|
27
|
+
React.createElement(PopupConfirm, { title: title, message: message, status: popupStatus, isOpen: isPopupOpen, buttons: popupButtons, onConfirm: onConfirm })));
|
|
28
|
+
};
|
|
29
|
+
export { NotificationContext, NotificationProvider };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigProvider } from "./Config";
|
|
2
|
+
import { NotificationProvider } from "./Notification";
|
|
3
|
+
import { LanguageProvider } from "./Language";
|
|
4
|
+
import { LoadingProvider } from "./Loading";
|
|
5
|
+
export { ConfigProvider, LanguageProvider, NotificationProvider, LoadingProvider };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConfigProvider } from "./Config";
|
|
2
|
+
import { NotificationProvider } from "./Notification";
|
|
3
|
+
import { LanguageProvider } from "./Language";
|
|
4
|
+
import { LoadingProvider } from "./Loading";
|
|
5
|
+
export { ConfigProvider, LanguageProvider, NotificationProvider, LoadingProvider };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import useNotification from "./useNotification";
|
|
2
|
+
import useValidation from "./useValidation";
|
|
3
|
+
import useTranslation from "./useTranslation";
|
|
4
|
+
declare const useLayout: () => {
|
|
5
|
+
config: {
|
|
6
|
+
layout: {
|
|
7
|
+
sider: {
|
|
8
|
+
left: {
|
|
9
|
+
element: React.ReactNode | null;
|
|
10
|
+
active: boolean;
|
|
11
|
+
};
|
|
12
|
+
right: {
|
|
13
|
+
element: React.ReactNode | null;
|
|
14
|
+
active: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
perPage: number;
|
|
19
|
+
};
|
|
20
|
+
setConfig: React.Dispatch<React.SetStateAction<{
|
|
21
|
+
layout: {
|
|
22
|
+
sider: {
|
|
23
|
+
left: {
|
|
24
|
+
element: React.ReactNode | null;
|
|
25
|
+
active: boolean;
|
|
26
|
+
};
|
|
27
|
+
right: {
|
|
28
|
+
element: React.ReactNode | null;
|
|
29
|
+
active: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
perPage: number;
|
|
34
|
+
}>>;
|
|
35
|
+
};
|
|
36
|
+
declare const useLoading: () => {
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
39
|
+
};
|
|
40
|
+
declare const useLanguage: () => string | undefined;
|
|
41
|
+
export { useLayout, useLoading, useLanguage, useTranslation, useNotification, useValidation };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { ConfigContext } from "../contexts/Config";
|
|
4
|
+
import { LanguageContext } from "../contexts/Language";
|
|
5
|
+
import { LoadingContext } from "../contexts/Loading";
|
|
6
|
+
import useNotification from "./useNotification";
|
|
7
|
+
import useValidation from "./useValidation";
|
|
8
|
+
import useTranslation from "./useTranslation";
|
|
9
|
+
const useLayout = () => {
|
|
10
|
+
const context = useContext(ConfigContext);
|
|
11
|
+
if (!context)
|
|
12
|
+
throw new Error("useLayout must be used within a LayoutProvider");
|
|
13
|
+
return context;
|
|
14
|
+
};
|
|
15
|
+
const useLoading = () => useContext(LoadingContext);
|
|
16
|
+
const useLanguage = () => useContext(LanguageContext);
|
|
17
|
+
export { useLayout, useLoading, useLanguage, useTranslation, useNotification, useValidation };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PopupButtonConfig, Status } from "../contexts/Notification";
|
|
2
|
+
declare const useNotification: () => {
|
|
3
|
+
notification: ({ title, message, status }: {
|
|
4
|
+
title: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
status: Status | number;
|
|
7
|
+
}) => void;
|
|
8
|
+
popupConfirm: ({ title, message, status, buttons, onConfirm, }: {
|
|
9
|
+
title: string;
|
|
10
|
+
message?: string;
|
|
11
|
+
status: (Status | "save" | "delete") | number;
|
|
12
|
+
buttons?: PopupButtonConfig | null;
|
|
13
|
+
onConfirm?: (confirm: boolean) => void;
|
|
14
|
+
}) => void;
|
|
15
|
+
};
|
|
16
|
+
export default useNotification;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { NotificationContext } from "../contexts/Notification";
|
|
3
|
+
const useNotification = () => {
|
|
4
|
+
// contexts
|
|
5
|
+
const { setTitle, setMessage, setStatus, setPopupStatus, setTrigger, setIsPopupOpen, setPopupButtons, setOnConfirm } = useContext(NotificationContext);
|
|
6
|
+
// methods
|
|
7
|
+
const notification = ({ title, message, status }) => {
|
|
8
|
+
setTitle?.(title);
|
|
9
|
+
setMessage?.(message ?? "");
|
|
10
|
+
setStatus?.(status);
|
|
11
|
+
setTrigger?.((trigger) => !trigger);
|
|
12
|
+
};
|
|
13
|
+
const popupConfirm = ({ title, message, status, buttons, onConfirm, }) => {
|
|
14
|
+
setTitle?.(title);
|
|
15
|
+
setMessage?.(message ?? "");
|
|
16
|
+
setPopupStatus?.(status);
|
|
17
|
+
setIsPopupOpen?.((trigger) => !trigger);
|
|
18
|
+
setPopupButtons?.(buttons ?? null);
|
|
19
|
+
setOnConfirm?.(() => onConfirm);
|
|
20
|
+
};
|
|
21
|
+
return { notification, popupConfirm };
|
|
22
|
+
};
|
|
23
|
+
export default useNotification;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { INotificationLocale } from "../locales";
|
|
2
|
+
import IKanbanBoardLocale from "../locales/kanban-board/IKanbanBoardLocale";
|
|
3
|
+
import ITableLocale from "../locales/table/ITableLocale";
|
|
4
|
+
type LocaleMap = Record<string, Record<string, any>>;
|
|
5
|
+
declare const useTranslation: <TBaseLocale>(currentLanguage: string | undefined, translations?: LocaleMap) => {
|
|
6
|
+
t: (key: Extract<keyof TBaseLocale | keyof ITableLocale | keyof IKanbanBoardLocale | keyof INotificationLocale, string>, ...args: any[]) => string;
|
|
7
|
+
currentLanguage: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
export default useTranslation;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Utils from "../../../infrastructure/shared/Utils";
|
|
2
|
+
import { NotificationEN, NotificationTR } from "../locales";
|
|
3
|
+
import KanbanBoardEN from "../locales/kanban-board/en";
|
|
4
|
+
import KanbanBoardTR from "../locales/kanban-board/tr";
|
|
5
|
+
import TableEN from "../locales/table/en";
|
|
6
|
+
import TableTR from "../locales/table/tr";
|
|
7
|
+
const useTranslation = function (currentLanguage, translations = {}) {
|
|
8
|
+
const merged = {};
|
|
9
|
+
const ExtraLocales = {
|
|
10
|
+
tr: { ...TableTR, ...KanbanBoardTR, ...NotificationTR },
|
|
11
|
+
en: { ...TableEN, ...KanbanBoardEN, ...NotificationEN },
|
|
12
|
+
};
|
|
13
|
+
const allLanguages = new Set([...Object.keys(translations), ...Object.keys(ExtraLocales)]);
|
|
14
|
+
allLanguages.forEach((lang) => {
|
|
15
|
+
merged[lang] = {
|
|
16
|
+
...translations[lang],
|
|
17
|
+
...ExtraLocales[lang],
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
const t = (key, ...args) => {
|
|
21
|
+
return Utils.StringFormat(merged[currentLanguage ?? "tr"][key], ...args) ?? "";
|
|
22
|
+
};
|
|
23
|
+
return { t, currentLanguage };
|
|
24
|
+
};
|
|
25
|
+
export default useTranslation;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ValidationProps } from "../../../infrastructure/types";
|
|
2
|
+
declare const useValidation: <TData extends object>(data: TData, params: ValidationProps<TData>[], step?: number) => {
|
|
3
|
+
onSubmit: (callback: (result: boolean) => void) => void;
|
|
4
|
+
setSubmit: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
+
errors: Partial<{ [key in keyof TData]: string; }>;
|
|
6
|
+
};
|
|
7
|
+
export default useValidation;
|