arengibook 2.4.575 → 2.4.577

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.
Files changed (2) hide show
  1. package/dist/index.js +85 -27
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35802,7 +35802,7 @@ var Dropdown = function Dropdown(_ref) {
35802
35802
  var _ref$options = _ref.options,
35803
35803
  options = _ref$options === void 0 ? [] : _ref$options,
35804
35804
  _ref$isGroupedOption = _ref.isGroupedOption,
35805
- isGroupedOption = _ref$isGroupedOption === void 0 ? false : _ref$isGroupedOption,
35805
+ isGroupedOption = _ref$isGroupedOption === void 0 ? true : _ref$isGroupedOption,
35806
35806
  value = _ref.value,
35807
35807
  _ref$placeholder = _ref.placeholder,
35808
35808
  placeholder = _ref$placeholder === void 0 ? 'Sélectionnez une option' : _ref$placeholder,
@@ -35827,18 +35827,12 @@ var Dropdown = function Dropdown(_ref) {
35827
35827
  showClear = _ref$showClear === void 0 ? false : _ref$showClear,
35828
35828
  _ref$groupedItemTempl = _ref.groupedItemTemplateConfig,
35829
35829
  groupedItemTemplateConfig = _ref$groupedItemTempl === void 0 ? {
35830
- showIcon: true,
35830
+ showIcon: false,
35831
35831
  iconKey: 'icon',
35832
- showImage: true,
35832
+ showImage: false,
35833
35833
  imageKey: 'image',
35834
- imageStyle: {
35835
- width: '18px',
35836
- marginRight: '0.5rem'
35837
- },
35838
- labelStyle: {
35839
- color: '#374151',
35840
- fontSize: '14px'
35841
- },
35834
+ imageStyle: null,
35835
+ labelStyle: null,
35842
35836
  generalIcon: null,
35843
35837
  generalImage: null
35844
35838
  } : _ref$groupedItemTempl;
@@ -35901,7 +35895,7 @@ var Dropdown = function Dropdown(_ref) {
35901
35895
  };
35902
35896
  });
35903
35897
  };
35904
- var finalOptions = isGroupedOption ? formatGroupedOptions(options) : options;
35898
+ isGroupedOption ? formatGroupedOptions(options) : options;
35905
35899
  var groupedItemTemplate = function groupedItemTemplate(option) {
35906
35900
  var _ref6 = groupedItemTemplateConfig || {},
35907
35901
  showImage = _ref6.showImage,
@@ -35912,21 +35906,44 @@ var Dropdown = function Dropdown(_ref) {
35912
35906
  labelStyle = _ref6.labelStyle,
35913
35907
  generalIcon = _ref6.generalIcon,
35914
35908
  generalImage = _ref6.generalImage;
35915
- console.log(option);
35916
- console.log(generalImage);
35917
- console.log(generalIcon);
35918
- console.log(option[imageKey]);
35909
+ var icon = option.value && option.value[iconKey];
35910
+ if (generalIcon || generalIcon || showImage && option[imageKey] || showIcon && icon) {
35911
+ var styleLabel = {
35912
+ 'marginLeft': '10px'
35913
+ };
35914
+ }
35919
35915
  if (option.group) {
35920
35916
  return /*#__PURE__*/React__default.createElement("div", {
35921
35917
  className: "flex align-items-center"
35922
35918
  }, /*#__PURE__*/React__default.createElement("div", {
35923
35919
  style: _objectSpread2({
35924
- fontSize: '11px',
35920
+ fontSize: '15px',
35925
35921
  fontWeight: 'bold'
35926
35922
  }, labelStyle)
35927
- }, option.label));
35923
+ }, generalIcon && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("i", {
35924
+ className: generalIcon
35925
+ })), generalImage && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("img", {
35926
+ alt: "General",
35927
+ src: generalImage,
35928
+ style: imageStyle || {
35929
+ width: '18px',
35930
+ marginRight: '0.5rem'
35931
+ },
35932
+ className: "mr-2"
35933
+ })), showImage && option[imageKey] && /*#__PURE__*/React__default.createElement("img", {
35934
+ alt: option.label,
35935
+ src: option[imageKey],
35936
+ style: imageStyle || {
35937
+ width: '18px',
35938
+ marginRight: '0.5rem'
35939
+ },
35940
+ className: "mr-2"
35941
+ }), showIcon && icon && /*#__PURE__*/React__default.createElement("i", {
35942
+ className: 'mr-2 ' + icon
35943
+ }), /*#__PURE__*/React__default.createElement("span", {
35944
+ style: styleLabel
35945
+ }, option.label)));
35928
35946
  }
35929
- var icon = option.value && option.value[iconKey];
35930
35947
  return /*#__PURE__*/React__default.createElement("div", {
35931
35948
  className: "flex align-items-center"
35932
35949
  }, generalImage && /*#__PURE__*/React__default.createElement("img", {
@@ -35951,13 +35968,15 @@ var Dropdown = function Dropdown(_ref) {
35951
35968
  className: 'mr-2 ' + icon
35952
35969
  }), /*#__PURE__*/React__default.createElement("div", {
35953
35970
  style: _objectSpread2({}, labelStyle)
35954
- }, option.label));
35971
+ }, /*#__PURE__*/React__default.createElement("span", {
35972
+ style: styleLabel
35973
+ }, option.label)));
35955
35974
  };
35956
35975
  return /*#__PURE__*/React__default.createElement("div", {
35957
35976
  className: "flex flex-col gap-1"
35958
35977
  }, /*#__PURE__*/React__default.createElement(Dropdown$1, _extends$A({
35959
35978
  value: optionSelected,
35960
- options: finalOptions,
35979
+ options: options,
35961
35980
  onChange: function onChange(e) {
35962
35981
  return setOptionSelected(e.value);
35963
35982
  },
@@ -35988,14 +36007,53 @@ var Dropdown = function Dropdown(_ref) {
35988
36007
  };
35989
36008
 
35990
36009
  var optionsExample = [{
35991
- label: 'Option 1',
35992
- value: '1'
36010
+ label: 'Germany',
36011
+ code: 'DE',
36012
+ items: [{
36013
+ label: 'Berlin',
36014
+ value: 'Berlin'
36015
+ }, {
36016
+ label: 'Frankfurt',
36017
+ value: 'Frankfurt'
36018
+ }, {
36019
+ label: 'Hamburg',
36020
+ value: 'Hamburg'
36021
+ }, {
36022
+ label: 'Munich',
36023
+ value: 'Munich'
36024
+ }]
35993
36025
  }, {
35994
- label: 'Option 2',
35995
- value: '2'
36026
+ label: 'USA',
36027
+ code: 'US',
36028
+ items: [{
36029
+ label: 'Chicago',
36030
+ value: 'Chicago'
36031
+ }, {
36032
+ label: 'Los Angeles',
36033
+ value: 'Los Angeles'
36034
+ }, {
36035
+ label: 'New York',
36036
+ value: 'New York'
36037
+ }, {
36038
+ label: 'San Francisco',
36039
+ value: 'San Francisco'
36040
+ }]
35996
36041
  }, {
35997
- label: 'Option 3',
35998
- value: '3'
36042
+ label: 'Japan',
36043
+ code: 'JP',
36044
+ items: [{
36045
+ label: 'Kyoto',
36046
+ value: 'Kyoto'
36047
+ }, {
36048
+ label: 'Osaka',
36049
+ value: 'Osaka'
36050
+ }, {
36051
+ label: 'Tokyo',
36052
+ value: 'Tokyo'
36053
+ }, {
36054
+ label: 'Yokohama',
36055
+ value: 'Yokohama'
36056
+ }]
35999
36057
  }];
36000
36058
  var DropdownPresets = {
36001
36059
  Default: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "arengibook",
3
3
  "private": false,
4
- "version": "2.4.575",
4
+ "version": "2.4.577",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
7
7
  "exports": {