namirasoft-site-react 1.4.200 → 1.4.202
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.
|
@@ -38,21 +38,10 @@ export class NSBoxDate extends React.Component {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
|
-
var _a;
|
|
41
|
+
var _a, _b;
|
|
42
42
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
43
43
|
menu.builtin.copy = { enabled: true, getValue: () => { var _a; return (_a = this.state.value) !== null && _a !== void 0 ? _a : ""; } };
|
|
44
|
-
|
|
45
|
-
if (date)
|
|
46
|
-
try {
|
|
47
|
-
let toks = date.split(delimiter_from);
|
|
48
|
-
let ans = toks[0] + delimiter_to + toks[1].padStart(2, "0") + delimiter_to + toks[2].padStart(2, "0");
|
|
49
|
-
return ans;
|
|
50
|
-
}
|
|
51
|
-
catch (error) {
|
|
52
|
-
}
|
|
53
|
-
return "";
|
|
54
|
-
}
|
|
55
|
-
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("input", { id: this.props.id, name: this.props.name, type: "date", className: StylesNSBox.ns_box_input, placeholder: (_a = this.props.placeholder) !== null && _a !== void 0 ? _a : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: getFormattedValue(this.state.value, "/", "-"), onChange: e => this.setValue(getFormattedValue(e.target.value, "-", "/")), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, style: {
|
|
44
|
+
return (_jsx(NSBoxBaseLayout, Object.assign({ ref: this.NSBoxBaseLayout_Main }, this.props, { menu: menu, children: _jsx("input", { id: this.props.id, name: this.props.name, type: "date", className: StylesNSBox.ns_box_input, placeholder: (_a = this.props.placeholder) !== null && _a !== void 0 ? _a : `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`, value: (_b = this.state.value) !== null && _b !== void 0 ? _b : "", onChange: e => this.setValue(e.target.value), onClick: () => { var _a, _b; (_b = (_a = this.props).onClicked) === null || _b === void 0 ? void 0 : _b.call(_a, this); }, style: {
|
|
56
45
|
background: `url("https://static.namirasoft.com/image/concept/type/date.png") white no-repeat scroll center right 4px`,
|
|
57
46
|
backgroundSize: "24px",
|
|
58
47
|
paddingRight: "8px"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSBoxDate.js","sourceRoot":"","sources":["../../src/components/NSBoxDate.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,wBAAwB,CAAC;AAChC,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAyB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAWnD,MAAM,OAAO,SAAU,SAAQ,KAAK,CAAC,SAAyC;IAG7E,YAAY,KAAqB;;QAEhC,KAAK,CAAC,KAAK,CAAC,CAAC;QAHd,yBAAoB,GAAG,SAAS,EAAmB,CAAC;QAInD,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,IAAI,EAAE,CAAC;QACnD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACzC,IAA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,CAAC,IAAI,EACrB,IAAI,EAAC,MAAM,EACX,SAAS,EAAE,WAAW,CAAC,YAAY,EACnC,WAAW,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,WAAW,mCAAI,gBAAgB,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,EAAE,EAC3I,KAAK,EAAE,MAAA,IAAI,CAAC,KAAK,CAAC,KAAK,mCAAI,EAAE,EAC7B,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAC5C,OAAO,EAAE,GAAG,EAAE,eAAG,MAAA,MAAA,IAAI,CAAC,KAAK,EAAC,SAAS,mDAAG,IAAI,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE;oBACN,UAAU,EAAE,0GAA0G;oBACtH,cAAc,EAAE,MAAM;oBACtB,YAAY,EAAE,KAAK;iBACnB,GACA,IACe,CAClB,CAAC;IACH,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"framework": "npm",
|
|
9
9
|
"application": "package",
|
|
10
10
|
"private": false,
|
|
11
|
-
"version": "1.4.
|
|
11
|
+
"version": "1.4.202",
|
|
12
12
|
"author": "Amir Abolhasani",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "./dist/main.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"namirasoft-api-link": "^1.4.8",
|
|
36
36
|
"namirasoft-api-product": "^1.4.11",
|
|
37
37
|
"namirasoft-core": "^1.4.39",
|
|
38
|
-
"namirasoft-schema": "^1.4.
|
|
38
|
+
"namirasoft-schema": "^1.4.21",
|
|
39
39
|
"namirasoft-site-map": "^1.4.9",
|
|
40
40
|
"os-browserify": "^0.3.0",
|
|
41
41
|
"path-browserify": "^1.0.1",
|
|
@@ -61,20 +61,6 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState> i
|
|
|
61
61
|
let menu = safeMenuMenuItem(this.props, () => { });
|
|
62
62
|
menu.builtin.copy = { enabled: true, getValue: () => this.state.value ?? "" };
|
|
63
63
|
|
|
64
|
-
function getFormattedValue(date: string | null, delimiter_from: string, delimiter_to: string)
|
|
65
|
-
{
|
|
66
|
-
if (date)
|
|
67
|
-
try
|
|
68
|
-
{
|
|
69
|
-
let toks = date.split(delimiter_from);
|
|
70
|
-
let ans = toks[0] + delimiter_to + toks[1].padStart(2, "0") + delimiter_to + toks[2].padStart(2, "0");
|
|
71
|
-
return ans;
|
|
72
|
-
} catch (error)
|
|
73
|
-
{
|
|
74
|
-
}
|
|
75
|
-
return "";
|
|
76
|
-
}
|
|
77
|
-
|
|
78
64
|
return (
|
|
79
65
|
<NSBoxBaseLayout
|
|
80
66
|
ref={this.NSBoxBaseLayout_Main}
|
|
@@ -87,8 +73,8 @@ export class NSBoxDate extends React.Component<NSBoxDateProps, NSBoxDateState> i
|
|
|
87
73
|
type="date"
|
|
88
74
|
className={StylesNSBox.ns_box_input}
|
|
89
75
|
placeholder={this.props.placeholder ?? `Please enter ${NamingConvention.auto.convert(this.props.title, NamingConvention.lower_case_space)}`}
|
|
90
|
-
value={
|
|
91
|
-
onChange={e => this.setValue(
|
|
76
|
+
value={this.state.value ?? ""}
|
|
77
|
+
onChange={e => this.setValue(e.target.value)}
|
|
92
78
|
onClick={() => { this.props.onClicked?.(this); }}
|
|
93
79
|
style={{
|
|
94
80
|
background: `url("https://static.namirasoft.com/image/concept/type/date.png") white no-repeat scroll center right 4px`,
|