bitboss-ui 0.2.31 → 0.2.32
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/components/BaseButton/BaseButton.vue.d.ts +6 -6
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +16 -16
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +36 -36
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +20 -20
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +21 -21
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +8 -8
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +6 -6
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +20 -20
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +20 -20
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +36 -36
- package/dist/components/BaseRating/BaseRating.vue.d.ts +17 -17
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +23 -23
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +15 -15
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +1 -1
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +20 -20
- package/dist/components/BaseTag/BaseTag.vue.d.ts +20 -20
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +19 -19
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +18 -18
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -3
- package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -3
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +8 -8
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +6 -6
- package/dist/components/BbButton/BbButton.vue.d.ts +1 -1
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +11 -11
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +27 -27
- package/dist/components/BbChip/BbChip.vue.d.ts +2 -2
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +4 -4
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -24
- package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -2
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +11 -11
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +14 -14
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +4 -4
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +3 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +10 -10
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +9 -9
- package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
- package/dist/components/BbPopover/BbPopover.vue.d.ts +8 -8
- package/dist/components/BbRadio/BbRadio.vue.d.ts +10 -10
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +27 -27
- package/dist/components/BbRating/BbRating.vue.d.ts +10 -10
- package/dist/components/BbSelect/BbSelect.vue.d.ts +19 -19
- package/dist/components/BbSlider/BbSlider.vue.d.ts +8 -8
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +2 -2
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +20 -20
- package/dist/components/BbTab/BbTab.vue.d.ts +5 -5
- package/dist/components/BbTable/BbTable.vue.d.ts +11 -11
- package/dist/components/BbTable/types.d.ts +107 -107
- package/dist/components/BbTag/BbTag.vue.d.ts +13 -13
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +11 -11
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -10
- package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +3 -3
- package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
- package/dist/composables/useConfirm.d.ts +10 -10
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useRoute.d.ts +2 -2
- package/dist/composables/useRouter.d.ts +1 -1
- package/dist/composables/useToast.d.ts +5 -5
- package/dist/composables/useWizard.d.ts +1 -1
- package/dist/index.d.ts +126 -126
- package/dist/index101.js +32 -37
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +19 -19
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +16 -16
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +15 -15
- package/dist/index107.js.map +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +7 -7
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +16 -16
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +3 -3
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +6 -6
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -4
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +5 -5
- package/dist/index119.js.map +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -4
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +4 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +11 -11
- package/dist/index13.js.map +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +226 -224
- package/dist/index15.js.map +1 -1
- package/dist/index17.js +61 -62
- package/dist/index17.js.map +1 -1
- package/dist/index19.js +22 -22
- package/dist/index19.js.map +1 -1
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +2 -5
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +4 -16
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +293 -14
- package/dist/index199.js.map +1 -1
- package/dist/index2.js +23 -23
- package/dist/index2.js.map +1 -1
- package/dist/index200.js +15 -18
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +13 -17
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +18 -28
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +20 -8
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +29 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +8 -378
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -134
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +235 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +3 -174
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +35 -23
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +4 -4
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +6 -373
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +10 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +378 -4
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +134 -3
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -3
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +172 -8
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +23 -3
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -31
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +3 -6
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +3 -2
- package/dist/index219.js.map +1 -1
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +26 -233
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +16 -8
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +2 -121
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +8 -27
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +120 -12
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +1 -1
- package/dist/index227.js +4 -295
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -6
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +6 -2
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +14 -16
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +2 -2
- package/dist/index235.js +2 -2
- package/dist/index236.js +428 -110
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +88 -105
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +199 -3
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +1 -1
- package/dist/index240.js +1 -1
- package/dist/index241.js +2 -435
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +115 -87
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +104 -198
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +160 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -9
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +5 -162
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +1 -1
- package/dist/index249.js +37 -14
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +4 -4
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +2 -38
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +15 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +3 -2
- package/dist/index253.js.map +1 -1
- package/dist/index255.js +2 -3
- package/dist/index255.js.map +1 -1
- package/dist/index27.js +7 -7
- package/dist/index27.js.map +1 -1
- package/dist/index29.js +15 -15
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -1
- package/dist/index3.js.map +1 -1
- package/dist/index31.js +28 -28
- package/dist/index31.js.map +1 -1
- package/dist/index33.js +10 -11
- package/dist/index33.js.map +1 -1
- package/dist/index35.js +2 -2
- package/dist/index35.js.map +1 -1
- package/dist/index37.js +12 -12
- package/dist/index37.js.map +1 -1
- package/dist/index39.js +5 -7
- package/dist/index39.js.map +1 -1
- package/dist/index4.js.map +1 -1
- package/dist/index41.js +5 -5
- package/dist/index41.js.map +1 -1
- package/dist/index43.js +19 -16
- package/dist/index43.js.map +1 -1
- package/dist/index45.js +9 -9
- package/dist/index45.js.map +1 -1
- package/dist/index47.js +4 -4
- package/dist/index47.js.map +1 -1
- package/dist/index49.js +1 -1
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +7 -6
- package/dist/index5.js.map +1 -1
- package/dist/index51.js +6 -6
- package/dist/index51.js.map +1 -1
- package/dist/index53.js.map +1 -1
- package/dist/index55.js +20 -20
- package/dist/index55.js.map +1 -1
- package/dist/index57.js +35 -35
- package/dist/index57.js.map +1 -1
- package/dist/index59.js +8 -8
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +38 -38
- package/dist/index6.js.map +1 -1
- package/dist/index61.js +27 -27
- package/dist/index61.js.map +1 -1
- package/dist/index63.js +4 -4
- package/dist/index63.js.map +1 -1
- package/dist/index65.js +20 -20
- package/dist/index65.js.map +1 -1
- package/dist/index67.js +26 -26
- package/dist/index67.js.map +1 -1
- package/dist/index69.js +21 -19
- package/dist/index69.js.map +1 -1
- package/dist/index7.js.map +1 -1
- package/dist/index71.js +2 -2
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +3 -3
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +14 -14
- package/dist/index73.js.map +1 -1
- package/dist/index75.js +18 -18
- package/dist/index75.js.map +1 -1
- package/dist/index77.js +11 -11
- package/dist/index77.js.map +1 -1
- package/dist/index79.js +15 -15
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +10 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +20 -20
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +34 -34
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +18 -18
- package/dist/index87.js.map +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +53 -53
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +16 -16
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +21 -21
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +37 -37
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +18 -18
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/CommonProps.d.ts +18 -18
- package/dist/types/ExtractGenericFromComputedRef.d.ts +1 -1
- package/dist/types/ExtractGenericFromRef.d.ts +1 -1
- package/dist/types/VoidHtmlElements.d.ts +1 -1
- package/dist/utilities/functions/cloneDeep.d.ts +1 -1
- package/dist/utilities/functions/debounce.d.ts +1 -1
- package/dist/utilities/functions/flow.d.ts +1 -1
- package/dist/utilities/functions/get.d.ts +1 -1
- package/dist/utilities/functions/isNotNil.d.ts +1 -1
- package/dist/utilities/functions/mapValues.d.ts +1 -1
- package/dist/utilities/functions/merge.d.ts +1 -1
- package/dist/utilities/functions/millisecondsTo.d.ts +1 -1
- package/dist/utilities/functions/overEvery.d.ts +1 -1
- package/dist/utilities/functions/percentage.d.ts +4 -4
- package/dist/utilities/functions/pick.d.ts +1 -1
- package/dist/utilities/functions/pickBy.d.ts +1 -1
- package/dist/utilities/functions/roundToTheNearest.d.ts +1 -1
- package/package.json +93 -77
- package/dist/index256.js +0 -5
- package/dist/index256.js.map +0 -1
package/dist/index67.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index67.js","sources":["../src/components/BbDropdownButton/BbDropdownButton.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderList as _renderList, createSlots as _createSlots, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-dropdown-button__dropdown-label\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n class: \"bb-dropdown-button__dropdown-chevron\",\n xmlns: \"http://www.w3.org/2000/svg\"
|
|
1
|
+
{"version":3,"file":"index67.js","sources":["../src/components/BbDropdownButton/BbDropdownButton.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderList as _renderList, createSlots as _createSlots, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-dropdown-button__dropdown-label\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n class: \"bb-dropdown-button__dropdown-chevron\",\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z\",\n fill: \"currentColor\"\n })\n], -1)\n\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbDropdown from '../BbDropdown/BbDropdown.vue';\nimport type { BbDropdownProps, MappedItem } from '../BbDropdown/BbDropdown.vue';\n\nexport type BbDropdownButtonProps = Pick<\n\tBbDropdownProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'items'\n\t| 'offset'\n\t| 'padding'\n\t| 'placement'\n\t| 'theme'\n\t| 'transitionDuration'\n\t| 'width'\n>;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropdownButton',\n props: {\n arrowPadding: {},\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n items: {},\n offset: {},\n padding: {},\n placement: {},\n theme: { default: 'default' },\n transitionDuration: {},\n width: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst mainBtn = computed(() => {\n\tconst base = { ...props.items[0] };\n\tbase.disabled = base.disabled || props.disabled;\n\treturn base;\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass([\"bb-dropdown-button\", {\n\t\t\t'bb-dropdown-button--block': _ctx.block,\n\t\t\t[`bb-dropdown-button--theme-${props.theme}`]: props.theme,\n\t\t}])\n }, [\n _createVNode(BaseButton, _mergeProps(mainBtn.value, { class: \"bb-dropdown-button__main-btn\" }), {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"left-btn\", {\n disabled: mainBtn.value.disabled,\n text: mainBtn.value.text\n })\n ]),\n _: 3\n }, 16),\n _createVNode(BbDropdown, {\n id: _ctx.id,\n \"arrow-padding\": _ctx.arrowPadding,\n disabled: _ctx.disabled,\n eager: _ctx.eager,\n items: _ctx.items,\n offset: _ctx.offset,\n padding: _ctx.padding,\n placement: _ctx.placement,\n theme: _ctx.theme,\n \"transition-duration\": _ctx.transitionDuration,\n width: _ctx.width\n }, _createSlots({\n activator: _withCtx(({\n\t\t\t\t\tprops,\n\t\t\t\t\topening,\n\t\t\t\t\topen,\n\t\t\t\t\tclosed,\n\t\t\t\t\tclosing,\n\t\t\t\t\tdisabled,\n\t\t\t\t\tplacement,\n\t\t\t\t}) => [\n _renderSlot(_ctx.$slots, \"activator\", {\n closed: closed,\n closing: closing,\n disabled: disabled,\n open: open,\n opening: opening,\n placement: placement,\n props: props\n }, () => [\n _createVNode(BaseButton, _mergeProps(props, { class: \"bb-dropdown-button__dropdown-btn\" }), {\n default: _withCtx(() => [\n _createElementVNode(\"span\", _hoisted_1, _toDisplayString(open || opening ? 'Chiudi' : 'Apri') + \" il menu\", 1),\n _renderSlot(_ctx.$slots, \"right-btn\", {\n closed: closed,\n closing: closing,\n disabled: disabled,\n open: open,\n opening: opening,\n placement: placement\n }, () => [\n _hoisted_2\n ])\n ]),\n _: 2\n }, 1040)\n ])\n ]),\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:prepend\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n item: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:append\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, [\n _renderList(_ctx.items, (item) => {\n return {\n name: item.key,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, item.key, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"id\", \"arrow-padding\", \"disabled\", \"eager\", \"items\", \"offset\", \"padding\", \"placement\", \"theme\", \"transition-duration\", \"width\"])\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","mainBtn","computed","base","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_createVNode","BaseButton","_mergeProps","_withCtx","_renderSlot","BbDropdown","_createSlots","opening","open","closed","closing","disabled","placement","_createElementVNode","_toDisplayString","data","_normalizeProps","_guardReactiveProps","_renderList","item"],"mappings":";;;;;AAGA,MAAMA,IAAa,EAAE,OAAO,wCACtBC,sBAA8C,OAAO;AAAA,EACzD,OAAO;AAAA,EACP,SAAS;AAAA,EACT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;AAAA,UAC1BX,EAAYT,EAAK,QAAQ,WAAWqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC/E;AAAA,QACD,gBAAgBZ,EAAS,CAACY,MAAS;AAAA,UACjCX,EAAYT,EAAK,QAAQ,gBAAgBqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CACpF;AAAA,QACD,MAAMZ,EAAS,CAACY,MAAS;AAAA,UACvBX,EAAYT,EAAK,QAAQ,QAAQqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC5E;AAAA,QACD,eAAeZ,EAAS,CAACY,MAAS;AAAA,UAChCX,EAAYT,EAAK,QAAQ,eAAeqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CACnF;AAAA,QACD,QAAQZ,EAAS,CAACY,MAAS;AAAA,UACzBX,EAAYT,EAAK,QAAQ,UAAUqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC9E;AAAA,QACD,GAAG;AAAA,MAAA,GACF;AAAA,QACDG,EAAYvB,EAAK,OAAO,CAACwB,OAChB;AAAA,UACL,MAAMA,EAAK;AAAA,UACX,IAAIhB,EAAS,CAACY,MAAS;AAAA,YACrBX,EAAYT,EAAK,QAAQwB,EAAK,KAAKH,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,UAAA,CAC9E;AAAA,QAAA,EAEJ;AAAA,MACF,CAAA,GAAG,MAAM,CAAC,MAAM,iBAAiB,YAAY,SAAS,SAAS,UAAU,WAAW,aAAa,SAAS,uBAAuB,OAAO,CAAC;AAAA,OACzI,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
package/dist/index69.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
|
|
2
|
-
import { findInTree as ae } from "./
|
|
2
|
+
import { findInTree as ae } from "./index222.js";
|
|
3
3
|
import { useId as re } from "./index7.js";
|
|
4
4
|
import oe from "./index118.js";
|
|
5
5
|
import "./index183.js";
|
|
6
6
|
const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, ne = ["id", "
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
class: "bb-dropzone__submittable-label"
|
|
9
|
+
}, ne = ["id", "disabled", "multiple", "name"], ie = { class: "bb-dropzone__errors" }, fe = /* @__PURE__ */ j({
|
|
10
10
|
__name: "BbDropzone",
|
|
11
11
|
props: {
|
|
12
12
|
autofocus: {},
|
|
@@ -57,7 +57,7 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
|
57
57
|
if (r.includes("/"))
|
|
58
58
|
e.push(r);
|
|
59
59
|
else {
|
|
60
|
-
b || (b = await import("./
|
|
60
|
+
b || (b = await import("./index221.js").then((s) => s.i));
|
|
61
61
|
const o = b.getType(r);
|
|
62
62
|
if (!o)
|
|
63
63
|
throw new Error(
|
|
@@ -142,7 +142,9 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
|
142
142
|
formattedSize: A(e.size),
|
|
143
143
|
filename: e.name
|
|
144
144
|
};
|
|
145
|
-
throw new Error(
|
|
145
|
+
throw new Error(
|
|
146
|
+
"Requested to create an error for maxSize without providing a maxSize."
|
|
147
|
+
);
|
|
146
148
|
},
|
|
147
149
|
uniqueness: (e) => ({
|
|
148
150
|
type: "uniqueness",
|
|
@@ -167,47 +169,47 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
|
|
|
167
169
|
() => !!w.value.length || t.hasErrors
|
|
168
170
|
);
|
|
169
171
|
return (e, a) => (V(), G(K(e.tag), {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
id: v,
|
|
173
|
+
class: O(k.value)
|
|
172
174
|
}, {
|
|
173
175
|
default: M(() => [
|
|
174
176
|
c("label", {
|
|
175
|
-
onDrop: y($, ["prevent"]),
|
|
176
177
|
onDragenter: y(B, ["prevent"]),
|
|
178
|
+
onDragleave: y(E, ["prevent"]),
|
|
177
179
|
onDragover: y(N, ["prevent"]),
|
|
178
|
-
|
|
180
|
+
onDrop: y($, ["prevent"])
|
|
179
181
|
}, [
|
|
180
182
|
c("input", {
|
|
181
|
-
type: "file",
|
|
182
183
|
accept: P.value,
|
|
183
184
|
autofocus: e.autofocus,
|
|
184
185
|
disabled: e.disabled,
|
|
185
186
|
multiple: e.multiple,
|
|
187
|
+
type: "file",
|
|
188
|
+
onBlur: L,
|
|
186
189
|
onChange: H,
|
|
187
|
-
onFocus: I
|
|
188
|
-
onBlur: L
|
|
190
|
+
onFocus: I
|
|
189
191
|
}, null, 40, le),
|
|
190
192
|
U(e.$slots, "default", Y(Z(q.value)))
|
|
191
193
|
], 32),
|
|
192
194
|
c("label", se, [
|
|
193
195
|
J(" Server files "),
|
|
194
196
|
c("input", {
|
|
195
|
-
class: "bb-dropzone__submittable-input",
|
|
196
|
-
type: "file",
|
|
197
197
|
id: Q(z),
|
|
198
|
-
name: e.name,
|
|
199
198
|
ref_key: "submittable",
|
|
200
199
|
ref: d,
|
|
200
|
+
class: "bb-dropzone__submittable-input",
|
|
201
|
+
disabled: e.disabled,
|
|
201
202
|
multiple: e.multiple,
|
|
202
|
-
|
|
203
|
+
name: e.name,
|
|
204
|
+
type: "file"
|
|
203
205
|
}, null, 8, ne)
|
|
204
206
|
]),
|
|
205
207
|
c("span", ie, [
|
|
206
208
|
W(oe, { tag: "span" }, {
|
|
207
209
|
default: M(() => [
|
|
208
210
|
(V(!0), F(X, null, ee(w.value, (r) => (V(), F("span", {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
+
key: r,
|
|
212
|
+
class: "bb-dropzone__error"
|
|
211
213
|
}, te(r), 1))), 128))
|
|
212
214
|
]),
|
|
213
215
|
_: 1
|
package/dist/index69.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index69.js","sources":["../src/components/BbDropzone/BbDropzone.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, withModifiers as _withModifiers, unref as _unref, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createVNode as _createVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_2 = {\n class: \"bb-dropzone__submittable-label\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_3 = [\"id\", \"name\", \"multiple\", \"disabled\"]\nconst _hoisted_4 = { class: \"bb-dropzone__errors\" }\n\nimport { computed, ref, watch } from \"vue\";\nimport { findInTree } from \"@/utilities/functions/findInTree\";\nimport { useId } from \"@/composables/useId\";\nimport BbSmoothHeight from \"../BbSmoothHeight/BbSmoothHeight.vue\";\nimport type { CommonProps, NonVoidElementTag } from \"@/types/CommonProps\";\n\nexport type DropZoneError = ReturnType<\n (typeof createError)[keyof typeof createError]\n>;\n\nexport type BbDropzoneProps = Pick<CommonProps, \n'autofocus' |\n'disabled' |\n'errors' |\n'hasErrors' |\n'id' |\n'multiple' |\n'name'\n> & {\n /**\n * Array of mime-types or extensions to filter selectable files.\n */\n accept?: string[];\n /**\n * Maximum number of acceptable files\n */\n maxFiles?: number;\n /**\n * Max size of the files in bytes.\n */\n maxSize?: number;\n /**\n * Used by v-model.\n */\n modelValue: any;\n} & NonVoidElementTag\n\n// This is the dynamic import for mime\nexport type BbDropzoneEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"error\", data: DropZoneError): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"update:modelValue\", data: any): void;\n};\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropzone',\n props: {\n autofocus: {},\n disabled: { type: Boolean },\n errors: {},\n hasErrors: { type: Boolean },\n id: {},\n multiple: { type: Boolean },\n name: {},\n accept: {},\n maxFiles: {},\n maxSize: {},\n modelValue: {},\n tag: { default: \"div\" }\n },\n emits: [\"blur\", \"error\", \"focus\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nlet mime: any;\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst submittable = ref<any | null>(null);\n\nif (props.accept) {\n if (!Array.isArray(props.accept)) {\n throw new Error(\"Property accept is not an array\");\n }\n}\nif (props.multiple) {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\n \"Component is set to multiple but modelValue is not an array\"\n );\n }\n}\n\nconst hasFocus = ref(false);\nconst onFocus = (event: FocusEvent) => {\n hasFocus.value = true;\n emit('focus', event)\n}\nconst onBlur = (event: FocusEvent) => {\n hasFocus.value = false;\n emit('blur', event)\n}\n\n/** Allow dropzone to be submittable (this is flimsy and might break) */\nwatch(\n () => props.modelValue,\n () => {\n let container = new DataTransfer();\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length) {\n props.modelValue.forEach((file) => container.items.add(file));\n }\n } else {\n if (props.modelValue) container.items.add(props.modelValue);\n }\n if (submittable.value) {\n if (container.items.length) {\n submittable.value.files = container.files;\n } else {\n submittable.value.files = null;\n }\n }\n }\n);\n\nconst acceptedMimeTypes = ref<string[]>([]);\nconst acceptedMimeTypesString = computed(() =>\n acceptedMimeTypes.value.join(\",\")\n);\nwatch(\n () => props.accept,\n async () => {\n if (props.accept) {\n let accumulated = [];\n for (let i = 0; i < props.accept.length; i++) {\n const element = props.accept[i];\n if (element.includes(\"/\")) accumulated.push(element);\n else {\n if (!mime) mime = await import(\"mime\");\n const foundMime = mime.getType(element);\n if (!foundMime) {\n throw new Error(\n `Could not detect the correct mime associated with ${element}`\n );\n }\n accumulated.push(foundMime);\n }\n }\n acceptedMimeTypes.value = accumulated;\n }\n },\n { immediate: true }\n);\n\n/**\n * Component state\n */\nconst id = props.id || `${useId().id.value}`;\nconst containerId = `bb_dz_${id}`;\n\nconst dragging = ref(false);\n// Add a timeout to prevent browser flickering\nlet draggingTimeout: ReturnType<typeof setTimeout>;\n\nconst classes = computed(() => {\n return {\n \"bb-dropzone\": true,\n \"bb-dropzone--errors\": hasErrors.value,\n \"bb-dropzone--dragging\": dragging.value,\n };\n});\nconst slotAttributes = computed(() => {\n return {\n dragging: dragging.value,\n focused: hasFocus.value,\n id: id\n };\n});\n\n/**\n * Component handlers\n */\nconst onDrop = (event: DragEvent) => {\n dragging.value = false;\n\n if (event.dataTransfer) {\n event.stopImmediatePropagation();\n let files;\n files = Array.from(event.dataTransfer.files);\n files = parseFiles(files);\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n if (event.currentTarget instanceof HTMLLabelElement) {\n const innerInput = event.currentTarget.querySelector(\"input[type=file]\");\n if (innerInput instanceof HTMLInputElement) {\n innerInput.focus();\n }\n }\n }\n};\nconst onChange = (event: Event) => {\n if (event.target instanceof HTMLInputElement) {\n if (event.target.files) {\n let files;\n files = parseFiles(Array.from(event.target.files));\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n }\n event.target.value = \"\";\n event.target.files = null;\n }\n};\n\nconst parseFiles = (files: File[]) => {\n return files.filter((file, index) => {\n // Sizecheck\n if (props.maxSize) {\n let passing = file.size <= props.maxSize;\n if (!passing) {\n emit(\"error\", createError.maxSize(file));\n return false;\n }\n }\n // Uniqueness check\n let alreadyExists = false;\n if (props.modelValue) {\n if (Array.isArray(props.modelValue)) {\n alreadyExists = props.modelValue.some((current) =>\n compareFiles(current, file)\n );\n } else {\n alreadyExists = compareFiles(props.modelValue, file);\n }\n }\n if (alreadyExists) {\n emit(\"error\", createError.uniqueness(file));\n return false;\n }\n // Mime type check\n if (props.accept) {\n const mimePassed = acceptedMimeTypes.value.some((mime) => {\n let found = false;\n if (mime.includes(\"*\"))\n found = found || mime.split(\"/\")[0] === file.type.split(\"/\")[0];\n else found = found || mime === file.type;\n return found;\n });\n if (!mimePassed) {\n emit(\"error\", createError.accept(file));\n return false;\n }\n }\n // Max files check\n if (props.maxFiles) {\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length + index + 1 > props.maxFiles) {\n emit(\n \"error\",\n createError.maxFiles(file, props.modelValue.length + index + 1)\n );\n return false;\n }\n }\n }\n return true;\n });\n};\n\nconst onDragOver = (event: Event) => {\n // Find the closest dropzone in case of nested dropzones\n const target = event.target;\n if (target instanceof HTMLElement) {\n const closestDropzone = findInTree([target], \"parentElement\", (el) =>\n el.classList.contains(\"bb-dropzone\")\n );\n if (closestDropzone) {\n /* When dragging over this dropzone set as dragging */\n if (closestDropzone.id === containerId) {\n setDragging();\n /* When dragging over a nested dropzone do not highlight this dropzone */\n } else {\n unsetDragging();\n }\n }\n }\n};\n\nconst setDragging = () => {\n clearTimeout(draggingTimeout);\n dragging.value = true;\n};\n\nconst unsetDragging = () => {\n draggingTimeout = setTimeout(() => {\n dragging.value = false;\n }, 100);\n};\n\nconst bytesToUnit = (bytes: number, decimals = 2) => {\n if (!bytes) return \"0 B\";\n const k = 1024;\n const dm = decimals || 0;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n};\n\n/**\n * Returns true if files are identical by the properties that are accessible\n * @param file The file to check\n * @param otherFile The file to check against\n */\nconst compareFiles = (file: File, otherFile: File) => {\n const properties: (keyof File)[] = [\"name\", \"size\", \"lastModified\", \"type\"];\n return !properties.some((key) => file[key] !== otherFile[key]);\n};\n\n/**\n * Helper that creates errors based on component properties\n */\nconst createError = {\n maxSize: (file: File) => {\n // Todo update to isNil\n if (props.maxSize) {\n return {\n type: \"maxSize\",\n file: file,\n formattedMaxSize: bytesToUnit(+props.maxSize),\n formattedSize: bytesToUnit(file.size),\n filename: file.name,\n } as const;\n } else throw new Error('Requested to create an error for maxSize without providing a maxSize.')\n },\n uniqueness: (file: File) => {\n return {\n type: \"uniqueness\",\n file: file,\n filename: file.name,\n } as const;\n },\n accept: (file: File) => {\n return {\n type: \"accept\",\n file: file,\n acceptedMimeTypes: acceptedMimeTypes.value,\n mimeType: file.type,\n filename: file.name,\n } as const;\n },\n maxFiles: (file: File, totalFiles: number) => {\n return {\n type: \"maxFiles\",\n file: file,\n maxFiles: props.maxFiles,\n totalFiles,\n filename: file.name,\n } as const;\n },\n};\n\nconst computedErrors = computed(() => {\n return props.errors ? ([] as string[]).concat(props.errors) : [];\n});\n\nconst hasErrors = computed(\n () => Boolean(computedErrors.value.length) || props.hasErrors\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {\n class: _normalizeClass(classes.value),\n id: containerId\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"label\", {\n onDrop: _withModifiers(onDrop, [\"prevent\"]),\n onDragenter: _withModifiers(setDragging, [\"prevent\"]),\n onDragover: _withModifiers(onDragOver, [\"prevent\"]),\n onDragleave: _withModifiers(unsetDragging, [\"prevent\"])\n }, [\n _createElementVNode(\"input\", {\n type: \"file\",\n accept: acceptedMimeTypesString.value,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n multiple: _ctx.multiple,\n onChange: onChange,\n onFocus: onFocus,\n onBlur: onBlur\n }, null, 40, _hoisted_1),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 32),\n _createElementVNode(\"label\", _hoisted_2, [\n _createTextVNode(\" Server files \"),\n _createElementVNode(\"input\", {\n class: \"bb-dropzone__submittable-input\",\n type: \"file\",\n id: _unref(id),\n name: _ctx.name,\n ref_key: \"submittable\",\n ref: submittable,\n multiple: _ctx.multiple,\n disabled: _ctx.disabled\n }, null, 8, _hoisted_3)\n ]),\n _createElementVNode(\"span\", _hoisted_4, [\n _createVNode(BbSmoothHeight, { tag: \"span\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(computedErrors.value, (error) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: \"bb-dropzone__error\",\n key: error\n }, _toDisplayString(error), 1))\n }), 128))\n ]),\n _: 1\n })\n ])\n ]),\n _: 3\n }, 8, [\"class\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","mime","props","emit","submittable","ref","hasFocus","onFocus","event","onBlur","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","files","parseFiles","innerInput","onChange","index","createError","alreadyExists","current","compareFiles","found","onDragOver","target","closestDropzone","findInTree","el","setDragging","unsetDragging","bytesToUnit","bytes","decimals","k","dm","sizes","otherFile","key","totalFiles","computedErrors","_ctx","_cache","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementVNode","_withModifiers","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_unref","_createVNode","BbSmoothHeight","_createElementBlock","_Fragment","_renderList","error","_toDisplayString"],"mappings":";;;;;AAGA,MAAMA,KAAa,CAAC,UAAU,aAAa,YAAY,UAAU,GAC3DC,KAAa;AAAA,EACjB,OAAO;AA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AAA,YACL,UAAUoD,EAAK;AAAA,YACf,UAAUA,EAAK;AAAA,UAAA,GACd,MAAM,GAAG7D,EAAU;AAAA,QAAA,CACvB;AAAA,QACDoE,EAAoB,QAAQnE,IAAY;AAAA,UACtC0E,EAAaC,IAAgB,EAAE,KAAK,UAAU;AAAA,YAC5C,SAAST,EAAS,MAAM;AAAA,eACrBJ,EAAW,EAAI,GAAGc,EAAoBC,GAAW,MAAMC,GAAYnB,EAAe,OAAO,CAACoB,OACjFjB,EAAA,GAAcc,EAAoB,QAAQ;AAAA,gBAChD,OAAO;AAAA,gBACP,KAAKG;AAAA,cACJ,GAAAC,GAAiBD,CAAK,GAAG,CAAC,EAC9B,GAAG,GAAG;AAAA,YAAA,CACR;AAAA,YACD,GAAG;AAAA,UAAA,CACJ;AAAA,QAAA,CACF;AAAA,MAAA,CACF;AAAA,MACD,GAAG;AAAA,IAAA,GACF,GAAG,CAAC,OAAO,CAAC;AAAA,EAEjB;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index69.js","sources":["../src/components/BbDropzone/BbDropzone.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, withModifiers as _withModifiers, unref as _unref, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createVNode as _createVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_2 = {\n \"aria-hidden\": \"true\",\n class: \"bb-dropzone__submittable-label\"\n}\nconst _hoisted_3 = [\"id\", \"disabled\", \"multiple\", \"name\"]\nconst _hoisted_4 = { class: \"bb-dropzone__errors\" }\n\nimport { computed, ref, watch } from 'vue';\nimport { findInTree } from '@/utilities/functions/findInTree';\nimport { useId } from '@/composables/useId';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\nimport type { CommonProps, NonVoidElementTag } from '@/types/CommonProps';\n\nexport type DropZoneError = ReturnType<\n\t(typeof createError)[keyof typeof createError]\n>;\n\nexport type BbDropzoneProps = Pick<\n\tCommonProps,\n\t'autofocus' | 'disabled' | 'errors' | 'hasErrors' | 'id' | 'multiple' | 'name'\n> & {\n\t/**\n\t * Array of mime-types or extensions to filter selectable files.\n\t */\n\taccept?: string[];\n\t/**\n\t * Maximum number of acceptable files\n\t */\n\tmaxFiles?: number;\n\t/**\n\t * Max size of the files in bytes.\n\t */\n\tmaxSize?: number;\n\t/**\n\t * Used by v-model.\n\t */\n\tmodelValue: any;\n} & NonVoidElementTag;\n\n// This is the dynamic import for mime\nexport type BbDropzoneEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'error', data: DropZoneError): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'update:modelValue', data: any): void;\n};\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropzone',\n props: {\n autofocus: {},\n disabled: { type: Boolean },\n errors: {},\n hasErrors: { type: Boolean },\n id: {},\n multiple: { type: Boolean },\n name: {},\n accept: {},\n maxFiles: {},\n maxSize: {},\n modelValue: {},\n tag: { default: 'div' }\n },\n emits: [\"blur\", \"error\", \"focus\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nlet mime: any;\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst submittable = ref<any | null>(null);\n\nif (props.accept) {\n\tif (!Array.isArray(props.accept)) {\n\t\tthrow new Error('Property accept is not an array');\n\t}\n}\nif (props.multiple) {\n\tif (!Array.isArray(props.modelValue)) {\n\t\tthrow new Error(\n\t\t\t'Component is set to multiple but modelValue is not an array'\n\t\t);\n\t}\n}\n\nconst hasFocus = ref(false);\nconst onFocus = (event: FocusEvent) => {\n\thasFocus.value = true;\n\temit('focus', event);\n};\nconst onBlur = (event: FocusEvent) => {\n\thasFocus.value = false;\n\temit('blur', event);\n};\n\n/** Allow dropzone to be submittable (this is flimsy and might break) */\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tlet container = new DataTransfer();\n\t\tif (Array.isArray(props.modelValue)) {\n\t\t\tif (props.modelValue.length) {\n\t\t\t\tprops.modelValue.forEach((file) => container.items.add(file));\n\t\t\t}\n\t\t} else {\n\t\t\tif (props.modelValue) container.items.add(props.modelValue);\n\t\t}\n\t\tif (submittable.value) {\n\t\t\tif (container.items.length) {\n\t\t\t\tsubmittable.value.files = container.files;\n\t\t\t} else {\n\t\t\t\tsubmittable.value.files = null;\n\t\t\t}\n\t\t}\n\t}\n);\n\nconst acceptedMimeTypes = ref<string[]>([]);\nconst acceptedMimeTypesString = computed(() =>\n\tacceptedMimeTypes.value.join(',')\n);\nwatch(\n\t() => props.accept,\n\tasync () => {\n\t\tif (props.accept) {\n\t\t\tlet accumulated = [];\n\t\t\tfor (let i = 0; i < props.accept.length; i++) {\n\t\t\t\tconst element = props.accept[i];\n\t\t\t\tif (element.includes('/')) accumulated.push(element);\n\t\t\t\telse {\n\t\t\t\t\tif (!mime) mime = await import('mime');\n\t\t\t\t\tconst foundMime = mime.getType(element);\n\t\t\t\t\tif (!foundMime) {\n\t\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t\t`Could not detect the correct mime associated with ${element}`\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\taccumulated.push(foundMime);\n\t\t\t\t}\n\t\t\t}\n\t\t\tacceptedMimeTypes.value = accumulated;\n\t\t}\n\t},\n\t{ immediate: true }\n);\n\n/**\n * Component state\n */\nconst id = props.id || `${useId().id.value}`;\nconst containerId = `bb_dz_${id}`;\n\nconst dragging = ref(false);\n// Add a timeout to prevent browser flickering\nlet draggingTimeout: ReturnType<typeof setTimeout>;\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-dropzone': true,\n\t\t'bb-dropzone--errors': hasErrors.value,\n\t\t'bb-dropzone--dragging': dragging.value,\n\t};\n});\nconst slotAttributes = computed(() => {\n\treturn {\n\t\tdragging: dragging.value,\n\t\tfocused: hasFocus.value,\n\t\tid: id,\n\t};\n});\n\n/**\n * Component handlers\n */\nconst onDrop = (event: DragEvent) => {\n\tdragging.value = false;\n\n\tif (event.dataTransfer) {\n\t\tevent.stopImmediatePropagation();\n\t\tlet files;\n\t\tfiles = Array.from(event.dataTransfer.files);\n\t\tfiles = parseFiles(files);\n\t\tif (props.multiple) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\temit('update:modelValue', [...props.modelValue, ...files]);\n\t\t\t}\n\t\t} else {\n\t\t\tfiles = files[0];\n\t\t\temit('update:modelValue', files);\n\t\t}\n\t\tif (event.currentTarget instanceof HTMLLabelElement) {\n\t\t\tconst innerInput = event.currentTarget.querySelector('input[type=file]');\n\t\t\tif (innerInput instanceof HTMLInputElement) {\n\t\t\t\tinnerInput.focus();\n\t\t\t}\n\t\t}\n\t}\n};\nconst onChange = (event: Event) => {\n\tif (event.target instanceof HTMLInputElement) {\n\t\tif (event.target.files) {\n\t\t\tlet files;\n\t\t\tfiles = parseFiles(Array.from(event.target.files));\n\t\t\tif (props.multiple) {\n\t\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\t\temit('update:modelValue', [...props.modelValue, ...files]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfiles = files[0];\n\t\t\t\temit('update:modelValue', files);\n\t\t\t}\n\t\t}\n\t\tevent.target.value = '';\n\t\tevent.target.files = null;\n\t}\n};\n\nconst parseFiles = (files: File[]) => {\n\treturn files.filter((file, index) => {\n\t\t// Sizecheck\n\t\tif (props.maxSize) {\n\t\t\tlet passing = file.size <= props.maxSize;\n\t\t\tif (!passing) {\n\t\t\t\temit('error', createError.maxSize(file));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Uniqueness check\n\t\tlet alreadyExists = false;\n\t\tif (props.modelValue) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\talreadyExists = props.modelValue.some((current) =>\n\t\t\t\t\tcompareFiles(current, file)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\talreadyExists = compareFiles(props.modelValue, file);\n\t\t\t}\n\t\t}\n\t\tif (alreadyExists) {\n\t\t\temit('error', createError.uniqueness(file));\n\t\t\treturn false;\n\t\t}\n\t\t// Mime type check\n\t\tif (props.accept) {\n\t\t\tconst mimePassed = acceptedMimeTypes.value.some((mime) => {\n\t\t\t\tlet found = false;\n\t\t\t\tif (mime.includes('*'))\n\t\t\t\t\tfound = found || mime.split('/')[0] === file.type.split('/')[0];\n\t\t\t\telse found = found || mime === file.type;\n\t\t\t\treturn found;\n\t\t\t});\n\t\t\tif (!mimePassed) {\n\t\t\t\temit('error', createError.accept(file));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// Max files check\n\t\tif (props.maxFiles) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\tif (props.modelValue.length + index + 1 > props.maxFiles) {\n\t\t\t\t\temit(\n\t\t\t\t\t\t'error',\n\t\t\t\t\t\tcreateError.maxFiles(file, props.modelValue.length + index + 1)\n\t\t\t\t\t);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t});\n};\n\nconst onDragOver = (event: Event) => {\n\t// Find the closest dropzone in case of nested dropzones\n\tconst target = event.target;\n\tif (target instanceof HTMLElement) {\n\t\tconst closestDropzone = findInTree([target], 'parentElement', (el) =>\n\t\t\tel.classList.contains('bb-dropzone')\n\t\t);\n\t\tif (closestDropzone) {\n\t\t\t/* When dragging over this dropzone set as dragging */\n\t\t\tif (closestDropzone.id === containerId) {\n\t\t\t\tsetDragging();\n\t\t\t\t/* When dragging over a nested dropzone do not highlight this dropzone */\n\t\t\t} else {\n\t\t\t\tunsetDragging();\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst setDragging = () => {\n\tclearTimeout(draggingTimeout);\n\tdragging.value = true;\n};\n\nconst unsetDragging = () => {\n\tdraggingTimeout = setTimeout(() => {\n\t\tdragging.value = false;\n\t}, 100);\n};\n\nconst bytesToUnit = (bytes: number, decimals = 2) => {\n\tif (!bytes) return '0 B';\n\tconst k = 1024;\n\tconst dm = decimals || 0;\n\tconst sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\n\tconst i = Math.floor(Math.log(bytes) / Math.log(k));\n\treturn parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\n};\n\n/**\n * Returns true if files are identical by the properties that are accessible\n * @param file The file to check\n * @param otherFile The file to check against\n */\nconst compareFiles = (file: File, otherFile: File) => {\n\tconst properties: (keyof File)[] = ['name', 'size', 'lastModified', 'type'];\n\treturn !properties.some((key) => file[key] !== otherFile[key]);\n};\n\n/**\n * Helper that creates errors based on component properties\n */\nconst createError = {\n\tmaxSize: (file: File) => {\n\t\t// Todo update to isNil\n\t\tif (props.maxSize) {\n\t\t\treturn {\n\t\t\t\ttype: 'maxSize',\n\t\t\t\tfile: file,\n\t\t\t\tformattedMaxSize: bytesToUnit(+props.maxSize),\n\t\t\t\tformattedSize: bytesToUnit(file.size),\n\t\t\t\tfilename: file.name,\n\t\t\t} as const;\n\t\t} else\n\t\t\tthrow new Error(\n\t\t\t\t'Requested to create an error for maxSize without providing a maxSize.'\n\t\t\t);\n\t},\n\tuniqueness: (file: File) => {\n\t\treturn {\n\t\t\ttype: 'uniqueness',\n\t\t\tfile: file,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n\taccept: (file: File) => {\n\t\treturn {\n\t\t\ttype: 'accept',\n\t\t\tfile: file,\n\t\t\tacceptedMimeTypes: acceptedMimeTypes.value,\n\t\t\tmimeType: file.type,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n\tmaxFiles: (file: File, totalFiles: number) => {\n\t\treturn {\n\t\t\ttype: 'maxFiles',\n\t\t\tfile: file,\n\t\t\tmaxFiles: props.maxFiles,\n\t\t\ttotalFiles,\n\t\t\tfilename: file.name,\n\t\t} as const;\n\t},\n};\n\nconst computedErrors = computed(() => {\n\treturn props.errors ? ([] as string[]).concat(props.errors) : [];\n});\n\nconst hasErrors = computed(\n\t() => Boolean(computedErrors.value.length) || props.hasErrors\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {\n id: containerId,\n class: _normalizeClass(classes.value)\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"label\", {\n onDragenter: _withModifiers(setDragging, [\"prevent\"]),\n onDragleave: _withModifiers(unsetDragging, [\"prevent\"]),\n onDragover: _withModifiers(onDragOver, [\"prevent\"]),\n onDrop: _withModifiers(onDrop, [\"prevent\"])\n }, [\n _createElementVNode(\"input\", {\n accept: acceptedMimeTypesString.value,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n multiple: _ctx.multiple,\n type: \"file\",\n onBlur: onBlur,\n onChange: onChange,\n onFocus: onFocus\n }, null, 40, _hoisted_1),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 32),\n _createElementVNode(\"label\", _hoisted_2, [\n _createTextVNode(\" Server files \"),\n _createElementVNode(\"input\", {\n id: _unref(id),\n ref_key: \"submittable\",\n ref: submittable,\n class: \"bb-dropzone__submittable-input\",\n disabled: _ctx.disabled,\n multiple: _ctx.multiple,\n name: _ctx.name,\n type: \"file\"\n }, null, 8, _hoisted_3)\n ]),\n _createElementVNode(\"span\", _hoisted_4, [\n _createVNode(BbSmoothHeight, { tag: \"span\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(computedErrors.value, (error) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n key: error,\n class: \"bb-dropzone__error\"\n }, _toDisplayString(error), 1))\n }), 128))\n ]),\n _: 1\n })\n ])\n ]),\n _: 3\n }, 8, [\"class\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","mime","props","emit","submittable","ref","hasFocus","onFocus","event","onBlur","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","files","parseFiles","innerInput","onChange","index","createError","alreadyExists","current","compareFiles","found","onDragOver","target","closestDropzone","findInTree","el","setDragging","unsetDragging","bytesToUnit","bytes","decimals","k","dm","sizes","otherFile","key","totalFiles","computedErrors","_ctx","_cache","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementVNode","_withModifiers","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_unref","_createVNode","BbSmoothHeight","_createElementBlock","_Fragment","_renderList","error","_toDisplayString"],"mappings":";;;;;AAGA,MAAMA,KAAa,CAAC,UAAU,aAAa,YAAY,UAAU,GAC3DC,KAAa;AAAA,EACjB,eAAe;AAAA,EACf,OAAO;AACT,GACMC,KAAa,CAAC,MAAM,YAAY,YAAY,MAAM,GAClDC,KAAa,EAAE,OAAO,yBA0CAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,CAAC;AAAA,IACZ,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,QAAQ,CAAC;AAAA,IACT,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,MAAM,CAAC;AAAA,IACP,QAAQ,CAAC;AAAA,IACT,UAAU,CAAC;AAAA,IACX,SAAS,CAAC;AAAA,IACV,YAAY,CAAC;AAAA,IACb,KAAK,EAAE,SAAS,MAAM;AAAA,EACxB;AAAA,EACA,OAAO,CAAC,QAAQ,SA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AG;AAAA,IAAA,GACF,GAAG,CAAC,OAAO,CAAC;AAAA,EAEjB;AAEA,CAAC;"}
|
package/dist/index7.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index7.js","sources":["../src/composables/useId.ts"],"sourcesContent":["import { ref } from
|
|
1
|
+
{"version":3,"file":"index7.js","sources":["../src/composables/useId.ts"],"sourcesContent":["import { ref } from 'vue';\n\nconst makeid = (length: number) => {\n\tlet result = '';\n\tconst characters =\n\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\tconst charactersLength = characters.length;\n\tlet counter = 0;\n\twhile (counter < length) {\n\t\tresult += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\tcounter += 1;\n\t}\n\treturn result;\n};\n\n/**\n * Return a reactive ref to an ID with a collision probability of one in 4 trillion.\n * The characters used are [a-zA-Z0-9] so they are fully compatible with HTML5 ID attr.\n * Also returns a function to refresh the id.\n */\nexport const useId = () => {\n\tconst id = ref(makeid(12));\n\tconst refresh = () => (id.value = makeid(12));\n\treturn {\n\t\t/**\n\t\t * The generated id\n\t\t */\n\t\tid,\n\t\trefresh,\n\t};\n};\n"],"names":["makeid","length","result","characters","charactersLength","counter","useId","id","ref"],"mappings":";AAEA,MAAMA,IAAS,CAACC,MAAmB;AAClC,MAAIC,IAAS;AACb,QAAMC,IACL,kEACKC,IAAmBD,EAAW;AACpC,MAAIE,IAAU;AACd,SAAOA,IAAUJ;AACN,IAAAC,KAAAC,EAAW,OAAO,KAAK,MAAM,KAAK,OAAO,IAAIC,CAAgB,CAAC,GAC7DC,KAAA;AAEL,SAAAH;AACR,GAOaI,IAAQ,MAAM;AAC1B,QAAMC,IAAKC,EAAIR,EAAO,EAAE,CAAC;AAElB,SAAA;AAAA;AAAA;AAAA;AAAA,IAIN,IAAAO;AAAA,IACA,SANe,MAAOA,EAAG,QAAQP,EAAO,EAAE;AAAA,EAM1C;AAEF;"}
|
package/dist/index71.js
CHANGED
package/dist/index71.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index71.js","sources":["../src/components/BbHover/BbHover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot } from \"vue\"\n\nimport { ref } from
|
|
1
|
+
{"version":3,"file":"index71.js","sources":["../src/components/BbHover/BbHover.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot } from \"vue\"\n\nimport { ref } from 'vue';\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbHover',\n setup(__props) {\n\n\nconst isHovering = ref(false);\n\nconst onMouseenter = (event: MouseEvent) => {\n\tconst outerTarget = event.target;\n\tif (outerTarget instanceof HTMLElement) {\n\t\tisHovering.value = true;\n\t\tconst onDocumentMouseover = (event: MouseEvent) => {\n\t\t\tconst innerTarget = event.target;\n\t\t\tif (innerTarget instanceof HTMLElement) {\n\t\t\t\tif (!outerTarget.contains(innerTarget)) {\n\t\t\t\t\tisHovering.value = false;\n\t\t\t\t\tdocument.removeEventListener('mouseover', onDocumentMouseover);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tdocument.addEventListener('mouseover', onDocumentMouseover);\n\t}\n};\n\nreturn (_ctx: any,_cache: any) => {\n return _renderSlot(_ctx.$slots, \"default\", {\n isHovering: isHovering.value,\n props: { onMouseenter: onMouseenter }\n })\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","isHovering","ref","onMouseenter","event","outerTarget","onDocumentMouseover","innerTarget","_ctx","_cache","_renderSlot"],"mappings":";AAMA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,MAAMC,GAAS;AAGX,UAAAC,IAAaC,EAAI,EAAK,GAEtBC,IAAe,CAACC,MAAsB;AAC3C,YAAMC,IAAcD,EAAM;AAC1B,UAAIC,aAAuB,aAAa;AACvC,QAAAJ,EAAW,QAAQ;AACb,cAAAK,IAAsB,CAACF,MAAsB;AAClD,gBAAMG,IAAcH,EAAM;AAC1B,UAAIG,aAAuB,gBACrBF,EAAY,SAASE,CAAW,MACpCN,EAAW,QAAQ,IACV,SAAA,oBAAoB,aAAaK,CAAmB;AAAA,QAE/D;AAEQ,iBAAA,iBAAiB,aAAaA,CAAmB;AAAA,MAC3D;AAAA,IAAA;AAGM,WAAA,CAACE,GAAUC,MACTC,EAAYF,EAAK,QAAQ,WAAW;AAAA,MACzC,YAAYP,EAAW;AAAA,MACvB,OAAO,EAAE,cAAAE,EAA2B;AAAA,IAAA,CACrC;AAAA,EAEH;AAEA,CAAC;"}
|
package/dist/index72.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
|
|
2
|
-
import { throttle as c } from "./
|
|
2
|
+
import { throttle as c } from "./index208.js";
|
|
3
3
|
const M = /* @__PURE__ */ h({
|
|
4
4
|
__name: "BbIntersection",
|
|
5
5
|
props: {
|
|
@@ -26,9 +26,9 @@ const M = /* @__PURE__ */ h({
|
|
|
26
26
|
i("intersected", e);
|
|
27
27
|
}, r.debounceTime);
|
|
28
28
|
return (e, B) => (g(), b(w(e.tag), {
|
|
29
|
-
class: "bb-intersection",
|
|
30
29
|
ref_key: "infinitescrolltrigger",
|
|
31
|
-
ref: l
|
|
30
|
+
ref: l,
|
|
31
|
+
class: "bb-intersection"
|
|
32
32
|
}, {
|
|
33
33
|
default: _(() => [
|
|
34
34
|
I(e.$slots, "default", {
|
package/dist/index72.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index72.js","sources":["../src/components/BbIntersection/BbIntersection.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport type { NonVoidElementTag } from
|
|
1
|
+
{"version":3,"file":"index72.js","sources":["../src/components/BbIntersection/BbIntersection.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, resolveDynamicComponent as _resolveDynamicComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport type { NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { onBeforeUnmount, onMounted, ref } from 'vue';\n\nexport type BbIntersectionProps = {\n\t/**\n\t * Time to wait before emitting intersection value\n\t */\n\tdebounceTime?: number;\n\t/**\n\t * Options used to confgiure the IntersectionObserver\n\t */\n\toptions?: IntersectionObserverInit;\n} & NonVoidElementTag;\n\nexport type BbIntersectionEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'intersected', value: number): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbIntersection',\n props: {\n debounceTime: { default: 0 },\n options: { default: () => ({\n\t\troot: null,\n\t\tthreshold: [0, 0.2, 0.4, 0.6, 0.8, 1],\n\t}) },\n tag: { default: 'div' }\n },\n emits: [\"shown\", \"hidden\", \"intersected\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst observer = ref<IntersectionObserver | null>(null);\nconst infinitescrolltrigger = ref<Element | null>(null);\nconst shown = ref(false);\nconst hidden = ref(true);\nconst percentage = ref(0);\n\nonMounted(() => {\n\tobserver.value = new IntersectionObserver((entries) => {\n\t\thandleIntersect(entries[0]);\n\t}, props.options);\n\tif (infinitescrolltrigger.value) {\n\t\tobserver.value.observe(infinitescrolltrigger.value);\n\t}\n});\nonBeforeUnmount(() => {\n\tif (observer.value) observer.value.disconnect();\n});\n\nconst handleIntersect = throttle((entry: IntersectionObserverEntry) => {\n\tif (entry.isIntersecting) {\n\t\tpercentage.value = Math.trunc(entry.intersectionRatio * 100);\n\t\tif (entry.intersectionRatio === 1) {\n\t\t\tshown.value = true;\n\t\t\thidden.value = false;\n\t\t\temit('shown');\n\t\t} else {\n\t\t\tshown.value = false;\n\t\t\thidden.value = false;\n\t\t\temitIntersected(Math.trunc(entry.intersectionRatio * 100));\n\t\t}\n\t} else {\n\t\tshown.value = false;\n\t\thidden.value = true;\n\t\temit('hidden');\n\t}\n});\n\nconst emitIntersected = throttle((percentage: number) => {\n\temit('intersected', percentage);\n}, props.debounceTime);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {\n ref_key: \"infinitescrolltrigger\",\n ref: infinitescrolltrigger,\n class: \"bb-intersection\"\n }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"default\", {\n hidden: hidden.value,\n percentage: percentage.value,\n shown: shown.value\n })\n ]),\n _: 3\n }, 512))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","props","emit","observer","ref","infinitescrolltrigger","shown","hidden","percentage","onMounted","entries","handleIntersect","onBeforeUnmount","throttle","entry","emitIntersected","_ctx","_cache","_openBlock","_createBlock","_resolveDynamicComponent","_withCtx","_renderSlot"],"mappings":";;AAyBA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,EAAE;AAAA,IAC3B,SAAS,EAAE,SAAS,OAAO;AAAA,MAC7B,MAAM;AAAA,MACN,WAAW,CAAC,GAAG,KAAK,KAAK,KAAK,KAAK,CAAC;AAAA,IAAA,GAClC;AAAA,IACA,KAAK,EAAE,SAAS,MAAM;AAAA,EACxB;AAAA,EACA,OAAO,CAAC,SAAS,UAAU,aAAa;AAAA,EACxC,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAExC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AA,MAAA,CACF;AAAA,MACD,GAAG;AAAA,OACF,GAAG;AAAA,EAER;AAEA,CAAC;"}
|
package/dist/index73.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as t, openBlock as b, createBlock as c, withCtx as a, renderSlot as l, normalizeProps as n, guardReactiveProps as s, createVNode as h, mergeProps as f } from "vue";
|
|
2
2
|
import y from "./index21.js";
|
|
3
3
|
import "./index22.js";
|
|
4
|
-
import
|
|
4
|
+
import v from "./index23.js";
|
|
5
5
|
import "./index24.js";
|
|
6
|
-
const
|
|
6
|
+
const C = /* @__PURE__ */ t({
|
|
7
7
|
__name: "BbNumberInput",
|
|
8
8
|
props: {
|
|
9
9
|
autocomplete: {},
|
|
@@ -41,15 +41,15 @@ const E = /* @__PURE__ */ t({
|
|
|
41
41
|
"onUpdate:modelValue": (e) => o("update:modelValue", e)
|
|
42
42
|
};
|
|
43
43
|
return (e, k) => (b(), c(y, {
|
|
44
|
+
id: e.id,
|
|
44
45
|
class: "bb-number-input",
|
|
45
46
|
direction: e.direction,
|
|
46
47
|
errors: e.errors,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
id: e.id,
|
|
48
|
+
"has-errors": e.hasErrors,
|
|
49
|
+
"hide-label": e.hideLabel,
|
|
50
50
|
label: e.label,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
"label-position": e.labelPosition,
|
|
52
|
+
"model-value": e.modelValue,
|
|
53
53
|
name: e.name,
|
|
54
54
|
reverse: e.reverse
|
|
55
55
|
}, {
|
|
@@ -57,15 +57,15 @@ const E = /* @__PURE__ */ t({
|
|
|
57
57
|
l(e.$slots, "label", n(s(d)))
|
|
58
58
|
]),
|
|
59
59
|
input: a(({ id: d, name: u, hasErrors: m }) => [
|
|
60
|
-
h(
|
|
60
|
+
h(v, f({
|
|
61
|
+
id: d,
|
|
61
62
|
autocomplete: e.autocomplete,
|
|
62
63
|
autofocus: e.autofocus,
|
|
63
64
|
disabled: e.disabled,
|
|
64
|
-
|
|
65
|
-
id: d,
|
|
65
|
+
"has-errors": m,
|
|
66
66
|
max: e.max,
|
|
67
67
|
min: e.min,
|
|
68
|
-
|
|
68
|
+
"model-value": e.modelValue,
|
|
69
69
|
name: u,
|
|
70
70
|
placeholder: e.placeholder,
|
|
71
71
|
readonly: e.readonly,
|
|
@@ -84,13 +84,13 @@ const E = /* @__PURE__ */ t({
|
|
|
84
84
|
l(e.$slots, "prepend-outer", n(s(r)))
|
|
85
85
|
]),
|
|
86
86
|
_: 2
|
|
87
|
-
}, 1040, ["
|
|
87
|
+
}, 1040, ["id", "autocomplete", "autofocus", "disabled", "has-errors", "max", "min", "model-value", "name", "placeholder", "readonly", "step"])
|
|
88
88
|
]),
|
|
89
89
|
_: 3
|
|
90
|
-
}, 8, ["
|
|
90
|
+
}, 8, ["id", "direction", "errors", "has-errors", "hide-label", "label", "label-position", "model-value", "name", "reverse"]));
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
C as default
|
|
95
95
|
};
|
|
96
96
|
//# sourceMappingURL=index73.js.map
|
package/dist/index73.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index73.js","sources":["../src/components/BbNumberInput/BbNumberInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport BaseInputContainer from
|
|
1
|
+
{"version":3,"file":"index73.js","sources":["../src/components/BbNumberInput/BbNumberInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseNumberInput from '../BaseNumberInput/BaseNumberInput.vue';\nimport type {\n\tBaseNumberInputEvents,\n\tBaseNumberInputSlots,\n} from '../BaseNumberInput/BaseNumberInput.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BbNumberInputProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Maximum value cap\n\t */\n\tmax?: number;\n\n\t/**\n\t * Minimum value cap\n\t */\n\tmin?: number;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: number | string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Incremental unit used in the exposed `increase`\n\t * and `decrease` function. It's NOT APPLIED to manual input as a step of 5\n\t * will prevent the user from inserting a value like `115` because of rounding down.\n\t */\n\tstep?: number;\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nexport type BbNumberInputEvents = BaseNumberInputEvents;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbNumberInput',\n props: {\n autocomplete: {},\n autofocus: {},\n disabled: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n max: {},\n min: {},\n modelValue: {},\n name: {},\n placeholder: {},\n readonly: {},\n step: {},\n direction: {},\n errors: {},\n hideLabel: { type: Boolean },\n label: {},\n labelPosition: {},\n reverse: { type: Boolean }\n },\n emits: [\"blur\", \"change\", \"click\", \"decrease\", \"focus\", \"increase\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\nconst emit = __emit;\n\n\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonDecrease: (event: number) => emit('decrease', event),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonIncrease: (event: number) => emit('increase', event),\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: number | null) =>\n\t\temit('update:modelValue', value),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseInputContainer, {\n id: _ctx.id,\n class: \"bb-number-input\",\n direction: _ctx.direction,\n errors: _ctx.errors,\n \"has-errors\": _ctx.hasErrors,\n \"hide-label\": _ctx.hideLabel,\n label: _ctx.label,\n \"label-position\": _ctx.labelPosition,\n \"model-value\": _ctx.modelValue,\n name: _ctx.name,\n reverse: _ctx.reverse\n }, {\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"label\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n input: _withCtx(({ id, name, hasErrors }) => [\n _createVNode(BaseNumberInput, _mergeProps({\n id: id,\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n \"has-errors\": hasErrors,\n max: _ctx.max,\n min: _ctx.min,\n \"model-value\": _ctx.modelValue,\n name: name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly,\n step: _ctx.step\n }, eventListeners), {\n \"append-outer\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append-outer\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"prepend-outer\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend-outer\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, 1040, [\"id\", \"autocomplete\", \"autofocus\", \"disabled\", \"has-errors\", \"max\", \"min\", \"model-value\", \"name\", \"placeholder\", \"readonly\", \"step\"])\n ]),\n _: 3\n }, 8, [\"id\", \"direction\", \"errors\", \"has-errors\", \"hide-label\", \"label\", \"label-position\", \"model-value\", \"name\", \"reverse\"]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","emit","eventListeners","event","value","_ctx","_cache","_openBlock","_createBlock","BaseInputContainer","_withCtx","data","_renderSlot","_normalizeProps","_guardReactiveProps","id","name","hasErrors","_createVNode","BaseNumberInput","_mergeProps"],"mappings":";;;;;AA4GA,MAA4BA,IAAiBC,gBAAAA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AA,UACD,SAASD,EAAS,CAACC,MAAS;AAAA,YAC1BC,EAAYP,EAAK,QAAQ,WAAWQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CAC/E;AAAA,UACD,iBAAiBD,EAAS,CAACC,MAAS;AAAA,YAClCC,EAAYP,EAAK,QAAQ,iBAAiBQ,EAAgBC,EAAoBH,CAAI,CAAC,CAAC;AAAA,UAAA,CACrF;AAAA,UACD,GAAG;AAAA,QAAA,GACF,MAAM,CAAC,MAAM,gBAAgB,aAAa,YAAY,cAAc,OAAO,OAAO,eAAe,QAAQ,eAAe,YAAY,MAAM,CAAC;AAAA,MAAA,CAC/I;AAAA,MACD,GAAG;AAAA,IACF,GAAA,GAAG,CAAC,MAAM,aAAa,UAAU,cAAc,cAAc,SAAS,kBAAkB,eAAe,QAAQ,SAAS,CAAC;AAAA,EAE9H;AAEA,CAAC;"}
|
package/dist/index75.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent as q, ref as s, useAttrs as G, computed as m, onMounted as J, watch as Q, onBeforeUnmount as X, openBlock as y, createBlock as Y, Teleport as Z, createElementVNode as o, mergeProps as N, createElementBlock as w, renderSlot as l, createTextVNode as ee, toDisplayString as z, createCommentVNode as B, nextTick as te } from "vue";
|
|
2
|
-
import { useFocusTrap as oe } from "./
|
|
2
|
+
import { useFocusTrap as oe } from "./index209.js";
|
|
3
3
|
import { useId as L } from "./index7.js";
|
|
4
4
|
import { wait as O } from "./index122.js";
|
|
5
5
|
const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [
|
|
6
6
|
/* @__PURE__ */ o("svg", {
|
|
7
|
-
viewBox: "0 0 24 24",
|
|
8
7
|
fill: "none",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg"
|
|
10
10
|
}, [
|
|
11
11
|
/* @__PURE__ */ o("path", {
|
|
12
12
|
d: "M23 23L1 1M23 1L1 23",
|
|
13
13
|
stroke: "currentColor",
|
|
14
|
-
"stroke-
|
|
15
|
-
"stroke-
|
|
14
|
+
"stroke-linecap": "round",
|
|
15
|
+
"stroke-width": "2"
|
|
16
16
|
})
|
|
17
17
|
])
|
|
18
18
|
], -1), ie = /* @__PURE__ */ o("div", { style: { flex: "10000 10000 0%" } }, null, -1), fe = /* @__PURE__ */ q({
|
|
@@ -151,24 +151,24 @@ const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__c
|
|
|
151
151
|
}), [
|
|
152
152
|
v.value ? (y(), w("div", {
|
|
153
153
|
key: 0,
|
|
154
|
-
class: "bb-offcanvas__content",
|
|
155
154
|
ref_key: "content",
|
|
156
|
-
ref: S
|
|
155
|
+
ref: S,
|
|
156
|
+
class: "bb-offcanvas__content"
|
|
157
157
|
}, [
|
|
158
158
|
l(t.$slots, "content", { close: k }, () => [
|
|
159
159
|
o("div", {
|
|
160
|
-
class: "bb-offcanvas__header",
|
|
161
160
|
ref_key: "header",
|
|
162
|
-
ref: T
|
|
161
|
+
ref: T,
|
|
162
|
+
class: "bb-offcanvas__header"
|
|
163
163
|
}, [
|
|
164
164
|
l(t.$slots, "header", {
|
|
165
|
-
titleId: h,
|
|
166
165
|
close: k,
|
|
167
|
-
title: t.title
|
|
166
|
+
title: t.title,
|
|
167
|
+
titleId: h
|
|
168
168
|
}, () => [
|
|
169
169
|
o("span", {
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
id: h,
|
|
171
|
+
class: "bb-offcanvas__title"
|
|
172
172
|
}, [
|
|
173
173
|
l(t.$slots, "title", { text: t.title }, () => [
|
|
174
174
|
ee(z(t.title), 1)
|
|
@@ -177,8 +177,8 @@ const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__c
|
|
|
177
177
|
o("span", se, [
|
|
178
178
|
t.showClose ? (y(), w("button", {
|
|
179
179
|
key: 0,
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
type: "button",
|
|
181
|
+
onClick: k
|
|
182
182
|
}, [
|
|
183
183
|
l(t.$slots, "close", { text: $.value }, () => [
|
|
184
184
|
o("span", ae, [
|
|
@@ -191,9 +191,9 @@ const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__c
|
|
|
191
191
|
])
|
|
192
192
|
], 512),
|
|
193
193
|
o("div", {
|
|
194
|
-
class: "bb-offcanvas__body",
|
|
195
194
|
ref_key: "body",
|
|
196
|
-
ref: A
|
|
195
|
+
ref: A,
|
|
196
|
+
class: "bb-offcanvas__body"
|
|
197
197
|
}, [
|
|
198
198
|
l(t.$slots, "description", {
|
|
199
199
|
descriptionId: _,
|
|
@@ -209,9 +209,9 @@ const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__c
|
|
|
209
209
|
], 512),
|
|
210
210
|
ie,
|
|
211
211
|
o("div", {
|
|
212
|
-
class: "bb-offcanvas__footer",
|
|
213
212
|
ref_key: "footer",
|
|
214
|
-
ref: M
|
|
213
|
+
ref: M,
|
|
214
|
+
class: "bb-offcanvas__footer"
|
|
215
215
|
}, [
|
|
216
216
|
l(t.$slots, "footer")
|
|
217
217
|
], 512)
|