├── CHANGELOG.md ├── LICENSE ├── README.md ├── components ├── action-sheet │ ├── index.ts │ └── src │ │ ├── action-sheet.ts │ │ ├── action-sheet.vue │ │ ├── composables │ │ ├── index.ts │ │ └── use-action-sheet.ts │ │ └── instance.ts ├── avatar │ ├── index.ts │ └── src │ │ ├── avatar-group.ts │ │ ├── avatar-group.vue │ │ ├── avatar.ts │ │ ├── avatar.vue │ │ ├── composables │ │ ├── avatar-custom.ts │ │ ├── index.ts │ │ ├── use-avatar-badge-props.ts │ │ ├── use-avatar-group.ts │ │ ├── use-avatar-icon-props.ts │ │ ├── use-avatar-props.ts │ │ └── use-avatar.ts │ │ └── instance.ts ├── badge │ ├── index.ts │ └── src │ │ ├── badge.ts │ │ ├── badge.vue │ │ ├── composables │ │ ├── badge-custom.ts │ │ ├── index.ts │ │ └── use-badge.ts │ │ └── instance.ts ├── base │ ├── common-props │ │ ├── checkbox │ │ │ └── index.ts │ │ ├── form-meta │ │ │ └── index.ts │ │ ├── picker │ │ │ └── index.ts │ │ ├── progress │ │ │ └── index.ts │ │ ├── radio │ │ │ └── index.ts │ │ ├── steps │ │ │ └── index.ts │ │ ├── subsection │ │ │ └── index.ts │ │ ├── swipe-action │ │ │ └── index.ts │ │ ├── tabbar │ │ │ └── index.ts │ │ └── tabs │ │ │ └── index.ts │ ├── composables │ │ ├── use-component-common-props │ │ │ └── index.ts │ │ └── use-progress-props │ │ │ └── index.ts │ └── types │ │ └── checkbox │ │ └── index.ts ├── bubble-box │ ├── index.ts │ └── src │ │ ├── bubble-box.ts │ │ ├── bubble-box.vue │ │ ├── composables │ │ ├── bubble-box-custom.ts │ │ ├── index.ts │ │ ├── use-bubble-box.ts │ │ └── use-bubble-options.ts │ │ ├── instance.ts │ │ └── types.ts ├── button │ ├── index.ts │ └── src │ │ ├── button.ts │ │ ├── button.vue │ │ ├── composables │ │ ├── button-custom.ts │ │ ├── index.ts │ │ └── use-button.ts │ │ └── instance.ts ├── calendar │ ├── index.ts │ ├── libs │ │ └── lunar-calendar │ │ │ └── index.ts │ └── src │ │ ├── calendar.ts │ │ ├── calendar.vue │ │ ├── composables │ │ ├── calendar-custom.ts │ │ ├── index.ts │ │ ├── use-calendar-selector.ts │ │ └── use-calendar.ts │ │ ├── instance.ts │ │ └── types.ts ├── checkbox │ ├── index.ts │ └── src │ │ ├── checkbox-group.ts │ │ ├── checkbox-group.vue │ │ ├── checkbox.ts │ │ ├── checkbox.vue │ │ ├── composables │ │ ├── checkbox-custom.ts │ │ ├── index.ts │ │ ├── use-checkbox-common-props.ts │ │ ├── use-checkbox-group.ts │ │ └── use-checkbox.ts │ │ └── instance.ts ├── circle-progress │ ├── index.ts │ └── src │ │ ├── circle-progress.ts │ │ ├── circle-progress.vue │ │ ├── composables │ │ ├── index.ts │ │ └── use-circle-progress.ts │ │ └── instance.ts ├── collapse │ ├── index.ts │ └── src │ │ ├── collapse-item.ts │ │ ├── collapse-item.vue │ │ ├── collapse.ts │ │ ├── collapse.vue │ │ ├── composables │ │ ├── collapse-item-custom.ts │ │ ├── index.ts │ │ ├── use-collapse-item.ts │ │ └── use-collapse.ts │ │ └── instance.ts ├── count-down │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── count-down-custom.ts │ │ ├── count-down-separator-data.ts │ │ ├── index.ts │ │ └── use-count-down.ts │ │ ├── count-down.ts │ │ ├── count-down.vue │ │ └── instance.ts ├── count-scroll │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── count-scroll-custom.ts │ │ ├── index.ts │ │ └── use-count-scroll.ts │ │ ├── count-scroll.ts │ │ ├── count-scroll.vue │ │ └── instance.ts ├── count-to │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── count-to-custom.ts │ │ ├── index.ts │ │ └── use-count-to.ts │ │ ├── count-to.ts │ │ ├── count-to.vue │ │ └── instance.ts ├── date-time-picker │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── use-date-time-data.ts │ │ ├── use-date-time-picker.ts │ │ └── use-handle-min-max-time.ts │ │ ├── date-time-picker.ts │ │ ├── date-time-picker.vue │ │ ├── instance.ts │ │ └── types.ts ├── empty │ ├── index.ts │ ├── libs │ │ ├── default.ts │ │ └── index.ts │ └── src │ │ ├── composables │ │ ├── empty-custom.ts │ │ └── index.ts │ │ ├── empty.ts │ │ ├── empty.vue │ │ └── instance.ts ├── footer │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── footer-custom.ts │ │ ├── index.ts │ │ └── use-footer.ts │ │ ├── footer.ts │ │ ├── footer.vue │ │ ├── instance.ts │ │ └── types.ts ├── form │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── form-custom.ts │ │ ├── form-item-custom.ts │ │ ├── index.ts │ │ ├── use-form-common-props.ts │ │ ├── use-form-item-operation.ts │ │ ├── use-form-item.ts │ │ └── use-form.ts │ │ ├── form-item.ts │ │ ├── form-item.vue │ │ ├── form.ts │ │ ├── form.vue │ │ ├── instance.ts │ │ ├── types.ts │ │ └── utils.ts ├── icon │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── icon-custom.ts │ │ └── index.ts │ │ ├── icon.ts │ │ ├── icon.vue │ │ └── instance.ts ├── image-upload │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── use-image-upload.ts │ │ └── use-upload-handle-function.ts │ │ ├── image-upload.ts │ │ ├── image-upload.vue │ │ ├── instance.ts │ │ └── types.ts ├── index-list │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index-list-custom.ts │ │ ├── index.ts │ │ └── use-index-list.ts │ │ ├── index-list.ts │ │ ├── index-list.vue │ │ ├── instance.ts │ │ └── types.ts ├── index.ts ├── input │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── input-custom.ts │ │ └── use-input.ts │ │ ├── input.ts │ │ ├── input.vue │ │ └── instance.ts ├── keyboard │ ├── index.ts │ ├── libs │ │ ├── car-keyboard-data.ts │ │ └── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── use-keyboard-data.ts │ │ └── use-keyboard.ts │ │ ├── instance.ts │ │ ├── keyboard.ts │ │ └── keyboard.vue ├── lazy-load │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── lazy-load-custom.ts │ │ └── use-lazy-load.ts │ │ ├── instance.ts │ │ ├── lazy-load.ts │ │ ├── lazy-load.vue │ │ └── types.ts ├── line-progress │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── line-progress-custom.ts │ │ ├── instance.ts │ │ ├── line-progress.ts │ │ └── line-progress.vue ├── list │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── list-item-custom.ts │ │ ├── instance.ts │ │ ├── list-item.ts │ │ └── list-item.vue ├── loading │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── loading-custom.ts │ │ ├── instance.ts │ │ ├── loading.ts │ │ └── loading.vue ├── loadmore │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── loadmore-custom.ts │ │ ├── instance.ts │ │ ├── loadmore.ts │ │ └── loadmore.vue ├── modal │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── modal-custom.ts │ │ └── use-modal.ts │ │ ├── instance.ts │ │ ├── modal.ts │ │ └── modal.vue ├── navbar │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── navbar-custom.ts │ │ └── use-navbar.ts │ │ ├── instance.ts │ │ ├── navbar.ts │ │ ├── navbar.vue │ │ └── types.ts ├── notice-bar │ ├── index.ts │ └── src │ │ ├── column-notice-bar.vue │ │ ├── composables │ │ ├── index.ts │ │ ├── notice-bar-common-props.ts │ │ ├── use-column-notice-bar.ts │ │ ├── use-notice-bar.ts │ │ └── use-row-notice-bar.ts │ │ ├── instance.ts │ │ ├── notice-bar.ts │ │ ├── notice-bar.vue │ │ └── row-notice-bar.vue ├── notify │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── notify-custom.ts │ │ └── use-notify.ts │ │ ├── instance.ts │ │ ├── notify.ts │ │ └── notify.vue ├── number-box │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── number-box-custom.ts │ │ └── use-number-box.ts │ │ ├── instance.ts │ │ ├── number-box.ts │ │ └── number-box.vue ├── overlay │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── use-overlay.ts │ │ ├── instance.ts │ │ ├── overlay.ts │ │ └── overlay.vue ├── photo-album │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── use-photo-album.ts │ │ ├── instance.ts │ │ ├── photo-album.ts │ │ └── photo-album.vue ├── picker │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── picker-custom.ts │ │ └── use-picker.ts │ │ ├── instance.ts │ │ ├── picker.ts │ │ └── picker.vue ├── popup │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── popup-custom.ts │ │ └── use-popup.ts │ │ ├── instance.ts │ │ ├── popup.ts │ │ └── popup.vue ├── radio │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── radio-custom.ts │ │ ├── use-radio-common-props.ts │ │ ├── use-radio-group.ts │ │ └── use-radio.ts │ │ ├── instance.ts │ │ ├── radio-group.ts │ │ ├── radio-group.vue │ │ ├── radio.ts │ │ └── radio.vue ├── rate │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── rate-custom.ts │ │ ├── use-rate-item-data.ts │ │ └── use-rate.ts │ │ ├── instance.ts │ │ ├── rate.ts │ │ ├── rate.vue │ │ └── types.ts ├── read-more │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── read-more-custom.ts │ │ └── use-read-more.ts │ │ ├── instance.ts │ │ ├── read-more.ts │ │ └── read-more.vue ├── region-picker │ ├── index.ts │ ├── libs │ │ ├── index.ts │ │ ├── region-data.json │ │ └── types.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── use-region-picker.ts │ │ ├── instance.ts │ │ ├── region-picker.ts │ │ └── region-picker.vue ├── scroll-list │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── scroll-list-custom.ts │ │ └── use-scroll-list.ts │ │ ├── instance.ts │ │ ├── scroll-list.ts │ │ └── scroll-list.vue ├── search-box │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── search-box-custom.ts │ │ └── use-search-box.ts │ │ ├── instance.ts │ │ ├── search-box.ts │ │ └── search-box.vue ├── slider │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── slider-custom.ts │ │ ├── use-slider-common-porps.ts │ │ ├── use-slider-node-info.ts │ │ └── use-slider.ts │ │ ├── instance.ts │ │ ├── slider.ts │ │ └── slider.vue ├── steps │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── step-custom.ts │ │ ├── steps-custom.ts │ │ ├── use-step.ts │ │ └── use-steps.ts │ │ ├── instance.ts │ │ ├── steps-item.ts │ │ ├── steps-item.vue │ │ ├── steps.ts │ │ ├── steps.vue │ │ └── types.ts ├── sticky │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── sticky-custom.ts │ │ ├── use-sticky-support.ts │ │ └── use-sticky.ts │ │ ├── instance.ts │ │ ├── sticky.ts │ │ ├── sticky.vue │ │ └── types.ts ├── subsection │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── subsection-custom.ts │ │ ├── subsection-item-custom.ts │ │ ├── use-subsection-item.ts │ │ └── use-subsection.ts │ │ ├── instance.ts │ │ ├── subsection-item.ts │ │ ├── subsection-item.vue │ │ ├── subsection.ts │ │ ├── subsection.vue │ │ └── types.ts ├── swipe-action │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── swipe-action-options.ts │ │ ├── use-swipe-action-item.ts │ │ └── use-swipe-action.ts │ │ ├── instance.ts │ │ ├── swipe-action-item.ts │ │ ├── swipe-action-item.vue │ │ ├── swipe-action.ts │ │ └── swipe-action.vue ├── swiper │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── swiper-custom.ts │ │ └── use-swiper.ts │ │ ├── instance.ts │ │ ├── swiper.ts │ │ └── swiper.vue ├── switch-tab │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── switch-tab-custom.ts │ │ └── use-switch-tab.ts │ │ ├── instance.ts │ │ ├── switch-tab.ts │ │ └── switch-tab.vue ├── switch │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── switch-custom.ts │ │ ├── use-switch-common-props.ts │ │ └── use-switch.ts │ │ ├── instance.ts │ │ ├── switch.ts │ │ └── switch.vue ├── tabbar │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── tabbar-custom.ts │ │ ├── tabbar-item-custom.ts │ │ ├── use-tabbar-item.ts │ │ └── use-tabbar.ts │ │ ├── instance.ts │ │ ├── tabbar-item.ts │ │ ├── tabbar-item.vue │ │ ├── tabbar.ts │ │ ├── tabbar.vue │ │ └── types.ts ├── tabs │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── tabs-custom.ts │ │ ├── tabs-item-custom.ts │ │ ├── use-tabs-item.ts │ │ └── use-tabs.ts │ │ ├── instance.ts │ │ ├── tabs-item.ts │ │ ├── tabs-item.vue │ │ ├── tabs.ts │ │ ├── tabs.vue │ │ └── types.ts ├── tag │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ ├── tag-custom.ts │ │ └── use-tag.ts │ │ ├── instance.ts │ │ ├── tag.ts │ │ └── tag.vue ├── title │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── title-custom.ts │ │ ├── instance.ts │ │ ├── title.ts │ │ └── title.vue ├── water-fall │ ├── index.ts │ └── src │ │ ├── composables │ │ ├── index.ts │ │ └── use-water-fall.ts │ │ ├── instance.ts │ │ ├── water-fall.ts │ │ └── water-fall.vue └── week-calendar │ ├── index.ts │ └── src │ ├── composables │ ├── index.ts │ ├── use-week-calendar-selector.ts │ ├── use-week-calendar.ts │ └── week-calendar-custom.ts │ ├── instance.ts │ ├── types.ts │ ├── week-calendar.ts │ └── week-calendar.vue ├── constants ├── color.ts ├── event.ts ├── img-mode.ts ├── index.ts ├── key.ts ├── shape.ts ├── size.ts ├── types.ts └── z-index.ts ├── global.d.ts ├── hooks ├── index.ts ├── use-component-color │ └── index.ts ├── use-component-size │ └── index.ts ├── use-long-press │ └── index.ts ├── use-namespace │ └── index.ts ├── use-observer │ └── index.ts ├── use-ordered-children │ └── index.ts ├── use-prop │ └── index.ts ├── use-selector-query │ └── index.ts ├── use-toggle │ └── index.ts ├── use-touch │ └── index.ts ├── use-uniapp-system-rect-info │ └── index.ts └── use-z-index │ └── index.ts ├── index.ts ├── lib ├── component.ts ├── defaults.ts ├── index.ts └── make-installer.ts ├── libs ├── async-validator │ ├── HISTORY.md │ ├── LICENSE.md │ ├── README.md │ ├── index.ts │ ├── interface.ts │ ├── messages.ts │ ├── rule │ │ ├── enum.ts │ │ ├── index.ts │ │ ├── pattern.ts │ │ ├── range.ts │ │ ├── required.ts │ │ ├── type.ts │ │ ├── url.ts │ │ └── whitespace.ts │ ├── util.ts │ └── validator │ │ ├── any.ts │ │ ├── array.ts │ │ ├── boolean.ts │ │ ├── date.ts │ │ ├── enum.ts │ │ ├── float.ts │ │ ├── index.ts │ │ ├── integer.ts │ │ ├── method.ts │ │ ├── number.ts │ │ ├── object.ts │ │ ├── pattern.ts │ │ ├── regexp.ts │ │ ├── required.ts │ │ ├── string.ts │ │ └── type.ts ├── dayjs │ ├── CHANGELOG.md │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── README.md │ ├── constant.js │ ├── index.d.ts │ ├── index.js │ ├── locale │ │ ├── af.js │ │ ├── am.js │ │ ├── ar-dz.js │ │ ├── ar-iq.js │ │ ├── ar-kw.js │ │ ├── ar-ly.js │ │ ├── ar-ma.js │ │ ├── ar-sa.js │ │ ├── ar-tn.js │ │ ├── ar.js │ │ ├── az.js │ │ ├── be.js │ │ ├── bg.js │ │ ├── bi.js │ │ ├── bm.js │ │ ├── bn-bd.js │ │ ├── bn.js │ │ ├── bo.js │ │ ├── br.js │ │ ├── bs.js │ │ ├── ca.js │ │ ├── constant.js │ │ ├── cs.js │ │ ├── cv.js │ │ ├── cy.js │ │ ├── da.js │ │ ├── de-at.js │ │ ├── de-ch.js │ │ ├── de.js │ │ ├── dv.js │ │ ├── el.js │ │ ├── en-au.js │ │ ├── en-ca.js │ │ ├── en-gb.js │ │ ├── en-ie.js │ │ ├── en-il.js │ │ ├── en-in.js │ │ ├── en-nz.js │ │ ├── en-sg.js │ │ ├── en-tt.js │ │ ├── en.js │ │ ├── eo.js │ │ ├── es-do.js │ │ ├── es-mx.js │ │ ├── es-pr.js │ │ ├── es-us.js │ │ ├── es.js │ │ ├── et.js │ │ ├── eu.js │ │ ├── fa.js │ │ ├── fi.js │ │ ├── fo.js │ │ ├── fr-ca.js │ │ ├── fr-ch.js │ │ ├── fr.js │ │ ├── fy.js │ │ ├── ga.js │ │ ├── gd.js │ │ ├── gl.js │ │ ├── gom-latn.js │ │ ├── gu.js │ │ ├── he.js │ │ ├── hi.js │ │ ├── hr.js │ │ ├── ht.js │ │ ├── hu.js │ │ ├── hy-am.js │ │ ├── id.js │ │ ├── index.d copy.ts │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── is.js │ │ ├── it-ch.js │ │ ├── it.js │ │ ├── ja.js │ │ ├── jv.js │ │ ├── ka.js │ │ ├── kk.js │ │ ├── km.js │ │ ├── kn.js │ │ ├── ko.js │ │ ├── ku.js │ │ ├── ky.js │ │ ├── lb.js │ │ ├── lo.js │ │ ├── lt.js │ │ ├── lv.js │ │ ├── me.js │ │ ├── mi.js │ │ ├── mk.js │ │ ├── ml.js │ │ ├── mn.js │ │ ├── mr.js │ │ ├── ms-my.js │ │ ├── ms.js │ │ ├── mt.js │ │ ├── my.js │ │ ├── nb.js │ │ ├── ne.js │ │ ├── nl-be.js │ │ ├── nl.js │ │ ├── nn.js │ │ ├── oc-lnc.js │ │ ├── pa-in.js │ │ ├── pl.js │ │ ├── plugin │ │ │ ├── advancedFormat │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── arraySupport │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── badMutable │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── bigIntSupport │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── buddhistEra │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── calendar │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── customParseFormat │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── dayOfYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── devHelper │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── duration │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isBetween │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isLeapYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isMoment │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isSameOrAfter │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isSameOrBefore │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isToday │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isTomorrow │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isYesterday │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isoWeek │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── isoWeeksInYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── localeData │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── localizedFormat │ │ │ │ ├── index.d.ts │ │ │ │ ├── index.js │ │ │ │ └── utils.js │ │ │ ├── minMax │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── objectSupport │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── pluralGetSet │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── preParsePostFormat │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── quarterOfYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── relativeTime │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── timezone │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── toArray │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── toObject │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── updateLocale │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── utc │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── weekOfYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ ├── weekYear │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ │ └── weekday │ │ │ │ ├── index.d.ts │ │ │ │ └── index.js │ │ ├── pt-br.js │ │ ├── pt.js │ │ ├── rn.js │ │ ├── ro.js │ │ ├── ru.js │ │ ├── rw.js │ │ ├── sd.js │ │ ├── se.js │ │ ├── si.js │ │ ├── sk.js │ │ ├── sl.js │ │ ├── sq.js │ │ ├── sr-cyrl.js │ │ ├── sr.js │ │ ├── ss.js │ │ ├── sv-fi.js │ │ ├── sv.js │ │ ├── sw.js │ │ ├── ta.js │ │ ├── te.js │ │ ├── tet.js │ │ ├── tg.js │ │ ├── th.js │ │ ├── tk.js │ │ ├── tl-ph.js │ │ ├── tlh.js │ │ ├── tr.js │ │ ├── types.d.ts │ │ ├── tzl.js │ │ ├── tzm-latn.js │ │ ├── tzm.js │ │ ├── ug-cn.js │ │ ├── uk.js │ │ ├── ur.js │ │ ├── utils.js │ │ ├── uz-latn.js │ │ ├── uz.js │ │ ├── vi.js │ │ ├── x-pseudo.js │ │ ├── yo.js │ │ ├── zh-cn.js │ │ ├── zh-hk.js │ │ ├── zh-tw.js │ │ └── zh.js │ ├── plugin │ │ ├── advancedFormat │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── arraySupport │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── badMutable │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── bigIntSupport │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── buddhistEra │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── calendar │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── customParseFormat │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── dayOfYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── devHelper │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── duration │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isBetween │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isLeapYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isMoment │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isSameOrAfter │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isSameOrBefore │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isToday │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isTomorrow │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isYesterday │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isoWeek │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── isoWeeksInYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── localeData │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── localizedFormat │ │ │ ├── index.d.ts │ │ │ ├── index.js │ │ │ └── utils.js │ │ ├── minMax │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── objectSupport │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── pluralGetSet │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── preParsePostFormat │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── quarterOfYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── relativeTime │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── timezone │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── toArray │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── toObject │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── updateLocale │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── utc │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── weekOfYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ ├── weekYear │ │ │ ├── index.d.ts │ │ │ └── index.js │ │ └── weekday │ │ │ ├── index.d.ts │ │ │ └── index.js │ └── utils.js └── lodash │ ├── CHANGELOG │ ├── LICENSE │ ├── README.md │ ├── _addMapEntry.ts │ ├── _addSetEntry.ts │ ├── _arrayFilter.ts │ ├── _arrayLikeKeys.ts │ ├── _arrayReduce.ts │ ├── _asciiToArray.ts │ ├── _assignValue.ts │ ├── _baseAssign.ts │ ├── _baseFindIndex.ts │ ├── _baseGetTag.ts │ ├── _baseIndexOf.ts │ ├── _baseIsArguments.ts │ ├── _baseIsNan.ts │ ├── _baseKeys.ts │ ├── _baseSlice.ts │ ├── _baseTime.ts │ ├── _baseToString.ts │ ├── _baseTrim.ts │ ├── _castPath.ts │ ├── _castSlice.ts │ ├── _charStartIndex.ts │ ├── _charsEndIndex.ts │ ├── _cloneArrayBuffer.ts │ ├── _cloneDataView.ts │ ├── _cloneMap.ts │ ├── _cloneRegExp.ts │ ├── _cloneSet.ts │ ├── _cloneSymbol.ts │ ├── _cloneTypedArray.ts │ ├── _common.ts │ ├── _copyArray.ts │ ├── _copyObject.ts │ ├── _copySymbols.ts │ ├── _eq.ts │ ├── _getSymbol.ts │ ├── _getTag.ts │ ├── _hasUnicode.ts │ ├── _initCloneArray.ts │ ├── _initCloneByTag.ts │ ├── _initCloneObject.ts │ ├── _isHostObject.ts │ ├── _isIndex.ts │ ├── _isKey.ts │ ├── _isPrototype.ts │ ├── _mapToArray.ts │ ├── _nativeKeys.ts │ ├── _objectToString.ts │ ├── _overArg.ts │ ├── _setToArray.ts │ ├── _strictIndexOf.ts │ ├── _stringToArray.ts │ ├── _stringToPath.ts │ ├── _toKey.ts │ ├── _toNumber.ts │ ├── _toSource.ts │ ├── _toString.ts │ ├── _trimmedEndIndex.ts │ ├── _unicodeToArray.ts │ ├── cast-array.ts │ ├── debounce.ts │ ├── from-pairs.ts │ ├── get.ts │ ├── index.ts │ ├── is-arguments.ts │ ├── is-array-like.ts │ ├── is-array.ts │ ├── is-boolean.ts │ ├── is-function.ts │ ├── is-length.ts │ ├── is-nil.ts │ ├── is-number.ts │ ├── is-object-like.ts │ ├── is-object.ts │ ├── keys.ts │ ├── set.ts │ ├── stubArray.ts │ ├── throttle.ts │ └── trim.ts ├── package.json ├── theme-chalk ├── mixins │ ├── config.scss │ ├── function.scss │ └── mixins.scss ├── src │ ├── action-sheet.scss │ ├── avatar-group.scss │ ├── avatar.scss │ ├── badge.scss │ ├── bubble-box.scss │ ├── button.scss │ ├── calendar.scss │ ├── checkbox-group.scss │ ├── checkbox.scss │ ├── circle-progress.scss │ ├── collapse-item.scss │ ├── collapse.scss │ ├── column-notice-bar.scss │ ├── count-down.scss │ ├── count-scroll.scss │ ├── count-to.scss │ ├── empty.scss │ ├── footer.scss │ ├── form-item.scss │ ├── form.scss │ ├── icon.scss │ ├── image-upload.scss │ ├── index-list.scss │ ├── input.scss │ ├── keyboard.scss │ ├── lazy-load.scss │ ├── line-progress.scss │ ├── list.scss │ ├── loading.scss │ ├── loadmore.scss │ ├── modal.scss │ ├── navbar.scss │ ├── notice-bar.scss │ ├── notify.scss │ ├── number-box.scss │ ├── overlay.scss │ ├── photo-album.scss │ ├── picker.scss │ ├── popup.scss │ ├── radio-group.scss │ ├── radio.scss │ ├── rate.scss │ ├── read-more.scss │ ├── row-notice-bar.scss │ ├── scroll-list.scss │ ├── search-box.scss │ ├── slider.scss │ ├── step.scss │ ├── steps.scss │ ├── sticky.scss │ ├── subsection-item.scss │ ├── subsection.scss │ ├── swipe-action-item.scss │ ├── swipe-action.scss │ ├── swiper.scss │ ├── switch-tab.scss │ ├── switch.scss │ ├── tabbar-item.scss │ ├── tabbar.scss │ ├── tabs-item.scss │ ├── tabs.scss │ ├── tag.scss │ ├── title.scss │ ├── water-fall.scss │ └── week-calendar.scss └── var │ └── size.scss ├── tokens ├── avatar.ts ├── checkbox.ts ├── collapse.ts ├── form.ts ├── index.ts ├── notice-bar.ts ├── radio.ts ├── steps.ts ├── subsection.ts ├── swipe-action.ts ├── tabbar.ts └── tabs.ts ├── typings └── uniapp.d.ts └── utils ├── clone-deep.ts ├── debounce.ts ├── dom ├── index.ts ├── select-query.ts └── unit.ts ├── error.ts ├── format.ts ├── index.ts ├── is-empty.ts ├── objects.ts ├── rand.ts ├── throttle.ts ├── types.ts ├── typescript.ts ├── uniapp ├── index.ts └── router.ts ├── validator └── index.ts └── vue ├── icon.ts ├── index.ts ├── install.ts ├── props ├── index.ts ├── runtime.ts ├── types.ts └── util.ts └── typescript.ts /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2023-present, Tuniao Technology 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /components/action-sheet/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import ActionSheet from './src/action-sheet.vue' 3 | 4 | export const TnActionSheet = withNoopInstall(ActionSheet) 5 | export default TnActionSheet 6 | 7 | export * from './src/action-sheet' 8 | export type { TnActionSheetInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/action-sheet/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-action-sheet' 2 | -------------------------------------------------------------------------------- /components/action-sheet/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type ActionSheet from './action-sheet.vue' 2 | 3 | export type TnActionSheetInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/avatar/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | 3 | import Avatar from './src/avatar.vue' 4 | import AvatarGroup from './src/avatar-group.vue' 5 | 6 | export const TnAvatar = withInstall(Avatar, { 7 | AvatarGroup, 8 | }) 9 | export const TnAvatarGroup = withNoopInstall(AvatarGroup) 10 | export default TnAvatar 11 | 12 | export * from './src/avatar' 13 | export * from './src/avatar-group' 14 | export type { AvatarInstance, AvatarGroupInstance } from './src/instance' 15 | -------------------------------------------------------------------------------- /components/avatar/src/avatar-group.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | 21 | 24 | -------------------------------------------------------------------------------- /components/avatar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-avatar-icon-props' 2 | export * from './use-avatar-props' 3 | export * from './avatar-custom' 4 | export * from './use-avatar' 5 | export * from './use-avatar-group' 6 | export * from './use-avatar-badge-props' 7 | -------------------------------------------------------------------------------- /components/avatar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Avatar from './avatar.vue' 2 | import type AvatarGroup from './avatar-group.vue' 3 | 4 | export type AvatarInstance = InstanceType 5 | export type AvatarGroupInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/badge/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | 3 | import Badge from './src/badge.vue' 4 | 5 | export const TnBadge = withNoopInstall(Badge) 6 | export default TnBadge 7 | 8 | export * from './src/badge' 9 | export type { BadgeInstance } from './src/instance' 10 | -------------------------------------------------------------------------------- /components/badge/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './badge-custom' 2 | export * from './use-badge' 3 | -------------------------------------------------------------------------------- /components/badge/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Badge from './badge.vue' 2 | 3 | export type BadgeInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/base/common-props/form-meta/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | import { formComponentSizes } from '../../../../constants' 3 | 4 | export const formMetaProps = buildProps({ 5 | /** 6 | * @description 设置表单下组件的尺寸 7 | */ 8 | size: { 9 | type: String, 10 | values: formComponentSizes, 11 | }, 12 | /** 13 | * @description 是否禁用表单内的所有组件,优先级比组件自身的禁用属性高 14 | */ 15 | disabled: Boolean, 16 | } as const) 17 | -------------------------------------------------------------------------------- /components/base/common-props/progress/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | import type { ExtractPropTypes } from 'vue' 4 | 5 | export const propgressBaseProps = buildProps({ 6 | /** 7 | * @description 当前进度百分比 8 | */ 9 | percent: { 10 | type: Number, 11 | default: 0, 12 | }, 13 | /** 14 | * @description 激活时的颜色,以tn开头则使用图鸟内置的颜色,在为圆环进度条是无法使用内置的颜色 15 | */ 16 | activeColor: String, 17 | /** 18 | * @description 未激活时的颜色,以tn开头则使用图鸟内置的颜色,在为圆环进度条是无法使用内置的颜色 19 | */ 20 | inactiveColor: String, 21 | /** 22 | * @description 显示当前进度 23 | */ 24 | showPercent: Boolean, 25 | /** 26 | * @description 动画执行时间,单位ms 27 | */ 28 | duration: { 29 | type: Number, 30 | default: 1500, 31 | }, 32 | } as const) 33 | 34 | export type ProgressBaseProps = ExtractPropTypes 35 | -------------------------------------------------------------------------------- /components/base/common-props/radio/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | import { useFormSizeProps } from '../../composables/use-component-common-props' 3 | 4 | export const radioBaseProps = buildProps({ 5 | /** 6 | * @description radio单选框尺寸 7 | */ 8 | size: useFormSizeProps, 9 | /** 10 | * @description radio单选框是否禁用 11 | */ 12 | disabled: Boolean, 13 | /** 14 | * @description radio禁止点击标签进行选择 15 | */ 16 | labelDisabled: Boolean, 17 | /** 18 | * @description 是否显示边框 19 | */ 20 | border: Boolean, 21 | /** 22 | * @description radio激活时的颜色,以tn开头则使用图鸟内置的颜色只支持普通颜色 23 | */ 24 | activeColor: { 25 | type: String, 26 | default: '', 27 | }, 28 | } as const) 29 | -------------------------------------------------------------------------------- /components/base/common-props/steps/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | export const stepsBaseProps = buildProps({ 4 | /** 5 | * @description 默认颜色,以tn开头使用图鸟内置颜色 6 | */ 7 | color: String, 8 | /** 9 | * @description 激活时颜色,以tn开头使用图鸟内置颜色 10 | */ 11 | activeColor: String, 12 | /** 13 | * @description 禁止点击 14 | */ 15 | disabled: Boolean, 16 | } as const) 17 | -------------------------------------------------------------------------------- /components/base/common-props/subsection/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | export const subsectionBaseProps = buildProps({ 4 | /** 5 | * @description 默认颜色,以tn开头使用图鸟内置的颜色 6 | */ 7 | color: String, 8 | /** 9 | * @description 激活时的颜色,以tn开头使用图鸟内置的颜色 10 | */ 11 | activeColor: String, 12 | /** 13 | * @description 是否禁用 14 | */ 15 | disabled: Boolean, 16 | } as const) 17 | -------------------------------------------------------------------------------- /components/base/common-props/swipe-action/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | export const swipeActionBaseProps = buildProps({ 4 | /** 5 | * @description 自动关闭菜单 6 | */ 7 | autoClose: { 8 | type: Boolean, 9 | default: true, 10 | }, 11 | } as const) 12 | -------------------------------------------------------------------------------- /components/base/common-props/tabbar/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | export const tabbarBaseProps = buildProps({ 4 | /** 5 | * @description 未选中时的颜色 6 | */ 7 | inactiveColor: String, 8 | /** 9 | * @description 选中时的颜色 10 | */ 11 | activeColor: String, 12 | /** 13 | * @description 图标大小 14 | */ 15 | iconSize: String, 16 | /** 17 | * @description 文字大小 18 | */ 19 | fontSize: String, 20 | } as const) 21 | -------------------------------------------------------------------------------- /components/base/common-props/tabs/index.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../../utils' 2 | 3 | export const tabsBaseProps = buildProps({ 4 | /** 5 | * @description 默认颜色,以tn开头时使用图鸟内置的颜色 6 | */ 7 | color: String, 8 | /** 9 | * @description 选中颜色,以tn开头时使用图鸟内置的颜色 10 | */ 11 | activeColor: String, 12 | /** 13 | * @description 字体大小 14 | */ 15 | fontSize: String, 16 | /** 17 | * @description 选中字体大小 18 | */ 19 | activeFontSize: String, 20 | } as const) 21 | -------------------------------------------------------------------------------- /components/base/types/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | export const checkboxCheckedShapes = ['square', 'circle'] as const 2 | export type CheckboxCheckedShape = (typeof checkboxCheckedShapes)[number] 3 | 4 | export type CheckboxValueType = string | number | boolean 5 | -------------------------------------------------------------------------------- /components/bubble-box/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import BubbleBox from './src/bubble-box.vue' 3 | 4 | export const TnBubbleBox = withNoopInstall(BubbleBox) 5 | export default TnBubbleBox 6 | 7 | export * from './src/bubble-box' 8 | export type { TnBubbleBoxInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/bubble-box/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './bubble-box-custom' 2 | export * from './use-bubble-options' 3 | export * from './use-bubble-box' 4 | -------------------------------------------------------------------------------- /components/bubble-box/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type BubbleBox from './bubble-box.vue' 2 | 3 | export type TnBubbleBoxInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/bubble-box/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface BubbleBoxOptionItemData { 2 | text: string 3 | icon: string 4 | disabled: boolean 5 | color: BubbleBoxOptionDataColor 6 | } 7 | 8 | export interface BubbleBoxOptionDataColor { 9 | class: string 10 | style: string 11 | } 12 | 13 | export type BubbleBoxOptionData = BubbleBoxOptionItemData[] 14 | -------------------------------------------------------------------------------- /components/button/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Button from './src/button.vue' 3 | 4 | export const TnButton = withNoopInstall(Button) 5 | export default TnButton 6 | 7 | export * from './src/button' 8 | export type { TnButtonInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/button/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './button-custom' 2 | export * from './use-button' 3 | -------------------------------------------------------------------------------- /components/button/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Button from './button.vue' 2 | 3 | export type TnButtonInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/calendar/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Calendar from './src/calendar.vue' 3 | 4 | export const TnCalendar = withNoopInstall(Calendar) 5 | export default TnCalendar 6 | 7 | export * from './src/calendar' 8 | export type { TnCalendarInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/calendar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './calendar-custom' 2 | export * from './use-calendar' 3 | -------------------------------------------------------------------------------- /components/calendar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Calendar from './calendar.vue' 2 | 3 | export type TnCalendarInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/checkbox/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Checkbox from './src/checkbox.vue' 3 | import CheckboxGroup from './src/checkbox-group.vue' 4 | 5 | export const TnCheckbox = withInstall(Checkbox, { 6 | CheckboxGroup, 7 | }) 8 | export default TnCheckbox 9 | export const TnCheckboxGroup = withNoopInstall(CheckboxGroup) 10 | 11 | export * from './src/checkbox' 12 | export * from './src/checkbox-group' 13 | export type { CheckboxInstance, CheckboxGroupInstance } from './src/instance' 14 | -------------------------------------------------------------------------------- /components/checkbox/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-checkbox-common-props' 2 | export * from './use-checkbox' 3 | export * from './use-checkbox-group' 4 | export * from './checkbox-custom' 5 | -------------------------------------------------------------------------------- /components/checkbox/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Checkbox from './checkbox.vue' 2 | import type CheckboxGroup from './checkbox-group.vue' 3 | 4 | export type CheckboxInstance = InstanceType 5 | export type CheckboxGroupInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/circle-progress/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import circleProgress from './src/circle-progress.vue' 3 | 4 | export const TnCircleProgress = withNoopInstall(circleProgress) 5 | export default TnCircleProgress 6 | 7 | export * from './src/circle-progress' 8 | export type { TnCircleProgressInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/circle-progress/src/circle-progress.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../utils' 2 | import { propgressBaseProps } from '../../base/common-props/progress' 3 | 4 | import type { ExtractPropTypes } from 'vue' 5 | 6 | export const circleProgressProps = buildProps({ 7 | ...propgressBaseProps, 8 | /** 9 | * @description 圆环的半径,单位 px,只支持传递固定的值 10 | */ 11 | radius: { 12 | type: Number, 13 | default: 50, 14 | }, 15 | /** 16 | * @description 圆环的宽度,单位 px,只支持传递固定的值 17 | */ 18 | ringWidth: { 19 | type: Number, 20 | default: 7, 21 | }, 22 | }) 23 | 24 | export type CircleProgressProps = ExtractPropTypes 25 | -------------------------------------------------------------------------------- /components/circle-progress/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-circle-progress' 2 | -------------------------------------------------------------------------------- /components/circle-progress/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type CircleProgress from './circle-progress.vue' 2 | 3 | export type TnCircleProgressInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/collapse/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Collapse from './src/collapse.vue' 3 | import CollapseItem from './src/collapse-item.vue' 4 | 5 | export const TnCollapse = withInstall(Collapse, { 6 | CollapseItem, 7 | }) 8 | export default TnCollapse 9 | export const TnCollapseItem = withNoopInstall(CollapseItem) 10 | 11 | export * from './src/collapse' 12 | export * from './src/collapse-item' 13 | 14 | export type { TnCollapseInstance, TnCollapseItemInstance } from './src/instance' 15 | -------------------------------------------------------------------------------- /components/collapse/src/collapse-item.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../utils' 2 | 3 | import type { ExtractPropTypes } from 'vue' 4 | 5 | export const collapseItemProps = buildProps({ 6 | /** 7 | * @description CollapseItem标题 8 | */ 9 | title: String, 10 | /** 11 | * @description CollapseItem是否禁用 12 | */ 13 | disabled: Boolean, 14 | }) 15 | 16 | export type CollapseItemProps = ExtractPropTypes 17 | -------------------------------------------------------------------------------- /components/collapse/src/collapse.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /components/collapse/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './collapse-item-custom' 2 | export * from './use-collapse' 3 | export * from './use-collapse-item' 4 | -------------------------------------------------------------------------------- /components/collapse/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Collapse from './collapse.vue' 2 | import type CollapseItem from './collapse-item.vue' 3 | 4 | export type TnCollapseInstance = InstanceType 5 | export type TnCollapseItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/count-down/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import CountDown from './src/count-down.vue' 3 | 4 | export const TnCountDown = withNoopInstall(CountDown) 5 | export default TnCountDown 6 | 7 | export * from './src/count-down' 8 | export type { TnCountDownInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/count-down/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './count-down-custom' 2 | export * from './count-down-separator-data' 3 | export * from './use-count-down' 4 | -------------------------------------------------------------------------------- /components/count-down/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type CountDown from './count-down.vue' 2 | 3 | export type TnCountDownInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/count-scroll/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import CountScroll from './src/count-scroll.vue' 3 | 4 | export const TnCountScroll = withNoopInstall(CountScroll) 5 | export default TnCountScroll 6 | 7 | export type { TnCountScrollInstance } from './src/instance' 8 | -------------------------------------------------------------------------------- /components/count-scroll/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './count-scroll-custom' 2 | export * from './use-count-scroll' 3 | -------------------------------------------------------------------------------- /components/count-scroll/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type CountScroll from './count-scroll.vue' 2 | 3 | export type TnCountScrollInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/count-to/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import CountTo from './src/count-to.vue' 3 | 4 | export const TnCountTo = withNoopInstall(CountTo) 5 | export default TnCountTo 6 | 7 | export type { TnCountToInstance } from './src/instance' 8 | -------------------------------------------------------------------------------- /components/count-to/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './count-to-custom' 2 | export * from './use-count-to' 3 | -------------------------------------------------------------------------------- /components/count-to/src/count-to.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /components/count-to/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type CountTo from './count-to.vue' 2 | 3 | export type TnCountToInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/date-time-picker/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import DateTimePicker from './src/date-time-picker.vue' 3 | 4 | export const TnDateTimePicker = withNoopInstall(DateTimePicker) 5 | export default TnDateTimePicker 6 | 7 | export * from './src/date-time-picker' 8 | export type { TnDateTimePickerInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/date-time-picker/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-date-time-picker' 2 | -------------------------------------------------------------------------------- /components/date-time-picker/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type DateTimePicker from './date-time-picker.vue' 2 | 3 | export type TnDateTimePickerInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/date-time-picker/src/types.ts: -------------------------------------------------------------------------------- 1 | // date-time-picker内部统一时间格式 2 | export const innerDefaultDateTimeFormat = 'YYYY/MM/DD HH:mm:ss' 3 | -------------------------------------------------------------------------------- /components/empty/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Empty from './src/empty.vue' 3 | 4 | export const TnEmpty = withNoopInstall(Empty) 5 | export default TnEmpty 6 | 7 | export * from './src/empty' 8 | export type { TnEmptyInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/empty/libs/default.ts: -------------------------------------------------------------------------------- 1 | import type { EmptyMode } from '../src/empty' 2 | 3 | export const emptyDefaultTips: Record = { 4 | cart: '购物车为空', 5 | page: '页面不存在', 6 | search: '搜索结果为空', 7 | address: '地址为空', 8 | network: '网络不通', 9 | order: '订单为空', 10 | coupon: '优惠券为空', 11 | favor: '暂无收藏', 12 | permission: '无权限', 13 | history: '历史记录为空', 14 | message: '暂无消息', 15 | list: '列表为空', 16 | data: '暂无数据', 17 | comment: '暂无评论', 18 | } 19 | -------------------------------------------------------------------------------- /components/empty/libs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './default' 2 | -------------------------------------------------------------------------------- /components/empty/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './empty-custom' 2 | -------------------------------------------------------------------------------- /components/empty/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Empty from './empty.vue' 2 | 3 | export type TnEmptyInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/footer/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Footer from './src/footer.vue' 3 | 4 | export const TnFooter = withNoopInstall(Footer) 5 | export default TnFooter 6 | 7 | export * from './src/footer' 8 | export type { TnFooterInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/footer/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './footer-custom' 2 | export * from './use-footer' 3 | -------------------------------------------------------------------------------- /components/footer/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Footer from './footer.vue' 2 | 3 | export type TnFooterInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/footer/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface FooterNavigatorItem { 2 | title: string 3 | url: string 4 | color: FooterNavigatorColor 5 | } 6 | 7 | export interface FooterNavigatorColor { 8 | class: string 9 | style: string 10 | } 11 | 12 | export type FooterNavigatorData = FooterNavigatorItem[] 13 | -------------------------------------------------------------------------------- /components/form/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Form from './src/form.vue' 3 | import FormItem from './src/form-item.vue' 4 | 5 | export const TnForm = withInstall(Form, { 6 | FormItem, 7 | }) 8 | export default TnForm 9 | export const TnFormItem = withNoopInstall(FormItem) 10 | 11 | export * from './src/form' 12 | export * from './src/form-item' 13 | export * from './src/types' 14 | 15 | export * from './src/composables' 16 | 17 | export type { TnFormInstance, TnFormItemInstance } from './src/instance' 18 | -------------------------------------------------------------------------------- /components/form/src/composables/form-custom.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | import { useNamespace } from '../../../../hooks' 3 | 4 | export const useFormCustomStyle = () => { 5 | const ns = useNamespace('form') 6 | 7 | const formClass = computed(() => { 8 | const cls: string[] = [ns.b()] 9 | return cls.join(' ') 10 | }) 11 | 12 | return { 13 | formClass, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/form/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './form-custom' 2 | export * from './form-item-custom' 3 | export * from './use-form-common-props' 4 | export * from './use-form-item' 5 | export * from './use-form-item-operation' 6 | export * from './use-form' 7 | -------------------------------------------------------------------------------- /components/form/src/composables/use-form-item.ts: -------------------------------------------------------------------------------- 1 | import { inject } from 'vue' 2 | import { formContextKey, formItemContextKey } from '../../../../tokens' 3 | 4 | export const useFormItem = () => { 5 | const form = inject(formContextKey, undefined) 6 | const formItem = inject(formItemContextKey, undefined) 7 | 8 | return { 9 | form, 10 | formItem, 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /components/form/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Form from './form.vue' 2 | import type FormItem from './form-item.vue' 3 | 4 | export type TnFormInstance = InstanceType 5 | export type TnFormItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/form/src/utils.ts: -------------------------------------------------------------------------------- 1 | import { castArray } from '../../../libs/lodash' 2 | 3 | import type { Arrayable } from '../../../utils' 4 | import type { FormItemContext } from './types' 5 | import type { FormItemProp } from './form-item' 6 | 7 | export const filterFields = ( 8 | fields: FormItemContext[], 9 | props: Arrayable 10 | ) => { 11 | const normalized = castArray(props) 12 | return normalized.length > 0 13 | ? fields.filter((field) => field.prop && normalized.includes(field.prop)) 14 | : fields 15 | } 16 | -------------------------------------------------------------------------------- /components/icon/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Icon from './src/icon.vue' 3 | 4 | export const TnIcon = withNoopInstall(Icon) 5 | export default TnIcon 6 | 7 | export * from './src/icon' 8 | export type { IconInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/icon/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './icon-custom' 2 | -------------------------------------------------------------------------------- /components/icon/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Icon from './icon.vue' 2 | 3 | export type IconInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/image-upload/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import ImageUpload from './src/image-upload.vue' 3 | 4 | export const TnImageUpload = withNoopInstall(ImageUpload) 5 | export default TnImageUpload 6 | 7 | export * from './src/image-upload' 8 | export * from './src/types' 9 | export type { TnImageUploadInstance } from './src/instance' 10 | -------------------------------------------------------------------------------- /components/image-upload/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-image-upload' 2 | -------------------------------------------------------------------------------- /components/image-upload/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type ImageUpload from './image-upload.vue' 2 | 3 | export type TnImageUploadInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/image-upload/src/types.ts: -------------------------------------------------------------------------------- 1 | export type ImageUploadList = Array 2 | export interface ImageUploadListItem { 3 | url: string 4 | status: 'ready' | 'uploading' | 'done' | 'failed' 5 | progress: number 6 | uploadTask?: UniApp.UploadTask 7 | file?: ImageUploadFile 8 | } 9 | 10 | export type ImageUploadFile = UniApp.ChooseImageSuccessCallbackResultFile | File 11 | -------------------------------------------------------------------------------- /components/index-list/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import IndexList from './src/index-list.vue' 3 | 4 | export const TnIndexList = withNoopInstall(IndexList) 5 | export default TnIndexList 6 | 7 | export * from './src/index-list' 8 | export type { TnIndexListInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/index-list/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './index-list-custom' 2 | export * from './use-index-list' 3 | -------------------------------------------------------------------------------- /components/index-list/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type IndexList from './index-list.vue' 2 | 3 | export type TnIndexListInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/index-list/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface IndexListDataItem { 2 | key: string 3 | title: string 4 | data: any[] 5 | } 6 | 7 | export type IndexListData = IndexListDataItem[] 8 | 9 | export interface KeyListRectInfo { 10 | top: number 11 | height: number 12 | } 13 | -------------------------------------------------------------------------------- /components/input/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall } from '../../utils' 2 | import Input from './src/input.vue' 3 | 4 | export const TnInput = withInstall(Input) 5 | export default TnInput 6 | 7 | export * from './src/input' 8 | 9 | export type { TnInputInstance } from './src/instance' 10 | -------------------------------------------------------------------------------- /components/input/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './input-custom' 2 | export * from './use-input' 3 | -------------------------------------------------------------------------------- /components/input/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type TnInput from './input.vue' 2 | 3 | export type TnInputInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/keyboard/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import keyboard from './src/keyboard.vue' 3 | 4 | export const TnKeyboard = withNoopInstall(keyboard) 5 | export default TnKeyboard 6 | 7 | export * from './src/keyboard' 8 | export type { TnKeyboardInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/keyboard/libs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './car-keyboard-data' 2 | -------------------------------------------------------------------------------- /components/keyboard/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-keyboard-data' 2 | export * from './use-keyboard' 3 | -------------------------------------------------------------------------------- /components/keyboard/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Keyboard from './keyboard.vue' 2 | 3 | export type TnKeyboardInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/lazy-load/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import LazyLoad from './src/lazy-load.vue' 3 | 4 | export const TnLazyLoad = withNoopInstall(LazyLoad) 5 | export default TnLazyLoad 6 | 7 | export * from './src/lazy-load' 8 | export type { TnLazyLoadInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/lazy-load/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lazy-load-custom' 2 | export * from './use-lazy-load' 3 | -------------------------------------------------------------------------------- /components/lazy-load/src/composables/lazy-load-custom.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | import { useNamespace } from '../../../../hooks' 3 | import { formatDomSizeValue } from '../../../../utils' 4 | 5 | import type { CSSProperties } from 'vue' 6 | import type { LazyLoadProps } from '../lazy-load' 7 | 8 | export const useLazyLoadCustomStyle = (props: LazyLoadProps) => { 9 | const ns = useNamespace('lazy-load') 10 | 11 | // lazyLoad的样式 12 | const lazyLoadStyle = computed(() => { 13 | const style: CSSProperties = {} 14 | 15 | // 设置宽高 16 | if (props.width) style.width = formatDomSizeValue(props.width) 17 | if (props.height) style.height = formatDomSizeValue(props.height) 18 | 19 | return style 20 | }) 21 | 22 | return { 23 | ns, 24 | lazyLoadStyle, 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /components/lazy-load/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type LazyLoad from './lazy-load.vue' 2 | 3 | export type TnLazyLoadInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/lazy-load/src/types.ts: -------------------------------------------------------------------------------- 1 | export type LazyLoadStatus = 'waiting' | 'loading' | 'loaded' | 'error' 2 | -------------------------------------------------------------------------------- /components/line-progress/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import lineProgress from './src/line-progress.vue' 3 | 4 | export const TnLineProgress = withNoopInstall(lineProgress) 5 | export default TnLineProgress 6 | 7 | export * from './src/line-progress' 8 | export type { TnLineProgressInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/line-progress/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './line-progress-custom' 2 | -------------------------------------------------------------------------------- /components/line-progress/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type LineProgress from './line-progress.vue' 2 | 3 | export type TnLineProgressInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/line-progress/src/line-progress.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../utils' 2 | import { propgressBaseProps } from '../../base/common-props/progress' 3 | 4 | import type { ExtractPropTypes } from 'vue' 5 | 6 | export const lineProgressProps = buildProps({ 7 | ...propgressBaseProps, 8 | /** 9 | * @description 进度条高度 10 | */ 11 | height: { 12 | type: [String, Number], 13 | default: 20, 14 | }, 15 | /** 16 | * @description 是否显示条纹 17 | */ 18 | stripe: Boolean, 19 | /** 20 | * @description 条纹是否有动画 21 | */ 22 | stripeAnimated: { 23 | type: Boolean, 24 | default: true, 25 | }, 26 | }) 27 | 28 | export type LineProgressProps = ExtractPropTypes 29 | -------------------------------------------------------------------------------- /components/list/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import ListItem from './src/list-item.vue' 3 | 4 | export const TnListItem = withNoopInstall(ListItem) 5 | export default TnListItem 6 | 7 | export * from './src/list-item' 8 | export type { TnListItemInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/list/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './list-item-custom' 2 | -------------------------------------------------------------------------------- /components/list/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type List from './list-item.vue' 2 | 3 | export type TnListItemInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/loading/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | 3 | import Loading from './src/loading.vue' 4 | 5 | export const TnLoading = withNoopInstall(Loading) 6 | export default TnLoading 7 | 8 | export * from './src/loading' 9 | export type { LoadingInstance } from './src/instance' 10 | -------------------------------------------------------------------------------- /components/loading/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './loading-custom' 2 | -------------------------------------------------------------------------------- /components/loading/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Loading from './loading.vue' 2 | 3 | export type LoadingInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/loadmore/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Loadmore from './src/loadmore.vue' 3 | 4 | export const TnLoadmore = withNoopInstall(Loadmore) 5 | export default TnLoadmore 6 | 7 | export * from './src/loadmore' 8 | export type { TnLoadmoreInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/loadmore/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './loadmore-custom' 2 | -------------------------------------------------------------------------------- /components/loadmore/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Loadmore from './loadmore.vue' 2 | 3 | export type TnLoadmoreInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/modal/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Modal from './src/modal.vue' 3 | 4 | export const TnModal = withNoopInstall(Modal) 5 | export default TnModal 6 | 7 | export * from './src/modal' 8 | export type { TnModalInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/modal/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './modal-custom' 2 | export * from './use-modal' 3 | -------------------------------------------------------------------------------- /components/modal/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Modal from './modal.vue' 2 | 3 | export type TnModalInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/navbar/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Navbar from './src/navbar.vue' 3 | 4 | export const TnNavbar = withNoopInstall(Navbar) 5 | export default TnNavbar 6 | 7 | export * from './src/navbar' 8 | export type { TnNavbarInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/navbar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './navbar-custom' 2 | export * from './use-navbar' 3 | -------------------------------------------------------------------------------- /components/navbar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Navbar from './navbar.vue' 2 | 3 | export type TnNavbarInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/navbar/src/types.ts: -------------------------------------------------------------------------------- 1 | export type NavbackButtonType = 'single' | 'multi' | 'text' | 'custom' | 'none' 2 | -------------------------------------------------------------------------------- /components/notice-bar/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import NoticeBar from './src/notice-bar.vue' 3 | 4 | export const TnNoticeBar = withNoopInstall(NoticeBar) 5 | export default TnNoticeBar 6 | 7 | export * from './src/notice-bar' 8 | export type { TnNoticeBarInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/notice-bar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './notice-bar-common-props' 2 | export * from './use-notice-bar' 3 | export * from './use-row-notice-bar' 4 | export * from './use-column-notice-bar' 5 | -------------------------------------------------------------------------------- /components/notice-bar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type NoticeBar from './notice-bar.vue' 2 | 3 | export type TnNoticeBarInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/notify/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Notify from './src/notify.vue' 3 | 4 | export const TnNotify = withNoopInstall(Notify) 5 | export default TnNotify 6 | 7 | export * from './src/notify' 8 | export type { TnNotifyInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/notify/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './notify-custom' 2 | export * from './use-notify' 3 | -------------------------------------------------------------------------------- /components/notify/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Notify from './notify.vue' 2 | 3 | export type TnNotifyInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/notify/src/notify.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 27 | 28 | 31 | -------------------------------------------------------------------------------- /components/number-box/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import NumberBox from './src/number-box.vue' 3 | 4 | export const TnNumberBox = withNoopInstall(NumberBox) 5 | export default TnNumberBox 6 | 7 | export * from './src/number-box' 8 | export type { TnNumberBoxInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/number-box/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './number-box-custom' 2 | export * from './use-number-box' 3 | -------------------------------------------------------------------------------- /components/number-box/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type NumberBox from './number-box.vue' 2 | 3 | export type TnNumberBoxInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/overlay/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Overlay from './src/overlay.vue' 3 | 4 | export const TnOverlay = withNoopInstall(Overlay) 5 | export default TnOverlay 6 | 7 | export * from './src/overlay' 8 | export type { TnOverlayInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/overlay/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-overlay' 2 | -------------------------------------------------------------------------------- /components/overlay/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Overlay from './overlay.vue' 2 | 3 | export type TnOverlayInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/overlay/src/overlay.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 22 | 23 | 26 | -------------------------------------------------------------------------------- /components/photo-album/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import PhotoAlbum from './src/photo-album.vue' 3 | 4 | export const TnPhotoAlbum = withNoopInstall(PhotoAlbum) 5 | export default TnPhotoAlbum 6 | 7 | export * from './src/photo-album' 8 | export type { TnPhotoAlbumInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/photo-album/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-photo-album' 2 | -------------------------------------------------------------------------------- /components/photo-album/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type PhotoAlbum from './photo-album.vue' 2 | 3 | export type TnPhotoAlbumInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/picker/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Picker from './src/picker.vue' 3 | 4 | export const TnPicker = withNoopInstall(Picker) 5 | export default TnPicker 6 | 7 | export * from './src/picker' 8 | export type { TnPickerInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/picker/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './picker-custom' 2 | export * from './use-picker' 3 | -------------------------------------------------------------------------------- /components/picker/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Picker from './picker.vue' 2 | 3 | export type TnPickerInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/popup/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Popup from './src/popup.vue' 3 | 4 | export const TnPopup = withNoopInstall(Popup) 5 | export default TnPopup 6 | 7 | export * from './src/popup' 8 | export type { TnPopupInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/popup/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './popup-custom' 2 | export * from './use-popup' 3 | -------------------------------------------------------------------------------- /components/popup/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Popup from './popup.vue' 2 | 3 | export type TnPopupInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/radio/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Radio from './src/radio.vue' 3 | import RadioGroup from './src/radio-group.vue' 4 | 5 | export const TnRadio = withInstall(Radio, { 6 | RadioGroup, 7 | }) 8 | export default TnRadio 9 | export const TnRadioGroup = withNoopInstall(RadioGroup) 10 | 11 | export * from './src/radio' 12 | export * from './src/radio-group' 13 | export type { RadioInstance, RadioGroupInstance } from './src/instance' 14 | -------------------------------------------------------------------------------- /components/radio/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-radio-common-props' 2 | export * from './radio-custom' 3 | export * from './use-radio' 4 | export * from './use-radio-group' 5 | -------------------------------------------------------------------------------- /components/radio/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Radio from './radio.vue' 2 | import type RadioGroup from './radio-group.vue' 3 | 4 | export type RadioInstance = InstanceType 5 | export type RadioGroupInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/rate/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Rate from './src/rate.vue' 3 | 4 | export const TnRate = withNoopInstall(Rate) 5 | export default TnRate 6 | 7 | export * from './src/rate' 8 | export type { TnRateInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/rate/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './rate-custom' 2 | export * from './use-rate' 3 | -------------------------------------------------------------------------------- /components/rate/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Rate from './rate.vue' 2 | 3 | export type TnRateInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/rate/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface RateItemData { 2 | active: RateItem 3 | inactive: RateItem 4 | } 5 | 6 | export interface RateItem { 7 | icon: string 8 | color: { 9 | class: string 10 | style: string 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /components/read-more/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import ReadMore from './src/read-more.vue' 3 | 4 | export const TnReadMore = withNoopInstall(ReadMore) 5 | export default TnReadMore 6 | 7 | export * from './src/read-more' 8 | export type { TnReadMoreInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/read-more/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './read-more-custom' 2 | export * from './use-read-more' 3 | -------------------------------------------------------------------------------- /components/read-more/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type ReadMore from './read-more.vue' 2 | 3 | export type TnReadMoreInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/region-picker/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import RegionPicker from './src/region-picker.vue' 3 | 4 | export const TnRegionPicker = withNoopInstall(RegionPicker) 5 | export default TnRegionPicker 6 | 7 | export * from './src/region-picker' 8 | export type { TnRegionPickerInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/region-picker/libs/index.ts: -------------------------------------------------------------------------------- 1 | export * from './types' 2 | -------------------------------------------------------------------------------- /components/region-picker/libs/types.ts: -------------------------------------------------------------------------------- 1 | export type RegionData = RegionDataItem[] 2 | export type RegionDataItem = { 3 | code: string 4 | name: string 5 | children?: RegionDataItem[] 6 | } 7 | -------------------------------------------------------------------------------- /components/region-picker/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-region-picker' 2 | -------------------------------------------------------------------------------- /components/region-picker/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type RegionPicker from './region-picker.vue' 2 | 3 | export type TnRegionPickerInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/scroll-list/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import ScrollList from './src/scroll-list.vue' 3 | 4 | export const TnScrollList = withNoopInstall(ScrollList) 5 | export default TnScrollList 6 | 7 | export * from './src/scroll-list' 8 | export type { TnScrollListInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/scroll-list/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './scroll-list-custom' 2 | export * from './use-scroll-list' 3 | -------------------------------------------------------------------------------- /components/scroll-list/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type ScrollList from './scroll-list.vue' 2 | 3 | export type TnScrollListInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/search-box/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import SearchBox from './src/search-box.vue' 3 | 4 | export const TnSearchBox = withNoopInstall(SearchBox) 5 | export default TnSearchBox 6 | 7 | export * from './src/search-box' 8 | export type { TnSearchBoxInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/search-box/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './search-box-custom' 2 | export * from './use-search-box' 3 | -------------------------------------------------------------------------------- /components/search-box/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type SearchBox from './search-box.vue' 2 | 3 | export type TnSearchBoxInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/slider/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Slider from './src/slider.vue' 3 | 4 | export const TnSlider = withNoopInstall(Slider) 5 | export default TnSlider 6 | 7 | export * from './src/slider' 8 | export type { TnSliderInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/slider/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-slider-common-porps' 2 | export * from './use-slider-node-info' 3 | export * from './slider-custom' 4 | export * from './use-slider' 5 | -------------------------------------------------------------------------------- /components/slider/src/composables/use-slider-common-porps.ts: -------------------------------------------------------------------------------- 1 | import { useFormDisabled, useFormSize } from '../../../form' 2 | 3 | import type { SliderProps } from '../slider' 4 | 5 | export const useSliderCommonProps = (props: SliderProps) => { 6 | // 滑动条的尺寸 7 | const size = useFormSize(props.size) 8 | 9 | // 滑动条是否禁用 10 | const disabled = useFormDisabled(props.disabled) 11 | 12 | return { 13 | size, 14 | disabled, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/slider/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Slider from './slider.vue' 2 | 3 | export type TnSliderInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/steps/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Steps from './src/steps.vue' 3 | import StepsItem from './src/steps-item.vue' 4 | 5 | export const TnSteps = withInstall(Steps, { 6 | StepsItem, 7 | }) 8 | export const TnStepsItem = withNoopInstall(StepsItem) 9 | export default TnSteps 10 | 11 | export * from './src/steps' 12 | export * from './src/steps-item' 13 | export * from './src/types' 14 | 15 | export type { TnStepsInstance, TnStepsItemInstance } from './src/instance' 16 | -------------------------------------------------------------------------------- /components/steps/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './steps-custom' 2 | export * from './step-custom' 3 | export * from './use-steps' 4 | export * from './use-step' 5 | -------------------------------------------------------------------------------- /components/steps/src/composables/steps-custom.ts: -------------------------------------------------------------------------------- 1 | import { useNamespace } from '../../../../hooks' 2 | 3 | export const useStepsCustomStyle = () => { 4 | const ns = useNamespace('steps') 5 | 6 | return { 7 | ns, 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /components/steps/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Stpes from './steps.vue' 2 | import type StepsItem from './steps-item.vue' 3 | 4 | export type TnStepsInstance = InstanceType 5 | export type TnStepsItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/steps/src/steps-item.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../utils' 2 | import { stepsBaseProps } from '../../base/common-props/steps' 3 | 4 | import type { ExtractPropTypes } from 'vue' 5 | 6 | export const stepProps = buildProps({ 7 | ...stepsBaseProps, 8 | /** 9 | * @description 标题 10 | */ 11 | title: String, 12 | /** 13 | * @description 默认的图标 14 | */ 15 | icon: String, 16 | /** 17 | * @description 激活时的图标 18 | */ 19 | activeIcon: String, 20 | }) 21 | 22 | export const stepEmits = { 23 | /** 24 | * @description 点击事件 25 | */ 26 | click: () => true, 27 | } 28 | 29 | export type StepProps = ExtractPropTypes 30 | export type StepEmits = typeof stepEmits 31 | -------------------------------------------------------------------------------- /components/steps/src/steps.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 17 | 18 | 21 | -------------------------------------------------------------------------------- /components/steps/src/types.ts: -------------------------------------------------------------------------------- 1 | export type StepRectInfo = { 2 | width: number 3 | height: number 4 | left: number 5 | } 6 | -------------------------------------------------------------------------------- /components/sticky/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Sticky from './src/sticky.vue' 3 | 4 | export const TnSticky = withNoopInstall(Sticky) 5 | export default TnSticky 6 | 7 | export * from './src/sticky' 8 | export type { TnStickyInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/sticky/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './sticky-custom' 2 | export * from './use-sticky' 3 | -------------------------------------------------------------------------------- /components/sticky/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Sticky from './sticky.vue' 2 | 3 | export type TnStickyInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/sticky/src/types.ts: -------------------------------------------------------------------------------- 1 | export type StickyRectInfo = { 2 | width: string | number 3 | height: string | number 4 | left: number 5 | } 6 | -------------------------------------------------------------------------------- /components/subsection/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Subsection from './src/subsection.vue' 3 | import SubsectionItem from './src/subsection-item.vue' 4 | 5 | export const TnSubsection = withInstall(Subsection, { 6 | SubsectionItem, 7 | }) 8 | export default TnSubsection 9 | export const TnSubsectionItem = withNoopInstall(SubsectionItem) 10 | 11 | export * from './src/subsection' 12 | export * from './src/subsection-item' 13 | export * from './src/types' 14 | export type { 15 | TnSubsectionInstance, 16 | TnSubsectionItemInstance, 17 | } from './src/instance' 18 | -------------------------------------------------------------------------------- /components/subsection/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './subsection-custom' 2 | export * from './subsection-item-custom' 3 | export * from './use-subsection' 4 | export * from './use-subsection-item' 5 | -------------------------------------------------------------------------------- /components/subsection/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Subsection from './subsection.vue' 2 | import type SubsectionItem from './subsection-item.vue' 3 | 4 | export type TnSubsectionInstance = InstanceType 5 | export type TnSubsectionItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/subsection/src/subsection-item.ts: -------------------------------------------------------------------------------- 1 | import { buildProps, isString } from '../../../utils' 2 | import { subsectionBaseProps } from '../../base/common-props/subsection' 3 | 4 | import type { ExtractPropTypes } from 'vue' 5 | 6 | export const subsectionItemProps = buildProps({ 7 | ...subsectionBaseProps, 8 | /** 9 | * @description 标题 10 | */ 11 | title: String, 12 | }) 13 | 14 | export const subsectionItemEmits = { 15 | /** 16 | * @description 点击事件 17 | */ 18 | click: (title: string) => isString(title), 19 | } 20 | 21 | export type SubsectionItemProps = ExtractPropTypes 22 | export type SubsectionItemEmits = typeof subsectionItemEmits 23 | -------------------------------------------------------------------------------- /components/subsection/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface SubsectionItemRect { 2 | left: number 3 | width: number 4 | } 5 | 6 | export type SubsectionSliderRect = SubsectionItemRect 7 | -------------------------------------------------------------------------------- /components/swipe-action/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import SwipeAction from './src/swipe-action.vue' 3 | import SwipeActionItem from './src/swipe-action-item.vue' 4 | 5 | export const TnSwipeAction = withInstall(SwipeAction, { 6 | SwipeActionItem, 7 | }) 8 | export default TnSwipeAction 9 | export const TnSwipeActionItem = withNoopInstall(SwipeActionItem) 10 | 11 | export * from './src/swipe-action' 12 | export * from './src/swipe-action-item' 13 | 14 | export type { 15 | TnSwipeActionInstance, 16 | TnSwipeActionItemInstance, 17 | } from './src/instance' 18 | -------------------------------------------------------------------------------- /components/swipe-action/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-swipe-action' 2 | export * from './swipe-action-options' 3 | export * from './use-swipe-action-item' 4 | -------------------------------------------------------------------------------- /components/swipe-action/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type SwipeAction from './swipe-action.vue' 2 | import type SwipeActionItem from './swipe-action-item.vue' 3 | 4 | export type TnSwipeActionInstance = InstanceType 5 | export type TnSwipeActionItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/swipe-action/src/swipe-action.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 19 | 20 | 23 | -------------------------------------------------------------------------------- /components/swiper/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Swiper from './src/swiper.vue' 3 | 4 | export const TnSwiper = withNoopInstall(Swiper) 5 | export default TnSwiper 6 | 7 | export * from './src/swiper' 8 | 9 | export type { TnSwiperInstance } from './src/instance' 10 | -------------------------------------------------------------------------------- /components/swiper/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './swiper-custom' 2 | export * from './use-swiper' 3 | -------------------------------------------------------------------------------- /components/swiper/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Swiper from './swiper.vue' 2 | 3 | export type TnSwiperInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/switch-tab/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import SwitchTab from './src/switch-tab.vue' 3 | 4 | export const TnSwitchTab = withNoopInstall(SwitchTab) 5 | export default TnSwitchTab 6 | 7 | export * from './src/switch-tab' 8 | export type { TnSwitchTabInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/switch-tab/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './switch-tab-custom' 2 | export * from './use-switch-tab' 3 | -------------------------------------------------------------------------------- /components/switch-tab/src/composables/use-switch-tab.ts: -------------------------------------------------------------------------------- 1 | import { nextTick } from 'vue' 2 | import type { SetupContext } from 'vue' 3 | import type { SwitchTabEmits, SwitchTabProps } from '../switch-tab' 4 | 5 | export const useSwitchTab = ( 6 | props: SwitchTabProps, 7 | emits: SetupContext['emit'] 8 | ) => { 9 | // 点击切换标签 10 | const tabClickEvent = (index: number) => { 11 | if (props.disabled) return 12 | emits('update:modelValue', index) 13 | nextTick(() => { 14 | emits('change', index) 15 | }) 16 | } 17 | 18 | return { 19 | tabClickEvent, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /components/switch-tab/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type SwitchTab from './switch-tab.vue' 2 | 3 | export type TnSwitchTabInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/switch/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Switch from './src/switch.vue' 3 | 4 | export const TnSwitch = withNoopInstall(Switch) 5 | export default TnSwitch 6 | 7 | export * from './src/switch' 8 | export type { TnSwitchInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/switch/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './switch-custom' 2 | export * from './use-switch-common-props' 3 | export * from './use-switch' 4 | -------------------------------------------------------------------------------- /components/switch/src/composables/use-switch-common-props.ts: -------------------------------------------------------------------------------- 1 | import { useFormDisabled, useFormSize } from '../../../form' 2 | import type { SwitchProps } from '../switch' 3 | 4 | export const useSwitchCommonProps = (props: SwitchProps) => { 5 | // Switch开关的尺寸 6 | const size = useFormSize(props.size) 7 | 8 | // Switch开关是否禁用 9 | const disabled = useFormDisabled(props.disabled) 10 | 11 | return { 12 | size, 13 | disabled, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/switch/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Switch from './switch.vue' 2 | 3 | export type TnSwitchInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/tabbar/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Tabbar from './src/tabbar.vue' 3 | import TabbarItem from './src/tabbar-item.vue' 4 | 5 | export const TnTabbar = withInstall(Tabbar, { 6 | TabbarItem, 7 | }) 8 | export const TnTabbarItem = withNoopInstall(TabbarItem) 9 | export default TnTabbar 10 | 11 | export * from './src/tabbar' 12 | export * from './src/tabbar-item' 13 | export * from './src/types' 14 | export type { TnTabbarInstance, TnTabbarItemInstance } from './src/instance' 15 | -------------------------------------------------------------------------------- /components/tabbar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tabbar-custom' 2 | export * from './tabbar-item-custom' 3 | export * from './use-tabbar' 4 | export * from './use-tabbar-item' 5 | -------------------------------------------------------------------------------- /components/tabbar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Tabbar from './tabbar.vue' 2 | import type TabbarItem from './tabbar-item.vue' 3 | 4 | export type TnTabbarInstance = InstanceType 5 | export type TnTabbarItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/tabbar/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface TabbarItemRect { 2 | width: number 3 | height: number 4 | left: number 5 | maxWidth?: number 6 | } 7 | -------------------------------------------------------------------------------- /components/tabs/index.ts: -------------------------------------------------------------------------------- 1 | import { withInstall, withNoopInstall } from '../../utils' 2 | import Tabs from './src/tabs.vue' 3 | import TabsItem from './src/tabs-item.vue' 4 | 5 | export const TnTabs = withInstall(Tabs, { 6 | TabsItem, 7 | }) 8 | export const TnTabsItem = withNoopInstall(TabsItem) 9 | export default TnTabs 10 | 11 | export * from './src/tabs' 12 | export * from './src/tabs-item' 13 | export * from './src/types' 14 | 15 | export type { TnTabsInstance, TnTabsItemInstance } from './src/instance' 16 | -------------------------------------------------------------------------------- /components/tabs/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tabs-custom' 2 | export * from './tabs-item-custom' 3 | export * from './use-tabs-item' 4 | export * from './use-tabs' 5 | -------------------------------------------------------------------------------- /components/tabs/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Tabs from './tabs.vue' 2 | import type TabsItem from './tabs-item.vue' 3 | 4 | export type TnTabsInstance = InstanceType 5 | export type TnTabsItemInstance = InstanceType 6 | -------------------------------------------------------------------------------- /components/tabs/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface TabsItemRect { 2 | width: number 3 | height: number 4 | left: number 5 | } 6 | 7 | export type TabsRect = TabsItemRect 8 | export type TabsBarRect = TabsItemRect 9 | -------------------------------------------------------------------------------- /components/tag/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Tag from './src/tag.vue' 3 | 4 | export const TnTag = withNoopInstall(Tag) 5 | export default TnTag 6 | 7 | export * from './src/tag' 8 | export type { TnTagInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/tag/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './tag-custom' 2 | export * from './use-tag' 3 | -------------------------------------------------------------------------------- /components/tag/src/composables/use-tag.ts: -------------------------------------------------------------------------------- 1 | import type { SetupContext } from 'vue' 2 | import type { TagEmits, TagProps } from '../tag' 3 | 4 | export const useTag = ( 5 | props: TagProps, 6 | emits: SetupContext['emit'] 7 | ) => { 8 | // 标签点击事件 9 | const tagClickHandle = () => { 10 | emits('click') 11 | } 12 | return { 13 | tagClickHandle, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /components/tag/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Tag from './tag.vue' 2 | 3 | export type TnTagInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/tag/src/tag.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /components/title/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import Title from './src/title.vue' 3 | 4 | export const TnTitle = withNoopInstall(Title) 5 | export default TnTitle 6 | 7 | export * from './src/title' 8 | export type { TnTitleInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/title/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './title-custom' 2 | -------------------------------------------------------------------------------- /components/title/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type Title from './title.vue' 2 | 3 | export type TnTitleInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/water-fall/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import waterFall from './src/water-fall.vue' 3 | 4 | export const TnWaterFall = withNoopInstall(waterFall) 5 | export default TnWaterFall 6 | 7 | export * from './src/water-fall' 8 | export type { TnWaterFallInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/water-fall/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-water-fall' 2 | -------------------------------------------------------------------------------- /components/water-fall/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type WaterFall from './water-fall.vue' 2 | 3 | export type TnWaterFallInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/water-fall/src/water-fall.ts: -------------------------------------------------------------------------------- 1 | import { buildProps } from '../../../utils' 2 | 3 | import type { ExtractPropTypes } from 'vue' 4 | 5 | export const waterFallModes = ['normal', 'calc'] as const 6 | 7 | export const waterFallProps = buildProps({ 8 | /** 9 | * @description 列表数据 10 | */ 11 | data: { 12 | type: Array, 13 | default: () => [], 14 | }, 15 | /** 16 | * @description 瀑布流模式 17 | */ 18 | mode: { 19 | type: String, 20 | values: waterFallModes, 21 | default: 'normal', 22 | }, 23 | }) 24 | 25 | export type WaterFallProps = ExtractPropTypes 26 | 27 | export type WaterFallMode = (typeof waterFallModes)[number] 28 | -------------------------------------------------------------------------------- /components/week-calendar/index.ts: -------------------------------------------------------------------------------- 1 | import { withNoopInstall } from '../../utils' 2 | import WeekCalendar from './src/week-calendar.vue' 3 | 4 | export const TnWeekCalendar = withNoopInstall(WeekCalendar) 5 | export default TnWeekCalendar 6 | 7 | export * from './src/week-calendar' 8 | export type { TnWeekCalendarInstance } from './src/instance' 9 | -------------------------------------------------------------------------------- /components/week-calendar/src/composables/index.ts: -------------------------------------------------------------------------------- 1 | export * from './week-calendar-custom' 2 | export * from './use-week-calendar' 3 | -------------------------------------------------------------------------------- /components/week-calendar/src/instance.ts: -------------------------------------------------------------------------------- 1 | import type WeekCalendar from './week-calendar.vue' 2 | 3 | export type TnWeekCalendarInstance = InstanceType 4 | -------------------------------------------------------------------------------- /components/week-calendar/src/types.ts: -------------------------------------------------------------------------------- 1 | export type WeekCalanderDateStatus = 'active' | 'normal' | 'disabled' 2 | 3 | export type WeekCalendarData = Array> 4 | 5 | export interface WeekCalendarItem { 6 | date: number 7 | status: WeekCalanderDateStatus 8 | desc?: string 9 | } 10 | -------------------------------------------------------------------------------- /constants/color.ts: -------------------------------------------------------------------------------- 1 | export const tuniaoColors = [ 2 | 'red', 3 | 'purplered', 4 | 'purple', 5 | 'bluepurple', 6 | 'aquablue', 7 | 'blue', 8 | 'indigo', 9 | 'cyan', 10 | 'teal', 11 | 'green', 12 | 'yellowgreen', 13 | 'lime', 14 | 'yellow', 15 | 'orangeyellow', 16 | 'orange', 17 | 'orangered', 18 | 'brown', 19 | 'grey', 20 | 'gray', 21 | ] as const 22 | export const tuniaoColorType = ['', 'dark', 'disabled', 'light'] as const 23 | export const tuniaoColorNames = ['bg', 'text', 'border', 'shadow'] as const 24 | 25 | export type TuniaoColor = (typeof tuniaoColors)[number] 26 | export type TuniaoColorType = (typeof tuniaoColorType)[number] 27 | export type TuniaoColorName = (typeof tuniaoColorNames)[number] 28 | -------------------------------------------------------------------------------- /constants/event.ts: -------------------------------------------------------------------------------- 1 | export const UPDATE_MODEL_EVENT = 'update:modelValue' 2 | export const CHANGE_EVENT = 'change' 3 | export const INPUT_EVENT = 'input' 4 | -------------------------------------------------------------------------------- /constants/img-mode.ts: -------------------------------------------------------------------------------- 1 | export const componentImgModes = [ 2 | 'scaleToFill', 3 | 'aspectFit', 4 | 'aspectFill', 5 | 'widthFix', 6 | 'heightFix', 7 | 'top', 8 | 'bottom', 9 | 'center', 10 | 'left', 11 | 'right', 12 | 'top left', 13 | 'top right', 14 | 'bottom left', 15 | 'bottom right', 16 | ] as const 17 | 18 | export type ComponentImgMode = (typeof componentImgModes)[number] 19 | -------------------------------------------------------------------------------- /constants/index.ts: -------------------------------------------------------------------------------- 1 | export * from './size' 2 | export * from './shape' 3 | export * from './img-mode' 4 | export * from './types' 5 | export * from './color' 6 | export * from './key' 7 | export * from './event' 8 | export * from './z-index' 9 | -------------------------------------------------------------------------------- /constants/key.ts: -------------------------------------------------------------------------------- 1 | export const INSTALLED_KEY = Symbol('INSTALLED_KEY') 2 | -------------------------------------------------------------------------------- /constants/shape.ts: -------------------------------------------------------------------------------- 1 | export const componentShapes = ['', 'circle', 'round'] as const 2 | 3 | export type ComponentShape = (typeof componentShapes)[number] 4 | -------------------------------------------------------------------------------- /constants/size.ts: -------------------------------------------------------------------------------- 1 | export const componentSizes = ['', 'sm', 'lg', 'xl'] as const 2 | export const formComponentSizes = ['', 'sm', 'lg'] as const 3 | 4 | export type ComponentSize = (typeof componentSizes)[number] 5 | export type FormComponentSize = (typeof formComponentSizes)[number] 6 | -------------------------------------------------------------------------------- /constants/types.ts: -------------------------------------------------------------------------------- 1 | export const componentTypes = [ 2 | '', 3 | 'primary', 4 | 'success', 5 | 'warning', 6 | 'danger', 7 | 'info', 8 | ] as const 9 | 10 | export type ComponentType = (typeof componentTypes)[number] 11 | -------------------------------------------------------------------------------- /constants/z-index.ts: -------------------------------------------------------------------------------- 1 | export const ZIndex: Record = { 2 | /** navbar */ 3 | navbar: 20090, 4 | /** tabbar */ 5 | tabbar: 20090, 6 | /** modal弹框 */ 7 | modal: 20076, 8 | /** popup 弹出层 */ 9 | popup: 20075, 10 | /** notify */ 11 | notify: 20074, 12 | /** 吸顶 */ 13 | sticky: 10030, 14 | /** 气泡弹框 */ 15 | bubble: 10020, 16 | /** mask 遮罩 */ 17 | mask: 9999, 18 | } 19 | -------------------------------------------------------------------------------- /hooks/index.ts: -------------------------------------------------------------------------------- 1 | export * from './use-namespace' 2 | export * from './use-component-color' 3 | export * from './use-component-size' 4 | export * from './use-prop' 5 | export * from './use-selector-query' 6 | export * from './use-toggle' 7 | export * from './use-touch' 8 | export * from './use-uniapp-system-rect-info' 9 | export * from './use-z-index' 10 | export * from './use-ordered-children' 11 | export * from './use-observer' 12 | export * from './use-long-press' 13 | -------------------------------------------------------------------------------- /hooks/use-component-size/index.ts: -------------------------------------------------------------------------------- 1 | import { computed } from 'vue' 2 | import { componentSizes } from '../../constants' 3 | 4 | export const componentSizeTypes = ['none', 'inner', 'custom'] as const 5 | export type ComponentSizeType = (typeof componentSizeTypes)[number] 6 | 7 | export const useComponentSize = (size?: string | number) => { 8 | // size类型,内置size类型还是设置的自定义size大小 9 | const sizeType = computed(() => { 10 | if (!size) return 'none' 11 | return componentSizes.includes(size as any) ? 'inner' : 'custom' 12 | }) 13 | 14 | return { 15 | sizeType, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /hooks/use-ordered-children/index.ts: -------------------------------------------------------------------------------- 1 | import { shallowRef } from 'vue' 2 | 3 | export const useOrderedChildren = () => { 4 | const children: Record = {} 5 | const orderedChildren = shallowRef([]) 6 | 7 | const addChild = (child: T) => { 8 | children[child.uid] = child 9 | orderedChildren.value.push(child) 10 | } 11 | const removeChild = (uid: number) => { 12 | delete children[uid] 13 | orderedChildren.value = orderedChildren.value.filter( 14 | (child) => child.uid !== uid 15 | ) 16 | } 17 | 18 | return { 19 | children: orderedChildren, 20 | addChild, 21 | removeChild, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /hooks/use-prop/index.ts: -------------------------------------------------------------------------------- 1 | import { computed, getCurrentInstance } from 'vue' 2 | import { isEmptyVariableInDefault } from '../../utils' 3 | import type { ComputedRef } from 'vue' 4 | 5 | export const useProp = (name: string): ComputedRef => { 6 | const vm = getCurrentInstance() 7 | return computed( 8 | () => isEmptyVariableInDefault(vm?.proxy?.$props as any)[name] 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /hooks/use-toggle/index.ts: -------------------------------------------------------------------------------- 1 | import { ref } from 'vue' 2 | import type { Ref } from 'vue' 3 | 4 | export const useToggle = (initState: boolean): [Ref, () => void] => { 5 | const state = ref(initState) 6 | const toggle = () => { 7 | state.value = !state.value 8 | } 9 | 10 | return [state, toggle] 11 | } 12 | -------------------------------------------------------------------------------- /index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/index' 2 | -------------------------------------------------------------------------------- /lib/defaults.ts: -------------------------------------------------------------------------------- 1 | import { makeInstaller } from './make-installer' 2 | import Components from './component' 3 | 4 | export default makeInstaller([...Components]) 5 | -------------------------------------------------------------------------------- /lib/index.ts: -------------------------------------------------------------------------------- 1 | import installer from './defaults' 2 | export * from '../components' 3 | export * from '../constants' 4 | export * from '../hooks' 5 | export * from './make-installer' 6 | 7 | export const install = installer.install 8 | export default installer 9 | -------------------------------------------------------------------------------- /lib/make-installer.ts: -------------------------------------------------------------------------------- 1 | import { INSTALLED_KEY } from '../constants' 2 | 3 | import type { App, Plugin } from '@vue/runtime-core' 4 | 5 | export const makeInstaller = (components: Plugin[] = []) => { 6 | const install = (app: App) => { 7 | if (app[INSTALLED_KEY]) return 8 | 9 | app[INSTALLED_KEY] = true 10 | components.forEach((c) => app.use(c)) 11 | } 12 | return { 13 | install, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /libs/async-validator/rule/enum.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteRule } from '../interface'; 2 | import { format } from '../util'; 3 | 4 | const ENUM = 'enum' as const; 5 | 6 | const enumerable: ExecuteRule = (rule, value, source, errors, options) => { 7 | rule[ENUM] = Array.isArray(rule[ENUM]) ? rule[ENUM] : []; 8 | if (rule[ENUM].indexOf(value) === -1) { 9 | errors.push( 10 | format(options.messages[ENUM], rule.fullField, rule[ENUM].join(', ')), 11 | ); 12 | } 13 | }; 14 | 15 | export default enumerable; 16 | -------------------------------------------------------------------------------- /libs/async-validator/rule/index.ts: -------------------------------------------------------------------------------- 1 | import required from './required'; 2 | import whitespace from './whitespace'; 3 | import type from './type'; 4 | import range from './range'; 5 | import enumRule from './enum'; 6 | import pattern from './pattern'; 7 | 8 | export default { 9 | required, 10 | whitespace, 11 | type, 12 | range, 13 | enum: enumRule, 14 | pattern, 15 | }; 16 | -------------------------------------------------------------------------------- /libs/async-validator/rule/required.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteRule } from '../interface'; 2 | import { format, isEmptyValue } from '../util'; 3 | 4 | const required: ExecuteRule = (rule, value, source, errors, options, type) => { 5 | if ( 6 | rule.required && 7 | (!source.hasOwnProperty(rule.field) || 8 | isEmptyValue(value, type || rule.type)) 9 | ) { 10 | errors.push(format(options.messages.required, rule.fullField)); 11 | } 12 | }; 13 | 14 | export default required; 15 | -------------------------------------------------------------------------------- /libs/async-validator/rule/whitespace.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteRule } from '../interface'; 2 | import { format } from '../util'; 3 | 4 | /** 5 | * Rule for validating whitespace. 6 | * 7 | * @param rule The validation rule. 8 | * @param value The value of the field on the source object. 9 | * @param source The source object being validated. 10 | * @param errors An array of errors that this rule may add 11 | * validation errors to. 12 | * @param options The validation options. 13 | * @param options.messages The validation messages. 14 | */ 15 | const whitespace: ExecuteRule = (rule, value, source, errors, options) => { 16 | if (/^\s+$/.test(value) || value === '') { 17 | errors.push(format(options.messages.whitespace, rule.fullField)); 18 | } 19 | }; 20 | 21 | export default whitespace; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/any.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const any: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | } 15 | callback(errors); 16 | }; 17 | 18 | export default any; 19 | -------------------------------------------------------------------------------- /libs/async-validator/validator/array.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule/index'; 3 | 4 | const array: ExecuteValidator = (rule, value, callback, source, options) => { 5 | const errors: string[] = []; 6 | const validate = 7 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 8 | if (validate) { 9 | if ((value === undefined || value === null) && !rule.required) { 10 | return callback(); 11 | } 12 | rules.required(rule, value, source, errors, options, 'array'); 13 | if (value !== undefined && value !== null) { 14 | rules.type(rule, value, source, errors, options); 15 | rules.range(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default array; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/boolean.ts: -------------------------------------------------------------------------------- 1 | import { isEmptyValue } from '../util'; 2 | import rules from '../rule'; 3 | import type { ExecuteValidator } from '../interface'; 4 | 5 | const boolean: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (value !== undefined) { 15 | rules.type(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default boolean; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/enum.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const ENUM = 'enum' as const; 6 | 7 | const enumerable: ExecuteValidator = ( 8 | rule, 9 | value, 10 | callback, 11 | source, 12 | options, 13 | ) => { 14 | const errors: string[] = []; 15 | const validate = 16 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 17 | if (validate) { 18 | if (isEmptyValue(value) && !rule.required) { 19 | return callback(); 20 | } 21 | rules.required(rule, value, source, errors, options); 22 | if (value !== undefined) { 23 | rules[ENUM](rule, value, source, errors, options); 24 | } 25 | } 26 | callback(errors); 27 | }; 28 | 29 | export default enumerable; 30 | -------------------------------------------------------------------------------- /libs/async-validator/validator/float.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const floatFn: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (value !== undefined) { 15 | rules.type(rule, value, source, errors, options); 16 | rules.range(rule, value, source, errors, options); 17 | } 18 | } 19 | callback(errors); 20 | }; 21 | 22 | export default floatFn; 23 | -------------------------------------------------------------------------------- /libs/async-validator/validator/integer.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const integer: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (value !== undefined) { 15 | rules.type(rule, value, source, errors, options); 16 | rules.range(rule, value, source, errors, options); 17 | } 18 | } 19 | callback(errors); 20 | }; 21 | 22 | export default integer; 23 | -------------------------------------------------------------------------------- /libs/async-validator/validator/method.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const method: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (value !== undefined) { 15 | rules.type(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default method; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/object.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const object: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (value !== undefined) { 15 | rules.type(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default object; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/pattern.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const pattern: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value, 'string') && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (!isEmptyValue(value, 'string')) { 15 | rules.pattern(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default pattern; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/regexp.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const regexp: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const errors: string[] = []; 7 | const validate = 8 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 9 | if (validate) { 10 | if (isEmptyValue(value) && !rule.required) { 11 | return callback(); 12 | } 13 | rules.required(rule, value, source, errors, options); 14 | if (!isEmptyValue(value)) { 15 | rules.type(rule, value, source, errors, options); 16 | } 17 | } 18 | callback(errors); 19 | }; 20 | 21 | export default regexp; 22 | -------------------------------------------------------------------------------- /libs/async-validator/validator/required.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | 4 | const required: ExecuteValidator = (rule, value, callback, source, options) => { 5 | const errors: string[] = []; 6 | const type = Array.isArray(value) ? 'array' : typeof value; 7 | rules.required(rule, value, source, errors, options, type); 8 | callback(errors); 9 | }; 10 | 11 | export default required; 12 | -------------------------------------------------------------------------------- /libs/async-validator/validator/type.ts: -------------------------------------------------------------------------------- 1 | import type { ExecuteValidator } from '../interface'; 2 | import rules from '../rule'; 3 | import { isEmptyValue } from '../util'; 4 | 5 | const type: ExecuteValidator = (rule, value, callback, source, options) => { 6 | const ruleType = rule.type; 7 | const errors: string[] = []; 8 | const validate = 9 | rule.required || (!rule.required && source.hasOwnProperty(rule.field)); 10 | if (validate) { 11 | if (isEmptyValue(value, ruleType) && !rule.required) { 12 | return callback(); 13 | } 14 | rules.required(rule, value, source, errors, options, ruleType); 15 | if (!isEmptyValue(value, ruleType)) { 16 | rules.type(rule, value, source, errors, options); 17 | } 18 | } 19 | callback(errors); 20 | }; 21 | 22 | export default type; 23 | -------------------------------------------------------------------------------- /libs/dayjs/locale/en.js: -------------------------------------------------------------------------------- 1 | // English [en] 2 | // We don't need weekdaysShort, weekdaysMin, monthsShort in en.js locale 3 | export default { 4 | name: 'en', 5 | weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), 6 | months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), 7 | ordinal: function ordinal(n) { 8 | var s = ['th', 'st', 'nd', 'rd']; 9 | var v = n % 100; 10 | return "[" + n + (s[(v - 20) % 10] || s[v] || s[0]) + "]"; 11 | } 12 | }; -------------------------------------------------------------------------------- /libs/dayjs/locale/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module 'dayjs/esm/locale/*' { 4 | namespace locale { 5 | interface Locale extends ILocale {} 6 | } 7 | 8 | const locale: locale.Locale 9 | 10 | export = locale 11 | } 12 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/advancedFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/arraySupport/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare module 'dayjs/esm' { 4 | interface ConfigTypeMap { 5 | arraySupport: [number?, number?, number?, number?, number?, number?, number?] 6 | } 7 | } 8 | 9 | declare const plugin: PluginFunc 10 | export = plugin 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/arraySupport/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, dayjs) { 2 | var proto = c.prototype; 3 | 4 | var parseDate = function parseDate(cfg) { 5 | var date = cfg.date, 6 | utc = cfg.utc; 7 | 8 | if (Array.isArray(date)) { 9 | if (utc) { 10 | if (!date.length) { 11 | return new Date(); 12 | } 13 | 14 | return new Date(Date.UTC.apply(null, date)); 15 | } 16 | 17 | if (date.length === 1) { 18 | return dayjs(String(date[0])).toDate(); 19 | } 20 | 21 | return new (Function.prototype.bind.apply(Date, [null].concat(date)))(); 22 | } 23 | 24 | return date; 25 | }; 26 | 27 | var oldParse = proto.parse; 28 | 29 | proto.parse = function (cfg) { 30 | cfg.date = parseDate.bind(this)(cfg); 31 | oldParse.bind(this)(cfg); 32 | }; 33 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/badMutable/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/bigIntSupport/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare module 'dayjs/esm' { 4 | interface ConfigTypeMap { 5 | bigIntSupport: BigInt 6 | } 7 | export function unix(t: BigInt): Dayjs 8 | } 9 | 10 | declare const plugin: PluginFunc 11 | export = plugin 12 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/bigIntSupport/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line valid-typeof 2 | var isBigInt = function isBigInt(num) { 3 | return typeof num === 'bigint'; 4 | }; 5 | 6 | export default (function (o, c, dayjs) { 7 | var proto = c.prototype; 8 | 9 | var parseDate = function parseDate(cfg) { 10 | var date = cfg.date; 11 | 12 | if (isBigInt(date)) { 13 | return Number(date); 14 | } 15 | 16 | return date; 17 | }; 18 | 19 | var oldParse = proto.parse; 20 | 21 | proto.parse = function (cfg) { 22 | cfg.date = parseDate.bind(this)(cfg); 23 | oldParse.bind(this)(cfg); 24 | }; 25 | 26 | var oldUnix = dayjs.unix; 27 | 28 | dayjs.unix = function (timestamp) { 29 | var ts = isBigInt(timestamp) ? Number(timestamp) : timestamp; 30 | return oldUnix(ts); 31 | }; 32 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/buddhistEra/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/buddhistEra/index.js: -------------------------------------------------------------------------------- 1 | import { FORMAT_DEFAULT } from '../../constant'; 2 | export default (function (o, c) { 3 | // locale needed later 4 | var proto = c.prototype; 5 | var oldFormat = proto.format; // extend en locale here 6 | 7 | proto.format = function (formatStr) { 8 | var _this = this; 9 | 10 | var yearBias = 543; 11 | var str = formatStr || FORMAT_DEFAULT; 12 | var result = str.replace(/(\[[^\]]+])|BBBB|BB/g, function (match, a) { 13 | var _this$$utils; 14 | 15 | var year = String(_this.$y + yearBias); 16 | var args = match === 'BB' ? [year.slice(-2), 2] : [year, 4]; 17 | return a || (_this$$utils = _this.$utils()).s.apply(_this$$utils, args.concat(['0'])); 18 | }); 19 | return oldFormat.bind(this)(result); 20 | }; 21 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/calendar/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | calendar(referenceTime?: ConfigType, formats?: object): string 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/customParseFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare interface PluginOptions { 4 | parseTwoDigitYear?: (yearString: string) => number 5 | } 6 | 7 | declare const plugin: PluginFunc 8 | export = plugin 9 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/dayOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | dayOfYear(): number 9 | dayOfYear(value: number): Dayjs 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/dayOfYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.dayOfYear = function (input) { 5 | // d(this) is for badMutable 6 | var dayOfYear = Math.round((d(this).startOf('day') - d(this).startOf('year')) / 864e5) + 1; 7 | return input == null ? dayOfYear : this.add(input - dayOfYear, 'day'); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/devHelper/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isBetween/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: '()' | '[]' | '[)' | '(]'): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isBetween/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | c.prototype.isBetween = function (a, b, u, i) { 3 | var dA = d(a); 4 | var dB = d(b); 5 | i = i || '()'; 6 | var dAi = i[0] === '('; 7 | var dBi = i[1] === ')'; 8 | return (dAi ? this.isAfter(dA, u) : !this.isBefore(dA, u)) && (dBi ? this.isBefore(dB, u) : !this.isAfter(dB, u)) || (dAi ? this.isBefore(dA, u) : !this.isAfter(dA, u)) && (dBi ? this.isAfter(dB, u) : !this.isBefore(dB, u)); 9 | }; 10 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isLeapYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isLeapYear(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isLeapYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.isLeapYear = function () { 5 | return this.$y % 4 === 0 && this.$y % 100 !== 0 || this.$y % 400 === 0; 6 | }; 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isMoment/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | 8 | export function isMoment(input: any): boolean 9 | 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isMoment/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, f) { 2 | f.isMoment = function (input) { 3 | return f.isDayjs(input); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isSameOrAfter/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isSameOrAfter(date: ConfigType, unit?: OpUnitType): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isSameOrAfter/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | c.prototype.isSameOrAfter = function (that, units) { 3 | return this.isSame(that, units) || this.isAfter(that, units); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isSameOrBefore/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isSameOrBefore(date: ConfigType, unit?: OpUnitType): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isSameOrBefore/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | c.prototype.isSameOrBefore = function (that, units) { 3 | return this.isSame(that, units) || this.isBefore(that, units); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isToday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isToday(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isToday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isToday = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var now = d(); 7 | return this.format(comparisonTemplate) === now.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isTomorrow/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isTomorrow(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isTomorrow/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isTomorrow = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var tomorrow = d().add(1, 'day'); 7 | return this.format(comparisonTemplate) === tomorrow.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isYesterday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isYesterday(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isYesterday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isYesterday = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var yesterday = d().subtract(1, 'day'); 7 | return this.format(comparisonTemplate) === yesterday.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isoWeek/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, OpUnitType, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | type ISOUnitType = OpUnitType | 'isoWeek'; 7 | 8 | declare module 'dayjs/esm' { 9 | interface Dayjs { 10 | isoWeekYear(): number 11 | isoWeek(): number 12 | isoWeek(value: number): Dayjs 13 | 14 | isoWeekday(): number 15 | isoWeekday(value: number): Dayjs 16 | 17 | startOf(unit: ISOUnitType): Dayjs 18 | 19 | endOf(unit: ISOUnitType): Dayjs 20 | 21 | isSame(date: ConfigType, unit?: ISOUnitType): boolean 22 | 23 | isBefore(date: ConfigType, unit?: ISOUnitType): boolean 24 | 25 | isAfter(date: ConfigType, unit?: ISOUnitType): boolean 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isoWeeksInYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isoWeeksInYear(): number 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/isoWeeksInYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.isoWeeksInYear = function () { 5 | var isLeapYear = this.isLeapYear(); 6 | var last = this.endOf('y'); 7 | var day = last.day(); 8 | 9 | if (day === 4 || isLeapYear && day === 5) { 10 | return 53; 11 | } 12 | 13 | return 52; 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/localizedFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/localizedFormat/index.js: -------------------------------------------------------------------------------- 1 | import { FORMAT_DEFAULT } from '../../constant'; 2 | import { u, englishFormats } from './utils'; 3 | export default (function (o, c, d) { 4 | var proto = c.prototype; 5 | var oldFormat = proto.format; 6 | d.en.formats = englishFormats; 7 | 8 | proto.format = function (formatStr) { 9 | if (formatStr === void 0) { 10 | formatStr = FORMAT_DEFAULT; 11 | } 12 | 13 | var _this$$locale = this.$locale(), 14 | _this$$locale$formats = _this$$locale.formats, 15 | formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats; 16 | 17 | var result = u(formatStr, formats); 18 | return oldFormat.call(this, result); 19 | }; 20 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/localizedFormat/utils.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/prefer-default-export 2 | export var t = function t(format) { 3 | return format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (_, a, b) { 4 | return a || b.slice(1); 5 | }); 6 | }; 7 | export var englishFormats = { 8 | LTS: 'h:mm:ss A', 9 | LT: 'h:mm A', 10 | L: 'MM/DD/YYYY', 11 | LL: 'MMMM D, YYYY', 12 | LLL: 'MMMM D, YYYY h:mm A', 13 | LLLL: 'dddd, MMMM D, YYYY h:mm A' 14 | }; 15 | export var u = function u(formatStr, formats) { 16 | return formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (_, a, b) { 17 | var B = b && b.toUpperCase(); 18 | return a || formats[b] || englishFormats[b] || t(formats[B]); 19 | }); 20 | }; -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/minMax/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | export function max(dayjs: Dayjs[]): Dayjs 8 | export function max(...dayjs: Dayjs[]): Dayjs 9 | export function min(dayjs: Dayjs[]): Dayjs 10 | export function min(...dayjs: Dayjs[]): Dayjs 11 | } 12 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/pluralGetSet/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | var pluralAliases = ['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'isoWeeks', 'months', 'quarters', 'years', 'dates']; 4 | pluralAliases.forEach(function (alias) { 5 | proto[alias] = proto[alias.replace(/s$/, '')]; 6 | }); 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/preParsePostFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/quarterOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, QUnitType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | quarter(): number 9 | 10 | quarter(quarter: number): Dayjs 11 | 12 | add(value: number, unit: QUnitType): Dayjs 13 | 14 | subtract(value: number, unit: QUnitType): Dayjs 15 | 16 | startOf(unit: QUnitType | OpUnitType): Dayjs 17 | 18 | endOf(unit: QUnitType | OpUnitType): Dayjs 19 | 20 | isSame(date: ConfigType, unit?: QUnitType): boolean 21 | 22 | isBefore(date: ConfigType, unit?: QUnitType): boolean 23 | 24 | isAfter(date: ConfigType, unit?: QUnitType): boolean 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/relativeTime/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare interface RelativeTimeThreshold { 4 | l: string 5 | r?: number 6 | d?: string 7 | } 8 | 9 | declare interface RelativeTimeOptions { 10 | rounding?: (num: number) => number 11 | thresholds?: RelativeTimeThreshold[] 12 | } 13 | 14 | declare const plugin: PluginFunc 15 | export = plugin 16 | 17 | declare module 'dayjs/esm' { 18 | interface Dayjs { 19 | fromNow(withoutSuffix?: boolean): string 20 | from(compared: ConfigType, withoutSuffix?: boolean): string 21 | toNow(withoutSuffix?: boolean): string 22 | to(compared: ConfigType, withoutSuffix?: boolean): string 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/timezone/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | tz(timezone?: string, keepLocalTime?: boolean): Dayjs 9 | offsetName(type?: 'short' | 'long'): string | undefined 10 | } 11 | 12 | interface DayjsTimezone { 13 | (date: ConfigType, timezone?: string): Dayjs 14 | (date: ConfigType, format: string, timezone?: string): Dayjs 15 | guess(): string 16 | setDefault(timezone?: string): void 17 | } 18 | 19 | const tz: DayjsTimezone 20 | } 21 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/toArray/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | toArray(): number[] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/toArray/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.toArray = function () { 5 | return [this.$y, this.$M, this.$D, this.$H, this.$m, this.$s, this.$ms]; 6 | }; 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/toObject/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | interface DayjsObject { 7 | years: number 8 | months: number 9 | date: number 10 | hours: number 11 | minutes: number 12 | seconds: number 13 | milliseconds: number 14 | } 15 | 16 | declare module 'dayjs/esm' { 17 | interface Dayjs { 18 | toObject(): DayjsObject 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/toObject/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.toObject = function () { 5 | return { 6 | years: this.$y, 7 | months: this.$M, 8 | date: this.$D, 9 | hours: this.$H, 10 | minutes: this.$m, 11 | seconds: this.$s, 12 | milliseconds: this.$ms 13 | }; 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/updateLocale/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | export function updateLocale(localeName: string, customConfig: Record): Record 8 | } 9 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/updateLocale/index.js: -------------------------------------------------------------------------------- 1 | export default (function (option, Dayjs, dayjs) { 2 | dayjs.updateLocale = function (locale, customConfig) { 3 | var localeList = dayjs.Ls; 4 | var localeConfig = localeList[locale]; 5 | if (!localeConfig) return; 6 | var customConfigKeys = customConfig ? Object.keys(customConfig) : []; 7 | customConfigKeys.forEach(function (c) { 8 | localeConfig[c] = customConfig[c]; 9 | }); 10 | return localeConfig; // eslint-disable-line consistent-return 11 | }; 12 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/utc/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | 9 | utc(keepLocalTime?: boolean): Dayjs 10 | 11 | local(): Dayjs 12 | 13 | isUTC(): boolean 14 | 15 | utcOffset(offset: number | string, keepLocalTime?: boolean): Dayjs 16 | } 17 | 18 | export function utc(config?: ConfigType, format?: string, strict?: boolean): Dayjs 19 | } 20 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/weekOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | week(): number 9 | 10 | week(value : number): Dayjs 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/weekYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | weekYear(): number 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/weekYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.weekYear = function () { 5 | var month = this.month(); 6 | var weekOfYear = this.week(); 7 | var year = this.year(); 8 | 9 | if (weekOfYear === 1 && month === 11) { 10 | return year + 1; 11 | } 12 | 13 | if (month === 0 && weekOfYear >= 52) { 14 | return year - 1; 15 | } 16 | 17 | return year; 18 | }; 19 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/weekday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | weekday(): number 9 | 10 | weekday(value: number): Dayjs 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/dayjs/locale/plugin/weekday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.weekday = function (input) { 5 | var weekStart = this.$locale().weekStart || 0; 6 | var $W = this.$W; 7 | var weekday = ($W < weekStart ? $W + 7 : $W) - weekStart; 8 | 9 | if (this.$utils().u(input)) { 10 | return weekday; 11 | } 12 | 13 | return this.subtract(weekday, 'day').add(input, 'day'); 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/dayjs/locale/types.d.ts: -------------------------------------------------------------------------------- 1 | declare interface ILocale { 2 | name: string 3 | weekdays?: string[] 4 | months?: string[] 5 | weekStart?: number 6 | weekdaysShort?: string[] 7 | monthsShort?: string[] 8 | weekdaysMin?: string[] 9 | ordinal?: (n: number) => number | string 10 | formats: Partial<{ 11 | LT: string 12 | LTS: string 13 | L: string 14 | LL: string 15 | LLL: string 16 | LLLL: string 17 | }> 18 | relativeTime: Partial<{ 19 | future: string 20 | past: string 21 | s: string 22 | m: string 23 | mm: string 24 | h: string 25 | hh: string 26 | d: string 27 | dd: string 28 | M: string 29 | MM: string 30 | y: string 31 | yy: string 32 | }> 33 | } 34 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/advancedFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/arraySupport/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare module 'dayjs/esm' { 4 | interface ConfigTypeMap { 5 | arraySupport: [number?, number?, number?, number?, number?, number?, number?] 6 | } 7 | } 8 | 9 | declare const plugin: PluginFunc 10 | export = plugin 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/arraySupport/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, dayjs) { 2 | var proto = c.prototype; 3 | 4 | var parseDate = function parseDate(cfg) { 5 | var date = cfg.date, 6 | utc = cfg.utc; 7 | 8 | if (Array.isArray(date)) { 9 | if (utc) { 10 | if (!date.length) { 11 | return new Date(); 12 | } 13 | 14 | return new Date(Date.UTC.apply(null, date)); 15 | } 16 | 17 | if (date.length === 1) { 18 | return dayjs(String(date[0])).toDate(); 19 | } 20 | 21 | return new (Function.prototype.bind.apply(Date, [null].concat(date)))(); 22 | } 23 | 24 | return date; 25 | }; 26 | 27 | var oldParse = proto.parse; 28 | 29 | proto.parse = function (cfg) { 30 | cfg.date = parseDate.bind(this)(cfg); 31 | oldParse.bind(this)(cfg); 32 | }; 33 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/badMutable/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/bigIntSupport/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare module 'dayjs/esm' { 4 | interface ConfigTypeMap { 5 | bigIntSupport: BigInt 6 | } 7 | export function unix(t: BigInt): Dayjs 8 | } 9 | 10 | declare const plugin: PluginFunc 11 | export = plugin 12 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/bigIntSupport/index.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line valid-typeof 2 | var isBigInt = function isBigInt(num) { 3 | return typeof num === 'bigint'; 4 | }; 5 | 6 | export default (function (o, c, dayjs) { 7 | var proto = c.prototype; 8 | 9 | var parseDate = function parseDate(cfg) { 10 | var date = cfg.date; 11 | 12 | if (isBigInt(date)) { 13 | return Number(date); 14 | } 15 | 16 | return date; 17 | }; 18 | 19 | var oldParse = proto.parse; 20 | 21 | proto.parse = function (cfg) { 22 | cfg.date = parseDate.bind(this)(cfg); 23 | oldParse.bind(this)(cfg); 24 | }; 25 | 26 | var oldUnix = dayjs.unix; 27 | 28 | dayjs.unix = function (timestamp) { 29 | var ts = isBigInt(timestamp) ? Number(timestamp) : timestamp; 30 | return oldUnix(ts); 31 | }; 32 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/buddhistEra/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/buddhistEra/index.js: -------------------------------------------------------------------------------- 1 | import { FORMAT_DEFAULT } from '../../constant'; 2 | export default (function (o, c) { 3 | // locale needed later 4 | var proto = c.prototype; 5 | var oldFormat = proto.format; // extend en locale here 6 | 7 | proto.format = function (formatStr) { 8 | var _this = this; 9 | 10 | var yearBias = 543; 11 | var str = formatStr || FORMAT_DEFAULT; 12 | var result = str.replace(/(\[[^\]]+])|BBBB|BB/g, function (match, a) { 13 | var _this$$utils; 14 | 15 | var year = String(_this.$y + yearBias); 16 | var args = match === 'BB' ? [year.slice(-2), 2] : [year, 4]; 17 | return a || (_this$$utils = _this.$utils()).s.apply(_this$$utils, args.concat(['0'])); 18 | }); 19 | return oldFormat.bind(this)(result); 20 | }; 21 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/calendar/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | calendar(referenceTime?: ConfigType, formats?: object): string 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/customParseFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare interface PluginOptions { 4 | parseTwoDigitYear?: (yearString: string) => number 5 | } 6 | 7 | declare const plugin: PluginFunc 8 | export = plugin 9 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/dayOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | dayOfYear(): number 9 | dayOfYear(value: number): Dayjs 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/dayOfYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.dayOfYear = function (input) { 5 | // d(this) is for badMutable 6 | var dayOfYear = Math.round((d(this).startOf('day') - d(this).startOf('year')) / 864e5) + 1; 7 | return input == null ? dayOfYear : this.add(input - dayOfYear, 'day'); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/devHelper/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isBetween/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isBetween(a: ConfigType, b: ConfigType, c?: OpUnitType | null, d?: '()' | '[]' | '[)' | '(]'): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isBetween/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | c.prototype.isBetween = function (a, b, u, i) { 3 | var dA = d(a); 4 | var dB = d(b); 5 | i = i || '()'; 6 | var dAi = i[0] === '('; 7 | var dBi = i[1] === ')'; 8 | return (dAi ? this.isAfter(dA, u) : !this.isBefore(dA, u)) && (dBi ? this.isBefore(dB, u) : !this.isAfter(dB, u)) || (dAi ? this.isBefore(dA, u) : !this.isAfter(dA, u)) && (dBi ? this.isAfter(dB, u) : !this.isBefore(dB, u)); 9 | }; 10 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isLeapYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isLeapYear(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isLeapYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.isLeapYear = function () { 5 | return this.$y % 4 === 0 && this.$y % 100 !== 0 || this.$y % 400 === 0; 6 | }; 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isMoment/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | 8 | export function isMoment(input: any): boolean 9 | 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isMoment/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, f) { 2 | f.isMoment = function (input) { 3 | return f.isDayjs(input); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isSameOrAfter/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isSameOrAfter(date: ConfigType, unit?: OpUnitType): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isSameOrAfter/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | c.prototype.isSameOrAfter = function (that, units) { 3 | return this.isSame(that, units) || this.isAfter(that, units); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isSameOrBefore/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isSameOrBefore(date: ConfigType, unit?: OpUnitType): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isSameOrBefore/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | c.prototype.isSameOrBefore = function (that, units) { 3 | return this.isSame(that, units) || this.isBefore(that, units); 4 | }; 5 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isToday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isToday(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isToday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isToday = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var now = d(); 7 | return this.format(comparisonTemplate) === now.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isTomorrow/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isTomorrow(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isTomorrow/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isTomorrow = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var tomorrow = d().add(1, 'day'); 7 | return this.format(comparisonTemplate) === tomorrow.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isYesterday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isYesterday(): boolean 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isYesterday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c, d) { 2 | var proto = c.prototype; 3 | 4 | proto.isYesterday = function () { 5 | var comparisonTemplate = 'YYYY-MM-DD'; 6 | var yesterday = d().subtract(1, 'day'); 7 | return this.format(comparisonTemplate) === yesterday.format(comparisonTemplate); 8 | }; 9 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/isoWeek/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, OpUnitType, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | type ISOUnitType = OpUnitType | 'isoWeek'; 7 | 8 | declare module 'dayjs/esm' { 9 | interface Dayjs { 10 | isoWeekYear(): number 11 | isoWeek(): number 12 | isoWeek(value: number): Dayjs 13 | 14 | isoWeekday(): number 15 | isoWeekday(value: number): Dayjs 16 | 17 | startOf(unit: ISOUnitType): Dayjs 18 | 19 | endOf(unit: ISOUnitType): Dayjs 20 | 21 | isSame(date: ConfigType, unit?: ISOUnitType): boolean 22 | 23 | isBefore(date: ConfigType, unit?: ISOUnitType): boolean 24 | 25 | isAfter(date: ConfigType, unit?: ISOUnitType): boolean 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isoWeeksInYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | isoWeeksInYear(): number 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/isoWeeksInYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.isoWeeksInYear = function () { 5 | var isLeapYear = this.isLeapYear(); 6 | var last = this.endOf('y'); 7 | var day = last.day(); 8 | 9 | if (day === 4 || isLeapYear && day === 5) { 10 | return 53; 11 | } 12 | 13 | return 52; 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/localizedFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/localizedFormat/index.js: -------------------------------------------------------------------------------- 1 | import { FORMAT_DEFAULT } from '../../constant'; 2 | import { u, englishFormats } from './utils'; 3 | export default (function (o, c, d) { 4 | var proto = c.prototype; 5 | var oldFormat = proto.format; 6 | d.en.formats = englishFormats; 7 | 8 | proto.format = function (formatStr) { 9 | if (formatStr === void 0) { 10 | formatStr = FORMAT_DEFAULT; 11 | } 12 | 13 | var _this$$locale = this.$locale(), 14 | _this$$locale$formats = _this$$locale.formats, 15 | formats = _this$$locale$formats === void 0 ? {} : _this$$locale$formats; 16 | 17 | var result = u(formatStr, formats); 18 | return oldFormat.call(this, result); 19 | }; 20 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/localizedFormat/utils.js: -------------------------------------------------------------------------------- 1 | // eslint-disable-next-line import/prefer-default-export 2 | export var t = function t(format) { 3 | return format.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function (_, a, b) { 4 | return a || b.slice(1); 5 | }); 6 | }; 7 | export var englishFormats = { 8 | LTS: 'h:mm:ss A', 9 | LT: 'h:mm A', 10 | L: 'MM/DD/YYYY', 11 | LL: 'MMMM D, YYYY', 12 | LLL: 'MMMM D, YYYY h:mm A', 13 | LLLL: 'dddd, MMMM D, YYYY h:mm A' 14 | }; 15 | export var u = function u(formatStr, formats) { 16 | return formatStr.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function (_, a, b) { 17 | var B = b && b.toUpperCase(); 18 | return a || formats[b] || englishFormats[b] || t(formats[B]); 19 | }); 20 | }; -------------------------------------------------------------------------------- /libs/dayjs/plugin/minMax/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | export function max(dayjs: Dayjs[]): Dayjs 8 | export function max(...dayjs: Dayjs[]): Dayjs 9 | export function min(dayjs: Dayjs[]): Dayjs 10 | export function min(...dayjs: Dayjs[]): Dayjs 11 | } 12 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/pluralGetSet/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | var pluralAliases = ['milliseconds', 'seconds', 'minutes', 'hours', 'days', 'weeks', 'isoWeeks', 'months', 'quarters', 'years', 'dates']; 4 | pluralAliases.forEach(function (alias) { 5 | proto[alias] = proto[alias.replace(/s$/, '')]; 6 | }); 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/preParsePostFormat/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/quarterOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType, QUnitType, OpUnitType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | quarter(): number 9 | 10 | quarter(quarter: number): Dayjs 11 | 12 | add(value: number, unit: QUnitType): Dayjs 13 | 14 | subtract(value: number, unit: QUnitType): Dayjs 15 | 16 | startOf(unit: QUnitType | OpUnitType): Dayjs 17 | 18 | endOf(unit: QUnitType | OpUnitType): Dayjs 19 | 20 | isSame(date: ConfigType, unit?: QUnitType): boolean 21 | 22 | isBefore(date: ConfigType, unit?: QUnitType): boolean 23 | 24 | isAfter(date: ConfigType, unit?: QUnitType): boolean 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/relativeTime/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare interface RelativeTimeThreshold { 4 | l: string 5 | r?: number 6 | d?: string 7 | } 8 | 9 | declare interface RelativeTimeOptions { 10 | rounding?: (num: number) => number 11 | thresholds?: RelativeTimeThreshold[] 12 | } 13 | 14 | declare const plugin: PluginFunc 15 | export = plugin 16 | 17 | declare module 'dayjs/esm' { 18 | interface Dayjs { 19 | fromNow(withoutSuffix?: boolean): string 20 | from(compared: ConfigType, withoutSuffix?: boolean): string 21 | toNow(withoutSuffix?: boolean): string 22 | to(compared: ConfigType, withoutSuffix?: boolean): string 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/timezone/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | tz(timezone?: string, keepLocalTime?: boolean): Dayjs 9 | offsetName(type?: 'short' | 'long'): string | undefined 10 | } 11 | 12 | interface DayjsTimezone { 13 | (date: ConfigType, timezone?: string): Dayjs 14 | (date: ConfigType, format: string, timezone?: string): Dayjs 15 | guess(): string 16 | setDefault(timezone?: string): void 17 | } 18 | 19 | const tz: DayjsTimezone 20 | } 21 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/toArray/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | toArray(): number[] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/toArray/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.toArray = function () { 5 | return [this.$y, this.$M, this.$D, this.$H, this.$m, this.$s, this.$ms]; 6 | }; 7 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/toObject/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | interface DayjsObject { 7 | years: number 8 | months: number 9 | date: number 10 | hours: number 11 | minutes: number 12 | seconds: number 13 | milliseconds: number 14 | } 15 | 16 | declare module 'dayjs/esm' { 17 | interface Dayjs { 18 | toObject(): DayjsObject 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/toObject/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.toObject = function () { 5 | return { 6 | years: this.$y, 7 | months: this.$M, 8 | date: this.$D, 9 | hours: this.$H, 10 | minutes: this.$m, 11 | seconds: this.$s, 12 | milliseconds: this.$ms 13 | }; 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/updateLocale/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | export function updateLocale(localeName: string, customConfig: Record): Record 8 | } 9 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/updateLocale/index.js: -------------------------------------------------------------------------------- 1 | export default (function (option, Dayjs, dayjs) { 2 | dayjs.updateLocale = function (locale, customConfig) { 3 | var localeList = dayjs.Ls; 4 | var localeConfig = localeList[locale]; 5 | if (!localeConfig) return; 6 | var customConfigKeys = customConfig ? Object.keys(customConfig) : []; 7 | customConfigKeys.forEach(function (c) { 8 | localeConfig[c] = customConfig[c]; 9 | }); 10 | return localeConfig; // eslint-disable-line consistent-return 11 | }; 12 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/utc/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc, ConfigType } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | 9 | utc(keepLocalTime?: boolean): Dayjs 10 | 11 | local(): Dayjs 12 | 13 | isUTC(): boolean 14 | 15 | utcOffset(offset: number | string, keepLocalTime?: boolean): Dayjs 16 | } 17 | 18 | export function utc(config?: ConfigType, format?: string, strict?: boolean): Dayjs 19 | } 20 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/weekOfYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | week(): number 9 | 10 | week(value : number): Dayjs 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/weekYear/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | weekYear(): number 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/weekYear/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.weekYear = function () { 5 | var month = this.month(); 6 | var weekOfYear = this.week(); 7 | var year = this.year(); 8 | 9 | if (weekOfYear === 1 && month === 11) { 10 | return year + 1; 11 | } 12 | 13 | if (month === 0 && weekOfYear >= 52) { 14 | return year - 1; 15 | } 16 | 17 | return year; 18 | }; 19 | }); -------------------------------------------------------------------------------- /libs/dayjs/plugin/weekday/index.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginFunc } from 'dayjs/esm' 2 | 3 | declare const plugin: PluginFunc 4 | export = plugin 5 | 6 | declare module 'dayjs/esm' { 7 | interface Dayjs { 8 | weekday(): number 9 | 10 | weekday(value: number): Dayjs 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /libs/dayjs/plugin/weekday/index.js: -------------------------------------------------------------------------------- 1 | export default (function (o, c) { 2 | var proto = c.prototype; 3 | 4 | proto.weekday = function (input) { 5 | var weekStart = this.$locale().weekStart || 0; 6 | var $W = this.$W; 7 | var weekday = ($W < weekStart ? $W + 7 : $W) - weekStart; 8 | 9 | if (this.$utils().u(input)) { 10 | return weekday; 11 | } 12 | 13 | return this.subtract(weekday, 'day').add(input, 'day'); 14 | }; 15 | }); -------------------------------------------------------------------------------- /libs/lodash/CHANGELOG: -------------------------------------------------------------------------------- 1 | https://github.com/lodash/lodash/wiki/Changelog 2 | -------------------------------------------------------------------------------- /libs/lodash/_addMapEntry.ts: -------------------------------------------------------------------------------- 1 | export function addMapEntry(map: any, pair: any) { 2 | map.set(pair[0], pair[1]) 3 | return map 4 | } 5 | -------------------------------------------------------------------------------- /libs/lodash/_addSetEntry.ts: -------------------------------------------------------------------------------- 1 | export function addSetEntry(set: any, value: any) { 2 | set.add(value) 3 | return set 4 | } 5 | -------------------------------------------------------------------------------- /libs/lodash/_arrayFilter.ts: -------------------------------------------------------------------------------- 1 | export function arrayFilter(array: any, predicate: any) { 2 | let index = -1 3 | const length = array == null ? 0 : array.length 4 | let resIndex = 0 5 | const result = [] 6 | 7 | while (++index < length) { 8 | const value = array[index] 9 | if (predicate(value, index, array)) { 10 | result[resIndex++] = value 11 | } 12 | } 13 | return result 14 | } 15 | -------------------------------------------------------------------------------- /libs/lodash/_arrayLikeKeys.ts: -------------------------------------------------------------------------------- 1 | import { baseTimes } from './_baseTime' 2 | import { isIndex } from './_isIndex' 3 | import { isArguments } from './is-arguments' 4 | import { isArray } from './is-array' 5 | 6 | const objectProto = Object.prototype 7 | const hasOwnProperty = objectProto.hasOwnProperty 8 | 9 | export function arrayLikeKeys(value: any, inherited?: any) { 10 | const result = 11 | isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [] 12 | 13 | const length = result.length, 14 | skipIndexes = !!length 15 | 16 | for (const key in value) { 17 | if ( 18 | (inherited || hasOwnProperty.call(value, key)) && 19 | !(skipIndexes && (key == 'length' || isIndex(key, length))) 20 | ) { 21 | result.push(key) 22 | } 23 | } 24 | return result 25 | } 26 | -------------------------------------------------------------------------------- /libs/lodash/_arrayReduce.ts: -------------------------------------------------------------------------------- 1 | export function arrayReduce( 2 | array: any, 3 | iteratee: any, 4 | accumulator: any, 5 | initAccum?: any 6 | ) { 7 | let index = -1 8 | const length = array ? array.length : 0 9 | 10 | if (initAccum && length) { 11 | accumulator = array[++index] 12 | } 13 | while (++index < length) { 14 | accumulator = iteratee(accumulator, array[index], index, array) 15 | } 16 | return accumulator 17 | } 18 | -------------------------------------------------------------------------------- /libs/lodash/_asciiToArray.ts: -------------------------------------------------------------------------------- 1 | export function asciiToArray(string: string) { 2 | return string.split('') 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/_assignValue.ts: -------------------------------------------------------------------------------- 1 | import { eq } from './_eq' 2 | 3 | const objectProto = Object.prototype 4 | const hasOwnProperty = objectProto.hasOwnProperty 5 | 6 | export function assignValue( 7 | object: T, 8 | key: string | symbol, 9 | value: any 10 | ) { 11 | const objValue = object[key as keyof typeof object] 12 | if ( 13 | !(hasOwnProperty.call(object, key) && eq(objValue, value)) || 14 | (value === undefined && !(key in object)) 15 | ) { 16 | object[key as keyof typeof object] = value 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /libs/lodash/_baseAssign.ts: -------------------------------------------------------------------------------- 1 | import { copyObject } from './_copyObject' 2 | import { keys } from './keys' 3 | 4 | export function baseAssign(object: any, source: any) { 5 | return object && copyObject(source, keys(source), object) 6 | } 7 | -------------------------------------------------------------------------------- /libs/lodash/_baseFindIndex.ts: -------------------------------------------------------------------------------- 1 | export function baseFindIndex( 2 | array: string[], 3 | predicate: (...args: any[]) => boolean, 4 | fromIndex: number, 5 | fromRight = false 6 | ) { 7 | const length = array.length 8 | let index = fromIndex + (fromRight ? 1 : -1) 9 | 10 | while (fromRight ? index-- : ++index < length) { 11 | if (predicate(array[index], index, array)) { 12 | return index 13 | } 14 | } 15 | return -1 16 | } 17 | -------------------------------------------------------------------------------- /libs/lodash/_baseGetTag.ts: -------------------------------------------------------------------------------- 1 | const objectProto = Object.prototype 2 | const objectToString = objectProto.toString 3 | 4 | export function baseGetTag(value: any) { 5 | return objectToString.call(value) 6 | } 7 | -------------------------------------------------------------------------------- /libs/lodash/_baseIndexOf.ts: -------------------------------------------------------------------------------- 1 | import { baseFindIndex } from './_baseFindIndex' 2 | import { baseIsNaN } from './_baseIsNan' 3 | import { strictIndexOf } from './_strictIndexOf' 4 | 5 | export function baseIndexOf(array: string[], value: string, fromIndex: number) { 6 | return value === value 7 | ? strictIndexOf(array, value, fromIndex) 8 | : baseFindIndex(array, baseIsNaN, fromIndex) 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_baseIsArguments.ts: -------------------------------------------------------------------------------- 1 | import { baseGetTag } from './_baseGetTag' 2 | import { isObjectLike } from './is-object-like' 3 | 4 | const argsTag = '[object Arguments]' 5 | 6 | export function baseIsArguments(value: any) { 7 | return isObjectLike(value) && baseGetTag(value) == argsTag 8 | } 9 | -------------------------------------------------------------------------------- /libs/lodash/_baseIsNan.ts: -------------------------------------------------------------------------------- 1 | export function baseIsNaN(value: any) { 2 | return value !== value 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/_baseKeys.ts: -------------------------------------------------------------------------------- 1 | import { isPrototype } from './_isPrototype' 2 | import { nativeKeys } from './_nativeKeys' 3 | 4 | const objectProto = Object.prototype 5 | const hasOwnProperty = objectProto.hasOwnProperty 6 | 7 | export function baseKeys(object: any) { 8 | if (!isPrototype(object)) { 9 | return nativeKeys(object) 10 | } 11 | const result = [] 12 | for (const key in new Object(object)) { 13 | if (hasOwnProperty.call(object, key) && key != 'constructor') { 14 | result.push(key) 15 | } 16 | } 17 | return result 18 | } 19 | -------------------------------------------------------------------------------- /libs/lodash/_baseSlice.ts: -------------------------------------------------------------------------------- 1 | export function baseSlice(array: string[], start: number, end: number) { 2 | let index = -1 3 | let length = array.length 4 | 5 | if (start < 0) { 6 | start = -start > length ? 0 : length + start 7 | } 8 | end = end > length ? length : end 9 | if (end < 0) { 10 | end += length 11 | } 12 | length = start > end ? 0 : (end - start) >>> 0 13 | start >>>= 0 14 | 15 | const result = Array.from({ length }) 16 | while (++index < length) { 17 | result[index] = array[index + start] 18 | } 19 | return result 20 | } 21 | -------------------------------------------------------------------------------- /libs/lodash/_baseTime.ts: -------------------------------------------------------------------------------- 1 | export function baseTimes(n: any, iteratee: any) { 2 | let index = -1 3 | const result = Array.from({ length: n }) 4 | 5 | while (++index < n) { 6 | result[index] = iteratee(index) 7 | } 8 | return result 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_baseToString.ts: -------------------------------------------------------------------------------- 1 | import { isSymbol } from '@vue/shared' 2 | import { INFINITY } from './_common' 3 | 4 | import type { PropertyName } from './_common' 5 | 6 | const symbolProto = Symbol ? Symbol.prototype : undefined 7 | const symbolToString = symbolProto ? symbolProto.toString : undefined 8 | 9 | export function baseToString(value: PropertyName) { 10 | if (typeof value == 'string') { 11 | return value 12 | } 13 | if (isSymbol(value)) { 14 | return symbolToString ? symbolToString.call(value) : '' 15 | } 16 | const result = `${value}` 17 | return result == '0' && 1 / value == -INFINITY ? '-0' : result 18 | } 19 | -------------------------------------------------------------------------------- /libs/lodash/_baseTrim.ts: -------------------------------------------------------------------------------- 1 | import { trimmedEndIndex } from './_trimmedEndIndex' 2 | 3 | const reTrimStart = /^\s+/ 4 | 5 | export function baseTrim(string: string) { 6 | return string 7 | ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 8 | : string 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_castPath.ts: -------------------------------------------------------------------------------- 1 | import { stringToPath } from './_stringToPath' 2 | 3 | import type { PropertyName, PropertyPath } from './_common' 4 | 5 | export function castPath(value: PropertyPath) { 6 | return Array.isArray(value) ? value : stringToPath(value as PropertyName) 7 | } 8 | -------------------------------------------------------------------------------- /libs/lodash/_castSlice.ts: -------------------------------------------------------------------------------- 1 | import { baseSlice } from './_baseSlice' 2 | 3 | export function castSlice(array: string[], start: number, end: number) { 4 | const length = array.length 5 | end = end === undefined ? length : end 6 | return !start && end >= length ? array : baseSlice(array, start, end) 7 | } 8 | -------------------------------------------------------------------------------- /libs/lodash/_charStartIndex.ts: -------------------------------------------------------------------------------- 1 | import { baseIndexOf } from './_baseIndexOf' 2 | 3 | export function charsStartIndex(strSymbols: string[], chrSymbols: string[]) { 4 | let index = -1 5 | const length = strSymbols.length 6 | 7 | while ( 8 | ++index < length && 9 | baseIndexOf(chrSymbols, strSymbols[index], 0) > -1 10 | ) { 11 | /* empty */ 12 | } 13 | return index 14 | } 15 | -------------------------------------------------------------------------------- /libs/lodash/_charsEndIndex.ts: -------------------------------------------------------------------------------- 1 | import { baseIndexOf } from './_baseIndexOf' 2 | 3 | export function charsEndIndex(strSymbols: string[], chrSymbols: string[]) { 4 | let index = strSymbols.length 5 | 6 | while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { 7 | /* empty */ 8 | } 9 | return index 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/_cloneArrayBuffer.ts: -------------------------------------------------------------------------------- 1 | export function cloneArrayBuffer(arrayBuffer: any) { 2 | const result = new arrayBuffer.constructor(arrayBuffer.byteLength) 3 | new Uint8Array(result).set(new Uint8Array(arrayBuffer)) 4 | return result 5 | } 6 | -------------------------------------------------------------------------------- /libs/lodash/_cloneDataView.ts: -------------------------------------------------------------------------------- 1 | import { cloneArrayBuffer } from './_cloneArrayBuffer' 2 | 3 | export function cloneDataView(dataView: any, isDeep: any) { 4 | const buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer 5 | return new dataView.constructor( 6 | buffer, 7 | dataView.byteOffset, 8 | dataView.byteLength 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/_cloneMap.ts: -------------------------------------------------------------------------------- 1 | import { addMapEntry } from './_addMapEntry' 2 | import { arrayReduce } from './_arrayReduce' 3 | import { mapToArray } from './_mapToArray' 4 | 5 | export function cloneMap(map: any, isDeep: any, cloneFunc: any) { 6 | const array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map) 7 | return arrayReduce(array, addMapEntry, new map.constructor()) 8 | } 9 | -------------------------------------------------------------------------------- /libs/lodash/_cloneRegExp.ts: -------------------------------------------------------------------------------- 1 | const reFlags = /\w*$/ 2 | 3 | /** 4 | * Creates a clone of `regexp`. 5 | * 6 | * @private 7 | * @param {Object} regexp The regexp to clone. 8 | * @returns {Object} Returns the cloned regexp. 9 | */ 10 | export function cloneRegExp(regexp: any) { 11 | const result = new regexp.constructor(regexp.source, reFlags.exec(regexp)) 12 | result.lastIndex = regexp.lastIndex 13 | return result 14 | } 15 | -------------------------------------------------------------------------------- /libs/lodash/_cloneSet.ts: -------------------------------------------------------------------------------- 1 | import { addSetEntry } from './_addSetEntry' 2 | import { arrayReduce } from './_arrayReduce' 3 | import { setToArray } from './_setToArray' 4 | 5 | export function cloneSet(set: any, isDeep: any, cloneFunc: any) { 6 | const array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set) 7 | return arrayReduce(array, addSetEntry, new set.constructor()) 8 | } 9 | -------------------------------------------------------------------------------- /libs/lodash/_cloneSymbol.ts: -------------------------------------------------------------------------------- 1 | const symbolProto = Symbol ? Symbol.prototype : undefined, 2 | symbolValueOf = symbolProto ? symbolProto.valueOf : undefined 3 | 4 | export function cloneSymbol(symbol: any) { 5 | return symbolValueOf ? new Object(symbolValueOf.call(symbol)) : {} 6 | } 7 | -------------------------------------------------------------------------------- /libs/lodash/_cloneTypedArray.ts: -------------------------------------------------------------------------------- 1 | import { cloneArrayBuffer } from './_cloneArrayBuffer' 2 | 3 | export function cloneTypedArray(typedArray: any, isDeep: any) { 4 | const buffer = isDeep 5 | ? cloneArrayBuffer(typedArray.buffer) 6 | : typedArray.buffer 7 | return new typedArray.constructor( 8 | buffer, 9 | typedArray.byteOffset, 10 | typedArray.length 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /libs/lodash/_copyArray.ts: -------------------------------------------------------------------------------- 1 | export function copyArray(source: any, array: any) { 2 | let index = -1 3 | const length = source.length 4 | 5 | array || (array = Array.from({ length })) 6 | while (++index < length) { 7 | array[index] = source[index] 8 | } 9 | return array 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/_copyObject.ts: -------------------------------------------------------------------------------- 1 | import { assignValue } from './_assignValue' 2 | 3 | export function copyObject( 4 | source: any, 5 | props: any, 6 | object: any, 7 | customizer?: any 8 | ) { 9 | object || (object = {}) 10 | 11 | let index = -1 12 | const length = props.length 13 | 14 | while (++index < length) { 15 | const key = props[index] 16 | 17 | let newValue = customizer 18 | ? customizer(object[key], source[key], key, object, source) 19 | : undefined 20 | 21 | if (newValue === undefined) { 22 | newValue = source[key] 23 | } 24 | assignValue(object, key, newValue) 25 | } 26 | return object 27 | } 28 | -------------------------------------------------------------------------------- /libs/lodash/_copySymbols.ts: -------------------------------------------------------------------------------- 1 | import { copyObject } from './_copyObject' 2 | import { getSymbols } from './_getSymbol' 3 | 4 | export function copySymbols(source: any, object: any) { 5 | return copyObject(source, getSymbols(source) as unknown as any, object) 6 | } 7 | -------------------------------------------------------------------------------- /libs/lodash/_eq.ts: -------------------------------------------------------------------------------- 1 | export function eq(value: any, other: any) { 2 | return value === other || (value !== value && other !== other) 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/_getSymbol.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable prefer-arrow-callback */ 2 | /* eslint-disable indent */ 3 | import { arrayFilter } from './_arrayFilter' 4 | import { stubArray } from './stubArray' 5 | 6 | const objectProto = Object.prototype 7 | 8 | const propertyIsEnumerable = objectProto.propertyIsEnumerable 9 | 10 | const nativeGetSymbols = Object.getOwnPropertySymbols 11 | 12 | const getSymbols = !nativeGetSymbols 13 | ? stubArray 14 | : function (object: any) { 15 | if (object == null) return [] 16 | object = new Object(object) 17 | return arrayFilter(nativeGetSymbols(object), function (symbol: any) { 18 | return propertyIsEnumerable.call(object, symbol) 19 | }) 20 | } 21 | 22 | export { getSymbols } 23 | -------------------------------------------------------------------------------- /libs/lodash/_hasUnicode.ts: -------------------------------------------------------------------------------- 1 | const rsAstralRange = '\\ud800-\\udfff', 2 | rsComboMarksRange = '\\u0300-\\u036f', 3 | reComboHalfMarksRange = '\\ufe20-\\ufe2f', 4 | rsComboSymbolsRange = '\\u20d0-\\u20ff', 5 | rsComboRange = 6 | rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 7 | rsVarRange = '\\ufe0e\\ufe0f' 8 | 9 | /** Used to compose unicode capture groups. */ 10 | const rsZWJ = '\\u200d' 11 | 12 | /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ 13 | // eslint-disable-next-line no-misleading-character-class 14 | const reHasUnicode = new RegExp( 15 | `[${rsZWJ}${rsAstralRange}${rsComboRange}${rsVarRange}]` 16 | ) 17 | 18 | export function hasUnicode(string: string) { 19 | return reHasUnicode.test(string) 20 | } 21 | -------------------------------------------------------------------------------- /libs/lodash/_initCloneArray.ts: -------------------------------------------------------------------------------- 1 | const objectProto = Object.prototype 2 | const hasOwnProperty = objectProto.hasOwnProperty 3 | 4 | export function initCloneArray(array: any) { 5 | const length = array.length 6 | const result = new array.constructor(length) 7 | 8 | // Add properties assigned by `RegExp#exec`. 9 | if ( 10 | length && 11 | typeof array[0] == 'string' && 12 | hasOwnProperty.call(array, 'index') 13 | ) { 14 | result.index = array.index 15 | result.input = array.input 16 | } 17 | return result 18 | } 19 | -------------------------------------------------------------------------------- /libs/lodash/_initCloneObject.ts: -------------------------------------------------------------------------------- 1 | import { isPrototype } from './_isPrototype' 2 | import { isObject } from './is-object' 3 | 4 | function overArg(func: any, transform: any) { 5 | return function (arg: any) { 6 | return func(transform(arg)) 7 | } 8 | } 9 | 10 | const getPrototype = overArg(Object.getPrototypeOf, Object) 11 | 12 | function baseCreate(proto: any) { 13 | return isObject(proto) ? objectCreate(proto) : {} 14 | } 15 | 16 | const objectCreate = Object.create 17 | 18 | export function initCloneObject(object: any) { 19 | return typeof object.constructor == 'function' && !isPrototype(object) 20 | ? baseCreate(getPrototype(object)) 21 | : {} 22 | } 23 | -------------------------------------------------------------------------------- /libs/lodash/_isHostObject.ts: -------------------------------------------------------------------------------- 1 | export function isHostObject(value: any) { 2 | let result = false 3 | if (value != null && typeof value.toString != 'function') { 4 | try { 5 | result = !!`${value}` 6 | } catch (e) {} 7 | } 8 | return result 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_isIndex.ts: -------------------------------------------------------------------------------- 1 | import { MAX_SAFE_INTEGER, reIsUint } from './_common' 2 | 3 | export function isIndex(value: any, length?: any) { 4 | length = length == null ? MAX_SAFE_INTEGER : length 5 | return ( 6 | !!length && 7 | (typeof value == 'number' || reIsUint.test(value)) && 8 | value > -1 && 9 | value % 1 == 0 && 10 | value < length 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /libs/lodash/_isKey.ts: -------------------------------------------------------------------------------- 1 | import { isSymbol } from '@vue/shared' 2 | 3 | import { reIsDeepProp, reIsPlainProp } from './_common' 4 | 5 | import type { PropertyPath } from './_common' 6 | 7 | export function isKey(value: PropertyPath, object: any) { 8 | if (Array.isArray(value)) { 9 | return false 10 | } 11 | const type = typeof value 12 | if ( 13 | type == 'number' || 14 | type == 'symbol' || 15 | type == 'boolean' || 16 | value == null || 17 | isSymbol(value) 18 | ) { 19 | return true 20 | } 21 | return ( 22 | reIsPlainProp.test(value as string) || 23 | !reIsDeepProp.test(value as string) || 24 | // eslint-disable-next-line unicorn/new-for-builtins 25 | (object != null && (value as any) in Object(object)) 26 | ) 27 | } 28 | -------------------------------------------------------------------------------- /libs/lodash/_isPrototype.ts: -------------------------------------------------------------------------------- 1 | const objectProto = Object.prototype 2 | 3 | export function isPrototype(value: any) { 4 | const Ctor = value && value.constructor, 5 | proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto 6 | 7 | return value === proto 8 | } 9 | -------------------------------------------------------------------------------- /libs/lodash/_mapToArray.ts: -------------------------------------------------------------------------------- 1 | export function mapToArray(map: any) { 2 | let index = -1 3 | const result = Array.from({ length: map.size }) 4 | 5 | map.forEach((value: any, key: any) => { 6 | result[++index] = [key, value] 7 | }) 8 | return result 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_nativeKeys.ts: -------------------------------------------------------------------------------- 1 | import { overArg } from './_overArg' 2 | 3 | const nativeKeys = overArg(Object.keys, Object) 4 | 5 | export { nativeKeys } 6 | -------------------------------------------------------------------------------- /libs/lodash/_objectToString.ts: -------------------------------------------------------------------------------- 1 | const objectProto = Object.prototype 2 | 3 | export const objectToString = objectProto.toString 4 | -------------------------------------------------------------------------------- /libs/lodash/_overArg.ts: -------------------------------------------------------------------------------- 1 | export function overArg(func: any, transform: any) { 2 | return function (arg: any) { 3 | return func(transform(arg)) 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /libs/lodash/_setToArray.ts: -------------------------------------------------------------------------------- 1 | export function setToArray(set: any) { 2 | let index = -1 3 | const result = Array.from({ length: set.size }) 4 | 5 | set.forEach((value: any) => { 6 | result[++index] = value 7 | }) 8 | return result 9 | } 10 | -------------------------------------------------------------------------------- /libs/lodash/_strictIndexOf.ts: -------------------------------------------------------------------------------- 1 | export function strictIndexOf( 2 | array: string[], 3 | value: string, 4 | fromIndex: number 5 | ) { 6 | let index = fromIndex - 1 7 | const length = array.length 8 | 9 | while (++index < length) { 10 | if (array[index] === value) { 11 | return index 12 | } 13 | } 14 | return -1 15 | } 16 | -------------------------------------------------------------------------------- /libs/lodash/_stringToArray.ts: -------------------------------------------------------------------------------- 1 | import { asciiToArray } from './_asciiToArray' 2 | import { hasUnicode } from './_hasUnicode' 3 | import { unicodeToArray } from './_unicodeToArray' 4 | 5 | export function stringToArray(string: string) { 6 | return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string) 7 | } 8 | -------------------------------------------------------------------------------- /libs/lodash/_stringToPath.ts: -------------------------------------------------------------------------------- 1 | import { toString } from './_toString' 2 | import { reEscapeChar, reLeadingDot, rePropName } from './_common' 3 | 4 | import type { PropertyName } from './_common' 5 | 6 | export const stringToPath = function (string: PropertyName) { 7 | string = toString(string) 8 | 9 | const result = [] 10 | if (reLeadingDot.test(string)) { 11 | result.push('') 12 | } 13 | string.replace( 14 | rePropName, 15 | (match: string, number: any, quote: any, string: any) => { 16 | result.push(quote ? string.replace(reEscapeChar, '$1') : number || match) 17 | return '' 18 | } 19 | ) 20 | return result 21 | } 22 | -------------------------------------------------------------------------------- /libs/lodash/_toKey.ts: -------------------------------------------------------------------------------- 1 | import { isSymbol } from '@vue/shared' 2 | import { INFINITY } from './_common' 3 | 4 | export function toKey(value: any) { 5 | if (typeof value == 'string' || isSymbol(value)) { 6 | return value 7 | } 8 | const result = `${value}` 9 | return result == '0' && 1 / value == -INFINITY ? '-0' : result 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/_toSource.ts: -------------------------------------------------------------------------------- 1 | const funcProto = Function.prototype 2 | const funcToString = funcProto.toString 3 | 4 | export function toSource(func: any) { 5 | if (func != null) { 6 | try { 7 | return funcToString.call(func) 8 | } catch (e) {} 9 | try { 10 | return `${func}` 11 | } catch (e) {} 12 | } 13 | return '' 14 | } 15 | -------------------------------------------------------------------------------- /libs/lodash/_toString.ts: -------------------------------------------------------------------------------- 1 | import { baseToString } from './_baseToString' 2 | 3 | import type { PropertyName } from './_common' 4 | 5 | export function toString(value: PropertyName) { 6 | return value == null ? '' : baseToString(value) 7 | } 8 | -------------------------------------------------------------------------------- /libs/lodash/_trimmedEndIndex.ts: -------------------------------------------------------------------------------- 1 | const reWhitespace = /\s/ 2 | 3 | export function trimmedEndIndex(string: string) { 4 | let index = string.length 5 | 6 | while (index-- && reWhitespace.test(string.charAt(index))) { 7 | /* empty */ 8 | } 9 | return index 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/cast-array.ts: -------------------------------------------------------------------------------- 1 | import type { Many } from './_common' 2 | 3 | export function castArray(value: Many): T[] { 4 | if (!value || (Array.isArray(value) && !value.length)) { 5 | return [] 6 | } 7 | return Array.isArray(value) ? value : [value as T] 8 | } 9 | -------------------------------------------------------------------------------- /libs/lodash/from-pairs.ts: -------------------------------------------------------------------------------- 1 | type List = ArrayLike 2 | type PropertyName = string | number | symbol 3 | interface Dictionary { 4 | [index: string]: T 5 | } 6 | 7 | export function fromPairs( 8 | pairs: List<[PropertyName, T]> | null | undefined 9 | ): Dictionary 10 | export function fromPairs( 11 | pairs: List | null | undefined 12 | ): Dictionary { 13 | const result = {} 14 | if (pairs == null) { 15 | return result 16 | } 17 | for (const pair of pairs) { 18 | result[pair[0]] = pair[1] 19 | } 20 | return result 21 | } 22 | -------------------------------------------------------------------------------- /libs/lodash/get.ts: -------------------------------------------------------------------------------- 1 | import { isKey } from './_isKey' 2 | import { castPath } from './_castPath' 3 | import { toKey } from './_toKey' 4 | 5 | import type { PropertyPath } from './_common' 6 | 7 | function baseGet(object: any, path: PropertyPath) { 8 | path = isKey(path, object) ? [path] : castPath(path) 9 | 10 | let index = 0 11 | const length = path.length 12 | 13 | while (object != null && index < length) { 14 | object = object[toKey(path[index++])] 15 | } 16 | return index && index == length ? object : undefined 17 | } 18 | 19 | export function get(object: any, path: PropertyPath, defaultValue?: any): any { 20 | const result = object == null ? undefined : baseGet(object, path) 21 | return result === undefined ? defaultValue : result 22 | } 23 | -------------------------------------------------------------------------------- /libs/lodash/index.ts: -------------------------------------------------------------------------------- 1 | export { fromPairs } from './from-pairs' 2 | export { isNil } from './is-nil' 3 | export { isBoolean } from './is-boolean' 4 | export { isNumber } from './is-number' 5 | export { get } from './get' 6 | export { set } from './set' 7 | export { debounce } from './debounce' 8 | export { throttle } from './throttle' 9 | export { castArray } from './cast-array' 10 | export { trim } from './trim' 11 | -------------------------------------------------------------------------------- /libs/lodash/is-arguments.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable indent */ 2 | import { baseIsArguments } from './_baseIsArguments' 3 | import { isObjectLike } from './is-object-like' 4 | 5 | const objectProto = Object.prototype 6 | 7 | const hasOwnProperty = objectProto.hasOwnProperty 8 | 9 | const propertyIsEnumerable = objectProto.propertyIsEnumerable 10 | 11 | const isArguments = baseIsArguments( 12 | (function () { 13 | // eslint-disable-next-line prefer-rest-params 14 | return arguments 15 | })() 16 | ) 17 | ? baseIsArguments 18 | : function (value: any) { 19 | return ( 20 | isObjectLike(value) && 21 | hasOwnProperty.call(value, 'callee') && 22 | !propertyIsEnumerable.call(value, 'callee') 23 | ) 24 | } 25 | 26 | export { isArguments } 27 | -------------------------------------------------------------------------------- /libs/lodash/is-array-like.ts: -------------------------------------------------------------------------------- 1 | import { isFunction } from './is-function' 2 | import { isLength } from './is-length' 3 | 4 | export function isArrayLike(value: any) { 5 | return value != null && isLength(value.length) && !isFunction(value) 6 | } 7 | -------------------------------------------------------------------------------- /libs/lodash/is-array.ts: -------------------------------------------------------------------------------- 1 | export function isArray(value: any) { 2 | return Array.isArray(value) 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/is-boolean.ts: -------------------------------------------------------------------------------- 1 | import { isObjectLike } from './is-object-like' 2 | import { objectToString } from './_objectToString' 3 | 4 | const boolTag = '[object Boolean]' 5 | 6 | export function isBoolean(value?: any): value is boolean { 7 | return ( 8 | value === true || 9 | value === false || 10 | (isObjectLike(value) && objectToString.call(value) == boolTag) 11 | ) 12 | } 13 | -------------------------------------------------------------------------------- /libs/lodash/is-function.ts: -------------------------------------------------------------------------------- 1 | import { baseGetTag } from './_baseGetTag' 2 | import { isObject } from './is-object' 3 | 4 | const asyncTag = '[object AsyncFunction]', 5 | funcTag = '[object Function]', 6 | genTag = '[object GeneratorFunction]', 7 | proxyTag = '[object Proxy]' 8 | 9 | export function isFunction(value: any) { 10 | if (!isObject(value)) { 11 | return false 12 | } 13 | 14 | const tag = baseGetTag(value) 15 | return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag 16 | } 17 | -------------------------------------------------------------------------------- /libs/lodash/is-length.ts: -------------------------------------------------------------------------------- 1 | import { MAX_SAFE_INTEGER } from './_common' 2 | 3 | export function isLength(value: any) { 4 | return ( 5 | typeof value == 'number' && 6 | value > -1 && 7 | value % 1 == 0 && 8 | value <= MAX_SAFE_INTEGER 9 | ) 10 | } 11 | -------------------------------------------------------------------------------- /libs/lodash/is-nil.ts: -------------------------------------------------------------------------------- 1 | export function isNil(value: any): value is null | undefined { 2 | return value == null 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/is-number.ts: -------------------------------------------------------------------------------- 1 | import { isObjectLike } from './is-object-like' 2 | import { objectToString } from './_objectToString' 3 | 4 | const numberTag = '[object Number]' 5 | 6 | export function isNumber(value?: any): value is number { 7 | return ( 8 | typeof value == 'number' || 9 | (isObjectLike(value) && objectToString.call(value) == numberTag) 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /libs/lodash/is-object-like.ts: -------------------------------------------------------------------------------- 1 | export function isObjectLike(value?: any): boolean { 2 | return value != null && typeof value == 'object' 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/is-object.ts: -------------------------------------------------------------------------------- 1 | export function isObject(value: any) { 2 | const type = typeof value 3 | return value != null && (type == 'object' || type == 'function') 4 | } 5 | -------------------------------------------------------------------------------- /libs/lodash/keys.ts: -------------------------------------------------------------------------------- 1 | import { arrayLikeKeys } from './_arrayLikeKeys' 2 | import { baseKeys } from './_baseKeys' 3 | import { isArrayLike } from './is-array-like' 4 | 5 | export function keys(object: any) { 6 | return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object) 7 | } 8 | -------------------------------------------------------------------------------- /libs/lodash/stubArray.ts: -------------------------------------------------------------------------------- 1 | export function stubArray() { 2 | return [] 3 | } 4 | -------------------------------------------------------------------------------- /libs/lodash/throttle.ts: -------------------------------------------------------------------------------- 1 | import { isObject } from '@vue/shared' 2 | import { debounce } from './debounce' 3 | 4 | import type { DebouncedFunc, ThrottleSettings } from './_common' 5 | 6 | const FUNC_ERROR_TEXT = 'Expected a function' 7 | 8 | export function throttle any>( 9 | func: T, 10 | wait?: number, 11 | options?: ThrottleSettings 12 | ): DebouncedFunc { 13 | let leading = true, 14 | trailing = true 15 | 16 | if (typeof func != 'function') { 17 | throw new TypeError(FUNC_ERROR_TEXT) 18 | } 19 | if (isObject(options)) { 20 | leading = 'leading' in options ? !!options.leading : leading 21 | trailing = 'trailing' in options ? !!options.trailing : trailing 22 | } 23 | return debounce(func, wait, { 24 | leading, 25 | maxWait: wait, 26 | trailing, 27 | }) 28 | } 29 | -------------------------------------------------------------------------------- /theme-chalk/mixins/config.scss: -------------------------------------------------------------------------------- 1 | $namespace: 'tn' !default; 2 | $common-separator: '-' !default; 3 | $element-separator: '__' !default; 4 | $modifier-separator: '--' !default; 5 | $state-prefix: 'is-' !default; 6 | -------------------------------------------------------------------------------- /theme-chalk/src/avatar-group.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(avatar-group) { 4 | display: flex; 5 | align-items: center; 6 | 7 | position: relative; 8 | width: fit-content; 9 | } 10 | -------------------------------------------------------------------------------- /theme-chalk/src/checkbox-group.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(checkbox-group) { 4 | position: relative; 5 | width: 100%; 6 | 7 | display: flex; 8 | flex-wrap: wrap; 9 | 10 | @include when(wrap) { 11 | display: block; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /theme-chalk/src/circle-progress.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(circle-progress) { 4 | position: relative; 5 | 6 | /* canvas 进度条 start */ 7 | @include e(canvas) { 8 | position: absolute; 9 | width: 100%; 10 | height: 100%; 11 | left: 50%; 12 | top: 50%; 13 | transform: translate(-50%, -50%); 14 | } 15 | /* canvas 进度条 end */ 16 | 17 | /* 进度值 start */ 18 | @include e(precent-value) { 19 | position: absolute; 20 | left: 50%; 21 | top: 50%; 22 | transform: translate(-50%, -50%); 23 | } 24 | /* 进度值 end */ 25 | } 26 | -------------------------------------------------------------------------------- /theme-chalk/src/collapse.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(collapse) { 4 | position: relative; 5 | width: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /theme-chalk/src/column-notice-bar.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(column-notice-bar) { 4 | position: relative; 5 | 6 | width: 100%; 7 | height: auto; 8 | 9 | @include e(swiper) { 10 | position: relative; 11 | width: 100%; 12 | height: 1em; 13 | } 14 | 15 | @include e(swiper-item) { 16 | position: relative; 17 | width: 100%; 18 | line-height: 1.1em; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /theme-chalk/src/count-scroll.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(count-scroll) { 4 | display: inline-block; 5 | height: 1em; 6 | overflow: hidden; 7 | 8 | @include e(wrapper) { 9 | height: 1em; 10 | display: flex; 11 | align-items: flex-start; 12 | } 13 | 14 | @include e(column) { 15 | height: auto; 16 | display: flex; 17 | flex-direction: column; 18 | align-items: center; 19 | 20 | transform: translateY(0%); 21 | 22 | transition-property: transform; 23 | transition-timing-function: ease; 24 | 25 | @include m(item) { 26 | line-height: 1; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /theme-chalk/src/count-to.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(count-to) { 4 | display: inline-block; 5 | } 6 | -------------------------------------------------------------------------------- /theme-chalk/src/form.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins' as *; 2 | 3 | @include b(form) { 4 | display: block; 5 | position: relative; 6 | width: 100%; 7 | } 8 | -------------------------------------------------------------------------------- /theme-chalk/src/notice-bar.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(notice-bar) { 4 | position: relative; 5 | 6 | width: 100%; 7 | padding: 10rpx 20rpx; 8 | 9 | display: flex; 10 | align-items: center; 11 | 12 | /* 左图标 start */ 13 | @include e(left-icon) { 14 | padding-right: 20rpx; 15 | } 16 | /* 左图标 end */ 17 | /* 右图标 start */ 18 | @include e(right-icon) { 19 | padding-left: 20rpx; 20 | } 21 | /* 右图标 end */ 22 | 23 | /* 内容区域 */ 24 | @include e(content) { 25 | flex-grow: 1; 26 | flex-shrink: 1; 27 | overflow: hidden; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /theme-chalk/src/overlay.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(overlay) { 4 | position: fixed; 5 | top: 0; 6 | left: 0; 7 | right: 0; 8 | bottom: 0; 9 | transition-property: all; 10 | transition-timing-function: ease; 11 | visibility: hidden; 12 | opacity: 0; 13 | 14 | @include m(show) { 15 | opacity: 1; 16 | visibility: visible; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /theme-chalk/src/photo-album.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(photo-album) { 4 | position: relative; 5 | width: 100%; 6 | display: flex; 7 | flex-wrap: wrap; 8 | 9 | /* 容器 start */ 10 | @include e(container) { 11 | flex-grow: 0; 12 | flex-shrink: 0; 13 | position: relative; 14 | height: 0; 15 | margin: 10rpx 20rpx 10rpx 0rpx; 16 | } 17 | /* 容器 end */ 18 | 19 | /* item start */ 20 | @include e(item) { 21 | position: absolute; 22 | left: 0; 23 | top: 0; 24 | width: 100%; 25 | height: 100%; 26 | border-radius: 15rpx; 27 | background-color: var(--tn-color-gray-light); 28 | 29 | &__image { 30 | width: 100%; 31 | height: 100%; 32 | border-radius: inherit; 33 | } 34 | } 35 | /* item end */ 36 | } 37 | -------------------------------------------------------------------------------- /theme-chalk/src/radio-group.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b('radio-group') { 4 | position: relative; 5 | width: 100%; 6 | 7 | display: flex; 8 | flex-wrap: wrap; 9 | 10 | @include when(wrap) { 11 | display: block; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /theme-chalk/src/row-notice-bar.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(row-notice-bar) { 4 | position: relative; 5 | width: auto; 6 | min-width: 0; 7 | padding-left: 100%; 8 | 9 | color: inherit; 10 | background-color: transparent; 11 | 12 | @include e(value) { 13 | display: inline; 14 | word-break: keep-all; 15 | white-space: nowrap; 16 | width: auto; 17 | min-width: 0; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /theme-chalk/src/steps.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(steps) { 4 | position: relative; 5 | 6 | width: 100%; 7 | 8 | display: flex; 9 | flex-wrap: nowrap; 10 | } 11 | -------------------------------------------------------------------------------- /theme-chalk/src/sticky.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(sticky) { 4 | /* #ifdef APP-VUE || MP-WEIXIN */ 5 | position: sticky; 6 | /* #endif */ 7 | 8 | @include e(content) { 9 | width: 100%; 10 | z-index: inherit; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /theme-chalk/src/subsection-item.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(subsection-item) { 4 | position: relative; 5 | flex: 1; 6 | padding: 10rpx; 7 | 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | 12 | transition: color 0.3s ease; 13 | 14 | /* 分段器模式 start */ 15 | @include m(default) { 16 | border-right-width: 1rpx; 17 | border-right-style: solid; 18 | 19 | &:last-of-type { 20 | border: none; 21 | } 22 | } 23 | /* 分段器模式 end */ 24 | 25 | /* 禁止选中 */ 26 | @include when(disabled) { 27 | opacity: 0.4; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /theme-chalk/src/swipe-action.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(swipe-action) { 4 | position: relative; 5 | width: 100%; 6 | } 7 | -------------------------------------------------------------------------------- /theme-chalk/src/water-fall.scss: -------------------------------------------------------------------------------- 1 | @use '../mixins/mixins.scss' as *; 2 | 3 | @include b(water-fall) { 4 | position: relative; 5 | width: 100%; 6 | display: flex; 7 | flex-wrap: wrap; 8 | 9 | /* 左右两边容器 start */ 10 | @include e(container) { 11 | width: calc(100% / 2); 12 | height: fit-content; 13 | } 14 | /* 左右两边容器 end */ 15 | } 16 | -------------------------------------------------------------------------------- /theme-chalk/var/size.scss: -------------------------------------------------------------------------------- 1 | // 图鸟内置尺寸 2 | $tn-inner-sizes: sm, lg, xl; 3 | 4 | // form表单尺寸 5 | $tn-form-sizes: sm, lg; 6 | -------------------------------------------------------------------------------- /tokens/avatar.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { AvatarGroupProps } from '../components' 3 | 4 | export type AvatarContext = { 5 | uid: number 6 | } 7 | 8 | export type AvatarGroupContext = AvatarGroupProps & { 9 | avatarItems: AvatarContext[] 10 | addItem: (item: AvatarContext) => void 11 | removeItem: (uid: number) => void 12 | handleItemClick: (uid: number) => void 13 | } 14 | 15 | export const avatarGroupContextKey: InjectionKey = Symbol( 16 | 'avatarGroupContextKey' 17 | ) 18 | -------------------------------------------------------------------------------- /tokens/checkbox.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { CheckboxGroupProps, CheckboxGroupValueType } from '../components' 3 | 4 | export interface CheckboxGroupContext extends CheckboxGroupProps { 5 | changeEvent: (val: CheckboxGroupValueType[number]) => void 6 | } 7 | 8 | export const checkboxGroupKey: InjectionKey = 9 | Symbol('checkboxGroupKey') 10 | -------------------------------------------------------------------------------- /tokens/collapse.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { CollapseProps } from '../components/collapse' 3 | 4 | export type CollapseItemContext = { 5 | uid: number 6 | } 7 | 8 | export type CollapseContext = Pick< 9 | CollapseProps, 10 | 'showArrow' | 'arrowColor' 11 | > & { 12 | items: CollapseItemContext[] 13 | addItem: (item: CollapseItemContext) => void 14 | removeItem: (uid: number) => void 15 | activeUid: number[] 16 | handleItemClick: (uid: number) => void 17 | } 18 | 19 | export const collapseContextKey: InjectionKey = 20 | Symbol('collapseContextKey') 21 | -------------------------------------------------------------------------------- /tokens/form.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { FormContext, FormItemContext } from '../components' 3 | 4 | export const formContextKey: InjectionKey = 5 | Symbol('formContextKey') 6 | export const formItemContextKey: InjectionKey = 7 | Symbol('formItemContextKey') 8 | -------------------------------------------------------------------------------- /tokens/index.ts: -------------------------------------------------------------------------------- 1 | export * from './avatar' 2 | export * from './checkbox' 3 | export * from './form' 4 | export * from './radio' 5 | export * from './tabbar' 6 | export * from './tabs' 7 | export * from './steps' 8 | export * from './notice-bar' 9 | export * from './collapse' 10 | export * from './swipe-action' 11 | export * from './subsection' 12 | -------------------------------------------------------------------------------- /tokens/notice-bar.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { NoticeBarProps } from '../components/notice-bar' 3 | 4 | export type NoticeBarContext = NoticeBarProps & { 5 | play: boolean 6 | click: (index: number) => void 7 | } 8 | 9 | export const noticeBarKey: InjectionKey = Symbol('noticeBar') 10 | -------------------------------------------------------------------------------- /tokens/radio.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { RadioGroupProps } from '../components' 3 | 4 | export interface RadioGroupContext extends RadioGroupProps { 5 | changeEvent: (val: RadioGroupProps['modelValue']) => void 6 | } 7 | 8 | export const radioGroupKey: InjectionKey = 9 | Symbol('radioGroupKey') 10 | -------------------------------------------------------------------------------- /tokens/steps.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { StepsProps } from '../components/steps' 3 | 4 | export type StepContext = { 5 | uid: number 6 | } 7 | 8 | export type StepsContext = StepsProps & { 9 | items: StepContext[] 10 | activeUidList: number[] 11 | addItem: (item: StepContext) => void 12 | removeItem: (uid: number) => void 13 | setActiveItem: (uid: number) => void 14 | } 15 | 16 | export const stepsContextKey: InjectionKey = 17 | Symbol('stepsContextKey') 18 | -------------------------------------------------------------------------------- /tokens/subsection.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { 3 | SubsectionItemProps, 4 | SubsectionItemRect, 5 | SubsectionProps, 6 | } from '../components/subsection' 7 | 8 | export type SubsectionItemContext = SubsectionItemProps & { 9 | uid: number 10 | element: SubsectionItemRect 11 | } 12 | 13 | export type SubsectionContext = SubsectionProps & { 14 | items: SubsectionItemContext[] 15 | activeUid: number 16 | addItem: (item: SubsectionItemContext) => void 17 | removeItem: (uid: number) => void 18 | setActiveItem: (uid: number) => void 19 | } 20 | 21 | export const subsectionContextKey: InjectionKey = Symbol( 22 | 'subsectionContextKey' 23 | ) 24 | -------------------------------------------------------------------------------- /tokens/swipe-action.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { SwipeActionProps } from '../components' 3 | 4 | export type SwipeActionItemContext = { 5 | uid: number 6 | } 7 | 8 | export type SwiperActionContext = SwipeActionProps & { 9 | items: SwipeActionItemContext[] 10 | activeUid: number[] 11 | addItem: (item: SwipeActionItemContext) => void 12 | removeItem: (uid: number) => void 13 | setActiveItem: (uid: number) => void 14 | closeAllItemOption: () => void 15 | optionClick: (uid: number, optionIndex: number) => void 16 | } 17 | 18 | export const swipeActionContextKey: InjectionKey = Symbol( 19 | 'swipeActionContextKey' 20 | ) 21 | -------------------------------------------------------------------------------- /tokens/tabbar.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { TabbarItemRect, TabbarProps } from '../components/tabbar' 3 | 4 | export type TabbarItemContext = { 5 | uid: number 6 | name?: string | number 7 | } 8 | 9 | export type TabbarContext = TabbarProps & { 10 | items: TabbarItemContext[] 11 | activeUid: number 12 | addItem: (item: TabbarItemContext) => void 13 | removeItem: (uid: number) => void 14 | setActiveItem: (uid: number) => void 15 | setBulgeCircle: (rect: TabbarItemRect) => void 16 | } 17 | 18 | export const tabbarContextKey: InjectionKey = 19 | Symbol('tabbarContextKey') 20 | -------------------------------------------------------------------------------- /tokens/tabs.ts: -------------------------------------------------------------------------------- 1 | import type { InjectionKey } from 'vue' 2 | import type { TabsItemRect, TabsProps } from '../components/tabs' 3 | 4 | export type TabsItemContext = { 5 | uid: number 6 | elementRect: TabsItemRect 7 | name?: string | number 8 | } 9 | 10 | export type TabsContext = TabsProps & { 11 | items: TabsItemContext[] 12 | activeUid: number 13 | showBar: boolean 14 | addItem: (item: TabsItemContext) => void 15 | removeItem: (uid: number) => void 16 | setActiveItem: (uid: number) => void 17 | } 18 | 19 | export const tabsContextKey: InjectionKey = 20 | Symbol('tabsContextKey') 21 | -------------------------------------------------------------------------------- /utils/dom/index.ts: -------------------------------------------------------------------------------- 1 | export * from './unit' 2 | export * from './select-query' 3 | -------------------------------------------------------------------------------- /utils/dom/unit.ts: -------------------------------------------------------------------------------- 1 | import { isString } from '../types' 2 | 3 | /** 4 | * 格式化dom的尺寸单位 5 | * @param value 待处理的值 6 | * @param unit 默认单位 7 | * @param empty 是否返回空值 8 | * @returns 处理后的值 9 | */ 10 | export const formatDomSizeValue = ( 11 | value: string | number, 12 | unit = 'rpx', 13 | empty = true 14 | ): string => { 15 | if (!value) return empty ? '' : `0${unit}` 16 | if (isString(value) && /(^calc)|(%|vw|vh|px|rpx|auto)$/.test(value as string)) 17 | return value as string 18 | return `${value}${unit}` 19 | } 20 | -------------------------------------------------------------------------------- /utils/error.ts: -------------------------------------------------------------------------------- 1 | import { isString } from '@vue/shared' 2 | 3 | class TuniaoUIError extends Error { 4 | constructor(message: string) { 5 | super(message) 6 | this.name = 'TuniaoUIError' 7 | } 8 | } 9 | 10 | export function throwError(scope: string, msg: string): never { 11 | throw new TuniaoUIError(`[${scope}] ${msg}`) 12 | } 13 | 14 | export function debugWarn(err: Error): void 15 | export function debugWarn(scope: string, message: string): void 16 | export function debugWarn(scope: string | Error, message?: string): void { 17 | if (process.env.NODE_ENV !== 'production') { 18 | const error: Error = isString(scope) 19 | ? new TuniaoUIError(`[${scope}] ${message}`) 20 | : scope 21 | // eslint-disable-next-line no-console 22 | console.warn(error) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /utils/index.ts: -------------------------------------------------------------------------------- 1 | export * from './vue' 2 | export * from './debounce' 3 | export * from './throttle' 4 | export * from './objects' 5 | export * from './types' 6 | export * from './typescript' 7 | export * from './dom' 8 | export * from './rand' 9 | export * from './uniapp' 10 | export * from './error' 11 | export * from './format' 12 | export * from './clone-deep' 13 | export * from './is-empty' 14 | -------------------------------------------------------------------------------- /utils/is-empty.ts: -------------------------------------------------------------------------------- 1 | export const isEmptyVariableInDefault = ( 2 | variable: any, 3 | defaultValue: any = undefined 4 | ): T => { 5 | return variable === undefined || variable === null ? defaultValue : variable 6 | } 7 | 8 | export const isEmptyDoubleVariableInDefault = ( 9 | variable1: any, 10 | variable2: any, 11 | defaultValue: any = undefined 12 | ): T => { 13 | return isEmptyVariableInDefault( 14 | variable1, 15 | isEmptyVariableInDefault(variable2, defaultValue) 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /utils/objects.ts: -------------------------------------------------------------------------------- 1 | import { get, set } from '../libs/lodash' 2 | import type { Entries } from 'type-fest' 3 | import type { Arrayable } from '.' 4 | 5 | export { hasOwn } from '@vue/shared' 6 | export const keysOf = (arr: T) => 7 | Object.keys(arr) as Array 8 | export const entriesOf = (arr: T) => 9 | Object.entries(arr) as Entries 10 | 11 | export const getProp = ( 12 | obj: Record, 13 | path: Arrayable, 14 | defaultValue?: any 15 | ): { value: T } => { 16 | return { 17 | get value() { 18 | return get(obj, path, defaultValue) 19 | }, 20 | set value(val: any) { 21 | set(obj, path, val) 22 | }, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /utils/rand.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * 生成0~10000的随机数 3 | */ 4 | export const generateId = (): number => Math.floor(Math.random() * 10000) 5 | 6 | /** 7 | * 生成随机数(0 ~ max) 8 | * @param max 最大值 9 | * @returns 随机数 10 | */ 11 | export const getRandomInt = (max: number) => 12 | Math.floor(Math.random() * Math.floor(max)) 13 | -------------------------------------------------------------------------------- /utils/typescript.ts: -------------------------------------------------------------------------------- 1 | export const mutable = >( 2 | val: T 3 | ) => val as Mutable 4 | export type Mutable = { -readonly [P in keyof T]: T[P] } 5 | 6 | export type HTMLElementCustomized = HTMLElement & T 7 | 8 | export type Nullable = T | null 9 | export type Arrayable = T | T[] 10 | export type Awaitable = T | Promise 11 | -------------------------------------------------------------------------------- /utils/uniapp/index.ts: -------------------------------------------------------------------------------- 1 | export * from './router' 2 | -------------------------------------------------------------------------------- /utils/vue/icon.ts: -------------------------------------------------------------------------------- 1 | import { definePropType } from './props' 2 | 3 | export const iconPropType = definePropType([String]) 4 | 5 | export const FormValidateIconsMap = { 6 | validating: 'loading', 7 | success: 'success-circle', 8 | error: 'close-circle', 9 | } 10 | -------------------------------------------------------------------------------- /utils/vue/index.ts: -------------------------------------------------------------------------------- 1 | export * from './typescript' 2 | export * from './install' 3 | export * from './props' 4 | export * from './icon' 5 | -------------------------------------------------------------------------------- /utils/vue/props/index.ts: -------------------------------------------------------------------------------- 1 | export * from './util' 2 | export * from './types' 3 | export * from './runtime' 4 | -------------------------------------------------------------------------------- /utils/vue/props/util.ts: -------------------------------------------------------------------------------- 1 | export type Writable = { -readonly [P in keyof T]: T[P] } 2 | export type WriteableArray = T extends readonly any[] ? Writable : T 3 | 4 | export type IfNever = [T] extends [never] ? Y : N 5 | 6 | export type IfUnknown = [unknown] extends [T] ? Y : N 7 | 8 | export type UnknowToNever = IfUnknown 9 | 10 | export {} 11 | -------------------------------------------------------------------------------- /utils/vue/typescript.ts: -------------------------------------------------------------------------------- 1 | import type { AppContext, Plugin, Ref } from 'vue' 2 | 3 | export type SFCWithInstall = T & Plugin 4 | 5 | export type SFCInstallWithContext = SFCWithInstall & { 6 | _content: AppContext | null 7 | } 8 | 9 | export type MaybeRef = T | Ref 10 | --------------------------------------------------------------------------------