@databrainhq/plugin 0.9.16 → 0.9.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/index.es.js CHANGED
@@ -7448,23 +7448,23 @@ const ExternalMetricForm = ({
7448
7448
  })]
7449
7449
  });
7450
7450
  };
7451
- const container$d = "_container_u60ky_1";
7452
- const wrapper$2 = "_wrapper_u60ky_9";
7453
- const label$4 = "_label_u60ky_17";
7454
- const noOptions = "_noOptions_u60ky_25";
7455
- const floatingLabel = "_floatingLabel_u60ky_33";
7456
- const floatingText = "_floatingText_u60ky_39";
7457
- const normalText = "_normalText_u60ky_47";
7458
- const dropdown$1 = "_dropdown_u60ky_55";
7459
- const options$1 = "_options_u60ky_63";
7460
- const checkedOption$2 = "_checkedOption_u60ky_71";
7461
- const option$1 = "_option_u60ky_63";
7462
- const icon$1 = "_icon_u60ky_87";
7463
- const text$2 = "_text_u60ky_95";
7464
- const search = "_search_u60ky_103";
7465
- const loadMore = "_loadMore_u60ky_111";
7466
- const loadMoreIcon = "_loadMoreIcon_u60ky_119";
7467
- const aboveList = "_aboveList_u60ky_127";
7451
+ const container$d = "_container_4qg98_1";
7452
+ const wrapper$2 = "_wrapper_4qg98_9";
7453
+ const label$4 = "_label_4qg98_17";
7454
+ const noOptions = "_noOptions_4qg98_25";
7455
+ const floatingLabel = "_floatingLabel_4qg98_33";
7456
+ const floatingText = "_floatingText_4qg98_41";
7457
+ const normalText = "_normalText_4qg98_49";
7458
+ const dropdown$1 = "_dropdown_4qg98_57";
7459
+ const options$1 = "_options_4qg98_65";
7460
+ const checkedOption$2 = "_checkedOption_4qg98_73";
7461
+ const option$1 = "_option_4qg98_65";
7462
+ const icon$1 = "_icon_4qg98_89";
7463
+ const text$2 = "_text_4qg98_97";
7464
+ const search = "_search_4qg98_105";
7465
+ const loadMore = "_loadMore_4qg98_113";
7466
+ const loadMoreIcon = "_loadMoreIcon_4qg98_121";
7467
+ const aboveList = "_aboveList_4qg98_129";
7468
7468
  var styles$A = {
7469
7469
  container: container$d,
7470
7470
  wrapper: wrapper$2,
@@ -8188,6 +8188,14 @@ const FloatingDropDown = ({
8188
8188
  return options2.slice(0, limit);
8189
8189
  return options2.filter((opt) => opt.label.toLowerCase().includes(searchKeyword)).slice(0, limit);
8190
8190
  }, [searchKeyword, options2, limit]);
8191
+ const trimSentence = (sentence, lenghtlimit = 20) => {
8192
+ if (!sentence)
8193
+ return false;
8194
+ if (sentence.length > lenghtlimit) {
8195
+ return `${sentence.substring(0, lenghtlimit)}...`;
8196
+ }
8197
+ return sentence;
8198
+ };
8191
8199
  return /* @__PURE__ */ jsxs("div", {
8192
8200
  className: r$4(styles$A.container, className),
8193
8201
  ref: wrapperRef,
@@ -8195,7 +8203,7 @@ const FloatingDropDown = ({
8195
8203
  variant: "span",
8196
8204
  styleClass: labelVariant === "floating" ? "custom" : "font-14",
8197
8205
  className: `${styles$A.label} ${labelVariant === "floating" ? styles$A.floatingLabel : ""}`,
8198
- children: label2
8206
+ children: trimSentence(label2, 29)
8199
8207
  }) : null, /* @__PURE__ */ jsxs(Button, {
8200
8208
  type: "button",
8201
8209
  variant: "custom",
@@ -8206,7 +8214,7 @@ const FloatingDropDown = ({
8206
8214
  variant: "p",
8207
8215
  styleClass: "font-14",
8208
8216
  className: `${styles$A.text} ${labelVariant === "floating" ? styles$A.floatingText : ""}`,
8209
- children: [icon2, selectedOption2.label || selectedOption2.value || "Select an option"]
8217
+ children: [icon2, trimSentence(selectedOption2.label) || trimSentence(selectedOption2.value) || "Select an option"]
8210
8218
  }), /* @__PURE__ */ jsx(materialSymbolsKeyboardArrowDown, {})]
8211
8219
  }), isShow && !isDisabled && /* @__PURE__ */ jsxs("div", {
8212
8220
  className: `${dropdownAbove ? styles$A.aboveList : styles$A.dropdown}`,
@@ -8228,7 +8236,7 @@ const FloatingDropDown = ({
8228
8236
  onChange(option2);
8229
8237
  setIsShow(false);
8230
8238
  },
8231
- children: option2.label
8239
+ children: trimSentence(option2.label, 25)
8232
8240
  }, option2.key || option2.value);
8233
8241
  }), limit <= options2.length && /* @__PURE__ */ jsxs(Button, {
8234
8242
  variant: "secondary",
@@ -95715,22 +95723,22 @@ var zt = function(t3) {
95715
95723
  } }]), a4;
95716
95724
  }(), $t = "input", Gt = "navigate";
95717
95725
  var reactDatepicker = "";
95718
- const datePickerContainer = "_datePickerContainer_14m8h_1";
95719
- const buttonWrapper = "_buttonWrapper_14m8h_9";
95720
- const datePickerCalendarWrapper = "_datePickerCalendarWrapper_14m8h_17";
95721
- const label$2 = "_label_14m8h_25";
95722
- const text = "_text_14m8h_33";
95723
- const button$4 = "_button_14m8h_9";
95724
- const datePickerCalContainer = "_datePickerCalContainer_14m8h_49";
95725
- const datePickerOptionsWrapper = "_datePickerOptionsWrapper_14m8h_57";
95726
- const datePickerOption = "_datePickerOption_14m8h_57";
95727
- const datePickerCalendar = "_datePickerCalendar_14m8h_17";
95728
- const datePickerCalendarHeader = "_datePickerCalendarHeader_14m8h_97";
95729
- const checkedOption = "_checkedOption_14m8h_105";
95730
- const datePickerCalFooter = "_datePickerCalFooter_14m8h_113";
95731
- const dayClassName = "_dayClassName_14m8h_121";
95732
- const datePickerSelectedWrapper = "_datePickerSelectedWrapper_14m8h_129";
95733
- const datePickerSelectedDate = "_datePickerSelectedDate_14m8h_137";
95726
+ const datePickerContainer = "_datePickerContainer_lwzws_1";
95727
+ const buttonWrapper = "_buttonWrapper_lwzws_9";
95728
+ const datePickerCalendarWrapper = "_datePickerCalendarWrapper_lwzws_17";
95729
+ const label$2 = "_label_lwzws_25";
95730
+ const text = "_text_lwzws_33";
95731
+ const button$4 = "_button_lwzws_9";
95732
+ const datePickerCalContainer = "_datePickerCalContainer_lwzws_49";
95733
+ const datePickerOptionsWrapper = "_datePickerOptionsWrapper_lwzws_57";
95734
+ const datePickerOption = "_datePickerOption_lwzws_57";
95735
+ const datePickerCalendar = "_datePickerCalendar_lwzws_17";
95736
+ const checkedOption = "_checkedOption_lwzws_81";
95737
+ const datePickerCalFooter = "_datePickerCalFooter_lwzws_89";
95738
+ const dayClassName = "_dayClassName_lwzws_97";
95739
+ const datePickerSelectedWrapper = "_datePickerSelectedWrapper_lwzws_105";
95740
+ const datePickerSelectedDate = "_datePickerSelectedDate_lwzws_113";
95741
+ const clearDateBtn = "_clearDateBtn_lwzws_121";
95734
95742
  var styles$s = {
95735
95743
  datePickerContainer,
95736
95744
  buttonWrapper,
@@ -95742,12 +95750,12 @@ var styles$s = {
95742
95750
  datePickerOptionsWrapper,
95743
95751
  datePickerOption,
95744
95752
  datePickerCalendar,
95745
- datePickerCalendarHeader,
95746
95753
  checkedOption,
95747
95754
  datePickerCalFooter,
95748
95755
  dayClassName,
95749
95756
  datePickerSelectedWrapper,
95750
- datePickerSelectedDate
95757
+ datePickerSelectedDate,
95758
+ clearDateBtn
95751
95759
  };
95752
95760
  const options = [{
95753
95761
  type: "day",
@@ -95858,6 +95866,23 @@ const DateRangePicker = ({
95858
95866
  onChange == null ? void 0 : onChange(void 0);
95859
95867
  }
95860
95868
  }, [startDate, endDate]);
95869
+ const onDateSelect = (dates) => {
95870
+ const [start2, end2] = dates;
95871
+ if (start2) {
95872
+ const startDateFormat = start2.toISOString().slice(0, 10);
95873
+ const endDateFormat = endDate == null ? void 0 : endDate.toISOString().slice(0, 10);
95874
+ setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
95875
+ setStartDate(start2);
95876
+ } else
95877
+ setStartDate(void 0);
95878
+ if (end2) {
95879
+ const endDateFormat = end2.toISOString().slice(0, 10);
95880
+ const startDateFormat = startDate == null ? void 0 : startDate.toISOString().slice(0, 10);
95881
+ setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
95882
+ setEndDate(end2);
95883
+ } else
95884
+ setEndDate(void 0);
95885
+ };
95861
95886
  return /* @__PURE__ */ jsx(Fragment, {
95862
95887
  children: /* @__PURE__ */ jsx(PopoverMenu, {
95863
95888
  position: "bottom-left",
@@ -95899,37 +95924,19 @@ const DateRangePicker = ({
95899
95924
  }, label2))
95900
95925
  }), /* @__PURE__ */ jsxs("div", {
95901
95926
  className: styles$s.datePickerCalContainer,
95902
- children: [/* @__PURE__ */ jsxs("div", {
95927
+ children: [/* @__PURE__ */ jsx("div", {
95903
95928
  className: styles$s.datePickerCalendarWrapper,
95904
- children: [/* @__PURE__ */ jsx(zt, {
95929
+ children: /* @__PURE__ */ jsx(zt, {
95905
95930
  selected: startDate,
95906
95931
  startDate,
95907
- selectsStart: true,
95908
95932
  endDate,
95909
- onChange: (date) => {
95910
- const startDateFormat = date.toISOString().slice(0, 10);
95911
- const endDateFormat = endDate == null ? void 0 : endDate.toISOString().slice(0, 10);
95912
- setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
95913
- setStartDate(date);
95914
- },
95933
+ selectsRange: true,
95934
+ monthsShown: 2,
95915
95935
  open: true,
95916
95936
  inline: true,
95937
+ onChange: onDateSelect,
95917
95938
  calendarClassName: styles$s.datePickerCalendar
95918
- }), /* @__PURE__ */ jsx(zt, {
95919
- selected: endDate,
95920
- startDate,
95921
- endDate,
95922
- selectsEnd: true,
95923
- onChange: (date) => {
95924
- const startDateFormat = startDate == null ? void 0 : startDate.toISOString().slice(0, 10);
95925
- const endDateFormat = date.toISOString().slice(0, 10);
95926
- setTimeGrainValue(`${startDateFormat} - ${endDateFormat}`);
95927
- setEndDate(date);
95928
- },
95929
- calendarClassName: styles$s.datePickerCalendar,
95930
- open: true,
95931
- inline: true
95932
- })]
95939
+ })
95933
95940
  }), /* @__PURE__ */ jsxs("div", {
95934
95941
  className: styles$s.datePickerCalFooter,
95935
95942
  children: [/* @__PURE__ */ jsxs("div", {
@@ -95941,7 +95948,7 @@ const DateRangePicker = ({
95941
95948
  children: [/* @__PURE__ */ jsx("span", {
95942
95949
  children: (startDate == null ? void 0 : startDate.getDate()) || "D"
95943
95950
  }), "/", " ", /* @__PURE__ */ jsx("span", {
95944
- children: (startDate == null ? void 0 : startDate.getMonth()) || "M"
95951
+ children: startDate ? startDate.getMonth() + 1 : "M"
95945
95952
  }), " /", " ", /* @__PURE__ */ jsx("span", {
95946
95953
  children: (startDate == null ? void 0 : startDate.getFullYear()) || "Y"
95947
95954
  })]
@@ -95950,9 +95957,9 @@ const DateRangePicker = ({
95950
95957
  styleClass: "font-14",
95951
95958
  className: styles$s.datePickerSelectedDate,
95952
95959
  children: [/* @__PURE__ */ jsx("span", {
95953
- children: (endDate == null ? void 0 : endDate.getDay()) || "D"
95960
+ children: (endDate == null ? void 0 : endDate.getDate()) || "D"
95954
95961
  }), "/", " ", /* @__PURE__ */ jsx("span", {
95955
- children: (endDate == null ? void 0 : endDate.getMonth()) || "M"
95962
+ children: endDate ? endDate.getMonth() + 1 : "M"
95956
95963
  }), " /", " ", /* @__PURE__ */ jsx("span", {
95957
95964
  children: (endDate == null ? void 0 : endDate.getFullYear()) || "Y"
95958
95965
  })]