viewkitjs 0.28.0 → 0.30.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/CHANGELOG.md +218 -0
- package/MIGRATION.md +181 -11
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.d.ts +2 -2
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -12
- package/views/dist/contract.d.ts +161 -18
- package/views/dist/contract.js +170 -28
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +8 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +176 -0
- package/views/dist/controls/customize/customize.js +348 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +15 -0
- package/views/dist/controls/customize/map-customize-body.js +195 -0
- package/views/dist/controls/customize/map-ranges.d.ts +23 -0
- package/views/dist/controls/customize/map-ranges.js +41 -0
- package/views/dist/controls/customize/rules.d.ts +39 -0
- package/views/dist/controls/customize/rules.js +21 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +65 -0
- package/views/dist/controls/customize/words.js +42 -0
- package/views/dist/controls/customize.css +57 -0
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +4 -0
- package/views/dist/controls/filter-editor/filter-editor.js +86 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +42 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +33 -9
- package/views/dist/controls/index.js +32 -9
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +16 -1
- package/views/dist/controls/menu-list/menu-list.js +26 -8
- package/views/dist/controls/menu-list.css +8 -0
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +59 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/map-text-body.d.ts +1 -1
- package/views/dist/controls/text-editor/map-text-body.js +2 -2
- package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
- package/views/dist/controls/text-editor/text-editor.js +17 -7
- package/views/dist/controls/text-editor.css +11 -0
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/values-editor/values.js +6 -2
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/options.d.ts +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/rich-text.js +0 -1
- package/views/dist/editors/ChipsEditor.d.ts +4 -5
- package/views/dist/editors/ChipsEditor.js +12 -78
- package/views/dist/editors/DateEditor.d.ts +12 -16
- package/views/dist/editors/DateEditor.js +40 -191
- package/views/dist/editors/EditorPanel.d.ts +2 -6
- package/views/dist/editors/EditorPanel.js +2 -2
- package/views/dist/editors/LocationEditor.d.ts +11 -19
- package/views/dist/editors/LocationEditor.js +19 -211
- package/views/dist/editors/NameEditor.d.ts +8 -16
- package/views/dist/editors/NameEditor.js +11 -100
- package/views/dist/editors/NumberEditor.d.ts +14 -21
- package/views/dist/editors/NumberEditor.js +22 -49
- package/views/dist/editors/RangeEditor.d.ts +9 -33
- package/views/dist/editors/RangeEditor.js +12 -97
- package/views/dist/editors/RelationEditor.d.ts +6 -9
- package/views/dist/editors/RelationEditor.js +11 -30
- package/views/dist/editors/RelationSetEditor.d.ts +13 -24
- package/views/dist/editors/RelationSetEditor.js +33 -101
- package/views/dist/editors/SelectEditor.d.ts +15 -17
- package/views/dist/editors/SelectEditor.js +15 -94
- package/views/dist/editors/TextEditor.d.ts +23 -26
- package/views/dist/editors/TextEditor.js +11 -48
- package/views/dist/editors/ValueListEditor.d.ts +14 -23
- package/views/dist/editors/ValueListEditor.js +16 -202
- package/views/dist/editors/body-panel.d.ts +13 -7
- package/views/dist/editors/body-panel.js +3 -7
- package/views/dist/editors/edit-cores.d.ts +15 -15
- package/views/dist/editors/edit-cores.js +14 -14
- package/views/dist/editors/number-body.d.ts +1 -1
- package/views/dist/editors/number-step.d.ts +0 -34
- package/views/dist/editors/number-step.js +0 -37
- package/views/dist/editors/option-add-flow.d.ts +1 -13
- package/views/dist/editors/option-add-flow.js +0 -22
- package/views/dist/editors/relation-links-body.d.ts +2 -3
- package/views/dist/editors/relation-picker.d.ts +13 -3
- package/views/dist/editors/relation-source.d.ts +0 -22
- package/views/dist/editors/relation-source.js +0 -21
- package/views/dist/field-row/FieldRow.js +5 -6
- package/views/dist/field-row/FieldRowLane.js +0 -1
- package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
- package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
- package/views/dist/field-row/editors/RowDateEditor.js +2 -2
- package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowNameEditor.js +7 -12
- package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
- package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
- package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
- package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
- package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
- package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowTextEditor.js +3 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
- package/views/dist/field-row/field-row-button.d.ts +6 -9
- package/views/dist/field-row/field-row-button.js +1 -6
- package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
- package/views/dist/field-row/row-target.d.ts +0 -7
- package/views/dist/field-row/row-target.js +0 -2
- package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
- package/views/dist/grid/chrome/GridAddColumn.js +8 -66
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
- package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
- package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
- package/views/dist/grid/chrome/GridCellEditors.js +12 -12
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
- package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
- package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
- package/views/dist/grid/chrome/GridDateEditor.js +3 -3
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
- package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
- package/views/dist/grid/chrome/GridHeader.js +3 -2
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
- package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
- package/views/dist/grid/chrome/GridNameEditor.js +4 -4
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
- package/views/dist/grid/chrome/GridNumberEditor.js +5 -6
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
- package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
- package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
- package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
- package/views/dist/grid/chrome/GridRow.js +0 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
- package/views/dist/grid/chrome/GridRowActions.js +0 -5
- package/views/dist/grid/chrome/GridRowCells.js +11 -7
- package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
- package/views/dist/grid/chrome/GridStructure.js +0 -1
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
- package/views/dist/grid/chrome/GridTextEditor.js +5 -18
- package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
- package/views/dist/grid/chrome/grid-body-place.js +4 -8
- package/views/dist/grid/chrome/grid-button.d.ts +7 -10
- package/views/dist/grid/chrome/grid-button.js +1 -6
- package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
- package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
- package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/chrome/grid-group-menu-parts.d.ts +5 -9
- package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
- package/views/dist/grid/chrome/grid-hover.js +0 -1
- package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
- package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
- package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/editing-controller.d.ts +2 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
- package/views/dist/grid/core/refusal-sentence.js +2 -2
- package/views/dist/grid/core/write-states.d.ts +3 -1
- package/views/dist/grid/core/write-states.js +6 -2
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/body-frame.d.ts +0 -32
- package/views/dist/model/body-frame.js +1 -15
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/column-inspect.d.ts +5 -5
- package/views/dist/model/column-inspect.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/customize-body.d.ts +1 -10
- package/views/dist/panels/customize-body.js +0 -3
- package/views/dist/panels/filter/MenuSelect.js +0 -5
- package/views/dist/panels/filter/RangeFilterBody.js +0 -1
- package/views/dist/panels/filter/details.d.ts +1 -5
- package/views/dist/panels/filter/details.js +0 -13
- package/views/dist/panels/filter/filter-list.d.ts +0 -1
- package/views/dist/panels/filter/filter-list.js +1 -1
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +10 -2
- package/views/dist/panels/panel-button.d.ts +10 -12
- package/views/dist/panels/panel-button.js +1 -6
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/chrome.d.ts +0 -17
- package/views/dist/panels/react/chrome.js +0 -8
- package/views/dist/panels/react/customize-body.d.ts +14 -12
- package/views/dist/panels/react/customize-body.js +93 -19
- package/views/dist/panels/react/customize.d.ts +16 -12
- package/views/dist/panels/react/customize.js +4 -110
- package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
- package/views/dist/panels/react/filter/FilterEditor.js +6 -330
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +27 -51
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
- package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
- package/views/dist/panels/react/filter/editor-ctx.js +5 -33
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
- package/views/dist/panels/react/filter/filter-part-body.js +0 -5
- package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
- package/views/dist/panels/react/filter/rule-writes.js +4 -95
- package/views/dist/panels/react/order-details.d.ts +1 -26
- package/views/dist/panels/react/order-details.js +3 -69
- package/views/dist/panels/react/panel-header.js +0 -1
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/popover.d.ts +4 -7
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -136
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
- package/views/dist/panels/react/sort/SortEditor.js +8 -245
- package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
- package/views/dist/panels/react/sort/SortFieldList.js +11 -25
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +16 -18
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
- package/views/dist/panels/react/view-actions.js +0 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
- package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +30 -45
- package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
- package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
- package/views/dist/panels/react/views-row/menu-classes.js +0 -2
- package/views/dist/panels/react.d.ts +5 -12
- package/views/dist/panels/react.js +5 -12
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.d.ts +2 -46
- package/views/dist/provider/ViewsProvider.js +31 -27
- package/views/dist/provider/components.d.ts +295 -107
- package/views/dist/provider/context.d.ts +7 -21
- package/views/dist/provider/missing-slot.d.ts +3 -7
- package/views/dist/provider/missing-slot.js +2 -9
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -3
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +6 -4
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +694 -191
- package/views/dist/styles.unlayered.css +691 -188
- package/views/docs/contract.md +133 -130
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/getting-started.md +222 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +224 -4
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/editors.md +235 -20
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +7 -7
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +15 -17
- package/views/docs/guides/the-provider.md +9 -15
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +2 -2
- package/views/docs/reference/controls.md +215 -21
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/editors-chips.md +2 -2
- package/views/docs/reference/editors-date.md +4 -4
- package/views/docs/reference/editors-location.md +4 -7
- package/views/docs/reference/editors-name.md +3 -5
- package/views/docs/reference/editors-number.md +10 -10
- package/views/docs/reference/editors-panel.md +3 -3
- package/views/docs/reference/editors-range.md +3 -5
- package/views/docs/reference/editors-relation.md +4 -4
- package/views/docs/reference/editors-select.md +3 -3
- package/views/docs/reference/editors-text.md +3 -4
- package/views/docs/reference/editors-value-list.md +3 -3
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +2 -2
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +23 -37
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +24 -24
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +12 -11
- package/views/skills/views/SKILL.md +2 -2
- package/views/dist/editors/relation-panel.d.ts +0 -69
- package/views/dist/editors/relation-panel.js +0 -46
- package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
- package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
- package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
- package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
- package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
- package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
- package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
- package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
- package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
- package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
- package/views/dist/grid/chrome/GridFlyout.js +0 -80
- package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
- package/views/dist/grid/chrome/GridMenuRow.js +0 -15
- package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
- package/views/dist/grid/chrome/grid-menu-search.js +0 -7
- package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
- package/views/dist/panels/react/GroupBucketsList.js +0 -44
- package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
- package/views/dist/panels/react/LayoutColumnsList.js +0 -101
- package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
- package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
- package/views/dist/panels/react/drag.d.ts +0 -2
- package/views/dist/panels/react/drag.js +0 -5
- package/views/dist/panels/react/layout-detail.d.ts +0 -4
- package/views/dist/panels/react/layout-detail.js +0 -29
- package/views/dist/panels/react/root-list.d.ts +0 -6
- package/views/dist/panels/react/root-list.js +0 -31
- package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
- package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
- package/views/dist/panels/react/view-footer.d.ts +0 -20
- package/views/dist/panels/react/view-footer.js +0 -41
|
@@ -1,34 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { cx } from "../../../internal/cx.js";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
3
|
import { useViews } from "../../../provider/context.js";
|
|
6
|
-
import { FIELD_PADDING } from "../../filter/TextFilterBody.js";
|
|
7
|
-
import { GROUP_BY_SEARCH_AFTER, matchSortOptions } from "../../labels.js";
|
|
8
4
|
import { sortedField } from "../../settings/sorts.js";
|
|
9
5
|
import { sortBodyOptions } from "../../sort-body-options.js";
|
|
10
|
-
import { PANEL_LIST_CLASS } from "../chrome.js";
|
|
11
6
|
export function SortFieldList({ sorts, own, onPick, onDone, form = "computer", }) {
|
|
12
|
-
const {
|
|
13
|
-
const { RadioRow, PanelSearch } = atoms;
|
|
14
|
-
const [query, setQuery] = useState("");
|
|
15
|
-
const searchable = sorts.options.length > GROUP_BY_SEARCH_AFTER;
|
|
7
|
+
const { messages, components, icons } = useViews();
|
|
16
8
|
const word = messages({ key: "views.panels.sort-sorted" });
|
|
17
9
|
const takenOf = (value) => value !== own && sortedField(sorts.rules, value, own);
|
|
18
10
|
const FieldsBody = components.FieldsBody;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}, onDone: () => onDone?.() }));
|
|
29
|
-
}
|
|
30
|
-
return (_jsxs("div", { "data-slot": "vk-sort-fields", "data-vs-detail": true, className: cx("max-h-72", PANEL_LIST_CLASS), children: [searchable && (_jsx("div", { "data-vs-inset": true, className: FIELD_PADDING, children: _jsx(PanelSearch, { value: query, onChange: setQuery, placeholder: messages({ key: "views.panels.sort-search" }), autoFocus: true }) })), matchSortOptions(sorts.options, query).map((option) => {
|
|
31
|
-
const taken = takenOf(option.value);
|
|
32
|
-
return (_jsx(RadioRow, { mark: "box", selected: option.value === own, label: option.label, disabled: taken, disabledReason: taken ? word : undefined, trailing: taken ? _jsx("span", { className: "text-xs text-(color:--vk-fg-subtle)", children: word }) : null, onClick: () => onPick(option.value) }, option.value));
|
|
33
|
-
})] }));
|
|
11
|
+
const glyphs = { icons, AppIcon: components.AppIcon };
|
|
12
|
+
return (_jsx(FieldsBody, { purpose: "sort", label: sorts.label ?? messages({ key: "views.panels.sort" }), search: messages({ key: "views.panels.sort-search" }), fields: sortBodyOptions(sorts.options, glyphs).map(({ value, defaultDir: _dir, ...option }) => ({
|
|
13
|
+
...option,
|
|
14
|
+
key: value,
|
|
15
|
+
...(takenOf(value) ? { disabled: word } : {}),
|
|
16
|
+
})), ...(own !== undefined ? { own } : {}), form: form, onPick: (key) => {
|
|
17
|
+
if (sorts.options.some((option) => option.value === key) && !takenOf(key))
|
|
18
|
+
onPick(key);
|
|
19
|
+
}, onDone: () => onDone?.() }));
|
|
34
20
|
}
|
|
@@ -61,10 +61,20 @@ export type ReadyToolbarProps<Row> = SettingsPanelsInput<Row> & {
|
|
|
61
61
|
* filters": on the row's right, Sort and Filter adding from the fields and the bar holding what is set (Mihai's look,
|
|
62
62
|
* the default), or on the bar, the bar's own empty Sort and Filter adding. */
|
|
63
63
|
sortFilter?: "right" | "bar";
|
|
64
|
-
/** When the kit arrangement's filter bar shows on a computer:
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
/** When the kit arrangement's filter bar shows on a computer: while a filter stands or is held until whole, or a second
|
|
65
|
+
* axis of views stands there (the default: the bar is the filters' line, and a sort, a change to save or a panel open
|
|
66
|
+
* never bring it), or always.
|
|
67
|
+
* Means nothing while `sortFilter` is "bar", which always shows it. */
|
|
67
68
|
bar?: "added" | "always";
|
|
69
|
+
/** The view's name, drawn in Customize's head (where its head is the view's name) and renamed in place where
|
|
70
|
+
* `onRenameView` is handed too. */
|
|
71
|
+
viewName?: string;
|
|
72
|
+
onRenameView?: (name: string) => void;
|
|
73
|
+
/** Copy link to view, in Customize's foot, where handed. */
|
|
74
|
+
onCopyLink?: () => void;
|
|
75
|
+
/** Export CSV, in Customize's foot, where handed, with what it takes in words (`exportCount`, "12 deals"). */
|
|
76
|
+
onExport?: () => void;
|
|
77
|
+
exportCount?: string;
|
|
68
78
|
className?: string;
|
|
69
79
|
};
|
|
70
80
|
export declare function ReadyToolbar<Row>(props: ReadyToolbarProps<Row>): ReactNode;
|
|
@@ -27,7 +27,14 @@ import { ToolbarSortPill } from "./ToolbarSortPill.js";
|
|
|
27
27
|
import { ToolbarAdvancedFilters } from "./ToolbarAdvancedFilters.js";
|
|
28
28
|
import { ToolbarViews } from "./ToolbarViews.js";
|
|
29
29
|
export function ReadyToolbar(props) {
|
|
30
|
-
const { settings, onChange, views, viewsLayout, onAdd, addItems, addLabel, view, fieldEditor, searchPlaceholder, searching, hosts, narrow, className, } = props;
|
|
30
|
+
const { settings, onChange, views, viewsLayout, onAdd, addItems, addLabel, view, fieldEditor, searchPlaceholder, searching, hosts, narrow, className, viewName, onRenameView, onCopyLink, onExport, exportCount, } = props;
|
|
31
|
+
const customizeOwn = {
|
|
32
|
+
...(viewName !== undefined && { viewName }),
|
|
33
|
+
...(onRenameView && { onRenameView }),
|
|
34
|
+
...(onCopyLink && { onCopyLink }),
|
|
35
|
+
...(onExport && { onExport }),
|
|
36
|
+
...(exportCount !== undefined && { exportCount }),
|
|
37
|
+
};
|
|
31
38
|
const { icons, messages, conventions } = useViews();
|
|
32
39
|
const desktop = useDesktop();
|
|
33
40
|
const phone = props.phone ?? !desktop;
|
|
@@ -157,7 +164,7 @@ export function ReadyToolbar(props) {
|
|
|
157
164
|
icon: _jsx(Edit, { className: "h-4 w-4" }),
|
|
158
165
|
onSelect: () => options.onOpenChange(true),
|
|
159
166
|
},
|
|
160
|
-
node: (_jsx(ToolbarOptions, { ...inputs, view: view, viewFoot: footHere ? "
|
|
167
|
+
node: (_jsx(ToolbarOptions, { ...inputs, view: view, viewFoot: !footHere ? "none" : view ? undefined : "kit", footClear: footHere && clearable ? clear("options") : undefined, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: hosts?.options, ...customizeOwn })),
|
|
161
168
|
},
|
|
162
169
|
...(quickNode
|
|
163
170
|
? [
|
|
@@ -314,7 +321,7 @@ export function ReadyToolbar(props) {
|
|
|
314
321
|
{
|
|
315
322
|
key: "options",
|
|
316
323
|
side: "end",
|
|
317
|
-
node: (_jsx(ToolbarOptions, { ...inputs, view: view, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: hosts?.options })),
|
|
324
|
+
node: (_jsx(ToolbarOptions, { ...inputs, view: view, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: hosts?.options, ...customizeOwn })),
|
|
318
325
|
},
|
|
319
326
|
{ key: "new", side: "end", node: _jsx(ToolbarNew, { onAdd: onAdd, items: addItems, label: addLabel }) },
|
|
320
327
|
];
|
|
@@ -22,7 +22,7 @@ export function Toolbar({ parts, phone, narrow, narrowBelow = TOOLBAR_NARROW_BEL
|
|
|
22
22
|
const nodes = new Map(parts.map((part) => [part.key, part.node]));
|
|
23
23
|
if (fold) {
|
|
24
24
|
const menus = new Map(parts.flatMap((part) => (part.menu ? [[part.key, part.menu]] : [])));
|
|
25
|
-
return (_jsx(ToolbarRadioContext.Provider, { value: radio, children: _jsx("div", { ref: box, "data-slot": "vk-toolbar", "data-form": form, "data-fold": "", className: cx("flex w-full flex-col", className), children: lines.map((line) => (_jsx(FoldLine, { line: line, form: form, nodes: nodes, menus: menus, search: { open: searchOpen, onOpenChange: setSearchOpen } }, line.kind))) }) }));
|
|
25
|
+
return (_jsx(ToolbarRadioContext.Provider, { value: radio, children: _jsx("div", { ref: box, "data-slot": "vk-toolbar", "data-form": form, "data-fold": "", className: cx("@container flex w-full flex-col", className), children: lines.map((line) => (_jsx(FoldLine, { line: line, form: form, nodes: nodes, menus: menus, search: { open: searchOpen, onOpenChange: setSearchOpen } }, line.kind))) }) }));
|
|
26
26
|
}
|
|
27
27
|
return (_jsx(ToolbarRadioContext.Provider, { value: radio, children: _jsx("div", { ref: box, "data-slot": "vk-toolbar", "data-form": form, className: cx("flex w-full flex-col", form === "row" ? "gap-1" : "gap-2", className), children: lines.map((line) => (_jsx(Line, { line: line, form: form, nodes: nodes }, line.kind))) }) }));
|
|
28
28
|
}
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { advancedFiltersOf, followAdvancedKeys, } from "../../../filters/filter-tree.js";
|
|
5
5
|
import { useViews } from "../../../provider/context.js";
|
|
6
|
-
import {
|
|
6
|
+
import { FilterEditorHost } from "../filter/FilterEditor.js";
|
|
7
7
|
import { useSheetPanels } from "../panel-sheet.js";
|
|
8
8
|
import { useToolbarPanel, useToolbarSlot } from "./context.js";
|
|
9
9
|
import { ToolbarButton } from "./ToolbarButton.js";
|
|
@@ -77,7 +77,7 @@ export function AdvancedFilterPill({ filterTree, at, count, aside = false, host:
|
|
|
77
77
|
openAtPress.current = false;
|
|
78
78
|
panel.onOpenChange(!wasOpen);
|
|
79
79
|
}, children: name }));
|
|
80
|
-
const content = (_jsx(
|
|
80
|
+
const content = (_jsx(FilterEditorHost, { filterTree: filterTree, at: at, onDone: () => close(), onRemoved: onRemoved }));
|
|
81
81
|
return (_jsxs("span", { "data-slot": "vk-toolbar-advanced-filter", "data-open": (slot.fold || foldedAt) && panel.open ? "" : undefined, hidden: foldedAt ? true : undefined, className: "relative inline-flex shrink-0 items-center", children: [aside ? (_jsx(Tooltip, { content: messages({ key: "views.panels.advanced-filter-set-aside" }), side: "bottom", children: _jsx("span", { className: "inline-flex min-w-0", children: button }) })) : (button), Host ? (_jsx(Host, { open: panel.open, onOpenChange: panel.onOpenChange, title: name, children: content })) : (_jsx(Popover, { open: panel.open, onOpenChange: (next, details) => {
|
|
82
82
|
if (!next)
|
|
83
83
|
close(details?.reason !== "outside-press" && details?.reason !== "focus-out");
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { putBackAt } from "../../../filters/filter-tree.js";
|
|
5
5
|
import { useViews } from "../../../provider/context.js";
|
|
6
|
-
import { setAsideFits } from "../../settings/filter-groups.js";
|
|
6
|
+
import { listedFieldsOf, setAsideFits } from "../../settings/filter-groups.js";
|
|
7
7
|
import { asideFilterWords } from "../../toolbar/filter-words.js";
|
|
8
8
|
import { FilterFieldList } from "../filter/FilterFieldList.js";
|
|
9
9
|
import { repointBarFilter } from "./bar-writes.js";
|
|
@@ -45,7 +45,7 @@ export function ToolbarAsideFilter({ ctx, path, node, open, onOpenChange, folded
|
|
|
45
45
|
if (details?.reason !== "outside-press" && details?.reason !== "focus-out")
|
|
46
46
|
anchorOf(part).current?.focus({ preventScroll: true });
|
|
47
47
|
};
|
|
48
|
-
return (_jsxs("span", { ref: placeBox, "data-slot": "vk-toolbar-filter-aside", "data-aside": "", role: "group", "aria-label": words.sentence, "data-open": open ? "" : undefined, hidden: foldedAt ? true : undefined, className: "relative inline-flex min-w-0 shrink-0 items-center", children: [_jsx(Tooltip, { content: words.why, side: "bottom", children: _jsx("span", { className: "inline-flex min-w-0", children: _jsx(ToolbarButton, { ref: fieldBox, icon: null, label: messages({ key: "views.panels.filter-field" }), joined: "start", aside: true, popup: "dialog", open: open === "field", ...press("field"), children: words.field }) }) }), _jsx(Popover, { open: open === "field", onOpenChange: closed("field"), anchor: anchorOf("field"), align: "start", sideOffset: 8, chrome: "menu", children: _jsx(FilterFieldList, { fields: ctx.filterTree
|
|
48
|
+
return (_jsxs("span", { ref: placeBox, "data-slot": "vk-toolbar-filter-aside", "data-aside": "", role: "group", "aria-label": words.sentence, "data-open": open ? "" : undefined, hidden: foldedAt ? true : undefined, className: "relative inline-flex min-w-0 shrink-0 items-center", children: [_jsx(Tooltip, { content: words.why, side: "bottom", children: _jsx("span", { className: "inline-flex min-w-0", children: _jsx(ToolbarButton, { ref: fieldBox, icon: null, label: messages({ key: "views.panels.filter-field" }), joined: "start", aside: true, popup: "dialog", open: open === "field", ...press("field"), children: words.field }) }) }), _jsx(Popover, { open: open === "field", onOpenChange: closed("field"), anchor: anchorOf("field"), align: "start", sideOffset: 8, chrome: "menu", children: _jsx(FilterFieldList, { fields: listedFieldsOf(ctx.filterTree), relations: true, onPick: (picked, far) => {
|
|
49
49
|
onOpenChange(null);
|
|
50
50
|
const result = repointBarFilter(ctx, path, node, picked, far);
|
|
51
51
|
if (result)
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRef } from "react";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
4
|
import { canGroupAt, nodeAt } from "../../../filters/filter-tree.js";
|
|
5
5
|
import { useViews } from "../../../provider/context.js";
|
|
6
|
-
import {
|
|
6
|
+
import { drawsUnnamedValue } from "../../labels.js";
|
|
7
|
+
import { listedFieldsOf, takesValue, withOperator } from "../../settings/filter-groups.js";
|
|
7
8
|
import { barFilterWords } from "../../toolbar/filter-words.js";
|
|
8
9
|
import { fieldOfRule } from "../filter/editor-ctx.js";
|
|
9
10
|
import { FilterFieldList } from "../filter/FilterFieldList.js";
|
|
10
|
-
import { AppFilterPart
|
|
11
|
+
import { AppFilterPart } from "../filter/filter-part-body.js";
|
|
11
12
|
import { FilterValueBody } from "../filter/FilterValueBody.js";
|
|
12
13
|
import { convertBarFilter, pickBarField, writeBarRule } from "./bar-writes.js";
|
|
13
14
|
import { useToolbarPanel } from "./context.js";
|
|
@@ -47,10 +48,17 @@ export function ToolbarBarFilter({ ctx, at, rule, open, onOpenChange, foldedAt,
|
|
|
47
48
|
const config = takesValue(rule.operator)
|
|
48
49
|
? ctx.filterTree.valueOf(rule, write, relation?.fieldKey)
|
|
49
50
|
: null;
|
|
50
|
-
const
|
|
51
|
+
const asked = useRef(new Set());
|
|
52
|
+
const ask = config && drawsUnnamedValue(config) && "onOpen" in config ? config.onOpen : undefined;
|
|
53
|
+
const askKey = config?.key;
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!ask || askKey === undefined || asked.current.has(askKey))
|
|
56
|
+
return;
|
|
57
|
+
asked.current.add(askKey);
|
|
58
|
+
ask();
|
|
59
|
+
});
|
|
51
60
|
const actions = messages({ key: "views.panels.filter-rule-actions", values: { label: words.field } });
|
|
52
61
|
const More = icons.more;
|
|
53
|
-
const partBody = useFilterPartBody();
|
|
54
62
|
const anchorOf = (part) => foldedAt ?? boxes[part];
|
|
55
63
|
const press = (part) => ({
|
|
56
64
|
onPointerDown: () => {
|
|
@@ -73,24 +81,14 @@ export function ToolbarBarFilter({ ctx, at, rule, open, onOpenChange, foldedAt,
|
|
|
73
81
|
onOpenChange(null);
|
|
74
82
|
anchorOf(part).current?.focus({ preventScroll: true });
|
|
75
83
|
};
|
|
76
|
-
return (_jsxs("span", { ref: placeBox, "data-slot": "vk-toolbar-filter-rule", role: "group", "aria-label": words.sentence, "data-open": open ? "" : undefined, hidden: foldedAt ? true : undefined, className: "relative inline-flex min-w-0 shrink-0 items-center", children: [_jsx(ToolbarButton, { ref: fieldBox, icon: null, label: messages({ key: "views.panels.filter-field" }), joined: "start", popup: "dialog", open: open === "field", ...press("field"), children: words.field }), _jsx(Popover, { open: open === "field", onOpenChange: closed("field"), anchor: anchorOf("field"), align: "start", sideOffset: 8, chrome: "menu", children: _jsx(FilterFieldList, { fields: ctx.filterTree
|
|
84
|
+
return (_jsxs("span", { ref: placeBox, "data-slot": "vk-toolbar-filter-rule", role: "group", "aria-label": words.sentence, "data-open": open ? "" : undefined, hidden: foldedAt ? true : undefined, className: "relative inline-flex min-w-0 shrink-0 items-center", children: [_jsx(ToolbarButton, { ref: fieldBox, icon: null, label: messages({ key: "views.panels.filter-field" }), joined: "start", popup: "dialog", open: open === "field", ...press("field"), children: words.field }), _jsx(Popover, { open: open === "field", onOpenChange: closed("field"), anchor: anchorOf("field"), align: "start", sideOffset: 8, chrome: "menu", children: _jsx(FilterFieldList, { fields: listedFieldsOf(ctx.filterTree), own: field?.key, relations: true, onPick: (picked, far) => {
|
|
77
85
|
done("field");
|
|
78
86
|
pickBarField(ctx, at, rule, picked, far);
|
|
79
|
-
}, onDone: () => done("field") }) }), _jsx(ToolbarButton, { ref: wayBox, icon: null, label: messages({ key: "views.panels.filter-way" }), joined: "middle", popup:
|
|
87
|
+
}, onDone: () => done("field") }) }), _jsx(ToolbarButton, { ref: wayBox, icon: null, label: messages({ key: "views.panels.filter-way" }), joined: "middle", popup: "dialog", open: open === "way", ...(field && press("way")), children: words.way }), field && (_jsx(Popover, { open: open === "way", onOpenChange: closed("way"), anchor: anchorOf("way"), align: "start", sideOffset: 8, chrome: "menu", children: _jsx(AppFilterPart, { part: "way", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, relation?.fieldKey), own: null, form: "computer", onWay: (operator) => {
|
|
80
88
|
done("way");
|
|
81
89
|
if (operator !== rule.operator)
|
|
82
90
|
writeBarRule(ctx, at, withOperator(rule, field.type, operator));
|
|
83
|
-
}, onValue: write, onDone: () => done("way") }) })) : (_jsx(
|
|
84
|
-
key: way.value,
|
|
85
|
-
label: way.label,
|
|
86
|
-
checked: way.value === rule.operator,
|
|
87
|
-
separatorBefore: way.value === "is_empty",
|
|
88
|
-
onSelect: () => {
|
|
89
|
-
done("way");
|
|
90
|
-
if (field && way.value !== rule.operator)
|
|
91
|
-
writeBarRule(ctx, at, withOperator(rule, field.type, way.value));
|
|
92
|
-
},
|
|
93
|
-
})) })), words.value !== null && (_jsxs("span", { "data-part": "value", className: "inline-flex min-w-0 max-w-60", children: [_jsx(ToolbarButton, { ref: valueBox, icon: null, label: messages({ key: "views.panels.filter-value" }), joined: "middle", waits: words.waits, popup: "dialog", open: open === "value", ...press("value"), children: words.value }), config && (_jsx(Popover, { open: open === "value", onOpenChange: closed("value"), anchor: anchorOf("value"), align: "start", sideOffset: 8, chrome: "menu", initialFocus: false, children: partBody && field ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, relation?.fieldKey), own: _jsx(FilterValueBody, { filter: config }), form: "computer", onWay: (operator) => {
|
|
91
|
+
}, onValue: write, onDone: () => done("way") }) })), words.value !== null && (_jsxs("span", { "data-part": "value", className: "inline-flex min-w-0 max-w-60", children: [_jsx(ToolbarButton, { ref: valueBox, icon: null, label: messages({ key: "views.panels.filter-value" }), joined: "middle", waits: words.waits, popup: "dialog", open: open === "value", ...press("value"), children: words.value }), config && (_jsx(Popover, { open: open === "value", onOpenChange: closed("value"), anchor: anchorOf("value"), align: "start", sideOffset: 8, chrome: "menu", initialFocus: false, children: field ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, relation?.fieldKey), own: _jsx(FilterValueBody, { filter: config }), form: "computer", onWay: (operator) => {
|
|
94
92
|
if (operator !== rule.operator)
|
|
95
93
|
writeBarRule(ctx, at, withOperator(rule, field.type, operator));
|
|
96
94
|
}, onValue: write, onDone: () => done("value") })) : (_jsx(FilterValueBody, { filter: config })) }))] })), _jsx(ToolbarButton, { ref: menuBox, icon: _jsx(More, { className: "h-4 w-4 shrink-0" }), label: actions, joined: "end", iconAlone: true, popup: "menu", open: open === "menu", ...press("menu") }), _jsx(Menu, { open: open === "menu", onOpenChange: closed("menu"), anchor: anchorOf("menu"), align: "end", label: actions, items: [
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { useViews } from "../../../provider/context.js";
|
|
5
|
+
import { listedFieldsOf } from "../../settings/filter-groups.js";
|
|
5
6
|
import { FilterFieldList } from "../filter/FilterFieldList.js";
|
|
6
7
|
import { useSheetPanels } from "../panel-sheet.js";
|
|
7
8
|
import { useFoldAnchor, useToolbarPanel } from "./context.js";
|
|
@@ -27,7 +28,7 @@ export function ToolbarFilterAdd({ filterTree, onHeldChange, open, onOpenChange,
|
|
|
27
28
|
fields.onOpenChange(false);
|
|
28
29
|
onPick(picked, far);
|
|
29
30
|
};
|
|
30
|
-
const list = (_jsx(FilterFieldList, { fields: filterTree
|
|
31
|
+
const list = (_jsx(FilterFieldList, { fields: listedFieldsOf(filterTree), relations: true, onPick: pick, onDone: () => {
|
|
31
32
|
fields.onOpenChange(false);
|
|
32
33
|
hangsAt.anchor.current?.focus({ preventScroll: true });
|
|
33
34
|
} }));
|
|
@@ -4,7 +4,7 @@ import { useLayoutEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { isRelationRule, } from "viewkitjs/fields/query";
|
|
5
5
|
import { barItemsOf, followBarKeys, } from "../../../filters/filter-tree.js";
|
|
6
6
|
import { useViews } from "../../../provider/context.js";
|
|
7
|
-
import { takesValue } from "../../settings/filter-groups.js";
|
|
7
|
+
import { listedFieldsOf, takesValue } from "../../settings/filter-groups.js";
|
|
8
8
|
import { asideFilterWords, barFilterWords } from "../../toolbar/filter-words.js";
|
|
9
9
|
import { fieldOfRule, heldStands, relationOf, samePath, useEditorCtx, } from "../filter/editor-ctx.js";
|
|
10
10
|
import { FilterFieldList } from "../filter/FilterFieldList.js";
|
|
@@ -281,7 +281,7 @@ export function ToolbarFilters({ filterTree, open: openIn, onOpenChange: onOpenC
|
|
|
281
281
|
const why = details?.reason;
|
|
282
282
|
if (!next && why !== "outside-press" && why !== "focus-out")
|
|
283
283
|
hangsAt.anchor.current?.focus({ preventScroll: true });
|
|
284
|
-
}, anchor: hangsAt.anchor, align: "start", sideOffset: 8, chrome: "menu", panelData: { "data-slot": "vk-toolbar-filters-panel" }, children: _jsx(FilterFieldList, { fields: filterTree
|
|
284
|
+
}, anchor: hangsAt.anchor, align: "start", sideOffset: 8, chrome: "menu", panelData: { "data-slot": "vk-toolbar-filters-panel" }, children: _jsx(FilterFieldList, { fields: listedFieldsOf(filterTree), relations: true, onPick: onPick, onDone: () => {
|
|
285
285
|
fields.onOpenChange(false);
|
|
286
286
|
hangsAt.anchor.current?.focus({ preventScroll: true });
|
|
287
287
|
} }) }))] }, "add"));
|
|
@@ -292,5 +292,5 @@ export function ToolbarFilters({ filterTree, open: openIn, onOpenChange: onOpenC
|
|
|
292
292
|
pending && !pending.replaces ? heldFilter() : null,
|
|
293
293
|
add,
|
|
294
294
|
];
|
|
295
|
-
return (_jsxs("span", { "data-slot": "vk-toolbar-filters", className: "inline-flex min-w-0 items-center gap-2", children: [line, HostPanel && (_jsx(HostPanel, { open: fields.open, onOpenChange: fields.onOpenChange, title: empty ? name : addLabel, children: _jsx(FilterFieldList, { fields: filterTree
|
|
295
|
+
return (_jsxs("span", { "data-slot": "vk-toolbar-filters", className: "inline-flex min-w-0 items-center gap-2", children: [line, HostPanel && (_jsx(HostPanel, { open: fields.open, onOpenChange: fields.onOpenChange, title: empty ? name : addLabel, children: _jsx(FilterFieldList, { fields: listedFieldsOf(filterTree), relations: true, onPick: onPick, onDone: () => fields.onOpenChange(false) }) }))] }));
|
|
296
296
|
}
|
|
@@ -3,10 +3,10 @@ import { type ActivePanel, type ViewOptionInputs } from "../../model.js";
|
|
|
3
3
|
import type { CollectionViewState } from "../../view-state.js";
|
|
4
4
|
import type { PanelFieldEditor } from "../field-editor.js";
|
|
5
5
|
import { type ToolbarPanelHost } from "./panel-part.js";
|
|
6
|
-
export declare function ToolbarOptions({ view, viewFoot, footClear, fieldEditor, foldFilters, onClear, open, onOpenChange, page: pageIn, onPageChange, host, widthClassName, ...inputs }: ViewOptionInputs & {
|
|
7
|
-
/** The shared view this list shows: the drift dot, and the panel's footer (Reset,
|
|
6
|
+
export declare function ToolbarOptions({ view, viewFoot, footClear, fieldEditor, foldFilters, onClear, open, onOpenChange, page: pageIn, onPageChange, host, widthClassName, viewName, onRenameView, onCopyLink, onExport, exportCount, ...inputs }: ViewOptionInputs & {
|
|
7
|
+
/** The shared view this list shows: the drift dot, and the panel's footer (Reset, Save for everyone). */
|
|
8
8
|
view?: CollectionViewState;
|
|
9
|
-
/** Customize's foot: `kit` for Clear and Save, `none` for none; absent, Reset and
|
|
9
|
+
/** Customize's foot: `kit` for Clear and Save, `none` for none; absent, Reset and Save for everyone. */
|
|
10
10
|
viewFoot?: "kit" | "none";
|
|
11
11
|
/** With no shared view, the foot's Clear (the list back to its default); absent, no foot. */
|
|
12
12
|
footClear?: () => void;
|
|
@@ -24,6 +24,14 @@ export declare function ToolbarOptions({ view, viewFoot, footClear, fieldEditor,
|
|
|
24
24
|
page?: ActivePanel;
|
|
25
25
|
onPageChange?: (page: ActivePanel) => void;
|
|
26
26
|
host?: ToolbarPanelHost;
|
|
27
|
-
/** The popover's width class. Default `w-
|
|
27
|
+
/** The popover's width class. Default `w-75`: 300 px, the Pane Customize was designed in. */
|
|
28
28
|
widthClassName?: string;
|
|
29
|
+
/** The view's name, drawn in Customize's head and renamed in place where `onRenameView` is handed too. */
|
|
30
|
+
viewName?: string;
|
|
31
|
+
onRenameView?: (name: string) => void;
|
|
32
|
+
/** Copy link to view, in Customize's foot, where handed. */
|
|
33
|
+
onCopyLink?: () => void;
|
|
34
|
+
/** Export CSV, in Customize's foot, where handed, with what it takes in words (`exportCount`, "12 deals"). */
|
|
35
|
+
onExport?: () => void;
|
|
36
|
+
exportCount?: string;
|
|
29
37
|
}): ReactNode;
|
|
@@ -6,12 +6,14 @@ import { getViewOptionAvailability } from "../../availability.js";
|
|
|
6
6
|
import { clearViewOptions, countActiveViewOptions, } from "../../model.js";
|
|
7
7
|
import { ViewOptionsPanelContent } from "../customize.js";
|
|
8
8
|
import { viewOptionsPopoverClassName } from "../popover.js";
|
|
9
|
+
import { PanelStepHold, usePanelStep } from "../panel-step.js";
|
|
9
10
|
import { ToolbarPanelPart } from "./panel-part.js";
|
|
10
|
-
export function ToolbarOptions({ view, viewFoot, footClear, fieldEditor, foldFilters = true, onClear, open, onOpenChange, page: pageIn, onPageChange, host, widthClassName, ...inputs }) {
|
|
11
|
+
export function ToolbarOptions({ view, viewFoot, footClear, fieldEditor, foldFilters = true, onClear, open, onOpenChange, page: pageIn, onPageChange, host, widthClassName, viewName, onRenameView, onCopyLink, onExport, exportCount, ...inputs }) {
|
|
11
12
|
const { icons, messages } = useViews();
|
|
12
13
|
const Glyph = icons.options;
|
|
13
14
|
const [ownOpen, setOwnOpen] = useState(false);
|
|
14
15
|
const [ownPage, setOwnPage] = useState(null);
|
|
16
|
+
const step = usePanelStep();
|
|
15
17
|
const holdsOpen = open !== undefined && !!onOpenChange;
|
|
16
18
|
const holdsPage = pageIn !== undefined && !!onPageChange;
|
|
17
19
|
const page = holdsPage ? pageIn : ownPage;
|
|
@@ -29,5 +31,7 @@ export function ToolbarOptions({ view, viewFoot, footClear, fieldEditor, foldFil
|
|
|
29
31
|
else
|
|
30
32
|
setOwnOpen(next);
|
|
31
33
|
};
|
|
32
|
-
return (_jsx(ToolbarPanelPart, { panelKey: "options", slot: "vk-toolbar-options", icon: _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: name, word: name, count: count, onClear: clear, dot: !!view && view.changes > 0, open: holdsOpen ? open : ownOpen, onOpenChange: handleOpenChange, host: host, popoverClassName:
|
|
34
|
+
return (_jsx(ToolbarPanelPart, { panelKey: "options", slot: "vk-toolbar-options", icon: _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: name, word: name, count: count, onClear: clear, dot: !!view && view.changes > 0, open: holdsOpen ? open : ownOpen, onOpenChange: handleOpenChange, host: host, popoverClassName: widthClassName
|
|
35
|
+
? viewOptionsPopoverClassName(page, widthClassName)
|
|
36
|
+
: viewOptionsPopoverClassName(null, "w-75"), onSheetEscape: step.escapeBack, children: ({ fill, close, closeButton }) => (_jsx(PanelStepHold.Provider, { value: step, children: _jsx(ViewOptionsPanelContent, { ...inputs, activePanel: page, onOpenPanel: setPage, anyActive: view ? view.changes > 0 : count > 0, clearAll: clear, foldFilters: foldFilters, onClose: close, closeButton: closeButton, fill: fill, view: view, viewFoot: viewFoot, footClear: footClear, fieldEditor: fieldEditor, ...(viewName !== undefined && { viewName }), ...(onRenameView && { onRenameView }), ...(onCopyLink && { onCopyLink }), ...(onExport && { onExport }), ...(exportCount !== undefined && { exportCount }) }) })) }));
|
|
33
37
|
}
|
|
@@ -12,5 +12,5 @@ export function ToolbarQuickFilters({ quickFilters, open, onOpenChange, host, ic
|
|
|
12
12
|
return null;
|
|
13
13
|
const Glyph = icons.filterCategory;
|
|
14
14
|
const label = quickFilters.label ?? messages({ key: "views.panels.quick-filters" });
|
|
15
|
-
return (_jsx(ToolbarPanelPart, { panelKey: "quick", slot: "vk-toolbar-quick", icon: icon ?? _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: label, word: word === null ? null : label, changed: holdStands(quickFilters.hold), open: open, onOpenChange: onOpenChange, host: host, children: ({
|
|
15
|
+
return (_jsx(ToolbarPanelPart, { panelKey: "quick", slot: "vk-toolbar-quick", icon: icon ?? _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: label, word: word === null ? null : label, changed: holdStands(quickFilters.hold), open: open, onOpenChange: onOpenChange, host: host, children: ({ close, closeButton }) => (_jsx(QuickFiltersPanel, { quickFilters: quickFilters, form: phone ? "phone" : "computer", onDone: close, closeButton: closeButton })) }));
|
|
16
16
|
}
|
|
@@ -4,8 +4,6 @@ import { useViews } from "../../../provider/context.js";
|
|
|
4
4
|
import { drawPanelButton } from "../../panel-button.js";
|
|
5
5
|
import { useToolbarSlot } from "./context.js";
|
|
6
6
|
import { ToolbarButton } from "./ToolbarButton.js";
|
|
7
|
-
const CLEAR_CLASS = "inline-flex h-8 shrink-0 items-center rounded-full px-3 text-sm text-(color:--vk-fg-subtle) transition-colors hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg) disabled:opacity-50";
|
|
8
|
-
const SAVE_CLASS = "inline-flex h-8 shrink-0 items-center rounded-full border border-(color:--vk-border) px-3 text-sm font-medium text-(color:--vk-fg) transition-colors hover:bg-(color:--vk-hovered) disabled:opacity-50";
|
|
9
7
|
export function ToolbarSave({ view, onClear, }) {
|
|
10
8
|
const views = useViews();
|
|
11
9
|
const { messages } = views;
|
|
@@ -20,7 +18,6 @@ export function ToolbarSave({ view, onClear, }) {
|
|
|
20
18
|
return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [_jsx(ToolbarButton, { icon: null, label: clearWord, part: "clear", disabled: pending, onClick: clear, children: clearWord }), view?.canPublish && (_jsx(ToolbarButton, { icon: null, label: saveWord, part: "save", disabled: pending, onClick: view.onPublish, children: saveWord }))] }));
|
|
21
19
|
}
|
|
22
20
|
return (_jsxs("span", { "data-slot": "vk-toolbar-save", className: "inline-flex shrink-0 items-center gap-2", children: [drawPanelButton(views, {
|
|
23
|
-
own: CLEAR_CLASS,
|
|
24
21
|
frame: "h-8 px-3",
|
|
25
22
|
variant: "ghost",
|
|
26
23
|
size: "sm",
|
|
@@ -30,7 +27,6 @@ export function ToolbarSave({ view, onClear, }) {
|
|
|
30
27
|
children: messages({ key: "views.panels.view-clear" }),
|
|
31
28
|
}), view?.canPublish &&
|
|
32
29
|
drawPanelButton(views, {
|
|
33
|
-
own: SAVE_CLASS,
|
|
34
30
|
frame: "h-8 px-3",
|
|
35
31
|
variant: "outline",
|
|
36
32
|
size: "sm",
|
|
@@ -71,7 +71,6 @@ export function ToolbarSearch({ value, onChange, placeholder, searching = false,
|
|
|
71
71
|
event.preventDefault();
|
|
72
72
|
clear();
|
|
73
73
|
}, className: cx("h-9 w-full min-w-0 rounded-full bg-transparent pl-9 outline-none", desktop ? "text-sm" : "text-base", withClose ? "pr-9" : "pr-3", "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none") }), withClose && (drawPanelButton(views, {
|
|
74
|
-
own: "absolute right-1.5 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full text-(color:--vk-fg-subtlest) transition-colors hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)",
|
|
75
74
|
frame: "absolute right-1.5 top-1/2 h-6 w-6 -translate-y-1/2",
|
|
76
75
|
variant: "ghost",
|
|
77
76
|
size: "icon",
|
|
@@ -4,7 +4,7 @@ import { useRef, useState } from "react";
|
|
|
4
4
|
import { useViews } from "../../../provider/context.js";
|
|
5
5
|
import { addSortRule, canAddSortRule, isSortRulesActive, openSortPlaces, sortRulesLabel, } from "../../settings/sorts.js";
|
|
6
6
|
import { useSheetDrawsClose, useSheetPanels } from "../panel-sheet.js";
|
|
7
|
-
import {
|
|
7
|
+
import { SortEditorHost, useSortEditorHost } from "../sort/SortEditor.js";
|
|
8
8
|
import { SortFieldList } from "../sort/SortFieldList.js";
|
|
9
9
|
import { useFoldAnchor, useToolbarPanel } from "./context.js";
|
|
10
10
|
import { ToolbarPanelPart } from "./panel-part.js";
|
|
@@ -59,7 +59,7 @@ function ComputerPill({ sorts, open: openIn, onOpenChange: onOpenChangeIn, host:
|
|
|
59
59
|
close();
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
|
-
const content = opens.what === "editor" ? (_jsx(
|
|
62
|
+
const content = opens.what === "editor" ? (_jsx(SortEditorHost, { sorts: editing, form: "computer", addSort: opens.addSort, onDone: () => close() })) : (_jsx(SortFieldList, { sorts: sorts, onPick: (value) => {
|
|
63
63
|
const next = addSortRule(sorts.rules, value, places);
|
|
64
64
|
sorts.onChange(next);
|
|
65
65
|
close(true, opens.at === "add" && canAddSortRule(next, places));
|
|
@@ -81,7 +81,7 @@ function PhonePill({ sorts, open: openIn, onOpenChange: onOpenChangeIn, host })
|
|
|
81
81
|
const holds = openIn !== undefined && !!onOpenChangeIn;
|
|
82
82
|
const open = holds ? openIn : held;
|
|
83
83
|
const onOpenChange = holds ? onOpenChangeIn : setHeld;
|
|
84
|
-
const editor =
|
|
84
|
+
const editor = useSortEditorHost({ sorts, form: "phone", open, onDone: () => onOpenChange(false) });
|
|
85
85
|
const headDraws = useSheetDrawsClose();
|
|
86
86
|
const Glyph = icons.sort;
|
|
87
87
|
const name = messages({ key: "views.panels.sort" });
|
|
@@ -31,7 +31,6 @@ function ExportCsvRow({ exportCsv }) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
return drawPanelButton(views, {
|
|
34
|
-
own: cx(ACTION_ROW_CLASS, "hover:bg-(color:--vk-hovered) disabled:pointer-events-none"),
|
|
35
34
|
frame: "h-auto w-full justify-start gap-2.5 px-3 py-2 text-left [font:inherit]",
|
|
36
35
|
variant: "ghost",
|
|
37
36
|
size: "sm",
|
|
@@ -89,16 +89,14 @@ export function FoldingViewRow({ axis, folded: told }) {
|
|
|
89
89
|
const ordered = pills.filter(inBlock).map((pill) => (visibleValues.has(pill.value) ? dealt.shift() : pill.value));
|
|
90
90
|
axis.onReorder(ordered);
|
|
91
91
|
};
|
|
92
|
-
return (_jsxs("div", { ref: hostRef, "data-slot": "vk-views-row", className: isTold ? "relative flex flex-none items-center gap-0.5" : "relative flex min-w-0 flex-1 items-center gap-0.5", children: [_jsx(PillGroup, { value: axis.value, options: shown, onChange: axis.onChange, variant: "plain", onReorder: axis.onReorder ? onPillReorder : undefined, canDrag: axis.canDrag }), folded.length > 0 && _jsx(FoldedViews, { axis: axis, options: foldedOptions }), axis.onCreate && _jsx(ViewCreatePill, { label: axis.createLabel, onClick: axis.onCreate }), !isTold && (_jsx("div", { "aria-hidden": true, inert: true, className: "pointer-events-none absolute inset-0 overflow-hidden", style: { visibility: "hidden" }, children: _jsxs("div", { ref: measureRef, "data-slot": "vk-views-row", className: "pointer-events-none absolute left-0 top-0 flex items-center gap-0.5 whitespace-nowrap", children: [_jsx("div", { "data-measure-pills": true, className: "contents", children: _jsx(PillGroup, { value: axis.value, options: pills, onChange: () => { }, variant: "plain" }) }), inFrame ? (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: _jsx(MoreButton, { count: 99 }) })) :
|
|
93
|
-
own: MORE_CHIP_CLASS,
|
|
92
|
+
return (_jsxs("div", { ref: hostRef, "data-slot": "vk-views-row", className: isTold ? "relative flex flex-none items-center gap-0.5" : "relative flex min-w-0 flex-1 items-center gap-0.5", children: [_jsx(PillGroup, { value: axis.value, options: shown, onChange: axis.onChange, variant: "plain", onReorder: axis.onReorder ? onPillReorder : undefined, canDrag: axis.canDrag }), folded.length > 0 && _jsx(FoldedViews, { axis: axis, options: foldedOptions }), axis.onCreate && _jsx(ViewCreatePill, { label: axis.createLabel, onClick: axis.onCreate }), !isTold && (_jsx("div", { "aria-hidden": true, inert: true, className: "pointer-events-none absolute inset-0 overflow-hidden", style: { visibility: "hidden" }, children: _jsxs("div", { ref: measureRef, "data-slot": "vk-views-row", className: "pointer-events-none absolute left-0 top-0 flex items-center gap-0.5 whitespace-nowrap", children: [_jsx("div", { "data-measure-pills": true, className: "contents", children: _jsx(PillGroup, { value: axis.value, options: pills, onChange: () => { }, variant: "plain" }) }), inFrame ? (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: _jsx(MoreButton, { count: 99 }) })) : (_jsx("span", { "data-measure-more": true, className: "inline-flex", children: drawPanelButton(views, {
|
|
94
93
|
frame: MORE_CHIP_FRAME,
|
|
95
94
|
variant: "ghost",
|
|
96
95
|
size: "sm",
|
|
97
96
|
"data-slot": "vk-views-more",
|
|
98
97
|
children: _jsx(MoreChipInner, { count: 99 }),
|
|
99
|
-
}) }))
|
|
98
|
+
}) })), axis.onCreate && (_jsx("span", { "data-measure-ghost": true, children: _jsx(ViewCreatePill, { label: axis.createLabel, onClick: () => { } }) }))] }) }))] }));
|
|
100
99
|
}
|
|
101
|
-
const MORE_CHIP_CLASS = "inline-flex h-8 shrink-0 items-center gap-0.5 whitespace-nowrap rounded-full px-2.5 text-sm font-medium text-(color:--vk-fg-subtle) transition-colors duration-(--vk-duration,150ms) hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg) data-[state=open]:bg-(color:--vk-pressed) data-[state=open]:text-(color:--vk-fg)";
|
|
102
100
|
const MORE_CHIP_FRAME = "h-8 shrink-0 gap-0.5 whitespace-nowrap px-2.5";
|
|
103
101
|
function MoreChipInner({ count }) {
|
|
104
102
|
const { conventions, icons } = useViews();
|
|
@@ -117,7 +115,6 @@ function FoldedViews({ axis, options, }) {
|
|
|
117
115
|
const toggle = useAnchoredToggle(anchor);
|
|
118
116
|
const inFrame = useViewsRowInFrame();
|
|
119
117
|
return (_jsxs(_Fragment, { children: [inFrame ? (_jsx(MoreButton, { count: options.length, ref: anchor, open: toggle.open, onPointerDown: toggle.triggerProps.onPointerDown, onClick: toggle.triggerProps.onClick })) : (_jsx(PanelButton, { views: views, draw: {
|
|
120
|
-
own: MORE_CHIP_CLASS,
|
|
121
118
|
frame: MORE_CHIP_FRAME,
|
|
122
119
|
variant: "ghost",
|
|
123
120
|
size: "sm",
|
|
@@ -15,7 +15,6 @@ export function ViewCreatePill({ label, onClick, size = "default", className, })
|
|
|
15
15
|
return (_jsx(ToolbarButton, { icon: _jsx(Add, { className: "h-3.5 w-3.5 shrink-0" }), label: name, word: null, part: "views-add", size: size === "sm" ? "sm" : undefined, onClick: onClick }));
|
|
16
16
|
}
|
|
17
17
|
return drawPanelButton(views, {
|
|
18
|
-
own: cx("inline-flex shrink-0 items-center justify-center rounded-full text-(color:--vk-fg-subtle) transition-colors duration-(--vk-duration,150ms) hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)", size === "sm" ? "h-6 w-6" : "h-8 w-8", className),
|
|
19
18
|
frame: cx("shrink-0", size === "sm" ? "h-6 w-6" : "h-8 w-8", className),
|
|
20
19
|
variant: "ghost",
|
|
21
20
|
size: "icon",
|