@rdeam/qui 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/defineProperty.mjs +12 -0
- package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/toPrimitive.mjs +14 -0
- package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/toPropertyKey.mjs +9 -0
- package/es/_virtual/_@oxc-project_runtime@0.127.0/helpers/typeof.mjs +11 -0
- package/es/component.d.ts +3 -0
- package/es/component.mjs +39 -0
- package/es/component.mjs.map +1 -0
- package/es/components/date-picker/index.d.ts +6 -0
- package/es/components/date-picker/index.mjs +9 -0
- package/es/components/date-picker/index.mjs.map +1 -0
- package/es/components/date-picker/src/date-picker.d.ts +19 -0
- package/es/components/date-picker/src/date-picker.mjs +28 -0
- package/es/components/date-picker/src/date-picker.mjs.map +1 -0
- package/es/components/date-picker/src/date-picker.vue.d.ts +33 -0
- package/es/components/date-picker/src/date-picker.vue.mjs +7 -0
- package/es/components/date-picker/src/date-picker.vue.mjs.map +1 -0
- package/es/components/date-picker/src/date-picker.vue_vue_type_script_setup_true_lang.mjs +42 -0
- package/es/components/date-picker/src/date-picker.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/date-picker/src/instance.d.ts +2 -0
- package/es/components/date-picker/src/instance.mjs +0 -0
- package/es/components/date-picker/style/index.d.ts +1 -0
- package/es/components/descriptions/index.d.ts +6 -0
- package/es/components/descriptions/index.mjs +9 -0
- package/es/components/descriptions/index.mjs.map +1 -0
- package/es/components/descriptions/src/descriptions.d.ts +42 -0
- package/es/components/descriptions/src/descriptions.mjs +86 -0
- package/es/components/descriptions/src/descriptions.mjs.map +1 -0
- package/es/components/descriptions/src/idescriptions.d.ts +72 -0
- package/es/components/descriptions/src/idescriptions.mjs +55 -0
- package/es/components/descriptions/src/idescriptions.mjs.map +1 -0
- package/es/components/descriptions/src/instance.d.ts +2 -0
- package/es/components/descriptions/src/instance.mjs +0 -0
- package/es/components/descriptions/style/index.d.ts +1 -0
- package/es/components/ellipsis-tag/index.d.ts +6 -0
- package/es/components/ellipsis-tag/index.mjs +9 -0
- package/es/components/ellipsis-tag/index.mjs.map +1 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.d.ts +20 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.mjs +19 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.mjs.map +1 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.vue.d.ts +51 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.vue.mjs +7 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.vue.mjs.map +1 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.vue_vue_type_script_setup_true_lang.mjs +74 -0
- package/es/components/ellipsis-tag/src/ellipsis-tag.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/ellipsis-tag/src/instance.d.ts +2 -0
- package/es/components/ellipsis-tag/src/instance.mjs +0 -0
- package/es/components/ellipsis-tag/style/index.d.ts +1 -0
- package/es/components/empty/index.d.ts +6 -0
- package/es/components/empty/index.mjs +9 -0
- package/es/components/empty/index.mjs.map +1 -0
- package/es/components/empty/src/empty.d.ts +86 -0
- package/es/components/empty/src/empty.mjs +158 -0
- package/es/components/empty/src/empty.mjs.map +1 -0
- package/es/components/empty/src/iempty.d.ts +41 -0
- package/es/components/empty/src/iempty.mjs +44 -0
- package/es/components/empty/src/iempty.mjs.map +1 -0
- package/es/components/empty/src/instance.d.ts +2 -0
- package/es/components/empty/src/instance.mjs +0 -0
- package/es/components/empty/style/index.d.ts +1 -0
- package/es/components/index.d.ts +16 -0
- package/es/components/index.mjs +33 -0
- package/es/components/jdata-viewer/index.d.ts +6 -0
- package/es/components/jdata-viewer/index.mjs +9 -0
- package/es/components/jdata-viewer/index.mjs.map +1 -0
- package/es/components/jdata-viewer/src/ijdata-viewer.d.ts +40 -0
- package/es/components/jdata-viewer/src/ijdata-viewer.mjs +43 -0
- package/es/components/jdata-viewer/src/ijdata-viewer.mjs.map +1 -0
- package/es/components/jdata-viewer/src/instance.d.ts +2 -0
- package/es/components/jdata-viewer/src/instance.mjs +0 -0
- package/es/components/jdata-viewer/src/jdata-viewer.d.ts +87 -0
- package/es/components/jdata-viewer/src/jdata-viewer.mjs +125 -0
- package/es/components/jdata-viewer/src/jdata-viewer.mjs.map +1 -0
- package/es/components/jdata-viewer/src/use-view.d.ts +7 -0
- package/es/components/jdata-viewer/src/use-view.mjs +98 -0
- package/es/components/jdata-viewer/src/use-view.mjs.map +1 -0
- package/es/components/jdata-viewer/style/index.d.ts +1 -0
- package/es/components/radio/index.d.ts +6 -0
- package/es/components/radio/index.mjs +9 -0
- package/es/components/radio/index.mjs.map +1 -0
- package/es/components/radio/src/instance.d.ts +2 -0
- package/es/components/radio/src/instance.mjs +0 -0
- package/es/components/radio/src/radio.d.ts +16 -0
- package/es/components/radio/src/radio.mjs +37 -0
- package/es/components/radio/src/radio.mjs.map +1 -0
- package/es/components/radio/src/radio.vue.d.ts +25 -0
- package/es/components/radio/src/radio.vue.mjs +7 -0
- package/es/components/radio/src/radio.vue.mjs.map +1 -0
- package/es/components/radio/src/radio.vue_vue_type_script_setup_true_lang.mjs +44 -0
- package/es/components/radio/src/radio.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/radio/style/index.d.ts +1 -0
- package/es/components/remote-search/index.d.ts +6 -0
- package/es/components/remote-search/index.mjs +9 -0
- package/es/components/remote-search/index.mjs.map +1 -0
- package/es/components/remote-search/src/instance.d.ts +2 -0
- package/es/components/remote-search/src/instance.mjs +0 -0
- package/es/components/remote-search/src/iremote-search.d.ts +26 -0
- package/es/components/remote-search/src/iremote-search.mjs +94 -0
- package/es/components/remote-search/src/iremote-search.mjs.map +1 -0
- package/es/components/remote-search/src/remote-search.d.ts +72 -0
- package/es/components/remote-search/src/remote-search.mjs +191 -0
- package/es/components/remote-search/src/remote-search.mjs.map +1 -0
- package/es/components/remote-search/style/index.d.ts +1 -0
- package/es/components/search-form/index.d.ts +6 -0
- package/es/components/search-form/index.mjs +9 -0
- package/es/components/search-form/index.mjs.map +1 -0
- package/es/components/search-form/src/components/Grid/components/GridItem.vue.d.ts +33 -0
- package/es/components/search-form/src/components/Grid/components/GridItem.vue.mjs +7 -0
- package/es/components/search-form/src/components/Grid/components/GridItem.vue.mjs.map +1 -0
- package/es/components/search-form/src/components/Grid/components/GridItem.vue_vue_type_script_setup_true_lang.mjs +54 -0
- package/es/components/search-form/src/components/Grid/components/GridItem.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/search-form/src/components/Grid/index.vue.d.ts +28 -0
- package/es/components/search-form/src/components/Grid/index.vue.mjs +7 -0
- package/es/components/search-form/src/components/Grid/index.vue.mjs.map +1 -0
- package/es/components/search-form/src/components/Grid/index.vue_vue_type_script_setup_true_lang.mjs +62 -0
- package/es/components/search-form/src/components/Grid/index.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/search-form/src/components/Grid/interface/index.d.ts +5 -0
- package/es/components/search-form/src/components/Grid/interface/index.mjs +0 -0
- package/es/components/search-form/src/components/SearchFormItem.vue.d.ts +36 -0
- package/es/components/search-form/src/components/SearchFormItem.vue.mjs +7 -0
- package/es/components/search-form/src/components/SearchFormItem.vue.mjs.map +1 -0
- package/es/components/search-form/src/components/SearchFormItem.vue_vue_type_script_lang.mjs +103 -0
- package/es/components/search-form/src/components/SearchFormItem.vue_vue_type_script_lang.mjs.map +1 -0
- package/es/components/search-form/src/instance.d.ts +2 -0
- package/es/components/search-form/src/instance.mjs +0 -0
- package/es/components/search-form/src/isearch-form.d.ts +76 -0
- package/es/components/search-form/src/isearch-form.mjs +63 -0
- package/es/components/search-form/src/isearch-form.mjs.map +1 -0
- package/es/components/search-form/src/search-form.d.ts +55 -0
- package/es/components/search-form/src/search-form.mjs +319 -0
- package/es/components/search-form/src/search-form.mjs.map +1 -0
- package/es/components/search-form/style/index.d.ts +1 -0
- package/es/components/sticky-container/index.d.ts +6 -0
- package/es/components/sticky-container/index.mjs +9 -0
- package/es/components/sticky-container/index.mjs.map +1 -0
- package/es/components/sticky-container/src/instance.d.ts +2 -0
- package/es/components/sticky-container/src/instance.mjs +0 -0
- package/es/components/sticky-container/src/isticky-container.d.ts +4 -0
- package/es/components/sticky-container/src/isticky-container.mjs +8 -0
- package/es/components/sticky-container/src/isticky-container.mjs.map +1 -0
- package/es/components/sticky-container/src/sticky-container.d.ts +2 -0
- package/es/components/sticky-container/src/sticky-container.mjs +32 -0
- package/es/components/sticky-container/src/sticky-container.mjs.map +1 -0
- package/es/components/sticky-container/style/index.d.ts +1 -0
- package/es/components/table/index.d.ts +6 -0
- package/es/components/table/index.mjs +9 -0
- package/es/components/table/index.mjs.map +1 -0
- package/es/components/table/src/components/Setting.vue.d.ts +30 -0
- package/es/components/table/src/components/Setting.vue.mjs +7 -0
- package/es/components/table/src/components/Setting.vue.mjs.map +1 -0
- package/es/components/table/src/components/Setting.vue_vue_type_script_setup_true_lang.mjs +67 -0
- package/es/components/table/src/components/Setting.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/table/src/components/TableColumn.vue.d.ts +15 -0
- package/es/components/table/src/components/TableColumn.vue.mjs +7 -0
- package/es/components/table/src/components/TableColumn.vue.mjs.map +1 -0
- package/es/components/table/src/components/TableColumn.vue_vue_type_script_setup_true_lang.mjs +132 -0
- package/es/components/table/src/components/TableColumn.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/table/src/instance.d.ts +2 -0
- package/es/components/table/src/instance.mjs +0 -0
- package/es/components/table/src/table.d.ts +84 -0
- package/es/components/table/src/table.mjs +139 -0
- package/es/components/table/src/table.mjs.map +1 -0
- package/es/components/table/src/table.vue.d.ts +384 -0
- package/es/components/table/src/table.vue.mjs +7 -0
- package/es/components/table/src/table.vue.mjs.map +1 -0
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs +143 -0
- package/es/components/table/src/table.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/table/src/use-controller.d.ts +10 -0
- package/es/components/table/src/use-controller.mjs +117 -0
- package/es/components/table/src/use-controller.mjs.map +1 -0
- package/es/components/table/src/use-table.d.ts +26 -0
- package/es/components/table/src/use-table.mjs +188 -0
- package/es/components/table/src/use-table.mjs.map +1 -0
- package/es/components/table/style/index.d.ts +1 -0
- package/es/components/table-editor/index.d.ts +6 -0
- package/es/components/table-editor/index.mjs +9 -0
- package/es/components/table-editor/index.mjs.map +1 -0
- package/es/components/table-editor/src/components/BaseItem.vue.d.ts +15 -0
- package/es/components/table-editor/src/components/BaseItem.vue.mjs +7 -0
- package/es/components/table-editor/src/components/BaseItem.vue.mjs.map +1 -0
- package/es/components/table-editor/src/components/BaseItem.vue_vue_type_script_lang.mjs +37 -0
- package/es/components/table-editor/src/components/BaseItem.vue_vue_type_script_lang.mjs.map +1 -0
- package/es/components/table-editor/src/instance.d.ts +2 -0
- package/es/components/table-editor/src/instance.mjs +0 -0
- package/es/components/table-editor/src/table-editor.d.ts +45 -0
- package/es/components/table-editor/src/table-editor.mjs +24 -0
- package/es/components/table-editor/src/table-editor.mjs.map +1 -0
- package/es/components/table-editor/src/table-editor.vue.d.ts +82 -0
- package/es/components/table-editor/src/table-editor.vue.mjs +7 -0
- package/es/components/table-editor/src/table-editor.vue.mjs.map +1 -0
- package/es/components/table-editor/src/table-editor.vue_vue_type_script_setup_true_lang.mjs +75 -0
- package/es/components/table-editor/src/table-editor.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/table-editor/style/index.d.ts +1 -0
- package/es/components/tabs/index.d.ts +6 -0
- package/es/components/tabs/index.mjs +9 -0
- package/es/components/tabs/index.mjs.map +1 -0
- package/es/components/tabs/src/instance.d.ts +2 -0
- package/es/components/tabs/src/instance.mjs +0 -0
- package/es/components/tabs/src/itabs.d.ts +31 -0
- package/es/components/tabs/src/itabs.mjs +33 -0
- package/es/components/tabs/src/itabs.mjs.map +1 -0
- package/es/components/tabs/src/tabs.d.ts +55 -0
- package/es/components/tabs/src/tabs.mjs +58 -0
- package/es/components/tabs/src/tabs.mjs.map +1 -0
- package/es/components/tabs/style/index.d.ts +1 -0
- package/es/components/tarea-tag/index.d.ts +6 -0
- package/es/components/tarea-tag/index.mjs +9 -0
- package/es/components/tarea-tag/index.mjs.map +1 -0
- package/es/components/tarea-tag/src/instance.d.ts +2 -0
- package/es/components/tarea-tag/src/instance.mjs +0 -0
- package/es/components/tarea-tag/src/tarea-tag.d.ts +10 -0
- package/es/components/tarea-tag/src/tarea-tag.mjs +29 -0
- package/es/components/tarea-tag/src/tarea-tag.mjs.map +1 -0
- package/es/components/tarea-tag/src/tarea-tag.vue.d.ts +23 -0
- package/es/components/tarea-tag/src/tarea-tag.vue.mjs +7 -0
- package/es/components/tarea-tag/src/tarea-tag.vue.mjs.map +1 -0
- package/es/components/tarea-tag/src/tarea-tag.vue_vue_type_script_setup_true_lang.mjs +149 -0
- package/es/components/tarea-tag/src/tarea-tag.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/tarea-tag/style/index.d.ts +1 -0
- package/es/components/text-ellipsis/index.d.ts +5 -0
- package/es/components/text-ellipsis/index.mjs +9 -0
- package/es/components/text-ellipsis/index.mjs.map +1 -0
- package/es/components/text-ellipsis/src/instance.d.ts +2 -0
- package/es/components/text-ellipsis/src/instance.mjs +0 -0
- package/es/components/text-ellipsis/src/itext-ellipsis.d.ts +11 -0
- package/es/components/text-ellipsis/src/itext-ellipsis.mjs +16 -0
- package/es/components/text-ellipsis/src/itext-ellipsis.mjs.map +1 -0
- package/es/components/text-ellipsis/src/text-ellipsis.d.ts +25 -0
- package/es/components/text-ellipsis/src/text-ellipsis.mjs +115 -0
- package/es/components/text-ellipsis/src/text-ellipsis.mjs.map +1 -0
- package/es/components/text-ellipsis/src/use-window-size.d.ts +5 -0
- package/es/components/text-ellipsis/src/use-window-size.mjs +28 -0
- package/es/components/text-ellipsis/src/use-window-size.mjs.map +1 -0
- package/es/components/text-ellipsis/src/utils.d.ts +22 -0
- package/es/components/text-ellipsis/src/utils.mjs +26 -0
- package/es/components/text-ellipsis/src/utils.mjs.map +1 -0
- package/es/components/text-ellipsis/style/index.d.ts +1 -0
- package/es/components/time-line/index.d.ts +6 -0
- package/es/components/time-line/index.mjs +9 -0
- package/es/components/time-line/index.mjs.map +1 -0
- package/es/components/time-line/src/instance.d.ts +2 -0
- package/es/components/time-line/src/instance.mjs +0 -0
- package/es/components/time-line/src/time-line.d.ts +28 -0
- package/es/components/time-line/src/time-line.mjs +25 -0
- package/es/components/time-line/src/time-line.mjs.map +1 -0
- package/es/components/time-line/src/time-line.vue.d.ts +81 -0
- package/es/components/time-line/src/time-line.vue.mjs +7 -0
- package/es/components/time-line/src/time-line.vue.mjs.map +1 -0
- package/es/components/time-line/src/time-line.vue_vue_type_script_setup_true_lang.mjs +37 -0
- package/es/components/time-line/src/time-line.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/time-line/style/index.d.ts +1 -0
- package/es/components/uploader/index.d.ts +6 -0
- package/es/components/uploader/index.mjs +9 -0
- package/es/components/uploader/index.mjs.map +1 -0
- package/es/components/uploader/src/UploadInfo.vue.d.ts +30 -0
- package/es/components/uploader/src/UploadInfo.vue.mjs +7 -0
- package/es/components/uploader/src/UploadInfo.vue.mjs.map +1 -0
- package/es/components/uploader/src/UploadInfo.vue_vue_type_script_setup_true_lang.mjs +167 -0
- package/es/components/uploader/src/UploadInfo.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/uploader/src/instance.d.ts +2 -0
- package/es/components/uploader/src/instance.mjs +0 -0
- package/es/components/uploader/src/toast.d.ts +1 -0
- package/es/components/uploader/src/toast.mjs +37 -0
- package/es/components/uploader/src/toast.mjs.map +1 -0
- package/es/components/uploader/src/uploader.d.ts +32 -0
- package/es/components/uploader/src/uploader.mjs +104 -0
- package/es/components/uploader/src/uploader.mjs.map +1 -0
- package/es/components/uploader/src/uploader.vue.d.ts +98 -0
- package/es/components/uploader/src/uploader.vue.mjs +7 -0
- package/es/components/uploader/src/uploader.vue.mjs.map +1 -0
- package/es/components/uploader/src/uploader.vue_vue_type_script_setup_true_lang.mjs +48 -0
- package/es/components/uploader/src/uploader.vue_vue_type_script_setup_true_lang.mjs.map +1 -0
- package/es/components/uploader/src/use-uploader.d.ts +20 -0
- package/es/components/uploader/src/use-uploader.mjs +263 -0
- package/es/components/uploader/src/use-uploader.mjs.map +1 -0
- package/es/components/uploader/style/index.d.ts +1 -0
- package/es/defaults.d.ts +5 -0
- package/es/defaults.mjs +8 -0
- package/es/defaults.mjs.map +1 -0
- package/es/directives/copy/index.d.ts +3 -0
- package/es/directives/copy/index.mjs +31 -0
- package/es/directives/copy/index.mjs.map +1 -0
- package/es/directives/draggable/index.d.ts +3 -0
- package/es/directives/draggable/index.mjs +28 -0
- package/es/directives/draggable/index.mjs.map +1 -0
- package/es/directives/index.d.ts +4 -0
- package/es/directives/index.mjs +5 -0
- package/es/directives/longpress/index.d.ts +7 -0
- package/es/directives/longpress/index.mjs +32 -0
- package/es/directives/longpress/index.mjs.map +1 -0
- package/es/directives/resize-element/index.d.ts +3 -0
- package/es/directives/resize-element/index.mjs +30 -0
- package/es/directives/resize-element/index.mjs.map +1 -0
- package/es/directives/show-tip/index.d.ts +3 -0
- package/es/directives/show-tip/index.mjs +19 -0
- package/es/directives/show-tip/index.mjs.map +1 -0
- package/es/hooks/_configurable.d.ts +27 -0
- package/es/hooks/_configurable.mjs +10 -0
- package/es/hooks/_configurable.mjs.map +1 -0
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +2 -0
- package/es/hooks/toRef/index.d.ts +14 -0
- package/es/hooks/toRef/index.mjs +19 -0
- package/es/hooks/toRef/index.mjs.map +1 -0
- package/es/hooks/tryOnScopeDispose/index.d.ts +7 -0
- package/es/hooks/tryOnScopeDispose/index.mjs +18 -0
- package/es/hooks/tryOnScopeDispose/index.mjs.map +1 -0
- package/es/hooks/unrefElement/index.d.ts +12 -0
- package/es/hooks/unrefElement/index.mjs +16 -0
- package/es/hooks/unrefElement/index.mjs.map +1 -0
- package/es/hooks/use-full-screen/index.d.ts +1 -0
- package/es/hooks/use-full-screen/index.mjs +32 -0
- package/es/hooks/use-full-screen/index.mjs.map +1 -0
- package/es/hooks/useEventListener/index.d.ts +83 -0
- package/es/hooks/useEventListener/index.mjs +47 -0
- package/es/hooks/useEventListener/index.mjs.map +1 -0
- package/es/hooks/useFullscreen/index.d.ts +25 -0
- package/es/hooks/useFullscreen/index.mjs +121 -0
- package/es/hooks/useFullscreen/index.mjs.map +1 -0
- package/es/hooks/useMounted/index.d.ts +6 -0
- package/es/hooks/useMounted/index.mjs +19 -0
- package/es/hooks/useMounted/index.mjs.map +1 -0
- package/es/hooks/useSupported/index.d.ts +2 -0
- package/es/hooks/useSupported/index.mjs +14 -0
- package/es/hooks/useSupported/index.mjs.map +1 -0
- package/es/hooks/utils/filters.d.ts +84 -0
- package/es/hooks/utils/filters.mjs +141 -0
- package/es/hooks/utils/filters.mjs.map +1 -0
- package/es/hooks/utils/general.d.ts +49 -0
- package/es/hooks/utils/general.mjs +85 -0
- package/es/hooks/utils/general.mjs.map +1 -0
- package/es/hooks/utils/index.d.ts +6 -0
- package/es/hooks/utils/index.mjs +6 -0
- package/es/hooks/utils/is.d.ts +13 -0
- package/es/hooks/utils/is.mjs +29 -0
- package/es/hooks/utils/is.mjs.map +1 -0
- package/es/hooks/utils/port.d.ts +2 -0
- package/es/hooks/utils/port.mjs +17 -0
- package/es/hooks/utils/port.mjs.map +1 -0
- package/es/hooks/utils/types.d.ts +117 -0
- package/es/hooks/utils/types.mjs +0 -0
- package/es/hooks/utils/vue.d.ts +1 -0
- package/es/hooks/utils/vue.mjs +9 -0
- package/es/hooks/utils/vue.mjs.map +1 -0
- package/es/hooks/watchImmediate/index.d.ts +5 -0
- package/es/hooks/watchImmediate/index.mjs +17 -0
- package/es/hooks/watchImmediate/index.mjs.map +1 -0
- package/es/index.d.ts +8 -0
- package/es/index.mjs +47 -0
- package/es/index.mjs.map +1 -0
- package/es/make-installer.d.ts +5 -0
- package/es/make-installer.mjs +15 -0
- package/es/make-installer.mjs.map +1 -0
- package/es/share/dist/index.d.ts +60 -0
- package/es/share/dist/index.mjs +16 -0
- package/es/share/dist/index.mjs.map +1 -0
- package/es/utils/browser.d.ts +3 -0
- package/es/utils/browser.mjs +9 -0
- package/es/utils/browser.mjs.map +1 -0
- package/es/utils/console-log/index.d.ts +3 -0
- package/es/utils/console-log/index.mjs +23 -0
- package/es/utils/console-log/index.mjs.map +1 -0
- package/es/utils/create/index.d.ts +21 -0
- package/es/utils/create/index.mjs +43 -0
- package/es/utils/create/index.mjs.map +1 -0
- package/es/utils/dom/index.d.ts +2 -0
- package/es/utils/dom/index.mjs +3 -0
- package/es/utils/dom/scroll.d.ts +11 -0
- package/es/utils/dom/scroll.mjs +107 -0
- package/es/utils/dom/scroll.mjs.map +1 -0
- package/es/utils/dom/style.d.ts +5 -0
- package/es/utils/dom/style.mjs +35 -0
- package/es/utils/dom/style.mjs.map +1 -0
- package/es/utils/easings.d.ts +1 -0
- package/es/utils/easings.mjs +11 -0
- package/es/utils/easings.mjs.map +1 -0
- package/es/utils/index.d.ts +11 -0
- package/es/utils/index.mjs +14 -0
- package/es/utils/objects.d.ts +8 -0
- package/es/utils/objects.mjs +19 -0
- package/es/utils/objects.mjs.map +1 -0
- package/es/utils/raf.d.ts +2 -0
- package/es/utils/raf.mjs +8 -0
- package/es/utils/raf.mjs.map +1 -0
- package/es/utils/request/index.d.ts +25 -0
- package/es/utils/request/index.mjs +49 -0
- package/es/utils/request/index.mjs.map +1 -0
- package/es/utils/types.d.ts +10 -0
- package/es/utils/types.mjs +22 -0
- package/es/utils/types.mjs.map +1 -0
- package/es/utils/typescript.d.ts +12 -0
- package/es/utils/typescript.mjs +6 -0
- package/es/utils/typescript.mjs.map +1 -0
- package/es/utils/vue/index.d.ts +3 -0
- package/es/utils/vue/index.mjs +3 -0
- package/es/utils/vue/install.d.ts +50 -0
- package/es/utils/vue/install.mjs +74 -0
- package/es/utils/vue/install.mjs.map +1 -0
- package/es/utils/vue/props/index.d.ts +3 -0
- package/es/utils/vue/props/index.mjs +2 -0
- package/es/utils/vue/props/runtime.d.ts +29 -0
- package/es/utils/vue/props/runtime.mjs +59 -0
- package/es/utils/vue/props/runtime.mjs.map +1 -0
- package/es/utils/vue/props/types.d.ts +120 -0
- package/es/utils/vue/props/types.mjs +0 -0
- package/es/utils/vue/props/util.d.ts +8 -0
- package/es/utils/vue/props/util.mjs +0 -0
- package/es/utils/vue/typescript.d.ts +6 -0
- package/es/utils/vue/typescript.mjs +0 -0
- package/es/version.d.ts +1 -0
- package/es/version.mjs +6 -0
- package/es/version.mjs.map +1 -0
- package/global.d.ts +1 -0
- package/package.json +80 -0
- package/resolvers/index.d.mts +19 -0
- package/resolvers/index.d.ts +19 -0
- package/resolvers/index.mjs +32 -0
- package/theme-chalk/hd-date-picker.css +1 -0
- package/theme-chalk/hd-descriptions.css +1 -0
- package/theme-chalk/hd-ellipsis-tag.css +1 -0
- package/theme-chalk/hd-empty.css +2 -0
- package/theme-chalk/hd-jdata-viewer.css +1 -0
- package/theme-chalk/hd-radio.css +1 -0
- package/theme-chalk/hd-remote-search.css +1 -0
- package/theme-chalk/hd-search-form.css +1 -0
- package/theme-chalk/hd-sticky-container.css +1 -0
- package/theme-chalk/hd-table-editor.css +1 -0
- package/theme-chalk/hd-table.css +1 -0
- package/theme-chalk/hd-tabs.css +1 -0
- package/theme-chalk/hd-tarea-tag.css +1 -0
- package/theme-chalk/hd-text-ellipsis.css +1 -0
- package/theme-chalk/hd-time-line.css +1 -0
- package/theme-chalk/hd-uploader.css +1 -0
- package/theme-chalk/index.css +1 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { version } from "./version.mjs";
|
|
2
|
+
//#region packages/hd-custom/make-installer.ts
|
|
3
|
+
var makeInstaller = (components = []) => {
|
|
4
|
+
const install = (app) => {
|
|
5
|
+
for (const [, component] of Object.entries(components)) app.use(component);
|
|
6
|
+
};
|
|
7
|
+
return {
|
|
8
|
+
version,
|
|
9
|
+
install
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { makeInstaller };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=make-installer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"make-installer.mjs","names":[],"sources":["../../../packages/hd-custom/make-installer.ts"],"sourcesContent":["import { version } from './version'\nimport type { App, Plugin } from 'vue'\n\nexport const makeInstaller = (components: Plugin[] = []) => {\n const install = (app: App) => {\n for (const [, component] of Object.entries(components)) {\n app.use(component)\n }\n }\n\n return {\n version,\n install,\n }\n}\n"],"mappings":";;AAGA,IAAa,iBAAiB,aAAuB,EAAE,KAAK;CAC1D,MAAM,WAAW,QAAa;AAC5B,OAAK,MAAM,GAAG,cAAc,OAAO,QAAQ,WAAW,CACpD,KAAI,IAAI,UAAU;;AAItB,QAAO;EACL;EACA;EACD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 判断一个值是否为空
|
|
3
|
+
* @param value - 要检查的值
|
|
4
|
+
* @returns {boolean} - 如果值为空返回 true,否则返回 false
|
|
5
|
+
* @description
|
|
6
|
+
* - null 或 undefined 返回 true
|
|
7
|
+
* - 空字符串或空数组返回 true
|
|
8
|
+
* - 空对象(没有自身属性)返回 true
|
|
9
|
+
* - 其他情况返回 false
|
|
10
|
+
*/
|
|
11
|
+
declare const isEmptyFun: (value: any) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 检查一个值是否为函数
|
|
14
|
+
* @param value - 要检查的值
|
|
15
|
+
* @returns {boolean} - 如果值是函数返回 true,否则返回 false
|
|
16
|
+
*/
|
|
17
|
+
declare const isFunctionFun: (value: any) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 创建一个防抖函数
|
|
20
|
+
* @param func - 要防抖的函数
|
|
21
|
+
* @param wait - 等待时间(毫秒)
|
|
22
|
+
* @returns - 返回防抖后的函数
|
|
23
|
+
* @description 在连续调用时,只有在等待了指定时间后才会执行函数
|
|
24
|
+
*/
|
|
25
|
+
declare function debounceFun<F extends (...args: any[]) => any>(func: F, wait: number): (...args: Parameters<F>) => Promise<ReturnType<F>>;
|
|
26
|
+
/**
|
|
27
|
+
* 生成一个 UUID
|
|
28
|
+
* @returns {string} - 返回生成的 UUID 字符串
|
|
29
|
+
* @description 生成格式为 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' 的 UUID
|
|
30
|
+
*/
|
|
31
|
+
declare const guid: () => string;
|
|
32
|
+
/**
|
|
33
|
+
* 复制文本到剪贴板
|
|
34
|
+
* @param str - 要复制的字符串
|
|
35
|
+
* @returns {Promise<boolean>} - 复制成功返回 true,失败返回 false
|
|
36
|
+
* @description 使用现代的 Clipboard API,如果不支持则回退到传统方法
|
|
37
|
+
*/
|
|
38
|
+
declare const copyStr: (str: string) => Promise<boolean>;
|
|
39
|
+
|
|
40
|
+
interface OcrField {
|
|
41
|
+
[key: string]: string;
|
|
42
|
+
}
|
|
43
|
+
interface OcrData {
|
|
44
|
+
[key: string]: string | number | boolean | null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* OCR字段映射工具
|
|
48
|
+
* @param originalData - OCR原始数据
|
|
49
|
+
* @param field - 字段映射关系
|
|
50
|
+
* @returns 映射后的数据对象
|
|
51
|
+
* @example
|
|
52
|
+
* const result = ocrValueMapping(data, {
|
|
53
|
+
* businessScope: 'businessScope',
|
|
54
|
+
* companyName: 'companyName',
|
|
55
|
+
* expireDate: 'expireDate'
|
|
56
|
+
* })
|
|
57
|
+
*/
|
|
58
|
+
declare const ocrValueMapping: (originalData: OcrData, field: OcrField) => OcrData;
|
|
59
|
+
|
|
60
|
+
export { copyStr, debounceFun, guid, isEmptyFun, isFunctionFun, ocrValueMapping };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region packages/share/dist/index.mjs
|
|
2
|
+
function debounceFun(func, wait) {
|
|
3
|
+
let timeoutId;
|
|
4
|
+
return function debounced(...args) {
|
|
5
|
+
return new Promise((resolve) => {
|
|
6
|
+
clearTimeout(timeoutId);
|
|
7
|
+
timeoutId = setTimeout(() => {
|
|
8
|
+
resolve(func.apply(this, args));
|
|
9
|
+
}, wait);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { debounceFun };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/share/dist/index.mjs"],"sourcesContent":["const isEmptyFun = (value) => {\n if (value == null) {\n return true;\n }\n if (typeof value === \"string\" || Array.isArray(value)) {\n return value.length === 0;\n }\n if (typeof value === \"object\") {\n return Object.keys(value).length === 0;\n }\n return false;\n};\nconst isFunctionFun = (value) => {\n return typeof value === \"function\";\n};\nfunction debounceFun(func, wait) {\n let timeoutId;\n return function debounced(...args) {\n return new Promise((resolve) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n resolve(func.apply(this, args));\n }, wait);\n });\n };\n}\nconst guid = () => {\n const S4 = () => {\n return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);\n };\n return `${S4()}${S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`;\n};\nconst copyStr = async (str) => {\n if (!str) return false;\n try {\n if (navigator.clipboard && window.isSecureContext) {\n await navigator.clipboard.writeText(str);\n return true;\n }\n const textArea = document.createElement(\"textarea\");\n textArea.value = str;\n textArea.style.position = \"fixed\";\n textArea.style.left = \"-999999px\";\n textArea.style.top = \"-999999px\";\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n try {\n document.execCommand(\"copy\");\n textArea.remove();\n return true;\n } catch (err) {\n textArea.remove();\n return false;\n }\n } catch (err) {\n return false;\n }\n};\n\nconst ocrValueMapping = (originalData, field) => {\n const mappedData = {};\n Object.entries(field).forEach(([key, value]) => {\n mappedData[key] = originalData[value] ?? null;\n });\n return mappedData;\n};\n\nexport { copyStr, debounceFun, guid, isEmptyFun, isFunctionFun, ocrValueMapping };\n"],"mappings":";AAeA,SAAS,YAAY,MAAM,MAAM;CAC/B,IAAI;AACJ,QAAO,SAAS,UAAU,GAAG,MAAM;AACjC,SAAO,IAAI,SAAS,YAAY;AAC9B,gBAAa,UAAU;AACvB,eAAY,iBAAiB;AAC3B,YAAQ,KAAK,MAAM,MAAM,KAAK,CAAC;MAC9B,KAAK;IACR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.mjs","names":[],"sources":["../../../../packages/utils/browser.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\r\n\r\nexport const ifFirefox = () => {\r\n isClient && /firefox/i.test(window.navigator.userAgent)\r\n}\r\n\r\nexport {\r\n isClient\r\n}"],"mappings":";;AAEA,IAAa,kBAAkB;AAC7B,aAAY,WAAW,KAAK,OAAO,UAAU,UAAU"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region packages/utils/console-log/index.ts
|
|
2
|
+
var ProxyConsole = new Proxy(console, { get(target, propKey) {
|
|
3
|
+
const originalMethod = target[propKey];
|
|
4
|
+
if (originalMethod instanceof Function) {
|
|
5
|
+
var _window;
|
|
6
|
+
if (((_window = window) === null || _window === void 0 ? void 0 : _window.sessionStorage).getItem("HD-ENGINE-DEBUGGER")) return originalMethod;
|
|
7
|
+
return () => {};
|
|
8
|
+
}
|
|
9
|
+
return originalMethod;
|
|
10
|
+
} });
|
|
11
|
+
function error(msg, ...rest) {
|
|
12
|
+
ProxyConsole.error(`[hd-engine: error]: ${msg}`, rest);
|
|
13
|
+
}
|
|
14
|
+
function warning(msg) {
|
|
15
|
+
ProxyConsole.warn(`[hd-engine: warning]: ${msg}`);
|
|
16
|
+
}
|
|
17
|
+
function logger(msg, ...rest) {
|
|
18
|
+
ProxyConsole.log(`[hd-engine: logger]: ${msg}`, rest);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { error, logger, warning };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/utils/console-log/index.ts"],"sourcesContent":["const ProxyConsole = new Proxy(console, {\n get(target: any, propKey: string) {\n const originalMethod = target[propKey]\n if (originalMethod instanceof Function) {\n const session = window?.sessionStorage\n if (session.getItem('HD-ENGINE-DEBUGGER')) {\n return originalMethod\n }\n return (): void => {}\n }\n return originalMethod\n },\n})\n\nexport function error(msg: string, ...rest: any[]) {\n ProxyConsole.error(`[hd-engine: error]: ${msg}`, rest)\n}\n\nexport function warning(msg: string) {\n ProxyConsole.warn(`[hd-engine: warning]: ${msg}`)\n}\n\nexport function logger(msg: string, ...rest: any[]) {\n ProxyConsole.log(`[hd-engine: logger]: ${msg}`, rest)\n}\n"],"mappings":";AAAA,IAAM,eAAe,IAAI,MAAM,SAAS,EACtC,IAAI,QAAa,SAAiB;CAChC,MAAM,iBAAiB,OAAO;AAC9B,KAAI,0BAA0B,UAAU;;AAEtC,QAAA,UADgB,YAAA,QAAA,YAAA,KAAA,IAAA,KAAA,IAAA,QAAQ,gBACZ,QAAQ,qBAAqB,CACvC,QAAO;AAET,eAAmB;;AAErB,QAAO;GAEV,CAAC;AAEF,SAAgB,MAAM,KAAa,GAAG,MAAa;AACjD,cAAa,MAAM,uBAAuB,OAAO,KAAK;;AAGxD,SAAgB,QAAQ,KAAa;AACnC,cAAa,KAAK,yBAAyB,MAAM;;AAGnD,SAAgB,OAAO,KAAa,GAAG,MAAa;AAClD,cAAa,IAAI,wBAAwB,OAAO,KAAK"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 1. 创建vnode
|
|
3
|
+
* 2. 挂载
|
|
4
|
+
*/
|
|
5
|
+
import { VNode } from 'vue';
|
|
6
|
+
import type { Component } from 'vue';
|
|
7
|
+
type IObj = {
|
|
8
|
+
[k: string]: any;
|
|
9
|
+
};
|
|
10
|
+
interface IReturnObj {
|
|
11
|
+
$destroy: Function;
|
|
12
|
+
}
|
|
13
|
+
export declare const createMountContainer: (customClass?: string[]) => Element;
|
|
14
|
+
export declare const createVnode: (component: Component, props: IObj, slots?: IObj) => VNode;
|
|
15
|
+
export declare const mount: (vnode: VNode, appendToContainer?: Element, customClass?: string[]) => IReturnObj;
|
|
16
|
+
type ICreator = (component: Component, props: IObj, customClass?: string[]) => void;
|
|
17
|
+
/**
|
|
18
|
+
* 1. 给组件实例扩充 createAPI
|
|
19
|
+
*/
|
|
20
|
+
export declare const creator: ICreator;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { h, render } from "vue";
|
|
2
|
+
//#region packages/utils/create/index.ts
|
|
3
|
+
/**
|
|
4
|
+
* 1. 创建vnode
|
|
5
|
+
* 2. 挂载
|
|
6
|
+
*/
|
|
7
|
+
var mountDom = null;
|
|
8
|
+
var appendToContainer = document.body;
|
|
9
|
+
var createMountContainer = (customClass) => {
|
|
10
|
+
console.log("customClass", customClass);
|
|
11
|
+
const container = document.createElement("div");
|
|
12
|
+
container.className = `creator-api-container ${customClass ? customClass : ""}`;
|
|
13
|
+
return container;
|
|
14
|
+
};
|
|
15
|
+
var createVnode = (component, props, slots) => {
|
|
16
|
+
return h(component, { ...props }, { ...slots });
|
|
17
|
+
};
|
|
18
|
+
var destroy = () => {
|
|
19
|
+
if (mountDom) appendToContainer.removeChild(mountDom);
|
|
20
|
+
};
|
|
21
|
+
var mount = (vnode, appendToContainer = document.body, customClass) => {
|
|
22
|
+
destroy();
|
|
23
|
+
mountDom = createMountContainer(customClass);
|
|
24
|
+
render(vnode, mountDom);
|
|
25
|
+
appendToContainer.appendChild(mountDom);
|
|
26
|
+
function $destroy(mountDom) {
|
|
27
|
+
if (mountDom) appendToContainer.removeChild(mountDom);
|
|
28
|
+
}
|
|
29
|
+
return { $destroy };
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 1. 给组件实例扩充 createAPI
|
|
33
|
+
*/
|
|
34
|
+
var creator = (component, props, customClass) => {
|
|
35
|
+
appendToContainer = props.appendTo || document.body;
|
|
36
|
+
Object.assign(component, { $creator: function(props, customClass, slots) {
|
|
37
|
+
mount(createVnode(this, props, slots), appendToContainer, customClass);
|
|
38
|
+
} });
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { createMountContainer, createVnode, creator, mount };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/utils/create/index.ts"],"sourcesContent":["/**\r\n * 1. 创建vnode\r\n * 2. 挂载\r\n */\r\n\r\nimport { render, h, VNode } from 'vue'\r\nimport type { Component } from 'vue'\r\nlet mountDom: Element | null = null\r\nlet appendToContainer: Element = document.body\r\n\r\ntype IObj = {\r\n [k: string]: any\r\n}\r\n\r\ninterface IReturnObj {\r\n $destroy: Function\r\n}\r\n\r\nexport const createMountContainer = (customClass?: string[]): Element => {\r\n console.log('customClass', customClass)\r\n const container = document.createElement('div')\r\n container.className = `creator-api-container ${customClass ? customClass : ''}`\r\n return container\r\n}\r\n\r\nexport const createVnode = (component: Component, props: IObj, slots?: IObj): VNode => {\r\n const vnode = h(component, { ...props }, { ...slots })\r\n return vnode\r\n}\r\n\r\nconst destroy = () => {\r\n if (mountDom) {\r\n appendToContainer.removeChild(mountDom)\r\n }\r\n}\r\n\r\nexport const mount = (vnode: VNode, appendToContainer: Element = document.body, customClass?: string[]): IReturnObj => {\r\n destroy()\r\n mountDom = createMountContainer(customClass)\r\n render(vnode, mountDom)\r\n appendToContainer.appendChild(mountDom)\r\n\r\n function $destroy(mountDom: Element) {\r\n if (mountDom) {\r\n appendToContainer.removeChild(mountDom)\r\n }\r\n }\r\n return {\r\n $destroy,\r\n }\r\n}\r\n\r\ntype ICreator = (component: Component, props: IObj, customClass?: string[]) => void\r\n\r\n/**\r\n * 1. 给组件实例扩充 createAPI\r\n */\r\nexport const creator: ICreator = (component: Component, props: IObj, customClass?: string[]) => {\r\n appendToContainer = props.appendTo || document.body\r\n\r\n Object.assign(component!, {\r\n $creator: function (props: IObj, customClass?: string[], slots?: IObj) {\r\n const vnode = createVnode(this, props, slots)\r\n mount(vnode, appendToContainer, customClass)\r\n },\r\n })\r\n}\r\n"],"mappings":";;;;;;AAOA,IAAI,WAA2B;AAC/B,IAAI,oBAA6B,SAAS;AAU1C,IAAa,wBAAwB,gBAAoC;AACvE,SAAQ,IAAI,eAAe,YAAY;CACvC,MAAM,YAAY,SAAS,cAAc,MAAM;AAC/C,WAAU,YAAY,yBAAyB,cAAc,cAAc;AAC3E,QAAO;;AAGT,IAAa,eAAe,WAAsB,OAAa,UAAwB;AAErF,QADc,EAAE,WAAW,EAAE,GAAG,OAAO,EAAE,EAAE,GAAG,OAAO,CAC9C;;AAGT,IAAM,gBAAgB;AACpB,KAAI,SACF,mBAAkB,YAAY,SAAS;;AAI3C,IAAa,SAAS,OAAc,oBAA6B,SAAS,MAAM,gBAAuC;AACrH,UAAS;AACT,YAAW,qBAAqB,YAAY;AAC5C,QAAO,OAAO,SAAS;AACvB,mBAAkB,YAAY,SAAS;CAEvC,SAAS,SAAS,UAAmB;AACnC,MAAI,SACF,mBAAkB,YAAY,SAAS;;AAG3C,QAAO,EACL,UACD;;;;;AAQH,IAAa,WAAqB,WAAsB,OAAa,gBAA2B;AAC9F,qBAAoB,MAAM,YAAY,SAAS;AAE/C,QAAO,OAAO,WAAY,EACxB,UAAU,SAAU,OAAa,aAAwB,OAAc;AAErE,QADc,YAAY,MAAM,OAAO,MACjC,EAAO,mBAAmB,YAAY;IAE/C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { addClass, classNameToArray, getStyle, hasClass, removeClass } from "./style.mjs";
|
|
2
|
+
import { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView } from "./scroll.mjs";
|
|
3
|
+
export { addClass, animateScrollTo, classNameToArray, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, getStyle, hasClass, isScroll, removeClass, scrollIntoView };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const isScroll: (el: HTMLElement, isVertical?: boolean) => boolean;
|
|
2
|
+
export declare const getScrollContainer: (el: HTMLElement, isVertical?: boolean) => Window | HTMLElement | undefined;
|
|
3
|
+
export declare const getScrollBarWidth: (namespace?: string) => number;
|
|
4
|
+
/**
|
|
5
|
+
* Scroll with in the container element, positioning the **selected** element at the top
|
|
6
|
+
* of the container
|
|
7
|
+
*/
|
|
8
|
+
export declare function scrollIntoView(container: HTMLElement, selected: HTMLElement): void;
|
|
9
|
+
export declare function animateScrollTo(container: HTMLElement | Window, from: number, to: number, duration: number, callback?: unknown): () => void;
|
|
10
|
+
export declare const getScrollElement: (target: HTMLElement, container: HTMLElement | Window) => HTMLElement;
|
|
11
|
+
export declare const getScrollTop: (container: HTMLElement | Window) => number;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { isClient } from "../browser.mjs";
|
|
2
|
+
import { getStyle } from "./style.mjs";
|
|
3
|
+
import { easeInOutCubic } from "../easings.mjs";
|
|
4
|
+
import { isFunction, isWindow } from "../types.mjs";
|
|
5
|
+
import { cAF, rAF } from "../raf.mjs";
|
|
6
|
+
//#region packages/utils/dom/scroll.ts
|
|
7
|
+
var isScroll = (el, isVertical) => {
|
|
8
|
+
if (!isClient) return false;
|
|
9
|
+
const key = {
|
|
10
|
+
undefined: "overflow",
|
|
11
|
+
true: "overflow-y",
|
|
12
|
+
false: "overflow-x"
|
|
13
|
+
}[String(isVertical)];
|
|
14
|
+
const overflow = getStyle(el, key);
|
|
15
|
+
return [
|
|
16
|
+
"scroll",
|
|
17
|
+
"auto",
|
|
18
|
+
"overlay"
|
|
19
|
+
].some((s) => overflow.includes(s));
|
|
20
|
+
};
|
|
21
|
+
var getScrollContainer = (el, isVertical) => {
|
|
22
|
+
if (!isClient) return;
|
|
23
|
+
let parent = el;
|
|
24
|
+
while (parent) {
|
|
25
|
+
if ([
|
|
26
|
+
window,
|
|
27
|
+
document,
|
|
28
|
+
document.documentElement
|
|
29
|
+
].includes(parent)) return window;
|
|
30
|
+
if (isScroll(parent, isVertical)) return parent;
|
|
31
|
+
parent = parent.parentNode;
|
|
32
|
+
}
|
|
33
|
+
return parent;
|
|
34
|
+
};
|
|
35
|
+
var scrollBarWidth;
|
|
36
|
+
var getScrollBarWidth = (namespace) => {
|
|
37
|
+
var _outer$parentNode;
|
|
38
|
+
if (!isClient) return 0;
|
|
39
|
+
if (scrollBarWidth !== void 0) return scrollBarWidth;
|
|
40
|
+
const outer = document.createElement("div");
|
|
41
|
+
outer.className = `${namespace}-scrollbar__wrap`;
|
|
42
|
+
outer.style.visibility = "hidden";
|
|
43
|
+
outer.style.width = "100px";
|
|
44
|
+
outer.style.position = "absolute";
|
|
45
|
+
outer.style.top = "-9999px";
|
|
46
|
+
document.body.appendChild(outer);
|
|
47
|
+
const widthNoScroll = outer.offsetWidth;
|
|
48
|
+
outer.style.overflow = "scroll";
|
|
49
|
+
const inner = document.createElement("div");
|
|
50
|
+
inner.style.width = "100%";
|
|
51
|
+
outer.appendChild(inner);
|
|
52
|
+
const widthWithScroll = inner.offsetWidth;
|
|
53
|
+
(_outer$parentNode = outer.parentNode) === null || _outer$parentNode === void 0 || _outer$parentNode.removeChild(outer);
|
|
54
|
+
scrollBarWidth = widthNoScroll - widthWithScroll;
|
|
55
|
+
return scrollBarWidth;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Scroll with in the container element, positioning the **selected** element at the top
|
|
59
|
+
* of the container
|
|
60
|
+
*/
|
|
61
|
+
function scrollIntoView(container, selected) {
|
|
62
|
+
if (!isClient) return;
|
|
63
|
+
if (!selected) {
|
|
64
|
+
container.scrollTop = 0;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const offsetParents = [];
|
|
68
|
+
let pointer = selected.offsetParent;
|
|
69
|
+
while (pointer !== null && container !== pointer && container.contains(pointer)) {
|
|
70
|
+
offsetParents.push(pointer);
|
|
71
|
+
pointer = pointer.offsetParent;
|
|
72
|
+
}
|
|
73
|
+
const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
|
|
74
|
+
const bottom = top + selected.offsetHeight;
|
|
75
|
+
const viewRectTop = container.scrollTop;
|
|
76
|
+
const viewRectBottom = viewRectTop + container.clientHeight;
|
|
77
|
+
if (top < viewRectTop) container.scrollTop = top;
|
|
78
|
+
else if (bottom > viewRectBottom) container.scrollTop = bottom - container.clientHeight;
|
|
79
|
+
}
|
|
80
|
+
function animateScrollTo(container, from, to, duration, callback) {
|
|
81
|
+
const startTime = Date.now();
|
|
82
|
+
let handle;
|
|
83
|
+
const scroll = () => {
|
|
84
|
+
const time = Date.now() - startTime;
|
|
85
|
+
const nextScrollTop = easeInOutCubic(time > duration ? duration : time, from, to, duration);
|
|
86
|
+
if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop);
|
|
87
|
+
else container.scrollTop = nextScrollTop;
|
|
88
|
+
if (time < duration) handle = rAF(scroll);
|
|
89
|
+
else if (isFunction(callback)) callback();
|
|
90
|
+
};
|
|
91
|
+
scroll();
|
|
92
|
+
return () => {
|
|
93
|
+
handle && cAF(handle);
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
var getScrollElement = (target, container) => {
|
|
97
|
+
if (isWindow(container)) return target.ownerDocument.documentElement;
|
|
98
|
+
return container;
|
|
99
|
+
};
|
|
100
|
+
var getScrollTop = (container) => {
|
|
101
|
+
if (isWindow(container)) return window.scrollY;
|
|
102
|
+
return container.scrollTop;
|
|
103
|
+
};
|
|
104
|
+
//#endregion
|
|
105
|
+
export { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView };
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=scroll.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scroll.mjs","names":[],"sources":["../../../../../packages/utils/dom/scroll.ts"],"sourcesContent":["import { isClient } from '../browser'\r\nimport { easeInOutCubic } from '../easings'\r\nimport { isFunction, isWindow } from '../types'\r\nimport { cAF, rAF } from '../raf'\r\nimport { getStyle } from './style'\r\n\r\nexport const isScroll = (el: HTMLElement, isVertical?: boolean): boolean => {\r\n if (!isClient) return false\r\n\r\n const key = (\r\n {\r\n undefined: 'overflow',\r\n true: 'overflow-y',\r\n false: 'overflow-x',\r\n } as const\r\n )[String(isVertical)]!\r\n const overflow = getStyle(el, key)\r\n return ['scroll', 'auto', 'overlay'].some((s) => overflow.includes(s))\r\n}\r\n\r\nexport const getScrollContainer = (\r\n el: HTMLElement,\r\n isVertical?: boolean\r\n): Window | HTMLElement | undefined => {\r\n if (!isClient) return\r\n\r\n let parent: HTMLElement = el\r\n while (parent) {\r\n if ([window, document, document.documentElement].includes(parent))\r\n return window\r\n\r\n if (isScroll(parent, isVertical)) return parent\r\n\r\n parent = parent.parentNode as HTMLElement\r\n }\r\n\r\n return parent\r\n}\r\n\r\nlet scrollBarWidth: number\r\nexport const getScrollBarWidth = (namespace?: string): number => {\r\n if (!isClient) return 0\r\n if (scrollBarWidth !== undefined) return scrollBarWidth\r\n\r\n const outer = document.createElement('div')\r\n outer.className = `${namespace}-scrollbar__wrap`\r\n outer.style.visibility = 'hidden'\r\n outer.style.width = '100px'\r\n outer.style.position = 'absolute'\r\n outer.style.top = '-9999px'\r\n document.body.appendChild(outer)\r\n\r\n const widthNoScroll = outer.offsetWidth\r\n outer.style.overflow = 'scroll'\r\n\r\n const inner = document.createElement('div')\r\n inner.style.width = '100%'\r\n outer.appendChild(inner)\r\n\r\n const widthWithScroll = inner.offsetWidth\r\n outer.parentNode?.removeChild(outer)\r\n scrollBarWidth = widthNoScroll - widthWithScroll\r\n\r\n return scrollBarWidth\r\n}\r\n\r\n/**\r\n * Scroll with in the container element, positioning the **selected** element at the top\r\n * of the container\r\n */\r\nexport function scrollIntoView(\r\n container: HTMLElement,\r\n selected: HTMLElement\r\n): void {\r\n if (!isClient) return\r\n\r\n if (!selected) {\r\n container.scrollTop = 0\r\n return\r\n }\r\n\r\n const offsetParents: HTMLElement[] = []\r\n let pointer = selected.offsetParent\r\n while (\r\n pointer !== null &&\r\n container !== pointer &&\r\n container.contains(pointer)\r\n ) {\r\n offsetParents.push(pointer as HTMLElement)\r\n pointer = (pointer as HTMLElement).offsetParent\r\n }\r\n const top =\r\n selected.offsetTop +\r\n offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0)\r\n const bottom = top + selected.offsetHeight\r\n const viewRectTop = container.scrollTop\r\n const viewRectBottom = viewRectTop + container.clientHeight\r\n\r\n if (top < viewRectTop) {\r\n container.scrollTop = top\r\n } else if (bottom > viewRectBottom) {\r\n container.scrollTop = bottom - container.clientHeight\r\n }\r\n}\r\n\r\nexport function animateScrollTo(\r\n container: HTMLElement | Window,\r\n from: number,\r\n to: number,\r\n duration: number,\r\n callback?: unknown\r\n) {\r\n const startTime = Date.now()\r\n\r\n let handle: number | undefined\r\n const scroll = () => {\r\n const timestamp = Date.now()\r\n const time = timestamp - startTime\r\n const nextScrollTop = easeInOutCubic(\r\n time > duration ? duration : time,\r\n from,\r\n to,\r\n duration\r\n )\r\n\r\n if (isWindow(container)) {\r\n container.scrollTo(window.pageXOffset, nextScrollTop)\r\n } else {\r\n container.scrollTop = nextScrollTop\r\n }\r\n if (time < duration) {\r\n handle = rAF(scroll)\r\n } else if (isFunction(callback)) {\r\n callback()\r\n }\r\n }\r\n\r\n scroll()\r\n\r\n return () => {\r\n handle && cAF(handle)\r\n }\r\n}\r\n\r\nexport const getScrollElement = (\r\n target: HTMLElement,\r\n container: HTMLElement | Window\r\n) => {\r\n if (isWindow(container)) {\r\n return target.ownerDocument.documentElement\r\n }\r\n return container\r\n}\r\n\r\nexport const getScrollTop = (container: HTMLElement | Window) => {\r\n if (isWindow(container)) {\r\n return window.scrollY\r\n }\r\n return container.scrollTop\r\n}"],"mappings":";;;;;;AAMA,IAAa,YAAY,IAAiB,eAAkC;AAC1E,KAAI,CAAC,SAAU,QAAO;CAEtB,MAAM,MACJ;EACE,WAAW;EACX,MAAM;EACN,OAAO;EACR,CACD,OAAO,WAAW;CACpB,MAAM,WAAW,SAAS,IAAI,IAAI;AAClC,QAAO;EAAC;EAAU;EAAQ;EAAU,CAAC,MAAM,MAAM,SAAS,SAAS,EAAE,CAAC;;AAGxE,IAAa,sBACX,IACA,eACqC;AACrC,KAAI,CAAC,SAAU;CAEf,IAAI,SAAsB;AAC1B,QAAO,QAAQ;AACb,MAAI;GAAC;GAAQ;GAAU,SAAS;GAAgB,CAAC,SAAS,OAAO,CAC/D,QAAO;AAET,MAAI,SAAS,QAAQ,WAAW,CAAE,QAAO;AAEzC,WAAS,OAAO;;AAGlB,QAAO;;AAGT,IAAI;AACJ,IAAa,qBAAqB,cAA+B;;AAC/D,KAAI,CAAC,SAAU,QAAO;AACtB,KAAI,mBAAmB,KAAA,EAAW,QAAO;CAEzC,MAAM,QAAQ,SAAS,cAAc,MAAM;AAC3C,OAAM,YAAY,GAAG,UAAU;AAC/B,OAAM,MAAM,aAAa;AACzB,OAAM,MAAM,QAAQ;AACpB,OAAM,MAAM,WAAW;AACvB,OAAM,MAAM,MAAM;AAClB,UAAS,KAAK,YAAY,MAAM;CAEhC,MAAM,gBAAgB,MAAM;AAC5B,OAAM,MAAM,WAAW;CAEvB,MAAM,QAAQ,SAAS,cAAc,MAAM;AAC3C,OAAM,MAAM,QAAQ;AACpB,OAAM,YAAY,MAAM;CAExB,MAAM,kBAAkB,MAAM;AAC9B,EAAA,oBAAA,MAAM,gBAAA,QAAA,sBAAA,KAAA,KAAA,kBAAY,YAAY,MAAM;AACpC,kBAAiB,gBAAgB;AAEjC,QAAO;;;;;;AAOT,SAAgB,eACd,WACA,UACM;AACN,KAAI,CAAC,SAAU;AAEf,KAAI,CAAC,UAAU;AACb,YAAU,YAAY;AACtB;;CAGF,MAAM,gBAA+B,EAAE;CACvC,IAAI,UAAU,SAAS;AACvB,QACE,YAAY,QACZ,cAAc,WACd,UAAU,SAAS,QAAQ,EAC3B;AACA,gBAAc,KAAK,QAAuB;AAC1C,YAAW,QAAwB;;CAErC,MAAM,MACJ,SAAS,YACT,cAAc,QAAQ,MAAM,SAAS,OAAO,KAAK,WAAW,EAAE;CAChE,MAAM,SAAS,MAAM,SAAS;CAC9B,MAAM,cAAc,UAAU;CAC9B,MAAM,iBAAiB,cAAc,UAAU;AAE/C,KAAI,MAAM,YACR,WAAU,YAAY;UACb,SAAS,eAClB,WAAU,YAAY,SAAS,UAAU;;AAI7C,SAAgB,gBACd,WACA,MACA,IACA,UACA,UACA;CACA,MAAM,YAAY,KAAK,KAAK;CAE5B,IAAI;CACJ,MAAM,eAAe;EAEnB,MAAM,OADY,KAAK,KACV,GAAY;EACzB,MAAM,gBAAgB,eACpB,OAAO,WAAW,WAAW,MAC7B,MACA,IACA,SACD;AAED,MAAI,SAAS,UAAU,CACrB,WAAU,SAAS,OAAO,aAAa,cAAc;MAErD,WAAU,YAAY;AAExB,MAAI,OAAO,SACT,UAAS,IAAI,OAAO;WACX,WAAW,SAAS,CAC7B,WAAU;;AAId,SAAQ;AAER,cAAa;AACX,YAAU,IAAI,OAAO;;;AAIzB,IAAa,oBACX,QACA,cACG;AACH,KAAI,SAAS,UAAU,CACrB,QAAO,OAAO,cAAc;AAE9B,QAAO;;AAGT,IAAa,gBAAgB,cAAoC;AAC/D,KAAI,SAAS,UAAU,CACrB,QAAO,OAAO;AAEhB,QAAO,UAAU"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const classNameToArray: (cls?: string) => string[];
|
|
2
|
+
export declare const getStyle: (element: HTMLElement, styleName: string) => string;
|
|
3
|
+
export declare const addClass: (el: Element, cls: string) => void;
|
|
4
|
+
export declare const removeClass: (el: Element, cls: string) => void;
|
|
5
|
+
export declare const hasClass: (el: Element, cls: string) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { isClient } from "../browser.mjs";
|
|
2
|
+
import { camelize } from "@vue/shared";
|
|
3
|
+
//#region packages/utils/dom/style.ts
|
|
4
|
+
var classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
|
|
5
|
+
var getStyle = (element, styleName) => {
|
|
6
|
+
if (!isClient || !element || !styleName) return "";
|
|
7
|
+
let key = camelize(styleName);
|
|
8
|
+
if (key === "float") key = "cssFloat";
|
|
9
|
+
try {
|
|
10
|
+
var _document$defaultView;
|
|
11
|
+
const style = element.style[key];
|
|
12
|
+
if (style) return style;
|
|
13
|
+
const computed = (_document$defaultView = document.defaultView) === null || _document$defaultView === void 0 ? void 0 : _document$defaultView.getComputedStyle(element, "");
|
|
14
|
+
return computed ? computed[key] : "";
|
|
15
|
+
} catch (e) {
|
|
16
|
+
return element.style[key];
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
var addClass = (el, cls) => {
|
|
20
|
+
if (!el || !cls.trim()) return;
|
|
21
|
+
el.classList.add(...classNameToArray(cls));
|
|
22
|
+
};
|
|
23
|
+
var removeClass = (el, cls) => {
|
|
24
|
+
if (!el) return;
|
|
25
|
+
el.classList.remove(cls);
|
|
26
|
+
};
|
|
27
|
+
var hasClass = (el, cls) => {
|
|
28
|
+
if (!el || !cls) return false;
|
|
29
|
+
if (cls.includes(" ")) throw new Error("className should not contain space.");
|
|
30
|
+
return el.classList.contains(cls);
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { addClass, classNameToArray, getStyle, hasClass, removeClass };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=style.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.mjs","names":[],"sources":["../../../../../packages/utils/dom/style.ts"],"sourcesContent":["import { isClient } from '../browser'\r\nimport { camelize } from '@vue/shared'\r\n\r\nexport const classNameToArray = (cls = '') =>\r\n cls.split(' ').filter((item) => !!item.trim())\r\n\r\nexport const getStyle = (element: HTMLElement, styleName: string): string => {\r\n if (!isClient || !element || !styleName) return ''\r\n let key = camelize(styleName)\r\n if (key === 'float') key = 'cssFloat'\r\n try {\r\n const style = (element.style as any)[key]\r\n if (style) return style\r\n const computed = document.defaultView?.getComputedStyle(element, '')\r\n return computed ? computed[key] : ''\r\n } catch (e) {\r\n return (element.style as any)[key]\r\n }\r\n}\r\n\r\nexport const addClass = (el: Element, cls: string) => {\r\n if (!el || !cls.trim()) return\r\n el.classList.add(...classNameToArray(cls))\r\n}\r\n\r\nexport const removeClass = (el: Element, cls: string) => {\r\n if (!el) return\r\n el.classList.remove(cls)\r\n}\r\n\r\nexport const hasClass = (el: Element, cls: string): boolean => {\r\n if (!el || !cls) return false\r\n if (cls.includes(' ')) throw new Error('className should not contain space.')\r\n return el.classList.contains(cls)\r\n}"],"mappings":";;;AAGA,IAAa,oBAAoB,MAAM,OACrC,IAAI,MAAM,IAAI,CAAC,QAAQ,SAAS,CAAC,CAAC,KAAK,MAAM,CAAC;AAEhD,IAAa,YAAY,SAAsB,cAA8B;AAC3E,KAAI,CAAC,YAAY,CAAC,WAAW,CAAC,UAAW,QAAO;CAChD,IAAI,MAAM,SAAS,UAAU;AAC7B,KAAI,QAAQ,QAAS,OAAM;AAC3B,KAAI;;EACF,MAAM,QAAS,QAAQ,MAAc;AACrC,MAAI,MAAO,QAAO;EAClB,MAAM,YAAA,wBAAW,SAAS,iBAAA,QAAA,0BAAA,KAAA,IAAA,KAAA,IAAA,sBAAa,iBAAiB,SAAS,GAAG;AACpE,SAAO,WAAW,SAAS,OAAO;UAC3B,GAAG;AACV,SAAQ,QAAQ,MAAc;;;AAIlC,IAAa,YAAY,IAAa,QAAgB;AACpD,KAAI,CAAC,MAAM,CAAC,IAAI,MAAM,CAAE;AACxB,IAAG,UAAU,IAAI,GAAG,iBAAiB,IAAI,CAAC;;AAG5C,IAAa,eAAe,IAAa,QAAgB;AACvD,KAAI,CAAC,GAAI;AACT,IAAG,UAAU,OAAO,IAAI;;AAG1B,IAAa,YAAY,IAAa,QAAyB;AAC7D,KAAI,CAAC,MAAM,CAAC,IAAK,QAAO;AACxB,KAAI,IAAI,SAAS,IAAI,CAAE,OAAM,IAAI,MAAM,sCAAsC;AAC7E,QAAO,GAAG,UAAU,SAAS,IAAI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function easeInOutCubic(t: number, b: number, c: number, d: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region packages/utils/easings.ts
|
|
2
|
+
function easeInOutCubic(t, b, c, d) {
|
|
3
|
+
const cc = c - b;
|
|
4
|
+
t /= d / 2;
|
|
5
|
+
if (t < 1) return cc / 2 * t * t * t + b;
|
|
6
|
+
return cc / 2 * ((t -= 2) * t * t + 2) + b;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { easeInOutCubic };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=easings.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"easings.mjs","names":[],"sources":["../../../../packages/utils/easings.ts"],"sourcesContent":["\r\nexport function easeInOutCubic(t: number, b: number, c: number, d: number) {\r\n const cc = c - b\r\n t /= d / 2\r\n if (t < 1) {\r\n return (cc / 2) * t * t * t + b\r\n }\r\n return (cc / 2) * ((t -= 2) * t * t + 2) + b\r\n}\r\n"],"mappings":";AACA,SAAgB,eAAe,GAAW,GAAW,GAAW,GAAW;CACzE,MAAM,KAAK,IAAI;AACf,MAAK,IAAI;AACT,KAAI,IAAI,EACN,QAAQ,KAAK,IAAK,IAAI,IAAI,IAAI;AAEhC,QAAQ,KAAK,MAAO,KAAK,KAAK,IAAI,IAAI,KAAK"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './dom/index.js';
|
|
2
|
+
export * from './vue/index.js';
|
|
3
|
+
export * from './console-log/index.js';
|
|
4
|
+
export * from './request/index.js';
|
|
5
|
+
export * from './create/index.js';
|
|
6
|
+
export * from './types.js';
|
|
7
|
+
export * from './typescript.js';
|
|
8
|
+
export * from './browser.js';
|
|
9
|
+
export * from './objects.js';
|
|
10
|
+
export * from './easings.js';
|
|
11
|
+
export * from './raf.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ifFirefox, isClient } from "./browser.mjs";
|
|
2
|
+
import { addClass, classNameToArray, getStyle, hasClass, removeClass } from "./dom/style.mjs";
|
|
3
|
+
import { easeInOutCubic } from "./easings.mjs";
|
|
4
|
+
import { isArray, isBoolean, isDate, isElement, isEmpty, isFunction, isNumber, isObject, isPlainObject, isPromise, isPropAbsent, isString, isStringNumber, isSymbol, isUndefined, isVNode, isWindow } from "./types.mjs";
|
|
5
|
+
import { cAF, rAF } from "./raf.mjs";
|
|
6
|
+
import { animateScrollTo, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, isScroll, scrollIntoView } from "./dom/scroll.mjs";
|
|
7
|
+
import { withInstall, withInstallDirective, withInstallFunction, withNoopInstall } from "./vue/install.mjs";
|
|
8
|
+
import { entriesOf, getProp, hasOwn, keysOf } from "./objects.mjs";
|
|
9
|
+
import { buildProp, buildProps, definePropType, hdPropKey, isHdProp } from "./vue/props/runtime.mjs";
|
|
10
|
+
import { error, logger, warning } from "./console-log/index.mjs";
|
|
11
|
+
import request, { RequestHttp, baseConfig } from "./request/index.mjs";
|
|
12
|
+
import { createMountContainer, createVnode, creator, mount } from "./create/index.mjs";
|
|
13
|
+
import { mutable } from "./typescript.mjs";
|
|
14
|
+
export { RequestHttp, addClass, animateScrollTo, baseConfig, buildProp, buildProps, cAF, classNameToArray, createMountContainer, createVnode, creator, definePropType, easeInOutCubic, entriesOf, error, getProp, getScrollBarWidth, getScrollContainer, getScrollElement, getScrollTop, getStyle, hasClass, hasOwn, hdPropKey, ifFirefox, isArray, isBoolean, isClient, isDate, isElement, isEmpty, isFunction, isHdProp, isNumber, isObject, isPlainObject, isPromise, isPropAbsent, isScroll, isString, isStringNumber, isSymbol, isUndefined, isVNode, isWindow, keysOf, logger, mount, mutable, rAF, removeClass, request, scrollIntoView, warning, withInstall, withInstallDirective, withInstallFunction, withNoopInstall };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Entries } from 'type-fest';
|
|
2
|
+
import type { Arrayable } from '.';
|
|
3
|
+
export declare const keysOf: <T extends object>(arr: T) => Array<keyof T>;
|
|
4
|
+
export declare const entriesOf: <T extends object>(arr: T) => Entries<T>;
|
|
5
|
+
export { hasOwn } from '@vue/shared';
|
|
6
|
+
export declare const getProp: <T = any>(obj: Record<string, any>, path: Arrayable<string>, defaultValue?: any) => {
|
|
7
|
+
value: T;
|
|
8
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { hasOwn } from "@vue/shared";
|
|
2
|
+
import { get, set } from "lodash-unified";
|
|
3
|
+
//#region packages/utils/objects.ts
|
|
4
|
+
var keysOf = (arr) => Object.keys(arr);
|
|
5
|
+
var entriesOf = (arr) => Object.entries(arr);
|
|
6
|
+
var getProp = (obj, path, defaultValue) => {
|
|
7
|
+
return {
|
|
8
|
+
get value() {
|
|
9
|
+
return get(obj, path, defaultValue);
|
|
10
|
+
},
|
|
11
|
+
set value(val) {
|
|
12
|
+
set(obj, path, val);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { entriesOf, getProp, hasOwn, keysOf };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=objects.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.mjs","names":[],"sources":["../../../../packages/utils/objects.ts"],"sourcesContent":["import { get, set } from 'lodash-unified'\r\nimport type { Entries } from 'type-fest'\r\nimport type { Arrayable } from '.'\r\n\r\nexport const keysOf = <T extends object>(arr: T) =>\r\n Object.keys(arr) as Array<keyof T>\r\nexport const entriesOf = <T extends object>(arr: T) =>\r\n Object.entries(arr) as Entries<T>\r\nexport { hasOwn } from '@vue/shared'\r\n\r\nexport const getProp = <T = any>(\r\n obj: Record<string, any>,\r\n path: Arrayable<string>,\r\n defaultValue?: any\r\n): { value: T } => {\r\n return {\r\n get value() {\r\n return get(obj, path, defaultValue)\r\n },\r\n set value(val: any) {\r\n set(obj, path, val)\r\n },\r\n }\r\n}\r\n"],"mappings":";;;AAIA,IAAa,UAA4B,QACvC,OAAO,KAAK,IAAI;AAClB,IAAa,aAA+B,QAC1C,OAAO,QAAQ,IAAI;AAGrB,IAAa,WACX,KACA,MACA,iBACiB;AACjB,QAAO;EACL,IAAI,QAAQ;AACV,UAAO,IAAI,KAAK,MAAM,aAAa;;EAErC,IAAI,MAAM,KAAU;AAClB,OAAI,KAAK,MAAM,IAAI;;EAEtB"}
|
package/es/utils/raf.mjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { isClient } from "./browser.mjs";
|
|
2
|
+
//#region packages/utils/raf.ts
|
|
3
|
+
var rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
|
|
4
|
+
var cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { cAF, rAF };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=raf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"raf.mjs","names":[],"sources":["../../../../packages/utils/raf.ts"],"sourcesContent":["import { isClient } from './browser'\r\n\r\nexport const rAF = (fn: () => void) =>\r\n isClient\r\n ? window.requestAnimationFrame(fn)\r\n : (setTimeout(fn, 16) as unknown as number)\r\n\r\nexport const cAF = (handle: number) =>\r\n isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle)"],"mappings":";;AAEA,IAAa,OAAO,OAClB,WACI,OAAO,sBAAsB,GAAG,GAC/B,WAAW,IAAI,GAAG;AAEzB,IAAa,OAAO,WAClB,WAAW,OAAO,qBAAqB,OAAO,GAAG,aAAa,OAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
2
|
+
type Result<T> = {
|
|
3
|
+
code: number;
|
|
4
|
+
message: string;
|
|
5
|
+
result: T;
|
|
6
|
+
};
|
|
7
|
+
export declare const baseConfig: {
|
|
8
|
+
baseURL: string;
|
|
9
|
+
timeout: number;
|
|
10
|
+
withCredentials: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare class RequestHttp {
|
|
13
|
+
instance: AxiosInstance;
|
|
14
|
+
resInterceptors: any;
|
|
15
|
+
CancelToken: any;
|
|
16
|
+
constructor(config: AxiosRequestConfig);
|
|
17
|
+
removeResponseInterceptors(): void;
|
|
18
|
+
request(config: AxiosRequestConfig): Promise<AxiosResponse>;
|
|
19
|
+
get<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>>;
|
|
20
|
+
post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>>;
|
|
21
|
+
put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>>;
|
|
22
|
+
delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>>;
|
|
23
|
+
}
|
|
24
|
+
export declare const request: RequestHttp;
|
|
25
|
+
export default request;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { _defineProperty } from "../../_virtual/_@oxc-project_runtime@0.127.0/helpers/defineProperty.mjs";
|
|
2
|
+
import axios from "axios";
|
|
3
|
+
//#region packages/utils/request/index.ts
|
|
4
|
+
var baseConfig = {
|
|
5
|
+
baseURL: "",
|
|
6
|
+
timeout: 5e4,
|
|
7
|
+
withCredentials: true
|
|
8
|
+
};
|
|
9
|
+
var RequestHttp = class {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
_defineProperty(this, "instance", void 0);
|
|
12
|
+
_defineProperty(this, "resInterceptors", void 0);
|
|
13
|
+
_defineProperty(this, "CancelToken", void 0);
|
|
14
|
+
this.instance = axios.create(config);
|
|
15
|
+
this.CancelToken = axios.CancelToken;
|
|
16
|
+
this.resInterceptors = this.instance.interceptors.response.use((res) => {
|
|
17
|
+
if (res.status === 200 && (res.data.success || res.data.status === 0)) return Promise.resolve(res.data.data);
|
|
18
|
+
else {
|
|
19
|
+
console.error(res.data.message);
|
|
20
|
+
return Promise.reject(res.data);
|
|
21
|
+
}
|
|
22
|
+
}, (error) => {
|
|
23
|
+
return Promise.reject(error.response);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
removeResponseInterceptors() {
|
|
27
|
+
this.instance.interceptors.response.eject(this.resInterceptors);
|
|
28
|
+
}
|
|
29
|
+
request(config) {
|
|
30
|
+
return this.instance.request(config);
|
|
31
|
+
}
|
|
32
|
+
get(url, config) {
|
|
33
|
+
return this.instance.get(url, config);
|
|
34
|
+
}
|
|
35
|
+
post(url, data, config) {
|
|
36
|
+
return this.instance.post(url, data, config);
|
|
37
|
+
}
|
|
38
|
+
put(url, data, config) {
|
|
39
|
+
return this.instance.put(url, data, config);
|
|
40
|
+
}
|
|
41
|
+
delete(url, config) {
|
|
42
|
+
return this.instance.delete(url, config);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var request = new RequestHttp(baseConfig);
|
|
46
|
+
//#endregion
|
|
47
|
+
export { RequestHttp, baseConfig, request as default, request };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../../packages/utils/request/index.ts"],"sourcesContent":["import axios, { AxiosInstance, AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios'\r\n\r\ntype Result<T> = {\r\n code: number\r\n message: string\r\n result: T\r\n}\r\n\r\nexport const baseConfig = {\r\n baseURL: '',\r\n timeout: 50000,\r\n withCredentials: true,\r\n}\r\n\r\nexport class RequestHttp {\r\n instance: AxiosInstance\r\n resInterceptors: any\r\n CancelToken: any\r\n constructor(config: AxiosRequestConfig) {\r\n // 创建 axios 实例\r\n this.instance = axios.create(config)\r\n this.CancelToken = axios.CancelToken\r\n // this.instance.interceptors.request.use(\r\n // (config) => {\r\n // // 添加 token\r\n // let token = sessionStorage.getItem(\"authorization\") as string;\r\n // if (token) {\r\n // token = JSON.parse(token);\r\n // config.headers.authorization = token;\r\n // }\r\n // return config;\r\n // },\r\n // (error) => {\r\n // return Promise.reject(error);\r\n // }\r\n // );\r\n\r\n this.resInterceptors = this.instance.interceptors.response.use(\r\n (res: AxiosResponse) => {\r\n if (res.status === 200 && (res.data.success || res.data.status === 0)) {\r\n return Promise.resolve(res.data.data)\r\n } else {\r\n console.error(res.data.message)\r\n return Promise.reject(res.data)\r\n }\r\n },\r\n (error: AxiosError) => {\r\n return Promise.reject(error.response)\r\n },\r\n )\r\n }\r\n\r\n // 定义请求方法\r\n\r\n public removeResponseInterceptors() {\r\n this.instance.interceptors.response.eject(this.resInterceptors)\r\n }\r\n\r\n public request(config: AxiosRequestConfig): Promise<AxiosResponse> {\r\n return this.instance.request(config)\r\n }\r\n\r\n public get<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>> {\r\n return this.instance.get(url, config)\r\n }\r\n\r\n public post<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>> {\r\n return this.instance.post(url, data, config)\r\n }\r\n\r\n public put<T = any>(url: string, data?: any, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>> {\r\n return this.instance.put(url, data, config)\r\n }\r\n\r\n public delete<T = any>(url: string, config?: AxiosRequestConfig): Promise<AxiosResponse<Result<T>>> {\r\n return this.instance.delete(url, config)\r\n }\r\n}\r\n\r\nexport const request = new RequestHttp(baseConfig)\r\nexport default request\r\n"],"mappings":";;;AAQA,IAAa,aAAa;CACxB,SAAS;CACT,SAAS;CACT,iBAAiB;CAClB;AAED,IAAa,cAAb,MAAyB;CAIvB,YAAY,QAA4B;wBAHxC,YAAA,KAAA,EAAA;wBACA,mBAAA,KAAA,EAAA;wBACA,eAAA,KAAA,EAAA;AAGE,OAAK,WAAW,MAAM,OAAO,OAAO;AACpC,OAAK,cAAc,MAAM;AAgBzB,OAAK,kBAAkB,KAAK,SAAS,aAAa,SAAS,KACxD,QAAuB;AACtB,OAAI,IAAI,WAAW,QAAQ,IAAI,KAAK,WAAW,IAAI,KAAK,WAAW,GACjE,QAAO,QAAQ,QAAQ,IAAI,KAAK,KAAK;QAChC;AACL,YAAQ,MAAM,IAAI,KAAK,QAAQ;AAC/B,WAAO,QAAQ,OAAO,IAAI,KAAK;;MAGlC,UAAsB;AACrB,UAAO,QAAQ,OAAO,MAAM,SAAS;IAExC;;CAKH,6BAAoC;AAClC,OAAK,SAAS,aAAa,SAAS,MAAM,KAAK,gBAAgB;;CAGjE,QAAe,QAAoD;AACjE,SAAO,KAAK,SAAS,QAAQ,OAAO;;CAGtC,IAAoB,KAAa,QAAgE;AAC/F,SAAO,KAAK,SAAS,IAAI,KAAK,OAAO;;CAGvC,KAAqB,KAAa,MAAY,QAAgE;AAC5G,SAAO,KAAK,SAAS,KAAK,KAAK,MAAM,OAAO;;CAG9C,IAAoB,KAAa,MAAY,QAAgE;AAC3G,SAAO,KAAK,SAAS,IAAI,KAAK,MAAM,OAAO;;CAG7C,OAAuB,KAAa,QAAgE;AAClG,SAAO,KAAK,SAAS,OAAO,KAAK,OAAO;;;AAI5C,IAAa,UAAU,IAAI,YAAY,WAAW"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { isArray, isFunction, isObject, isString, isDate, isPromise, isSymbol, isPlainObject, } from '@vue/shared';
|
|
2
|
+
export { isVNode } from 'vue';
|
|
3
|
+
export declare const isUndefined: (val: any) => val is undefined;
|
|
4
|
+
export declare const isBoolean: (val: any) => val is boolean;
|
|
5
|
+
export declare const isNumber: (val: any) => val is number;
|
|
6
|
+
export declare const isEmpty: (val: unknown) => boolean;
|
|
7
|
+
export declare const isElement: (e: unknown) => e is Element;
|
|
8
|
+
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
|
|
9
|
+
export declare const isStringNumber: (val: string) => boolean;
|
|
10
|
+
export declare const isWindow: (val: unknown) => val is Window;
|