@majoo-ui/react 1.60.27-rc.1 → 1.60.27-rc.2

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.
@@ -102,14 +102,14 @@ export declare const SelectBox: import("@stitches/react/types/styled-component")
102
102
  align?: "stretch" | "center" | "end" | "start" | "baseline" | undefined;
103
103
  justify?: "center" | "end" | "start" | "between" | "evenly" | "around" | undefined;
104
104
  wrap?: "wrap" | "noWrap" | "wrapReverse" | undefined;
105
- gap?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
106
- m?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
107
- mt?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
108
- mb?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
109
- mr?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
110
- ml?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
111
- mx?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
112
- my?: 1 | 2 | "1" | "2" | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
105
+ gap?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
106
+ m?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
107
+ mt?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
108
+ mb?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
109
+ mr?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
110
+ ml?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
111
+ mx?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
112
+ my?: 1 | "1" | "2" | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | undefined;
113
113
  mobileOnly?: boolean | "true" | undefined;
114
114
  desktopOnly?: boolean | "true" | undefined;
115
115
  }, {
package/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import React__default, { useState, useEffect, useCallback, createContext, useContext, useRef, cloneElement, createElement as createElement$2, forwardRef, useLayoutEffect, Fragment as Fragment$1, useReducer, useMemo, memo } from 'react';
2
+ import React__default, { useState, useEffect, useCallback, createContext, useContext, useRef, cloneElement, createElement as createElement$2, forwardRef, useMemo, useLayoutEffect, Fragment as Fragment$1, useReducer, memo } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { createStitches, styled as styled$1 } from '@stitches/react';
5
5
  import { foundations } from '@majoo-ui/core';
@@ -14303,7 +14303,7 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
14303
14303
  }
14304
14304
  }
14305
14305
  });
14306
- const getOption = useCallback(() => maxSelectedItem ? option == null ? void 0 : option.map(item => {
14306
+ const memoOptions = useMemo(() => maxSelectedItem ? option == null ? void 0 : option.map(item => {
14307
14307
  const isMaxSelectedItem = maxSelectedItem && (selectedValue == null ? void 0 : selectedValue.length) >= maxSelectedItem;
14308
14308
  if (isMaxSelectedItem && !(selectedValue != null && selectedValue.includes(item.id))) {
14309
14309
  item.hideCheck = true;
@@ -14322,12 +14322,12 @@ const InputSelectCheck = /*#__PURE__*/forwardRef((_ref, ref) => {
14322
14322
  setItems(isShowSelectAll ? [{
14323
14323
  id: '!all',
14324
14324
  name: selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')
14325
- }, ...getOption()] : getOption());
14325
+ }, ...memoOptions] : memoOptions);
14326
14326
  setInitItems(isShowSelectAll ? [{
14327
14327
  id: '!all',
14328
14328
  name: selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')
14329
- }, ...getOption()] : getOption());
14330
- }, [isShowSelectAll, selectAllLabel, t, maxSelectedItem, option]);
14329
+ }, ...memoOptions] : memoOptions);
14330
+ }, [isShowSelectAll, selectAllLabel, t, memoOptions]);
14331
14331
  useEffect(() => {
14332
14332
  if (selectedValue.length > 0 && disabledOptions.length === 0) {
14333
14333
  setInitItems(sortValue);
package/index.umd.js CHANGED
@@ -14482,7 +14482,7 @@
14482
14482
  }
14483
14483
  }
14484
14484
  });
14485
- const getOption = React.useCallback(() => maxSelectedItem ? option == null ? void 0 : option.map(item => {
14485
+ const memoOptions = React.useMemo(() => maxSelectedItem ? option == null ? void 0 : option.map(item => {
14486
14486
  const isMaxSelectedItem = maxSelectedItem && (selectedValue == null ? void 0 : selectedValue.length) >= maxSelectedItem;
14487
14487
  if (isMaxSelectedItem && !(selectedValue != null && selectedValue.includes(item.id))) {
14488
14488
  item.hideCheck = true;
@@ -14501,12 +14501,12 @@
14501
14501
  setItems(isShowSelectAll ? [{
14502
14502
  id: '!all',
14503
14503
  name: selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')
14504
- }, ...getOption()] : getOption());
14504
+ }, ...memoOptions] : memoOptions);
14505
14505
  setInitItems(isShowSelectAll ? [{
14506
14506
  id: '!all',
14507
14507
  name: selectAllLabel != null ? selectAllLabel : t('selectAllLabelText', 'Pilih Semua')
14508
- }, ...getOption()] : getOption());
14509
- }, [isShowSelectAll, selectAllLabel, t, maxSelectedItem, option]);
14508
+ }, ...memoOptions] : memoOptions);
14509
+ }, [isShowSelectAll, selectAllLabel, t, memoOptions]);
14510
14510
  React.useEffect(() => {
14511
14511
  if (selectedValue.length > 0 && disabledOptions.length === 0) {
14512
14512
  setInitItems(sortValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.60.27-rc.1",
3
+ "version": "1.60.27-rc.2",
4
4
  "dependencies": {
5
5
  "@majoo-ui/core": "^1.31.3",
6
6
  "@majoo-ui/helpers": "^1.30.5",