@ws-ui/roles-editor 1.13.0-dev.4 → 1.13.0-dev.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.
package/dist/index.es.js CHANGED
@@ -15185,7 +15185,7 @@ function gZ({
15185
15185
  /* @__PURE__ */ ue(
15186
15186
  np,
15187
15187
  {
15188
- defaultValue: t,
15188
+ activeTab: t,
15189
15189
  onTabChange: (h) => s(h),
15190
15190
  children: [
15191
15191
  /* @__PURE__ */ I(
@@ -32686,25 +32686,29 @@ const vS = xr(null), yle = () => ({
32686
32686
  host: n,
32687
32687
  onSetTabFlags: i,
32688
32688
  history: o,
32689
- initialState: a
32689
+ selectedTab: a,
32690
+ onTabChange: s,
32691
+ initialState: c
32690
32692
  }) => {
32691
- const [s, c] = Dl(ble, {
32693
+ const [d, u] = Dl(ble, {
32692
32694
  ...yle(),
32693
- ...a
32694
- }), d = Re(
32695
+ ...c
32696
+ }), h = Re(
32695
32697
  () => t ? XV(t) : null,
32696
32698
  [t]
32697
- ), u = Re(
32699
+ ), p = Re(
32698
32700
  () => ({
32699
- catalog: d,
32701
+ catalog: h,
32700
32702
  qodly: r,
32701
32703
  host: n,
32702
32704
  onSetTabFlags: i,
32703
- history: o
32705
+ history: o,
32706
+ selectedTab: a,
32707
+ onTabChange: s
32704
32708
  }),
32705
- [d, r, n, i, o]
32709
+ [h, r, n, i, o, a, s]
32706
32710
  );
32707
- return /* @__PURE__ */ I(vS.Provider, { value: { state: s, dispatch: c, external: u }, children: e });
32711
+ return /* @__PURE__ */ I(vS.Provider, { value: { state: d, dispatch: u, external: p }, children: e });
32708
32712
  };
32709
32713
  function xle() {
32710
32714
  var s, c, d, u;
@@ -32752,7 +32756,10 @@ function xle() {
32752
32756
  ),
32753
32757
  getCatalog: me(() => n.catalog ?? null, [n.catalog]),
32754
32758
  getQodly: me(() => n.qodly ?? !1, [n.qodly]),
32755
- getSelectedTab: me(() => t.selectedTab, [t.selectedTab]),
32759
+ getSelectedTab: me(
32760
+ () => n.selectedTab ?? t.selectedTab,
32761
+ [n.selectedTab, t.selectedTab]
32762
+ ),
32756
32763
  getForceLogin: me(
32757
32764
  () => t.forceLogin ?? !1,
32758
32765
  [t.forceLogin]
@@ -32824,9 +32831,12 @@ function xle() {
32824
32831
  },
32825
32832
  []
32826
32833
  ),
32827
- toggleTab: me((h) => {
32828
- r({ type: "TOGGLE_TAB", payload: h });
32829
- }, []),
32834
+ toggleTab: me(
32835
+ (h) => {
32836
+ n.onTabChange && n.onTabChange(h), n.selectedTab === void 0 && r({ type: "TOGGLE_TAB", payload: h });
32837
+ },
32838
+ [n.onTabChange, n.selectedTab]
32839
+ ),
32830
32840
  toggleForceLogin: me(
32831
32841
  (h) => {
32832
32842
  a.markEdit(), r({ type: "TOGGLE_FORCE_LOGIN", payload: h });
@@ -38003,14 +38013,20 @@ const W7 = (e) => {
38003
38013
  /* @__PURE__ */ I(Mi, { className: "mr-2 mt-0.5 h-4 w-4 shrink-0" }),
38004
38014
  /* @__PURE__ */ ue("p", { className: "flex flex-col gap-y-2", children: [
38005
38015
  /* @__PURE__ */ I("span", { className: "mr-1", children: "Permission inherited from:" }),
38006
- /* @__PURE__ */ I("ul", { children: c.from.map((u) => /* @__PURE__ */ I(
38007
- "li",
38008
- {
38009
- className: "cursor-pointer list-disc font-bold hover:underline",
38010
- onClick: () => n(o[u].id),
38011
- children: o[u].privilege
38012
- }
38013
- )) })
38016
+ /* @__PURE__ */ I("ul", { children: c.from.map((u) => {
38017
+ var h;
38018
+ return /* @__PURE__ */ I(
38019
+ "li",
38020
+ {
38021
+ className: "cursor-pointer list-disc font-bold hover:underline",
38022
+ onClick: () => {
38023
+ var p;
38024
+ return n((p = o[u]) == null ? void 0 : p.id);
38025
+ },
38026
+ children: (h = o[u]) == null ? void 0 : h.privilege
38027
+ }
38028
+ );
38029
+ }) })
38014
38030
  ] })
38015
38031
  ] }) : null,
38016
38032
  c.info && /* @__PURE__ */ ue("div", { className: "flex items-start", children: [
@@ -38031,14 +38047,20 @@ const W7 = (e) => {
38031
38047
  /* @__PURE__ */ I($1, { className: "mr-2 mt-0.5 h-4 w-4 shrink-0" }),
38032
38048
  /* @__PURE__ */ ue("p", { children: [
38033
38049
  /* @__PURE__ */ I("span", { className: "mr-1", children: "Function is promoted with: " }),
38034
- i == null ? void 0 : i.map((u) => /* @__PURE__ */ I(
38035
- "li",
38036
- {
38037
- className: "cursor-pointer list-disc font-bold hover:underline",
38038
- onClick: () => n(o[u].id),
38039
- children: o[u].privilege
38040
- }
38041
- ))
38050
+ i == null ? void 0 : i.map((u) => {
38051
+ var h;
38052
+ return /* @__PURE__ */ I(
38053
+ "li",
38054
+ {
38055
+ className: "cursor-pointer list-disc font-bold hover:underline",
38056
+ onClick: () => {
38057
+ var p;
38058
+ return n((p = o[u]) == null ? void 0 : p.id);
38059
+ },
38060
+ children: (h = o[u]) == null ? void 0 : h.privilege
38061
+ }
38062
+ );
38063
+ })
38042
38064
  ] })
38043
38065
  ] }) }),
38044
38066
  children: /* @__PURE__ */ I(KH, { className: "h-3 w-3 " })
@@ -40163,9 +40185,11 @@ const Kue = ({ selectedRole: e }) => {
40163
40185
  initialValue: e,
40164
40186
  catalog: t,
40165
40187
  history: r,
40166
- ...n
40188
+ activeTab: n,
40189
+ onTabChange: i,
40190
+ ...o
40167
40191
  }) => {
40168
- const i = Re(
40192
+ const a = Re(
40169
40193
  () => ({
40170
40194
  ...Mo(G7(e)),
40171
40195
  flags: { touched: !1 }
@@ -40175,10 +40199,12 @@ const Kue = ({ selectedRole: e }) => {
40175
40199
  return /* @__PURE__ */ I(
40176
40200
  wle,
40177
40201
  {
40178
- initialState: i,
40202
+ initialState: a,
40179
40203
  catalog: t,
40180
40204
  history: r,
40181
- children: /* @__PURE__ */ I(ide, { initialValue: e, ...n })
40205
+ selectedTab: n,
40206
+ onTabChange: i,
40207
+ children: /* @__PURE__ */ I(ide, { initialValue: e, ...o })
40182
40208
  }
40183
40209
  );
40184
40210
  };