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