@gears-frontx/ui-kit 0.4.4 → 0.4.6
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/dist/chunks/actions.iasfkjWq.css +1 -0
- package/dist/chunks/create-column-auto-size.js +62 -0
- package/dist/chunks/create-column-auto-size.js.map +1 -0
- package/dist/chunks/data-grid-record-context.js +13 -0
- package/dist/chunks/data-grid-record-context.js.map +1 -0
- package/dist/chunks/data-grid.-6P4UQGJ.css +1 -0
- package/dist/chunks/debounce.js +17 -0
- package/dist/chunks/debounce.js.map +1 -0
- package/dist/chunks/empty.Cfg5lE0n.css +1 -0
- package/dist/chunks/filters.DcFdZpNG.css +1 -0
- package/dist/chunks/hooked.js +44 -0
- package/dist/chunks/hooked.js.map +1 -0
- package/dist/chunks/ignore-row-click.js +5 -0
- package/dist/chunks/ignore-row-click.js.map +1 -0
- package/dist/chunks/messages.js +34 -3
- package/dist/chunks/messages.js.map +1 -1
- package/dist/chunks/pagination.DPVITj_D.css +1 -0
- package/dist/chunks/resolve-body-cell-props.DGczzk1U.css +1 -0
- package/dist/chunks/resolve-body-cell-props.js +140 -0
- package/dist/chunks/resolve-body-cell-props.js.map +1 -0
- package/dist/chunks/row-actions.BprAXgu2.css +1 -0
- package/dist/chunks/row-click.DAYTmSBO.css +1 -0
- package/dist/chunks/row-number.C7fNu9Bw.css +1 -0
- package/dist/chunks/row-select.BjKdiMf5.css +1 -0
- package/dist/chunks/table-configuration.a6C_fp7B.css +1 -0
- package/dist/chunks/table-context.js +8 -0
- package/dist/chunks/table-context.js.map +1 -0
- package/dist/chunks/table-types.js +11 -0
- package/dist/chunks/table-types.js.map +1 -0
- package/dist/chunks/table.Dmz7LEk7.css +1 -0
- package/dist/components/data-grid/components/filter-chip.d.ts +21 -0
- package/dist/components/data-grid/components/filter-chip.d.ts.map +1 -0
- package/dist/components/data-grid/components/filter-control-area.d.ts +9 -0
- package/dist/components/data-grid/components/filter-control-area.d.ts.map +1 -0
- package/dist/components/data-grid/components/filter-options-search-input.d.ts +11 -0
- package/dist/components/data-grid/components/filter-options-search-input.d.ts.map +1 -0
- package/dist/components/data-grid/components/filter-popover-content.d.ts +8 -0
- package/dist/components/data-grid/components/filter-popover-content.d.ts.map +1 -0
- package/dist/components/data-grid/components/filter-reset-button.d.ts +8 -0
- package/dist/components/data-grid/components/filter-reset-button.d.ts.map +1 -0
- package/dist/components/data-grid/components/filter-scrollable-wrapper.d.ts +8 -0
- package/dist/components/data-grid/components/filter-scrollable-wrapper.d.ts.map +1 -0
- package/dist/components/data-grid/messages.d.ts +31 -0
- package/dist/components/data-grid/messages.d.ts.map +1 -1
- package/dist/components/data-grid/plugins/actions/actions-plugin.d.ts +4 -0
- package/dist/components/data-grid/plugins/actions/actions-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/actions-types.d.ts +11 -0
- package/dist/components/data-grid/plugins/actions/actions-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions/components/data-grid-actions-wrapper.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-plugin.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-types.d.ts +25 -0
- package/dist/components/data-grid/plugins/actions-menu/actions-menu-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/components/data-grid-actions-menu.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/actions-menu/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/adaptive-popover.d.ts +20 -0
- package/dist/components/data-grid/plugins/filters/components/adaptive-popover.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/all-filters-button.d.ts +3 -0
- package/dist/components/data-grid/plugins/filters/components/all-filters-button.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/all-filters-dialog.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/components/all-filters-dialog.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/dialog-filter-item.d.ts +9 -0
- package/dist/components/data-grid/plugins/filters/components/dialog-filter-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/filter-label.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/components/filter-label.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/filter-popover.d.ts +9 -0
- package/dist/components/data-grid/plugins/filters/components/filter-popover.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/filter-single.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/components/filter-single.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/components/filters-bar.d.ts +3 -0
- package/dist/components/data-grid/plugins/filters/components/filters-bar.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-dialog-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-dialog-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-list.d.ts +12 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-list.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/checkbox-group-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/filter-checkbox-group.d.ts +20 -0
- package/dist/components/data-grid/plugins/filters/entities/checkbox-group/filter-checkbox-group.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-calendar.d.ts +17 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-calendar.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-dialog-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-dialog-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-selection.d.ts +16 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-selection.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-value.d.ts +19 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/date-range-value.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/filter-date-range.d.ts +16 -0
- package/dist/components/data-grid/plugins/filters/entities/date-range/filter-date-range.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/entities.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/entities.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/search/filter-search.d.ts +10 -0
- package/dist/components/data-grid/plugins/filters/entities/search/filter-search.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/search/search-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/search/search-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/filter-tag-group.d.ts +14 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/filter-tag-group.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-dialog-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-dialog-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-list.d.ts +11 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-list.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/tag-group/tag-group-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/toggle/filter-toggle.d.ts +10 -0
- package/dist/components/data-grid/plugins/filters/entities/toggle/filter-toggle.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/toggle/toggle-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/toggle/toggle-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/filter-tree.d.ts +20 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/filter-tree.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/resolve-filter-tree-value.d.ts +8 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/resolve-filter-tree-value.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-dialog-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-dialog-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-list.d.ts +12 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-list.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-quick-filter.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-quick-filter.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-radio-select-plugin.d.ts +13 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/tree-radio-select-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/use-tree-search.d.ts +8 -0
- package/dist/components/data-grid/plugins/filters/entities/tree/use-tree-search.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/filters-plugin.d.ts +3 -0
- package/dist/components/data-grid/plugins/filters/filters-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/filters-types.d.ts +141 -0
- package/dist/components/data-grid/plugins/filters/filters-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/public.d.ts +11 -0
- package/dist/components/data-grid/plugins/filters/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/services/read-option-values.d.ts +7 -0
- package/dist/components/data-grid/plugins/filters/services/read-option-values.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/services/use-async-filter-search.d.ts +20 -0
- package/dist/components/data-grid/plugins/filters/services/use-async-filter-search.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/filters/services/use-filter-search.d.ts +12 -0
- package/dist/components/data-grid/plugins/filters/services/use-filter-search.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/components/data-grid-row-actions-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-actions/components/data-grid-row-actions-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-actions/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-plugin.d.ts +6 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-types.d.ts +24 -0
- package/dist/components/data-grid/plugins/row-actions/row-actions-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/components/data-grid-row-click.d.ts +8 -0
- package/dist/components/data-grid/plugins/row-click/components/data-grid-row-click.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-click/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/row-click-plugin.d.ts +14 -0
- package/dist/components/data-grid/plugins/row-click/row-click-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-click/row-click-utils.d.ts +9 -0
- package/dist/components/data-grid/plugins/row-click/row-click-utils.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/components/data-grid-row-number-cell.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-number/components/data-grid-row-number-cell.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-number/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/row-number-plugin.d.ts +4 -0
- package/dist/components/data-grid/plugins/row-number/row-number-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/row-number-types.d.ts +6 -0
- package/dist/components/data-grid/plugins/row-number/row-number-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-number/services/row-number-formula.d.ts +2 -0
- package/dist/components/data-grid/plugins/row-number/services/row-number-formula.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-banner.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-banner.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-body.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-body.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-header.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-header.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-top.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/components/data-grid-row-select-top.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/row-select/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/row-select-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/row-select/row-select-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/row-select/row-select-types.d.ts +113 -0
- package/dist/components/data-grid/plugins/row-select/row-select-types.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.d.ts +10 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-group-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.d.ts +10 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-item.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.d.ts +8 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-pin-button.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration-trigger.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/components/data-grid-table-configuration.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/public.d.ts +3 -0
- package/dist/components/data-grid/plugins/table-configuration/public.d.ts.map +1 -0
- package/dist/components/data-grid/plugins/table-configuration/table-configuration-plugin.d.ts +5 -0
- package/dist/components/data-grid/plugins/table-configuration/table-configuration-plugin.d.ts.map +1 -0
- package/dist/components/data-grid/services/layout/components/data-grid-layout-top.d.ts.map +1 -1
- package/dist/components/data-grid/services/layout/components/toolbar-lines.d.ts +2 -0
- package/dist/components/data-grid/services/layout/components/toolbar-lines.d.ts.map +1 -0
- package/dist/components/data-grid/services/table/components/data-grid-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-extra-header-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-header-cell.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/components/data-grid-header-group.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/table-service.d.ts.map +1 -1
- package/dist/components/data-grid/services/table/table-sticky.d.ts +16 -0
- package/dist/components/data-grid/services/table/table-sticky.d.ts.map +1 -1
- package/dist/components/data-grid/tree/components/tree-actions.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-actions.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-content.d.ts +3 -0
- package/dist/components/data-grid/tree/components/tree-content.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-layout-slot.d.ts +9 -0
- package/dist/components/data-grid/tree/components/tree-layout-slot.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-left-slot.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-left-slot.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-list-item.d.ts +10 -0
- package/dist/components/data-grid/tree/components/tree-list-item.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-main.d.ts +3 -0
- package/dist/components/data-grid/tree/components/tree-main.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-node-content.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-node-content.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-node-directory-item.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-node-directory-item.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-node-leaf.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-node-leaf.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-nodes.d.ts +7 -0
- package/dist/components/data-grid/tree/components/tree-nodes.d.ts.map +1 -0
- package/dist/components/data-grid/tree/components/tree-placeholder.d.ts +6 -0
- package/dist/components/data-grid/tree/components/tree-placeholder.d.ts.map +1 -0
- package/dist/components/data-grid/tree/create-tree.d.ts +5 -0
- package/dist/components/data-grid/tree/create-tree.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/core/tree-context.d.ts +21 -0
- package/dist/components/data-grid/tree/services/core/tree-context.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/focus/focus-service.d.ts +5 -0
- package/dist/components/data-grid/tree/services/focus/focus-service.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/focus/focus-types.d.ts +25 -0
- package/dist/components/data-grid/tree/services/focus/focus-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/focus/navigation-helpers.d.ts +27 -0
- package/dist/components/data-grid/tree/services/focus/navigation-helpers.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/hooked/hooked-types.d.ts +8 -0
- package/dist/components/data-grid/tree/services/hooked/hooked-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/hooked/hooked.d.ts +3 -0
- package/dist/components/data-grid/tree/services/hooked/hooked.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/internal/internal-helpers.d.ts +2 -0
- package/dist/components/data-grid/tree/services/internal/internal-helpers.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/layout/layout-service.d.ts +5 -0
- package/dist/components/data-grid/tree/services/layout/layout-service.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/layout/layout-types.d.ts +124 -0
- package/dist/components/data-grid/tree/services/layout/layout-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-helpers.d.ts +50 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-helpers.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-service.d.ts +5 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-service.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-types.d.ts +43 -0
- package/dist/components/data-grid/tree/services/plugins/plugins-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/settings/settings-service.d.ts +5 -0
- package/dist/components/data-grid/tree/services/settings/settings-service.d.ts.map +1 -0
- package/dist/components/data-grid/tree/services/settings/settings-types.d.ts +73 -0
- package/dist/components/data-grid/tree/services/settings/settings-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/tree-types.d.ts +44 -0
- package/dist/components/data-grid/tree/tree-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree/tree.d.ts +4 -0
- package/dist/components/data-grid/tree/tree.d.ts.map +1 -0
- package/dist/components/data-grid/tree-structure/tree-structure-types.d.ts +89 -0
- package/dist/components/data-grid/tree-structure/tree-structure-types.d.ts.map +1 -0
- package/dist/components/data-grid/tree-structure/tree-structure.d.ts +19 -0
- package/dist/components/data-grid/tree-structure/tree-structure.d.ts.map +1 -0
- package/dist/components/data-grid/utils/components-stack.d.ts +12 -0
- package/dist/components/data-grid/utils/components-stack.d.ts.map +1 -0
- package/dist/components/data-grid/utils/use-is-tablet-up.d.ts +3 -0
- package/dist/components/data-grid/utils/use-is-tablet-up.d.ts.map +1 -0
- package/dist/components/table/table.d.ts +20 -3
- package/dist/components/table/table.d.ts.map +1 -1
- package/dist/data-grid/actions-menu.d.ts +1 -0
- package/dist/data-grid/actions-menu.js +57 -0
- package/dist/data-grid/actions-menu.js.map +1 -0
- package/dist/data-grid/actions.d.ts +1 -0
- package/dist/data-grid/actions.js +36 -0
- package/dist/data-grid/actions.js.map +1 -0
- package/dist/data-grid/filters.d.ts +1 -0
- package/dist/data-grid/filters.js +1634 -0
- package/dist/data-grid/filters.js.map +1 -0
- package/dist/data-grid/pagination.js +41 -40
- package/dist/data-grid/pagination.js.map +1 -1
- package/dist/data-grid/row-actions.d.ts +1 -0
- package/dist/data-grid/row-actions.js +52 -0
- package/dist/data-grid/row-actions.js.map +1 -0
- package/dist/data-grid/row-click.d.ts +1 -0
- package/dist/data-grid/row-click.js +69 -0
- package/dist/data-grid/row-click.js.map +1 -0
- package/dist/data-grid/row-number.d.ts +1 -0
- package/dist/data-grid/row-number.js +38 -0
- package/dist/data-grid/row-number.js.map +1 -0
- package/dist/data-grid/row-select.d.ts +1 -0
- package/dist/data-grid/row-select.js +293 -0
- package/dist/data-grid/row-select.js.map +1 -0
- package/dist/data-grid/table-configuration.d.ts +1 -0
- package/dist/data-grid/table-configuration.js +165 -0
- package/dist/data-grid/table-configuration.js.map +1 -0
- package/dist/data-grid/text-search.js +55 -67
- package/dist/data-grid/text-search.js.map +1 -1
- package/dist/data-grid.js +901 -1009
- package/dist/data-grid.js.map +1 -1
- package/dist/docs/data-grid.md +504 -11
- package/dist/docs/table.md +57 -2
- package/dist/empty.js +34 -34
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +418 -393
- package/dist/index.js.map +1 -1
- package/dist/table.js +114 -112
- package/dist/table.js.map +1 -1
- package/llms.txt +9 -7
- package/package.json +1 -1
- package/dist/chunks/data-grid.DIkpRRaf.css +0 -1
- package/dist/chunks/empty.DWqLrSfF.css +0 -1
- package/dist/chunks/pagination.BAAl9D_S.css +0 -1
- package/dist/chunks/table.CMm41tvy.css +0 -1
|
@@ -0,0 +1,1634 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { create as z } from "zustand";
|
|
3
|
+
import { u as k, c as rt, b as ot } from "../chunks/plugins-helpers.js";
|
|
4
|
+
import { jsx as s, jsxs as w, Fragment as P } from "react/jsx-runtime";
|
|
5
|
+
import { FunnelIcon as st, RotateCwIcon as it, XIcon as lt, SearchIcon as ct, ChevronRightIcon as at } from "lucide-react";
|
|
6
|
+
import { useSyncExternalStore as ut, useState as T, useEffect as $, useMemo as Te, useRef as Pe, useId as dt, createContext as ft, useContext as pt, createElement as Ce, memo as ht } from "react";
|
|
7
|
+
import { cx as W } from "class-variance-authority";
|
|
8
|
+
import { m as O } from "../chunks/messages.js";
|
|
9
|
+
import { SheetHeader as mt, SheetTitle as gt, SheetFooter as St, Sheet as vt, SheetContent as Ct } from "../sheet.js";
|
|
10
|
+
import { Accordion as yt, AccordionItem as It, AccordionTrigger as bt, AccordionContent as _t } from "../accordion.js";
|
|
11
|
+
import { Button as ue } from "../button.js";
|
|
12
|
+
import { Badge as de } from "../badge.js";
|
|
13
|
+
import { d as Ke } from "../chunks/debounce.js";
|
|
14
|
+
import { Popover as Nt, PopoverTrigger as wt, PopoverContent as At } from "../popover.js";
|
|
15
|
+
import { Drawer as xt, DrawerTrigger as Ft, DrawerContent as Dt } from "../drawer.js";
|
|
16
|
+
import { a as Lt } from "../chunks/table-types.js";
|
|
17
|
+
import { Input as Me } from "../input.js";
|
|
18
|
+
import { Spinner as kt } from "../spinner.js";
|
|
19
|
+
import { Label as Oe } from "../label.js";
|
|
20
|
+
import { Checkbox as Tt } from "../checkbox.js";
|
|
21
|
+
import { c as Pt, u as Kt } from "../chunks/hooked.js";
|
|
22
|
+
import { DropdownMenu as Mt, DropdownMenuItem as ze } from "../dropdown-menu.js";
|
|
23
|
+
import { useShallow as U } from "zustand/react/shallow";
|
|
24
|
+
import { RadioGroup as Ot, RadioGroupItem as zt } from "../radio-group.js";
|
|
25
|
+
import { parse as $t, isValid as Rt, format as Gt, set as Vt, isBefore as Ht, startOfDay as ye } from "date-fns";
|
|
26
|
+
import { Calendar as Bt } from "../calendar.js";
|
|
27
|
+
import '../chunks/filters.DcFdZpNG.css';const jt = "_chip_1pstc_6", qt = "_hover_1pstc_43", Ut = "_active_1pstc_49", se = {
|
|
28
|
+
chip: jt,
|
|
29
|
+
hover: qt,
|
|
30
|
+
active: Ut
|
|
31
|
+
};
|
|
32
|
+
function $e({ active: e, hover: t, className: n }) {
|
|
33
|
+
return W(se.chip, e && se.active, t && se.hover, n);
|
|
34
|
+
}
|
|
35
|
+
function fe({
|
|
36
|
+
active: e,
|
|
37
|
+
hover: t,
|
|
38
|
+
className: n,
|
|
39
|
+
type: r = "button",
|
|
40
|
+
...o
|
|
41
|
+
}) {
|
|
42
|
+
return /* @__PURE__ */ s("button", { type: r, className: $e({ active: e, hover: t, className: n }), ...o });
|
|
43
|
+
}
|
|
44
|
+
function Wt({ active: e, hover: t, className: n, ...r }) {
|
|
45
|
+
return /* @__PURE__ */ s("label", { className: $e({ active: e, hover: t, className: n }), ...r });
|
|
46
|
+
}
|
|
47
|
+
const Xt = 720;
|
|
48
|
+
function Qt(e) {
|
|
49
|
+
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
50
|
+
}
|
|
51
|
+
function Et() {
|
|
52
|
+
return window.innerWidth >= Xt;
|
|
53
|
+
}
|
|
54
|
+
function Jt() {
|
|
55
|
+
return !1;
|
|
56
|
+
}
|
|
57
|
+
function Re() {
|
|
58
|
+
return ut(Qt, Et, Jt);
|
|
59
|
+
}
|
|
60
|
+
const Yt = "_panel_11w9a_6", Zt = {
|
|
61
|
+
panel: Yt
|
|
62
|
+
};
|
|
63
|
+
function en({ onApply: e }) {
|
|
64
|
+
const r = k().getPlugin("filters").useFilterEntities();
|
|
65
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
66
|
+
/* @__PURE__ */ s(mt, { children: /* @__PURE__ */ s(gt, { children: O.filters.allFiltersTitle }) }),
|
|
67
|
+
/* @__PURE__ */ s(yt, { multiple: !0, children: r.map((o) => {
|
|
68
|
+
if (!o.dialogFilterComponent) return null;
|
|
69
|
+
const i = o.dialogFilterComponent;
|
|
70
|
+
return /* @__PURE__ */ s(i, { filterEntity: o }, o.id);
|
|
71
|
+
}) }),
|
|
72
|
+
/* @__PURE__ */ s(St, { children: /* @__PURE__ */ s(ue, { onClick: e, children: O.filters.apply }) })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
function Ie() {
|
|
76
|
+
const t = k().getPlugin("filters"), [n, r] = T(!1), o = Re(), a = t.useFilterEntities().filter((A) => A.dialogFilterComponent).map((A) => A.filterKey), f = t.useActiveCount(a);
|
|
77
|
+
function h() {
|
|
78
|
+
t.resetDraftState(), r(!0);
|
|
79
|
+
}
|
|
80
|
+
function g() {
|
|
81
|
+
r(!1), t.resetDraftState();
|
|
82
|
+
}
|
|
83
|
+
function b() {
|
|
84
|
+
t.applyDraftState(), r(!1);
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
87
|
+
/* @__PURE__ */ w(fe, { hover: n, onClick: h, children: [
|
|
88
|
+
/* @__PURE__ */ s(st, {}),
|
|
89
|
+
O.filters.allFilters,
|
|
90
|
+
f > 0 && /* @__PURE__ */ s(de, { size: "xs", children: f })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ s(vt, { open: n, onOpenChange: (A) => !A && g(), children: /* @__PURE__ */ s(
|
|
93
|
+
Ct,
|
|
94
|
+
{
|
|
95
|
+
side: o ? "right" : "bottom",
|
|
96
|
+
closeLabel: O.filters.closeDialog,
|
|
97
|
+
className: Zt.panel,
|
|
98
|
+
children: /* @__PURE__ */ s(en, { onApply: b })
|
|
99
|
+
}
|
|
100
|
+
) })
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
const tn = "_filterOptions_1pdo1_1", nn = "_tail_1pdo1_16", rn = "_chip_1pdo1_25", ie = {
|
|
104
|
+
filterOptions: tn,
|
|
105
|
+
tail: nn,
|
|
106
|
+
chip: rn
|
|
107
|
+
};
|
|
108
|
+
function on({ filterEntity: e }) {
|
|
109
|
+
if (!e.filterComponent) return null;
|
|
110
|
+
const t = e.filterComponent;
|
|
111
|
+
return /* @__PURE__ */ s(t, { filterEntity: e });
|
|
112
|
+
}
|
|
113
|
+
function sn() {
|
|
114
|
+
const t = k().getPlugin("filters"), n = t.useFilterEntities(), r = t.useIsAllFiltersOptionVisible(), o = n.some((a) => a.dialogFilterComponent), i = n.filter((a) => a.filterComponent), l = r && o;
|
|
115
|
+
return /* @__PURE__ */ w("div", { className: ie.filterOptions, children: [
|
|
116
|
+
i.map((a, f) => {
|
|
117
|
+
const h = f === i.length - 1;
|
|
118
|
+
return /* @__PURE__ */ w("div", { className: h ? ie.tail : ie.chip, children: [
|
|
119
|
+
/* @__PURE__ */ s(on, { filterEntity: a }),
|
|
120
|
+
h && l && /* @__PURE__ */ s(Ie, {})
|
|
121
|
+
] }, a.id);
|
|
122
|
+
}),
|
|
123
|
+
i.length === 0 && l && /* @__PURE__ */ s(Ie, {})
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
const go = rt("filters", (e) => {
|
|
127
|
+
const t = z(() => ({
|
|
128
|
+
entities: [],
|
|
129
|
+
isAllFiltersOptionVisible: !0
|
|
130
|
+
})), n = e.registerPersistentState(
|
|
131
|
+
"filters",
|
|
132
|
+
{
|
|
133
|
+
schema: {}
|
|
134
|
+
}
|
|
135
|
+
), r = z(() => ({
|
|
136
|
+
filters: n.value ?? {}
|
|
137
|
+
})), o = z(() => ({ filters: {} }));
|
|
138
|
+
return p(r, o), e.registerSlot("top-start", {
|
|
139
|
+
id: "filters",
|
|
140
|
+
component: sn
|
|
141
|
+
}), e.hook("load:context", () => {
|
|
142
|
+
const u = m();
|
|
143
|
+
if (Object.keys(u).length !== 0)
|
|
144
|
+
return { filters: u };
|
|
145
|
+
}), e.hook("refresh", (u) => {
|
|
146
|
+
"resetFilters" in u && u.resetFilters && (r.setState({ filters: {} }), o.setState({ filters: {} }), n.setValue(void 0));
|
|
147
|
+
}), r.subscribe(() => {
|
|
148
|
+
const u = r.getState().filters;
|
|
149
|
+
n.setValue(Object.keys(u).length > 0 ? u : void 0);
|
|
150
|
+
}), {
|
|
151
|
+
useFilterEntities: () => t((u) => u.entities),
|
|
152
|
+
useIsAllFiltersOptionVisible: () => t((u) => u.isAllFiltersOptionVisible),
|
|
153
|
+
useState: a,
|
|
154
|
+
useActiveCount: f,
|
|
155
|
+
setState: h,
|
|
156
|
+
removeState: g,
|
|
157
|
+
useDraftState: b,
|
|
158
|
+
setDraftState: A,
|
|
159
|
+
applyDraftState: I,
|
|
160
|
+
resetDraftState: F,
|
|
161
|
+
isFilterValueActive: v,
|
|
162
|
+
onPropsChange: S
|
|
163
|
+
};
|
|
164
|
+
function a(u) {
|
|
165
|
+
return r((N) => N.filters[u]);
|
|
166
|
+
}
|
|
167
|
+
function f(u) {
|
|
168
|
+
return r(
|
|
169
|
+
(N) => u.filter((D) => {
|
|
170
|
+
var L;
|
|
171
|
+
return v((L = N.filters[D]) == null ? void 0 : L.value);
|
|
172
|
+
}).length
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
function h(u, N) {
|
|
176
|
+
C(r, u, N), e.refresh({ resetFilters: !1 }), p(r, o);
|
|
177
|
+
}
|
|
178
|
+
function g(u) {
|
|
179
|
+
r.setState((N) => {
|
|
180
|
+
const D = { ...N.filters };
|
|
181
|
+
return delete D[u], { filters: D };
|
|
182
|
+
}), e.refresh({ resetFilters: !1 }), p(r, o);
|
|
183
|
+
}
|
|
184
|
+
function b(u) {
|
|
185
|
+
return o((N) => N.filters[u]);
|
|
186
|
+
}
|
|
187
|
+
function A(u, N) {
|
|
188
|
+
C(o, u, N);
|
|
189
|
+
}
|
|
190
|
+
function I() {
|
|
191
|
+
const u = o.getState().filters;
|
|
192
|
+
r.setState({ filters: { ...u } }), e.refresh({ resetFilters: !1 });
|
|
193
|
+
}
|
|
194
|
+
function F() {
|
|
195
|
+
p(r, o);
|
|
196
|
+
}
|
|
197
|
+
function m() {
|
|
198
|
+
const { filters: u } = r.getState(), { entities: N } = t.getState(), D = {};
|
|
199
|
+
for (const [L, M] of Object.entries(u))
|
|
200
|
+
if (v(M == null ? void 0 : M.value)) {
|
|
201
|
+
const x = N.find((V) => V.filterKey === L);
|
|
202
|
+
D[L] = x != null && x.resolveLoadValue ? x.resolveLoadValue(M) : M;
|
|
203
|
+
}
|
|
204
|
+
return D;
|
|
205
|
+
}
|
|
206
|
+
function v(u) {
|
|
207
|
+
return u == null || u === "" ? !1 : typeof u == "boolean" ? !0 : Array.isArray(u) ? u.length > 0 : !0;
|
|
208
|
+
}
|
|
209
|
+
function C(u, N, D) {
|
|
210
|
+
u.setState((L) => ({
|
|
211
|
+
filters: { ...L.filters, [N]: D }
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
function p(u, N) {
|
|
215
|
+
N.setState({ filters: { ...u.getState().filters } });
|
|
216
|
+
}
|
|
217
|
+
function S(u) {
|
|
218
|
+
const N = {};
|
|
219
|
+
u.entities !== void 0 && (N.entities = u.entities), u.isAllFiltersOptionVisible !== void 0 && (N.isAllFiltersOptionVisible = u.isAllFiltersOptionVisible), Object.keys(N).length > 0 && t.setState(N);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
const ln = "_content_8lncy_1", cn = {
|
|
223
|
+
content: ln
|
|
224
|
+
};
|
|
225
|
+
function an({ children: e, maxInlineSize: t }) {
|
|
226
|
+
const n = t ? { maxInlineSize: t } : void 0;
|
|
227
|
+
return /* @__PURE__ */ s("div", { className: cn.content, style: n, children: e });
|
|
228
|
+
}
|
|
229
|
+
const un = "_divider_18abl_1", dn = "_resetButton_18abl_9", be = {
|
|
230
|
+
divider: un,
|
|
231
|
+
resetButton: dn
|
|
232
|
+
};
|
|
233
|
+
function fn({ disabled: e, onClick: t }) {
|
|
234
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
235
|
+
/* @__PURE__ */ s("hr", { className: be.divider }),
|
|
236
|
+
/* @__PURE__ */ s("div", { className: be.resetButton, children: /* @__PURE__ */ s(
|
|
237
|
+
ue,
|
|
238
|
+
{
|
|
239
|
+
variant: "ghost",
|
|
240
|
+
size: "sm",
|
|
241
|
+
disabled: e,
|
|
242
|
+
onClick: t,
|
|
243
|
+
icon: /* @__PURE__ */ s(it, {}),
|
|
244
|
+
children: O.filters.reset
|
|
245
|
+
}
|
|
246
|
+
) })
|
|
247
|
+
] });
|
|
248
|
+
}
|
|
249
|
+
const pn = "_popover_bymr3_8", hn = {
|
|
250
|
+
popover: pn
|
|
251
|
+
};
|
|
252
|
+
function mn({
|
|
253
|
+
open: e,
|
|
254
|
+
onOpenChange: t,
|
|
255
|
+
trigger: n,
|
|
256
|
+
minInlineSize: r,
|
|
257
|
+
children: o
|
|
258
|
+
}) {
|
|
259
|
+
return Re() ? /* @__PURE__ */ w(Nt, { open: e, onOpenChange: t, children: [
|
|
260
|
+
/* @__PURE__ */ s(wt, { render: n }),
|
|
261
|
+
/* @__PURE__ */ s(At, { className: hn.popover, children: r != null ? /* @__PURE__ */ s("div", { style: { minInlineSize: r }, children: o }) : o })
|
|
262
|
+
] }) : /* @__PURE__ */ w(xt, { open: e, onOpenChange: t, side: "bottom", children: [
|
|
263
|
+
/* @__PURE__ */ s(Ft, { render: n }),
|
|
264
|
+
/* @__PURE__ */ s(Dt, { children: o })
|
|
265
|
+
] });
|
|
266
|
+
}
|
|
267
|
+
function pe({ filterEntity: e }) {
|
|
268
|
+
const n = ot().table.useConfigurationColumns();
|
|
269
|
+
if (e.label != null)
|
|
270
|
+
return /* @__PURE__ */ s(P, { children: e.label });
|
|
271
|
+
const o = gn(n).find((i) => i.id === e.id);
|
|
272
|
+
if (o == null)
|
|
273
|
+
throw new Error(
|
|
274
|
+
`Label for "${e.id}" is not defined. "id" should match a column id or filter entity should have a label.`
|
|
275
|
+
);
|
|
276
|
+
return /* @__PURE__ */ s(P, { children: o.label });
|
|
277
|
+
}
|
|
278
|
+
function gn(e) {
|
|
279
|
+
const t = [];
|
|
280
|
+
for (const n of e)
|
|
281
|
+
Lt(n) ? t.push(...n.columns) : t.push(n);
|
|
282
|
+
return t;
|
|
283
|
+
}
|
|
284
|
+
const Sn = "_dot_1cz9l_2", vn = {
|
|
285
|
+
dot: Sn
|
|
286
|
+
}, Cn = 140;
|
|
287
|
+
function X({ filterEntity: e, children: t }) {
|
|
288
|
+
var m;
|
|
289
|
+
const r = k().getPlugin("filters"), [o, i] = T(!1), l = r.useState(e.filterKey), a = l == null ? void 0 : l.value, f = !r.isFilterValueActive(a), h = Array.isArray(a) && a.length > 0 ? a.length : void 0, g = (m = e.params) == null ? void 0 : m.popover, b = `${(g == null ? void 0 : g.minInlineSize) ?? Cn}px`, A = (g == null ? void 0 : g.maxInlineSize) != null ? `${g.maxInlineSize}px` : void 0;
|
|
290
|
+
function I() {
|
|
291
|
+
r.removeState(e.filterKey);
|
|
292
|
+
}
|
|
293
|
+
const F = /* @__PURE__ */ w(fe, { hover: o, active: !f, children: [
|
|
294
|
+
/* @__PURE__ */ s(pe, { filterEntity: e }),
|
|
295
|
+
!f && (h != null ? /* @__PURE__ */ s(de, { size: "xs", children: h }) : /* @__PURE__ */ s("span", { className: vn.dot }))
|
|
296
|
+
] });
|
|
297
|
+
return /* @__PURE__ */ s(
|
|
298
|
+
mn,
|
|
299
|
+
{
|
|
300
|
+
open: o,
|
|
301
|
+
onOpenChange: i,
|
|
302
|
+
minInlineSize: b,
|
|
303
|
+
trigger: F,
|
|
304
|
+
children: /* @__PURE__ */ w(an, { maxInlineSize: A, children: [
|
|
305
|
+
t,
|
|
306
|
+
/* @__PURE__ */ s(fn, { disabled: f, onClick: I })
|
|
307
|
+
] })
|
|
308
|
+
}
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
function yn({ filterEntity: e }) {
|
|
312
|
+
var f;
|
|
313
|
+
const n = k().getPlugin("filters"), r = ((f = n.useState(e.filterKey)) == null ? void 0 : f.value) ?? "", [o, i] = T(r);
|
|
314
|
+
$(() => {
|
|
315
|
+
i(r);
|
|
316
|
+
}, [r]);
|
|
317
|
+
const l = Te(
|
|
318
|
+
() => Ke((h) => {
|
|
319
|
+
h ? n.setState(e.filterKey, { value: h }) : n.removeState(e.filterKey);
|
|
320
|
+
}, 1e3),
|
|
321
|
+
[e.filterKey, n]
|
|
322
|
+
);
|
|
323
|
+
$(() => () => l.cancel(), [l]);
|
|
324
|
+
function a(h) {
|
|
325
|
+
i(h), l(h);
|
|
326
|
+
}
|
|
327
|
+
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Me, { value: o, onValueChange: a }) });
|
|
328
|
+
}
|
|
329
|
+
function So(e) {
|
|
330
|
+
return {
|
|
331
|
+
id: e.id,
|
|
332
|
+
filterKey: e.filterKey ?? e.id,
|
|
333
|
+
label: e.label,
|
|
334
|
+
filterComponent: yn
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function In({ filterEntity: e }) {
|
|
338
|
+
const n = k().getPlugin("filters"), r = n.useState(e.filterKey), o = (r == null ? void 0 : r.value) === !0;
|
|
339
|
+
function i() {
|
|
340
|
+
o ? n.removeState(e.filterKey) : n.setState(e.filterKey, { value: !0 });
|
|
341
|
+
}
|
|
342
|
+
return /* @__PURE__ */ s(fe, { active: o, onClick: i, children: /* @__PURE__ */ s(pe, { filterEntity: e }) });
|
|
343
|
+
}
|
|
344
|
+
function vo(e) {
|
|
345
|
+
return {
|
|
346
|
+
id: e.id,
|
|
347
|
+
filterKey: e.filterKey ?? e.id,
|
|
348
|
+
label: e.label,
|
|
349
|
+
filterComponent: In
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const bn = "_header_1kn5i_1", _n = "_actions_1kn5i_10", Nn = "_titleWithActions_1kn5i_18", wn = "_tagClose_1kn5i_23", E = {
|
|
353
|
+
header: bn,
|
|
354
|
+
actions: _n,
|
|
355
|
+
titleWithActions: Nn,
|
|
356
|
+
tagClose: wn
|
|
357
|
+
};
|
|
358
|
+
function ee({ filterEntity: e, children: t }) {
|
|
359
|
+
const r = k().getPlugin("filters"), o = r.useDraftState(e.filterKey), i = An(o == null ? void 0 : o.value, r.isFilterValueActive);
|
|
360
|
+
function l() {
|
|
361
|
+
r.setDraftState(e.filterKey, { value: void 0 });
|
|
362
|
+
}
|
|
363
|
+
return /* @__PURE__ */ w(It, { children: [
|
|
364
|
+
/* @__PURE__ */ w("div", { className: E.header, children: [
|
|
365
|
+
/* @__PURE__ */ s(bt, { children: /* @__PURE__ */ s("span", { className: W(i > 0 && E.titleWithActions), children: /* @__PURE__ */ s(pe, { filterEntity: e }) }) }),
|
|
366
|
+
i > 0 && /* @__PURE__ */ s("span", { className: E.actions, children: /* @__PURE__ */ w(de, { children: [
|
|
367
|
+
i,
|
|
368
|
+
/* @__PURE__ */ s(
|
|
369
|
+
"button",
|
|
370
|
+
{
|
|
371
|
+
type: "button",
|
|
372
|
+
className: E.tagClose,
|
|
373
|
+
"aria-label": O.filters.close,
|
|
374
|
+
onClick: l,
|
|
375
|
+
children: /* @__PURE__ */ s(lt, {})
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
] }) })
|
|
379
|
+
] }),
|
|
380
|
+
/* @__PURE__ */ s(_t, { children: t })
|
|
381
|
+
] });
|
|
382
|
+
}
|
|
383
|
+
function An(e, t) {
|
|
384
|
+
return Array.isArray(e) ? e.length : t(e) ? 1 : 0;
|
|
385
|
+
}
|
|
386
|
+
function te(e) {
|
|
387
|
+
return Array.isArray(e) ? e : [];
|
|
388
|
+
}
|
|
389
|
+
const xn = "_sizeXl_1h36k_8", _e = {
|
|
390
|
+
default: "_default_1h36k_1",
|
|
391
|
+
sizeXl: xn
|
|
392
|
+
}, Fn = {
|
|
393
|
+
m: _e.default,
|
|
394
|
+
xl: _e.sizeXl
|
|
395
|
+
};
|
|
396
|
+
function ne({ children: e, size: t = "m" }) {
|
|
397
|
+
return /* @__PURE__ */ s("div", { className: Fn[t], children: e });
|
|
398
|
+
}
|
|
399
|
+
function re({
|
|
400
|
+
value: e,
|
|
401
|
+
onValueChange: t,
|
|
402
|
+
placeholder: n,
|
|
403
|
+
autoFocus: r,
|
|
404
|
+
disabled: o
|
|
405
|
+
}) {
|
|
406
|
+
return /* @__PURE__ */ s(
|
|
407
|
+
Me,
|
|
408
|
+
{
|
|
409
|
+
value: e,
|
|
410
|
+
placeholder: n ?? O.filters.searchPlaceholder,
|
|
411
|
+
icon: /* @__PURE__ */ s(ct, {}),
|
|
412
|
+
onValueChange: t,
|
|
413
|
+
autoFocus: r,
|
|
414
|
+
disabled: o
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
const Dn = "_wrapper_1gwyh_1", Ln = {
|
|
419
|
+
wrapper: Dn
|
|
420
|
+
};
|
|
421
|
+
function oe({ children: e, role: t }) {
|
|
422
|
+
return /* @__PURE__ */ s("div", { className: Ln.wrapper, role: t, children: e });
|
|
423
|
+
}
|
|
424
|
+
const kn = 300;
|
|
425
|
+
function Tn(e, t = kn) {
|
|
426
|
+
const [n, r] = T(""), [o, i] = T([]), [l, a] = T(!0), f = Pe(0);
|
|
427
|
+
return $(() => {
|
|
428
|
+
const h = f.current + 1;
|
|
429
|
+
f.current = h, a(!0);
|
|
430
|
+
const g = setTimeout(() => {
|
|
431
|
+
e(n.trim()).then((b) => {
|
|
432
|
+
h === f.current && i(b);
|
|
433
|
+
}).catch(() => {
|
|
434
|
+
h === f.current && i([]);
|
|
435
|
+
}).finally(() => {
|
|
436
|
+
h === f.current && a(!1);
|
|
437
|
+
});
|
|
438
|
+
}, t);
|
|
439
|
+
return () => clearTimeout(g);
|
|
440
|
+
}, [n, e, t]), { searchTerm: n, setSearchTerm: r, options: o, isLoading: l };
|
|
441
|
+
}
|
|
442
|
+
function Pn(e) {
|
|
443
|
+
return typeof e == "string" ? e : typeof e == "number" ? String(e) : "";
|
|
444
|
+
}
|
|
445
|
+
function Kn(e, t) {
|
|
446
|
+
return typeof t == "function" ? t(e) : String(e[t] || "");
|
|
447
|
+
}
|
|
448
|
+
function Ge(e, t) {
|
|
449
|
+
const [n, r] = T("");
|
|
450
|
+
let o = e;
|
|
451
|
+
if (t && n.trim()) {
|
|
452
|
+
const i = n.toLowerCase();
|
|
453
|
+
o = e.filter((l) => Pn(l.label).toLowerCase().includes(i));
|
|
454
|
+
}
|
|
455
|
+
return {
|
|
456
|
+
searchTerm: n,
|
|
457
|
+
setSearchTerm: r,
|
|
458
|
+
filteredOptions: o
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
const Mn = "_list_1thlr_1", On = "_listItem_1thlr_13", zn = "_status_1thlr_18", Z = {
|
|
462
|
+
list: Mn,
|
|
463
|
+
listItem: On,
|
|
464
|
+
status: zn
|
|
465
|
+
};
|
|
466
|
+
function $n(e, t, n) {
|
|
467
|
+
return n ? [...e, t] : e.filter((r) => r !== t);
|
|
468
|
+
}
|
|
469
|
+
function Ve({
|
|
470
|
+
options: e,
|
|
471
|
+
value: t,
|
|
472
|
+
onChange: n
|
|
473
|
+
}) {
|
|
474
|
+
return /* @__PURE__ */ s("ul", { className: Z.list, children: e.map((r) => /* @__PURE__ */ s("li", { className: Z.listItem, children: /* @__PURE__ */ w(Oe, { children: [
|
|
475
|
+
/* @__PURE__ */ s(
|
|
476
|
+
Tt,
|
|
477
|
+
{
|
|
478
|
+
checked: t.includes(r.value),
|
|
479
|
+
onCheckedChange: (o) => n($n(t, r.value, o))
|
|
480
|
+
}
|
|
481
|
+
),
|
|
482
|
+
r.component ? /* @__PURE__ */ s(r.component, { option: r }) : /* @__PURE__ */ s(P, { children: r.label })
|
|
483
|
+
] }) }, r.value)) });
|
|
484
|
+
}
|
|
485
|
+
function Rn({
|
|
486
|
+
options: e,
|
|
487
|
+
showSearch: t,
|
|
488
|
+
value: n,
|
|
489
|
+
onChange: r,
|
|
490
|
+
searchSize: o
|
|
491
|
+
}) {
|
|
492
|
+
const { searchTerm: i, setSearchTerm: l, filteredOptions: a } = Ge(e, t);
|
|
493
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
494
|
+
t && /* @__PURE__ */ s(ne, { size: o, children: /* @__PURE__ */ s(re, { value: i, onValueChange: l }) }),
|
|
495
|
+
/* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s(Ve, { options: a, value: n, onChange: r }) })
|
|
496
|
+
] });
|
|
497
|
+
}
|
|
498
|
+
function Gn({
|
|
499
|
+
searchOptions: e,
|
|
500
|
+
searchDebounce: t,
|
|
501
|
+
value: n,
|
|
502
|
+
onChange: r,
|
|
503
|
+
searchSize: o
|
|
504
|
+
}) {
|
|
505
|
+
const { searchTerm: i, setSearchTerm: l, options: a, isLoading: f } = Tn(
|
|
506
|
+
e,
|
|
507
|
+
t
|
|
508
|
+
), h = f && a.length === 0;
|
|
509
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
510
|
+
/* @__PURE__ */ s(ne, { size: o, children: /* @__PURE__ */ s(re, { value: i, onValueChange: l }) }),
|
|
511
|
+
/* @__PURE__ */ s(oe, { children: h ? /* @__PURE__ */ s("div", { className: Z.status, children: /* @__PURE__ */ s(kt, {}) }) : a.length > 0 ? /* @__PURE__ */ s(Ve, { options: a, value: n, onChange: r }) : /* @__PURE__ */ s("div", { className: Z.status, children: O.filters.noOptionsFound }) })
|
|
512
|
+
] });
|
|
513
|
+
}
|
|
514
|
+
function He({ filterEntity: e, ...t }) {
|
|
515
|
+
const { options: n, search: r, searchDebounce: o } = e.params;
|
|
516
|
+
return typeof n == "function" ? /* @__PURE__ */ s(Gn, { searchOptions: n, searchDebounce: o, ...t }) : /* @__PURE__ */ s(Rn, { options: n, showSearch: r ?? !1, ...t });
|
|
517
|
+
}
|
|
518
|
+
function Vn({ filterEntity: e }) {
|
|
519
|
+
const n = k().getPlugin("filters"), r = n.useDraftState(e.filterKey), o = te(r == null ? void 0 : r.value);
|
|
520
|
+
function i(l) {
|
|
521
|
+
n.setDraftState(e.filterKey, { value: l });
|
|
522
|
+
}
|
|
523
|
+
return /* @__PURE__ */ s(ee, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
524
|
+
He,
|
|
525
|
+
{
|
|
526
|
+
filterEntity: e,
|
|
527
|
+
value: o,
|
|
528
|
+
onChange: i,
|
|
529
|
+
searchSize: "xl"
|
|
530
|
+
}
|
|
531
|
+
) });
|
|
532
|
+
}
|
|
533
|
+
function Hn({ filterEntity: e }) {
|
|
534
|
+
const n = k().getPlugin("filters"), r = n.useState(e.filterKey), o = te(r == null ? void 0 : r.value);
|
|
535
|
+
function i(l) {
|
|
536
|
+
l.length > 0 ? n.setState(e.filterKey, { value: l }) : n.removeState(e.filterKey);
|
|
537
|
+
}
|
|
538
|
+
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
539
|
+
He,
|
|
540
|
+
{
|
|
541
|
+
filterEntity: e,
|
|
542
|
+
value: o,
|
|
543
|
+
onChange: i,
|
|
544
|
+
searchSize: "m"
|
|
545
|
+
}
|
|
546
|
+
) });
|
|
547
|
+
}
|
|
548
|
+
function Co(e) {
|
|
549
|
+
const { options: t } = e;
|
|
550
|
+
return {
|
|
551
|
+
id: e.id,
|
|
552
|
+
filterKey: e.filterKey ?? e.id,
|
|
553
|
+
label: e.label,
|
|
554
|
+
filterComponent: Hn,
|
|
555
|
+
dialogFilterComponent: Vn,
|
|
556
|
+
params: {
|
|
557
|
+
options: t,
|
|
558
|
+
get search() {
|
|
559
|
+
return e.search ?? (typeof t == "function" || t.length > 5);
|
|
560
|
+
},
|
|
561
|
+
searchDebounce: e.searchDebounce,
|
|
562
|
+
popover: e.popover
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
const Bn = "_options_9wsap_1", jn = "_hiddenInput_9wsap_10", Ne = {
|
|
567
|
+
options: Bn,
|
|
568
|
+
hiddenInput: jn
|
|
569
|
+
};
|
|
570
|
+
function Be({ filterEntity: e, value: t, onChange: n, searchSize: r }) {
|
|
571
|
+
const o = dt(), { options: i, mode: l = "checkbox", search: a } = e.params, { searchTerm: f, setSearchTerm: h, filteredOptions: g } = Ge(
|
|
572
|
+
i,
|
|
573
|
+
a ?? !1
|
|
574
|
+
);
|
|
575
|
+
function b(I) {
|
|
576
|
+
return t.includes(I);
|
|
577
|
+
}
|
|
578
|
+
function A(I) {
|
|
579
|
+
l === "radio" ? n([I]) : b(I) ? n(t.filter((F) => F !== I)) : n([...t, I]);
|
|
580
|
+
}
|
|
581
|
+
return /* @__PURE__ */ w("div", { children: [
|
|
582
|
+
a && /* @__PURE__ */ s(ne, { size: r, children: /* @__PURE__ */ s(re, { value: f, onValueChange: h }) }),
|
|
583
|
+
/* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s("div", { className: Ne.options, children: g.map((I) => /* @__PURE__ */ w(Wt, { active: b(I.value), children: [
|
|
584
|
+
I.component ? /* @__PURE__ */ s(I.component, { option: I }) : /* @__PURE__ */ s(P, { children: I.label }),
|
|
585
|
+
/* @__PURE__ */ s(
|
|
586
|
+
"input",
|
|
587
|
+
{
|
|
588
|
+
type: l === "radio" ? "radio" : "checkbox",
|
|
589
|
+
name: o,
|
|
590
|
+
value: String(I.value),
|
|
591
|
+
checked: b(I.value),
|
|
592
|
+
onChange: () => A(I.value),
|
|
593
|
+
className: Ne.hiddenInput
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
] }, String(I.value))) }) })
|
|
597
|
+
] });
|
|
598
|
+
}
|
|
599
|
+
function qn({ filterEntity: e }) {
|
|
600
|
+
const n = k().getPlugin("filters"), r = n.useDraftState(e.filterKey), o = te(r == null ? void 0 : r.value);
|
|
601
|
+
function i(l) {
|
|
602
|
+
n.setDraftState(e.filterKey, { value: l });
|
|
603
|
+
}
|
|
604
|
+
return /* @__PURE__ */ s(ee, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
605
|
+
Be,
|
|
606
|
+
{
|
|
607
|
+
filterEntity: e,
|
|
608
|
+
value: o,
|
|
609
|
+
onChange: i,
|
|
610
|
+
searchSize: "xl"
|
|
611
|
+
}
|
|
612
|
+
) });
|
|
613
|
+
}
|
|
614
|
+
function Un({ filterEntity: e }) {
|
|
615
|
+
const n = k().getPlugin("filters"), r = n.useState(e.filterKey), o = te(r == null ? void 0 : r.value);
|
|
616
|
+
function i(l) {
|
|
617
|
+
l.length > 0 ? n.setState(e.filterKey, { value: l }) : n.removeState(e.filterKey);
|
|
618
|
+
}
|
|
619
|
+
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
620
|
+
Be,
|
|
621
|
+
{
|
|
622
|
+
filterEntity: e,
|
|
623
|
+
value: o,
|
|
624
|
+
onChange: i,
|
|
625
|
+
searchSize: "m"
|
|
626
|
+
}
|
|
627
|
+
) });
|
|
628
|
+
}
|
|
629
|
+
function yo(e) {
|
|
630
|
+
return {
|
|
631
|
+
id: e.id,
|
|
632
|
+
filterKey: e.filterKey ?? e.id,
|
|
633
|
+
label: e.label,
|
|
634
|
+
filterComponent: Un,
|
|
635
|
+
dialogFilterComponent: qn,
|
|
636
|
+
params: {
|
|
637
|
+
options: e.options,
|
|
638
|
+
mode: e.mode ?? "checkbox",
|
|
639
|
+
get search() {
|
|
640
|
+
return e.search ?? e.options.length > 10;
|
|
641
|
+
},
|
|
642
|
+
popover: e.popover
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
function Wn(e, t, n) {
|
|
647
|
+
if (!n)
|
|
648
|
+
return t;
|
|
649
|
+
const r = e.getNode(t);
|
|
650
|
+
if (!r)
|
|
651
|
+
return t;
|
|
652
|
+
if (typeof n == "function")
|
|
653
|
+
return n(r.item);
|
|
654
|
+
const o = r.item[n];
|
|
655
|
+
return typeof o == "string" || typeof o == "number" ? o : t;
|
|
656
|
+
}
|
|
657
|
+
const he = Symbol("tree-internal-context"), je = ft(null), Xn = je.Provider;
|
|
658
|
+
function qe() {
|
|
659
|
+
const e = pt(je);
|
|
660
|
+
if (!e)
|
|
661
|
+
throw new Error("useTree must be used within TreeProvider");
|
|
662
|
+
return e;
|
|
663
|
+
}
|
|
664
|
+
function Qn() {
|
|
665
|
+
return K().plugins.pluginContext;
|
|
666
|
+
}
|
|
667
|
+
function K() {
|
|
668
|
+
return qe()[he];
|
|
669
|
+
}
|
|
670
|
+
function j({
|
|
671
|
+
name: e,
|
|
672
|
+
...t
|
|
673
|
+
}) {
|
|
674
|
+
const { layout: n } = K(), r = n.useSlots(e);
|
|
675
|
+
return r.length === 0 ? null : /* @__PURE__ */ s(P, { children: r.map((o) => {
|
|
676
|
+
const i = o.component;
|
|
677
|
+
return /* @__PURE__ */ s(i, { ...t }, o.id);
|
|
678
|
+
}) });
|
|
679
|
+
}
|
|
680
|
+
const En = "_treeMain_ayh6i_8", Jn = {
|
|
681
|
+
treeMain: En
|
|
682
|
+
};
|
|
683
|
+
function Ue({
|
|
684
|
+
node: e
|
|
685
|
+
}) {
|
|
686
|
+
var a;
|
|
687
|
+
const { settings: t, layout: n } = K(), o = (a = n.useSlots("label")[0]) == null ? void 0 : a.component, i = l();
|
|
688
|
+
if (o)
|
|
689
|
+
return /* @__PURE__ */ s(o, { item: e.item, label: i });
|
|
690
|
+
function l() {
|
|
691
|
+
return t.label ? typeof t.label == "string" ? String(e.item[t.label]) : t.label(e.item) : String(e.item.id);
|
|
692
|
+
}
|
|
693
|
+
return /* @__PURE__ */ s("span", { children: i });
|
|
694
|
+
}
|
|
695
|
+
const Yn = "_icon_1r7q3_1", Zn = "_iconExpanded_1r7q3_6", we = {
|
|
696
|
+
icon: Yn,
|
|
697
|
+
iconExpanded: Zn
|
|
698
|
+
};
|
|
699
|
+
function er({
|
|
700
|
+
node: e
|
|
701
|
+
}) {
|
|
702
|
+
const { settings: t, layout: n } = K(), r = n.useComponent("directory"), o = n.useLayoutStore((m) => m.expandedIds.has(e.id)), l = n.useSlots("icon").length > 0, f = n.useSlots("left").length > 0, h = g();
|
|
703
|
+
function g() {
|
|
704
|
+
if (!f)
|
|
705
|
+
return !1;
|
|
706
|
+
const { showInlineStart: m } = t;
|
|
707
|
+
return !m || m === "leaf" ? !1 : m === "directory" ? !0 : m(e.item);
|
|
708
|
+
}
|
|
709
|
+
function b() {
|
|
710
|
+
n.toggleExpanded(e.id);
|
|
711
|
+
}
|
|
712
|
+
const A = o ? O.tree.collapse : O.tree.expand, I = l ? /* @__PURE__ */ s(j, { name: "icon", item: e.item, expanded: o }) : /* @__PURE__ */ s("span", { className: o ? we.iconExpanded : we.icon, children: /* @__PURE__ */ s(at, {}) }), F = /* @__PURE__ */ w(P, { children: [
|
|
713
|
+
/* @__PURE__ */ s(
|
|
714
|
+
ue,
|
|
715
|
+
{
|
|
716
|
+
variant: "ghost",
|
|
717
|
+
size: "sm",
|
|
718
|
+
render: /* @__PURE__ */ s("span", {}),
|
|
719
|
+
nativeButton: !1,
|
|
720
|
+
"data-tree-node-click-ignore": !0,
|
|
721
|
+
tabIndex: -1,
|
|
722
|
+
onClick: b,
|
|
723
|
+
"aria-expanded": o,
|
|
724
|
+
"aria-label": A,
|
|
725
|
+
icon: I
|
|
726
|
+
}
|
|
727
|
+
),
|
|
728
|
+
h && /* @__PURE__ */ s(j, { name: "left", item: e.item, node: e })
|
|
729
|
+
] });
|
|
730
|
+
return (
|
|
731
|
+
// eslint-disable-next-line react-hooks/static-components -- DirectoryComponent comes from the tree's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
732
|
+
/* @__PURE__ */ s(r, { node: e, leftSlot: F, children: /* @__PURE__ */ s(Ue, { node: e }) })
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
function tr({
|
|
736
|
+
node: e
|
|
737
|
+
}) {
|
|
738
|
+
const { settings: t, layout: n } = K(), r = n.useComponent("leaf"), i = n.useSlots("left").length > 0, l = a();
|
|
739
|
+
function a() {
|
|
740
|
+
const { showInlineStart: f } = t;
|
|
741
|
+
return !f || f === "leaf" ? !0 : f === "directory" ? !1 : f(e.item);
|
|
742
|
+
}
|
|
743
|
+
return (
|
|
744
|
+
// eslint-disable-next-line react-hooks/static-components -- LeafComponent comes from the tree's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
745
|
+
/* @__PURE__ */ s(
|
|
746
|
+
r,
|
|
747
|
+
{
|
|
748
|
+
node: e,
|
|
749
|
+
leftSlot: i && l ? /* @__PURE__ */ s(j, { name: "left", item: e.item, node: e }) : void 0,
|
|
750
|
+
children: /* @__PURE__ */ s(Ue, { node: e })
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
);
|
|
754
|
+
}
|
|
755
|
+
const nr = "_treeNodeDirectory_ugt7q_1", rr = "_treeNodeDirectoryChildren_ugt7q_10", Ae = {
|
|
756
|
+
treeNodeDirectory: nr,
|
|
757
|
+
treeNodeDirectoryChildren: rr
|
|
758
|
+
};
|
|
759
|
+
function We({
|
|
760
|
+
nodes: e
|
|
761
|
+
}) {
|
|
762
|
+
const { layout: t } = K(), n = t.useLayoutStore((o) => o.filter), r = n ? e.filter((o) => n(o.item)) : e;
|
|
763
|
+
return /* @__PURE__ */ s(P, { children: r.map((o) => /* @__PURE__ */ s(or, { node: o }, o.id)) });
|
|
764
|
+
}
|
|
765
|
+
function or({
|
|
766
|
+
node: e
|
|
767
|
+
}) {
|
|
768
|
+
return e.isLeaf ? /* @__PURE__ */ s(tr, { node: e }) : /* @__PURE__ */ s(sr, { node: e });
|
|
769
|
+
}
|
|
770
|
+
function sr({
|
|
771
|
+
node: e
|
|
772
|
+
}) {
|
|
773
|
+
const { settings: t, layout: n } = K(), r = n.useComponent("placeholder"), o = n.useLayoutStore((g) => g.expandedIds.has(e.id)), i = t.treeStructure.current.useChildren(e.id), l = f(), a = h();
|
|
774
|
+
function f() {
|
|
775
|
+
return {
|
|
776
|
+
node: e,
|
|
777
|
+
item: e.item
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
function h() {
|
|
781
|
+
var b;
|
|
782
|
+
const g = (b = t.showDirectoryBottom) == null ? void 0 : b.call(t, e.item, l);
|
|
783
|
+
return g === "when_expanded" ? o : g !== !1;
|
|
784
|
+
}
|
|
785
|
+
return /* @__PURE__ */ w("div", { className: Ae.treeNodeDirectory, children: [
|
|
786
|
+
/* @__PURE__ */ s(er, { node: e }),
|
|
787
|
+
o && /* @__PURE__ */ s("div", { className: Ae.treeNodeDirectoryChildren, children: i.length > 0 ? /* @__PURE__ */ s(We, { nodes: i }) : (
|
|
788
|
+
// eslint-disable-next-line react-hooks/static-components -- PlaceholderComponent comes from the tree's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
789
|
+
/* @__PURE__ */ s(r, { parent: e.item })
|
|
790
|
+
) }),
|
|
791
|
+
a && /* @__PURE__ */ s(j, { name: "directory-bottom", node: e })
|
|
792
|
+
] });
|
|
793
|
+
}
|
|
794
|
+
function ir() {
|
|
795
|
+
const { settings: e, layout: t, focus: n } = K(), r = e.treeStructure.current.useRootNodes(), o = t.useComponent("placeholder");
|
|
796
|
+
return /* @__PURE__ */ w(
|
|
797
|
+
"div",
|
|
798
|
+
{
|
|
799
|
+
className: Jn.treeMain,
|
|
800
|
+
role: "tree",
|
|
801
|
+
"aria-label": e.ariaLabel,
|
|
802
|
+
"aria-labelledby": e.ariaLabelledBy,
|
|
803
|
+
onKeyDown: n.handleKeyDown,
|
|
804
|
+
children: [
|
|
805
|
+
/* @__PURE__ */ s(Mt, { open: !0, modal: !1, children: r.length > 0 ? /* @__PURE__ */ s(We, { nodes: r }) : (
|
|
806
|
+
// eslint-disable-next-line react-hooks/static-components -- PlaceholderComponent comes from the tree's component registry (a store lookup), so it is the same component on every render; the rule cannot see through the lookup.
|
|
807
|
+
/* @__PURE__ */ s(o, { parent: null })
|
|
808
|
+
) }),
|
|
809
|
+
/* @__PURE__ */ s(j, { name: "bottom" })
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
function lr() {
|
|
815
|
+
const e = qe(), t = e.treeStructure.current;
|
|
816
|
+
return $(() => (e.init(), () => e.destroy()), [e]), t ? /* @__PURE__ */ s(ir, {}) : null;
|
|
817
|
+
}
|
|
818
|
+
function le(e, t) {
|
|
819
|
+
const n = [];
|
|
820
|
+
return r(e.getRootNodes()), n;
|
|
821
|
+
function r(o) {
|
|
822
|
+
for (const i of o)
|
|
823
|
+
n.push(i), !i.isLeaf && t.has(i.id) && r(i.children);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
function cr(e, t) {
|
|
827
|
+
const n = e.findIndex((r) => r.id === t);
|
|
828
|
+
return n === -1 || n === e.length - 1 ? null : e[n + 1];
|
|
829
|
+
}
|
|
830
|
+
function ar(e, t) {
|
|
831
|
+
const n = e.findIndex((r) => r.id === t);
|
|
832
|
+
return n <= 0 ? null : e[n - 1];
|
|
833
|
+
}
|
|
834
|
+
function ur(e) {
|
|
835
|
+
const { layout: t, settings: n } = e, r = z()(() => ({
|
|
836
|
+
focusedNodeId: null
|
|
837
|
+
})), o = {
|
|
838
|
+
setFocusedNode: i,
|
|
839
|
+
focusNode: l
|
|
840
|
+
};
|
|
841
|
+
return e.plugins.registerPublicApi(o), {
|
|
842
|
+
...o,
|
|
843
|
+
useFocusStore: r,
|
|
844
|
+
handleKeyDown: a
|
|
845
|
+
};
|
|
846
|
+
function i(v) {
|
|
847
|
+
r.setState({ focusedNodeId: v });
|
|
848
|
+
}
|
|
849
|
+
function l(v) {
|
|
850
|
+
i(v);
|
|
851
|
+
}
|
|
852
|
+
function a(v) {
|
|
853
|
+
const { focusedNodeId: C } = r.getState();
|
|
854
|
+
if (!C) return;
|
|
855
|
+
const { key: p } = v;
|
|
856
|
+
let S = !1;
|
|
857
|
+
p === "ArrowDown" ? S = f() : p === "ArrowUp" ? S = h() : p === "ArrowRight" ? S = g() : p === "ArrowLeft" ? S = b() : p === "Home" ? S = A() : p === "End" ? S = I() : p === "Enter" && (S = F()), S && v.preventDefault();
|
|
858
|
+
}
|
|
859
|
+
function f() {
|
|
860
|
+
const { treeStructure: v, expandedIds: C, focusedNodeId: p } = m();
|
|
861
|
+
if (!p) return !1;
|
|
862
|
+
const S = le(v, C), u = cr(S, p);
|
|
863
|
+
return u ? (i(u.id), !0) : !1;
|
|
864
|
+
}
|
|
865
|
+
function h() {
|
|
866
|
+
const { treeStructure: v, expandedIds: C, focusedNodeId: p } = m();
|
|
867
|
+
if (!p) return !1;
|
|
868
|
+
const S = le(v, C), u = ar(S, p);
|
|
869
|
+
return u ? (i(u.id), !0) : !1;
|
|
870
|
+
}
|
|
871
|
+
function g() {
|
|
872
|
+
const { treeStructure: v, expandedIds: C, focusedNodeId: p } = m();
|
|
873
|
+
if (!p) return !1;
|
|
874
|
+
const S = v.getNode(p);
|
|
875
|
+
if (!S || S.isLeaf)
|
|
876
|
+
return !1;
|
|
877
|
+
if (!C.has(p))
|
|
878
|
+
return t.toggleExpanded(p, !0), !0;
|
|
879
|
+
const u = S.children[0];
|
|
880
|
+
return u ? (i(u.id), !0) : !1;
|
|
881
|
+
}
|
|
882
|
+
function b() {
|
|
883
|
+
const { treeStructure: v, expandedIds: C, focusedNodeId: p } = m();
|
|
884
|
+
if (!p) return !1;
|
|
885
|
+
const S = v.getNode(p);
|
|
886
|
+
return S ? !S.isLeaf && C.has(p) ? (t.toggleExpanded(p, !1), !0) : S.parent ? (i(S.parent.id), !0) : !1 : !1;
|
|
887
|
+
}
|
|
888
|
+
function A() {
|
|
889
|
+
const { treeStructure: v } = m(), C = v.getRootNodes()[0];
|
|
890
|
+
return C ? (i(C.id), !0) : !1;
|
|
891
|
+
}
|
|
892
|
+
function I() {
|
|
893
|
+
const { treeStructure: v, expandedIds: C } = m(), p = le(v, C), S = p[p.length - 1];
|
|
894
|
+
return S ? (i(S.id), !0) : !1;
|
|
895
|
+
}
|
|
896
|
+
function F() {
|
|
897
|
+
const { treeStructure: v, focusedNodeId: C } = m();
|
|
898
|
+
if (!C) return !1;
|
|
899
|
+
const p = v.getNode(C);
|
|
900
|
+
return p ? n.click ? (n.click({ id: p.id, item: p.item }), !0) : p.isLeaf ? !1 : (t.toggleExpanded(C), !0) : !1;
|
|
901
|
+
}
|
|
902
|
+
function m() {
|
|
903
|
+
const v = n.treeStructure.current, { expandedIds: C } = t.useLayoutStore.getState(), { focusedNodeId: p } = r.getState();
|
|
904
|
+
return { treeStructure: v, expandedIds: C, focusedNodeId: p };
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
function dr() {
|
|
908
|
+
const e = Pt();
|
|
909
|
+
return {
|
|
910
|
+
hook: e.hook,
|
|
911
|
+
callHook: e.callHook,
|
|
912
|
+
callHookParallel: e.callHookParallel,
|
|
913
|
+
callHookSync: e.callHookSync
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function ce(e) {
|
|
917
|
+
const t = [];
|
|
918
|
+
let n;
|
|
919
|
+
return {
|
|
920
|
+
registerComponent: o,
|
|
921
|
+
getStackedComponent: r
|
|
922
|
+
};
|
|
923
|
+
function r() {
|
|
924
|
+
return n ?? (n = t.reduceRight((i, l) => (a) => Ce(l, a, Ce(i, a)), e)), n;
|
|
925
|
+
}
|
|
926
|
+
function o(i) {
|
|
927
|
+
t.unshift(i), n = void 0;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
const fr = "_treeActions_m77gm_1", pr = "_treeActionsAlways_m77gm_6", hr = "_treeActionsHover_m77gm_12", ae = {
|
|
931
|
+
treeActions: fr,
|
|
932
|
+
treeActionsAlways: pr,
|
|
933
|
+
treeActionsHover: hr
|
|
934
|
+
};
|
|
935
|
+
function mr({
|
|
936
|
+
node: e
|
|
937
|
+
}) {
|
|
938
|
+
const { settings: t } = K(), n = o(), r = i();
|
|
939
|
+
if (r === !1)
|
|
940
|
+
return null;
|
|
941
|
+
function o() {
|
|
942
|
+
return {
|
|
943
|
+
node: e,
|
|
944
|
+
item: e.item
|
|
945
|
+
};
|
|
946
|
+
}
|
|
947
|
+
function i() {
|
|
948
|
+
var a;
|
|
949
|
+
return ((a = t.showActions) == null ? void 0 : a.call(t, e.item, n)) ?? "when_hover";
|
|
950
|
+
}
|
|
951
|
+
return /* @__PURE__ */ s(
|
|
952
|
+
"div",
|
|
953
|
+
{
|
|
954
|
+
className: W(
|
|
955
|
+
ae.treeActions,
|
|
956
|
+
r === !0 ? ae.treeActionsAlways : ae.treeActionsHover
|
|
957
|
+
),
|
|
958
|
+
"data-tree-node-click-ignore": !0,
|
|
959
|
+
children: /* @__PURE__ */ s(j, { name: "actions", item: e.item })
|
|
960
|
+
}
|
|
961
|
+
);
|
|
962
|
+
}
|
|
963
|
+
const gr = "_treeLeftSlot_88822_1", Sr = {
|
|
964
|
+
treeLeftSlot: gr
|
|
965
|
+
};
|
|
966
|
+
function Xe({ children: e }) {
|
|
967
|
+
return /* @__PURE__ */ s("div", { className: Sr.treeLeftSlot, children: e });
|
|
968
|
+
}
|
|
969
|
+
const vr = "_treeListItem_euazv_9", Cr = "_leaf_euazv_23", yr = "_label_euazv_44", Ir = "_ellipsis_euazv_49", J = {
|
|
970
|
+
treeListItem: vr,
|
|
971
|
+
leaf: Cr,
|
|
972
|
+
label: yr,
|
|
973
|
+
ellipsis: Ir
|
|
974
|
+
};
|
|
975
|
+
function xe({
|
|
976
|
+
node: e,
|
|
977
|
+
children: t,
|
|
978
|
+
className: n,
|
|
979
|
+
leftSlot: r
|
|
980
|
+
}) {
|
|
981
|
+
var M;
|
|
982
|
+
const { settings: o, layout: i, focus: l } = K(), a = Pe(null), f = i.useLayoutStore((x) => x.activeIds.has(e.id)), h = i.useLayoutStore((x) => x.activeIds), g = l.useFocusStore((x) => x.focusedNodeId), b = i.useLayoutStore((x) => x.expandedIds.has(e.id)), A = i.useLayoutStore(
|
|
983
|
+
(x) => {
|
|
984
|
+
var V;
|
|
985
|
+
return (((V = x.slots.get("actions")) == null ? void 0 : V.length) ?? 0) > 0;
|
|
986
|
+
}
|
|
987
|
+
), I = o.treeStructure.current, F = I.getLevel(e.id), m = I.getSiblingCount(e.id), v = I.getSiblingPosition(e.id), C = e.id === ((M = I.getRootNodes()[0]) == null ? void 0 : M.id), p = g === e.id, S = L(), u = o.ellipsis ?? !0;
|
|
988
|
+
$(() => {
|
|
989
|
+
p && a.current && document.activeElement !== a.current && a.current.focus();
|
|
990
|
+
}, [p]);
|
|
991
|
+
function N(x) {
|
|
992
|
+
o.click && (x.target instanceof Element && x.target.closest("[data-tree-node-click-ignore]") || o.click({ id: e.id, item: e.item }));
|
|
993
|
+
}
|
|
994
|
+
function D() {
|
|
995
|
+
l.setFocusedNode(e.id);
|
|
996
|
+
}
|
|
997
|
+
function L() {
|
|
998
|
+
if (g !== null)
|
|
999
|
+
return p ? 0 : -1;
|
|
1000
|
+
if (o.initialFocusedNodeId !== void 0)
|
|
1001
|
+
return e.id === o.initialFocusedNodeId ? 0 : -1;
|
|
1002
|
+
if (h.size > 0) {
|
|
1003
|
+
const x = Array.from(h)[0];
|
|
1004
|
+
return e.id === x ? 0 : -1;
|
|
1005
|
+
}
|
|
1006
|
+
return C ? 0 : -1;
|
|
1007
|
+
}
|
|
1008
|
+
return /* @__PURE__ */ w(
|
|
1009
|
+
ze,
|
|
1010
|
+
{
|
|
1011
|
+
ref: a,
|
|
1012
|
+
role: "treeitem",
|
|
1013
|
+
tabIndex: S,
|
|
1014
|
+
onClick: o.click ? N : void 0,
|
|
1015
|
+
onFocus: D,
|
|
1016
|
+
"aria-selected": f,
|
|
1017
|
+
"aria-expanded": e.isLeaf ? void 0 : b,
|
|
1018
|
+
"aria-level": F,
|
|
1019
|
+
"aria-setsize": m,
|
|
1020
|
+
"aria-posinset": v,
|
|
1021
|
+
"data-active": f || void 0,
|
|
1022
|
+
className: W(J.treeListItem, e.isLeaf && J.leaf, n),
|
|
1023
|
+
children: [
|
|
1024
|
+
r && /* @__PURE__ */ s(Xe, { children: r }),
|
|
1025
|
+
/* @__PURE__ */ s("span", { className: W(J.label, u && J.ellipsis), children: t }),
|
|
1026
|
+
A && /* @__PURE__ */ s(mr, { node: e })
|
|
1027
|
+
]
|
|
1028
|
+
}
|
|
1029
|
+
);
|
|
1030
|
+
}
|
|
1031
|
+
const br = "_treePlaceholder_13ekq_6", _r = {
|
|
1032
|
+
treePlaceholder: br
|
|
1033
|
+
};
|
|
1034
|
+
function Nr({
|
|
1035
|
+
parent: e
|
|
1036
|
+
}) {
|
|
1037
|
+
var o;
|
|
1038
|
+
const { layout: t } = K(), r = (o = t.useSlots("placeholder")[0]) == null ? void 0 : o.component;
|
|
1039
|
+
return /* @__PURE__ */ w(ze, { disabled: !0, className: _r.treePlaceholder, children: [
|
|
1040
|
+
/* @__PURE__ */ s(Xe, {}),
|
|
1041
|
+
r ? /* @__PURE__ */ s(r, { parent: e }) : O.tree.noItems
|
|
1042
|
+
] });
|
|
1043
|
+
}
|
|
1044
|
+
function wr(e) {
|
|
1045
|
+
const t = [], n = z()(() => ({
|
|
1046
|
+
slots: /* @__PURE__ */ new Map(),
|
|
1047
|
+
expandedIds: /* @__PURE__ */ new Set(),
|
|
1048
|
+
activeIds: /* @__PURE__ */ new Set()
|
|
1049
|
+
})), r = z(() => ({
|
|
1050
|
+
leaf: ce(xe),
|
|
1051
|
+
directory: ce(xe),
|
|
1052
|
+
placeholder: ce(Nr)
|
|
1053
|
+
})), o = {
|
|
1054
|
+
registerSlot: f,
|
|
1055
|
+
registerComponent: F,
|
|
1056
|
+
toggleExpanded: g,
|
|
1057
|
+
toggleActive: b,
|
|
1058
|
+
clearActive: A,
|
|
1059
|
+
setFilter: I
|
|
1060
|
+
};
|
|
1061
|
+
return e.plugins.registerPublicApi(o), {
|
|
1062
|
+
...o,
|
|
1063
|
+
useLayoutStore: n,
|
|
1064
|
+
useSlots: l,
|
|
1065
|
+
useComponent: a
|
|
1066
|
+
};
|
|
1067
|
+
function i(m) {
|
|
1068
|
+
return n.getState().slots.get(m) ?? t;
|
|
1069
|
+
}
|
|
1070
|
+
function l(m) {
|
|
1071
|
+
return n(
|
|
1072
|
+
U(
|
|
1073
|
+
(v) => v.slots.get(m) ?? t
|
|
1074
|
+
)
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
function a(m) {
|
|
1078
|
+
return r(() => r.getState()[m].getStackedComponent());
|
|
1079
|
+
}
|
|
1080
|
+
function f(m, v) {
|
|
1081
|
+
const C = Math.random().toString(), p = i(m), S = (p.length + 1) * 10, u = { id: C, name: m, ...v, order: S }, N = [...p, u];
|
|
1082
|
+
return n.setState((D) => {
|
|
1083
|
+
const L = new Map(D.slots);
|
|
1084
|
+
return L.set(m, N), { slots: L };
|
|
1085
|
+
}), () => h(m, C);
|
|
1086
|
+
}
|
|
1087
|
+
function h(m, v) {
|
|
1088
|
+
const C = i(m);
|
|
1089
|
+
if (!C.length) return;
|
|
1090
|
+
const p = C.filter((S) => S.id !== v);
|
|
1091
|
+
n.setState((S) => {
|
|
1092
|
+
const u = new Map(S.slots);
|
|
1093
|
+
return p.length ? u.set(m, p) : u.delete(m), { slots: u };
|
|
1094
|
+
});
|
|
1095
|
+
}
|
|
1096
|
+
function g(m, v) {
|
|
1097
|
+
n.setState((C) => {
|
|
1098
|
+
const p = C.expandedIds.has(m), S = v ?? !p, u = new Set(C.expandedIds);
|
|
1099
|
+
return S !== p && (S ? u.add(m) : u.delete(m)), { expandedIds: u };
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
function b(m, v) {
|
|
1103
|
+
n.setState((C) => {
|
|
1104
|
+
const p = C.activeIds.has(m), S = v ?? !p, u = new Set(C.activeIds);
|
|
1105
|
+
return S !== p && (S ? u.add(m) : u.delete(m)), { activeIds: u };
|
|
1106
|
+
});
|
|
1107
|
+
}
|
|
1108
|
+
function A() {
|
|
1109
|
+
n.setState({ activeIds: /* @__PURE__ */ new Set() });
|
|
1110
|
+
}
|
|
1111
|
+
function I(m) {
|
|
1112
|
+
n.setState({
|
|
1113
|
+
filter: m
|
|
1114
|
+
});
|
|
1115
|
+
}
|
|
1116
|
+
function F(m, v) {
|
|
1117
|
+
r.getState()[m].registerComponent(v);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
function Ar(e) {
|
|
1121
|
+
const t = /* @__PURE__ */ new Map(), n = {
|
|
1122
|
+
hook: e.hooked.hook,
|
|
1123
|
+
getPlugin: a
|
|
1124
|
+
}, r = { ...n };
|
|
1125
|
+
return {
|
|
1126
|
+
...n,
|
|
1127
|
+
registerPlugin: i,
|
|
1128
|
+
registerPlugins: l,
|
|
1129
|
+
registerPublicApi: o,
|
|
1130
|
+
pluginContext: r
|
|
1131
|
+
};
|
|
1132
|
+
function o(f) {
|
|
1133
|
+
Object.assign(r, f);
|
|
1134
|
+
}
|
|
1135
|
+
function i(f) {
|
|
1136
|
+
if (t.has(f.name)) {
|
|
1137
|
+
console.warn(
|
|
1138
|
+
`[DataGridTree] Plugin "${f.name}" is already registered — skipping duplicate registration.`
|
|
1139
|
+
);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
const h = f.setup(r);
|
|
1143
|
+
h !== void 0 && t.set(f.name, h);
|
|
1144
|
+
}
|
|
1145
|
+
function l(f) {
|
|
1146
|
+
f.forEach((h) => i(h));
|
|
1147
|
+
}
|
|
1148
|
+
function a(f) {
|
|
1149
|
+
return t.get(f);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
function xr(e, t) {
|
|
1153
|
+
const n = {
|
|
1154
|
+
...t
|
|
1155
|
+
}, r = {
|
|
1156
|
+
settings: n,
|
|
1157
|
+
treeStructure: t.treeStructure
|
|
1158
|
+
};
|
|
1159
|
+
return e.plugins.registerPublicApi(r), n;
|
|
1160
|
+
}
|
|
1161
|
+
function Fr(e) {
|
|
1162
|
+
const t = dr(), n = {}, r = {
|
|
1163
|
+
hooked: t,
|
|
1164
|
+
get plugins() {
|
|
1165
|
+
return Y(n.plugins, "plugins");
|
|
1166
|
+
},
|
|
1167
|
+
get layout() {
|
|
1168
|
+
return Y(n.layout, "layout");
|
|
1169
|
+
},
|
|
1170
|
+
get settings() {
|
|
1171
|
+
return Y(n.settings, "settings");
|
|
1172
|
+
},
|
|
1173
|
+
get focus() {
|
|
1174
|
+
return Y(n.focus, "focus");
|
|
1175
|
+
}
|
|
1176
|
+
};
|
|
1177
|
+
return n.plugins = Ar(r), n.settings = xr(r, e), n.layout = wr(r), n.focus = ur(r), {
|
|
1178
|
+
init: i,
|
|
1179
|
+
destroy: o,
|
|
1180
|
+
...r.plugins.pluginContext,
|
|
1181
|
+
[he]: r
|
|
1182
|
+
};
|
|
1183
|
+
function o() {
|
|
1184
|
+
t.callHookSync("destroy");
|
|
1185
|
+
}
|
|
1186
|
+
async function i() {
|
|
1187
|
+
await t.callHook("init");
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
function Y(e, t) {
|
|
1191
|
+
if (e === void 0)
|
|
1192
|
+
throw new Error(`[DataGridTree] The ${t} service was used before it was created.`);
|
|
1193
|
+
return e;
|
|
1194
|
+
}
|
|
1195
|
+
function Dr({
|
|
1196
|
+
name: e,
|
|
1197
|
+
treeStructure: t,
|
|
1198
|
+
children: n,
|
|
1199
|
+
...r
|
|
1200
|
+
}) {
|
|
1201
|
+
const o = Kt(t), [i] = T(
|
|
1202
|
+
() => Fr({
|
|
1203
|
+
...r,
|
|
1204
|
+
name: e,
|
|
1205
|
+
treeStructure: o
|
|
1206
|
+
})
|
|
1207
|
+
);
|
|
1208
|
+
return $(() => {
|
|
1209
|
+
i[he].layout.setFilter(r.filter);
|
|
1210
|
+
}, [i, r.filter]), /* @__PURE__ */ w(Xn, { value: i, children: [
|
|
1211
|
+
n,
|
|
1212
|
+
/* @__PURE__ */ s(lr, {})
|
|
1213
|
+
] });
|
|
1214
|
+
}
|
|
1215
|
+
function Lr(e, t, n) {
|
|
1216
|
+
return ht(function(o) {
|
|
1217
|
+
const i = K(), [l] = T(() => {
|
|
1218
|
+
const a = t(i.plugins.pluginContext);
|
|
1219
|
+
return i.plugins.registerPlugin({
|
|
1220
|
+
name: e,
|
|
1221
|
+
setup: () => a
|
|
1222
|
+
}), a;
|
|
1223
|
+
});
|
|
1224
|
+
return $(() => {
|
|
1225
|
+
var a;
|
|
1226
|
+
(a = l.onPropsChange) == null || a.call(l, o);
|
|
1227
|
+
}, [l, o]), null;
|
|
1228
|
+
}, n);
|
|
1229
|
+
}
|
|
1230
|
+
const kr = "_radioGroup_1l2s1_7", Tr = "_text_1l2s1_14", Fe = {
|
|
1231
|
+
radioGroup: kr,
|
|
1232
|
+
text: Tr
|
|
1233
|
+
}, De = "selected";
|
|
1234
|
+
function Pr({
|
|
1235
|
+
item: e,
|
|
1236
|
+
label: t
|
|
1237
|
+
}) {
|
|
1238
|
+
const r = Qn().getPlugin("radioSelect"), o = e.id, l = r.useSelectedId() === o;
|
|
1239
|
+
function a() {
|
|
1240
|
+
(typeof o == "string" || typeof o == "number") && r.select(o);
|
|
1241
|
+
}
|
|
1242
|
+
return /* @__PURE__ */ w(Oe, { children: [
|
|
1243
|
+
/* @__PURE__ */ s(
|
|
1244
|
+
Ot,
|
|
1245
|
+
{
|
|
1246
|
+
className: Fe.radioGroup,
|
|
1247
|
+
value: l ? De : "",
|
|
1248
|
+
onValueChange: a,
|
|
1249
|
+
children: /* @__PURE__ */ s(zt, { value: De, "data-tree-node-click-ignore": "" })
|
|
1250
|
+
}
|
|
1251
|
+
),
|
|
1252
|
+
/* @__PURE__ */ s("span", { className: Fe.text, children: t })
|
|
1253
|
+
] });
|
|
1254
|
+
}
|
|
1255
|
+
const Kr = Lr("radioSelect", (e) => {
|
|
1256
|
+
let t = {};
|
|
1257
|
+
const n = z(() => ({
|
|
1258
|
+
selectedId: void 0
|
|
1259
|
+
}));
|
|
1260
|
+
return e.registerSlot("label", {
|
|
1261
|
+
component: Pr
|
|
1262
|
+
}), {
|
|
1263
|
+
useSelectedId: () => n((l) => l.selectedId),
|
|
1264
|
+
select: i,
|
|
1265
|
+
onPropsChange: o
|
|
1266
|
+
};
|
|
1267
|
+
function o(l) {
|
|
1268
|
+
t = l, l.value !== void 0 && n.setState({ selectedId: l.value });
|
|
1269
|
+
}
|
|
1270
|
+
function i(l) {
|
|
1271
|
+
var a;
|
|
1272
|
+
n.setState({ selectedId: l }), (a = t.onChange) == null || a.call(t, l);
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
function Mr(e, t) {
|
|
1276
|
+
const [n, r] = T(""), [o, i] = T(""), l = Te(
|
|
1277
|
+
() => Ke((h) => i(h), 300),
|
|
1278
|
+
[]
|
|
1279
|
+
);
|
|
1280
|
+
$(() => (l(n), () => l.cancel()), [n, l]);
|
|
1281
|
+
let a = null;
|
|
1282
|
+
if (o.trim()) {
|
|
1283
|
+
const h = o.toLowerCase(), g = /* @__PURE__ */ new Set();
|
|
1284
|
+
e.forEach((b) => {
|
|
1285
|
+
t(b.item).toLowerCase().includes(h) && g.add(b.id);
|
|
1286
|
+
}), a = g;
|
|
1287
|
+
}
|
|
1288
|
+
function f(h) {
|
|
1289
|
+
if (!a) return !0;
|
|
1290
|
+
const g = h.id;
|
|
1291
|
+
if (typeof g != "string" && typeof g != "number") return !1;
|
|
1292
|
+
if (a.has(g)) return !0;
|
|
1293
|
+
for (const b of a)
|
|
1294
|
+
if (e.isDescendantOf(b, g) || e.isDescendantOf(g, b))
|
|
1295
|
+
return !0;
|
|
1296
|
+
return !1;
|
|
1297
|
+
}
|
|
1298
|
+
return {
|
|
1299
|
+
searchTerm: n,
|
|
1300
|
+
setSearchTerm: r,
|
|
1301
|
+
matchingItemIds: a,
|
|
1302
|
+
filter: f
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
function Qe({ filterEntity: e, value: t, onChange: n, searchSize: r }) {
|
|
1306
|
+
const { tree: o, treeLabel: i, search: l } = e.params, a = (b) => Kn(b, i), { searchTerm: f, setSearchTerm: h, filter: g } = Mr(o, a);
|
|
1307
|
+
return /* @__PURE__ */ w(P, { children: [
|
|
1308
|
+
l && /* @__PURE__ */ s(ne, { size: r, children: /* @__PURE__ */ s(re, { value: f, onValueChange: h }) }),
|
|
1309
|
+
/* @__PURE__ */ s(oe, { children: /* @__PURE__ */ s(
|
|
1310
|
+
Dr,
|
|
1311
|
+
{
|
|
1312
|
+
name: `filter-tree-${e.filterKey}`,
|
|
1313
|
+
treeStructure: o,
|
|
1314
|
+
label: i,
|
|
1315
|
+
ellipsis: !1,
|
|
1316
|
+
filter: g,
|
|
1317
|
+
children: /* @__PURE__ */ s(Kr, { value: t, onChange: n, name: e.filterKey })
|
|
1318
|
+
}
|
|
1319
|
+
) })
|
|
1320
|
+
] });
|
|
1321
|
+
}
|
|
1322
|
+
function Or({ filterEntity: e }) {
|
|
1323
|
+
const n = k().getPlugin("filters"), r = n.useDraftState(e.filterKey), o = r == null ? void 0 : r.value;
|
|
1324
|
+
function i(l) {
|
|
1325
|
+
n.setDraftState(e.filterKey, { value: l });
|
|
1326
|
+
}
|
|
1327
|
+
return /* @__PURE__ */ s(ee, { filterEntity: e, children: /* @__PURE__ */ s(Qe, { filterEntity: e, value: o, onChange: i, searchSize: "xl" }) });
|
|
1328
|
+
}
|
|
1329
|
+
function zr({ filterEntity: e }) {
|
|
1330
|
+
const n = k().getPlugin("filters"), r = n.useState(e.filterKey), o = r == null ? void 0 : r.value;
|
|
1331
|
+
function i(l) {
|
|
1332
|
+
n.setState(e.filterKey, { value: l });
|
|
1333
|
+
}
|
|
1334
|
+
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(Qe, { filterEntity: e, value: o, onChange: i, searchSize: "m" }) });
|
|
1335
|
+
}
|
|
1336
|
+
function Io(e) {
|
|
1337
|
+
return {
|
|
1338
|
+
id: e.id,
|
|
1339
|
+
filterKey: e.filterKey ?? e.id,
|
|
1340
|
+
label: e.label,
|
|
1341
|
+
filterComponent: zr,
|
|
1342
|
+
dialogFilterComponent: Or,
|
|
1343
|
+
params: {
|
|
1344
|
+
tree: e.tree,
|
|
1345
|
+
treeLabel: e.treeLabel,
|
|
1346
|
+
get search() {
|
|
1347
|
+
return e.search ?? e.tree.getNodes().length > 5;
|
|
1348
|
+
},
|
|
1349
|
+
popover: e.popover
|
|
1350
|
+
},
|
|
1351
|
+
resolveLoadValue: e.filterValue ? (t) => ({
|
|
1352
|
+
value: Wn(e.tree, t.value, e.filterValue)
|
|
1353
|
+
}) : void 0
|
|
1354
|
+
};
|
|
1355
|
+
}
|
|
1356
|
+
const $r = "yyyy-MM-dd";
|
|
1357
|
+
function Ee(e) {
|
|
1358
|
+
return !e.from && !e.to;
|
|
1359
|
+
}
|
|
1360
|
+
function Le(e, t) {
|
|
1361
|
+
if (typeof e != "string" || e === "") return null;
|
|
1362
|
+
const n = $t(e, t, /* @__PURE__ */ new Date());
|
|
1363
|
+
return Rt(n) ? n : null;
|
|
1364
|
+
}
|
|
1365
|
+
function ke(e, t) {
|
|
1366
|
+
return Gt(Vt(e, { hours: 12, minutes: 0, seconds: 0 }), t);
|
|
1367
|
+
}
|
|
1368
|
+
function Rr({ from: e, to: t }, n) {
|
|
1369
|
+
return !e || t ? { from: n, to: null } : Ht(ye(n), ye(e)) ? { from: n, to: e } : { from: e, to: n };
|
|
1370
|
+
}
|
|
1371
|
+
const Gr = 1;
|
|
1372
|
+
function Je({ value: e, onChange: t, modelDateFormat: n }) {
|
|
1373
|
+
const r = n ?? $r, o = Le(e.from, r), i = Le(e.to, r), [l, a] = T(() => o ?? /* @__PURE__ */ new Date());
|
|
1374
|
+
function f(h) {
|
|
1375
|
+
const g = Rr({ from: o, to: i }, h);
|
|
1376
|
+
t({
|
|
1377
|
+
from: g.from ? ke(g.from, r) : void 0,
|
|
1378
|
+
to: g.to ? ke(g.to, r) : void 0
|
|
1379
|
+
});
|
|
1380
|
+
}
|
|
1381
|
+
return /* @__PURE__ */ s(
|
|
1382
|
+
Bt,
|
|
1383
|
+
{
|
|
1384
|
+
mode: "range",
|
|
1385
|
+
selected: o ? { from: o, to: i ?? void 0 } : void 0,
|
|
1386
|
+
month: l,
|
|
1387
|
+
onMonthChange: a,
|
|
1388
|
+
onSelect: (h, g) => f(g),
|
|
1389
|
+
weekStartsOn: Gr
|
|
1390
|
+
}
|
|
1391
|
+
);
|
|
1392
|
+
}
|
|
1393
|
+
function Vr({ filterEntity: e }) {
|
|
1394
|
+
const n = k().getPlugin("filters"), r = n.useDraftState(e.filterKey), o = (r == null ? void 0 : r.value) ?? {};
|
|
1395
|
+
function i(l) {
|
|
1396
|
+
n.setDraftState(e.filterKey, {
|
|
1397
|
+
value: Ee(l) ? void 0 : l
|
|
1398
|
+
});
|
|
1399
|
+
}
|
|
1400
|
+
return /* @__PURE__ */ s(ee, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
1401
|
+
Je,
|
|
1402
|
+
{
|
|
1403
|
+
value: o,
|
|
1404
|
+
onChange: i,
|
|
1405
|
+
modelDateFormat: e.params.modelDateFormat
|
|
1406
|
+
}
|
|
1407
|
+
) });
|
|
1408
|
+
}
|
|
1409
|
+
function Hr({ filterEntity: e }) {
|
|
1410
|
+
const n = k().getPlugin("filters"), r = n.useState(e.filterKey), o = (r == null ? void 0 : r.value) ?? {};
|
|
1411
|
+
function i(l) {
|
|
1412
|
+
Ee(l) ? n.removeState(e.filterKey) : n.setState(e.filterKey, { value: l });
|
|
1413
|
+
}
|
|
1414
|
+
return /* @__PURE__ */ s(X, { filterEntity: e, children: /* @__PURE__ */ s(
|
|
1415
|
+
Je,
|
|
1416
|
+
{
|
|
1417
|
+
value: o,
|
|
1418
|
+
onChange: i,
|
|
1419
|
+
modelDateFormat: e.params.modelDateFormat
|
|
1420
|
+
}
|
|
1421
|
+
) });
|
|
1422
|
+
}
|
|
1423
|
+
function bo(e) {
|
|
1424
|
+
return {
|
|
1425
|
+
id: e.id,
|
|
1426
|
+
filterKey: e.filterKey ?? e.id,
|
|
1427
|
+
label: e.label,
|
|
1428
|
+
filterComponent: Hr,
|
|
1429
|
+
dialogFilterComponent: Vr,
|
|
1430
|
+
params: {
|
|
1431
|
+
modelDateFormat: e.modelDateFormat,
|
|
1432
|
+
// Passed straight through, like every sibling entity: the popover's
|
|
1433
|
+
// `min-inline-size` is a floor and the popup is shrink-to-fit, so the calendar's
|
|
1434
|
+
// own 272px minimum already sizes the popover.
|
|
1435
|
+
popover: e.popover
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
function Br(e) {
|
|
1440
|
+
const t = z(() => ({
|
|
1441
|
+
nodeMap: /* @__PURE__ */ new Map(),
|
|
1442
|
+
childrenMap: /* @__PURE__ */ new Map()
|
|
1443
|
+
}));
|
|
1444
|
+
return e.items && N(e.items), {
|
|
1445
|
+
setItems: N,
|
|
1446
|
+
move: u,
|
|
1447
|
+
forEach: tt,
|
|
1448
|
+
eachNode: ve,
|
|
1449
|
+
getNode: C,
|
|
1450
|
+
getChildren: H,
|
|
1451
|
+
getRootNodes: F,
|
|
1452
|
+
getNodes: m,
|
|
1453
|
+
getLevel: Se,
|
|
1454
|
+
getSiblingCount: Ze,
|
|
1455
|
+
getSiblingPosition: et,
|
|
1456
|
+
isDescendantOf: S,
|
|
1457
|
+
useRootNodes: () => t(U(() => F())),
|
|
1458
|
+
useNodes: () => t(U(() => m())),
|
|
1459
|
+
useNodesCount: () => t(() => v()),
|
|
1460
|
+
useNode: (c) => t(() => C(c)),
|
|
1461
|
+
useHasNode: (c) => t(() => me(c)),
|
|
1462
|
+
useChildren: (c) => t(U(() => H(c))),
|
|
1463
|
+
useNodePath: (c) => t(U(() => ge(c))),
|
|
1464
|
+
useNodeLevel: (c) => t(() => Se(c)),
|
|
1465
|
+
useNodeIndex: (c) => t(() => Ye(c)),
|
|
1466
|
+
useIsLeaf: (c) => t(() => p(c)),
|
|
1467
|
+
useIsDescendantOf: (c, d) => t(() => S(c, d))
|
|
1468
|
+
};
|
|
1469
|
+
function F() {
|
|
1470
|
+
return H(null);
|
|
1471
|
+
}
|
|
1472
|
+
function m() {
|
|
1473
|
+
const { nodeMap: c } = t.getState();
|
|
1474
|
+
return Array.from(c.values());
|
|
1475
|
+
}
|
|
1476
|
+
function v() {
|
|
1477
|
+
const { nodeMap: c } = t.getState();
|
|
1478
|
+
return c.size;
|
|
1479
|
+
}
|
|
1480
|
+
function C(c) {
|
|
1481
|
+
const { nodeMap: d } = t.getState();
|
|
1482
|
+
return d.get(c);
|
|
1483
|
+
}
|
|
1484
|
+
function p(c) {
|
|
1485
|
+
return q(c).isLeaf;
|
|
1486
|
+
}
|
|
1487
|
+
function S(c, d) {
|
|
1488
|
+
if (!me(c)) return !1;
|
|
1489
|
+
let y = q(c);
|
|
1490
|
+
for (; y.parentId !== null; ) {
|
|
1491
|
+
if (y.parentId === d)
|
|
1492
|
+
return !0;
|
|
1493
|
+
y = q(y.parentId);
|
|
1494
|
+
}
|
|
1495
|
+
return !1;
|
|
1496
|
+
}
|
|
1497
|
+
function u(c) {
|
|
1498
|
+
const d = t.getState(), y = d.nodeMap.get(c.id);
|
|
1499
|
+
if (!y)
|
|
1500
|
+
throw new Error(`Node with id "${c.id}" not found`);
|
|
1501
|
+
if (c.parentId !== null && (c.parentId === c.id || S(c.parentId, c.id)))
|
|
1502
|
+
throw new Error(`Node with id "${c.id}" cannot move under itself or its descendant "${c.parentId}"`);
|
|
1503
|
+
const _ = new Map(d.childrenMap), B = _.get(y.parentId);
|
|
1504
|
+
if (B) {
|
|
1505
|
+
const Q = B.filter((nt) => nt.id !== c.id);
|
|
1506
|
+
_.set(y.parentId, Q);
|
|
1507
|
+
}
|
|
1508
|
+
const R = [..._.get(c.parentId) ?? []], G = c.position ?? R.length;
|
|
1509
|
+
y.parentId = c.parentId, y.parent = c.parentId === null ? null : d.nodeMap.get(c.parentId) ?? null, R.splice(G, 0, y), _.set(c.parentId, R);
|
|
1510
|
+
for (const Q of d.nodeMap.values())
|
|
1511
|
+
Q.children = _.get(Q.id) ?? [];
|
|
1512
|
+
t.setState({
|
|
1513
|
+
nodeMap: new Map(d.nodeMap),
|
|
1514
|
+
childrenMap: _
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1517
|
+
function N(c) {
|
|
1518
|
+
const d = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
|
|
1519
|
+
if (e.childrenKey)
|
|
1520
|
+
for (const [_, B, R] of D(c)) {
|
|
1521
|
+
const G = L(_, B, R);
|
|
1522
|
+
d.set(G.id, G);
|
|
1523
|
+
}
|
|
1524
|
+
else
|
|
1525
|
+
for (const _ of c) {
|
|
1526
|
+
const B = M(_), R = V(_), G = L(B, R, _);
|
|
1527
|
+
d.set(G.id, G);
|
|
1528
|
+
}
|
|
1529
|
+
for (const _ of d.values())
|
|
1530
|
+
y.set(_.parentId, [...y.get(_.parentId) ?? [], _]);
|
|
1531
|
+
for (const _ of d.values())
|
|
1532
|
+
_.parent = _.parentId === null ? null : d.get(_.parentId) ?? null, _.children = y.get(_.id) ?? [];
|
|
1533
|
+
t.setState({
|
|
1534
|
+
nodeMap: d,
|
|
1535
|
+
childrenMap: y
|
|
1536
|
+
});
|
|
1537
|
+
}
|
|
1538
|
+
function* D(c, d = null) {
|
|
1539
|
+
for (const y of c) {
|
|
1540
|
+
const _ = M(y);
|
|
1541
|
+
yield [_, d, y], yield* D(x(y), _);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
function L(c, d, y) {
|
|
1545
|
+
return {
|
|
1546
|
+
id: c,
|
|
1547
|
+
item: y,
|
|
1548
|
+
parentId: d,
|
|
1549
|
+
isLeaf: e.isLeaf ? e.isLeaf(y) : !1,
|
|
1550
|
+
parent: null,
|
|
1551
|
+
// Will be set later
|
|
1552
|
+
children: []
|
|
1553
|
+
// Will be set later
|
|
1554
|
+
};
|
|
1555
|
+
}
|
|
1556
|
+
function M(c) {
|
|
1557
|
+
const { itemKey: d = "id" } = e;
|
|
1558
|
+
if (typeof d == "function")
|
|
1559
|
+
return d(c);
|
|
1560
|
+
if (!(d in c))
|
|
1561
|
+
throw new Error(`Key "${d}" not found in item ${JSON.stringify(c)}`);
|
|
1562
|
+
return c[d];
|
|
1563
|
+
}
|
|
1564
|
+
function x(c) {
|
|
1565
|
+
return e.childrenKey ? typeof e.childrenKey == "function" ? (e.childrenKey(c) ?? []).filter((d) => d != null) : (c[e.childrenKey] ?? []).filter((d) => d != null) : [];
|
|
1566
|
+
}
|
|
1567
|
+
function V(c) {
|
|
1568
|
+
const { parentKey: d = "parent_id" } = e;
|
|
1569
|
+
return typeof d == "function" ? d(c) ?? null : d == null ? null : c[d] ?? null;
|
|
1570
|
+
}
|
|
1571
|
+
function me(c) {
|
|
1572
|
+
const { nodeMap: d } = t.getState();
|
|
1573
|
+
return d.has(c);
|
|
1574
|
+
}
|
|
1575
|
+
function q(c) {
|
|
1576
|
+
const { nodeMap: d } = t.getState(), y = d.get(c);
|
|
1577
|
+
if (!y)
|
|
1578
|
+
throw new Error(`Node with id "${c}" not found`);
|
|
1579
|
+
return y;
|
|
1580
|
+
}
|
|
1581
|
+
function Ye(c) {
|
|
1582
|
+
const d = q(c);
|
|
1583
|
+
return H(d.parentId).findIndex((y) => y.id === c);
|
|
1584
|
+
}
|
|
1585
|
+
function ge(c) {
|
|
1586
|
+
const d = q(c), y = [];
|
|
1587
|
+
let _ = d;
|
|
1588
|
+
for (; _; )
|
|
1589
|
+
y.unshift(_), _ = _.parent;
|
|
1590
|
+
return y;
|
|
1591
|
+
}
|
|
1592
|
+
function Se(c) {
|
|
1593
|
+
return ge(c).length;
|
|
1594
|
+
}
|
|
1595
|
+
function Ze(c) {
|
|
1596
|
+
const d = C(c);
|
|
1597
|
+
return d ? H(d.parentId).length : 1;
|
|
1598
|
+
}
|
|
1599
|
+
function et(c) {
|
|
1600
|
+
const d = C(c);
|
|
1601
|
+
return d ? H(d.parentId).findIndex((y) => y.id === c) + 1 : 1;
|
|
1602
|
+
}
|
|
1603
|
+
function H(c) {
|
|
1604
|
+
const { childrenMap: d } = t.getState();
|
|
1605
|
+
return d.get(c) ?? [];
|
|
1606
|
+
}
|
|
1607
|
+
function tt(c) {
|
|
1608
|
+
for (const d of ve())
|
|
1609
|
+
c(d);
|
|
1610
|
+
}
|
|
1611
|
+
function* ve() {
|
|
1612
|
+
const c = [...F()].reverse();
|
|
1613
|
+
for (; c.length > 0; ) {
|
|
1614
|
+
const d = c.pop();
|
|
1615
|
+
yield d, c.push(...[...d.children].reverse());
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
function _o(e) {
|
|
1620
|
+
const [t] = T(() => Br(e));
|
|
1621
|
+
return t;
|
|
1622
|
+
}
|
|
1623
|
+
export {
|
|
1624
|
+
go as DataGridFiltersPlugin,
|
|
1625
|
+
Br as createDataGridTreeStructure,
|
|
1626
|
+
Co as filterCheckboxGroup,
|
|
1627
|
+
bo as filterDateRange,
|
|
1628
|
+
So as filterSearch,
|
|
1629
|
+
yo as filterTagGroup,
|
|
1630
|
+
vo as filterToggle,
|
|
1631
|
+
Io as filterTree,
|
|
1632
|
+
_o as useDataGridTreeStructure
|
|
1633
|
+
};
|
|
1634
|
+
//# sourceMappingURL=filters.js.map
|