@blocklet/labels 1.6.38 → 1.6.39

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
@@ -782,7 +782,8 @@ function GithubLabelPicker({
782
782
  buttonSx,
783
783
  actions,
784
784
  trigger,
785
- multiple = true
785
+ multiple = true,
786
+ updateImmediately = true
786
787
  }) {
787
788
  const { locale } = useLocaleContext();
788
789
  const { flattenedLabels: labels, getLabelsByIds, loading, createLabel } = LabelsContainer.useContainer();
@@ -910,6 +911,8 @@ function GithubLabelPicker({
910
911
  if (!multiple) {
911
912
  onChange == null ? void 0 : onChange(newValue.length ? [newValue[newValue.length - 1].data.id] : []);
912
913
  setAnchorEl(null);
914
+ } else if (updateImmediately) {
915
+ onChange(newValue.map((x) => x.data.id));
913
916
  }
914
917
  },
915
918
  disableCloseOnSelect: true,
package/dist/index.umd.js CHANGED
@@ -770,7 +770,8 @@ var __publicField = (obj, key, value) => {
770
770
  buttonSx,
771
771
  actions,
772
772
  trigger,
773
- multiple = true
773
+ multiple = true,
774
+ updateImmediately = true
774
775
  }) {
775
776
  const { locale } = context.useLocaleContext();
776
777
  const { flattenedLabels: labels, getLabelsByIds, loading, createLabel } = LabelsContainer.useContainer();
@@ -898,6 +899,8 @@ var __publicField = (obj, key, value) => {
898
899
  if (!multiple) {
899
900
  onChange == null ? void 0 : onChange(newValue.length ? [newValue[newValue.length - 1].data.id] : []);
900
901
  setAnchorEl(null);
902
+ } else if (updateImmediately) {
903
+ onChange(newValue.map((x) => x.data.id));
901
904
  }
902
905
  },
903
906
  disableCloseOnSelect: true,
@@ -9,5 +9,6 @@ export interface GithubLabelPickerProps {
9
9
  actions?: React.ReactNode;
10
10
  trigger?: React.ReactNode;
11
11
  multiple?: boolean;
12
+ updateImmediately?: boolean;
12
13
  }
13
- export declare function GithubLabelPicker({ value, onChange, title, noLabelsText, buttonSx, actions, trigger, multiple, }: GithubLabelPickerProps): import("react/jsx-runtime").JSX.Element | null;
14
+ export declare function GithubLabelPicker({ value, onChange, title, noLabelsText, buttonSx, actions, trigger, multiple, updateImmediately, }: GithubLabelPickerProps): import("react/jsx-runtime").JSX.Element | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/labels",
3
- "version": "1.6.38",
3
+ "version": "1.6.39",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -28,7 +28,7 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@blocklet/translation-input": "1.6.38",
31
+ "@blocklet/translation-input": "1.6.39",
32
32
  "@emotion/css": "^11.10.5",
33
33
  "@emotion/react": "^11.10.5",
34
34
  "@emotion/styled": "^11.10.5",
@@ -80,5 +80,5 @@
80
80
  "resolutions": {
81
81
  "react": "^18.2.0"
82
82
  },
83
- "gitHead": "599f0830fa7eeb12dd82873d121dee1a054e2d6f"
83
+ "gitHead": "959f1f5cb088c8a2644ecf9bf5ef3d7e52e3b119"
84
84
  }