diff --git a/Gruntfile.js b/Gruntfile.js index ac450a71..1635f800 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -79,6 +79,16 @@ module.exports = function (grunt) { },{ pattern: /{VERSION}/ig, replacement: pkg.version + },{ + pattern: /{EZEDITTABLE_LINK}/ig, + replacement: 'ezEditTable' },{ pattern: //ig, replacement: function (match, p1) { diff --git a/demos/old/demo.html b/demos/advanced-grid.html similarity index 95% rename from demos/old/demo.html rename to demos/advanced-grid.html index 8ba81513..790eeb16 100644 --- a/demos/old/demo.html +++ b/demos/advanced-grid.html @@ -1,13 +1,13 @@ - TableFilter v0.0.0 - Demo + TableFilter v0.0.0 - Selection Grid Demo

TableFilter v0.0.0

+

Selection grid demo

+

+ To make the grid rows selectable, you need to import the + ezEditTable plugin, enable the selectable property + and configure the advancedGrid with the ezEditTable + options. +

+

+ Instructions: Double-click on a row on or press enter key to + perform action. Enable multiple rows selection by checking the Multiple + selection checkbox. Keep Ctrl/Cmd or Shift key + pressed to select multiple rows. +


 
 
+
+ + +
+ @@ -41,7 +71,7 @@ - + @@ -52,7 +82,7 @@ - + @@ -63,7 +93,7 @@ - + @@ -74,7 +104,7 @@ - + @@ -85,7 +115,7 @@ - + @@ -96,7 +126,7 @@ - + @@ -107,7 +137,7 @@ - + @@ -118,7 +148,7 @@ - + @@ -129,7 +159,7 @@ - + @@ -140,7 +170,7 @@ - + @@ -151,7 +181,7 @@ - + @@ -162,7 +192,7 @@ - + @@ -173,7 +203,7 @@ - + @@ -184,7 +214,7 @@ - + @@ -195,7 +225,7 @@ - + @@ -206,7 +236,7 @@ - + @@ -217,7 +247,7 @@ - + @@ -228,7 +258,7 @@ - + @@ -239,7 +269,7 @@ - + @@ -250,7 +280,7 @@ - + @@ -261,7 +291,7 @@ - + @@ -272,7 +302,7 @@ - + @@ -283,7 +313,7 @@ - + @@ -294,7 +324,7 @@ - + @@ -305,7 +335,7 @@ - + @@ -316,7 +346,7 @@ - + @@ -327,7 +357,7 @@ - + @@ -338,7 +368,7 @@ - + @@ -349,7 +379,7 @@ - + @@ -360,7 +390,7 @@ - + @@ -371,7 +401,7 @@ - + @@ -382,7 +412,7 @@ - + @@ -393,7 +423,7 @@ - + @@ -404,7 +434,7 @@ - + @@ -415,7 +445,7 @@ - + @@ -426,7 +456,7 @@ - + @@ -437,7 +467,7 @@ - + @@ -448,7 +478,7 @@ - + @@ -459,7 +489,7 @@ - + @@ -470,7 +500,7 @@ - + @@ -481,7 +511,7 @@ - + @@ -492,7 +522,7 @@ - + @@ -503,7 +533,7 @@ - + @@ -514,7 +544,7 @@ - + @@ -525,7 +555,7 @@ - + @@ -536,7 +566,7 @@ - + @@ -547,7 +577,7 @@ - + @@ -558,7 +588,7 @@ - + @@ -569,7 +599,7 @@ - + @@ -580,7 +610,7 @@ - + @@ -591,7 +621,7 @@ - + @@ -602,7 +632,7 @@ - + @@ -613,7 +643,7 @@ - + @@ -624,7 +654,7 @@ - + @@ -635,7 +665,7 @@ - + @@ -646,7 +676,7 @@ - + @@ -657,7 +687,7 @@ - + @@ -668,7 +698,7 @@ - + @@ -679,7 +709,7 @@ - + @@ -690,7 +720,7 @@ - + @@ -701,7 +731,7 @@ - + @@ -712,7 +742,7 @@ - + @@ -723,7 +753,7 @@ - + @@ -734,7 +764,7 @@ - + @@ -745,7 +775,7 @@ - + @@ -756,7 +786,7 @@ - + @@ -767,7 +797,7 @@ - + @@ -778,7 +808,7 @@ - + @@ -789,7 +819,7 @@ - + @@ -800,7 +830,7 @@ - + @@ -811,7 +841,7 @@ - + @@ -822,7 +852,7 @@ - + @@ -833,7 +863,7 @@ - + @@ -844,7 +874,7 @@ - + @@ -855,7 +885,7 @@ - + @@ -866,7 +896,7 @@ - + @@ -877,7 +907,7 @@ - + @@ -888,7 +918,7 @@ - + @@ -899,7 +929,7 @@ - + @@ -910,7 +940,7 @@ - + @@ -921,7 +951,7 @@ - + @@ -932,7 +962,7 @@ - + @@ -943,7 +973,7 @@ - + @@ -954,7 +984,7 @@ - + @@ -965,7 +995,7 @@ - + @@ -976,7 +1006,7 @@ - + @@ -987,7 +1017,7 @@ - + @@ -998,7 +1028,7 @@ - + @@ -1009,7 +1039,7 @@ - + @@ -1020,7 +1050,7 @@ - + @@ -1031,7 +1061,7 @@ - + @@ -1042,7 +1072,7 @@ - + @@ -1053,7 +1083,7 @@ - + @@ -1064,7 +1094,7 @@ - + @@ -1075,7 +1105,7 @@ - + @@ -1086,7 +1116,7 @@ - + @@ -1097,7 +1127,7 @@ - + @@ -1108,7 +1138,7 @@ - + @@ -1119,7 +1149,7 @@ - + @@ -1130,7 +1160,7 @@ - + @@ -1141,7 +1171,7 @@ - + @@ -1152,7 +1182,7 @@ - + @@ -1163,7 +1193,7 @@ - + @@ -1174,7 +1204,7 @@ - + @@ -1185,7 +1215,7 @@ - + @@ -1196,7 +1226,7 @@ - + @@ -1207,7 +1237,7 @@ - + @@ -1218,7 +1248,7 @@ - + @@ -1229,7 +1259,7 @@ - + @@ -1240,7 +1270,7 @@ - + @@ -1251,7 +1281,7 @@ - + @@ -1262,7 +1292,7 @@ - + @@ -1273,7 +1303,7 @@ - + @@ -1284,7 +1314,7 @@ - + @@ -1295,7 +1325,7 @@ - + @@ -1306,7 +1336,7 @@ - + @@ -1317,7 +1347,7 @@ - + @@ -1328,7 +1358,7 @@ - + @@ -1339,7 +1369,7 @@ - + @@ -1350,7 +1380,7 @@ - + @@ -1361,7 +1391,7 @@ - + @@ -1372,7 +1402,7 @@ - + @@ -1383,7 +1413,7 @@ - + @@ -1394,7 +1424,7 @@ - + @@ -1405,7 +1435,7 @@ - + @@ -1416,7 +1446,7 @@ - + @@ -1427,7 +1457,7 @@ - + @@ -1438,7 +1468,7 @@ - + @@ -1449,7 +1479,7 @@ - + @@ -1460,7 +1490,7 @@ - + @@ -1471,7 +1501,7 @@ - + @@ -1482,7 +1512,7 @@ - + @@ -1493,7 +1523,7 @@ - + @@ -1504,7 +1534,7 @@ - + @@ -1515,7 +1545,7 @@ - + @@ -1526,7 +1556,7 @@ - + @@ -1537,7 +1567,7 @@ - + @@ -1548,7 +1578,7 @@ - + @@ -1559,7 +1589,7 @@ - + @@ -1570,7 +1600,7 @@ - + @@ -1581,7 +1611,7 @@ - + @@ -1592,7 +1622,7 @@ - + @@ -1603,7 +1633,7 @@ - + @@ -1614,7 +1644,7 @@ - + @@ -1625,7 +1655,7 @@ - + @@ -1636,7 +1666,7 @@ - + @@ -1647,7 +1677,7 @@ - + @@ -1658,7 +1688,7 @@ - + @@ -1669,7 +1699,7 @@ - + @@ -1680,7 +1710,7 @@ - + @@ -1691,7 +1721,7 @@ - + @@ -1702,7 +1732,7 @@ - + @@ -1713,7 +1743,7 @@ - + @@ -1724,7 +1754,7 @@ - + @@ -1735,7 +1765,7 @@ - + @@ -1746,7 +1776,7 @@ - + @@ -1757,7 +1787,7 @@ - + @@ -1768,7 +1798,7 @@ - + @@ -1779,7 +1809,7 @@ - + @@ -1790,7 +1820,7 @@ - + @@ -1801,7 +1831,7 @@ - + @@ -1812,7 +1842,7 @@ - + @@ -1823,7 +1853,7 @@ - + @@ -1834,7 +1864,7 @@ - + @@ -1845,7 +1875,7 @@ - + @@ -1856,7 +1886,7 @@ - + @@ -1867,7 +1897,7 @@ - + @@ -1878,7 +1908,7 @@ - + @@ -1889,7 +1919,7 @@ - + @@ -1900,7 +1930,7 @@ - + @@ -1911,7 +1941,7 @@ - + @@ -1922,7 +1952,7 @@ - + @@ -1933,7 +1963,7 @@ - + @@ -1944,7 +1974,7 @@ - + @@ -1955,7 +1985,7 @@ - + @@ -1966,7 +1996,7 @@ - + @@ -1977,7 +2007,7 @@ - + @@ -1988,7 +2018,7 @@ - + @@ -1999,7 +2029,7 @@ - + @@ -2010,7 +2040,7 @@ - + @@ -2021,7 +2051,7 @@ - + @@ -2032,7 +2062,7 @@ - + @@ -2043,7 +2073,7 @@ - + @@ -2054,7 +2084,7 @@ - + @@ -2065,7 +2095,7 @@ - + @@ -2076,7 +2106,7 @@ - + @@ -2087,7 +2117,7 @@ - + @@ -2098,7 +2128,7 @@ - + @@ -2109,7 +2139,7 @@ - + @@ -2120,7 +2150,7 @@ - + @@ -2131,7 +2161,7 @@ - + @@ -2142,7 +2172,7 @@ - + @@ -2153,7 +2183,7 @@ - + @@ -2164,7 +2194,7 @@ - + @@ -2175,7 +2205,7 @@ - + @@ -2186,7 +2216,7 @@ - + @@ -2197,7 +2227,7 @@ - + @@ -2208,7 +2238,7 @@ - + @@ -2219,7 +2249,7 @@ - + @@ -2230,7 +2260,7 @@ - + @@ -2241,7 +2271,7 @@ - + @@ -2252,7 +2282,7 @@ - + @@ -2263,7 +2293,7 @@ - + @@ -2274,7 +2304,7 @@ - + @@ -2285,7 +2315,7 @@ - + @@ -2296,7 +2326,7 @@ - + @@ -2307,7 +2337,7 @@ - + @@ -2318,7 +2348,7 @@ - + @@ -2329,7 +2359,7 @@ - + @@ -2340,7 +2370,7 @@ - + @@ -2351,7 +2381,7 @@ - + @@ -2362,7 +2392,7 @@ - + @@ -2373,7 +2403,7 @@ - + @@ -2384,7 +2414,7 @@ - + @@ -2395,7 +2425,7 @@ - + @@ -2406,7 +2436,7 @@ - + @@ -2417,7 +2447,7 @@ - + @@ -2428,7 +2458,7 @@ - + @@ -2439,7 +2469,7 @@ - + @@ -2450,7 +2480,7 @@ - + @@ -2461,7 +2491,7 @@ - + @@ -2472,7 +2502,7 @@ - + @@ -2483,7 +2513,7 @@ - + @@ -2494,7 +2524,7 @@ - + @@ -2505,7 +2535,7 @@ - + @@ -2516,7 +2546,7 @@ - + @@ -2527,7 +2557,7 @@ - + @@ -2538,7 +2568,7 @@ - + @@ -2549,7 +2579,7 @@ - + @@ -2560,7 +2590,7 @@ - + @@ -2571,7 +2601,7 @@ - + @@ -2582,7 +2612,7 @@ - + @@ -2593,7 +2623,7 @@ - + @@ -2604,7 +2634,7 @@ - + @@ -2615,7 +2645,7 @@ - + @@ -2626,7 +2656,7 @@ - + @@ -2637,7 +2667,7 @@ - + @@ -2648,7 +2678,7 @@ - + @@ -2659,7 +2689,7 @@ - + @@ -2670,7 +2700,7 @@ - + @@ -2681,7 +2711,7 @@ - + @@ -2692,7 +2722,7 @@ - + @@ -2703,7 +2733,7 @@ - + @@ -2714,7 +2744,7 @@ - + @@ -2725,7 +2755,7 @@ - + @@ -2736,7 +2766,7 @@ - + @@ -2747,7 +2777,7 @@ - + @@ -2758,7 +2788,7 @@ - + @@ -2769,7 +2799,7 @@ - + @@ -2780,7 +2810,7 @@ - + @@ -2791,7 +2821,7 @@ - + @@ -2802,7 +2832,7 @@ - + @@ -2813,7 +2843,7 @@ - + @@ -2824,7 +2854,7 @@ - + @@ -2835,7 +2865,7 @@ - + @@ -2846,7 +2876,7 @@ - + @@ -2857,7 +2887,7 @@ - + @@ -2868,7 +2898,7 @@ - + @@ -2879,7 +2909,7 @@ - + @@ -2890,7 +2920,7 @@ - + @@ -2901,7 +2931,7 @@ - + @@ -2912,7 +2942,7 @@ - + @@ -2923,7 +2953,7 @@ - + @@ -2934,7 +2964,7 @@ - + @@ -2945,7 +2975,7 @@ - + @@ -2956,7 +2986,7 @@ - + @@ -2967,7 +2997,7 @@ - + @@ -2978,7 +3008,7 @@ - + @@ -2989,7 +3019,7 @@ - + @@ -3000,7 +3030,7 @@ - + @@ -3011,7 +3041,7 @@ - + @@ -3022,7 +3052,7 @@ - + @@ -3033,7 +3063,7 @@ - + @@ -3044,7 +3074,7 @@ - + @@ -3055,7 +3085,7 @@ - + @@ -3066,7 +3096,7 @@ - + @@ -3077,7 +3107,7 @@ - + @@ -3088,7 +3118,7 @@ - + @@ -3099,7 +3129,7 @@ - + @@ -3110,7 +3140,7 @@ - + @@ -3121,7 +3151,7 @@ - + @@ -3132,7 +3162,7 @@ - + @@ -3143,7 +3173,7 @@ - + @@ -3154,7 +3184,7 @@ - + @@ -3165,7 +3195,7 @@ - + @@ -3176,7 +3206,7 @@ - + @@ -3187,7 +3217,7 @@ - + @@ -3198,7 +3228,7 @@ - + @@ -3209,7 +3239,7 @@ - + @@ -3220,7 +3250,7 @@ - + @@ -3231,7 +3261,7 @@ - + @@ -3242,7 +3272,7 @@ - + @@ -3253,7 +3283,7 @@ - + @@ -3264,7 +3294,7 @@ - + @@ -3275,7 +3305,7 @@ - + @@ -3286,7 +3316,7 @@ - + @@ -3297,7 +3327,7 @@ - + @@ -3308,7 +3338,7 @@ - + @@ -3319,7 +3349,7 @@ - + @@ -3330,7 +3360,7 @@ - + @@ -3341,7 +3371,7 @@ - + @@ -3352,7 +3382,7 @@ - + @@ -3363,7 +3393,7 @@ - + @@ -3374,7 +3404,7 @@ - + @@ -3385,7 +3415,7 @@ - + @@ -3396,7 +3426,7 @@ - + @@ -3407,7 +3437,7 @@ - + @@ -3418,7 +3448,7 @@ - + @@ -3429,7 +3459,7 @@ - + @@ -3440,7 +3470,7 @@ - + @@ -3451,7 +3481,7 @@ - + @@ -3462,7 +3492,7 @@ - + @@ -3473,7 +3503,7 @@ - + @@ -3484,7 +3514,7 @@ - + @@ -3495,7 +3525,7 @@ - + @@ -3506,7 +3536,7 @@ - + @@ -3517,7 +3547,7 @@ - + @@ -3528,7 +3558,7 @@ - + @@ -3539,7 +3569,7 @@ - + @@ -3550,7 +3580,7 @@ - + @@ -3561,7 +3591,7 @@ - + @@ -3572,7 +3602,7 @@ - + @@ -3583,7 +3613,7 @@ - + @@ -3594,7 +3624,7 @@ - + @@ -3605,7 +3635,7 @@ - + @@ -3616,7 +3646,7 @@ - + @@ -3627,7 +3657,7 @@ - + @@ -3638,7 +3668,7 @@ - + @@ -3649,7 +3679,7 @@ - + @@ -3660,7 +3690,7 @@ - + @@ -3671,7 +3701,7 @@ - + @@ -3682,7 +3712,7 @@ - + @@ -3693,7 +3723,7 @@ - + @@ -3704,7 +3734,7 @@ - + @@ -3715,7 +3745,7 @@ - + @@ -3726,7 +3756,7 @@ - + @@ -3737,7 +3767,7 @@ - + @@ -3748,7 +3778,7 @@ - + @@ -3759,7 +3789,7 @@ - + @@ -3770,7 +3800,7 @@ - + @@ -3781,7 +3811,7 @@ - + @@ -3792,7 +3822,7 @@ - + @@ -3803,7 +3833,7 @@ - + @@ -3814,7 +3844,7 @@ - + @@ -3825,7 +3855,7 @@ - + @@ -3836,7 +3866,7 @@ - + @@ -3847,7 +3877,7 @@ - + @@ -3858,7 +3888,7 @@ - + @@ -3869,7 +3899,7 @@ - + @@ -3880,7 +3910,7 @@ - + @@ -3891,7 +3921,7 @@ - + @@ -3902,7 +3932,7 @@ - + @@ -3913,7 +3943,7 @@ - + @@ -3924,7 +3954,7 @@ - + @@ -3935,7 +3965,7 @@ - + @@ -3946,7 +3976,7 @@ - + @@ -3957,7 +3987,7 @@ - + @@ -3968,7 +3998,7 @@ - + @@ -3979,7 +4009,7 @@ - + @@ -3990,7 +4020,7 @@ - + @@ -4001,7 +4031,7 @@ - + @@ -4012,7 +4042,7 @@ - + @@ -4023,7 +4053,7 @@ - + @@ -4034,7 +4064,7 @@ - + @@ -4045,7 +4075,7 @@ - + @@ -4056,7 +4086,7 @@ - + @@ -4067,7 +4097,7 @@ - + @@ -4078,7 +4108,7 @@ - + @@ -4089,7 +4119,7 @@ - + @@ -4100,7 +4130,7 @@ - + @@ -4111,7 +4141,7 @@ - + @@ -4122,7 +4152,7 @@ - + @@ -4133,7 +4163,7 @@ - + @@ -4144,7 +4174,7 @@ - + @@ -4155,7 +4185,7 @@ - + @@ -4166,7 +4196,7 @@ - + @@ -4177,7 +4207,7 @@ - + @@ -4188,7 +4218,7 @@ - + @@ -4199,7 +4229,7 @@ - + @@ -4210,7 +4240,7 @@ - + @@ -4221,7 +4251,7 @@ - + @@ -4232,7 +4262,7 @@ - + @@ -4243,7 +4273,7 @@ - + @@ -4254,7 +4284,7 @@ - + @@ -4265,7 +4295,7 @@ - + @@ -4276,7 +4306,7 @@ - + @@ -4287,7 +4317,7 @@ - + @@ -4298,7 +4328,7 @@ - + @@ -4309,7 +4339,7 @@ - + @@ -4320,7 +4350,7 @@ - + @@ -4331,7 +4361,7 @@ - + @@ -4342,7 +4372,7 @@ - + @@ -4353,7 +4383,7 @@ - + @@ -4364,7 +4394,7 @@ - + @@ -4375,7 +4405,7 @@ - + @@ -4386,7 +4416,7 @@ - + @@ -4397,7 +4427,7 @@ - + @@ -4408,7 +4438,7 @@ - + @@ -4419,7 +4449,7 @@ - + @@ -4430,7 +4460,7 @@ - + @@ -4441,7 +4471,7 @@ - + @@ -4452,7 +4482,7 @@ - + @@ -4463,7 +4493,7 @@ - + @@ -4474,7 +4504,7 @@ - + @@ -4485,7 +4515,7 @@ - + @@ -4496,7 +4526,7 @@ - + @@ -4507,7 +4537,7 @@ - + @@ -4518,7 +4548,7 @@ - + @@ -4529,7 +4559,7 @@ - + @@ -4540,7 +4570,7 @@ - + @@ -4551,7 +4581,7 @@ - + @@ -4562,7 +4592,7 @@ - + @@ -4573,7 +4603,7 @@ - + @@ -4584,7 +4614,7 @@ - + @@ -4595,7 +4625,7 @@ - + @@ -4606,7 +4636,7 @@ - + @@ -4617,7 +4647,7 @@ - + @@ -4628,7 +4658,7 @@ - + @@ -4639,7 +4669,7 @@ - + @@ -4650,7 +4680,7 @@ - + @@ -4661,7 +4691,7 @@ - + @@ -4672,7 +4702,7 @@ - + @@ -4683,7 +4713,7 @@ - + @@ -4694,7 +4724,7 @@ - + @@ -4705,7 +4735,7 @@ - + @@ -4716,7 +4746,7 @@ - + @@ -4727,7 +4757,7 @@ - + @@ -4738,7 +4768,7 @@ - + @@ -4749,7 +4779,7 @@ - + @@ -4760,7 +4790,7 @@ - + @@ -4771,7 +4801,7 @@ - + @@ -4782,7 +4812,7 @@ - + @@ -4793,7 +4823,7 @@ - + @@ -4804,7 +4834,7 @@ - + @@ -4815,7 +4845,7 @@ - + @@ -4826,7 +4856,7 @@ - + @@ -4837,7 +4867,7 @@ - + @@ -4848,7 +4878,7 @@ - + @@ -4859,7 +4889,7 @@ - + @@ -4870,7 +4900,7 @@ - + @@ -4881,7 +4911,7 @@ - + @@ -4892,7 +4922,7 @@ - + @@ -4903,7 +4933,7 @@ - + @@ -4914,7 +4944,7 @@ - + @@ -4925,7 +4955,7 @@ - + @@ -4936,7 +4966,7 @@ - + @@ -4947,7 +4977,7 @@ - + @@ -4958,7 +4988,7 @@ - + @@ -4969,7 +4999,7 @@ - + @@ -4980,7 +5010,7 @@ - + @@ -4991,7 +5021,7 @@ - + @@ -5002,7 +5032,7 @@ - + @@ -5013,7 +5043,7 @@ - + @@ -5024,7 +5054,7 @@ - + @@ -5035,7 +5065,7 @@ - + @@ -5046,7 +5076,7 @@ - + @@ -5057,7 +5087,7 @@ - + @@ -5068,7 +5098,7 @@ - + @@ -5079,7 +5109,7 @@ - + @@ -5090,7 +5120,7 @@ - + @@ -5101,7 +5131,7 @@ - + @@ -5112,7 +5142,7 @@ - + @@ -5123,7 +5153,7 @@ - + @@ -5134,7 +5164,7 @@ - + @@ -5145,7 +5175,7 @@ - + @@ -5156,7 +5186,7 @@ - + @@ -5167,7 +5197,7 @@ - + @@ -5178,7 +5208,7 @@ - + @@ -5189,7 +5219,7 @@ - + @@ -5200,7 +5230,7 @@ - + @@ -5211,7 +5241,7 @@ - + @@ -5222,7 +5252,7 @@ - + @@ -5233,7 +5263,7 @@ - + @@ -5244,7 +5274,7 @@ - + @@ -5255,7 +5285,7 @@ - + @@ -5266,7 +5296,7 @@ - + @@ -5277,7 +5307,7 @@ - + @@ -5288,7 +5318,7 @@ - + @@ -5299,7 +5329,7 @@ - + @@ -5310,7 +5340,7 @@ - + @@ -5321,7 +5351,7 @@ - + @@ -5332,7 +5362,7 @@ - + @@ -5343,7 +5373,7 @@ - + @@ -5354,7 +5384,7 @@ - + @@ -5365,7 +5395,7 @@ - + @@ -5376,7 +5406,7 @@ - + @@ -5387,7 +5417,7 @@ - + @@ -5398,7 +5428,7 @@ - + @@ -5409,7 +5439,7 @@ - + @@ -5420,7 +5450,7 @@ - + @@ -5431,7 +5461,7 @@ - + @@ -5442,7 +5472,7 @@ - + @@ -5453,7 +5483,7 @@ - + @@ -5464,7 +5494,7 @@ - + @@ -5475,7 +5505,7 @@ - + @@ -5486,7 +5516,7 @@ - + @@ -5497,7 +5527,7 @@ - + @@ -5508,7 +5538,7 @@ - + @@ -5519,7 +5549,7 @@ - + @@ -5530,7 +5560,7 @@ - + @@ -5541,7 +5571,7 @@ - + @@ -5552,7 +5582,7 @@ - + @@ -5563,7 +5593,7 @@ - + @@ -5574,7 +5604,7 @@ - + @@ -5585,7 +5615,7 @@ - + @@ -5596,7 +5626,7 @@ - + @@ -5607,7 +5637,7 @@ - + @@ -5618,7 +5648,7 @@ - + @@ -5629,7 +5659,7 @@ - + @@ -5640,7 +5670,7 @@ - + @@ -5651,7 +5681,7 @@ - + @@ -5662,7 +5692,7 @@ - + @@ -5673,7 +5703,7 @@ - + @@ -5684,7 +5714,7 @@ - + @@ -5695,7 +5725,7 @@ - + @@ -5706,7 +5736,7 @@ - + @@ -5717,7 +5747,7 @@ - + @@ -5728,7 +5758,7 @@ - + @@ -5739,7 +5769,7 @@ - + @@ -5750,7 +5780,7 @@ - + @@ -5761,7 +5791,7 @@ - + @@ -5772,7 +5802,7 @@ - + @@ -5783,7 +5813,7 @@ - + @@ -5794,7 +5824,7 @@ - + @@ -5805,7 +5835,7 @@ - + @@ -5816,7 +5846,7 @@ - + @@ -5827,7 +5857,7 @@ - + @@ -5838,7 +5868,7 @@ - + @@ -5849,7 +5879,7 @@ - + @@ -5860,7 +5890,7 @@ - + @@ -5871,7 +5901,7 @@ - + @@ -5882,7 +5912,7 @@ - + @@ -5893,7 +5923,7 @@ - + @@ -5904,7 +5934,7 @@ - + @@ -5915,7 +5945,7 @@ - + @@ -5926,7 +5956,7 @@ - + @@ -5937,7 +5967,7 @@ - + @@ -5948,7 +5978,7 @@ - + @@ -5959,7 +5989,7 @@ - + @@ -5970,7 +6000,7 @@ - + @@ -5981,7 +6011,7 @@ - + @@ -5992,7 +6022,7 @@ - + @@ -6003,7 +6033,7 @@ - + @@ -6014,7 +6044,7 @@ - + @@ -6025,7 +6055,7 @@ - + @@ -6036,7 +6066,7 @@ - + @@ -6047,7 +6077,7 @@ - + @@ -6058,7 +6088,7 @@ - + @@ -6069,7 +6099,7 @@ - + @@ -6080,7 +6110,7 @@ - + @@ -6091,7 +6121,7 @@ - + @@ -6102,7 +6132,7 @@ - + @@ -6113,7 +6143,7 @@ - + @@ -6124,7 +6154,7 @@ - + @@ -6135,7 +6165,7 @@ - + @@ -6146,7 +6176,7 @@ - + @@ -6157,7 +6187,7 @@ - + @@ -6168,7 +6198,7 @@ - + @@ -6179,7 +6209,7 @@ - + @@ -6190,7 +6220,7 @@ - + @@ -6201,7 +6231,7 @@ - + @@ -6212,7 +6242,7 @@ - + @@ -6223,7 +6253,7 @@ - + @@ -6234,7 +6264,7 @@ - + @@ -6245,7 +6275,7 @@ - + @@ -6256,7 +6286,7 @@ - + @@ -6267,7 +6297,7 @@ - + @@ -6278,7 +6308,7 @@ - + @@ -6289,7 +6319,7 @@ - + @@ -6300,7 +6330,7 @@ - + @@ -6311,7 +6341,7 @@ - + @@ -6322,7 +6352,7 @@ - + @@ -6333,7 +6363,7 @@ - + @@ -6344,7 +6374,7 @@ - + @@ -6355,7 +6385,7 @@ - + @@ -6366,7 +6396,7 @@ - + @@ -6377,7 +6407,7 @@ - + @@ -6388,7 +6418,7 @@ - + @@ -6399,7 +6429,7 @@ - + @@ -6410,7 +6440,7 @@ - + @@ -6421,7 +6451,7 @@ - + @@ -6432,7 +6462,7 @@ - + @@ -6443,7 +6473,7 @@ - + @@ -6454,7 +6484,7 @@ - + @@ -6465,7 +6495,7 @@ - + @@ -6476,7 +6506,7 @@ - + @@ -6487,7 +6517,7 @@ - + @@ -6498,7 +6528,7 @@ - + @@ -6509,7 +6539,7 @@ - + @@ -6520,7 +6550,7 @@ - + @@ -6531,7 +6561,7 @@ - + @@ -6542,7 +6572,7 @@ - + @@ -6553,7 +6583,7 @@ - + @@ -6564,7 +6594,7 @@ - + @@ -6575,7 +6605,7 @@ - + @@ -6586,7 +6616,7 @@ - + @@ -6597,7 +6627,7 @@ - + @@ -6608,7 +6638,7 @@ - + @@ -6619,7 +6649,7 @@ - + @@ -6630,7 +6660,7 @@ - + @@ -6641,7 +6671,7 @@ - + @@ -6652,7 +6682,7 @@ - + @@ -6663,7 +6693,7 @@ - + @@ -6674,7 +6704,7 @@ - + @@ -6685,7 +6715,7 @@ - + @@ -6696,7 +6726,7 @@ - + @@ -6707,7 +6737,7 @@ - + @@ -6718,7 +6748,7 @@ - + @@ -6729,7 +6759,7 @@ - + @@ -6740,7 +6770,7 @@ - + @@ -6751,7 +6781,7 @@ - + @@ -6762,7 +6792,7 @@ - + @@ -6773,7 +6803,7 @@ - + @@ -6784,7 +6814,7 @@ - + @@ -6795,7 +6825,7 @@ - + @@ -6806,7 +6836,7 @@ - + @@ -6817,7 +6847,7 @@ - + @@ -6828,7 +6858,7 @@ - + @@ -6839,7 +6869,7 @@ - + @@ -6850,7 +6880,7 @@ - + @@ -6861,7 +6891,7 @@ - + @@ -6872,7 +6902,7 @@ - + @@ -6883,7 +6913,7 @@ - + @@ -6894,7 +6924,7 @@ - + @@ -6905,7 +6935,7 @@ - + @@ -6916,7 +6946,7 @@ - + @@ -6927,7 +6957,7 @@ - + @@ -6938,7 +6968,7 @@ - + @@ -6949,7 +6979,7 @@ - + @@ -6960,7 +6990,7 @@ - + @@ -6971,7 +7001,7 @@ - + @@ -6982,7 +7012,7 @@ - + @@ -6993,7 +7023,7 @@ - + @@ -7004,7 +7034,7 @@ - + @@ -7015,7 +7045,7 @@ - + @@ -7026,7 +7056,7 @@ - + @@ -7037,7 +7067,7 @@ - + @@ -7048,7 +7078,7 @@ - + @@ -7059,7 +7089,7 @@ - + @@ -7070,7 +7100,7 @@ - + @@ -7081,7 +7111,7 @@ - + @@ -7092,7 +7122,7 @@ - + @@ -7103,7 +7133,7 @@ - + @@ -7114,7 +7144,7 @@ - + @@ -7125,7 +7155,7 @@ - + @@ -7136,7 +7166,7 @@ - + @@ -7147,7 +7177,7 @@ - + @@ -7158,7 +7188,7 @@ - + @@ -7169,7 +7199,7 @@ - + @@ -7180,7 +7210,7 @@ - + @@ -7191,7 +7221,7 @@ - + @@ -7202,7 +7232,7 @@ - + @@ -7213,7 +7243,7 @@ - + @@ -7224,7 +7254,7 @@ - + @@ -7235,7 +7265,7 @@ - + @@ -7246,7 +7276,7 @@ - + @@ -7257,7 +7287,7 @@ - + @@ -7268,7 +7298,7 @@ - + @@ -7279,7 +7309,7 @@ - + @@ -7290,7 +7320,7 @@ - + @@ -7301,7 +7331,7 @@ - + @@ -7312,7 +7342,7 @@ - + @@ -7323,7 +7353,7 @@ - + @@ -7334,7 +7364,7 @@ - + @@ -7345,7 +7375,7 @@ - + @@ -7356,7 +7386,7 @@ - + @@ -7367,7 +7397,7 @@ - + @@ -7378,7 +7408,7 @@ - + @@ -7389,7 +7419,7 @@ - + @@ -7400,7 +7430,7 @@ - + @@ -7411,7 +7441,7 @@ - + @@ -7422,7 +7452,7 @@ - + @@ -7433,7 +7463,7 @@ - + @@ -7444,7 +7474,7 @@ - + @@ -7455,7 +7485,7 @@ - + @@ -7466,7 +7496,7 @@ - + @@ -7477,7 +7507,7 @@ - + @@ -7488,7 +7518,7 @@ - + @@ -7499,7 +7529,7 @@ - + @@ -7510,7 +7540,7 @@ - + @@ -7521,7 +7551,7 @@ - + @@ -7532,7 +7562,7 @@ - + @@ -7543,7 +7573,7 @@ - + @@ -7554,7 +7584,7 @@ - + @@ -7565,7 +7595,7 @@ - + @@ -7576,7 +7606,7 @@ - + @@ -7587,7 +7617,7 @@ - + @@ -7598,7 +7628,7 @@ - + @@ -7609,7 +7639,7 @@ - + @@ -7620,7 +7650,7 @@ - + @@ -7631,7 +7661,7 @@ - + @@ -7642,7 +7672,7 @@ - + @@ -7653,7 +7683,7 @@ - + @@ -7664,7 +7694,7 @@ - + @@ -7675,7 +7705,7 @@ - + @@ -7686,7 +7716,7 @@ - + @@ -7697,7 +7727,7 @@ - + @@ -7708,7 +7738,7 @@ - + @@ -7719,7 +7749,7 @@ - + @@ -7730,7 +7760,7 @@ - + @@ -7741,7 +7771,7 @@ - + @@ -7752,7 +7782,7 @@ - + @@ -7763,7 +7793,7 @@ - + @@ -7774,7 +7804,7 @@ - + @@ -7785,7 +7815,7 @@ - + @@ -7796,7 +7826,7 @@ - + @@ -7807,7 +7837,7 @@ - + @@ -7818,7 +7848,7 @@ - + @@ -7829,7 +7859,7 @@ - + @@ -7840,7 +7870,7 @@ - + @@ -7851,7 +7881,7 @@ - + @@ -7862,7 +7892,7 @@ - + @@ -7873,7 +7903,7 @@ - + @@ -7884,7 +7914,7 @@ - + @@ -7895,7 +7925,7 @@ - + @@ -7906,7 +7936,7 @@ - + @@ -7917,7 +7947,7 @@ - + @@ -7928,7 +7958,7 @@ - + @@ -7939,7 +7969,7 @@ - + @@ -7950,7 +7980,7 @@ - + @@ -7961,7 +7991,7 @@ - + @@ -7972,7 +8002,7 @@ - + @@ -7983,7 +8013,7 @@ - + @@ -7994,7 +8024,7 @@ - + @@ -8005,7 +8035,7 @@ - + @@ -8016,7 +8046,7 @@ - + @@ -8027,7 +8057,7 @@ - + @@ -8038,7 +8068,7 @@ - + @@ -8049,7 +8079,7 @@ - + @@ -8060,7 +8090,7 @@ - + @@ -8071,7 +8101,7 @@ - + @@ -8082,7 +8112,7 @@ - + @@ -8093,7 +8123,7 @@ - + @@ -8104,7 +8134,7 @@ - + @@ -8115,7 +8145,7 @@ - + @@ -8126,7 +8156,7 @@ - + @@ -8137,7 +8167,7 @@ - + @@ -8148,7 +8178,7 @@ - + @@ -8159,7 +8189,7 @@ - + @@ -8170,7 +8200,7 @@ - + @@ -8181,7 +8211,7 @@ - + @@ -8192,7 +8222,7 @@ - + @@ -8203,7 +8233,7 @@ - + @@ -8214,7 +8244,7 @@ - + @@ -8225,7 +8255,7 @@ - + @@ -8236,7 +8266,7 @@ - + @@ -8247,7 +8277,7 @@ - + @@ -8258,7 +8288,7 @@ - + @@ -8269,7 +8299,7 @@ - + @@ -8280,7 +8310,7 @@ - + @@ -8291,7 +8321,7 @@ - + @@ -8302,7 +8332,7 @@ - + @@ -8313,7 +8343,7 @@ - + @@ -8324,7 +8354,7 @@ - + @@ -8335,7 +8365,7 @@ - + @@ -8346,7 +8376,7 @@ - + @@ -8357,7 +8387,7 @@ - + @@ -8368,7 +8398,7 @@ - + @@ -8379,7 +8409,7 @@ - + @@ -8390,7 +8420,7 @@ - + @@ -8401,7 +8431,7 @@ - + @@ -8412,7 +8442,7 @@ - + @@ -8423,7 +8453,7 @@ - + @@ -8434,7 +8464,7 @@ - + @@ -8445,7 +8475,7 @@ - + @@ -8456,7 +8486,7 @@ - + @@ -8467,7 +8497,7 @@ - + @@ -8478,7 +8508,7 @@ - + @@ -8489,7 +8519,7 @@ - + @@ -8500,7 +8530,7 @@ - + @@ -8511,7 +8541,7 @@ - + @@ -8522,7 +8552,7 @@ - + @@ -8533,7 +8563,7 @@ - + @@ -8544,7 +8574,7 @@ - + @@ -8555,7 +8585,7 @@ - + @@ -8566,7 +8596,7 @@ - + @@ -8577,7 +8607,7 @@ - + @@ -8588,7 +8618,7 @@ - + @@ -8599,7 +8629,7 @@ - + @@ -8610,7 +8640,7 @@ - + @@ -8621,7 +8651,7 @@ - + @@ -8632,7 +8662,7 @@ - + @@ -8643,7 +8673,7 @@ - + @@ -8654,7 +8684,7 @@ - + @@ -8665,7 +8695,7 @@ - + @@ -8676,7 +8706,7 @@ - + @@ -8687,7 +8717,7 @@ - + @@ -8698,7 +8728,7 @@ - + @@ -8709,7 +8739,7 @@ - + @@ -8720,7 +8750,7 @@ - + @@ -8731,7 +8761,7 @@ - + @@ -8742,7 +8772,7 @@ - + @@ -8753,7 +8783,7 @@ - + @@ -8764,7 +8794,7 @@ - + @@ -8775,7 +8805,7 @@ - + @@ -8786,7 +8816,7 @@ - + @@ -8797,7 +8827,7 @@ - + @@ -8808,7 +8838,7 @@ - + @@ -8819,7 +8849,7 @@ - + @@ -8830,7 +8860,7 @@ - + @@ -8841,7 +8871,7 @@ - + @@ -8852,7 +8882,7 @@ - + @@ -8863,7 +8893,7 @@ - + @@ -8874,7 +8904,7 @@ - + @@ -8885,7 +8915,7 @@ - + @@ -8896,7 +8926,7 @@ - + @@ -8907,7 +8937,7 @@ - + @@ -8918,7 +8948,7 @@ - + @@ -8929,7 +8959,7 @@ - + @@ -8940,7 +8970,7 @@ - + @@ -8951,7 +8981,7 @@ - + @@ -8962,7 +8992,7 @@ - + @@ -8973,7 +9003,7 @@ - + @@ -8984,7 +9014,7 @@ - + @@ -8995,7 +9025,7 @@ - + @@ -9006,7 +9036,7 @@ - + @@ -9017,7 +9047,7 @@ - + @@ -9028,7 +9058,7 @@ - + @@ -9039,7 +9069,7 @@ - + @@ -9050,7 +9080,7 @@ - + @@ -9061,7 +9091,7 @@ - + @@ -9072,7 +9102,7 @@ - + @@ -9083,7 +9113,7 @@ - + @@ -9094,7 +9124,7 @@ - + @@ -9105,7 +9135,7 @@ - + @@ -9116,7 +9146,7 @@ - + @@ -9127,7 +9157,7 @@ - + @@ -9138,7 +9168,7 @@ - + @@ -9149,7 +9179,7 @@ - + @@ -9160,7 +9190,7 @@ - + @@ -9171,7 +9201,7 @@ - + @@ -9182,7 +9212,7 @@ - + @@ -9193,7 +9223,7 @@ - + @@ -9204,7 +9234,7 @@ - + @@ -9215,7 +9245,7 @@ - + @@ -9226,7 +9256,7 @@ - + @@ -9237,7 +9267,7 @@ - + @@ -9248,7 +9278,7 @@ - + @@ -9259,7 +9289,7 @@ - + @@ -9270,7 +9300,7 @@ - + @@ -9281,7 +9311,7 @@ - + @@ -9292,7 +9322,7 @@ - + @@ -9303,7 +9333,7 @@ - + @@ -9314,7 +9344,7 @@ - + @@ -9325,7 +9355,7 @@ - + @@ -9336,7 +9366,7 @@ - + @@ -9347,7 +9377,7 @@ - + @@ -9358,7 +9388,7 @@ - + @@ -9369,7 +9399,7 @@ - + @@ -9380,7 +9410,7 @@ - + @@ -9391,7 +9421,7 @@ - + @@ -9402,7 +9432,7 @@ - + @@ -9413,7 +9443,7 @@ - + @@ -9424,7 +9454,7 @@ - + @@ -9435,7 +9465,7 @@ - + @@ -9446,7 +9476,7 @@ - + @@ -9457,7 +9487,7 @@ - + @@ -9468,7 +9498,7 @@ - + @@ -9479,7 +9509,7 @@ - + @@ -9490,7 +9520,7 @@ - + @@ -9501,7 +9531,7 @@ - + @@ -9512,7 +9542,7 @@ - + @@ -9523,7 +9553,7 @@ - + @@ -9534,7 +9564,7 @@ - + @@ -9545,7 +9575,7 @@ - + @@ -9556,7 +9586,7 @@ - + @@ -9567,7 +9597,7 @@ - + @@ -9578,7 +9608,7 @@ - + @@ -9589,7 +9619,7 @@ - + @@ -9600,7 +9630,7 @@ - + @@ -9611,7 +9641,7 @@ - + @@ -9622,7 +9652,7 @@ - + @@ -9633,7 +9663,7 @@ - + @@ -9644,7 +9674,7 @@ - + @@ -9655,7 +9685,7 @@ - + @@ -9666,7 +9696,7 @@ - + @@ -9677,7 +9707,7 @@ - + @@ -9688,7 +9718,7 @@ - + @@ -9699,7 +9729,7 @@ - + @@ -9710,7 +9740,7 @@ - + @@ -9721,7 +9751,7 @@ - + @@ -9732,7 +9762,7 @@ - + @@ -9743,7 +9773,7 @@ - + @@ -9754,7 +9784,7 @@ - + @@ -9765,7 +9795,7 @@ - + @@ -9776,7 +9806,7 @@ - + @@ -9787,7 +9817,7 @@ - + @@ -9798,7 +9828,7 @@ - + @@ -9809,7 +9839,7 @@ - + @@ -9820,7 +9850,7 @@ - + @@ -9831,7 +9861,7 @@ - + @@ -9842,7 +9872,7 @@ - + @@ -9853,7 +9883,7 @@ - + @@ -9864,7 +9894,7 @@ - + @@ -9875,7 +9905,7 @@ - + @@ -9886,7 +9916,7 @@ - + @@ -9897,7 +9927,7 @@ - + @@ -9908,7 +9938,7 @@ - + @@ -9919,7 +9949,7 @@ - + @@ -9930,7 +9960,7 @@ - + @@ -9941,7 +9971,7 @@ - + @@ -9952,7 +9982,7 @@ - + @@ -9963,7 +9993,7 @@ - + @@ -9974,7 +10004,7 @@ - + @@ -9985,7 +10015,7 @@ - + @@ -9996,7 +10026,7 @@ - + @@ -10007,7 +10037,7 @@ - + @@ -10018,7 +10048,7 @@ - + @@ -10029,7 +10059,7 @@ - + @@ -10040,7 +10070,7 @@ - + @@ -10051,7 +10081,7 @@ - + @@ -10062,7 +10092,7 @@ - + @@ -10073,7 +10103,7 @@ - + @@ -10084,7 +10114,7 @@ - + @@ -10095,7 +10125,7 @@ - + @@ -10106,7 +10136,7 @@ - + @@ -10117,7 +10147,7 @@ - + @@ -10128,7 +10158,7 @@ - + @@ -10139,7 +10169,7 @@ - + @@ -10150,7 +10180,7 @@ - + @@ -10161,7 +10191,7 @@ - + @@ -10172,7 +10202,7 @@ - + @@ -10183,7 +10213,7 @@ - + @@ -10194,7 +10224,7 @@ - + @@ -10205,7 +10235,7 @@ - + @@ -10216,7 +10246,7 @@ - + @@ -10227,7 +10257,7 @@ - + @@ -10238,7 +10268,7 @@ - + @@ -10249,7 +10279,7 @@ - + @@ -10260,7 +10290,7 @@ - + @@ -10271,7 +10301,7 @@ - + @@ -10282,7 +10312,7 @@ - + @@ -10293,7 +10323,7 @@ - + @@ -10304,7 +10334,7 @@ - + @@ -10315,7 +10345,7 @@ - + @@ -10326,7 +10356,7 @@ - + @@ -10337,7 +10367,7 @@ - + @@ -10348,7 +10378,7 @@ - + @@ -10359,7 +10389,7 @@ - + @@ -10370,7 +10400,7 @@ - + @@ -10381,7 +10411,7 @@ - + @@ -10392,7 +10422,7 @@ - + @@ -10403,7 +10433,7 @@ - + @@ -10414,7 +10444,7 @@ - + @@ -10425,7 +10455,7 @@ - + @@ -10436,7 +10466,7 @@ - + @@ -10447,7 +10477,7 @@ - + @@ -10458,7 +10488,7 @@ - + @@ -10469,7 +10499,7 @@ - + @@ -10480,7 +10510,7 @@ - + @@ -10491,7 +10521,7 @@ - + @@ -10502,7 +10532,7 @@ - + @@ -10513,7 +10543,7 @@ - + @@ -10524,7 +10554,7 @@ - + @@ -10535,7 +10565,7 @@ - + @@ -10546,7 +10576,7 @@ - + @@ -10557,7 +10587,7 @@ - + @@ -10568,7 +10598,7 @@ - + @@ -10579,7 +10609,7 @@ - + @@ -10590,7 +10620,7 @@ - + @@ -10601,7 +10631,7 @@ - + @@ -10612,7 +10642,7 @@ - + @@ -10623,7 +10653,7 @@ - + @@ -10634,7 +10664,7 @@ - + @@ -10645,7 +10675,7 @@ - + @@ -10656,7 +10686,7 @@ - + @@ -10667,7 +10697,7 @@ - + @@ -10678,7 +10708,7 @@ - + @@ -10689,7 +10719,7 @@ - + @@ -10700,7 +10730,7 @@ - + @@ -10711,7 +10741,7 @@ - + @@ -10722,7 +10752,7 @@ - + @@ -10733,7 +10763,7 @@ - + @@ -10744,7 +10774,7 @@ - + @@ -10755,7 +10785,7 @@ - + @@ -10766,7 +10796,7 @@ - + @@ -10777,7 +10807,7 @@ - + @@ -10788,7 +10818,7 @@ - + @@ -10799,7 +10829,7 @@ - + @@ -10810,7 +10840,7 @@ - + @@ -10821,7 +10851,7 @@ - + @@ -10832,7 +10862,7 @@ - + @@ -10843,7 +10873,7 @@ - + @@ -10854,7 +10884,7 @@ - + @@ -10865,7 +10895,7 @@ - + @@ -10876,7 +10906,7 @@ - + @@ -10887,7 +10917,7 @@ - + @@ -10898,7 +10928,7 @@ - + @@ -10909,7 +10939,7 @@ - + @@ -10920,7 +10950,7 @@ - + @@ -10931,7 +10961,7 @@ - + @@ -10942,7 +10972,7 @@ - + @@ -10953,7 +10983,7 @@ - + @@ -10964,7 +10994,7 @@ - + @@ -10975,7 +11005,7 @@ - + @@ -10986,7 +11016,7 @@ - + @@ -10997,7 +11027,7 @@ - + @@ -11008,7 +11038,7 @@ - + @@ -11019,7 +11049,7 @@ - + @@ -11030,7 +11060,7 @@ - + @@ -11041,7 +11071,7 @@ - + @@ -11052,7 +11082,7 @@ - + @@ -11063,7 +11093,7 @@ - + @@ -11074,7 +11104,7 @@ - + @@ -11085,7 +11115,7 @@ - + @@ -11096,7 +11126,7 @@ - + @@ -11107,7 +11137,7 @@ - + @@ -11118,7 +11148,7 @@ - + @@ -11129,7 +11159,7 @@ - + @@ -11140,7 +11170,7 @@ - + @@ -11151,7 +11181,7 @@ - + @@ -11162,7 +11192,7 @@ - + @@ -11173,7 +11203,7 @@ - + @@ -11184,7 +11214,7 @@ - + @@ -11195,7 +11225,7 @@ - + @@ -11206,7 +11236,7 @@ - + @@ -11217,7 +11247,7 @@ - + @@ -11228,7 +11258,7 @@ - + @@ -11239,7 +11269,7 @@ - + @@ -11250,7 +11280,7 @@ - + @@ -11261,7 +11291,7 @@ - + @@ -11272,7 +11302,7 @@ - + @@ -11283,7 +11313,7 @@ - + @@ -11294,7 +11324,7 @@ - + @@ -11305,7 +11335,7 @@ - + @@ -11316,7 +11346,7 @@ - + @@ -11327,7 +11357,7 @@ - + @@ -11338,7 +11368,7 @@ - + @@ -11349,7 +11379,7 @@ - + @@ -11360,7 +11390,7 @@ - + @@ -11371,7 +11401,7 @@ - + @@ -11382,7 +11412,7 @@ - + @@ -11393,7 +11423,7 @@ - + @@ -11404,7 +11434,7 @@ - + @@ -11415,7 +11445,7 @@ - + @@ -11426,7 +11456,7 @@ - + @@ -11437,7 +11467,7 @@ - + @@ -11448,7 +11478,7 @@ - + @@ -11459,7 +11489,7 @@ - + @@ -11470,7 +11500,7 @@ - + @@ -11481,7 +11511,7 @@ - + @@ -11492,7 +11522,7 @@ - + @@ -11503,7 +11533,7 @@ - + @@ -11514,7 +11544,7 @@ - + @@ -11525,7 +11555,7 @@ - + @@ -11536,7 +11566,7 @@ - + @@ -11547,7 +11577,7 @@ - + @@ -11558,7 +11588,7 @@ - + @@ -11569,7 +11599,7 @@ - + @@ -11580,7 +11610,7 @@ - + @@ -11591,7 +11621,7 @@ - + @@ -11602,7 +11632,7 @@ - + @@ -11613,7 +11643,7 @@ - + @@ -11624,7 +11654,7 @@ - + @@ -11635,7 +11665,7 @@ - + @@ -11646,7 +11676,7 @@ - + @@ -11657,7 +11687,7 @@ - + @@ -11668,7 +11698,7 @@ - + @@ -11679,7 +11709,7 @@ - + @@ -11690,7 +11720,7 @@ - + @@ -11701,7 +11731,7 @@ - + @@ -11712,7 +11742,7 @@ - + @@ -11723,7 +11753,7 @@ - + @@ -11734,7 +11764,7 @@ - + @@ -11745,7 +11775,7 @@ - + @@ -11756,7 +11786,7 @@ - + @@ -11767,7 +11797,7 @@ - + @@ -11778,7 +11808,7 @@ - + @@ -11789,7 +11819,7 @@ - + @@ -11800,7 +11830,7 @@ - + @@ -11811,7 +11841,7 @@ - + @@ -11822,7 +11852,7 @@ - + @@ -11833,7 +11863,7 @@ - + @@ -11844,7 +11874,7 @@ - + @@ -11855,7 +11885,7 @@ - + @@ -11866,7 +11896,7 @@ - + @@ -11877,7 +11907,7 @@ - + @@ -11888,7 +11918,7 @@ - + @@ -11899,7 +11929,7 @@ - + @@ -11910,7 +11940,7 @@ - + @@ -11921,7 +11951,7 @@ - + @@ -11932,7 +11962,7 @@ - + @@ -11943,7 +11973,7 @@ - + @@ -11954,7 +11984,7 @@ - + @@ -11965,7 +11995,7 @@ - + @@ -11976,7 +12006,7 @@ - + @@ -11987,7 +12017,7 @@ - + @@ -11998,7 +12028,7 @@ - + @@ -12009,7 +12039,7 @@ - + @@ -12020,7 +12050,7 @@ - + @@ -12031,7 +12061,7 @@ - + @@ -12042,7 +12072,7 @@ - + @@ -12053,7 +12083,7 @@ - + @@ -12064,7 +12094,7 @@ - + @@ -12075,7 +12105,7 @@ - + @@ -12086,7 +12116,7 @@ - + @@ -12097,7 +12127,7 @@ - + @@ -12108,7 +12138,7 @@ - + @@ -12119,7 +12149,7 @@ - + @@ -12130,7 +12160,7 @@ - + @@ -12141,7 +12171,7 @@ - + @@ -12152,7 +12182,7 @@ - + @@ -12163,7 +12193,7 @@ - + @@ -12174,7 +12204,7 @@ - + @@ -12185,7 +12215,7 @@ - + @@ -12196,7 +12226,7 @@ - + @@ -12207,7 +12237,7 @@ - + @@ -12218,7 +12248,7 @@ - + @@ -12229,7 +12259,7 @@ - + @@ -12240,7 +12270,7 @@ - + @@ -12251,7 +12281,7 @@ - + @@ -12262,7 +12292,7 @@ - + @@ -12273,7 +12303,7 @@ - + @@ -12284,7 +12314,7 @@ - + @@ -12295,7 +12325,7 @@ - + @@ -12306,7 +12336,7 @@ - + @@ -12317,7 +12347,7 @@ - + @@ -12328,7 +12358,7 @@ - + @@ -12339,7 +12369,7 @@ - + @@ -12350,7 +12380,7 @@ - + @@ -12361,7 +12391,7 @@ - + @@ -12372,7 +12402,7 @@ - + @@ -12383,7 +12413,7 @@ - + @@ -12394,7 +12424,7 @@ - + @@ -12405,7 +12435,7 @@ - + @@ -12416,7 +12446,7 @@ - + @@ -12427,7 +12457,7 @@ - + @@ -12438,7 +12468,7 @@ - + @@ -12449,7 +12479,7 @@ - + @@ -12460,7 +12490,7 @@ - + @@ -12471,7 +12501,7 @@ - + @@ -12482,7 +12512,7 @@ - + @@ -12493,7 +12523,7 @@ - + @@ -12504,7 +12534,7 @@ - + @@ -12515,7 +12545,7 @@ - + @@ -12526,7 +12556,7 @@ - + @@ -12537,7 +12567,7 @@ - + @@ -12548,7 +12578,7 @@ - + @@ -12559,7 +12589,7 @@ - + @@ -12570,7 +12600,7 @@ - + @@ -12581,7 +12611,7 @@ - + @@ -12592,7 +12622,7 @@ - + @@ -12603,7 +12633,7 @@ - + @@ -12614,7 +12644,7 @@ - + @@ -12625,7 +12655,7 @@ - + @@ -12636,7 +12666,7 @@ - + @@ -12647,7 +12677,7 @@ - + @@ -12658,7 +12688,7 @@ - + @@ -12669,7 +12699,7 @@ - + @@ -12680,7 +12710,7 @@ - + @@ -12691,7 +12721,7 @@ - + @@ -12702,7 +12732,7 @@ - + @@ -12713,7 +12743,7 @@ - + @@ -12724,7 +12754,7 @@ - + @@ -12735,7 +12765,7 @@ - + @@ -12746,7 +12776,7 @@ - + @@ -12757,7 +12787,7 @@ - + @@ -12768,7 +12798,7 @@ - + @@ -12779,7 +12809,7 @@ - + @@ -12790,7 +12820,7 @@ - + @@ -12801,7 +12831,7 @@ - + @@ -12812,7 +12842,7 @@ - + @@ -12823,7 +12853,7 @@ - + @@ -12834,7 +12864,7 @@ - + @@ -12845,7 +12875,7 @@ - + @@ -12856,7 +12886,7 @@ - + @@ -12867,7 +12897,7 @@ - + @@ -12878,7 +12908,7 @@ - + @@ -12889,7 +12919,7 @@ - + @@ -12900,7 +12930,7 @@ - + @@ -12911,7 +12941,7 @@ - + @@ -12922,7 +12952,7 @@ - + @@ -12933,7 +12963,7 @@ - + @@ -12944,7 +12974,7 @@ - + @@ -12955,7 +12985,7 @@ - + @@ -12966,7 +12996,7 @@ - + @@ -12980,57 +13010,67 @@
Angola AGO 199434.66 9.09
Angola AGO 199541.86 9.43
Angola AGO 199637.17 8.57
Angola AGO 1997na na
Angola AGO 1998na na
Angola AGO 1999na na
Angola AGO 2000na na
Albania ALB 199487.78 14.42
Albania ALB 199583.34 13.10
Albania ALB 199693.06 10.65
Albania ALB 199792.89 11.02
Albania ALB 199891.21 11.00
Albania ALB 199989.94 11.23
Albania ALB 200085.45 12.70
Argentina ARG 199468.89 17.41
Argentina ARG 199567.44 15.45
Argentina ARG 199668.21 15.75
Argentina ARG 199769.18 17.09
Argentina ARG 199869.39 17.28
Argentina ARG 199969.72 15.27
Argentina ARG 200069.06 14.08
Armenia ARM 199486.35 12.97
Armenia ARM 199592.23 10.88
Armenia ARM 199689.90 10.91
Armenia ARM 199797.20 11.46
Armenia ARM 199895.81 11.00
Armenia ARM 199992.50 9.81
Armenia ARM 200090.67 10.04
Antigua ATG 199441.82 9.89
Antigua ATG 199550.45 17.76
Antigua ATG 199644.11 16.27
Antigua ATG 199738.27 14.72
Antigua ATG 199839.64 14.17
Antigua ATG 199938.56 13.69
Antigua ATG 200034.82 11.85
Australia AUS 199470.54 24.28
Australia AUS 199569.84 23.20
Australia AUS 199669.12 23.65
Australia AUS 199769.38 24.65
Australia AUS 199870.27 25.24
Australia AUS 199970.29 25.27
Australia AUS 200069.55 23.06
Austria AUT 199468.76 25.42
Austria AUT 199568.63 25.73
Austria AUT 199669.75 25.01
Austria AUT 199769.84 25.52
Austria AUT 199869.63 24.80
Austria AUT 199970.04 24.61
Austria AUT 200069.19 25.34
Azerbaijan AZE 199465.70 15.20
Azerbaijan AZE 199577.38 12.11
Azerbaijan AZE 199682.31 16.97
Azerbaijan AZE 199772.32 21.39
Azerbaijan AZE 199876.31 17.56
Azerbaijan AZE 199970.92 13.22
Azerbaijan AZE 200059.13 10.77
Burundi BDI 199488.58 3.15
Burundi BDI 199586.36 3.01
Burundi BDI 199683.64 3.62
Burundi BDI 199780.45 2.37
Burundi BDI 199885.66 3.43
Burundi BDI 199984.03 3.17
Burundi BDI 200087.56 4.18
Belgium BEL 199455.10 22.32
Belgium BEL 199554.24 23.13
Belgium BEL 199654.93 22.53
Belgium BEL 199754.39 23.33
Belgium BEL 199854.71 23.57
Belgium BEL 199954.80 22.94
Belgium BEL 200054.29 23.62
Benin BEN 199489.45 5.35
Benin BEN 199589.33 7.70
Benin BEN 199689.90 7.07
Benin BEN 199792.93 8.06
Benin BEN 199890.98 7.55
Benin BEN 199992.61 7.86
Benin BEN 200092.27 8.25
Burkina Faso BFA 199479.81 6.57
Burkina Faso BFA 199580.41 9.29
Burkina Faso BFA 199680.40 12.12
Burkina Faso BFA 199776.94 14.94
Burkina Faso BFA 199880.66 12.24
Burkina Faso BFA 199979.81 13.14
Burkina Faso BFA 200076.53 14.87
Bangladesh BGD 199484.37 9.56
Bangladesh BGD 199585.13 9.79
Bangladesh BGD 199686.95 10.16
Bangladesh BGD 199784.85 10.73
Bangladesh BGD 199882.45 11.25
Bangladesh BGD 199982.67 11.71
Bangladesh BGD 200081.88 12.14
Bulgaria BGR 199464.40 3.03
Bulgaria BGR 199567.05 3.27
Bulgaria BGR 199668.56 3.34
Bulgaria BGR 199762.69 4.42
Bulgaria BGR 199867.91 6.72
Bulgaria BGR 199970.96 7.72
Bulgaria BGR 200067.34 6.95
Bahrain BHR 1994na na
Bahrain BHR 1995na na
Bahrain BHR 199642.28 6.39
Bahrain BHR 1997na na
Bahrain BHR 1998na na
Bahrain BHR 1999na na
Bahrain BHR 2000na na
Bahamas BHS 1994na na
Bahamas BHS 1995na na
Bahamas BHS 199674.02 9.91
Bahamas BHS 1997na na
Bahamas BHS 1998na na
Bahamas BHS 1999na na
Bahamas BHS 2000na na
Belarus BLR 199455.99 23.98
Belarus BLR 199553.15 17.58
Belarus BLR 199653.52 18.06
Belarus BLR 199754.83 19.16
Belarus BLR 199856.25 18.10
Belarus BLR 199957.87 14.02
Belarus BLR 200056.02 13.77
Belize BLZ 199458.01 14.22
Belize BLZ 199560.84 11.55
Belize BLZ 199660.25 11.07
Belize BLZ 199759.64 14.48
Belize BLZ 199861.28 14.83
Belize BLZ 199966.11 14.87
Belize BLZ 200071.83 18.77
Bermuda BMU 1994na na
Bermuda BMU 1995na na
Bermuda BMU 199688.74 14.57
Bermuda BMU 1997na na
Bermuda BMU 1998na na
Bermuda BMU 1999na na
Bermuda BMU 2000na na
Bolivia BOL 199479.16 8.06
Bolivia BOL 199577.28 8.56
Bolivia BOL 199676.81 9.67
Bolivia BOL 199778.13 12.04
Bolivia BOL 199880.08 14.68
Bolivia BOL 199980.47 11.10
Bolivia BOL 200077.94 10.75
Brazil BRA 199457.54 16.52
Brazil BRA 199563.95 17.20
Brazil BRA 199663.60 16.62
Brazil BRA 199762.94 17.06
Brazil BRA 199862.26 16.94
Brazil BRA 199964.52 15.61
Brazil BRA 200065.75 15.63
Barbados BRB 199479.39 3.38
Barbados BRB 199581.55 3.56
Barbados BRB 199682.72 3.11
Barbados BRB 199789.86 3.66
Barbados BRB 199889.29 4.06
Barbados BRB 199991.80 4.17
Barbados BRB 200091.60 3.93
Bhutan BTN 1994na na
Bhutan BTN 1995na na
Bhutan BTN 199650.57 23.23
Bhutan BTN 1997na na
Bhutan BTN 1998na na
Bhutan BTN 1999na na
Bhutan BTN 2000na na
Botswana BWA 199443.25 16.83
Botswana BWA 199541.99 16.84
Botswana BWA 199639.71 17.15
Botswana BWA 199749.99 15.44
Botswana BWA 199859.68 12.91
Botswana BWA 199967.67 11.61
Botswana BWA 2000na na
Central African Republic CAF 199479.22 5.21
Central African Republic CAF 199571.40 6.48
Central African Republic CAF 199693.68 2.36
Central African Republic CAF 199784.87 4.61
Central African Republic CAF 199875.09 6.34
Central African Republic CAF 1999na na
Central African Republic CAF 2000na na
Canada CAN 199459.23 24.00
Canada CAN 199557.94 23.78
Canada CAN 199658.41 23.18
Canada CAN 199758.36 26.16
Canada CAN 199859.34 25.38
Canada CAN 199958.32 25.06
Canada CAN 200055.67 25.86
Switzerland CHE 199458.96 25.97
Switzerland CHE 199558.46 26.98
Switzerland CHE 199659.10 26.22
Switzerland CHE 199759.32 25.93
Switzerland CHE 199858.89 27.07
Switzerland CHE 199958.95 25.80
Switzerland CHE 200057.98 26.89
Chile CHL 199460.54 20.03
Chile CHL 199558.02 23.45
Chile CHL 199661.49 24.12
Chile CHL 199761.97 24.59
Chile CHL 199863.67 24.24
Chile CHL 199962.89 18.04
Chile CHL 200061.34 19.70
China CHN 199450.06 22.34
China CHN 199551.68 22.47
China CHN 199651.88 22.04
China CHN 199749.97 21.82
China CHN 199849.44 21.60
China CHN 199950.55 21.00
China CHN 200048.66 21.09
Cote d`Ivoire CIV 199474.25 4.88
Cote d`Ivoire CIV 199577.07 5.49
Cote d`Ivoire CIV 199674.25 5.55
Cote d`Ivoire CIV 199776.36 4.85
Cote d`Ivoire CIV 199877.11 5.65
Cote d`Ivoire CIV 199975.24 6.31
Cote d`Ivoire CIV 200076.76 5.75
Cameroon CMR 199483.49 5.30
Cameroon CMR 199581.81 4.73
Cameroon CMR 199683.46 4.93
Cameroon CMR 199784.39 5.02
Cameroon CMR 199884.45 5.46
Cameroon CMR 199984.65 5.79
Cameroon CMR 200081.14 5.41
Congo, Republic of COG 199465.37 11.94
Congo, Republic of COG 199562.36 8.44
Congo, Republic of COG 199658.65 7.39
Congo, Republic of COG 199757.40 4.65
Congo, Republic of COG 199885.72 5.49
Congo, Republic of COG 199957.27 4.42
Congo, Republic of COG 200044.71 2.61
Colombia COL 199471.19 15.83
Colombia COL 199571.11 15.77
Colombia COL 199669.81 14.73
Colombia COL 199769.22 14.03
Colombia COL 199869.45 12.81
Colombia COL 199967.11 7.84
Colombia COL 200067.93 8.79
Comoros COM 199490.86 6.47
Comoros COM 199588.22 6.79
Comoros COM 199689.35 6.95
Comoros COM 199792.65 6.09
Comoros COM 199884.20 6.50
Comoros COM 199985.71 4.78
Comoros COM 200079.76 4.30
Cape Verde CPV 199483.45 21.97
Cape Verde CPV 199581.02 21.03
Cape Verde CPV 199680.03 19.19
Cape Verde CPV 199781.66 17.42
Cape Verde CPV 199890.39 15.55
Cape Verde CPV 199985.86 15.58
Cape Verde CPV 200076.33 13.79
Costa Rica CRI 199465.10 18.10
Costa Rica CRI 199563.86 16.01
Costa Rica CRI 199665.34 13.86
Costa Rica CRI 199765.46 16.36
Costa Rica CRI 199863.56 18.50
Costa Rica CRI 199960.20 14.81
Costa Rica CRI 200062.16 14.11
Cuba CUB 199471.25 0.97
Cuba CUB 199572.19 1.31
Cuba CUB 199672.36 1.54
Cuba CUB 1997na na
Cuba CUB 1998na na
Cuba CUB 1999na na
Cuba CUB 2000na na
Cyprus CYP 199461.28 18.47
Cyprus CYP 199562.64 20.32
Cyprus CYP 199666.27 17.88
Cyprus CYP 1997na na
Cyprus CYP 1998na na
Cyprus CYP 1999na na
Cyprus CYP 2000na na
Czech Republic CZE 199468.20 21.63
Czech Republic CZE 199567.55 25.24
Czech Republic CZE 199669.29 25.85
Czech Republic CZE 199769.24 24.80
Czech Republic CZE 199866.54 23.27
Czech Republic CZE 199967.97 21.81
Czech Republic CZE 200067.42 24.21
Djibouti DJI 1994na na
Djibouti DJI 1995na na
Djibouti DJI 199676.89 4.15
Djibouti DJI 1997na na
Djibouti DJI 1998na na
Djibouti DJI 1999na na
Djibouti DJI 2000na na
Dominica DMA 199454.89 11.40
Dominica DMA 199552.37 13.93
Dominica DMA 199650.27 12.41
Dominica DMA 1997na na
Dominica DMA 1998na na
Dominica DMA 1999na na
Dominica DMA 200048.21 12.21
Denmark DNK 199467.12 19.85
Denmark DNK 199566.10 22.21
Denmark DNK 199666.28 21.37
Denmark DNK 199765.64 23.66
Denmark DNK 199866.63 24.48
Denmark DNK 199966.02 22.25
Denmark DNK 200062.90 24.14
Dominican Republic DOM 199472.84 13.91
Dominican Republic DOM 199571.38 12.40
Dominican Republic DOM 199673.36 11.97
Dominican Republic DOM 199767.83 11.89
Dominican Republic DOM 199868.61 13.87
Dominican Republic DOM 199966.60 14.03
Dominican Republic DOM 200067.16 13.78
Algeria DZA 199463.93 12.98
Algeria DZA 199562.44 12.93
Algeria DZA 199656.09 11.88
Algeria DZA 199754.72 11.15
Algeria DZA 199859.67 14.00
Algeria DZA 199957.05 12.46
Algeria DZA 200046.21 9.78
Ecuador ECU 199459.27 15.80
Ecuador ECU 199559.68 16.88
Ecuador ECU 199657.76 14.56
Ecuador ECU 199760.63 17.35
Ecuador ECU 199865.18 19.55
Ecuador ECU 199960.38 9.22
Ecuador ECU 200056.87 12.93
Egypt EGY 199491.01 4.40
Egypt EGY 199590.08 4.74
Egypt EGY 199691.13 4.96
Egypt EGY 199791.31 5.13
Egypt EGY 199894.19 5.99
Egypt EGY 199992.60 5.94
Egypt EGY 200090.51 5.87
Eritrea ERI 1994na na
Eritrea ERI 1995na na
Eritrea ERI 199697.45 9.09
Eritrea ERI 1997na na
Eritrea ERI 1998na na
Eritrea ERI 1999na na
Eritrea ERI 2000na na
Spain ESP 199470.03 22.62
Spain ESP 199575.16 21.96
Spain ESP 199669.01 23.21
Spain ESP 199768.59 23.23
Spain ESP 199868.87 24.02
Spain ESP 199969.49 24.65
Spain ESP 200069.13 25.47
Estonia EST 199460.88 15.06
Estonia EST 199557.51 13.58
Estonia EST 199659.60 14.71
Estonia EST 199760.00 16.90
Estonia EST 199860.80 15.63
Estonia EST 199957.41 12.36
Estonia EST 200056.70 13.15
Ethiopia ETH 199483.96 4.35
Ethiopia ETH 199583.20 4.70
Ethiopia ETH 199687.47 5.73
Ethiopia ETH 199781.74 5.48
Ethiopia ETH 199877.51 5.16
Ethiopia ETH 199975.78 4.63
Ethiopia ETH 200067.96 4.00
Finland FIN 199465.05 21.05
Finland FIN 199564.34 20.17
Finland FIN 199664.71 20.40
Finland FIN 199763.46 20.95
Finland FIN 199863.06 20.97
Finland FIN 199964.13 20.20
Finland FIN 200062.24 21.04
Fiji FJI 199462.51 9.66
Fiji FJI 199562.17 10.23
Fiji FJI 199667.08 7.91
Fiji FJI 199767.78 8.91
Fiji FJI 199861.34 8.28
Fiji FJI 199959.69 7.58
Fiji FJI 2000na na
France FRA 199467.62 22.39
France FRA 199567.07 23.05
France FRA 199667.76 21.99
France FRA 199766.98 21.38
France FRA 199866.88 22.49
France FRA 199967.01 22.53
France FRA 200066.37 23.82
Gabon GAB 199461.20 7.51
Gabon GAB 199562.73 6.83
Gabon GAB 199660.40 6.94
Gabon GAB 199760.68 8.95
Gabon GAB 199875.85 11.17
Gabon GAB 199975.64 7.81
Gabon GAB 200078.96 8.66
United Kingdom GBR 199474.59 18.24
United Kingdom GBR 199574.48 18.24
United Kingdom GBR 199675.19 17.95
United Kingdom GBR 199774.61 18.51
United Kingdom GBR 199874.60 19.81
United Kingdom GBR 199975.82 19.17
United Kingdom GBR 200075.20 19.43
Georgia GEO 1994na na
Georgia GEO 1995na na
Georgia GEO 199674.12 1.91
Georgia GEO 199780.78 4.21
Georgia GEO 199877.00 6.35
Georgia GEO 199981.66 3.60
Georgia GEO 200074.17 4.07
Germany GER 199468.43 24.49
Germany GER 199568.52 24.15
Germany GER 199669.25 23.13
Germany GER 199769.34 22.90
Germany GER 199869.23 23.06
Germany GER 199970.15 22.68
Germany GER 200069.42 23.62
Ghana GHA 199477.44 6.39
Ghana GHA 199575.48 5.50
Ghana GHA 199678.28 6.19
Ghana GHA 199786.14 7.36
Ghana GHA 199880.44 6.57
Ghana GHA 199986.46 6.18
Ghana GHA 200083.80 5.10
Guinea GIN 199489.23 10.79
Guinea GIN 199592.91 8.17
Guinea GIN 199692.83 7.24
Guinea GIN 199790.34 7.30
Guinea GIN 199892.52 7.13
Guinea GIN 199993.30 7.12
Guinea GIN 200093.34 7.59
Gambia, The GMB 199488.70 8.37
Gambia, The GMB 199590.68 10.01
Gambia, The GMB 199690.79 10.54
Gambia, The GMB 199788.52 7.74
Gambia, The GMB 199891.65 8.56
Gambia, The GMB 199991.87 7.42
Gambia, The GMB 200088.83 7.33
Guinea-Bissau GNB 199479.34 13.86
Guinea-Bissau GNB 199582.62 13.87
Guinea-Bissau GNB 199681.97 14.22
Guinea-Bissau GNB 199778.38 14.23
Guinea-Bissau GNB 199884.36 12.43
Guinea-Bissau GNB 199979.67 7.60
Guinea-Bissau GNB 200078.99 5.55
Equatorial Guinea GNQ 199473.08 35.44
Equatorial Guinea GNQ 199568.66 37.99
Equatorial Guinea GNQ 199670.28 58.13
Equatorial Guinea GNQ 199761.74 31.64
Equatorial Guinea GNQ 199877.17 41.79
Equatorial Guinea GNQ 199935.32 26.65
Equatorial Guinea GNQ 200026.83 17.70
Greece GRC 199473.97 19.13
Greece GRC 199579.40 19.51
Greece GRC 199679.55 20.44
Greece GRC 199778.66 20.79
Greece GRC 199878.46 21.77
Greece GRC 199978.14 21.31
Greece GRC 200076.60 22.84
Grenada GRD 199467.34 22.21
Grenada GRD 199567.51 19.21
Grenada GRD 199670.48 21.86
Grenada GRD 199776.62 23.37
Grenada GRD 199876.23 23.57
Grenada GRD 199962.17 22.30
Grenada GRD 200066.07 24.51
Guatemala GTM 199485.03 8.04
Guatemala GTM 199584.88 7.52
Guatemala GTM 199685.27 6.17
Guatemala GTM 199784.71 6.93
Guatemala GTM 199885.01 9.00
Guatemala GTM 199986.15 8.36
Guatemala GTM 200084.15 8.23
Guyana GUY 199473.84 12.72
Guyana GUY 199568.55 15.16
Guyana GUY 199665.30 14.17
Guyana GUY 199766.15 13.93
Guyana GUY 199868.23 12.71
Guyana GUY 199965.83 10.25
Guyana GUY 2000na na
Hong Kong HKG 199466.90 26.70
Hong Kong HKG 199567.63 31.41
Hong Kong HKG 199667.25 28.99
Hong Kong HKG 199767.82 30.70
Hong Kong HKG 199866.14 26.74
Hong Kong HKG 199966.72 21.79
Hong Kong HKG 200064.45 24.99
Honduras HND 199475.67 18.86
Honduras HND 199571.65 18.05
Honduras HND 199673.85 16.40
Honduras HND 199775.45 16.86
Honduras HND 199874.40 16.12
Honduras HND 199978.29 17.23
Honduras HND 200072.43 20.37
Croatia HRV 1994na na
Croatia HRV 199562.01 12.21
Croatia HRV 199659.88 15.33
Croatia HRV 199763.61 19.18
Croatia HRV 199860.80 16.66
Croatia HRV 199959.46 15.94
Croatia HRV 200057.70 15.27
Haiti HTI 199488.65 2.31
Haiti HTI 199593.86 3.19
Haiti HTI 199695.19 2.59
Haiti HTI 199790.21 2.13
Haiti HTI 199894.75 1.96
Haiti HTI 1999na na
Haiti HTI 2000na na
Hungary HUN 199472.63 17.51
Hungary HUN 199566.80 19.24
Hungary HUN 199664.90 21.78
Hungary HUN 199763.07 22.42
Hungary HUN 199863.69 24.66
Hungary HUN 199964.62 24.13
Hungary HUN 200064.13 25.47
Indonesia IDN 199457.93 19.86
Indonesia IDN 199557.30 24.37
Indonesia IDN 199661.49 21.19
Indonesia IDN 199762.54 20.99
Indonesia IDN 199862.16 13.22
Indonesia IDN 199966.37 10.13
Indonesia IDN 200064.78 10.67
India IND 199462.63 11.92
India IND 199559.41 13.25
India IND 199660.74 11.93
India IND 199760.02 12.53
India IND 199856.59 12.88
India IND 199954.33 13.60
India IND 200052.38 13.18
Ireland IRL 199467.30 17.26
Ireland IRL 199564.44 18.75
Ireland IRL 199663.58 19.71
Ireland IRL 199761.62 20.97
Ireland IRL 199861.08 22.95
Ireland IRL 199960.54 21.15
Ireland IRL 200059.78 21.55
Iran IRN 199465.28 9.50
Iran IRN 199559.45 19.53
Iran IRN 199665.09 13.45
Iran IRN 199765.44 15.89
Iran IRN 199867.09 18.23
Iran IRN 199963.62 15.06
Iran IRN 200056.01 13.12
Iceland ISL 199466.75 18.75
Iceland ISL 199567.73 19.11
Iceland ISL 199668.58 22.01
Iceland ISL 199768.10 22.78
Iceland ISL 199869.60 27.09
Iceland ISL 199971.74 24.78
Iceland ISL 200070.85 27.57
Israel ISR 199458.29 30.43
Israel ISR 199558.64 30.91
Israel ISR 199658.65 30.81
Israel ISR 199758.33 27.69
Israel ISR 199859.09 24.50
Israel ISR 199959.00 25.51
Israel ISR 200058.20 23.33
Italy ITA 199470.38 19.93
Italy ITA 199569.23 20.71
Italy ITA 199669.15 20.10
Italy ITA 199770.06 20.28
Italy ITA 199870.64 20.52
Italy ITA 199971.26 21.09
Italy ITA 200062.05 21.73
Jamaica JAM 199466.66 21.96
Jamaica JAM 199565.98 21.15
Jamaica JAM 199665.50 20.48
Jamaica JAM 199754.95 23.35
Jamaica JAM 199857.92 20.38
Jamaica JAM 199957.49 20.35
Jamaica JAM 200057.66 20.53
Jordan JOR 199458.32 19.36
Jordan JOR 199554.83 18.85
Jordan JOR 199659.03 17.44
Jordan JOR 199757.59 14.17
Jordan JOR 199859.58 11.84
Jordan JOR 199959.43 9.98
Jordan JOR 200063.18 10.74
Japan JPN 199460.85 31.36
Japan JPN 199560.98 31.58
Japan JPN 199660.87 32.71
Japan JPN 199760.66 32.31
Japan JPN 199861.83 30.15
Japan JPN 199962.87 28.94
Japan JPN 200061.62 29.75
Kazakhstan KAZ 199470.85 17.12
Kazakhstan KAZ 199564.00 10.68
Kazakhstan KAZ 199669.88 7.31
Kazakhstan KAZ 199772.01 7.77
Kazakhstan KAZ 199876.82 7.38
Kazakhstan KAZ 199970.68 7.50
Kazakhstan KAZ 200060.88 7.14
Kenya KEN 199472.50 7.09
Kenya KEN 199579.51 7.74
Kenya KEN 199678.64 7.74
Kenya KEN 199782.14 7.57
Kenya KEN 199881.71 7.89
Kenya KEN 199978.15 7.75
Kenya KEN 200080.12 7.54
Kyrgyzstan KGZ 199462.55 3.27
Kyrgyzstan KGZ 199562.98 7.21
Kyrgyzstan KGZ 199666.23 11.17
Kyrgyzstan KGZ 199755.38 10.24
Kyrgyzstan KGZ 199868.52 7.19
Kyrgyzstan KGZ 199962.81 7.92
Kyrgyzstan KGZ 200060.33 6.97
Cambodia KHM 199486.18 3.98
Cambodia KHM 199591.89 4.65
Cambodia KHM 199690.50 5.54
Cambodia KHM 199784.46 5.14
Cambodia KHM 199886.29 5.76
Cambodia KHM 199986.41 6.45
Cambodia KHM 2000na na
St. Kitts & Nevis KNA 199440.82 19.36
St. Kitts & Nevis KNA 199548.41 18.19
St. Kitts & Nevis KNA 199650.79 17.94
St. Kitts & Nevis KNA 199743.95 17.17
St. Kitts & Nevis KNA 199843.91 16.42
St. Kitts & Nevis KNA 199948.20 13.23
St. Kitts & Nevis KNA 200047.47 16.49
Korea, Republic of KOR 199454.90 40.23
Korea, Republic of KOR 199555.31 40.50
Korea, Republic of KOR 199656.54 41.64
Korea, Republic of KOR 199757.48 37.65
Korea, Republic of KOR 199855.74 24.66
Korea, Republic of KOR 199958.15 29.05
Korea, Republic of KOR 200057.12 30.78
Kuwait KWT 1994na na
Kuwait KWT 1995na na
Kuwait KWT 199652.02 9.92
Kuwait KWT 1997na na
Kuwait KWT 1998na na
Kuwait KWT 1999na na
Kuwait KWT 2000na na
Laos LAO 1994na na
Laos LAO 1995na na
Laos LAO 199662.23 21.23
Laos LAO 1997na na
Laos LAO 1998na na
Laos LAO 1999na na
Laos LAO 2000na na
Lebanon LBN 1994116.16 17.47
Lebanon LBN 1995112.06 17.75
Lebanon LBN 1996106.19 15.82
Lebanon LBN 1997102.27 13.80
Lebanon LBN 199890.82 14.94
Lebanon LBN 199984.82 10.30
Lebanon LBN 200076.50 8.18
St. Lucia LCA 199472.33 14.08
St. Lucia LCA 199571.02 10.71
St. Lucia LCA 199673.61 12.28
St. Lucia LCA 199774.36 14.19
St. Lucia LCA 199873.66 13.44
St. Lucia LCA 199976.55 14.36
St. Lucia LCA 200074.81 13.69
Sri Lanka LKA 199477.42 12.51
Sri Lanka LKA 199577.79 11.87
Sri Lanka LKA 199674.71 11.39
Sri Lanka LKA 199770.28 11.99
Sri Lanka LKA 199869.28 12.46
Sri Lanka LKA 199970.39 12.49
Sri Lanka LKA 200067.61 12.51
Lesotho LSO 1994104.34 32.80
Lesotho LSO 199597.14 41.61
Lesotho LSO 199693.75 47.20
Lesotho LSO 199790.25 44.58
Lesotho LSO 199883.36 38.40
Lesotho LSO 199975.51 37.52
Lesotho LSO 200064.63 36.22
Lithuania LTU 199471.03 8.23
Lithuania LTU 199564.59 13.76
Lithuania LTU 199666.34 13.42
Lithuania LTU 199766.56 16.09
Lithuania LTU 199864.16 16.26
Lithuania LTU 199968.06 14.95
Lithuania LTU 200066.35 12.98
Luxembourg LUX 199450.30 24.06
Luxembourg LUX 199559.21 23.86
Luxembourg LUX 199659.89 23.68
Luxembourg LUX 199756.35 24.85
Luxembourg LUX 199854.65 23.34
Luxembourg LUX 199953.35 25.10
Luxembourg LUX 200049.58 23.48
Latvia LVA 199462.48 6.91
Latvia LVA 199557.21 10.00
Latvia LVA 199662.73 10.41
Latvia LVA 199763.63 11.18
Latvia LVA 199864.94 14.59
Latvia LVA 199965.09 12.42
Latvia LVA 200064.59 11.85
Macao MAC 199434.85 22.02
Macao MAC 199533.69 18.33
Macao MAC 199634.98 13.82
Macao MAC 199738.80 14.72
Macao MAC 199840.37 12.89
Macao MAC 199941.47 12.01
Macao MAC 200039.24 8.25
Morocco MAR 199482.80 9.66
Morocco MAR 199581.32 11.29
Morocco MAR 199682.28 9.56
Morocco MAR 199777.19 10.08
Morocco MAR 199877.38 11.45
Morocco MAR 199976.73 10.55
Morocco MAR 200076.12 12.22
Moldova MDA 1994na na
Moldova MDA 199565.59 10.32
Moldova MDA 199670.62 9.49
Moldova MDA 199769.89 8.85
Moldova MDA 199880.25 9.57
Moldova MDA 199976.57 8.84
Moldova MDA 200094.10 8.70
Madagascar MDG 199491.64 2.62
Madagascar MDG 199591.30 2.62
Madagascar MDG 199690.08 2.83
Madagascar MDG 199791.84 2.69
Madagascar MDG 199891.79 2.76
Madagascar MDG 199992.84 2.72
Madagascar MDG 200093.58 3.23
Mexico MEX 199476.81 21.08
Mexico MEX 199575.67 14.42
Mexico MEX 199674.23 16.85
Mexico MEX 199773.88 19.70
Mexico MEX 199875.23 20.74
Mexico MEX 199974.79 20.45
Mexico MEX 200067.09 20.83
Macedonia MKD 199476.92 8.90
Macedonia MKD 199570.69 13.15
Macedonia MKD 199672.64 12.67
Macedonia MKD 199773.37 12.53
Macedonia MKD 199874.26 12.49
Macedonia MKD 199972.04 10.40
Macedonia MKD 200081.76 10.03
Mali MLI 199492.97 7.57
Mali MLI 199585.67 7.24
Mali MLI 199686.57 7.79
Mali MLI 199779.25 6.41
Mali MLI 199880.31 6.42
Mali MLI 199979.55 6.17
Mali MLI 200077.07 6.36
Malta MLT 199463.96 20.61
Malta MLT 199566.08 21.43
Malta MLT 199668.27 18.81
Malta MLT 199766.64 16.58
Malta MLT 199866.65 14.55
Malta MLT 1999na na
Malta MLT 2000na na
Mongolia MNG 1994na na
Mongolia MNG 1995na na
Mongolia MNG 199662.98 16.64
Mongolia MNG 1997na na
Mongolia MNG 1998na na
Mongolia MNG 1999na na
Mongolia MNG 2000na na
Mozambique MOZ 199499.67 3.52
Mozambique MOZ 199599.74 4.36
Mozambique MOZ 199697.80 3.66
Mozambique MOZ 199793.82 3.33
Mozambique MOZ 199891.56 4.20
Mozambique MOZ 199997.52 5.90
Mozambique MOZ 200096.09 4.68
Mauritania MRT 199474.24 6.87
Mauritania MRT 199578.29 8.14
Mauritania MRT 199677.75 9.95
Mauritania MRT 199775.65 11.01
Mauritania MRT 199879.58 10.35
Mauritania MRT 199977.37 8.64
Mauritania MRT 2000na na
Mauritius MUS 199484.31 13.65
Mauritius MUS 199581.27 10.62
Mauritius MUS 199680.10 10.40
Mauritius MUS 199781.49 12.79
Mauritius MUS 199879.13 11.83
Mauritius MUS 199982.13 11.14
Mauritius MUS 200081.33 11.34
Malawi MWI 199483.59 8.97
Malawi MWI 199588.52 5.03
Malawi MWI 199695.96 4.62
Malawi MWI 199796.64 4.56
Malawi MWI 199891.85 4.35
Malawi MWI 1999100.70 4.49
Malawi MWI 200093.58 3.75
Malaysia MYS 199451.11 31.97
Malaysia MYS 199550.71 34.74
Malaysia MYS 199649.13 33.18
Malaysia MYS 199748.20 34.40
Malaysia MYS 199840.87 18.06
Malaysia MYS 199934.85 18.26
Malaysia MYS 200030.03 21.70
Namibia NAM 199456.98 11.87
Namibia NAM 199558.94 10.53
Namibia NAM 199659.45 11.40
Namibia NAM 199761.69 10.19
Namibia NAM 199860.92 13.25
Namibia NAM 199958.59 11.67
Namibia NAM 2000na na
Niger NER 199477.07 4.13
Niger NER 199578.25 2.99
Niger NER 199681.47 3.92
Niger NER 199780.44 4.25
Niger NER 199882.78 4.39
Niger NER 199979.18 3.74
Niger NER 200083.32 3.85
Nigeria NGA 199472.87 12.76
Nigeria NGA 199575.46 11.04
Nigeria NGA 199661.19 9.82
Nigeria NGA 199773.97 9.61
Nigeria NGA 199881.13 11.54
Nigeria NGA 199969.82 16.31
Nigeria NGA 200031.89 22.19
Nicaragua NIC 199484.60 10.13
Nicaragua NIC 199582.70 11.31
Nicaragua NIC 199680.28 12.71
Nicaragua NIC 199794.53 16.80
Nicaragua NIC 199896.28 17.16
Nicaragua NIC 1999104.73 21.48
Nicaragua NIC 200092.21 17.88
Netherlands NLD 199462.60 21.10
Netherlands NLD 199562.14 21.85
Netherlands NLD 199662.55 21.93
Netherlands NLD 199762.23 22.35
Netherlands NLD 199862.84 22.34
Netherlands NLD 199963.76 22.37
Netherlands NLD 200062.73 22.47
Norway NOR 199460.61 25.84
Norway NOR 199559.80 27.17
Norway NOR 199658.95 25.94
Norway NOR 199757.91 28.41
Norway NOR 199861.30 31.31
Norway NOR 199960.58 26.91
Norway NOR 200053.45 24.48
Nepal NPL 199469.40 17.03
Nepal NPL 199567.83 18.06
Nepal NPL 199670.37 18.83
Nepal NPL 199770.79 17.36
Nepal NPL 199870.42 16.56
Nepal NPL 199970.49 13.26
Nepal NPL 200067.27 16.02
New Zealand NZL 199468.19 21.95
New Zealand NZL 199567.71 23.36
New Zealand NZL 199668.19 23.38
New Zealand NZL 199769.16 22.06
New Zealand NZL 199870.50 20.99
New Zealand NZL 199970.12 22.69
New Zealand NZL 200067.64 22.33
Oman OMN 1994na na
Oman OMN 1995na na
Oman OMN 199658.28 8.08
Oman OMN 1997na na
Oman OMN 1998na na
Oman OMN 1999na na
Oman OMN 2000na na
Pakistan PAK 199471.29 11.40
Pakistan PAK 199571.46 11.09
Pakistan PAK 199674.02 11.07
Pakistan PAK 199776.36 10.48
Pakistan PAK 199873.72 10.08
Pakistan PAK 199977.28 8.68
Pakistan PAK 200074.04 8.81
Panama PAN 199458.47 23.68
Panama PAN 199558.24 26.17
Panama PAN 199657.94 26.54
Panama PAN 199761.24 25.19
Panama PAN 199865.55 26.58
Panama PAN 199963.07 28.71
Panama PAN 200062.25 26.65
Peru PER 199470.81 19.94
Peru PER 199570.23 22.00
Peru PER 199670.88 20.86
Peru PER 199769.40 22.28
Peru PER 199870.35 21.78
Peru PER 199970.06 18.43
Peru PER 200069.53 17.44
Philippines PHL 199473.05 15.89
Philippines PHL 199574.71 15.56
Philippines PHL 199675.25 16.42
Philippines PHL 199775.74 17.48
Philippines PHL 199876.54 13.95
Philippines PHL 199971.83 12.22
Philippines PHL 200067.12 11.63
Papua New Guinea PNG 199450.16 5.76
Papua New Guinea PNG 199562.67 8.42
Papua New Guinea PNG 199654.26 12.65
Papua New Guinea PNG 199760.92 11.06
Papua New Guinea PNG 199859.26 9.46
Papua New Guinea PNG 199963.01 9.54
Papua New Guinea PNG 2000na na
Poland POL 199476.06 14.85
Poland POL 199572.91 17.34
Poland POL 199675.08 19.53
Poland POL 199775.62 21.50
Poland POL 199875.75 22.38
Poland POL 199977.18 22.24
Poland POL 200067.21 24.35
Puerto Rico PRI 1994na na
Puerto Rico PRI 1995na na
Puerto Rico PRI 199696.11 22.95
Puerto Rico PRI 199796.61 25.16
Puerto Rico PRI 199895.55 23.29
Puerto Rico PRI 1999na na
Puerto Rico PRI 2000na na
Portugal PRT 199462.86 20.71
Portugal PRT 199572.38 23.85
Portugal PRT 199672.48 23.73
Portugal PRT 199772.21 25.41
Portugal PRT 199872.33 26.62
Portugal PRT 199961.67 26.46
Portugal PRT 200060.74 27.22
Paraguay PRY 199472.56 12.24
Paraguay PRY 199572.84 12.89
Paraguay PRY 199671.61 12.43
Paraguay PRY 199779.87 13.06
Paraguay PRY 199880.88 12.43
Paraguay PRY 199977.12 11.63
Paraguay PRY 200077.14 11.06
Qatar QAT 1994na na
Qatar QAT 1995na na
Qatar QAT 199650.10 13.25
Qatar QAT 1997na na
Qatar QAT 1998na na
Qatar QAT 1999na na
Qatar QAT 2000na na
Romania ROM 199472.13 13.89
Romania ROM 199577.55 12.60
Romania ROM 199683.08 11.64
Romania ROM 199782.27 11.50
Romania ROM 199883.94 10.65
Romania ROM 199981.47 10.12
Romania ROM 200081.03 11.18
Russia RUS 199449.51 18.33
Russia RUS 199560.73 17.40
Russia RUS 199663.86 13.72
Russia RUS 199766.68 13.05
Russia RUS 199867.73 9.20
Russia RUS 199957.35 8.81
Russia RUS 200054.74 8.79
Rwanda RWA 1994132.16 4.48
Rwanda RWA 199592.77 3.08
Rwanda RWA 199689.71 3.21
Rwanda RWA 199791.44 3.72
Rwanda RWA 199889.34 4.22
Rwanda RWA 199985.72 3.46
Rwanda RWA 200083.86 3.22
Saudi Arabia SAU 1994na na
Saudi Arabia SAU 1995na na
Saudi Arabia SAU 199646.99 8.88
Saudi Arabia SAU 1997na na
Saudi Arabia SAU 1998na na
Saudi Arabia SAU 1999na na
Saudi Arabia SAU 2000na na
Sudan SDN 1994na na
Sudan SDN 1995na na
Sudan SDN 199679.21 9.57
Sudan SDN 1997na na
Sudan SDN 1998na na
Sudan SDN 1999na na
Sudan SDN 2000na na
Senegal SEN 199481.26 6.60
Senegal SEN 199582.13 6.41
Senegal SEN 199683.67 6.66
Senegal SEN 199783.82 6.55
Senegal SEN 199883.67 7.44
Senegal SEN 199986.21 6.91
Senegal SEN 200086.91 7.14
Singapore SGP 199438.34 39.92
Singapore SGP 199536.51 41.32
Singapore SGP 199634.74 43.93
Singapore SGP 199733.92 45.56
Singapore SGP 199832.87 40.05
Singapore SGP 199934.74 37.74
Singapore SGP 200034.79 37.72
Sierra Leone SLE 199481.94 4.55
Sierra Leone SLE 199592.02 3.21
Sierra Leone SLE 199698.93 5.27
Sierra Leone SLE 1997na na
Sierra Leone SLE 199894.56 4.22
Sierra Leone SLE 1999na na
Sierra Leone SLE 200093.12 3.91
El Salvador SLV 199489.03 9.81
El Salvador SLV 199589.31 10.35
El Salvador SLV 199688.77 7.79
El Salvador SLV 199787.05 7.90
El Salvador SLV 199886.72 9.28
El Salvador SLV 199987.76 8.34
El Salvador SLV 200089.26 8.87
Sao Tome and Principe STP 1994102.76 18.97
Sao Tome and Principe STP 1995114.31 17.42
Sao Tome and Principe STP 1996106.56 18.71
Sao Tome and Principe STP 1997na na
Sao Tome and Principe STP 199875.45 17.81
Sao Tome and Principe STP 199974.96 18.08
Sao Tome and Principe STP 200074.00 18.08
Slovak Republic SVK 199465.49 16.74
Slovak Republic SVK 199565.91 21.68
Slovak Republic SVK 199670.16 27.02
Slovak Republic SVK 199770.37 26.01
Slovak Republic SVK 199856.47 27.91
Slovak Republic SVK 199955.98 24.51
Slovak Republic SVK 200052.22 24.78
Slovenia SVN 199453.21 19.87
Slovenia SVN 199554.46 23.11
Slovenia SVN 199654.32 23.23
Slovenia SVN 199753.24 24.14
Slovenia SVN 199852.82 25.35
Slovenia SVN 199953.27 27.82
Slovenia SVN 200051.13 27.60
Sweden SWE 199469.48 18.48
Sweden SWE 199566.83 19.46
Sweden SWE 199667.50 18.93
Sweden SWE 199767.27 18.59
Sweden SWE 199867.56 19.56
Sweden SWE 199967.93 19.51
Sweden SWE 200050.14 20.60
Swaziland SWZ 1994na na
Swaziland SWZ 1995na na
Swaziland SWZ 199671.22 18.45
Swaziland SWZ 199770.88 20.40
Swaziland SWZ 199869.07 21.30
Swaziland SWZ 199970.47 18.63
Swaziland SWZ 200070.87 18.87
Seychelles SYC 199442.56 16.11
Seychelles SYC 199552.63 16.28
Seychelles SYC 199645.20 28.23
Seychelles SYC 199757.54 18.98
Seychelles SYC 199873.09 16.45
Seychelles SYC 199965.64 17.61
Seychelles SYC 200062.18 14.50
Syria SYR 199474.74 11.94
Syria SYR 199570.86 10.43
Syria SYR 199670.93 9.15
Syria SYR 199767.45 8.26
Syria SYR 199867.96 7.89
Syria SYR 199965.98 7.66
Syria SYR 200060.57 7.00
Chad TCD 199490.13 7.87
Chad TCD 199585.24 4.67
Chad TCD 199684.43 6.47
Chad TCD 199784.76 6.29
Chad TCD 199886.65 6.97
Chad TCD 199985.94 4.83
Chad TCD 200079.78 6.70
Togo TGO 199468.92 9.01
Togo TGO 199569.31 9.94
Togo TGO 199671.39 12.18
Togo TGO 199783.52 10.62
Togo TGO 199877.32 12.72
Togo TGO 199976.58 11.32
Togo TGO 200077.45 12.32
Thailand THA 199449.76 41.04
Thailand THA 199550.86 42.04
Thailand THA 199650.60 41.49
Thailand THA 199751.84 33.08
Thailand THA 199851.04 17.75
Thailand THA 199953.04 18.58
Thailand THA 200053.46 20.87
Tajikistan TJK 1994na na
Tajikistan TJK 1995na na
Tajikistan TJK 199667.37 11.96
Tajikistan TJK 199768.69 8.66
Tajikistan TJK 199883.12 6.86
Tajikistan TJK 199971.90 8.41
Tajikistan TJK 200075.94 9.09
Turkmenistan TKM 1994na na
Turkmenistan TKM 1995na na
Turkmenistan TKM 199639.05 40.47
Turkmenistan TKM 1997na na
Turkmenistan TKM 1998na na
Turkmenistan TKM 1999na na
Turkmenistan TKM 2000na na
Trinidad&Tobago TTO 199458.83 12.99
Trinidad&Tobago TTO 199561.43 9.78
Trinidad&Tobago TTO 199663.48 10.14
Trinidad&Tobago TTO 199769.75 17.97
Trinidad&Tobago TTO 199874.74 14.06
Trinidad&Tobago TTO 199972.84 8.36
Trinidad&Tobago TTO 200069.76 7.43
Tunisia TUN 199476.17 12.71
Tunisia TUN 199576.85 12.78
Tunisia TUN 199677.48 13.06
Tunisia TUN 199778.11 13.12
Tunisia TUN 199879.27 12.98
Tunisia TUN 199978.74 12.49
Tunisia TUN 200078.56 13.29
Turkey TUR 199469.04 16.11
Turkey TUR 199568.59 21.63
Turkey TUR 199670.84 20.99
Turkey TUR 199770.55 21.49
Turkey TUR 199869.10 20.15
Turkey TUR 199969.65 18.07
Turkey TUR 200069.15 21.11
Taiwan TWN 199462.63 21.77
Taiwan TWN 199562.85 21.63
Taiwan TWN 199662.49 20.63
Taiwan TWN 199762.75 21.83
Taiwan TWN 199863.93 21.96
Taiwan TWN 1999na na
Taiwan TWN 2000na na
Tanzania TZA 199486.97 11.15
Tanzania TZA 199585.15 9.92
Tanzania TZA 199685.45 8.62
Tanzania TZA 199782.23 10.42
Tanzania TZA 199889.55 9.83
Tanzania TZA 199988.05 8.90
Tanzania TZA 200083.33 9.39
Uganda UGA 199478.67 2.92
Uganda UGA 199578.14 3.53
Uganda UGA 199680.10 3.64
Uganda UGA 199776.78 3.29
Uganda UGA 199878.37 3.17
Uganda UGA 199983.85 3.22
Uganda UGA 200085.06 3.57
Ukraine UKR 199454.28 17.10
Ukraine UKR 199555.88 11.12
Ukraine UKR 199656.48 9.03
Ukraine UKR 199756.85 9.34
Ukraine UKR 199857.65 9.36
Ukraine UKR 199954.19 8.80
Ukraine UKR 200054.36 9.68
Uruguay URY 199469.50 12.00
Uruguay URY 199567.90 12.65
Uruguay URY 199669.59 11.58
Uruguay URY 199769.85 11.79
Uruguay URY 199870.63 12.21
Uruguay URY 199971.49 11.06
Uruguay URY 200071.82 10.03
United States USA 199468.11 20.90
United States USA 199568.14 20.98
United States USA 199668.05 21.58
United States USA 199767.45 22.52
United States USA 199868.08 22.89
United States USA 199968.84 23.14
United States USA 200068.26 24.25
Uzbekistan UZB 199455.78 13.30
Uzbekistan UZB 199546.88 13.69
Uzbekistan UZB 199655.53 9.33
Uzbekistan UZB 1997na na
Uzbekistan UZB 1998na na
Uzbekistan UZB 1999na na
Uzbekistan UZB 2000na na
St.Vincent & Grenadines VCT 199455.00 9.08
St.Vincent & Grenadines VCT 199546.90 9.66
St.Vincent & Grenadines VCT 199646.09 8.90
St.Vincent & Grenadines VCT 199757.14 9.77
St.Vincent & Grenadines VCT 199855.10 10.36
St.Vincent & Grenadines VCT 199953.17 10.42
St.Vincent & Grenadines VCT 200046.42 8.43
Venezuela VEN 199465.22 10.43
Venezuela VEN 199564.45 13.96
Venezuela VEN 199658.90 11.65
Venezuela VEN 199762.94 15.71
Venezuela VEN 199868.34 16.95
Venezuela VEN 199964.40 13.85
Venezuela VEN 200057.99 13.54
Vietnam VNM 199473.44 12.60
Vietnam VNM 199575.01 13.98
Vietnam VNM 199679.06 14.90
Vietnam VNM 199777.91 13.19
Vietnam VNM 1998na na
Vietnam VNM 1999na na
Vietnam VNM 2000na na
Yemen YEM 199449.13 5.30
Yemen YEM 199555.43 6.58
Yemen YEM 199666.80 6.82
Yemen YEM 199750.50 6.38
Yemen YEM 199856.05 6.27
Yemen YEM 199953.31 5.37
Yemen YEM 200039.77 5.62
South Africa ZAF 199462.72 7.73
South Africa ZAF 199565.00 8.57
South Africa ZAF 199665.17 7.94
South Africa ZAF 199765.45 7.61
South Africa ZAF 199866.23 7.28
South Africa ZAF 199965.74 6.74
South Africa ZAF 200064.99 7.08
Congo, Dem. Rep. ZAR 199480.48 2.96
Congo, Dem. Rep. ZAR 199577.93 2.63
Congo, Dem. Rep. ZAR 199678.43 2.43
Congo, Dem. Rep. ZAR 199781.94 2.60
Congo, Dem. Rep. ZAR 1998na na
Congo, Dem. Rep. ZAR 1999na na
Congo, Dem. Rep. ZAR 2000na na
Zambia ZMB 199475.43 9.86
Zambia ZMB 199576.55 10.31
Zambia ZMB 199678.74 10.99
Zambia ZMB 199777.59 12.15
Zambia ZMB 199885.12 13.75
Zambia ZMB 199991.82 15.30
Zambia ZMB 200086.33 15.38
Zimbabwe ZWE 199460.10 18.53
Zimbabwe ZWE 199566.89 15.03
Zimbabwe ZWE 199672.06 11.32
Zimbabwe ZWE 199782.82 11.01
Zimbabwe ZWE 199877.66 10.75
Zimbabwe ZWE 199976.89 10.73
Zimbabwe ZWE 2000
+
+ + + +
+ + + + diff --git a/demos/old/dev-complex.html b/demos/old/dev-complex.html deleted file mode 100644 index dfce6f93..00000000 --- a/demos/old/dev-complex.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - HTML Table Filter Generator - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
-
- - - - - - \ No newline at end of file diff --git a/demos/old/dev.html b/demos/old/dev.html deleted file mode 100644 index 37c430ea..00000000 --- a/demos/old/dev.html +++ /dev/null @@ -1,214 +0,0 @@ - - - - HTML Table Filter Generator - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
Tot:
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- -
- - - - - -
- - - - - \ No newline at end of file diff --git a/demos/old/dist-complex.html b/demos/old/dist-complex.html deleted file mode 100644 index ccb69569..00000000 --- a/demos/old/dist-complex.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - HTML Table Filter Generator - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
-
- - - - - - \ No newline at end of file diff --git a/demos/old/dist.html b/demos/old/dist.html deleted file mode 100644 index f8e856e9..00000000 --- a/demos/old/dist.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - HTML Table Filter Generator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
Tot:
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- - - - - \ No newline at end of file diff --git a/demos/starter.html b/demos/starter.html new file mode 100644 index 00000000..39056385 --- /dev/null +++ b/demos/starter.html @@ -0,0 +1,513 @@ + + + + TableFilter v0.0.0 - Starter + + +

TableFilter v0.0.0

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
countryisocodeyearPOPXRATPPPcgdpccci
BeninBEN19985950.33589.9517822190.951178.4690.987.55
BeninBEN19996109.53615.6990967200.191174.9092.617.86
BeninBEN20006272.00711.9763184200.611224.7492.278.25
Burkina FasoBFA19949755.03555.2047119125.76838.7679.816.57
Burkina FasoBFA19959988.00499.148407136.65860.8980.419.29
Burkina FasoBFA199610225.00511.5523987144.18881.1180.4012.12
Burkina FasoBFA199710473.53583.6693726141.78899.0176.9414.94
RussiaRUS1998146899.019.7050828932.647086.3967.739.20
RussiaRUS1999146308.9924.61993984.038074.7057.358.81
RussiaRUS2000145555.0128.129169464.859995.9154.748.79
RwandaRWA19946230.00194.51750.39529.48132.164.48
RwandaRWA19956400.00262.197509870.67746.3492.773.08
RwandaRWA19966727.00306.820007377.90823.2589.713.21
RwandaRWA19977895.18301.529785284.13847.7991.443.72
RwandaRWA19988105.00312.314086985.32914.2289.344.22
El SalvadorSLV19955669.008.7545833593.544143.5989.3110.35
El SalvadorSLV19965798.008.7550001143.694235.7988.777.79
El SalvadorSLV19975911.008.7562503813.744408.4187.057.90
Slovak RepublicSVK20005401.0046.035213.0212618.5352.2224.78
SloveniaSVN19941988.90128.808593879.9711662.1253.2119.87
SloveniaSVN19951990.00118.518501389.0312574.9654.4623.11
SloveniaSVN19961991.00135.364303697.2713151.5154.3223.23
SloveniaSVN19971985.96159.6882935103.9614143.0253.2424.14
SloveniaSVN19981982.60166.134201108.9315067.3452.8225.35
ZambiaZMB19948740.72669.3706055307.48834.1975.439.86
ZambiaZMB19958980.00864.1192017402.40829.3776.5510.31
ZambiaZMB19969214.401207.900024515.01838.0578.7410.99
ZambiaZMB19979443.211314.498047596.97851.4777.5912.15
ZambiaZMB19989665.711862.06897744.91800.6985.1213.75
ZambiaZMB19999881.212388.019043941.87765.2491.8215.30
ZambiaZMB200010089.003110.8439941157.63840.9786.3315.38
ZimbabweZWE199410775.358.1515388492.012586.8460.1018.53
ZimbabweZWE199511011.008.665375712.152603.3766.8915.03
ZimbabweZWE199611242.1610.002349852.642860.2372.0611.32
ZimbabweZWE199711923.5212.111289983.172727.0682.8211.01
ZimbabweZWE199812153.8523.679109574.062799.8577.6610.75
ZimbabweZWE199912388.3238.301200876.122770.4876.8910.73
ZimbabweZWE200012627.0044.417919169.482607.0369.238.62
+ + + + + + +

+
+
+
+
+
+
+
+
+
diff --git a/dist/starter.html b/dist/starter.html
new file mode 100644
index 00000000..39056385
--- /dev/null
+++ b/dist/starter.html
@@ -0,0 +1,513 @@
+
+
+
+    TableFilter v0.0.0 - Starter
+
+
+

TableFilter v0.0.0

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
countryisocodeyearPOPXRATPPPcgdpccci
BeninBEN19985950.33589.9517822190.951178.4690.987.55
BeninBEN19996109.53615.6990967200.191174.9092.617.86
BeninBEN20006272.00711.9763184200.611224.7492.278.25
Burkina FasoBFA19949755.03555.2047119125.76838.7679.816.57
Burkina FasoBFA19959988.00499.148407136.65860.8980.419.29
Burkina FasoBFA199610225.00511.5523987144.18881.1180.4012.12
Burkina FasoBFA199710473.53583.6693726141.78899.0176.9414.94
RussiaRUS1998146899.019.7050828932.647086.3967.739.20
RussiaRUS1999146308.9924.61993984.038074.7057.358.81
RussiaRUS2000145555.0128.129169464.859995.9154.748.79
RwandaRWA19946230.00194.51750.39529.48132.164.48
RwandaRWA19956400.00262.197509870.67746.3492.773.08
RwandaRWA19966727.00306.820007377.90823.2589.713.21
RwandaRWA19977895.18301.529785284.13847.7991.443.72
RwandaRWA19988105.00312.314086985.32914.2289.344.22
El SalvadorSLV19955669.008.7545833593.544143.5989.3110.35
El SalvadorSLV19965798.008.7550001143.694235.7988.777.79
El SalvadorSLV19975911.008.7562503813.744408.4187.057.90
Slovak RepublicSVK20005401.0046.035213.0212618.5352.2224.78
SloveniaSVN19941988.90128.808593879.9711662.1253.2119.87
SloveniaSVN19951990.00118.518501389.0312574.9654.4623.11
SloveniaSVN19961991.00135.364303697.2713151.5154.3223.23
SloveniaSVN19971985.96159.6882935103.9614143.0253.2424.14
SloveniaSVN19981982.60166.134201108.9315067.3452.8225.35
ZambiaZMB19948740.72669.3706055307.48834.1975.439.86
ZambiaZMB19958980.00864.1192017402.40829.3776.5510.31
ZambiaZMB19969214.401207.900024515.01838.0578.7410.99
ZambiaZMB19979443.211314.498047596.97851.4777.5912.15
ZambiaZMB19989665.711862.06897744.91800.6985.1213.75
ZambiaZMB19999881.212388.019043941.87765.2491.8215.30
ZambiaZMB200010089.003110.8439941157.63840.9786.3315.38
ZimbabweZWE199410775.358.1515388492.012586.8460.1018.53
ZimbabweZWE199511011.008.665375712.152603.3766.8915.03
ZimbabweZWE199611242.1610.002349852.642860.2372.0611.32
ZimbabweZWE199711923.5212.111289983.172727.0682.8211.01
ZimbabweZWE199812153.8523.679109574.062799.8577.6610.75
ZimbabweZWE199912388.3238.301200876.122770.4876.8910.73
ZimbabweZWE200012627.0044.417919169.482607.0369.238.62
+ + + + + + +

+
+
+
+
+
+
+
+
+
diff --git a/dist/tablefilter/style/tablefilter.css b/dist/tablefilter/style/tablefilter.css
index 7ea0de72..a079891c 100644
--- a/dist/tablefilter/style/tablefilter.css
+++ b/dist/tablefilter/style/tablefilter.css
@@ -283,7 +283,7 @@ div.grd_Cont .odd{ background-color:#DFE8F6; }/*row bg alternating color*/
 
 /* Selection */
 .ezActiveRow{ background-color:#2852A8 !important; color:#fff; }
-.ezSelectedRow{	background-color:#316AC5; color:#fff; }
+.ezSelectedRow{	background-color:#316AC5 !important; color:#fff; }
 .ezActiveCell{
 	background-color:#D9E8FB !important;
 	color:#000 !important; font-weight:bold;
diff --git a/dist/tablefilter/tablefilter.js b/dist/tablefilter/tablefilter.js
index 109b52d0..cb93eb15 100644
--- a/dist/tablefilter/tablefilter.js
+++ b/dist/tablefilter/tablefilter.js
@@ -1,10 +1,7035 @@
-/** 
- *	 TableFilter v0.0.0 by Max Guglielmi 
- *	 build date: 2015-07-10T07:12:21.982Z 
- *	 MIT License  
- */ 
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory();
+	else if(typeof define === 'function' && define.amd)
+		define(factory);
+	else {
+		var a = factory();
+		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+	}
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ 	// install a JSONP callback for chunk loading
+/******/ 	var parentJsonpFunction = window["webpackJsonp"];
+/******/ 	window["webpackJsonp"] = function webpackJsonpCallback(chunkIds, moreModules) {
+/******/ 		// add "moreModules" to the modules object,
+/******/ 		// then flag all "chunkIds" as loaded and fire callback
+/******/ 		var moduleId, chunkId, i = 0, callbacks = [];
+/******/ 		for(;i < chunkIds.length; i++) {
+/******/ 			chunkId = chunkIds[i];
+/******/ 			if(installedChunks[chunkId])
+/******/ 				callbacks.push.apply(callbacks, installedChunks[chunkId]);
+/******/ 			installedChunks[chunkId] = 0;
+/******/ 		}
+/******/ 		for(moduleId in moreModules) {
+/******/ 			modules[moduleId] = moreModules[moduleId];
+/******/ 		}
+/******/ 		if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules);
+/******/ 		while(callbacks.length)
+/******/ 			callbacks.shift().call(null, __webpack_require__);
+/******/
+/******/ 	};
+/******/
+/******/ 	// The module cache
+/******/ 	var installedModules = {};
+/******/
+/******/ 	// object to store loaded and loading chunks
+/******/ 	// "0" means "already loaded"
+/******/ 	// Array means "loading", array contains callbacks
+/******/ 	var installedChunks = {
+/******/ 		0:0
+/******/ 	};
+/******/
+/******/ 	// The require function
+/******/ 	function __webpack_require__(moduleId) {
+/******/
+/******/ 		// Check if module is in cache
+/******/ 		if(installedModules[moduleId])
+/******/ 			return installedModules[moduleId].exports;
+/******/
+/******/ 		// Create a new module (and put it into the cache)
+/******/ 		var module = installedModules[moduleId] = {
+/******/ 			exports: {},
+/******/ 			id: moduleId,
+/******/ 			loaded: false
+/******/ 		};
+/******/
+/******/ 		// Execute the module function
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+/******/
+/******/ 		// Flag the module as loaded
+/******/ 		module.loaded = true;
+/******/
+/******/ 		// Return the exports of the module
+/******/ 		return module.exports;
+/******/ 	}
+/******/
+/******/ 	// This file contains only the entry chunk.
+/******/ 	// The chunk loading function for additional chunks
+/******/ 	__webpack_require__.e = function requireEnsure(chunkId, callback) {
+/******/ 		// "0" is the signal for "already loaded"
+/******/ 		if(installedChunks[chunkId] === 0)
+/******/ 			return callback.call(null, __webpack_require__);
+/******/
+/******/ 		// an array means "currently loading".
+/******/ 		if(installedChunks[chunkId] !== undefined) {
+/******/ 			installedChunks[chunkId].push(callback);
+/******/ 		} else {
+/******/ 			// start chunk loading
+/******/ 			installedChunks[chunkId] = [callback];
+/******/ 			var head = document.getElementsByTagName('head')[0];
+/******/ 			var script = document.createElement('script');
+/******/ 			script.type = 'text/javascript';
+/******/ 			script.charset = 'utf-8';
+/******/ 			script.async = true;
+/******/
+/******/ 			script.src = __webpack_require__.p + "tf-" + ({}[chunkId]||chunkId) + ".js";
+/******/ 			head.appendChild(script);
+/******/ 		}
+/******/ 	};
+/******/
+/******/ 	// expose the modules object (__webpack_modules__)
+/******/ 	__webpack_require__.m = modules;
+/******/
+/******/ 	// expose the module cache
+/******/ 	__webpack_require__.c = installedModules;
+/******/
+/******/ 	// __webpack_public_path__
+/******/ 	__webpack_require__.p = "/dist/tablefilter/";
+/******/
+/******/ 	// Load entry module and return exports
+/******/ 	return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ function(module, exports, __webpack_require__) {
 
-!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var a=i[s]={exports:{},id:s,loaded:!1};return t[s].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var s=window.webpackJsonp;window.webpackJsonp=function(i,l){for(var n,r,o=0,h=[];o1)for(var s=0,i=arguments.length;i>s;s++){var l=arguments[s],n=typeof l;switch(u["default"].lower(n)){case"number":this.startRow=l;break;case"object":this.cfg=l}}var o=this.cfg;this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(d){this.nbCells=this.getCellsNb(0)}this.basePath=o.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=o.grid===!1?!1:!0,this.gridLayout=Boolean(o.grid_layout),this.sourceTblHtml=null,this.gridLayout&&(this.sourceTblHtml=this.tbl.outerHTML),this.filtersRowIndex=o.filters_row_index||0,this.headersRow=o.headers_row_index||(0===this.filtersRowIndex?1:0),this.gridLayout&&(this.headersRow>1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==o.filters_cell_tag||"td"!==o.filters_cell_tag?"td":o.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.infDivCssClass=o.inf_div_css_class||"inf",this.lDivCssClass=o.left_div_css_class||"ldiv",this.rDivCssClass=o.right_div_css_class||"rdiv",this.mDivCssClass=o.middle_div_css_class||"mdiv",this.contDivCssClass=o.content_div_css_class||"cont",this.stylePath=o.style_path||this.basePath+"style/",this.stylesheet=o.stylesheet||this.stylePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=o.flts_row_css_class||"fltrow",this.enableIcons=o.enable_icons===!1?!1:!0,this.alternateBgs=Boolean(o.alternate_rows),this.hasColWidths=g["default"].isArray(o.col_widths),this.colWidths=this.hasColWidths?o.col_widths:null,this.fltCssClass=o.flt_css_class||"flt",this.fltMultiCssClass=o.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=o.flt_small_css_class||"flt_s",this.singleFltCssClass=o.single_flt_css_class||"single_flt",this.enterKey=o.enter_key===!1?!1:!0,this.onBeforeFilter=g["default"].isFn(o.on_before_filter)?o.on_before_filter:null,this.onAfterFilter=g["default"].isFn(o.on_after_filter)?o.on_after_filter:null,this.caseSensitive=Boolean(o.case_sensitive),this.exactMatch=Boolean(o.exact_match),this.linkedFilters=Boolean(o.linked_filters),this.disableExcludedOptions=Boolean(o.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasVisibleRows=Boolean(o.rows_always_visible),this.visibleRows=this.hasVisibleRows?o.rows_always_visible:[],this.isExternalFlt=Boolean(o.external_flt_grid),this.externalFltTgtIds=o.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(o.exec_delay)?100:parseInt(o.exec_delay,10),this.onFiltersLoaded=g["default"].isFn(o.on_filters_loaded)?o.on_filters_loaded:null,this.singleSearchFlt=Boolean(o.single_search_filter),this.onRowValidated=g["default"].isFn(o.on_row_validated)?o.on_row_validated:null,this.customCellDataCols=o.custom_cell_data_cols?o.custom_cell_data_cols:[],this.customCellData=g["default"].isFn(o.custom_cell_data)?o.custom_cell_data:null,this.watermark=o.watermark||"",this.isWatermarkArray=g["default"].isArray(this.watermark),this.toolBarTgtId=o.toolbar_target_id||null,this.helpInstructions=g["default"].isUndef(o.help_instructions)?void 0:Boolean(o.help_instructions),this.popUpFilters=Boolean(o.popup_filters),this.markActiveColumns=Boolean(o.mark_active_columns),this.activeColumnsCssClass=o.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=g["default"].isFn(o.on_before_active_column)?o.on_before_active_column:null,this.onAfterActiveColumn=g["default"].isFn(o.on_after_active_column)?o.on_after_active_column:null,this.displayAllText=o.display_all_text||"Clear",this.enableEmptyOption=Boolean(o.enable_empty_option),this.emptyText=o.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(o.enable_non_empty_option),this.nonEmptyText=o.non_empty_text||"(Non empty)",this.onSlcChange=o.on_change===!1?!1:!0,this.sortSlc=o.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(o.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?o.sort_num_asc:null,this.isSortNumDesc=Boolean(o.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?o.sort_num_desc:null,this.fillSlcOnDemand=Boolean(o.fill_slc_on_demand),this.hasCustomOptions=g["default"].isObj(o.custom_options),this.customOptions=o.custom_options,this.rgxOperator=o.regexp_operator||"rgx:",this.emOperator=o.empty_operator||"[empty]",this.nmOperator=o.nonempty_operator||"[nonempty]",this.orOperator=o.or_operator||"||",this.anOperator=o.and_operator||"&&",this.grOperator=o.greater_operator||">",this.lwOperator=o.lower_operator||"<",this.leOperator=o.lower_equal_operator||"<=",this.geOperator=o.greater_equal_operator||">=",this.dfOperator=o.different_operator||"!",this.lkOperator=o.like_operator||"*",this.eqOperator=o.equal_operator||"=",this.stOperator=o.start_with_operator||"{",this.enOperator=o.end_with_operator||"}",this.curExp=o.cur_exp||"^[¥£€$]",this.separator=o.separator||",",this.rowsCounter=Boolean(o.rows_counter),this.statusBar=Boolean(o.status_bar),this.loader=Boolean(o.loader),this.displayBtn=Boolean(o.btn),this.btnText=o.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=o.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(o.btn_reset),this.btnResetCssClass=o.btn_reset_css_class||"reset",this.onBeforeReset=g["default"].isFn(o.on_before_reset)?o.on_before_reset:null,this.onAfterReset=g["default"].isFn(o.on_after_reset)?o.on_after_reset:null,this.paging=Boolean(o.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.autoFilter=Boolean(o.auto_filter),this.autoFilterDelay=isNaN(o.auto_filter_delay)?900:o.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(o.highlight_keywords),this.defaultDateType=o.default_date_type||"DMY",this.thousandsSeparator=o.thousands_separator||",",this.decimalSeparator=o.decimal_separator||".",this.hasColNbFormat=g["default"].isArray(o.col_number_format),this.colNbFormat=this.hasColNbFormat?o.col_number_format:null,this.hasColDateType=g["default"].isArray(o.col_date_type),this.colDateType=this.hasColDateType?o.col_date_type:null,this.msgFilter=o.msg_filter||"Filtering data...",this.msgPopulate=o.msg_populate||"Populating filter...",this.msgPopulateCheckList=o.msg_populate_checklist||"Populating list...",this.msgChangePage=o.msg_change_page||"Collecting paging data...",this.msgClear=o.msg_clear||"Clearing filters...",this.msgChangeResults=o.msg_change_results||"Changing results per page...",this.msgResetValues=o.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=o.msg_reset_page||"Re-setting page...",this.msgResetPageLength=o.msg_reset_page_length||"Re-setting page length...",this.msgSort=o.msg_sort||"Sorting data...",this.msgLoadExtensions=o.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=o.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(o.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&o.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&o.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=o.extensions,this.hasExtensions=g["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(o.enable_default_theme),this.hasThemes=this.enableDefaultTheme||g["default"].isArray(o.themes),this.themes=o.themes||[],this.themesPath=o.themes_path||this.stylePath+"themes/",this.Mod={},this.ExtRegistry={},this.Evt={name:{filter:"Filter",dropdown:"DropDown",checklist:"CheckList",changepage:"ChangePage",clear:"Clear",changeresultsperpage:"ChangeResults",resetvalues:"ResetValues",resetpage:"ResetPage",resetpagelength:"ResetPageLength",loadextensions:"LoadExtensions",loadthemes:"LoadThemes"},detectKey:function(t){if(this.enterKey){var e=t||O.event;if(e){var s=r["default"].keyCode(e);13===s?(this.filter(),r["default"].cancel(e),r["default"].stop(e)):(this.isUserTyping=!0,O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}}},onKeyUp:function(t){function e(){O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var s=t||O.event,i=r["default"].keyCode(s);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=O.setInterval(e.bind(this),this.autoFilterDelay)):(O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,O.clearInterval(this.autoFilterTimer))},onInpFocus:function(t){var e=t||O.event,s=r["default"].target(e);this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.popUpFilters&&(r["default"].cancel(e),r["default"].stop(e))},onSlcFocus:function(t){var e=t||O.event,s=r["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Mod.dropdown._build(i)}this.popUpFilters&&(r["default"].cancel(e),r["default"].stop(e))},onSlcChange:function(t){if(this.activeFlt){var e=t||O.event;this.popUpFilters&&r["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||O.event,s=r["default"].target(e);if(this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Mod.checkList._build(i),this.Mod.checkList.checkListDiv[i].onclick=null,this.Mod.checkList.checkListDiv[i].title=""}},onBtnClick:function(){this.filter()}}}}return l(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=h["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popUpFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var t=this.Mod,e=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(t.store=new w.Store(this)),this.gridLayout&&(t.gridLayout=new x.GridLayout(this),t.gridLayout.init()),this.loader&&(t.loader||(t.loader=new k.Loader(this))),this.highlightKeywords&&(t.highlightKeyword=new T.HighlightKeyword(this)),this.popUpFilters&&(t.popupFilter||(t.popupFilter=new R.PopupFilter(this)),t.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var i=void 0;if(!this.gridLayout){var a=h["default"].tag(this.tbl,"thead");i=a.length>0?a[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,i.className=this.fltsRowCssClass,!this.isExternalFlt||this.gridLayout&&!this.popUpFilters||(i.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;e>l;l++){this.popUpFilters&&t.popupFilter.build(l);var n=h["default"].create(this.fltCellTag),o=this.getFilterType(l),d=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[l]:null;if(this.singleSearchFlt&&(n.colSpan=this.nbCells),this.gridLayout||i.appendChild(n),s=l==e-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(o=this.fltTypeInp,s=this.singleFltCssClass),o===this.fltTypeSlc||o===this.fltTypeMulti){t.dropdown||(t.dropdown=new F.Dropdown(this));var f=t.dropdown,c=h["default"].create(this.fltTypeSlc,["id",this.prfxFlt+l+"_"+this.id],["ct",l],["filled","0"]);if(o===this.fltTypeMulti&&(c.multiple=this.fltTypeMulti,c.title=f.multipleSlcTooltip),c.className=u["default"].lower(o)===this.fltTypeSlc?s:this.fltMultiCssClass,d?(h["default"].id(d).appendChild(c),this.externalFltEls.push(c)):n.appendChild(c),this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||f._build(l),r["default"].add(c,"keypress",this.Evt.detectKey.bind(this)),r["default"].add(c,"change",this.Evt.onSlcChange.bind(this)),r["default"].add(c,"focus",this.Evt.onSlcFocus.bind(this)),this.fillSlcOnDemand){var p=h["default"].createOpt(this.displayAllText,"");c.appendChild(p)}}else if(o===this.fltTypeCheckList){var g=void 0;t.checkList=new P.CheckList(this),g=t.checkList;var v=h["default"].create("div",["id",g.prfxCheckListDiv+l+"_"+this.id],["ct",l],["filled","0"]);v.className=g.checkListDivCssClass,d?(h["default"].id(d).appendChild(v),this.externalFltEls.push(v)):n.appendChild(v),g.checkListDiv[l]=v,this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||g._build(l),this.fillSlcOnDemand&&(r["default"].add(v,"click",this.Evt.onCheckListClick.bind(this)),v.appendChild(h["default"].text(g.activateCheckListTxt)))}else{var b=o===this.fltTypeInp?"text":"hidden",m=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+l+"_"+this.id],["type",b],["ct",l]);if("hidden"!==b&&this.watermark&&m.setAttribute("placeholder",this.isWatermarkArray?this.watermark[l]||"":this.watermark),m.className=s,r["default"].add(m,"focus",this.Evt.onInpFocus.bind(this)),d?(h["default"].id(d).appendChild(m),this.externalFltEls.push(m)):n.appendChild(m),this.fltIds.push(this.prfxFlt+l+"_"+this.id),r["default"].add(m,"keypress",this.Evt.detectKey.bind(this)),r["default"].add(m,"keydown",this.Evt.onKeyDown.bind(this)),r["default"].add(m,"keyup",this.Evt.onKeyUp.bind(this)),r["default"].add(m,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var _=this.Mod.store.getFilterValues(this.fltsValuesCookie);" "!=_[l]&&this.setFilterValue(l,_[l],!1)}}if(l==e-1&&this.displayBtn){var C=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+l+"_"+this.id],["type","button"],["value",this.btnText]);C.className=this.btnCssClass,d?h["default"].id(d).appendChild(C):n.appendChild(C),r["default"].add(C,"click",this.Evt.onBtnClick.bind(this))}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.rowsCounter&&(t.rowsCounter=new I.RowsCounter(this),t.rowsCounter.init()),this.statusBar&&(t.statusBar=new S.StatusBar(this),t.statusBar.init()),(this.paging||t.paging)&&(t.paging||(t.paging=new L.Paging(this)),t.paging.isPagingRemoved?t.paging.reset():t.paging.init()),this.btnReset&&(t.clearButton=new E.ClearButton(this),t.clearButton.init()),this.helpInstructions&&(t.help||(t.help=new N.Help(this)),t.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(t.alternateRows=new D.AlternateRows(this),t.alternateRows.init()),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.loader&&t.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?r.dropdown._build(i,!0):r.dropdown._build(i,!1,a,l);break;case e.checklist:r.checkList._build(i,a,l);break;case e.changepage:r.paging._changePage(n);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:r.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:r.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:r.paging._resetPageLength(this.pgLenCookie);break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&r.statusBar.message(""),this.loader&&r.loader.show("none")}var s=void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,a=s.slcExternal,l=s.slcId,n=s.pgIndex,r=this.Mod;this.loader||this.statusBar||this.linkedFilters?(this.loader&&r.loader.show(""),this.statusBar&&r.statusBar.message(this["msg"+t]),O.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,a=t.path,l=void 0;i&&a?l=t.path+i:(i=i.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,i)),s.e(1,function(s){var a=[s(1)("./"+l)];(function(s){var a=new s(e,t);a.init(),e.ExtRegistry[i]=a}).apply(null,a)})}}},{key:"extension",value:function(t){return this.ExtRegistry[t]}},{key:"hasExtension",value:function(t){return!g["default"].isEmpty(this.ExtRegistry[t])}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e],a=this.ExtRegistry[i.name];a&&(a.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(g["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var a=t[s],l=a.name,n=a.path,r=this.prfxTf+l;l&&!n?n=this.themesPath+l+"/"+l+".css":!l&&a.path&&(l="theme{0}".replace("{0}",s)),this.isImported(n,"link")||this["import"](r,n,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},{key:"getStylesheet",value:function(){var t=void 0===arguments[0]?"default":arguments[0];return h["default"].id(this.prfxTf+t)}},{key:"destroy",value:function(){if(this._hasGrid){var t=this.tbl.rows,e=this.Mod;this.isExternalFlt&&!this.popUpFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;s0&&[].forEach.call(e,function(e){t.removeChild(e)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt&&this.externalFltTgtIds)for(var t=this.externalFltTgtIds,e=t.length,s=0;e>s;s++){var i=t[s],a=h["default"].id(i);a&&(a.innerHTML="")}}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(t&&this.isCustomOptions(t)){for(var e=this.customOptions,s=e.cols,i=[],a=[],l=b["default"].indexByValue(s,t),n=e.values[l],r=e.texts[l],o=e.sorts[l],h=0,d=n.length;d>h;h++)a.push(n[h]),i.push(r[h]?r[h]:n[h]);return o&&(a.sort(),i.sort()),[a,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.fillSlcOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Mod.paging&&this.Mod.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Mod.paging&&this.Mod.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.fillSlcOnDemand){var e=this.Mod.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var a=0;ad;d++)""!==l[d]&&(n=h["default"].createOpt(l[d],l[d],!0),o.appendChild(n),this.hasStoredValues=!0)}}else if(r===this.fltTypeCheckList){var f=this.Mod.checkList,c=f.checkListDiv[a];c.title=c.innerHTML,c.innerHTML="";var p=h["default"].create("ul",["id",this.fltIds[a]],["colIndex",a]);p.className=f.checkListCssClass;var g=h["default"].createCheckItem(this.fltIds[a]+"_0","",this.displayAllText);g.className=f.checkListItemCssClass,p.appendChild(g),c.appendChild(p),l=e[a].split(" "+this.orOperator+" ");for(var d=0,u=l.length;u>d;d++)if(""!==l[d]){var v=h["default"].createCheckItem(this.fltIds[a]+"_"+(d+1),l[d],l[d]);v.className=f.checkListItemCssClass,p.appendChild(v),v.check.checked=!0,f.setCheckListValues(v.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Mod.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{key:"_filter",value:function(){function t(t,e,s){if(this.highlightKeywords&&e){t=t.replace(p,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(m,"");var a=t;(r.test(t)||o.test(t)||d.test(t)||f.test(t)||c.test(t))&&(a=h["default"].getText(s)),""!==a&&i.highlightKeyword.highlight(s,a,i.highlightKeyword.highlightCssClass)}}function e(t,e,s){var i=void 0,a=y["default"].removeNbFormat,h=d.test(t),b=r.test(t),x=f.test(t),k=o.test(t),T=c.test(t),R=g.test(t),F=p.test(t),P=v.test(t),I=m.test(t),S=_===t,E=C===t,N=w.test(t),D=h&&B(t.replace(d,""),L),O=b&&B(t.replace(r,""),L),A=x&&B(t.replace(f,""),L),H=k&&B(t.replace(o,""),L),V=T&&B(t.replace(c,""),L),U=R&&B(t.replace(g,""),L),G=void 0,j=void 0;if(B(e,L))G=M(e,L),D?(j=M(t.replace(d,""),L),i=j>G):O?(j=M(t.replace(r,""),L),i=j>=G):H?(j=M(t.replace(o,""),L),i=G>=j):A?(j=M(t.replace(f,""),L),i=G>j):V?(j=M(t.replace(c,""),L),i=G.toString()!=j.toString()):U?(j=M(t.replace(g,""),L),i=G.toString()==j.toString()):p.test(t)?i=this._containsStr(t.replace(p,""),e,null,!1):B(t,L)?(j=M(t,L),i=G.toString()==j.toString()):S?i=u["default"].isEmpty(e):E&&(i=!u["default"].isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(l=a(e,this.colNbFormat[s]),n=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(l=a(e,"us"),n="us"):(l=a(e,"eu"),n="eu"),b)i=l<=a(t.replace(r,""),n);else if(k)i=l>=a(t.replace(o,""),n);else if(h)i=la(t.replace(f,""),n);else if(T)i=this._containsStr(t.replace(c,""),e)?!1:!0;else if(F)i=this._containsStr(t.replace(p,""),e,null,!1);else if(R)i=this._containsStr(t.replace(g,""),e,null,!0);else if(P)i=0===e.indexOf(t.replace(v,""))?!0:!1;else if(I){var W=t.replace(m,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(S)i=u["default"].isEmpty(e);else if(E)i=!u["default"].isEmpty(e);else if(N)try{var $=t.replace(w,""),K=new RegExp($);i=K.test(e)}catch(Y){i=!1}else i=this._containsStr(t,e,this.getFilterType(s));return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this);var s=this.tbl.rows,i=this.Mod,a=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var l,n,r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),d=new RegExp(this.lwOperator),f=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),p=new RegExp(u["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),m=new RegExp(this.enOperator),_=this.emOperator,C=this.nmOperator,w=new RegExp(u["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var S=this.searchArgs[this.singleSearchFlt?0:I],L=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==S){var E=u["default"].matchCase(this.getCellData(I,k[I]),this.caseSensitive),N=S.split(this.orOperator),D=N.length>1?!0:!1,O=S.split(this.anOperator),A=O.length>1?!0:!1;if(D||A){for(var H=void 0,V=!1,U=D?N:O,G=0,j=U.length;j>G&&(H=u["default"].trim(U[G]),V=e.call(this,H,E,I),t.call(this,H,V,k[I]),!D||!V)&&(!A||V);G++);R[I]=V}else R[I]=e.call(this,u["default"].trim(S),E,I),t.call(this,S,R[I],k[I]);R[I]||(F=!1),this.singleSearchFlt&&R[I]&&(P=!0),this.popUpFilters&&i.popupFilter.buildIcon(I,!0),this.markActiveColumns&&x===this.refRow&&(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,I),h["default"].addClass(this.getHeaderElement(I),this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,I))}}this.singleSearchFlt&&P&&(F=!0),F?(this.validateRow(x,!0),this.validRowsIndex.push(x),this.alternateBgs&&i.alternateRows.setRowBg(x,this.validRowsIndex.length),this.onRowValidated&&this.onRowValidated.call(null,this,x)):(this.validateRow(x,!1),i.alternateRows&&i.alternateRows.removeRowBg(x),this.hasVisibleRows&&b["default"].has(this.visibleRows,x)&&!this.paging?this.validRowsIndex.push(x):a++)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=a,this.rememberGridValues&&i.store.saveFilterValues(this.fltsValuesCookie),this.paging?(i.paging.startPagingRow=0,i.paging.currentPageNb=1,i.paging.setPagingInfo(this.validRowsIndex)):this.applyProps(),this.onAfterFilter&&this.onAfterFilter.call(null,this)}}},{key:"applyProps",value:function(){var t=this.Mod;this.visibleRows&&this.enforceVisibility(),this.hasExtension("colOps")&&this.extension("colOps").calc(),this.linkedFilters&&this.linkFilters();var e=!this.paging&&this.hasVisibleRows?this.nbVisibleRows-this.visibleRows.length:this.nbVisibleRows;this.rowsCounter&&t.rowsCounter.refresh(e),this.popUpFilters&&t.popupFilter.closeAll()}},{key:"getColValues",value:function(t){var e=void 0===arguments[1]?!1:arguments[1],s=void 0===arguments[2]?void 0:arguments[2];if(this.fltGrid){for(var i=this.tbl.rows,a=[],l=this.refRow;lh;h++)if(h==t&&""==i[l].style.display){var d=u["default"].lower(this.getCellData(h,r[h])),f=this.colNbFormat?this.colNbFormat[t]:null,c=e?y["default"].removeNbFormat(d,f):d;a.push(c)}}return a}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.getFilterType(t);if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var a=0,l=s.options.length;l>a;a++)s.options[a].selected&&(e=e.concat(s.options[a].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else i===this.fltTypeCheckList&&(null!==s.getAttribute("value")?(e=s.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,s=this.fltIds.length;s>e;e++)t.push(u["default"].trim(u["default"].matchCase(this.getFilterValue(e),this.caseSensitive)));return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var s=[],i=0,a=this.fltIds.length;a>i;i++){var l=this.getFilterType(i);if(l===u["default"].lower(t)){ -var n=e?i:this.fltIds[i];s.push(n)}}return s}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return h["default"].id(e)}},{key:"getCellsNb",value:function(){var t=void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=g["default"].isUndef(this.refRow)?0:this.refRow,s=this.tbl.rows.length;return t&&(e=0),parseInt(s-e,10)}},{key:"getCellData",value:function(t,e){return g["default"].isUndef(t)||!e?"":this.customCellData&&b["default"].has(this.customCellDataCols,t)?this.customCellData.call(null,this,e,t):h["default"].getText(e)}},{key:"getTableData",value:function(){for(var t=this.tbl.rows,e=this.refRow;ea;a++){var n=this.getCellData(a,i[a]);s[1].push(n)}this.tblData.push(s)}return this.tblData}},{key:"getFilteredData",value:function(t){if(!this.validRowsIndex)return[];var e=this.tbl.rows,s=[];if(t){for(var i=this.gridLayout?this.Mod.gridLayout.headTbl:this.tbl,a=i.rows[this.headersRow],l=[a.rowIndex,[]],n=0;ni;i++){var l=e[i],n=l[1],r=n[t];s.push(r)}return s}},{key:"getRowDisplay",value:function(t){return this.fltGrid&&g["default"].isObj(t)?t.style.display:void 0}},{key:"validateRow",value:function(t,e){var s=this.tbl.rows[t];if(s&&"boolean"==typeof e){this.hasVisibleRows&&b["default"].has(this.visibleRows,t)&&!this.paging&&(e=!0);var i=e?"":"none",a=e?"true":"false";s.style.display=i,this.paging&&s.setAttribute("validRow",a)}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;tl;l++){var r=s.options[l];(""===a||""===a[0])&&(r.selected=!1),""===r.value&&(r.selected=!1),""!==r.value&&b["default"].has(a,r.value,!0)&&(r.selected=!0)}else if(i===this.fltTypeCheckList){e=u["default"].matchCase(e,this.caseSensitive);var o=e.split(" "+this.orOperator+" "),d=h["default"].tag(s,"li").length;s.setAttribute("value",""),s.setAttribute("indexes","");for(var f=0;d>f;f++){var c=h["default"].tag(s,"li")[f],p=h["default"].tag(c,"label")[0],g=h["default"].tag(c,"input")[0],v=u["default"].matchCase(h["default"].getText(p),this.caseSensitive);""!==v&&b["default"].has(o,v,!0)?(g.checked=!0,this.Mod.checkList.setCheckListValues(g)):(g.checked=!1,this.Mod.checkList.setCheckListValues(g))}}}}},{key:"setColWidths",value:function(t,e){function s(t){var s=this.nbCells,i=this.colWidths;if(s!=i.length||s!=t.cells.length)throw new Error("Columns number mismatch!");for(var a=h["default"].tag(e,"col"),l=a.length>0,n=l?null:A.createDocumentFragment(),r=0;s>r;r++){var o=void 0;l?o=a[r]:(o=h["default"].create("col",["id",this.id+"_col_"+r]),n.appendChild(o)),o.style.width=i[r]}l||e.insertBefore(n,e.firstChild)}if(this.fltGrid&&this.hasColWidths){e=e||this.tbl;var i=void 0;i=void 0===t?"none"!=e.rows[0].style.display?0:1:t,s.call(this,e.rows[i])}}},{key:"enforceVisibility",value:function(){if(this._hasGrid&&this.hasVisibleRows&&!this.paging)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.linkedFilters&&(this.activeFilterId="",this.linkFilters()),this.rememberPageLen&&c["default"].remove(this.pgLenCookie),this.rememberPageNb&&c["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.fltIds.length;e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"linkFilters",value:function(){if(this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);i=i.concat(s);var a=this.activeFilterId.split("_")[0];a=a.split(this.prfxFlt)[1];for(var l=void 0,n=0,r=i.length;r>n;n++){var o=h["default"].id(this.fltIds[i[n]]);if(l=this.getFilterValue(i[n]),a!==i[n]||this.paging&&b["default"].has(t,i[n])&&a===i[n]||!this.paging&&(b["default"].has(s,i[n])||b["default"].has(e,i[n]))||l===this.displayAllText){if(b["default"].has(s,i[n])?this.Mod.checkList.checkListDiv[i[n]].innerHTML="":o.innerHTML="",this.fillSlcOnDemand){var d=h["default"].createOpt(this.displayAllText,"");o&&o.appendChild(d)}b["default"].has(s,i[n])?this.Mod.checkList._build(i[n]):this.Mod.dropdown._build(i[n],!0),this.setFilterValue(i[n],l)}}}}},{key:"_resetGrid",value:function(){if(!this.isFirstLoad){var t=this.Mod,e=this.tbl,s=e.rows,i=this.filtersRowIndex,a=s[i];if(!this.gridLayout)if(e.tHead){var l=e.tHead.insertRow(this.filtersRowIndex);e.tHead.replaceChild(this.fltGridEl,l)}else a.parentNode.insertBefore(this.fltGridEl,a);if(this.isExternalFlt)for(var n=this.externalFltTgtIds,r=0,o=n.length;o>r;r++){var d=h["default"].id(n[r]);if(d){var u=this.externalFltEls[r];d.appendChild(u);var f=this.getFilterType(r);this.gridLayout&&""===u.innerHTML&&f!==this.fltTypeInp&&((f===this.fltTypeSlc||f===this.fltTypeMulti)&&t.dropdown.build(r),f===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.popUpFilters&&(this.headersRow++,t.popupFilter.buildAll()),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{key:"_containsStr",value:function(t,e,s,i){var a=void 0,l=this.caseSensitive?"g":"gi",n=i?i:this.exactMatch;return a=n||s!==this.fltTypeInp&&s?new RegExp("(^\\s*)"+u["default"].rgxEsc(t)+"(\\s*$)",l):new RegExp(u["default"].rgxEsc(t),l),a.test(e)}},{key:"isImported",value:function(t,e){for(var s=!1,i=e?e:"script",a="script"==i?"src":"href",l=h["default"].tag(A,i),n=0,r=l.length;r>n;n++)if(void 0!==l[n][a]&&l[n][a].match(t)){s=!0;break}return s}},{key:"import",value:function(t,e,s,i){var a=i?i:"script",l=this.isImported(e,a);if(!l){var n=this,r=!1,o=void 0,d=h["default"].tag(A,"head")[0];o="link"===u["default"].lower(a)?h["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):h["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,"function"==typeof s&&s.call(null,n))},o.onerror=function(){throw new Error("TF script could not load: "+e)},d.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},create:function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;i0){var i=document.cookie,a=i.indexOf(s);if(-1!==a){a+=s.length;var l=i.indexOf(";",a);-1===l&&(l=i.length),e=unescape(i.substring(a,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"==typeof window[t]&&(e=!0):t&&"object"==typeof t&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i},isNull:function(t){return null===t},isEmpty:function(t){return this.isUndef(t)||this.isNull(t)||0===t.length}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(4),l=i(a);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,a=0;a2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function a(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,a=void 0;if("Y"==e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,a=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"==e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,a=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,a=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&a.test(t)===!1)return!1;var l=t.split(RegExp.$1),n=void 0,r=void 0,o=void 0;n="M"===e.substring(0,1)?l[0]:"M"===e.substring(1,2)?l[1]:l[2],r="D"===e.substring(0,1)?l[0]:"D"===e.substring(1,2)?l[1]:l[2],o="Y"===e.substring(0,1)?l[0]:"Y"===e.substring(1,2)?l[1]:l[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var h=new Date(parseInt(o,10),parseInt(n,10)-1,parseInt(r,10),0,0,0,0);return parseInt(r,10)!=h.getDate()?!1:parseInt(n,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),s=new Date(i(l[2]),a(l[1])-1,l[0]);break;case"DMY":l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(l[2]),l[1]-1,l[0]);break;case"MDY":l=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(l[2]),l[0]-1,l[1]);break;case"YMD":l=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),s=new Date(i(l[0]),l[1]-1,l[2]);break;default:l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(l[2]),l[1]-1,l[0])}return s}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var a=s(4),l=i(a);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===l["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s0&&i.removeChild(T[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(0,this.headTbl),i.style.width="",this.headTbl.style.width=i.clientWidth+"px",u["default"].add(this.tblCont,"scroll",function(e){var s=u["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i});var R=(s.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=g),this.tblHasColTag=r["default"].tag(i,"col").length>0?!0:!1;var F=function(){for(var t=e.nbCells-1;t>=0;t--){var s=r["default"].create("col",["id",e.id+"_col_"+t]);i.insertBefore(s,i.firstChild),s.style.width=e.colWidths[t],this.gridColElms[t]=s}this.tblHasColTag=!0};if(this.tblHasColTag)for(var P=r["default"].tag(i,"col"),I=0;I',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=r["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=r["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=r["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=r["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.tf=t}return l(e,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,a=parseInt(i.getAttribute("ci"),10);if(this.closeAll(a),this.toggle(a),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[a],n=this.tf.getHeaderElement(a),r=.95*n.clientWidth;l.style.width=parseInt(r,10)+"px"}u["default"].cancel(s),u["default"].stop(s)}},{key:"init",value:function(){for(var t=this,e=this.tf,s=0;sy;y++)if(t===y&&(!e||e&&a.disableExcludedOptions)||t==y&&e&&(""===o[m].style.display&&!a.paging||a.paging&&(!a.validRowsIndex||a.validRowsIndex&&h["default"].has(a.validRowsIndex,m))&&(void 0===f||f==t||f!=t&&h["default"].has(a.validRowsIndex,m)))){var w=a.getCellData(y,_[y]),x=u["default"].matchCase(w,d);if(h["default"].has(this.opts,x,d)||this.opts.push(w),e&&a.disableExcludedOptions){var k=b[y];k||(k=a.getFilteredDataCol(y)),h["default"].has(k,x,d)||h["default"].has(v,x,d)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var T=a.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(a.sortSlc&&!this.isCustom&&(d?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),a.sortNumAsc&&h["default"].has(a.sortNumAsc,t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&h["default"].has(a.sortNumDesc,t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,n,e,v,p,g)}}},{key:"addOptions",value:function(t,e,s,i,a,l){var n=this.tf,o=u["default"].lower(this.slcFillingMethod),d=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var f=0;f"+p+""}else{var b;b=n.fillSlcOnDemand&&d===this.opts[f]&&n["col"+t]===n.fltTypeSlc?r["default"].createOpt(p,c,!0):n["col"+t]!==n.fltTypeMulti?r["default"].createOpt(p,c," "!==a[t]&&c===a[t]?!0:!1):r["default"].createOpt(p,c,h["default"].has(l,u["default"].matchCase(this.opts[f],n.matchCase),n.matchCase)||-1!==l.toString().indexOf(c)?!0:!1),g&&(b.disabled=!0),e.appendChild(b)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=u["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=r["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var a=r["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(a)}if(e.enableNonEmptyOption){var l=r["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}}]),t}();e.Dropdown=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!a.linkedFilters||a.linkedFilters&&a.disableExcludedOptions)||t===_&&a.linkedFilters&&(""===d[v].style.display&&!a.paging||a.paging&&(!f||f===t||f!=t&&h["default"].has(a.validRowsIndex,v)))){var C=a.getCellData(_,b[_]),y=u["default"].matchCase(C,a.matchCase);h["default"].has(this.opts,y,a.matchCase)||this.opts.push(C);var w=p[_];a.linkedFilters&&a.disableExcludedOptions&&(w||(w=a.getFilteredDataCol(_)),h["default"].has(w,y,a.matchCase)||h["default"].has(this.excludedOpts,y,a.matchCase)||a.isFirstLoad||this.excludedOpts.push(C))}}if(this.isCustom){var x=a.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(a.sortSlc&&!this.isCustom&&(a.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(c["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(c["default"].ignoreCase))),a.sortNumAsc&&h["default"].has(a.sortNumAsc,t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&h["default"].has(a.sortNumDesc,t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,o,a.separator),a.fillSlcOnDemand&&(n.innerHTML=""),n.appendChild(o),n.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,a=this.addTChecks(t,e),l=[],n=i.feature("store"),o=n?n.getFilterValues(i.fltsValuesCookie)[t]:null;o&&u["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&h["default"].has(i.customSlcOptions.cols,t)?l.push(o):l=o.split(" "+i.orOperator+" "));for(var d=0;d0?1:0),l=a+i.pagingLength-1<=e.nbVisibleRows?a+i.pagingLength-1:e.nbVisibleRows;s=a+this.fromToTextSeparator+l+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows-(e.hasVisibleRows?e.visibleRows.length:0);this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{key:"destroy",value:function(){var t=this.tf;t.hasGrid()&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):r["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=d},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s",this.btnPrevPageText=s.btn_prev_page_text||"<",this.btnLastPageText=s.btn_last_page_text||">|",this.btnFirstPageText=s.btn_first_page_text||"|<",this.btnNextPageHtml=s.btn_next_page_html||(e.enableIcons?'':null),this.btnPrevPageHtml=s.btn_prev_page_html||(e.enableIcons?'':null),this.btnFirstPageHtml=s.btn_first_page_html||(e.enableIcons?'':null),this.btnLastPageHtml=s.btn_last_page_html||(e.enableIcons?'':null),this.pageText=s.page_text||" Page ",this.ofText=s.of_text||" of ",this.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",this.hasPagingBtns=s.paging_btns===!1?!1:!0,this.pageSelectorType=s.page_selector_type||e.fltTypeSlc,this.onBeforeChangePage=h["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=h["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_";var i=this.refRow,l=this.nbRows;this.nbPages=Math.ceil((l-i)/this.pagingLength);var n=this;this.evt={slcIndex:function(){return n.pageSelectorType===e.fltTypeSlc?n.pagingSlc.options.selectedIndex:parseInt(n.pagingSlc.value,10)-1},nbOpts:function(){return n.pageSelectorType===e.fltTypeSlc?parseInt(n.pagingSlc.options.length,10)-1:n.nbPages-1},next:function(){var t=n.evt.slcIndex()0?n.evt.slcIndex()-1:n.evt.nbOpts();n.changePage(t)},last:function(){n.changePage(n.evt.nbOpts())},first:function(){n.changePage(0)},_detectKey:function(t){var s=c["default"].keyCode(t);13===s&&(e.sorted?(e.filter(),n.changePage(n.evt.slcIndex())):n.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return l(t,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){e.changePage(),t.target.blur()},this.pageSelectorType===s.fltTypeSlc&&(t=r["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,c["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=r["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,c["default"].add(t,"keypress",i._detectKey));var a=r["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),l=r["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),n=r["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),o=r["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)a.innerHTML=this.btnNextPageHtml,c["default"].add(a,"click",i.next);else{var h=r["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);h.className=this.btnPageCssClass,c["default"].add(h,"click",i.next),a.appendChild(h)}if(this.btnPrevPageHtml)l.innerHTML=this.btnPrevPageHtml,c["default"].add(l,"click",i.prev);else{var d=r["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);d.className=this.btnPageCssClass,c["default"].add(d,"click",i.prev),l.appendChild(d)}if(this.btnLastPageHtml)n.innerHTML=this.btnLastPageHtml,c["default"].add(n,"click",i.last);else{var u=r["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,c["default"].add(u,"click",i.last),n.appendChild(u)}if(this.btnFirstPageHtml)o.innerHTML=this.btnFirstPageHtml,c["default"].add(o,"click",i.first);else{var f=r["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);f.className=this.btnPageCssClass,c["default"].add(f,"click",i.first),o.appendChild(f)}}this.pagingTgtId||s.setToolbar();var p=this.pagingTgtId?r["default"].id(this.pagingTgtId):s.mDiv;p.appendChild(o),p.appendChild(l);var g=r["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(r["default"].text(this.pageText)),g.className=this.nbPgSpanCssClass,p.appendChild(g),p.appendChild(t);var v=r["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(r["default"].text(this.ofText)),v.className=this.nbPgSpanCssClass,p.appendChild(v);var b=r["default"].create("span",["id",this.prfxPgSpan+s.id]);b.className=this.nbPgSpanCssClass,b.appendChild(r["default"].text(" "+this.nbPages+" ")),p.appendChild(b),p.appendChild(a),p.appendChild(n),this.pagingSlc=r["default"].id(this.prfxSlcPages+s.id),(!s.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),s.fltGrid||(s.validateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.isPagingRemoved=!1}},{key:"reset",value:function(){var t=void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!e.paging&&(e.paging=!0,this.isPagingRemoved=!0,this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(){var t=void 0===arguments[0]?[]:arguments[0],e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?r["default"].id(this.pagingTgtId):e.mDiv,a=r["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t,0===t.length)for(var l=e.refRow;l0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var d=0;dl;l++){var r=e.validRowsIndex[l],o=i[r],d=o.getAttribute("validRow");l>=this.startPagingRow&&a>l?((h["default"].isNull(d)||Boolean(d))&&(o.style.display=""),e.alternateBgs&&s&&s.setRowBg(r,l)):(o.style.display="none",e.alternateBgs&&s&&s.removeRowBg(r))}e.nbVisibleRows=e.validRowsIndex.length,e.applyProps()}},{key:"getPage",value:function(){return this.currentPageNb}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&e.paging){var s=this.evt,i=typeof t;if("string"===i)switch(u["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=r["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var a=this.resultsPerPage[0],l=this.resultsPerPage[1],n=r["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);n.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var o=this.resultsPerPageTgtId?r["default"].id(this.resultsPerPageTgtId):e.rDiv;n.appendChild(r["default"].text(a));var h=e.feature("help");h&&h.cont?(h.cont.parentNode.insertBefore(n,h.cont),h.cont.parentNode.insertBefore(i,h.cont)):(o.appendChild(n),o.appendChild(i));for(var d=0;d=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.feature("store").savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(t.paging){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.feature("store").savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.feature("store").getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(e.paging){var s=e.feature("store").getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()){var e=r["default"].id(this.prfxBtnNextSpan+t.id),s=r["default"].id(this.prfxBtnPrevSpan+t.id),i=r["default"].id(this.prfxBtnLastSpan+t.id),a=r["default"].id(this.prfxBtnFirstSpan+t.id),l=r["default"].id(this.prfxPgBeforeSpan+t.id),n=r["default"].id(this.prfxPgAfterSpan+t.id),o=r["default"].id(this.prfxPgSpan+t.id),h=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?c["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&c["default"].remove(this.pagingSlc,"keypress",h._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(c["default"].remove(e,"click",h.next),e.parentNode.removeChild(e)),s&&(c["default"].remove(s,"click",h.prev),s.parentNode.removeChild(s)),i&&(c["default"].remove(i,"click",h.last),i.parentNode.removeChild(i)),a&&(c["default"].remove(a,"click",h.first),a.parentNode.removeChild(a)),l&&l.parentNode.removeChild(l),n&&n.parentNode.removeChild(n),o&&o.parentNode.removeChild(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return l(t,[{key:"onClick",value:function(){this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(e.hasGrid()||e.isFirstLoad||!e.btnResetEl){var s=r["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?r["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var a=s.firstChild;h["default"].add(a,"click",function(){t.onClick()})}else{var l=r["default"].create("a",["href","javascript:void(0);"]);l.className=e.btnResetCssClass,l.appendChild(r["default"].text(this.btnResetText)),s.appendChild(l),h["default"].add(l,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=r["default"].id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=d},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more:
https://github.com/koalyptus/TableFilter/wiki/4.-Filter-operators
',this.instrHtml=s.help_instructions_html||null,this.btnText=s.help_instructions_btn_text||"?",this.btnHtml=s.help_instructions_btn_html||null,this.btnCssClass=s.help_instructions_btn_css_class||"helpBtn",this.contCssClass=s.help_instructions_container_css_class||"helpCont",this.btn=null,this.cont=null,this.defaultHtml='

TableFilter v. '+e.version+'

https://github.com/koalyptus/TableFilter/
©2015-'+e.year+' Max Guglielmi.
',this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.tf=e}return l(t,[{key:"init",value:function(){var t=this;if(!this.btn){var e=this.tf,s=r["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=r["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var a=this.tgtId?r["default"].id(this.tgtId):e.rDiv;a.appendChild(s);var l=this.contTgtId?r["default"].id(this.contTgtId):s;if(this.btnHtml){s.innerHTML=this.btnHtml;var n=s.firstChild;h["default"].add(n,"click",function(){t.toggle()}),l.appendChild(i)}else{l.appendChild(i);var o=r["default"].create("a",["href","javascript:void(0);"]);o.className=this.btnCssClass,o.appendChild(r["default"].text(this.btnText)),s.appendChild(o),h["default"].add(o,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(i),i.innerHTML=this.instrHtml,this.contTgtId||(i.className=this.contCssClass,h["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.instrText,i.className=this.contCssClass,h["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.defaultHtml,h["default"].add(i,"click",function(){t.toggle()}),this.cont=i,this.btn=s}}},{key:"toggle",value:function(){if(this.cont){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}}},{key:"destroy",value:function(){this.btn&&(this.btn.parentNode.removeChild(this.btn),this.btn=null,this.cont&&(this.cont.parentNode.removeChild(this.cont),this.cont=null))}}]),t}();e.Help=d},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;sn;n++){var r=s?n:e[n];this.setRowBg(r,l),l++}}},{key:"setRowBg",value:function(t,e){if(this.tf.alternateBgs&&!isNaN(t)){var s=this.tf.tbl.rows,i=isNaN(e)?t:e;this.removeRowBg(t),r["default"].addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;r["default"].removeClass(e[t],this.oddCss),r["default"].removeClass(e[t],this.evenCss)}}},{key:"remove",value:function(){if(this.tf.hasGrid())for(var t=this.tf.refRow;ts?-1:s>i?1:0}},t.exports=e["default"]}])}); \ No newline at end of file + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var _Cookie = __webpack_require__(5); + + var _Cookie2 = _interopRequireDefault(_Cookie); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var _DateHelper = __webpack_require__(8); + + var _DateHelper2 = _interopRequireDefault(_DateHelper); + + var _Helpers = __webpack_require__(9); + + var _Helpers2 = _interopRequireDefault(_Helpers); + + // Features + + var _Store = __webpack_require__(10); + + var _GridLayout = __webpack_require__(11); + + var _Loader = __webpack_require__(12); + + var _HighlightKeyword = __webpack_require__(13); + + var _PopupFilter = __webpack_require__(14); + + var _Dropdown = __webpack_require__(15); + + var _CheckList = __webpack_require__(16); + + var _RowsCounter = __webpack_require__(17); + + var _StatusBar = __webpack_require__(18); + + var _Paging = __webpack_require__(19); + + var _ClearButton = __webpack_require__(20); + + var _Help = __webpack_require__(21); + + var _AlternateRows = __webpack_require__(22); + + var global = window, + isValidDate = _DateHelper2['default'].isValid, + formatDate = _DateHelper2['default'].format, + doc = global.document; + + var TableFilter = (function () { + + /** + * TF object constructor + * @param {String} id Table id + * @param {Number} row index indicating the 1st row + * @param {Object} configuration object + * + * TODO: Accept a TABLE element or query selectors + */ + + function TableFilter(id) { + _classCallCheck(this, TableFilter); + + if (arguments.length === 0) { + return; + } + + this.id = id; + this.version = '0.0.0'; + this.year = new Date().getFullYear(); + this.tbl = _Dom2['default'].id(id); + this.startRow = null; + this.refRow = null; + this.headersRow = null; + this.cfg = {}; + this.nbFilterableRows = null; + this.nbRows = null; + this.nbCells = null; + this._hasGrid = false; + this.enableModules = false; + + if (!this.tbl || this.tbl.nodeName != 'TABLE' || this.getRowsNb() === 0) { + throw new Error('Could not instantiate TableFilter: HTML table not found.'); + } + + if (arguments.length > 1) { + for (var i = 0, len = arguments.length; i < len; i++) { + var arg = arguments[i]; + var argtype = typeof arg; + switch (_Str2['default'].lower(argtype)) { + case 'number': + this.startRow = arg; + break; + case 'object': + this.cfg = arg; + break; + } + } + } + + // configuration object + var f = this.cfg; + + //Start row et cols nb + this.refRow = this.startRow === null ? 2 : this.startRow + 1; + try { + this.nbCells = this.getCellsNb(this.refRow); + } catch (e) { + this.nbCells = this.getCellsNb(0); + } + + //default script base path + this.basePath = f.base_path || 'tablefilter/'; + + /*** filter types ***/ + this.fltTypeInp = 'input'; + this.fltTypeSlc = 'select'; + this.fltTypeMulti = 'multiple'; + this.fltTypeCheckList = 'checklist'; + this.fltTypeNone = 'none'; + + /*** filters' grid properties ***/ + + //enables/disables filter grid + this.fltGrid = f.grid === false ? false : true; + + /*** Grid layout ***/ + //enables/disables grid layout (fixed headers) + this.gridLayout = Boolean(f.grid_layout); + this.sourceTblHtml = null; + if (this.gridLayout) { + this.sourceTblHtml = this.tbl.outerHTML; + } + /*** ***/ + + this.filtersRowIndex = f.filters_row_index || 0; + this.headersRow = f.headers_row_index || (this.filtersRowIndex === 0 ? 1 : 0); + + if (this.gridLayout) { + if (this.headersRow > 1) { + this.filtersRowIndex = this.headersRow + 1; + } else { + this.filtersRowIndex = 1; + this.headersRow = 0; + } + } + + //defines tag of the cells containing filters (td/th) + this.fltCellTag = f.filters_cell_tag !== 'th' || f.filters_cell_tag !== 'td' ? 'td' : f.filters_cell_tag; + + //stores filters ids + this.fltIds = []; + //stores filters DOM elements + this.fltElms = []; + //stores filters values + this.searchArgs = null; + //stores table data + this.tblData = []; + //stores valid rows indexes (rows visible upon filtering) + this.validRowsIndex = null; + //stores filters row element + this.fltGridEl = null; + //is first load boolean + this.isFirstLoad = true; + //container div for paging elements, reset btn etc. + this.infDiv = null; + //div for rows counter + this.lDiv = null; + //div for reset button and results per page select + this.rDiv = null; + //div for paging elements + this.mDiv = null; + + //defines css class for div containing paging elements, rows counter etc + this.infDivCssClass = f.inf_div_css_class || 'inf'; + //defines css class for left div + this.lDivCssClass = f.left_div_css_class || 'ldiv'; + //defines css class for right div + this.rDivCssClass = f.right_div_css_class || 'rdiv'; + //defines css class for mid div + this.mDivCssClass = f.middle_div_css_class || 'mdiv'; + //table container div css class + this.contDivCssClass = f.content_div_css_class || 'cont'; + + /*** filters' grid appearance ***/ + //stylesheet file + this.stylePath = f.style_path || this.basePath + 'style/'; + this.stylesheet = f.stylesheet || this.stylePath + 'tablefilter.css'; + this.stylesheetId = this.id + '_style'; + //defines css class for filters row + this.fltsRowCssClass = f.flts_row_css_class || 'fltrow'; + //enables/disables icons (paging, reset button) + this.enableIcons = f.enable_icons === false ? false : true; + //enables/disbles rows alternating bg colors + this.alternateBgs = Boolean(f.alternate_rows); + //defines widths of columns + this.hasColWidths = _Types2['default'].isArray(f.col_widths); + this.colWidths = this.hasColWidths ? f.col_widths : null; + //defines css class for filters + this.fltCssClass = f.flt_css_class || 'flt'; + //defines css class for multiple selects filters + this.fltMultiCssClass = f.flt_multi_css_class || 'flt_multi'; + //defines css class for filters + this.fltSmallCssClass = f.flt_small_css_class || 'flt_s'; + //defines css class for single-filter + this.singleFltCssClass = f.single_flt_css_class || 'single_flt'; + + /*** filters' grid behaviours ***/ + //enables/disables enter key + this.enterKey = f.enter_key === false ? false : true; + //calls function before filtering starts + this.onBeforeFilter = _Types2['default'].isFn(f.on_before_filter) ? f.on_before_filter : null; + //calls function after filtering + this.onAfterFilter = _Types2['default'].isFn(f.on_after_filter) ? f.on_after_filter : null; + //enables/disables case sensitivity + this.caseSensitive = Boolean(f.case_sensitive); + //enables/disbles exact match for search + this.exactMatch = Boolean(f.exact_match); + //refreshes drop-down lists upon validation + this.linkedFilters = Boolean(f.linked_filters); + //wheter excluded options are disabled + this.disableExcludedOptions = Boolean(f.disable_excluded_options); + //stores active filter element + this.activeFlt = null; + //id of active filter + this.activeFilterId = null; + //enables always visible rows + this.hasVisibleRows = Boolean(f.rows_always_visible); + //array containing always visible rows + this.visibleRows = this.hasVisibleRows ? f.rows_always_visible : []; + //enables/disables external filters generation + this.isExternalFlt = Boolean(f.external_flt_grid); + //array containing ids of external elements containing filters + this.externalFltTgtIds = f.external_flt_grid_ids || null; + //stores filters elements if isExternalFlt is true + this.externalFltEls = []; + //delays any filtering process if loader true + this.execDelay = !isNaN(f.exec_delay) ? parseInt(f.exec_delay, 10) : 100; + //calls function when filters grid loaded + this.onFiltersLoaded = _Types2['default'].isFn(f.on_filters_loaded) ? f.on_filters_loaded : null; + //enables/disables single filter search + this.singleSearchFlt = Boolean(f.single_search_filter); + //calls function after row is validated + this.onRowValidated = _Types2['default'].isFn(f.on_row_validated) ? f.on_row_validated : null; + //array defining columns for customCellData event + this.customCellDataCols = f.custom_cell_data_cols ? f.custom_cell_data_cols : []; + //calls custom function for retrieving cell data + this.customCellData = _Types2['default'].isFn(f.custom_cell_data) ? f.custom_cell_data : null; + //input watermark text array + this.watermark = f.watermark || ''; + this.isWatermarkArray = _Types2['default'].isArray(this.watermark); + //id of toolbar container element + this.toolBarTgtId = f.toolbar_target_id || null; + //enables/disables help div + this.helpInstructions = _Types2['default'].isUndef(f.help_instructions) ? undefined : Boolean(f.help_instructions); + //popup filters + this.popUpFilters = Boolean(f.popup_filters); + //active columns color + this.markActiveColumns = Boolean(f.mark_active_columns); + //defines css class for active column header + this.activeColumnsCssClass = f.active_columns_css_class || 'activeHeader'; + //calls function before active column header is marked + this.onBeforeActiveColumn = _Types2['default'].isFn(f.on_before_active_column) ? f.on_before_active_column : null; + //calls function after active column header is marked + this.onAfterActiveColumn = _Types2['default'].isFn(f.on_after_active_column) ? f.on_after_active_column : null; + + /*** select filter's customisation and behaviours ***/ + //defines 1st option text + this.displayAllText = f.display_all_text || 'Clear'; + //enables/disables empty option in combo-box filters + this.enableEmptyOption = Boolean(f.enable_empty_option); + //defines empty option text + this.emptyText = f.empty_text || '(Empty)'; + //enables/disables non empty option in combo-box filters + this.enableNonEmptyOption = Boolean(f.enable_non_empty_option); + //defines empty option text + this.nonEmptyText = f.non_empty_text || '(Non empty)'; + //enables/disables onChange event on combo-box + this.onSlcChange = f.on_change === false ? false : true; + //enables/disables select options sorting + this.sortSlc = f.sort_select === false ? false : true; + //enables/disables ascending numeric options sorting + this.isSortNumAsc = Boolean(f.sort_num_asc); + this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : null; + //enables/disables descending numeric options sorting + this.isSortNumDesc = Boolean(f.sort_num_desc); + this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : null; + //enabled selects are populated on demand + this.fillSlcOnDemand = Boolean(f.fill_slc_on_demand); + this.hasCustomOptions = _Types2['default'].isObj(f.custom_options); + this.customOptions = f.custom_options; + + /*** Filter operators ***/ + this.rgxOperator = f.regexp_operator || 'rgx:'; + this.emOperator = f.empty_operator || '[empty]'; + this.nmOperator = f.nonempty_operator || '[nonempty]'; + this.orOperator = f.or_operator || '||'; + this.anOperator = f.and_operator || '&&'; + this.grOperator = f.greater_operator || '>'; + this.lwOperator = f.lower_operator || '<'; + this.leOperator = f.lower_equal_operator || '<='; + this.geOperator = f.greater_equal_operator || '>='; + this.dfOperator = f.different_operator || '!'; + this.lkOperator = f.like_operator || '*'; + this.eqOperator = f.equal_operator || '='; + this.stOperator = f.start_with_operator || '{'; + this.enOperator = f.end_with_operator || '}'; + this.curExp = f.cur_exp || '^[¥£€$]'; + this.separator = f.separator || ','; + + /*** rows counter ***/ + //show/hides rows counter + this.rowsCounter = Boolean(f.rows_counter); + + /*** status bar ***/ + //show/hides status bar + this.statusBar = Boolean(f.status_bar); + + /*** loader ***/ + //enables/disables loader/spinner indicator + this.loader = Boolean(f.loader); + + /*** validation - reset buttons/links ***/ + //show/hides filter's validation button + this.displayBtn = Boolean(f.btn); + //defines validation button text + this.btnText = f.btn_text || (!this.enableIcons ? 'Go' : ''); + //defines css class for validation button + this.btnCssClass = f.btn_css_class || (!this.enableIcons ? 'btnflt' : 'btnflt_icon'); + //show/hides reset link + this.btnReset = Boolean(f.btn_reset); + //defines css class for reset button + this.btnResetCssClass = f.btn_reset_css_class || 'reset'; + //callback function before filters are cleared + this.onBeforeReset = _Types2['default'].isFn(f.on_before_reset) ? f.on_before_reset : null; + //callback function after filters are cleared + this.onAfterReset = _Types2['default'].isFn(f.on_after_reset) ? f.on_after_reset : null; + + /*** paging ***/ + //enables/disables table paging + this.paging = Boolean(f.paging); + this.nbVisibleRows = 0; //nb visible rows + this.nbHiddenRows = 0; //nb hidden rows + + /*** autofilter on typing ***/ + //enables/disables auto filtering, table is filtered when user stops + //typing + this.autoFilter = Boolean(f.auto_filter); + //onkeyup delay timer (msecs) + this.autoFilterDelay = !isNaN(f.auto_filter_delay) ? f.auto_filter_delay : 900; + //typing indicator + this.isUserTyping = null; + this.autoFilterTimer = null; + + /*** keyword highlighting ***/ + //enables/disables keyword highlighting + this.highlightKeywords = Boolean(f.highlight_keywords); + + /*** data types ***/ + //defines default date type (european DMY) + this.defaultDateType = f.default_date_type || 'DMY'; + //defines default thousands separator + //US = ',' EU = '.' + this.thousandsSeparator = f.thousands_separator || ','; + //defines default decimal separator + //US & javascript = '.' EU = ',' + this.decimalSeparator = f.decimal_separator || '.'; + //enables number format per column + this.hasColNbFormat = _Types2['default'].isArray(f.col_number_format); + //array containing columns nb formats + this.colNbFormat = this.hasColNbFormat ? f.col_number_format : null; + //enables date type per column + this.hasColDateType = _Types2['default'].isArray(f.col_date_type); + //array containing columns date type + this.colDateType = this.hasColDateType ? f.col_date_type : null; + + /*** status messages ***/ + //filtering + this.msgFilter = f.msg_filter || 'Filtering data...'; + //populating drop-downs + this.msgPopulate = f.msg_populate || 'Populating filter...'; + //populating drop-downs + this.msgPopulateCheckList = f.msg_populate_checklist || 'Populating list...'; + //changing paging page + this.msgChangePage = f.msg_change_page || 'Collecting paging data...'; + //clearing filters + this.msgClear = f.msg_clear || 'Clearing filters...'; + //changing nb results/page + this.msgChangeResults = f.msg_change_results || 'Changing results per page...'; + //re-setting grid values + this.msgResetValues = f.msg_reset_grid_values || 'Re-setting filters values...'; + //re-setting page + this.msgResetPage = f.msg_reset_page || 'Re-setting page...'; + //re-setting page length + this.msgResetPageLength = f.msg_reset_page_length || 'Re-setting page length...'; + //table sorting + this.msgSort = f.msg_sort || 'Sorting data...'; + //extensions loading + this.msgLoadExtensions = f.msg_load_extensions || 'Loading extensions...'; + //themes loading + this.msgLoadThemes = f.msg_load_themes || 'Loading theme(s)...'; + + /*** ids prefixes ***/ + //css class name added to table + this.prfxTf = 'TF'; + //filters (inputs - selects) + this.prfxFlt = 'flt'; + //validation button + this.prfxValButton = 'btn'; + //container div for paging elements, rows counter etc. + this.prfxInfDiv = 'inf_'; + //left div + this.prfxLDiv = 'ldiv_'; + //right div + this.prfxRDiv = 'rdiv_'; + //middle div + this.prfxMDiv = 'mdiv_'; + //filter values cookie + this.prfxCookieFltsValues = 'tf_flts_'; + //page nb cookie + this.prfxCookiePageNb = 'tf_pgnb_'; + //page length cookie + this.prfxCookiePageLen = 'tf_pglen_'; + + /*** cookies ***/ + this.hasStoredValues = false; + //remembers filters values on page load + this.rememberGridValues = Boolean(f.remember_grid_values); + //cookie storing filter values + this.fltsValuesCookie = this.prfxCookieFltsValues + this.id; + //remembers page nb on page load + this.rememberPageNb = this.paging && f.remember_page_number; + //cookie storing page nb + this.pgNbCookie = this.prfxCookiePageNb + this.id; + //remembers page length on page load + this.rememberPageLen = this.paging && f.remember_page_length; + //cookie storing page length + this.pgLenCookie = this.prfxCookiePageLen + this.id; + + /*** extensions ***/ + //imports external script + this.extensions = f.extensions; + this.hasExtensions = _Types2['default'].isArray(this.extensions); + + /*** themes ***/ + this.enableDefaultTheme = Boolean(f.enable_default_theme); + //imports themes + this.hasThemes = this.enableDefaultTheme || _Types2['default'].isArray(f.themes); + this.themes = f.themes || []; + //themes path + this.themesPath = f.themes_path || this.stylePath + 'themes/'; + + // Features registry + this.Mod = {}; + + // Extensions registry + this.ExtRegistry = {}; + + /*** TF events ***/ + this.Evt = { + name: { + filter: 'Filter', + dropdown: 'DropDown', + checklist: 'CheckList', + changepage: 'ChangePage', + clear: 'Clear', + changeresultsperpage: 'ChangeResults', + resetvalues: 'ResetValues', + resetpage: 'ResetPage', + resetpagelength: 'ResetPageLength', + loadextensions: 'LoadExtensions', + loadthemes: 'LoadThemes' + }, + + // Detect key + detectKey: function detectKey(e) { + if (!this.enterKey) { + return; + } + var _ev = e || global.event; + if (_ev) { + var key = _Event2['default'].keyCode(_ev); + if (key === 13) { + this.filter(); + _Event2['default'].cancel(_ev); + _Event2['default'].stop(_ev); + } else { + this.isUserTyping = true; + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + } + } + }, + // if auto-filter on, detect user is typing and filter columns + onKeyUp: function onKeyUp(e) { + if (!this.autoFilter) { + return; + } + var _ev = e || global.event; + var key = _Event2['default'].keyCode(_ev); + this.isUserTyping = false; + + function filter() { + /*jshint validthis:true */ + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + if (!this.isUserTyping) { + this.filter(); + this.isUserTyping = null; + } + } + + if (key !== 13 && key !== 9 && key !== 27 && key !== 38 && key !== 40) { + if (this.autoFilterTimer === null) { + this.autoFilterTimer = global.setInterval(filter.bind(this), this.autoFilterDelay); + } + } else { + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + } + }, + // if auto-filter on, detect user is typing + onKeyDown: function onKeyDown() { + if (!this.autoFilter) { + return; + } + this.isUserTyping = true; + }, + // if auto-filter on, clear interval on filter blur + onInpBlur: function onInpBlur() { + if (this.autoFilter) { + this.isUserTyping = false; + global.clearInterval(this.autoFilterTimer); + } + // if(o.ezEditTable){ + // if(o.editable){ + // o.ezEditTable.Editable.Set(); + // } + // if(o.selectable){ + // o.ezEditTable.Selection.Set(); + // } + // } + }, + // set focused text-box filter as active + onInpFocus: function onInpFocus(e) { + var _ev = e || global.event; + var elm = _Event2['default'].target(_ev); + this.activeFilterId = elm.getAttribute('id'); + this.activeFlt = _Dom2['default'].id(this.activeFilterId); + if (this.popUpFilters) { + _Event2['default'].cancel(_ev); + _Event2['default'].stop(_ev); + } + // if(o.ezEditTable){ + // if(o.editable){ + // o.ezEditTable.Editable.Remove(); + // } + // if(o.selectable){ + // o.ezEditTable.Selection.Remove(); + // } + // } + }, + // set focused drop-down filter as active + onSlcFocus: function onSlcFocus(e) { + var _ev = e || global.event; + var elm = _Event2['default'].target(_ev); + this.activeFilterId = elm.getAttribute('id'); + this.activeFlt = _Dom2['default'].id(this.activeFilterId); + // select is populated when element has focus + if (this.fillSlcOnDemand && elm.getAttribute('filled') === '0') { + var ct = elm.getAttribute('ct'); + this.Mod.dropdown._build(ct); + } + if (this.popUpFilters) { + _Event2['default'].cancel(_ev); + _Event2['default'].stop(_ev); + } + }, + // filter columns on drop-down filter change + onSlcChange: function onSlcChange(e) { + if (!this.activeFlt) { + return; + } + var _ev = e || global.event; + if (this.popUpFilters) { + _Event2['default'].stop(_ev); + } + if (this.onSlcChange) { + this.filter(); + } + }, + // fill checklist filter on click if required + onCheckListClick: function onCheckListClick(e) { + var _ev = e || global.event; + var elm = _Event2['default'].target(_ev); + if (this.fillSlcOnDemand && elm.getAttribute('filled') === '0') { + var ct = elm.getAttribute('ct'); + this.Mod.checkList._build(ct); + this.Mod.checkList.checkListDiv[ct].onclick = null; + this.Mod.checkList.checkListDiv[ct].title = ''; + } + }, + // filter when validation button clicked + onBtnClick: function onBtnClick() { + this.filter(); + } + }; + } + + _createClass(TableFilter, [{ + key: 'init', + + /** + * Initialise filtering grid bar behaviours and layout + * + * TODO: decompose in smaller methods + */ + value: function init() { + if (this._hasGrid) { + return; + } + if (!this.tbl) { + this.tbl = _Dom2['default'].id(this.id); + } + if (this.gridLayout) { + this.refRow = this.startRow === null ? 0 : this.startRow; + } + if (this.popUpFilters && (this.filtersRowIndex === 0 && this.headersRow === 1 || this.gridLayout)) { + this.headersRow = 0; + } + + var Mod = this.Mod; + var n = this.singleSearchFlt ? 1 : this.nbCells, + inpclass = undefined; + + //loads stylesheet if not imported + this['import'](this.stylesheetId, this.stylesheet, null, 'link'); + + //loads theme + if (this.hasThemes) { + this._loadThemes(); + } + + if (this.rememberGridValues || this.rememberPageNb || this.rememberPageLen) { + Mod.store = new _Store.Store(this); + } + + if (this.gridLayout) { + Mod.gridLayout = new _GridLayout.GridLayout(this); + Mod.gridLayout.init(); + } + + if (this.loader) { + if (!Mod.loader) { + Mod.loader = new _Loader.Loader(this); + } + } + + if (this.highlightKeywords) { + Mod.highlightKeyword = new _HighlightKeyword.HighlightKeyword(this); + } + + if (this.popUpFilters) { + if (!Mod.popupFilter) { + Mod.popupFilter = new _PopupFilter.PopupFilter(this); + } + Mod.popupFilter.init(); + } + + //filters grid is not generated + if (!this.fltGrid) { + this.refRow = this.refRow - 1; + if (this.gridLayout) { + this.refRow = 0; + } + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.nbFilterableRows + this.refRow; + } else { + if (this.isFirstLoad) { + var fltrow = undefined; + if (!this.gridLayout) { + var thead = _Dom2['default'].tag(this.tbl, 'thead'); + if (thead.length > 0) { + fltrow = thead[0].insertRow(this.filtersRowIndex); + } else { + fltrow = this.tbl.insertRow(this.filtersRowIndex); + } + + if (this.headersRow > 1 && this.filtersRowIndex <= this.headersRow && !this.popUpFilters) { + this.headersRow++; + } + if (this.popUpFilters) { + this.headersRow++; + } + + fltrow.className = this.fltsRowCssClass; + //Disable for grid_layout + if (this.isExternalFlt && (!this.gridLayout || this.popUpFilters)) { + fltrow.style.display = 'none'; + } + } + + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.tbl.rows.length; + + for (var i = 0; i < n; i++) { + // this loop adds filters + + if (this.popUpFilters) { + Mod.popupFilter.build(i); + } + + var fltcell = _Dom2['default'].create(this.fltCellTag), + col = this.getFilterType(i), + externalFltTgtId = this.isExternalFlt && this.externalFltTgtIds ? this.externalFltTgtIds[i] : null; + + if (this.singleSearchFlt) { + fltcell.colSpan = this.nbCells; + } + if (!this.gridLayout) { + fltrow.appendChild(fltcell); + } + inpclass = i == n - 1 && this.displayBtn ? this.fltSmallCssClass : this.fltCssClass; + + //only 1 input for single search + if (this.singleSearchFlt) { + col = this.fltTypeInp; + inpclass = this.singleFltCssClass; + } + + //drop-down filters + if (col === this.fltTypeSlc || col === this.fltTypeMulti) { + if (!Mod.dropdown) { + Mod.dropdown = new _Dropdown.Dropdown(this); + } + var dropdown = Mod.dropdown; + + var slc = _Dom2['default'].create(this.fltTypeSlc, ['id', this.prfxFlt + i + '_' + this.id], ['ct', i], ['filled', '0']); + + if (col === this.fltTypeMulti) { + slc.multiple = this.fltTypeMulti; + slc.title = dropdown.multipleSlcTooltip; + } + slc.className = _Str2['default'].lower(col) === this.fltTypeSlc ? inpclass : this.fltMultiCssClass; // for ie<=6 + + //filter is appended in desired external element + if (externalFltTgtId) { + _Dom2['default'].id(externalFltTgtId).appendChild(slc); + this.externalFltEls.push(slc); + } else { + fltcell.appendChild(slc); + } + + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + + if (!this.fillSlcOnDemand) { + dropdown._build(i); + } + + _Event2['default'].add(slc, 'keypress', this.Evt.detectKey.bind(this)); + _Event2['default'].add(slc, 'change', this.Evt.onSlcChange.bind(this)); + _Event2['default'].add(slc, 'focus', this.Evt.onSlcFocus.bind(this)); + + //1st option is created here since dropdown.build isn't + //invoked + if (this.fillSlcOnDemand) { + var opt0 = _Dom2['default'].createOpt(this.displayAllText, ''); + slc.appendChild(opt0); + } + } + // checklist + else if (col === this.fltTypeCheckList) { + var checkList = undefined; + Mod.checkList = new _CheckList.CheckList(this); + checkList = Mod.checkList; + + var divCont = _Dom2['default'].create('div', ['id', checkList.prfxCheckListDiv + i + '_' + this.id], ['ct', i], ['filled', '0']); + divCont.className = checkList.checkListDivCssClass; + + //filter is appended in desired element + if (externalFltTgtId) { + _Dom2['default'].id(externalFltTgtId).appendChild(divCont); + this.externalFltEls.push(divCont); + } else { + fltcell.appendChild(divCont); + } + + checkList.checkListDiv[i] = divCont; + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + if (!this.fillSlcOnDemand) { + checkList._build(i); + } + + if (this.fillSlcOnDemand) { + _Event2['default'].add(divCont, 'click', this.Evt.onCheckListClick.bind(this)); + divCont.appendChild(_Dom2['default'].text(checkList.activateCheckListTxt)); + } + } else { + //show/hide input + var inptype = col === this.fltTypeInp ? 'text' : 'hidden'; + var inp = _Dom2['default'].create(this.fltTypeInp, ['id', this.prfxFlt + i + '_' + this.id], ['type', inptype], ['ct', i]); + if (inptype !== 'hidden' && this.watermark) { + inp.setAttribute('placeholder', this.isWatermarkArray ? this.watermark[i] || '' : this.watermark); + } + inp.className = inpclass; + _Event2['default'].add(inp, 'focus', this.Evt.onInpFocus.bind(this)); + + //filter is appended in desired element + if (externalFltTgtId) { + _Dom2['default'].id(externalFltTgtId).appendChild(inp); + this.externalFltEls.push(inp); + } else { + fltcell.appendChild(inp); + } + + this.fltIds.push(this.prfxFlt + i + '_' + this.id); + + _Event2['default'].add(inp, 'keypress', this.Evt.detectKey.bind(this)); + _Event2['default'].add(inp, 'keydown', this.Evt.onKeyDown.bind(this)); + _Event2['default'].add(inp, 'keyup', this.Evt.onKeyUp.bind(this)); + _Event2['default'].add(inp, 'blur', this.Evt.onInpBlur.bind(this)); + + if (this.rememberGridValues) { + var flts_values = this.Mod.store.getFilterValues(this.fltsValuesCookie); + if (flts_values[i] != ' ') { + this.setFilterValue(i, flts_values[i], false); + } + } + } + // this adds submit button + if (i == n - 1 && this.displayBtn) { + var btn = _Dom2['default'].create(this.fltTypeInp, ['id', this.prfxValButton + i + '_' + this.id], ['type', 'button'], ['value', this.btnText]); + btn.className = this.btnCssClass; + + //filter is appended in desired element + if (externalFltTgtId) { + _Dom2['default'].id(externalFltTgtId).appendChild(btn); + } else { + fltcell.appendChild(btn); + } + + _Event2['default'].add(btn, 'click', this.Evt.onBtnClick.bind(this)); + } //if + } // for i + } else { + this._resetGrid(); + } //if isFirstLoad + } //if this.fltGrid + + /* Filter behaviours */ + if (this.rowsCounter) { + Mod.rowsCounter = new _RowsCounter.RowsCounter(this); + Mod.rowsCounter.init(); + } + if (this.statusBar) { + Mod.statusBar = new _StatusBar.StatusBar(this); + Mod.statusBar.init(); + } + if (this.paging || Mod.paging) { + if (!Mod.paging) { + Mod.paging = new _Paging.Paging(this); + } + + // TODO: handle both cases in paging init + if (Mod.paging.isPagingRemoved) { + Mod.paging.reset(); + } else { + Mod.paging.init(); + } + } + if (this.btnReset) { + Mod.clearButton = new _ClearButton.ClearButton(this); + Mod.clearButton.init(); + } + if (this.helpInstructions) { + if (!Mod.help) { + Mod.help = new _Help.Help(this); + } + Mod.help.init(); + } + if (this.hasColWidths && !this.gridLayout) { + this.setColWidths(); + } + if (this.alternateBgs) { + Mod.alternateRows = new _AlternateRows.AlternateRows(this); + Mod.alternateRows.init(); + } + + this.isFirstLoad = false; + this._hasGrid = true; + + if (this.rememberGridValues || this.rememberPageLen || this.rememberPageNb) { + this.resetValues(); + } + + //TF css class is added to table + if (!this.gridLayout) { + _Dom2['default'].addClass(this.tbl, this.prfxTf); + } + + if (this.loader) { + Mod.loader.show('none'); + } + + /* Loads extensions */ + if (this.hasExtensions) { + this.initExtensions(); + } + + if (this.onFiltersLoaded) { + this.onFiltersLoaded.call(null, this); + } + } + }, { + key: 'EvtManager', + + /** + * Manages state messages + * @param {String} evt Event name + * @param {Object} cfg Config object + */ + value: function EvtManager(evt) { + var cfg = arguments[1] === undefined ? { slcIndex: null, slcExternal: false, slcId: null, pgIndex: null } : arguments[1]; + + var slcIndex = cfg.slcIndex; + var slcExternal = cfg.slcExternal; + var slcId = cfg.slcId; + var pgIndex = cfg.pgIndex; + var cpt = this.Mod; + + function efx() { + /*jshint validthis:true */ + var ev = this.Evt.name; + + switch (evt) { + case ev.filter: + this._filter(); + break; + case ev.dropdown: + if (this.linkedFilters) { + cpt.dropdown._build(slcIndex, true); + } else { + cpt.dropdown._build(slcIndex, false, slcExternal, slcId); + } + break; + case ev.checklist: + cpt.checkList._build(slcIndex, slcExternal, slcId); + break; + case ev.changepage: + cpt.paging._changePage(pgIndex); + break; + case ev.clear: + this._clearFilters(); + this._filter(); + break; + case ev.changeresultsperpage: + cpt.paging._changeResultsPerPage(); + break; + case ev.resetvalues: + this._resetValues(); + this._filter(); + break; + case ev.resetpage: + cpt.paging._resetPage(this.pgNbCookie); + break; + case ev.resetpagelength: + cpt.paging._resetPageLength(this.pgLenCookie); + break; + case ev.loadextensions: + this._loadExtensions(); + break; + case ev.loadthemes: + this._loadThemes(); + break; + } + if (this.statusBar) { + cpt.statusBar.message(''); + } + if (this.loader) { + cpt.loader.show('none'); + } + } + + if (!this.loader && !this.statusBar && !this.linkedFilters) { + efx.call(this); + } else { + if (this.loader) { + cpt.loader.show(''); + } + if (this.statusBar) { + cpt.statusBar.message(this['msg' + evt]); + } + global.setTimeout(efx.bind(this), this.execDelay); + } + } + }, { + key: 'feature', + + /** + * Return a feature instance for a given name + * @param {String} name Name of the feature + * @return {Object} + */ + value: function feature(name) { + return this.Mod[name]; + } + }, { + key: 'initExtensions', + + /** + * Initialise all the extensions defined in the configuration object + */ + value: function initExtensions() { + var exts = this.extensions; + + for (var i = 0, len = exts.length; i < len; i++) { + var ext = exts[i]; + if (!this.ExtRegistry[ext.name]) { + this.loadExtension(ext); + } + } + } + }, { + key: 'loadExtension', + + /** + * Load an extension module + * @param {Object} ext Extension config object + */ + value: function loadExtension(ext) { + var _this = this; + + if (!ext || !ext.name) { + return; + } + + var name = ext.name; + var path = ext.path; + var modulePath = undefined; + + if (name && path) { + modulePath = ext.path + name; + } else { + name = name.replace('.js', ''); + modulePath = 'extensions/{}/{}'.replace(/{}/g, name); + } + + __webpack_require__.e/* require */(1, function(__webpack_require__) { var __WEBPACK_AMD_REQUIRE_ARRAY__ = [__webpack_require__(1)("./" + modulePath)]; (function (mod) { + var inst = new mod(_this, ext); + inst.init(); + _this.ExtRegistry[name] = inst; + }.apply(null, __WEBPACK_AMD_REQUIRE_ARRAY__));}); + } + }, { + key: 'extension', + + /** + * Get an extension instance + * @param {String} name Name of the extension + * @return {Object} Extension instance + */ + value: function extension(name) { + return this.ExtRegistry[name]; + } + }, { + key: 'hasExtension', + + /** + * Check passed extension name exists + * @param {String} name Name of the extension + * @return {Boolean} + */ + value: function hasExtension(name) { + return !_Types2['default'].isEmpty(this.ExtRegistry[name]); + } + }, { + key: 'destroyExtensions', + + /** + * Destroy all the extensions defined in the configuration object + */ + value: function destroyExtensions() { + var exts = this.extensions; + + for (var i = 0, len = exts.length; i < len; i++) { + var ext = exts[i]; + var extInstance = this.ExtRegistry[ext.name]; + if (extInstance) { + extInstance.destroy(); + this.ExtRegistry[ext.name] = null; + } + } + } + }, { + key: 'loadThemes', + value: function loadThemes() { + this.EvtManager(this.Evt.name.loadthemes); + } + }, { + key: '_loadThemes', + + /** + * Load themes defined in the configuration object + */ + value: function _loadThemes() { + var themes = this.themes; + //Default theme config + if (this.enableDefaultTheme) { + var defaultTheme = { name: 'default' }; + this.themes.push(defaultTheme); + } + if (_Types2['default'].isArray(themes)) { + for (var i = 0, len = themes.length; i < len; i++) { + var theme = themes[i]; + var _name = theme.name; + var path = theme.path; + var styleId = this.prfxTf + _name; + if (_name && !path) { + path = this.themesPath + _name + '/' + _name + '.css'; + } else if (!_name && theme.path) { + _name = 'theme{0}'.replace('{0}', i); + } + + if (!this.isImported(path, 'link')) { + this['import'](styleId, path, null, 'link'); + } + } + } + + //Some elements need to be overriden for default theme + //Reset button + this.btnResetText = null; + this.btnResetHtml = ''; + + //Paging buttons + this.btnPrevPageHtml = ''; + this.btnNextPageHtml = ''; + this.btnFirstPageHtml = ''; + this.btnLastPageHtml = ''; + + //Loader + this.loader = true; + this.loaderHtml = '
'; + this.loaderText = null; + } + }, { + key: 'getStylesheet', + + /** + * Return stylesheet DOM element for a given theme name + * @return {DOMElement} stylesheet element + */ + value: function getStylesheet() { + var name = arguments[0] === undefined ? 'default' : arguments[0]; + + return _Dom2['default'].id(this.prfxTf + name); + } + }, { + key: 'destroy', + + /** + * Destroy filter grid + */ + value: function destroy() { + if (!this._hasGrid) { + return; + } + var rows = this.tbl.rows, + Mod = this.Mod; + + if (this.isExternalFlt && !this.popUpFilters) { + this.removeExternalFlts(); + } + if (this.infDiv) { + this.removeToolbar(); + } + if (this.highlightKeywords) { + Mod.highlightKeyword.unhighlightAll(); + } + if (this.markActiveColumns) { + this.clearActiveColumns(); + } + if (this.hasExtensions) { + this.destroyExtensions(); + } + + //this loop shows all rows and removes validRow attribute + for (var j = this.refRow; j < this.nbRows; j++) { + rows[j].style.display = ''; + + if (rows[j].hasAttribute('validRow')) { + rows[j].removeAttribute('validRow'); + } + + //removes alternating colors + if (this.alternateBgs) { + Mod.alternateRows.removeRowBg(j); + } + } //for j + + if (this.fltGrid && !this.gridLayout) { + this.fltGridEl = rows[this.filtersRowIndex]; + this.tbl.deleteRow(this.filtersRowIndex); + } + + // Destroy modules + Object.keys(Mod).forEach(function (key) { + var feature = Mod[key]; + if (feature && _Types2['default'].isFn(feature.destroy)) { + feature.destroy(); + } + }); + + _Dom2['default'].removeClass(this.tbl, this.prfxTf); + this.activeFlt = null; + this.isStartBgAlternate = true; + this._hasGrid = false; + this.tbl = null; + } + }, { + key: 'setToolbar', + + /** + * Generate container element for paging, reset button, rows counter etc. + */ + value: function setToolbar() { + if (this.infDiv) { + return; + } + + /*** container div ***/ + var infdiv = _Dom2['default'].create('div', ['id', this.prfxInfDiv + this.id]); + infdiv.className = this.infDivCssClass; + + //custom container + if (this.toolBarTgtId) { + _Dom2['default'].id(this.toolBarTgtId).appendChild(infdiv); + } + //grid-layout + else if (this.gridLayout) { + var gridLayout = this.Mod.gridLayout; + gridLayout.tblMainCont.appendChild(infdiv); + infdiv.className = gridLayout.gridInfDivCssClass; + } + //default location: just above the table + else { + var cont = _Dom2['default'].create('caption'); + cont.appendChild(infdiv); + this.tbl.insertBefore(cont, this.tbl.firstChild); + } + this.infDiv = _Dom2['default'].id(this.prfxInfDiv + this.id); + + /*** left div containing rows # displayer ***/ + var ldiv = _Dom2['default'].create('div', ['id', this.prfxLDiv + this.id]); + ldiv.className = this.lDivCssClass; + infdiv.appendChild(ldiv); + this.lDiv = _Dom2['default'].id(this.prfxLDiv + this.id); + + /*** right div containing reset button + + nb results per page select ***/ + var rdiv = _Dom2['default'].create('div', ['id', this.prfxRDiv + this.id]); + rdiv.className = this.rDivCssClass; + infdiv.appendChild(rdiv); + this.rDiv = _Dom2['default'].id(this.prfxRDiv + this.id); + + /*** mid div containing paging elements ***/ + var mdiv = _Dom2['default'].create('div', ['id', this.prfxMDiv + this.id]); + mdiv.className = this.mDivCssClass; + infdiv.appendChild(mdiv); + this.mDiv = _Dom2['default'].id(this.prfxMDiv + this.id); + + // Enable help instructions by default if topbar is generated and not + // explicitely set to false + if (_Types2['default'].isUndef(this.helpInstructions)) { + if (!this.Mod.help) { + this.Mod.help = new _Help.Help(this); + } + this.Mod.help.init(); + this.helpInstructions = true; + } + } + }, { + key: 'removeToolbar', + + /** + * Remove toolbar container element + */ + value: function removeToolbar() { + if (!this.infDiv) { + return; + } + this.infDiv.parentNode.removeChild(this.infDiv); + this.infDiv = null; + + var tbl = this.tbl; + var captions = _Dom2['default'].tag(tbl, 'caption'); + if (captions.length > 0) { + [].forEach.call(captions, function (elm) { + tbl.removeChild(elm); + }); + } + } + }, { + key: 'removeExternalFlts', + + /** + * Remove all the external column filters + */ + value: function removeExternalFlts() { + if (!this.isExternalFlt || !this.externalFltTgtIds) { + return; + } + var ids = this.externalFltTgtIds, + len = ids.length; + for (var ct = 0; ct < len; ct++) { + var externalFltTgtId = ids[ct], + externalFlt = _Dom2['default'].id(externalFltTgtId); + if (externalFlt) { + externalFlt.innerHTML = ''; + } + } + } + }, { + key: 'isCustomOptions', + + /** + * Check if given column implements a filter with custom options + * @param {Number} colIndex Column's index + * @return {Boolean} + */ + value: function isCustomOptions(colIndex) { + return this.hasCustomOptions && this.customOptions.cols.indexOf(colIndex) != -1; + } + }, { + key: 'getCustomOptions', + + /** + * Returns an array [[value0, value1 ...],[text0, text1 ...]] with the + * custom options values and texts + * @param {Number} colIndex Column's index + * @return {Array} + */ + value: function getCustomOptions(colIndex) { + if (!colIndex || !this.isCustomOptions(colIndex)) { + return; + } + + var customOptions = this.customOptions; + var cols = customOptions.cols; + var optTxt = [], + optArray = []; + var index = _Arr2['default'].indexByValue(cols, colIndex); + var slcValues = customOptions.values[index]; + var slcTexts = customOptions.texts[index]; + var slcSort = customOptions.sorts[index]; + + for (var r = 0, len = slcValues.length; r < len; r++) { + optArray.push(slcValues[r]); + if (slcTexts[r]) { + optTxt.push(slcTexts[r]); + } else { + optTxt.push(slcValues[r]); + } + } + if (slcSort) { + optArray.sort(); + optTxt.sort(); + } + return [optArray, optTxt]; + } + }, { + key: 'resetValues', + value: function resetValues() { + this.EvtManager(this.Evt.name.resetvalues); + } + }, { + key: '_resetValues', + + /** + * Reset persisted filter values + */ + value: function _resetValues() { + //only fillSlcOnDemand + if (this.rememberGridValues && this.fillSlcOnDemand) { + this._resetGridValues(this.fltsValuesCookie); + } + if (this.rememberPageLen && this.Mod.paging) { + this.Mod.paging.resetPageLength(this.pgLenCookie); + } + if (this.rememberPageNb && this.Mod.paging) { + this.Mod.paging.resetPage(this.pgNbCookie); + } + } + }, { + key: '_resetGridValues', + + /** + * Reset persisted filter values when load filters on demand feature is + * enabled + * @param {String} name cookie name storing filter values + */ + value: function _resetGridValues(name) { + if (!this.fillSlcOnDemand) { + return; + } + var fltsValues = this.Mod.store.getFilterValues(name), + slcFltsIndex = this.getFiltersByType(this.fltTypeSlc, true), + multiFltsIndex = this.getFiltersByType(this.fltTypeMulti, true); + + //if the number of columns is the same as before page reload + if (Number(fltsValues[fltsValues.length - 1]) === this.fltIds.length) { + for (var i = 0; i < fltsValues.length - 1; i++) { + if (fltsValues[i] === ' ') { + continue; + } + var s = undefined, + opt = undefined; + var fltType = this.getFilterType(i); + // if fillSlcOnDemand, drop-down needs to contain stored + // value(s) for filtering + if (fltType === this.fltTypeSlc || fltType === this.fltTypeMulti) { + var slc = _Dom2['default'].id(this.fltIds[i]); + slc.options[0].selected = false; + + //selects + if (_Arr2['default'].has(slcFltsIndex, i)) { + opt = _Dom2['default'].createOpt(fltsValues[i], fltsValues[i], true); + slc.appendChild(opt); + this.hasStoredValues = true; + } + //multiple select + if (_Arr2['default'].has(multiFltsIndex, i)) { + s = fltsValues[i].split(' ' + this.orOperator + ' '); + for (var j = 0, len = s.length; j < len; j++) { + if (s[j] === '') { + continue; + } + opt = _Dom2['default'].createOpt(s[j], s[j], true); + slc.appendChild(opt); + this.hasStoredValues = true; + } + } // if multiFltsIndex + } else if (fltType === this.fltTypeCheckList) { + var checkList = this.Mod.checkList; + var divChk = checkList.checkListDiv[i]; + divChk.title = divChk.innerHTML; + divChk.innerHTML = ''; + + var ul = _Dom2['default'].create('ul', ['id', this.fltIds[i]], ['colIndex', i]); + ul.className = checkList.checkListCssClass; + + var li0 = _Dom2['default'].createCheckItem(this.fltIds[i] + '_0', '', this.displayAllText); + li0.className = checkList.checkListItemCssClass; + ul.appendChild(li0); + + divChk.appendChild(ul); + + s = fltsValues[i].split(' ' + this.orOperator + ' '); + for (var j = 0, len = s.length; j < len; j++) { + if (s[j] === '') { + continue; + } + var li = _Dom2['default'].createCheckItem(this.fltIds[i] + '_' + (j + 1), s[j], s[j]); + li.className = checkList.checkListItemCssClass; + ul.appendChild(li); + li.check.checked = true; + checkList.setCheckListValues(li.check); + this.hasStoredValues = true; + } + } + } //end for + + if (!this.hasStoredValues && this.paging) { + this.Mod.paging.setPagingInfo(); + } + } //end if + } + }, { + key: 'filter', + value: function filter() { + this.EvtManager(this.Evt.name.filter); + } + }, { + key: '_filter', + + /** + * Filter the table by retrieving the data from each cell in every single + * row and comparing it to the search term for current column. A row is + * hidden when all the search terms are not found in inspected row. + * + * TODO: Reduce complexity of this massive method + */ + value: function _filter() { + if (!this.fltGrid || !this._hasGrid && !this.isFirstLoad) { + return; + } + //invoke onbefore callback + if (this.onBeforeFilter) { + this.onBeforeFilter.call(null, this); + } + + var row = this.tbl.rows, + Mod = this.Mod, + hiddenrows = 0; + + this.validRowsIndex = []; + + // removes keyword highlighting + if (this.highlightKeywords) { + Mod.highlightKeyword.unhighlightAll(); + } + //removes popup filters active icons + if (this.popUpFilters) { + Mod.popupFilter.buildIcons(); + } + //removes active column header class + if (this.markActiveColumns) { + this.clearActiveColumns(); + } + // search args re-init + this.searchArgs = this.getFiltersValue(); + + var num_cell_data, nbFormat; + var re_le = new RegExp(this.leOperator), + re_ge = new RegExp(this.geOperator), + re_l = new RegExp(this.lwOperator), + re_g = new RegExp(this.grOperator), + re_d = new RegExp(this.dfOperator), + re_lk = new RegExp(_Str2['default'].rgxEsc(this.lkOperator)), + re_eq = new RegExp(this.eqOperator), + re_st = new RegExp(this.stOperator), + re_en = new RegExp(this.enOperator), + + // re_an = new RegExp(this.anOperator), + // re_cr = new RegExp(this.curExp), + re_em = this.emOperator, + re_nm = this.nmOperator, + re_re = new RegExp(_Str2['default'].rgxEsc(this.rgxOperator)); + + //keyword highlighting + function highlight(str, ok, cell) { + /*jshint validthis:true */ + if (this.highlightKeywords && ok) { + str = str.replace(re_lk, ''); + str = str.replace(re_eq, ''); + str = str.replace(re_st, ''); + str = str.replace(re_en, ''); + var w = str; + if (re_le.test(str) || re_ge.test(str) || re_l.test(str) || re_g.test(str) || re_d.test(str)) { + w = _Dom2['default'].getText(cell); + } + if (w !== '') { + Mod.highlightKeyword.highlight(cell, w, Mod.highlightKeyword.highlightCssClass); + } + } + } + + //looks for search argument in current row + function hasArg(sA, cell_data, j) { + /*jshint validthis:true */ + var occurence = undefined, + removeNbFormat = _Helpers2['default'].removeNbFormat; + //Search arg operator tests + var hasLO = re_l.test(sA), + hasLE = re_le.test(sA), + hasGR = re_g.test(sA), + hasGE = re_ge.test(sA), + hasDF = re_d.test(sA), + hasEQ = re_eq.test(sA), + hasLK = re_lk.test(sA), + + // hasAN = re_an.test(sA), + hasST = re_st.test(sA), + hasEN = re_en.test(sA), + hasEM = re_em === sA, + hasNM = re_nm === sA, + hasRE = re_re.test(sA); + + //Search arg dates tests + var isLDate = hasLO && isValidDate(sA.replace(re_l, ''), dtType); + var isLEDate = hasLE && isValidDate(sA.replace(re_le, ''), dtType); + var isGDate = hasGR && isValidDate(sA.replace(re_g, ''), dtType); + var isGEDate = hasGE && isValidDate(sA.replace(re_ge, ''), dtType); + var isDFDate = hasDF && isValidDate(sA.replace(re_d, ''), dtType); + var isEQDate = hasEQ && isValidDate(sA.replace(re_eq, ''), dtType); + + var dte1 = undefined, + dte2 = undefined; + //dates + if (isValidDate(cell_data, dtType)) { + dte1 = formatDate(cell_data, dtType); + // lower date + if (isLDate) { + dte2 = formatDate(sA.replace(re_l, ''), dtType); + occurence = dte1 < dte2; + } + // lower equal date + else if (isLEDate) { + dte2 = formatDate(sA.replace(re_le, ''), dtType); + occurence = dte1 <= dte2; + } + // greater equal date + else if (isGEDate) { + dte2 = formatDate(sA.replace(re_ge, ''), dtType); + occurence = dte1 >= dte2; + } + // greater date + else if (isGDate) { + dte2 = formatDate(sA.replace(re_g, ''), dtType); + occurence = dte1 > dte2; + } + // different date + else if (isDFDate) { + dte2 = formatDate(sA.replace(re_d, ''), dtType); + occurence = dte1.toString() != dte2.toString(); + } + // equal date + else if (isEQDate) { + dte2 = formatDate(sA.replace(re_eq, ''), dtType); + occurence = dte1.toString() == dte2.toString(); + } + // searched keyword with * operator doesn't have to be a date + else if (re_lk.test(sA)) { + // like date + occurence = this._containsStr(sA.replace(re_lk, ''), cell_data, null, false); + } else if (isValidDate(sA, dtType)) { + dte2 = formatDate(sA, dtType); + occurence = dte1.toString() == dte2.toString(); + } + //empty + else if (hasEM) { + occurence = _Str2['default'].isEmpty(cell_data); + } + //non-empty + else if (hasNM) { + occurence = !_Str2['default'].isEmpty(cell_data); + } + } else { + //first numbers need to be formated + if (this.hasColNbFormat && this.colNbFormat[j]) { + num_cell_data = removeNbFormat(cell_data, this.colNbFormat[j]); + nbFormat = this.colNbFormat[j]; + } else { + if (this.thousandsSeparator === ',' && this.decimalSeparator === '.') { + num_cell_data = removeNbFormat(cell_data, 'us'); + nbFormat = 'us'; + } else { + num_cell_data = removeNbFormat(cell_data, 'eu'); + nbFormat = 'eu'; + } + } + + // first checks if there is any operator (<,>,<=,>=,!,*,=,{,}, + // rgx:) + // lower equal + if (hasLE) { + occurence = num_cell_data <= removeNbFormat(sA.replace(re_le, ''), nbFormat); + } + //greater equal + else if (hasGE) { + occurence = num_cell_data >= removeNbFormat(sA.replace(re_ge, ''), nbFormat); + } + //lower + else if (hasLO) { + occurence = num_cell_data < removeNbFormat(sA.replace(re_l, ''), nbFormat); + } + //greater + else if (hasGR) { + occurence = num_cell_data > removeNbFormat(sA.replace(re_g, ''), nbFormat); + } + //different + else if (hasDF) { + occurence = this._containsStr(sA.replace(re_d, ''), cell_data) ? false : true; + } + //like + else if (hasLK) { + occurence = this._containsStr(sA.replace(re_lk, ''), cell_data, null, false); + } + //equal + else if (hasEQ) { + occurence = this._containsStr(sA.replace(re_eq, ''), cell_data, null, true); + } + //starts with + else if (hasST) { + occurence = cell_data.indexOf(sA.replace(re_st, '')) === 0 ? true : false; + } + //ends with + else if (hasEN) { + var searchArg = sA.replace(re_en, ''); + occurence = cell_data.lastIndexOf(searchArg, cell_data.length - 1) === cell_data.length - 1 - (searchArg.length - 1) && cell_data.lastIndexOf(searchArg, cell_data.length - 1) > -1 ? true : false; + } + //empty + else if (hasEM) { + occurence = _Str2['default'].isEmpty(cell_data); + } + //non-empty + else if (hasNM) { + occurence = !_Str2['default'].isEmpty(cell_data); + } + //regexp + else if (hasRE) { + //in case regexp fires an exception + try { + //operator is removed + var srchArg = sA.replace(re_re, ''); + var rgx = new RegExp(srchArg); + occurence = rgx.test(cell_data); + } catch (e) { + occurence = false; + } + } else { + occurence = this._containsStr(sA, cell_data, this.getFilterType(j)); + } + } //else + return occurence; + } //fn + + for (var k = this.refRow; k < this.nbRows; k++) { + /*** if table already filtered some rows are not visible ***/ + if (row[k].style.display === 'none') { + row[k].style.display = ''; + } + + var cell = row[k].cells, + nchilds = cell.length; + + // checks if row has exact cell # + if (nchilds !== this.nbCells) { + continue; + } + + var occurence = [], + isRowValid = true, + + //only for single filter search + singleFltRowValid = false; + + // this loop retrieves cell data + for (var j = 0; j < nchilds; j++) { + //searched keyword + var sA = this.searchArgs[this.singleSearchFlt ? 0 : j]; + var dtType = this.hasColDateType ? this.colDateType[j] : this.defaultDateType; + if (sA === '') { + continue; + } + + var cell_data = _Str2['default'].matchCase(this.getCellData(j, cell[j]), this.caseSensitive); + + //multiple search parameter operator || + var sAOrSplit = sA.split(this.orOperator), + + //multiple search || parameter boolean + hasMultiOrSA = sAOrSplit.length > 1 ? true : false, + + //multiple search parameter operator && + sAAndSplit = sA.split(this.anOperator), + + //multiple search && parameter boolean + hasMultiAndSA = sAAndSplit.length > 1 ? true : false; + + //multiple sarch parameters + if (hasMultiOrSA || hasMultiAndSA) { + var cS = undefined, + occur = false, + s = hasMultiOrSA ? sAOrSplit : sAAndSplit; + for (var w = 0, len = s.length; w < len; w++) { + cS = _Str2['default'].trim(s[w]); + occur = hasArg.call(this, cS, cell_data, j); + highlight.call(this, cS, occur, cell[j]); + if (hasMultiOrSA && occur) { + break; + } + if (hasMultiAndSA && !occur) { + break; + } + } + occurence[j] = occur; + } + //single search parameter + else { + occurence[j] = hasArg.call(this, _Str2['default'].trim(sA), cell_data, j); + highlight.call(this, sA, occurence[j], cell[j]); + } //else single param + + if (!occurence[j]) { + isRowValid = false; + } + if (this.singleSearchFlt && occurence[j]) { + singleFltRowValid = true; + } + if (this.popUpFilters) { + Mod.popupFilter.buildIcon(j, true); + } + if (this.markActiveColumns) { + if (k === this.refRow) { + if (this.onBeforeActiveColumn) { + this.onBeforeActiveColumn.call(null, this, j); + } + _Dom2['default'].addClass(this.getHeaderElement(j), this.activeColumnsCssClass); + if (this.onAfterActiveColumn) { + this.onAfterActiveColumn.call(null, this, j); + } + } + } + } //for j + + if (this.singleSearchFlt && singleFltRowValid) { + isRowValid = true; + } + + if (!isRowValid) { + this.validateRow(k, false); + if (Mod.alternateRows) { + Mod.alternateRows.removeRowBg(k); + } + // always visible rows need to be counted as valid + if (this.hasVisibleRows && _Arr2['default'].has(this.visibleRows, k) && !this.paging) { + this.validRowsIndex.push(k); + } else { + hiddenrows++; + } + } else { + this.validateRow(k, true); + this.validRowsIndex.push(k); + if (this.alternateBgs) { + Mod.alternateRows.setRowBg(k, this.validRowsIndex.length); + } + if (this.onRowValidated) { + this.onRowValidated.call(null, this, k); + } + } + } // for k + + this.nbVisibleRows = this.validRowsIndex.length; + this.nbHiddenRows = hiddenrows; + + if (this.rememberGridValues) { + Mod.store.saveFilterValues(this.fltsValuesCookie); + } + //applies filter props after filtering process + if (!this.paging) { + this.applyProps(); + } else { + // Shouldn't need to care of that here... + // TODO: provide a method in paging module + Mod.paging.startPagingRow = 0; + Mod.paging.currentPageNb = 1; + // + Mod.paging.setPagingInfo(this.validRowsIndex); + } + //invokes onafter callback + if (this.onAfterFilter) { + this.onAfterFilter.call(null, this); + } + } + }, { + key: 'applyProps', + + /** + * Re-apply the features/behaviour concerned by filtering/paging operation + * + * NOTE: this will disappear whenever custom events in place + */ + value: function applyProps() { + var Mod = this.Mod; + + //shows rows always visible + if (this.visibleRows) { + this.enforceVisibility(); + } + //columns operations + if (this.hasExtension('colOps')) { + this.extension('colOps').calc(); + } + + //re-populates drop-down filters + if (this.linkedFilters) { + this.linkFilters(); + } + var nr = !this.paging && this.hasVisibleRows ? this.nbVisibleRows - this.visibleRows.length : this.nbVisibleRows; + //refreshes rows counter + if (this.rowsCounter) { + Mod.rowsCounter.refresh(nr); + } + + if (this.popUpFilters) { + Mod.popupFilter.closeAll(); + } + } + }, { + key: 'getColValues', + + /** + * Return the data of a specified colum + * @param {Number} colindex Column index + * @param {Boolean} num Return unformatted number + * @param {Array} exclude List of row indexes to be excluded + * @return {Array} Flat list of data for a column + */ + value: function getColValues(colindex) { + var num = arguments[1] === undefined ? false : arguments[1]; + var exclude = arguments[2] === undefined ? undefined : arguments[2]; + + if (!this.fltGrid) { + return; + } + var row = this.tbl.rows, + colValues = []; + + for (var i = this.refRow; i < this.nbRows; i++) { + var isExludedRow = false; + // checks if current row index appears in exclude array + if (exclude && _Types2['default'].isArray(exclude)) { + isExludedRow = _Arr2['default'].has(exclude, i); + } + var cell = row[i].cells, + nchilds = cell.length; + + // checks if row has exact cell # and is not excluded + if (nchilds === this.nbCells && !isExludedRow) { + // this loop retrieves cell data + for (var j = 0; j < nchilds; j++) { + if (j != colindex || row[i].style.display != '') { + continue; + } + var cell_data = _Str2['default'].lower(this.getCellData(j, cell[j])), + nbFormat = this.colNbFormat ? this.colNbFormat[colindex] : null, + data = num ? _Helpers2['default'].removeNbFormat(cell_data, nbFormat) : cell_data; + colValues.push(data); + } + } + } + return colValues; + } + }, { + key: 'getFilterValue', + + /** + * Return the filter's value of a specified column + * @param {Number} index Column index + * @return {String} Filter value + */ + value: function getFilterValue(index) { + if (!this.fltGrid) { + return; + } + var fltValue = undefined, + flt = this.getFilterElement(index); + if (!flt) { + return ''; + } + // let fltColType = this.fltCol[index]; + var fltColType = this.getFilterType(index); + if (fltColType !== this.fltTypeMulti && fltColType !== this.fltTypeCheckList) { + fltValue = flt.value; + } + //mutiple select + else if (fltColType === this.fltTypeMulti) { + fltValue = ''; + for (var j = 0, len = flt.options.length; j < len; j++) { + if (flt.options[j].selected) { + fltValue = fltValue.concat(flt.options[j].value + ' ' + this.orOperator + ' '); + } + } + //removes last operator || + fltValue = fltValue.substr(0, fltValue.length - 4); + } + //checklist + else if (fltColType === this.fltTypeCheckList) { + if (flt.getAttribute('value') !== null) { + fltValue = flt.getAttribute('value'); + //removes last operator || + fltValue = fltValue.substr(0, fltValue.length - 3); + } else { + fltValue = ''; + } + } + return fltValue; + } + }, { + key: 'getFiltersValue', + + /** + * Return the filters' values + * @return {Array} List of filters' values + */ + value: function getFiltersValue() { + if (!this.fltGrid) { + return; + } + var searchArgs = []; + for (var i = 0, len = this.fltIds.length; i < len; i++) { + searchArgs.push(_Str2['default'].trim(_Str2['default'].matchCase(this.getFilterValue(i), this.caseSensitive))); + } + return searchArgs; + } + }, { + key: 'getFilterId', + + /** + * Return the ID of the filter of a specified column + * @param {Number} index Column's index + * @return {String} ID of the filter element + */ + value: function getFilterId(index) { + if (!this.fltGrid) { + return; + } + return this.fltIds[index]; + } + }, { + key: 'getFiltersByType', + + /** + * Return the list of ids of filters matching a specified type. + * Note: hidden filters are also returned + * + * @param {String} type Filter type string ('input', 'select', 'multiple', + * 'checklist') + * @param {Boolean} bool If true returns columns indexes instead of IDs + * @return {[type]} List of element IDs or column indexes + */ + value: function getFiltersByType(type, bool) { + if (!this.fltGrid) { + return; + } + var arr = []; + for (var i = 0, len = this.fltIds.length; i < len; i++) { + var fltType = this.getFilterType(i); + if (fltType === _Str2['default'].lower(type)) { + var a = bool ? i : this.fltIds[i]; + arr.push(a); + } + } + return arr; + } + }, { + key: 'getFilterElement', + + /** + * Return the filter's DOM element for a given column + * @param {Number} index Column's index + * @return {DOMElement} + */ + value: function getFilterElement(index) { + var fltId = this.fltIds[index]; + return _Dom2['default'].id(fltId); + } + }, { + key: 'getCellsNb', + + /** + * Return the number of cells for a given row index + * @param {Number} rowIndex Index of the row + * @return {Number} Number of cells + */ + value: function getCellsNb() { + var rowIndex = arguments[0] === undefined ? 0 : arguments[0]; + + var tr = this.tbl.rows[rowIndex]; + return tr.cells.length; + } + }, { + key: 'getRowsNb', + + /** + * Return the number of filterable rows starting from reference row if + * defined + * @param {Boolean} includeHeaders Include the headers row + * @return {Number} Number of filterable rows + */ + value: function getRowsNb(includeHeaders) { + var s = _Types2['default'].isUndef(this.refRow) ? 0 : this.refRow, + ntrs = this.tbl.rows.length; + if (includeHeaders) { + s = 0; + } + return parseInt(ntrs - s, 10); + } + }, { + key: 'getCellData', + + /** + * Return the data of a given cell + * @param {Number} i Column's index + * @param {Object} cell Cell's DOM object + * @return {String} + */ + value: function getCellData(i, cell) { + if (_Types2['default'].isUndef(i) || !cell) { + return ''; + } + //First checks for customCellData event + if (this.customCellData && _Arr2['default'].has(this.customCellDataCols, i)) { + return this.customCellData.call(null, this, cell, i); + } else { + return _Dom2['default'].getText(cell); + } + } + }, { + key: 'getTableData', + + /** + * Return the table data with following format: + * [ + * [rowIndex, [value0, value1...]], + * [rowIndex, [value0, value1...]] + * ] + * @return {Array} + * + * TODO: provide an API returning data in JSON format + */ + value: function getTableData() { + var row = this.tbl.rows; + for (var k = this.refRow; k < this.nbRows; k++) { + var rowData = [k, []]; + var cells = row[k].cells; + // this loop retrieves cell data + for (var j = 0, len = cells.length; j < len; j++) { + var cell_data = this.getCellData(j, cells[j]); + rowData[1].push(cell_data); + } + this.tblData.push(rowData); + } + return this.tblData; + } + }, { + key: 'getFilteredData', + + /** + * Return the filtered data with following format: + * [ + * [rowIndex, [value0, value1...]], + * [rowIndex, [value0, value1...]] + * ] + * @param {Boolean} includeHeaders Include headers row + * @return {Array} + * + * TODO: provide an API returning data in JSON format + */ + value: function getFilteredData(includeHeaders) { + if (!this.validRowsIndex) { + return []; + } + var row = this.tbl.rows, + filteredData = []; + if (includeHeaders) { + var table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.tbl, + r = table.rows[this.headersRow], + rowData = [r.rowIndex, []]; + for (var j = 0; j < this.nbCells; j++) { + var headerText = this.getCellData(j, r.cells[j]); + rowData[1].push(headerText); + } + filteredData.push(rowData); + } + + var validRows = this.getValidRows(true); + for (var i = 0; i < validRows.length; i++) { + var rData = [this.validRowsIndex[i], []], + cells = row[this.validRowsIndex[i]].cells; + for (var k = 0; k < cells.length; k++) { + var cell_data = this.getCellData(k, cells[k]); + rData[1].push(cell_data); + } + filteredData.push(rData); + } + return filteredData; + } + }, { + key: 'getFilteredDataCol', + + /** + * Return the filtered data for a given column index + * @param {Number} colIndex Colmun's index + * @return {Array} Flat list of values ['val0','val1','val2'...] + * + * TODO: provide an API returning data in JSON format + */ + value: function getFilteredDataCol(colIndex) { + if (colIndex === undefined) { + return []; + } + var data = this.getFilteredData(), + colData = []; + for (var i = 0, len = data.length; i < len; i++) { + var r = data[i], + + //cols values of current row + d = r[1], + + //data of searched column + c = d[colIndex]; + colData.push(c); + } + return colData; + } + }, { + key: 'getRowDisplay', + + /** + * Get the display value of a row + * @param {RowElement} DOM element of the row + * @return {String} Usually 'none' or '' + */ + value: function getRowDisplay(row) { + if (!this.fltGrid || !_Types2['default'].isObj(row)) { + return; + } + return row.style.display; + } + }, { + key: 'validateRow', + + /** + * Validate/invalidate row by setting the 'validRow' attribute on the row + * @param {Number} rowIndex Index of the row + * @param {Boolean} isValid + */ + value: function validateRow(rowIndex, isValid) { + var row = this.tbl.rows[rowIndex]; + if (!row || typeof isValid !== 'boolean') { + return; + } + + // always visible rows are valid + if (this.hasVisibleRows && _Arr2['default'].has(this.visibleRows, rowIndex) && !this.paging) { + isValid = true; + } + + var displayFlag = isValid ? '' : 'none', + validFlag = isValid ? 'true' : 'false'; + row.style.display = displayFlag; + + if (this.paging) { + row.setAttribute('validRow', validFlag); + } + } + }, { + key: 'validateAllRows', + + /** + * Validate all filterable rows + */ + value: function validateAllRows() { + if (!this._hasGrid) { + return; + } + this.validRowsIndex = []; + for (var k = this.refRow; k < this.nbFilterableRows; k++) { + this.validateRow(k, true); + this.validRowsIndex.push(k); + } + } + }, { + key: 'setFilterValue', + + /** + * Set search value to a given filter + * @param {Number} index Column's index + * @param {String} searcharg Search term + */ + value: function setFilterValue(index) { + var searcharg = arguments[1] === undefined ? '' : arguments[1]; + + if (!this.fltGrid && !this.isFirstLoad || !this.getFilterElement(index)) { + return; + } + var slc = this.getFilterElement(index), + + // execFilter = doFilter===undefined ? true : doFilter, + fltColType = this.getFilterType(index); + + if (fltColType !== this.fltTypeMulti && fltColType != this.fltTypeCheckList) { + slc.value = searcharg; + } + //multiple selects + else if (fltColType === this.fltTypeMulti) { + var s = searcharg.split(' ' + this.orOperator + ' '); + // let ct = 0; //keywords counter + for (var j = 0, len = slc.options.length; j < len; j++) { + var option = slc.options[j]; + if (s === '' || s[0] === '') { + option.selected = false; + } + if (option.value === '') { + option.selected = false; + } + if (option.value !== '' && _Arr2['default'].has(s, option.value, true)) { + option.selected = true; + } //if + } //for j + } + //checklist + else if (fltColType === this.fltTypeCheckList) { + searcharg = _Str2['default'].matchCase(searcharg, this.caseSensitive); + var sarg = searcharg.split(' ' + this.orOperator + ' '); + var lisNb = _Dom2['default'].tag(slc, 'li').length; + + slc.setAttribute('value', ''); + slc.setAttribute('indexes', ''); + + for (var k = 0; k < lisNb; k++) { + var li = _Dom2['default'].tag(slc, 'li')[k], + lbl = _Dom2['default'].tag(li, 'label')[0], + chk = _Dom2['default'].tag(li, 'input')[0], + lblTxt = _Str2['default'].matchCase(_Dom2['default'].getText(lbl), this.caseSensitive); + if (lblTxt !== '' && _Arr2['default'].has(sarg, lblTxt, true)) { + chk.checked = true; + this.Mod.checkList.setCheckListValues(chk); + } else { + chk.checked = false; + this.Mod.checkList.setCheckListValues(chk); + } + } + } + } + }, { + key: 'setColWidths', + + /** + * Set them columns' widths as per configuration + * @param {Number} rowIndex Optional row index to apply the widths to + * @param {Element} tbl DOM element + */ + value: function setColWidths(rowIndex, tbl) { + if (!this.fltGrid || !this.hasColWidths) { + return; + } + tbl = tbl || this.tbl; + var rIndex = undefined; + if (rowIndex === undefined) { + rIndex = tbl.rows[0].style.display != 'none' ? 0 : 1; + } else { + rIndex = rowIndex; + } + + setWidths.call(this, tbl.rows[rIndex]); + + function setWidths(row) { + /*jshint validthis:true */ + var nbCols = this.nbCells; + var colWidths = this.colWidths; + if (nbCols != colWidths.length || nbCols != row.cells.length) { + throw new Error('Columns number mismatch!'); + } + + var colTags = _Dom2['default'].tag(tbl, 'col'); + var tblHasColTag = colTags.length > 0; + var frag = !tblHasColTag ? doc.createDocumentFragment() : null; + for (var k = 0; k < nbCols; k++) { + // row.cells[k].style.width = colWidths[k]; + var col = undefined; + if (tblHasColTag) { + col = colTags[k]; + } else { + col = _Dom2['default'].create('col', ['id', this.id + '_col_' + k]); + frag.appendChild(col); + } + col.style.width = colWidths[k]; + } + if (!tblHasColTag) { + tbl.insertBefore(frag, tbl.firstChild); + } + } + } + }, { + key: 'enforceVisibility', + + /** + * Makes defined rows always visible + * + * NOTE: This applies only when paging is disabled + */ + value: function enforceVisibility() { + if (this._hasGrid && this.hasVisibleRows && !this.paging) { + for (var i = 0, len = this.visibleRows.length; i < len; i++) { + var row = this.visibleRows[i]; + //row index cannot be > nrows + if (row <= this.nbRows) { + this.validateRow(row, true); + } + } + } + } + }, { + key: 'clearFilters', + value: function clearFilters() { + this.EvtManager(this.Evt.name.clear); + } + }, { + key: '_clearFilters', + + /** + * Clear all the filters' values + */ + value: function _clearFilters() { + if (!this.fltGrid) { + return; + } + if (this.onBeforeReset) { + this.onBeforeReset.call(null, this, this.getFiltersValue()); + } + for (var i = 0, len = this.fltIds.length; i < len; i++) { + this.setFilterValue(i, ''); + } + if (this.linkedFilters) { + this.activeFilterId = ''; + this.linkFilters(); + } + if (this.rememberPageLen) { + _Cookie2['default'].remove(this.pgLenCookie); + } + if (this.rememberPageNb) { + _Cookie2['default'].remove(this.pgNbCookie); + } + if (this.onAfterReset) { + this.onAfterReset.call(null, this); + } + } + }, { + key: 'clearActiveColumns', + + /** + * Clears filtered columns visual indicator (background color) + * @return {[type]} [description] + */ + value: function clearActiveColumns() { + for (var i = 0, len = this.fltIds.length; i < len; i++) { + _Dom2['default'].removeClass(this.getHeaderElement(i), this.activeColumnsCssClass); + } + } + }, { + key: 'linkFilters', + + /** + * Refresh the filters subject to linking ('select', 'multiple', + * 'checklist' type) + */ + value: function linkFilters() { + if (!this.activeFilterId) { + return; + } + var slcA1 = this.getFiltersByType(this.fltTypeSlc, true), + slcA2 = this.getFiltersByType(this.fltTypeMulti, true), + slcA3 = this.getFiltersByType(this.fltTypeCheckList, true), + slcIndex = slcA1.concat(slcA2); + slcIndex = slcIndex.concat(slcA3); + + var activeFlt = this.activeFilterId.split('_')[0]; + activeFlt = activeFlt.split(this.prfxFlt)[1]; + var slcSelectedValue = undefined; + for (var i = 0, len = slcIndex.length; i < len; i++) { + var curSlc = _Dom2['default'].id(this.fltIds[slcIndex[i]]); + slcSelectedValue = this.getFilterValue(slcIndex[i]); + + // Welcome to cyclomatic complexity hell :) + // TODO: simplify/refactor if statement + if (activeFlt !== slcIndex[i] || this.paging && _Arr2['default'].has(slcA1, slcIndex[i]) && activeFlt === slcIndex[i] || !this.paging && (_Arr2['default'].has(slcA3, slcIndex[i]) || _Arr2['default'].has(slcA2, slcIndex[i])) || slcSelectedValue === this.displayAllText) { + + if (_Arr2['default'].has(slcA3, slcIndex[i])) { + this.Mod.checkList.checkListDiv[slcIndex[i]].innerHTML = ''; + } else { + curSlc.innerHTML = ''; + } + + //1st option needs to be inserted + if (this.fillSlcOnDemand) { + var opt0 = _Dom2['default'].createOpt(this.displayAllText, ''); + if (curSlc) { + curSlc.appendChild(opt0); + } + } + + if (_Arr2['default'].has(slcA3, slcIndex[i])) { + this.Mod.checkList._build(slcIndex[i]); + } else { + this.Mod.dropdown._build(slcIndex[i], true); + } + + this.setFilterValue(slcIndex[i], slcSelectedValue); + } + } // for i + } + }, { + key: '_resetGrid', + + /** + * Re-generate the filters grid bar when previously removed + */ + value: function _resetGrid() { + if (this.isFirstLoad) { + return; + } + + var Mod = this.Mod; + var tbl = this.tbl; + var rows = tbl.rows; + var filtersRowIndex = this.filtersRowIndex; + var filtersRow = rows[filtersRowIndex]; + + // grid was removed, grid row element is stored in fltGridEl property + if (!this.gridLayout) { + // If table has a thead ensure the filters row is appended in the + // thead element + if (tbl.tHead) { + var tempRow = tbl.tHead.insertRow(this.filtersRowIndex); + tbl.tHead.replaceChild(this.fltGridEl, tempRow); + } else { + filtersRow.parentNode.insertBefore(this.fltGridEl, filtersRow); + } + } + + // filters are appended in external placeholders elements + if (this.isExternalFlt) { + var externalFltTgtIds = this.externalFltTgtIds; + for (var ct = 0, len = externalFltTgtIds.length; ct < len; ct++) { + var extFlt = _Dom2['default'].id(externalFltTgtIds[ct]); + + if (!extFlt) { + continue; + } + + var externalFltEl = this.externalFltEls[ct]; + extFlt.appendChild(externalFltEl); + var colFltType = this.getFilterType(ct); + //IE special treatment for gridLayout, appended filters are + //empty + if (this.gridLayout && externalFltEl.innerHTML === '' && colFltType !== this.fltTypeInp) { + if (colFltType === this.fltTypeSlc || colFltType === this.fltTypeMulti) { + Mod.dropdown.build(ct); + } + if (colFltType === this.fltTypeCheckList) { + Mod.checkList.build(ct); + } + } + } + } + + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = rows.length; + + if (this.popUpFilters) { + this.headersRow++; + Mod.popupFilter.buildAll(); + } + + if (!this.gridLayout) { + _Dom2['default'].addClass(this.tbl, this.prfxTf); + } + this._hasGrid = true; + } + }, { + key: '_containsStr', + + /** + * Checks if passed data contains the searched arg + * @param {String} arg Search term + * @param {String} data Data string + * @param {String} fltType Filter type ('input', 'select') + * @param {Boolean} forceMatch Exact match + * @return {Boolean]} + * + * TODO: move into string module, remove fltType in order to decouple it + * from TableFilter module + */ + value: function _containsStr(arg, data, fltType, forceMatch) { + // Improved by Cedric Wartel (cwl) + // automatic exact match for selects and special characters are now + // filtered + var regexp = undefined, + modifier = this.caseSensitive ? 'g' : 'gi', + exactMatch = !forceMatch ? this.exactMatch : forceMatch; + if (exactMatch || fltType !== this.fltTypeInp && fltType) { + regexp = new RegExp('(^\\s*)' + _Str2['default'].rgxEsc(arg) + '(\\s*$)', modifier); + } else { + regexp = new RegExp(_Str2['default'].rgxEsc(arg), modifier); + } + return regexp.test(data); + } + }, { + key: 'isImported', + + /** + * Check if passed script or stylesheet is already imported + * @param {String} filePath Ressource path + * @param {String} type Possible values: 'script' or 'link' + * @return {Boolean} + */ + value: function isImported(filePath, type) { + var imported = false, + importType = !type ? 'script' : type, + attr = importType == 'script' ? 'src' : 'href', + files = _Dom2['default'].tag(doc, importType); + for (var i = 0, len = files.length; i < len; i++) { + if (files[i][attr] === undefined) { + continue; + } + if (files[i][attr].match(filePath)) { + imported = true; + break; + } + } + return imported; + } + }, { + key: 'import', + + /** + * Import script or stylesheet + * @param {String} fileId Ressource ID + * @param {String} filePath Ressource path + * @param {Function} callback Callback + * @param {String} type Possible values: 'script' or 'link' + */ + value: function _import(fileId, filePath, callback, type) { + var ftype = !type ? 'script' : type, + imported = this.isImported(filePath, ftype); + if (imported) { + return; + } + var o = this, + isLoaded = false, + file = undefined, + head = _Dom2['default'].tag(doc, 'head')[0]; + + if (_Str2['default'].lower(ftype) === 'link') { + file = _Dom2['default'].create('link', ['id', fileId], ['type', 'text/css'], ['rel', 'stylesheet'], ['href', filePath]); + } else { + file = _Dom2['default'].create('script', ['id', fileId], ['type', 'text/javascript'], ['src', filePath]); + } + + //Browser <> IE onload event works only for scripts, not for stylesheets + file.onload = file.onreadystatechange = function () { + if (!isLoaded && (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')) { + isLoaded = true; + if (typeof callback === 'function') { + callback.call(null, o); + } + } + }; + file.onerror = function () { + throw new Error('TF script could not load: ' + filePath); + }; + head.appendChild(file); + } + }, { + key: 'hasGrid', + + /** + * Check if table has filters grid + * @return {Boolean} + */ + value: function hasGrid() { + return this._hasGrid; + } + }, { + key: 'getFiltersId', + + /** + * Get list of filter IDs + * @return {[type]} [description] + */ + value: function getFiltersId() { + return this.fltIds || []; + } + }, { + key: 'getValidRows', + + /** + * Get filtered (valid) rows indexes + * @param {Boolean} reCalc Force calculation of filtered rows list + * @return {Array} List of row indexes + */ + value: function getValidRows(reCalc) { + if (!reCalc) { + return this.validRowsIndex; + } + + this.validRowsIndex = []; + for (var k = this.refRow; k < this.getRowsNb(true); k++) { + var r = this.tbl.rows[k]; + if (!this.paging) { + if (this.getRowDisplay(r) !== 'none') { + this.validRowsIndex.push(r.rowIndex); + } + } else { + if (r.getAttribute('validRow') === 'true' || r.getAttribute('validRow') === null) { + this.validRowsIndex.push(r.rowIndex); + } + } + } + return this.validRowsIndex; + } + }, { + key: 'getFiltersRowIndex', + + /** + * Get the index of the row containing the filters + * @return {Number} + */ + value: function getFiltersRowIndex() { + return this.filtersRowIndex; + } + }, { + key: 'getHeadersRowIndex', + + /** + * Get the index of the headers row + * @return {Number} + */ + value: function getHeadersRowIndex() { + return this.headersRow; + } + }, { + key: 'getStartRowIndex', + + /** + * Get the row index from where the filtering process start (1st filterable + * row) + * @return {Number} + */ + value: function getStartRowIndex() { + return this.refRow; + } + }, { + key: 'getLastRowIndex', + + /** + * Get the index of the last row + * @return {Number} + */ + value: function getLastRowIndex() { + if (!this._hasGrid) { + return; + } + return this.nbRows - 1; + } + }, { + key: 'getHeaderElement', + + /** + * Get the header DOM element for a given column index + * @param {Number} colIndex Column index + * @return {Object} + */ + value: function getHeaderElement(colIndex) { + var table = this.gridLayout ? this.Mod.gridLayout.headTbl : this.tbl; + var tHead = _Dom2['default'].tag(table, 'thead'); + var headersRow = this.headersRow; + var header = undefined; + for (var i = 0; i < this.nbCells; i++) { + if (i !== colIndex) { + continue; + } + if (tHead.length === 0) { + header = table.rows[headersRow].cells[i]; + } + if (tHead.length === 1) { + header = tHead[0].rows[headersRow].cells[i]; + } + break; + } + return header; + } + }, { + key: 'getFilterType', + + /** + * Return the filter type for a specified column + * @param {Number} colIndex Column's index + * @return {String} + */ + value: function getFilterType(colIndex) { + var colType = this.cfg['col_' + colIndex]; + return !colType ? this.fltTypeInp : _Str2['default'].lower(colType); + } + }, { + key: 'getFilterableRowsNb', + + /** + * Get the total number of filterable rows + * @return {Number} + */ + value: function getFilterableRowsNb() { + return this.getRowsNb(false); + } + }, { + key: 'config', + + /** + * Get the configuration object (literal object) + * @return {Object} + */ + value: function config() { + return this.cfg; + } + }]); + + return TableFilter; + })(); + + exports.TableFilter = TableFilter; + +/***/ }, +/* 1 */, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * DOM event utilities + */ + + exports['default'] = { + add: function add(obj, type, func, capture) { + if (obj.addEventListener) { + obj.addEventListener(type, func, capture); + } else if (obj.attachEvent) { + obj.attachEvent('on' + type, func); + } else { + obj['on' + type] = func; + } + }, + remove: function remove(obj, type, func, capture) { + if (obj.detachEvent) { + obj.detachEvent('on' + type, func); + } else if (obj.removeEventListener) { + obj.removeEventListener(type, func, capture); + } else { + obj['on' + type] = null; + } + }, + stop: function stop(evt) { + if (!evt) { + evt = window.event; + } + if (evt.stopPropagation) { + evt.stopPropagation(); + } else { + evt.cancelBubble = true; + } + }, + cancel: function cancel(evt) { + if (!evt) { + evt = window.event; + } + if (evt.preventDefault) { + evt.preventDefault(); + } else { + evt.returnValue = false; + } + }, + target: function target(evt) { + return evt && evt.target || window.event && window.event.srcElement; + }, + keyCode: function keyCode(evt) { + return evt.charCode ? evt.charCode : evt.keyCode ? evt.keyCode : evt.which ? evt.which : 0; + } + }; + module.exports = exports['default']; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * DOM utilities + */ + + exports['default'] = { + + /** + * Returns text + text of children of given node + * @param {NodeElement} node + * @return {String} + */ + getText: function getText(node) { + var s = node.textContent || node.innerText || node.innerHTML.replace(/<[^<>]+>/g, ''); + s = s.replace(/^\s+/, '').replace(/\s+$/, ''); + return s; + }, + + /** + * Creates an html element with given collection of attributes + * @param {String} tag a string of the html tag to create + * @param {Array} an undetermined number of arrays containing the with 2 + * items, the attribute name and its value ['id','myId'] + * @return {Object} created element + */ + create: function create(tag) { + if (!tag || tag === '') { + return; + } + + var el = document.createElement(tag), + args = arguments; + + if (args.length > 1) { + for (var i = 0; i < args.length; i++) { + var argtype = typeof args[i]; + if (argtype.toLowerCase() === 'object' && args[i].length === 2) { + el.setAttribute(args[i][0], args[i][1]); + } + } + } + return el; + }, + + /** + * Returns a text node with given text + * @param {String} txt + * @return {Object} + */ + text: function text(txt) { + return document.createTextNode(txt); + }, + + /** + * Returns offset position of passed element + * @param {object} obj [description] + * @return {object} literal object with left and top values + */ + position: function position(obj) { + var l = 0, + t = 0; + if (obj && obj.offsetParent) { + do { + l += obj.offsetLeft; + t += obj.offsetTop; + } while (obj == obj.offsetParent); + } + return { left: l, top: t }; + }, + + hasClass: function hasClass(ele, cls) { + if (!ele) { + return false; + } + + if (supportsClassList()) { + return ele.classList.contains(cls); + } + return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)')); + }, + + addClass: function addClass(ele, cls) { + if (!ele) { + return; + } + + if (supportsClassList()) { + ele.classList.add(cls); + return; + } + + if (ele.className === '') { + ele.className = cls; + } else if (!this.hasClass(ele, cls)) { + ele.className += ' ' + cls; + } + }, + + removeClass: function removeClass(ele, cls) { + if (!ele) { + return; + } + + if (supportsClassList()) { + ele.classList.remove(cls); + return; + } + var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)', 'g'); + ele.className = ele.className.replace(reg, ''); + }, + + /** + * Creates and returns an option element + * @param {String} text option text + * @param {String} value option value + * @param {Boolean} isSel whether option is selected + * @return {Object} option element + */ + createOpt: function createOpt(text, value, isSel) { + var isSelected = isSel ? true : false, + opt = isSelected ? this.create('option', ['value', value], ['selected', 'true']) : this.create('option', ['value', value]); + opt.appendChild(this.text(text)); + return opt; + }, + + /** + * Creates and returns a checklist item + * @param {Number} chkIndex index of check item + * @param {String} chkValue check item value + * @param {String} labelText check item label text + * @return {Object} li DOM element + */ + createCheckItem: function createCheckItem(chkIndex, chkValue, labelText) { + var li = this.create('li'), + label = this.create('label', ['for', chkIndex]), + check = this.create('input', ['id', chkIndex], ['name', chkIndex], ['type', 'checkbox'], ['value', chkValue]); + label.appendChild(check); + label.appendChild(this.text(labelText)); + li.appendChild(label); + li.label = label; + li.check = check; + return li; + }, + + id: function id(_id) { + return document.getElementById(_id); + }, + + tag: function tag(o, tagname) { + return o.getElementsByTagName(tagname); + } + }; + + // HTML5 classList API + function supportsClassList() { + return document.documentElement.classList; + } + module.exports = exports['default']; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * String utilities + */ + + exports['default'] = { + + lower: function lower(text) { + return text.toLowerCase(); + }, + + upper: function upper(text) { + return text.toUpperCase(); + }, + + trim: function trim(text) { + if (text.trim) { + return text.trim(); + } + return text.replace(/^\s*|\s*$/g, ''); + }, + + isEmpty: function isEmpty(text) { + return this.trim(text) === ''; + }, + + rgxEsc: function rgxEsc(text) { + var chars = /[-\/\\^$*+?.()|[\]{}]/g; + var escMatch = '\\$&'; + return String(text).replace(chars, escMatch); + }, + + matchCase: function matchCase(text, mc) { + if (!mc) { + return this.lower(text); + } + return text; + } + + }; + module.exports = exports['default']; + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * Cookie utilities + */ + + exports['default'] = { + + write: function write(name, value, hours) { + var expire = ''; + if (hours) { + expire = new Date(new Date().getTime() + hours * 3600000); + expire = '; expires=' + expire.toGMTString(); + } + document.cookie = name + '=' + escape(value) + expire; + }, + + read: function read(name) { + var cookieValue = '', + search = name + '='; + if (document.cookie.length > 0) { + var cookie = document.cookie, + offset = cookie.indexOf(search); + if (offset !== -1) { + offset += search.length; + var end = cookie.indexOf(';', offset); + if (end === -1) { + end = cookie.length; + } + cookieValue = unescape(cookie.substring(offset, end)); + } + } + return cookieValue; + }, + + remove: function remove(name) { + this.write(name, '', -1); + }, + + valueToArray: function valueToArray(name, separator) { + if (!separator) { + separator = ','; + } + //reads the cookie + var val = this.read(name); + //creates an array with filters' values + var arr = val.split(separator); + return arr; + }, + + getValueByIndex: function getValueByIndex(name, index, separator) { + if (!separator) { + separator = ','; + } + //reads the cookie + var val = this.valueToArray(name, separator); + return val[index]; + } + + }; + module.exports = exports['default']; + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * Types utilities + */ + + var UNDEFINED = void 0; + + exports['default'] = { + /** + * Check if argument is an object or a global object + * @param {String or Object} v + * @return {Boolean} + */ + isObj: function isObj(v) { + var isO = false; + if (typeof v === 'string') { + if (window[v] && typeof window[v] === 'object') { + isO = true; + } + } else { + if (v && typeof v === 'object') { + isO = true; + } + } + return isO; + }, + + /** + * Check if argument is a function + * @param {Function} fn + * @return {Boolean} + */ + isFn: function isFn(fn) { + return fn && fn.constructor == Function; + }, + + /** + * Check if argument is an array + * @param {Array} obj + * @return {Boolean} + */ + isArray: function isArray(obj) { + return obj && obj.constructor == Array; + }, + + /** + * Determine if argument is undefined + * @param {Any} o + * @return {Boolean} + */ + isUndef: function isUndef(o) { + return o === UNDEFINED; + }, + + /** + * Determine if argument is null + * @param {Any} o + * @return {Boolean} + */ + isNull: function isNull(o) { + return o === null; + }, + + /** + * Determine if argument is empty (undefined, null or empty string) + * @param {Any} o + * @return {Boolean} + */ + isEmpty: function isEmpty(o) { + return this.isUndef(o) || this.isNull(o) || o.length === 0; + } + }; + module.exports = exports['default']; + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * Array utilities + */ + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + exports['default'] = { + has: function has(arr, val, caseSensitive) { + var sCase = caseSensitive === undefined ? false : caseSensitive; + for (var i = 0; i < arr.length; i++) { + if (_Str2['default'].matchCase(arr[i].toString(), sCase) == val) { + return true; + } + } + return false; + }, + indexByValue: function indexByValue(arr, val, caseSensitive) { + var sCase = caseSensitive === undefined ? false : caseSensitive; + for (var i = 0; i < arr.length; i++) { + if (_Str2['default'].matchCase(arr[i].toString(), sCase) == val) { + return i; + } + } + return -1; + } + }; + module.exports = exports['default']; + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * Date utilities + */ + + exports['default'] = { + isValid: function isValid(dateStr, format) { + if (!format) { + format = 'DMY'; + } + format = format.toUpperCase(); + if (format.length != 3) { + if (format === 'DDMMMYYYY') { + var d = this.format(dateStr, format); + dateStr = d.getDate() + '/' + (d.getMonth() + 1) + '/' + d.getFullYear(); + format = 'DMY'; + } + } + if (format.indexOf('M') === -1 || format.indexOf('D') === -1 || format.indexOf('Y') === -1) { + format = 'DMY'; + } + var reg1 = undefined, + reg2 = undefined; + // If the year is first + if (format.substring(0, 1) == 'Y') { + reg1 = /^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/; + reg2 = /^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/; + } else if (format.substring(1, 2) == 'Y') { + // If the year is second + reg1 = /^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/; + reg2 = /^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/; + } else { + // The year must be third + reg1 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/; + reg2 = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/; + } + // If it doesn't conform to the right format (with either a 2 digit year + // or 4 digit year), fail + if (reg1.test(dateStr) === false && reg2.test(dateStr) === false) { + return false; + } + // Split into 3 parts based on what the divider was + var parts = dateStr.split(RegExp.$1); + var mm = undefined, + dd = undefined, + yy = undefined; + // Check to see if the 3 parts end up making a valid date + if (format.substring(0, 1) === 'M') { + mm = parts[0]; + } else if (format.substring(1, 2) === 'M') { + mm = parts[1]; + } else { + mm = parts[2]; + } + if (format.substring(0, 1) === 'D') { + dd = parts[0]; + } else if (format.substring(1, 2) === 'D') { + dd = parts[1]; + } else { + dd = parts[2]; + } + if (format.substring(0, 1) === 'Y') { + yy = parts[0]; + } else if (format.substring(1, 2) === 'Y') { + yy = parts[1]; + } else { + yy = parts[2]; + } + if (parseInt(yy, 10) <= 50) { + yy = (parseInt(yy, 10) + 2000).toString(); + } + if (parseInt(yy, 10) <= 99) { + yy = (parseInt(yy, 10) + 1900).toString(); + } + var dt = new Date(parseInt(yy, 10), parseInt(mm, 10) - 1, parseInt(dd, 10), 0, 0, 0, 0); + if (parseInt(dd, 10) != dt.getDate()) { + return false; + } + if (parseInt(mm, 10) - 1 != dt.getMonth()) { + return false; + } + return true; + }, + format: function format(dateStr, formatStr) { + if (!formatStr) { + formatStr = 'DMY'; + } + if (!dateStr || dateStr === '') { + return new Date(1001, 0, 1); + } + var oDate = undefined; + var parts = undefined; + + switch (formatStr.toUpperCase()) { + case 'DDMMMYYYY': + parts = dateStr.replace(/[- \/.]/g, ' ').split(' '); + oDate = new Date(y2kDate(parts[2]), mmm2mm(parts[1]) - 1, parts[0]); + break; + case 'DMY': + /* jshint ignore:start */ + parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/, '$1 $3 $5').split(' '); + oDate = new Date(y2kDate(parts[2]), parts[1] - 1, parts[0]); + /* jshint ignore:end */ + break; + case 'MDY': + /* jshint ignore:start */ + parts = dateStr.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/, '$1 $3 $5').split(' '); + oDate = new Date(y2kDate(parts[2]), parts[0] - 1, parts[1]); + /* jshint ignore:end */ + break; + case 'YMD': + /* jshint ignore:start */ + parts = dateStr.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/, '$1 $4 $6').split(' '); + oDate = new Date(y2kDate(parts[0]), parts[1] - 1, parts[2]); + /* jshint ignore:end */ + break; + default: + //in case format is not correct + /* jshint ignore:start */ + parts = dateStr.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/, '$1 $3 $5').split(' '); + oDate = new Date(y2kDate(parts[2]), parts[1] - 1, parts[0]); + /* jshint ignore:end */ + break; + } + return oDate; + } + }; + + function y2kDate(yr) { + if (yr === undefined) { + return 0; + } + if (yr.length > 2) { + return yr; + } + var y = undefined; + //>50 belong to 1900 + if (yr <= 99 && yr > 50) { + y = '19' + yr; + } + //<50 belong to 2000 + if (yr < 50 || yr === '00') { + y = '20' + yr; + } + return y; + } + + function mmm2mm(mmm) { + if (mmm === undefined) { + return 0; + } + var mondigit = undefined; + var MONTH_NAMES = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december', 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; + for (var m_i = 0; m_i < MONTH_NAMES.length; m_i++) { + var month_name = MONTH_NAMES[m_i]; + if (mmm.toLowerCase() === month_name) { + mondigit = m_i + 1; + break; + } + } + if (mondigit > 11 || mondigit < 23) { + mondigit = mondigit - 12; + } + if (mondigit < 1 || mondigit > 12) { + return 0; + } + return mondigit; + } + module.exports = exports['default']; + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + /** + * Misc helpers + */ + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + exports['default'] = { + removeNbFormat: function removeNbFormat(data, format) { + if (!data) { + return; + } + if (!format) { + format = 'us'; + } + var n = data; + if (_Str2['default'].lower(format) === 'us') { + n = +n.replace(/[^\d\.-]/g, ''); + } else { + n = +n.replace(/[^\d\,-]/g, '').replace(',', '.'); + } + return n; + } + }; + module.exports = exports['default']; + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Cookie = __webpack_require__(5); + + var _Cookie2 = _interopRequireDefault(_Cookie); + + var Store = (function () { + + /** + * Store, persistence manager + * @param {Object} tf TableFilter instance + * + * TODO: use localStorage and fallback to cookie persistence + */ + + function Store(tf) { + _classCallCheck(this, Store); + + var f = tf.config(); + + this.duration = !isNaN(f.set_cookie_duration) ? parseInt(f.set_cookie_duration, 10) : 100000; + + this.tf = tf; + } + + _createClass(Store, [{ + key: 'saveFilterValues', + + /** + * Store filters' values in cookie + * @param {String} cookie name + */ + value: function saveFilterValues(name) { + var tf = this.tf; + var fltValues = []; + //store filters' values + for (var i = 0; i < tf.fltIds.length; i++) { + var value = tf.getFilterValue(i); + if (value === '') { + value = ' '; + } + fltValues.push(value); + } + //adds array size + fltValues.push(tf.fltIds.length); + + //writes cookie + _Cookie2['default'].write(name, fltValues.join(tf.separator), this.duration); + } + }, { + key: 'getFilterValues', + + /** + * Retrieve filters' values from cookie + * @param {String} cookie name + * @return {Array} + */ + value: function getFilterValues(name) { + var flts = _Cookie2['default'].read(name); + var rgx = new RegExp(this.tf.separator, 'g'); + // filters' values array + return flts.split(rgx); + } + }, { + key: 'savePageNb', + + /** + * Store page number in cookie + * @param {String} cookie name + */ + value: function savePageNb(name) { + _Cookie2['default'].write(name, this.tf.feature('paging').currentPageNb, this.duration); + } + }, { + key: 'getPageNb', + + /** + * Retrieve page number from cookie + * @param {String} cookie name + * @return {String} + */ + value: function getPageNb(name) { + return _Cookie2['default'].read(name); + } + }, { + key: 'savePageLength', + + /** + * Store page length in cookie + * @param {String} cookie name + */ + value: function savePageLength(name) { + _Cookie2['default'].write(name, this.tf.feature('paging').resultsPerPageSlc.selectedIndex, this.duration); + } + }, { + key: 'getPageLength', + + /** + * Retrieve page length from cookie + * @param {String} cookie name + * @return {String} + */ + value: function getPageLength(name) { + return _Cookie2['default'].read(name); + } + }]); + + return Store; + })(); + + exports.Store = Store; + +/***/ }, +/* 11 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var GridLayout = (function () { + + /** + * Grid layout, table with fixed headers + * @param {Object} tf TableFilter instance + */ + + function GridLayout(tf) { + _classCallCheck(this, GridLayout); + + var f = tf.config(); + + //defines grid width + this.gridWidth = f.grid_width || null; + //defines grid height + this.gridHeight = f.grid_height || null; + //defines css class for main container + this.gridMainContCssClass = f.grid_cont_css_class || 'grd_Cont'; + //defines css class for div containing table + this.gridContCssClass = f.grid_tbl_cont_css_class || 'grd_tblCont'; + //defines css class for div containing headers' table + this.gridHeadContCssClass = f.grid_tblHead_cont_css_class || 'grd_headTblCont'; + //defines css class for div containing rows counter, paging etc. + this.gridInfDivCssClass = f.grid_inf_grid_css_class || 'grd_inf'; + //defines which row contains column headers + this.gridHeadRowIndex = f.grid_headers_row_index || 0; + //array of headers row indexes to be placed in header table + this.gridHeadRows = f.grid_headers_rows || [0]; + //generate filters in table headers + this.gridEnableFilters = f.grid_enable_default_filters !== undefined ? f.grid_enable_default_filters : true; + //default col width + this.gridDefaultColWidth = f.grid_default_col_width || '100px'; + //enables/disables columns resizer + // this.gridEnableColResizer = f.grid_enable_cols_resizer!==undefined ? + // f.grid_enable_cols_resizer : false; + // //defines col resizer script path + // this.gridColResizerPath = f.grid_cont_col_resizer_path || + // this.basePath+'TFExt_ColsResizer/TFExt_ColsResizer.js'; + + this.gridColElms = []; + + //div containing grid elements if grid_layout true + this.prfxMainTblCont = 'gridCont_'; + //div containing table if grid_layout true + this.prfxTblCont = 'tblCont_'; + //div containing headers table if grid_layout true + this.prfxHeadTblCont = 'tblHeadCont_'; + //headers' table if grid_layout true + this.prfxHeadTbl = 'tblHead_'; + //id of td containing the filter if grid_layout true + this.prfxGridFltTd = '_td_'; + //id of th containing column header if grid_layout true + this.prfxGridTh = 'tblHeadTh_'; + + this.tf = tf; + } + + _createClass(GridLayout, [{ + key: 'init', + + /** + * Generates a grid with fixed headers + */ + value: function init() { + var _this = this; + + var tf = this.tf; + var f = tf.config(); + var tbl = tf.tbl; + + if (!tf.gridLayout) { + return; + } + + tf.isExternalFlt = true; + + // default width of 100px if column widths not set + if (!tf.hasColWidths) { + tf.colWidths = []; + for (var k = 0; k < tf.nbCells; k++) { + var colW, + cell = tbl.rows[this.gridHeadRowIndex].cells[k]; + if (cell.width !== '') { + colW = cell.width; + } else if (cell.style.width !== '') { + colW = parseInt(cell.style.width, 10); + } else { + colW = this.gridDefaultColWidth; + } + tf.colWidths[k] = colW; + } + tf.hasColWidths = true; + } + tf.setColWidths(this.gridHeadRowIndex); + + var tblW; //initial table width + if (tbl.width !== '') { + tblW = tbl.width; + } else if (tbl.style.width !== '') { + tblW = parseInt(tbl.style.width, 10); + } else { + tblW = tbl.clientWidth; + } + + //Main container: it will contain all the elements + this.tblMainCont = _Dom2['default'].create('div', ['id', this.prfxMainTblCont + tf.id]); + this.tblMainCont.className = this.gridMainContCssClass; + if (this.gridWidth) { + this.tblMainCont.style.width = this.gridWidth; + } + tbl.parentNode.insertBefore(this.tblMainCont, tbl); + + //Table container: div wrapping content table + this.tblCont = _Dom2['default'].create('div', ['id', this.prfxTblCont + tf.id]); + this.tblCont.className = this.gridContCssClass; + if (this.gridWidth) { + if (this.gridWidth.indexOf('%') != -1) { + console.log(this.gridWidth); + this.tblCont.style.width = '100%'; + } else { + this.tblCont.style.width = this.gridWidth; + } + } + if (this.gridHeight) { + this.tblCont.style.height = this.gridHeight; + } + tbl.parentNode.insertBefore(this.tblCont, tbl); + var t = tbl.parentNode.removeChild(tbl); + this.tblCont.appendChild(t); + + //In case table width is expressed in % + if (tbl.style.width === '') { + tbl.style.width = (tf._containsStr('%', tblW) ? tbl.clientWidth : tblW) + 'px'; + } + + var d = this.tblCont.parentNode.removeChild(this.tblCont); + this.tblMainCont.appendChild(d); + + //Headers table container: div wrapping headers table + this.headTblCont = _Dom2['default'].create('div', ['id', this.prfxHeadTblCont + tf.id]); + this.headTblCont.className = this.gridHeadContCssClass; + if (this.gridWidth) { + if (this.gridWidth.indexOf('%') != -1) { + console.log(this.gridWidth); + this.headTblCont.style.width = '100%'; + } else { + this.headTblCont.style.width = this.gridWidth; + } + } + + //Headers table + this.headTbl = _Dom2['default'].create('table', ['id', this.prfxHeadTbl + tf.id]); + var tH = _Dom2['default'].create('tHead'); //IE<7 needs it + + //1st row should be headers row, ids are added if not set + //Those ids are used by the sort feature + var hRow = tbl.rows[this.gridHeadRowIndex]; + var sortTriggers = []; + for (var n = 0; n < tf.nbCells; n++) { + var c = hRow.cells[n]; + var thId = c.getAttribute('id'); + if (!thId || thId === '') { + thId = this.prfxGridTh + n + '_' + tf.id; + c.setAttribute('id', thId); + } + sortTriggers.push(thId); + } + + //Filters row is created + var filtersRow = _Dom2['default'].create('tr'); + if (this.gridEnableFilters && tf.fltGrid) { + tf.externalFltTgtIds = []; + for (var j = 0; j < tf.nbCells; j++) { + var fltTdId = tf.prfxFlt + j + this.prfxGridFltTd + tf.id; + var cl = _Dom2['default'].create(tf.fltCellTag, ['id', fltTdId]); + filtersRow.appendChild(cl); + tf.externalFltTgtIds[j] = fltTdId; + } + } + //Headers row are moved from content table to headers table + for (var i = 0; i < this.gridHeadRows.length; i++) { + var headRow = tbl.rows[this.gridHeadRows[0]]; + tH.appendChild(headRow); + } + this.headTbl.appendChild(tH); + if (tf.filtersRowIndex === 0) { + tH.insertBefore(filtersRow, hRow); + } else { + tH.appendChild(filtersRow); + } + + this.headTblCont.appendChild(this.headTbl); + this.tblCont.parentNode.insertBefore(this.headTblCont, this.tblCont); + + //THead needs to be removed in content table for sort feature + var thead = _Dom2['default'].tag(tbl, 'thead'); + if (thead.length > 0) { + tbl.removeChild(thead[0]); + } + + //Headers table style + this.headTbl.style.tableLayout = 'fixed'; + tbl.style.tableLayout = 'fixed'; + this.headTbl.cellPadding = tbl.cellPadding; + this.headTbl.cellSpacing = tbl.cellSpacing; + // this.headTbl.style.width = tbl.style.width; + + //content table without headers needs col widths to be reset + tf.setColWidths(0, this.headTbl); + + //Headers container width + // this.headTblCont.style.width = this.tblCont.clientWidth+'px'; + + tbl.style.width = ''; + // + this.headTbl.style.width = tbl.clientWidth + 'px'; + // + + //scroll synchronisation + _Event2['default'].add(this.tblCont, 'scroll', function (evt) { + var elm = _Event2['default'].target(evt); + var scrollLeft = elm.scrollLeft; + _this.headTblCont.scrollLeft = scrollLeft; + //New pointerX calc taking into account scrollLeft + // if(!o.isPointerXOverwritten){ + // try{ + // o.Evt.pointerX = function(evt){ + // var e = evt || global.event; + // var bdScrollLeft = tf_StandardBody().scrollLeft + + // scrollLeft; + // return (e.pageX + scrollLeft) || + // (e.clientX + bdScrollLeft); + // }; + // o.isPointerXOverwritten = true; + // } catch(err) { + // o.isPointerXOverwritten = false; + // } + // } + }); + + //Configure sort extension if any + var sort = (f.extensions || []).filter(function (itm) { + return itm.name === 'sort'; + }); + if (sort.length === 1) { + sort[0].async_sort = true; + sort[0].trigger_ids = sortTriggers; + } + + // if(this.gridEnableColResizer){ + // if(!tf.hasExtensions){ + // tf.extensions = { + // name:['ColumnsResizer_'+tf.id], + // src:[this.gridColResizerPath], + // description:['Columns Resizing'], + // initialize:[function(o){ + // o.SetColsResizer('ColumnsResizer_'+o.id);}] + // }; + // tf.hasExtensions = true; + // } else { + // if(!tf._containsStr( + // 'colsresizer', + // Str.lower(tf.extensions.src.toString())) ){ + // tf.extensions.name.push('ColumnsResizer_'+tf.id); + // tf.extensions.src.push(tf.gridColResizerPath); + // tf.extensions.description.push('Columns Resizing'); + // tf.extensions.initialize.push(function(o){ + // o.SetColsResizer('ColumnsResizer_'+o.id);}); + // } + // } + // } + + //Default columns resizer properties for grid layout + // f.col_resizer_cols_headers_table = this.headTbl.getAttribute('id'); + // f.col_resizer_cols_headers_index = this.gridHeadRowIndex; + // f.col_resizer_width_adjustment = 0; + // f.col_enable_text_ellipsis = false; + + //Cols generation for all browsers excepted IE<=7 + this.tblHasColTag = _Dom2['default'].tag(tbl, 'col').length > 0 ? true : false; + + //Col elements are enough to keep column widths after sorting and + //filtering + var createColTags = function createColTags() { + for (var k = tf.nbCells - 1; k >= 0; k--) { + var col = _Dom2['default'].create('col', ['id', tf.id + '_col_' + k]); + tbl.insertBefore(col, tbl.firstChild); + col.style.width = tf.colWidths[k]; + this.gridColElms[k] = col; + } + this.tblHasColTag = true; + }; + + if (!this.tblHasColTag) { + createColTags.call(this); + } else { + var cols = _Dom2['default'].tag(tbl, 'col'); + for (var ii = 0; ii < tf.nbCells; ii++) { + cols[ii].setAttribute('id', tf.id + '_col_' + ii); + cols[ii].style.width = tf.colWidths[ii]; + this.gridColElms.push(cols[ii]); + } + } + + var afterColResizedFn = _Types2['default'].isFn(f.on_after_col_resized) ? f.on_after_col_resized : null; + f.on_after_col_resized = function (o, colIndex) { + if (!colIndex) { + return; + } + var w = o.crWColsRow.cells[colIndex].style.width; + var col = o.gridColElms[colIndex]; + col.style.width = w; + + var thCW = o.crWColsRow.cells[colIndex].clientWidth; + var tdCW = o.crWRowDataTbl.cells[colIndex].clientWidth; + + if (thCW != tdCW) { + o.headTbl.style.width = tbl.clientWidth + 'px'; + } + + if (afterColResizedFn) { + afterColResizedFn.call(null, o, colIndex); + } + }; + + if (tbl.clientWidth !== this.headTbl.clientWidth) { + tbl.style.width = this.headTbl.clientWidth + 'px'; + } + } + }, { + key: 'destroy', + + /** + * Removes the grid layout + */ + value: function destroy() { + var tf = this.tf; + var tbl = tf.tbl; + + if (!tf.gridLayout) { + return; + } + var t = tbl.parentNode.removeChild(tbl); + this.tblMainCont.parentNode.insertBefore(t, this.tblMainCont); + this.tblMainCont.parentNode.removeChild(this.tblMainCont); + + this.tblMainCont = null; + this.headTblCont = null; + this.headTbl = null; + this.tblCont = null; + + tbl.outerHTML = tf.sourceTblHtml; + //needed to keep reference of table element + tbl = _Dom2['default'].id(tf.id); + } + }]); + + return GridLayout; + })(); + + exports.GridLayout = GridLayout; + +/***/ }, +/* 12 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var global = window; + + /** + * Loading message/spinner + * @param {Object} tf TableFilter instance + */ + + var Loader = (function () { + function Loader(tf) { + _classCallCheck(this, Loader); + + // TableFilter configuration + var f = tf.config(); + //id of container element + this.loaderTgtId = f.loader_target_id || null; + //div containing loader + this.loaderDiv = null; + //defines loader text + this.loaderText = f.loader_text || 'Loading...'; + //defines loader innerHtml + this.loaderHtml = f.loader_html || null; + //defines css class for loader div + this.loaderCssClass = f.loader_css_class || 'loader'; + //delay for hiding loader + this.loaderCloseDelay = 200; + //callback function before loader is displayed + this.onShowLoader = _Types2['default'].isFn(f.on_show_loader) ? f.on_show_loader : null; + //callback function after loader is closed + this.onHideLoader = _Types2['default'].isFn(f.on_hide_loader) ? f.on_hide_loader : null; + //loader div + this.prfxLoader = 'load_'; + + this.tf = tf; + + var containerDiv = _Dom2['default'].create('div', ['id', this.prfxLoader + tf.id]); + containerDiv.className = this.loaderCssClass; + + var targetEl = !this.loaderTgtId ? tf.tbl.parentNode : _Dom2['default'].id(this.loaderTgtId); + if (!this.loaderTgtId) { + targetEl.insertBefore(containerDiv, tf.tbl); + } else { + targetEl.appendChild(containerDiv); + } + this.loaderDiv = _Dom2['default'].id(this.prfxLoader + tf.id); + if (!this.loaderHtml) { + this.loaderDiv.appendChild(_Dom2['default'].text(this.loaderText)); + } else { + this.loaderDiv.innerHTML = this.loaderHtml; + } + } + + _createClass(Loader, [{ + key: 'show', + value: function show(p) { + var _this = this; + + if (!this.tf.loader || !this.loaderDiv || this.loaderDiv.style.display === p) { + return; + } + + var displayLoader = function displayLoader() { + if (!_this.loaderDiv) { + return; + } + if (_this.onShowLoader && p !== 'none') { + _this.onShowLoader.call(null, _this); + } + _this.loaderDiv.style.display = p; + if (_this.onHideLoader && p === 'none') { + _this.onHideLoader.call(null, _this); + } + }; + + var t = p === 'none' ? this.loaderCloseDelay : 1; + global.setTimeout(displayLoader, t); + } + }, { + key: 'destroy', + value: function destroy() { + if (!this.loaderDiv) { + return; + } + var tf = this.tf, + targetEl = !this.loaderTgtId ? tf.gridLayout ? tf.feature('gridLayout').tblCont : tf.tbl.parentNode : _Dom2['default'].id(this.loaderTgtId); + targetEl.removeChild(this.loaderDiv); + this.loaderDiv = null; + } + }]); + + return Loader; + })(); + + exports.Loader = Loader; + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var HighlightKeyword = (function () { + + /** + * HighlightKeyword, highlight matched keyword + * @param {Object} tf TableFilter instance + */ + + function HighlightKeyword(tf) { + _classCallCheck(this, HighlightKeyword); + + var f = tf.config(); + //defines css class for highlighting + this.highlightCssClass = f.highlight_css_class || 'keyword'; + this.highlightedNodes = []; + + this.tf = tf; + } + + _createClass(HighlightKeyword, [{ + key: 'highlight', + + /** + * highlight occurences of searched term in passed node + * @param {Node} node + * @param {String} word Searched term + * @param {String} cssClass Css class name + */ + value: function highlight(node, word, cssClass) { + // Iterate into this nodes childNodes + if (node.hasChildNodes) { + var children = node.childNodes; + for (var i = 0; i < children.length; i++) { + this.highlight(children[i], word, cssClass); + } + } + + if (node.nodeType === 3) { + var tempNodeVal = _Str2['default'].lower(node.nodeValue); + var tempWordVal = _Str2['default'].lower(word); + if (tempNodeVal.indexOf(tempWordVal) != -1) { + var pn = node.parentNode; + if (pn && pn.className != cssClass) { + // word not highlighted yet + var nv = node.nodeValue, + ni = tempNodeVal.indexOf(tempWordVal), + + // Create a load of replacement nodes + before = _Dom2['default'].text(nv.substr(0, ni)), + docWordVal = nv.substr(ni, word.length), + after = _Dom2['default'].text(nv.substr(ni + word.length)), + hiwordtext = _Dom2['default'].text(docWordVal), + hiword = _Dom2['default'].create('span'); + hiword.className = cssClass; + hiword.appendChild(hiwordtext); + pn.insertBefore(before, node); + pn.insertBefore(hiword, node); + pn.insertBefore(after, node); + pn.removeChild(node); + this.highlightedNodes.push(hiword.firstChild); + } + } + } + } + }, { + key: 'unhighlight', + + /** + * Removes highlight to nodes matching passed string + * @param {String} word + * @param {String} cssClass Css class to remove + */ + value: function unhighlight(word, cssClass) { + var arrRemove = []; + var highlightedNodes = this.highlightedNodes; + for (var i = 0; i < highlightedNodes.length; i++) { + var n = highlightedNodes[i]; + if (!n) { + continue; + } + var tempNodeVal = _Str2['default'].lower(n.nodeValue), + tempWordVal = _Str2['default'].lower(word); + if (tempNodeVal.indexOf(tempWordVal) !== -1) { + var pn = n.parentNode; + if (pn && pn.className === cssClass) { + var prevSib = pn.previousSibling, + nextSib = pn.nextSibling; + if (!prevSib || !nextSib) { + continue; + } + nextSib.nodeValue = prevSib.nodeValue + n.nodeValue + nextSib.nodeValue; + prevSib.nodeValue = ''; + n.nodeValue = ''; + arrRemove.push(i); + } + } + } + for (var k = 0; k < arrRemove.length; k++) { + highlightedNodes.splice(arrRemove[k], 1); + } + } + }, { + key: 'unhighlightAll', + + /** + * Clear all occurrences of highlighted nodes + */ + value: function unhighlightAll() { + if (!this.tf.highlightKeywords || !this.tf.searchArgs) { + return; + } + for (var y = 0; y < this.tf.searchArgs.length; y++) { + this.unhighlight(this.tf.searchArgs[y], this.highlightCssClass); + } + this.highlightedNodes = []; + } + }]); + + return HighlightKeyword; + })(); + + exports.HighlightKeyword = HighlightKeyword; + +/***/ }, +/* 14 */ +/***/ function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var PopupFilter = (function () { + + /** + * Pop-up filter component + * @param {Object} tf TableFilter instance + */ + + function PopupFilter(tf) { + _classCallCheck(this, PopupFilter); + + // Configuration object + var f = tf.config(); + + // Enable external filters behaviour + tf.isExternalFlt = true; + tf.externalFltTgtIds = []; + + //filter icon path + this.popUpImgFlt = f.popup_filters_image || tf.themesPath + 'icn_filter.gif'; + //active filter icon path + this.popUpImgFltActive = f.popup_filters_image_active || tf.themesPath + 'icn_filterActive.gif'; + this.popUpImgFltHtml = f.popup_filters_image_html || 'Column filter'; + //defines css class for popup div containing filter + this.popUpDivCssClass = f.popup_div_css_class || 'popUpFilter'; + //callback function before popup filtes is opened + this.onBeforePopUpOpen = _Types2['default'].isFn(f.on_before_popup_filter_open) ? f.on_before_popup_filter_open : null; + //callback function after popup filtes is opened + this.onAfterPopUpOpen = _Types2['default'].isFn(f.on_after_popup_filter_open) ? f.on_after_popup_filter_open : null; + //callback function before popup filtes is closed + this.onBeforePopUpClose = _Types2['default'].isFn(f.on_before_popup_filter_close) ? f.on_before_popup_filter_close : null; + //callback function after popup filtes is closed + this.onAfterPopUpClose = _Types2['default'].isFn(f.on_after_popup_filter_close) ? f.on_after_popup_filter_close : null; + + //stores filters spans + this.popUpFltSpans = []; + //stores filters icons + this.popUpFltImgs = []; + //stores filters containers + this.popUpFltElms = this.popUpFltElmCache || []; + this.popUpFltAdjustToContainer = true; + + //id prefix for pop-up filter span + this.prfxPopUpSpan = 'popUpSpan_'; + //id prefix for pop-up div containing filter + this.prfxPopUpDiv = 'popUpDiv_'; + + this.tf = tf; + } + + _createClass(PopupFilter, [{ + key: 'onClick', + value: function onClick(e) { + var evt = e || global.event, + elm = evt.target.parentNode, + colIndex = parseInt(elm.getAttribute('ci'), 10); + + this.closeAll(colIndex); + this.toggle(colIndex); + + if (this.popUpFltAdjustToContainer) { + var popUpDiv = this.popUpFltElms[colIndex], + header = this.tf.getHeaderElement(colIndex), + headerWidth = header.clientWidth * 0.95; + popUpDiv.style.width = parseInt(headerWidth, 10) + 'px'; + } + _Event2['default'].cancel(evt); + _Event2['default'].stop(evt); + } + }, { + key: 'init', + + /** + * Initialize DOM elements + */ + value: function init() { + var _this = this; + + var tf = this.tf; + for (var i = 0; i < tf.nbCells; i++) { + if (tf['col' + i] === tf.fltTypeNone) { + continue; + } + var popUpSpan = _Dom2['default'].create('span', ['id', this.prfxPopUpSpan + tf.id + '_' + i], ['ci', i]); + popUpSpan.innerHTML = this.popUpImgFltHtml; + var header = tf.getHeaderElement(i); + header.appendChild(popUpSpan); + _Event2['default'].add(popUpSpan, 'click', function (evt) { + _this.onClick(evt); + }); + this.popUpFltSpans[i] = popUpSpan; + this.popUpFltImgs[i] = popUpSpan.firstChild; + } + } + }, { + key: 'buildAll', + + /** + * Build all pop-up filters elements + */ + value: function buildAll() { + for (var i = 0; i < this.popUpFltElmCache.length; i++) { + this.build(i, this.popUpFltElmCache[i]); + } + } + }, { + key: 'build', + + /** + * Build a specified pop-up filter elements + * @param {Number} colIndex Column index + * @param {Object} div Optional container DOM element + */ + value: function build(colIndex, div) { + var tf = this.tf; + var popUpDiv = !div ? _Dom2['default'].create('div', ['id', this.prfxPopUpDiv + tf.id + '_' + colIndex]) : div; + popUpDiv.className = this.popUpDivCssClass; + tf.externalFltTgtIds.push(popUpDiv.id); + var header = tf.getHeaderElement(colIndex); + header.insertBefore(popUpDiv, header.firstChild); + _Event2['default'].add(popUpDiv, 'click', function (evt) { + _Event2['default'].stop(evt); + }); + this.popUpFltElms[colIndex] = popUpDiv; + } + }, { + key: 'toggle', + + /** + * Toogle visibility of specified filter + * @param {Number} colIndex Column index + */ + value: function toggle(colIndex) { + var tf = this.tf, + popUpFltElm = this.popUpFltElms[colIndex]; + + if (popUpFltElm.style.display === 'none' || popUpFltElm.style.display === '') { + if (this.onBeforePopUpOpen) { + this.onBeforePopUpOpen.call(null, this, this.popUpFltElms[colIndex], colIndex); + } + popUpFltElm.style.display = 'block'; + if (tf['col' + colIndex] === tf.fltTypeInp) { + var flt = tf.getFilterElement(colIndex); + if (flt) { + flt.focus(); + } + } + if (this.onAfterPopUpOpen) { + this.onAfterPopUpOpen.call(null, this, this.popUpFltElms[colIndex], colIndex); + } + } else { + if (this.onBeforePopUpClose) { + this.onBeforePopUpClose.call(null, this, this.popUpFltElms[colIndex], colIndex); + } + popUpFltElm.style.display = 'none'; + if (this.onAfterPopUpClose) { + this.onAfterPopUpClose.call(null, this, this.popUpFltElms[colIndex], colIndex); + } + } + } + }, { + key: 'closeAll', + + /** + * Close all filters excepted for the specified one if any + * @param {Number} exceptIdx Column index of the filter to not close + */ + value: function closeAll(exceptIdx) { + for (var i = 0; i < this.popUpFltElms.length; i++) { + if (i === exceptIdx) { + continue; + } + var popUpFltElm = this.popUpFltElms[i]; + if (popUpFltElm) { + popUpFltElm.style.display = 'none'; + } + } + } + }, { + key: 'buildIcons', + + /** + * Build all the icons representing the pop-up filters + */ + value: function buildIcons() { + for (var i = 0; i < this.popUpFltImgs.length; i++) { + this.buildIcon(i, false); + } + } + }, { + key: 'buildIcon', + + /** + * Build specified icon + * @param {Number} colIndex Column index + * @param {Boolean} active Apply active state + */ + value: function buildIcon(colIndex, active) { + if (this.popUpFltImgs[colIndex]) { + this.popUpFltImgs[colIndex].src = active ? this.popUpImgFltActive : this.popUpImgFlt; + } + } + }, { + key: 'destroy', + + /** + * Remove pop-up filters + */ + value: function destroy() { + this.popUpFltElmCache = []; + for (var i = 0; i < this.popUpFltElms.length; i++) { + var popUpFltElm = this.popUpFltElms[i], + popUpFltSpan = this.popUpFltSpans[i], + popUpFltImg = this.popUpFltImgs[i]; + if (popUpFltElm) { + popUpFltElm.parentNode.removeChild(popUpFltElm); + this.popUpFltElmCache[i] = popUpFltElm; + } + popUpFltElm = null; + if (popUpFltSpan) { + popUpFltSpan.parentNode.removeChild(popUpFltSpan); + } + popUpFltSpan = null; + if (popUpFltImg) { + popUpFltImg.parentNode.removeChild(popUpFltImg); + } + popUpFltImg = null; + } + this.popUpFltElms = []; + this.popUpFltSpans = []; + this.popUpFltImgs = []; + } + }]); + + return PopupFilter; + })(); + + exports.PopupFilter = PopupFilter; + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }, +/* 15 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var _Sort = __webpack_require__(23); + + var _Sort2 = _interopRequireDefault(_Sort); + + var Dropdown = (function () { + + /** + * Dropdown UI component + * @param {Object} tf TableFilter instance + */ + + function Dropdown(tf) { + _classCallCheck(this, Dropdown); + + // Configuration object + var f = tf.config(); + + this.enableSlcResetFilter = f.enable_slc_reset_filter === false ? false : true; + //defines empty option text + this.nonEmptyText = f.non_empty_text || '(Non empty)'; + //sets select filling method: 'innerHTML' or 'createElement' + this.slcFillingMethod = f.slc_filling_method || 'createElement'; + //IE only, tooltip text appearing on select before it is populated + this.activateSlcTooltip = f.activate_slc_tooltip || 'Click to activate'; + //tooltip text appearing on multiple select + this.multipleSlcTooltip = f.multiple_slc_tooltip || 'Use Ctrl key for multiple selections'; + + this.isCustom = null; + this.opts = null; + this.optsTxt = null; + this.slcInnerHtml = null; + + this.tf = tf; + } + + _createClass(Dropdown, [{ + key: 'build', + + /** + * Build drop-down filter UI asynchronously + * @param {Number} colIndex Column index + * @param {Boolean} isLinked Enable linked refresh behaviour + * @param {Boolean} isExternal Render in external container + * @param {String} extSlcId External container id + */ + value: function build(colIndex, isLinked, isExternal, extSlcId) { + var tf = this.tf; + tf.EvtManager(tf.Evt.name.dropdown, { + slcIndex: colIndex, + slcRefreshed: isLinked, + slcExternal: isExternal, + slcId: extSlcId + }); + } + }, { + key: '_build', + + /** + * Build drop-down filter UI + * @param {Number} colIndex Column index + * @param {Boolean} isLinked Enable linked refresh behaviour + * @param {Boolean} isExternal Render in external container + * @param {String} extSlcId External container id + */ + value: function _build(colIndex) { + var isLinked = arguments[1] === undefined ? false : arguments[1]; + var isExternal = arguments[2] === undefined ? false : arguments[2]; + var extSlcId = arguments[3] === undefined ? null : arguments[3]; + + var tf = this.tf; + colIndex = parseInt(colIndex, 10); + + this.opts = []; + this.optsTxt = []; + this.slcInnerHtml = ''; + + var slcId = tf.fltIds[colIndex]; + if (!_Dom2['default'].id(slcId) && !isExternal || !_Dom2['default'].id(extSlcId) && isExternal) { + return; + } + var slc = !isExternal ? _Dom2['default'].id(slcId) : _Dom2['default'].id(extSlcId), + rows = tf.tbl.rows, + matchCase = tf.matchCase; + + //custom select test + this.isCustom = tf.isCustomOptions(colIndex); + + //custom selects text + var activeFlt; + if (isLinked && tf.activeFilterId) { + activeFlt = tf.activeFilterId.split('_')[0]; + activeFlt = activeFlt.split(tf.prfxFlt)[1]; + } + + /*** remember grid values ***/ + var fltsValues = [], + fltArr = []; + if (tf.rememberGridValues) { + fltsValues = tf.feature('store').getFilterValues(tf.fltsValuesCookie); + if (fltsValues && !_Str2['default'].isEmpty(fltsValues.toString())) { + if (this.isCustom) { + fltArr.push(fltsValues[colIndex]); + } else { + fltArr = fltsValues[colIndex].split(' ' + tf.orOperator + ' '); + } + } + } + + var excludedOpts = null, + filteredDataCol = null; + if (isLinked && tf.disableExcludedOptions) { + excludedOpts = []; + filteredDataCol = []; + } + + for (var k = tf.refRow; k < tf.nbRows; k++) { + // always visible rows don't need to appear on selects as always + // valid + if (tf.hasVisibleRows && _Arr2['default'].has(tf.visibleRows, k) && !tf.paging) { + continue; + } + + var cell = rows[k].cells, + nchilds = cell.length; + + // checks if row has exact cell # + if (nchilds !== tf.nbCells || this.isCustom) { + continue; + } + + // this loop retrieves cell data + for (var j = 0; j < nchilds; j++) { + // WTF: cyclomatic complexity hell + if (colIndex === j && (!isLinked || isLinked && tf.disableExcludedOptions) || colIndex == j && isLinked && (rows[k].style.display === '' && !tf.paging || tf.paging && (!tf.validRowsIndex || tf.validRowsIndex && _Arr2['default'].has(tf.validRowsIndex, k)) && (activeFlt === undefined || activeFlt == colIndex || activeFlt != colIndex && _Arr2['default'].has(tf.validRowsIndex, k)))) { + var cell_data = tf.getCellData(j, cell[j]), + + //Vary Peter's patch + cell_string = _Str2['default'].matchCase(cell_data, matchCase); + + // checks if celldata is already in array + if (!_Arr2['default'].has(this.opts, cell_string, matchCase)) { + this.opts.push(cell_data); + } + + if (isLinked && tf.disableExcludedOptions) { + var filteredCol = filteredDataCol[j]; + if (!filteredCol) { + filteredCol = tf.getFilteredDataCol(j); + } + if (!_Arr2['default'].has(filteredCol, cell_string, matchCase) && !_Arr2['default'].has(excludedOpts, cell_string, matchCase) && !this.isFirstLoad) { + excludedOpts.push(cell_data); + } + } + } //if colIndex==j + } //for j + } //for k + + //Retrieves custom values + if (this.isCustom) { + var customValues = tf.getCustomOptions(colIndex); + this.opts = customValues[0]; + this.optsTxt = customValues[1]; + } + + if (tf.sortSlc && !this.isCustom) { + if (!matchCase) { + this.opts.sort(_Sort2['default'].ignoreCase); + if (excludedOpts) { + excludedOpts.sort(_Sort2['default'].ignoreCase); + } + } else { + this.opts.sort(); + if (excludedOpts) { + excludedOpts.sort(); + } + } + } + + //asc sort + if (tf.sortNumAsc && _Arr2['default'].has(tf.sortNumAsc, colIndex)) { + try { + this.opts.sort(numSortAsc); + if (excludedOpts) { + excludedOpts.sort(numSortAsc); + } + if (this.isCustom) { + this.optsTxt.sort(numSortAsc); + } + } catch (e) { + this.opts.sort(); + if (excludedOpts) { + excludedOpts.sort(); + } + if (this.isCustom) { + this.optsTxt.sort(); + } + } //in case there are alphanumeric values + } + //desc sort + if (tf.sortNumDesc && _Arr2['default'].has(tf.sortNumDesc, colIndex)) { + try { + this.opts.sort(numSortDesc); + if (excludedOpts) { + excludedOpts.sort(numSortDesc); + } + if (this.isCustom) { + this.optsTxt.sort(numSortDesc); + } + } catch (e) { + this.opts.sort(); + if (excludedOpts) { + excludedOpts.sort(); + } + if (this.isCustom) { + this.optsTxt.sort(); + } + } //in case there are alphanumeric values + } + + //populates drop-down + this.addOptions(colIndex, slc, isLinked, excludedOpts, fltsValues, fltArr); + } + }, { + key: 'addOptions', + + /** + * Add drop-down options + * @param {Number} colIndex Column index + * @param {Object} slc Select Dom element + * @param {Boolean} isLinked Enable linked refresh behaviour + * @param {Array} excludedOpts Array of excluded options + * @param {Array} fltsValues Collection of persisted filter values + * @param {Array} fltArr Collection of persisted filter values + */ + value: function addOptions(colIndex, slc, isLinked, excludedOpts, fltsValues, fltArr) { + var tf = this.tf, + fillMethod = _Str2['default'].lower(this.slcFillingMethod), + slcValue = slc.value; + + slc.innerHTML = ''; + slc = this.addFirstOption(slc); + + for (var y = 0; y < this.opts.length; y++) { + if (this.opts[y] === '') { + continue; + } + var val = this.opts[y]; //option value + var lbl = this.isCustom ? this.optsTxt[y] : val; //option text + var isDisabled = false; + if (isLinked && tf.disableExcludedOptions && _Arr2['default'].has(excludedOpts, _Str2['default'].matchCase(val, tf.matchCase), tf.matchCase)) { + isDisabled = true; + } + + if (fillMethod === 'innerhtml') { + var slcAttr = ''; + if (tf.fillSlcOnDemand && slcValue === this.opts[y]) { + slcAttr = 'selected="selected"'; + } + this.slcInnerHtml += ''; + } else { + var opt; + //fill select on demand + if (tf.fillSlcOnDemand && slcValue === this.opts[y] && tf['col' + colIndex] === tf.fltTypeSlc) { + opt = _Dom2['default'].createOpt(lbl, val, true); + } else { + if (tf['col' + colIndex] !== tf.fltTypeMulti) { + opt = _Dom2['default'].createOpt(lbl, val, fltsValues[colIndex] !== ' ' && val === fltsValues[colIndex] ? true : false); + } else { + opt = _Dom2['default'].createOpt(lbl, val, _Arr2['default'].has(fltArr, _Str2['default'].matchCase(this.opts[y], tf.matchCase), tf.matchCase) || fltArr.toString().indexOf(val) !== -1 ? true : false); + } + } + if (isDisabled) { + opt.disabled = true; + } + slc.appendChild(opt); + } + } // for y + + if (fillMethod === 'innerhtml') { + slc.innerHTML += this.slcInnerHtml; + } + slc.setAttribute('filled', '1'); + } + }, { + key: 'addFirstOption', + + /** + * Add drop-down header option + * @param {Object} slc Select DOM element + */ + value: function addFirstOption(slc) { + var tf = this.tf, + fillMethod = _Str2['default'].lower(this.slcFillingMethod); + + if (fillMethod === 'innerhtml') { + this.slcInnerHtml += ''; + } else { + var opt0 = _Dom2['default'].createOpt(!this.enableSlcResetFilter ? '' : tf.displayAllText, ''); + if (!this.enableSlcResetFilter) { + opt0.style.display = 'none'; + } + slc.appendChild(opt0); + if (tf.enableEmptyOption) { + var opt1 = _Dom2['default'].createOpt(tf.emptyText, tf.emOperator); + slc.appendChild(opt1); + } + if (tf.enableNonEmptyOption) { + var opt2 = _Dom2['default'].createOpt(tf.nonEmptyText, tf.nmOperator); + slc.appendChild(opt2); + } + } + return slc; + } + }]); + + return Dropdown; + })(); + + exports.Dropdown = Dropdown; + +/***/ }, +/* 16 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var _Sort = __webpack_require__(23); + + var _Sort2 = _interopRequireDefault(_Sort); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var CheckList = (function () { + + /** + * Checklist UI component + * @param {Object} tf TableFilter instance + */ + + function CheckList(tf) { + _classCallCheck(this, CheckList); + + // Configuration object + var f = tf.config(); + + this.checkListDiv = []; //checklist container div + //defines css class for div containing checklist filter + this.checkListDivCssClass = f.div_checklist_css_class || 'div_checklist'; + //defines css class for checklist filters + this.checkListCssClass = f.checklist_css_class || 'flt_checklist'; + //defines css class for checklist item (li) + this.checkListItemCssClass = f.checklist_item_css_class || 'flt_checklist_item'; + //defines css class for selected checklist item (li) + this.checkListSlcItemCssClass = f.checklist_selected_item_css_class || 'flt_checklist_slc_item'; + //Load on demand text + this.activateCheckListTxt = f.activate_checklist_text || 'Click to load filter data'; + //defines css class for checklist filters + this.checkListItemDisabledCssClass = f.checklist_item_disabled_css_class || 'flt_checklist_item_disabled'; + this.enableCheckListResetFilter = f.enable_checklist_reset_filter === false ? false : true; + //checklist filter container div + this.prfxCheckListDiv = 'chkdiv_'; + + this.isCustom = null; + this.opts = null; + this.optsTxt = null; + this.excludedOpts = null; + + this.tf = tf; + } + + _createClass(CheckList, [{ + key: 'onChange', + + // TODO: move event here + value: function onChange(evt) { + var elm = evt.target; + this.tf.activeFilterId = elm.getAttribute('id'); + this.tf.activeFlt = _Dom2['default'].id(this.tf.activeFilterId); + this.tf.Evt.onSlcChange.call(this.tf, evt); + } + }, { + key: 'optionClick', + value: function optionClick(evt) { + this.setCheckListValues(evt.target); + this.onChange(evt); + } + }, { + key: 'build', + + /** + * Build checklist UI asynchronously + * @param {Number} colIndex Column index + * @param {Boolean} isExternal Render in external container + * @param {String} extFltId External container id + */ + value: function build(colIndex, isExternal, extFltId) { + var tf = this.tf; + tf.EvtManager(tf.Evt.name.checklist, { slcIndex: colIndex, slcExternal: isExternal, slcId: extFltId }); + } + }, { + key: '_build', + + /** + * Build checklist UI + * @param {Number} colIndex Column index + * @param {Boolean} isExternal Render in external container + * @param {String} extFltId External container id + */ + value: function _build(colIndex) { + var _this = this; + + var isExternal = arguments[1] === undefined ? false : arguments[1]; + var extFltId = arguments[2] === undefined ? null : arguments[2]; + + var tf = this.tf; + colIndex = parseInt(colIndex, 10); + + this.opts = []; + this.optsTxt = []; + + var divFltId = this.prfxCheckListDiv + colIndex + '_' + tf.id; + if (!_Dom2['default'].id(divFltId) && !isExternal || !_Dom2['default'].id(extFltId) && isExternal) { + return; + } + + var flt = !isExternal ? this.checkListDiv[colIndex] : _Dom2['default'].id(extFltId); + var ul = _Dom2['default'].create('ul', ['id', tf.fltIds[colIndex]], ['colIndex', colIndex]); + ul.className = this.checkListCssClass; + _Event2['default'].add(ul, 'change', function (evt) { + _this.onChange(evt); + }); + + var rows = tf.tbl.rows; + this.isCustom = tf.isCustomOptions(colIndex); + + var activeFlt; + if (tf.linkedFilters && tf.activeFilterId) { + activeFlt = tf.activeFilterId.split('_')[0]; + activeFlt = activeFlt.split(tf.prfxFlt)[1]; + } + + var filteredDataCol = []; + if (tf.linkedFilters && tf.disableExcludedOptions) { + this.excludedOpts = []; + } + + for (var k = tf.refRow; k < tf.nbRows; k++) { + // always visible rows don't need to appear on selects as always + // valid + if (tf.hasVisibleRows && _Arr2['default'].has(tf.visibleRows, k) && !tf.paging) { + continue; + } + + var cells = rows[k].cells; + var ncells = cells.length; + + // checks if row has exact cell # + if (ncells !== tf.nbCells || this.isCustom) { + continue; + } + + // this loop retrieves cell data + for (var j = 0; j < ncells; j++) { + // WTF: cyclomatic complexity hell :) + if (colIndex === j && (!tf.linkedFilters || tf.linkedFilters && tf.disableExcludedOptions) || colIndex === j && tf.linkedFilters && (rows[k].style.display === '' && !tf.paging || tf.paging && (!activeFlt || activeFlt === colIndex || activeFlt != colIndex && _Arr2['default'].has(tf.validRowsIndex, k)))) { + var cell_data = tf.getCellData(j, cells[j]); + //Vary Peter's patch + var cell_string = _Str2['default'].matchCase(cell_data, tf.matchCase); + // checks if celldata is already in array + if (!_Arr2['default'].has(this.opts, cell_string, tf.matchCase)) { + this.opts.push(cell_data); + } + var filteredCol = filteredDataCol[j]; + if (tf.linkedFilters && tf.disableExcludedOptions) { + if (!filteredCol) { + filteredCol = tf.getFilteredDataCol(j); + } + if (!_Arr2['default'].has(filteredCol, cell_string, tf.matchCase) && !_Arr2['default'].has(this.excludedOpts, cell_string, tf.matchCase) && !tf.isFirstLoad) { + this.excludedOpts.push(cell_data); + } + } + } + } + } + + //Retrieves custom values + if (this.isCustom) { + var customValues = tf.getCustomOptions(colIndex); + this.opts = customValues[0]; + this.optsTxt = customValues[1]; + } + + if (tf.sortSlc && !this.isCustom) { + if (!tf.matchCase) { + this.opts.sort(_Sort2['default'].ignoreCase); + if (this.excludedOpts) { + this.excludedOpts.sort(_Sort2['default'].ignoreCase); + } + } else { + this.opts.sort(); + if (this.excludedOpts) { + this.excludedOpts.sort(); + } + } + } + //asc sort + if (tf.sortNumAsc && _Arr2['default'].has(tf.sortNumAsc, colIndex)) { + try { + this.opts.sort(numSortAsc); + if (this.excludedOpts) { + this.excludedOpts.sort(numSortAsc); + } + if (this.isCustom) { + this.optsTxt.sort(numSortAsc); + } + } catch (e) { + this.opts.sort(); + if (this.excludedOpts) { + this.excludedOpts.sort(); + } + if (this.isCustom) { + this.optsTxt.sort(); + } + } //in case there are alphanumeric values + } + //desc sort + if (tf.sortNumDesc && _Arr2['default'].has(tf.sortNumDesc, colIndex)) { + try { + this.opts.sort(numSortDesc); + if (this.excludedOpts) { + this.excludedOpts.sort(numSortDesc); + } + if (this.isCustom) { + this.optsTxt.sort(numSortDesc); + } + } catch (e) { + this.opts.sort(); + if (this.excludedOpts) { + this.excludedOpts.sort(); + } + if (this.isCustom) { + this.optsTxt.sort(); + } + } //in case there are alphanumeric values + } + + this.addChecks(colIndex, ul, tf.separator); + + if (tf.fillSlcOnDemand) { + flt.innerHTML = ''; + } + flt.appendChild(ul); + flt.setAttribute('filled', '1'); + } + }, { + key: 'addChecks', + + /** + * Add checklist options + * @param {Number} colIndex Column index + * @param {Object} ul Ul element + */ + value: function addChecks(colIndex, ul) { + var _this2 = this; + + var tf = this.tf; + var chkCt = this.addTChecks(colIndex, ul); + var fltArr = []; //remember grid values + var store = tf.feature('store'); + var tmpVal = store ? store.getFilterValues(tf.fltsValuesCookie)[colIndex] : null; + if (tmpVal && _Str2['default'].trim(tmpVal).length > 0) { + if (tf.hasCustomSlcOptions && _Arr2['default'].has(tf.customSlcOptions.cols, colIndex)) { + fltArr.push(tmpVal); + } else { + fltArr = tmpVal.split(' ' + tf.orOperator + ' '); + } + } + + for (var y = 0; y < this.opts.length; y++) { + var val = this.opts[y]; //item value + var lbl = this.isCustom ? this.optsTxt[y] : val; //item text + var li = _Dom2['default'].createCheckItem(tf.fltIds[colIndex] + '_' + (y + chkCt), val, lbl); + li.className = this.checkListItemCssClass; + if (tf.linkedFilters && tf.disableExcludedOptions && _Arr2['default'].has(this.excludedOpts, _Str2['default'].matchCase(val, tf.matchCase), tf.matchCase)) { + _Dom2['default'].addClass(li, this.checkListItemDisabledCssClass); + li.check.disabled = true; + li.disabled = true; + } else { + _Event2['default'].add(li.check, 'click', function (evt) { + _this2.optionClick(evt); + }); + } + ul.appendChild(li); + + if (val === '') { + //item is hidden + li.style.display = 'none'; + } + + /*** remember grid values ***/ + if (tf.rememberGridValues) { + if (tf.hasCustomSlcOptions && _Arr2['default'].has(tf.customSlcOptions.cols, colIndex) && fltArr.toString().indexOf(val) != -1 || _Arr2['default'].has(fltArr, _Str2['default'].matchCase(val, tf.matchCase), tf.matchCase)) { + li.check.checked = true; + this.setCheckListValues(li.check); + } + } + } + } + }, { + key: 'addTChecks', + + /** + * Add checklist header option + * @param {Number} colIndex Column index + * @param {Object} ul Ul element + */ + value: function addTChecks(colIndex, ul) { + var _this3 = this; + + var tf = this.tf; + var chkCt = 1; + var li0 = _Dom2['default'].createCheckItem(tf.fltIds[colIndex] + '_0', '', tf.displayAllText); + li0.className = this.checkListItemCssClass; + ul.appendChild(li0); + + _Event2['default'].add(li0.check, 'click', function (evt) { + _this3.optionClick(evt); + }); + + if (!this.enableCheckListResetFilter) { + li0.style.display = 'none'; + } + + if (tf.enableEmptyOption) { + var li1 = _Dom2['default'].createCheckItem(tf.fltIds[colIndex] + '_1', tf.emOperator, tf.emptyText); + li1.className = this.checkListItemCssClass; + ul.appendChild(li1); + _Event2['default'].add(li1.check, 'click', function (evt) { + _this3.optionClick(evt); + }); + chkCt++; + } + + if (tf.enableNonEmptyOption) { + var li2 = _Dom2['default'].createCheckItem(tf.fltIds[colIndex] + '_2', tf.nmOperator, tf.nonEmptyText); + li2.className = this.checkListItemCssClass; + ul.appendChild(li2); + _Event2['default'].add(li2.check, 'click', function (evt) { + _this3.optionClick(evt); + }); + chkCt++; + } + return chkCt; + } + }, { + key: 'setCheckListValues', + + /** + * Store checked options in DOM element attribute + * @param {Object} o checklist option DOM element + */ + value: function setCheckListValues(o) { + if (!o) { + return; + } + var tf = this.tf; + var chkValue = o.value; //checked item value + var chkIndex = parseInt(o.id.split('_')[2], 10); + var filterTag = 'ul', + itemTag = 'li'; + var n = o; + + //ul tag search + while (_Str2['default'].lower(n.nodeName) !== filterTag) { + n = n.parentNode; + } + + var li = n.childNodes[chkIndex]; + var colIndex = n.getAttribute('colIndex'); + var fltValue = n.getAttribute('value'); //filter value (ul tag) + var fltIndexes = n.getAttribute('indexes'); //selected items (ul tag) + + if (o.checked) { + //show all item + if (chkValue === '') { + if (fltIndexes && fltIndexes !== '') { + //items indexes + var indSplit = fltIndexes.split(tf.separator); + //checked items loop + for (var u = 0; u < indSplit.length; u++) { + //checked item + var cChk = _Dom2['default'].id(tf.fltIds[colIndex] + '_' + indSplit[u]); + if (cChk) { + cChk.checked = false; + _Dom2['default'].removeClass(n.childNodes[indSplit[u]], this.checkListSlcItemCssClass); + } + } + } + n.setAttribute('value', ''); + n.setAttribute('indexes', ''); + } else { + fltValue = fltValue ? fltValue : ''; + chkValue = _Str2['default'].trim(fltValue + ' ' + chkValue + ' ' + tf.orOperator); + chkIndex = fltIndexes + chkIndex + tf.separator; + n.setAttribute('value', chkValue); + n.setAttribute('indexes', chkIndex); + //1st option unchecked + if (_Dom2['default'].id(tf.fltIds[colIndex] + '_0')) { + _Dom2['default'].id(tf.fltIds[colIndex] + '_0').checked = false; + } + } + + if (_Str2['default'].lower(li.nodeName) === itemTag) { + _Dom2['default'].removeClass(n.childNodes[0], this.checkListSlcItemCssClass); + _Dom2['default'].addClass(li, this.checkListSlcItemCssClass); + } + } else { + //removes values and indexes + if (chkValue !== '') { + var replaceValue = new RegExp(_Str2['default'].rgxEsc(chkValue + ' ' + tf.orOperator)); + fltValue = fltValue.replace(replaceValue, ''); + n.setAttribute('value', _Str2['default'].trim(fltValue)); + + var replaceIndex = new RegExp(_Str2['default'].rgxEsc(chkIndex + tf.separator)); + fltIndexes = fltIndexes.replace(replaceIndex, ''); + n.setAttribute('indexes', fltIndexes); + } + if (_Str2['default'].lower(li.nodeName) === itemTag) { + _Dom2['default'].removeClass(li, this.checkListSlcItemCssClass); + } + } + } + }]); + + return CheckList; + })(); + + exports.CheckList = CheckList; + +/***/ }, +/* 17 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var RowsCounter = (function () { + + /** + * Rows counter + * @param {Object} tf TableFilter instance + */ + + function RowsCounter(tf) { + _classCallCheck(this, RowsCounter); + + // TableFilter configuration + var f = tf.config(); + + //id of custom container element + this.rowsCounterTgtId = f.rows_counter_target_id || null; + //element containing tot nb rows + this.rowsCounterDiv = null; + //element containing tot nb rows label + this.rowsCounterSpan = null; + //defines rows counter text + this.rowsCounterText = f.rows_counter_text || 'Rows: '; + this.fromToTextSeparator = f.from_to_text_separator || '-'; + this.overText = f.over_text || ' / '; + //defines css class rows counter + this.totRowsCssClass = f.tot_rows_css_class || 'tot'; + //rows counter div + this.prfxCounter = 'counter_'; + //nb displayed rows label + this.prfxTotRows = 'totrows_span_'; + //label preceding nb rows label + this.prfxTotRowsTxt = 'totRowsTextSpan_'; + //callback raised before counter is refreshed + this.onBeforeRefreshCounter = _Types2['default'].isFn(f.on_before_refresh_counter) ? f.on_before_refresh_counter : null; + //callback raised after counter is refreshed + this.onAfterRefreshCounter = _Types2['default'].isFn(f.on_after_refresh_counter) ? f.on_after_refresh_counter : null; + + this.tf = tf; + } + + _createClass(RowsCounter, [{ + key: 'init', + value: function init() { + var tf = this.tf; + + if (!tf.hasGrid() && !tf.isFirstLoad || this.rowsCounterSpan) { + return; + } + + //rows counter container + var countDiv = _Dom2['default'].create('div', ['id', this.prfxCounter + tf.id]); + countDiv.className = this.totRowsCssClass; + //rows counter label + var countSpan = _Dom2['default'].create('span', ['id', this.prfxTotRows + tf.id]); + var countText = _Dom2['default'].create('span', ['id', this.prfxTotRowsTxt + tf.id]); + countText.appendChild(_Dom2['default'].text(this.rowsCounterText)); + + // counter is added to defined element + if (!this.rowsCounterTgtId) { + tf.setToolbar(); + } + var targetEl = !this.rowsCounterTgtId ? tf.lDiv : _Dom2['default'].id(this.rowsCounterTgtId); + + //default container: 'lDiv' + if (!this.rowsCounterTgtId) { + countDiv.appendChild(countText); + countDiv.appendChild(countSpan); + targetEl.appendChild(countDiv); + } else { + //custom container, no need to append statusDiv + targetEl.appendChild(countText); + targetEl.appendChild(countSpan); + } + this.rowsCounterDiv = countDiv; + this.rowsCounterSpan = countSpan; + + this.refresh(); + } + }, { + key: 'refresh', + value: function refresh(p) { + if (!this.rowsCounterSpan) { + return; + } + + var tf = this.tf; + + if (this.onBeforeRefreshCounter) { + this.onBeforeRefreshCounter.call(null, tf, this.rowsCounterSpan); + } + + var totTxt; + if (!tf.paging) { + if (p && p !== '') { + totTxt = p; + } else { + totTxt = tf.nbFilterableRows - tf.nbHiddenRows - (tf.hasVisibleRows ? tf.visibleRows.length : 0); + } + } else { + var paging = tf.feature('paging'); + if (paging) { + //paging start row + var paging_start_row = parseInt(paging.startPagingRow, 10) + (tf.nbVisibleRows > 0 ? 1 : 0); + var paging_end_row = paging_start_row + paging.pagingLength - 1 <= tf.nbVisibleRows ? paging_start_row + paging.pagingLength - 1 : tf.nbVisibleRows; + totTxt = paging_start_row + this.fromToTextSeparator + paging_end_row + this.overText + tf.nbVisibleRows; + } + } + this.rowsCounterSpan.innerHTML = totTxt; + if (this.onAfterRefreshCounter) { + this.onAfterRefreshCounter.call(null, tf, this.rowsCounterSpan, totTxt); + } + } + }, { + key: 'destroy', + value: function destroy() { + var tf = this.tf; + if (!tf.hasGrid() || !this.rowsCounterSpan) { + return; + } + + if (!this.rowsCounterTgtId && this.rowsCounterDiv) { + this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv); + } else { + _Dom2['default'].id(this.rowsCounterTgtId).innerHTML = ''; + } + this.rowsCounterSpan = null; + this.rowsCounterDiv = null; + } + }]); + + return RowsCounter; + })(); + + exports.RowsCounter = RowsCounter; + +/***/ }, +/* 18 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var global = window; + + var StatusBar = (function () { + + /** + * Status bar UI component + * @param {Object} tf TableFilter instance + */ + + function StatusBar(tf) { + _classCallCheck(this, StatusBar); + + // Configuration object + var f = tf.config(); + + //id of custom container element + this.statusBarTgtId = f.status_bar_target_id || null; + //element containing status bar label + this.statusBarDiv = null; + //status bar + this.statusBarSpan = null; + //status bar label + this.statusBarSpanText = null; + //defines status bar text + this.statusBarText = f.status_bar_text || ''; + //defines css class status bar + this.statusBarCssClass = f.status_bar_css_class || 'status'; + //delay for status bar clearing + this.statusBarCloseDelay = 250; + + //calls function before message is displayed + this.onBeforeShowMsg = _Types2['default'].isFn(f.on_before_show_msg) ? f.on_before_show_msg : null; + //calls function after message is displayed + this.onAfterShowMsg = _Types2['default'].isFn(f.on_after_show_msg) ? f.on_after_show_msg : null; + + // status bar div + this.prfxStatus = 'status_'; + // status bar label + this.prfxStatusSpan = 'statusSpan_'; + // text preceding status bar label + this.prfxStatusTxt = 'statusText_'; + + this.tf = tf; + } + + _createClass(StatusBar, [{ + key: 'init', + value: function init() { + var tf = this.tf; + if (!tf.hasGrid() && !tf.isFirstLoad) { + return; + } + + //status bar container + var statusDiv = _Dom2['default'].create('div', ['id', this.prfxStatus + tf.id]); + statusDiv.className = this.statusBarCssClass; + + //status bar label + var statusSpan = _Dom2['default'].create('span', ['id', this.prfxStatusSpan + tf.id]); + //preceding text + var statusSpanText = _Dom2['default'].create('span', ['id', this.prfxStatusTxt + tf.id]); + statusSpanText.appendChild(_Dom2['default'].text(this.statusBarText)); + + // target element container + if (!this.statusBarTgtId) { + tf.setToolbar(); + } + var targetEl = !this.statusBarTgtId ? tf.lDiv : _Dom2['default'].id(this.statusBarTgtId); + + //default container: 'lDiv' + if (!this.statusBarTgtId) { + statusDiv.appendChild(statusSpanText); + statusDiv.appendChild(statusSpan); + targetEl.appendChild(statusDiv); + } else { + // custom container, no need to append statusDiv + targetEl.appendChild(statusSpanText); + targetEl.appendChild(statusSpan); + } + + this.statusBarDiv = statusDiv; + this.statusBarSpan = statusSpan; + this.statusBarSpanText = statusSpanText; + } + }, { + key: 'message', + value: function message() { + var _this = this; + + var t = arguments[0] === undefined ? '' : arguments[0]; + + var tf = this.tf; + if (!tf.statusBar || !this.statusBarSpan) { + return; + } + if (this.onBeforeShowMsg) { + this.onBeforeShowMsg.call(null, this.tf, t); + } + + var d = t === '' ? this.statusBarCloseDelay : 1; + global.setTimeout(function () { + _this.statusBarSpan.innerHTML = t; + if (_this.onAfterShowMsg) { + _this.onAfterShowMsg.call(null, _this.tf, t); + } + }, d); + } + }, { + key: 'destroy', + value: function destroy() { + var tf = this.tf; + if (!tf.hasGrid() || !this.statusBarDiv) { + return; + } + + this.statusBarDiv.innerHTML = ''; + this.statusBarDiv.parentNode.removeChild(this.statusBarDiv); + this.statusBarSpan = null; + this.statusBarSpanText = null; + this.statusBarDiv = null; + } + }]); + + return StatusBar; + })(); + + exports.StatusBar = StatusBar; + +/***/ }, +/* 19 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var Paging = (function () { + + /** + * Pagination component + * @param {Object} tf TableFilter instance + */ + + function Paging(tf) { + _classCallCheck(this, Paging); + + // Configuration object + var f = tf.config(); + + //css class for paging buttons (previous,next,etc.) + this.btnPageCssClass = f.paging_btn_css_class || 'pgInp'; + //stores paging select element + this.pagingSlc = null; + //results per page select element + this.resultsPerPageSlc = null; + //id of container element + this.pagingTgtId = f.paging_target_id || null; + //defines table paging length + this.pagingLength = !isNaN(f.paging_length) ? f.paging_length : 10; + //id of container element + this.resultsPerPageTgtId = f.results_per_page_target_id || null; + //css class for paging select element + this.pgSlcCssClass = f.paging_slc_css_class || 'pgSlc'; + //css class for paging input element + this.pgInpCssClass = f.paging_inp_css_class || 'pgNbInp'; + //stores results per page text and values + this.resultsPerPage = f.results_per_page || null; + //enables/disables results per page drop-down + this.hasResultsPerPage = _Types2['default'].isArray(this.resultsPerPage); + //defines css class for results per page select + this.resultsSlcCssClass = f.results_slc_css_class || 'rspg'; + //css class for label preceding results per page select + this.resultsSpanCssClass = f.results_span_css_class || 'rspgSpan'; + //1st row index of current page + this.startPagingRow = 0; + //total nb of pages + this.nbPages = 0; + //current page nb + this.currentPageNb = 1; + //defines next page button text + this.btnNextPageText = f.btn_next_page_text || '>'; + //defines previous page button text + this.btnPrevPageText = f.btn_prev_page_text || '<'; + //defines last page button text + this.btnLastPageText = f.btn_last_page_text || '>|'; + //defines first page button text + this.btnFirstPageText = f.btn_first_page_text || '|<'; + //defines next page button html + this.btnNextPageHtml = f.btn_next_page_html || (!tf.enableIcons ? null : ''); + //defines previous page button html + this.btnPrevPageHtml = f.btn_prev_page_html || (!tf.enableIcons ? null : ''); + //defines last page button html + this.btnFirstPageHtml = f.btn_first_page_html || (!tf.enableIcons ? null : ''); + //defines previous page button html + this.btnLastPageHtml = f.btn_last_page_html || (!tf.enableIcons ? null : ''); + //defines text preceeding page selector drop-down + this.pageText = f.page_text || ' Page '; + //defines text after page selector drop-down + this.ofText = f.of_text || ' of '; + //css class for span containing tot nb of pages + this.nbPgSpanCssClass = f.nb_pages_css_class || 'nbpg'; + //enables/disables paging buttons + this.hasPagingBtns = f.paging_btns === false ? false : true; + //defines previous page button html + this.pageSelectorType = f.page_selector_type || tf.fltTypeSlc; + //calls function before page is changed + this.onBeforeChangePage = _Types2['default'].isFn(f.on_before_change_page) ? f.on_before_change_page : null; + //calls function before page is changed + this.onAfterChangePage = _Types2['default'].isFn(f.on_after_change_page) ? f.on_after_change_page : null; + + //pages select + this.prfxSlcPages = 'slcPages_'; + //results per page select + this.prfxSlcResults = 'slcResults_'; + //label preciding results per page select + this.prfxSlcResultsTxt = 'slcResultsTxt_'; + //span containing next page button + this.prfxBtnNextSpan = 'btnNextSpan_'; + //span containing previous page button + this.prfxBtnPrevSpan = 'btnPrevSpan_'; + //span containing last page button + this.prfxBtnLastSpan = 'btnLastSpan_'; + //span containing first page button + this.prfxBtnFirstSpan = 'btnFirstSpan_'; + //next button + this.prfxBtnNext = 'btnNext_'; + //previous button + this.prfxBtnPrev = 'btnPrev_'; + //last button + this.prfxBtnLast = 'btnLast_'; + //first button + this.prfxBtnFirst = 'btnFirst_'; + //span for tot nb pages + this.prfxPgSpan = 'pgspan_'; + //span preceding pages select (contains 'Page') + this.prfxPgBeforeSpan = 'pgbeforespan_'; + //span following pages select (contains ' of ') + this.prfxPgAfterSpan = 'pgafterspan_'; + + var start_row = this.refRow; + var nrows = this.nbRows; + //calculates page nb + this.nbPages = Math.ceil((nrows - start_row) / this.pagingLength); + + //Paging elements events + var o = this; + // Paging DOM events + this.evt = { + slcIndex: function slcIndex() { + return o.pageSelectorType === tf.fltTypeSlc ? o.pagingSlc.options.selectedIndex : parseInt(o.pagingSlc.value, 10) - 1; + }, + nbOpts: function nbOpts() { + return o.pageSelectorType === tf.fltTypeSlc ? parseInt(o.pagingSlc.options.length, 10) - 1 : o.nbPages - 1; + }, + next: function next() { + var nextIndex = o.evt.slcIndex() < o.evt.nbOpts() ? o.evt.slcIndex() + 1 : 0; + o.changePage(nextIndex); + }, + prev: function prev() { + var prevIndex = o.evt.slcIndex() > 0 ? o.evt.slcIndex() - 1 : o.evt.nbOpts(); + o.changePage(prevIndex); + }, + last: function last() { + o.changePage(o.evt.nbOpts()); + }, + first: function first() { + o.changePage(0); + }, + _detectKey: function _detectKey(e) { + var key = _Event2['default'].keyCode(e); + if (key === 13) { + if (tf.sorted) { + tf.filter(); + o.changePage(o.evt.slcIndex()); + } else { + o.changePage(); + } + this.blur(); + } + }, + slcPagesChange: null, + nextEvt: null, + prevEvt: null, + lastEvt: null, + firstEvt: null + }; + + this.tf = tf; + } + + _createClass(Paging, [{ + key: 'init', + + /** + * Initialize DOM elements + */ + value: function init() { + var _this = this; + + var slcPages; + var tf = this.tf; + var evt = this.evt; + + // Check resultsPerPage is in expected format and initialise the + // results per page component + if (this.hasResultsPerPage) { + if (this.resultsPerPage.length < 2) { + this.hasResultsPerPage = false; + } else { + this.pagingLength = this.resultsPerPage[1][0]; + this.setResultsPerPage(); + } + } + + evt.slcPagesChange = function (event) { + _this.changePage(); + event.target.blur(); + }; + + // Paging drop-down list selector + if (this.pageSelectorType === tf.fltTypeSlc) { + slcPages = _Dom2['default'].create(tf.fltTypeSlc, ['id', this.prfxSlcPages + tf.id]); + slcPages.className = this.pgSlcCssClass; + _Event2['default'].add(slcPages, 'change', evt.slcPagesChange); + } + + // Paging input selector + if (this.pageSelectorType === tf.fltTypeInp) { + slcPages = _Dom2['default'].create(tf.fltTypeInp, ['id', this.prfxSlcPages + tf.id], ['value', this.currentPageNb]); + slcPages.className = this.pgInpCssClass; + _Event2['default'].add(slcPages, 'keypress', evt._detectKey); + } + + // btns containers + var btnNextSpan = _Dom2['default'].create('span', ['id', this.prfxBtnNextSpan + tf.id]); + var btnPrevSpan = _Dom2['default'].create('span', ['id', this.prfxBtnPrevSpan + tf.id]); + var btnLastSpan = _Dom2['default'].create('span', ['id', this.prfxBtnLastSpan + tf.id]); + var btnFirstSpan = _Dom2['default'].create('span', ['id', this.prfxBtnFirstSpan + tf.id]); + + if (this.hasPagingBtns) { + // Next button + if (!this.btnNextPageHtml) { + var btn_next = _Dom2['default'].create(tf.fltTypeInp, ['id', this.prfxBtnNext + tf.id], ['type', 'button'], ['value', this.btnNextPageText], ['title', 'Next']); + btn_next.className = this.btnPageCssClass; + _Event2['default'].add(btn_next, 'click', evt.next); + btnNextSpan.appendChild(btn_next); + } else { + btnNextSpan.innerHTML = this.btnNextPageHtml; + _Event2['default'].add(btnNextSpan, 'click', evt.next); + } + // Previous button + if (!this.btnPrevPageHtml) { + var btn_prev = _Dom2['default'].create(tf.fltTypeInp, ['id', this.prfxBtnPrev + tf.id], ['type', 'button'], ['value', this.btnPrevPageText], ['title', 'Previous']); + btn_prev.className = this.btnPageCssClass; + _Event2['default'].add(btn_prev, 'click', evt.prev); + btnPrevSpan.appendChild(btn_prev); + } else { + btnPrevSpan.innerHTML = this.btnPrevPageHtml; + _Event2['default'].add(btnPrevSpan, 'click', evt.prev); + } + // Last button + if (!this.btnLastPageHtml) { + var btn_last = _Dom2['default'].create(tf.fltTypeInp, ['id', this.prfxBtnLast + tf.id], ['type', 'button'], ['value', this.btnLastPageText], ['title', 'Last']); + btn_last.className = this.btnPageCssClass; + _Event2['default'].add(btn_last, 'click', evt.last); + btnLastSpan.appendChild(btn_last); + } else { + btnLastSpan.innerHTML = this.btnLastPageHtml; + _Event2['default'].add(btnLastSpan, 'click', evt.last); + } + // First button + if (!this.btnFirstPageHtml) { + var btn_first = _Dom2['default'].create(tf.fltTypeInp, ['id', this.prfxBtnFirst + tf.id], ['type', 'button'], ['value', this.btnFirstPageText], ['title', 'First']); + btn_first.className = this.btnPageCssClass; + _Event2['default'].add(btn_first, 'click', evt.first); + btnFirstSpan.appendChild(btn_first); + } else { + btnFirstSpan.innerHTML = this.btnFirstPageHtml; + _Event2['default'].add(btnFirstSpan, 'click', evt.first); + } + } + + // paging elements (buttons+drop-down list) are added to defined element + if (!this.pagingTgtId) { + tf.setToolbar(); + } + var targetEl = !this.pagingTgtId ? tf.mDiv : _Dom2['default'].id(this.pagingTgtId); + targetEl.appendChild(btnFirstSpan); + targetEl.appendChild(btnPrevSpan); + + var pgBeforeSpan = _Dom2['default'].create('span', ['id', this.prfxPgBeforeSpan + tf.id]); + pgBeforeSpan.appendChild(_Dom2['default'].text(this.pageText)); + pgBeforeSpan.className = this.nbPgSpanCssClass; + targetEl.appendChild(pgBeforeSpan); + targetEl.appendChild(slcPages); + var pgAfterSpan = _Dom2['default'].create('span', ['id', this.prfxPgAfterSpan + tf.id]); + pgAfterSpan.appendChild(_Dom2['default'].text(this.ofText)); + pgAfterSpan.className = this.nbPgSpanCssClass; + targetEl.appendChild(pgAfterSpan); + var pgspan = _Dom2['default'].create('span', ['id', this.prfxPgSpan + tf.id]); + pgspan.className = this.nbPgSpanCssClass; + pgspan.appendChild(_Dom2['default'].text(' ' + this.nbPages + ' ')); + targetEl.appendChild(pgspan); + targetEl.appendChild(btnNextSpan); + targetEl.appendChild(btnLastSpan); + this.pagingSlc = _Dom2['default'].id(this.prfxSlcPages + tf.id); + + // if this.rememberGridValues==true this.setPagingInfo() is called + // in ResetGridValues() method + if (!tf.rememberGridValues || this.isPagingRemoved) { + this.setPagingInfo(); + } + if (!tf.fltGrid) { + tf.validateAllRows(); + this.setPagingInfo(tf.validRowsIndex); + } + + this.isPagingRemoved = false; + } + }, { + key: 'reset', + + /** + * Reset paging when filters are already instantiated + * @param {Boolean} filterTable Execute filtering once paging instanciated + */ + value: function reset() { + var filterTable = arguments[0] === undefined ? false : arguments[0]; + + var tf = this.tf; + if (!tf.hasGrid() || tf.paging) { + return; + } + tf.paging = true; + this.isPagingRemoved = true; + this.init(); + tf.resetValues(); + if (filterTable) { + tf.filter(); + } + } + }, { + key: 'setPagingInfo', + + /** + * Calculate number of pages based on valid rows + * Refresh paging select according to number of pages + * @param {Array} validRows Collection of valid rows + */ + value: function setPagingInfo() { + var validRows = arguments[0] === undefined ? [] : arguments[0]; + + var tf = this.tf; + var rows = tf.tbl.rows; + var mdiv = !this.pagingTgtId ? tf.mDiv : _Dom2['default'].id(this.pagingTgtId); + var pgspan = _Dom2['default'].id(this.prfxPgSpan + tf.id); + + //store valid rows indexes + tf.validRowsIndex = validRows; + + if (validRows.length === 0) { + //counts rows to be grouped + for (var j = tf.refRow; j < tf.nbRows; j++) { + var row = rows[j]; + if (!row) { + continue; + } + + var isRowValid = row.getAttribute('validRow'); + if (_Types2['default'].isNull(isRowValid) || Boolean(isRowValid)) { + tf.validRowsIndex.push(j); + } + } + } + + //calculate nb of pages + this.nbPages = Math.ceil(tf.validRowsIndex.length / this.pagingLength); + //refresh page nb span + pgspan.innerHTML = this.nbPages; + //select clearing shortcut + if (this.pageSelectorType === tf.fltTypeSlc) { + this.pagingSlc.innerHTML = ''; + } + + if (this.nbPages > 0) { + mdiv.style.visibility = 'visible'; + if (this.pageSelectorType === tf.fltTypeSlc) { + for (var z = 0; z < this.nbPages; z++) { + var currOpt = new Option(z + 1, z * this.pagingLength, false, false); + this.pagingSlc.options[z] = currOpt; + } + } else { + //input type + this.pagingSlc.value = this.currentPageNb; + } + } else { + /*** if no results paging select and buttons are hidden ***/ + mdiv.style.visibility = 'hidden'; + } + this.groupByPage(tf.validRowsIndex); + } + }, { + key: 'groupByPage', + + /** + * Group table rows by page and display valid rows + * @param {Array} validRows Collection of valid rows + */ + value: function groupByPage(validRows) { + var tf = this.tf; + var alternateRows = tf.feature('alternateRows'); + var rows = tf.tbl.rows; + var endPagingRow = parseInt(this.startPagingRow, 10) + parseInt(this.pagingLength, 10); + + //store valid rows indexes + if (validRows) { + tf.validRowsIndex = validRows; + } + + //this loop shows valid rows of current page + for (var h = 0, len = tf.validRowsIndex.length; h < len; h++) { + var validRowIdx = tf.validRowsIndex[h]; + var r = rows[validRowIdx]; + var isRowValid = r.getAttribute('validRow'); + + if (h >= this.startPagingRow && h < endPagingRow) { + // if(r.getAttribute('validRow')==='true' || + // !r.getAttribute('validRow')){ + if (_Types2['default'].isNull(isRowValid) || Boolean(isRowValid)) { + r.style.display = ''; + } + if (tf.alternateBgs && alternateRows) { + alternateRows.setRowBg(validRowIdx, h); + } + } else { + r.style.display = 'none'; + if (tf.alternateBgs && alternateRows) { + alternateRows.removeRowBg(validRowIdx); + } + } + } + + tf.nbVisibleRows = tf.validRowsIndex.length; + //re-applies filter behaviours after filtering process + tf.applyProps(); + } + }, { + key: 'getPage', + + /** + * Return the current page number + * @return {Number} Page number + */ + value: function getPage() { + return this.currentPageNb; + } + }, { + key: 'setPage', + + /** + * Show page based on passed param value (string or number): + * @param {String} or {Number} cmd possible string values: 'next', + * 'previous', 'last', 'first' or page number as per param + */ + value: function setPage(cmd) { + var tf = this.tf; + if (!tf.hasGrid() || !tf.paging) { + return; + } + var btnEvt = this.evt, + cmdtype = typeof cmd; + if (cmdtype === 'string') { + switch (_Str2['default'].lower(cmd)) { + case 'next': + btnEvt.next(); + break; + case 'previous': + btnEvt.prev(); + break; + case 'last': + btnEvt.last(); + break; + case 'first': + btnEvt.first(); + break; + default: + btnEvt.next(); + break; + } + } else if (cmdtype === 'number') { + this.changePage(cmd - 1); + } + } + }, { + key: 'setResultsPerPage', + + /** + * Generates UI elements for the number of results per page drop-down + */ + value: function setResultsPerPage() { + var _this2 = this; + + var tf = this.tf; + var evt = this.evt; + + if (!tf.hasGrid() && !tf.isFirstLoad) { + return; + } + if (this.resultsPerPageSlc || !this.resultsPerPage) { + return; + } + + evt.slcResultsChange = function (ev) { + _this2.changeResultsPerPage(); + ev.target.blur(); + }; + + var slcR = _Dom2['default'].create(tf.fltTypeSlc, ['id', this.prfxSlcResults + tf.id]); + slcR.className = tf.resultsSlcCssClass; + var slcRText = this.resultsPerPage[0], + slcROpts = this.resultsPerPage[1]; + var slcRSpan = _Dom2['default'].create('span', ['id', this.prfxSlcResultsTxt + tf.id]); + slcRSpan.className = this.resultsSpanCssClass; + + // results per page select is added to external element + if (!this.resultsPerPageTgtId) { + tf.setToolbar(); + } + var targetEl = !this.resultsPerPageTgtId ? tf.rDiv : _Dom2['default'].id(this.resultsPerPageTgtId); + slcRSpan.appendChild(_Dom2['default'].text(slcRText)); + + var help = tf.feature('help'); + if (help && help.cont) { + help.cont.parentNode.insertBefore(slcRSpan, help.cont); + help.cont.parentNode.insertBefore(slcR, help.cont); + } else { + targetEl.appendChild(slcRSpan); + targetEl.appendChild(slcR); + } + + for (var r = 0; r < slcROpts.length; r++) { + var currOpt = new Option(slcROpts[r], slcROpts[r], false, false); + slcR.options[r] = currOpt; + } + _Event2['default'].add(slcR, 'change', evt.slcResultsChange); + this.resultsPerPageSlc = slcR; + } + }, { + key: 'removeResultsPerPage', + + /** + * Remove number of results per page UI elements + */ + value: function removeResultsPerPage() { + var tf = this.tf; + if (!tf.hasGrid() || !this.resultsPerPageSlc || !this.resultsPerPage) { + return; + } + var slcR = this.resultsPerPageSlc, + slcRSpan = _Dom2['default'].id(this.prfxSlcResultsTxt + tf.id); + if (slcR) { + slcR.parentNode.removeChild(slcR); + } + if (slcRSpan) { + slcRSpan.parentNode.removeChild(slcRSpan); + } + this.resultsPerPageSlc = null; + } + }, { + key: 'changePage', + + /** + * Change the page asynchronously according to passed index + * @param {Number} index Index of the page (0-n) + */ + value: function changePage(index) { + var tf = this.tf; + var evt = tf.Evt; + tf.EvtManager(evt.name.changepage, { pgIndex: index }); + } + }, { + key: 'changeResultsPerPage', + + /** + * Change rows asynchronously according to page results + */ + value: function changeResultsPerPage() { + var tf = this.tf; + var evt = tf.Evt; + tf.EvtManager(evt.name.changeresultsperpage); + } + }, { + key: 'resetPage', + + /** + * Re-set asynchronously page nb at page re-load + */ + value: function resetPage() { + var tf = this.tf; + var evt = tf.Evt; + tf.EvtManager(evt.name.resetpage); + } + }, { + key: 'resetPageLength', + + /** + * Re-set asynchronously page length at page re-load + */ + value: function resetPageLength() { + var tf = this.tf; + var evt = tf.Evt; + tf.EvtManager(evt.name.resetpagelength); + } + }, { + key: '_changePage', + + /** + * Change the page according to passed index + * @param {Number} index Index of the page (0-n) + */ + value: function _changePage(index) { + var tf = this.tf; + + if (!tf.paging) { + return; + } + if (index === null) { + index = this.pageSelectorType === tf.fltTypeSlc ? this.pagingSlc.options.selectedIndex : this.pagingSlc.value - 1; + } + if (index >= 0 && index <= this.nbPages - 1) { + if (this.onBeforeChangePage) { + this.onBeforeChangePage.call(null, this, index); + } + this.currentPageNb = parseInt(index, 10) + 1; + if (this.pageSelectorType === tf.fltTypeSlc) { + this.pagingSlc.options[index].selected = true; + } else { + this.pagingSlc.value = this.currentPageNb; + } + + if (tf.rememberPageNb) { + tf.feature('store').savePageNb(tf.pgNbCookie); + } + this.startPagingRow = this.pageSelectorType === tf.fltTypeSlc ? this.pagingSlc.value : index * this.pagingLength; + + this.groupByPage(); + + if (this.onAfterChangePage) { + this.onAfterChangePage.call(null, this, index); + } + } + } + }, { + key: '_changeResultsPerPage', + + /** + * Change rows according to page results drop-down + * TODO: accept a parameter setting the results per page length + */ + value: function _changeResultsPerPage() { + var tf = this.tf; + + if (!tf.paging) { + return; + } + var slcR = this.resultsPerPageSlc; + var slcPagesSelIndex = this.pageSelectorType === tf.fltTypeSlc ? this.pagingSlc.selectedIndex : parseInt(this.pagingSlc.value - 1, 10); + this.pagingLength = parseInt(slcR.options[slcR.selectedIndex].value, 10); + this.startPagingRow = this.pagingLength * slcPagesSelIndex; + + if (!isNaN(this.pagingLength)) { + if (this.startPagingRow >= tf.nbFilterableRows) { + this.startPagingRow = tf.nbFilterableRows - this.pagingLength; + } + this.setPagingInfo(); + + if (this.pageSelectorType === tf.fltTypeSlc) { + var slcIndex = this.pagingSlc.options.length - 1 <= slcPagesSelIndex ? this.pagingSlc.options.length - 1 : slcPagesSelIndex; + this.pagingSlc.options[slcIndex].selected = true; + } + if (tf.rememberPageLen) { + tf.feature('store').savePageLength(tf.pgLenCookie); + } + } + } + }, { + key: '_resetPage', + + /** + * Re-set page nb at page re-load + */ + value: function _resetPage(name) { + var tf = this.tf; + var pgnb = tf.feature('store').getPageNb(name); + if (pgnb !== '') { + this.changePage(pgnb - 1); + } + } + }, { + key: '_resetPageLength', + + /** + * Re-set page length value at page re-load + */ + value: function _resetPageLength(name) { + var tf = this.tf; + if (!tf.paging) { + return; + } + var pglenIndex = tf.feature('store').getPageLength(name); + + if (pglenIndex !== '') { + this.resultsPerPageSlc.options[pglenIndex].selected = true; + this.changeResultsPerPage(); + } + } + }, { + key: 'destroy', + + /** + * Remove paging feature + */ + value: function destroy() { + var tf = this.tf; + + if (!tf.hasGrid()) { + return; + } + // btns containers + var btnNextSpan = _Dom2['default'].id(this.prfxBtnNextSpan + tf.id); + var btnPrevSpan = _Dom2['default'].id(this.prfxBtnPrevSpan + tf.id); + var btnLastSpan = _Dom2['default'].id(this.prfxBtnLastSpan + tf.id); + var btnFirstSpan = _Dom2['default'].id(this.prfxBtnFirstSpan + tf.id); + //span containing 'Page' text + var pgBeforeSpan = _Dom2['default'].id(this.prfxPgBeforeSpan + tf.id); + //span containing 'of' text + var pgAfterSpan = _Dom2['default'].id(this.prfxPgAfterSpan + tf.id); + //span containing nb of pages + var pgspan = _Dom2['default'].id(this.prfxPgSpan + tf.id); + + var evt = this.evt; + + if (this.pagingSlc) { + if (this.pageSelectorType === tf.fltTypeSlc) { + _Event2['default'].remove(this.pagingSlc, 'change', evt.slcPagesChange); + } else if (this.pageSelectorType === tf.fltTypeInp) { + _Event2['default'].remove(this.pagingSlc, 'keypress', evt._detectKey); + } + this.pagingSlc.parentNode.removeChild(this.pagingSlc); + } + + if (btnNextSpan) { + _Event2['default'].remove(btnNextSpan, 'click', evt.next); + btnNextSpan.parentNode.removeChild(btnNextSpan); + } + + if (btnPrevSpan) { + _Event2['default'].remove(btnPrevSpan, 'click', evt.prev); + btnPrevSpan.parentNode.removeChild(btnPrevSpan); + } + + if (btnLastSpan) { + _Event2['default'].remove(btnLastSpan, 'click', evt.last); + btnLastSpan.parentNode.removeChild(btnLastSpan); + } + + if (btnFirstSpan) { + _Event2['default'].remove(btnFirstSpan, 'click', evt.first); + btnFirstSpan.parentNode.removeChild(btnFirstSpan); + } + + if (pgBeforeSpan) { + pgBeforeSpan.parentNode.removeChild(pgBeforeSpan); + } + + if (pgAfterSpan) { + pgAfterSpan.parentNode.removeChild(pgAfterSpan); + } + + if (pgspan) { + pgspan.parentNode.removeChild(pgspan); + } + + if (this.hasResultsPerPage) { + this.removeResultsPerPage(); + } + + this.pagingSlc = null; + this.nbPages = 0; + this.isPagingRemoved = true; + tf.paging = false; + } + }]); + + return Paging; + })(); + + exports.Paging = Paging; + +/***/ }, +/* 20 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var ClearButton = (function () { + + /** + * Clear button component + * @param {Object} tf TableFilter instance + */ + + function ClearButton(tf) { + _classCallCheck(this, ClearButton); + + // Configuration object + var f = tf.config(); + + //id of container element + this.btnResetTgtId = f.btn_reset_target_id || null; + //reset button element + this.btnResetEl = null; + //defines reset text + this.btnResetText = f.btn_reset_text || 'Reset'; + //defines reset button tooltip + this.btnResetTooltip = f.btn_reset_tooltip || 'Clear filters'; + //defines reset button innerHtml + this.btnResetHtml = f.btn_reset_html || (!tf.enableIcons ? null : ''); + //span containing reset button + this.prfxResetSpan = 'resetspan_'; + + this.tf = tf; + } + + _createClass(ClearButton, [{ + key: 'onClick', + value: function onClick() { + this.tf.clearFilters(); + } + }, { + key: 'init', + + /** + * Build DOM elements + */ + value: function init() { + var _this = this; + + var tf = this.tf; + + if (!tf.hasGrid() && !tf.isFirstLoad && tf.btnResetEl) { + return; + } + + var resetspan = _Dom2['default'].create('span', ['id', this.prfxResetSpan + tf.id]); + + // reset button is added to defined element + if (!this.btnResetTgtId) { + tf.setToolbar(); + } + var targetEl = !this.btnResetTgtId ? tf.rDiv : _Dom2['default'].id(this.btnResetTgtId); + targetEl.appendChild(resetspan); + + if (!this.btnResetHtml) { + var fltreset = _Dom2['default'].create('a', ['href', 'javascript:void(0);']); + fltreset.className = tf.btnResetCssClass; + fltreset.appendChild(_Dom2['default'].text(this.btnResetText)); + resetspan.appendChild(fltreset); + // fltreset.onclick = this.Evt._Clear; + _Event2['default'].add(fltreset, 'click', function () { + _this.onClick(); + }); + } else { + resetspan.innerHTML = this.btnResetHtml; + var resetEl = resetspan.firstChild; + // resetEl.onclick = this.Evt._Clear; + _Event2['default'].add(resetEl, 'click', function () { + _this.onClick(); + }); + } + this.btnResetEl = resetspan.firstChild; + } + }, { + key: 'destroy', + + /** + * Remove clear button UI + */ + value: function destroy() { + var tf = this.tf; + + if (!tf.hasGrid() || !this.btnResetEl) { + return; + } + + var resetspan = _Dom2['default'].id(tf.prfxResetSpan + tf.id); + if (resetspan) { + resetspan.parentNode.removeChild(resetspan); + } + this.btnResetEl = null; + } + }]); + + return ClearButton; + })(); + + exports.ClearButton = ClearButton; + +/***/ }, +/* 21 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var Help = (function () { + + /** + * Help UI component + * @param {Object} tf TableFilter instance + */ + + function Help(tf) { + _classCallCheck(this, Help); + + // Configuration object + var f = tf.config(); + + //id of custom container element for instructions + this.tgtId = f.help_instructions_target_id || null; + //id of custom container element for instructions + this.contTgtId = f.help_instructions_container_target_id || null; + //defines help text + this.instrText = f.help_instructions_text ? f.help_instructions_text : 'Use the filters above each column to filter and limit table ' + 'data. Avanced searches can be performed by using the following ' + 'operators:
<, <=, >, ' + '>=, =, *, !, {, }, ' + '||,&&, [empty], [nonempty], ' + 'rgx:
' + 'Learn more.
'; + //defines help innerHtml + this.instrHtml = f.help_instructions_html || null; + //defines reset button text + this.btnText = f.help_instructions_btn_text || '?'; + //defines reset button innerHtml + this.btnHtml = f.help_instructions_btn_html || null; + //defines css class for help button + this.btnCssClass = f.help_instructions_btn_css_class || 'helpBtn'; + //defines css class for help container + this.contCssClass = f.help_instructions_container_css_class || 'helpCont'; + //help button element + this.btn = null; + //help content div + this.cont = null; + this.defaultHtml = '

TableFilter ' + 'v. ' + tf.version + '

' + 'https://github.com/koalyptus/TableFilter/' + '
©2015-' + tf.year + ' Max Guglielmi.' + '
' + 'Close
'; + + //id prefix for help elements + this.prfxHelpSpan = 'helpSpan_'; + //id prefix for help elements + this.prfxHelpDiv = 'helpDiv_'; + + this.tf = tf; + } + + _createClass(Help, [{ + key: 'init', + value: function init() { + var _this = this; + + if (this.btn) { + return; + } + + var tf = this.tf; + + var helpspan = _Dom2['default'].create('span', ['id', this.prfxHelpSpan + tf.id]); + var helpdiv = _Dom2['default'].create('div', ['id', this.prfxHelpDiv + tf.id]); + + //help button is added to defined element + if (!this.tgtId) { + tf.setToolbar(); + } + var targetEl = !this.tgtId ? tf.rDiv : _Dom2['default'].id(this.tgtId); + targetEl.appendChild(helpspan); + + var divContainer = !this.contTgtId ? helpspan : _Dom2['default'].id(this.contTgtId); + + if (!this.btnHtml) { + divContainer.appendChild(helpdiv); + var helplink = _Dom2['default'].create('a', ['href', 'javascript:void(0);']); + helplink.className = this.btnCssClass; + helplink.appendChild(_Dom2['default'].text(this.btnText)); + helpspan.appendChild(helplink); + _Event2['default'].add(helplink, 'click', function () { + _this.toggle(); + }); + } else { + helpspan.innerHTML = this.btnHtml; + var helpEl = helpspan.firstChild; + _Event2['default'].add(helpEl, 'click', function () { + _this.toggle(); + }); + divContainer.appendChild(helpdiv); + } + + if (!this.instrHtml) { + helpdiv.innerHTML = this.instrText; + helpdiv.className = this.contCssClass; + _Event2['default'].add(helpdiv, 'dblclick', function () { + _this.toggle(); + }); + } else { + if (this.contTgtId) { + divContainer.appendChild(helpdiv); + } + helpdiv.innerHTML = this.instrHtml; + if (!this.contTgtId) { + helpdiv.className = this.contCssClass; + _Event2['default'].add(helpdiv, 'dblclick', function () { + _this.toggle(); + }); + } + } + helpdiv.innerHTML += this.defaultHtml; + _Event2['default'].add(helpdiv, 'click', function () { + _this.toggle(); + }); + + this.cont = helpdiv; + this.btn = helpspan; + } + }, { + key: 'toggle', + + /** + * Toggle help pop-up + */ + value: function toggle() { + if (!this.cont) { + return; + } + var divDisplay = this.cont.style.display; + if (divDisplay === '' || divDisplay === 'none') { + this.cont.style.display = 'inline'; + } else { + this.cont.style.display = 'none'; + } + } + }, { + key: 'destroy', + + /** + * Remove help UI + */ + value: function destroy() { + if (!this.btn) { + return; + } + this.btn.parentNode.removeChild(this.btn); + this.btn = null; + if (!this.cont) { + return; + } + this.cont.parentNode.removeChild(this.cont); + this.cont = null; + } + }]); + + return Help; + })(); + + exports.Help = Help; + +/***/ }, +/* 22 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var AlternateRows = (function () { + + /** + * Alternating rows color + * @param {Object} tf TableFilter instance + */ + + function AlternateRows(tf) { + _classCallCheck(this, AlternateRows); + + var f = tf.config(); + //defines css class for even rows + this.evenCss = f.even_row_css_class || 'even'; + //defines css class for odd rows + this.oddCss = f.odd_row_css_class || 'odd'; + + this.tf = tf; + } + + _createClass(AlternateRows, [{ + key: 'init', + + /** + * Sets alternating rows color + */ + value: function init() { + var tf = this.tf; + if (!tf.hasGrid() && !tf.isFirstLoad) { + return; + } + var validRowsIndex = tf.validRowsIndex; + var noValidRowsIndex = validRowsIndex === null; + //1st index + var beginIndex = noValidRowsIndex ? tf.refRow : 0; + // nb indexes + var indexLen = noValidRowsIndex ? tf.nbFilterableRows + beginIndex : validRowsIndex.length; + var idx = 0; + + //alternates bg color + for (var j = beginIndex; j < indexLen; j++) { + var rowIdx = noValidRowsIndex ? j : validRowsIndex[j]; + this.setRowBg(rowIdx, idx); + idx++; + } + } + }, { + key: 'setRowBg', + + /** + * Sets row background color + * @param {Number} rowIdx Row index + * @param {Number} idx Valid rows collection index needed to calculate bg + * color + */ + value: function setRowBg(rowIdx, idx) { + if (!this.tf.alternateBgs || isNaN(rowIdx)) { + return; + } + var rows = this.tf.tbl.rows; + var i = isNaN(idx) ? rowIdx : idx; + this.removeRowBg(rowIdx); + + _Dom2['default'].addClass(rows[rowIdx], i % 2 ? this.evenCss : this.oddCss); + } + }, { + key: 'removeRowBg', + + /** + * Removes row background color + * @param {Number} idx Row index + */ + value: function removeRowBg(idx) { + if (isNaN(idx)) { + return; + } + var rows = this.tf.tbl.rows; + _Dom2['default'].removeClass(rows[idx], this.oddCss); + _Dom2['default'].removeClass(rows[idx], this.evenCss); + } + }, { + key: 'remove', + + /** + * Removes all alternating backgrounds + */ + value: function remove() { + if (!this.tf.hasGrid()) { + return; + } + for (var i = this.tf.refRow; i < this.tf.nbRows; i++) { + this.removeRowBg(i); + } + } + }, { + key: 'enable', + value: function enable() { + this.tf.alternateBgs = true; + } + }, { + key: 'disable', + value: function disable() { + this.tf.alternateBgs = false; + } + }]); + + return AlternateRows; + })(); + + exports.AlternateRows = AlternateRows; + +/***/ }, +/* 23 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + exports['default'] = { + ignoreCase: function ignoreCase(a, b) { + var x = _Str2['default'].lower(a); + var y = _Str2['default'].lower(b); + return x < y ? -1 : x > y ? 1 : 0; + } + }; + module.exports = exports['default']; + +/***/ } +/******/ ]) +}); +; +//# sourceMappingURL=tablefilter.js.map \ No newline at end of file diff --git a/dist/tablefilter/tf-1.js b/dist/tablefilter/tf-1.js index 02977dfe..95f92d7a 100644 --- a/dist/tablefilter/tf-1.js +++ b/dist/tablefilter/tf-1.js @@ -1,8 +1,2223 @@ -/** - * TableFilter v0.0.0 by Max Guglielmi - * build date: 2015-07-10T07:12:21.982Z - * MIT License - */ +webpackJsonp([1],[ +/* 0 */, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { -webpackJsonp([1],[,function(t,e,s){function i(t){return s(l(t))}function l(t){return a[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var a={"./array":7,"./array.js":7,"./cookie":5,"./cookie.js":5,"./date":8,"./date.js":8,"./dom":3,"./dom.js":3,"./event":2,"./event.js":2,"./extensions/advancedGrid/adapterEzEditTable":24,"./extensions/advancedGrid/adapterEzEditTable.js":24,"./extensions/advancedGrid/advancedGrid":25,"./extensions/advancedGrid/advancedGrid.js":25,"./extensions/colOps/colOps":26,"./extensions/colOps/colOps.js":26,"./extensions/colsVisibility/colsVisibility":27,"./extensions/colsVisibility/colsVisibility.js":27,"./extensions/filtersVisibility/filtersVisibility":28,"./extensions/filtersVisibility/filtersVisibility.js":28,"./extensions/sort/adapterSortabletable":29,"./extensions/sort/adapterSortabletable.js":29,"./extensions/sort/sort":30,"./extensions/sort/sort.js":30,"./helpers":9,"./helpers.js":9,"./modules/alternateRows":22,"./modules/alternateRows.js":22,"./modules/checkList":16,"./modules/checkList.js":16,"./modules/clearButton":20,"./modules/clearButton.js":20,"./modules/dropdown":15,"./modules/dropdown.js":15,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":21,"./modules/help.js":21,"./modules/highlightKeywords":13,"./modules/highlightKeywords.js":13,"./modules/loader":12,"./modules/loader.js":12,"./modules/paging":19,"./modules/paging.js":19,"./modules/popupFilter":14,"./modules/popupFilter.js":14,"./modules/rowsCounter":17,"./modules/rowsCounter.js":17,"./modules/statusBar":18,"./modules/statusBar.js":18,"./modules/store":10,"./modules/store.js":10,"./sort":23,"./sort.js":23,"./string":4,"./string.js":4,"./types":6,"./types.js":6};i.keys=function(){return Object.keys(a)},i.resolve=l,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&!s.startRow?void 0:s.startRow||e.refRow,s.base_path=s.base_path||e.basePath+"ezEditTable/";var l=s.editable,a=s.selectable;s.selection=a,a&&(s.default_selection=s.default_selection||"row"),s.active_cell_css=s.active_cell_css||"ezETSelectedCell";var n=0,o=0;if(a){var d=function(t,s,i){var l=t.Selection,a=function(i){if("row"===t.defaultSelection)l.SelectRowByIndex(i);else{t.ClearSelections();var a=s.cellIndex,n=e.tbl.rows[i];"both"===t.defaultSelection&&l.SelectRowByIndex(i),n&&l.SelectCell(n.cells[a])}if(e.validRowsIndex.length!==e.getRowsNb()){var r=e.tbl.rows[i];r&&r.scrollIntoView(!1),f&&(f.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===f.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:f.scrollIntoView(!1))}};if(e.validRowsIndex){var r,d=e.validRowsIndex,u=d.length,c="row"!==t.defaultSelection?s.parentNode:s,f="TD"===s.nodeName?s:null,p=void 0!==i?t.Event.GetKey(i):0,g=h["default"].has(d,c.rowIndex),v=34===p||33===p?e.feature("paging").pagingLength||t.nbRowsPerPage:1;if(g)34!==p&&33!==p?(n=h["default"].indexByValue(d,c.rowIndex),o=c.rowIndex):(r=34===p?u-1>=n+v?d[n+v]:[u-1]:n-v<=d[0]?d[0]:d[n-v],o=r,n=h["default"].indexByValue(d,r),a(r));else{if(c.rowIndex>o)if(c.rowIndex>=d[u-1])r=d[u-1];else{var b=n+v;r=b>u-1?d[u-1]:d[b]}else if(c.rowIndex<=d[0])r=d[0];else{var m=d[n-v];r=m?m:d[0]}o=c.rowIndex,a(r)}}},u=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.feature("paging").nbPages>1){var l=e.feature("paging");t.nbRowsPerPage=l.pagingLength;var a=e.validRowsIndex,n=a.length,r=parseInt(l.startPagingRow,10)+parseInt(l.pagingLength,10),o=i.rowIndex;o===a[n-1]&&l.currentPageNb!==l.nbPages?l.setPage("last"):o==a[0]&&1!==l.currentPageNb?l.setPage("first"):o>a[r-1]&&oa[0]&&l.setPage("previous")}};if(e.paging&&(e.feature("paging").onAfterChangePage=function(t){var e=t.tf.extension("advancedGrid"),s=e._ezEditTable,i=s.Selection,l=i.GetActiveRow();l&&l.scrollIntoView(!1);var a=i.GetActiveCell();a&&a.scrollIntoView(!1)}),"row"===s.default_selection){var c=s.on_before_selected_row;s.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var f=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])}}else{var p=s.on_before_selected_cell;s.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])};var g=s.on_after_selected_cell;s.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])}}}if(l){var v=s.on_added_dom_row;if(s.on_added_dom_row=function(){e.nbFilterableRows++,e.paging?(e.nbRows++,e.nbVisibleRows++,e.nbFilterableRows++,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset()):e.feature("rowsCounter").refresh(),e.alternateBgs&&e.feature("alternateRows").init(),v&&v.call(null,arguments[0],arguments[1],arguments[2])},s.actions&&s.actions["delete"]){var b=s.actions["delete"].on_after_submit;s.actions["delete"].on_after_submit=function(){e.nbFilterableRows--,e.paging?(e.nbRows--,e.nbVisibleRows--,e.nbFilterableRows--,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset(!1)):e.feature("rowsCounter").refresh(),e.alternateBgs&&e.feature("alternateRows").init(),b&&b.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(m){throw new Error(this.err)}this.initialized=!0}},{key:"reset",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&t.Selection.Set(),this.cfg.editable&&t.Editable.Set())}},{key:"destroy",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.initialized=!1}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(24),a=i(l);e["default"]=a["default"],t.exports=e["default"]},function(module,exports,__webpack_require__){"use strict";var _interopRequireDefault=function(t){return t&&t.__esModule?t:{"default":t}},_classCallCheck=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},_createClass=function(){function t(t,e){for(var s=0;s=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_Str2["default"].lower(typeof labelId)&&"object"==_Str2["default"].lower(typeof colIndex)&&"object"==_Str2["default"].lower(typeof operation))for(var rows=tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(tf.getColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),_Dom2["default"].id(labThisCol[i]))switch(_Str2["default"].lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom2["default"].id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom2["default"].id(labThisCol[i]).firstChild,txtnode=_Dom2["default"].text(result);_Dom2["default"].id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?rows[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,tf)}}},{key:"destroy",value:function(){}}]),ColOps}();exports["default"]=ColOps,module.exports=exports["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0,this.onLoaded=h["default"].isFn(s.on_loaded)?s.on_loaded:null,this.onBeforeOpen=h["default"].isFn(s.on_before_open)?s.on_before_open:null,this.onAfterOpen=h["default"].isFn(s.on_after_open)?s.on_after_open:null,this.onBeforeClose=h["default"].isFn(s.on_before_close)?s.on_before_close:null,this.onAfterClose=h["default"].isFn(s.on_after_close)?s.on_after_close:null,this.onBeforeColHidden=h["default"].isFn(s.on_before_col_hidden)?s.on_before_col_hidden:null,this.onAfterColHidden=h["default"].isFn(s.on_after_col_hidden)?s.on_after_col_hidden:null,this.onBeforeColDisplayed=h["default"].isFn(s.on_before_col_displayed)?s.on_before_col_displayed:null,this.onAfterColDisplayed=h["default"].isFn(s.on_after_col_displayed)?s.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.feature("gridLayout").headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](s.name+"Style",e.stylePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,l=this.onAfterClose;e&&"inline"!==t&&e.call(null,this),s&&"inline"===t&&s.call(null,this),this.contEl.style.display="inline"===t?"none":"inline",i&&"inline"!==t&&i.call(null,this),l&&"inline"===t&&l.call(null,this)}},{key:"checkItem",value:function(t){var e=t.parentNode;if(e&&t){var s=t.firstChild.checked,i=t.firstChild.getAttribute("id").split("_")[1];i=parseInt(i,10),s?r["default"].addClass(e,this.listSlcItemCssClass):r["default"].removeClass(e,this.listSlcItemCssClass);var l=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(l=!0),this.setHidden(i,l)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var t=this;if(!this.btnEl){var e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?r["default"].id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}if(this.btnHtml){s.innerHTML=this.btnHtml;var a=s.firstChild;this.enableHover?u["default"].add(a,"mouseover",function(e){t.toggle(e)}):u["default"].add(a,"click",function(e){t.toggle(e)})}else{var n=r["default"].create("a",["href","javascript:;"]);n.className=this.btnCssClass,n.title=this.desc,n.innerHTML=this.btnText,s.appendChild(n),this.enableHover?u["default"].add(n,"mouseover",function(e){t.toggle(e)}):u["default"].add(n,"click",function(e){t.toggle(e)})}this.spanEl=s,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var t=this,e=this.tf,s=this.contElTgtId?r["default"].id(this.contElTgtId):r["default"].create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=r["default"].create("p");i.innerHTML=this.text,s.appendChild(i);var l=r["default"].create("ul",["id","ul"+this.name+"_"+e.id]);l.className=this.listCssClass;var a=this.headersTbl?this.headersTbl:e.tbl,n=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),o=a.rows[n];if(this.enableTickAll){var h=r["default"].createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);r["default"].addClass(h,this.listItemCssClass),l.appendChild(h),h.check.checked=!this.tickToHide,u["default"].add(h.check,"click",function(){for(var t=0;t',this.icnCollapseHtml='Collapse filters',this.defaultText="Toggle filters",this.targetId=s.target_id||null,this.enableIcon=s.enable_icon===!1?!1:!0,this.btnText=s.btn_text||"",this.collapseBtnHtml=this.enableIcon?this.icnCollapseHtml+this.btnText:this.btnText||this.defaultText,this.expandBtnHtml=this.enableIcon?this.icnExpandHtml+this.btnText:this.btnText||this.defaultText,this.btnHtml=s.btn_html||null,this.btnCssClass=s.btn_css_class||"btnExpClpFlt",this.contCssClass=s.cont_css_class||"expClpFlt",this.filtersRowIndex=h["default"].isUndef(s.filters_row_index)?e.getFiltersRowIndex():s.filters_row_index,this.visibleAtStart=h["default"].isUndef(s.visible_at_start)?!0:Boolean(s.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=h["default"].isFn(s.on_before_show)?s.on_before_show:null,this.onAfterShow=h["default"].isFn(s.on_after_show)?s.on_after_show:null,this.onBeforeHide=h["default"].isFn(s.on_before_hide)?s.on_before_hide:null,this.onAfterHide=h["default"].isFn(s.on_after_hide)?s.on_after_hide:null,e["import"](s.name+"Style",e.stylePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"init",value:function(){this.initialized||(this.buildUI(),this.initialized=!0)}},{key:"buildUI",value:function(){var t=this,e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.contCssClass,this.targetId||e.setToolbar();var i=this.targetId?r["default"].id(this.targetId):e.rDiv;if(this.targetId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}var a=void 0;this.btnHtml?(s.innerHTML=this.btnHtml,a=s.firstChild,u["default"].add(a,"click",function(){return t.toggle()})):(a=r["default"].create("a",["href","javascript:void(0);"]),a.className=this.btnCssClass,a.title=this.btnText||this.defaultText,a.innerHTML=this.collapseBtnHtml,s.appendChild(a),u["default"].add(a,"click",function(){return t.toggle()})),this.contEl=s,this.btnEl=a,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function(){var t=this.tf,e=t.gridLayout?t.feature("gridLayout").headTbl:t.tbl,s=e.rows[this.filtersRowIndex],i=s.style.display;this.onBeforeShow&&""!=i&&this.onBeforeShow.call(this,this),this.onBeforeHide&&""===i&&this.onBeforeHide.call(null,this),s.style.display=""===i?"none":"",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=""===i?this.expandBtnHtml:this.collapseBtnHtml),this.onAfterShow&&""!=i&&this.onAfterShow.call(null,this),this.onAfterHide&&""===i&&this.onAfterHide.call(null,this)}},{key:"destroy",value:function(){(this.btnEl||this.contEl)&&(this.btnEl.innerHTML="",this.btnEl.parentNode.removeChild(this.btnEl),this.btnEl=null,this.contEl.innerHTML="",this.contEl.parentNode.removeChild(this.contEl),this.contEl=null,this.initialized=!1)}}]),t}();e["default"]=c,t.exports=e["default"]},function(t,e,s){"use strict";function i(t){return S["default"].removeNbFormat(t,"us")}function l(t){return S["default"].removeNbFormat(t,"eu")}function a(t,e){return x["default"].format(t,e)}function n(t){return a(t,"DMY")}function r(t){return a(t,"MDY")}function o(t){return a(t,"YMD")}function h(t){return a(t,"DDMMMYYYY")}function d(t){var e=t.split(".");for(var s in e){for(var i=e[s];3>i.length;)i="0"+i;e[s]=i}return e.join(".")}function u(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var c=function(t){return t&&t.__esModule?t:{"default":t}},f=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},p=function(){function t(t,e){for(var s=0;si;i++);return i},SortableTable.prototype.initHeader=function(s){var i=this;if(!i.tHead){if(!e.gridLayout)return;i.tHead=e.feature("gridLayout").headTbl.tHead}i.headersRow=e.headersRow;var l=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var a=l.length,n=void 0,r=void 0,o=0;a>o;o++)r=l[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(r.style.cursor="pointer",n=m["default"].create("img",["src",t.imgPath+t.imgBlank]),r.appendChild(n),null!==i.sortTypes[o]&&r.setAttribute("_sortType",i.sortTypes[o]),w["default"].add(r,"click",i._headerOnclick)):(r.setAttribute("_sortType",s[o]),r._sortType="None");i.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var e=this,s=void 0,i=void 0,l=void 0;if(t.asyncSort&&t.triggerIds.length>0){var a=t.triggerIds;s=[],i=a.length;for(var n=0;nr;r++){var o=s[r].getAttribute("_sortType");null!==o&&"None"!==o&&(l=s[r].lastChild||s[r],"img"!==l.nodeName.toLowerCase()&&(l=m["default"].create("img",["src",t.imgPath+t.imgBlank]),s[r].appendChild(l)),r===e.sortColumn?l.className=t.imgClassName+" "+(this.descending?t.imgDescClassName:t.imgAscClassName):l.className=t.imgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,l=i._sortTypeInfo[e];if(l&&l.getRowValue)return l.getRowValue(t,s);var a=t.cells[s],n=SortableTable.getInnerText(a);return i.getValueFromString(n,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.customKey)?e.getAttribute(t.customKey):m["default"].getText(e):void 0}}},{key:"addSortType",value:function(){var t=arguments;SortableTable.prototype.addSortType(t[0],t[1],t[2],t[3])}},{key:"setSortTypes",value:function(){for(var t=this,e=this.tf,s=this.sortTypes,a=[],c=0;c0&&!function(){for(var e=t.triggerIds,s=0;s descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.element = oTable;\r\n this.setTHead( oTable.tHead );\r\n this.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n if (this.tHead && this.tHead != oTHead )\r\n this.uninitHeader();\r\n this.tHead = oTHead;\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n this.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.sortTypes = oSortTypes || [];\r\n if ( this.tHead )\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var doc = this.tHead.ownerDocument || this.tHead.document;\r\n this.sortTypes = oSortTypes || [];\r\n var l = cells.length;\r\n var img, c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n img = doc.createElement("IMG");\r\n img.src = "images/blank.png";\r\n c.appendChild(img);\r\n if (this.sortTypes[i] != null)\r\n c._sortType = this.sortTypes[i];\r\n if (typeof c.addEventListener != "undefined")\r\n c.addEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.attachEvent != "undefined")\r\n c.attachEvent("onclick", this._headerOnclick);\r\n else\r\n c.onclick = this._headerOnclick;\r\n }\r\n else\r\n {\r\n c.setAttribute( "_sortType", oSortTypes[i] );\r\n c._sortType = "None";\r\n }\r\n }\r\n this.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (c._sortType != null && c._sortType != "None") {\r\n c.removeChild(c.lastChild);\r\n if (typeof c.removeEventListener != "undefined")\r\n c.removeEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.detachEvent != "undefined")\r\n c.detachEvent("onclick", this._headerOnclick);\r\n c._sortType = null;\r\n c.removeAttribute( "_sortType" );\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var img;\r\n for (var i = 0; i < l; i++) {\r\n if (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n img = cells[i].lastChild;\r\n if (i == this.sortColumn)\r\n img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n else\r\n img.className = "sort-arrow";\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n // find TD element\r\n var el = e.target || e.srcElement;\r\n while (el.tagName != "TD")\r\n el = el.parentNode;\r\n\r\n this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n var cells = oTd.parentNode.childNodes\r\n var l = cells.length;\r\n var i;\r\n for (i = 0; cells[i] != oTd && i < l; i++)\r\n ;\r\n return i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n return this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n if (!this.tBody) return;\r\n if (sSortType == null)\r\n sSortType = this.getSortType(nColumn);\r\n\r\n // exit if None\r\n if (sSortType == "None")\r\n return;\r\n\r\n if (bDescending == null) {\r\n if (this.sortColumn != nColumn)\r\n this.descending = this.defaultDescending;\r\n else\r\n this.descending = !this.descending;\r\n }\r\n else\r\n this.descending = bDescending;\r\n\r\n this.sortColumn = nColumn;\r\n\r\n if (typeof this.onbeforesort == "function")\r\n this.onbeforesort();\r\n\r\n var f = this.getSortFunction(sSortType, nColumn);\r\n var a = this.getCache(sSortType, nColumn);\r\n var tBody = this.tBody;\r\n\r\n a.sort(f);\r\n\r\n if (this.descending)\r\n a.reverse();\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // remove from doc\r\n var nextSibling = tBody.nextSibling;\r\n var p = tBody.parentNode;\r\n p.removeChild(tBody);\r\n }\r\n\r\n // insert in the new order\r\n var l = a.length;\r\n for (var i = 0; i < l; i++)\r\n tBody.appendChild(a[i].element);\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // insert into doc\r\n p.insertBefore(tBody, nextSibling);\r\n }\r\n\r\n this.updateHeaderArrows();\r\n\r\n this.destroyCache(a);\r\n\r\n if (typeof this.onsort == "function")\r\n this.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n var oThis = this;\r\n this._asyncsort = function () {\r\n oThis.sort(nColumn, bDescending, sSortType);\r\n };\r\n window.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n if (!this.tBody) return [];\r\n var rows = this.tBody.rows;\r\n var l = rows.length;\r\n var a = new Array(l);\r\n var r;\r\n for (var i = 0; i < l; i++) {\r\n r = rows[i];\r\n a[i] = {\r\n value: this.getRowValue(r, sType, nColumn),\r\n element: r\r\n };\r\n };\r\n return a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n var l = oArray.length;\r\n for (var i = 0; i < l; i++) {\r\n oArray[i].value = null;\r\n oArray[i].element = null;\r\n oArray[i] = null;\r\n }\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n // if we have defined a custom getRowValue use that\r\n if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n return this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n var s;\r\n var c = oRow.cells[nColumn];\r\n if (typeof c.innerText != "undefined")\r\n s = c.innerText;\r\n else\r\n s = SortableTable.getInnerText(c);\r\n return this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n var s = "";\r\n var cs = oNode.childNodes;\r\n var l = cs.length;\r\n for (var i = 0; i < l; i++) {\r\n switch (cs[i].nodeType) {\r\n case 1: //ELEMENT_NODE\r\n s += SortableTable.getInnerText(cs[i]);\r\n break;\r\n case 3: //TEXT_NODE\r\n s += cs[i].nodeValue;\r\n break;\r\n }\r\n }\r\n return s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].getValueFromString( sText );\r\n return sText;\r\n /*\r\n switch (sType) {\r\n case "Number":\r\n return Number(sText);\r\n case "CaseInsensitiveString":\r\n return sText.toUpperCase();\r\n case "Date":\r\n var parts = sText.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n }\r\n return sText;\r\n */\r\n };\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].compare;\r\n return SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n this.uninitHeader();\r\n var win = this.document.parentWindow;\r\n if (win && typeof win.detachEvent != "undefined") { // only IE needs this\r\n win.detachEvent("onunload", this._onunload);\r\n }\r\n this._onunload = null;\r\n this.element = null;\r\n this.tHead = null;\r\n this.tBody = null;\r\n this.document = null;\r\n this._headerOnclick = null;\r\n this.sortTypes = null;\r\n this._asyncsort = null;\r\n this.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n this._sortTypeInfo[sType] = {\r\n type: sType,\r\n getValueFromString: fGetValueFromString || SortableTable.idFunction,\r\n compare: fCompareFunction || SortableTable.basicCompare,\r\n getRowValue: fGetRowValue\r\n };\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n delete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n if (n1.value < n2.value)\r\n return -1;\r\n if (n2.value < n1.value)\r\n return 1;\r\n return 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n return x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n return s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n var parts = s.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'}]); \ No newline at end of file + var map = { + "./array": 7, + "./array.js": 7, + "./cookie": 5, + "./cookie.js": 5, + "./date": 8, + "./date.js": 8, + "./dom": 3, + "./dom.js": 3, + "./event": 2, + "./event.js": 2, + "./extensions/advancedGrid/adapterEzEditTable": 24, + "./extensions/advancedGrid/adapterEzEditTable.js": 24, + "./extensions/advancedGrid/advancedGrid": 25, + "./extensions/advancedGrid/advancedGrid.js": 25, + "./extensions/colOps/colOps": 26, + "./extensions/colOps/colOps.js": 26, + "./extensions/colsVisibility/colsVisibility": 27, + "./extensions/colsVisibility/colsVisibility.js": 27, + "./extensions/filtersVisibility/filtersVisibility": 28, + "./extensions/filtersVisibility/filtersVisibility.js": 28, + "./extensions/sort/adapterSortabletable": 29, + "./extensions/sort/adapterSortabletable.js": 29, + "./extensions/sort/sort": 30, + "./extensions/sort/sort.js": 30, + "./helpers": 9, + "./helpers.js": 9, + "./modules/alternateRows": 22, + "./modules/alternateRows.js": 22, + "./modules/checkList": 16, + "./modules/checkList.js": 16, + "./modules/clearButton": 20, + "./modules/clearButton.js": 20, + "./modules/dropdown": 15, + "./modules/dropdown.js": 15, + "./modules/gridLayout": 11, + "./modules/gridLayout.js": 11, + "./modules/help": 21, + "./modules/help.js": 21, + "./modules/highlightKeywords": 13, + "./modules/highlightKeywords.js": 13, + "./modules/loader": 12, + "./modules/loader.js": 12, + "./modules/paging": 19, + "./modules/paging.js": 19, + "./modules/popupFilter": 14, + "./modules/popupFilter.js": 14, + "./modules/rowsCounter": 17, + "./modules/rowsCounter.js": 17, + "./modules/statusBar": 18, + "./modules/statusBar.js": 18, + "./modules/store": 10, + "./modules/store.js": 10, + "./sort": 23, + "./sort.js": 23, + "./string": 4, + "./string.js": 4, + "./types": 6, + "./types.js": 6 + }; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }()); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 1; + + +/***/ }, +/* 2 */, +/* 3 */, +/* 4 */, +/* 5 */, +/* 6 */, +/* 7 */, +/* 8 */, +/* 9 */, +/* 10 */, +/* 11 */, +/* 12 */, +/* 13 */, +/* 14 */, +/* 15 */, +/* 16 */, +/* 17 */, +/* 18 */, +/* 19 */, +/* 20 */, +/* 21 */, +/* 22 */, +/* 23 */, +/* 24 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var AdapterEzEditTable = (function () { + /** + * Adapter module for ezEditTable, an external library providing advanced + * grid features (selection and edition): + * http://codecanyon.net/item/ezedittable-enhance-html-tables/2425123?ref=koalyptus + * + * @param {Object} tf TableFilter instance + */ + + function AdapterEzEditTable(tf, cfg) { + _classCallCheck(this, AdapterEzEditTable); + + // ezEditTable config + this.initialized = false; + this.desc = cfg.description || 'ezEditTable adapter'; + this.filename = cfg.filename || 'ezEditTable.js'; + this.vendorPath = cfg.vendor_path; + this.loadStylesheet = Boolean(cfg.load_stylesheet); + this.stylesheet = cfg.stylesheet || this.vendorPath + 'ezEditTable.css'; + this.stylesheetName = cfg.stylesheet_name || 'ezEditTableCss'; + this.err = 'Failed to instantiate EditTable object.\n"ezEditTable" ' + 'dependency not found.'; + + this._ezEditTable = null; + this.cfg = cfg; + this.tf = tf; + } + + _createClass(AdapterEzEditTable, [{ + key: 'init', + + /** + * Conditionally load ezEditTable library and set advanced grid + * @return {[type]} [description] + */ + value: function init() { + var _this = this; + + var tf = this.tf; + if (window.EditTable) { + this._setAdvancedGrid(); + } else { + var path = this.vendorPath + this.filename; + tf['import'](this.filename, path, function () { + _this._setAdvancedGrid(); + }); + } + if (this.loadStylesheet && !tf.isImported(this.stylesheet, 'link')) { + tf['import'](this.stylesheetName, this.stylesheet, null, 'link'); + } + } + }, { + key: '_setAdvancedGrid', + + /** + * Instantiate ezEditTable component for advanced grid features + */ + value: function _setAdvancedGrid() { + var tf = this.tf; + + //start row for EditTable constructor needs to be calculated + var startRow, + cfg = this.cfg, + thead = _Dom2['default'].tag(tf.tbl, 'thead'); + + //if thead exists and startRow not specified, startRow is calculated + //automatically by EditTable + if (thead.length > 0 && !cfg.startRow) { + startRow = undefined; + } + //otherwise startRow config property if any or TableFilter refRow + else { + startRow = cfg.startRow || tf.refRow; + } + + cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/'; + var editable = cfg.editable; + var selectable = cfg.selectable; + cfg.selection = selectable; + + if (selectable) { + cfg.default_selection = cfg.default_selection || 'row'; + } + //CSS Styles + cfg.active_cell_css = cfg.active_cell_css || 'ezETSelectedCell'; + + var _lastValidRowIndex = 0; + var _lastRowIndex = 0; + + if (selectable) { + //Row navigation needs to be calculated according to TableFilter's + //validRowsIndex array + var onAfterSelection = function onAfterSelection(et, selectedElm, e) { + var slc = et.Selection; + //Next valid filtered row needs to be selected + var doSelect = function doSelect(nextRowIndex) { + if (et.defaultSelection === 'row') { + slc.SelectRowByIndex(nextRowIndex); + } else { + et.ClearSelections(); + var cellIndex = selectedElm.cellIndex, + row = tf.tbl.rows[nextRowIndex]; + if (et.defaultSelection === 'both') { + slc.SelectRowByIndex(nextRowIndex); + } + if (row) { + slc.SelectCell(row.cells[cellIndex]); + } + } + //Table is filtered + if (tf.validRowsIndex.length !== tf.getRowsNb()) { + var r = tf.tbl.rows[nextRowIndex]; + if (r) { + r.scrollIntoView(false); + } + if (cell) { + if (cell.cellIndex === tf.getCellsNb() - 1 && tf.gridLayout) { + tf.tblCont.scrollLeft = 100000000; + } else if (cell.cellIndex === 0 && tf.gridLayout) { + tf.tblCont.scrollLeft = 0; + } else { + cell.scrollIntoView(false); + } + } + } + }; + + //table is not filtered + if (!tf.validRowsIndex) { + return; + } + var validIndexes = tf.validRowsIndex, + validIdxLen = validIndexes.length, + row = et.defaultSelection !== 'row' ? selectedElm.parentNode : selectedElm, + + //cell for default_selection = 'both' or 'cell' + cell = selectedElm.nodeName === 'TD' ? selectedElm : null, + keyCode = e !== undefined ? et.Event.GetKey(e) : 0, + isRowValid = _Arr2['default'].has(validIndexes, row.rowIndex), + nextRowIndex, + + //pgup/pgdown keys + d = keyCode === 34 || keyCode === 33 ? tf.feature('paging').pagingLength || et.nbRowsPerPage : 1; + + //If next row is not valid, next valid filtered row needs to be + //calculated + if (!isRowValid) { + //Selection direction up/down + if (row.rowIndex > _lastRowIndex) { + //last row + if (row.rowIndex >= validIndexes[validIdxLen - 1]) { + nextRowIndex = validIndexes[validIdxLen - 1]; + } else { + var calcRowIndex = _lastValidRowIndex + d; + if (calcRowIndex > validIdxLen - 1) { + nextRowIndex = validIndexes[validIdxLen - 1]; + } else { + nextRowIndex = validIndexes[calcRowIndex]; + } + } + } else { + //first row + if (row.rowIndex <= validIndexes[0]) { + nextRowIndex = validIndexes[0]; + } else { + var v = validIndexes[_lastValidRowIndex - d]; + nextRowIndex = v ? v : validIndexes[0]; + } + } + _lastRowIndex = row.rowIndex; + doSelect(nextRowIndex); + } else { + //If filtered row is valid, special calculation for + //pgup/pgdown keys + if (keyCode !== 34 && keyCode !== 33) { + _lastValidRowIndex = _Arr2['default'].indexByValue(validIndexes, row.rowIndex); + _lastRowIndex = row.rowIndex; + } else { + if (keyCode === 34) { + //pgdown + //last row + if (_lastValidRowIndex + d <= validIdxLen - 1) { + nextRowIndex = validIndexes[_lastValidRowIndex + d]; + } else { + nextRowIndex = [validIdxLen - 1]; + } + } else { + //pgup + //first row + if (_lastValidRowIndex - d <= validIndexes[0]) { + nextRowIndex = validIndexes[0]; + } else { + nextRowIndex = validIndexes[_lastValidRowIndex - d]; + } + } + _lastRowIndex = nextRowIndex; + _lastValidRowIndex = _Arr2['default'].indexByValue(validIndexes, nextRowIndex); + doSelect(nextRowIndex); + } + } + }; + + //Page navigation has to be enforced whenever selected row is out of + //the current page range + var onBeforeSelection = function onBeforeSelection(et, selectedElm) { + var row = et.defaultSelection !== 'row' ? selectedElm.parentNode : selectedElm; + if (tf.paging) { + if (tf.feature('paging').nbPages > 1) { + var paging = tf.feature('paging'); + //page length is re-assigned in case it has changed + et.nbRowsPerPage = paging.pagingLength; + var validIndexes = tf.validRowsIndex, + validIdxLen = validIndexes.length, + pagingEndRow = parseInt(paging.startPagingRow, 10) + parseInt(paging.pagingLength, 10); + var rowIndex = row.rowIndex; + + if (rowIndex === validIndexes[validIdxLen - 1] && paging.currentPageNb !== paging.nbPages) { + paging.setPage('last'); + } else if (rowIndex == validIndexes[0] && paging.currentPageNb !== 1) { + paging.setPage('first'); + } else if (rowIndex > validIndexes[pagingEndRow - 1] && rowIndex < validIndexes[validIdxLen - 1]) { + paging.setPage('next'); + } else if (rowIndex < validIndexes[paging.startPagingRow] && rowIndex > validIndexes[0]) { + paging.setPage('previous'); + } + } + } + }; + + //Selected row needs to be visible when paging is activated + if (tf.paging) { + tf.feature('paging').onAfterChangePage = function (paging) { + var advGrid = paging.tf.extension('advancedGrid'); + var et = advGrid._ezEditTable; + var slc = et.Selection; + var row = slc.GetActiveRow(); + if (row) { + row.scrollIntoView(false); + } + var cell = slc.GetActiveCell(); + if (cell) { + cell.scrollIntoView(false); + } + }; + } + + //Rows navigation when rows are filtered is performed with the + //EditTable row selection callback events + if (cfg.default_selection === 'row') { + var fnB = cfg.on_before_selected_row; + cfg.on_before_selected_row = function () { + onBeforeSelection(arguments[0], arguments[1], arguments[2]); + if (fnB) { + fnB.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + var fnA = cfg.on_after_selected_row; + cfg.on_after_selected_row = function () { + onAfterSelection(arguments[0], arguments[1], arguments[2]); + if (fnA) { + fnA.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + } else { + var fnD = cfg.on_before_selected_cell; + cfg.on_before_selected_cell = function () { + onBeforeSelection(arguments[0], arguments[1], arguments[2]); + if (fnD) { + fnD.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + var fnC = cfg.on_after_selected_cell; + cfg.on_after_selected_cell = function () { + onAfterSelection(arguments[0], arguments[1], arguments[2]); + if (fnC) { + fnC.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + } + } + if (editable) { + //Added or removed rows, TF rows number needs to be re-calculated + var fnE = cfg.on_added_dom_row; + cfg.on_added_dom_row = function () { + tf.nbFilterableRows++; + if (!tf.paging) { + tf.feature('rowsCounter').refresh(); + } else { + tf.nbRows++; + tf.nbVisibleRows++; + tf.nbFilterableRows++; + tf.paging = false; + tf.feature('paging').destroy(); + tf.feature('paging').reset(); + } + if (tf.alternateBgs) { + tf.feature('alternateRows').init(); + } + if (fnE) { + fnE.call(null, arguments[0], arguments[1], arguments[2]); + } + }; + if (cfg.actions && cfg.actions['delete']) { + var fnF = cfg.actions['delete'].on_after_submit; + cfg.actions['delete'].on_after_submit = function () { + tf.nbFilterableRows--; + if (!tf.paging) { + tf.feature('rowsCounter').refresh(); + } else { + tf.nbRows--; + tf.nbVisibleRows--; + tf.nbFilterableRows--; + tf.paging = false; + tf.feature('paging').destroy(); + tf.feature('paging').reset(false); + } + if (tf.alternateBgs) { + tf.feature('alternateRows').init(); + } + if (fnF) { + fnF.call(null, arguments[0], arguments[1]); + } + }; + } + } + + try { + this._ezEditTable = new EditTable(tf.id, cfg, startRow); + this._ezEditTable.Init(); + } catch (e) { + throw new Error(this.err); + } + + this.initialized = true; + } + }, { + key: 'reset', + + /** + * Reset advanced grid when previously removed + */ + value: function reset() { + var ezEditTable = this._ezEditTable; + if (ezEditTable) { + if (this.cfg.selectable) { + ezEditTable.Selection.Set(); + } + if (this.cfg.editable) { + ezEditTable.Editable.Set(); + } + } + } + }, { + key: 'destroy', + + /** + * Remove advanced grid + */ + value: function destroy() { + var ezEditTable = this._ezEditTable; + if (ezEditTable) { + if (this.cfg.selectable) { + ezEditTable.Selection.ClearSelections(); + ezEditTable.Selection.Remove(); + } + if (this.cfg.editable) { + ezEditTable.Editable.Remove(); + } + } + this.initialized = false; + } + }]); + + return AdapterEzEditTable; + })(); + + exports['default'] = AdapterEzEditTable; + module.exports = exports['default']; + +/***/ }, +/* 25 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _AdapterEzEditTable = __webpack_require__(24); + + var _AdapterEzEditTable2 = _interopRequireDefault(_AdapterEzEditTable); + + exports['default'] = _AdapterEzEditTable2['default']; + module.exports = exports['default']; + +/***/ }, +/* 26 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Str = __webpack_require__(4); + + var _Str2 = _interopRequireDefault(_Str); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var ColOps = (function () { + + /** + * Column calculations + * @param {Object} tf TableFilter instance + */ + + function ColOps(tf, opts) { + _classCallCheck(this, ColOps); + + //calls function before col operation + this.onBeforeOperation = _Types2['default'].isFn(opts.on_before_operation) ? opts.on_before_operation : null; + //calls function after col operation + this.onAfterOperation = _Types2['default'].isFn(opts.on_after_operation) ? opts.on_after_operation : null; + + this.opts = opts; + this.tf = tf; + } + + _createClass(ColOps, [{ + key: 'init', + value: function init() { + this.calc(); + } + }, { + key: 'calc', + + /** + * Calculates columns' values + * Configuration options are stored in 'opts' property + * - 'id' contains ids of elements showing result (array) + * - 'col' contains the columns' indexes (array) + * - 'operation' contains operation type (array, values: 'sum', 'mean', + * 'min', 'max', 'median', 'q1', 'q3') + * - 'write_method' array defines which method to use for displaying the + * result (innerHTML, setValue, createTextNode) - default: 'innerHTML' + * - 'tot_row_index' defines in which row results are displayed + * (integers array) + * + * - changes made by Nuovella: + * (1) optimized the routine (now it will only process each column once), + * (2) added calculations for the median, lower and upper quartile. + */ + value: function calc() { + var tf = this.tf; + if (!tf.isFirstLoad && !tf.hasGrid()) { + return; + } + + if (this.onBeforeOperation) { + this.onBeforeOperation.call(null, tf); + } + + var opts = this.opts, + labelId = opts.id, + colIndex = opts.col, + operation = opts.operation, + outputType = opts.write_method, + totRowIndex = opts.tot_row_index, + excludeRow = opts.exclude_row, + decimalPrecision = _Types2['default'].isUndef(opts.decimal_precision) ? 2 : opts.decimal_precision; + + //nuovella: determine unique list of columns to operate on + var ucolIndex = [], + ucolMax = 0; + ucolIndex[ucolMax] = colIndex[0]; + + for (var ii = 1; ii < colIndex.length; ii++) { + var saved = 0; + //see if colIndex[ii] is already in the list of unique indexes + for (var jj = 0; jj <= ucolMax; jj++) { + if (ucolIndex[jj] === colIndex[ii]) { + saved = 1; + } + } + //if not saved then, save the index; + if (saved === 0) { + ucolMax++; + ucolIndex[ucolMax] = colIndex[ii]; + } + } + + if (_Str2['default'].lower(typeof labelId) == 'object' && _Str2['default'].lower(typeof colIndex) == 'object' && _Str2['default'].lower(typeof operation) == 'object') { + var rows = tf.tbl.rows, + colvalues = []; + + for (var ucol = 0; ucol <= ucolMax; ucol++) { + //this retrieves col values + //use ucolIndex because we only want to pass through this loop + //once for each column get the values in this unique column + colvalues.push(tf.getColValues(ucolIndex[ucol], true, excludeRow)); + + //next: calculate all operations for this column + var result, + nbvalues = 0, + temp, + meanValue = 0, + sumValue = 0, + minValue = null, + maxValue = null, + q1Value = null, + medValue = null, + q3Value = null, + meanFlag = 0, + sumFlag = 0, + minFlag = 0, + maxFlag = 0, + q1Flag = 0, + medFlag = 0, + q3Flag = 0, + theList = [], + opsThisCol = [], + decThisCol = [], + labThisCol = [], + oTypeThisCol = [], + mThisCol = -1; + + for (var k = 0; k < colIndex.length; k++) { + if (colIndex[k] === ucolIndex[ucol]) { + mThisCol++; + opsThisCol[mThisCol] = _Str2['default'].lower(operation[k]); + decThisCol[mThisCol] = decimalPrecision[k]; + labThisCol[mThisCol] = labelId[k]; + oTypeThisCol = outputType !== undefined && _Str2['default'].lower(typeof outputType) === 'object' ? outputType[k] : null; + + switch (opsThisCol[mThisCol]) { + case 'mean': + meanFlag = 1; + break; + case 'sum': + sumFlag = 1; + break; + case 'min': + minFlag = 1; + break; + case 'max': + maxFlag = 1; + break; + case 'median': + medFlag = 1; + break; + case 'q1': + q1Flag = 1; + break; + case 'q3': + q3Flag = 1; + break; + } + } + } + + for (var j = 0; j < colvalues[ucol].length; j++) { + //sort the list for calculation of median and quartiles + if (q1Flag == 1 || q3Flag == 1 || medFlag == 1) { + if (j < colvalues[ucol].length - 1) { + for (k = j + 1; k < colvalues[ucol].length; k++) { + if (eval(colvalues[ucol][k]) < eval(colvalues[ucol][j])) { + temp = colvalues[ucol][j]; + colvalues[ucol][j] = colvalues[ucol][k]; + colvalues[ucol][k] = temp; + } + } + } + } + var cvalue = parseFloat(colvalues[ucol][j]); + theList[j] = parseFloat(cvalue); + + if (!isNaN(cvalue)) { + nbvalues++; + if (sumFlag === 1 || meanFlag === 1) { + sumValue += parseFloat(cvalue); + } + if (minFlag === 1) { + if (minValue === null) { + minValue = parseFloat(cvalue); + } else { + minValue = parseFloat(cvalue) < minValue ? parseFloat(cvalue) : minValue; + } + } + if (maxFlag === 1) { + if (maxValue === null) { + maxValue = parseFloat(cvalue); + } else { + maxValue = parseFloat(cvalue) > maxValue ? parseFloat(cvalue) : maxValue; + } + } + } + } //for j + if (meanFlag === 1) { + meanValue = sumValue / nbvalues; + } + if (medFlag === 1) { + var aux = 0; + if (nbvalues % 2 === 1) { + aux = Math.floor(nbvalues / 2); + medValue = theList[aux]; + } else { + medValue = (theList[nbvalues / 2] + theList[nbvalues / 2 - 1]) / 2; + } + } + var posa; + if (q1Flag === 1) { + posa = 0; + posa = Math.floor(nbvalues / 4); + if (4 * posa == nbvalues) { + q1Value = (theList[posa - 1] + theList[posa]) / 2; + } else { + q1Value = theList[posa]; + } + } + if (q3Flag === 1) { + posa = 0; + var posb = 0; + posa = Math.floor(nbvalues / 4); + if (4 * posa === nbvalues) { + posb = 3 * posa; + q3Value = (theList[posb] + theList[posb - 1]) / 2; + } else { + q3Value = theList[nbvalues - posa - 1]; + } + } + + for (var i = 0; i <= mThisCol; i++) { + switch (opsThisCol[i]) { + case 'mean': + result = meanValue; + break; + case 'sum': + result = sumValue; + break; + case 'min': + result = minValue; + break; + case 'max': + result = maxValue; + break; + case 'median': + result = medValue; + break; + case 'q1': + result = q1Value; + break; + case 'q3': + result = q3Value; + break; + } + + var precision = !isNaN(decThisCol[i]) ? decThisCol[i] : 2; + + //if outputType is defined + if (oTypeThisCol && result) { + result = result.toFixed(precision); + + if (_Dom2['default'].id(labThisCol[i])) { + switch (_Str2['default'].lower(oTypeThisCol)) { + case 'innerhtml': + if (isNaN(result) || !isFinite(result) || nbvalues === 0) { + _Dom2['default'].id(labThisCol[i]).innerHTML = '.'; + } else { + _Dom2['default'].id(labThisCol[i]).innerHTML = result; + } + break; + case 'setvalue': + _Dom2['default'].id(labThisCol[i]).value = result; + break; + case 'createtextnode': + var oldnode = _Dom2['default'].id(labThisCol[i]).firstChild; + var txtnode = _Dom2['default'].text(result); + _Dom2['default'].id(labThisCol[i]).replaceChild(txtnode, oldnode); + break; + } //switch + } + } else { + try { + if (isNaN(result) || !isFinite(result) || nbvalues === 0) { + _Dom2['default'].id(labThisCol[i]).innerHTML = '.'; + } else { + _Dom2['default'].id(labThisCol[i]).innerHTML = result.toFixed(precision); + } + } catch (e) {} //catch + } //else + } //for i + + // row(s) with result are always visible + var totRow = totRowIndex && totRowIndex[ucol] ? rows[totRowIndex[ucol]] : null; + if (totRow) { + totRow.style.display = ''; + } + } //for ucol + } //if typeof + + if (this.onAfterOperation) { + this.onAfterOperation.call(null, tf); + } + } + }, { + key: 'destroy', + value: function destroy() {} + }]); + + return ColOps; + })(); + + exports['default'] = ColOps; + module.exports = exports['default']; + +/***/ }, +/* 27 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var ColsVisibility = (function () { + + /** + * Columns Visibility extension + * @param {Object} tf TableFilter instance + * @param {Object} f Config + */ + + function ColsVisibility(tf, f) { + _classCallCheck(this, ColsVisibility); + + // Configuration object + var cfg = tf.config(); + + this.initialized = false; + this.name = f.name; + this.desc = f.description || 'Columns visibility manager'; + + //show/hide cols span element + this.spanEl = null; + //show/hide cols button element + this.btnEl = null; + //show/hide cols container div element + this.contEl = null; + + //tick to hide or show column + this.tickToHide = f.tick_to_hide === false ? false : true; + //enables/disables cols manager generation + this.manager = f.manager === false ? false : true; + //only if external headers + this.headersTbl = f.headers_table || false; + //only if external headers + this.headersIndex = f.headers_index || 1; + //id of container element + this.contElTgtId = f.container_target_id || null; + //alternative headers text + this.headersText = f.headers_text || null; + //id of button container element + this.btnTgtId = f.btn_target_id || null; + //defines show/hide cols text + this.btnText = f.btn_text || 'Columns▼'; + //defines show/hide cols button innerHtml + this.btnHtml = f.btn_html || null; + //defines css class for show/hide cols button + this.btnCssClass = f.btn_css_class || 'colVis'; + //defines close link text + this.btnCloseText = f.btn_close_text || 'Close'; + //defines close button innerHtml + this.btnCloseHtml = f.btn_close_html || null; + //defines css class for close button + this.btnCloseCssClass = f.btn_close_css_class || this.btnCssClass; + this.stylesheet = f.stylesheet || 'colsVisibility.css'; + //span containing show/hide cols button + this.prfx = 'colVis_'; + //defines css class span containing show/hide cols + this.spanCssClass = f.span_css_class || 'colVisSpan'; + this.prfxCont = this.prfx + 'Cont_'; + //defines css class div containing show/hide cols + this.contCssClass = f.cont_css_class || 'colVisCont'; + //defines css class for cols list (ul) + this.listCssClass = cfg.list_css_class || 'cols_checklist'; + //defines css class for list item (li) + this.listItemCssClass = cfg.checklist_item_css_class || 'cols_checklist_item'; + //defines css class for selected list item (li) + this.listSlcItemCssClass = cfg.checklist_selected_item_css_class || 'cols_checklist_slc_item'; + //text preceding columns list + this.text = f.text || (this.tickToHide ? 'Hide: ' : 'Show: '); + this.atStart = f.at_start || null; + this.enableHover = Boolean(f.enable_hover); + //enables select all option + this.enableTickAll = Boolean(f.enable_tick_all); + //text preceding columns list + this.tickAllText = f.tick_all_text || 'Select all:'; + + //array containing hidden columns indexes + this.hiddenCols = []; + this.tblHasColTag = _Dom2['default'].tag(tf.tbl, 'col').length > 0; + + //callback invoked just after cols manager is loaded + this.onLoaded = _Types2['default'].isFn(f.on_loaded) ? f.on_loaded : null; + //calls function before cols manager is opened + this.onBeforeOpen = _Types2['default'].isFn(f.on_before_open) ? f.on_before_open : null; + //calls function after cols manager is opened + this.onAfterOpen = _Types2['default'].isFn(f.on_after_open) ? f.on_after_open : null; + //calls function before cols manager is closed + this.onBeforeClose = _Types2['default'].isFn(f.on_before_close) ? f.on_before_close : null; + //calls function after cols manager is closed + this.onAfterClose = _Types2['default'].isFn(f.on_after_close) ? f.on_after_close : null; + + //callback before col is hidden + this.onBeforeColHidden = _Types2['default'].isFn(f.on_before_col_hidden) ? f.on_before_col_hidden : null; + //callback after col is hidden + this.onAfterColHidden = _Types2['default'].isFn(f.on_after_col_hidden) ? f.on_after_col_hidden : null; + //callback before col is displayed + this.onBeforeColDisplayed = _Types2['default'].isFn(f.on_before_col_displayed) ? f.on_before_col_displayed : null; + //callback after col is displayed + this.onAfterColDisplayed = _Types2['default'].isFn(f.on_after_col_displayed) ? f.on_after_col_displayed : null; + + //Grid layout compatibility + if (tf.gridLayout) { + this.headersTbl = tf.feature('gridLayout').headTbl; //headers table + this.headersIndex = 0; //headers index + this.onAfterColDisplayed = function () {}; + this.onAfterColHidden = function () {}; + } + + //Loads extension stylesheet + tf['import'](f.name + 'Style', tf.stylePath + this.stylesheet, null, 'link'); + + this.tf = tf; + } + + _createClass(ColsVisibility, [{ + key: 'toggle', + value: function toggle() { + var contDisplay = this.contEl.style.display; + var onBeforeOpen = this.onBeforeOpen; + var onBeforeClose = this.onBeforeClose; + var onAfterOpen = this.onAfterOpen; + var onAfterClose = this.onAfterClose; + + if (onBeforeOpen && contDisplay !== 'inline') { + onBeforeOpen.call(null, this); + } + if (onBeforeClose && contDisplay === 'inline') { + onBeforeClose.call(null, this); + } + + this.contEl.style.display = contDisplay === 'inline' ? 'none' : 'inline'; + + if (onAfterOpen && contDisplay !== 'inline') { + onAfterOpen.call(null, this); + } + if (onAfterClose && contDisplay === 'inline') { + onAfterClose.call(null, this); + } + } + }, { + key: 'checkItem', + value: function checkItem(lbl) { + var li = lbl.parentNode; + if (!li || !lbl) { + return; + } + var isChecked = lbl.firstChild.checked; + var colIndex = lbl.firstChild.getAttribute('id').split('_')[1]; + colIndex = parseInt(colIndex, 10); + if (isChecked) { + _Dom2['default'].addClass(li, this.listSlcItemCssClass); + } else { + _Dom2['default'].removeClass(li, this.listSlcItemCssClass); + } + + var hide = false; + if (this.tickToHide && isChecked || !this.tickToHide && !isChecked) { + hide = true; + } + this.setHidden(colIndex, hide); + } + }, { + key: 'init', + value: function init() { + if (!this.manager) { + return; + } + this.buildBtn(); + this.buildManager(); + + this.initialized = true; + } + }, { + key: 'buildBtn', + + /** + * Build main button UI + */ + value: function buildBtn() { + var _this = this; + + if (this.btnEl) { + return; + } + var tf = this.tf; + var span = _Dom2['default'].create('span', ['id', this.prfx + tf.id]); + span.className = this.spanCssClass; + + //Container element (rdiv or custom element) + if (!this.btnTgtId) { + tf.setToolbar(); + } + var targetEl = !this.btnTgtId ? tf.rDiv : _Dom2['default'].id(this.btnTgtId); + + if (!this.btnTgtId) { + var firstChild = targetEl.firstChild; + firstChild.parentNode.insertBefore(span, firstChild); + } else { + targetEl.appendChild(span); + } + + if (!this.btnHtml) { + var btn = _Dom2['default'].create('a', ['href', 'javascript:;']); + btn.className = this.btnCssClass; + btn.title = this.desc; + + btn.innerHTML = this.btnText; + span.appendChild(btn); + if (!this.enableHover) { + _Event2['default'].add(btn, 'click', function (evt) { + _this.toggle(evt); + }); + } else { + _Event2['default'].add(btn, 'mouseover', function (evt) { + _this.toggle(evt); + }); + } + } else { + //Custom html + span.innerHTML = this.btnHtml; + var colVisEl = span.firstChild; + if (!this.enableHover) { + _Event2['default'].add(colVisEl, 'click', function (evt) { + _this.toggle(evt); + }); + } else { + _Event2['default'].add(colVisEl, 'mouseover', function (evt) { + _this.toggle(evt); + }); + } + } + + this.spanEl = span; + this.btnEl = this.spanEl.firstChild; + + if (this.onLoaded) { + this.onLoaded.call(null, this); + } + } + }, { + key: 'buildManager', + + /** + * Build columns manager UI + */ + value: function buildManager() { + var _this2 = this; + + var tf = this.tf; + + var container = !this.contElTgtId ? _Dom2['default'].create('div', ['id', this.prfxCont + tf.id]) : _Dom2['default'].id(this.contElTgtId); + container.className = this.contCssClass; + + //Extension description + var extNameLabel = _Dom2['default'].create('p'); + extNameLabel.innerHTML = this.text; + container.appendChild(extNameLabel); + + //Headers list + var ul = _Dom2['default'].create('ul', ['id', 'ul' + this.name + '_' + tf.id]); + ul.className = this.listCssClass; + + var tbl = this.headersTbl ? this.headersTbl : tf.tbl; + var headerIndex = this.headersTbl ? this.headersIndex : tf.getHeadersRowIndex(); + var headerRow = tbl.rows[headerIndex]; + + //Tick all option + if (this.enableTickAll) { + var li = _Dom2['default'].createCheckItem('col__' + tf.id, this.tickAllText, this.tickAllText); + _Dom2['default'].addClass(li, this.listItemCssClass); + ul.appendChild(li); + li.check.checked = !this.tickToHide; + + _Event2['default'].add(li.check, 'click', function () { + for (var h = 0; h < headerRow.cells.length; h++) { + var itm = _Dom2['default'].id('col_' + h + '_' + tf.id); + if (itm && li.check.checked !== itm.checked) { + itm.click(); + itm.checked = li.check.checked; + } + } + }); + } + + for (var i = 0; i < headerRow.cells.length; i++) { + var cell = headerRow.cells[i]; + var cellText = this.headersText && this.headersText[i] ? this.headersText[i] : this._getHeaderText(cell); + var liElm = _Dom2['default'].createCheckItem('col_' + i + '_' + tf.id, cellText, cellText); + _Dom2['default'].addClass(liElm, this.listItemCssClass); + if (!this.tickToHide) { + _Dom2['default'].addClass(liElm, this.listSlcItemCssClass); + } + ul.appendChild(liElm); + if (!this.tickToHide) { + liElm.check.checked = true; + } + + _Event2['default'].add(liElm.check, 'click', function (evt) { + var elm = _Event2['default'].target(evt); + var lbl = elm.parentNode; + _this2.checkItem(lbl); + }); + } + + //separator + var p = _Dom2['default'].create('p', ['align', 'center']); + var btn; + //Close link + if (!this.btnCloseHtml) { + btn = _Dom2['default'].create('a', ['href', 'javascript:;']); + btn.className = this.btnCloseCssClass; + btn.innerHTML = this.btnCloseText; + _Event2['default'].add(btn, 'click', function (evt) { + _this2.toggle(evt); + }); + p.appendChild(btn); + } else { + p.innerHTML = this.btnCloseHtml; + btn = p.firstChild; + _Event2['default'].add(btn, 'click', function (evt) { + _this2.toggle(evt); + }); + } + + container.appendChild(ul); + container.appendChild(p); + + this.btnEl.parentNode.insertBefore(container, this.btnEl); + this.contEl = container; + + if (this.atStart) { + var a = this.atStart; + for (var k = 0; k < a.length; k++) { + var itm = _Dom2['default'].id('col_' + a[k] + '_' + tf.id); + if (itm) { + itm.click(); + } + } + } + } + }, { + key: 'setHidden', + + /** + * Hide or show specified columns + * @param {Numner} colIndex Column index + * @param {Boolean} hide hide column if true or show if false + */ + value: function setHidden(colIndex, hide) { + var tf = this.tf; + var tbl = tf.tbl; + + if (this.onBeforeColHidden && hide) { + this.onBeforeColHidden.call(null, this, colIndex); + } + if (this.onBeforeColDisplayed && !hide) { + this.onBeforeColDisplayed.call(null, this, colIndex); + } + + this._hideCells(tbl, colIndex, hide); + if (this.headersTbl) { + this._hideCells(this.headersTbl, colIndex, hide); + } + + var hiddenCols = this.hiddenCols; + if (hide) { + if (hiddenCols.indexOf(colIndex) === -1) { + this.hiddenCols.push(colIndex); + } + } else { + var itemIndex = _Arr2['default'].indexByValue(hiddenCols, colIndex, true); + if (hiddenCols.indexOf(colIndex) !== -1) { + this.hiddenCols.splice(itemIndex, 1); + } + } + + var gridLayout; + var headTbl; + var gridColElms; + if (this.onAfterColHidden && hide) { + //This event is fired just after a column is displayed for + //grid_layout support + //TODO: grid layout module should be responsible for those + //calculations + if (tf.gridLayout) { + gridLayout = tf.feature('gridLayout'); + headTbl = gridLayout.headTbl; + gridColElms = gridLayout.gridColElms; + var hiddenWidth = parseInt(gridColElms[colIndex].style.width, 10); + + var headTblW = parseInt(headTbl.style.width, 10); + headTbl.style.width = headTblW - hiddenWidth + 'px'; + tbl.style.width = headTbl.style.width; + } + this.onAfterColHidden.call(null, this, colIndex); + } + + if (this.onAfterColDisplayed && !hide) { + //This event is fired just after a column is displayed for + //grid_layout support + //TODO: grid layout module should be responsible for those + //calculations + if (tf.gridLayout) { + gridLayout = tf.feature('gridLayout'); + headTbl = gridLayout.headTbl; + gridColElms = gridLayout.gridColElms; + var width = parseInt(gridColElms[colIndex].style.width, 10); + headTbl.style.width = parseInt(headTbl.style.width, 10) + width + 'px'; + tf.tbl.style.width = headTbl.style.width; + } + this.onAfterColDisplayed.call(null, this, colIndex); + } + } + }, { + key: 'showCol', + + /** + * Show specified column + * @param {Number} colIndex Column index + */ + value: function showCol(colIndex) { + if (colIndex === undefined || !this.isColHidden(colIndex)) { + return; + } + if (this.manager && this.contEl) { + var itm = _Dom2['default'].id('col_' + colIndex + '_' + this.tf.id); + if (itm) { + itm.click(); + } + } else { + this.setHidden(colIndex, false); + } + } + }, { + key: 'hideCol', + + /** + * Hide specified column + * @param {Number} colIndex Column index + */ + value: function hideCol(colIndex) { + if (colIndex === undefined || this.isColHidden(colIndex)) { + return; + } + if (this.manager && this.contEl) { + var itm = _Dom2['default'].id('col_' + colIndex + '_' + this.tf.id); + if (itm) { + itm.click(); + } + } else { + this.setHidden(colIndex, true); + } + } + }, { + key: 'isColHidden', + + /** + * Determine if specified column is hidden + * @param {Number} colIndex Column index + */ + value: function isColHidden(colIndex) { + if (this.hiddenCols.indexOf(colIndex) !== -1) { + return true; + } + return false; + } + }, { + key: 'toggleCol', + + /** + * Toggle visibility of specified column + * @param {Number} colIndex Column index + */ + value: function toggleCol(colIndex) { + if (colIndex === undefined || this.isColHidden(colIndex)) { + this.showCol(colIndex); + } else { + this.hideCol(colIndex); + } + } + }, { + key: 'getHiddenCols', + + /** + * Returns the indexes of the columns currently hidden + * @return {Array} column indexes + */ + value: function getHiddenCols() { + return this.hiddenCols; + } + }, { + key: 'destroy', + + /** + * Remove the columns manager + */ + value: function destroy() { + if (!this.btnEl && !this.contEl) { + return; + } + if (_Dom2['default'].id(this.contElTgtId)) { + _Dom2['default'].id(this.contElTgtId).innerHTML = ''; + } else { + this.contEl.innerHTML = ''; + this.contEl.parentNode.removeChild(this.contEl); + this.contEl = null; + } + this.btnEl.innerHTML = ''; + this.btnEl.parentNode.removeChild(this.btnEl); + this.btnEl = null; + this.initialized = false; + } + }, { + key: '_getHeaderText', + value: function _getHeaderText(cell) { + if (!cell.hasChildNodes) { + return ''; + } + + for (var i = 0; i < cell.childNodes.length; i++) { + var n = cell.childNodes[i]; + if (n.nodeType === 3) { + return n.nodeValue; + } else if (n.nodeType === 1) { + if (n.id && n.id.indexOf('popUp') !== -1) { + continue; + } else { + return _Dom2['default'].getText(n); + } + } + continue; + } + return ''; + } + }, { + key: '_hideCells', + value: function _hideCells(tbl, colIndex, hide) { + for (var i = 0; i < tbl.rows.length; i++) { + var row = tbl.rows[i]; + var cell = row.cells[colIndex]; + if (cell) { + cell.style.display = hide ? 'none' : ''; + } + } + } + }]); + + return ColsVisibility; + })(); + + exports['default'] = ColsVisibility; + module.exports = exports['default']; + +/***/ }, +/* 28 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var FiltersVisibility = (function () { + + /** + * Filters Row Visibility extension + * @param {Object} tf TableFilter instance + * @param {Object} f Config + */ + + function FiltersVisibility(tf, f) { + _classCallCheck(this, FiltersVisibility); + + this.initialized = false; + this.name = f.name; + this.desc = f.description || 'Filters row visibility manager'; + + // Path and image filenames + this.stylesheet = f.stylesheet || 'filtersVisibility.css'; + this.icnExpand = f.expand_icon_name || 'icn_exp.png'; + this.icnCollapse = f.collapse_icon_name || 'icn_clp.png'; + + //expand/collapse filters span element + this.contEl = null; + //expand/collapse filters btn element + this.btnEl = null; + + this.icnExpandHtml = 'Expand filters'; + this.icnCollapseHtml = 'Collapse filters'; + this.defaultText = 'Toggle filters'; + + //id of container element + this.targetId = f.target_id || null; + //enables/disables expand/collapse icon + this.enableIcon = f.enable_icon === false ? false : true; + this.btnText = f.btn_text || ''; + + //defines expand/collapse filters text + this.collapseBtnHtml = this.enableIcon ? this.icnCollapseHtml + this.btnText : this.btnText || this.defaultText; + this.expandBtnHtml = this.enableIcon ? this.icnExpandHtml + this.btnText : this.btnText || this.defaultText; + + //defines expand/collapse filters button innerHtml + this.btnHtml = f.btn_html || null; + //defines css class for expand/collapse filters button + this.btnCssClass = f.btn_css_class || 'btnExpClpFlt'; + //defines css class span containing expand/collapse filters + this.contCssClass = f.cont_css_class || 'expClpFlt'; + this.filtersRowIndex = !_Types2['default'].isUndef(f.filters_row_index) ? f.filters_row_index : tf.getFiltersRowIndex(); + + this.visibleAtStart = !_Types2['default'].isUndef(f.visible_at_start) ? Boolean(f.visible_at_start) : true; + + // Prefix + this.prfx = 'fltsVis_'; + + //callback before filters row is shown + this.onBeforeShow = _Types2['default'].isFn(f.on_before_show) ? f.on_before_show : null; + //callback after filters row is shown + this.onAfterShow = _Types2['default'].isFn(f.on_after_show) ? f.on_after_show : null; + //callback before filters row is hidden + this.onBeforeHide = _Types2['default'].isFn(f.on_before_hide) ? f.on_before_hide : null; + //callback after filters row is hidden + this.onAfterHide = _Types2['default'].isFn(f.on_after_hide) ? f.on_after_hide : null; + + //Loads extension stylesheet + tf['import'](f.name + 'Style', tf.stylePath + this.stylesheet, null, 'link'); + + this.tf = tf; + } + + _createClass(FiltersVisibility, [{ + key: 'init', + + /** + * Initialise extension + */ + value: function init() { + if (this.initialized) { + return; + } + + this.buildUI(); + this.initialized = true; + } + }, { + key: 'buildUI', + + /** + * Build UI elements + */ + value: function buildUI() { + var _this = this; + + var tf = this.tf; + var span = _Dom2['default'].create('span', ['id', this.prfx + tf.id]); + span.className = this.contCssClass; + + //Container element (rdiv or custom element) + if (!this.targetId) { + tf.setToolbar(); + } + var targetEl = !this.targetId ? tf.rDiv : _Dom2['default'].id(this.targetId); + + if (!this.targetId) { + var firstChild = targetEl.firstChild; + firstChild.parentNode.insertBefore(span, firstChild); + } else { + targetEl.appendChild(span); + } + + var btn = undefined; + if (!this.btnHtml) { + btn = _Dom2['default'].create('a', ['href', 'javascript:void(0);']); + btn.className = this.btnCssClass; + btn.title = this.btnText || this.defaultText; + btn.innerHTML = this.collapseBtnHtml; + span.appendChild(btn); + _Event2['default'].add(btn, 'click', function () { + return _this.toggle(); + }); + } else { + //Custom html + span.innerHTML = this.btnHtml; + btn = span.firstChild; + _Event2['default'].add(btn, 'click', function () { + return _this.toggle(); + }); + } + + this.contEl = span; + this.btnEl = btn; + + if (!this.visibleAtStart) { + this.toggle(); + } + } + }, { + key: 'toggle', + + /** + * Toggle filters visibility + */ + value: function toggle() { + var tf = this.tf; + var tbl = tf.gridLayout ? tf.feature('gridLayout').headTbl : tf.tbl; + var fltRow = tbl.rows[this.filtersRowIndex]; + var fltRowDisplay = fltRow.style.display; + + if (this.onBeforeShow && fltRowDisplay != '') { + this.onBeforeShow.call(this, this); + } + if (this.onBeforeHide && fltRowDisplay === '') { + this.onBeforeHide.call(null, this); + } + + fltRow.style.display = fltRowDisplay === '' ? 'none' : ''; + if (this.enableIcon && !this.btnHtml) { + this.btnEl.innerHTML = fltRowDisplay === '' ? this.expandBtnHtml : this.collapseBtnHtml; + } + + if (this.onAfterShow && fltRowDisplay != '') { + this.onAfterShow.call(null, this); + } + if (this.onAfterHide && fltRowDisplay === '') { + this.onAfterHide.call(null, this); + } + } + }, { + key: 'destroy', + + /** + * Destroy the UI + */ + value: function destroy() { + if (!this.btnEl && !this.contEl) { + return; + } + + this.btnEl.innerHTML = ''; + this.btnEl.parentNode.removeChild(this.btnEl); + this.btnEl = null; + + this.contEl.innerHTML = ''; + this.contEl.parentNode.removeChild(this.contEl); + this.contEl = null; + this.initialized = false; + } + }]); + + return FiltersVisibility; + })(); + + exports['default'] = FiltersVisibility; + module.exports = exports['default']; + +/***/ }, +/* 29 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _Types = __webpack_require__(6); + + var _Types2 = _interopRequireDefault(_Types); + + var _Dom = __webpack_require__(3); + + var _Dom2 = _interopRequireDefault(_Dom); + + var _Arr = __webpack_require__(7); + + var _Arr2 = _interopRequireDefault(_Arr); + + var _Event = __webpack_require__(2); + + var _Event2 = _interopRequireDefault(_Event); + + var _DateHelper = __webpack_require__(8); + + var _DateHelper2 = _interopRequireDefault(_DateHelper); + + var _Helpers = __webpack_require__(9); + + var _Helpers2 = _interopRequireDefault(_Helpers); + + var AdapterSortableTable = (function () { + + /** + * SortableTable Adapter module + * @param {Object} tf TableFilter instance + */ + + function AdapterSortableTable(tf, opts) { + _classCallCheck(this, AdapterSortableTable); + + // Configuration object + var f = tf.config(); + + this.initialized = false; + this.name = opts.name; + this.desc = opts.description || 'Sortable table'; + + //indicates if paging is enabled + this.isPaged = false; + + //indicates if tables was sorted + this.sorted = false; + + this.sortTypes = _Types2['default'].isArray(opts.types) ? opts.types : []; + this.sortColAtStart = _Types2['default'].isArray(opts.sort_col_at_start) ? opts.sort_col_at_start : null; + this.asyncSort = Boolean(opts.async_sort); + this.triggerIds = _Types2['default'].isArray(opts.trigger_ids) ? opts.trigger_ids : []; + + // edit .sort-arrow.descending / .sort-arrow.ascending in + // tablefilter.css to reflect any path change + this.imgPath = opts.images_path || tf.themesPath; + this.imgBlank = opts.image_blank || 'blank.png'; + this.imgClassName = opts.image_class_name || 'sort-arrow'; + this.imgAscClassName = opts.image_asc_class_name || 'ascending'; + this.imgDescClassName = opts.image_desc_class_name || 'descending'; + //cell attribute storing custom key + this.customKey = opts.custom_key || 'data-tf-sortKey'; + + /*** TF additional events ***/ + //additional paging events for alternating background + // o.Evt._Paging.nextEvt = function(){ + // if(o.sorted && o.alternateBgs) o.Filter(); + // } + // o.Evt._Paging.prevEvt = o.Evt._Paging.nextEvt; + // o.Evt._Paging.firstEvt = o.Evt._Paging.nextEvt; + // o.Evt._Paging.lastEvt = o.Evt._Paging.nextEvt; + // o.Evt._OnSlcPagesChangeEvt = o.Evt._Paging.nextEvt; + + // callback invoked after sort is loaded and instanciated + this.onSortLoaded = _Types2['default'].isFn(opts.on_sort_loaded) ? opts.on_sort_loaded : null; + // callback invoked before table is sorted + this.onBeforeSort = _Types2['default'].isFn(opts.on_before_sort) ? opts.on_before_sort : null; + // callback invoked after table is sorted + this.onAfterSort = _Types2['default'].isFn(opts.on_after_sort) ? f.on_after_sort : null; + + this.tf = tf; + } + + _createClass(AdapterSortableTable, [{ + key: 'init', + value: function init() { + var tf = this.tf; + var adpt = this; + + // SortableTable class sanity check (sortabletable.js) + if (_Types2['default'].isUndef(SortableTable)) { + throw new Error('SortableTable class not found.'); + } + + this.overrideSortableTable(); + this.setSortTypes(); + + //Column sort at start + var sortColAtStart = adpt.sortColAtStart; + if (sortColAtStart) { + this.stt.sort(sortColAtStart[0], sortColAtStart[1]); + } + + if (this.onSortLoaded) { + this.onSortLoaded.call(null, tf, this); + } + + /*** SortableTable callbacks ***/ + this.stt.onbeforesort = function () { + if (this.onBeforeSort) { + this.onBeforeSort.call(null, tf, this.stt.sortColumn); + } + + /*** sort behaviour for paging ***/ + if (tf.paging) { + adpt.isPaged = true; + tf.paging = false; + tf.feature('paging').destroy(); + } + }; + + this.stt.onsort = function () { + adpt.sorted = true; + + //rows alternating bg issue + // TODO: move into AlternateRows component + if (tf.alternateBgs) { + var rows = tf.tbl.rows, + c = 0; + + var setClass = function setClass(row, i, removeOnly) { + if (_Types2['default'].isUndef(removeOnly)) { + removeOnly = false; + } + var altRows = tf.feature('alternateRows'), + oddCls = altRows.oddCss, + evenCls = altRows.evenCss; + _Dom2['default'].removeClass(row, oddCls); + _Dom2['default'].removeClass(row, evenCls); + + if (!removeOnly) { + _Dom2['default'].addClass(row, i % 2 ? oddCls : evenCls); + } + }; + + for (var i = tf.refRow; i < tf.nbRows; i++) { + var isRowValid = rows[i].getAttribute('validRow'); + if (tf.paging && rows[i].style.display === '') { + setClass(rows[i], c); + c++; + } else { + if ((isRowValid === 'true' || isRowValid === null) && rows[i].style.display === '') { + setClass(rows[i], c); + c++; + } else { + setClass(rows[i], c, true); + } + } + } + } + //sort behaviour for paging + if (adpt.isPaged) { + var paginator = tf.feature('paging'); + paginator.reset(false); + paginator.setPage(paginator.getPage()); + adpt.isPaged = false; + } + + if (adpt.onAfterSort) { + adpt.onAfterSort.call(null, tf, tf.stt.sortColumn); + } + }; + + this.initialized = true; + } + }, { + key: 'sortByColumnIndex', + + /** + * Sort specified column + * @param {Number} colIdx Column index + */ + value: function sortByColumnIndex(colIdx) { + this.stt.sort(colIdx); + } + }, { + key: 'overrideSortableTable', + value: function overrideSortableTable() { + var adpt = this, + tf = this.tf; + + /** + * Overrides headerOnclick method in order to handle th event + * @param {Object} e [description] + */ + SortableTable.prototype.headerOnclick = function (evt) { + if (!adpt.initialized) { + return; + } + + // find Header element + var el = evt.target || evt.srcElement; + + while (el.tagName !== 'TD' && el.tagName !== 'TH') { + el = el.parentNode; + } + + this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex); + }; + + /** + * Overrides getCellIndex IE returns wrong cellIndex when columns are + * hidden + * @param {Object} oTd TD element + * @return {Number} Cell index + */ + SortableTable.getCellIndex = function (oTd) { + var cells = oTd.parentNode.cells, + l = cells.length, + i = undefined; + for (i = 0; cells[i] != oTd && i < l; i++) {} + return i; + }; + + /** + * Overrides initHeader in order to handle filters row position + * @param {Array} oSortTypes + */ + SortableTable.prototype.initHeader = function (oSortTypes) { + var stt = this; + if (!stt.tHead) { + if (tf.gridLayout) { + stt.tHead = tf.feature('gridLayout').headTbl.tHead; + } else { + return; + } + } + + stt.headersRow = tf.headersRow; + var cells = stt.tHead.rows[stt.headersRow].cells; + stt.sortTypes = oSortTypes || []; + var l = cells.length; + var img = undefined, + c = undefined; + + for (var i = 0; i < l; i++) { + c = cells[i]; + if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None') { + c.style.cursor = 'pointer'; + img = _Dom2['default'].create('img', ['src', adpt.imgPath + adpt.imgBlank]); + c.appendChild(img); + if (stt.sortTypes[i] !== null) { + c.setAttribute('_sortType', stt.sortTypes[i]); + } + _Event2['default'].add(c, 'click', stt._headerOnclick); + } else { + c.setAttribute('_sortType', oSortTypes[i]); + c._sortType = 'None'; + } + } + stt.updateHeaderArrows(); + }; + + /** + * Overrides updateHeaderArrows in order to handle arrows indicators + */ + SortableTable.prototype.updateHeaderArrows = function () { + var stt = this; + var cells = undefined, + l = undefined, + img = undefined; + + // external headers + if (adpt.asyncSort && adpt.triggerIds.length > 0) { + var triggers = adpt.triggerIds; + cells = []; + l = triggers.length; + for (var j = 0; j < triggers.length; j++) { + cells.push(_Dom2['default'].id(triggers[j])); + } + } else { + if (!this.tHead) { + return; + } + cells = stt.tHead.rows[stt.headersRow].cells; + l = cells.length; + } + for (var i = 0; i < l; i++) { + var cellAttr = cells[i].getAttribute('_sortType'); + if (cellAttr !== null && cellAttr !== 'None') { + img = cells[i].lastChild || cells[i]; + if (img.nodeName.toLowerCase() !== 'img') { + img = _Dom2['default'].create('img', ['src', adpt.imgPath + adpt.imgBlank]); + cells[i].appendChild(img); + } + if (i === stt.sortColumn) { + img.className = adpt.imgClassName + ' ' + (this.descending ? adpt.imgDescClassName : adpt.imgAscClassName); + } else { + img.className = adpt.imgClassName; + } + } + } + }; + + /** + * Overrides getRowValue for custom key value feature + * @param {Object} oRow Row element + * @param {String} sType + * @param {Number} nColumn + * @return {String} + */ + SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) { + var stt = this; + // if we have defined a custom getRowValue use that + var sortTypeInfo = stt._sortTypeInfo[sType]; + if (sortTypeInfo && sortTypeInfo.getRowValue) { + return sortTypeInfo.getRowValue(oRow, nColumn); + } + var c = oRow.cells[nColumn]; + var s = SortableTable.getInnerText(c); + return stt.getValueFromString(s, sType); + }; + + /** + * Overrides getInnerText in order to avoid Firefox unexpected sorting + * behaviour with untrimmed text elements + * @param {Object} oNode DOM element + * @return {String} DOM element inner text + */ + SortableTable.getInnerText = function (oNode) { + if (!oNode) { + return; + } + if (oNode.getAttribute(adpt.customKey)) { + return oNode.getAttribute(adpt.customKey); + } else { + return _Dom2['default'].getText(oNode); + } + }; + } + }, { + key: 'addSortType', + value: function addSortType() { + var args = arguments; + SortableTable.prototype.addSortType(args[0], args[1], args[2], args[3]); + } + }, { + key: 'setSortTypes', + value: function setSortTypes() { + var _this = this; + + var tf = this.tf, + sortTypes = this.sortTypes, + _sortTypes = []; + + for (var i = 0; i < tf.nbCells; i++) { + var colType = undefined; + + if (sortTypes[i]) { + colType = sortTypes[i].toLowerCase(); + if (colType === 'none') { + colType = 'None'; + } + } else { + // resolve column types + if (tf.hasColNbFormat && tf.colNbFormat[i] !== null) { + colType = tf.colNbFormat[i].toLowerCase(); + } else if (tf.hasColDateType && tf.colDateType[i] !== null) { + colType = tf.colDateType[i].toLowerCase() + 'date'; + } else { + colType = 'String'; + } + } + _sortTypes.push(colType); + } + + //Public TF method to add sort type + + //Custom sort types + this.addSortType('number', Number); + this.addSortType('caseinsensitivestring', SortableTable.toUpperCase); + this.addSortType('date', SortableTable.toDate); + this.addSortType('string'); + this.addSortType('us', usNumberConverter); + this.addSortType('eu', euNumberConverter); + this.addSortType('dmydate', dmyDateConverter); + this.addSortType('ymddate', ymdDateConverter); + this.addSortType('mdydate', mdyDateConverter); + this.addSortType('ddmmmyyyydate', ddmmmyyyyDateConverter); + this.addSortType('ipaddress', ipAddress, sortIP); + + this.stt = new SortableTable(tf.tbl, _sortTypes); + + /*** external table headers adapter ***/ + if (this.asyncSort && this.triggerIds.length > 0) { + (function () { + var triggers = _this.triggerIds; + for (var j = 0; j < triggers.length; j++) { + if (triggers[j] === null) { + continue; + } + var trigger = _Dom2['default'].id(triggers[j]); + if (trigger) { + trigger.style.cursor = 'pointer'; + + _Event2['default'].add(trigger, 'click', function (evt) { + var elm = evt.target; + if (!_this.tf.sort) { + return; + } + _this.stt.asyncSort(_Arr2['default'].indexByValue(triggers, elm.id, true)); + }); + trigger.setAttribute('_sortType', _sortTypes[j]); + } + } + })(); + } + } + }, { + key: 'destroy', + + /** + * Destroy sort + */ + value: function destroy() { + var tf = this.tf; + this.sorted = false; + this.initialized = false; + this.stt.destroy(); + + var ids = tf.getFiltersId(); + for (var idx = 0; idx < ids.length; idx++) { + var header = tf.getHeaderElement(idx); + var img = _Dom2['default'].tag(header, 'img'); + + if (img.length === 1) { + header.removeChild(img[0]); + } + } + } + }]); + + return AdapterSortableTable; + })(); + + exports['default'] = AdapterSortableTable; + + //Converters + function usNumberConverter(s) { + return _Helpers2['default'].removeNbFormat(s, 'us'); + } + function euNumberConverter(s) { + return _Helpers2['default'].removeNbFormat(s, 'eu'); + } + function dateConverter(s, format) { + return _DateHelper2['default'].format(s, format); + } + function dmyDateConverter(s) { + return dateConverter(s, 'DMY'); + } + function mdyDateConverter(s) { + return dateConverter(s, 'MDY'); + } + function ymdDateConverter(s) { + return dateConverter(s, 'YMD'); + } + function ddmmmyyyyDateConverter(s) { + return dateConverter(s, 'DDMMMYYYY'); + } + + function ipAddress(value) { + var vals = value.split('.'); + for (var x in vals) { + var val = vals[x]; + while (3 > val.length) { + val = '0' + val; + } + vals[x] = val; + } + return vals.join('.'); + } + + function sortIP(a, b) { + var aa = ipAddress(a.value.toLowerCase()); + var bb = ipAddress(b.value.toLowerCase()); + if (aa == bb) { + return 0; + } else if (aa < bb) { + return -1; + } else { + return 1; + } + } + module.exports = exports['default']; + +/***/ }, +/* 30 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + var _interopRequireDefault = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + // import 'script!sortabletable'; + + var _AdapterSortableTable = __webpack_require__(29); + + var _AdapterSortableTable2 = _interopRequireDefault(_AdapterSortableTable); + + if (!window.SortableTable) { + __webpack_require__(31); + } + + exports['default'] = _AdapterSortableTable2['default']; + module.exports = exports['default']; + +/***/ }, +/* 31 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(32)(__webpack_require__(33)+"\n\n// SCRIPT-LOADER FOOTER\n//# sourceURL=script:///C:/Users/max.guglielmi/Documents/dev/perso/javascript/GitHub/TableFilter/libs/sortabletable.js") + +/***/ }, +/* 32 */ +/***/ function(module, exports, __webpack_require__) { + + /* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra + */ + module.exports = function(src) { + if (typeof execScript === "function") + execScript(src); + else + eval.call(null, src); + } + +/***/ }, +/* 33 */ +/***/ function(module, exports, __webpack_require__) { + + module.exports = "/*----------------------------------------------------------------------------\\\r\n| Sortable Table 1.12 |\r\n|-----------------------------------------------------------------------------|\r\n| Created by Erik Arvidsson |\r\n| (http://webfx.eae.net/contact.html#erik) |\r\n| For WebFX (http://webfx.eae.net/) |\r\n|-----------------------------------------------------------------------------|\r\n| A DOM 1 based script that allows an ordinary HTML table to be sortable. |\r\n|-----------------------------------------------------------------------------|\r\n| Copyright (c) 1998 - 2006 Erik Arvidsson |\r\n|-----------------------------------------------------------------------------|\r\n| Licensed under the Apache License, Version 2.0 (the \"License\"); you may not |\r\n| use this file except in compliance with the License. You may obtain a copy |\r\n| of the License at http://www.apache.org/licenses/LICENSE-2.0 |\r\n| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |\r\n| Unless required by applicable law or agreed to in writing, software |\r\n| distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT |\r\n| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |\r\n| License for the specific language governing permissions and limitations |\r\n| under the License. |\r\n|-----------------------------------------------------------------------------|\r\n| 2003-01-10 | First version |\r\n| 2003-01-19 | Minor changes to the date parsing |\r\n| 2003-01-28 | JScript 5.0 fixes (no support for 'in' operator) |\r\n| 2003-02-01 | Sloppy typo like error fixed in getInnerText |\r\n| 2003-07-04 | Added workaround for IE cellIndex bug. |\r\n| 2003-11-09 | The bDescending argument to sort was not correctly working |\r\n| | Using onclick DOM0 event if no support for addEventListener |\r\n| | or attachEvent |\r\n| 2004-01-13 | Adding addSortType and removeSortType which makes it a lot |\r\n| | easier to add new, custom sort types. |\r\n| 2004-01-27 | Switch to use descending = false as the default sort order. |\r\n| | Change defaultDescending to suit your needs. |\r\n| 2004-03-14 | Improved sort type None look and feel a bit |\r\n| 2004-08-26 | Made the handling of tBody and tHead more flexible. Now you |\r\n| | can use another tHead or no tHead, and you can chose some |\r\n| | other tBody. |\r\n| 2006-04-25 | Changed license to Apache Software License 2.0 |\r\n|-----------------------------------------------------------------------------|\r\n| Created 2003-01-10 | All changes are in the log above. | Updated 2006-04-25 |\r\n\\----------------------------------------------------------------------------*/\r\n\r\n\r\nfunction SortableTable(oTable, oSortTypes) {\r\n\r\n\tthis.sortTypes = oSortTypes || [];\r\n\r\n\tthis.sortColumn = null;\r\n\tthis.descending = null;\r\n\r\n\tvar oThis = this;\r\n\tthis._headerOnclick = function (e) {\r\n\t\toThis.headerOnclick(e);\r\n\t};\r\n\r\n\tif (oTable) {\r\n\t\tthis.setTable( oTable );\r\n\t\tthis.document = oTable.ownerDocument || oTable.document;\r\n\t}\r\n\telse {\r\n\t\tthis.document = document;\r\n\t}\r\n\r\n\r\n\t// only IE needs this\r\n\tvar win = this.document.defaultView || this.document.parentWindow;\r\n\tthis._onunload = function () {\r\n\t\toThis.destroy();\r\n\t};\r\n\tif (win && typeof win.attachEvent != \"undefined\") {\r\n\t\twin.attachEvent(\"onunload\", this._onunload);\r\n\t}\r\n}\r\n\r\nSortableTable.gecko = navigator.product == \"Gecko\";\r\nSortableTable.msie = /msie/i.test(navigator.userAgent);\r\n// Mozilla is faster when doing the DOM manipulations on\r\n// an orphaned element. MSIE is not\r\nSortableTable.removeBeforeSort = SortableTable.gecko;\r\n\r\nSortableTable.prototype.onsort = function () {};\r\n\r\n// default sort order. true -> descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.element = oTable;\r\n\tthis.setTHead( oTable.tHead );\r\n\tthis.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n\tif (this.tHead && this.tHead != oTHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.tHead = oTHead;\r\n\tthis.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n\tthis.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tif ( this.tHead )\r\n\t\tthis.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar doc = this.tHead.ownerDocument || this.tHead.document;\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tvar l = cells.length;\r\n\tvar img, c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (this.sortTypes[i] != null && this.sortTypes[i] != \"None\") {\r\n\t\t\timg = doc.createElement(\"IMG\");\r\n\t\t\timg.src = \"images/blank.png\";\r\n\t\t\tc.appendChild(img);\r\n\t\t\tif (this.sortTypes[i] != null)\r\n\t\t\t\tc._sortType = this.sortTypes[i];\r\n\t\t\tif (typeof c.addEventListener != \"undefined\")\r\n\t\t\t\tc.addEventListener(\"click\", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.attachEvent != \"undefined\")\r\n\t\t\t\tc.attachEvent(\"onclick\", this._headerOnclick);\r\n\t\t\telse\r\n\t\t\t\tc.onclick = this._headerOnclick;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tc.setAttribute( \"_sortType\", oSortTypes[i] );\r\n\t\t\tc._sortType = \"None\";\r\n\t\t}\r\n\t}\r\n\tthis.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (c._sortType != null && c._sortType != \"None\") {\r\n\t\t\tc.removeChild(c.lastChild);\r\n\t\t\tif (typeof c.removeEventListener != \"undefined\")\r\n\t\t\t\tc.removeEventListener(\"click\", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.detachEvent != \"undefined\")\r\n\t\t\t\tc.detachEvent(\"onclick\", this._headerOnclick);\r\n\t\t\tc._sortType = null;\r\n\t\t\tc.removeAttribute( \"_sortType\" );\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar img;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tif (cells[i]._sortType != null && cells[i]._sortType != \"None\") {\r\n\t\t\timg = cells[i].lastChild;\r\n\t\t\tif (i == this.sortColumn)\r\n\t\t\t\timg.className = \"sort-arrow \" + (this.descending ? \"descending\" : \"ascending\");\r\n\t\t\telse\r\n\t\t\t\timg.className = \"sort-arrow\";\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n\t// find TD element\r\n\tvar el = e.target || e.srcElement;\r\n\twhile (el.tagName != \"TD\")\r\n\t\tel = el.parentNode;\r\n\r\n\tthis.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n\tvar cells = oTd.parentNode.childNodes\r\n\tvar l = cells.length;\r\n\tvar i;\r\n\tfor (i = 0; cells[i] != oTd && i < l; i++)\r\n\t\t;\r\n\treturn i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n\treturn this.sortTypes[nColumn] || \"String\";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n\tif (!this.tBody) return;\r\n\tif (sSortType == null)\r\n\t\tsSortType = this.getSortType(nColumn);\r\n\r\n\t// exit if None\r\n\tif (sSortType == \"None\")\r\n\t\treturn;\r\n\r\n\tif (bDescending == null) {\r\n\t\tif (this.sortColumn != nColumn)\r\n\t\t\tthis.descending = this.defaultDescending;\r\n\t\telse\r\n\t\t\tthis.descending = !this.descending;\r\n\t}\r\n\telse\r\n\t\tthis.descending = bDescending;\r\n\r\n\tthis.sortColumn = nColumn;\r\n\r\n\tif (typeof this.onbeforesort == \"function\")\r\n\t\tthis.onbeforesort();\r\n\r\n\tvar f = this.getSortFunction(sSortType, nColumn);\r\n\tvar a = this.getCache(sSortType, nColumn);\r\n\tvar tBody = this.tBody;\r\n\r\n\ta.sort(f);\r\n\r\n\tif (this.descending)\r\n\t\ta.reverse();\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// remove from doc\r\n\t\tvar nextSibling = tBody.nextSibling;\r\n\t\tvar p = tBody.parentNode;\r\n\t\tp.removeChild(tBody);\r\n\t}\r\n\r\n\t// insert in the new order\r\n\tvar l = a.length;\r\n\tfor (var i = 0; i < l; i++)\r\n\t\ttBody.appendChild(a[i].element);\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// insert into doc\r\n\t\tp.insertBefore(tBody, nextSibling);\r\n\t}\r\n\r\n\tthis.updateHeaderArrows();\r\n\r\n\tthis.destroyCache(a);\r\n\r\n\tif (typeof this.onsort == \"function\")\r\n\t\tthis.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n\tvar oThis = this;\r\n\tthis._asyncsort = function () {\r\n\t\toThis.sort(nColumn, bDescending, sSortType);\r\n\t};\r\n\twindow.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n\tif (!this.tBody) return [];\r\n\tvar rows = this.tBody.rows;\r\n\tvar l = rows.length;\r\n\tvar a = new Array(l);\r\n\tvar r;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tr = rows[i];\r\n\t\ta[i] = {\r\n\t\t\tvalue:\t\tthis.getRowValue(r, sType, nColumn),\r\n\t\t\telement:\tr\r\n\t\t};\r\n\t};\r\n\treturn a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n\tvar l = oArray.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\toArray[i].value = null;\r\n\t\toArray[i].element = null;\r\n\t\toArray[i] = null;\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n\t// if we have defined a custom getRowValue use that\r\n\tif (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n\t\treturn this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n\tvar s;\r\n\tvar c = oRow.cells[nColumn];\r\n\tif (typeof c.innerText != \"undefined\")\r\n\t\ts = c.innerText;\r\n\telse\r\n\t\ts = SortableTable.getInnerText(c);\r\n\treturn this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n\tvar s = \"\";\r\n\tvar cs = oNode.childNodes;\r\n\tvar l = cs.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tswitch (cs[i].nodeType) {\r\n\t\t\tcase 1: //ELEMENT_NODE\r\n\t\t\t\ts += SortableTable.getInnerText(cs[i]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\t//TEXT_NODE\r\n\t\t\t\ts += cs[i].nodeValue;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].getValueFromString( sText );\r\n\treturn sText;\r\n\t/*\r\n\tswitch (sType) {\r\n\t\tcase \"Number\":\r\n\t\t\treturn Number(sText);\r\n\t\tcase \"CaseInsensitiveString\":\r\n\t\t\treturn sText.toUpperCase();\r\n\t\tcase \"Date\":\r\n\t\t\tvar parts = sText.split(\"-\");\r\n\t\t\tvar d = new Date(0);\r\n\t\t\td.setFullYear(parts[0]);\r\n\t\t\td.setDate(parts[2]);\r\n\t\t\td.setMonth(parts[1] - 1);\r\n\t\t\treturn d.valueOf();\r\n\t}\r\n\treturn sText;\r\n\t*/\r\n\t};\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].compare;\r\n\treturn SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n\tthis.uninitHeader();\r\n\tvar win = this.document.parentWindow;\r\n\tif (win && typeof win.detachEvent != \"undefined\") {\t// only IE needs this\r\n\t\twin.detachEvent(\"onunload\", this._onunload);\r\n\t}\r\n\tthis._onunload = null;\r\n\tthis.element = null;\r\n\tthis.tHead = null;\r\n\tthis.tBody = null;\r\n\tthis.document = null;\r\n\tthis._headerOnclick = null;\r\n\tthis.sortTypes = null;\r\n\tthis._asyncsort = null;\r\n\tthis.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n\tthis._sortTypeInfo[sType] = {\r\n\t\ttype:\t\t\t\tsType,\r\n\t\tgetValueFromString:\tfGetValueFromString || SortableTable.idFunction,\r\n\t\tcompare:\t\t\tfCompareFunction || SortableTable.basicCompare,\r\n\t\tgetRowValue:\t\tfGetRowValue\r\n\t};\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n\tdelete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n\tif (n1.value < n2.value)\r\n\t\treturn -1;\r\n\tif (n2.value < n1.value)\r\n\t\treturn 1;\r\n\treturn 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n\treturn x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n\treturn s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n\tvar parts = s.split(\"-\");\r\n\tvar d = new Date(0);\r\n\td.setFullYear(parts[0]);\r\n\td.setDate(parts[2]);\r\n\td.setMonth(parts[1] - 1);\r\n\treturn d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType(\"Number\", Number);\r\nSortableTable.prototype.addSortType(\"CaseInsensitiveString\", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType(\"Date\", SortableTable.toDate);\r\nSortableTable.prototype.addSortType(\"String\");\r\n// None is a special case\r\n" + +/***/ } +]); +//# sourceMappingURL=tf-1.js.map \ No newline at end of file diff --git a/libs/ezEditTable/docs/doc.html b/libs/ezEditTable/docs/doc.html deleted file mode 100644 index 51c58484..00000000 --- a/libs/ezEditTable/docs/doc.html +++ /dev/null @@ -1,2049 +0,0 @@ - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
- - - -

Documentation

- - - -

Configuration Object

- - -

You will find here all the properties of the configuration object ( var - etConfig = { property: value }) needed to configure the EditTable object:

- - - - - -

General

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
selectionbooleanenables / disables selection model (default - true)  var etConfig = { selection: false }
editablebooleanenables / disables inline cell editing(default - false)  var etConfig = { editable: true }
key_navigationbooleanenables / disables keyboard navigation (default - true) var etConfig = { key_navigation: false }
table_cssstringdefines the css class of the table element (default - 'ezEditableTable')Check out the ezEditTable.css stylesheet and edit the css classes - for your project's needs var etConfig = { table_css: "myclass" }
unselectable_css string defines the css class that makes the table text unselectable (default - - 'ezUnselectable')Older versions of IE do not support this css class, as an alternative - use unselectable="on" to expect same result var etConfig = { unselectable_css: "myclass" }
activity_indicator_css string defines the css class to be applied to the table in order to indicate - server activity   var etConfig = { activity_indicator_css: "myclass" }
on_server_activity_start function callback event function called before server activity starts (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • row is the current row to be processed server-side
  • -
var etConfig = { on_server_activity_start: function(o, row){ - alert('Row data to be processed: ' + o.Selection.GetRowValues(row)); } }
on_server_activity_stop function callback event function called when server activity stopped (default: - null)

2 parameters are passed to the function:

- - -
    -
  • o is the current EditTable object
  • -
  • row is the current row to be processed server-side
  • -
var etConfig = { on_server_activity_stop: function(o, row){ - alert('Row data processed server-side: ' + o.Selection.GetRowValues(row)); - } }
base_pathstring defines the path to the script's directory (default: 'ezEditTable/')This is used for the command editor icons' path var etConfig = { base_path: "myDir/" }
- Top of page -
- - - -

Selection

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
selection_modelstring defines the selection model: "single" or "multiple" - (default: 'single') 2 possible values: 'single' or 'multiple'var etConfig = { selection_model: 'multiple' }
default_selectionstringdefines the selection type (default: 'row')3 possible values: 'row', 'cell' or 'both'var etConfig = { default_selection: 'both' }
key_selectionbooleanenables / disable multiple selection by using Ctrl and Shift keys - (default: true)select multiple rows by holding Ctrl or Shift key down, only if - selection model is 'multiple'var etConfig = { key_selection: false }
select_row_at_startbooleanfirst row is selected at start if set true (default: false) var etConfig = { select_row_at_start: true }
row_index_at_startnumberdefines which row has to be selected at start (default: this.startRow)this.startRow = numeric parameter passed to constructor:
- var et = new EditTable('myTableId', 3, etConfig);
var etConfig = { row_index_at_start: 3 }
scroll_into_viewbooleanIf set true selected row scrolls into view; useful when row is selected - by using keyboard (default: false) var etConfig = { scroll_into_view: true }
active_row_cssstringdefines css class for active row (default: 'ezActiveRow') var etConfig = { active_row_css: 'myClass' }
selected_row_cssstringdefines css class for selected rows (default: 'ezSelectedRow')

only if 'multiple' selection model is enabled

-
var etConfig = { selected_row_css: 'myClass' }
active_cell_cssstring defines css class for active cell (default: 'ezActiveCell')only if 'cell' or 'both' selection type is enabledvar etConfig = { active_cell_css: 'myClass' };
nb_rows_per_pagenumber defines number of rows to jump when PgDown or PgUp keys are pressed - (default: 10)

specify a huge number to jump straight to 1st or last row (1000)

-
var etConfig = { nb_rows_per_page: 1000 }
- Top of page -
- - -

Selection callback events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
on_selection_initializedfunctioncallback event function called when Selection object is initialised - (default: null)

1 parameter is passed to the function:

-
    -
  • o is the current EditTable object
  • - -
var etConfig = { on_selection_initialized: function(o){ alert(o.id+' - Selection object is initialised!'); } }
on_before_selected_rowfunctioncallback event function called before a row is selected (default: - null) )

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • row is the current row to be selected
  • -
var etConfig = { on_before_selected_row: function(o, row){ - alert('Row index: ' + row.rowIndex); } }
on_after_selected_rowfunctioncallback event function called after a row is selected (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • - -
  • row is the current selected row
  • -
var etConfig = { on_after_selected_row: function(o, row){ - alert('Row index: ' + row.rowIndex); } }
on_before_selected_cellfunctioncallback event function called before a cell is selected (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell to be selected
  • -
var etConfig = { on_before_selected_cell: function(o, cell){ - alert('Cell index: ' + cell.cellIndex); } }
on_after_selected_cellfunctioncallback event function called (default: null)

2 parameters are passed to the function:

-
    - -
  • o is the current EditTable object
  • -
  • cell is the current selected cell
  • -
var etConfig = { on_after_selected_cell: function(o, cell){ - alert('Cell index: ' + cell.cellIndex); } }
on_before_deselected_rowfunctioncallback event function called before a row is deselected (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • row is the current row to be deselected
  • - -
var etConfig = { on_before_deselected_row: function(o, row){ - alert('Row index: ' + row.rowIndex); } }
on_after_deselected_rowfunctioncallback event function called after a row is deselected (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • row is the current deselected row
  • -
var etConfig = { on_after_deselected_row: function(o, row){ - alert('Row index: ' + row.rowIndex); } }
on_before_deselected_cellfunctioncallback event function called before a cell is deselected (default: - null)

2 parameters are passed to the function:

-
    - -
  • o is the current EditTable object
  • -
  • cell is the current cell to be deselected
  • -
var etConfig = { on_before_deselected_cell: function(o, cell){ - alert('Cell index: ' + cell.cellIndex); } }
on_after_deselected_cellfunctioncallback event function called after a cell is deselected (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current deselected cell
  • - -
var etConfig = { on_after_deselected_cell: function(o, cell){ - alert('Cell index: ' + cell.cellIndex); } }
on_validate_rowfunctioncallback event function called after a row is validated by pressing enter key or on double-click (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • row is the current validated row
  • -
-

Note the editable property needs to be set to false

- -
var etConfig = { on_validate_row: function(o, row){ - alert('Row index: ' + row.rowIndex); } }
on_validate_cellfunctioncallback event function called after a cell is validated by pressing enter key or on double-click (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current validated cell
  • -
-

Note the editable property needs to be set to false

- -
var etConfig = { on_validate_cell: function(o, cell){ - alert('Cell index: ' + cell.cellIndex); } }
- Top of page -
- - - -

Editable

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
editor_modelstringdefines the editor model (default: 'cell')2 possible values: 'cell' or 'row'var etConfig = { editor_model: 'row' }
open_editor_actionstringdefines which mouse action opens the inline editing feature (default: - 'dblclick') 2 possible values: 'dblclick', 'click'var etConfig = { open_editor_action: 'click' }
ajax newbooleanenables AJAX requests (default: true if jQuery is detected)it is enabled if jQuery is detected and the ajax property is - not explicitly set falsevar etConfig = { editable: true, ajax: false }
cell_editorsarrayarray defining the editor configuration for each column (default: - []) the number of editors must be equal to the number of columns. Refer - to Cell editors properties for details - about editors' configuration

var etConfig = { cell_editors: [
- { type: 'select' },
- { type: 'textarea' },
- { type: 'input' },
- { type: 'uploader' },
- { type: 'none' },
- { type: 'command' }
- ] }

input_editor_cssstringdefines the css class for 'input' type editors (default: 'ezInputEditor') var etConfig = { input_editor_css: 'myClass' };
textarea_editor_cssstringdefines the css class for 'textarea' type editors (default: 'ezTextAreaEditor') var etConfig = { textarea_editor_css: 'myClass' };
select_editor_cssstringdefines the css class for 'input' type editors (default: 'ezSelectEditor') var etConfig = { select_editor_css: 'myClass' };
command_editor_cssstringcss class applied to command editor buttons container (default: - 'ezCommandEditor') var etConfig = { command_editor_css: 'myClass' };
modified_cell_cssstringcss class applied to modified cells (default: 'ezModifiedCell')this css class shows the green small triangle in the left-upper - corner of the cellvar etConfig = { modified_cell_css: 'myClass' };
auto_savebooleansaves automatically pending changes upon selection changeeditable property needs to be activated (default: true if editable is on)var etConfig = { auto_save: false };
auto_save_modelstringdetermines when modified and/or added data is saved, upon row or cell selection change (default: 'row')2 possible values 'row' or 'cell'var etConfig = { auto_save_model: 'cell' };
auto_save_typestringdefines if only insertions or updates, or both are saved automatically (default: 'both')3 possible values 'insert', 'update' or 'both'var etConfig = { auto_save_type: 'update' };
editable_on_keystroke newbooleanmakes the inline cell editor appear upon keystroke (default: false)only if edition is enabled and editorModel is set to 'cell' and - selectionModel to 'single'var etConfig = { editable: true, editable_on_keystroke: true };
new_row_prefixstringdefines the prefix for new added row ids (default: 'tr')prefix should match the prefix assigned to already existing rowsvar etConfig = { new_row_prefix: 'row' };
form_submit_intervalnumberdefines the interval in ms separating rows data submissions (default: 50)by default the script submits a single form for each modified row. Depending on ISPs / network - security policies, multiple submissions to same page are blocked by the server. - This interval can be useful to fine tune the form submissions when those server restrictions apply.var etConfig = { form_submit_interval: 750 };
new_row_pos newstring or numberdefines the row position of a newly created row (default: 'top')2 possible values as a string: 'top' or 'bottom', and as an integer: - any number >= 0 and <= total number of rows. If the supplied numeric - value exceeds the total number of rows then the script fallback to default - value 'top'var etConfig = { new_row_pos: 'bottom' };
- - Top of page -
- - -

Cell editors

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
typestringsets the editor type (default: 'input')these are the editor types: 'none', 'input', 'textarea', 'select', - 'multiple', 'boolean', 'command', 'custom', 'uploader' var etConfig = { cell_editors: [
- { type: 'select' },
- { type: 'textarea' },
- { type: 'input' },
- { type: 'uploader' },
- { type: 'none' },
- { type: 'command' }
- ]}
cssstringdefines a css class for the editor (default: null)  var etConfig = { cell_editors: [
- { type: 'select', css:'myClass' },...
- ]}
attributesarray defines the additional attributes for the editor's DOM element - (default: null)useful for specifying the max length of characters for input and - textarea typesvar etConfig = { cell_editors: [
- - { type: 'input', attributes:[['maxLength',5],['title','5 chars max']] - },...
- ]}
stylestringsets the inline style for the editor's DOM element (default: null) var etConfig = { cell_editors: [
- { type: 'textarea', style: 'background-color:#fff;' },...
- ]}
custom_slc_optionsarraydefines the options of a 'select' editor type (default: null)this property applies only to 'select' and 'multiple' editors { - type: 'multiple', custom_slc_options:['a','b','c'], sort_slc_options: - 'string', values_separator: ', ' },var etConfig = { cell_editors: [
- { type: 'select', custom_slc_options:['a','b','c'] },...
- ]}
custom_slc_valuesarraydefines the options values of a 'select' editor type (default: null)this property applies only to 'select' and 'multiple' editors { - type: 'multiple', custom_slc_options:['a','b','c'], custom_slc_values:['1','2','3'], sort_slc_options: - 'string', values_separator: ', ' },var etConfig = { cell_editors: [
- { type: 'select', custom_slc_options:['a','b','c'], custom_slc_values:['1','2','3'] },...
- ]}
sort_slc_optionsstringsorts the custom options (default: null)

this property applies only to 'select' and 'multiple' editors. - 3 possible values:

-
    - -
  • 'string': sorts string values
  • -
  • 'numasc': sorts numeric values in ascending manner
  • -
  • 'numdesc': sorts numeric values in descending manner
  • -
var etConfig = { cell_editors: [
- { type: 'select', custom_slc_options:['a','b','c'], sort_slc_options: - 'string' },...
- ]}
values_separatorstringdefines the value separator for 'multiple' type editors (default: - ', ') this property applies only to 'multiple' editorsvar etConfig = { cell_editors: [
- { type: 'multiple', custom_slc_options:['a','b','c'], sort_slc_options: - 'string', values_separator: '; ' },...
- ]}
allow_empty_valuebooleandefines the columns accepting empty values (default: false)var etConfig = { cell_editors: [
- { type: 'input', allow_empty_value:true },...
- ]}
targetstringdefines the custom editor target element id (default: 'null')this property applies only to 'custom' editorsvar etConfig = { cell_editors: [
- { type: 'custom', target: 'datePick' },...
- ]}
command_column_indexnumbertells the script in which column command buttons have to be generated - (default: this.nbCells-1)this property applies only to 'command' editors. Default value is - the last column of the tablevar etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4 },...
- ]}
buttonsobject

this literal object is the configuration object of the command - buttons generated in column (default: {})

this property applies only to 'command' editors. Refer to Command - buttons properties for details about 'command' editor buttons - configuration

var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- buttons:{
- enable: ['update', 'insert', 'delete', 'submit', 'cancel'],
- 'update': { title:'Edit row' },
- 'insert': { title:'Add row', scrollIntoView: false },
- 'delete': { title:'Delete row' },
- 'submit': { text:'Save', title:'Save' },
- 'cancel': { text:'Cancel', title:'Cancel' } }
- },...
- - ]}

- Top of page -
- - -

Command buttons

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
enablearrayenables the command buttons to be generated (default: ['update', - 'insert', 'delete', 'submit', 'cancel'])command buttons types: 'update', 'insert', 'delete', 'submit', 'cancel'. - To disable a particular button remove it from the arrayvar etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- buttons:{
- enable: ['update', 'submit', 'cancel'],
- 'update': { title:'Edit row' },
- - 'submit': { text:'Save', title:'Save' },
- 'cancel': { text:'Cancel', title:'Cancel' } }
},...
- ]}
updateobjectconfiguration object of the 'update' button (default: {})

Below a list of the properties for the 'update' button:

-
    -
  • 'text': text of the button (default: '')
  • -
  • 'icon': icon image html (default: '<img src="'+this.basePath+'themes/icn_edit.gif" - alt="" />')
  • - -
  • 'title': tooltip for the button (default: 'Edit record')
  • -
  • 'css': additional css class (default: null)
  • -
  • 'style': inline style element (default: null)
  • -
var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- - buttons:{
- enable: ['update'],
- 'update': { text:'Edit', title:'Edit row', css:'myClass'}
},...
- ]}
insertobject configuration object of the 'insert' button (default: {})

Below a list of the properties for the 'insert' button:

-
    -
  • 'text': text of the button (default: '')
  • -
  • 'icon': icon image html (default: '<img src="'+this.basePath+'themes/icn_edit.gif" - alt="" />')
  • - -
  • 'title': tooltip for the button (default: 'Create record')
  • -
  • 'css': additional css class (default: null)
  • -
  • 'style': inline style element (default: null)
  • -
  • 'scrollIntoView': scrolls into view inserted row (default: false)
  • -
var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- buttons:{
- enable: ['insert'],
- 'insert': { text:'Add', title:'Add row', css:'myClass'}
},...
- ]}
deleteobjectconfiguration object of the 'delete' button (default: {})

Below a list of the properties for the 'delete' button:

-
    -
  • 'text': text of the button (default: '')
  • - -
  • 'icon': icon image html (default: '<img src="'+this.basePath+'themes/icn_edit.gif" - alt="" />')
  • -
  • 'title': tooltip for the button (default: 'Delete record')
  • -
  • 'css': additional css class (default: null)
  • -
  • 'style': inline style element (default: null)
  • - -
var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- buttons:{
- enable: ['delete'],
- 'delete': { text:'Remove', title:'Remove row', css:'myClass'}
},...
- - ]}
submitobjectconfiguration object of the 'submit' button (default: {})

Below a list of the properties for the 'submit' button:

-
    -
  • 'text': text of the button (default: 'Submit')
  • -
  • 'icon': icon image html (default: '<img src="'+this.basePath+'themes/icn_edit.gif" - alt="" />')
  • -
  • 'title': tooltip for the button (default: 'Submit record')
  • - -
  • 'css': additional css class (default: null)
  • -
  • 'style': inline style element (default: null)
  • -
var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- buttons:{
- - enable: ['submit'],
- 'submit': { text:'Save', title:'Save row', css:'myClass'}
},...
- ]}
cancelobjectconfiguration object of the 'cancel' button (default: {})

Below a list of the properties for the 'cancel' button:

-
    -
  • 'text': text of the button (default: 'Cancel')
  • -
  • 'icon': icon image html (default: '<img src="'+this.basePath+'themes/icn_edit.gif" - alt="" />')
  • - -
  • 'title': tooltip for the button (default: 'Cancel')
  • -
  • 'css': additional css class (default: null)
  • -
  • 'style': inline style element (default: null)
  • -
var etConfig = { cell_editors: [
- { type: 'command', command_column_index: 4,
- - buttons:{
- enable: ['cancel'],
- 'cancel': { css:'myClass'}
},...
- ]}
- Top of page -
- - -

Uploader editor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
uploaderobjectdefines the uploader editor settings (default: {}) ...cell_editors:[ - { - type: 'uploader', - uploader: { uri: 'php/uploadFile.php', path: 'images/uploads/', max_file_size: '51200', show_link: false } - },... - ] -
uristringdefines the URL of the resource performing the upload operation (default: null) ...cell_editors:[ - { - type: 'uploader', - uploader: { uri: 'php/uploadFile.php' } - },... - ] -
pathstringdefines the path to the uploads folder repository (default: null) ...cell_editors:[ - { - type: 'uploader', - uploader: { path: 'images/uploads/' } - },... - ] -
show_uploadbooleanshows or hides uploaded file (default: true) ...cell_editors:[ - { - type: 'uploader', - uploader: { show_upload: false } - },... - ] -
sql_fieldstringdefines the name of the SQL field name storing upload filename (default: 'IMAGENAME')optional depending on how the upload server-side operation is implemented. - On the script's website, the name of the SQL field storing the filename is rerquired by the PHP resource. - This does not mean that it is a good practice, it is just for demoing purposes....cell_editors:[ - { - type: 'uploader', - uploader: { sql_field: 'FILENAME' } - },... - ] -
record_id_column_indexnumbertells the script which is the index of the column containing the record id (default: null)optional depending on how the id of a record is used in the HTML table. - If this property is defined, the script will use it in order to retrieve the - record id of working row. Otherwise, it will extract it from the id of the - working row, by default 'tr'+Id. - ...cell_editors:[ - { - type: 'uploader', - uploader: { record_id_column_index: 0 } - },... - ] -
show_linkbooleanUploaded file appears as a link in the uploader box and in the cell if set true (default: true) ...cell_editors:[ - { - type: 'uploader', - uploader: { show_link: false } - },... - ] -
link_cssstringdefines the css class for the upload link (default: '') ...cell_editors:[ - { - type: 'uploader', - uploader: { show_link: true, link_css: 'myClass' } - },... - ] -
loader_imagestringdefines the path of the loader image displayed during the upload operation (default: this.basePath + 'themes/img_loader.gif') ...cell_editors:[ - { - type: 'uploader', - uploader: { loader_image: 'myFolder/loader.gif' } - },... - ] -
ok_imagestringsets the path of the image used to notify users that cell contains an uploaded file (default: this.basePath + 'themes/img_loader.gif')If show_upload is active and show_link property is set false this property applies....cell_editors:[ - { - type: 'uploader', - uploader: { ok_image: 'myFolder/ok.gif' } - },... - ] -
max_file_sizenumbersets the maximum file size allowed, default value is 100Kb (default: 102400)Optional depending on the server-side implementation. This value is passed to the server in the online script's demos....cell_editors:[ - { - type: 'uploader', - uploader: { max_file_size: 51200 } - },... - ] -
valid_extensionsstringsets a list of comma separated file extensions to pass to the server logic (default: 'jpg, jpeg, gif, png')Optional depending on the server-side implementation. This value is passed to the server in the online script's demos....cell_editors:[ - { - type: 'uploader', - uploader: { valid_extensions: 'doc,docx,pdf,rtf' } - },... - ] -
cssstringdefines the css class applied to the uploader container element (default: 'ezUploaderEditor')...cell_editors:[ - { - type: 'uploader', - uploader: { css: 'myClass' } - },... - ] -
output_cssstringdefines the css class applied to the uploader output messages container (default: 'ezUploaderEditorOutput')...cell_editors:[ - { - type: 'uploader', - uploader: { output_css: 'myClass' } - },... - ] -
display_cssstringdefines the css class applied to the image displayer container (default: 'ezUploaderEditorOutput')...cell_editors:[ - { - type: 'uploader', - uploader: { output_css: 'myClass' } - },... - ] -
javascript_code_successstringdefines javascript code to be injected by the server after a successfull upload operation - (default: '<script>window.parent["{1}"].SetUploadSuccess(true); window.parent["{1}"].SetUploadName("{0}");' + - 'window.parent["{1}"].ShowUpload();</script>')Optional depending on server-side implementation. This value is passed to the server in the online script's demos....cell_editors:[ - { - type: 'uploader', - uploader: { javascript_code_success: '<script>alert('Upload name: {0}');</script>' } - },... - ] -
- - Top of page -
- - -

Editable and cell editors callback events and delegates

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
on_editable_initializedfunctioncallback event function called when Editable object is initialised - (default: null)

1 parameter is passed to the function:

-
    -
  • o is the current EditTable object
  • - -
var etConfig = { on_editable_initialized: function(o){ alert(o.id+ - ' Editable object is initialised!'); } }
on_before_open_editorfunctioncallback event function called before a cell editor is opened - (default: null) -

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • -
  • editor is the current opened editor
  • -
var etConfig = { on_before_open_editor: function(o, cell, - editor){ cell.style.backgroundColor = 'pink'; } }
on_after_open_editorfunction callback event function called after a cell editor is opened (default: - null)

3 parameters are passed to the function:

-
    - -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • -
  • editor is the current opened editor
  • -
var etConfig = { on_after_open_editor: function(o, cell, editor){ - cell.style.backgroundColor = 'transparent'; } }
on_before_close_editorfunctioncallback event function called before a cell editor is closed (default: - null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • - -
  • cell is the current cell
  • -
  • editor is the current opened editor
  • -
var etConfig = { on_before_close_editor: function(o, cell, - editor){ cell.style.backgroundColor = 'pink'; } }
on_after_close_editorfunctioncallback event function called after a cell editor is closed (default: - null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • - -
  • editor is the current opened editor
  • -
var etConfig = { on_after_close_editor: function(o, cell, - editor){ cell.style.backgroundColor = 'transparent'; } }
set_custom_editor_valuefunctiondelegate function called to set 'custom' editor value (default: - null)

4 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened editor
  • -
  • colIndex is the column index
  • - -
  • val is the value to set in the custom editor
  • -
var etConfig = { set_custom_editor_value: function(o, editor, - colIndex, val){ alert('Value to set in custom editor:' + val); } }
get_custom_editor_valuefunctiondelegate function called to get 'custom' editor value (default: - null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened editor
  • -
  • colIndex is the column index
  • - -
var etConfig = { get_custom_editor_value: function(o, editor, - colIndex){ alert('Call function to retrieve custom editor value for - column '+colIndex); } }
set_cell_modified_valuefunctiondelegate function called to write modified value in cell (default: - null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • -
  • val is the value to write in the cell
  • -
var etConfig = { set_cell_modified_value: function(o, cell, - val){ alert('This value has to be written in the cell: ' + val); } - }
validate_modified_valuefunctiondelegate function called to validate modified value to be written - in cell (default: null)

3 parameters are passed to the function:

-
    - -
  • o is the current EditTable object
  • -
  • colIndex is the column index
  • -
  • cellVal is the cell value
  • -
  • edtVal is the editor value
  • -
  • cell is the current cell
  • - -
  • editor is the current editor
  • -
-

The validation delegate must return a boolean

var etConfig = { validate_modified_value: function(o, colIndex, - cellVal, edtVal, cell, editor){ alert('Validation function returns - a boolean'); } }
open_custom_editorfunctiondelegate function called to open 'custom' editor (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • - -
  • editor is the current opened editor
  • -
var etConfig = { open_custom_editor: function(o, cell, editor){ - alert('Custom editor for column '+cell.cellIndex+' is being opened!'); - } }
close_custom_editorfunctiondelegate function called to close 'custom' editor (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • cell is the current cell
  • -
  • editor is the current opened editor
  • - -
var etConfig = { close_custom_editor: function(o, cell, editor){ - alert('Custom editor for column '+cell.cellIndex+' is closed!'); } - }
show_uploadfunctiondelegate function called by uploader editor to display uploaded file (default: null)

4 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • divUplDisplay is the container element containing the upload
  • -
  • uploadName is the filename of the uploaded file
  • -
  • path is the upload path
  • -
var etConfig = { - cell_editors:[ - { - type: 'uploader', - uploader: { - show_upload: function(o, divUplDisplay, uploadName, path){ - divUplDisplay.style.display = ''; - divUplDisplay.innerHTML = uploadName; - } - } - }] - }
on_before_openfunctioncallback called before uploader editor is opened (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened uploader editor
  • -
  • cell is the current cell
  • -
var etConfig = { - cell_editors:[ - { - type: 'uploader', - uploader: { - on_before_open: function(o, editor, cell){ - alert('uploader is going to be opened'); - } - } - }] - }
on_after_openfunctioncallback called after uploader editor is opened (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened uploader editor
  • -
  • cell is the current cell
  • -
var etConfig = { - cell_editors:[ - { - type: 'uploader', - uploader: { - on_after_open: function(o, editor, cell){ - alert('uploader is opened now'); - } - } - }] - }
on_before_closefunctioncallback called before uploader editor is closed (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened uploader editor
  • -
  • cell is the current cell
  • -
var etConfig = { - cell_editors:[ - { - type: 'uploader', - uploader: { - on_before_close: function(o, editor, cell){ - alert('uploader is going to be closed'); - } - } - }] - }
on_after_closefunctioncallback called after uploader editor is closed (default: null)

3 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • editor is the current opened uploader editor
  • -
  • cell is the current cell
  • -
var etConfig = { - cell_editors:[ - { - type: 'uploader', - uploader: { - on_after_close: function(o, editor, cell){ - alert('uploader is closed now'); - } - } - }] - }
- Top of page -
- - -

Actions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
actionsobjectserver actions configuration object (default: {})   

var etConfig = {
- actions:{
- 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST', -
- param_names: ['iso', 'name', 'printablename', 'iso3', 'code'] },
- - 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- param_names: ['iso', 'name', 'printablename', 'iso3', 'code'] },
- 'delete': {
- uri: 'script.delete.php', submit_method: 'script', bulk_delete: - true }
- }
- -
}

-
update object'update' action configuration object (default: {})

Below the list of properties for the 'update' actions:

-
    -
  • uri: server-side page
  • -
  • form_method: 2 possible values 'form' or 'script'
  • -
  • submit_method: 'POST' or 'GET' requests, if form_method is script - only GET requests
  • -
  • param_names: collection of parameters expected by the server-side - page (uri property)
  • - -
var etConfig = {
- actions:{
- 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST', -
- param_names: ['iso', 'name', 'printablename', 'iso3', 'code'] } }
- -
}
insertobject 'insert' action configuration object (default: {})

Below the list of properties for the 'insert' actions:

- -
    -
  • uri: server-side page
  • -
  • form_method: 2 possible values 'form' or 'script'
  • -
  • submit_method: 'POST' or 'GET' requests, if form_method is script - only GET requests
  • -
  • param_names: collection of parameters expected by the server-side - page (uri property)
  • -
  • default_record: collection of values to add when a row is added - to table (insert command button)
  • - -

var etConfig = {
- actions:{
- 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- param_names: ['iso', 'name', 'printablename', 'iso3', 'code'],
- - default_record: ['', 'New country', 'New country', 'XXX', '0']
} - }
-
}

-
deleteobject'delete' action configuration object  (default: {})

Below the list of properties for the 'update' actions:

-
    -
  • uri: server-side page
  • -
  • form_method: 2 possible values 'form' or 'script'
  • -
  • submit_method: 'POST' or 'GET' requests, if form_method is script - only GET requests
  • - -
  • param_names: collection of parameters expected by the server-side - page (uri property)
  • -
  • bulk_delete: enables multiple rows deletion operations
  • -
var etConfig = {
- actions:{
- 'delete': {
- - uri: 'script.delete.php', submit_method: 'script', bulk_delete: true - } }
}
- - -

Actions callback events

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
on_update_submitfunctiondelegate function called for submitting modified data to server - (default: null)

2 parameters are passed to the function:

- -
    -
  • o is the current EditTable object
  • -
  • treated rows: array of modified rows objects
  • -


- var etConfig = {
-
actions:{
- - 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST', -
- on_update_submit: function(o, treatedRows){ alert(treatedRows); - }
- } } } }

-
on_insert_submit function delegate function called for submitting inserted data to server - (default: null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • treated rows: array of inserted rows objects
  • - -
var etConfig = {
- actions:{
- 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- on_insert_submit: function(o, treatedRows){ alert(treatedRows); }
- - } } } }
on_delete_submitfunction delegate function called for submitting deleted data to server - (default: null)

2 parameters are passed to the function:

- -
    -
  • o is the current EditTable object
  • -
  • treated rows: array of deleted rows objects
  • -

- var etConfig = {
- actions:{
- - 'delete': {
- uri: 'script.delete.php', submit_method: 'script', bulk_delete: false,
- on_delete_submit: function(o, treatedRows){ alert(treatedRows); }
- } } } }
on_before_submit function callback function called before data is sent to server (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • treated rows: array of modified rows objects
  • - -

var etConfig = {
- actions:{
- 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST',
- on_before_submit: function(o, modifiedRows){ alert('before update'); - }
- - },
- 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- on_before_submit: function(o, modifiedRows){ alert('before insert'); - }
- },
- 'delete': {
- - uri: 'script.delete.php', submit_method: 'script', bulk_delete: - false,
- on_before_submit: function(o, modifiedRows){ alert('before delete'); - } }
} }

-
on_after_submit function callback function called after data is sent to server (default: - null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • treated rows: array of modified rows objects
  • -
var etConfig = {
- actions:{
- 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST',
- on_after_submit: function(o, modifiedRows){ alert('before update'); - }
- },
- - 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- on_after_submit: function(o, modifiedRows){ alert('before insert'); - }
- },
- 'delete': {
- uri: 'script.delete.php', submit_method: 'script', bulk_delete: false,
- - on_after_submit: function(o, modifiedRows){ alert('before delete'); - } }
}
on_submit_error function callback function called when error occurs when data is sent to - server (default: null)

2 parameters are passed to the function:

-
    -
  • o is the current EditTable object
  • -
  • e is the error object
  • -
  • desc is the error object description
  • -
-
-var etConfig = {
-        actions: {
-            'update': {
-                uri: 'updateRow.php',
-                submit_method: 'form',
-                form_method: 'POST',
-                on_submit_error: function (o, e, desc) {
-                    alert('An error occured');
-                }
-            },
-            'insert': {
-
-                uri: 'insertRow.php',
-                submit_method: 'form',
-                form_method: 'POST',
-
-                on_submit_error: function (o, e, desc) {
-                    alert('An error occured');
-                }
-            },
-            'delete': {
-                uri: 'script.delete.php',
-                submit_method: 'script',
-                bulk_delete: false,
-                on_submit_error: function (o, e, desc) {
-                    alert('An error occured');
-                }
-            }
-        }
-          	
-
check_response_sanity newfunctioncallback function called when the AJAX request returns a response object - usually in JSON format. This delegate checks the sanity of the response object and - returns a boolean (default: null) -

This callback is invoked only when ajax is on.

-

1 parameter is passed to the function:

-
    -
  • data: response object, usually in JSON format
  • -
-
-
-actions: {
-    'update': {
-        uri: 'php/json.update.record.php',
-        form_method: 'POST',
-        param_names: [
-        	'id', 'name', 'email', 'startdate', 'salary'
-        ],
-        check_response_sanity: function (data) {
-            return (data && data.hasOwnProperty('result') &&
-                data.result.hasOwnProperty('success'));
-        }
-    },
-    'insert': {
-        uri: 'php/json.insert.record.php',
-        form_method: 'POST',
-        param_names: [
-        	'id', 'name', 'email', 'startdate', 'salary'
-        ],
-        default_record: [
-        	'', 'Employee name...', 
-        	'employee@email.com', '2011-01-01', 
-        	'0.00'
-        ],
-        check_response_sanity: function (data) {
-            return (data && data.hasOwnProperty('result') &&
-                data.result.hasOwnProperty('success'));
-        }
-    },
-    'delete': {
-        uri: 'php/json.delete.record.php',
-        form_method: 'POST',
-        bulk_delete: false,
-        param_names: ['id'],
-        check_response_sanity: function (data) {
-            return (data && data.hasOwnProperty('result') &&
-                data.result.hasOwnProperty('success'));
-        }
-    }
-};
-          	
-
process_response newfunctioncallback function called when the AJAX request returns a response object - usually in JSON format. This delegate gives the possibility to add custom - processing of the response object (default: null) -

This callback is invoked only when ajax is on.

-

1 parameter is passed to the function:

-
    -
  • data: response object, usually in JSON format
  • -
-
-
-actions: {
-    'update': {
-        uri: 'php/json.update.record.php',
-        form_method: 'POST',
-        param_names: [
-        	'id', 'name', 'email', 'startdate', 'salary'
-        ],
-        process_response: function (data) {
-        	alert(data.result.description);
-        }
-    },
-    'insert': {
-        uri: 'php/json.insert.record.php',
-        form_method: 'POST',
-        param_names: [
-        	'id', 'name', 'email', 'startdate', 'salary'
-        ],
-        default_record: [
-        	'', 'Employee name...', 
-        	'employee@email.com', '2011-01-01', 
-        	'0.00'
-        ],
-        process_response: function (data) {
-            alert(data.result.description + 
-            	' ('+ data.result.id +')');
-        }
-    },
-    'delete': {
-        uri: 'php/json.delete.record.php',
-        form_method: 'POST',
-        bulk_delete: false,
-        param_names: ['id'],
-        process_response: function (data) {
-            alert(data.result.description + 
-            	' ('+ data.result.id +')');
-        }
-    }
-};
-          	
-
- - -

Messages

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
msg_submit_okstringtext displayed when data was successfully sent to the server (default: - 'Modified rows were successfully submitted to server!') 

 

var etConfig = { msg_submit_ok: 'Data saved successfully!'}
msg_confirm_delete_selected_rowsstringtext displayed to ask confirmation for deleting operation (default: - ''Do you want to delete the selected row(s)?'')  var etConfig = { msg_confirm_delete_selected_rows: 'Are you - sure you want to delete selected rows?' }
msg_error_occuredstringtext displayed when an error occurs in general (default: 'An error - occured!')  var etConfig = { msg_error_occured: 'Error!' }
msg_submit_unsuccessfulstringtext displayed when an error occurs when data is sent to server - (default: 'Modified rows could not be saved correctly!')  var etConfig = { msg_submit_unsuccessful: 'Data could not - be saved correctly!' }
undefined_submit_urlstringtext displayed when data cannot be sent to server because URI is - missing (default: 'Modified rows could not be saved! Submit URL is - not defined')  var etConfig = { msg_filter: 'Please provide a URL to which - submit data!' }
- - Top of page -
- - -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/doc_class.html b/libs/ezEditTable/docs/doc_class.html deleted file mode 100644 index 38dab65f..00000000 --- a/libs/ezEditTable/docs/doc_class.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
- - -

Documentation

- - -

EditTable Class

- - - - -

Constructor

-

EditTable(id, startRow, config);

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeDescriptionRemarksExample
idstringid of the table element var myEditTable = new EditTable("myTableId");
startRow numberindex of the first row from which row selection can startoptional parametervar myEditTable = new EditTable("myTableId", 2);
configobject configuration objectoptional parametervar myEditTable = new EditTable("myTableId", 2, { editable: true });
- - - -
- -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/doc_methods.html b/libs/ezEditTable/docs/doc_methods.html deleted file mode 100644 index f69723e9..00000000 --- a/libs/ezEditTable/docs/doc_methods.html +++ /dev/null @@ -1,599 +0,0 @@ - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
- - - -

Documentation

- - - - -

EditTable Class

- - - - -

General Public Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescriptionRemarksExample
Init()EditTable object initialisation  var myET = new EditTable('myTableId');
- myET.editable = true;
- ...
- myET.Init();
GetCellsNb( rowIndex )returns number of cells of a specified row  myET.GetCellsNb(4);
GetRowsNb()returns total number of rows myET.GetRowsNb();
GetRow(e)returns the DOM row element for a given event function myFunction(e){ var clickedRow = myET.GetRow(e); }
GetRowByIndex( rowIndex )returns the DOM row element for a given row index  myET.GetRowByIndex(5);
GetCell(e)returns the DOM cell element for a given event  function myFunction(e){ var clickedCell = myET.GetCell(e); - }
IsSelectable()checks if table rows are selectable and returns a boolean  myET.IsSelectable();
IsEditable()checks if table is editable and returns a boolean  myET.IsEditable();
ClearSelections()clears current row(s) and/or cell selection  myET.ClearSelections();
- - Top of page -
- - -

Selection Public Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescriptionRemarksExample
Init()Selection object initialisation  var myET = new EditTable('myTableId');
- ...
- myET.Selection.Init();
Set()enables selection feature  myET.Selection.Set();
Remove() disables selection feature myET.Selection.Remove();
SetEvents()sets click and keyboard events to table element myET.Selection.SetEvents();
RemoveEvents()removes click and keyboard events to table element myET.Selection.RemoveEvents();
GetActiveRow()returns the active row element, that is, the row currently selected  var activeRow = myET.Selection.GetActiveRow();
- if(activeRow){ ... }
GetActiveCell()returns the active cell element, that is, the cell currently selected var activeCell = myET.Selection.GetActiveCell();
- if(activeCell){ ... }
GetSelectedRows()returns an array of the row elements currently selected, if selection - model is multiplereturns:
- [rowobject, rowobject, rowobject, ... rowobject]
var selRows = myET.Selection.GetSelectedRows();
- if(selRows.length > 0){ ... }
GetSelectedValues()returns an array containing a collection of selected rows values - returns: [
- ['value 0', 'value 1', 'value 2', ... 'value 3'],
- ['value 0', 'value 1', 'value 2', ... 'value 3'],
- - ['value 0', 'value 1', 'value 2', ... 'value 3'],
- ...
- ['value 0', 'value 1', 'value 2', ... 'value 3']
- ]
var selValues = myET.Selection.GetSelectedValues();
- if(selValues.length > 0){
- - var firstValueOfFirstSelectedRow = selValues[0][0];
- }
GetActiveRowValues()returns an array containing the cell values of active rowreturns ['value 0', 'value 1', 'value 2', ... 'value 3']var activeValues = myET.Selection.GetActiveRowValues();
- if(activeValues.length > 0){ ... }
GetRowValues( row )returns an array containing the cell values of a given row, it accepts - only a row DOM elementreturns ['value 0', 'value 1', 'value 2', ... 'value 3']

var myRow = myET.GetRowByIndex(7);
- if(myRow){
- myRowValues = myET.Selection.GetRowValues(myRow);
-
}

SelectRowByIndex( rowIndex )selects a row for a given row index  myET.Selection.SelectRowByIndex(9);
SelectRowsByIndexes( rowIndexes ) newselects rows for a given array of row indexesMultiple selection needs to be active (selection_model: 'multiple') myET.Selection.SelectRowsByIndexes([2, 7, 9, 12]);
SelectRow( row )selects given row element var myRow = myET.GetRowByIndex(6);
- if(myRow){
- myET.Selection.SelectRow(myRow);
- }
DeselectRow( row )deselects given row element var myRow = myET.GetRowByIndex(6);
- if(myET.Selection.IsRowSelected(myRow)){
- - myET.Selection.DeselectRow(myRow);
- }
SelectCell( cell )selects given cell element var myCell = myET.GetRowByIndex(3).cells[2];
- if(myCell) myET.Selection.SelectCell(myCell);
DeselectCell( cell )deselects given cell element var myCell = myET.GetRowByIndex(3).cells[2];
- if(myCell) myET.Selection.DeselectCell(myCell);
ClearSelections()clears current row(s) and/or cell selectionThe general ClearSelections() invokes this method ( - myET.ClearSelections() )myET.Selection.ClearSelections();
IsRowSelected( row )determines if given row is selected and returns a boolean var myRow = myET.GetRowByIndex(6);
- - if(myET.Selection.IsRowSelected(myRow)){ ... }
IsCellSelected( cell )determines if given cell is selected and returns a boolean var myCell = myET.GetRowByIndex(3).cells[2];
- - if(myET.Selection.IsCellSelected( myCell )){ ... }
- - Top of page -
- - -

Editable Public Methods

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescriptionRemarksExample
Init()Editable object initialisation  var myET = new EditTable('myTableId');
- - ...
- myET.Editable.Init();
Set()enables inline editing feature  myET.Editable.Set();
Remove() disables inline editing feature myET.Editable.Remove();
SetEvents()sets click and keyboard events to table element myET.Editable.SetEvents();
RemoveEvents()removes click and keyboard events to table element myET.Editable.RemoveEvents();
GetModifiedRows()returns an array containing the modified rows objectsreturns:
- [
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- - modified: [true, false, ...]
- }],
- ...
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- - modified: [true, false, ...]
- }]
- ]
- urlParams are the paramaters names that are expected server-side. - If the parameters' names are not defined by the property param_names - in the actions object (configuration object actions), - the param name by default equals to 'col_n' where - n is the column index (col_0, col_1, ... col_n)

var modRowObjs = myET.Editable.GetModifiedRows();
- for(var i=0; i<modRowObjs.length; i++){
- var rowIndex = modRowObjs[i][0]; //int
- var obj = modRowObjs[i][1]; //object
- var objValues = obj.values; //array
- - var objModValues = obj.modified; //array of booleans
- var objUrlParams = obj.urlParams //string
- }

GetAddedRows()returns an array containing the added rows objectsreturns:
- [
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- - modified: [true, true, ...]
- }],
- ...
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- - modified: [true, true, ...]
- }]
- ]
- urlParams are the paramaters names that are expected server-side. - If the parameters' names are not defined by the property param_names - in the actions object (configuration object actions), - the param name by default equals to 'col_n' where - n is the column index (col_0, col_1, ... col_n)
var addRowObjs = myET.Editable.GetAddedRows();
- for(var i=0; i<addRowObjs.length; i++){
- var rowIndex = addRowObjs[i][0]; //int
- var obj = addRowObjs[i][1]; //object
- var objValues = obj.values; //array
- var objModValues = obj.modified; //array of booleans
- - var objUrlParams = obj.urlParams //string
- }
GetDeletedRows()returns an array containing the deleted rows objectsreturns:
- - [
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- modified: [false, false, ...]
- - }],
- ...
- [rowIndex,
- { values: [val0, val1, ...valn],
- urlParams: '&ColName0=cellvalue0&ColName1=cellvalue1',
- - modified: [false, false, ...]
- }]
- ]
- urlParams are the paramaters names that are expected server-side. - If the parameters' names are not defined by the property param_names - in the actions object (configuration object actions), - the param name by default equals to 'col_n' where - n is the column index (col_0, col_1, ... col_n)
var delRowObjs = myET.Editable.GetDeletedRows();
- for(var i=0; i<delRowObjs.length; i++){
- var rowIndex = delRowObjs[i][0]; //int
- var obj = delRowObjs[i][1]; //object
- var objValues = obj.values; //array
- - var objModValues = obj.modified; //array of booleans
- var objUrlParams = obj.urlParams //string
- }
SubmitEditedRows()submits edited rows to server according to actions configuration - options modified rows objects are sent to server (uri property in 'update' - actions configuration options)

function SaveEditedRows(){
- myET.Editable.SubmitEditedRows();
- }

-
SubmitAddedRows()submits added rows to server according to actions configuration - options added rows objects are sent to server (uri property in 'insert' - actions configuration options)function SaveAddedRows(){ - myET.Editable.SubmitAddeddRows(); - }
SubmitDeletedRows()submits deleted rows to server according to actions configuration - options deleted rows objects are sent to server (uri property in 'delete' - actions configuration options). A - confirmation prompt appears before sending data to server

function DeleteSelectedRows(){ - myET.Editable.SubmitDeletedRows(); - }

SubmitAll() newsubmits added and edited rows to server according to actions configuration - options function SubmitAll(){ myET.Editable.SubmitAll(); }
AddNewRow()adds a row to the tablemyET.Editable.AddNewRow();
- -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/doc_properties.html b/libs/ezEditTable/docs/doc_properties.html deleted file mode 100644 index 1c295cf3..00000000 --- a/libs/ezEditTable/docs/doc_properties.html +++ /dev/null @@ -1,515 +0,0 @@ - - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
- - - -

Documentation

- - - -

EditTable Class

- - - - -

General Public Properties

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
idstringreturns the HTML table's id used by the EditTable objectuse it as getter onlyalert( myET.id );
tableHTMLTableElementreturns the HTML table element used by the EditTable objectuse it as getter onlyalert( myET.table );
configobjectreturns the EditTable configuration object (literal object)use it as getter or setteralert( myET.config );
startRownumberindex of the first row from which row selection can startuse it as getter onlyalert( myET.startRow );
nbCellsnumberreturns the number of table columnsuse it as getter onlyalert( myET.nbCells );
selectionbooleanenables / disables selection modeluse it as getter or settermyET.selection = false;
keyNavbooleanenables / disables keyboard navigationuse it as getter or settermyET.keyNav = false;
editablebooleanenables / disables inline editinguse it as getter or settermyET.editable = true;
tableCssstringdefines the css class of the table elementuse it as getter or settermyET.tableCss = 'myClass';
unselectableCssstringdefines the css class that makes the table text unselectableuse it as getter or setteralert( myET.unselectableCss );
activityIndicatorCssstringdefines the css class to be applied to the table in order to indicate - server activity use it as getter or setteralert( myET.activityIndicatorCss );
basePathstringdefines the path to the script's directoryuse it as getter or setteralert( myET.basePath );
-
- Top of page - - -

Selection Public Properties

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
selectionModelstringdefines the selection model: "single" or "multiple"use it as getter or setter - 2 possible values: 'single' or 'multiple'myET.selectionModel = 'multiple';
defaultSelectionstringdefines the selection typeuse it as getter or setter - 3 possible values: 'row', 'cell' or - 'both'myET.defaultSelection = 'both';
keySelectionbooleanenables / disable multiple selection by using Ctrl and Shift keys - use it as getter or setter - select multiple rows by holding Ctrl - or Shift key down, only if selection model is 'multiple'myET.keySelection = false;
selectRowAtStartbooleanfirst row is selected at start if set trueuse it as getter or settermyET.selectRowAtStart = true;
rowIndexAtStartnumberdefines which row has to be selected at startuse it as getter or settermyET.rowIndexAtStart = 5;
scrollIntoViewbooleanIf set true selected row scrolls into view; useful when row is selected - by using keyboarduse it as getter or settermyET.scrollIntoView = true;
activeRowCssstringdefines css class for active rowuse it as getter or settermyET.activeRowCss = 'myClass';
selectedRowCssstringdefines css class for selected rowsuse it as getter or setter - only if 'multiple' selection model - is enabledmyET.selectedRowCss = 'myClass';
activeCellCssstringdefines css class for active celluse it as getter or setter - only if 'cell' or 'both' selection - type is enabledmyET.activeCellCss = 'myClass';
nbRowsPerPagenumberdefines number of rows to jump when PgDown or PgUp keys are presseduse it as getter or setter - specify a huge number to jump straight - to 1st or last row (1000)myET.nbRowsPerPage = 1000;
-
- Top of page - - -

Editable Public Properties

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PropertyTypeDescriptionRemarksExample
editorModelstringdefines the editor modeluse it as getter or setter - 2 possible values: 'cell' or 'row'myET.editorModel = 'row';
openEditorActionstringdefines which mouse action opens the inline editing featureuse it as getter or setter - 2 possible values: 'dblclick', 'click'myET.openEditorAction = 'click';
ajax newbooleanenables AJAX requests (default: true if jQuery is detected)it is enabled if jQuery is detected and the ajax property is - not explicitly set falsemyET.ajax = false;
inputEditorCssbooleandefines the css class for 'input' type editorsuse it as getter or setter - select multiple rows by holding Ctrl - or Shift key down, only if selection model is 'multiple'myET.inputEditorCss = 'myClass';
textareaEditorCssbooleandefines the css class for 'textarea' type editorsuse it as getter or settermyET.textareaEditorCss = 'myClass';
selectEditorCssnumberdefines the css class for 'input' type editorsuse it as getter or settermyET.selectEditorCss = 'myClass';
commandEditorCssbooleancss class applied to command editor buttons containeruse it as getter or settermyET.commandEditorCss = 'myClass';
modifiedCellCssstringcss class applied to modified cellsuse it as getter or setter - this css class shows the green small - triangle in the left-upper corner of the cellmyET.modifiedCellCss = 'myClass';
cellEditorsarrayarray defining the editor configuration for each columnuse it as getter or setter - the number of editors must be equal - to the number of columns. Refer to Cell - editors properties for details about editors' configurationmyET.cellEditors = [
- { type: 'select' },
- { type: 'textarea' },
- { type: 'input' },
- { type: 'uploader' },
- { type: 'none' },
- { type: 'command' }
- ];
actionsobjectserver actions configuration object use it as getter or setter - Refer to actions - properties for details about server actions configurationmyET.actions = {
- 'update': {
- uri: 'updateRow.php', submit_method: 'form', form_method: 'POST', -
- param_names: ['iso', 'name', 'printablename', 'iso3', 'code'] },
- 'insert': {
- uri: 'insertRow.php', submit_method: 'form', form_method: 'POST', -
- - param_names: ['iso', 'name', 'printablename', 'iso3', 'code'] },
- 'delete': {
- uri: 'script.delete.php', submit_method: 'script', bulk_delete: true - }
- }
autoSavebooleansaves automatically pending changes upon selection changeeditable property needs to be activated (default: true if editable is on)myET.autoSave = false;
autoSaveModelstringdetermines when modified and/or added data is saved, upon row or cell selection change (default: 'row')2 possible values 'row' or 'cell'myET.autoSaveModel = 'cell';
autoSaveTypestringdefines if only insertions or updates, or both are saved automatically (default: 'both')3 possible values 'insert', 'update' or 'both'myET.autoSaveType = 'update';
editableOnKeystroke newbooleanmakes the inline cell editor appear upon keystroke (default: false)only if edition is enabled and editorModel is set to 'cell' and - selectionModel to 'single'myET.editableOnKeystroke = true;
newRowPrefixstringdefines the prefix for new added row ids (default: 'tr')prefix should match the prefix assigned to already existing rowsmyET.newRowPrefix = 'row';
formSubmitIntervalnumberdefines the interval in ms separating rows data submissions (default: 50)by default the script submits a single form for each modified row. Depending on ISPs - security policies, multiple submissions to same page are simply blocked by the server. - This interval can be useful to fine tune the form submissions when those server restrictions apply.myET.formSubmitInterval = 750;
newRowPos newstring or numberdefines the row position of a newly created row (default: 'top')2 possible values as a string: 'top' or 'bottom', and as an integer: - any number >= 0 and <= total number of rows. If the supplied numeric - value exceeds the total number of rows then the script fallback to default - value 'top'myET.newRowPos = 'bottom';
-
- - Top of page - - -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/doc_utilities.html b/libs/ezEditTable/docs/doc_utilities.html deleted file mode 100644 index 2f362404..00000000 --- a/libs/ezEditTable/docs/doc_utilities.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
- - - -

Documentation

- - - -

Utility Functions

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MethodDescriptionRemarksExample
setEditTable( id, startRow, config )

Calls EditTable constructor and returns the EditTable object:

- -
    -
  • id: table id (string)
  • -
  • startRow (optional): index of the first row from which row selection - can start (number)
  • -
  • config (optional): configuration object (literal object)
  • -
  var et = setEditTable('myTableId', 2, { editable: true });
Get(id)

this is a document.getElementById() shortcut:

-
    -
  • id: id of the element (string)
  • - -
  var myElm = et.Get('myId');
Tag(o, tagname)

this is just a getElementsByTagName() shortcut:

- -
    -
  • o: target element (DOM element)
  • -
  • tagname: tag to search for (string)
  • -
-

It returns an array

 var myTables = et.Tag(document, 'table');
GetText(n)

returns the text of given a node and its child nodes:

-
    -
  • n: node (DOM element)
  • -
 var tableText = et.GetText( et.Tag(document,'table' )[0]);
CreateElm(tag)

creates an html element with defined attributes:

-
    -
  • the html tag to create (string)
  • - -
  • an unlimited # of arrays defining the attributes values ('attribute - name','value' ['id','myId'])
  • -
 var myInput = et.CreateElm( 'input', ['id','myId'], ['value','Hello - world'] );
CreateText(t)

this is just a document.createTextNode shortcut:

- -
    -
  • t: text to generate (string)
  • -
 var myText = et.CreateText( 'Hello world' );
IsArray(obj)

checks if passed param is an array. It returns a boolean

 alert(et.IsArray([1,2,3]));
IsObj(obj)

checks if passed param is an object. It returns a boolean

 alert(et.IsObj({ text: 'hello'}));
IsFn(fn)

checks if passed param is a function. It returns a boolean

 alert(et.IsFn(function(){ var a=0; }));
- -
- - - -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/index.html b/libs/ezEditTable/docs/index.html deleted file mode 100644 index 8d1da9ef..00000000 --- a/libs/ezEditTable/docs/index.html +++ /dev/null @@ -1,473 +0,0 @@ - - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi - - - - - - - - - - - - - - - -
- - - - - -
-

ezEditTable

-

Description

-

- ezEditTable is a javascript code aimed at enhancing regular - HTML tables by adding features such as inline editing components, advanced - selection and keyboard navigation. With just a line of code you can easily - convert a regular HTML table in an advanced editable and selectable grid control. -

-

Main features

-
    -
  • Attach to an existing HTML table
  • -
  • Advanced selection model
  • -
  • Extended keyboard navigation
  • -
  • Inline cell or row editing
  • -
  • Insert and remove rows
  • -
  • Send changes to server via GET or POST form submission, AJAX requests or - by script injection in the head section of the document (only GETs)
  • -
  • Integration with any server-side technology as this is a pure client-side solution
  • -
  • Callbacks for all events, and delegates for most actions
  • -
  • Based on plain javascript and dependent on jQuery only for performing AJAX requests
  • -
  • Exhaustive documentation and API
  • -
  • Easy setup and easy customisable themes
  • -
- -

Installation - - Starter - -

-

To install ezEditTable unzip the download package and then include the following - scripts and stylesheet files in the head section of your page:

- -
-	<link href="ezEditTable/ezEditTable.css" rel="stylesheet" type="text/css"/>
-	<script src="ezEditTable/ezEditTable.js"></script>
-	
- -

Make sure the table you'd like to make editable or selectable - has an unique id and a thead and tbody - sections.

-

Here you have an example of a regular html table:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- -

Below the same table enhanced by the script (id="table1"), - click to select a row or use keys to move the selection:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- - -

There are 2 different ways to call the script:

-
    - - -
  • invoke the setEditTable function, which returns a EditTable object:
  • -
- -
<script language="javascript" type="text/javascript">
-	var et = setEditTable("table1");
-</script> 
- -
    -
  • instanciate the EditTable object:
  • -
- -
<script language="javascript" type="text/javascript">
-	var et = new EditTable('table1');
-	et.Init();
-</script> 
-

If your document contains several tables (like this page), it is important - to define unique ids, otherwise the script will not work properly.

- -

The setEditTable() function or the EditTable - class accepts 2 additional parameters that will be explained in the next - tables. In the example below, by specifing a row number as a "start" - row, we tell the script from which row can start the selection, this is - helpful when the tbody and thead sections are not defined:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is the table caption
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- - -
var et02 = setEditTable("table2", 2);
- -

or

- -
var et02 = new EditTable("table2", 2);
-et02.Init();
-

By default, the script adds a single row selection feature to the table. - You could decide to also add a cell selection feature and make the cells - editable, double-click on a cell to see:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This is the table caption
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- -

To do that you just need to declare a literal object (configuration - object) in which you specify the features you would like to enable:

- -
<script language="javascript" type="text/javascript">
-	var table3Config = {
-		default_selection: 'both',
-		editable: true,
-		auto_save: false
-	}
- 	var et03 = setTableEdit("table3", 2, table3Config);
-</script>
-

or

-
<script language="javascript" type="text/javascript">
-	var table3Config = {
-		default_selection: 'both',
-		editable: true,
-		auto_save: false
-	}
-	var et03 = new EditTable("table3", 2 ,table3Config);
-	et03.Init();
-</script>
- -

You can name the configuration object as you want, but don't forget - to add it to the parameters of the setEditTable() function - or EditTable class. It is important to respect the syntax and - naming convention as shown above. You will find an exhaustive list of properties - in the documentation section.

-

Documentation

- - -

For more information about the script's configuration and API check out - the documentation and the - available online demos.

- -
- -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/samples.html b/libs/ezEditTable/docs/samples.html deleted file mode 100644 index 233ed4fe..00000000 --- a/libs/ezEditTable/docs/samples.html +++ /dev/null @@ -1,1082 +0,0 @@ - - - - ezEditTable, enhance HTML tables easily, advanced inline editing, selection and keyboard navigation - script by Max Guglielmi | Samples, Examples - - - - - - - - - - - - - - - -
- - - - - -
- -

Samples - - Starter - -

- -

In this page you will find a collection of samples showing how to configure - the ezEditTable script.

-
-
    -
  • Table 1: call the script
  • -
  • Table 2: enable cell selection only
  • - -
  • Table 3: enable multiple rows selection (click - + ctrl or shift key) and define selection's starting row
  • -
  • Table 4: disable key navigation and key selection - (ctrl and shift key for multiple selection), enable multiple selection - (click selection)
  • -
  • Table 5: select a row at start and use callback - event functions before and after a row is selected
  • -
  • Table 6: enable default inline cell editing, double-click - on a cell to display cell editor
  • -
  • Table 7: define editor type by column, double-click - or use F2, enter or spacebar keys to display editor
  • - -
  • Table 8: use the script's public methods and properties - to change features programmatically or to retrieve information
  • -
  • Table 9: enable a command type column editor
  • -
-
- -
-

Here you have a regular HTML table:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- WORLD INTERNET USAGE AND POPULATION STATISTICS -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
- -

Below the same table enhanced by the ezEditTable script:

- -

TABLE 1

-

Call the script

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
- -
<script language="javascript" type="text/javascript">
-	var et1 = setEditTable("table1");
-</script>
-
- - Top of page -
- -

TABLE 2

-

Enable cell selection only

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
- -
<script language="javascript" type="text/javascript">
-	var table2_Config = { default_selection:'cell' };
-	var et2 = setEditTable("table2", table2_Config);
-</script>
- - Top of page -
- -

TABLE 3

- -

Enable multiple rows selection (click + ctrl or shift key) and define selection's - starting row

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Group 1Group 2Group 3
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
-
<script language="javascript" type="text/javascript">
-	var table3_Config = { selection_model: 'multiple' };
-	var et3 = setEditTable("table3", table3_Config, 2);
-</script>
- - Top of page -
- -

TABLE 4

-

Disable key navigation and key selection, enable multiple selection (click - selection)

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
-
<script language="javascript" type="text/javascript">
-	table4_Config = { key_navigation: false, key_selection: false, selection_model: 'multiple' };
-	var et4 = setEditTable("table4", table4_Config);
-</script>
- - Top of page -
- -

TABLE 5

- -

Select a row at start and use callback event functions before (on_before_selected_row) - and after (on_after_selected_row) a row is selected

- -   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
- -
-<script language="javascript" type="text/javascript">
-	var table5_Config = {
-		select_row_at_start: true,
-		row_index_at_start: 1,
-		on_before_selected_row: function(o, row){ o.Get('output1').innerHTML = 'Active row: '+row.rowIndex.toString() +' '; },
-		on_after_selected_row: function(o, row){ o.Get('output2').innerHTML = 'Active row data:' + o.Selection.GetRowValues(row); },
-	};
-	var et5 = setEditTable("table5", table5_Config);
-</script>
- - Top of page -
-

TABLE 6

- -

Enable default inline cell editing, double-click on a cell to display cell - editor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
-
-<script language="javascript" type="text/javascript">
-	var table6_Config = { editable: true, auto_save: false, default_selection: 'both' };
-	var et6 = setEditTable("table6", table6_Config);
-</script>
- - Top of page -
- -

TABLE 7

- -

Define editor type by column, double-click or use F2, enter or spacebar - keys to display editor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
-
-<script language="javascript" type="text/javascript">
-	var table7_Config = {
-		editable: true,
-		auto_save: false,
-		default_selection: 'both',
-		cell_editors:[
-			{ type: 'select', attributes:[['title','Choose a continent']] },
-			{ type: 'input', css:'alignRight' },
-			{ type: 'textarea', style:'background-color: yellow;' },
-			{ type: 'input', attributes:[['maxLength',5],['title','5 chars max']] },
-			{ type: 'none' }
-		]
-	};
-var et7 = setEditTable('table7', table7_Config);
-</script>
- - Top of page -
- -

TABLE 8

- -

Use the script's public methods and properties to change features programmatically - or to retrieve information

-
- - - - - - -
- - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of World
Africa933,448,29214.2 %3.5 %3.0 %
Asia3,712,527,62456.5 %10.5 %35.6 %
Europe809,624,68612.3 %38.6 %28.6 %
Middle East193,452,7272.9 %10.0 %1.8 %
North America334,538,0185.1 %69.4 %21.2 %
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 %
Oceania / Australia34,468,4430.5 %53.5 %1.7 %
- - -
-<script language="javascript" type="text/javascript">
-	var table8_Config = { editable: true, auto_save: false };
-	var et8 = setEditTable("table8", table8_Config);
-</script>
-
-<!-- buttons code below -->
-
-<input type="button" value="Is selectable?" onClick="alert( et8.IsSelectable() );" />
-<input type="button" value="Is editable?" onClick="alert( et8.IsEditable() );" />
-
-<input type="button" value="Clear selections" onClick="et8.ClearSelections();" />
-<input type="button" value="Disable edition" onClick="et8.Editable.Remove();" />
-
-<input type="button" value="Enable edition" onClick="et8.Editable.Set();" />
-<input type="button" value="Disable selection" onClick="et8.Selection.Remove();" />
-
-<input type="button" value="Enable selection" onClick="et8.Selection.Set();" />
-<input type="button" value="Enable multiple selection" onClick="et8.selectionModel = 'multiple';" />
-
-<input type="button" value="Disable multiple selection" onClick="et8.selectionModel = 'single';" />
-<input type="button" value="Enable cell selection" onClick="et8.ClearSelections(); et8.defaultSelection = 'cell';" />
-
-<input type="button" value="Disable cell selection" onClick="et8.ClearSelections(); et8.defaultSelection = 'row';" />
-<input type="button" value="Enable row editor" onClick="et8.editorModel = 'row';" />
-
-<input type="button" value="Disable row editor" onClick="et8.Editable.CloseRowEditor(); et8.editorModel = 'cell';" />
-<input type="button" value="Get active row values" onClick="alert(et8.Selection.GetActiveRowValues());" />
-
-<input type="button" value="Get selected rows values" onClick="alert(et8.Selection.GetSelectedValues());" />
-
- - Top of page -
- - -

TABLE 9

-

Enable a command type column editor

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
World RegionsPopulation ( 2007 Est.)Population % of World% Population ( Penetration )Usage % of WorldAction
Africa933,448,29214.2 %3.5 %3.0 % 
Asia3,712,527,62456.5 %10.5 %35.6 % 
Europe809,624,68612.3 %38.6 %28.6 % 
Middle East193,452,7272.9 %10.0 %1.8 % 
North America334,538,0185.1 %69.4 %21.2 % 
Latin America / Caribbean556,606,6278.5 %16.0 %8.1 % 
Oceania / Australia34,468,4430.5 %53.5 %1.7 % 
-
-<script language="javascript" type="text/javascript">
-//<![CDATA[
-	var table9_Config = {
-		base_path: '../',
-		editable: true,
-		auto_save: false,
-		cell_editors:[
-			{ type: 'select', attributes:[['title','Choose a continent']] },
-			{ type: 'input', css:'alignRight' },
-			{ type: 'textarea', style:'background-color: yellow;' },
-			{ type: 'input', attributes:[['maxLength',5],['title','5 chars max']] },
-			{ type: 'input' },
-			{ type: 'command',
-				buttons:{
-					enable: ['update', 'insert', 'delete', 'submit', 'cancel'],
-					'update': { title:'Edit row' },
-					'insert': { title:'Add row'  },
-					'delete': { title:'Delete row' },
-					'submit': { text:'Save', title:'Save'  },
-					'cancel': { text:'Cancel', title:'Cancel' }
-				}
-			}
-		]
-	};
-	var et9 = setEditTable("table9", table9_Config);
-//]]>
-</script>
- - - Top of page -
- -
- - - - -
- - - - diff --git a/libs/ezEditTable/docs/starter.html b/libs/ezEditTable/docs/starter.html deleted file mode 100644 index 1f306b87..00000000 --- a/libs/ezEditTable/docs/starter.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - ezEditTable, enhance HTML tables easily - Starter page - by Max Guglielmi - - - - - - - - - - -

Starter

-

- ← Documentation -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
- - - -
- -
-

Source code of the page:

-
-<!DOCTYPE HTML>
-<html>
-<head>
-    <title>ezEditTable, enhance HTML tables easily - Starter page - by Max Guglielmi</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
-    <link href="../ezEditTable.css" rel="stylesheet" type="text/css">
-    <script src="../ezEditTable.js"></script>
-</head>
-<body>
-    <h1>ezEditTable Starter</h1>
-
-    <table id="demo" cellspacing="0" cellpadding="0">
-        <thead>
-                    <tr>
-                        <th>From</th>
-                        <th>Destination</th>
-                        <th>Road Distance (km)</th>
-                        <th>By Air (hrs)</th>
-                        <th width="15%">By Rail (hrs)</th>
-
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr>
-                        <td><strong>Sydney</strong></td>
-                        <td>Adelaide</td>
-                        <td>1412</td>
-                        <td>1.4</td>
-                        <td>25.3</td>
-                    </tr>
-                    <tr>
-                        <td><strong>Sydney</strong></td>
-                        <td>Brisbane</td>
-                        <td>982</td>
-                        <td>1.5</td>
-                        <td>16</td>
-                    </tr>
-                    <tr>
-                        <td><strong>Sydney</strong></td>
-                        <td>Canberra</td>
-                        <td>286</td>
-                        <td>.6</td>
-                        <td>4.3</td>
-                    </tr>
-                    <tr>
-                        <td><strong>Sydney</strong></td>
-                        <td>Melbourne</td>
-                        <td>872</td>
-                        <td>1.1</td>
-                        <td>10.5</td>
-                    </tr>
-                    <tr>
-                        <td><strong>Adelaide</strong></td>
-                        <td>Perth</td>
-                        <td>2781</td>
-                        <td>3.1</td>
-                        <td>38</td>
-                    </tr>
-                    <tr>
-                        <td><strong>Adelaide</strong></td>
-                        <td>Alice Springs</td>
-                        <td>1533</td>
-                        <td>2</td>
-                        <td>20.25</td>
-                    </tr>
-                     <tr>
-                        <td><strong>Adelaide</strong></td>
-                        <td>Brisbane</td>
-                        <td>2045</td>
-                        <td>2.15</td>
-                        <td>40</td>
-                    </tr>
-        </tbody>
-    </table>
-
-    <script language="javascript" type="text/javascript">
-        var config = {
-            selection: true,
-            default_selection: 'both'
-        };
-        var et = new EditTable('demo', config);
-        et.Init();
-    </script>
-
-</body>
-</html>
-	  		
-
- - diff --git a/libs/ezEditTable/ezEditTable-uncompressed.css b/libs/ezEditTable/ezEditTable-uncompressed.css deleted file mode 100644 index 50fa7fc9..00000000 --- a/libs/ezEditTable/ezEditTable-uncompressed.css +++ /dev/null @@ -1,86 +0,0 @@ -/*==================================================== - - ezEditTable global stylesheet - - Edit classes below for your projects' needs -=====================================================*/ - -.ezEditableTable{ - padding:0; color:#000; - border-collapse:collapse; - font:12px/13px arial, tahoma, helvetica, sans-serif !important; -} -.ezEditableTable th, .ezEditableTable td{ - margin:0; padding:5px; - color:inherit; - border:1px solid #ccc !important; -} -.ezEditableTable th{ - background:#EBECEE !important; -} - -/* Selection */ -.ezActiveRow{ background-color:#2852A8 !important; color:#fff; } -.ezSelectedRow{ background-color:#316AC5; color:#fff; } -.ezActiveCell{ - background-color:#D9E8FB !important; - color:#000 !important; font-weight:bold; -} -.ezUnselectable{ - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - user-select: none; -} - -/* Cell editors */ -.ezInputEditor{ width:95%; height:auto; font-size:inherit; border:1px solid #AACCF6; } -.ezTextareaEditor{ width:95%; height:35px; font-size:inherit; border:1px solid #AACCF6; } -.ezSelectEditor{ width:100%; font-size:inherit; border:1px solid #AACCF6; } -.ezModifiedCell{ background:transparent url(themes/bg_mod_cell.png) 0 0 no-repeat; } -select[multiple="multiple"].ezSelectEditor{ height:35px; } -/* Command type editor */ -.ezCommandEditor{ margin:2px; } -.ezCommandEditor button{ - font-size:10px; - border:1px solid #ccc; - background:#fff; margin:1px; - border-radius:4px 4px 4px 4px; - -moz-border-radius:4px 4px 4px 4px; -} -/* Uploader editor */ -.ezUploaderEditor{ - position:absolute; display:inline; - margin:15px 0 0 0px; - border:1px solid #ccc; padding:5px; - background:#fff; color:#000; z-index:10000; - border-radius:4px; - -moz-border-radius:4px; - -webkit-border-radius:4px; - box-shadow:3px 3px 2px #888; - -moz-box-shadow:3px 3px 2px #888; - -webkit-box-shadow:3px 3px 2px #888; -} -.ezUploaderEditor button{ - font-size:10px; - border:1px solid #ccc; - background:#fff; margin:1px; - border-radius:4px 4px 4px 4px; - -moz-border-radius:4px 4px 4px 4px; -} -.ezUploaderEditorOutput{ } -.ezUploaderEditorDisplay{ - display:none; position:relative; - max-width:800px; max-height:600px; - overflow:auto; border:0; - background:#fff; padding:5px; margin:5px; -} - -/* Utils */ -.ezOpacity{ - filter:alpha(opacity=60); /* for IE */ - opacity:0.6; /* CSS3 standard */ -} -.alignLeft{ text-align:left; } -.alignCenter{ text-align:center; } -.alignRight{ text-align:right; } -.icnImg{ border:0; } \ No newline at end of file diff --git a/libs/ezEditTable/ezEditTable-uncompressed.js b/libs/ezEditTable/ezEditTable-uncompressed.js deleted file mode 100644 index ee66e659..00000000 --- a/libs/ezEditTable/ezEditTable-uncompressed.js +++ /dev/null @@ -1,2081 +0,0 @@ -/*------------------------------------------------------------------------ - - ezEditTable v2.3 (edittable.free.fr) - - Copyright (c) 2012 Max Guglielmi - - License required for use -------------------------------------------------------------------------*/ - -var EditTable = function(id){ -/*======================================================================== - - EditTable object constructor - - Params: - - id: table id (string) - - startRow (optional): start row index (number) - - config (optional): configuration object (literal object) -========================================================================*/ - if(arguments.length === 0){ return; } - this.id = id; - this.version = '2.3'; - this.table = this.Get(id); - this.tBody = this.table.tBodies[0]; - this.startRow = 0; - this.config = null; - this.nbCells = null; - if(!window['et_activeGrid']){ window.et_activeGrid = ''; }//global var for active grid in page - - if(this.table === null || this.table.nodeName.LCase() !== 'table'){ return; } - var tBodyRows = this.Tag(this.tBody, 'tr'); - if(tBodyRows.length > 0){ this.startRow = tBodyRows[0].rowIndex; } - - if(arguments.length > 1){ - for(var i=0; iwindow.parent["{1}"].SetUploadSuccess(true); window.parent["{1}"].SetUploadName("{0}");' + - 'window.parent["{1}"].ShowUpload();'; //js code invoked from server-side when file successfully uploaded - - //Uploader callbacks and delegates - this.showUpload[i] = upl.hasOwnProperty('show_upload') && this.IsFn(upl['show_upload']) ? upl['show_upload'] : null; //delegate function for showing uploaded file - this.onBeforeOpenUploader[i] = upl.hasOwnProperty('on_before_open') && this.IsFn(upl['on_before_open']) ? upl['on_before_open'] : null; - this.onAfterOpenUploader[i] = upl.hasOwnProperty('on_after_open') && this.IsFn(upl['on_after_open']) ? upl['on_after_open'] : null; - this.onBeforeCloseUploader[i] = upl.hasOwnProperty('on_before_close') && this.IsFn(upl['on_before_close']) ? upl['on_before_close'] : null; - this.onAfterCloseUploader[i] = upl.hasOwnProperty('on_after_close') && this.IsFn(upl['on_after_close']) ? upl['on_after_close'] : null; - break; - } - } - if(this.editorTypes.indexOf(this.edtTypes.command) != -1){ this.editorModel = 'row'; } - this.inputEditorCss = f.input_editor_css!==undefined ? f.input_editor_css : 'ezInputEditor'; //default css class applied to input editor - this.textareaEditorCss = f.textarea_editor_css!==undefined ? f.textarea_editor_css : 'ezTextareaEditor'; //default css class applied to textarea editor - this.selectEditorCss = f.select_editor_css!==undefined ? f.select_editor_css : 'ezSelectEditor'; //default css class applied to select editor - this.commandEditorCss = f.command_editor_css!==undefined ? f.command_editor_css : 'ezCommandEditor'; //default css class applied to command editor - this.modifiedCellCss = f.modified_cell_css!==undefined ? f.modified_cell_css : 'ezModifiedCell'; //default css class applied to modified cell - - //Command type editor config - this.cmdEnabledBtns = this.editorCmdBtns.hasOwnProperty('enable') ? this.editorCmdBtns.enable : ['update', 'insert', 'delete', 'submit', 'cancel']; //command buttons to be enabled - this.cmdUpdateBtn = this.editorCmdBtns.hasOwnProperty('update') ? this.editorCmdBtns.update : {}; //update command button - this.cmdInsertBtn = this.editorCmdBtns.hasOwnProperty('insert') ? this.editorCmdBtns.insert : {}; //insert command button - this.cmdDeleteBtn = this.editorCmdBtns.hasOwnProperty('delete') ? this.editorCmdBtns['delete'] : {}; //delete command button - this.cmdSubmitBtn = this.editorCmdBtns.hasOwnProperty('submit') ? this.editorCmdBtns['submit'] : {}; //submit command button - this.cmdCancelBtn = this.editorCmdBtns.hasOwnProperty('cancel') ? this.editorCmdBtns.cancel : {}; //cancel command button - - this.cmdUpdateBtnText = this.cmdUpdateBtn.hasOwnProperty('text') ? this.cmdUpdateBtn.text : ''; //Default text is empty because icon is set by default - this.cmdInsertBtnText = this.cmdInsertBtn.hasOwnProperty('text') ? this.cmdInsertBtn.text : ''; //Default text is empty because icon is set by default - this.cmdDeleteBtnText = this.cmdDeleteBtn.hasOwnProperty('text') ? this.cmdDeleteBtn.text : ''; //Default text is empty because icon is set by default - this.cmdSubmitBtnText = this.cmdSubmitBtn.hasOwnProperty('text') ? this.cmdSubmitBtn.text : 'Submit'; - this.cmdCancelBtnText = this.cmdCancelBtn.hasOwnProperty('text') ? this.cmdCancelBtn.text : 'Cancel'; - - this.cmdUpdateBtnTitle = this.cmdUpdateBtn.hasOwnProperty('title') ? this.cmdUpdateBtn.title : 'Edit record'; - this.cmdInsertBtnTitle = this.cmdInsertBtn.hasOwnProperty('title') ? this.cmdInsertBtn.title : 'Create record'; - this.cmdDeleteBtnTitle = this.cmdDeleteBtn.hasOwnProperty('title') ? this.cmdDeleteBtn.title : 'Delete record'; - this.cmdSubmitBtnTitle = this.cmdSubmitBtn.hasOwnProperty('title') ? this.cmdSubmitBtn.title : 'Submit record'; - this.cmdCancelBtnTitle = this.cmdCancelBtn.hasOwnProperty('title') ? this.cmdCancelBtn.title : 'Cancel'; - - this.cmdUpdateBtnIcon = this.cmdUpdateBtn.hasOwnProperty('icon') ? this.cmdUpdateBtn.icon : ''; - this.cmdInsertBtnIcon = this.cmdInsertBtn.hasOwnProperty('icon') ? this.cmdInsertBtn.icon : ''; - this.cmdDeleteBtnIcon = this.cmdDeleteBtn.hasOwnProperty('icon') ? this.cmdDeleteBtn.icon : ''; - this.cmdSubmitBtnIcon = this.cmdSubmitBtn.hasOwnProperty('icon') ? this.cmdSubmitBtn.icon : ''; - this.cmdCancelBtnIcon = this.cmdCancelBtn.hasOwnProperty('icon') ? this.cmdCancelBtn.icon : ''; - - this.cmdUpdateBtnCss = this.cmdUpdateBtn.hasOwnProperty('css') ? this.cmdUpdateBtn.css : null; - this.cmdInsertBtnCss = this.cmdInsertBtn.hasOwnProperty('css') ? this.cmdInsertBtn.css : null; - this.cmdDeleteBtnCss = this.cmdDeleteBtn.hasOwnProperty('css') ? this.cmdDeleteBtn.css : null; - this.cmdSubmitBtnCss = this.cmdSubmitBtn.hasOwnProperty('css') ? this.cmdSubmitBtn.css : null; - this.cmdCancelBtnCss = this.cmdCancelBtn.hasOwnProperty('css') ? this.cmdCancelBtn.css : null; - - this.cmdUpdateBtnStyle = this.cmdUpdateBtn.hasOwnProperty('style') ? this.cmdUpdateBtn.style : null; - this.cmdInsertBtnStyle = this.cmdInsertBtn.hasOwnProperty('style') ? this.cmdInsertBtn.style : null; - this.cmdDeleteBtnStyle = this.cmdDeleteBtn.hasOwnProperty('style') ? this.cmdDeleteBtn.style : null; - this.cmdSubmitBtnStyle = this.cmdSubmitBtn.hasOwnProperty('style') ? this.cmdSubmitBtn.style : null; - this.cmdCancelBtnStyle = this.cmdCancelBtn.hasOwnProperty('style') ? this.cmdCancelBtn.style : null; - - this.cmdInsertBtnScroll = this.cmdInsertBtn.hasOwnProperty('scrollIntoView') ? this.cmdInsertBtn.scrollIntoView : false; //scroll new added row into view - - //Editor callbacks, delegates - this.onEditableInit = this.IsFn(f.on_editable_initialized) ? f.on_editable_initialized : null; - this.onBeforeOpenEditor = this.IsFn(f.on_before_open_editor) ? f.on_before_open_editor : null; - this.onAfterOpenEditor = this.IsFn(f.on_after_open_editor) ? f.on_after_open_editor : null; - this.onBeforeCloseEditor = this.IsFn(f.on_before_close_editor) ? f.on_before_close_editor : null; - this.onAfterCloseEditor = this.IsFn(f.on_after_close_editor) ? f.on_after_close_editor : null; - this.setCustomEditorValue = this.IsFn(f.set_custom_editor_value) ? f.set_custom_editor_value : null; - this.getCustomEditorValue = this.IsFn(f.get_custom_editor_value) ? f.get_custom_editor_value : null; - this.setCellModifiedValue = this.IsFn(f.set_cell_modified_value) ? f.set_cell_modified_value : null; - this.validateModifiedValue = this.IsFn(f.validate_modified_value) ? f.validate_modified_value : null; - this.openCustomEditor = this.IsFn(f.open_custom_editor) ? f.open_custom_editor : null; - this.closeCustomEditor = this.IsFn(f.close_custom_editor) ? f.close_custom_editor : null; - this.onAddedDomRow = this.IsFn(f.on_added_dom_row) ? f.on_added_dom_row : null; - - //Server actions config - this.actions = this.IsObj(f.actions) ? f.actions : {}; - this.updateConfig = this.actions['update']!==undefined ? this.actions['update'] : {}; - this.insertConfig = this.actions['insert']!==undefined ? this.actions['insert'] : {}; - this.deleteConfig = this.actions['delete']!==undefined ? this.actions['delete'] : {}; - this.updateURI = this.updateConfig.hasOwnProperty('uri') ? this.updateConfig['uri'] : null; - this.insertURI = this.insertConfig.hasOwnProperty('uri') ? this.insertConfig['uri'] : null; - this.deleteURI = this.deleteConfig.hasOwnProperty('uri') ? this.deleteConfig['uri'] : null; - this.updateFormMethod = this.updateConfig.hasOwnProperty('form_method') ? this.updateConfig['form_method'].LCase() : 'post'; - this.insertFormMethod = this.insertConfig.hasOwnProperty('form_method') ? this.insertConfig['form_method'].LCase() : 'post'; - this.deleteFormMethod = this.deleteConfig.hasOwnProperty('form_method') ? this.deleteConfig['form_method'].LCase() : 'post'; - this.updateSubmitMethod = this.updateConfig.hasOwnProperty('submit_method') ? this.updateConfig['submit_method'].LCase() : this.ajax ? 'ajax': 'form'; - this.insertSubmitMethod = this.insertConfig.hasOwnProperty('submit_method') ? this.insertConfig['submit_method'].LCase() : this.ajax ? 'ajax': 'form'; - this.deleteSubmitMethod = this.deleteConfig.hasOwnProperty('submit_method') ? this.deleteConfig['submit_method'].LCase() : this.ajax ? 'ajax': 'form'; - this.bulkDelete = this.deleteConfig.hasOwnProperty('bulk_delete') ? this.deleteConfig['bulk_delete'] : false; //enables delete of selected rows - this.defaultRecord = this.insertConfig.hasOwnProperty('default_record') - && this.IsArray(this.insertConfig['default_record']) ? this.insertConfig['default_record'] : null; - this.updateParams = this.updateConfig.hasOwnProperty('param_names') - && this.IsArray(this.updateConfig['param_names']) ? this.updateConfig['param_names'] : null; - this.insertParams = this.insertConfig.hasOwnProperty('param_names') - && this.IsArray(this.insertConfig['param_names']) ? this.insertConfig['param_names'] : null; - this.deleteParams = this.deleteConfig.hasOwnProperty('param_names') - && this.IsArray(this.deleteConfig['param_names']) ? this.deleteConfig['param_names'] : null; - - //Server actions delegates and callbacks - this.onUpdateSubmit = this.updateConfig.hasOwnProperty('on_update_submit') - && this.IsFn(this.updateConfig['on_update_submit']) ? this.updateConfig['on_update_submit'] : null; - this.onInsertSubmit = this.insertConfig.hasOwnProperty('on_insert_submit') - && this.IsFn(this.insertConfig['on_insert_submit']) ? this.insertConfig['on_insert_submit'] : null; - this.onDeleteSubmit = this.deleteConfig.hasOwnProperty('on_delete_submit') - && this.IsFn(this.deleteConfig['on_delete_submit']) ? this.deleteConfig['on_delete_submit'] : null; - this.onBeforeUpdateSubmit = this.updateConfig.hasOwnProperty('on_before_submit') - && this.IsFn(this.updateConfig['on_before_submit']) ? this.updateConfig['on_before_submit'] : null; - this.onBeforeInsertSubmit = this.insertConfig.hasOwnProperty('on_before_submit') - && this.IsFn(this.insertConfig['on_before_submit']) ? this.insertConfig['on_before_submit'] : null; - this.onBeforeDeleteSubmit = this.deleteConfig.hasOwnProperty('on_before_submit') - && this.IsFn(this.deleteConfig['on_before_submit']) ? this.deleteConfig['on_before_submit'] : null; - this.onAfterUpdateSubmit = this.updateConfig.hasOwnProperty('on_after_submit') - && this.IsFn(this.updateConfig['on_after_submit']) ? this.updateConfig['on_after_submit'] : null; - this.onAfterInsertSubmit = this.insertConfig.hasOwnProperty('on_after_submit') - && this.IsFn(this.insertConfig['on_after_submit']) ? this.insertConfig['on_after_submit'] : null; - this.onAfterDeleteSubmit = this.deleteConfig.hasOwnProperty('on_after_submit') - && this.IsFn(this.deleteConfig['on_after_submit']) ? this.deleteConfig['on_after_submit'] : null; - this.onUpdateError = this.updateConfig.hasOwnProperty('on_submit_error') - && this.IsFn(this.updateConfig['on_submit_error']) ? this.updateConfig['on_submit_error'] : null; - this.onInsertError = this.insertConfig.hasOwnProperty('on_submit_error') - && this.IsFn(this.insertConfig['on_submit_error']) ? this.insertConfig['on_submit_error'] : null; - this.onDeleteError = this.deleteConfig.hasOwnProperty('on_submit_error') - && this.IsFn(this.deleteConfig['on_submit_error']) ? this.deleteConfig['on_submit_error'] : null; - this.checkUpdateResponseSanity = this.updateConfig.hasOwnProperty('check_response_sanity') - && this.IsFn(this.updateConfig['check_response_sanity']) ? this.updateConfig['check_response_sanity'] : null; - this.checkInsertResponseSanity = this.insertConfig.hasOwnProperty('check_response_sanity') - && this.IsFn(this.insertConfig['check_response_sanity']) ? this.insertConfig['check_response_sanity'] : null; - this.checkDeleteResponseSanity = this.deleteConfig.hasOwnProperty('check_response_sanity') - && this.IsFn(this.deleteConfig['check_response_sanity']) ? this.deleteConfig['check_response_sanity'] : null; - this.processUpdateResponse = this.updateConfig.hasOwnProperty('process_response') - && this.IsFn(this.updateConfig['process_response']) ? this.updateConfig['process_response'] : null; - this.processInsertResponse = this.insertConfig.hasOwnProperty('process_response') - && this.IsFn(this.insertConfig['process_response']) ? this.insertConfig['process_response'] : null; - this.processDeleteResponse = this.deleteConfig.hasOwnProperty('process_response') - && this.IsFn(this.deleteConfig['process_response']) ? this.deleteConfig['process_response'] : null; - - //Messages - this.msgSubmitOK = f.msg_submit_ok!==undefined ? f.msg_submit_ok : 'Changes were successfully submitted to server!'; - this.msgConfirmDelSelectedRows = f.msg_confirm_delete_selected_rows!==undefined ? f.msg_confirm_delete_selected_rows : 'Do you want to delete the selected row(s)?'; - this.msgErrOccur = f.msg_error_occured!==undefined ? f.msg_error_occured : 'An error occured!'; - this.msgSaveUnsuccess = f.msg_submit_unsuccessful!==undefined ? f.msg_submit_unsuccessful : 'Changes could not be saved!'; - this.msgUndefinedSubmitUrl = f.undefined_submit_url!==undefined ? f.undefined_submit_url : 'Changes could not be saved! Endpoint URL is not defined'; - this.msgNewRowNoUploader = f.msg_new_row_no_uploader!==undefined ? f.msg_new_row_no_uploader : 'Please save the newly added rows before using the Uploader.'; - this.msgInvalidData = f.msg_invalid_data!==undefined ? f.msg_invalid_data : 'Returned data is invalid.'; - - //Containers - this.ifrmContainer = {}; //submit forms container - - //Values - this.valuesSeparator = ', '; - this.defaultRecordUndefinedValue = '...'; - this.newRowClass = 'ezNewRow'; - this.recordKeyValue = 'new'; - - //Attributes - this.attrValue = 'data-ez-slc-value'; - this.attrText = 'data-ez-slc-text'; - this.attrCont = 'data-ez-html'; - this.attrData = 'data-ez-data'; - this.attrUplname = 'data-ez-uplname'; - this.attrColIndex = 'data-ez-col-index'; - this.attrRowIndex = 'data-ez-row-index'; - - //Counters - this.savedRowsNb = { 'insert': 0, 'update': 0, 'delete': 0 }; - - //prefixes - this.prfxEdt = 'edt_'; - this.prfxIFrm = 'iframe_'; - this.prfxFrm = 'form_'; - this.prfxScr = 'scr_'; - this.prfxParam = 'col_'; - //upload editor - this.prfxUplCont = 'upl_'; - this.prfxUplForm = 'upl_form_'; - this.prfxUplIframe = 'upl_ifrm_'; - this.prfxUplInfo = 'upl_info_'; - this.prfxUplOutput = 'upl_output_'; - this.prfxUplBtn = 'upl_btn_'; - this.prfxUplBtnClose = 'upl_btn_close_'; - this.prfxUplImgDisplay = 'upl_img_display_'; - this.prfxUplWinRef = 'et_upl_'; - - //Upload form - this.uplFileInp = 'UPL_FILE'; - this.uplKeyInput = 'RECORD_KEY'; - this.uplFldPath = 'IMAGES_FOLDER_PATH'; - this.uplSqlFieldName = 'SQL_FIELD'; - this.uplFileSize = 'MAX_FILE_SIZE'; - this.uplValidExts = 'VALID_EXTENSIONS'; - this.uplJsCode = 'JS_CODE'; - - this.Editable = new Editable(this); - this.Selection = new Selection(this); -}; - -var Editable = function(editTable){ - this.o = editTable; -}; - -var Selection = function(editTable){ - this.o = editTable; -}; - -var Uploader = function(editTable, colIndex){ - this.o = editTable; - this.colIndex = colIndex; - window[this.o.prfxUplWinRef + colIndex + this.o.id] = this; //global reference for server-side purposes -}; - -Uploader.prototype = { - divUpl: null, formUpl: null, fileUpl: null, hiddenFileSize: null, hiddenFolderPath: null, hiddenValidExt: null, hiddenKey: null, - ifrmUpl: null, divUplInfo: null, divUplOutput: null, divUplBtnsCont: null, divUplBtn: null, divUplBtnClose: null, divUplDisplay: null, - initialValue: null, isUploadSuccessful: false, - Init: function(){ - if(!this.o.hasUploader){ return; } - this.SetUploader(); - }, - SetUploader: function(){ - this.divUpl = this.o.CreateElm('div', - ['id', this.o.prfxUplCont + this.colIndex + this.o.id], ['style', 'display:none; z-index:10001;'], ['class', this.o.uplCss[this.colIndex]] - ); - this.formUpl = this.o.CreateElm('form', - ['id', this.o.prfxUplForm + this.colIndex + this.o.id], ['name', this.o.prfxUplForm + this.colIndex + this.o.id], ['method', 'POST'], - ['action', this.o.uplURI[this.colIndex]], ['target', this.o.prfxUplIframe + this.colIndex + this.o.id], ['enctype', 'multipart/form-data'] - ); - this.fileUpl = this.o.CreateElm('input',['id', this.o.uplFileInp], ['name', this.o.uplFileInp], ['type', 'file']); - this.hiddenFileSize = this.o.CreateElm('input', ['name', this.o.uplFileSize], ['type', 'hidden'], ['value', this.o.uplMaxFileSize[this.colIndex]]); //server-side info: max file size - this.hiddenFolderPath = this.o.CreateElm('input', ['name', this.o.uplFldPath], ['type', 'hidden'], ['value', this.o.uplPath[this.colIndex]]); //server-side info: images folder path - this.hiddenValidExt = this.o.CreateElm('input', ['name', this.o.uplValidExts], ['type', 'hidden'], ['value', this.o.uplValidExt[this.colIndex]]); //server-side info: allowed file extensions - this.hiddenKey = this.o.CreateElm('input', ['name', this.o.uplKeyInput], ['type', 'hidden'], ['value', this.o.recordKeyValue]); //server-side info: record key - this.hiddenSqlField = this.o.CreateElm('input', ['name', this.o.uplSqlFieldName], ['type', 'hidden'], ['value', this.o.uplSqlField[this.colIndex]]); //server-side info: SQL field name storing upload filename - this.hiddenUplWinRef = this.o.CreateElm('input', ['name', this.o.uplJsCode], ['type', 'hidden'], ['value', this.o.uplJsSuccess[this.colIndex]]); //server-side info: js code invoked from server when upload successful - this.ifrmUpl = this.o.CreateElm('iframe', ['id', this.o.prfxUplIframe + this.colIndex + this.o.id], ['name', this.o.prfxUplIframe + this.colIndex + this.o.id], ['style', 'display:none; left:-10001;']); - this.divUplInfo = this.o.CreateElm('div',['id', this.o.prfxUplInfo + this.colIndex + this.o.id]); - this.divUplOutput = this.o.CreateElm('div',['id', this.o.prfxUplOutput + this.colIndex + this.o.id], ['class', this.o.uplOutputCss[this.colIndex]]); - this.divUplBtnsCont = this.o.CreateElm('div',['style', 'text-align:right']); - this.divUplBtn = this.o.CreateElm('button',['id', this.o.prfxUplBtn + this.colIndex + this.o.id], ['style', 'display:none;']); - this.divUplBtnClose = this.o.CreateElm('button',['id', this.o.prfxUplBtnClose + this.colIndex + this.o.id]); - this.divUplDisplay = this.o.CreateElm('div',['id', this.o.prfxUplImgDisplay + this.colIndex + this.o.id], ['class', this.o.uplDisplayCss[this.colIndex]]); - - //IE<8 class, name, style attributes are not set correctly... - if(!this.o.Css.Has(this.divUpl, this.o.uplCss[this.colIndex])){ - this.o.Css.Add(this.divUpl, this.o.uplCss[this.colIndex]); - this.o.Css.Add(this.divUplOutput, this.o.uplOutputCss[this.colIndex]); - this.o.Css.Add(this.divUplDisplay, this.o.uplDisplayCss[this.colIndex]); - this.divUpl.style.cssText = 'display:none; z-index:10001;'; - this.divUplBtnsCont.style.cssText = 'text-align:right'; - this.divUplBtn.style.cssText = 'display:none;'; - this.formUpl = document.createElement( - '
' - ); - this.ifrmUpl = document.createElement( - '' - ); - } - - this.divUplInfo.innerHTML = parseInt(this.o.uplMaxFileSize[this.colIndex]/1024, 10) + 'Kb max (' + this.o.uplValidExt[this.colIndex].toString() + ')'; - this.divUplBtn.appendChild(this.o.CreateText('Upload')); - this.divUplBtnClose.appendChild(this.o.CreateText('Close')); - this.divUplBtnsCont.appendChild(this.divUplBtn); - this.divUplBtnsCont.appendChild(this.divUplBtnClose); - - this.formUpl.appendChild(this.fileUpl); - this.formUpl.appendChild(this.hiddenFileSize); - this.formUpl.appendChild(this.hiddenFolderPath); - this.formUpl.appendChild(this.hiddenUplWinRef); - this.formUpl.appendChild(this.hiddenValidExt); - this.formUpl.appendChild(this.hiddenKey); - this.formUpl.appendChild(this.hiddenSqlField); - - this.divUpl.appendChild(this.formUpl); - this.divUpl.appendChild(this.ifrmUpl); - this.divUpl.appendChild(this.divUplInfo); - this.divUpl.appendChild(this.divUplOutput); - this.divUpl.appendChild(this.divUplBtnsCont); - this.divUpl.appendChild(this.divUplDisplay); - this.o.table.parentNode.insertBefore(this.divUpl, this.o.table); - - //Events - var x = this; - this.ifrmUpl.onload = this.ifrmUpl.onreadystatechange = function(){ //Iframe onload event - if(!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete'){ - try{ - var iframeDoc = this.contentDocument || this.contentWindow.document; - if(iframeDoc.location.href != 'about:blank'){ - x.Output(iframeDoc.body.innerHTML); - x.iframe.src = 'about:blank'; - x.HideUploadButton(); - } - } catch(ex){} - } - }; - - this.o.Event.Add(this.fileUpl, 'click', function(e){ x.OnUplClick(); }); - this.o.Event.Add(this.divUplBtn, 'click', function(e){ x.Upload(); }); - this.o.Event.Add(this.divUplBtnClose, 'click', function(e){ x.Close(x.o.Selection.GetActiveRow().cells[x.colIndex]); }); - - //Js code passed to server - var js = this.o.uplJsSuccess[this.colIndex].replace(/\{1\}/g, this.o.prfxUplWinRef + this.colIndex + this.o.id); - this.hiddenUplWinRef.value = js; - }, - GetValue: function(){ return this.fileUpl.value; }, - HasValueChanged: function(){ return this.initialValue != this.GetValue(); }, - OnUplClick: function(){ this.ShowUploadButton(); }, - Upload: function(){ this.ShowLoader(); this.formUpl.submit(); }, - SetRecordKey: function(key){ this.hiddenKey.value = key; }, - GetRecordKey: function(){ return this.hiddenKey.value; }, - ShowUploadButton: function(){ this.divUplBtn.style.display = 'inline'; }, - HideUploadButton: function(){ this.divUplBtn.style.display = 'none'; }, - ShowUploadContainer: function(){ this.divUplDisplay.style.display = 'block'; }, - HideUploadContainer: function(){ this.divUplDisplay.style.display = 'none'; }, - ShowUpload: function(){ - if(!this.o.uplShowUpload[this.colIndex]){ return; } - var row = this.o.Selection.GetActiveRow(); - if(this.o.showUpload[this.colIndex]){ - this.ShowUploadContainer(); - this.o.showUpload[this.colIndex].call(this, this.o, this.divUplDisplay, this.GetUploadName(), this.o.uplPath[this.colIndex]); - return; - } - if(row){ - var uplname = this.GetUploadName(); - if(uplname){ - if(this.o.uplShowLink[this.colIndex]){ - this.divUplDisplay.innerHTML = this.GetUploadLinkHtml(); - } else { - this.divUplDisplay.innerHTML = ''+uplname+''; - } - this.ShowUploadContainer(); - this.divUpl.scrollIntoView(false); - } else { this.ClearUpload(); } - } - }, - ClearUpload: function(){ - this.divUplDisplay.innerHTML = ''; - this.HideUploadContainer(); - }, - GetUploadName: function(){ - var cell = this.o.Selection.GetActiveRow().cells[this.colIndex]; - if(cell){ return cell.getAttribute(this.o.attrUplname); } - return null; - }, - SetUploadName: function(name){ - var cell = this.o.Selection.GetActiveRow().cells[this.colIndex]; - if(cell){ cell.setAttribute(this.o.attrUplname, name); } - }, - GetUploadLinkHtml: function(){ - var uplname = this.GetUploadName(); - return ''+ - uplname.replace(this.GetRecordKey()+'_', '') + ''; - }, - Open: function(cell){ - if(!cell){ return; } - if(this.o.Css.Has(cell.parentNode, this.o.newRowClass) || !cell.parentNode.getAttribute('id')){ alert(this.o.msgNewRowNoUploader); return; } - cell.appendChild(this.divUpl); - if(this.o.onBeforeOpenUploader[this.colIndex]){ - this.o.onBeforeOpenUploader[this.colIndex].call(this, this.o, this.divUpl, cell); - } - var key = this.o.uplRecordIdColIndex[this.colIndex] - ? this.o.Selection.GetActiveRow()[this.o.uplRecordIdColIndex[this.colIndex]] - : this.o.Selection.GetActiveRow().getAttribute('id').replace(this.o.newRowPrefix, ''); - if(key !== ''){ - this.divUpl.style.display = ''; - this.SetRecordKey(key); - this.initialValue = this.GetValue(); - this.SetUploadSuccess(false); - this.ShowUpload(); - } - if(this.o.onAfterOpenUploader[this.colIndex]){ - this.o.onAfterOpenUploader[this.colIndex].call(this, this.o, this.divUpl, cell); - } - }, - Close: function(cell){ - if(this.divUpl.style.display == 'none'){ return; } - if(this.o.onBeforeCloseUploader[this.colIndex]){ - this.o.onBeforeCloseUploader[this.colIndex].call(this, this.o, this.divUpl, cell); - } - if(cell && this.IsUploadSuccessful()){ - if(this.o.uplShowLink[this.colIndex]){ - var div = this.o.CreateElm('div'); - div.innerHTML = this.divUplDisplay.innerHTML; - cell.appendChild(div); - } else { - var img = this.o.Tag(cell, 'img')[0]; - if(img){ img.src = this.o.uplOkImg[this.colIndex]; } - } - } - this.Output(''); - this.SetRecordKey(''); - this.ClearUpload(); - this.HideUploadButton(); - this.divUpl.style.display = 'none'; - this.o.StandardBody().appendChild(this.divUpl); - if(this.o.onAfterCloseUploader[this.colIndex]){ - this.o.onAfterCloseUploader[this.colIndex].call(this, this.o, this.divUpl, cell); - } - }, - Output: function(msg){ this.divUplOutput.innerHTML = msg; }, - SetUploadSuccess: function(val){ this.isUploadSuccessful = val; }, - IsUploadSuccessful: function(val){ return this.isUploadSuccessful; }, - ShowLoader: function(){ this.Output('Please wait...'); }, - HideLoader: function(){ this.Output(''); } -}; - -Editable.prototype = { - onEditAdded: false, activeCellEditor: null, openCellEditor: null, activeRow: null, - modifiedRows: [], newRows: [], addedRows: [], deletedRows: [], - Init: function(){ - if(!this.o.editable){ return; } - this.SetEvents(); - this.SetCellsEditor(); - if(this.o.onEditableInit){ this.o.onEditableInit.call(null, this.o); } - }, - Set: function(){ this.o.editable = true; this.SetEvents(); }, - Remove: function(){ this.o.editable = false; this.RemoveEvents(); }, - SetEvents: function(){ - if(!this.onEditAdded){ - var x = this; - this.o.Event.Bind(this.o.table, this.o.openEditorAction, function(e){ x.Edit.call(x, e); }); - this.onEditAdded = true; - } - }, - RemoveEvents: function(){ - if(this.onEditAdded){ - var x = this; - this.o.Event.Unbind(this.o.table, this.o.openEditorAction, function(e){ x.Edit.call(x, e); }); - this.onEditAdded = false; - } - }, - SetCellsEditor: function(){ - for (var i = 0; i < this.o.nbCells; i++){ - if(this.o.editorTypes.length == this.o.nbCells){ - switch (this.o.editorTypes[i]){ - case this.o.edtTypes.none: - this.o.editors[i] = null; - break; - case this.o.edtTypes.input: - this.o.editors[i] = this.CreateInputEditor(i); - break; - case this.o.edtTypes.textarea: - this.o.editors[i] = this.CreateMultilineEditor(i); - break; - case this.o.edtTypes.select: - case this.o.edtTypes.multiple: - this.o.editors[i] = this.CreateSelectEditor(i); - break; - case this.o.edtTypes.bool: - this.o.editors[i] = {}; - break; - case this.o.edtTypes.uploader: - this.o.editors[i] = this.CreateUploaderEditor(i); - break; - case this.o.edtTypes.command: - this.SetCommandEditor(i); - this.o.editors[i] = null; - break; - case this.o.edtTypes.custom: - this.o.editors[i] = this.o.Get(this.o.customEditor[i]); - break; - default: - this.o.editors[i] = null; - break; - } - } else { - //If editor type not set, default type is input - this.o.editorTypes[i] = this.o.edtTypes.input; - this.o.editors[i] = this.CreateInputEditor(i); - } - } - }, - CreateInputEditor: function(colIndex){ - if(colIndex === undefined) return null; - var inp = this.o.CreateElm(this.o.edtTypes.input, ['id', this.o.prfxEdt + colIndex + '_' + this.o.id], ['type', 'text'], - ['class', this.o.inputEditorCss], [this.o.attrColIndex, colIndex]); - var attr = this.o.editorAttributes[colIndex]; - if(attr) for (var i = 0; i < attr.length; i++){ inp.setAttribute(attr[i][0], attr[i][1]); } //additional attributes - if(inp.className === '') inp.className = this.o.inputEditorCss; //for older IE versions... - if(this.o.editorCss[colIndex]) this.o.Css.Add(inp, this.o.editorCss[colIndex]); //additional css - if(this.o.editorStyles[colIndex]) inp.style.cssText = this.o.editorStyles[colIndex]; //inline style - var x = this; - this.o.Event.Add(inp, 'focus', function(e){ x.Event.OnInputFocus.call(x, e); }); - this.o.Event.Add(inp, 'blur', function(e){ x.Event.OnBlur.call(x, e); }); - return inp; - }, - CreateMultilineEditor: function(colIndex){ - if(colIndex === undefined) return null; - var txa = this.o.CreateElm(this.o.edtTypes.textarea, ['id', this.o.prfxEdt + colIndex + '_' + this.o.id], - ['class', this.o.textareaEditorCss], [this.o.attrColIndex, colIndex]); - var attr = this.o.editorAttributes[colIndex]; - if(attr) for (var i = 0; i < attr.length; i++){ txa.setAttribute(attr[i][0], attr[i][1]); } //additional attributes - if(txa.className === '') txa.className = this.o.textareaEditorCss; //for older IE versions... - if(this.o.editorCss[colIndex]) this.o.Css.Add(txa, this.o.editorCss[colIndex]); //additional css - if(this.o.editorStyles[colIndex]) txa.style.cssText = this.o.editorStyles[colIndex]; //inline style - var x = this; - this.o.Event.Add(txa, 'focus', function(e){ x.Event.OnInputFocus.call(x, e); }); - this.o.Event.Add(txa, 'blur', function(e){ x.Event.OnBlur.call(x, e); }); - this.o.Event.Add(txa, 'keypress', function(e){ x.Event.OnKeyPress.call(x, e); }); - return txa; - }, - CreateSelectEditor: function(colIndex){ - if(colIndex === undefined) return null; - var slc = this.o.CreateElm(this.o.edtTypes.select, ['id', this.o.prfxEdt + colIndex + '_' + this.o.id], - ['class', this.o.selectEditorCss], [this.o.attrColIndex, colIndex]); - if(this.o.IsEditorType(colIndex, this.o.edtTypes.multiple)){ slc.setAttribute('multiple', 'multiple'); } - var attr = this.o.editorAttributes[colIndex]; - if(attr) for (var i = 0; i < attr.length; i++){ slc.setAttribute(attr[i][0], attr[i][1]); } //additional attributes - if(slc.className === '') slc.className = this.o.selectEditorCss; //for older IE versions... - if(this.o.editorCss[colIndex]) this.o.Css.Add(slc, this.o.editorCss[colIndex]); //additional css - if(this.o.editorStyles[colIndex]) slc.style.cssText = this.o.editorStyles[colIndex]; //inline style - var optArray = [], valArray = []; //options arrays - if(this.o.editorCustomSlcOptions[colIndex]){//custom values - for (var i = 0; i < this.o.editorCustomSlcOptions[colIndex].length; i++){ - var data = this.o.editorCustomSlcOptions[colIndex][i]; - if(this.o.editorCustomSlcValues[colIndex]){ - var val = this.o.editorCustomSlcValues[colIndex][i]; - if(valArray.indexOf(val) == -1) valArray.push(val); - } - if(optArray.indexOf(data) == -1) optArray.push(data); - } - } else {//automatic column values - for (var i = this.o.startRow; i < this.o.GetRowsNb(); i++){ - var row = this.o.table.rows[i]; - var cell = row.cells[colIndex]; - if(!row || !cell) continue; - var data = this.o.GetText(cell); - if(optArray.indexOf(data) == -1) optArray.push(data); - } - } - if(this.o.editorSortSlcOptions[colIndex]){ - var sortType = this.o.editorSortSlcOptions[colIndex].LCase(); - if(sortType == 'numdesc'){ - try { optArray.sort(this.o.Sort.NumDesc); } catch (e){ } - } else if(sortType == 'numasc'){ - try { optArray.sort(this.o.Sort.NumAsc); } catch (e){ } - } else { - try { optArray.sort(this.o.Sort.IgnoreCase); } catch (e){ } - } - } - for (var j = 0; j < optArray.length; j++){ - var opt = this.o.CreateElm('option', ['value', valArray[j] || optArray[j]]); - opt.appendChild(this.o.CreateText(optArray[j])); - slc.appendChild(opt); - } - var x = this; - this.o.Event.Add(slc, 'change', function(e){ - var cell = x.o.GetCell(e); - if(cell){ - cell.setAttribute(x.o.attrText, slc.options[slc.selectedIndex].text); //for inserts - cell.setAttribute(x.o.attrValue, slc.options[slc.selectedIndex].value); //for inserts - slc.setAttribute(x.o.attrText, slc.options[slc.selectedIndex].text); - slc.setAttribute(x.o.attrValue, slc.options[slc.selectedIndex].value); - } - }); - this.o.Event.Add(slc, 'blur', function(e){ x.Event.OnBlur.call(x, e); }); - this.o.Event.Add(slc, 'keypress', function(e){ x.Event.OnKeyPress.call(x, e); }); - return slc; - }, - SetCommandEditor: function(colIndex){ - if(colIndex === undefined || !this.o.IsEditorType(colIndex, this.o.edtTypes.command)){ return; } - this.edtBtns = []; this.addBtns = []; this.delBtns = []; this.submitBtns = []; this.cancelBtns = []; - var x = this.o.Editable, - o = this.o; - for (var i = this.o.startRow; i < this.o.GetRowsNb(); i++){ - var row = this.o.table.rows[i]; - var cell = row.cells[colIndex]; - if(!row || !cell) continue; - - var div = this.o.CreateElm('div', ['class', this.o.commandEditorCss]); - if(this.o.cmdEnabledBtns.indexOf('update') != -1){ - var editBtn = this.o.CreateElm('button', ['id', 'editBtn_' + i + '_' + this.o.id], ['title', this.o.cmdUpdateBtnTitle], - ['css', this.o.cmdUpdateBtnCss], [this.o.attrColIndex, i]); - if(this.o.cmdUpdateBtnStyle) editBtn.style.cssText = this.o.cmdUpdateBtnStyle; //inline style - editBtn.innerHTML = this.o.cmdUpdateBtnIcon + this.o.cmdUpdateBtnText; - div.appendChild(editBtn); - this.o.Event.Add(editBtn, 'click', function(e){ x.Edit.call(x, e); }); - if(this.edtBtns.indexOf(editBtn) == -1) this.edtBtns[i] = editBtn; - } - if(this.o.cmdEnabledBtns.indexOf('insert') != -1){ - var createBtn = this.o.CreateElm('button', ['id', 'createBtn_' + i + '_' + this.o.id], ['title', this.o.cmdInsertBtnTitle], - ['css', this.o.cmdInsertBtnCss], [this.o.attrColIndex, i]); - if(this.o.cmdInsertBtnStyle) createBtn.style.cssText = this.o.cmdInsertBtnStyle; //inline style - createBtn.innerHTML = this.o.cmdInsertBtnIcon + this.o.cmdInsertBtnText; - div.appendChild(createBtn); - this.o.Event.Add(createBtn, 'click', function(e){ x.AddNewRow(); x.SetCommandEditor(x.o.editorCmdColIndex); }); - if(this.addBtns.indexOf(createBtn) == -1) this.addBtns[i] = createBtn; - } - if(this.o.cmdEnabledBtns.indexOf('delete') != -1){ - var delBtn = this.o.CreateElm('button', ['id', 'delBtn_' + i + '_' + this.o.id], ['title', this.o.cmdDeleteBtnTitle], - ['css', this.o.cmdDeleteBtnCss], [this.o.attrColIndex, i]); - if(this.o.cmdDeleteBtnStyle) delBtn.style.cssText = this.o.cmdDeleteBtnStyle; //inline style - delBtn.innerHTML = this.o.cmdDeleteBtnIcon + this.o.cmdDeleteBtnText; - div.appendChild(delBtn); - this.o.Event.Add(delBtn, 'click', function(e){ x.SubmitDeletedRows(); }); - if(this.delBtns.indexOf(delBtn) == -1) this.delBtns[i] = delBtn; - } - if(this.o.cmdEnabledBtns.indexOf('submit') != -1){ - var postBtn = this.o.CreateElm('button', ['id', 'postBtn_' + i + '_' + this.o.id], ['title', this.o.cmdSubmitBtnTitle], - ['style', 'display:none;'], ['css', this.o.cmdSubmitBtnCss], [this.o.attrColIndex, i]); - postBtn.style.display = 'none'; //older versions of IE - if(this.o.cmdSubmitBtnStyle) postBtn.style.cssText += this.o.cmdSubmitBtnStyle; //inline style - postBtn.innerHTML = this.o.cmdSubmitBtnIcon + this.o.cmdSubmitBtnText; - div.appendChild(postBtn); - this.o.Event.Add(postBtn, 'click', function(e){ - o.Event.Stop(e); - x.CloseRowEditor(); - x.SubmitAll(); - }); - if(this.submitBtns.indexOf(postBtn) == -1) this.submitBtns[i] = postBtn; - } - if(this.o.cmdEnabledBtns.indexOf('cancel') != -1){ - var cancelBtn = this.o.CreateElm('button', ['id', 'cancelBtn_' + i + '_' + this.o.id], ['title', this.o.cmdCancelBtnTitle], - ['style', 'display:none;'], ['css', this.o.cmdCancelBtnCss], [this.o.attrColIndex, i]); - cancelBtn.style.display = 'none'; //older versions of IE - if(this.o.cmdCancelBtnStyle) cancelBtn.style.cssText += this.o.cmdCancelBtnStyle; //inline style - cancelBtn.innerHTML = this.o.cmdCancelBtnIcon + this.o.cmdCancelBtnText; - div.appendChild(cancelBtn); - this.o.Event.Add(cancelBtn, 'click', function(e){ o.Event.Stop(e); x.CloseRowEditor(); }); - if(this.cancelBtns.indexOf(cancelBtn) == -1) this.cancelBtns[i] = cancelBtn; - } - cell.innerHTML = ''; - cell.appendChild(div); - } - }, - CreateUploaderEditor: function(colIndex){ - var uploader = new Uploader(this.o, colIndex); - uploader.Init(); - return uploader; - }, - OpenCellEditor: function(cell){ - if(!cell){ return; } - var cellIndex = cell.cellIndex; - var editor = this.o.editors[cellIndex]; - if(this.o.onBeforeOpenEditor){ this.o.onBeforeOpenEditor.call(null, this.o, cell, editor); } - this.activeCellEditor = cell; - this.openCellEditor = cellIndex; - if(!this.o.IsEditorType(cellIndex, this.o.edtTypes.uploader)){ - var data = this.o.GetText(cell); - this.SetCellCache(cell, data); - this.SetEditorValue(cellIndex, data); - if(!this.o.IsEditorType(cellIndex, this.o.edtTypes.custom)){ - cell.innerHTML = ''; - cell.appendChild(editor); - if(this.o.editorModel == 'cell'){ this.SetEditorFocus(cellIndex); } - } else { - if(this.o.openCustomEditor){ this.o.openCustomEditor.call(null, this.o, cell, editor); } - } - } else { editor.Open(cell); } - if(this.o.onAfterOpenEditor){ this.o.onAfterOpenEditor.call(null, this.o, cell, editor); } - }, - OpenRowEditor: function(row){ - if(!row) return; - this.activeRow = row; - for (var i = 0; i < this.o.nbCells; i++){ - if(!this.o.editors[i] || this.o.IsEditorType(i, this.o.edtTypes.bool) - || this.o.IsEditorType(i, this.o.edtTypes.command)){ continue; } - var c = row.cells[i]; - this.OpenCellEditor(c); - if(this.o.Selection.activeCell && this.o.Selection.activeCell.cellIndex === i){ - this.SetEditorFocus(i); - } - } - this.ShowCommandBtns(row.rowIndex, false); - }, - CloseRowEditor: function(){ - if(!this.activeRow) return; - var row = this.activeRow; - for (var i = 0; i < this.o.nbCells; i++){ - if(!this.o.editors[i] || this.o.IsEditorType(i, this.o.edtTypes.bool)) continue; - this.activeCellEditor = row.cells[i]; - this.CloseCellEditor(i); - } - this.ShowCommandBtns(row.rowIndex, true); - if(this.o.autoSave){ this.AutoSubmit(); } - this.activeRow = null; - }, - ShowCommandBtns: function(rowIndex, showIcons){ - if(rowIndex === undefined || showIcons === undefined || this.o.editorModel != 'row') return; - if(!this.edtBtns || !this.addBtns || !this.delBtns || !this.submitBtns || !this.cancelBtns) return; - if(showIcons){ - if(this.edtBtns[rowIndex]) this.edtBtns[rowIndex].style.display = 'inline'; - if(this.addBtns[rowIndex]) this.addBtns[rowIndex].style.display = 'inline'; - if(this.delBtns[rowIndex]) this.delBtns[rowIndex].style.display = 'inline'; - if(this.submitBtns[rowIndex]) this.submitBtns[rowIndex].style.display = 'none'; - if(this.cancelBtns[rowIndex]) this.cancelBtns[rowIndex].style.display = 'none'; - } else { - if(this.edtBtns[rowIndex]) this.edtBtns[rowIndex].style.display = 'none'; - if(this.addBtns[rowIndex]) this.addBtns[rowIndex].style.display = 'none'; - if(this.delBtns[rowIndex]) this.delBtns[rowIndex].style.display = 'none'; - if(this.submitBtns[rowIndex]) this.submitBtns[rowIndex].style.display = 'inline'; - if(this.cancelBtns[rowIndex]) this.cancelBtns[rowIndex].style.display = 'inline'; - } - }, - CloseCellEditor: function(colIndex){ - if(colIndex === undefined || !this.activeCellEditor){ return; } - if(this.o.onBeforeCloseEditor){ this.o.onBeforeCloseEditor.call(null, this.o, this.activeCellEditor, this.o.editors[colIndex]); } - var edtVal = this.GetEditorValue(colIndex), - cache = this.GetCellCache(this.activeCellEditor), - cellVal = cache[1], cellHtml = cache[0], - editor = this.o.editors[colIndex], - val; - if(this.o.IsEditorType(colIndex, this.o.edtTypes.uploader)){ - editor.Close(this.activeCellEditor); - } else { - if(this.o.IsEditorType(colIndex, this.o.edtTypes.multiple)){//multiple selections need to be cleared - for (var j = 0; j < editor.options.length; j++){ - if(editor.options[j].selected){ editor.options[j].selected = false; } - } - } - if(edtVal != cellVal){ - var reg = new RegExp(cellVal.RegexpEscape(), 'g'); - if(reg.test(cellHtml) && cellVal !== ''){ val = cellHtml.replace(reg, edtVal); } //value to be written - else { val = edtVal; } - } - if(this.o.setCellModifiedValue){ this.o.setCellModifiedValue.call(null, this.o, this.activeCellEditor, val); } - else { - try { this.activeCellEditor.removeChild(editor); } catch (e){ if(this.activeCellEditor) this.activeCellEditor.innerHTML = ''; } //for older versions of IE - try { - if(!this.o.validateModifiedValue || - this.o.validateModifiedValue.call(null, this.o, colIndex, cellVal, edtVal, this.activeCellEditor, editor)){ //validation ok - if(this.o.editorAllowEmptyValue[colIndex]){ //empty value is allowed - this.activeCellEditor.innerHTML = (val !== undefined ? val : cellHtml); - } else { this.activeCellEditor.innerHTML = (val !== undefined && val.Trim() !== '' ? val : cellHtml); } - if(edtVal != cellVal){ - //select editor with option value different from option text - if(this.o.IsEditorType(colIndex, this.o.edtTypes.select)){ val = editor.getAttribute(this.o.attrValue); } - if(this.o.editorModel == 'row'){ this.SetModifiedCell(this.activeCellEditor, this.activeCellEditor.innerHTML, cellVal); } - else { this.SetModifiedCell(this.activeCellEditor, val, cellVal); } - } - } else { this.activeCellEditor.innerHTML = cellVal || cellHtml; } //resets cached value - } catch (e){ } //Temp solution for mysterious Chrome bug - } - if(this.o.onAfterCloseEditor){ this.o.onAfterCloseEditor.call(null, this.o, this.activeCellEditor, editor); } - this.RemoveCellCache(this.activeCellEditor); - if(this.o.IsEditorType(colIndex, this.o.edtTypes.custom)){ - if(this.o.closeCustomEditor){ this.o.closeCustomEditor.call(null, this.o, this.activeCellEditor, editor); } - } - } - if(this.o.autoSave && this.o.editorModel === 'cell' && this.o.autoSaveModel === 'cell'){ this.AutoSubmit(); } - this.activeCellEditor = null; - this.openCellEditor = null; - }, - IsEditorOpen: function(colIndex){ return this.openCellEditor == colIndex; }, - IsRowEditorOpen: function(){ return this.activeRow !== null; }, - SetEditorFocus: function(colIndex){ - if(this.o.editors[colIndex] && (this.IsEditorOpen(colIndex) || this.activeRow) && - (!this.o.IsEditorType(colIndex, this.o.edtTypes.custom) && !this.o.IsEditorType(colIndex, this.o.edtTypes.command) - && !this.o.IsEditorType(colIndex, this.o.edtTypes.bool))){ this.o.editors[colIndex].focus(); } - }, - BlurEditor: function(colIndex){ if(this.o.editors[colIndex] && (this.IsEditorOpen(colIndex) || this.activeRow)) this.o.editors[colIndex].blur(); }, - SetModifiedCell: function(cell, val, oldVal){ - if(!cell) return; - var row = cell.parentNode; - if(this.o.Css.Has(row, this.o.newRowClass)){ return; } //modified values of added rows don't need to be treated - var r = {}; r.values = []; r.urlParams = ''; r.modified = []; - var modRow = this.GetModifiedRow(row.rowIndex); - if(!modRow){ - for (var i = 0; i < row.cells.length; i++){ - if(cell.cellIndex == i){ this.o.Css.Add(cell, this.o.modifiedCellCss); } - var cache = this.GetCellCache(row.cells[i]); - var t = cell.cellIndex == i ? val : (this.o.editorModel == 'row' && !this.o.IsEditorType(i, this.o.edtTypes.none) ? cache[1] || this.o.GetText(row.cells[i]) : this.o.GetText(row.cells[i])); - if(this.o.IsEditorType(i, this.o.edtTypes.bool) && this.o.Tag(row.cells[i], 'input').length > 0) - t = this.o.Tag(row.cells[i], 'input')[0].checked; - var paramName = this.o.prfxParam + i; //param name for server-side purposes - r.values.push(t); - r.modified.push(cell.cellIndex == i ? true : false); - r.urlParams += '&' + paramName + '=' + encodeURIComponent(t); //params for submission - } - this.modifiedRows.push([row.rowIndex, r]); - } else { - var obj = modRow[1]; - obj.values[cell.cellIndex] = val; - obj.modified[cell.cellIndex] = true; - var paramName = this.o.prfxParam + cell.cellIndex; - var oldParam = paramName + '=' + encodeURIComponent(oldVal); - var newParam = paramName + '=' + encodeURIComponent(val); - obj.urlParams = obj.urlParams.replace(oldParam, newParam); - } - }, - GetModifiedRow: function(rowIndex){ - if(rowIndex === undefined){ return null; } - for (var i = 0; i < this.modifiedRows.length; i++){ - if(this.modifiedRows[i][0] == rowIndex){ - return this.modifiedRows[i]; - } - } return null; - }, - GetModifiedRows: function(){ return this.modifiedRows; }, - GetAddedRows: function(){ return this.addedRows; }, - SetRowsObject: function(rows, cmd){ - if(!rows) return; - for (var i = 0; i < rows.length; i++){ - var row = rows[i]; - if(!row) continue; - var r = {}; r.values = []; r.urlParams = ''; r.modified = []; - for (var j = 0; j < row.cells.length; j++){ - var cell = row.cells[j]; - var t = this.o.GetText(row.cells[j]); - if(this.o.IsEditorType(j, this.o.edtTypes.bool) && this.o.Tag(cell, 'input').length > 0){ - t = this.o.Tag(cell, 'input')[0].checked; - } else if(this.o.IsEditorType(j, this.o.edtTypes.select)){ t = cell.getAttribute(this.o.attrValue); } - var paramName = this.o.prfxParam + j; //param name for server-side purposes - r.values.push(t); - r.modified.push((cmd == 'delete' ? false : true)); - r.urlParams += '&' + paramName + '=' + encodeURIComponent(t); //params for submission - } - if(cmd == 'delete') this.deletedRows.push([row.rowIndex, r]); - else if(cmd == 'insert') this.addedRows.push([row.rowIndex, r]); - else this.modifiedRows.push([row.rowIndex, r]); - } - }, - GetDeletedRows: function(){ return this.deletedRows; }, - RemoveModifiedRow: function(rowIndex){ - if(rowIndex === undefined) return; - for (var i = 0; i < this.GetModifiedRows().length; i++){ - if(this.GetModifiedRows()[i][0] == rowIndex){ - this.modifiedRows.splice(i, 1); break; - } - } - }, - RemoveModifiedCellMark: function(rowIndex, cellIndexes){ - if(rowIndex === undefined) return; - var row = this.o.table.rows[rowIndex], cells = row.cells; - for (var i = 0; i < cells.length; i++){ - var cell = cells[i]; - if(!cellIndexes || cellIndexes.indexOf(i) != -1) - this.o.Css.Remove(cell, this.o.modifiedCellCss); - } - }, - SetCellCache: function(cell, data, htmlCont){ - if(!cell || data === undefined) return; - var html = htmlCont || htmlCont === '' ? htmlCont : cell.innerHTML; - cell.setAttribute(this.o.attrCont, escape(html)); - cell.setAttribute(this.o.attrData, escape(data)); - }, - GetCellCache: function(cell){ - if(!cell) return []; - var a, b; - if(cell.attributes[this.o.attrCont] !== undefined) a = unescape(cell.getAttribute(this.o.attrCont)); - if(cell.attributes[this.o.attrData] !== undefined) b = unescape(cell.getAttribute(this.o.attrData)); - return [a, b]; - }, - RemoveCellCache: function(cell){ - if(!cell) return; - if(cell.attributes[this.o.attrCont] !== undefined) cell.removeAttribute(this.o.attrCont); - if(cell.attributes[this.o.attrData] !== undefined) cell.removeAttribute(this.o.attrData); - }, - GetEditorValue: function(colIndex){ - var editor = this.o.editors[colIndex]; - var editorType = this.o.editorTypes[colIndex]; - var val = ''; - if(!editor || !editorType) return val; - switch (editorType.LCase()){ - case this.o.edtTypes.input: - case this.o.edtTypes.textarea: - val = editor.value; - break; - case this.o.edtTypes.select: - val = editor.getAttribute(this.o.attrText) || editor.value; - break; - case this.o.edtTypes.multiple: - var sep = !this.o.editorValuesSeparator[colIndex] ? this.o.valuesSeparator : this.o.editorValuesSeparator[colIndex]; - for (var j = 0; j < editor.options.length; j++) - if(editor.options[j].selected) - val = val.concat(editor.options[j].value, sep); - val = val.substring(0, val.length - sep.length); - break; - case this.o.edtTypes.custom: - if(this.o.getCustomEditorValue) val = this.o.getCustomEditorValue.call(null, this.o, editor, colIndex); - break; - } - return val; - }, - SetEditorValue: function(colIndex, val){ - var editor = this.o.editors[colIndex]; - var editorType = this.o.editorTypes[colIndex]; - switch (editorType.LCase()){ - case this.o.edtTypes.input: - case this.o.edtTypes.textarea: - case this.o.edtTypes.select: - editor.value = val; - break; - case this.o.edtTypes.multiple: - for (var j = 0; j < editor.options.length; j++) - if(editor.options[j].value == val) editor.options[j].selected = true; - break; - case this.o.edtTypes.custom: - if(this.o.setCustomEditorValue) this.o.setCustomEditorValue.call(null, this.o, editor, colIndex, val); - break; - } - }, - GetCheckBox: function(cell){ - if(!cell) return null; - var chk = this.o.Tag(cell, 'input')[0]; - if(chk.getAttribute('type').LCase() == 'checkbox') return chk; - else return null; - }, - SetCheckBoxValue: function(e, cell){ - if(!cell) return; - var x = this.o.Editable; - var checkbox = x.GetCheckBox(cell); - if(!checkbox || checkbox.type.LCase() != 'checkbox') return; - if(this.o.Event.GetElement(e) != checkbox){//in case user clicks on cell instead of checkbox - if(checkbox.checked) checkbox.checked = false; - else checkbox.checked = true; - } - var data = !checkbox.checked; - x.SetCellCache(cell, data, ''); - x.SetModifiedCell(cell); - if(x.o.autoSave){ x.SubmitAll(); } //checkbox value set straightaway, prevents treatedRows inconsistency - }, - AddNewRow: function(){ - var row, - rowIdx = this.o.startRow; - - if(this.o.newRowPos === 'bottom'){ - rowIdx = -1; - } - else if(typeof this.o.newRowPos === 'number' && - this.o.newRowPos >= -1){ - rowIdx = this.o.newRowPos; - } - - try{ - row = this.o.table.insertRow(rowIdx); - } catch(e) { - row = this.o.table.insertRow(this.o.startRow); - console.log(e); - } - row.setAttribute('id', this.o.CreateId()); //temp id for new row - this.o.Css.Add(row, this.o.newRowClass); - for (var i = 0; i < this.o.nbCells; i++){ - var cell = row.insertCell(i); - if(this.o.defaultRecord){ cell.innerHTML = this.o.defaultRecord[i]; } - else { cell.innerHTML = this.o.defaultRecordUndefinedValue; } - } - if(this.o.cmdInsertBtnScroll){ row.scrollIntoView(false); } - this.newRows.push(row); - if(this.o.onAddedDomRow){ this.o.onAddedDomRow.call(null, this.o, this.newRows, row); } - }, - SubmitEditedRows: function(){ this.Submit('update'); }, - SubmitAddedRows: function(){ this.SetRowsObject(this.newRows, 'insert'); this.Submit('insert'); }, - SubmitDeletedRows: function(){ - if(this.o.selection){ - if(!this.o.Selection.activeRow && this.o.Selection.selectedRows.length === 0) return; - var rows = (this.o.bulkDelete) ? this.o.Selection.selectedRows : [this.o.Selection.activeRow]; - if(rows.length === 0){ return; } - this.SetRowsObject(rows, 'delete'); - if(confirm(this.o.msgConfirmDelSelectedRows)){ this.Submit('delete'); } - else { this.deletedRows = []; } - } - }, - SubmitAll: function(){ this.submitAll = true; this.SubmitAddedRows(); this.SubmitEditedRows(); }, - AutoSubmit: function(){ - switch(this.o.autoSaveType){ - case 'both': this.SubmitAll(); break; - case 'insert': this.SubmitAddedRows(); break; - case 'update': default: this.SubmitEditedRows(); break; - } - }, - Submit: function(cmd){ - cmd = cmd.LCase(); - var x = this; - var treatedRows, uri, submitMethod, formMethod, params; - var beforeSubmitCallBack, afterSubmitCallBack, onSubmit, onSubmitError; - var checkResponseSanity, processResponse; - switch ((cmd || '')){ - case 'insert': - treatedRows = this.GetAddedRows(); - uri = this.o.insertURI; - submitMethod = this.o.insertSubmitMethod; - formMethod = this.o.insertFormMethod; - params = this.o.insertParams; - beforeSubmitCallBack = this.o.onBeforeInsertSubmit; - afterSubmitCallBack = this.o.onAfterInsertSubmit; - onSubmit = this.o.onInsertSubmit; - onSubmitError = this.o.onInsertError; - checkResponseSanity = this.o.checkInsertResponseSanity; - processResponse = this.o.processInsertResponse; - break; - case 'delete': - treatedRows = this.GetDeletedRows(); - uri = this.o.deleteURI; - submitMethod = this.o.deleteSubmitMethod; - formMethod = this.o.deleteFormMethod; - params = this.o.deleteParams; - beforeSubmitCallBack = this.o.onBeforeDeleteSubmit; - afterSubmitCallBack = this.o.onAfterDeleteSubmit; - onSubmit = this.o.onDeleteSubmit; - onSubmitError = this.o.onDeleteError; - checkResponseSanity = this.o.checkDeleteResponseSanity; - processResponse = this.o.processDeleteResponse; - break; - case 'update': - default: - treatedRows = this.GetModifiedRows(); - uri = this.o.updateURI; - submitMethod = this.o.updateSubmitMethod; - formMethod = this.o.updateFormMethod; - params = this.o.updateParams; - beforeSubmitCallBack = this.o.onBeforeUpdateSubmit; - afterSubmitCallBack = this.o.onAfterUpdateSubmit; - onSubmit = this.o.onUpdateSubmit; - onSubmitError = this.o.onUpdateError; - checkResponseSanity = this.o.checkUpdateResponseSanity; - processResponse = this.o.processUpdateResponse; - break; - } - if(beforeSubmitCallBack){ beforeSubmitCallBack.call(null, this.o, treatedRows); } - if(onSubmit){ onSubmit.call(null, this.o, treatedRows); } - else { - if((!uri || uri === '') && treatedRows.length > 0){ - alert(cmd.toUpperCase() + ': ' + this.o.msgUndefinedSubmitUrl); - treatedRows = []; x.o.savedRowsNb[cmd] = 0; - SubmitComplete(false); - } else { - for (var i = 0; i < treatedRows.length; i++){ - var modArr = treatedRows[i], rowIndex = modArr[0], row = modArr[1]; - if(rowIndex < 0) continue; - var rowValues = row.values; - var urlParams = row.urlParams, paramParts = urlParams.split('&'); - var rowId = this.o.table.rows[rowIndex].getAttribute('id'); - if(params && this.o.IsArray(params)){//params are replaced if defined - for (var j = 0; j < params.length; j++){ - if(params[j] === ''){ continue; } - urlParams = urlParams.replace(paramParts[j + 1].split('=')[0], params[j]); - } - paramParts = urlParams.split('&'); - } - this.o.Css.Add(this.o.table, this.o.activityIndicatorCss); - if(this.o.onServerActivityStart) this.o.onServerActivityStart.call(null, this.o, this.o.table.rows[rowIndex]); - - if(submitMethod === 'script'){//GET method by using script tag inclusion - var prm = (uri.indexOf('?') === -1 ? '?rowId=' : '&rowId=') + rowId + urlParams; - try {//window.open(uri+prm); - this.o.IncludeFile(this.o.prfxScr + rowIndex + '_' + this.o.id, uri + prm, - function(eg, scriptElm){ - eg.savedRowsNb[cmd]++; var rIndex = scriptElm.id.replace(eg.prfxScr, '').replace('_' + eg.id, ''); - eg.Editable.RemoveModifiedCellMark(parseInt(rIndex, 10)); - SubmitComplete(true); - }); - } catch (e){ - this.o.Css.Remove(this.o.table, this.o.activityIndicatorCss); - if(this.o.onServerActivityStop) this.o.onServerActivityStop.call(null, this.o, this.o.table.rows[rowIndex]); - if(this.o.onSubmitError) this.o.onSubmitError.call(null, this.o, e, e.description); - else alert(this.o.msgErrOccur + '\n' + e.description + '\n' + this.o.msgSaveUnsuccess); - } - } - else if(submitMethod !== 'script' && this.o.ajax){ - var xhr = (function(rowIndex, arrIndex, rowId, urlParams) { - var _self = this, - div; - // Submit data with intervals - if(arrIndex===0){ - submitData(rowId, urlParams, rowIndex, arrIndex); - } else { - setTimeout(function() { - submitData(rowId, urlParams, rowIndex, arrIndex); }, - (arrIndex*x.o.formSubmitInterval) - ); - } - - function submitData(rowId, urlParams, rowIndex, arrIndex){ - var prm = 'rowId=' + rowId + '&rIndex=' + rowIndex + urlParams; - - $.ajax({ - url: uri, - type: formMethod, - data: prm - }).done(function(data, status, xhr){ - // Determine response content-type - var dataType = xhr.getResponseHeader('content-type') || 'application/json'; - - if(dataType.indexOf('application/json') !== -1){ - var sane = sanityCheck(data); - if(sane){ - // Process the response if needed - if(processResponse){ - processResponse.call(_self.o, data); - } - - // Ensure id attribute is set for newly created rows, so they can be updated immediately - if(data.result && data.result.id && cmd === 'insert'){ - if(_self.o.table.rows[rowIndex]){ - _self.o.table.rows[rowIndex].setAttribute('id', _self.o.newRowPrefix + data.result.id); - } - } - - release(); - } else { - fail(null, 'Invalid Data', _self.o.msgInvalidData); - } - } else { - div = _self.o.CreateElm('div', ['id', 'xhr_' + rowIndex + '_' + _self.o.id]); - document.body.appendChild(div); - $(div).html(data); - release(); - } - }).always(function(data){ - if(div){ document.body.removeChild(div); } - }).fail(fail); - } - - function sanityCheck(data) { - if(checkResponseSanity){ - return checkResponseSanity.call(_self.o, data); - } - return (data && data.hasOwnProperty('result') && - data.result.hasOwnProperty('success') && - data.result.hasOwnProperty('id')); - } - - function fail(jqXHR, textStatus, errDesc) { - // remove reference from collection of rows to be treated - if(cmd === 'insert'){ - _self.o.Editable.addedRows.splice(arrIndex, 1); - _self.o.Editable.newRows.splice(arrIndex, 1); - } - treatedRows.splice(arrIndex, 1); - _self.o.Css.Remove(_self.o.table, _self.o.activityIndicatorCss); - if(_self.o.onServerActivityStop) _self.o.onServerActivityStop.call(null, _self.o, _self.o.table.rows[rowIndex]); - if(_self.o.onSubmitError) _self.o.onSubmitError.call(null, _self.o, e, e.description); - else alert(_self.o.msgErrOccur + '\n' + errDesc + '\n' + _self.o.msgSaveUnsuccess); - } - - function release(){ - _self.o.savedRowsNb[cmd]++; - _self.o.Editable.RemoveModifiedCellMark(rowIndex); - _self.o.Css.Remove(_self.o.table.rows[rowIndex], _self.o.newRowClass); - SubmitComplete(true); - } - }).call(this, rowIndex, i, rowId, urlParams); - } else {//GET or POST method by using form and iframe elements - if(!this.o.ifrmContainer[cmd]) this.o.ifrmContainer[cmd] = this.o.CreateElm('div', ['id', 'cont_' + this.o.id + cmd], ['style', 'display:none;']); - var iframeId = this.o.prfxIFrm + rowIndex + '_' + this.o.id + cmd; - var iframe; //below for older versions of IE, name attribute dynamically created problem, very ugly solution... - try { var iframe = document.createElement(''); } - catch (e){ var iframe = this.o.CreateElm('iframe', ['id', iframeId], ['name', iframeId], ['src', 'about:blank'], [this.o.attrRowIndex, rowIndex]); } - iframe.style.cssText = 'display:none; width:0; height:0;'; - - var form = this.o.CreateElm( 'form', - ['id', this.o.prfxFrm + rowIndex + '_' + this.o.id + cmd], ['method', formMethod], ['action', uri], - ['target', iframeId], ['accept-charset', 'utf-8'] ); - for (var j = 1; j < paramParts.length; j++){ - var paramName = paramParts[j].split('=')[0]; - var paramValue = paramParts[j].split('=')[1]; - var hiddenField = this.o.CreateElm('input', ['type', 'hidden'], ['name', paramName], ['value', paramValue]); - form.appendChild(hiddenField); - } - var hiddenField = this.o.CreateElm('input', ['type', 'hidden'], ['name', 'rowId'], ['value', rowId]); - form.appendChild(hiddenField); - - document.body.appendChild(this.o.ifrmContainer[cmd]); - this.o.ifrmContainer[cmd].appendChild(iframe); - this.o.ifrmContainer[cmd].appendChild(form); - } - } //for i - - if(treatedRows.length > 0 && this.o.ifrmContainer[cmd]){ - var ifrms = this.o.Tag(this.o.ifrmContainer[cmd], 'iframe'), - frms = this.o.Tag(this.o.ifrmContainer[cmd], 'form'); - for(var j=0; j= x.o.startRow) { - slcRowIndex = curSlcRowIndex-1; - } else { - slcRowIndex = x.o.startRow; - } - } - if(selectedCell){ - curSlcCellIndex = selectedCell.cellIndex; - } - x.o.Selection.ClearSelections(); - var a = []; - for (var k = 0; k < x.o.Editable.deletedRows.length; k++){ - a.push(x.o.Editable.deletedRows[k][0]); - } - a.sort(x.o.Sort.NumDesc); //rows indexes need to be sorted in desc manner for rows deleting operation - for (var k = 0; k < a.length; k++){ - x.o.table.deleteRow(a[k]); - } - if(slcRowIndex !== null){ - x.o.Selection.SelectRowByIndex(slcRowIndex); - } - if(curSlcCellIndex !== null){ - if(selectedRow){ - var cell = selectedRow.cells[curSlcCellIndex]; - x.o.Selection.SelectCell(cell); - } - } - } - x.o.Editable.deletedRows = []; - x.o.Editable.SetCommandEditor(x.o.editorCmdColIndex); - } - else x.o.Editable.modifiedRows = []; - if(x.o.savedRowsNb.update === 0 && x.o.savedRowsNb.insert === 0 && x.o.savedRowsNb['delete'] === 0){ - if(afterSubmitCallBack){ afterSubmitCallBack.call(null, x.o, treatedRows); } - else { // message displayed if autosave false - if(verbose && !x.o.autoSave && (!x.o.Editable.submitAll || - (x.o.Editable.submitAll && cmd === 'update'))){ - alert(x.o.msgSubmitOK); - } - } - x.o.Editable.submitAll = false; - } - if(x.o.onServerActivityStop) x.o.onServerActivityStop.call(null, x.o, x.o.table.rows[rowIndex]); - if(submitMethod === 'form' && !x.o.ajax && x.o.ifrmContainer[cmd]){ - x.o.ifrmContainer[cmd].innerHTML = ''; - } - x.o.Css.Remove(x.o.table, x.o.activityIndicatorCss); - } - } - }, - Edit: function(e){ - var row, cell; - if(e && e.type && e.type.LCase().indexOf('click') !== -1){ - row = this.o.GetRow(e); - cell = this.o.GetCell(e); - } else { - if(!this.o.selection) return; - if(!this.o.Selection.activeRow && !this.o.Selection.activeCell) return; - row = this.o.Selection.activeRow; - cell = this.o.Selection.activeCell; - } - if(!row || row.rowIndex < this.o.startRow) return; - - if(this.o.editorModel === 'cell' && cell){ - var cellIndex = cell.cellIndex; - if(!this.activeCellEditor && this.o.editors[cellIndex]){ - if(this.o.IsEditorType(cellIndex, this.o.edtTypes.bool)){ - this.SetCheckBoxValue(e, cell); - } else { this.OpenCellEditor(cell); } - } - } - if(this.o.editorModel === 'row' && !this.IsRowEditorOpen()){ this.OpenRowEditor(row); } - }, - Event: { - OnInputFocus: function(e){ - var elm = this.o.Event.GetElement(e); - elm.select(); - }, - OnBlur: function(e){ - var elm = this.o.Event.GetElement(e); - var colIndex = elm.getAttribute(this.o.attrColIndex); - if(colIndex === null){ - var cell = this.o.GetElement(e, 'td'); - colIndex = cell.cellIndex; - } - if(this.o.editorModel == 'cell'){ this.CloseCellEditor(colIndex); } - } - } -}; - -Selection.prototype = { - onClickAdded: false, activeRow: null, activeCell: null, selectedRows: [], - Init: function(){ - if(!this.o.selection) return; - this.SetEvents(); - if(this.o.selectRowAtStart){ - this.SelectRowByIndex(this.o.rowIndexAtStart); - if(this.activeRow) this.SelectCell(this.activeRow.cells[0]); - } - if(this.o.onSelectionInit) this.o.onSelectionInit.call(null, this.o); - }, - Set: function(){ - this.o.selection = true; - this.o.keyNav = true; - this.SetEvents(); - }, - Remove: function(){ - this.o.selection = false; - this.o.keyNav = false; - this.RemoveEvents(); - }, - SetEvents: function(){ - if(!this.onClickAdded){ - var x = this; - this.o.Event.Bind(this.o.table, 'click', function(e){ x.OnClick.call(x, e); }); - if(this.o.onValidateRow || this.o.onValidateCell) this.o.Event.Bind(this.o.table, 'dblclick', function(e){ x.OnDblClick.call(x, e); }); - this.onClickAdded = true; - } - if(this.o.keyNav){ this.o.Event.Bind(this.o.StandardBody(), 'keydown', function(e){ x.OnKeyDown.call(x, e); }); } - }, - RemoveEvents: function(){ - if(this.onClickAdded){ - var x = this; - this.o.Event.Unbind(this.o.table, 'click', function(e){ x.OnClick.call(x, e); }); - if(this.o.onValidateRow || this.o.onValidateCell) this.o.Event.Unbind(this.o.table, 'dblclick', function(e){ x.OnDblClick.call(x, e); }); - this.o.Event.Unbind(this.o.StandardBody(), 'keydown', function(e){ x.OnKeyDown.call(x, e); }); - this.onClickAdded = false; - } - }, - GetActiveRow: function(){ return this.activeRow; }, - GetActiveCell: function(){ return this.activeCell; }, - GetSelectedRows: function(){ return this.selectedRows; }, - GetSelectedValues: function(){ - var values = []; - for(var i=0; i 0){ - if(!this.IsRowSelected(row)) this.SelectRow(row); - else this.DeselectRow(row); - } else this.SelectRow(row); - } - else if(this.o.keySelection && (!e.ctrlKey && !e.shiftKey)){ - this.ClearSelections(); - this.SelectRow(row); - } - else if(this.o.keySelection && e.ctrlKey && this.selectedRows.length > 0) - this.SelectRow(row); - else if(this.o.keySelection && e.shiftKey && this.selectedRows.length > 0){ - if(!this.activeRow) return; - var prevRowIndex = this.activeRow.rowIndex; - this.SelectRow(row); - var curRowIndex = this.activeRow.rowIndex; - if(prevRowIndex < curRowIndex){ - for(var i=prevRowIndex+1; icurRowIndex; i--){ - var r = this.o.table.rows[i]; - if(r){ - if(!this.IsRowSelected(r)) this.SelectRow(r); - else this.DeselectRow(r); - } - } - if(!this.IsRowSelected(this.o.table.rows[prevRowIndex-1])) - this.DeselectRow(this.o.table.rows[prevRowIndex]); - } - this.SelectRow(row); - } - else{ this.SelectRow(row); } - this.DeselectCell(this.activeCell); - if(this.IsRowSelected(row)){ this.SelectCell(cell); } - } - - if(this.o.editable){ - if(this.o.editorModel=='cell'){ - var activeCellEditor = this.o.Editable.activeCellEditor; - if(!activeCellEditor && cell && this.o.editors[cell.cellIndex]){ - //Boolean is set if cell clicked even if editor action is dblclick - if(this.o.IsEditorType(cell.cellIndex, this.o.edtTypes.bool) && this.o.openEditorAction==='dblclick'){ - this.o.Editable.SetCheckBoxValue(e, cell); - } - } - //Custom or uploader editor is closed if cell selection changes - if(activeCellEditor && (this.o.IsEditorType(activeCellEditor.cellIndex, this.o.edtTypes.custom) || - this.o.IsEditorType(activeCellEditor.cellIndex, this.o.edtTypes.uploader)) - && (cell && cell.cellIndex!=activeCellEditor.cellIndex || row.rowIndex!=activeCellEditor.parentNode.rowIndex)){ - this.o.Editable.CloseCellEditor(activeCellEditor.cellIndex); - } - } - if(this.o.editorModel=='row'){ - if(row != this.o.Editable.activeRow) this.o.Editable.CloseRowEditor(); - } - } - }, - OnKeyDown: function(e){ - if(!this.activeRow) return; - var t = this.o.GetTableFromElement(this.activeRow); - if(!t || t.nodeName.LCase() != 'table' || t['id'] != et_activeGrid) return; - var keyCode = this.o.Event.GetKey(e); - var maxRowIndex = (this.o.table.rows.length - 1); - var nbCells = (this.o.GetCellsNb() - 1); - var curRowIndex = this.activeRow.rowIndex; - var rowIndex, cellIndex; - - var x = this; - var navigate = function(cmd){ - if(!x.activeRow){ - rowIndex = x.o.startRow; cellIndex = 0; - } else { - var curCellIndex = (x.activeCell ? x.activeCell.cellIndex : 0); - if(x.o.selectionModel == 'single' || (x.o.selectionModel == 'multiple' && !e.shiftKey) || !x.o.keySelection) x.ClearSelections(); - else if(x.o.selectionModel == 'multiple' && e.shiftKey) x.DeselectCell(x.activeCell, e); - cellIndex = curCellIndex; - if(cmd === 'down') rowIndex = (curRowIndex < maxRowIndex) ? curRowIndex + 1 : maxRowIndex; - else if(cmd === 'up') rowIndex = (curRowIndex == x.o.startRow) ? x.o.startRow : curRowIndex - 1; - else if(cmd === 'pgdown') rowIndex = (curRowIndex+x.o.nbRowsPerPage < maxRowIndex) ? curRowIndex + x.o.nbRowsPerPage : maxRowIndex; - else if(cmd === 'pgup') rowIndex = (curRowIndex-x.o.nbRowsPerPage <= x.o.startRow) ? x.o.startRow : curRowIndex - x.o.nbRowsPerPage; - else if(cmd === 'home') rowIndex = x.o.startRow; - else if(cmd === 'end') rowIndex = maxRowIndex; - else if(cmd === 'right'){ - if(x.o.defaultSelection != 'row'){ - rowIndex = curRowIndex; - cellIndex = (curCellIndex+1 > nbCells) ? 0 : curCellIndex+1; - if((curCellIndex+1) > nbCells) rowIndex = (curRowIndex < maxRowIndex) ? curRowIndex + 1 : maxRowIndex; - } else rowIndex = (curRowIndex < maxRowIndex) ? curRowIndex + 1 : maxRowIndex; - } - else if(cmd === 'left'){ - if(x.o.defaultSelection != 'row'){ - rowIndex = curRowIndex; - cellIndex = (curCellIndex-1 < 0) ? nbCells : curCellIndex-1; - if(curCellIndex-1 < 0) rowIndex = (curRowIndex == x.o.startRow) ? x.o.startRow : curRowIndex - 1; - } else rowIndex = (curRowIndex == x.o.startRow) ? x.o.startRow : curRowIndex - 1; - } - } - var row = x.o.table.rows[rowIndex]; - if(x.o.keySelection && e.shiftKey && x.selectedRows.length > 0 && (cmd=='pgdown' || cmd=='pgup' || cmd=='home' || cmd=='end')){ - if(!x.activeRow) return; - if(curRowIndex < rowIndex){ - for(var i=curRowIndex+1; irowIndex; i--){ - var r = x.o.table.rows[i]; - if(r){ - if(!x.IsRowSelected(r)) x.SelectRow(r, e); - else x.DeselectRow(r, e); - } - } - if(!x.IsRowSelected(x.o.table.rows[curRowIndex-1])) - x.DeselectRow(x.o.table.rows[curRowIndex], e); - } - x.SelectRow(row, e); - } else { - if(x.o.keySelection && e.shiftKey && x.IsRowSelected(row)) x.DeselectRow(x.o.table.rows[curRowIndex], e); - x.SelectRow(row, e); - } - - if(x.o.defaultSelection != 'row'){ - var cell = row.cells[cellIndex]; - x.SelectCell(cell, e); - if(x.o.scrollIntoView) cell.scrollIntoView(false); - } - if(x.o.scrollIntoView && x.o.defaultSelection=='row') row.scrollIntoView(false); - if(x.o.autoSave && x.o.autoSaveModel === 'row'){ - if(rowIndex !== curRowIndex){ x.o.Editable.AutoSubmit(); } - } - x.o.Event.Cancel(e); - }; - - var ed = this.o.Editable; - function closeEditor(){ - if(x.o.editable && ed.activeCellEditor && x.o.editorModel=='cell') - ed.CloseCellEditor(ed.activeCellEditor.cellIndex); - - if(x.o.editable && ed.activeRow && x.o.editorModel=='row') - if(ed.activeRow != x.activeRow) ed.CloseRowEditor(); - } - - switch(keyCode){ - case 40: //arrow down - if(!x.o.editable || (x.o.editable && !ed.activeCellEditor && !ed.activeRow)) navigate('down'); - break; - case 38: //arrow up - if(!x.o.editable || (x.o.editable && !ed.activeCellEditor && !ed.activeRow)) navigate('up'); - break; - case 37: //arrow left - if(!x.o.editable || (x.o.editable && !ed.activeCellEditor && !ed.activeRow)) navigate('left'); - break; - case 39: //arrow right - if(!x.o.editable || (x.o.editable && !ed.activeCellEditor) && !ed.activeRow) navigate('right'); - break; - case 34: //pagedown - navigate('pgdown'); closeEditor(); - break; - case 33: //pageup - navigate('pgup'); closeEditor(); - break; - case 36: //home - navigate('home'); closeEditor(); - break; - case 35: //end - navigate('end'); closeEditor(); - break; - case 9: //tab - if(e.shiftKey) navigate('left'); - else navigate('right'); - if(x.o.editorModel == 'row'){ - if(x.activeCell && x.selectionModel!='row') ed.SetEditorFocus(x.activeCell.cellIndex); - if(x.activeRow && ed.activeRow && x.activeRow.rowIndex != ed.activeRow.rowIndex) closeEditor(); - } else{ closeEditor(); } - break; - case 13: //enter - if(!x.o.editable){ - if(!x.o.onValidateRow && !x.o.onValidateCell) navigate('down'); - else{ - if(x.o.onValidateRow && x.o.defaultSelection != 'cell') x.o.onValidateRow.call(null, x.o, x.activeRow); - if(x.o.onValidateCell && x.o.defaultSelection != 'row') x.o.onValidateCell.call(null, x.o, x.activeCell); - } - } else { - if(!ed.activeCellEditor){ ed.Edit.call(ed, e); x.o.Event.Cancel(e); } - else - if(x.o.IsEditorType(ed.activeCellEditor.cellIndex, x.o.edtTypes.input)){ closeEditor(); } - } - break; - case 113: //F2 - case 32: //space bar - if(x.o.editable && (!ed.activeCellEditor)){ ed.Edit.call(ed, e); x.o.Event.Cancel(e); } - break; - case 45: //insert - if(x.o.editable && (!ed.activeCellEditor)){ - ed.AddNewRow(); - ed.SetCommandEditor(x.o.editorCmdColIndex); - x.o.Event.Cancel(e); - } - break; - case 46: //delete - if(x.o.editable && (!ed.activeCellEditor)){ ed.SubmitDeletedRows(); x.o.Event.Cancel(e); } - break; - case 27: //escape - if(x.o.editable && x.o.editorModel == 'cell'){ if(ed.activeCellEditor) closeEditor(); } - if(x.o.editable && x.o.editorModel == 'row') closeEditor(); - break; - default: //key stroke opens editor if edition is enabled - if((x.o.editable && x.o.editableOnKeystroke && - x.o.editorModel == 'cell' && x.o.selectionModel == 'single' && - !ed.activeCellEditor && !ed.activeRow)){ - ed.Edit.call(ed, e); - x.o.Event.Cancel(e); - } - break; - } - if(x.o.editable && x.o.openEditorAction=='click'){ ed.Edit.call(ed, e); } - } -};//Selection - -EditTable.prototype = { - Init: function(){ - this.Css.Add(this.table, this.tableCss+' '+this.unselectableCss); - this.Selection.Init(); - this.Editable.Init(); - }, - GetCellsNb: function(rowIndex){ - var tr = (rowIndex === undefined) ? this.table.rows[this.startRow] : this.table.rows[rowIndex]; - return tr.cells.length; - }, - GetRowsNb: function(){ return this.table.rows.length; }, - GetRow: function(e){ return this.GetElement(e, 'tr'); }, - GetRowByIndex: function(rowIndex){ return this.table.rows[rowIndex]; }, - GetCell: function(e){ return this.GetElement(e, 'td') || this.GetElement(e, 'th'); }, - GetTableFromElement: function(elm){ - if(!elm) return null; - while(elm.parentNode){ - if(elm.nodeName.UCase() === 'TABLE'){ return elm; } - elm = elm.parentNode; - } - return null; - }, - GetElement: function(e, tagName){ - var elm, target = this.Event.GetElement(e); - while(target.parentNode){ - if(target.nodeName.UCase() === tagName.UCase() - && this.IsParentValid(target)){ - elm = target; break; - } - target = target.parentNode; - } - return elm; - }, - IsParentValid: function(elm){ - while(elm.parentNode){ - if(elm.nodeName.UCase() === 'TABLE'){ - if(elm.id == this.id) return true; - else return false; - } - elm = elm.parentNode; - } - return false; - }, - IsSelectable: function(){ return this.selection; }, - IsEditable: function(){ return this.editable; }, - ClearSelections: function(){ this.Selection.ClearSelections(); }, - IsEditorType: function(colIndex, type){ return this.editorTypes[colIndex] === type; }, - IsObj: function(o){ return (o && o.constructor == Object); }, - IsFn: function(fn){ return (fn && fn.constructor == Function); }, - IsArray: function(a){ return (a && a.constructor == Array); }, - Get: function(id){ return document.getElementById(id); }, - Tag: function(o, tagname){ if(!o){ return null; } else { return o.getElementsByTagName(tagname); } }, - GetText: function(n){ - if(!n){ return ''; } - var s = n.textContent || n.innerText || n.innerHTML.replace(/\<[^<>]+>/g, ''); - return s.replace(/^\s+/, '').replace(/\s+$/, '').Trim(); - }, - CreateElm: function(tag){ - if(tag===undefined || tag===null || tag==='') return; - var el = document.createElement(tag); - if(arguments.length>1){ - for(var i=0; i IE onload event works only for scripts, not for stylesheets - if(!isLoaded && - (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete')){ - isLoaded = true; - if(typeof callback === 'function'){ - head.removeChild(file); - callback.call(null, x, this); - } - } - }; - head.appendChild(file); - }, - Sort:{ - NumAsc: function(a, b){ return (a-b); }, - NumDesc: function(a, b){ return (b-a); }, - IgnoreCase: function(a, b){ - var x = a.LCase(); - var y = b.LCase(); - return ((x < y) ? -1 : ((x > y) ? 1 : 0)); - } - } -}; - -if(typeof String.prototype.LCase === 'undefined'){ - String.prototype.LCase = function(){ return this.toLowerCase(); }; -} -if(typeof String.prototype.UCase === 'undefined'){ - String.prototype.UCase = function(){ return this.toUpperCase(); }; -} -if(typeof String.prototype.Trim === 'undefined'){ - String.prototype.Trim = function(){//optimised by Anthony Maes - return this.replace(/(^[\s\xA0]*)|([\s\xA0]*$)/g,''); - }; -} -if(typeof String.prototype.RegexpEscape === 'undefined'){ - String.prototype.RegexpEscape = function(){ - var s = this; - function escape(e){ - a = new RegExp('\\'+e,'g'); - s = s.replace(a,'\\'+e); - } - chars = new Array('\\','[','^','$','.','|','?','*','+','(',')','�'); - for(var e=0; e0&&(this.startRow=b[0].rowIndex),arguments.length>1)for(var c=0;cwindow.parent["{1}"].SetUploadSuccess(true); window.parent["{1}"].SetUploadName("{0}");window.parent["{1}"].ShowUpload();',this.showUpload[c]=g.hasOwnProperty("show_upload")&&this.IsFn(g.show_upload)?g.show_upload:null,this.onBeforeOpenUploader[c]=g.hasOwnProperty("on_before_open")&&this.IsFn(g.on_before_open)?g.on_before_open:null,this.onAfterOpenUploader[c]=g.hasOwnProperty("on_after_open")&&this.IsFn(g.on_after_open)?g.on_after_open:null,this.onBeforeCloseUploader[c]=g.hasOwnProperty("on_before_close")&&this.IsFn(g.on_before_close)?g.on_before_close:null,this.onAfterCloseUploader[c]=g.hasOwnProperty("on_after_close")&&this.IsFn(g.on_after_close)?g.on_after_close:null}}-1!=this.editorTypes.indexOf(this.edtTypes.command)&&(this.editorModel="row"),this.inputEditorCss=void 0!==e.input_editor_css?e.input_editor_css:"ezInputEditor",this.textareaEditorCss=void 0!==e.textarea_editor_css?e.textarea_editor_css:"ezTextareaEditor",this.selectEditorCss=void 0!==e.select_editor_css?e.select_editor_css:"ezSelectEditor",this.commandEditorCss=void 0!==e.command_editor_css?e.command_editor_css:"ezCommandEditor",this.modifiedCellCss=void 0!==e.modified_cell_css?e.modified_cell_css:"ezModifiedCell",this.cmdEnabledBtns=this.editorCmdBtns.hasOwnProperty("enable")?this.editorCmdBtns.enable:["update","insert","delete","submit","cancel"],this.cmdUpdateBtn=this.editorCmdBtns.hasOwnProperty("update")?this.editorCmdBtns.update:{},this.cmdInsertBtn=this.editorCmdBtns.hasOwnProperty("insert")?this.editorCmdBtns.insert:{},this.cmdDeleteBtn=this.editorCmdBtns.hasOwnProperty("delete")?this.editorCmdBtns["delete"]:{},this.cmdSubmitBtn=this.editorCmdBtns.hasOwnProperty("submit")?this.editorCmdBtns.submit:{},this.cmdCancelBtn=this.editorCmdBtns.hasOwnProperty("cancel")?this.editorCmdBtns.cancel:{},this.cmdUpdateBtnText=this.cmdUpdateBtn.hasOwnProperty("text")?this.cmdUpdateBtn.text:"",this.cmdInsertBtnText=this.cmdInsertBtn.hasOwnProperty("text")?this.cmdInsertBtn.text:"",this.cmdDeleteBtnText=this.cmdDeleteBtn.hasOwnProperty("text")?this.cmdDeleteBtn.text:"",this.cmdSubmitBtnText=this.cmdSubmitBtn.hasOwnProperty("text")?this.cmdSubmitBtn.text:"Submit",this.cmdCancelBtnText=this.cmdCancelBtn.hasOwnProperty("text")?this.cmdCancelBtn.text:"Cancel",this.cmdUpdateBtnTitle=this.cmdUpdateBtn.hasOwnProperty("title")?this.cmdUpdateBtn.title:"Edit record",this.cmdInsertBtnTitle=this.cmdInsertBtn.hasOwnProperty("title")?this.cmdInsertBtn.title:"Create record",this.cmdDeleteBtnTitle=this.cmdDeleteBtn.hasOwnProperty("title")?this.cmdDeleteBtn.title:"Delete record",this.cmdSubmitBtnTitle=this.cmdSubmitBtn.hasOwnProperty("title")?this.cmdSubmitBtn.title:"Submit record",this.cmdCancelBtnTitle=this.cmdCancelBtn.hasOwnProperty("title")?this.cmdCancelBtn.title:"Cancel",this.cmdUpdateBtnIcon=this.cmdUpdateBtn.hasOwnProperty("icon")?this.cmdUpdateBtn.icon:'',this.cmdInsertBtnIcon=this.cmdInsertBtn.hasOwnProperty("icon")?this.cmdInsertBtn.icon:'',this.cmdDeleteBtnIcon=this.cmdDeleteBtn.hasOwnProperty("icon")?this.cmdDeleteBtn.icon:'',this.cmdSubmitBtnIcon=this.cmdSubmitBtn.hasOwnProperty("icon")?this.cmdSubmitBtn.icon:"",this.cmdCancelBtnIcon=this.cmdCancelBtn.hasOwnProperty("icon")?this.cmdCancelBtn.icon:"",this.cmdUpdateBtnCss=this.cmdUpdateBtn.hasOwnProperty("css")?this.cmdUpdateBtn.css:null,this.cmdInsertBtnCss=this.cmdInsertBtn.hasOwnProperty("css")?this.cmdInsertBtn.css:null,this.cmdDeleteBtnCss=this.cmdDeleteBtn.hasOwnProperty("css")?this.cmdDeleteBtn.css:null,this.cmdSubmitBtnCss=this.cmdSubmitBtn.hasOwnProperty("css")?this.cmdSubmitBtn.css:null,this.cmdCancelBtnCss=this.cmdCancelBtn.hasOwnProperty("css")?this.cmdCancelBtn.css:null,this.cmdUpdateBtnStyle=this.cmdUpdateBtn.hasOwnProperty("style")?this.cmdUpdateBtn.style:null,this.cmdInsertBtnStyle=this.cmdInsertBtn.hasOwnProperty("style")?this.cmdInsertBtn.style:null,this.cmdDeleteBtnStyle=this.cmdDeleteBtn.hasOwnProperty("style")?this.cmdDeleteBtn.style:null,this.cmdSubmitBtnStyle=this.cmdSubmitBtn.hasOwnProperty("style")?this.cmdSubmitBtn.style:null,this.cmdCancelBtnStyle=this.cmdCancelBtn.hasOwnProperty("style")?this.cmdCancelBtn.style:null,this.cmdInsertBtnScroll=this.cmdInsertBtn.hasOwnProperty("scrollIntoView")?this.cmdInsertBtn.scrollIntoView:!1,this.onEditableInit=this.IsFn(e.on_editable_initialized)?e.on_editable_initialized:null,this.onBeforeOpenEditor=this.IsFn(e.on_before_open_editor)?e.on_before_open_editor:null,this.onAfterOpenEditor=this.IsFn(e.on_after_open_editor)?e.on_after_open_editor:null,this.onBeforeCloseEditor=this.IsFn(e.on_before_close_editor)?e.on_before_close_editor:null,this.onAfterCloseEditor=this.IsFn(e.on_after_close_editor)?e.on_after_close_editor:null,this.setCustomEditorValue=this.IsFn(e.set_custom_editor_value)?e.set_custom_editor_value:null,this.getCustomEditorValue=this.IsFn(e.get_custom_editor_value)?e.get_custom_editor_value:null,this.setCellModifiedValue=this.IsFn(e.set_cell_modified_value)?e.set_cell_modified_value:null,this.validateModifiedValue=this.IsFn(e.validate_modified_value)?e.validate_modified_value:null,this.openCustomEditor=this.IsFn(e.open_custom_editor)?e.open_custom_editor:null,this.closeCustomEditor=this.IsFn(e.close_custom_editor)?e.close_custom_editor:null,this.onAddedDomRow=this.IsFn(e.on_added_dom_row)?e.on_added_dom_row:null,this.actions=this.IsObj(e.actions)?e.actions:{},this.updateConfig=void 0!==this.actions.update?this.actions.update:{},this.insertConfig=void 0!==this.actions.insert?this.actions.insert:{},this.deleteConfig=void 0!==this.actions["delete"]?this.actions["delete"]:{},this.updateURI=this.updateConfig.hasOwnProperty("uri")?this.updateConfig.uri:null,this.insertURI=this.insertConfig.hasOwnProperty("uri")?this.insertConfig.uri:null,this.deleteURI=this.deleteConfig.hasOwnProperty("uri")?this.deleteConfig.uri:null,this.updateFormMethod=this.updateConfig.hasOwnProperty("form_method")?this.updateConfig.form_method.LCase():"post",this.insertFormMethod=this.insertConfig.hasOwnProperty("form_method")?this.insertConfig.form_method.LCase():"post",this.deleteFormMethod=this.deleteConfig.hasOwnProperty("form_method")?this.deleteConfig.form_method.LCase():"post",this.updateSubmitMethod=this.updateConfig.hasOwnProperty("submit_method")?this.updateConfig.submit_method.LCase():this.ajax?"ajax":"form",this.insertSubmitMethod=this.insertConfig.hasOwnProperty("submit_method")?this.insertConfig.submit_method.LCase():this.ajax?"ajax":"form",this.deleteSubmitMethod=this.deleteConfig.hasOwnProperty("submit_method")?this.deleteConfig.submit_method.LCase():this.ajax?"ajax":"form",this.bulkDelete=this.deleteConfig.hasOwnProperty("bulk_delete")?this.deleteConfig.bulk_delete:!1,this.defaultRecord=this.insertConfig.hasOwnProperty("default_record")&&this.IsArray(this.insertConfig.default_record)?this.insertConfig.default_record:null,this.updateParams=this.updateConfig.hasOwnProperty("param_names")&&this.IsArray(this.updateConfig.param_names)?this.updateConfig.param_names:null,this.insertParams=this.insertConfig.hasOwnProperty("param_names")&&this.IsArray(this.insertConfig.param_names)?this.insertConfig.param_names:null,this.deleteParams=this.deleteConfig.hasOwnProperty("param_names")&&this.IsArray(this.deleteConfig.param_names)?this.deleteConfig.param_names:null,this.onUpdateSubmit=this.updateConfig.hasOwnProperty("on_update_submit")&&this.IsFn(this.updateConfig.on_update_submit)?this.updateConfig.on_update_submit:null,this.onInsertSubmit=this.insertConfig.hasOwnProperty("on_insert_submit")&&this.IsFn(this.insertConfig.on_insert_submit)?this.insertConfig.on_insert_submit:null,this.onDeleteSubmit=this.deleteConfig.hasOwnProperty("on_delete_submit")&&this.IsFn(this.deleteConfig.on_delete_submit)?this.deleteConfig.on_delete_submit:null,this.onBeforeUpdateSubmit=this.updateConfig.hasOwnProperty("on_before_submit")&&this.IsFn(this.updateConfig.on_before_submit)?this.updateConfig.on_before_submit:null,this.onBeforeInsertSubmit=this.insertConfig.hasOwnProperty("on_before_submit")&&this.IsFn(this.insertConfig.on_before_submit)?this.insertConfig.on_before_submit:null,this.onBeforeDeleteSubmit=this.deleteConfig.hasOwnProperty("on_before_submit")&&this.IsFn(this.deleteConfig.on_before_submit)?this.deleteConfig.on_before_submit:null,this.onAfterUpdateSubmit=this.updateConfig.hasOwnProperty("on_after_submit")&&this.IsFn(this.updateConfig.on_after_submit)?this.updateConfig.on_after_submit:null,this.onAfterInsertSubmit=this.insertConfig.hasOwnProperty("on_after_submit")&&this.IsFn(this.insertConfig.on_after_submit)?this.insertConfig.on_after_submit:null,this.onAfterDeleteSubmit=this.deleteConfig.hasOwnProperty("on_after_submit")&&this.IsFn(this.deleteConfig.on_after_submit)?this.deleteConfig.on_after_submit:null,this.onUpdateError=this.updateConfig.hasOwnProperty("on_submit_error")&&this.IsFn(this.updateConfig.on_submit_error)?this.updateConfig.on_submit_error:null,this.onInsertError=this.insertConfig.hasOwnProperty("on_submit_error")&&this.IsFn(this.insertConfig.on_submit_error)?this.insertConfig.on_submit_error:null,this.onDeleteError=this.deleteConfig.hasOwnProperty("on_submit_error")&&this.IsFn(this.deleteConfig.on_submit_error)?this.deleteConfig.on_submit_error:null,this.checkUpdateResponseSanity=this.updateConfig.hasOwnProperty("check_response_sanity")&&this.IsFn(this.updateConfig.check_response_sanity)?this.updateConfig.check_response_sanity:null,this.checkInsertResponseSanity=this.insertConfig.hasOwnProperty("check_response_sanity")&&this.IsFn(this.insertConfig.check_response_sanity)?this.insertConfig.check_response_sanity:null,this.checkDeleteResponseSanity=this.deleteConfig.hasOwnProperty("check_response_sanity")&&this.IsFn(this.deleteConfig.check_response_sanity)?this.deleteConfig.check_response_sanity:null,this.processUpdateResponse=this.updateConfig.hasOwnProperty("process_response")&&this.IsFn(this.updateConfig.process_response)?this.updateConfig.process_response:null,this.processInsertResponse=this.insertConfig.hasOwnProperty("process_response")&&this.IsFn(this.insertConfig.process_response)?this.insertConfig.process_response:null,this.processDeleteResponse=this.deleteConfig.hasOwnProperty("process_response")&&this.IsFn(this.deleteConfig.process_response)?this.deleteConfig.process_response:null,this.msgSubmitOK=void 0!==e.msg_submit_ok?e.msg_submit_ok:"Changes were successfully submitted to server!",this.msgConfirmDelSelectedRows=void 0!==e.msg_confirm_delete_selected_rows?e.msg_confirm_delete_selected_rows:"Do you want to delete the selected row(s)?",this.msgErrOccur=void 0!==e.msg_error_occured?e.msg_error_occured:"An error occured!",this.msgSaveUnsuccess=void 0!==e.msg_submit_unsuccessful?e.msg_submit_unsuccessful:"Changes could not be saved!",this.msgUndefinedSubmitUrl=void 0!==e.undefined_submit_url?e.undefined_submit_url:"Changes could not be saved! Endpoint URL is not defined",this.msgNewRowNoUploader=void 0!==e.msg_new_row_no_uploader?e.msg_new_row_no_uploader:"Please save the newly added rows before using the Uploader.",this.msgInvalidData=void 0!==e.msg_invalid_data?e.msg_invalid_data:"Returned data is invalid.",this.ifrmContainer={},this.valuesSeparator=", ",this.defaultRecordUndefinedValue="...",this.newRowClass="ezNewRow",this.recordKeyValue="new",this.attrValue="data-ez-slc-value",this.attrText="data-ez-slc-text",this.attrCont="data-ez-html",this.attrData="data-ez-data",this.attrUplname="data-ez-uplname",this.attrColIndex="data-ez-col-index",this.attrRowIndex="data-ez-row-index",this.savedRowsNb={insert:0,update:0,"delete":0},this.prfxEdt="edt_",this.prfxIFrm="iframe_",this.prfxFrm="form_",this.prfxScr="scr_",this.prfxParam="col_",this.prfxUplCont="upl_",this.prfxUplForm="upl_form_",this.prfxUplIframe="upl_ifrm_",this.prfxUplInfo="upl_info_",this.prfxUplOutput="upl_output_",this.prfxUplBtn="upl_btn_",this.prfxUplBtnClose="upl_btn_close_",this.prfxUplImgDisplay="upl_img_display_",this.prfxUplWinRef="et_upl_",this.uplFileInp="UPL_FILE",this.uplKeyInput="RECORD_KEY",this.uplFldPath="IMAGES_FOLDER_PATH",this.uplSqlFieldName="SQL_FIELD",this.uplFileSize="MAX_FILE_SIZE",this.uplValidExts="VALID_EXTENSIONS",this.uplJsCode="JS_CODE",this.Editable=new Editable(this),this.Selection=new Selection(this)}},Editable=function(a){this.o=a},Selection=function(a){this.o=a},Uploader=function(a,b){this.o=a,this.colIndex=b,window[this.o.prfxUplWinRef+b+this.o.id]=this};Uploader.prototype={divUpl:null,formUpl:null,fileUpl:null,hiddenFileSize:null,hiddenFolderPath:null,hiddenValidExt:null,hiddenKey:null,ifrmUpl:null,divUplInfo:null,divUplOutput:null,divUplBtnsCont:null,divUplBtn:null,divUplBtnClose:null,divUplDisplay:null,initialValue:null,isUploadSuccessful:!1,Init:function(){this.o.hasUploader&&this.SetUploader()},SetUploader:function(){this.divUpl=this.o.CreateElm("div",["id",this.o.prfxUplCont+this.colIndex+this.o.id],["style","display:none; z-index:10001;"],["class",this.o.uplCss[this.colIndex]]),this.formUpl=this.o.CreateElm("form",["id",this.o.prfxUplForm+this.colIndex+this.o.id],["name",this.o.prfxUplForm+this.colIndex+this.o.id],["method","POST"],["action",this.o.uplURI[this.colIndex]],["target",this.o.prfxUplIframe+this.colIndex+this.o.id],["enctype","multipart/form-data"]),this.fileUpl=this.o.CreateElm("input",["id",this.o.uplFileInp],["name",this.o.uplFileInp],["type","file"]),this.hiddenFileSize=this.o.CreateElm("input",["name",this.o.uplFileSize],["type","hidden"],["value",this.o.uplMaxFileSize[this.colIndex]]),this.hiddenFolderPath=this.o.CreateElm("input",["name",this.o.uplFldPath],["type","hidden"],["value",this.o.uplPath[this.colIndex]]),this.hiddenValidExt=this.o.CreateElm("input",["name",this.o.uplValidExts],["type","hidden"],["value",this.o.uplValidExt[this.colIndex]]),this.hiddenKey=this.o.CreateElm("input",["name",this.o.uplKeyInput],["type","hidden"],["value",this.o.recordKeyValue]),this.hiddenSqlField=this.o.CreateElm("input",["name",this.o.uplSqlFieldName],["type","hidden"],["value",this.o.uplSqlField[this.colIndex]]),this.hiddenUplWinRef=this.o.CreateElm("input",["name",this.o.uplJsCode],["type","hidden"],["value",this.o.uplJsSuccess[this.colIndex]]),this.ifrmUpl=this.o.CreateElm("iframe",["id",this.o.prfxUplIframe+this.colIndex+this.o.id],["name",this.o.prfxUplIframe+this.colIndex+this.o.id],["style","display:none; left:-10001;"]),this.divUplInfo=this.o.CreateElm("div",["id",this.o.prfxUplInfo+this.colIndex+this.o.id]),this.divUplOutput=this.o.CreateElm("div",["id",this.o.prfxUplOutput+this.colIndex+this.o.id],["class",this.o.uplOutputCss[this.colIndex]]),this.divUplBtnsCont=this.o.CreateElm("div",["style","text-align:right"]),this.divUplBtn=this.o.CreateElm("button",["id",this.o.prfxUplBtn+this.colIndex+this.o.id],["style","display:none;"]),this.divUplBtnClose=this.o.CreateElm("button",["id",this.o.prfxUplBtnClose+this.colIndex+this.o.id]),this.divUplDisplay=this.o.CreateElm("div",["id",this.o.prfxUplImgDisplay+this.colIndex+this.o.id],["class",this.o.uplDisplayCss[this.colIndex]]),this.o.Css.Has(this.divUpl,this.o.uplCss[this.colIndex])||(this.o.Css.Add(this.divUpl,this.o.uplCss[this.colIndex]),this.o.Css.Add(this.divUplOutput,this.o.uplOutputCss[this.colIndex]),this.o.Css.Add(this.divUplDisplay,this.o.uplDisplayCss[this.colIndex]),this.divUpl.style.cssText="display:none; z-index:10001;",this.divUplBtnsCont.style.cssText="text-align:right",this.divUplBtn.style.cssText="display:none;",this.formUpl=document.createElement('
'),this.ifrmUpl=document.createElement('')),this.divUplInfo.innerHTML=parseInt(this.o.uplMaxFileSize[this.colIndex]/1024,10)+"Kb max ("+this.o.uplValidExt[this.colIndex].toString()+")",this.divUplBtn.appendChild(this.o.CreateText("Upload")),this.divUplBtnClose.appendChild(this.o.CreateText("Close")),this.divUplBtnsCont.appendChild(this.divUplBtn),this.divUplBtnsCont.appendChild(this.divUplBtnClose),this.formUpl.appendChild(this.fileUpl),this.formUpl.appendChild(this.hiddenFileSize),this.formUpl.appendChild(this.hiddenFolderPath),this.formUpl.appendChild(this.hiddenUplWinRef),this.formUpl.appendChild(this.hiddenValidExt),this.formUpl.appendChild(this.hiddenKey),this.formUpl.appendChild(this.hiddenSqlField),this.divUpl.appendChild(this.formUpl),this.divUpl.appendChild(this.ifrmUpl),this.divUpl.appendChild(this.divUplInfo),this.divUpl.appendChild(this.divUplOutput),this.divUpl.appendChild(this.divUplBtnsCont),this.divUpl.appendChild(this.divUplDisplay),this.o.table.parentNode.insertBefore(this.divUpl,this.o.table);var a=this;this.ifrmUpl.onload=this.ifrmUpl.onreadystatechange=function(){if(!this.readyState||"loaded"==this.readyState||"complete"==this.readyState)try{var b=this.contentDocument||this.contentWindow.document;"about:blank"!=b.location.href&&(a.Output(b.body.innerHTML),a.iframe.src="about:blank",a.HideUploadButton())}catch(c){}},this.o.Event.Add(this.fileUpl,"click",function(){a.OnUplClick()}),this.o.Event.Add(this.divUplBtn,"click",function(){a.Upload()}),this.o.Event.Add(this.divUplBtnClose,"click",function(){a.Close(a.o.Selection.GetActiveRow().cells[a.colIndex])});var b=this.o.uplJsSuccess[this.colIndex].replace(/\{1\}/g,this.o.prfxUplWinRef+this.colIndex+this.o.id);this.hiddenUplWinRef.value=b},GetValue:function(){return this.fileUpl.value},HasValueChanged:function(){return this.initialValue!=this.GetValue()},OnUplClick:function(){this.ShowUploadButton()},Upload:function(){this.ShowLoader(),this.formUpl.submit()},SetRecordKey:function(a){this.hiddenKey.value=a},GetRecordKey:function(){return this.hiddenKey.value},ShowUploadButton:function(){this.divUplBtn.style.display="inline"},HideUploadButton:function(){this.divUplBtn.style.display="none"},ShowUploadContainer:function(){this.divUplDisplay.style.display="block"},HideUploadContainer:function(){this.divUplDisplay.style.display="none"},ShowUpload:function(){if(this.o.uplShowUpload[this.colIndex]){var a=this.o.Selection.GetActiveRow();if(this.o.showUpload[this.colIndex])return this.ShowUploadContainer(),void this.o.showUpload[this.colIndex].call(this,this.o,this.divUplDisplay,this.GetUploadName(),this.o.uplPath[this.colIndex]);if(a){var b=this.GetUploadName();b?(this.divUplDisplay.innerHTML=this.o.uplShowLink[this.colIndex]?this.GetUploadLinkHtml():''+b+'',this.ShowUploadContainer(),this.divUpl.scrollIntoView(!1)):this.ClearUpload()}}},ClearUpload:function(){this.divUplDisplay.innerHTML="",this.HideUploadContainer()},GetUploadName:function(){var a=this.o.Selection.GetActiveRow().cells[this.colIndex];return a?a.getAttribute(this.o.attrUplname):null},SetUploadName:function(a){var b=this.o.Selection.GetActiveRow().cells[this.colIndex];b&&b.setAttribute(this.o.attrUplname,a)},GetUploadLinkHtml:function(){var a=this.GetUploadName();return''+a.replace(this.GetRecordKey()+"_","")+""},Open:function(a){if(a){if(this.o.Css.Has(a.parentNode,this.o.newRowClass)||!a.parentNode.getAttribute("id"))return void alert(this.o.msgNewRowNoUploader);a.appendChild(this.divUpl),this.o.onBeforeOpenUploader[this.colIndex]&&this.o.onBeforeOpenUploader[this.colIndex].call(this,this.o,this.divUpl,a);var b=this.o.uplRecordIdColIndex[this.colIndex]?this.o.Selection.GetActiveRow()[this.o.uplRecordIdColIndex[this.colIndex]]:this.o.Selection.GetActiveRow().getAttribute("id").replace(this.o.newRowPrefix,"");""!==b&&(this.divUpl.style.display="",this.SetRecordKey(b),this.initialValue=this.GetValue(),this.SetUploadSuccess(!1),this.ShowUpload()),this.o.onAfterOpenUploader[this.colIndex]&&this.o.onAfterOpenUploader[this.colIndex].call(this,this.o,this.divUpl,a)}},Close:function(a){if("none"!=this.divUpl.style.display){if(this.o.onBeforeCloseUploader[this.colIndex]&&this.o.onBeforeCloseUploader[this.colIndex].call(this,this.o,this.divUpl,a),a&&this.IsUploadSuccessful())if(this.o.uplShowLink[this.colIndex]){var b=this.o.CreateElm("div");b.innerHTML=this.divUplDisplay.innerHTML,a.appendChild(b)}else{var c=this.o.Tag(a,"img")[0];c&&(c.src=this.o.uplOkImg[this.colIndex])}this.Output(""),this.SetRecordKey(""),this.ClearUpload(),this.HideUploadButton(),this.divUpl.style.display="none",this.o.StandardBody().appendChild(this.divUpl),this.o.onAfterCloseUploader[this.colIndex]&&this.o.onAfterCloseUploader[this.colIndex].call(this,this.o,this.divUpl,a)}},Output:function(a){this.divUplOutput.innerHTML=a},SetUploadSuccess:function(a){this.isUploadSuccessful=a},IsUploadSuccessful:function(){return this.isUploadSuccessful},ShowLoader:function(){this.Output('Please wait...')},HideLoader:function(){this.Output("")}},Editable.prototype={onEditAdded:!1,activeCellEditor:null,openCellEditor:null,activeRow:null,modifiedRows:[],newRows:[],addedRows:[],deletedRows:[],Init:function(){this.o.editable&&(this.SetEvents(),this.SetCellsEditor(),this.o.onEditableInit&&this.o.onEditableInit.call(null,this.o))},Set:function(){this.o.editable=!0,this.SetEvents()},Remove:function(){this.o.editable=!1,this.RemoveEvents()},SetEvents:function(){if(!this.onEditAdded){var a=this;this.o.Event.Bind(this.o.table,this.o.openEditorAction,function(b){a.Edit.call(a,b)}),this.onEditAdded=!0}},RemoveEvents:function(){if(this.onEditAdded){var a=this;this.o.Event.Unbind(this.o.table,this.o.openEditorAction,function(b){a.Edit.call(a,b)}),this.onEditAdded=!1}},SetCellsEditor:function(){for(var a=0;a0&&(m=this.o.Tag(d.cells[k],"input")[0].checked);var h=this.o.prfxParam+k;e.values.push(m),e.modified.push(a.cellIndex==k?!0:!1),e.urlParams+="&"+h+"="+encodeURIComponent(m)}this.modifiedRows.push([d.rowIndex,e])}}}},GetModifiedRow:function(a){if(void 0===a)return null;for(var b=0;b0?h=this.o.Tag(g,"input")[0].checked:this.o.IsEditorType(f,this.o.edtTypes.select)&&(h=g.getAttribute(this.o.attrValue));var i=this.o.prfxParam+f;e.values.push(h),e.modified.push("delete"==b?!1:!0),e.urlParams+="&"+i+"="+encodeURIComponent(h)}"delete"==b?this.deletedRows.push([d.rowIndex,e]):"insert"==b?this.addedRows.push([d.rowIndex,e]):this.modifiedRows.push([d.rowIndex,e])}}},GetDeletedRows:function(){return this.deletedRows},RemoveModifiedRow:function(a){if(void 0!==a)for(var b=0;b=-1&&(b=this.o.newRowPos);try{a=this.o.table.insertRow(b)}catch(c){a=this.o.table.insertRow(this.o.startRow),console.log(c)}a.setAttribute("id",this.o.CreateId()),this.o.Css.Add(a,this.o.newRowClass);for(var d=0;d=n.o.startRow?h-1:n.o.startRow),g&&(j=g.cellIndex),n.o.Selection.ClearSelections();for(var l=[],m=0;m0)alert(a.toUpperCase()+": "+this.o.msgUndefinedSubmitUrl),c=[],n.o.savedRowsNb[a]=0,b(!1);else{for(var o=0;oq)){var s=(r.values,r.urlParams),t=s.split("&"),u=this.o.table.rows[q].getAttribute("id");if(g&&this.o.IsArray(g)){for(var v=0;v')}catch(x){var y=this.o.CreateElm("iframe",["id",z],["name",z],["src","about:blank"],[this.o.attrRowIndex,q])}y.style.cssText="display:none; width:0; height:0;";for(var A=this.o.CreateElm("form",["id",this.o.prfxFrm+q+"_"+this.o.id+a],["method",f],["action",d],["target",z],["accept-charset","utf-8"]),v=1;v0&&this.o.ifrmContainer[a])for(var E=this.o.Tag(this.o.ifrmContainer[a],"iframe"),F=this.o.Tag(this.o.ifrmContainer[a],"form"),v=0;v0)this.SelectRow(b);else if(this.o.keySelection&&a.shiftKey&&this.selectedRows.length>0){if(!this.activeRow)return;var d=this.activeRow.rowIndex;this.SelectRow(b);var e=this.activeRow.rowIndex;if(e>d){for(var f=d+1;e>f;f++){var g=this.o.table.rows[f];g&&(this.IsRowSelected(g)?this.DeselectRow(g):this.SelectRow(g))}this.IsRowSelected(this.o.table.rows[d+1])||this.DeselectRow(this.o.table.rows[d])}else{for(var f=d-1;f>e;f--){var g=this.o.table.rows[f];g&&(this.IsRowSelected(g)?this.DeselectRow(g):this.SelectRow(g))}this.IsRowSelected(this.o.table.rows[d-1])||this.DeselectRow(this.o.table.rows[d])}this.SelectRow(b)}else this.SelectRow(b);else this.ClearSelections(),this.SelectRow(b);else this.selectedRows.length>0?this.IsRowSelected(b)?this.DeselectRow(b):this.SelectRow(b):this.SelectRow(b);this.DeselectCell(this.activeCell),this.IsRowSelected(b)&&this.SelectCell(c)}if(this.o.editable){if("cell"==this.o.editorModel){var h=this.o.Editable.activeCellEditor;!h&&c&&this.o.editors[c.cellIndex]&&this.o.IsEditorType(c.cellIndex,this.o.edtTypes.bool)&&"dblclick"===this.o.openEditorAction&&this.o.Editable.SetCheckBoxValue(a,c),h&&(this.o.IsEditorType(h.cellIndex,this.o.edtTypes.custom)||this.o.IsEditorType(h.cellIndex,this.o.edtTypes.uploader))&&(c&&c.cellIndex!=h.cellIndex||b.rowIndex!=h.parentNode.rowIndex)&&this.o.Editable.CloseCellEditor(h.cellIndex)}"row"==this.o.editorModel&&b!=this.o.Editable.activeRow&&this.o.Editable.CloseRowEditor()}}},OnKeyDown:function(a){function b(){j.o.editable&&l.activeCellEditor&&"cell"==j.o.editorModel&&l.CloseCellEditor(l.activeCellEditor.cellIndex),j.o.editable&&l.activeRow&&"row"==j.o.editorModel&&l.activeRow!=j.activeRow&&l.CloseRowEditor()}if(this.activeRow){var c=this.o.GetTableFromElement(this.activeRow);if(c&&"table"==c.nodeName.LCase()&&c.id==et_activeGrid){var d,e,f=this.o.Event.GetKey(a),g=this.o.table.rows.length-1,h=this.o.GetCellsNb()-1,i=this.activeRow.rowIndex,j=this,k=function(b){if(j.activeRow){var c=j.activeCell?j.activeCell.cellIndex:0;"single"==j.o.selectionModel||"multiple"==j.o.selectionModel&&!a.shiftKey||!j.o.keySelection?j.ClearSelections():"multiple"==j.o.selectionModel&&a.shiftKey&&j.DeselectCell(j.activeCell,a),e=c,"down"===b?d=g>i?i+1:g:"up"===b?d=i==j.o.startRow?j.o.startRow:i-1:"pgdown"===b?d=i+j.o.nbRowsPerPageh?0:c+1,c+1>h&&(d=g>i?i+1:g)):d=g>i?i+1:g:"left"===b&&("row"!=j.o.defaultSelection?(d=i,e=0>c-1?h:c-1,0>c-1&&(d=i==j.o.startRow?j.o.startRow:i-1)):d=i==j.o.startRow?j.o.startRow:i-1)}else d=j.o.startRow,e=0;var f=j.o.table.rows[d];if(j.o.keySelection&&a.shiftKey&&j.selectedRows.length>0&&("pgdown"==b||"pgup"==b||"home"==b||"end"==b)){if(!j.activeRow)return;if(d>i){for(var k=i+1;d>k;k++){var l=j.o.table.rows[k];l&&(j.IsRowSelected(l)?j.DeselectRow(l,a):j.SelectRow(l,a))}j.IsRowSelected(j.o.table.rows[i+1])||j.DeselectRow(j.o.table.rows[i],a)}else{for(var k=i-1;k>d;k--){var l=j.o.table.rows[k];l&&(j.IsRowSelected(l)?j.DeselectRow(l,a):j.SelectRow(l,a))}j.IsRowSelected(j.o.table.rows[i-1])||j.DeselectRow(j.o.table.rows[i],a)}j.SelectRow(f,a)}else j.o.keySelection&&a.shiftKey&&j.IsRowSelected(f)&&j.DeselectRow(j.o.table.rows[i],a),j.SelectRow(f,a);if("row"!=j.o.defaultSelection){var m=f.cells[e];j.SelectCell(m,a),j.o.scrollIntoView&&m.scrollIntoView(!1)}j.o.scrollIntoView&&"row"==j.o.defaultSelection&&f.scrollIntoView(!1),j.o.autoSave&&"row"===j.o.autoSaveModel&&d!==i&&j.o.Editable.AutoSubmit(),j.o.Event.Cancel(a)},l=this.o.Editable;switch(f){case 40:(!j.o.editable||j.o.editable&&!l.activeCellEditor&&!l.activeRow)&&k("down");break;case 38:(!j.o.editable||j.o.editable&&!l.activeCellEditor&&!l.activeRow)&&k("up");break;case 37:(!j.o.editable||j.o.editable&&!l.activeCellEditor&&!l.activeRow)&&k("left");break;case 39:(!j.o.editable||j.o.editable&&!l.activeCellEditor&&!l.activeRow)&&k("right");break;case 34:k("pgdown"),b();break;case 33:k("pgup"),b();break;case 36:k("home"),b();break;case 35:k("end"),b();break;case 9:k(a.shiftKey?"left":"right"),"row"==j.o.editorModel?(j.activeCell&&"row"!=j.selectionModel&&l.SetEditorFocus(j.activeCell.cellIndex),j.activeRow&&l.activeRow&&j.activeRow.rowIndex!=l.activeRow.rowIndex&&b()):b();break;case 13:j.o.editable?l.activeCellEditor?j.o.IsEditorType(l.activeCellEditor.cellIndex,j.o.edtTypes.input)&&b():(l.Edit.call(l,a),j.o.Event.Cancel(a)):j.o.onValidateRow||j.o.onValidateCell?(j.o.onValidateRow&&"cell"!=j.o.defaultSelection&&j.o.onValidateRow.call(null,j.o,j.activeRow),j.o.onValidateCell&&"row"!=j.o.defaultSelection&&j.o.onValidateCell.call(null,j.o,j.activeCell)):k("down");break;case 113:case 32:j.o.editable&&!l.activeCellEditor&&(l.Edit.call(l,a),j.o.Event.Cancel(a));break;case 45:j.o.editable&&!l.activeCellEditor&&(l.AddNewRow(),l.SetCommandEditor(j.o.editorCmdColIndex),j.o.Event.Cancel(a));break;case 46:j.o.editable&&!l.activeCellEditor&&(l.SubmitDeletedRows(),j.o.Event.Cancel(a));break;case 27:j.o.editable&&"cell"==j.o.editorModel&&l.activeCellEditor&&b(),j.o.editable&&"row"==j.o.editorModel&&b();break;default:j.o.editable&&j.o.editableOnKeystroke&&"cell"==j.o.editorModel&&"single"==j.o.selectionModel&&!l.activeCellEditor&&!l.activeRow&&(l.Edit.call(l,a),j.o.Event.Cancel(a)) -}j.o.editable&&"click"==j.o.openEditorAction&&l.Edit.call(l,a)}}}},EditTable.prototype={Init:function(){this.Css.Add(this.table,this.tableCss+" "+this.unselectableCss),this.Selection.Init(),this.Editable.Init()},GetCellsNb:function(a){var b=void 0===a?this.table.rows[this.startRow]:this.table.rows[a];return b.cells.length},GetRowsNb:function(){return this.table.rows.length},GetRow:function(a){return this.GetElement(a,"tr")},GetRowByIndex:function(a){return this.table.rows[a]},GetCell:function(a){return this.GetElement(a,"td")||this.GetElement(a,"th")},GetTableFromElement:function(a){if(!a)return null;for(;a.parentNode;){if("TABLE"===a.nodeName.UCase())return a;a=a.parentNode}return null},GetElement:function(a,b){for(var c,d=this.Event.GetElement(a);d.parentNode;){if(d.nodeName.UCase()===b.UCase()&&this.IsParentValid(d)){c=d;break}d=d.parentNode}return c},IsParentValid:function(a){for(;a.parentNode;){if("TABLE"===a.nodeName.UCase())return a.id==this.id?!0:!1;a=a.parentNode}return!1},IsSelectable:function(){return this.selection},IsEditable:function(){return this.editable},ClearSelections:function(){this.Selection.ClearSelections()},IsEditorType:function(a,b){return this.editorTypes[a]===b},IsObj:function(a){return a&&a.constructor==Object},IsFn:function(a){return a&&a.constructor==Function},IsArray:function(a){return a&&a.constructor==Array},Get:function(a){return document.getElementById(a)},Tag:function(a,b){return a?a.getElementsByTagName(b):null},GetText:function(a){if(!a)return"";var b=a.textContent||a.innerText||a.innerHTML.replace(/\<[^<>]+>/g,"");return b.replace(/^\s+/,"").replace(/\s+$/,"").Trim()},CreateElm:function(a){if(void 0!==a&&null!==a&&""!==a){var b=document.createElement(a);if(arguments.length>1)for(var c=0;cc?-1:c>d?1:0}}},"undefined"==typeof String.prototype.LCase&&(String.prototype.LCase=function(){return this.toLowerCase()}),"undefined"==typeof String.prototype.UCase&&(String.prototype.UCase=function(){return this.toUpperCase()}),"undefined"==typeof String.prototype.Trim&&(String.prototype.Trim=function(){return this.replace(/(^[\s\xA0]*)|([\s\xA0]*$)/g,"")}),"undefined"==typeof String.prototype.RegexpEscape&&(String.prototype.RegexpEscape=function(){function b(b){a=new RegExp("\\"+b,"g"),c=c.replace(a,"\\"+b)}var c=this;chars=new Array("\\","[","^","$",".","|","?","*","+","(",")","�");for(var d=0;dc;c++)if(this[c]===a)return c;return-1}); \ No newline at end of file diff --git a/libs/ezEditTable/themes/bg_mod_cell.png b/libs/ezEditTable/themes/bg_mod_cell.png deleted file mode 100644 index 6ab2c15f..00000000 Binary files a/libs/ezEditTable/themes/bg_mod_cell.png and /dev/null differ diff --git a/libs/ezEditTable/themes/default/ezDefault.css b/libs/ezEditTable/themes/default/ezDefault.css deleted file mode 100644 index d52393a3..00000000 --- a/libs/ezEditTable/themes/default/ezDefault.css +++ /dev/null @@ -1,23 +0,0 @@ -/*==================================================== - - ezEditTable default theme stylesheet - - Edit classes below for your project needs -=====================================================*/ - -.ezEditableTable{ - border:0 !important; - border-left:1px solid #99BBE8 !important; - border-right:1px solid #99BBE8 !important; - border-bottom:1px solid #99BBE8 !important; - font:12px/13px arial, tahoma, helvetica, sans-serif !important; -} -.ezEditableTable th, td{ border:1px solid #C5D3EC !important; } -.ezEditableTable th{ - background:transparent url(img/bg_col_header.gif) 0 -2px repeat-x !important; -} - -/* Selection */ -.ezActiveRow td{ background-color:#316AC5; color:#fff !important; } -.ezSelectedRow{ background-color:#D9E8FB !important; border:1px dotted #909090 !important; color:#000; } - -/* Command type editor */ -.ezCommandEditor button{ border:1px solid #C5D3EC !important; } \ No newline at end of file diff --git a/libs/ezEditTable/themes/default/img/bg_col_header.gif b/libs/ezEditTable/themes/default/img/bg_col_header.gif deleted file mode 100644 index be6c50e1..00000000 Binary files a/libs/ezEditTable/themes/default/img/bg_col_header.gif and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_add.gif b/libs/ezEditTable/themes/icn_add.gif deleted file mode 100644 index 77f6dcd4..00000000 Binary files a/libs/ezEditTable/themes/icn_add.gif and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_cross.png b/libs/ezEditTable/themes/icn_cross.png deleted file mode 100644 index 1514d51a..00000000 Binary files a/libs/ezEditTable/themes/icn_cross.png and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_del.gif b/libs/ezEditTable/themes/icn_del.gif deleted file mode 100644 index 697b0684..00000000 Binary files a/libs/ezEditTable/themes/icn_del.gif and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_edit.gif b/libs/ezEditTable/themes/icn_edit.gif deleted file mode 100644 index 2a72d103..00000000 Binary files a/libs/ezEditTable/themes/icn_edit.gif and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_save.gif b/libs/ezEditTable/themes/icn_save.gif deleted file mode 100644 index 44dcc1df..00000000 Binary files a/libs/ezEditTable/themes/icn_save.gif and /dev/null differ diff --git a/libs/ezEditTable/themes/icn_tick.png b/libs/ezEditTable/themes/icn_tick.png deleted file mode 100644 index a9925a06..00000000 Binary files a/libs/ezEditTable/themes/icn_tick.png and /dev/null differ diff --git a/libs/ezEditTable/themes/skyblue/ezSkyBlue.css b/libs/ezEditTable/themes/skyblue/ezSkyBlue.css deleted file mode 100644 index b65398f3..00000000 --- a/libs/ezEditTable/themes/skyblue/ezSkyBlue.css +++ /dev/null @@ -1,68 +0,0 @@ -/*==================================================== - - ezEditTable SkyBlue theme stylesheet - - Edit classes below for your project needs -=====================================================*/ - -.ezEditableTable{ - padding:0; color:#000; - font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; - border-right:1px solid #A4BED4; - border-top:1px solid #A4BED4; - border-left:1px solid #A4BED4; - border-bottom:0; -} -.ezEditableTable td{ - margin:0; padding:5px; color:inherit; - border-bottom:1px solid #A4BED4; - border-left:0; border-top:0; border-right:0; -} -.ezEditableTable th{ - margin:0; padding:5px; color:inherit; - background:#D1E5FE url("img/sky_blue_grid.gif") 0 0 repeat-x !important; - border-color:#FDFDFD #A4BED4 #A4BED4 #FDFDFD; - border-width:1px; border-style:solid; -} -.ezModifiedCell{ background:transparent url(../bg_mod_cell.png) 0 0 no-repeat !important; } - -/* Selection */ -.ezActiveRow td{ background:#D9E8FB; border-top:1px solid #FDFDFD; border-bottom:1px solid #A4BED4 !important; color:#000 !important; } -.ezSelectedRow{ background:#D1E5FE url("img/sky_blue_grid.gif") 0 0 repeat-x !important; color:#000; } -td.ezActiveCell{ - background-color:#fff !important; color:#000 !important; - font-weight:bold; font-style:italic; border-bottom:0; - border-top:1px solid #FDFDFD !important; - border-left:1px solid #A4BED4 !important; - border-right:1px solid #A4BED4 !important; -} -.ezUnselectable{ - -moz-user-select: -moz-none; - -khtml-user-select: none; - -webkit-user-select: none; - -o-user-select: none; - user-select: none; -} - -/* Editors */ -.ezInputEditor{ width:100%; height:auto; font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; border:0; } -.ezTextareaEditor{ width:100%; height:25px; font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; border:0; overflow:auto; } -.ezSelectEditor{ width:100%; font:12px/13px "Trebuchet MS", Verdana, Helvetica, Arial, sans-serif !important; border:1px solid #AACCF6; } -select[multiple="multiple"].ezSelectEditor{ height:35px; } - -/* Command type editor */ -.ezCommandEditor button{ - margin:2px !important; background:#D1E5FE; - border:1px solid #A4BED4; - font-size:12px !important; - border-radius:4px 4px 4px 4px; - -moz-border-radius:4px 4px 4px 4px; -} -.ezCommandEditor button img{ vertical-align:middle; margin:2px; } - -/* Utils */ -.ezOpacity{ - filter:alpha(opacity=60); /* for IE */ - opacity:0.6; /* CSS3 standard */ -} -.alignLeft{ text-align:left; } -.alignCenter{ text-align:center; } -.alignRight{ text-align:right; } \ No newline at end of file diff --git a/libs/ezEditTable/themes/skyblue/img/sky_blue_grid.gif b/libs/ezEditTable/themes/skyblue/img/sky_blue_grid.gif deleted file mode 100644 index 430aa245..00000000 Binary files a/libs/ezEditTable/themes/skyblue/img/sky_blue_grid.gif and /dev/null differ diff --git a/src/extensions/advancedGrid/adapterEzEditTable.js b/src/extensions/advancedGrid/adapterEzEditTable.js index e1e5c793..54173d1c 100644 --- a/src/extensions/advancedGrid/adapterEzEditTable.js +++ b/src/extensions/advancedGrid/adapterEzEditTable.js @@ -65,10 +65,7 @@ export default class AdapterEzEditTable { } cfg.base_path = cfg.base_path || tf.basePath + 'ezEditTable/'; - // var editable = tf.editable; var editable = cfg.editable; - // cfg.editable = editable; - // var selectable = tf.selectable; var selectable = cfg.selectable; cfg.selection = selectable; diff --git a/src/modules/help.js b/src/modules/help.js index 0c39d340..addc6291 100644 --- a/src/modules/help.js +++ b/src/modules/help.js @@ -24,10 +24,9 @@ export class Help{ 'operators:
<, <=, >, ' + '>=, =, *, !, {, }, ' + '||,&&, [empty], [nonempty], ' + - 'rgx:
Learn more:
' + + 'rgx:
' + 'https://github.com/' + - 'koalyptus/TableFilter/wiki/4.-Filter-operators
'; + '4.-Filter-operators" target="_blank">Learn more.
'; //defines help innerHtml this.instrHtml = f.help_instructions_html || null; //defines reset button text diff --git a/static/partials/countries-table-tiny.html b/static/partials/countries-table-tiny.html new file mode 100644 index 00000000..8b3ea8c8 --- /dev/null +++ b/static/partials/countries-table-tiny.html @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
countryisocodeyearPOPXRATPPPcgdpccci
BeninBEN19985950.33589.9517822190.951178.4690.987.55
BeninBEN19996109.53615.6990967200.191174.9092.617.86
BeninBEN20006272.00711.9763184200.611224.7492.278.25
Burkina FasoBFA19949755.03555.2047119125.76838.7679.816.57
Burkina FasoBFA19959988.00499.148407136.65860.8980.419.29
Burkina FasoBFA199610225.00511.5523987144.18881.1180.4012.12
Burkina FasoBFA199710473.53583.6693726141.78899.0176.9414.94
RussiaRUS1998146899.019.7050828932.647086.3967.739.20
RussiaRUS1999146308.9924.61993984.038074.7057.358.81
RussiaRUS2000145555.0128.129169464.859995.9154.748.79
RwandaRWA19946230.00194.51750.39529.48132.164.48
RwandaRWA19956400.00262.197509870.67746.3492.773.08
RwandaRWA19966727.00306.820007377.90823.2589.713.21
RwandaRWA19977895.18301.529785284.13847.7991.443.72
RwandaRWA19988105.00312.314086985.32914.2289.344.22
El SalvadorSLV19955669.008.7545833593.544143.5989.3110.35
El SalvadorSLV19965798.008.7550001143.694235.7988.777.79
El SalvadorSLV19975911.008.7562503813.744408.4187.057.90
Slovak RepublicSVK20005401.0046.035213.0212618.5352.2224.78
SloveniaSVN19941988.90128.808593879.9711662.1253.2119.87
SloveniaSVN19951990.00118.518501389.0312574.9654.4623.11
SloveniaSVN19961991.00135.364303697.2713151.5154.3223.23
SloveniaSVN19971985.96159.6882935103.9614143.0253.2424.14
SloveniaSVN19981982.60166.134201108.9315067.3452.8225.35
ZambiaZMB19948740.72669.3706055307.48834.1975.439.86
ZambiaZMB19958980.00864.1192017402.40829.3776.5510.31
ZambiaZMB19969214.401207.900024515.01838.0578.7410.99
ZambiaZMB19979443.211314.498047596.97851.4777.5912.15
ZambiaZMB19989665.711862.06897744.91800.6985.1213.75
ZambiaZMB19999881.212388.019043941.87765.2491.8215.30
ZambiaZMB200010089.003110.8439941157.63840.9786.3315.38
ZimbabweZWE199410775.358.1515388492.012586.8460.1018.53
ZimbabweZWE199511011.008.665375712.152603.3766.8915.03
ZimbabweZWE199611242.1610.002349852.642860.2372.0611.32
ZimbabweZWE199711923.5212.111289983.172727.0682.8211.01
ZimbabweZWE199812153.8523.679109574.062799.8577.6610.75
ZimbabweZWE199912388.3238.301200876.122770.4876.8910.73
ZimbabweZWE200012627.0044.417919169.482607.0369.238.62
diff --git a/static/style/tablefilter.css b/static/style/tablefilter.css index 7ea0de72..a079891c 100644 --- a/static/style/tablefilter.css +++ b/static/style/tablefilter.css @@ -283,7 +283,7 @@ div.grd_Cont .odd{ background-color:#DFE8F6; }/*row bg alternating color*/ /* Selection */ .ezActiveRow{ background-color:#2852A8 !important; color:#fff; } -.ezSelectedRow{ background-color:#316AC5; color:#fff; } +.ezSelectedRow{ background-color:#316AC5 !important; color:#fff; } .ezActiveCell{ background-color:#D9E8FB !important; color:#000 !important; font-weight:bold; diff --git a/static/templates/advanced-grid.html b/static/templates/advanced-grid.html new file mode 100644 index 00000000..82a85a90 --- /dev/null +++ b/static/templates/advanced-grid.html @@ -0,0 +1,94 @@ + + + + {NAME} v{VERSION} - Selection Grid Demo + + + +

{NAME} v{VERSION}

+

Selection grid demo

+ +

+ To make the grid rows selectable, you need to import the + {EZEDITTABLE_LINK} plugin, enable the selectable property + and configure the advancedGrid with the {EZEDITTABLE_LINK} + options. +

+ +

+ Instructions: Double-click on a row on or press enter key to + perform action. Enable multiple rows selection by checking the Multiple + selection checkbox. Keep Ctrl/Cmd or Shift key + pressed to select multiple rows. +

+ + +
+ + +
+ +
+ + + +
+ + + + + + diff --git a/static/templates/starter.html b/static/templates/starter.html new file mode 100644 index 00000000..e8d4349b --- /dev/null +++ b/static/templates/starter.html @@ -0,0 +1,60 @@ + + + + {NAME} v{VERSION} - Starter + + +

{NAME} v{VERSION}

+ + + + + + + + +

+
+
+
+