@nice2dev/ui 1.3.14 → 1.3.16
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/CHANGELOG.md +39 -0
- package/dist/{NiceDataGrid-BTtrpB6P.cjs → NiceDataGrid-aNPAHsWy.cjs} +1 -1
- package/dist/NiceForm-BtRBLffD.cjs +1 -0
- package/dist/{NiceMention-CUl3myJg.cjs → NiceMention-CMqAGvO0.cjs} +1 -1
- package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +1 -0
- package/dist/{NicePagination-CKsAP38Q.cjs → NicePagination-D7XxeNFz.cjs} +1 -1
- package/dist/{NiceSavedQueryPanel-CpGjsyhc.cjs → NiceSavedQueryPanel-JHrSlHAV.cjs} +1 -1
- package/dist/{NiceScheduler-Dwym4RVa.cjs → NiceScheduler-2TwOZq-y.cjs} +1 -1
- package/dist/{core-lazy-Bwdr6Kcl.cjs → core-lazy-Cda-D35m.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/display/NiceProgress.mjs +1 -1
- package/dist/editors/inputs/NiceNumberInput.mjs +27 -27
- package/dist/editors/inputs/NicePasswordInput.mjs +20 -19
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +53 -53
- package/dist/index.d.ts +50 -14
- package/dist/lazy.cjs +1 -1
- package/dist/navigation/NiceCard.mjs +66 -62
- package/dist/navigation/NiceFirstRunPreferences.mjs +55 -54
- package/dist/navigation/NiceNavShell.mjs +429 -429
- package/dist/navigation/NiceSetupWizard.mjs +333 -317
- package/dist/navigation/NiceSidebarNav.mjs +1111 -1039
- package/dist/navigation/menuBuilderModel.mjs +1 -1
- package/dist/navigation/sidebarColors.mjs +67 -39
- package/dist/navigation/sidebarNavTypes.mjs +16 -14
- package/dist/navigation/sidebarPrefs/NiceSidebarPrefsDisplay.mjs +120 -42
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +34 -6
- package/dist/{no-code-BQqK8mvU.cjs → no-code-B3BHeyG-.cjs} +1 -1
- package/dist/no-code.cjs +1 -1
- package/dist/style.css +2 -2
- package/package.json +5 -5
- package/dist/NiceForm-Cl5syDvY.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-DZHj2xTn.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -9186,6 +9186,8 @@ export declare interface NiceCardProps extends NiceBaseProps {
|
|
|
9186
9186
|
children: default_2.ReactNode;
|
|
9187
9187
|
/** Header title text. */
|
|
9188
9188
|
title?: string;
|
|
9189
|
+
/** Icon before the title in the header (e.g. `<NtdDatabase />`), sized to the title's font. */
|
|
9190
|
+
icon?: default_2.ReactNode;
|
|
9189
9191
|
/** Extra element rendered at the right side of the header (actions, badges, etc.). */
|
|
9190
9192
|
headerExtra?: default_2.ReactNode;
|
|
9191
9193
|
/** Footer content. */
|
|
@@ -13630,8 +13632,11 @@ export declare interface NiceFirstRunValues {
|
|
|
13630
13632
|
language?: string;
|
|
13631
13633
|
/** The menu folded to icons. */
|
|
13632
13634
|
collapsed?: boolean;
|
|
13633
|
-
/**
|
|
13634
|
-
|
|
13635
|
+
/**
|
|
13636
|
+
* How the menu shows colour: the theme's shades (`'theme'`, the default since 1.3.16), plus a bar
|
|
13637
|
+
* by each item in its branch colour, or whole items filled.
|
|
13638
|
+
*/
|
|
13639
|
+
colorStyle?: SidebarNavColorStyle;
|
|
13635
13640
|
}
|
|
13636
13641
|
|
|
13637
13642
|
/**
|
|
@@ -17691,11 +17696,12 @@ export declare interface NiceNavShellProps {
|
|
|
17691
17696
|
tabColors?: NiceNavShellTabColors;
|
|
17692
17697
|
/**
|
|
17693
17698
|
* How a tab shows its colour (1.3.3): `'bar'` — a line under the tab, `'fill'` — a tint with a
|
|
17694
|
-
* bar along the top.
|
|
17695
|
-
* `
|
|
17696
|
-
*
|
|
17699
|
+
* bar along the top, `'theme'` (1.3.16) — no colour, the theme's tabs. Absent: the sidebar's
|
|
17700
|
+
* `colorStyle` preference (Preferences → Display) of `sidebarUserId` (default `'theme'`), so the
|
|
17701
|
+
* tabs follow the user's choice. Pass it when your own `sidebar` keeps its preferences elsewhere
|
|
17702
|
+
* (e.g. on the server).
|
|
17697
17703
|
*/
|
|
17698
|
-
colorStyle?:
|
|
17704
|
+
colorStyle?: SidebarNavColorStyle;
|
|
17699
17705
|
/** Extra props for the built-in NiceSidebarNav (rendered from `sidebarData`), e.g. `levelColors`. */
|
|
17700
17706
|
sidebarProps?: Partial<NiceSidebarNavProps>;
|
|
17701
17707
|
/**
|
|
@@ -28072,6 +28078,11 @@ export declare interface SetupWizardStep {
|
|
|
28072
28078
|
* The step that completes the wizard (1.3.14). When any step is `final`, only such a step calls
|
|
28073
28079
|
* `onComplete`; every other one — the last one in view included — goes on to its `nextStep`
|
|
28074
28080
|
* (or the next one) with `labels.next`. Without any `final` step, the last step completes.
|
|
28081
|
+
*
|
|
28082
|
+
* `false` (1.3.16): this step never completes, even while it is the only one or the last one in
|
|
28083
|
+
* view — for steps the host adds after it (a first choice that decides every step after it). Its
|
|
28084
|
+
* main button reads `labels.next`; pressed before the next step exists (e.g. the host adds the
|
|
28085
|
+
* steps in `validate`), the wizard moves on as soon as that step arrives.
|
|
28075
28086
|
*/
|
|
28076
28087
|
final?: boolean;
|
|
28077
28088
|
}
|
|
@@ -28150,6 +28161,9 @@ export declare interface SidebarNavBranchColors {
|
|
|
28150
28161
|
levelColors?: string[];
|
|
28151
28162
|
}
|
|
28152
28163
|
|
|
28164
|
+
/** How the sidebar tree and NavShell's tabs show colour — see {@link SidebarNavUserPrefs.colorStyle}. */
|
|
28165
|
+
export declare type SidebarNavColorStyle = 'theme' | 'bar' | 'fill';
|
|
28166
|
+
|
|
28153
28167
|
/**
|
|
28154
28168
|
* Top-level data node: one data source with all its navigation children.
|
|
28155
28169
|
* modules → used in 'all' mode (depth: source → module → view → …)
|
|
@@ -28241,8 +28255,12 @@ export declare interface SidebarNavHelpers {
|
|
|
28241
28255
|
setLeftClickBehavior: (v: 'focus-existing' | 'open-new') => void;
|
|
28242
28256
|
/** Replace the per-mode ordering of item ids. Pass `null` to clear (revert to data-defined order). */
|
|
28243
28257
|
reorderItems: (mode: SidebarNavMode, orderedIds: string[] | null) => void;
|
|
28244
|
-
/** How
|
|
28245
|
-
setColorStyle: (v:
|
|
28258
|
+
/** How the tree shows colour: the theme's shades (default), plus branch bars, or filled rows. */
|
|
28259
|
+
setColorStyle: (v: SidebarNavColorStyle) => void;
|
|
28260
|
+
/** A step per level (default) or no indentation (1.3.16). */
|
|
28261
|
+
setIndent: (v: SidebarNavUserPrefs['indent']) => void;
|
|
28262
|
+
/** What stays in view while the tree scrolls (1.3.16). */
|
|
28263
|
+
setStickyHeaders: (v: SidebarNavUserPrefs['stickyHeaders']) => void;
|
|
28246
28264
|
/** How NiceNavShell opens pages: automatically, one at a time or in tabs (1.3.4). */
|
|
28247
28265
|
setPageMode: (v: NiceNavShellPageMode) => void;
|
|
28248
28266
|
/**
|
|
@@ -28394,16 +28412,34 @@ export declare interface SidebarNavUserPrefs {
|
|
|
28394
28412
|
*/
|
|
28395
28413
|
itemOrder: Partial<Record<SidebarNavMode, string[]>>;
|
|
28396
28414
|
/**
|
|
28397
|
-
* How
|
|
28398
|
-
* - `'
|
|
28399
|
-
*
|
|
28400
|
-
*
|
|
28401
|
-
*
|
|
28415
|
+
* How the tree is coloured (1.3.3; `'theme'` and the default since 1.3.16):
|
|
28416
|
+
* - `'theme'` (default): the theme's colours, shaded by level — the source header in the
|
|
28417
|
+
* primary, each level under it lighter, pages a faint tint of their level; a theme's
|
|
28418
|
+
* `nesting.sidebar` or the sidebar's `levelColors` replaces the shades. Branch colours (e.g.
|
|
28419
|
+
* databases) paint nothing, and NavShell's tabs stay uncoloured;
|
|
28420
|
+
* - `'bar'`: the same shades, plus a branch's colour as a bar on the left edge of its rows and
|
|
28421
|
+
* NavShell's tabs underlined in it;
|
|
28422
|
+
* - `'fill'`: rows filled with the level / branch colours (text picked for contrast), and the
|
|
28423
|
+
* tabs tinted with a bar along the top — the look of 1.3.2.
|
|
28402
28424
|
*
|
|
28403
28425
|
* Set from the Display page of the preferences; `preferences={{ colorStyle: 'fill' }}` makes
|
|
28404
28426
|
* `'fill'` the default.
|
|
28405
28427
|
*/
|
|
28406
|
-
colorStyle:
|
|
28428
|
+
colorStyle: SidebarNavColorStyle;
|
|
28429
|
+
/**
|
|
28430
|
+
* Indentation of the tree (1.3.16): `'steps'` (default) — a step per level; `'none'` — every
|
|
28431
|
+
* level starts at the same place and the shades alone show the level.
|
|
28432
|
+
*/
|
|
28433
|
+
indent: 'steps' | 'none';
|
|
28434
|
+
/**
|
|
28435
|
+
* What stays in view while the tree scrolls (1.3.16):
|
|
28436
|
+
* - `'path'` (default): the source header above the tree, outside its scroll area (the
|
|
28437
|
+
* scrollbar starts a level lower), and the headers above the first visible row stuck under it,
|
|
28438
|
+
* one per level;
|
|
28439
|
+
* - `'root'`: only the source header stays;
|
|
28440
|
+
* - `'none'`: everything scrolls — the most room on a short screen.
|
|
28441
|
+
*/
|
|
28442
|
+
stickyHeaders: 'path' | 'root' | 'none';
|
|
28407
28443
|
/**
|
|
28408
28444
|
* How NiceNavShell opens pages when it offers tabs (`tabsMode="enabled"`, 1.3.4):
|
|
28409
28445
|
* - `'auto'` (default): in tabs in an installed app (a window of its own, no browser tab strip),
|
package/dist/lazy.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),n=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitGraph$1).then(e=>({default:e.NiceGitGraph}))),o=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceBranchManager$1).then(e=>({default:e.NiceBranchManager}))),l=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitDiffViewer$1).then(e=>({default:e.NiceGitDiffViewer}))),s=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitBlame$1).then(e=>({default:e.NiceGitBlame}))),h=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitConflictResolver$1).then(e=>({default:e.NiceGitConflictResolver}))),c=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineEditor$1).then(e=>({default:e.NicePipelineEditor}))),y=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineMonitor$1).then(e=>({default:e.NicePipelineMonitor}))),u=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitHooks$1).then(e=>({default:e.NiceGitHooks}))),z=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceMergeRequestBuilder$1).then(e=>({default:e.NiceMergeRequestBuilder}))),d=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),n=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitGraph$1).then(e=>({default:e.NiceGitGraph}))),o=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceBranchManager$1).then(e=>({default:e.NiceBranchManager}))),l=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitDiffViewer$1).then(e=>({default:e.NiceGitDiffViewer}))),s=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitBlame$1).then(e=>({default:e.NiceGitBlame}))),h=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitConflictResolver$1).then(e=>({default:e.NiceGitConflictResolver}))),c=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineEditor$1).then(e=>({default:e.NicePipelineEditor}))),y=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NicePipelineMonitor$1).then(e=>({default:e.NicePipelineMonitor}))),u=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceGitHooks$1).then(e=>({default:e.NiceGitHooks}))),z=a.lazy(()=>Promise.resolve().then(()=>require("./devops-cgRBnZVX.cjs")).then(e=>e.NiceMergeRequestBuilder$1).then(e=>({default:e.NiceMergeRequestBuilder}))),d=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceAPIFlow$1).then(e=>({default:e.NiceAPIFlow}))),f=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceCodeTemplate$1).then(e=>({default:e.NiceCodeTemplate}))),N=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceDataMapper$1).then(e=>({default:e.NiceDataMapper}))),L=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceEventOrchestrator$1).then(e=>({default:e.NiceEventOrchestrator}))),p=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceStateDesigner$1).then(e=>({default:e.NiceStateDesigner}))),v=a.lazy(()=>Promise.resolve().then(()=>require("./no-code-B3BHeyG-.cjs")).then(e=>e.NiceTestBuilder$1).then(e=>({default:e.NiceTestBuilder}))),D=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchManager$1).then(e=>({default:e.NiceDataBranchManager}))),P=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataDiffViewer$1).then(e=>({default:e.NiceDataDiffViewer}))),m=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataBranchGraph$1).then(e=>({default:e.NiceDataBranchGraph}))),q=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataMergeBuilder$1).then(e=>({default:e.NiceDataMergeBuilder}))),B=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataConflictResolver$1).then(e=>({default:e.NiceDataConflictResolver}))),M=a.lazy(()=>Promise.resolve().then(()=>require("./data-branching-7rpktFJ-.cjs")).then(e=>e.NiceDataSnapshot$1).then(e=>({default:e.NiceDataSnapshot}))),G=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceChart$1).then(e=>({default:e.NiceChart}))),g=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceTreeMap$1).then(e=>({default:e.NiceTreeMap}))),$=a.lazy(()=>Promise.resolve().then(()=>require("./charts-B0tHOpJ7.cjs")).then(e=>e.NiceSankey$1).then(e=>({default:e.NiceSankey}))),t=()=>{Promise.resolve().then(()=>require("./devops.cjs"))},r=()=>{Promise.resolve().then(()=>require("./no-code.cjs"))},i=()=>{Promise.resolve().then(()=>require("./data-branching.cjs"))},C=()=>{"requestIdleCallback"in window?requestIdleCallback(()=>{t(),r(),i()}):setTimeout(()=>{t(),r(),i()},2e3)};exports.LazyAPIFlow=d;exports.LazyBranchManager=o;exports.LazyChart=G;exports.LazyCodeTemplate=f;exports.LazyDataBranchGraph=m;exports.LazyDataBranchManager=D;exports.LazyDataConflictResolver=B;exports.LazyDataDiffViewer=P;exports.LazyDataMapper=N;exports.LazyDataMergeBuilder=q;exports.LazyDataSnapshot=M;exports.LazyEventOrchestrator=L;exports.LazyGitBlame=s;exports.LazyGitConflictResolver=h;exports.LazyGitDiffViewer=l;exports.LazyGitGraph=n;exports.LazyGitHooks=u;exports.LazyMergeRequestBuilder=z;exports.LazyPipelineEditor=c;exports.LazyPipelineMonitor=y;exports.LazySankey=$;exports.LazyStateDesigner=p;exports.LazyTestBuilder=v;exports.LazyTreemap=g;exports.preloadDataBranching=i;exports.preloadDevOps=t;exports.preloadHeavyModules=C;exports.preloadNoCode=r;
|
|
@@ -1,83 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useComponentDisplayStyle as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import { jsxs as _, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useComponentDisplayStyle as V, useComponentDisplayClass as X } from "@nice2dev/ui-core";
|
|
3
|
+
import t from "react";
|
|
4
|
+
const Y = /* @__PURE__ */ t.createContext(null), Z = /* @__PURE__ */ t.createContext(null), re = ({
|
|
5
5
|
children: y,
|
|
6
|
-
title:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
title: s,
|
|
7
|
+
icon: d,
|
|
8
|
+
headerExtra: v,
|
|
9
|
+
footer: N,
|
|
10
|
+
hoverable: w,
|
|
11
|
+
bordered: D = !0,
|
|
12
|
+
onClick: o,
|
|
13
|
+
selectable: z,
|
|
13
14
|
selected: C,
|
|
14
15
|
value: e,
|
|
15
|
-
onSelect:
|
|
16
|
-
name:
|
|
17
|
-
disabled:
|
|
16
|
+
onSelect: $,
|
|
17
|
+
name: R,
|
|
18
|
+
disabled: l,
|
|
18
19
|
readOnly: p,
|
|
19
|
-
loading:
|
|
20
|
-
error:
|
|
21
|
-
size:
|
|
22
|
-
className:
|
|
23
|
-
style:
|
|
24
|
-
displayStyle:
|
|
25
|
-
id:
|
|
26
|
-
testId:
|
|
27
|
-
"data-testid":
|
|
20
|
+
loading: m,
|
|
21
|
+
error: a,
|
|
22
|
+
size: j,
|
|
23
|
+
className: F,
|
|
24
|
+
style: G,
|
|
25
|
+
displayStyle: u,
|
|
26
|
+
id: I,
|
|
27
|
+
testId: K,
|
|
28
|
+
"data-testid": B
|
|
28
29
|
}) => {
|
|
29
|
-
const f =
|
|
30
|
-
if (
|
|
30
|
+
const f = V("card", u), E = X("card", u), h = t.useContext(Y), M = t.useContext(Z), W = j ?? M ?? "md", q = t.useMemo(() => {
|
|
31
|
+
if (u)
|
|
31
32
|
return f;
|
|
32
33
|
const {
|
|
33
|
-
background:
|
|
34
|
-
border:
|
|
35
|
-
boxShadow:
|
|
36
|
-
backdropFilter:
|
|
37
|
-
WebkitBackdropFilter:
|
|
38
|
-
...
|
|
34
|
+
background: i,
|
|
35
|
+
border: O,
|
|
36
|
+
boxShadow: ee,
|
|
37
|
+
backdropFilter: ne,
|
|
38
|
+
WebkitBackdropFilter: ce,
|
|
39
|
+
...U
|
|
39
40
|
} = f;
|
|
40
|
-
return
|
|
41
|
-
}, [f,
|
|
42
|
-
e != null && (
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
!
|
|
47
|
-
}, b = n ||
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
41
|
+
return U;
|
|
42
|
+
}, [f, u]), r = h != null && e != null, n = z || r || $ != null, A = R ?? (r ? h.name : void 0), x = n && C === void 0 && !r, [H, J] = t.useState(!1), S = r ? h.value === e : x ? H : !!C, L = () => {
|
|
43
|
+
e != null && ($?.(e), r && h.onChange(e));
|
|
44
|
+
}, g = l || m, k = () => {
|
|
45
|
+
g || (n && !p && (L(), x && J((i) => !i)), o?.());
|
|
46
|
+
}, P = (i) => {
|
|
47
|
+
!g && n && !p && (i.key === " " || i.key === "Enter") && (i.preventDefault(), k());
|
|
48
|
+
}, b = n || o != null, Q = n ? "radio" : o ? "button" : void 0, T = typeof a == "string" ? a.length > 0 : !!a;
|
|
49
|
+
return /* @__PURE__ */ _("div", { className: "nice-card-field", children: [
|
|
50
|
+
/* @__PURE__ */ _(
|
|
50
51
|
"div",
|
|
51
52
|
{
|
|
52
|
-
className: `nice-card nice-card--${
|
|
53
|
-
style: { ...
|
|
54
|
-
id:
|
|
55
|
-
"data-testid":
|
|
53
|
+
className: `nice-card nice-card--${W} nice-card--ds-${E} ${D ? "nice-card--bordered" : "nice-card--frameless"} ${w ? "nice-card--hoverable" : ""} ${o ? "nice-card--clickable" : ""} ${n ? "nice-card--selectable" : ""} ${S ? "nice-card--selected" : ""} ${l ? "nice-card--disabled" : ""} ${p ? "nice-card--readonly" : ""} ${m ? "nice-card--loading" : ""} ${T ? "nice-card--error" : ""} ${F || ""}`,
|
|
54
|
+
style: { ...q, ...G },
|
|
55
|
+
id: I,
|
|
56
|
+
"data-testid": B ?? K,
|
|
56
57
|
onClick: b ? k : void 0,
|
|
57
|
-
onKeyDown: b ?
|
|
58
|
-
role:
|
|
59
|
-
"aria-checked": n ?
|
|
60
|
-
"aria-disabled":
|
|
61
|
-
"aria-busy":
|
|
58
|
+
onKeyDown: b ? P : void 0,
|
|
59
|
+
role: Q,
|
|
60
|
+
"aria-checked": n ? S : void 0,
|
|
61
|
+
"aria-disabled": l || void 0,
|
|
62
|
+
"aria-busy": m || void 0,
|
|
62
63
|
"data-value": e != null ? String(e) : void 0,
|
|
63
|
-
"data-name":
|
|
64
|
-
tabIndex: b && !
|
|
64
|
+
"data-name": A,
|
|
65
|
+
tabIndex: b && !l ? 0 : void 0,
|
|
65
66
|
children: [
|
|
66
|
-
(
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
(s || d || v) && /* @__PURE__ */ _("div", { className: "nice-card__header", children: [
|
|
68
|
+
(s || d) && /* @__PURE__ */ _("div", { className: "nice-card__heading", children: [
|
|
69
|
+
d && /* @__PURE__ */ c("span", { className: "nice-card__title-icon", "aria-hidden": "true", children: d }),
|
|
70
|
+
s && /* @__PURE__ */ c("h3", { className: "nice-card__title", children: s })
|
|
71
|
+
] }),
|
|
72
|
+
v
|
|
69
73
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
/* @__PURE__ */ c("div", { className: "nice-card__body", children: y }),
|
|
75
|
+
N && /* @__PURE__ */ c("div", { className: "nice-card__footer", children: N }),
|
|
76
|
+
m && /* @__PURE__ */ c("span", { className: "nice-card__spinner", "aria-hidden": "true", children: /* @__PURE__ */ c("span", { className: "nice-spinner nice-spinner--sm" }) })
|
|
73
77
|
]
|
|
74
78
|
}
|
|
75
79
|
),
|
|
76
|
-
typeof
|
|
80
|
+
typeof a == "string" && a && /* @__PURE__ */ c("div", { className: "nice-card__error", role: "alert", children: a })
|
|
77
81
|
] });
|
|
78
82
|
};
|
|
79
83
|
export {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
re as NiceCard,
|
|
85
|
+
Z as NiceCardGroupSizeContext,
|
|
86
|
+
Y as NiceCardRadioContext
|
|
83
87
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { useNiceTranslation as O } from "@nice2dev/ui-core";
|
|
3
|
-
import { useState as N, useMemo as
|
|
3
|
+
import { useState as N, useMemo as T } from "react";
|
|
4
4
|
import { NiceButton as R } from "../buttons/NiceButton.mjs";
|
|
5
5
|
import { NiceSegmentedControl as d } from "../display/NiceSegmentedControl.mjs";
|
|
6
|
-
import { NiceLanguagePicker as
|
|
7
|
-
import { NiceThemePicker as
|
|
6
|
+
import { NiceLanguagePicker as E } from "../editors/pickers/NiceLanguagePicker.mjs";
|
|
7
|
+
import { NiceThemePicker as P } from "../editors/pickers/NiceThemePicker.mjs";
|
|
8
8
|
import { NiceModal as A } from "../feedback/NiceModal.mjs";
|
|
9
9
|
/* empty css */
|
|
10
10
|
const D = ["single", "tabs"];
|
|
@@ -19,76 +19,76 @@ function F({
|
|
|
19
19
|
languages: f,
|
|
20
20
|
priorityLanguages: _,
|
|
21
21
|
title: w,
|
|
22
|
-
description:
|
|
23
|
-
"data-testid":
|
|
22
|
+
description: S,
|
|
23
|
+
"data-testid": m = "nice-first-run-preferences"
|
|
24
24
|
}) {
|
|
25
|
-
const { t:
|
|
26
|
-
i !==
|
|
27
|
-
const s = (
|
|
25
|
+
const { t: e } = O(), [r, b] = N(h ?? {}), [k, C] = N(i);
|
|
26
|
+
i !== k && (C(i), i && b(h ?? {}));
|
|
27
|
+
const s = (t, n) => b((p) => ({ ...p, [t]: n })), x = T(
|
|
28
28
|
() => v ?? ["pages", "theme", "language", "menu"].filter(
|
|
29
|
-
(
|
|
29
|
+
(t) => (t !== "theme" || (u?.length ?? 0) > 0) && (t !== "language" || (f?.length ?? 0) > 0)
|
|
30
30
|
),
|
|
31
31
|
[v, u, f]
|
|
32
32
|
), M = {
|
|
33
|
-
auto:
|
|
34
|
-
single:
|
|
35
|
-
tabs:
|
|
36
|
-
}, l = (
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
] },
|
|
40
|
-
return /* @__PURE__ */
|
|
33
|
+
auto: e("firstRun.pagesAuto", "Automatically"),
|
|
34
|
+
single: e("firstRun.pagesSingle", "One at a time"),
|
|
35
|
+
tabs: e("firstRun.pagesTabs", "In tabs")
|
|
36
|
+
}, l = (t, n, p) => /* @__PURE__ */ o("section", { className: "nice-first-run__section", "aria-label": n, children: [
|
|
37
|
+
/* @__PURE__ */ a("h3", { className: "nice-first-run__heading", children: n }),
|
|
38
|
+
p
|
|
39
|
+
] }, t);
|
|
40
|
+
return /* @__PURE__ */ a(
|
|
41
41
|
A,
|
|
42
42
|
{
|
|
43
43
|
open: i,
|
|
44
44
|
onClose: g,
|
|
45
45
|
size: "md",
|
|
46
46
|
closeOnOverlay: !1,
|
|
47
|
-
title: w ??
|
|
48
|
-
"data-testid":
|
|
47
|
+
title: w ?? e("firstRun.title", "Set up your workspace"),
|
|
48
|
+
"data-testid": m,
|
|
49
49
|
footer: /* @__PURE__ */ o("div", { className: "nice-first-run__footer", children: [
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ a(R, { variant: "ghost", onClick: g, "data-testid": `${m}-skip`, children: e("firstRun.skip", "Skip") }),
|
|
51
|
+
/* @__PURE__ */ a(
|
|
52
52
|
R,
|
|
53
53
|
{
|
|
54
54
|
variant: "primary",
|
|
55
55
|
onClick: () => y(r),
|
|
56
|
-
"data-testid": `${
|
|
57
|
-
children:
|
|
56
|
+
"data-testid": `${m}-save`,
|
|
57
|
+
children: e("firstRun.save", "Save")
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
] }),
|
|
61
61
|
children: /* @__PURE__ */ o("div", { className: "nice-first-run", children: [
|
|
62
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ a("p", { className: "nice-first-run__intro", children: S ?? e(
|
|
63
63
|
"firstRun.intro",
|
|
64
64
|
"Choose how you want to work. You can change all of it later in the preferences."
|
|
65
65
|
) }),
|
|
66
|
-
x.map((
|
|
67
|
-
switch (
|
|
66
|
+
x.map((t) => {
|
|
67
|
+
switch (t) {
|
|
68
68
|
case "pages":
|
|
69
69
|
return l(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
/* @__PURE__ */
|
|
70
|
+
t,
|
|
71
|
+
e("firstRun.pages", "Opening pages"),
|
|
72
|
+
/* @__PURE__ */ a(
|
|
73
73
|
d,
|
|
74
74
|
{
|
|
75
75
|
block: !0,
|
|
76
|
-
options: c.map((
|
|
76
|
+
options: c.map((n) => ({ value: n, label: M[n] })),
|
|
77
77
|
value: r.pageMode && c.includes(r.pageMode) ? r.pageMode : c[0],
|
|
78
|
-
onChange: (
|
|
78
|
+
onChange: (n) => s("pageMode", n)
|
|
79
79
|
}
|
|
80
80
|
)
|
|
81
81
|
);
|
|
82
82
|
case "theme":
|
|
83
83
|
return l(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
84
|
+
t,
|
|
85
|
+
e("firstRun.theme", "Theme"),
|
|
86
|
+
/* @__PURE__ */ a(
|
|
87
|
+
P,
|
|
88
88
|
{
|
|
89
89
|
themes: u,
|
|
90
90
|
value: r.theme,
|
|
91
|
-
onChange: (
|
|
91
|
+
onChange: (n) => s("theme", n?.id),
|
|
92
92
|
showPreviewInValue: !0,
|
|
93
93
|
showPreviewInMenu: !0,
|
|
94
94
|
showTextInValue: !0,
|
|
@@ -98,13 +98,13 @@ function F({
|
|
|
98
98
|
);
|
|
99
99
|
case "language":
|
|
100
100
|
return l(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
|
|
101
|
+
t,
|
|
102
|
+
e("firstRun.language", "Language"),
|
|
103
|
+
/* @__PURE__ */ a(
|
|
104
|
+
E,
|
|
105
105
|
{
|
|
106
106
|
value: r.language,
|
|
107
|
-
onChange: (
|
|
107
|
+
onChange: (n) => s("language", n?.code),
|
|
108
108
|
allowedCodes: f,
|
|
109
109
|
priorityCodes: _,
|
|
110
110
|
displayName: "native"
|
|
@@ -113,32 +113,33 @@ function F({
|
|
|
113
113
|
);
|
|
114
114
|
case "menu":
|
|
115
115
|
return l(
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
t,
|
|
117
|
+
e("firstRun.menu", "Menu"),
|
|
118
118
|
/* @__PURE__ */ o("div", { className: "nice-first-run__stack", children: [
|
|
119
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ a(
|
|
120
120
|
d,
|
|
121
121
|
{
|
|
122
122
|
block: !0,
|
|
123
123
|
options: [
|
|
124
|
-
{ value: "expanded", label:
|
|
125
|
-
{ value: "icons", label:
|
|
124
|
+
{ value: "expanded", label: e("firstRun.menuExpanded", "Expanded") },
|
|
125
|
+
{ value: "icons", label: e("firstRun.menuIcons", "Icons only") }
|
|
126
126
|
],
|
|
127
127
|
value: r.collapsed ? "icons" : "expanded",
|
|
128
|
-
onChange: (
|
|
128
|
+
onChange: (n) => s("collapsed", n === "icons")
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ a("span", { className: "nice-first-run__label", children: e("firstRun.colorStyle", "Branch colours") }),
|
|
132
|
+
/* @__PURE__ */ a(
|
|
133
133
|
d,
|
|
134
134
|
{
|
|
135
135
|
block: !0,
|
|
136
136
|
options: [
|
|
137
|
-
{ value: "
|
|
138
|
-
{ value: "
|
|
137
|
+
{ value: "theme", label: e("firstRun.colorStyleTheme", "Theme colours") },
|
|
138
|
+
{ value: "bar", label: e("firstRun.colorStyleBar", "A bar by each item") },
|
|
139
|
+
{ value: "fill", label: e("firstRun.colorStyleFill", "Whole items filled") }
|
|
139
140
|
],
|
|
140
|
-
value: r.colorStyle
|
|
141
|
-
onChange: (
|
|
141
|
+
value: r.colorStyle ?? "theme",
|
|
142
|
+
onChange: (n) => s("colorStyle", n)
|
|
142
143
|
}
|
|
143
144
|
)
|
|
144
145
|
] })
|