yuyeon 0.3.4-beta.15 → 0.3.4-beta.17
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/dist/yuyeon.js +336 -336
- package/dist/yuyeon.umd.cjs +1 -1
- package/lib/components/img/YImg.js +6 -6
- package/lib/components/img/YImg.js.map +1 -1
- package/lib/directives/plate-wave/index.js.map +1 -1
- package/package.json +1 -1
- package/types/components/dialog/YDialog.d.ts +4 -4
- package/types/components/img/YImg.d.ts +4 -1
- package/types/components/img/index.d.ts +1 -0
- package/types/components/index.d.ts +1 -0
- package/types/components/layer/YLayer.d.ts +2 -2
- package/types/components/menu/YMenu.d.ts +4 -4
- package/types/composables/coordinate/types.d.ts +1 -0
- package/types/directives/plate-wave/index.d.ts +1 -1
- package/types/shims.d.ts +5 -4
- package/types/components/table/composibles/header.d.ts +0 -207
- package/types/components/table/composibles/items.d.ts +0 -55
- package/types/components/table/composibles/measure.d.ts +0 -8
- package/types/components/table/composibles/options.d.ts +0 -11
- package/types/components/table/composibles/pagination.d.ts +0 -81
- package/types/components/table/composibles/selection.d.ts +0 -82
- package/types/components/table/composibles/sorted-items.d.ts +0 -7
- package/types/components/table/composibles/sorting.d.ts +0 -62
- package/types/src/abstract/items.d.ts +0 -49
- package/types/src/components/alert/YAlert.d.ts +0 -13
- package/types/src/components/alert/index.d.ts +0 -1
- package/types/src/components/app/YApp.d.ts +0 -8
- package/types/src/components/app/index.d.ts +0 -1
- package/types/src/components/badge/YBadge.d.ts +0 -126
- package/types/src/components/badge/index.d.ts +0 -1
- package/types/src/components/bench/YBench.d.ts +0 -4
- package/types/src/components/bench/index.d.ts +0 -1
- package/types/src/components/button/YButton.d.ts +0 -189
- package/types/src/components/button/index.d.ts +0 -1
- package/types/src/components/card/YCard.d.ts +0 -9
- package/types/src/components/card/YCardBody.d.ts +0 -2
- package/types/src/components/card/YCardFooter.d.ts +0 -2
- package/types/src/components/card/YCardHeader.d.ts +0 -2
- package/types/src/components/card/index.d.ts +0 -4
- package/types/src/components/checkbox/YCheckbox.d.ts +0 -23
- package/types/src/components/checkbox/YInputCheckbox.d.ts +0 -31
- package/types/src/components/checkbox/index.d.ts +0 -4
- package/types/src/components/chip/YChip.d.ts +0 -37
- package/types/src/components/chip/index.d.ts +0 -1
- package/types/src/components/date-picker/YDateCalendar.d.ts +0 -115
- package/types/src/components/date-picker/YDatePicker.d.ts +0 -94
- package/types/src/components/date-picker/YDatePickerControl.d.ts +0 -97
- package/types/src/components/date-picker/YMonthPicker.d.ts +0 -25
- package/types/src/components/date-picker/YYearPicker.d.ts +0 -38
- package/types/src/components/date-picker/index.d.ts +0 -3
- package/types/src/components/default-provider/YDefaultProvider.d.ts +0 -0
- package/types/src/components/default-provider/index.d.ts +0 -0
- package/types/src/components/dialog/YDialog.d.ts +0 -715
- package/types/src/components/dialog/index.d.ts +0 -1
- package/types/src/components/divider/YDivider.d.ts +0 -14
- package/types/src/components/divider/index.d.ts +0 -1
- package/types/src/components/draggable/YDraggable.d.ts +0 -36
- package/types/src/components/draggable/index.d.ts +0 -1
- package/types/src/components/dropdown/YDropdown.d.ts +0 -574
- package/types/src/components/dropdown/index.d.ts +0 -1
- package/types/src/components/field-input/YFieldInput.d.ts +0 -322
- package/types/src/components/field-input/index.d.ts +0 -1
- package/types/src/components/form/YForm.d.ts +0 -20
- package/types/src/components/form/index.d.ts +0 -1
- package/types/src/components/hover/YHover.d.ts +0 -57
- package/types/src/components/hover/index.d.ts +0 -1
- package/types/src/components/icon/YIcon.d.ts +0 -67
- package/types/src/components/icon/index.d.ts +0 -1
- package/types/src/components/icons/YIconCheckbox.d.ts +0 -6
- package/types/src/components/icons/YIconClear.d.ts +0 -1
- package/types/src/components/icons/YIconDropdown.d.ts +0 -1
- package/types/src/components/icons/YIconExpand.d.ts +0 -1
- package/types/src/components/icons/YIconPageControl.d.ts +0 -14
- package/types/src/components/icons/YIconSort.d.ts +0 -10
- package/types/src/components/icons/index.d.ts +0 -51
- package/types/src/components/img/YImg.d.ts +0 -136
- package/types/src/components/img/index.d.ts +0 -1
- package/types/src/components/index.d.ts +0 -39
- package/types/src/components/input/YInput.d.ts +0 -249
- package/types/src/components/input/index.d.ts +0 -1
- package/types/src/components/ip-field/YIpv4Field.d.ts +0 -65
- package/types/src/components/ip-field/index.d.ts +0 -1
- package/types/src/components/layer/YLayer.d.ts +0 -436
- package/types/src/components/layer/active-delay.d.ts +0 -4
- package/types/src/components/layer/active-stack.d.ts +0 -16
- package/types/src/components/layer/base.d.ts +0 -28
- package/types/src/components/layer/content.d.ts +0 -21
- package/types/src/components/layer/index.d.ts +0 -1
- package/types/src/components/layer/scroll-strategies.d.ts +0 -41
- package/types/src/components/list/YList.d.ts +0 -19
- package/types/src/components/list/YListItem.d.ts +0 -42
- package/types/src/components/list/index.d.ts +0 -2
- package/types/src/components/loading/YSpinnerRing.d.ts +0 -3
- package/types/src/components/loading/index.d.ts +0 -1
- package/types/src/components/menu/YMenu.d.ts +0 -517
- package/types/src/components/menu/index.d.ts +0 -1
- package/types/src/components/navigation/YNavigation.d.ts +0 -1
- package/types/src/components/navigation/index.d.ts +0 -1
- package/types/src/components/pagination/YPagination.d.ts +0 -137
- package/types/src/components/pagination/index.d.ts +0 -1
- package/types/src/components/panel/YDividePanel.d.ts +0 -5
- package/types/src/components/panel/index.d.ts +0 -1
- package/types/src/components/plate/YPlate.d.ts +0 -9
- package/types/src/components/plate/index.d.ts +0 -1
- package/types/src/components/progress-bar/YProgressBar.d.ts +0 -38
- package/types/src/components/progress-bar/index.d.ts +0 -1
- package/types/src/components/progress-ring/YProgressRing.d.ts +0 -34
- package/types/src/components/progress-ring/index.d.ts +0 -1
- package/types/src/components/radio/YRadio.d.ts +0 -25
- package/types/src/components/radio/YRadioIcon.d.ts +0 -6
- package/types/src/components/radio/index.d.ts +0 -2
- package/types/src/components/select/YSelect.d.ts +0 -1221
- package/types/src/components/select/index.d.ts +0 -1
- package/types/src/components/slider/YSlider.d.ts +0 -16
- package/types/src/components/slider/index.d.ts +0 -1
- package/types/src/components/slider/slider.d.ts +0 -0
- package/types/src/components/snackbar/YSnackbar.d.ts +0 -452
- package/types/src/components/snackbar/index.d.ts +0 -1
- package/types/src/components/switch/YSwitch.d.ts +0 -137
- package/types/src/components/switch/index.d.ts +0 -1
- package/types/src/components/tab/YTab.d.ts +0 -218
- package/types/src/components/tab/YTabs.d.ts +0 -98
- package/types/src/components/tab/index.d.ts +0 -3
- package/types/src/components/tab/shared.d.ts +0 -4
- package/types/src/components/tab/types.d.ts +0 -5
- package/types/src/components/table/YDataTable.d.ts +0 -459
- package/types/src/components/table/YDataTableBody.d.ts +0 -99
- package/types/src/components/table/YDataTableCell.d.ts +0 -32
- package/types/src/components/table/YDataTableControl.d.ts +0 -68
- package/types/src/components/table/YDataTableHead.d.ts +0 -54
- package/types/src/components/table/YDataTableLayer.d.ts +0 -13
- package/types/src/components/table/YDataTableLayerRow.d.ts +0 -22
- package/types/src/components/table/YDataTableLayerRows.d.ts +0 -9
- package/types/src/components/table/YDataTableRow.d.ts +0 -53
- package/types/src/components/table/YDataTableServer.d.ts +0 -502
- package/types/src/components/table/YTable.d.ts +0 -65
- package/types/src/components/table/composables/expand.d.ts +0 -42
- package/types/src/components/table/composables/header.d.ts +0 -175
- package/types/src/components/table/composables/items.d.ts +0 -55
- package/types/src/components/table/composables/measure.d.ts +0 -8
- package/types/src/components/table/composables/options.d.ts +0 -11
- package/types/src/components/table/composables/pagination.d.ts +0 -81
- package/types/src/components/table/composables/provides.d.ts +0 -15
- package/types/src/components/table/composables/selection.d.ts +0 -82
- package/types/src/components/table/composables/sorted-items.d.ts +0 -7
- package/types/src/components/table/composables/sorting.d.ts +0 -56
- package/types/src/components/table/index.d.ts +0 -10
- package/types/src/components/table/types/common.d.ts +0 -2
- package/types/src/components/table/types/header.d.ts +0 -25
- package/types/src/components/table/types/index.d.ts +0 -59
- package/types/src/components/table/types/item.d.ts +0 -23
- package/types/src/components/table/types/row.d.ts +0 -4
- package/types/src/components/text-ellipsis/YTextEllipsis.d.ts +0 -11
- package/types/src/components/text-ellipsis/index.d.ts +0 -1
- package/types/src/components/text-highlighter/YTextHighlighter.d.ts +0 -26
- package/types/src/components/text-highlighter/index.d.ts +0 -1
- package/types/src/components/text-interpolation/YTi.d.ts +0 -11
- package/types/src/components/text-interpolation/index.d.ts +0 -1
- package/types/src/components/textarea/YTextarea.d.ts +0 -583
- package/types/src/components/textarea/index.d.ts +0 -1
- package/types/src/components/toggle-button/YToggleButton.d.ts +0 -4
- package/types/src/components/toggle-button/index.d.ts +0 -1
- package/types/src/components/tooltip/YTooltip.d.ts +0 -502
- package/types/src/components/tooltip/index.d.ts +0 -1
- package/types/src/components/transitions/expand-transition.d.ts +0 -20
- package/types/src/components/transitions/index.d.ts +0 -38
- package/types/src/components/tree-view/YTreeView.d.ts +0 -172
- package/types/src/components/tree-view/YTreeViewNode.d.ts +0 -176
- package/types/src/components/tree-view/index.d.ts +0 -2
- package/types/src/components/tree-view/tree-view.d.ts +0 -51
- package/types/src/components/tree-view/types.d.ts +0 -17
- package/types/src/components/tree-view/util.d.ts +0 -6
- package/types/src/composables/choice-link.d.ts +0 -3
- package/types/src/composables/choice.d.ts +0 -113
- package/types/src/composables/communication.d.ts +0 -8
- package/types/src/composables/component.d.ts +0 -3
- package/types/src/composables/coordinate/arrangement.d.ts +0 -7
- package/types/src/composables/coordinate/index.d.ts +0 -87
- package/types/src/composables/coordinate/levitation.d.ts +0 -7
- package/types/src/composables/coordinate/types.d.ts +0 -8
- package/types/src/composables/coordinate/utils/point.d.ts +0 -22
- package/types/src/composables/date/factory.d.ts +0 -3
- package/types/src/composables/date/index.d.ts +0 -12
- package/types/src/composables/date/setting.d.ts +0 -5
- package/types/src/composables/date/types.d.ts +0 -13
- package/types/src/composables/defaults/index.d.ts +0 -11
- package/types/src/composables/defaults/share.d.ts +0 -4
- package/types/src/composables/defaults/types.d.ts +0 -12
- package/types/src/composables/dimension.d.ts +0 -54
- package/types/src/composables/focus.d.ts +0 -30
- package/types/src/composables/form.d.ts +0 -132
- package/types/src/composables/i18n/index.d.ts +0 -9
- package/types/src/composables/i18n/locale.d.ts +0 -3
- package/types/src/composables/i18n/rtl.d.ts +0 -21
- package/types/src/composables/i18n/share.d.ts +0 -1
- package/types/src/composables/icon.d.ts +0 -79
- package/types/src/composables/index.d.ts +0 -10
- package/types/src/composables/layer-group.d.ts +0 -10
- package/types/src/composables/layout.d.ts +0 -10
- package/types/src/composables/list-items.d.ts +0 -113
- package/types/src/composables/progress.d.ts +0 -4
- package/types/src/composables/ref.d.ts +0 -6
- package/types/src/composables/resize-observer.d.ts +0 -24
- package/types/src/composables/scope.d.ts +0 -3
- package/types/src/composables/style-color.d.ts +0 -14
- package/types/src/composables/theme/factory.d.ts +0 -4
- package/types/src/composables/theme/helper.d.ts +0 -3
- package/types/src/composables/theme/index.d.ts +0 -57
- package/types/src/composables/theme/setting.d.ts +0 -11
- package/types/src/composables/theme/types.d.ts +0 -29
- package/types/src/composables/timing.d.ts +0 -20
- package/types/src/composables/transition.d.ts +0 -40
- package/types/src/composables/validation.d.ts +0 -82
- package/types/src/composables/vue-router.d.ts +0 -43
- package/types/src/declares.d.ts +0 -1
- package/types/src/directives/complement-click/index.d.ts +0 -26
- package/types/src/directives/index.d.ts +0 -2
- package/types/src/directives/plate-wave/index.d.ts +0 -20
- package/types/src/directives/theme-class/index.d.ts +0 -4
- package/types/src/etc/index.d.ts +0 -1
- package/types/src/globals.d.ts +0 -20
- package/types/src/i18n/built-in.d.ts +0 -3
- package/types/src/i18n/config.d.ts +0 -81
- package/types/src/i18n/types.d.ts +0 -20
- package/types/src/index.d.ts +0 -13
- package/types/src/locales/en.d.ts +0 -6
- package/types/src/locales/index.d.ts +0 -2
- package/types/src/locales/ko.d.ts +0 -6
- package/types/src/mixins/di.d.ts +0 -2
- package/types/src/mixins/rebind-attrs.d.ts +0 -5
- package/types/src/shims.d.ts +0 -65
- package/types/src/types/index.d.ts +0 -9
- package/types/src/util/anchor.d.ts +0 -23
- package/types/src/util/array.d.ts +0 -2
- package/types/src/util/collection.d.ts +0 -1
- package/types/src/util/color/apca.d.ts +0 -29
- package/types/src/util/color/const.d.ts +0 -5
- package/types/src/util/color/contrast/contrast.d.ts +0 -74
- package/types/src/util/color/conversion.d.ts +0 -131
- package/types/src/util/color/hct/cam16.d.ts +0 -116
- package/types/src/util/color/hct/hct-solver.d.ts +0 -131
- package/types/src/util/color/hct/hct.d.ts +0 -71
- package/types/src/util/color/hct/viewing-conditions.d.ts +0 -58
- package/types/src/util/color/index.d.ts +0 -5
- package/types/src/util/color/palettes/core-palette.d.ts +0 -44
- package/types/src/util/color/palettes/tonal-palette.d.ts +0 -40
- package/types/src/util/color/types.d.ts +0 -14
- package/types/src/util/color/utils/math-utils.d.ts +0 -82
- package/types/src/util/common.d.ts +0 -17
- package/types/src/util/component/component.d.ts +0 -5
- package/types/src/util/component/index.d.ts +0 -11
- package/types/src/util/component/inject-self.d.ts +0 -3
- package/types/src/util/component/props.d.ts +0 -32
- package/types/src/util/component/types.d.ts +0 -21
- package/types/src/util/date/adapters/yuyeon-date-adapter.d.ts +0 -43
- package/types/src/util/date/built-in.d.ts +0 -41
- package/types/src/util/date/index.d.ts +0 -3
- package/types/src/util/date/types.d.ts +0 -167
- package/types/src/util/debounce.d.ts +0 -11
- package/types/src/util/dom.d.ts +0 -5
- package/types/src/util/environments.d.ts +0 -6
- package/types/src/util/frame-scheduler.d.ts +0 -7
- package/types/src/util/index.d.ts +0 -16
- package/types/src/util/reactivity.d.ts +0 -7
- package/types/src/util/rect.d.ts +0 -36
- package/types/src/util/scroll.d.ts +0 -3
- package/types/src/util/string.d.ts +0 -9
- package/types/src/util/ui.d.ts +0 -4
- package/types/src/util/validation.d.ts +0 -3
|
@@ -76,16 +76,14 @@ export const YImg = defineComponent({
|
|
|
76
76
|
watch(() => props.src, () => {
|
|
77
77
|
initIntersect();
|
|
78
78
|
});
|
|
79
|
-
const _Placeholder =
|
|
79
|
+
const _Placeholder = placeholderProps => {
|
|
80
80
|
if (!slots.placeholder) return null;
|
|
81
81
|
return _createVNode(PolyTransition, _mergeProps(polyTransitionBindProps.value, {
|
|
82
82
|
"appear": true
|
|
83
83
|
}), {
|
|
84
|
-
default: () => [(status
|
|
84
|
+
default: () => [(placeholderProps.status === "idle" || placeholderProps.status === "error") && _createVNode("div", {
|
|
85
85
|
"class": "y-img__placeholder"
|
|
86
|
-
}, [slots.placeholder?.(
|
|
87
|
-
status: status.value
|
|
88
|
-
})])]
|
|
86
|
+
}, [slots.placeholder?.(placeholderProps)])]
|
|
89
87
|
});
|
|
90
88
|
};
|
|
91
89
|
function onLoad() {
|
|
@@ -165,7 +163,9 @@ export const YImg = defineComponent({
|
|
|
165
163
|
useRender(() => {
|
|
166
164
|
return _createVNode("div", {
|
|
167
165
|
"class": ["y-img"]
|
|
168
|
-
}, [_createVNode(_Placeholder,
|
|
166
|
+
}, [_createVNode(_Placeholder, {
|
|
167
|
+
"status": status.value
|
|
168
|
+
}, null), _createVNode(_Image, {
|
|
169
169
|
"status": status.value
|
|
170
170
|
}, null)]);
|
|
171
171
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YImg.js","names":["computed","getCurrentInstance","nextTick","onBeforeMount","onBeforeUnmount","ref","shallowRef","vShow","watch","withDirectives","createVNode","_createVNode","mergeProps","_mergeProps","useRender","pressDimensionPropsOptions","PolyTransition","pressPolyTransitionPropsOptions","usePolyTransition","defineComponent","propsFactory","Environments","pressYImgPropsOptions","src","String","crossorigin","referrerpolicy","transition","objectFit","type","default","eager","Boolean","YImg","name","props","slots","Object","emits","setup","_ref","attrs","emit","vm","image$","status","imgSrc","naturalWidth","naturalHeight","polyTransitionBindProps","srcMeta","imgClasses","getImgSrc","imgEl","value","currentSrc","inspectImage","complete","endsWith","startsWith","initIntersect","_Placeholder","placeholder","onLoad","isUnmounted","onError","event","_Image","imageProps","Img","draggable","alt","requestTimer","requestInspectImage","timeout","arguments","length","undefined","_request","clearTimeout","window","setTimeout","isIntersection","canUseIntersectionObserver"],"sources":["../../../src/components/img/YImg.tsx"],"sourcesContent":["import {\n type CSSProperties,\n computed,\n getCurrentInstance,\n type ImgHTMLAttributes,\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n type PropType,\n ref,\n type SlotsType,\n shallowRef,\n vShow,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { useRender } from \"@/composables/component\";\nimport { pressDimensionPropsOptions } from \"@/composables/dimension\";\nimport {\n PolyTransition,\n pressPolyTransitionPropsOptions,\n usePolyTransition,\n} from \"@/composables/transition\";\nimport { defineComponent, propsFactory } from \"@/util/component\";\nimport Environments from \"@/util/environments\";\n\nimport \"./YImg.scss\";\n\nexport const pressYImgPropsOptions = propsFactory(\n {\n src: String as PropType<string>,\n crossorigin: String as PropType<ImgHTMLAttributes[\"crossorigin\"]>,\n referrerpolicy: String as PropType<ImgHTMLAttributes[\"referrerpolicy\"]>,\n ...pressPolyTransitionPropsOptions({\n transition: \"fade\",\n }),\n objectFit: {\n type: String as PropType<\n Extract<\n CSSProperties[\"objectFit\"],\n \"contain\" | \"cover\" | \"fill\" | \"scale-down\"\n >\n >,\n default: \"contain\",\n },\n eager: Boolean,\n ...pressDimensionPropsOptions(),\n },\n \"YImg\",\n);\n\nexport type YImgStatus = \"idle\" | \"loading\" | \"loaded\" | \"error\";\n\nexport const YImg = defineComponent({\n name: \"YImg\",\n props: {\n ...pressYImgPropsOptions(),\n },\n slots: Object as SlotsType<{\n placeholder: any;\n }>,\n emits: [\"load\", \"loaded\", \"error\"],\n setup(props, { slots, attrs, emit }) {\n const vm = getCurrentInstance()!;\n const image$ = ref<HTMLImageElement>();\n const status = shallowRef<YImgStatus>(props.eager ? \"loading\" : \"idle\");\n const imgSrc = shallowRef(\"\");\n const naturalWidth = shallowRef<number>();\n const naturalHeight = shallowRef<number>();\n const { polyTransitionBindProps } = usePolyTransition(props);\n\n const srcMeta = computed(() => {\n const src = props.src;\n\n return {\n src,\n };\n });\n\n const imgClasses = computed(() => {\n return {\n \"y-img--cover\": props.objectFit === \"cover\",\n \"y-img--contain\": props.objectFit === \"contain\",\n \"y-img--fill\": props.objectFit === \"fill\",\n \"y-img--scale-down\": props.objectFit === \"scale-down\",\n };\n });\n\n function getImgSrc() {\n const imgEl = image$.value;\n if (imgEl) {\n imgSrc.value = imgEl.currentSrc || imgEl.src;\n }\n }\n\n function inspectImage(imgEl: HTMLImageElement) {\n if (imgEl.naturalWidth || imgEl.naturalHeight) {\n naturalWidth.value = imgEl.naturalWidth;\n naturalHeight.value = imgEl.naturalHeight;\n } else if (!imgEl.complete && status.value === \"loading\") {\n return false;\n } else if (\n imgEl.currentSrc.endsWith(\".svg\") ||\n imgEl.currentSrc.startsWith(\"data:image/svg+xml\")\n ) {\n naturalWidth.value = 1;\n naturalHeight.value = 1;\n }\n\n return true;\n }\n\n watch(\n () => props.src,\n () => {\n initIntersect();\n },\n );\n\n const _Placeholder = () => {\n if (!slots.placeholder) return null;\n return (\n <PolyTransition {...polyTransitionBindProps.value} appear>\n {(status.value === \"idle\" || status.value === \"error\") && (\n <div class=\"y-img__placeholder\">\n {slots.placeholder?.({ status: status.value })}\n </div>\n )}\n </PolyTransition>\n );\n };\n\n function onLoad() {\n if (vm.isUnmounted) return;\n status.value = \"loaded\";\n }\n\n function onError(event?: Event) {\n if (vm.isUnmounted) return;\n status.value = \"error\";\n emit(\"error\", event);\n }\n\n const _Image = (imageProps: { status: string }) => {\n const Img = (\n <img\n ref={image$}\n src={srcMeta.value.src}\n crossorigin={props.crossorigin}\n referrerpolicy={props.referrerpolicy}\n draggable={(attrs as ImgHTMLAttributes).draggable}\n alt={(attrs as ImgHTMLAttributes).alt}\n class={[\"y-img__img\", imgClasses.value]}\n onLoad={onLoad}\n onError={onError}\n />\n );\n\n return (\n <PolyTransition {...polyTransitionBindProps.value} appear>\n {withDirectives(Img, [[vShow, imageProps.status === \"loaded\"]])}\n </PolyTransition>\n );\n };\n\n let requestTimer = -1;\n\n /**\n *\n * @param imgEl\n * @param timeout null: once\n */\n function requestInspectImage(\n imgEl: HTMLImageElement,\n timeout: number | null = 100,\n ) {\n const _request = () => {\n clearTimeout(requestTimer);\n if (vm.isUnmounted) return;\n if (!inspectImage(imgEl) && timeout != null) {\n requestTimer = window.setTimeout(_request, timeout);\n }\n };\n\n _request();\n }\n\n function initIntersect(isIntersection?: boolean) {\n if (props.eager && isIntersection) return;\n if (\n Environments.canUseIntersectionObserver &&\n !isIntersection &&\n !props.eager\n )\n return;\n\n status.value = \"loading\";\n\n if (!srcMeta.value.src) return;\n nextTick(() => {\n emit(\"load\", image$.value?.currentSrc || srcMeta.value.src);\n setTimeout(() => {\n if (vm.isUnmounted) return;\n if (image$.value?.complete) {\n if (!image$.value?.naturalWidth) {\n onError();\n }\n if (status.value === \"error\") return;\n requestInspectImage(image$.value, null);\n if (status.value === \"loading\") onLoad();\n } else if (image$.value) {\n requestInspectImage(image$.value);\n getImgSrc();\n }\n });\n });\n }\n\n onBeforeMount(() => {\n initIntersect();\n });\n\n onBeforeUnmount(() => {\n clearTimeout(requestTimer);\n });\n\n useRender(() => {\n return (\n <div class={[\"y-img\"]}>\n <_Placeholder />\n <_Image status={status.value} />\n </div>\n );\n });\n\n return {\n status,\n image$: image$\n }\n },\n});\n"],"mappings":"AAAA,SAEEA,QAAQ,EACRC,kBAAkB,EAElBC,QAAQ,EACRC,aAAa,EACbC,eAAe,EAEfC,GAAG,EAEHC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,cAAc,EAAAC,WAAA,IAAAC,YAAA,EAAAC,UAAA,IAAAC,WAAA,QACT,KAAK;AAAC,SAEJC,SAAS;AAAA,SACTC,0BAA0B;AAAA,SAEjCC,cAAc,EACdC,+BAA+B,EAC/BC,iBAAiB;AAAA,SAEVC,eAAe,EAAEC,YAAY;AAAA,OAC/BC,YAAY;AAEnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGF,YAAY,CAC/C;EACEG,GAAG,EAAEC,MAA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,KAAK,SAAS,EAAES,MAAM,CAAC,CAAC;UAC1C,CAAC,MAAM,IAAInB,MAAM,CAACU,KAAK,EAAE;YACvBmB,mBAAmB,CAAC7B,MAAM,CAACU,KAAK,CAAC;YACjCF,SAAS,CAAC,CAAC;UACb;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEAjD,aAAa,CAAC,MAAM;MAClByD,aAAa,CAAC,CAAC;IACjB,CAAC,CAAC;IAEFxD,eAAe,CAAC,MAAM;MACpB2E,YAAY,CAACP,YAAY,CAAC;IAC5B,CAAC,CAAC;IAEF1D,SAAS,CAAC,MAAM;MACd,OAAAH,YAAA;QAAA,SACc,CAAC,OAAO;MAAC,IAAAA,YAAA,CAAAkD,YAAA,eAAAlD,YAAA,CAAAwD,MAAA;QAAA,UAEHtB,MAAM,CAACS;MAAK;IAGlC,CAAC,CAAC;IAEF,OAAO;MACLT,MAAM;MACND,MAAM,EAAEA;IACV,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"YImg.js","names":["computed","getCurrentInstance","nextTick","onBeforeMount","onBeforeUnmount","ref","shallowRef","vShow","watch","withDirectives","createVNode","_createVNode","mergeProps","_mergeProps","useRender","pressDimensionPropsOptions","PolyTransition","pressPolyTransitionPropsOptions","usePolyTransition","defineComponent","propsFactory","Environments","pressYImgPropsOptions","src","String","crossorigin","referrerpolicy","transition","objectFit","type","default","eager","Boolean","YImg","name","props","slots","Object","emits","setup","_ref","attrs","emit","vm","image$","status","imgSrc","naturalWidth","naturalHeight","polyTransitionBindProps","srcMeta","imgClasses","getImgSrc","imgEl","value","currentSrc","inspectImage","complete","endsWith","startsWith","initIntersect","_Placeholder","placeholderProps","placeholder","onLoad","isUnmounted","onError","event","_Image","imageProps","Img","draggable","alt","requestTimer","requestInspectImage","timeout","arguments","length","undefined","_request","clearTimeout","window","setTimeout","isIntersection","canUseIntersectionObserver"],"sources":["../../../src/components/img/YImg.tsx"],"sourcesContent":["import {\n type CSSProperties,\n computed,\n getCurrentInstance,\n type ImgHTMLAttributes,\n nextTick,\n onBeforeMount,\n onBeforeUnmount,\n type PropType,\n ref,\n type SlotsType,\n shallowRef,\n vShow,\n watch,\n withDirectives,\n} from \"vue\";\n\nimport { useRender } from \"@/composables/component\";\nimport { pressDimensionPropsOptions } from \"@/composables/dimension\";\nimport {\n PolyTransition,\n pressPolyTransitionPropsOptions,\n usePolyTransition,\n} from \"@/composables/transition\";\nimport { defineComponent, propsFactory } from \"@/util/component\";\nimport Environments from \"@/util/environments\";\n\nimport \"./YImg.scss\";\n\nexport const pressYImgPropsOptions = propsFactory(\n {\n src: String as PropType<string>,\n crossorigin: String as PropType<ImgHTMLAttributes[\"crossorigin\"]>,\n referrerpolicy: String as PropType<ImgHTMLAttributes[\"referrerpolicy\"]>,\n ...pressPolyTransitionPropsOptions({\n transition: \"fade\",\n }),\n objectFit: {\n type: String as PropType<\n Extract<\n CSSProperties[\"objectFit\"],\n \"contain\" | \"cover\" | \"fill\" | \"scale-down\"\n >\n >,\n default: \"contain\",\n },\n eager: Boolean,\n ...pressDimensionPropsOptions(),\n },\n \"YImg\",\n);\n\nexport type YImgStatus = \"idle\" | \"loading\" | \"loaded\" | \"error\";\n\nexport const YImg = defineComponent({\n name: \"YImg\",\n props: {\n ...pressYImgPropsOptions(),\n },\n slots: Object as SlotsType<{\n placeholder: any;\n }>,\n emits: [\"load\", \"loaded\", \"error\"],\n setup(props, { slots, attrs, emit }) {\n const vm = getCurrentInstance()!;\n const image$ = ref<HTMLImageElement>();\n const status = shallowRef<YImgStatus>(props.eager ? \"loading\" : \"idle\");\n const imgSrc = shallowRef(\"\");\n const naturalWidth = shallowRef<number>();\n const naturalHeight = shallowRef<number>();\n const { polyTransitionBindProps } = usePolyTransition(props);\n\n const srcMeta = computed(() => {\n const src = props.src;\n\n return {\n src,\n };\n });\n\n const imgClasses = computed(() => {\n return {\n \"y-img--cover\": props.objectFit === \"cover\",\n \"y-img--contain\": props.objectFit === \"contain\",\n \"y-img--fill\": props.objectFit === \"fill\",\n \"y-img--scale-down\": props.objectFit === \"scale-down\",\n };\n });\n\n function getImgSrc() {\n const imgEl = image$.value;\n if (imgEl) {\n imgSrc.value = imgEl.currentSrc || imgEl.src;\n }\n }\n\n function inspectImage(imgEl: HTMLImageElement) {\n if (imgEl.naturalWidth || imgEl.naturalHeight) {\n naturalWidth.value = imgEl.naturalWidth;\n naturalHeight.value = imgEl.naturalHeight;\n } else if (!imgEl.complete && status.value === \"loading\") {\n return false;\n } else if (\n imgEl.currentSrc.endsWith(\".svg\") ||\n imgEl.currentSrc.startsWith(\"data:image/svg+xml\")\n ) {\n naturalWidth.value = 1;\n naturalHeight.value = 1;\n }\n\n return true;\n }\n\n watch(\n () => props.src,\n () => {\n initIntersect();\n },\n );\n\n const _Placeholder = (placeholderProps: { status: string }) => {\n if (!slots.placeholder) return null;\n return (\n <PolyTransition {...polyTransitionBindProps.value} appear>\n {(placeholderProps.status === \"idle\" || placeholderProps.status === \"error\") && (\n <div class=\"y-img__placeholder\">\n {slots.placeholder?.(placeholderProps)}\n </div>\n )}\n </PolyTransition>\n );\n };\n\n function onLoad() {\n if (vm.isUnmounted) return;\n status.value = \"loaded\";\n }\n\n function onError(event?: Event) {\n if (vm.isUnmounted) return;\n status.value = \"error\";\n emit(\"error\", event);\n }\n\n const _Image = (imageProps: { status: string }) => {\n const Img = (\n <img\n ref={image$}\n src={srcMeta.value.src}\n crossorigin={props.crossorigin}\n referrerpolicy={props.referrerpolicy}\n draggable={(attrs as ImgHTMLAttributes).draggable}\n alt={(attrs as ImgHTMLAttributes).alt}\n class={[\"y-img__img\", imgClasses.value]}\n onLoad={onLoad}\n onError={onError}\n />\n );\n\n return (\n <PolyTransition {...polyTransitionBindProps.value} appear>\n {withDirectives(Img, [[vShow, imageProps.status === \"loaded\"]])}\n </PolyTransition>\n );\n };\n\n let requestTimer = -1;\n\n /**\n *\n * @param imgEl\n * @param timeout null: once\n */\n function requestInspectImage(\n imgEl: HTMLImageElement,\n timeout: number | null = 100,\n ) {\n const _request = () => {\n clearTimeout(requestTimer);\n if (vm.isUnmounted) return;\n if (!inspectImage(imgEl) && timeout != null) {\n requestTimer = window.setTimeout(_request, timeout);\n }\n };\n\n _request();\n }\n\n function initIntersect(isIntersection?: boolean) {\n if (props.eager && isIntersection) return;\n if (\n Environments.canUseIntersectionObserver &&\n !isIntersection &&\n !props.eager\n )\n return;\n\n status.value = \"loading\";\n\n if (!srcMeta.value.src) return;\n nextTick(() => {\n emit(\"load\", image$.value?.currentSrc || srcMeta.value.src);\n setTimeout(() => {\n if (vm.isUnmounted) return;\n if (image$.value?.complete) {\n if (!image$.value?.naturalWidth) {\n onError();\n }\n if (status.value === \"error\") return;\n requestInspectImage(image$.value, null);\n if (status.value === \"loading\") onLoad();\n } else if (image$.value) {\n requestInspectImage(image$.value);\n getImgSrc();\n }\n });\n });\n }\n\n onBeforeMount(() => {\n initIntersect();\n });\n\n onBeforeUnmount(() => {\n clearTimeout(requestTimer);\n });\n\n useRender(() => {\n return (\n <div class={[\"y-img\"]}>\n <_Placeholder status={status.value} />\n <_Image status={status.value} />\n </div>\n );\n });\n\n return {\n status,\n image$: image$\n }\n },\n});\n"],"mappings":"AAAA,SAEEA,QAAQ,EACRC,kBAAkB,EAElBC,QAAQ,EACRC,aAAa,EACbC,eAAe,EAEfC,GAAG,EAEHC,UAAU,EACVC,KAAK,EACLC,KAAK,EACLC,cAAc,EAAAC,WAAA,IAAAC,YAAA,EAAAC,UAAA,IAAAC,WAAA,QACT,KAAK;AAAC,SAEJC,SAAS;AAAA,SACTC,0BAA0B;AAAA,SAEjCC,cAAc,EACdC,+BAA+B,EAC/BC,iBAAiB;AAAA,SAEVC,eAAe,EAAEC,YAAY;AAAA,OAC/BC,YAAY;AAEnB;AAEA,OAAO,MAAMC,qBAAqB,GAAGF,YAAY,CAC/C;EACEG,GAAG,EAAEC,MAA0B;EAC/BC,WAAW,EAAED,MAAoD;EACjEE,cAAc,EAAEF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AACU,KAAK,EAAE;YACvBoB,mBAAmB,CAAC9B,MAAM,CAACU,KAAK,CAAC;YACjCF,SAAS,CAAC,CAAC;UACb;QACF,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEAjD,aAAa,CAAC,MAAM;MAClByD,aAAa,CAAC,CAAC;IACjB,CAAC,CAAC;IAEFxD,eAAe,CAAC,MAAM;MACpB4E,YAAY,CAACP,YAAY,CAAC;IAC5B,CAAC,CAAC;IAEF3D,SAAS,CAAC,MAAM;MACd,OAAAH,YAAA;QAAA,SACc,CAAC,OAAO;MAAC,IAAAA,YAAA,CAAAkD,YAAA;QAAA,UACGhB,MAAM,CAACS;MAAK,UAAA3C,YAAA,CAAAyD,MAAA;QAAA,UAClBvB,MAAM,CAACS;MAAK;IAGlC,CAAC,CAAC;IAEF,OAAO;MACLT,MAAM;MACND,MAAM,EAAEA;IACV,CAAC;EACH;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["CLASS_NAME","showAnimation","el","animation","document","createElement","className","appendChild","dataset","activated","String","performance","now","hideAnimation","animations","getElementsByClassName","length","isHiding","diff","Number","delay","Math","max","setTimeout","removeChild","keyboardEventFlag","spawn","event","currentTarget","clean","stop","keyboardSpawn","key","keyboardClean","destroyListeners","removeEventListener","attachWave","binding","init","arguments","undefined","value","modifiers","enabled","addEventListener","PlateWave","mounted","updated","oldValue","unmount"],"sources":["../../../src/directives/plate-wave/index.ts"],"sourcesContent":["import type { Directive, DirectiveBinding } from 'vue';\n\nimport './plate-wave.scss';\n\nexport interface PlateWaveBinding\n extends Omit<DirectiveBinding, 'modifiers' | 'value'> {\n value?: boolean;\n modifiers: { stop?: boolean };\n}\n\nconst CLASS_NAME = 'y-plate-wave__animation';\n\nfunction showAnimation(el: HTMLElement | null) {\n if (!el) return;\n const animation = document.createElement('span');\n animation.className = CLASS_NAME;\n el.appendChild(animation);\n animation.dataset.activated = String(performance.now());\n}\n\nfunction hideAnimation(el: HTMLElement | null) {\n if (!el) {\n return;\n }\n const animations = el.getElementsByClassName(CLASS_NAME);\n if (animations.length === 0) return;\n const animation = animations[animations.length - 1] as HTMLElement;\n if (animation.dataset.isHiding) return;\n animation.dataset.isHiding = 'true';\n const diff = performance.now() - Number(animation.dataset.activated);\n const delay = Math.max(250 - diff, 0);\n setTimeout(() => {\n if (animation) {\n el.removeChild(animation);\n }\n }, delay + 300);\n}\n\n/*\n * Event\n * */\n\nlet keyboardEventFlag = false;\n\nfunction spawn(event: Event) {\n showAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction clean(event: Event) {\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction stop(event: Event) {\n //\n}\n\nfunction keyboardSpawn(event: KeyboardEvent) {\n if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {\n keyboardEventFlag = true;\n showAnimation(event.currentTarget as HTMLElement);\n }\n}\n\nfunction keyboardClean(event: KeyboardEvent) {\n keyboardEventFlag = false;\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction destroyListeners(el: HTMLElement) {\n el.removeEventListener('mousedown', spawn);\n el.removeEventListener('mouseup', clean);\n el.removeEventListener('mouseleave', clean);\n el.removeEventListener('keydown', keyboardSpawn);\n el.removeEventListener('keyup', keyboardClean);\n}\n\nfunction attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {\n const { value, modifiers } = binding;\n let enabled = value ?? true;\n if (typeof value === 'boolean') {\n enabled = value;\n }\n if (!enabled) hideAnimation(el);\n\n if (enabled && init) {\n if (modifiers.stop) {\n el.addEventListener('mousedown', stop);\n return;\n }\n\n el.addEventListener('mousedown', spawn);\n el.addEventListener('mouseup', clean);\n el.addEventListener('mouseleave', clean);\n el.addEventListener('keydown', keyboardSpawn);\n el.addEventListener('keyup', keyboardClean);\n el.addEventListener('blur', clean);\n } else if (!enabled && !init) {\n destroyListeners(el);\n }\n}\n\nexport const PlateWave = {\n mounted(el: HTMLElement, binding: PlateWaveBinding) {\n attachWave(el, binding, true);\n },\n updated(el: HTMLElement, binding: PlateWaveBinding) {\n if (binding.value === binding.oldValue) {\n return;\n }\n attachWave(el, binding);\n },\n unmount(el: HTMLElement) {\n destroyListeners(el);\n },\n};\n\nexport type PlateWaveDirective = Directive<HTMLElement,
|
|
1
|
+
{"version":3,"file":"index.js","names":["CLASS_NAME","showAnimation","el","animation","document","createElement","className","appendChild","dataset","activated","String","performance","now","hideAnimation","animations","getElementsByClassName","length","isHiding","diff","Number","delay","Math","max","setTimeout","removeChild","keyboardEventFlag","spawn","event","currentTarget","clean","stop","keyboardSpawn","key","keyboardClean","destroyListeners","removeEventListener","attachWave","binding","init","arguments","undefined","value","modifiers","enabled","addEventListener","PlateWave","mounted","updated","oldValue","unmount"],"sources":["../../../src/directives/plate-wave/index.ts"],"sourcesContent":["import type { Directive, DirectiveBinding } from 'vue';\n\nimport './plate-wave.scss';\n\nexport interface PlateWaveBinding\n extends Omit<DirectiveBinding, 'modifiers' | 'value'> {\n value?: boolean;\n modifiers: { stop?: boolean };\n}\n\nconst CLASS_NAME = 'y-plate-wave__animation';\n\nfunction showAnimation(el: HTMLElement | null) {\n if (!el) return;\n const animation = document.createElement('span');\n animation.className = CLASS_NAME;\n el.appendChild(animation);\n animation.dataset.activated = String(performance.now());\n}\n\nfunction hideAnimation(el: HTMLElement | null) {\n if (!el) {\n return;\n }\n const animations = el.getElementsByClassName(CLASS_NAME);\n if (animations.length === 0) return;\n const animation = animations[animations.length - 1] as HTMLElement;\n if (animation.dataset.isHiding) return;\n animation.dataset.isHiding = 'true';\n const diff = performance.now() - Number(animation.dataset.activated);\n const delay = Math.max(250 - diff, 0);\n setTimeout(() => {\n if (animation) {\n el.removeChild(animation);\n }\n }, delay + 300);\n}\n\n/*\n * Event\n * */\n\nlet keyboardEventFlag = false;\n\nfunction spawn(event: Event) {\n showAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction clean(event: Event) {\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction stop(event: Event) {\n //\n}\n\nfunction keyboardSpawn(event: KeyboardEvent) {\n if (!keyboardEventFlag && (event.key === 'Enter' || event.key === 'Space')) {\n keyboardEventFlag = true;\n showAnimation(event.currentTarget as HTMLElement);\n }\n}\n\nfunction keyboardClean(event: KeyboardEvent) {\n keyboardEventFlag = false;\n hideAnimation(event.currentTarget as HTMLElement);\n}\n\nfunction destroyListeners(el: HTMLElement) {\n el.removeEventListener('mousedown', spawn);\n el.removeEventListener('mouseup', clean);\n el.removeEventListener('mouseleave', clean);\n el.removeEventListener('keydown', keyboardSpawn);\n el.removeEventListener('keyup', keyboardClean);\n}\n\nfunction attachWave(el: HTMLElement, binding: PlateWaveBinding, init = false) {\n const { value, modifiers } = binding;\n let enabled = value ?? true;\n if (typeof value === 'boolean') {\n enabled = value;\n }\n if (!enabled) hideAnimation(el);\n\n if (enabled && init) {\n if (modifiers.stop) {\n el.addEventListener('mousedown', stop);\n return;\n }\n\n el.addEventListener('mousedown', spawn);\n el.addEventListener('mouseup', clean);\n el.addEventListener('mouseleave', clean);\n el.addEventListener('keydown', keyboardSpawn);\n el.addEventListener('keyup', keyboardClean);\n el.addEventListener('blur', clean);\n } else if (!enabled && !init) {\n destroyListeners(el);\n }\n}\n\nexport const PlateWave = {\n mounted(el: HTMLElement, binding: PlateWaveBinding) {\n attachWave(el, binding, true);\n },\n updated(el: HTMLElement, binding: PlateWaveBinding) {\n if (binding.value === binding.oldValue) {\n return;\n }\n attachWave(el, binding);\n },\n unmount(el: HTMLElement) {\n destroyListeners(el);\n },\n};\n\nexport type PlateWaveDirective = Directive<HTMLElement, boolean>;\n\ndeclare module 'vue' {\n export interface ComponentCustomProperties {\n vPlateWave: PlateWaveDirective;\n }\n}\n\nexport default PlateWave;\n"],"mappings":"AAEA;AAQA,MAAMA,UAAU,GAAG,yBAAyB;AAE5C,SAASC,aAAaA,CAACC,EAAsB,EAAE;EAC7C,IAAI,CAACA,EAAE,EAAE;EACT,MAAMC,S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C,WAAW,EAAEd,IAAI,CAAC;MACtC;IACF;IAEA5B,EAAE,CAAC0C,gBAAgB,CAAC,WAAW,EAAElB,KAAK,CAAC;IACvCxB,EAAE,CAAC0C,gBAAgB,CAAC,SAAS,EAAEf,KAAK,CAAC;IACrC3B,EAAE,CAAC0C,gBAAgB,CAAC,YAAY,EAAEf,KAAK,CAAC;IACxC3B,EAAE,CAAC0C,gBAAgB,CAAC,SAAS,EAAEb,aAAa,CAAC;IAC7C7B,EAAE,CAAC0C,gBAAgB,CAAC,OAAO,EAAEX,aAAa,CAAC;IAC3C/B,EAAE,CAAC0C,gBAAgB,CAAC,MAAM,EAAEf,KAAK,CAAC;EACpC,CAAC,MAAM,IAAI,CAACc,OAAO,IAAI,CAACL,IAAI,EAAE;IAC5BJ,gBAAgB,CAAChC,EAAE,CAAC;EACtB;AACF;AAEA,OAAO,MAAM2C,SAAS,GAAG;EACvBC,OAAOA,CAAC5C,EAAe,EAAEmC,OAAyB,EAAE;IAClDD,UAAU,CAAClC,EAAE,EAAEmC,OAAO,EAAE,IAAI,CAAC;EAC/B,CAAC;EACDU,OAAOA,CAAC7C,EAAe,EAAEmC,OAAyB,EAAE;IAClD,IAAIA,OAAO,CAACI,KAAK,KAAKJ,OAAO,CAACW,QAAQ,EAAE;MACtC;IACF;IACAZ,UAAU,CAAClC,EAAE,EAAEmC,OAAO,CAAC;EACzB,CAAC;EACDY,OAAOA,CAAC/C,EAAe,EAAE;IACvBgC,gBAAgB,CAAChC,EAAE,CAAC;EACtB;AACF,CAAC;AAUD,eAAe2C,SAAS","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -577,8 +577,8 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
577
577
|
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
578
578
|
getActiveLayers: () => import('vue').ComponentInternalInstance[];
|
|
579
579
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
"update:modelValue": (value: boolean) => true;
|
|
581
|
+
"click:complement": (mouseEvent: MouseEvent) => true;
|
|
582
582
|
afterLeave: () => true;
|
|
583
583
|
}, string> | undefined, import('vue').DefineComponent<{
|
|
584
584
|
minWidth: PropType<number | string>;
|
|
@@ -703,8 +703,8 @@ export declare const YDialog: import('vue').DefineComponent<{
|
|
|
703
703
|
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
704
704
|
getActiveLayers: () => import('vue').ComponentInternalInstance[];
|
|
705
705
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
706
|
-
|
|
707
|
-
|
|
706
|
+
"update:modelValue": (value: boolean) => true;
|
|
707
|
+
"click:complement": (mouseEvent: MouseEvent) => true;
|
|
708
708
|
afterLeave: () => true;
|
|
709
709
|
}, string> | undefined>;
|
|
710
710
|
classes: import('vue').ComputedRef<{
|
|
@@ -130,4 +130,7 @@ export declare const YImg: import('vue').DefineComponent<{
|
|
|
130
130
|
src: PropType<string>;
|
|
131
131
|
crossorigin: PropType<ImgHTMLAttributes["crossorigin"]>;
|
|
132
132
|
referrerpolicy: PropType<ImgHTMLAttributes["referrerpolicy"]>;
|
|
133
|
-
},
|
|
133
|
+
}, {
|
|
134
|
+
status: import('vue').ShallowRef<YImgStatus, YImgStatus>;
|
|
135
|
+
image$: import('vue').Ref<HTMLImageElement | undefined, HTMLImageElement | undefined>;
|
|
136
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("error" | "load" | "loaded")[], "error" | "load" | "loaded">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './YImg';
|
|
@@ -429,8 +429,8 @@ export declare const YLayer: import('vue').DefineComponent<{
|
|
|
429
429
|
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
430
430
|
getActiveLayers: () => ComponentInternalInstance[];
|
|
431
431
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
432
|
-
|
|
433
|
-
|
|
432
|
+
"update:modelValue": (value: boolean) => true;
|
|
433
|
+
"click:complement": (mouseEvent: MouseEvent) => true;
|
|
434
434
|
afterLeave: () => true;
|
|
435
435
|
}, string>;
|
|
436
436
|
export type YLayer = InstanceType<typeof YLayer>;
|
|
@@ -373,8 +373,8 @@ export declare const YMenu: import('vue').DefineComponent<{
|
|
|
373
373
|
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
374
374
|
getActiveLayers: () => import('vue').ComponentInternalInstance[];
|
|
375
375
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
376
|
-
|
|
377
|
-
|
|
376
|
+
"update:modelValue": (value: boolean) => true;
|
|
377
|
+
"click:complement": (mouseEvent: MouseEvent) => true;
|
|
378
378
|
afterLeave: () => true;
|
|
379
379
|
}, string> | undefined, import('vue').DefineComponent<{
|
|
380
380
|
minWidth: PropType<number | string>;
|
|
@@ -499,8 +499,8 @@ export declare const YMenu: import('vue').DefineComponent<{
|
|
|
499
499
|
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
500
500
|
getActiveLayers: () => import('vue').ComponentInternalInstance[];
|
|
501
501
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
502
|
-
|
|
503
|
-
|
|
502
|
+
"update:modelValue": (value: boolean) => true;
|
|
503
|
+
"click:complement": (mouseEvent: MouseEvent) => true;
|
|
504
504
|
afterLeave: () => true;
|
|
505
505
|
}, string> | undefined>;
|
|
506
506
|
baseEl: import('vue').ComputedRef<any>;
|
|
@@ -11,7 +11,7 @@ export declare const PlateWave: {
|
|
|
11
11
|
updated(el: HTMLElement, binding: PlateWaveBinding): void;
|
|
12
12
|
unmount(el: HTMLElement): void;
|
|
13
13
|
};
|
|
14
|
-
export type PlateWaveDirective = Directive<HTMLElement,
|
|
14
|
+
export type PlateWaveDirective = Directive<HTMLElement, boolean>;
|
|
15
15
|
declare module 'vue' {
|
|
16
16
|
interface ComponentCustomProperties {
|
|
17
17
|
vPlateWave: PlateWaveDirective;
|
package/types/shims.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { YAlert, YApp, YBadge, YButton, YCard, YCardBody, YCardFooter, YCardHeader, YCheckbox, YChip, YDataTable,
|
|
1
|
+
import { YAlert, YApp, YBadge, YButton, YCard, YCardBody, YCardFooter, YCardHeader, YCheckbox, YChip, YDataTable, YDataTableServer, YDateCalendar, YDatePicker, YDividePanel, YDivider, YExpandHTransition, YExpandVTransition, YFieldInput, YForm, YHover, YIcon, YImg, YInput, YIpv4Field, YLayer, YList, YListItem, YMenu, YMonthPicker, YPagination, YProgressBar, YProgressRing, YSelect, YSnackbar, YSpinnerRing, YSwitch, YTab, YTable, YTabs, YTextarea, YTextEllipsis, YTextHighlighter, YTi, YTooltip, YTreeView } from 'yuyeon/components';
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
declare module
|
|
4
|
+
declare module "vue" {
|
|
5
5
|
export interface GlobalComponents {
|
|
6
6
|
// @define-components
|
|
7
7
|
YApp: YApp;
|
|
@@ -55,10 +55,11 @@ declare module 'vue' {
|
|
|
55
55
|
YTextHighlighter: YTextHighlighter;
|
|
56
56
|
YProgressRing: YProgressRing;
|
|
57
57
|
YTextEllipsis: YTextEllipsis;
|
|
58
|
+
YImg: YImg;
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
export interface GlobalDirectives {
|
|
61
|
-
vPlateWave: typeof import(
|
|
62
|
-
vComplementClick: typeof import(
|
|
62
|
+
vPlateWave: (typeof import("yuyeon/directives"))["PlateWave"];
|
|
63
|
+
vComplementClick: (typeof import("yuyeon/directives"))["ComplementClick"];
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { DeepReadonly, InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
-
import { DataTableHeader, InternalDataTableHeader } from '../types';
|
|
3
|
-
|
|
4
|
-
export declare const pressDataTableHeader: <Defaults extends {
|
|
5
|
-
headers?: unknown;
|
|
6
|
-
} = {}>(defaults?: Defaults | undefined) => {
|
|
7
|
-
headers: unknown extends Defaults["headers"] ? {
|
|
8
|
-
type: PropType<readonly {
|
|
9
|
-
readonly key: string;
|
|
10
|
-
readonly text: string;
|
|
11
|
-
readonly value?: any;
|
|
12
|
-
readonly colspan?: number | undefined;
|
|
13
|
-
readonly rowspan?: number | undefined;
|
|
14
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
15
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
16
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
17
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
18
|
-
readonly width?: string | number | undefined;
|
|
19
|
-
readonly minWidth?: string | undefined;
|
|
20
|
-
readonly maxWidth?: string | undefined;
|
|
21
|
-
readonly sortable?: boolean | undefined;
|
|
22
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
23
|
-
readonly mustSort?: boolean | undefined;
|
|
24
|
-
}[]>;
|
|
25
|
-
default: () => never[];
|
|
26
|
-
} : Omit<{
|
|
27
|
-
type: PropType<readonly {
|
|
28
|
-
readonly key: string;
|
|
29
|
-
readonly text: string;
|
|
30
|
-
readonly value?: any;
|
|
31
|
-
readonly colspan?: number | undefined;
|
|
32
|
-
readonly rowspan?: number | undefined;
|
|
33
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
34
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
35
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
36
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
37
|
-
readonly width?: string | number | undefined;
|
|
38
|
-
readonly minWidth?: string | undefined;
|
|
39
|
-
readonly maxWidth?: string | undefined;
|
|
40
|
-
readonly sortable?: boolean | undefined;
|
|
41
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
42
|
-
readonly mustSort?: boolean | undefined;
|
|
43
|
-
}[]>;
|
|
44
|
-
default: () => never[];
|
|
45
|
-
}, "type" | "default"> & {
|
|
46
|
-
type: PropType<unknown extends Defaults["headers"] ? readonly {
|
|
47
|
-
readonly key: string;
|
|
48
|
-
readonly text: string;
|
|
49
|
-
readonly value?: any;
|
|
50
|
-
readonly colspan?: number | undefined;
|
|
51
|
-
readonly rowspan?: number | undefined;
|
|
52
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
53
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
54
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
55
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
56
|
-
readonly width?: string | number | undefined;
|
|
57
|
-
readonly minWidth?: string | undefined;
|
|
58
|
-
readonly maxWidth?: string | undefined;
|
|
59
|
-
readonly sortable?: boolean | undefined;
|
|
60
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
61
|
-
readonly mustSort?: boolean | undefined;
|
|
62
|
-
}[] : readonly {
|
|
63
|
-
readonly key: string;
|
|
64
|
-
readonly text: string;
|
|
65
|
-
readonly value?: any;
|
|
66
|
-
readonly colspan?: number | undefined;
|
|
67
|
-
readonly rowspan?: number | undefined;
|
|
68
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
69
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
70
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
71
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
72
|
-
readonly width?: string | number | undefined;
|
|
73
|
-
readonly minWidth?: string | undefined;
|
|
74
|
-
readonly maxWidth?: string | undefined;
|
|
75
|
-
readonly sortable?: boolean | undefined;
|
|
76
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
77
|
-
readonly mustSort?: boolean | undefined;
|
|
78
|
-
}[] | Defaults["headers"]>;
|
|
79
|
-
default: unknown extends Defaults["headers"] ? readonly {
|
|
80
|
-
readonly key: string;
|
|
81
|
-
readonly text: string;
|
|
82
|
-
readonly value?: any;
|
|
83
|
-
readonly colspan?: number | undefined;
|
|
84
|
-
readonly rowspan?: number | undefined;
|
|
85
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
86
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
87
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
88
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
89
|
-
readonly width?: string | number | undefined;
|
|
90
|
-
readonly minWidth?: string | undefined;
|
|
91
|
-
readonly maxWidth?: string | undefined;
|
|
92
|
-
readonly sortable?: boolean | undefined;
|
|
93
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
94
|
-
readonly mustSort?: boolean | undefined;
|
|
95
|
-
}[] : readonly {
|
|
96
|
-
readonly key: string;
|
|
97
|
-
readonly text: string;
|
|
98
|
-
readonly value?: any;
|
|
99
|
-
readonly colspan?: number | undefined;
|
|
100
|
-
readonly rowspan?: number | undefined;
|
|
101
|
-
readonly fixed?: boolean | "left" | "right" | undefined;
|
|
102
|
-
readonly classes?: string | readonly string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
103
|
-
readonly headerClasses?: string | readonly string[] | undefined;
|
|
104
|
-
readonly align?: "start" | "end" | "center" | undefined;
|
|
105
|
-
readonly width?: string | number | undefined;
|
|
106
|
-
readonly minWidth?: string | undefined;
|
|
107
|
-
readonly maxWidth?: string | undefined;
|
|
108
|
-
readonly sortable?: boolean | undefined;
|
|
109
|
-
readonly sort?: import('../types').DataTableCompareFn | undefined;
|
|
110
|
-
readonly mustSort?: boolean | undefined;
|
|
111
|
-
}[] | Defaults["headers"];
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
export declare const Y_DATA_TABLE_HEADER_KEY: InjectionKey<{
|
|
115
|
-
headers: Ref<InternalDataTableHeader[][]>;
|
|
116
|
-
columns: Ref<InternalDataTableHeader[]>;
|
|
117
|
-
}>;
|
|
118
|
-
type HeaderProps = {
|
|
119
|
-
headers: DeepReadonly<DataTableHeader[]> | undefined;
|
|
120
|
-
};
|
|
121
|
-
export declare function createHeader(props: HeaderProps, options?: {
|
|
122
|
-
enableSelect?: Ref<boolean>;
|
|
123
|
-
}): {
|
|
124
|
-
headers: Ref<{
|
|
125
|
-
key: string;
|
|
126
|
-
text: string;
|
|
127
|
-
value?: any;
|
|
128
|
-
colspan?: number | undefined;
|
|
129
|
-
rowspan?: number | undefined;
|
|
130
|
-
fixed?: boolean | "left" | "right" | undefined;
|
|
131
|
-
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
132
|
-
headerClasses?: string | string[] | undefined;
|
|
133
|
-
align?: "start" | "end" | "center" | undefined;
|
|
134
|
-
width?: string | number | undefined;
|
|
135
|
-
minWidth?: string | undefined;
|
|
136
|
-
maxWidth?: string | undefined;
|
|
137
|
-
sortable: boolean;
|
|
138
|
-
sort?: import('../types').DataTableCompareFn | undefined;
|
|
139
|
-
mustSort?: boolean | undefined;
|
|
140
|
-
fixedOffset?: number | undefined;
|
|
141
|
-
lastFixed?: boolean | undefined;
|
|
142
|
-
rightOffset?: number | undefined;
|
|
143
|
-
}[][], InternalDataTableHeader[][] | {
|
|
144
|
-
key: string;
|
|
145
|
-
text: string;
|
|
146
|
-
value?: any;
|
|
147
|
-
colspan?: number | undefined;
|
|
148
|
-
rowspan?: number | undefined;
|
|
149
|
-
fixed?: boolean | "left" | "right" | undefined;
|
|
150
|
-
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
151
|
-
headerClasses?: string | string[] | undefined;
|
|
152
|
-
align?: "start" | "end" | "center" | undefined;
|
|
153
|
-
width?: string | number | undefined;
|
|
154
|
-
minWidth?: string | undefined;
|
|
155
|
-
maxWidth?: string | undefined;
|
|
156
|
-
sortable: boolean;
|
|
157
|
-
sort?: import('../types').DataTableCompareFn | undefined;
|
|
158
|
-
mustSort?: boolean | undefined;
|
|
159
|
-
fixedOffset?: number | undefined;
|
|
160
|
-
lastFixed?: boolean | undefined;
|
|
161
|
-
rightOffset?: number | undefined;
|
|
162
|
-
}[][]>;
|
|
163
|
-
columns: Ref<{
|
|
164
|
-
key: string;
|
|
165
|
-
text: string;
|
|
166
|
-
value?: any;
|
|
167
|
-
colspan?: number | undefined;
|
|
168
|
-
rowspan?: number | undefined;
|
|
169
|
-
fixed?: boolean | "left" | "right" | undefined;
|
|
170
|
-
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
171
|
-
headerClasses?: string | string[] | undefined;
|
|
172
|
-
align?: "start" | "end" | "center" | undefined;
|
|
173
|
-
width?: string | number | undefined;
|
|
174
|
-
minWidth?: string | undefined;
|
|
175
|
-
maxWidth?: string | undefined;
|
|
176
|
-
sortable: boolean;
|
|
177
|
-
sort?: import('../types').DataTableCompareFn | undefined;
|
|
178
|
-
mustSort?: boolean | undefined;
|
|
179
|
-
fixedOffset?: number | undefined;
|
|
180
|
-
lastFixed?: boolean | undefined;
|
|
181
|
-
rightOffset?: number | undefined;
|
|
182
|
-
}[], InternalDataTableHeader[] | {
|
|
183
|
-
key: string;
|
|
184
|
-
text: string;
|
|
185
|
-
value?: any;
|
|
186
|
-
colspan?: number | undefined;
|
|
187
|
-
rowspan?: number | undefined;
|
|
188
|
-
fixed?: boolean | "left" | "right" | undefined;
|
|
189
|
-
classes?: string | string[] | import('../types/common').DataTableCellClassesFn | undefined;
|
|
190
|
-
headerClasses?: string | string[] | undefined;
|
|
191
|
-
align?: "start" | "end" | "center" | undefined;
|
|
192
|
-
width?: string | number | undefined;
|
|
193
|
-
minWidth?: string | undefined;
|
|
194
|
-
maxWidth?: string | undefined;
|
|
195
|
-
sortable: boolean;
|
|
196
|
-
sort?: import('../types').DataTableCompareFn | undefined;
|
|
197
|
-
mustSort?: boolean | undefined;
|
|
198
|
-
fixedOffset?: number | undefined;
|
|
199
|
-
lastFixed?: boolean | undefined;
|
|
200
|
-
rightOffset?: number | undefined;
|
|
201
|
-
}[]>;
|
|
202
|
-
};
|
|
203
|
-
export declare function useHeader(): {
|
|
204
|
-
headers: Ref<InternalDataTableHeader[][], InternalDataTableHeader[][]>;
|
|
205
|
-
columns: Ref<InternalDataTableHeader[], InternalDataTableHeader[]>;
|
|
206
|
-
};
|
|
207
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { PropType, Ref } from 'vue';
|
|
2
|
-
import { DataTableItem, InternalDataTableHeader } from '../types';
|
|
3
|
-
|
|
4
|
-
export type DataTableItemsProps = {
|
|
5
|
-
items: any[];
|
|
6
|
-
itemKey: any;
|
|
7
|
-
itemSelectable: any;
|
|
8
|
-
returnItem: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare const pressDataTableItemsProps: <Defaults extends {
|
|
11
|
-
items?: unknown;
|
|
12
|
-
itemKey?: unknown;
|
|
13
|
-
itemSelectable?: unknown;
|
|
14
|
-
returnItem?: unknown;
|
|
15
|
-
} = {}>(defaults?: Defaults | undefined) => {
|
|
16
|
-
items: unknown extends Defaults["items"] ? {
|
|
17
|
-
type: PropType<any[]>;
|
|
18
|
-
default: () => never[];
|
|
19
|
-
} : Omit<{
|
|
20
|
-
type: PropType<any[]>;
|
|
21
|
-
default: () => never[];
|
|
22
|
-
}, "type" | "default"> & {
|
|
23
|
-
type: PropType<unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"]>;
|
|
24
|
-
default: unknown extends Defaults["items"] ? any[] : any[] | Defaults["items"];
|
|
25
|
-
};
|
|
26
|
-
itemKey: unknown extends Defaults["itemKey"] ? {
|
|
27
|
-
type: PropType<any>;
|
|
28
|
-
default: string;
|
|
29
|
-
} : Omit<{
|
|
30
|
-
type: PropType<any>;
|
|
31
|
-
default: string;
|
|
32
|
-
}, "type" | "default"> & {
|
|
33
|
-
type: PropType<unknown extends Defaults["itemKey"] ? any : any>;
|
|
34
|
-
default: unknown extends Defaults["itemKey"] ? any : any;
|
|
35
|
-
};
|
|
36
|
-
itemSelectable: unknown extends Defaults["itemSelectable"] ? {
|
|
37
|
-
type: PropType<any>;
|
|
38
|
-
default: null;
|
|
39
|
-
} : Omit<{
|
|
40
|
-
type: PropType<any>;
|
|
41
|
-
default: null;
|
|
42
|
-
}, "type" | "default"> & {
|
|
43
|
-
type: PropType<unknown extends Defaults["itemSelectable"] ? any : any>;
|
|
44
|
-
default: unknown extends Defaults["itemSelectable"] ? any : any;
|
|
45
|
-
};
|
|
46
|
-
returnItem: unknown extends Defaults["returnItem"] ? BooleanConstructor : {
|
|
47
|
-
type: PropType<unknown extends Defaults["returnItem"] ? boolean : boolean | Defaults["returnItem"]>;
|
|
48
|
-
default: unknown extends Defaults["returnItem"] ? boolean : boolean | Defaults["returnItem"];
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
export declare function updateItem(props: Omit<DataTableItemsProps, 'items'>, item: any, index: number, columns: InternalDataTableHeader[]): DataTableItem;
|
|
52
|
-
export declare function updateItems(props: Omit<DataTableItemsProps, 'items'>, items: DataTableItemsProps['items'], columns: InternalDataTableHeader[]): DataTableItem[];
|
|
53
|
-
export declare function useItems(props: DataTableItemsProps, columns: Ref<InternalDataTableHeader[]>): {
|
|
54
|
-
items: import('vue').ComputedRef<DataTableItem<any>[]>;
|
|
55
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare function useRectMeasure(): {
|
|
2
|
-
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
3
|
-
wrapperRef: import('vue').Ref<any, any>;
|
|
4
|
-
tableRef: import('vue').Ref<any, any>;
|
|
5
|
-
containerRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
6
|
-
wrapperRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
7
|
-
tableRect: import('vue').ShallowRef<DOMRectReadOnly | undefined, DOMRectReadOnly | undefined>;
|
|
8
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
2
|
-
import { SortOption } from '../types';
|
|
3
|
-
|
|
4
|
-
type DataTableOptionsState = {
|
|
5
|
-
page: Ref<number>;
|
|
6
|
-
pageSize: Ref<number>;
|
|
7
|
-
sortBy: Ref<readonly SortOption[]>;
|
|
8
|
-
search: Ref<string | undefined>;
|
|
9
|
-
};
|
|
10
|
-
export declare function useOptions({ page, pageSize, sortBy, search }: DataTableOptionsState, emit: Function): void;
|
|
11
|
-
export {};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { InjectionKey, PropType, Ref } from 'vue';
|
|
2
|
-
import { DataTableProvidePaginationData } from '../types';
|
|
3
|
-
|
|
4
|
-
export declare const Y_DATA_TABLE_PAGINATION_KEY: InjectionKey<{
|
|
5
|
-
page: Ref<number>;
|
|
6
|
-
pageSize: Ref<number>;
|
|
7
|
-
startIndex: Ref<number>;
|
|
8
|
-
endIndex: Ref<number>;
|
|
9
|
-
pageLength: Ref<number>;
|
|
10
|
-
total: Ref<number>;
|
|
11
|
-
prevPage: () => void;
|
|
12
|
-
nextPage: () => void;
|
|
13
|
-
setPage: (page: number) => void;
|
|
14
|
-
setPageSize: (size: number) => void;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const pressDataTablePaginationProps: <Defaults extends {
|
|
17
|
-
page?: unknown;
|
|
18
|
-
pageSize?: unknown;
|
|
19
|
-
} = {}>(defaults?: Defaults | undefined) => {
|
|
20
|
-
page: unknown extends Defaults["page"] ? {
|
|
21
|
-
type: PropType<string | number>;
|
|
22
|
-
default: number;
|
|
23
|
-
} : Omit<{
|
|
24
|
-
type: PropType<string | number>;
|
|
25
|
-
default: number;
|
|
26
|
-
}, "type" | "default"> & {
|
|
27
|
-
type: PropType<unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"]>;
|
|
28
|
-
default: unknown extends Defaults["page"] ? string | number : NonNullable<string | number> | Defaults["page"];
|
|
29
|
-
};
|
|
30
|
-
pageSize: unknown extends Defaults["pageSize"] ? {
|
|
31
|
-
type: PropType<string | number>;
|
|
32
|
-
default: number;
|
|
33
|
-
} : Omit<{
|
|
34
|
-
type: PropType<string | number>;
|
|
35
|
-
default: number;
|
|
36
|
-
}, "type" | "default"> & {
|
|
37
|
-
type: PropType<unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"]>;
|
|
38
|
-
default: unknown extends Defaults["pageSize"] ? string | number : NonNullable<string | number> | Defaults["pageSize"];
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type PaginationProps = {
|
|
42
|
-
page: number | string;
|
|
43
|
-
'onUpdate:page': ((v: any) => void) | undefined;
|
|
44
|
-
pageSize: number | string;
|
|
45
|
-
'onUpdate:pageSize': ((v: any) => void) | undefined;
|
|
46
|
-
total?: number | string;
|
|
47
|
-
};
|
|
48
|
-
export declare function createPagination(props: PaginationProps): {
|
|
49
|
-
page: Ref<any, any> & {
|
|
50
|
-
readonly rxValue: any;
|
|
51
|
-
};
|
|
52
|
-
pageSize: Ref<any, any> & {
|
|
53
|
-
readonly rxValue: any;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export declare function providePagination(options: {
|
|
57
|
-
page: Ref<number>;
|
|
58
|
-
pageSize: Ref<number>;
|
|
59
|
-
total: Ref<number>;
|
|
60
|
-
}): DataTableProvidePaginationData;
|
|
61
|
-
export declare function usePagination(): {
|
|
62
|
-
page: Ref<number, number>;
|
|
63
|
-
pageSize: Ref<number, number>;
|
|
64
|
-
startIndex: Ref<number, number>;
|
|
65
|
-
endIndex: Ref<number, number>;
|
|
66
|
-
pageLength: Ref<number, number>;
|
|
67
|
-
total: Ref<number, number>;
|
|
68
|
-
prevPage: () => void;
|
|
69
|
-
nextPage: () => void;
|
|
70
|
-
setPage: (page: number) => void;
|
|
71
|
-
setPageSize: (size: number) => void;
|
|
72
|
-
};
|
|
73
|
-
export declare function usePaginatedItems<T>(options: {
|
|
74
|
-
items: Ref<readonly T[]>;
|
|
75
|
-
startIndex: Ref<number>;
|
|
76
|
-
endIndex: Ref<number>;
|
|
77
|
-
pageSize: Ref<number>;
|
|
78
|
-
}): {
|
|
79
|
-
paginatedItems: import('vue').ComputedRef<readonly T[]>;
|
|
80
|
-
};
|
|
81
|
-
export {};
|