dry-ux 1.49.0 → 1.50.0

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.
@@ -1,6 +1,6 @@
1
1
  import { DajaxiceFn } from "./Proxy.interface";
2
2
  export declare const modules: DajaxiceModules;
3
- export declare type DajaxiceModules = {
3
+ export type DajaxiceModules = {
4
4
  employee?: {
5
5
  getDetails: DajaxiceFn<{
6
6
  id: number;
@@ -1,4 +1,4 @@
1
- export declare type Args<T = void> = {
1
+ export type Args<T = void> = {
2
2
  args: T;
3
3
  /**
4
4
  * If true, it will show a loader when a Dajaxice function is called. Defaults to false.
@@ -27,9 +27,9 @@ export declare type Args<T = void> = {
27
27
  loader?: boolean;
28
28
  };
29
29
  };
30
- declare type ArgType<T> = T extends void ? Omit<Args, "args"> | void : Args<T>;
30
+ type ArgType<T> = T extends void ? Omit<Args, "args"> | void : Args<T>;
31
31
  export declare type DajaxiceFn<TArgs = void> = <TResult = any>(args: ArgType<TArgs>) => Promise<TResult>;
32
- export declare type MethodArgs = Partial<Args<any>>;
32
+ export type MethodArgs = Partial<Args<any>>;
33
33
  export interface IDajaxiceProxy<TModule> {
34
34
  modules: TModule;
35
35
  authCheck?: {
@@ -15,7 +15,7 @@ export declare class ErrorBoundary extends React.PureComponent<IErrorBoundaryPro
15
15
  error: Error;
16
16
  };
17
17
  componentDidCatch(error: Error, info: React.ErrorInfo): void;
18
- render: () => JSX.Element & React.ReactNode;
18
+ render: () => React.JSX.Element;
19
19
  private handleError;
20
20
  private resetError;
21
21
  }
@@ -1,2 +1,2 @@
1
1
  import * as React from "react";
2
- export declare const ErrorScreen: React.MemoExoticComponent<() => JSX.Element>;
2
+ export declare const ErrorScreen: React.MemoExoticComponent<() => React.JSX.Element>;
@@ -1,4 +1,4 @@
1
- declare type FlattenOptions = {
1
+ type FlattenOptions = {
2
2
  delimiter?: string;
3
3
  maxDepth?: number;
4
4
  transformKey?: (key: any) => any;
@@ -12,7 +12,7 @@ declare type FlattenOptions = {
12
12
  export declare function flatten(target: any, opts?: FlattenOptions): {
13
13
  [key: string]: any;
14
14
  };
15
- declare type UnflattenOptions = Pick<FlattenOptions, "delimiter" | "transformKey"> & {
15
+ type UnflattenOptions = Pick<FlattenOptions, "delimiter" | "transformKey"> & {
16
16
  overwrite?: boolean;
17
17
  object?: boolean;
18
18
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unflatten = exports.flatten = void 0;
3
+ exports.flatten = flatten;
4
+ exports.unflatten = unflatten;
4
5
  function isBuffer(obj) {
5
6
  return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
6
7
  }
@@ -40,7 +41,6 @@ function flatten(target, opts) {
40
41
  step(target, null, null);
41
42
  return output;
42
43
  }
43
- exports.flatten = flatten;
44
44
  /**
45
45
  * Unflattens an object with the paths for keys.
46
46
  * @param target The object to unflatten.
@@ -122,4 +122,3 @@ function unflatten(target, opts) {
122
122
  });
123
123
  return result;
124
124
  }
125
- exports.unflatten = unflatten;
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  /**
3
3
  * Returns a function that will call the given handler and prevent the default event behavior.
4
- * @param handler: The handler to call.
4
+ * @param handler The function to call when the event is triggered.
5
5
  */
6
6
  export declare const preventDefault: (handler?: (event: any) => void) => (event: any) => void;
7
7
  /**
@@ -59,5 +59,5 @@ export declare const tryParseJson: <T = any>(json: string, errorValue?: {}) => {
59
59
  export declare const useIsVisible: (ref: React.MutableRefObject<any>) => boolean;
60
60
  export declare const usePubSub: <T>() => {
61
61
  usePub: () => <TName extends keyof T, TPayload extends T[TName]>(event: TName, data?: TPayload) => void;
62
- useSub: <TName_1 extends keyof T, TPayload_1 extends T[TName_1]>(event: TName_1, callback: (data: TPayload_1) => void) => () => void;
62
+ useSub: <TName extends keyof T, TPayload_1 extends T[TName]>(event: TName, callback: (data: TPayload_1) => void) => () => void;
63
63
  };
@@ -4,7 +4,7 @@ exports.usePubSub = exports.useIsVisible = exports.tryParseJson = exports.Deferr
4
4
  const React = require("react");
5
5
  /**
6
6
  * Returns a function that will call the given handler and prevent the default event behavior.
7
- * @param handler: The handler to call.
7
+ * @param handler The function to call when the event is triggered.
8
8
  */
9
9
  const preventDefault = (handler) => (event) => {
10
10
  event.preventDefault();
@@ -20,7 +20,7 @@ exports.preventDefault = preventDefault;
20
20
  const importScript = (resourceUrl, singleton = true, placement = "body") => new Promise(resolve => {
21
21
  React.useEffect(() => {
22
22
  const script = document.createElement("script");
23
- if (!$(`script[src='${resourceUrl}']`).length) {
23
+ if (!document.querySelectorAll(`script[src='${resourceUrl}']`).length) {
24
24
  script.src = resourceUrl;
25
25
  script.async = true;
26
26
  script.onload = () => resolve();
@@ -44,7 +44,7 @@ exports.importScript = importScript;
44
44
  */
45
45
  const importStyleSheet = (resourceUrl) => {
46
46
  React.useEffect(() => {
47
- if (!$(`link[href='${resourceUrl}']`).length) {
47
+ if (!document.querySelectorAll(`link[href='${resourceUrl}']`).length) {
48
48
  const link = document.createElement("link");
49
49
  link.href = resourceUrl;
50
50
  link.rel = "stylesheet";
@@ -1,10 +1,15 @@
1
1
  import * as React from "react";
2
+ import { UIUtilRendererProps } from "./ui-utils/UIUtilRenderer";
2
3
  interface IDryUXProviderProps {
3
4
  /**
4
5
  * Does not render the renderer for this provider. If this is set to true, then the renderer needs to be mounted
5
6
  * by explicitly.
6
7
  */
7
8
  noRenderer?: boolean;
9
+ /**
10
+ * Props to pass to the renderer.
11
+ */
12
+ rendererProps?: UIUtilRendererProps;
8
13
  children: React.ReactNode;
9
14
  }
10
15
  export declare const DryUXProvider: React.FC<IDryUXProviderProps>;
package/dist/provider.js CHANGED
@@ -4,6 +4,6 @@ exports.DryUXProvider = void 0;
4
4
  const React = require("react");
5
5
  const UIUtilProvider_1 = require("./ui-utils/UIUtilProvider");
6
6
  const UIUtilRenderer_1 = require("./ui-utils/UIUtilRenderer");
7
- exports.DryUXProvider = React.memo(({ children, noRenderer = false }) => (React.createElement(UIUtilProvider_1.UIUtilProvider, null,
7
+ exports.DryUXProvider = React.memo(({ children, noRenderer = false, rendererProps }) => (React.createElement(UIUtilProvider_1.UIUtilProvider, null,
8
8
  children,
9
- !noRenderer && React.createElement(UIUtilRenderer_1.UIUtilRenderer, null))));
9
+ !noRenderer && React.createElement(UIUtilRenderer_1.UIUtilRenderer, Object.assign({}, rendererProps)))));
package/dist/types.d.ts CHANGED
@@ -1,14 +1,2 @@
1
- interface JQuery {
2
- notify(message: string, options: any): JQuery;
3
- noty: any;
4
- }
5
1
  interface Window {
6
- noty(options: any): JQuery;
7
- google: any;
8
- InfoBox: any;
9
- welcomeMessage: string;
10
- isLocal: boolean;
11
- devHost: string;
12
- $: any;
13
2
  }
14
- declare const $: any;
package/dist/types.js CHANGED
@@ -1 +0,0 @@
1
- const $ = window.$;
@@ -1,9 +1,16 @@
1
1
  import * as React from "react";
2
2
  import { ModalOptions } from "./uiUtil.interface";
3
- interface IModalProps {
3
+ export interface IModalProps {
4
4
  options: ModalOptions;
5
5
  handleClose: () => void;
6
6
  shown: boolean;
7
+ config: {
8
+ styles?: {
9
+ [selector: string]: React.CSSProperties;
10
+ };
11
+ defaultModalStyles?: boolean;
12
+ setBackdropHeight?: boolean;
13
+ };
7
14
  }
8
15
  declare const Modal: React.FC<IModalProps & {
9
16
  handleClose: () => void;
@@ -2,14 +2,36 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const React = require("react");
4
4
  const react_bootstrap_1 = require("react-bootstrap");
5
- const Modal = React.memo(({ handleClose, shown, options: { content, footerContent, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true }, }) => {
5
+ const Modal = React.memo(({ handleClose, shown, options: { content, footerContent, cssClass, closeBtn, title, width, onClose, titleCloseBtn = true }, config: { defaultModalStyles = false, styles = {}, setBackdropHeight = true }, }) => {
6
+ const applyStyles = React.useCallback(() => {
7
+ document.querySelectorAll(".modal-dialog").forEach((el) => {
8
+ el.style.width = typeof width == "number" ? `${width}px` : width;
9
+ if (defaultModalStyles) {
10
+ el.style.maxWidth = "95%";
11
+ el.style.marginTop = "100px";
12
+ el.querySelectorAll(".modal-header").forEach((el) => (el.style.display = "block"));
13
+ el.querySelectorAll(".modal-title").forEach((el) => (el.style.marginTop = "0"));
14
+ }
15
+ });
16
+ document.querySelectorAll("[role=dialog]").forEach((el) => (el.style.opacity = "1"));
17
+ if (setBackdropHeight) {
18
+ document
19
+ .querySelectorAll(".modal-backdrop")
20
+ .forEach((el) => (el.style.height = `${document.body.scrollHeight}px`));
21
+ }
22
+ Object.keys(styles).forEach(selector => {
23
+ document.querySelectorAll(selector).forEach((el) => {
24
+ Object.keys(styles[selector]).forEach(style => {
25
+ el.style[style] = styles[selector][style];
26
+ });
27
+ });
28
+ });
29
+ }, [width, defaultModalStyles]);
6
30
  React.useEffect(() => {
7
31
  if (shown) {
8
- $(".modal-dialog").css("width", width);
9
- $("[role=dialog]").css("opacity", 1);
10
- $(".modal-backdrop").css("height", $(document).height());
32
+ applyStyles();
11
33
  }
12
- }, [shown, width]);
34
+ }, [shown, width, defaultModalStyles]);
13
35
  const hide = () => {
14
36
  handleClose();
15
37
  onClose && onClose();
@@ -1,2 +1,2 @@
1
1
  import * as React from "react";
2
- export declare const Spinner: React.MemoExoticComponent<() => JSX.Element>;
2
+ export declare const Spinner: React.MemoExoticComponent<() => React.JSX.Element>;
@@ -46,5 +46,5 @@ export declare class UIUtilProvider extends React.PureComponent<{}, IUIUtilProvi
46
46
  removeModalInstance(id: string): void;
47
47
  getCurrentModal(id: string): IModalCreate;
48
48
  createModal(id: string, options: ModalOptions): IModalCreate;
49
- render(): JSX.Element;
49
+ render(): React.JSX.Element;
50
50
  }
@@ -76,49 +76,10 @@ class UIUtilProvider extends React.PureComponent {
76
76
  return Object.assign(Object.assign({}, defaultState.loader), { show: () => this.loader.show(), hide: () => this.loader.hide() });
77
77
  }
78
78
  showNotifyAlert(message, alertType, position, bindToElement) {
79
- Promise.resolve().then(() => require(/* webpackChunkName: "notify" */ "../external-dependencies/notify-js/notify")).then(() => {
80
- const options = Object.assign(Object.assign({}, (alertType && { className: alertType })), (position && { position }));
81
- $(".notifyjs-hidable").trigger("click");
82
- if (bindToElement) {
83
- $(bindToElement).notify(message, options);
84
- }
85
- else {
86
- $.notify(message, options);
87
- }
88
- });
79
+ alert("Starting with 1.49.1, this is deprecated. Please use Notyf package directly.");
89
80
  }
90
81
  showNoty(message, alertType) {
91
- Promise.resolve().then(() => require(/* webpackChunkName: "noty" */ "../external-dependencies/noty/jquery.noty.packaged")).then(() => {
92
- $.noty.defaults = {
93
- layout: "topCenter",
94
- theme: "relax",
95
- type: "alert",
96
- text: "",
97
- dismissQueue: false,
98
- template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
99
- animation: {
100
- open: { height: "toggle" },
101
- close: { height: "toggle" },
102
- easing: "swing",
103
- speed: 500, // opening & closing animation speed
104
- },
105
- timeout: 4000,
106
- force: true,
107
- modal: false,
108
- maxVisible: 1,
109
- killer: true,
110
- closeWith: ["click"],
111
- callback: {
112
- onShow: function () { },
113
- afterShow: function () { },
114
- onClose: function () { },
115
- afterClose: function () { },
116
- onCloseClick: function () { },
117
- },
118
- buttons: false, // an array of buttons
119
- };
120
- window.noty({ text: message, type: alertType });
121
- });
82
+ alert("Starting with 1.49.1, this is deprecated. Please use Notyf package directly.");
122
83
  }
123
84
  toggleModalInstance(id, shown, destroyOnClose = false) {
124
85
  const { modal: { instances }, } = this.state;
@@ -1,2 +1,6 @@
1
1
  import * as React from "react";
2
- export declare const UIUtilRenderer: React.MemoExoticComponent<() => JSX.Element>;
2
+ import { IModalProps } from "./Modal";
3
+ export type UIUtilRendererProps = {
4
+ modalConfig?: IModalProps["config"];
5
+ };
6
+ export declare const UIUtilRenderer: React.FC<UIUtilRendererProps>;
@@ -4,10 +4,10 @@ exports.UIUtilRenderer = void 0;
4
4
  const React = require("react");
5
5
  const UIUtilProvider_1 = require("./UIUtilProvider");
6
6
  const Modal_1 = require("./Modal");
7
- exports.UIUtilRenderer = React.memo(() => {
7
+ exports.UIUtilRenderer = React.memo(({ modalConfig = {} }) => {
8
8
  const { modal } = (0, UIUtilProvider_1.useUIUtilContext)();
9
9
  return (React.createElement(React.Fragment, null, Object.keys(modal.instances).map(id => {
10
10
  const { shown, options, handleClose } = modal.instances[id];
11
- return (React.createElement(Modal_1.default, { key: id, shown: shown, options: options, handleClose: () => handleClose(id, false, true) }));
11
+ return (React.createElement(Modal_1.default, { key: id, shown: shown, options: options, handleClose: () => handleClose(id, false, true), config: modalConfig }));
12
12
  })));
13
13
  });
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface IModalCreate {
3
2
  /**
4
3
  * Hides the modal.
@@ -13,7 +12,7 @@ export interface IModalCreate {
13
12
  */
14
13
  remove: () => void;
15
14
  }
16
- export declare type ModalOptions = {
15
+ export type ModalOptions = {
17
16
  /**
18
17
  * The content of the modal.
19
18
  */
@@ -51,8 +50,8 @@ export declare type ModalOptions = {
51
50
  */
52
51
  destroyOnClose?: boolean;
53
52
  };
54
- export declare type AlertType = "success" | "warning" | "error";
55
- export declare type ButtonType = "primary" | "info" | "success" | "warning" | "danger";
53
+ export type AlertType = "success" | "warning" | "error";
54
+ export type ButtonType = "primary" | "info" | "success" | "warning" | "danger";
56
55
  export interface IUtilModalAction {
57
56
  /**
58
57
  * The content to display in the modal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dry-ux",
3
- "version": "1.49.0",
3
+ "version": "1.50.0",
4
4
  "description": "",
5
5
  "main": "dist/index",
6
6
  "scripts": {
@@ -9,7 +9,8 @@
9
9
  "format": "prettier --write \"src/**/*.ts\" \"src/**/*.tsx\"",
10
10
  "update:version": "npm version minor --no-git-tag-version",
11
11
  "prepub:npm": "npm run format && npm run build && npm run update:version",
12
- "publish:npm": "npm run prepub:npm && npm publish"
12
+ "publish:npm": "npm run prepub:npm && npm publish",
13
+ "pack": "npm run build && npm pack --pack-destination pack/"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -31,8 +32,7 @@
31
32
  "typescript": "*"
32
33
  },
33
34
  "dependencies": {
34
- "react-bootstrap": "^0.33.1",
35
- "jquery": "^3.6.1"
35
+ "react-bootstrap": "^0.33.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@types/react": ">=16.14.8",
@@ -1,2 +0,0 @@
1
- declare function _exports(t: any, n: any): any;
2
- export = _exports;
@@ -1,60 +0,0 @@
1
- (function (e) { typeof define == "function" && define.amd ? define(["jquery"], e) : typeof module == "object" && module.exports ? module.exports = function (t, n) { return n === undefined && (typeof window != "undefined" ? n = require("jquery") : n = require("jquery")(t)), e(n), n; } : e(jQuery); })(function (e) { function A(t, n, i) { typeof i == "string" && (i = { className: i }), this.options = E(w, e.isPlainObject(i) ? i : {}), this.loadHTML(), this.wrapper = e(h.html), this.options.clickToHide && this.wrapper.addClass(r + "-hidable"), this.wrapper.data(r, this), this.arrow = this.wrapper.find("." + r + "-arrow"), this.container = this.wrapper.find("." + r + "-container"), this.container.append(this.userContainer), t && t.length && (this.elementType = t.attr("type"), this.originalElement = t, this.elem = N(t), this.elem.data(r, this), this.elem.before(this.wrapper)), this.container.hide(), this.run(n); } var t = [].indexOf || function (e) { for (var t = 0, n = this.length; t < n; t++)
2
- if (t in this && this[t] === e)
3
- return t; return -1; }, n = "notify", r = n + "js", i = n + "!blank", s = { t: "top", m: "middle", b: "bottom", l: "left", c: "center", r: "right" }, o = ["l", "c", "r"], u = ["t", "m", "b"], a = ["t", "b", "l", "r"], f = { t: "b", m: null, b: "t", l: "r", c: null, r: "l" }, l = function (t) { var n; return n = [], e.each(t.split(/\W+/), function (e, t) { var r; r = t.toLowerCase().charAt(0); if (s[r])
4
- return n.push(r); }), n; }, c = {}, h = { name: "core", html: '<div class="' + r + '-wrapper">\n <div class="' + r + '-arrow"></div>\n <div class="' + r + '-container"></div>\n</div>', css: "." + r + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + r + "-corner ." + r + "-wrapper,\n." + r + "-corner ." + r + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + r + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + r + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + r + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + r + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}" }, p = { "border-radius": ["-webkit-", "-moz-"] }, d = function (e) { return c[e]; }, v = function (e) { if (!e)
5
- throw "Missing Style name"; c[e] && delete c[e]; }, m = function (t, i) { if (!t)
6
- throw "Missing Style name"; if (!i)
7
- throw "Missing Style definition"; if (!i.html)
8
- throw "Missing Style HTML"; var s = c[t]; s && s.cssElem && (window.console && console.warn(n + ": overwriting style '" + t + "'"), c[t].cssElem.remove()), i.name = t, c[t] = i; var o = ""; i.classes && e.each(i.classes, function (t, n) { return o += "." + r + "-" + i.name + "-" + t + " {\n", e.each(n, function (t, n) { return p[t] && e.each(p[t], function (e, r) { return o += " " + r + t + ": " + n + ";\n"; }), o += " " + t + ": " + n + ";\n"; }), o += "}\n"; }), i.css && (o += "/* styles for " + i.name + " */\n" + i.css), o && (i.cssElem = g(o), i.cssElem.attr("id", "notify-" + i.name)); var u = {}, a = e(i.html); y("html", a, u), y("text", a, u), i.fields = u; }, g = function (t) { var n, r, i; r = x("style"), r.attr("type", "text/css"), e("head").append(r); try {
9
- r.html(t);
10
- }
11
- catch (s) {
12
- r[0].styleSheet.cssText = t;
13
- } return r; }, y = function (t, n, r) { var s; return t !== "html" && (t = "text"), s = "data-notify-" + t, b(n, "[" + s + "]").each(function () { var n; n = e(this).attr(s), n || (n = i), r[n] = t; }); }, b = function (e, t) { return e.is(t) ? e : e.find(t); }, w = { clickToHide: !0, autoHide: !0, autoHideDelay: 5e3, arrowShow: !0, arrowSize: 5, breakNewLines: !0, elementPosition: "bottom", globalPosition: "top right", style: "bootstrap", className: "error", showAnimation: "slideDown", showDuration: 400, hideAnimation: "slideUp", hideDuration: 200, gap: 5 }, E = function (t, n) { var r; return r = function () { }, r.prototype = t, e.extend(!0, new r, n); }, S = function (t) { return e.extend(w, t); }, x = function (t) { return e("<" + t + "></" + t + ">"); }, T = {}, N = function (t) { var n; return t.is("[type=radio]") && (n = t.parents("form:first").find("[type=radio]").filter(function (n, r) { return e(r).attr("name") === t.attr("name"); }), t = n.first()), t; }, C = function (e, t, n) { var r, i; if (typeof n == "string")
14
- n = parseInt(n, 10);
15
- else if (typeof n != "number")
16
- return; if (isNaN(n))
17
- return; return r = s[f[t.charAt(0)]], i = t, e[r] !== undefined && (t = s[r.charAt(0)], n = -n), e[t] === undefined ? e[t] = n : e[t] += n, null; }, k = function (e, t, n) { if (e === "l" || e === "t")
18
- return 0; if (e === "c" || e === "m")
19
- return n / 2 - t / 2; if (e === "r" || e === "b")
20
- return n - t; throw "Invalid alignment"; }, L = function (e) { return L.e = L.e || x("div"), L.e.html(e).html(); }; A.prototype.loadHTML = function () { var t; t = this.getStyle(), this.userContainer = e(t.html), this.userFields = t.fields; }, A.prototype.show = function (e, t) { var n, r, i, s, o; r = function (n) { return function () { !e && !n.elem && n.destroy(); if (t)
21
- return t(); }; }(this), o = this.container.parent().parents(":hidden").length > 0, i = this.container.add(this.arrow), n = []; if (o && e)
22
- s = "show";
23
- else if (o && !e)
24
- s = "hide";
25
- else if (!o && e)
26
- s = this.options.showAnimation, n.push(this.options.showDuration);
27
- else {
28
- if (!!o || !!e)
29
- return r();
30
- s = this.options.hideAnimation, n.push(this.options.hideDuration);
31
- } return n.push(r), i[s].apply(i, n); }, A.prototype.setGlobalPosition = function () { var t = this.getPosition(), n = t[0], i = t[1], o = s[n], u = s[i], a = n + "|" + i, f = T[a]; if (!f || !document.contains(f[0])) {
32
- f = T[a] = x("div");
33
- var l = {};
34
- l[o] = 0, u === "middle" ? l.top = "45%" : u === "center" ? l.left = "45%" : l[u] = 0, f.css(l).addClass(r + "-corner"), e("body").append(f);
35
- } return f.prepend(this.wrapper); }, A.prototype.setElementPosition = function () { var n, r, i, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, L, A, O, M, _, D, P, H, B, j; H = this.getPosition(), _ = H[0], O = H[1], M = H[2], g = this.elem.position(), d = this.elem.outerHeight(), y = this.elem.outerWidth(), v = this.elem.innerHeight(), m = this.elem.innerWidth(), j = this.wrapper.position(), c = this.container.height(), h = this.container.width(), T = s[_], L = f[_], A = s[L], p = {}, p[A] = _ === "b" ? d : _ === "r" ? y : 0, C(p, "top", g.top - j.top), C(p, "left", g.left - j.left), B = ["top", "left"]; for (w = 0, S = B.length; w < S; w++)
36
- D = B[w], N = parseInt(this.elem.css("margin-" + D), 10), N && C(p, D, N); b = Math.max(0, this.options.gap - (this.options.arrowShow ? i : 0)), C(p, A, b); if (!this.options.arrowShow)
37
- this.arrow.hide();
38
- else {
39
- i = this.options.arrowSize, r = e.extend({}, p), n = this.userContainer.css("border-color") || this.userContainer.css("border-top-color") || this.userContainer.css("background-color") || "white";
40
- for (E = 0, x = a.length; E < x; E++) {
41
- D = a[E], P = s[D];
42
- if (D === L)
43
- continue;
44
- l = P === T ? n : "transparent", r["border-" + P] = i + "px solid " + l;
45
- }
46
- C(p, s[L], i), t.call(a, O) >= 0 && C(r, s[O], i * 2);
47
- } t.call(u, _) >= 0 ? (C(p, "left", k(O, h, y)), r && C(r, "left", k(O, i, m))) : t.call(o, _) >= 0 && (C(p, "top", k(O, c, d)), r && C(r, "top", k(O, i, v))), this.container.is(":visible") && (p.display = "block"), this.container.removeAttr("style").css(p); if (r)
48
- return this.arrow.removeAttr("style").css(r); }, A.prototype.getPosition = function () { var e, n, r, i, s, f, c, h; h = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition), e = l(h), e.length === 0 && (e[0] = "b"); if (n = e[0], t.call(a, n) < 0)
49
- throw "Must be one of [" + a + "]"; if (e.length === 1 || (r = e[0], t.call(u, r) >= 0) && (i = e[1], t.call(o, i) < 0) || (s = e[0], t.call(o, s) >= 0) && (f = e[1], t.call(u, f) < 0))
50
- e[1] = (c = e[0], t.call(o, c) >= 0) ? "m" : "l"; return e.length === 2 && (e[2] = e[1]), e; }, A.prototype.getStyle = function (e) { var t; e || (e = this.options.style), e || (e = "default"), t = c[e]; if (!t)
51
- throw "Missing style: " + e; return t; }, A.prototype.updateClasses = function () { var t, n; return t = ["base"], e.isArray(this.options.className) ? t = t.concat(this.options.className) : this.options.className && t.push(this.options.className), n = this.getStyle(), t = e.map(t, function (e) { return r + "-" + n.name + "-" + e; }).join(" "), this.userContainer.attr("class", t); }, A.prototype.run = function (t, n) { var r, s, o, u, a; e.isPlainObject(n) ? e.extend(this.options, n) : e.type(n) === "string" && (this.options.className = n); if (this.container && !t) {
52
- this.show(!1);
53
- return;
54
- } if (!this.container && !t)
55
- return; s = {}, e.isPlainObject(t) ? s = t : s[i] = t; for (o in s) {
56
- r = s[o], u = this.userFields[o];
57
- if (!u)
58
- continue;
59
- u === "text" && (r = L(r), this.options.breakNewLines && (r = r.replace(/\n/g, "<br/>"))), a = o === i ? "" : "=" + o, b(this.userContainer, "[data-notify-" + u + a + "]").html(r);
60
- } this.updateClasses(), this.elem ? this.setElementPosition() : this.setGlobalPosition(), this.show(!0), this.options.autoHide && (clearTimeout(this.autohideTimer), this.autohideTimer = setTimeout(this.show.bind(this, !1), this.options.autoHideDelay)); }, A.prototype.destroy = function () { this.wrapper.data(r, null), this.wrapper.remove(); }, e[n] = function (t, r, i) { return t && t.nodeName || t.jquery ? e(t)[n](r, i) : (i = r, r = t, new A(null, r, i)), t; }, e.fn[n] = function (t, n) { return e(this).each(function () { var i = N(e(this)).data(r); i && i.destroy(); var s = new A(e(this), t, n); }), this; }, e.extend(e[n], { defaults: S, addStyle: m, removeStyle: v, pluginOptions: w, getStyle: d, insertCSS: g }), m("bootstrap", { html: "<div>\n<span data-notify-text></span>\n</div>", classes: { base: { "font-weight": "bold", padding: "8px 15px 8px 14px", "text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)", "background-color": "#fcf8e3", border: "1px solid #fbeed5", "border-radius": "4px", "white-space": "nowrap", "padding-left": "25px", "background-repeat": "no-repeat", "background-position": "3px 7px" }, error: { color: "#B94A48", "background-color": "#F2DEDE", "border-color": "#EED3D7", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)" }, success: { color: "#468847", "background-color": "#DFF0D8", "border-color": "#D6E9C6", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)" }, info: { color: "#3A87AD", "background-color": "#D9EDF7", "border-color": "#BCE8F1", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)" }, warn: { color: "#C09853", "background-color": "#FCF8E3", "border-color": "#FBEED5", "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)" } } }), e(function () { g(h.css).attr("id", "core-notify"), e(document).on("click", "." + r + "-hidable", function (t) { e(this).trigger("notify-hide"); }), e(document).on("notify-hide", "." + r + "-wrapper", function (t) { var n = e(this).data(r); n && n.show(!1); }); }); });
@@ -1,2 +0,0 @@
1
- declare const _exports: (options: any) => JQuery;
2
- export = _exports;