@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,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useEffect, useRef } from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
const FilterPopup = ({ children, refs, states, coordinate }) => {
|
|
5
|
+
// refs
|
|
6
|
+
const _arTableFilterPopup = useRef(null);
|
|
7
|
+
// methods
|
|
8
|
+
const handleClickOutSide = (event) => {
|
|
9
|
+
const target = event.target;
|
|
10
|
+
const clickedInsidePopup = _arTableFilterPopup.current && _arTableFilterPopup.current.contains(target);
|
|
11
|
+
const isOneOfButtons = refs.buttons.current.some((button) => button === target || button?.contains(target));
|
|
12
|
+
if (!clickedInsidePopup && !isOneOfButtons)
|
|
13
|
+
handleClose();
|
|
14
|
+
};
|
|
15
|
+
const handleKeys = (event) => {
|
|
16
|
+
const key = event.key;
|
|
17
|
+
if (key === "Escape")
|
|
18
|
+
states.open.set(false);
|
|
19
|
+
};
|
|
20
|
+
const handleOpen = () => states.open.set(true);
|
|
21
|
+
const handleClose = () => states.open.set(false);
|
|
22
|
+
// useEffects
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const currentButtons = refs.buttons.current;
|
|
25
|
+
currentButtons.forEach((button) => {
|
|
26
|
+
if (button)
|
|
27
|
+
button.addEventListener("click", handleOpen);
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
currentButtons.forEach((button) => {
|
|
31
|
+
if (button)
|
|
32
|
+
button.removeEventListener("click", handleOpen);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}, [refs.buttons]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
const tableContentRef = refs.tableContent.current;
|
|
38
|
+
if (tableContentRef) {
|
|
39
|
+
tableContentRef.addEventListener("scroll", handleClose);
|
|
40
|
+
}
|
|
41
|
+
document.addEventListener("click", handleClickOutSide);
|
|
42
|
+
document.addEventListener("keydown", handleKeys);
|
|
43
|
+
return () => {
|
|
44
|
+
document.removeEventListener("click", handleClickOutSide);
|
|
45
|
+
document.removeEventListener("keydown", handleKeys);
|
|
46
|
+
if (tableContentRef) {
|
|
47
|
+
tableContentRef.removeEventListener("scroll", handleClose);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return (states.open.get &&
|
|
52
|
+
ReactDOM.createPortal(React.createElement("div", { ref: _arTableFilterPopup, className: "ar-table-filter-popup", style: { top: coordinate.y, left: coordinate.x } }, children), document.body));
|
|
53
|
+
};
|
|
54
|
+
export default FilterPopup;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Errors, MimeTypes, TableColumnProps } from "../../../libs/infrastructure/types";
|
|
3
|
+
import { IChildrenProps } from "../../../libs/infrastructure/types/IGlobalProps";
|
|
4
|
+
import { FilterOperator } from "../../../libs/infrastructure/shared/Enums";
|
|
5
|
+
export type Operator = "Contains" | "DoesNotContains" | "Equals" | "DoesNotEquals" | "BeginsWith" | "EndsWith" | "Blank" | "NotBlank";
|
|
6
|
+
export type FilterValue = {
|
|
7
|
+
value: string | number | boolean;
|
|
8
|
+
operator: FilterOperator;
|
|
9
|
+
};
|
|
10
|
+
export type Actions = {
|
|
11
|
+
import?: ImportActionType;
|
|
12
|
+
export?: ExportActionType;
|
|
13
|
+
create?: CreateActionType;
|
|
14
|
+
delete?: DeleteActionType;
|
|
15
|
+
};
|
|
16
|
+
export type Sort<T> = {
|
|
17
|
+
key: keyof T;
|
|
18
|
+
direction: "asc" | "desc" | null;
|
|
19
|
+
};
|
|
20
|
+
export type SearchedParam = {
|
|
21
|
+
[key: string]: FilterValue | FilterValue[];
|
|
22
|
+
};
|
|
23
|
+
export type Config<T extends object> = {
|
|
24
|
+
locale?: Intl.LocalesArgument;
|
|
25
|
+
isServerSide?: boolean;
|
|
26
|
+
isProperties?: boolean;
|
|
27
|
+
isSearchable?: boolean;
|
|
28
|
+
scroll?: {
|
|
29
|
+
maxHeight: number;
|
|
30
|
+
};
|
|
31
|
+
subrow?: {
|
|
32
|
+
openAutomatically?: boolean;
|
|
33
|
+
selector?: string;
|
|
34
|
+
button?: boolean;
|
|
35
|
+
render?: {
|
|
36
|
+
styles: React.CSSProperties;
|
|
37
|
+
element: (item: T[]) => React.JSX.Element;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
dnd?: {
|
|
41
|
+
renderItem: React.JSX.Element;
|
|
42
|
+
};
|
|
43
|
+
isTreeView?: boolean;
|
|
44
|
+
validation?: {
|
|
45
|
+
errors: Errors<T>;
|
|
46
|
+
getChangeData?: (items: T[]) => void;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
type ImportActionType = {
|
|
50
|
+
tooltip: string;
|
|
51
|
+
title?: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
buttonText?: string;
|
|
54
|
+
allowedTypes?: MimeTypes[];
|
|
55
|
+
prefixItem?: React.ReactNode;
|
|
56
|
+
suffixItem?: React.ReactNode;
|
|
57
|
+
onClick: (formData: FormData | undefined, files: File[], base64: string[]) => void;
|
|
58
|
+
};
|
|
59
|
+
type ExportActionType = {
|
|
60
|
+
tooltip: string;
|
|
61
|
+
title?: string;
|
|
62
|
+
message?: string;
|
|
63
|
+
content?: React.JSX.Element;
|
|
64
|
+
onClick: () => void;
|
|
65
|
+
};
|
|
66
|
+
type CreateActionType = {
|
|
67
|
+
tooltip: string;
|
|
68
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
69
|
+
};
|
|
70
|
+
type DeleteActionType = {
|
|
71
|
+
tooltip: string;
|
|
72
|
+
title?: string;
|
|
73
|
+
message?: string;
|
|
74
|
+
onClick: () => void;
|
|
75
|
+
};
|
|
76
|
+
interface IProps<T extends object> extends IChildrenProps {
|
|
77
|
+
trackBy?: (item: T) => string;
|
|
78
|
+
title?: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
data: T[];
|
|
81
|
+
columns: TableColumnProps<T>[];
|
|
82
|
+
actions?: Actions;
|
|
83
|
+
rowBackgroundColor?: (item: T) => string;
|
|
84
|
+
selections?: (selectionItems: T[]) => void;
|
|
85
|
+
selectionDisabled?: (item: T) => boolean;
|
|
86
|
+
previousSelections?: T[];
|
|
87
|
+
sortedParams?: (params: Sort<T>[], query: string) => void;
|
|
88
|
+
searchedParams?: (params: SearchedParam | null, query: string, operator: FilterOperator) => void;
|
|
89
|
+
onEditable?: (item: T, trackByValue: string, currentKey?: keyof T | null) => void;
|
|
90
|
+
onDnD?: (item: T[]) => void;
|
|
91
|
+
pagination?: {
|
|
92
|
+
totalRecords: number;
|
|
93
|
+
perPage: number;
|
|
94
|
+
currentPage?: number;
|
|
95
|
+
onChange?: (currentPage: number, perPage: number) => void;
|
|
96
|
+
};
|
|
97
|
+
config?: Config<T>;
|
|
98
|
+
}
|
|
99
|
+
export default IProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
2
|
+
import { Config, Sort } from "./IProps";
|
|
3
|
+
import { TableColumnProps } from "../../../libs/infrastructure/types";
|
|
4
|
+
interface IProps<T extends object> {
|
|
5
|
+
refs: {
|
|
6
|
+
tableContent: MutableRefObject<HTMLDivElement | null>;
|
|
7
|
+
buttons: MutableRefObject<(HTMLSpanElement | null)[]>;
|
|
8
|
+
};
|
|
9
|
+
states: {
|
|
10
|
+
open: {
|
|
11
|
+
get: boolean;
|
|
12
|
+
set: Dispatch<SetStateAction<boolean>>;
|
|
13
|
+
};
|
|
14
|
+
sort: {
|
|
15
|
+
get: Sort<T>[];
|
|
16
|
+
set: Dispatch<SetStateAction<Sort<T>[]>>;
|
|
17
|
+
currentColumn: TableColumnProps<T> | null;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
methods: {
|
|
21
|
+
handleScroll: () => void;
|
|
22
|
+
};
|
|
23
|
+
coordinate: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
config: Config<T>;
|
|
28
|
+
}
|
|
29
|
+
declare function PropertiesPopup<T extends object>({ refs, states, methods, coordinate, config }: IProps<T>): false | React.ReactPortal;
|
|
30
|
+
declare const _default: typeof PropertiesPopup;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { memo, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
import { ARIcon } from "../../icons";
|
|
5
|
+
import { ExtractKey } from "./Helpers";
|
|
6
|
+
import { useTranslation } from "../../../libs/core/application/hooks";
|
|
7
|
+
function PropertiesPopup({ refs, states, methods, coordinate, config }) {
|
|
8
|
+
// refs
|
|
9
|
+
const _arTablePropertiesPopup = useRef(null);
|
|
10
|
+
// hooks
|
|
11
|
+
const { t } = useTranslation(String(config.locale ?? "tr"));
|
|
12
|
+
// methods
|
|
13
|
+
const handleClickOutSide = (event) => {
|
|
14
|
+
const target = event.target;
|
|
15
|
+
const clickedInsidePopup = _arTablePropertiesPopup.current && _arTablePropertiesPopup.current.contains(target);
|
|
16
|
+
const isOneOfButtons = target.closest('[data-properties-button="true"]');
|
|
17
|
+
if (!clickedInsidePopup && !isOneOfButtons)
|
|
18
|
+
handleClose();
|
|
19
|
+
};
|
|
20
|
+
const handleSort = useMemo(() => {
|
|
21
|
+
return (columnKey, direction) => {
|
|
22
|
+
if (!columnKey)
|
|
23
|
+
return;
|
|
24
|
+
states.sort.set(() => [{ key: columnKey, direction }]);
|
|
25
|
+
};
|
|
26
|
+
}, [states.sort]);
|
|
27
|
+
const handleKeys = (event) => {
|
|
28
|
+
const key = event.key;
|
|
29
|
+
if (key === "Escape")
|
|
30
|
+
handleClose();
|
|
31
|
+
};
|
|
32
|
+
const handleOpen = () => {
|
|
33
|
+
states.open.set(true);
|
|
34
|
+
methods.handleScroll();
|
|
35
|
+
};
|
|
36
|
+
const handleClose = () => {
|
|
37
|
+
states.open.set(false);
|
|
38
|
+
methods.handleScroll();
|
|
39
|
+
};
|
|
40
|
+
// useEffects
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const currentButtons = refs.buttons.current;
|
|
43
|
+
currentButtons.forEach((button) => {
|
|
44
|
+
if (button)
|
|
45
|
+
button.addEventListener("click", handleOpen);
|
|
46
|
+
});
|
|
47
|
+
return () => {
|
|
48
|
+
currentButtons.forEach((button) => {
|
|
49
|
+
if (button)
|
|
50
|
+
button.removeEventListener("click", handleOpen);
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
}, [refs.buttons]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
const tableContentRef = refs.tableContent.current;
|
|
56
|
+
if (tableContentRef) {
|
|
57
|
+
tableContentRef.addEventListener("scroll", handleClose);
|
|
58
|
+
}
|
|
59
|
+
document.addEventListener("click", handleClickOutSide);
|
|
60
|
+
document.addEventListener("keydown", handleKeys);
|
|
61
|
+
return () => {
|
|
62
|
+
document.removeEventListener("click", handleClickOutSide);
|
|
63
|
+
document.removeEventListener("keydown", handleKeys);
|
|
64
|
+
if (tableContentRef) {
|
|
65
|
+
tableContentRef.removeEventListener("scroll", handleClose);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, []);
|
|
69
|
+
const currentKey = ExtractKey(states.sort.currentColumn?.key);
|
|
70
|
+
const currentSort = states.sort.get?.find((s) => s.key === currentKey);
|
|
71
|
+
return (states.open.get &&
|
|
72
|
+
ReactDOM.createPortal(React.createElement("div", { ref: _arTablePropertiesPopup, className: "ar-table-properties-popup", style: { top: coordinate.y, left: coordinate.x } },
|
|
73
|
+
React.createElement("ul", null,
|
|
74
|
+
currentSort && (!currentSort.direction || currentSort.direction === "desc") && (React.createElement("li", { onClick: () => handleSort(currentKey, "asc") },
|
|
75
|
+
React.createElement("span", null,
|
|
76
|
+
React.createElement(ARIcon, { icon: "ArrowUp" })),
|
|
77
|
+
React.createElement("span", null, t("Table.Properties.Asc.Text")))),
|
|
78
|
+
currentSort && (!currentSort.direction || currentSort.direction === "asc") && (React.createElement("li", { onClick: () => handleSort(currentKey, "desc") },
|
|
79
|
+
React.createElement("span", null,
|
|
80
|
+
React.createElement(ARIcon, { icon: "ArrowDown" })),
|
|
81
|
+
React.createElement("span", null, t("Table.Properties.Desc.Text")))),
|
|
82
|
+
currentSort && currentSort.direction && (React.createElement("li", { onClick: () => {
|
|
83
|
+
states.sort.set((prev) => prev.filter((s) => s.key !== currentKey));
|
|
84
|
+
states.open.set(false);
|
|
85
|
+
} },
|
|
86
|
+
React.createElement("span", null,
|
|
87
|
+
React.createElement(ARIcon, { icon: "ChevronExpand" })),
|
|
88
|
+
React.createElement("span", null, t("Table.Properties.ClearSort.Text")))))), document.body));
|
|
89
|
+
}
|
|
90
|
+
export default memo(PropertiesPopup);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { Config, Sort } from "./IProps";
|
|
3
|
+
import { TableColumnProps } from "../../../libs/infrastructure/types";
|
|
4
|
+
declare const MemoizedTHeadCell: <T extends object>({ refs, states, methods, columns, config, }: {
|
|
5
|
+
refs: {
|
|
6
|
+
propertiesButton: React.MutableRefObject<(HTMLSpanElement | null)[]>;
|
|
7
|
+
};
|
|
8
|
+
states: {
|
|
9
|
+
open: {
|
|
10
|
+
get: boolean;
|
|
11
|
+
set: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
};
|
|
13
|
+
sort: {
|
|
14
|
+
get: Sort<T>[];
|
|
15
|
+
set: Dispatch<SetStateAction<Sort<T>[]>>;
|
|
16
|
+
};
|
|
17
|
+
sortCurrentColumn: {
|
|
18
|
+
set: React.Dispatch<React.SetStateAction<TableColumnProps<T> | null>>;
|
|
19
|
+
};
|
|
20
|
+
propertiesButtonCoordinate: {
|
|
21
|
+
set: React.Dispatch<React.SetStateAction<{
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}>>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
methods: {
|
|
28
|
+
handleScroll: () => void;
|
|
29
|
+
};
|
|
30
|
+
columns: TableColumnProps<T>[];
|
|
31
|
+
config: Config<T>;
|
|
32
|
+
}) => React.JSX.Element;
|
|
33
|
+
declare const THeadCell: typeof MemoizedTHeadCell;
|
|
34
|
+
export default THeadCell;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { memo } from "react";
|
|
2
|
+
import Button from "../../form/button";
|
|
3
|
+
import { ARIcon } from "../../icons";
|
|
4
|
+
import { ExtractKey } from "./Helpers";
|
|
5
|
+
const MemoizedTHeadCell = function ({ refs, states, methods, columns, config, }) {
|
|
6
|
+
return (React.createElement(React.Fragment, null, columns.map((c, cIndex) => {
|
|
7
|
+
const { isProperties = true } = c.config ?? {};
|
|
8
|
+
// Orijinal c.key araması optimize edildi ve string formatına güvenli şekilde çekildi
|
|
9
|
+
const columnKeyString = String(ExtractKey(c.key) ?? cIndex);
|
|
10
|
+
const _direction = states.sort.get.find((s) => s.key === columnKeyString)?.direction;
|
|
11
|
+
let _className = [];
|
|
12
|
+
if (c.config?.sticky)
|
|
13
|
+
_className.push(`sticky-${c.config.sticky}`);
|
|
14
|
+
if (!c.config?.width)
|
|
15
|
+
_className.push("min-w");
|
|
16
|
+
if (c.config?.alignContent) {
|
|
17
|
+
_className.push(`align-content-${c.config.alignContent}`);
|
|
18
|
+
}
|
|
19
|
+
return (React.createElement("th", { key: `column-head-${columnKeyString}`, ...(_className.length > 0 && {
|
|
20
|
+
className: `${_className.join(" ")}`,
|
|
21
|
+
}), ...(c.config?.width
|
|
22
|
+
? {
|
|
23
|
+
style: { minWidth: c.config.width, maxWidth: c.config.width },
|
|
24
|
+
}
|
|
25
|
+
: { style: {} }), ...(c.config?.sticky && {
|
|
26
|
+
"data-sticky-position": c.config.sticky,
|
|
27
|
+
}) },
|
|
28
|
+
React.createElement("div", null,
|
|
29
|
+
React.createElement("span", { style: { fontWeight: 500 } },
|
|
30
|
+
(_direction === "asc" || _direction === "desc") && (React.createElement("span", null,
|
|
31
|
+
_direction === "asc" && React.createElement(ARIcon, { icon: "ArrowUp" }),
|
|
32
|
+
_direction === "desc" && React.createElement(ARIcon, { icon: "ArrowDown" }))),
|
|
33
|
+
c.title),
|
|
34
|
+
config.isProperties && isProperties && (React.createElement("span", { ref: (element) => {
|
|
35
|
+
if (element) {
|
|
36
|
+
refs.propertiesButton.current[cIndex] = element;
|
|
37
|
+
}
|
|
38
|
+
}, className: "properties-field", "data-properties-button": "true", onClick: (event) => {
|
|
39
|
+
event.preventDefault();
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
42
|
+
const screenCenterX = window.innerWidth / 2;
|
|
43
|
+
const coordinateX = rect.x > screenCenterX ? rect.x + rect.width - 225 : rect.x;
|
|
44
|
+
const coordinateY = rect.y + rect.height;
|
|
45
|
+
states.sortCurrentColumn.set(c);
|
|
46
|
+
states.propertiesButtonCoordinate.set({
|
|
47
|
+
x: coordinateX,
|
|
48
|
+
y: coordinateY,
|
|
49
|
+
});
|
|
50
|
+
states.sort.set((prev) => {
|
|
51
|
+
const key = ExtractKey(c.key);
|
|
52
|
+
const index = prev.findIndex((s) => s.key === key);
|
|
53
|
+
if (index === -1)
|
|
54
|
+
return [...prev, { key, direction: null }];
|
|
55
|
+
return prev;
|
|
56
|
+
});
|
|
57
|
+
states.open.set(true);
|
|
58
|
+
methods.handleScroll();
|
|
59
|
+
} },
|
|
60
|
+
React.createElement(Button, { variant: "borderless", icon: {
|
|
61
|
+
element: React.createElement(ARIcon, { size: 16, icon: "ThreeDotsVertical", fill: "var(--dark)", strokeWidth: 0 }),
|
|
62
|
+
} }))))));
|
|
63
|
+
})));
|
|
64
|
+
};
|
|
65
|
+
// React.memo kullanımı sırasında generic tipi koruyoruz.
|
|
66
|
+
const THeadCell = memo(MemoizedTHeadCell);
|
|
67
|
+
export default THeadCell;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableColumnProps } from "../../../../libs/infrastructure/types";
|
|
3
|
+
import { Config } from "../IProps";
|
|
4
|
+
interface IProps<T extends object> {
|
|
5
|
+
c: TableColumnProps<T>;
|
|
6
|
+
item: T;
|
|
7
|
+
trackByValue: string;
|
|
8
|
+
onEditable: (item: T, trackByValue: string, currentKey?: keyof T | null) => void;
|
|
9
|
+
config: Config<T>;
|
|
10
|
+
}
|
|
11
|
+
declare const Editable: <T extends object>({ c, item, trackByValue, onEditable, config }: IProps<T>) => React.JSX.Element | null;
|
|
12
|
+
export default Editable;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import Input from "../../../form/input";
|
|
4
|
+
import DatePicker from "../../../form/date-picker";
|
|
5
|
+
import Select from "../../../form/select";
|
|
6
|
+
import { ExtractKey } from "../Helpers";
|
|
7
|
+
import Checkbox from "../../../form/checkbox";
|
|
8
|
+
const Editable = function ({ c, item, trackByValue, onEditable, config }) {
|
|
9
|
+
// refs
|
|
10
|
+
// variables
|
|
11
|
+
const key = c.key;
|
|
12
|
+
const itemValue = item[c.key];
|
|
13
|
+
const selectItem = c.editable?.(item)?.options?.find((x) => x.value === itemValue);
|
|
14
|
+
const selectItems = Array.isArray(itemValue)
|
|
15
|
+
? c.editable?.(item)?.options?.filter((x) => itemValue.includes(x.value))
|
|
16
|
+
: [];
|
|
17
|
+
const validation = config.validation;
|
|
18
|
+
const _vText = validation?.errors?.[`${c.key}_${trackByValue}`];
|
|
19
|
+
// states
|
|
20
|
+
const [_value, setValue] = useState(itemValue);
|
|
21
|
+
// methods
|
|
22
|
+
const handleChange = useCallback((value, set = true) => {
|
|
23
|
+
if (set)
|
|
24
|
+
setValue(value);
|
|
25
|
+
onEditable({ ...item, [key]: value }, trackByValue, ExtractKey(c.key));
|
|
26
|
+
}, [item]);
|
|
27
|
+
// useEffects
|
|
28
|
+
useEffect(() => setValue(itemValue), [itemValue]);
|
|
29
|
+
// return
|
|
30
|
+
switch (c.editable?.(item)?.type) {
|
|
31
|
+
case "string":
|
|
32
|
+
case "number":
|
|
33
|
+
return (React.createElement(Input, { variant: "borderless", value: String(_value ?? ""), onChange: (event) => {
|
|
34
|
+
handleChange(c.editable?.(item)?.type === "number" ? Number(event.target.value) : event.target.value);
|
|
35
|
+
}, validation: { text: _vText }, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
36
|
+
case "boolean":
|
|
37
|
+
return (React.createElement(Checkbox, { variant: "borderless", color: "blue", checked: Boolean(_value), onChange: (event) => {
|
|
38
|
+
const checked = event.target.checked;
|
|
39
|
+
setValue(checked);
|
|
40
|
+
onEditable({
|
|
41
|
+
...item,
|
|
42
|
+
[key]: checked,
|
|
43
|
+
}, trackByValue, ExtractKey(c.key));
|
|
44
|
+
}, validation: { text: _vText }, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
45
|
+
case "decimal":
|
|
46
|
+
return (React.createElement(Input.Decimal, { variant: "borderless", name: c.key, value: String(_value ?? ""), onChange: (event) => handleChange(event.target.value), validation: { text: _vText }, locale: config.locale, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
47
|
+
case "input-formatted-decimal":
|
|
48
|
+
return (React.createElement(Input.FormattedDecimal, { variant: "borderless", name: c.key, value: String(_value ?? ""), onChange: (event) => handleChange(event.target.value), validation: { text: _vText }, locale: config.locale, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
49
|
+
case "date-picker":
|
|
50
|
+
return (React.createElement(DatePicker, { variant: "borderless", value: String(_value ?? ""), onChange: (value) => handleChange(value), validation: { text: _vText }, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
51
|
+
case "single-select":
|
|
52
|
+
return (React.createElement(Select, { variant: "borderless", value: selectItem, options: c.editable?.(item).options, onClick: async () => await c.editable?.(item)?.method?.(), onChange: (option) => handleChange(option?.value, false), validation: { text: _vText }, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
53
|
+
case "multiple-select":
|
|
54
|
+
return (React.createElement(Select, { variant: "borderless", value: selectItems, options: c.editable?.(item).options, onClick: async () => await c.editable?.(item)?.method?.(), onChange: (options) => handleChange(options.map((option) => option.value), false), validation: { text: _vText }, multiple: true, ...(c.editable?.(item).where ? { disabled: c.editable?.(item).where } : {}) }));
|
|
55
|
+
default:
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
export default Editable;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { Config } from "../IProps";
|
|
3
|
+
import { TableColumnProps } from "../../../../libs/infrastructure/types";
|
|
4
|
+
interface IProps<T extends object> {
|
|
5
|
+
data: T[];
|
|
6
|
+
columns: TableColumnProps<T>[];
|
|
7
|
+
refs: {
|
|
8
|
+
_checkboxItems: React.MutableRefObject<(HTMLInputElement | null)[]>;
|
|
9
|
+
_selectionItems: React.MutableRefObject<T[]>;
|
|
10
|
+
};
|
|
11
|
+
states: {
|
|
12
|
+
setSelectAll: {
|
|
13
|
+
get: boolean;
|
|
14
|
+
set: Dispatch<SetStateAction<boolean>>;
|
|
15
|
+
};
|
|
16
|
+
showSubitems: {
|
|
17
|
+
get: {
|
|
18
|
+
[key: string]: boolean;
|
|
19
|
+
};
|
|
20
|
+
set: Dispatch<React.SetStateAction<{
|
|
21
|
+
[key: string]: boolean;
|
|
22
|
+
}>>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
methods: {
|
|
26
|
+
trackBy?: (item: T) => string;
|
|
27
|
+
selections?: (selectionItems: T[]) => void;
|
|
28
|
+
selectionDisabled?: (item: T) => boolean;
|
|
29
|
+
onDnD?: (item: T[]) => void;
|
|
30
|
+
onEditable?: (item: T, trackByValue: string, currentKey?: keyof T | null) => void;
|
|
31
|
+
rowBackgroundColor?: (item: T) => string;
|
|
32
|
+
};
|
|
33
|
+
config: Config<T>;
|
|
34
|
+
}
|
|
35
|
+
declare const _default: <T extends object>(props: IProps<T>) => React.JSX.Element;
|
|
36
|
+
export default _default;
|