@omegagrid/dialog 0.2.5

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.
@@ -0,0 +1,56 @@
1
+ import { Layout, Overlay, VerticalPosition } from '@omegagrid/core';
2
+ import { LitElement } from 'lit';
3
+ import { DialogAlert, DialogButton, DialogLocation, DialogOptions } from '../types';
4
+ export declare class DialogEvent extends Event {
5
+ readonly dialog: Dialog;
6
+ readonly button: DialogButton;
7
+ constructor(type: string, dialog: Dialog, button: DialogButton);
8
+ }
9
+ export declare class Dialog extends LitElement implements Layout {
10
+ static styles: import("lit").CSSResult[];
11
+ resizable: boolean;
12
+ closable: boolean;
13
+ scrollable: boolean;
14
+ disableButtons: boolean;
15
+ disableAutoclose: boolean;
16
+ buttonPosition: VerticalPosition;
17
+ alertPosition: VerticalPosition;
18
+ component: HTMLElement;
19
+ header: string;
20
+ width: string | number;
21
+ height: string | number;
22
+ buttons: DialogButton[];
23
+ loaderVisible: boolean;
24
+ body: HTMLDivElement;
25
+ loader: Overlay;
26
+ alerts: DialogAlert[];
27
+ private _parent;
28
+ private _movingOffset;
29
+ private _elementOffset;
30
+ private _location;
31
+ set location(value: DialogLocation);
32
+ get location(): DialogLocation;
33
+ layout(): void;
34
+ _onKeyDown: (e: KeyboardEvent) => void;
35
+ constructor();
36
+ setOptions(options: DialogOptions): void;
37
+ getOptions(): DialogOptions;
38
+ firstUpdated(): void;
39
+ submit(): void;
40
+ addAlert(alert: DialogAlert): void;
41
+ clearAlerts(): void;
42
+ disconnectedCallback(): void;
43
+ clearEvents(): void;
44
+ _onParentMouseUp: () => void;
45
+ _onHeaderMouseDown: (e: MouseEvent) => void;
46
+ _onParentMouseMove: (e: MouseEvent) => void;
47
+ _onClick: (btn: DialogButton) => void;
48
+ showLoader(): void;
49
+ hideLoader(): void;
50
+ updated(props: Map<PropertyKey, unknown>): void;
51
+ render: () => import("lit-html").TemplateResult<1>;
52
+ positionDialog(location: DialogLocation): void;
53
+ open(parent: HTMLElement, location?: DialogLocation): void;
54
+ close(dispatchEvent?: boolean): void;
55
+ }
56
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,MAAM,EAAE,OAAO,EAAmB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAsB,cAAc,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAaxG,qBAAa,WAAY,SAAQ,KAAK;aAIpB,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,YAAY;gBAFpC,IAAI,EAAE,MAAM,EACI,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY;CAKrC;AAED,qBAEa,MAAO,SAAQ,UAAW,YAAW,MAAM;IAEvD,MAAM,CAAC,MAAM,4BAAW;IAGxB,SAAS,UAAS;IAGlB,QAAQ,UAAS;IAGjB,UAAU,UAAS;IAGnB,cAAc,UAAS;IAGvB,gBAAgB,UAAS;IAGzB,cAAc,EAAE,gBAAgB,CAAY;IAG5C,aAAa,EAAE,gBAAgB,CAAS;IAGxC,SAAS,EAAE,WAAW,CAAC;IAGvB,MAAM,EAAE,MAAM,CAAC;IAGf,KAAK,EAAE,MAAM,GAAC,MAAM,CAAC;IAGrB,MAAM,EAAE,MAAM,GAAC,MAAM,CAAC;IAGtB,OAAO,EAAE,YAAY,EAAE,CAAM;IAG7B,aAAa,UAAS;IAGtB,IAAI,EAAE,cAAc,CAAC;IAGrB,MAAM,EAAE,OAAO,CAAC;IAGhB,MAAM,EAAE,WAAW,EAAE,CAAM;IAE3B,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,aAAa,CAAqC;IAC1D,OAAO,CAAC,cAAc,CAAqC;IAE3D,OAAO,CAAC,SAAS,CAAiB;IAClC,IAAI,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAgC;IAClE,IAAI,QAAQ,IADQ,cAAc,CAIjC;IAGD,MAAM;IAMN,UAAU,MAAO,aAAa,UAS7B;;IAQD,UAAU,CAAC,OAAO,EAAE,aAAa;IAKjC,UAAU,IAAI,aAAa;IAiB3B,YAAY;IAIZ,MAAM;IASN,QAAQ,CAAC,KAAK,EAAE,WAAW;IAM3B,WAAW;IAIX,oBAAoB;IAIpB,WAAW;IAKX,gBAAgB,aAEd;IAEF,kBAAkB,MAAO,UAAU,UAKjC;IAEF,kBAAkB,MAAO,UAAU,UAOjC;IAEF,QAAQ,QAAS,YAAY,UAG5B;IAED,UAAU;IAKV,UAAU;IAKV,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC;IAcxC,MAAM,6CAsCL;IAED,cAAc,CAAC,QAAQ,EAAE,cAAc;IAuBvC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,cAAc;IASnD,KAAK,CAAC,aAAa,UAAO;CAK1B"}
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.Dialog = exports.DialogEvent = void 0;
10
+ const core_1 = require("@omegagrid/core");
11
+ const lit_1 = require("lit");
12
+ const decorators_js_1 = require("lit/decorators.js");
13
+ const map_js_1 = require("lit/directives/map.js");
14
+ const dialog_style_1 = require("./dialog.style");
15
+ const DEFAULT_BUTTON_CONFIG = new Map([
16
+ ['ok', { type: 'ok', text: 'OK', default: true }],
17
+ ['cancel', { type: 'ok', text: 'Cancel' }],
18
+ ['yes', { type: 'ok', text: 'Yes' }],
19
+ ['no', { type: 'ok', text: 'No' }],
20
+ ['close', { type: 'ok', text: 'Close' }]
21
+ ]);
22
+ class DialogEvent extends Event {
23
+ constructor(type, dialog, button) {
24
+ super(`dialog.${type}`, { bubbles: true, composed: true, cancelable: true });
25
+ this.dialog = dialog;
26
+ this.button = button;
27
+ }
28
+ }
29
+ exports.DialogEvent = DialogEvent;
30
+ let Dialog = class Dialog extends lit_1.LitElement {
31
+ set location(value) { this.positionDialog(value); }
32
+ get location() {
33
+ if (this._location == null)
34
+ this._location = { x: this.offsetLeft, y: this.offsetTop };
35
+ return this._location;
36
+ }
37
+ layout() {
38
+ if (this.component && this.component.layout) {
39
+ this.component.layout();
40
+ }
41
+ }
42
+ constructor() {
43
+ super();
44
+ this.resizable = false;
45
+ this.closable = false;
46
+ this.scrollable = false;
47
+ this.disableButtons = false;
48
+ this.disableAutoclose = false;
49
+ this.buttonPosition = 'bottom';
50
+ this.alertPosition = 'top';
51
+ this.buttons = [];
52
+ this.loaderVisible = false;
53
+ this.alerts = [];
54
+ this._movingOffset = null;
55
+ this._elementOffset = null;
56
+ this._onKeyDown = (e) => {
57
+ switch (e.key) {
58
+ case 'Enter':
59
+ this.submit();
60
+ break;
61
+ case 'Escape':
62
+ if (this.closable)
63
+ this.close();
64
+ break;
65
+ }
66
+ };
67
+ this._onParentMouseUp = () => {
68
+ this.clearEvents();
69
+ };
70
+ this._onHeaderMouseDown = (e) => {
71
+ this._movingOffset = { left: e.clientX, top: e.clientY };
72
+ this._elementOffset = { left: this.offsetLeft, top: this.offsetTop };
73
+ this._parent.addEventListener('mouseup', this._onParentMouseUp);
74
+ this._parent.addEventListener('mousemove', this._onParentMouseMove);
75
+ };
76
+ this._onParentMouseMove = (e) => {
77
+ this._location = null;
78
+ core_1.dom.setPosition(this, {
79
+ l: this._elementOffset.left + e.clientX - this._movingOffset.left,
80
+ t: this._elementOffset.top + e.clientY - this._movingOffset.top,
81
+ });
82
+ this.dispatchEvent(new DialogEvent('move', this, null));
83
+ };
84
+ this._onClick = (btn) => {
85
+ const res = this.dispatchEvent(new DialogEvent('click', this, btn));
86
+ if (res && !this.disableAutoclose)
87
+ this.close();
88
+ };
89
+ this.render = () => {
90
+ const buttons = (0, map_js_1.map)(this.buttons, btn => (0, lit_1.html) `
91
+ <og-button
92
+ .text="${DEFAULT_BUTTON_CONFIG.get(btn).text}"
93
+ @click="${() => this._onClick(btn)}"
94
+ ?disabled="${this.disableButtons}"
95
+ ?default="${DEFAULT_BUTTON_CONFIG.get(btn).default}">
96
+ </og-button>
97
+ `);
98
+ const alerts = (0, map_js_1.map)(this.alerts, alert => (0, lit_1.html) `
99
+ <og-alert .text="${alert.text}" .type="${alert.type}" closable></og-alert>
100
+ `);
101
+ return (0, lit_1.html) `
102
+ <div id="header" @mousedown="${this._onHeaderMouseDown}">
103
+ <div id="title">${this.header ? (0, lit_1.html) `${this.header}` : (0, lit_1.html) `<slot name="header"></slot>`}</div>
104
+ ${this.closable ? (0, lit_1.html) `<div id="close" @click="${() => this.close()}">&times</div>` : ``}
105
+ </div>
106
+ ${this.buttons.length > 0 && this.buttonPosition == 'top' ? (0, lit_1.html) `<div id="buttons">${buttons}</div>` : ``}
107
+ ${this.alerts.length > 0 && this.alertPosition == 'top' ? (0, lit_1.html) `<div id="alerts">${alerts}</div>` : ``}
108
+ <div id="body">
109
+ ${this.loaderVisible ? (0, lit_1.html) `<og-overlay defaultLoader></og-overlay>` : ``}
110
+ ${this.scrollable ? (0, lit_1.html) `
111
+ <og-container>
112
+ ${this.component
113
+ ? (0, lit_1.html) `<div slot="content">${this.component}</div>`
114
+ : (0, lit_1.html) `<slot name="content" slot="content"></slot>`}
115
+ </og-container>
116
+ ` : (0, lit_1.html) `
117
+ ${this.component
118
+ ? (0, lit_1.html) `<div slot="content" style="height: 100%">${this.component}</div>`
119
+ : (0, lit_1.html) `<slot name="content"></slot>`}
120
+ `}
121
+ </div>
122
+ ${this.alerts.length > 0 && this.alertPosition == 'bottom' ? (0, lit_1.html) `<div id="alerts">${alerts}</div>` : ``}
123
+ ${this.buttons.length > 0 && this.buttonPosition == 'bottom' ? (0, lit_1.html) `<div id="buttons">${buttons}</div>` : ``}
124
+ `;
125
+ };
126
+ this.addEventListener('keydown', this._onKeyDown);
127
+ (new ResizeObserver(() => this.layout())).observe(this);
128
+ }
129
+ setOptions(options) {
130
+ Object.assign(this, options);
131
+ this.requestUpdate();
132
+ }
133
+ getOptions() {
134
+ return {
135
+ header: this.header,
136
+ buttons: this.buttons,
137
+ disableButtons: this.disableButtons,
138
+ disableAutoclose: this.disableAutoclose,
139
+ buttonPosition: this.buttonPosition,
140
+ alertPosition: this.alertPosition,
141
+ closable: this.closable,
142
+ resizable: this.resizable,
143
+ scrollable: this.scrollable,
144
+ width: this.width,
145
+ height: this.height,
146
+ location: this.location
147
+ };
148
+ }
149
+ firstUpdated() {
150
+ this.tabIndex = 0;
151
+ }
152
+ submit() {
153
+ for (const btn of this.buttons) {
154
+ if (DEFAULT_BUTTON_CONFIG.get(btn).default) {
155
+ this._onClick(btn);
156
+ break;
157
+ }
158
+ }
159
+ }
160
+ addAlert(alert) {
161
+ const alerts = [...this.alerts];
162
+ alerts.push(alert);
163
+ this.alerts = alerts;
164
+ }
165
+ clearAlerts() {
166
+ this.alerts = [];
167
+ }
168
+ disconnectedCallback() {
169
+ this.clearEvents();
170
+ }
171
+ clearEvents() {
172
+ this._parent.removeEventListener('mouseup', this._onParentMouseUp);
173
+ this._parent.removeEventListener('mousemove', this._onParentMouseMove);
174
+ }
175
+ showLoader() {
176
+ this.loaderVisible = true;
177
+ this.disableButtons = true;
178
+ }
179
+ hideLoader() {
180
+ this.loaderVisible = false;
181
+ this.disableButtons = false;
182
+ }
183
+ updated(props) {
184
+ if (this.loaderVisible && this.loader) {
185
+ this.loader.show(this.body);
186
+ }
187
+ if (props.has('width') && this.width) {
188
+ core_1.dom.setSize(this, { w: this.width });
189
+ }
190
+ if (props.has('height') && this.height) {
191
+ core_1.dom.setSize(this, { h: this.height });
192
+ }
193
+ }
194
+ positionDialog(location) {
195
+ this._location = location;
196
+ if (!this._parent)
197
+ return;
198
+ if (location == 'center')
199
+ core_1.dom.setCenterPosition(this, this._parent);
200
+ else {
201
+ if (core_1.utils.isString(location.x)) {
202
+ if (location.x == 'left')
203
+ core_1.dom.setPosition(this, { l: 0 });
204
+ else if (location.x == 'right')
205
+ core_1.dom.setPosition(this, { r: 0 });
206
+ else
207
+ core_1.dom.setCenterPosition(this, this._parent, { horizontal: true, vertical: false });
208
+ }
209
+ else {
210
+ core_1.dom.setPosition(this, { l: location.x });
211
+ }
212
+ if (core_1.utils.isString(location.y)) {
213
+ if (location.y == 'top')
214
+ core_1.dom.setPosition(this, { t: 0 });
215
+ else if (location.y == 'bottom')
216
+ core_1.dom.setPosition(this, { b: 0 });
217
+ else
218
+ core_1.dom.setCenterPosition(this, this._parent, { horizontal: false, vertical: true });
219
+ }
220
+ else {
221
+ core_1.dom.setPosition(this, { t: location.y });
222
+ }
223
+ }
224
+ }
225
+ open(parent, location) {
226
+ this._parent = parent;
227
+ location = location || this.location || 'center';
228
+ console.log(location);
229
+ (parent.shadowRoot ? parent.shadowRoot : parent).appendChild(this);
230
+ core_1.dom.showElement(this, this.scrollable || this.height ? 'flex' : 'block');
231
+ this.updateComplete.then(() => this.positionDialog(location));
232
+ }
233
+ close(dispatchEvent = true) {
234
+ core_1.dom.remove(this);
235
+ if (dispatchEvent)
236
+ this.dispatchEvent(new DialogEvent('close', this, null));
237
+ }
238
+ };
239
+ exports.Dialog = Dialog;
240
+ Dialog.styles = [dialog_style_1.style];
241
+ __decorate([
242
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
243
+ ], Dialog.prototype, "resizable", void 0);
244
+ __decorate([
245
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
246
+ ], Dialog.prototype, "closable", void 0);
247
+ __decorate([
248
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
249
+ ], Dialog.prototype, "scrollable", void 0);
250
+ __decorate([
251
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
252
+ ], Dialog.prototype, "disableButtons", void 0);
253
+ __decorate([
254
+ (0, decorators_js_1.property)({ type: Boolean, reflect: true })
255
+ ], Dialog.prototype, "disableAutoclose", void 0);
256
+ __decorate([
257
+ (0, decorators_js_1.property)({ type: String, reflect: true })
258
+ ], Dialog.prototype, "buttonPosition", void 0);
259
+ __decorate([
260
+ (0, decorators_js_1.property)({ type: String, reflect: true })
261
+ ], Dialog.prototype, "alertPosition", void 0);
262
+ __decorate([
263
+ (0, decorators_js_1.property)({ type: Object })
264
+ ], Dialog.prototype, "component", void 0);
265
+ __decorate([
266
+ (0, decorators_js_1.property)({ type: String })
267
+ ], Dialog.prototype, "header", void 0);
268
+ __decorate([
269
+ (0, decorators_js_1.property)({ type: String, reflect: true })
270
+ ], Dialog.prototype, "width", void 0);
271
+ __decorate([
272
+ (0, decorators_js_1.property)({ type: String, reflect: true })
273
+ ], Dialog.prototype, "height", void 0);
274
+ __decorate([
275
+ (0, decorators_js_1.property)({ type: Array })
276
+ ], Dialog.prototype, "buttons", void 0);
277
+ __decorate([
278
+ (0, decorators_js_1.state)()
279
+ ], Dialog.prototype, "loaderVisible", void 0);
280
+ __decorate([
281
+ (0, decorators_js_1.query)('#body')
282
+ ], Dialog.prototype, "body", void 0);
283
+ __decorate([
284
+ (0, decorators_js_1.query)('og-overlay')
285
+ ], Dialog.prototype, "loader", void 0);
286
+ __decorate([
287
+ (0, decorators_js_1.state)()
288
+ ], Dialog.prototype, "alerts", void 0);
289
+ exports.Dialog = Dialog = __decorate([
290
+ (0, decorators_js_1.customElement)('og-dialog'),
291
+ (0, core_1.stylable)({ vars: ['font-*', 'background-*', 'color-*', 'text-*', 'dialog-*', 'border-*', 'accent-*'] })
292
+ ], Dialog);
293
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAA0F;AAC1F,6BAAuC;AACvC,qDAA0E;AAC1E,kDAA4C;AAE5C,iDAAuC;AAIvC,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAmC;IACvE,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;IAC/C,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAC,CAAC;IACxC,CAAC,KAAK,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC;IAClC,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAChC,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC;CACtC,CAAC,CAAC;AAEH,MAAa,WAAY,SAAQ,KAAK;IAErC,YACC,IAAY,EACI,MAAc,EACd,MAAoB;QAEpC,KAAK,CAAC,UAAU,IAAI,EAAE,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC,CAAC;QAH3D,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAc;IAGrC,CAAC;CAED;AAVD,kCAUC;AAIM,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,gBAAU;IAyDrC,IAAI,QAAQ,CAAC,KAAqB,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAA,CAAC,CAAC;IAClE,IAAI,QAAQ;QACX,IAAI,IAAI,CAA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MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACA;AAGxC;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;yCACF;AAGvB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;sCACV;AAGf;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;qCACnB;AAGrB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;sCAClB;AAGtB;IADC,IAAA,wBAAQ,EAAC,EAAC,IAAI,EAAE,KAAK,EAAC,CAAC;uCACK;AAG7B;IADC,IAAA,qBAAK,GAAE;6CACc;AAGtB;IADC,IAAA,qBAAK,EAAC,OAAO,CAAC;oCACM;AAGrB;IADC,IAAA,qBAAK,EAAC,YAAY,CAAC;sCACJ;AAGhB;IADC,IAAA,qBAAK,GAAE;sCACmB;iBAlDf,MAAM;IAFlB,IAAA,6BAAa,EAAC,WAAW,CAAC;IAC1B,IAAA,eAAQ,EAAC,EAAC,IAAI,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,EAAC,CAAC;GACzF,MAAM,CA2QlB"}
@@ -0,0 +1,2 @@
1
+ export declare const style: import("lit").CSSResult;
2
+ //# sourceMappingURL=dialog.style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.style.d.ts","sourceRoot":"","sources":["../../src/components/dialog.style.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK,yBA+EjB,CAAC"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.style = void 0;
7
+ const lit_1 = require("lit");
8
+ const constants_1 = __importDefault(require("../constants"));
9
+ exports.style = (0, lit_1.css) `
10
+ * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ :host {
15
+ display: none;
16
+ flex-direction: column;
17
+ background: var(--dialog-background);
18
+ color: var(--dialog-color);
19
+ border: 1px solid var(--border-color);
20
+ font-size: var(--font-size);
21
+ font-family: var(--font-family);
22
+ width: 400px;
23
+ position: absolute;
24
+ overflow: hidden;
25
+ outline: none;
26
+ box-shadow: 8px 8px 4px -3px var(--dialog-shadow);
27
+ z-index: 500;
28
+ }
29
+
30
+ :host([resizable]) {
31
+ resize: both;
32
+ }
33
+
34
+ #header {
35
+ display: flex;
36
+ height: ${constants_1.default.DIALOG_HEADER_HEIGHT}px;
37
+ line-height: ${constants_1.default.DIALOG_HEADER_HEIGHT}px;
38
+ padding: 0 10px;
39
+ flex: 0;
40
+ cursor: move;
41
+ }
42
+
43
+ #title {
44
+ flex: 1;
45
+ }
46
+
47
+ #close {
48
+ flex: 0;
49
+ margin-top: ${constants_1.default.DIALOG_HEADER_HEIGHT / 4}px;
50
+ min-width: ${constants_1.default.DIALOG_HEADER_HEIGHT / 2}px;
51
+ height: ${constants_1.default.DIALOG_HEADER_HEIGHT / 2}px;
52
+ line-height: ${constants_1.default.DIALOG_HEADER_HEIGHT / 2}px;
53
+ border-radius: 50%;
54
+ cursor: pointer;
55
+ text-align: center;
56
+ }
57
+
58
+ #close:hover {
59
+ background-color: var(--accent-color);
60
+ }
61
+
62
+ #body {
63
+ position: relative;
64
+ flex: 1;
65
+ overflow: hidden;
66
+ border-top: 1px solid var(--border-color);
67
+ }
68
+
69
+ #body og-container {
70
+ height: 100%;
71
+ }
72
+
73
+ #buttons {
74
+ display: flex;
75
+ flex-direction: row;
76
+ gap: 8px;
77
+ justify-content: flex-end;
78
+ padding: 8px;
79
+ border-top: 1px solid var(--border-color);
80
+ height: 40px;
81
+ line-height: 40px;
82
+ }
83
+
84
+ #buttons og-button {
85
+ min-width: 80px;
86
+ text-align: center;
87
+ }
88
+ `;
89
+ //# sourceMappingURL=dialog.style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.style.js","sourceRoot":"","sources":["../../src/components/dialog.style.ts"],"names":[],"mappings":";;;;;;AAAA,6BAA0B;AAC1B,6DAAqC;AAExB,QAAA,KAAK,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2BZ,mBAAS,CAAC,oBAAoB;iBACzB,mBAAS,CAAC,oBAAoB;;;;;;;;;;;;gBAY/B,mBAAS,CAAC,oBAAoB,GAAG,CAAC;eACnC,mBAAS,CAAC,oBAAoB,GAAG,CAAC;YACrC,mBAAS,CAAC,oBAAoB,GAAG,CAAC;iBAC7B,mBAAS,CAAC,oBAAoB,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoClD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './dialog';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./dialog"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB"}
@@ -0,0 +1,43 @@
1
+ declare const _default: {
2
+ LOCALE: string;
3
+ PREFIX: string;
4
+ DEFAULT_ACCENT_COLOR: string;
5
+ DEFAULT_ACCENT_COLOR_2: import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<string | number | ArrayLike<number> | import("color")<any> | {
6
+ [key: string]: any;
7
+ }> | {
8
+ [key: string]: any;
9
+ }> | {
10
+ [key: string]: any;
11
+ }> | {
12
+ [key: string]: any;
13
+ }> | {
14
+ [key: string]: any;
15
+ }> | {
16
+ [key: string]: any;
17
+ }> | {
18
+ [key: string]: any;
19
+ }> | {
20
+ [key: string]: any;
21
+ }> | {
22
+ [key: string]: any;
23
+ }> | {
24
+ [key: string]: any;
25
+ }> | {
26
+ [key: string]: any;
27
+ }>;
28
+ SIZER_SIZE: number;
29
+ SLIDER_SIZE: number;
30
+ SLIDER_MIN_LENGTH: number;
31
+ EXPANDER_SIZE: number;
32
+ LIST_ITEM_HEIGHT: number;
33
+ LIST_RENDERING_TRESHOLD: number;
34
+ LIST_AUTOSCROLL_TRESHOLD: number;
35
+ LIST_AUTOSCROLL_DELAY: number;
36
+ DEFAULT_TEXT_HIGHLIGHT_COLOR: string;
37
+ TOOLTIP_MARGIN: number;
38
+ MENU_ITEM_HEIGHT: number;
39
+ COLORPICKER_COLOR_SIZE: number;
40
+ DIALOG_HEADER_HEIGHT: number;
41
+ };
42
+ export default _default;
43
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAGE"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@omegagrid/core");
4
+ exports.default = {
5
+ DIALOG_HEADER_HEIGHT: 32,
6
+ ...core_1.constants
7
+ };
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;AAAA,0CAA6D;AAE7D,kBAAe;IACd,oBAAoB,EAAE,EAAE;IACxB,GAAG,gBAAa;CAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './components';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B"}
@@ -0,0 +1,30 @@
1
+ import { AlertType, HorizontalPosition, VerticalPosition } from "@omegagrid/core";
2
+ export type DialogButton = 'ok' | 'cancel' | 'yes' | 'no' | 'close' | 'custom';
3
+ export type DialogButtonConfig = {
4
+ type: DialogButton;
5
+ text: string;
6
+ default?: boolean;
7
+ };
8
+ export type DialogAlert = {
9
+ text: string;
10
+ type: AlertType;
11
+ };
12
+ export type DialogLocation = {
13
+ x?: number | HorizontalPosition;
14
+ y?: number | VerticalPosition;
15
+ } | 'center';
16
+ export type DialogOptions = {
17
+ header?: string;
18
+ buttons?: DialogButton[];
19
+ disableButtons?: boolean;
20
+ disableAutoclose?: boolean;
21
+ buttonPosition?: VerticalPosition;
22
+ alertPosition?: VerticalPosition;
23
+ closable?: boolean;
24
+ resizable?: boolean;
25
+ scrollable?: boolean;
26
+ width?: string | number;
27
+ height?: string | number;
28
+ location?: DialogLocation;
29
+ };
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAElF,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,OAAO,GAAG,QAAQ,CAAC;AAG/E,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAA;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,CAAC,CAAC,EAAE,MAAM,GAAC,kBAAkB,CAAC;IAC9B,CAAC,CAAC,EAAE,MAAM,GAAC,gBAAgB,CAAC;CAC5B,GAAG,QAAQ,CAAC;AAEb,MAAM,MAAM,aAAa,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAC,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,cAAc,CAAA;CACzB,CAAA"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@omegagrid/dialog",
3
+ "version": "0.2.5",
4
+ "license": "UNLICENSED",
5
+ "description": "Dialog component",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "files": [
9
+ "./dist/**/*"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/cechi/omegagrid.git"
14
+ },
15
+ "bugs": "https://github.com/cechi/omegagrid/issues",
16
+ "author": {
17
+ "name": "Petr Čechura",
18
+ "email": "p.cechura@gmail.com",
19
+ "url": "https://cechura.eu"
20
+ },
21
+ "scripts": {
22
+ "watch": "tsc --watch",
23
+ "build": "tsc",
24
+ "test": "jest --passWithNoTests",
25
+ "lint": "eslint **/src/**/*.ts",
26
+ "_prepack": "yarn build",
27
+ "_prepublish": "yarn test && yarn lint"
28
+ },
29
+ "dependencies": {
30
+ "@fortawesome/fontawesome-svg-core": "6.4.2",
31
+ "@lit/localize": "^0.12.1",
32
+ "@omegagrid/core": "^0.2.5",
33
+ "@riovir/wc-fontawesome": "^0.1.9",
34
+ "lit": "^3.1.1",
35
+ "monaco-editor": "^0.45.0",
36
+ "ts-debounce": "^4.0.0",
37
+ "vscode-loader": "^1.0.2"
38
+ },
39
+ "devDependencies": {
40
+ "@types/jest": "^29.5.11",
41
+ "@types/node": "^20.11.5",
42
+ "@typescript-eslint/eslint-plugin": "^6.19.0",
43
+ "@typescript-eslint/parser": "^6.19.0",
44
+ "eslint": "^8.56.0",
45
+ "jest": "^29.7.0",
46
+ "jest-environment-jsdom": "^29.7.0",
47
+ "ts-jest": "^29.1.1",
48
+ "ts-node": "^10.9.2",
49
+ "typescript": "5.3.2"
50
+ }
51
+ }