@nice2dev/ui-bi 1.2.0 → 1.2.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,147 @@
1
1
  # @nice2dev/ui-bi
2
2
 
3
+ ## 1.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 06eb0d2: 1.2.2 — library texts through the translator, a translator in the packages that had none, and the
8
+ end of the hook-dependency warnings. Nothing removed or renamed. Upgrade notes:
9
+ `documentation/omniverk/OMNIVERK_UPGRADE_1.2.2.md`.
10
+
11
+ **Translations.** 2,825 new keys in the global dictionary (en, pl, de, fr, es, uk), 80 in the local
12
+ dictionaries of ui-math, ui-diagrams and ui-presentations: column headers, option labels, texts in
13
+ conditions and templates, messages given to setters, labels returned by helpers, Polish texts that
14
+ were the English default. Relative dates through `Intl.RelativeTimeFormat`, plural forms through
15
+ `…One` / `…Many` keys. ui-science, ui-platform, ui-mobile, auth, licensing, templates, social and
16
+ the icon tools translate through `useNiceTranslation` (new peer `@nice2dev/ui-core ^1.2.0`);
17
+ ui-security reads the global translator when its own provider is absent.
18
+
19
+ **Additions.** `labelKey` on ui-mobile `TabItem` and `SwipeAction` (the presets set it);
20
+ `registerWebAuthn` / `authenticateWebAuthn` take the WebAuthn options `NiceWebAuthnButton` used to
21
+ drop (defaults unchanged); `NiceKeyboardHint` shows `descriptionKey`. Eight icons in
22
+ `@nice2dev/icons` — `NtdPoint`, `NtdSegment`, `NtdPerpendicular`, `NtdParallel`, `NtdMidpoint`,
23
+ `NtdAngleBisector`, `NtdGroup`, `NtdUngroup` — and the same names as `NiceIcon` built-ins.
24
+
25
+ **Behaviour changes, agreed.** ui-math, ui-diagrams and ui-presentations follow the app's global
26
+ `NiceI18nProvider` language when their own provider is absent (they stayed English);
27
+ `NicePresentationEditor` without `lang` takes the surrounding language. Icons drawn as glyphs are
28
+ Nice icons: the `NiceGeometry` tools, Align / Group / Ungroup / Layout of the diagram toolbar, the
29
+ presentation grid toggle, zoom and "Add Track" of `NiceDMXTimeline`. icons-gaming and
30
+ icons-filetypes name an icon by its `title` and are decorative without one, like `createIcon`
31
+ (screen readers read "GiHeart" or "DOCX file icon"); new optional `title` on the gaming icon props.
32
+
33
+ **Hook dependencies (161 → 0).** Fixed along the way: `NiceLowPowerMode` re-rendered forever from
34
+ mount and overflowed the stack on wake; `GenericPlayer` / `NiceGenericPlayerStage` restarted the
35
+ track on a volume change; `NiceDMXTimeline` called `onPlay` on every frame and missed cues added
36
+ during playback; `NiceConflictResolution` `autoResolve` never resolved; `NiceMAM` selected by the
37
+ previous filter; `NiceRulesEngine` "Run All" kept only the last result; `NiceCodeEditor` saved with
38
+ the first render's `onSave`; a consumer's cursor handler switched off `NiceCodeEditorAI`
39
+ completion; `useRadioStream` lost a volume set before the first play; `NiceGameEditor` shortcuts,
40
+ `useVoiceControl` continuous sessions, `NiceDeviceTrust` with a host storing the score.
41
+
42
+ ## 1.2.1
43
+
44
+ ### Patch Changes
45
+
46
+ - 8c82c30: 1.2.1 — the decisions that waited since 1.2.0, and the debts the CI gates were holding. One API
47
+ change, agreed: `NiceIconSuggestorAI` suggests Nice icons only. Two stylesheets to import if you use
48
+ the packages: `@nice2dev/social/style.css`, `@nice2dev/ui-science/style.css`. Upgrade notes:
49
+ `documentation/omniverk/OMNIVERK_UPGRADE_1.2.1.md`.
50
+
51
+ **Tree-shaking.** An import from a package no longer brings the whole package. Module-level
52
+ statements that may have a side effect — a `displayName` assigned after each component (now
53
+ `Object.assign` inside `/* @__PURE__ */`, or under a development check for plain functions),
54
+ unannotated `forwardRef` / `memo` / `createContext` / icon-factory calls, spreads, registries filled
55
+ at import, `<style>` tags injected at import, a direct `eval` in ui-math — are gone. One import from
56
+ each of 53 packages: 5066.5 kB → 1171.6 kB (`@nice2dev/ui` 1928.2 kB → 12.9 kB, icon packs 48–275 kB
57
+ → 1.6–2.6 kB). `defaultViewRegistry` has the Nice\* input controls from the start, each loading its
58
+ module on first render; sixteen controls add their styles to `<head>` on first render.
59
+
60
+ **Dead code.** 405 source files no entry point imported (never on npm) are deleted;
61
+ `NiceClipboardStack` (`@nice2dev/ui`) and `NiceSampleBrowser` (`@nice2dev/ui-audio`), finished and
62
+ documented, are exported.
63
+
64
+ **ui-mobile draws Nice icons.** New peer `@nice2dev/icons ^1.2.0`; `TabIcons`, `DrawerIcons`,
65
+ `HeaderIcons`, the `NiceSwipeActions` presets and the `NiceInfiniteScroll` states are `Ntd*` icons
66
+ instead of pasted `<svg>`, simple glyphs are CSS marks. `@nice2dev/icons` adds `NtdReply` and
67
+ `NtdInbox`; an icon no longer throws without `window.matchMedia`.
68
+
69
+ **`NiceIconSuggestorAI` (breaking, agreed).** `AIIconLibrary` is `'nice'`; `svgPath` and `unicode`
70
+ left `AISuggestedIcon`; the preview is a `<NiceIcon>`, "Copy SVG" is "Copy JSX".
71
+
72
+ **Peer ranges.** Every internal `@nice2dev/*` peer is `^1.2.0` (was as wide as `^1.0.20`), except
73
+ `@nice2dev/icons ^1.2.1` where a package draws an icon new in 1.2.1: ui-mobile (`NtdReply`,
74
+ `NtdInbox`), ui-audio (`NtdMicrophoneOff`) and ui-security (`NtdBackspace`). ui-security, licensing
75
+ (`^1.2.0`) and templates (`^1.2.0`) gain the `@nice2dev/icons` peer: their glyph icons (`⌫`, `←`,
76
+ `→`, `↑`, `↓`) are Nice icons now. `@nice2dev/icons` adds `NtdBackspace`.
77
+
78
+ **Class names inside components.** 834 class names in library stylesheets had no `nice-` prefix
79
+ (`.tab-button`, `.status-badge`, `.selected`, …) and styled every element of that name on the page.
80
+ They follow `nice-{block}__{element}--{modifier}` now — no change on screen. The class theme hooks
81
+ next to `[data-theme]` on seven controls (`dark` on the AI chart / data grid / code and HTML
82
+ editors / form builder, `light-theme` on `NiceMAM` and `NiceVideoAnnotator`) are `nice-dark` /
83
+ `nice-light`; `NiceLowPowerMode` marks `<html>` with `nice-lpm-no-animations` /
84
+ `nice-lpm-reduced-quality`; the `NiceVideoEditor` of `@nice2dev/ui-video` styles its elements under
85
+ `nice-video-studio`, so they no longer collide with the `NiceVideoEditor` of `@nice2dev/ui`.
86
+ Rules for classes nothing rendered are gone, among them the stylesheet of `NiceGanttChart`, which
87
+ left ui-erp in 1.0.10.
88
+
89
+ **Translations.** About 3,400 UI texts in 32 packages were hard-coded; they go through `t()` now,
90
+ with the English text unchanged and pl / de / fr / es / uk in `@nice2dev/i18n` (ui-diagrams,
91
+ ui-presentations and ui-math in their own dictionaries). In `@nice2dev/events` and
92
+ `@nice2dev/admin` that includes column headers, option labels and the statuses and roles they used
93
+ to print raw (`checked-in`, `no-show`) — English labels for those come from the dictionary. ui-3d and ui-graphics read the app's
94
+ global translator, as ui-audio does since 1.2.0 — their own provider overrides it. ui-audio's
95
+ controls used 631 keys the dictionary did not have (English in every language), and the radio
96
+ player showed raw keys (`search_stations`). Texts that were hard-coded **in Polish** — in
97
+ `NiceSidebarNav`, `NiceNetworkDiscoveryPanel`, the backup and smart-home controls,
98
+ `NiceSavedQueryPanel`, `NiceNotificationPreferences`, the ui-buildings panels, the ui-printing
99
+ template editor and the photo editor — default to English now; Polish is in the dictionary. English
100
+ plurals glued on (`result{s}`) are two keys. `presentationsTranslator(lang)` (ui-presentations)
101
+ translates outside its provider.
102
+
103
+ **List props are optional.** 170 list props (`items`, `columns`, `data`, …) in 15 packages that
104
+ were required without a default are optional, with a stable empty default; every one of those
105
+ controls mounts without data (tested). `NiceStockChart` without data no longer computes NaN
106
+ coordinates.
107
+
108
+ **Unstyled components get stylesheets.** 98 components rendered class names no stylesheet had —
109
+ admin panels, auth forms, events rounds and pickers, the ERP invoice / purchase order / VAT table /
110
+ HR dashboard, the radio player, `NiceInbox`, PWA prompts, `NiceViewRenderer`, shells, smart-home,
111
+ … The fixed layout that sat in inline style objects is in classes now, so an app can override it;
112
+ values that depend on data stay inline. **`@nice2dev/social` and `@nice2dev/ui-science` ship a
113
+ stylesheet — import `@nice2dev/social/style.css` / `@nice2dev/ui-science/style.css`.** ui-science's
114
+ `sideEffects` is `["*.css"]`. Colours, spacing and radii in every stylesheet come from theme tokens
115
+ (visible in dark themes: `NiceRecipe` difficulty badges, transcoder states, warehouse heat map).
116
+
117
+ **Icons only from Nice.** About 130 glyphs (`×`, `→`, `↑`) and 100 pasted `<svg>` used as icons
118
+ are Nice icons; 11 `<svg>` stay as the control's own graphic (logos, spinners, checkbox mark). `NiceIcon`
119
+ gains `pin`, `mic-off`, `log-out`, `chevrons-left`, `chevrons-right`, `zoom-in`, `zoom-out`,
120
+ `navigation`, `refresh-ccw`, `minimize` and `smartphone`; `@nice2dev/icons` gains
121
+ `NtdMicrophoneOff`. The `icon` fields of the module, menu, tab, mode, quick-action, scene and admin
122
+ widget DTOs, notification channels and view toolbar items are rendered through `NiceIcon` — they
123
+ used to be printed as text. `NiceRatings` `thumbs` draws shapes instead of emoji.
124
+
125
+ **Dialogs instead of `window.prompt` / `confirm` / `alert`.** New `useNiceDialogs()` — `prompt`,
126
+ `confirm` and `alert` as promises on `NicePromptDialog` / `NiceConfirmDialog` — and
127
+ `NiceConfirmDialog.showReject`. Seventeen controls asked through the browser's blocking dialogs and
128
+ use the library's now (`NiceFileManager`, `NiceHtmlEditor`, `NiceViewRenderer` action `confirm`, the 3D,
129
+ vector and pixel editors, …). Keys pressed in `NicePromptDialog` / `NiceConfirmDialog` no longer
130
+ reach the page's shortcuts (Escape still closes them), and `NicePromptDialog`'s backdrop covers the
131
+ whole viewport.
132
+
133
+ **Smaller fixes.** `NiceFileManager.items` is optional. `NiceMLStudio` status badges: `draft`,
134
+ `registered`, `archived`, `cancelled` get a neutral colour, deploying / stopped deployments theirs.
135
+ Component docs (`doc.json`) list only props the components have. `NiceMobileTabs`: tabs beyond
136
+ `maxTabs` open from "More" (it only logged). `NiceInventoryManager`: new `onCreatePurchaseOrder`;
137
+ without it the "Create PO" button is gone (it only logged). Keyboard: `NiceNavShell` tabs follow the
138
+ WAI-ARIA tabs pattern, clickable `NiceDeviceTile` / `NiceCardGroup` cards and animated icons with
139
+ `trigger="click"` are focusable. ui-math: `CalculatorService.evaluate` parses instead of running
140
+ `new Function` (`asin`, `sinh`, `ceil`, exponents and `angleUnit` were wrong); `ExpressionParser`
141
+ takes `functions`, `constants`, `ignoreCase` and `strict`, multiplies implicitly (`2x`) and reads `^`
142
+ right to left. `InvoiceLine.vatRate` and `VatRate.rate` are documented as fractions (0.23).
143
+ `AmqpServerBinding` is `Record<string, never>`.
144
+
3
145
  ## 1.2.0
4
146
 
5
147
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("@nice2dev/ui"),f=require("@nice2dev/ui-core"),m=require("react"),q=[{target:".nice-etl-builder",titleKey:"tutorial.etlBuilder.intro.title",title:"ETL builder",contentKey:"tutorial.etlBuilder.intro.content",content:"Wire sources → transformations → destinations into a pipeline, switch the views, then run it and save the configuration.",placement:"auto"}],K={id:"",name:"New Pipeline",sources:[],transformations:[],destinations:[],version:1},E=o=>/^[a-z][a-z0-9-]*$/.test(o)?e.jsx(g.NiceIcon,{name:o,size:16}):o,w=[{type:"filter",key:"etlBuilder.transform.filter",label:"Filter",icon:"filter"},{type:"map",key:"etlBuilder.transform.map",label:"Map",icon:"shuffle"},{type:"aggregate",key:"etlBuilder.transform.aggregate",label:"Aggregate",icon:"∑"},{type:"join",key:"etlBuilder.transform.join",label:"Join",icon:"link"},{type:"union",key:"etlBuilder.transform.union",label:"Union",icon:"∪"},{type:"sort",key:"etlBuilder.transform.sort",label:"Sort",icon:"sort"},{type:"deduplicate",key:"etlBuilder.transform.deduplicate",label:"Deduplicate",icon:"copy"},{type:"pivot",key:"etlBuilder.transform.pivot",label:"Pivot",icon:"expand"},{type:"unpivot",key:"etlBuilder.transform.unpivot",label:"Unpivot",icon:"collapse"},{type:"split",key:"etlBuilder.transform.split",label:"Split",icon:"scissors"},{type:"merge",key:"etlBuilder.transform.merge",label:"Merge",icon:"git-branch"},{type:"lookup",key:"etlBuilder.transform.lookup",label:"Lookup",icon:"book"},{type:"derive",key:"etlBuilder.transform.derive",label:"Derive Column",icon:"plus"},{type:"validate",key:"etlBuilder.transform.validate",label:"Validate",icon:"check"},{type:"cleanse",key:"etlBuilder.transform.cleanse",label:"Cleanse",icon:"wand"},{type:"custom",key:"etlBuilder.transform.custom",label:"Custom",icon:"ƒ"}];function V({pipeline:o,dataSources:l=[],onChange:d,onRun:t,onSchedule:h,onSave:n,className:j="",tutorial:a}){const{t:c}=f.useNiceTranslation(),[p,I]=m.useState(()=>o||{...K,id:f.createId(),name:c("etlBuilder.newPipeline","New Pipeline")}),[u,_]=m.useState(null),[v,L]=m.useState("design"),[B,T]=m.useState(!1),[P,A]=m.useState([]),[y,N]=m.useState(null),F=m.useRef(null),b=m.useCallback(i=>{I(s=>{const r=i(s);return d==null||d(r),r})},[d]),S=m.useCallback(i=>{var r;const s={id:f.createId(),type:i.type,name:i.name,config:i.config,schema:(r=i.schema)==null?void 0:r.tables[0]};b(x=>({...x,sources:[...x.sources,s]}))},[b]),D=m.useCallback((i,s)=>{const r={id:f.createId(),type:i,name:(()=>{const x=w.find(H=>H.type===i);return x?c(x.key,x.label):i})(),input:[],output:f.createId(),config:Y(i)};b(x=>({...x,transformations:[...x.transformations,r]})),_({type:"transformation",id:r.id})},[b,c]),z=m.useCallback(()=>{const i={id:f.createId(),type:"database",name:c("etlBuilder.newDestination","New Destination"),config:{},writeMode:"append"};b(s=>({...s,destinations:[...s.destinations,i]})),_({type:"destination",id:i.id})},[b,c]),k=m.useCallback((i,s)=>{b(r=>{switch(i){case"source":return{...r,sources:r.sources.filter(x=>x.id!==s)};case"transformation":return{...r,transformations:r.transformations.filter(x=>x.id!==s)};case"destination":return{...r,destinations:r.destinations.filter(x=>x.id!==s)};default:return r}}),_(null)},[b]),R=m.useCallback(async()=>{if(t){T(!0);try{const i=await t(p);A(s=>[i,...s].slice(0,50))}finally{T(!1)}}},[p,t]),U=m.useCallback(i=>{b(s=>({...s,schedule:i})),h==null||h(p,i)},[p,b,h]),M=m.useCallback(i=>{if(i.preventDefault(),!!y){if(y.startsWith("transform:")){const s=y.replace("transform:","");D(s)}N(null)}},[y,D]),$=()=>{if(!u)return null;switch(u.type){case"source":return p.sources.find(i=>i.id===u.id);case"transformation":return p.transformations.find(i=>i.id===u.id);case"destination":return p.destinations.find(i=>i.id===u.id);default:return null}},O=v==="design"?e.jsxs("div",{className:"nice-etl-builder__palette",children:[e.jsx("h4",{children:c("etlBuilder.sources","Sources")}),l.map(i=>e.jsxs("div",{className:"nice-etl-builder__palette-item",onClick:()=>S(i),children:[e.jsx("span",{className:"nice-etl-builder__palette-icon",children:e.jsx(g.NiceIcon,{name:"database",size:14})}),e.jsx("span",{children:i.name})]},i.id)),e.jsxs("button",{onClick:()=>S({id:"",name:c("etlBuilder.newSource","New Source"),type:"database",config:{}}),children:[e.jsx(g.NiceIcon,{name:"plus",size:14})," ",c("etlBuilder.addSource","Add Source")]}),e.jsx("h4",{children:c("etlBuilder.transformations","Transformations")}),w.map(i=>e.jsxs("div",{className:"nice-etl-builder__palette-item",draggable:!0,onDragStart:()=>N(`transform:${i.type}`),onDragEnd:()=>N(null),children:[e.jsx("span",{className:"nice-etl-builder__palette-icon",children:E(i.icon)}),e.jsx("span",{children:c(i.key,i.label)})]},i.type)),e.jsx("h4",{children:c("etlBuilder.destinations","Destinations")}),e.jsxs("button",{onClick:z,children:[e.jsx(g.NiceIcon,{name:"plus",size:14})," ",c("etlBuilder.addDestination","Add Destination")]})]}):void 0,W=u&&v==="design"?e.jsx(J,{nodeType:u.type,node:$()??null,dataSources:l,onChange:i=>{b(s=>{switch(u.type){case"source":return{...s,sources:s.sources.map(r=>r.id===u.id?{...r,...i}:r)};case"transformation":return{...s,transformations:s.transformations.map(r=>r.id===u.id?{...r,...i}:r)};case"destination":return{...s,destinations:s.destinations.map(r=>r.id===u.id?{...r,...i}:r)};default:return s}})},onClose:()=>_(null)}):void 0;return e.jsxs(g.NiceAppShell,{flush:!0,className:`nice-etl-builder ${j}`,height:"100%",style:{minHeight:600},sidebar:O,rightSidebar:W,toolbar:e.jsxs("div",{className:"nice-etl-builder__toolbar",children:[e.jsx("input",{type:"text",value:p.name,onChange:i=>b(s=>({...s,name:i.target.value})),className:"nice-etl-builder__name-input"}),e.jsx("div",{className:"nice-etl-builder__tabs",children:["design","code","schedule","history"].map(i=>e.jsx("button",{className:`nice-etl-builder__tab ${v===i?"nice-etl-builder__tab--active":""}`,onClick:()=>L(i),children:c(`etlBuilder.tab.${i}`,i.charAt(0).toUpperCase()+i.slice(1))},i))}),e.jsxs("div",{className:"nice-etl-builder__actions",children:[e.jsxs("button",{onClick:R,disabled:B||!t,title:t?void 0:c("etlBuilder.runNotSetUp","Running pipelines is not set up"),className:"nice-etl-builder__run-btn",children:[e.jsx(g.NiceIcon,{name:B?"clock":"play",size:14})," ",B?c("etlBuilder.running","Running..."):c("etlBuilder.run","Run")]}),e.jsxs("button",{onClick:()=>n==null?void 0:n(p),disabled:!n,title:n?void 0:c("etlBuilder.saveNotSetUp","Saving pipelines is not set up"),className:"nice-etl-builder__save-btn",children:[e.jsx(g.NiceIcon,{name:"save",size:14})," ",c("save","Save")]}),e.jsx(f.NiceTutorialButton,{steps:f.resolveTutorial(a,q)})]})]}),children:[v==="design"&&e.jsx("div",{ref:F,className:"nice-etl-builder__canvas",onDragOver:i=>i.preventDefault(),onDrop:M,onClick:()=>_(null),children:e.jsxs("div",{className:"nice-etl-builder__flow",children:[e.jsxs("div",{className:"nice-etl-builder__column",children:[e.jsx("h5",{children:c("etlBuilder.sources","Sources")}),p.sources.map(i=>e.jsx(C,{node:i,nodeType:"source",icon:"database",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"source",id:i.id}),onDelete:()=>k("source",i.id)},i.id))]}),e.jsx("div",{className:"nice-etl-builder__arrow","aria-hidden":"true",children:e.jsx(g.NiceIcon,{name:"arrow-right",size:16})}),e.jsxs("div",{className:"nice-etl-builder__column nice-etl-builder__column--transforms",children:[e.jsx("h5",{children:c("etlBuilder.transformations","Transformations")}),p.transformations.map(i=>{const s=w.find(r=>r.type===i.type);return e.jsx(C,{node:i,nodeType:"transformation",icon:(s==null?void 0:s.icon)||"shuffle",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"transformation",id:i.id}),onDelete:()=>k("transformation",i.id)},i.id)}),p.transformations.length===0&&e.jsx("div",{className:"nice-etl-builder__empty-column",children:c("etlBuilder.dragTransformationsHere","Drag transformations here")})]}),e.jsx("div",{className:"nice-etl-builder__arrow","aria-hidden":"true",children:e.jsx(g.NiceIcon,{name:"arrow-right",size:16})}),e.jsxs("div",{className:"nice-etl-builder__column",children:[e.jsx("h5",{children:c("etlBuilder.destinations","Destinations")}),p.destinations.map(i=>e.jsx(C,{node:i,nodeType:"destination",icon:"download",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"destination",id:i.id}),onDelete:()=>k("destination",i.id)},i.id))]})]})}),v==="code"&&e.jsx("div",{className:"nice-etl-builder__code-view",children:e.jsx("pre",{children:JSON.stringify(p,null,2)})}),v==="schedule"&&e.jsx(G,{schedule:p.schedule,monitoring:p.monitoring,onChange:U}),v==="history"&&e.jsx(Q,{runs:P})]})}function Y(o){switch(o){case"filter":return{condition:""};case"map":return{mappings:[]};case"aggregate":return{groupBy:[],aggregations:[]};case"join":return{joinType:"inner",leftKey:"",rightKey:""};case"union":return{inputs:[]};case"sort":return{columns:[],directions:[]};case"deduplicate":return{columns:[],keepFirst:!0};case"pivot":return{pivotColumn:"",valueColumn:"",aggregation:"sum"};case"unpivot":return{columns:[],nameColumn:"name",valueColumn:"value"};case"derive":return{name:"",expression:""};case"validate":return{rules:[]};case"cleanse":return{operations:[]};case"custom":return{code:`// Custom transformation
2
- return data;`};default:return{}}}function C({node:o,nodeType:l,icon:d,isSelected:t,onSelect:h,onDelete:n}){return e.jsxs("div",{className:`nice-etl-builder__node nice-etl-builder__node--${l} ${t?"nice-etl-builder__node--selected":""}`,onClick:j=>{j.stopPropagation(),h()},children:[e.jsx("span",{className:"nice-etl-builder__node-icon",children:E(d)}),e.jsx("span",{className:"nice-etl-builder__node-name",children:o.name}),e.jsx("button",{className:"nice-etl-builder__node-delete",onClick:j=>{j.stopPropagation(),n()},children:"×"})]})}function J({nodeType:o,node:l,dataSources:d,onChange:t,onClose:h}){var j;const{t:n}=f.useNiceTranslation();return l?e.jsxs("div",{className:"nice-etl-builder__properties",children:[e.jsxs("div",{className:"nice-etl-builder__properties-header",children:[e.jsxs("h4",{children:[o.charAt(0).toUpperCase()+o.slice(1)," Properties"]}),e.jsx("button",{onClick:h,children:"×"})]}),e.jsxs("div",{className:"nice-etl-builder__properties-content",children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.name","Name")}),e.jsx("input",{type:"text",value:l.name,onChange:a=>t({name:a.target.value})})]}),o==="source"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.type","Type")}),e.jsxs("select",{value:l.type,onChange:a=>t({type:a.target.value}),children:[e.jsx("option",{value:"database",children:n("etlBuilder.database","Database")}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"file",children:n("etlBuilder.file","File")}),e.jsx("option",{value:"stream",children:n("etlBuilder.stream","Stream")})]})]}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:((j=l.incremental)==null?void 0:j.enabled)||!1,onChange:a=>{var c;return t({incremental:{...l.incremental,enabled:a.target.checked,column:((c=l.incremental)==null?void 0:c.column)||""}})}}),n("etlBuilder.incrementalLoad","Incremental Load")]})})]}),o==="transformation"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.type","Type")}),e.jsx("span",{children:l.type})]}),l.type==="filter"&&e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.condition","Condition")}),e.jsx("textarea",{value:String(l.config.condition||""),onChange:a=>t({config:{...l.config,condition:a.target.value}}),placeholder:n("etlBuilder.conditionPlaceholder","e.g., age > 18 AND status = 'active'"),rows:3})]}),l.type==="derive"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.columnName","Column Name")}),e.jsx("input",{type:"text",value:String(l.config.name||""),onChange:a=>t({config:{...l.config,name:a.target.value}})})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.expression","Expression")}),e.jsx("input",{type:"text",value:String(l.config.expression||""),onChange:a=>t({config:{...l.config,expression:a.target.value}}),placeholder:n("etlBuilder.expressionPlaceholder","e.g., price * quantity")})]})]}),l.type==="custom"&&e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.code","Code")}),e.jsx("textarea",{value:String(l.config.code||""),onChange:a=>t({config:{...l.config,code:a.target.value}}),rows:10,className:"nice-etl-builder__code-input"})]})]}),o==="destination"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.type","Type")}),e.jsxs("select",{value:l.type,onChange:a=>t({type:a.target.value}),children:[e.jsx("option",{value:"database",children:n("etlBuilder.database","Database")}),e.jsx("option",{value:"file",children:n("etlBuilder.file","File")}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"warehouse",children:n("etlBuilder.dataWarehouse","Data Warehouse")})]})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.writeMode","Write Mode")}),e.jsxs("select",{value:l.writeMode,onChange:a=>t({writeMode:a.target.value}),children:[e.jsx("option",{value:"append",children:n("etlBuilder.append","Append")}),e.jsx("option",{value:"overwrite",children:n("etlBuilder.overwrite","Overwrite")}),e.jsx("option",{value:"upsert",children:n("etlBuilder.upsert","Upsert")}),e.jsx("option",{value:"merge",children:n("etlBuilder.merge","Merge")})]})]})]})]})]}):e.jsx(e.Fragment,{})}function G({schedule:o,monitoring:l,onChange:d}){const{t}=f.useNiceTranslation(),[h,n]=m.useState(o||{enabled:!1});return e.jsxs("div",{className:"nice-etl-builder__schedule-editor",children:[e.jsx("h4",{children:t("etlBuilder.scheduleConfiguration","Schedule Configuration")}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:h.enabled,onChange:j=>{const a={...h,enabled:j.target.checked};n(a),d(a)}}),t("etlBuilder.enableScheduledExecution","Enable scheduled execution")]})}),h.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:t("etlBuilder.cronExpression","Cron Expression")}),e.jsx("input",{type:"text",value:h.cron||"",onChange:j=>{const a={...h,cron:j.target.value};n(a)},placeholder:t("etlBuilder.cronPlaceholder","0 * * * * (every hour)")}),e.jsx("small",{children:t("etlBuilder.cronFormat","Format: minute hour day month weekday")})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:t("etlBuilder.timezone","Timezone")}),e.jsxs("select",{value:h.timezone||"UTC",onChange:j=>{const a={...h,timezone:j.target.value};n(a)},children:[e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:t("etlBuilder.easternTime","Eastern Time")}),e.jsx("option",{value:"America/Chicago",children:t("etlBuilder.centralTime","Central Time")}),e.jsx("option",{value:"America/Los_Angeles",children:t("etlBuilder.pacificTime","Pacific Time")}),e.jsx("option",{value:"Europe/London",children:t("etlBuilder.london","London")}),e.jsx("option",{value:"Europe/Warsaw",children:t("etlBuilder.warsaw","Warsaw")})]})]}),e.jsx("button",{onClick:()=>d(h),children:t("etlBuilder.saveSchedule","Save Schedule")})]}),e.jsx("h4",{children:t("etlBuilder.monitoring","Monitoring")}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:(l==null?void 0:l.alertOnFailure)||!1,disabled:!0}),t("etlBuilder.alertOnFailure","Alert on failure")]})}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:t("etlBuilder.logLevel","Log Level")}),e.jsxs("select",{value:(l==null?void 0:l.logLevel)||"info",disabled:!0,children:[e.jsx("option",{value:"error",children:t("etlBuilder.error","Error")}),e.jsx("option",{value:"warn",children:t("etlBuilder.warning","Warning")}),e.jsx("option",{value:"info",children:t("etlBuilder.info","Info")}),e.jsx("option",{value:"debug",children:t("etlBuilder.debug","Debug")})]})]})]})}function Q({runs:o}){const{t:l}=f.useNiceTranslation();return e.jsxs("div",{className:"nice-etl-builder__history-view",children:[e.jsx("h4",{children:l("etlBuilder.runHistory","Run History")}),o.length===0?e.jsx("div",{className:"nice-etl-builder__no-history",children:l("etlBuilder.noRunsYet","No runs yet")}):e.jsxs("table",{className:"nice-etl-builder__history-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:l("etlBuilder.status","Status")}),e.jsx("th",{children:l("etlBuilder.startTime","Start Time")}),e.jsx("th",{children:l("etlBuilder.duration","Duration")}),e.jsx("th",{children:l("etlBuilder.rows","Rows")}),e.jsx("th",{children:l("etlBuilder.errors","Errors")})]})}),e.jsx("tbody",{children:o.map(d=>e.jsxs("tr",{className:`nice-etl-builder__run nice-etl-builder__run--${d.status}`,children:[e.jsx("td",{children:e.jsxs("span",{className:`nice-etl-builder__status nice-etl-builder__status--${d.status}`,children:[e.jsx(g.NiceIcon,{name:d.status==="success"?"check":d.status==="failed"?"close":"clock",size:12}),d.status]})}),e.jsx("td",{children:d.startTime.toLocaleString()}),e.jsx("td",{children:d.endTime?`${Math.round((d.endTime.getTime()-d.startTime.getTime())/1e3)}s`:"-"}),e.jsxs("td",{children:[d.rowsProcessed.toLocaleString()," / ",d.rowsWritten.toLocaleString()]}),e.jsx("td",{children:d.errors.length})]},d.id))})]})]})}exports.NiceETLBuilder=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("@nice2dev/ui"),g=require("@nice2dev/ui-core"),m=require("react"),q=[{target:".nice-etl-builder",titleKey:"tutorial.etlBuilder.intro.title",title:"ETL builder",contentKey:"tutorial.etlBuilder.intro.content",content:"Wire sources → transformations → destinations into a pipeline, switch the views, then run it and save the configuration.",placement:"auto"}],K={id:"",name:"New Pipeline",sources:[],transformations:[],destinations:[],version:1},P=o=>/^[a-z][a-z0-9-]*$/.test(o)?e.jsx(f.NiceIcon,{name:o,size:16}):o,w=[{type:"filter",key:"etlBuilder.transform.filter",label:"Filter",icon:"filter"},{type:"map",key:"etlBuilder.transform.map",label:"Map",icon:"shuffle"},{type:"aggregate",key:"etlBuilder.transform.aggregate",label:"Aggregate",icon:"∑"},{type:"join",key:"etlBuilder.transform.join",label:"Join",icon:"link"},{type:"union",key:"etlBuilder.transform.union",label:"Union",icon:"∪"},{type:"sort",key:"etlBuilder.transform.sort",label:"Sort",icon:"sort"},{type:"deduplicate",key:"etlBuilder.transform.deduplicate",label:"Deduplicate",icon:"copy"},{type:"pivot",key:"etlBuilder.transform.pivot",label:"Pivot",icon:"expand"},{type:"unpivot",key:"etlBuilder.transform.unpivot",label:"Unpivot",icon:"collapse"},{type:"split",key:"etlBuilder.transform.split",label:"Split",icon:"scissors"},{type:"merge",key:"etlBuilder.transform.merge",label:"Merge",icon:"git-branch"},{type:"lookup",key:"etlBuilder.transform.lookup",label:"Lookup",icon:"book"},{type:"derive",key:"etlBuilder.transform.derive",label:"Derive Column",icon:"plus"},{type:"validate",key:"etlBuilder.transform.validate",label:"Validate",icon:"check"},{type:"cleanse",key:"etlBuilder.transform.cleanse",label:"Cleanse",icon:"wand"},{type:"custom",key:"etlBuilder.transform.custom",label:"Custom",icon:"ƒ"}];function V({pipeline:o,dataSources:t=[],onChange:d,onRun:n,onSchedule:p,onSave:l,className:j="",tutorial:r}){const{t:c}=g.useNiceTranslation(),[h,I]=m.useState(()=>o||{...K,id:g.createId(),name:c("etlBuilder.newPipeline","New Pipeline")}),[u,_]=m.useState(null),[v,E]=m.useState("design"),[B,S]=m.useState(!1),[L,A]=m.useState([]),[y,N]=m.useState(null),z=m.useRef(null),b=m.useCallback(i=>{I(s=>{const a=i(s);return d==null||d(a),a})},[d]),T=m.useCallback(i=>{var a;const s={id:g.createId(),type:i.type,name:i.name,config:i.config,schema:(a=i.schema)==null?void 0:a.tables[0]};b(x=>({...x,sources:[...x.sources,s]}))},[b]),D=m.useCallback((i,s)=>{const a={id:g.createId(),type:i,name:(()=>{const x=w.find(H=>H.type===i);return x?c(x.key,x.label):i})(),input:[],output:g.createId(),config:Y(i)};b(x=>({...x,transformations:[...x.transformations,a]})),_({type:"transformation",id:a.id})},[b,c]),F=m.useCallback(()=>{const i={id:g.createId(),type:"database",name:c("etlBuilder.newDestination","New Destination"),config:{},writeMode:"append"};b(s=>({...s,destinations:[...s.destinations,i]})),_({type:"destination",id:i.id})},[b,c]),k=m.useCallback((i,s)=>{b(a=>{switch(i){case"source":return{...a,sources:a.sources.filter(x=>x.id!==s)};case"transformation":return{...a,transformations:a.transformations.filter(x=>x.id!==s)};case"destination":return{...a,destinations:a.destinations.filter(x=>x.id!==s)};default:return a}}),_(null)},[b]),R=m.useCallback(async()=>{if(n){S(!0);try{const i=await n(h);A(s=>[i,...s].slice(0,50))}finally{S(!1)}}},[h,n]),U=m.useCallback(i=>{b(s=>({...s,schedule:i})),p==null||p(h,i)},[h,b,p]),M=m.useCallback(i=>{if(i.preventDefault(),!!y){if(y.startsWith("transform:")){const s=y.replace("transform:","");D(s)}N(null)}},[y,D]),$=()=>{if(!u)return null;switch(u.type){case"source":return h.sources.find(i=>i.id===u.id);case"transformation":return h.transformations.find(i=>i.id===u.id);case"destination":return h.destinations.find(i=>i.id===u.id);default:return null}},O=v==="design"?e.jsxs("div",{className:"nice-etl-builder__palette",children:[e.jsx("h4",{children:c("etlBuilder.sources","Sources")}),t.map(i=>e.jsxs("div",{className:"nice-etl-builder__palette-item",onClick:()=>T(i),children:[e.jsx("span",{className:"nice-etl-builder__palette-icon",children:e.jsx(f.NiceIcon,{name:"database",size:14})}),e.jsx("span",{children:i.name})]},i.id)),e.jsxs("button",{onClick:()=>T({id:"",name:c("etlBuilder.newSource","New Source"),type:"database",config:{}}),children:[e.jsx(f.NiceIcon,{name:"plus",size:14})," ",c("etlBuilder.addSource","Add Source")]}),e.jsx("h4",{children:c("etlBuilder.transformations","Transformations")}),w.map(i=>e.jsxs("div",{className:"nice-etl-builder__palette-item",draggable:!0,onDragStart:()=>N(`transform:${i.type}`),onDragEnd:()=>N(null),children:[e.jsx("span",{className:"nice-etl-builder__palette-icon",children:P(i.icon)}),e.jsx("span",{children:c(i.key,i.label)})]},i.type)),e.jsx("h4",{children:c("etlBuilder.destinations","Destinations")}),e.jsxs("button",{onClick:F,children:[e.jsx(f.NiceIcon,{name:"plus",size:14})," ",c("etlBuilder.addDestination","Add Destination")]})]}):void 0,W=u&&v==="design"?e.jsx(J,{nodeType:u.type,node:$()??null,dataSources:t,onChange:i=>{b(s=>{switch(u.type){case"source":return{...s,sources:s.sources.map(a=>a.id===u.id?{...a,...i}:a)};case"transformation":return{...s,transformations:s.transformations.map(a=>a.id===u.id?{...a,...i}:a)};case"destination":return{...s,destinations:s.destinations.map(a=>a.id===u.id?{...a,...i}:a)};default:return s}})},onClose:()=>_(null)}):void 0;return e.jsxs(f.NiceAppShell,{flush:!0,className:`nice-etl-builder ${j}`,height:"100%",style:{minHeight:600},sidebar:O,rightSidebar:W,toolbar:e.jsxs("div",{className:"nice-etl-builder__toolbar",children:[e.jsx("input",{type:"text",value:h.name,onChange:i=>b(s=>({...s,name:i.target.value})),className:"nice-etl-builder__name-input"}),e.jsx("div",{className:"nice-etl-builder__tabs",children:["design","code","schedule","history"].map(i=>e.jsx("button",{className:`nice-etl-builder__tab ${v===i?"nice-etl-builder__tab--active":""}`,onClick:()=>E(i),children:c(`etlBuilder.tab.${i}`,i.charAt(0).toUpperCase()+i.slice(1))},i))}),e.jsxs("div",{className:"nice-etl-builder__actions",children:[e.jsxs("button",{onClick:R,disabled:B||!n,title:n?void 0:c("etlBuilder.runNotSetUp","Running pipelines is not set up"),className:"nice-etl-builder__run-btn",children:[e.jsx(f.NiceIcon,{name:B?"clock":"play",size:14})," ",B?c("etlBuilder.running","Running..."):c("etlBuilder.run","Run")]}),e.jsxs("button",{onClick:()=>l==null?void 0:l(h),disabled:!l,title:l?void 0:c("etlBuilder.saveNotSetUp","Saving pipelines is not set up"),className:"nice-etl-builder__save-btn",children:[e.jsx(f.NiceIcon,{name:"save",size:14})," ",c("save","Save")]}),e.jsx(g.NiceTutorialButton,{steps:g.resolveTutorial(r,q)})]})]}),children:[v==="design"&&e.jsx("div",{ref:z,className:"nice-etl-builder__canvas",onDragOver:i=>i.preventDefault(),onDrop:M,onClick:()=>_(null),children:e.jsxs("div",{className:"nice-etl-builder__flow",children:[e.jsxs("div",{className:"nice-etl-builder__column",children:[e.jsx("h5",{children:c("etlBuilder.sources","Sources")}),h.sources.map(i=>e.jsx(C,{node:i,nodeType:"source",icon:"database",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"source",id:i.id}),onDelete:()=>k("source",i.id)},i.id))]}),e.jsx("div",{className:"nice-etl-builder__arrow","aria-hidden":"true",children:e.jsx(f.NiceIcon,{name:"arrow-right",size:16})}),e.jsxs("div",{className:"nice-etl-builder__column nice-etl-builder__column--transforms",children:[e.jsx("h5",{children:c("etlBuilder.transformations","Transformations")}),h.transformations.map(i=>{const s=w.find(a=>a.type===i.type);return e.jsx(C,{node:i,nodeType:"transformation",icon:(s==null?void 0:s.icon)||"shuffle",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"transformation",id:i.id}),onDelete:()=>k("transformation",i.id)},i.id)}),h.transformations.length===0&&e.jsx("div",{className:"nice-etl-builder__empty-column",children:c("etlBuilder.dragTransformationsHere","Drag transformations here")})]}),e.jsx("div",{className:"nice-etl-builder__arrow","aria-hidden":"true",children:e.jsx(f.NiceIcon,{name:"arrow-right",size:16})}),e.jsxs("div",{className:"nice-etl-builder__column",children:[e.jsx("h5",{children:c("etlBuilder.destinations","Destinations")}),h.destinations.map(i=>e.jsx(C,{node:i,nodeType:"destination",icon:"download",isSelected:(u==null?void 0:u.id)===i.id,onSelect:()=>_({type:"destination",id:i.id}),onDelete:()=>k("destination",i.id)},i.id))]})]})}),v==="code"&&e.jsx("div",{className:"nice-etl-builder__code-view",children:e.jsx("pre",{children:JSON.stringify(h,null,2)})}),v==="schedule"&&e.jsx(G,{schedule:h.schedule,monitoring:h.monitoring,onChange:U}),v==="history"&&e.jsx(Q,{runs:L})]})}function Y(o){switch(o){case"filter":return{condition:""};case"map":return{mappings:[]};case"aggregate":return{groupBy:[],aggregations:[]};case"join":return{joinType:"inner",leftKey:"",rightKey:""};case"union":return{inputs:[]};case"sort":return{columns:[],directions:[]};case"deduplicate":return{columns:[],keepFirst:!0};case"pivot":return{pivotColumn:"",valueColumn:"",aggregation:"sum"};case"unpivot":return{columns:[],nameColumn:"name",valueColumn:"value"};case"derive":return{name:"",expression:""};case"validate":return{rules:[]};case"cleanse":return{operations:[]};case"custom":return{code:`// Custom transformation
2
+ return data;`};default:return{}}}function C({node:o,nodeType:t,icon:d,isSelected:n,onSelect:p,onDelete:l}){const{t:j}=g.useNiceTranslation();return e.jsxs("div",{className:`nice-etl-builder__node nice-etl-builder__node--${t} ${n?"nice-etl-builder__node--selected":""}`,onClick:r=>{r.stopPropagation(),p()},children:[e.jsx("span",{className:"nice-etl-builder__node-icon",children:P(d)}),e.jsx("span",{className:"nice-etl-builder__node-name",children:o.name}),e.jsx("button",{"aria-label":j("etlBuilder.close","Close"),className:"nice-etl-builder__node-delete",onClick:r=>{r.stopPropagation(),l()},children:e.jsx(f.NiceIcon,{name:"close",size:14})})]})}function J({nodeType:o,node:t,dataSources:d,onChange:n,onClose:p}){var j;const{t:l}=g.useNiceTranslation();return t?e.jsxs("div",{className:"nice-etl-builder__properties",children:[e.jsxs("div",{className:"nice-etl-builder__properties-header",children:[e.jsx("h4",{children:o==="source"?l("etlBuilder.sourceProperties","Source Properties"):o==="transformation"?l("etlBuilder.transformationProperties","Transformation Properties"):o==="destination"?l("etlBuilder.destinationProperties","Destination Properties"):l("etlBuilder.properties","{type} Properties").replace("{type}",o.charAt(0).toUpperCase()+o.slice(1))}),e.jsx("button",{onClick:p,"aria-label":l("etlBuilder.close","Close"),children:e.jsx(f.NiceIcon,{name:"close",size:14})})]}),e.jsxs("div",{className:"nice-etl-builder__properties-content",children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.name","Name")}),e.jsx("input",{type:"text",value:t.name,onChange:r=>n({name:r.target.value})})]}),o==="source"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.type","Type")}),e.jsxs("select",{value:t.type,onChange:r=>n({type:r.target.value}),children:[e.jsx("option",{value:"database",children:l("etlBuilder.database","Database")}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"file",children:l("etlBuilder.file","File")}),e.jsx("option",{value:"stream",children:l("etlBuilder.stream","Stream")})]})]}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:((j=t.incremental)==null?void 0:j.enabled)||!1,onChange:r=>{var c;return n({incremental:{...t.incremental,enabled:r.target.checked,column:((c=t.incremental)==null?void 0:c.column)||""}})}}),l("etlBuilder.incrementalLoad","Incremental Load")]})})]}),o==="transformation"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.type","Type")}),e.jsx("span",{children:t.type})]}),t.type==="filter"&&e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.condition","Condition")}),e.jsx("textarea",{value:String(t.config.condition||""),onChange:r=>n({config:{...t.config,condition:r.target.value}}),placeholder:l("etlBuilder.conditionPlaceholder","e.g., age > 18 AND status = 'active'"),rows:3})]}),t.type==="derive"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.columnName","Column Name")}),e.jsx("input",{type:"text",value:String(t.config.name||""),onChange:r=>n({config:{...t.config,name:r.target.value}})})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.expression","Expression")}),e.jsx("input",{type:"text",value:String(t.config.expression||""),onChange:r=>n({config:{...t.config,expression:r.target.value}}),placeholder:l("etlBuilder.expressionPlaceholder","e.g., price * quantity")})]})]}),t.type==="custom"&&e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.code","Code")}),e.jsx("textarea",{value:String(t.config.code||""),onChange:r=>n({config:{...t.config,code:r.target.value}}),rows:10,className:"nice-etl-builder__code-input"})]})]}),o==="destination"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.type","Type")}),e.jsxs("select",{value:t.type,onChange:r=>n({type:r.target.value}),children:[e.jsx("option",{value:"database",children:l("etlBuilder.database","Database")}),e.jsx("option",{value:"file",children:l("etlBuilder.file","File")}),e.jsx("option",{value:"api",children:"API"}),e.jsx("option",{value:"warehouse",children:l("etlBuilder.dataWarehouse","Data Warehouse")})]})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:l("etlBuilder.writeMode","Write Mode")}),e.jsxs("select",{value:t.writeMode,onChange:r=>n({writeMode:r.target.value}),children:[e.jsx("option",{value:"append",children:l("etlBuilder.append","Append")}),e.jsx("option",{value:"overwrite",children:l("etlBuilder.overwrite","Overwrite")}),e.jsx("option",{value:"upsert",children:l("etlBuilder.upsert","Upsert")}),e.jsx("option",{value:"merge",children:l("etlBuilder.merge","Merge")})]})]})]})]})]}):e.jsx(e.Fragment,{})}function G({schedule:o,monitoring:t,onChange:d}){const{t:n}=g.useNiceTranslation(),[p,l]=m.useState(o||{enabled:!1});return e.jsxs("div",{className:"nice-etl-builder__schedule-editor",children:[e.jsx("h4",{children:n("etlBuilder.scheduleConfiguration","Schedule Configuration")}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:p.enabled,onChange:j=>{const r={...p,enabled:j.target.checked};l(r),d(r)}}),n("etlBuilder.enableScheduledExecution","Enable scheduled execution")]})}),p.enabled&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.cronExpression","Cron Expression")}),e.jsx("input",{type:"text",value:p.cron||"",onChange:j=>{const r={...p,cron:j.target.value};l(r)},placeholder:n("etlBuilder.cronPlaceholder","0 * * * * (every hour)")}),e.jsx("small",{children:n("etlBuilder.cronFormat","Format: minute hour day month weekday")})]}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.timezone","Timezone")}),e.jsxs("select",{value:p.timezone||"UTC",onChange:j=>{const r={...p,timezone:j.target.value};l(r)},children:[e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:n("etlBuilder.easternTime","Eastern Time")}),e.jsx("option",{value:"America/Chicago",children:n("etlBuilder.centralTime","Central Time")}),e.jsx("option",{value:"America/Los_Angeles",children:n("etlBuilder.pacificTime","Pacific Time")}),e.jsx("option",{value:"Europe/London",children:n("etlBuilder.london","London")}),e.jsx("option",{value:"Europe/Warsaw",children:n("etlBuilder.warsaw","Warsaw")})]})]}),e.jsx("button",{onClick:()=>d(p),children:n("etlBuilder.saveSchedule","Save Schedule")})]}),e.jsx("h4",{children:n("etlBuilder.monitoring","Monitoring")}),e.jsx("div",{className:"nice-etl-builder__field",children:e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:(t==null?void 0:t.alertOnFailure)||!1,disabled:!0}),n("etlBuilder.alertOnFailure","Alert on failure")]})}),e.jsxs("div",{className:"nice-etl-builder__field",children:[e.jsx("label",{children:n("etlBuilder.logLevel","Log Level")}),e.jsxs("select",{value:(t==null?void 0:t.logLevel)||"info",disabled:!0,children:[e.jsx("option",{value:"error",children:n("etlBuilder.error","Error")}),e.jsx("option",{value:"warn",children:n("etlBuilder.warning","Warning")}),e.jsx("option",{value:"info",children:n("etlBuilder.info","Info")}),e.jsx("option",{value:"debug",children:n("etlBuilder.debug","Debug")})]})]})]})}function Q({runs:o}){const{t}=g.useNiceTranslation();return e.jsxs("div",{className:"nice-etl-builder__history-view",children:[e.jsx("h4",{children:t("etlBuilder.runHistory","Run History")}),o.length===0?e.jsx("div",{className:"nice-etl-builder__no-history",children:t("etlBuilder.noRunsYet","No runs yet")}):e.jsxs("table",{className:"nice-etl-builder__history-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("etlBuilder.status","Status")}),e.jsx("th",{children:t("etlBuilder.startTime","Start Time")}),e.jsx("th",{children:t("etlBuilder.duration","Duration")}),e.jsx("th",{children:t("etlBuilder.rows","Rows")}),e.jsx("th",{children:t("etlBuilder.errors","Errors")})]})}),e.jsx("tbody",{children:o.map(d=>e.jsxs("tr",{className:`nice-etl-builder__run nice-etl-builder__run--${d.status}`,children:[e.jsx("td",{children:e.jsxs("span",{className:`nice-etl-builder__status nice-etl-builder__status--${d.status}`,children:[e.jsx(f.NiceIcon,{name:d.status==="success"?"check":d.status==="failed"?"close":"clock",size:12}),d.status]})}),e.jsx("td",{children:d.startTime.toLocaleString()}),e.jsx("td",{children:d.endTime?`${Math.round((d.endTime.getTime()-d.startTime.getTime())/1e3)}s`:"-"}),e.jsxs("td",{children:[d.rowsProcessed.toLocaleString()," / ",d.rowsWritten.toLocaleString()]}),e.jsx("td",{children:d.errors.length})]},d.id))})]})]})}exports.NiceETLBuilder=V;
package/dist/index.mjs CHANGED
@@ -18,7 +18,7 @@ const Z = [
18
18
  transformations: [],
19
19
  destinations: [],
20
20
  version: 1
21
- }, R = (u) => /^[a-z][a-z0-9-]*$/.test(u) ? /* @__PURE__ */ e(g, { name: u, size: 16 }) : u, E = [
21
+ }, R = (u) => /^[a-z][a-z0-9-]*$/.test(u) ? /* @__PURE__ */ e(g, { name: u, size: 16 }) : u, x = [
22
22
  { type: "filter", key: "etlBuilder.transform.filter", label: "Filter", icon: "filter" },
23
23
  { type: "map", key: "etlBuilder.transform.map", label: "Map", icon: "shuffle" },
24
24
  { type: "aggregate", key: "etlBuilder.transform.aggregate", label: "Aggregate", icon: "∑" },
@@ -41,23 +41,23 @@ const Z = [
41
41
  { type: "cleanse", key: "etlBuilder.transform.cleanse", label: "Cleanse", icon: "wand" },
42
42
  { type: "custom", key: "etlBuilder.transform.custom", label: "Custom", icon: "ƒ" }
43
43
  ];
44
- function se({
44
+ function ce({
45
45
  pipeline: u,
46
46
  dataSources: t = [],
47
47
  onChange: o,
48
- onRun: n,
48
+ onRun: r,
49
49
  onSchedule: h,
50
- onSave: r,
50
+ onSave: n,
51
51
  className: f = "",
52
- tutorial: c
52
+ tutorial: s
53
53
  }) {
54
- const { t: s } = C(), [m, U] = N(
54
+ const { t: c } = C(), [m, U] = N(
55
55
  () => u || {
56
56
  ...ee,
57
57
  id: w(),
58
- name: s("etlBuilder.newPipeline", "New Pipeline")
58
+ name: c("etlBuilder.newPipeline", "New Pipeline")
59
59
  }
60
- ), [p, v] = N(null), [B, F] = N("design"), [S, P] = N(!1), [M, I] = N([]), [T, D] = N(null), $ = X(null), _ = y(
60
+ ), [p, v] = N(null), [B, F] = N("design"), [S, L] = N(!1), [M, I] = N([]), [T, D] = N(null), $ = X(null), _ = y(
61
61
  (i) => {
62
62
  U((a) => {
63
63
  const d = i(a);
@@ -87,8 +87,8 @@ function se({
87
87
  id: w(),
88
88
  type: i,
89
89
  name: (() => {
90
- const b = E.find((J) => J.type === i);
91
- return b ? s(b.key, b.label) : i;
90
+ const b = x.find((J) => J.type === i);
91
+ return b ? c(b.key, b.label) : i;
92
92
  })(),
93
93
  input: [],
94
94
  output: w(),
@@ -99,12 +99,12 @@ function se({
99
99
  transformations: [...b.transformations, d]
100
100
  })), v({ type: "transformation", id: d.id });
101
101
  },
102
- [_, s]
102
+ [_, c]
103
103
  ), W = y(() => {
104
104
  const i = {
105
105
  id: w(),
106
106
  type: "database",
107
- name: s("etlBuilder.newDestination", "New Destination"),
107
+ name: c("etlBuilder.newDestination", "New Destination"),
108
108
  config: {},
109
109
  writeMode: "append"
110
110
  };
@@ -112,7 +112,7 @@ function se({
112
112
  ...a,
113
113
  destinations: [...a.destinations, i]
114
114
  })), v({ type: "destination", id: i.id });
115
- }, [_, s]), x = y(
115
+ }, [_, c]), P = y(
116
116
  (i, a) => {
117
117
  _((d) => {
118
118
  switch (i) {
@@ -132,16 +132,16 @@ function se({
132
132
  },
133
133
  [_]
134
134
  ), O = y(async () => {
135
- if (n) {
136
- P(!0);
135
+ if (r) {
136
+ L(!0);
137
137
  try {
138
- const i = await n(m);
138
+ const i = await r(m);
139
139
  I((a) => [i, ...a].slice(0, 50));
140
140
  } finally {
141
- P(!1);
141
+ L(!1);
142
142
  }
143
143
  }
144
- }, [m, n]), H = y(
144
+ }, [m, r]), H = y(
145
145
  (i) => {
146
146
  _((a) => ({ ...a, schedule: i })), h == null || h(m, i);
147
147
  },
@@ -171,7 +171,7 @@ function se({
171
171
  return null;
172
172
  }
173
173
  }, V = B === "design" ? /* @__PURE__ */ l("div", { className: "nice-etl-builder__palette", children: [
174
- /* @__PURE__ */ e("h4", { children: s("etlBuilder.sources", "Sources") }),
174
+ /* @__PURE__ */ e("h4", { children: c("etlBuilder.sources", "Sources") }),
175
175
  t.map((i) => /* @__PURE__ */ l("div", { className: "nice-etl-builder__palette-item", onClick: () => A(i), children: [
176
176
  /* @__PURE__ */ e("span", { className: "nice-etl-builder__palette-icon", children: /* @__PURE__ */ e(g, { name: "database", size: 14 }) }),
177
177
  /* @__PURE__ */ e("span", { children: i.name })
@@ -181,19 +181,19 @@ function se({
181
181
  {
182
182
  onClick: () => A({
183
183
  id: "",
184
- name: s("etlBuilder.newSource", "New Source"),
184
+ name: c("etlBuilder.newSource", "New Source"),
185
185
  type: "database",
186
186
  config: {}
187
187
  }),
188
188
  children: [
189
189
  /* @__PURE__ */ e(g, { name: "plus", size: 14 }),
190
190
  " ",
191
- s("etlBuilder.addSource", "Add Source")
191
+ c("etlBuilder.addSource", "Add Source")
192
192
  ]
193
193
  }
194
194
  ),
195
- /* @__PURE__ */ e("h4", { children: s("etlBuilder.transformations", "Transformations") }),
196
- E.map((i) => /* @__PURE__ */ l(
195
+ /* @__PURE__ */ e("h4", { children: c("etlBuilder.transformations", "Transformations") }),
196
+ x.map((i) => /* @__PURE__ */ l(
197
197
  "div",
198
198
  {
199
199
  className: "nice-etl-builder__palette-item",
@@ -202,16 +202,16 @@ function se({
202
202
  onDragEnd: () => D(null),
203
203
  children: [
204
204
  /* @__PURE__ */ e("span", { className: "nice-etl-builder__palette-icon", children: R(i.icon) }),
205
- /* @__PURE__ */ e("span", { children: s(i.key, i.label) })
205
+ /* @__PURE__ */ e("span", { children: c(i.key, i.label) })
206
206
  ]
207
207
  },
208
208
  i.type
209
209
  )),
210
- /* @__PURE__ */ e("h4", { children: s("etlBuilder.destinations", "Destinations") }),
210
+ /* @__PURE__ */ e("h4", { children: c("etlBuilder.destinations", "Destinations") }),
211
211
  /* @__PURE__ */ l("button", { onClick: W, children: [
212
212
  /* @__PURE__ */ e(g, { name: "plus", size: 14 }),
213
213
  " ",
214
- s("etlBuilder.addDestination", "Add Destination")
214
+ c("etlBuilder.addDestination", "Add Destination")
215
215
  ] })
216
216
  ] }) : void 0, Y = p && B === "design" ? /* @__PURE__ */ e(
217
217
  le,
@@ -275,7 +275,7 @@ function se({
275
275
  {
276
276
  className: `nice-etl-builder__tab ${B === i ? "nice-etl-builder__tab--active" : ""}`,
277
277
  onClick: () => F(i),
278
- children: s(`etlBuilder.tab.${i}`, i.charAt(0).toUpperCase() + i.slice(1))
278
+ children: c(`etlBuilder.tab.${i}`, i.charAt(0).toUpperCase() + i.slice(1))
279
279
  },
280
280
  i
281
281
  )) }),
@@ -284,31 +284,31 @@ function se({
284
284
  "button",
285
285
  {
286
286
  onClick: O,
287
- disabled: S || !n,
288
- title: n ? void 0 : s("etlBuilder.runNotSetUp", "Running pipelines is not set up"),
287
+ disabled: S || !r,
288
+ title: r ? void 0 : c("etlBuilder.runNotSetUp", "Running pipelines is not set up"),
289
289
  className: "nice-etl-builder__run-btn",
290
290
  children: [
291
291
  /* @__PURE__ */ e(g, { name: S ? "clock" : "play", size: 14 }),
292
292
  " ",
293
- S ? s("etlBuilder.running", "Running...") : s("etlBuilder.run", "Run")
293
+ S ? c("etlBuilder.running", "Running...") : c("etlBuilder.run", "Run")
294
294
  ]
295
295
  }
296
296
  ),
297
297
  /* @__PURE__ */ l(
298
298
  "button",
299
299
  {
300
- onClick: () => r == null ? void 0 : r(m),
301
- disabled: !r,
302
- title: r ? void 0 : s("etlBuilder.saveNotSetUp", "Saving pipelines is not set up"),
300
+ onClick: () => n == null ? void 0 : n(m),
301
+ disabled: !n,
302
+ title: n ? void 0 : c("etlBuilder.saveNotSetUp", "Saving pipelines is not set up"),
303
303
  className: "nice-etl-builder__save-btn",
304
304
  children: [
305
305
  /* @__PURE__ */ e(g, { name: "save", size: 14 }),
306
306
  " ",
307
- s("save", "Save")
307
+ c("save", "Save")
308
308
  ]
309
309
  }
310
310
  ),
311
- /* @__PURE__ */ e(G, { steps: Q(c, Z) })
311
+ /* @__PURE__ */ e(G, { steps: Q(s, Z) })
312
312
  ] })
313
313
  ] }),
314
314
  children: [
@@ -322,52 +322,52 @@ function se({
322
322
  onClick: () => v(null),
323
323
  children: /* @__PURE__ */ l("div", { className: "nice-etl-builder__flow", children: [
324
324
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__column", children: [
325
- /* @__PURE__ */ e("h5", { children: s("etlBuilder.sources", "Sources") }),
325
+ /* @__PURE__ */ e("h5", { children: c("etlBuilder.sources", "Sources") }),
326
326
  m.sources.map((i) => /* @__PURE__ */ e(
327
- L,
327
+ E,
328
328
  {
329
329
  node: i,
330
330
  nodeType: "source",
331
331
  icon: "database",
332
332
  isSelected: (p == null ? void 0 : p.id) === i.id,
333
333
  onSelect: () => v({ type: "source", id: i.id }),
334
- onDelete: () => x("source", i.id)
334
+ onDelete: () => P("source", i.id)
335
335
  },
336
336
  i.id
337
337
  ))
338
338
  ] }),
339
339
  /* @__PURE__ */ e("div", { className: "nice-etl-builder__arrow", "aria-hidden": "true", children: /* @__PURE__ */ e(g, { name: "arrow-right", size: 16 }) }),
340
340
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__column nice-etl-builder__column--transforms", children: [
341
- /* @__PURE__ */ e("h5", { children: s("etlBuilder.transformations", "Transformations") }),
341
+ /* @__PURE__ */ e("h5", { children: c("etlBuilder.transformations", "Transformations") }),
342
342
  m.transformations.map((i) => {
343
- const a = E.find((d) => d.type === i.type);
343
+ const a = x.find((d) => d.type === i.type);
344
344
  return /* @__PURE__ */ e(
345
- L,
345
+ E,
346
346
  {
347
347
  node: i,
348
348
  nodeType: "transformation",
349
349
  icon: (a == null ? void 0 : a.icon) || "shuffle",
350
350
  isSelected: (p == null ? void 0 : p.id) === i.id,
351
351
  onSelect: () => v({ type: "transformation", id: i.id }),
352
- onDelete: () => x("transformation", i.id)
352
+ onDelete: () => P("transformation", i.id)
353
353
  },
354
354
  i.id
355
355
  );
356
356
  }),
357
- m.transformations.length === 0 && /* @__PURE__ */ e("div", { className: "nice-etl-builder__empty-column", children: s("etlBuilder.dragTransformationsHere", "Drag transformations here") })
357
+ m.transformations.length === 0 && /* @__PURE__ */ e("div", { className: "nice-etl-builder__empty-column", children: c("etlBuilder.dragTransformationsHere", "Drag transformations here") })
358
358
  ] }),
359
359
  /* @__PURE__ */ e("div", { className: "nice-etl-builder__arrow", "aria-hidden": "true", children: /* @__PURE__ */ e(g, { name: "arrow-right", size: 16 }) }),
360
360
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__column", children: [
361
- /* @__PURE__ */ e("h5", { children: s("etlBuilder.destinations", "Destinations") }),
361
+ /* @__PURE__ */ e("h5", { children: c("etlBuilder.destinations", "Destinations") }),
362
362
  m.destinations.map((i) => /* @__PURE__ */ e(
363
- L,
363
+ E,
364
364
  {
365
365
  node: i,
366
366
  nodeType: "destination",
367
367
  icon: "download",
368
368
  isSelected: (p == null ? void 0 : p.id) === i.id,
369
369
  onSelect: () => v({ type: "destination", id: i.id }),
370
- onDelete: () => x("destination", i.id)
370
+ onDelete: () => P("destination", i.id)
371
371
  },
372
372
  i.id
373
373
  ))
@@ -422,20 +422,21 @@ return data;` };
422
422
  return {};
423
423
  }
424
424
  }
425
- function L({
425
+ function E({
426
426
  node: u,
427
427
  nodeType: t,
428
428
  icon: o,
429
- isSelected: n,
429
+ isSelected: r,
430
430
  onSelect: h,
431
- onDelete: r
431
+ onDelete: n
432
432
  }) {
433
+ const { t: f } = C();
433
434
  return /* @__PURE__ */ l(
434
435
  "div",
435
436
  {
436
- className: `nice-etl-builder__node nice-etl-builder__node--${t} ${n ? "nice-etl-builder__node--selected" : ""}`,
437
- onClick: (f) => {
438
- f.stopPropagation(), h();
437
+ className: `nice-etl-builder__node nice-etl-builder__node--${t} ${r ? "nice-etl-builder__node--selected" : ""}`,
438
+ onClick: (s) => {
439
+ s.stopPropagation(), h();
439
440
  },
440
441
  children: [
441
442
  /* @__PURE__ */ e("span", { className: "nice-etl-builder__node-icon", children: R(o) }),
@@ -443,11 +444,12 @@ function L({
443
444
  /* @__PURE__ */ e(
444
445
  "button",
445
446
  {
447
+ "aria-label": f("etlBuilder.close", "Close"),
446
448
  className: "nice-etl-builder__node-delete",
447
- onClick: (f) => {
448
- f.stopPropagation(), r();
449
+ onClick: (s) => {
450
+ s.stopPropagation(), n();
449
451
  },
450
- children: "×"
452
+ children: /* @__PURE__ */ e(g, { name: "close", size: 14 })
451
453
  }
452
454
  )
453
455
  ]
@@ -458,44 +460,44 @@ function le({
458
460
  nodeType: u,
459
461
  node: t,
460
462
  dataSources: o,
461
- onChange: n,
463
+ onChange: r,
462
464
  onClose: h
463
465
  }) {
464
466
  var f;
465
- const { t: r } = C();
467
+ const { t: n } = C();
466
468
  return t ? /* @__PURE__ */ l("div", { className: "nice-etl-builder__properties", children: [
467
469
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__properties-header", children: [
468
- /* @__PURE__ */ l("h4", { children: [
469
- u.charAt(0).toUpperCase() + u.slice(1),
470
- " Properties"
471
- ] }),
472
- /* @__PURE__ */ e("button", { onClick: h, children: "×" })
470
+ /* @__PURE__ */ e("h4", { children: u === "source" ? n("etlBuilder.sourceProperties", "Source Properties") : u === "transformation" ? n("etlBuilder.transformationProperties", "Transformation Properties") : u === "destination" ? n("etlBuilder.destinationProperties", "Destination Properties") : n("etlBuilder.properties", "{type} Properties").replace(
471
+ "{type}",
472
+ u.charAt(0).toUpperCase() + u.slice(1)
473
+ ) }),
474
+ /* @__PURE__ */ e("button", { onClick: h, "aria-label": n("etlBuilder.close", "Close"), children: /* @__PURE__ */ e(g, { name: "close", size: 14 }) })
473
475
  ] }),
474
476
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__properties-content", children: [
475
477
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
476
- /* @__PURE__ */ e("label", { children: r("etlBuilder.name", "Name") }),
478
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.name", "Name") }),
477
479
  /* @__PURE__ */ e(
478
480
  "input",
479
481
  {
480
482
  type: "text",
481
483
  value: t.name,
482
- onChange: (c) => n({ name: c.target.value })
484
+ onChange: (s) => r({ name: s.target.value })
483
485
  }
484
486
  )
485
487
  ] }),
486
488
  u === "source" && /* @__PURE__ */ l(k, { children: [
487
489
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
488
- /* @__PURE__ */ e("label", { children: r("etlBuilder.type", "Type") }),
490
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.type", "Type") }),
489
491
  /* @__PURE__ */ l(
490
492
  "select",
491
493
  {
492
494
  value: t.type,
493
- onChange: (c) => n({ type: c.target.value }),
495
+ onChange: (s) => r({ type: s.target.value }),
494
496
  children: [
495
- /* @__PURE__ */ e("option", { value: "database", children: r("etlBuilder.database", "Database") }),
497
+ /* @__PURE__ */ e("option", { value: "database", children: n("etlBuilder.database", "Database") }),
496
498
  /* @__PURE__ */ e("option", { value: "api", children: "API" }),
497
- /* @__PURE__ */ e("option", { value: "file", children: r("etlBuilder.file", "File") }),
498
- /* @__PURE__ */ e("option", { value: "stream", children: r("etlBuilder.stream", "Stream") })
499
+ /* @__PURE__ */ e("option", { value: "file", children: n("etlBuilder.file", "File") }),
500
+ /* @__PURE__ */ e("option", { value: "stream", children: n("etlBuilder.stream", "Stream") })
499
501
  ]
500
502
  }
501
503
  )
@@ -506,36 +508,36 @@ function le({
506
508
  {
507
509
  type: "checkbox",
508
510
  checked: ((f = t.incremental) == null ? void 0 : f.enabled) || !1,
509
- onChange: (c) => {
510
- var s;
511
- return n({
511
+ onChange: (s) => {
512
+ var c;
513
+ return r({
512
514
  incremental: {
513
515
  ...t.incremental,
514
- enabled: c.target.checked,
515
- column: ((s = t.incremental) == null ? void 0 : s.column) || ""
516
+ enabled: s.target.checked,
517
+ column: ((c = t.incremental) == null ? void 0 : c.column) || ""
516
518
  }
517
519
  });
518
520
  }
519
521
  }
520
522
  ),
521
- r("etlBuilder.incrementalLoad", "Incremental Load")
523
+ n("etlBuilder.incrementalLoad", "Incremental Load")
522
524
  ] }) })
523
525
  ] }),
524
526
  u === "transformation" && /* @__PURE__ */ l(k, { children: [
525
527
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
526
- /* @__PURE__ */ e("label", { children: r("etlBuilder.type", "Type") }),
528
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.type", "Type") }),
527
529
  /* @__PURE__ */ e("span", { children: t.type })
528
530
  ] }),
529
531
  t.type === "filter" && /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
530
- /* @__PURE__ */ e("label", { children: r("etlBuilder.condition", "Condition") }),
532
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.condition", "Condition") }),
531
533
  /* @__PURE__ */ e(
532
534
  "textarea",
533
535
  {
534
536
  value: String(t.config.condition || ""),
535
- onChange: (c) => n({
536
- config: { ...t.config, condition: c.target.value }
537
+ onChange: (s) => r({
538
+ config: { ...t.config, condition: s.target.value }
537
539
  }),
538
- placeholder: r(
540
+ placeholder: n(
539
541
  "etlBuilder.conditionPlaceholder",
540
542
  "e.g., age > 18 AND status = 'active'"
541
543
  ),
@@ -545,44 +547,44 @@ function le({
545
547
  ] }),
546
548
  t.type === "derive" && /* @__PURE__ */ l(k, { children: [
547
549
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
548
- /* @__PURE__ */ e("label", { children: r("etlBuilder.columnName", "Column Name") }),
550
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.columnName", "Column Name") }),
549
551
  /* @__PURE__ */ e(
550
552
  "input",
551
553
  {
552
554
  type: "text",
553
555
  value: String(t.config.name || ""),
554
- onChange: (c) => n({
555
- config: { ...t.config, name: c.target.value }
556
+ onChange: (s) => r({
557
+ config: { ...t.config, name: s.target.value }
556
558
  })
557
559
  }
558
560
  )
559
561
  ] }),
560
562
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
561
- /* @__PURE__ */ e("label", { children: r("etlBuilder.expression", "Expression") }),
563
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.expression", "Expression") }),
562
564
  /* @__PURE__ */ e(
563
565
  "input",
564
566
  {
565
567
  type: "text",
566
568
  value: String(t.config.expression || ""),
567
- onChange: (c) => n({
569
+ onChange: (s) => r({
568
570
  config: {
569
571
  ...t.config,
570
- expression: c.target.value
572
+ expression: s.target.value
571
573
  }
572
574
  }),
573
- placeholder: r("etlBuilder.expressionPlaceholder", "e.g., price * quantity")
575
+ placeholder: n("etlBuilder.expressionPlaceholder", "e.g., price * quantity")
574
576
  }
575
577
  )
576
578
  ] })
577
579
  ] }),
578
580
  t.type === "custom" && /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
579
- /* @__PURE__ */ e("label", { children: r("etlBuilder.code", "Code") }),
581
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.code", "Code") }),
580
582
  /* @__PURE__ */ e(
581
583
  "textarea",
582
584
  {
583
585
  value: String(t.config.code || ""),
584
- onChange: (c) => n({
585
- config: { ...t.config, code: c.target.value }
586
+ onChange: (s) => r({
587
+ config: { ...t.config, code: s.target.value }
586
588
  }),
587
589
  rows: 10,
588
590
  className: "nice-etl-builder__code-input"
@@ -592,33 +594,33 @@ function le({
592
594
  ] }),
593
595
  u === "destination" && /* @__PURE__ */ l(k, { children: [
594
596
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
595
- /* @__PURE__ */ e("label", { children: r("etlBuilder.type", "Type") }),
597
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.type", "Type") }),
596
598
  /* @__PURE__ */ l(
597
599
  "select",
598
600
  {
599
601
  value: t.type,
600
- onChange: (c) => n({ type: c.target.value }),
602
+ onChange: (s) => r({ type: s.target.value }),
601
603
  children: [
602
- /* @__PURE__ */ e("option", { value: "database", children: r("etlBuilder.database", "Database") }),
603
- /* @__PURE__ */ e("option", { value: "file", children: r("etlBuilder.file", "File") }),
604
+ /* @__PURE__ */ e("option", { value: "database", children: n("etlBuilder.database", "Database") }),
605
+ /* @__PURE__ */ e("option", { value: "file", children: n("etlBuilder.file", "File") }),
604
606
  /* @__PURE__ */ e("option", { value: "api", children: "API" }),
605
- /* @__PURE__ */ e("option", { value: "warehouse", children: r("etlBuilder.dataWarehouse", "Data Warehouse") })
607
+ /* @__PURE__ */ e("option", { value: "warehouse", children: n("etlBuilder.dataWarehouse", "Data Warehouse") })
606
608
  ]
607
609
  }
608
610
  )
609
611
  ] }),
610
612
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
611
- /* @__PURE__ */ e("label", { children: r("etlBuilder.writeMode", "Write Mode") }),
613
+ /* @__PURE__ */ e("label", { children: n("etlBuilder.writeMode", "Write Mode") }),
612
614
  /* @__PURE__ */ l(
613
615
  "select",
614
616
  {
615
617
  value: t.writeMode,
616
- onChange: (c) => n({ writeMode: c.target.value }),
618
+ onChange: (s) => r({ writeMode: s.target.value }),
617
619
  children: [
618
- /* @__PURE__ */ e("option", { value: "append", children: r("etlBuilder.append", "Append") }),
619
- /* @__PURE__ */ e("option", { value: "overwrite", children: r("etlBuilder.overwrite", "Overwrite") }),
620
- /* @__PURE__ */ e("option", { value: "upsert", children: r("etlBuilder.upsert", "Upsert") }),
621
- /* @__PURE__ */ e("option", { value: "merge", children: r("etlBuilder.merge", "Merge") })
620
+ /* @__PURE__ */ e("option", { value: "append", children: n("etlBuilder.append", "Append") }),
621
+ /* @__PURE__ */ e("option", { value: "overwrite", children: n("etlBuilder.overwrite", "Overwrite") }),
622
+ /* @__PURE__ */ e("option", { value: "upsert", children: n("etlBuilder.upsert", "Upsert") }),
623
+ /* @__PURE__ */ e("option", { value: "merge", children: n("etlBuilder.merge", "Merge") })
622
624
  ]
623
625
  }
624
626
  )
@@ -632,9 +634,9 @@ function te({
632
634
  monitoring: t,
633
635
  onChange: o
634
636
  }) {
635
- const { t: n } = C(), [h, r] = N(u || { enabled: !1 });
637
+ const { t: r } = C(), [h, n] = N(u || { enabled: !1 });
636
638
  return /* @__PURE__ */ l("div", { className: "nice-etl-builder__schedule-editor", children: [
637
- /* @__PURE__ */ e("h4", { children: n("etlBuilder.scheduleConfiguration", "Schedule Configuration") }),
639
+ /* @__PURE__ */ e("h4", { children: r("etlBuilder.scheduleConfiguration", "Schedule Configuration") }),
638
640
  /* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */ l("label", { children: [
639
641
  /* @__PURE__ */ e(
640
642
  "input",
@@ -642,65 +644,65 @@ function te({
642
644
  type: "checkbox",
643
645
  checked: h.enabled,
644
646
  onChange: (f) => {
645
- const c = { ...h, enabled: f.target.checked };
646
- r(c), o(c);
647
+ const s = { ...h, enabled: f.target.checked };
648
+ n(s), o(s);
647
649
  }
648
650
  }
649
651
  ),
650
- n("etlBuilder.enableScheduledExecution", "Enable scheduled execution")
652
+ r("etlBuilder.enableScheduledExecution", "Enable scheduled execution")
651
653
  ] }) }),
652
654
  h.enabled && /* @__PURE__ */ l(k, { children: [
653
655
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
654
- /* @__PURE__ */ e("label", { children: n("etlBuilder.cronExpression", "Cron Expression") }),
656
+ /* @__PURE__ */ e("label", { children: r("etlBuilder.cronExpression", "Cron Expression") }),
655
657
  /* @__PURE__ */ e(
656
658
  "input",
657
659
  {
658
660
  type: "text",
659
661
  value: h.cron || "",
660
662
  onChange: (f) => {
661
- const c = { ...h, cron: f.target.value };
662
- r(c);
663
+ const s = { ...h, cron: f.target.value };
664
+ n(s);
663
665
  },
664
- placeholder: n("etlBuilder.cronPlaceholder", "0 * * * * (every hour)")
666
+ placeholder: r("etlBuilder.cronPlaceholder", "0 * * * * (every hour)")
665
667
  }
666
668
  ),
667
- /* @__PURE__ */ e("small", { children: n("etlBuilder.cronFormat", "Format: minute hour day month weekday") })
669
+ /* @__PURE__ */ e("small", { children: r("etlBuilder.cronFormat", "Format: minute hour day month weekday") })
668
670
  ] }),
669
671
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
670
- /* @__PURE__ */ e("label", { children: n("etlBuilder.timezone", "Timezone") }),
672
+ /* @__PURE__ */ e("label", { children: r("etlBuilder.timezone", "Timezone") }),
671
673
  /* @__PURE__ */ l(
672
674
  "select",
673
675
  {
674
676
  value: h.timezone || "UTC",
675
677
  onChange: (f) => {
676
- const c = { ...h, timezone: f.target.value };
677
- r(c);
678
+ const s = { ...h, timezone: f.target.value };
679
+ n(s);
678
680
  },
679
681
  children: [
680
682
  /* @__PURE__ */ e("option", { value: "UTC", children: "UTC" }),
681
- /* @__PURE__ */ e("option", { value: "America/New_York", children: n("etlBuilder.easternTime", "Eastern Time") }),
682
- /* @__PURE__ */ e("option", { value: "America/Chicago", children: n("etlBuilder.centralTime", "Central Time") }),
683
- /* @__PURE__ */ e("option", { value: "America/Los_Angeles", children: n("etlBuilder.pacificTime", "Pacific Time") }),
684
- /* @__PURE__ */ e("option", { value: "Europe/London", children: n("etlBuilder.london", "London") }),
685
- /* @__PURE__ */ e("option", { value: "Europe/Warsaw", children: n("etlBuilder.warsaw", "Warsaw") })
683
+ /* @__PURE__ */ e("option", { value: "America/New_York", children: r("etlBuilder.easternTime", "Eastern Time") }),
684
+ /* @__PURE__ */ e("option", { value: "America/Chicago", children: r("etlBuilder.centralTime", "Central Time") }),
685
+ /* @__PURE__ */ e("option", { value: "America/Los_Angeles", children: r("etlBuilder.pacificTime", "Pacific Time") }),
686
+ /* @__PURE__ */ e("option", { value: "Europe/London", children: r("etlBuilder.london", "London") }),
687
+ /* @__PURE__ */ e("option", { value: "Europe/Warsaw", children: r("etlBuilder.warsaw", "Warsaw") })
686
688
  ]
687
689
  }
688
690
  )
689
691
  ] }),
690
- /* @__PURE__ */ e("button", { onClick: () => o(h), children: n("etlBuilder.saveSchedule", "Save Schedule") })
692
+ /* @__PURE__ */ e("button", { onClick: () => o(h), children: r("etlBuilder.saveSchedule", "Save Schedule") })
691
693
  ] }),
692
- /* @__PURE__ */ e("h4", { children: n("etlBuilder.monitoring", "Monitoring") }),
694
+ /* @__PURE__ */ e("h4", { children: r("etlBuilder.monitoring", "Monitoring") }),
693
695
  /* @__PURE__ */ e("div", { className: "nice-etl-builder__field", children: /* @__PURE__ */ l("label", { children: [
694
696
  /* @__PURE__ */ e("input", { type: "checkbox", checked: (t == null ? void 0 : t.alertOnFailure) || !1, disabled: !0 }),
695
- n("etlBuilder.alertOnFailure", "Alert on failure")
697
+ r("etlBuilder.alertOnFailure", "Alert on failure")
696
698
  ] }) }),
697
699
  /* @__PURE__ */ l("div", { className: "nice-etl-builder__field", children: [
698
- /* @__PURE__ */ e("label", { children: n("etlBuilder.logLevel", "Log Level") }),
700
+ /* @__PURE__ */ e("label", { children: r("etlBuilder.logLevel", "Log Level") }),
699
701
  /* @__PURE__ */ l("select", { value: (t == null ? void 0 : t.logLevel) || "info", disabled: !0, children: [
700
- /* @__PURE__ */ e("option", { value: "error", children: n("etlBuilder.error", "Error") }),
701
- /* @__PURE__ */ e("option", { value: "warn", children: n("etlBuilder.warning", "Warning") }),
702
- /* @__PURE__ */ e("option", { value: "info", children: n("etlBuilder.info", "Info") }),
703
- /* @__PURE__ */ e("option", { value: "debug", children: n("etlBuilder.debug", "Debug") })
702
+ /* @__PURE__ */ e("option", { value: "error", children: r("etlBuilder.error", "Error") }),
703
+ /* @__PURE__ */ e("option", { value: "warn", children: r("etlBuilder.warning", "Warning") }),
704
+ /* @__PURE__ */ e("option", { value: "info", children: r("etlBuilder.info", "Info") }),
705
+ /* @__PURE__ */ e("option", { value: "debug", children: r("etlBuilder.debug", "Debug") })
704
706
  ] })
705
707
  ] })
706
708
  ] });
@@ -754,5 +756,5 @@ function ne({ runs: u }) {
754
756
  ] });
755
757
  }
756
758
  export {
757
- se as NiceETLBuilder
759
+ ce as NiceETLBuilder
758
760
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nice2dev/ui-bi",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Nice2Dev Business Intelligence — Report builder, dashboard studio, ETL pipeline builder",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -33,14 +33,14 @@
33
33
  "prepublishOnly": "npm run build"
34
34
  },
35
35
  "peerDependencies": {
36
- "@nice2dev/ui": "^1.0.28",
37
- "@nice2dev/ui-core": "^1.0.28",
36
+ "@nice2dev/ui": "^1.2.0",
37
+ "@nice2dev/ui-core": "^1.2.0",
38
38
  "react": ">=17.0.0",
39
39
  "react-dom": ">=17.0.0"
40
40
  },
41
41
  "devDependencies": {
42
- "@nice2dev/ui": "^1.2.0",
43
- "@nice2dev/ui-core": "^1.2.0",
42
+ "@nice2dev/ui": "^1.2.2",
43
+ "@nice2dev/ui-core": "^1.2.2",
44
44
  "@testing-library/jest-dom": "^7.0.1",
45
45
  "@testing-library/react": "^16.3.3",
46
46
  "@types/react": "^19.2.18",