@symbo.ls/uikit 2.11.270 → 2.11.276

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/dist/index.cjs.js CHANGED
@@ -406,6 +406,7 @@ var require_string = __commonJS({
406
406
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
407
407
  var string_exports = {};
408
408
  __export2(string_exports, {
409
+ lowercaseFirstLetter: () => lowercaseFirstLetter,
409
410
  replaceLiteralsWithObjectFields: () => replaceLiteralsWithObjectFields2,
410
411
  stringIncludesAny: () => stringIncludesAny,
411
412
  trimStringFromSymbols: () => trimStringFromSymbols
@@ -445,6 +446,9 @@ var require_string = __commonJS({
445
446
  }
446
447
  });
447
448
  };
449
+ var lowercaseFirstLetter = (inputString) => {
450
+ return `${inputString.charAt(0).toLowerCase()}${inputString.slice(1)}`;
451
+ };
448
452
  }
449
453
  });
450
454
 
@@ -4764,7 +4768,7 @@ var require_on = __commonJS({
4764
4768
  var applyEventsOnNode = (element, options) => {
4765
4769
  const { node: node2, on } = element;
4766
4770
  for (const param in on) {
4767
- if (param === "init" || param === "beforeClassAssign" || param === "render" || param === "renderRouter" || param === "attachNode" || param === "stateInit" || param === "stateCreated" || param === "initStateUpdated" || param === "stateUpdated" || param === "initUpdate" || param === "update")
4771
+ if (param === "init" || param === "beforeClassAssign" || param === "render" || param === "renderRouter" || param === "attachNode" || param === "stateInit" || param === "stateCreated" || param === "initStateUpdate" || param === "stateUpdate" || param === "initUpdate" || param === "update")
4768
4772
  continue;
4769
4773
  const appliedFunction = element.on[param];
4770
4774
  if ((0, import_utils17.isFunction)(appliedFunction)) {
@@ -5262,7 +5266,7 @@ var require_updateState = __commonJS({
5262
5266
  } else if (options.preventInheritAtCurrentState)
5263
5267
  return;
5264
5268
  if (!options.preventInitStateUpdateListener) {
5265
- const initStateUpdateReturns = (0, import_event.triggerEventOnUpdate)("initStateUpdated", obj, element, options);
5269
+ const initStateUpdateReturns = (0, import_event.triggerEventOnUpdate)("initStateUpdate", obj, element, options);
5266
5270
  if (initStateUpdateReturns === false)
5267
5271
  return element;
5268
5272
  }
@@ -5273,7 +5277,7 @@ var require_updateState = __commonJS({
5273
5277
  updateDependentState(state, obj, options);
5274
5278
  applyElementUpdate(state, obj, options);
5275
5279
  if (!options.preventStateUpdateListener) {
5276
- (0, import_event.triggerEventOnUpdate)("stateUpdated", obj, element, options);
5280
+ (0, import_event.triggerEventOnUpdate)("stateUpdate", obj, element, options);
5277
5281
  }
5278
5282
  return state;
5279
5283
  };
@@ -5281,13 +5285,15 @@ var require_updateState = __commonJS({
5281
5285
  const { overwrite } = options;
5282
5286
  if (!overwrite)
5283
5287
  return;
5284
- const shallow = overwrite === "shallow";
5288
+ const shallow = overwrite === "shallow" || overwrite === "shallow-once";
5285
5289
  const merge22 = overwrite === "merge";
5286
5290
  if (merge22) {
5287
5291
  (0, import_utils17.deepMerge)(state, obj, import_ignore.IGNORE_STATE_PARAMS);
5288
5292
  return;
5289
5293
  }
5290
5294
  const overwriteFunc = shallow ? import_utils17.overwriteShallow : import_utils17.overwriteDeep;
5295
+ if (options.overwrite === "shallow-once")
5296
+ options.overwrite = true;
5291
5297
  overwriteFunc(state, obj, import_ignore.IGNORE_STATE_PARAMS);
5292
5298
  };
5293
5299
  var hoistStateUpdate = (state, obj, options) => {
@@ -5313,13 +5319,13 @@ var require_updateState = __commonJS({
5313
5319
  targetParent.update(changesValue, {
5314
5320
  execStateFunction: false,
5315
5321
  isHoisted: true,
5316
- ...options,
5317
5322
  preventUpdate: options.preventHoistElementUpdate,
5318
- overwrite: !options.replace
5323
+ overwrite: !options.replace,
5324
+ ...options
5319
5325
  });
5320
5326
  const hasNotUpdated = options.preventUpdate !== true || !options.preventHoistElementUpdate;
5321
5327
  if (!options.preventStateUpdateListener && hasNotUpdated) {
5322
- (0, import_event.triggerEventOnUpdate)("stateUpdated", obj, element, options);
5328
+ (0, import_event.triggerEventOnUpdate)("stateUpdate", obj, element, options);
5323
5329
  }
5324
5330
  return true;
5325
5331
  };
@@ -6889,7 +6895,7 @@ var Collection = {
6889
6895
  }
6890
6896
  return data;
6891
6897
  },
6892
- $setStateCollection: (param, el, state) => {
6898
+ $stateCollection: (param, el, state) => {
6893
6899
  if (!param)
6894
6900
  return;
6895
6901
  if ((0, import_utils4.isString)(param)) {
@@ -6929,7 +6935,7 @@ var Collection = {
6929
6935
  el.content = obj;
6930
6936
  return obj;
6931
6937
  },
6932
- $setPropsCollection: (param, el, state) => {
6938
+ $propsCollection: (param, el, state) => {
6933
6939
  if (!param)
6934
6940
  return;
6935
6941
  if ((0, import_utils4.isString)(param)) {
@@ -9254,8 +9260,8 @@ var CommonFieldTemplate = {
9254
9260
 
9255
9261
  // Field/Field.js
9256
9262
  var Field = {
9263
+ extend: "Flex",
9257
9264
  tag: "label",
9258
- extend: [Focusable, IconText],
9259
9265
  props: {
9260
9266
  minWidth: "F2+Z2",
9261
9267
  maxWidth: "F2+Z2",
@@ -9263,14 +9269,10 @@ var Field = {
9263
9269
  align: "center flex-start",
9264
9270
  gap: "Y",
9265
9271
  boxSizing: "border-box",
9266
- padding: "- A - Z2",
9267
- round: "Z1",
9268
- border: "solid, gray .45 +80",
9269
- borderWidth: ".8px",
9270
9272
  position: "relative",
9271
- ":focus-within": { outline: "1px solid #0474F2" },
9272
- Icon: {
9273
- fontSize: "Z2"
9273
+ Input: {
9274
+ padding: "Z2 B2 Z2 B",
9275
+ flex: "1"
9274
9276
  },
9275
9277
  Button: {
9276
9278
  padding: "0",
@@ -9280,19 +9282,15 @@ var Field = {
9280
9282
  }
9281
9283
  },
9282
9284
  Input: {
9283
- props: {
9284
- fontWeight: "400",
9285
- padding: "0",
9286
- background: "rgba(0, 0, 0, 0)",
9287
- round: "0",
9288
- color: "title",
9289
- fontFamily: "avenir",
9290
- placeholder: "Placeholder",
9291
- flex: "1",
9292
- minHeight: "100%",
9293
- outline: "none !important",
9294
- "::placeholder": { color: "gray 1 +64" }
9295
- }
9285
+ placeholder: "Placeholder"
9286
+ },
9287
+ Icon: {
9288
+ props: ({ parent }) => ({
9289
+ name: parent.props.icon,
9290
+ minWidth: "A",
9291
+ margin: "- Z1 - -C",
9292
+ position: "relative"
9293
+ })
9296
9294
  }
9297
9295
  };
9298
9296
  var FieldTemplate = {
@@ -9348,25 +9346,35 @@ var FieldWithTitleTemplate = {
9348
9346
 
9349
9347
  // Field/Search.js
9350
9348
  var Search = {
9351
- extend: Field,
9352
9349
  tag: "search",
9353
9350
  props: {
9354
9351
  maxWidth: "G3",
9355
9352
  gap: "Z",
9356
- theme: "dialog",
9357
- padding: "Z+V Z+V2"
9353
+ onSubmit: (ev, el, s) => {
9354
+ }
9358
9355
  },
9359
9356
  Form: {
9360
- SquareButton: {
9361
- name: "search",
9362
- color: "title",
9363
- margin: "V - - -"
9357
+ extend: "Field",
9358
+ props: {
9359
+ flow: "row-reverse",
9360
+ Input: {
9361
+ padding: "Z2 B Z2 C"
9362
+ },
9363
+ Icon: {
9364
+ margin: "- -C - Z1",
9365
+ name: "search"
9366
+ }
9364
9367
  },
9365
9368
  Input: {
9366
9369
  props: {
9367
- placeholder: "type a command or search",
9370
+ type: "search",
9371
+ placeholder: "Search",
9368
9372
  "::placeholder": { color: "paragraph" }
9369
9373
  }
9374
+ },
9375
+ Icon: {},
9376
+ on: {
9377
+ submit: (ev, el, s) => el.parent.props.onSubmit(ev, el, s)
9370
9378
  }
9371
9379
  }
9372
9380
  };
@@ -9815,9 +9823,8 @@ var Input = {
9815
9823
  theme: "field",
9816
9824
  fontSize: "A",
9817
9825
  round: "C",
9818
- lineHeight: 1,
9819
- fontFamily: "smbls",
9820
- padding: "Z A"
9826
+ lineHeight: "1",
9827
+ padding: "Z2 B"
9821
9828
  },
9822
9829
  attr: {
9823
9830
  pattern: ({ props: props4 }) => props4.pattern,
@@ -10000,12 +10007,13 @@ var Textarea = {
10000
10007
  round: "Z1",
10001
10008
  placeholder: "Leave us a message...",
10002
10009
  padding: "A",
10003
- theme: "transparent",
10010
+ theme: "field",
10004
10011
  border: "none",
10005
10012
  maxWidth: "G1_default",
10006
10013
  minHeight: "E_default",
10007
10014
  width: "100%",
10008
10015
  height: "E1_default",
10016
+ fontFamily: "inherit",
10009
10017
  style: { resize: "none" }
10010
10018
  },
10011
10019
  ".simple": {
@@ -10017,10 +10025,11 @@ var Textarea = {
10017
10025
  },
10018
10026
  ".outlined": {
10019
10027
  props: {
10020
- background: "transparent",
10028
+ theme: "field",
10029
+ borderWidth: "1px",
10030
+ borderStyle: "solid",
10021
10031
  lineHeight: 1.4,
10022
10032
  placeholder: "Leave us a message...",
10023
- outline: "none !important",
10024
10033
  resize: "none"
10025
10034
  }
10026
10035
  }
@@ -10087,7 +10096,8 @@ var Button = {
10087
10096
  textDecoration: "none",
10088
10097
  lineHeight: "1",
10089
10098
  whiteSpace: "nowrap",
10090
- padding: "Z A1",
10099
+ padding: "Z B2",
10100
+ fontWeight: "500",
10091
10101
  fontFamily: "inherit",
10092
10102
  round: "C2"
10093
10103
  },
@@ -10123,12 +10133,11 @@ var FlexButton = {
10123
10133
  boxSize: "fit-content",
10124
10134
  padding: "Z2 A2",
10125
10135
  round: "Z1",
10126
- gap: "X1",
10127
- position: "relative"
10128
- },
10129
- Icon: {
10130
- props: { fontSize: "B1" }
10136
+ gap: "Z",
10137
+ position: "relative",
10138
+ Icon: { fontSize: "B1" }
10131
10139
  },
10140
+ Icon: {},
10132
10141
  Text: { text: "Button" }
10133
10142
  };
10134
10143
  var ButtonSet = {
@@ -10392,16 +10401,40 @@ var props = {
10392
10401
  }
10393
10402
  }
10394
10403
  };
10395
- var Range = {
10396
- props,
10397
- tag: "input",
10398
- attr: { type: "range" }
10399
- };
10400
10404
  var returnPropertyValue = (el, property, def) => {
10401
10405
  const val = el.props && el.props[property];
10402
- const r = (0, import_utils14.isFunction)(val) ? val(el, el.state) : val !== void 0 ? val : def !== void 0 ? def : 50;
10406
+ const r = (0, import_utils14.isFunction)(val) ? val(el, el.state) : val !== void 0 ? val : def !== void 0 ? def : 0;
10403
10407
  return r + "";
10404
10408
  };
10409
+ var Range = {
10410
+ props,
10411
+ tag: "input",
10412
+ attr: {
10413
+ type: "range",
10414
+ value: (el, s) => parseFloat(el.state.value || el.props.value || el.props.defaultValue),
10415
+ min: (el, s) => returnPropertyValue(el, "min", 0),
10416
+ max: (el, s) => returnPropertyValue(el, "max", 100),
10417
+ step: (el, s) => returnPropertyValue(el, "step", 1)
10418
+ },
10419
+ on: {
10420
+ input: (ev, el, s) => {
10421
+ const props4 = el.props;
10422
+ if ((0, import_utils14.isFunction)(props4.onInput)) {
10423
+ props4.onInput(ev, el, s);
10424
+ } else {
10425
+ s.update({ value: parseFloat(el.node.value) });
10426
+ }
10427
+ },
10428
+ change: (ev, el, s) => {
10429
+ const props4 = el.props;
10430
+ if ((0, import_utils14.isFunction)(props4.onChange)) {
10431
+ props4.onChange(ev, el, s);
10432
+ } else {
10433
+ s.update({ value: parseFloat(el.node.value) });
10434
+ }
10435
+ }
10436
+ }
10437
+ };
10405
10438
  var RangeWithButtons = {
10406
10439
  minus: {
10407
10440
  extend: SquareButton,
@@ -10427,13 +10460,13 @@ var RangeWithButtons = {
10427
10460
  tag: "span",
10428
10461
  text: ({ state, parent }) => {
10429
10462
  const unit = returnPropertyValue(parent, "unit", "");
10430
- return "" + (state.value || 50) + unit;
10463
+ return "" + (state.value || state.defaultValue || 0) + unit;
10431
10464
  }
10432
10465
  },
10433
10466
  input: {
10434
10467
  extend: Range,
10435
10468
  attr: {
10436
- value: (el, s) => parseFloat(el.state.value),
10469
+ value: (el, s) => parseFloat(s.value || s.defaultValue),
10437
10470
  min: (el, s) => returnPropertyValue(el.parent, "min", 0),
10438
10471
  max: (el, s) => returnPropertyValue(el.parent, "max", 100),
10439
10472
  step: (el, s) => returnPropertyValue(el.parent, "step", 1)
@@ -10654,7 +10687,7 @@ var AvatarBundle = {
10654
10687
  }
10655
10688
  },
10656
10689
  childExtend: Avatar,
10657
- $setPropsCollection: ({ props: props4 }) => props4.options
10690
+ $propsCollection: ({ props: props4 }) => props4.options
10658
10691
  };
10659
10692
 
10660
10693
  // Avatar/AvatarChooser.js
@@ -10695,7 +10728,7 @@ var AvatarChooser = {
10695
10728
  }
10696
10729
  },
10697
10730
  childExtend: { tag: "option" },
10698
- $setPropsCollection: ({ parent, state }) => {
10731
+ $propsCollection: ({ parent, state }) => {
10699
10732
  if (!parent.props.options)
10700
10733
  return [];
10701
10734
  return parent.props.options.map((v) => {
@@ -10906,7 +10939,7 @@ var Pills = {
10906
10939
  }
10907
10940
  }
10908
10941
  },
10909
- $setPropsCollection: ({ props: props4, state }) => new Array(props4.qty).fill({})
10942
+ $propsCollection: ({ props: props4, state }) => new Array(props4.qty).fill({})
10910
10943
  };
10911
10944
 
10912
10945
  // Tab/index.js
@@ -10917,6 +10950,8 @@ var Tab = {
10917
10950
  align: "center flex-start",
10918
10951
  position: "relative",
10919
10952
  padding: "Z Z1",
10953
+ theme: "field",
10954
+ borderRadius: "A A X2 X2",
10920
10955
  icon: "smile"
10921
10956
  },
10922
10957
  Icon: {},
@@ -11541,7 +11576,7 @@ var DropdownList = {
11541
11576
  }
11542
11577
  })
11543
11578
  },
11544
- $setPropsCollection: ({ props: props4 }) => props4.options
11579
+ $propsCollection: ({ props: props4 }) => props4.options
11545
11580
  };
11546
11581
  var DropdownParent = {
11547
11582
  props: {