@gumigumih/react-calculator-input-form 1.1.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +269 -223
- package/dist/components/atoms/Button.d.ts +1 -1
- package/dist/components/atoms/Icon.d.ts +0 -0
- package/dist/components/molecules/CalculatorDisplay.d.ts +2 -1
- package/dist/components/molecules/CalculatorKeypad.d.ts +0 -0
- package/dist/components/organisms/Calculator.d.ts +12 -2
- package/dist/components/organisms/CalculatorInputForm.d.ts +6 -2
- package/dist/components/organisms/calculatorUtils.d.ts +2 -0
- package/dist/components/organisms/useCalculatorController.d.ts +20 -0
- package/dist/constants/colors.d.ts +0 -0
- package/dist/index.d.ts +0 -4
- package/dist/index.esm.js +276 -1402
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +273 -1401
- package/dist/index.js.map +1 -1
- package/dist/styles/calculator.css +444 -444
- package/package.json +100 -101
- package/dist/components/atoms/__tests__/Button.test.d.ts +0 -1
- package/dist/components/organisms/__tests__/CalculatorInputForm.test.d.ts +0 -1
- package/dist/setupTests.d.ts +0 -1
- package/dist/styles/index.d.ts +0 -6
- package/dist/styles/index.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var reactNumberFormat = require('react-number-format');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var reactDom = require('react-dom');
|
|
6
7
|
|
|
@@ -31,10 +32,45 @@ function styleInject(css, ref) {
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
var css_248z = ".calculator-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:9999}.calculator-background-pattern{inset:0;overflow:hidden;position:absolute}.calculator-background-pattern>div{inset:0;opacity:.1;position:absolute}.calculator-pattern-item{font-size:2rem;position:absolute}.calculator-pattern-item:first-child{font-size:2.5rem;left:2.5rem;top:2.5rem}.calculator-pattern-item:nth-child(2){font-size:1.875rem;right:5rem;top:5rem}.calculator-pattern-item:nth-child(3){font-size:1.5rem;left:5rem;top:10rem}.calculator-pattern-item:nth-child(4){font-size:1.875rem;right:10rem;top:15rem}.calculator-pattern-item:nth-child(5){font-size:1.5rem;left:10rem;top:20rem}.calculator-pattern-item:nth-child(6){bottom:10rem;font-size:1.875rem;right:5rem}.calculator-modal{background:#fff;border-radius:.75rem;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);max-height:90vh;max-width:24rem;overflow-y:auto;position:relative;width:100%;z-index:10}.calculator-header{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:1rem}.calculator-logo-container{align-items:center;display:flex;gap:.75rem}.calculator-logo{align-items:center;background-color:#60a5fa;border-radius:50%;display:flex;height:2.5rem;justify-content:center;width:2.5rem}.calculator-logo-text{color:#fff;font-size:1.25rem;font-weight:700}.calculator-title{color:#111827;font-size:1.125rem;font-weight:700;margin:0}.calculator-subtitle{color:#6b7280;font-size:.75rem;margin:0}.calculator-close-button{background:none;border:none;border-radius:.375rem;color:#6b7280;cursor:pointer;font-size:1.25rem;padding:.5rem;transition:all .2s ease-in-out}.calculator-close-button:hover{background-color:#6b7280;color:#fff}.calculator-participants{display:flex;flex-direction:column;gap:1rem;padding:1.5rem}.calculator-participant-row{align-items:center;border:2px solid #e5e7eb;border-radius:.5rem;cursor:pointer;display:flex;justify-content:space-between;padding:1rem;transition:all .2s}.calculator-participant-row:hover{border-color:#d1d5db}.calculator-participant-row.selected{background-color:#eff6ff;border-color:#3b82f6}.calculator-participant-info{align-items:center;display:flex;gap:.75rem}.calculator-participant-name{color:#374151;font-size:1.125rem;font-weight:500}.calculator-participant-amount{align-items:center;display:flex;gap:.5rem}.calculator-amount-text{color:#111827;font-size:1.5rem;font-weight:700}.calculator-currency{color:#6b7280}.calculator-clear-button{background:none;border:none;color:#9ca3af;cursor:pointer;padding:.25rem;transition:color .2s}.calculator-clear-button:hover{color:#ef4444}.calculator-participant-controls{display:flex;gap:.5rem}.calculator-add-button{background-color:#3b82f6;border:none;border-radius:.5rem;color:#fff;cursor:pointer;flex:1;font-size:.875rem;font-weight:700;padding:.5rem 1rem;transition:background-color .2s}.calculator-add-button:hover{background-color:#2563eb}.calculator-remove-button{background-color:#6b7280;border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-size:.875rem;font-weight:700;padding:.5rem 1rem;transition:background-color .2s}.calculator-remove-button:hover{background-color:#4b5563}.calculator-keypad-section{border-top:none;padding:1rem}.calculator-display-input{background-color:#f3f4f6;border:none;border-radius:0!important;box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace;font-size:1.5rem;outline:none;padding:.75rem 1.25rem;text-align:right;width:100%}.calculator-error{color:#ef4444;font-size:.75rem;margin-top:.25rem;padding-left:1.25rem;padding-right:1.25rem}.calculator-keypad{display:flex;flex-direction:column;gap:.5rem}.calculator-keypad-grid{display:grid;gap:.5rem;grid-template-columns:repeat(4,1fr)}.calculator-keypad-button{border:none;border-radius:.5rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);cursor:pointer;font-size:1rem;font-weight:700;padding:.75rem;transition:all .2s}.calculator-keypad-button.number{background-color:#f3f4f6;color:#374151}.calculator-keypad-button.number:hover{background-color:#dbeafe}.calculator-keypad-button.operator{background-color:#ff9f0a;color:#fff}.calculator-keypad-button.operator:hover{background-color:#ffb340}.calculator-keypad-button.clear{background-color:#ef4444;color:#fff}.calculator-keypad-button.clear:hover{background-color:#dc2626}.calculator-keypad-button.backspace{background-color:#a5a5a5;color:#fff}.calculator-keypad-button.backspace:hover{background-color:#b5b5b5}.calculator-keypad-button.decimal{background-color:#e5e7eb;color:#374151}.calculator-keypad-button.decimal:hover{background-color:#d1d5db}.calculator-keypad-button.include{background-color:#a5f3fc;color:#374151}.calculator-keypad-button.include:hover{background-color:#67e8f9}.calculator-keypad-button.exclude{background-color:#fce7f3;color:#374151}.calculator-keypad-button.exclude:hover{background-color:#fbcfe8}.calculator-action-buttons{display:grid;gap:.75rem;grid-template-columns:1fr 1fr}.calculator-equals-button{background-color:#ff9f0a;border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1rem;font-weight:700;padding:.75rem;transition:background-color .2s}.calculator-equals-button:hover{background-color:#ffb340}.calculator-decide-button{background-color:#10b981;border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1rem;font-weight:700;grid-column:1/-1;padding:.75rem;transition:background-color .2s}.calculator-decide-button:hover{background-color:#059669}.calculator-total-section{border-top:1px solid #e5e7eb;padding:1.5rem}.calculator-total-row{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem}.calculator-total-label{color:#374151;font-size:1.125rem;font-weight:500}.calculator-total-amount{color:#111827;font-size:1.5rem;font-weight:700}.calculator-per-person{color:#2563eb}.calculator-calculate-button{background-color:#10b981;border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1.125rem;font-weight:700;padding:1rem;transition:background-color .2s;width:100%}.calculator-calculate-button:hover{background-color:#059669}@media (max-width:640px){.calculator-overlay{padding:.5rem}.calculator-modal{margin:.5rem;max-width:100%}.calculator-keypad-button{font-size:1.125rem;padding:.75rem}}.calculator-keypad-button.number.zero-wide{grid-column:span 2}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhbGN1bGF0b3IuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLG9CQVFFLGtCQUFtQixDQUZuQix5QkFBOEIsQ0FEOUIsUUFBUyxDQUVULFlBQWEsQ0FFYixzQkFBdUIsQ0FOdkIsTUFBTyxDQVFQLFlBQW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gZm9udC1zaXplOiAxLjEyNXJlbTtcbiAgZm9udC13ZWlnaHQ6IGJvbGQ7XG4gIGJvcmRlcjogbm9uZTtcbiAgYm9yZGVyLXJhZGl1czogMC41cmVtO1xuICBjdXJzb3I6IHBvaW50ZXI7XG4gIHRyYW5zaXRpb246IGJhY2tncm91bmQtY29sb3IgMC4ycztcbiAgYm94LXNoYWRvdzogMCAxMHB4IDE1cHggLTNweCByZ2JhKDAsIDAsIDAsIDAuMSk7XG59XG5cbi5jYWxjdWxhdG9yLWNhbGN1bGF0ZS1idXR0b246aG92ZXIge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjMDU5NjY5O1xufVxuXG4vKiDjg6zjgrnjg53jg7Pjgrfjg5blr77lv5wgKi9cbkBtZWRpYSAobWF4LXdpZHRoOiA2NDBweCkge1xuICAuY2FsY3VsYXRvci1vdmVybGF5IHtcbiAgICBwYWRkaW5nOiAwLjVyZW07XG4gIH1cblxuICAuY2FsY3VsYXRvci1tb2RhbCB7XG4gICAgbWF4LXdpZHRoOiAxMDAlO1xuICAgIG1hcmdpbjogMC41cmVtO1xuICB9XG5cbiAgLmNhbGN1bGF0b3Ita2V5cGFkLWJ1dHRvbiB7XG4gICAgcGFkZGluZzogMC43NXJlbTtcbiAgICBmb250LXNpemU6IDEuMTI1cmVtO1xuICB9XG59XG5cbi5jYWxjdWxhdG9yLWtleXBhZC1idXR0b24ubnVtYmVyLnplcm8td2lkZSB7XG4gIGdyaWQtY29sdW1uOiBzcGFuIDI7XG59XG4iXX0= */";
|
|
35
|
+
var css_248z = ".calculator-overlay{align-items:center;background:rgba(0,0,0,.5);bottom:0;display:flex;justify-content:center;left:0;padding:1rem;position:fixed;right:0;top:0;z-index:9999}.calculator-background-pattern{inset:0;overflow:hidden;position:absolute}.calculator-background-pattern>div{inset:0;opacity:.1;position:absolute}.calculator-pattern-item{font-size:2rem;position:absolute}.calculator-pattern-item:first-child{font-size:2.5rem;left:2.5rem;top:2.5rem}.calculator-pattern-item:nth-child(2){font-size:1.875rem;right:5rem;top:5rem}.calculator-pattern-item:nth-child(3){font-size:1.5rem;left:5rem;top:10rem}.calculator-pattern-item:nth-child(4){font-size:1.875rem;right:10rem;top:15rem}.calculator-pattern-item:nth-child(5){font-size:1.5rem;left:10rem;top:20rem}.calculator-pattern-item:nth-child(6){bottom:10rem;font-size:1.875rem;right:5rem}.calculator-modal{background:var(--calculator-surface,#fff);border-radius:.75rem;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);max-height:90vh;max-width:24rem;overflow-y:auto;position:relative;width:100%;z-index:10}.calculator-header{align-items:center;border-bottom:1px solid #e5e7eb;display:flex;justify-content:space-between;padding:1rem}.calculator-logo-container{align-items:center;display:flex;gap:.75rem}.calculator-logo{align-items:center;background-color:var(--calculator-primary,#60a5fa);border-radius:50%;display:flex;height:2.5rem;justify-content:center;width:2.5rem}.calculator-logo-text{color:#fff;font-size:1.25rem;font-weight:700}.calculator-title{color:#111827;font-size:1.125rem;font-weight:700;margin:0}.calculator-subtitle{color:#6b7280;font-size:.75rem;margin:0}.calculator-close-button{background:none;border:none;border-radius:.375rem;color:#6b7280;cursor:pointer;font-size:1.25rem;padding:.5rem;transition:all .2s ease-in-out}.calculator-close-button:hover{background-color:var(--calculator-danger,#6b7280);color:#fff}.calculator-participants{display:flex;flex-direction:column;gap:1rem;padding:1.5rem}.calculator-participant-row{align-items:center;border:2px solid #e5e7eb;border-radius:.5rem;cursor:pointer;display:flex;justify-content:space-between;padding:1rem;transition:all .2s}.calculator-participant-row:hover{border-color:#d1d5db}.calculator-participant-row.selected{background-color:color-mix(in srgb,var(--calculator-primary,#3b82f6) 10%,#fff);border-color:var(--calculator-primary,#3b82f6)}.calculator-participant-info{align-items:center;display:flex;gap:.75rem}.calculator-participant-name{color:#374151;font-size:1.125rem;font-weight:500}.calculator-participant-amount{align-items:center;display:flex;gap:.5rem}.calculator-amount-text{color:#111827;font-size:1.5rem;font-weight:700}.calculator-currency{color:#6b7280}.calculator-clear-button{background:none;border:none;color:#9ca3af;cursor:pointer;padding:.25rem;transition:color .2s}.calculator-clear-button:hover{color:#ef4444}.calculator-participant-controls{display:flex;gap:.5rem}.calculator-add-button{background-color:var(--calculator-primary,#3b82f6);border:none;border-radius:.5rem;color:#fff;cursor:pointer;flex:1;font-size:.875rem;font-weight:700;padding:.5rem 1rem;transition:background-color .2s}.calculator-add-button:hover{background-color:color-mix(in srgb,var(--calculator-primary,#3b82f6) 85%,#000)}.calculator-remove-button{background-color:var(--calculator-danger,#6b7280);border:none;border-radius:.5rem;color:#fff;cursor:pointer;font-size:.875rem;font-weight:700;padding:.5rem 1rem;transition:background-color .2s}.calculator-remove-button:hover{background-color:color-mix(in srgb,var(--calculator-danger,#6b7280) 85%,#000)}.calculator-keypad-section{border-top:none;padding:1rem}.calculator-display-input{background-color:#f3f4f6;border:none;border-radius:0!important;box-sizing:border-box;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace;font-size:1.5rem;outline:none;padding:.75rem 1.25rem;text-align:right;width:100%}.calculator-error{color:#ef4444;font-size:.75rem;margin-top:.25rem;padding-left:1.25rem;padding-right:1.25rem}.calculator-keypad{display:flex;flex-direction:column;gap:.5rem}.calculator-keypad-grid{display:grid;gap:.5rem;grid-template-columns:repeat(4,1fr)}.calculator-keypad-button{border:none;border-radius:.5rem;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);cursor:pointer;font-size:1rem;font-weight:700;padding:.75rem;transition:all .2s}.calculator-keypad-button.number{background-color:#f3f4f6;color:#374151}.calculator-keypad-button.number:hover{background-color:#dbeafe}.calculator-keypad-button.operator{background-color:var(--calculator-operator,#ff9f0a);color:#fff}.calculator-keypad-button.operator:hover{background-color:color-mix(in srgb,var(--calculator-operator,#ff9f0a) 85%,#fff)}.calculator-keypad-button.clear{background-color:var(--calculator-danger,#ef4444);color:#fff}.calculator-keypad-button.clear:hover{background-color:color-mix(in srgb,var(--calculator-danger,#ef4444) 85%,#000)}.calculator-keypad-button.backspace{background-color:#a5a5a5;color:#fff}.calculator-keypad-button.backspace:hover{background-color:#b5b5b5}.calculator-keypad-button.decimal{background-color:#e5e7eb;color:#374151}.calculator-keypad-button.decimal:hover{background-color:#d1d5db}.calculator-keypad-button.include{background-color:color-mix(in srgb,var(--calculator-success,#a5f3fc) 30%,#fff);color:#374151}.calculator-keypad-button.include:hover{background-color:var(--calculator-success,#67e8f9)}.calculator-keypad-button.exclude{background-color:color-mix(in srgb,var(--calculator-danger,#fce7f3) 20%,#fff);color:#374151}.calculator-keypad-button.exclude:hover{background-color:color-mix(in srgb,var(--calculator-danger,#fbcfe8) 35%,#fff)}.calculator-action-buttons{display:grid;gap:.75rem;grid-template-columns:1fr 1fr}.calculator-equals-button{background-color:var(--calculator-operator,#ff9f0a);border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1rem;font-weight:700;padding:.75rem;transition:background-color .2s}.calculator-equals-button:hover{background-color:color-mix(in srgb,var(--calculator-operator,#ff9f0a) 85%,#fff)}.calculator-decide-button{background-color:var(--calculator-success,#10b981);border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1rem;font-weight:700;grid-column:1/-1;padding:.75rem;transition:background-color .2s}.calculator-decide-button:hover{background-color:color-mix(in srgb,var(--calculator-success,#10b981) 85%,#000)}.calculator-total-section{border-top:1px solid #e5e7eb;padding:1.5rem}.calculator-total-row{align-items:center;display:flex;justify-content:space-between;margin-bottom:1rem}.calculator-total-label{color:#374151;font-size:1.125rem;font-weight:500}.calculator-total-amount{color:#111827;font-size:1.5rem;font-weight:700}.calculator-per-person{color:var(--calculator-primary,#2563eb)}.calculator-calculate-button{background-color:var(--calculator-success,#10b981);border:none;border-radius:.5rem;box-shadow:0 10px 15px -3px rgba(0,0,0,.1);color:#fff;cursor:pointer;font-size:1.125rem;font-weight:700;padding:1rem;transition:background-color .2s;width:100%}.calculator-calculate-button:hover{background-color:color-mix(in srgb,var(--calculator-success,#10b981) 85%,#000)}@media (max-width:640px){.calculator-overlay{padding:.5rem}.calculator-modal{margin:.5rem;max-width:100%}.calculator-keypad-button{font-size:1.125rem;padding:.75rem}}.calculator-keypad-button.number.zero-wide{grid-column:span 2}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNhbGN1bGF0b3IuY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLG9CQVFFLGtCQUFtQixDQUZuQix5QkFBOEIsQ0FEOUIsUUFBUyxDQUVULFlBQWEsQ0FFYixzQkFBdUIsQ0FOdkIsTUFBTyxDQVFQLFlBQWEsQ0FWYixjQUFlLENBR2YsT0FBUSxDQUZSLEtBQU0sQ0FRTixZQUVGLENBRUEsK0JBRUUsT0FBUSxDQUNSLGVBQWdCLENBRmhCLGlCQUdGLENBRUEsbUNBRUUsT0FBUSxDQUNSLFVBQVksQ0FGWixpQkFHRixDQUVBLHlCQUVFLGNBQWUsQ0FEZixpQkFFRixDQUVBLHFDQUdFLGdCQUFpQixDQURqQixXQUFZLENBRFosVUFHRixDQUNBLHNDQUdFLGtCQUFtQixDQURuQixVQUFXLENBRFgsUUFHRixDQUNBLHNDQUdFLGdCQUFpQixDQURqQixTQUFVLENBRFYsU0FHRixDQUNBLHNDQUdFLGtCQUFtQixDQURuQixXQUFZLENBRFosU0FHRixDQUNBLHNDQUdFLGdCQUFpQixDQURqQixVQUFXLENBRFgsU0FHRixDQUNBLHNDQUNFLFlBQWEsQ0FFYixrQkFBbUIsQ0FEbkIsVUFFRixDQUdBLGtCQUNFLHlDQUE0QyxDQUM1QyxvQkFBc0IsQ0FHdEIsNENBQWlELENBQ2pELGVBQWdCLENBRmhCLGVBQWdCLENBR2hCLGVBQWdCLENBQ2hCLGlCQUFrQixDQUxsQixVQUFXLENBTVgsVUFDRixDQUdBLG1CQUdFLGtCQUFtQixDQUVuQiwrQkFBZ0M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AwLjVyZW07XHJcbiAgfVxyXG5cclxuICAuY2FsY3VsYXRvci1tb2RhbCB7XHJcbiAgICBtYXgtd2lkdGg6IDEwMCU7XHJcbiAgICBtYXJnaW46IDAuNXJlbTtcclxuICB9XHJcblxyXG4gIC5jYWxjdWxhdG9yLWtleXBhZC1idXR0b24ge1xyXG4gICAgcGFkZGluZzogMC43NXJlbTtcclxuICAgIGZvbnQtc2l6ZTogMS4xMjVyZW07XHJcbiAgfVxyXG59XHJcblxyXG4uY2FsY3VsYXRvci1rZXlwYWQtYnV0dG9uLm51bWJlci56ZXJvLXdpZGUge1xyXG4gIGdyaWQtY29sdW1uOiBzcGFuIDI7XHJcbn1cclxuIl19 */";
|
|
35
36
|
styleInject(css_248z);
|
|
36
37
|
|
|
37
|
-
const
|
|
38
|
+
const CalculatorDisplay = ({ value, error, inputRef, editable, placeholder, onChange, numberFormatOptions = {} }) => {
|
|
39
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [editable ? (jsxRuntime.jsx(reactNumberFormat.NumericFormat, { ...numberFormatOptions, className: "calculator-display-input", value: value, onValueChange: (vals) => onChange?.(vals.value), placeholder: placeholder ?? '数値を入力', inputMode: "decimal" })) : (jsxRuntime.jsx("div", { className: "calculator-display-input", children: jsxRuntime.jsx("div", { ref: inputRef, style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: value ? (jsxRuntime.jsx(reactNumberFormat.NumericFormat, { ...numberFormatOptions, value: value, displayType: "text" })) : (jsxRuntime.jsx("span", { className: "text-gray-400", children: placeholder ?? '0' })) }) })), error && jsxRuntime.jsx("div", { className: "calculator-error", children: error })] }));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const Button = ({ children, className = '', type = 'button', ...props }) => (jsxRuntime.jsx("button", { className: `py-2 px-4 rounded-md font-bold focus:outline-none focus:ring-2 transition-colors ${className}`, type: type, ...props, children: children }));
|
|
43
|
+
|
|
44
|
+
const CalculatorKeypad = ({ onButtonClick, onEqual, onDecide, onTaxInclude, onTaxExclude, enableTaxCalculation = true, decimalPlaces = 6 }) => {
|
|
45
|
+
// decimalPlacesが0の場合は小数点ボタンを非表示
|
|
46
|
+
const buttons = decimalPlaces === 0
|
|
47
|
+
? [
|
|
48
|
+
['7', '8', '9', '÷'],
|
|
49
|
+
['4', '5', '6', '×'],
|
|
50
|
+
['1', '2', '3', '-'],
|
|
51
|
+
['0', '←'], // 小数点ボタンを削除
|
|
52
|
+
['+'],
|
|
53
|
+
]
|
|
54
|
+
: [
|
|
55
|
+
['7', '8', '9', '÷'],
|
|
56
|
+
['4', '5', '6', '×'],
|
|
57
|
+
['1', '2', '3', '-'],
|
|
58
|
+
['0', '.', '←'],
|
|
59
|
+
['+'],
|
|
60
|
+
];
|
|
61
|
+
return (jsxRuntime.jsx("div", { className: "calculator-keypad-section", children: jsxRuntime.jsxs("div", { className: "calculator-keypad", children: [enableTaxCalculation && (jsxRuntime.jsxs("div", { className: "calculator-keypad-grid", children: [jsxRuntime.jsxs(Button, { className: "calculator-keypad-button include", onClick: () => onTaxInclude(0.08), tabIndex: 0, children: ["\u7A0E\u8FBC", jsxRuntime.jsx("br", {}), "8%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button include", onClick: () => onTaxInclude(0.10), tabIndex: 0, children: ["\u7A0E\u8FBC", jsxRuntime.jsx("br", {}), "10%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button exclude", onClick: () => onTaxExclude(0.08), tabIndex: 0, children: ["\u7A0E\u629C", jsxRuntime.jsx("br", {}), "8%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button exclude", onClick: () => onTaxExclude(0.10), tabIndex: 0, children: ["\u7A0E\u629C", jsxRuntime.jsx("br", {}), "10%"] })] })), jsxRuntime.jsx("div", { className: "calculator-keypad-grid", style: { marginTop: '0.25rem' }, children: buttons.flat().map((btn, i) => {
|
|
62
|
+
let className = 'calculator-keypad-button ';
|
|
63
|
+
if (['÷', '×', '-', '+'].includes(btn))
|
|
64
|
+
className += 'operator';
|
|
65
|
+
else if (btn === '←')
|
|
66
|
+
className += 'backspace';
|
|
67
|
+
else if (btn === '0' && decimalPlaces === 0)
|
|
68
|
+
className += 'number zero-wide'; // 0ボタンを2つ分の幅に
|
|
69
|
+
else
|
|
70
|
+
className += 'number';
|
|
71
|
+
return (jsxRuntime.jsx(Button, { className: className, onClick: () => onButtonClick(btn), tabIndex: 0, children: btn }, btn + i));
|
|
72
|
+
}) }), jsxRuntime.jsxs("div", { className: "calculator-action-buttons", style: { marginTop: '0.75rem' }, children: [jsxRuntime.jsx(Button, { className: "calculator-keypad-button clear", onClick: () => onButtonClick('C'), children: "C" }), jsxRuntime.jsx(Button, { className: "calculator-equals-button", onClick: onEqual, children: "=" }), jsxRuntime.jsx(Button, { className: "calculator-decide-button", onClick: onDecide, children: "\u6C7A\u5B9A" })] })] }) }));
|
|
73
|
+
};
|
|
38
74
|
|
|
39
75
|
/*!
|
|
40
76
|
* Font Awesome Free 7.0.1 by @fontawesome - https://fontawesome.com
|
|
@@ -216,13 +252,13 @@ function _unsupportedIterableToArray$1(r, a) {
|
|
|
216
252
|
}
|
|
217
253
|
}
|
|
218
254
|
|
|
219
|
-
var noop
|
|
255
|
+
var noop = function noop() {};
|
|
220
256
|
var _WINDOW = {};
|
|
221
257
|
var _DOCUMENT = {};
|
|
222
258
|
var _MUTATION_OBSERVER = null;
|
|
223
259
|
var _PERFORMANCE = {
|
|
224
|
-
mark: noop
|
|
225
|
-
measure: noop
|
|
260
|
+
mark: noop,
|
|
261
|
+
measure: noop
|
|
226
262
|
};
|
|
227
263
|
try {
|
|
228
264
|
if (typeof window !== 'undefined') _WINDOW = window;
|
|
@@ -2162,10 +2198,10 @@ function findIcon(iconName, prefix) {
|
|
|
2162
2198
|
});
|
|
2163
2199
|
}
|
|
2164
2200
|
|
|
2165
|
-
var noop$1
|
|
2201
|
+
var noop$1 = function noop() {};
|
|
2166
2202
|
var p$2 = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
|
|
2167
|
-
mark: noop$1
|
|
2168
|
-
measure: noop$1
|
|
2203
|
+
mark: noop$1,
|
|
2204
|
+
measure: noop$1
|
|
2169
2205
|
};
|
|
2170
2206
|
var preamble = "FA \"7.0.1\"";
|
|
2171
2207
|
var begin = function begin(name) {
|
|
@@ -5156,1265 +5192,6 @@ var convertCurry = convert.bind(null, React.createElement);
|
|
|
5156
5192
|
|
|
5157
5193
|
const Icon = (props) => jsxRuntime.jsx(FontAwesomeIcon, { ...props });
|
|
5158
5194
|
|
|
5159
|
-
/**
|
|
5160
|
-
* react-number-format - 5.4.4
|
|
5161
|
-
* Author : Sudhanshu Yadav
|
|
5162
|
-
* Copyright (c) 2016, 2025 to Sudhanshu Yadav, released under the MIT license.
|
|
5163
|
-
* https://github.com/s-yadav/react-number-format
|
|
5164
|
-
*/
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
/******************************************************************************
|
|
5168
|
-
Copyright (c) Microsoft Corporation.
|
|
5169
|
-
|
|
5170
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
5171
|
-
purpose with or without fee is hereby granted.
|
|
5172
|
-
|
|
5173
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
5174
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
5175
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
5176
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
5177
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
5178
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
5179
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
5180
|
-
***************************************************************************** */
|
|
5181
|
-
|
|
5182
|
-
function __rest(s, e) {
|
|
5183
|
-
var t = {};
|
|
5184
|
-
for (var p in s) { if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5185
|
-
{ t[p] = s[p]; } }
|
|
5186
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
5187
|
-
{ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5188
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
5189
|
-
{ t[p[i]] = s[p[i]]; }
|
|
5190
|
-
} }
|
|
5191
|
-
return t;
|
|
5192
|
-
}
|
|
5193
|
-
|
|
5194
|
-
var SourceType;
|
|
5195
|
-
(function (SourceType) {
|
|
5196
|
-
SourceType["event"] = "event";
|
|
5197
|
-
SourceType["props"] = "prop";
|
|
5198
|
-
})(SourceType || (SourceType = {}));
|
|
5199
|
-
|
|
5200
|
-
// basic noop function
|
|
5201
|
-
function noop() { }
|
|
5202
|
-
function memoizeOnce(cb) {
|
|
5203
|
-
var lastArgs;
|
|
5204
|
-
var lastValue = undefined;
|
|
5205
|
-
return function () {
|
|
5206
|
-
var args = [], len = arguments.length;
|
|
5207
|
-
while ( len-- ) args[ len ] = arguments[ len ];
|
|
5208
|
-
|
|
5209
|
-
if (lastArgs &&
|
|
5210
|
-
args.length === lastArgs.length &&
|
|
5211
|
-
args.every(function (value, index) { return value === lastArgs[index]; })) {
|
|
5212
|
-
return lastValue;
|
|
5213
|
-
}
|
|
5214
|
-
lastArgs = args;
|
|
5215
|
-
lastValue = cb.apply(void 0, args);
|
|
5216
|
-
return lastValue;
|
|
5217
|
-
};
|
|
5218
|
-
}
|
|
5219
|
-
function charIsNumber(char) {
|
|
5220
|
-
return !!(char || '').match(/\d/);
|
|
5221
|
-
}
|
|
5222
|
-
function isNil(val) {
|
|
5223
|
-
return val === null || val === undefined;
|
|
5224
|
-
}
|
|
5225
|
-
function isNanValue(val) {
|
|
5226
|
-
return typeof val === 'number' && isNaN(val);
|
|
5227
|
-
}
|
|
5228
|
-
function isNotValidValue(val) {
|
|
5229
|
-
return isNil(val) || isNanValue(val) || (typeof val === 'number' && !isFinite(val));
|
|
5230
|
-
}
|
|
5231
|
-
function escapeRegExp(str) {
|
|
5232
|
-
return str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
|
5233
|
-
}
|
|
5234
|
-
function getThousandsGroupRegex(thousandsGroupStyle) {
|
|
5235
|
-
switch (thousandsGroupStyle) {
|
|
5236
|
-
case 'lakh':
|
|
5237
|
-
return /(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;
|
|
5238
|
-
case 'wan':
|
|
5239
|
-
return /(\d)(?=(\d{4})+(?!\d))/g;
|
|
5240
|
-
case 'thousand':
|
|
5241
|
-
default:
|
|
5242
|
-
return /(\d)(?=(\d{3})+(?!\d))/g;
|
|
5243
|
-
}
|
|
5244
|
-
}
|
|
5245
|
-
function applyThousandSeparator(str, thousandSeparator, thousandsGroupStyle) {
|
|
5246
|
-
var thousandsGroupRegex = getThousandsGroupRegex(thousandsGroupStyle);
|
|
5247
|
-
var index = str.search(/[1-9]/);
|
|
5248
|
-
index = index === -1 ? str.length : index;
|
|
5249
|
-
return (str.substring(0, index) +
|
|
5250
|
-
str.substring(index, str.length).replace(thousandsGroupRegex, '$1' + thousandSeparator));
|
|
5251
|
-
}
|
|
5252
|
-
function usePersistentCallback(cb) {
|
|
5253
|
-
var callbackRef = React.useRef(cb);
|
|
5254
|
-
// keep the callback ref upto date
|
|
5255
|
-
callbackRef.current = cb;
|
|
5256
|
-
/**
|
|
5257
|
-
* initialize a persistent callback which never changes
|
|
5258
|
-
* through out the component lifecycle
|
|
5259
|
-
*/
|
|
5260
|
-
var persistentCbRef = React.useRef(function () {
|
|
5261
|
-
var args = [], len = arguments.length;
|
|
5262
|
-
while ( len-- ) args[ len ] = arguments[ len ];
|
|
5263
|
-
|
|
5264
|
-
return callbackRef.current.apply(callbackRef, args);
|
|
5265
|
-
});
|
|
5266
|
-
return persistentCbRef.current;
|
|
5267
|
-
}
|
|
5268
|
-
//spilt a float number into different parts beforeDecimal, afterDecimal, and negation
|
|
5269
|
-
function splitDecimal(numStr, allowNegative) {
|
|
5270
|
-
if ( allowNegative === void 0 ) allowNegative = true;
|
|
5271
|
-
|
|
5272
|
-
var hasNegation = numStr[0] === '-';
|
|
5273
|
-
var addNegation = hasNegation && allowNegative;
|
|
5274
|
-
numStr = numStr.replace('-', '');
|
|
5275
|
-
var parts = numStr.split('.');
|
|
5276
|
-
var beforeDecimal = parts[0];
|
|
5277
|
-
var afterDecimal = parts[1] || '';
|
|
5278
|
-
return {
|
|
5279
|
-
beforeDecimal: beforeDecimal,
|
|
5280
|
-
afterDecimal: afterDecimal,
|
|
5281
|
-
hasNegation: hasNegation,
|
|
5282
|
-
addNegation: addNegation,
|
|
5283
|
-
};
|
|
5284
|
-
}
|
|
5285
|
-
function fixLeadingZero(numStr) {
|
|
5286
|
-
if (!numStr)
|
|
5287
|
-
{ return numStr; }
|
|
5288
|
-
var isNegative = numStr[0] === '-';
|
|
5289
|
-
if (isNegative)
|
|
5290
|
-
{ numStr = numStr.substring(1, numStr.length); }
|
|
5291
|
-
var parts = numStr.split('.');
|
|
5292
|
-
var beforeDecimal = parts[0].replace(/^0+/, '') || '0';
|
|
5293
|
-
var afterDecimal = parts[1] || '';
|
|
5294
|
-
return ("" + (isNegative ? '-' : '') + beforeDecimal + (afterDecimal ? ("." + afterDecimal) : ''));
|
|
5295
|
-
}
|
|
5296
|
-
/**
|
|
5297
|
-
* limit decimal numbers to given scale
|
|
5298
|
-
* Not used .fixedTo because that will break with big numbers
|
|
5299
|
-
*/
|
|
5300
|
-
function limitToScale(numStr, scale, fixedDecimalScale) {
|
|
5301
|
-
var str = '';
|
|
5302
|
-
var filler = fixedDecimalScale ? '0' : '';
|
|
5303
|
-
for (var i = 0; i <= scale - 1; i++) {
|
|
5304
|
-
str += numStr[i] || filler;
|
|
5305
|
-
}
|
|
5306
|
-
return str;
|
|
5307
|
-
}
|
|
5308
|
-
function repeat(str, count) {
|
|
5309
|
-
return Array(count + 1).join(str);
|
|
5310
|
-
}
|
|
5311
|
-
function toNumericString(num) {
|
|
5312
|
-
var _num = num + ''; // typecast number to string
|
|
5313
|
-
// store the sign and remove it from the number.
|
|
5314
|
-
var sign = _num[0] === '-' ? '-' : '';
|
|
5315
|
-
if (sign)
|
|
5316
|
-
{ _num = _num.substring(1); }
|
|
5317
|
-
// split the number into cofficient and exponent
|
|
5318
|
-
var ref = _num.split(/[eE]/g);
|
|
5319
|
-
var coefficient = ref[0];
|
|
5320
|
-
var exponent = ref[1];
|
|
5321
|
-
// covert exponent to number;
|
|
5322
|
-
exponent = Number(exponent);
|
|
5323
|
-
// if there is no exponent part or its 0, return the coffiecient with sign
|
|
5324
|
-
if (!exponent)
|
|
5325
|
-
{ return sign + coefficient; }
|
|
5326
|
-
coefficient = coefficient.replace('.', '');
|
|
5327
|
-
/**
|
|
5328
|
-
* for scientific notation the current decimal index will be after first number (index 0)
|
|
5329
|
-
* So effective decimal index will always be 1 + exponent value
|
|
5330
|
-
*/
|
|
5331
|
-
var decimalIndex = 1 + exponent;
|
|
5332
|
-
var coffiecientLn = coefficient.length;
|
|
5333
|
-
if (decimalIndex < 0) {
|
|
5334
|
-
// if decimal index is less then 0 add preceding 0s
|
|
5335
|
-
// add 1 as join will have
|
|
5336
|
-
coefficient = '0.' + repeat('0', Math.abs(decimalIndex)) + coefficient;
|
|
5337
|
-
}
|
|
5338
|
-
else if (decimalIndex >= coffiecientLn) {
|
|
5339
|
-
// if decimal index is less then 0 add leading 0s
|
|
5340
|
-
coefficient = coefficient + repeat('0', decimalIndex - coffiecientLn);
|
|
5341
|
-
}
|
|
5342
|
-
else {
|
|
5343
|
-
// else add decimal point at proper index
|
|
5344
|
-
coefficient =
|
|
5345
|
-
(coefficient.substring(0, decimalIndex) || '0') + '.' + coefficient.substring(decimalIndex);
|
|
5346
|
-
}
|
|
5347
|
-
return sign + coefficient;
|
|
5348
|
-
}
|
|
5349
|
-
/**
|
|
5350
|
-
* This method is required to round prop value to given scale.
|
|
5351
|
-
* Not used .round or .fixedTo because that will break with big numbers
|
|
5352
|
-
*/
|
|
5353
|
-
function roundToPrecision(numStr, scale, fixedDecimalScale) {
|
|
5354
|
-
//if number is empty don't do anything return empty string
|
|
5355
|
-
if (['', '-'].indexOf(numStr) !== -1)
|
|
5356
|
-
{ return numStr; }
|
|
5357
|
-
var shouldHaveDecimalSeparator = (numStr.indexOf('.') !== -1 || fixedDecimalScale) && scale;
|
|
5358
|
-
var ref = splitDecimal(numStr);
|
|
5359
|
-
var beforeDecimal = ref.beforeDecimal;
|
|
5360
|
-
var afterDecimal = ref.afterDecimal;
|
|
5361
|
-
var hasNegation = ref.hasNegation;
|
|
5362
|
-
var floatValue = parseFloat(("0." + (afterDecimal || '0')));
|
|
5363
|
-
var floatValueStr = afterDecimal.length <= scale ? ("0." + afterDecimal) : floatValue.toFixed(scale);
|
|
5364
|
-
var roundedDecimalParts = floatValueStr.split('.');
|
|
5365
|
-
var intPart = beforeDecimal;
|
|
5366
|
-
// if we have cary over from rounding decimal part, add that on before decimal
|
|
5367
|
-
if (beforeDecimal && Number(roundedDecimalParts[0])) {
|
|
5368
|
-
intPart = beforeDecimal
|
|
5369
|
-
.split('')
|
|
5370
|
-
.reverse()
|
|
5371
|
-
.reduce(function (roundedStr, current, idx) {
|
|
5372
|
-
if (roundedStr.length > idx) {
|
|
5373
|
-
return ((Number(roundedStr[0]) + Number(current)).toString() +
|
|
5374
|
-
roundedStr.substring(1, roundedStr.length));
|
|
5375
|
-
}
|
|
5376
|
-
return current + roundedStr;
|
|
5377
|
-
}, roundedDecimalParts[0]);
|
|
5378
|
-
}
|
|
5379
|
-
var decimalPart = limitToScale(roundedDecimalParts[1] || '', scale, fixedDecimalScale);
|
|
5380
|
-
var negation = hasNegation ? '-' : '';
|
|
5381
|
-
var decimalSeparator = shouldHaveDecimalSeparator ? '.' : '';
|
|
5382
|
-
return ("" + negation + intPart + decimalSeparator + decimalPart);
|
|
5383
|
-
}
|
|
5384
|
-
/** set the caret positon in an input field **/
|
|
5385
|
-
function setCaretPosition(el, caretPos) {
|
|
5386
|
-
el.value = el.value;
|
|
5387
|
-
// ^ this is used to not only get 'focus', but
|
|
5388
|
-
// to make sure we don't have it everything -selected-
|
|
5389
|
-
// (it causes an issue in chrome, and having it doesn't hurt any other browser)
|
|
5390
|
-
if (el !== null) {
|
|
5391
|
-
/* @ts-ignore */
|
|
5392
|
-
if (el.createTextRange) {
|
|
5393
|
-
/* @ts-ignore */
|
|
5394
|
-
var range = el.createTextRange();
|
|
5395
|
-
range.move('character', caretPos);
|
|
5396
|
-
range.select();
|
|
5397
|
-
return true;
|
|
5398
|
-
}
|
|
5399
|
-
// (el.selectionStart === 0 added for Firefox bug)
|
|
5400
|
-
if (el.selectionStart || el.selectionStart === 0) {
|
|
5401
|
-
el.focus();
|
|
5402
|
-
el.setSelectionRange(caretPos, caretPos);
|
|
5403
|
-
return true;
|
|
5404
|
-
}
|
|
5405
|
-
// fail city, fortunately this never happens (as far as I've tested) :)
|
|
5406
|
-
el.focus();
|
|
5407
|
-
return false;
|
|
5408
|
-
}
|
|
5409
|
-
}
|
|
5410
|
-
/**
|
|
5411
|
-
* TODO: remove dependency of findChangeRange, findChangedRangeFromCaretPositions is better way to find what is changed
|
|
5412
|
-
* currently this is mostly required by test and isCharacterSame util
|
|
5413
|
-
* Given previous value and newValue it returns the index
|
|
5414
|
-
* start - end to which values have changed.
|
|
5415
|
-
* This function makes assumption about only consecutive
|
|
5416
|
-
* characters are changed which is correct assumption for caret input.
|
|
5417
|
-
*/
|
|
5418
|
-
var findChangeRange = memoizeOnce(function (prevValue, newValue) {
|
|
5419
|
-
var i = 0, j = 0;
|
|
5420
|
-
var prevLength = prevValue.length;
|
|
5421
|
-
var newLength = newValue.length;
|
|
5422
|
-
while (prevValue[i] === newValue[i] && i < prevLength)
|
|
5423
|
-
{ i++; }
|
|
5424
|
-
//check what has been changed from last
|
|
5425
|
-
while (prevValue[prevLength - 1 - j] === newValue[newLength - 1 - j] &&
|
|
5426
|
-
newLength - j > i &&
|
|
5427
|
-
prevLength - j > i) {
|
|
5428
|
-
j++;
|
|
5429
|
-
}
|
|
5430
|
-
return {
|
|
5431
|
-
from: { start: i, end: prevLength - j },
|
|
5432
|
-
to: { start: i, end: newLength - j },
|
|
5433
|
-
};
|
|
5434
|
-
});
|
|
5435
|
-
var findChangedRangeFromCaretPositions = function (lastCaretPositions, currentCaretPosition) {
|
|
5436
|
-
var startPosition = Math.min(lastCaretPositions.selectionStart, currentCaretPosition);
|
|
5437
|
-
return {
|
|
5438
|
-
from: { start: startPosition, end: lastCaretPositions.selectionEnd },
|
|
5439
|
-
to: { start: startPosition, end: currentCaretPosition },
|
|
5440
|
-
};
|
|
5441
|
-
};
|
|
5442
|
-
/*
|
|
5443
|
-
Returns a number whose value is limited to the given range
|
|
5444
|
-
*/
|
|
5445
|
-
function clamp(num, min, max) {
|
|
5446
|
-
return Math.min(Math.max(num, min), max);
|
|
5447
|
-
}
|
|
5448
|
-
function geInputCaretPosition(el) {
|
|
5449
|
-
/*Max of selectionStart and selectionEnd is taken for the patch of pixel and other mobile device caret bug*/
|
|
5450
|
-
return Math.max(el.selectionStart, el.selectionEnd);
|
|
5451
|
-
}
|
|
5452
|
-
function addInputMode() {
|
|
5453
|
-
return (typeof navigator !== 'undefined' &&
|
|
5454
|
-
!(navigator.platform && /iPhone|iPod/.test(navigator.platform)));
|
|
5455
|
-
}
|
|
5456
|
-
function getDefaultChangeMeta(value) {
|
|
5457
|
-
return {
|
|
5458
|
-
from: {
|
|
5459
|
-
start: 0,
|
|
5460
|
-
end: 0,
|
|
5461
|
-
},
|
|
5462
|
-
to: {
|
|
5463
|
-
start: 0,
|
|
5464
|
-
end: value.length,
|
|
5465
|
-
},
|
|
5466
|
-
lastValue: '',
|
|
5467
|
-
};
|
|
5468
|
-
}
|
|
5469
|
-
function defaultIsCharacterSame(ref) {
|
|
5470
|
-
var currentValue = ref.currentValue;
|
|
5471
|
-
var formattedValue = ref.formattedValue;
|
|
5472
|
-
var currentValueIndex = ref.currentValueIndex;
|
|
5473
|
-
var formattedValueIndex = ref.formattedValueIndex;
|
|
5474
|
-
|
|
5475
|
-
return currentValue[currentValueIndex] === formattedValue[formattedValueIndex];
|
|
5476
|
-
}
|
|
5477
|
-
function getCaretPosition(newFormattedValue, lastFormattedValue, curValue, curCaretPos, boundary, isValidInputCharacter,
|
|
5478
|
-
/**
|
|
5479
|
-
* format function can change the character, the caret engine relies on mapping old value and new value
|
|
5480
|
-
* In such case if character is changed, parent can tell which chars are equivalent
|
|
5481
|
-
* Some example, all allowedDecimalCharacters are updated to decimalCharacters, 2nd case if user is coverting
|
|
5482
|
-
* number to different numeric system.
|
|
5483
|
-
*/
|
|
5484
|
-
isCharacterSame) {
|
|
5485
|
-
if ( isCharacterSame === void 0 ) isCharacterSame = defaultIsCharacterSame;
|
|
5486
|
-
|
|
5487
|
-
/**
|
|
5488
|
-
* if something got inserted on empty value, add the formatted character before the current value,
|
|
5489
|
-
* This is to avoid the case where typed character is present on format characters
|
|
5490
|
-
*/
|
|
5491
|
-
var firstAllowedPosition = boundary.findIndex(function (b) { return b; });
|
|
5492
|
-
var prefixFormat = newFormattedValue.slice(0, firstAllowedPosition);
|
|
5493
|
-
if (!lastFormattedValue && !curValue.startsWith(prefixFormat)) {
|
|
5494
|
-
lastFormattedValue = prefixFormat;
|
|
5495
|
-
curValue = prefixFormat + curValue;
|
|
5496
|
-
curCaretPos = curCaretPos + prefixFormat.length;
|
|
5497
|
-
}
|
|
5498
|
-
var curValLn = curValue.length;
|
|
5499
|
-
var formattedValueLn = newFormattedValue.length;
|
|
5500
|
-
// create index map
|
|
5501
|
-
var addedIndexMap = {};
|
|
5502
|
-
var indexMap = new Array(curValLn);
|
|
5503
|
-
for (var i = 0; i < curValLn; i++) {
|
|
5504
|
-
indexMap[i] = -1;
|
|
5505
|
-
for (var j = 0, jLn = formattedValueLn; j < jLn; j++) {
|
|
5506
|
-
var isCharSame = isCharacterSame({
|
|
5507
|
-
currentValue: curValue,
|
|
5508
|
-
lastValue: lastFormattedValue,
|
|
5509
|
-
formattedValue: newFormattedValue,
|
|
5510
|
-
currentValueIndex: i,
|
|
5511
|
-
formattedValueIndex: j,
|
|
5512
|
-
});
|
|
5513
|
-
if (isCharSame && addedIndexMap[j] !== true) {
|
|
5514
|
-
indexMap[i] = j;
|
|
5515
|
-
addedIndexMap[j] = true;
|
|
5516
|
-
break;
|
|
5517
|
-
}
|
|
5518
|
-
}
|
|
5519
|
-
}
|
|
5520
|
-
/**
|
|
5521
|
-
* For current caret position find closest characters (left and right side)
|
|
5522
|
-
* which are properly mapped to formatted value.
|
|
5523
|
-
* The idea is that the new caret position will exist always in the boundary of
|
|
5524
|
-
* that mapped index
|
|
5525
|
-
*/
|
|
5526
|
-
var pos = curCaretPos;
|
|
5527
|
-
while (pos < curValLn && (indexMap[pos] === -1 || !isValidInputCharacter(curValue[pos]))) {
|
|
5528
|
-
pos++;
|
|
5529
|
-
}
|
|
5530
|
-
// if the caret position is on last keep the endIndex as last for formatted value
|
|
5531
|
-
var endIndex = pos === curValLn || indexMap[pos] === -1 ? formattedValueLn : indexMap[pos];
|
|
5532
|
-
pos = curCaretPos - 1;
|
|
5533
|
-
while (pos > 0 && indexMap[pos] === -1)
|
|
5534
|
-
{ pos--; }
|
|
5535
|
-
var startIndex = pos === -1 || indexMap[pos] === -1 ? 0 : indexMap[pos] + 1;
|
|
5536
|
-
/**
|
|
5537
|
-
* case where a char is added on suffix and removed from middle, example 2sq345 becoming $2,345 sq
|
|
5538
|
-
* there is still a mapping but the order of start index and end index is changed
|
|
5539
|
-
*/
|
|
5540
|
-
if (startIndex > endIndex)
|
|
5541
|
-
{ return endIndex; }
|
|
5542
|
-
/**
|
|
5543
|
-
* given the current caret position if it closer to startIndex
|
|
5544
|
-
* keep the new caret position on start index or keep it closer to endIndex
|
|
5545
|
-
*/
|
|
5546
|
-
return curCaretPos - startIndex < endIndex - curCaretPos ? startIndex : endIndex;
|
|
5547
|
-
}
|
|
5548
|
-
/* This keeps the caret within typing area so people can't type in between prefix or suffix or format characters */
|
|
5549
|
-
function getCaretPosInBoundary(value, caretPos, boundary, direction) {
|
|
5550
|
-
var valLn = value.length;
|
|
5551
|
-
// clamp caret position to [0, value.length]
|
|
5552
|
-
caretPos = clamp(caretPos, 0, valLn);
|
|
5553
|
-
if (direction === 'left') {
|
|
5554
|
-
while (caretPos >= 0 && !boundary[caretPos])
|
|
5555
|
-
{ caretPos--; }
|
|
5556
|
-
// if we don't find any suitable caret position on left, set it on first allowed position
|
|
5557
|
-
if (caretPos === -1)
|
|
5558
|
-
{ caretPos = boundary.indexOf(true); }
|
|
5559
|
-
}
|
|
5560
|
-
else {
|
|
5561
|
-
while (caretPos <= valLn && !boundary[caretPos])
|
|
5562
|
-
{ caretPos++; }
|
|
5563
|
-
// if we don't find any suitable caret position on right, set it on last allowed position
|
|
5564
|
-
if (caretPos > valLn)
|
|
5565
|
-
{ caretPos = boundary.lastIndexOf(true); }
|
|
5566
|
-
}
|
|
5567
|
-
// if we still don't find caret position, set it at the end of value
|
|
5568
|
-
if (caretPos === -1)
|
|
5569
|
-
{ caretPos = valLn; }
|
|
5570
|
-
return caretPos;
|
|
5571
|
-
}
|
|
5572
|
-
function caretUnknownFormatBoundary(formattedValue) {
|
|
5573
|
-
var boundaryAry = Array.from({ length: formattedValue.length + 1 }).map(function () { return true; });
|
|
5574
|
-
for (var i = 0, ln = boundaryAry.length; i < ln; i++) {
|
|
5575
|
-
// consider caret to be in boundary if it is before or after numeric value
|
|
5576
|
-
boundaryAry[i] = Boolean(charIsNumber(formattedValue[i]) || charIsNumber(formattedValue[i - 1]));
|
|
5577
|
-
}
|
|
5578
|
-
return boundaryAry;
|
|
5579
|
-
}
|
|
5580
|
-
function useInternalValues(value, defaultValue, valueIsNumericString, format, removeFormatting, onValueChange) {
|
|
5581
|
-
if ( onValueChange === void 0 ) onValueChange = noop;
|
|
5582
|
-
|
|
5583
|
-
var getValues = usePersistentCallback(function (value, valueIsNumericString) {
|
|
5584
|
-
var formattedValue, numAsString;
|
|
5585
|
-
if (isNotValidValue(value)) {
|
|
5586
|
-
numAsString = '';
|
|
5587
|
-
formattedValue = '';
|
|
5588
|
-
}
|
|
5589
|
-
else if (typeof value === 'number' || valueIsNumericString) {
|
|
5590
|
-
numAsString = typeof value === 'number' ? toNumericString(value) : value;
|
|
5591
|
-
formattedValue = format(numAsString);
|
|
5592
|
-
}
|
|
5593
|
-
else {
|
|
5594
|
-
numAsString = removeFormatting(value, undefined);
|
|
5595
|
-
formattedValue = format(numAsString);
|
|
5596
|
-
}
|
|
5597
|
-
return { formattedValue: formattedValue, numAsString: numAsString };
|
|
5598
|
-
});
|
|
5599
|
-
var ref = React.useState(function () {
|
|
5600
|
-
return getValues(isNil(value) ? defaultValue : value, valueIsNumericString);
|
|
5601
|
-
});
|
|
5602
|
-
var values = ref[0];
|
|
5603
|
-
var setValues = ref[1];
|
|
5604
|
-
var _onValueChange = function (newValues, sourceInfo) {
|
|
5605
|
-
if (newValues.formattedValue !== values.formattedValue) {
|
|
5606
|
-
setValues({
|
|
5607
|
-
formattedValue: newValues.formattedValue,
|
|
5608
|
-
numAsString: newValues.value,
|
|
5609
|
-
});
|
|
5610
|
-
}
|
|
5611
|
-
// call parent on value change if only if formatted value is changed
|
|
5612
|
-
onValueChange(newValues, sourceInfo);
|
|
5613
|
-
};
|
|
5614
|
-
// if value is switch from controlled to uncontrolled, use the internal state's value to format with new props
|
|
5615
|
-
var _value = value;
|
|
5616
|
-
var _valueIsNumericString = valueIsNumericString;
|
|
5617
|
-
if (isNil(value)) {
|
|
5618
|
-
_value = values.numAsString;
|
|
5619
|
-
_valueIsNumericString = true;
|
|
5620
|
-
}
|
|
5621
|
-
var newValues = getValues(_value, _valueIsNumericString);
|
|
5622
|
-
React.useMemo(function () {
|
|
5623
|
-
setValues(newValues);
|
|
5624
|
-
}, [newValues.formattedValue]);
|
|
5625
|
-
return [values, _onValueChange];
|
|
5626
|
-
}
|
|
5627
|
-
|
|
5628
|
-
function defaultRemoveFormatting(value) {
|
|
5629
|
-
return value.replace(/[^0-9]/g, '');
|
|
5630
|
-
}
|
|
5631
|
-
function defaultFormat(value) {
|
|
5632
|
-
return value;
|
|
5633
|
-
}
|
|
5634
|
-
function NumberFormatBase(props) {
|
|
5635
|
-
var type = props.type; if ( type === void 0 ) type = 'text';
|
|
5636
|
-
var displayType = props.displayType; if ( displayType === void 0 ) displayType = 'input';
|
|
5637
|
-
var customInput = props.customInput;
|
|
5638
|
-
var renderText = props.renderText;
|
|
5639
|
-
var getInputRef = props.getInputRef;
|
|
5640
|
-
var format = props.format; if ( format === void 0 ) format = defaultFormat;
|
|
5641
|
-
var removeFormatting = props.removeFormatting; if ( removeFormatting === void 0 ) removeFormatting = defaultRemoveFormatting;
|
|
5642
|
-
var defaultValue = props.defaultValue;
|
|
5643
|
-
var valueIsNumericString = props.valueIsNumericString;
|
|
5644
|
-
var onValueChange = props.onValueChange;
|
|
5645
|
-
var isAllowed = props.isAllowed;
|
|
5646
|
-
var onChange = props.onChange; if ( onChange === void 0 ) onChange = noop;
|
|
5647
|
-
var onKeyDown = props.onKeyDown; if ( onKeyDown === void 0 ) onKeyDown = noop;
|
|
5648
|
-
var onMouseUp = props.onMouseUp; if ( onMouseUp === void 0 ) onMouseUp = noop;
|
|
5649
|
-
var onFocus = props.onFocus; if ( onFocus === void 0 ) onFocus = noop;
|
|
5650
|
-
var onBlur = props.onBlur; if ( onBlur === void 0 ) onBlur = noop;
|
|
5651
|
-
var propValue = props.value;
|
|
5652
|
-
var getCaretBoundary = props.getCaretBoundary; if ( getCaretBoundary === void 0 ) getCaretBoundary = caretUnknownFormatBoundary;
|
|
5653
|
-
var isValidInputCharacter = props.isValidInputCharacter; if ( isValidInputCharacter === void 0 ) isValidInputCharacter = charIsNumber;
|
|
5654
|
-
var isCharacterSame = props.isCharacterSame;
|
|
5655
|
-
var otherProps = __rest(props, ["type", "displayType", "customInput", "renderText", "getInputRef", "format", "removeFormatting", "defaultValue", "valueIsNumericString", "onValueChange", "isAllowed", "onChange", "onKeyDown", "onMouseUp", "onFocus", "onBlur", "value", "getCaretBoundary", "isValidInputCharacter", "isCharacterSame"]);
|
|
5656
|
-
var ref = useInternalValues(propValue, defaultValue, Boolean(valueIsNumericString), format, removeFormatting, onValueChange);
|
|
5657
|
-
var ref_0 = ref[0];
|
|
5658
|
-
var formattedValue = ref_0.formattedValue;
|
|
5659
|
-
var numAsString = ref_0.numAsString;
|
|
5660
|
-
var onFormattedValueChange = ref[1];
|
|
5661
|
-
var caretPositionBeforeChange = React.useRef();
|
|
5662
|
-
var lastUpdatedValue = React.useRef({ formattedValue: formattedValue, numAsString: numAsString });
|
|
5663
|
-
var _onValueChange = function (values, source) {
|
|
5664
|
-
lastUpdatedValue.current = { formattedValue: values.formattedValue, numAsString: values.value };
|
|
5665
|
-
onFormattedValueChange(values, source);
|
|
5666
|
-
};
|
|
5667
|
-
var ref$1 = React.useState(false);
|
|
5668
|
-
var mounted = ref$1[0];
|
|
5669
|
-
var setMounted = ref$1[1];
|
|
5670
|
-
var focusedElm = React.useRef(null);
|
|
5671
|
-
var timeout = React.useRef({
|
|
5672
|
-
setCaretTimeout: null,
|
|
5673
|
-
focusTimeout: null,
|
|
5674
|
-
});
|
|
5675
|
-
React.useEffect(function () {
|
|
5676
|
-
setMounted(true);
|
|
5677
|
-
return function () {
|
|
5678
|
-
clearTimeout(timeout.current.setCaretTimeout);
|
|
5679
|
-
clearTimeout(timeout.current.focusTimeout);
|
|
5680
|
-
};
|
|
5681
|
-
}, []);
|
|
5682
|
-
var _format = format;
|
|
5683
|
-
var getValueObject = function (formattedValue, numAsString) {
|
|
5684
|
-
var floatValue = parseFloat(numAsString);
|
|
5685
|
-
return {
|
|
5686
|
-
formattedValue: formattedValue,
|
|
5687
|
-
value: numAsString,
|
|
5688
|
-
floatValue: isNaN(floatValue) ? undefined : floatValue,
|
|
5689
|
-
};
|
|
5690
|
-
};
|
|
5691
|
-
var setPatchedCaretPosition = function (el, caretPos, currentValue) {
|
|
5692
|
-
// don't reset the caret position when the whole input content is selected
|
|
5693
|
-
if (el.selectionStart === 0 && el.selectionEnd === el.value.length)
|
|
5694
|
-
{ return; }
|
|
5695
|
-
/* setting caret position within timeout of 0ms is required for mobile chrome,
|
|
5696
|
-
otherwise browser resets the caret position after we set it
|
|
5697
|
-
We are also setting it without timeout so that in normal browser we don't see the flickering */
|
|
5698
|
-
setCaretPosition(el, caretPos);
|
|
5699
|
-
timeout.current.setCaretTimeout = setTimeout(function () {
|
|
5700
|
-
if (el.value === currentValue && el.selectionStart !== caretPos) {
|
|
5701
|
-
setCaretPosition(el, caretPos);
|
|
5702
|
-
}
|
|
5703
|
-
}, 0);
|
|
5704
|
-
};
|
|
5705
|
-
/* This keeps the caret within typing area so people can't type in between prefix or suffix */
|
|
5706
|
-
var correctCaretPosition = function (value, caretPos, direction) {
|
|
5707
|
-
return getCaretPosInBoundary(value, caretPos, getCaretBoundary(value), direction);
|
|
5708
|
-
};
|
|
5709
|
-
var getNewCaretPosition = function (inputValue, newFormattedValue, caretPos) {
|
|
5710
|
-
var caretBoundary = getCaretBoundary(newFormattedValue);
|
|
5711
|
-
var updatedCaretPos = getCaretPosition(newFormattedValue, formattedValue, inputValue, caretPos, caretBoundary, isValidInputCharacter, isCharacterSame);
|
|
5712
|
-
//correct caret position if its outside of editable area
|
|
5713
|
-
updatedCaretPos = getCaretPosInBoundary(newFormattedValue, updatedCaretPos, caretBoundary);
|
|
5714
|
-
return updatedCaretPos;
|
|
5715
|
-
};
|
|
5716
|
-
var updateValueAndCaretPosition = function (params) {
|
|
5717
|
-
var newFormattedValue = params.formattedValue; if ( newFormattedValue === void 0 ) newFormattedValue = '';
|
|
5718
|
-
var input = params.input;
|
|
5719
|
-
var source = params.source;
|
|
5720
|
-
var event = params.event;
|
|
5721
|
-
var numAsString = params.numAsString;
|
|
5722
|
-
var caretPos;
|
|
5723
|
-
if (input) {
|
|
5724
|
-
var inputValue = params.inputValue || input.value;
|
|
5725
|
-
var currentCaretPosition = geInputCaretPosition(input);
|
|
5726
|
-
/**
|
|
5727
|
-
* set the value imperatively, this is required for IE fix
|
|
5728
|
-
* This is also required as if new caret position is beyond the previous value.
|
|
5729
|
-
* Caret position will not be set correctly
|
|
5730
|
-
*/
|
|
5731
|
-
input.value = newFormattedValue;
|
|
5732
|
-
//get the caret position
|
|
5733
|
-
caretPos = getNewCaretPosition(inputValue, newFormattedValue, currentCaretPosition);
|
|
5734
|
-
//set caret position imperatively
|
|
5735
|
-
if (caretPos !== undefined) {
|
|
5736
|
-
setPatchedCaretPosition(input, caretPos, newFormattedValue);
|
|
5737
|
-
}
|
|
5738
|
-
}
|
|
5739
|
-
if (newFormattedValue !== formattedValue) {
|
|
5740
|
-
// trigger onValueChange synchronously, so parent is updated along with the number format. Fix for #277, #287
|
|
5741
|
-
_onValueChange(getValueObject(newFormattedValue, numAsString), { event: event, source: source });
|
|
5742
|
-
}
|
|
5743
|
-
};
|
|
5744
|
-
/**
|
|
5745
|
-
* if the formatted value is not synced to parent, or if the formatted value is different from last synced value sync it
|
|
5746
|
-
* if the formatting props is removed, in which case last formatted value will be different from the numeric string value
|
|
5747
|
-
* in such case we need to inform the parent.
|
|
5748
|
-
*/
|
|
5749
|
-
React.useEffect(function () {
|
|
5750
|
-
var ref = lastUpdatedValue.current;
|
|
5751
|
-
var lastFormattedValue = ref.formattedValue;
|
|
5752
|
-
var lastNumAsString = ref.numAsString;
|
|
5753
|
-
if (formattedValue !== lastFormattedValue || numAsString !== lastNumAsString) {
|
|
5754
|
-
_onValueChange(getValueObject(formattedValue, numAsString), {
|
|
5755
|
-
event: undefined,
|
|
5756
|
-
source: SourceType.props,
|
|
5757
|
-
});
|
|
5758
|
-
}
|
|
5759
|
-
}, [formattedValue, numAsString]);
|
|
5760
|
-
// also if formatted value is changed from the props, we need to update the caret position
|
|
5761
|
-
// keep the last caret position if element is focused
|
|
5762
|
-
var currentCaretPosition = focusedElm.current
|
|
5763
|
-
? geInputCaretPosition(focusedElm.current)
|
|
5764
|
-
: undefined;
|
|
5765
|
-
// needed to prevent warning with useLayoutEffect on server
|
|
5766
|
-
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
|
|
5767
|
-
useIsomorphicLayoutEffect(function () {
|
|
5768
|
-
var input = focusedElm.current;
|
|
5769
|
-
if (formattedValue !== lastUpdatedValue.current.formattedValue && input) {
|
|
5770
|
-
var caretPos = getNewCaretPosition(lastUpdatedValue.current.formattedValue, formattedValue, currentCaretPosition);
|
|
5771
|
-
/**
|
|
5772
|
-
* set the value imperatively, as we set the caret position as well imperatively.
|
|
5773
|
-
* This is to keep value and caret position in sync
|
|
5774
|
-
*/
|
|
5775
|
-
input.value = formattedValue;
|
|
5776
|
-
setPatchedCaretPosition(input, caretPos, formattedValue);
|
|
5777
|
-
}
|
|
5778
|
-
}, [formattedValue]);
|
|
5779
|
-
var formatInputValue = function (inputValue, event, source) {
|
|
5780
|
-
var input = event.target;
|
|
5781
|
-
var changeRange = caretPositionBeforeChange.current
|
|
5782
|
-
? findChangedRangeFromCaretPositions(caretPositionBeforeChange.current, input.selectionEnd)
|
|
5783
|
-
: findChangeRange(formattedValue, inputValue);
|
|
5784
|
-
var changeMeta = Object.assign(Object.assign({}, changeRange), { lastValue: formattedValue });
|
|
5785
|
-
var _numAsString = removeFormatting(inputValue, changeMeta);
|
|
5786
|
-
var _formattedValue = _format(_numAsString);
|
|
5787
|
-
// formatting can remove some of the number chars, so we need to fine number string again
|
|
5788
|
-
_numAsString = removeFormatting(_formattedValue, undefined);
|
|
5789
|
-
if (isAllowed && !isAllowed(getValueObject(_formattedValue, _numAsString))) {
|
|
5790
|
-
//reset the caret position
|
|
5791
|
-
var input$1 = event.target;
|
|
5792
|
-
var currentCaretPosition = geInputCaretPosition(input$1);
|
|
5793
|
-
var caretPos = getNewCaretPosition(inputValue, formattedValue, currentCaretPosition);
|
|
5794
|
-
input$1.value = formattedValue;
|
|
5795
|
-
setPatchedCaretPosition(input$1, caretPos, formattedValue);
|
|
5796
|
-
return false;
|
|
5797
|
-
}
|
|
5798
|
-
updateValueAndCaretPosition({
|
|
5799
|
-
formattedValue: _formattedValue,
|
|
5800
|
-
numAsString: _numAsString,
|
|
5801
|
-
inputValue: inputValue,
|
|
5802
|
-
event: event,
|
|
5803
|
-
source: source,
|
|
5804
|
-
input: event.target,
|
|
5805
|
-
});
|
|
5806
|
-
return true;
|
|
5807
|
-
};
|
|
5808
|
-
var setCaretPositionInfoBeforeChange = function (el, endOffset) {
|
|
5809
|
-
if ( endOffset === void 0 ) endOffset = 0;
|
|
5810
|
-
|
|
5811
|
-
var selectionStart = el.selectionStart;
|
|
5812
|
-
var selectionEnd = el.selectionEnd;
|
|
5813
|
-
caretPositionBeforeChange.current = { selectionStart: selectionStart, selectionEnd: selectionEnd + endOffset };
|
|
5814
|
-
};
|
|
5815
|
-
var _onChange = function (e) {
|
|
5816
|
-
var el = e.target;
|
|
5817
|
-
var inputValue = el.value;
|
|
5818
|
-
var changed = formatInputValue(inputValue, e, SourceType.event);
|
|
5819
|
-
if (changed)
|
|
5820
|
-
{ onChange(e); }
|
|
5821
|
-
// reset the position, as we have already handled the caret position
|
|
5822
|
-
caretPositionBeforeChange.current = undefined;
|
|
5823
|
-
};
|
|
5824
|
-
var _onKeyDown = function (e) {
|
|
5825
|
-
var el = e.target;
|
|
5826
|
-
var key = e.key;
|
|
5827
|
-
var selectionStart = el.selectionStart;
|
|
5828
|
-
var selectionEnd = el.selectionEnd;
|
|
5829
|
-
var value = el.value; if ( value === void 0 ) value = '';
|
|
5830
|
-
var expectedCaretPosition;
|
|
5831
|
-
//Handle backspace and delete against non numerical/decimal characters or arrow keys
|
|
5832
|
-
if (key === 'ArrowLeft' || key === 'Backspace') {
|
|
5833
|
-
expectedCaretPosition = Math.max(selectionStart - 1, 0);
|
|
5834
|
-
}
|
|
5835
|
-
else if (key === 'ArrowRight') {
|
|
5836
|
-
expectedCaretPosition = Math.min(selectionStart + 1, value.length);
|
|
5837
|
-
}
|
|
5838
|
-
else if (key === 'Delete') {
|
|
5839
|
-
expectedCaretPosition = selectionStart;
|
|
5840
|
-
}
|
|
5841
|
-
// if key is delete and text is not selected keep the end offset to 1, as it deletes one character
|
|
5842
|
-
// this is required as selection is not changed on delete case, which changes the change range calculation
|
|
5843
|
-
var endOffset = 0;
|
|
5844
|
-
if (key === 'Delete' && selectionStart === selectionEnd) {
|
|
5845
|
-
endOffset = 1;
|
|
5846
|
-
}
|
|
5847
|
-
var isArrowKey = key === 'ArrowLeft' || key === 'ArrowRight';
|
|
5848
|
-
//if expectedCaretPosition is not set it means we don't want to Handle keyDown
|
|
5849
|
-
// also if multiple characters are selected don't handle
|
|
5850
|
-
if (expectedCaretPosition === undefined || (selectionStart !== selectionEnd && !isArrowKey)) {
|
|
5851
|
-
onKeyDown(e);
|
|
5852
|
-
// keep information of what was the caret position before keyDown
|
|
5853
|
-
// set it after onKeyDown, in case parent updates the position manually
|
|
5854
|
-
setCaretPositionInfoBeforeChange(el, endOffset);
|
|
5855
|
-
return;
|
|
5856
|
-
}
|
|
5857
|
-
var newCaretPosition = expectedCaretPosition;
|
|
5858
|
-
if (isArrowKey) {
|
|
5859
|
-
var direction = key === 'ArrowLeft' ? 'left' : 'right';
|
|
5860
|
-
newCaretPosition = correctCaretPosition(value, expectedCaretPosition, direction);
|
|
5861
|
-
// arrow left or right only moves the caret, so no need to handle the event, if we are handling it manually
|
|
5862
|
-
if (newCaretPosition !== expectedCaretPosition) {
|
|
5863
|
-
e.preventDefault();
|
|
5864
|
-
}
|
|
5865
|
-
}
|
|
5866
|
-
else if (key === 'Delete' && !isValidInputCharacter(value[expectedCaretPosition])) {
|
|
5867
|
-
// in case of delete go to closest caret boundary on the right side
|
|
5868
|
-
newCaretPosition = correctCaretPosition(value, expectedCaretPosition, 'right');
|
|
5869
|
-
}
|
|
5870
|
-
else if (key === 'Backspace' && !isValidInputCharacter(value[expectedCaretPosition])) {
|
|
5871
|
-
// in case of backspace go to closest caret boundary on the left side
|
|
5872
|
-
newCaretPosition = correctCaretPosition(value, expectedCaretPosition, 'left');
|
|
5873
|
-
}
|
|
5874
|
-
if (newCaretPosition !== expectedCaretPosition) {
|
|
5875
|
-
setPatchedCaretPosition(el, newCaretPosition, value);
|
|
5876
|
-
}
|
|
5877
|
-
onKeyDown(e);
|
|
5878
|
-
setCaretPositionInfoBeforeChange(el, endOffset);
|
|
5879
|
-
};
|
|
5880
|
-
/** required to handle the caret position when click anywhere within the input **/
|
|
5881
|
-
var _onMouseUp = function (e) {
|
|
5882
|
-
var el = e.target;
|
|
5883
|
-
/**
|
|
5884
|
-
* NOTE: we have to give default value for value as in case when custom input is provided
|
|
5885
|
-
* value can come as undefined when nothing is provided on value prop.
|
|
5886
|
-
*/
|
|
5887
|
-
var correctCaretPositionIfRequired = function () {
|
|
5888
|
-
var selectionStart = el.selectionStart;
|
|
5889
|
-
var selectionEnd = el.selectionEnd;
|
|
5890
|
-
var value = el.value; if ( value === void 0 ) value = '';
|
|
5891
|
-
if (selectionStart === selectionEnd) {
|
|
5892
|
-
var caretPosition = correctCaretPosition(value, selectionStart);
|
|
5893
|
-
if (caretPosition !== selectionStart) {
|
|
5894
|
-
setPatchedCaretPosition(el, caretPosition, value);
|
|
5895
|
-
}
|
|
5896
|
-
}
|
|
5897
|
-
};
|
|
5898
|
-
correctCaretPositionIfRequired();
|
|
5899
|
-
// try to correct after selection has updated by browser
|
|
5900
|
-
// this case is required when user clicks on some position while a text is selected on input
|
|
5901
|
-
requestAnimationFrame(function () {
|
|
5902
|
-
correctCaretPositionIfRequired();
|
|
5903
|
-
});
|
|
5904
|
-
onMouseUp(e);
|
|
5905
|
-
setCaretPositionInfoBeforeChange(el);
|
|
5906
|
-
};
|
|
5907
|
-
var _onFocus = function (e) {
|
|
5908
|
-
// Workaround Chrome and Safari bug https://bugs.chromium.org/p/chromium/issues/detail?id=779328
|
|
5909
|
-
// (onFocus event target selectionStart is always 0 before setTimeout)
|
|
5910
|
-
if (e.persist)
|
|
5911
|
-
{ e.persist(); }
|
|
5912
|
-
var el = e.target;
|
|
5913
|
-
var currentTarget = e.currentTarget;
|
|
5914
|
-
focusedElm.current = el;
|
|
5915
|
-
timeout.current.focusTimeout = setTimeout(function () {
|
|
5916
|
-
var selectionStart = el.selectionStart;
|
|
5917
|
-
var selectionEnd = el.selectionEnd;
|
|
5918
|
-
var value = el.value; if ( value === void 0 ) value = '';
|
|
5919
|
-
var caretPosition = correctCaretPosition(value, selectionStart);
|
|
5920
|
-
//setPatchedCaretPosition only when everything is not selected on focus (while tabbing into the field)
|
|
5921
|
-
if (caretPosition !== selectionStart &&
|
|
5922
|
-
!(selectionStart === 0 && selectionEnd === value.length)) {
|
|
5923
|
-
setPatchedCaretPosition(el, caretPosition, value);
|
|
5924
|
-
}
|
|
5925
|
-
onFocus(Object.assign(Object.assign({}, e), { currentTarget: currentTarget }));
|
|
5926
|
-
}, 0);
|
|
5927
|
-
};
|
|
5928
|
-
var _onBlur = function (e) {
|
|
5929
|
-
focusedElm.current = null;
|
|
5930
|
-
clearTimeout(timeout.current.focusTimeout);
|
|
5931
|
-
clearTimeout(timeout.current.setCaretTimeout);
|
|
5932
|
-
onBlur(e);
|
|
5933
|
-
};
|
|
5934
|
-
// add input mode on element based on format prop and device once the component is mounted
|
|
5935
|
-
var inputMode = mounted && addInputMode() ? 'numeric' : undefined;
|
|
5936
|
-
var inputProps = Object.assign({ inputMode: inputMode }, otherProps, {
|
|
5937
|
-
type: type,
|
|
5938
|
-
value: formattedValue,
|
|
5939
|
-
onChange: _onChange,
|
|
5940
|
-
onKeyDown: _onKeyDown,
|
|
5941
|
-
onMouseUp: _onMouseUp,
|
|
5942
|
-
onFocus: _onFocus,
|
|
5943
|
-
onBlur: _onBlur,
|
|
5944
|
-
});
|
|
5945
|
-
if (displayType === 'text') {
|
|
5946
|
-
return renderText ? (React.createElement(React.Fragment, null, renderText(formattedValue, otherProps) || null)) : (React.createElement("span", Object.assign({}, otherProps, { ref: getInputRef }), formattedValue));
|
|
5947
|
-
}
|
|
5948
|
-
else if (customInput) {
|
|
5949
|
-
var CustomInput = customInput;
|
|
5950
|
-
/* @ts-ignore */
|
|
5951
|
-
return React.createElement(CustomInput, Object.assign({}, inputProps, { ref: getInputRef }));
|
|
5952
|
-
}
|
|
5953
|
-
return React.createElement("input", Object.assign({}, inputProps, { ref: getInputRef }));
|
|
5954
|
-
}
|
|
5955
|
-
|
|
5956
|
-
function format(numStr, props) {
|
|
5957
|
-
var decimalScale = props.decimalScale;
|
|
5958
|
-
var fixedDecimalScale = props.fixedDecimalScale;
|
|
5959
|
-
var prefix = props.prefix; if ( prefix === void 0 ) prefix = '';
|
|
5960
|
-
var suffix = props.suffix; if ( suffix === void 0 ) suffix = '';
|
|
5961
|
-
var allowNegative = props.allowNegative;
|
|
5962
|
-
var thousandsGroupStyle = props.thousandsGroupStyle; if ( thousandsGroupStyle === void 0 ) thousandsGroupStyle = 'thousand';
|
|
5963
|
-
// don't apply formatting on empty string or '-'
|
|
5964
|
-
if (numStr === '' || numStr === '-') {
|
|
5965
|
-
return numStr;
|
|
5966
|
-
}
|
|
5967
|
-
var ref = getSeparators(props);
|
|
5968
|
-
var thousandSeparator = ref.thousandSeparator;
|
|
5969
|
-
var decimalSeparator = ref.decimalSeparator;
|
|
5970
|
-
/**
|
|
5971
|
-
* Keep the decimal separator
|
|
5972
|
-
* when decimalScale is not defined or non zero and the numStr has decimal in it
|
|
5973
|
-
* Or if decimalScale is > 0 and fixeDecimalScale is true (even if numStr has no decimal)
|
|
5974
|
-
*/
|
|
5975
|
-
var hasDecimalSeparator = (decimalScale !== 0 && numStr.indexOf('.') !== -1) || (decimalScale && fixedDecimalScale);
|
|
5976
|
-
var ref$1 = splitDecimal(numStr, allowNegative);
|
|
5977
|
-
var beforeDecimal = ref$1.beforeDecimal;
|
|
5978
|
-
var afterDecimal = ref$1.afterDecimal;
|
|
5979
|
-
var addNegation = ref$1.addNegation; // eslint-disable-line prefer-const
|
|
5980
|
-
//apply decimal precision if its defined
|
|
5981
|
-
if (decimalScale !== undefined) {
|
|
5982
|
-
afterDecimal = limitToScale(afterDecimal, decimalScale, !!fixedDecimalScale);
|
|
5983
|
-
}
|
|
5984
|
-
if (thousandSeparator) {
|
|
5985
|
-
beforeDecimal = applyThousandSeparator(beforeDecimal, thousandSeparator, thousandsGroupStyle);
|
|
5986
|
-
}
|
|
5987
|
-
//add prefix and suffix when there is a number present
|
|
5988
|
-
if (prefix)
|
|
5989
|
-
{ beforeDecimal = prefix + beforeDecimal; }
|
|
5990
|
-
if (suffix)
|
|
5991
|
-
{ afterDecimal = afterDecimal + suffix; }
|
|
5992
|
-
//restore negation sign
|
|
5993
|
-
if (addNegation)
|
|
5994
|
-
{ beforeDecimal = '-' + beforeDecimal; }
|
|
5995
|
-
numStr = beforeDecimal + ((hasDecimalSeparator && decimalSeparator) || '') + afterDecimal;
|
|
5996
|
-
return numStr;
|
|
5997
|
-
}
|
|
5998
|
-
function getSeparators(props) {
|
|
5999
|
-
var decimalSeparator = props.decimalSeparator; if ( decimalSeparator === void 0 ) decimalSeparator = '.';
|
|
6000
|
-
var thousandSeparator = props.thousandSeparator;
|
|
6001
|
-
var allowedDecimalSeparators = props.allowedDecimalSeparators;
|
|
6002
|
-
if (thousandSeparator === true) {
|
|
6003
|
-
thousandSeparator = ',';
|
|
6004
|
-
}
|
|
6005
|
-
if (!allowedDecimalSeparators) {
|
|
6006
|
-
allowedDecimalSeparators = [decimalSeparator, '.'];
|
|
6007
|
-
}
|
|
6008
|
-
return {
|
|
6009
|
-
decimalSeparator: decimalSeparator,
|
|
6010
|
-
thousandSeparator: thousandSeparator,
|
|
6011
|
-
allowedDecimalSeparators: allowedDecimalSeparators,
|
|
6012
|
-
};
|
|
6013
|
-
}
|
|
6014
|
-
function handleNegation(value, allowNegative) {
|
|
6015
|
-
if ( value === void 0 ) value = '';
|
|
6016
|
-
|
|
6017
|
-
var negationRegex = new RegExp('(-)');
|
|
6018
|
-
var doubleNegationRegex = new RegExp('(-)(.)*(-)');
|
|
6019
|
-
// Check number has '-' value
|
|
6020
|
-
var hasNegation = negationRegex.test(value);
|
|
6021
|
-
// Check number has 2 or more '-' values
|
|
6022
|
-
var removeNegation = doubleNegationRegex.test(value);
|
|
6023
|
-
//remove negation
|
|
6024
|
-
value = value.replace(/-/g, '');
|
|
6025
|
-
if (hasNegation && !removeNegation && allowNegative) {
|
|
6026
|
-
value = '-' + value;
|
|
6027
|
-
}
|
|
6028
|
-
return value;
|
|
6029
|
-
}
|
|
6030
|
-
function getNumberRegex(decimalSeparator, global) {
|
|
6031
|
-
return new RegExp(("(^-)|[0-9]|" + (escapeRegExp(decimalSeparator))), global ? 'g' : undefined);
|
|
6032
|
-
}
|
|
6033
|
-
function isNumericString(val, prefix, suffix) {
|
|
6034
|
-
// for empty value we can always treat it as numeric string
|
|
6035
|
-
if (val === '')
|
|
6036
|
-
{ return true; }
|
|
6037
|
-
return (!(prefix === null || prefix === void 0 ? void 0 : prefix.match(/\d/)) && !(suffix === null || suffix === void 0 ? void 0 : suffix.match(/\d/)) && typeof val === 'string' && !isNaN(Number(val)));
|
|
6038
|
-
}
|
|
6039
|
-
function removeFormatting(value, changeMeta, props) {
|
|
6040
|
-
var assign;
|
|
6041
|
-
|
|
6042
|
-
if ( changeMeta === void 0 ) changeMeta = getDefaultChangeMeta(value);
|
|
6043
|
-
var allowNegative = props.allowNegative;
|
|
6044
|
-
var prefix = props.prefix; if ( prefix === void 0 ) prefix = '';
|
|
6045
|
-
var suffix = props.suffix; if ( suffix === void 0 ) suffix = '';
|
|
6046
|
-
var decimalScale = props.decimalScale;
|
|
6047
|
-
var from = changeMeta.from;
|
|
6048
|
-
var to = changeMeta.to;
|
|
6049
|
-
var start = to.start;
|
|
6050
|
-
var end = to.end;
|
|
6051
|
-
var ref = getSeparators(props);
|
|
6052
|
-
var allowedDecimalSeparators = ref.allowedDecimalSeparators;
|
|
6053
|
-
var decimalSeparator = ref.decimalSeparator;
|
|
6054
|
-
var isBeforeDecimalSeparator = value[end] === decimalSeparator;
|
|
6055
|
-
/**
|
|
6056
|
-
* If only a number is added on empty input which matches with the prefix or suffix,
|
|
6057
|
-
* then don't remove it, just return the same
|
|
6058
|
-
*/
|
|
6059
|
-
if (charIsNumber(value) &&
|
|
6060
|
-
(value === prefix || value === suffix) &&
|
|
6061
|
-
changeMeta.lastValue === '') {
|
|
6062
|
-
return value;
|
|
6063
|
-
}
|
|
6064
|
-
/** Check for any allowed decimal separator is added in the numeric format and replace it with decimal separator */
|
|
6065
|
-
if (end - start === 1 && allowedDecimalSeparators.indexOf(value[start]) !== -1) {
|
|
6066
|
-
var separator = decimalScale === 0 ? '' : decimalSeparator;
|
|
6067
|
-
value = value.substring(0, start) + separator + value.substring(start + 1, value.length);
|
|
6068
|
-
}
|
|
6069
|
-
var stripNegation = function (value, start, end) {
|
|
6070
|
-
/**
|
|
6071
|
-
* if prefix starts with - we don't allow negative number to avoid confusion
|
|
6072
|
-
* if suffix starts with - and the value length is same as suffix length, then the - sign is from the suffix
|
|
6073
|
-
* In other cases, if the value starts with - then it is a negation
|
|
6074
|
-
*/
|
|
6075
|
-
var hasNegation = false;
|
|
6076
|
-
var hasDoubleNegation = false;
|
|
6077
|
-
if (prefix.startsWith('-')) {
|
|
6078
|
-
hasNegation = false;
|
|
6079
|
-
}
|
|
6080
|
-
else if (value.startsWith('--')) {
|
|
6081
|
-
hasNegation = false;
|
|
6082
|
-
hasDoubleNegation = true;
|
|
6083
|
-
}
|
|
6084
|
-
else if (suffix.startsWith('-') && value.length === suffix.length) {
|
|
6085
|
-
hasNegation = false;
|
|
6086
|
-
}
|
|
6087
|
-
else if (value[0] === '-') {
|
|
6088
|
-
hasNegation = true;
|
|
6089
|
-
}
|
|
6090
|
-
var charsToRemove = hasNegation ? 1 : 0;
|
|
6091
|
-
if (hasDoubleNegation)
|
|
6092
|
-
{ charsToRemove = 2; }
|
|
6093
|
-
// remove negation/double negation from start to simplify prefix logic as negation comes before prefix
|
|
6094
|
-
if (charsToRemove) {
|
|
6095
|
-
value = value.substring(charsToRemove);
|
|
6096
|
-
// account for the removal of the negation for start and end index
|
|
6097
|
-
start -= charsToRemove;
|
|
6098
|
-
end -= charsToRemove;
|
|
6099
|
-
}
|
|
6100
|
-
return { value: value, start: start, end: end, hasNegation: hasNegation };
|
|
6101
|
-
};
|
|
6102
|
-
var toMetadata = stripNegation(value, start, end);
|
|
6103
|
-
var hasNegation = toMetadata.hasNegation;
|
|
6104
|
-
((assign = toMetadata, value = assign.value, start = assign.start, end = assign.end));
|
|
6105
|
-
var ref$1 = stripNegation(changeMeta.lastValue, from.start, from.end);
|
|
6106
|
-
var fromStart = ref$1.start;
|
|
6107
|
-
var fromEnd = ref$1.end;
|
|
6108
|
-
var lastValue = ref$1.value;
|
|
6109
|
-
// if only prefix and suffix part is updated reset the value to last value
|
|
6110
|
-
// if the changed range is from suffix in the updated value, and the the suffix starts with the same characters, allow the change
|
|
6111
|
-
var updatedSuffixPart = value.substring(start, end);
|
|
6112
|
-
if (value.length &&
|
|
6113
|
-
lastValue.length &&
|
|
6114
|
-
(fromStart > lastValue.length - suffix.length || fromEnd < prefix.length) &&
|
|
6115
|
-
!(updatedSuffixPart && suffix.startsWith(updatedSuffixPart))) {
|
|
6116
|
-
value = lastValue;
|
|
6117
|
-
}
|
|
6118
|
-
/**
|
|
6119
|
-
* remove prefix
|
|
6120
|
-
* Remove whole prefix part if its present on the value
|
|
6121
|
-
* If the prefix is partially deleted (in which case change start index will be less the prefix length)
|
|
6122
|
-
* Remove only partial part of prefix.
|
|
6123
|
-
*/
|
|
6124
|
-
var startIndex = 0;
|
|
6125
|
-
if (value.startsWith(prefix))
|
|
6126
|
-
{ startIndex += prefix.length; }
|
|
6127
|
-
else if (start < prefix.length)
|
|
6128
|
-
{ startIndex = start; }
|
|
6129
|
-
value = value.substring(startIndex);
|
|
6130
|
-
// account for deleted prefix for end
|
|
6131
|
-
end -= startIndex;
|
|
6132
|
-
/**
|
|
6133
|
-
* Remove suffix
|
|
6134
|
-
* Remove whole suffix part if its present on the value
|
|
6135
|
-
* If the suffix is partially deleted (in which case change end index will be greater than the suffixStartIndex)
|
|
6136
|
-
* remove the partial part of suffix
|
|
6137
|
-
*/
|
|
6138
|
-
var endIndex = value.length;
|
|
6139
|
-
var suffixStartIndex = value.length - suffix.length;
|
|
6140
|
-
if (value.endsWith(suffix))
|
|
6141
|
-
{ endIndex = suffixStartIndex; }
|
|
6142
|
-
// if the suffix is removed from the end
|
|
6143
|
-
else if (end > suffixStartIndex)
|
|
6144
|
-
{ endIndex = end; }
|
|
6145
|
-
// if the suffix is removed from start
|
|
6146
|
-
else if (end > value.length - suffix.length)
|
|
6147
|
-
{ endIndex = end; }
|
|
6148
|
-
value = value.substring(0, endIndex);
|
|
6149
|
-
// add the negation back and handle for double negation
|
|
6150
|
-
value = handleNegation(hasNegation ? ("-" + value) : value, allowNegative);
|
|
6151
|
-
// remove non numeric characters
|
|
6152
|
-
value = (value.match(getNumberRegex(decimalSeparator, true)) || []).join('');
|
|
6153
|
-
// replace the decimalSeparator with ., and only keep the first separator, ignore following ones
|
|
6154
|
-
var firstIndex = value.indexOf(decimalSeparator);
|
|
6155
|
-
value = value.replace(new RegExp(escapeRegExp(decimalSeparator), 'g'), function (match, index) {
|
|
6156
|
-
return index === firstIndex ? '.' : '';
|
|
6157
|
-
});
|
|
6158
|
-
//check if beforeDecimal got deleted and there is nothing after decimal,
|
|
6159
|
-
//clear all numbers in such case while keeping the - sign
|
|
6160
|
-
var ref$2 = splitDecimal(value, allowNegative);
|
|
6161
|
-
var beforeDecimal = ref$2.beforeDecimal;
|
|
6162
|
-
var afterDecimal = ref$2.afterDecimal;
|
|
6163
|
-
var addNegation = ref$2.addNegation; // eslint-disable-line prefer-const
|
|
6164
|
-
//clear only if something got deleted before decimal (cursor is before decimal)
|
|
6165
|
-
if (to.end - to.start < from.end - from.start &&
|
|
6166
|
-
beforeDecimal === '' &&
|
|
6167
|
-
isBeforeDecimalSeparator &&
|
|
6168
|
-
!parseFloat(afterDecimal)) {
|
|
6169
|
-
value = addNegation ? '-' : '';
|
|
6170
|
-
}
|
|
6171
|
-
return value;
|
|
6172
|
-
}
|
|
6173
|
-
function getCaretBoundary(formattedValue, props) {
|
|
6174
|
-
var prefix = props.prefix; if ( prefix === void 0 ) prefix = '';
|
|
6175
|
-
var suffix = props.suffix; if ( suffix === void 0 ) suffix = '';
|
|
6176
|
-
var boundaryAry = Array.from({ length: formattedValue.length + 1 }).map(function () { return true; });
|
|
6177
|
-
var hasNegation = formattedValue[0] === '-';
|
|
6178
|
-
// fill for prefix and negation
|
|
6179
|
-
boundaryAry.fill(false, 0, prefix.length + (hasNegation ? 1 : 0));
|
|
6180
|
-
// fill for suffix
|
|
6181
|
-
var valLn = formattedValue.length;
|
|
6182
|
-
boundaryAry.fill(false, valLn - suffix.length + 1, valLn + 1);
|
|
6183
|
-
return boundaryAry;
|
|
6184
|
-
}
|
|
6185
|
-
function validateAndUpdateProps(props) {
|
|
6186
|
-
var ref = getSeparators(props);
|
|
6187
|
-
var thousandSeparator = ref.thousandSeparator;
|
|
6188
|
-
var decimalSeparator = ref.decimalSeparator;
|
|
6189
|
-
// eslint-disable-next-line prefer-const
|
|
6190
|
-
var prefix = props.prefix; if ( prefix === void 0 ) prefix = '';
|
|
6191
|
-
var allowNegative = props.allowNegative; if ( allowNegative === void 0 ) allowNegative = true;
|
|
6192
|
-
if (thousandSeparator === decimalSeparator) {
|
|
6193
|
-
throw new Error(("\n Decimal separator can't be same as thousand separator.\n thousandSeparator: " + thousandSeparator + " (thousandSeparator = {true} is same as thousandSeparator = \",\")\n decimalSeparator: " + decimalSeparator + " (default value for decimalSeparator is .)\n "));
|
|
6194
|
-
}
|
|
6195
|
-
if (prefix.startsWith('-') && allowNegative) {
|
|
6196
|
-
// TODO: throw error in next major version
|
|
6197
|
-
console.error(("\n Prefix can't start with '-' when allowNegative is true.\n prefix: " + prefix + "\n allowNegative: " + allowNegative + "\n "));
|
|
6198
|
-
allowNegative = false;
|
|
6199
|
-
}
|
|
6200
|
-
return Object.assign(Object.assign({}, props), { allowNegative: allowNegative });
|
|
6201
|
-
}
|
|
6202
|
-
function useNumericFormat(props) {
|
|
6203
|
-
// validate props
|
|
6204
|
-
props = validateAndUpdateProps(props);
|
|
6205
|
-
props.decimalSeparator;
|
|
6206
|
-
props.allowedDecimalSeparators;
|
|
6207
|
-
props.thousandsGroupStyle;
|
|
6208
|
-
var suffix = props.suffix;
|
|
6209
|
-
var allowNegative = props.allowNegative;
|
|
6210
|
-
var allowLeadingZeros = props.allowLeadingZeros;
|
|
6211
|
-
var onKeyDown = props.onKeyDown; if ( onKeyDown === void 0 ) onKeyDown = noop;
|
|
6212
|
-
var onBlur = props.onBlur; if ( onBlur === void 0 ) onBlur = noop;
|
|
6213
|
-
var thousandSeparator = props.thousandSeparator;
|
|
6214
|
-
var decimalScale = props.decimalScale;
|
|
6215
|
-
var fixedDecimalScale = props.fixedDecimalScale;
|
|
6216
|
-
var prefix = props.prefix; if ( prefix === void 0 ) prefix = '';
|
|
6217
|
-
var defaultValue = props.defaultValue;
|
|
6218
|
-
var value = props.value;
|
|
6219
|
-
var valueIsNumericString = props.valueIsNumericString;
|
|
6220
|
-
var onValueChange = props.onValueChange;
|
|
6221
|
-
var restProps = __rest(props, ["decimalSeparator", "allowedDecimalSeparators", "thousandsGroupStyle", "suffix", "allowNegative", "allowLeadingZeros", "onKeyDown", "onBlur", "thousandSeparator", "decimalScale", "fixedDecimalScale", "prefix", "defaultValue", "value", "valueIsNumericString", "onValueChange"]);
|
|
6222
|
-
// get derived decimalSeparator and allowedDecimalSeparators
|
|
6223
|
-
var ref = getSeparators(props);
|
|
6224
|
-
var decimalSeparator = ref.decimalSeparator;
|
|
6225
|
-
var allowedDecimalSeparators = ref.allowedDecimalSeparators;
|
|
6226
|
-
var _format = function (numStr) { return format(numStr, props); };
|
|
6227
|
-
var _removeFormatting = function (inputValue, changeMeta) { return removeFormatting(inputValue, changeMeta, props); };
|
|
6228
|
-
var _value = isNil(value) ? defaultValue : value;
|
|
6229
|
-
// try to figure out isValueNumericString based on format prop and value
|
|
6230
|
-
var _valueIsNumericString = valueIsNumericString !== null && valueIsNumericString !== void 0 ? valueIsNumericString : isNumericString(_value, prefix, suffix);
|
|
6231
|
-
if (!isNil(value)) {
|
|
6232
|
-
_valueIsNumericString = _valueIsNumericString || typeof value === 'number';
|
|
6233
|
-
}
|
|
6234
|
-
else if (!isNil(defaultValue)) {
|
|
6235
|
-
_valueIsNumericString = _valueIsNumericString || typeof defaultValue === 'number';
|
|
6236
|
-
}
|
|
6237
|
-
var roundIncomingValueToPrecision = function (value) {
|
|
6238
|
-
if (isNotValidValue(value))
|
|
6239
|
-
{ return value; }
|
|
6240
|
-
if (typeof value === 'number') {
|
|
6241
|
-
value = toNumericString(value);
|
|
6242
|
-
}
|
|
6243
|
-
/**
|
|
6244
|
-
* only round numeric or float string values coming through props,
|
|
6245
|
-
* we don't need to do it for onChange events, as we want to prevent typing there
|
|
6246
|
-
*/
|
|
6247
|
-
if (_valueIsNumericString && typeof decimalScale === 'number') {
|
|
6248
|
-
return roundToPrecision(value, decimalScale, Boolean(fixedDecimalScale));
|
|
6249
|
-
}
|
|
6250
|
-
return value;
|
|
6251
|
-
};
|
|
6252
|
-
var ref$1 = useInternalValues(roundIncomingValueToPrecision(value), roundIncomingValueToPrecision(defaultValue), Boolean(_valueIsNumericString), _format, _removeFormatting, onValueChange);
|
|
6253
|
-
var ref$1_0 = ref$1[0];
|
|
6254
|
-
var numAsString = ref$1_0.numAsString;
|
|
6255
|
-
var formattedValue = ref$1_0.formattedValue;
|
|
6256
|
-
var _onValueChange = ref$1[1];
|
|
6257
|
-
var _onKeyDown = function (e) {
|
|
6258
|
-
var el = e.target;
|
|
6259
|
-
var key = e.key;
|
|
6260
|
-
var selectionStart = el.selectionStart;
|
|
6261
|
-
var selectionEnd = el.selectionEnd;
|
|
6262
|
-
var value = el.value; if ( value === void 0 ) value = '';
|
|
6263
|
-
// if user tries to delete partial prefix then ignore it
|
|
6264
|
-
if ((key === 'Backspace' || key === 'Delete') && selectionEnd < prefix.length) {
|
|
6265
|
-
e.preventDefault();
|
|
6266
|
-
return;
|
|
6267
|
-
}
|
|
6268
|
-
// if multiple characters are selected and user hits backspace, no need to handle anything manually
|
|
6269
|
-
if (selectionStart !== selectionEnd) {
|
|
6270
|
-
onKeyDown(e);
|
|
6271
|
-
return;
|
|
6272
|
-
}
|
|
6273
|
-
// if user hits backspace, while the cursor is before prefix, and the input has negation, remove the negation
|
|
6274
|
-
if (key === 'Backspace' &&
|
|
6275
|
-
value[0] === '-' &&
|
|
6276
|
-
selectionStart === prefix.length + 1 &&
|
|
6277
|
-
allowNegative) {
|
|
6278
|
-
// bring the cursor to after negation
|
|
6279
|
-
setCaretPosition(el, 1);
|
|
6280
|
-
}
|
|
6281
|
-
// don't allow user to delete decimal separator when decimalScale and fixedDecimalScale is set
|
|
6282
|
-
if (decimalScale && fixedDecimalScale) {
|
|
6283
|
-
if (key === 'Backspace' && value[selectionStart - 1] === decimalSeparator) {
|
|
6284
|
-
setCaretPosition(el, selectionStart - 1);
|
|
6285
|
-
e.preventDefault();
|
|
6286
|
-
}
|
|
6287
|
-
else if (key === 'Delete' && value[selectionStart] === decimalSeparator) {
|
|
6288
|
-
e.preventDefault();
|
|
6289
|
-
}
|
|
6290
|
-
}
|
|
6291
|
-
// if user presses the allowed decimal separator before the separator, move the cursor after the separator
|
|
6292
|
-
if ((allowedDecimalSeparators === null || allowedDecimalSeparators === void 0 ? void 0 : allowedDecimalSeparators.includes(key)) && value[selectionStart] === decimalSeparator) {
|
|
6293
|
-
setCaretPosition(el, selectionStart + 1);
|
|
6294
|
-
}
|
|
6295
|
-
var _thousandSeparator = thousandSeparator === true ? ',' : thousandSeparator;
|
|
6296
|
-
// move cursor when delete or backspace is pressed before/after thousand separator
|
|
6297
|
-
if (key === 'Backspace' && value[selectionStart - 1] === _thousandSeparator) {
|
|
6298
|
-
setCaretPosition(el, selectionStart - 1);
|
|
6299
|
-
}
|
|
6300
|
-
if (key === 'Delete' && value[selectionStart] === _thousandSeparator) {
|
|
6301
|
-
setCaretPosition(el, selectionStart + 1);
|
|
6302
|
-
}
|
|
6303
|
-
onKeyDown(e);
|
|
6304
|
-
};
|
|
6305
|
-
var _onBlur = function (e) {
|
|
6306
|
-
var _value = numAsString;
|
|
6307
|
-
// if there no no numeric value, clear the input
|
|
6308
|
-
if (!_value.match(/\d/g)) {
|
|
6309
|
-
_value = '';
|
|
6310
|
-
}
|
|
6311
|
-
// clear leading 0s
|
|
6312
|
-
if (!allowLeadingZeros) {
|
|
6313
|
-
_value = fixLeadingZero(_value);
|
|
6314
|
-
}
|
|
6315
|
-
// apply fixedDecimalScale on blur event
|
|
6316
|
-
if (fixedDecimalScale && decimalScale) {
|
|
6317
|
-
_value = roundToPrecision(_value, decimalScale, fixedDecimalScale);
|
|
6318
|
-
}
|
|
6319
|
-
if (_value !== numAsString) {
|
|
6320
|
-
var formattedValue = format(_value, props);
|
|
6321
|
-
_onValueChange({
|
|
6322
|
-
formattedValue: formattedValue,
|
|
6323
|
-
value: _value,
|
|
6324
|
-
floatValue: parseFloat(_value),
|
|
6325
|
-
}, {
|
|
6326
|
-
event: e,
|
|
6327
|
-
source: SourceType.event,
|
|
6328
|
-
});
|
|
6329
|
-
}
|
|
6330
|
-
onBlur(e);
|
|
6331
|
-
};
|
|
6332
|
-
var isValidInputCharacter = function (inputChar) {
|
|
6333
|
-
if (inputChar === decimalSeparator)
|
|
6334
|
-
{ return true; }
|
|
6335
|
-
return charIsNumber(inputChar);
|
|
6336
|
-
};
|
|
6337
|
-
var isCharacterSame = function (ref) {
|
|
6338
|
-
var currentValue = ref.currentValue;
|
|
6339
|
-
var lastValue = ref.lastValue;
|
|
6340
|
-
var formattedValue = ref.formattedValue;
|
|
6341
|
-
var currentValueIndex = ref.currentValueIndex;
|
|
6342
|
-
var formattedValueIndex = ref.formattedValueIndex;
|
|
6343
|
-
|
|
6344
|
-
var curChar = currentValue[currentValueIndex];
|
|
6345
|
-
var newChar = formattedValue[formattedValueIndex];
|
|
6346
|
-
/**
|
|
6347
|
-
* NOTE: as thousand separator and allowedDecimalSeparators can be same, we need to check on
|
|
6348
|
-
* typed range if we have typed any character from allowedDecimalSeparators, in that case we
|
|
6349
|
-
* consider different characters like , and . same within the range of updated value.
|
|
6350
|
-
*/
|
|
6351
|
-
var typedRange = findChangeRange(lastValue, currentValue);
|
|
6352
|
-
var to = typedRange.to;
|
|
6353
|
-
// handle corner case where if we user types a decimal separator with fixedDecimalScale
|
|
6354
|
-
// and pass back float value the cursor jumps. #851
|
|
6355
|
-
var getDecimalSeparatorIndex = function (value) {
|
|
6356
|
-
return _removeFormatting(value).indexOf('.') + prefix.length;
|
|
6357
|
-
};
|
|
6358
|
-
if (value === 0 &&
|
|
6359
|
-
fixedDecimalScale &&
|
|
6360
|
-
decimalScale &&
|
|
6361
|
-
currentValue[to.start] === decimalSeparator &&
|
|
6362
|
-
getDecimalSeparatorIndex(currentValue) < currentValueIndex &&
|
|
6363
|
-
getDecimalSeparatorIndex(formattedValue) > formattedValueIndex) {
|
|
6364
|
-
return false;
|
|
6365
|
-
}
|
|
6366
|
-
if (currentValueIndex >= to.start &&
|
|
6367
|
-
currentValueIndex < to.end &&
|
|
6368
|
-
allowedDecimalSeparators &&
|
|
6369
|
-
allowedDecimalSeparators.includes(curChar) &&
|
|
6370
|
-
newChar === decimalSeparator) {
|
|
6371
|
-
return true;
|
|
6372
|
-
}
|
|
6373
|
-
return curChar === newChar;
|
|
6374
|
-
};
|
|
6375
|
-
return Object.assign(Object.assign({}, restProps), { value: formattedValue, valueIsNumericString: false, isValidInputCharacter: isValidInputCharacter,
|
|
6376
|
-
isCharacterSame: isCharacterSame, onValueChange: _onValueChange, format: _format, removeFormatting: _removeFormatting, getCaretBoundary: function (formattedValue) { return getCaretBoundary(formattedValue, props); }, onKeyDown: _onKeyDown, onBlur: _onBlur });
|
|
6377
|
-
}
|
|
6378
|
-
function NumericFormat(props) {
|
|
6379
|
-
var numericFormatProps = useNumericFormat(props);
|
|
6380
|
-
return React.createElement(NumberFormatBase, Object.assign({}, numericFormatProps));
|
|
6381
|
-
}
|
|
6382
|
-
|
|
6383
|
-
const CalculatorDisplay = ({ value, error, inputRef, editable, placeholder, onChange, numberFormatOptions = {} }) => {
|
|
6384
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [editable ? (jsxRuntime.jsx(NumericFormat, { className: "calculator-display-input", value: value, onValueChange: (vals) => onChange?.(vals.value), placeholder: placeholder ?? '数値を入力', inputMode: "decimal", ...numberFormatOptions })) : (jsxRuntime.jsx("div", { className: "calculator-display-input", children: jsxRuntime.jsx("div", { ref: inputRef, style: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }, children: value ? (jsxRuntime.jsx(NumericFormat, { value: value, displayType: "text", ...numberFormatOptions })) : (jsxRuntime.jsx("span", { className: "text-gray-400", children: placeholder ?? '0' })) }) })), error && jsxRuntime.jsx("div", { className: "calculator-error", children: error })] }));
|
|
6385
|
-
};
|
|
6386
|
-
|
|
6387
|
-
const CalculatorKeypad = ({ onButtonClick, onEqual, onDecide, onTaxInclude, onTaxExclude, enableTaxCalculation = true, decimalPlaces = 6 }) => {
|
|
6388
|
-
// decimalPlacesが0の場合は小数点ボタンを非表示
|
|
6389
|
-
const buttons = decimalPlaces === 0
|
|
6390
|
-
? [
|
|
6391
|
-
['7', '8', '9', '÷'],
|
|
6392
|
-
['4', '5', '6', '×'],
|
|
6393
|
-
['1', '2', '3', '-'],
|
|
6394
|
-
['0', '←'], // 小数点ボタンを削除
|
|
6395
|
-
['+'],
|
|
6396
|
-
]
|
|
6397
|
-
: [
|
|
6398
|
-
['7', '8', '9', '÷'],
|
|
6399
|
-
['4', '5', '6', '×'],
|
|
6400
|
-
['1', '2', '3', '-'],
|
|
6401
|
-
['0', '.', '←'],
|
|
6402
|
-
['+'],
|
|
6403
|
-
];
|
|
6404
|
-
return (jsxRuntime.jsx("div", { className: "calculator-keypad-section", children: jsxRuntime.jsxs("div", { className: "calculator-keypad", children: [enableTaxCalculation && (jsxRuntime.jsxs("div", { className: "calculator-keypad-grid", children: [jsxRuntime.jsxs(Button, { className: "calculator-keypad-button include", onClick: () => onTaxInclude(0.08), tabIndex: 0, children: ["\u7A0E\u8FBC", jsxRuntime.jsx("br", {}), "8%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button include", onClick: () => onTaxInclude(0.10), tabIndex: 0, children: ["\u7A0E\u8FBC", jsxRuntime.jsx("br", {}), "10%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button exclude", onClick: () => onTaxExclude(0.08), tabIndex: 0, children: ["\u7A0E\u629C", jsxRuntime.jsx("br", {}), "8%"] }), jsxRuntime.jsxs(Button, { className: "calculator-keypad-button exclude", onClick: () => onTaxExclude(0.10), tabIndex: 0, children: ["\u7A0E\u629C", jsxRuntime.jsx("br", {}), "10%"] })] })), jsxRuntime.jsx("div", { className: "calculator-keypad-grid", style: { marginTop: '0.25rem' }, children: buttons.flat().map((btn, i) => {
|
|
6405
|
-
let className = 'calculator-keypad-button ';
|
|
6406
|
-
if (['÷', '×', '-', '+'].includes(btn))
|
|
6407
|
-
className += 'operator';
|
|
6408
|
-
else if (btn === '←')
|
|
6409
|
-
className += 'backspace';
|
|
6410
|
-
else if (btn === '0' && decimalPlaces === 0)
|
|
6411
|
-
className += 'number zero-wide'; // 0ボタンを2つ分の幅に
|
|
6412
|
-
else
|
|
6413
|
-
className += 'number';
|
|
6414
|
-
return (jsxRuntime.jsx(Button, { className: className, onClick: () => onButtonClick(btn), tabIndex: 0, children: btn }, btn + i));
|
|
6415
|
-
}) }), jsxRuntime.jsxs("div", { className: "calculator-action-buttons", style: { marginTop: '0.75rem' }, children: [jsxRuntime.jsx(Button, { className: "calculator-keypad-button clear", onClick: () => onButtonClick('C'), children: "C" }), jsxRuntime.jsx(Button, { className: "calculator-equals-button", onClick: onEqual, children: "=" }), jsxRuntime.jsx(Button, { className: "calculator-decide-button", onClick: onDecide, children: "\u6C7A\u5B9A" })] })] }) }));
|
|
6416
|
-
};
|
|
6417
|
-
|
|
6418
5195
|
/*!
|
|
6419
5196
|
* Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com
|
|
6420
5197
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
@@ -6427,7 +5204,6 @@ const faXmark = {
|
|
|
6427
5204
|
};
|
|
6428
5205
|
const faTimes = faXmark;
|
|
6429
5206
|
|
|
6430
|
-
// formatNumber function removed - not used
|
|
6431
5207
|
function normalizeNumberString(num, maxFractionDigits = 6) {
|
|
6432
5208
|
if (!isFinite(num))
|
|
6433
5209
|
return '0';
|
|
@@ -6437,94 +5213,160 @@ function normalizeNumberString(num, maxFractionDigits = 6) {
|
|
|
6437
5213
|
}
|
|
6438
5214
|
function calculateExpression(expr) {
|
|
6439
5215
|
try {
|
|
6440
|
-
const sanitized = expr.replace(/,/g, '').replace(/×/g, '*').replace(/÷/g, '/');
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
5216
|
+
const sanitized = expr.replace(/,/g, '').replace(/×/g, '*').replace(/÷/g, '/').trim();
|
|
5217
|
+
if (!sanitized)
|
|
5218
|
+
return '0';
|
|
5219
|
+
const tokens = sanitized.match(/(\d+(?:\.\d+)?|[+\-*/()])/g);
|
|
5220
|
+
if (!tokens)
|
|
5221
|
+
return '0';
|
|
5222
|
+
const output = [];
|
|
5223
|
+
const operators = [];
|
|
5224
|
+
const precedence = { '+': 1, '-': 1, '*': 2, '/': 2 };
|
|
5225
|
+
for (let i = 0; i < tokens.length; i += 1) {
|
|
5226
|
+
const token = tokens[i];
|
|
5227
|
+
if (/^\d/.test(token)) {
|
|
5228
|
+
output.push(Number(token));
|
|
5229
|
+
continue;
|
|
5230
|
+
}
|
|
5231
|
+
if (token === '(') {
|
|
5232
|
+
operators.push(token);
|
|
5233
|
+
continue;
|
|
5234
|
+
}
|
|
5235
|
+
if (token === ')') {
|
|
5236
|
+
while (operators.length && operators[operators.length - 1] !== '(') {
|
|
5237
|
+
output.push(operators.pop());
|
|
5238
|
+
}
|
|
5239
|
+
if (!operators.length)
|
|
5240
|
+
return '0';
|
|
5241
|
+
operators.pop();
|
|
5242
|
+
continue;
|
|
5243
|
+
}
|
|
5244
|
+
const prevToken = tokens[i - 1];
|
|
5245
|
+
const isUnaryMinus = token === '-' && (i === 0 || ['+', '-', '*', '/', '('].includes(prevToken));
|
|
5246
|
+
if (isUnaryMinus) {
|
|
5247
|
+
const nextToken = tokens[i + 1];
|
|
5248
|
+
if (!nextToken || !/^\d/.test(nextToken))
|
|
5249
|
+
return '0';
|
|
5250
|
+
output.push(Number(`-${nextToken}`));
|
|
5251
|
+
i += 1;
|
|
5252
|
+
continue;
|
|
5253
|
+
}
|
|
5254
|
+
while (operators.length &&
|
|
5255
|
+
operators[operators.length - 1] !== '(' &&
|
|
5256
|
+
precedence[operators[operators.length - 1]] >= precedence[token]) {
|
|
5257
|
+
output.push(operators.pop());
|
|
5258
|
+
}
|
|
5259
|
+
operators.push(token);
|
|
5260
|
+
}
|
|
5261
|
+
while (operators.length) {
|
|
5262
|
+
const operator = operators.pop();
|
|
5263
|
+
if (operator === '(')
|
|
5264
|
+
return '0';
|
|
5265
|
+
output.push(operator);
|
|
5266
|
+
}
|
|
5267
|
+
const stack = [];
|
|
5268
|
+
for (const token of output) {
|
|
5269
|
+
if (typeof token === 'number') {
|
|
5270
|
+
stack.push(token);
|
|
5271
|
+
continue;
|
|
5272
|
+
}
|
|
5273
|
+
const right = stack.pop();
|
|
5274
|
+
const left = stack.pop();
|
|
5275
|
+
if (left === undefined || right === undefined)
|
|
5276
|
+
return '0';
|
|
5277
|
+
switch (token) {
|
|
5278
|
+
case '+':
|
|
5279
|
+
stack.push(left + right);
|
|
5280
|
+
break;
|
|
5281
|
+
case '-':
|
|
5282
|
+
stack.push(left - right);
|
|
5283
|
+
break;
|
|
5284
|
+
case '*':
|
|
5285
|
+
stack.push(left * right);
|
|
5286
|
+
break;
|
|
5287
|
+
case '/':
|
|
5288
|
+
stack.push(right === 0 ? Number.NaN : left / right);
|
|
5289
|
+
break;
|
|
5290
|
+
default:
|
|
5291
|
+
return '0';
|
|
5292
|
+
}
|
|
5293
|
+
}
|
|
5294
|
+
if (stack.length !== 1 || !isFinite(stack[0]))
|
|
6444
5295
|
return '0';
|
|
6445
|
-
return normalizeNumberString(
|
|
5296
|
+
return normalizeNumberString(stack[0]);
|
|
6446
5297
|
}
|
|
6447
5298
|
catch {
|
|
6448
5299
|
return '0';
|
|
6449
5300
|
}
|
|
6450
5301
|
}
|
|
6451
|
-
|
|
5302
|
+
|
|
5303
|
+
function useCalculatorController({ isOpen, initialValue = '', onClose, onCalculate, enableTaxCalculation, decimalPlaces, }) {
|
|
5304
|
+
const operatorButtons = ['+', '-', '×', '÷'];
|
|
6452
5305
|
const [expression, setExpression] = React.useState(initialValue || '');
|
|
6453
5306
|
const [displayValue, setDisplayValue] = React.useState(initialValue || '');
|
|
6454
5307
|
const [error, setError] = React.useState('');
|
|
6455
5308
|
const [isWaitingForOperand, setIsWaitingForOperand] = React.useState(false);
|
|
6456
5309
|
const [mounted, setMounted] = React.useState(false);
|
|
6457
|
-
const inputRef = React.useRef(null);
|
|
6458
|
-
// DOM要素の存在確認
|
|
6459
5310
|
React.useEffect(() => {
|
|
6460
5311
|
setMounted(true);
|
|
6461
5312
|
return () => setMounted(false);
|
|
6462
5313
|
}, []);
|
|
6463
5314
|
React.useEffect(() => {
|
|
6464
|
-
if (isOpen)
|
|
6465
|
-
|
|
6466
|
-
|
|
5315
|
+
if (!isOpen)
|
|
5316
|
+
return;
|
|
5317
|
+
setExpression(initialValue || '');
|
|
5318
|
+
setDisplayValue(initialValue || '');
|
|
5319
|
+
setIsWaitingForOperand(false);
|
|
5320
|
+
setError('');
|
|
5321
|
+
}, [isOpen, initialValue]);
|
|
5322
|
+
const commitExpression = (nextExpression, nextDisplayValue = nextExpression) => {
|
|
5323
|
+
setExpression(nextExpression);
|
|
5324
|
+
setDisplayValue(nextDisplayValue);
|
|
5325
|
+
};
|
|
5326
|
+
const replaceLastNumber = (nextValue) => {
|
|
5327
|
+
setExpression((prev) => prev.replace(/[\d.]+$/, nextValue));
|
|
5328
|
+
};
|
|
5329
|
+
const appendDigit = (val) => {
|
|
5330
|
+
if (isWaitingForOperand) {
|
|
5331
|
+
commitExpression(expression + val, val);
|
|
6467
5332
|
setIsWaitingForOperand(false);
|
|
6468
|
-
|
|
5333
|
+
return;
|
|
6469
5334
|
}
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
5335
|
+
const nextDisplayValue = displayValue === '0' ? val : displayValue + val;
|
|
5336
|
+
commitExpression(expression === '0' ? val : expression + val, nextDisplayValue);
|
|
5337
|
+
};
|
|
5338
|
+
const appendDecimal = () => {
|
|
5339
|
+
if (displayValue.includes('.'))
|
|
6473
5340
|
return;
|
|
6474
|
-
const
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
handleButtonClick('←');
|
|
6494
|
-
e.preventDefault();
|
|
6495
|
-
}
|
|
6496
|
-
else if (e.key === 'Enter' || e.key === '=') {
|
|
6497
|
-
handleDecide();
|
|
6498
|
-
e.preventDefault();
|
|
6499
|
-
}
|
|
6500
|
-
else if (e.key === 'Escape') {
|
|
6501
|
-
onClose();
|
|
6502
|
-
e.preventDefault();
|
|
6503
|
-
}
|
|
6504
|
-
else if (e.key === 'c' || e.key === 'C') {
|
|
6505
|
-
handleButtonClick('C');
|
|
6506
|
-
e.preventDefault();
|
|
6507
|
-
}
|
|
6508
|
-
};
|
|
6509
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
6510
|
-
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
6511
|
-
}, [isOpen, expression, displayValue]);
|
|
5341
|
+
const nextDisplayValue = displayValue ? `${displayValue}.` : '0.';
|
|
5342
|
+
if (isWaitingForOperand) {
|
|
5343
|
+
commitExpression(expression + nextDisplayValue, nextDisplayValue);
|
|
5344
|
+
setIsWaitingForOperand(false);
|
|
5345
|
+
return;
|
|
5346
|
+
}
|
|
5347
|
+
replaceLastNumber(nextDisplayValue);
|
|
5348
|
+
setDisplayValue(nextDisplayValue);
|
|
5349
|
+
};
|
|
5350
|
+
const appendOperator = (val) => {
|
|
5351
|
+
if (!expression)
|
|
5352
|
+
return;
|
|
5353
|
+
const currentResult = calculateExpression(expression);
|
|
5354
|
+
const nextExpression = /[+\-×÷]$/.test(expression)
|
|
5355
|
+
? expression.slice(0, -1) + val
|
|
5356
|
+
: `${currentResult}${val}`;
|
|
5357
|
+
commitExpression(nextExpression, currentResult);
|
|
5358
|
+
setIsWaitingForOperand(true);
|
|
5359
|
+
};
|
|
6512
5360
|
const handleDisplayChange = (newValue) => {
|
|
6513
5361
|
setError('');
|
|
6514
5362
|
setDisplayValue(newValue);
|
|
6515
5363
|
if (isWaitingForOperand) {
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
// Append it to the expression.
|
|
6520
|
-
setExpression(expression + newValue);
|
|
6521
|
-
setIsWaitingForOperand(false); // No longer waiting for operand
|
|
6522
|
-
}
|
|
6523
|
-
else {
|
|
6524
|
-
// 既存の式の最後の数値を置き換える
|
|
6525
|
-
const newExpression = expression.replace(/[\d.]+$/, newValue);
|
|
6526
|
-
setExpression(newExpression);
|
|
5364
|
+
commitExpression(expression + newValue);
|
|
5365
|
+
setIsWaitingForOperand(false);
|
|
5366
|
+
return;
|
|
6527
5367
|
}
|
|
5368
|
+
replaceLastNumber(newValue);
|
|
5369
|
+
setDisplayValue(newValue);
|
|
6528
5370
|
};
|
|
6529
5371
|
const handleButtonClick = (val) => {
|
|
6530
5372
|
setError('');
|
|
@@ -6532,55 +5374,25 @@ const Calculator = ({ isOpen, onClose, onCalculate, initialValue = '', title, de
|
|
|
6532
5374
|
setExpression('');
|
|
6533
5375
|
setDisplayValue('');
|
|
6534
5376
|
setIsWaitingForOperand(false);
|
|
5377
|
+
return;
|
|
6535
5378
|
}
|
|
6536
|
-
|
|
6537
|
-
if (displayValue.length
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
else if (val === '.') {
|
|
6544
|
-
if (!displayValue.includes('.')) {
|
|
6545
|
-
const newDisplayValue = displayValue ? displayValue + '.' : '0.';
|
|
6546
|
-
setDisplayValue(newDisplayValue);
|
|
6547
|
-
if (isWaitingForOperand) {
|
|
6548
|
-
setExpression(expression + newDisplayValue);
|
|
6549
|
-
setIsWaitingForOperand(false);
|
|
6550
|
-
}
|
|
6551
|
-
else {
|
|
6552
|
-
setExpression(expression + (displayValue ? '.' : '0.'));
|
|
6553
|
-
// Append decimal to the last number in the expression
|
|
6554
|
-
const lastNumberRegex = /([\d.]+)$/;
|
|
6555
|
-
setExpression(expression.replace(lastNumberRegex, (match) => match + '.'));
|
|
6556
|
-
}
|
|
6557
|
-
}
|
|
5379
|
+
if (val === '←') {
|
|
5380
|
+
if (displayValue.length === 0)
|
|
5381
|
+
return;
|
|
5382
|
+
const nextDisplayValue = displayValue.slice(0, -1);
|
|
5383
|
+
setDisplayValue(nextDisplayValue);
|
|
5384
|
+
setExpression((prev) => prev.slice(0, -1));
|
|
5385
|
+
return;
|
|
6558
5386
|
}
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
setExpression(expression.slice(0, -1) + val);
|
|
6563
|
-
}
|
|
6564
|
-
else {
|
|
6565
|
-
const result = calculateExpression(expression);
|
|
6566
|
-
setExpression(result + val);
|
|
6567
|
-
setDisplayValue(result);
|
|
6568
|
-
}
|
|
6569
|
-
setIsWaitingForOperand(true);
|
|
6570
|
-
}
|
|
5387
|
+
if (val === '.') {
|
|
5388
|
+
appendDecimal();
|
|
5389
|
+
return;
|
|
6571
5390
|
}
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
setExpression(expression + val);
|
|
6576
|
-
setIsWaitingForOperand(false);
|
|
6577
|
-
}
|
|
6578
|
-
else {
|
|
6579
|
-
const newDisplayValue = displayValue === '0' ? val : displayValue + val;
|
|
6580
|
-
setDisplayValue(newDisplayValue);
|
|
6581
|
-
setExpression(expression === '0' ? val : expression + val);
|
|
6582
|
-
}
|
|
5391
|
+
if (operatorButtons.includes(val)) {
|
|
5392
|
+
appendOperator(val);
|
|
5393
|
+
return;
|
|
6583
5394
|
}
|
|
5395
|
+
appendDigit(val);
|
|
6584
5396
|
};
|
|
6585
5397
|
const handleEqual = () => {
|
|
6586
5398
|
if (!expression)
|
|
@@ -6599,7 +5411,7 @@ const Calculator = ({ isOpen, onClose, onCalculate, initialValue = '', title, de
|
|
|
6599
5411
|
onCalculate(result);
|
|
6600
5412
|
onClose();
|
|
6601
5413
|
};
|
|
6602
|
-
const
|
|
5414
|
+
const updateTaxValue = (compute, rate) => {
|
|
6603
5415
|
if (!enableTaxCalculation)
|
|
6604
5416
|
return;
|
|
6605
5417
|
if (!expression) {
|
|
@@ -6611,33 +5423,95 @@ const Calculator = ({ isOpen, onClose, onCalculate, initialValue = '', title, de
|
|
|
6611
5423
|
setError('有効な金額を入力してください');
|
|
6612
5424
|
return;
|
|
6613
5425
|
}
|
|
6614
|
-
const
|
|
6615
|
-
const result = normalizeNumberString(taxIncluded, decimalPlaces);
|
|
5426
|
+
const result = normalizeNumberString(compute(currentValue, rate), decimalPlaces);
|
|
6616
5427
|
setExpression(result);
|
|
6617
5428
|
setDisplayValue(result);
|
|
6618
5429
|
setError('');
|
|
6619
5430
|
};
|
|
5431
|
+
const handleTaxInclude = (rate) => {
|
|
5432
|
+
updateTaxValue((value, taxRate) => value * (1 + taxRate), rate);
|
|
5433
|
+
};
|
|
6620
5434
|
const handleTaxExclude = (rate) => {
|
|
6621
|
-
|
|
6622
|
-
return;
|
|
6623
|
-
if (!expression) {
|
|
6624
|
-
setError('金額を入力してください');
|
|
6625
|
-
return;
|
|
6626
|
-
}
|
|
6627
|
-
const currentValue = parseFloat(calculateExpression(expression));
|
|
6628
|
-
if (isNaN(currentValue)) {
|
|
6629
|
-
setError('有効な金額を入力してください');
|
|
6630
|
-
return;
|
|
6631
|
-
}
|
|
6632
|
-
const taxExcluded = currentValue / (1 + rate);
|
|
6633
|
-
const result = normalizeNumberString(taxExcluded, decimalPlaces);
|
|
6634
|
-
setExpression(result);
|
|
6635
|
-
setDisplayValue(result);
|
|
6636
|
-
setError('');
|
|
5435
|
+
updateTaxValue((value, taxRate) => value / (1 + taxRate), rate);
|
|
6637
5436
|
};
|
|
5437
|
+
return {
|
|
5438
|
+
mounted,
|
|
5439
|
+
displayValue,
|
|
5440
|
+
error,
|
|
5441
|
+
handleDisplayChange,
|
|
5442
|
+
handleButtonClick,
|
|
5443
|
+
handleEqual,
|
|
5444
|
+
handleDecide,
|
|
5445
|
+
handleTaxInclude,
|
|
5446
|
+
handleTaxExclude,
|
|
5447
|
+
};
|
|
5448
|
+
}
|
|
5449
|
+
|
|
5450
|
+
const Calculator = ({ isOpen, onClose, onCalculate, initialValue = '', title, description, enableTaxCalculation = false, decimalPlaces = 6, numberFormatOptions = {}, placeholder, colors, theme, }) => {
|
|
5451
|
+
const inputRef = React.useRef(null);
|
|
5452
|
+
const { mounted, displayValue, error, handleDisplayChange, handleButtonClick, handleEqual, handleDecide, handleTaxInclude, handleTaxExclude, } = useCalculatorController({
|
|
5453
|
+
isOpen,
|
|
5454
|
+
initialValue,
|
|
5455
|
+
onClose,
|
|
5456
|
+
onCalculate,
|
|
5457
|
+
enableTaxCalculation,
|
|
5458
|
+
decimalPlaces,
|
|
5459
|
+
});
|
|
5460
|
+
React.useEffect(() => {
|
|
5461
|
+
if (!isOpen)
|
|
5462
|
+
return;
|
|
5463
|
+
const handleKeyDown = (e) => {
|
|
5464
|
+
if (!isOpen)
|
|
5465
|
+
return;
|
|
5466
|
+
const activeElement = document.activeElement;
|
|
5467
|
+
if (activeElement && activeElement.tagName === 'INPUT')
|
|
5468
|
+
return;
|
|
5469
|
+
if (e.key >= '0' && e.key <= '9') {
|
|
5470
|
+
handleButtonClick(e.key);
|
|
5471
|
+
e.preventDefault();
|
|
5472
|
+
}
|
|
5473
|
+
else if (e.key === '.') {
|
|
5474
|
+
handleButtonClick('.');
|
|
5475
|
+
e.preventDefault();
|
|
5476
|
+
}
|
|
5477
|
+
else if (e.key === '+' || e.key === '-' || e.key === '*' || e.key === '/') {
|
|
5478
|
+
handleButtonClick(e.key === '*' ? '×' : e.key === '/' ? '÷' : e.key);
|
|
5479
|
+
e.preventDefault();
|
|
5480
|
+
}
|
|
5481
|
+
else if (e.key === 'Backspace') {
|
|
5482
|
+
handleButtonClick('←');
|
|
5483
|
+
e.preventDefault();
|
|
5484
|
+
}
|
|
5485
|
+
else if (e.key === 'Enter' || e.key === '=') {
|
|
5486
|
+
handleDecide();
|
|
5487
|
+
e.preventDefault();
|
|
5488
|
+
}
|
|
5489
|
+
else if (e.key === 'Escape') {
|
|
5490
|
+
onClose();
|
|
5491
|
+
e.preventDefault();
|
|
5492
|
+
}
|
|
5493
|
+
else if (e.key === 'c' || e.key === 'C') {
|
|
5494
|
+
handleButtonClick('C');
|
|
5495
|
+
e.preventDefault();
|
|
5496
|
+
}
|
|
5497
|
+
};
|
|
5498
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
5499
|
+
return () => window.removeEventListener('keydown', handleKeyDown);
|
|
5500
|
+
}, [isOpen, handleButtonClick, handleDecide, onClose]);
|
|
6638
5501
|
if (!isOpen || !mounted)
|
|
6639
5502
|
return null;
|
|
6640
|
-
const
|
|
5503
|
+
const colorTheme = {
|
|
5504
|
+
...theme,
|
|
5505
|
+
...colors,
|
|
5506
|
+
};
|
|
5507
|
+
const themeStyle = {
|
|
5508
|
+
...(colorTheme?.primaryColor ? { '--calculator-primary': colorTheme.primaryColor } : {}),
|
|
5509
|
+
...(colorTheme?.operatorColor ? { '--calculator-operator': colorTheme.operatorColor } : {}),
|
|
5510
|
+
...(colorTheme?.successColor ? { '--calculator-success': colorTheme.successColor } : {}),
|
|
5511
|
+
...(colorTheme?.dangerColor ? { '--calculator-danger': colorTheme.dangerColor } : {}),
|
|
5512
|
+
...(colorTheme?.surfaceColor ? { '--calculator-surface': colorTheme.surfaceColor } : {}),
|
|
5513
|
+
};
|
|
5514
|
+
const modal = (jsxRuntime.jsx("div", { className: "calculator-overlay", style: themeStyle, children: jsxRuntime.jsxs("div", { className: "calculator-modal", children: [title || description ? (jsxRuntime.jsxs("div", { className: "calculator-header", children: [jsxRuntime.jsxs("div", { children: [title && jsxRuntime.jsx("h2", { className: "calculator-title", children: title }), description && jsxRuntime.jsx("p", { className: "calculator-subtitle", children: description })] }), jsxRuntime.jsx("button", { onClick: onClose, className: "calculator-close-button", "aria-label": "\u9589\u3058\u308B", children: jsxRuntime.jsx(Icon, { icon: faTimes, className: "w-5 h-5" }) })] })) : (jsxRuntime.jsxs("div", { className: "calculator-header", children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx("button", { onClick: onClose, className: "calculator-close-button", "aria-label": "\u9589\u3058\u308B", children: jsxRuntime.jsx(Icon, { icon: faTimes, className: "w-5 h-5" }) })] })), jsxRuntime.jsx("div", { className: "calculator-display", children: jsxRuntime.jsx(CalculatorDisplay, { value: displayValue, error: error, inputRef: inputRef, editable: true, onChange: handleDisplayChange, numberFormatOptions: numberFormatOptions, placeholder: placeholder }) }), jsxRuntime.jsx(CalculatorKeypad, { onButtonClick: handleButtonClick, onEqual: handleEqual, onDecide: handleDecide, onTaxInclude: handleTaxInclude, onTaxExclude: handleTaxExclude, enableTaxCalculation: enableTaxCalculation, decimalPlaces: decimalPlaces })] }) }));
|
|
6641
5515
|
// DOM要素の存在確認を行ってからポータルを作成
|
|
6642
5516
|
if (typeof document !== 'undefined' && document.body) {
|
|
6643
5517
|
return reactDom.createPortal(modal, document.body);
|
|
@@ -6645,7 +5519,7 @@ const Calculator = ({ isOpen, onClose, onCalculate, initialValue = '', title, de
|
|
|
6645
5519
|
return null;
|
|
6646
5520
|
};
|
|
6647
5521
|
|
|
6648
|
-
const CalculatorInputForm = ({ value, onChange, placeholder = 'クリックして金額を入力', className, title, description, enableTaxCalculation = false, decimalPlaces = 6, numberFormatOptions = {}, displayPlaceholder, }) => {
|
|
5522
|
+
const CalculatorInputForm = ({ value, onChange, placeholder = 'クリックして金額を入力', className, title, description, enableTaxCalculation = false, decimalPlaces = 6, numberFormatOptions = {}, displayPlaceholder, colors, theme, }) => {
|
|
6649
5523
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
6650
5524
|
const [mounted, setMounted] = React.useState(false);
|
|
6651
5525
|
// DOM要素の存在確認
|
|
@@ -6661,13 +5535,11 @@ const CalculatorInputForm = ({ value, onChange, placeholder = 'クリックし
|
|
|
6661
5535
|
if (!mounted) {
|
|
6662
5536
|
return null;
|
|
6663
5537
|
}
|
|
6664
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(NumericFormat, { value: value, onValueChange: (vals) => onChange(vals.value), placeholder: placeholder, className: className, readOnly: true, onClick: () => setIsOpen(true)
|
|
5538
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(reactNumberFormat.NumericFormat, { ...numberFormatOptions, value: value, onValueChange: (vals) => onChange(vals.value), placeholder: placeholder, className: className, readOnly: true, onClick: () => setIsOpen(true) }), jsxRuntime.jsx(Calculator, { isOpen: isOpen, onClose: () => setIsOpen(false), onCalculate: handleCalculate, initialValue: value, title: title, description: description, enableTaxCalculation: enableTaxCalculation, decimalPlaces: decimalPlaces, numberFormatOptions: numberFormatOptions, placeholder: displayPlaceholder, colors: colors, theme: theme })] }));
|
|
6665
5539
|
};
|
|
6666
5540
|
|
|
6667
|
-
exports.Button = Button;
|
|
6668
5541
|
exports.Calculator = Calculator;
|
|
6669
5542
|
exports.CalculatorDisplay = CalculatorDisplay;
|
|
6670
5543
|
exports.CalculatorInputForm = CalculatorInputForm;
|
|
6671
5544
|
exports.CalculatorKeypad = CalculatorKeypad;
|
|
6672
|
-
exports.Icon = Icon;
|
|
6673
5545
|
//# sourceMappingURL=index.js.map
|