@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,8 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IDisabledProps, IPlaceholderProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IUpperCaseProps, IValidationProps, IPlaceholderProps, IDisabledProps {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string | number | readonly string[] | undefined;
|
|
5
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
locale?: Intl.LocalesArgument;
|
|
7
|
+
}
|
|
8
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import Input from "..";
|
|
4
|
+
import NUMBER from "../../../../libs/infrastructure/shared/NUMBER";
|
|
5
|
+
const FormattedDecimal = ({ variant, color, name, value, onChange, locale = "tr-TR", digits, placeholder, validation, disabled, }) => {
|
|
6
|
+
const _input = useRef(null);
|
|
7
|
+
const [_value, setValue] = useState("");
|
|
8
|
+
// methods
|
|
9
|
+
const getSeparators = (locale) => {
|
|
10
|
+
const parts = new Intl.NumberFormat(locale).formatToParts(1000.1);
|
|
11
|
+
const group = parts.find((p) => p.type === "group")?.value ?? ",";
|
|
12
|
+
const decimal = parts.find((p) => p.type === "decimal")?.value ?? ".";
|
|
13
|
+
return { group, decimal };
|
|
14
|
+
};
|
|
15
|
+
const getFormatter = useMemo(() => NUMBER.Decimal(locale, digits), [locale, digits]);
|
|
16
|
+
const handleClick = () => {
|
|
17
|
+
const input = _input.current;
|
|
18
|
+
if (!input)
|
|
19
|
+
return;
|
|
20
|
+
const caret = input.selectionStart ?? 0;
|
|
21
|
+
input.setSelectionRange(caret, caret + 1);
|
|
22
|
+
};
|
|
23
|
+
const handleKeyUp = (event) => {
|
|
24
|
+
const input = _input.current;
|
|
25
|
+
if (!input)
|
|
26
|
+
return;
|
|
27
|
+
const caret = input.selectionStart ?? 0;
|
|
28
|
+
if (event.code === "ArrowRight") {
|
|
29
|
+
input.setSelectionRange(caret, caret + 1);
|
|
30
|
+
}
|
|
31
|
+
else if (event.code === "ArrowLeft" && caret > 0) {
|
|
32
|
+
input.setSelectionRange(caret - 1, caret);
|
|
33
|
+
}
|
|
34
|
+
else if (["ArrowUp", "ArrowDown"].includes(event.code)) {
|
|
35
|
+
input.setSelectionRange(caret, caret + 1);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleChange = (event) => {
|
|
39
|
+
let { value } = event.target;
|
|
40
|
+
const { group, decimal } = getSeparators(locale);
|
|
41
|
+
// Locale’a göre izin verilen karakterleri temizle.
|
|
42
|
+
const regex = new RegExp(`[^0-9\\${group}\\${decimal}]`, "g");
|
|
43
|
+
value = value.replace(regex, "");
|
|
44
|
+
// Normalize et (decimal her zaman "." olacak şekilde)
|
|
45
|
+
let normalized = value.replace(new RegExp(`\\${group}`, "g"), "").replace(decimal, ".");
|
|
46
|
+
const parsed = parseFloat(normalized);
|
|
47
|
+
const numericValue = isNaN(parsed) ? 0 : parsed;
|
|
48
|
+
const formatted = value === "" ? "" : getFormatter.format(numericValue);
|
|
49
|
+
setValue(formatted);
|
|
50
|
+
onChange?.({
|
|
51
|
+
...event,
|
|
52
|
+
target: {
|
|
53
|
+
...event.target,
|
|
54
|
+
name,
|
|
55
|
+
value: normalized,
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
// useEffects
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (value === undefined || value === null || value === "") {
|
|
62
|
+
setValue("");
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setValue(getFormatter.format(Number(value)));
|
|
66
|
+
}, [value, getFormatter]);
|
|
67
|
+
return (React.createElement(Input, { ref: _input, name: name, variant: variant, color: color, value: _value, type: "text", inputMode: "decimal", onChange: (event) => {
|
|
68
|
+
if (disabled)
|
|
69
|
+
return;
|
|
70
|
+
handleChange(event);
|
|
71
|
+
}, onClick: handleClick, onKeyUp: handleKeyUp, placeholder: placeholder, validation: validation, disabled: disabled }));
|
|
72
|
+
};
|
|
73
|
+
export default FormattedDecimal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IDisabledProps, IPlaceholderProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IUpperCaseProps, IValidationProps, IPlaceholderProps, IDisabledProps {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string | number | readonly string[] | undefined;
|
|
5
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
6
|
+
locale?: Intl.LocalesArgument;
|
|
7
|
+
digits?: {
|
|
8
|
+
minimum?: number;
|
|
9
|
+
maximum?: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../../../assets/css/components/form/input/styles.css";
|
|
3
|
+
import IProps from "./IProps";
|
|
4
|
+
import Otp from "./otp/Otp";
|
|
5
|
+
import FormattedDecimal from "./formatted-decimal/FormattedDecimal";
|
|
6
|
+
import Phone from "./phone/Phone";
|
|
7
|
+
import Decimal from "./decimal/Decimal";
|
|
8
|
+
interface InputCompound extends React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLInputElement>> {
|
|
9
|
+
Decimal: typeof Decimal;
|
|
10
|
+
FormattedDecimal: typeof FormattedDecimal;
|
|
11
|
+
Phone: typeof Phone;
|
|
12
|
+
Otp: typeof Otp;
|
|
13
|
+
}
|
|
14
|
+
declare const Input: InputCompound;
|
|
15
|
+
export default Input;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
3
|
+
import "../../../assets/css/components/form/input/styles.css";
|
|
4
|
+
import Button from "../button";
|
|
5
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
6
|
+
import { ARIcon } from "../../icons";
|
|
7
|
+
import Otp from "./otp/Otp";
|
|
8
|
+
import FormattedDecimal from "./formatted-decimal/FormattedDecimal";
|
|
9
|
+
import Phone from "./phone/Phone";
|
|
10
|
+
import Decimal from "./decimal/Decimal";
|
|
11
|
+
const BaseInput = forwardRef(({ variant = "outlined", color = "light", icon, border = { radius: "sm" }, button, addon, upperCase, validation, ...attributes }, ref) => {
|
|
12
|
+
// refs
|
|
13
|
+
const _innerRef = useRef(null);
|
|
14
|
+
const _label = useRef(null);
|
|
15
|
+
// states
|
|
16
|
+
const [value, setValue] = useState("");
|
|
17
|
+
// hooks
|
|
18
|
+
// Dışarıdan gelen ref'i _innerRef'e bağla.
|
|
19
|
+
useImperativeHandle(ref, () => _innerRef.current);
|
|
20
|
+
// variables
|
|
21
|
+
const _wrapperClassName = ["ar-input-wrapper"];
|
|
22
|
+
const _inputClassName = [];
|
|
23
|
+
const _addonBeforeClassName = ["addon-before"];
|
|
24
|
+
const _addonAfterClassName = ["addon-after"];
|
|
25
|
+
_inputClassName.push(...Utils.GetClassName(variant, undefined, !Utils.IsNullOrEmpty(validation?.text) ? "red" : color, border, undefined, icon, attributes.className));
|
|
26
|
+
// addon className
|
|
27
|
+
if (addon) {
|
|
28
|
+
_wrapperClassName.push("addon");
|
|
29
|
+
_addonBeforeClassName.push(`${addon.variant || "filled"}`);
|
|
30
|
+
_addonBeforeClassName.push(`${status}`);
|
|
31
|
+
_addonAfterClassName.push(`${addon.variant || "filled"}`);
|
|
32
|
+
_addonAfterClassName.push(`${status}`);
|
|
33
|
+
_addonBeforeClassName.push(`border-radius-${border.radius}`);
|
|
34
|
+
_addonAfterClassName.push(`border-radius-${border.radius}`);
|
|
35
|
+
}
|
|
36
|
+
// methods
|
|
37
|
+
const handleNumberChange = (delta) => {
|
|
38
|
+
const current = Number(value) || 0;
|
|
39
|
+
const newValue = current + delta;
|
|
40
|
+
const dataset = _innerRef.current?.dataset ?? {};
|
|
41
|
+
setValue(newValue);
|
|
42
|
+
attributes.onChange?.({
|
|
43
|
+
target: {
|
|
44
|
+
id: attributes.id ?? "",
|
|
45
|
+
name: attributes.name ?? "",
|
|
46
|
+
value: String(newValue),
|
|
47
|
+
type: attributes.type ?? "number",
|
|
48
|
+
dataset: dataset,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
// Özel büyük harfe dönüştürme işlevi.
|
|
53
|
+
const convertToUpperCase = (str) => {
|
|
54
|
+
return str
|
|
55
|
+
.replace(/ş/g, "S")
|
|
56
|
+
.replace(/Ş/g, "S")
|
|
57
|
+
.replace(/ı/g, "I")
|
|
58
|
+
.replace(/I/g, "I")
|
|
59
|
+
.replace(/ç/g, "C")
|
|
60
|
+
.replace(/Ç/g, "C")
|
|
61
|
+
.replace(/ğ/g, "G")
|
|
62
|
+
.replace(/Ğ/g, "G")
|
|
63
|
+
.replace(/ö/g, "O")
|
|
64
|
+
.replace(/Ö/g, "O")
|
|
65
|
+
.replace(/ü/g, "U")
|
|
66
|
+
.replace(/Ü/g, "U")
|
|
67
|
+
.replace(/[a-z]/g, (match) => match.toUpperCase());
|
|
68
|
+
};
|
|
69
|
+
// useEffects
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (attributes.value !== undefined)
|
|
72
|
+
setValue(attributes.value ?? "");
|
|
73
|
+
}, [attributes.value]);
|
|
74
|
+
return (React.createElement("div", { className: _wrapperClassName.map((c) => c).join(" ") },
|
|
75
|
+
addon?.before && React.createElement("span", { className: _addonBeforeClassName.map((c) => c).join(" ") }, addon?.before),
|
|
76
|
+
React.createElement("div", { className: "ar-input" },
|
|
77
|
+
icon?.element && React.createElement("span", { className: "icon-element" }, icon.element),
|
|
78
|
+
attributes.placeholder && (React.createElement("label", { ref: _label, className: value ? "visible" : "hidden", ...(value ? { style: { maxWidth: _innerRef.current?.getBoundingClientRect().width } } : {}) },
|
|
79
|
+
validation && "* ",
|
|
80
|
+
attributes.placeholder)),
|
|
81
|
+
React.createElement("div", { className: "input" },
|
|
82
|
+
React.createElement("input", { ref: _innerRef, ...attributes, type: attributes.type === "number" ? "text" : attributes.type, placeholder: `${validation ? "* " : ""}${attributes.placeholder ?? ""}`, value: value ?? attributes.value, size: attributes.size || 20, className: _inputClassName.map((c) => c).join(" "), ...(attributes.type === "number"
|
|
83
|
+
? {
|
|
84
|
+
onKeyDown: (event) => {
|
|
85
|
+
const allowedKeys = ["Backspace", "Tab", "ArrowLeft", "ArrowRight", "Delete"];
|
|
86
|
+
const isNumberKey = /^[0-9]$/.test(event.key);
|
|
87
|
+
if (!isNumberKey && !allowedKeys.includes(event.key))
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
},
|
|
90
|
+
}
|
|
91
|
+
: {}), ...(value
|
|
92
|
+
? {
|
|
93
|
+
style: {
|
|
94
|
+
...attributes.style,
|
|
95
|
+
clipPath: `polygon(
|
|
96
|
+
-15px 0,
|
|
97
|
+
10px -5px,
|
|
98
|
+
10px 5px,
|
|
99
|
+
calc(${_label.current?.getBoundingClientRect().width}px + 7px) 5px,
|
|
100
|
+
calc(${_label.current?.getBoundingClientRect().width}px + 7px) -5px,
|
|
101
|
+
100% -70px,
|
|
102
|
+
calc(100% + 5px) calc(100% + 5px),
|
|
103
|
+
-5px calc(100% + 5px)
|
|
104
|
+
)`,
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
: { style: { ...attributes.style } }), onChange: (event) => {
|
|
108
|
+
// Disabled gelmesi durumunda işlem yapmasına izin verme...
|
|
109
|
+
if (attributes.disabled)
|
|
110
|
+
return;
|
|
111
|
+
(() => {
|
|
112
|
+
if (upperCase)
|
|
113
|
+
event.target.value = convertToUpperCase(event.target.value);
|
|
114
|
+
setValue(event.target.value);
|
|
115
|
+
})();
|
|
116
|
+
(() => {
|
|
117
|
+
if (attributes.onChange) {
|
|
118
|
+
// Mevcut değeri alın
|
|
119
|
+
const { value } = event.target;
|
|
120
|
+
const currentValue = upperCase ? convertToUpperCase(value) : value;
|
|
121
|
+
// Yeni değeri oluşturun ve onChange fonksiyonunu çağırın
|
|
122
|
+
// const newValue = `${addon?.before ?? ""}${currentValue}${addon?.after ?? ""}`;
|
|
123
|
+
attributes.onChange({
|
|
124
|
+
...event,
|
|
125
|
+
target: {
|
|
126
|
+
...event.target,
|
|
127
|
+
id: event.target.id,
|
|
128
|
+
name: event.target.name,
|
|
129
|
+
value: currentValue,
|
|
130
|
+
type: event.target.type,
|
|
131
|
+
dataset: event.target.dataset,
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
})();
|
|
136
|
+
} }),
|
|
137
|
+
!attributes.disabled && attributes.type === "number" && (React.createElement("div", { className: "handle-number-button" },
|
|
138
|
+
React.createElement("span", { onClick: () => handleNumberChange(1) },
|
|
139
|
+
React.createElement(ARIcon, { icon: "ChevronUp", size: 12, fill: "var(--gray-500)" })),
|
|
140
|
+
React.createElement("span", { onClick: () => handleNumberChange(-1) },
|
|
141
|
+
React.createElement(ARIcon, { icon: "ChevronDown", size: 12, fill: "var(--gray-500)" }))))),
|
|
142
|
+
validation?.text && React.createElement("span", { className: "validation" }, validation.text)),
|
|
143
|
+
addon?.after && React.createElement("span", { className: _addonAfterClassName.map((c) => c).join(" ") }, addon?.after),
|
|
144
|
+
button && React.createElement(Button, { ...button, border: { radius: border.radius }, disabled: attributes.disabled })));
|
|
145
|
+
});
|
|
146
|
+
const Input = BaseInput;
|
|
147
|
+
Input.Decimal = Decimal;
|
|
148
|
+
Input.FormattedDecimal = FormattedDecimal;
|
|
149
|
+
Input.Phone = Phone;
|
|
150
|
+
Input.Otp = Otp;
|
|
151
|
+
BaseInput.displayName = "Input";
|
|
152
|
+
export default Input;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IColorProps, IVariantProps } from "../../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
interface IProps extends IVariantProps, IColorProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "color"> {
|
|
3
|
+
character: number;
|
|
4
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
5
|
+
}
|
|
6
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useRef, useCallback, useState, useEffect } from "react";
|
|
3
|
+
import Input from "..";
|
|
4
|
+
const Otp = ({ character, onChange, ...attributes }) => {
|
|
5
|
+
// refs
|
|
6
|
+
const _inputs = useRef([]);
|
|
7
|
+
// states
|
|
8
|
+
const [otpValues, setOtpValues] = useState(() => Array(character).fill(""));
|
|
9
|
+
// methods
|
|
10
|
+
const triggerChange = (newValues, event) => {
|
|
11
|
+
setOtpValues(newValues);
|
|
12
|
+
const combinedValue = newValues.join("");
|
|
13
|
+
onChange?.({
|
|
14
|
+
...event,
|
|
15
|
+
target: {
|
|
16
|
+
...event.currentTarget,
|
|
17
|
+
name: attributes.name ?? "",
|
|
18
|
+
value: combinedValue,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const handleKeyDown = useCallback((index) => (event) => {
|
|
23
|
+
if (attributes.disabled)
|
|
24
|
+
return;
|
|
25
|
+
const { key } = event;
|
|
26
|
+
const currentInput = _inputs.current[index];
|
|
27
|
+
// Sol / Aşağı Ok Tuşları
|
|
28
|
+
if (key === "ArrowDown" || key === "ArrowLeft") {
|
|
29
|
+
event.preventDefault(); // Tarayıcı imleç hareketini engelle
|
|
30
|
+
if (index > 0) {
|
|
31
|
+
const prevInput = _inputs.current[index - 1];
|
|
32
|
+
prevInput?.focus();
|
|
33
|
+
setTimeout(() => prevInput?.select(), 0);
|
|
34
|
+
}
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Sağ / Yukarı Ok Tuşları
|
|
38
|
+
if (key === "ArrowUp" || key === "ArrowRight") {
|
|
39
|
+
event.preventDefault(); // Tarayıcı imleç hareketini engelle
|
|
40
|
+
if (index < character - 1) {
|
|
41
|
+
const nextInput = _inputs.current[index + 1];
|
|
42
|
+
nextInput?.focus();
|
|
43
|
+
setTimeout(() => nextInput?.select(), 0);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Backspace (Silme) İşlemi
|
|
48
|
+
if (key === "Backspace") {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
const newValues = [...otpValues];
|
|
51
|
+
if (otpValues[index] !== "") {
|
|
52
|
+
// Mevcut kutu doluysa temizle
|
|
53
|
+
newValues[index] = "";
|
|
54
|
+
triggerChange(newValues, event);
|
|
55
|
+
}
|
|
56
|
+
else if (index > 0) {
|
|
57
|
+
// Mevcut kutu boşsa bir öncekini temizle ve focus ol
|
|
58
|
+
newValues[index - 1] = "";
|
|
59
|
+
triggerChange(newValues, event);
|
|
60
|
+
_inputs.current[index - 1]?.focus();
|
|
61
|
+
setTimeout(() => _inputs.current[index - 1]?.select(), 0);
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Sadece rakamlara izin ver (Meta tuşları hariç: Ctrl+V, Cmd+V vb.)
|
|
66
|
+
if (!/[0-9]/.test(key) && key.length === 1 && !event.ctrlKey && !event.metaKey) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Eğer tek bir rakam basıldıysa ve input seçiliyse (üzerine yazma mantığı)
|
|
71
|
+
if (/[0-9]/.test(key) && key.length === 1) {
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
const newValues = [...otpValues];
|
|
74
|
+
newValues[index] = key; // Değeri set et (seçili olduğu için direkt üzerine yazar)
|
|
75
|
+
triggerChange(newValues, event);
|
|
76
|
+
// Son kutuda değilsek bir sonrakine geç ve seç
|
|
77
|
+
if (index < character - 1) {
|
|
78
|
+
const nextInput = _inputs.current[index + 1];
|
|
79
|
+
nextInput?.focus();
|
|
80
|
+
setTimeout(() => nextInput?.select(), 0);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
// Son kutudaysa sadece seçili bırak ki tekrar basıldığında üzerine yazabilsin
|
|
84
|
+
setTimeout(() => currentInput?.select(), 0);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, [character, otpValues, attributes.disabled, onChange, attributes.name]);
|
|
88
|
+
const handlePaste = useCallback((index) => (event) => {
|
|
89
|
+
event.preventDefault();
|
|
90
|
+
if (attributes.disabled)
|
|
91
|
+
return;
|
|
92
|
+
const pastedData = event.clipboardData.getData("text").trim();
|
|
93
|
+
if (!/^\d+$/.test(pastedData))
|
|
94
|
+
return; // Sadece rakam ise kabul et
|
|
95
|
+
const digits = pastedData.split("").slice(0, character - index);
|
|
96
|
+
const newValues = [...otpValues];
|
|
97
|
+
digits.forEach((digit, i) => {
|
|
98
|
+
if (index + i < character) {
|
|
99
|
+
newValues[index + i] = digit;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
triggerChange(newValues, event);
|
|
103
|
+
// Yapıştırılan son karaktere veya son input'a focus at
|
|
104
|
+
const focusIndex = Math.min(index + digits.length, character - 1);
|
|
105
|
+
const targetInput = _inputs.current[focusIndex];
|
|
106
|
+
targetInput?.focus();
|
|
107
|
+
setTimeout(() => targetInput?.select(), 0);
|
|
108
|
+
}, [character, otpValues, attributes.disabled]);
|
|
109
|
+
const handleClick = useCallback((event) => {
|
|
110
|
+
event.currentTarget.select();
|
|
111
|
+
}, []);
|
|
112
|
+
// useEffects
|
|
113
|
+
useEffect(() => {
|
|
114
|
+
setOtpValues(Array(character).fill(""));
|
|
115
|
+
}, [character]);
|
|
116
|
+
return (React.createElement("div", { className: "ar-input-otp-wrapper" }, Array.from({ length: character }, (_, index) => (React.createElement("span", { key: index },
|
|
117
|
+
React.createElement(Input, { ref: (el) => {
|
|
118
|
+
_inputs.current[index] = el;
|
|
119
|
+
}, ...attributes, value: otpValues[index], onChange: () => { }, onKeyDown: handleKeyDown(index), onPaste: handlePaste(index), onFocus: (event) => event.target.select(), onClick: handleClick, size: 1, maxLength: 1, placeholder: undefined, autoFocus: index === 0, autoComplete: "off" }))))));
|
|
120
|
+
};
|
|
121
|
+
Otp.displayName = "Input.Otp";
|
|
122
|
+
export default Otp;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IValidationProps, IVariantProps } from "../../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
import { Option } from "../../../../libs/infrastructure/types";
|
|
3
|
+
interface IProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "color">, IVariantProps, IColorProps, IBorderProps, IValidationProps {
|
|
4
|
+
options?: Option[];
|
|
5
|
+
values: {
|
|
6
|
+
option?: string;
|
|
7
|
+
value: string | number | readonly string[] | undefined;
|
|
8
|
+
};
|
|
9
|
+
onSelected?: (option: Option | undefined) => void;
|
|
10
|
+
}
|
|
11
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import Input from "..";
|
|
4
|
+
import Select from "../../select";
|
|
5
|
+
import PHONE from "../../../../libs/infrastructure/shared/PHONE";
|
|
6
|
+
const Phone = ({ variant, color, options, values, onSelected, validation, ...attributes }) => {
|
|
7
|
+
// refs
|
|
8
|
+
const _input = useRef(null);
|
|
9
|
+
// states
|
|
10
|
+
const [_value, setValue] = useState("");
|
|
11
|
+
const [selected, setSelected] = useState(undefined);
|
|
12
|
+
// options referans kararlılığı için JSON key
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
const optionsKey = useMemo(() => JSON.stringify(options), [options]);
|
|
15
|
+
// methods
|
|
16
|
+
const handleClick = () => {
|
|
17
|
+
const input = _input.current;
|
|
18
|
+
if (!input)
|
|
19
|
+
return;
|
|
20
|
+
const caret = input.selectionStart ?? 0;
|
|
21
|
+
input.setSelectionRange(caret, caret + 1);
|
|
22
|
+
};
|
|
23
|
+
// useEffects
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setValue(values.value);
|
|
26
|
+
setSelected(options?.find((option) => option.value === values.option));
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
}, [values.value, values.option, optionsKey]);
|
|
29
|
+
return (React.createElement("div", { className: "ar-input-phone-wrapper" },
|
|
30
|
+
options && (React.createElement(Select, { style: { width: 130 }, variant: "outlined", color: "light", options: options, value: selected, onChange: (option) => {
|
|
31
|
+
onSelected?.(option);
|
|
32
|
+
setSelected(option);
|
|
33
|
+
}, validation: validation, config: { validation: { text: "hidden" } } })),
|
|
34
|
+
React.createElement(Input, { ref: _input, ...attributes, ...(!options ? { style: { borderRadius: "var(--border-radius-sm)" } } : {}), variant: variant, color: color, value: PHONE.FormatByMask(selected?.value, _value), type: "tel", inputMode: "decimal", onChange: (event) => {
|
|
35
|
+
if (attributes.disabled)
|
|
36
|
+
return;
|
|
37
|
+
setValue(event.target.value);
|
|
38
|
+
attributes.onChange?.(event);
|
|
39
|
+
}, onClick: handleClick, validation: validation })));
|
|
40
|
+
};
|
|
41
|
+
export default Phone;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IBorderProps, IColorProps, IIconProps, ISizeProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
2
|
+
import { Color } from "../../../libs/infrastructure/types";
|
|
3
|
+
interface IProps extends IVariantProps, IColorProps, IBorderProps, IIconProps, ISizeProps, IUpperCaseProps, IValidationProps, Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "size" | "color"> {
|
|
4
|
+
label?: string;
|
|
5
|
+
trace?: {
|
|
6
|
+
color: Color;
|
|
7
|
+
};
|
|
8
|
+
pastTrace?: {
|
|
9
|
+
color: Color;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
|
+
import "../../../assets/css/components/form/radio/radio.css";
|
|
4
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
5
|
+
const Radio = forwardRef(({ label, size = "normal", color = "blue", border = { radius: "pill" }, trace, pastTrace, upperCase, validation, ...attributes }, ref) => {
|
|
6
|
+
// refs
|
|
7
|
+
const _innerRef = useRef(null);
|
|
8
|
+
const _checkbox = useRef(null);
|
|
9
|
+
const _checkboxClassName = ["ar-radio"];
|
|
10
|
+
const _traceClassName = ["trace", "filled"];
|
|
11
|
+
const _pastTraceClassName = ["past-trace", "filled"];
|
|
12
|
+
// hooks
|
|
13
|
+
// Dışarıdan gelen ref'i _innerRef'e bağla.
|
|
14
|
+
useImperativeHandle(ref, () => _innerRef.current);
|
|
15
|
+
_checkboxClassName.push(...Utils.GetClassName("filled", undefined, attributes.checked ? color : "light", border, size, undefined, attributes.className));
|
|
16
|
+
if (trace && Object.keys(trace).length > 0)
|
|
17
|
+
_traceClassName.push(trace.color);
|
|
18
|
+
if (pastTrace && Object.keys(pastTrace).length > 0)
|
|
19
|
+
_pastTraceClassName.push(pastTrace.color);
|
|
20
|
+
return (React.createElement("div", { className: "ar-radio-wrapper" },
|
|
21
|
+
React.createElement("label", null,
|
|
22
|
+
React.createElement("input", { ref: _innerRef, type: "radio", ...attributes, size: 0, onChange: (event) => {
|
|
23
|
+
(() => {
|
|
24
|
+
const _current = _checkbox.current;
|
|
25
|
+
if (!_current)
|
|
26
|
+
return;
|
|
27
|
+
})();
|
|
28
|
+
(() => attributes.onChange && attributes.onChange(event))();
|
|
29
|
+
} }),
|
|
30
|
+
React.createElement("span", null,
|
|
31
|
+
React.createElement("span", { ref: _checkbox, className: _checkboxClassName.map((c) => c).join(" ") }),
|
|
32
|
+
trace && Object.keys(trace).length > 0 && (React.createElement("span", { className: _traceClassName.map((c) => c).join(" ") })),
|
|
33
|
+
pastTrace && Object.keys(pastTrace).length > 0 && (React.createElement("span", { className: _pastTraceClassName.map((c) => c).join(" ") })),
|
|
34
|
+
label && React.createElement("span", { className: "label" }, upperCase ? label.toUpperCase() : label)),
|
|
35
|
+
validation?.text && React.createElement("span", { className: "validation" }, validation.text))));
|
|
36
|
+
});
|
|
37
|
+
Radio.displayName = "Radio";
|
|
38
|
+
export default Radio;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Variants, Option, Status, Color } from "../../../libs/infrastructure/types";
|
|
2
|
+
import { IBorderProps, IDisabledProps, IIconProps, ISizeProps, IColorProps, IUpperCaseProps, IValidationProps, IVariantProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
3
|
+
export interface IMultiple {
|
|
4
|
+
status?: {
|
|
5
|
+
color?: Color;
|
|
6
|
+
selected?: {
|
|
7
|
+
variant?: Variants;
|
|
8
|
+
color?: Color;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
value: Option[];
|
|
12
|
+
onChange: (option: Option[]) => void;
|
|
13
|
+
multiple: true;
|
|
14
|
+
}
|
|
15
|
+
export interface ISingle {
|
|
16
|
+
status?: Status;
|
|
17
|
+
value: Option | undefined;
|
|
18
|
+
onChange: (option: Option | undefined) => void;
|
|
19
|
+
multiple?: false;
|
|
20
|
+
}
|
|
21
|
+
export type Props = {
|
|
22
|
+
style?: React.CSSProperties | undefined;
|
|
23
|
+
options: Option[];
|
|
24
|
+
onSearch?: (searchText: string) => void;
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
onCreate?: (option: Option) => void;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
config?: {
|
|
30
|
+
clear?: boolean;
|
|
31
|
+
validation?: {
|
|
32
|
+
text: "visible" | "hidden";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
} & (IMultiple | ISingle) & IVariantProps & IColorProps & IBorderProps & IIconProps & ISizeProps & IUpperCaseProps & IValidationProps & IDisabledProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|