@ironsource/shared-ui 1.4.2-rc.5 → 1.4.2-rc.6

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.
@@ -1 +1 @@
1
- .label[data-v-4888d2df]{color:#41454d}.v-enter-active[data-v-4888d2df],.v-leave-active[data-v-4888d2df]{transition:opacity .25s ease}ol[data-v-4888d2df],ul[data-v-4888d2df],menu[data-v-4888d2df]{list-style:none;margin:0;padding:0}.dropdown[data-v-4888d2df]{display:flex;flex-direction:column}.dropdown--disabled[data-v-4888d2df]{opacity:.7}.list-container[data-v-4888d2df]{padding:.5rem;max-height:13.8rem}.list-container--multi[data-v-4888d2df]{margin-bottom:0}.v-popper__arrow-container[data-v-4888d2df]{display:none}.helper-text[data-v-4888d2df]{padding-top:.25rem;color:#696a6b}.helper-text--error[data-v-4888d2df]{color:#da564f}.no-result-container[data-v-4888d2df]{height:100%;display:flex;align-items:center}.no-result[data-v-4888d2df]{color:#8e959d;padding-left:.5rem}.list[data-v-4888d2df]{outline:none;display:flex;flex-direction:column;width:100%;min-height:2rem;border-radius:.5rem}.list--multi[data-v-4888d2df]{margin-bottom:.5rem;border-bottom-left-radius:0;border-bottom-right-radius:0}.button__container[data-v-4888d2df]{display:flex;justify-content:center;flex-direction:column;position:relative}.button__container[data-v-4888d2df]:not(.button__container--disabled){cursor:pointer}.loader[data-v-4888d2df]{color:#8e959d;display:flex;height:100%;margin-left:.375rem;justify-self:center;align-items:center}.loader-icon[data-v-4888d2df]{margin-right:.25rem;display:flex}.button[data-v-4888d2df]{font-size:.875rem;line-height:1.25rem;min-width:15rem;color:#53575b;height:2rem;text-align:start;padding:.25rem .75rem;background:#F1F3F4;border-radius:.5rem;display:flex;border:none;align-items:center}.button--lg[data-v-4888d2df]{height:2.5rem}.button[data-v-4888d2df]:hover:not(.button--open):not(.button--disabled){color:#53575b;background:#EDEFF0}.button--open[data-v-4888d2df],.button[data-v-4888d2df]:focus-visible{background:linear-gradient(0deg,#3083FF 0,#3083FF 2px,#F1F3F4 0)}.image-slot[data-v-4888d2df]{margin-right:.5rem}.angle-down[data-v-4888d2df]{margin-left:auto;display:flex;color:#7b838c}.actions[data-v-4888d2df]{display:flex;width:100%;margin-left:auto;padding:.75rem 1rem;border-top:1px solid #DDDFE1;justify-content:flex-end}.actions[data-v-4888d2df]:first-child{padding-right:.25rem}.apply-button[data-v-4888d2df]{margin-left:.25rem}.dropdown-title__text[data-v-4888d2df]{color:#41454d;border-bottom:1px solid #DDDFE1;padding:1rem}.dropdown-title__search[data-v-4888d2df]{padding:3px 0;width:100%;border-bottom:1px solid #DDDFE1}
1
+ .label[data-v-12b53c10]{color:#41454d}.v-enter-active[data-v-12b53c10],.v-leave-active[data-v-12b53c10]{transition:opacity .25s ease}ol[data-v-12b53c10],ul[data-v-12b53c10],menu[data-v-12b53c10]{list-style:none;margin:0;padding:0}.dropdown[data-v-12b53c10]{display:flex;flex-direction:column}.dropdown--disabled[data-v-12b53c10]{opacity:.7}.list-container[data-v-12b53c10]{padding:.5rem}.list-container--multi[data-v-12b53c10]{margin-bottom:0}.v-popper__arrow-container[data-v-12b53c10]{display:none}.helper-text[data-v-12b53c10]{padding-top:.25rem;color:#696a6b}.helper-text--error[data-v-12b53c10]{color:#da564f}.no-result-container[data-v-12b53c10]{height:100%;display:flex;align-items:center}.no-result[data-v-12b53c10]{color:#8e959d;padding-left:.5rem}.list[data-v-12b53c10]{outline:none;display:flex;flex-direction:column;width:100%;min-height:2rem;border-radius:.5rem}.list--multi[data-v-12b53c10]{margin-bottom:.5rem;border-bottom-left-radius:0;border-bottom-right-radius:0}.button__container[data-v-12b53c10]{display:flex;justify-content:center;flex-direction:column;position:relative}.button__container[data-v-12b53c10]:not(.button__container--disabled){cursor:pointer}.loader[data-v-12b53c10]{color:#8e959d;display:flex;height:100%;margin-left:.375rem;justify-self:center;align-items:center}.loader-icon[data-v-12b53c10]{margin-right:.25rem;display:flex}.button[data-v-12b53c10]{font-size:.875rem;line-height:1.25rem;min-width:15rem;color:#53575b;height:2rem;text-align:start;padding:.25rem .75rem;background:#F1F3F4;border-radius:.5rem;display:flex;border:none;align-items:center}.button--lg[data-v-12b53c10]{height:2.5rem}.button[data-v-12b53c10]:hover:not(.button--open):not(.button--disabled){color:#53575b;background:#EDEFF0}.button--open[data-v-12b53c10],.button[data-v-12b53c10]:focus-visible{background:linear-gradient(0deg,#3083FF 0,#3083FF 2px,#F1F3F4 0)}.image-slot[data-v-12b53c10]{margin-right:.5rem}.angle-down[data-v-12b53c10]{margin-left:auto;display:flex;color:#7b838c}.actions[data-v-12b53c10]{display:flex;width:100%;margin-left:auto;padding:.75rem 1rem;border-top:1px solid #DDDFE1;justify-content:flex-end}.actions[data-v-12b53c10]:first-child{padding-right:.25rem}.apply-button[data-v-12b53c10]{margin-left:.25rem}.dropdown-title__text[data-v-12b53c10]{color:#41454d;border-bottom:1px solid #DDDFE1;padding:1rem}.dropdown-title__search[data-v-12b53c10]{padding:3px 0;width:100%;border-bottom:1px solid #DDDFE1}
@@ -11,9 +11,10 @@ import { isObjectInArray } from '../../utils/array.vue.js';
11
11
  import { objectsEqual } from '../../utils/object.vue.js';
12
12
  import { useClamp, useVirtualList, onClickOutside } from '@vueuse/core';
13
13
  import { Mode, Type, DropdownContext } from './DropdownContext.vue.js';
14
+ import { pxToRem } from '../../utils/style.vue.js';
14
15
  /* empty css *//* empty css */
15
16
  import "../../Dropdown.vue_vue_type_style_index_0_scoped_true_lang.css";import "../../Dropdown.vue_vue_type_style_index_1_lang.css";
16
- const _withScopeId = (n) => (pushScopeId("data-v-4888d2df"), n = n(), popScopeId(), n);
17
+ const _withScopeId = (n) => (pushScopeId("data-v-12b53c10"), n = n(), popScopeId(), n);
17
18
  const _hoisted_1 = ["tabindex"];
18
19
  const _hoisted_2 = ["disabled", "aria-expanded", "aria-labelledby", "aria-disabled"];
19
20
  const _hoisted_3 = {
@@ -222,13 +223,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
222
223
  );
223
224
  const hasSubtitle = computed(() => optionsIds.value[0]?.hasSubtitle);
224
225
  const isMulti = computed(() => api.mode === Mode.Multi);
226
+ const itemHeight = computed(
227
+ () => hasSubtitle.value ? MULTILINE_LIST_HEIGHT : LIST_HEIGHT
228
+ );
225
229
  const {
226
230
  list: virtualOptions,
227
231
  containerProps,
228
232
  wrapperProps,
229
233
  scrollTo
230
234
  } = useVirtualList(filteredOptions, {
231
- itemHeight: () => hasSubtitle.value ? MULTILINE_LIST_HEIGHT : LIST_HEIGHT
235
+ itemHeight: itemHeight.value
232
236
  });
233
237
  watch(
234
238
  () => props.isOpen,
@@ -506,6 +510,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
506
510
  }
507
511
  }
508
512
  };
513
+ const calculateTableHeight = computed(() => {
514
+ const MAX_NUMBER_OF_OPTIONS = 7;
515
+ const PADDING_PX = 8;
516
+ const optionsLength = virtualOptions.value.length;
517
+ const showSelectAllAddition = props.showSelectAll ? 1 : 0;
518
+ const isThereMoreOptionsThenMax = optionsLength > MAX_NUMBER_OF_OPTIONS;
519
+ const numberOfRows = optionsLength + showSelectAllAddition;
520
+ const numToCalculate = isThereMoreOptionsThenMax ? MAX_NUMBER_OF_OPTIONS + 0.5 : numberOfRows;
521
+ return pxToRem(numToCalculate * itemHeight.value + PADDING_PX);
522
+ });
509
523
  expose({
510
524
  selectItem: onSelect,
511
525
  scrollTo
@@ -569,7 +583,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
569
583
  }, [
570
584
  renderSlot(_ctx.$slots, "input-list", { open: unref(open) }, void 0, true),
571
585
  createElementVNode("div", mergeProps(unref(containerProps), {
572
- class: ["list-container", { "list-container--multi": __props.multi }]
586
+ class: ["list-container", { "list-container--multi": __props.multi }],
587
+ style: { height: `${unref(calculateTableHeight)}rem` }
573
588
  }), [
574
589
  createElementVNode("ul", mergeProps(unref(wrapperProps), {
575
590
  role: "listbox",
@@ -753,6 +768,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
753
768
  };
754
769
  }
755
770
  });
756
- var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4888d2df"]]);
771
+ var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-12b53c10"]]);
757
772
 
758
773
  export { Dropdown as default };
@@ -0,0 +1 @@
1
+ export declare const PX_TO_REM_RATIO: number;
@@ -0,0 +1,3 @@
1
+ const PX_TO_REM_RATIO = 1 / 16;
2
+
3
+ export { PX_TO_REM_RATIO };
package/index.vue.js CHANGED
@@ -1,4 +1,4 @@
1
- import './IncludeExcludeOption.vue_vue_type_style_index_0_scoped_true_lang.css';
1
+ import './Icon.vue_vue_type_style_index_0_scoped_true_lang.css';
2
2
  export { AppTriggerTypes } from './components/appTrigger/index.vue.js';
3
3
  export { AutocompleteDropdownTypes } from './components/autocompleteDropdown/index.vue.js';
4
4
  export { MenuItemTypes } from './components/menuItem/index.vue.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "1.4.2-rc.5",
3
+ "version": "1.4.2-rc.6",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -0,0 +1 @@
1
+ export declare const pxToRem: (value: number) => number;
@@ -0,0 +1,5 @@
1
+ import { PX_TO_REM_RATIO } from '../consts/style.vue.js';
2
+
3
+ const pxToRem = (value) => value * PX_TO_REM_RATIO;
4
+
5
+ export { pxToRem };