expensify-common 1.0.1 → 2.0.2
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.
- package/README.md +15 -6
- package/dist/API.d.ts +11 -0
- package/{lib/API.jsx → dist/API.js} +230 -165
- package/dist/APIDeferred.d.ts +7 -0
- package/{lib/APIDeferred.jsx → dist/APIDeferred.js} +35 -53
- package/dist/BrowserDetect.d.ts +19 -0
- package/dist/BrowserDetect.js +107 -0
- package/dist/CONST.d.ts +813 -0
- package/{lib/CONST.jsx → dist/CONST.js} +245 -167
- package/dist/Cookie.d.ts +68 -0
- package/{lib/Cookie.jsx → dist/Cookie.js} +23 -36
- package/dist/CredentialsWrapper.d.ts +32 -0
- package/dist/CredentialsWrapper.js +52 -0
- package/dist/Device.d.ts +8 -0
- package/dist/Device.js +15 -0
- package/dist/ExpenseRule.d.ts +39 -0
- package/{lib/ExpenseRule.jsx → dist/ExpenseRule.js} +12 -14
- package/dist/ExpensiMark.d.ts +142 -0
- package/dist/ExpensiMark.js +1026 -0
- package/dist/Func.d.ts +40 -0
- package/{lib/Func.jsx → dist/Func.js} +19 -25
- package/dist/Log.d.ts +3 -0
- package/dist/Log.js +41 -0
- package/dist/Logger.d.ts +77 -0
- package/dist/Logger.js +126 -0
- package/dist/Network.d.ts +6 -0
- package/{lib/Network.jsx → dist/Network.js} +48 -45
- package/dist/Num.d.ts +95 -0
- package/{lib/Num.jsx → dist/Num.js} +20 -40
- package/dist/PageEvent.d.ts +25 -0
- package/dist/PageEvent.js +28 -0
- package/dist/PubSub.d.ts +2 -0
- package/{lib/PubSub.jsx → dist/PubSub.js} +27 -39
- package/dist/ReportHistoryStore.d.ts +64 -0
- package/dist/ReportHistoryStore.js +261 -0
- package/dist/Templates.d.ts +2 -0
- package/{lib/Templates.jsx → dist/Templates.js} +33 -48
- package/dist/Url.d.ts +22 -0
- package/dist/Url.js +30 -0
- package/dist/components/CopyText.d.ts +45 -0
- package/{lib/components/CopyText.jsx → dist/components/CopyText.js} +16 -23
- package/dist/components/StepProgressBar.d.ts +22 -0
- package/dist/components/StepProgressBar.js +68 -0
- package/dist/components/form/element/combobox.d.ts +237 -0
- package/{lib → dist}/components/form/element/combobox.js +361 -516
- package/dist/components/form/element/dropdown.d.ts +35 -0
- package/dist/components/form/element/dropdown.js +66 -0
- package/dist/components/form/element/dropdownItem.d.ts +55 -0
- package/dist/components/form/element/dropdownItem.js +118 -0
- package/dist/components/form/element/onOffSwitch.d.ts +94 -0
- package/dist/components/form/element/onOffSwitch.js +195 -0
- package/dist/components/form/element/switch.d.ts +58 -0
- package/{lib → dist}/components/form/element/switch.js +29 -66
- package/dist/fastMerge.d.ts +9 -0
- package/dist/fastMerge.js +77 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +71 -0
- package/dist/jquery.expensifyIframify.d.ts +10 -0
- package/{lib → dist}/jquery.expensifyIframify.js +52 -93
- package/dist/mixins/PubSub.d.ts +20 -0
- package/{lib/mixins/PubSub.jsx → dist/mixins/PubSub.js} +12 -11
- package/dist/mixins/extraClasses.d.ts +8 -0
- package/{lib → dist}/mixins/extraClasses.js +8 -12
- package/dist/mixins/validationClasses.d.ts +12 -0
- package/dist/mixins/validationClasses.js +58 -0
- package/dist/str.d.ts +613 -0
- package/{lib → dist}/str.js +176 -160
- package/dist/tlds.d.ts +2 -0
- package/dist/tlds.js +4 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +13 -0
- package/package.json +47 -18
- package/.editorconfig +0 -34
- package/.eslintrc.js +0 -11
- package/.github/CODEOWNERS +0 -2
- package/.github/CONTRIBUTING.md +0 -163
- package/.github/ISSUE_TEMPLATE.md +0 -3
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- package/.github/workflows/cla.yml +0 -39
- package/.github/workflows/lint.yml +0 -29
- package/.github/workflows/test.yml +0 -29
- package/CLA.md +0 -20
- package/Gruntfile.js +0 -13
- package/__tests__/ExpensiMark-test.js +0 -340
- package/__tests__/Logger-test.js +0 -55
- package/__tests__/Str-test.js +0 -53
- package/babel.config.js +0 -12
- package/grunt/configloader.js +0 -17
- package/grunt/configs/chokidar.js +0 -23
- package/grunt/configs/eslint.js +0 -15
- package/grunt/task/watch.js +0 -3
- package/grunt/taskloader.js +0 -25
- package/lib/BrowserDetect.jsx +0 -91
- package/lib/ExpensiMark.js +0 -253
- package/lib/Log.jsx +0 -36
- package/lib/Logger.jsx +0 -154
- package/lib/PageEvent.jsx +0 -23
- package/lib/ReportHistoryStore.jsx +0 -194
- package/lib/components/StepProgressBar.js +0 -49
- package/lib/components/form/element/dropdown.js +0 -90
- package/lib/components/form/element/dropdownItem.js +0 -178
- package/lib/components/form/element/onOffSwitch.jsx +0 -229
- package/lib/mixins/validationClasses.js +0 -23
- package/lib/tlds.jsx +0 -3
package/README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
# `expensify-common`
|
|
2
|
-
This is a collection of JS libraries and components which are used across various Expensify projects. These libraries are provided as-is, and the repos which use them will need to do their own bundling, minifying, and uglifying.
|
|
2
|
+
This is a collection of JS/TS libraries and components which are used across various Expensify projects. These libraries are provided as-is, and the repos which use them will need to do their own bundling, minifying, and uglifying.
|
|
3
3
|
|
|
4
4
|
# Installation
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
`expensify-common` is published to [`npm`](https://www.npmjs.com/package/expensify-common)
|
|
6
|
+
|
|
7
|
+
```shell
|
|
8
|
+
npm install expensify-common
|
|
9
|
+
```
|
|
7
10
|
|
|
8
11
|
# Development
|
|
9
12
|
* Write all code as ES6.
|
|
10
|
-
* Always lint your code with `npm run
|
|
11
|
-
* Make sure you're using http://editorconfig.org/
|
|
13
|
+
* Always lint your code with `npm run lint`
|
|
12
14
|
|
|
13
15
|
## Testing your code while you are developing
|
|
14
16
|
The best way to test your code while you are developing changes is via `npm link`.
|
|
@@ -17,6 +19,8 @@ The best way to test your code while you are developing changes is via `npm link
|
|
|
17
19
|
1. `cd` into the project directory that has a dependency on `expensify-common`
|
|
18
20
|
1. Run `npm link expensify-common`
|
|
19
21
|
|
|
22
|
+
If that does not work, another option is running `npm i expensify-common ../expensify-common --save`.
|
|
23
|
+
|
|
20
24
|
Alternatively, you can edit files directly in a project's `node_modules` then apply those changes to this repository.
|
|
21
25
|
|
|
22
26
|
# Proposing a Change (Non-Expensify Contributors)
|
|
@@ -26,4 +30,9 @@ Alternatively, you can edit files directly in a project's `node_modules` then ap
|
|
|
26
30
|
1. They will review and accept your changes, merge them, then deploy a new version
|
|
27
31
|
|
|
28
32
|
# Deploying a Change (Expensify Only)
|
|
29
|
-
|
|
33
|
+
Once the PR has been merged, install the new version of the package with `npm install expensify-common@x.x.x` command. Be sure to check the repos below to confirm whether or not they are affected by your changes!
|
|
34
|
+
- Expensify/Web-Expensify
|
|
35
|
+
- Expensify/Web-Secure
|
|
36
|
+
- Expensify/Mobile-Expensify
|
|
37
|
+
- Expensify/App
|
|
38
|
+
- Expensify/Comp
|
package/dist/API.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {Network} network
|
|
3
|
+
* @param {Object} [args]
|
|
4
|
+
* @param {Function} [args.enhanceParameters] A function that takes the existing command parameters and returns a
|
|
5
|
+
* modified version of them (for things like adding CSRF tokens)
|
|
6
|
+
*
|
|
7
|
+
* @returns {Object}
|
|
8
|
+
*/
|
|
9
|
+
export default function API(network: Network, args?: {
|
|
10
|
+
enhanceParameters?: Function | undefined;
|
|
11
|
+
} | undefined): Object;
|