@nativescript/core 8.2.0-custom.1 → 8.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/accessibility/accessibility-service.android.js +11 -9
  2. package/accessibility/accessibility-service.android.js.map +1 -1
  3. package/accessibility/index.android.js +16 -15
  4. package/accessibility/index.android.js.map +1 -1
  5. package/application/application-common.d.ts +2 -0
  6. package/application/application-common.js +2 -0
  7. package/application/application-common.js.map +1 -1
  8. package/application/index.android.d.ts +14 -1
  9. package/application/index.android.js +36 -2
  10. package/application/index.android.js.map +1 -1
  11. package/application/index.d.ts +37 -0
  12. package/application/index.ios.d.ts +7 -1
  13. package/application/index.ios.js +63 -14
  14. package/application/index.ios.js.map +1 -1
  15. package/color/color-common.js +4 -2
  16. package/color/color-common.js.map +1 -1
  17. package/config/config.interface.d.ts +9 -1
  18. package/connectivity/index.ios.js +1 -0
  19. package/connectivity/index.ios.js.map +1 -1
  20. package/css/parser.js +0 -1
  21. package/css/parser.js.map +1 -1
  22. package/debugger/webinspector-network.ios.js.map +1 -1
  23. package/file-system/file-system-access.android.d.ts +57 -1
  24. package/file-system/file-system-access.android.js +293 -0
  25. package/file-system/file-system-access.android.js.map +1 -1
  26. package/file-system/file-system-access.d.ts +73 -1
  27. package/file-system/index.js +18 -16
  28. package/file-system/index.js.map +1 -1
  29. package/global-types.d.ts +1 -0
  30. package/image-asset/index.ios.js +7 -12
  31. package/image-asset/index.ios.js.map +1 -1
  32. package/image-source/index.ios.js +20 -17
  33. package/image-source/index.ios.js.map +1 -1
  34. package/index.d.ts +8 -4
  35. package/index.js +14 -4
  36. package/index.js.map +1 -1
  37. package/module-name-resolver/qualifier-matcher/index.js +6 -4
  38. package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
  39. package/package.json +44 -29
  40. package/platforms/android/res/values/ids.xml +4 -0
  41. package/platforms/android/widgets-release.aar +0 -0
  42. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
  43. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
  44. package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  45. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
  46. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
  47. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +1 -1
  48. package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
  49. package/platforms/ios/src/NativeScriptUtils.h +16 -0
  50. package/platforms/ios/src/NativeScriptUtils.m +134 -0
  51. package/platforms/ios/src/UIView+NativeScript.h +13 -0
  52. package/platforms/ios/src/UIView+NativeScript.m +127 -0
  53. package/platforms/ios/src/module.modulemap +10 -0
  54. package/platforms/ios/typings/objc!NativeScriptUtils.d.ts +19 -0
  55. package/references.d.ts +5 -1
  56. package/ui/action-bar/index.android.d.ts +2 -0
  57. package/ui/action-bar/index.android.js +30 -1
  58. package/ui/action-bar/index.android.js.map +1 -1
  59. package/ui/animation/index.android.js +40 -62
  60. package/ui/animation/index.android.js.map +1 -1
  61. package/ui/animation/index.ios.js +10 -1
  62. package/ui/animation/index.ios.js.map +1 -1
  63. package/ui/animation/keyframe-animation.js +1 -2
  64. package/ui/animation/keyframe-animation.js.map +1 -1
  65. package/ui/builder/binding-builder.js +1 -1
  66. package/ui/builder/binding-builder.js.map +1 -1
  67. package/ui/button/button-common.js.map +1 -1
  68. package/ui/button/index.android.d.ts +2 -0
  69. package/ui/button/index.android.js +26 -0
  70. package/ui/button/index.android.js.map +1 -1
  71. package/ui/core/bindable/bindable-expressions.d.ts +7 -0
  72. package/ui/core/bindable/bindable-expressions.js +257 -0
  73. package/ui/core/bindable/bindable-expressions.js.map +1 -0
  74. package/ui/core/bindable/index.js +41 -33
  75. package/ui/core/bindable/index.js.map +1 -1
  76. package/ui/core/view/index.android.d.ts +5 -0
  77. package/ui/core/view/index.android.js +112 -9
  78. package/ui/core/view/index.android.js.map +1 -1
  79. package/ui/core/view/index.d.ts +10 -2
  80. package/ui/core/view/index.ios.d.ts +1 -0
  81. package/ui/core/view/index.ios.js +17 -3
  82. package/ui/core/view/index.ios.js.map +1 -1
  83. package/ui/core/view/view-common.d.ts +9 -2
  84. package/ui/core/view/view-common.js +47 -1
  85. package/ui/core/view/view-common.js.map +1 -1
  86. package/ui/core/view-base/index.d.ts +10 -0
  87. package/ui/core/view-base/index.js +5 -1
  88. package/ui/core/view-base/index.js.map +1 -1
  89. package/ui/date-picker/date-picker-common.d.ts +8 -0
  90. package/ui/date-picker/date-picker-common.js +25 -0
  91. package/ui/date-picker/date-picker-common.js.map +1 -1
  92. package/ui/date-picker/index.android.d.ts +2 -0
  93. package/ui/date-picker/index.android.js +30 -3
  94. package/ui/date-picker/index.android.js.map +1 -1
  95. package/ui/date-picker/index.ios.js +49 -8
  96. package/ui/date-picker/index.ios.js.map +1 -1
  97. package/ui/frame/fragment.android.js +3 -0
  98. package/ui/frame/fragment.android.js.map +1 -1
  99. package/ui/frame/fragment.transitions.android.d.ts +1 -0
  100. package/ui/frame/fragment.transitions.android.js +25 -28
  101. package/ui/frame/fragment.transitions.android.js.map +1 -1
  102. package/ui/frame/fragment.transitions.ios.js +3 -3
  103. package/ui/frame/frame-common.js.map +1 -1
  104. package/ui/frame/index.android.d.ts +1 -0
  105. package/ui/frame/index.android.js +45 -5
  106. package/ui/frame/index.android.js.map +1 -1
  107. package/ui/frame/index.d.ts +1 -0
  108. package/ui/frame/index.ios.js +8 -8
  109. package/ui/gestures/gestures-common.d.ts +6 -0
  110. package/ui/gestures/gestures-common.js +7 -0
  111. package/ui/gestures/gestures-common.js.map +1 -1
  112. package/ui/gestures/index.android.js +16 -6
  113. package/ui/gestures/index.android.js.map +1 -1
  114. package/ui/gestures/index.d.ts +21 -0
  115. package/ui/gestures/index.ios.js +9 -2
  116. package/ui/gestures/index.ios.js.map +1 -1
  117. package/ui/gestures/touch-manager.d.ts +53 -0
  118. package/ui/gestures/touch-manager.js +205 -0
  119. package/ui/gestures/touch-manager.js.map +1 -0
  120. package/ui/image/image-common.d.ts +1 -0
  121. package/ui/image/image-common.js +4 -0
  122. package/ui/image/image-common.js.map +1 -1
  123. package/ui/image/index.ios.d.ts +2 -0
  124. package/ui/image/index.ios.js +64 -27
  125. package/ui/image/index.ios.js.map +1 -1
  126. package/ui/index.d.ts +2 -2
  127. package/ui/index.js +1 -1
  128. package/ui/index.js.map +1 -1
  129. package/ui/layouts/root-layout/index.android.js +17 -2
  130. package/ui/layouts/root-layout/index.android.js.map +1 -1
  131. package/ui/layouts/root-layout/index.d.ts +2 -0
  132. package/ui/layouts/root-layout/index.ios.d.ts +3 -0
  133. package/ui/layouts/root-layout/index.ios.js +30 -9
  134. package/ui/layouts/root-layout/index.ios.js.map +1 -1
  135. package/ui/layouts/root-layout/root-layout-common.d.ts +5 -2
  136. package/ui/layouts/root-layout/root-layout-common.js +76 -62
  137. package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
  138. package/ui/list-view/list-view-common.js.map +1 -1
  139. package/ui/page/page-common.js.map +1 -1
  140. package/ui/placeholder/index.android.js.map +1 -1
  141. package/ui/repeater/index.js.map +1 -1
  142. package/ui/scroll-view/index.android.js +2 -1
  143. package/ui/scroll-view/index.android.js.map +1 -1
  144. package/ui/scroll-view/scroll-view-common.js.map +1 -1
  145. package/ui/search-bar/search-bar-common.js.map +1 -1
  146. package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
  147. package/ui/slider/slider-common.js.map +1 -1
  148. package/ui/styling/background-common.d.ts +1 -2
  149. package/ui/styling/background-common.js.map +1 -1
  150. package/ui/styling/background.android.d.ts +1 -3
  151. package/ui/styling/background.android.js +2 -124
  152. package/ui/styling/background.android.js.map +1 -1
  153. package/ui/styling/background.d.ts +60 -56
  154. package/ui/styling/background.ios.js +3 -34
  155. package/ui/styling/background.ios.js.map +1 -1
  156. package/ui/styling/css-animation-parser.js +1 -1
  157. package/ui/styling/css-animation-parser.js.map +1 -1
  158. package/ui/styling/css-selector/index.js +2 -2
  159. package/ui/styling/css-selector/index.js.map +1 -1
  160. package/ui/styling/font-common.js +5 -10
  161. package/ui/styling/font-common.js.map +1 -1
  162. package/ui/styling/font.ios.js +9 -91
  163. package/ui/styling/font.ios.js.map +1 -1
  164. package/ui/styling/linear-gradient.d.ts +7 -2
  165. package/ui/styling/linear-gradient.js.map +1 -1
  166. package/ui/styling/style-properties.js +3 -3
  167. package/ui/styling/style-properties.js.map +1 -1
  168. package/ui/switch/index.android.js +5 -2
  169. package/ui/switch/index.android.js.map +1 -1
  170. package/ui/switch/index.ios.d.ts +2 -0
  171. package/ui/switch/index.ios.js +61 -7
  172. package/ui/switch/index.ios.js.map +1 -1
  173. package/ui/switch/switch-common.js +6 -1
  174. package/ui/switch/switch-common.js.map +1 -1
  175. package/ui/tab-view/index.android.d.ts +1 -0
  176. package/ui/tab-view/index.android.js +23 -3
  177. package/ui/tab-view/index.android.js.map +1 -1
  178. package/ui/tab-view/index.d.ts +9 -0
  179. package/ui/tab-view/index.ios.d.ts +13 -3
  180. package/ui/tab-view/index.ios.js +47 -40
  181. package/ui/tab-view/index.ios.js.map +1 -1
  182. package/ui/tab-view/tab-view-common.d.ts +2 -0
  183. package/ui/tab-view/tab-view-common.js +2 -0
  184. package/ui/tab-view/tab-view-common.js.map +1 -1
  185. package/ui/text-base/index.android.js +19 -13
  186. package/ui/text-base/index.android.js.map +1 -1
  187. package/ui/text-base/index.ios.d.ts +7 -6
  188. package/ui/text-base/index.ios.js +69 -193
  189. package/ui/text-base/index.ios.js.map +1 -1
  190. package/ui/text-field/index.android.js +1 -1
  191. package/ui/text-field/index.android.js.map +1 -1
  192. package/ui/text-field/text-field-common.js.map +1 -1
  193. package/ui/time-picker/index.ios.js +1 -1
  194. package/ui/time-picker/index.ios.js.map +1 -1
  195. package/ui/utils.d.ts +31 -1
  196. package/ui/utils.ios.d.ts +16 -0
  197. package/ui/utils.ios.js +41 -0
  198. package/ui/utils.ios.js.map +1 -1
  199. package/ui/web-view/web-view-common.js.map +1 -1
  200. package/utils/index.d.ts +21 -0
  201. package/utils/native-helper.android.js +7 -1
  202. package/utils/native-helper.android.js.map +1 -1
  203. package/utils/utils-common.d.ts +3 -0
  204. package/utils/utils-common.js +30 -0
  205. package/utils/utils-common.js.map +1 -1
  206. package/js-libs/esprima/esprima.d.ts +0 -266
  207. package/js-libs/esprima/esprima.js +0 -1042
  208. package/js-libs/esprima/package.json +0 -75
  209. package/js-libs/polymer-expressions/package.json +0 -6
  210. package/js-libs/polymer-expressions/path-parser.js +0 -393
  211. package/js-libs/polymer-expressions/polymer-expressions.d.ts +0 -14
  212. package/js-libs/polymer-expressions/polymer-expressions.js +0 -541
  213. package/ui/styling/gradient.d.ts +0 -17
@@ -1,75 +0,0 @@
1
- {
2
- "name": "esprima",
3
- "description": "ECMAScript parsing infrastructure for multipurpose analysis",
4
- "homepage": "http://esprima.org",
5
- "main": "esprima",
6
- "sideEffects": false,
7
- "types": "esprima.d.ts",
8
- "bin": {
9
- "esparse": "./bin/esparse.js",
10
- "esvalidate": "./bin/esvalidate.js"
11
- },
12
- "version": "2.0.0-dev",
13
- "engines": {
14
- "node": ">=0.4.0"
15
- },
16
- "author": {
17
- "name": "Ariya Hidayat",
18
- "email": "ariya.hidayat@gmail.com"
19
- },
20
- "maintainers": [
21
- {
22
- "name": "Ariya Hidayat",
23
- "email": "ariya.hidayat@gmail.com",
24
- "web": "http://ariya.ofilabs.com"
25
- }
26
- ],
27
- "repository": {
28
- "type": "git",
29
- "url": "https://github.com/ariya/esprima.git"
30
- },
31
- "bugs": {
32
- "url": "http://issues.esprima.org"
33
- },
34
- "licenses": [
35
- {
36
- "type": "BSD",
37
- "url": "https://github.com/ariya/esprima/raw/master/LICENSE.BSD"
38
- }
39
- ],
40
- "devDependencies": {
41
- "jslint": "~0.1.9",
42
- "eslint": "~5.16.0",
43
- "jscs": "~1.2.4",
44
- "istanbul": "~0.2.6",
45
- "complexity-report": "~0.6.1",
46
- "regenerate": "~0.6.2",
47
- "unicode-7.0.0": "~0.1.5",
48
- "json-diff": "~0.3.1",
49
- "optimist": "~0.6.0"
50
- },
51
- "keywords": [
52
- "ast",
53
- "ecmascript",
54
- "javascript",
55
- "parser",
56
- "syntax"
57
- ],
58
- "scripts": {
59
- "generate-regex": "node tools/generate-identifier-regex.js",
60
- "test": "npm run-script lint && node test/run.js && npm run-script coverage && npm run-script complexity",
61
- "lint": "npm run-script check-version && npm run-script eslint && npm run-script jscs && npm run-script jslint",
62
- "check-version": "node tools/check-version.js",
63
- "eslint": "node node_modules/eslint/bin/eslint.js esprima.js",
64
- "jscs": "node node_modules/jscs/bin/jscs esprima.js",
65
- "jslint": "node node_modules/jslint/bin/jslint.js esprima.js",
66
- "coverage": "npm run-script analyze-coverage && npm run-script check-coverage",
67
- "analyze-coverage": "node node_modules/istanbul/lib/cli.js cover test/runner.js",
68
- "check-coverage": "node node_modules/istanbul/lib/cli.js check-coverage --statement 100 --branch 100 --function 100",
69
- "complexity": "npm run-script analyze-complexity && npm run-script check-complexity",
70
- "analyze-complexity": "node tools/list-complexity.js",
71
- "check-complexity": "node node_modules/complexity-report/src/cli.js --maxcc 15 --silent -l -w esprima.js",
72
- "benchmark": "node test/benchmarks.js",
73
- "benchmark-quick": "node test/benchmarks.js quick"
74
- }
75
- }
@@ -1,6 +0,0 @@
1
- {
2
- "sideEffects": false,
3
- "name": "polymer-expressions",
4
- "main": "polymer-expressions",
5
- "types": "polymer-expressions.d.ts"
6
- }
@@ -1,393 +0,0 @@
1
- /*
2
- * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3
- * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
4
- * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
5
- * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
6
- * Code distributed by Google as part of the polymer project is also
7
- * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
8
- */
9
-
10
- 'use strict';
11
-
12
- function detectEval() {
13
- // Don't test for eval if we're running in a Chrome App environment.
14
- // We check for APIs set that only exist in a Chrome App context.
15
- if (typeof chrome !== 'undefined' && chrome.app && chrome.app.runtime) {
16
- return false;
17
- }
18
-
19
- // Firefox OS Apps do not allow eval. This feature detection is very hacky
20
- // but even if some other platform adds support for this function this code
21
- // will continue to work.
22
- if (typeof navigator != 'undefined' && navigator.getDeviceStorage) {
23
- return false;
24
- }
25
-
26
- try {
27
- var f = new Function('', 'return true;');
28
- return f();
29
- } catch (ex) {
30
- return false;
31
- }
32
- }
33
-
34
- var hasEval = detectEval();
35
-
36
- function isIndex(s) {
37
- return +s === s >>> 0 && s !== '';
38
- }
39
-
40
- function toNumber(s) {
41
- return +s;
42
- }
43
-
44
- function isObject(obj) {
45
- return obj === Object(obj);
46
- }
47
-
48
- var numberIsNaN = Number.isNaN || function (value) {
49
- return typeof value === 'number' && isNaN(value);
50
- }
51
-
52
- function areSameValue(left, right) {
53
- if (left === right)
54
- return left !== 0 || 1 / left === 1 / right;
55
- if (numberIsNaN(left) && numberIsNaN(right))
56
- return true;
57
-
58
- return left !== left && right !== right;
59
- }
60
-
61
- var createObject = ('__proto__' in {}) ?
62
- function (obj) { return obj; } :
63
- function (obj) {
64
- var proto = obj.__proto__;
65
- if (!proto)
66
- return obj;
67
- var newObject = Object.create(proto);
68
- Object.getOwnPropertyNames(obj).forEach(function (name) {
69
- Object.defineProperty(newObject, name,
70
- Object.getOwnPropertyDescriptor(obj, name));
71
- });
72
- return newObject;
73
- };
74
-
75
- var identStart = '[\$_a-zA-Z]';
76
- var identPart = '[\$_a-zA-Z0-9]';
77
- var identRegExp = new RegExp('^' + identStart + '+' + identPart + '*' + '$');
78
-
79
- function getPathCharType(char) {
80
- if (char === undefined)
81
- return 'eof';
82
-
83
- var code = char.charCodeAt(0);
84
-
85
- switch (code) {
86
- case 0x5B: // [
87
- case 0x5D: // ]
88
- case 0x2E: // .
89
- case 0x22: // "
90
- case 0x27: // '
91
- case 0x30: // 0
92
- return char;
93
-
94
- case 0x5F: // _
95
- case 0x24: // $
96
- return 'ident';
97
-
98
- case 0x20: // Space
99
- case 0x09: // Tab
100
- case 0x0A: // Newline
101
- case 0x0D: // Return
102
- case 0xA0: // No-break space
103
- case 0xFEFF: // Byte Order Mark
104
- case 0x2028: // Line Separator
105
- case 0x2029: // Paragraph Separator
106
- return 'ws';
107
- }
108
-
109
- // a-z, A-Z
110
- if ((0x61 <= code && code <= 0x7A) || (0x41 <= code && code <= 0x5A))
111
- return 'ident';
112
-
113
- // 1-9
114
- if (0x31 <= code && code <= 0x39)
115
- return 'number';
116
-
117
- return 'else';
118
- }
119
-
120
- var pathStateMachine = {
121
- 'beforePath': {
122
- 'ws': ['beforePath'],
123
- 'ident': ['inIdent', 'append'],
124
- '[': ['beforeElement'],
125
- 'eof': ['afterPath']
126
- },
127
-
128
- 'inPath': {
129
- 'ws': ['inPath'],
130
- '.': ['beforeIdent'],
131
- '[': ['beforeElement'],
132
- 'eof': ['afterPath']
133
- },
134
-
135
- 'beforeIdent': {
136
- 'ws': ['beforeIdent'],
137
- 'ident': ['inIdent', 'append']
138
- },
139
-
140
- 'inIdent': {
141
- 'ident': ['inIdent', 'append'],
142
- '0': ['inIdent', 'append'],
143
- 'number': ['inIdent', 'append'],
144
- 'ws': ['inPath', 'push'],
145
- '.': ['beforeIdent', 'push'],
146
- '[': ['beforeElement', 'push'],
147
- 'eof': ['afterPath', 'push']
148
- },
149
-
150
- 'beforeElement': {
151
- 'ws': ['beforeElement'],
152
- '0': ['afterZero', 'append'],
153
- 'number': ['inIndex', 'append'],
154
- "'": ['inSingleQuote', 'append', ''],
155
- '"': ['inDoubleQuote', 'append', '']
156
- },
157
-
158
- 'afterZero': {
159
- 'ws': ['afterElement', 'push'],
160
- ']': ['inPath', 'push']
161
- },
162
-
163
- 'inIndex': {
164
- '0': ['inIndex', 'append'],
165
- 'number': ['inIndex', 'append'],
166
- 'ws': ['afterElement'],
167
- ']': ['inPath', 'push']
168
- },
169
-
170
- 'inSingleQuote': {
171
- "'": ['afterElement'],
172
- 'eof': ['error'],
173
- 'else': ['inSingleQuote', 'append']
174
- },
175
-
176
- 'inDoubleQuote': {
177
- '"': ['afterElement'],
178
- 'eof': ['error'],
179
- 'else': ['inDoubleQuote', 'append']
180
- },
181
-
182
- 'afterElement': {
183
- 'ws': ['afterElement'],
184
- ']': ['inPath', 'push']
185
- }
186
- }
187
-
188
- function noop() { }
189
-
190
- function parsePath(path) {
191
- var keys = [];
192
- var index = -1;
193
- var c, newChar, key, type, transition, action, typeMap, mode = 'beforePath';
194
-
195
- var actions = {
196
- push: function () {
197
- if (key === undefined)
198
- return;
199
-
200
- keys.push(key);
201
- key = undefined;
202
- },
203
-
204
- append: function () {
205
- if (key === undefined)
206
- key = newChar
207
- else
208
- key += newChar;
209
- }
210
- };
211
-
212
- function maybeUnescapeQuote() {
213
- if (index >= path.length)
214
- return;
215
-
216
- var nextChar = path[index + 1];
217
- if ((mode == 'inSingleQuote' && nextChar == "'") ||
218
- (mode == 'inDoubleQuote' && nextChar == '"')) {
219
- index++;
220
- newChar = nextChar;
221
- actions.append();
222
- return true;
223
- }
224
- }
225
-
226
- while (mode) {
227
- index++;
228
- c = path[index];
229
-
230
- if (c == '\\' && maybeUnescapeQuote(mode))
231
- continue;
232
-
233
- type = getPathCharType(c);
234
- typeMap = pathStateMachine[mode];
235
- transition = typeMap[type] || typeMap['else'] || 'error';
236
-
237
- if (transition == 'error')
238
- return; // parse error;
239
-
240
- mode = transition[0];
241
- action = actions[transition[1]] || noop;
242
- newChar = transition[2] === undefined ? c : transition[2];
243
- action();
244
-
245
- if (mode === 'afterPath') {
246
- return keys;
247
- }
248
- }
249
-
250
- return; // parse error
251
- }
252
-
253
- function isIdent(s) {
254
- return identRegExp.test(s);
255
- }
256
-
257
- var constructorIsPrivate = {};
258
-
259
- function Path(parts, privateToken) {
260
- if (privateToken !== constructorIsPrivate)
261
- throw Error('Use Path.get to retrieve path objects');
262
-
263
- for (var i = 0; i < parts.length; i++) {
264
- this.push(String(parts[i]));
265
- }
266
-
267
- if (hasEval && this.length) {
268
- this.getValueFrom = this.compiledGetValueFromFn();
269
- }
270
- }
271
-
272
- // TODO(rafaelw): Make simple LRU cache
273
- var pathCache = {};
274
-
275
- function getPath(pathString) {
276
- if (pathString instanceof Path)
277
- return pathString;
278
-
279
- if (pathString == null || pathString.length == 0)
280
- pathString = '';
281
-
282
- if (typeof pathString != 'string') {
283
- if (isIndex(pathString.length)) {
284
- // Constructed with array-like (pre-parsed) keys
285
- return new Path(pathString, constructorIsPrivate);
286
- }
287
-
288
- pathString = String(pathString);
289
- }
290
-
291
- var path = pathCache[pathString];
292
- if (path)
293
- return path;
294
-
295
- var parts = parsePath(pathString);
296
- if (!parts)
297
- return invalidPath;
298
-
299
- var path = new Path(parts, constructorIsPrivate);
300
- pathCache[pathString] = path;
301
- return path;
302
- }
303
-
304
- Path.get = getPath;
305
-
306
- function formatAccessor(key) {
307
- if (isIndex(key)) {
308
- return '[' + key + ']';
309
- } else {
310
- return '["' + key.replace(/"/g, '\\"') + '"]';
311
- }
312
- }
313
-
314
- Path.prototype = createObject({
315
- __proto__: [],
316
- valid: true,
317
-
318
- toString: function () {
319
- var pathString = '';
320
- for (var i = 0; i < this.length; i++) {
321
- var key = this[i];
322
- if (isIdent(key)) {
323
- pathString += i ? '.' + key : key;
324
- } else {
325
- pathString += formatAccessor(key);
326
- }
327
- }
328
-
329
- return pathString;
330
- },
331
-
332
- getValueFrom: function (obj, directObserver) {
333
- for (var i = 0; i < this.length; i++) {
334
- if (obj == null)
335
- return;
336
- obj = obj[this[i]];
337
- }
338
- return obj;
339
- },
340
-
341
- iterateObjects: function (obj, observe) {
342
- for (var i = 0; i < this.length; i++) {
343
- if (i)
344
- obj = obj[this[i - 1]];
345
- if (!isObject(obj))
346
- return;
347
- observe(obj, this[i]);
348
- }
349
- },
350
-
351
- compiledGetValueFromFn: function () {
352
- var str = '';
353
- var pathString = 'obj';
354
- str += 'if (obj != null';
355
- var i = 0;
356
- var key;
357
- for (; i < (this.length - 1) ; i++) {
358
- key = this[i];
359
- pathString += isIdent(key) ? '.' + key : formatAccessor(key);
360
- str += ' &&\n ' + pathString + ' != null';
361
- }
362
- str += ')\n';
363
-
364
- var key = this[i];
365
- pathString += isIdent(key) ? '.' + key : formatAccessor(key);
366
-
367
- str += ' return ' + pathString + ';\nelse\n return undefined;';
368
- return new Function('obj', str);
369
- },
370
-
371
- setValueFrom: function (obj, value) {
372
- if (!this.length)
373
- return false;
374
-
375
- for (var i = 0; i < this.length - 1; i++) {
376
- if (!isObject(obj))
377
- return false;
378
- obj = obj[this[i]];
379
- }
380
-
381
- if (!isObject(obj))
382
- return false;
383
-
384
- obj[this[i]] = value;
385
- return true;
386
- }
387
- });
388
-
389
- var invalidPath = new Path('', constructorIsPrivate);
390
- invalidPath.valid = false;
391
- invalidPath.getValueFrom = invalidPath.setValueFrom = function () { };
392
-
393
- exports.Path = Path;
@@ -1,14 +0,0 @@
1
- //@private
2
- export class PolymerExpressions {
3
- static getExpression(expression: string): Expression;
4
- }
5
-
6
- export class Expression {
7
- /**
8
- * Evaluates a value for an expression.
9
- * @param model - Context of the expression.
10
- * @param isBackConvert - Denotes if the convertion is forward (from model to ui) or back (ui to model).
11
- * @param changedModel - A property bag which contains all changed properties (in case of two way binding).
12
- */
13
- getValue(model, isBackConvert, changedModel);
14
- }