@wisdomgarden/torque 0.1.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/README.md +75 -0
- package/dist/common/components.types.d.ts +60 -0
- package/dist/common/components.types.js +1 -0
- package/dist/common/dayjs.d.ts +7 -0
- package/dist/common/dayjs.js +10 -0
- package/dist/common/use-css-variable-value.d.ts +6 -0
- package/dist/common/use-css-variable-value.js +23 -0
- package/dist/common/use-css-variable-values.d.ts +10 -0
- package/dist/common/use-css-variable-values.js +25 -0
- package/dist/common/use-form-wrapper-props.d.ts +48 -0
- package/dist/common/use-form-wrapper-props.js +59 -0
- package/dist/common/use-ime-safe-input.d.ts +10 -0
- package/dist/common/use-ime-safe-input.js +23 -0
- package/dist/common/use-notification-a11y.d.ts +4 -0
- package/dist/common/use-notification-a11y.js +18 -0
- package/dist/common/use-sticky-box.d.ts +9 -0
- package/dist/common/use-sticky-box.js +217 -0
- package/dist/common/util.d.ts +5 -0
- package/dist/common/util.js +14 -0
- package/dist/components/_inner/base-select/common/searchable.d.ts +5 -0
- package/dist/components/_inner/base-select/common/searchable.js +6 -0
- package/dist/components/_inner/base-select/common/select.types.d.ts +169 -0
- package/dist/components/_inner/base-select/common/select.types.js +1 -0
- package/dist/components/_inner/base-select/search-select/index.d.ts +6 -0
- package/dist/components/_inner/base-select/search-select/index.js +106 -0
- package/dist/components/_inner/base-select/search-select/search-select.module.css.js +10 -0
- package/dist/components/_inner/base-select/single-select/index.d.ts +1 -0
- package/dist/components/_inner/base-select/single-select/index.js +5 -0
- package/dist/components/_inner/base-select/single-select/single-select.d.ts +5 -0
- package/dist/components/_inner/base-select/single-select/single-select.js +58 -0
- package/dist/components/_inner/base-select/target/single-select-target.d.ts +15 -0
- package/dist/components/_inner/base-select/target/single-select-target.js +56 -0
- package/dist/components/_inner/bottom-action/bottom-action-item.d.ts +11 -0
- package/dist/components/_inner/bottom-action/bottom-action-item.js +140 -0
- package/dist/components/_inner/bottom-action/bottom-action.d.ts +6 -0
- package/dist/components/_inner/bottom-action/bottom-action.js +161 -0
- package/dist/components/_inner/bottom-action/bottom-action.module.css.js +46 -0
- package/dist/components/_inner/bottom-action/bottom-action.types.d.ts +117 -0
- package/dist/components/_inner/bottom-action/index.d.ts +2 -0
- package/dist/components/_inner/bottom-action/index.js +5 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.d.ts +32 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.js +91 -0
- package/dist/components/_inner/drawer/base-bottom-drawer.module.css.js +18 -0
- package/dist/components/_inner/dropdown/empty-state.d.ts +6 -0
- package/dist/components/_inner/dropdown/empty-state.js +16 -0
- package/dist/components/_inner/dropdown/empty-state.module.css.js +12 -0
- package/dist/components/_inner/dropdown/options-drop-down.d.ts +22 -0
- package/dist/components/_inner/dropdown/options-drop-down.js +95 -0
- package/dist/components/_inner/dropdown/options-drop-down.module.css.js +18 -0
- package/dist/components/_inner/menu/_mobile/menu.mobile.d.ts +11 -0
- package/dist/components/_inner/menu/_mobile/menu.mobile.js +15 -0
- package/dist/components/_inner/menu/_web/menu-web.module.css.js +18 -0
- package/dist/components/_inner/menu/_web/menu.web.d.ts +6 -0
- package/dist/components/_inner/menu/_web/menu.web.js +198 -0
- package/dist/components/_inner/number/number-input-left.d.ts +5 -0
- package/dist/components/_inner/number/number-input-left.js +29 -0
- package/dist/components/_inner/number/number-input-right.d.ts +6 -0
- package/dist/components/_inner/number/number-input-right.js +62 -0
- package/dist/components/_inner/number/number.module.css.js +12 -0
- package/dist/components/_inner/table/head/table-head-filter-multi-select.d.ts +25 -0
- package/dist/components/_inner/table/head/table-head-filter-multi-select.js +139 -0
- package/dist/components/_inner/table/head/table-head-filter-search.d.ts +18 -0
- package/dist/components/_inner/table/head/table-head-filter-search.js +102 -0
- package/dist/components/_inner/table/head/table-head-filter-single-select.d.ts +21 -0
- package/dist/components/_inner/table/head/table-head-filter-single-select.js +76 -0
- package/dist/components/_inner/table/head/table-head-sort.d.ts +16 -0
- package/dist/components/_inner/table/head/table-head-sort.js +51 -0
- package/dist/components/_inner/table/head/table-head.module.css.js +40 -0
- package/dist/components/_inner/table/index.d.ts +5 -0
- package/dist/components/_inner/table/index.js +13 -0
- package/dist/components/_inner/table/table-header-title.d.ts +7 -0
- package/dist/components/_inner/table/table-header-title.js +24 -0
- package/dist/components/_inner/table/table-header-title.module.css.js +12 -0
- package/dist/components/_inner/tags-input/hooks/use-height-transition.d.ts +15 -0
- package/dist/components/_inner/tags-input/hooks/use-height-transition.js +31 -0
- package/dist/components/_inner/tags-input/hooks/use-is-wrapped.d.ts +12 -0
- package/dist/components/_inner/tags-input/hooks/use-is-wrapped.js +24 -0
- package/dist/components/_inner/tags-input/index.d.ts +2 -0
- package/dist/components/_inner/tags-input/index.js +5 -0
- package/dist/components/_inner/tags-input/styles/tags-input.module.css.js +48 -0
- package/dist/components/_inner/tags-input/tags-input-tag.d.ts +13 -0
- package/dist/components/_inner/tags-input/tags-input-tag.js +53 -0
- package/dist/components/_inner/tags-input/tags-input.d.ts +9 -0
- package/dist/components/_inner/tags-input/tags-input.js +143 -0
- package/dist/components/_inner/tags-input/tags-input.types.d.ts +57 -0
- package/dist/components/alert/alert.d.ts +6 -0
- package/dist/components/alert/alert.js +102 -0
- package/dist/components/alert/alert.module.css.js +20 -0
- package/dist/components/alert/alert.types.d.ts +18 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/index.js +6 -0
- package/dist/components/base-input/base-input.d.ts +5 -0
- package/dist/components/base-input/base-input.js +143 -0
- package/dist/components/base-input/base-input.types.d.ts +89 -0
- package/dist/components/base-input/index.d.ts +5 -0
- package/dist/components/base-input/index.js +11 -0
- package/dist/components/base-input/styles/base-input-variables.module.css.js +8 -0
- package/dist/components/base-input/styles/base-input.module.css.js +24 -0
- package/dist/components/base-input/subs/base-input-left-section.d.ts +10 -0
- package/dist/components/base-input/subs/base-input-left-section.js +29 -0
- package/dist/components/base-input/subs/base-input-right-section.d.ts +23 -0
- package/dist/components/base-input/subs/base-input-right-section.js +87 -0
- package/dist/components/base-input/subs/base-input-target.d.ts +11 -0
- package/dist/components/base-input/subs/base-input-target.js +35 -0
- package/dist/components/base-input/subs/base-input-wrapper.d.ts +18 -0
- package/dist/components/base-input/subs/base-input-wrapper.js +51 -0
- package/dist/components/base-input/util.d.ts +8 -0
- package/dist/components/base-input/util.js +16 -0
- package/dist/components/bottom-drawer/bottom-drawer.d.ts +6 -0
- package/dist/components/bottom-drawer/bottom-drawer.js +16 -0
- package/dist/components/bottom-drawer/index.d.ts +2 -0
- package/dist/components/bottom-drawer/index.js +5 -0
- package/dist/components/box/box.d.ts +2 -0
- package/dist/components/box/box.js +27 -0
- package/dist/components/box/box.module.css.js +8 -0
- package/dist/components/box/box.types.d.ts +36 -0
- package/dist/components/box/index.d.ts +2 -0
- package/dist/components/box/index.js +5 -0
- package/dist/components/button/button.d.ts +17 -0
- package/dist/components/button/button.js +91 -0
- package/dist/components/button/button.types.d.ts +88 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +5 -0
- package/dist/components/button/styles/button-variables.module.css.js +8 -0
- package/dist/components/button/styles/button.module.css.js +18 -0
- package/dist/components/checkbox/checkbox-group.d.ts +7 -0
- package/dist/components/checkbox/checkbox-group.js +51 -0
- package/dist/components/checkbox/checkbox-variables.module.css.js +8 -0
- package/dist/components/checkbox/checkbox.d.ts +9 -0
- package/dist/components/checkbox/checkbox.js +93 -0
- package/dist/components/checkbox/checkbox.module.css.js +12 -0
- package/dist/components/checkbox/checkbox.types.d.ts +41 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +8 -0
- package/dist/components/combobox/combobox-context.d.ts +9 -0
- package/dist/components/combobox/combobox-context.js +15 -0
- package/dist/components/combobox/combobox-dropdown.d.ts +13 -0
- package/dist/components/combobox/combobox-dropdown.js +35 -0
- package/dist/components/combobox/combobox-infinite-dropdown.d.ts +51 -0
- package/dist/components/combobox/combobox-infinite-dropdown.js +56 -0
- package/dist/components/combobox/combobox-option.d.ts +3 -0
- package/dist/components/combobox/combobox-option.js +50 -0
- package/dist/components/combobox/combobox-options.d.ts +8 -0
- package/dist/components/combobox/combobox-options.js +38 -0
- package/dist/components/combobox/combobox-search.d.ts +27 -0
- package/dist/components/combobox/combobox-search.js +29 -0
- package/dist/components/combobox/combobox-target.d.ts +15 -0
- package/dist/components/combobox/combobox-target.js +49 -0
- package/dist/components/combobox/combobox.d.ts +61 -0
- package/dist/components/combobox/combobox.js +53 -0
- package/dist/components/combobox/combobox.types.d.ts +58 -0
- package/dist/components/combobox/hooks/use-combobox-search-input.d.ts +11 -0
- package/dist/components/combobox/hooks/use-combobox-search-input.js +22 -0
- package/dist/components/combobox/hooks/use-combobox-target-key-down.d.ts +12 -0
- package/dist/components/combobox/hooks/use-combobox-target-key-down.js +35 -0
- package/dist/components/combobox/hooks/use-combobox.d.ts +58 -0
- package/dist/components/combobox/hooks/use-combobox.js +90 -0
- package/dist/components/combobox/index.d.ts +5 -0
- package/dist/components/combobox/index.js +9 -0
- package/dist/components/combobox/styles/combobox.module.css.js +14 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-dropdown.d.ts +10 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-dropdown.js +14 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-target.d.ts +3 -0
- package/dist/components/combobox/subs/combobox-bottom-drawer-target.js +20 -0
- package/dist/components/data-filter/data-filter-content.d.ts +13 -0
- package/dist/components/data-filter/data-filter-content.js +46 -0
- package/dist/components/data-filter/data-filter-drawer.d.ts +19 -0
- package/dist/components/data-filter/data-filter-drawer.js +73 -0
- package/dist/components/data-filter/data-filter-inline.d.ts +6 -0
- package/dist/components/data-filter/data-filter-inline.js +12 -0
- package/dist/components/data-filter/data-filter-panel.d.ts +13 -0
- package/dist/components/data-filter/data-filter-panel.js +40 -0
- package/dist/components/data-filter/data-filter.d.ts +2 -0
- package/dist/components/data-filter/data-filter.js +94 -0
- package/dist/components/data-filter/data-filter.module.css.js +56 -0
- package/dist/components/data-filter/data-filter.types.d.ts +29 -0
- package/dist/components/data-filter/filter-condition-tags/filter-condition-tags.d.ts +16 -0
- package/dist/components/data-filter/filter-condition-tags/filter-condition-tags.js +114 -0
- package/dist/components/data-filter/filter-condition-tags/index.d.ts +1 -0
- package/dist/components/data-filter/filter-condition-tags/index.js +5 -0
- package/dist/components/data-filter/hooks/use-data-filter-open-state.d.ts +10 -0
- package/dist/components/data-filter/hooks/use-data-filter-open-state.js +21 -0
- package/dist/components/data-filter/hooks/use-data-filter-state.d.ts +11 -0
- package/dist/components/data-filter/hooks/use-data-filter-state.js +48 -0
- package/dist/components/data-filter/index.d.ts +3 -0
- package/dist/components/data-filter/index.js +7 -0
- package/dist/components/date-picker/components/common/calendar-header.d.ts +10 -0
- package/dist/components/date-picker/components/common/calendar-header.js +70 -0
- package/dist/components/date-picker/components/common/calendar-panel.d.ts +6 -0
- package/dist/components/date-picker/components/common/calendar-panel.js +133 -0
- package/dist/components/date-picker/components/common/date-cell.d.ts +8 -0
- package/dist/components/date-picker/components/common/date-cell.js +46 -0
- package/dist/components/date-picker/components/common/decade-view.d.ts +8 -0
- package/dist/components/date-picker/components/common/decade-view.js +36 -0
- package/dist/components/date-picker/components/common/month-view.d.ts +5 -0
- package/dist/components/date-picker/components/common/month-view.js +65 -0
- package/dist/components/date-picker/components/common/picker-footer.d.ts +28 -0
- package/dist/components/date-picker/components/common/picker-footer.js +29 -0
- package/dist/components/date-picker/components/common/picker-sections.d.ts +14 -0
- package/dist/components/date-picker/components/common/picker-sections.js +31 -0
- package/dist/components/date-picker/components/common/picker-target-input.d.ts +7 -0
- package/dist/components/date-picker/components/common/picker-target-input.js +11 -0
- package/dist/components/date-picker/components/common/time-column.d.ts +6 -0
- package/dist/components/date-picker/components/common/time-column.js +121 -0
- package/dist/components/date-picker/components/common/time-input-row.d.ts +20 -0
- package/dist/components/date-picker/components/common/time-input-row.js +65 -0
- package/dist/components/date-picker/components/common/time-panel.d.ts +6 -0
- package/dist/components/date-picker/components/common/time-panel.js +86 -0
- package/dist/components/date-picker/components/common/year-view.d.ts +8 -0
- package/dist/components/date-picker/components/common/year-view.js +36 -0
- package/dist/components/date-picker/components/picker-focus-context.d.ts +21 -0
- package/dist/components/date-picker/components/picker-focus-context.js +16 -0
- package/dist/components/date-picker/components/range/range-panel.d.ts +33 -0
- package/dist/components/date-picker/components/range/range-panel.js +101 -0
- package/dist/components/date-picker/components/range/range-shell.d.ts +6 -0
- package/dist/components/date-picker/components/range/range-shell.js +110 -0
- package/dist/components/date-picker/components/single/picker-shell.d.ts +6 -0
- package/dist/components/date-picker/components/single/picker-shell.js +109 -0
- package/dist/components/date-picker/date-picker.d.ts +6 -0
- package/dist/components/date-picker/date-picker.js +76 -0
- package/dist/components/date-picker/date-picker.types.d.ts +543 -0
- package/dist/components/date-picker/date-picker.types.js +5 -0
- package/dist/components/date-picker/date-range-picker.d.ts +5 -0
- package/dist/components/date-picker/date-range-picker.js +103 -0
- package/dist/components/date-picker/date-time-picker.d.ts +6 -0
- package/dist/components/date-picker/date-time-picker.js +181 -0
- package/dist/components/date-picker/date-time-range-picker.d.ts +6 -0
- package/dist/components/date-picker/date-time-range-picker.js +157 -0
- package/dist/components/date-picker/hooks/date-disabled.d.ts +27 -0
- package/dist/components/date-picker/hooks/date-disabled.js +60 -0
- package/dist/components/date-picker/hooks/time-utils.d.ts +17 -0
- package/dist/components/date-picker/hooks/time-utils.js +14 -0
- package/dist/components/date-picker/hooks/use-calendar.d.ts +12 -0
- package/dist/components/date-picker/hooks/use-calendar.js +28 -0
- package/dist/components/date-picker/hooks/use-date-parser.d.ts +17 -0
- package/dist/components/date-picker/hooks/use-date-parser.js +16 -0
- package/dist/components/date-picker/hooks/use-grid-keyboard.d.ts +22 -0
- package/dist/components/date-picker/hooks/use-grid-keyboard.js +74 -0
- package/dist/components/date-picker/hooks/use-range-draft.d.ts +61 -0
- package/dist/components/date-picker/hooks/use-range-draft.js +84 -0
- package/dist/components/date-picker/hooks/use-range-session.d.ts +14 -0
- package/dist/components/date-picker/hooks/use-range-session.js +11 -0
- package/dist/components/date-picker/hooks/use-resolved-format.d.ts +15 -0
- package/dist/components/date-picker/hooks/use-resolved-format.js +25 -0
- package/dist/components/date-picker/index.d.ts +21 -0
- package/dist/components/date-picker/index.js +15 -0
- package/dist/components/date-picker/styles/calendar-header.module.css.js +14 -0
- package/dist/components/date-picker/styles/calendar-panel.module.css.js +12 -0
- package/dist/components/date-picker/styles/date-cell.module.css.js +8 -0
- package/dist/components/date-picker/styles/month-view.module.css.js +12 -0
- package/dist/components/date-picker/styles/panel-layout.module.css.js +12 -0
- package/dist/components/date-picker/styles/picker-footer.module.css.js +10 -0
- package/dist/components/date-picker/styles/picker-shell.module.css.js +12 -0
- package/dist/components/date-picker/styles/range-panel.module.css.js +12 -0
- package/dist/components/date-picker/styles/time-column.module.css.js +10 -0
- package/dist/components/date-picker/styles/time-input-row.module.css.js +16 -0
- package/dist/components/date-picker/styles/time-panel.module.css.js +8 -0
- package/dist/components/date-picker/styles/year-view.module.css.js +10 -0
- package/dist/components/date-picker/time-picker.d.ts +6 -0
- package/dist/components/date-picker/time-picker.js +81 -0
- package/dist/components/date-picker/time-range-picker.d.ts +6 -0
- package/dist/components/date-picker/time-range-picker.js +135 -0
- package/dist/components/drawer/drawer-events.d.ts +28 -0
- package/dist/components/drawer/drawer-events.js +14 -0
- package/dist/components/drawer/drawer.d.ts +33 -0
- package/dist/components/drawer/drawer.js +86 -0
- package/dist/components/drawer/drawer.module.css.js +34 -0
- package/dist/components/drawer/drawes.d.ts +4 -0
- package/dist/components/drawer/drawes.js +82 -0
- package/dist/components/drawer/index.d.ts +4 -0
- package/dist/components/drawer/index.js +9 -0
- package/dist/components/filter/filter-popover.d.ts +11 -0
- package/dist/components/filter/filter-popover.js +53 -0
- package/dist/components/filter/filter.d.ts +5 -0
- package/dist/components/filter/filter.js +29 -0
- package/dist/components/filter/filter.module.css.js +12 -0
- package/dist/components/filter/filter.types.d.ts +27 -0
- package/dist/components/filter/filter.types.js +1 -0
- package/dist/components/filter/icon-filter.d.ts +6 -0
- package/dist/components/filter/icon-filter.js +25 -0
- package/dist/components/filter/index.d.ts +4 -0
- package/dist/components/filter/index.js +9 -0
- package/dist/components/filter/multi-filter.d.ts +5 -0
- package/dist/components/filter/multi-filter.js +52 -0
- package/dist/components/flex/flex.d.ts +9 -0
- package/dist/components/flex/flex.js +28 -0
- package/dist/components/flex/flex.module.css.js +8 -0
- package/dist/components/flex/index.d.ts +2 -0
- package/dist/components/flex/index.js +5 -0
- package/dist/components/flex/layout.types.d.ts +69 -0
- package/dist/components/form-wrapper/form-item-wrapper-defaults-context.d.ts +10 -0
- package/dist/components/form-wrapper/form-item-wrapper-defaults-context.js +19 -0
- package/dist/components/form-wrapper/form-item-wrapper.d.ts +5 -0
- package/dist/components/form-wrapper/form-item-wrapper.js +111 -0
- package/dist/components/form-wrapper/form-item-wrapper.module.css.js +28 -0
- package/dist/components/form-wrapper/form-wrapper.types.d.ts +15 -0
- package/dist/components/form-wrapper/index.d.ts +3 -0
- package/dist/components/form-wrapper/index.js +8 -0
- package/dist/components/group/group.d.ts +8 -0
- package/dist/components/group/group.js +36 -0
- package/dist/components/group/group.module.css.js +8 -0
- package/dist/components/group/index.d.ts +1 -0
- package/dist/components/group/index.js +5 -0
- package/dist/components/icon-button/icon-button.d.ts +20 -0
- package/dist/components/icon-button/icon-button.js +20 -0
- package/dist/components/icon-button/icon-button.module.css.js +8 -0
- package/dist/components/icon-button/icon-button.types.d.ts +7 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/icon-button/index.js +5 -0
- package/dist/components/link-button/index.d.ts +1 -0
- package/dist/components/link-button/index.js +5 -0
- package/dist/components/link-button/link-button.d.ts +31 -0
- package/dist/components/link-button/link-button.js +31 -0
- package/dist/components/link-icon-button/index.d.ts +1 -0
- package/dist/components/link-icon-button/index.js +5 -0
- package/dist/components/link-icon-button/link-icon-button.d.ts +37 -0
- package/dist/components/link-icon-button/link-icon-button.js +30 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.js +5 -0
- package/dist/components/menu/menu.d.ts +33 -0
- package/dist/components/menu/menu.js +17 -0
- package/dist/components/menu/menu.types.d.ts +46 -0
- package/dist/components/message/index.d.ts +2 -0
- package/dist/components/message/index.js +5 -0
- package/dist/components/message/message.d.ts +2 -0
- package/dist/components/message/message.js +42 -0
- package/dist/components/message/message.module.css.js +14 -0
- package/dist/components/message/message.types.d.ts +7 -0
- package/dist/components/message/messages.d.ts +10 -0
- package/dist/components/message/messages.js +37 -0
- package/dist/components/modal/index.d.ts +2 -0
- package/dist/components/modal/index.js +5 -0
- package/dist/components/modal/modal.d.ts +6 -0
- package/dist/components/modal/modal.js +51 -0
- package/dist/components/modal/modal.module.css.js +10 -0
- package/dist/components/multi-select/base-multi-select.d.ts +3 -0
- package/dist/components/multi-select/base-multi-select.js +100 -0
- package/dist/components/multi-select/index.d.ts +1 -0
- package/dist/components/multi-select/index.js +5 -0
- package/dist/components/multi-select/multi-select-input.d.ts +29 -0
- package/dist/components/multi-select/multi-select-input.js +74 -0
- package/dist/components/multi-select/multi-select.d.ts +28 -0
- package/dist/components/multi-select/multi-select.js +34 -0
- package/dist/components/multi-select/multi-select.mobile.d.ts +4 -0
- package/dist/components/multi-select/multi-select.mobile.js +59 -0
- package/dist/components/multi-select/multi-select.types.d.ts +56 -0
- package/dist/components/multi-select/multi-select.types.js +1 -0
- package/dist/components/multi-select/styles/base-multi-select.module.css.js +16 -0
- package/dist/components/notifications/index.d.ts +3 -0
- package/dist/components/notifications/index.js +7 -0
- package/dist/components/notifications/notification.d.ts +11 -0
- package/dist/components/notifications/notification.js +79 -0
- package/dist/components/notifications/notification.module.css.js +14 -0
- package/dist/components/notifications/notification.types.d.ts +25 -0
- package/dist/components/notifications/notifications.d.ts +42 -0
- package/dist/components/notifications/notifications.js +42 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/number-input/index.js +5 -0
- package/dist/components/number-input/number-input.d.ts +8 -0
- package/dist/components/number-input/number-input.js +161 -0
- package/dist/components/number-input/number-input.module.css.js +8 -0
- package/dist/components/number-input/number-input.types.d.ts +65 -0
- package/dist/components/paper/index.d.ts +1 -0
- package/dist/components/paper/index.js +5 -0
- package/dist/components/paper/paper.d.ts +7 -0
- package/dist/components/paper/paper.js +15 -0
- package/dist/components/paper/paper.module.css.js +8 -0
- package/dist/components/password-input/index.d.ts +2 -0
- package/dist/components/password-input/index.js +5 -0
- package/dist/components/password-input/password-input.d.ts +15 -0
- package/dist/components/password-input/password-input.js +32 -0
- package/dist/components/popover/hooks.d.ts +17 -0
- package/dist/components/popover/hooks.js +131 -0
- package/dist/components/popover/index.d.ts +8 -0
- package/dist/components/popover/index.js +13 -0
- package/dist/components/popover/popover-context.d.ts +4 -0
- package/dist/components/popover/popover-context.js +16 -0
- package/dist/components/popover/popover-dropdown.d.ts +3 -0
- package/dist/components/popover/popover-dropdown.js +149 -0
- package/dist/components/popover/popover-stack.d.ts +10 -0
- package/dist/components/popover/popover-stack.js +24 -0
- package/dist/components/popover/popover-target.d.ts +3 -0
- package/dist/components/popover/popover-target.js +55 -0
- package/dist/components/popover/popover.d.ts +3 -0
- package/dist/components/popover/popover.js +175 -0
- package/dist/components/popover/popover.types.d.ts +211 -0
- package/dist/components/popover/styles/popover.module.css.js +12 -0
- package/dist/components/radio/index.d.ts +8 -0
- package/dist/components/radio/index.js +12 -0
- package/dist/components/radio/radio-group.d.ts +18 -0
- package/dist/components/radio/radio-group.js +54 -0
- package/dist/components/radio/radio-variables.module.css.js +8 -0
- package/dist/components/radio/radio.d.ts +17 -0
- package/dist/components/radio/radio.js +56 -0
- package/dist/components/radio/radio.module.css.js +14 -0
- package/dist/components/radio/radio.types.d.ts +59 -0
- package/dist/components/select/index.d.ts +3 -0
- package/dist/components/select/index.js +5 -0
- package/dist/components/select/select.d.ts +15 -0
- package/dist/components/select/select.js +48 -0
- package/dist/components/select/select.mobile.d.ts +12 -0
- package/dist/components/select/select.mobile.js +53 -0
- package/dist/components/stack/index.d.ts +1 -0
- package/dist/components/stack/index.js +5 -0
- package/dist/components/stack/stack.d.ts +6 -0
- package/dist/components/stack/stack.js +10 -0
- package/dist/components/sticky-box.d.ts +2 -0
- package/dist/components/sticky-box.js +10 -0
- package/dist/components/switch/index.d.ts +4 -0
- package/dist/components/switch/index.js +7 -0
- package/dist/components/switch/switch-group.d.ts +26 -0
- package/dist/components/switch/switch-group.js +12 -0
- package/dist/components/switch/switch.d.ts +27 -0
- package/dist/components/switch/switch.js +23 -0
- package/dist/components/switch/switch.module.css.js +7 -0
- package/dist/components/tab/index.d.ts +7 -0
- package/dist/components/tab/index.js +13 -0
- package/dist/components/tab/styles/tabs-variables.module.css.js +8 -0
- package/dist/components/tab/styles/tabs.module.css.js +22 -0
- package/dist/components/tab/subs/tabs-link-tab.d.ts +10 -0
- package/dist/components/tab/subs/tabs-link-tab.js +28 -0
- package/dist/components/tab/subs/tabs-list.d.ts +6 -0
- package/dist/components/tab/subs/tabs-list.js +59 -0
- package/dist/components/tab/subs/tabs-panel.d.ts +6 -0
- package/dist/components/tab/subs/tabs-panel.js +40 -0
- package/dist/components/tab/subs/tabs-tab.d.ts +6 -0
- package/dist/components/tab/subs/tabs-tab.js +52 -0
- package/dist/components/tab/tabs-context.d.ts +3 -0
- package/dist/components/tab/tabs-context.js +13 -0
- package/dist/components/tab/tabs.d.ts +20 -0
- package/dist/components/tab/tabs.js +83 -0
- package/dist/components/tab/tabs.types.d.ts +107 -0
- package/dist/components/tab/use-tabs-data-props.d.ts +9 -0
- package/dist/components/tab/use-tabs-data-props.js +12 -0
- package/dist/components/tab/use-tabs-keyboard-navigation.d.ts +13 -0
- package/dist/components/tab/use-tabs-keyboard-navigation.js +44 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/index.js +16 -0
- package/dist/components/table/table.d.ts +23 -0
- package/dist/components/table/table.js +159 -0
- package/dist/components/table/table.module.css.js +56 -0
- package/dist/components/table/table.types.d.ts +55 -0
- package/dist/components/table-pagination/index.d.ts +3 -0
- package/dist/components/table-pagination/index.js +8 -0
- package/dist/components/table-pagination/pagination.d.ts +10 -0
- package/dist/components/table-pagination/pagination.js +115 -0
- package/dist/components/table-pagination/pagination.module.css.js +14 -0
- package/dist/components/table-pagination/table-pagination.d.ts +15 -0
- package/dist/components/table-pagination/table-pagination.js +123 -0
- package/dist/components/table-pagination/table-pagination.module.css.js +18 -0
- package/dist/components/tag/closable-tag.d.ts +2 -0
- package/dist/components/tag/closable-tag.js +35 -0
- package/dist/components/tag/icon-tag.d.ts +2 -0
- package/dist/components/tag/icon-tag.js +36 -0
- package/dist/components/tag/index.d.ts +5 -0
- package/dist/components/tag/index.js +11 -0
- package/dist/components/tag/link-tag.d.ts +11 -0
- package/dist/components/tag/link-tag.js +31 -0
- package/dist/components/tag/styles/tag-variables.module.css.js +8 -0
- package/dist/components/tag/styles/tag.module.css.js +18 -0
- package/dist/components/tag/tag.d.ts +28 -0
- package/dist/components/tag/tag.js +40 -0
- package/dist/components/tag/tag.types.d.ts +72 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.js +5 -0
- package/dist/components/text/text.d.ts +3 -0
- package/dist/components/text/text.js +36 -0
- package/dist/components/text/text.module.css.js +8 -0
- package/dist/components/text/text.types.d.ts +11 -0
- package/dist/components/text-area/index.d.ts +2 -0
- package/dist/components/text-area/index.js +5 -0
- package/dist/components/text-area/text-area.d.ts +9 -0
- package/dist/components/text-area/text-area.js +125 -0
- package/dist/components/text-area/text-area.module.css.js +22 -0
- package/dist/components/text-area/text-area.types.d.ts +46 -0
- package/dist/components/text-input/index.d.ts +2 -0
- package/dist/components/text-input/index.js +5 -0
- package/dist/components/text-input/text-input.d.ts +14 -0
- package/dist/components/text-input/text-input.js +24 -0
- package/dist/components/tooltip/floating-arrow.d.ts +13 -0
- package/dist/components/tooltip/floating-arrow.js +40 -0
- package/dist/components/tooltip/get-arrow-position-styles.d.ts +11 -0
- package/dist/components/tooltip/get-arrow-position-styles.js +63 -0
- package/dist/components/tooltip/index.d.ts +54 -0
- package/dist/components/tooltip/index.js +150 -0
- package/dist/components/tooltip/styles.module.css.js +10 -0
- package/dist/components/tooltip/types.d.ts +13 -0
- package/dist/components/tooltip/use-merged-events.d.ts +18 -0
- package/dist/components/tooltip/use-merged-events.js +22 -0
- package/dist/components/tooltip/use-tooltip-trigger.d.ts +13 -0
- package/dist/components/tooltip/use-tooltip-trigger.js +59 -0
- package/dist/components/tooltip/utils.d.ts +4 -0
- package/dist/components/tooltip/utils.js +35 -0
- package/dist/components/tree/hooks/use-custom-click-behavior-feature.d.ts +16 -0
- package/dist/components/tree/hooks/use-custom-click-behavior-feature.js +125 -0
- package/dist/components/tree/hooks/use-tree-animation.d.ts +12 -0
- package/dist/components/tree/hooks/use-tree-animation.js +111 -0
- package/dist/components/tree/hooks/use-tree-config.d.ts +22 -0
- package/dist/components/tree/hooks/use-tree-config.js +96 -0
- package/dist/components/tree/hooks/use-tree-search.d.ts +19 -0
- package/dist/components/tree/hooks/use-tree-search.js +57 -0
- package/dist/components/tree/hooks/use-tree-value.d.ts +16 -0
- package/dist/components/tree/hooks/use-tree-value.js +37 -0
- package/dist/components/tree/hooks/use-tree.d.ts +13 -0
- package/dist/components/tree/hooks/use-tree.js +111 -0
- package/dist/components/tree/index.d.ts +7 -0
- package/dist/components/tree/index.js +16 -0
- package/dist/components/tree/styles/tree.module.css.js +44 -0
- package/dist/components/tree/tree-content.d.ts +15 -0
- package/dist/components/tree/tree-content.js +77 -0
- package/dist/components/tree/tree-context.d.ts +19 -0
- package/dist/components/tree/tree-context.js +13 -0
- package/dist/components/tree/tree-node-list.d.ts +9 -0
- package/dist/components/tree/tree-node-list.js +21 -0
- package/dist/components/tree/tree-node.d.ts +11 -0
- package/dist/components/tree/tree-node.js +137 -0
- package/dist/components/tree/tree.d.ts +20 -0
- package/dist/components/tree/tree.js +22 -0
- package/dist/components/tree/tree.types.d.ts +126 -0
- package/dist/components/tree-select/index.d.ts +2 -0
- package/dist/components/tree-select/index.js +5 -0
- package/dist/components/tree-select/styles/tree-select.module.css.js +20 -0
- package/dist/components/tree-select/tree-select-dropdown.d.ts +9 -0
- package/dist/components/tree-select/tree-select-dropdown.js +36 -0
- package/dist/components/tree-select/tree-select-target.d.ts +18 -0
- package/dist/components/tree-select/tree-select-target.js +116 -0
- package/dist/components/tree-select/tree-select.d.ts +21 -0
- package/dist/components/tree-select/tree-select.js +201 -0
- package/dist/components/tree-select/tree-select.types.d.ts +39 -0
- package/dist/components/unstyled-button/index.d.ts +1 -0
- package/dist/components/unstyled-button/index.js +5 -0
- package/dist/components/unstyled-button/unstyled-button.d.ts +3 -0
- package/dist/components/unstyled-button/unstyled-button.js +19 -0
- package/dist/components/unstyled-button/unstyled-button.module.css.js +8 -0
- package/dist/components/virtualized-tree-select/index.d.ts +2 -0
- package/dist/components/virtualized-tree-select/index.js +5 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.d.ts +25 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.js +253 -0
- package/dist/components/virtualized-tree-select/virtualized-tree-select.module.css.js +20 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +214 -0
- package/dist/locale/ar.d.ts +2 -0
- package/dist/locale/ar.js +58 -0
- package/dist/locale/en.d.ts +2 -0
- package/dist/locale/en.js +58 -0
- package/dist/locale/index.d.ts +6 -0
- package/dist/locale/index.js +15 -0
- package/dist/locale/ko.d.ts +2 -0
- package/dist/locale/ko.js +58 -0
- package/dist/locale/types.d.ts +55 -0
- package/dist/locale/types.js +8 -0
- package/dist/locale/zh-Hans.d.ts +2 -0
- package/dist/locale/zh-Hans.js +58 -0
- package/dist/locale/zh-Hant.d.ts +2 -0
- package/dist/locale/zh-Hant.js +58 -0
- package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-number-format/dist/react-number-format.es.js +572 -0
- package/dist/provider/hooks.d.ts +24 -0
- package/dist/provider/hooks.js +26 -0
- package/dist/provider/index.d.ts +7 -0
- package/dist/provider/index.js +16 -0
- package/dist/provider/ui-context.d.ts +16 -0
- package/dist/provider/ui-context.js +14 -0
- package/dist/provider/ui-link.d.ts +22 -0
- package/dist/provider/ui-link.js +10 -0
- package/dist/provider/ui-provider.d.ts +19 -0
- package/dist/provider/ui-provider.js +21 -0
- package/package.json +198 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as E, jsx as d } from "react/jsx-runtime";
|
|
3
|
+
import { useId as ue } from "@mantine/hooks";
|
|
4
|
+
import { clsx as ge } from "clsx";
|
|
5
|
+
import { useState as Ie, useCallback as m, useMemo as G } from "react";
|
|
6
|
+
import { useFormWrapperProps as be } from "../../common/use-form-wrapper-props.js";
|
|
7
|
+
import "../../provider/ui-context.js";
|
|
8
|
+
import { useLocale as Ce } from "../../provider/hooks.js";
|
|
9
|
+
import { Checkbox as Se } from "../checkbox/checkbox.js";
|
|
10
|
+
import { FormItemWrapper as we } from "../form-wrapper/form-item-wrapper.js";
|
|
11
|
+
import { Popover as J } from "../popover/index.js";
|
|
12
|
+
import { TreeContextProvider as ke } from "../tree/tree-context.js";
|
|
13
|
+
import { useTree as Te } from "../tree/hooks/use-tree.js";
|
|
14
|
+
import A from "./styles/tree-select.module.css.js";
|
|
15
|
+
import { TreeSelectDropdown as Ne } from "./tree-select-dropdown.js";
|
|
16
|
+
import { TreeSelectTarget as Oe } from "./tree-select-target.js";
|
|
17
|
+
const ve = (h, p, c) => {
|
|
18
|
+
if (!p) return null;
|
|
19
|
+
const n = [...h];
|
|
20
|
+
for (; n.length > 0; ) {
|
|
21
|
+
const l = n.shift();
|
|
22
|
+
if (l) {
|
|
23
|
+
if (c(l.data) === p) return l.data;
|
|
24
|
+
l.children?.length && n.push(...l.children);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
function ye(h) {
|
|
30
|
+
const { id: p } = h, c = ue(p), { wrapProps: n, rest: l, outerDescribedBy: P } = be(h, c), {
|
|
31
|
+
onChange: x,
|
|
32
|
+
selectionMode: t = "single",
|
|
33
|
+
data: S,
|
|
34
|
+
getItemId: w,
|
|
35
|
+
isItemFolder: k,
|
|
36
|
+
isItemDisabled: D,
|
|
37
|
+
selectableFolders: T = !0,
|
|
38
|
+
propagateCheckedState: K = !0,
|
|
39
|
+
showSelectAll: N = !1,
|
|
40
|
+
placeholder: Q,
|
|
41
|
+
disabled: f = !1,
|
|
42
|
+
clearable: U = !1,
|
|
43
|
+
size: X = "md",
|
|
44
|
+
singleLine: Y,
|
|
45
|
+
borderRadius: Z = "full",
|
|
46
|
+
position: _ = "bottom-start",
|
|
47
|
+
withinPortal: $ = !0,
|
|
48
|
+
dropdownMaxHeight: ee = 404,
|
|
49
|
+
searchable: O = !0,
|
|
50
|
+
searchPlaceholder: le,
|
|
51
|
+
renderTarget: F,
|
|
52
|
+
"aria-label": L,
|
|
53
|
+
onDropdownOpen: R,
|
|
54
|
+
onDropdownClose: M
|
|
55
|
+
} = l, [u, te] = Ie(!1), g = m(
|
|
56
|
+
(e) => {
|
|
57
|
+
te(e), e ? R?.() : M?.();
|
|
58
|
+
},
|
|
59
|
+
[R, M]
|
|
60
|
+
), re = m(
|
|
61
|
+
(e) => {
|
|
62
|
+
t === "single" && g(!1), x?.(e);
|
|
63
|
+
},
|
|
64
|
+
[t, g, x]
|
|
65
|
+
), W = Te({ ...l, onChange: re }), {
|
|
66
|
+
tree: se,
|
|
67
|
+
searchValue: oe,
|
|
68
|
+
setSearchValue: j,
|
|
69
|
+
classNames: v,
|
|
70
|
+
selectedItems: ne,
|
|
71
|
+
checkedItems: y,
|
|
72
|
+
setCheckedItems: I,
|
|
73
|
+
clear: ae,
|
|
74
|
+
getItemName: de
|
|
75
|
+
} = W, V = m(
|
|
76
|
+
(e) => {
|
|
77
|
+
g(e), !e && O && j("");
|
|
78
|
+
},
|
|
79
|
+
[g, O, j]
|
|
80
|
+
), z = t === "single" ? ne : y, ce = m(
|
|
81
|
+
(e) => {
|
|
82
|
+
I((s) => s.filter((a) => a !== e));
|
|
83
|
+
},
|
|
84
|
+
[I]
|
|
85
|
+
), B = t === "single" && F ? F({
|
|
86
|
+
selected: ve(S, z[0], w),
|
|
87
|
+
dropdownOpened: u,
|
|
88
|
+
disabled: f
|
|
89
|
+
}) : null, ie = Ce(), r = G(() => {
|
|
90
|
+
const e = [], s = [], a = [];
|
|
91
|
+
if (!N || t !== "multi")
|
|
92
|
+
return { leafIds: e, folderIds: s, disabledIds: a };
|
|
93
|
+
const i = (fe) => {
|
|
94
|
+
for (const o of fe) {
|
|
95
|
+
const q = w(o.data);
|
|
96
|
+
if (D?.(o.data)) {
|
|
97
|
+
a.push(q), o.children?.length && i(o.children);
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
((k ? k(o.data) : !!o.children?.length) ? s : e).push(q), o.children?.length && i(o.children);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return i(S), { leafIds: e, folderIds: s, disabledIds: a };
|
|
104
|
+
}, [
|
|
105
|
+
N,
|
|
106
|
+
t,
|
|
107
|
+
S,
|
|
108
|
+
w,
|
|
109
|
+
k,
|
|
110
|
+
D
|
|
111
|
+
]), H = G(() => new Set(y), [y]), b = T && !K ? [...r.folderIds, ...r.leafIds] : r.leafIds, C = b.length > 0 && b.every((e) => H.has(e)), me = b.some((e) => H.has(e)), he = m(() => {
|
|
112
|
+
I((e) => {
|
|
113
|
+
const s = e.filter(
|
|
114
|
+
(i) => r.disabledIds.includes(i)
|
|
115
|
+
);
|
|
116
|
+
if (C) return s;
|
|
117
|
+
const a = T ? [...r.folderIds, ...r.leafIds] : r.leafIds;
|
|
118
|
+
return [...s, ...a];
|
|
119
|
+
});
|
|
120
|
+
}, [C, T, r, I]), pe = N && t === "multi" && !oe && b.length > 0 ? /* @__PURE__ */ E("div", { className: A.selectAllRow, children: [
|
|
121
|
+
/* @__PURE__ */ d("span", { className: A.spacer, "aria-hidden": "true" }),
|
|
122
|
+
/* @__PURE__ */ d(
|
|
123
|
+
Se,
|
|
124
|
+
{
|
|
125
|
+
checked: C,
|
|
126
|
+
indeterminate: !C && me,
|
|
127
|
+
onChange: he,
|
|
128
|
+
label: ie.selectAll,
|
|
129
|
+
labelClassName: A.selectAllLabel
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }) : null;
|
|
133
|
+
return /* @__PURE__ */ d(ke, { value: W, children: /* @__PURE__ */ d(
|
|
134
|
+
we,
|
|
135
|
+
{
|
|
136
|
+
...n,
|
|
137
|
+
className: ge(v?.root, n.className),
|
|
138
|
+
id: c,
|
|
139
|
+
children: /* @__PURE__ */ E(
|
|
140
|
+
J,
|
|
141
|
+
{
|
|
142
|
+
opened: u,
|
|
143
|
+
onOpenChange: V,
|
|
144
|
+
position: _,
|
|
145
|
+
disabled: f,
|
|
146
|
+
offset: 4,
|
|
147
|
+
children: [
|
|
148
|
+
/* @__PURE__ */ d(
|
|
149
|
+
J.Target,
|
|
150
|
+
{
|
|
151
|
+
...B ? {
|
|
152
|
+
"aria-label": L,
|
|
153
|
+
"aria-describedby": P
|
|
154
|
+
} : {},
|
|
155
|
+
children: B ?? /* @__PURE__ */ d(
|
|
156
|
+
Oe,
|
|
157
|
+
{
|
|
158
|
+
size: X,
|
|
159
|
+
placeholder: Q,
|
|
160
|
+
disabled: f,
|
|
161
|
+
clearable: U,
|
|
162
|
+
error: n.error,
|
|
163
|
+
singleLine: Y,
|
|
164
|
+
borderRadius: Z,
|
|
165
|
+
id: c,
|
|
166
|
+
"aria-label": L,
|
|
167
|
+
"aria-describedby": P,
|
|
168
|
+
selectionMode: t,
|
|
169
|
+
selectedIds: z,
|
|
170
|
+
tree: se,
|
|
171
|
+
getItemName: de,
|
|
172
|
+
onRemove: ce,
|
|
173
|
+
onClick: () => !f && V(!u),
|
|
174
|
+
onClear: ae,
|
|
175
|
+
dropdownOpened: u,
|
|
176
|
+
classNames: v
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ d(
|
|
182
|
+
Ne,
|
|
183
|
+
{
|
|
184
|
+
classNames: v,
|
|
185
|
+
searchable: O,
|
|
186
|
+
searchPlaceholder: le,
|
|
187
|
+
withinPortal: $,
|
|
188
|
+
dropdownMaxHeight: ee,
|
|
189
|
+
topSlot: pe
|
|
190
|
+
}
|
|
191
|
+
)
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
) });
|
|
197
|
+
}
|
|
198
|
+
ye.displayName = "TreeSelect";
|
|
199
|
+
export {
|
|
200
|
+
ye as TreeSelect
|
|
201
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormProps, InputWrapProps, SimpleComponentSizeBase } from '../../common/components.types';
|
|
3
|
+
import { PopoverPosition } from '../popover';
|
|
4
|
+
import { TreeBaseProps, TreeClassNames } from '../tree/tree.types';
|
|
5
|
+
export interface TreeSelectClassNames extends TreeClassNames {
|
|
6
|
+
target?: string;
|
|
7
|
+
dropdown?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TreeSelectRenderTargetProps<T> {
|
|
10
|
+
readonly selected: T | null;
|
|
11
|
+
readonly dropdownOpened: boolean;
|
|
12
|
+
readonly disabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* TreeSelect 下拉树组件 Props
|
|
16
|
+
*/
|
|
17
|
+
export type TreeSelectProps<T = unknown> = TreeBaseProps<T> & InputWrapProps & FormProps & {
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
size?: SimpleComponentSizeBase;
|
|
22
|
+
borderRadius?: 'full' | 'sm';
|
|
23
|
+
position?: PopoverPosition;
|
|
24
|
+
/** PC 端下拉是否渲染到 Portal;嵌套浮层关系由 Popover 自动处理。 @default true */
|
|
25
|
+
withinPortal?: boolean;
|
|
26
|
+
/** 下拉面板最大高度,超出后内部列表滚动。number 按 px 处理。 @default 404 */
|
|
27
|
+
dropdownMaxHeight?: number | string;
|
|
28
|
+
classNames?: TreeSelectClassNames;
|
|
29
|
+
/** 多选模式下,已选标签超出 2 个是否折叠为 "+N...",默认为 true */
|
|
30
|
+
singleLine?: boolean;
|
|
31
|
+
/** 仅多选有效:在下拉面板顶部显示全选行(搜索时自动隐藏) */
|
|
32
|
+
showSelectAll?: boolean;
|
|
33
|
+
/** 自定义单选触发器,返回的元素会直接接收 Popover 交互和 ARIA 属性 */
|
|
34
|
+
renderTarget?: (props: TreeSelectRenderTargetProps<T>) => React.ReactElement;
|
|
35
|
+
id?: string;
|
|
36
|
+
'aria-label'?: string;
|
|
37
|
+
onDropdownOpen?: () => void;
|
|
38
|
+
onDropdownClose?: () => void;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UnstyledButton } from './unstyled-button';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BoxProps, LayoutElement } from '../box/box.types';
|
|
2
|
+
export type UnstyledButtonProps<T extends LayoutElement = 'button'> = BoxProps<T>;
|
|
3
|
+
export declare function UnstyledButton<T extends LayoutElement = 'button'>(props: UnstyledButtonProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { clsx as e } from "clsx";
|
|
4
|
+
import { Box as n } from "../box/box.js";
|
|
5
|
+
import c from "./unstyled-button.module.css.js";
|
|
6
|
+
function u(o) {
|
|
7
|
+
const { component: t = "button", className: r, ...s } = o;
|
|
8
|
+
return /* @__PURE__ */ m(
|
|
9
|
+
n,
|
|
10
|
+
{
|
|
11
|
+
component: t,
|
|
12
|
+
className: e(c.root, r),
|
|
13
|
+
...s
|
|
14
|
+
}
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
u as UnstyledButton
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TreeDataNode } from '../tree/tree.types';
|
|
2
|
+
type SingleModeProps = {
|
|
3
|
+
selectionMode?: 'single';
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
};
|
|
7
|
+
type MultiModeProps = {
|
|
8
|
+
selectionMode: 'multi';
|
|
9
|
+
value?: string[];
|
|
10
|
+
onChange?: (value: string[]) => void;
|
|
11
|
+
};
|
|
12
|
+
type SelectionProps = SingleModeProps | MultiModeProps;
|
|
13
|
+
export type VirtualizedTreeSelectProps<T = unknown> = SelectionProps & {
|
|
14
|
+
readonly data: TreeDataNode<T>[];
|
|
15
|
+
readonly getItemId: (item: T) => string;
|
|
16
|
+
readonly getItemName: (item: T) => string;
|
|
17
|
+
readonly clearable?: boolean;
|
|
18
|
+
readonly placeholder?: string;
|
|
19
|
+
readonly id?: string;
|
|
20
|
+
readonly defaultExpandedIds?: string[];
|
|
21
|
+
readonly onDropdownClose?: (value: string[]) => void;
|
|
22
|
+
readonly borderRadius?: 'sm' | 'full';
|
|
23
|
+
};
|
|
24
|
+
export declare function VirtualizedTreeSelect<T = unknown>(props: VirtualizedTreeSelectProps<T>): import("react").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as M, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { useCombobox as ne, Combobox as f, PillsInput as _, Pill as H, Checkbox as te } from "@mantine/core";
|
|
4
|
+
import { useId as oe } from "@mantine/hooks";
|
|
5
|
+
import { useVirtualizer as re } from "@tanstack/react-virtual";
|
|
6
|
+
import { clsx as ie } from "clsx";
|
|
7
|
+
import { useState as W, useRef as I, useDeferredValue as ae, useEffect as le, useMemo as P } from "react";
|
|
8
|
+
import "../../provider/ui-context.js";
|
|
9
|
+
import { useLocale as se } from "../../provider/hooks.js";
|
|
10
|
+
import { useIsWrapped as ce } from "../_inner/tags-input/hooks/use-is-wrapped.js";
|
|
11
|
+
import A from "../_inner/tags-input/styles/tags-input.module.css.js";
|
|
12
|
+
import { IconButton as de } from "../icon-button/icon-button.js";
|
|
13
|
+
import { Text as ue } from "../text/text.js";
|
|
14
|
+
import { Tooltip as he } from "../tooltip/index.js";
|
|
15
|
+
import g from "./virtualized-tree-select.module.css.js";
|
|
16
|
+
const pe = 36, fe = 320, G = 8, me = 27;
|
|
17
|
+
function j(a, t, l, r = /* @__PURE__ */ new Map()) {
|
|
18
|
+
for (const s of a)
|
|
19
|
+
r.set(t(s.data), l(s.data)), s.children && j(s.children, t, l, r);
|
|
20
|
+
return r;
|
|
21
|
+
}
|
|
22
|
+
function Y(a, t, l, r, s = 0) {
|
|
23
|
+
const p = [];
|
|
24
|
+
for (const d of a) {
|
|
25
|
+
const u = t(d.data), h = !!d.children?.length;
|
|
26
|
+
p.push({ id: u, name: l(d.data), depth: s, isFolder: h }), h && r.has(u) && d.children && p.push(
|
|
27
|
+
...Y(
|
|
28
|
+
d.children,
|
|
29
|
+
t,
|
|
30
|
+
l,
|
|
31
|
+
r,
|
|
32
|
+
s + 1
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return p;
|
|
37
|
+
}
|
|
38
|
+
function $(a, t, l, r, s = 0) {
|
|
39
|
+
const p = [], d = r.toLowerCase();
|
|
40
|
+
for (const u of a) {
|
|
41
|
+
const h = t(u.data), v = l(u.data), D = !!u.children?.length, x = u.children ? $(u.children, t, l, r, s + 1) : [];
|
|
42
|
+
(v.toLowerCase().includes(d) || x.length > 0) && (p.push({ id: h, name: v, depth: s, isFolder: D }), p.push(...x));
|
|
43
|
+
}
|
|
44
|
+
return p;
|
|
45
|
+
}
|
|
46
|
+
function Re(a) {
|
|
47
|
+
const {
|
|
48
|
+
data: t,
|
|
49
|
+
getItemId: l,
|
|
50
|
+
getItemName: r,
|
|
51
|
+
selectionMode: s = "single",
|
|
52
|
+
clearable: p,
|
|
53
|
+
placeholder: d,
|
|
54
|
+
id: u,
|
|
55
|
+
defaultExpandedIds: h,
|
|
56
|
+
onDropdownClose: v,
|
|
57
|
+
borderRadius: D = "full"
|
|
58
|
+
} = a, x = se(), q = oe(u), [k, L] = W(""), [y, T] = W(
|
|
59
|
+
() => new Set(h ?? [])
|
|
60
|
+
), V = I(null), N = ae(k), w = N.trim().length > 0, [J, K] = ce(), B = I(t);
|
|
61
|
+
le(() => {
|
|
62
|
+
const e = B.current !== t;
|
|
63
|
+
if (B.current = t, e) {
|
|
64
|
+
T(new Set(h ?? []));
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
h?.length && T((n) => {
|
|
68
|
+
const i = new Set(n);
|
|
69
|
+
let E = !1;
|
|
70
|
+
for (const m of h)
|
|
71
|
+
i.has(m) || (i.add(m), E = !0);
|
|
72
|
+
return E ? i : n;
|
|
73
|
+
});
|
|
74
|
+
}, [t, h]);
|
|
75
|
+
const b = s === "multi", c = P(() => {
|
|
76
|
+
const e = a.value;
|
|
77
|
+
return Array.isArray(e) ? e : typeof e == "string" ? [e] : [];
|
|
78
|
+
}, [a.value]), O = I(v);
|
|
79
|
+
O.current = v;
|
|
80
|
+
const S = I(c);
|
|
81
|
+
S.current = c;
|
|
82
|
+
const R = (e) => {
|
|
83
|
+
S.current = e, O.current?.(e);
|
|
84
|
+
}, C = ne({
|
|
85
|
+
onDropdownClose: () => {
|
|
86
|
+
L(""), O.current?.(S.current);
|
|
87
|
+
}
|
|
88
|
+
}), Q = P(
|
|
89
|
+
() => j(t, l, r),
|
|
90
|
+
[t, l, r]
|
|
91
|
+
), z = P(
|
|
92
|
+
() => w ? $(t, l, r, N) : Y(t, l, r, y),
|
|
93
|
+
[t, l, r, N, w, y]
|
|
94
|
+
), F = re({
|
|
95
|
+
count: z.length,
|
|
96
|
+
getScrollElement: () => V.current,
|
|
97
|
+
estimateSize: () => pe,
|
|
98
|
+
overscan: 10
|
|
99
|
+
}), U = (e) => {
|
|
100
|
+
T((n) => {
|
|
101
|
+
const i = new Set(n);
|
|
102
|
+
return i.has(e) ? i.delete(e) : i.add(e), i;
|
|
103
|
+
});
|
|
104
|
+
}, X = (e) => {
|
|
105
|
+
if (b) {
|
|
106
|
+
const n = c.includes(e) ? c.filter((i) => i !== e) : [...c, e];
|
|
107
|
+
a.onChange?.(n), S.current = n;
|
|
108
|
+
} else
|
|
109
|
+
a.onChange?.(e), S.current = [e], C.closeDropdown();
|
|
110
|
+
}, Z = (e) => {
|
|
111
|
+
if (!b) return;
|
|
112
|
+
const n = c.filter((i) => i !== e);
|
|
113
|
+
a.onChange?.(n), R(n);
|
|
114
|
+
}, ee = () => {
|
|
115
|
+
b ? (a.onChange?.([]), R([])) : (a.onChange?.(""), R([]));
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ M(
|
|
118
|
+
f,
|
|
119
|
+
{
|
|
120
|
+
store: C,
|
|
121
|
+
withinPortal: !1,
|
|
122
|
+
onOptionSubmit: X,
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ o(f.Target, { children: /* @__PURE__ */ o(
|
|
125
|
+
_,
|
|
126
|
+
{
|
|
127
|
+
id: q,
|
|
128
|
+
classNames: {
|
|
129
|
+
input: A.pillsInput,
|
|
130
|
+
section: A.pillsInputSection
|
|
131
|
+
},
|
|
132
|
+
"data-size": "md",
|
|
133
|
+
"data-border-radius": D,
|
|
134
|
+
"data-wrapped": K,
|
|
135
|
+
"data-value-length": c.length,
|
|
136
|
+
rightSection: p && c.length > 0 ? /* @__PURE__ */ o(f.ClearButton, { onClear: ee }) : void 0,
|
|
137
|
+
onClick: () => C.openDropdown(),
|
|
138
|
+
children: /* @__PURE__ */ M(H.Group, { ref: J, children: [
|
|
139
|
+
c.map((e) => /* @__PURE__ */ o(
|
|
140
|
+
H,
|
|
141
|
+
{
|
|
142
|
+
withRemoveButton: b,
|
|
143
|
+
onRemove: () => Z(e),
|
|
144
|
+
children: Q.get(e) ?? e
|
|
145
|
+
},
|
|
146
|
+
e
|
|
147
|
+
)),
|
|
148
|
+
/* @__PURE__ */ o(f.EventsTarget, { children: /* @__PURE__ */ o(
|
|
149
|
+
_.Field,
|
|
150
|
+
{
|
|
151
|
+
"aria-label": d ?? x.pleaseSelect,
|
|
152
|
+
placeholder: c.length === 0 ? d : void 0,
|
|
153
|
+
value: k,
|
|
154
|
+
onChange: (e) => {
|
|
155
|
+
C.updateSelectedOptionIndex(), L(e.currentTarget.value);
|
|
156
|
+
},
|
|
157
|
+
onFocus: () => C.openDropdown(),
|
|
158
|
+
onBlur: () => C.closeDropdown()
|
|
159
|
+
}
|
|
160
|
+
) })
|
|
161
|
+
] })
|
|
162
|
+
}
|
|
163
|
+
) }),
|
|
164
|
+
/* @__PURE__ */ o(f.Dropdown, { children: /* @__PURE__ */ o(f.Options, { children: z.length === 0 ? /* @__PURE__ */ o(f.Empty, { children: x.noData }) : /* @__PURE__ */ o(
|
|
165
|
+
"div",
|
|
166
|
+
{
|
|
167
|
+
ref: V,
|
|
168
|
+
style: { height: fe, overflowY: "auto" },
|
|
169
|
+
children: /* @__PURE__ */ o(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
style: {
|
|
173
|
+
height: F.getTotalSize(),
|
|
174
|
+
position: "relative"
|
|
175
|
+
},
|
|
176
|
+
children: F.getVirtualItems().map((e) => {
|
|
177
|
+
const n = z[e.index], i = c.includes(n.id), E = w || y.has(n.id);
|
|
178
|
+
return /* @__PURE__ */ o(
|
|
179
|
+
f.Option,
|
|
180
|
+
{
|
|
181
|
+
value: n.id,
|
|
182
|
+
className: g.virtualOption,
|
|
183
|
+
style: {
|
|
184
|
+
height: e.size,
|
|
185
|
+
transform: `translateY(${e.start}px)`,
|
|
186
|
+
padding: 0
|
|
187
|
+
},
|
|
188
|
+
children: /* @__PURE__ */ M(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: g.virtualOptionContent,
|
|
192
|
+
style: {
|
|
193
|
+
paddingInlineStart: G + n.depth * me,
|
|
194
|
+
paddingInlineEnd: G
|
|
195
|
+
},
|
|
196
|
+
children: [
|
|
197
|
+
n.isFolder ? /* @__PURE__ */ o(
|
|
198
|
+
de,
|
|
199
|
+
{
|
|
200
|
+
iconName: "arrow-right-fill",
|
|
201
|
+
iconClassName: E ? g.expandIconOpen : g.expandIcon,
|
|
202
|
+
variant: "text",
|
|
203
|
+
color: "regular",
|
|
204
|
+
size: "md",
|
|
205
|
+
tabIndex: -1,
|
|
206
|
+
"aria-hidden": !0,
|
|
207
|
+
onMouseDown: (m) => {
|
|
208
|
+
m.preventDefault(), m.stopPropagation();
|
|
209
|
+
},
|
|
210
|
+
onClick: (m) => {
|
|
211
|
+
m.stopPropagation(), w || U(n.id);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
) : /* @__PURE__ */ o("span", { className: g.spacer, "aria-hidden": !0 }),
|
|
215
|
+
b && /* @__PURE__ */ o(
|
|
216
|
+
te,
|
|
217
|
+
{
|
|
218
|
+
readOnly: !0,
|
|
219
|
+
"aria-hidden": !0,
|
|
220
|
+
tabIndex: -1,
|
|
221
|
+
checked: i,
|
|
222
|
+
style: { cursor: "pointer", pointerEvents: "none" }
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ o(he, { showOnlyWhenTruncated: !0, label: n.name, children: /* @__PURE__ */ o(
|
|
226
|
+
ue,
|
|
227
|
+
{
|
|
228
|
+
component: "span",
|
|
229
|
+
className: ie(
|
|
230
|
+
g.nodeLabel,
|
|
231
|
+
i && g.nodeLabelChecked
|
|
232
|
+
),
|
|
233
|
+
children: n.name
|
|
234
|
+
}
|
|
235
|
+
) })
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
)
|
|
239
|
+
},
|
|
240
|
+
e.key
|
|
241
|
+
);
|
|
242
|
+
})
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
}
|
|
246
|
+
) }) })
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
export {
|
|
252
|
+
Re as VirtualizedTreeSelect
|
|
253
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
const n = "_virtualOption_rl5uu_2", e = "_virtualOptionContent_rl5uu_9", o = "_spacer_rl5uu_15", t = "_expandIcon_rl5uu_21", a = "_expandIconOpen_rl5uu_25", l = "_nodeLabel_rl5uu_29", u = "_nodeLabelChecked_rl5uu_40", c = {
|
|
3
|
+
virtualOption: n,
|
|
4
|
+
virtualOptionContent: e,
|
|
5
|
+
spacer: o,
|
|
6
|
+
expandIcon: t,
|
|
7
|
+
expandIconOpen: a,
|
|
8
|
+
nodeLabel: l,
|
|
9
|
+
nodeLabelChecked: u
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
c as default,
|
|
13
|
+
t as expandIcon,
|
|
14
|
+
a as expandIconOpen,
|
|
15
|
+
l as nodeLabel,
|
|
16
|
+
u as nodeLabelChecked,
|
|
17
|
+
o as spacer,
|
|
18
|
+
n as virtualOption,
|
|
19
|
+
e as virtualOptionContent
|
|
20
|
+
};
|