amotify 0.1.30 → 0.1.32

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.
Files changed (96) hide show
  1. package/dist/@declaration/_.js +1 -1
  2. package/dist/@styles/componentClasses/_.css +102 -99
  3. package/dist/@styles/componentClasses/_.js +46 -46
  4. package/dist/@styles/index.css +102 -99
  5. package/dist/@styles/index.js +46 -46
  6. package/dist/@styles/init.css +2 -2
  7. package/dist/@styles/style.css +102 -99
  8. package/dist/@styles/style.js +46 -46
  9. package/dist/@styles/var.css +2 -2
  10. package/dist/@utils/GenerateClassName.js +470 -1
  11. package/dist/@utils/LaunchReactApp.js +78 -1
  12. package/dist/@utils/_.js +12 -1
  13. package/dist/@utils/collectForm.js +96 -1
  14. package/dist/@utils/color.js +103 -1
  15. package/dist/@utils/config.js +101 -1
  16. package/dist/@utils/fin.js +39 -1
  17. package/dist/@utils/getElement.js +13 -1
  18. package/dist/@utils/jsminEx.js +172 -1
  19. package/dist/@utils/pageTransit.js +33 -1
  20. package/dist/@utils/useRecycle.js +44 -1
  21. package/dist/@utils/useStore.js +54 -1
  22. package/dist/atoms/Box.js +20 -1
  23. package/dist/atoms/FAI.js +148 -1
  24. package/dist/atoms/Flex.js +34 -1
  25. package/dist/atoms/Grid.js +17 -1
  26. package/dist/atoms/Img.js +65 -1
  27. package/dist/atoms/Logo.js +359 -51
  28. package/dist/atoms/P.js +20 -1
  29. package/dist/atoms/Placeholder.js +44 -1
  30. package/dist/atoms/Span.js +20 -1
  31. package/dist/atoms/_.js +9 -1
  32. package/dist/chunk-JJ3PEWPN.js +60 -0
  33. package/dist/fn/Button.js +316 -1
  34. package/dist/fn/Cropper.js +1009 -1
  35. package/dist/fn/Effect/Fade.js +88 -1
  36. package/dist/fn/Effect/Pudding.js +22 -1
  37. package/dist/fn/Effect/Ripple.js +117 -3
  38. package/dist/fn/Effect/_.js +14 -1
  39. package/dist/fn/Input/AutoHeightText.js +112 -1
  40. package/dist/fn/Input/Checker.js +36 -1
  41. package/dist/fn/Input/Chips/Selector.js +472 -1
  42. package/dist/fn/Input/Chips/_.js +349 -1
  43. package/dist/fn/Input/Contenteditable.d.ts +1 -1
  44. package/dist/fn/Input/Contenteditable.js +160 -1
  45. package/dist/fn/Input/DigitCharacters.js +275 -1
  46. package/dist/fn/Input/Filer.js +619 -1
  47. package/dist/fn/Input/Hidden.js +48 -1
  48. package/dist/fn/Input/List.js +450 -1
  49. package/dist/fn/Input/Parts.js +121 -1
  50. package/dist/fn/Input/Plain.js +12 -1
  51. package/dist/fn/Input/RichSelect.js +279 -1
  52. package/dist/fn/Input/Search.js +53 -1
  53. package/dist/fn/Input/Segmented.js +245 -1
  54. package/dist/fn/Input/Select.js +278 -1
  55. package/dist/fn/Input/Slider.js +538 -1
  56. package/dist/fn/Input/Switch.js +221 -1
  57. package/dist/fn/Input/Text.js +626 -1
  58. package/dist/fn/Input/TextArea.js +151 -1
  59. package/dist/fn/Input/Time/Picker.js +1457 -1
  60. package/dist/fn/Input/Time/_.js +867 -1
  61. package/dist/fn/Input/_.js +48 -1
  62. package/dist/fn/Input/core.js +626 -1
  63. package/dist/fn/Layout/PageNotFound.js +90 -1
  64. package/dist/fn/Layout/PageRouter.js +87 -1
  65. package/dist/fn/Layout/PageViewController.js +29 -1
  66. package/dist/fn/Layout/Plate.js +37 -1
  67. package/dist/fn/Layout/RootViewController.js +315 -1
  68. package/dist/fn/Layout/SwipeView.js +348 -1
  69. package/dist/fn/Layout/TabBar.js +72 -1
  70. package/dist/fn/Layout/_.js +22 -1
  71. package/dist/fn/Loader/_.js +104 -1
  72. package/dist/fn/Loader/corner.js +85 -1
  73. package/dist/fn/Loader/mini.js +125 -1
  74. package/dist/fn/Loader/top.js +73 -1
  75. package/dist/fn/Sheet.js +1101 -1
  76. package/dist/fn/Snackbar.js +216 -1
  77. package/dist/fn/Table/Data.js +974 -1
  78. package/dist/fn/Table/Drag.js +435 -1
  79. package/dist/fn/Table/Normal.js +136 -1
  80. package/dist/fn/Table/Parts.js +41 -1
  81. package/dist/fn/Table/Wrapper.js +60 -1
  82. package/dist/fn/Table/_.js +16 -1
  83. package/dist/fn/Table/cellStyling.js +51 -1
  84. package/dist/fn/Tooltips.js +58 -1
  85. package/dist/fn/_.js +10 -1
  86. package/dist/index.js +20 -1
  87. package/dist/mols/Accordion.js +152 -1
  88. package/dist/mols/Column.js +16 -1
  89. package/dist/mols/LinkifyText.js +42 -1
  90. package/dist/mols/List.js +42 -1
  91. package/dist/mols/Row.js +47 -1
  92. package/dist/mols/Text.js +67 -1
  93. package/dist/mols/_.js +6 -1
  94. package/dist/temps/_.js +1 -1
  95. package/dist/temps/designBook.js +3639 -20
  96. package/package.json +1 -1
@@ -1 +1,279 @@
1
- import{b as t,c as a,d as O}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{useState as R}from"react";import{$$ as s}from"../../@utils/_";import M from"../../atoms/Box";import P from"../../atoms/FAI";import $ from"../../mols/Column";import j from"../Button";import _ from"../Tooltips";import{Wrapper as K,BoxWrapper as z,CommonEffects as G,DefaultStyles as Q}from"./core";import X from"./Parts";import{InputRichSelectClasses as Y,InputClasses as Z}from"../../@styles/componentClasses/_";function w(e){let{value:l,params:r}=e,{required:o,options:i}=r,p=[];return o&&(!i.length||i.length&&s.is.nullish(JSON.parse(l)))&&p.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!p.filter(({type:d})=>d=="invalid").length,notice:p}}const ee=e=>{let E=e,{tone:l,required:r,form:o,className:i,enableFormSubmit:p,enableUnSelected:d,checkValidationAtFirst:b,onChange:I,onKeyDown:V,onValidate:C,onUpdateValue:f,onUpdateValidValue:h,value:y="",options:x,placeholder:k,leftIndicator:le,rightIndicator:ne,leftIcon:oe,rightIcon:ae,componentID:ie,status_id:ue,cellStyles:A,sheetStyles:m,gravityPoint:F}=E,L=O(E,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","cellStyles","sheetStyles","gravityPoint"]),H={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:s.uuid.gen()},[D]=R(s.uuid.gen()),[u,S]=R(H),[v,J]=R({ok:!1,notice:[]});G({type:"richSelect",params:e,val_status:u,set_status:S,ExtraOverrideParams:{dataValue:y,formatValue:y},val_validate:v,set_validate:J,DefaultValidation:w,onUpdateValue:f,onUpdateValidValue:h});let T=n(M,{fontColor:"4.thin",textAlign:"left",children:k||"\u9078\u629E"});if(u.dataValue){let c=x.find(g=>g.type=="button"&&g.value==u.dataValue);c&&(T=c.selectedLabel||c.label)}return n(z,{val_status:u,set_status:S,val_validate:v,params:e,children:n("button",a(t({},L),{"data-form":o,"data-validation":v.ok,"data-component-id":u.componentID,"data-value":u.dataValue,"data-input-type":"richSelect",className:[i,Y("SelectLegend"),Z("InputCover")].join(" "),onClick:c=>{_.open({tipsID:D,parent:c.currentTarget,gravityPoint:F||13,close_option:{parentBlur:!1},content:()=>{let g=x.map(U=>{let{type:W,value:q,label:B}=U;return W=="button"?n(j.Button.Clear.R,a(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0,onClick:()=>{S(a(t({},u),{dataValue:q,eventType:"update",eventID:s.uuid.gen()})),_.close(D)}},A),{children:B})):B});return n($,a(t({ssCardBox:!0,padding:[1,0],gap:0,overflow:"auto"},m),{freeCSS:t({minWidth:12*20,maxHeight:"90vh"},m==null?void 0:m.freeCSS),children:g}))}})},children:T}))})},te=e=>{let{value:l=null,placeholder:r,options:o=[]}=e,i=0,p=JSON.stringify(l),d=o.map(I=>{let{type:V,value:C}=I,f=JSON.stringify(C),h=f==p;return i|=Number(h),a(t({},I),{type:V||"button",value:f})});i||(l=null);let b=JSON.stringify(l);return n(ee,a(t({},e),{value:b,options:d}))},N=e=>{var r,o;e=t({},e),s.is.nullish(e.rightIcon)&&(e.rightIcon=n(X.RightIcon,a(t({flexType:"col"},e.rightIconStyles),{children:n(P.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(o=e.paddingLeft)!=null?o:3);let l=Q.Boxish(e);return delete l.rightIconStyles,n(K,{componentID:e.componentID,children:te,params:l})};export{N as RichSelect,N as default};
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import {
8
+ useState
9
+ } from "react";
10
+ import {
11
+ $$
12
+ } from "../../@utils/_";
13
+ import Box from "../../atoms/Box";
14
+ import FAI from "../../atoms/FAI";
15
+ import Column from "../../mols/Column";
16
+ import Button from "../Button";
17
+ import Tooltips from "../Tooltips";
18
+ import {
19
+ Wrapper,
20
+ BoxWrapper,
21
+ CommonEffects,
22
+ DefaultStyles
23
+ } from "./core";
24
+ import Parts from "./Parts";
25
+ import {
26
+ InputRichSelectClasses,
27
+ InputClasses
28
+ } from "../../@styles/componentClasses/_";
29
+ function DefaultValidation(props) {
30
+ let {
31
+ value,
32
+ params
33
+ } = props;
34
+ let {
35
+ required,
36
+ options
37
+ } = params;
38
+ let notice = [];
39
+ if (required) {
40
+ if (!options.length || options.length && $$.is.nullish(JSON.parse(value))) {
41
+ notice.push({ type: "invalid", label: "\u5FC5\u9808\u9805\u76EE\u3067\u3059" });
42
+ }
43
+ }
44
+ return {
45
+ ok: !notice.filter(({ type }) => type == "invalid").length,
46
+ notice
47
+ };
48
+ }
49
+ const Core = (params) => {
50
+ let _a = params, {
51
+ tone,
52
+ required,
53
+ form,
54
+ className,
55
+ enableFormSubmit,
56
+ enableUnSelected,
57
+ checkValidationAtFirst,
58
+ onChange,
59
+ onKeyDown,
60
+ onValidate,
61
+ onUpdateValue,
62
+ onUpdateValidValue,
63
+ value = "",
64
+ options,
65
+ placeholder,
66
+ leftIndicator,
67
+ rightIndicator,
68
+ leftIcon,
69
+ rightIcon,
70
+ componentID,
71
+ status_id,
72
+ cellStyles,
73
+ sheetStyles,
74
+ gravityPoint
75
+ } = _a, others = __objRest(_a, [
76
+ "tone",
77
+ "required",
78
+ "form",
79
+ "className",
80
+ "enableFormSubmit",
81
+ "enableUnSelected",
82
+ "checkValidationAtFirst",
83
+ "onChange",
84
+ "onKeyDown",
85
+ "onValidate",
86
+ "onUpdateValue",
87
+ "onUpdateValidValue",
88
+ "value",
89
+ "options",
90
+ "placeholder",
91
+ "leftIndicator",
92
+ "rightIndicator",
93
+ "leftIcon",
94
+ "rightIcon",
95
+ "componentID",
96
+ "status_id",
97
+ "cellStyles",
98
+ "sheetStyles",
99
+ "gravityPoint"
100
+ ]);
101
+ let Default_Status = {
102
+ componentID: params.componentID || "",
103
+ dataValue: value,
104
+ eventType: "init",
105
+ eventID: $$.uuid.gen()
106
+ };
107
+ let [val_tipID] = useState($$.uuid.gen());
108
+ let [val_status, set_status] = useState(Default_Status);
109
+ let [val_validate, set_validate] = useState({
110
+ ok: false,
111
+ notice: []
112
+ });
113
+ CommonEffects({
114
+ type: "richSelect",
115
+ params,
116
+ val_status,
117
+ set_status,
118
+ ExtraOverrideParams: {
119
+ dataValue: value,
120
+ formatValue: value
121
+ },
122
+ val_validate,
123
+ set_validate,
124
+ DefaultValidation,
125
+ onUpdateValue,
126
+ onUpdateValidValue
127
+ });
128
+ let SelectedElement = /* @__PURE__ */ jsx(Box, { fontColor: "4.thin", textAlign: "left", children: placeholder || "\u9078\u629E" });
129
+ if (val_status.dataValue) {
130
+ let Selected = options.find((option) => option.type == "button" && option.value == val_status.dataValue);
131
+ if (Selected) {
132
+ SelectedElement = Selected.selectedLabel || Selected.label;
133
+ }
134
+ }
135
+ return /* @__PURE__ */ jsx(
136
+ BoxWrapper,
137
+ {
138
+ val_status,
139
+ set_status,
140
+ val_validate,
141
+ params,
142
+ children: /* @__PURE__ */ jsx(
143
+ "button",
144
+ __spreadProps(__spreadValues({}, others), {
145
+ "data-form": form,
146
+ "data-validation": val_validate.ok,
147
+ "data-component-id": val_status.componentID,
148
+ "data-value": val_status.dataValue,
149
+ "data-input-type": "richSelect",
150
+ className: [
151
+ className,
152
+ InputRichSelectClasses("SelectLegend"),
153
+ InputClasses("InputCover")
154
+ ].join(" "),
155
+ onClick: (e) => {
156
+ Tooltips.open({
157
+ tipsID: val_tipID,
158
+ parent: e.currentTarget,
159
+ gravityPoint: gravityPoint || 13,
160
+ close_option: {
161
+ parentBlur: false
162
+ },
163
+ content: () => {
164
+ let Options = options.map((option) => {
165
+ let {
166
+ type,
167
+ value: value2,
168
+ label
169
+ } = option;
170
+ if (type == "button") {
171
+ return /* @__PURE__ */ jsx(
172
+ Button.Button.Clear.R,
173
+ __spreadProps(__spreadValues({
174
+ color: "cloud",
175
+ borderRadius: 0,
176
+ fontColor: "2.normal",
177
+ textAlign: "left",
178
+ padding: 0,
179
+ onClick: () => {
180
+ set_status(__spreadProps(__spreadValues({}, val_status), {
181
+ dataValue: value2,
182
+ eventType: "update",
183
+ eventID: $$.uuid.gen()
184
+ }));
185
+ Tooltips.close(val_tipID);
186
+ }
187
+ }, cellStyles), {
188
+ children: label
189
+ })
190
+ );
191
+ } else {
192
+ return label;
193
+ }
194
+ });
195
+ return /* @__PURE__ */ jsx(
196
+ Column,
197
+ __spreadProps(__spreadValues({
198
+ ssCardBox: true,
199
+ padding: [1, 0],
200
+ gap: 0,
201
+ overflow: "auto"
202
+ }, sheetStyles), {
203
+ freeCSS: __spreadValues({
204
+ minWidth: 12 * 20,
205
+ maxHeight: "90vh"
206
+ }, sheetStyles == null ? void 0 : sheetStyles.freeCSS),
207
+ children: Options
208
+ })
209
+ );
210
+ }
211
+ });
212
+ },
213
+ children: SelectedElement
214
+ })
215
+ )
216
+ }
217
+ );
218
+ };
219
+ const RichSelectInput = (params) => {
220
+ let {
221
+ value = null,
222
+ placeholder,
223
+ options = []
224
+ } = params;
225
+ let SelectedExist = 0;
226
+ let SelectedValue = JSON.stringify(value);
227
+ let DefaultOptions = options.map((option) => {
228
+ let { type, value: value2 } = option;
229
+ let Value = JSON.stringify(value2);
230
+ let Selected = Value == SelectedValue;
231
+ SelectedExist |= Number(Selected);
232
+ return __spreadProps(__spreadValues({}, option), {
233
+ type: type || "button",
234
+ value: Value
235
+ });
236
+ });
237
+ if (!SelectedExist)
238
+ value = null;
239
+ let DefaultValue = JSON.stringify(value);
240
+ return /* @__PURE__ */ jsx(
241
+ Core,
242
+ __spreadProps(__spreadValues({}, params), {
243
+ value: DefaultValue,
244
+ options: DefaultOptions
245
+ })
246
+ );
247
+ };
248
+ const RichSelect = (rawParams) => {
249
+ var _a, _b;
250
+ rawParams = __spreadValues({}, rawParams);
251
+ if ($$.is.nullish(rawParams.rightIcon)) {
252
+ rawParams.rightIcon = /* @__PURE__ */ jsx(
253
+ Parts.RightIcon,
254
+ __spreadProps(__spreadValues({
255
+ flexType: "col"
256
+ }, rawParams.rightIconStyles), {
257
+ children: /* @__PURE__ */ jsx(FAI.AngleDown, {})
258
+ })
259
+ );
260
+ }
261
+ if (rawParams.rightIcon)
262
+ rawParams.paddingRight = (_a = rawParams.paddingRight) != null ? _a : 3;
263
+ if (rawParams.leftIcon)
264
+ rawParams.paddingLeft = (_b = rawParams.paddingLeft) != null ? _b : 3;
265
+ let params = DefaultStyles.Boxish(rawParams);
266
+ delete params.rightIconStyles;
267
+ return /* @__PURE__ */ jsx(
268
+ Wrapper,
269
+ {
270
+ componentID: rawParams.componentID,
271
+ children: RichSelectInput,
272
+ params
273
+ }
274
+ );
275
+ };
276
+ export {
277
+ RichSelect,
278
+ RichSelect as default
279
+ };
@@ -1 +1,53 @@
1
- import{b as e}from"../../chunk-VY3566IV.js";import{jsx as t,jsxs as p}from"react/jsx-runtime";import r from"../../atoms/Box";import n from"../../atoms/FAI";import i from"../../mols/Row";import f from"../../mols/Column";import{faAngleUp as l}from"@fortawesome/free-solid-svg-icons/faAngleUp";import{faAngleDown as u}from"@fortawesome/free-solid-svg-icons/faAngleDown";import c from"./Chips/_";import d from"./Parts";const m=a=>t(c,e({AddButtonComponent:o=>o.selected.length?null:t(r,{children:"\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),SelectedCellComponent:o=>t(r,{width:1,textAlign:"left",children:p(i.Separate,{children:[o.label,o.defaultRemoveButton]})}),paddingLeft:3,rightIcon:t(d.LeftIcon,{children:p(f,{gap:0,children:[t(n,{icon:l}),t(n,{icon:u,freeCSS:{marginTop:-6}})]})}),limit:1},a));export{m as Search,m as default};
1
+ import {
2
+ __spreadValues
3
+ } from "../../chunk-JJ3PEWPN.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import Box from "../../atoms/Box";
6
+ import FAI from "../../atoms/FAI";
7
+ import Row from "../../mols/Row";
8
+ import Column from "../../mols/Column";
9
+ import { faAngleUp } from "@fortawesome/free-solid-svg-icons/faAngleUp";
10
+ import { faAngleDown } from "@fortawesome/free-solid-svg-icons/faAngleDown";
11
+ import Chips from "./Chips/_";
12
+ import Parts from "./Parts";
13
+ const Search = (params) => {
14
+ return /* @__PURE__ */ jsx(
15
+ Chips,
16
+ __spreadValues({
17
+ AddButtonComponent: (props) => {
18
+ if (props.selected.length)
19
+ return null;
20
+ return /* @__PURE__ */ jsx(Box, { children: "\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044" });
21
+ },
22
+ SelectedCellComponent: (props) => {
23
+ return /* @__PURE__ */ jsx(
24
+ Box,
25
+ {
26
+ width: 1,
27
+ textAlign: "left",
28
+ children: /* @__PURE__ */ jsxs(Row.Separate, { children: [
29
+ props.label,
30
+ props.defaultRemoveButton
31
+ ] })
32
+ }
33
+ );
34
+ },
35
+ paddingLeft: 3,
36
+ rightIcon: /* @__PURE__ */ jsx(Parts.LeftIcon, { children: /* @__PURE__ */ jsxs(
37
+ Column,
38
+ {
39
+ gap: 0,
40
+ children: [
41
+ /* @__PURE__ */ jsx(FAI, { icon: faAngleUp }),
42
+ /* @__PURE__ */ jsx(FAI, { icon: faAngleDown, freeCSS: { marginTop: -6 } })
43
+ ]
44
+ }
45
+ ) }),
46
+ limit: 1
47
+ }, params)
48
+ );
49
+ };
50
+ export {
51
+ Search,
52
+ Search as default
53
+ };
@@ -1 +1,245 @@
1
- import{b as o,c as l,d as a}from"../../chunk-VY3566IV.js";import{jsx as t}from"react/jsx-runtime";import{$$ as R}from"../../@utils/_";import{useState as c}from"react";import x from"./List";import{InputSegmentedClasses as u}from"../../@styles/componentClasses/_";const n=e=>{let S=e,{tone:E,appearance:i,value:r,options:f,onUpdateValue:b,onUpdateValidValue:C,freeCSS:p,cellStyles:g,cellClassName:k,cellCheckedClassName:B,cellCheckedStyles:I}=S,m=a(S,["tone","appearance","value","options","onUpdateValue","onUpdateValidValue","freeCSS","cellStyles","cellClassName","cellCheckedClassName","cellCheckedStyles"]),[v]=c(R.uuid.gen()),[s,L]=c(r),[w,h]=c(s);return s!=r&&(L(r),h(r)),t(x.Radio,l(o({defaultActiveStyling:!1,flexWrap:!1,borderRadius:"2.tone.secondary",position:"relative",options:f,value:w,componentID:v,icon:!1},m),{freeCSS:o({whiteSpace:"nowrap"},p),cellStyles:o({flexCenter:!0,ssPushable:!0,boxShadow:"none"},g),cellClassName:[k,u("Label"),u("Tone_"+i)].join(" "),cellCheckedStyles:o({isSemiBoldFont:!0},I),cellCheckedClassName:[B,u("Checked")].join(" "),tone:"custom",onUpdateValue:b,onUpdateValidValue:y=>{C&&C(y),i=="BottomLine"&&h(y.value[0])}}))},d={Auto:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",ssCardBox:!0},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Auto"},e))),Normal:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),Cloud:e=>(e=o({},e),e=l(o({padding:"1/3",gap:"1/3",backgroundColor:"cloud"},e),{cellStyles:o({borderRadius:"inherit",position:"relative"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Cloud"},e))),Cloud2:e=>(e=o({},e),e.tone="WhiteCloud",t(d.Cloud,l(o({fontColor:"3.blur"},e),{cellCheckedStyles:o({fontColor:"1.clear"},e.cellCheckedStyles)}))),Cloud3:e=>(e=o({},e),e.tone="ThemeCloud",t(d.Cloud,l(o({backgroundColor:"tcOpFew",fontColor:"theme"},e),{cellStyles:o({},e.cellStyles)}))),Border:e=>(e=o({},e),e=l(o({backgroundColor:"1.layer.base",border:"2.normal",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin"},e),{cellStyles:o({borderRadius:0,borderRight:"2.normal"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"tcOpFew",fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:e.tone||"Border"},e))),Border2:e=>(e=o({},e),e=l(o({border:!0,borderColor:"theme",overflow:"hidden",gap:0,ssLastChildLossBorder:"right",boxShadow:"0.thin",fontColor:"3.blur"},e),{cellStyles:o({borderRadius:0,borderRight:!0,borderColor:"theme"},e.cellStyles),cellCheckedStyles:o({backgroundColor:"theme",fontColor:"white"},e.cellCheckedStyles)}),e.tone="ThemeBorder",t(n,o({appearance:"Border"},e))),BottomLine:e=>(e=o({},e),e=l(o({gap:0,fontColor:"3.blur"},e),{cellStyles:o({ssEffectsOnActive:"ripple.theme",borderRadius:0,padding:1},e.cellStyles),cellCheckedStyles:o({fontColor:"theme"},e.cellCheckedStyles)}),t(n,o({appearance:"BottomLine"},e)))};export{d as Segmented,d as default};
1
+ import {
2
+ __objRest,
3
+ __spreadProps,
4
+ __spreadValues
5
+ } from "../../chunk-JJ3PEWPN.js";
6
+ import { jsx } from "react/jsx-runtime";
7
+ import {
8
+ $$
9
+ } from "../../@utils/_";
10
+ import {
11
+ useState
12
+ } from "react";
13
+ import List from "./List";
14
+ import { InputSegmentedClasses } from "../../@styles/componentClasses/_";
15
+ const Core = (params) => {
16
+ let _a = params, {
17
+ tone,
18
+ appearance,
19
+ value,
20
+ options,
21
+ onUpdateValue,
22
+ onUpdateValidValue,
23
+ freeCSS,
24
+ cellStyles,
25
+ cellClassName,
26
+ cellCheckedClassName,
27
+ cellCheckedStyles
28
+ } = _a, others = __objRest(_a, [
29
+ "tone",
30
+ "appearance",
31
+ "value",
32
+ "options",
33
+ "onUpdateValue",
34
+ "onUpdateValidValue",
35
+ "freeCSS",
36
+ "cellStyles",
37
+ "cellClassName",
38
+ "cellCheckedClassName",
39
+ "cellCheckedStyles"
40
+ ]);
41
+ let [val_componentID] = useState($$.uuid.gen());
42
+ let [val_defValue, set_defValue] = useState(value);
43
+ let [val_value, set_value] = useState(val_defValue);
44
+ if (val_defValue != value) {
45
+ set_defValue(value);
46
+ set_value(value);
47
+ }
48
+ return /* @__PURE__ */ jsx(
49
+ List.Radio,
50
+ __spreadProps(__spreadValues({
51
+ defaultActiveStyling: false,
52
+ flexWrap: false,
53
+ borderRadius: "2.tone.secondary",
54
+ position: "relative",
55
+ options,
56
+ value: val_value,
57
+ componentID: val_componentID,
58
+ icon: false
59
+ }, others), {
60
+ freeCSS: __spreadValues({
61
+ whiteSpace: "nowrap"
62
+ }, freeCSS),
63
+ cellStyles: __spreadValues({
64
+ flexCenter: true,
65
+ ssPushable: true,
66
+ boxShadow: "none"
67
+ }, cellStyles),
68
+ cellClassName: [
69
+ cellClassName,
70
+ InputSegmentedClasses("Label"),
71
+ InputSegmentedClasses("Tone_" + appearance)
72
+ ].join(" "),
73
+ cellCheckedStyles: __spreadValues({
74
+ isSemiBoldFont: true
75
+ }, cellCheckedStyles),
76
+ cellCheckedClassName: [
77
+ cellCheckedClassName,
78
+ InputSegmentedClasses("Checked")
79
+ ].join(" "),
80
+ tone: "custom",
81
+ onUpdateValue,
82
+ onUpdateValidValue: (args) => {
83
+ if (onUpdateValidValue)
84
+ onUpdateValidValue(args);
85
+ if (appearance == "BottomLine") {
86
+ set_value(args.value[0]);
87
+ }
88
+ }
89
+ })
90
+ );
91
+ };
92
+ const Segmented = {
93
+ Auto: (params) => {
94
+ params = __spreadValues({}, params);
95
+ params = __spreadProps(__spreadValues({
96
+ padding: "1/3",
97
+ gap: "1/3",
98
+ ssCardBox: true
99
+ }, params), {
100
+ cellStyles: __spreadValues({
101
+ borderRadius: "inherit",
102
+ position: "relative"
103
+ }, params.cellStyles),
104
+ cellCheckedStyles: __spreadValues({
105
+ backgroundColor: "theme",
106
+ fontColor: "white"
107
+ }, params.cellCheckedStyles)
108
+ });
109
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: params.tone || "Auto" }, params));
110
+ },
111
+ Normal: (params) => {
112
+ params = __spreadValues({}, params);
113
+ params = __spreadProps(__spreadValues({
114
+ border: true,
115
+ borderColor: "theme",
116
+ overflow: "hidden",
117
+ gap: 0,
118
+ ssLastChildLossBorder: "right",
119
+ fontColor: "3.blur"
120
+ }, params), {
121
+ cellStyles: __spreadValues({
122
+ borderRadius: 0,
123
+ borderRight: true,
124
+ borderColor: "theme"
125
+ }, params.cellStyles),
126
+ cellCheckedStyles: __spreadValues({
127
+ backgroundColor: "theme",
128
+ fontColor: "white"
129
+ }, params.cellCheckedStyles)
130
+ });
131
+ params.tone = "ThemeBorder";
132
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: "Border" }, params));
133
+ },
134
+ Cloud: (params) => {
135
+ params = __spreadValues({}, params);
136
+ params = __spreadProps(__spreadValues({
137
+ padding: "1/3",
138
+ gap: "1/3",
139
+ backgroundColor: "cloud"
140
+ }, params), {
141
+ cellStyles: __spreadValues({
142
+ borderRadius: "inherit",
143
+ position: "relative"
144
+ }, params.cellStyles),
145
+ cellCheckedStyles: __spreadValues({
146
+ backgroundColor: "theme",
147
+ fontColor: "white"
148
+ }, params.cellCheckedStyles)
149
+ });
150
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: params.tone || "Cloud" }, params));
151
+ },
152
+ Cloud2: (params) => {
153
+ params = __spreadValues({}, params);
154
+ params.tone = "WhiteCloud";
155
+ return /* @__PURE__ */ jsx(
156
+ Segmented.Cloud,
157
+ __spreadProps(__spreadValues({
158
+ fontColor: "3.blur"
159
+ }, params), {
160
+ cellCheckedStyles: __spreadValues({
161
+ fontColor: "1.clear"
162
+ }, params.cellCheckedStyles)
163
+ })
164
+ );
165
+ },
166
+ Cloud3: (params) => {
167
+ params = __spreadValues({}, params);
168
+ params.tone = "ThemeCloud";
169
+ return /* @__PURE__ */ jsx(
170
+ Segmented.Cloud,
171
+ __spreadProps(__spreadValues({
172
+ backgroundColor: "tcOpFew",
173
+ fontColor: "theme"
174
+ }, params), {
175
+ cellStyles: __spreadValues({}, params.cellStyles)
176
+ })
177
+ );
178
+ },
179
+ Border: (params) => {
180
+ params = __spreadValues({}, params);
181
+ params = __spreadProps(__spreadValues({
182
+ backgroundColor: "1.layer.base",
183
+ border: "2.normal",
184
+ overflow: "hidden",
185
+ gap: 0,
186
+ ssLastChildLossBorder: "right",
187
+ boxShadow: "0.thin"
188
+ }, params), {
189
+ cellStyles: __spreadValues({
190
+ borderRadius: 0,
191
+ borderRight: "2.normal"
192
+ }, params.cellStyles),
193
+ cellCheckedStyles: __spreadValues({
194
+ backgroundColor: "tcOpFew",
195
+ fontColor: "theme"
196
+ }, params.cellCheckedStyles)
197
+ });
198
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: params.tone || "Border" }, params));
199
+ },
200
+ Border2: (params) => {
201
+ params = __spreadValues({}, params);
202
+ params = __spreadProps(__spreadValues({
203
+ border: true,
204
+ borderColor: "theme",
205
+ overflow: "hidden",
206
+ gap: 0,
207
+ ssLastChildLossBorder: "right",
208
+ boxShadow: "0.thin",
209
+ fontColor: "3.blur"
210
+ }, params), {
211
+ cellStyles: __spreadValues({
212
+ borderRadius: 0,
213
+ borderRight: true,
214
+ borderColor: "theme"
215
+ }, params.cellStyles),
216
+ cellCheckedStyles: __spreadValues({
217
+ backgroundColor: "theme",
218
+ fontColor: "white"
219
+ }, params.cellCheckedStyles)
220
+ });
221
+ params.tone = "ThemeBorder";
222
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: "Border" }, params));
223
+ },
224
+ BottomLine: (params) => {
225
+ params = __spreadValues({}, params);
226
+ params = __spreadProps(__spreadValues({
227
+ gap: 0,
228
+ fontColor: "3.blur"
229
+ }, params), {
230
+ cellStyles: __spreadValues({
231
+ ssEffectsOnActive: "ripple.theme",
232
+ borderRadius: 0,
233
+ padding: 1
234
+ }, params.cellStyles),
235
+ cellCheckedStyles: __spreadValues({
236
+ fontColor: "theme"
237
+ }, params.cellCheckedStyles)
238
+ });
239
+ return /* @__PURE__ */ jsx(Core, __spreadValues({ appearance: "BottomLine" }, params));
240
+ }
241
+ };
242
+ export {
243
+ Segmented,
244
+ Segmented as default
245
+ };