@hina-ui/vue 1.7.5 → 1.7.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/README.md +37 -0
- package/dist/index.js +2222 -987
- package/dist/index.js.map +1 -1
- package/dist/shared/behavior/anchor-follow.ts +95 -0
- package/dist/shared/behavior/form.ts +187 -0
- package/dist/shared/behavior/ripple.ts +222 -0
- package/dist/shared/behavior/spoiler/painter.ts +197 -0
- package/dist/shared/behavior/spoiler/worklet.ts +199 -0
- package/dist/shared/behavior/toast.ts +243 -0
- package/dist/shared/lib/anchor.ts +83 -0
- package/dist/shared/lib/banner.ts +10 -0
- package/dist/shared/lib/calendar/format.ts +23 -0
- package/dist/shared/lib/caret.ts +48 -0
- package/dist/shared/lib/collapse.ts +29 -0
- package/dist/shared/lib/command-palette/hotkey.ts +27 -0
- package/dist/shared/lib/command-palette/match.ts +92 -0
- package/dist/shared/lib/data-list.ts +40 -0
- package/dist/shared/lib/data-table/column-sizing-styles.ts +41 -0
- package/dist/shared/lib/data-table/column-sizing.ts +101 -0
- package/dist/shared/lib/data-table/csv.ts +51 -0
- package/dist/shared/lib/data-table/layout.ts +199 -0
- package/dist/shared/lib/data-table/resize.ts +66 -0
- package/dist/shared/lib/data-table/state.ts +226 -0
- package/dist/shared/lib/data-table/utils.ts +80 -0
- package/dist/shared/lib/date-range-field/validity.ts +21 -0
- package/dist/shared/lib/date.ts +111 -0
- package/dist/shared/lib/field-focus.ts +36 -0
- package/dist/shared/lib/file-upload/select.ts +58 -0
- package/dist/shared/lib/file-upload/size.ts +16 -0
- package/dist/shared/lib/form/errors.ts +48 -0
- package/dist/shared/lib/form/focus.ts +10 -0
- package/dist/shared/lib/form/standard-schema.ts +26 -0
- package/dist/shared/lib/form/values.ts +23 -0
- package/dist/shared/lib/highlighter.ts +98 -0
- package/dist/shared/lib/iris-origin.ts +40 -0
- package/dist/shared/lib/lightbox/clip.ts +117 -0
- package/dist/shared/lib/lightbox/download.ts +29 -0
- package/dist/shared/lib/lightbox/gesture.ts +54 -0
- package/dist/shared/lib/lightbox/paging.ts +33 -0
- package/dist/shared/lib/lightbox/pose.ts +142 -0
- package/dist/shared/lib/lightbox/source.ts +17 -0
- package/dist/shared/lib/lightbox/types.ts +14 -0
- package/dist/shared/lib/lightbox/zoom.ts +127 -0
- package/dist/shared/lib/meter-group.ts +16 -0
- package/dist/shared/lib/overlay-anchor.ts +42 -0
- package/dist/shared/lib/pagination.ts +16 -0
- package/dist/shared/lib/pointer-corridor.ts +26 -0
- package/dist/shared/lib/qr-code-export.ts +68 -0
- package/dist/shared/lib/range-calendar/limit.ts +11 -0
- package/dist/shared/lib/rating.ts +4 -0
- package/dist/shared/lib/relative-time.ts +20 -0
- package/dist/shared/lib/scroll-area.ts +77 -0
- package/dist/shared/lib/scroll-restore.ts +148 -0
- package/dist/shared/lib/toast-layout.ts +42 -0
- package/dist/shared/lib/tree/selection.ts +131 -0
- package/dist/shared/lib/tree-select/filter.ts +19 -0
- package/dist/shared/lib/virtual/choices.ts +193 -0
- package/dist/shared/lib/virtual/collection.ts +71 -0
- package/dist/shared/lib/virtual/filter.ts +26 -0
- package/dist/shared/lib/virtual/flow.ts +32 -0
- package/dist/shared/lib/virtual/list.ts +63 -0
- package/dist/shared/lib/virtual/navigation.ts +26 -0
- package/dist/shared/lib/virtual/tree.ts +98 -0
- package/dist/shared/locale/en-US.ts +220 -0
- package/dist/shared/locale/index.ts +52 -0
- package/dist/shared/locale/types.ts +225 -0
- package/dist/shared/locale/zh-CN.ts +215 -0
- package/dist/shared/primitives/number-field/LICENSE +21 -0
- package/dist/shared/primitives/number-field/index.ts +407 -0
- package/dist/shared/styles/semantic.css +10 -2
- package/dist/shared/types/autocomplete.ts +16 -0
- package/dist/shared/types/data-table.ts +170 -0
- package/dist/shared/types/pagination.ts +19 -0
- package/dist/shared/types/select.ts +23 -0
- package/dist/shared/types/tree-select.ts +34 -0
- package/dist/shared/types/tree.ts +20 -0
- package/dist/types/shared/src/behavior/anchor-follow.d.ts +13 -0
- package/dist/types/shared/src/behavior/anchor-follow.d.ts.map +1 -0
- package/dist/types/shared/src/behavior/form.d.ts +24 -0
- package/dist/types/shared/src/behavior/form.d.ts.map +1 -0
- package/dist/types/shared/src/behavior/ripple.d.ts +11 -0
- package/dist/types/shared/src/behavior/ripple.d.ts.map +1 -0
- package/dist/types/shared/src/behavior/spoiler/painter.d.ts +35 -0
- package/dist/types/shared/src/behavior/spoiler/painter.d.ts.map +1 -0
- package/dist/types/shared/src/behavior/spoiler/worklet.d.ts +2 -0
- package/dist/types/shared/src/behavior/spoiler/worklet.d.ts.map +1 -0
- package/dist/types/shared/src/behavior/toast.d.ts +72 -0
- package/dist/types/shared/src/behavior/toast.d.ts.map +1 -0
- package/dist/types/shared/src/lib/anchor.d.ts +31 -0
- package/dist/types/shared/src/lib/anchor.d.ts.map +1 -0
- package/dist/types/shared/src/lib/banner.d.ts +3 -0
- package/dist/types/shared/src/lib/banner.d.ts.map +1 -0
- package/dist/types/shared/src/lib/calendar/format.d.ts +7 -0
- package/dist/types/shared/src/lib/calendar/format.d.ts.map +1 -0
- package/dist/types/shared/src/lib/caret.d.ts +2 -0
- package/dist/types/shared/src/lib/caret.d.ts.map +1 -0
- package/dist/types/shared/src/lib/collapse.d.ts +9 -0
- package/dist/types/shared/src/lib/collapse.d.ts.map +1 -0
- package/dist/types/shared/src/lib/command-palette/hotkey.d.ts +9 -0
- package/dist/types/shared/src/lib/command-palette/hotkey.d.ts.map +1 -0
- package/dist/types/shared/src/lib/command-palette/match.d.ts +21 -0
- package/dist/types/shared/src/lib/command-palette/match.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-list.d.ts +7 -0
- package/dist/types/shared/src/lib/data-list.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/column-sizing-styles.d.ts +8 -0
- package/dist/types/shared/src/lib/data-table/column-sizing-styles.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/column-sizing.d.ts +22 -0
- package/dist/types/shared/src/lib/data-table/column-sizing.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/csv.d.ts +5 -0
- package/dist/types/shared/src/lib/data-table/csv.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/layout.d.ts +28 -0
- package/dist/types/shared/src/lib/data-table/layout.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/resize.d.ts +15 -0
- package/dist/types/shared/src/lib/data-table/resize.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/state.d.ts +103 -0
- package/dist/types/shared/src/lib/data-table/state.d.ts.map +1 -0
- package/dist/types/shared/src/lib/data-table/utils.d.ts +11 -0
- package/dist/types/shared/src/lib/data-table/utils.d.ts.map +1 -0
- package/dist/types/shared/src/lib/date-range-field/validity.d.ts +12 -0
- package/dist/types/shared/src/lib/date-range-field/validity.d.ts.map +1 -0
- package/dist/types/shared/src/lib/date.d.ts +28 -0
- package/dist/types/shared/src/lib/date.d.ts.map +1 -0
- package/dist/types/shared/src/lib/field-focus.d.ts +2 -0
- package/dist/types/shared/src/lib/field-focus.d.ts.map +1 -0
- package/dist/types/shared/src/lib/file-upload/select.d.ts +17 -0
- package/dist/types/shared/src/lib/file-upload/select.d.ts.map +1 -0
- package/dist/types/shared/src/lib/file-upload/size.d.ts +2 -0
- package/dist/types/shared/src/lib/file-upload/size.d.ts.map +1 -0
- package/dist/types/shared/src/lib/form/errors.d.ts +7 -0
- package/dist/types/shared/src/lib/form/errors.d.ts.map +1 -0
- package/dist/types/shared/src/lib/form/focus.d.ts +2 -0
- package/dist/types/shared/src/lib/form/focus.d.ts.map +1 -0
- package/dist/types/shared/src/lib/form/standard-schema.d.ts +23 -0
- package/dist/types/shared/src/lib/form/standard-schema.d.ts.map +1 -0
- package/dist/types/shared/src/lib/form/values.d.ts +3 -0
- package/dist/types/shared/src/lib/form/values.d.ts.map +1 -0
- package/dist/types/shared/src/lib/highlighter.d.ts +4 -0
- package/dist/types/shared/src/lib/highlighter.d.ts.map +1 -0
- package/dist/types/shared/src/lib/iris-origin.d.ts +6 -0
- package/dist/types/shared/src/lib/iris-origin.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/clip.d.ts +16 -0
- package/dist/types/shared/src/lib/lightbox/clip.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/download.d.ts +3 -0
- package/dist/types/shared/src/lib/lightbox/download.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/gesture.d.ts +26 -0
- package/dist/types/shared/src/lib/lightbox/gesture.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/paging.d.ts +9 -0
- package/dist/types/shared/src/lib/lightbox/paging.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/pose.d.ts +38 -0
- package/dist/types/shared/src/lib/lightbox/pose.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/source.d.ts +4 -0
- package/dist/types/shared/src/lib/lightbox/source.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/types.d.ts +16 -0
- package/dist/types/shared/src/lib/lightbox/types.d.ts.map +1 -0
- package/dist/types/shared/src/lib/lightbox/zoom.d.ts +40 -0
- package/dist/types/shared/src/lib/lightbox/zoom.d.ts.map +1 -0
- package/dist/types/shared/src/lib/meter-group.d.ts +5 -0
- package/dist/types/shared/src/lib/meter-group.d.ts.map +1 -0
- package/dist/types/shared/src/lib/overlay-anchor.d.ts +10 -0
- package/dist/types/shared/src/lib/overlay-anchor.d.ts.map +1 -0
- package/dist/types/shared/src/lib/pagination.d.ts +4 -0
- package/dist/types/shared/src/lib/pagination.d.ts.map +1 -0
- package/dist/types/shared/src/lib/pointer-corridor.d.ts +7 -0
- package/dist/types/shared/src/lib/pointer-corridor.d.ts.map +1 -0
- package/dist/types/shared/src/lib/qr-code-export.d.ts +6 -0
- package/dist/types/shared/src/lib/qr-code-export.d.ts.map +1 -0
- package/dist/types/shared/src/lib/range-calendar/limit.d.ts +3 -0
- package/dist/types/shared/src/lib/range-calendar/limit.d.ts.map +1 -0
- package/dist/types/shared/src/lib/rating.d.ts +2 -0
- package/dist/types/shared/src/lib/rating.d.ts.map +1 -0
- package/dist/types/shared/src/lib/relative-time.d.ts +2 -0
- package/dist/types/shared/src/lib/relative-time.d.ts.map +1 -0
- package/dist/types/shared/src/lib/scroll-area.d.ts +50 -0
- package/dist/types/shared/src/lib/scroll-area.d.ts.map +1 -0
- package/dist/types/shared/src/lib/scroll-restore.d.ts +34 -0
- package/dist/types/shared/src/lib/scroll-restore.d.ts.map +1 -0
- package/dist/types/shared/src/lib/toast-layout.d.ts +13 -0
- package/dist/types/shared/src/lib/toast-layout.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tree/selection.d.ts +23 -0
- package/dist/types/shared/src/lib/tree/selection.d.ts.map +1 -0
- package/dist/types/shared/src/lib/tree-select/filter.d.ts +7 -0
- package/dist/types/shared/src/lib/tree-select/filter.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/choices.d.ts +59 -0
- package/dist/types/shared/src/lib/virtual/choices.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/collection.d.ts +25 -0
- package/dist/types/shared/src/lib/virtual/collection.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/flow.d.ts +18 -0
- package/dist/types/shared/src/lib/virtual/flow.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/list.d.ts +46 -0
- package/dist/types/shared/src/lib/virtual/list.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/navigation.d.ts +3 -0
- package/dist/types/shared/src/lib/virtual/navigation.d.ts.map +1 -0
- package/dist/types/shared/src/lib/virtual/tree.d.ts +31 -0
- package/dist/types/shared/src/lib/virtual/tree.d.ts.map +1 -0
- package/dist/types/shared/src/locale/en-US.d.ts +3 -0
- package/dist/types/shared/src/locale/en-US.d.ts.map +1 -0
- package/dist/types/shared/src/locale/index.d.ts +6 -0
- package/dist/types/shared/src/locale/index.d.ts.map +1 -0
- package/dist/types/shared/src/locale/types.d.ts +235 -0
- package/dist/types/shared/src/locale/types.d.ts.map +1 -0
- package/dist/types/shared/src/locale/zh-CN.d.ts +3 -0
- package/dist/types/shared/src/locale/zh-CN.d.ts.map +1 -0
- package/dist/types/shared/src/primitives/number-field/index.d.ts +155 -0
- package/dist/types/shared/src/primitives/number-field/index.d.ts.map +1 -0
- package/dist/types/shared/src/types/autocomplete.d.ts +14 -0
- package/dist/types/shared/src/types/autocomplete.d.ts.map +1 -0
- package/dist/types/shared/src/types/data-table.d.ts +169 -0
- package/dist/types/shared/src/types/data-table.d.ts.map +1 -0
- package/dist/types/shared/src/types/pagination.d.ts +23 -0
- package/dist/types/shared/src/types/pagination.d.ts.map +1 -0
- package/dist/types/shared/src/types/select.d.ts +14 -0
- package/dist/types/shared/src/types/select.d.ts.map +1 -0
- package/dist/types/shared/src/types/tree-select.d.ts +10 -0
- package/dist/types/shared/src/types/tree-select.d.ts.map +1 -0
- package/dist/types/shared/src/types/tree.d.ts +18 -0
- package/dist/types/shared/src/types/tree.d.ts.map +1 -0
- package/dist/types/shared/src/variants/autocomplete.d.ts +3 -0
- package/dist/types/shared/src/variants/autocomplete.d.ts.map +1 -0
- package/dist/types/shared/src/variants/editable.d.ts +52 -0
- package/dist/types/shared/src/variants/editable.d.ts.map +1 -0
- package/dist/types/shared/src/variants/float-button.d.ts +74 -0
- package/dist/types/shared/src/variants/float-button.d.ts.map +1 -0
- package/dist/types/shared/src/variants/split-button.d.ts +18 -0
- package/dist/types/shared/src/variants/split-button.d.ts.map +1 -0
- package/dist/types/vue/src/components/accordion/AccordionTrigger.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/anchor/composables/useAnchor.d.ts +2 -7
- package/dist/types/vue/src/components/anchor/composables/useAnchor.d.ts.map +1 -1
- package/dist/types/vue/src/components/anchor/composables/useAnchorFollow.d.ts.map +1 -1
- package/dist/types/vue/src/components/anchor/composables/useScrollSpy.d.ts +2 -5
- package/dist/types/vue/src/components/anchor/composables/useScrollSpy.d.ts.map +1 -1
- package/dist/types/vue/src/components/anchor/types.d.ts +1 -8
- package/dist/types/vue/src/components/anchor/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/autocomplete/autocomplete.variants.d.ts +1 -1
- package/dist/types/vue/src/components/autocomplete/autocomplete.variants.d.ts.map +1 -1
- package/dist/types/vue/src/components/autocomplete/types.d.ts +1 -13
- package/dist/types/vue/src/components/autocomplete/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/banner/utils/direction.d.ts +1 -2
- package/dist/types/vue/src/components/banner/utils/direction.d.ts.map +1 -1
- package/dist/types/vue/src/components/calendar/utils/format.d.ts +1 -6
- package/dist/types/vue/src/components/calendar/utils/format.d.ts.map +1 -1
- package/dist/types/vue/src/components/code-block/highlighter.d.ts +1 -3
- package/dist/types/vue/src/components/code-block/highlighter.d.ts.map +1 -1
- package/dist/types/vue/src/components/collapsible/CollapsibleTrigger.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/composables/useCommandItems.d.ts +1 -1
- package/dist/types/vue/src/components/command-palette/utils/hotkey.d.ts +1 -8
- package/dist/types/vue/src/components/command-palette/utils/hotkey.d.ts.map +1 -1
- package/dist/types/vue/src/components/command-palette/utils/match.d.ts +5 -12
- package/dist/types/vue/src/components/command-palette/utils/match.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-list/composables/useDataList.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-list/utils/scroll.d.ts +1 -2
- package/dist/types/vue/src/components/data-list/utils/scroll.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/column-sizing-styles.d.ts +1 -3
- package/dist/types/vue/src/components/data-table/column-sizing-styles.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/column-sizing.d.ts +1 -21
- package/dist/types/vue/src/components/data-table/column-sizing.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useDataTable.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableColumns.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableDrag.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableExport.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableResize.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableResizeHandles.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/composables/useTableVirtual.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/types.d.ts +3 -153
- package/dist/types/vue/src/components/data-table/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/data-table/utils.d.ts +1 -9
- package/dist/types/vue/src/components/data-table/utils.d.ts.map +1 -1
- package/dist/types/vue/src/components/date-range-field/utils/validity.d.ts +1 -11
- package/dist/types/vue/src/components/date-range-field/utils/validity.d.ts.map +1 -1
- package/dist/types/vue/src/components/editable/editable.variants.d.ts +1 -1
- package/dist/types/vue/src/components/editable/editable.variants.d.ts.map +1 -1
- package/dist/types/vue/src/components/file-upload/utils/select.d.ts +1 -16
- package/dist/types/vue/src/components/file-upload/utils/select.d.ts.map +1 -1
- package/dist/types/vue/src/components/file-upload/utils/size.d.ts +1 -1
- package/dist/types/vue/src/components/file-upload/utils/size.d.ts.map +1 -1
- package/dist/types/vue/src/components/float-button/float-button.variants.d.ts +1 -1
- package/dist/types/vue/src/components/float-button/float-button.variants.d.ts.map +1 -1
- package/dist/types/vue/src/components/form/Form.vue.d.ts +1 -1
- package/dist/types/vue/src/components/form/composables/useForm.d.ts +9 -15
- package/dist/types/vue/src/components/form/composables/useForm.d.ts.map +1 -1
- package/dist/types/vue/src/components/form/standard-schema.d.ts +1 -22
- package/dist/types/vue/src/components/form/standard-schema.d.ts.map +1 -1
- package/dist/types/vue/src/components/form/utils/errors.d.ts +1 -6
- package/dist/types/vue/src/components/form/utils/errors.d.ts.map +1 -1
- package/dist/types/vue/src/components/form/utils/focus.d.ts +1 -1
- package/dist/types/vue/src/components/form/utils/focus.d.ts.map +1 -1
- package/dist/types/vue/src/components/form/utils/values.d.ts +1 -2
- package/dist/types/vue/src/components/form/utils/values.d.ts.map +1 -1
- package/dist/types/vue/src/components/form-field/FormField.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/types.d.ts +1 -15
- package/dist/types/vue/src/components/lightbox/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/clip.d.ts +1 -15
- package/dist/types/vue/src/components/lightbox/utils/clip.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/download.d.ts +1 -2
- package/dist/types/vue/src/components/lightbox/utils/download.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/gesture.d.ts +1 -25
- package/dist/types/vue/src/components/lightbox/utils/gesture.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/paging.d.ts +1 -8
- package/dist/types/vue/src/components/lightbox/utils/paging.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/pose.d.ts +1 -37
- package/dist/types/vue/src/components/lightbox/utils/pose.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/source.d.ts +1 -3
- package/dist/types/vue/src/components/lightbox/utils/source.d.ts.map +1 -1
- package/dist/types/vue/src/components/lightbox/utils/zoom.d.ts +1 -39
- package/dist/types/vue/src/components/lightbox/utils/zoom.d.ts.map +1 -1
- package/dist/types/vue/src/components/meter-group/utils/tones.d.ts +1 -3
- package/dist/types/vue/src/components/meter-group/utils/tones.d.ts.map +1 -1
- package/dist/types/vue/src/components/month-grid/MonthGrid.vue.d.ts +1 -1
- package/dist/types/vue/src/components/multi-select/MultiSelect.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/pagination/composables/usePagination.d.ts +2 -2
- package/dist/types/vue/src/components/pagination/composables/usePagination.d.ts.map +1 -1
- package/dist/types/vue/src/components/pagination/types.d.ts +1 -22
- package/dist/types/vue/src/components/pagination/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/pagination/utils/ranges.d.ts +1 -2
- package/dist/types/vue/src/components/pagination/utils/ranges.d.ts.map +1 -1
- package/dist/types/vue/src/components/password-input/PasswordInput.vue.d.ts +4 -1
- package/dist/types/vue/src/components/password-input/PasswordInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/qr-code/export.d.ts +1 -2
- package/dist/types/vue/src/components/qr-code/export.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-calendar/utils/limit.d.ts +1 -2
- package/dist/types/vue/src/components/range-calendar/utils/limit.d.ts.map +1 -1
- package/dist/types/vue/src/components/range-slider/RangeSlider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/rating/utils/fill.d.ts +1 -1
- package/dist/types/vue/src/components/rating/utils/fill.d.ts.map +1 -1
- package/dist/types/vue/src/components/ripple/useRipple.d.ts.map +1 -1
- package/dist/types/vue/src/components/scroll-area/ScrollArea.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/scroll-area/composables/useEdgeShadow.d.ts +2 -1
- package/dist/types/vue/src/components/scroll-area/composables/useEdgeShadow.d.ts.map +1 -1
- package/dist/types/vue/src/components/scroll-area/composables/useLayerLock.d.ts.map +1 -1
- package/dist/types/vue/src/components/scroll-area/composables/useWheelRedirect.d.ts.map +1 -1
- package/dist/types/vue/src/components/scroll-area/scroll-restore.d.ts +1 -33
- package/dist/types/vue/src/components/scroll-area/scroll-restore.d.ts.map +1 -1
- package/dist/types/vue/src/components/search-input/SearchInput.vue.d.ts +4 -1
- package/dist/types/vue/src/components/search-input/SearchInput.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/select/types.d.ts +1 -13
- package/dist/types/vue/src/components/select/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/slider/Slider.vue.d.ts +2 -2
- package/dist/types/vue/src/components/split-button/split-button.variants.d.ts +1 -1
- package/dist/types/vue/src/components/split-button/split-button.variants.d.ts.map +1 -1
- package/dist/types/vue/src/components/spoiler/SpoilerPainter.d.ts +1 -34
- package/dist/types/vue/src/components/spoiler/SpoilerPainter.d.ts.map +1 -1
- package/dist/types/vue/src/components/spoiler/utils/irisOrigin.d.ts +1 -5
- package/dist/types/vue/src/components/spoiler/utils/irisOrigin.d.ts.map +1 -1
- package/dist/types/vue/src/components/spoiler/worklet.d.ts +1 -1
- package/dist/types/vue/src/components/spoiler/worklet.d.ts.map +1 -1
- package/dist/types/vue/src/components/table/Table.vue.d.ts +6 -3
- package/dist/types/vue/src/components/table/Table.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/tabs/TabsList.vue.d.ts +6 -3
- package/dist/types/vue/src/components/tabs/TabsList.vue.d.ts.map +1 -1
- package/dist/types/vue/src/components/time/utils/relativeTime.d.ts +1 -1
- package/dist/types/vue/src/components/time/utils/relativeTime.d.ts.map +1 -1
- package/dist/types/vue/src/components/toast/composables/useToastLayout.d.ts +4 -11
- package/dist/types/vue/src/components/toast/composables/useToastLayout.d.ts.map +1 -1
- package/dist/types/vue/src/components/toast/store.d.ts +14 -62
- package/dist/types/vue/src/components/toast/store.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/composables/useTree.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/types.d.ts +1 -17
- package/dist/types/vue/src/components/tree/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree/utils/selection.d.ts +1 -15
- package/dist/types/vue/src/components/tree/utils/selection.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/types.d.ts +1 -9
- package/dist/types/vue/src/components/tree-select/types.d.ts.map +1 -1
- package/dist/types/vue/src/components/tree-select/utils/filterTree.d.ts +1 -6
- package/dist/types/vue/src/components/tree-select/utils/filterTree.d.ts.map +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts +1 -1
- package/dist/types/vue/src/components/virtual-list/composables/useVirtualList.d.ts.map +1 -1
- package/dist/types/vue/src/components/visually-hidden/VisuallyHidden.vue.d.ts +4 -1
- package/dist/types/vue/src/components/visually-hidden/VisuallyHidden.vue.d.ts.map +1 -1
- package/dist/types/vue/src/lib/caret.d.ts +1 -1
- package/dist/types/vue/src/lib/caret.d.ts.map +1 -1
- package/dist/types/vue/src/lib/collapse.d.ts +2 -8
- package/dist/types/vue/src/lib/collapse.d.ts.map +1 -1
- package/dist/types/vue/src/lib/date.d.ts +1 -27
- package/dist/types/vue/src/lib/date.d.ts.map +1 -1
- package/dist/types/vue/src/lib/field-focus.d.ts +1 -1
- package/dist/types/vue/src/lib/field-focus.d.ts.map +1 -1
- package/dist/types/vue/src/lib/overlay-anchor.d.ts +2 -7
- package/dist/types/vue/src/lib/overlay-anchor.d.ts.map +1 -1
- package/dist/types/vue/src/lib/pointer-corridor.d.ts +1 -6
- package/dist/types/vue/src/lib/pointer-corridor.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts +3 -11
- package/dist/types/vue/src/lib/reka/useVirtualChoices.d.ts.map +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts +1 -1
- package/dist/types/vue/src/lib/reka/useVirtualTree.d.ts.map +1 -1
- package/dist/types/vue/src/lib/virtual/navigation.d.ts +1 -2
- package/dist/types/vue/src/lib/virtual/navigation.d.ts.map +1 -1
- package/dist/types/vue/src/lib/virtual/useVirtualCollection.d.ts +1 -1
- package/dist/types/vue/src/lib/virtual/useVirtualCollection.d.ts.map +1 -1
- package/dist/types/vue/src/lib/virtual/useVirtualWindow.d.ts +2 -15
- package/dist/types/vue/src/lib/virtual/useVirtualWindow.d.ts.map +1 -1
- package/dist/types/vue/src/locale/en-US.d.ts +1 -2
- package/dist/types/vue/src/locale/en-US.d.ts.map +1 -1
- package/dist/types/vue/src/locale/index.d.ts +3 -4
- package/dist/types/vue/src/locale/index.d.ts.map +1 -1
- package/dist/types/vue/src/locale/types.d.ts +1 -234
- package/dist/types/vue/src/locale/types.d.ts.map +1 -1
- package/dist/types/vue/src/locale/zh-CN.d.ts +1 -2
- package/dist/types/vue/src/locale/zh-CN.d.ts.map +1 -1
- package/dist/types/vue/src/primitives/number-field/NumberFieldDecrement.vue.d.ts +17 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldDecrement.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldIncrement.vue.d.ts +17 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldIncrement.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldInput.vue.d.ts +16 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldInput.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts +47 -0
- package/dist/types/vue/src/primitives/number-field/NumberFieldRoot.vue.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/context.d.ts +41 -0
- package/dist/types/vue/src/primitives/number-field/context.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/number-field/index.d.ts +5 -0
- package/dist/types/vue/src/primitives/number-field/index.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/timers.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/timers.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/usePrimitiveElement.d.ts +6 -0
- package/dist/types/vue/src/primitives/utils/usePrimitiveElement.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts +7 -0
- package/dist/types/vue/src/primitives/utils/useVModel.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts +66 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInput.d.ts.map +1 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue.d.ts +28 -0
- package/dist/types/vue/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/components/accordion/AccordionTrigger.vue +9 -1
- package/src/components/anchor/composables/useAnchor.ts +3 -12
- package/src/components/anchor/composables/useAnchorFollow.ts +8 -76
- package/src/components/anchor/composables/useScrollSpy.ts +22 -38
- package/src/components/anchor/types.ts +1 -8
- package/src/components/autocomplete/autocomplete.variants.ts +1 -1
- package/src/components/autocomplete/composables/useAutocomplete.ts +1 -1
- package/src/components/autocomplete/types.ts +1 -16
- package/src/components/banner/utils/direction.ts +1 -10
- package/src/components/calendar/utils/format.ts +1 -23
- package/src/components/code-block/highlighter.ts +1 -98
- package/src/components/collapsible/CollapsibleTrigger.vue +8 -1
- package/src/components/command-palette/utils/hotkey.ts +1 -27
- package/src/components/command-palette/utils/match.ts +5 -75
- package/src/components/data-list/composables/useDataList.ts +2 -4
- package/src/components/data-list/utils/scroll.ts +1 -26
- package/src/components/data-table/column-sizing-styles.ts +1 -40
- package/src/components/data-table/column-sizing.ts +1 -101
- package/src/components/data-table/composables/useDataTable.ts +103 -123
- package/src/components/data-table/composables/useTableColumns.ts +38 -113
- package/src/components/data-table/composables/useTableDrag.ts +21 -11
- package/src/components/data-table/composables/useTableExport.ts +8 -32
- package/src/components/data-table/composables/useTableResize.ts +13 -17
- package/src/components/data-table/composables/useTableResizeHandles.ts +6 -21
- package/src/components/data-table/types.ts +15 -155
- package/src/components/data-table/utils.ts +1 -75
- package/src/components/date-range-field/utils/validity.ts +1 -21
- package/src/components/editable/editable.variants.ts +1 -1
- package/src/components/file-upload/utils/select.ts +1 -58
- package/src/components/file-upload/utils/size.ts +1 -16
- package/src/components/float-button/float-button.variants.ts +1 -1
- package/src/components/form/composables/useForm.ts +24 -135
- package/src/components/form/standard-schema.ts +1 -26
- package/src/components/form/utils/errors.ts +1 -48
- package/src/components/form/utils/focus.ts +1 -10
- package/src/components/form/utils/values.ts +1 -23
- package/src/components/form-field/FormField.vue +3 -2
- package/src/components/lightbox/types.ts +1 -14
- package/src/components/lightbox/utils/clip.ts +1 -117
- package/src/components/lightbox/utils/download.ts +1 -29
- package/src/components/lightbox/utils/gesture.ts +1 -54
- package/src/components/lightbox/utils/paging.ts +1 -33
- package/src/components/lightbox/utils/pose.ts +1 -142
- package/src/components/lightbox/utils/source.ts +1 -17
- package/src/components/lightbox/utils/zoom.ts +1 -127
- package/src/components/meter-group/utils/tones.ts +1 -14
- package/src/components/multi-select/MultiSelect.vue +1 -2
- package/src/components/number-input/NumberInput.vue +2 -2
- package/src/components/pagination/composables/usePagination.ts +2 -3
- package/src/components/pagination/types.ts +1 -19
- package/src/components/pagination/utils/ranges.ts +1 -12
- package/src/components/password-input/PasswordInput.vue +6 -0
- package/src/components/qr-code/export.ts +1 -65
- package/src/components/range-calendar/utils/limit.ts +1 -11
- package/src/components/rating/utils/fill.ts +1 -4
- package/src/components/ripple/useRipple.ts +10 -198
- package/src/components/scroll-area/ScrollArea.vue +6 -18
- package/src/components/scroll-area/composables/useEdgeShadow.ts +7 -16
- package/src/components/scroll-area/composables/useLayerLock.ts +2 -9
- package/src/components/scroll-area/composables/useWheelRedirect.ts +2 -10
- package/src/components/scroll-area/scroll-restore.ts +1 -148
- package/src/components/search-input/SearchInput.vue +6 -0
- package/src/components/select/types.ts +1 -23
- package/src/components/split-button/split-button.variants.ts +1 -1
- package/src/components/spoiler/SpoilerPainter.ts +1 -197
- package/src/components/spoiler/utils/irisOrigin.ts +1 -40
- package/src/components/spoiler/worklet.ts +1 -199
- package/src/components/table/Table.vue +9 -0
- package/src/components/tabs/TabsList.vue +9 -0
- package/src/components/time/utils/relativeTime.ts +1 -20
- package/src/components/toast/composables/useToastLayout.ts +12 -24
- package/src/components/toast/store.ts +16 -228
- package/src/components/tree/composables/useTree.ts +17 -33
- package/src/components/tree/types.ts +1 -20
- package/src/components/tree/utils/selection.ts +1 -78
- package/src/components/tree-select/types.ts +1 -34
- package/src/components/tree-select/utils/filterTree.ts +1 -19
- package/src/components/virtual-list/composables/useVirtualList.ts +16 -42
- package/src/components/visually-hidden/VisuallyHidden.vue +21 -3
- package/src/lib/caret.ts +1 -48
- package/src/lib/collapse.ts +6 -29
- package/src/lib/date.ts +1 -111
- package/src/lib/field-focus.ts +1 -36
- package/src/lib/overlay-anchor.ts +11 -37
- package/src/lib/pointer-corridor.ts +1 -26
- package/src/lib/reka/useVirtualChoices.ts +55 -133
- package/src/lib/reka/useVirtualTree.ts +22 -65
- package/src/lib/virtual/navigation.ts +1 -26
- package/src/lib/virtual/useVirtualCollection.ts +28 -47
- package/src/lib/virtual/useVirtualWindow.ts +15 -25
- package/src/locale/en-US.ts +1 -220
- package/src/locale/index.ts +9 -53
- package/src/locale/types.ts +1 -225
- package/src/locale/zh-CN.ts +1 -215
- package/src/primitives/number-field/LICENSE +21 -0
- package/src/primitives/number-field/NumberFieldDecrement.vue +21 -0
- package/src/primitives/number-field/NumberFieldIncrement.vue +21 -0
- package/src/primitives/number-field/NumberFieldInput.vue +114 -0
- package/src/primitives/number-field/NumberFieldRoot.vue +169 -0
- package/src/primitives/number-field/context.ts +111 -0
- package/src/primitives/number-field/index.ts +14 -0
- package/src/primitives/utils/LICENSE +44 -0
- package/src/primitives/utils/timers.ts +6 -0
- package/src/primitives/utils/usePrimitiveElement.ts +12 -0
- package/src/primitives/utils/useVModel.ts +37 -0
- package/src/primitives/visually-hidden/LICENSE +21 -0
- package/src/primitives/visually-hidden/VisuallyHiddenInput.ts +97 -0
- package/src/primitives/visually-hidden/VisuallyHiddenInputBubble.vue +49 -0
|
@@ -1,142 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Corners } from './clip'
|
|
3
|
-
import { fitSize, rotatedSize, type Size } from './zoom'
|
|
4
|
-
|
|
5
|
-
export interface Rect {
|
|
6
|
-
x: number
|
|
7
|
-
y: number
|
|
8
|
-
width: number
|
|
9
|
-
height: number
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface Pose {
|
|
13
|
-
x: number
|
|
14
|
-
y: number
|
|
15
|
-
scale: number
|
|
16
|
-
rotate: number
|
|
17
|
-
clipPath: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export const REST_POSE: Pose = {
|
|
21
|
-
x: 0,
|
|
22
|
-
y: 0,
|
|
23
|
-
scale: 1,
|
|
24
|
-
rotate: 0,
|
|
25
|
-
clipPath: 'inset(0px 0px 0px 0px round 0px 0px 0px 0px / 0px 0px 0px 0px)',
|
|
26
|
-
}
|
|
27
|
-
export const TRAVEL_SPRING = { type: 'spring', visualDuration: 0.3, bounce: 0 } as const
|
|
28
|
-
export const RETURN_SPRING = { ...TRAVEL_SPRING, visualDuration: 0.22 } as const
|
|
29
|
-
export const DISMISS_SCALE = 0.7
|
|
30
|
-
export const DISMISS_TRAVEL = 0.3
|
|
31
|
-
export const DISMISS_COMMIT = 0.5
|
|
32
|
-
export const DISMISS_VELOCITY = 600
|
|
33
|
-
|
|
34
|
-
function px(value: number): string {
|
|
35
|
-
return `${Math.round(value * 100) / 100}px`
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function fitRect(
|
|
39
|
-
natural: Size,
|
|
40
|
-
stage: Size & Partial<Pick<Rect, 'x' | 'y'>>,
|
|
41
|
-
rotation = 0,
|
|
42
|
-
): Rect {
|
|
43
|
-
const size = fitSize(natural, stage, rotation)
|
|
44
|
-
return {
|
|
45
|
-
x: (stage.x ?? 0) + (stage.width - size.width) / 2,
|
|
46
|
-
y: (stage.y ?? 0) + (stage.height - size.height) / 2,
|
|
47
|
-
width: size.width,
|
|
48
|
-
height: size.height,
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function renderedRect(box: Rect, natural: Size, fit: ImageVariants['fit'] = 'cover'): Rect {
|
|
53
|
-
if (fit === 'fill' || natural.width <= 0 || natural.height <= 0) return { ...box }
|
|
54
|
-
const contain = Math.min(box.width / natural.width, box.height / natural.height)
|
|
55
|
-
const cover = Math.max(box.width / natural.width, box.height / natural.height)
|
|
56
|
-
const scale =
|
|
57
|
-
fit === 'cover'
|
|
58
|
-
? cover
|
|
59
|
-
: fit === 'contain'
|
|
60
|
-
? contain
|
|
61
|
-
: fit === 'none'
|
|
62
|
-
? 1
|
|
63
|
-
: Math.min(contain, 1)
|
|
64
|
-
const width = natural.width * scale
|
|
65
|
-
const height = natural.height * scale
|
|
66
|
-
return {
|
|
67
|
-
x: box.x + (box.width - width) / 2,
|
|
68
|
-
y: box.y + (box.height - height) / 2,
|
|
69
|
-
width,
|
|
70
|
-
height,
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
function intersect(a: Rect, b: Rect): Rect {
|
|
75
|
-
const x = Math.max(a.x, b.x)
|
|
76
|
-
const y = Math.max(a.y, b.y)
|
|
77
|
-
const right = Math.min(a.x + a.width, b.x + b.width)
|
|
78
|
-
const bottom = Math.min(a.y + a.height, b.y + b.height)
|
|
79
|
-
return { x, y, width: Math.max(0, right - x), height: Math.max(0, bottom - y) }
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export function openPose(
|
|
83
|
-
frame: Rect,
|
|
84
|
-
box: Rect,
|
|
85
|
-
natural: Size,
|
|
86
|
-
fit?: ImageVariants['fit'],
|
|
87
|
-
radius: number | Corners = 0,
|
|
88
|
-
clipBox = box,
|
|
89
|
-
): Pose {
|
|
90
|
-
const rendered = renderedRect(box, natural, fit)
|
|
91
|
-
if (frame.width <= 0 || frame.height <= 0 || rendered.width <= 0) return REST_POSE
|
|
92
|
-
const scale = rendered.width / frame.width
|
|
93
|
-
const visible = intersect(intersect(box, clipBox), rendered)
|
|
94
|
-
const top = (visible.y - rendered.y) / scale
|
|
95
|
-
const left = (visible.x - rendered.x) / scale
|
|
96
|
-
const right = (rendered.x + rendered.width - visible.x - visible.width) / scale
|
|
97
|
-
const bottom = (rendered.y + rendered.height - visible.y - visible.height) / scale
|
|
98
|
-
const corners =
|
|
99
|
-
typeof radius === 'number'
|
|
100
|
-
? Array.from({ length: 4 }, () => ({ x: radius, y: radius }))
|
|
101
|
-
: radius
|
|
102
|
-
const leftEdge = Math.abs(visible.x - clipBox.x) <= 0.5
|
|
103
|
-
const topEdge = Math.abs(visible.y - clipBox.y) <= 0.5
|
|
104
|
-
const rightEdge = Math.abs(visible.x + visible.width - clipBox.x - clipBox.width) <= 0.5
|
|
105
|
-
const bottomEdge = Math.abs(visible.y + visible.height - clipBox.y - clipBox.height) <= 0.5
|
|
106
|
-
const touches = [
|
|
107
|
-
leftEdge && topEdge,
|
|
108
|
-
rightEdge && topEdge,
|
|
109
|
-
rightEdge && bottomEdge,
|
|
110
|
-
leftEdge && bottomEdge,
|
|
111
|
-
]
|
|
112
|
-
const clipped = corners.map((corner, index) => (touches[index] ? corner : { x: 0, y: 0 }))
|
|
113
|
-
const horizontal = clipped.map(corner => px(Math.max(0, corner.x) / scale)).join(' ')
|
|
114
|
-
const vertical = clipped.map(corner => px(Math.max(0, corner.y) / scale)).join(' ')
|
|
115
|
-
return {
|
|
116
|
-
x: rendered.x + rendered.width / 2 - (frame.x + frame.width / 2),
|
|
117
|
-
y: rendered.y + rendered.height / 2 - (frame.y + frame.height / 2),
|
|
118
|
-
scale,
|
|
119
|
-
rotate: 0,
|
|
120
|
-
clipPath: `inset(${px(top)} ${px(right)} ${px(bottom)} ${px(left)} round ${horizontal} / ${vertical})`,
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
export function baseScale(frame: Size, stage: Size, rotation: number, natural: Size): number {
|
|
125
|
-
const visual = rotatedSize(frame, rotation)
|
|
126
|
-
if (visual.width <= 0 || visual.height <= 0) return 1
|
|
127
|
-
return Math.min(
|
|
128
|
-
stage.width / visual.width,
|
|
129
|
-
stage.height / visual.height,
|
|
130
|
-
natural.width / frame.width,
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export function dismissProgress(offsetY: number, stageHeight: number): number {
|
|
135
|
-
if (stageHeight <= 0) return 0
|
|
136
|
-
return Math.min(1, Math.max(0, offsetY) / (stageHeight * DISMISS_TRAVEL))
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export function shouldDismiss(offsetY: number, velocityY: number, stageHeight: number): boolean {
|
|
140
|
-
if (offsetY <= 0) return false
|
|
141
|
-
return dismissProgress(offsetY, stageHeight) >= DISMISS_COMMIT || velocityY >= DISMISS_VELOCITY
|
|
142
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/lightbox/pose'
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Rect } from './pose'
|
|
3
|
-
|
|
4
|
-
export function sourceRect(source: LightboxSource | null | undefined): Rect | null {
|
|
5
|
-
if (!source) return null
|
|
6
|
-
const isElement = 'getBoundingClientRect' in source
|
|
7
|
-
if (isElement && !source.isConnected) return null
|
|
8
|
-
const rect = isElement ? source.getBoundingClientRect() : source
|
|
9
|
-
if (
|
|
10
|
-
![rect.x, rect.y, rect.width, rect.height].every(Number.isFinite) ||
|
|
11
|
-
rect.width <= 0 ||
|
|
12
|
-
rect.height <= 0
|
|
13
|
-
) {
|
|
14
|
-
return null
|
|
15
|
-
}
|
|
16
|
-
return { x: rect.x, y: rect.y, width: rect.width, height: rect.height }
|
|
17
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/lightbox/source'
|
|
@@ -1,127 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
width: number
|
|
3
|
-
height: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface Point {
|
|
7
|
-
x: number
|
|
8
|
-
y: number
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface Bounds {
|
|
12
|
-
minX: number
|
|
13
|
-
maxX: number
|
|
14
|
-
minY: number
|
|
15
|
-
maxY: number
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const ZOOM_MIN = 1
|
|
19
|
-
export const ZOOM_MAX = 2
|
|
20
|
-
export const ZOOM_STEP = 1.5
|
|
21
|
-
export const OVERSHOOT = 0.55
|
|
22
|
-
export const WHEEL_INTENSITY = 0.002
|
|
23
|
-
|
|
24
|
-
export const ZOOM_EPSILON = 0.001
|
|
25
|
-
|
|
26
|
-
export function isZoomed(zoom: number): boolean {
|
|
27
|
-
return zoom > ZOOM_MIN + ZOOM_EPSILON
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function rotatedSize(size: Size, rotation: number): Size {
|
|
31
|
-
const quarter = Math.round(rotation / 90) % 2
|
|
32
|
-
return quarter === 0 ? size : { width: size.height, height: size.width }
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function fitSize(natural: Size, stage: Size, rotation = 0): Size {
|
|
36
|
-
const upright = rotatedSize(natural, rotation)
|
|
37
|
-
if (upright.width <= 0 || upright.height <= 0) return { width: 0, height: 0 }
|
|
38
|
-
const scale = Math.min(1, stage.width / upright.width, stage.height / upright.height)
|
|
39
|
-
return { width: upright.width * scale, height: upright.height * scale }
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function panBounds(displayed: Size, stage: Size): Bounds {
|
|
43
|
-
const x = Math.max(0, (displayed.width - stage.width) / 2)
|
|
44
|
-
const y = Math.max(0, (displayed.height - stage.height) / 2)
|
|
45
|
-
return { minX: x ? -x : 0, maxX: x, minY: y ? -y : 0, maxY: y }
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function clampOffset(offset: Point, bounds: Bounds): Point {
|
|
49
|
-
return {
|
|
50
|
-
x: Math.min(Math.max(offset.x, bounds.minX), bounds.maxX),
|
|
51
|
-
y: Math.min(Math.max(offset.y, bounds.minY), bounds.maxY),
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function zoomAbout(offset: Point, zoom: number, next: number, focal: Point): Point {
|
|
56
|
-
const ratio = next / zoom
|
|
57
|
-
return {
|
|
58
|
-
x: focal.x - (focal.x - offset.x) * ratio,
|
|
59
|
-
y: focal.y - (focal.y - offset.y) * ratio,
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function resist(over: number, span: number, coefficient: number): number {
|
|
64
|
-
return (1 - 1 / ((over * coefficient) / span + 1)) * span
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function rubberBand(
|
|
68
|
-
value: number,
|
|
69
|
-
min: number,
|
|
70
|
-
max: number,
|
|
71
|
-
span: number,
|
|
72
|
-
coefficient = OVERSHOOT,
|
|
73
|
-
): number {
|
|
74
|
-
if (span <= 0) return Math.min(Math.max(value, min), max)
|
|
75
|
-
if (value > max) return max + resist(value - max, span, coefficient)
|
|
76
|
-
if (value < min) return min - resist(min - value, span, coefficient)
|
|
77
|
-
return value
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function elasticOffset(offset: Point, bounds: Bounds, stage: Size): Point {
|
|
81
|
-
return {
|
|
82
|
-
x: rubberBand(offset.x, bounds.minX, bounds.maxX, stage.width),
|
|
83
|
-
y: rubberBand(offset.y, bounds.minY, bounds.maxY, stage.height),
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function clampZoom(zoom: number, min = ZOOM_MIN, max = ZOOM_MAX): number {
|
|
88
|
-
return Math.min(Math.max(zoom, min), max)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function elasticZoom(zoom: number, min = ZOOM_MIN, max = ZOOM_MAX): number {
|
|
92
|
-
const lo = Math.log(min)
|
|
93
|
-
const hi = Math.log(max)
|
|
94
|
-
return Math.exp(rubberBand(Math.log(zoom), lo, hi, hi - lo))
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function pinchZoom(startZoom: number, startDistance: number, distance: number): number {
|
|
98
|
-
if (startDistance <= 0) return startZoom
|
|
99
|
-
return startZoom * (distance / startDistance)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function wheelZoom(zoom: number, deltaY: number, intensity = WHEEL_INTENSITY): number {
|
|
103
|
-
return zoom * Math.exp(-deltaY * intensity)
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function zoomLevels(natural: Size, fit: Size, stage: Size) {
|
|
107
|
-
const original = fit.width > 0 ? Math.max(ZOOM_MIN, natural.width / fit.width) : ZOOM_MIN
|
|
108
|
-
const secondary =
|
|
109
|
-
natural.height > natural.width * 2
|
|
110
|
-
? Math.min(original, stage.width / fit.width)
|
|
111
|
-
: natural.width > natural.height * 2
|
|
112
|
-
? Math.min(original, stage.height / fit.height)
|
|
113
|
-
: original
|
|
114
|
-
return {
|
|
115
|
-
original,
|
|
116
|
-
secondary: Number.isFinite(secondary) ? Math.max(ZOOM_MIN, secondary) : ZOOM_MIN,
|
|
117
|
-
max: original * ZOOM_MAX,
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export function doubleTapZoom(zoom: number, secondary: number): number {
|
|
122
|
-
return isZoomed(zoom) ? ZOOM_MIN : secondary
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function stepZoom(zoom: number, direction: 1 | -1, max = ZOOM_MAX): number {
|
|
126
|
-
return clampZoom(zoom * ZOOM_STEP ** direction, ZOOM_MIN, max)
|
|
127
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/lightbox/zoom'
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const METER_TONES: MeterTone[] = [
|
|
4
|
-
'accent',
|
|
5
|
-
'info',
|
|
6
|
-
'success',
|
|
7
|
-
'warning',
|
|
8
|
-
'danger',
|
|
9
|
-
'neutral',
|
|
10
|
-
]
|
|
11
|
-
|
|
12
|
-
export function toneAt(index: number): MeterTone {
|
|
13
|
-
return METER_TONES[index % METER_TONES.length]!
|
|
14
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/meter-group'
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts" generic="T extends SelectOption = SelectOption">
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
|
-
import { SelectRoot, SelectTrigger } from 'reka-ui'
|
|
3
|
+
import { SelectRoot, SelectTrigger, VisuallyHidden } from 'reka-ui'
|
|
4
4
|
import { cn } from '../../lib/cn'
|
|
5
5
|
import type { VirtualizeOptions } from '../../lib/virtual/types'
|
|
6
6
|
import { useUiLocale } from '../../locale'
|
|
7
7
|
import Chip from '../chip/Chip.vue'
|
|
8
|
-
import VisuallyHidden from '../visually-hidden/VisuallyHidden.vue'
|
|
9
8
|
import { X } from '@lucide/vue'
|
|
10
9
|
import InputAction from '../input/InputAction.vue'
|
|
11
10
|
import DisclosureIcon from '../disclosure-icon/DisclosureIcon.vue'
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { ChevronDown, ChevronUp } from '@lucide/vue'
|
|
4
|
+
import { useForwardPropsEmits } from 'reka-ui'
|
|
4
5
|
import {
|
|
5
6
|
NumberFieldDecrement,
|
|
6
7
|
NumberFieldIncrement,
|
|
7
8
|
NumberFieldInput,
|
|
8
9
|
NumberFieldRoot,
|
|
9
|
-
useForwardPropsEmits,
|
|
10
10
|
type NumberFieldRootEmits,
|
|
11
|
-
} from '
|
|
11
|
+
} from '../../primitives/number-field'
|
|
12
12
|
import { cn } from '../../lib/cn'
|
|
13
13
|
import { useUiLocale } from '../../locale'
|
|
14
14
|
import { useFieldControl } from '../form-field/context'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, watch, type Ref } from 'vue'
|
|
2
|
+
import { paginationInteger } from '../../../../../shared/src/lib/pagination'
|
|
2
3
|
import type { PaginationChange, PaginationState } from '../types'
|
|
3
4
|
|
|
4
5
|
interface PaginationOptions {
|
|
@@ -10,9 +11,7 @@ interface PaginationOptions {
|
|
|
10
11
|
pending?: boolean
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export
|
|
14
|
-
return Number.isFinite(value) ? Math.max(minimum, Math.floor(value)) : fallback
|
|
15
|
-
}
|
|
14
|
+
export { paginationInteger }
|
|
16
15
|
|
|
17
16
|
export function usePagination(
|
|
18
17
|
props: PaginationOptions,
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
page: number
|
|
3
|
-
pageSize: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export interface PaginationState extends PaginationChange {
|
|
7
|
-
total: number
|
|
8
|
-
pageCount: number
|
|
9
|
-
from: number
|
|
10
|
-
to: number
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type PaginationEntry = { type: 'page'; value: number } | { type: 'ellipsis' }
|
|
14
|
-
export type PaginationSide = 'prev' | 'next'
|
|
15
|
-
export interface PaginationRange {
|
|
16
|
-
side: PaginationSide
|
|
17
|
-
from: number
|
|
18
|
-
to: number
|
|
19
|
-
}
|
|
1
|
+
export * from '../../../../shared/src/types/pagination'
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function paginationRanges(items: PaginationEntry[]): PaginationRange[] {
|
|
4
|
-
return items.flatMap((item, index) => {
|
|
5
|
-
if (item.type !== 'ellipsis') return []
|
|
6
|
-
const previous = items[index - 1]
|
|
7
|
-
const next = items[index + 1]
|
|
8
|
-
if (previous?.type !== 'page' || next?.type !== 'page' || next.value <= previous.value + 1)
|
|
9
|
-
return []
|
|
10
|
-
return [{ side: index === 1 ? 'prev' : 'next', from: previous.value + 1, to: next.value - 1 }]
|
|
11
|
-
})
|
|
12
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/pagination'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { shallowRef } from 'vue'
|
|
2
3
|
import { Eye, EyeOff } from '@lucide/vue'
|
|
3
4
|
import { cn } from '../../lib/cn'
|
|
4
5
|
import { useUiLocale } from '../../locale'
|
|
@@ -20,10 +21,15 @@
|
|
|
20
21
|
const visible = defineModel<boolean>('visible', { default: false })
|
|
21
22
|
|
|
22
23
|
const t = useUiLocale()
|
|
24
|
+
|
|
25
|
+
const base = shallowRef<InstanceType<typeof InputBase> | null>(null)
|
|
26
|
+
|
|
27
|
+
defineExpose({ clear: () => base.value?.clear(), focus: () => base.value?.focus() })
|
|
23
28
|
</script>
|
|
24
29
|
|
|
25
30
|
<template>
|
|
26
31
|
<InputBase
|
|
32
|
+
ref="base"
|
|
27
33
|
v-bind="$attrs"
|
|
28
34
|
v-model="model"
|
|
29
35
|
:type="visible ? 'text' : 'password'"
|
|
@@ -1,65 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function dataURL(blob: Blob): Promise<string> {
|
|
4
|
-
return new Promise((resolve, reject) => {
|
|
5
|
-
const reader = new FileReader()
|
|
6
|
-
reader.onload = () => resolve(reader.result as string)
|
|
7
|
-
reader.onerror = () => reject(reader.error)
|
|
8
|
-
reader.readAsDataURL(blob)
|
|
9
|
-
})
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export async function exportQRCode(
|
|
13
|
-
svg: SVGSVGElement,
|
|
14
|
-
size: number,
|
|
15
|
-
{ type = 'image/png', scale = 2 }: QRCodeExportOptions = {},
|
|
16
|
-
): Promise<Blob> {
|
|
17
|
-
const clone = svg.cloneNode(true) as SVGSVGElement
|
|
18
|
-
const source = [svg, ...svg.querySelectorAll('*')]
|
|
19
|
-
const target = [clone, ...clone.querySelectorAll('*')]
|
|
20
|
-
target.forEach((el, index) => {
|
|
21
|
-
const style = getComputedStyle(source[index]!)
|
|
22
|
-
el.removeAttribute('class')
|
|
23
|
-
el.removeAttribute('style')
|
|
24
|
-
el.setAttribute('fill', style.fill)
|
|
25
|
-
})
|
|
26
|
-
clone.setAttribute('xmlns', 'http://www.w3.org/2000/svg')
|
|
27
|
-
clone.setAttribute('width', String(size))
|
|
28
|
-
clone.setAttribute('height', String(size))
|
|
29
|
-
for (const image of clone.querySelectorAll('image')) {
|
|
30
|
-
const href = image.getAttribute('href')
|
|
31
|
-
if (!href) continue
|
|
32
|
-
let embedded = href
|
|
33
|
-
if (!href.startsWith('data:')) {
|
|
34
|
-
const response = await fetch(new URL(href, svg.ownerDocument.baseURI))
|
|
35
|
-
if (!response.ok) throw new Error('Unable to export the QR code logo')
|
|
36
|
-
embedded = await dataURL(await response.blob())
|
|
37
|
-
}
|
|
38
|
-
const decoded = new Image()
|
|
39
|
-
decoded.src = embedded
|
|
40
|
-
await decoded.decode()
|
|
41
|
-
image.setAttribute('href', embedded)
|
|
42
|
-
}
|
|
43
|
-
const blob = new Blob([new XMLSerializer().serializeToString(clone)], { type: 'image/svg+xml' })
|
|
44
|
-
if (type === 'image/svg+xml') return blob
|
|
45
|
-
const url = URL.createObjectURL(blob)
|
|
46
|
-
try {
|
|
47
|
-
const image = new Image()
|
|
48
|
-
image.src = url
|
|
49
|
-
await image.decode()
|
|
50
|
-
const factor = Number.isFinite(scale) ? Math.max(1, Math.min(8, scale)) : 2
|
|
51
|
-
const canvas = svg.ownerDocument.createElement('canvas')
|
|
52
|
-
canvas.width = canvas.height = Math.min(8192, Math.round(size * factor))
|
|
53
|
-
const context = canvas.getContext('2d')
|
|
54
|
-
if (!context) throw new Error('Canvas is unavailable')
|
|
55
|
-
context.drawImage(image, 0, 0, canvas.width, canvas.height)
|
|
56
|
-
return await new Promise<Blob>((resolve, reject) => {
|
|
57
|
-
canvas.toBlob(
|
|
58
|
-
result => (result ? resolve(result) : reject(new Error('Unable to export the QR code'))),
|
|
59
|
-
'image/png',
|
|
60
|
-
)
|
|
61
|
-
})
|
|
62
|
-
} finally {
|
|
63
|
-
URL.revokeObjectURL(url)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
export * from '../../../../shared/src/lib/qr-code-export'
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export function maximumDaysMatcher(
|
|
4
|
-
start: DateValue | undefined,
|
|
5
|
-
end: DateValue | undefined,
|
|
6
|
-
maximumDays: number | undefined,
|
|
7
|
-
) {
|
|
8
|
-
if (!start || end || !maximumDays) return undefined
|
|
9
|
-
const reach = maximumDays - 1
|
|
10
|
-
return (date: DateValue) => Math.abs(date.compare(start)) > reach
|
|
11
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/range-calendar/limit'
|