@g9tm/lynxcontrols 2.5.3 → 2.5.5
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/catalog/cards/G9AppShell.md +1 -1
- package/catalog/cards/G9Badge.md +1 -1
- package/catalog/cards/G9DirectionScope.md +10 -0
- package/catalog/cards/G9IconButton.md +1 -1
- package/catalog/cards/G9NumPad.md +5 -1
- package/catalog/cards/G9Photo.md +1 -1
- package/catalog/cards/G9PinEntry.md +2 -2
- package/catalog/cards/G9ProgressBar.md +1 -1
- package/catalog/cards/G9SafeIconButton.md +1 -1
- package/catalog/cards/G9ScrollSpyBar.md +1 -1
- package/catalog/cards/G9StatusPill.md +1 -1
- package/catalog/cards/G9Stepper.md +3 -3
- package/catalog/cards/G9Tag.md +1 -1
- package/catalog/catalog.json +793 -59
- package/catalog/index.md +3 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/context.d.ts +5 -0
- package/dist/anchor/context.d.ts.map +1 -1
- package/dist/anchor/context.jsx +2 -1
- package/dist/anchor/hooks.d.ts.map +1 -1
- package/dist/anchor/hooks.jsx +6 -1
- package/dist/anchor/index.d.ts +1 -1
- package/dist/anchor/index.d.ts.map +1 -1
- package/dist/anchor/index.jsx +1 -1
- package/dist/anchor/registry.d.ts +5 -0
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/base/node-ref.d.ts +8 -0
- package/dist/base/node-ref.d.ts.map +1 -0
- package/dist/base/node-ref.jsx +11 -0
- package/dist/base/pressable.d.ts +5 -0
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +4 -1
- package/dist/base/sizing.d.ts +4 -0
- package/dist/base/sizing.d.ts.map +1 -0
- package/dist/base/sizing.jsx +6 -0
- package/dist/button/button.d.ts +6 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +14 -3
- package/dist/button/icon-button.d.ts +14 -0
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +21 -7
- package/dist/display/display.css +1 -1
- package/dist/display/display.css.map +1 -1
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +7 -2
- package/dist/display/motion-figures.d.ts +7 -0
- package/dist/display/motion-figures.d.ts.map +1 -1
- package/dist/display/motion-figures.jsx +14 -5
- package/dist/display/progress-bar.d.ts +11 -1
- package/dist/display/progress-bar.d.ts.map +1 -1
- package/dist/display/progress-bar.jsx +18 -4
- package/dist/display/shimmer.jsx +1 -1
- package/dist/fields/extra-entries.css +13 -0
- package/dist/fields/extra-entries.css.map +1 -1
- package/dist/fields/extra-entries.d.ts +25 -3
- package/dist/fields/extra-entries.d.ts.map +1 -1
- package/dist/fields/extra-entries.jsx +48 -9
- package/dist/fields/fields.css +18 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/outlined-field.d.ts +15 -3
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +21 -5
- package/dist/fields/pin-entry.d.ts +21 -0
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +17 -8
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +7 -1
- package/dist/fields/use-text-input.d.ts +2 -0
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +3 -1
- package/dist/header/app-bar.d.ts.map +1 -1
- package/dist/header/app-bar.jsx +4 -4
- package/dist/host/bottom-overlays.d.ts +11 -0
- package/dist/host/bottom-overlays.d.ts.map +1 -0
- package/dist/host/bottom-overlays.jsx +18 -0
- package/dist/host/context.d.ts +4 -0
- package/dist/host/context.d.ts.map +1 -0
- package/dist/host/context.jsx +3 -0
- package/dist/host/host.d.ts +3 -3
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +1 -1
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +3 -1
- package/dist/layout/scroll-spy.d.ts +5 -0
- package/dist/layout/scroll-spy.d.ts.map +1 -1
- package/dist/layout/scroll-spy.jsx +14 -5
- package/dist/layout/scrollers.d.ts +5 -0
- package/dist/layout/scrollers.d.ts.map +1 -1
- package/dist/layout/scrollers.jsx +23 -3
- package/dist/provider/direction-scope.d.ts +13 -0
- package/dist/provider/direction-scope.d.ts.map +1 -0
- package/dist/provider/direction-scope.jsx +12 -0
- package/dist/provider/index.d.ts +1 -0
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.jsx +1 -0
- package/dist/provider/provider.css +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/range-slider/range-slider.css +14 -14
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/step-slider.jsx +8 -8
- package/dist/shell/shell.d.ts +5 -0
- package/dist/shell/shell.d.ts.map +1 -1
- package/dist/shell/shell.jsx +14 -10
- package/dist/survey/survey.d.ts.map +1 -1
- package/dist/survey/survey.jsx +15 -5
- package/dist/tabs/tab-view.d.ts.map +1 -1
- package/dist/tabs/tab-view.jsx +10 -3
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +7 -0
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +2 -1
- package/dist/toggle/choice.css +15 -0
- package/dist/toggle/choice.css.map +1 -1
- package/dist/toggle/choice.d.ts +13 -0
- package/dist/toggle/choice.d.ts.map +1 -1
- package/dist/toggle/choice.jsx +49 -21
- package/package.json +2 -2
- package/skills/g9-lynx-app/references/catalog-index.md +1 -1
- package/skills/g9-lynx-app/references/components/button.md +2 -2
- package/skills/g9-lynx-app/references/components/charts.md +34 -28
- package/skills/g9-lynx-app/references/components/commerce.md +1 -0
- package/skills/g9-lynx-app/references/components/display-1.md +1 -1
- package/skills/g9-lynx-app/references/components/display-2.md +2 -2
- package/skills/g9-lynx-app/references/components/display-3.md +2 -2
- package/skills/g9-lynx-app/references/components/fields.md +7 -3
- package/skills/g9-lynx-app/references/components/layout-1.md +1 -1
- package/skills/g9-lynx-app/references/components/provider.md +11 -0
- package/skills/g9-lynx-app/references/components/shell.md +1 -1
- package/skills/g9-lynx-app/references/components/toggle.md +3 -3
- package/skills/g9-lynx-app/references/localization-rtl.md +4 -0
- package/skills/g9-lynx-app/references/provider-and-host.md +3 -0
- package/skills/g9-lynx-app/references/theming.md +5 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./display.css";
|
|
2
|
-
import { formatColor, lighten, resolveProgressColor } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { formatColor, g9MotionScale, lighten, resolveProgressColor } from "@g9tm/lynxcontrols-foundation";
|
|
3
|
+
import { useEffect, useState } from "@lynx-js/react";
|
|
3
4
|
import { useG9Control } from "../base/control.jsx";
|
|
4
5
|
import { useG9Theme } from "../provider/hooks.jsx";
|
|
5
6
|
function progressLabel(value) {
|
|
@@ -16,11 +17,21 @@ function G9ProgressBar(props) {
|
|
|
16
17
|
const height = null != (_props_barHeight = props.barHeight) ? _props_barHeight : 10;
|
|
17
18
|
const radius = Math.min(null != (_props_cornerRadius = props.cornerRadius) ? _props_cornerRadius : 999, height / 2);
|
|
18
19
|
const color = null != (_props_progressColor = props.progressColor) ? _props_progressColor : resolveProgressColor(null != (_props_progressType = props.progressType) ? _props_progressType : 'primary', palette);
|
|
19
|
-
const
|
|
20
|
+
const flat = true === props.flat;
|
|
21
|
+
const fill = flat ? color : `linear-gradient(to right, ${color}, ${formatColor(lighten(color, 0.24))})`;
|
|
20
22
|
const paused = true === props.isPaused || control.disabled;
|
|
21
23
|
const indeterminate = true === props.isIndeterminate;
|
|
22
24
|
const placement = null != (_props_labelPlacement = props.labelPlacement) ? _props_labelPlacement : 'none';
|
|
23
25
|
const value = clampProgress(null != (_props_value = props.value) ? _props_value : 0);
|
|
26
|
+
const [waiting, setWaiting] = useState(()=>{
|
|
27
|
+
var _props_fillDelayMs;
|
|
28
|
+
return (null != (_props_fillDelayMs = props.fillDelayMs) ? _props_fillDelayMs : 0) > 0 && g9MotionScale() > 0;
|
|
29
|
+
});
|
|
30
|
+
useEffect(()=>{
|
|
31
|
+
if (!waiting) return;
|
|
32
|
+
const timer = setTimeout(()=>setWaiting(false), props.fillDelayMs);
|
|
33
|
+
return ()=>clearTimeout(timer);
|
|
34
|
+
}, []);
|
|
24
35
|
return <view className={control.className} {...control.idProps} style={control.rootStyle()}>
|
|
25
36
|
{'none' !== placement ? <text className="g9-progress__label" style={{
|
|
26
37
|
color
|
|
@@ -35,11 +46,14 @@ function G9ProgressBar(props) {
|
|
|
35
46
|
'accessibility-label': props.accessibilityLabel
|
|
36
47
|
} : {}} accessibility-value={indeterminate ? '' : progressLabel(value)}>
|
|
37
48
|
<view className={`g9-progress__fill${indeterminate ? ' g9-progress__fill--indeterminate' : ''}${indeterminate && !paused ? ' g9-progress__fill--sweep' : ''}`} style={{
|
|
38
|
-
width: indeterminate ? '20%' : `${100 * value}%`,
|
|
49
|
+
width: indeterminate ? '20%' : `${waiting ? 0 : 100 * value}%`,
|
|
50
|
+
...flat && !indeterminate && (waiting || 0 === value) ? {
|
|
51
|
+
opacity: 0
|
|
52
|
+
} : {},
|
|
39
53
|
borderRadius: `${radius}px`,
|
|
40
54
|
background: fill
|
|
41
55
|
}}>
|
|
42
|
-
{!paused ? <view className="g9-progress__stripes"/> : null}
|
|
56
|
+
{!paused && !flat ? <view className="g9-progress__stripes"/> : null}
|
|
43
57
|
</view>
|
|
44
58
|
{props.showSegments ? [
|
|
45
59
|
1,
|
package/dist/display/shimmer.jsx
CHANGED
|
@@ -29,7 +29,7 @@ function G9SheetSkeleton(props) {
|
|
|
29
29
|
<view className="g9-skeleton__circle"/>
|
|
30
30
|
<view className="g9-skeleton__bar g9-skeleton__line"/>
|
|
31
31
|
</view>);
|
|
32
|
-
return <view className="g9-
|
|
32
|
+
return <view className="g9-shimmer-overlay" style={{
|
|
33
33
|
backgroundColor: null != (_props_backgroundColor = props.backgroundColor) ? _props_backgroundColor : 'var(--g9-background)'
|
|
34
34
|
}}>
|
|
35
35
|
<view className={`g9-skeleton__rows${form ? ' g9-skeleton__rows--form' : ''}`}>{items}</view>
|
|
@@ -117,6 +117,19 @@
|
|
|
117
117
|
background-color: #ffffff24;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
+
.g9-numpad__key--action {
|
|
121
|
+
background-color: var(--g9-primary);
|
|
122
|
+
flex-direction: row;
|
|
123
|
+
column-gap: 6px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.g9-numpad__action-text {
|
|
127
|
+
font-size: 17px;
|
|
128
|
+
font-family: var(--g9-font-text-700);
|
|
129
|
+
color: var(--g9-on-primary);
|
|
130
|
+
font-weight: 700;
|
|
131
|
+
}
|
|
132
|
+
|
|
120
133
|
.g9-numpad__key--blank {
|
|
121
134
|
background-color: #0000;
|
|
122
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/fields/extra-entries.css"],"names":[],"mappings":"AACA;EAAE,OAAO;EACP,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,gBAAgB;EAChB,cAAc;EACd,OAAO;AACT;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;AACjC;;AAGA;EAAE,sBAAsB;EACtB,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,+BAA+B;EAC/B,qCAAqC;EACrC,mBAAmB;EACnB,iBAAiB;EACjB,oCAAoC;EACpC,4CAA4C;EAC5C,eAAe;EACf,mBAAmB;EACnB,QAAQ;EACR,iBAAiB;EACjB,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,YAAY;EACZ,eAAe;EACf,gCAAgC;EAChC,6BAA6B;EAC7B,OAAO;AACT;;AAGA;EAAE,eAAe;EACf,QAAQ;EACR,aAAa;AACf;;AAGA;EAAE,sBAAsB;EACtB,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,8BAA8B;EAC9B,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,oCAAoC;EACpC,+BAA+B;EAC/B,gBAAgB;AAClB;;AAGA;EAAE,sBAAsB;EACtB,gCAAgC;AAClC;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;EAC9B,iBAAiB;AACnB;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,sBAAsB;EACtB,iBAAiB;AACnB;;AAGA;EAAE,sBAAsB;EACtB,aAAa;EACb,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,gBAAgB;EAChB,aAAa;AACf;;AAGA;EAAE,kDAAkD;EAClD,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,2BAA2B;AAC7B;;AAGA;EAAE,uBAAuB;AACzB;;AAGA;EAAE,WAAW;AACb;;AAGA;EAAE,eAAe;EACf,oCAAoC;EACpC,6BAA6B;EAC7B,gBAAgB;AAClB;;AAGA;EAAE,WAAW;EACX,gCAAgC;AAClC","sourcesContent":["/* G9NumberEntry, G9TimeEntry, G9TagEntry, G9FormField, G9NumPad. */\n.g9-number-entry {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0px;\n column-gap: 6px;\n}\n\n.g9-number-entry__input {\n flex: 1;\n text-align: left;\n direction: ltr;\n}\n\n.g9-number-entry__suffix {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-tags {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n}\n\n.g9-tags__box {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: var(--g9-height-md);\n padding: 6px 10px;\n gap: 6px;\n border-radius: var(--g9-radius-field);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-input-border);\n background-color: var(--g9-input-background);\n}\n\n.g9-tags__input {\n flex: 1;\n min-width: 80px;\n height: 32px;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-tags__suggestions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.g9-form-field {\n display: flex;\n flex-direction: column;\n row-gap: 6px;\n}\n\n.g9-form-field__head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.g9-form-field__label {\n font-size: 13px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-text-secondary);\n}\n\n.g9-form-field__required {\n color: var(--g9-error);\n font-family: var(--g9-font-text);\n}\n\n.g9-form-field__hint {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-form-field__error {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-error);\n}\n\n.g9-numpad {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n}\n\n.g9-numpad__row {\n display: flex;\n justify-content: center;\n column-gap: 18px;\n}\n\n.g9-numpad__key {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 64px;\n border-radius: 32px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-numpad__key--dark {\n background-color: rgba(255, 255, 255, 0.14);\n}\n\n.g9-numpad__key--blank {\n background-color: transparent;\n}\n\n.g9-numpad__key--off {\n opacity: 0.4;\n}\n\n.g9-numpad__digit {\n font-size: 26px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-text-primary);\n}\n\n.g9-numpad__digit--dark {\n color: #ffffff;\n font-family: var(--g9-font-text);\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://./src/fields/extra-entries.css"],"names":[],"mappings":"AACA;EAAE,OAAO;EACP,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,gBAAgB;EAChB,cAAc;EACd,OAAO;AACT;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,+BAA+B;AACjC;;AAGA;EAAE,sBAAsB;EACtB,YAAY;EACZ,aAAa;AACf;;A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-number-entry {\n display: flex;\n align-items: center;\n flex: 1;\n min-width: 0px;\n column-gap: 6px;\n}\n\n.g9-number-entry__input {\n flex: 1;\n text-align: left;\n direction: ltr;\n}\n\n.g9-number-entry__suffix {\n font-size: 13px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n}\n\n.g9-tags {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n}\n\n.g9-tags__box {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: var(--g9-height-md);\n padding: 6px 10px;\n gap: 6px;\n border-radius: var(--g9-radius-field);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-input-border);\n background-color: var(--g9-input-background);\n}\n\n.g9-tags__input {\n flex: 1;\n min-width: 80px;\n height: 32px;\n font-size: 14px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-tags__suggestions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.g9-form-field {\n display: flex;\n flex-direction: column;\n row-gap: 6px;\n}\n\n.g9-form-field__head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n\n.g9-form-field__label {\n font-size: 13px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-text-secondary);\n}\n\n.g9-form-field__required {\n color: var(--g9-error);\n font-family: var(--g9-font-text);\n}\n\n.g9-form-field__hint {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-form-field__error {\n font-size: 12px;\n font-family: var(--g9-font-text);\n line-height: 19px;\n color: var(--g9-error);\n}\n\n.g9-numpad {\n display: flex;\n flex-direction: column;\n row-gap: 10px;\n}\n\n.g9-numpad__row {\n display: flex;\n justify-content: center;\n column-gap: 18px;\n}\n\n.g9-numpad__key {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 72px;\n height: 64px;\n border-radius: 32px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-numpad__key--dark {\n background-color: rgba(255, 255, 255, 0.14);\n}\n\n.g9-numpad__key--action {\n flex-direction: row;\n column-gap: 6px;\n background-color: var(--g9-primary);\n}\n\n.g9-numpad__action-text {\n font-size: 17px;\n font-family: var(--g9-font-text-700);\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-numpad__key--blank {\n background-color: transparent;\n}\n\n.g9-numpad__key--off {\n opacity: 0.4;\n}\n\n.g9-numpad__digit {\n font-size: 26px;\n font-family: var(--g9-font-text-600);\n font-weight: 600;\n color: var(--g9-text-primary);\n}\n\n.g9-numpad__digit--dark {\n color: #ffffff;\n font-family: var(--g9-font-text);\n}\n"],"sourceRoot":""}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import './extra-entries.css';
|
|
2
2
|
import { type ReactNode } from '@lynx-js/react';
|
|
3
3
|
import { type G9StyleProp } from '../base/control.js';
|
|
4
|
+
import { type G9IconInput } from '../icon/icon.js';
|
|
4
5
|
import { type G9OutlinedFieldProps } from './outlined-field.js';
|
|
5
6
|
/** Props of {@link G9NumberEntry}. */
|
|
6
7
|
export interface G9NumberEntryProps extends Omit<G9OutlinedFieldProps, 'anchor'> {
|
|
@@ -77,12 +78,32 @@ export interface G9FormFieldProps {
|
|
|
77
78
|
}
|
|
78
79
|
/** A label above any control, a hint or an error below (SAC Field, G9Hub Field): for controls without a floating label. */
|
|
79
80
|
export declare const G9FormField: import("react").NamedExoticComponent<G9FormFieldProps>;
|
|
81
|
+
/** The main key of a {@link G9NumPad} (ShopManager's «ورود»): filled with the primary colour. */
|
|
82
|
+
export interface G9NumPadActionKey {
|
|
83
|
+
/** Its words (also its accessibility label). */
|
|
84
|
+
readonly label?: string;
|
|
85
|
+
readonly icon?: G9IconInput;
|
|
86
|
+
readonly onPress: () => void;
|
|
87
|
+
/** A spinner in place of the words; taps do nothing. */
|
|
88
|
+
readonly busy?: boolean;
|
|
89
|
+
readonly disabled?: boolean;
|
|
90
|
+
/** The bottom row's end (default: where the back key was; the back key moves to the start) or its start. */
|
|
91
|
+
readonly position?: 'start' | 'end';
|
|
92
|
+
}
|
|
80
93
|
/** Props of {@link G9NumPad}. */
|
|
81
94
|
export interface G9NumPadProps {
|
|
82
95
|
/** A digit `'0'`–`'9'`, `'back'` or the extra key's value. */
|
|
83
96
|
readonly onKey: (key: string) => void;
|
|
84
|
-
/** The bottom-start key (`'.'`, `'00'`, or nothing). */
|
|
97
|
+
/** The bottom-start key (`'.'`, `'00'`, or nothing). Not shown with an `actionKey` (its place goes to the back key). */
|
|
85
98
|
readonly extraKey?: string;
|
|
99
|
+
/** A filled main key in the bottom row (sign in, confirm). */
|
|
100
|
+
readonly actionKey?: G9NumPadActionKey;
|
|
101
|
+
/** The back key's accessibility label. Default the strings table's `delete`. */
|
|
102
|
+
readonly backLabel?: string;
|
|
103
|
+
/** Each key's height. Default the shape's large control height under shared sizing, else 64. */
|
|
104
|
+
readonly keyHeight?: number;
|
|
105
|
+
/** Each key's corner radius. Default half the height (round keys). */
|
|
106
|
+
readonly keyRadius?: number;
|
|
86
107
|
/** Brand-coloured lock screen (white keys on the primary colour, SAC LockScreen). */
|
|
87
108
|
readonly dark?: boolean;
|
|
88
109
|
readonly disabled?: boolean;
|
|
@@ -91,8 +112,9 @@ export interface G9NumPadProps {
|
|
|
91
112
|
readonly style?: G9StyleProp;
|
|
92
113
|
}
|
|
93
114
|
/**
|
|
94
|
-
* A big numeric keypad (SAC PinPad and CodePad): works whatever the system keyboard does (an
|
|
95
|
-
* opens it). Digits follow the culture; every key is a
|
|
115
|
+
* A big numeric keypad (SAC PinPad and CodePad, ShopManager's PIN screen): works whatever the system keyboard does (an
|
|
116
|
+
* in-app browser that never opens it). Digits and their accessibility labels follow the culture; every key is a large
|
|
117
|
+
* target with a tick haptic. An `actionKey` adds a filled main key to the bottom row.
|
|
96
118
|
*/
|
|
97
119
|
export declare function G9NumPad(props: G9NumPadProps): ReactNode;
|
|
98
120
|
//# sourceMappingURL=extra-entries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extra-entries.d.ts","sourceRoot":"","sources":["../../src/fields/extra-entries.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"extra-entries.d.ts","sourceRoot":"","sources":["../../src/fields/extra-entries.tsx"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAS7B,OAAO,EAAQ,KAAK,SAAS,EAA+B,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,KAAK,WAAW,EAAgD,MAAM,iBAAiB,CAAC;AAGjG,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO9E,sCAAsC;AACtC,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC;IAC9E,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,0CAA0C;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,QAAQ,CAAC,OA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AC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,4GAA4G;IAC5G,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;CACrC;AAED,iCAAiC;AACjC,MAAM,WAAW,aAAa;IAC5B,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,wHAAwH;IACxH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,CAAC,EAAE,iBAAiB,CAAC;IACvC,gFAAgF;IAChF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,CA0FxD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./extra-entries.css";
|
|
2
|
-
import { g9Haptic, getNumberSymbols, groupWhileTyping, normalizeToAscii } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { G9StringKey, g9Haptic, getNumberSymbols, groupWhileTyping, normalizeToAscii, toNativeDigits } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { memo, useEffect, useRef, useState } from "@lynx-js/react";
|
|
4
4
|
import { g9ChildId, g9IdProps, g9RowStyle, mergeStyle } from "../base/control.jsx";
|
|
5
5
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
6
|
+
import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
|
|
6
7
|
import { G9Icon } from "../icon/icon.jsx";
|
|
7
|
-
import { useG9Culture, useG9Direction } from "../provider/hooks.jsx";
|
|
8
|
+
import { useG9Culture, useG9Direction, useG9Shape, useG9Strings } from "../provider/hooks.jsx";
|
|
8
9
|
import { G9Chip } from "../toggle/choice.jsx";
|
|
9
10
|
import { G9OutlinedField } from "./outlined-field.jsx";
|
|
10
11
|
import { invokeNode } from "./use-text-input.jsx";
|
|
@@ -295,28 +296,66 @@ const PAD = [
|
|
|
295
296
|
'9'
|
|
296
297
|
];
|
|
297
298
|
function G9NumPad(props) {
|
|
299
|
+
var _props_keyHeight, _props_keyRadius, _props_backLabel, _action_label;
|
|
298
300
|
const culture = useG9Culture();
|
|
299
|
-
const
|
|
300
|
-
const
|
|
301
|
+
const strings = useG9Strings();
|
|
302
|
+
const shape = useG9Shape();
|
|
303
|
+
const digit = (d)=>toNativeDigits(d, culture.numberingSystem);
|
|
304
|
+
const height = null != (_props_keyHeight = props.keyHeight) ? _props_keyHeight : 'shared' === shape.sizing ? shape.heights.lg : 64;
|
|
305
|
+
const radius = null != (_props_keyRadius = props.keyRadius) ? _props_keyRadius : height / 2;
|
|
306
|
+
const look = {
|
|
307
|
+
height: `${height}px`,
|
|
308
|
+
borderRadius: `${radius}px`
|
|
309
|
+
};
|
|
310
|
+
const backLabel = null != (_props_backLabel = props.backLabel) ? _props_backLabel : strings.get(G9StringKey.Delete);
|
|
311
|
+
const key = (k, label, a11y)=><view key={k} className={`g9-numpad__key${props.dark ? ' g9-numpad__key--dark' : ''}${props.disabled ? ' g9-numpad__key--off' : ''}`} style={look} {...g9IdProps(g9ChildId(props.id, 'back' === k ? 'Back' : k))} bindtap={()=>{
|
|
301
312
|
if (props.disabled) return;
|
|
302
313
|
g9Haptic('tick');
|
|
303
314
|
props.onKey(k);
|
|
304
|
-
}} accessibility-element={true} accessibility-traits="button" accessibility-label={
|
|
315
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-label={a11y}>
|
|
305
316
|
{label}
|
|
306
317
|
</view>;
|
|
307
318
|
const text1 = (s)=><text className={`g9-numpad__digit${props.dark ? ' g9-numpad__digit--dark' : ''}`}>{s}</text>;
|
|
319
|
+
const back = key('back', <G9Icon icon="arrowBack" size={22} color={props.dark ? '#FFFFFF' : 'var(--g9-text-primary)'}/>, backLabel);
|
|
320
|
+
const action = props.actionKey;
|
|
321
|
+
const actionOff = true === props.disabled || (null == action ? void 0 : action.disabled) === true || (null == action ? void 0 : action.busy) === true;
|
|
322
|
+
const actionView = action ? <view key="action" className={`g9-numpad__key g9-numpad__key--action${actionOff ? ' g9-numpad__key--off' : ''}`} style={look} {...g9IdProps(g9ChildId(props.id, 'Action'))} bindtap={()=>{
|
|
323
|
+
if (actionOff) return;
|
|
324
|
+
g9Haptic('tick');
|
|
325
|
+
action.onPress();
|
|
326
|
+
}} accessibility-element={true} accessibility-traits="button" accessibility-label={null != (_action_label = action.label) ? _action_label : ''} {...action.busy ? {
|
|
327
|
+
'accessibility-status': 'busy'
|
|
328
|
+
} : {}}>
|
|
329
|
+
{action.busy ? <G9ActivityIndicator running={true} size={22} color="var(--g9-on-primary)"/> : <>
|
|
330
|
+
{action.icon ? <G9Icon icon={action.icon} size={22} color="var(--g9-on-primary)"/> : null}
|
|
331
|
+
{action.label ? <text className="g9-numpad__action-text">{action.label}</text> : null}
|
|
332
|
+
</>}
|
|
333
|
+
</view> : null;
|
|
334
|
+
const extra = props.extraKey ? key(props.extraKey, text1(props.extraKey), props.extraKey) : <view key="blank" className="g9-numpad__key g9-numpad__key--blank" style={look}/>;
|
|
335
|
+
const zero = key('0', text1(digit('0')), digit('0'));
|
|
336
|
+
const last = action ? 'start' === action.position ? [
|
|
337
|
+
actionView,
|
|
338
|
+
zero,
|
|
339
|
+
back
|
|
340
|
+
] : [
|
|
341
|
+
back,
|
|
342
|
+
zero,
|
|
343
|
+
actionView
|
|
344
|
+
] : [
|
|
345
|
+
extra,
|
|
346
|
+
zero,
|
|
347
|
+
back
|
|
348
|
+
];
|
|
308
349
|
return <view className={`g9-numpad${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} style={mergeStyle(void 0, props.style)}>
|
|
309
350
|
{[
|
|
310
351
|
0,
|
|
311
352
|
1,
|
|
312
353
|
2
|
|
313
354
|
].map((r)=><view key={r} className="g9-numpad__row" style={g9RowStyle('ltr')}>
|
|
314
|
-
{PAD.slice(3 * r, 3 * r + 3).map((d)=>key(d, text1(digit(d))))}
|
|
355
|
+
{PAD.slice(3 * r, 3 * r + 3).map((d)=>key(d, text1(digit(d)), digit(d)))}
|
|
315
356
|
</view>)}
|
|
316
357
|
<view className="g9-numpad__row" style={g9RowStyle('ltr')}>
|
|
317
|
-
{
|
|
318
|
-
{key('0', text1(digit('0')))}
|
|
319
|
-
{key('back', <G9Icon icon="arrowBack" size={22} color={props.dark ? '#FFFFFF' : 'var(--g9-text-primary)'}/>)}
|
|
358
|
+
{last}
|
|
320
359
|
</view>
|
|
321
360
|
</view>;
|
|
322
361
|
}
|
package/dist/fields/fields.css
CHANGED
|
@@ -196,5 +196,23 @@
|
|
|
196
196
|
background-color: var(--g9-surface-container-high);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
.g9-pin--dots {
|
|
200
|
+
justify-content: center;
|
|
201
|
+
align-items: center;
|
|
202
|
+
column-gap: 14px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.g9-pin__dot {
|
|
206
|
+
border-style: solid;
|
|
207
|
+
border-width: 1.5px;
|
|
208
|
+
border-color: var(--g9-outline);
|
|
209
|
+
background-color: #0000;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.g9-pin__dot--filled {
|
|
213
|
+
border-color: var(--g9-primary);
|
|
214
|
+
background-color: var(--g9-primary);
|
|
215
|
+
}
|
|
216
|
+
|
|
199
217
|
|
|
200
218
|
/*# sourceMappingURL=fields.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAaA;EAVE,sBAAsB;EACtB,OAAO;EACP,uBAAuB;EACvB,aAAa;AACf;;AAaA;EAVE,WAAW;EACX,YAAY;EACZ,eAAe;EACf,gCAAgC;EAChC,uBAAuB;AACzB;;AAcA;EAXE,uBAAuB;EACvB,YAAY;EACZ,gCAAgC;AAClC;;AAgBA;EAbE,oBAAoB;EACpB,sBAAsB;EACtB,uBAAuB;EACvB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAgBA;EAbE,2BAA2B;EAC3B,YAAY;AACd;;AAgBA;EAbE,WAAW;EACX,eAAe;EACf,gCAAgC;EAChC,uBAAuB;AACzB;;AAgBA;EAbE,WAAW;EACX,eAAe;EACf,gCAAgC;EAChC,uBAAuB;AACzB;;AAgBA;EAbE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAgBA;EAbE,oBAAoB;EACpB,YAAY;EACZ,iBAAiB;EACjB,gCAAgC;EAChC,uBAAuB;EACvB,iBAAiB;EACjB,kBAAkB;EAClB,qDAAqD;EACrD,yBAAyB;EACzB,kBAAkB;AACpB;;AAkBA;EAfE,wEAAwE;EACxE,gCAAgC;AAClC;;AAkBA;EAfE,mBAAmB;EACnB,8BAA8B;EAC9B,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;AACf;;AAkBA;EAfE,iBAAiB;EACjB,gCAAgC;EAChC,OAAO;AACT;;AAkBA;EAfE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;AAChC;;AAkBA;EAfE,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,4CAA4C;AAC9C;;AAkBA;EAfE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAoBA;EAjBE,YAAY;AACd;;AAyBA;EAtBE,cAAc;EACd,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAyBA;EAtBE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;EACvC,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;EACjB,aAAa;AACf;;AAyBA;EAtBE,sCAAsC;AACxC;;AAyBA;EAtBE,iBAAiB;EACjB,+BAA+B;AACjC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;AAC/B;;AAyBA;EAtBE,8BAA8B;AAChC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;AAChC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;EACnC,iBAAiB;AACnB;;AA0BA;EAvBE,kDAAkD;AACpD","sourcesContent":["/* Outlined fields (MAUI G9OutlinedFieldBase). Colours come from the theme variables; sizes from G9Metrics. */\n.g9-field {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-field__box {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: transparent;\n}\n\n.g9-field__outline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__halo {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex: 1;\n}\n\n.g9-field__input {\n width: 100%;\n height: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n background-color: transparent;\n}\n\n/* The read-only value: a text line centred like the input's. */\n.g9-field__input--readonly {\n height: auto;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* MAUI 1.4.9 RestingPlaceholder: the hint inside an empty box (under an always-floated label, or placeholderInside),\n over the input where its text starts — the input's 15 px in TextTertiary; it never takes a touch. */\n.g9-field__hint {\n position: absolute;\n top: 0px;\n bottom: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n pointer-events: none;\n}\n\n.g9-field__hint--multiline {\n bottom: auto;\n justify-content: flex-start;\n}\n\n.g9-field__hint-text {\n width: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n text-overflow: ellipsis;\n}\n\n.g9-field__textarea {\n width: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n background-color: transparent;\n}\n\n.g9-field__slot {\n display: flex;\n position: absolute;\n align-items: center;\n justify-content: center;\n}\n\n.g9-field__label {\n position: absolute;\n height: 22px;\n line-height: 22px;\n padding-left: 4px;\n padding-right: 4px;\n background-color: transparent;\n transition-property: top, font-size, transform, color;\n transition-duration: 160ms;\n pointer-events: none;\n font-family: var(--g9-font-text);\n}\n\n/* Only a floated label sits on the outline: its notch paints the colour behind the field (a container that is not\n --g9-background sets --g9-field-notch-background; G9 sheets and popups do). At rest it paints nothing. */\n.g9-field__label--floated {\n background-color: var(--g9-field-notch-background, var(--g9-background));\n font-family: var(--g9-font-text);\n}\n\n.g9-field__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 4px;\n padding-left: 14px;\n padding-right: 14px;\n}\n\n.g9-field__helper {\n flex: 1;\n font-size: 11.5px;\n font-family: var(--g9-font-text);\n}\n\n.g9-field__counter {\n font-size: 11px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-field__busy {\n width: 18px;\n height: 18px;\n border-width: 2px;\n border-style: solid;\n border-radius: 9px;\n animation: g9-field-spin 800ms linear infinite;\n}\n\n@keyframes g9-field-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Disabled dims the field (MAUI DisabledDimAlpha) part by part: an opacity on the box itself renders it into a layer\n the size of the box on Android, which cut the floated label above it in half. The label takes the disabled colour\n instead, so its notch still hides the outline. */\n.g9-field--disabled .g9-field__outline,\n.g9-field--disabled .g9-field__halo,\n.g9-field--disabled .g9-field__content,\n.g9-field--disabled .g9-field__slot,\n.g9-field--disabled .g9-field__footer {\n opacity: 0.45;\n}\n\n/* PIN entry (MAUI G9PinEntry): the row is always left-to-right. */\n.g9-pin {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n direction: ltr;\n}\n\n.g9-pin__cell {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n border-style: solid;\n border-width: 1.4px;\n border-radius: 10px;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-pin__cell--filled {\n border-color: var(--g9-primary-border);\n}\n\n.g9-pin__cell--active {\n border-width: 2px;\n border-color: var(--g9-primary);\n}\n\n.g9-pin__char {\n font-size: 22px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-pin--disabled .g9-pin__char {\n color: var(--g9-text-disabled);\n}\n\n.g9-pin__placeholder {\n font-size: 22px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-pin__separator {\n font-size: 22px;\n font-family: var(--g9-font-text);\n margin-right: 6px;\n color: var(--g9-on-surface-variant);\n}\n\n/* appearance=\"filled\": a sunken box, no stroke at rest (the focus colour strokes it). */\n.g9-field__outline--filled {\n background-color: var(--g9-surface-container-high);\n}\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAA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ACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAoBA;EAjBE,YAAY;AACd;;AAyBA;EAtBE,cAAc;EACd,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAyBA;EAtBE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;EACvC,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;EACjB,aAAa;AACf;;AAyBA;EAtBE,sCAAsC;AACxC;;AAyBA;EAtBE,iBAAiB;EACjB,+BAA+B;AACjC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;AAC/B;;AAyBA;EAtBE,8BAA8B;AAChC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,8BAA8B;AAChC;;AAyBA;EAtBE,eAAe;EACf,gCAAgC;EAChC,mCAAmC;EACnC,iBAAiB;AACnB;;AA0BA;EAvBE,kDAAkD;AACpD;;AA0BA;EAvBE,uBAAuB;EACvB,mBAAmB;EACnB,gBAAgB;AAClB;;AA0BA;EAvBE,mBAAmB;EACnB,mBAAmB;EACnB,+BAA+B;EAC/B,uBAAuB;AACzB;;AA0BA;EAvBE,+BAA+B;EAC/B,mCAAmC;AACrC","sourcesContent":["/* Outlined fields (MAUI G9OutlinedFieldBase). Colours come from the theme variables; sizes from G9Metrics. */\n.g9-field {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-field__box {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: transparent;\n}\n\n.g9-field__outline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__halo {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex: 1;\n}\n\n.g9-field__input {\n width: 100%;\n height: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n background-color: transparent;\n}\n\n/* The read-only value: a text line centred like the input's. */\n.g9-field__input--readonly {\n height: auto;\n text-overflow: ellipsis;\n font-family: var(--g9-font-text);\n}\n\n/* MAUI 1.4.9 RestingPlaceholder: the hint inside an empty box (under an always-floated label, or placeholderInside),\n over the input where its text starts — the input's 15 px in TextTertiary; it never takes a touch. */\n.g9-field__hint {\n position: absolute;\n top: 0px;\n bottom: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n pointer-events: none;\n}\n\n.g9-field__hint--multiline {\n bottom: auto;\n justify-content: flex-start;\n}\n\n.g9-field__hint-text {\n width: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n text-overflow: ellipsis;\n}\n\n.g9-field__textarea {\n width: 100%;\n font-size: 15px;\n font-family: var(--g9-font-text);\n background-color: transparent;\n}\n\n.g9-field__slot {\n display: flex;\n position: absolute;\n align-items: center;\n justify-content: center;\n}\n\n.g9-field__label {\n position: absolute;\n height: 22px;\n line-height: 22px;\n padding-left: 4px;\n padding-right: 4px;\n background-color: transparent;\n transition-property: top, font-size, transform, color;\n transition-duration: 160ms;\n pointer-events: none;\n font-family: var(--g9-font-text);\n}\n\n/* Only a floated label sits on the outline: its notch paints the colour behind the field (a container that is not\n --g9-background sets --g9-field-notch-background; G9 sheets and popups do). At rest it paints nothing. */\n.g9-field__label--floated {\n background-color: var(--g9-field-notch-background, var(--g9-background));\n font-family: var(--g9-font-text);\n}\n\n.g9-field__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 4px;\n padding-left: 14px;\n padding-right: 14px;\n}\n\n.g9-field__helper {\n flex: 1;\n font-size: 11.5px;\n font-family: var(--g9-font-text);\n}\n\n.g9-field__counter {\n font-size: 11px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-field__busy {\n width: 18px;\n height: 18px;\n border-width: 2px;\n border-style: solid;\n border-radius: 9px;\n animation: g9-field-spin 800ms linear infinite;\n}\n\n@keyframes g9-field-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Disabled dims the field (MAUI DisabledDimAlpha) part by part: an opacity on the box itself renders it into a layer\n the size of the box on Android, which cut the floated label above it in half. The label takes the disabled colour\n instead, so its notch still hides the outline. */\n.g9-field--disabled .g9-field__outline,\n.g9-field--disabled .g9-field__halo,\n.g9-field--disabled .g9-field__content,\n.g9-field--disabled .g9-field__slot,\n.g9-field--disabled .g9-field__footer {\n opacity: 0.45;\n}\n\n/* PIN entry (MAUI G9PinEntry): the row is always left-to-right. */\n.g9-pin {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n direction: ltr;\n}\n\n.g9-pin__cell {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n border-style: solid;\n border-width: 1.4px;\n border-radius: 10px;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-pin__cell--filled {\n border-color: var(--g9-primary-border);\n}\n\n.g9-pin__cell--active {\n border-width: 2px;\n border-color: var(--g9-primary);\n}\n\n.g9-pin__char {\n font-size: 22px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-pin--disabled .g9-pin__char {\n color: var(--g9-text-disabled);\n}\n\n.g9-pin__placeholder {\n font-size: 22px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n}\n\n.g9-pin__separator {\n font-size: 22px;\n font-family: var(--g9-font-text);\n margin-right: 6px;\n color: var(--g9-on-surface-variant);\n}\n\n/* appearance=\"filled\": a sunken box, no stroke at rest (the focus colour strokes it). */\n.g9-field__outline--filled {\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-pin--dots {\n column-gap: 14px;\n align-items: center;\n justify-content: center;\n}\n\n.g9-pin__dot {\n border-width: 1.5px;\n border-style: solid;\n border-color: var(--g9-outline);\n background-color: transparent;\n}\n\n.g9-pin__dot--filled {\n border-color: var(--g9-primary);\n background-color: var(--g9-primary);\n}\n"],"sourceRoot":""}
|
|
@@ -20,6 +20,11 @@ export interface G9OutlinedFieldProps {
|
|
|
20
20
|
readonly label?: string | null;
|
|
21
21
|
/** Placeholder; shown as the label when `label` is not set. */
|
|
22
22
|
readonly placeholder?: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* What a screen reader, Maestro and automation call the field: put on the native input itself. Default the label,
|
|
25
|
+
* else the placeholder (a field is named by its label; ShopManager, 2.5.5).
|
|
26
|
+
*/
|
|
27
|
+
readonly accessibilityLabel?: string;
|
|
23
28
|
/** Helper line under the field; replaced by `errorText` while the field has an error. */
|
|
24
29
|
readonly helperText?: string | null;
|
|
25
30
|
/** Error message, shown (in the error colour) while `hasError`. */
|
|
@@ -78,9 +83,12 @@ export interface G9OutlinedFieldProps {
|
|
|
78
83
|
readonly onTrailingPress?: () => void;
|
|
79
84
|
/**
|
|
80
85
|
* `'outlined'` (default) a stroked box with a notched floating label; `'filled'` a sunken box without a stroke at
|
|
81
|
-
* rest (SAC/ShopManager/G9Hub plain fields), the focus colour as its stroke.
|
|
86
|
+
* rest (SAC/ShopManager/G9Hub plain fields), the focus colour as its stroke. `'plain'` (ShopManager's field): no
|
|
87
|
+
* floating label and no notch — the label is the placeholder, the app draws a title above if it wants one —, a 1 dp
|
|
88
|
+
* outline on the input background, 17 px text. `'code'`: the plain look one height up (lg), 22 px text, centred (a
|
|
89
|
+
* one-time code, a voucher).
|
|
82
90
|
*/
|
|
83
|
-
readonly appearance?: 'outlined' | 'filled';
|
|
91
|
+
readonly appearance?: 'outlined' | 'filled' | 'plain' | 'code';
|
|
84
92
|
/** Fully rounded ends (a search pill, G9Hub `round`). */
|
|
85
93
|
readonly round?: boolean;
|
|
86
94
|
/** Inline style on the field root. */
|
|
@@ -102,6 +110,10 @@ export interface G9OutlinedFieldStateInput {
|
|
|
102
110
|
readonly textLength: number;
|
|
103
111
|
/** Resting chrome tone: `'outline'` (default) or `'placeholder'` (search). */
|
|
104
112
|
readonly restingTone?: 'outline' | 'placeholder';
|
|
113
|
+
/** The shape's shared md height (G9ShapeSet.sizing 'shared'): the field's height when it names none. */
|
|
114
|
+
readonly sharedHeight?: number | null;
|
|
115
|
+
/** The shape's shared lg height: a `'code'` field's height when it names none. */
|
|
116
|
+
readonly sharedLargeHeight?: number | null;
|
|
105
117
|
}
|
|
106
118
|
/** The resolved look of an outlined field (colours are CSS colour values). */
|
|
107
119
|
export interface G9OutlinedFieldState {
|
|
@@ -133,7 +145,7 @@ export declare function resolveRestingPlaceholder(props: Pick<G9OutlinedFieldPro
|
|
|
133
145
|
* The hint a TEXT input draws itself (MAUI 1.4.9 `G9TextEntry` / `G9Editor`): only while the field owns it — a label is
|
|
134
146
|
* set, or `placeholderInside` — since without a label the floating label already is the placeholder.
|
|
135
147
|
*/
|
|
136
|
-
export declare function resolveInnerHint(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>): string | null;
|
|
148
|
+
export declare function resolveInnerHint(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside' | 'appearance'>): string | null;
|
|
137
149
|
/**
|
|
138
150
|
* Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer
|
|
139
151
|
* part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-field.d.ts","sourceRoot":"","sources":["../../src/fields/outlined-field.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAa,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"outlined-field.d.ts","sourceRoot":"","sources":["../../src/fields/outlined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
|
import { useG9Anchor } from "../anchor/hooks.jsx";
|
|
5
5
|
import { g9RowStyle } from "../base/control.jsx";
|
|
6
|
+
import { useG9SharedHeights } from "../base/sizing.jsx";
|
|
6
7
|
import { g9KeyboardTargetProps } from "../host/keyboard.jsx";
|
|
7
8
|
import { G9IconSlot, hasIconSlot } from "../icon/slot.jsx";
|
|
8
9
|
import { useG9Direction, useG9Settings } from "../provider/hooks.jsx";
|
|
@@ -16,11 +17,15 @@ function resolveRestingPlaceholder(props) {
|
|
|
16
17
|
return true === props.alwaysFloat && props.label !== placeholder ? placeholder : null;
|
|
17
18
|
}
|
|
18
19
|
function resolveInnerHint(props) {
|
|
20
|
+
if ('plain' === props.appearance || 'code' === props.appearance) {
|
|
21
|
+
const text1 = blank(props.placeholder) ? props.label : props.placeholder;
|
|
22
|
+
return text1 && !blank(text1) ? text1 : null;
|
|
23
|
+
}
|
|
19
24
|
const owns = true === props.placeholderInside || !blank(props.label);
|
|
20
25
|
return owns ? resolveRestingPlaceholder(props) : null;
|
|
21
26
|
}
|
|
22
27
|
function resolveOutlinedFieldState(props, input) {
|
|
23
|
-
var _props_filledValueHighlight, _props_statusColor, _props_errorText, _props_helperText, _props_maxLength, _ref, _props_label;
|
|
28
|
+
var _props_filledValueHighlight, _props_statusColor, _props_errorText, _props_helperText, _props_maxLength, _ref, _props_label, _input_sharedLargeHeight, _input_sharedHeight;
|
|
24
29
|
const hasError = true === props.hasError;
|
|
25
30
|
const useStatus = true === props.useStatusColor;
|
|
26
31
|
const filled = input.hasValue || true === input.valueFloated;
|
|
@@ -40,7 +45,8 @@ function resolveOutlinedFieldState(props, input) {
|
|
|
40
45
|
const counterText = true === props.showCharacterCounter && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';
|
|
41
46
|
const emphasis = input.focused || hasError || useStatus;
|
|
42
47
|
const halo = true === props.showFocusHalo && input.focused && !hasError && !useStatus;
|
|
43
|
-
const
|
|
48
|
+
const bare = 'plain' === props.appearance || 'code' === props.appearance;
|
|
49
|
+
const labelRaw = bare ? '' : null != (_ref = null != (_props_label = props.label) ? _props_label : true === props.placeholderInside ? null : props.placeholder) ? _ref : '';
|
|
44
50
|
return {
|
|
45
51
|
floated,
|
|
46
52
|
stateColor,
|
|
@@ -53,14 +59,18 @@ function resolveOutlinedFieldState(props, input) {
|
|
|
53
59
|
footerVisible: '' !== helperText || '' !== counterText,
|
|
54
60
|
strokeWidth: emphasis ? G9Metrics.OutlinedFieldEmphasisStrokeThickness : G9Metrics.OutlinedFieldStrokeThickness,
|
|
55
61
|
haloWidth: halo ? G9Metrics.OutlinedFieldFocusHaloThickness : 0,
|
|
56
|
-
fieldHeight: props.fieldHeight && props.fieldHeight > 0 ? props.fieldHeight : G9Metrics.ControlHeight
|
|
62
|
+
fieldHeight: props.fieldHeight && props.fieldHeight > 0 ? props.fieldHeight : 'code' === props.appearance ? null != (_input_sharedLargeHeight = input.sharedLargeHeight) ? _input_sharedLargeHeight : G9Metrics.ControlHeight + 8 : null != (_input_sharedHeight = input.sharedHeight) ? _input_sharedHeight : G9Metrics.ControlHeight
|
|
57
63
|
};
|
|
58
64
|
}
|
|
59
65
|
function useOutlinedField(props, input) {
|
|
66
|
+
var _ref, _ref1;
|
|
60
67
|
const settings = useG9Settings();
|
|
68
|
+
const shared = useG9SharedHeights();
|
|
61
69
|
return resolveOutlinedFieldState(props, {
|
|
62
70
|
...input,
|
|
63
|
-
highlightFilledValue: settings.fields.highlightFilledValue
|
|
71
|
+
highlightFilledValue: settings.fields.highlightFilledValue,
|
|
72
|
+
sharedHeight: null != (_ref = null == shared ? void 0 : shared.md) ? _ref : null,
|
|
73
|
+
sharedLargeHeight: null != (_ref1 = null == shared ? void 0 : shared.lg) ? _ref1 : null
|
|
64
74
|
});
|
|
65
75
|
}
|
|
66
76
|
function physicalSide(column) {
|
|
@@ -157,6 +167,7 @@ function G9OutlinedField(props) {
|
|
|
157
167
|
borderTopColor: 'transparent'
|
|
158
168
|
}}/> : affordance ? <G9IconSlot icon={affordance.icon} color={null != (_affordance_color = affordance.color) ? _affordance_color : state.stateColor} size={iconSize}/> : <G9IconSlot {...trailing} color={state.stateColor} size={iconSize}/>;
|
|
159
169
|
const filled = 'filled' === props.appearance;
|
|
170
|
+
const bare = 'plain' === props.appearance || 'code' === props.appearance;
|
|
160
171
|
const radius = props.round ? `${state.fieldHeight / 2}px` : `var(--g9-radius-field, ${G9Metrics.RadiusMd}px)`;
|
|
161
172
|
return <view className={`g9-field g9-dir-${direction}${disabled ? ' g9-field--disabled' : ''}${props.className ? ` ${props.className}` : ''}`} {...anchorHandle.props} {...props.style ? {
|
|
162
173
|
style: props.style
|
|
@@ -174,7 +185,12 @@ function G9OutlinedField(props) {
|
|
|
174
185
|
}
|
|
175
186
|
} : {}}>
|
|
176
187
|
{}
|
|
177
|
-
<view className={`g9-field__outline${filled ? ' g9-field__outline--filled' : ''}`} style={{
|
|
188
|
+
<view className={`g9-field__outline${filled ? ' g9-field__outline--filled' : ''}`} style={bare ? {
|
|
189
|
+
borderColor: props.focused || true === props.hasError || props.errorText ? state.stateColor : 'var(--g9-outline)',
|
|
190
|
+
borderWidth: '1px',
|
|
191
|
+
borderRadius: radius,
|
|
192
|
+
backgroundColor: 'var(--g9-input-background)'
|
|
193
|
+
} : {
|
|
178
194
|
borderColor: !filled || props.focused || true === props.hasError || props.errorText ? state.stateColor : 'transparent',
|
|
179
195
|
borderWidth: `${filled && !props.focused ? Math.max(1, state.strokeWidth) : state.strokeWidth}px`,
|
|
180
196
|
borderRadius: radius
|
|
@@ -33,6 +33,27 @@ export interface G9PinEntryProps {
|
|
|
33
33
|
readonly disabled?: boolean;
|
|
34
34
|
/** Accessibility label of the row (the progress `n / total` is always announced). */
|
|
35
35
|
readonly accessibilityLabel?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The announced progress as a template: `{0}` the characters entered, `{1}` the most there can be (ShopManager:
|
|
38
|
+
* `'{0} رقم وارد شده'`). Default `'{0} / {1}'`.
|
|
39
|
+
*/
|
|
40
|
+
readonly progressLabel?: string;
|
|
41
|
+
/**
|
|
42
|
+
* `'cells'` (default) a box per character; `'dots'` a row of dots that fill as the code grows (a PIN screen over a
|
|
43
|
+
* `G9NumPad`), never showing the characters.
|
|
44
|
+
*/
|
|
45
|
+
readonly appearance?: 'cells' | 'dots';
|
|
46
|
+
/** Dots: how many are drawn before anything is typed (a PIN of 4 to 8 digits shows 4, then grows). Default `maxLength`. */
|
|
47
|
+
readonly minLength?: number;
|
|
48
|
+
/** Dots: the longest code (the cell count otherwise comes from `length` / `groupSizes`). */
|
|
49
|
+
readonly maxLength?: number;
|
|
50
|
+
/** Dots: each dot's size. Default 14. */
|
|
51
|
+
readonly dotSize?: number;
|
|
52
|
+
/**
|
|
53
|
+
* False: no hidden input and a tap focuses nothing; the code comes only from `value` (a `G9NumPad` on the same
|
|
54
|
+
* screen). Default true.
|
|
55
|
+
*/
|
|
56
|
+
readonly systemKeyboard?: boolean;
|
|
36
57
|
readonly className?: string;
|
|
37
58
|
}
|
|
38
59
|
/** Imperative handle of {@link G9PinEntry}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pin-entry.d.ts","sourceRoot":"","sources":["../../src/fields/pin-entry.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAa,cAAc,EAAoB,MAAM,+BAA+B,CAAC;AAiB5F,uDAAuD;AACvD,MAAM,WAAW,eAAe;IAC9B,iGAAiG;IACjG,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qDAAqD;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,oHAAoH;IACpH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,C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M,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE9E;AAoCD,oHAAoH;AACpH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAS1E;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASrG;AAgBD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,8GAkMtB,CAAC"}
|
|
@@ -147,11 +147,13 @@ const hiddenInputStyle = {
|
|
|
147
147
|
backgroundColor: 'transparent'
|
|
148
148
|
};
|
|
149
149
|
const G9PinEntry = forwardRef(function(props, ref) {
|
|
150
|
-
var _props_type, _props_length, _props_defaultValue, _props_separator;
|
|
150
|
+
var _props_type, _props_length, _props_defaultValue, _props_separator, _props_minLength, _props_progressLabel;
|
|
151
151
|
const keyboardAware = useContext(KeyboardAwareTriggerContext);
|
|
152
152
|
const type = null != (_props_type = props.type) ? _props_type : G9PinEntryType.Number;
|
|
153
|
-
const
|
|
154
|
-
const
|
|
153
|
+
const dots = 'dots' === props.appearance;
|
|
154
|
+
const groups = dots ? [] : parsePinGroupSizes(props.groupSizes);
|
|
155
|
+
const cells = dots && void 0 !== props.maxLength ? Math.max(1, props.maxLength) : pinCellCount(null != (_props_length = props.length) ? _props_length : 4, groups);
|
|
156
|
+
const keyboard = false !== props.systemKeyboard;
|
|
155
157
|
const [value, setValue] = useControllableState({
|
|
156
158
|
value: props.value,
|
|
157
159
|
defaultValue: null != (_props_defaultValue = props.defaultValue) ? _props_defaultValue : '',
|
|
@@ -204,7 +206,7 @@ const G9PinEntry = forwardRef(function(props, ref) {
|
|
|
204
206
|
sync();
|
|
205
207
|
});
|
|
206
208
|
const focus = ()=>{
|
|
207
|
-
if (props.disabled) return;
|
|
209
|
+
if (props.disabled || !keyboard) return;
|
|
208
210
|
invokeNode(inputRef, 'focus');
|
|
209
211
|
invokeNode(inputRef, 'setSelectionRange', {
|
|
210
212
|
selectionStart: chars.length,
|
|
@@ -255,7 +257,14 @@ const G9PinEntry = forwardRef(function(props, ref) {
|
|
|
255
257
|
const row = [];
|
|
256
258
|
let groupIndex = 0;
|
|
257
259
|
let inGroup = 0;
|
|
258
|
-
|
|
260
|
+
const dotCount = Math.min(cells, Math.max(chars.length, Math.max(1, null != (_props_minLength = props.minLength) ? _props_minLength : cells)));
|
|
261
|
+
const dotSize = props.dotSize && props.dotSize > 0 ? props.dotSize : 14;
|
|
262
|
+
for(let i = 0; dots && i < dotCount; i++)row.push(<view key={`d${i}`} className={`g9-pin__dot${i < chars.length ? ' g9-pin__dot--filled' : ''}`} style={{
|
|
263
|
+
width: `${dotSize}px`,
|
|
264
|
+
height: `${dotSize}px`,
|
|
265
|
+
borderRadius: `${dotSize / 2}px`
|
|
266
|
+
}}/>);
|
|
267
|
+
for(let i = 0; !dots && i < cells; i++){
|
|
259
268
|
var _props_maskCharacter, _props_placeholder;
|
|
260
269
|
const ch = chars[i];
|
|
261
270
|
const state = i === active ? 'active' : void 0 !== ch ? 'filled' : 'empty';
|
|
@@ -276,9 +285,9 @@ const G9PinEntry = forwardRef(function(props, ref) {
|
|
|
276
285
|
inGroup = 0;
|
|
277
286
|
}
|
|
278
287
|
}
|
|
279
|
-
return <view {...g9KeyboardTargetProps} className={`g9-pin g9-dir-ltr${props.disabled ? ' g9-pin--disabled' : ''}${complete ? ' g9-pin--complete' : ''}${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} accessibility-element={true} accessibility-label={`${props.accessibilityLabel ? `${props.accessibilityLabel}, ` : ''}${
|
|
288
|
+
return <view {...g9KeyboardTargetProps} className={`g9-pin g9-dir-ltr${dots ? ' g9-pin--dots' : ''}${props.disabled ? ' g9-pin--disabled' : ''}${complete ? ' g9-pin--complete' : ''}${props.className ? ` ${props.className}` : ''}`} {...g9IdProps(props.id)} accessibility-element={true} accessibility-label={`${props.accessibilityLabel ? `${props.accessibilityLabel}, ` : ''}${(null != (_props_progressLabel = props.progressLabel) ? _props_progressLabel : '{0} / {1}').replace('{0}', String(chars.length)).replace('{1}', String(cells))}`} bindtap={focus}>
|
|
280
289
|
{row}
|
|
281
|
-
<input {...g9KeyboardTargetProps} ref={attach} className="g9-pin__input" android-fullscreen-mode={false} ignore-focus={true} confirm-type="done" disabled={true === props.disabled} maxlength={cells} ios-auto-correct={false} ios-spell-check={false} type={type === G9PinEntryType.Number || type === G9PinEntryType.Password ? 'number' : 'text'} style={hiddenInputStyle} bindinput={onInput} bindfocus={()=>{
|
|
290
|
+
{keyboard ? <input {...g9KeyboardTargetProps} ref={attach} className="g9-pin__input" android-fullscreen-mode={false} ignore-focus={true} confirm-type="done" disabled={true === props.disabled} maxlength={cells} ios-auto-correct={false} ios-spell-check={false} type={type === G9PinEntryType.Number || type === G9PinEntryType.Password ? 'number' : 'text'} style={hiddenInputStyle} bindinput={onInput} bindfocus={()=>{
|
|
282
291
|
var _keyboardAware_onInputFocused;
|
|
283
292
|
setFocused(true);
|
|
284
293
|
null == (_keyboardAware_onInputFocused = keyboardAware.onInputFocused) || _keyboardAware_onInputFocused.call(keyboardAware);
|
|
@@ -286,7 +295,7 @@ const G9PinEntry = forwardRef(function(props, ref) {
|
|
|
286
295
|
var _keyboardAware_onInputBlurred;
|
|
287
296
|
setFocused(false);
|
|
288
297
|
null == (_keyboardAware_onInputBlurred = keyboardAware.onInputBlurred) || _keyboardAware_onInputBlurred.call(keyboardAware);
|
|
289
|
-
}}/>
|
|
298
|
+
}}/> : null}
|
|
290
299
|
</view>;
|
|
291
300
|
});
|
|
292
301
|
export { G9PinEntry, filterPin, isPinCharAllowed, parsePinGroupSizes, pinCellCount };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-entry.d.ts","sourceRoot":"","sources":["../../src/fields/text-entry.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,iBAAiB,EA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AK,EAAE;IACxC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC,GAAG,OAAO,CAEV;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACjD,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,UAAU,SAAU,SAAQ,gBAAgB;IAC1C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,yGA0GzB,CAAC;AAIF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,gHAEtB,CAAC"}
|
|
@@ -82,10 +82,16 @@ const TextEntryBody = forwardRef(function(props, ref) {
|
|
|
82
82
|
{core.text}
|
|
83
83
|
</text> : <input {...core.elementProps} className="g9-field__input" type={resolveInputElementType(core.inputType, keyboard, masked)} confirm-type={null != (_ref = null != (_props_variant_confirmType = props.variant.confirmType) ? _props_variant_confirmType : props.confirmType) ? _ref : 'done'} ios-spell-check={false !== props.isSpellCheckEnabled} ios-auto-correct={false !== props.isTextPredictionEnabled} style={{
|
|
84
84
|
direction: core.textDirection,
|
|
85
|
-
textAlign: 'rtl' === core.textDirection ? 'right' : 'left',
|
|
85
|
+
textAlign: 'code' === props.appearance ? 'center' : 'rtl' === core.textDirection ? 'right' : 'left',
|
|
86
86
|
...core.font ? {
|
|
87
87
|
fontFamily: core.font
|
|
88
88
|
} : {},
|
|
89
|
+
...'plain' === props.appearance ? {
|
|
90
|
+
fontSize: '17px'
|
|
91
|
+
} : {},
|
|
92
|
+
...'code' === props.appearance ? {
|
|
93
|
+
fontSize: '22px'
|
|
94
|
+
} : {},
|
|
89
95
|
color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)'
|
|
90
96
|
}}/>}
|
|
91
97
|
</G9OutlinedField>;
|