From 73e01b7bab10e1b0b53601981e0e94caba565987 Mon Sep 17 00:00:00 2001 From: Goldman Kim Date: Fri, 20 Dec 2024 17:12:54 +0900 Subject: [PATCH] Add TypeScript typings for Natural-JS library Introduces TypeScript type definitions for the Natural-JS library, including validation, formatting, data binding, and UI components. This commit improves developer experience by enabling type checking and IntelliSense support in development environments. --- package.json | 21 + src/main/resources/static/index.html | 14 +- .../static/js/natural_js/@types/.npmignore | 5 + .../static/js/natural_js/@types/index.d.ts | 18 + .../@types/natural.architecture.d.ts | 348 ++ .../@types/natural.architecture.misc.d.ts | 258 ++ .../js/natural_js/@types/natural.code.d.ts | 14 + .../natural_js/@types/natural.code.misc.d.ts | 16 + .../js/natural_js/@types/natural.core.d.ts | 926 +++++ .../natural_js/@types/natural.core.misc.d.ts | 107 + .../js/natural_js/@types/natural.data.d.ts | 1144 ++++++ .../natural_js/@types/natural.data.misc.d.ts | 106 + .../js/natural_js/@types/natural.js.d.ts | 300 ++ .../natural_js/@types/natural.template.d.ts | 8 + .../@types/natural.template.misc.d.ts | 206 + .../js/natural_js/@types/natural.ui.d.ts | 1667 ++++++++ .../js/natural_js/@types/natural.ui.misc.d.ts | 3563 +++++++++++++++++ .../natural_js/@types/natural.ui.shell.d.ts | 304 ++ .../@types/natural.ui.shell.misc.d.ts | 610 +++ .../js/natural_js/@types/natural_js-tests.js | 256 ++ .../js/natural_js/@types/natural_js-tests.ts | 286 ++ .../static/js/natural_js/@types/package.json | 22 + .../static/js/natural_js/@types/tsconfig.json | 20 + .../natural.js+code+template.es6.min.js | 636 +++ .../natural.js+code+template.es6.min.map | 8 + tsconfig.json | 13 + 26 files changed, 10868 insertions(+), 8 deletions(-) create mode 100644 package.json create mode 100644 src/main/resources/static/js/natural_js/@types/.npmignore create mode 100644 src/main/resources/static/js/natural_js/@types/index.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.architecture.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.architecture.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.code.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.code.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.core.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.core.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.data.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.data.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.js.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.template.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.template.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.ui.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.ui.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.ui.shell.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural.ui.shell.misc.d.ts create mode 100644 src/main/resources/static/js/natural_js/@types/natural_js-tests.js create mode 100644 src/main/resources/static/js/natural_js/@types/natural_js-tests.ts create mode 100644 src/main/resources/static/js/natural_js/@types/package.json create mode 100644 src/main/resources/static/js/natural_js/@types/tsconfig.json create mode 100644 src/main/resources/static/js/natural_js/natural.js+code+template.es6.min.js create mode 100644 src/main/resources/static/js/natural_js/natural.js+code+template.es6.min.map create mode 100644 tsconfig.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..1533b23 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "natural_js_boot", + "version": "1.0.0", + "description": "", + "main": "index.html", + "scripts": { + "build": "tsc", + "build:watch": "tsc -w", + "dev": "NODE_ENV=dev nodemon --watch src/ --delay 500ms --exec ts-node src/start.ts", + "start:dev": "NODE_ENV=dev ts-node-dev --respawn --transpile-only src/start.ts", + "start": "NODE_ENV=production node build/start.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/bbalganjjm/natural_js.git" + }, + "private": true, + "dependencies": { + "@types/jquery": "^3.5.32" + } +} diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html index fb62907..090123e 100644 --- a/src/main/resources/static/index.html +++ b/src/main/resources/static/index.html @@ -12,19 +12,17 @@ + - - - - - + + - - - + + + + * ``` + * + * If you load a page with the above structure using the N.popup, N.tab component or N.comm library, the init function of the Controller object is called when page loading is complete. + * + * > For Natural-ARCHITECTURE-based pages to function properly, they must be loaded with the N.comm library, N.popup, or N.tab components. + * + * > When selecting an element on a page, you must `find` on a view or specify view as the `context` argument (second argument) to a jQuery function. + * Otherwise, unintended elements from other block pages may be selected, resulting in unpredictable errors. + * For more information, please refer to the [Restrictions and Tips](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0601.html) menu. + * + * > When `N(".view").cont()` is executed, a `pageid data attribute value` such as `data-pageid="view"` is created in the `.view` element specified by the selector. + * The `pageid` is `.(dot), #(sharp), [(left bracket), ](right bracket), '(single quote), :(colon), ((left bracket), ), )(right bracket), >(right arrow bracket), " "(space), -(hyphen)` characters are removed to create pageid, so the page identification value is defined not to include the special characters. + * For example, `N("page.view-01").cont()` creates a pageid of `pageview01` with the dot and hyphen removed. + * + * To control a specific page, such as a block page or tab content, you can get a Controller object as follows. + * ``` + * var page01Cont = N("#page01").instance("cont"); + * page01Cont.gridInst.bind([]); + * ``` + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0201.html + */ + cont(contObj: NA.Objects.Controller.Object): NA.Objects.Controller.Object; +} + +declare namespace NA { + class Communicator { + constructor(obj: NJS | string, url?: string | NA.Options.Request); + xhr: JQuery.jqXHR; + initFilterConfig(): NA.Objects.Config.FilterConfig; + resetFilterConfig(): NA.Communicator; + /** + * Registers a callback function to be executed when a successful response is received from the server. + * + * If the `callback` argument is not provided to the `submit` function, a Promise-compatible `xhr` object is returned, allowing the use of async/await syntax. + * + * ``` + * // JSON Data + * const fn1 = async () => { + * const data = await N.comm("data.json").submit(); + * }; + * + * // Catch exception + * const fn2 = async () => { + * const data = await N.comm("data.json").submit().then((data) => { + * console.log(data); + * }).catch((e) => { + * console.error(e); + * }); + * }; + * + * // HTML page + * const fn3 = async () => { + * const data = await N("#page-container").comm("page.html").submit(); + * console.log(data); // HTML Text + * }; + * ``` + * + * @param {NA.Callbacks.Communicator.Submit} callback - Define a callback function that handles the server's response when the request is successful. + * + * When requesting an HTML page, a Controller object of the loaded page is returned as the argument to the callback function. For other requests, a data object and the Communicator.request object are returned. + * ``` + * // JSON Data + * N.comm("data.json").submit(function(data, request) { + * N.log(data, request); + * }); + * + * // HTML page + * N("#page-container").comm("page.html").submit(function(cont) { + * N.log(cont); // cont: Controller object + * }); + * ``` + * @return {NA.Communicator} The jqXHR object or the Communicator instance depending on the submission context. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0203.html&tab=html/naturaljs/refr/refr020305.html + */ + submit(callback: NA.Callbacks.Communicator.Submit): NA.Communicator; + /** + * Registers a callback function to be executed when a successful response is received from the server. + * + * If the `callback` argument is not provided to the `submit` function, a Promise-compatible `xhr` object is returned, allowing the use of async/await syntax. + * + * ``` + * // JSON Data + * const fn1 = async () => { + * const data = await N.comm("data.json").submit(); + * }; + * + * // Catch exception + * const fn2 = async () => { + * const data = await N.comm("data.json").submit().then((data) => { + * console.log(data); + * }).catch((e) => { + * console.error(e); + * }); + * }; + * + * // HTML page + * const fn3 = async () => { + * const data = await N("#page-container").comm("page.html").submit(); + * console.log(data); // HTML Text + * }; + * ``` + * + * @return {JQuery.jqXHR} The jqXHR object or the Communicator instance depending on the submission context. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0203.html&tab=html/naturaljs/refr/refr020305.html + */ + submit(): JQuery.jqXHR; + /** + * Registers a callback function that will be executed when an error response is received from the server after calling the submit function or when an error occurs in the callback function of the submit method. + * > You can call the error method multiple times to register multiple callback functions. + * + * @param {NA.Callbacks.Communicator.Error} callback - Defines the callback function that handles errors when they occur. + * + * The `this` context of the callback function is the instance of the created N.comm, and it receives the following arguments: + * - xhr(arguments[2]): jQuery XMLHTTPRequest + * - textStatus(arguments[3]): "success" (when an error occurs in the submit callback) or "error" (when an error occurs from the server) + * - e(arguments[0]): ErrorThrown + * - request(arguments[1]): Communicator.request + * - callback(arguments[4]): The callback function specified as an argument in the submit method when textStatus is "success". + * + * ``` + * N.comm("data.json").error(function(xhr, textStatus, e, request, callback) { + * // 2. First error handler for col01.length error + * }).error(function(xhr, textStatus, e, request, callback) { + * // 3. Second error handler for col01.length error + * }).submit(function(data, request) { + * var col01; + * col01.length; // 1. Generates an undefined related error + * }); + * ``` + * + * @return {NA.Communicator} Returns the `Communicator` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0203.html&tab=html/naturaljs/refr/refr020305.html + */ + error(callback: NA.Callbacks.Communicator.Error): NA.Communicator; + /** + * The `Communicator.request` object is a request information object created each time `N.comm` is executed. + * + * The options of the `N.comm()` function are stored in the `Communicator.request.options` object and are delivered as headers or parameters of the server request. + * + * When requesting an HTML page, the request object is passed as the second argument of the `init` function of the Controller object or as a member variable (`this.request`) of the Controller object. You can check the request information or retrieve the request parameter object using the provided request object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html + */ + request: NA.Request; + } + + class Request { + constructor(obj: NJS, opts: NA.Options.Request); + options: NA.Options.Request; + attrObj: object; + obj: NA.Communicator; + /** + * Get the parameters passed while calling this page. + * + * Retrieving data from the loaded page: + * ``` + * N(".view").cont({ + * init: function(view, request) { + * var data1 = request.attr("data1"); // { data: ["1", "2"] } + * var data2 = request.attr("data2"); // ["3", "4"] + * } + * }); + * ``` + * + * @param {String} name - Parameter name + * + * @return {NA.Communicator} Returns the passed parameter value. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + attr(name: string): any; + /** + * Set the parameters to be passed to the page to be loaded. + * + * Sending data: + * ``` + * N(".view").cont({ + * init: function(view, request) { + * N("#section").comm("page.html") + * .request.attr("data1", { data: ["1", "2"] }) + * .request.attr("data2", ["3", "4"]) + * .submit(); + * } + * }); + * ``` + * + * @param {String} name - Parameter name + * @param {any} obj - Parameter data + * + * @return {NA.Communicator} Returns the Communicator object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + attr(name: string, obj: any): NA.Communicator; + removeAttr(name: string): NA.Communicator; + /** + * Extracts the GET parameter values from the browser's URL. + * + * @return {object} Returns all GET parameters as an object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + param(): object; + /** + * Extracts the value of a GET parameter from the URL in the browser. + * + * @param {string} name - The key of the parameter to be retrieved. + * @return {string} The value of the parameter + */ + param(name: string): string; + /** + * Retrieves the current request options. + * + * @return {NA.Options.Request} The options used for the request. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + get(): NA.Options.Request; + /** + * Retrieves for the value specified as a key in request options. + * + * @param {string} key - Property name of request options + * @return {any} Value corresponding to the key value specified in request options + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + get(key: string): any; + /** + * Reloads the block page loaded by the Communicator. + * > If the attr method has not been called to set values before calling reload, the values in the request object before the reload are maintained even after reloading. + * + * > You can specify the Communicator.request data for the page being reloaded using the attr method. + * + * ``` + * request.attr("param", { param: 1 }); + * request.reload(); + * ``` + * + * > The reload function does not support method chaining. + * ``` + * request.attr("param", { param: 1 }).reload(); // This usage is invalid. + * ``` + * + * @param {NA.Callbacks.Request.Reload} [callback] - An optional callback function that will be called upon the completion of the reload process. + * ``` + * request.reload(function(html, request) { + * N.log(html, request); + * }); + * ``` + * @return {NA.Communicator} Returns the Communicator instance to allow for method chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0204.html&tab=html/naturaljs/refr/refr020403.html + */ + reload(callback?: NA.Callbacks.Request.Reload): NA.Communicator; + } + + interface Controller { + new(obj: NJS, contObj: NA.Objects.Controller.Object): NA.Objects.Controller.Object; + trInit(cont: NA.Objects.Controller.Object, request: NA.Request): void; + /** + * Aspect-oriented programming(AOP) processing class. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0202.html + */ + aop: { + pointcuts: { + regexp: { + fn(param: RegExp | string, contFrag: NA.Objects.Controller.Object, fnChain: string): boolean; + }; + }; + wrap(cont: NA.Objects.Controller.Object): void; + }; + } + + interface Context { + attrObj: object; + /** + * Get data stored in N.context. + * + * @param {string} name - data name. + * @return {any} Stored data. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0206.html&tab=html/naturaljs/refr/refr020602.html + */ + attr(name: string): any; + /** + * Set the data to be stored in N.context. + * + * @param {string} name - data name. + * @param {any} obj - Data to store. + * @return {this} The current object, for chainability. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0206.html&tab=html/naturaljs/refr/refr020602.html + */ + attr(name: string, obj: any): NA.Context; + } + + interface Config { + filterConfig: NA.Objects.Config.FilterConfig; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.architecture.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.architecture.misc.d.ts new file mode 100644 index 0000000..a4966b6 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.architecture.misc.d.ts @@ -0,0 +1,258 @@ +declare namespace NA { + namespace Options { + /** + * Options interface extending the JQuery.Ajax.AjaxSettingsBase interface for making `N.comm.request` with additional settings. + */ + interface Request extends Omit, "success" | "error" | "complete"> { + /** + * A string containing the URL to which the request is sent. + */ + url: string; + /** + * When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). As of jQuery 1.6 you can pass false to tell jQuery to not set any content type header. Note: The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding. Note: For cross-domain requests, setting the content type to anything other than application/x-www-form-urlencoded, multipart/form-data, or text/plain will trigger the browser to send a preflight OPTIONS request to the server. + */ + contentType?: string; + /** + * The MIME type of content that is used to submit the form to the server. Possible values are: + * + * "application/x-www-form-urlencoded": The initial default type. + * + * "multipart/form-data": The type that allows file `` element(s) to upload file data. + * + * "text/plain": A type introduced in HTML5. + */ + enctype?: Objects.Request.Enctype; + /** + * If set to false, it will force requested pages not to be cached by the browser. Note: Setting cache to false will only work correctly with HEAD and GET requests. It works by appending "_={timestamp}" to the GET parameters. The parameter is not needed for other types of requests, except in IE8 when a POST is made to a URL that has already been requested by a GET. + */ + cache?: boolean; + /** + * By default, all requests are sent asynchronously (i.e. this is set to true by default). If you need synchronous requests, set this option to false. Cross-domain requests and dataType: "jsonp" requests do not support synchronous operation. Note that synchronous requests may temporarily lock the browser, disabling any actions while the request is active. As of jQuery 1.8, the use of async: false with jqXHR ($.Deferred) is deprecated; you must use the success/error/complete callback options instead of the corresponding methods of the jqXHR object such as jqXHR.done(). + * + * @deprecated + */ + async?: boolean; + /** + * An alias for method. You should use type if you're using versions of jQuery prior to 1.9.0. + */ + type?: Objects.Request.HttpMethod; + /** + * Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below). + */ + data?: JQuery.PlainObject | string; + /** + * The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: + * + * "xml": Returns an XML document that can be processed via jQuery. + * + * "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM. + * + * "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, _=[TIMESTAMP], to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests. + * + * "json": Evaluates the response as JSON and returns a JavaScript object. Cross-domain "json" requests are converted to "jsonp" unless the request includes jsonp: false in its request options. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.) + * + * "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. + * + * "text": A plain text string. + * + * multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml". Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. + */ + dataType?: Objects.Request.DataType; + /** + * If you wish to force a crossDomain request (such as JSONP) on the same domain, set the value of crossDomain to true. This allows, for example, server-side redirection to another domain. + */ + crossDomain?: boolean; + /** + * The browser's `location.href` value when requested. + */ + referrer?: string; + /** + * If set to `true`, the parameter object specified as an argument of the N function in `N().comm` can be specified as an array type. + * + * > When using Communicator with `N(params).comm(url).submit()`, if the object type of params is array and the dataIsArray option is set to false, only the first object of array is transmitted. + * The cause of this problem is that if you call the get function after setting the argument of the jQuery function to `array(jQuery([{}]))` or `object($({}))`, both return `array([{}])`. + * Even if it is inconvenient, when transmitting an array to the server, set dataIsArray to true or use an array in an object. + * + * > When `Communicator` is used with `N.comm(params, url).submit()`, even if the dataIsArray option is not set to true, params is not created as a jQuery object, so it is sent as an array type. + * + * > Applied after `Natural-ARCHITECTURE v0.8.1.4` version. + */ + dataIsArray?: boolean; + /** + * If set to `false`, the response will not be blocked even if the location.href when making a request to the server and the location.href when receiving a response from the server are different. + * + * > If the server response is blocked for unknown reasons, test this option by setting it to false. + */ + urlSync?: boolean; + /** + * If set to `true`, the loaded page will be appended to the element specified by the `target` option rather than overwritten. + */ + append?: boolean; + /** + * Specifies the element into which to insert HTML content. + * + * > When Communicator is used with `N(".block").comm("page.html").submit()`, the `N("#block")` element object is specified as the target property value. + */ + target?: NJS; + } + } + + namespace Callbacks { + namespace Communicator { + interface Submit { + ( + this: NA.Communicator, + data?: NC.JSONObject | NC.JSONObject[] | NC.Primitive | object | object[] | NA.Controller, + request?: NA.Request, + ): void; + } + interface Error { + ( + this: NA.Communicator, + xhr: JQuery.jqXHR, + textStatus: JQuery.Ajax.TextStatus, + e: Error, + request: NA.Request, + submitCallback: Submit, + ): void; + } + } + + namespace Controller { + interface OnOpen { + (this: NA.Objects.Controller.Object, onOpenData?: any): void; + } + } + + namespace Request { + interface Reload { + (this: NA.Communicator, html?: string | NA.Controller, request?: NA.Request): void; + } + } + } + + namespace Objects { + namespace Request { + /** + * Enum representing different encoding types for form submissions. + * + * The `Enctype` enum provides a set of constants that define the encoding type + * used when submitting form data. This is used in the `enctype` attribute of HTML forms. + * + * Enctype.URLENCODED - Represents the MIME type `application/x-www-form-urlencoded`. + * This is the default encoding type that is used by forms. + * + * Enctype.MULTIPART - Represents the MIME type `multipart/form-data`. + * This encoding type is used when the form includes file uploads. + * + * Enctype.PLAIN - Represents the MIME type `text/plain`. + * This encoding type sends data without any encoding for the key-value pairs. + */ + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum Enctype { + URLENCODED = "application/x-www-form-urlencoded", + MULTIPART = "multipart/form-data", + PLAIN = "text/plain", + } + + /** + * An enumeration for different types of data formats that can be used. + */ + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum DataType { + JSON = "json", + XML = "xml", + SCRIPT = "script", + HTML = "html", + TEXT = "text", + JSONP = "jsonp", + } + + /** + * Enum for HTTP methods. + * + * This enum provides a collection of standard HTTP methods used in network communication. + * Each key in the enum represents a type of request that can be made to a web server. + * + * - POST: Used to submit data to be processed to a specified resource. + * - GET: Requests a representation of the specified resource. + * - PUT: Replaces all current representations of the target resource with the request payload. + * - DELETE: Deletes the specified resource. + * - HEAD: Asks for a response identical to a GET request, but without the response body. + * - OPTIONS: Used to describe the communication options for the target resource. + * - TRACE: Performs a message loop-back test along the path to the target resource. + * - CONNECT: Establishes a tunnel to the server identified by the target resource. + * - PATCH: Used to apply partial modifications to a resource. + */ + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum HttpMethod { + POST = "POST", + GET = "GET", + PUT = "PUT", + DELETE = "DELETE", + HEAD = "HEAD", + OPTIONS = "OPTIONS", + TRACE = "TRACE", + CONNECT = "CONNECT", + PATCH = "PATCH", + } + } + + namespace Controller { + interface InitFunction { + (this: Object, view: NJS, request: NA.Request): void; + } + + interface BaseObject { + [key: string]: any; + /** + * The initializer function that is called to set up the initial state or configuration. + * This function is optional, and if provided, it should follow the signature defined by `InitFunction`. + */ + init?: InitFunction; + /** + * View element. + * + * > Same as the first argument of the init function. + */ + view?: NJS; + /** + * Instance of the Communicator.request object. + * + * > Same as the second argument of the init function. + */ + request?: NA.Request; + /** + * If the popup page is called by N.popup or N.tab components, this is the instance of the calling component. + * With this instance, you can control the parent page. + */ + caller?: NU.Popup & NU.Tab; // FIXME + /** + * If the popup page is called by N.popup or N.tab components, this is the controller object instance of the parent page. + * + * With this instance, you can control the parent page. + * + * > The opener attribute should be specified with the Controller object of the parent page when creating an instance of N.popup or N.tab components. + */ + opener?: BaseObject & NT.Objects.Controller.Object; + /** + * This is a function implementation of the onOpen option specified as a string in pop-ups and tabs. + */ + onOpen?: Callbacks.Controller.OnOpen; + } + + type Object = BaseObject & (NT.Objects.Controller.InitialObject | {}); + } + + namespace Config { + interface FilterConfig { + beforeInitFilters: object[]; + afterInitFilters: object[]; + beforeSendFilters: object[]; + successFilters: object[]; + errorFilters: object[]; + completeFilters: object[]; + } + } + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.code.d.ts b/src/main/resources/static/js/natural_js/@types/natural.code.d.ts new file mode 100644 index 0000000..669bb3e --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.code.d.ts @@ -0,0 +1,14 @@ +declare class NCD { + static inspection: { + test(codes: string, rules?: string[]): boolean | NCD.CodeInspectionResult[]; + rules: { + NoContextSpecifiedInSelector(codes: string, excludes: string[], report: NCD.CodeInspectionResult[]): void; + UseTheComponentsValMethod(codes: string, excludes: string[], report: NCD.CodeInspectionResult[]): void; + }; + report: { + console(data: NCD.CodeInspectionResult[], url: string): false | undefined; + }; + }; + + static addSourceURL(codes: string, sourceURL: string): string; +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.code.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.code.misc.d.ts new file mode 100644 index 0000000..6e47dd6 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.code.misc.d.ts @@ -0,0 +1,16 @@ +declare namespace NCD { + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum SeverityLevels { + BLOCKER = "Blocker", + CRITICAL = "Critical", + MAJOR = "Major", + MINOR = "Minor", + } + + interface CodeInspectionResult { + level: SeverityLevels.BLOCKER | SeverityLevels.CRITICAL | SeverityLevels.MAJOR | SeverityLevels.MINOR; + message: string; + line: number; + code: string; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.core.d.ts b/src/main/resources/static/js/natural_js/@types/natural.core.d.ts new file mode 100644 index 0000000..c3cf498 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.core.d.ts @@ -0,0 +1,926 @@ +/** + * The NC class is a CORE package of Natural-JS that provides various utilities and methods for collection manipulation, event binding, instance handling, value management, event retrieval, locale setting, etc. + */ +declare class NC { + /** + * Removes an element from the collection based on the provided index or identifier. + * + * @param {any} idx - The index or identifier of the element to be removed. + * @param {number} length - The length of the collection from which the element is to be removed. + * @return {this} The instance of the collection after the element has been removed. + */ + remove_(idx: any, length: number): NC; + /** + * Binds an event handler that is executed with top priority to the specified event type of the selected element. + * + * @param {string} eventName - The name of the event to bind to. + * @param {JQuery.EventHandler} eventHandler - The event handler function to execute when the event is triggered. + * @return {this} The current object, for chainability. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010103.html + */ + tpBind(eventName: string, eventHandler: JQuery.EventHandler): NC; + /** + * Returns or stores an instance of the component object or Controller object in the context element or View element of the UI component. + * > Natural-JS stores the created object instances in the specified template (context or view) elements during the initialization of components or libraries to easily control block content such as tabs or popups. + * + * The method operates differently based on the number and type of arguments as follows: + * 1. Returns all instances stored in the selected elements. + * + * If only one instance is returned, the original instance object is returned. If there are two or more instances, they are stored and returned in an array. If no instances are found, `undefined` is returned. + * ``` + * var all = N(".grid01", ".grid02").instance(); + * ``` + * 2. Specifies all instances stored in the selected elements as arguments of the callback function. + * > The callback function is executed as many times as there are instances. + * ``` + * var all = N(".grid01", ".grid02").instance(function(instanceId, instance) { + * // this: instance + * // instanceId: identifier of the stored instance + * // instance: stored instance + * }); + * ``` + * 3. Returns all instances stored with the instanceId `name` in the selected elements. + * + * If only one instance is returned, the original instance object is returned. If there are two or more instances, they are stored and returned in an array. If no instances are found, `undefined` is returned. + * ``` + * var all = N(".grid01", ".grid02").instance("name"); + * ``` + * 4. Returns all instances stored with the instanceId `name` in the selected elements as arguments of the callback function. + * > The callback function is executed as many times as there are instances. + * ``` + * var all = N(".grid01", ".grid02").instance("name", function(instanceId, instance) { + * // this: instance + * // instanceId: identifier of the stored instance + * // instance: stored instance + * }); + * ``` + * 5. Stores the instance with instanceId `name` in the selected elements. + * ``` + * N(".grid01").instance("name", instance); + * ``` + * > If the `instance` argument is a function type, it might not work correctly. Use object or string types for the `instance` argument instead. + * + * @param {string | NC.InstanceCallback} name - The name of the instance. + * + * Predefined instance names are as follows: + * + * - Controller object of N.cont: cont + * - Instance of N.alert: alert + * > Stored in the .block_overlay_msg__ element. + * - Instance of N.button: button + * - Instance of N.datepicker: datepicker + * - Instance of N.popup: popup + * > The Controller object of the loaded popup content is stored in the .block_overlay_msg__ > .msg_box__ > .view_context__ element. + * - Instance of N.tab: tab + * > The Controller object of the loaded tab content is stored in the .tab__ > .{tab content element id} > .view_context__ element. + * - Instance of N.select: select + * - Instance of N.form: form + * - Instance of N.list: list + * - Instance of N.grid: grid + * - Instance of N.pagination: pagination + * - Instance of N.tree: tree + * - Instance of N.notify: notify + * - Instance of N.docs: docs + * > Components whose instance storage locations are not specifically mentioned are stored in the context elements specified by the context option. + * @param {NC.Instance} [instance] - The instance to store in the selected elements or a callback function to retrieve instances. + * > The callback function returns the index (arguments[0]) and each instance (arguments[1]). The `this` context of the callback function refers to each instance. + * @return {void | NJS | NC.Instance[] | NC.Instance | NC} Returns undefined, an array of instances, a single instance, or the context itself. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010103.html + */ + instance( + name: string | NC.InstanceCallback, + instance?: NC.Instance, + ): undefined | NJS | NC.Instance[] | NC.Instance | NC; + /** + * Gets or selects the selected values of elements such as select, select[multiple=multiple], input[type=radio], and input[type=checkbox]. + * + * > In the case of checkbox, if there is only one option, it operates in a mode that decides whether it is Y/N or 1/0. + * + * > You can set whether the default value for single selection is Y/N, 1/0, or on/off with the variables N.context.attr("core").sgChkdVal("Checked Value") and N.context.attr("core").sgUnChkdVal("Unchecked Value") in natural.config.js. + * + * @param {string|string[]|NC.ValsCallback} [vals] - Optional parameter that can be either a string, an array of strings, or a callback function. + * + * When specifying a single value, specify the value as a string, and when selecting two or more options, specify the value as an array of strings. + * + * If a function is specified, the callback function is executed for each selected option element. The arguments for the callback function are as follows: + * - this: The selected option element + * - args[0]: The index of the selected option element + * - args[1]: The selected option element + * @return {string|string[] | NJS | this} If the vals argument is not provided, the selected value is returned. If the vals argument is specified, the elements that match the specified value are selected. + * If only one is selected, a value of type string is returned, and if two or more are selected, the values are returned in an array. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010103.html + */ + vals(vals?: string | string[] | NC.ValsCallback): string | string[] | NJS | NC; + /** + * Returns the events bound to the selected element. + * + * @param {string} eventName - The name of the event. + * @param {string} [namespace] - The optional namespace for the event. + * @return {NC.EventsObject | NC.EventObject} If neither the eventType argument nor the namespace argument is provided, all events are returned; if the namespace is not provided, only the events corresponding to the specified eventType are returned. + * If the namespace argument is provided, the events are returned as an array object, otherwise they are returned as a jQuery object. If no events are bound, undefined is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010103.html + */ + events(eventName: string, namespace?: string): NC.EventsObject | NC.EventObject; + /** + * Gets the default locale value configured in the framework. + * > The default messages of the framework will be processed in multiple languages according to the configured locale value. + * + * > Pre-registered multilingual message sets include en_US, ko_KR, and can be modified in the `message` property of the [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html). + * + * > The default locale of the framework can be set to the value of the `N.context.attr("core").locale` property in [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html). + * + * @return {string} If the `str` argument is provided, it returns `undefined`. If not provided, it returns a locale string such as "en_US" or "ko_KR". + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static locale(): string; + /** + * Sets the default locale value to be configured in the framework. + * > The default messages of the framework will be processed in multiple languages according to the configured locale value. + * + * > Pre-registered multilingual message sets include en_US, ko_KR, and can be modified in the `message` property of the [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html). + * + * > The default locale of the framework can be set to the value of the `N.context.attr("core").locale` property in [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html). + * + * @param {string} str - Enter a valid locale string such as "en_US" or "ko_KR". + * @return {void} This method does not return any value. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static locale(str: string): void; + /** + * Logs the `debug` level messages to the console. + * + * @param {...any} obj - The items to log to the console. They can be of any type and multiple arguments can be passed. + * @return {Console} Displays the contents of the provided item in the browser console. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010103.html + */ + static debug(...obj: any): Console; + /** + * Logs the messages to the console. + * + * @param {...any} obj - The items to log to the console. They can be of any type and multiple arguments can be passed. + * @return {Console} Displays the contents of the provided item in the browser console. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static log(...obj: any): Console; + /** + * Logs the `info` level messages to the console. + * + * @param {...any} obj - The items to log to the console. They can be of any type and multiple arguments can be passed. + * @return {Console} Displays the contents of the provided item in the browser console. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static info(...obj: any): Console; + /** + * Logs the `warning` level messages to the console. + * + * @param {...any} obj - The items to log to the console. They can be of any type and multiple arguments can be passed. + * @return {Console} Displays the contents of the provided item in the browser console. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static warn(...obj: any): Console; + /** + * Throws an error and logs the error message to the browser console. + * + * > The N.error function returns an ErrorThrown object, so to raise an error, you must declare the throw statement before the N.error function. + * ``` + * throw N.error("An error has occurred."); + * ``` + * + * @param {string} msg - The error message to be logged. + * @param {Error} [e] - If an Error object is specified, the error is raised using the specified object. + * @return {Error} Error object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static error(msg: string, e?: Error): Error; + /** + * Identifies the type of an object. + * + * @param {any} obj - The object to identify the type of. + * @return {NC.ObjectType | string} The identified type of the object, either as an NC.ObjectType or a string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static type(obj: any): NC.ObjectType | string; + /** + * Determines if the provided object is a string. + * + * @param {any} obj - The object to check. + * @return {boolean} true if the value is a string; otherwise, false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isString(obj: any): boolean; + /** + * Determines if the provided object is a numeric. + * + * @param {any} obj - The object to check. + * @return {boolean} true if the value is a numeric; otherwise, false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isNumeric(obj: any): boolean; + /** + * Determines if a given object is a plain object. + * A plain object is one that is created by the Object constructor or one with a prototype of null. + * + * @param {any} obj - The object to test. + * @return {boolean} true if the object is a plain object, false otherwise. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isPlainObject(obj: any): boolean; + /** + * Checks if the given object is empty (i.e., has no own enumerable properties). + * + * @param {object} obj - The object to check for emptiness. + * @return {boolean} Returns true if the object is empty, false otherwise. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isEmptyObject(obj: any): boolean; + /** + * Determines if the given object is an array. + * + * @param {any} obj - The object to be checked. + * @return {boolean} true if the object is an array, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isArray(obj: any): boolean; + /** + * Checks if the given object is array-like. + * An object is considered array-like if it is not a function and has a `length` property that is a number. + * + * @param {any} obj - The object to check. + * @return {boolean} - Returns `true` if the object is array-like, otherwise returns `false`. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isArraylike(obj: any): boolean; + /** + * Checks if the given object is of type jQuery object. + * + * @param {any} obj - The object to check. + * @return {boolean} true if the object is a jQuery object, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isWrappedSet(obj: any): boolean; + /** + * Determines if the provided object is a DOM element. + * + * @param {any} obj - The object to check. + * @return {boolean} true if the object is a DOM element, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static isElement(obj: any): boolean; + /** + * Converts a given element, array of elements, or any input to a CSS selector string. + * + * @param {NJS | HTMLElement | HTMLElement[] | any} el - The input element(s) or any value to convert. + * @returns {string} The CSS selector string derived from the input. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static toSelector(el: NC.Selector): string; + /** + * A function that takes a variable number of arguments and returns an array of + * JQuery.Deferred objects, ensuring that the deferred tasks are executed in serial order. + * + * @param {...Function} args - The arguments to be passed to each deferred task. + * @returns {JQuery.Deferred[]} An array of JQuery.Deferred objects representing the serialized execution of tasks. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010104.html + */ + static serialExecute(...args: unknown[]): JQuery.Deferred[]; + /** + * Provides methods to perform different levels of garbage collection. + */ + static gc: { + /** + * Minimum garbage collection + * + * @returns {true} If the operation is successful, it unconditionally returns true. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010105.html + */ + minimum(): true; + /** + * Full garbage collection + * + * @returns {true} If the operation is successful, it unconditionally returns true. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010105.html + */ + full(): true; + /** + * Remove garbage instances from observables in ND.ds. + * + * @return {void} This method does not return any value. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010105.html + */ + ds(): void; + }; + /** + * Provides utility functions for processing and manipulating strings. + */ + static string: { + /** + * Checks if the given context string contains the specified substring. + * + * @param {string} context - The string in which to search for the substring. + * @param {string} str - The substring to search for within the context string. + * @return {boolean} - Returns true if the context string contains the specified substring, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + contains(context: string, str: string): boolean; + + /** + * Checks if the given string context ends with the specified substring str. + * + * @param {string} context - The string to be checked. + * @param {string} str - The substring to look for at the end of the context string. + * @return {boolean} Returns true if the context string ends with the specified substring, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + endsWith(context: string, str: string): boolean; + /** + * Checks if the provided string starts with the given substring. + * + * @param {string} context - The full string to be checked. + * @param {string} str - The substring to check for at the start of the full string. + * @return {boolean} true if the full string starts with the substring, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + startsWith(context: string, str: string): boolean; + /** + * Inserts a given substring into a context string at a specified index. + * + * @param {string} context - The original string where the substring will be inserted. + * @param {number} idx - The index at which to insert the substring. + * @param {string} str - The substring to be inserted. + * @return {string} - The resulting string after the insertion. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + insertAt(context: string, idx: number, str: string): string; + /** + * Removes all whitespace characters from the given string. + * + * @param {string} str - The string from which to remove whitespace. + * @return {string} The string without any whitespace characters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + removeWhitespace(str: string): string; + /** + * Pads the left side of a string with a specified character or string until the string reaches a given length. + * + * @param {string} str - The original string to be padded. + * @param {number} length - The desired total length of the string after padding. + * @param {string} padStr - The string to pad the original string with. + * @return {string} - The padded string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + lpad(str: string, length: number, padStr: string): string; + /** + * Right pads a given string with a specified string up to a certain length. + * + * @param {string} str - The original string to be padded. + * @param {number} length - The total length of the resulting string after padding. + * @param {string} padStr - The string to pad with. + * @return {string} The padded string of the specified length. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + rpad(str: string, length: number, padStr: string): string; + /** + * Checks if the provided string is empty. + * + * @param {string} str - The string to be checked. + * @return {boolean} true if the string is empty, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + isEmpty(str: string): boolean; + /** + * Calculates the byte length of a string given a specific character byte length. + * + * @param {string} str - The input string for which to calculate the byte length. + * @param {number} charByteLength - The default byte length of each individual character in the string. + * @return {number} The total byte length of the string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + byteLength(str: string, charByteLength: number): number; + /** + * Trims the input string and returns an empty string if the input is null or undefined. + * + * @param str - The input string to be trimmed. + * @return The trimmed string, or an empty string if the input is null or undefined. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + trimToEmpty(str: string): string; + /** + * Converts a null or undefined string to an empty string. + * If the input string is neither null nor undefined, it will be returned as is. + * + * @param {string | null | undefined} str - The input string which can be null, undefined, or a string. + * @return {string} The original string if it is not null/undefined, otherwise an empty string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + nullToEmpty(str: string | null | undefined): string; + /** + * Trims the input string and returns `null` if the resulting string is empty. + * + * @param {string} str - The input string to be trimmed. + * @return {string | null} The trimmed string or null if the trimmed string is empty. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + trimToNull(str: string): string | null; + /** + * Trims the given string and returns `undefined` if the resulting string is empty. + * + * @param {string} str - The string to be trimmed. + * @return {string | undefined} - The trimmed string or undefined if the trimmed string is empty. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + trimToUndefined(str: string): string | undefined; + /** + * Trims leading and trailing whitespace from the given string. If the resulting string is empty, + * the method returns the string "0". + * + * @param {string} str - The string to be trimmed. + * @return {string} - The trimmed string, or "0" if the resulting string is empty. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + trimToZero(str: string): string; + /** + * Trims a given string and replaces it with a provided default value if it is empty. + * + * @param {string} str - The string to be trimmed. + * @param {string} val - The value to replace if the trimmed string is empty. + * @return {string} The trimmed string, or the replacement value if empty. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010106.html + */ + trimToVal(str: string, val: string): string; + }; + /** + * Provides various utilities for handling and manipulating dates. + */ + static date: { + /** + * Calculates the difference in days between two dates given in string format. + * + * @param {string} refDateStr - The reference date as a string in the format YYYYMMDD. + * @param {string} targetDateStr - The target date as a string in the format YYYYMMDD. + * @return {number} The number of days between the reference date and the target date. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + diff(refDateStr: string, targetDateStr: string): number; + /** + * Converts a date string to an array of strings or numbers representing the date components. + * + * @param {string} str - The date string to be converted. + * @param {string} format - The format of the date string (e.g. "YYYYMMDD"). + * @param {boolean} [isString] - Optional. If true, returns the components as strings; otherwise, returns them as numbers. + * @return {string[] | number[]} An array of strings or numbers representing the date components. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + strToDateStrArr(str: string, format: string, isString?: boolean): string[] | number[]; + /** + * Converts a string to a NC.Date object based on the specified format. + * + * @param {string} str - The date and time string to be converted. + * - "19991231": "1999-12-31 00:00:00" + * - "1999123103": "1999-12-31 03:00:00" + * - "199912310348": "1999-12-31 03:48:00" + * - "19991231034856": "1999-12-31 03:48:56" + * @param {string} format - The expected format of the date and time string. + * - Y: Year + * - m: Month + * - d: Day + * - H: Hour + * - i: Minute + * - s: Second + * - e.g., "19991231": "Ymd" + * - e.g., "3112": "dm" + * - e.g., "12311999": "mdY" + * - e.g., "19991231120159": "YmdHis" + * + * > If the format argument is not provided, it is automatically set depending on the length of the input date string as follows: + * > - 4 digits: "Y" + * > - 6 digits: "Y-m" + * > - 8 digits: "Y-m-d" + * > - 10 digits: "Y-m-d H" + * > - 12 digits: "Y-m-d H:i" + * > - 14 digits: "Y-m-d H:i:s" + * + * > Date and time separator characters such as dash (-) and colon (:) are defined by the [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html) N.context.attr("data").formatter.date object functions. You can change these separator characters by modifying the return string of these functions. + * + * @return {NC.Date | null} A NC.Date object representing the date in the string, or null if the string does not match the format. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + strToDate(str: string, format: string): NC.Date | null; + /** + * Formats a given date string into the specified format. + * + * @param {string} str - The date string to be formatted. + * @param {string} [format] - An optional format string that determines the output format. If not provided, a default format will be used. + * - Y: Year + * - m: Month + * - d: Day + * - e.g., "19991231": "Ymd" + * - e.g., "3112": "dm" + * - e.g., "12311999": "mdY" + * @return {string} The formatted date string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + format(str: string, format?: string): string; // Format the date string + /** + * Converts a Date object to a timestamp. + * + * @param {Date} [dateObj] - The Date object to convert. If no Date object is provided, the current date and time are used. + * @return {number} The timestamp representation of the given date. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + dateToTs(dateObj?: Date): number; + /** + * Converts a Unix timestamp to a JavaScript Date object. + * + * @param {number} [tsNum] - The Unix timestamp to convert. If not provided, the current time will be used. + * @return {Date} The JavaScript Date object representing the given timestamp. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + tsToDate(tsNum?: number): Date; + /** + * Generates a list of date objects for a specified year and month. + * + * @param {number} year - The year for which the date list is to be generated. + * @param {number} month - The month for which the date list is to be generated. + * @return {[NC.JSONObject[]]} An array containing date objects for each day of the specified month in the specified year. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010108.html + */ + dateList(year: number, month: number): [Date, Date, Date, Date, Date, Date, Date][]; + }; + /** + * Provides utility methods for working with HTML elements, including converting data attributes to options objects, creating JSON data objects, defining data change effects, and calculating maximum z-index. + */ + static element: { + /** + * Converts an object string defined by the `data-opts` attribute value of an HTML element to an options object. + * + * @param {NJS} ele - HTML elements to be converted. + * @return {string} Options object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010107.html + */ + toOpts(ele: NJS): string; + /** + * Converts an array object string defined by the `data-format` or `data-validate` attribute value of an HTML element to an rule array object. + * + * @param {NJS} ele - HTML elements to be converted. + * @param {"format" | "validate"} ruleset - The type of rules to be applied, either formatting or validation. + * @return {NC.RuleObj} - The resulting rule object containing the applied rules. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010107.html + */ + toRules(ele: NJS, ruleset: "format" | "validate"): NC.RuleObj; + /** + * Creates a JSON Data object with the id and value attributes of the specified input elements. + * + * > Used in the N.form's add method to create initial data. + * + * e.g. Convert the values of the input elements inside the #box element to JSON data. + * ``` + * var data = N.element.toData($("#box").find(":input")); + * ``` + * + * @param {NJS} eles - N object containing only input select elements. + * @return {JSONObject} JSON data object with id and value pairs of the input elements. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010107.html + */ + toData(eles: NJS): NC.JSONObject; + + /** + * The effect of changes displayed on elements when data is synchronized by ND.ds is defined. + * + * @param {NJS} eles - HTML elements on which the change effect will be displayed. + * @return {void} This method does not return a value. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010107.html + */ + dataChanged(eles: NJS): void; + /** + * Calculates the maximum z-index value among a collection of HTML elements. + * + * @param {NJS} ele - A collection of HTML elements to evaluate. + * @return {number} The highest z-index value found within the collection of elements. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010107.html + */ + maxZindex(ele: NJS): number; + }; + /** + * Provides various utility functions and properties related to browser operation. + */ + static browser: { + /** + * Sets or gets a cookie based on the provided parameters. When only the name is provided, it retrieves the cookie value. + * When name and value are provided, it sets a cookie with the optional expiry days and domain. + * + * @param {string} name - The name of the cookie. + * @param {string} [value] - The value to be assigned to the cookie. If not provided, the function will return the current value of the cookie. + * @param {number} [expiredays] - The number of days until the cookie expires. Defaults to session cookie if not provided. + * @param {string} [domain] - The domain where the cookie is accessible. Defaults to current domain if not provided. + * @return {string | undefined} - The value of the cookie if only name is provided. Undefined if setting a cookie. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + cookie(name: string, value?: string, expiredays?: number, domain?: string): string | undefined; + /** + * Removes a cookie by its name and optional domain. + * + * @param {string} name - The name of the cookie to remove. + * @param {string} [domain] - The domain from which the cookie is to be removed. If omitted, the current domain is assumed. + * @return {void} This method does not return anything. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + removeCookie(name: string, domain?: string): void; + /** + * Function to retrieve the version of Microsoft Internet Explorer (IE). + * + * This function detects the version of IE being used by the client and returns + * it as a number. If the browser is not Internet Explorer, it returns 0. + * + * @return {number} The version of Internet Explorer as a number, or 0 if the browser is not IE. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + msieVersion(): number; + /** + * Checks if the given browser name matches the current browser type. + * + * @param {"opera" | "firefox" | "safari" | "chrome" | "ie" | "ios" | "android"} name - The name of the browser type to check against. + * @return {boolean} true if the given browser name matches the current browser type, otherwise false. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + is(name: NC.BrowserType): boolean; + /** + * Retrieves the context path of the application. + * + * This function returns a string representing the context path, + * which is typically the base path or root directory from which + * the application is served. It is commonly used for constructing + * URLs that are relative to the application's root. + * - "opera": Opera Browser. + * - "firefox": Mozilla Firefox Browser. + * - "safari": Apple Safari Browser. + * - "chrome": Google Chrome Browser. + * - "ie": Microsoft Internet Explorer Browser. + * - "android": Google Android OS + * - "ios": Apple iOS + * + * @returns {string} The application context path. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + contextPath(): string; + /** + * Calculates and returns the width of the browser's scrollbar. + * + * This function creates a temporary DOM element, measures the difference + * between its clientWidth and offsetWidth, and then removes the element. + * + * @returns {number} The width of the scrollbar in pixels. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010109.html + */ + scrollbarWidth(): number; + }; + /** + * Provides various utilities for handling messages. + */ + static message: { + /** + * Replaces variables in the given message string with corresponding values from the vars array. + * + * @param msg - The message string containing variables to be replaced. Variables are denoted by placeholders such as {0}, {1}, etc. + * @param vars - An optional array of strings. Each entry in this array provides a replacement for the corresponding placeholder in the message string. + * @return The message string with all placeholders replaced by their corresponding values from the vars array. + */ + replaceMsgVars(msg: string, vars?: string[]): string; + /** + * Returns a message that matches the currently set locale from the input message resource. + * + * The framework's default locale is `N.context.attr("core")` value in [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html) This can be set as the value of the `locale` property. + * + * @param {NC.MessageResourceObj} resource - The message resource object that needs to be fetched. + * Message resources must be created as object types and configure locale-specific message sets as follows. + * ``` + * var message = { + * "ko_KR": { + * messageKey: "안녕 {0}." + * }, + * "en_US": { + * messageKey: "Hello {0}." + * } + * } + * + * var msg = N.message.get(message, "key", ["Natural-JS"]); + * + * // msg: "Hello Natural-JS." + * ``` + * @param {string} key - This is the key of the message to retrieve from the message resource object. + * The message string containing variables to be replaced. Variables are denoted by placeholders such as {0}, {1}, etc. + * @param {string[]} [vars] - An optional array of strings. Each entry in this array provides a replacement for the corresponding placeholder in the message string. + * @return {string} Message string, if there is no message string corresponding to key, the key value is returned as is. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010110.html + */ + get(resource: NC.MessageResourceObj, key: string, vars?: string[]): string; + }; + /** + * Array utilities for various array operations. + */ + static array: { + /** + * Removes duplicate objects from an array based on a specified key. + * If no key is provided, it removes duplicate primitive values. + * + * @param {JSONObject[] | NJS} arr - The array from which duplicates are to be removed. + * @param {string} [key] - Optional. The property name on which duplication check is based. + * @return {JSONObject[]} A new array with duplicates removed. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010111.html + */ + deduplicate(arr: NC.JSONObject[] | NJS, key?: string): NC.JSONObject[]; + }; + /** + * Provides utilities for processing JSON data. + */ + static json: { + mapFromKeys(obj: NC.JSONObject | NC.JSONObject[]): NC.JSONObject | NC.JSONObject[]; + /** + * Merges two JSON arrays based on a specified key. + * + * > - Merges the arr2 argument based on the arr1 argument and excludes duplicate elements. + * > - If you specify the object's property name as the third argument, duplicate elements are excluded based on that property. + * > - Even if the objects specified by the arr1 argument are merged, their memory references do not change. + * + * @param {JSONObject[] | NJS} arr1 - The first JSON array to merge. + * @param {JSONObject[] | NJS} arr2 - The second JSON array to merge. + * @param {string} key - The key used to identify and merge objects from the arrays. + * @return {JSONObject[]} The merged JSON array containing objects from both arrays. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010112.html + */ + mergeJsonArray( + arr1: NC.JSONObject[] | NJS, + arr2: NC.JSONObject[] | NJS, + key: string, + ): NC.JSONObject[]; + /** + * Formats the given data to a string representation with specified indentation. + * + * @param {object | object[] | string} oData - The data to be formatted. The data can be an object, array of objects, or json string. + * @param {number} sIndent - The number of spaces to use for indentation. + * @return {string | null} The formatted string or null if the data type is unsupported. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010112.html + */ + format(oData: object | object[] | string, sIndent?: number): string | null; + }; + /** + * Provides utilities for processing event. + */ + static event: { + /** + * Checks if the provided keyboard event is related to number input keys. + * > This function was taken from "https://stackoverflow.com/a/13952775" and modified. + * + * @param e - The jQuery keyboard event to be checked. + * @return A boolean value indicating whether the event is related to number input keys. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010113.html + */ + isNumberRelatedKeys(e: JQuery.Event): boolean; // + /** + * Disables the current event handling, effectively preventing the default action and stopping the propagation of the event. + * + * @param {JQuery.Event} e - The jQuery event object associated with the event being handled. + * @return {boolean} - Always returns false to indicate that the default action should not be executed. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0101.html&tab=html/naturaljs/refr/refr010113.html + */ + disable(e: JQuery.Event): false; + /** + * Locks the window scrolling functionality to specific elements. + * + * @param {NJS} ele - HTML element that should lock window scrolling. + * @return {void} This method does not return a value. + */ + windowScrollLock(ele: NJS): void; + /** + * Retrieves the maximum duration of CSS animations or transitions applied to any of the given HTMLElements. + * + * @param {NJS} ele - A wrapped or unwrapped array of HTMLElements to analyze for CSS durations. + * @param {string} css - The CSS property name (e.g., 'animation', 'transition') to inspect for durations. + * @return {number} The maximum duration in milliseconds among all specified CSS properties on the provided elements. + */ + getMaxDuration(ele: NJS, css: string): number; + /** + * Detects the end event name of a CSS animation. + * > Referenced the code from [David Walsh](http://davidwalsh.name/css-animation-callback). + * + * @param {NJS} ele - The HTML elements to check for animation events. + * @return {string | "nothing"} The name of the animation event, or "nothing" if no event is found. + */ + whichAnimationEvent(ele: NJS): string | "nothing"; // Detect the end event name of CSS animations, + /** + * Detects the end event name of a CSS transition. + * > Referenced the code from [David Walsh](http://davidwalsh.name/css-animation-callback). + * + * @param {NJS} ele - The HTML elements to check for transition events. + * @return {string | "nothing"} The name of the animation event, or "nothing" if no event is found. + */ + whichTransitionEvent(ele: NJS): string | "nothing"; + }; + /** + * Used in N.formatter to process user formats. + * + * @see http://www.pengoworks.com/workshop/js/mask/ Mask JavaScript API(dswitzer@pengoworks.com) + */ + static mask: { + new(m: any): { + /** + * Sets a generic value for masking operations. + */ + setGeneric(_v: string, _d: boolean): string; + /** + * Sets a numeric value for masking based on the provided parameters. + */ + setNumeric(_v: string, _p: string, _d: boolean): string; + }; + }; +} + +/** + * Extends the JavaScript Date object to provide additional utility functions for date manipulation and formatting. + */ +interface Date { + /** + * Returns a string created with the date of the Date object in the specified format. + * > This is a function that extends to the Javascript Date object. + * + * > Referenced the library from [http://www.svendtofte.com/javascript/javascript-date-string-formatting/](http://www.svendtofte.com/javascript/javascript-date-string-formatting/) and [http://www.php.net/date](http://www.php.net/date). + * + * @param {string} input - Date format string. + * - Y: Year + * - m: Month + * - d: Day + * - H: Hour + * - i: Minute + * - s: Second + * - e.g., "1999-12-31": "Y-m-d" + * - e.g., "31/12": "d/m" + * - e.g., "12-31-1999": "m-d-Y" + * - e.g., "1999-12-31-12:01:59": "Y-m-d H:i:s" + * @param {number} [time] - A Timestamp value that sets the default date for the Date object. + * @return {string} The formatted date string. + */ + formatDate(input: string, time?: number): string; +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.core.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.core.misc.d.ts new file mode 100644 index 0000000..f7409aa --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.core.misc.d.ts @@ -0,0 +1,107 @@ +declare namespace NC { + type Primitive = string | number | boolean | null; + type JSONValue = Primitive | JSONObject | JSONValue[]; + interface JSONObject { + [key: string]: JSONValue; + } + + interface Date { + obj: Date; + format: string; + } + + type EventObject = object[]; + interface EventsObject { + [key: string]: EventObject; + } + + interface RuleObj { + id: { + [key: string]: [string, ...NC.Primitive[]][]; + }; + } + + type Instance = + | NA.Controller + | NU.Alert + | NU.Button + | NU.Datepicker + | NU.Popup + | NU.Tab + | NU.Select + | NU.Form + | NU.List + | NU.Grid + | NU.Pagination + | NU.Tree + | NUS.Notify + | NUS.Documents; + interface InstanceCallback { + (this: NC.Instance, instanceName: string, instance: NC.Instance): void; + } + + interface ValsCallback { + (this: NJS, index: number, selEle: NJS): void; + } + + /** + * Enumeration representing types of web browsers. + */ + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum BrowserType { + OPERA = "opera", + FIREFOX = "firefox", + SAFARI = "safari", + CHROME = "chrome", + IE = "ie", + IOS = "ios", + ANDROID = "android", + } + + /** + * Represents a message resource object that stores localized strings organized + * by language and message keys. This type is typically used for managing + * translations or multilingual support in an application. + * + * The structure of the object is as follows: + * - The first level keys represent message identifiers. + * - The second level keys correspond to specific languages or locales. + * - The values are the translated strings in the defined language or locale. + * + * Example: + * ``` + * { + * "greeting": { + * "en_US": "Hello", + * "ko_KR": "안녕하세요" + * } + * } + * ``` + */ + interface MessageResourceObj { + [key: string]: { + [key: string]: string; + }; + } + + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum ObjectType { + NUMBER = "number", + STRING = "string", + ARRAY = "array", + OBJECT = "object", + FUNCTION = "function", + DATE = "date", + } + + type Selector = + | string + | Element + | Array + | JQuery + | JQuery.Node + | JQuery.PlainObject + | ((this: Document, readyCallback: (this: Document) => void) => void) + | NJS + | JQuery; +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.data.d.ts b/src/main/resources/static/js/natural_js/@types/natural.data.d.ts new file mode 100644 index 0000000..2044886 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.data.d.ts @@ -0,0 +1,1144 @@ +declare class ND { + /** + * Formatter(N.formatter) is a library that formats an input data set (array of JSON objects) and returns the formatted data set. + * - Instead of using a ruleset, you can pass an element as an argument, where the element wraps elements with formatting rules declared in the data-format attribute. This will display the formatted string in those elements. If the element is a text input element, it will display the original string of the data when the cursor focuses in (focusin event), and display the formatted string when the cursor focuses out (focusout event). + * - You can also format on a per-string basis rather than using a dataset. + * + * @param {NJS | HTMLElement | ND.FormatRuleObject | string} [rules] - Specifies formatting rules. + * The formatting rule can be specified in two types as follows: + * - If you specify the rules as an object option: + * ``` + * // { "columnPropertyName": [["ruleName", arguments[0], arguments[1]...]] } + * new N.formatter(data, { + * "numeric": [["trimtoempty"], ["numeric", "#,###.##0000"]], + * "generic": [["trimtoempty"], ["generic", "@@ABCD"]], + * "limit": [["trimtoempty"], ["limit", "13", "..."]], + * "etc": [["date", 12]] + * }).format(); + * ``` + * - If you specify the rules by providing a jQuery object which includes elements with data-validate attributes: + * ``` + * ... + *
+ * + * + *
+ * ... + * + * + * ``` + * If you set formatting rules declaratively and want to change the formatting rules dynamically, you just need to reassign the value of the "format" data attribute for the corresponding input element as follows: + * ``` + * N("#limit").data("format", [["trimtoempty"]]) + * ``` + * + * @returns {ND.Formatter} A new N.format instance. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html + */ + formatter(rules?: NJS | HTMLElement | ND.FormatRuleObject | string): ND.Formatter; + /** + * Validator (N.validator) is a library that validates an input data set (array of JSON objects) and returns the result data set. + * - Instead of a ruleset, if you pass an element that wraps input elements with validation rules declared in the data-validate attribute, it will validate the value entered in the element when the cursor focusout occurs on the input element. If validation fails, an error message is displayed in the form of a tooltip near the input element. + * - Validation can also be performed on strings, not just datasets. + * + * @param {NJS|HTMLElement|ND.ValidationRuleObject|string} [rules] - Specifies the validation rules. + * You can specify the validation rules in two ways as follows: + * - Specifying rules as object options: + * ``` + * // { "columnName": [["ruleName", arguments[0], arguments[1] ... ] } + * N.validator(data, { + * "numeric": [["required"], ["integer+commas"]], + * "generic": [["required"], ["korean"]], + * "limit": [["required"], ["alphabet"]] + * }).validate(); + * ``` + * + * - Specifying rules by passing a jQuery object that wraps elements with data-validate attributes: + * ``` + * ... + *
+ * + * + *
+ * ... + * + * + * ``` + * + * To dynamically change the validation rules when specifying validation rules declaratively, reassign the validation rules to the "validate" data attribute of the input element as follows: + * + * ``` + * N("#numeric").data("validate", [["required"], ["integer"]]) + * ``` + * + * @returns {ND.Validator} A new N.validate instance. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html + */ + validator(rules?: NJS | HTMLElement | ND.ValidationRuleObject | string): ND.Validator; + /** + * Extracts data that matches the specified condition. + * + * @param {ND.ConditionCallback | string} condition - Specifies the filtering condition. + * + * If you specify a function, only the rows for which the function returns true are filtered. + * ``` + * var fData = N.data.filter([ + * { name: "John", age: 18 }, + * { name: "Mike", age: 16 }, + * { name: "Mike", age: 14 } + * ], function(item) { + * return item.name === "Mike" && item.age === 16; + * }); + * + * console.log(fData); // [{ name: "Mike", age: 16 }] + * ``` + * + * If you specify a condition string, only the rows that match the condition are filtered. + * ``` + * var fData = N.data.filter([ + * { name: "John", age: 18 }, + * { name: "Mike", age: 16 }, + * { name: "Mike", age: 14 } + * ], 'name === "Mike"'); + * + * console.log(fData); // [{ name: "Mike", age: 16 }, { name: "Mike", age: 14 }] + * ``` + * > Processing conditions with a function is faster than specifying them with a string. + * + * > Specifying conditions with a string does not support and(&&) or or(||) expressions and supports only a single condition expression. + * @return {NJS} A new JSON object array containing the elements that satisfy the provided condition. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0303.html&tab=html/naturaljs/refr/refr030302.html + */ + datafilter(this: NJS, condition: ND.ConditionCallback | string): NJS; + /** + * Sorts the data based on the specified "key" argument value. + * + * @param {string} key - The property name of the JSON object to be used as the sorting criteria + * @param {string} [reverse] - If set to true, sorts in descending order. + * @return {NJS} A new JSON object array containing the sorted elements. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0303.html&tab=html/naturaljs/refr/refr030302.html + */ + datasort(this: NJS, key: string, reverse?: boolean): NJS; + /** + * This class handles data synchronization logic for two-way data binding. + */ + static ds: { + instance(inst: NC.Instance, isReg?: boolean): ND.DataSync; + }; + static formatter: { + /** + * Formatter(N.formatter) is a library that formats an input data set (array of JSON objects) and returns the formatted data set. + * - Instead of using a ruleset, you can pass an element as an argument, where the element wraps elements with formatting rules declared in the data-format attribute. This will display the formatted string in those elements. If the element is a text input element, it will display the original string of the data when the cursor focuses in (focusin event), and display the formatted string when the cursor focuses out (focusout event). + * - You can also format on a per-string basis rather than using a dataset. + * + * @param {NJS} data - The data to be formatted. + * @param {NJS | HTMLElement | ND.FormatRuleObject | string} [rules] - Specifies formatting rules. + * The formatting rule can be specified in two types as follows: + * - If you specify the rules as an object option: + * ``` + * // { "columnPropertyName": [["ruleName", arguments[0], arguments[1]...]] } + * new N.formatter(data, { + * "numeric": [["trimtoempty"], ["numeric", "#,###.##0000"]], + * "generic": [["trimtoempty"], ["generic", "@@ABCD"]], + * "limit": [["trimtoempty"], ["limit", "13", "..."]], + * "etc": [["date", 12]] + * }).format(); + * ``` + * - If you specify the rules by providing a jQuery object which includes elements with data-validate attributes: + * ``` + * ... + *
+ * + * + *
+ * ... + * + * + * ``` + * If you set formatting rules declaratively and want to change the formatting rules dynamically, you just need to reassign the value of the "format" data attribute for the corresponding input element as follows: + * ``` + * N("#limit").data("format", [["trimtoempty"]]) + * ``` + * + * @returns {ND.Formatter} A new N.format instance. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html + */ + new( + data: NJS, + rules?: NJS | HTMLElement | ND.FormatRuleObject | string, + ): ND.Formatter; + /** + * Adds commas(,) at thousand separators. It processes only the part before the decimal point, if present. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + commas(str: string): string; + /** + * Convert to South Korea's resident registration number format. + * + * @param {string} str - The string to be formatted. + * @param {[number, string]} args - Replaces the entered string with the specified character. + * - args[0]: Length of string to replace + * - args[1]: Character to replace + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + rrn(str: string, args: [number, string]): string; + /** + * Convert to US Social Security number format. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + ssn(str: string): string; + /** + * Convert to South Korea's business registration number format. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + kbrn(str: string): string; + /** + * Convert to South Korea's corporate number format. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + kcn(str: string): string; + /** + * Convert to uppercase. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + upper(str: string): string; + /** + * Convert to lowercase. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + lower(str: string): string; + /** + * Converts the first alphabetic character to uppercase. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + capitalize(str: string): string; + /** + * Convert to South Korea's zip code format. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + zipcode(str: string): string; + /** + * Convert to South Korea's phone number format. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + phone(str: string): string; + /** + * Remove meaningless zeros. + * - 0100.0 -> 100 + * - 0100.10 -> 100.1 + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + realnum(str: string): string; + /** + * Removes the first and last whitespace from a string. If the input string is null or undefined, it is converted to an empty string. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + trimtoempty(str: string): string; + /** + * Removes the first and last whitespace from a string. If the input string is empty, null, or undefined, it is converted to 0. + * + * @param {string} str - The string to be formatted. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + trimtozero(str: string): string; + /** + * Removes the first and last whitespace from a string. If the input string is empty, null, or undefined, it is converted to valStr. + * + * @param {string} str - The string to be formatted. + * @param {[string]} args - String to be replaced when the value is null or undefined + * - args[0]: String to replace + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + trimtoval(str: string, args: [string]): string; + /** + * Converts or formats a date string according to specified options and returns the formatted date string. + * + * The global date format can be set in the N.context.attr("data").formatter.date property of [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010204.html). + * + * @param {string} str - The string to be formatted. + * @param {[number | string, "date" | "month", NU.Options.Datepicker]} args - Specifies the date format and options for the Datepicker component applied to the element designated as the third argument of the function. + * - args[0]:: Specifies the date format in either a numeric or string format as follows: + * - number + * - 4: year + * - 6: year-month + * - 8: year-month-day + * - 10: year-month-day hour + * - 12: year-month-day hour:minute + * - 14: year-month-day hour:minute:second + * - string + * - Y: year (4 digits) + * - y: year (2 digits) + * - m: month + * - d: day + * - H: hour + * - i: minute + * - s: second + * ``` + * "1999/12/31": "Y/m/d" + * "99/12/31": "y/m/d" + * "31/12": "d/m" + * "12/31/1999": "m/d/Y" + * "1999-12-31 12:01:59": "Y-m-d H:i:s" + * ``` + * - args[1]:: If "date", a date picker is applied to the element specified as the third argument. If "month", a month picker is applied. + * - args[2]:: You can specify options to create the Datepicker for the element designated as the third argument of the function. + * @param {NJS} [ele] - If this argument is specified, the NU.datepicker component is automatically applied. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + date( + str: string, + args: [number | string, "date" | "month", NU.Options.Datepicker], + ele?: NJS, + ): string; + /** + * Convert to time format. + * + * @param {string} str - The string to be formatted. + * @param {[number]} [args] - Specifies the time format. + * number If you specify the length by type, it is converted as follows: + * - 2: hour + * - 4: hour:minute + * - 6: hour:minute:second + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + time(str: string, args?: [number]): string; + /** + * Cuts the string to a specified length. + * + * @param {string} str - The string to be formatted. + * @param {[number, string]} args + * - args[0]: - String maximum length. + * - args[1]: - Character to be appended after cutting the string. + * @param {NJS} ele - An element that will display the original, uncut string as the title attribute. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + limit(str: string, args: [number, string], ele: NJS): string; + /** + * Replaces a string with a specified string. + * + * @param {string} str - The string to be formatted. + * @param {[number, string, boolean]} args + * - args[0]: - String to be replaced + * - args[1]: - String to replace + * - args[2]: - This is an argument used inside Formatter that is not generally used. + * @param {NJS} [ele] - This is an argument used inside Formatter that is not generally used. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + replace(str: string, args: [string, number, boolean], ele?: NJS): string; + /** + * Fill with filler characters from the left to the specified length. + * + * @param {string} str - The string to be formatted. + * @param {[number, string]} args + * - args[0]: - Length of string to be converted. + * - args[1]: - Filler character. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + lpad(str: string, args: [number, string]): string; + /** + * Fill with filler characters from the right to the specified length. + * + * @param {string} str - The string to be formatted. + * @param {[number, string]} args + * - args[0]: - Length of string to be converted. + * - args[1]: - Filler character. + * @return {string} The formatted string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + rpad(str: string, args: [number, string]): string; + /** + * Fill with filler characters from the right to the specified length. + * + * @param {string} str - The string to be masked. + * @param {[ND.FormatMaskingRules, string]} args + * - args[0]: - Masking Type + * - "phone": Masks phone number. + * - "email": Masks email address. + * - "address": Masks address. + * - "name": Masks name. + * - "rrn": Masks South Korea's resident registration number. + * - args[1]: - Masking character. + * If not entered, it will be replaced with the "*" character. + * @return {string} The masked string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + mask(str: string, args: [ND.FormatMaskingRules, string]): string; + /** + * Format the string using a user format. + * + * > The generic and numeric rules are developed based on the [Mask JavaScript API (v0.4b)](https://pengoworks.com/workshop/js/mask/) library. + * > The date masking part has been removed, and functionality has been changed to add recognition for Korean characters and handling for values less than 0 (values after the decimal point), allowing * characters and space characters (existing * characters are converted to ~ characters). + * > For detailed usage and examples, please refer to the link [here](https://pengoworks.com/workshop/js/mask/). + * + * - #: Numbers, spaces + * - @: Korean characters (consonants/vowels), English letters, spaces + * - ~: Korean characters (consonants/vowels), English letters, numbers, spaces + * + * Example) + * ``` + * mask: ~~~~'~-~~~ + * string: namesdan + * result: name's-dan + * + * mask: (###) ###-#### + * string: 614-777-6094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 6147776094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 614.777.6094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 6147a76094 + * result: 6147a76094 + * + * mask: (###) #x*-#### + * string: 6147a76094 + * result: (614) 7a7-6094 + * + * mask: ###.###.#### + * string: 614-777-6094 + * result: 614.777.6094 + * + * mask: ###/###.#### + * string: 614-777-6094 + * result: 614/777.6094 + * + * mask: phone !#: ###/###.#### + * string: 614-777-6094 + * result: phone !: 614/777.6094 + * ``` + * @param {string} str - The string to be masked. + * @param {[string]} args + * - args[0]: - User format string + * @return {string} The masked string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + generic(str: string, args: [string]): string; + /** + * Format a numeric string using a custom format. + * + * > The generic and numeric rules are developed based on the [Mask JavaScript API (v0.4b)](https://pengoworks.com/workshop/js/mask/) library. + * > The date masking part has been removed, and functionality has been changed to add recognition for Korean characters and handling for values less than 0 (values after the decimal point), allowing * characters and space characters(existing * characters are converted to ~ characters). + * > For detailed usage and examples, please refer to the link [here](https://pengoworks.com/workshop/js/mask/). + * + * - #: Numbers, spaces + * - @: Korean characters (consonants/vowels), English letters, spaces + * - ~: Korean characters (consonants/vowels), English letters, numbers, spaces + * + * Example) + * ``` + * mask: ~~~~'~-~~~ + * string: namesdan + * result: name's-dan + * + * mask: (###) ###-#### + * string: 614-777-6094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 6147776094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 614.777.6094 + * result: (614) 777-6094 + * + * mask: (###) ###-#### + * string: 6147a76094 + * result: 6147a76094 + * + * mask: (###) #x*-#### + * string: 6147a76094 + * result: (614) 7a7-6094 + * + * mask: ###.###.#### + * string: 614-777-6094 + * result: 614.777.6094 + * + * mask: ###/###.#### + * string: 614-777-6094 + * result: 614/777.6094 + * + * mask: phone !#: ###/###.#### + * string: 614-777-6094 + * result: phone !: 614/777.6094 + * ``` + * @param {string} str - The string to be masked. + * @param {[string, "ceil" | "floor" | "round"]} args + * - args[0]: - User format string + * - args[1]: - Depending on the entered value, decimal points are processed as follows. + * - ceil: Unconditionally round up (decimal point processing possible) + * - floor: Unconditionally discard (decimal point processing possible) + * - round: Rounding (possible to handle decimal points) + * @return {string} The masked string. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030106.html + */ + numeric(str: string, args: [string, "ceil" | "floor" | "round"]): string; + }; + + static validator: { + /** + * Validator (N.validator) is a library that validates an input data set (array of JSON objects) and returns the result data set. + * - Instead of a ruleset, if you pass an element that wraps input elements with validation rules declared in the data-validate attribute, it will validate the value entered in the element when the cursor focusout occurs on the input element. If validation fails, an error message is displayed in the form of a tooltip near the input element. + * - Validation can also be performed on strings, not just datasets. + * + * @param {NJS} data - The data to be validated. + * @param {NJS|HTMLElement|ND.ValidationRuleObject|string} [rules] - Specifies the validation rules. + * You can specify the validation rules in two ways as follows: + * - Specifying rules as object options: + * ``` + * // { "columnName": [["ruleName", arguments[0], arguments[1] ... ] } + * N.validator(data, { + * "numeric": [["required"], ["integer+commas"]], + * "generic": [["required"], ["korean"]], + * "limit": [["required"], ["alphabet"]] + * }).validate(); + * ``` + * + * - Specifying rules by passing a jQuery object that wraps elements with data-validate attributes: + * ``` + * ... + *
+ * + * + *
+ * ... + * + * + * ``` + * + * To dynamically change the validation rules when specifying validation rules declaratively, reassign the validation rules to the "validate" data attribute of the input element as follows: + * + * ``` + * N("#numeric").data("validate", [["required"], ["integer"]]) + * ``` + * + * @returns {ND.Validator} A new N.validate instance. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html + */ + new( + data: NJS, + rules?: NJS | HTMLElement | ND.ValidationRuleObject | string, + ): ND.Validator; + /** + * Checks required input. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + required(str: string): boolean; + /** + * Checks whether only English characters are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + alphabet(str: string): boolean; + /** + * Checks whether only numbers (integers) are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + integer(str: string): boolean; + /** + * Checks whether only Korean characters are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + korean(str: string): boolean; + /** + * Checks whether only English characters and numbers (integers) are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + alphabet_integer(str: string): boolean; + /** + * Checks whether only numbers (integers) and Korean characters are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + integer_korean(str: string): boolean; + /** + * Checks whether only English and Korean characters are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + alphabet_korean(str: string): boolean; + /** + * Checks whether only English characters, numbers (integers), and Korean characters are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + alphabet_integer_korean(str: string): boolean; + /** + * Checks whether only numbers (integers) and dashes (-) are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + dash_integer(str: string): boolean; + /** + * Checks whether only numbers (integers) and commas (,) are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + commas_integer(str: string): boolean; + /** + * Checks whether only numbers (integers), commas (,), and dots (.) are entered. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + number(str: string): boolean; + /** + * Checks if it matches email address format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + email(str: string): boolean; + /** + * Checks if it matches URL format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + url(str: string): boolean; + /** + * Checks if it matches South Korea's postal code format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + zipcode(str: string): boolean; + /** + * Checks whether the specified number of decimal places has been entered. + * + * @param {string} str - The string to be checked. + * @param {[number]} args + * - args[0]: - Decimal point length. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + decimal(str: string, args: NC.Primitive[]): boolean; + /** + * Checks if it matches the South Korea's phone number format. + * + * @param {string} str - The string to be checked. + * @param {[boolean]} args + * - args[0]: - If true, true is returned even if only 1 of the last 4 digits of the phone number is entered. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + phone(str: string, args: [boolean]): boolean; + /** + * Checks if it matches the South Korea's resident registration number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + rrn(str: string): boolean; + /** + * Checks if it matches the U.S. Social Security number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + ssn(str: string): boolean; + /** + * Checks if it matches the South Korea's alien registration number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + frn(str: string): boolean; + /** + * Checks if it matches the South Korea's alien registration number or resident registration number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + frn_rrn(str: string): boolean; + /** + * Checks if it matches the South Korea's corporate number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + kbrn(str: string): boolean; + /** + * Checks if it matches the South Korea's business registration number format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + kcn(str: string): boolean; + /** + * Checks if it matches the date format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + date(str: string): boolean; + /** + * Checks if it matches the time format. + * + * @param {string} str - The string to be checked. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + time(str: string): boolean; + /** + * Checks whether the specified value has been entered. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + accept(str: string, args: [string]): boolean; + /** + * Checks whether an unspecified value has been entered. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + notaccept(str: string, args: [string]): boolean; + /** + * Checks whether the specified value is included. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + match(str: string, args: [string]): boolean; + /** + * Checks whether the specified value is not included. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + notmatch(str: string, args: [string]): boolean; + /** + * Checks whether the specified file extension has been entered. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + acceptfileext(str: string, args: [string]): boolean; + /** + * Checks whether an unspecified file extension has been entered. + * + * @param {string} str - The string to be checked. + * @param {[string]} args + * - args[0]: String to compare. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + notacceptfileext(str: string, args: [string]): boolean; + /** + * Checks whether the value of the specified input element is equal to the value. + * + * @param {string} str - The string to be checked. + * @param {[JQuery.Selector]} args + * - args[0]: jQuery selector string to select input element. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + equalTo(str: string, args: [JQuery.Selector]): boolean; + /** + * Checks whether the input string length is less than the specified length. + * + * @param {string} str - The string to be checked. + * @param {[number]} args + * - args[0]: Maximum string length to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + maxlength(str: string, args: [number]): boolean; + /** + * Checks whether the input string length is greater than the specified length. + * + * @param {string} str - The string to be checked. + * @param {[number]} args + * - args[0]: Minimum string length to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + /* eslint-disable-next-line @definitelytyped/no-single-element-tuple-type */ + minlength(str: string, args: [number]): boolean; + /** + * Checks whether the input string length is between the specified lengths. + * + * @param {string} str - The string to be checked. + * @param {[number, number]} args + * - args[0]: Minimum string length to allow. + * - args[1]: Maximum string length to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + rangelength(str: string, args: [number, number]): boolean; + /** + * Checks whether the byte length of input string is less than the specified length. + * + * @param {string} str - The string to be checked. + * @param {[number, number]} args + * - args[0]: Maximum byte length to allow. + * - args[1]: This is the byte length of Hangul and Hangul special characters, excluding English characters, numbers, and basic special characters. + * > If not entered, the N.context.attr("core").charByteLength value from Config(natural.config.js) is applied. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + maxbyte(str: string, args: [number, number]): boolean; + /** + * Checks whether the byte length of input string is greater than the specified length. + * + * @param {string} str - The string to be checked. + * @param {[number, number]} args + * - args[0]: Minimum byte length to allow. + * - args[1]: This is the byte length of Hangul and Hangul special characters, excluding English characters, numbers, and basic special characters. + * > If not entered, the N.context.attr("core").charByteLength value from Config(natural.config.js) is applied. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + minbyte(str: string, args: [number, number]): boolean; + /** + * Checks whether the byte length of input string is between the specified lengths. + * + * @param {string} str - The string to be checked. + * @param {[number, number, number]} args + * - args[0]: Minimum byte length to allow. + * - args[1]: Maximum byte length to allow. + * - args[2]: This is the byte length of Hangul and Hangul special characters, excluding English characters, numbers, and basic special characters. + * > If not entered, the N.context.attr("core").charByteLength value from Config(natural.config.js) is applied. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + rangebyte(str: string, args: [number, number, number]): boolean; + /** + * Checks whether the input number value is less than the specified value. + * + * @param {string} str - The string to be checked. + * @param {[number]} args + * - args[0]: Maximum number value to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + maxvalue(str: string, args: [number, number]): boolean; + /** + * Checks whether the input number value is greater than the specified value. + * + * @param {string} str - The string to be checked. + * @param {[number]} args + * - args[0]: Minimum number value to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + minvalue(str: string, args: [number, number]): boolean; + /** + * Checks whether the input number value is between the specified values. + * + * @param {string} str - The string to be checked. + * @param {[number, number]} args + * - args[0]: Minimum number value to allow. + * - args[1]: Maximum number value to allow. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + rangevalue(str: string, args: [number, number]): boolean; + /** + * Tests whether a string matches a given regular expression pattern. + * + * @param {string} str - The string to be tested against the regular expression. + * @param {[string, string]} args + * - args[0]: Regular expression pattern. + * - args[1]: Flags used to define the search + * behavior of the pattern. + * @return {boolean} - Validation result. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030206.html + */ + regexp(str: string, args: [string, string]): boolean; + }; + static data: { + /** + * Extracts data that matches the specified condition. + * + * @param {NJS | NC.JSONObject[]} arr - The data to filter + * @param {ND.ConditionCallback | string} condition - Specifies the filtering condition. + * + * If you specify a function, only the rows for which the function returns true are filtered. + * ``` + * var fData = N.data.filter([ + * { name: "John", age: 18 }, + * { name: "Mike", age: 16 }, + * { name: "Mike", age: 14 } + * ], function(item) { + * return item.name === "Mike" && item.age === 16; + * }); + * + * console.log(fData); // [{ name: "Mike", age: 16 }] + * ``` + * + * If you specify a condition string, only the rows that match the condition are filtered. + * ``` + * var fData = N.data.filter([ + * { name: "John", age: 18 }, + * { name: "Mike", age: 16 }, + * { name: "Mike", age: 14 } + * ], 'name === "Mike"'); + * + * console.log(fData); // [{ name: "Mike", age: 16 }, { name: "Mike", age: 14 }] + * ``` + * > Processing conditions with a function is faster than specifying them with a string. + * + * > Specifying conditions with a string does not support and(&&) or or(||) expressions and supports only a single condition expression. + * @return {NJS} A new JSON object array containing the elements that satisfy the provided condition. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0303.html&tab=html/naturaljs/refr/refr030302.html + */ + filter( + arr: NJS | NC.JSONObject[], + condition: ND.ConditionCallback | string, + ): NJS | NC.JSONObject[]; + sortBy(key: string, reverse: 1 | -1): (a: number, b: number) => 1 | -1 | 0; + /** + * Sorts the data based on the specified "key" argument value. + * + * @param {NJS | NC.JSONObject[]} arr - Data to be sorted + * @param {string} key - The property name of the JSON object to be used as the sorting criteria + * @param {string} [reverse] - If set to true, sorts in descending order. + * @return {NJS} A new JSON object array containing the sorted elements. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0303.html&tab=html/naturaljs/refr/refr030302.html + */ + sort( + arr: NJS | NC.JSONObject[], + key: string, + reverse?: boolean, + ): NJS | NC.JSONObject[]; + }; +} + +declare namespace ND { + interface Formatter { + /** + * TODO Please add a comment. + */ + format(row: number): ND.FormatResultObject; + /** + * TODO Please add a comment. + */ + unformat(row: number, key: string): NC.Primitive; + } + + interface Validator { + /** + * TODO Please add a comment. + */ + validate(row: number): ND.ValidateResultObject; + } + + interface DataSync { + viewContext: NJS; + /** + * TODO Please add a comment. + */ + remove(): DataSync; + /** + * TODO Please add a comment. + */ + notify(row: number, key: string): DataSync; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.data.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.data.misc.d.ts new file mode 100644 index 0000000..e31e323 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.data.misc.d.ts @@ -0,0 +1,106 @@ +declare namespace ND { + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum FormatRules { + COMMAS = "commas", + RRN = "rrn", + SSN = "ssn", + KBRN = "kbrn", + KCN = "kcn", + UPPER = "upper", + LOWER = "lower", + CAPITALIZE = "capitalize", + ZIPCODE = "zipcode", + PHONE = "phone", + REALNUM = "realnum", + TRIMTOEMPTY = "trimtoempty", + TRIMTOZERO = "trimtozero", + TRIMTOVAL = "trimtoval", + DATE = "date", + TIME = "time", + LIMIT = "limit", + REPLACE = "replace", + LPAD = "lpad", + RPAD = "rpad", + MASK = "mask", + GENERIC = "generic", + NUMERIC = "numeric", + } + + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum FormatMaskingRules { + PHONE = "phone", + EMAIL = "email", + ADDRESS = "address", + NAME = "name", + RRN = "rrn", + } + + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum ValidationRules { + REQUIRED = "required", + ALPHABET = "alphabet", + INTEGER = "integer", + KOREAN = "korean", + ALPHABET_INTEGER = "alphabet_integer", + INTEGER_KOREAN = "integer_korean", + ALPHABET_KOREAN = "alphabet_korean", + ALPHABET_INTEGER_KOREAN = "alphabet_integer_korean", + DASH_INTEGER = "dash_integer", + COMMAS_INTEGER = "commas_integer", + NUMBER = "number", + EMAIL = "email", + URL = "url", + ZIPCODE = "zipcode", + DECIMAL = "decimal", + PHONE = "phone", + RRN = "rrn", + SSN = "ssn", + FRN = "frn", + FRN_RRN = "frn_rrn", + KBRN = "kbrn", + KCN = "kcn", + DATE = "date", + TIME = "time", + ACCEPT = "accept", + MATCH = "match", + ACCEPTFILEEXT = "acceptfileext", + NOTACCEPT = "notaccept", + NOTMATCH = "notmatch", + NOTACCEPTFILEEXT = "notacceptfileext", + EQUALTO = "equalTo", + MAXLENGTH = "maxlength", + MINLENGTH = "minlength", + RANGELENGTH = "rangelength", + MAXBYTE = "maxbyte", + MINBYTE = "minbyte", + RANGEBYTE = "rangebyte", + MAXVALUE = "maxvalue", + MINVALUE = "minvalue", + RANGEVALUE = "rangevalue", + REGEXP = "regexp", + } + + interface FormatRuleObject { + [key: string]: [FormatRules, ...NC.Primitive[]][]; + } + + interface ValidationRuleObject { + [key: string]: [ValidationRules, ...NC.Primitive[]][]; + } + + interface FormatResultObject { + [key: string]: string; + } + + type ValidateResultObject = { + [key: string]: { + rule: string; + result: boolean; + msg: string | null; + }[]; + }[]; + + interface ConditionCallback { + (item: object): boolean; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.js.d.ts b/src/main/resources/static/js/natural_js/@types/natural.js.d.ts new file mode 100644 index 0000000..86423dd --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.js.d.ts @@ -0,0 +1,300 @@ +/** + * N() is a core method of Natural-JS. It returns a collection of matched elements found in the DOM based on the provided arguments or creates elements matching the given HTML string. + * + * N() extends the jQuery() function, thus it can be replaced with $() or jQuery(). However, local functions of the N object cannot be used within jQuery or $ objects. + */ +declare function N( + selector?: NC.Selector, + context?: Element | Document | JQuery | string | NJS, +): NJS; + +interface NJS extends Omit, NC, NA, ND, NU, NUS { + version: { + "Natural-JS": string; + "Natural-CORE": string; + "Natural-ARCHITECTURE": string; + "Natural-DATA": string; + "Natural-UI": string; + "Natural-UI.Shell": string; + "Natural-CODE": string; + "Natural-TEMPLATE": string; + }; + + selector: string; + + [index: number]: T extends Array ? T[number] : never; +} + +/** + * N is a collection class that defines common functions for Natural-JS. + */ +declare namespace N { + // === Natural-CORE + const locale: typeof NC.locale; + const debug: typeof NC.debug; + const log: typeof NC.log; + const info: typeof NC.info; + const warn: typeof NC.warn; + const error: typeof NC.error; + const type: typeof NC.type; + const isString: typeof NC.isString; + const isNumeric: typeof NC.isNumeric; + const isPlainObject: typeof NC.isPlainObject; + const isEmptyObject: typeof NC.isEmptyObject; + const isArray: typeof NC.isArray; + const isArraylike: typeof NC.isArraylike; + const isWrappedSet: typeof NC.isWrappedSet; + const isElement: typeof NC.isElement; + const toSelector: typeof NC.toSelector; + const serialExecute: typeof NC.serialExecute; + const gc: typeof NC.gc; + const string: typeof NC.string; + const date: typeof NC.date; + const element: typeof NC.element; + const browser: typeof NC.browser; + const message: typeof NC.message; + const array: typeof NC.array; + const json: typeof NC.json; + const event: typeof NC.event; + const mask: typeof NC.mask; + + // === Natural-ARCHITECTURE + /** + * Performs asynchronous HTTP (Ajax) requests in `N.comm`. + * + * @see https://api.jquery.com/jquery.ajax/#jQuery-ajax-settings + */ + const ajax: typeof NA.ajax; + /** + * N.comm is a library that supports Ajax communication with the server, such as requesting content or data from the server or passing parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0203.html + */ + function comm(obj: NJS | string, url?: string | NA.Options.Request): NA.Communicator; + /** + * N.cont executes the init function of the Controller object and returns the Controller object. + * + * > The Controller object is an object that controls the elements of the View and the data retrieved from the Communicator. + * + * N.cont should be declared immediately below the View area of the page, like this: + * + * ``` + *
+ *

View area

+ *
+ * + * + * ``` + * + * If you load a page with the above structure using the N.popup, N.tab component or N.comm library, the init function of the Controller object is called when page loading is complete. + * + * > For Natural-ARCHITECTURE-based pages to function properly, they must be loaded with the N.comm library, N.popup, or N.tab components. + * + * > When selecting an element on a page, you must `find` on a view or specify view as the `context` argument (second argument) to a jQuery function. + * Otherwise, unintended elements from other block pages may be selected, resulting in unpredictable errors. + * For more information, please refer to the [Restrictions and Tips](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0601.html) menu. + * + * > When `N(".view").cont()` is executed, a `pageid data attribute value` such as `data-pageid="view"` is created in the `.view` element specified by the selector. + * The `pageid` is `.(dot), #(sharp), [(left bracket), ](right bracket), '(single quote), :(colon), ((left bracket), ), )(right bracket), >(right arrow bracket), " "(space), -(hyphen)` characters are removed to create pageid, so the page identification value is defined not to include the special characters. + * For example, `N("page.view-01").cont()` creates a pageid of `pageview01` with the dot and hyphen removed. + * + * To control a specific page, such as a block page or tab content, you can get a Controller object as follows. + * ``` + * var page01Cont = N("#page01").instance("cont"); + * page01Cont.gridInst.bind([]); + * ``` + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0201.html + */ + const cont: typeof NA.cont; + /** + * Context (N.context) is a space that guarantees data persistence within the life-cycle (until the page is loaded and redirected to another URL) of a Natural-JS-based application. + * + * Natural-JS's [configuration values](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html), framework common messages, etc. are stored in the N.context object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0206.html + */ + const context: typeof NA.context; + /** + * Config(natural.config.js) stores the operational environment settings, AOP settings, Communication Filter settings, + * and global option values for UI components of Natural-JS. + * + * The settings are defined in the natural.config.js file and are saved as separate attribute values for each package in N.context. + * - N.context.attr("core"): Basic settings for the Natural-CORE package libraries. + * - N.context.attr("architecture"): Basic settings for the Natural-ARCHITECTURE package libraries. + * - N.context.attr("data"): Basic settings for the Natural-DATA package libraries. + * - N.context.attr("ui"): Basic settings for the Natural-UI package libraries. + * - N.context.attr("ui.shell"): Basic settings for the Natural-UI.Shell package libraries. + * + * The following two attributes are essential when applying Natural-JS: + * + * The following two attributes are essential when applying Natural-JS: + * 1. N.context.attr("architecture").page.context: Specifies the container area (element) where the web application's content will be displayed as a jQuery selector string. + * > It is automatically entered when using the Documents(N.docs) component. + * + * > If the web application is built as an SPA (Single Page Application), specify the element that loads the menu page. Otherwise, enter "body" or the element wrapping the entire content. + * 2. N.context.attr("ui").alert.container: Specifies the area (element) where elements of the N.alert and N.popup components will be stored as a jQuery selector string. + * > It is automatically entered when using the Documents(N.docs) component. + * + * > If the web application is built as an SPA (Single Page Application), specify the element that loads the menu page. Otherwise, enter "body" or the element wrapping the entire content. + * + * The order in which component options are applied is as follows: + * 1. Option values specified when initializing the component. + * 2. Option values specified in Config(natural.config.js). + * 3. The component’s default option values. + * > If you set a global event option, the global event is executed first, followed by the event specified when initializing the component. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html + */ + const config: typeof NA.config; + + // === Natural-DATA + /** + * DataSync(N.ds) is a module in Natural-JS that handles two-way data binding. + */ + const ds: typeof ND.ds; + const formatter: typeof ND.formatter; + const validator: typeof ND.validator; + /** + * The Natural-DATA library provides methods and functions for sorting, filtering, and refining data of type array[json object]. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0303.html + */ + const data: typeof ND.data; + + // === Natural-UI + /** + * This class defines common functions that support the development of Natural-UI components. + */ + const ui: typeof NU.ui; + const alert: typeof NU.alert; + /** + * Button (N.button) is a UI component that creates buttons using the `a, input[type=button], button` elements specified by the context option. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html + */ + const button: typeof NU.button; + /** + * Datepicker (N.datepicker) is a UI component that displays a calendar popup on the text input element specified by the context option, allowing you to select and input dates or months. + * + * - You can easily use the Datepicker by declaring the "date" rule in the data-format attribute of the text input element and linking it with data-related components. Refer to the ["date", 4|6|8|10|12|14, "month"|"date"] rules in the [Declarative Options] tab of the Form, List, Grid menu, and the [Format Rule List] tab of the Formatter menu. + * + * > For descriptions of declarative options, refer to the declarative options section of the [API Documentation Guide](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0001.html) menu. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html + */ + const datepicker: typeof NU.datepicker; + /** + * Popup (N.popup) is a UI component that creates a layer popup using the internal element specified by the context option or the page specified by the url option. + * + * - When a popup is created with the page specified by the url option, the generated popup's Controller object will have caller (the N.popup instance that called it) and opener (the parent page's Controller object that called it, passed as an option during popup creation) properties. You can use the opener to control the parent page or use the caller to close itself or send data to the parent Controller. + * + * > If the Popup dialog box is not displayed, and an error occurs, you need to specify the top-level HTML element where N.alert related HTML elements will be stored using a jQuery selector string in the N.context.attr("ui").alert.container property of the [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html). + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html + */ + const popup: typeof NU.popup; + /** + * Tab(N.tab) is a UI component that creates a tab page view using a context option specified element composed of div>ul>li tags. + * + * If a page specified with the url option is created as a popup, the Controller object of the created popup will have properties caller(the N.popup instance that called it) and opener(the parent page Controller object that called it, which must be passed as an option when creating the popup). + * You can use opener to control the parent page or use caller to close itself and send data to the parent Controller. + * By calling the cont method on an instance of N.tab, you can get the Controller objects of each tab page. For more details on the cont method, please refer to the [Function] tab. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html + */ + const tab: typeof NU.tab; + /** + * Select(N.select) is a UI component that binds data to select, input[type=checkbox], input[type=radio] elements to create selection elements and extend the functionality of those controls. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html + */ + const select: typeof NU.select; + /** + * Form(N.form) is a UI component that binds or creates single row data on an element (block elements like div, table) specified with the context option. + * - N.form integrates with components of the Natural-DATA package to simplify the data formatting and input data validation processes. For more details, please refer to the [Declarative Option] tab. + * - Data is bound when the property name (column name) of the bound data object matches the id attribute value of the element. Data formatting and validation are activated when data is bound to an element. + * - If elements within the context elements of N.form are specified again as context for N.form or other data-related components (e.g., N.grid, N.list), errors may occur or data synchronization issues may arise. Ensure that context elements for N.form are specified without duplication or that column data is split to avoid data redundancy. For how to separate context elements or data, please refer to the example > Multi Form Binding menu source code. + * > After adding to a form element created with add() and then calling bind(), or calling bind() after add() or bind() after bind(), the data synchronization logic for the form's input elements may have issues. In this case, be sure to execute the unbind method in between. + * > ``` + * > var formInst = N([]).form().add(); + * > formInst.unbind().bind(0, [{ "col01": "abcd" }]) + * > ``` + * - When the value of an input element is changed or the val method is used to change data, the rowStatus property is created, with "insert" for input, "update" for modification, and "delete" for deletion. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html + */ + const form: typeof NU.form; + /** + * List(N.list) is a UI component that creates a data list in a single column format using ul>li elements specified with the context option. + * + * - N.list integrates with components of the Natural-DATA package to simplify the data formatting and input data validation processes. For more details, please refer to the [Declarative Option] tab. + * - Data is bound when the property name (column name) of the bound data object matches the id attribute value of the element. Data formatting and validation are activated when data is bound to an element. + * - When changing the value of an input element or the val method is used to change data, the rowStatus property is created, with "insert" for input, "update" for modification, and "delete" for deletion. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html + */ + const list: typeof NU.list; + /** + * Grid(N.grid) is a UI component that creates a data list in a multi-column format using table elements specified with the context option. + * - N.grid integrates with components of the Natural-DATA package to simplify the data formatting and input data validation processes. For more details, please refer to the [Declarative Option] tab. + * - Data is bound when the property name (column name) of the bound data object matches the id attribute value of the element. Data formatting and validation are activated when data is bound to an element. + * - Provides two types of grids: fixed header and list type. + * - When changing the value of an input element or the val method is used to change data, the rowStatus property is created. The rowStatus value is "insert" for input, "update" for modification, and "delete" for deletion. + * - Provides many functions for handling list data, such as pasting Excel data, data filtering/sorting, etc. For more details on the provided functions, please refer to the option tab and function tab. + * > The width of the table element to be made into a grid must be specified, whether it is a fixed length (px) or a variable length (%). + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html + */ + const grid: typeof NU.grid; + /** + * Pagination(N.pagination) is a UI component that creates paging indexes for list data or overall row counts. + * - The structure of the N.pagination context element consists of a div>ul>li>a hierarchy. + * - The N.pagination component can generate parameters for SQL paging or paginate full list data of type array[json object]. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html + */ + const pagination: typeof NU.pagination; + + /** + * Tree(N.tree) is a UI component that creates tree elements from hierarchical data. + * - A checkbox can be added to the nodes for group selection. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html + */ + const tree: typeof NU.tree; + + // === Natural-UI.Shell + /** + * Notify(N.notify) is a UI component that displays global notifications at a specified position without requiring user confirmation. + * > The Alert(N.alert) is used for handling messages within the content area, while N.notify handles messages site-wide. Thus, N.alert component elements are created within each View element, and N.notify is created in the document.body element. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html + */ + function notify(position: NUS.Options.NotifyPosition, opts?: NUS.Options.Notify): NUS.Notify; + /** + * Creates a message notification. + */ + namespace notify { + const add: typeof NUS.notify.add; + } + /** + * Documents(N.docs) is a page container that displays menu pages based on Natural-JS in either MDI (Multi Document Interface) or SDI (Single Document Interface) structures. + * - Options such as the maximum number of pages and the maximum number of state-maintained pages can be specified. It can also display a loading indicator for the requests and responses of N.comm. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html + */ + const docs: typeof NUS.docs; + /** + * Natural-CODE + */ + const code: typeof NCD; + /** + * Natural-TEMPLATE + */ + const template: typeof NT; +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.template.d.ts b/src/main/resources/static/js/natural_js/@types/natural.template.d.ts new file mode 100644 index 0000000..a15fc84 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.template.d.ts @@ -0,0 +1,8 @@ +declare class NT { + static readonly aop: { + codes(cont: NA.Objects.Controller.Object, joinPoint: unknown): void; + template(cont: NA.Objects.Controller.Object, joinPoint: unknown): void; + components(cont: NA.Objects.Controller.Object, prop: string, compActionDefer: JQuery.Deferred[]): void; + events(cont: NA.Objects.Controller.Object, prop: string): void; + }; +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.template.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.template.misc.d.ts new file mode 100644 index 0000000..fbf72d1 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.template.misc.d.ts @@ -0,0 +1,206 @@ +declare namespace NT { + namespace Options { + interface Extra { + /** + * After the component is initialized, the specified function is immediately executed. + * - string: Function name + * - ...any[]: Arguments of the function + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + action?: string | [string, ...any[]]; + /** + * Purpose of Form - When you enter the string "search-box", the specified area is created as a search box Form. You can specify more detailed options with the object type. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + usage?: string | { + "search-box": { + defaultButton?: JQuery.Selector; + events?: { + event: string; + target: JQuery.Selector; + handler: NT.Objects.Controller.EventHandler; + }[]; + }; + }; + } + /** + * Represents a function type for filtering an array of JSON objects. + * + * @param {NJS} data - Data to process. + * @returns {NJS} - Processed data. + */ + interface SelectFilter { + (data: NJS): NJS; + } + interface Select { + /** + * Common code classification code - Set the classification code value of the code list to bind. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + code?: string; + /** + * The Communicator to retrieve the list - Specify `c.{serviceName}` declared in the Controller object. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + comm?: string; + /** + * Data to bind - You can directly create and bind data like [{}, {}] through the `data` option without specifying the `comm` option. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + data?: NC.JSONObject[]; + /** + * Property name of the data bound to the label of the selection element - Set the property name to bind from the retrieved data object. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + key?: string; + /** + * Property name of the data bound to the value of the selection element - Set the property name to bind from the retrieved data object. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + val?: string; + /** + * Data filter - Filters the common code data before binding. + * + * ``` + * "filter": function (data) { + * // If you process data (original data) and return it, the processed data is bound. + * return N(N.array.deduplicate(data, "age")).datasort("age"); // Sort after removing duplicates. + * } + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + filter?: SelectFilter; + /** + * Default selected value - Set the value of the default selection when the component is initialized. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + selected?: string; + } + } + + namespace Objects { + namespace Controller { + /** + * EventHandler is a type definition for a callback function used to handle events. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/template/documents/template-guide.html + */ + interface EventHandler { + (this: HTMLElement, e: JQuery.Event, ...args: any[]): void; + } + + type InitialObject = + & { + [K in `p.alert.${string}`]: (NT.Options.Extra & NU.Options.Alert); + } + & { + [K in `p.button.${string}`]: (NT.Options.Extra & NU.Options.Button); + } + & { + [K in `p.datepicker.${string}`]: (NT.Options.Extra & NU.Options.Datepicker); + } + & { + [K in `p.popup.${string}`]: (NT.Options.Extra & NU.Options.Popup); + } + & { + [K in `p.tab.${string}`]: (NT.Options.Extra & NU.Options.Tab); + } + & { + [K in `p.select.${string}`]: + | [string, string?, string?, NT.Options.SelectFilter?] + | NT.Options.Select; + } + & { + [K in `p.form.${string}`]: (NT.Options.Extra & NU.Options.Form); + } + & { + [K in `p.list.${string}`]: (NT.Options.Extra & NU.Options.List); + } + & { + [K in `p.grid.${string}`]: (NT.Options.Extra & NU.Options.Grid); + } + & { + [K in `p.pagination.${string}`]: (NT.Options.Extra & NU.Options.Pagination); + } + & { + [K in `p.tree.${string}`]: (NT.Options.Extra & NU.Options.Tree); + } + & { + [K in `c.${string}`]: (...args: any[]) => NA.Communicator; + } + & { + [K in `e.${string}`]: EventHandler | { + target: JQuery.Selector; + handler: EventHandler; + }; + }; + + type Object = + & NA.Objects.Controller.BaseObject + & InitialObject + & { + [K in `p.alert.${string}`]: NU.Alert; + } + & { + [K in `p.button.${string}`]: NU.Button; + } + & { + [K in `p.datepicker.${string}`]: NU.Datepicker; + } + & { + [K in `p.popup.${string}`]: NU.Popup; + } + & { + [K in `p.tab.${string}`]: NU.Tab; + } + & { + [K in `p.select.${string}`]: NU.Select; + } + & { + [K in `p.form.${string}`]: NU.Form; + } + & { + [K in `p.list.${string}`]: NU.List; + } + & { + [K in `p.grid.${string}`]: NU.Grid; + } + & { + [K in `p.pagination.${string}`]: NU.Pagination; + } + & { + [K in `p.tree.${string}`]: NU.Tree; + } + & { + [K in `e.${string}`]: NJS; + }; + } + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.ui.d.ts b/src/main/resources/static/js/natural_js/@types/natural.ui.d.ts new file mode 100644 index 0000000..61bc07d --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.ui.d.ts @@ -0,0 +1,1667 @@ +declare class NU { + /** + * Create an object instance of Alert with the N() function. + * ``` + * var alert = N(context).alert(opts|msg); + * var alert = N(context).alert(opts|msg, vars); + * ``` + * + * @param {NU.Options.Alert | string} msg - Specifies an initialization option object for the component or a string representing the contents of the warning message. + * @param {string[]} [vars] - This is an array of strings to replace the message variable with. + * @returns {NU.Alert} An instance of an Alert object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040103.html + */ + alert(this: NJS, msg: NU.Options.Alert | string, vars?: string[]): NU.Alert; + /** + * Creates an object instance of Button with the N() function. + * ``` + * var button = N(context).button(opts); + * ``` + * + * @param {NU.Options.Button} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Button} An instance of a Button object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040203.html + */ + button(this: NJS, opts?: NU.Options.Button): NU.Button; + /** + * Creates an object instance of Datepicker with the N() function. + * ``` + * var datepicker = N(context).datepicker(opts); + * ``` + * + * @param {NU.Options.Datepicker} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Datepicker} An instance of a Datepicker object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040303.html + */ + datepicker(this: NJS, opts?: NU.Options.Datepicker): NU.Datepicker; + /** + * Creates an object instance of Popup with the N() function. + * ``` + * var popup = N(context).popup(opts); + * ``` + * + * @param {NU.Options.Popup} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Popup} An instance of a Popup object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040403.html + */ + popup(this: NJS, opts?: NU.Options.Popup): NU.Popup; + /** + * Creates an object instance of Tab with the N() function. + * ``` + * var tab = N(context).tab(opts); + * ``` + * + * @param {NU.Options.Tab} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Tab} An instance of a Tab object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040503.html + */ + tab(this: NJS, opts?: NU.Options.Tab): NU.Tab; + /** + * Creates a new Select instance. + * ``` + * var select = N(data).select(opts|context); + * ``` + * + * @param {NU.Options.Select | NJS | NC.JSONObject[], + opts?: NU.Options.Select | Omit, keyof NJS>, + ): NU.Select; + /** + * Creates a new Form instance. + * ``` + * var form = N(data).form(opts|context); + * ``` + * + * @param {NU.Options.Form | NJS | NC.JSONObject[], + opts?: NU.Options.Form | Omit, keyof NJS>, + ): NU.Form; + /** + * Creates a new List instance. + * ``` + * var list = N(data).list(opts|context); + * ``` + * + * @param {NU.Options.List | NJS | NC.JSONObject[], + opts?: NU.Options.List | Omit, keyof NJS>, + ): NU.List; + /** + * Creates a new Grid instance. + * ``` + * var grid = N(data).grid(opts|context); + * ``` + * + * @param {NU.Options.Grid | NJS | NC.JSONObject[], + opts?: NU.Options.Grid | Omit, keyof NJS>, + ): NU.Grid; + /** + * Creates a new Pagination instance. + * ``` + * var pagination = N(data).pagination(opts|context); + * ``` + * + * @param {NU.Options.Pagination | NJS | NC.JSONObject[], + opts: NU.Options.Pagination | Omit, keyof NJS>, + ): NU.Pagination; + /** + * Creates a new Tree instance. + * ``` + * var tree = N(data).tree(opts|context); + * ``` + * + * @param {NU.Options.Tree | NJS | NC.JSONObject[], + opts: NU.Options.Tree | Omit, keyof NJS>, + ): NU.Tree; + + static ui: { + iteration: { + render: (i: any, limit: any, delay: any, lastIdx: any, callType: any) => void; + select: (compNm: any) => void; + checkAll: (compNm: any) => void; + checkSingle: (compNm: any) => void; + move: (fromRow: any, toRow: any, compNm: any) => any; + copy: (fromRow: any, toRow: any, compNm: any) => any; + }; + draggable: { + events: (eventNameSpace: any, startHandler: any, moveHandler: any, endHandler: any) => void; + moveX: (x: any, min: any, max: any) => boolean; + moveY: (y: any, min: any, max: any) => boolean; + }; + scroll: { + paging: (contextWrapEle: any, defSPSize: any, rowEleLength: any, rowTagName: any, bindOpt: any) => void; + }; + utils: { + wrapHandler: (opts: any, compNm: any, eventNm: any) => void; + isTextInput: (tagName: any, type: any) => boolean; + }; + }; + + static alert: { + /** + * Creates an object instance of Alert. + * ``` + * var alert = new N.alert(context, opts|msg); + * var alert = new N.alert(context, opts|msg, vars); + * ``` + * + * @param {NJS} obj - Specifies the element on which Alert's modal overlay will be displayed. + * @param {NU.Options.Alert | string} msg - Either an initialization option object that defines how the alert should behave, or a string representing the alert message content. + * @param {string[]} [vars] - This is an array of strings to replace the message variable with. + * @returns {NU.Alert} An instance of an Alert object, configured according to the provided parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040103.html + */ + new(obj: NJS, msg: NU.Options.Alert | string, vars?: string[]): NU.Alert; + wrapEle(): void; + resetOffSetEle(opts: NU.Options.Alert): void; + wrapInputEle(): void; + }; + + static button: { + /** + * Creates an object instance of Button. + * ``` + * var button = new N.button(context, opts); + * ``` + * + * @param {NJS} obj - Specifies the context element to which the Button will be applied. + * @param {NU.Options.Button} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Button} An instance of a Button object, configured according to the provided parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040203.html + */ + new(obj: NJS, opts?: NU.Options.Button): NU.Button; + wrapEle(): void; + }; + + static datepicker: { + /** + * Creates an object instance of Datepicker. + * ``` + * var datepicker = new N.datepicker(context, opts); + * ``` + * + * @param {NJS} obj - Specifies the context element to which the Datepicker will be applied. + * @param {NU.Options.Datepicker} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Datepicker} An instance of a Datepicker object, configured according to the provided parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040303.html + */ + new(obj: NJS, opts?: NU.Options.Datepicker): NU.Datepicker; + checkMinMaxDate(): boolean; + wrapEle(): void; + createContents(): any; + yearPaging(yearItems: NJS, currYear: number | string, addCnt: number, absolute?: boolean): void; + selectItems( + opts: NU.Options.Datepicker, + value: string, + format: string, + yearsPanel: NJS, + monthsPanel: NJS, + daysPanel: NJS, + ): void; + }; + + static popup: { + /** + * Creates an object instance of Popup. + * ``` + * var popup = new N.popup(context, opts); + * ``` + * + * @param {NJS} obj - Specifies the context element to which the Popup will be applied. + * @param {NU.Options.Popup} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Popup} An instance of a Popup object, configured according to the provided parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040403.html + */ + new(obj: NJS, opts?: NU.Options.Popup): NU.Popup; + wrapEle(): void; + loadContent(callback: NU.Callbacks.Popup.LoadContent): void; + popOpen(onOpenData: any, cont: NA.Objects.Controller.Object): void; + }; + + static tab: { + /** + * Creates an object instance of Tab. + * ``` + * var tab = new N.tab(context, opts); + * ``` + * + * @param {NJS} obj - Specifies the context element to which the Tab will be applied. + * @param {NU.Options.Tab} [opts] - Specifies the initialization option object for the component. + * @returns {NU.Tab} An instance of a Tab object, configured according to the provided parameters. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040503.html + */ + new(obj: NJS, opts?: NU.Options.Tab): NU.Tab; + wrapEle(): void; + wrapScroll(): void; + loadContent(url: string, targetIdx: number, callback: NU.Callbacks.Tab.LoadContent, isFirst: boolean): void; + }; + + static select: { + /** + * Creates a new Select instance. + * ``` + * var select = new N.select(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.Select | NJS | NC.JSONObject[], + opts?: NU.Options.Select | Omit, keyof NJS>, + ): NU.Select; + wrapEle(): void; + }; + + static form: { + /** + * Creates a new Form instance. + * ``` + * var form = new N.form(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.Form | NJS | NC.JSONObject[], + opts?: NU.Options.Form | Omit, keyof NJS>, + ): NU.Form; + }; + + static list: { + /** + * Creates a new List instance. + * ``` + * var list = new N.list(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.List | NJS | NC.JSONObject[], + opts?: NU.Options.List | Omit, keyof NJS>, + ): NU.List; + createScroll(): void; + vResize(contextWrapEle: NJS): void; + }; + + static grid: { + /** + * Creates a new Grid instance. + * ``` + * var grid = new N.grid(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.Grid | NJS | NC.JSONObject[], + opts?: NU.Options.Grid | Omit, keyof NJS>, + ): NU.Grid; + tableCells(tbl: any, opt_cellValueGetter: any): any[][]; + tableMap(): NU.Objects.Grid.TableMap; + setTheadCellInfo(): void; + removeColgroup(): void; + fixColumn(): void; + fixHeader(): void; + vResize(gridWrap: NJS, contextWrapEle: NJS, tfootWrap: NJS): void; + more(): void; + resize(): void; + sort(): void; + dataFilter(): void; + rowSpan( + i: number, + rowEle: NJS, + bfRowEle: NJS, + rowData: NC.JSONObject, + bfRowData: NC.JSONObject, + colId: string, + ): void; + paste(): void; + }; + + static pagination: { + /** + * Creates a new Pagination instance. + * ``` + * var pagination = new N.pagination(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.Pagination | NJS | NC.JSONObject[], + opts?: NU.Options.Pagination | Omit, keyof NJS>, + ): NU.Pagination; + wrapEle: NU.Objects.Pagination.LinkEles; + changePageSet( + linkEles: NU.Objects.Pagination.LinkEles, + opts: NU.Options.Pagination, + isRemake: boolean, + ): NU.Options.CurrPageNavInfo; + }; + + static tree: { + /** + * Creates a new Tree instance. + * ``` + * var tree = new N.tree(data, opts|context); + * ``` + * + * @param {NJS | NC.JSONObject[]} data - Specifies data to bind to the component. + * @param {NU.Options.Tree | NJS | NC.JSONObject[], + opts?: NU.Options.Tree | Omit, keyof NJS>, + ): NU.Tree; + }; +} + +declare namespace NU { + interface Alert { + options: NU.Options.Alert; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040105.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Shows a message dialog box. + * + * @return {NU.Alert} Returns the `Alert` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040105.html + */ + show(): NU.Alert; + /** + * Hides the message dialog box. + * + * @return {NU.Alert} Returns the `Alert` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040105.html + */ + hide(): NU.Alert; + /** + * Removes all elements related to Alert. + * + * @return {NU.Alert} Returns the `Alert` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040105.html + */ + remove(): NU.Alert; + } + + interface Button { + options: NU.Options.Button; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040206.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Disable the button. + * + * @return {NU.Button} Returns the `Button` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040206.html + */ + disable(): NU.Button; + /** + * Enable the button. + * + * @return {NU.Button} Returns the `Button` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040206.html + */ + enable(): NU.Button; + } + + interface Datepicker { + options: NU.Options.Datepicker; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040306.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Shows the Datepicker. + * + * @return {NU.Datepicker} Returns the `Datepicker` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040306.html + */ + show(): NU.Datepicker; + /** + * Hides the Datepicker. + * + * @return {NU.Datepicker} Returns the `Datepicker` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040306.html + */ + hide(): NU.Datepicker; + } + + interface Popup { + options: NU.Options.Popup; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040405.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Opens the Popup. + * + * @param {any} [onOpenData] - Optional data to be processed or used when the popup is opened. + * > Pass onOpenData as the first argument to the onOpen function specified by the onOpen event option. + * @return {NU.Popup} Returns the `Popup` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040405.html + */ + open(onOpenData?: any): NU.Popup; + /** + * Close the Popup. + * + * @param {any} [onCloseData] - Optional data to be processed or used when the popup is closed. + * > Pass onCloseData as the first argument to the onClose function specified by the onClose event option. + * @return {NU.Popup} Returns the `Popup` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040405.html + */ + close(onCloseData?: any): NU.Popup; + /** + * Removes all elements related to Popup. + * + * @return {NU.Popup} Returns the `Popup` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040405.html + */ + remove(): NU.Popup; + } + + interface Tab { + options: NU.Options.Tab; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Opens the specified tab. + * + * @param {number} idx - The index of the tab to open. + * @param {any} [onOpenData] - Optional data to be processed or used when the tab is opened. + * > Pass onOpenData as the first argument to the onOpen function specified by the onOpen event option. + * @param {boolean} [isFirst] - This is an option used inside a component that is set to true when a tab is instantiated and the default active tab is automatically selected. + * @return {NU.Tab} - Returns the `Tab` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + open(idx: number, onOpenData?: any, isFirst?: boolean): NU.Tab; + /** + * Opens the specified tab. + * + * @param {number} [idx] - The index of the tab to open. If no arguments are specified, a status information object is returned. + * @param {any} [onOpenData] - Optional data to be processed or used when the tab is opened. + * > Pass onOpenData as the first argument to the onOpen function specified by the onOpen event option. + * @param {boolean} [isFirst] - This is an option used inside a component that is set to true when a tab is instantiated and the default active tab is automatically selected. + * @return {Object} If all arguments are not entered, the following tab status information is returned in object type. + * @return {number} return.index - Index of the activated tab. + * @return {NJS} return.tab - Activated tab navigation element. + * @return {NJS} return.content - Activated tab content element. + * @return {NA.Objects.Controller.Object} return.cont - Controller object of the activated tab content. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + open(idx?: number, onOpenData?: any, isFirst?: boolean): { + index: number; + tab: NJS; + content: NJS; + cont: NA.Objects.Controller.Object; + }; + /** + * Disables the specified tab. + * + * @param {number} idx - The index of the tab to disable. + * @return {NU.Tab} Returns the `Tab` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + disable(idx: number): NU.Tab; + /** + * Enables the specified tab. + * + * @param {number} idx - The index of the tab to be enabled. + * @return {NU.Tab} Returns the `Tab` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + enable(idx: number): NU.Tab; + /** + * Returns the Controller object of the tab content. + * > If the tab content is created internally or the preload option is false, undefined is returned because there is no Controller object. + * + * @param {number} [idx] - Enter the tab index where the controller object you want to look up is located. If no index is provided, the method returns the controller object that is active. + * @return {NA.Objects.Controller.Object} The controller object corresponding to the specified index. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040506.html + */ + cont(idx?: number): NA.Objects.Controller.Object; + } + + interface Select { + options: NU.Options.Select; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - true: Extracts only the currently selected row data and returns it as `JSONObject[]` type. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + data(selFlag: true): NC.JSONObject[]; + /** + * Returns the latest data bound to the component. + * + * @param {false} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - true: Extracts only the currently selected row data and returns it as `JSONObject[]` type. + * - false: Returns data of the original type of type `NJS` bound to the component. + * @return {NJS} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + data(): NC.JSONObject[]; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Binds data to the element specified by the context option. + * > If the context element is a checkbox and is checked, the elements created when data is bound are also created in a checked state. + * + * > When data is bound to a radio or checkbox input element, the element set as context has an id attribute and a name attribute, and only the name attribute is added to the additionally created option element. + * When binding an event to a created checkbox or radio, if you select an element with the id selector, the event is applied only to the first option element, so select the element with the name attribute. + * ``` + * $("input[name='name']").on("click", function(e) { ... }); + * ``` + * + * @param {NJS} [data] - Specifies the data to bind. + * @return {NU.Select} Returns the `Select` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + bind(data?: NJS | NC.JSONObject[]): NU.Select; + /** + * Returns the index of the selected option. + * + * @return {number} Index of selected option + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + index(): number; + /** + * Select the option corresponding to the specified index. + * + * @param {number} idx - Index of the option to select + * @return {NU.Select} Returns the `Select` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + index(idx: number): NU.Select; + /** + * Returns the value of the selected option. + * + * @return {NC.Primitive | NC.Primitive[]} Selected option value. + */ + val(): NC.Primitive | NC.Primitive[]; + /** + * Select the option corresponding to the specified value. + * + * @param {NC.Primitive | NC.Primitive[]} [val] - Option value to select. + * @return {NU.Select} Returns the `Select` instance for chaining. + */ + val(val?: NC.Primitive | NC.Primitive[]): NU.Select; + /** + * Removes option elements and row data objects equal to the value specified by the val argument.. + * + * @param {NC.Primitive} val - + * @return {NU.Select} Returns the `Select` instance for chaining. + */ + remove(val: NC.Primitive): NU.Select; + /** + * Reset selection. + * + * @param {boolean} [selFlag] - For select elements, setting it to true will select nothing and setting it to false will select the default (first) option element. + * @return {NU.Select} - Returns the `Select` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040605.html + */ + reset(selFlag?: boolean): NU.Select; + } + + interface Form { + options: NU.Options.Form; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - true: Extracts only the currently selected row data and returns it as `JSONObject[]` type. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * @param {...string} cols - If you specify the property name of the data as an argument from the second argument to the nth argument of the data method, an object from which only the specified property value is extracted is returned. + * ``` + * var formInst = N([]).form(".context") + * .bind(0, [{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }]); + * formInst.data(true, "col01", "col02", "col03"); + * // [{ col01: "", col02: "", col03: "" }] + * ``` + * > This only works if you specify the first argument as true. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + data(selFlag: true, ...cols: string[]): NC.JSONObject[]; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - true: Extracts only the currently selected row data and returns it as `JSONObject[]` type. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + data(): NC.JSONObject[]; + /** + * Returns the index of the data bound to the Form from the bound data array. + * + * @param {string} [before] - If "before" is specified, the index of the data bound just before is returned. + * @return {number} Row index. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + row(before?: "before"): number; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + context(sel?: JQuery.Selector): NJS; + bindEvents: { + validate(ele: NJS, opts: NU.Options.Form, eleType: string, isTextInput: boolean): void; + dataSync(ele: NJS, opts: NU.Options.Form, vals: NC.JSONObject, eleType: string): void; + enterKey(ele: NJS, opts: NU.Options.Form): void; + format(ele: NJS, opts: NU.Options.Form, eleType: string, key: string): void; + }; + /** + * Binds data to elements that have an id attribute value within the element specified by the context option. + * + * > If you change only the data and bind it again, N.form may not work properly. + * When rebinding to a context element that has data bound to it, you must first run the unbind method and then run the bind method. + * + * @param {number} row - Specifies the row index of the data array to bind. + * @param {NJS} [data] - Specifies the data to bind. + * @param {...string} [cols] - If you specify the property name of the data from the third to the nth argument of the bind method, only the elements whose property name and id attribute value match will be bound to the data. + * ``` + * // Data to bind + * var data = [{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }] + * // Binds only to elements that have the id attribute values “col01”, “col02”, and “col03”. + * formInstance.bind(0, data, "col01", "col02", "col03"); + * ``` + * ``` + * // After directly modifying the bound data, bind only to elements that have the id attribute values “col01”, “col02”, and “col03”. + * var data = formInstance.data()[formInstance.row()] + * data.col01 = "val"; + * data.col02 = "123"; + * data.col03 = "temp"; + * formInstance.bind(0, data, "col01", "col02", "col03"); + * ``` + * @return {NU.Form} Returns the `Form` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + bind(row: number, data?: NJS | NC.JSONObject[], ...cols: string[]): NU.Form; + /** + * Add new row data. + * + * When creating row data, a data object is created with the id attribute name and value of the input elements in the context element. + * + * @param {number | NC.JSONObject} [data] - If you specify a data object, the generated data and the specified data are merged and bound. + * > If the data argument is of type number, it is specified as the row(args[1]) argument. + * @param {number} [row] - If you specify the row index where new data will be added as the row argument, the row data will be added immediately before the specified row index. + * @return {NU.Form} Returns the `Form` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + add(data?: number | NC.JSONObject, row?: number): NU.Form; + /** + * Removes the data object bound to the Form from the data array. + * > If rowStatus is `insert`, remove the row data, otherwise change rowStatus to "delete". + * + * @return {NU.Form} Returns the `Form` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + remove(): NU.Form; + /** + * Reverts to the state where the initial data was bound or the initial data state created when adding. + * + * @return {NU.Form} Returns the `Form` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + revert(): NU.Form; + /** + * Returns validation results for all added/modified data. + * + * @return {boolean} Returns true if validation is successful, false if validation fails, and displays a failure message in a tooltip next to the corresponding input element. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040706.html + */ + validate(): boolean; + /** + * Retrieves the property value of the data object bound to the component. + * + * @param {string} key - Property name of data object. + * @return {NC.Primitive | NC.Primitive[]} The value specified by the key argument. + */ + val(key: string): NC.Primitive | NC.Primitive[]; + /** + * Updates or adds property values of the data object bound to the component. + * + * @param {string} key - Property name of data object + * @param {NC.Primitive | NC.Primitive[]} [val] - Property value of data object + * @param {boolean} [notify] - If set to false, data change notification will not be displayed to components referencing the same data. + * @return {NU.Form} Returns the `Form` instance for chaining. + */ + val(key: string, val: NC.Primitive | NC.Primitive[], notify?: boolean): NU.Form; + /** + * Processes real-time data synchronization logic for two-way data binding between data components. + * + * @param {number} row - The index of the row to be updated. + * @param {string} [key] - This is the column name of the row data to be updated. + * @return {NU.Form} Returns the `Form` instance for chaining. + */ + update(row: number, key?: string): NU.Form; + } + + interface List { + options: NU.Options.List; + /** + * The default row(li) element of a list. Create row elements by duplicating this element. + */ + tempRowEle: NJS; + /** + * This is an element specified by the context option of the list component. An instance of the original context element is assigned to the processed element. + */ + contextEle: NJS; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - modified: Returns inserted, updated and deleted data as `JSONObject[]` type. + * - selected: When the select option or multiselect option is set, the selected data is returned as `JSONObject[]` type. + * - checked: When the checkAll option, checkAllTarget option, or checkOnlyTarget option is set, the checked data is returned as `JSONObject[]` type. + * - insert: Returns the inserted data as `JSONObject[]` type. + * - update: Returns the inserted data as `JSONObject[]` type. + * - delete: Returns the inserted data as `JSONObject[]` type. + * @param {...string} cols - If you specify the property name of the data as an argument from the second argument to the nth argument of the data method, an object from which only the specified property value is extracted is returned. + * ``` + * var listInst = N([]).list(".context") + * .bind([{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }]); + * listInst.data("modified", "col01", "col02", "col03"); + * // [{ col01: "", col02: "", col03: "" }] + * ``` + * > This only works if the first argument is "modified", "selected", "checked", "insert", "update", or "delete". + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + data( + selFlag: "modified" | "selected" | "checked" | "insert" | "update" | "delete", + ...cols: string[] + ): NC.JSONObject[]; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - modified: Returns inserted, updated and deleted data as `JSONObject[]` type. + * - selected: When the select option or multiselect option is set, the selected data is returned as `JSONObject[]` type. + * - checked: When the checkAll option, checkAllTarget option, or checkOnlyTarget option is set, the checked data is returned as `JSONObject[]` type. + * - insert: Returns the inserted data as `JSONObject[]` type. + * - update: Returns the inserted data as `JSONObject[]` type. + * - delete: Returns the inserted data as `JSONObject[]` type. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + data(): NC.JSONObject[]; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Returns the row element (li) of the element specified by the context option. + * + * If you modify the returned element and then run the bind function, rows will be created with the modified element. + * + * The contextBodyTemplate function allows you to modify row elements of N.list even after N.list has been initialized. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The default tbody element of a table element or the element selected in the default tbody element of a table element is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + contextBodyTemplate(sel?: JQuery.Selector): NJS; + /** + * Returns the index of the selected row. + * > To use the select method, the `select` or `multiselect` option must be set to true. + * + * @return {NJS} Index of selected row + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + select(): number[]; + /** + * Select a row. + * > To use the select method, the `select` or `multiselect` option must be set to true. + * + * @param {number | number[]} row + * - number: Specifies the row index to select. + * - number[]: When selecting multiple items at once, specify the row index as an array. + * @param {boolean} [isAppend] - If you do not enter it or enter false, all selected rows will be deselected and then selected again. If you enter true, the existing selected rows will be maintained and selected. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + select(row: number | number[], isAppend?: boolean): NU.List; + /** + * Returns the index of the row where the checkbox elements specified by the `checkAllTarget` and `checkSingleTarget` options are checked. + * + * @return {NJS} Index of checked row + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + check(): NJS; + /** + * Checks the checkbox elements specified with the checkAllTarget` and `checkSingleTarget` options. + * + * @param {number | number[]} row + * - number: Specifies the row index to check. + * - number[]: When checking multiple items at once, specify the row index as an array. + * @param {boolean} [isAppend] - If you do not enter it or enter false, all checked rows will be dechecked and then checked again. If you enter true, the existing checked rows will be maintained and checked. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + check(row: number | number[], isAppend?: boolean): NU.List; + /** + * Binds data to elements with an id attribute value within the element specified by the context option and creates row elements equal to the length of data. + * + * @param {NJS} [data] - Specifies the data to bind. + * @param {"append" | "list.bind" | "list.update"} [callType] + * - append: Merges previously bound data and newly bound data and adds new row elements to previously created row elements. + * - list.bind: This is an option for processing status inside a component. Set opts.scrollPaging.idx to 0. + * - list.update: This is an option for processing status inside a component. This is a flag to branch the logic processed when called from the logic for two-way data binding(update function). + * > When the "append" argument value is set, the scrollPaging.size option value is automatically set to 0, disabling the scroll paging feature. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + bind(data?: NJS | NC.JSONObject[], callType?: "append" | "list.bind" | "list.update"): NU.List; + /** + * Add new row elements and data. + * + * When creating row data, a data object is created with the id attribute name and value of the input elements in the context element. + * + * @param {number | NC.JSONObject} [data] - If you specify a data object, the generated data and the specified data are merged and bound. + * > If the data argument is of type number, it is specified as the row(args[1]) argument. + * @param {number} [row] - If you specify the row index where new data will be added as the row argument, the row data will be added immediately before the specified row index. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + add(data?: number | NC.JSONObject, row?: number): NU.List; + /** + * Removes the data object bound to the Form from the data array. + * > If rowStatus is `insert`, remove the row data, otherwise change rowStatus to "delete". + * + * @param {number} [row] - Specifies the index of the row to remove. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + remove(row: number): NU.List; + /** + * Reverts to the state where the initial data was bound or the initial data state created when adding. + * + * @param {number} [row] - Specifies the index of the row to remove. If not specified, reverts the entire row data. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + revert(row?: number): NU.List; + /** + * Returns validation results for all added/modified data. + * + * @param {number} [row] - Specifies the index of the row to validation. If not specified, validates the entire row data. + * @return {boolean} Returns true if validation is successful, false if validation fails, and displays a failure message in a tooltip next to the corresponding input element. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + validate(row?: number): boolean; + /** + * Retrieves the property value of the data object bound to the component. + * + * @param {number} row - The row index from which the value is to be retrieved. + * @param {string} key - Property name of data object. + * @return {NC.Primitive | NC.Primitive[]} The value specified by the key argument. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + val(row: number, key: string): NC.Primitive | NC.Primitive[]; + /** + * Updates or adds property values of the data object bound to the component. + * + * @param {number} row - The index of the row where the value is to be modified. + * @param {string} key - Property name of data object + * @param {NC.Primitive | NC.Primitive[]} [val] - Property value of data object + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + val(row: number, key: string, val: NC.Primitive | NC.Primitive[]): NU.List; + /** + * Move element and row data from one location to another within a list. + * + * @param {number} fromRow - The index of the item to move from. + * @param {number} toRow - The index of the new position for the item. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + move(fromRow: number, toRow: number): NU.List; + /** + * Copy element and row data from one location to another within a list. + * + * @param {number} fromRow - The index of the item to copy from. + * @param {number} toRow - The index of the new position for the item. + * @return {NU.List} Returns the `List` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + copy(fromRow: number, toRow: number): NU.List; + /** + * Processes real-time data synchronization logic for two-way data binding between data components. + * + * @param {number} row - The index of the row to be updated. + * @param {string} [key] - This is the column name of the row data to be updated. + * @return {NU.Form} Returns the `Form` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040806.html + */ + update(row: number, key?: string): NU.List; + } + + interface Grid { + options: NU.Options.Grid; + /** + * The default row(tbody) element of a grid. Create row elements by duplicating this element. + */ + tempRowEle: NJS; + /** + * It is a structured collection of elements that make up a table. + */ + tableMap: NU.Objects.Grid.TableMap; + /** + * These are thead elements of the table. + */ + thead: NJS; + /** + * This is an element specified by the context option of the list component. An instance of the original context element is assigned to the processed element. + */ + contextEle: NJS; + /** + * A collection of id values for elements for which the rowSpan property is defined. + */ + rowSpanIds: NJS; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - modified: Returns inserted, updated and deleted data as `JSONObject[]` type. + * - selected: When the select option or multiselect option is set, the selected data is returned as `JSONObject[]` type. + * - checked: When the checkAll option, checkAllTarget option, or checkOnlyTarget option is set, the checked data is returned as `JSONObject[]` type. + * - insert: Returns the inserted data as `JSONObject[]` type. + * - update: Returns the inserted data as `JSONObject[]` type. + * - delete: Returns the inserted data as `JSONObject[]` type. + * @param {...string} cols - If you specify the property name of the data as an argument from the second argument to the nth argument of the data method, an object from which only the specified property value is extracted is returned. + * ``` + * var gridInst = N([]).grid(".context") + * .bind([{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }]); + * gridInst.data("modified", "col01", "col02", "col03"); + * // [{ col01: "", col02: "", col03: "" }] + * ``` + * > This only works if the first argument is "modified", "selected", "checked", "insert", "update", or "delete". + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + data( + selFlag: "modified" | "selected" | "checked" | "insert" | "update" | "delete", + ...cols: string[] + ): NC.JSONObject[]; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - modified: Returns inserted, updated and deleted data as `JSONObject[]` type. + * - selected: When the select option or multiselect option is set, the selected data is returned as `JSONObject[]` type. + * - checked: When the checkAll option, checkAllTarget option, or checkOnlyTarget option is set, the checked data is returned as `JSONObject[]` type. + * - insert: Returns the inserted data as `JSONObject[]` type. + * - update: Returns the inserted data as `JSONObject[]` type. + * - delete: Returns the inserted data as `JSONObject[]` type. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + data(): NC.JSONObject[]; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Returns the thead element of the table. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The table's thead element or the element selected in the table's thead is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + contextHead(sel?: JQuery.Selector): NJS; + /** + * Returns the row element (tbody) of the element specified by the context option. + * + * If you modify the returned element and then run the bind function, rows will be created with the modified element. + * + * The contextBodyTemplate function allows you to modify row elements in N.grid even after N.grid has been initialized. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The default tbody element of a table element or the element selected in the default tbody element of a table element is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + contextBodyTemplate(sel?: JQuery.Selector): NJS; + /** + * Returns the index of the selected row. + * > To use the select method, the `select` or `multiselect` option must be set to true. + * + * @return {NJS} Index of selected row + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + select(): number[]; + /** + * Select a row. + * > To use the select method, the `select` or `multiselect` option must be set to true. + * + * @param {number | number[]} row + * - number: Specifies the row index to select. + * - number[]: When selecting multiple items at once, specify the row index as an array. + * @param {boolean} [isAppend] - If you do not enter it or enter false, all selected rows will be deselected and then selected again. If you enter true, the existing selected rows will be maintained and selected. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + select(row: number | number[], isAppend?: boolean): NU.Grid; + /** + * Returns the index of the row where the checkbox elements specified by the `checkAllTarget` and `checkSingleTarget` options are checked. + * + * @return {NJS} Index of checked row + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + check(): NJS; + /** + * Checks the checkbox elements specified with the checkAllTarget` and `checkSingleTarget` options. + * + * @param {number | number[]} row + * - number: Specifies the row index to check. + * - number[]: When checking multiple items at once, specify the row index as an array. + * @param {boolean} [isAppend] - If you do not enter it or enter false, all checked rows will be dechecked and then checked again. If you enter true, the existing checked rows will be maintained and checked. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + check(row: number | number[], isAppend?: boolean): NU.Grid; + /** + * Binds data to elements with an id attribute value within the element specified by the context option and creates row elements equal to the length of data. + * + * @param {NJS} [data] - Specifies the data to bind. + * @param {"append" | "grid.bind" | "grid.update"} [callType] + * - append: Merges previously bound data and newly bound data and adds new row elements to previously created row elements. + * - grid.bind: This is an option for processing status inside a component. Set opts.scrollPaging.idx to 0. + * - grid.dataFilter: This is an option for processing status inside a component. This is a flag to branch the logic processed when called from the logic for the grid data filter function. + * - grid.sort: This is an option for processing status inside a component. This is a flag to branch the logic processed when called from the logic for the grid data sort function. + * - grid.update: This is an option for processing status inside a component. This is a flag to branch the logic processed when called from the logic for two-way data binding(update function). + * > When the "append" argument value is set, the scrollPaging.size option value is automatically set to 0, disabling the scroll paging feature. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + bind( + data?: NJS | NC.JSONObject[], + callType?: "append" | "grid.bind" | "grid.dataFilter" | "grid.sort" | "grid.update", + ): NU.Grid; + /** + * Add new row elements and data. + * + * When creating row data, a data object is created with the id attribute name and value of the input elements in the context element. + * + * @param {number | NC.JSONObject} [data] - If you specify a data object, the generated data and the specified data are merged and bound. + * > If the data argument is of type number, it is specified as the row(args[1]) argument. + * @param {number} [row] - If you specify the row index where new data will be added as the row argument, the row data will be added immediately before the specified row index. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + add(data?: number | NC.JSONObject, row?: number): NU.Grid; + /** + * Removes the data object bound to the Form from the data array. + * > If rowStatus is `insert`, remove the row data, otherwise change rowStatus to "delete". + * + * @param {number} [row] - Specifies the index of the row to remove. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + remove(row: number): NU.Grid; + /** + * Reverts to the state where the initial data was bound or the initial data state created when adding. + * + * @param {number} [row] - Specifies the index of the row to remove. If not specified, reverts the entire row data. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + revert(row?: number): NU.Grid; + /** + * Returns validation results for all added/modified data. + * + * @param {number} [row] - Specifies the index of the row to validation. If not specified, validates the entire row data. + * @return {boolean} Returns true if validation is successful, false if validation fails, and displays a failure message in a tooltip next to the corresponding input element. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + validate(row?: number): boolean; + /** + * Retrieves the property value of the data object bound to the component. + * + * @param {number} row - The row index from which the value is to be retrieved. + * @param {string} key - Property name of data object. + * @return {NC.Primitive | NC.Primitive[]} The value specified by the key argument. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + val(row: number, key: string): NC.Primitive | NC.Primitive[]; + /** + * Updates or adds property values of the data object bound to the component. + * + * @param {number} row - The index of the row where the value is to be modified. + * @param {string} key - Property name of data object + * @param {NC.Primitive | NC.Primitive[]} [val] - Property value of data object + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + val(row: number, key: string, val: NC.Primitive | NC.Primitive[]): NU.Grid; + /** + * Move element and row data from one location to another within a list. + * + * @param {number} fromRow - The index of the item to move from. + * @param {number} toRow - The index of the new position for the item. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + move(fromRow: number, toRow: number): NU.Grid; + /** + * Copy element and row data from one location to another within a list. + * + * @param {number} fromRow - The index of the item to copy from. + * @param {number} toRow - The index of the new position for the item. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + copy(fromRow: number, toRow: number): NU.Grid; + /** + * Shows hidden columns again. + * + * @param {number} colIdxs - The indices of the columns to be shown. + * @return {NU.Grid} - Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + show(colIdxs: number): NU.Grid; + /** + * Hides the selected column. + * + * @param {number} colIdxs - The index of the column to be hidden. + * @return {NU.Grid} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + hide(colIdxs: number): NU.Grid; + /** + * Processes real-time data synchronization logic for two-way data binding between data components. + * + * @param {number} row - The index of the row to be updated. + * @param {string} [key] - This is the column name of the row data to be updated. + * @return {NU.Form} Returns the `Grid` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040906.html + */ + update(row: number, key?: string): NU.Grid; + } + + interface Pagination { + options: NU.Options.Pagination; + linkEles: NU.Objects.Pagination.LinkEles; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041006.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041006.html + */ + data(): NC.JSONObject[]; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Creates a Pagination element by binding data to the element specified with the context option. + * + * @param {NJS | number} [data] - Specify data to bind or set totalCount. + * If the argument type is number, it is set to totalCount, and if the argument type is array type, it is set to data. + * @param {number} [totalCount] - Enter the total number of rows of data for pagination. + * @return {NU.Pagination} Returns the `Pagination` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + bind(data?: NJS | NC.JSONObject[] | number, totalCount?: number): NU.Pagination; + /** + * Gets the Total count value. + * + * @return {number} Total count of data to be displayed by pagination. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + totalCount(): number; + /** + * Specifies the Total count value. + * > Since only the option value of N.pagination is changed, the bind method must be executed after executing this function for the changed value to be displayed in pagination. + * + * @param {number} totalCount - Total count of data to be displayed by pagination. + * @return {NU.Pagination} Returns the `Pagination` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + totalCount(totalCount: number): NU.Pagination; + /** + * Gets the currently selected page number. + * + * @return {number} Tpage number. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + pageNo(): number; + /** + * Sets the specified page number. + * > Since only the option value of N.pagination is changed, the bind method must be executed after executing this function for the changed value to be displayed in pagination. + * + * @param {number} pageNo - page number. + * @return {NU.Pagination} Returns the `Pagination` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + pageNo(pageNo: number): NU.Pagination; + /** + * Gets the count per page value. + * + * @return {number} Count per page. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + countPerPage(): number; + /** + * Sets the specified count per page value. + * > Since only the option value of N.pagination is changed, the bind method must be executed after executing this function for the changed value to be displayed in pagination. + * + * @param {number} countPerPage - Count per page. + * @return {NU.Pagination} Returns the `Pagination` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + countPerPage(countPerPage: number): NU.Pagination; + /** + * Gets the value of the count per page set. + * + * @return {number} Count per page set. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + countPerPageSet(): number; + /** + * Sets the specified count per page set. + * > Since only the option value of N.pagination is changed, the bind method must be executed after executing this function for the changed value to be displayed in pagination. + * + * @param {number} countPerPageSet - count per page set. + * @return {NU.Pagination} Returns the `Pagination` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041005.html + */ + countPerPageSet(countPerPageSet: number): NU.Pagination; + /** + * Returns a paging information object. + * + * @return {NU.Options.CurrPageNavInfo} currPageNavInfo object information. + * - pageNo: Current page number. + * - countPerPage: Row count per page. + * - countPerPageSet: Page count per page set. + * - currSelPageSet: Current page set number. + * - pageCount: Total page count. + * - pageSetCount: Total page set count. + * - totalCount: Total row count. + * - startPage: First page number in the current page set. + * - startRowIndex: First row index on the selected page. + * - startRowNum: First row number of the selected page. + * - endPage: Last page number in the current page set. + * - endRowIndex: Last row index on the selected page. + * - endRowNum: Last row number of the selected page. + */ + currPageNavInfo(): NU.Options.CurrPageNavInfo; + } + + interface Tree { + options: NU.Options.Tree; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - selected: Returns the data of the selected node as `JSONObject[]` type. + * - checked: Returns the data of the checked node as `JSONObject[]` type. + * - checkedInLastNode: Returns the data of the last node of all checked elements in `JSONObject[]` type. + * @param {...string} cols - If you specify the property name of the data as an argument from the second argument to the nth argument of the data method, an object from which only the specified property value is extracted is returned. + * ``` + * var treeInst = N([]).tree(".context") + * .bind([{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }]); + * treeInst.data("checked", "col01", "col02", "col03"); + * // [{ col01: "", col02: "", col03: "" }] + * ``` + * > This only works if the first argument is "selected", "selected", "checked", or "checkedInLastNode". + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041106.html + */ + data(selFlag: "selected" | "checked" | "checkedInLastNode", ...cols: string[]): NC.JSONObject[]; + /** + * Returns the latest data bound to the component. + * + * @param {true} selFlag - Depending on the argument values, it returns the following data: + * - undefined(If the selFlag option is not specified): Returns data of type `JSONObject[]`. + * - false: Returns data of the original type of type `NJS` bound to the component. + * > When binding data retrieved with the data method to another data-related component, you must set it to "false" to bind the original type of data to enable two-way data binding. + * - selected: Returns the data of the selected node as `JSONObject[]` type. + * - checked: Returns the data of the checked node as `JSONObject[]` type. + * - checkedInLastNode: Returns the data of the last node of all checked elements in `JSONObject[]` type. + * ``` + * var treeInst = N([]).tree(".context") + * .bind([{ col01: "", col02: "", col03: "", col04: "", col05: "", col06: "" }]); + * treeInst.data("checked", "col01", "col02", "col03"); + * // [{ col01: "", col02: "", col03: "" }] + * ``` + * > This only works if the first argument is "selected", "checked", or "checkedInLastNode". + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041106.html + */ + data(selFlag: false): NJS; + /** + * Returns the latest data bound to the component. + * + * @return {JSONObject[]} The data currently bound to the component is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041106.html + */ + data(): NC.JSONObject[]; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Creates a Tree within the element specified by the context option. + * + * @param {NJS} [data] - Specifies the data to bind. + * @return {NU.Tree} Returns the `Tree` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + bind(data?: NJS | NC.JSONObject[]): NU.Tree; + /** + * Returns the selected node value. + * + * @return {NC.Primitive} Selected node value. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + select(): NC.Primitive; + /** + * Select a node. + * + * @param {NC.Primitive} [val] - Specifies the node value to select. + * @return {NU.Tree} Returns the `Tree` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + select(val?: NC.Primitive): NU.Tree; + /** + * Expand all tree nodes. + * + * @return {NU.Tree} Returns the `Tree` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + expand(): NU.Tree; + /** + * Collapses all tree nodes. + * + * @param {boolean} isFirstNodeOpen - If set to true, all nodes except the first will be collapsed. + * @return {NU.Tree} Returns the `Tree` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041105.html + */ + collapse(isFirstNodeOpen?: boolean): NU.Tree; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.ui.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.ui.misc.d.ts new file mode 100644 index 0000000..9438abb --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.ui.misc.d.ts @@ -0,0 +1,3563 @@ +declare namespace NU { + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum ButtonSize { + NONE = "none", + SMALLER = "smaller", + SMALL = "small", + MEDIUM = "medium", + LARGE = "large", + BIG = "big", + } + + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum ButtonColor { + NONE = "none", + PRIMARY = "primary", + PRIMARY_CONTAINER = "primary_container", + SECONDARY = "secondary", + SECONDARY_CONTAINER = "secondary_container", + TERTIARY = "tertiary", + TERTIARY_CONTAINER = "tertiary_container", + } + + /* eslint-disable-next-line @definitelytyped/no-const-enum */ + const enum ButtonType { + NONE = "none", + FILLED = "filled", + OUTLINED = "outlined", + ELEVATED = "elevated", + } + + namespace Options { + interface Alert { + /** + * Specifies the area where the message dialog for Alert will be displayed. + * + * When the modal option is set to true, Alert's overlay element covers as much as the element specified by context. + * > If you specify a window object, it will cover the entire screen, and if you enter a jquery selector or jQuery object, it will cover only the specified element. + * + * When you specify an input element(select, input, textarea, etc.), a message is displayed in a tooltip next to the input element. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + context?: Window | NJS; + /** + * Message content. + * + * > You can specify a message string, jQuery object, HTML string, or HTML element. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + msg: string | NJS; + /** + * Replaces the variable in the message with the entered value. + * > Variables such as `{index}` declared in the message are replaced with the value corresponding to the index of the array set with the vars option. + * ``` + * N(window).alert({ + * msg: "{0} {1}-JS.", + * vars: ["Hello", "Natural"] + * }).show(); + * + * // Result message: "Hello Natural-JS" + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + vars?: string[]; + /** + * If set to true, the HTML in the message will be applied. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + html?: boolean; + /** + * Top position(px) of the message dialog. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + top?: number; + /** + * Left position(px) of the message dialog. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + left?: number; + /** + * Width of the message dialog. + * - number: When set to the number type, the entered number(px) is set as the width of the element. + * - NU.EventHandlers.Alert.Width: When set to a function type, msgContext (element that covers the screen when the modal option is true) and msgContents (message content element) are passed as arguments, and the width of the element is set with the returned value. + * ``` + * ... + * // Fill the width of the dialog to the screen + * width: function(msgContext, msgContents) { + * return $(window).width(); + * }, + * ... + * ``` + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + width?: number | NU.EventHandlers.Alert.Width; + /** + * Height of the content of the message dialog excluding the title area. + * - number: When set to the number type, the entered number (px) is set as the height of the element. + * - NU.EventHandlers.Alert.Height: function 타입으로 설정할 경우 msgContext(modal 옵션이 true 일 때 화면에 덮는 요소), msgContents(메시지 콘텐츠 요소)가 인수로 전달되고 return 된 값으로 요소의 높이가 설정됩니다. + * ``` + * ... + * // fill the height of the dialog to fill the screen + * height: function(msgContext, msgContents) { + * // Since msgContents are hidden when the message dialog is opened, we need to call the show() function and then get the height of the title area. + * return $(window).height() - msgContents.show().find(".msg_title_box__").height(); + * }, + * ... + * ``` + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + height?: number | NU.EventHandlers.Alert.Height; + /** + * Sets the title of the message dialog box. If not set, the title bar will not be created. + * > It can also be set in the title attribute of the context HTML element. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + title?: string; + /** + * If set to false, elements related to the default button(OK/Cancel button) will not be created. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + button?: boolean; + /** + * Defines the options of the Button component applied to the confirmation button of the message dialog. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + okButtonOpts?: NU.Options.Button | null; + /** + * Defines the options of the Button component applied to the cancel button of the message dialog. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + cancelButtonOpts?: NU.Options.Button | null; + /** + * Set whether to hide or remove dialog box elements when the message dialog box is closed. + * - hide: Hides the message dialog element to maintain its previous state. + * - remove: Reset the state by removing the message dialog element. + * + * @default "remove" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + closeMode?: "hide" | "remove"; + /** + * If set to true, it creates an overlay element that covers the element specified by context, blocking all events except the content of the message dialog box. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + modal?: boolean; + /** + * If set to false, clicking on the msgContext (the element that covers the screen when the modal option is true) will not close the message dialog. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + overlayClose?: boolean; + /** + * Specifies the background color of msgContext(the element that covers the screen when the modal option is true). + * It can be defined as the color property value of CSS. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + overlayColor?: "string" | null; + /** + * If set to false, pressing the ESC key will not close the message dialog. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + escClose?: boolean; + /** + * If set to true it will show OK/Cancel buttons, if set to false it will only show OK buttons. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + confirm?: boolean; + /** + * If set to true, the message dialog will always appear on top. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + alwaysOnTop?: boolean; + /** + * When applying the alwaysOnTop option, specify target elements for calculating the top z-index. + * > Specified with jQuery selector syntax. + * + * > When Alert or Popup related elements are hidden by other elements, add a selector for the element that is being hidden. + * + * @default "div, span, ul, p, nav, article, section, header, footer, aside" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + alwaysOnTopCalcTarget?: string; + /** + * If set to false, the block overlay will not be resized and the message dialog will be repositioned automatically when the browser resizes or the height of the parent content changes dynamically. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + dynPos?: boolean; + /** + * If set to true, disables window scrolling in the browser when scrolling with the mouse wheel over message dialog elements. + * + * Prevents the browser's default behavior of scrolling the browser window up or down the first or last time the message dialog element is scrolled. + * > This only works when the modal option is set to true. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + windowScrollLock?: boolean; + /** + * If set to true, the message dialog can be dragged by the title bar. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + draggable?: boolean; + /** + * If set to false, the message dialog will not automatically be moved inward when dropped off-screen. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + draggableOverflowCorrection?: boolean; + /** + * Specifies where the message dialog box will move inward when dropped off the screen. + * > If the message dialog box does not return completely inside and a scroll bar appears on the screen, correct the position of the message dialog box by increasing or decreasing it by 1. + * + * @default { top: 0, bottom: 0, left: 0, right: 0 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + draggableOverflowCorrectionAddValues?: { + top?: number; + bottom?: number; + left?: number; + right?: number; + }; + /** + * When set to true, saves memory usage by removing unnecessary reference elements. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + saveMemory?: boolean; + /** + * Defines an event handler that runs when the OK button is clicked. + * ``` + * onOk: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > Returning 0 only executes the event handler and does not close the dialog box. + * + * > This works on the OK button that is created when the button option is set to true. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onOk?: NU.EventHandlers.Alert.OnOk | null; + /** + * Define an event handler that runs when the message dialog is closed by clicking the Cancel button, clicking the X button, clicking the message overlay element, or pressing the ESC key. + * ``` + * onCancel: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > Returning 0 only executes the event handler and does not close the message dialog. + * + * > This works on the cancel button created when the button option is set to true. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onCancel?: NU.EventHandlers.Alert.OnCancel | null; + /** + * Defines an event handler that runs before the message dialog is displayed. + * ``` + * onBeforeShow: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onBeforeShow?: NU.EventHandlers.Alert.OnBeforeShow | null; + /** + * Defines an event handler that runs after the message dialog is displayed. + * ``` + * onShow: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onShow?: NU.EventHandlers.Alert.OnShow | null; + /** + * Defines an event handler that runs before the message dialog is hidden. + * ``` + * onBeforeHide: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onBeforeHide event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onBeforeHide?: NU.EventHandlers.Alert.OnBeforeHide | null; + /** + * Defines an event handler that runs after the message dialog is hidden. + * ``` + * onHide: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onHide event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onHide?: NU.EventHandlers.Alert.OnHide | null; + /** + * Defines an event handler that runs before the message dialog is removed. + * ``` + * onBeforeRemove: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onBeforeRemove event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onBeforeRemove?: NU.EventHandlers.Alert.OnBeforeRemove | null; + /** + * Defines an event handler that runs after the message dialog is removed. + * ``` + * onRemove: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onRemove event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0401.html&tab=html/naturaljs/refr/refr040104.html + */ + onRemove?: NU.EventHandlers.Alert.OnRemove | null; + isInput?: boolean; + isWindow?: boolean; + } + + interface Button { + /** + * Specifies the context element to which the Button will be applied. + * + * Button's context element must be written with `a`, `button`, or `input[type=button]` tag. + * > Buttons can select multiple elements at once and specify them as context. + * ``` + * Button + * + * + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + context?: NJS; + /** + * Set the size of the button. + * + * The size can be one of "none", "smaller", "small", "medium", "large", or "big". + * + * @default "none" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + size?: ButtonSize; + /** + * X + * Sets the color of the button. + * + * The color can be one of the following: "none", "primary", "primary_container", "secondary", "secondary_container", "tertiary", "tertiary_container". + * + * Naming and default values for button colors are based on [Color roles in Material Design 3](https://m3.material.io/styles/color/roles). + * + * To change the style of the button, simply edit the class starting with "btn_" in the natural.ui.css file. + * ``` + * a.btn_{color}__,input[type='button'].btn_{color}__,button.btn_{color}__ { + * color: var(--md-sys-color-on-tertiary); + * background-color: var(--md-sys-color-tertiary); + * border: 1px solid var(--md-sys-color-tertiary); + * } + * ``` + * + * @default "none" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + color?: ButtonColor; + /** + * Configures whether the button should have a filled background or just an outline. + * + * The type can be one of "none", "filled", "outlined", or "elevated". + * + * The colors for "filled" and "outlined" types are determined by the `color` option. If the `color` option is set to "none", the button's background or outline will not be displayed. + * + * @default "none" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + type?: ButtonType; + /** + * If set to true, the button will be created in a disabled state. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + disable?: boolean; + /** + * Defines the event handler that is executed before the button options are applied. + * + * > This can be used when utilizing an external button library, to add necessary HTML elements inside or outside the button element, or to edit the HTML elements for other purposes. + * ``` + * onBeforeCreate: function(context, opts) { + * // this: Button instance + * // context: context element + * // opts: The options specified when the button is created + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + onBeforeCreate?: NU.EventHandlers.Button.OnBeforeCreate | null; + /** + * Defines the event handler that is executed after the button options are applied. + * + * > This can be used when utilizing an external button library, to define effect events for the button element or to process the button for other purposes. + * ``` + * onCreate: function(context, opts) { + * // this: Button instance + * // context: context element + * // opts: The options specified when the button is created + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0402.html&tab=html/naturaljs/refr/refr040204.html + */ + onCreate?: NU.EventHandlers.Button.OnCreate | null; + } + + interface Datepicker { + /** + * Specifies the input element to which the Datepicker will be applied. + * ``` + * + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + context?: NJS; + /** + * Datepicker container element. + * + * @default N('
') + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + contents?: NJS; + /** + * If set to true, a Monthpicker will be displayed where only the year and month can be selected. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + monthonly?: boolean; + /** + * If set to false, the Datepicker will not be displayed when the cursor is focused on the input element. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + focusin?: boolean; + /** + * If set to top, the year selection element will be created at the top. + * + * @default "left" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + yearsPanelPosition?: "left" | "top"; + /** + * If set to top, the month selection element will be created at the top. + * + * @default "left" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + monthsPanelPosition?: "left" | "top"; + /** + * When the yearsPanelPosition option value is "top", sets the number of previous years that can be selected. + * + * @default 200 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + minYear?: number; + /** + * When the yearsPanelPosition option value is "top", sets the number of future years that can be selected. + * + * @default 200 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + maxYear?: number; + /** + * If set to true, when the year changes, the changed date will be reflected immediately in the input element. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + yearChangeInput?: boolean; + /** + * If set to true, when the month changes, the changed date will be immediately reflected in the input element. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + monthChangeInput?: boolean; + /** + * If set to true, the month will change when you touch and drag left or right. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + touchMonthChange?: boolean; + /** + * If set to true, the month will change when you scroll the mouse wheel. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + scrollMonthChange?: boolean; + /** + * If you select or enter a date earlier than the set date, input will be blocked. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + minDate?: string; + /** + * If you select or enter a date after the set date, input will be blocked. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + maxDate?: string; + /** + * If you configure the holiday option, the Datepicker will display holidays. + * + * Holidays can be configured using `repeat` and `once` objects as shown below: + * ``` + * { + * "repeat": { + * "0619": "Holiday1", + * "0620": "Holiday3", + * "0621": ["Holiday6", "Holiday7"], + * "0622": ["Holiday9", "Holiday10"] + * }, + * "once": { + * "20200619": "Holiday2", + * "20200620": ["Holiday4", "Holiday5"], + * "20200621": "Holiday8", + * "20200622": ["Holiday11", "Holiday12"] + * } + * } + * ``` + * The `repeat` object specifies holidays that recur every year by providing the month and date (without the year). + * The `once` object specifies holidays that do not recur every year and requires the full date in `YYYYMMDD` format. + * + * If there are multiple holidays on the same date, you can specify multiple holiday names as an array. + * + * You can configure this in the `N.context.attr("ui").datepicker.holiday` property of the [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) so that it is applied to all Datepickers: + * ``` + * N.comm("getHolidayList.json").submit(function(data) { + * var once = {}; + * N(data).each(function() { + * once[this.holidayDate] = this.holidayName; + * }); + * if (N.context.attr("ui").datepicker.holiday === undefined) { + * N.context.attr("ui").datepicker.holiday = {}; + * } + * N.context.attr("ui").datepicker.holiday.once = once; + * }); + * ``` + * > Elements marked as holidays will have an additional class attribute value of `datepicker_holiday__`. + * + * @default { "repeat": null, "once": null } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + holiday?: { + "repeat"?: { + [key: string]: string | string[]; + } | null; + "once"?: { + [key: string]: string | string[]; + } | null; + }; + /** + * Defines an event handler that is executed when the year is changed. + * ``` + * onChangeYear: function(context, year, e) { + * // this: Datepicker instance + * // context: context element + * // year: selected year + * // e: event object + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onChangeYear?: NU.EventHandlers.Datepicker.OnChangeYear | null; + /** + * Defines an event handler that is executed when the month is changed. + * ``` + * onChangeMonth: function(context, month, year, e) { + * // this: Datepicker instance + * // context: context element + * // month: selected month + * // year: selected year + * // e: event object + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onChangeMonth?: NU.EventHandlers.Datepicker.OnChangeMonth | null; + /** + * Defines the event handler that is executed when a date or a month (if the `monthonly` option is set to true) is selected. + * ``` + * onSelect: function(context, selDate, monthonly) { + * // this: Datepicker instance + * // context: context element + * // selDate: Selected date as a Date object + * // selDate = { + * // obj: Date object, + * // format: Date format (Refer to Formatter > Format Rule List Tab > "Specify a date format rule as a string" for "date" rule) + * // } + * // selDate.obj.formatDate("Y-m-d") => "2024-09-26"; + * // monthonly: value of the monthonly option + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onSelect?: NU.EventHandlers.Datepicker.OnSelect | null; + /** + * Defines the event handler that is executed before the date picker is displayed. + * ``` + * onBeforeShow: function(context, contents) { + * // this: Datepicker instance + * // context: context element + * // contents: Datepicker panel element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onBeforeShow?: NU.EventHandlers.Datepicker.OnBeforeShow | null; + /** + * Defines an event handler that runs after the datepicker is displayed. + * ``` + * onShow: function(context, contents) { + * // this: Datepicker instance + * // context: context element + * // contents: Datepicker panel element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onShow?: NU.EventHandlers.Datepicker.OnShow | null; + /** + * Defines an event handler that runs before the datepicker is closed. + * ``` + * onBeforeHide: function(context, contents) { + * // this: Datepicker instance + * // context: context element + * // contents: Datepicker panel element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onBeforeHide?: NU.EventHandlers.Datepicker.OnBeforeHide | null; + /** + * Defines an event handler that runs after the datepicker is closed (after the closing effect ends). + * ``` + * onHide: function(context) { + * // this: Datepicker instance + * // context: context element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0403.html&tab=html/naturaljs/refr/refr040304.html + */ + onHide?: NU.EventHandlers.Datepicker.OnHide | null; + } + + interface Popup { + /** + * Specifies the Block element inside the page to create as a popup. + * + * > Since the element inside the page is turned into a popup, the `url` option must not be set. + * ``` + * N("context").popup(); + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + context?: NJS; + /** + * Specifies the URL of the page to be displayed in a popup. + * + * > Once the popup page has finished loading, the `init` method of the popup page will be called. + * + * > Since a different page is being loaded to create the popup, the `context` option should not be specified. + * ``` + * N().popup("url"); + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + url?: string; + /** + * Sets the title of the popup. If not set, the title bar is not created. + * + * > If the `url` option is specified, the title can also be set using the `title` attribute of the `view` element from the loaded page. + * When creating a popup by specifying a context, the title can be set using the `title` attribute of the context element. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + title?: string; + /** + * If set to false, it does not create basic button-related elements (OK/Cancel buttons). + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + button?: boolean; + /** + * If set to true, it creates an overlay element that covers the entire screen, + * blocking all interactions except for the popup content. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + modal?: boolean; + /** + * The position(px) to the top of the popup. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + top?: number; + /** + * The position(px) to the left of the popup. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + left?: number; + /** + * Width of the popup. + * - number: When set to the number type, the entered number(px) is set as the width of the element. + * - NU.EventHandlers.Popup.Width: When set to a function type, msgContext (element that covers the screen when the modal option is true) and msgContents (message content element) are passed as arguments, and the width of the element is set with the returned value. + * ``` + * ... + * // Fill the width of the popup to the screen + * width: function(msgContext, msgContents) { + * return $(window).width(); + * }, + * ... + * ``` + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + width?: NU.EventHandlers.Popup.Width | number; + /** + * Height of the content of the popup excluding the title area. + * - number: When set to the number type, the entered number (px) is set as the height of the element. + * - NU.EventHandlers.Popup.Height: function 타입으로 설정할 경우 msgContext(modal 옵션이 true 일 때 화면에 덮는 요소), msgContents(메시지 콘텐츠 요소)가 인수로 전달되고 return 된 값으로 요소의 높이가 설정됩니다. + * ``` + * ... + * // fill the height of the popup to fill the screen + * height: function(msgContext, msgContents) { + * // Since msgContents are hidden when the popup is opened, we need to call the show() function and then get the height of the title area. + * return $(window).height() - msgContents.show().find(".msg_title_box__").height(); + * }, + * ... + * ``` + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + height?: number | NU.EventHandlers.Popup.Height; + /** + * An option for referencing the parent page's Controller object from the popup's Controller object. + * + * When you assign the Controller object of the page creating the popup to the opener option, it will be passed to the popup’s Controller object as its opener property. + * + * > This only works when you set the url option to create another page as popup content. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + opener?: NA.Objects.Controller.Object | null; + /** + * Sets whether to hide or remove the popup element when the popup is closed. + * - hide: Hides the popup element and maintains the previous state. + * - remove: Removes the popup element to reset its state. + * + * @default "hide" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + closeMode?: "hide" | "remove"; + /** + * If set to true, the popup will always appear on top. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + alwaysOnTop?: boolean; + /** + * If set to false, the popup will not close when clicking the msgContext + * (the element covering the screen when the modal option is true). + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + overlayClose?: boolean; + /** + * If set to false, the popup will not close when pressing the ESC key. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + escClose?: boolean; + /** + * Defines an event handler that runs when the OK button is clicked. + * ``` + * onOk: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > Returning 0 only executes the event handler and does not close the dialog box. + * + * > This works on the OK button that is created when the button option is set to true. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onOk?: NU.EventHandlers.Popup.OnOk | null; + /** + * Define an event handler that runs when the message dialog is closed by clicking the Cancel button, clicking the X button, clicking the message overlay element, or pressing the ESC key. + * + * ``` + * onCancel: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > Returning 0 only executes the event handler and does not close the dialog box. + * + * > This works on the cancel button created when the button option is set to true. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onCancel?: NU.EventHandlers.Popup.OnCancel | null; + /** + * Define an event handler that fires before the pop-up is displayed. + * ``` + * onBeforeShow: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onBeforeShow?: NU.EventHandlers.Popup.OnBeforeShow | null; + /** + * Define an event handler that fires after the pop-up is displayed. + * ``` + * onShow: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onShow?: NU.EventHandlers.Popup.OnShow | null; + /** + * Define an event handler that fires before the popup is hidden. + * ``` + * onBeforeHide: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onBeforeHide event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onBeforeHide?: NU.EventHandlers.Popup.OnBeforeHide | null; + /** + * Define an event handler that fires after the popup is hidden. + * ``` + * onHide: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onHide event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onHide?: NU.EventHandlers.Popup.OnHide | null; + /** + * Define an event handler that fires before the popup is removed. + * ``` + * onBeforeRemove: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onBeforeRemove event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onBeforeRemove?: NU.EventHandlers.Popup.OnBeforeRemove | null; + /** + * Define an event handler that fires after the popup is removed. + * ``` + * onRemove: function(msgContext, msgContents) { + * // this: Alert instance + * // msgContext: Message overlay element + * // msgContents: Message dialog element + * } + * ``` + * > If the closeMode option is set to hide, the onRemove event will not fire. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onRemove?: NU.EventHandlers.Popup.OnRemove | null; + /** + * Defines an event handler that is executed every time the popup is opened. + * + * > The function name is defined as a string, and the actual event handler method must be implemented in the Controller object of the popup content using the specified function name. + * + * > The first argument of the `open` method is passed as the first argument (`onOpenData`) to the onOpen event handler function. + * + * > If the popup content is loaded for the first time, the `init` function of the Controller object is executed before the `onOpen` function. + * + * > This only works when you set the `url` option to load another page as popup content. + * + * - Popup instance example: + * ``` + * N(".popup").cont({ + * ... + * init: function(view, request) { + * var popup = N().popup({ + * url: "./popup.html", + * onOpen: "onOpenFn" + * }); + * + * popup.open([1, 2, 3]); + * } + * ... + * }); + * ``` + * - Popup's Controller object example: + * ``` + * N(".popup").cont({ + * ... + * onOpenFn: function(onOpenData) { + * console.log(onOpenData); + * + * // [1, 2, 3] + * } + * ... + * }); + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onOpen?: string | NU.EventHandlers.Popup.OnOpen | null; + /** + * Sets the data of the parent page to pass as the first argument of the onOpen event handler function. + * + * The first argument value of the open method will be set to this value. + * + * > This only works when you set the `url` option to create another page as popup content. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onOpenData?: any; + /** + * Defines an event handler that is executed whenever the popup is closed. + * ``` + * onClose: function(onCloseData) { + * // this: Popup instance + * // onCloseData: The first argument passed to the caller's close function of the Controller object invoked from the popup. + * } + * ``` + * > When the popup content loading is complete, a `caller` property is created on the Controller object of the popup. The `caller` refers to the Popup instance of the parent page that created this popup. + * To close its own popup, this popup can execute the command `this.caller.close(onCloseData);` from the Controller object. When this command is executed and the popup closes, the `onClose` event handler function receives the `onCloseData` as its first argument. + * + * > This only works when you set the `url` option to create another page as the popup content. + * + * - Popup instance example + * ``` + * N(".popup").cont({ + * ... + * init: function(view, request) { + * var popup = N().popup({ + * url: "./popup.html", + * onClose: function(onCloseData) { + * console.log(onCloseData); + * + * // [1, 2, 3] + * } + * }); + * } + * ... + * }); + * ``` + * - Controller object of the popup + * ``` + * N(".popup").cont({ + * ... + * events: function() { + * var caller = this.caller; + * N(".close", this.view).on("click", function(onCloseData) { + * + * caller.close([1, 2, 3]); + * + * }); + * } + * ... + * }); + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onClose?: NU.EventHandlers.Popup.OnClose | null; + /** + * Sets the data of the popup page to be passed as the first argument of the onClose event handler. + * + * The value of the first argument of the `this.caller.close` method in the popup's Controller object is set to this value. + * + * > This only works when you set the `url` option to create another page as popup content. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onCloseData?: any; + /** + * Defines the event handler that runs when the popup content has finished loading. + * + * ``` + * onLoad: function(cont) { + * // this: Popup instance + * // cont: The Controller object for the popup + * } + * ``` + * > This only works when you set the `url` option to create another page as popup content. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + onLoad?: NU.EventHandlers.Popup.OnLoad | null; + /** + * If set to true, the popup's content is preloaded when the popup is initialized; + * if set to false, the popup's content is loaded when the popup is opened for the first time. + * + * > This option works only when the `url` option is set to create popup content from another page. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + preload?: boolean; + /** + * If set to false, it does not automatically adjust the size of the block overlay and the position of the popup when resizing the browser window or when the parent's content height changes dynamically. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + dynPos?: boolean; + /** + * If set to true, it disables the browser's window scroll when scrolling with the mouse wheel over a popup element. + * + * This blocks the browser's default behavior of scrolling up or down when the popup element reaches its top or bottom scroll limit. + * + * > Only works when the modal option is set to true. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + windowScrollLock?: boolean; + /** + * Enables dragging the popup dialog box using the title bar when set to `true`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + draggable?: boolean; + /** + * When set to `false`, the popup will not automatically move back inside the screen if dropped outside of it. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + draggableOverflowCorrection?: boolean; + /** + * Specifies where the popup will move inward when dropped off the screen. + * > If the popup does not return completely inside and a scroll bar appears on the screen, correct the position of the popup by increasing or decreasing it by 1. + * + * @default { top: 0, bottom: 0, left: 0, right: 0 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + draggableOverflowCorrectionAddValues?: { + top?: number; + bottom?: number; + left?: number; + right?: number; + }; + /** + * When set to true, saves memory usage by removing unnecessary reference elements. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0404.html&tab=html/naturaljs/refr/refr040404.html + */ + saveMemory?: boolean; + } + + interface EachTab { + /** + * Specifies the URL of the page to be created as tab content. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + url?: string; + /** + * If set to true, the tab and its content will be selected by default after the tabs are initialized. + * + * > The `active` option should be set to true for only one tab to be displayed by default. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + active?: boolean; + /** + * If set to true, the page for the tab content will be preloaded during the tab initialization instead of loading it the first time the tab is selected. + * + * This is used when you need to reference elements or the Controller object of the tab content during initialization. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + preload?: boolean; + /** + * Specifies the name of the `onOpen` event handler function as a string that will be executed in the loaded content whenever a tab is opened. + * - The `onOpen` event handler function must be defined in the Controller object of the page being loaded with the specified name. + * - The first argument of the `onOpen` event handler function is the `onOpenData` specified as the second argument when calling the `open` function. + * - When tab content is loaded for the first time, the `init` function of the Controller object is executed, followed by the `onOpen` function. + * - If an `onActive` event is defined, the `onActive` function is executed first, followed by the `onOpen` function. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + onOpen?: string | NU.EventHandlers.Tab.OnOpen; + /** + * When set to `true`, the specified tab is created in a disabled state. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + disable?: boolean; + /** + * When set to `true`, the status of tab content is not preserved, and the associated tab content is reloaded and initialized each time the tab is selected. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + stateless?: boolean; + } + interface Tab { + /** + * Specifies the context element where the Tab will be applied. + * + * The context element for the Tab must be written using the `div` tag, + * containing `ul`, `li`, and additional `div` tags. + * + * - Tab + * - The tab elements are created using the `li` tags inside a `ul` tag. + * - The `href` attribute of the tab link (`` tag) should match the `id` attribute + * of the corresponding tab content (`
` tag). + * - Tab contents + * - Tab content elements must be created using `div` tags. + * - The number and order of `tab contents` (`div`) should match the tabs (`li`). + * - The `id` attribute of the tab contents (`div` tags) should match the `href` attribute of + * the tab links (`` tags). + * - You can set a URL option in the tab options to load other pages, or you can directly + * write the content inside the tab content element (`div`). + * ``` + *
+ * + *
Tab1
+ *
+ *
+ *
+ * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + context?: NJS; + /** + * A variable that only contains instances of tab link elements. + * + * @default null + */ + links?: NJS | null; + /** + * A variable that only contains instances of tab content elements. + * + * @default null + */ + contents?: NJS | null; + /** + * Instead of using the `data-opts` attribute of a tab element, you can specify the options for individual tabs as an array of objects. + * + * The options should be configured as objects according to the order and number of tabs. + * ``` + * N("#tab").tab({ + * tabOpts: [ + * { width: "auto", url: "tab1.html", preload: false, active: false }, //Tab1 + * { width: "auto", url: "tab2.html", preload: false, active: false }, //Tab2 + * { width: "auto", url: "tab3.html", preload: false, active: false, onOpen: "onOpen" } //Tab3 + * ] + * }); + * ``` + * You can also specify options via the `data-opts` attribute directly on the tab tags (`
  • ` elements). + * + * For detailed explanations of individual options, please refer to the [declarative options](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040505.html) tab. + * + * @default [] + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + tabOpts?: NU.Options.EachTab[]; + /** + * If set to `true`, the tab and tab content will be displayed randomly when the tab is initialized. + * If set to `false`, the first tab will be displayed. + * + * > If the `active` option is set to `true` among the tab options, the `active` option will take precedence. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + randomSel?: boolean; + /** + * This option allows the Controller (N.cont) object of the parent page, where the Tab instance was created, + * to be referenced from the Controller object in the tab content when the `url` option is set in the tab options to load another page. + * + * When creating a Tab instance, you can specify the Controller object in the `opener` option. + * This will pass the Controller object of the parent page into the `opener` property of the tab content page's Controller object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + opener?: NA.Objects.Controller.Object | null; + /** + * Defines an event handler that is executed every time a tab is activated. + * + * ``` + * onActive: function(tabIdx, tabEle, contentEle, tabEles, contentEles) { + * // this: Tab instance + * // tabIdx: Index of the activated tab + * // tabEle: Element of the activated tab + * // contentEle: Element of the activated content + * // tabEles: All tab elements + * // contentEles: All content elements + * } + * ``` + * > When tab content is loaded for the first time, the `init` function of the Controller object is executed before the `onActive` function is executed. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + onActive?: NU.EventHandlers.Tab.OnActive | null; + /** + * Defines an event handler that is executed when tab content loading is complete. + * + * ``` + * onLoad: function(tabIdx, tabEle, contentEle, cont) { + * // this: Tab instance + * // tabIdx: Index of the activated tab + * // tabEle: Element of the activated tab + * // contentEle: Element of the activated content + * // cont: Controller object of the loaded tab content + * } + * ``` + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + onLoad?: NU.EventHandlers.Tab.OnLoad | null; + /** + * If set to `true`, the `onActive` event is not triggered when the tab is created, and the default tab is selected. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + blockOnActiveWhenCreate?: boolean; + /** + * When set to true, tabs can be scrolled using mouse drag, touch, or the first/last buttons. + * + * To scroll tabs using the first/last buttons, you need to include `a` tags and `span` tags as the first and last child elements of the `ul` tag. + * ``` + *
    + * + * + * + *
    tab1
    + *
    tab2
    + *
    tab3
    + *
    + * ``` + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + tabScroll?: boolean; + /** + * Due to styles (CSS) applied to tab elements, the last tab may be either cut off or have additional spacing. In such cases, you can adjust the following options in the `tabScrollCorrection` object to display the tabs correctly: + * - tabContainerWidthCorrectionPx: An option that allows you to increment or decrement by 1 to correct the tab appearance when the last tab is cut off or has extra spacing. + * - tabContainerWidthReCalcDelayTime: An option that allows you to re-adjust the tab appearance by incrementing or decrementing by 1 when the tabs are first displayed and are either cut off or have extra spacing. + * ``` + * N("#tab").tab({ + * tabScrollCorrection: { + * tabContainerWidthCorrectionPx: 1, + * tabContainerWidthReCalcDelayTime: 0 + * } + * }); + * ``` + * [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) If you set the `tabScrollCorrection` option in the N.context.attr("ui").tab property of the configuration, it will be applied to all Tab components. + * + * @default { tabContainerWidthCorrectionPx: 0, tabContainerWidthReCalcDelayTime: 0 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0405.html&tab=html/naturaljs/refr/refr040504.html + */ + tabScrollCorrection?: { + tabContainerWidthCorrectionPx?: number; + tabContainerWidthReCalcDelayTime?: number; + }; + } + + interface Select { + /** + * Specifies the data to bind to the Select element. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + data?: NJS; + /** + * Specifies the context element where the Select will be applied. + * + * The context element for Select must be written as a `select` or input tags with `type=checkbox` or `type=radio`. + * ``` + * + * + * + * + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + context?: NJS; + /** + * Specifies the property name of the data to be bound to the name attribute of the selected element. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + key?: string; + /** + * Specifies the property name of the data to be bound to the value attribute of the selected element. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + val?: string; + /** + * If set to `false`, clears the default options in the select element before binding the data. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + append?: boolean; + /** + * If the context is `input[type=checkbox]` or `input[type=radio]`, specifies the direction in which the selected elements are placed. + * - h: Horizontal + * - v: Vertical + * + * @default "h" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + direction?: "h" | "v"; + /** + * Select element type + * - 1: select + * - 2: select[multiple='multiple'] + * - 3: radio + * - 4: checkbox + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + type?: 0 | 1 | 2 | 3 | 4; + /** + * This variable is assigned with the instance of the default template element when it's a radio or checkbox. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0406.html&tab=html/naturaljs/refr/refr040604.html + */ + template?: NJS | null; + } + + interface Form { + /** + * Specifies the data to bind to the Form. + * + * Although the Form represents a single data component, the bound data is of a JSON object array type. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + data?: NJS; + /** + * Specifies the index value of the row from the list data indicated by the data option to bind to the form. + * + * The default value is -1, but if no value is entered, it will be set to 0, binding the first row of the list data to the form. + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + row?: number; + /** + * Specifies the context element to apply to the Form. + * + * The context element of the Form can be written as tags that represent regions such as table, div, section, etc. + * + * If the property name of the data matches the id attribute value of the element, the data is bound. + * + * > All data-related components of Natural-JS use the id attribute for fast binding speed, which is inevitable. + * ``` + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    registered
    + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + context?: NJS; + /** + * When set to `false`, validation of input values is not performed when focus is lost from input elements. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + validate?: boolean; + /** + * When set to `true`, the `unbind` method is automatically called before rebinding the same form elements, allowing for the reuse of form elements. + * > The context element of the form is not recreated, so the purpose of the `add` and `bind` methods should be clearly distinguished. + * Even if the `unbind` method is called for form elements already bound with data, it cannot perfectly restore the previous state. + * Use is not recommended unless absolutely necessary. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + autoUnbind?: boolean; + /** + * An internal variable used within the system. + * + * @default null + */ + state?: "add" | "bind" | "revert" | "update" | NJS | null; + /** + * When set to `true`, HTML of data is applied while binding to the form. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + html?: boolean; + /** + * When set to `true`, row data is added to the top of the data list when the `add` method is called. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + addTop?: boolean; + /** + * Specifies format rules as an object type rather than using the data-format attribute of the target element. + * + * > Refer to the `rules` parameter description of [Formatter Constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030103.html) for constructing the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + fRules?: ND.FormatRuleObject | null; + /** + * Specifies validation rules as an object type rather than using the data-validate attribute of the target element. + * + * > Refer to the `rules` parameter description of [Validator Constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030203.html) for constructing the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + vRules?: ND.ValidationRuleObject | null; + /** + * An internal variable used within the system. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + extObj?: NU.List | NU.Grid | null; + /** + * An internal variable used within the system. + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + extRow?: number; + /** + * When set to `true`, the revert functionality is enabled, and the revert method can be used. + * + * @default false + */ + revert?: boolean; + /** + * If set to true, element searching is cached, slightly improving performance. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + cache?: boolean; + /** + * If set to true, the unbind feature is enabled, allowing the use of the unbind method. + * > Enabling the unbind feature retains initially bound data in memory, which increases memory usage. + * + * > Since context elements in the form are not regenerated, add and bind methods must be distinctly used based on their purposes. Even when the unbind method is called on form elements with already bound data, it may not fully restore the previous state. Therefore, it is not recommended except in cases of necessity. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + unbind?: boolean; + /** + * If set to true, it prevents conflicts between events already bound to input elements and component-specific events such as format, validate, and dataSync before the component is initialized. + * + * > If format does not work correctly, or bound data is not handled as intended, or an unknown error occurs, consider setting this to true. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + tpBind?: boolean; + /** + * Defines an event handler that executes before data property values are bound to elements. + * + * > [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) can be set as a global option to apply to all components (Grid, List) that use Form. + * If you use the onBeforeBindValue event, you can handle all the values and elements to be bound with Form, Grid, or List at once. + * + * > When the onBeforeBindValue event is set as a global event option in N.config, the result of the handler defined during component initialization is passed as the argument (val) of the global handler. Therefore, unlike other events, global event handlers cannot be interrupted in component events. + * ``` + * onBeforeBindValue: function(ele, val, action) { + * // this: Form instance + * // ele: element to be bound + * // val: value to be bound + * // action: method name of the Form instance - "bind" | "val" + * return val; // The processed value must be returned. + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + onBeforeBindValue?: NU.EventHandlers.Form.OnBeforeBindValue | null; + /** + * Defines an event handler that executes after data property values are bound to elements. + * + * > [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) can be set as a global option to apply to all components (Grid, List) that use Form. + * The onBindValue event allows you to handle all the values and elements bound with Form, Grid, or List at once. + * ``` + * onBindValue: function(ele, val, action) { + * // this: Form instance + * // ele: bound element + * // val: bound value + * // action: method name of the Form instance - "bind" | "val" + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + onBindValue?: NU.EventHandlers.Form.OnBindValue | null; + /** + * Defines an event handler that executes before data property values are bound to elements. + * + * > [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) can be set as a global option to apply to all components (Grid, List) that use Form. + * ``` + * onBeforeBind: function(context, rowData) { + * // this: Form instance + * // context: context element + * // rowData: data to be bound to the form + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + onBeforeBind?: NU.EventHandlers.Form.OnBeforeBind | null; + /** + * Defines an event handler that executes after data is fully bound. + * + * > [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010205.html) can be set as a global option to apply to all components (Grid, List) that use Form. + * ``` + * onBind: function(context, rowData) { + * // this: Form instance + * // context: context element + * // rowData: bound data + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + onBind?: NU.EventHandlers.Form.OnBind | null; + /** + * Internal variable used within the class. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0407.html&tab=html/naturaljs/refr/refr040704.html + */ + InitialData?: NJS; + } + + interface List { + /** + * Specifies the data to be bound to the List. + * + * The context elements of the List must be written with `ul` and `li` tags. + * + * If the property name of a row's data matches the id attribute value of an element, the data will be bound to that element. + * + * > All data-related components in Natural-JS unavoidably use id attributes for faster binding performance. + * ``` + *
      + *
    • + * + * + * + * + *
    • + *
    + * ``` + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + data?: NJS; + /** + * A variable used internally. + * + * @default -1 + */ + row?: number; + /** + * A variable used internally. + * + * @default -1 + */ + beforeRow?: number; + /** + * Specifies the context elements to which the List will be applied. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + context?: NJS; + /** + * Specifies the height of the list body. + * + * If the specified value is greater than 0, a scrollbar will appear within the list body, and its height will be fixed to the specified value. If set to 0, all data will be displayed in the list body. + * + * > When binding paginated data to a List combined with the Pagination component, setting this to `0` to display all the data at once is recommended. + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + height?: number; + /** + * If set to false, validation of the input value is not performed when the input element loses focus. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + validate?: boolean; + /** + * If set to true, HTML of the data is applied when binding the data. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + html?: boolean; + /** + * If set to true, a new row element and row data will be added to the beginning of the list when the `add` method is called. + * + * > If the `addTop` option is set to false, a data synchronization issue might occur, forcing the `scrollPaging.size` and `createRowDelay` option values to be set to 0. This may degrade data binding performance. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + addTop?: boolean; + /** + * If set to true, the row added by the `add` method will be automatically selected. + * + * > The `select` option must be set to true. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + addSelect?: boolean; + /** + * If set to true, the height of the list body can be adjusted with the mouse. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + vResizable?: boolean; + /** + * If set to true, window scrolling in the browser will be disabled when scrolling with a mouse wheel over the data list element. + * + * The browser's default behavior of scrolling up or down the window when reaching the start or end of the data list element will be prevented. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + windowScrollLock?: boolean; + /** + * If set to true, the `onSelect` event is triggered when a row is selected (single row selection), + * and the class attribute of the row element (`tbody`) is toggled with the value `list_selected__`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + select?: boolean; + /** + * If set to false, selecting an already selected row (with the `select` option set to true) will not deselect it. + * + * > The `unselect` option is not applied when the `multiselect` option is true. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + unselect?: boolean; + /** + * If set to true, the `onSelect` event is triggered when multiple rows are selected (multi-row selection), + * and the class attribute of the row element (`tbody`) is toggled with the value `list_selected__`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + multiselect?: boolean; + /** + * Specifies an `input[type=checkbox]` element used to select all checkboxes + * targeted by the `checkAllTarget` option. + * + * > Unlike grids, this should not be specified as a jQuery selector string, + * but as an exact jQuery object type representing the specific element. + * + * > Only toggles the checkbox state without triggering a click event. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + checkAll?: JQuery.Selector; + /** + * Specifies an `input[type=checkbox]` element used for multi-row selection in the list. + * + * The specified element can be used with the `check` function to retrieve + * or set the index of selected rows. + * + * > `checkSingleTarget` elements must be inside an `li` element. + * + * > Use jQuery selector syntax, where the selector context is automatically set to list row elements (`li`). + * + * > Only one of `checkAllTarget` and `checkSingleTarget` can be used. + * + * > Binding data via the `id` attribute on checkboxes may cause issues. + * Use this functionality only for retrieving the indexes of selected rows. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + checkAllTarget?: JQuery.Selector; + /** + * Specifies an `input[type=checkbox]` element used for single-row selection in the list. + * + * The specified element can be used with the `check` function to retrieve + * or set the index of the selected row. + * + * > `checkSingleTarget` elements must be inside an `li` element. + * + * > Use jQuery selector syntax, where the selector context is automatically set to list row elements (`li`). + * + * > Only one of `checkAllTarget` and `checkSingleTarget` can be used. + * + * > Binding data via the `id` attribute on checkboxes may cause issues. + * Use this functionality only for retrieving the indexes of selected rows. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + checkSingleTarget?: JQuery.Selector; + /** + * When set to `true`, the "list_hover__" class attribute value is added to the row element when the mouse is over the row, and the added class attribute value is removed when the mouse is out. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + hover?: boolean; + /** + * When set to `true`, the revert feature is enabled, and the `revert` method can be used. + * + * > Enabling the revert feature stores the initially bound data in memory, which will increase memory usage. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + revert?: boolean; + /** + * When set to a value greater than 1, each row of the list is created separately when binding. At this time, the interval between the creation of the next row is set. + * + * > If set to 0, all rows are created at once, which can cause the browser to freeze during data binding. + * + * @default 1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + createRowDelay?: number; + /** + * Specifies the number of rows to bind at once during scroll paging. + * + * The list has scroll paging enabled by default, and specifying 0 disables the scroll paging feature. + * + * The `size` option value should be specified as a nested property of the `scrollPaging` option object, like this: + * ``` + * ... + * scrollPaging: { + * size: 50 + * } + * ... + * ``` + * > If set too small, the scroll may not be created, leaving all the data displayed. Ensure to set an amount allowing rows to overflow the list body. + * + * > If set too high, the browser may experience a performance load when scroll paging is triggered. If the list contains input elements or images, set it below 100; otherwise, set it below 1000 for optimal performance. + * + * @default { idx: 0, size: 100 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + scrollPaging?: { + idx?: number; + size?: number; + }; + /** + * Specifies the format rules in an object type instead of the target element’s `data-format` attribute. + * + * > Refer to the description of the `rules` argument in the [Formatter Constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030103.html) for how to construct the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + fRules?: ND.FormatRuleObject | null; + /** + * Specifies validation rules in an object type instead of the target element’s `data-validate` attribute. + * + * > Refer to the description of the `rules` argument in the [Validator Constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030203.html) for how to construct the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + vRules?: ND.ValidationRuleObject | null; + /** + * When set to `false`, rows appended using the `bind` method's second argument with the "append" option do not automatically scroll into view. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + appendScroll?: boolean; + /** + * If set to false, added rows will not automatically scroll into view when the add method is called. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + addScroll?: boolean; + /** + * If set to false, the last selected row will not scroll into view when the select method is called. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + selectScroll?: boolean; + /** + * If set to false, the last checked row will not scroll into view when the check method is called. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + checkScroll?: boolean; + /** + * If set to false, the last row that failed validation will not scroll into view when the validate method is called. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + validateScroll?: boolean; + /** + * If set to true, caching is applied during element searching to slightly improve performance. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + cache?: boolean; + /** + * If set to true, it prevents conflicts between existing binding events (such as format, validate, and dataSync) and component events before initializing the component. + * + * > If format does not function correctly, bound data is not handled as intended, or unknown errors occur, consider setting this option to true. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + tpBind?: boolean; + /** + * Defines an event handler that is executed before data is bound to the row element created when bound or added. + * ``` + * rowHandlerBeforeBind: function(rowIdx, rowEle, rowData) { + * // this: List instance + * // rowIdx: Index of the created row + * // rowEle: Created row element (li) + * // rowData: Data for the row to be created + * } + * ``` + * > The `rowHandlerBeforeBind` event handler is executed each time a row element is created. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + rowHandlerBeforeBind?: NU.EventHandlers.List.RowHandlerBeforeBind | null; + /** + * Defines an event handler that is executed after data is bound to the row element created when bound or added. + * ``` + * rowHandler: function(rowIdx, rowEle, rowData) { + * // this: List instance + * // rowIdx: Index of the created row + * // rowEle: Created row element (li) + * // rowData: Bound data of the created row + * } + * ``` + * > The `rowHandler` event handler is executed each time a row element is created. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + rowHandler?: NU.EventHandlers.List.RowHandler | null; + /** + * Defines an event handler that is executed before a row is selected. + * ``` + * onBeforeSelect: function(rowIdx, rowEle, rowData, beforeRowIdx, e) { + * // this: List instance + * // rowIdx: The index of the selected row + * // rowEle: The selected row element (li) + * // rowData: The data of the selected row + * // beforeRowIdx: The index of the row previously selected + * // e: The click event object + * } + * ``` + * > If false is returned in the onBeforeSelect event handler, the row will not be selected. In this case, the onSelect event will be executed under the same conditions as the onBeforeSelect event. + * + * > This is executed only if the `select` or `multiselect` option is set to true. + * + * > If the `unselect` option is set to false and selection is canceled, the `rowIdx` argument returns -1. If selected, it returns the index of the selected row. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + onBeforeSelect?: NU.EventHandlers.List.OnBeforeSelect | null; + /** + * Defines an event handler that is executed after a row is selected. + * ``` + * onSelect: function(rowIdx, rowEle, rowData, beforeRowIdx, e) { + * // this: List instance + * // rowIdx: Index of the selected row + * // rowEle: Element of the selected row (li) + * // rowData: Data of the selected row + * // beforeRowIdx: Index of the previously selected row + * // e: click event object + * } + * ``` + * > Executed only when the `select` or `multiselect` option is set to `true`. + * + * > When the `unselect` option is set to `false`, it returns `-1` in `rowIdx` when deselected and the index of the selected row when selected. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + onSelect?: NU.EventHandlers.List.OnSelect | null; + /** + * Defines an event handler that is executed after the data is bound. + * ``` + * onBind: function(context, data, isFirstPage, isLastPage) { + * // this: List instance + * // context: Context element + * // data: Bound data + * // isFirstPage: Whether it is the first page when scroll paging (returns true if not scroll-paging) + * // isLastPage: Whether it is the last page when scroll paging (returns true if not scroll-paging) + * } + * ``` + * > Executed whenever paged data is bound when scroll paging is enabled. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0408.html&tab=html/naturaljs/refr/refr040804.html + */ + onBind?: NU.EventHandlers.List.OnBind | null; + } + + interface GridMisc { + resizableCorrectionWidth?: number; + resizableLastCellCorrectionWidth?: number; + resizeBarCorrectionLeft?: number; + resizeBarCorrectionHeight?: number; + fixedcolHeadMarginTop?: number; + fixedcolHeadMarginLeft?: number; + fixedcolHeadHeight?: number; + fixedcolBodyMarginTop?: number; + fixedcolBodyMarginLeft?: number; + fixedcolBodyBindHeight?: number; + fixedcolBodyAddHeight?: number; + fixedcolRootContainer?: JQuery.Selector | null; + } + + interface Grid { + /** + * Specifies the data to be bound to the Grid. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + data?: NJS; + /** + * This variable is used internally. + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + row?: number; + /** + * This variable is used internally. + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + beforeRow?: number; + /** + * Specifies the context element to which the Grid is applied. + * + * The context element for the Grid must always be written as a `table` tag. + * + * - thead - Grid header + * - Creates column titles for the grid. + * - The cells in the `thead` must be written using the `th` tag. + * - If the header is not needed, you don't need to include it, but sortable or filter options that work on the header cannot be used. + * - Multiple `tr` tags can be written inside the `thead` tag. + * - tbody - Grid body + * - The top-level element representing rows is `tbody`, and it is replicated by the length of the list data. + * - Cells in the `tbody` are written with the `td` tag. + * - If a row's property name matches the value of an element's `id` attribute, data binding is applied. + * > All data-related components in Natural-JS inevitably use the id attribute for fast binding speed. + * + * > To bind more than one column's data in a single cell (`td`), add more than one element into the cell and include the `id` attribute values. In this case, the `data-id` attribute value in the `thead`'s `th` must set the property name used for sorting/filtering, etc. + * + * - You can create row groups by writing multiple `tr` tags inside the `tbody` tag. + * - tfoot - Grid footer + * - If the Grid footer is not needed, it does not need to be included. + * - Cells in the `tfoot` are written with the `td` tag. + * ``` + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    nameageemailregistered
    + * + * + *
    + * ``` + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + context?: NJS; + /** + * Specifies the height of the grid body. + * + * If the value is greater than 0, the header is fixed, and a scrollbar will appear in the grid body, fixed at the specified height. If set to 0, the header will not be fixed, and all data will be displayed in the grid body. + * + * > When using the grid with a Pagination component to bind paginated data to the list, it is recommended to set this to 0 to display all data at once. + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + height?: number; + /** + * Specifies which columns are fixed, allowing other columns to scroll horizontally. + * + * If set to 0, no columns will be fixed. Setting a number greater than or equal to 1 will fix that many columns starting from the first column. + * + * > The header (thead) section is required, and the footer (tfoot) section must not be present. + * + * > This option will not work if the grid's header or body consists of more than two sets of rows or if the height option is greater than 0. + * + * > If the fixed cells are displayed abnormally, adjust the values of the options: misc.fixedcolHeadMarginTop, misc.fixedcolHeadMarginLeft, misc.fixedcolHeadHeight, misc.fixedcolBodyMarginTop, misc.fixedcolBodyMarginLeft, fixedcolBodyBindHeight, and fixedcolBodyAddHeight. + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + fixedcol?: number; + /** + * When set to true, activates the functionality to hide or show columns and automatically generates a detailed popup. + * + * A button for executing the above functionality is created after the last column of the grid. + * + * If set to true, all columns defined in the grid header will be shown in the detailed popup. If an array of column names is provided as an option, only the specified columns will be shown. + * + * > The column titles are extracted directly from the grid header's title text, so columns not defined in the grid header will not be displayed. To show columns not in the grid header within the detailed popup, add the columns to the grid, initialize it, and then use the hide method to hide the added columns in the grid while keeping them visible in the popup. + * + * > When used in conjunction with the fixedcol option, the column hiding/showing feature might not work correctly. + * + * > The column title information in the detailed popup is extracted based on the id values of the elements in the td inside the tbody. If there are two or more elements with id attributes inside a td or if the composition of elements in the grid header and body is too different, the extraction may not be accurate. In this case, declare the column name to be extracted in the data-id attribute of the th elements to ensure it works correctly. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + more?: boolean | string[]; + /** + * If set to false, disables validation of input values when the input element loses focus. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + validate?: boolean; + /** + * If set to true, the data's HTML will be applied when binding data. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + html?: boolean; + /** + * If set to true, when the add method is called, the row element and row data are added to the beginning of the list. + * + * > When the addTop option is set to false, data synchronization issues can occur, so the settings for the scrollPaging.size and createRowDelay options are forced to 0. + * This may reduce data binding performance. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + addTop?: boolean; + /** + * If set to true, the row added when the add method is called will be automatically selected. + * + * > The select option must be set to true. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + addSelect?: boolean; + /** + * When set to true, you can filter the data based on the selected column. + * + * > If the filter option is set to false, you can activate the filtering function for each column by declaring the attribute `data-filter="true"` in the `th` element. + * + * > The information for the filtered column is based on the value of the `id` of `td` elements in the `tbody` or elements within the `td`. However, if there are two or more elements with the `id` attribute inside a `td` in the `tbody` or if the structure of the grid header and body differs greatly, filtering may not work properly. + * In this case, declare the column name to be filtered in the `data-id` attribute of the `th` element to make it work correctly. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + filter?: boolean; + /** + * When set to true, you can adjust the width of the column. + * + * > If you specify the width of cells using the `col` tag in the `colgroup`, and if the `resizable` option is true, the grid transfers the width value defined in the `col` tag to the `thead`'s `th` and removes the `colgroup` tag during initialization. Therefore, it is recommended to set column widths in the `thead`'s `th` instead of using the `col` tag when using the column resizing functionality. + * + * > The column resizing function may not work properly when there is a `colspan` attribute in a `th` in the `thead`. + * + * > If the grid's layout breaks while resizing columns, please adjust the values of the options `misc.resizableCorrectionWidth`, `misc.resizableLastCellCorrectionWidth`, `misc.resizeBarCorrectionLeft`, and `misc.resizeBarCorrectionHeight`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + resizable?: boolean; + /** + * When set to true, you can adjust the height of the grid body. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + vResizable?: boolean; + /** + * When set to true, you can sort the data based on the selected column. + * + * > The information for the sorted column is based on the value of the `id` of `td` elements in the `tbody` or elements within the `td`. However, if there are two or more elements with the `id` attribute inside a `td` in the `tbody` or if the structure of the grid header and body differs greatly, sorting may not work properly. + * In this case, declare the column name to be sorted in the `data-id` attribute of the `th` element to make it work correctly. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + sortable?: boolean; + /** + * If set to true, disables the browser's window scroll while scrolling with the mouse wheel over the data list element. + * + * Prevents the browser's default behavior of scrolling up or down the browser window when the data list element is scrolled to the top or bottom. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + windowScrollLock?: boolean; + /** + * If set to true, the onSelect event is triggered upon selecting a row (single-row selection), + * and the class attribute of the row element (tbody) toggles a value prefixed with `grid_selected__`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + select?: boolean; + /** + * If set to false, the selected row will not be deselected even if it is reselected while the select option is true. + * + * > The unselect option will not be applied if the multiselect option is true. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + unselect?: boolean; + /** + * If set to true, the onSelect event is triggered upon selecting a row (multi-row selection), + * and the class attribute of the row element (tbody) toggles a value prefixed with `grid_selected__`. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + multiselect?: boolean; + /** + * Specifies the input[type=checkbox] element to select all checkboxes designated by the `checkAllTarget` option. + * + * > The specified element must be in the `thead` section. + * + * > It is specified using a jQuery selector, and the context of the selector is automatically set to the header element (`thead`) of the grid. + * + * > This option only checks the checkbox without triggering the click event. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + checkAll?: JQuery.Selector; + /** + * Specifies the input[type=checkbox] element for selecting multiple rows in the grid. + * + * The specified element can be used to get or select the indices of rows selected using the `check` function. + * + * > The `checkSingleTarget` element must reside within the `tbody` section. + * + * > It is specified using a jQuery selector, and the context of the selector is automatically set to the row element (`tbody`) of the grid. + * + * > Only one of the `checkAllTarget` or `checkSingleTarget` options can be used. + * + * > If an `id` attribute is set on the checkbox and bound to data, it might not work correctly. Please use it only for retrieving the indices of selected rows. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + checkAllTarget?: JQuery.Selector; + /** + * Specifies the input[type=checkbox] element for single row selection in the grid. + * + * The specified element can be used to get or select the indices of rows selected using the `check` function. + * + * > The `checkSingleTarget` element must reside within the `tbody` section. + * + * > It is specified using a jQuery selector, and the context of the selector is automatically set to the row element (`tbody`) of the grid. + * + * > Only one of the `checkAllTarget` or `checkSingleTarget` options can be used. + * + * > If an `id` attribute is set on the checkbox and bound to data, it might not work correctly. Please use it only for retrieving the indices of selected rows. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + checkSingleTarget?: JQuery.Selector; + /** + * When set to true, the "list_hover__" class attribute is added to the row element when the mouse hovers over it and is removed when the mouse moves out. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + hover?: boolean; + /** + * When set to true, the revert functionality is enabled, and the `revert` method can be used. + * + * > Enabling the revert functionality stores the initially bound data in memory, which increases memory usage. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + revert?: boolean; + /** + * If set to a value greater than or equal to 1, each row of the grid is created separately during binding. + * At this point, you can configure the time interval until the next row is created. + * + * > If set to 0, all rows are created at once, which may cause the browser to freeze during data binding. + * + * @default 1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + createRowDelay?: number; + /** + * Specifies the number of rows to bind at once during scroll paging. + * + * For header-fixed lists, the scroll paging functionality is enabled by default, and setting the value to 0 will disable scroll paging. + * + * The `size` option value should be specified as a subproperty of the `scrollPaging` option object as follows: + * ``` + * ... + * scrollPaging: { + * size: 50 + * } + * ... + * ``` + * > Setting it too small may result in no scroll bar being created, and data may not be fully displayed. + * Ensure you specify a value large enough so that rows can exceed the grid body. + * + * > If set too high, it might strain the browser during scroll paging. If the grid contains input elements or images, it is recommended to set it to 100 or below; otherwise, 1000 or below is advisable. + * + * @default { idx: 0, size: 100 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + scrollPaging?: { + idx?: number; + size?: number; + }; + /** + * Specifies format rules as an object type instead of the `data-format` attribute of the target element. + * + * > Refer to the description of the `rules` parameter of the [Formatter constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0301.html&tab=html/naturaljs/refr/refr030103.html) to write the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + fRules?: ND.FormatRuleObject | null; + /** + * Specifies validation rules as an object type instead of the `data-validate` attribute of the target element. + * + * > Refer to the description of the `rules` parameter of the [Validator constructor](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0302.html&tab=html/naturaljs/refr/refr030203.html) to write the option object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + vRules?: ND.ValidationRuleObject | null; + /** + * If set to false, the `bind` method won't automatically scroll to the appended row when the "append" option is specified as the second argument. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + appendScroll?: boolean; + /** + * If set to false, the `add` method won't scroll to the newly added row. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + addScroll?: boolean; + /** + * If set to false, the `select` method won't scroll to the last selected row. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + selectScroll?: boolean; + /** + * If set to false, the `check` method won't scroll to the last checked row. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + checkScroll?: boolean; + /** + * If set to false, the `validate` method won't scroll to the last row that failed validation. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + validateScroll?: boolean; + /** + * Improves performance slightly by caching the search for elements if set to true. + * + * @default true + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + cache?: boolean; + /** + * Prevents conflicts between events already bound to input elements and component events such as format, validate, and dataSync before the component is initialized, if set to true. + * + * > Please set it to true if the format does not work correctly, the bound data is not handled as intended, or unexpected errors occur. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + tpBind?: boolean; + /** + * Allows pasting (Ctrl + V) data copied from Excel into the grid if set to true. + * + * > In addition to data copied from Excel, you can also paste text that separates rows with the Enter key (\n) and columns with the Tab key (\t). + * + * > Based on the selected cell where the text input cursor is displayed, the values are pasted in order into elements that have an `id` attribute. If the element is not an input element but still has an `id` attribute, the cell value is updated. + * + * > Elements with readonly or disabled attributes do not accept any values. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + pastiable?: boolean; + /** + * Defines an event handler that is executed before data is bound to the row element created when bind or add is called. + * ``` + * rowHandlerBeforeBind: function(rowIdx, rowEle, rowData) { + * // this: Grid instance + * // rowIdx: Index of the created row + * // rowEle: Created row element (li) + * // rowData: Data of the row to be created + * } + * ``` + * > The `rowHandlerBeforeBind` event handler is executed every time a row element is created. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + rowHandlerBeforeBind?: NU.EventHandlers.Grid.RowHandlerBeforeBind | null; + /** + * Defines an event handler that is executed after data is bound to the row element created when bind or add is called. + * ``` + * rowHandler: function(rowIdx, rowEle, rowData) { + * // this: Grid instance + * // rowIdx: Index of the created row + * // rowEle: Created row element (li) + * // rowData: Data of the created row + * } + * ``` + * > The `rowHandler` event handler is executed every time a row element is created. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + rowHandler?: NU.EventHandlers.Grid.RowHandler | null; + /** + * Defines an event handler that is executed before a row is selected. + * ``` + * onBeforeSelect: function(rowIdx, rowEle, rowData, beforeRowIdx, e) { + * // this: Grid instance + * // rowIdx: Index of the selected row + * // rowEle: Element (li) of the selected row + * // rowData: Data of the selected row + * // beforeRowIdx: Index of the row that was previously selected + * // e: Click event object + * } + * ``` + * > If the `onBeforeSelect` event handler returns `false`, the row selection is canceled. In this case, the `onSelect` event is executed under the same condition as the `onBeforeSelect` event. + * + * > Executes only when the `select` or `multiselect` option is set to `true`. + * + * > If the `unselect` option is set to `false`, the `rowIdx` argument returns `-1` when selection is canceled, and the index of the selected row when a row is selected. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + onBeforeSelect?: NU.EventHandlers.Grid.OnBeforeSelect | null; + /** + * Defines an event handler that is executed after a row is selected. + * ``` + * onSelect: function(rowIdx, rowEle, rowData, beforeRowIdx, e) { + * // this: Grid instance + * // rowIdx: Index of the selected row + * // rowEle: Element (li) of the selected row + * // rowData: Data of the selected row + * // beforeRowIdx: Index of the row that was previously selected + * // e: Click event object + * } + * ``` + * > Executes only when the `select` or `multiselect` option is set to `true`. + * + * > If the `unselect` option is set to `false`, the `rowIdx` argument returns `-1` when selection is canceled, and the index of the selected row when a row is selected. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + onSelect?: NU.EventHandlers.Grid.OnSelect | null; + /** + * Defines an event handler that is executed after data binding is completed. + * ``` + * onBind: function(context, data, isFirstPage, isLastPage) { + * // this: Grid instance + * // context: Context element + * // data: Bound data + * // isFirstPage: Whether it is the first page in scroll paging (returns `true` if scroll paging is not enabled) + * // isLastPage: Whether it is the last page in scroll paging (returns `true` if scroll paging is not enabled) + * } + * ``` + * > Executes whenever paginated data is bound if scroll paging is enabled. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + onBind?: NU.EventHandlers.Grid.OnBind | null; + /** + * Miscellaneous constants. + * + * @default { + * resizableCorrectionWidth: 0, + * resizableLastCellCorrectionWidth: 0, + * resizeBarCorrectionLeft: 0, + * resizeBarCorrectionHeight: 0, + * fixedcolHeadMarginTop: 0, + * fixedcolHeadMarginLeft: 0, + * fixedcolHeadHeight: 0, + * fixedcolBodyMarginTop: 0, + * fixedcolBodyMarginLeft: 0, + * fixedcolBodyBindHeight: 0, + * fixedcolBodyAddHeight: 1, + * fixedcolRootContainer: null + * } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + misc?: NU.Options.GridMisc; + /** + * Variables used internally. + * + * @default -1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0409.html&tab=html/naturaljs/refr/refr040904.html + */ + currMoveToRow?: number; + } + + interface CurrPageNavInfo { + /** + * Current page number. + * + * @default 1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + pageNo: number; + /** + * Row count per page. + * + * @default 10 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + countPerPage: number; + /** + * Page count per page set. + * + * @default 10 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + countPerPageSet: number; + /** + * Total row count. + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + totalCount: number; + /** + * Total page count. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + pageCount: number; + /** + * Total page set count. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + pageSetCount: number; + /** + * Current page set number. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + currSelPageSet: number; + /** + * First page number in the current page set. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + startPage: number; + /** + * Last page number in the current page set. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + endPage: number; + /** + * First row index on the selected page. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + startRowIndex: number; + /** + * First row number of the selected page. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + startRowNum: number; + /** + * Last row index on the selected page. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + endRowIndex: number; + /** + * Last row number of the selected page. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + endRowNum: number; + } + interface Pagination { + /** + * Specifies the data to be bound to the Pagination. + * + * > If the `data` option is specified, the `totalCount` value is automatically calculated and set. Therefore, you must not set the `totalCount` value to 0 or configure it manually. + * + * > In case of paging via the database, do not specify the `data` option. Instead, fetch and configure only the `totalCount` value from the server. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + data?: NJS; + /** + * Specifies the context element to which Pagination will be applied. + * + * The context element for Pagination must use `div` tags containing `ul` and `li` tags. + * + * - First page, Last page, Previous page, Next page: + * - Write `ul` tags with `li` tags containing `a` tags. + * - Separate `ul` tags for first/previous and last/next page elements. + * - If related tags for first and last page links are not written, the corresponding functionalities are disabled. + * - Page index: + * - Write `ul` tags with `li` tags containing `a` tags. + * ``` + *
    + * + *
      + *
    • 1
    • + *
    + * + *
    + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + context?: NJS; + /** + * Total row count. + * + * > In case of paging via the database, do not specify the `data` option. Instead, fetch and configure only the `totalCount` value from the server. + * + * @default 0 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + totalCount?: number; + /** + * Row count per page. + * + * @default 10 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + countPerPage?: number; + /** + * Page count per page set. + * + * @default 10 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + countPerPageSet?: number; + /** + * Sets the initial page number to display after Pagination is initialized. + * + * @default 1 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + pageNo?: number; + /** + * Defines the event handler to execute when a page is switched. + * ``` + * onChange: function(pageNo, selEle, selData, currPageNavInfo) { + * // this: Pagination instance + * // pageNo: Page number + * // selEle: Selected page navigation element + * // selData: Selected page's data list + * // currPageNavInfo: Current page navigation info + * } + * ``` + * `currPageNavInfo` Object Information: + * - pageNo: Current page number. + * - countPerPage: Row count per page. + * - countPerPageSet: Page count per page set. + * - currSelPageSet: Current page set number. + * - pageCount: Total page count. + * - pageSetCount: Total page set count. + * - totalCount: Total row count. + * - startPage: First page number in the current page set. + * - startRowIndex: First row index on the selected page. + * - startRowNum: First row number of the selected page. + * - endPage: Last page number in the current page set. + * - endRowIndex: Last row index on the selected page. + * - endRowNum: Last row number of the selected page. + * + * For database paging, fetch the `totalCount` value from the server first, then pass the `currPageNavInfo` argument of the `onChange` event handler to the server to fetch paged data. + * + * Bind the paged data to the Grid or List whenever the page changes in the `onChange` event. + * ``` + * var grid = N(data).grid(".grid-context"); + * + * N.comm("getTotalCnt.json").submit(function(data){ + * N(data).pagination({ + * context: ".pagination-context", + * totalCount: data.totalCount, + * onChange: function(pageNo, selEle, selData, currPageNavInfo) { + * N(currPageNavInfo).comm("getPagedDataList.json").submit(function(data){ + * grid.bind(selData); + * }); + * } + * }).bind(); + * }); + * ``` + * > If `blockOnChangeWhenBind` is set to `true`, the event is executed only when the paging buttons are clicked. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + onChange?: NU.EventHandlers.Pagination.OnChange | null; + /** + * When set to `true`, the `onChange` event is not executed when the bind method is called. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + blockOnChangeWhenBind?: boolean; + /** + * A variable assigned to hold the paging state information object. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0410.html&tab=html/naturaljs/refr/refr041004.html + */ + currPageNavInfo?: NU.Options.CurrPageNavInfo | null; + } + + interface Tree { + /** + * Specifies the data to bind to the Tree. + * + * @default undefined + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + data?: NJS; + /** + * Specifies the element to apply the Tree. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + context?: NJS; + /** + * Specifies the property name of the data to be displayed as the node name. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + key?: string; + /** + * Specifies the property name of the data to be set as the node value. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + val?: string; + /** + * Specifies the property name of the data to be set as the node level. + * + * > The level option is not mandatory, but specifying it enhances the Tree rendering speed. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + level?: string; + /** + * Specifies the property name of the data to be set as the parent node value. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + parent?: string; + /** + * When set to `true`, folder nodes can be selected. + * + * > If the option is `true`, users can click the [+] icon to expand the folder, and clicking on the node name will select it. + * If the option is `false`, clicking on a folder node name will not select the folder but only expand it. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + folderSelectable?: boolean; + /** + * If set to true, checkboxes will be added before the node name. + * + * > When a checkbox is checked, all child nodes are also checked, and the `onCheck` event handler is executed. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + checkbox?: boolean; + /** + * Defines the event handler to be executed when a node is selected. + * ``` + * onSelect: function(selNodeIndex, selNodeEle, selNodeData) { + * // this: Tree instance + * // selNodeIndex: The index of the selected node + * // selNodeEle: The element of the selected node + * // selNodeData: The row data of the selected node + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + onSelect?: NU.EventHandlers.Tree.OnSelect | null; + /** + * Defines the event handler to be executed when a node is checked. + * + * ``` + * onCheck: function(selNodeIndex, selNodeEle, selNodeData + * , checkedElesIndexes, checkedEles, checkedElesData + * , checkFlag) { + * // this: Tree instance + * // selNodeIndex: The index of the selected node + * // selNodeEle: The element of the selected node + * // selNodeData: The row data of the selected node + * // checkedElesIndexes: The indexes of the checked nodes + * // selNodeEle: The elements of the checked nodes + * // selNodeData: The row data of the checked nodes + * // checkFlag: Whether the checkbox was checked + * } + * ``` + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0411.html&tab=html/naturaljs/refr/refr041104.html + */ + onCheck?: NU.EventHandlers.Tree.OnCheck | null; + } + } + + namespace EventHandlers { + namespace Alert { + interface Width { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): number; + } + interface Height { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): number; + } + interface OnOk { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): undefined | 0; + } + interface OnCancel { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): undefined | 0; + } + interface OnBeforeShow { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnShow { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnBeforeHide { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnHide { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnBeforeRemove { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnRemove { + (this: NU.Alert, msgContext?: NJS, msgContents?: NJS): void; + } + } + namespace Button { + interface OnBeforeCreate { + (this: NU.Button, context: NJS, opts: NU.Options.Button): void; + } + interface OnCreate { + (this: NU.Button, context: NJS, opts: NU.Options.Button): void; + } + } + namespace Datepicker { + interface OnChangeYear { + (this: NU.Datepicker, context: NJS, selYearStr: string, e: JQuery.Event): void; + } + interface OnChangeMonth { + ( + this: NU.Datepicker, + context: NJS, + selMonthStr: string, + selYearStr: string, + e: JQuery.Event, + ): void; + } + interface OnSelect { + (this: NU.Datepicker, context: NJS, selDate: NC.Date, monthonly: boolean): void; + } + interface OnBeforeShow { + (this: NU.Datepicker, context: NJS, contents: NJS): undefined | false; + } + interface OnShow { + (this: NU.Datepicker, context: NJS, contents: NJS): void; + } + interface OnBeforeHide { + (this: NU.Datepicker, context: NJS, contents: NJS): void; + } + interface OnHide { + (this: NU.Datepicker, context: NJS): void; + } + } + namespace Popup { + interface Width { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): number; + } + interface Height { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): number; + } + interface OnOk { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): undefined | 0; + } + interface OnCancel { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): undefined | 0; + } + interface OnBeforeShow { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnShow { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnBeforeHide { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnHide { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnBeforeRemove { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnRemove { + (this: NU.Popup, msgContext?: NJS, msgContents?: NJS): void; + } + interface OnOpen { + (this: NA.Objects.Controller.Object, onOpenData?: any): void; + } + interface OnClose { + (this: NU.Popup, onCloseData?: any): void; + } + interface OnLoad { + (this: NU.Popup, cont: NA.Objects.Controller.Object): void; + } + } + namespace Tab { + interface OnOpen { + (this: NA.Objects.Controller.Object, onOpenData?: any): void; + } + interface OnActive { + ( + this: NU.Tab, + selTabIdx: number, + selTabEle: NJS, + selContentEle: NJS, + links: NJS, + contents: NJS, + ): void; + } + interface OnLoad { + ( + this: NU.Tab, + selTabIdx: number, + selTabEle: NJS, + selContentEle: NJS, + cont: NA.Objects.Controller.Object, + ): void; + } + } + namespace Form { + interface OnBeforeBindValue { + ( + this: NU.Form, + ele: NJS, + val: NC.Primitive | NC.Primitive[], + action: "bind" | "val", + ): NC.Primitive | NC.Primitive[]; + } + interface OnBindValue { + ( + this: NU.Form, + ele: NJS, + val: NC.Primitive | NC.Primitive[], + action: "bind" | "val", + ): void; + } + interface OnBeforeBind { + (this: NU.Form, context: NJS, vals: NC.JSONObject): void; + } + interface OnBind { + (this: NU.Form, context: NJS, vals: NC.JSONObject): void; + } + } + namespace List { + interface RowHandlerBeforeBind { + (this: NU.List, rowIdx: number, rowEle: NJS, rowData: NC.JSONObject): void; + } + interface RowHandler { + (this: NU.List, rowIdx: number, rowEle: NJS, rowData: NC.JSONObject): void; + } + interface OnBeforeSelect { + ( + this: NU.List, + rowIdx: number, + rowEle: NJS, + rowData: NJS, + beforeRowIdx: number, + e: JQuery.Event, + ): undefined | false; + } + interface OnSelect { + ( + this: NU.List, + rowIdx: number, + rowEle: NJS, + rowData: NJS, + beforeRowIdx: number, + e: JQuery.Event, + ): void; + } + interface OnBind { + ( + this: NU.List, + context: NJS, + data: NJS, + isFirstPage: boolean, + isLastPage: boolean, + ): void; + } + } + namespace Grid { + interface RowHandlerBeforeBind { + (this: NU.Grid, rowIdx: number, rowEle: NJS, rowData: NC.JSONObject): void; + } + interface RowHandler { + (this: NU.Grid, rowIdx: number, rowEle: NJS, rowData: NC.JSONObject): void; + } + interface OnBeforeSelect { + ( + this: NU.Grid, + rowIdx: number, + rowEle: NJS, + rowData: NJS, + beforeRowIdx: number, + e: JQuery.Event, + ): undefined | false; + } + interface OnSelect { + ( + this: NU.Grid, + rowIdx: number, + rowEle: NJS, + rowData: NJS, + beforeRowIdx: number, + e: JQuery.Event, + ): void; + } + interface OnBind { + ( + this: NU.Grid, + context: NJS, + data: NJS, + isFirstPage: boolean, + isLastPage: boolean, + ): void; + } + } + namespace Pagination { + interface OnChange { + ( + this: NU.Pagination, + pageNo: number, + selEle: NJS, + selData: NC.JSONObject[], + currPageNavInfo: NU.Options.CurrPageNavInfo, + ): void; + } + } + namespace Tree { + interface OnSelect { + (this: NU.Tree, selNodeIndex: number, selNodeEle: NJS, selNodeData: NC.JSONObject): void; + } + interface OnCheck { + ( + this: NU.Tree, + selNodeIndex: number, + selNodeEle: NJS, + selNodeData: NC.JSONObject, + checkedElesIndexes: number[], + checkedEles: NJS, + checkedElesData: NC.JSONObject[], + checkFlag: boolean, + ): void; + } + } + } + + namespace Callbacks { + namespace Popup { + interface LoadContent { + (this: NU.Popup, cont?: NA.Objects.Controller.Object, context?: NJS): void; + } + } + namespace Tab { + interface LoadContent { + (this: NU.Tab, cont?: NA.Objects.Controller.Object, context?: NJS): void; + } + } + } + + namespace Objects { + namespace Grid { + interface TableMap { + colgroup: HTMLElement[][]; + thead: HTMLTableCellElement[][]; + tbody: HTMLTableCellElement[][]; + tfoot: HTMLTableCellElement[][]; + } + } + + namespace Pagination { + interface LinkEles { + body: HTMLElement[][]; + page: HTMLElement[][]; + first: HTMLElement[][]; + prev: HTMLElement[][]; + next: HTMLElement[][]; + last: HTMLElement[][]; + } + } + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.ui.shell.d.ts b/src/main/resources/static/js/natural_js/@types/natural.ui.shell.d.ts new file mode 100644 index 0000000..379e647 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.ui.shell.d.ts @@ -0,0 +1,304 @@ +declare class NUS { + /** + * Create an object instance of Notify with the N() function. + * ``` + * var notify = N(position).notify(opts); + * ``` + * + * @param {NUS.Options.Notify} [opts] - Specifies the initialization option object for the component. + * @returns {NUS.Notify} An instance of a Notify object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050103.html + */ + notify(this: NJS, opts?: NUS.Options.Notify): NUS.Notify; + /** + * Create an object instance of Documents with the N() function. + * ``` + * var docs = N(context).docs(opts); + * ``` + * + * @param {NUS.Options.Documents} [opts] - Specifies the initialization option object for the component. + * @returns {NUS.Documents} An instance of a Documents object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050202.html + */ + docs(this: NJS, opts?: NUS.Options.Documents): NUS.Documents; + + static notify: { + /** + * Creates a new Notify instance. + * ``` + * var notify = new N.notify(position, opts); + * ``` + * + * @param {NUS.Options.NotifyPosition} position - Set where the message will appear. + * > It can be specified with the left / right / top / bottom properties of the options object. + * @param {NUS.Options.Notify} [opts] - Specifies the initialization option object for the component. + * @returns {NUS.Notify} An instance of a Notify object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050103.html + */ + new(position: NUS.Options.NotifyPosition, opts?: NUS.Options.Notify): NUS.Notify; + add(msg: string, url?: string): void; + wrapEle(): void; + }; + + static docs: { + /** + * Creates a new Documents instance. + * ``` + * var docs = new N.docs(context, opts); + * ``` + * + * @param {NJS} obj - The context element to which the Documents will be applied. + * @param {NUS.Options.Documents} [opts] - Specifies the initialization option object for the component. + * @returns {NUS.Documents} An instance of a Documents object, configured according to the provided options. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050202.html + */ + new(obj: NJS, opts?: NUS.Options.Documents): NUS.Documents; + createLoadIndicator(): NUS.Documents; + updateLoadIndicator(entireLoadRequestCnt: number, entireLoadRequestMaxCnt: number): NUS.Documents; + removeLoadIndicator(): NUS.Documents; + errorLoadIndicator(): NUS.Documents; + wrapEle(): void; + wrapScroll(): void; + clearScrollPosition(tabEle: number | NJS, isActive?: boolean): void; + loadContent(docOpts: NUS.Options.DocOpts, callback: NUS.Callbacks.Documents.LoadContent): void; + closeBtnControl(): void; + inactivateTab(): void; + activateTab(docId_: string, isFromDocsTabList_?: boolean, isNotLoaded_?: boolean): void; + showTabContents(docId_: string): boolean | undefined; + hideTabContents(docId_: string): void; + remove(targetTabEle: NJS): void; + }; +} + +declare namespace NUS { + interface Notify { + options: NUS.Options.Notify; + /** + * Returns the message container element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050105.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Adds a notification message, optionally with a URL link. + * + * @param {string} msg - The notification message to be added. + * @param {string} [url] - An optional URL associated with the notification. + * @return {NUS.Notify} Returns the `Notify` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050105.html + */ + add(msg: string, url?: string): NUS.Notify; + /** + * Removes the specified message dialog element(s) from the DOM. + * + * @param {NJS} msgBoxEle - The element(s) representing the message box to be removed. + * @return {NUS.Notify} Returns the `Notify` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050105.html + */ + remove(msgBoxEle: NJS): NUS.Notify; + } + + interface Documents { + options: NUS.Options.Documents; + request: DocumentsRequest; + /** + * Returns the context element. + * + * @param {JQuery.Selector} [sel] - An optional jQuery selector to refine the context. + * @return {NJS} The context element or the element selected in the context is returned. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + context(sel?: JQuery.Selector): NJS; + /** + * Add new Documents tab content. + * + * @param {string} docId - The unique identifier for the document page to be added. + * @param {string} docNm - The name of the document page to be added. + * @param {NUS.Options.DocOpts} docOpts - Enter options that apply only to the page being added. + * ``` + * var docOpts = { + * url: "url", // document URL + * urlSync: true, // The response will be blocked if location.href when requesting to the server and location.href when receiving a response from the server are different. + * docId: docId, // document id + * docNm: docNm, // document name + * onBeforeLoad: function(docId, target) { + * // onBeforeLoad event that applies only to the document being added. + * + * // docId: document id + * // target: Element to put loaded content + * + * var doc = this.doc(docId); // get document info + * var cont = this.cont(docId); // get document's Controller object + * var view = cont.view; + * var request = cont.request; + * }, + * onLoad: function(docId) { + * // onLoad event that applies only to the document being added. + * }, + * onBeforeActive: function(docId) { + * // onBeforeActive event that applies only to the document being added. + * }, + * onActive: function(docId) { + * // onActive event that applies only to the document being added. + * }, + * onBeforeInactive: function(docId) { + * // onBeforeInactive event that applies only to the document being added. + * }, + * onInactive: function(docId) { + * // onInactive event that applies only to the document being added. + * }, + * onBeforeRemoveState: function(docId) { + * // onBeforeRemoveState event that applies only to the document being added. + * }, + * onRemoveState: function(docId) { + * // onRemoveState event that applies only to the document being added. + * }, + * onBeforeRemove: function(docId) { + * // onBeforeRemove event that applies only to the document being added. + * }, + * onRemove: function(docId) { + * // onRemove event that applies only to the document being added. + * }, + * stateless: false // Whether to maintain the state of tab content + * } + * ``` + * > Events set here are executed after the global event is executed. + * @return {NUS.Documents} Returns the `Documents` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + add(docId: string, docNm: string, docOpts: NUS.Options.DocOpts): NUS.Documents; + /** + * Activates the content of the specified tab. + * + * @param {string} docId - The unique identifier for the document to activate. + * @param {boolean} [isFromDocsTabList] - Arguments used inside the component. + * @param {boolean} [isNotLoaded] - Arguments used inside the component. + * @return {NUS.Documents} Returns the `Documents` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + active(docId: string, isFromDocsTabList?: boolean, isNotLoaded?: boolean): NUS.Documents; + /** + * Removes the state of the specified tab content. + * + * @param {string | NUS.Callbacks.Documents.RemoveState} [docId] - Unique identifier of the document whose status should be removed. When you enter a function, it is processed as a callback argument value. + * @param {NUS.Callbacks.Documents.RemoveState} [callback] - Specify a callback function to be executed when you click the OK button in the warning window that appears when the maximum number of state maintenance is exceeded. + * @return {NUS.Documents} Returns the `Documents` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + removeState( + docId?: string | NUS.Callbacks.Documents.RemoveState, + callback?: NUS.Callbacks.Documents.RemoveState, + ): NUS.Documents; + /** + * Removes the contents of the specified tab. + * + * @param {string} docId - The unique identifier of the document to be removed. + * @param {boolean} [unconditional] - Specifies whether to immediately remove the page without prompting even if there is modified data. + * @return {NUS.Documents} Returns the `Documents` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + remove(docId: string, unconditional?: boolean): NUS.Documents; + /** + * Retrieves option information set for all currently open tab contents. + * + * @return {NUS.Options.DocsObject} + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + doc(): NUS.Options.DocsObject; + /** + * Retrieves option information set for the specified tab content. + * + * @param {string} docId - The unique identifier of the document to retrieve option information. + * @return {NUS.Options.DocOpts} Option information set for the specified tab content + */ + doc(docId: string): NUS.Options.DocOpts; + /** + * Retrieves the controller object for the given document ID. + * + * @param {string} docId - The unique identifier of the document. + * @return {NA.Objects.Controller.Object} The controller object associated with the document ID. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + cont(docId: string): NA.Objects.Controller.Object; + /** + * Reloads a document content by its identifier and executes a callback function upon completion. + * > If you do not specify a value with the `request.attr` function before executing the reload function, the value of the request object before reload will be maintained even after reloading. + * + * @param {string} docId - The unique identifier of the document to be reloaded. + * @param {NUS.Callbacks.Documents.Reload} [callback] - The callback function to execute after the document is reloaded. + * `page's HTML code string` and `Communicator.request` object are input as arguments to the callback function. + * ``` + * docsInstance.reload("docId", function(html, request) { + * N.log(html, request); + * }); + * ``` + * @return {NUS.Documents} Returns the `Documents` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + reload(docId: string, callback?: NUS.Callbacks.Documents.Reload): NUS.Documents; + } + + interface DocumentsRequest extends Documents { + /** + * Set the parameters to be passed to the page to be loaded. + * + * @param {String} name - Parameter name + * @param {any} [obj] - Parameter data + * + * @return {DocumentsRequest} Returns the `DocumentsRequest` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050204.html + */ + attr(name: string, obj?: any): DocumentsRequest; + removeAttr(name: string): DocumentsRequest; + /** + * Extracts the GET parameter values from the browser's URL. + * + * @return {object} Returns all GET parameters as an object. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050204.html + */ + param(): object; + /** + * Extracts the value of a GET parameter from the URL in the browser. + * + * @param {string} name - The key of the parameter to be retrieved. + * @return {string} The value of the parameter + */ + param(name: string): string; + /** + * Retrieves the current request options. + * + * @return {DocumentsRequest} Returns the `DocumentsRequest` instance for chaining. + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050204.html + */ + get(): DocumentsRequest; + /** + * Retrieves for the value specified as a key in request options. + * + * @param {string} key - Property name of request options + * @return {any} Value corresponding to the key value specified in request options + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050204.html + */ + get(key: string): any; + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural.ui.shell.misc.d.ts b/src/main/resources/static/js/natural_js/@types/natural.ui.shell.misc.d.ts new file mode 100644 index 0000000..44a2986 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural.ui.shell.misc.d.ts @@ -0,0 +1,610 @@ +declare namespace NUS { + namespace Options { + interface NotifyPosition { + left?: number; + right?: number; + top?: number; + bottom?: number; + } + interface Notify { + /** + * Set where the message will appear. + * + * It can be specified with the left / right / top / bottom properties of the options object. + * + * @default { top: 10, right: 10 } + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + position?: NotifyPosition; + /** + * Specifies a global message container that contains message elements. + * + * @default N("body") + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + container?: NJS; + /** + * An instance of the element that displays the message is assigned. + * + * @default undefined + */ + context?: NJS; + /** + * Set the time in seconds for the message to be displayed. + * + * @default 7 + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + displayTime?: number; + /** + * If set to true, the message dialog will always appear on top. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + alwaysOnTop?: boolean; + /** + * If set to true, the HTML Code of the message will be applied. + * + * @default false + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + html?: boolean; + /** + * When applying the alwaysOnTop option, specify target elements for calculating the top z-index. + * + * > Specified with jQuery selector syntax. + * + * > When N.notify related elements are obscured by other elements, please add a selector for the element that is being obscured. + * + * @default "div, span, ul, p, nav, article, section, header, footer, aside" + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0501.html&tab=html/naturaljs/refr/refr050104.html + */ + alwaysOnTopCalcTarget?: string; + } + + interface DocsObject { + [key: string]: DocOpts; + } + /** + * This is an option that can be set whenever tab content is added to the Documents component. + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050205.html + */ + interface DocOpts { + /** + * Document id + */ + docId?: string; + /** + * Document name + */ + docNm?: string; + /** + * Document url + */ + url: string; + /** + * Specifies whether to block responses when the `location.href` when requesting to the server is different from the `location.href` when receiving the response from the server. + * + * @default true + */ + urlSync?: boolean; + /** + * onBeforeLoad event that applies only to the document being added. + * + * @default null + */ + onBeforeLoad?: EventHandlers.Documents.OnBeforeLoad | null; + /** + * onLoad event that applies only to the document being added. + * + * @default null + */ + onLoad?: EventHandlers.Documents.OnLoad | null; + /** + * onBeforeActive event that applies only to the document being added. + * + * @default null + */ + onBeforeActive?: EventHandlers.Documents.OnBeforeActive | null; + /** + * onActive event that applies only to the document being added. + * + * @default null + */ + onActive?: EventHandlers.Documents.OnActive | null; + /** + * onBeforeInactive event that applies only to the document being added. + * + * @default null + */ + onBeforeInactive?: EventHandlers.Documents.OnBeforeInactive | null; + /** + * onInactive event that applies only to the document being added. + * + * @default null + */ + onInactive?: EventHandlers.Documents.OnInactive | null; + /** + * onBeforeRemoveState event that applies only to the document being added. + * + * @default null + */ + onBeforeRemoveState?: EventHandlers.Documents.OnBeforeRemoveState | null; + /** + * onRemoveState event that applies only to the document being added. + * + * @default null + */ + onRemoveState?: EventHandlers.Documents.OnRemoveState | null; + /** + * onBeforeRemove event that applies only to the document being added. + * + * @default null + */ + onBeforeRemove?: EventHandlers.Documents.OnBeforeRemove | null; + /** + * onRemove event that applies only to the document being added. + * + * @default null + */ + onRemove?: EventHandlers.Documents.OnRemove | null; + /** + * Whether to maintain the state of tab content + * + * @default false + */ + stateless?: boolean; + } + interface Documents { + /** + * Specifies the element to apply N.docs to. + * + * @default undefined + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + context?: NJS; + /** + * If set to true, N.docs are created in the tab-based Multiple-Document Interface(MDI) format, and if set to false, N.docs are created in the general Single-Document Interface(SDI) format. + * - true: Displays tab and page content. + * - false: Shows only one page content and no tabs. + * + * @default true + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + multi?: boolean; + /** + * If the multi option is true, you can set the maximum number of persistent tab contents to prevent your web browser from slowing down each time additional tab content is opened. + * > When opening new content, if the number of open tab contents exceeds the maximum number of state retentions, the state of the content of the first opened tab is removed, and clicking on the tab from which state retention has been removed will reload the content. + * + * > A value of 0 does not limit the maximum number of stateful content. + * + * @default 0 + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + maxStateful?: number; + /** + * If the multi option is true, you can set a maximum number of tab contents to prevent your web browser from slowing down each time additional tab content is opened. + * + * > When opening new content, if the number of open tab contents exceeds the maximum number of tabs, no more tab contents can be opened. To open new content, you must close one of your existing tabs. + * + * > A value of 0 does not limit the maximum number of stateful content. + * + * @default 0 + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + maxTabs?: number; + /** + * If set to true, new tabs will be added last when you call the add method. + * + * @default false + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + addLast?: boolean; + /** + * If set to true, tabs can be scrolled by mouse drag or touch. + * + * @default false + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + tabScroll?: boolean; + /** + * Styles(CSS) that affect the tab element may cause the last tab to be cut off or have a gap. + * At this time, you can adjust the following option values using the properties of the tabScrollCorrection object to display it normally. + * - rightCorrectionPx: This is an option that allows you to correct the appearance of the tab by increasing or decreasing it by 1 when the last tab is cut off or a space is created. + * ``` + * N("#docs").docs({ + * tabScrollCorrection: { + * rightCorrectionPx: 1 + * } + * }); + * ``` + * > If you set the `tabScrollCorrection` option in the `N.context.attr("ui.shell").docs` property of [Config(natural.config.js)](https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0102.html&tab=html/naturaljs/refr/refr010206.html), it will be applied to the entire N.docs component. + * + * @default { rightCorrectionPx: 0 } + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + tabScrollCorrection?: { + rightCorrectionPx?: number; + }; + /** + * When you click the "Close All" button, if the closeAllRedirectURL option value is null, all tabs except the active tab will be closed, and if you enter a url string, you will be redirected to that url. + * + * When developing as a SPA(Single Page Application), it is recommended to enter the URL to go to the 'home' page so that the browser's garbage resources can be cleaned up. + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + closeAllRedirectURL?: string | null; + msgContext?: NJS; + /** + * If set to true, a progress bar will be displayed until all Ajax requests executed when the page is loaded are completed. + * + * @default false + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + entireLoadIndicator?: boolean; + /** + * If set to true, Double Submit will be prevented by blocking the screen until all Ajax requests executed when the page is loaded are completed. + * + * @default false + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + entireLoadScreenBlock?: boolean; + /** + * URLs specified as entireLoadExcludeURLs in entireLoad-related events or options (entireLoadIndicator, entireLoadScreenBlock, etc.) are excluded from capture. + * > Set this when you want to exclude Ajax calls that are loaded outside the N.docs context when the page is first loaded. + * + * @default [] + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + entireLoadExcludeURLs?: string[]; + entireLoadRequestCnt?: number; + entireLoadRequestMaxCnt?: number; + /** + * This event runs before content is loaded. + * ``` + * onBeforeLoad: function(docId, target) { + * // docId: document id + * // target: Element to place loaded content + * + * var doc = this.doc(docId); // document 정보 가져오기 + * } + * ``` + * > It will not be called again until the open page is closed. + * + * > Because it is executed before the page is loaded, the Controller object of the page loaded with the cont method cannot be obtained. + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeLoad?: EventHandlers.Documents.OnBeforeLoad | null; + /** + * This event runs after the page is loaded. + * ``` + * onLoad: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * > It will not be called again until the open page is closed. + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onLoad?: EventHandlers.Documents.OnLoad | null; + /** + * This is an event that is executed before any Ajax requests are captured when the page is loading. + * ``` + * onBeforeEntireLoad: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Retrieve document information + * } + * ``` + * > The event is executed once before the content is loaded, which means it is not possible to retrieve the Controller object of the page loaded using the `cont` method at this point. + * + * @default null + * + * @see https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeEntireLoad?: EventHandlers.Documents.OnBeforeEntireLoad | null; + /** + * Defines an event handler that is executed when an error occurs before page loading is complete and all Ajax requests are completed. + * ``` + * onErrorEntireLoad: function(e, request, xhr, textStatus, callback) { + * // e(arguments[0]): ErrorThrown + * // request(arguments[1]): Communicator.request + * // xhr(arguments[2]): jQuery XMLHTTORequest + * // textStatus(arguments[3]): "success" (if the request succeeds) or "error" (if an error occurs in the submit callback during the request (on the server-side)) + * // callback(arguments[4]): If the textStatus value is "success," this is the callback function specified as an argument for the submit method. + * } + * ``` + * > The event handler function of onErrorEntireLoad is the same as the `callback` parameter of the `N.comm.error` method. + * + * @default null + * + * @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html} + */ + onErrorEntireLoad?: EventHandlers.Documents.OnErrorEntireLoad | null; + /** + * Defines an event handler that is executed after page loading is complete and all Ajax requests are completed. + * ``` + * onEntireLoad: function(docId, entireLoadRequestCnt, entireLoadRequestMaxCnt) { + * // docId: document id + * // entireLoadRequestCnt: Number of completed requests + * // entireLoadRequestMaxCnt: Maximum number of requests that can be completed + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onEntireLoad?: EventHandlers.Documents.OnEntireLoad | null; + /** + * Defines an event handler that runs before the selected tab is activated. + * ``` + * onBeforeActive: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeActive?: EventHandlers.Documents.OnBeforeActive | null; + /** + * Defines an event handler that runs after the selected tab is activated. + * ``` + * onActive: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onActive?: EventHandlers.Documents.OnActive | null; + /** + * Defines an event handler that runs before the selected tab is disabled. + * ``` + * onBeforeInactive: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeInactive?: EventHandlers.Documents.OnBeforeInactive | null; + /** + * Defines an event handler that runs after the selected tab is disabled. + * ``` + * onInactive: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onInactive?: EventHandlers.Documents.OnInactive | null; + /** + * Defines an event handler that runs before the state of the selected tab is removed. + * ``` + * onBeforeRemoveState: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeRemoveState?: EventHandlers.Documents.OnBeforeRemoveState | null; + /** + * Defines an event handler that runs after the state of the selected tab is removed. + * ``` + * onRemoveState: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onRemoveState?: EventHandlers.Documents.OnRemoveState | null; + /** + * Defines an event handler that runs before the selected tab is removed. + * ``` + * onBeforeRemove: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onBeforeRemove?: EventHandlers.Documents.OnBeforeRemove | null; + /** + * Defines an event handler that runs after the selected tab is removed. + * ``` + * onRemove: function(docId) { + * // docId: document id + * + * var doc = this.doc(docId); // Get document information + * var cont = this.cont(docId); // Get the Controller object of the document + * var view = cont.view; + * var request = cont.request; + * } + * ``` + * + * @default null + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + onRemove?: EventHandlers.Documents.OnRemove | null; + docs?: DocsObject; + /** + * If set to true, the menu list dialog will always appear at the top. + * + * @default false + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + alwaysOnTop?: boolean; + /** + * When applying the `alwaysOnTop` option, specify target elements for calculating the top z-index. + * > Specified with jQuery selector syntax. + * + * > When N.docs-related elements are obscured by other elements, please add an obscured element selector. + * + * @default "div, span, ul, p, nav, article, section, header, footer, aside" + * + * @see @see {@link https://bbalganjjm.github.io/natural_js/?page=html/naturaljs/refr/refr0502.html&tab=html/naturaljs/refr/refr050203.html + */ + alwaysOnTopCalcTarget?: string; + order?: string[]; + loadedDocId?: string | null; + } + } + + namespace EventHandlers { + namespace Documents { + interface OnBeforeEntireLoad { + (this: NUS.Documents, docId?: string): void; + } + interface OnErrorEntireLoad { + ( + this: NUS.Documents, + e: Error, + request: NA.Request, + xhr: JQueryXHR, + textStatus: "success" | "error", + submitCallback: NA.Callbacks.Communicator.Submit, + ): void; + } + interface OnEntireLoad { + ( + this: NUS.Documents, + docId: string, + entireLoadRequestCnt: number, + entireLoadRequestMaxCnt: number, + ): void; + } + interface OnBeforeLoad { + (this: NUS.Documents, docId: string, target: NJS): void; + } + interface OnLoad { + (this: NUS.Documents, docId: string): void; + } + interface OnBeforeActive { + (this: NUS.Documents, docId: string, isFromDocsTabList: boolean, isNotLoaded: boolean): void; + } + interface OnActive { + (this: NUS.Documents, docId: string, isFromDocsTabList: boolean, isNotLoaded: boolean): void; + } + interface OnBeforeInactive { + (this: NUS.Documents, docId?: string): void; + } + interface OnInactive { + (this: NUS.Documents, docId?: string): void; + } + interface OnBeforeRemoveState { + (this: NUS.Documents, docId?: string): void; + } + interface OnRemoveState { + (this: NUS.Documents, docId?: string): void; + } + interface OnBeforeRemove { + (this: NUS.Documents, docId?: string): void; + } + interface OnRemove { + (this: NUS.Documents, docId?: string): void; + } + } + } + + namespace Callbacks { + namespace Documents { + interface RemoveState { + (this: NUS.Documents, docId?: string): void; + } + interface LoadContent { + (this: NUS.Documents): void; + } + interface Reload { + (this: NA.Communicator, html?: string, request?: NA.Request): void; + } + } + } +} diff --git a/src/main/resources/static/js/natural_js/@types/natural_js-tests.js b/src/main/resources/static/js/natural_js/@types/natural_js-tests.js new file mode 100644 index 0000000..01e24a6 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural_js-tests.js @@ -0,0 +1,256 @@ +"use strict"; +N([{}, {}]).each((index, element) => { }); +N(".button").remove_(1, 2).instance((instanceName, instance) => { }); +N(".button").tpBind("click", function () { }); +N(".button").events("click", "grid"); +N.locale().charAt(0); +N.locale("en-US"); +N(".button").on("click", function (e) { + N.event.disable(e); + N.event.isNumberRelatedKeys(e); +}); +NC.serialExecute(function (a) { +}, function (b, c) { +}); +N.gc.full(); +N.gc.ds(); +N.gc.minimum(); +N.string.trimToZero(""); +N.string.rpad("Hello", 10, "World"); +N.element.toOpts(N("div")); +N.browser.scrollbarWidth(); +N.browser.cookie("test", "test cookie value", 1, "localhost"); +new Date().formatDate("Y-m-d"); +const selector = N("asdf").selector; +N.validator.frn_rrn(""); +N.ajax({ + url: "http://localhost:8080", + type: "POST" /* NA.Objects.Request.HttpMethod.POST */, + dataType: "json" /* NA.Objects.Request.DataType.JSON */, + enctype: "application/x-www-form-urlencoded" /* NA.Objects.Request.Enctype.URLENCODED */ +}); +N.comm(N([]), { + url: "https://localhost:8080" +}).submit(function () { }); +N([]).comm({ + url: "http://localhost:8080", + type: "POST" /* NA.Objects.Request.HttpMethod.POST */, + dataType: "json" /* NA.Objects.Request.DataType.JSON */, + enctype: "application/x-www-form-urlencoded" /* NA.Objects.Request.Enctype.URLENCODED */ +}).submit(function (data, request) { }); +N.comm(N([]), "https://localhost:8080").request.attr("asd", "").error(function (xhr, textStatus, e, request, submitCallback) { +}).submit(function (data, request) { +}); +N([]).comm({ + url: "http://localhost:8080" +}).request.attr("asd", "").request.attr("asd", "asd").submit(function () { +}); +N.context.attr("asdf", 1).attr("asdf"); +N.config.filterConfig.successFilters; +const cont = new N.cont(N(".context"), { + init: function (view, request) { + view.each(function () { }); + request.attr("param01"); + request.attr("param02", 1); + request.reload(function (html, request) { + }); + }, + fn01: function () { + this.view.each(function () { }); + } +}); +cont.fn01(); +N(".context").cont({ + init: function (view, request) { + view.each(function () { }); + }, + fn01: function () { + this.view.each(function () { }); + this.request.attr("param"); + } +}); +N.ds.instance(class { +}, true) + .remove() + .notify(1, ""); +new N.formatter(N([{}]), { + "numeric": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["numeric" /* ND.FormatRules.NUMERIC */, "#,###.##0000"]], + "generic": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["generic" /* ND.FormatRules.GENERIC */, "@@ABS"]], + "limit": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["limit" /* ND.FormatRules.LIMIT */, "13", "..."]], + "etc": [["date" /* ND.FormatRules.DATE */, 12]] +}).format(1); +N([{}]).formatter({ + "numeric": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["numeric" /* ND.FormatRules.NUMERIC */, "#,###.##0000"]], + "generic": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["generic" /* ND.FormatRules.GENERIC */, "@@ABS"]], + "limit": [["trimtoempty" /* ND.FormatRules.TRIMTOEMPTY */], ["limit" /* ND.FormatRules.LIMIT */, "13", "..."]], + "etc": [["date" /* ND.FormatRules.DATE */, 12]] +}).format(1); +N.formatter["rrn" /* ND.FormatRules.RRN */]("1234567890123", [7, "*"]); +N.formatter["trimtoval" /* ND.FormatRules.TRIMTOVAL */]("", ["1"]); +new N.validator(N([{}]), { + "numeric": [["required" /* ND.ValidationRules.REQUIRED */], ["commas_integer" /* ND.ValidationRules.COMMAS_INTEGER */]], + "generic": [["required" /* ND.ValidationRules.REQUIRED */], ["korean" /* ND.ValidationRules.KOREAN */]], + "limit": [["required" /* ND.ValidationRules.REQUIRED */], ["alphabet" /* ND.ValidationRules.ALPHABET */]] +}).validate(1); +N([{}]).validator({ + "numeric": [["required" /* ND.ValidationRules.REQUIRED */], ["commas_integer" /* ND.ValidationRules.COMMAS_INTEGER */]], + "generic": [["required" /* ND.ValidationRules.REQUIRED */], ["korean" /* ND.ValidationRules.KOREAN */]], + "limit": [["required" /* ND.ValidationRules.REQUIRED */], ["alphabet" /* ND.ValidationRules.ALPHABET */]] +}).validate(1); +N.validator["rrn" /* ND.ValidationRules.RRN */]("123456-7890123"); +N.validator["minlength" /* ND.ValidationRules.MINLENGTH */]("123456-7890123", [6]); +N([]).datasort("key", false); +N.data.sort([{}], "key", true); +N(".area").alert("Hello").show(); +const alertInst = new N.alert(N(".area"), { + msg: "Hello", + onHide: function (msgContext, msgContents) { + console.log(msgContext, msgContents); + } +}).show(); +alertInst.options.msg = "Hello"; +alertInst.context("span").each(function (index, element) { }); +N(".button").button({ + color: "primary_container" /* NU.ButtonColor.PRIMARY_CONTAINER */, + size: "big" /* NU.ButtonSize.BIG */, + type: NU.ButtonType.ELEVATED +}).disable(); +new N.button(N(".button"), { + color: "primary_container" /* NU.ButtonColor.PRIMARY_CONTAINER */, + size: "big" /* NU.ButtonSize.BIG */, + type: NU.ButtonType.ELEVATED +}).disable(); +N(".input").datepicker({ + maxYear: 300 +}).show(); +new N.datepicker(N(".input"), { + minDate: "20190101" +}).show(); +let popup = new N.popup(N(".popup"), { + title: "Title", + width: 800, + draggable: true +}); +popup.open().close(); +popup = N().popup({ + url: "page.html", + title: "Title", + width: 800, + draggable: true +}); +popup.open(); +N(".tab").tab({ + tabOpts: [{ + url: "http://localhost:8080", + }] +}).cont().view.find(".tab-pane").remove(); +new N.tab(N(".tab"), { + tabOpts: [{ + url: "http://localhost:8080", + }] +}).cont(0).view.find(".tab-pane").remove(); +N(".tab").tab({ + tabOpts: [{ + url: "http://localhost:8080", + }] +}).open().cont.view.find(".tab-pane").remove(); +let select = new N.select(N([{ a: 1 }]), N(".select", cont.view)); +select.data(false).each((index, element) => { }); +select.data(true).forEach(function (item) { }); +select.context("option").get().forEach(function (item) { }); +select = N([{ a: 1 }]).select({ + context: N(".select", cont.view) +}); +select.data(false).each((index, element) => { }); +select.data().forEach(function (item) { }); +select.data(true).forEach(function (item) { }); +select.context("option").get().forEach(function (item) { }); +const idx = select.index(); +const sltInst = select.index(1); +const val = select.val(); +const sltInst02 = select.val("val"); +let form = N([{ a: 1 }]).form({ + context: N(".form", cont.view), + onBindValue: (ele, val, action) => { + } +}); +form.data(false).each((index, element) => { }); +form = N([{ a: 1 }]).form(N(".form", cont.view)); +form.data().forEach(function (item) { }); +form.data(true).forEach(function (item) { }); +form.context("option").get().forEach(function (item) { }); +form.val("col01"); +form.val("col01", "value"); +new N.list([{ age: 18 }, { age: 22 }], N(".list", cont.view)).bind(); +N([{ age: 18 }, { age: 22 }]).list({ + context: N(".list", cont.view), + height: 200, + rowHandler: function (index, row, data) { + if (data.age >= 28) { + row.find("#age").css("background-color", "red"); + } + } +}).bind(); +new N.grid([{ age: 18 }, { age: 22 }], N(".grid", cont.view)).bind(); +N([{ age: 18 }, { age: 22 }]).grid({ + context: N(".grid", cont.view), + height: 200, + rowHandler: function (index, row, data) { + if (data.age >= 28) { + row.find("#age").css("background-color", "red"); + } + } +}).bind(); +new N.pagination([{ age: 18 }, { age: 22 }], { + context: N(".pagination", cont.view), + onChange: function (pageNo, selEle, selData, currPageNavInfo) { + N.log(selData); + } +}).pageNo(3).bind(); +N([{ age: 18 }, { age: 22 }]).pagination({ + context: N(".pagination", cont.view), + onChange: function (pageNo, selEle, selData, currPageNavInfo) { + N.log(selData); + } +}).pageNo(3).bind(); +new N.tree([{ age: 18 }, { age: 22 }], { + context: ".treeBlock", + checkbox: true +}).bind(); +N([{ age: 18 }, { age: 22 }]).tree({ + context: ".treeBlock", + checkbox: true +}).bind(); +N({ + bottom: 50, + left: 50 +}).notify({ + alwaysOnTop: true +}).add("asd"); +N.notify({ + top: 50, + right: 50 +}, { + alwaysOnTop: true +}).add("asd"); +N.notify({ + top: 50, + right: 50 +}).add("asd"); +N.notify.add("asd", ""); +const docs1 = N(".context").docs({ + onEntireLoad: function (docId, entireLoadRequestCnt, entireLoadRequestMaxCnt) { + } +}); +docs1.add("ex-0001", "Example page", { url: "ex.html" }); +const docs2 = new N.docs(N(".context"), { + onEntireLoad: function (docId, entireLoadRequestCnt, entireLoadRequestMaxCnt) { + } +}); +docs2.request.attr("a", 1).request.attr("b", 2).add("page", "Example page", { url: "page.html" }); +const inspectionResult = N.code.inspection.test("code"); +if (Array.isArray(inspectionResult)) { + N.code.inspection.report.console(inspectionResult, "/test.js"); +} +N.code.addSourceURL("code", "/test.js"); +N.template.aop.codes({}, function () { }); diff --git a/src/main/resources/static/js/natural_js/@types/natural_js-tests.ts b/src/main/resources/static/js/natural_js/@types/natural_js-tests.ts new file mode 100644 index 0000000..a7e4a26 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/natural_js-tests.ts @@ -0,0 +1,286 @@ +N([{}, {}]).each((index, element) => {}); +N(".button").remove_(1, 2).instance((instanceName, instance) => {}); +N(".button").tpBind("click", function() {}); +N(".button").events("click", "grid"); +N.locale().charAt(0); +N.locale("en-US"); +N(".button").on("click", function(e) { + N.event.disable(e); + N.event.isNumberRelatedKeys(e); +}); +NC.serialExecute(function(a: any) { +}, function(b: any, c: any) { +}); +N.gc.full(); +N.gc.ds(); +N.gc.minimum(); +N.string.trimToZero(""); +N.string.rpad("Hello", 10, "World"); +N.date.dateList(2024, 12).forEach(function(date) { + date.forEach(function(date) { + date.formatDate("Y-m-d"); + }); +}); +N.element.toOpts(N("div")); +N.browser.scrollbarWidth(); +N.browser.cookie("test", "test cookie value", 1, "localhost"); + +const selector = N("asdf").selector; + +N.validator.frn_rrn(""); + +N.ajax({ + url: "http://localhost:8080", + type: NA.Objects.Request.HttpMethod.POST, + dataType: NA.Objects.Request.DataType.JSON, + enctype: NA.Objects.Request.Enctype.URLENCODED, +}); +N.comm(N([]), { + url: "https://localhost:8080", +}).submit(function() {}); +N([]).comm({ + url: "http://localhost:8080", + type: NA.Objects.Request.HttpMethod.POST, + dataType: NA.Objects.Request.DataType.JSON, + enctype: NA.Objects.Request.Enctype.URLENCODED, +}).submit(function(data, request) {}); +N.comm(N([]), "https://localhost:8080").request.attr("asd", "").error( + function(xhr, textStatus, e, request, submitCallback) { + }, +).submit(function(data, request) { +}); +N([]).comm({ + url: "http://localhost:8080", +}).request.attr("asd", "").request.attr("asd", "asd").submit(function() { +}); + +N.context.attr("asdf", 1).attr("asdf"); +N.config.filterConfig.successFilters; + +const cont = new N.cont(N(".context"), { + init: function(view, request) { + view.each(function() {}); + request.attr("param01"); + request.attr("param02", 1); + request.reload(function(html, request) { + }); + }, + fn01: function() { + this.view!.each(function() {}); + }, +}); +cont.fn01(); + +N(".context").cont({ + init: function(view, request) { + view.each(function() {}); + }, + fn01: function() { + this.view!.each(function() {}); + this.request!.attr("param"); + }, +}); + +N.ds.instance(N().grid(), true) + .remove() + .notify(1, ""); + +new N.formatter(N([{}]), { + "numeric": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.NUMERIC, "#,###.##0000"]], + "generic": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.GENERIC, "@@ABS"]], + "limit": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.LIMIT, "13", "..."]], + "etc": [[ND.FormatRules.DATE, 12]], +}).format(1); +N([{}]).formatter({ + "numeric": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.NUMERIC, "#,###.##0000"]], + "generic": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.GENERIC, "@@ABS"]], + "limit": [[ND.FormatRules.TRIMTOEMPTY], [ND.FormatRules.LIMIT, "13", "..."]], + "etc": [[ND.FormatRules.DATE, 12]], +}).format(1); +N.formatter[ND.FormatRules.RRN]("1234567890123", [7, "*"]); +N.formatter[ND.FormatRules.TRIMTOVAL]("", ["1"]); +new N.validator(N([{}]), { + "numeric": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.COMMAS_INTEGER]], + "generic": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.KOREAN]], + "limit": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.ALPHABET]], +}).validate(1); +N([{}]).validator({ + "numeric": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.COMMAS_INTEGER]], + "generic": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.KOREAN]], + "limit": [[ND.ValidationRules.REQUIRED], [ND.ValidationRules.ALPHABET]], +}).validate(1); +N.validator[ND.ValidationRules.RRN]("123456-7890123"); +N.validator[ND.ValidationRules.MINLENGTH]("123456-7890123", [6]); +N([]).datasort("key", false); +N.data.sort([{}], "key", true); + +N(".area").alert("Hello").show(); +const alertInst = new N.alert(N(".area"), { + msg: "Hello", + onHide: function(msgContext, msgContents) { + console.log(msgContext, msgContents); + }, +}).show(); +alertInst.options.msg = "Hello"; +alertInst.context("span").each(function(index, element) {}); + +N(".button").button({ + color: NU.ButtonColor.PRIMARY_CONTAINER, + size: NU.ButtonSize.BIG, + type: NU.ButtonType.ELEVATED, +}).disable(); +new N.button(N(".button"), { + color: NU.ButtonColor.PRIMARY_CONTAINER, + size: NU.ButtonSize.BIG, + type: NU.ButtonType.ELEVATED, +}).disable(); + +N(".input").datepicker({ + maxYear: 300, +}).show(); +new N.datepicker(N(".input"), { + minDate: "20190101", +}).show(); + +let popup = new N.popup(N(".popup"), { + title: "Title", + width: 800, + draggable: true, +}); +popup.open().close(); +popup = N().popup({ + url: "page.html", + title: "Title", + width: 800, + draggable: true, +}); +popup.open(); + +N(".tab").tab({ + tabOpts: [{ + url: "http://localhost:8080", + }], +}).cont().view!.find(".tab-pane").remove(); +new N.tab(N(".tab"), { + tabOpts: [{ + url: "http://localhost:8080", + }], +}).cont(0).view!.find(".tab-pane").remove(); +N(".tab").tab({ + tabOpts: [{ + url: "http://localhost:8080", + }], +}).open().cont.view!.find(".tab-pane").remove(); + +let select = new N.select(N([{ a: 1 }]), N(".select", cont.view)); +select.data(false).each((index, element) => {}); +select.data(true).forEach(function(item) {}); +select.context("option").get().forEach(function(item) {}); + +select = N([{ a: 1 }]).select({ + context: N(".select", cont.view), +}); +select.data(false).each((index, element) => {}); +select.data().forEach(function(item) {}); +select.data(true).forEach(function(item) {}); +select.context("option").get().forEach(function(item) {}); +const idx = select.index(); +const sltInst = select.index(1); +const val = select.val(); +const sltInst02 = select.val("val"); + +let form = N([{ a: 1 }]).form({ + context: N(".form", cont.view), + onBindValue: (ele, val, action) => { + }, +}); +form.data(false).each((index, element) => {}); +form = N([{ a: 1 }]).form(N(".form", cont.view)); +form.data().forEach(function(item) {}); +form.data(true).forEach(function(item) {}); +form.context("option").get().forEach(function(item) {}); +form.val("col01"); +form.val("col01", "value"); + +new N.list([{ age: 18 }, { age: 22 }], N(".list", cont.view)).bind(); +N([{ age: 18 }, { age: 22 }]).list({ + context: N(".list", cont.view), + height: 200, + rowHandler: function(index, row, data) { + if (data.age as number >= 28) { + row.find("#age").css("background-color", "red"); + } + }, +}).bind(); + +new N.grid([{ age: 18 }, { age: 22 }], N(".grid", cont.view)).bind(); +N([{ age: 18 }, { age: 22 }]).grid({ + context: N(".grid", cont.view), + height: 200, + rowHandler: function(index, row, data) { + if (data.age as number >= 28) { + row.find("#age").css("background-color", "red"); + } + }, +}).bind(); + +new N.pagination([{ age: 18 }, { age: 22 }], { + context: N(".pagination", cont.view), + onChange: function(pageNo, selEle, selData, currPageNavInfo) { + N.log(selData); + }, +}).pageNo(3).bind(); +N([{ age: 18 }, { age: 22 }]).pagination({ + context: N(".pagination", cont.view), + onChange: function(pageNo, selEle, selData, currPageNavInfo) { + N.log(selData); + }, +}).pageNo(3).bind(); + +new N.tree([{ age: 18 }, { age: 22 }], { + context: ".treeBlock", + checkbox: true, +}).bind(); + +N([{ age: 18 }, { age: 22 }]).tree({ + context: ".treeBlock", + checkbox: true, +}).bind(); + +N({ + bottom: 50, + left: 50, +}).notify({ + alwaysOnTop: true, +}).add("asd"); +N.notify({ + top: 50, + right: 50, +}, { + alwaysOnTop: true, +}).add("asd"); +N.notify({ + top: 50, + right: 50, +}).add("asd"); +N.notify.add("asd", ""); + +const docs1 = N(".context").docs({ + onEntireLoad: function(docId, entireLoadRequestCnt, entireLoadRequestMaxCnt) { + }, +}); +docs1.add("ex-0001", "Example page", { url: "ex.html" }); + +const docs2 = new N.docs(N(".context"), { + onEntireLoad: function(docId, entireLoadRequestCnt, entireLoadRequestMaxCnt) { + }, +}); +docs2.request.attr("a", 1).request.attr("b", 2).add("page", "Example page", { url: "page.html" }); + +const inspectionResult = N.code.inspection.test("code"); +if (Array.isArray(inspectionResult)) { + N.code.inspection.report.console(inspectionResult, "/test.js"); +} +N.code.addSourceURL("code", "/test.js"); + +N.template.aop.codes({} as NA.Objects.Controller.Object, function() {}); diff --git a/src/main/resources/static/js/natural_js/@types/package.json b/src/main/resources/static/js/natural_js/@types/package.json new file mode 100644 index 0000000..9b2eb40 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/package.json @@ -0,0 +1,22 @@ +{ + "private": true, + "name": "@types/natural_js", + "version": "1.0.9999", + "nonNpm": true, + "nonNpmDescription": "Natural-JS", + "projects": [ + "https://github.com/bbalganjjm/natural_js" + ], + "dependencies": { + "@types/jquery": "*" + }, + "devDependencies": { + "@types/natural_js": "workspace:." + }, + "owners": [ + { + "name": "Goldman Kim", + "githubUsername": "bbalganjjm" + } + ] +} diff --git a/src/main/resources/static/js/natural_js/@types/tsconfig.json b/src/main/resources/static/js/natural_js/@types/tsconfig.json new file mode 100644 index 0000000..dfbe546 --- /dev/null +++ b/src/main/resources/static/js/natural_js/@types/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "natural_js-tests.ts" + ] +} diff --git a/src/main/resources/static/js/natural_js/natural.js+code+template.es6.min.js b/src/main/resources/static/js/natural_js/natural.js+code+template.es6.min.js new file mode 100644 index 0000000..41c56dd --- /dev/null +++ b/src/main/resources/static/js/natural_js/natural.js+code+template.es6.min.js @@ -0,0 +1,636 @@ +/* + Natural-CORE v1.0.0 + + Released under the LGPL v2.1 license + Date: 2014-09-26T11:11Z + + Copyright 2014 Goldman Kim(bbalganjjm@gmail.com) + + Includes formatdate.js & Mask JavaScript API + formatdate.js : http://www.svendtofte.com/javascript/javascript-date-string-formatting/ + Mask JavaScript API : http://www.pengoworks.com/workshop/js/mask/, dswitzer@pengoworks.com +*/ +class NC$$module$__$src$natural_core{remove_(e,a){void 0!==e&&(NC$$module$__$src$natural_core.isNumeric(e)||(e=this.toArray().indexOf(e)),void 0===a&&(a=1),this.splice(e,a));return this}tpBind(){const e=arguments,a=this;return this.each(function(){void 0!==jQuery._data(this,"events")?(a.on.apply(a,e),jQuery(this).each(function(){const b=jQuery._data(this,"events")[e[0].split(".")[0]],c=b.pop();b.splice(0,0,c)})):a.on.apply(a,e)})}instance(e,a){if(0===arguments.length)return this.map(function(){return jQuery.map(jQuery(this).data(), +function(b,c){if(NC$$module$__$src$natural_core.string.endsWith(c,"__"))return b})});if(1===arguments.length){if("function"===typeof e)return this.each(function(){return jQuery.each(jQuery(this).data(),function(c,d){NC$$module$__$src$natural_core.string.endsWith(c,"__")&&e.call(d,c.replace("__",""),d)})});const b=this.map(function(){return jQuery.map(jQuery(this).data(),function(c,d){if(d===e+"__")return c})});return 1>=b.length?b[0]:b}if(2===arguments.length){if("function"===typeof a)return this.each(function(){return jQuery.each(jQuery(this).data(), +function(b,c){e+"__"===b&&a.call(c,b.replace("__",""),c)})});this.data(e+"__",a);return this}}vals(e){var a=this.get(0).tagName.toLowerCase(),b=NC$$module$__$src$natural_core.string.trimToEmpty(this.attr("type")).toLowerCase();let c;if(void 0!==e&&"function"!==NC$$module$__$src$natural_core.type(e)){if("select"===a)null!==NC$$module$__$src$natural_core.string.trimToNull(e)||this.is("select[multiple='multiple']")?this.val(e):0 option:selected");if(1 option");return a.each(function(){e.call(this,c.index(this),this)})}if(1===a.length)if("function"!==NC$$module$__$src$natural_core.type(e)){if(void 0!==a.attr("value"))return NC$$module$__$src$natural_core.string.trimToEmpty(a.val())}else return e.call(a,this.find("> option:not(.select_default__)").index(a),a),a;else if(0===a.length&&this.is("[multiple]"))return[]}else{if("radio"===b){a=this.filter("[name='"+this.attr("name")+"']:checked");if("function"!==NC$$module$__$src$natural_core.type(e))return NC$$module$__$src$natural_core.string.trimToEmpty(a.val()); +e.call(a,this.filter("[name='"+this.attr("name")+"']").index(a),a);return a}if("checkbox"===b){a=this.filter("[name='"+this.attr("name")+"']:checked");if(1{const e=class{static $jscomp$static$init$m1795419079$0$minimum(){return function(){jQuery(window).off("resize.datepicker");jQuery(window).off("resize.alert");jQuery(document).off("click.datepicker");jQuery(document).off("keyup.alert");jQuery(document).off("click.grid.dataFilter"); +jQuery(document).off("click.grid.more touchstart.grid.more");return!0}}static $jscomp$static$init$m1795419079$1$full(){return function(){jQuery(window).off("resize.datepicker");jQuery(window).off("resize.alert");jQuery(document).off("dragstart.alert selectstart.alert mousemove.alert touchmove.alert mouseup.alert touchend.alert");jQuery(document).off("click.datepicker");jQuery(document).off("keyup.alert");jQuery(document).off("dragstart.grid.vResize selectstart.grid.vResize mousemove.grid.vResize touchmove.grid.vResize mouseup.grid.vResize touchend.grid.vResize"); +jQuery(document).off("dragstart.grid.resize selectstart.grid.resize mousemove.grid.resize touchmove.grid.resize mouseup.grid.resize touchend.grid.resize");jQuery(document).off("click.grid.dataFilter");jQuery(document).off("click.grid.more touchstart.grid.more");return!0}}static $jscomp$static$init$m1795419079$2$ds(){return function(){0#data_sync_temp__").length&&(jQuery(NA$$module$__$src$natural_architecture.context.attr("architecture").page.context).find(">#data_sync_temp__").instance("ds").obserable= +jQuery.uniqueSort(jQuery(".grid__, .list__, .form__:not('.grid__>tbody, .list__>li'), .tree__",NA$$module$__$src$natural_architecture.context.attr("architecture").page.context).instance()))}}};e.minimum=e.$jscomp$static$init$m1795419079$0$minimum();e.full=e.$jscomp$static$init$m1795419079$1$full();e.ds=e.$jscomp$static$init$m1795419079$2$ds();return e})()}static $jscomp$static$init$m1795419079$66$string(){return(()=>{const e=class{static $jscomp$static$init$m1795419079$3$contains(){return function(a, +b){if("string"!==typeof a)throw NC$$module$__$src$natural_core.error("[NC.string.contains]arguments[0] was not entered or is not of string type.");return-1>11?b:f>>7?2:1);return c}}static $jscomp$static$init$m1795419079$12$trimToEmpty(){return function(a){return void 0!==a&&null!==a?String(a).trim():""}}static $jscomp$static$init$m1795419079$13$nullToEmpty(){return function(a){return null===a||void 0===a?"":a}}static $jscomp$static$init$m1795419079$14$trimToNull(){return function(a){return 0===NC$$module$__$src$natural_core.string.trimToEmpty(a).length?null:NC$$module$__$src$natural_core.string.trimToEmpty(a)}}static $jscomp$static$init$m1795419079$15$trimToUndefined(){return function(a){return 0=== +NC$$module$__$src$natural_core.string.trimToEmpty(a).length?void 0:NC$$module$__$src$natural_core.string.trimToEmpty(a)}}static $jscomp$static$init$m1795419079$16$trimToZero(){return function(a){return 0===NC$$module$__$src$natural_core.string.trimToEmpty(a).length?"0":NC$$module$__$src$natural_core.string.trimToEmpty(a)}}static $jscomp$static$init$m1795419079$17$trimToVal(){return function(a,b){return 0===NC$$module$__$src$natural_core.string.trimToEmpty(a).length?b:NC$$module$__$src$natural_core.string.trimToEmpty(a)}}}; +e.contains=e.$jscomp$static$init$m1795419079$3$contains();e.endsWith=e.$jscomp$static$init$m1795419079$4$endsWith();e.startsWith=e.$jscomp$static$init$m1795419079$5$startsWith();e.insertAt=e.$jscomp$static$init$m1795419079$6$insertAt();e.removeWhitespace=e.$jscomp$static$init$m1795419079$7$removeWhitespace();e.lpad=e.$jscomp$static$init$m1795419079$8$lpad();e.rpad=e.$jscomp$static$init$m1795419079$9$rpad();e.isEmpty=e.$jscomp$static$init$m1795419079$10$isEmpty();e.byteLength=e.$jscomp$static$init$m1795419079$11$byteLength(); +e.trimToEmpty=e.$jscomp$static$init$m1795419079$12$trimToEmpty();e.nullToEmpty=e.$jscomp$static$init$m1795419079$13$nullToEmpty();e.trimToNull=e.$jscomp$static$init$m1795419079$14$trimToNull();e.trimToUndefined=e.$jscomp$static$init$m1795419079$15$trimToUndefined();e.trimToZero=e.$jscomp$static$init$m1795419079$16$trimToZero();e.trimToVal=e.$jscomp$static$init$m1795419079$17$trimToVal();return e})()}static $jscomp$static$init$m1795419079$67$date(){return(()=>{const e=class{static $jscomp$static$init$m1795419079$18$diff(){return function(a, +b){"string"===NC$$module$__$src$natural_core.type(a)&&(a=this.strToDate(a).obj);"string"===NC$$module$__$src$natural_core.type(b)&&(b=this.strToDate(b).obj);return Math.ceil((b-a)/1E3/24/60/60)}}static $jscomp$static$init$m1795419079$19$strToDateStrArr(){return function(a,b,c){const d=[];let f=0;if(3===b.length&&7===a.length||2===b.length&&5===a.length)f=-1;if(NC$$module$__$src$natural_core.string.startsWith(b,"Ymd"))d.push(a.substring(0,4+f)),d.push(a.substring(4+f,6+f)),d.push(a.substring(6+f,8+ +f));else if(NC$$module$__$src$natural_core.string.startsWith(b,"mdY"))d.push(a.substring(4,8+f)),d.push(a.substring(0,2)),d.push(a.substring(2,4));else if(NC$$module$__$src$natural_core.string.startsWith(b,"dmY"))d.push(a.substring(4,8+f)),d.push(a.substring(2,4)),d.push(a.substring(0,2));else if(NC$$module$__$src$natural_core.string.startsWith(b,"Ym"))d.push(a.substring(0,4+f)),d.push(a.substring(4+f,6+f));else if(NC$$module$__$src$natural_core.string.startsWith(b,"mY"))d.push(a.substring(2,6+f)), +d.push(a.substring(0,2));else throw NC$$module$__$src$natural_core.error('[NC.date.strToDateStrArr]"'+b+'" date format is not support. please change return value of NA.context.attr("data").formatter.date\'s functions');void 0!==c&&!1!==c||jQuery(d).each(function(g){d[g]=parseInt(this)});return d}}static $jscomp$static$init$m1795419079$20$strToDate(){return function(a,b){a=NC$$module$__$src$natural_core.string.trimToEmpty(a).replace(/[^0-9]/g,"");var c=null;2=a.length?c={obj:new Date(a, +1,1,0,0,0),format:"Y"}:6===a.length?(void 0===b&&(b=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ym()),c=NC$$module$__$src$natural_core.date.strToDateStrArr(a,b.replace(/[^Y|^m|^d]/g,"")),c={obj:new Date(c[0],c[1]-1,1,0,0,0),format:b}):8===a.length?(void 0===b&&(b=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd()),c=NC$$module$__$src$natural_core.date.strToDateStrArr(a,b.replace(/[^Y|^m|^d]/g,"")),c={obj:new Date(c[0],c[1]-1,c[2],0,0,0), +format:b}):10===a.length?(void 0===b&&(b=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.YmdH()),c=NC$$module$__$src$natural_core.date.strToDateStrArr(a,b.replace(/[^Y|^m|^d]/g,"")),c={obj:new Date(c[0],c[1]-1,c[2],Number(a.substring(8,10)),0,0),format:b}):12===a.length?(void 0===b&&(b=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.YmdHi()),c=NC$$module$__$src$natural_core.date.strToDateStrArr(a,b.replace(/[^Y|^m|^d]/g,"")),c={obj:new Date(c[0], +c[1]-1,c[2],Number(a.substring(8,10)),Number(a.substring(10,12)),0),format:b}):14<=a.length&&(void 0===b&&(b=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.YmdHis()),c=NC$$module$__$src$natural_core.date.strToDateStrArr(a,b.replace(/[^Y|^m|^d]/g,"")),c={obj:new Date(c[0],c[1]-1,c[2],Number(a.substring(8,10)),Number(a.substring(10,12)),Number(a.substring(12,14))),format:b});return c}}static $jscomp$static$init$m1795419079$21$format(){return function(a,b){const c=this.strToDate(a); +return null!==c?c.obj.formatDate(void 0!==b?b:c.format):a}}static $jscomp$static$init$m1795419079$22$dateToTs(){return function(a){void 0===a&&(a=new Date);return Math.round(a.getTime()/1E3)}}static $jscomp$static$init$m1795419079$23$tsToDate(){return function(a){return void 0===a?new Date:new Date(a)}}static $jscomp$static$init$m1795419079$24$dateList(){return function(a,b){const c=[];var d=new Date(a,b-1,0),f=new Date(a,b,0);a=new Date(a,b+1,0);b=f.getDate();const g=d.getDate();var h=d.getDay(); +let k=[];if(6!==h)for(h=g-h;h<=g;h++)d.setDate(h),k.push(new Date(d.getFullYear(),d.getMonth(),d.getDate(),0));for(d=1;d<=b;d++)f.setDate(d),k.push(new Date(f.getFullYear(),f.getMonth(),f.getDate(),0)),0{const e= +class{static $jscomp$static$init$m1795419079$25$toOpts(){return function(a){return N$$module$__$src$natural_js(a).data("opts")}}static $jscomp$static$init$m1795419079$26$toRules(){return function(a,b){const c={};let d,f;a.each(function(){d=jQuery(this);f=d.is("input:radio, input:checkbox")?d.attr("name"):d.attr("id");c[f]=d.data(b)});return c}}static $jscomp$static$init$m1795419079$27$toData(){return function(a){const b={};let c,d,f=jQuery();a.each(function(){c=jQuery(this).attr("id");d=jQuery(this); +d.is("input:radio")||d.is("input:checkbox")?0===f.filter(d).length&&(0 +{const e=class{static $jscomp$static$init$m1795419079$30$cookie(){return function(a,b,c,d){if(void 0===b){b=a+"=";d=b.length;c=document.cookie.length;for(var f=0;fb&&(b=a.indexOf(".NET"));const c=a.match(/Trident\/(\d.\d)/i);return 0>b?0:void 0===c?parseInt(a.substring(b+ +5,a.indexOf(".",b))):parseInt(c[1])+4}}static $jscomp$static$init$m1795419079$33$is(){return function(a){return"opera"in window||0<=navigator.userAgent.indexOf(" OPR/")?"opera"===a:"InstallTrigger"in window?"firefox"===a:"ios"!==a&&navigator.userAgent.match(/^((?!chrome|android|crios|fxios).)*safari/i)?"safari"===a:"chrome"in window&&!("opera"in window||0<=navigator.userAgent.indexOf(" OPR/"))?"chrome"===a:0
    '); +jQuery("body").append(a);const b=jQuery(a).innerWidth(),c=jQuery("div",a).innerWidth();jQuery(a).remove();return b-c}}};e.cookie=e.$jscomp$static$init$m1795419079$30$cookie();e.removeCookie=e.$jscomp$static$init$m1795419079$31$removeCookie();e.msieVersion=e.$jscomp$static$init$m1795419079$32$msieVersion();e.is=e.$jscomp$static$init$m1795419079$33$is();e.contextPath=e.$jscomp$static$init$m1795419079$34$contextPath();e.scrollbarWidth=e.$jscomp$static$init$m1795419079$35$scrollbarWidth();return e})()}static $jscomp$static$init$m1795419079$70$message(){return(()=> +{const e=class{static $jscomp$static$init$m1795419079$36$replaceMsgVars(){return function(a,b){if(void 0!==b)for(let c=0;c{const e=class{static $jscomp$static$init$m1795419079$38$deduplicate(){return function(a,b){const c=[];jQuery(a).each(function(d,f){"object"===NC$$module$__$src$natural_core.type(f)&&void 0!==b?0>jQuery.inArray(f[b],jQuery(c).map(function(){return this[b]}).get())&&c.push(f):0>jQuery.inArray(f,c)&&c.push(f)});return c}}};e.deduplicate=e.$jscomp$static$init$m1795419079$38$deduplicate();return e})()}static $jscomp$static$init$m1795419079$72$json(){return(()=> +{const e=class{static $jscomp$static$init$m1795419079$39$mapFromKeys(){return function(a){if(1d.indexOf(this[c])&&a.push(this)});return a}}static $jscomp$static$init$m1795419079$41$format(){return function(a,b){if(NC$$module$__$src$natural_core.isEmptyObject(a))return null; +NC$$module$__$src$natural_core.isString(a)&&(a=JSON.parse(a));void 0===b&&(b=4);return JSON.stringify(a,void 0,b)}}};e.mapFromKeys=e.$jscomp$static$init$m1795419079$39$mapFromKeys();e.mergeJsonArray=e.$jscomp$static$init$m1795419079$40$mergeJsonArray();e.format=e.$jscomp$static$init$m1795419079$41$format();return e})()}static $jscomp$static$init$m1795419079$73$event(){return(()=>{const e=class{static $jscomp$static$init$m1795419079$42$isNumberRelatedKeys(){return function(a){a=a?a:window.event;let b; +const c=[97,65,99,67,118,86,115,83,112,80],d=[8,9,27,13,35,36,37,39,46,45];b=a.keyCode?a.keyCode:a.which?a.which:a.charCode;return!b||48<=b&&57>=b||96<=b&&105>=b?!0:a.ctrlKey&&-1!==c.indexOf(b)||-1!==navigator.userAgent.indexOf("Firefox")&&(a.ctrlKey&&a.keyCode&&0=b||a.keyCode&&0=b)?!0:-1!==d.indexOf(b)?-1===navigator.userAgent.indexOf("Firefox")||39!==b&&45!==b&&46!==b?!(a.shiftKey&&(35===b||36===b||37===b)):void 0!==a.keyCode&&0=jQuery(this).scrollTop()?!1:!(0>b&&jQuery(this).scrollTop()>=this.scrollHeight-jQuery(this).height())})}}static $jscomp$static$init$m1795419079$45$getMaxDuration(){return function(a,b){return!a.css(b)||a.css(b).startsWith("0")?0:Math.max.apply(void 0, +jQuery(a.css(b).split(",")).map(function(){return-1 +class{constructor(e){this.format=e;this.error=[];this.errorCodes=[];this.strippedValue="";this.allowPartial=!1;this.throwError=function(a,b,c){this.error[this.error.length]=b;this.errorCodes[this.errorCodes.length]=a;return"string"==typeof c?c:!0}}setGeneric(e,a){let b;var c=this.format;let d=[],f="",g,h=[],k=0,l={"@":"a-zA-Z\uac00-\ud7a3\u3131-\u314e\u314f-\u3163 s","#":"0-9s","~":"0-9a-zA-Z\uac00-\ud7a3\u3131-\u314e\u314f-\u3163 s"};b=e.replace(new RegExp("[^"+l["~"]+"]","gi"),"");!0===a&&b.length=== +this.strippedValue.length&&(b=b.substring(0,b.length-1));this.strippedValue=b;for(let m=0;mb.length)break}this.allowPartial&&!c&&(f="");this.allowPartial&&(this.nextValidChar=f.lengthh.length)e=void 0!==a&&"round"===a?String(Math.round(Number(e.substring(0,h.length+ +1))/10)):void 0!==a&&"ceil"===a?String(Math.ceil(Number(e.substring(0,h.length+1))/10)):String(Math.floor(Number(e.substring(0,h.length+1))/10));else for(;e.length=e.length?g+"."+e:0k&&(k+=1E3);1===String(k).length&&(k="00"+k);2===String(k).length&&(k="0"+k);return k},c:function(){return this.Y()+"-"+this.m()+"-"+this.d()+"T"+this.H()+":"+this.i()+":"+this.s()+this.P()},d:function(){const k=String(this.j());return 1===k.length?"0"+k:k},D:function(){return c[h.getDay()]},F:function(){return f[h.getMonth()]},g:function(){return 0===h.getHours()?12:12h.getTimezoneOffset()?"+"+l+k:"-"+l+k},P:function(){const k=this.O();return k.substring(0,3)+":"+k.substring(3,5)},r:function(){return this.D()+", "+this.d()+" "+this.M()+" "+this.Y()+ +" "+this.H()+":"+this.i()+":"+this.s()+" "+this.O()},s:function(){const k=String(h.getSeconds());return 1===k.length?"0"+k:k},S:function(){switch(h.getDate()){case 1:return"st";case 2:return"nd";case 3:return"rd";case 21:return"st";case 22:return"nd";case 23:return"rd";case 31:return"st";default:return"th"}},t:function(){return 1===this.L()&&2===this.n()?29:[null,31,28,31,30,31,30,31,31,30,31,30,31][this.n()]},U:function(){return Math.round(h.getTime()/1E3)},w:function(){return h.getDay()},W:function(){var k= +this.N();const l=this.z(),m=364+this.L()-l;if(2>=m&&k<=3-m)return 1;if(2>=l&&5<=k)return(new Date(this.Y()-1,11,31)).formatDate("W");k=(new Date(this.Y(),0,1)).getDay();k=0!==k?k-1:6;return 3>=k?1+Math.floor((l+k)/7):1+Math.floor((l-(7-k))/7)},y:function(){const k=String(this.Y());return k.substring(k.length-2,k.length)},Y:function(){if(h.getFullYear){var k=(new Date("January 1 2001 00:00:00 +0000")).getFullYear();if(2001===k)return h.getFullYear()}k=h.getYear();k%=100;return k+(38>k?2E3:1900)},z:function(){var k= +"January 1 "+this.Y()+" 00:00:00 GMT"+this.O();k=new Date(k);k=h.getTime()-k.getTime();return Math.floor(k/1E3/60/60/24)},Z:function(){return-60*h.getTimezoneOffset()}},h=a?new Date(a):this;e=e.split("");for(a=0;a{const e=class{constructor(a,b){if(void 0===a)throw NC$$module$__$src$natural_core.error("[NA.comm]You must input arguments[0]");(NC$$module$__$src$natural_core.isPlainObject(a)|| +NC$$module$__$src$natural_core.isString(a))&&void 0===b&&(b=a,a=jQuery());if(NC$$module$__$src$natural_core.isPlainObject(a)||NC$$module$__$src$natural_core.isArray(a))a=jQuery(a);void 0===NA$$module$__$src$natural_architecture.config.filterConfig&&(NA$$module$__$src$natural_architecture.config.filterConfig=NA$$module$__$src$natural_architecture.comm.initFilterConfig());let c=!1;jQuery(NA$$module$__$src$natural_architecture.config.filterConfig.beforeInitFilters).each(function(){let d;if((d=this(a))instanceof +Error)return c=!0,!1;void 0!==d&&(a=jQuery(d))});if(c)return a;a.request=new NA$$module$__$src$natural_architecture.comm.request(a,NC$$module$__$src$natural_core.isString(b)?{url:b}:b);a.errorHandlers=[];jQuery(jQuery.map(NA$$module$__$src$natural_architecture.comm,function(d,f){if("function"===typeof NA$$module$__$src$natural_architecture.comm[f]&&"request"!==f)return f})).each(function(d,f){a[f]=function(g){return NA$$module$__$src$natural_architecture.comm[f].call(a,g)}});return a}static $jscomp$static$init$m158876411$0$xhr(){return null}static $jscomp$static$init$m158876411$1$initFilterConfig(){return function(){const a= +[],b=[],c=[],d=[],f=[],g=[],h=NA$$module$__$src$natural_architecture.context.attr("architecture").comm.filters,k=[],l=NA$$module$__$src$natural_architecture.context.attr("core").spltSepa;for(const m in h)void 0!==h[m].order&&k.push(h[m].order+l+m);k.sort();for(const m in h)void 0===h[m].order&&k.push(m);jQuery(k).each(function(){var m=this.split(l);m=1class{constructor(a,b){this.options={url:null,referrer:window.location.href,contentType:"application/json; charset=utf-8",cache:!1,async:!0,type:"POST",data:null,dataIsArray:!1,dataType:"json",urlSync:!0,crossDomain:!1,browserHistory:!0,append:!1,target:null};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("architecture").comm.request.options)}catch(c){}jQuery.extend(this.options,b);this.attrObj= +{};this.obj=a;if(null===this.options.data){if(NC$$module$__$src$natural_core.isWrappedSet(a)){if(!NC$$module$__$src$natural_core.isElement(a))try{if(this.options.data=this.options.dataIsArray?a.get():a.get(0),this.options.dataIsArray&&"array"===NC$$module$__$src$natural_core.type(this.options.data)||"object"===NC$$module$__$src$natural_core.type(this.options.data))this.options.data=JSON.stringify(this.options.data)}catch(c){this.options.data=null}}else if(null!=a)try{this.options.data=a,"object"=== +NC$$module$__$src$natural_core.type(this.options.data)&&(this.options.data=JSON.stringify(a))}catch(c){this.options.data=null}null!=this.options.data&&"GET"===this.options.type.toUpperCase()&&(a=this.options.data.charAt(0),b=this.options.data.charAt(this.options.data.length-1),"{"===a&&"}"===b||"["===a&&"]"===b)&&(this.options.data="q="+encodeURI(this.options.data))}}attr(a,b){if(void 0===a)return this.attrObj;if(void 0===b)return void 0!==this.attrObj&&void 0!==this.attrObj[a]?this.attrObj[a]:void 0; +void 0===this.attrObj&&(this.attrObj={});this.attrObj[a]=b;return this.obj}removeAttr(a){void 0!==this.attrObj[a]&&delete this.attrObj[a];return this}param(a){if(NC$$module$__$src$natural_core.string.isEmpty(a)){if(0>this.options.url.indexOf("?"))return{};a={};const b=this.options.url.split("?")[1].split("&");for(let c=0;c +{const e=class{constructor(a,b){if(void 0!==a.attr("id")&&1| |\-/gi,""));a.addClass("view_context__");a.instance("cont",b);b.view=a;return b}static $jscomp$static$init$m158876411$6$trInit(){return function(a, +b){a.request=b;NA$$module$__$src$natural_architecture.cont.aop.wrap.call(this,a);void 0!==a.init&&a.init(a.view,b)}}static $jscomp$static$init$m158876411$7$aop(){return{pointcuts:{regexp:{fn:function(a,b,c){return(a instanceof RegExp?a:new RegExp(a)).test(c)}}},wrap:function(a){if(NA$$module$__$src$natural_architecture.context.attr("architecture").cont&&NA$$module$__$src$natural_architecture.context.attr("architecture").cont.advisors&&0{const e=class{static $jscomp$static$init$m158876411$8$attrObj(){return{}}static $jscomp$static$init$m158876411$9$attr(){return function(a,b){if(void 0!==a)if(void 0!== +b)NA$$module$__$src$natural_architecture.context.attrObj[a]=b;else return NA$$module$__$src$natural_architecture.context.attrObj[a];return this}}};e.attrObj=e.$jscomp$static$init$m158876411$8$attrObj();e.attr=e.$jscomp$static$init$m158876411$9$attr();return e})()}static $jscomp$static$init$m158876411$14$config(){return class{}}}NA$$module$__$src$natural_architecture.ajax=NA$$module$__$src$natural_architecture.$jscomp$static$init$m158876411$10$ajax();NA$$module$__$src$natural_architecture.comm=NA$$module$__$src$natural_architecture.$jscomp$static$init$m158876411$11$comm(); +NA$$module$__$src$natural_architecture.cont=NA$$module$__$src$natural_architecture.$jscomp$static$init$m158876411$12$cont();NA$$module$__$src$natural_architecture.context=NA$$module$__$src$natural_architecture.$jscomp$static$init$m158876411$13$context();NA$$module$__$src$natural_architecture.config=NA$$module$__$src$natural_architecture.$jscomp$static$init$m158876411$14$config();var module$__$src$natural_architecture={};module$__$src$natural_architecture.NA=NA$$module$__$src$natural_architecture;/* + Natural-DATA v1.0.0 + + Released under the LGPL v2.1 license + Date: 2014-09-26T11:11Z + + Copyright 2014 Goldman Kim(bbalganjjm@gmail.com) +*/ +class ND$$module$__$src$natural_data{datafilter(e){return ND$$module$__$src$natural_data.data.filter(this,e)}datasort(e,a){return ND$$module$__$src$natural_data.data.sort(this,e,a)}formatter(e){return new ND$$module$__$src$natural_data.formatter(this,e)}validator(e){return new ND$$module$__$src$natural_data.validator(this,e)}static $jscomp$static$init$m1306995634$68$ds(){return(()=>{const e=class{constructor(a,b){var c=jQuery(NA$$module$__$src$natural_architecture.context.attr("architecture").page.context); +0===c.length&&NC$$module$__$src$natural_core.warn('[ND.ds]Context element is missing. Please specify the correct Natural-JS\'s main context element selector to "NA.context.attr("architecture").page.context" property in "natural.config.js" file');let d=c.find("var#data_sync_temp__");0===d.length&&(d=c.append('').find("var#data_sync_temp__"));this.viewContext=d;c=this.viewContext.instance("ds");void 0!==c?(c.inst=a,void 0!==b&&!0===b&&c.observable.push(a)):(c=this,c.inst= +a,c.observable=[],c.observable.push(a),this.viewContext.instance("ds",c));return c}static $jscomp$static$init$m1306995634$0$instance(){return function(a,b){return new ND$$module$__$src$natural_data.ds(a,b)}}remove(){const a=this.inst,b=this.observable;if(a&&b)for(let c=0;c{const e=class{constructor(a,b){this.options={data:NC$$module$__$src$natural_core.isPlainObject(a)?N$$module$__$src$natural_js(a):a,rules:b,isElement:!1,createEvent:!0,context:null,targetEle:N$$module$__$src$natural_js()};if(NC$$module$__$src$natural_core.isElement(b)||NC$$module$__$src$natural_core.isString(b)){const c= +this.options;c.isElement=!0;c.context=N$$module$__$src$natural_js(b);if(0NC$$module$__$src$natural_core.string.trimToEmpty(a).length)return a;a=a.replace(/[^0-9*]/g,"");10b[0])return void 0!== +b[1]?NC$$module$__$src$natural_core.string.trimToEmpty(a.substring(0,d))+b[1]:a.substring(0,d)}return a}}static $jscomp$static$init$m1306995634$18$replace(){return function(a,b,c){if(void 0===b||2>b.length)throw NC$$module$__$src$natural_core.error("[ND.formatter.replace]You must input args[0](target string) and args[1](replace string)");a=a.split(String(b[0])).join(String(b[1]));"undefined"!=typeof b[2]&&"true"===String(b[2])&&(this.vo[c.attr("name")]=a);return a}}static $jscomp$static$init$m1306995634$19$lpad(){return function(a, +b){if(void 0===b||2>b.length)throw NC$$module$__$src$natural_core.error("[ND.formatter.lpad]You must input args[0](fill length) and args[1](replace string)");return NC$$module$__$src$natural_core.string.lpad(a,Number(b[0]),b[1])}}static $jscomp$static$init$m1306995634$20$rpad(){return function(a,b){if(void 0===b||2>b.length)throw NC$$module$__$src$natural_core.error("[ND.formatter.rpad]You must input args[0](fill length) and args[1](replace string)");return NC$$module$__$src$natural_core.string.rpad(a, +Number(b[0]),b[1])}}static $jscomp$static$init$m1306995634$21$mask(){return function(a,b){if(void 0===b||1>b.length)throw NC$$module$__$src$natural_core.error("[ND.formatter.rpad]You must input args[0](masking rule)");let c="*";2!==b.length||NC$$module$__$src$natural_core.string.isEmpty(b[1])||(c=b[1]);if("phone"===b[0]){a=NC$$module$__$src$natural_core.string.trimToEmpty(a);var d=this.phone(a);a=d.substring(0,d.indexOf("-")+1);b=d.substring(d.lastIndexOf("-"),d.length);d=d.replace(a,"").replace(b, +"");return a+d.replace(/\d/g,c)+b}if("email"===b[0]){if(a=NC$$module$__$src$natural_core.string.trimToEmpty(a),ND$$module$__$src$natural_data.validator.email(a)){b="";for(d=0;3>d;d++)b+=c;return a.replace(/@.*/,"").replace(/.{1,3}$/,b)+a.replace(/.*@/,"@")}}else{if("address"===b[0]){a=NC$$module$__$src$natural_core.string.trimToEmpty(a);a=a.split(" ");let f="",g,h,k;jQuery(a).each(function(){g=NC$$module$__$src$natural_core.string.trimToEmpty(this);h=g.substring(0,1);k=g.substring(g.length-1,g.length); +if(0>"_\uacbd\uae30_\uac15\uc6d0_\ucda9\ubd81_\ucda9\ub0a8_\uc804\ubd81_\uc804\ub0a8_\uacbd\ubd81_\uacbd\ub0a8_\uc81c\uc8fc_".indexOf("_"+g+"_")&&0>"_\ub3c4_\uc2dc_\uad70_\uad6c_".indexOf("_"+k+"_")){let m="";if(-1<"_\uc74d_\uba74_\ub3d9_\ub9ac_\ub85c_\uae38_\uac00_".indexOf("_"+k+"_")&&(new RegExp(/[^0-9*]/)).test(h)){for(var l=0;lf&&" "!==this?c:this}).get().join("");b=1;1d;d++)b+= +c;return this.rrn(a.replace(/.{1,7}$/,b))}}return a}}static $jscomp$static$init$m1306995634$22$generic(){return function(a,b){if(void 0===b||void 0===b[0])throw NC$$module$__$src$natural_core.error("[ND.formatter.generic]You must input args[0](user format rule)");return(new NC$$module$__$src$natural_core.mask(b[0])).setGeneric(String(a))}}static $jscomp$static$init$m1306995634$23$numeric(){return function(a,b){if(void 0===b||void 0===b[0])throw NC$$module$__$src$natural_core.error("[ND.formatter.numeric]You must input args[0](user format rule)"); +return(new NC$$module$__$src$natural_core.mask(b[0])).setNumeric(String(a),b[1])}}};e.commas=e.$jscomp$static$init$m1306995634$1$commas();e.rrn=e.$jscomp$static$init$m1306995634$2$rrn();e.ssn=e.$jscomp$static$init$m1306995634$3$ssn();e.kbrn=e.$jscomp$static$init$m1306995634$4$kbrn();e.kcn=e.$jscomp$static$init$m1306995634$5$kcn();e.upper=e.$jscomp$static$init$m1306995634$6$upper();e.lower=e.$jscomp$static$init$m1306995634$7$lower();e.capitalize=e.$jscomp$static$init$m1306995634$8$capitalize();e.zipcode= +e.$jscomp$static$init$m1306995634$9$zipcode();e.phone=e.$jscomp$static$init$m1306995634$10$phone();e.realnum=e.$jscomp$static$init$m1306995634$11$realnum();e.trimtoempty=e.$jscomp$static$init$m1306995634$12$trimtoempty();e.trimtozero=e.$jscomp$static$init$m1306995634$13$trimtozero();e.trimtoval=e.$jscomp$static$init$m1306995634$14$trimtoval();e.date=e.$jscomp$static$init$m1306995634$15$date();e.time=e.$jscomp$static$init$m1306995634$16$time();e.limit=e.$jscomp$static$init$m1306995634$17$limit();e.replace= +e.$jscomp$static$init$m1306995634$18$replace();e.lpad=e.$jscomp$static$init$m1306995634$19$lpad();e.rpad=e.$jscomp$static$init$m1306995634$20$rpad();e.mask=e.$jscomp$static$init$m1306995634$21$mask();e.generic=e.$jscomp$static$init$m1306995634$22$generic();e.numeric=e.$jscomp$static$init$m1306995634$23$numeric();return e})()}static $jscomp$static$init$m1306995634$70$validator(){return(()=>{const e=class{constructor(a,b){this.validate=function(c){const d=this.options,f=[];let g,h,k,l=0d.rules[t].toString().indexOf("required")&&"required"!==n&&NC$$module$__$src$natural_core.string.isEmpty(String(p[t]))?h.result=!0:h.result=ND$$module$__$src$natural_data.validator[n](NC$$module$__$src$natural_core.string.trimToEmpty(p[t]),m)}catch(r){if(-1c;c++)b+=Number(a.substring(c,c+1))*(c%8+2);return((11-b%11)%10+2)%10===Number(a.substring(12,13))}}static $jscomp$static$init$m1306995634$43$frn_rrn(){return function(a){a=a.replace(/[^0-9*]/g,"");return 13!==NC$$module$__$src$natural_core.string.trimToEmpty(a).length?!1:5<=Number(a.charAt(6))&& +8>=Number(a.charAt(6))?this.frn():this.rrn()}}static $jscomp$static$init$m1306995634$44$kbrn(){return function(a){a=a.replace(/[^0-9*]/g,"");var b=[1,3,7,1,3,7,1,3,5,1];let c;var d=0;for(c=0;7>=c;c++)d+=b[c]*a.charAt(c);b="0"+b[8]*a.charAt(8);b=b.substring(b.length-2,b.length);d+=Math.floor(Number(b.charAt(0)))+Math.floor(Number(b.charAt(1)));d=(10-d%10)%10;return Math.floor(Number(a.charAt(9)))===d}}static $jscomp$static$init$m1306995634$45$kcn(){return function(a){a=a.replace(/[^0-9*]/g,"");if(13!== +a.length)return!1;a=a.split("");const b=[1,2,1,2,1,2,1,2,1,2,1,2];let c=0;for(let d=0;12>d;d++)c+=parseInt(a[d])*b[d];return(10-c%10)%10===a[12]}}static $jscomp$static$init$m1306995634$46$date(){return function(a){var b=a.replace(new RegExp("\\"+NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.dateSepa,"gi"),"");if(8!==NC$$module$__$src$natural_core.string.trimToEmpty(b).length)return!1;a=[31,28,31,30,31,30,31,31,30,31,30,31];const c=b.substring(0,4),d=b.substring(4,6);b= +b.substring(6,8);if(0===b)return!1;let f=!1,g=!1;0===c%4&&(g=0!==c%100,0===c%400&&(g=!0));g?2===Number(d)?b<=a[d-1]+1&&(f=!0):b<=a[d-1]&&(f=!0):b<=a[d-1]&&(f=!0);return f}}static $jscomp$static$init$m1306995634$47$time(){return function(a){return(new RegExp(/^([01]\d|2[0-3])([0-5]\d){0,2}$/)).test(a.replace(/[^0-9]/g,""))}}static $jscomp$static$init$m1306995634$48$accept(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.accept]You must input args[0](accept string)");return(new RegExp("^("+ +b[0]+")$")).test(a)}}static $jscomp$static$init$m1306995634$49$match(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.match]You must input args[0](match string)");return(new RegExp(b[0])).test(a)}}static $jscomp$static$init$m1306995634$50$acceptfileext(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.acceptFileExt]You must input args[0](file extention)");return(new RegExp(".("+b[0]+")$","i")).test(a)}}static $jscomp$static$init$m1306995634$51$notaccept(){return function(a, +b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.notAccept]You must input args[0](refused string)");return!(new RegExp("^("+b[0]+")$")).test(a)}}static $jscomp$static$init$m1306995634$52$notmatch(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.notMatch]You must input args[0](unmatch String)");return!(new RegExp(b[0])).test(a)}}static $jscomp$static$init$m1306995634$53$notacceptfileext(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.notAcceptFileExt]You must input args[0](file extention)"); +return!(new RegExp(".("+b[0]+")$","i")).test(a)}}static $jscomp$static$init$m1306995634$54$equalTo(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.equalTo]You must input args[0](selector string(:input))");return null===NC$$module$__$src$natural_core.string.trimToNull(jQuery(b[0]).val())?!0:a===jQuery(b[0]).val()}}static $jscomp$static$init$m1306995634$55$maxlength(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.maxlength]You must input args[0](length)"); +return NC$$module$__$src$natural_core.string.trimToEmpty(a).length<=Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))}}static $jscomp$static$init$m1306995634$56$minlength(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.minlength]You must input args[0](length)");return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<=NC$$module$__$src$natural_core.string.trimToEmpty(a).length}}static $jscomp$static$init$m1306995634$57$rangelength(){return function(a, +b){if(void 0===b||2>b.length)throw Error("[ND.validator.rangelength]You must input args[0](minimum length) and args[1](maximum length");return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<=NC$$module$__$src$natural_core.string.trimToEmpty(a).length&&NC$$module$__$src$natural_core.string.trimToZero(a).length<=Number(NC$$module$__$src$natural_core.string.trimToEmpty(b[1]))}}static $jscomp$static$init$m1306995634$58$maxbyte(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.maxbyte]You must input args[0](maximum byte)"); +void 0===b[1]&&(b[1]=NA$$module$__$src$natural_architecture.context.attr("core").charByteLength);return NC$$module$__$src$natural_core.string.byteLength(NC$$module$__$src$natural_core.string.trimToEmpty(a),b[1])<=Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))}}static $jscomp$static$init$m1306995634$59$minbyte(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.minbyte]You must input args[0](minimum byte)");void 0===b[1]&&(b[1]=NA$$module$__$src$natural_architecture.context.attr("core").charByteLength); +return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<=NC$$module$__$src$natural_core.string.byteLength(NC$$module$__$src$natural_core.string.trimToEmpty(a),b[1])}}static $jscomp$static$init$m1306995634$60$rangebyte(){return function(a,b){if(void 0===b||2>b.length)throw Error("[ND.validator.rangebyte]You must input args[0](minimum byte) and args[1](maximum byte)");void 0===b[2]&&(b[2]=NA$$module$__$src$natural_architecture.context.attr("core").charByteLength);return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<= +NC$$module$__$src$natural_core.string.byteLength(NC$$module$__$src$natural_core.string.trimToEmpty(a),b[2])&&NC$$module$__$src$natural_core.string.byteLength(NC$$module$__$src$natural_core.string.trimToEmpty(a),b[2])<=Number(NC$$module$__$src$natural_core.string.trimToZero(b[1]))}}static $jscomp$static$init$m1306995634$61$maxvalue(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.maxvalue]You must input args[0](maximum value)");return Number(NC$$module$__$src$natural_core.string.trimToZero(a))<= +Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))}}static $jscomp$static$init$m1306995634$62$minvalue(){return function(a,b){if(void 0===b||void 0===b[0])throw Error("[ND.validator.minvalue]You must input args[0](minimum value)");return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<=Number(NC$$module$__$src$natural_core.string.trimToZero(a))}}static $jscomp$static$init$m1306995634$63$rangevalue(){return function(a,b){if(void 0===b||2>b.length)throw Error("[ND.validator.rangevalue]You must input args[0](minimum value) and args[1](maximum value)"); +return Number(NC$$module$__$src$natural_core.string.trimToZero(b[0]))<=Number(NC$$module$__$src$natural_core.string.trimToZero(a))&&Number(NC$$module$__$src$natural_core.string.trimToZero(a))<=Number(NC$$module$__$src$natural_core.string.trimToZero(b[1]))}}static $jscomp$static$init$m1306995634$64$regexp(){return function(a,b){if(void 0===b||2>b.length)throw Error("[ND.validator.regexp]You must input args[0](regular expression string) and args[1](flag)");return(NC$$module$__$src$natural_core.string.trimToUndefined(b[1])? +new RegExp(b[0],b[1]):new RegExp(b[0])).test(a)}}};e.required=e.$jscomp$static$init$m1306995634$24$required();e.alphabet=e.$jscomp$static$init$m1306995634$25$alphabet();e.integer=e.$jscomp$static$init$m1306995634$26$integer();e.korean=e.$jscomp$static$init$m1306995634$27$korean();e.alphabet_integer=e.$jscomp$static$init$m1306995634$28$alphabet_integer();e.integer_korean=e.$jscomp$static$init$m1306995634$29$integer_korean();e.alphabet_korean=e.$jscomp$static$init$m1306995634$30$alphabet_korean();e.alphabet_integer_korean= +e.$jscomp$static$init$m1306995634$31$alphabet_integer_korean();e.dash_integer=e.$jscomp$static$init$m1306995634$32$dash_integer();e.commas_integer=e.$jscomp$static$init$m1306995634$33$commas_integer();e.number=e.$jscomp$static$init$m1306995634$34$number();e.email=e.$jscomp$static$init$m1306995634$35$email();e.url=e.$jscomp$static$init$m1306995634$36$url();e.zipcode=e.$jscomp$static$init$m1306995634$37$zipcode();e.decimal=e.$jscomp$static$init$m1306995634$38$decimal();e.phone=e.$jscomp$static$init$m1306995634$39$phone(); +e.rrn=e.$jscomp$static$init$m1306995634$40$rrn();e.ssn=e.$jscomp$static$init$m1306995634$41$ssn();e.frn=e.$jscomp$static$init$m1306995634$42$frn();e.frn_rrn=e.$jscomp$static$init$m1306995634$43$frn_rrn();e.kbrn=e.$jscomp$static$init$m1306995634$44$kbrn();e.kcn=e.$jscomp$static$init$m1306995634$45$kcn();e.date=e.$jscomp$static$init$m1306995634$46$date();e.time=e.$jscomp$static$init$m1306995634$47$time();e.accept=e.$jscomp$static$init$m1306995634$48$accept();e.match=e.$jscomp$static$init$m1306995634$49$match(); +e.acceptfileext=e.$jscomp$static$init$m1306995634$50$acceptfileext();e.notaccept=e.$jscomp$static$init$m1306995634$51$notaccept();e.notmatch=e.$jscomp$static$init$m1306995634$52$notmatch();e.notacceptfileext=e.$jscomp$static$init$m1306995634$53$notacceptfileext();e.equalTo=e.$jscomp$static$init$m1306995634$54$equalTo();e.maxlength=e.$jscomp$static$init$m1306995634$55$maxlength();e.minlength=e.$jscomp$static$init$m1306995634$56$minlength();e.rangelength=e.$jscomp$static$init$m1306995634$57$rangelength(); +e.maxbyte=e.$jscomp$static$init$m1306995634$58$maxbyte();e.minbyte=e.$jscomp$static$init$m1306995634$59$minbyte();e.rangebyte=e.$jscomp$static$init$m1306995634$60$rangebyte();e.maxvalue=e.$jscomp$static$init$m1306995634$61$maxvalue();e.minvalue=e.$jscomp$static$init$m1306995634$62$minvalue();e.rangevalue=e.$jscomp$static$init$m1306995634$63$rangevalue();e.regexp=e.$jscomp$static$init$m1306995634$64$regexp();return e})()}static $jscomp$static$init$m1306995634$71$data(){return(()=>{const e=class{static $jscomp$static$init$m1306995634$65$filter(){return function(a, +b){if("function"===typeof b)return NC$$module$__$src$natural_core.isWrappedSet(a)?N$$module$__$src$natural_js(jQuery.grep(a.toArray(),b)):jQuery.grep(a,b);if("string"===NC$$module$__$src$natural_core.type(b)){b=b.replace(/ /g,"").replace(/\|\|/g," || item.").replace(/&&/g," || item.");const c=new Function("item","return item."+b);return NC$$module$__$src$natural_core.isWrappedSet(a)?N$$module$__$src$natural_js(jQuery.grep(a.toArray(),function(d){return c(d)})):jQuery.grep(a,function(d){return c(d)})}return a}}static $jscomp$static$init$m1306995634$66$sortBy(){return function(a, +b){return function(c,d){c=c[a];d=d[a];Number(c)&&Number(d)&&(c=Number(c),d=Number(d));return cd?1*b:0}}}static $jscomp$static$init$m1306995634$67$sort(){return function(a,b,c){return a.sort(this.sortBy(b,c?-1:1))}}};e.filter=e.$jscomp$static$init$m1306995634$65$filter();e.sortBy=e.$jscomp$static$init$m1306995634$66$sortBy();e.sort=e.$jscomp$static$init$m1306995634$67$sort();return e})()}}ND$$module$__$src$natural_data.ds=ND$$module$__$src$natural_data.$jscomp$static$init$m1306995634$68$ds(); +ND$$module$__$src$natural_data.formatter=ND$$module$__$src$natural_data.$jscomp$static$init$m1306995634$69$formatter();ND$$module$__$src$natural_data.validator=ND$$module$__$src$natural_data.$jscomp$static$init$m1306995634$70$validator();ND$$module$__$src$natural_data.data=ND$$module$__$src$natural_data.$jscomp$static$init$m1306995634$71$data();var module$__$src$natural_data={};module$__$src$natural_data.ND=ND$$module$__$src$natural_data;/* + Natural-UI v1.0.0 + + Released under the LGPL v2.1 license + Date: 2014-09-26T11:11Z + + Copyright 2014 Goldman Kim(bbalganjjm@gmail.com) +*/ +class NU$$module$__$src$natural_ui{alert(e,a){return new NU$$module$__$src$natural_ui.alert(this,e,a)}button(e){if(this.is("input[type='button'], button, a"))return this.each(function(){return new NU$$module$__$src$natural_ui.button(N$$module$__$src$natural_js(this),e)})}datepicker(e){return new NU$$module$__$src$natural_ui.datepicker(this,e)}popup(e){return new NU$$module$__$src$natural_ui.popup(this,e)}tab(e){return new NU$$module$__$src$natural_ui.tab(this,e)}select(e){return new NU$$module$__$src$natural_ui.select(this, +e)}form(e){return new NU$$module$__$src$natural_ui.form(this,e)}list(e){return new NU$$module$__$src$natural_ui.list(this,e)}grid(e){return new NU$$module$__$src$natural_ui.grid(this,e)}pagination(e){return new NU$$module$__$src$natural_ui.pagination(this,e)}tree(e){return new NU$$module$__$src$natural_ui.tree(this,e)}static $jscomp$static$init$506130788$37$ui(){return(()=>{const e=class{static $jscomp$static$init$506130788$0$iteration(){return{render:function(a,b,c,d,f){const g=this.options,h=this, +k=h.tempRowEle.clone(!0,!0);g.context.append(k);const l=N$$module$__$src$natural_js(g.data[a]).form({context:k,html:g.html,validate:g.validate,extObj:h,extRow:a,revert:g.revert,unbind:!1,cache:g.cache});null!==g.rowHandlerBeforeBind&&g.rowHandlerBeforeBind.call(h,a,k,g.data[a]);l.bind();null!==g.rowHandler&&g.rowHandler.call(h,a,k,g.data[a]);0"+d,function(f){const g=N$$module$__$src$natural_js(this);let h,k;if(!N$$module$__$src$natural_js(f.target).is(b.checkAllTarget)&& +!N$$module$__$src$natural_js(f.target).is(b.checkSingleTarget)){g.hasClass(a+"_selected__")?(b.row=-1,k=!1):(b.row=b.context.find(">"+d).index(g),k=!0);b.multiselect||b.unselect||(b.row=b.context.find(">"+d).index(g),k=!0);null!==b.onBeforeSelect&&(h=b.onBeforeSelect.call(c,b.row,g,b.data,b.beforeRow,f));if(void 0===h||!0===h)k?(b.multiselect||b.context.find("> "+d+":eq("+b.beforeRow+")").removeClass(a+"_selected__"),g.addClass(a+"_selected__"),b.beforeRow=b.row):g.removeClass(a+"_selected__");null!== +b.onSelect&&b.onSelect.call(c,b.row,g,b.data,b.beforeRow,f)}})},checkAll:function(a){const b=this.options,c=this.contextEle,d="grid"===a?this.thead.find(b.checkAll):N$$module$__$src$natural_js(b.checkAll),f="grid"===a?"tbody > tr > td":"li";d.on("click."+a+".checkAll",function(){N$$module$__$src$natural_js(this).prop("checked")?c.find(f+" "+b.checkAllTarget+":not(':checked')").prop("checked",!0):c.find(f+" "+b.checkAllTarget+":checked").removeProp("checked")});c.on("click."+a+".checkAllTarget",f+ +" "+b.checkAllTarget,function(){c.find(f+" "+b.checkAllTarget).length===c.find(f+" "+b.checkAllTarget+":checked").length?d.prop("checked",!0):d.removeProp("checked")})},checkSingle:function(a){const b=this.options,c=this.contextEle,d="grid"===a?"tbody > tr > td":"li";c.on("click.grid.checkSingleTarget",d+" "+b.checkSingleTarget,function(){c.find(d+" "+b.checkSingleTarget).not(this).removeAttr("checked")})},move:function(a,b,c){if(a!==b){const d=this.options;let f;b>d.data.length-1?(f="after",b=d.data.length- +1,d.data.push(d.data.splice(a,1)[0])):(f="before",d.data.splice(ad.data.length-1?(f="after",b=d.data.length-1,d.data.push(d.data[a])):(f="before",d.data.splice(b,0,d.data[a]));c="grid"===c?"tbody": +"li";d.context.find(c+":eq("+b+")")[f](d.context.find(c+":eq("+a+")").clone(!0,!0))}return this}}}static $jscomp$static$init$506130788$1$draggable(){return{events:function(a,b,c,d){const f=this;this.on("mousedown"+a+" touchstart"+a,function(g){const h=g.originalEvent.touches?g.originalEvent.touches[0]:g;if(g.originalEvent.touches||1===(g.which||g.button)){let k;void 0!==b&&(k=b.call(this,g,f,h.pageX,h.pageY));!1!==k&&(N$$module$__$src$natural_js(document).on("mousemove"+a+" touchmove"+a,function(l){N$$module$__$src$natural_js(document).on("dragstart"+ +a+" selectstart"+a,function(){return!1});const m=l.originalEvent.touches?l.originalEvent.touches[0]:l;void 0!==c&&c.call(this,l,f,m.pageX,m.pageY);l.originalEvent.touches||l.preventDefault();l.stopImmediatePropagation();l.stopPropagation();if(!l.originalEvent.touches)return!1}),N$$module$__$src$natural_js(document).on("mouseup"+a+" touchend"+a,function(l){N$$module$__$src$natural_js(document).off("dragstart"+a+" selectstart"+a+" mousemove"+a+" touchmove"+a+" mouseup"+a+" touchend"+a);void 0!==d&& +d.call(this,l,f);l.originalEvent.touches||l.preventDefault();l.stopImmediatePropagation();l.stopPropagation();if(!l.originalEvent.touches)return!1}))}g.originalEvent.touches||g.preventDefault();g.stopImmediatePropagation();g.stopPropagation();if(!g.originalEvent.touches)return!1})},moveX:function(a,b,c){const d=this;if(void 0!==b&&ac)return a=c,!1;N$$module$__$src$natural_js(["-webkit-transform","-ms-transform","transform"]).each(function(){d.css(this,"translateX("+ +a+"px)")})},moveY:function(a,b,c){const d=this;if(void 0!==b&&ac)return a=c,!1;N$$module$__$src$natural_js(["-webkit-transform","-ms-transform","transform"]).each(function(){d.css(this,"translateY("+a+"px)")})}}}static $jscomp$static$init$506130788$2$scroll(){return{paging:function(a,b,c,d,f){const g=this.options,h=this;a.on("scroll",function(){if(0=g.context.height()- +k.height()&&(c=g.context.find(d).length,-1=g.scrollPaging.idx+b&&(0=g.data.length?g.data.length-g.scrollPaging.idx:b,g.scrollPaging.idx{const e=class{constructor(a,b,c){this.options={obj:a,context:a, +container:null,msgContext:N$$module$__$src$natural_js(),msgContents:null,msg:b,vars:c,html:!1,top:void 0,left:void 0,width:0,height:0,isInput:!1,isWindow:a===window||a.get(0)===window||a.is("body"),title:a===window||a.get(0)===window||a.get(0)===window.document||a.is("body")?void 0:a.attr("title"),button:!0,okButtonOpts:null,cancelButtonOpts:null,closeMode:"remove",modal:!0,onOk:null,onCancel:null,onBeforeShow:null,onShow:null,onBeforeHide:null,onHide:null,onBeforeRemove:null,onRemove:null,overlayColor:null, +overlayClose:!0,escClose:!0,confirm:!1,alwaysOnTop:!1,alwaysOnTopCalcTarget:"div, span, ul, p, nav, article, section, header, footer, aside",dynPos:!0,windowScrollLock:!0,draggable:!1,draggableOverflowCorrection:!0,draggableOverflowCorrectionAddValues:{top:0,bottom:0,left:0,right:0},saveMemory:!1};try{this.options.container=NA$$module$__$src$natural_architecture.context.attr("architecture").page.context,jQuery.extend(!0,this.options,NA$$module$__$src$natural_architecture.context.attr("ui").alert), +NC$$module$__$src$natural_core.isString(this.options.container)&&(this.options.container=N$$module$__$src$natural_js(this.options.container))}catch(d){throw NC$$module$__$src$natural_core.error("NU.alert",d);}if(0===N$$module$__$src$natural_js(this.options.container).length)throw NC$$module$__$src$natural_core.error('[NU.alert]Container element is missing. please specify the correct element selector that will contain the message dialog\'s element. it can be defined in the "NA.context.attr("ui").alert.container" property of "natural.config.js" file.'); +N$$module$__$src$natural_js(a).is(":input")&&(this.options.isInput=!0);void 0!==b&&NC$$module$__$src$natural_core.isPlainObject(b)&&(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onOk"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onCancel"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onBeforeShow"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onShow"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onBeforeHide"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b, +"alert","onHide"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onBeforeRemove"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","onRemove"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","okButtonOpts"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"alert","cancelButtonOpts"),jQuery.extend(!0,this.options,b),NC$$module$__$src$natural_core.isString(this.options.container)&&(this.options.container=N$$module$__$src$natural_js(this.options.container)),b.hasOwnProperty("title")&& +(this.options.title=b.title));this.options.isWindow&&(this.options.context=N$$module$__$src$natural_js("body"));this.options.isInput?(NU$$module$__$src$natural_ui.alert.wrapInputEle.call(this),this.options.context.instance("alert",this)):(NU$$module$__$src$natural_ui.alert.wrapEle.call(this),this.options.msgContents.instance("alert",this),this.options.saveMemory&&(this.options.msg=null,this.options.vars=null));return this}static $jscomp$static$init$506130788$4$wrapEle(){return function(){const a= +this.options;var b={display:"none",position:a.isWindow?"fixed":"absolute",cursor:"not-allowed",padding:0};a.isWindow||(b["border-radius"]="0px"!==a.context.css("border-radius")?a.context.css("border-radius"):"0px");var c=0;a.alwaysOnTop&&(c=NC$$module$__$src$natural_core.element.maxZindex(N$$module$__$src$natural_js(a.alwaysOnTopCalcTarget)),b["z-index"]=String(c+1));null!==a.overlayColor&&(b["background-color"]=a.overlayColor);a.msgContext=a[a.isWindow?"container":"context"][a.isWindow?"append": +"after"](N$$module$__$src$natural_js('
    ').css(b))[a.isWindow?"find":"siblings"](".block_overlay__:"+(a.isWindow?"last":"first"));a.msgContext.addClass("alert_overlay__");void 0!==a.vars&&(a.msg=NC$$module$__$src$natural_core.message.replaceMsgVars(a.msg,a.vars));b={display:"none",position:a.isWindow?"fixed":"absolute"};a.alwaysOnTop&&(b["z-index"]=String(c+2));c="";void 0!==a.title&&(c='
    '+ +a.title+'
    ');let d="";a.button&&(d='
    ");a.msgContents=a.msgContext.after(N$$module$__$src$natural_js('
    '+ +c+'
    '+d+"
    ").css(b)).next(".block_overlay_msg__:last");a.msgContents.addClass("alert__ hidden__");const f=this;a.msgContents.find(".msg_title_box__ .msg_title_close_btn__").on("click.alert touchend.alert",function(g){g.preventDefault();if(null!==a.onCancel){if(0!==a.onCancel.call(f,a.msgContext,a.msgContents))f[a.closeMode]()}else f[a.closeMode]()});a.msgContents.find(".msg_box__")[a.html?"html":"text"](a.msg);if("function"===typeof a.width||0r-q?(p.top=(a.isWindow?0:r+(q-r))+a.draggableOverflowCorrectionAddValues.top,p.top-=parseFloat(a.msgContents.css("margin-top"))):r+v>q+t&&(p.top=(a.isWindow?t-v:q+t-v)+a.draggableOverflowCorrectionAddValues.bottom,p.top-=parseFloat(a.msgContents.css("margin-top")));0>p.top&&(p.top=a.draggableOverflowCorrectionAddValues.top,"fixed"===a.msgContents.css("position")&&(p.top-=parseFloat(a.msgContents.css("margin-top"))));0>a.msgContents.offset().left? +p.left=a.draggableOverflowCorrectionAddValues.left:a.msgContents.offset().left+a.msgContents.outerWidth()>u&&(p.left=u-a.msgContents.outerWidth()+a.draggableOverflowCorrectionAddValues.right);NC$$module$__$src$natural_core.isEmptyObject(p)||a.msgContents.animate(p,200)}a.msgContents.fadeTo(100,"1.0");N$$module$__$src$natural_js(window.document).off("dragstart.alert selectstart.alert mousemove.alert touchmove.alert mouseup.alert touchend.alert")})}})}}}static $jscomp$static$init$506130788$5$resetOffSetEle(){return function(a){a.context.position(); +if(a.context.is(":visible")){const c=N$$module$__$src$natural_js(window).height(),d=N$$module$__$src$natural_js(window).width(),f=a.msgContents.height(),g=a.msgContents.width();var b={height:a.isWindow?window.innerHeight?window.innerHeight:c:a.context.outerHeight()+"px",width:a.isWindow?d:a.context.outerWidth()+"px"};let h=0;a.isWindow?(b.top="0",b.left="0"):(b["margin-top"]="-"+(parseFloat(b.height)+parseFloat(a.context.css("margin-bottom")))+"px",h=parseFloat(a.context.css("margin-left")),b.left= +String(a.context.position().left+h)+"px");a.msgContext.css(b).hide().show();!0!==a.msgContents.data("isMoved")&&(b={},a.isWindow?void 0!==a.top?(b.position="absolute",b.top=String(a.top)+"px"):(b.top="0",b["margin-top"]=String(Math.floor(a.msgContext.height()/2-f/2)-1)+"px"):void 0!==a.top?(b.position="absolute",b.top=String(a.top)+"px"):b["margin-top"]="-"+String(Math.floor(a.msgContext.height()/2+f/2+parseFloat(a.context.css("margin-bottom")))+1)+"px",void 0!==a.left?b.left=String(a.left)+"px": +(a.msgContents.width(g),b.left=String(Math.floor(a.context.position().left+h+(a.msgContext.width()/2-g/2))-1)+"px"),f>c&&(b["margin-top"]=String(N$$module$__$src$natural_js(window).scrollTop())+"px",b.position="absolute"),g>d&&(b.left="0",b.position="absolute"),a.isWindow&&c>f&&d>g&&(b.position="fixed"),a.msgContents.css(b));a.msgContents.show()}else a.msgContext.hide(),a.msgContents.hide()}}static $jscomp$static$init$506130788$6$wrapInputEle(){return function(){const a=this.options;let b=!1;void 0!== +a.context.instance("alert")&&(a.context.instance("alert").remove(),b=!0);if(0(window.innerWidth?window.innerWidth:N$$module$__$src$natural_js(window).width())?(a.msgContents=a.msgContext.before('').prev(".msg__"),a.msgContents.removeClass("orgin_left__").addClass("orgin_right__"), +c=!0):(a.msgContents=a.msgContext.after('').next(".msg__"),a.msgContents.removeClass("orgin_right__").addClass("orgin_left__"),c=!1),a.msgContents.addClass("alert__ alert_tooltip__ hidden__"),a.msgContents.append('');a.alwaysOnTop&&a.msgContents.css("z-index",NC$$module$__$src$natural_core.element.maxZindex(a.container.find(a.alwaysOnTopCalcTarget))+ +1);const d=this;a.msgContents.find(".msg_close__").on("click",function(g){g.preventDefault();d.remove()});const f=a.msgContents.find(".msg_line_box__").empty();NC$$module$__$src$natural_core.isArray(a.msg)?(a.msgContents.find(".msg_line_box__").empty(),N$$module$__$src$natural_js(a.msg).each(function(g,h){void 0!==a.vars&&(a.msg[g]=NC$$module$__$src$natural_core.message.replaceMsgVars(h,a.vars));f.append("
  • "+a.msg[g]+"
  • ")})):(void 0!==a.vars&&(a.msg=NC$$module$__$src$natural_core.message.replaceMsgVars(a.msg, +a.vars)),f.append("
  • "+a.msg+"
  • "));c&&a.msgContents.css("margin-left","-"+String(a.msgContents.outerWidth())+"px")}else this.remove()}}context(a){return void 0!==a?this.options.context.find(a):this.options.context}show(){const a=this.options,b=this;null!==a.onBeforeShow&&a.onBeforeShow.call(b,a.msgContext,a.msgContents);N$$module$__$src$natural_js(".docs__>.docs_tab_context__").css("z-index","0");a.isInput?NC$$module$__$src$natural_core.isEmptyObject(a.msg)||(a.msgContext.parent().css({"white-space":"normal"}), +a.msgContents.show(),a.iTime=setTimeout(function(){a.msgContext.parent().css({"white-space":""});b[a.closeMode]()},a.input.displayTimeout),a.msgContents.removeClass("hidden__").addClass("visible__")):(a.dynPos&&!a.isWindow?(NU$$module$__$src$natural_ui.alert.resetOffSetEle(a),a.time=setInterval(function(){a.context.is(":visible")&&NU$$module$__$src$natural_ui.alert.resetOffSetEle(a)},500)):(a.resizeHandler=function(){NU$$module$__$src$natural_ui.alert.resetOffSetEle(a)},N$$module$__$src$natural_js(window).off("resize.alert", +a.resizeHandler).on("resize.alert",a.resizeHandler).trigger("resize.alert")),a.isWindow||a.msgContext.closest(".msg_box__").css("position","relative"),!0===a.button&&a.msgContents.find(".buttonBox__ .confirm__").get(0).focus(),a.msgContents.removeClass("hidden__").addClass("visible__"),a.msgContents.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.msgContents),function(){null!==a.onShow&&a.onShow.call(b,a.msgContext,a.msgContents)}).trigger("nothing"));a.escClose&&(a.keyupHandler=function(c){if(27=== +(c.keyCode?c.keyCode:c.which?c.which:c.charCode))if(null!==a.onCancel){if(0!==a.onCancel.call(b,a.msgContext,a.msgContents))b[a.closeMode]()}else b[a.closeMode]()},N$$module$__$src$natural_js(document).off("keyup.alert",a.keyupHandler).on("keyup.alert",a.keyupHandler));return this}hide(){const a=this.options;null!==a.onBeforeHide&&a.onBeforeHide.call(this,a.msgContext,a.msgContents);N$$module$__$src$natural_js(".docs__>.docs_tab_context__").css("z-index","");a.isInput?(a.msgContents.removeClass("visible__").addClass("hidden__"), +a.msgContents.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.msgContents),function(){clearTimeout(a.iTime);a.msgContents.remove();null!==a.onHide&&a.onHide.call(this,a.msgContext,a.msgContents)}).trigger("nothing")):(a.isWindow||a.msgContext.closest(".msg_box__").css("position",""),a.msgContext.hide(),a.msgContents.removeClass("visible__").addClass("hidden__"),a.msgContents.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.msgContents),function(){a.msgContents.hide(); +null!==a.onHide&&a.onHide.call(this,a.msgContext,a.msgContents)}).trigger("nothing"));N$$module$__$src$natural_js(window).off("resize.alert",a.resizeHandler);a.escClose&&N$$module$__$src$natural_js(document).off("keyup.alert",a.keyupHandler);return this}remove(){const a=this.options;null!==a.onBeforeRemove&&a.onBeforeRemove.call(this,a.msgContext,a.msgContents);N$$module$__$src$natural_js(".docs__>.docs_tab_context__").css("z-index","");a.isInput?(a.msgContents.removeClass("visible__").addClass("hidden__"), +a.msgContents.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.msgContents),function(){clearTimeout(a.iTime);a.msgContents.remove();null!==a.onRemove&&a.onRemove.call(this,a.msgContext,a.msgContents)}).trigger("nothing")):(clearInterval(a.time),a.isWindow||a.msgContext.closest(".msg_box__").css("position",""),a.msgContext.remove(),a.msgContents.removeClass("visible__").addClass("hidden__"),a.msgContents.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.msgContents),function(){a.msgContents.remove(); +a.msgContents.hasClass("popup__")&&NC$$module$__$src$natural_core.gc.ds();null!==a.onRemove&&a.onRemove.call(this,a.msgContext,a.msgContents)}).trigger("nothing"));N$$module$__$src$natural_js(window).off("resize.alert",a.resizeHandler);a.escClose&&N$$module$__$src$natural_js(document).off("keyup.alert",a.keyupHandler);return this}};e.wrapEle=e.$jscomp$static$init$506130788$4$wrapEle();e.resetOffSetEle=e.$jscomp$static$init$506130788$5$resetOffSetEle();e.wrapInputEle=e.$jscomp$static$init$506130788$6$wrapInputEle(); +return e})()}static $jscomp$static$init$506130788$39$button(){return(()=>{const e=class{constructor(a,b){this.options={context:a,size:"none",color:"none",type:"none",disable:!1,onBeforeCreate:null,onCreate:null};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").button)}catch(c){throw NC$$module$__$src$natural_core.error("NU.button",c);}jQuery.extend(this.options,NC$$module$__$src$natural_core.element.toOpts(this.options.context));void 0!==b&&(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b, +"button","onBeforeCreate"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"button","onCreate"),jQuery.extend(this.options,b));this.options.context.addClass("button__");this.options.onBeforeCreate&&this.options.onBeforeCreate.call(this,this.options.context,this.options);NU$$module$__$src$natural_ui.button.wrapEle.call(this);this.options.context.instance("button",this);this.options.onCreate&&this.options.onCreate.call(this,this.options.context,this.options);return this}static $jscomp$static$init$506130788$7$wrapEle(){return function(){const a= +this.options;a.disable?this.disable():this.enable();a.context.is("a")&&a.context.attr("onselectstart","return false;");if(a.context.is("a")||a.context.is("button")||a.context.is("input[type='button']"))a.context.removeClass("btn_common__ btn_smaller__ btn_small__ btn_medium__ btn_large__ btn_big__ btn_primary__ btn_primary_container__ btn_secondary__ btn_secondary_container__ btn_tertiary__ btn_tertiary_container__ btn_filled__ btn_outlined__ btn_elevated__"),"none"!==a.size&&(a.context.addClass("btn_common__"), +a.context.addClass("btn_"+a.size+"__")),"none"!==a.color&&a.context.addClass("btn_"+a.color+"__ "),"none"!==a.type&&a.context.addClass("btn_"+a.type+"__")}}context(a){return void 0!==a?this.options.context.find(a):this.options.context}disable(){const a=this.options.context;a.is("a")?(a.off("click.button"),a.tpBind("click.button",NC$$module$__$src$natural_core.event.disable)):a.prop("disabled",!0);a.addClass("btn_disabled__");return this}enable(){const a=this.options.context;a.is("a")?a.off("click", +NC$$module$__$src$natural_core.event.disable):a.prop("disabled",!1);a.removeClass("btn_disabled__");return this}};e.wrapEle=e.$jscomp$static$init$506130788$7$wrapEle();return e})()}static $jscomp$static$init$506130788$40$datepicker(){return(()=>{const e=class{constructor(a,b){this.options={context:a,contents:N$$module$__$src$natural_js('
    '),monthonly:!1,focusin:!0,yearsPanelPosition:"left",monthsPanelPosition:"left",minYear:200,maxYear:200,yearChangeInput:!1,monthChangeInput:!1, +touchMonthChange:!1,scrollMonthChange:!1,minDate:null,maxDate:null,holiday:{repeat:null,once:null},onChangeYear:null,onChangeMonth:null,onSelect:null,onBeforeShow:null,onShow:null,onBeforeHide:null,onHide:null};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").datepicker),b&&!0===b.monthonly&&NA$$module$__$src$natural_architecture.context.attr("ui").datepicker.monthonlyOpts&&jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").datepicker.monthonlyOpts)}catch(c){throw NC$$module$__$src$natural_core.error("NU.datepicker", +c);}void 0!==b&&(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onChangeYear"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onChangeMonth"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onBeforeShow"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onShow"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"datepicker","onBeforeHide"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b, +"datepicker","onHide"),jQuery.extend(this.options,b));"top"===this.options.yearsPanelPosition&&"top"===this.options.monthsPanelPosition&&!0===this.options.monthonly&&(NC$$module$__$src$natural_core.warn('[NU.datepicker]This option combination({ yearsPanelPosition : "top", monthsPanelPosition : "top", monthonly : true }) is not suppored.'),this.options.yearsPanelPosition="left",this.options.monthsPanelPosition="left");this.options.context.addClass("datepicker__");NU$$module$__$src$natural_ui.datepicker.wrapEle.call(this); +this.options.context.instance("datepicker",this);return this}static $jscomp$static$init$506130788$8$checkMinMaxDate(){return function(){const a=this.options,b=a.context.val();if(4===b.length){if(null!=a.minDate&&4<=a.minDate.length&&Number(b) +Number(a.maxDate.substring(0,4)))return a.context.val(a.maxDate.substring(0,4)).trigger("keyup.datepicker",[!0]),a.context.alert(NC$$module$__$src$natural_core.message.get(a.message,"maxDate",[a.maxDate])).show(),!1}else if(6===b.length){if(null!=a.minDate&&6<=a.minDate.length&&Number(b)Number(a.maxDate.substring(0,6)))return a.context.val(a.maxDate.substring(0,6)).trigger("keyup.datepicker",[!0]),a.context.alert(NC$$module$__$src$natural_core.message.get(a.message,"maxDate",[a.maxDate])).show(),!1}else if(8===b.length){if(null!=a.minDate&&8===a.minDate.length&&Number(b)Number(a.maxDate))return a.context.val(a.maxDate).trigger("keyup.datepicker",[!0]),a.context.alert(NC$$module$__$src$natural_core.message.get(a.message,"maxDate",[a.maxDate])).show(),!1}return!0}}static $jscomp$static$init$506130788$9$wrapEle(){return function(){const a=this.options,b=this;if(a.focusin&&!a.context.prop("readonly")&&!a.context.prop("disabled"))a.context.off("focusin.datepicker").on("focusin.datepicker",function(){b.show()}); +a.context.off("keydown.datepicker").on("keydown.datepicker",function(c){const d=c.keyCode?c.keyCode:c.which?c.which:c.charCode;if(!NC$$module$__$src$natural_core.event.isNumberRelatedKeys(c)||8k[0])return a.context.alert(NC$$module$__$src$natural_core.message.get(a.message,"yearNaN")).show(),a.context.val(f.replace(l[0],"")),!1;if(2===l[1].length&&(1>k[1]|| +12k[2]||k[2]>parseInt(a.gEndDate)))return a.context.alert(NC$$module$__$src$natural_core.message.get(a.message,"dayNaN",[String(parseInt(a.gEndDate))])).show(),a.context.val(f.replace(l[2],"")),!1;if(!d&&!NU$$module$__$src$natural_ui.datepicker.checkMinMaxDate.call(b))return!1;d=a.contents.find(".datepicker_years_panel__"); +k=a.contents.find(".datepicker_months_panel__");l=a.contents.find(".datepicker_days_panel__");3===h.length&&-1
    ').on("click.datepicker", +function(p){p.stopPropagation()}).addClass("hidden__").addClass("years_panel_position_"+a.yearsPanelPosition+"__").addClass("months_panel_position_"+a.monthsPanelPosition+"__");a.context.off("click.datepicker").on("click.datepicker",function(p){p.stopPropagation()});a.monthonly?(a.context.attr("maxlength","6"),a.contents.addClass("datepicker_monthonly__")):a.context.attr("maxlength","8");a.contents.css({display:"none",position:"absolute"});const f=N$$module$__$src$natural_js('
    '); +let g,h,k,l,m;if("left"===a.yearsPanelPosition){var n=N$$module$__$src$natural_js("
    ");f.append(n.clone(!0).addClass("datepicker_year_title__").text(NC$$module$__$src$natural_core.message.get(a.message,"year")));let p;for(p=a.currYear-2;p<=a.currYear+2;p++){var u=n.clone(!0).addClass("datepicker_year_item__");p===a.currYear&&(u.addClass("datepicker_curr_year__"),u.addClass("datepicker_year_selected__"));f.append(u.text(NC$$module$__$src$natural_core.string.lpad(String(p),4,"0")))}f.on("click.datepicker", +".datepicker_year_item__",function(t,q){t.preventDefault();const r=f.find(".datepicker_year_item__.datepicker_year_selected__").removeClass("datepicker_year_selected__");N$$module$__$src$natural_js(this).addClass("datepicker_year_selected__");const v=N$$module$__$src$natural_js(this).text();if(v!==r.text()||q){if(a.yearChangeInput){q=a.context.val().replace(/\D/g,"");if(4>=q.length)a.context.val(NC$$module$__$src$natural_core.string.lpad(v,4,"0"));else{let y;6===q.length?y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ym().replace(/[^Y|^m|^d]/g, +""):8===q.length&&(y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd().replace(/[^Y|^m|^d]/g,""));if(void 0!==y){q=NC$$module$__$src$natural_core.date.strToDate(q,y);let w="";N$$module$__$src$natural_js(y.split("")).each(function(x,z){w+=z+"-"});q=q.obj.formatDate(w).replace(q.obj.formatDate("Y"),v).replace(/-/g,"");a.context.val(q)}}if(!NU$$module$__$src$natural_ui.datepicker.checkMinMaxDate.call(b))return!1}a.monthonly||h.find(".datepicker_month_item__.datepicker_month_selected__").trigger("click.datepicker"); +null!==a.onChangeYear&&a.onChangeYear.call(b,a.context,v,t);a.context.trigger("onChangeYear",[a.context,v,t])}});n=N$$module$__$src$natural_js('');n.find(".datepicker_year_prev__").on("click.datepicker", +function(t){t.preventDefault();NU$$module$__$src$natural_ui.datepicker.yearPaging(f.find(".datepicker_year_item__"),a.currYear,-5);f.find(".datepicker_year_selected__").trigger("click.datepicker",[!0])});n.find(".datepicker_year_next__").on("click.datepicker",function(t){t.preventDefault();NU$$module$__$src$natural_ui.datepicker.yearPaging(f.find(".datepicker_year_item__"),a.currYear,5);f.find(".datepicker_year_selected__").trigger("click.datepicker",[!0])});f.append(n)}else if("top"===a.yearsPanelPosition){N$$module$__$src$natural_js('').appendTo(f).find("> .datepicker_year_prev__").on("click.datepicker",function(t,q){t.preventDefault();t=parseInt(p.val());if(t>a.currYear-a.minYear)p.val(NC$$module$__$src$natural_core.string.lpad(String(t-1),4,"0")).trigger("change.datepicker",q?[q]:void 0);else{p.empty();t--;var r=t-a.minYear;let v=t+a.maxYear;100>r&&(r=100,v=r+a.maxYear);for(;r<=v;r++){let y="";r===t&&(a.currYear=t,y='selected="selected"'); +p.append('")}p.trigger("change.datepicker",q?[q]:void 0)}});const p=N$$module$__$src$natural_js('');for(n=a.currYear-a.minYear;n<=a.currYear+a.maxYear;n++)p.append('");p.addClass("datepicker_year_item__ datepicker_year_selected__").on("change.datepicker",function(t,q){const r=N$$module$__$src$natural_js(this).val();if(a.yearChangeInput){var v=a.context.val().replace(/\D/g,"");if(4>=v.length)a.context.val(r);else{let y;6===v.length?y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ym().replace(/[^Y|^m|^d]/g,""):8===v.length&&(y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd().replace(/[^Y|^m|^d]/g, +""));if(void 0!==y){v=NC$$module$__$src$natural_core.date.strToDate(v,y);let w="";N$$module$__$src$natural_js(y.split("")).each(function(x,z){w+=z+"-"});v=v.obj.formatDate(w).replace(v.obj.formatDate("Y"),r).replace(/-/g,"");a.context.val(v)}}if(!q&&!NU$$module$__$src$natural_ui.datepicker.checkMinMaxDate.call(b))return!1}void 0!==g&&g.trigger("change.datepicker");null!==a.onChangeYear&&a.onChangeYear.call(b,a.context,r,t);a.context.trigger("onChangeYear",[a.context,r,t])}).appendTo(f);N$$module$__$src$natural_js('').appendTo(f).find("> .datepicker_year_next__").on("click.datepicker",function(t,q){t.preventDefault();t=parseInt(p.val());if(ta.minYear+a.maxYear)p.val(NC$$module$__$src$natural_core.string.lpad(String(t+1),4,"0")).trigger("change.datepicker",q?[q]:void 0);else{p.empty();t++;var r=t-a.minYear;const v=t+a.maxYear;for(;r<=v;r++){let y="";r===t&&(a.currYear=t,y='selected="selected"'); +p.append('")}p.trigger("change.datepicker",q?[q]:void 0)}})}a.contents.append(f);h=N$$module$__$src$natural_js('
    ');a.monthonly||(k=NC$$module$__$src$natural_core.message.get(a.message,"days").split(","),l=N$$module$__$src$natural_js('
    '),m=N$$module$__$src$natural_js("
    ")); +if("top"===a.monthsPanelPosition){h.hide();n=N$$module$__$src$natural_js('
    ');g=N$$module$__$src$natural_js("");for(u=1;12>=u;u++)g.append('");const p=N$$module$__$src$natural_js('').appendTo(n).find("> .datepicker_month_prev__").on("click.datepicker",function(q){q.preventDefault();q=String(parseInt(g.val())-1);1>q&&(q=f.find(".datepicker_year_prev__"),"left"===a.yearsPanelPosition?(q=String(Number(f.find(".datepicker_year_selected__").text())-1),f.find(".datepicker_year_item__").removeClass("datepicker_year_selected__"),0===f.find(".datepicker_year_item__:contains('"+NC$$module$__$src$natural_core.string.lpad(String(q),4,"0")+"')").length&& +NU$$module$__$src$natural_ui.datepicker.yearPaging(f.find(".datepicker_year_item__"),q,-4,!0),f.find(".datepicker_year_item__:contains('"+NC$$module$__$src$natural_core.string.lpad(String(q),4,"0")+"')").trigger("click")):"top"===a.yearsPanelPosition&&q.trigger("click.datepicker",[!0]),q=12);g.val(q);h.find(".datepicker_month_item__:contains("+q+"):eq(0)").trigger("click.datepicker")});g.addClass("datepicker_month_item__ datepicker_month_selected__").on("change.datepicker",function(){h.find(".datepicker_month_item__:contains("+ +N$$module$__$src$natural_js(this).val()+"):eq(0)").trigger("click.datepicker")}).appendTo(n);const t=N$$module$__$src$natural_js('').appendTo(n).find("> .datepicker_month_next__").on("click.datepicker",function(q){q.preventDefault();q=String(parseInt(g.val())+1);12v?t.trigger("click.datepicker"):p.trigger("click.datepicker"));r=q=void 0})}}n=N$$module$__$src$natural_js("
    ");h.append(n.clone().addClass("datepicker_month_title__").text(NC$$module$__$src$natural_core.message.get(a.message,"month")));for(u=1;12>=u;u++)h.append(n.clone(!0).addClass("datepicker_month_item__").text(String(u))),0===h.find(".datepicker_month_selected__").length&& +h.find(".datepicker_month_item__:contains("+String(parseInt(c.formatDate("m")))+"):eq(0)").addClass("datepicker_month_selected__");a.contents.append(h);h.on("click.datepicker",".datepicker_month_item__",function(p,t){p.preventDefault();var q=h.find(".datepicker_month_item__.datepicker_month_selected__").removeClass("datepicker_month_selected__");N$$module$__$src$natural_js(this).addClass("datepicker_month_selected__");var r=f.find(".datepicker_year_selected__")["left"===a.yearsPanelPosition?"text": +"val"](),v=N$$module$__$src$natural_js(this).text();if(v!==q.text()){if(a.monthChangeInput&&(q=a.context.val().replace(/\D/g,""),4<=q.length)){if(4===q.length){var y="Ym";q+=NC$$module$__$src$natural_core.string.lpad(v,2,"0")}else 6===q.length?y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ym().replace(/[^Y|^m|^d]/g,""):8===q.length&&(y=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd().replace(/[^Y|^m|^d]/g,""));if(void 0!==y){var w=NC$$module$__$src$natural_core.date.strToDate(q, +y);let A="";N$$module$__$src$natural_js(y.split("")).each(function(E,C){A+=C+"-"});y=NC$$module$__$src$natural_core.date.strToDate(NC$$module$__$src$natural_core.string.lpad(w.obj.formatDate("Y"),4,"0")+NC$$module$__$src$natural_core.string.lpad(String(Number(v)+1),2,"0")+"00","Ymd").obj.getDate();q=w.obj.formatDate(A).replace(w.obj.formatDate("Y"),NC$$module$__$src$natural_core.string.lpad(w.obj.formatDate("Y"),4,"0")).replace(w.obj.formatDate("m")+"-",NC$$module$__$src$natural_core.string.lpad(v, +2,"0")+"-");Number(w.obj.formatDate("d"))>y?q=q.replace(w.obj.formatDate("d")+"-",NC$$module$__$src$natural_core.string.lpad(y,2,"0")+"-"):Number(a.lastSelectedDay)===y&&(q=q.replace(w.obj.formatDate("d")+"-",NC$$module$__$src$natural_core.string.lpad(a.lastSelectedDay,2,"0")+"-"));q=q.replace(/-/g,"");a.context.val(q)}if(!NU$$module$__$src$natural_ui.datepicker.checkMinMaxDate.call(b))return!1}null!==a.onChangeMonth&&a.onChangeMonth.call(b,a.context,v,r,p);a.context.trigger("onChangeMonth",[a.context, +v,r,p])}if(a.monthonly){p=NC$$module$__$src$natural_core.date.strToDate(NC$$module$__$src$natural_core.string.lpad(r,4,"0")+NC$$module$__$src$natural_core.string.lpad(N$$module$__$src$natural_js(this).text(),2,"0"),"Ym");p.format=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ym().replace(/[^Y|^m|^d]/g,"");var x;null!==a.onSelect&&(x=a.onSelect.call(b,a.context,p,a.monthonly));if(void 0===x||!0===x){r=p.format.replace(/[^Y|^m|^d]/g,"");x=p.obj.formatDate("Y");v=p.obj.formatDate(r); +if(3===x.length){let A="";N$$module$__$src$natural_js(r.split("")).each(function(E,C){A+=C+"-"});v=p.obj.formatDate(A).replace(x,"0"+x).replace(/-/g,"")}a.context.val(v)}a.context.trigger("onSelect",[a.context,p,a.monthonly]);b.hide(t)}else{l.find(".datepicker_day_selected__").text();l.empty();x=NC$$module$__$src$natural_core.date.strToDate(NC$$module$__$src$natural_core.string.lpad(r,4,"0")+NC$$module$__$src$natural_core.string.lpad(String(parseInt(N$$module$__$src$natural_js(this).text())+1),2, +"0")+"00","Ymd");t=x.obj.getDate();a.gEndDate=t;"Ymd"!==d&&(a.gEndDate=31);x.obj.setDate(1);p=x.obj.getDay();for(v=0;v=v?(y.addClass("datepicker_prev_day_item__"), +w=String(q+v),y.data("year",r.obj.getFullYear()).data("month",r.obj.getMonth()+1).data("day",w)):v>t?(y.addClass("datepicker_next_day_item__"),w=String(v-t),y.data("year",12===x.obj.getMonth()+1?x.obj.getFullYear()+1:x.obj.getFullYear()).data("month",13===x.obj.getMonth()+2?1:x.obj.getMonth()+2).data("day",w)):(y.addClass("datepicker_day_item__"),y.data("year",x.obj.getFullYear()).data("month",x.obj.getMonth()+1).data("day",w));var z=NC$$module$__$src$natural_core.string.lpad(String(y.data("year")), +4,"0")+NC$$module$__$src$natural_core.string.lpad(String(y.data("month")),2,"0")+NC$$module$__$src$natural_core.string.lpad(String(y.data("day")),2,"0");a.minDate&&Number(z)Number(a.maxDate)&&(y.addClass("datepicker_max_date__"),y.tpBind("click",NC$$module$__$src$natural_core.event.disable));var B=z.substring(4,8);const A=[];a.holiday.repeat&&a.holiday.repeat[B]&& +(B=a.holiday.repeat[B],"array"===NC$$module$__$src$natural_core.type(B)?A.push(B.join(", ")):A.push(B));a.holiday.once&&a.holiday.once[z]&&(z=a.holiday.once[z],"array"===NC$$module$__$src$natural_core.type(z)?A.push(z.join(", ")):A.push(z));NC$$module$__$src$natural_core.isEmptyObject(A)||y.addClass("datepicker_holiday__").attr("title",A.join(", "));l.append(y.text(w))}l.find(".datepicker_prev_day_item__, .datepicker_day_item__, .datepicker_next_day_item__").each(function(A,E){setTimeout(function(){N$$module$__$src$natural_js(E).addClass("visible__")}, +10*A)});r=a.context.val().replace(/\D/g,"");NC$$module$__$src$natural_core.string.isEmpty(r)||8!==r.length?l.find(".datepicker_day_item__:contains("+String(Number(c.formatDate("d")))+"):eq(0)").addClass("datepicker_day_selected__"):(x=NC$$module$__$src$natural_core.date.strToDate(r,r=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd().replace(/[^Y|^m|^d]/g,"")),l.find(".datepicker_day_item__:contains("+String(Number(x.obj.formatDate("d")))+"):eq(0)").addClass("datepicker_day_selected__"), +!a.monthChangeInput&&Number(a.lastSelectedDay)>t&&l.find(".datepicker_day_item__:contains("+String(t)+"):eq(0)").addClass("datepicker_day_selected__"))}});a.monthonly||(a.contents.append(l),l.on("click.datepicker",".datepicker_day_item__, .datepicker_prev_day_item__, .datepicker_next_day_item__",function(p,t){p.preventDefault();var q=N$$module$__$src$natural_js(this);l.find(".datepicker_prev_day_item__.datepicker_day_selected__, .datepicker_day_item__.datepicker_day_selected__, .datepicker_next_day_item__.datepicker_day_selected__").removeClass("datepicker_day_selected__"); +q.addClass("datepicker_day_selected__");p=NC$$module$__$src$natural_core.date.strToDate(NC$$module$__$src$natural_core.string.lpad(String(q.data("year")),4,"0")+NC$$module$__$src$natural_core.string.lpad(String(q.data("month")),2,"0")+NC$$module$__$src$natural_core.string.lpad(String(q.data("day")),2,"0"),"Ymd");a.lastSelectedDay=q.text();p.format=NA$$module$__$src$natural_architecture.context.attr("data").formatter.date.Ymd().replace(/[^Y|^m|^d]/g,"");var r;null!==a.onSelect&&(r=a.onSelect.call(b, +a.context,p,a.monthonly));if(void 0===r||!0===r){r=p.format.replace(/[^Y|^m|^d]/g,"");q=p.obj.formatDate("Y");let v=p.obj.formatDate(r);if(3===q.length){let y="";N$$module$__$src$natural_js(r.split("")).each(function(w,x){y+=x+"-"});v=p.obj.formatDate(y).replace(q,"0"+q).replace(/-/g,"")}a.context.val(v)}a.context.trigger("onSelect",[a.context,p,a.monthonly]);b.hide(t)}));n=a.context.closest("label,span");0k&&(k=100,c=k+a.maxYear);for(;k<=c;k++){let l="";k===h[0]&&(a.currYear=h[0],l='selected="selected"');d.append('")}}NC$$module$__$src$natural_core.string.isEmpty(a.context.val())||d.trigger("change.datepicker")}isNaN(b[1])||2!==b[1].length||(f.find(".datepicker_month_item__").removeClass("datepicker_month_selected__"),a.monthonly?f.find(".datepicker_month_item__:contains("+String(h[1])+"):eq(0)").addClass("datepicker_month_selected__"):f.find(".datepicker_month_item__:contains("+String(h[1])+"):eq(0)").trigger("click.datepicker"), +"top"===a.monthsPanelPosition&&a.contents.find(".datepicker_top_months_panel__ .datepicker_month_item__").val(String(h[1])));isNaN(b[2])||2!==b[2].length||(g.find(".datepicker_prev_day_item__, .datepicker_day_item__, .datepicker_next_day_item__").removeClass("datepicker_day_selected__"),g.find(".datepicker_day_item__:contains("+String(h[2])+"):eq(0)").addClass("datepicker_day_selected__"))}}context(a){return void 0!==a?this.options.context.find(a):this.options.context}show(){const a=this.options; +var b=a.context.closest("label,span");if(0===b.length&&0===a.context.next(".datepicker_contents__").length||0a.contents.outerWidth()?c.offset().left+parseInt(c.css("padding-left"))+c.width():window.innerWidth? +window.innerWidth:N$$module$__$src$natural_js(window).width();d.offset().left+a.contents.width()>l?(a.contents.css("left",k+d.outerWidth()-a.contents.width()+"px"),a.contents.removeClass("orgin_left__").addClass("orgin_right__")):(a.contents.css("left",k+"px"),a.contents.removeClass("orgin_right__").addClass("orgin_left__"))}).trigger("resize.datepicker");const f=this;a.contents.show(10,function(){N$$module$__$src$natural_js(this).removeClass("hidden__").addClass("visible__");N$$module$__$src$natural_js(this).one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a.contents), +function(g){N$$module$__$src$natural_js(document).off("click.datepicker").on("click.datepicker",function(h){a.context.get(0).blur();f.hide()});null!==a.onShow&&a.onShow.call(f,a.context,a.contents);a.context.trigger("onShow",[a.context,a.contents])}).trigger("nothing")});return this}hide(){const a=this.options;if(a.contents.hasClass("visible__")){const b=this;if(null!==a.onBeforeHide){const c=a.onBeforeHide.call(this,a.context,a.contents,0{const e=class{constructor(a,b){this.options={context:a,url:null,title:null,button:!0,modal:!0,top:void 0,left:void 0,height:0,width:0,opener:null,closeMode:"hide",alwaysOnTop:!1,confirm:!0,overlayClose:!0,escClose:!0,onOk:null,onCancel:null,onBeforeShow:null,onShow:null,onBeforeHide:null,onHide:null,onBeforeRemove:null,onRemove:null,onOpen:null,onOpenData:null,onClose:null,onCloseData:null,onLoad:null,preload:!1,dynPos:!0,windowScrollLock:!0, +draggable:!1,draggableOverflowCorrection:!0,draggableOverflowCorrectionAddValues:{top:0,bottom:0,left:0,right:0},saveMemory:!1};let c=!1;b&&b.opener&&(b.opener=void 0,c=!0);try{jQuery.extend(!0,this.options,NA$$module$__$src$natural_architecture.context.attr("ui").popup)}catch(d){throw NC$$module$__$src$natural_core.error("NU.popup",d);}void 0!==b?"string"===NC$$module$__$src$natural_core.type(b)&&(this.options.url=b):1===arguments.length&&NC$$module$__$src$natural_core.isPlainObject(a)&&(b=a,a=N$$module$__$src$natural_js(window)); +NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onOk");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onCancel");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onBeforeShow");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onShow");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onBeforeHide");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onHide");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onBeforeRemove"); +NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onRemove");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onOpen");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onClose");NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"popup","onLoad");jQuery.extend(!0,this.options,b);c&&(b.opener=opener,this.options.opener=b.opener,opener=void 0);this.options.title=void 0!==b?NC$$module$__$src$natural_core.string.trimToNull(b.title):null;null!==this.options.url||this.options.preload&& +"remove"===this.options.closeMode?this.options.preload&&NU$$module$__$src$natural_ui.popup.loadContent.call(this,function(d,f){this.options.context=f;this.options.context.instance("popup",this);this.options.isLoaded=!0}):(NU$$module$__$src$natural_ui.popup.wrapEle.call(this),this.options.context.instance("popup",this));return this}static $jscomp$static$init$506130788$13$wrapEle(){return function(){const a=this.options;a.context.hide();a.html=!0;a.msg=a.context;null===a.title&&(a.title=a.context.attr("title")); +null!==a.title&&a.context.removeAttr("title");this.alert=N$$module$__$src$natural_js(window).alert(a);this.alert.options.msgContext.addClass("popup_overlay__");this.alert.options.msgContents.addClass("popup__");a.saveMemory&&(this.alert.options.msg=null)}}static $jscomp$static$init$506130788$14$loadContent(){return function(a){const b=this.options,c=this;(new NA$$module$__$src$natural_architecture.comm({url:b.url,contentType:"text/html; charset=UTF-8",dataType:"html",type:"GET"})).submit(function(d){b.context= +N$$module$__$src$natural_js(d);null===b.title&&(b.title=b.context.filter(":not('style, script'):last").attr("title"),null!==b.title&&b.context.filter(":not('style, script'):last").removeAttr("title"));b.html=!0;b.msg=b.context;if(null!=b.onRemove){const g=b.onRemove;b.onRemove=function(){b.context=null;return g.apply(this,arguments)}}else b.onRemove=function(){b.context=null};let f;b.opener&&(f=b.opener,b.opener=void 0);c.alert=N$$module$__$src$natural_js(window).alert(b);f&&(b.opener=f,f=void 0); +c.alert.options.msgContext.addClass("popup_overlay__");c.alert.options.msgContents.addClass("popup__");b.saveMemory&&(c.alert.options.msg=null);this.request.options.target=b.context.parent();d=b.context.filter(".view_context__:last").instance("cont");void 0!==d&&(d.caller=c,null!=b.opener&&(d.opener=b.opener),NA$$module$__$src$natural_architecture.cont.trInit.call(this,d,this.request));a.call(c,d,b.context);null!==b.onLoad&&b.onLoad.call(this,d)})}}static $jscomp$static$init$506130788$15$popOpen(){return function(a, +b){b=this.options;null===b.url&&b.context.show();this.alert.show();if(null!==b.onOpen)if(b.onOpenData=void 0!==a?a:null,void 0!==b.context.filter(".view_context__:last").instance("cont")[b.onOpen])b.context.filter(".view_context__:last").instance("cont")[b.onOpen](a);else NC$$module$__$src$natural_core.warn("[NU.popup.popOpen]The onOpen event handler("+b.onOpen+") is not defined on the Controller(NA.cont) of the NU.popup.")}}context(a){return void 0!==a?this.options.context.find(a):this.options.context}open(a){const b= +this.options,c=this;void 0===a&&null!==b.onOpenData&&(a=b.onOpenData);null===this.options.url||(b.preload||b.isLoaded)&&b.isLoaded?(NU$$module$__$src$natural_ui.popup.popOpen.call(this,a),b.preload&&"remove"===b.closeMode&&(b.isLoaded=!1)):(b.isLoaded=!1,NU$$module$__$src$natural_ui.popup.loadContent.call(this,function(d,f){b.context=f;b.context.instance("popup",this);NU$$module$__$src$natural_ui.popup.popOpen.call(c,a,d);"remove"!==b.closeMode&&(b.isLoaded=!0)}));return this}close(a){const b=this.options; +void 0===a&&null!==b.onCloseData&&(a=b.onCloseData);null!==b.onClose&&b.onClose.call(this,a);this.alert[b.closeMode]();return this}remove(){this.alert.remove();return this}};e.wrapEle=e.$jscomp$static$init$506130788$13$wrapEle();e.loadContent=e.$jscomp$static$init$506130788$14$loadContent();e.popOpen=e.$jscomp$static$init$506130788$15$popOpen();return e})()}static $jscomp$static$init$506130788$42$tab(){return(()=>{const e=class{constructor(a,b){this.options={context:0ul>li"):null,tabOpts:[],randomSel:!1,opener:null,onActive:null,onLoad:null,blockOnActiveWhenCreate:!1,contents:0div"):null,tabScroll:!1,tabScrollCorrection:{tabContainerWidthCorrectionPx:0,tabContainerWidthReCalcDelayTime:0}};let c=!1;b&&b.opener&&(b.opener=void 0,c=!0);try{jQuery.extend(!0,this.options,NA$$module$__$src$natural_architecture.context.attr("ui").tab)}catch(g){throw NC$$module$__$src$natural_core.error("NU.tab",g);}NC$$module$__$src$natural_core.isPlainObject(a)&& +(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"tab","onActive"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"tab","onLoad"),jQuery.extend(!0,this.options,a),this.options.context=N$$module$__$src$natural_js(a.context));this.options.links=this.options.context.find(">ul>li");this.options.contents=this.options.context.find(">div");const d=this;let f;0===this.options.tabOpts.length&&this.options.links.each(function(g){g=N$$module$__$src$natural_js(this);f=NC$$module$__$src$natural_core.element.toOpts(g); +void 0===f&&(f={});f.target=g.find("a").attr("href");d.options.tabOpts.push(f)});jQuery.extend(this.options,b);c&&(b.opener=opener,this.options.opener=b.opener,opener=void 0);this.options.context.addClass("tab__");NU$$module$__$src$natural_ui.tab.wrapEle.call(this);this.options.context.instance("tab",this)}static $jscomp$static$init$506130788$16$wrapEle(){return function(){const a=this.options;a.contents.hide();const b=this;let c;N$$module$__$src$natural_js(a.tabOpts).each(function(f){this.disable? +b.disable(f):b.enable(f);!0===this.active?c=f:a.randomSel?c=Math.floor(Math.random()*a.links.length):0===f&&(c=f);this.preload&&void 0!==this.url&&NU$$module$__$src$natural_ui.tab.loadContent.call(b,this.url,f,function(g,h){null!==a.onLoad&&a.onLoad.call(b,f,a.links.eq(f),h,g)})});let d;a.links.on("mousedown.tab"+(0ul").css("margin-left"))});a.links.on("click.tab"+ +(0ul").css("margin-left"))-d)&&!0!==h)return d=void 0,!1;d=void 0;if(!N$$module$__$src$natural_js(this).hasClass("tab_active__")){const k=N$$module$__$src$natural_js(this),l=a.beforeOpenIdx=a.links.index(this),m=a.tabOpts[l],n=a.contents.eq(l);a.links.filter(".tab_active__").removeClass("tab_active__");k.addClass("tab_active__");const u= +function(){null!==a.onActive&&(!1===a.blockOnActiveWhenCreate||!0===a.blockOnActiveWhenCreate&&!0!==h)&&a.onActive.call(b,l,k,n,a.links,a.contents)},p=function(){if(void 0!==m.onOpen){const r=n.children(".view_context__:last").instance("cont");if(void 0!==r[m.onOpen])r[m.onOpen](g);else NC$$module$__$src$natural_core.warn("[NU.tab.wrapEle]The onOpen event handler("+m.onOpen+") is not defined on the Controller(NA.cont) of the tab(NU.tab)'s contents.")}},t=jQuery.Deferred(),q=jQuery.Deferred();jQuery.when(t, +q).done(function(){a.context.dequeue("open")});f=a.contents.filter(".tab_content_active__");if(0ul").addClass("effect__"),c=a.context.find(">a").hide();let d,f;const g=parseInt(NC$$module$__$src$natural_core.string.trimToZero(b.find(">li:first").css("margin-right")));let h=g,k=0,l=0,m;1a.context.width()+ +g?(0').parent(),0u||a.context.outerWidth()>=r.width()+p+q)return!1;h=q+g;r.css("margin-left",q+"px");t=!0},function(q,r){t&&(0<=h+(1=r.width()-(a.context.outerWidth()+-1*h)?(h=-1*(r.width()-a.context.outerWidth()-1),1ul");if(f.outerWidth()>d.context.innerWidth()){let g=parseInt(f.css("margin-left"))-N$$module$__$src$natural_js(d.links.get(a)).position().left+(d.context.innerWidth()/2-N$$module$__$src$natural_js(d.links.get(a)).outerWidth()/2);const h=d.context.find(">.tab_scroll_prev__"), +k=d.context.find(">.tab_scroll_next__");g>d.context.find(">.tab_scroll_prev__").outerWidth()?(g=0f.outerWidth()+g?(g=-(f.outerWidth()-d.context.innerWidth()+(0 div.tab_content_active__"),cont:d.context.find("> div.tab_content_active__ > .view_context__").instance("cont")}:{index:d.beforeOpenIdx,tab:"Tab content has not yet been loaded.",content:"Tab content has not yet been loaded.",cont:"Tab content has not yet been loaded."};return this}disable(a){void 0!==a&&N$$module$__$src$natural_js(this.options.links.get(a)).off("click.tab.disable").off("touchstart.tab.disable").off("touchend.tab.disable").tpBind("click.tab.disable", +NC$$module$__$src$natural_core.event.disable).tpBind("touchstart.tab.disable",NC$$module$__$src$natural_core.event.disable).tpBind("touchend.tab.disable",NC$$module$__$src$natural_core.event.disable).addClass("tab_disabled__");return this}enable(a){void 0!==a&&N$$module$__$src$natural_js(this.options.links.get(a)).off("click",NC$$module$__$src$natural_core.event.disable).off("touchstart",NC$$module$__$src$natural_core.event.disable).off("touchend",NC$$module$__$src$natural_core.event.disable).removeClass("tab_disabled__"); +return this}cont(a){const b=this.options;a=void 0!==a?b.context.find("> div:eq("+String(a)+") > .view_context__").instance("cont"):b.context.find("> .tab_content_active__ > .view_context__").instance("cont");void 0===a&&NC$$module$__$src$natural_core.warn("Tab content has not been loaded yet or Controller(NA.cont) object is missing.");return a}};e.wrapEle=e.$jscomp$static$init$506130788$16$wrapEle();e.wrapScroll=e.$jscomp$static$init$506130788$17$wrapScroll();e.loadContent=e.$jscomp$static$init$506130788$18$loadContent(); +return e})()}static $jscomp$static$init$506130788$43$select(){return(()=>{const e=class{constructor(a,b){this.options={data:"array"===NC$$module$__$src$natural_core.type(a)?N$$module$__$src$natural_js(a):a,context:null,key:null,val:null,append:!0,direction:"h",type:0,template:null};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").select)}catch(c){throw NC$$module$__$src$natural_core.error("NU.select",c);}jQuery.extend(this.options,NC$$module$__$src$natural_core.element.toOpts(this.options.context)); +NC$$module$__$src$natural_core.isPlainObject(b)?(jQuery.extend(this.options,b),"array"===NC$$module$__$src$natural_core.type(this.options.data)&&(this.options.data=N$$module$__$src$natural_js(b.data)),this.options.context=N$$module$__$src$natural_js(b.context)):this.options.context=N$$module$__$src$natural_js(b);this.options.template=this.options.context;NU$$module$__$src$natural_ui.select.wrapEle.call(this);this.options.context.addClass("select__");this.options.context.instance("select",this);return this}static $jscomp$static$init$506130788$19$wrapEle(){return function(){const a= +this.options;a.context.is("select")&&"multiple"!==a.context.attr("multiple")?(this.options.context.find("option").addClass("select_default__"),a.type=1):a.context.is("select")&&"multiple"===a.context.attr("multiple")?(this.options.context.find("option").addClass("select_default__"),a.type=2):a.context.is("input:radio")?a.type=3:a.context.is("input:checkbox")&&(a.type=4)}}data(a){const b=this.options;if(void 0!==a&&!0===a){const c=(1===b.type||2===b.type?b.context.find("option"):b.context.closest(".select_input_container__").children("label")).filter(".select_default__").length; +a=this.index();"array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]);return N$$module$__$src$natural_js(a).map(function(){if(-1"+d[b.key]+"")});else if((3===b.type||4===b.type)&&0===b.context.filter(".select_template__").length){const c=b.context.attr("id");let d=N$$module$__$src$natural_js('
    ');"h"===b.direction?d.addClass("select_input_horizontal__"):"v"===b.direction&&d.addClass("select_input_vertical__"); +let f,g;b.data.each(function(h,k){f=N$$module$__$src$natural_js('');g=N$$module$__$src$natural_js(""+k[b.key]+"");0===h?(b.template.attr("name",c).attr("value",k[b.val]).addClass("select_input__ select_template__").wrap(f).parent().append(g).wrap(d),d=b.template.closest(".select_input_container__")):(f.append(b.template.clone(!0).attr("name",c).attr("value",k[b.val]).removeAttr("id").removeClass("select_template__")),f.append(g), +d.append(f))});g=f=void 0}return this}index(a){const b=this.options,c=1===b.type||2===b.type?b.context.find("option"):b.context.closest(".select_input_container__").children("label"),d=1===b.type||2===b.type?b.context:c.find(":radio, :checkbox");if(void 0===a){a=d.vals();const g=NA$$module$__$src$natural_architecture.context.attr("core").spltSepa,h=g+("array"===NC$$module$__$src$natural_core.type(a)?a.join(g):String(a))+g,k=[];(1===b.type||2===b.type?c:d).each(function(l){-1class{constructor(e,a){this.bindEvents={validate:function(b,c,d,f){if(void 0!==b.data("validate")&&"hidden"!==d&&(N$$module$__$src$natural_js().validator(null!==c.vRules? +c.vRules:b),f&&NC$$module$__$src$natural_core.isEmptyObject(b.events("focusout","form.validate"))))b[c.tpBind?"tpBind":"on"]("focusout.form.validate",function(){const g=N$$module$__$src$natural_js(this);g.prop("disabled")||g.prop("readonly")||!c.validate||g.trigger("validate.validator")})},dataSync:function(b,c,d,f){const g=this;let h="focusout";"select"===f&&(h="change");if(NC$$module$__$src$natural_core.isEmptyObject(b.events(h,"dataSync.form")))b[c.tpBind?"tpBind":"on"](h+".form.dataSync",function(k){k= +N$$module$__$src$natural_js(this);const l=k.val();d!==c.data[c.row]&&(d=c.data[c.row]);(null===d[k.attr("id")]?"":d[k.attr("id")])!==l&&("select"===f&&(k.removeClass("validate_false__"),void 0!==k.instance("alert")&&(k.instance("alert").remove(),k.removeData("alert__"))),k.prop("disabled")||k.prop("readonly")||c.validate&&(!c.validate||k.hasClass("validate_false__"))||(k.removeClass("validate_false__"),void 0!==k.instance("alert")&&(k.instance("alert").remove(),k.removeData("alert__")),d[k.attr("id")]= +l,"insert"!==d.rowStatus&&"delete"!==d.rowStatus&&(d.rowStatus="update",k.addClass("data_changed__"),c.context.hasClass("row_data_changed__")||c.context.addClass("row_data_changed__")),ND$$module$__$src$natural_data.ds.instance(null!==c.extObj?c.extObj:g).notify(-1 +arguments.length&&null!==b.onBeforeBind&&null===this.options.extObj&&b.onBeforeBind.call(c,b.context,d);"insert"===d.rowStatus||"update"===d.rowStatus?b.context.addClass("row_data_changed__"):b.context.removeClass("row_data_changed__");"delete"===d.rowStatus?b.context.addClass("row_data_deleted__"):b.context.removeClass("row_data_deleted__");let h,k;let l;const m=NA$$module$__$src$natural_architecture.context.attr("core").spltSepa;let n;2n.indexOf(m+u+m)))if(NC$$module$__$src$natural_core.string.isEmpty(u))NC$$module$__$src$natural_core.warn('[NU.form.bind]Within the context, there is an element with an id attribute value of ""(blank).'); +else{var f=h.filter("#"+u);if(null!==b.onBeforeBindValue){var g=b.onBeforeBindValue.call(c,f,d[u],"bind");void 0!==g&&(d[u]=g)}0arguments.length&&null!==b.onBind&&null===this.options.extObj&&b.onBind.call(c,b.context,d);h=k=g=f=g=g=l=void 0}return this}unbind(e){var a=this.options;if(a.unbind&&null!==a.InitialData){a.context.removeClass("row_data_changed__"); +e=a.InitialData;let c;let d,f;c=a.context.find("[id]:not(:radio, :checkbox)");a=a.context.find(":radio, :checkbox");for(const g in e)if(d=c.filter("#"+g),0b.data.length||0>a)a=void 0;b.addTop?(void 0===a&&(a=0),b.data.splice(a,0,c)):void 0===a?(b.data.push(c),a=b.data.length-1):b.data.splice(a,0,c);b.row=a;null!==b.extObj&&(b.data=N$$module$__$src$natural_js(b.data[b.row]),b.row=0,e=b.extObj.options.context.find(b.extObj instanceof NU$$module$__$src$natural_ui.grid?">tbody":">li").length,a=b.extObj.options.scrollPaging.size,b.extObj.options.scrollPaging.idx= +e/a*a-a+e%a,null!==b.extObj.options.rowHandlerBeforeBind&&b.extObj.options.rowHandlerBeforeBind.call(b.extObj,b.extRow,b.context,b.data[b.row]));b.revert&&(b.revertData=jQuery.extend({},b.data[b.row]));this.bind(b.row,b.state);ND$$module$__$src$natural_data.ds.instance(null!==b.extObj?b.extObj:this).notify(-1=a.filter(".validate_false__").length}val(e,a,b){const c=this.options,d=c.data[c.row];if(void 0===a)return d[e];var f;let g,h=f=!1,k=c.context.find("#"+e);if(null!==c.onBeforeBindValue){var l=c.onBeforeBindValue.call(this,k,d[e],"val");void 0!==l&&(d[e]=l)}0{const e=class{constructor(a, +b){this.options={data:"array"===NC$$module$__$src$natural_core.type(a)?N$$module$__$src$natural_js(a):a,row:-1,beforeRow:-1,context:null,height:0,validate:!0,html:!1,addTop:!0,addSelect:!1,vResizable:!1,windowScrollLock:!0,select:!1,unselect:!0,multiselect:!1,checkAll:null,checkAllTarget:null,checkSingleTarget:null,hover:!1,revert:!1,createRowDelay:1,scrollPaging:{idx:0,size:100},fRules:null,vRules:null,appendScroll:!0,addScroll:!0,selectScroll:!0,checkScroll:!0,validateScroll:!0,cache:!0,tpBind:!1, +rowHandlerBeforeBind:null,rowHandler:null,onBeforeSelect:null,onSelect:null,onBind:null};try{jQuery.extend(!0,this.options,NA$$module$__$src$natural_architecture.context.attr("ui").list)}catch(c){throw NC$$module$__$src$natural_core.error("NU.list",c);}NC$$module$__$src$natural_core.isPlainObject(b)?(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"list","onBeforeSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"list","onSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b, +"list","onBind"),b.data="array"===NC$$module$__$src$natural_core.type(b.data)?N$$module$__$src$natural_js(b.data):b.data,jQuery.extend(!0,this.options,b),this.options.scrollPaging.limit=this.options.scrollPaging.size,"string"===NC$$module$__$src$natural_core.type(this.options.context)&&(this.options.context=N$$module$__$src$natural_js(this.options.context))):this.options.context=N$$module$__$src$natural_js(b);this.options.addTop||(this.options.scrollPaging.size=0,this.options.createRowDelay=0);this.options.scrollPaging.defSize= +this.options.scrollPaging.size;this.tempRowEle=this.options.context.find("> li").clone(!0,!0);this.options.context.addClass("list__");this.options.hover&&this.options.context.addClass("list_hover__");(this.options.select||this.options.multiselect)&&NU$$module$__$src$natural_ui.ui.iteration.select.call(this,"list");0 .list__")); +null!==this.options.checkAll&&null!==this.options.checkAllTarget?NU$$module$__$src$natural_ui.ui.iteration.checkAll.call(this,"list"):null!==this.options.checkSingleTarget&&NU$$module$__$src$natural_ui.ui.iteration.checkSingle.call(this,"list");this.options.context.instance("list",this);ND$$module$__$src$natural_data.ds.instance(this,!0);return this}static $jscomp$static$init$506130788$20$createScroll(){return function(){const a=this.options;a.context.css({margin:"0"});const b=a.context.wrap('
    ').parent().css({height:String(a.height)+ +"px","overflow-y":"scroll","margin-left":"-1px"});NC$$module$__$src$natural_core.browser.is("ie")&&b.css("overflow-x","hidden");a.windowScrollLock&&NC$$module$__$src$natural_core.event.windowScrollLock(b);NU$$module$__$src$natural_ui.ui.scroll.paging.call(this,b,a.scrollPaging.limit,void 0,"> li","list.bind");a.vResizable&&NU$$module$__$src$natural_ui.list.vResize.call(this,b)}}static $jscomp$static$init$506130788$21$vResize(){return function(a){const b=N$$module$__$src$natural_js('
    ').css({"text-align":"center", +cursor:"n-resize","margin-bottom":a.css("margin-bottom")});a.css("margin-bottom","0");let c,d;NU$$module$__$src$natural_ui.ui.draggable.events.call(b,".list.vResize",function(f,g,h,k){d=a.offset()},function(f,g,h,k){c=k-d.top+"px";a.css({height:c,"max-height":c})});a.after(b)}}data(a){const b=this.options;if(void 0===a)return b.data.get();if(!1===a)return b.data;if("modified"===a)return b.data.datafilter(function(c){return void 0!==c.rowStatus}).get();if("selected"===a){if(b.select||b.multiselect){const c= +[],d=Array.prototype.slice.call(arguments,0),f=this.contextEle.find(">li.form__");f.filter(".list_selected__").each(function(){N$$module$__$src$natural_js(this);1li.form__");f.find(b.checkAllTarget||b.checkSingleTarget).filter(":checked").each(function(){const g= +N$$module$__$src$natural_js(this);1li.form__");return g.filter(".list_selected__").map(function(){return g.index(this)}).get()}"array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]);const d=this;let f;b||d.contextEle.find(">li.list_selected__").removeClass("list_selected__");N$$module$__$src$natural_js(a).each(function(){f=d.contextEle.find(">li"+(0a&&(a=0),c.context.parent(".context_wrap__").stop().animate({scrollTop:a},300,"swing"));return this}check(a,b){const c=this.options;if(void 0===a){const g=this.contextEle.find(">li");return g.find(c.checkAllTarget||c.checkSingleTarget).filter(":checked").map(function(){return g.index(N$$module$__$src$natural_js(this).closest("li.form__"))}).get()}"array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]);const d=this;let f; +b||d.contextEle.find(">li").find((c.checkAllTarget||c.checkSingleTarget)+":checked").prop("checked",!1);N$$module$__$src$natural_js(a).each(function(){f=d.contextEle.find(">li").find(c.checkAllTarget||c.checkSingleTarget).eq(this);f.is(":checked")&&f.prop("checked",!1);f.trigger("click.list")});c.checkScroll&&(b=f.closest("li.form__"),a=a[a.length-1]*b.outerHeight()-c.height/2+b.outerHeight()/2,0>a&&(a=0),c.context.parent(".context_wrap__").stop().animate({scrollTop:a},300,"swing"));return this}bind(a, +b){const c=this.options;if(c.isBinding){const d=this,f=arguments;c.context.queue("bind",function(){d.bind.apply(d,f)})}else c.data&&a&&"append"===b?(c.scrollPaging.size=0,c.scrollPaging.idx=c.data.length-1,jQuery.merge(c.data,a)):(c.scrollPaging.size=c.scrollPaging.defSize,a&&(c.data="array"===NC$$module$__$src$natural_core.type(a)?N$$module$__$src$natural_js(a):a)),null!==c.checkAll&&N$$module$__$src$natural_js(c.checkAll).prop("checked",!1),0li").clearQueue().stop(), +"list.bind"!==b&&(c.scrollPaging.idx="append"===b&&0li.empty__").remove():c.context.find(">li").remove()),NU$$module$__$src$natural_ui.ui.iteration.render.call(this,c.scrollPaging.idx,0===c.height||0===c.scrollPaging.size||"append"===b&&0li").remove(),c.context.append('
  • '+NC$$module$__$src$natural_core.message.get(c.message,"empty")+"
  • "),null!==c.onBind&&"list.update"!==b&&c.onBind.call(this,c.context,c.data,!0,!0));return this}add(a,b){const c=this.options;0li.empty__").length&&c.context.find(">li").remove();const d=this.tempRowEle.clone(!0,!0);NC$$module$__$src$natural_core.isNumeric(a)&&(b=a,a=void 0);if(b>c.data.length||0>b)b=void 0;if(void 0===b)c.addTop? +c.context.prepend(d):c.context.append(d);else{var f=c.context.find(">li:eq("+b+")");0===b?c.context.prepend(d):b===c.context.find(">li").length?f=c.context.find(">li:eq("+(b-1)+")"):c.context.find(">li:eq("+b+")").before(d);c.addScroll?(f=b*f.outerHeight()-c.height/2+f.outerHeight()/2,0>f&&(f=0),c.context.parent(".context_wrap__").stop().animate({scrollTop:f},300,"swing",function(){c.addSelect&&N$$module$__$src$natural_js(this).find(">ul>li:eq("+b+")").trigger("click.list")})):c.addSelect&&setTimeout(function(){c.context.parent(".context_wrap__").find(">ul>li:eq("+ +b+")").trigger("click.list")},0)}f=c.data.form({context:d,html:c.html,validate:c.validate,extObj:this,extRow:void 0===b?c.addTop?0:c.data.length:b,addTop:c.addTop,revert:c.revert,tpBind:c.tpBind});f.add(a,b);null!==c.rowHandler&&c.rowHandler.call(this,f.options.extRow,d,f.data(!0)[0]);c.context.find(">li").removeClass("list_selected__");void 0===b&&c.context.parent(".context_wrap__").stop().animate({scrollTop:c.addTop?0:c.context.parent(".context_wrap__").prop("scrollHeight")},300,"swing",function(){c.addSelect&& +N$$module$__$src$natural_js(this).find("> ul > li:"+(c.addTop?"first":"last")).trigger("click.list")});return this}remove(a){const b=this.options;void 0!==a&&("array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]),N$$module$__$src$natural_js(a.sort().reverse()).each(function(c,d){if(void 0===b.data[this])throw NC$$module$__$src$natural_core.error("[NU.list.prototype.remove]Row index is out of range");"insert"===b.data[this].rowStatus?(b.data.splice(this,1),b.context.find(">li:eq("+d+")").remove(), +c=b.context.find(">li").length,d=b.scrollPaging.size,b.scrollPaging.idx=c/d*d-d+c%d):(b.data[this].rowStatus="delete",b.context.find(">li:eq("+d+")").addClass("row_data_deleted__"))}));ND$$module$__$src$natural_data.ds.instance(this).notify();return this}revert(a){const b=this.options;if(!b.revert)throw NC$$module$__$src$natural_core.error("[NU.form.prototype.revert]Can not revert. NU.form's revert option value is false");const c=this;void 0!==a?("array"!==NC$$module$__$src$natural_core.type(a)&& +(a=[a]),N$$module$__$src$natural_js(a).each(function(){const d=b.context.find(">li:eq("+String(this)+")"),f=d.instance("form");null!==b.rowHandlerBeforeBind&&b.rowHandlerBeforeBind.call(c,this,d,f.options.revertData);f.revert();null!==b.rowHandler&&b.rowHandler.call(c,this,d,b.data[this])})):b.context.find("li").instance("form",function(){if(void 0!==this.options&&("update"===this.options.data[0].rowStatus||"insert"===this.options.data[0].rowStatus)){const d=this.options.extRow;null!==b.rowHandlerBeforeBind&& +b.rowHandlerBeforeBind.call(c,d,this.context(),this.options.revertData);this.revert();null!==b.rowHandler&&b.rowHandler.call(c,d,this.context(),b.data[d])}});return this}validate(a){const b=this.options;let c=!0;if(void 0!==a)c=b.context.find(">li:eq("+String(a)+")").instance("form").validate();else{let d;b.context.find(">li").instance("form",function(f){void 0!==this.options&&0.form__:eq("+String(a)+")").instance("form");if(d)d.val(b,c);else if(this.options.data[a])this.options.data[a][b]= +c;else throw NC$$module$__$src$natural_core.error("[NU.list.prototype.val]There is no row data that is "+a+" index");return this}move(a,b){NU$$module$__$src$natural_ui.ui.iteration.move.call(this,a,b,"list");return this}copy(a,b){NU$$module$__$src$natural_ui.ui.iteration.copy.call(this,a,b,"list");return this}update(a,b){void 0!==a?void 0!==b?this.options.context.find(">li:eq("+String(a)+")").instance("form").update(0,b):!0!==this.options.data[a]._isRevert&&"insert"===this.options.data[a].rowStatus? +"insert"===this.options.data[a].rowStatus?this.bind(void 0,"list.update"):this.add(this.options.data[a]):this.options.context.find(">li:eq("+String(a)+")").instance("form").update(0):this.bind(void 0,"list.update");return this}};e.createScroll=e.$jscomp$static$init$506130788$20$createScroll();e.vResize=e.$jscomp$static$init$506130788$21$vResize();return e})()}static $jscomp$static$init$506130788$46$grid(){return(()=>{const e=class{constructor(a,b){this.options={data:"array"===NC$$module$__$src$natural_core.type(a)? +N$$module$__$src$natural_js(a):a,row:-1,beforeRow:-1,context:null,height:0,fixedcol:0,more:!1,validate:!0,html:!1,addTop:!0,addSelect:!1,filter:!1,resizable:!1,vResizable:!1,sortable:!1,windowScrollLock:!0,select:!1,unselect:!0,multiselect:!1,checkAll:null,checkAllTarget:null,checkSingleTarget:null,hover:!1,revert:!1,createRowDelay:1,scrollPaging:{idx:0,size:100},fRules:null,vRules:null,appendScroll:!0,addScroll:!0,selectScroll:!0,checkScroll:!0,validateScroll:!0,cache:!0,tpBind:!1,pastiable:!1,rowHandlerBeforeBind:null, +rowHandler:null,onBeforeSelect:null,onSelect:null,onBind:null,misc:{resizableCorrectionWidth:0,resizableLastCellCorrectionWidth:0,resizeBarCorrectionLeft:0,resizeBarCorrectionHeight:0,fixedcolHeadMarginTop:0,fixedcolHeadMarginLeft:0,fixedcolHeadHeight:0,fixedcolBodyMarginTop:0,fixedcolBodyMarginLeft:0,fixedcolBodyBindHeight:0,fixedcolBodyAddHeight:1,fixedcolRootContainer:null},currMoveToRow:-1};try{jQuery.extend(!0,this.options,NA$$module$__$src$natural_architecture.context.attr("ui").grid)}catch(c){throw NC$$module$__$src$natural_core.error("NU.grid", +c);}NC$$module$__$src$natural_core.isPlainObject(b)?(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"grid","onBeforeSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"grid","onSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(b,"grid","onBind"),b.data="array"===NC$$module$__$src$natural_core.type(b.data)?N$$module$__$src$natural_js(b.data):b.data,jQuery.extend(!0,this.options,b),this.options.scrollPaging.limit=this.options.scrollPaging.size,"string"===NC$$module$__$src$natural_core.type(this.options.context)&& +(this.options.context=N$$module$__$src$natural_js(this.options.context))):this.options.context=N$$module$__$src$natural_js(b);this.options.addTop||(this.options.scrollPaging.size=0,this.options.createRowDelay=0);this.options.scrollPaging.defSize=this.options.scrollPaging.size;this.tempRowEle=this.options.context.find("> tbody").clone(!0,!0);this.options.context.addClass("grid__");this.options.hover&&this.options.context.addClass("grid_hover__");(this.options.select||this.options.multiselect)&&NU$$module$__$src$natural_ui.ui.iteration.select.call(this, +"grid");this.options.resizable&&NU$$module$__$src$natural_ui.grid.removeColgroup.call(this);this.options.more&&NU$$module$__$src$natural_ui.grid.more.call(this);0.thead_wrap__>table>thead"):this.options.context.find(">thead"); +0===this.options.height&&NU$$module$__$src$natural_ui.grid.fixColumn.call(this);this.contextEle=this.options.context;0 .grid__"));this.rowSpanIds=this.thead.find("th:regexp(data:rowspan,true)").map(function(){return N$$module$__$src$natural_js(this).data("id")});null!==this.options.checkAll&&null!==this.options.checkAllTarget?NU$$module$__$src$natural_ui.ui.iteration.checkAll.call(this,"grid"):null!==this.options.checkSingleTarget&& +NU$$module$__$src$natural_ui.ui.iteration.checkSingle.call(this,"grid");this.options.sortable&&NU$$module$__$src$natural_ui.grid.sort.call(this);this.options.resizable&&NU$$module$__$src$natural_ui.grid.resize.call(this);if(this.options.filter||0 tr th[data-filter='true']").length)this.options.filter&&this.thead.find("> tr th").attr("data-filter","true"),NU$$module$__$src$natural_ui.grid.dataFilter.call(this);this.options.pastiable&&NU$$module$__$src$natural_ui.grid.paste.call(this); +this.options.context.instance("grid",this);ND$$module$__$src$natural_data.ds.instance(this,!0);return this}static $jscomp$static$init$506130788$22$tableCells(){return function(a,b){const c=a.find(">tr");b=b||function(h){return h.textContent||h.innerText};const d=[];let f=c.length;for(var g=0;g colgroup").length&&b.push(a.context.find("> colgroup > col").each(function(d){N$$module$__$src$natural_js(this).addClass("col_"+ +String(d)+"__")}).get());0 colgroup").length&&(b.unshift(a.context.closest(".grid_wrap__").find(">.thead_wrap__>table>colgroup>col").each(function(d){N$$module$__$src$natural_js(this).addClass("col_"+String(d)+"__")}).get()),b.push(a.context.closest(".grid_wrap__").find(">.tfoot_wrap__>table>colgroup>col").each(function(d){N$$module$__$src$natural_js(this).addClass("col_"+String(d)+"__")}).get())),c=NU$$module$__$src$natural_ui.grid.tableCells(a.context.closest(".grid_wrap__").find(">.thead_wrap__>table>thead")), +c=c.concat(NU$$module$__$src$natural_ui.grid.tableCells(a.context.closest(".grid_wrap__").find("> .tbody_wrap__>table>thead"))),a=NU$$module$__$src$natural_ui.grid.tableCells(a.context.closest(".grid_wrap__").find(">.tfoot_wrap__>table>tfoot"))):(c=NU$$module$__$src$natural_ui.grid.tableCells(a.context.find("> thead")),a=NU$$module$__$src$natural_ui.grid.tableCells(a.context.find("> tfoot")));return{colgroup:b,thead:c,tbody:NU$$module$__$src$natural_ui.grid.tableCells(this.tempRowEle),tfoot:a}}}static $jscomp$static$init$506130788$24$setTheadCellInfo(){return function(){const a= +this.tableMap;if(0!==a.thead.length){var b=0;N$$module$__$src$natural_js(a.tbody).each(function(c,d){N$$module$__$src$natural_js(d).each(function(f,g){if(void 0===a.thead[c+b]||void 0===a.thead[c+b][f])return!1;let h=N$$module$__$src$natural_js(a.thead[c+b][f]);g=N$$module$__$src$natural_js(g);0===b&&g.attr("colspan")!==h.attr("colspan")&&(h=N$$module$__$src$natural_js(a.thead[c+1][f]));if(g.attr("colspan")===h.attr("colspan"))f=g.attr("id"),void 0===f&&(f=g.find("[id]").attr("id")),void 0!==f&&h.data("id", +f);else return b++,!0})})}}}static $jscomp$static$init$506130788$25$removeColgroup(){return function(){const a=this.options;if(0 thead"));let c;0 tfoot")));a.context.find("colgroup>col").each(function(d,f){N$$module$__$src$natural_js(b).each(function(g,h){void 0===N$$module$__$src$natural_js(h[d]).attr("colspan")&&N$$module$__$src$natural_js(h[d]).css("width", +f.style.width).removeAttr("scope")});0 tr > th").toArray().splice(a.fixedcol).reduce(function(g, +h){return g+parseInt(window.getComputedStyle(h,null).getPropertyValue("width"))},0)});const c=a.context.wrap(N$$module$__$src$natural_js("
    ",{css:{"overflow-x":NC$$module$__$src$natural_core.browser.is("ios")?"scroll":"auto"},"class":"grid_wrap__"})).parent("div");var b=c.wrap(N$$module$__$src$natural_js("
    ",{"class":"grid_container__"})).parent("div");null===a.misc.fixedcolRootContainer?b.css("position","relative"):a.context.closest(a.misc.fixedcolRootContainer).css("position","relative"); +b=this.thead.find("> tr").height();this.thead.find("> tr").height(b);let d=0,f=0;for(let g=0;gtbody td:eq(0)"),c=b.css("border-left-width");1>parseInt(c)&&(c="1px");var d=c+" "+b.css("border-left-style")+" "+b.css("border-left-color");c=b.css("border-bottom-width");1>parseInt(c)&&(c="1px");c=c+" "+b.css("border-bottom-style")+" "+b.css("border-bottom-color"); +b=a.context.wrap('
    ').parent();b.css({"border-left":d});d=NC$$module$__$src$natural_core.browser.scrollbarWidth();0b.width()&&b.width(a.context.width()+d);var f=a.context.clone(!0,!0),g=a.context.find("> thead").clone();f.find(">thead").remove();f.find(">tbody").remove();f.find(">tfoot").remove();f.append(a.context.find("> thead"));f=f.wrap('
    ').parent().css({"padding-right":d+"px","margin-left":"-1px"});b.prepend(f); +a.context.append(g);a.context.find("> thead th").empty().css({height:"0","padding-top":"0","padding-bottom":"0","border-top":"none","border-bottom":"none"});a.context.find("> tbody td").css({"border-top":"none"});this.tempRowEle.find("td").css({"border-top":"none"});g=a.context.wrap('
    ').parent().css({height:String(a.height)+"px","overflow-y":"scroll","overflow-x":"hidden","margin-left":"-1px"});0===a.context.find("> tfoot").length&&g.css("border-bottom",c);a.windowScrollLock&& +NC$$module$__$src$natural_core.event.windowScrollLock(g);NU$$module$__$src$natural_ui.ui.scroll.paging.call(this,g,a.scrollPaging.limit,void 0,"> tbody","grid.bind");if(0 tfoot").length){var h=a.context.clone(!0,!0);h.find(">thead").remove();h.find(">tbody").remove();h.find(">tfoot").remove();h.append(a.context.find("> tfoot"));h=h.wrap('
    ').parent().css({"padding-right":d+"px","margin-left":"-1px"});b.append(h)}a.vResizable&&NU$$module$__$src$natural_ui.grid.vResize.call(this, +b,g,h)}}static $jscomp$static$init$506130788$28$vResize(){return function(a,b,c){let d=!1;const f=N$$module$__$src$natural_js('
    ').css({"text-align":"center",cursor:"n-resize","margin-bottom":a.css("margin-bottom")});a.css("margin-bottom","0");let g,h,k=0;NU$$module$__$src$natural_ui.ui.draggable.events.call(f,".grid.vResize",function(l,m,n,u){void 0!==c&&(k=c.height());h=b.offset()},function(l,m,n,u){g=u-h.top-k+"px";b.css({height:g,"max-height":g})});f.on("mousedown.grid.vResize touchstart.grid.vResize", +function(l){l.originalEvent.touches&&(l.preventDefault(),l.stopPropagation());if(l.originalEvent.touches||1===(l.which||l.button))N$$module$__$src$natural_js(document).on("dragstart.grid.vResize selectstart.grid.vResize",function(){return!1}),d=!0,N$$module$__$src$natural_js(window.document).on("mousemove.grid.vResize touchmove.grid.vResize",function(m){let n;m.originalEvent.touches&&(m.stopPropagation(),n=m.originalEvent.touches[0]);d&&(g=(void 0!==n?n.pageY:m.pageY)-h.top-k+"px",b.css({height:g, +"max-height":g}))}),N$$module$__$src$natural_js(window.document).on("mouseup.grid.vResize touchend.grid.vResize",function(m){N$$module$__$src$natural_js(document).off("dragstart.grid.vResize selectstart.grid.vResize mousemove.grid.vResize touchmove.grid.vResize mouseup.grid.vResize touchend.grid.vResize");d=!1})});a.after(f)}}static $jscomp$static$init$506130788$29$more(){return function(){const a=this.options,b=this;!0===a.more&&(a.more=b.tempRowEle.find("[id]").map(function(){return N$$module$__$src$natural_js(this).attr("id")}).get()); +0 colgroup").length&&a.context.find("> colgroup").append('');var c=NU$$module$__$src$natural_ui.grid.tableCells(a.context.find(">thead")).length;if(0").addClass("grid_more_thead_col__");1').addClass("grid_col_show_hide_btn__").appendTo(d); +void 0!==d&&a.context.find(">thead > tr:first").append(d);d=NU$$module$__$src$natural_ui.grid.tableCells(this.tempRowEle).length;if(0").addClass("grid_more_tbody_col__");1').addClass("grid_more_btn__").appendTo(f);void 0!==f&&b.tempRowEle.find("> tr:first").append(f);f=NU$$module$__$src$natural_ui.grid.tableCells(a.context.find(">tfoot")).length; +if(0").addClass("grid_more_tfoot_col__");1tfoot > tr:first").append(g);g=N$$module$__$src$natural_js('
      ');c.after(g); +let h;g.find(".grid_more_checkall_box__ :checkbox").on("click.grid.more",function(){N$$module$__$src$natural_js(this).is(":checked")?h.find("input[name='hideshow']:not(':checked')").trigger("click"):h.find("input[name='hideshow']:checked").trigger("click")});const k=function(l){h.find("input[name='hideshow']").length===h.find("input[name='hideshow']:checked").length?l.find(".grid_more_checkall_box__ :checkbox").prop("checked",!0):l.find(".grid_more_checkall_box__ :checkbox").prop("checked",!1)};c.on("click.grid.more", +function(l){l.preventDefault();l.stopPropagation();l.stopImmediatePropagation();const m=N$$module$__$src$natural_js(this).next(".grid_more_panel__ ");0").appendTo(h))}),k(m));N$$module$__$src$natural_js(document).off("click.grid.more");N$$module$__$src$natural_js(document).on("click.grid.more", +function(n){0!==N$$module$__$src$natural_js(n.target).parents(".grid_more_panel__, .grid_col_show_hide_btn__").length||N$$module$__$src$natural_js(n.target).hasClass("grid_col_show_hide_btn__")||(m.removeClass("visible__").addClass("hidden__"),m.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(m),function(){m.hide();N$$module$__$src$natural_js(document).off("click.grid.more touchstart.grid.more")}).trigger("nothing"))});m.show(0,function(){N$$module$__$src$natural_js(this).removeClass("hidden__").addClass("visible__")})}); +a.context.on("click.grid.more",".grid_more_tbody_col__ .grid_more_btn__",function(l){l.preventDefault();l.stopPropagation();l.stopImmediatePropagation();let m=a.context.find(">tbody").index(N$$module$__$src$natural_js(this).closest("tbody.form__"));l=N$$module$__$src$natural_js("
      ").addClass("grid_more_popup_contents__");var n=N$$module$__$src$natural_js("
      ").addClass("grid_more_contents__").appendTo(l).css({"overflow-y":"auto","max-height":N$$module$__$src$natural_js(window).height()- +200+"px"});const u=N$$module$__$src$natural_js("
      ").appendTo(n),p=N$$module$__$src$natural_js("").appendTo(u);N$$module$__$src$natural_js(a.more).each(function(){const r=N$$module$__$src$natural_js("").appendTo(p);var v=b.thead.find(">tr > th:regexp(data:id, "+this+")").clone();v.find(".btn_data_filter_full__, .data_filter_panel__, .btn_data_filter__, .resize_bar__, .sortable__").remove();v.removeAttr("rowspan").removeAttr("colspan");N$$module$__$src$natural_js("", +{text:v.text()}).appendTo(r);v=a.context.find(">tbody:eq("+m+") #"+this);v.is("td")?v.clone().removeAttr("rowspan").removeAttr("colspan").removeAttr("class").removeAttr("style").appendTo(r):(v.hasClass("datepicker__")&&v.next(".datepicker_contents__").remove(),v=v.closest("td").clone(),v.find(".datepicker__").removeClass("datepicker__"),v.removeAttr("rowspan").removeAttr("colspan").removeAttr("class").removeAttr("style").appendTo(r))});const t=a.data.form(n).unbind().bind(m);n=N$$module$__$src$natural_js('
      ').appendTo(l); +N$$module$__$src$natural_js(''+NC$$module$__$src$natural_core.message.get(a.message,"prev")+"").on("click.grid.more",function(r){r.preventDefault();0'+String(m+1)+"").appendTo(n);N$$module$__$src$natural_js(''+NC$$module$__$src$natural_core.message.get(a.message, +"next")+"").on("click.grid.more",function(r){r.preventDefault();m+1 tr th:not(.grid_head_fixed__)");let A=!1;NC$$module$__$src$natural_core.browser.scrollbarWidth();NC$$module$__$src$natural_core.browser.is("safari")&&(B.css("padding-left","0"),B.css("padding-right","0"));"fixed"!==z.context.css("table-layout")&&z.context.css("table-layout","fixed");const E=NC$$module$__$src$natural_core.browser.is("ie")?-2:0;let C;C=0 .resize_bar__").css({top:G.position().top+1,left:G.position().left+G.outerWidth()-2.5+z.misc.resizeBarCorrectionLeft+"px"})}).last().find("> .resize_bar__");F.css({left:parseInt(F.css("left"))-2.5});F=void 0});let J=!0;B.each(function(){d=N$$module$__$src$natural_js(this);b=N$$module$__$src$natural_js('
      ').css({padding:"0px", +position:"absolute",width:"5px",height:String(d.outerHeight())+"px",opacity:"0"}).appendTo(d);b.on("mousedown.grid.resize touchstart.grid.resize",function(F){let G;F.originalEvent.touches&&(G=F.originalEvent.touches[0]);if(F.originalEvent.touches||1===(F.which||F.button)){N$$module$__$src$natural_js(this).css({opacity:""}).animate({height:c+"px"},150);r=void 0!==G?G.pageX:F.pageX;n=N$$module$__$src$natural_js(this);f=n.parent("th");g=f.next();let H=!1;0===g.length&&(g=C,H=!0);0 tr > td:eq("+B.index(f)+")"),m=l.next()));if(J&&H){let D;B.each(function(I){D=N$$module$__$src$natural_js(this).width();N$$module$__$src$natural_js(this).width(D+(0 tr > td:eq("+B.index(this)+")").width(D+(0D&&(x=D-r,t=u+x,q=H?p+x:p-x,0tr>th:not(.grid_more_thead_col__)");b.css("cursor","pointer");const c=this;b.filter(function(d, +f){return void 0!==N$$module$__$src$natural_js(f).data("id")}).on("click.grid.sort",function(d){d=N$$module$__$src$natural_js(this);if(d.data("sortLock"))return d.data("sortLock",!1),!1;if(0'+a.sortableItem.asc+"")):(c.bind(N$$module$__$src$natural_js(a.data).datasort(N$$module$__$src$natural_js(this).data("id")),"grid.sort"),b.find(".sortable__").remove(),d.append(''+a.sortableItem.desc+""))}})}}static $jscomp$static$init$506130788$32$dataFilter(){return function(){const a=this.options,b=this.thead,c=b.find("> tr th").filter(function(m,n){return void 0!== +N$$module$__$src$natural_js(n).data("id")}),d=this;let f,g,h,k;const l=function(m,n){m.find(".btn_data_filter__").removeClass("btn_data_filter_empty__ btn_data_filter_part__ btn_data_filter_full__").addClass("btn_data_filter_"+n+"__")};N$$module$__$src$natural_js(''+NC$$module$__$src$natural_core.message.get(a.message,"dFilter")+"").addClass("btn_data_filter_full__").on("click.grid.dataFilter", +function(m){m.preventDefault();m.stopPropagation();const n=N$$module$__$src$natural_js(this);m=b.find(".data_filter_panel__.visible__");if(0
        ').css("z-index",1).hide().appendTo(p).on("click.grid.dataFilter, mouseover.grid.dataFilter",function(w){w.stopPropagation()}),v=N$$module$__$src$natural_js('
        ').css({"z-index":2,opacity:.3}).appendTo(t),m=t.find(".data_filter_search__"),t.find(".data_filter_search_btn__").on("click.grid.dataFilter", +function(w){w.preventDefault();w=t.find(".data_filter_search_word__").val();if(null!==NC$$module$__$src$natural_core.string.trimToNull(w)){const x=q.find("li:contains('"+w+"')").show().find(":checkbox").prop("checked",!0);q.find("li:not(:contains('"+w+"'))").hide().find(":checkbox").prop("checked",!1).last().trigger("do.grid.dataFilter");x.each(function(){const z=N$$module$__$src$natural_js(this);z.parent().children(".data_filter_cnt__").text("("+String(z.data("length"))+")")})}else q.find("li").show(), +q.find("li :checkbox").prop("checked",!0).last().trigger("do.grid.dataFilter")}),t.find(".data_filter_search_word__").on("keyup.grid.dataFilter",function(w){13===(w.keyCode?w.keyCode:w.which?w.which:w.charCode)&&t.find(".data_filter_search_btn__").trigger("click")}),t.find(".data_filter_checkall_box__ :checkbox").on("click.grid.dataFilter",function(){if(N$$module$__$src$natural_js(this).is(":checked")){let w;t.find(".data_filter_search_word__").val("");q.find("li").show();q.find("li :checkbox").prop("checked", +!0).each(function(){w=N$$module$__$src$natural_js(this);w.parent().children(".data_filter_cnt__").text("("+String(w.data("length"))+")")}).last().trigger("do.grid.dataFilter")}else q.find("li .data_filter_checkbox__").prop("checked",!1).last().trigger("do.grid.dataFilter"),q.find("li .data_filter_cnt__").text("(0)")}),q=t.find(".data_filter_list__").css({"max-height":a.height-m.outerHeight()-t.find(".data_filter_checkall_box__").height()-15}),g={},jQuery.each(f,function(w,x){void 0===g[r+"_"+x[r]]? +g[r+"_"+x[r]]=[w]:g[r+"_"+x[r]].push(w)}),NC$$module$__$src$natural_core.isEmptyObject(h)||f.length===a.data.length?h=g:(h={},jQuery.each(a.data,function(w,x){void 0===h[r+"_"+x[r]]?h[r+"_"+x[r]]=[w]:h[r+"_"+x[r]].push(w)})));t.show(0,function(){N$$module$__$src$natural_js(this).removeClass("hidden__").addClass("visible__")});m=0;for(const w in g){var y=void 0;u=void 0===h[w]?0:h[w].length;y=q.find(".data_filter_item_"+String(m)+"__");0"),y.find(".data_filter_item_name__").text(w.replace(r+"_","")),y.find(".data_filter_checkbox__").data("rowIdxs",g[w]).data("length",u).on("click.grid.dataFilter, do.grid.dataFilter",function(){var x=N$$module$__$src$natural_js(this); +x.is(":checked")?x.parent().children(".data_filter_cnt__").text("("+String(x.data("length"))+")"):x.parent().children(".data_filter_cnt__").text("(0)");x=p.find(".data_filter_list__ li :checkbox:not(:checked)");0(this.rowSpanIds.get().join("|")+"|").indexOf(h)||a.prev("td").hasClass("grid_rowspan__")){b=b.find("#"+g).closest("td");g=a.css("background-color");if("rgba(0, 0, 0, 0)"===g||"transparent"===g)g=a.parent().css("background-color");if("rgba(0, 0, 0, 0)"===g||"transparent"===g)g=a.parent().parent().css("background-color");a.css("border-bottom-color",g);a.css("background-color", +g);b.css("background-color",g);a.addClass("grid_rowspan__");g=b.children();0tbody.form__");f.filter(".grid_selected__").each(function(){1tbody.form__"); +f.find(b.checkAllTarget||b.checkSingleTarget).filter(":checked").each(function(){const g=N$$module$__$src$natural_js(this);1tbody.form__");return g.filter(".grid_selected__").map(function(){return g.index(this)}).get()}"array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]);const d=this;let f;b||d.contextEle.find(">tbody.grid_selected__").removeClass("grid_selected__");N$$module$__$src$natural_js(a).each(function(){f=d.contextEle.find(">tbody"+(0a&&(a=0),c.context.parent(".tbody_wrap__").stop().animate({scrollTop:a},300,"swing"));return this}check(a,b){const c=this.options;if(void 0===a){const g=this.contextEle.find(">tbody.form__");return g.find(c.checkAllTarget||c.checkSingleTarget).filter(":checked").map(function(){return g.index(N$$module$__$src$natural_js(this).closest("tbody.form__"))}).get()}"array"!==NC$$module$__$src$natural_core.type(a)&& +(a=[a]);const d=this;let f;b||d.contextEle.find(">tbody").find((c.checkAllTarget||c.checkSingleTarget)+":checked").prop("checked",!1);N$$module$__$src$natural_js(a).each(function(){f=d.contextEle.find(">tbody").find(c.checkAllTarget||c.checkSingleTarget).eq(this);f.is(":checked")&&f.prop("checked",!1);f.trigger("click.grid")});c.checkScroll&&(b=f.closest("tbody.form__"),a=a[a.length-1]*b.outerHeight()-c.height/2+b.outerHeight()/2,0>a&&(a=0),c.context.parent(".tbody_wrap__").stop().animate({scrollTop:a}, +300,"swing"));return this}bind(a,b){const c=this.options;c.sortable&&"grid.sort"!==b&&this.thead.find(".sortable__").remove();if(c.isBinding){const d=this,f=arguments;c.context.queue("bind",function(){d.bind.apply(d,f)})}else{c.data&&a&&"append"===b?(c.scrollPaging.size=0,c.scrollPaging.idx=c.data.length-1,jQuery.merge(c.data,a)):(c.scrollPaging.size=c.scrollPaging.defSize,null!=a&&(c.data="array"===NC$$module$__$src$natural_core.type(a)?N$$module$__$src$natural_js(a):a));if(c.filter||0 tr th[data-filter='true']").length)if("grid.dataFilter"!== +b&&"grid.sort"!==b||("grid.dataFilter"===b||"grid.sort"===b)&&"grid.sort"===b)this.thead.find("th .data_filter_panel__").remove(),"grid.dataFilter"!==b&&"grid.sort"!==b&&(this.thead.find(".btn_data_filter__").removeClass("btn_data_filter_empty__ btn_data_filter_part__ btn_data_filter_full__").addClass("btn_data_filter_full__"),0tbody").clearQueue().stop();"grid.bind"!==b&&(c.scrollPaging.idx="append"===b&&0tbody>tr>td.empty__").parent().parent().remove():c.context.find(">tbody").remove());const d=c.scrollPaging.idx;NU$$module$__$src$natural_ui.ui.iteration.render.call(this,d,0===c.height|| +0===c.scrollPaging.size||"append"===b&&0tbody").remove();let d=0;void 0!==this.tableMap.colgroup[0]&&0"+NC$$module$__$src$natural_core.message.get(c.message,"empty")+"");c.context.append(f);0tbody").remove();const d=this.tempRowEle.clone(!0, +!0);NC$$module$__$src$natural_core.isNumeric(a)&&(b=a,a=void 0);if(b>c.data.length||0>b)b=void 0;if(void 0===b)c.addTop?c.context.find(">thead").after(d):c.context.append(d);else{var f=c.context.find(">tbody:eq("+b+")");0===b?c.context.find("thead").after(d):b===c.context.find(">tbody").length?f=c.context.find(">tbody:eq("+(b-1)+")"):c.context.find(">tbody:eq("+b+")").before(d);c.addScroll?(f=b*f.outerHeight()-c.height/2+f.outerHeight()/2,0>f&&(f=0),c.context.parent(".tbody_wrap__").stop().animate({scrollTop:f}, +300,"swing",function(){c.addSelect&&N$$module$__$src$natural_js(this).find(">table>tbody:eq("+b+")").trigger("click.grid")})):c.addSelect&&setTimeout(function(){c.context.parent(".tbody_wrap__").find(">table>tbody:eq("+b+")").trigger("click.grid")},0)}f=c.data.form({context:d,html:c.html,validate:c.validate,extObj:this,extRow:void 0===b?c.addTop?0:c.data.length:b,addTop:c.addTop,revert:c.revert,tpBind:c.tpBind});f.add(a,b);null!==c.rowHandler&&c.rowHandler.call(this,f.options.extRow,d,f.data(!0)[0]); +0 tbody").removeClass("grid_selected__");void 0===b&&c.context.parent(".tbody_wrap__").stop().animate({scrollTop:c.addTop?0:c.context.parent(".tbody_wrap__").prop("scrollHeight")},300,"swing",function(){c.addSelect&&N$$module$__$src$natural_js(this).find("> table > tbody:"+(c.addTop?"first":"last")).trigger("click.grid")});return this}remove(a){const b=this.options;void 0!==a&&("array"!== +NC$$module$__$src$natural_core.type(a)&&(a=[a]),N$$module$__$src$natural_js(a.sort().reverse()).each(function(c,d){if(void 0===b.data[this])throw NC$$module$__$src$natural_core.error("[NU.grid.prototype.remove]Row index is out of range");"insert"===b.data[this].rowStatus?(b.data.splice(this,1),b.context.find(">tbody:eq("+d+")").remove(),c=b.context.find(">tbody").length,d=b.scrollPaging.size,b.scrollPaging.idx=c/d*d-d+c%d):(b.data[this].rowStatus="delete",b.context.find(">tbody:eq("+d+")").addClass("row_data_deleted__"))})); +ND$$module$__$src$natural_data.ds.instance(this).notify();return this}revert(a){const b=this.options;if(!b.revert)throw NC$$module$__$src$natural_core.error("[NU.form.prototype.revert]Can not revert. NU.form's revert option value is false");const c=this;void 0!==a?("array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]),N$$module$__$src$natural_js(a).each(function(){const d=b.context.find(">tbody:eq("+String(this)+")"),f=d.instance("form");null!==b.rowHandlerBeforeBind&&b.rowHandlerBeforeBind.call(c, +this,d,f.options.revertData);f.revert();null!==b.rowHandler&&b.rowHandler.call(c,this,d,b.data[this])})):b.context.find(">tbody").instance("form",function(){if(void 0!==this.options&&("update"===this.options.data[0].rowStatus||"insert"===this.options.data[0].rowStatus)){const d=this.options.extRow;null!==b.rowHandlerBeforeBind&&b.rowHandlerBeforeBind.call(c,d,this.context(),this.options.revertData);this.revert();null!==b.rowHandler&&b.rowHandler.call(c,d,this.context(),b.data[d])}});return this}validate(a){const b= +this.options;let c=!0;if(void 0!==a)c=b.context.find(">tbody:eq("+String(a)+")").instance("form").validate();else{let d;b.context.find(">tbody").instance("form",function(f){void 0!==this.options&&0.form__:eq("+String(a)+")").instance("form");if(d)d.val(b,c);else if(this.options.data[a])this.options.data[a][b]=c;else throw NC$$module$__$src$natural_core.error("[NU.grid.prototype.val]There is no row data that is "+a+" index");return this}move(a,b){NU$$module$__$src$natural_ui.ui.iteration.move.call(this,a,b,"grid");return this}copy(a, +b){NU$$module$__$src$natural_ui.ui.iteration.copy.call(this,a,b,"grid");return this}show(a){const b=this.options,c=this;void 0!==a&&"array"!==NC$$module$__$src$natural_core.type(a)&&(a=[a]);N$$module$__$src$natural_js(a).each(function(f,g){f=0tbody>tr>.empty__");0tbody>tr>.empty__");0tbody:eq("+String(a)+")").instance("form").update(0,b):!0!==this.options.data[a]._isRevert&&"insert"===this.options.data[a].rowStatus?"insert"===this.options.data[a].rowStatus?this.bind(void 0,"grid.update"):this.add(this.options.data[a]):this.options.context.find(">tbody:eq("+String(a)+")").instance("form").update(0):this.bind(void 0,"grid.update");return this}};e.tableCells=e.$jscomp$static$init$506130788$22$tableCells(); +e.tableMap=e.$jscomp$static$init$506130788$23$tableMap();e.setTheadCellInfo=e.$jscomp$static$init$506130788$24$setTheadCellInfo();e.removeColgroup=e.$jscomp$static$init$506130788$25$removeColgroup();e.fixColumn=e.$jscomp$static$init$506130788$26$fixColumn();e.fixHeader=e.$jscomp$static$init$506130788$27$fixHeader();e.vResize=e.$jscomp$static$init$506130788$28$vResize();e.more=e.$jscomp$static$init$506130788$29$more();e.resize=e.$jscomp$static$init$506130788$30$resize();e.sort=e.$jscomp$static$init$506130788$31$sort(); +e.dataFilter=e.$jscomp$static$init$506130788$32$dataFilter();e.rowSpan=e.$jscomp$static$init$506130788$33$rowSpan();e.paste=e.$jscomp$static$init$506130788$34$paste();return e})()}static $jscomp$static$init$506130788$47$pagination(){return(()=>{const e=class{constructor(a,b){this.options={data:"array"===NC$$module$__$src$natural_core.type(a)?N$$module$__$src$natural_js(a):a,context:null,totalCount:0,countPerPage:10,countPerPageSet:10,pageNo:1,onChange:null,blockOnChangeWhenBind:!1,currPageNavInfo:null}; +try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").pagination)}catch(c){throw NC$$module$__$src$natural_core.error("NU.pagination",c);}0f&&(g=f);let h=(g-1)*b.countPerPageSet+ +1,k=h+b.countPerPageSet-1;1>h&&(h=1);k>d&&(k=d);1>k&&(k=1);if(void 0===c||!1===c){a.body.empty();for(let l=h;l<=k;l++)c=a.page.clone(!0,!0),c.attr("data-pageno",String(l)),c.find("a > span").text(String(l)),a.body.append(c)}0=g?N$$module$__$src$natural_js(a.prev).removeClass("pagination_disable__"):N$$module$__$src$natural_js(a.prev).addClass("pagination_disable__");void 0!==a.first&&(1!==b.pageNo?N$$module$__$src$natural_js(a.first).removeClass("pagination_disable__"):N$$module$__$src$natural_js(a.first).addClass("pagination_disable__")); +f>g?N$$module$__$src$natural_js(a.next).removeClass("pagination_disable__"):N$$module$__$src$natural_js(a.next).addClass("pagination_disable__");void 0!==a.last&&(0b.totalCount-1&&(c=b.totalCount-1);return b.currPageNavInfo={pageNo:b.pageNo,countPerPage:b.countPerPage,countPerPageSet:b.countPerPageSet, +totalCount:b.totalCount,pageCount:d,pageSetCount:f,currSelPageSet:g,startPage:h,endPage:k,startRowIndex:a,startRowNum:a+1,endRowIndex:c,endRowNum:c+1}}}data(a){if(void 0===a)return this.options.data.get();if(!1===a)return this.options.data}context(a){return void 0!==a?this.options.context.find(a):this.options.context}bind(a,b){const c=this.options,d=this;0=c.currPageNavInfo.currSelPageSet&&(c.pageNo=c.currPageNavInfo.startPage-c.countPerPageSet,c.currPageNavInfo=NU$$module$__$src$natural_ui.pagination.changePageSet(f,c),f.body.find("li a:first").trigger("click.pagination"))});f.body.off("click.pagination");f.body.on("click.pagination","li > a",function(g,h){g.preventDefault();c.pageNo=Number(N$$module$__$src$natural_js(this).parent().data("pageno")); +c.currPageNavInfo=NU$$module$__$src$natural_ui.pagination.changePageSet(f,c,!0);if(null!==c.onChange){g=[];if(0c.currPageNavInfo.currSelPageSet&&(c.pageNo=c.currPageNavInfo.startPage+c.countPerPageSet,c.currPageNavInfo=NU$$module$__$src$natural_ui.pagination.changePageSet(f,c),f.body.find("li a:first").trigger("click.pagination"))});void 0!==f.last&&(f.last.off("click.pagination"),f.last.on("click.pagination", +function(g){g.preventDefault();c.pageNo!==c.currPageNavInfo.pageCount&&(c.pageNo=c.currPageNavInfo.pageCount,c.currPageNavInfo=NU$$module$__$src$natural_ui.pagination.changePageSet(f,c),f.body.find("li a:last").trigger("click.pagination"))}));return this}totalCount(a){const b=this.options;return void 0!==a?(b.totalCount=a,this):b.totalCount}pageNo(a){const b=this.options;return void 0!==a?(b.pageNo=a,this):b.pageNo}countPerPage(a){if(void 0!==a){const b=this.options;b.countPerPage=a;b.pageNo=1}else return this.options.countPerPage; +return this}countPerPageSet(a){if(void 0!==a){const b=this.options;b.countPerPageSet=a;b.pageNo=1}else return this.options.countPerPageSet;return this}currPageNavInfo(){return this.options.currPageNavInfo}};e.wrapEle=e.$jscomp$static$init$506130788$35$wrapEle();e.changePageSet=e.$jscomp$static$init$506130788$36$changePageSet();return e})()}static $jscomp$static$init$506130788$48$tree(){return(()=>class{constructor(e,a){this.options={data:"array"===NC$$module$__$src$natural_core.type(e)?N$$module$__$src$natural_js(e): +e,context:null,key:null,val:null,level:null,parent:null,folderSelectable:!1,checkbox:!1,onSelect:null,onCheck:null};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui").tree)}catch(b){throw NC$$module$__$src$natural_core.error("NU.tree",b);}NC$$module$__$src$natural_core.isPlainObject(a)?(NU$$module$__$src$natural_ui.ui.utils.wrapHandler(a,"tree","onSelect"),NU$$module$__$src$natural_ui.ui.utils.wrapHandler(a,"tree","onCheck"),a.data="array"===NC$$module$__$src$natural_core.type(a.data)? +N$$module$__$src$natural_js(a.data):a.data,jQuery.extend(this.options,a),"string"===NC$$module$__$src$natural_core.type(this.options.context)&&(this.options.context=N$$module$__$src$natural_js(this.options.context))):this.options.context=N$$module$__$src$natural_js(a);this.options.context.addClass("tree__");this.options.context.instance("tree",this);ND$$module$__$src$natural_data.ds.instance(this,!0);return this}data(e){if(void 0===e)return this.options.data.get();if(!1===e)return this.options.data; +if("selected"===e){const a=this.options.data;if(1').appendTo(a.context.empty());let d=!1;N$$module$__$src$natural_js(a.data).each(function(f,g){1!==g[a.level]&&d?c.find("#"+g[a.parent]).append('
      • '+(a.checkbox?'':"")+''+g[a.key]+'
        • '):(c.append('
        • '+(a.checkbox?'': +"")+''+g[a.key]+'
          • '),d=!0)});e=c.find("ul:empty");e.parent().addClass("tree_last_node__");e.remove();if(a.checkbox)c.on("click.tree",".tree_check__ > :checkbox",function(f){let g;var h=N$$module$__$src$natural_js(this).closest("li").parent().children("li"),k=N$$module$__$src$natural_js(this).parents("li"),l=N$$module$__$src$natural_js(this).closest("ul").parent(); +N$$module$__$src$natural_js(this).removeClass("tree_auto_parents_select__");N$$module$__$src$natural_js(this).is(":checked")?(N$$module$__$src$natural_js(this).parent().siblings("ul").find(":not(:checked)").prop("checked",!0),g=!0):(N$$module$__$src$natural_js(this).parent().siblings("ul").find(":checked").prop("checked",!1),g=!1);const m=h.find(":checkbox").length;h=h.find(":checked").length;l=l.find("> span.tree_check__ > :checkbox");const n=k.not(":first").find("> span.tree_check__ > :checkbox"); +g?0 span.tree_check__ > :not(:checked)").prop("checked",!0).addClass("tree_auto_parents_select__"):h===m&&(l.prop("checked",!0).removeClass("tree_auto_parents_select__"),l.trigger("click.tree").trigger("click.tree"))):0 a.tree_key__.tree_active__").removeClass("tree_active__");N$$module$__$src$natural_js(this).addClass("tree_active__")});c.on("click.tree",".tree_icon__"+(a.folderSelectable?"":", li:not('.tree_last_node__') .tree_key__"),function(f){f.preventDefault();f=N$$module$__$src$natural_js(this).parent("li");0 ul > li").length&&(f.hasClass("tree_open__")?f.removeClass("tree_open__").addClass("tree_close__"): +f.removeClass("tree_close__").addClass("tree_open__"))});if(a.folderSelectable)c.on("click.tree","li:not('.tree_last_node__') .tree_key__",function(f){f.preventDefault()});this.collapse(!0);return this}select(e){const a=this.options;if(void 0!==e)return a.context.find(".tree_"+e+"__ > .tree_key__").trigger("click.tree"),this;e=a.context.find(".tree_key__.tree_active__");if(0{const e=class{constructor(a,b){if(!NC$$module$__$src$natural_core.isEmptyObject(a)&&void 0===b)return new NUS$$module$__$src$natural_ui_shell.notify(null,a);this.options={position:{top:10,right:10},container:N$$module$__$src$natural_js("body"),context:null, +displayTime:7,alwaysOnTop:!1,html:!1,alwaysOnTopCalcTarget:"div, span, ul, p, nav, article, section, header, footer, aside"};try{jQuery.extend(this.options,NA$$module$__$src$natural_architecture.context.attr("ui.shell").notify),a&&(NC$$module$__$src$natural_core.isWrappedSet(a)?0
            ").addClass("notify__").css({position:"fixed"}).appendTo(a.container); +a.alwaysOnTop&&a.context.css("z-index",String(NC$$module$__$src$natural_core.element.maxZindex(N$$module$__$src$natural_js(a.alwaysOnTopCalcTarget))+1))}}context(a){return void 0!==a?this.options.context.find(a):this.options.context}add(a,b){const c=this.options,d=this;c.context.css({top:"",right:"",bottom:"",left:""});c.context.css(c.position);const f=N$$module$__$src$natural_js(void 0!==b?'':"");f[c.html?"html":"text"](a);if(void 0!==b)f.on("click.notify",function(h){h.preventDefault(); +"function"===typeof b?b.call(this):NC$$module$__$src$natural_core.string.startsWith(b,"#")?location.hash=b:location.href=b});const g=N$$module$__$src$natural_js("
            ",{"class":"notify_msg__"}).css({display:"none",position:"relative"}).append(f).appendTo(c.context).show().addClass("visible__");N$$module$__$src$natural_js('').appendTo(g).on("click.notify",function(h){h.preventDefault(); +d.remove(g)});setTimeout(function(){d.remove(g)},1E3*c.displayTime);return this}remove(a){a.removeClass("visible__").addClass("hidden__");a.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(a),function(b){N$$module$__$src$natural_js(this).remove()}).trigger("nothing");return this}};e.add=e.$jscomp$static$init$m773549662$0$add();e.wrapEle=e.$jscomp$static$init$m773549662$1$wrapEle();return e})()}static $jscomp$static$init$m773549662$17$docs(){return(()=>{const e=class{constructor(a,b){this.options= +{context:0d.indexOf(f.options.url)&&(c.options.entireLoadRequestCnt++, +c.options.entireLoadIndicator&&c.options.entireLoadRequestMaxCnt++),this.errorHandlers.push(function(k,l,m,n,u){null!==c.options.onErrorEntireLoad&&c.options.onErrorEntireLoad.call(c,k,l,m,n,u);NUS$$module$__$src$natural_ui_shell.docs.errorLoadIndicator.call(c);c.options.entireLoadRequestCnt=0;c.options.entireLoadIndicator&&(c.options.entireLoadRequestMaxCnt=0)}))},complete:function(f,g,h){null!==c.options.loadedDocId&&(0>d.indexOf(f.options.url)&&(c.options.entireLoadRequestCnt--,c.options.entireLoadIndicator&& +NUS$$module$__$src$natural_ui_shell.docs.updateLoadIndicator.call(c)),0>=c.options.entireLoadRequestCnt&&(null!==c.options.onEntireLoad&&c.options.onEntireLoad.call(c,c.options.loadedDocId,c.options.entireLoadRequestCnt,c.options.entireLoadRequestMaxCnt),NUS$$module$__$src$natural_ui_shell.docs.removeLoadIndicator.call(c),c.options.entireLoadRequestMaxCnt=0,c.options.entireLoadRequestCnt=0))}};NA$$module$__$src$natural_architecture.comm.resetFilterConfig()}this.request=new NA$$module$__$src$natural_architecture.comm.request(this); +NUS$$module$__$src$natural_ui_shell.docs.wrapEle.call(this);this.options.tabScroll&&NUS$$module$__$src$natural_ui_shell.docs.wrapScroll.call(this);this.options.context.instance("docs",this);return this}static $jscomp$static$init$m773549662$2$createLoadIndicator(){return function(){const a=this.options;if(a.entireLoadScreenBlock){var b=NC$$module$__$src$natural_core.element.maxZindex(N$$module$__$src$natural_js(a.alwaysOnTopCalcTarget).not(".entire_load_screen_block__, .entire_load_indicator__"))+ +1;var c=N$$module$__$src$natural_js(".entire_load_screen_block__");0
            ').css("z-index",String(b)).on("click",function(d){d.stopPropagation()}),c.appendTo("body").on(NC$$module$__$src$natural_core.event.whichTransitionEvent(c),function(d){N$$module$__$src$natural_js(this).hide().removeClass("hidden__")}).trigger("nothing"));c=void 0}a.entireLoadIndicator&& +(b=void 0===b?NC$$module$__$src$natural_core.element.maxZindex(N$$module$__$src$natural_js(a.alwaysOnTopCalcTarget).not(".entire_load_screen_block__, .entire_load_indicator__"))+1:b+1,c=a.context.find("> .entire_load_indicator__"),0 .entire_load_indicator_bar__").css("left","")):(b=N$$module$__$src$natural_js('
            ').on("click",function(d){d.stopPropagation()}).css("z-index", +String(b)),a.context.find(".docs_tab_context__").after(b)),c=void 0);return this}}static $jscomp$static$init$m773549662$3$updateLoadIndicator(){return function(a,b){const c=this.options;c.context.find("> .entire_load_indicator__ > .entire_load_indicator_bar__").css("left","-"+100*(a?a:c.entireLoadRequestCnt)/(b?b:c.entireLoadRequestMaxCnt)+"%");return this}}static $jscomp$static$init$m773549662$4$removeLoadIndicator(){return function(){const a=this.options;if(a.entireLoadIndicator){const b=a.context.find("> .entire_load_indicator__"); +b.addClass("hidden__").one(NC$$module$__$src$natural_core.event.whichTransitionEvent(b),function(c){N$$module$__$src$natural_js(this).hide()}).trigger("nothing");b.find("> .entire_load_indicator_bar__").css("left","0")}a.entireLoadScreenBlock&&N$$module$__$src$natural_js(".entire_load_screen_block__").trigger("nothing");return this}}static $jscomp$static$init$m773549662$5$errorLoadIndicator(){return function(){const a=this.options;if(a.entireLoadIndicator){const b=a.context.find("> .entire_load_indicator__"); +b.one(NC$$module$__$src$natural_core.event.whichTransitionEvent(b),function(c){N$$module$__$src$natural_js(this).hide()}).trigger("nothing");a.context.find("> .entire_load_indicator__ > .entire_load_indicator_bar__").css("left","")}a.entireLoadScreenBlock&&N$$module$__$src$natural_js(".entire_load_screen_block__").trigger("nothing");return this}}static $jscomp$static$init$m773549662$6$wrapEle(){return function(){const a=this.options;a.context.addClass("docs__");NC$$module$__$src$natural_core.browser.is("ios")&& +a.context.addClass("ios__");NC$$module$__$src$natural_core.browser.is("android")&&a.context.addClass("android__");if(a.multi){a.context.addClass("multi__");var b=N$$module$__$src$natural_js("",{"class":"docs_tab_context__"}).appendTo(a.context);N$$module$__$src$natural_js("