@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,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/form/button-action/styles.css";
|
|
4
|
+
import Button from "../button";
|
|
5
|
+
import ReactDOM from "react-dom";
|
|
6
|
+
const ButtonAction = ({ buttons }) => {
|
|
7
|
+
// refs
|
|
8
|
+
const _wrapper = useRef(null);
|
|
9
|
+
const _button = useRef(null);
|
|
10
|
+
const _list = useRef(null);
|
|
11
|
+
// states
|
|
12
|
+
const [open, setOpen] = useState(false);
|
|
13
|
+
// methods
|
|
14
|
+
const handleClickOutSide = (event) => {
|
|
15
|
+
const target = event.target;
|
|
16
|
+
if (_wrapper.current && !_wrapper.current.contains(target))
|
|
17
|
+
setOpen(false);
|
|
18
|
+
};
|
|
19
|
+
const handleKeys = (event) => {
|
|
20
|
+
const key = event.key;
|
|
21
|
+
if (key === "Escape")
|
|
22
|
+
setOpen(false);
|
|
23
|
+
};
|
|
24
|
+
const handlePosition = () => {
|
|
25
|
+
if (_wrapper.current && _button.current && _list.current) {
|
|
26
|
+
const elementRect = _button.current.getBoundingClientRect();
|
|
27
|
+
const popoverRect = _list.current.getBoundingClientRect();
|
|
28
|
+
if (elementRect) {
|
|
29
|
+
const screenCenterX = window.innerWidth / 2;
|
|
30
|
+
const screenCenterY = window.innerHeight / 2;
|
|
31
|
+
const sx = window.scrollX || document.documentElement.scrollLeft;
|
|
32
|
+
const sy = window.scrollY || document.documentElement.scrollTop;
|
|
33
|
+
_list.current.style.visibility = "visible";
|
|
34
|
+
_list.current.style.opacity = "1";
|
|
35
|
+
_list.current.style.top = `${(elementRect.top > screenCenterY
|
|
36
|
+
? elementRect.top - popoverRect.height + elementRect.height
|
|
37
|
+
: elementRect.top) + sy}px`;
|
|
38
|
+
_list.current.style.left = `${(elementRect.left > screenCenterX
|
|
39
|
+
? elementRect.right - (elementRect.width + 7.5) - popoverRect.width
|
|
40
|
+
: elementRect.left + elementRect.width + 7.5) + sx}px`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const handleResizeEvent = () => setOpen(false);
|
|
45
|
+
// useEffects
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!open)
|
|
48
|
+
return;
|
|
49
|
+
setTimeout(() => handlePosition(), 0);
|
|
50
|
+
window.addEventListener("blur", () => setOpen(false));
|
|
51
|
+
window.addEventListener("resize", handleResizeEvent);
|
|
52
|
+
document.addEventListener("click", handleClickOutSide);
|
|
53
|
+
document.addEventListener("keydown", handleKeys);
|
|
54
|
+
return () => {
|
|
55
|
+
window.removeEventListener("blur", () => setOpen(false));
|
|
56
|
+
window.removeEventListener("resize", handleResizeEvent);
|
|
57
|
+
document.removeEventListener("click", handleClickOutSide);
|
|
58
|
+
document.removeEventListener("keydown", handleKeys);
|
|
59
|
+
};
|
|
60
|
+
}, [open]);
|
|
61
|
+
return (React.createElement("div", { ref: _wrapper, className: "ar-button-action" },
|
|
62
|
+
React.createElement("span", { ref: _button },
|
|
63
|
+
React.createElement(Button, { variant: "borderless", color: "light", icon: { element: React.createElement("span", { className: "dotted" }) }, onClick: () => setOpen((prev) => !prev) })),
|
|
64
|
+
open &&
|
|
65
|
+
ReactDOM.createPortal(React.createElement("span", { ref: _list, className: "ar-action-buttons" }, buttons.map((button, index) => (React.createElement(Button, { key: index, style: { display: "flex", justifyContent: "flex-start" }, variant: "borderless", color: button.color ?? "blue", size: "small", icon: button.icon, onClick: button.onClick }, button.text)))), document.body)));
|
|
66
|
+
};
|
|
67
|
+
ButtonAction.displayName = "ButtonAction";
|
|
68
|
+
export default ButtonAction;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import "../../../assets/css/components/form/button-group/styles.css";
|
|
3
|
+
import Button from "../button";
|
|
4
|
+
declare const ButtonGroup: React.FC<{
|
|
5
|
+
children: ReactElement<typeof Button> | ReactElement<typeof Button>[];
|
|
6
|
+
}>;
|
|
7
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/form/button-group/styles.css";
|
|
4
|
+
import Button from "../button";
|
|
5
|
+
import Alert from "../../feedback/alert";
|
|
6
|
+
const ButtonGroup = ({ children }) => {
|
|
7
|
+
// states
|
|
8
|
+
const [error, setError] = useState(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
try {
|
|
11
|
+
// Çocuk elemanların sadece `Button` bileşenleri olduğundan emin olun
|
|
12
|
+
React.Children.forEach(children, (child) => {
|
|
13
|
+
if (!React.isValidElement(child) || child.type !== Button) {
|
|
14
|
+
throw new Error("ButtonGroup can only have Button elements as children.");
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
// Hata yoksa, error'u temizle
|
|
18
|
+
setError(null);
|
|
19
|
+
}
|
|
20
|
+
catch (err) {
|
|
21
|
+
if (err instanceof Error) {
|
|
22
|
+
// Hata varsa error state'e yaz
|
|
23
|
+
setError(err.message);
|
|
24
|
+
console.error(err.message);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}, [children]); // children değişirse kontrolü tekrar yap
|
|
28
|
+
return React.createElement("div", { className: "ar-button-group" }, error ? React.createElement(Alert, { status: "danger", message: error }) : children);
|
|
29
|
+
};
|
|
30
|
+
ButtonGroup.displayName = "ButtonGroup";
|
|
31
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IUpperCaseProps, IValidationProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "type" | "size" | "color"> {
|
|
3
|
+
label?: string;
|
|
4
|
+
}
|
|
5
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
3
|
+
import React, { forwardRef, useRef } from "react";
|
|
4
|
+
import "../../../assets/css/components/form/checkbox/checkbox.css";
|
|
5
|
+
const Checkbox = forwardRef(({ label, color = "blue", border = { radius: "sm" }, upperCase, ...attributes }, ref) => {
|
|
6
|
+
// refs
|
|
7
|
+
const _checkbox = useRef(null);
|
|
8
|
+
const _checkboxClassName = ["ar-checkbox"];
|
|
9
|
+
_checkboxClassName.push(...Utils.GetClassName("filled", undefined, attributes.checked ? color : "light", border, undefined, undefined, attributes.className));
|
|
10
|
+
return (React.createElement("div", { className: "ar-checkbox-wrapper" },
|
|
11
|
+
React.createElement("label", null,
|
|
12
|
+
React.createElement("input", { ref: ref, type: "checkbox", ...attributes, size: 0, onChange: (event) => {
|
|
13
|
+
// (() => {
|
|
14
|
+
// const _current = _checkbox.current;
|
|
15
|
+
// if (!_current) return;
|
|
16
|
+
// })();
|
|
17
|
+
(() => attributes.onChange && attributes.onChange(event))();
|
|
18
|
+
} }),
|
|
19
|
+
React.createElement("span", null,
|
|
20
|
+
React.createElement("span", { ref: _checkbox, className: _checkboxClassName.map((c) => c).join(" ") }),
|
|
21
|
+
label && React.createElement("span", { className: "label" }, upperCase ? label.toUpperCase() : label)))));
|
|
22
|
+
});
|
|
23
|
+
Checkbox.displayName = "Checkbox";
|
|
24
|
+
export default Checkbox;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare class DATE {
|
|
2
|
+
Parse: (value: string, isCloack?: boolean) => {
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
day: number;
|
|
6
|
+
hours: number;
|
|
7
|
+
minutes: number;
|
|
8
|
+
};
|
|
9
|
+
ParseValue: (value: string, isCloack?: boolean) => string;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: DATE;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
class DATE {
|
|
2
|
+
Parse = (value, isCloack = false) => {
|
|
3
|
+
// Seçilmiş Tarih ve Zaman
|
|
4
|
+
const [sd, st] = value.split("T");
|
|
5
|
+
const [y, m, d] = sd.split("-").map(Number);
|
|
6
|
+
// Zaman Bilgileri
|
|
7
|
+
const [c, _] = isCloack && st ? st.split(".") : "00:00";
|
|
8
|
+
const [hh, mm] = isCloack ? c.split(":").map(Number) : [0, 0];
|
|
9
|
+
return {
|
|
10
|
+
year: y,
|
|
11
|
+
month: m,
|
|
12
|
+
day: d,
|
|
13
|
+
hours: hh,
|
|
14
|
+
minutes: mm,
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
ParseValue = (value, isCloack = false) => {
|
|
18
|
+
const [date, time] = value.split("T");
|
|
19
|
+
const [hour, minute] = isCloack && time ? time.split(":") : ["hh", "mm"];
|
|
20
|
+
if (!isCloack)
|
|
21
|
+
return date || "";
|
|
22
|
+
if (!date)
|
|
23
|
+
return "";
|
|
24
|
+
return `${date}T${hour}:${minute}`;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default new DATE();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IStatusProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
type Props = {
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
config?: {
|
|
5
|
+
locale?: Intl.LocalesArgument;
|
|
6
|
+
isClock?: boolean;
|
|
7
|
+
isFooterButton?: boolean;
|
|
8
|
+
};
|
|
9
|
+
} & IVariantProps & IColorProps & IStatusProps & IBorderProps & IValidationProps & Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "onChange" | "color">;
|
|
10
|
+
export default Props;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/form/date-picker/date-picker.css";
|
|
4
|
+
import Input from "../input";
|
|
5
|
+
import Button from "../button";
|
|
6
|
+
import Alert from "../../feedback/alert";
|
|
7
|
+
import ReactDOM from "react-dom";
|
|
8
|
+
import DATE from "./DATE";
|
|
9
|
+
const weekdays = ["Pzt", "Sal", "Çar", "Per", "Cum", "Cmt", "Paz"];
|
|
10
|
+
const months = [
|
|
11
|
+
{ value: 0, text: "Ocak" },
|
|
12
|
+
{ value: 1, text: "Şubat" },
|
|
13
|
+
{ value: 2, text: "Mart" },
|
|
14
|
+
{ value: 3, text: "Nisan" },
|
|
15
|
+
{ value: 4, text: "Mayıs" },
|
|
16
|
+
{ value: 5, text: "Haziran" },
|
|
17
|
+
{ value: 6, text: "Temmuz" },
|
|
18
|
+
{ value: 7, text: "Ağustos" },
|
|
19
|
+
{ value: 8, text: "Eylül" },
|
|
20
|
+
{ value: 9, text: "Ekim" },
|
|
21
|
+
{ value: 10, text: "Kasım" },
|
|
22
|
+
{ value: 11, text: "Aralık" },
|
|
23
|
+
];
|
|
24
|
+
const DatePicker = ({ variant, color, onChange, config, validation, ...attributes }) => {
|
|
25
|
+
// refs
|
|
26
|
+
const _arCalendar = useRef(null);
|
|
27
|
+
const _arClock = useRef(null);
|
|
28
|
+
const _placeholder = useRef(null);
|
|
29
|
+
const _calendarHeader = useRef(null);
|
|
30
|
+
const _calendarFooter = useRef(null);
|
|
31
|
+
const _clockHeader = useRef(null);
|
|
32
|
+
const _clockFooter = useRef(null);
|
|
33
|
+
const _currentDate = useRef(new Date()).current;
|
|
34
|
+
const _beginDate = useRef(null);
|
|
35
|
+
// refs -> Geçerli Tarih ve Saat Bilgileri.
|
|
36
|
+
const _year = useRef(_currentDate.getFullYear());
|
|
37
|
+
const _month = useRef(_currentDate.getMonth());
|
|
38
|
+
const _day = useRef(_currentDate.getDate());
|
|
39
|
+
const _hours = useRef(_currentDate.getHours());
|
|
40
|
+
const _minutes = useRef(_currentDate.getMinutes());
|
|
41
|
+
// refs -> List Elements
|
|
42
|
+
const _hoursListElement = useRef(null);
|
|
43
|
+
const _hoursLiElements = useRef([]);
|
|
44
|
+
const _minutesListElement = useRef(null);
|
|
45
|
+
const _minutesLiElements = useRef([]);
|
|
46
|
+
// states
|
|
47
|
+
const [calendarIsOpen, setCalendarIsOpen] = useState(false);
|
|
48
|
+
const [calendarDays, setCalendarDays] = useState([]);
|
|
49
|
+
const [years, setYears] = useState([]);
|
|
50
|
+
const [hours, setHours] = useState();
|
|
51
|
+
const [minutes, setMinutes] = useState();
|
|
52
|
+
const [dateChanged, setDateChanged] = useState(false);
|
|
53
|
+
const [timeChanged, setTimeChanged] = useState(false);
|
|
54
|
+
// states => Seçilmiş Tarihler
|
|
55
|
+
const [selectedYear, setSelectedYear] = useState(_currentDate.getFullYear());
|
|
56
|
+
const [selectedMonth, setSelectedMonth] = useState(_currentDate.getMonth());
|
|
57
|
+
const [selectedDay, setSelectedDay] = useState(_currentDate.getDate());
|
|
58
|
+
const [selectedHours, setSelectedHours] = useState(_currentDate.getHours());
|
|
59
|
+
const [selectedMinutes, setSelectedMinutes] = useState(_currentDate.getMinutes());
|
|
60
|
+
// methods
|
|
61
|
+
const handleClickOutSide = (event) => {
|
|
62
|
+
const target = event.target;
|
|
63
|
+
if (target === _beginDate.current)
|
|
64
|
+
return;
|
|
65
|
+
if (_arCalendar.current && !_arCalendar.current.contains(target))
|
|
66
|
+
closeCalendar();
|
|
67
|
+
};
|
|
68
|
+
const handleKeys = (event) => {
|
|
69
|
+
const key = event.key;
|
|
70
|
+
if (key === "Escape") {
|
|
71
|
+
event.stopPropagation();
|
|
72
|
+
closeCalendar();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const handlePosition = () => {
|
|
76
|
+
if (_arCalendar.current && _beginDate.current) {
|
|
77
|
+
const arCalendarRect = _arCalendar.current.getBoundingClientRect();
|
|
78
|
+
const InpuRect = _beginDate.current?.getBoundingClientRect();
|
|
79
|
+
if (InpuRect) {
|
|
80
|
+
const screenCenterX = window.innerWidth / 2;
|
|
81
|
+
const screenCenterY = window.innerHeight / 2;
|
|
82
|
+
const sx = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
83
|
+
const sy = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
84
|
+
const _isClock = InpuRect.left > screenCenterX ? -Math.abs(config?.isClock ? 7.5 * 16.75 : 0) : 0;
|
|
85
|
+
_arCalendar.current.style.visibility = "visible";
|
|
86
|
+
_arCalendar.current.style.opacity = "1";
|
|
87
|
+
_arCalendar.current.style.top = `${(InpuRect.top > screenCenterY ? InpuRect.top - arCalendarRect.height : InpuRect.top + InpuRect.height) + sy}px`;
|
|
88
|
+
_arCalendar.current.style.left = `${(InpuRect.left > screenCenterX ? InpuRect.right - arCalendarRect.width : InpuRect.left) + sx + _isClock}px`;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const handleHeight = () => {
|
|
93
|
+
if (_arCalendar.current && _arClock.current) {
|
|
94
|
+
const calendar = _arCalendar.current?.getBoundingClientRect()?.height;
|
|
95
|
+
_arClock.current.style.maxHeight = `${calendar}px`;
|
|
96
|
+
}
|
|
97
|
+
if (_calendarHeader.current && _clockHeader.current) {
|
|
98
|
+
const calendarHeaderH = _calendarHeader.current?.getBoundingClientRect()?.height;
|
|
99
|
+
_clockHeader.current.style.minHeight = `${calendarHeaderH}px`;
|
|
100
|
+
}
|
|
101
|
+
if (_calendarFooter && _clockFooter.current) {
|
|
102
|
+
const calendarFooterH = _calendarFooter.current?.getBoundingClientRect()?.height;
|
|
103
|
+
_clockFooter.current.style.minHeight = `${calendarFooterH}px`;
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const handleOk = (isShutdownOn = true) => {
|
|
107
|
+
// Stateler güncelleniyor...
|
|
108
|
+
setSelectedYear(_year.current);
|
|
109
|
+
setSelectedMonth(_month.current);
|
|
110
|
+
setSelectedDay(_day.current);
|
|
111
|
+
setSelectedHours(_hours.current);
|
|
112
|
+
setSelectedMinutes(_minutes.current);
|
|
113
|
+
const inputDate = new Date(Date.UTC(_year.current, _month.current, _day.current, !config?.isClock ? 0 : _hours.current, !config?.isClock ? 0 : _minutes.current, 0));
|
|
114
|
+
onChange(inputDate.toISOString());
|
|
115
|
+
isShutdownOn && setCalendarIsOpen(false);
|
|
116
|
+
};
|
|
117
|
+
const setNowButton = () => {
|
|
118
|
+
const now = new Date();
|
|
119
|
+
// Stateler güncelleniyor...
|
|
120
|
+
setSelectedYear(now.getFullYear());
|
|
121
|
+
setSelectedMonth(now.getMonth());
|
|
122
|
+
setSelectedDay(now.getDate());
|
|
123
|
+
setSelectedHours(now.getHours());
|
|
124
|
+
setSelectedMinutes(now.getMinutes());
|
|
125
|
+
_year.current = now.getFullYear();
|
|
126
|
+
_month.current = now.getMonth();
|
|
127
|
+
_day.current = now.getDate();
|
|
128
|
+
_hours.current = now.getHours();
|
|
129
|
+
_minutes.current = now.getMinutes();
|
|
130
|
+
// Takvim kapatılıyor...
|
|
131
|
+
setCalendarIsOpen(false);
|
|
132
|
+
// Değer gönderiliyor...
|
|
133
|
+
const inputDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), !config?.isClock ? 0 : now.getHours(), !config?.isClock ? 0 : now.getMinutes(), 0));
|
|
134
|
+
onChange(inputDate.toISOString());
|
|
135
|
+
};
|
|
136
|
+
const okayButton = () => {
|
|
137
|
+
return (React.createElement(Button, { variant: "borderless", color: "green", onClick: () => handleOk() }, "Tamam"));
|
|
138
|
+
};
|
|
139
|
+
const closeCalendar = () => {
|
|
140
|
+
const { year, month, day, hours, minutes } = DATE.Parse(String(attributes.value), config?.isClock);
|
|
141
|
+
_year.current = attributes.value ? year : selectedYear;
|
|
142
|
+
_month.current = attributes.value ? month - 1 : selectedMonth;
|
|
143
|
+
_day.current = attributes.value ? day : selectedDay;
|
|
144
|
+
_hours.current = attributes.value ? hours : selectedHours;
|
|
145
|
+
_minutes.current = attributes.value ? minutes : selectedMinutes;
|
|
146
|
+
setCalendarIsOpen(false);
|
|
147
|
+
};
|
|
148
|
+
// useEffects
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (calendarIsOpen) {
|
|
151
|
+
setTimeout(() => {
|
|
152
|
+
handleHeight();
|
|
153
|
+
handlePosition();
|
|
154
|
+
}, 0);
|
|
155
|
+
const days = [];
|
|
156
|
+
const firstDayOfMonth = new Date(_year.current, _month.current, 1);
|
|
157
|
+
const lastDayOfMonth = new Date(_year.current, _month.current + 1, 0);
|
|
158
|
+
const startingDay = firstDayOfMonth.getDay() === 0 ? 7 : firstDayOfMonth.getDay();
|
|
159
|
+
const endingDay = lastDayOfMonth.getDay() === 0 ? 7 : lastDayOfMonth.getDay();
|
|
160
|
+
for (let i = 1; i < startingDay; i++) {
|
|
161
|
+
days.push(React.createElement("span", { key: `prev-${i}`, className: "empty-day" }));
|
|
162
|
+
}
|
|
163
|
+
for (let i = firstDayOfMonth.getDate(); i <= lastDayOfMonth.getDate(); i++) {
|
|
164
|
+
const isSelected = !isNaN(firstDayOfMonth.getTime())
|
|
165
|
+
? firstDayOfMonth.getFullYear() === _year.current &&
|
|
166
|
+
firstDayOfMonth.getMonth() === _month.current &&
|
|
167
|
+
i === _day.current
|
|
168
|
+
: _currentDate.getFullYear() === _year.current &&
|
|
169
|
+
_currentDate.getMonth() === _month.current &&
|
|
170
|
+
i === _day.current;
|
|
171
|
+
days.push(React.createElement("span", { key: `current-${i}`, className: isSelected ? "selection-day" : "", onClick: (event) => {
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
_day.current = i;
|
|
174
|
+
setSelectedDay(i);
|
|
175
|
+
setDateChanged(!dateChanged);
|
|
176
|
+
handleOk(false);
|
|
177
|
+
} },
|
|
178
|
+
React.createElement("span", null, i)));
|
|
179
|
+
}
|
|
180
|
+
for (let i = endingDay; i < 7; i++) {
|
|
181
|
+
days.push(React.createElement("span", { key: `next-${i}`, className: "empty-day" }));
|
|
182
|
+
}
|
|
183
|
+
setCalendarDays(days);
|
|
184
|
+
// window.addEventListener("blur", () => closeCalendar());
|
|
185
|
+
document.addEventListener("click", handleClickOutSide);
|
|
186
|
+
document.addEventListener("keydown", handleKeys);
|
|
187
|
+
}
|
|
188
|
+
return () => {
|
|
189
|
+
// window.removeEventListener("blur", () => closeCalendar());
|
|
190
|
+
document.removeEventListener("click", handleClickOutSide);
|
|
191
|
+
document.removeEventListener("keydown", handleKeys);
|
|
192
|
+
};
|
|
193
|
+
}, [dateChanged, calendarIsOpen]);
|
|
194
|
+
useEffect(() => {
|
|
195
|
+
const generateList = (count, current, setFunc) => {
|
|
196
|
+
const items = Array.from({ length: count }, (_, i) => (React.createElement("li", { ref: (element) => {
|
|
197
|
+
if (!element)
|
|
198
|
+
return;
|
|
199
|
+
count === 24 ? (_hoursLiElements.current[i] = element) : (_minutesLiElements.current[i] = element);
|
|
200
|
+
}, key: i, ...(current === i ? { className: "selection-time" } : {}), onClick: () => {
|
|
201
|
+
if (count === 24) {
|
|
202
|
+
setTimeChanged((prev) => !prev);
|
|
203
|
+
_hours.current = i;
|
|
204
|
+
setSelectedHours(i);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
setTimeChanged((prev) => !prev);
|
|
208
|
+
_minutes.current = i;
|
|
209
|
+
setSelectedMinutes(i);
|
|
210
|
+
}
|
|
211
|
+
handleOk(false);
|
|
212
|
+
} },
|
|
213
|
+
React.createElement("span", null,
|
|
214
|
+
React.createElement("span", null, i.toString().padStart(2, "0"))))));
|
|
215
|
+
setFunc(items);
|
|
216
|
+
};
|
|
217
|
+
// Listeler oluşturuyor...
|
|
218
|
+
generateList(24, _hours.current, setHours);
|
|
219
|
+
generateList(60, _minutes.current, setMinutes);
|
|
220
|
+
if (!config?.isClock)
|
|
221
|
+
return;
|
|
222
|
+
if (calendarIsOpen)
|
|
223
|
+
handleHeight();
|
|
224
|
+
// Seçim sonrasında en yukarı getirme işlemi için aşağıda yer alan kodlar yazılmıştır
|
|
225
|
+
const hourLiElement = _hoursLiElements.current[_hours.current];
|
|
226
|
+
const minuteLiElement = _minutesLiElements.current[_minutes.current];
|
|
227
|
+
if (hourLiElement) {
|
|
228
|
+
_hoursListElement.current?.scrollTo({
|
|
229
|
+
top: hourLiElement.offsetTop - _hoursListElement.current.offsetTop - 8,
|
|
230
|
+
behavior: "smooth",
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (minuteLiElement) {
|
|
234
|
+
_minutesListElement.current?.scrollTo({
|
|
235
|
+
top: minuteLiElement.offsetTop - _minutesListElement.current.offsetTop - 8,
|
|
236
|
+
behavior: "smooth",
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
}, [timeChanged, calendarIsOpen, config?.isClock]);
|
|
240
|
+
useEffect(() => {
|
|
241
|
+
if (isNaN(_year.current))
|
|
242
|
+
return;
|
|
243
|
+
const years = [];
|
|
244
|
+
// Son 20 yıl
|
|
245
|
+
for (let i = _year.current - 20; i <= _year.current; i++) {
|
|
246
|
+
years.push({ value: i, text: `${i}` });
|
|
247
|
+
}
|
|
248
|
+
// Önümüzdeki 20 yıl
|
|
249
|
+
for (let i = _year.current + 1; i <= _year.current + 20; i++) {
|
|
250
|
+
years.push({ value: i, text: `${i}` });
|
|
251
|
+
}
|
|
252
|
+
setYears(years);
|
|
253
|
+
}, [selectedYear]);
|
|
254
|
+
return (React.createElement("div", { className: "ar-date-picker" },
|
|
255
|
+
attributes.placeholder && attributes.placeholder.length > 0 && (React.createElement("label", { ref: _placeholder },
|
|
256
|
+
validation ? "* " : "",
|
|
257
|
+
attributes.placeholder)),
|
|
258
|
+
React.createElement("div", { className: "wrapper", style: {
|
|
259
|
+
clipPath: `polygon(
|
|
260
|
+
-15px 0,
|
|
261
|
+
10px -5px,
|
|
262
|
+
10px 5px,
|
|
263
|
+
calc(${_placeholder.current?.getBoundingClientRect().width}px + 7px) 5px,
|
|
264
|
+
calc(${_placeholder.current?.getBoundingClientRect().width}px + 7px) -5px,
|
|
265
|
+
100% -70px,
|
|
266
|
+
calc(100% + 5px) calc(100% + 5px),
|
|
267
|
+
-5px calc(100% + 5px)
|
|
268
|
+
)`,
|
|
269
|
+
} },
|
|
270
|
+
React.createElement(Input, { ref: _beginDate, variant: variant, color: color, ...attributes, value: DATE.ParseValue(String(attributes.value), config?.isClock), type: config?.isClock ? "datetime-local" : "date", onKeyDown: (event) => {
|
|
271
|
+
if (event.code === "Space")
|
|
272
|
+
event.preventDefault();
|
|
273
|
+
else if (event.code === "Enter")
|
|
274
|
+
handleOk();
|
|
275
|
+
}, onChange: (event) => {
|
|
276
|
+
// Disabled gelmesi durumunda işlem yapmasına izin verme...
|
|
277
|
+
if (attributes.disabled)
|
|
278
|
+
return;
|
|
279
|
+
(() => {
|
|
280
|
+
if (!calendarIsOpen)
|
|
281
|
+
setCalendarIsOpen(true);
|
|
282
|
+
const value = event.target.value;
|
|
283
|
+
const [date, time] = value.split("T");
|
|
284
|
+
const [year, month, day] = date.split("-").map(Number);
|
|
285
|
+
const hours = time ? time.split(".")[0].split(":").map(Number)[0] : 0;
|
|
286
|
+
const minutes = time ? time.split(".")[0].split(":").map(Number)[1] : 0;
|
|
287
|
+
_year.current = year;
|
|
288
|
+
_month.current = month - 1;
|
|
289
|
+
_day.current = day;
|
|
290
|
+
if (hours || minutes) {
|
|
291
|
+
_hours.current = hours;
|
|
292
|
+
_minutes.current = minutes;
|
|
293
|
+
}
|
|
294
|
+
// Yıl ve Ay'ı anlık yeniler.
|
|
295
|
+
setSelectedYear(_year.current);
|
|
296
|
+
setSelectedMonth(_month.current);
|
|
297
|
+
// Takvimi anlık yeniler.
|
|
298
|
+
setDateChanged((prev) => !prev);
|
|
299
|
+
setTimeChanged((prev) => !prev);
|
|
300
|
+
onChange(value);
|
|
301
|
+
})();
|
|
302
|
+
}, onClick: (event) => {
|
|
303
|
+
event.preventDefault();
|
|
304
|
+
setCalendarIsOpen(true);
|
|
305
|
+
}, autoComplete: "off", validation: validation })),
|
|
306
|
+
calendarIsOpen &&
|
|
307
|
+
ReactDOM.createPortal(React.createElement("div", { ref: _arCalendar, className: "ar-date-calendar" },
|
|
308
|
+
React.createElement("div", { ref: _calendarHeader, className: "header" },
|
|
309
|
+
React.createElement("div", { className: "select-field" },
|
|
310
|
+
React.createElement("div", { className: "prev" },
|
|
311
|
+
React.createElement("span", { onClick: () => {
|
|
312
|
+
_year.current -= 1;
|
|
313
|
+
setSelectedYear(_year.current);
|
|
314
|
+
setDateChanged((prev) => !prev);
|
|
315
|
+
} }),
|
|
316
|
+
React.createElement("span", { onClick: () => {
|
|
317
|
+
if (_month.current <= 0) {
|
|
318
|
+
_year.current -= 1;
|
|
319
|
+
_month.current = 12;
|
|
320
|
+
}
|
|
321
|
+
_month.current -= 1;
|
|
322
|
+
setSelectedYear(_year.current);
|
|
323
|
+
setSelectedMonth(_month.current);
|
|
324
|
+
setDateChanged((prev) => !prev);
|
|
325
|
+
} })),
|
|
326
|
+
React.createElement("div", { className: "selects" },
|
|
327
|
+
React.createElement("div", null,
|
|
328
|
+
React.createElement("span", null, months.find((month) => month.value === selectedMonth)?.text)),
|
|
329
|
+
React.createElement("div", null,
|
|
330
|
+
React.createElement("span", null, years.find((year) => year.value === selectedYear)?.text))),
|
|
331
|
+
React.createElement("div", { className: "next" },
|
|
332
|
+
React.createElement("span", { onClick: () => {
|
|
333
|
+
if (_month.current >= 11) {
|
|
334
|
+
_year.current += 1;
|
|
335
|
+
_month.current = -1;
|
|
336
|
+
}
|
|
337
|
+
_month.current += 1;
|
|
338
|
+
setSelectedYear(_year.current);
|
|
339
|
+
setSelectedMonth(_month.current);
|
|
340
|
+
setDateChanged((prev) => !prev);
|
|
341
|
+
} }),
|
|
342
|
+
React.createElement("span", { onClick: () => {
|
|
343
|
+
_year.current += 1;
|
|
344
|
+
setSelectedYear(_year.current);
|
|
345
|
+
setDateChanged((prev) => !prev);
|
|
346
|
+
} })))),
|
|
347
|
+
React.createElement("div", { className: "content" }, !isNaN(_month.current) && !isNaN(_year.current) ? (React.createElement("div", { className: "calendar" },
|
|
348
|
+
React.createElement("div", { className: "weekdays" }, weekdays.map((weekday, index) => (React.createElement("span", { key: index }, weekday)))),
|
|
349
|
+
React.createElement("div", { className: "days" }, calendarDays))) : (React.createElement(Alert, { status: "warning" }, "Ay veya y\u0131l se\u00E7imi yapman\u0131z gerekmektedir."))),
|
|
350
|
+
config?.isFooterButton && (React.createElement("div", { ref: _calendarFooter, className: "footer" },
|
|
351
|
+
React.createElement("div", null,
|
|
352
|
+
React.createElement(Button, { variant: "borderless", onClick: () => setNowButton() }, "\u015Eimdi")),
|
|
353
|
+
React.createElement("div", null, !config?.isClock && okayButton()))),
|
|
354
|
+
config?.isClock && (React.createElement("div", { ref: _arClock, className: "clock" },
|
|
355
|
+
React.createElement("div", { ref: _clockHeader, className: "header" },
|
|
356
|
+
_hours.current.toString().padStart(2, "0"),
|
|
357
|
+
" : ",
|
|
358
|
+
_minutes.current.toString().padStart(2, "0")),
|
|
359
|
+
React.createElement("div", { className: "content" },
|
|
360
|
+
React.createElement("ul", { ref: _hoursListElement }, hours),
|
|
361
|
+
React.createElement("ul", { ref: _minutesListElement }, minutes)),
|
|
362
|
+
React.createElement("div", { ref: _clockFooter, className: "footer" }, okayButton())))), document.body)));
|
|
363
|
+
};
|
|
364
|
+
DatePicker.displayName = "DatePicker";
|
|
365
|
+
export default DatePicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import IButtonProps from "../button/IProps";
|
|
2
|
+
import { Variants } from "../../../libs/infrastructure/types";
|
|
3
|
+
import { IBorderProps, IColorProps, IIconProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
4
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IIconProps, IUpperCaseProps, IValidationProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "color"> {
|
|
5
|
+
button?: Omit<IButtonProps, "size" | "shape" | "position" | "fullWidth">;
|
|
6
|
+
addon?: {
|
|
7
|
+
variant?: Variants;
|
|
8
|
+
before?: string | number;
|
|
9
|
+
after?: string | number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useRef, useState, useEffect, useMemo } from "react";
|
|
3
|
+
import Input from "..";
|
|
4
|
+
const Decimal = ({ variant, color, name, value, onChange, placeholder, validation, disabled, locale = "tr-TR", }) => {
|
|
5
|
+
const _input = useRef(null);
|
|
6
|
+
const [_value, setValue] = useState("");
|
|
7
|
+
// methods
|
|
8
|
+
const decimalSeparator = useMemo(() => {
|
|
9
|
+
const parts = new Intl.NumberFormat(locale).formatToParts(1.1);
|
|
10
|
+
return parts.find((p) => p.type === "decimal")?.value ?? ".";
|
|
11
|
+
}, [locale]);
|
|
12
|
+
const handleChange = (event) => {
|
|
13
|
+
let inputValue = event.target.value;
|
|
14
|
+
// Locale’a göre izin verilen karakterler. (rakam, decimal, -)
|
|
15
|
+
const regex = new RegExp(`[^0-9\\${decimalSeparator}-]`, "g");
|
|
16
|
+
inputValue = inputValue.replace(regex, "");
|
|
17
|
+
// Sadece başta negatif işarete izin ver.
|
|
18
|
+
if (inputValue.includes("-")) {
|
|
19
|
+
inputValue = (inputValue.startsWith("-") ? "-" : "") + inputValue.replace(/-/g, "");
|
|
20
|
+
}
|
|
21
|
+
// Tek decimal separator’a izin ver.
|
|
22
|
+
const parts = inputValue.split(decimalSeparator);
|
|
23
|
+
if (parts.length > 2) {
|
|
24
|
+
inputValue = parts[0] + decimalSeparator + parts.slice(1).join("");
|
|
25
|
+
}
|
|
26
|
+
setValue(inputValue);
|
|
27
|
+
// Parent’a normalize edilmiş "." decimal gönder.
|
|
28
|
+
const normalized = inputValue.replace(decimalSeparator, ".");
|
|
29
|
+
onChange?.({
|
|
30
|
+
...event,
|
|
31
|
+
target: {
|
|
32
|
+
...event.target,
|
|
33
|
+
name,
|
|
34
|
+
value: normalized,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
// useEffects
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (value === undefined || value === null || value === "") {
|
|
41
|
+
setValue("");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const stringValue = String(value);
|
|
45
|
+
const localized = stringValue.replace(".", decimalSeparator);
|
|
46
|
+
setValue(localized);
|
|
47
|
+
}, [value, decimalSeparator]);
|
|
48
|
+
return (React.createElement(Input, { ref: _input, name: name, variant: variant, color: color, type: "text", inputMode: "decimal", value: _value, onChange: (e) => {
|
|
49
|
+
if (disabled)
|
|
50
|
+
return;
|
|
51
|
+
handleChange(e);
|
|
52
|
+
}, placeholder: placeholder, validation: validation, disabled: disabled }));
|
|
53
|
+
};
|
|
54
|
+
export default Decimal;
|