@hina-ui/vue 1.7.4 → 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 +2251 -992
- 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/Anchor.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 +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/composables/useLightboxHint.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/prev-next/PrevNextLink.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/Anchor.vue +13 -9
- package/src/components/anchor/composables/useAnchor.ts +3 -12
- package/src/components/anchor/composables/useAnchorFollow.ts +10 -63
- 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/composables/useLightboxHint.ts +6 -1
- 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/prev-next/PrevNext.vue +1 -1
- package/src/components/prev-next/PrevNextLink.vue +1 -1
- 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,23 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
value: string | number
|
|
3
|
-
label: string
|
|
4
|
-
description?: string
|
|
5
|
-
disabled?: boolean
|
|
6
|
-
} & T
|
|
7
|
-
|
|
8
|
-
export interface SelectOptionGroup<T extends SelectOption = SelectOption> {
|
|
9
|
-
label: string
|
|
10
|
-
options: T[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type SelectItems<T extends SelectOption = SelectOption> = Array<T | SelectOptionGroup<T>>
|
|
14
|
-
|
|
15
|
-
export function isOptionGroup<T extends SelectOption>(
|
|
16
|
-
item: T | SelectOptionGroup<T>,
|
|
17
|
-
): item is SelectOptionGroup<T> {
|
|
18
|
-
return !('value' in item) && 'options' in item
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function flattenOptions<T extends SelectOption>(items: SelectItems<T>): T[] {
|
|
22
|
-
return items.flatMap(item => (isOptionGroup(item) ? item.options : [item]))
|
|
23
|
-
}
|
|
1
|
+
export * from '../../../../shared/src/types/select'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../../../../shared/src/variants/split-button'
|
|
@@ -1,197 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { prefersReducedMotion } from '../../motion'
|
|
3
|
-
|
|
4
|
-
export const isPaintWorkletSupported =
|
|
5
|
-
typeof CSS !== 'undefined' && (CSS as { paintWorklet?: unknown }).paintWorklet !== undefined
|
|
6
|
-
|
|
7
|
-
let workletRegistered = false
|
|
8
|
-
|
|
9
|
-
export function registerSpoilerWorklet() {
|
|
10
|
-
if (workletRegistered || !isPaintWorkletSupported) return
|
|
11
|
-
workletRegistered = true
|
|
12
|
-
const paintWorklet = (CSS as unknown as { paintWorklet: { addModule(url: string): void } })
|
|
13
|
-
.paintWorklet
|
|
14
|
-
paintWorklet.addModule(
|
|
15
|
-
URL.createObjectURL(new Blob([workletSource], { type: 'application/javascript' })),
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface SpoilerPainterOptions {
|
|
20
|
-
fps?: number
|
|
21
|
-
gap?: number
|
|
22
|
-
density?: number
|
|
23
|
-
mimicWords?: boolean
|
|
24
|
-
accent?: string
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const DEFAULTS = {
|
|
28
|
-
fps: 24,
|
|
29
|
-
gap: 6,
|
|
30
|
-
density: 0.12,
|
|
31
|
-
mimicWords: true,
|
|
32
|
-
accent: '0 0% 20%',
|
|
33
|
-
} as const
|
|
34
|
-
|
|
35
|
-
const BLOCK_MAX_TILE = 293
|
|
36
|
-
const INLINE_MAX_TILE = 333
|
|
37
|
-
const GAP_RATIO = 8
|
|
38
|
-
const DEFAULT_FADE_S = 1.5
|
|
39
|
-
|
|
40
|
-
export class SpoilerPainter {
|
|
41
|
-
readonly el: HTMLElement
|
|
42
|
-
maxFPS: number = DEFAULTS.fps
|
|
43
|
-
|
|
44
|
-
private t = 0
|
|
45
|
-
private t0 = 0
|
|
46
|
-
private tstop: number | null = null
|
|
47
|
-
private raf: number | null = null
|
|
48
|
-
private fadeS = 0
|
|
49
|
-
private hidden = false
|
|
50
|
-
private destroyed = false
|
|
51
|
-
|
|
52
|
-
constructor(el: HTMLElement, options: SpoilerPainterOptions = {}) {
|
|
53
|
-
registerSpoilerWorklet()
|
|
54
|
-
this.el = el
|
|
55
|
-
this.update(options)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get isHidden() {
|
|
59
|
-
return this.hidden
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
update({
|
|
63
|
-
fps = DEFAULTS.fps,
|
|
64
|
-
gap = DEFAULTS.gap,
|
|
65
|
-
density = DEFAULTS.density,
|
|
66
|
-
mimicWords = DEFAULTS.mimicWords,
|
|
67
|
-
accent = DEFAULTS.accent,
|
|
68
|
-
}: SpoilerPainterOptions = {}) {
|
|
69
|
-
if (this.destroyed) return
|
|
70
|
-
|
|
71
|
-
this.maxFPS = prefersReducedMotion() ? 0 : fps
|
|
72
|
-
|
|
73
|
-
this.el.style.setProperty('--hn-nz-density', String(density))
|
|
74
|
-
this.el.style.setProperty('--hn-nz-accent', accent)
|
|
75
|
-
|
|
76
|
-
const isBlockElement = getComputedStyle(this.el).getPropertyValue('display') !== 'inline'
|
|
77
|
-
this.useBackgroundStyle('auto', 'auto', false)
|
|
78
|
-
|
|
79
|
-
if (isBlockElement) {
|
|
80
|
-
this.el.style.setProperty('--hn-nz-words', 'false')
|
|
81
|
-
const rect = this.el.getBoundingClientRect()
|
|
82
|
-
|
|
83
|
-
if (rect.width * rect.height > BLOCK_MAX_TILE * BLOCK_MAX_TILE) {
|
|
84
|
-
this.useBackgroundStyle(
|
|
85
|
-
Math.min(rect.width, BLOCK_MAX_TILE),
|
|
86
|
-
Math.min(rect.height, BLOCK_MAX_TILE),
|
|
87
|
-
true,
|
|
88
|
-
)
|
|
89
|
-
} else {
|
|
90
|
-
const capGap = Math.floor(Math.min(gap, rect.width / GAP_RATIO, rect.height / GAP_RATIO))
|
|
91
|
-
this.el.style.setProperty('--hn-nz-gap', `${capGap}px ${capGap}px`)
|
|
92
|
-
}
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
this.el.style.setProperty('--hn-nz-words', String(mimicWords))
|
|
97
|
-
const rects = [...this.el.getClientRects()]
|
|
98
|
-
const heightOfLine = Math.min(...rects.map(r => r.height))
|
|
99
|
-
|
|
100
|
-
this.useBackgroundStyle(INLINE_MAX_TILE, heightOfLine, true)
|
|
101
|
-
const capGap = Math.floor(Math.min(heightOfLine / GAP_RATIO, gap))
|
|
102
|
-
this.el.style.setProperty('--hn-nz-gap', `0 ${capGap}px`)
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
private useBackgroundStyle(ws: string | number, hs: string | number, tile: boolean) {
|
|
106
|
-
const w = typeof ws === 'number' ? `${ws}px` : ws
|
|
107
|
-
const h = typeof hs === 'number' ? `${hs}px` : hs
|
|
108
|
-
const repeatAndPosition = tile ? 'repeat left center' : 'no-repeat center center'
|
|
109
|
-
this.el.style.background = `paint(hn-spoiler) ${repeatAndPosition} / ${w} ${h}`
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
private setFade(value: number) {
|
|
113
|
-
this.fadeS = value
|
|
114
|
-
this.el.style.setProperty('--hn-nz-fade', `${value}s`)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
private setT(value: number) {
|
|
118
|
-
this.t = value
|
|
119
|
-
this.el.style.setProperty('--hn-nz-t', value.toFixed(3))
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
private setTstop(value: number | null) {
|
|
123
|
-
this.tstop = value
|
|
124
|
-
if (value !== null) {
|
|
125
|
-
this.el.style.setProperty('--hn-nz-stop', value.toFixed(3))
|
|
126
|
-
} else {
|
|
127
|
-
this.el.style.removeProperty('--hn-nz-stop')
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
private parseFade(value: number | boolean | undefined) {
|
|
132
|
-
if (this.maxFPS <= 0) return 0
|
|
133
|
-
return value === true || value === undefined ? DEFAULT_FADE_S : Number(value)
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
hide(animate?: number | boolean) {
|
|
137
|
-
if (this.destroyed) return
|
|
138
|
-
this.hidden = true
|
|
139
|
-
this.setFade(this.parseFade(animate))
|
|
140
|
-
this.setTstop(null)
|
|
141
|
-
this.setT(0)
|
|
142
|
-
this.startAnimation()
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
reveal(animate?: number | boolean) {
|
|
146
|
-
if (this.destroyed) return
|
|
147
|
-
this.hidden = false
|
|
148
|
-
const duration = this.parseFade(animate)
|
|
149
|
-
this.setFade(duration)
|
|
150
|
-
this.setTstop(this.t)
|
|
151
|
-
if (duration <= 0) this.stopAnimation()
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
private frame = (now: DOMHighResTimeStamp) => {
|
|
155
|
-
if (this.destroyed) return
|
|
156
|
-
const shouldStop = this.tstop !== null && this.t > this.tstop + this.fadeS
|
|
157
|
-
|
|
158
|
-
if (this.maxFPS > 0 && !shouldStop) {
|
|
159
|
-
this.raf = requestAnimationFrame(this.frame)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
const dt = now - this.t0
|
|
163
|
-
if (dt > 0 && dt < 1000 / this.maxFPS) return
|
|
164
|
-
|
|
165
|
-
this.setT(this.t + dt / 1000)
|
|
166
|
-
this.t0 = now
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
private startAnimation() {
|
|
170
|
-
this.t0 = performance.now()
|
|
171
|
-
this.frame(this.t0)
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private stopAnimation() {
|
|
175
|
-
if (this.raf !== null) {
|
|
176
|
-
cancelAnimationFrame(this.raf)
|
|
177
|
-
this.raf = null
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
destroy() {
|
|
182
|
-
this.destroyed = true
|
|
183
|
-
this.stopAnimation()
|
|
184
|
-
this.el.style.removeProperty('background')
|
|
185
|
-
for (const prop of [
|
|
186
|
-
'--hn-nz-t',
|
|
187
|
-
'--hn-nz-stop',
|
|
188
|
-
'--hn-nz-fade',
|
|
189
|
-
'--hn-nz-gap',
|
|
190
|
-
'--hn-nz-words',
|
|
191
|
-
'--hn-nz-density',
|
|
192
|
-
'--hn-nz-accent',
|
|
193
|
-
]) {
|
|
194
|
-
this.el.style.removeProperty(prop)
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
1
|
+
export * from '../../../../shared/src/behavior/spoiler/painter'
|
|
@@ -1,40 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
x: number
|
|
3
|
-
y: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export function irisOrigin(
|
|
7
|
-
rects: readonly DOMRect[],
|
|
8
|
-
clientX: number,
|
|
9
|
-
clientY: number,
|
|
10
|
-
): IrisOrigin | null {
|
|
11
|
-
const valid = rects.filter(r => r.width > 0 && r.height > 0)
|
|
12
|
-
if (valid.length === 0) return null
|
|
13
|
-
|
|
14
|
-
const totalWidth = valid.reduce((sum, r) => sum + r.width, 0)
|
|
15
|
-
const lineHeight = valid[0]!.height
|
|
16
|
-
|
|
17
|
-
let virtualX: number | null = null
|
|
18
|
-
let virtualY = 0
|
|
19
|
-
let walked = 0
|
|
20
|
-
for (const r of valid) {
|
|
21
|
-
const inside =
|
|
22
|
-
clientY >= r.top - 2 &&
|
|
23
|
-
clientY <= r.bottom + 2 &&
|
|
24
|
-
clientX >= r.left - 2 &&
|
|
25
|
-
clientX <= r.right + 2
|
|
26
|
-
if (inside) {
|
|
27
|
-
virtualX = walked + (clientX - r.left)
|
|
28
|
-
virtualY = clientY - r.top
|
|
29
|
-
break
|
|
30
|
-
}
|
|
31
|
-
walked += r.width
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (virtualX === null || totalWidth === 0 || lineHeight === 0) return null
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
x: (virtualX / totalWidth) * 100,
|
|
38
|
-
y: (virtualY / lineHeight) * 100,
|
|
39
|
-
}
|
|
40
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/iris-origin'
|
|
@@ -1,199 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const workletMain = () => {
|
|
4
|
-
const M = Math
|
|
5
|
-
|
|
6
|
-
const lcgrand =
|
|
7
|
-
(seed = 1) =>
|
|
8
|
-
(a = 0, b = 1) =>
|
|
9
|
-
a +
|
|
10
|
-
(M.abs(b - a) * (M.imul(48271, (seed = M.imul(214013, seed) + 2531011)) & 0x7fffffff)) /
|
|
11
|
-
0x7fffffff
|
|
12
|
-
|
|
13
|
-
const pol2vec = (l: number, a = 0) => [l * M.cos(a), l * M.sin(a)] as const
|
|
14
|
-
const vecmag = ([x, y]: readonly number[]) => M.sqrt(x! * x! + y! * y!)
|
|
15
|
-
const vecnorm = ([x, y]: readonly number[], l = vecmag([x!, y!])) =>
|
|
16
|
-
l === 0 ? ([0, 0] as const) : ([x! / l, y! / l] as const)
|
|
17
|
-
|
|
18
|
-
const trapezoidalWave = (l: number, a: number, b: number) => {
|
|
19
|
-
const s = M.max(a, l - b)
|
|
20
|
-
return (t: number) => {
|
|
21
|
-
if (t < a) return M.max(0, t / a)
|
|
22
|
-
if (t > s) return M.max(0, 1 - (t - s) / (l - s))
|
|
23
|
-
return 1
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const cycle = (x: number, n: number) => ((x % n) + n) % n
|
|
28
|
-
const mirror = (x: number, n: number, r: number) => (x < r ? n + x : x > n - r ? x - n : x)
|
|
29
|
-
const clamp = (min: number, x: number, max: number) => M.max(min, M.min(x, max))
|
|
30
|
-
|
|
31
|
-
const cycleBounds = ([x, y]: readonly number[], [w, h]: readonly number[], r: number) => {
|
|
32
|
-
const tx = cycle(x!, w!)
|
|
33
|
-
const ty = cycle(y!, h!)
|
|
34
|
-
return [
|
|
35
|
-
[tx, ty],
|
|
36
|
-
[mirror(tx, w!, r), mirror(ty, h!, r)],
|
|
37
|
-
] as const
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const easeOutCubic = (t: number) => --t * t * t + 1
|
|
41
|
-
|
|
42
|
-
type World = { t: number; tStop: number; tStart: number; n: number }
|
|
43
|
-
|
|
44
|
-
const animateFadeInOut = (world: World, idx: number, duration: number) => {
|
|
45
|
-
const direction = world.tStop <= world.t ? 'out' : 'in'
|
|
46
|
-
const animationStartT = direction === 'in' ? world.tStart : world.tStop
|
|
47
|
-
const t = animationStartT + ((2 / 3) * duration * idx) / world.n
|
|
48
|
-
const fadeFor = (1 / 3) * duration
|
|
49
|
-
|
|
50
|
-
let progress = 0
|
|
51
|
-
if (direction === 'in') {
|
|
52
|
-
progress = (fadeFor + t - world.t) / fadeFor || 0
|
|
53
|
-
} else {
|
|
54
|
-
progress = (world.t - t) / fadeFor || 1
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return easeOutCubic(1 - clamp(0, progress, 1))
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const FAKE_WORDS = [5, 3, 4, 4, 2, 4, 7, 6, 8, 6, 3, 1, 6]
|
|
61
|
-
|
|
62
|
-
const makeWordDistribution = (line: number, em: number, space: number) => {
|
|
63
|
-
let marker = 0
|
|
64
|
-
let i = 0
|
|
65
|
-
let wordslen = 0
|
|
66
|
-
const chunks: [number, number][] = []
|
|
67
|
-
|
|
68
|
-
do {
|
|
69
|
-
const endOfWord = M.min(line, marker + FAKE_WORDS[i++ % FAKE_WORDS.length]! * em)
|
|
70
|
-
wordslen += endOfWord - marker
|
|
71
|
-
chunks.push([marker, (marker = endOfWord)])
|
|
72
|
-
} while ((marker += space) < line)
|
|
73
|
-
|
|
74
|
-
if (chunks.length >= 0) chunks[chunks.length - 1]![1] = line
|
|
75
|
-
|
|
76
|
-
return (t: number) => {
|
|
77
|
-
const w = t * wordslen
|
|
78
|
-
let m = 0
|
|
79
|
-
for (const [start, end] of chunks) {
|
|
80
|
-
const wordLength = end - start
|
|
81
|
-
if (m < w && w <= m + wordLength) return start + w - m
|
|
82
|
-
m += wordLength
|
|
83
|
-
}
|
|
84
|
-
return 0
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const getVar = (props: { get(name: string): unknown }, name: string) => {
|
|
89
|
-
const val = props.get(name)
|
|
90
|
-
if (typeof val === 'string') return val
|
|
91
|
-
return String(val ?? '')
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
class HnSpoilerWorklet {
|
|
95
|
-
static get contextOptions() {
|
|
96
|
-
return { alpha: true }
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
static get inputProperties() {
|
|
100
|
-
return [
|
|
101
|
-
'--hn-nz-t',
|
|
102
|
-
'--hn-nz-stop',
|
|
103
|
-
'--hn-nz-fade',
|
|
104
|
-
'--hn-nz-gap',
|
|
105
|
-
'--hn-nz-accent',
|
|
106
|
-
'--hn-nz-words',
|
|
107
|
-
'--hn-nz-density',
|
|
108
|
-
]
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
paint(
|
|
112
|
-
ctx: CanvasRenderingContext2D,
|
|
113
|
-
size: { width: number; height: number },
|
|
114
|
-
props: { get(name: string): unknown },
|
|
115
|
-
) {
|
|
116
|
-
const rand = lcgrand(4011505)
|
|
117
|
-
|
|
118
|
-
const accent = (getVar(props, '--hn-nz-accent') || '0 0% 0%').split(' ')
|
|
119
|
-
const mimicWords = getVar(props, '--hn-nz-words').trim() === 'true'
|
|
120
|
-
const vmin = 2
|
|
121
|
-
const vmax = 12
|
|
122
|
-
const width = size.width
|
|
123
|
-
const height = size.height
|
|
124
|
-
const gaps = (getVar(props, '--hn-nz-gap') || '0px 0px').split(' ').map(parseFloat)
|
|
125
|
-
const hgap = gaps[0] ?? 0
|
|
126
|
-
const vgap = gaps[1] ?? 0
|
|
127
|
-
const density = parseFloat(getVar(props, '--hn-nz-density')) || 0.08
|
|
128
|
-
const sizedev = (globalThis as { devicePixelRatio?: number }).devicePixelRatio! > 1 ? 0.5 : 0
|
|
129
|
-
const fadeDuration = parseFloat(getVar(props, '--hn-nz-fade')) || 0
|
|
130
|
-
|
|
131
|
-
const world: World = {
|
|
132
|
-
t: parseFloat(getVar(props, '--hn-nz-t') || '0'),
|
|
133
|
-
tStop: parseFloat(getVar(props, '--hn-nz-stop') || 'Infinity'),
|
|
134
|
-
tStart: 0,
|
|
135
|
-
n: M.round(M.min(5000, density * (width - 2 * hgap) * (height - 2 * vgap))),
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const lineWidth = width - 2 * hgap
|
|
139
|
-
const lineHeight = height - 2 * vgap
|
|
140
|
-
|
|
141
|
-
const wordDist = mimicWords
|
|
142
|
-
? makeWordDistribution(lineWidth, lineHeight, M.max(12, lineHeight / 4))
|
|
143
|
-
: (x: number) => x * (width - 2 * hgap)
|
|
144
|
-
|
|
145
|
-
ctx.clearRect(0, 0, size.width, size.height)
|
|
146
|
-
|
|
147
|
-
for (let i = 0; i < world.n; ++i) {
|
|
148
|
-
const x0 = hgap + wordDist(rand())
|
|
149
|
-
const y0 = rand(vgap, height - vgap)
|
|
150
|
-
const v0mag = rand(vmin, vmax)
|
|
151
|
-
const size0 = rand(1, 1 + sizedev)
|
|
152
|
-
|
|
153
|
-
const l = parseInt(accent[2] ?? '0')
|
|
154
|
-
const ldir = l > 50 ? -1 : 1
|
|
155
|
-
const lightness = M.floor(clamp(0, l + ldir * rand(0, 30), 100))
|
|
156
|
-
|
|
157
|
-
const v0 = pol2vec(v0mag, rand(0, M.PI * 2))
|
|
158
|
-
const vx0 = v0[0]
|
|
159
|
-
const vy0 = v0[1]
|
|
160
|
-
vecnorm(v0)
|
|
161
|
-
|
|
162
|
-
const shape = rand() > 0.5 ? 'square' : 'circle'
|
|
163
|
-
const lifetime = rand(0.3, 1.5)
|
|
164
|
-
const respawn = rand(0, 1)
|
|
165
|
-
const visibilityFn = trapezoidalWave(lifetime, 0.15, 0.3)
|
|
166
|
-
const phase = rand(0, lifetime + respawn)
|
|
167
|
-
|
|
168
|
-
const cantSpawnNoMore =
|
|
169
|
-
M.floor((world.tStop + phase) / (lifetime + respawn)) <
|
|
170
|
-
M.floor((world.t + phase) / (lifetime + respawn))
|
|
171
|
-
if (cantSpawnNoMore) continue
|
|
172
|
-
|
|
173
|
-
const t = M.min(lifetime, (world.t + phase) % (lifetime + respawn))
|
|
174
|
-
const x = x0 + vx0 * t
|
|
175
|
-
const y = y0 + vy0 * t
|
|
176
|
-
|
|
177
|
-
const fade = animateFadeInOut(world, i, fadeDuration)
|
|
178
|
-
const alpha = fade * (1 - t / lifetime)
|
|
179
|
-
const psize = fade * (size0 * visibilityFn(t))
|
|
180
|
-
|
|
181
|
-
for (const [wx, wy] of cycleBounds([x, y], [width, height], psize / 2)) {
|
|
182
|
-
ctx.beginPath()
|
|
183
|
-
ctx.fillStyle = `hsl(${accent[0]} ${accent[1]} ${lightness}% / ${M.round(alpha * 100)}%)`
|
|
184
|
-
if (shape === 'square') {
|
|
185
|
-
ctx.rect(wx!, wy!, psize, psize)
|
|
186
|
-
} else {
|
|
187
|
-
ctx.arc(wx!, wy!, psize / 2, 0, M.PI * 2)
|
|
188
|
-
}
|
|
189
|
-
ctx.closePath()
|
|
190
|
-
ctx.fill()
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
registerPaint('hn-spoiler', HnSpoilerWorklet)
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export const workletSource = `(${workletMain.toString()})()`
|
|
1
|
+
export * from '../../../../shared/src/behavior/spoiler/worklet'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, shallowRef } from 'vue'
|
|
2
3
|
import ScrollArea from '../scroll-area/ScrollArea.vue'
|
|
3
4
|
import { cn } from '../../lib/cn'
|
|
4
5
|
import { tableWrapper, type TableVariants } from './table.variants'
|
|
@@ -15,10 +16,18 @@
|
|
|
15
16
|
}>(),
|
|
16
17
|
{ variant: 'primary', hover: true, stickyHeader: false },
|
|
17
18
|
)
|
|
19
|
+
|
|
20
|
+
const area = shallowRef<InstanceType<typeof ScrollArea> | null>(null)
|
|
21
|
+
|
|
22
|
+
defineExpose({
|
|
23
|
+
viewport: computed(() => area.value?.viewport),
|
|
24
|
+
instance: computed(() => area.value?.instance),
|
|
25
|
+
})
|
|
18
26
|
</script>
|
|
19
27
|
|
|
20
28
|
<template>
|
|
21
29
|
<ScrollArea
|
|
30
|
+
ref="area"
|
|
22
31
|
:direction="props.stickyHeader ? 'both' : 'horizontal'"
|
|
23
32
|
:class="
|
|
24
33
|
cn(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed, shallowRef } from 'vue'
|
|
2
3
|
import { TabsList } from 'reka-ui'
|
|
3
4
|
import ScrollArea from '../scroll-area/ScrollArea.vue'
|
|
4
5
|
import { cn } from '../../lib/cn'
|
|
@@ -13,10 +14,18 @@
|
|
|
13
14
|
}>()
|
|
14
15
|
|
|
15
16
|
const { variant, orientation } = useTabsStyle()
|
|
17
|
+
|
|
18
|
+
const area = shallowRef<InstanceType<typeof ScrollArea> | null>(null)
|
|
19
|
+
|
|
20
|
+
defineExpose({
|
|
21
|
+
viewport: computed(() => area.value?.viewport),
|
|
22
|
+
instance: computed(() => area.value?.instance),
|
|
23
|
+
})
|
|
16
24
|
</script>
|
|
17
25
|
|
|
18
26
|
<template>
|
|
19
27
|
<ScrollArea
|
|
28
|
+
ref="area"
|
|
20
29
|
:direction="orientation"
|
|
21
30
|
:scrollbar="false"
|
|
22
31
|
:class="cn(tabsScroll({ variant, orientation }), props.class)"
|
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
[60, 'second'],
|
|
3
|
-
[60, 'minute'],
|
|
4
|
-
[24, 'hour'],
|
|
5
|
-
[7, 'day'],
|
|
6
|
-
[4.34524, 'week'],
|
|
7
|
-
[12, 'month'],
|
|
8
|
-
[Infinity, 'year'],
|
|
9
|
-
] as const
|
|
10
|
-
|
|
11
|
-
export function relativeTime(target: Date, nowMs: number, tag: string, justNow: string): string {
|
|
12
|
-
let duration = (target.getTime() - nowMs) / 1000
|
|
13
|
-
if (Math.abs(duration) < 45) return justNow
|
|
14
|
-
const rtf = new Intl.RelativeTimeFormat(tag, { numeric: 'auto' })
|
|
15
|
-
for (const [amount, unit] of DIVISIONS) {
|
|
16
|
-
if (Math.abs(duration) < amount) return rtf.format(Math.round(duration), unit)
|
|
17
|
-
duration /= amount
|
|
18
|
-
}
|
|
19
|
-
return ''
|
|
20
|
-
}
|
|
1
|
+
export * from '../../../../../shared/src/lib/relative-time'
|
|
@@ -1,28 +1,23 @@
|
|
|
1
1
|
import { computed, onBeforeUnmount, reactive, watch } from 'vue'
|
|
2
|
+
import {
|
|
3
|
+
toastCardHeight,
|
|
4
|
+
toastItemStyle,
|
|
5
|
+
toastLayout,
|
|
6
|
+
type ToastSlot,
|
|
7
|
+
} from '../../../../../shared/src/lib/toast-layout'
|
|
2
8
|
import { toastState, type ToastItem } from '../store'
|
|
3
9
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
const GAP = 12
|
|
7
|
-
const CARD_CHROME_BLOCK = 34
|
|
10
|
+
export { VISIBLE_STACK } from '../../../../../shared/src/lib/toast-layout'
|
|
8
11
|
|
|
9
12
|
export function useToastLayout() {
|
|
10
13
|
const heights = reactive(new Map<number | string, number>())
|
|
11
14
|
const observers = new Map<number | string, { observer: ResizeObserver; el: HTMLElement }>()
|
|
12
|
-
const lastLayout = new Map<number | string,
|
|
15
|
+
const lastLayout = new Map<number | string, ToastSlot>()
|
|
13
16
|
|
|
14
17
|
const openItems = computed(() => toastState.items.filter(item => item.open))
|
|
15
18
|
|
|
16
19
|
const layout = computed(() => {
|
|
17
|
-
const map =
|
|
18
|
-
const open = openItems.value
|
|
19
|
-
let offset = 0
|
|
20
|
-
for (let i = open.length - 1; i >= 0; i -= 1) {
|
|
21
|
-
const item = open[i]!
|
|
22
|
-
const index = open.length - 1 - i
|
|
23
|
-
map.set(item.id, { index, offset })
|
|
24
|
-
offset += (heights.get(item.id) ?? 0) + GAP
|
|
25
|
-
}
|
|
20
|
+
const map = toastLayout(openItems.value, id => heights.get(id))
|
|
26
21
|
for (const [id, slot] of map) lastLayout.set(id, slot)
|
|
27
22
|
return map
|
|
28
23
|
})
|
|
@@ -37,14 +32,7 @@ export function useToastLayout() {
|
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
function itemStyle(item: ToastItem) {
|
|
40
|
-
|
|
41
|
-
const selfHeight = heights.get(item.id)
|
|
42
|
-
return {
|
|
43
|
-
'--hn-t-index': String(slot.index),
|
|
44
|
-
'--hn-t-offset': `${slot.offset}px`,
|
|
45
|
-
...(selfHeight ? { '--hn-t-self-h': `${selfHeight}px` } : {}),
|
|
46
|
-
...(frontHeight.value > 0 ? { '--hn-t-front-h': `${frontHeight.value}px` } : {}),
|
|
47
|
-
}
|
|
35
|
+
return toastItemStyle(slotOf(item), heights.get(item.id), frontHeight.value)
|
|
48
36
|
}
|
|
49
37
|
|
|
50
38
|
function setItemRef(id: number | string, refValue: unknown) {
|
|
@@ -54,10 +42,10 @@ export function useToastLayout() {
|
|
|
54
42
|
if (existing?.el === el) return
|
|
55
43
|
existing?.observer.disconnect()
|
|
56
44
|
const observer = new ResizeObserver(() => {
|
|
57
|
-
heights.set(id, el
|
|
45
|
+
heights.set(id, toastCardHeight(el))
|
|
58
46
|
})
|
|
59
47
|
observer.observe(el)
|
|
60
|
-
heights.set(id, el
|
|
48
|
+
heights.set(id, toastCardHeight(el))
|
|
61
49
|
observers.set(id, { observer, el })
|
|
62
50
|
}
|
|
63
51
|
|