@spinjs/components 0.1.0-preview.1 → 0.2.0-alpha.1
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 +15 -5
- package/dist/angle-slider/angle-slider.events.d.ts +2 -3
- package/dist/angle-slider/angle-slider.machine.d.ts +4 -5
- package/dist/angle-slider/angle-slider.machine.js +2 -2
- package/dist/angle-slider/angle-slider.presentation.d.ts +11 -12
- package/dist/angle-slider/angle-slider.presentation.js +2 -2
- package/dist/angle-slider/angle-slider.state.d.ts +1 -2
- package/dist/angle-slider/angle-slider.state.js +1 -1
- package/dist/angle-slider/angle-slider.transitions.d.ts +2 -3
- package/dist/angle-slider/examples/basic.html +2 -2
- package/dist/angle-slider/examples/basic.html.js +5 -0
- package/dist/angle-slider/examples/knob.html +1 -1
- package/dist/angle-slider/examples/knob.html.js +5 -0
- package/dist/angle-slider/examples/labeled.html +11 -11
- package/dist/angle-slider/examples/labeled.html.js +5 -0
- package/dist/angle-slider/examples/marks.html +2 -2
- package/dist/angle-slider/examples/marks.html.js +5 -0
- package/dist/async-list/async-list.events.d.ts +2 -3
- package/dist/async-list/async-list.machine.d.ts +2 -3
- package/dist/async-list/async-list.machine.js +1 -1
- package/dist/async-list/async-list.presentation.d.ts +13 -14
- package/dist/async-list/async-list.presentation.js +2 -2
- package/dist/async-list/async-list.state.d.ts +1 -2
- package/dist/async-list/async-list.state.js +1 -1
- package/dist/async-list/async-list.transitions.d.ts +3 -4
- package/dist/async-list/examples/basic.html +7 -7
- package/dist/async-list/examples/basic.html.js +5 -0
- package/dist/avatar/avatar.events.d.ts +2 -3
- package/dist/avatar/avatar.machine.d.ts +12 -4
- package/dist/avatar/avatar.machine.js +1 -1
- package/dist/avatar/avatar.presentation.d.ts +5 -6
- package/dist/avatar/avatar.presentation.js +1 -1
- package/dist/avatar/avatar.state.d.ts +1 -2
- package/dist/avatar/avatar.state.js +1 -1
- package/dist/avatar/avatar.transitions.d.ts +2 -3
- package/dist/avatar/examples/badge.html +2 -2
- package/dist/avatar/examples/badge.html.js +5 -0
- package/dist/avatar/examples/badgeminimal.html +1 -1
- package/dist/avatar/examples/badgeminimal.html.js +5 -0
- package/dist/avatar/examples/basic.html +1 -1
- package/dist/avatar/examples/basic.html.js +5 -0
- package/dist/avatar/examples/count.html +5 -5
- package/dist/avatar/examples/count.html.js +5 -0
- package/dist/avatar/examples/fallback.html +1 -1
- package/dist/avatar/examples/fallback.html.js +5 -0
- package/dist/avatar/examples/group.html +4 -4
- package/dist/avatar/examples/group.html.js +5 -0
- package/dist/avatar/examples/icon.html +2 -2
- package/dist/avatar/examples/icon.html.js +5 -0
- package/dist/avatar/examples/multiples.html +4 -4
- package/dist/avatar/examples/multiples.html.js +5 -0
- package/dist/avatar/examples/pills.html +12 -12
- package/dist/avatar/examples/pills.html.js +5 -0
- package/dist/avatar/examples/pillsolid.html +4 -4
- package/dist/avatar/examples/pillsolid.html.js +5 -0
- package/dist/avatar/examples/rounded.html +1 -1
- package/dist/avatar/examples/rounded.html.js +5 -0
- package/dist/avatar/examples/status.html +2 -2
- package/dist/avatar/examples/status.html.js +5 -0
- package/dist/avatar/examples/statusminimal.html +1 -1
- package/dist/avatar/examples/statusminimal.html.js +5 -0
- package/dist/avatar/examples/trusted.html +6 -6
- package/dist/avatar/examples/trusted.html.js +5 -0
- package/dist/avatar/examples/verification.html +3 -3
- package/dist/avatar/examples/verification.html.js +5 -0
- package/dist/carousel/carousel.events.d.ts +2 -3
- package/dist/carousel/carousel.machine.d.ts +3 -4
- package/dist/carousel/carousel.machine.js +1 -1
- package/dist/carousel/carousel.presentation.d.ts +14 -15
- package/dist/carousel/carousel.presentation.js +2 -2
- package/dist/carousel/carousel.state.d.ts +1 -2
- package/dist/carousel/carousel.state.js +1 -1
- package/dist/carousel/carousel.transitions.d.ts +2 -3
- package/dist/carousel/examples/autoplay.html +8 -8
- package/dist/carousel/examples/autoplay.html.js +5 -0
- package/dist/carousel/examples/basic.html +7 -7
- package/dist/carousel/examples/basic.html.js +5 -0
- package/dist/carousel/examples/cards.html +8 -8
- package/dist/carousel/examples/cards.html.js +5 -0
- package/dist/carousel/examples/hero.html +6 -6
- package/dist/carousel/examples/hero.html.js +5 -0
- package/dist/carousel/examples/infinite.html +7 -7
- package/dist/carousel/examples/infinite.html.js +5 -0
- package/dist/carousel/examples/minimal.html +5 -5
- package/dist/carousel/examples/minimal.html.js +5 -0
- package/dist/carousel/examples/testimonials.html +10 -10
- package/dist/carousel/examples/testimonials.html.js +5 -0
- package/dist/carousel/examples/thumbnails.html +8 -8
- package/dist/carousel/examples/thumbnails.html.js +5 -0
- package/dist/carousel/examples/vertical.html +8 -8
- package/dist/carousel/examples/vertical.html.js +5 -0
- package/dist/cascade-select/cascade.events.d.ts +2 -3
- package/dist/cascade-select/cascade.machine.d.ts +3 -4
- package/dist/cascade-select/cascade.machine.js +1 -1
- package/dist/cascade-select/cascade.presentation.d.ts +8 -9
- package/dist/cascade-select/cascade.presentation.js +12 -12
- package/dist/cascade-select/cascade.state.d.ts +1 -2
- package/dist/cascade-select/cascade.state.js +1 -1
- package/dist/cascade-select/cascade.transitions.d.ts +2 -3
- package/dist/cascade-select/examples/basic.html +13 -11
- package/dist/cascade-select/examples/basic.html.js +5 -0
- package/dist/color-picker/color-picker.events.d.ts +3 -4
- package/dist/color-picker/color-picker.machine.d.ts +3 -3
- package/dist/color-picker/color-picker.machine.js +1 -1
- package/dist/color-picker/color-picker.presentation.d.ts +20 -21
- package/dist/color-picker/color-picker.presentation.js +4 -5
- package/dist/color-picker/color-picker.state.d.ts +2 -3
- package/dist/color-picker/color-picker.state.js +2 -2
- package/dist/color-picker/color-picker.transitions.d.ts +3 -4
- package/dist/color-picker/color.d.ts +39 -0
- package/dist/color-picker/color.js +401 -0
- package/dist/color-picker/examples/basic.html +14 -14
- package/dist/color-picker/examples/basic.html.js +5 -0
- package/dist/color-picker/examples/hue-wheel.html +9 -9
- package/dist/color-picker/examples/hue-wheel.html.js +5 -0
- package/dist/color-picker/examples/inline.html +8 -8
- package/dist/color-picker/examples/inline.html.js +5 -0
- package/dist/color-picker/examples/with-presets.html +10 -10
- package/dist/color-picker/examples/with-presets.html.js +5 -0
- package/dist/combobox/combobox.events.d.ts +2 -3
- package/dist/combobox/combobox.machine.d.ts +3 -4
- package/dist/combobox/combobox.machine.js +1 -1
- package/dist/combobox/combobox.presentation.d.ts +8 -9
- package/dist/combobox/combobox.presentation.js +3 -3
- package/dist/combobox/combobox.state.d.ts +1 -2
- package/dist/combobox/combobox.state.js +1 -1
- package/dist/combobox/combobox.transitions.d.ts +3 -4
- package/dist/combobox/examples/basic.html +7 -7
- package/dist/combobox/examples/basic.html.js +5 -0
- package/dist/combobox/examples/directory.html +7 -7
- package/dist/combobox/examples/directory.html.js +5 -0
- package/dist/combobox/examples/grouping.html +7 -7
- package/dist/combobox/examples/grouping.html.js +5 -0
- package/dist/combobox/examples/multiple.html +8 -8
- package/dist/combobox/examples/multiple.html.js +5 -0
- package/dist/compiler/emit.d.ts +6 -0
- package/dist/compiler/emit.js +217 -0
- package/dist/compiler/transform.d.ts +52 -0
- package/dist/compiler/transform.js +169 -0
- package/dist/controller.d.ts +2 -3
- package/dist/controller.js +1 -1
- package/dist/date-input/date-input.events.d.ts +2 -3
- package/dist/date-input/date-input.machine.d.ts +3 -3
- package/dist/date-input/date-input.machine.js +1 -1
- package/dist/date-input/date-input.presentation.d.ts +6 -7
- package/dist/date-input/date-input.presentation.js +1 -1
- package/dist/date-input/date-input.state.d.ts +1 -2
- package/dist/date-input/date-input.state.js +1 -1
- package/dist/date-input/date-input.transitions.d.ts +3 -4
- package/dist/date-input/examples/basic.html +3 -3
- package/dist/date-input/examples/basic.html.js +5 -0
- package/dist/date-picker/date-picker.events.d.ts +2 -3
- package/dist/date-picker/date-picker.machine.d.ts +2 -3
- package/dist/date-picker/date-picker.machine.js +1 -1
- package/dist/date-picker/date-picker.presentation.d.ts +14 -15
- package/dist/date-picker/date-picker.presentation.js +2 -2
- package/dist/date-picker/date-picker.state.d.ts +1 -2
- package/dist/date-picker/date-picker.state.js +1 -1
- package/dist/date-picker/date-picker.transitions.d.ts +3 -4
- package/dist/date-picker/examples/appointment.html +7 -7
- package/dist/date-picker/examples/appointment.html.js +5 -0
- package/dist/date-picker/examples/basic.html.js +5 -0
- package/dist/date-picker/examples/multiple.html.js +5 -0
- package/dist/date-picker/examples/pricing.html.js +5 -0
- package/dist/date-picker/examples/range.html.js +5 -0
- package/dist/date-picker/examples/unavailable.html.js +5 -0
- package/dist/editable/editable.events.d.ts +2 -3
- package/dist/editable/editable.machine.d.ts +3 -4
- package/dist/editable/editable.machine.js +1 -1
- package/dist/editable/editable.presentation.d.ts +6 -7
- package/dist/editable/editable.presentation.js +1 -1
- package/dist/editable/editable.state.d.ts +1 -2
- package/dist/editable/editable.state.js +1 -1
- package/dist/editable/editable.transitions.d.ts +3 -4
- package/dist/editable/examples/basic.html +7 -7
- package/dist/editable/examples/basic.html.js +5 -0
- package/dist/editable/examples/doubleclick.html +6 -6
- package/dist/editable/examples/doubleclick.html.js +5 -0
- package/dist/editable/examples/inline-edit.html +4 -4
- package/dist/editable/examples/inline-edit.html.js +5 -0
- package/dist/editable/examples/profile-field.html +7 -7
- package/dist/editable/examples/profile-field.html.js +5 -0
- package/dist/editable/examples/resize.html +6 -6
- package/dist/editable/examples/resize.html.js +5 -0
- package/dist/editable/examples/task-item.html +7 -7
- package/dist/editable/examples/task-item.html.js +5 -0
- package/dist/editable/examples/title-editor.html +3 -3
- package/dist/editable/examples/title-editor.html.js +5 -0
- package/dist/editable/examples/with-controls.html +4 -4
- package/dist/editable/examples/with-controls.html.js +5 -0
- package/dist/examples.d.ts +22 -0
- package/dist/examples.js +501 -0
- package/dist/file-upload/examples/avatar.html +8 -8
- package/dist/file-upload/examples/avatar.html.js +5 -0
- package/dist/file-upload/examples/basic.html +8 -8
- package/dist/file-upload/examples/basic.html.js +5 -0
- package/dist/file-upload/examples/directory.html +8 -8
- package/dist/file-upload/examples/directory.html.js +5 -0
- package/dist/file-upload/examples/dragdrop.html +8 -8
- package/dist/file-upload/examples/dragdrop.html.js +5 -0
- package/dist/file-upload/examples/files.html +9 -9
- package/dist/file-upload/examples/files.html.js +5 -0
- package/dist/file-upload/examples/images.html +8 -8
- package/dist/file-upload/examples/images.html.js +5 -0
- package/dist/file-upload/examples/paste.html +8 -8
- package/dist/file-upload/examples/paste.html.js +5 -0
- package/dist/file-upload/examples/table.html +7 -7
- package/dist/file-upload/examples/table.html.js +5 -0
- package/dist/file-upload/file-upload.events.d.ts +2 -3
- package/dist/file-upload/file-upload.machine.d.ts +5 -3
- package/dist/file-upload/file-upload.machine.js +1 -1
- package/dist/file-upload/file-upload.presentation.d.ts +10 -11
- package/dist/file-upload/file-upload.presentation.js +1 -1
- package/dist/file-upload/file-upload.state.d.ts +1 -2
- package/dist/file-upload/file-upload.state.js +1 -1
- package/dist/file-upload/file-upload.transitions.d.ts +3 -4
- package/dist/floating-panel/examples/basic.html +22 -23
- package/dist/floating-panel/examples/basic.html.js +5 -0
- package/dist/floating-panel/examples/calculator.html +41 -41
- package/dist/floating-panel/examples/calculator.html.js +5 -0
- package/dist/floating-panel/examples/chat.html +29 -29
- package/dist/floating-panel/examples/chat.html.js +5 -0
- package/dist/floating-panel/examples/media-player.html +27 -27
- package/dist/floating-panel/examples/media-player.html.js +5 -0
- package/dist/floating-panel/examples/notes.html +36 -36
- package/dist/floating-panel/examples/notes.html.js +5 -0
- package/dist/floating-panel/examples/settings.html +34 -34
- package/dist/floating-panel/examples/settings.html.js +5 -0
- package/dist/floating-panel/examples/task.html +40 -40
- package/dist/floating-panel/examples/task.html.js +5 -0
- package/dist/floating-panel/examples/video-call.html +25 -25
- package/dist/floating-panel/examples/video-call.html.js +5 -0
- package/dist/floating-panel/floating-panel.events.d.ts +2 -3
- package/dist/floating-panel/floating-panel.machine.d.ts +2 -3
- package/dist/floating-panel/floating-panel.machine.js +1 -1
- package/dist/floating-panel/floating-panel.presentation.d.ts +11 -13
- package/dist/floating-panel/floating-panel.presentation.js +3 -6
- package/dist/floating-panel/floating-panel.state.d.ts +1 -2
- package/dist/floating-panel/floating-panel.state.js +1 -1
- package/dist/floating-panel/floating-panel.transitions.d.ts +3 -4
- package/dist/hover-card/examples/basic.html +5 -5
- package/dist/hover-card/examples/basic.html.js +5 -0
- package/dist/hover-card/examples/controlled.html +9 -10
- package/dist/hover-card/examples/controlled.html.js +5 -0
- package/dist/hover-card/examples/custom-positioning.html +8 -8
- package/dist/hover-card/examples/custom-positioning.html.js +5 -0
- package/dist/hover-card/examples/link.html +2 -2
- package/dist/hover-card/examples/link.html.js +5 -0
- package/dist/hover-card/examples/product.html +9 -9
- package/dist/hover-card/examples/product.html.js +5 -0
- package/dist/hover-card/examples/user.html +11 -11
- package/dist/hover-card/examples/user.html.js +5 -0
- package/dist/hover-card/examples/with-arrow.html +9 -9
- package/dist/hover-card/examples/with-arrow.html.js +5 -0
- package/dist/hover-card/hover-card.controller-def.d.ts +2 -4
- package/dist/hover-card/hover-card.controller-def.js +1 -1
- package/dist/image-cropper/crop-geometry.d.ts +1 -2
- package/dist/image-cropper/crop-geometry.js +1 -1
- package/dist/image-cropper/examples/basic.html +3 -3
- package/dist/image-cropper/examples/basic.html.js +5 -0
- package/dist/image-cropper/examples/circle.html +3 -3
- package/dist/image-cropper/examples/circle.html.js +5 -0
- package/dist/image-cropper/image-cropper.events.d.ts +2 -3
- package/dist/image-cropper/image-cropper.machine.d.ts +3 -4
- package/dist/image-cropper/image-cropper.machine.js +2 -2
- package/dist/image-cropper/image-cropper.presentation.d.ts +7 -8
- package/dist/image-cropper/image-cropper.presentation.js +2 -2
- package/dist/image-cropper/image-cropper.state.d.ts +1 -2
- package/dist/image-cropper/image-cropper.state.js +1 -1
- package/dist/image-cropper/image-cropper.transitions.d.ts +3 -4
- package/dist/index.d.ts +28 -13
- package/dist/index.js +21 -14
- package/dist/listbox/examples/basic.html +9 -9
- package/dist/listbox/examples/basic.html.js +5 -0
- package/dist/listbox/examples/controlled.html +9 -9
- package/dist/listbox/examples/controlled.html.js +5 -0
- package/dist/listbox/examples/countries.html +9 -9
- package/dist/listbox/examples/countries.html.js +5 -0
- package/dist/listbox/examples/grouped.html +9 -9
- package/dist/listbox/examples/grouped.html.js +5 -0
- package/dist/listbox/examples/icons.html +10 -10
- package/dist/listbox/examples/icons.html.js +5 -0
- package/dist/listbox/examples/multiple.html +9 -9
- package/dist/listbox/examples/multiple.html.js +5 -0
- package/dist/listbox/examples/priority.html +9 -9
- package/dist/listbox/examples/priority.html.js +5 -0
- package/dist/listbox/examples/settings.html +9 -9
- package/dist/listbox/examples/settings.html.js +5 -0
- package/dist/listbox/listbox.events.d.ts +2 -3
- package/dist/listbox/listbox.machine.d.ts +2 -3
- package/dist/listbox/listbox.machine.js +1 -1
- package/dist/listbox/listbox.presentation.d.ts +6 -5
- package/dist/listbox/listbox.presentation.js +1 -1
- package/dist/listbox/listbox.state.d.ts +1 -2
- package/dist/listbox/listbox.state.js +1 -1
- package/dist/listbox/listbox.transitions.d.ts +3 -4
- package/dist/menu/examples/basic.html +15 -13
- package/dist/menu/examples/basic.html.js +5 -0
- package/dist/menu/examples/context.html +14 -12
- package/dist/menu/examples/context.html.js +5 -0
- package/dist/menu/examples/groups.html +15 -13
- package/dist/menu/examples/groups.html.js +5 -0
- package/dist/menu/examples/icons.html +17 -15
- package/dist/menu/examples/icons.html.js +5 -0
- package/dist/menu/examples/nested.html +15 -13
- package/dist/menu/examples/nested.html.js +5 -0
- package/dist/menu/examples/user.html +21 -19
- package/dist/menu/examples/user.html.js +5 -0
- package/dist/menu/menu.events.d.ts +2 -3
- package/dist/menu/menu.machine.d.ts +2 -3
- package/dist/menu/menu.machine.js +1 -1
- package/dist/menu/menu.presentation.d.ts +6 -8
- package/dist/menu/menu.presentation.js +4 -5
- package/dist/menu/menu.state.d.ts +1 -2
- package/dist/menu/menu.state.js +1 -1
- package/dist/mode-picker/examples/basic.html +1 -1
- package/dist/mode-picker/examples/basic.html.js +5 -0
- package/dist/mode-picker/examples/minimal.html +1 -1
- package/dist/mode-picker/examples/minimal.html.js +5 -0
- package/dist/mode-picker/examples/pill.html +1 -1
- package/dist/mode-picker/examples/pill.html.js +5 -0
- package/dist/mode-picker/mode-picker.events.d.ts +2 -3
- package/dist/mode-picker/mode-picker.machine.d.ts +3 -3
- package/dist/mode-picker/mode-picker.machine.js +1 -1
- package/dist/mode-picker/mode-picker.presentation.d.ts +7 -8
- package/dist/mode-picker/mode-picker.presentation.js +2 -2
- package/dist/mode-picker/mode-picker.state.d.ts +1 -2
- package/dist/mode-picker/mode-picker.transitions.d.ts +3 -4
- package/dist/navigation-menu/examples/basic.html +6 -6
- package/dist/navigation-menu/examples/basic.html.js +5 -0
- package/dist/navigation-menu/examples/grouped.html +14 -12
- package/dist/navigation-menu/examples/grouped.html.js +5 -0
- package/dist/navigation-menu/examples/minimal.html +7 -5
- package/dist/navigation-menu/examples/minimal.html.js +5 -0
- package/dist/navigation-menu/navigation-menu.events.d.ts +2 -3
- package/dist/navigation-menu/navigation-menu.machine.d.ts +3 -3
- package/dist/navigation-menu/navigation-menu.machine.js +1 -1
- package/dist/navigation-menu/navigation-menu.presentation.d.ts +6 -7
- package/dist/navigation-menu/navigation-menu.presentation.js +2 -2
- package/dist/navigation-menu/navigation-menu.state.d.ts +1 -2
- package/dist/navigation-menu/navigation-menu.state.js +1 -1
- package/dist/navigation-menu/navigation-menu.transitions.d.ts +3 -4
- package/dist/number-input/examples/basic.html +10 -10
- package/dist/number-input/examples/basic.html.js +5 -0
- package/dist/number-input/examples/currency.html +6 -6
- package/dist/number-input/examples/currency.html.js +5 -0
- package/dist/number-input/examples/decimal.html +4 -4
- package/dist/number-input/examples/decimal.html.js +5 -0
- package/dist/number-input/examples/limits.html +6 -6
- package/dist/number-input/examples/limits.html.js +5 -0
- package/dist/number-input/examples/percentage.html +6 -6
- package/dist/number-input/examples/percentage.html.js +5 -0
- package/dist/number-input/examples/quantity.html +6 -6
- package/dist/number-input/examples/quantity.html.js +5 -0
- package/dist/number-input/examples/scrubber.html +11 -11
- package/dist/number-input/examples/scrubber.html.js +5 -0
- package/dist/number-input/examples/wheel.html +7 -7
- package/dist/number-input/examples/wheel.html.js +5 -0
- package/dist/number-input/number-input.events.d.ts +2 -3
- package/dist/number-input/number-input.machine.d.ts +4 -4
- package/dist/number-input/number-input.machine.js +1 -1
- package/dist/number-input/number-input.presentation.d.ts +7 -8
- package/dist/number-input/number-input.presentation.js +4 -4
- package/dist/number-input/number-input.state.d.ts +1 -2
- package/dist/number-input/number-input.state.js +1 -1
- package/dist/number-input/number-input.transitions.d.ts +3 -4
- package/dist/pagination/examples/basic.html +2 -2
- package/dist/pagination/examples/basic.html.js +5 -0
- package/dist/pagination/examples/dropdown.html +2 -2
- package/dist/pagination/examples/dropdown.html.js +5 -0
- package/dist/pagination/examples/info.html +3 -3
- package/dist/pagination/examples/info.html.js +5 -0
- package/dist/pagination/examples/jump.html +2 -2
- package/dist/pagination/examples/jump.html.js +5 -0
- package/dist/pagination/examples/numbered.html +2 -2
- package/dist/pagination/examples/numbered.html.js +5 -0
- package/dist/pagination/examples/pagesize.html +4 -4
- package/dist/pagination/examples/pagesize.html.js +5 -0
- package/dist/pagination/pagination.events.d.ts +2 -3
- package/dist/pagination/pagination.machine.d.ts +4 -4
- package/dist/pagination/pagination.machine.js +1 -1
- package/dist/pagination/pagination.presentation.d.ts +4 -5
- package/dist/pagination/pagination.presentation.js +1 -1
- package/dist/pagination/pagination.state.d.ts +1 -2
- package/dist/pagination/pagination.state.js +1 -1
- package/dist/pagination/pagination.transitions.d.ts +2 -3
- package/dist/pin-input/examples/basic.html +2 -2
- package/dist/pin-input/examples/basic.html.js +5 -0
- package/dist/pin-input/examples/field.html +4 -4
- package/dist/pin-input/examples/field.html.js +5 -0
- package/dist/pin-input/examples/masked.html +3 -3
- package/dist/pin-input/examples/masked.html.js +5 -0
- package/dist/pin-input/examples/placeholder.html +3 -3
- package/dist/pin-input/examples/placeholder.html.js +5 -0
- package/dist/pin-input/examples/twofactor.html +4 -4
- package/dist/pin-input/examples/twofactor.html.js +5 -0
- package/dist/pin-input/examples/verification.html +6 -6
- package/dist/pin-input/examples/verification.html.js +5 -0
- package/dist/pin-input/pin-input.events.d.ts +2 -3
- package/dist/pin-input/pin-input.machine.d.ts +3 -3
- package/dist/pin-input/pin-input.machine.js +1 -1
- package/dist/pin-input/pin-input.presentation.d.ts +4 -5
- package/dist/pin-input/pin-input.presentation.js +2 -2
- package/dist/pin-input/pin-input.state.d.ts +1 -2
- package/dist/pin-input/pin-input.state.js +1 -1
- package/dist/pin-input/pin-input.transitions.d.ts +1 -2
- package/dist/popover/examples/basic.html +4 -4
- package/dist/popover/examples/basic.html.js +5 -0
- package/dist/popover/examples/feedback.html +5 -5
- package/dist/popover/examples/feedback.html.js +5 -0
- package/dist/popover/examples/notifications.html +5 -5
- package/dist/popover/examples/notifications.html.js +5 -0
- package/dist/popover/examples/settings.html +8 -8
- package/dist/popover/examples/settings.html.js +5 -0
- package/dist/popover/examples/share.html +5 -5
- package/dist/popover/examples/share.html.js +5 -0
- package/dist/popover/examples/user.html +10 -10
- package/dist/popover/examples/user.html.js +5 -0
- package/dist/popover/popover.controller-def.d.ts +2 -4
- package/dist/popover/popover.controller-def.js +1 -1
- package/dist/rating-group/examples/basic.html +9 -9
- package/dist/rating-group/examples/basic.html.js +5 -0
- package/dist/rating-group/examples/movie.html +11 -11
- package/dist/rating-group/examples/movie.html.js +5 -0
- package/dist/rating-group/examples/product-review.html +13 -13
- package/dist/rating-group/examples/product-review.html.js +5 -0
- package/dist/rating-group/examples/service-evaluation.html +5 -5
- package/dist/rating-group/examples/service-evaluation.html.js +5 -0
- package/dist/rating-group/rating-group.events.d.ts +2 -3
- package/dist/rating-group/rating-group.machine.d.ts +2 -3
- package/dist/rating-group/rating-group.machine.js +1 -1
- package/dist/rating-group/rating-group.presentation.d.ts +6 -7
- package/dist/rating-group/rating-group.presentation.js +2 -2
- package/dist/rating-group/rating-group.state.d.ts +1 -2
- package/dist/rating-group/rating-group.state.js +1 -1
- package/dist/rating-group/rating-group.transitions.d.ts +3 -4
- package/dist/react/react.d.ts +2 -3
- package/dist/runtime/actions/action.d.ts +64 -0
- package/dist/runtime/actions/action.js +45 -0
- package/dist/runtime/actions/anchor.d.ts +43 -0
- package/dist/runtime/actions/anchor.js +127 -0
- package/dist/runtime/actions/date-picker-focus.d.ts +19 -0
- package/dist/runtime/actions/date-picker-focus.js +16 -0
- package/dist/runtime/actions/drag.d.ts +66 -0
- package/dist/runtime/actions/drag.js +118 -0
- package/dist/runtime/actions/form-control.d.ts +18 -0
- package/dist/runtime/actions/form-control.js +41 -0
- package/dist/runtime/actions/hover-delay.d.ts +26 -0
- package/dist/runtime/actions/hover-delay.js +61 -0
- package/dist/runtime/actions/index.d.ts +113 -0
- package/dist/runtime/actions/index.js +240 -0
- package/dist/runtime/actions/infinite-scroll.d.ts +22 -0
- package/dist/runtime/actions/infinite-scroll.js +33 -0
- package/dist/runtime/actions/interact-outside.d.ts +43 -0
- package/dist/runtime/actions/interact-outside.js +72 -0
- package/dist/runtime/actions/observe.d.ts +27 -0
- package/dist/runtime/actions/observe.js +25 -0
- package/dist/runtime/actions/scroll-into-view.d.ts +32 -0
- package/dist/runtime/actions/scroll-into-view.js +36 -0
- package/dist/runtime/actions/select-focus.d.ts +17 -0
- package/dist/runtime/actions/select-focus.js +16 -0
- package/dist/runtime/actions/select-options.d.ts +25 -0
- package/dist/runtime/actions/select-options.js +27 -0
- package/dist/runtime/actions/toast-actions.d.ts +65 -0
- package/dist/runtime/actions/toast-actions.js +143 -0
- package/dist/runtime/aria.d.ts +231 -0
- package/dist/runtime/aria.js +193 -0
- package/dist/runtime/component/define.d.ts +242 -0
- package/dist/runtime/component/define.js +12 -0
- package/dist/runtime/component/ids.d.ts +14 -0
- package/dist/runtime/component/ids.js +35 -0
- package/dist/runtime/component/synthesize.d.ts +32 -0
- package/dist/runtime/component/synthesize.js +385 -0
- package/dist/runtime/core/signal.d.ts +57 -0
- package/dist/runtime/core/signal.js +100 -0
- package/dist/runtime/core/style.d.ts +14 -0
- package/dist/runtime/core/style.js +31 -0
- package/dist/runtime/directives/bind.d.ts +38 -0
- package/dist/runtime/directives/bind.js +244 -0
- package/dist/runtime/directives/for.d.ts +12 -0
- package/dist/runtime/directives/for.js +104 -0
- package/dist/runtime/directives/if.d.ts +10 -0
- package/dist/runtime/directives/if.js +45 -0
- package/dist/runtime/directives/load.d.ts +13 -0
- package/dist/runtime/directives/load.js +119 -0
- package/dist/runtime/directives/spread.d.ts +17 -0
- package/dist/runtime/directives/spread.js +121 -0
- package/dist/runtime/directives/tpl.d.ts +11 -0
- package/dist/runtime/directives/tpl.js +39 -0
- package/dist/runtime/directives/use.d.ts +13 -0
- package/dist/runtime/directives/use.js +34 -0
- package/dist/runtime/index.d.ts +101 -0
- package/dist/runtime/index.js +40 -0
- package/dist/runtime/machine/fsm/machine.d.ts +192 -0
- package/dist/runtime/machine/fsm/machine.js +248 -0
- package/dist/runtime/math/index.d.ts +2 -0
- package/dist/runtime/math/index.js +1 -0
- package/dist/runtime/math/numbers.d.ts +58 -0
- package/dist/runtime/math/numbers.js +115 -0
- package/dist/runtime/props.d.ts +61 -0
- package/dist/runtime/props.js +113 -0
- package/dist/runtime/scope/element.d.ts +86 -0
- package/dist/runtime/scope/element.js +226 -0
- package/dist/runtime/scope/table.d.ts +55 -0
- package/dist/runtime/scope/table.js +174 -0
- package/dist/runtime/syntax/braces.d.ts +2 -0
- package/dist/runtime/syntax/braces.js +35 -0
- package/dist/runtime/syntax/classes.d.ts +22 -0
- package/dist/runtime/syntax/classes.js +119 -0
- package/dist/runtime/syntax/display.d.ts +25 -0
- package/dist/runtime/syntax/display.js +344 -0
- package/dist/runtime/syntax/expand-groups.d.ts +12 -0
- package/dist/runtime/syntax/expand-groups.js +31 -0
- package/dist/runtime/syntax/ir.d.ts +76 -0
- package/dist/runtime/syntax/ir.js +11 -0
- package/dist/runtime/syntax/parse.d.ts +2 -0
- package/dist/runtime/syntax/parse.js +407 -0
- package/dist/runtime/syntax/script-block.d.ts +43 -0
- package/dist/runtime/syntax/script-block.js +190 -0
- package/dist/runtime/testing.d.ts +11 -0
- package/dist/runtime/testing.js +1 -0
- package/dist/select/examples/basic.html +9 -9
- package/dist/select/examples/basic.html.js +5 -0
- package/dist/select/examples/category.html +10 -10
- package/dist/select/examples/category.html.js +5 -0
- package/dist/select/examples/country.html +10 -10
- package/dist/select/examples/country.html.js +5 -0
- package/dist/select/examples/language.html.js +5 -0
- package/dist/select/examples/multiple.html.js +5 -0
- package/dist/select/examples/profile.html +10 -10
- package/dist/select/examples/profile.html.js +5 -0
- package/dist/select/examples/theme.html.js +5 -0
- package/dist/select/examples/with-overlapping-label.html +8 -8
- package/dist/select/examples/with-overlapping-label.html.js +5 -0
- package/dist/select/select.events.d.ts +2 -3
- package/dist/select/select.machine.d.ts +2 -3
- package/dist/select/select.machine.js +1 -1
- package/dist/select/select.presentation.d.ts +16 -20
- package/dist/select/select.presentation.js +6 -6
- package/dist/select/select.shared.d.ts +1 -2
- package/dist/select/select.state.d.ts +1 -2
- package/dist/select/select.state.js +1 -1
- package/dist/select/select.transitions.d.ts +2 -3
- package/dist/shared/keyboard.d.ts +1 -2
- package/dist/signature-pad/examples/basic.html +3 -3
- package/dist/signature-pad/examples/basic.html.js +5 -0
- package/dist/signature-pad/examples/contract.html +7 -7
- package/dist/signature-pad/examples/contract.html.js +5 -0
- package/dist/signature-pad/examples/receipt.html +8 -8
- package/dist/signature-pad/examples/receipt.html.js +5 -0
- package/dist/signature-pad/examples/with-preview.html +6 -6
- package/dist/signature-pad/examples/with-preview.html.js +5 -0
- package/dist/signature-pad/signature-pad.events.d.ts +2 -3
- package/dist/signature-pad/signature-pad.machine.d.ts +4 -4
- package/dist/signature-pad/signature-pad.machine.js +2 -2
- package/dist/signature-pad/signature-pad.presentation.d.ts +10 -11
- package/dist/signature-pad/signature-pad.presentation.js +2 -2
- package/dist/signature-pad/signature-pad.state.d.ts +1 -2
- package/dist/signature-pad/signature-pad.state.js +1 -1
- package/dist/signature-pad/signature-pad.transitions.d.ts +3 -4
- package/dist/slider/examples/basic.html +1 -1
- package/dist/slider/examples/basic.html.js +5 -0
- package/dist/slider/examples/equalizer.html +13 -13
- package/dist/slider/examples/equalizer.html.js +5 -0
- package/dist/slider/examples/fractional.html.js +5 -0
- package/dist/slider/examples/marks.html +2 -2
- package/dist/slider/examples/marks.html.js +5 -0
- package/dist/slider/examples/range.html +1 -1
- package/dist/slider/examples/range.html.js +5 -0
- package/dist/slider/examples/stepped.html.js +5 -0
- package/dist/slider/examples/ticks.html +2 -2
- package/dist/slider/examples/ticks.html.js +5 -0
- package/dist/slider/examples/vertical.html.js +5 -0
- package/dist/slider/slider.events.d.ts +2 -3
- package/dist/slider/slider.machine.d.ts +3 -3
- package/dist/slider/slider.machine.js +2 -2
- package/dist/slider/slider.presentation.d.ts +7 -8
- package/dist/slider/slider.presentation.js +2 -2
- package/dist/slider/slider.state.d.ts +1 -2
- package/dist/slider/slider.state.js +1 -1
- package/dist/slider/slider.transitions.d.ts +3 -4
- package/dist/slider/slider.transitions.js +1 -1
- package/dist/solid/solid.d.ts +2 -3
- package/dist/spin-element.d.ts +1 -2
- package/dist/spin-element.js +1 -1
- package/dist/splitter/examples/basic.html +2 -2
- package/dist/splitter/examples/basic.html.js +5 -0
- package/dist/splitter/examples/nested.html +4 -4
- package/dist/splitter/examples/nested.html.js +5 -0
- package/dist/splitter/examples/threepanels.html +2 -2
- package/dist/splitter/examples/threepanels.html.js +5 -0
- package/dist/splitter/examples/vertical.html +2 -2
- package/dist/splitter/examples/vertical.html.js +5 -0
- package/dist/splitter/splitter.events.d.ts +2 -3
- package/dist/splitter/splitter.machine.d.ts +2 -3
- package/dist/splitter/splitter.machine.js +1 -1
- package/dist/splitter/splitter.presentation.d.ts +5 -6
- package/dist/splitter/splitter.presentation.js +1 -1
- package/dist/splitter/splitter.state.d.ts +1 -2
- package/dist/splitter/splitter.state.js +1 -1
- package/dist/splitter/splitter.transitions.d.ts +2 -3
- package/dist/steps/examples/basic.html +5 -5
- package/dist/steps/examples/basic.html.js +5 -0
- package/dist/steps/examples/checkmarks.html +4 -4
- package/dist/steps/examples/checkmarks.html.js +5 -0
- package/dist/steps/examples/content.html +5 -5
- package/dist/steps/examples/content.html.js +5 -0
- package/dist/steps/examples/descriptions.html +2 -2
- package/dist/steps/examples/descriptions.html.js +5 -0
- package/dist/steps/examples/icons.html +2 -2
- package/dist/steps/examples/icons.html.js +5 -0
- package/dist/steps/examples/lines.html +2 -2
- package/dist/steps/examples/lines.html.js +5 -0
- package/dist/steps/examples/navigation.html +4 -4
- package/dist/steps/examples/navigation.html.js +5 -0
- package/dist/steps/examples/onboarding.html +4 -4
- package/dist/steps/examples/onboarding.html.js +5 -0
- package/dist/steps/examples/progress.html +3 -3
- package/dist/steps/examples/progress.html.js +5 -0
- package/dist/steps/examples/segmented.html +6 -6
- package/dist/steps/examples/segmented.html.js +5 -0
- package/dist/steps/examples/vertical.html +5 -5
- package/dist/steps/examples/vertical.html.js +5 -0
- package/dist/steps/examples/verticallabels.html +2 -2
- package/dist/steps/examples/verticallabels.html.js +5 -0
- package/dist/steps/examples/verticalnavigation.html +2 -2
- package/dist/steps/examples/verticalnavigation.html.js +5 -0
- package/dist/steps/steps.events.d.ts +2 -3
- package/dist/steps/steps.machine.d.ts +3 -3
- package/dist/steps/steps.machine.js +1 -1
- package/dist/steps/steps.presentation.d.ts +4 -5
- package/dist/steps/steps.presentation.js +1 -1
- package/dist/steps/steps.state.d.ts +1 -2
- package/dist/steps/steps.state.js +1 -1
- package/dist/steps/steps.transitions.d.ts +3 -4
- package/dist/tabs/examples/basic.html +2 -2
- package/dist/tabs/examples/basic.html.js +5 -0
- package/dist/tabs/examples/dashboard.html +42 -42
- package/dist/tabs/examples/dashboard.html.js +5 -0
- package/dist/tabs/examples/ghost.html +2 -2
- package/dist/tabs/examples/ghost.html.js +5 -0
- package/dist/tabs/examples/icon-above.html +6 -6
- package/dist/tabs/examples/icon-above.html.js +5 -0
- package/dist/tabs/examples/icon-only.html +3 -3
- package/dist/tabs/examples/icon-only.html.js +5 -0
- package/dist/tabs/examples/outline-with-icons.html +6 -6
- package/dist/tabs/examples/outline-with-icons.html.js +5 -0
- package/dist/tabs/examples/outline.html +3 -3
- package/dist/tabs/examples/outline.html.js +5 -0
- package/dist/tabs/examples/pills.html +2 -2
- package/dist/tabs/examples/pills.html.js +5 -0
- package/dist/tabs/examples/project.html +33 -33
- package/dist/tabs/examples/project.html.js +5 -0
- package/dist/tabs/examples/settings.html +35 -35
- package/dist/tabs/examples/settings.html.js +5 -0
- package/dist/tabs/examples/stack-with-icons.html +7 -7
- package/dist/tabs/examples/stack-with-icons.html.js +5 -0
- package/dist/tabs/examples/stack.html +3 -3
- package/dist/tabs/examples/stack.html.js +5 -0
- package/dist/tabs/examples/underline.html +3 -3
- package/dist/tabs/examples/underline.html.js +5 -0
- package/dist/tabs/examples/vertical-ghost.html +3 -3
- package/dist/tabs/examples/vertical-ghost.html.js +5 -0
- package/dist/tabs/examples/vertical-icons.html +5 -5
- package/dist/tabs/examples/vertical-icons.html.js +5 -0
- package/dist/tabs/examples/vertical-underline.html +4 -4
- package/dist/tabs/examples/vertical-underline.html.js +5 -0
- package/dist/tabs/examples/vertical-with-icons.html +6 -6
- package/dist/tabs/examples/vertical-with-icons.html.js +5 -0
- package/dist/tabs/examples/vertical.html +2 -2
- package/dist/tabs/examples/vertical.html.js +5 -0
- package/dist/tabs/examples/with-badges.html +3 -3
- package/dist/tabs/examples/with-badges.html.js +5 -0
- package/dist/tabs/examples/with-icons.html +4 -4
- package/dist/tabs/examples/with-icons.html.js +5 -0
- package/dist/tabs/tabs.events.d.ts +2 -3
- package/dist/tabs/tabs.machine.d.ts +3 -3
- package/dist/tabs/tabs.machine.js +1 -1
- package/dist/tabs/tabs.presentation.d.ts +6 -7
- package/dist/tabs/tabs.presentation.js +1 -1
- package/dist/tabs/tabs.state.d.ts +1 -2
- package/dist/tabs/tabs.state.js +1 -1
- package/dist/tabs/tabs.transitions.d.ts +3 -4
- package/dist/tags-input/examples/basic.html +9 -9
- package/dist/tags-input/examples/basic.html.js +5 -0
- package/dist/tags-input/examples/with-combobox.html +14 -14
- package/dist/tags-input/examples/with-combobox.html.js +5 -0
- package/dist/tags-input/tags.events.d.ts +2 -3
- package/dist/tags-input/tags.machine.d.ts +6 -4
- package/dist/tags-input/tags.machine.js +2 -2
- package/dist/tags-input/tags.presentation.d.ts +6 -7
- package/dist/tags-input/tags.presentation.js +1 -1
- package/dist/tags-input/tags.state.d.ts +1 -2
- package/dist/tags-input/tags.state.js +2 -2
- package/dist/tags-input/tags.transitions.d.ts +2 -3
- package/dist/theme-picker/examples/basic.html +6 -6
- package/dist/theme-picker/examples/basic.html.js +5 -0
- package/dist/theme-picker/examples/cards.html +4 -4
- package/dist/theme-picker/examples/cards.html.js +5 -0
- package/dist/theme-picker/examples/compact.html +3 -3
- package/dist/theme-picker/examples/compact.html.js +5 -0
- package/dist/theme-picker/examples/swatches.html +2 -2
- package/dist/theme-picker/examples/swatches.html.js +5 -0
- package/dist/theme-picker/theme-picker.events.d.ts +2 -3
- package/dist/theme-picker/theme-picker.machine.d.ts +3 -3
- package/dist/theme-picker/theme-picker.machine.js +1 -1
- package/dist/theme-picker/theme-picker.presentation.d.ts +9 -10
- package/dist/theme-picker/theme-picker.presentation.js +2 -2
- package/dist/theme-picker/theme-picker.state.d.ts +1 -2
- package/dist/theme-picker/theme-picker.transitions.d.ts +3 -4
- package/dist/timer/examples/basic.html +1 -1
- package/dist/timer/examples/basic.html.js +5 -0
- package/dist/timer/examples/card.html +4 -4
- package/dist/timer/examples/card.html.js +5 -0
- package/dist/timer/examples/compact.html +5 -5
- package/dist/timer/examples/compact.html.js +5 -0
- package/dist/timer/examples/countdown.html +3 -3
- package/dist/timer/examples/countdown.html.js +5 -0
- package/dist/timer/examples/labels.html +3 -3
- package/dist/timer/examples/labels.html.js +5 -0
- package/dist/timer/examples/large.html +2 -2
- package/dist/timer/examples/large.html.js +5 -0
- package/dist/timer/examples/minimal.html +1 -1
- package/dist/timer/examples/minimal.html.js +5 -0
- package/dist/timer/examples/pomodoro.html +3 -3
- package/dist/timer/examples/pomodoro.html.js +5 -0
- package/dist/timer/examples/workout.html +4 -4
- package/dist/timer/examples/workout.html.js +5 -0
- package/dist/timer/timer.events.d.ts +2 -3
- package/dist/timer/timer.machine.d.ts +2 -3
- package/dist/timer/timer.machine.js +1 -1
- package/dist/timer/timer.presentation.d.ts +7 -8
- package/dist/timer/timer.presentation.js +1 -1
- package/dist/timer/timer.state.d.ts +1 -2
- package/dist/timer/timer.state.js +1 -1
- package/dist/timer/timer.transitions.d.ts +2 -3
- package/dist/toast/examples/action.html +3 -3
- package/dist/toast/examples/action.html.js +5 -0
- package/dist/toast/examples/basic.html +3 -3
- package/dist/toast/examples/basic.html.js +5 -0
- package/dist/toast/examples/bottomcenter.html +3 -3
- package/dist/toast/examples/bottomcenter.html.js +5 -0
- package/dist/toast/examples/bottomleft.html +3 -3
- package/dist/toast/examples/bottomleft.html.js +5 -0
- package/dist/toast/examples/bottomright.html +3 -3
- package/dist/toast/examples/bottomright.html.js +5 -0
- package/dist/toast/examples/duration.html +3 -3
- package/dist/toast/examples/duration.html.js +5 -0
- package/dist/toast/examples/promise.html +6 -6
- package/dist/toast/examples/promise.html.js +5 -0
- package/dist/toast/examples/topcenter.html +3 -3
- package/dist/toast/examples/topcenter.html.js +5 -0
- package/dist/toast/examples/topleft.html +3 -3
- package/dist/toast/examples/topleft.html.js +5 -0
- package/dist/toast/examples/topright.html +3 -3
- package/dist/toast/examples/topright.html.js +5 -0
- package/dist/toast/examples/types.html +3 -3
- package/dist/toast/examples/types.html.js +5 -0
- package/dist/toast/examples/updatable.html.js +5 -0
- package/dist/toast/toast.events.d.ts +2 -3
- package/dist/toast/toast.machine.d.ts +4 -4
- package/dist/toast/toast.machine.js +1 -1
- package/dist/toast/toast.presentation.d.ts +5 -6
- package/dist/toast/toast.presentation.js +1 -1
- package/dist/toast/toast.state.d.ts +1 -2
- package/dist/toast/toast.state.js +3 -3
- package/dist/toast/toast.transitions.d.ts +3 -4
- package/dist/toc/examples/basic.html +31 -0
- package/dist/toc/examples/basic.html.js +5 -0
- package/dist/toc/toc.events.d.ts +19 -0
- package/dist/toc/toc.events.js +1 -0
- package/dist/toc/toc.machine.d.ts +5 -0
- package/dist/toc/toc.machine.js +59 -0
- package/dist/toc/toc.presentation.d.ts +127 -0
- package/dist/toc/toc.presentation.js +117 -0
- package/dist/toc/toc.state.d.ts +41 -0
- package/dist/toc/toc.state.js +64 -0
- package/dist/toc/toc.transitions.d.ts +8 -0
- package/dist/toc/toc.transitions.js +27 -0
- package/dist/toggle-group/examples/basic.html +2 -2
- package/dist/toggle-group/examples/basic.html.js +5 -0
- package/dist/toggle-group/examples/ghost.html +1 -1
- package/dist/toggle-group/examples/ghost.html.js +5 -0
- package/dist/toggle-group/examples/icons.html +3 -3
- package/dist/toggle-group/examples/icons.html.js +5 -0
- package/dist/toggle-group/examples/multiple.html.js +5 -0
- package/dist/toggle-group/examples/outline.html +2 -2
- package/dist/toggle-group/examples/outline.html.js +5 -0
- package/dist/toggle-group/examples/toolbar.html +3 -3
- package/dist/toggle-group/examples/toolbar.html.js +5 -0
- package/dist/toggle-group/toggle-group.events.d.ts +2 -3
- package/dist/toggle-group/toggle-group.machine.d.ts +3 -3
- package/dist/toggle-group/toggle-group.machine.js +1 -1
- package/dist/toggle-group/toggle-group.presentation.d.ts +6 -7
- package/dist/toggle-group/toggle-group.presentation.js +2 -2
- package/dist/toggle-group/toggle-group.state.d.ts +1 -2
- package/dist/toggle-group/toggle-group.state.js +1 -1
- package/dist/toggle-group/toggle-group.transitions.d.ts +3 -4
- package/dist/tooltip/examples/basic.html.js +5 -0
- package/dist/tooltip/examples/metrics.html +9 -9
- package/dist/tooltip/examples/metrics.html.js +5 -0
- package/dist/tooltip/examples/positioning.html +4 -4
- package/dist/tooltip/examples/positioning.html.js +5 -0
- package/dist/tooltip/examples/status.html +10 -10
- package/dist/tooltip/examples/status.html.js +5 -0
- package/dist/tooltip/examples/video.html +6 -6
- package/dist/tooltip/examples/video.html.js +5 -0
- package/dist/tooltip/examples/with-arrow.html +1 -1
- package/dist/tooltip/examples/with-arrow.html.js +5 -0
- package/dist/tooltip/tooltip.controller-def.d.ts +3 -5
- package/dist/tooltip/tooltip.controller-def.js +1 -1
- package/dist/tour/examples/basic.html +5 -5
- package/dist/tour/examples/basic.html.js +5 -0
- package/dist/tour/tour.events.d.ts +2 -3
- package/dist/tour/tour.machine.d.ts +7 -3
- package/dist/tour/tour.machine.js +1 -1
- package/dist/tour/tour.presentation.d.ts +6 -7
- package/dist/tour/tour.presentation.js +1 -1
- package/dist/tour/tour.state.d.ts +1 -2
- package/dist/tour/tour.state.js +1 -1
- package/dist/tour/tour.transitions.d.ts +3 -4
- package/dist/tree-view/examples/basic.html +10 -10
- package/dist/tree-view/examples/basic.html.js +5 -0
- package/dist/tree-view/examples/loading.html +11 -11
- package/dist/tree-view/examples/loading.html.js +5 -0
- package/dist/tree-view/tree-view.events.d.ts +2 -3
- package/dist/tree-view/tree-view.machine.d.ts +2 -3
- package/dist/tree-view/tree-view.machine.js +1 -1
- package/dist/tree-view/tree-view.presentation.d.ts +9 -10
- package/dist/tree-view/tree-view.presentation.js +2 -2
- package/dist/tree-view/tree-view.state.d.ts +1 -2
- package/dist/tree-view/tree-view.state.js +1 -1
- package/dist/tree-view/tree-view.transitions.d.ts +3 -4
- package/package.json +43 -8
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { effect, own, scope } from "../core/signal.js";
|
|
2
|
+
// src/runtime/directives/bind.ts
|
|
3
|
+
function bindText(node, get) {
|
|
4
|
+
let last;
|
|
5
|
+
effect(() => {
|
|
6
|
+
const v = get();
|
|
7
|
+
if (v !== last) {
|
|
8
|
+
last = v;
|
|
9
|
+
node.data = v == null ? "" : String(v);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/** The class a markup's class attribute holds.
|
|
14
|
+
*
|
|
15
|
+
* The attribute takes the shape the markup reads best: a list of parts,
|
|
16
|
+
* where a part is a string of classes or an object of conditions.
|
|
17
|
+
*
|
|
18
|
+
* class={["mb-4 text-sm text-muted", { "bg-primary": focused }]}
|
|
19
|
+
*
|
|
20
|
+
* A string is the classes themselves — plain text, so the build's
|
|
21
|
+
* extractor sees them as they are. An object's keys are the classes and
|
|
22
|
+
* its values the conditions; a key whose value is truthy is in.
|
|
23
|
+
*
|
|
24
|
+
* The values are live reads, so the class follows the state.
|
|
25
|
+
*/
|
|
26
|
+
function classOf(classes) {
|
|
27
|
+
const out = [];
|
|
28
|
+
const keys = [];
|
|
29
|
+
const groupOf = (core) => {
|
|
30
|
+
let match;
|
|
31
|
+
if (/^bg-(.+)$/.exec(core) !== null) return "bg";
|
|
32
|
+
if (/^text-(left|center|right|justify|start|end)$/.exec(core) !== null) return "text-align";
|
|
33
|
+
if (/^text-(.+)$/.exec(core) !== null) return "text-color";
|
|
34
|
+
if (/^type-(.+)$/.exec(core) !== null) return "type";
|
|
35
|
+
if (/^opacity-\d+$/.exec(core) !== null) return "opacity";
|
|
36
|
+
if (/^cursor-(.+)$/.exec(core) !== null) return "cursor";
|
|
37
|
+
if (/^-?scale-(.+)$/.exec(core) !== null) return "scale";
|
|
38
|
+
if (/^-?rotate-(.+)$/.exec(core) !== null) return "rotate";
|
|
39
|
+
if (/^shadow(?:-(.+))?$/.exec(core) !== null) return "shadow";
|
|
40
|
+
if (/^rounded(?:-(none|sm|md|lg|xl|2xl|3xl|full))?$/.exec(core) !== null) return "rounded";
|
|
41
|
+
if (/^border(?:-(0|2|4|8))?$/.exec(core) !== null) return "border-width";
|
|
42
|
+
if (/^border-(solid|dashed|dotted|double|none)$/.exec(core) !== null) return "border-style";
|
|
43
|
+
if (/^border-(?!t$|r$|b$|l$|x$|y$|s$|e$|t-|r-|b-|l-|x-|y-|s-|e-)(.+)$/.exec(core) !== null) return "border-color";
|
|
44
|
+
match = /^(p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|w|h|min-w|max-w|min-h|max-h|z)-(.+)$/.exec(core);
|
|
45
|
+
if (match !== null) return match[1];
|
|
46
|
+
if (/^(block|inline-block|inline|flex|inline-flex|grid|inline-grid|contents|hidden)$/.exec(core) !== null) return "display";
|
|
47
|
+
if (/^(static|relative|absolute|fixed|sticky)$/.exec(core) !== null) return "position";
|
|
48
|
+
return null;
|
|
49
|
+
};
|
|
50
|
+
const push = (text) => {
|
|
51
|
+
for (const token of text.split(/\s+/)) {
|
|
52
|
+
if (token.length === 0) continue;
|
|
53
|
+
const cut = token.lastIndexOf(":");
|
|
54
|
+
const variant = cut === -1 ? "" : token.slice(0, cut + 1);
|
|
55
|
+
const core = cut === -1 ? token : token.slice(cut + 1);
|
|
56
|
+
const group = groupOf(core);
|
|
57
|
+
if (group === null) {
|
|
58
|
+
out.push(token);
|
|
59
|
+
keys.push(null);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const conflictKey = variant + group;
|
|
63
|
+
const fill = /^bg-(.+)$/.exec(core)?.[1];
|
|
64
|
+
for (let index = out.length - 1; index >= 0; index--) if (keys[index] === conflictKey) {
|
|
65
|
+
if (fill !== void 0 && group === "bg" && (fill === "surface" || fill.startsWith("surface-") || fill === "transparent")) {
|
|
66
|
+
const prevFill = /^bg-(.+)$/.exec(out[index].slice(variant.length))?.[1];
|
|
67
|
+
if (prevFill !== void 0) {
|
|
68
|
+
const inkKey = `${variant}text-on-${prevFill}`;
|
|
69
|
+
const at = out.indexOf(inkKey);
|
|
70
|
+
if (at !== -1) {
|
|
71
|
+
out.splice(at, 1);
|
|
72
|
+
keys.splice(at, 1);
|
|
73
|
+
if (at <= index) index -= 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
out.splice(index, 1);
|
|
78
|
+
keys.splice(index, 1);
|
|
79
|
+
}
|
|
80
|
+
out.push(token);
|
|
81
|
+
keys.push(conflictKey);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
const part = (value) => {
|
|
85
|
+
if (typeof value === "string") {
|
|
86
|
+
push(value);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (Array.isArray(value)) {
|
|
90
|
+
for (const item of value) part(item);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (value !== null && typeof value === "object") for (const [name, condition] of Object.entries(value)) {
|
|
94
|
+
if (!condition) continue;
|
|
95
|
+
push(name);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
part(classes);
|
|
99
|
+
return out.join(" ");
|
|
100
|
+
}
|
|
101
|
+
function bindAttr(el, name, get) {
|
|
102
|
+
let last = Symbol("init");
|
|
103
|
+
effect(() => {
|
|
104
|
+
const v = get();
|
|
105
|
+
if (Object.is(v, last)) return;
|
|
106
|
+
last = v;
|
|
107
|
+
if (v === void 0 || v === null || v === false) el.removeAttribute(name);
|
|
108
|
+
else if (v === true) el.setAttribute(name, "");
|
|
109
|
+
else el.setAttribute(name, String(v));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function bindProp(el, name, get) {
|
|
113
|
+
const view = el;
|
|
114
|
+
effect(() => {
|
|
115
|
+
view[name] = get();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function bindDynamic(el, name, get) {
|
|
119
|
+
if (el.tagName.includes("-")) bindProp(el, name, get);
|
|
120
|
+
else bindAttr(el, name, get);
|
|
121
|
+
}
|
|
122
|
+
function bindValue(el, source) {
|
|
123
|
+
const view = el;
|
|
124
|
+
let last = source();
|
|
125
|
+
view["value"] = last;
|
|
126
|
+
const onInput = () => {
|
|
127
|
+
const next = view["value"];
|
|
128
|
+
if (next === last) return;
|
|
129
|
+
last = next;
|
|
130
|
+
source.set(next);
|
|
131
|
+
};
|
|
132
|
+
el.addEventListener("input", onInput);
|
|
133
|
+
const stopInput = () => el.removeEventListener("input", onInput);
|
|
134
|
+
let stopEffect = () => {};
|
|
135
|
+
{
|
|
136
|
+
const owner = scope();
|
|
137
|
+
owner.run(() => effect(() => {
|
|
138
|
+
const next = source();
|
|
139
|
+
if (next === last) return;
|
|
140
|
+
last = next;
|
|
141
|
+
if (view["value"] !== next) view["value"] = next;
|
|
142
|
+
}));
|
|
143
|
+
const dispose = () => owner.dispose();
|
|
144
|
+
stopEffect = dispose;
|
|
145
|
+
}
|
|
146
|
+
const stop = () => {
|
|
147
|
+
stopInput();
|
|
148
|
+
stopEffect();
|
|
149
|
+
};
|
|
150
|
+
try {
|
|
151
|
+
own(stop);
|
|
152
|
+
} catch {}
|
|
153
|
+
return {
|
|
154
|
+
pull() {
|
|
155
|
+
const next = source();
|
|
156
|
+
if (next === last) return;
|
|
157
|
+
last = next;
|
|
158
|
+
if (view["value"] !== next) view["value"] = next;
|
|
159
|
+
},
|
|
160
|
+
stop
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
function bindChecked(el, source) {
|
|
164
|
+
let last = source();
|
|
165
|
+
el.checked = last;
|
|
166
|
+
const onInput = () => {
|
|
167
|
+
const next = el.checked;
|
|
168
|
+
if (next === last) return;
|
|
169
|
+
last = next;
|
|
170
|
+
source.set(next);
|
|
171
|
+
};
|
|
172
|
+
el.addEventListener("input", onInput);
|
|
173
|
+
const stopInput = () => el.removeEventListener("input", onInput);
|
|
174
|
+
let stopEffect = () => {};
|
|
175
|
+
{
|
|
176
|
+
const owner = scope();
|
|
177
|
+
owner.run(() => effect(() => {
|
|
178
|
+
const next = source();
|
|
179
|
+
if (next === last) return;
|
|
180
|
+
last = next;
|
|
181
|
+
el.checked = next;
|
|
182
|
+
}));
|
|
183
|
+
stopEffect = () => owner.dispose();
|
|
184
|
+
}
|
|
185
|
+
const stop = () => {
|
|
186
|
+
stopInput();
|
|
187
|
+
stopEffect();
|
|
188
|
+
};
|
|
189
|
+
try {
|
|
190
|
+
own(stop);
|
|
191
|
+
} catch {}
|
|
192
|
+
return {
|
|
193
|
+
pull() {
|
|
194
|
+
const next = source();
|
|
195
|
+
if (next === last) return;
|
|
196
|
+
last = next;
|
|
197
|
+
el.checked = next;
|
|
198
|
+
},
|
|
199
|
+
stop
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Light-DOM transclusion. At build start the element's existing children are
|
|
204
|
+
* moved out and grouped by their `slot` attribute (`""` = default). A
|
|
205
|
+
* `<slot name="x">` in markup resolves to its group; unmatched groups are
|
|
206
|
+
* dropped (native slot behavior — unassigned nodes render nowhere).
|
|
207
|
+
*
|
|
208
|
+
* Why manual instead of shadow DOM: the preset styles light DOM, and every
|
|
209
|
+
* selector in the system assumes it. Shadow would isolate correctly and
|
|
210
|
+
* break everything else.
|
|
211
|
+
*/
|
|
212
|
+
const projectedSlots = /* @__PURE__ */ new WeakMap();
|
|
213
|
+
function projectSlots(el) {
|
|
214
|
+
const cached = projectedSlots.get(el);
|
|
215
|
+
if (cached !== void 0) {
|
|
216
|
+
for (const node of [...el.childNodes]) {
|
|
217
|
+
if (node.nodeType === 8) continue;
|
|
218
|
+
el.removeChild(node);
|
|
219
|
+
}
|
|
220
|
+
return cached;
|
|
221
|
+
}
|
|
222
|
+
const groups = /* @__PURE__ */ new Map();
|
|
223
|
+
for (const node of [...el.childNodes]) {
|
|
224
|
+
if (node.nodeType === 8) continue;
|
|
225
|
+
const name = node instanceof Element ? node.getAttribute("slot") ?? "" : "";
|
|
226
|
+
const group = groups.get(name);
|
|
227
|
+
if (group !== void 0) group.push(node);
|
|
228
|
+
else groups.set(name, [node]);
|
|
229
|
+
el.removeChild(node);
|
|
230
|
+
}
|
|
231
|
+
projectedSlots.set(el, groups);
|
|
232
|
+
return groups;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Places assigned nodes (moved, never cloned — state and listeners travel)
|
|
236
|
+
* before `anchor`, or the fallback nodes when nothing was assigned.
|
|
237
|
+
*/
|
|
238
|
+
function placeSlot(host, anchor, assigned, fallback) {
|
|
239
|
+
const nodes = assigned !== void 0 && assigned.length > 0 ? assigned : fallback;
|
|
240
|
+
for (const n of nodes) if (n.parentNode !== host || n.nextSibling !== anchor) host.insertBefore(n, anchor);
|
|
241
|
+
}
|
|
242
|
+
export { bindAttr, bindChecked, bindDynamic, bindProp, bindText, bindValue, classOf, placeSlot, projectSlots };
|
|
243
|
+
|
|
244
|
+
//# sourceMappingURL=bind.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RenderedItem {
|
|
2
|
+
nodes: Node[];
|
|
3
|
+
cleanup?: () => void;
|
|
4
|
+
update?: (item: unknown, index: number) => void;
|
|
5
|
+
}
|
|
6
|
+
export interface BindForOptions<T> {
|
|
7
|
+
anchor: Comment;
|
|
8
|
+
items: () => readonly T[];
|
|
9
|
+
key: (item: T, index: number) => unknown;
|
|
10
|
+
render: (item: T, index: number) => RenderedItem;
|
|
11
|
+
}
|
|
12
|
+
export declare function bindFor<T>(opts: BindForOptions<T>): () => void;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { effect, own, scope, untrack } from "../core/signal.js";
|
|
2
|
+
// src/runtime/directives/for.ts
|
|
3
|
+
function bindFor(opts) {
|
|
4
|
+
const { anchor, items, key, render } = opts;
|
|
5
|
+
const parent = () => anchor.parentNode;
|
|
6
|
+
let cells = [];
|
|
7
|
+
let index = /* @__PURE__ */ new Map();
|
|
8
|
+
let last;
|
|
9
|
+
const sync = (list) => {
|
|
10
|
+
const host = parent();
|
|
11
|
+
if (host === null) return;
|
|
12
|
+
const next = new Array(list.length);
|
|
13
|
+
for (let i = 0; i < list.length; i++) {
|
|
14
|
+
const item = list[i];
|
|
15
|
+
const k = key(item, i);
|
|
16
|
+
const bucket = index.get(k);
|
|
17
|
+
const hit = bucket !== void 0 && bucket.at < bucket.cells.length ? bucket.cells[bucket.at++] : void 0;
|
|
18
|
+
if (hit !== void 0) {
|
|
19
|
+
hit.item = item;
|
|
20
|
+
next[i] = hit;
|
|
21
|
+
} else {
|
|
22
|
+
const owner = scope();
|
|
23
|
+
let rendered;
|
|
24
|
+
untrack(() => {
|
|
25
|
+
owner.run(() => {
|
|
26
|
+
rendered = render(item, i);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const nodes = [...rendered.nodes];
|
|
30
|
+
for (const n of nodes) host.insertBefore(n, anchor);
|
|
31
|
+
next[i] = {
|
|
32
|
+
key: k,
|
|
33
|
+
item,
|
|
34
|
+
rendered,
|
|
35
|
+
nodes,
|
|
36
|
+
owner
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const dead = [];
|
|
41
|
+
const keep = /* @__PURE__ */ new Set();
|
|
42
|
+
for (const cell of next) for (const n of cell.nodes) keep.add(n);
|
|
43
|
+
for (const cell of cells) {
|
|
44
|
+
let alive = false;
|
|
45
|
+
for (const n of cell.nodes) if (keep.has(n)) {
|
|
46
|
+
alive = true;
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
if (!alive) dead.push(cell);
|
|
50
|
+
}
|
|
51
|
+
let cursor = anchor;
|
|
52
|
+
for (let idx = next.length - 1; idx >= 0; idx--) {
|
|
53
|
+
const cell = next[idx];
|
|
54
|
+
if (cell.nodes.length === 0) continue;
|
|
55
|
+
for (let k = cell.nodes.length - 1; k >= 0; k--) {
|
|
56
|
+
const n = cell.nodes[k];
|
|
57
|
+
if (n.parentNode !== host) host.insertBefore(n, cursor);
|
|
58
|
+
else if (n.nextSibling !== cursor) host.insertBefore(n, cursor);
|
|
59
|
+
cursor = n;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (let i = 0; i < next.length; i++) {
|
|
63
|
+
const cell = next[i];
|
|
64
|
+
cell.rendered.update?.(cell.item, i);
|
|
65
|
+
}
|
|
66
|
+
for (const cell of dead) {
|
|
67
|
+
for (const n of cell.nodes) if (n.parentNode === host) host.removeChild(n);
|
|
68
|
+
cell.rendered.cleanup?.();
|
|
69
|
+
cell.owner.dispose();
|
|
70
|
+
}
|
|
71
|
+
cells = next;
|
|
72
|
+
const rebuilt = /* @__PURE__ */ new Map();
|
|
73
|
+
for (const cell of next) {
|
|
74
|
+
const bucket = rebuilt.get(cell.key);
|
|
75
|
+
if (bucket === void 0) rebuilt.set(cell.key, {
|
|
76
|
+
cells: [cell],
|
|
77
|
+
at: 0
|
|
78
|
+
});
|
|
79
|
+
else bucket.cells.push(cell);
|
|
80
|
+
}
|
|
81
|
+
index = rebuilt;
|
|
82
|
+
};
|
|
83
|
+
effect(() => {
|
|
84
|
+
const v = items();
|
|
85
|
+
if (v !== last) {
|
|
86
|
+
last = v;
|
|
87
|
+
sync(v ?? []);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const stop = () => {
|
|
91
|
+
for (const cell of cells) {
|
|
92
|
+
cell.rendered.cleanup?.();
|
|
93
|
+
cell.owner.dispose();
|
|
94
|
+
}
|
|
95
|
+
cells = [];
|
|
96
|
+
};
|
|
97
|
+
try {
|
|
98
|
+
own(stop);
|
|
99
|
+
} catch {}
|
|
100
|
+
return stop;
|
|
101
|
+
}
|
|
102
|
+
export { bindFor };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=for.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface BranchRender {
|
|
2
|
+
nodes: Node[];
|
|
3
|
+
cleanup?: () => void;
|
|
4
|
+
}
|
|
5
|
+
export interface BindIfOptions {
|
|
6
|
+
anchor: Comment;
|
|
7
|
+
test: () => number;
|
|
8
|
+
branches: Array<() => BranchRender>;
|
|
9
|
+
}
|
|
10
|
+
export declare function bindIf(opts: BindIfOptions): () => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { effect, own, scope, untrack } from "../core/signal.js";
|
|
2
|
+
// src/runtime/directives/if.ts
|
|
3
|
+
function bindIf(opts) {
|
|
4
|
+
const { anchor, test, branches } = opts;
|
|
5
|
+
let nodes = [];
|
|
6
|
+
let cleanup;
|
|
7
|
+
let owner;
|
|
8
|
+
let last;
|
|
9
|
+
const teardown = () => {
|
|
10
|
+
cleanup?.();
|
|
11
|
+
cleanup = void 0;
|
|
12
|
+
owner?.dispose();
|
|
13
|
+
owner = void 0;
|
|
14
|
+
const host = anchor.parentNode;
|
|
15
|
+
if (host !== null) {
|
|
16
|
+
for (const n of nodes) if (n.parentNode === host) host.removeChild(n);
|
|
17
|
+
}
|
|
18
|
+
nodes = [];
|
|
19
|
+
};
|
|
20
|
+
effect(() => {
|
|
21
|
+
const v = test();
|
|
22
|
+
if (v === last) return;
|
|
23
|
+
last = v;
|
|
24
|
+
teardown();
|
|
25
|
+
if (v < 0 || v >= branches.length) return;
|
|
26
|
+
const next = scope();
|
|
27
|
+
owner = next;
|
|
28
|
+
let rendered;
|
|
29
|
+
next.run(() => untrack(() => {
|
|
30
|
+
rendered = branches[v]();
|
|
31
|
+
}));
|
|
32
|
+
cleanup = rendered.cleanup;
|
|
33
|
+
nodes = rendered.nodes;
|
|
34
|
+
const host = anchor.parentNode;
|
|
35
|
+
if (host !== null) for (const n of nodes) host.insertBefore(n, anchor);
|
|
36
|
+
});
|
|
37
|
+
const stop = () => teardown();
|
|
38
|
+
try {
|
|
39
|
+
own(stop);
|
|
40
|
+
} catch {}
|
|
41
|
+
return stop;
|
|
42
|
+
}
|
|
43
|
+
export { bindIf };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=if.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementAction } from "./use.js";
|
|
2
|
+
import { Node } from "../syntax/ir.js";
|
|
3
|
+
import { Handle } from "../scope/table.js";
|
|
4
|
+
export interface LoaderActions {
|
|
5
|
+
readonly [name: string]: ElementAction<unknown>;
|
|
6
|
+
}
|
|
7
|
+
export interface LoaderScope {
|
|
8
|
+
readonly [name: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export declare function load(source: string, actions: LoaderActions, values: LoaderScope, onUnknown?: "throw" | "skip", resolve?: (handle: Handle) => unknown): {
|
|
11
|
+
nodes: Node[];
|
|
12
|
+
dispose(): void;
|
|
13
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { bindAttr, bindText } from "./bind.js";
|
|
2
|
+
import { bindSpread } from "./spread.js";
|
|
3
|
+
import { on, runAction } from "./use.js";
|
|
4
|
+
import { scope } from "../core/signal.js";
|
|
5
|
+
import { bindFor } from "./for.js";
|
|
6
|
+
import { parse } from "../syntax/parse.js";
|
|
7
|
+
// src/runtime/directives/load.ts
|
|
8
|
+
function resolve(value) {
|
|
9
|
+
if (typeof value === "function" && value.length === 0) try {
|
|
10
|
+
return value();
|
|
11
|
+
} catch {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
function readExpr(expr, values) {
|
|
17
|
+
const names = Object.keys(values);
|
|
18
|
+
const args = names.map((name) => values[name]);
|
|
19
|
+
try {
|
|
20
|
+
return resolve(new Function(...names, `return (${expr});`)(...args));
|
|
21
|
+
} catch {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function callExpr(expr, values) {
|
|
26
|
+
const fn = readExpr(expr, values);
|
|
27
|
+
if (typeof fn === "function") return fn;
|
|
28
|
+
return () => void 0;
|
|
29
|
+
}
|
|
30
|
+
function wire(root, ir, actions, values, _parts) {
|
|
31
|
+
const walk = (nodes, mount, _target, rowScope) => {
|
|
32
|
+
const active = rowScope ?? values;
|
|
33
|
+
for (const node of nodes) {
|
|
34
|
+
if (node.kind === "text") {
|
|
35
|
+
if (!node.parts.some((part) => part.kind === "expr")) {
|
|
36
|
+
const text = node.parts.map((part) => part.kind === "static" ? part.value : "").join("");
|
|
37
|
+
if (text.length > 0) mount.appendChild(document.createTextNode(text));
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
const t = document.createTextNode("");
|
|
41
|
+
mount.appendChild(t);
|
|
42
|
+
bindText(t, () => {
|
|
43
|
+
let out = "";
|
|
44
|
+
for (const part of node.parts) if (part.kind === "static") out += part.value;
|
|
45
|
+
else {
|
|
46
|
+
const v = readExpr(part.expr, active);
|
|
47
|
+
out += v == null ? "" : String(v);
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
});
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (node.kind === "for") {
|
|
54
|
+
const anchor = document.createComment("for");
|
|
55
|
+
mount.appendChild(anchor);
|
|
56
|
+
bindFor({
|
|
57
|
+
anchor,
|
|
58
|
+
items: () => readExpr(node.source, active) ?? [],
|
|
59
|
+
key: node.key !== void 0 ? (item, i) => readExpr(node.key, {
|
|
60
|
+
...active,
|
|
61
|
+
[node.binding]: item,
|
|
62
|
+
i
|
|
63
|
+
}) : (_item, i) => i,
|
|
64
|
+
render: (item) => {
|
|
65
|
+
const frag = document.createDocumentFragment();
|
|
66
|
+
const rowScope = {
|
|
67
|
+
...active,
|
|
68
|
+
[node.binding]: item
|
|
69
|
+
};
|
|
70
|
+
walk(node.body, frag, [], rowScope);
|
|
71
|
+
return { nodes: [...frag.childNodes] };
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
const el = document.createElement(node.tag);
|
|
77
|
+
for (const attr of node.attrs) if (attr.value.kind === "static") el.setAttribute(attr.name, attr.value.value);
|
|
78
|
+
else {
|
|
79
|
+
const expr = attr.value.expr;
|
|
80
|
+
bindAttr(el, attr.name, () => readExpr(expr, active));
|
|
81
|
+
}
|
|
82
|
+
for (const ev of node.events) {
|
|
83
|
+
const handler = callExpr(ev.handler, active);
|
|
84
|
+
on(el, ev.event, (e) => handler(e));
|
|
85
|
+
}
|
|
86
|
+
for (const use of node.actions) {
|
|
87
|
+
const action = actions[use.name];
|
|
88
|
+
if (typeof action === "function") {
|
|
89
|
+
if (use.param !== void 0) runAction(el, action, () => readExpr(use.param, active));
|
|
90
|
+
else runAction(el, action, void 0);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
for (const spread of node.spreads) bindSpread(el, () => readExpr(spread.expr, active));
|
|
94
|
+
mount.appendChild(el);
|
|
95
|
+
walk(node.children, el, [], active);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
walk(ir.nodes, root, _parts);
|
|
99
|
+
}
|
|
100
|
+
function load(source, actions, values, onUnknown = "skip", resolve) {
|
|
101
|
+
const ir = parse(source);
|
|
102
|
+
const frag = document.createDocumentFragment();
|
|
103
|
+
const owner = scope();
|
|
104
|
+
const effectiveValues = resolve ? {
|
|
105
|
+
...values,
|
|
106
|
+
"@@resolve": resolve
|
|
107
|
+
} : values;
|
|
108
|
+
const stop = owner.run(() => {
|
|
109
|
+
wire(frag, ir, actions, effectiveValues, []);
|
|
110
|
+
return () => owner.dispose();
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
nodes: [...frag.childNodes],
|
|
114
|
+
dispose: stop
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export { load };
|
|
118
|
+
|
|
119
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive prop application from a live reader.
|
|
3
|
+
*
|
|
4
|
+
* Loader-owned effect: called from emitted code in build scope. The reader
|
|
5
|
+
* re-runs when a signal it reads moves, plus on insertion. Handlers (on*)
|
|
6
|
+
* are skipped — actions own those.
|
|
7
|
+
*/
|
|
8
|
+
export declare function bindActionProps(el: Element, read: () => Record<string, unknown>): void;
|
|
9
|
+
/**
|
|
10
|
+
* Reactive spread application from a live reader.
|
|
11
|
+
*
|
|
12
|
+
* Same lifecycle as bindActionProps (signal-driven), but `on*`
|
|
13
|
+
* function values attach as event listeners instead of being skipped —
|
|
14
|
+
* the bag owns its handlers. Listener names are the lowercased slice(2)
|
|
15
|
+
* of the key; a camelCase name (`onFocus`) is already the DOM spelling.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bindSpread(el: Element, read: () => Record<string, unknown>): () => void;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { effect, signal, untrack } from "../core/signal.js";
|
|
2
|
+
import { runAction } from "../actions/action.js";
|
|
3
|
+
import { ACTIONS } from "../actions/index.js";
|
|
4
|
+
import { runInElement } from "../scope/element.js";
|
|
5
|
+
import { toStyleString } from "../core/style.js";
|
|
6
|
+
// src/runtime/directives/spread.ts
|
|
7
|
+
/**
|
|
8
|
+
* Properties written through the IDL rather than as content attributes.
|
|
9
|
+
*/
|
|
10
|
+
const ASSIGNABLE = /* @__PURE__ */ new Set([
|
|
11
|
+
"value",
|
|
12
|
+
"checked",
|
|
13
|
+
"selected",
|
|
14
|
+
"tabIndex"
|
|
15
|
+
]);
|
|
16
|
+
/**
|
|
17
|
+
* Whether the element declares the name as a writable property. A
|
|
18
|
+
* declared prop crosses through its accessor — an array or an object
|
|
19
|
+
* cannot travel as an attribute, and the element's grammar owns the
|
|
20
|
+
* coercion. A getter-only property (the DOM's `form`, say) stays on the
|
|
21
|
+
* attribute path: writing it would throw.
|
|
22
|
+
*/
|
|
23
|
+
const hasAccessor = (el, name) => {
|
|
24
|
+
let target = el;
|
|
25
|
+
while (target !== null) {
|
|
26
|
+
const desc = Object.getOwnPropertyDescriptor(target, name);
|
|
27
|
+
if (desc !== void 0) return typeof desc.set === "function";
|
|
28
|
+
target = Object.getPrototypeOf(target);
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Reactive prop application from a live reader.
|
|
34
|
+
*
|
|
35
|
+
* Loader-owned effect: called from emitted code in build scope. The reader
|
|
36
|
+
* re-runs when a signal it reads moves, plus on insertion. Handlers (on*)
|
|
37
|
+
* are skipped — actions own those.
|
|
38
|
+
*/
|
|
39
|
+
function bindActionProps(el, read) {
|
|
40
|
+
let last = {};
|
|
41
|
+
effect(() => {
|
|
42
|
+
const props = read();
|
|
43
|
+
for (const name of Object.keys(last)) if (!(name in props) && !name.startsWith("on")) el.removeAttribute(name);
|
|
44
|
+
for (const [name, value] of Object.entries(props)) {
|
|
45
|
+
if (name.startsWith("on")) continue;
|
|
46
|
+
if (!ASSIGNABLE.has(name) && Object.is(value, last[name])) continue;
|
|
47
|
+
if (ASSIGNABLE.has(name)) el[name] = value;
|
|
48
|
+
else if (name.startsWith("aria-") && (value === true || value === false)) el.setAttribute(name, value === true ? "true" : "false");
|
|
49
|
+
else if (value === void 0 || value === null || value === false) el.removeAttribute(name);
|
|
50
|
+
else if (value === true) el.setAttribute(name, "");
|
|
51
|
+
else el.setAttribute(name, String(value));
|
|
52
|
+
}
|
|
53
|
+
last = props;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Reactive spread application from a live reader.
|
|
58
|
+
*
|
|
59
|
+
* Same lifecycle as bindActionProps (signal-driven), but `on*`
|
|
60
|
+
* function values attach as event listeners instead of being skipped —
|
|
61
|
+
* the bag owns its handlers. Listener names are the lowercased slice(2)
|
|
62
|
+
* of the key; a camelCase name (`onFocus`) is already the DOM spelling.
|
|
63
|
+
*/
|
|
64
|
+
function bindSpread(el, read) {
|
|
65
|
+
let last = {};
|
|
66
|
+
const attached = /* @__PURE__ */ new Map();
|
|
67
|
+
const latest = signal({});
|
|
68
|
+
const attachedActions = /* @__PURE__ */ new Set();
|
|
69
|
+
effect(() => {
|
|
70
|
+
const props = read();
|
|
71
|
+
for (const name of Object.keys(last)) {
|
|
72
|
+
const directive = name.startsWith("use:");
|
|
73
|
+
if (!(name in props) && !name.startsWith("on") && !directive) el.removeAttribute(name);
|
|
74
|
+
}
|
|
75
|
+
const seen = /* @__PURE__ */ new Set();
|
|
76
|
+
const EVENT_ALIASES = { doubleclick: "dblclick" };
|
|
77
|
+
for (const [name, value] of Object.entries(props)) {
|
|
78
|
+
if (name.startsWith("on") && typeof value === "function") {
|
|
79
|
+
const type = EVENT_ALIASES[name.slice(2).toLowerCase()] ?? name.slice(2).toLowerCase();
|
|
80
|
+
const listener = value;
|
|
81
|
+
seen.add(type);
|
|
82
|
+
if (attached.get(type) !== listener) {
|
|
83
|
+
const prev = attached.get(type);
|
|
84
|
+
if (prev !== void 0) el.removeEventListener(type, prev);
|
|
85
|
+
el.addEventListener(type, listener);
|
|
86
|
+
attached.set(type, listener);
|
|
87
|
+
}
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (name.startsWith("use:")) continue;
|
|
91
|
+
if (Object.is(value, last[name])) continue;
|
|
92
|
+
if (name === "style") el.setAttribute("style", toStyleString(value));
|
|
93
|
+
else if (ASSIGNABLE.has(name) || hasAccessor(el, name)) el[name] = value;
|
|
94
|
+
else if (name.startsWith("aria-") && typeof value === "boolean") el.setAttribute(name, String(value));
|
|
95
|
+
else if (value === void 0 || value === null || value === false) el.removeAttribute(name);
|
|
96
|
+
else if (value === true) el.setAttribute(name, "");
|
|
97
|
+
else el.setAttribute(name, String(value));
|
|
98
|
+
}
|
|
99
|
+
for (const [type, fn] of attached) if (!seen.has(type)) {
|
|
100
|
+
el.removeEventListener(type, fn);
|
|
101
|
+
attached.delete(type);
|
|
102
|
+
}
|
|
103
|
+
last = props;
|
|
104
|
+
latest(props);
|
|
105
|
+
for (const name of Object.keys(props)) {
|
|
106
|
+
if (!name.startsWith("use:") || name.length <= 4) continue;
|
|
107
|
+
if (attachedActions.has(name)) continue;
|
|
108
|
+
const action = ACTIONS[name.slice(4)];
|
|
109
|
+
if (typeof action !== "function") continue;
|
|
110
|
+
attachedActions.add(name);
|
|
111
|
+
runInElement(el, () => untrack(() => runAction(el, action, () => {
|
|
112
|
+
const entry = latest()[name];
|
|
113
|
+
return typeof entry === "function" ? entry() : entry;
|
|
114
|
+
})));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
return () => {};
|
|
118
|
+
}
|
|
119
|
+
export { bindActionProps, bindSpread };
|
|
120
|
+
|
|
121
|
+
//# sourceMappingURL=spread.js.map
|