@ctzy-web-client/plugin-component-vue 1.0.7 → 1.0.9
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/package.json +3 -3
- package/src/advance-select/advance-operation.vue +2 -1
- package/src/advance-select/advance-option.vue +2 -1
- package/src/advance-select/advance-select.vue +2 -1
- package/src/advance-select/events-helpers.js +2 -1
- package/src/advance-select/index.js +1 -0
- package/src/advance-select/use-advance-option.js +2 -1
- package/src/advance-select/use-advance-select.js +1 -0
- package/src/application-slot/application-slot.js +2 -1
- package/src/application-slot/breadcrumb-item.vue +1 -0
- package/src/application-slot/header-tools-item.vue +1 -0
- package/src/application-slot/index.js +1 -0
- package/src/breadcrumb-select/breadcrumb-select.vue +2 -1
- package/src/breadcrumb-select/index.js +1 -0
- package/src/components.js +1 -0
- package/src/contextmenu/contextmenu-item.vue +2 -1
- package/src/contextmenu/contextmenu.vue +2 -1
- package/src/contextmenu/index.js +1 -0
- package/src/contextmenu/use-contextmenu.js +2 -1
- package/src/data-form/data-form-item.vue +2 -1
- package/src/data-form/data-form.vue +2 -1
- package/src/data-form/dynamic-component.js +1 -0
- package/src/data-form/form-components/Blots/AtBlot.js +1 -0
- package/src/data-form/form-components/bwa-date-picker.vue +1 -0
- package/src/data-form/form-components/bwa-date-time-picker.vue +1 -0
- package/src/data-form/form-components/bwa-input-float.vue +1 -0
- package/src/data-form/form-components/bwa-input-integer.vue +1 -0
- package/src/data-form/form-components/bwa-input.vue +1 -0
- package/src/data-form/form-components/bwa-multi-select.vue +1 -0
- package/src/data-form/form-components/bwa-rich-text-tinymce.vue +3 -2
- package/src/data-form/form-components/bwa-rich-text.vue +2 -1
- package/src/data-form/form-components/bwa-select.vue +1 -0
- package/src/data-form/form-components/bwa-textarea.vue +1 -0
- package/src/data-form/form-components/bwa-upload.vue +2 -1
- package/src/data-form/form-components/bwa-user-multi-select.vue +1 -0
- package/src/data-form/form-components/bwa-user-select.vue +2 -1
- package/src/data-form/index.js +1 -0
- package/src/data-table/data-column-view.vue +2 -1
- package/src/data-table/data-table-card.vue +2 -1
- package/src/data-table/data-table-column.vue +2 -1
- package/src/data-table/data-table.vue +2 -1
- package/src/data-table/dynamic-component.js +1 -0
- package/src/data-table/index.js +1 -0
- package/src/data-table/use-datatable-drag.js +1 -0
- package/src/datatable-settings/datatable-settings.vue +2 -1
- package/src/datatable-settings/index.js +1 -0
- package/src/date-range/date-picker.vue +2 -1
- package/src/date-range/date-range.vue +4 -3
- package/src/date-range/index.js +1 -0
- package/src/drag-list/constants.js +1 -0
- package/src/drag-list/drag-item.vue +2 -1
- package/src/drag-list/drag-list.vue +2 -1
- package/src/drag-list/index.js +1 -0
- package/src/drag-list/use-drag-list.js +1 -0
- package/src/dragable/constants.js +1 -0
- package/src/dragable/dragable-item.vue +2 -1
- package/src/dragable/dragable-operation.vue +2 -1
- package/src/dragable/dragable.vue +2 -1
- package/src/dragable/index.js +1 -0
- package/src/dragable/use-dragable.js +1 -0
- package/src/filter-panel/conditions/condition.js +1 -0
- package/src/filter-panel/conditions/date-range-condition.vue +1 -0
- package/src/filter-panel/conditions/department-condition/department-condition.vue +2 -1
- package/src/filter-panel/conditions/department-condition/department-node.vue +2 -1
- package/src/filter-panel/conditions/index.js +1 -0
- package/src/filter-panel/conditions/input-condition.vue +2 -1
- package/src/filter-panel/conditions/multi-user-condition.vue +2 -1
- package/src/filter-panel/conditions/multiple-menu-condition.vue +1 -0
- package/src/filter-panel/conditions/single-menu-condition.vue +2 -1
- package/src/filter-panel/conditions/single-user-condition.vue +2 -1
- package/src/filter-panel/filter-panel-item.vue +2 -1
- package/src/filter-panel/filter-panel.vue +2 -1
- package/src/filter-panel/index.js +1 -0
- package/src/filter-panel/use-filter-panel-item.js +2 -1
- package/src/filter-panel/use-filter-panel.js +2 -1
- package/src/hooks/use-data/index.js +3 -2
- package/src/index.js +1 -0
- package/src/layout/index.js +1 -0
- package/src/layout/layout.vue +2 -1
- package/src/make-installer.js +2 -1
- package/src/math/Rectangle.js +1 -0
- package/src/menu/index.js +1 -0
- package/src/menu/menu-item.vue +2 -1
- package/src/menu/menu.vue +2 -1
- package/src/panel/index.js +1 -0
- package/src/panel/panel.vue +2 -1
- package/src/panel-tabs/index.js +1 -0
- package/src/panel-tabs/panel-tabs.js +2 -1
- package/src/pct-filter-panel/index.js +1 -0
- package/src/pct-filter-panel/pct-compents/index.js +1 -0
- package/src/pct-filter-panel/pct-compents/pct-Input-condition.vue +2 -1
- package/src/pct-filter-panel/pct-compents/pct-date-range-condition.vue +2 -1
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition.vue +3 -2
- package/src/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.vue +3 -2
- package/src/pct-filter-panel/pct-filter-panel-item.vue +2 -1
- package/src/pct-filter-panel/pct-filter-panel.vue +2 -1
- package/src/pct-filter-panel/use-filter-panel-item.js +2 -1
- package/src/pct-filter-panel/use-filter-panel.js +3 -2
- package/src/plugins.js +1 -0
- package/src/progress/index.js +1 -0
- package/src/progress/progress-item.vue +2 -1
- package/src/progress/progress.vue +2 -1
- package/src/progress/use-progress.js +1 -0
- package/src/utils/db.js +1 -0
- package/src/utils.js +1 -0
- package/src/where-filter-panel/use-where-filter-panel.js +2 -1
- package/src/where-filter-panel/where-filter-panel.vue +1 -0
- package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
- package/es/advance-select/advance-operation.mjs +0 -43
- package/es/advance-select/advance-option.mjs +0 -125
- package/es/advance-select/advance-select.mjs +0 -359
- package/es/advance-select/events-helpers.mjs +0 -29
- package/es/advance-select/index.mjs +0 -13
- package/es/advance-select/use-advance-option.mjs +0 -43
- package/es/advance-select/use-advance-select.mjs +0 -117
- package/es/application-slot/application-slot.mjs +0 -51
- package/es/application-slot/breadcrumb-item.mjs +0 -23
- package/es/application-slot/header-tools-item.mjs +0 -23
- package/es/application-slot/index.mjs +0 -16
- package/es/breadcrumb-select/breadcrumb-select.mjs +0 -155
- package/es/breadcrumb-select/index.mjs +0 -6
- package/es/components.mjs +0 -22
- package/es/contextmenu/contextmenu-item.mjs +0 -21
- package/es/contextmenu/contextmenu.mjs +0 -64
- package/es/contextmenu/index.mjs +0 -10
- package/es/contextmenu/use-contextmenu.mjs +0 -85
- package/es/data-form/data-form-item.mjs +0 -53
- package/es/data-form/data-form.mjs +0 -175
- package/es/data-form/dynamic-component.mjs +0 -23
- package/es/data-form/form-components/Blots/AtBlot.mjs +0 -25
- package/es/data-form/form-components/bwa-date-picker.mjs +0 -45
- package/es/data-form/form-components/bwa-date-time-picker.mjs +0 -50
- package/es/data-form/form-components/bwa-input-float.mjs +0 -43
- package/es/data-form/form-components/bwa-input-integer.mjs +0 -56
- package/es/data-form/form-components/bwa-input.mjs +0 -38
- package/es/data-form/form-components/bwa-multi-select.mjs +0 -35
- package/es/data-form/form-components/bwa-rich-text-tinymce.mjs +0 -234
- package/es/data-form/form-components/bwa-rich-text.mjs +0 -325
- package/es/data-form/form-components/bwa-select.mjs +0 -76
- package/es/data-form/form-components/bwa-textarea.mjs +0 -33
- package/es/data-form/form-components/bwa-upload.mjs +0 -159
- package/es/data-form/form-components/bwa-user-multi-select.mjs +0 -30
- package/es/data-form/form-components/bwa-user-select.mjs +0 -69
- package/es/data-form/index.mjs +0 -34
- package/es/data-table/data-column-view.mjs +0 -131
- package/es/data-table/data-table-card.mjs +0 -118
- package/es/data-table/data-table-column.mjs +0 -56
- package/es/data-table/data-table.mjs +0 -369
- package/es/data-table/dynamic-component.mjs +0 -48
- package/es/data-table/index.mjs +0 -13
- package/es/data-table/use-datatable-drag.mjs +0 -110
- package/es/datatable-settings/datatable-settings.mjs +0 -309
- package/es/datatable-settings/index.mjs +0 -6
- package/es/date-range/date-picker.mjs +0 -128
- package/es/date-range/date-range.mjs +0 -176
- package/es/date-range/index.mjs +0 -6
- package/es/drag-list/constants.mjs +0 -3
- package/es/drag-list/drag-item.mjs +0 -49
- package/es/drag-list/drag-list.mjs +0 -56
- package/es/drag-list/index.mjs +0 -6
- package/es/drag-list/use-drag-list.mjs +0 -154
- package/es/dragable/constants.mjs +0 -4
- package/es/dragable/dragable-item.mjs +0 -25
- package/es/dragable/dragable-operation.mjs +0 -32
- package/es/dragable/dragable.mjs +0 -31
- package/es/dragable/index.mjs +0 -15
- package/es/dragable/use-dragable.mjs +0 -134
- package/es/filter-panel/conditions/condition.mjs +0 -30
- package/es/filter-panel/conditions/date-range-condition.mjs +0 -46
- package/es/filter-panel/conditions/department-condition/department-condition.mjs +0 -81
- package/es/filter-panel/conditions/department-condition/department-node.mjs +0 -74
- package/es/filter-panel/conditions/index.mjs +0 -21
- package/es/filter-panel/conditions/input-condition.mjs +0 -83
- package/es/filter-panel/conditions/multi-user-condition.mjs +0 -64
- package/es/filter-panel/conditions/multiple-menu-condition.mjs +0 -41
- package/es/filter-panel/conditions/single-menu-condition.mjs +0 -68
- package/es/filter-panel/conditions/single-user-condition.mjs +0 -64
- package/es/filter-panel/filter-panel-item.mjs +0 -47
- package/es/filter-panel/filter-panel.mjs +0 -180
- package/es/filter-panel/index.mjs +0 -15
- package/es/filter-panel/use-filter-panel-item.mjs +0 -52
- package/es/filter-panel/use-filter-panel.mjs +0 -135
- package/es/hooks/use-data/index.mjs +0 -152
- package/es/index.mjs +0 -27
- package/es/layout/index.mjs +0 -6
- package/es/layout/layout.mjs +0 -86
- package/es/make-installer.mjs +0 -34
- package/es/math/Rectangle.mjs +0 -25
- package/es/menu/index.mjs +0 -6
- package/es/menu/menu-item.mjs +0 -75
- package/es/menu/menu.mjs +0 -60
- package/es/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.mjs +0 -6372
- package/es/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.mjs +0 -1517
- package/es/panel/index.mjs +0 -6
- package/es/panel/panel.mjs +0 -55
- package/es/panel-tabs/index.mjs +0 -6
- package/es/panel-tabs/panel-tabs.mjs +0 -66
- package/es/pct-filter-panel/index.mjs +0 -10
- package/es/pct-filter-panel/pct-compents/index.mjs +0 -10
- package/es/pct-filter-panel/pct-compents/pct-Input-condition.mjs +0 -71
- package/es/pct-filter-panel/pct-compents/pct-date-range-condition.mjs +0 -74
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition.mjs +0 -186
- package/es/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.mjs +0 -147
- package/es/pct-filter-panel/pct-filter-panel-item.mjs +0 -48
- package/es/pct-filter-panel/pct-filter-panel.mjs +0 -251
- package/es/pct-filter-panel/use-filter-panel-item.mjs +0 -56
- package/es/pct-filter-panel/use-filter-panel.mjs +0 -127
- package/es/plugins.mjs +0 -5
- package/es/progress/index.mjs +0 -10
- package/es/progress/progress-item.mjs +0 -68
- package/es/progress/progress.mjs +0 -74
- package/es/progress/use-progress.mjs +0 -46
- package/es/utils/db.mjs +0 -9
- package/es/utils.mjs +0 -99
- package/es/where-filter-panel/index.mjs +0 -1
- package/es/where-filter-panel/use-where-filter-panel.mjs +0 -18
- package/es/where-filter-panel/where-filter-panel.mjs +0 -17
- package/lib/_virtual/_plugin-vue_export-helper.js +0 -13
- package/lib/advance-select/advance-operation.js +0 -47
- package/lib/advance-select/advance-option.js +0 -129
- package/lib/advance-select/advance-select.js +0 -363
- package/lib/advance-select/events-helpers.js +0 -33
- package/lib/advance-select/index.js +0 -20
- package/lib/advance-select/use-advance-option.js +0 -47
- package/lib/advance-select/use-advance-select.js +0 -122
- package/lib/application-slot/application-slot.js +0 -55
- package/lib/application-slot/breadcrumb-item.js +0 -27
- package/lib/application-slot/header-tools-item.js +0 -27
- package/lib/application-slot/index.js +0 -23
- package/lib/breadcrumb-select/breadcrumb-select.js +0 -159
- package/lib/breadcrumb-select/index.js +0 -11
- package/lib/components.js +0 -26
- package/lib/contextmenu/contextmenu-item.js +0 -25
- package/lib/contextmenu/contextmenu.js +0 -68
- package/lib/contextmenu/index.js +0 -16
- package/lib/contextmenu/use-contextmenu.js +0 -89
- package/lib/data-form/data-form-item.js +0 -57
- package/lib/data-form/data-form.js +0 -179
- package/lib/data-form/dynamic-component.js +0 -27
- package/lib/data-form/form-components/Blots/AtBlot.js +0 -31
- package/lib/data-form/form-components/bwa-date-picker.js +0 -49
- package/lib/data-form/form-components/bwa-date-time-picker.js +0 -54
- package/lib/data-form/form-components/bwa-input-float.js +0 -47
- package/lib/data-form/form-components/bwa-input-integer.js +0 -60
- package/lib/data-form/form-components/bwa-input.js +0 -42
- package/lib/data-form/form-components/bwa-multi-select.js +0 -39
- package/lib/data-form/form-components/bwa-rich-text-tinymce.js +0 -242
- package/lib/data-form/form-components/bwa-rich-text.js +0 -333
- package/lib/data-form/form-components/bwa-select.js +0 -80
- package/lib/data-form/form-components/bwa-textarea.js +0 -37
- package/lib/data-form/form-components/bwa-upload.js +0 -163
- package/lib/data-form/form-components/bwa-user-multi-select.js +0 -34
- package/lib/data-form/form-components/bwa-user-select.js +0 -73
- package/lib/data-form/index.js +0 -40
- package/lib/data-table/data-column-view.js +0 -135
- package/lib/data-table/data-table-card.js +0 -122
- package/lib/data-table/data-table-column.js +0 -60
- package/lib/data-table/data-table.js +0 -373
- package/lib/data-table/dynamic-component.js +0 -56
- package/lib/data-table/index.js +0 -20
- package/lib/data-table/use-datatable-drag.js +0 -114
- package/lib/datatable-settings/datatable-settings.js +0 -313
- package/lib/datatable-settings/index.js +0 -11
- package/lib/date-range/date-picker.js +0 -136
- package/lib/date-range/date-range.js +0 -180
- package/lib/date-range/index.js +0 -11
- package/lib/drag-list/constants.js +0 -7
- package/lib/drag-list/drag-item.js +0 -53
- package/lib/drag-list/drag-list.js +0 -60
- package/lib/drag-list/index.js +0 -11
- package/lib/drag-list/use-drag-list.js +0 -158
- package/lib/dragable/constants.js +0 -9
- package/lib/dragable/dragable-item.js +0 -29
- package/lib/dragable/dragable-operation.js +0 -36
- package/lib/dragable/dragable.js +0 -35
- package/lib/dragable/index.js +0 -22
- package/lib/dragable/use-dragable.js +0 -138
- package/lib/filter-panel/conditions/condition.js +0 -34
- package/lib/filter-panel/conditions/date-range-condition.js +0 -50
- package/lib/filter-panel/conditions/department-condition/department-condition.js +0 -85
- package/lib/filter-panel/conditions/department-condition/department-node.js +0 -78
- package/lib/filter-panel/conditions/index.js +0 -26
- package/lib/filter-panel/conditions/input-condition.js +0 -87
- package/lib/filter-panel/conditions/multi-user-condition.js +0 -68
- package/lib/filter-panel/conditions/multiple-menu-condition.js +0 -45
- package/lib/filter-panel/conditions/single-menu-condition.js +0 -72
- package/lib/filter-panel/conditions/single-user-condition.js +0 -68
- package/lib/filter-panel/filter-panel-item.js +0 -51
- package/lib/filter-panel/filter-panel.js +0 -184
- package/lib/filter-panel/index.js +0 -20
- package/lib/filter-panel/use-filter-panel-item.js +0 -56
- package/lib/filter-panel/use-filter-panel.js +0 -139
- package/lib/hooks/use-data/index.js +0 -157
- package/lib/index.js +0 -60
- package/lib/layout/index.js +0 -11
- package/lib/layout/layout.js +0 -90
- package/lib/make-installer.js +0 -62
- package/lib/math/Rectangle.js +0 -29
- package/lib/menu/index.js +0 -11
- package/lib/menu/menu-item.js +0 -79
- package/lib/menu/menu.js +0 -64
- package/lib/node_modules/.pnpm/@vueuse_core@9.6.0_vue@3.2.41/node_modules/@vueuse/core/index.js +0 -6635
- package/lib/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.js +0 -1628
- package/lib/panel/index.js +0 -11
- package/lib/panel/panel.js +0 -59
- package/lib/panel-tabs/index.js +0 -11
- package/lib/panel-tabs/panel-tabs.js +0 -70
- package/lib/pct-filter-panel/index.js +0 -14
- package/lib/pct-filter-panel/pct-compents/index.js +0 -16
- package/lib/pct-filter-panel/pct-compents/pct-Input-condition.js +0 -75
- package/lib/pct-filter-panel/pct-compents/pct-date-range-condition.js +0 -78
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition.js +0 -190
- package/lib/pct-filter-panel/pct-compents/pct-multiple-menu-condition2.js +0 -151
- package/lib/pct-filter-panel/pct-filter-panel-item.js +0 -52
- package/lib/pct-filter-panel/pct-filter-panel.js +0 -255
- package/lib/pct-filter-panel/use-filter-panel-item.js +0 -60
- package/lib/pct-filter-panel/use-filter-panel.js +0 -131
- package/lib/plugins.js +0 -9
- package/lib/progress/index.js +0 -16
- package/lib/progress/progress-item.js +0 -72
- package/lib/progress/progress.js +0 -78
- package/lib/progress/use-progress.js +0 -51
- package/lib/utils/db.js +0 -17
- package/lib/utils.js +0 -110
- package/lib/where-filter-panel/index.js +0 -2
- package/lib/where-filter-panel/use-where-filter-panel.js +0 -22
- package/lib/where-filter-panel/where-filter-panel.js +0 -21
- package/style/advance-select.css +0 -1
- package/style/breadcrumb-select.css +0 -1
- package/style/common.css +0 -1
- package/style/contextmenu.css +0 -1
- package/style/data-form.css +0 -1
- package/style/data-table.css +0 -1
- package/style/datatable-settings.css +0 -1
- package/style/date-range.css +0 -1
- package/style/department-condition.css +0 -1
- package/style/drag-list.css +0 -1
- package/style/dragable.css +0 -1
- package/style/filter-panel.css +0 -1
- package/style/index.css +0 -1
- package/style/input-condition.css +0 -1
- package/style/layout.css +0 -1
- package/style/menu.css +0 -1
- package/style/panel-tabs.css +0 -1
- package/style/panel.css +0 -1
- package/style/pct-filter-panel.css +0 -1
- package/style/progress.css +0 -1
- package/style/rich-text.css +0 -1
- package/style/var.css +0 -1
- /package/style/{src/advance-select.scss → advance-select.scss} +0 -0
- /package/style/{src/breadcrumb-select.scss → breadcrumb-select.scss} +0 -0
- /package/style/{src/common → common}/var.scss +0 -0
- /package/style/{src/common.scss → common.scss} +0 -0
- /package/style/{src/contextmenu.scss → contextmenu.scss} +0 -0
- /package/style/{src/data-form.scss → data-form.scss} +0 -0
- /package/style/{src/data-table.scss → data-table.scss} +0 -0
- /package/style/{src/datatable-settings.scss → datatable-settings.scss} +0 -0
- /package/style/{src/date-range.scss → date-range.scss} +0 -0
- /package/style/{src/department-condition.scss → department-condition.scss} +0 -0
- /package/style/{src/drag-list.scss → drag-list.scss} +0 -0
- /package/style/{src/dragable.scss → dragable.scss} +0 -0
- /package/style/{src/filter-panel.scss → filter-panel.scss} +0 -0
- /package/style/{src/index.scss → index.scss} +0 -0
- /package/style/{src/input-condition.scss → input-condition.scss} +0 -0
- /package/style/{src/layout.scss → layout.scss} +0 -0
- /package/style/{src/menu.scss → menu.scss} +0 -0
- /package/style/{src/mixins → mixins}/_var.scss +0 -0
- /package/style/{src/mixins → mixins}/config.scss +0 -0
- /package/style/{src/mixins → mixins}/function.scss +0 -0
- /package/style/{src/mixins → mixins}/mixins.scss +0 -0
- /package/style/{src/panel-tabs.scss → panel-tabs.scss} +0 -0
- /package/style/{src/panel.scss → panel.scss} +0 -0
- /package/style/{src/pct-filter-panel.scss → pct-filter-panel.scss} +0 -0
- /package/style/{src/progress.scss → progress.scss} +0 -0
- /package/style/{src/rich-text.scss → rich-text.scss} +0 -0
- /package/style/{src/theme → theme}/theme.scss +0 -0
- /package/style/{src/theme → theme}/var.scss +0 -0
- /package/style/{src/var.scss → var.scss} +0 -0
package/lib/node_modules/.pnpm/@vueuse_shared@9.6.0_vue@3.2.41/node_modules/@vueuse/shared/index.js
DELETED
|
@@ -1,1628 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vueDemi = require('vue-demi');
|
|
6
|
-
|
|
7
|
-
var __defProp$9 = Object.defineProperty;
|
|
8
|
-
var __defProps$6 = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp$b = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues$9 = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp$b.call(b, prop))
|
|
17
|
-
__defNormalProp$9(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols$b)
|
|
19
|
-
for (var prop of __getOwnPropSymbols$b(b)) {
|
|
20
|
-
if (__propIsEnum$b.call(b, prop))
|
|
21
|
-
__defNormalProp$9(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
|
|
26
|
-
function computedEager(fn, options) {
|
|
27
|
-
var _a;
|
|
28
|
-
const result = vueDemi.shallowRef();
|
|
29
|
-
vueDemi.watchEffect(() => {
|
|
30
|
-
result.value = fn();
|
|
31
|
-
}, __spreadProps$6(__spreadValues$9({}, options), {
|
|
32
|
-
flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
|
|
33
|
-
}));
|
|
34
|
-
return vueDemi.readonly(result);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
var _a;
|
|
38
|
-
const isClient = typeof window !== "undefined";
|
|
39
|
-
const isDef = (val) => typeof val !== "undefined";
|
|
40
|
-
const assert = (condition, ...infos) => {
|
|
41
|
-
if (!condition)
|
|
42
|
-
console.warn(...infos);
|
|
43
|
-
};
|
|
44
|
-
const toString = Object.prototype.toString;
|
|
45
|
-
const isBoolean = (val) => typeof val === "boolean";
|
|
46
|
-
const isFunction = (val) => typeof val === "function";
|
|
47
|
-
const isNumber = (val) => typeof val === "number";
|
|
48
|
-
const isString = (val) => typeof val === "string";
|
|
49
|
-
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
50
|
-
const isWindow = (val) => typeof window !== "undefined" && toString.call(val) === "[object Window]";
|
|
51
|
-
const now = () => Date.now();
|
|
52
|
-
const timestamp = () => +Date.now();
|
|
53
|
-
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
|
|
54
|
-
const noop = () => {
|
|
55
|
-
};
|
|
56
|
-
const rand = (min, max) => {
|
|
57
|
-
min = Math.ceil(min);
|
|
58
|
-
max = Math.floor(max);
|
|
59
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
60
|
-
};
|
|
61
|
-
const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
62
|
-
const hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
|
|
63
|
-
|
|
64
|
-
function resolveUnref(r) {
|
|
65
|
-
return typeof r === "function" ? r() : vueDemi.unref(r);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function createFilterWrapper(filter, fn) {
|
|
69
|
-
function wrapper(...args) {
|
|
70
|
-
filter(() => fn.apply(this, args), { fn, thisArg: this, args });
|
|
71
|
-
}
|
|
72
|
-
return wrapper;
|
|
73
|
-
}
|
|
74
|
-
const bypassFilter = (invoke) => {
|
|
75
|
-
return invoke();
|
|
76
|
-
};
|
|
77
|
-
function debounceFilter(ms, options = {}) {
|
|
78
|
-
let timer;
|
|
79
|
-
let maxTimer;
|
|
80
|
-
const filter = (invoke) => {
|
|
81
|
-
const duration = resolveUnref(ms);
|
|
82
|
-
const maxDuration = resolveUnref(options.maxWait);
|
|
83
|
-
if (timer)
|
|
84
|
-
clearTimeout(timer);
|
|
85
|
-
if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
|
|
86
|
-
if (maxTimer) {
|
|
87
|
-
clearTimeout(maxTimer);
|
|
88
|
-
maxTimer = null;
|
|
89
|
-
}
|
|
90
|
-
return invoke();
|
|
91
|
-
}
|
|
92
|
-
if (maxDuration && !maxTimer) {
|
|
93
|
-
maxTimer = setTimeout(() => {
|
|
94
|
-
if (timer)
|
|
95
|
-
clearTimeout(timer);
|
|
96
|
-
maxTimer = null;
|
|
97
|
-
invoke();
|
|
98
|
-
}, maxDuration);
|
|
99
|
-
}
|
|
100
|
-
timer = setTimeout(() => {
|
|
101
|
-
if (maxTimer)
|
|
102
|
-
clearTimeout(maxTimer);
|
|
103
|
-
maxTimer = null;
|
|
104
|
-
invoke();
|
|
105
|
-
}, duration);
|
|
106
|
-
};
|
|
107
|
-
return filter;
|
|
108
|
-
}
|
|
109
|
-
function throttleFilter(ms, trailing = true, leading = true) {
|
|
110
|
-
let lastExec = 0;
|
|
111
|
-
let timer;
|
|
112
|
-
let isLeading = true;
|
|
113
|
-
const clear = () => {
|
|
114
|
-
if (timer) {
|
|
115
|
-
clearTimeout(timer);
|
|
116
|
-
timer = void 0;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const filter = (invoke) => {
|
|
120
|
-
const duration = resolveUnref(ms);
|
|
121
|
-
const elapsed = Date.now() - lastExec;
|
|
122
|
-
clear();
|
|
123
|
-
if (duration <= 0) {
|
|
124
|
-
lastExec = Date.now();
|
|
125
|
-
return invoke();
|
|
126
|
-
}
|
|
127
|
-
if (elapsed > duration && (leading || !isLeading)) {
|
|
128
|
-
lastExec = Date.now();
|
|
129
|
-
invoke();
|
|
130
|
-
} else if (trailing) {
|
|
131
|
-
timer = setTimeout(() => {
|
|
132
|
-
lastExec = Date.now();
|
|
133
|
-
isLeading = true;
|
|
134
|
-
clear();
|
|
135
|
-
invoke();
|
|
136
|
-
}, duration - elapsed);
|
|
137
|
-
}
|
|
138
|
-
if (!leading && !timer)
|
|
139
|
-
timer = setTimeout(() => isLeading = true, duration);
|
|
140
|
-
isLeading = false;
|
|
141
|
-
};
|
|
142
|
-
return filter;
|
|
143
|
-
}
|
|
144
|
-
function pausableFilter(extendFilter = bypassFilter) {
|
|
145
|
-
const isActive = vueDemi.ref(true);
|
|
146
|
-
function pause() {
|
|
147
|
-
isActive.value = false;
|
|
148
|
-
}
|
|
149
|
-
function resume() {
|
|
150
|
-
isActive.value = true;
|
|
151
|
-
}
|
|
152
|
-
const eventFilter = (...args) => {
|
|
153
|
-
if (isActive.value)
|
|
154
|
-
extendFilter(...args);
|
|
155
|
-
};
|
|
156
|
-
return { isActive, pause, resume, eventFilter };
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function __onlyVue3(name = "this function") {
|
|
160
|
-
if (vueDemi.isVue3)
|
|
161
|
-
return;
|
|
162
|
-
throw new Error(`[VueUse] ${name} is only works on Vue 3.`);
|
|
163
|
-
}
|
|
164
|
-
const directiveHooks = {
|
|
165
|
-
mounted: vueDemi.isVue3 ? "mounted" : "inserted",
|
|
166
|
-
updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
|
|
167
|
-
unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
|
|
171
|
-
return new Promise((resolve, reject) => {
|
|
172
|
-
if (throwOnTimeout)
|
|
173
|
-
setTimeout(() => reject(reason), ms);
|
|
174
|
-
else
|
|
175
|
-
setTimeout(resolve, ms);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function identity(arg) {
|
|
179
|
-
return arg;
|
|
180
|
-
}
|
|
181
|
-
function createSingletonPromise(fn) {
|
|
182
|
-
let _promise;
|
|
183
|
-
function wrapper() {
|
|
184
|
-
if (!_promise)
|
|
185
|
-
_promise = fn();
|
|
186
|
-
return _promise;
|
|
187
|
-
}
|
|
188
|
-
wrapper.reset = async () => {
|
|
189
|
-
const _prev = _promise;
|
|
190
|
-
_promise = void 0;
|
|
191
|
-
if (_prev)
|
|
192
|
-
await _prev;
|
|
193
|
-
};
|
|
194
|
-
return wrapper;
|
|
195
|
-
}
|
|
196
|
-
function invoke(fn) {
|
|
197
|
-
return fn();
|
|
198
|
-
}
|
|
199
|
-
function containsProp(obj, ...props) {
|
|
200
|
-
return props.some((k) => k in obj);
|
|
201
|
-
}
|
|
202
|
-
function increaseWithUnit(target, delta) {
|
|
203
|
-
var _a;
|
|
204
|
-
if (typeof target === "number")
|
|
205
|
-
return target + delta;
|
|
206
|
-
const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : _a[0]) || "";
|
|
207
|
-
const unit = target.slice(value.length);
|
|
208
|
-
const result = parseFloat(value) + delta;
|
|
209
|
-
if (Number.isNaN(result))
|
|
210
|
-
return target;
|
|
211
|
-
return result + unit;
|
|
212
|
-
}
|
|
213
|
-
function objectPick(obj, keys, omitUndefined = false) {
|
|
214
|
-
return keys.reduce((n, k) => {
|
|
215
|
-
if (k in obj) {
|
|
216
|
-
if (!omitUndefined || obj[k] !== void 0)
|
|
217
|
-
n[k] = obj[k];
|
|
218
|
-
}
|
|
219
|
-
return n;
|
|
220
|
-
}, {});
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function computedWithControl(source, fn) {
|
|
224
|
-
let v = void 0;
|
|
225
|
-
let track;
|
|
226
|
-
let trigger;
|
|
227
|
-
const dirty = vueDemi.ref(true);
|
|
228
|
-
const update = () => {
|
|
229
|
-
dirty.value = true;
|
|
230
|
-
trigger();
|
|
231
|
-
};
|
|
232
|
-
vueDemi.watch(source, update, { flush: "sync" });
|
|
233
|
-
const get = isFunction(fn) ? fn : fn.get;
|
|
234
|
-
const set = isFunction(fn) ? void 0 : fn.set;
|
|
235
|
-
const result = vueDemi.customRef((_track, _trigger) => {
|
|
236
|
-
track = _track;
|
|
237
|
-
trigger = _trigger;
|
|
238
|
-
return {
|
|
239
|
-
get() {
|
|
240
|
-
if (dirty.value) {
|
|
241
|
-
v = get();
|
|
242
|
-
dirty.value = false;
|
|
243
|
-
}
|
|
244
|
-
track();
|
|
245
|
-
return v;
|
|
246
|
-
},
|
|
247
|
-
set(v2) {
|
|
248
|
-
set == null ? void 0 : set(v2);
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
});
|
|
252
|
-
if (Object.isExtensible(result))
|
|
253
|
-
result.trigger = update;
|
|
254
|
-
return result;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function createEventHook() {
|
|
258
|
-
const fns = [];
|
|
259
|
-
const off = (fn) => {
|
|
260
|
-
const index = fns.indexOf(fn);
|
|
261
|
-
if (index !== -1)
|
|
262
|
-
fns.splice(index, 1);
|
|
263
|
-
};
|
|
264
|
-
const on = (fn) => {
|
|
265
|
-
fns.push(fn);
|
|
266
|
-
return {
|
|
267
|
-
off: () => off(fn)
|
|
268
|
-
};
|
|
269
|
-
};
|
|
270
|
-
const trigger = (param) => {
|
|
271
|
-
fns.forEach((fn) => fn(param));
|
|
272
|
-
};
|
|
273
|
-
return {
|
|
274
|
-
on,
|
|
275
|
-
off,
|
|
276
|
-
trigger
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function createGlobalState(stateFactory) {
|
|
281
|
-
let initialized = false;
|
|
282
|
-
let state;
|
|
283
|
-
const scope = vueDemi.effectScope(true);
|
|
284
|
-
return () => {
|
|
285
|
-
if (!initialized) {
|
|
286
|
-
state = scope.run(stateFactory);
|
|
287
|
-
initialized = true;
|
|
288
|
-
}
|
|
289
|
-
return state;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
function createInjectionState(composable) {
|
|
294
|
-
const key = Symbol("InjectionState");
|
|
295
|
-
const useProvidingState = (...args) => {
|
|
296
|
-
vueDemi.provide(key, composable(...args));
|
|
297
|
-
};
|
|
298
|
-
const useInjectedState = () => vueDemi.inject(key);
|
|
299
|
-
return [useProvidingState, useInjectedState];
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
function tryOnScopeDispose(fn) {
|
|
303
|
-
if (vueDemi.getCurrentScope()) {
|
|
304
|
-
vueDemi.onScopeDispose(fn);
|
|
305
|
-
return true;
|
|
306
|
-
}
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function createSharedComposable(composable) {
|
|
311
|
-
let subscribers = 0;
|
|
312
|
-
let state;
|
|
313
|
-
let scope;
|
|
314
|
-
const dispose = () => {
|
|
315
|
-
subscribers -= 1;
|
|
316
|
-
if (scope && subscribers <= 0) {
|
|
317
|
-
scope.stop();
|
|
318
|
-
state = void 0;
|
|
319
|
-
scope = void 0;
|
|
320
|
-
}
|
|
321
|
-
};
|
|
322
|
-
return (...args) => {
|
|
323
|
-
subscribers += 1;
|
|
324
|
-
if (!state) {
|
|
325
|
-
scope = vueDemi.effectScope(true);
|
|
326
|
-
state = scope.run(() => composable(...args));
|
|
327
|
-
}
|
|
328
|
-
tryOnScopeDispose(dispose);
|
|
329
|
-
return state;
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {
|
|
334
|
-
__onlyVue3();
|
|
335
|
-
for (const [key, value] of Object.entries(extend)) {
|
|
336
|
-
if (key === "value")
|
|
337
|
-
continue;
|
|
338
|
-
if (vueDemi.isRef(value) && unwrap) {
|
|
339
|
-
Object.defineProperty(ref, key, {
|
|
340
|
-
get() {
|
|
341
|
-
return value.value;
|
|
342
|
-
},
|
|
343
|
-
set(v) {
|
|
344
|
-
value.value = v;
|
|
345
|
-
},
|
|
346
|
-
enumerable
|
|
347
|
-
});
|
|
348
|
-
} else {
|
|
349
|
-
Object.defineProperty(ref, key, { value, enumerable });
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return ref;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function get(obj, key) {
|
|
356
|
-
if (key == null)
|
|
357
|
-
return vueDemi.unref(obj);
|
|
358
|
-
return vueDemi.unref(obj)[key];
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
function isDefined(v) {
|
|
362
|
-
return vueDemi.unref(v) != null;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
var __defProp$8 = Object.defineProperty;
|
|
366
|
-
var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
|
|
367
|
-
var __hasOwnProp$a = Object.prototype.hasOwnProperty;
|
|
368
|
-
var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
|
|
369
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
370
|
-
var __spreadValues$8 = (a, b) => {
|
|
371
|
-
for (var prop in b || (b = {}))
|
|
372
|
-
if (__hasOwnProp$a.call(b, prop))
|
|
373
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
374
|
-
if (__getOwnPropSymbols$a)
|
|
375
|
-
for (var prop of __getOwnPropSymbols$a(b)) {
|
|
376
|
-
if (__propIsEnum$a.call(b, prop))
|
|
377
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
378
|
-
}
|
|
379
|
-
return a;
|
|
380
|
-
};
|
|
381
|
-
function makeDestructurable(obj, arr) {
|
|
382
|
-
if (typeof Symbol !== "undefined") {
|
|
383
|
-
const clone = __spreadValues$8({}, obj);
|
|
384
|
-
Object.defineProperty(clone, Symbol.iterator, {
|
|
385
|
-
enumerable: false,
|
|
386
|
-
value() {
|
|
387
|
-
let index = 0;
|
|
388
|
-
return {
|
|
389
|
-
next: () => ({
|
|
390
|
-
value: arr[index++],
|
|
391
|
-
done: index > arr.length
|
|
392
|
-
})
|
|
393
|
-
};
|
|
394
|
-
}
|
|
395
|
-
});
|
|
396
|
-
return clone;
|
|
397
|
-
} else {
|
|
398
|
-
return Object.assign([...arr], obj);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function reactify(fn, options) {
|
|
403
|
-
const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vueDemi.unref : resolveUnref;
|
|
404
|
-
return function(...args) {
|
|
405
|
-
return vueDemi.computed(() => fn.apply(this, args.map((i) => unrefFn(i))));
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
function reactifyObject(obj, optionsOrKeys = {}) {
|
|
410
|
-
let keys = [];
|
|
411
|
-
let options;
|
|
412
|
-
if (Array.isArray(optionsOrKeys)) {
|
|
413
|
-
keys = optionsOrKeys;
|
|
414
|
-
} else {
|
|
415
|
-
options = optionsOrKeys;
|
|
416
|
-
const { includeOwnProperties = true } = optionsOrKeys;
|
|
417
|
-
keys.push(...Object.keys(obj));
|
|
418
|
-
if (includeOwnProperties)
|
|
419
|
-
keys.push(...Object.getOwnPropertyNames(obj));
|
|
420
|
-
}
|
|
421
|
-
return Object.fromEntries(keys.map((key) => {
|
|
422
|
-
const value = obj[key];
|
|
423
|
-
return [
|
|
424
|
-
key,
|
|
425
|
-
typeof value === "function" ? reactify(value.bind(obj), options) : value
|
|
426
|
-
];
|
|
427
|
-
}));
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
function toReactive(objectRef) {
|
|
431
|
-
if (!vueDemi.isRef(objectRef))
|
|
432
|
-
return vueDemi.reactive(objectRef);
|
|
433
|
-
const proxy = new Proxy({}, {
|
|
434
|
-
get(_, p, receiver) {
|
|
435
|
-
return vueDemi.unref(Reflect.get(objectRef.value, p, receiver));
|
|
436
|
-
},
|
|
437
|
-
set(_, p, value) {
|
|
438
|
-
if (vueDemi.isRef(objectRef.value[p]) && !vueDemi.isRef(value))
|
|
439
|
-
objectRef.value[p].value = value;
|
|
440
|
-
else
|
|
441
|
-
objectRef.value[p] = value;
|
|
442
|
-
return true;
|
|
443
|
-
},
|
|
444
|
-
deleteProperty(_, p) {
|
|
445
|
-
return Reflect.deleteProperty(objectRef.value, p);
|
|
446
|
-
},
|
|
447
|
-
has(_, p) {
|
|
448
|
-
return Reflect.has(objectRef.value, p);
|
|
449
|
-
},
|
|
450
|
-
ownKeys() {
|
|
451
|
-
return Object.keys(objectRef.value);
|
|
452
|
-
},
|
|
453
|
-
getOwnPropertyDescriptor() {
|
|
454
|
-
return {
|
|
455
|
-
enumerable: true,
|
|
456
|
-
configurable: true
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
return vueDemi.reactive(proxy);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
function reactiveComputed(fn) {
|
|
464
|
-
return toReactive(vueDemi.computed(fn));
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function reactiveOmit(obj, ...keys) {
|
|
468
|
-
const flatKeys = keys.flat();
|
|
469
|
-
return reactiveComputed(() => Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
function reactivePick(obj, ...keys) {
|
|
473
|
-
const flatKeys = keys.flat();
|
|
474
|
-
return vueDemi.reactive(Object.fromEntries(flatKeys.map((k) => [k, vueDemi.toRef(obj, k)])));
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
function refAutoReset(defaultValue, afterMs = 1e4) {
|
|
478
|
-
return vueDemi.customRef((track, trigger) => {
|
|
479
|
-
let value = defaultValue;
|
|
480
|
-
let timer;
|
|
481
|
-
const resetAfter = () => setTimeout(() => {
|
|
482
|
-
value = defaultValue;
|
|
483
|
-
trigger();
|
|
484
|
-
}, resolveUnref(afterMs));
|
|
485
|
-
tryOnScopeDispose(() => {
|
|
486
|
-
clearTimeout(timer);
|
|
487
|
-
});
|
|
488
|
-
return {
|
|
489
|
-
get() {
|
|
490
|
-
track();
|
|
491
|
-
return value;
|
|
492
|
-
},
|
|
493
|
-
set(newValue) {
|
|
494
|
-
value = newValue;
|
|
495
|
-
trigger();
|
|
496
|
-
clearTimeout(timer);
|
|
497
|
-
timer = resetAfter();
|
|
498
|
-
}
|
|
499
|
-
};
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
function useDebounceFn(fn, ms = 200, options = {}) {
|
|
504
|
-
return createFilterWrapper(debounceFilter(ms, options), fn);
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
function refDebounced(value, ms = 200, options = {}) {
|
|
508
|
-
const debounced = vueDemi.ref(value.value);
|
|
509
|
-
const updater = useDebounceFn(() => {
|
|
510
|
-
debounced.value = value.value;
|
|
511
|
-
}, ms, options);
|
|
512
|
-
vueDemi.watch(value, () => updater());
|
|
513
|
-
return debounced;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
function refDefault(source, defaultValue) {
|
|
517
|
-
return vueDemi.computed({
|
|
518
|
-
get() {
|
|
519
|
-
var _a;
|
|
520
|
-
return (_a = source.value) != null ? _a : defaultValue;
|
|
521
|
-
},
|
|
522
|
-
set(value) {
|
|
523
|
-
source.value = value;
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
function useThrottleFn(fn, ms = 200, trailing = false, leading = true) {
|
|
529
|
-
return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function refThrottled(value, delay = 200, trailing = true, leading = true) {
|
|
533
|
-
if (delay <= 0)
|
|
534
|
-
return value;
|
|
535
|
-
const throttled = vueDemi.ref(value.value);
|
|
536
|
-
const updater = useThrottleFn(() => {
|
|
537
|
-
throttled.value = value.value;
|
|
538
|
-
}, delay, trailing, leading);
|
|
539
|
-
vueDemi.watch(value, () => updater());
|
|
540
|
-
return throttled;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
function refWithControl(initial, options = {}) {
|
|
544
|
-
let source = initial;
|
|
545
|
-
let track;
|
|
546
|
-
let trigger;
|
|
547
|
-
const ref = vueDemi.customRef((_track, _trigger) => {
|
|
548
|
-
track = _track;
|
|
549
|
-
trigger = _trigger;
|
|
550
|
-
return {
|
|
551
|
-
get() {
|
|
552
|
-
return get();
|
|
553
|
-
},
|
|
554
|
-
set(v) {
|
|
555
|
-
set(v);
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
});
|
|
559
|
-
function get(tracking = true) {
|
|
560
|
-
if (tracking)
|
|
561
|
-
track();
|
|
562
|
-
return source;
|
|
563
|
-
}
|
|
564
|
-
function set(value, triggering = true) {
|
|
565
|
-
var _a, _b;
|
|
566
|
-
if (value === source)
|
|
567
|
-
return;
|
|
568
|
-
const old = source;
|
|
569
|
-
if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
|
|
570
|
-
return;
|
|
571
|
-
source = value;
|
|
572
|
-
(_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
|
|
573
|
-
if (triggering)
|
|
574
|
-
trigger();
|
|
575
|
-
}
|
|
576
|
-
const untrackedGet = () => get(false);
|
|
577
|
-
const silentSet = (v) => set(v, false);
|
|
578
|
-
const peek = () => get(false);
|
|
579
|
-
const lay = (v) => set(v, false);
|
|
580
|
-
return extendRef(ref, {
|
|
581
|
-
get,
|
|
582
|
-
set,
|
|
583
|
-
untrackedGet,
|
|
584
|
-
silentSet,
|
|
585
|
-
peek,
|
|
586
|
-
lay
|
|
587
|
-
}, { enumerable: true });
|
|
588
|
-
}
|
|
589
|
-
const controlledRef = refWithControl;
|
|
590
|
-
|
|
591
|
-
function resolveRef(r) {
|
|
592
|
-
return typeof r === "function" ? vueDemi.computed(r) : vueDemi.ref(r);
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
function set(...args) {
|
|
596
|
-
if (args.length === 2) {
|
|
597
|
-
const [ref, value] = args;
|
|
598
|
-
ref.value = value;
|
|
599
|
-
}
|
|
600
|
-
if (args.length === 3) {
|
|
601
|
-
if (vueDemi.isVue2) {
|
|
602
|
-
vueDemi.set(...args);
|
|
603
|
-
} else {
|
|
604
|
-
const [target, key, value] = args;
|
|
605
|
-
target[key] = value;
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
function syncRef(left, right, options = {}) {
|
|
611
|
-
var _a, _b;
|
|
612
|
-
const {
|
|
613
|
-
flush = "sync",
|
|
614
|
-
deep = false,
|
|
615
|
-
immediate = true,
|
|
616
|
-
direction = "both",
|
|
617
|
-
transform = {}
|
|
618
|
-
} = options;
|
|
619
|
-
let watchLeft;
|
|
620
|
-
let watchRight;
|
|
621
|
-
const transformLTR = (_a = transform.ltr) != null ? _a : (v) => v;
|
|
622
|
-
const transformRTL = (_b = transform.rtl) != null ? _b : (v) => v;
|
|
623
|
-
if (direction === "both" || direction === "ltr") {
|
|
624
|
-
watchLeft = vueDemi.watch(left, (newValue) => right.value = transformLTR(newValue), { flush, deep, immediate });
|
|
625
|
-
}
|
|
626
|
-
if (direction === "both" || direction === "rtl") {
|
|
627
|
-
watchRight = vueDemi.watch(right, (newValue) => left.value = transformRTL(newValue), { flush, deep, immediate });
|
|
628
|
-
}
|
|
629
|
-
return () => {
|
|
630
|
-
watchLeft == null ? void 0 : watchLeft();
|
|
631
|
-
watchRight == null ? void 0 : watchRight();
|
|
632
|
-
};
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
function syncRefs(source, targets, options = {}) {
|
|
636
|
-
const {
|
|
637
|
-
flush = "sync",
|
|
638
|
-
deep = false,
|
|
639
|
-
immediate = true
|
|
640
|
-
} = options;
|
|
641
|
-
if (!Array.isArray(targets))
|
|
642
|
-
targets = [targets];
|
|
643
|
-
return vueDemi.watch(source, (newValue) => targets.forEach((target) => target.value = newValue), { flush, deep, immediate });
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
var __defProp$7 = Object.defineProperty;
|
|
647
|
-
var __defProps$5 = Object.defineProperties;
|
|
648
|
-
var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
|
|
649
|
-
var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
|
|
650
|
-
var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
|
|
651
|
-
var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
|
|
652
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
653
|
-
var __spreadValues$7 = (a, b) => {
|
|
654
|
-
for (var prop in b || (b = {}))
|
|
655
|
-
if (__hasOwnProp$9.call(b, prop))
|
|
656
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
657
|
-
if (__getOwnPropSymbols$9)
|
|
658
|
-
for (var prop of __getOwnPropSymbols$9(b)) {
|
|
659
|
-
if (__propIsEnum$9.call(b, prop))
|
|
660
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
661
|
-
}
|
|
662
|
-
return a;
|
|
663
|
-
};
|
|
664
|
-
var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
|
|
665
|
-
function toRefs(objectRef) {
|
|
666
|
-
if (!vueDemi.isRef(objectRef))
|
|
667
|
-
return vueDemi.toRefs(objectRef);
|
|
668
|
-
const result = Array.isArray(objectRef.value) ? new Array(objectRef.value.length) : {};
|
|
669
|
-
for (const key in objectRef.value) {
|
|
670
|
-
result[key] = vueDemi.customRef(() => ({
|
|
671
|
-
get() {
|
|
672
|
-
return objectRef.value[key];
|
|
673
|
-
},
|
|
674
|
-
set(v) {
|
|
675
|
-
if (Array.isArray(objectRef.value)) {
|
|
676
|
-
const copy = [...objectRef.value];
|
|
677
|
-
copy[key] = v;
|
|
678
|
-
objectRef.value = copy;
|
|
679
|
-
} else {
|
|
680
|
-
const newObject = __spreadProps$5(__spreadValues$7({}, objectRef.value), { [key]: v });
|
|
681
|
-
Object.setPrototypeOf(newObject, objectRef.value);
|
|
682
|
-
objectRef.value = newObject;
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
}));
|
|
686
|
-
}
|
|
687
|
-
return result;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
function tryOnBeforeMount(fn, sync = true) {
|
|
691
|
-
if (vueDemi.getCurrentInstance())
|
|
692
|
-
vueDemi.onBeforeMount(fn);
|
|
693
|
-
else if (sync)
|
|
694
|
-
fn();
|
|
695
|
-
else
|
|
696
|
-
vueDemi.nextTick(fn);
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
function tryOnBeforeUnmount(fn) {
|
|
700
|
-
if (vueDemi.getCurrentInstance())
|
|
701
|
-
vueDemi.onBeforeUnmount(fn);
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
function tryOnMounted(fn, sync = true) {
|
|
705
|
-
if (vueDemi.getCurrentInstance())
|
|
706
|
-
vueDemi.onMounted(fn);
|
|
707
|
-
else if (sync)
|
|
708
|
-
fn();
|
|
709
|
-
else
|
|
710
|
-
vueDemi.nextTick(fn);
|
|
711
|
-
}
|
|
712
|
-
|
|
713
|
-
function tryOnUnmounted(fn) {
|
|
714
|
-
if (vueDemi.getCurrentInstance())
|
|
715
|
-
vueDemi.onUnmounted(fn);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
function createUntil(r, isNot = false) {
|
|
719
|
-
function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
|
|
720
|
-
let stop = null;
|
|
721
|
-
const watcher = new Promise((resolve) => {
|
|
722
|
-
stop = vueDemi.watch(r, (v) => {
|
|
723
|
-
if (condition(v) !== isNot) {
|
|
724
|
-
stop == null ? void 0 : stop();
|
|
725
|
-
resolve(v);
|
|
726
|
-
}
|
|
727
|
-
}, {
|
|
728
|
-
flush,
|
|
729
|
-
deep,
|
|
730
|
-
immediate: true
|
|
731
|
-
});
|
|
732
|
-
});
|
|
733
|
-
const promises = [watcher];
|
|
734
|
-
if (timeout != null) {
|
|
735
|
-
promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => resolveUnref(r)).finally(() => stop == null ? void 0 : stop()));
|
|
736
|
-
}
|
|
737
|
-
return Promise.race(promises);
|
|
738
|
-
}
|
|
739
|
-
function toBe(value, options) {
|
|
740
|
-
if (!vueDemi.isRef(value))
|
|
741
|
-
return toMatch((v) => v === value, options);
|
|
742
|
-
const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
|
|
743
|
-
let stop = null;
|
|
744
|
-
const watcher = new Promise((resolve) => {
|
|
745
|
-
stop = vueDemi.watch([r, value], ([v1, v2]) => {
|
|
746
|
-
if (isNot !== (v1 === v2)) {
|
|
747
|
-
stop == null ? void 0 : stop();
|
|
748
|
-
resolve(v1);
|
|
749
|
-
}
|
|
750
|
-
}, {
|
|
751
|
-
flush,
|
|
752
|
-
deep,
|
|
753
|
-
immediate: true
|
|
754
|
-
});
|
|
755
|
-
});
|
|
756
|
-
const promises = [watcher];
|
|
757
|
-
if (timeout != null) {
|
|
758
|
-
promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => resolveUnref(r)).finally(() => {
|
|
759
|
-
stop == null ? void 0 : stop();
|
|
760
|
-
return resolveUnref(r);
|
|
761
|
-
}));
|
|
762
|
-
}
|
|
763
|
-
return Promise.race(promises);
|
|
764
|
-
}
|
|
765
|
-
function toBeTruthy(options) {
|
|
766
|
-
return toMatch((v) => Boolean(v), options);
|
|
767
|
-
}
|
|
768
|
-
function toBeNull(options) {
|
|
769
|
-
return toBe(null, options);
|
|
770
|
-
}
|
|
771
|
-
function toBeUndefined(options) {
|
|
772
|
-
return toBe(void 0, options);
|
|
773
|
-
}
|
|
774
|
-
function toBeNaN(options) {
|
|
775
|
-
return toMatch(Number.isNaN, options);
|
|
776
|
-
}
|
|
777
|
-
function toContains(value, options) {
|
|
778
|
-
return toMatch((v) => {
|
|
779
|
-
const array = Array.from(v);
|
|
780
|
-
return array.includes(value) || array.includes(resolveUnref(value));
|
|
781
|
-
}, options);
|
|
782
|
-
}
|
|
783
|
-
function changed(options) {
|
|
784
|
-
return changedTimes(1, options);
|
|
785
|
-
}
|
|
786
|
-
function changedTimes(n = 1, options) {
|
|
787
|
-
let count = -1;
|
|
788
|
-
return toMatch(() => {
|
|
789
|
-
count += 1;
|
|
790
|
-
return count >= n;
|
|
791
|
-
}, options);
|
|
792
|
-
}
|
|
793
|
-
if (Array.isArray(resolveUnref(r))) {
|
|
794
|
-
const instance = {
|
|
795
|
-
toMatch,
|
|
796
|
-
toContains,
|
|
797
|
-
changed,
|
|
798
|
-
changedTimes,
|
|
799
|
-
get not() {
|
|
800
|
-
return createUntil(r, !isNot);
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
return instance;
|
|
804
|
-
} else {
|
|
805
|
-
const instance = {
|
|
806
|
-
toMatch,
|
|
807
|
-
toBe,
|
|
808
|
-
toBeTruthy,
|
|
809
|
-
toBeNull,
|
|
810
|
-
toBeNaN,
|
|
811
|
-
toBeUndefined,
|
|
812
|
-
changed,
|
|
813
|
-
changedTimes,
|
|
814
|
-
get not() {
|
|
815
|
-
return createUntil(r, !isNot);
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
return instance;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
function until(r) {
|
|
822
|
-
return createUntil(r);
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
function useArrayEvery(list, fn) {
|
|
826
|
-
return vueDemi.computed(() => resolveUnref(list).every((element, index, array) => fn(resolveUnref(element), index, array)));
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
function useArrayFilter(list, fn) {
|
|
830
|
-
return vueDemi.computed(() => resolveUnref(list).map((i) => resolveUnref(i)).filter(fn));
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
function useArrayFind(list, fn) {
|
|
834
|
-
return vueDemi.computed(() => resolveUnref(resolveUnref(list).find((element, index, array) => fn(resolveUnref(element), index, array))));
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
function useArrayFindIndex(list, fn) {
|
|
838
|
-
return vueDemi.computed(() => resolveUnref(list).findIndex((element, index, array) => fn(resolveUnref(element), index, array)));
|
|
839
|
-
}
|
|
840
|
-
|
|
841
|
-
function useArrayJoin(list, separator) {
|
|
842
|
-
return vueDemi.computed(() => resolveUnref(list).map((i) => resolveUnref(i)).join(resolveUnref(separator)));
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
function useArrayMap(list, fn) {
|
|
846
|
-
return vueDemi.computed(() => resolveUnref(list).map((i) => resolveUnref(i)).map(fn));
|
|
847
|
-
}
|
|
848
|
-
|
|
849
|
-
function useArrayReduce(list, reducer, ...args) {
|
|
850
|
-
const reduceCallback = (sum, value, index) => reducer(resolveUnref(sum), resolveUnref(value), index);
|
|
851
|
-
return vueDemi.computed(() => {
|
|
852
|
-
const resolved = resolveUnref(list);
|
|
853
|
-
return args.length ? resolved.reduce(reduceCallback, resolveUnref(args[0])) : resolved.reduce(reduceCallback);
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
function useArraySome(list, fn) {
|
|
858
|
-
return vueDemi.computed(() => resolveUnref(list).some((element, index, array) => fn(resolveUnref(element), index, array)));
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
function useCounter(initialValue = 0, options = {}) {
|
|
862
|
-
const count = vueDemi.ref(initialValue);
|
|
863
|
-
const {
|
|
864
|
-
max = Infinity,
|
|
865
|
-
min = -Infinity
|
|
866
|
-
} = options;
|
|
867
|
-
const inc = (delta = 1) => count.value = Math.min(max, count.value + delta);
|
|
868
|
-
const dec = (delta = 1) => count.value = Math.max(min, count.value - delta);
|
|
869
|
-
const get = () => count.value;
|
|
870
|
-
const set = (val) => count.value = Math.max(min, Math.min(max, val));
|
|
871
|
-
const reset = (val = initialValue) => {
|
|
872
|
-
initialValue = val;
|
|
873
|
-
return set(val);
|
|
874
|
-
};
|
|
875
|
-
return { count, inc, dec, get, set, reset };
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
|
|
879
|
-
const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
|
|
880
|
-
const defaultMeridiem = (hours, minutes, isLowercase, hasPeriod) => {
|
|
881
|
-
let m = hours < 12 ? "AM" : "PM";
|
|
882
|
-
if (hasPeriod)
|
|
883
|
-
m = m.split("").reduce((acc, curr) => acc += `${curr}.`, "");
|
|
884
|
-
return isLowercase ? m.toLowerCase() : m;
|
|
885
|
-
};
|
|
886
|
-
const formatDate = (date, formatStr, options = {}) => {
|
|
887
|
-
var _a;
|
|
888
|
-
const years = date.getFullYear();
|
|
889
|
-
const month = date.getMonth();
|
|
890
|
-
const days = date.getDate();
|
|
891
|
-
const hours = date.getHours();
|
|
892
|
-
const minutes = date.getMinutes();
|
|
893
|
-
const seconds = date.getSeconds();
|
|
894
|
-
const milliseconds = date.getMilliseconds();
|
|
895
|
-
const day = date.getDay();
|
|
896
|
-
const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
|
|
897
|
-
const matches = {
|
|
898
|
-
YY: () => String(years).slice(-2),
|
|
899
|
-
YYYY: () => years,
|
|
900
|
-
M: () => month + 1,
|
|
901
|
-
MM: () => `${month + 1}`.padStart(2, "0"),
|
|
902
|
-
MMM: () => date.toLocaleDateString(options.locales, { month: "short" }),
|
|
903
|
-
MMMM: () => date.toLocaleDateString(options.locales, { month: "long" }),
|
|
904
|
-
D: () => String(days),
|
|
905
|
-
DD: () => `${days}`.padStart(2, "0"),
|
|
906
|
-
H: () => String(hours),
|
|
907
|
-
HH: () => `${hours}`.padStart(2, "0"),
|
|
908
|
-
h: () => `${hours % 12 || 12}`.padStart(1, "0"),
|
|
909
|
-
hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
|
|
910
|
-
m: () => String(minutes),
|
|
911
|
-
mm: () => `${minutes}`.padStart(2, "0"),
|
|
912
|
-
s: () => String(seconds),
|
|
913
|
-
ss: () => `${seconds}`.padStart(2, "0"),
|
|
914
|
-
SSS: () => `${milliseconds}`.padStart(3, "0"),
|
|
915
|
-
d: () => day,
|
|
916
|
-
dd: () => date.toLocaleDateString(options.locales, { weekday: "narrow" }),
|
|
917
|
-
ddd: () => date.toLocaleDateString(options.locales, { weekday: "short" }),
|
|
918
|
-
dddd: () => date.toLocaleDateString(options.locales, { weekday: "long" }),
|
|
919
|
-
A: () => meridiem(hours, minutes),
|
|
920
|
-
AA: () => meridiem(hours, minutes, false, true),
|
|
921
|
-
a: () => meridiem(hours, minutes, true),
|
|
922
|
-
aa: () => meridiem(hours, minutes, true, true)
|
|
923
|
-
};
|
|
924
|
-
return formatStr.replace(REGEX_FORMAT, (match, $1) => $1 || matches[match]());
|
|
925
|
-
};
|
|
926
|
-
const normalizeDate = (date) => {
|
|
927
|
-
if (date === null)
|
|
928
|
-
return new Date(NaN);
|
|
929
|
-
if (date === void 0)
|
|
930
|
-
return new Date();
|
|
931
|
-
if (date instanceof Date)
|
|
932
|
-
return new Date(date);
|
|
933
|
-
if (typeof date === "string" && !/Z$/i.test(date)) {
|
|
934
|
-
const d = date.match(REGEX_PARSE);
|
|
935
|
-
if (d) {
|
|
936
|
-
const m = d[2] - 1 || 0;
|
|
937
|
-
const ms = (d[7] || "0").substring(0, 3);
|
|
938
|
-
return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
return new Date(date);
|
|
942
|
-
};
|
|
943
|
-
function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
|
|
944
|
-
return vueDemi.computed(() => formatDate(normalizeDate(resolveUnref(date)), resolveUnref(formatStr), options));
|
|
945
|
-
}
|
|
946
|
-
|
|
947
|
-
function useIntervalFn(cb, interval = 1e3, options = {}) {
|
|
948
|
-
const {
|
|
949
|
-
immediate = true,
|
|
950
|
-
immediateCallback = false
|
|
951
|
-
} = options;
|
|
952
|
-
let timer = null;
|
|
953
|
-
const isActive = vueDemi.ref(false);
|
|
954
|
-
function clean() {
|
|
955
|
-
if (timer) {
|
|
956
|
-
clearInterval(timer);
|
|
957
|
-
timer = null;
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
function pause() {
|
|
961
|
-
isActive.value = false;
|
|
962
|
-
clean();
|
|
963
|
-
}
|
|
964
|
-
function resume() {
|
|
965
|
-
if (vueDemi.unref(interval) <= 0)
|
|
966
|
-
return;
|
|
967
|
-
isActive.value = true;
|
|
968
|
-
if (immediateCallback)
|
|
969
|
-
cb();
|
|
970
|
-
clean();
|
|
971
|
-
timer = setInterval(cb, resolveUnref(interval));
|
|
972
|
-
}
|
|
973
|
-
if (immediate && isClient)
|
|
974
|
-
resume();
|
|
975
|
-
if (vueDemi.isRef(interval)) {
|
|
976
|
-
const stopWatch = vueDemi.watch(interval, () => {
|
|
977
|
-
if (isActive.value && isClient)
|
|
978
|
-
resume();
|
|
979
|
-
});
|
|
980
|
-
tryOnScopeDispose(stopWatch);
|
|
981
|
-
}
|
|
982
|
-
tryOnScopeDispose(pause);
|
|
983
|
-
return {
|
|
984
|
-
isActive,
|
|
985
|
-
pause,
|
|
986
|
-
resume
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
var __defProp$6 = Object.defineProperty;
|
|
991
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
992
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
993
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
994
|
-
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
995
|
-
var __spreadValues$6 = (a, b) => {
|
|
996
|
-
for (var prop in b || (b = {}))
|
|
997
|
-
if (__hasOwnProp$8.call(b, prop))
|
|
998
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
999
|
-
if (__getOwnPropSymbols$8)
|
|
1000
|
-
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
1001
|
-
if (__propIsEnum$8.call(b, prop))
|
|
1002
|
-
__defNormalProp$6(a, prop, b[prop]);
|
|
1003
|
-
}
|
|
1004
|
-
return a;
|
|
1005
|
-
};
|
|
1006
|
-
function useInterval(interval = 1e3, options = {}) {
|
|
1007
|
-
const {
|
|
1008
|
-
controls: exposeControls = false,
|
|
1009
|
-
immediate = true,
|
|
1010
|
-
callback
|
|
1011
|
-
} = options;
|
|
1012
|
-
const counter = vueDemi.ref(0);
|
|
1013
|
-
const update = () => counter.value += 1;
|
|
1014
|
-
const controls = useIntervalFn(callback ? () => {
|
|
1015
|
-
update();
|
|
1016
|
-
callback(counter.value);
|
|
1017
|
-
} : update, interval, { immediate });
|
|
1018
|
-
if (exposeControls) {
|
|
1019
|
-
return __spreadValues$6({
|
|
1020
|
-
counter
|
|
1021
|
-
}, controls);
|
|
1022
|
-
} else {
|
|
1023
|
-
return counter;
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
function useLastChanged(source, options = {}) {
|
|
1028
|
-
var _a;
|
|
1029
|
-
const ms = vueDemi.ref((_a = options.initialValue) != null ? _a : null);
|
|
1030
|
-
vueDemi.watch(source, () => ms.value = timestamp(), options);
|
|
1031
|
-
return ms;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
function useTimeoutFn(cb, interval, options = {}) {
|
|
1035
|
-
const {
|
|
1036
|
-
immediate = true
|
|
1037
|
-
} = options;
|
|
1038
|
-
const isPending = vueDemi.ref(false);
|
|
1039
|
-
let timer = null;
|
|
1040
|
-
function clear() {
|
|
1041
|
-
if (timer) {
|
|
1042
|
-
clearTimeout(timer);
|
|
1043
|
-
timer = null;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
function stop() {
|
|
1047
|
-
isPending.value = false;
|
|
1048
|
-
clear();
|
|
1049
|
-
}
|
|
1050
|
-
function start(...args) {
|
|
1051
|
-
clear();
|
|
1052
|
-
isPending.value = true;
|
|
1053
|
-
timer = setTimeout(() => {
|
|
1054
|
-
isPending.value = false;
|
|
1055
|
-
timer = null;
|
|
1056
|
-
cb(...args);
|
|
1057
|
-
}, resolveUnref(interval));
|
|
1058
|
-
}
|
|
1059
|
-
if (immediate) {
|
|
1060
|
-
isPending.value = true;
|
|
1061
|
-
if (isClient)
|
|
1062
|
-
start();
|
|
1063
|
-
}
|
|
1064
|
-
tryOnScopeDispose(stop);
|
|
1065
|
-
return {
|
|
1066
|
-
isPending,
|
|
1067
|
-
start,
|
|
1068
|
-
stop
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
var __defProp$5 = Object.defineProperty;
|
|
1073
|
-
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
1074
|
-
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
1075
|
-
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
1076
|
-
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1077
|
-
var __spreadValues$5 = (a, b) => {
|
|
1078
|
-
for (var prop in b || (b = {}))
|
|
1079
|
-
if (__hasOwnProp$7.call(b, prop))
|
|
1080
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1081
|
-
if (__getOwnPropSymbols$7)
|
|
1082
|
-
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
1083
|
-
if (__propIsEnum$7.call(b, prop))
|
|
1084
|
-
__defNormalProp$5(a, prop, b[prop]);
|
|
1085
|
-
}
|
|
1086
|
-
return a;
|
|
1087
|
-
};
|
|
1088
|
-
function useTimeout(interval = 1e3, options = {}) {
|
|
1089
|
-
const {
|
|
1090
|
-
controls: exposeControls = false,
|
|
1091
|
-
callback
|
|
1092
|
-
} = options;
|
|
1093
|
-
const controls = useTimeoutFn(callback != null ? callback : noop, interval, options);
|
|
1094
|
-
const ready = vueDemi.computed(() => !controls.isPending.value);
|
|
1095
|
-
if (exposeControls) {
|
|
1096
|
-
return __spreadValues$5({
|
|
1097
|
-
ready
|
|
1098
|
-
}, controls);
|
|
1099
|
-
} else {
|
|
1100
|
-
return ready;
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
function useToNumber(value, options = {}) {
|
|
1105
|
-
const {
|
|
1106
|
-
method = "parseFloat",
|
|
1107
|
-
radix,
|
|
1108
|
-
nanToZero
|
|
1109
|
-
} = options;
|
|
1110
|
-
return vueDemi.computed(() => {
|
|
1111
|
-
let resolved = resolveUnref(value);
|
|
1112
|
-
if (typeof resolved === "string")
|
|
1113
|
-
resolved = Number[method](resolved, radix);
|
|
1114
|
-
if (nanToZero && isNaN(resolved))
|
|
1115
|
-
resolved = 0;
|
|
1116
|
-
return resolved;
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
|
-
|
|
1120
|
-
function useToString(value) {
|
|
1121
|
-
return vueDemi.computed(() => `${resolveUnref(value)}`);
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1124
|
-
function useToggle(initialValue = false, options = {}) {
|
|
1125
|
-
const {
|
|
1126
|
-
truthyValue = true,
|
|
1127
|
-
falsyValue = false
|
|
1128
|
-
} = options;
|
|
1129
|
-
const valueIsRef = vueDemi.isRef(initialValue);
|
|
1130
|
-
const _value = vueDemi.ref(initialValue);
|
|
1131
|
-
function toggle(value) {
|
|
1132
|
-
if (arguments.length) {
|
|
1133
|
-
_value.value = value;
|
|
1134
|
-
return _value.value;
|
|
1135
|
-
} else {
|
|
1136
|
-
const truthy = resolveUnref(truthyValue);
|
|
1137
|
-
_value.value = _value.value === truthy ? resolveUnref(falsyValue) : truthy;
|
|
1138
|
-
return _value.value;
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
if (valueIsRef)
|
|
1142
|
-
return toggle;
|
|
1143
|
-
else
|
|
1144
|
-
return [_value, toggle];
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
function watchArray(source, cb, options) {
|
|
1148
|
-
let oldList = (options == null ? void 0 : options.immediate) ? [] : [
|
|
1149
|
-
...source instanceof Function ? source() : Array.isArray(source) ? source : vueDemi.unref(source)
|
|
1150
|
-
];
|
|
1151
|
-
return vueDemi.watch(source, (newList, _, onCleanup) => {
|
|
1152
|
-
const oldListRemains = new Array(oldList.length);
|
|
1153
|
-
const added = [];
|
|
1154
|
-
for (const obj of newList) {
|
|
1155
|
-
let found = false;
|
|
1156
|
-
for (let i = 0; i < oldList.length; i++) {
|
|
1157
|
-
if (!oldListRemains[i] && obj === oldList[i]) {
|
|
1158
|
-
oldListRemains[i] = true;
|
|
1159
|
-
found = true;
|
|
1160
|
-
break;
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
if (!found)
|
|
1164
|
-
added.push(obj);
|
|
1165
|
-
}
|
|
1166
|
-
const removed = oldList.filter((_2, i) => !oldListRemains[i]);
|
|
1167
|
-
cb(newList, oldList, added, removed, onCleanup);
|
|
1168
|
-
oldList = [...newList];
|
|
1169
|
-
}, options);
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
1173
|
-
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
1174
|
-
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
1175
|
-
var __objRest$5 = (source, exclude) => {
|
|
1176
|
-
var target = {};
|
|
1177
|
-
for (var prop in source)
|
|
1178
|
-
if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1179
|
-
target[prop] = source[prop];
|
|
1180
|
-
if (source != null && __getOwnPropSymbols$6)
|
|
1181
|
-
for (var prop of __getOwnPropSymbols$6(source)) {
|
|
1182
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
|
|
1183
|
-
target[prop] = source[prop];
|
|
1184
|
-
}
|
|
1185
|
-
return target;
|
|
1186
|
-
};
|
|
1187
|
-
function watchWithFilter(source, cb, options = {}) {
|
|
1188
|
-
const _a = options, {
|
|
1189
|
-
eventFilter = bypassFilter
|
|
1190
|
-
} = _a, watchOptions = __objRest$5(_a, [
|
|
1191
|
-
"eventFilter"
|
|
1192
|
-
]);
|
|
1193
|
-
return vueDemi.watch(source, createFilterWrapper(eventFilter, cb), watchOptions);
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
|
-
var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
|
|
1197
|
-
var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
|
|
1198
|
-
var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
|
|
1199
|
-
var __objRest$4 = (source, exclude) => {
|
|
1200
|
-
var target = {};
|
|
1201
|
-
for (var prop in source)
|
|
1202
|
-
if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1203
|
-
target[prop] = source[prop];
|
|
1204
|
-
if (source != null && __getOwnPropSymbols$5)
|
|
1205
|
-
for (var prop of __getOwnPropSymbols$5(source)) {
|
|
1206
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
|
|
1207
|
-
target[prop] = source[prop];
|
|
1208
|
-
}
|
|
1209
|
-
return target;
|
|
1210
|
-
};
|
|
1211
|
-
function watchAtMost(source, cb, options) {
|
|
1212
|
-
const _a = options, {
|
|
1213
|
-
count
|
|
1214
|
-
} = _a, watchOptions = __objRest$4(_a, [
|
|
1215
|
-
"count"
|
|
1216
|
-
]);
|
|
1217
|
-
const current = vueDemi.ref(0);
|
|
1218
|
-
const stop = watchWithFilter(source, (...args) => {
|
|
1219
|
-
current.value += 1;
|
|
1220
|
-
if (current.value >= resolveUnref(count))
|
|
1221
|
-
vueDemi.nextTick(() => stop());
|
|
1222
|
-
cb(...args);
|
|
1223
|
-
}, watchOptions);
|
|
1224
|
-
return { count: current, stop };
|
|
1225
|
-
}
|
|
1226
|
-
|
|
1227
|
-
var __defProp$4 = Object.defineProperty;
|
|
1228
|
-
var __defProps$4 = Object.defineProperties;
|
|
1229
|
-
var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
|
|
1230
|
-
var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
|
|
1231
|
-
var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
|
|
1232
|
-
var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
|
|
1233
|
-
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1234
|
-
var __spreadValues$4 = (a, b) => {
|
|
1235
|
-
for (var prop in b || (b = {}))
|
|
1236
|
-
if (__hasOwnProp$4.call(b, prop))
|
|
1237
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1238
|
-
if (__getOwnPropSymbols$4)
|
|
1239
|
-
for (var prop of __getOwnPropSymbols$4(b)) {
|
|
1240
|
-
if (__propIsEnum$4.call(b, prop))
|
|
1241
|
-
__defNormalProp$4(a, prop, b[prop]);
|
|
1242
|
-
}
|
|
1243
|
-
return a;
|
|
1244
|
-
};
|
|
1245
|
-
var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
|
|
1246
|
-
var __objRest$3 = (source, exclude) => {
|
|
1247
|
-
var target = {};
|
|
1248
|
-
for (var prop in source)
|
|
1249
|
-
if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1250
|
-
target[prop] = source[prop];
|
|
1251
|
-
if (source != null && __getOwnPropSymbols$4)
|
|
1252
|
-
for (var prop of __getOwnPropSymbols$4(source)) {
|
|
1253
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
|
|
1254
|
-
target[prop] = source[prop];
|
|
1255
|
-
}
|
|
1256
|
-
return target;
|
|
1257
|
-
};
|
|
1258
|
-
function watchDebounced(source, cb, options = {}) {
|
|
1259
|
-
const _a = options, {
|
|
1260
|
-
debounce = 0,
|
|
1261
|
-
maxWait = void 0
|
|
1262
|
-
} = _a, watchOptions = __objRest$3(_a, [
|
|
1263
|
-
"debounce",
|
|
1264
|
-
"maxWait"
|
|
1265
|
-
]);
|
|
1266
|
-
return watchWithFilter(source, cb, __spreadProps$4(__spreadValues$4({}, watchOptions), {
|
|
1267
|
-
eventFilter: debounceFilter(debounce, { maxWait })
|
|
1268
|
-
}));
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
var __defProp$3 = Object.defineProperty;
|
|
1272
|
-
var __defProps$3 = Object.defineProperties;
|
|
1273
|
-
var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
|
|
1274
|
-
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
1275
|
-
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
1276
|
-
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
1277
|
-
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1278
|
-
var __spreadValues$3 = (a, b) => {
|
|
1279
|
-
for (var prop in b || (b = {}))
|
|
1280
|
-
if (__hasOwnProp$3.call(b, prop))
|
|
1281
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1282
|
-
if (__getOwnPropSymbols$3)
|
|
1283
|
-
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
1284
|
-
if (__propIsEnum$3.call(b, prop))
|
|
1285
|
-
__defNormalProp$3(a, prop, b[prop]);
|
|
1286
|
-
}
|
|
1287
|
-
return a;
|
|
1288
|
-
};
|
|
1289
|
-
var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
|
|
1290
|
-
var __objRest$2 = (source, exclude) => {
|
|
1291
|
-
var target = {};
|
|
1292
|
-
for (var prop in source)
|
|
1293
|
-
if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1294
|
-
target[prop] = source[prop];
|
|
1295
|
-
if (source != null && __getOwnPropSymbols$3)
|
|
1296
|
-
for (var prop of __getOwnPropSymbols$3(source)) {
|
|
1297
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
|
|
1298
|
-
target[prop] = source[prop];
|
|
1299
|
-
}
|
|
1300
|
-
return target;
|
|
1301
|
-
};
|
|
1302
|
-
function watchIgnorable(source, cb, options = {}) {
|
|
1303
|
-
const _a = options, {
|
|
1304
|
-
eventFilter = bypassFilter
|
|
1305
|
-
} = _a, watchOptions = __objRest$2(_a, [
|
|
1306
|
-
"eventFilter"
|
|
1307
|
-
]);
|
|
1308
|
-
const filteredCb = createFilterWrapper(eventFilter, cb);
|
|
1309
|
-
let ignoreUpdates;
|
|
1310
|
-
let ignorePrevAsyncUpdates;
|
|
1311
|
-
let stop;
|
|
1312
|
-
if (watchOptions.flush === "sync") {
|
|
1313
|
-
const ignore = vueDemi.ref(false);
|
|
1314
|
-
ignorePrevAsyncUpdates = () => {
|
|
1315
|
-
};
|
|
1316
|
-
ignoreUpdates = (updater) => {
|
|
1317
|
-
ignore.value = true;
|
|
1318
|
-
updater();
|
|
1319
|
-
ignore.value = false;
|
|
1320
|
-
};
|
|
1321
|
-
stop = vueDemi.watch(source, (...args) => {
|
|
1322
|
-
if (!ignore.value)
|
|
1323
|
-
filteredCb(...args);
|
|
1324
|
-
}, watchOptions);
|
|
1325
|
-
} else {
|
|
1326
|
-
const disposables = [];
|
|
1327
|
-
const ignoreCounter = vueDemi.ref(0);
|
|
1328
|
-
const syncCounter = vueDemi.ref(0);
|
|
1329
|
-
ignorePrevAsyncUpdates = () => {
|
|
1330
|
-
ignoreCounter.value = syncCounter.value;
|
|
1331
|
-
};
|
|
1332
|
-
disposables.push(vueDemi.watch(source, () => {
|
|
1333
|
-
syncCounter.value++;
|
|
1334
|
-
}, __spreadProps$3(__spreadValues$3({}, watchOptions), { flush: "sync" })));
|
|
1335
|
-
ignoreUpdates = (updater) => {
|
|
1336
|
-
const syncCounterPrev = syncCounter.value;
|
|
1337
|
-
updater();
|
|
1338
|
-
ignoreCounter.value += syncCounter.value - syncCounterPrev;
|
|
1339
|
-
};
|
|
1340
|
-
disposables.push(vueDemi.watch(source, (...args) => {
|
|
1341
|
-
const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;
|
|
1342
|
-
ignoreCounter.value = 0;
|
|
1343
|
-
syncCounter.value = 0;
|
|
1344
|
-
if (ignore)
|
|
1345
|
-
return;
|
|
1346
|
-
filteredCb(...args);
|
|
1347
|
-
}, watchOptions));
|
|
1348
|
-
stop = () => {
|
|
1349
|
-
disposables.forEach((fn) => fn());
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
function watchOnce(source, cb, options) {
|
|
1356
|
-
const stop = vueDemi.watch(source, (...args) => {
|
|
1357
|
-
vueDemi.nextTick(() => stop());
|
|
1358
|
-
return cb(...args);
|
|
1359
|
-
}, options);
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
var __defProp$2 = Object.defineProperty;
|
|
1363
|
-
var __defProps$2 = Object.defineProperties;
|
|
1364
|
-
var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
|
|
1365
|
-
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
1366
|
-
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
1367
|
-
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
1368
|
-
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1369
|
-
var __spreadValues$2 = (a, b) => {
|
|
1370
|
-
for (var prop in b || (b = {}))
|
|
1371
|
-
if (__hasOwnProp$2.call(b, prop))
|
|
1372
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1373
|
-
if (__getOwnPropSymbols$2)
|
|
1374
|
-
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
1375
|
-
if (__propIsEnum$2.call(b, prop))
|
|
1376
|
-
__defNormalProp$2(a, prop, b[prop]);
|
|
1377
|
-
}
|
|
1378
|
-
return a;
|
|
1379
|
-
};
|
|
1380
|
-
var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
|
|
1381
|
-
var __objRest$1 = (source, exclude) => {
|
|
1382
|
-
var target = {};
|
|
1383
|
-
for (var prop in source)
|
|
1384
|
-
if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1385
|
-
target[prop] = source[prop];
|
|
1386
|
-
if (source != null && __getOwnPropSymbols$2)
|
|
1387
|
-
for (var prop of __getOwnPropSymbols$2(source)) {
|
|
1388
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
|
|
1389
|
-
target[prop] = source[prop];
|
|
1390
|
-
}
|
|
1391
|
-
return target;
|
|
1392
|
-
};
|
|
1393
|
-
function watchPausable(source, cb, options = {}) {
|
|
1394
|
-
const _a = options, {
|
|
1395
|
-
eventFilter: filter
|
|
1396
|
-
} = _a, watchOptions = __objRest$1(_a, [
|
|
1397
|
-
"eventFilter"
|
|
1398
|
-
]);
|
|
1399
|
-
const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
|
|
1400
|
-
const stop = watchWithFilter(source, cb, __spreadProps$2(__spreadValues$2({}, watchOptions), {
|
|
1401
|
-
eventFilter
|
|
1402
|
-
}));
|
|
1403
|
-
return { stop, pause, resume, isActive };
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
var __defProp$1 = Object.defineProperty;
|
|
1407
|
-
var __defProps$1 = Object.defineProperties;
|
|
1408
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
1409
|
-
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
1410
|
-
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
1411
|
-
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
1412
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1413
|
-
var __spreadValues$1 = (a, b) => {
|
|
1414
|
-
for (var prop in b || (b = {}))
|
|
1415
|
-
if (__hasOwnProp$1.call(b, prop))
|
|
1416
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1417
|
-
if (__getOwnPropSymbols$1)
|
|
1418
|
-
for (var prop of __getOwnPropSymbols$1(b)) {
|
|
1419
|
-
if (__propIsEnum$1.call(b, prop))
|
|
1420
|
-
__defNormalProp$1(a, prop, b[prop]);
|
|
1421
|
-
}
|
|
1422
|
-
return a;
|
|
1423
|
-
};
|
|
1424
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
1425
|
-
var __objRest = (source, exclude) => {
|
|
1426
|
-
var target = {};
|
|
1427
|
-
for (var prop in source)
|
|
1428
|
-
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1429
|
-
target[prop] = source[prop];
|
|
1430
|
-
if (source != null && __getOwnPropSymbols$1)
|
|
1431
|
-
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
1432
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
1433
|
-
target[prop] = source[prop];
|
|
1434
|
-
}
|
|
1435
|
-
return target;
|
|
1436
|
-
};
|
|
1437
|
-
function watchThrottled(source, cb, options = {}) {
|
|
1438
|
-
const _a = options, {
|
|
1439
|
-
throttle = 0,
|
|
1440
|
-
trailing = true,
|
|
1441
|
-
leading = true
|
|
1442
|
-
} = _a, watchOptions = __objRest(_a, [
|
|
1443
|
-
"throttle",
|
|
1444
|
-
"trailing",
|
|
1445
|
-
"leading"
|
|
1446
|
-
]);
|
|
1447
|
-
return watchWithFilter(source, cb, __spreadProps$1(__spreadValues$1({}, watchOptions), {
|
|
1448
|
-
eventFilter: throttleFilter(throttle, trailing, leading)
|
|
1449
|
-
}));
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
var __defProp = Object.defineProperty;
|
|
1453
|
-
var __defProps = Object.defineProperties;
|
|
1454
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
1455
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
1456
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1457
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
1458
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1459
|
-
var __spreadValues = (a, b) => {
|
|
1460
|
-
for (var prop in b || (b = {}))
|
|
1461
|
-
if (__hasOwnProp.call(b, prop))
|
|
1462
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1463
|
-
if (__getOwnPropSymbols)
|
|
1464
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
1465
|
-
if (__propIsEnum.call(b, prop))
|
|
1466
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1467
|
-
}
|
|
1468
|
-
return a;
|
|
1469
|
-
};
|
|
1470
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
1471
|
-
function watchTriggerable(source, cb, options = {}) {
|
|
1472
|
-
let cleanupFn;
|
|
1473
|
-
function onEffect() {
|
|
1474
|
-
if (!cleanupFn)
|
|
1475
|
-
return;
|
|
1476
|
-
const fn = cleanupFn;
|
|
1477
|
-
cleanupFn = void 0;
|
|
1478
|
-
fn();
|
|
1479
|
-
}
|
|
1480
|
-
function onCleanup(callback) {
|
|
1481
|
-
cleanupFn = callback;
|
|
1482
|
-
}
|
|
1483
|
-
const _cb = (value, oldValue) => {
|
|
1484
|
-
onEffect();
|
|
1485
|
-
return cb(value, oldValue, onCleanup);
|
|
1486
|
-
};
|
|
1487
|
-
const res = watchIgnorable(source, _cb, options);
|
|
1488
|
-
const { ignoreUpdates } = res;
|
|
1489
|
-
const trigger = () => {
|
|
1490
|
-
let res2;
|
|
1491
|
-
ignoreUpdates(() => {
|
|
1492
|
-
res2 = _cb(getWatchSources(source), getOldValue(source));
|
|
1493
|
-
});
|
|
1494
|
-
return res2;
|
|
1495
|
-
};
|
|
1496
|
-
return __spreadProps(__spreadValues({}, res), {
|
|
1497
|
-
trigger
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
|
-
function getWatchSources(sources) {
|
|
1501
|
-
if (vueDemi.isReactive(sources))
|
|
1502
|
-
return sources;
|
|
1503
|
-
if (Array.isArray(sources))
|
|
1504
|
-
return sources.map((item) => getOneWatchSource(item));
|
|
1505
|
-
return getOneWatchSource(sources);
|
|
1506
|
-
}
|
|
1507
|
-
function getOneWatchSource(source) {
|
|
1508
|
-
return typeof source === "function" ? source() : vueDemi.unref(source);
|
|
1509
|
-
}
|
|
1510
|
-
function getOldValue(source) {
|
|
1511
|
-
return Array.isArray(source) ? source.map(() => void 0) : void 0;
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
function whenever(source, cb, options) {
|
|
1515
|
-
return vueDemi.watch(source, (v, ov, onInvalidate) => {
|
|
1516
|
-
if (v)
|
|
1517
|
-
cb(v, ov, onInvalidate);
|
|
1518
|
-
}, options);
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
exports.__onlyVue3 = __onlyVue3;
|
|
1522
|
-
exports.assert = assert;
|
|
1523
|
-
exports.autoResetRef = refAutoReset;
|
|
1524
|
-
exports.bypassFilter = bypassFilter;
|
|
1525
|
-
exports.clamp = clamp;
|
|
1526
|
-
exports.computedEager = computedEager;
|
|
1527
|
-
exports.computedWithControl = computedWithControl;
|
|
1528
|
-
exports.containsProp = containsProp;
|
|
1529
|
-
exports.controlledComputed = computedWithControl;
|
|
1530
|
-
exports.controlledRef = controlledRef;
|
|
1531
|
-
exports.createEventHook = createEventHook;
|
|
1532
|
-
exports.createFilterWrapper = createFilterWrapper;
|
|
1533
|
-
exports.createGlobalState = createGlobalState;
|
|
1534
|
-
exports.createInjectionState = createInjectionState;
|
|
1535
|
-
exports.createReactiveFn = reactify;
|
|
1536
|
-
exports.createSharedComposable = createSharedComposable;
|
|
1537
|
-
exports.createSingletonPromise = createSingletonPromise;
|
|
1538
|
-
exports.debounceFilter = debounceFilter;
|
|
1539
|
-
exports.debouncedRef = refDebounced;
|
|
1540
|
-
exports.debouncedWatch = watchDebounced;
|
|
1541
|
-
exports.directiveHooks = directiveHooks;
|
|
1542
|
-
exports.eagerComputed = computedEager;
|
|
1543
|
-
exports.extendRef = extendRef;
|
|
1544
|
-
exports.formatDate = formatDate;
|
|
1545
|
-
exports.get = get;
|
|
1546
|
-
exports.hasOwn = hasOwn;
|
|
1547
|
-
exports.identity = identity;
|
|
1548
|
-
exports.ignorableWatch = watchIgnorable;
|
|
1549
|
-
exports.increaseWithUnit = increaseWithUnit;
|
|
1550
|
-
exports.invoke = invoke;
|
|
1551
|
-
exports.isBoolean = isBoolean;
|
|
1552
|
-
exports.isClient = isClient;
|
|
1553
|
-
exports.isDef = isDef;
|
|
1554
|
-
exports.isDefined = isDefined;
|
|
1555
|
-
exports.isFunction = isFunction;
|
|
1556
|
-
exports.isIOS = isIOS;
|
|
1557
|
-
exports.isNumber = isNumber;
|
|
1558
|
-
exports.isObject = isObject;
|
|
1559
|
-
exports.isString = isString;
|
|
1560
|
-
exports.isWindow = isWindow;
|
|
1561
|
-
exports.makeDestructurable = makeDestructurable;
|
|
1562
|
-
exports.noop = noop;
|
|
1563
|
-
exports.normalizeDate = normalizeDate;
|
|
1564
|
-
exports.now = now;
|
|
1565
|
-
exports.objectPick = objectPick;
|
|
1566
|
-
exports.pausableFilter = pausableFilter;
|
|
1567
|
-
exports.pausableWatch = watchPausable;
|
|
1568
|
-
exports.promiseTimeout = promiseTimeout;
|
|
1569
|
-
exports.rand = rand;
|
|
1570
|
-
exports.reactify = reactify;
|
|
1571
|
-
exports.reactifyObject = reactifyObject;
|
|
1572
|
-
exports.reactiveComputed = reactiveComputed;
|
|
1573
|
-
exports.reactiveOmit = reactiveOmit;
|
|
1574
|
-
exports.reactivePick = reactivePick;
|
|
1575
|
-
exports.refAutoReset = refAutoReset;
|
|
1576
|
-
exports.refDebounced = refDebounced;
|
|
1577
|
-
exports.refDefault = refDefault;
|
|
1578
|
-
exports.refThrottled = refThrottled;
|
|
1579
|
-
exports.refWithControl = refWithControl;
|
|
1580
|
-
exports.resolveRef = resolveRef;
|
|
1581
|
-
exports.resolveUnref = resolveUnref;
|
|
1582
|
-
exports.set = set;
|
|
1583
|
-
exports.syncRef = syncRef;
|
|
1584
|
-
exports.syncRefs = syncRefs;
|
|
1585
|
-
exports.throttleFilter = throttleFilter;
|
|
1586
|
-
exports.throttledRef = refThrottled;
|
|
1587
|
-
exports.throttledWatch = watchThrottled;
|
|
1588
|
-
exports.timestamp = timestamp;
|
|
1589
|
-
exports.toReactive = toReactive;
|
|
1590
|
-
exports.toRefs = toRefs;
|
|
1591
|
-
exports.tryOnBeforeMount = tryOnBeforeMount;
|
|
1592
|
-
exports.tryOnBeforeUnmount = tryOnBeforeUnmount;
|
|
1593
|
-
exports.tryOnMounted = tryOnMounted;
|
|
1594
|
-
exports.tryOnScopeDispose = tryOnScopeDispose;
|
|
1595
|
-
exports.tryOnUnmounted = tryOnUnmounted;
|
|
1596
|
-
exports.until = until;
|
|
1597
|
-
exports.useArrayEvery = useArrayEvery;
|
|
1598
|
-
exports.useArrayFilter = useArrayFilter;
|
|
1599
|
-
exports.useArrayFind = useArrayFind;
|
|
1600
|
-
exports.useArrayFindIndex = useArrayFindIndex;
|
|
1601
|
-
exports.useArrayJoin = useArrayJoin;
|
|
1602
|
-
exports.useArrayMap = useArrayMap;
|
|
1603
|
-
exports.useArrayReduce = useArrayReduce;
|
|
1604
|
-
exports.useArraySome = useArraySome;
|
|
1605
|
-
exports.useCounter = useCounter;
|
|
1606
|
-
exports.useDateFormat = useDateFormat;
|
|
1607
|
-
exports.useDebounce = refDebounced;
|
|
1608
|
-
exports.useDebounceFn = useDebounceFn;
|
|
1609
|
-
exports.useInterval = useInterval;
|
|
1610
|
-
exports.useIntervalFn = useIntervalFn;
|
|
1611
|
-
exports.useLastChanged = useLastChanged;
|
|
1612
|
-
exports.useThrottle = refThrottled;
|
|
1613
|
-
exports.useThrottleFn = useThrottleFn;
|
|
1614
|
-
exports.useTimeout = useTimeout;
|
|
1615
|
-
exports.useTimeoutFn = useTimeoutFn;
|
|
1616
|
-
exports.useToNumber = useToNumber;
|
|
1617
|
-
exports.useToString = useToString;
|
|
1618
|
-
exports.useToggle = useToggle;
|
|
1619
|
-
exports.watchArray = watchArray;
|
|
1620
|
-
exports.watchAtMost = watchAtMost;
|
|
1621
|
-
exports.watchDebounced = watchDebounced;
|
|
1622
|
-
exports.watchIgnorable = watchIgnorable;
|
|
1623
|
-
exports.watchOnce = watchOnce;
|
|
1624
|
-
exports.watchPausable = watchPausable;
|
|
1625
|
-
exports.watchThrottled = watchThrottled;
|
|
1626
|
-
exports.watchTriggerable = watchTriggerable;
|
|
1627
|
-
exports.watchWithFilter = watchWithFilter;
|
|
1628
|
-
exports.whenever = whenever;
|