@type-dom/ui 0.1.1 → 0.1.3
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 +134 -44
- package/package.json +12 -2
- package/src/components/base/style/css.d.ts +1 -1
- package/src/components/base/style/css.js +1 -1
- package/src/components/basic/index.d.ts +0 -1
- package/src/components/basic/index.js +1 -3
- package/src/components/basic/td-button/style/index.d.ts +1 -1
- package/src/components/basic/td-button/style/index.js +1 -1
- package/src/components/basic/td-button/td-button.abstract.js +8 -9
- package/src/components/basic/td-button/td-button.interface.d.ts +2 -1
- package/src/components/basic/td-button/td-button.stories.d.ts +4 -0
- package/src/components/basic/td-button/td-button.stories.js +15 -0
- package/src/components/basic/td-button/use-button.d.ts +2 -2
- package/src/components/basic/td-button/use-button.js +2 -2
- package/src/components/basic/td-button-group/td-button-group.class.d.ts +3 -3
- package/src/components/basic/td-button-group/td-button-group.class.js +2 -2
- package/src/components/basic/td-button-group/td-button-group.interface.d.ts +2 -2
- package/src/components/basic/td-container/style/css.d.ts +1 -1
- package/src/components/basic/td-container/style/css.js +1 -1
- package/src/components/basic/td-container/td-aside/style/css.d.ts +1 -1
- package/src/components/basic/td-container/td-aside/style/css.js +1 -1
- package/src/components/basic/td-container/td-aside/style/index.d.ts +1 -1
- package/src/components/basic/td-container/td-aside/style/index.js +1 -1
- package/src/components/basic/td-container/td-aside/td-aside.class.js +7 -6
- package/src/components/basic/td-container/td-container.class.d.ts +1 -5
- package/src/components/basic/td-container/td-container.class.js +5 -7
- package/src/components/basic/td-container/td-container.js +2 -2
- package/src/components/basic/td-container/td-footer/style/css.d.ts +1 -1
- package/src/components/basic/td-container/td-footer/style/css.js +1 -1
- package/src/components/basic/td-container/td-footer/style/index.d.ts +1 -1
- package/src/components/basic/td-container/td-footer/style/index.js +1 -1
- package/src/components/basic/td-container/td-header/style/css.d.ts +1 -1
- package/src/components/basic/td-container/td-header/style/css.js +1 -1
- package/src/components/basic/td-container/td-header/style/index.d.ts +1 -1
- package/src/components/basic/td-container/td-header/style/index.js +1 -1
- package/src/components/basic/td-container/td-header/td-header.class.js +1 -1
- package/src/components/basic/td-container/td-main/style/css.d.ts +1 -1
- package/src/components/basic/td-container/td-main/style/css.js +1 -1
- package/src/components/basic/td-container/td-main/style/index.d.ts +1 -1
- package/src/components/basic/td-container/td-main/style/index.js +1 -1
- package/src/components/basic/td-icon/td-icon.class.js +1 -1
- package/src/components/basic/td-layout/td-col/style/css.d.ts +1 -1
- package/src/components/basic/td-layout/td-col/style/css.js +1 -1
- package/src/components/basic/td-layout/td-col/td-col.class.js +1 -1
- package/src/components/basic/td-layout/td-row/style/css.d.ts +1 -1
- package/src/components/basic/td-layout/td-row/style/css.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.class.d.ts +9 -16
- package/src/components/basic/td-scrollbar/bar/bar.class.js +51 -48
- package/src/components/basic/td-scrollbar/bar/bar.const.d.ts +2 -2
- package/src/components/basic/td-scrollbar/bar/bar.const.js +1 -1
- package/src/components/basic/td-scrollbar/bar/bar.interface.d.ts +3 -3
- package/src/components/basic/td-scrollbar/style/css.d.ts +1 -1
- package/src/components/basic/td-scrollbar/style/css.js +1 -1
- package/src/components/basic/td-scrollbar/td-scrollbar.class.d.ts +8 -10
- package/src/components/basic/td-scrollbar/td-scrollbar.class.js +145 -110
- package/src/components/basic/td-scrollbar/td-scrollbar.const.d.ts +2 -2
- package/src/components/basic/td-scrollbar/td-scrollbar.interface.d.ts +14 -6
- package/src/components/basic/td-scrollbar/thumb/thumb.class.d.ts +5 -7
- package/src/components/basic/td-scrollbar/thumb/thumb.class.js +85 -95
- package/src/components/basic/td-scrollbar/thumb/thumb.interface.d.ts +7 -6
- package/src/components/basic/td-scrollbar/util.d.ts +2 -2
- package/src/components/basic/td-scrollbar/util.js +11 -4
- package/src/components/basic/td-space/style/css.d.ts +1 -1
- package/src/components/basic/td-space/style/css.js +1 -1
- package/src/components/basic/td-space/td-space.class.js +6 -5
- package/src/components/basic/td-space/td-space.interface.d.ts +1 -2
- package/src/components/basic/td-space/use-space.d.ts +2 -2
- package/src/components/basic/td-space/use-space.js +7 -3
- package/src/components/basic/td-text/td-text.class.js +1 -1
- package/src/components/configuration/td-config-provider/hooks/use-global-config.d.ts +1 -1
- package/src/components/configuration/td-config-provider/hooks/use-global-config.js +8 -5
- package/src/components/configuration/td-config-provider/style/css.d.ts +1 -1
- package/src/components/configuration/td-config-provider/style/css.js +1 -1
- package/src/components/data/index.d.ts +4 -0
- package/src/components/data/index.js +5 -1
- package/src/components/data/td-avatar/td-avatar.class.js +3 -2
- package/src/components/data/td-badge/td-badge.class.js +1 -1
- package/src/components/data/td-card/style/css.d.ts +1 -1
- package/src/components/data/td-card/style/css.js +1 -1
- package/src/components/data/td-carousel/style/css.d.ts +1 -1
- package/src/components/data/td-carousel/style/css.js +1 -1
- package/src/components/data/td-carousel/td-carousel-item.class.js +1 -1
- package/src/components/data/td-carousel/use-carousel-item.d.ts +1 -1
- package/src/components/data/td-carousel/use-carousel.d.ts +2 -2
- package/src/components/data/td-check-tag/style/css.d.ts +1 -1
- package/src/components/data/td-check-tag/style/css.js +1 -1
- package/src/components/data/td-collapse/style/css.d.ts +1 -1
- package/src/components/data/td-collapse/style/css.js +1 -1
- package/src/components/data/td-collapse/td-collapse.class.js +1 -1
- package/src/components/data/td-collapse/td-collapse.interface.d.ts +2 -0
- package/src/components/data/td-collapse/use-collapse-item.js +2 -2
- package/src/components/data/td-collapse/use-collapse.d.ts +2 -2
- package/src/components/data/td-collapse/use-collapse.js +1 -1
- package/src/components/data/td-collapse-item/style/css.d.ts +1 -1
- package/src/components/data/td-collapse-item/style/css.js +1 -1
- package/src/components/data/td-collapse-item/td-collapse-item.class.js +2 -2
- package/src/components/data/td-collapse-transition/style/css.d.ts +1 -1
- package/src/components/data/td-collapse-transition/style/css.js +1 -1
- package/src/components/data/td-count-down/style/css.d.ts +1 -1
- package/src/components/data/td-count-down/style/css.js +1 -1
- package/src/components/data/td-count-down/td-count-down.class.d.ts +1 -1
- package/src/components/data/td-count-down/td-count-down.class.js +5 -4
- package/src/components/data/td-descriptions/style/css.d.ts +2 -2
- package/src/components/data/td-descriptions/style/css.js +2 -2
- package/src/components/data/td-descriptions-item/style/css.d.ts +1 -1
- package/src/components/data/td-descriptions-item/style/css.js +1 -1
- package/src/components/data/td-empty/img-empty.class.js +0 -15
- package/src/components/data/td-empty/style/css.d.ts +1 -1
- package/src/components/data/td-empty/style/css.js +1 -1
- package/src/components/data/td-empty/td-empty.class.js +5 -5
- package/src/components/data/td-image/style/css.d.ts +2 -2
- package/src/components/data/td-image/style/css.js +2 -2
- package/src/components/data/td-image/td-image.class.js +93 -143
- package/src/components/data/td-image/td-image.const.js +4 -2
- package/src/components/data/td-image/td-image.interface.d.ts +5 -0
- package/src/components/data/td-image-viewer/style/css.d.ts +1 -1
- package/src/components/data/td-image-viewer/style/css.js +1 -1
- package/src/components/data/td-image-viewer/td-image-viewer.class.js +80 -28
- package/src/components/data/td-image-viewer/td-image-viewer.const.js +2 -0
- package/src/components/data/td-image-viewer/td-image-viewer.interface.d.ts +10 -1
- package/src/components/data/td-pagination/style/css.d.ts +1 -1
- package/src/components/data/td-pagination/style/css.js +1 -1
- package/src/components/data/td-pagination/td-pagination.class.js +29 -35
- package/src/components/data/td-progress/style/css.d.ts +1 -1
- package/src/components/data/td-progress/style/css.js +1 -1
- package/src/components/data/td-progress/td-progress.class.d.ts +1 -0
- package/src/components/data/td-progress/td-progress.class.js +38 -31
- package/src/components/data/td-progress/td-progress.interface.d.ts +1 -1
- package/src/components/data/td-result/style/css.d.ts +1 -1
- package/src/components/data/td-result/style/css.js +1 -1
- package/src/components/data/td-segmented/style/css.d.ts +1 -1
- package/src/components/data/td-segmented/style/css.js +1 -1
- package/src/components/data/td-segmented/td-segmented.class.js +51 -54
- package/src/components/data/td-segmented/td-segmented.const.d.ts +2 -1
- package/src/components/data/td-segmented/td-segmented.const.js +6 -1
- package/src/components/data/td-segmented/td-segmented.interface.d.ts +17 -3
- package/src/components/data/td-statistic/style/css.d.ts +1 -1
- package/src/components/data/td-statistic/style/css.js +1 -1
- package/src/components/data/td-statistic/td-statistic.class.d.ts +2 -1
- package/src/components/data/td-statistic/td-statistic.class.js +2 -2
- package/src/components/data/td-statistic/td-statistic.interface.d.ts +1 -1
- package/src/components/data/td-tag/style/css.d.ts +1 -1
- package/src/components/data/td-tag/style/css.js +1 -1
- package/src/components/data/td-tag/td-tag.style.js +3 -3
- package/src/components/feedback/index.d.ts +2 -0
- package/src/components/feedback/index.js +3 -1
- package/src/components/feedback/td-alert/td-alert.class.js +3 -3
- package/src/components/feedback/td-alert/td-alert.style.js +0 -2
- package/src/components/feedback/td-dialog/style/css.d.ts +1 -1
- package/src/components/feedback/td-dialog/style/css.js +1 -1
- package/src/components/feedback/td-dialog/td-dialog.class.js +3 -3
- package/src/components/feedback/td-dialog/use-dialog.js +1 -1
- package/src/components/feedback/td-dialog-content/td-dialog-content.class.js +4 -4
- package/src/components/feedback/td-dialog-content/td-dialog-content.interface.d.ts +2 -1
- package/src/components/feedback/td-focus-trap/td-focus-trap.class.js +5 -3
- package/src/components/feedback/td-focus-trap/td-focus-trap.interface.d.ts +1 -2
- package/src/components/feedback/td-focus-trap/utils.d.ts +1 -1
- package/src/components/feedback/td-loading/style/css.d.ts +1 -1
- package/src/components/feedback/td-loading/style/css.js +1 -1
- package/src/components/feedback/td-message/instance.js +3 -3
- package/src/components/feedback/td-message/method.js +4 -4
- package/src/components/feedback/td-message/style/css.d.ts +1 -1
- package/src/components/feedback/td-message/style/css.js +1 -1
- package/src/components/feedback/td-message/td-message.class.js +1 -1
- package/src/components/feedback/td-message-box/message-box.js +30 -5
- package/src/components/feedback/td-message-box/style/css.d.ts +1 -1
- package/src/components/feedback/td-message-box/style/css.js +1 -1
- package/src/components/feedback/td-message-box/td-message-box.class.js +3 -3
- package/src/components/feedback/td-message-box/td-message-box.interface.d.ts +2 -0
- package/src/components/feedback/td-notification/style/css.d.ts +1 -1
- package/src/components/feedback/td-notification/style/css.js +1 -1
- package/src/components/feedback/td-notification/td-notification.class.js +3 -3
- package/src/components/feedback/td-only-child/td-only-child.class.js +2 -2
- package/src/components/feedback/td-overlay/style/css.d.ts +1 -1
- package/src/components/feedback/td-overlay/style/css.js +1 -1
- package/src/components/feedback/td-overlay/td-overlay.interface.d.ts +2 -2
- package/src/components/feedback/td-popconfirm/style/css.d.ts +4 -0
- package/src/components/feedback/td-popconfirm/style/css.js +6 -0
- package/src/components/feedback/td-popconfirm/style/index.d.ts +4 -0
- package/src/components/feedback/td-popconfirm/style/index.js +6 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.d.ts +9 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.class.js +109 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.const.d.ts +12 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.const.js +24 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.d.ts +68 -0
- package/src/components/feedback/td-popconfirm/td-popconfirm.interface.js +1 -0
- package/src/components/feedback/td-popover/style/css.d.ts +1 -1
- package/src/components/feedback/td-popover/style/css.js +1 -1
- package/src/components/feedback/td-popover/td-popover.class.d.ts +1 -2
- package/src/components/feedback/td-popover/td-popover.class.js +7 -5
- package/src/components/feedback/td-popover/td-popover.interface.d.ts +4 -0
- package/src/components/feedback/td-popper/arrow/arrow.class.js +2 -2
- package/src/components/feedback/td-popper/composable/use-content-dom.d.ts +14 -13
- package/src/components/feedback/td-popper/composable/use-content-dom.js +8 -1
- package/src/components/feedback/td-popper/composable/use-content.d.ts +8 -3
- package/src/components/feedback/td-popper/composable/use-content.js +21 -13
- package/src/components/feedback/td-popper/composable/use-focus-trap.d.ts +1 -1
- package/src/components/feedback/td-popper/composable/use-focus-trap.js +1 -1
- package/src/components/feedback/td-popper/content/content.class.d.ts +2 -2
- package/src/components/feedback/td-popper/content/content.class.js +13 -46
- package/src/components/feedback/td-popper/content/content.interface.d.ts +5 -6
- package/src/components/feedback/td-popper/style/css.d.ts +1 -1
- package/src/components/feedback/td-popper/style/css.js +1 -1
- package/src/components/feedback/td-popper/td-popper.interface.d.ts +2 -1
- package/src/components/feedback/td-popper/trigger/trigger.class.js +11 -6
- package/src/components/feedback/td-popper/utils.d.ts +2 -10
- package/src/components/feedback/td-popper/utils.js +6 -5
- package/src/components/feedback/td-tooltip/content/content.class.js +15 -9
- package/src/components/feedback/td-tooltip/content/content.interface.d.ts +2 -2
- package/src/components/feedback/td-tooltip/style/css.d.ts +1 -1
- package/src/components/feedback/td-tooltip/style/css.js +1 -1
- package/src/components/feedback/td-tooltip/td-tooltip.class.js +28 -31
- package/src/components/feedback/td-tooltip/td-tooltip.const.d.ts +26 -27
- package/src/components/feedback/td-tooltip/td-tooltip.const.js +1 -1
- package/src/components/feedback/td-tooltip/trigger/trigger.class.js +11 -8
- package/src/components/feedback/td-tooltip/trigger/trigger.interface.d.ts +1 -1
- package/src/components/feedback/td-tooltip/utils.d.ts +2 -1
- package/src/components/feedback/td-tooltip/utils.js +6 -5
- package/src/components/form/checkbox-group/checkbox-option/checkbox-option.class.js +7 -7
- package/src/components/form/index.d.ts +5 -2
- package/src/components/form/index.js +6 -3
- package/src/components/form/td-autocomplete/style/css.d.ts +1 -1
- package/src/components/form/td-autocomplete/style/css.js +1 -1
- package/src/components/form/td-checkbox/composables/use-checkbox-event.js +8 -7
- package/src/components/form/td-checkbox/composables/use-checkbox-model.d.ts +1 -1
- package/src/components/form/td-checkbox/composables/use-checkbox-model.js +24 -27
- package/src/components/form/td-checkbox/composables/use-checkbox-status.js +3 -2
- package/src/components/form/td-checkbox/composables/use-checkbox.d.ts +1 -1
- package/src/components/form/td-checkbox/composables/use-checkbox.js +6 -1
- package/src/components/form/td-checkbox/td-checkbox.class.js +23 -8
- package/src/components/form/td-checkbox-button/td-checkbox-button.class.js +10 -3
- package/src/components/form/td-checkbox-group/td-checkbox-group.class.js +10 -13
- package/src/components/form/td-date-picker/composables/use-range-picker.d.ts +2 -2
- package/src/components/form/td-date-picker/style/css.d.ts +1 -1
- package/src/components/form/td-date-picker/style/css.js +1 -1
- package/src/components/form/td-form/form-label-wrap/form-label-wrap.class.js +1 -1
- package/src/components/form/td-form/hooks/use-form-common-props.d.ts +2 -2
- package/src/components/form/td-form/hooks/use-form-common-props.js +2 -1
- package/src/components/form/td-form/hooks/use-form-item.d.ts +3 -3
- package/src/components/form/td-form/hooks/use-form-item.js +1 -1
- package/src/components/form/td-form/style/css.d.ts +1 -1
- package/src/components/form/td-form/style/css.js +1 -1
- package/src/components/form/td-form/td-form.interface.d.ts +1 -1
- package/src/components/form/td-form-item/style/css.d.ts +1 -1
- package/src/components/form/td-form-item/style/css.js +1 -1
- package/src/components/form/td-form-item/td-form-item.class.js +2 -2
- package/src/components/form/td-input/style/css.d.ts +1 -1
- package/src/components/form/td-input/style/css.js +1 -1
- package/src/components/form/td-input/td-input-field.class.js +1 -1
- package/src/components/form/td-input/td-input.class.js +60 -51
- package/src/components/form/td-input/td-input.interface.d.ts +3 -3
- package/src/components/form/td-input/{widget/utils.js → utils.js} +16 -11
- package/src/components/form/td-input-number/style/css.d.ts +1 -1
- package/src/components/form/td-input-number/style/css.js +1 -1
- package/src/components/form/td-input-number/td-input-number.class.d.ts +12 -0
- package/src/components/form/td-input-number/td-input-number.class.js +390 -0
- package/src/components/form/td-input-number/td-input-number.const.d.ts +9 -0
- package/src/components/form/td-input-number/td-input-number.const.js +22 -0
- package/src/components/form/td-input-number/td-input-number.interface.d.ts +73 -0
- package/src/components/form/td-input-number/td-input-number.interface.js +1 -0
- package/src/components/form/td-option/style/css.d.ts +1 -1
- package/src/components/form/td-option/style/css.js +1 -1
- package/src/components/form/td-option/td-option.class.d.ts +12 -3
- package/src/components/form/td-option/td-option.class.js +35 -31
- package/src/components/form/td-option/td-option.const.d.ts +1 -0
- package/src/components/form/td-option/td-option.const.js +3 -0
- package/src/components/form/td-option/td-option.interface.d.ts +13 -0
- package/src/components/form/td-option/useOption.d.ts +6 -5
- package/src/components/form/td-option/useOption.js +25 -20
- package/src/components/form/td-option-group/style/css.d.ts +1 -1
- package/src/components/form/td-option-group/style/css.js +1 -1
- package/src/components/form/td-option-group/td-option-group.class.js +2 -2
- package/src/components/form/td-radio/style/css.d.ts +1 -1
- package/src/components/form/td-radio/style/css.js +1 -1
- package/src/components/form/td-radio/td-radio.class.js +4 -3
- package/src/components/form/td-radio/use-radio.d.ts +3 -3
- package/src/components/form/td-radio/use-radio.js +13 -16
- package/src/components/form/td-radio-button/style/css.d.ts +1 -1
- package/src/components/form/td-radio-button/style/css.js +1 -1
- package/src/components/form/td-radio-button/td-radio-button.class.js +1 -1
- package/src/components/form/td-radio-group/style/css.d.ts +1 -1
- package/src/components/form/td-radio-group/style/css.js +1 -1
- package/src/components/form/td-radio-group/td-radio-group.class.js +5 -5
- package/src/components/form/td-rate/style/css.d.ts +1 -1
- package/src/components/form/td-rate/style/css.js +1 -1
- package/src/components/form/td-rate/td-rate.class.js +9 -10
- package/src/components/form/td-rate/td-rate.interface.d.ts +2 -1
- package/src/components/form/td-select/style/css.d.ts +7 -7
- package/src/components/form/td-select/style/css.js +7 -7
- package/src/components/form/td-select/td-options/td-options.class.d.ts +6 -0
- package/src/components/form/td-select/td-options/td-options.class.js +49 -0
- package/src/components/form/td-select/td-select-dropdown/td-select-dropdown.class.js +4 -4
- package/src/components/form/td-select/td-select.class.d.ts +1 -0
- package/src/components/form/td-select/td-select.class.js +178 -144
- package/src/components/form/td-select/td-select.const.d.ts +13 -0
- package/src/components/form/td-select/td-select.const.js +18 -1
- package/src/components/form/td-select/td-select.interface.d.ts +33 -12
- package/src/components/form/td-select/token.js +1 -1
- package/src/components/form/td-select/useSelect.d.ts +111 -64
- package/src/components/form/td-select/useSelect.js +225 -196
- package/src/components/form/td-slider/button/button.class.d.ts +10 -2
- package/src/components/form/td-slider/button/button.class.js +56 -14
- package/src/components/form/td-slider/button/button.interface.d.ts +7 -3
- package/src/components/form/td-slider/composables/index.d.ts +6 -0
- package/src/components/form/td-slider/composables/index.js +9 -0
- package/src/components/form/td-slider/composables/use-lifecycle.d.ts +4 -0
- package/src/components/form/td-slider/composables/use-lifecycle.js +43 -0
- package/src/components/form/td-slider/composables/use-marks.d.ts +7 -0
- package/src/components/form/td-slider/composables/use-marks.js +27 -0
- package/src/components/form/td-slider/composables/use-slide.d.ts +24 -3
- package/src/components/form/td-slider/composables/use-slide.js +163 -200
- package/src/components/form/td-slider/composables/use-slider-button.d.ts +20 -0
- package/src/components/form/td-slider/composables/use-slider-button.js +266 -0
- package/src/components/form/td-slider/composables/use-stops.d.ts +9 -0
- package/src/components/form/td-slider/composables/use-stops.js +45 -0
- package/src/components/form/td-slider/composables/use-watch.d.ts +4 -0
- package/src/components/form/td-slider/composables/use-watch.js +97 -0
- package/src/components/form/td-slider/constants.d.ts +11 -0
- package/src/components/form/td-slider/constants.js +4 -0
- package/src/components/form/td-slider/mark/mark.class.d.ts +8 -0
- package/src/components/form/td-slider/mark/mark.class.js +27 -0
- package/src/components/form/td-slider/mark/mark.interface.d.ts +8 -0
- package/src/components/form/td-slider/style/css.d.ts +1 -1
- package/src/components/form/td-slider/style/css.js +1 -1
- package/src/components/form/td-slider/td-slider.class.d.ts +4 -2
- package/src/components/form/td-slider/td-slider.class.js +242 -33
- package/src/components/form/td-slider/td-slider.interface.d.ts +20 -11
- package/src/components/form/td-switch/style/css.d.ts +1 -1
- package/src/components/form/td-switch/style/css.js +1 -1
- package/src/components/form/td-switch/td-switch.class.js +14 -5
- package/src/components/form/td-switch/td-switch.const.js +1 -1
- package/src/components/form/td-switch/widget/td-switch-core.js +4 -4
- package/src/components/form/td-time-picker/common/props.d.ts +2 -1
- package/src/components/form/td-time-picker/style/css.d.ts +1 -1
- package/src/components/form/td-time-picker/style/css.js +1 -1
- package/src/components/form/td-time-picker/time-picker-com/basic-time-spinner.class.js +6 -5
- package/src/components/form/td-upload/ajax.d.ts +9 -0
- package/src/components/form/td-upload/ajax.js +100 -0
- package/src/components/form/td-upload/constants.d.ts +6 -0
- package/src/components/form/td-upload/constants.js +5 -0
- package/src/components/form/td-upload/style/css.d.ts +1 -1
- package/src/components/form/td-upload/style/css.js +1 -1
- package/src/components/form/td-upload/style/index.d.ts +1 -1
- package/src/components/form/td-upload/style/index.js +1 -1
- package/src/components/form/td-upload/td-upload.class.d.ts +15 -0
- package/src/components/form/td-upload/td-upload.class.js +107 -0
- package/src/components/form/td-upload/td-upload.const.d.ts +5 -0
- package/src/components/form/td-upload/td-upload.const.js +22 -0
- package/src/components/form/td-upload/td-upload.interface.d.ts +160 -0
- package/src/components/form/td-upload/td-upload.interface.js +1 -0
- package/src/components/form/td-upload/upload-content/upload-content.class.d.ts +11 -0
- package/src/components/form/td-upload/upload-content/upload-content.class.js +218 -0
- package/src/components/form/td-upload/upload-content/upload-content.const.d.ts +2 -0
- package/src/components/form/td-upload/upload-content/upload-content.const.js +6 -0
- package/src/components/form/td-upload/upload-content/upload-content.interface.d.ts +15 -0
- package/src/components/form/td-upload/upload-content/upload-content.interface.js +2 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.class.d.ts +8 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.class.js +73 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.const.d.ts +5 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.const.js +10 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.interface.d.ts +7 -0
- package/src/components/form/td-upload/upload-dragger/upload-dragger.interface.js +2 -0
- package/src/components/form/td-upload/upload-list/upload-list.class.d.ts +8 -0
- package/src/components/form/td-upload/upload-list/upload-list.class.js +196 -0
- package/src/components/form/td-upload/upload-list/upload-list.const.d.ts +3 -0
- package/src/components/form/td-upload/upload-list/upload-list.const.js +13 -0
- package/src/components/form/td-upload/upload-list/upload-list.interface.d.ts +19 -0
- package/src/components/form/td-upload/upload-list/upload-list.interface.js +2 -0
- package/src/components/form/td-upload/use-handlers.d.ts +16 -0
- package/src/components/form/td-upload/use-handlers.js +175 -0
- package/src/components/navigation/index.d.ts +1 -0
- package/src/components/navigation/index.js +3 -0
- package/src/components/navigation/td-affix/style/css.d.ts +1 -1
- package/src/components/navigation/td-affix/style/css.js +1 -1
- package/src/components/navigation/td-affix/td-affix.class.d.ts +1 -0
- package/src/components/navigation/td-affix/td-affix.class.js +78 -36
- package/src/components/navigation/td-anchor/style/css.d.ts +1 -1
- package/src/components/navigation/td-anchor/style/css.js +1 -1
- package/src/components/navigation/td-anchor-link/style/css.d.ts +1 -1
- package/src/components/navigation/td-anchor-link/style/css.js +1 -1
- package/src/components/navigation/td-backtop/style/css.d.ts +1 -1
- package/src/components/navigation/td-backtop/style/css.js +1 -1
- package/src/components/navigation/td-backtop/td-backtop.class.d.ts +1 -0
- package/src/components/navigation/td-backtop/td-backtop.class.js +3 -2
- package/src/components/navigation/td-backtop/td-backtop.const.js +1 -0
- package/src/components/navigation/td-backtop/use-backtop.js +2 -1
- package/src/components/navigation/td-breadcrumb/style/css.d.ts +1 -1
- package/src/components/navigation/td-breadcrumb/style/css.js +1 -1
- package/src/components/navigation/td-breadcrumb/td-breadcrumb.class.js +1 -1
- package/src/components/navigation/td-breadcrumb-item/style/css.d.ts +1 -1
- package/src/components/navigation/td-breadcrumb-item/style/css.js +1 -1
- package/src/components/navigation/td-breadcrumb-item/td-breadcrumb-item.interface.d.ts +2 -1
- package/src/components/navigation/td-dropdown/style/css.d.ts +1 -1
- package/src/components/navigation/td-dropdown/style/css.js +1 -1
- package/src/components/navigation/td-dropdown-item/style/css.d.ts +1 -1
- package/src/components/navigation/td-dropdown-item/style/css.js +1 -1
- package/src/components/navigation/td-menu/index.d.ts +9 -0
- package/src/components/navigation/td-menu/index.js +13 -0
- package/src/components/navigation/td-menu/style/css.d.ts +2 -2
- package/src/components/navigation/td-menu/style/css.js +2 -2
- package/src/components/navigation/td-menu/td-menu-collapse-transition/td-menu-collapse-transition.class.d.ts +6 -0
- package/src/components/navigation/td-menu/td-menu-collapse-transition/td-menu-collapse-transition.class.js +56 -0
- package/src/components/navigation/td-menu/td-menu-item/style/css.d.ts +2 -0
- package/src/components/navigation/td-menu/td-menu-item/style/css.js +4 -0
- package/src/components/navigation/td-menu/td-menu-item/style/index.d.ts +2 -0
- package/src/components/navigation/td-menu/td-menu-item/style/index.js +4 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.class.d.ts +11 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.class.js +107 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.const.d.ts +4 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.const.js +10 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.interface.d.ts +20 -0
- package/src/components/navigation/td-menu/td-menu-item/td-menu-item.interface.js +2 -0
- package/src/components/navigation/td-menu/td-menu-item-group/style/css.d.ts +2 -0
- package/src/components/navigation/td-menu/td-menu-item-group/style/css.js +4 -0
- package/src/components/navigation/td-menu/td-menu-item-group/style/index.d.ts +2 -0
- package/src/components/navigation/td-menu/td-menu-item-group/style/index.js +4 -0
- package/src/components/navigation/td-menu/td-menu-item-group/td-menu-item-group.class.d.ts +9 -0
- package/src/components/navigation/td-menu/td-menu-item-group/td-menu-item-group.class.js +28 -0
- package/src/components/navigation/td-menu/td-menu-item-group/td-menu-item-group.interface.d.ts +10 -0
- package/src/components/navigation/td-menu/td-menu-item-group/td-menu-item-group.interface.js +2 -0
- package/src/components/navigation/td-menu/td-menu.class.d.ts +3 -2
- package/src/components/navigation/td-menu/td-menu.class.js +297 -27
- package/src/components/navigation/td-menu/td-menu.const.d.ts +8 -0
- package/src/components/navigation/td-menu/td-menu.const.js +29 -0
- package/src/components/navigation/td-menu/td-menu.interface.d.ts +86 -7
- package/src/components/navigation/td-menu/td-sub-menu/td-sub-menu.class.d.ts +10 -0
- package/src/components/navigation/td-menu/td-sub-menu/td-sub-menu.class.js +301 -0
- package/src/components/navigation/td-menu/td-sub-menu/td-sub-menu.interface.d.ts +53 -0
- package/src/components/navigation/td-menu/td-sub-menu/td-sub-menu.interface.js +2 -0
- package/src/components/navigation/td-menu/types.d.ts +36 -0
- package/src/components/navigation/td-menu/types.js +2 -0
- package/src/components/navigation/td-menu/use-menu-color.d.ts +2 -0
- package/src/components/navigation/td-menu/use-menu-color.js +14 -0
- package/src/components/navigation/td-menu/use-menu-css-var.d.ts +2 -0
- package/src/components/navigation/td-menu/use-menu-css-var.js +20 -0
- package/src/components/navigation/td-menu/use-menu.d.ts +8 -0
- package/src/components/navigation/td-menu/use-menu.js +31 -0
- package/src/components/navigation/td-menu/utils/menu-bar.d.ts +7 -0
- package/src/components/navigation/td-menu/utils/menu-bar.js +21 -0
- package/src/components/navigation/td-menu/utils/menu-item.d.ts +9 -0
- package/src/components/navigation/td-menu/utils/menu-item.js +58 -0
- package/src/components/navigation/td-menu/utils/submenu.d.ts +12 -0
- package/src/components/navigation/td-menu/utils/submenu.js +66 -0
- package/src/components/navigation/td-menu-item/style/css.d.ts +1 -1
- package/src/components/navigation/td-menu-item/style/css.js +1 -1
- package/src/components/navigation/td-menu-item-group/style/css.d.ts +1 -1
- package/src/components/navigation/td-menu-item-group/style/css.js +1 -1
- package/src/components/navigation/td-page-header/style/css.d.ts +2 -2
- package/src/components/navigation/td-page-header/style/css.js +2 -2
- package/src/components/navigation/td-step/style/css.d.ts +1 -1
- package/src/components/navigation/td-step/style/css.js +1 -1
- package/src/components/navigation/td-steps/style/css.d.ts +1 -1
- package/src/components/navigation/td-steps/style/css.js +1 -1
- package/src/components/navigation/td-tab-pane/style/css.d.ts +1 -1
- package/src/components/navigation/td-tab-pane/style/css.js +1 -1
- package/src/components/navigation/td-tabs/style/css.d.ts +1 -1
- package/src/components/navigation/td-tabs/style/css.js +1 -1
- package/src/components/others/collapsible-box/heading/expand-heading.js +1 -1
- package/src/components/others/example/op-btns.js +1 -1
- package/src/components/others/menus/menu.d.ts +6 -5
- package/src/components/others/menus/menu.js +24 -10
- package/src/components/others/menus/menus.d.ts +5 -5
- package/src/components/others/menus/menus.js +15 -23
- package/src/components/others/td-divider/style/css.d.ts +1 -1
- package/src/components/others/td-divider/style/css.js +1 -1
- package/src/hooks/use-attrs/index.d.ts +1 -1
- package/src/hooks/use-calc-input-width/index.d.ts +1 -1
- package/src/hooks/use-delayed-toggle/index.js +1 -1
- package/src/hooks/use-deprecated/index.d.ts +1 -1
- package/src/hooks/use-deprecated/index.js +2 -2
- package/src/hooks/use-empty-values/index.d.ts +4 -2
- package/src/hooks/use-empty-values/index.js +8 -8
- package/src/hooks/use-focus-controller/index.d.ts +1 -1
- package/src/hooks/use-focus-controller/index.js +1 -1
- package/src/hooks/use-id/index.js +4 -4
- package/src/hooks/use-lockscreen/index.js +1 -1
- package/src/hooks/use-model-toggle/index.js +11 -6
- package/src/hooks/use-namespace/index.d.ts +1 -1
- package/src/hooks/use-popper/index.d.ts +9 -4
- package/src/hooks/use-popper/index.js +42 -34
- package/src/hooks/use-popper-container/index.js +2 -2
- package/src/hooks/use-z-index/index.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/locale/index.d.ts +11 -0
- package/src/locale/index.js +24 -2
- package/src/locale/lang/hi.d.ts +180 -0
- package/src/locale/lang/hi.js +181 -0
- package/src/locale/lang/ku.js +1 -1
- package/src/locale/lang/lo.d.ts +180 -0
- package/src/locale/lang/lo.js +181 -0
- package/src/locale/lang/ms.d.ts +1 -1
- package/src/locale/lang/ms.js +11 -11
- package/src/locale/lang/no.d.ts +179 -0
- package/src/locale/lang/no.js +180 -0
- package/src/locale/lang/ru.js +4 -4
- package/src/locale/lang/te.d.ts +180 -0
- package/src/locale/lang/te.js +181 -0
- package/src/locale/lang/zh-hk.d.ts +179 -0
- package/src/locale/lang/zh-hk.js +181 -0
- package/src/locale/lang/zh-mo.d.ts +179 -0
- package/src/locale/lang/zh-mo.js +181 -0
- package/src/styles/var.js +5 -5
- package/src/theme-chalk/affix.scss +7 -0
- package/src/theme-chalk/alert.scss +115 -0
- package/src/theme-chalk/anchor-link.scss +41 -0
- package/src/theme-chalk/anchor.scss +88 -0
- package/src/theme-chalk/aside.scss +8 -0
- package/src/theme-chalk/autocomplete.scss +89 -0
- package/src/theme-chalk/avatar.scss +55 -0
- package/src/theme-chalk/backtop.scss +29 -0
- package/src/theme-chalk/badge.scss +58 -0
- package/src/theme-chalk/base.scss +3 -0
- package/src/theme-chalk/breadcrumb-item.scss +0 -0
- package/src/theme-chalk/breadcrumb.scss +62 -0
- package/src/theme-chalk/button-group.scss +80 -0
- package/src/theme-chalk/button.scss +304 -0
- package/src/theme-chalk/calendar.scss +80 -0
- package/src/theme-chalk/card.scss +45 -0
- package/src/theme-chalk/carousel-item.scss +58 -0
- package/src/theme-chalk/carousel.scss +188 -0
- package/src/theme-chalk/cascader-panel.scss +138 -0
- package/src/theme-chalk/cascader.scss +247 -0
- package/src/theme-chalk/check-tag.scss +60 -0
- package/src/theme-chalk/checkbox-button.scss +140 -0
- package/src/theme-chalk/checkbox-group.scss +7 -0
- package/src/theme-chalk/checkbox.scss +298 -0
- package/src/theme-chalk/col.scss +48 -0
- package/src/theme-chalk/collapse-item.scss +0 -0
- package/src/theme-chalk/collapse-transition.scss +0 -0
- package/src/theme-chalk/collapse.scss +70 -0
- package/src/theme-chalk/color/index.scss +20 -0
- package/src/theme-chalk/color-picker.scss +393 -0
- package/src/theme-chalk/common/popup.scss +47 -0
- package/src/theme-chalk/common/transition.scss +122 -0
- package/src/theme-chalk/common/var.scss +1655 -0
- package/src/theme-chalk/config-provider.scss +0 -0
- package/src/theme-chalk/container.scss +14 -0
- package/src/theme-chalk/dark/css-vars.scss +39 -0
- package/src/theme-chalk/dark/var.scss +222 -0
- package/src/theme-chalk/date-picker/date-picker.scss +110 -0
- package/src/theme-chalk/date-picker/date-range-picker.scss +113 -0
- package/src/theme-chalk/date-picker/date-table.scss +158 -0
- package/src/theme-chalk/date-picker/month-table.scss +112 -0
- package/src/theme-chalk/date-picker/picker-panel.scss +131 -0
- package/src/theme-chalk/date-picker/picker.scss +212 -0
- package/src/theme-chalk/date-picker/time-picker.scss +90 -0
- package/src/theme-chalk/date-picker/time-range-picker.scss +33 -0
- package/src/theme-chalk/date-picker/time-spinner.scss +111 -0
- package/src/theme-chalk/date-picker/year-table.scss +108 -0
- package/src/theme-chalk/date-picker.scss +9 -0
- package/src/theme-chalk/descriptions-item.scss +73 -0
- package/src/theme-chalk/descriptions.scss +152 -0
- package/src/theme-chalk/dialog.scss +192 -0
- package/src/theme-chalk/display.scss +12 -0
- package/src/theme-chalk/divider.scss +48 -0
- package/src/theme-chalk/drawer.scss +155 -0
- package/src/theme-chalk/dropdown-item.scss +0 -0
- package/src/theme-chalk/dropdown-menu.scss +0 -0
- package/src/theme-chalk/dropdown.scss +208 -0
- package/src/theme-chalk/empty.scss +49 -0
- package/src/theme-chalk/footer.scss +12 -0
- package/src/theme-chalk/form-item.scss +0 -0
- package/src/theme-chalk/form.scss +244 -0
- package/src/theme-chalk/header.scss +12 -0
- package/src/theme-chalk/icon.scss +45 -0
- package/src/theme-chalk/image-viewer.scss +155 -0
- package/src/theme-chalk/image.scss +49 -0
- package/src/theme-chalk/index.scss +111 -0
- package/src/theme-chalk/infinite-scroll.scss +0 -0
- package/src/theme-chalk/input-number.scss +186 -0
- package/src/theme-chalk/input-tag.scss +220 -0
- package/src/theme-chalk/input.scss +474 -0
- package/src/theme-chalk/link.scss +90 -0
- package/src/theme-chalk/loading.scss +104 -0
- package/src/theme-chalk/main.scss +14 -0
- package/src/theme-chalk/mention.scss +92 -0
- package/src/theme-chalk/menu-item-group.scss +0 -0
- package/src/theme-chalk/menu-item.scss +0 -0
- package/src/theme-chalk/menu.scss +339 -0
- package/src/theme-chalk/message-box.scss +213 -0
- package/src/theme-chalk/message.scss +98 -0
- package/src/theme-chalk/mixins/_button.scss +165 -0
- package/src/theme-chalk/mixins/_col.scss +33 -0
- package/src/theme-chalk/mixins/_var.scss +67 -0
- package/src/theme-chalk/mixins/config.scss +5 -0
- package/src/theme-chalk/mixins/function.scss +88 -0
- package/src/theme-chalk/mixins/mixins.scss +240 -0
- package/src/theme-chalk/mixins/utils.scss +39 -0
- package/src/theme-chalk/notification.scss +107 -0
- package/src/theme-chalk/option-group.scss +33 -0
- package/src/theme-chalk/option.scss +71 -0
- package/src/theme-chalk/overlay.scss +17 -0
- package/src/theme-chalk/page-header.scss +60 -0
- package/src/theme-chalk/pagination.scss +238 -0
- package/src/theme-chalk/popconfirm.scss +16 -0
- package/src/theme-chalk/popover.scss +61 -0
- package/src/theme-chalk/popper.scss +106 -0
- package/src/theme-chalk/progress.scss +179 -0
- package/src/theme-chalk/radio-button.scss +169 -0
- package/src/theme-chalk/radio-group.scss +9 -0
- package/src/theme-chalk/radio.scss +215 -0
- package/src/theme-chalk/rate.scss +108 -0
- package/src/theme-chalk/reset.scss +98 -0
- package/src/theme-chalk/result.scss +57 -0
- package/src/theme-chalk/row.scss +35 -0
- package/src/theme-chalk/scrollbar.scss +97 -0
- package/src/theme-chalk/segmented.scss +183 -0
- package/src/theme-chalk/select-dropdown-v2.scss +1 -0
- package/src/theme-chalk/select-dropdown.scss +57 -0
- package/src/theme-chalk/select-v2.scss +4 -0
- package/src/theme-chalk/select.scss +264 -0
- package/src/theme-chalk/skeleton-item.scss +83 -0
- package/src/theme-chalk/skeleton.scss +44 -0
- package/src/theme-chalk/slider.scss +212 -0
- package/src/theme-chalk/space.scss +20 -0
- package/src/theme-chalk/spinner.scss +43 -0
- package/src/theme-chalk/statistic.scss +35 -0
- package/src/theme-chalk/step.scss +316 -0
- package/src/theme-chalk/steps.scss +21 -0
- package/src/theme-chalk/sub-menu.scss +0 -0
- package/src/theme-chalk/switch.scss +300 -0
- package/src/theme-chalk/tab-pane.scss +0 -0
- package/src/theme-chalk/table-column.scss +98 -0
- package/src/theme-chalk/table-v2.scss +236 -0
- package/src/theme-chalk/table.scss +694 -0
- package/src/theme-chalk/tabs.scss +660 -0
- package/src/theme-chalk/tag.scss +181 -0
- package/src/theme-chalk/text.scss +51 -0
- package/src/theme-chalk/time-picker.scss +5 -0
- package/src/theme-chalk/time-select.scss +37 -0
- package/src/theme-chalk/timeline-item.scss +84 -0
- package/src/theme-chalk/timeline.scss +46 -0
- package/src/theme-chalk/tooltip-v2.scss +95 -0
- package/src/theme-chalk/tooltip.scss +0 -0
- package/src/theme-chalk/tour.scss +187 -0
- package/src/theme-chalk/transfer.scss +203 -0
- package/src/theme-chalk/tree-select.scss +41 -0
- package/src/theme-chalk/tree.scss +134 -0
- package/src/theme-chalk/upload.scss +654 -0
- package/src/theme-chalk/var.scss +87 -0
- package/src/theme-chalk/virtual-list.scss +40 -0
- package/src/components/basic/td-container/td-container.old.d.ts +0 -11
- package/src/components/basic/td-container/td-container.old.js +0 -31
- package/src/components/form/td-input/widget/prefix.d.ts +0 -10
- package/src/components/form/td-input/widget/prefix.js +0 -63
- package/src/components/form/td-input/widget/suffix.d.ts +0 -14
- package/src/components/form/td-input/widget/suffix.js +0 -125
- package/src/components/form/td-input/widget/td-input-wrapper.class.d.ts +0 -33
- package/src/components/form/td-input/widget/td-input-wrapper.class.js +0 -287
- package/src/components/form/td-input/widget/td-input-wrapper.interface.d.ts +0 -4
- package/src/components/form/td-input/widget/td-textarea-wrapper.d.ts +0 -13
- package/src/components/form/td-input/widget/td-textarea-wrapper.js +0 -120
- package/src/components/form/td-option/td-option.old.d.ts +0 -8
- package/src/components/form/td-option/td-option.old.js +0 -24
- package/src/components/form/td-slider/td-slider-marker.d.ts +0 -13
- package/src/components/form/td-slider/td-slider-marker.js +0 -19
- /package/src/components/form/td-input/{widget/utils.d.ts → utils.d.ts} +0 -0
- /package/src/components/form/{td-input/widget/td-input-wrapper.interface.js → td-slider/mark/mark.interface.js} +0 -0
|
@@ -1 +1,110 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TdPopconfirm = void 0;
|
|
4
|
+
const framework_1 = require("@type-dom/framework");
|
|
5
|
+
const signals_1 = require("@type-dom/signals");
|
|
6
|
+
const utils_1 = require("@type-dom/utils");
|
|
7
|
+
const use_locale_1 = require("../../../hooks/use-locale");
|
|
8
|
+
const use_namespace_1 = require("../../../hooks/use-namespace");
|
|
9
|
+
const td_icon_class_1 = require("../../basic/td-icon/td-icon.class");
|
|
10
|
+
const td_button_class_1 = require("../../basic/td-button/td-button.class");
|
|
11
|
+
const td_tooltip_class_1 = require("../td-tooltip/td-tooltip.class");
|
|
12
|
+
const td_popconfirm_const_1 = require("./td-popconfirm.const");
|
|
13
|
+
require("./style");
|
|
14
|
+
class TdPopconfirm extends framework_1.TypeFragment {
|
|
15
|
+
constructor(params = {}) {
|
|
16
|
+
super();
|
|
17
|
+
this.className = 'TdPopconfirm';
|
|
18
|
+
this.addEmits(td_popconfirm_const_1.popconfirmEmits);
|
|
19
|
+
this.assignProps(td_popconfirm_const_1.popconfirmProps);
|
|
20
|
+
this.props = this.useParams(params);
|
|
21
|
+
}
|
|
22
|
+
setup() {
|
|
23
|
+
var _a, _b, _c;
|
|
24
|
+
const props = this.props;
|
|
25
|
+
const emit = this.emit;
|
|
26
|
+
const { t } = (0, use_locale_1.useLocale)();
|
|
27
|
+
const ns = (0, use_namespace_1.useNamespace)('popconfirm');
|
|
28
|
+
const tooltipRef = (0, signals_1.signal)();
|
|
29
|
+
const hidePopper = () => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
(_b = (_a = tooltipRef.get()) === null || _a === void 0 ? void 0 : _a.onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
32
|
+
};
|
|
33
|
+
const style = (0, signals_1.computed)(() => {
|
|
34
|
+
return {
|
|
35
|
+
width: (0, utils_1.addUnit)(props.width),
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const confirm = (e) => {
|
|
39
|
+
emit('confirm', e);
|
|
40
|
+
hidePopper();
|
|
41
|
+
};
|
|
42
|
+
const cancel = (e) => {
|
|
43
|
+
// console.warn('cancel . ');
|
|
44
|
+
emit('cancel', e);
|
|
45
|
+
hidePopper();
|
|
46
|
+
};
|
|
47
|
+
const finalConfirmButtonText = (0, signals_1.computed)(() => props.confirmButtonText || t('el.popconfirm.confirmButtonText'));
|
|
48
|
+
const finalCancelButtonText = (0, signals_1.computed)(() => props.cancelButtonText || t('el.popconfirm.cancelButtonText'));
|
|
49
|
+
this.addChildren(new td_tooltip_class_1.TdTooltip({
|
|
50
|
+
refEl: tooltipRef,
|
|
51
|
+
trigger: 'click',
|
|
52
|
+
effect: 'light',
|
|
53
|
+
// v-bind="$attrs"
|
|
54
|
+
placement: props.placement, // add by me base on attr
|
|
55
|
+
popperClass: `${ns.namespace.get()}-popover`,
|
|
56
|
+
popperStyle: style,
|
|
57
|
+
teleported: props.teleported,
|
|
58
|
+
fallbackPlacements: ['bottom', 'top', 'right', 'left'],
|
|
59
|
+
hideAfter: props.hideAfter,
|
|
60
|
+
persistent: props.persistent,
|
|
61
|
+
slots: {
|
|
62
|
+
content: new framework_1.Div({
|
|
63
|
+
class: ns.e(),
|
|
64
|
+
slot: [
|
|
65
|
+
new framework_1.Div({
|
|
66
|
+
class: ns.e('main'),
|
|
67
|
+
slot: [
|
|
68
|
+
new td_icon_class_1.TdIcon({
|
|
69
|
+
vIf: !props.hideIcon && props.icon,
|
|
70
|
+
class: ns.e('icon'),
|
|
71
|
+
slot: new props.icon(),
|
|
72
|
+
styleObj: {
|
|
73
|
+
color: props.iconColor
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
props.title
|
|
77
|
+
]
|
|
78
|
+
}),
|
|
79
|
+
new framework_1.Div({
|
|
80
|
+
class: ns.e('action'),
|
|
81
|
+
slot: (0, utils_1.isFunction)((_a = props.slots) === null || _a === void 0 ? void 0 : _a.actions) ? (_b = props.slots) === null || _b === void 0 ? void 0 : _b.actions(confirm, cancel)
|
|
82
|
+
: [
|
|
83
|
+
new td_button_class_1.TdButton({
|
|
84
|
+
size: 'small',
|
|
85
|
+
type: props.cancelButtonType === 'text' ? '' : props.cancelButtonType,
|
|
86
|
+
text: props.cancelButtonType === 'text',
|
|
87
|
+
slot: finalCancelButtonText,
|
|
88
|
+
events: {
|
|
89
|
+
click: cancel
|
|
90
|
+
}
|
|
91
|
+
}),
|
|
92
|
+
new td_button_class_1.TdButton({
|
|
93
|
+
size: 'small',
|
|
94
|
+
type: props.confirmButtonType === 'text' ? '' : props.confirmButtonType,
|
|
95
|
+
text: props.confirmButtonType === 'text',
|
|
96
|
+
slot: finalConfirmButtonText,
|
|
97
|
+
events: {
|
|
98
|
+
click: confirm
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
}),
|
|
105
|
+
default: (_c = props.slots) === null || _c === void 0 ? void 0 : _c.reference,
|
|
106
|
+
}
|
|
107
|
+
}));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.TdPopconfirm = TdPopconfirm;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PopconfirmProps } from './td-popconfirm.interface';
|
|
2
|
+
export declare const popconfirmProps: PopconfirmProps;
|
|
3
|
+
export declare const popconfirmEmits: {
|
|
4
|
+
/**
|
|
5
|
+
* @description triggers when click confirm button
|
|
6
|
+
*/
|
|
7
|
+
confirm: (e: MouseEvent) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* @description triggers when click cancel button
|
|
10
|
+
*/
|
|
11
|
+
cancel: (e: MouseEvent) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.popconfirmEmits = exports.popconfirmProps = void 0;
|
|
4
|
+
const svgs_1 = require("@type-dom/svgs");
|
|
5
|
+
exports.popconfirmProps = {
|
|
6
|
+
confirmButtonType: 'primary',
|
|
7
|
+
cancelButtonType: 'text',
|
|
8
|
+
icon: svgs_1.ElQuestionFilledSvg,
|
|
9
|
+
iconColor: '#f90',
|
|
10
|
+
hideIcon: false,
|
|
11
|
+
hideAfter: 200,
|
|
12
|
+
teleported: true,
|
|
13
|
+
width: 150,
|
|
14
|
+
};
|
|
15
|
+
exports.popconfirmEmits = {
|
|
16
|
+
/**
|
|
17
|
+
* @description triggers when click confirm button
|
|
18
|
+
*/
|
|
19
|
+
confirm: (e) => e instanceof MouseEvent,
|
|
20
|
+
/**
|
|
21
|
+
* @description triggers when click cancel button
|
|
22
|
+
*/
|
|
23
|
+
cancel: (e) => e instanceof MouseEvent,
|
|
24
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ITypeFragment, TypeFragmentProps, TypeSvgSvg } from '@type-dom/framework';
|
|
2
|
+
import { IButtonType } from '../../basic/td-button/td-button.interface';
|
|
3
|
+
import { Placement } from '@type-dom/popper';
|
|
4
|
+
export interface ITdPopconfirm extends ITypeFragment {
|
|
5
|
+
className: 'TdPopconfirm';
|
|
6
|
+
}
|
|
7
|
+
export interface PopconfirmProps extends TypeFragmentProps {
|
|
8
|
+
/**
|
|
9
|
+
* @description Title
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* @description Confirm button text
|
|
14
|
+
*/
|
|
15
|
+
confirmButtonText?: string;
|
|
16
|
+
/**
|
|
17
|
+
* @description Cancel button text
|
|
18
|
+
*/
|
|
19
|
+
cancelButtonText?: string;
|
|
20
|
+
/**
|
|
21
|
+
* @description Confirm button type
|
|
22
|
+
* default: 'primary',
|
|
23
|
+
*/
|
|
24
|
+
confirmButtonType?: IButtonType;
|
|
25
|
+
/**
|
|
26
|
+
* @description Cancel button type
|
|
27
|
+
* default: 'text',
|
|
28
|
+
*/
|
|
29
|
+
cancelButtonType?: IButtonType;
|
|
30
|
+
/**
|
|
31
|
+
* @description Icon Component
|
|
32
|
+
* default: () => QuestionFilled,
|
|
33
|
+
*/
|
|
34
|
+
icon?: typeof TypeSvgSvg;
|
|
35
|
+
/**
|
|
36
|
+
* @description Icon color
|
|
37
|
+
* default: '#f90',
|
|
38
|
+
*/
|
|
39
|
+
iconColor?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @description is hide Icon
|
|
42
|
+
* default: false,
|
|
43
|
+
*/
|
|
44
|
+
hideIcon?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* @description delay of disappear, in millisecond
|
|
47
|
+
* default: 200,
|
|
48
|
+
*/
|
|
49
|
+
hideAfter?: number;
|
|
50
|
+
/**
|
|
51
|
+
* @description whether popconfirm is teleported to the body
|
|
52
|
+
*/
|
|
53
|
+
teleported?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description when popconfirm inactive and `persistent` is `false` , popconfirm will be destroyed
|
|
56
|
+
*/
|
|
57
|
+
persistent?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @description popconfirm width, min width 150px
|
|
60
|
+
* default: 150,
|
|
61
|
+
*/
|
|
62
|
+
width?: string | number;
|
|
63
|
+
/**
|
|
64
|
+
* @description popover placement tooltip
|
|
65
|
+
* bottom
|
|
66
|
+
*/
|
|
67
|
+
placement?: Placement;
|
|
68
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("
|
|
3
|
+
require("../../../base/style/css");
|
|
4
4
|
require("@element-plus/components/popper/style/css");
|
|
5
5
|
require("@element-plus/theme-chalk/el-popover.css");
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { TypeFragment } from '@type-dom/framework';
|
|
2
2
|
import { Computed } from '@type-dom/signals';
|
|
3
|
-
import { TdPopper } from '../td-popper/td-popper.class';
|
|
4
3
|
import { ITdPopover, PopoverProps } from './td-popover.interface';
|
|
5
4
|
import './style/index';
|
|
6
5
|
export declare class TdPopover extends TypeFragment implements ITdPopover {
|
|
7
6
|
className: 'TdPopover';
|
|
8
7
|
props: PopoverProps;
|
|
9
|
-
popperRef?: Computed<
|
|
8
|
+
popperRef?: Computed<HTMLElement | undefined>;
|
|
10
9
|
hide?: () => void;
|
|
11
10
|
constructor(params: PopoverProps);
|
|
12
11
|
setup(): void;
|
|
@@ -17,7 +17,7 @@ class TdPopover extends framework_1.TypeFragment {
|
|
|
17
17
|
this.props = this.useParams(params);
|
|
18
18
|
}
|
|
19
19
|
setup() {
|
|
20
|
-
var _a, _b, _c, _d
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
21
|
const props = this.props;
|
|
22
22
|
const emit = this.emit;
|
|
23
23
|
const updateEventKeyRaw = `onUpdate:visible`;
|
|
@@ -70,11 +70,13 @@ class TdPopover extends framework_1.TypeFragment {
|
|
|
70
70
|
});
|
|
71
71
|
this.addChild(new td_tooltip_class_1.TdTooltip({
|
|
72
72
|
refEl: tooltipRef,
|
|
73
|
-
// v-bind="$attrs"
|
|
73
|
+
// v-bind="$attrs" // virtualTriggering virtualRef等
|
|
74
|
+
virtualRef: props.virtualRef,
|
|
75
|
+
virtualTriggering: props.virtualTriggering,
|
|
74
76
|
trigger: props.trigger,
|
|
75
77
|
placement: props.placement,
|
|
76
78
|
disabled: props.disabled,
|
|
77
|
-
visible:
|
|
79
|
+
visible: props.visible, // todo undefined don't show popover , why ?
|
|
78
80
|
transition: props.transition,
|
|
79
81
|
popperOptions: props.popperOptions,
|
|
80
82
|
content: props.content,
|
|
@@ -102,7 +104,7 @@ class TdPopover extends framework_1.TypeFragment {
|
|
|
102
104
|
hide: afterLeave,
|
|
103
105
|
},
|
|
104
106
|
slots: {
|
|
105
|
-
default: (
|
|
107
|
+
default: (_a = props.slots) === null || _a === void 0 ? void 0 : _a.reference,
|
|
106
108
|
content: [
|
|
107
109
|
props.title
|
|
108
110
|
? new framework_1.Div({
|
|
@@ -114,7 +116,7 @@ class TdPopover extends framework_1.TypeFragment {
|
|
|
114
116
|
})
|
|
115
117
|
: undefined,
|
|
116
118
|
new framework_1.Fragment({
|
|
117
|
-
slot: (
|
|
119
|
+
slot: (_d = (_b = props.slot) !== null && _b !== void 0 ? _b : (_c = props.slots) === null || _c === void 0 ? void 0 : _c.default) !== null && _d !== void 0 ? _d : props.content,
|
|
118
120
|
}),
|
|
119
121
|
],
|
|
120
122
|
},
|
|
@@ -2,6 +2,8 @@ import { ITypeFragment, TypeFragmentProps } from '@type-dom/framework';
|
|
|
2
2
|
import { TooltipTriggerType } from '../td-tooltip/trigger/trigger.interface';
|
|
3
3
|
import { Placement } from '@type-dom/popper';
|
|
4
4
|
import { IStyle } from '@type-dom/css-type';
|
|
5
|
+
import { Ref } from '@type-dom/signals';
|
|
6
|
+
import { Measurable } from '../td-popper/td-popper.interface';
|
|
5
7
|
import { TooltipContentProps } from '../td-tooltip/content/content.interface';
|
|
6
8
|
export interface ITdPopover extends ITypeFragment {
|
|
7
9
|
className: 'TdPopover';
|
|
@@ -103,4 +105,6 @@ export interface PopoverProps extends TypeFragmentProps {
|
|
|
103
105
|
*/
|
|
104
106
|
persistent?: boolean;
|
|
105
107
|
'onUpdate:visible'?: (visible: boolean) => void;
|
|
108
|
+
virtualRef?: Ref<Measurable>;
|
|
109
|
+
virtualTriggering?: boolean;
|
|
106
110
|
}
|
|
@@ -14,12 +14,12 @@ class TdPopperArrow extends framework_1.TypeSpan {
|
|
|
14
14
|
this.props = this.useParams(params);
|
|
15
15
|
}
|
|
16
16
|
setup() {
|
|
17
|
-
console.log('TdPopperArrow setup . ');
|
|
17
|
+
// console.log('TdPopperArrow setup . ');
|
|
18
18
|
const props = this.props;
|
|
19
19
|
const ns = (0, use_namespace_1.useNamespace)('popper');
|
|
20
20
|
const { arrowOffset, arrowRef, arrowStyle } = (0, framework_1.inject)(constants_1.POPPER_CONTENT_INJECTION_KEY, undefined);
|
|
21
21
|
(0, signals_1.watch)(() => { var _a; return (_a = props.arrowOffset) === null || _a === void 0 ? void 0 : _a.get(); }, (val) => {
|
|
22
|
-
console.warn('watch props.arrowOffset is ', val);
|
|
22
|
+
// console.warn('watch props.arrowOffset is ', val);
|
|
23
23
|
arrowOffset === null || arrowOffset === void 0 ? void 0 : arrowOffset.set(val);
|
|
24
24
|
});
|
|
25
25
|
(0, framework_1.onBeforeUnmount)(() => {
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { IStyle } from '@type-dom/css-type';
|
|
2
2
|
import { PopperContentProps } from '../content/content.interface';
|
|
3
|
+
import { StyleValue } from '@type-dom/framework';
|
|
3
4
|
export declare const usePopperContentDOM: (props: PopperContentProps, { styles, role, }: any) => {
|
|
4
5
|
ariaModal: import("@type-dom/signals").Computed<string | undefined>;
|
|
5
6
|
arrowStyle: import("@type-dom/signals").Computed<IStyle<string | 0, string>>;
|
|
6
7
|
contentClass: import("@type-dom/signals").Computed<((string | {
|
|
7
|
-
[x: string]:
|
|
8
|
+
[x: string]: unknown;
|
|
8
9
|
} | ((string | {
|
|
9
|
-
[x: string]:
|
|
10
|
+
[x: string]: unknown;
|
|
10
11
|
} | ((string | {
|
|
11
|
-
[x: string]:
|
|
12
|
+
[x: string]: unknown;
|
|
12
13
|
} | ((string | {
|
|
13
|
-
[x: string]:
|
|
14
|
+
[x: string]: unknown;
|
|
14
15
|
} | ((string | {
|
|
15
|
-
[x: string]:
|
|
16
|
+
[x: string]: unknown;
|
|
16
17
|
} | ((string | {
|
|
17
|
-
[x: string]:
|
|
18
|
+
[x: string]: unknown;
|
|
18
19
|
} | ((string | {
|
|
19
|
-
[x: string]:
|
|
20
|
+
[x: string]: unknown;
|
|
20
21
|
} | ((string | {
|
|
21
|
-
[x: string]:
|
|
22
|
+
[x: string]: unknown;
|
|
22
23
|
} | ((string | {
|
|
23
|
-
[x: string]:
|
|
24
|
+
[x: string]: unknown;
|
|
24
25
|
} | ((string | {
|
|
25
|
-
[x: string]:
|
|
26
|
+
[x: string]: unknown;
|
|
26
27
|
} | ((string | {
|
|
27
|
-
[x: string]:
|
|
28
|
+
[x: string]: unknown;
|
|
28
29
|
} | ((string | {
|
|
29
|
-
[x: string]:
|
|
30
|
+
[x: string]: unknown;
|
|
30
31
|
} | /*elided*/ any) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]) | undefined)[]>;
|
|
31
|
-
contentStyle:
|
|
32
|
+
contentStyle: import("@type-dom/signals").Computed<StyleValue[]>;
|
|
32
33
|
contentZIndex: import("@type-dom/signals").Signal<number>;
|
|
33
34
|
updateZIndex: () => void;
|
|
34
35
|
};
|
|
@@ -19,7 +19,14 @@ styles, role, } //: Pick<UsePopperReturn, 'attributes' | 'styles'> &
|
|
|
19
19
|
ns.is(props.effect || ''),
|
|
20
20
|
props.popperClass,
|
|
21
21
|
]);
|
|
22
|
-
const contentStyle =
|
|
22
|
+
const contentStyle = (0, signals_1.computed)(() => {
|
|
23
|
+
// console.warn('props.popperStyle is ', props.popperStyle)
|
|
24
|
+
return [
|
|
25
|
+
{ zIndex: (0, signals_1.unref)(contentZIndex) },
|
|
26
|
+
(0, signals_1.unref)(styles).popper,
|
|
27
|
+
props.popperStyle || {},
|
|
28
|
+
];
|
|
29
|
+
});
|
|
23
30
|
const ariaModal = (0, signals_1.computed)(() => role === 'dialog' ? 'false' : undefined);
|
|
24
31
|
const arrowStyle = (0, signals_1.computed)(() => ((0, signals_1.unref)(styles).arrow || {}));
|
|
25
32
|
const updateZIndex = () => {
|
|
@@ -7,7 +7,7 @@ export declare const usePopperContent: (props: PopperContentProps) => {
|
|
|
7
7
|
[key: string]: string | boolean;
|
|
8
8
|
};
|
|
9
9
|
}>;
|
|
10
|
-
arrowRef: import("@type-dom/signals").Signal<HTMLElement
|
|
10
|
+
arrowRef: import("@type-dom/signals").Signal<HTMLElement>;
|
|
11
11
|
contentRef: import("@type-dom/signals").Signal<HTMLElement | undefined>;
|
|
12
12
|
instanceRef: Computed<import("@type-dom/popper").Instance | undefined>;
|
|
13
13
|
state: Computed<{
|
|
@@ -24,6 +24,11 @@ export declare const usePopperContent: (props: PopperContentProps) => {
|
|
|
24
24
|
} | undefined;
|
|
25
25
|
placement?: import("@type-dom/popper").Placement | undefined;
|
|
26
26
|
strategy?: import("@type-dom/popper").Strategy;
|
|
27
|
+
orderedMiddlewares?: {
|
|
28
|
+
options?: any;
|
|
29
|
+
name: string;
|
|
30
|
+
fn: (state: import("@type-dom/popper").MiddlewareState) => import("@type-dom/popper").MiddlewareReturn | Promise<import("@type-dom/popper").MiddlewareReturn>;
|
|
31
|
+
}[] | undefined;
|
|
27
32
|
scrollParents?: {
|
|
28
33
|
reference: Array<Element | Window | VisualViewport>;
|
|
29
34
|
popper: Array<Element | Window | VisualViewport>;
|
|
@@ -39,7 +44,7 @@ export declare const usePopperContent: (props: PopperContentProps) => {
|
|
|
39
44
|
}>;
|
|
40
45
|
styles: Computed<Record<string, import("dist/libs/css-type/src").IStyle<string | 0, string>>>;
|
|
41
46
|
role: Computed<import("../td-popper.interface").RoleTypes | undefined>;
|
|
42
|
-
forceUpdate: () => Promise<
|
|
43
|
-
update: () => Promise<import("@type-dom/popper").State | undefined
|
|
47
|
+
forceUpdate: () => Promise<void> | undefined;
|
|
48
|
+
update: () => Promise<Partial<import("@type-dom/popper").State>> | undefined;
|
|
44
49
|
};
|
|
45
50
|
export type UsePopperContentReturn = ReturnType<typeof usePopperContent>;
|
|
@@ -19,16 +19,21 @@ const usePopperContent = (props) => {
|
|
|
19
19
|
const { popperInstanceRef, contentRef, triggerRef, role } = (0, framework_1.inject)(constants_1.POPPER_INJECTION_KEY, undefined);
|
|
20
20
|
const arrowRef = (0, signals_1.signal)();
|
|
21
21
|
const arrowOffset = (0, signals_1.signal)(5);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
const eventListenerMiddleware = (0, signals_1.computed)(() => {
|
|
23
|
+
return {
|
|
24
|
+
name: 'eventListeners',
|
|
25
|
+
// enabled: !!props.visible,
|
|
26
|
+
fn: (state) => {
|
|
27
|
+
if ((0, signals_1.toRaw)(props.visible)) {
|
|
28
|
+
// update();
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
});
|
|
28
33
|
// middleWare
|
|
29
34
|
const arrowMiddleware = (0, signals_1.computed)(() => {
|
|
30
35
|
var _a;
|
|
31
|
-
console.log('arrowMiddleware', arrowRef, arrowOffset);
|
|
36
|
+
// console.log('arrowMiddleware', arrowRef, arrowOffset);
|
|
32
37
|
const arrowEl = (0, signals_1.unref)(arrowRef);
|
|
33
38
|
const offset = (_a = (0, signals_1.unref)(arrowOffset)) !== null && _a !== void 0 ? _a : DEFAULT_ARROW_OFFSET;
|
|
34
39
|
// Seems like the `phase` and `fn` is required by Modifier type
|
|
@@ -43,16 +48,18 @@ const usePopperContent = (props) => {
|
|
|
43
48
|
// },
|
|
44
49
|
// }
|
|
45
50
|
if (!(0, utils_1.isUndefined)(arrowEl)) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return undefined;
|
|
51
|
+
if (state.get().elements) {
|
|
52
|
+
state.get().elements.arrow = arrowEl;
|
|
53
|
+
}
|
|
50
54
|
}
|
|
55
|
+
return (0, popper_1.arrow)({ element: arrowEl, padding: offset });
|
|
51
56
|
});
|
|
52
57
|
// 这个 options 对应的是 中间件 Middleware, 不包含其它的选项。
|
|
53
58
|
const options = (0, signals_1.computed)(() => {
|
|
54
|
-
console.warn('useContent options computed . ');
|
|
55
|
-
return Object.assign({
|
|
59
|
+
// console.warn('useContent options computed . ');
|
|
60
|
+
return Object.assign({ onFirstUpdate: () => {
|
|
61
|
+
update();
|
|
62
|
+
} }, (0, utils_2.buildPopperOptions)(props, [
|
|
56
63
|
(0, signals_1.unref)(arrowMiddleware),
|
|
57
64
|
// unref(eventListenerModifier),
|
|
58
65
|
]));
|
|
@@ -65,6 +72,7 @@ const usePopperContent = (props) => {
|
|
|
65
72
|
var _a;
|
|
66
73
|
return (_a = (0, signals_1.unref)(computedReference)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
67
74
|
}, () => {
|
|
75
|
+
// virtual-trigger
|
|
68
76
|
update();
|
|
69
77
|
});
|
|
70
78
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PopperContentProps } from '../content/content.interface';
|
|
2
2
|
export declare const usePopperContentFocusTrap: (props: PopperContentProps, emit: (evt: string) => void) => {
|
|
3
|
-
focusStartRef: import("@type-dom/signals").Signal<HTMLElement | "first" | "container"
|
|
3
|
+
focusStartRef: import("@type-dom/signals").Signal<HTMLElement | "first" | "container">;
|
|
4
4
|
trapped: import("@type-dom/signals").Signal<boolean>;
|
|
5
5
|
onFocusAfterReleased: (event?: CustomEvent) => void;
|
|
6
6
|
onFocusAfterTrapped: () => void;
|
|
@@ -16,7 +16,7 @@ const usePopperContentFocusTrap = (props, emit) => {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
const onFocusInTrap = (event) => {
|
|
19
|
-
if (props.visible && !trapped.get()) {
|
|
19
|
+
if ((0, signals_1.unref)(props.visible) && !trapped.get()) {
|
|
20
20
|
if (event === null || event === void 0 ? void 0 : event.target) {
|
|
21
21
|
focusStartRef.set(event.target);
|
|
22
22
|
}
|
|
@@ -8,8 +8,8 @@ export declare class TdPopperContent extends TypeDiv implements ITdPopperContent
|
|
|
8
8
|
props: PopperContentProps & TypeDivProps;
|
|
9
9
|
popperContentRef: Signal<HTMLElement | undefined>;
|
|
10
10
|
popperInstanceRef?: Computed<Instance | undefined>;
|
|
11
|
-
updatePopper
|
|
12
|
-
contentStyle
|
|
11
|
+
updatePopper?: (shouldUpdateZIndex?: boolean) => void;
|
|
12
|
+
contentStyle?: IStyle;
|
|
13
13
|
constructor(params?: PopperContentProps);
|
|
14
14
|
setup(): void;
|
|
15
15
|
}
|
|
@@ -15,7 +15,7 @@ const content_const_1 = require("./content.const");
|
|
|
15
15
|
class TdPopperContent extends framework_1.TypeDiv {
|
|
16
16
|
constructor(params = {}) {
|
|
17
17
|
super();
|
|
18
|
-
console.log('TdPopperContent . ');
|
|
18
|
+
// console.log('TdPopperContent . ');
|
|
19
19
|
this.className = 'TdPopperContent';
|
|
20
20
|
this.attr.addName('td-popper-content');
|
|
21
21
|
this.addEmits(content_const_1.popperContentEmits);
|
|
@@ -25,7 +25,7 @@ class TdPopperContent extends framework_1.TypeDiv {
|
|
|
25
25
|
const props = this.props;
|
|
26
26
|
const emit = this.emit;
|
|
27
27
|
const { focusStartRef, trapped, onFocusAfterReleased, onFocusAfterTrapped, onFocusInTrap, onFocusoutPrevented, onReleaseRequested, } = (0, use_focus_trap_1.usePopperContentFocusTrap)(props, emit);
|
|
28
|
-
const { attributes, arrowRef, contentRef,
|
|
28
|
+
const { attributes, arrowRef, contentRef, styles, instanceRef, role, update, } = (0, use_content_1.usePopperContent)(props);
|
|
29
29
|
const { ariaModal, arrowStyle,
|
|
30
30
|
// contentAttrs,
|
|
31
31
|
contentClass, contentStyle, updateZIndex, } = (0, use_content_dom_1.usePopperContentDOM)(props, {
|
|
@@ -33,7 +33,7 @@ class TdPopperContent extends framework_1.TypeDiv {
|
|
|
33
33
|
attributes,
|
|
34
34
|
role,
|
|
35
35
|
});
|
|
36
|
-
const formItemContext =
|
|
36
|
+
const formItemContext = (0, framework_1.inject)(td_form_const_1.formItemContextKey, undefined);
|
|
37
37
|
const arrowOffset = (0, signals_1.signal)();
|
|
38
38
|
this.provide(constants_1.POPPER_CONTENT_INJECTION_KEY, {
|
|
39
39
|
arrowStyle,
|
|
@@ -46,51 +46,12 @@ class TdPopperContent extends framework_1.TypeDiv {
|
|
|
46
46
|
}
|
|
47
47
|
let triggerTargetAriaStopWatch = undefined;
|
|
48
48
|
const updatePopper = (...args_1) => tslib_1.__awaiter(this, [...args_1], void 0, function* (shouldUpdateZIndex = true) {
|
|
49
|
-
console.warn('updatePopper . ');
|
|
50
|
-
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const state = yield update();
|
|
54
|
-
console.warn('state is ', state);
|
|
55
|
-
if (!state)
|
|
56
|
-
return;
|
|
57
|
-
if (contentRef.get()) {
|
|
58
|
-
this.attr.setObj({
|
|
59
|
-
// maybe flip
|
|
60
|
-
dataPopperPlacement: state.placement,
|
|
61
|
-
});
|
|
62
|
-
const popperStyle = state === null || state === void 0 ? void 0 : state.styles.popper;
|
|
63
|
-
if (popperStyle) {
|
|
64
|
-
(0, utils_1.setStyle)(contentRef.get(), {
|
|
65
|
-
position: state.strategy,
|
|
66
|
-
left: popperStyle.left + 'px',
|
|
67
|
-
top: popperStyle.top + 'px',
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
const arrowDom = arrowRef.get();
|
|
71
|
-
if (arrowDom && (state === null || state === void 0 ? void 0 : state.middlewareData.arrow)) {
|
|
72
|
-
// const arrowStyle = matchPlacement(state.placement?.split('-')?.shift() as keyof typeof $placements || 'top');
|
|
73
|
-
// setStyle(arrowDom, {
|
|
74
|
-
// position: state.strategy,
|
|
75
|
-
// ...arrowStyle
|
|
76
|
-
// });
|
|
77
|
-
const arrowParams = state.middlewareData.arrow;
|
|
78
|
-
if (arrowParams === null || arrowParams === void 0 ? void 0 : arrowParams.x) {
|
|
79
|
-
(0, utils_1.setStyle)(arrowDom, {
|
|
80
|
-
left: arrowParams.x + 'px',
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (arrowParams === null || arrowParams === void 0 ? void 0 : arrowParams.y) {
|
|
84
|
-
(0, utils_1.setStyle)(arrowDom, {
|
|
85
|
-
top: arrowParams.y + 'px',
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
49
|
+
// console.warn('updatePopper . ');
|
|
50
|
+
update();
|
|
90
51
|
shouldUpdateZIndex && updateZIndex();
|
|
91
52
|
});
|
|
92
53
|
const togglePopperAlive = () => {
|
|
93
|
-
console.warn('togglePopperAlive . ');
|
|
54
|
+
// console.warn('togglePopperAlive . ');
|
|
94
55
|
updatePopper(false);
|
|
95
56
|
if ((0, signals_1.unref)(props.visible) && props.focusOnShow) {
|
|
96
57
|
trapped.set(true);
|
|
@@ -100,7 +61,7 @@ class TdPopperContent extends framework_1.TypeDiv {
|
|
|
100
61
|
}
|
|
101
62
|
};
|
|
102
63
|
(0, framework_1.onMounted)(() => {
|
|
103
|
-
(0, signals_1.watch)(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
|
64
|
+
(0, signals_1.watch)(() => (0, signals_1.unref)(props.triggerTargetEl), (triggerTargetEl, prevTriggerTargetEl) => {
|
|
104
65
|
triggerTargetAriaStopWatch === null || triggerTargetAriaStopWatch === void 0 ? void 0 : triggerTargetAriaStopWatch();
|
|
105
66
|
triggerTargetAriaStopWatch = undefined;
|
|
106
67
|
const el = (0, signals_1.unref)(triggerTargetEl || (contentRef === null || contentRef === void 0 ? void 0 : contentRef.get()));
|
|
@@ -151,11 +112,17 @@ class TdPopperContent extends framework_1.TypeDiv {
|
|
|
151
112
|
});
|
|
152
113
|
this.assignProps({
|
|
153
114
|
refDom: contentRef,
|
|
115
|
+
// styleObj: contentStyle,
|
|
154
116
|
});
|
|
117
|
+
// this.addEvents({ // dead loop
|
|
118
|
+
// mouseenter: (e) => emit('mouseenter', e),
|
|
119
|
+
// mouseleave: (e) => emit('mouseleave', e),
|
|
120
|
+
// });
|
|
155
121
|
this.attr.addObj({
|
|
156
122
|
tabindex: -1,
|
|
157
123
|
class: contentClass,
|
|
158
124
|
});
|
|
125
|
+
// console.warn('contentStyle is ', contentStyle.get());
|
|
159
126
|
this.style.addObj(contentStyle);
|
|
160
127
|
this.addChild(new td_focus_trap_class_1.TdFocusTrap({
|
|
161
128
|
trapped: trapped,
|